diff --git a/bizmatch-server/src/select-options/select-options.service.ts b/bizmatch-server/src/select-options/select-options.service.ts index 49f7678..1f2c4f3 100644 --- a/bizmatch-server/src/select-options/select-options.service.ts +++ b/bizmatch-server/src/select-options/select-options.service.ts @@ -21,12 +21,12 @@ export class SelectOptionsService { ]; public typesOfCommercialProperty: Array = [ { name: 'Retail', value: '100', icon: 'fa-solid fa-money-bill-wave', textColorClass: 'text-pink-400' }, - { name: 'Land', value: '101', icon: 'pi pi-building', textColorClass: 'text-blue-400' }, + { name: 'Land', value: '101', icon: 'fa-solid fa-building', textColorClass: 'text-blue-400' }, { name: 'Industrial', value: '102', icon: 'fa-solid fa-industry', textColorClass: 'text-yellow-400' }, { name: 'Office', value: '103', icon: 'fa-solid fa-umbrella', textColorClass: 'text-teal-400' }, { name: 'Mixed Use', value: '104', icon: 'fa-solid fa-rectangle-ad', textColorClass: 'text-orange-400' }, - { name: 'Multifamily', value: '105', icon: 'pi pi-star', textColorClass: 'text-purple-400' }, - { name: 'Uncategorized', value: '106', icon: 'pi pi-question', textColorClass: 'text-cyan-400' }, + { name: 'Multifamily', value: '105', icon: 'fa-solid fa-star', textColorClass: 'text-purple-400' }, + { name: 'Uncategorized', value: '106', icon: 'fa-solid fa-question', textColorClass: 'text-cyan-400' }, ]; public prices: Array = [ { name: '$100K', value: '100000' }, diff --git a/bizmatch/package.json b/bizmatch/package.json index cbd53eb..6cba5a2 100644 --- a/bizmatch/package.json +++ b/bizmatch/package.json @@ -13,53 +13,51 @@ }, "private": true, "dependencies": { - "@angular/animations": "^17.3.3", - "@angular/cdk": "^17.3.2", - "@angular/common": "^17.3.3", - "@angular/compiler": "^17.3.3", - "@angular/core": "^17.3.3", - "@angular/forms": "^17.3.3", - "@angular/platform-browser": "^17.3.3", - "@angular/platform-browser-dynamic": "^17.3.3", - "@angular/platform-server": "^17.3.3", - "@angular/router": "^17.3.3", - "@fortawesome/angular-fontawesome": "^0.14.1", - "@fortawesome/fontawesome-free": "^6.5.1", - "@fortawesome/fontawesome-svg-core": "^6.5.1", - "@fortawesome/free-brands-svg-icons": "^6.5.1", - "@fortawesome/free-regular-svg-icons": "^6.5.1", - "@fortawesome/free-solid-svg-icons": "^6.5.1", - "@ng-select/ng-select": "^12.0.7", - "@types/uuid": "^9.0.8", + "@angular/animations": "^18.0.6", + "@angular/cdk": "^18.0.6", + "@angular/common": "^18.0.6", + "@angular/compiler": "^18.0.6", + "@angular/core": "^18.0.6", + "@angular/forms": "^18.0.6", + "@angular/platform-browser": "^18.0.6", + "@angular/platform-browser-dynamic": "^18.0.6", + "@angular/platform-server": "^18.0.6", + "@angular/router": "^18.0.6", + "@fortawesome/angular-fontawesome": "^0.15.0", + "@fortawesome/fontawesome-free": "^6.5.2", + "@fortawesome/fontawesome-svg-core": "^6.5.2", + "@fortawesome/free-brands-svg-icons": "^6.5.2", + "@fortawesome/free-regular-svg-icons": "^6.5.2", + "@fortawesome/free-solid-svg-icons": "^6.5.2", + "@ng-select/ng-select": "^13.4.1", + "@types/uuid": "^10.0.0", "angular-cropperjs": "^14.0.1", "angular-mixed-cdk-drag-drop": "^2.2.3", "browser-bunyan": "^1.8.0", - "cropperjs": "^1.6.1", + "cropperjs": "^1.6.2", "dayjs": "^1.11.11", "express": "^4.18.2", "flowbite": "^2.4.1", "jwt-decode": "^4.0.0", - "keycloak-angular": "^15.2.1", - "keycloak-js": "^24.0.4", + "keycloak-angular": "^16.0.1", + "keycloak-js": "^25.0.1", "memoize-one": "^6.0.0", - "ngx-quill": "^25.3.2", + "ngx-currency": "^18.0.0", + "ngx-quill": "^26.0.5", "on-change": "^5.0.1", - "primeflex": "^3.3.1", - "primeicons": "^6.0.1", - "primeng": "^17.16.1", "rxjs": "~7.8.1", - "tslib": "^2.3.0", + "tslib": "^2.6.3", "urlcat": "^3.1.0", - "uuid": "^9.0.1", - "zone.js": "~0.14.4" + "uuid": "^10.0.0", + "zone.js": "~0.14.7" }, "devDependencies": { - "@angular-devkit/build-angular": "^17.3.3", - "@angular/cli": "^17.3.3", - "@angular/compiler-cli": "^17.3.3", + "@angular-devkit/build-angular": "^18.0.7", + "@angular/cli": "^18.0.7", + "@angular/compiler-cli": "^18.0.6", "@types/express": "^4.17.21", "@types/jasmine": "~5.1.4", - "@types/node": "^20.11.20", + "@types/node": "^20.14.9", "autoprefixer": "^10.4.19", "http-server": "^14.1.1", "jasmine-core": "~5.1.2", diff --git a/bizmatch/src/app/app.component.html b/bizmatch/src/app/app.component.html index 13721d3..a676a41 100644 --- a/bizmatch/src/app/app.component.html +++ b/bizmatch/src/app/app.component.html @@ -25,7 +25,7 @@ @if (loadingService.isLoading$ | async) {
- +
{{ loadingText }}
diff --git a/bizmatch/src/app/app.component.ts b/bizmatch/src/app/app.component.ts index b53fd33..9d1e9e5 100644 --- a/bizmatch/src/app/app.component.ts +++ b/bizmatch/src/app/app.component.ts @@ -4,9 +4,7 @@ import { ActivatedRoute, NavigationEnd, Router, RouterOutlet } from '@angular/ro import { initFlowbite } from 'flowbite'; import { KeycloakService } from 'keycloak-angular'; import onChange from 'on-change'; -import { ConfirmationService } from 'primeng/api'; -import { ConfirmDialogModule } from 'primeng/confirmdialog'; -import { ProgressSpinnerModule } from 'primeng/progressspinner'; + import { filter } from 'rxjs/operators'; import { ListingCriteria } from '../../../bizmatch-server/src/models/main.model'; import build from '../build'; @@ -18,8 +16,8 @@ import { createDefaultListingCriteria } from './utils/utils'; @Component({ selector: 'app-root', standalone: true, - imports: [CommonModule, RouterOutlet, HeaderComponent, ProgressSpinnerModule, FooterComponent, ConfirmDialogModule], - providers: [ConfirmationService], + imports: [CommonModule, RouterOutlet, HeaderComponent, FooterComponent], + providers: [], templateUrl: './app.component.html', styleUrl: './app.component.scss', }) @@ -30,14 +28,7 @@ export class AppComponent { listingCriteria: ListingCriteria = onChange(createDefaultListingCriteria(), (path, value, previousValue, applyData) => { sessionStorage.setItem('criteria', JSON.stringify(value)); }); - public constructor( - public loadingService: LoadingService, - private router: Router, - private activatedRoute: ActivatedRoute, - private keycloakService: KeycloakService, - private userService: UserService, - private confirmationService: ConfirmationService, - ) { + public constructor(public loadingService: LoadingService, private router: Router, private activatedRoute: ActivatedRoute, private keycloakService: KeycloakService, private userService: UserService) { this.router.events.pipe(filter(event => event instanceof NavigationEnd)).subscribe(() => { let currentRoute = this.activatedRoute.root; while (currentRoute.children[0] !== undefined) { @@ -57,13 +48,13 @@ export class AppComponent { } showVersionDialog() { - this.confirmationService.confirm({ - target: event.target as EventTarget, - message: `App Version: ${this.build.timestamp}`, - header: 'Version Info', - icon: 'pi pi-info-circle', - accept: () => {}, - reject: () => {}, - }); + // this.confirmationService.confirm({ + // target: event.target as EventTarget, + // message: `App Version: ${this.build.timestamp}`, + // header: 'Version Info', + // icon: 'pi pi-info-circle', + // accept: () => {}, + // reject: () => {}, + // }); } } diff --git a/bizmatch/src/app/app.config.ts b/bizmatch/src/app/app.config.ts index 14ea129..414ee50 100644 --- a/bizmatch/src/app/app.config.ts +++ b/bizmatch/src/app/app.config.ts @@ -55,7 +55,13 @@ export const appConfig: ApplicationConfig = { provideQuillConfig({ modules: { syntax: true, - toolbar: [['bold', 'italic', 'underline', 'strike'], [{ list: 'ordered' }, { list: 'bullet' }], [{ header: [1, 2, 3, 4, 5, 6, false] }], [{ color: [] }, { background: [] }], ['clean']], + toolbar: [ + ['bold', 'italic', 'underline'], // Einige Standardoptionen + [{ header: [1, 2, 3, false] }], // Benutzerdefinierte Header + [{ list: 'ordered' }, { list: 'bullet' }], + [{ color: [] }], // Dropdown mit Standardfarben + ['clean'], // Entfernt Formatierungen + ], }, }), ], diff --git a/bizmatch/src/app/components/footer/footer.component.ts b/bizmatch/src/app/components/footer/footer.component.ts index 1c142f9..d364b88 100644 --- a/bizmatch/src/app/components/footer/footer.component.ts +++ b/bizmatch/src/app/components/footer/footer.component.ts @@ -1,11 +1,13 @@ +import { CommonModule } from '@angular/common'; import { Component } from '@angular/core'; +import { FormsModule } from '@angular/forms'; +import { RouterModule } from '@angular/router'; +import { FontAwesomeModule } from '@fortawesome/angular-fontawesome'; import { initFlowbite } from 'flowbite'; -import { SidebarModule } from 'primeng/sidebar'; -import { SharedModule } from '../../shared/shared/shared.module'; @Component({ selector: 'app-footer', standalone: true, - imports: [SharedModule, SidebarModule], + imports: [CommonModule, FormsModule, RouterModule, FontAwesomeModule], templateUrl: './footer.component.html', styleUrl: './footer.component.scss', }) diff --git a/bizmatch/src/app/components/header/header.component.html b/bizmatch/src/app/components/header/header.component.html index 68d7003..19a460f 100644 --- a/bizmatch/src/app/components/header/header.component.html +++ b/bizmatch/src/app/components/header/header.component.html @@ -87,18 +87,30 @@ class="flex flex-col font-medium p-4 md:p-0 mt-4 border border-gray-100 rounded-lg bg-gray-50 md:space-x-8 rtl:space-x-reverse md:flex-row md:mt-0 md:border-0 md:bg-white dark:bg-gray-800 md:dark:bg-gray-900 dark:border-gray-700" >
  • - Businesses + Businesses
  • Properties
  • Professionals
  • diff --git a/bizmatch/src/app/components/header/header.component.ts b/bizmatch/src/app/components/header/header.component.ts index 23363db..7b6b6d7 100644 --- a/bizmatch/src/app/components/header/header.component.ts +++ b/bizmatch/src/app/components/header/header.component.ts @@ -1,14 +1,9 @@ import { CommonModule } from '@angular/common'; import { Component } from '@angular/core'; -import { Router } from '@angular/router'; +import { Router, RouterModule } from '@angular/router'; import { faUserGear } from '@fortawesome/free-solid-svg-icons'; import { initFlowbite } from 'flowbite'; import { KeycloakService } from 'keycloak-angular'; -import { MenuItem } from 'primeng/api'; -import { ButtonModule } from 'primeng/button'; -import { MenubarModule } from 'primeng/menubar'; -import { OverlayPanelModule } from 'primeng/overlaypanel'; -import { TabMenuModule } from 'primeng/tabmenu'; import { Observable } from 'rxjs'; import { KeycloakUser } from '../../../../../bizmatch-server/src/models/main.model'; import { environment } from '../../../environments/environment'; @@ -16,7 +11,7 @@ import { map2User } from '../../utils/utils'; @Component({ selector: 'header', standalone: true, - imports: [CommonModule, MenubarModule, ButtonModule, OverlayPanelModule, TabMenuModule], + imports: [CommonModule, RouterModule], templateUrl: './header.component.html', styleUrl: './header.component.scss', }) @@ -24,9 +19,6 @@ export class HeaderComponent { public buildVersion = environment.buildVersion; user$: Observable; user: KeycloakUser; - public tabItems: MenuItem[]; - public loginItems: MenuItem[]; - public menuItems: MenuItem[]; activeItem; faUserGear = faUserGear; constructor(public keycloakService: KeycloakService, private router: Router) {} @@ -52,4 +44,7 @@ export class HeaderComponent { register() { this.keycloakService.register({ redirectUri: `${window.location.origin}/account` }); } + isActive(route: string): boolean { + return this.router.url === route; + } } diff --git a/bizmatch/src/app/components/image-cropper/image-cropper.component.html b/bizmatch/src/app/components/image-cropper/image-cropper.component.html index 3371953..ff40dc9 100644 --- a/bizmatch/src/app/components/image-cropper/image-cropper.component.html +++ b/bizmatch/src/app/components/image-cropper/image-cropper.component.html @@ -2,13 +2,13 @@
    @if(ratioVariable){
    - +
    } @else {
    }
    - - +
    diff --git a/bizmatch/src/app/components/image-cropper/image-cropper.component.ts b/bizmatch/src/app/components/image-cropper/image-cropper.component.ts index e30c17c..29e91a6 100644 --- a/bizmatch/src/app/components/image-cropper/image-cropper.component.ts +++ b/bizmatch/src/app/components/image-cropper/image-cropper.component.ts @@ -1,8 +1,5 @@ import { Component, ViewChild } from '@angular/core'; import { AngularCropperjsModule, CropperComponent } from 'angular-cropperjs'; -import { DynamicDialogConfig, DynamicDialogRef } from 'primeng/dynamicdialog'; -import { FileUpload, FileUploadModule } from 'primeng/fileupload'; -import { SelectButtonModule } from 'primeng/selectbutton'; import { KeyValueRatio } from '../../../../../bizmatch-server/src/models/main.model'; import { ImageService } from '../../services/image.service'; import { LoadingService } from '../../services/loading.service'; @@ -15,36 +12,35 @@ export const stateOptions: KeyValueRatio[] = [ @Component({ selector: 'app-image-cropper', standalone: true, - imports: [SharedModule, FileUploadModule, AngularCropperjsModule, SelectButtonModule], + imports: [SharedModule, AngularCropperjsModule], templateUrl: './image-cropper.component.html', styleUrl: './image-cropper.component.scss', }) export class ImageCropperComponent { @ViewChild(CropperComponent) public angularCropper: CropperComponent; imageUrl: string; //wird im Template verwendet - fileUpload: FileUpload; value: number = stateOptions[0].value; cropperConfig = { aspectRatio: this.value }; ratioVariable: boolean; stateOptions = stateOptions; - constructor(private loadingService: LoadingService, private imageUploadService: ImageService, public config: DynamicDialogConfig, public ref: DynamicDialogRef) {} - ngOnInit(): void { - if (this.config.data) { - this.imageUrl = this.config.data.imageUrl; - this.fileUpload = this.config.data.fileUpload; - this.cropperConfig = this.config.data.config ? this.config.data.config : this.cropperConfig; - this.ratioVariable = this.config.data.ratioVariable; - } - } - sendImage() { - this.fileUpload.clear(); - this.ref.close(this.angularCropper.cropper); - } + constructor(private loadingService: LoadingService, private imageUploadService: ImageService) {} + // ngOnInit(): void { + // if (this.config.data) { + // this.imageUrl = this.config.data.imageUrl; + // this.fileUpload = this.config.data.fileUpload; + // this.cropperConfig = this.config.data.config ? this.config.data.config : this.cropperConfig; + // this.ratioVariable = this.config.data.ratioVariable; + // } + // } + // sendImage() { + // this.fileUpload.clear(); + // this.ref.close(this.angularCropper.cropper); + // } - cancelUpload() { - this.fileUpload.clear(); - this.ref.close(); - } + // cancelUpload() { + // this.fileUpload.clear(); + // this.ref.close(); + // } changeAspectRation(ratio: number) { this.cropperConfig = { aspectRatio: ratio }; this.angularCropper.cropper.setAspectRatio(ratio); diff --git a/bizmatch/src/app/components/inputnumber/inputnumber.component.scss b/bizmatch/src/app/components/inputnumber/inputnumber.component.scss deleted file mode 100644 index 4f543e4..0000000 --- a/bizmatch/src/app/components/inputnumber/inputnumber.component.scss +++ /dev/null @@ -1,115 +0,0 @@ -// @layer primeng { - app-inputnumber, - .p-inputnumber { - display: inline-flex; - } - - .p-inputnumber-button { - display: flex; - align-items: center; - justify-content: center; - flex: 0 0 auto; - } - - .p-inputnumber-buttons-stacked .p-button.p-inputnumber-button .p-button-label, - .p-inputnumber-buttons-horizontal .p-button.p-inputnumber-button .p-button-label { - display: none; - } - - .p-inputnumber-buttons-stacked .p-button.p-inputnumber-button-up { - border-top-left-radius: 0; - border-bottom-left-radius: 0; - border-bottom-right-radius: 0; - padding: 0; - } - - .p-inputnumber-buttons-stacked .p-inputnumber-input { - border-top-right-radius: 0; - border-bottom-right-radius: 0; - } - - .p-inputnumber-buttons-stacked .p-button.p-inputnumber-button-down { - border-top-left-radius: 0; - border-top-right-radius: 0; - border-bottom-left-radius: 0; - padding: 0; - } - - .p-inputnumber-buttons-stacked .p-inputnumber-button-group { - display: flex; - flex-direction: column; - } - - .p-inputnumber-buttons-stacked .p-inputnumber-button-group .p-button.p-inputnumber-button { - flex: 1 1 auto; - } - - .p-inputnumber-buttons-horizontal .p-button.p-inputnumber-button-up { - order: 3; - border-top-left-radius: 0; - border-bottom-left-radius: 0; - } - - .p-inputnumber-buttons-horizontal .p-inputnumber-input { - order: 2; - border-radius: 0; - } - - .p-inputnumber-buttons-horizontal .p-button.p-inputnumber-button-down { - order: 1; - border-top-right-radius: 0; - border-bottom-right-radius: 0; - } - - .p-inputnumber-buttons-vertical { - flex-direction: column; - } - - .p-inputnumber-buttons-vertical .p-button.p-inputnumber-button-up { - order: 1; - border-bottom-left-radius: 0; - border-bottom-right-radius: 0; - width: 100%; - } - - .p-inputnumber-buttons-vertical .p-inputnumber-input { - order: 2; - border-radius: 0; - text-align: center; - } - - .p-inputnumber-buttons-vertical .p-button.p-inputnumber-button-down { - order: 3; - border-top-left-radius: 0; - border-top-right-radius: 0; - width: 100%; - } - - .p-inputnumber-input { - flex: 1 1 auto; - } - - .p-fluid app-inputnumber, - .p-fluid .p-inputnumber { - width: 100%; - } - - .p-fluid .p-inputnumber .p-inputnumber-input { - width: 1%; - } - - .p-fluid .p-inputnumber-buttons-vertical .p-inputnumber-input { - width: 100%; - } - - .p-inputnumber-clear-icon { - position: absolute; - top: 50%; - margin-top: -0.5rem; - cursor: pointer; - } - - .p-inputnumber-clearable { - position: relative; - } -// } \ No newline at end of file diff --git a/bizmatch/src/app/components/inputnumber/inputnumber.component.ts b/bizmatch/src/app/components/inputnumber/inputnumber.component.ts deleted file mode 100644 index dfae10f..0000000 --- a/bizmatch/src/app/components/inputnumber/inputnumber.component.ts +++ /dev/null @@ -1,1480 +0,0 @@ -import { CommonModule, DOCUMENT } from '@angular/common'; -import { - AfterContentInit, - ChangeDetectionStrategy, - ChangeDetectorRef, - Component, - ContentChildren, - ElementRef, - EventEmitter, - Inject, - Injector, - Input, - NgModule, - OnChanges, - OnInit, - Output, - QueryList, - SimpleChanges, - TemplateRef, - ViewChild, - ViewEncapsulation, - forwardRef -} from '@angular/core'; -import { ControlValueAccessor, FormsModule, NG_VALUE_ACCESSOR, NgControl } from '@angular/forms'; -import { PrimeTemplate, SharedModule } from 'primeng/api'; -import { ButtonModule } from 'primeng/button'; -import { DomHandler } from 'primeng/dom'; -import { AngleDownIcon } from 'primeng/icons/angledown'; -import { AngleUpIcon } from 'primeng/icons/angleup'; -import { TimesIcon } from 'primeng/icons/times'; -import { InputTextModule } from 'primeng/inputtext'; -import { Nullable } from 'primeng/ts-helpers'; - -/** - * Custom input event. - * @see {@link InputNumber.onInput} - * @group Events - */ -export interface InputNumberInputEvent { - /** - * Browser event. - */ - originalEvent: Event; - /** - * Input value. - */ - value: number; - /** - * Selected option value. - */ - formattedValue: string; -} - -/** - * Defines valid templates in InputNumber. - * @group Templates - */ -export interface InputNumberTemplates { - /** - * Custom clear icon template. - */ - clearicon(): TemplateRef; - /** - * Custom increment button icon template. - */ - incrementbuttonicon(): TemplateRef; - /** - * Custom decrement button icon template. - */ - decrementbuttonicon(): TemplateRef; -} -export const INPUTNUMBER_VALUE_ACCESSOR: any = { - provide: NG_VALUE_ACCESSOR, - useExisting: forwardRef(() => InputNumberComponent), - multi: true -}; -/** - * InputNumber is an input component to provide numerical input. - * @group Components - */ -@Component({ - selector: 'app-inputNumber', - template: ` - - - - - - - - - - - - - - - - `, - changeDetection: ChangeDetectionStrategy.OnPush, - providers: [INPUTNUMBER_VALUE_ACCESSOR], - encapsulation: ViewEncapsulation.None, - styleUrl: './inputnumber.component.scss', - host: { - class: 'p-element p-inputwrapper', - '[class.p-inputwrapper-filled]': 'filled', - '[class.p-inputwrapper-focus]': 'focused', - '[class.p-inputnumber-clearable]': 'showClear && buttonLayout != "vertical"' - } -}) -export class InputNumberComponent implements OnInit, AfterContentInit, OnChanges, ControlValueAccessor { - /** - * Displays spinner buttons. - * @group Props - */ - @Input() showButtons: boolean = false; - /** - * Whether to format the value. - * @group Props - */ - @Input() format: boolean = true; - /** - * Layout of the buttons, valid values are "stacked" (default), "horizontal" and "vertical". - * @group Props - */ - @Input() buttonLayout: string = 'stacked'; - /** - * Identifier of the focus input to match a label defined for the component. - * @group Props - */ - @Input() inputId: string | undefined; - /** - * Style class of the component. - * @group Props - */ - @Input() styleClass: string | undefined; - /** - * Inline style of the component. - * @group Props - */ - @Input() style: { [klass: string]: any } | null | undefined; - /** - * Advisory information to display on input. - * @group Props - */ - @Input() placeholder: string | undefined; - /** - * Size of the input field. - * @group Props - */ - @Input() size: number | undefined; - /** - * Maximum number of character allows in the input field. - * @group Props - */ - @Input() maxlength: number | undefined; - /** - * Specifies tab order of the element. - * @group Props - */ - @Input() tabindex: number | undefined; - /** - * Title text of the input text. - * @group Props - */ - @Input() title: string | undefined; - /** - * Specifies one or more IDs in the DOM that labels the input field. - * @group Props - */ - @Input() ariaLabelledBy: string | undefined; - /** - * Used to define a string that labels the input element. - * @group Props - */ - @Input() ariaLabel: string | undefined; - /** - * Used to indicate that user input is required on an element before a form can be submitted. - * @group Props - */ - @Input() ariaRequired: boolean | undefined; - /** - * Name of the input field. - * @group Props - */ - @Input() name: string | undefined; - /** - * Indicates that whether the input field is required. - * @group Props - */ - @Input() required: boolean | undefined; - /** - * Used to define a string that autocomplete attribute the current element. - * @group Props - */ - @Input() autocomplete: string | undefined; - /** - * Mininum boundary value. - * @group Props - */ - @Input() min: number | undefined; - /** - * Maximum boundary value. - * @group Props - */ - @Input() max: number | undefined; - /** - * Style class of the increment button. - * @group Props - */ - @Input() incrementButtonClass: string | undefined; - /** - * Style class of the decrement button. - * @group Props - */ - @Input() decrementButtonClass: string | undefined; - /** - * Style class of the increment button. - * @group Props - */ - @Input() incrementButtonIcon: string | undefined; - /** - * Style class of the decrement button. - * @group Props - */ - @Input() decrementButtonIcon: string | undefined; - /** - * When present, it specifies that an input field is read-only. - * @group Props - */ - @Input() readonly: boolean = false; - /** - * Step factor to increment/decrement the value. - * @group Props - */ - @Input() step: number = 1; - /** - * Determines whether the input field is empty. - * @group Props - */ - @Input() allowEmpty: boolean = true; - /** - * Locale to be used in formatting. - * @group Props - */ - @Input() locale: string | undefined; - /** - * The locale matching algorithm to use. Possible values are "lookup" and "best fit"; the default is "best fit". See Locale Negotiation for details. - * @group Props - */ - @Input() localeMatcher: string | undefined; - /** - * Defines the behavior of the component, valid values are "decimal" and "currency". - * @group Props - */ - @Input() mode: string = 'decimal'; - /** - * The currency to use in currency formatting. Possible values are the ISO 4217 currency codes, such as "USD" for the US dollar, "EUR" for the euro, or "CNY" for the Chinese RMB. There is no default value; if the style is "currency", the currency property must be provided. - * @group Props - */ - @Input() currency: string | undefined; - /** - * How to display the currency in currency formatting. Possible values are "symbol" to use a localized currency symbol such as €, ü"code" to use the ISO currency code, "name" to use a localized currency name such as "dollar"; the default is "symbol". - * @group Props - */ - @Input() currencyDisplay: string | undefined; - /** - * Whether to use grouping separators, such as thousands separators or thousand/lakh/crore separators. - * @group Props - */ - @Input() useGrouping: boolean = true; - /** - * The minimum number of fraction digits to use. Possible values are from 0 to 20; the default for plain number and percent formatting is 0; the default for currency formatting is the number of minor unit digits provided by the ISO 4217 currency code list (2 if the list doesn't provide that information). - * @group Props - */ - @Input() minFractionDigits: number | undefined; - /** - * The maximum number of fraction digits to use. Possible values are from 0 to 20; the default for plain number formatting is the larger of minimumFractionDigits and 3; the default for currency formatting is the larger of minimumFractionDigits and the number of minor unit digits provided by the ISO 4217 currency code list (2 if the list doesn't provide that information). - * @group Props - */ - @Input() maxFractionDigits: number | undefined; - /** - * Text to display before the value. - * @group Props - */ - @Input() prefix: string | undefined; - /** - * Text to display after the value. - * @group Props - */ - @Input() suffix: string | undefined; - /** - * Inline style of the input field. - * @group Props - */ - @Input() inputStyle: any; - /** - * Style class of the input field. - * @group Props - */ - @Input() inputStyleClass: string | undefined; - /** - * When enabled, a clear icon is displayed to clear the value. - * @group Props - */ - @Input() showClear: boolean = false; - /** - * When present, it specifies that the element should be disabled. - * @group Props - */ - @Input() get disabled(): boolean | undefined { - return this._disabled; - } - set disabled(disabled: boolean | undefined) { - if (disabled) this.focused = false; - - this._disabled = disabled; - - if (this.timer) this.clearTimer(); - } - /** - * Callback to invoke on input. - * @param {InputNumberInputEvent} event - Custom input event. - * @group Emits - */ - @Output() onInput: EventEmitter = new EventEmitter(); - /** - * Callback to invoke when the component receives focus. - * @param {Event} event - Browser event. - * @group Emits - */ - @Output() onFocus: EventEmitter = new EventEmitter(); - /** - * Callback to invoke when the component loses focus. - * @param {Event} event - Browser event. - * @group Emits - */ - @Output() onBlur: EventEmitter = new EventEmitter(); - /** - * Callback to invoke on input key press. - * @param {KeyboardEvent} event - Keyboard event. - * @group Emits - */ - @Output() onKeyDown: EventEmitter = new EventEmitter(); - /** - * Callback to invoke when clear token is clicked. - * @group Emits - */ - @Output() onClear: EventEmitter = new EventEmitter(); - - @ViewChild('input') input!: ElementRef; - - @ContentChildren(PrimeTemplate) templates!: QueryList; - - clearIconTemplate: Nullable>; - - incrementButtonIconTemplate: Nullable>; - - decrementButtonIconTemplate: Nullable>; - - value: Nullable; - - onModelChange: Function = () => {}; - - onModelTouched: Function = () => {}; - - focused: Nullable; - - initialized: Nullable; - - groupChar: string = ''; - - prefixChar: string = ''; - - suffixChar: string = ''; - - isSpecialChar: Nullable; - - timer: any; - - lastValue: Nullable; - - _numeral: any; - - numberFormat: any; - - _decimal: any; - - _decimalChar: string; - - _group: any; - - _minusSign: any; - - _currency: Nullable; - - _prefix: Nullable; - - _suffix: Nullable; - - _index: number | any; - - _disabled: boolean | undefined; - - private ngControl: NgControl | null = null; - - constructor(@Inject(DOCUMENT) private document: Document, public el: ElementRef, private cd: ChangeDetectorRef, private readonly injector: Injector) {} - - ngOnChanges(simpleChange: SimpleChanges) { - const props = ['locale', 'localeMatcher', 'mode', 'currency', 'currencyDisplay', 'useGrouping', 'minFractionDigits', 'maxFractionDigits', 'prefix', 'suffix']; - if (props.some((p) => !!simpleChange[p])) { - this.updateConstructParser(); - } - } - - ngAfterContentInit() { - this.templates.forEach((item) => { - switch (item.getType()) { - case 'clearicon': - this.clearIconTemplate = item.template; - break; - - case 'incrementbuttonicon': - this.incrementButtonIconTemplate = item.template; - break; - - case 'decrementbuttonicon': - this.decrementButtonIconTemplate = item.template; - break; - } - }); - } - - ngOnInit() { - this.ngControl = this.injector.get(NgControl, null, { optional: true }); - - this.constructParser(); - - this.initialized = true; - } - - getOptions() { - return { - localeMatcher: this.localeMatcher, - style: this.mode, - currency: this.currency, - currencyDisplay: this.currencyDisplay, - useGrouping: this.useGrouping, - minimumFractionDigits: this.minFractionDigits, - maximumFractionDigits: this.maxFractionDigits - }; - } - - constructParser() { - this.numberFormat = new Intl.NumberFormat(this.locale, this.getOptions()); - const numerals = [...new Intl.NumberFormat(this.locale, { useGrouping: false }).format(9876543210)].reverse(); - const index = new Map(numerals.map((d, i) => [d, i])); - this._numeral = new RegExp(`[${numerals.join('')}]`, 'g'); - this._group = this.getGroupingExpression(); - this._minusSign = this.getMinusSignExpression(); - this._currency = this.getCurrencyExpression(); - this._decimal = this.getDecimalExpression(); - this._decimalChar = this.getDecimalChar(); - this._suffix = this.getSuffixExpression(); - this._prefix = this.getPrefixExpression(); - this._index = (d: any) => index.get(d); - } - - updateConstructParser() { - if (this.initialized) { - this.constructParser(); - } - } - - escapeRegExp(text: string): string { - return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); - } - - getDecimalExpression(): RegExp { - const decimalChar = this.getDecimalChar(); - return new RegExp(`[${decimalChar}]`, 'g'); - } - getDecimalChar(): string { - const formatter = new Intl.NumberFormat(this.locale, { ...this.getOptions(), useGrouping: false }); - return formatter - .format(1.1) - .replace(this._currency as RegExp | string, '') - .trim() - .replace(this._numeral, ''); - } - - getGroupingExpression(): RegExp { - const formatter = new Intl.NumberFormat(this.locale, { useGrouping: true }); - this.groupChar = formatter.format(1000000).trim().replace(this._numeral, '').charAt(0); - return new RegExp(`[${this.groupChar}]`, 'g'); - } - - getMinusSignExpression(): RegExp { - const formatter = new Intl.NumberFormat(this.locale, { useGrouping: false }); - return new RegExp(`[${formatter.format(-1).trim().replace(this._numeral, '')}]`, 'g'); - } - - getCurrencyExpression(): RegExp { - if (this.currency) { - const formatter = new Intl.NumberFormat(this.locale, { style: 'currency', currency: this.currency, currencyDisplay: this.currencyDisplay, minimumFractionDigits: 0, maximumFractionDigits: 0 }); - return new RegExp(`[${formatter.format(1).replace(/\s/g, '').replace(this._numeral, '').replace(this._group, '')}]`, 'g'); - } - - return new RegExp(`[]`, 'g'); - } - - getPrefixExpression(): RegExp { - if (this.prefix) { - this.prefixChar = this.prefix; - } else { - const formatter = new Intl.NumberFormat(this.locale, { style: this.mode, currency: this.currency, currencyDisplay: this.currencyDisplay }); - this.prefixChar = formatter.format(1).split('1')[0]; - } - - return new RegExp(`${this.escapeRegExp(this.prefixChar || '')}`, 'g'); - } - - getSuffixExpression(): RegExp { - if (this.suffix) { - this.suffixChar = this.suffix; - } else { - const formatter = new Intl.NumberFormat(this.locale, { style: this.mode, currency: this.currency, currencyDisplay: this.currencyDisplay, minimumFractionDigits: 0, maximumFractionDigits: 0 }); - this.suffixChar = formatter.format(1).split('1')[1]; - } - - return new RegExp(`${this.escapeRegExp(this.suffixChar || '')}`, 'g'); - } - - formatValue(value: any) { - if (value != null) { - if (value === '-') { - // Minus sign - return value; - } - - if (this.format) { - let formatter = new Intl.NumberFormat(this.locale, this.getOptions()); - let formattedValue = formatter.format(value); - if (this.prefix) { - formattedValue = this.prefix + formattedValue; - } - - if (this.suffix) { - formattedValue = formattedValue + this.suffix; - } - - return formattedValue; - } - - return value.toString(); - } - - return ''; - } - - parseValue(text: any) { - let filteredText = text - .replace(this._suffix as RegExp, '') - .replace(this._prefix as RegExp, '') - .trim() - .replace(/\s/g, '') - .replace(this._currency as RegExp, '') - .replace(this._group, '') - .replace(this._minusSign, '-') - .replace(this._decimal, '.') - .replace(this._numeral, this._index); - - if (filteredText) { - if (filteredText === '-') - // Minus sign - return filteredText; - - let parsedValue = +filteredText; - return isNaN(parsedValue) ? null : parsedValue; - } - - return null; - } - - repeat(event: Event, interval: number | null, dir: number) { - if (this.readonly) { - return; - } - - let i = interval || 500; - - this.clearTimer(); - this.timer = setTimeout(() => { - this.repeat(event, 40, dir); - }, i); - - this.spin(event, dir); - } - - spin(event: Event, dir: number) { - let step = this.step * dir; - let currentValue = this.parseValue(this.input?.nativeElement.value) || 0; - let newValue = this.validateValue((currentValue as number) + step); - if (this.maxlength && this.maxlength < this.formatValue(newValue).length) { - return; - } - this.updateInput(newValue, null, 'spin', null); - this.updateModel(event, newValue); - - this.handleOnInput(event, currentValue, newValue); - } - - clear() { - this.value = null; - this.onModelChange(this.value); - this.onClear.emit(); - } - - onUpButtonMouseDown(event: MouseEvent) { - if (event.button === 2) { - this.clearTimer(); - return; - } - - if (!this.disabled) { - this.input?.nativeElement.focus(); - this.repeat(event, null, 1); - event.preventDefault(); - } - } - - onUpButtonMouseUp() { - if (!this.disabled) { - this.clearTimer(); - } - } - - onUpButtonMouseLeave() { - if (!this.disabled) { - this.clearTimer(); - } - } - - onUpButtonKeyDown(event: KeyboardEvent) { - if (event.keyCode === 32 || event.keyCode === 13) { - this.repeat(event, null, 1); - } - } - - onUpButtonKeyUp() { - if (!this.disabled) { - this.clearTimer(); - } - } - - onDownButtonMouseDown(event: MouseEvent) { - if (event.button === 2) { - this.clearTimer(); - return; - } - if (!this.disabled) { - this.input?.nativeElement.focus(); - this.repeat(event, null, -1); - event.preventDefault(); - } - } - - onDownButtonMouseUp() { - if (!this.disabled) { - this.clearTimer(); - } - } - - onDownButtonMouseLeave() { - if (!this.disabled) { - this.clearTimer(); - } - } - - onDownButtonKeyUp() { - if (!this.disabled) { - this.clearTimer(); - } - } - - onDownButtonKeyDown(event: KeyboardEvent) { - if (event.keyCode === 32 || event.keyCode === 13) { - this.repeat(event, null, -1); - } - } - - onUserInput(event: Event) { - if (this.readonly) { - return; - } - - if (this.isSpecialChar) { - (event.target as HTMLInputElement).value = this.lastValue as string; - } - this.isSpecialChar = false; - } - - onInputKeyDown(event: KeyboardEvent) { - if (this.readonly) { - return; - } - - this.lastValue = (event.target as HTMLInputElement).value; - if ((event as KeyboardEvent).shiftKey || (event as KeyboardEvent).altKey) { - this.isSpecialChar = true; - return; - } - - let selectionStart = (event.target as HTMLInputElement).selectionStart as number; - let selectionEnd = (event.target as HTMLInputElement).selectionEnd as number; - let inputValue = (event.target as HTMLInputElement).value as string; - let newValueStr = null; - - if (event.altKey) { - event.preventDefault(); - } - - switch (event.code) { - case 'ArrowUp': - this.spin(event, 1); - event.preventDefault(); - break; - - case 'ArrowDown': - this.spin(event, -1); - event.preventDefault(); - break; - - case 'ArrowLeft': - for (let index = selectionStart; index <= inputValue.length; index++) { - const previousCharIndex = index === 0 ? 0 : index - 1; - if (this.isNumeralChar(inputValue.charAt(previousCharIndex))) { - this.input.nativeElement.setSelectionRange(index, index); - break; - } - } - break; - - case 'ArrowRight': - for (let index = selectionEnd; index >= 0; index--) { - if (this.isNumeralChar(inputValue.charAt(index))) { - this.input.nativeElement.setSelectionRange(index, index); - break; - } - } - break; - - case 'Tab': - case 'Enter': - newValueStr = this.validateValue(this.parseValue(this.input.nativeElement.value)); - this.input.nativeElement.value = this.formatValue(newValueStr); - this.input.nativeElement.setAttribute('aria-valuenow', newValueStr); - this.updateModel(event, newValueStr); - break; - - case 'Backspace': { - event.preventDefault(); - - if (selectionStart === selectionEnd) { - const deleteChar = inputValue.charAt(selectionStart - 1); - const { decimalCharIndex, decimalCharIndexWithoutPrefix } = this.getDecimalCharIndexes(inputValue); - - if (this.isNumeralChar(deleteChar)) { - const decimalLength = this.getDecimalLength(inputValue); - - if (this._group.test(deleteChar)) { - this._group.lastIndex = 0; - newValueStr = inputValue.slice(0, selectionStart - 2) + inputValue.slice(selectionStart - 1); - } else if (this._decimal.test(deleteChar)) { - this._decimal.lastIndex = 0; - - if (decimalLength) { - this.input?.nativeElement.setSelectionRange(selectionStart - 1, selectionStart - 1); - } else { - newValueStr = inputValue.slice(0, selectionStart - 1) + inputValue.slice(selectionStart); - } - } else if (decimalCharIndex > 0 && selectionStart > decimalCharIndex) { - const insertedText = this.isDecimalMode() && (this.minFractionDigits || 0) < decimalLength ? '' : '0'; - newValueStr = inputValue.slice(0, selectionStart - 1) + insertedText + inputValue.slice(selectionStart); - } else if (decimalCharIndexWithoutPrefix === 1) { - newValueStr = inputValue.slice(0, selectionStart - 1) + '0' + inputValue.slice(selectionStart); - newValueStr = (this.parseValue(newValueStr) as number) > 0 ? newValueStr : ''; - } else { - newValueStr = inputValue.slice(0, selectionStart - 1) + inputValue.slice(selectionStart); - } - } else if (this.mode === 'currency' && deleteChar.search(this._currency) != -1) { - newValueStr = inputValue.slice(1); - } - - this.updateValue(event, newValueStr, null, 'delete-single'); - } else { - newValueStr = this.deleteRange(inputValue, selectionStart, selectionEnd); - this.updateValue(event, newValueStr, null, 'delete-range'); - } - - break; - } - - case 'Delete': - event.preventDefault(); - - if (selectionStart === selectionEnd) { - const deleteChar = inputValue.charAt(selectionStart); - const { decimalCharIndex, decimalCharIndexWithoutPrefix } = this.getDecimalCharIndexes(inputValue); - - if (this.isNumeralChar(deleteChar)) { - const decimalLength = this.getDecimalLength(inputValue); - - if (this._group.test(deleteChar)) { - this._group.lastIndex = 0; - newValueStr = inputValue.slice(0, selectionStart) + inputValue.slice(selectionStart + 2); - } else if (this._decimal.test(deleteChar)) { - this._decimal.lastIndex = 0; - - if (decimalLength) { - this.input?.nativeElement.setSelectionRange(selectionStart + 1, selectionStart + 1); - } else { - newValueStr = inputValue.slice(0, selectionStart) + inputValue.slice(selectionStart + 1); - } - } else if (decimalCharIndex > 0 && selectionStart > decimalCharIndex) { - const insertedText = this.isDecimalMode() && (this.minFractionDigits || 0) < decimalLength ? '' : '0'; - newValueStr = inputValue.slice(0, selectionStart) + insertedText + inputValue.slice(selectionStart + 1); - } else if (decimalCharIndexWithoutPrefix === 1) { - newValueStr = inputValue.slice(0, selectionStart) + '0' + inputValue.slice(selectionStart + 1); - newValueStr = (this.parseValue(newValueStr) as number) > 0 ? newValueStr : ''; - } else { - newValueStr = inputValue.slice(0, selectionStart) + inputValue.slice(selectionStart + 1); - } - } - - this.updateValue(event, newValueStr as string, null, 'delete-back-single'); - } else { - newValueStr = this.deleteRange(inputValue, selectionStart, selectionEnd); - this.updateValue(event, newValueStr, null, 'delete-range'); - } - break; - - case 'Home': - if (this.min) { - this.updateModel(event, this.min); - event.preventDefault(); - } - break; - - case 'End': - if (this.max) { - this.updateModel(event, this.max); - event.preventDefault(); - } - break; - - default: - break; - } - - this.onKeyDown.emit(event); - } - - onInputKeyPress(event: KeyboardEvent) { - if (this.readonly) { - return; - } - - let code = event.which || event.keyCode; - let char = String.fromCharCode(code); - let isDecimalSign = this.isDecimalSign(char); - const isMinusSign = this.isMinusSign(char); - - if (code != 13) { - event.preventDefault(); - } - if (!isDecimalSign && event.code === 'NumpadDecimal') { - isDecimalSign = true; - char = this._decimalChar; - code = char.charCodeAt(0); - } - - const newValue = this.parseValue(this.input.nativeElement.value + char); - const newValueStr = newValue != null ? newValue.toString() : ''; - if (this.maxlength && newValueStr.length > this.maxlength) { - return; - } - - if ((48 <= code && code <= 57) || isMinusSign || isDecimalSign) { - this.insert(event, char, { isDecimalSign, isMinusSign }); - } - } - - onPaste(event: ClipboardEvent) { - if (!this.disabled && !this.readonly) { - event.preventDefault(); - let data = (event.clipboardData || (this.document as any).defaultView['clipboardData']).getData('Text'); - if (data) { - if (this.maxlength) { - data = data.toString().substring(0, this.maxlength); - } - - let filteredData = this.parseValue(data); - if (filteredData != null) { - this.insert(event, filteredData.toString()); - } - } - } - } - - allowMinusSign() { - return this.min == null || this.min < 0; - } - - isMinusSign(char: string) { - if (this._minusSign.test(char) || char === '-') { - this._minusSign.lastIndex = 0; - return true; - } - - return false; - } - - isDecimalSign(char: string) { - if (this._decimal.test(char)) { - this._decimal.lastIndex = 0; - return true; - } - - return false; - } - - isDecimalMode() { - return this.mode === 'decimal'; - } - - getDecimalCharIndexes(val: string) { - let decimalCharIndex = val.search(this._decimal); - this._decimal.lastIndex = 0; - - const filteredVal = val - .replace(this._prefix as RegExp, '') - .trim() - .replace(/\s/g, '') - .replace(this._currency as RegExp, ''); - const decimalCharIndexWithoutPrefix = filteredVal.search(this._decimal); - this._decimal.lastIndex = 0; - - return { decimalCharIndex, decimalCharIndexWithoutPrefix }; - } - - getCharIndexes(val: string) { - const decimalCharIndex = val.search(this._decimal); - this._decimal.lastIndex = 0; - const minusCharIndex = val.search(this._minusSign); - this._minusSign.lastIndex = 0; - const suffixCharIndex = val.search(this._suffix as RegExp); - (this._suffix as RegExp).lastIndex = 0; - const currencyCharIndex = val.search(this._currency as RegExp); - (this._currency as RegExp).lastIndex = 0; - - return { decimalCharIndex, minusCharIndex, suffixCharIndex, currencyCharIndex }; - } - - insert(event: Event, text: string, sign = { isDecimalSign: false, isMinusSign: false }) { - const minusCharIndexOnText = text.search(this._minusSign); - this._minusSign.lastIndex = 0; - if (!this.allowMinusSign() && minusCharIndexOnText !== -1) { - return; - } - - let selectionStart = this.input?.nativeElement.selectionStart; - let selectionEnd = this.input?.nativeElement.selectionEnd; - let inputValue = this.input?.nativeElement.value.trim(); - const { decimalCharIndex, minusCharIndex, suffixCharIndex, currencyCharIndex } = this.getCharIndexes(inputValue); - let newValueStr; - - if (sign.isMinusSign) { - if (selectionStart === 0) { - newValueStr = inputValue; - if (minusCharIndex === -1 || selectionEnd !== 0) { - newValueStr = this.insertText(inputValue, text, 0, selectionEnd); - } - - this.updateValue(event, newValueStr, text, 'insert'); - } - } else if (sign.isDecimalSign) { - if (decimalCharIndex > 0 && selectionStart === decimalCharIndex) { - this.updateValue(event, inputValue, text, 'insert'); - } else if (decimalCharIndex > selectionStart && decimalCharIndex < selectionEnd) { - newValueStr = this.insertText(inputValue, text, selectionStart, selectionEnd); - this.updateValue(event, newValueStr, text, 'insert'); - } else if (decimalCharIndex === -1 && this.maxFractionDigits) { - newValueStr = this.insertText(inputValue, text, selectionStart, selectionEnd); - this.updateValue(event, newValueStr, text, 'insert'); - } - } else { - const maxFractionDigits = this.numberFormat.resolvedOptions().maximumFractionDigits; - const operation = selectionStart !== selectionEnd ? 'range-insert' : 'insert'; - - if (decimalCharIndex > 0 && selectionStart > decimalCharIndex) { - if (selectionStart + text.length - (decimalCharIndex + 1) <= maxFractionDigits) { - const charIndex = currencyCharIndex >= selectionStart ? currencyCharIndex - 1 : suffixCharIndex >= selectionStart ? suffixCharIndex : inputValue.length; - - newValueStr = inputValue.slice(0, selectionStart) + text + inputValue.slice(selectionStart + text.length, charIndex) + inputValue.slice(charIndex); - this.updateValue(event, newValueStr, text, operation); - } - } else { - newValueStr = this.insertText(inputValue, text, selectionStart, selectionEnd); - this.updateValue(event, newValueStr, text, operation); - } - } - } - - insertText(value: string, text: string, start: number, end: number) { - let textSplit = text === '.' ? text : text.split('.'); - - if (textSplit.length === 2) { - const decimalCharIndex = value.slice(start, end).search(this._decimal); - this._decimal.lastIndex = 0; - return decimalCharIndex > 0 ? value.slice(0, start) + this.formatValue(text) + value.slice(end) : value || this.formatValue(text); - } else if (end - start === value.length) { - return this.formatValue(text); - } else if (start === 0) { - return text + value.slice(end); - } else if (end === value.length) { - return value.slice(0, start) + text; - } else { - return value.slice(0, start) + text + value.slice(end); - } - } - - deleteRange(value: string, start: number, end: number) { - let newValueStr; - - if (end - start === value.length) newValueStr = ''; - else if (start === 0) newValueStr = value.slice(end); - else if (end === value.length) newValueStr = value.slice(0, start); - else newValueStr = value.slice(0, start) + value.slice(end); - - return newValueStr; - } - - initCursor() { - let selectionStart = this.input?.nativeElement.selectionStart; - let inputValue = this.input?.nativeElement.value; - let valueLength = inputValue.length; - let index = null; - - // remove prefix - let prefixLength = (this.prefixChar || '').length; - inputValue = inputValue.replace(this._prefix, ''); - selectionStart = selectionStart - prefixLength; - - let char = inputValue.charAt(selectionStart); - if (this.isNumeralChar(char)) { - return selectionStart + prefixLength; - } - - //left - let i = selectionStart - 1; - while (i >= 0) { - char = inputValue.charAt(i); - if (this.isNumeralChar(char)) { - index = i + prefixLength; - break; - } else { - i--; - } - } - - if (index !== null) { - this.input?.nativeElement.setSelectionRange(index + 1, index + 1); - } else { - i = selectionStart; - while (i < valueLength) { - char = inputValue.charAt(i); - if (this.isNumeralChar(char)) { - index = i + prefixLength; - break; - } else { - i++; - } - } - - if (index !== null) { - this.input?.nativeElement.setSelectionRange(index, index); - } - } - - return index || 0; - } - - onInputClick() { - const currentValue = this.input?.nativeElement.value; - - if (!this.readonly && currentValue !== DomHandler.getSelection()) { - this.initCursor(); - } - } - - isNumeralChar(char: string) { - if (char.length === 1 && (this._numeral.test(char) || this._decimal.test(char) || this._group.test(char) || this._minusSign.test(char))) { - this.resetRegex(); - return true; - } - - return false; - } - - resetRegex() { - this._numeral.lastIndex = 0; - this._decimal.lastIndex = 0; - this._group.lastIndex = 0; - this._minusSign.lastIndex = 0; - } - - updateValue(event: Event, valueStr: Nullable, insertedValueStr: Nullable, operation: Nullable) { - let currentValue = this.input?.nativeElement.value; - let newValue = null; - - if (valueStr != null) { - newValue = this.parseValue(valueStr); - newValue = !newValue && !this.allowEmpty ? 0 : newValue; - this.updateInput(newValue, insertedValueStr, operation, valueStr); - - this.handleOnInput(event, currentValue, newValue); - } - } - - handleOnInput(event: Event, currentValue: string, newValue: any) { - if (this.isValueChanged(currentValue, newValue)) { - (this.input as ElementRef).nativeElement.value = this.formatValue(newValue); - this.input?.nativeElement.setAttribute('aria-valuenow', newValue); - this.updateModel(event, newValue); - this.onInput.emit({ originalEvent: event, value: newValue, formattedValue: currentValue }); - } - } - - isValueChanged(currentValue: string, newValue: string) { - if (newValue === null && currentValue !== null) { - return true; - } - - if (newValue != null) { - let parsedCurrentValue = typeof currentValue === 'string' ? this.parseValue(currentValue) : currentValue; - return newValue !== parsedCurrentValue; - } - - return false; - } - - validateValue(value: number | string) { - if (value === '-' || value == null) { - return null; - } - - if (this.min != null && (value as number) < this.min) { - return this.min; - } - - if (this.max != null && (value as number) > this.max) { - return this.max; - } - - return value; - } - - updateInput(value: any, insertedValueStr: Nullable, operation: Nullable, valueStr: Nullable) { - insertedValueStr = insertedValueStr || ''; - - let inputValue = this.input?.nativeElement.value; - let newValue = this.formatValue(value); - let currentLength = inputValue.length; - - if (newValue !== valueStr) { - newValue = this.concatValues(newValue, valueStr as string); - } - - if (currentLength === 0) { - this.input.nativeElement.value = newValue; - this.input.nativeElement.setSelectionRange(0, 0); - const index = this.initCursor(); - const selectionEnd = index + insertedValueStr.length; - this.input.nativeElement.setSelectionRange(selectionEnd, selectionEnd); - } else { - let selectionStart = this.input.nativeElement.selectionStart; - let selectionEnd = this.input.nativeElement.selectionEnd; - - if (this.maxlength && newValue.length > this.maxlength) { - newValue = newValue.slice(0, this.maxlength); - selectionStart = Math.min(selectionStart, this.maxlength); - selectionEnd = Math.min(selectionEnd, this.maxlength); - } - - if (this.maxlength && this.maxlength < newValue.length) { - return; - } - - this.input.nativeElement.value = newValue; - let newLength = newValue.length; - - if (operation === 'range-insert') { - const startValue = this.parseValue((inputValue || '').slice(0, selectionStart)); - const startValueStr = startValue !== null ? startValue.toString() : ''; - const startExpr = startValueStr.split('').join(`(${this.groupChar})?`); - const sRegex = new RegExp(startExpr, 'g'); - sRegex.test(newValue); - - const tExpr = insertedValueStr.split('').join(`(${this.groupChar})?`); - const tRegex = new RegExp(tExpr, 'g'); - tRegex.test(newValue.slice(sRegex.lastIndex)); - - selectionEnd = sRegex.lastIndex + tRegex.lastIndex; - this.input.nativeElement.setSelectionRange(selectionEnd, selectionEnd); - } else if (newLength === currentLength) { - if (operation === 'insert' || operation === 'delete-back-single') this.input.nativeElement.setSelectionRange(selectionEnd + 1, selectionEnd + 1); - else if (operation === 'delete-single') this.input.nativeElement.setSelectionRange(selectionEnd - 1, selectionEnd - 1); - else if (operation === 'delete-range' || operation === 'spin') this.input.nativeElement.setSelectionRange(selectionEnd, selectionEnd); - } else if (operation === 'delete-back-single') { - let prevChar = inputValue.charAt(selectionEnd - 1); - let nextChar = inputValue.charAt(selectionEnd); - let diff = currentLength - newLength; - let isGroupChar = this._group.test(nextChar); - - if (isGroupChar && diff === 1) { - selectionEnd += 1; - } else if (!isGroupChar && this.isNumeralChar(prevChar)) { - selectionEnd += -1 * diff + 1; - } - - this._group.lastIndex = 0; - this.input.nativeElement.setSelectionRange(selectionEnd, selectionEnd); - } else if (inputValue === '-' && operation === 'insert') { - this.input.nativeElement.setSelectionRange(0, 0); - const index = this.initCursor(); - const selectionEnd = index + insertedValueStr.length + 1; - this.input.nativeElement.setSelectionRange(selectionEnd, selectionEnd); - } else { - selectionEnd = selectionEnd + (newLength - currentLength); - this.input.nativeElement.setSelectionRange(selectionEnd, selectionEnd); - } - } - - this.input.nativeElement.setAttribute('aria-valuenow', value); - } - - concatValues(val1: string, val2: string) { - if (val1 && val2) { - let decimalCharIndex = val2.search(this._decimal); - this._decimal.lastIndex = 0; - - if (this.suffixChar) { - return decimalCharIndex !== -1 ? val1 : val1.replace(this.suffixChar, '').split(this._decimal)[0] + val2.replace(this.suffixChar, '').slice(decimalCharIndex) + this.suffixChar; - } else { - return decimalCharIndex !== -1 ? val1.split(this._decimal)[0] + val2.slice(decimalCharIndex) : val1; - } - } - return val1; - } - - getDecimalLength(value: string) { - if (value) { - const valueSplit = value.split(this._decimal); - - if (valueSplit.length === 2) { - return valueSplit[1] - .replace(this._suffix as RegExp, '') - .trim() - .replace(/\s/g, '') - .replace(this._currency as RegExp, '').length; - } - } - - return 0; - } - - onInputFocus(event: Event) { - this.focused = true; - this.onFocus.emit(event); - } - - onInputBlur(event: Event) { - this.focused = false; - - let newValue = this.validateValue(this.parseValue(this.input.nativeElement.value));//?.toString(); - this.input.nativeElement.value = this.formatValue(newValue); - this.input.nativeElement.setAttribute('aria-valuenow', newValue?.toString()); - this.updateModel(event, newValue); - this.onBlur.emit(event); - } - - formattedValue() { - const val = !this.value && !this.allowEmpty ? 0 : this.value; - return this.formatValue(val); - } - - updateModel(event: Event, value: any) { - const isBlurUpdateOnMode = this.ngControl?.control?.updateOn === 'blur'; - - if (this.value !== value) { - this.value = value; - - if (!(isBlurUpdateOnMode && this.focused)) { - this.onModelChange(value); - } - } else if (isBlurUpdateOnMode) { - this.onModelChange(value); - } - this.onModelTouched(); - } - - writeValue(value: any): void { - this.value = value; - this.cd.markForCheck(); - } - - registerOnChange(fn: Function): void { - this.onModelChange = fn; - } - - registerOnTouched(fn: Function): void { - this.onModelTouched = fn; - } - - setDisabledState(val: boolean): void { - this.disabled = val; - this.cd.markForCheck(); - } - - get filled() { - return this.value != null && this.value.toString().length > 0; - } - - clearTimer() { - if (this.timer) { - clearInterval(this.timer); - } - } -} - -@NgModule({ - imports: [CommonModule, InputTextModule, ButtonModule, TimesIcon, AngleUpIcon, AngleDownIcon], - exports: [InputNumberComponent, SharedModule], - declarations: [InputNumberComponent] -}) -export class InputNumberModule {} \ No newline at end of file diff --git a/bizmatch/src/app/pages/details/details-business-listing/details-business-listing.component.ts b/bizmatch/src/app/pages/details/details-business-listing/details-business-listing.component.ts index 1e986c3..dbd02fb 100644 --- a/bizmatch/src/app/pages/details/details-business-listing/details-business-listing.component.ts +++ b/bizmatch/src/app/pages/details/details-business-listing/details-business-listing.component.ts @@ -3,9 +3,6 @@ import { DomSanitizer, SafeHtml } from '@angular/platform-browser'; import { ActivatedRoute, NavigationEnd, Router } from '@angular/router'; import { KeycloakService } from 'keycloak-angular'; import onChange from 'on-change'; -import { MessageService } from 'primeng/api'; -import { GalleriaModule } from 'primeng/galleria'; -import { InputMaskModule } from 'primeng/inputmask'; import { lastValueFrom } from 'rxjs'; import { BusinessListing, User } from '../../../../../../bizmatch-server/src/models/db.model'; import { KeycloakUser, ListingCriteria, MailInfo } from '../../../../../../bizmatch-server/src/models/main.model'; @@ -20,8 +17,8 @@ import { getCriteriaStateObject, getSessionStorageHandler, map2User } from '../. @Component({ selector: 'app-details-business-listing', standalone: true, - imports: [SharedModule, GalleriaModule, InputMaskModule], - providers: [MessageService], + imports: [SharedModule], + providers: [], templateUrl: './details-business-listing.component.html', styleUrl: './details-business-listing.component.scss', }) @@ -63,7 +60,6 @@ export class DetailsBusinessListingComponent { private userService: UserService, public selectOptions: SelectOptionsService, private mailService: MailService, - private messageService: MessageService, private sanitizer: DomSanitizer, public historyService: HistoryService, public keycloakService: KeycloakService, @@ -97,7 +93,7 @@ export class DetailsBusinessListingComponent { this.mailinfo.userId = this.listing.userId; this.mailinfo.listing = this.listing; await this.mailService.mail(this.mailinfo); - this.messageService.add({ severity: 'info', summary: 'Confirmed', detail: 'Your message has been sent to the creator of the listing', life: 3000 }); + // this.messageService.add({ severity: 'info', summary: 'Confirmed', detail: 'Your message has been sent to the creator of the listing', life: 3000 }); } get listingDetails() { let typeOfRealEstate = ''; diff --git a/bizmatch/src/app/pages/details/details-commercial-property-listing/details-commercial-property-listing.component.html b/bizmatch/src/app/pages/details/details-commercial-property-listing/details-commercial-property-listing.component.html index e3f0764..00a1203 100644 --- a/bizmatch/src/app/pages/details/details-commercial-property-listing/details-commercial-property-listing.component.html +++ b/bizmatch/src/app/pages/details/details-commercial-property-listing/details-commercial-property-listing.component.html @@ -1,14 +1,12 @@ -
    + @if(historyService.canGoBack){ }
    - @if(listing){
    @@ -69,7 +67,6 @@
    -
    @@ -98,4 +95,4 @@ }
    - + --> diff --git a/bizmatch/src/app/pages/details/details-commercial-property-listing/details-commercial-property-listing.component.ts b/bizmatch/src/app/pages/details/details-commercial-property-listing/details-commercial-property-listing.component.ts index 13bd740..29f7ee7 100644 --- a/bizmatch/src/app/pages/details/details-commercial-property-listing/details-commercial-property-listing.component.ts +++ b/bizmatch/src/app/pages/details/details-commercial-property-listing/details-commercial-property-listing.component.ts @@ -3,9 +3,6 @@ import { DomSanitizer, SafeHtml } from '@angular/platform-browser'; import { ActivatedRoute, Router } from '@angular/router'; import { KeycloakService } from 'keycloak-angular'; import onChange from 'on-change'; -import { MessageService } from 'primeng/api'; -import { GalleriaModule } from 'primeng/galleria'; -import { InputMaskModule } from 'primeng/inputmask'; import { lastValueFrom } from 'rxjs'; import { CommercialPropertyListing, User } from '../../../../../../bizmatch-server/src/models/db.model'; import { ErrorResponse, KeycloakUser, ListingCriteria, MailInfo } from '../../../../../../bizmatch-server/src/models/main.model'; @@ -22,8 +19,8 @@ import { getCriteriaStateObject, getSessionStorageHandler, map2User } from '../. @Component({ selector: 'app-details-commercial-property-listing', standalone: true, - imports: [SharedModule, GalleriaModule, InputMaskModule], - providers: [MessageService], + imports: [SharedModule], + providers: [], templateUrl: './details-commercial-property-listing.component.html', styleUrl: './details-commercial-property-listing.component.scss', }) @@ -64,7 +61,6 @@ export class DetailsCommercialPropertyListingComponent { private userService: UserService, public selectOptions: SelectOptionsService, private mailService: MailService, - private messageService: MessageService, private sanitizer: DomSanitizer, public historyService: HistoryService, public keycloakService: KeycloakService, @@ -98,7 +94,7 @@ export class DetailsCommercialPropertyListingComponent { this.errorResponse = result as ErrorResponse; } else { this.errorResponse = null; - this.messageService.add({ severity: 'info', summary: 'Confirmed', detail: 'Your message has been sent to the creator of the listing', life: 3000 }); + // this.messageService.add({ severity: 'info', summary: 'Confirmed', detail: 'Your message has been sent to the creator of the listing', life: 3000 }); } } containsError(fieldname: string) { diff --git a/bizmatch/src/app/pages/details/details-user/details-user.component.html b/bizmatch/src/app/pages/details/details-user/details-user.component.html index d1a958d..f40d23c 100644 --- a/bizmatch/src/app/pages/details/details-user/details-user.component.html +++ b/bizmatch/src/app/pages/details/details-user/details-user.component.html @@ -1,4 +1,4 @@ -
    +
    -
    @if(user.hasCompanyLogo){ } -
    -
    @@ -77,9 +69,6 @@ @for (area of user.areasServed; track area) { } -
  • @@ -144,4 +133,4 @@ } - + --> diff --git a/bizmatch/src/app/pages/details/details-user/details-user.component.ts b/bizmatch/src/app/pages/details/details-user/details-user.component.ts index c3bebfb..3986041 100644 --- a/bizmatch/src/app/pages/details/details-user/details-user.component.ts +++ b/bizmatch/src/app/pages/details/details-user/details-user.component.ts @@ -2,8 +2,6 @@ import { Component } from '@angular/core'; import { DomSanitizer, SafeHtml } from '@angular/platform-browser'; import { ActivatedRoute, Router } from '@angular/router'; import { KeycloakService } from 'keycloak-angular'; -import { MessageService } from 'primeng/api'; -import { GalleriaModule } from 'primeng/galleria'; import { Observable } from 'rxjs'; import { BusinessListing, CommercialPropertyListing, User } from '../../../../../../bizmatch-server/src/models/db.model'; import { KeycloakUser, ListingCriteria, emailToDirName } from '../../../../../../bizmatch-server/src/models/main.model'; @@ -19,8 +17,7 @@ import { formatPhoneNumber, map2User } from '../../../utils/utils'; @Component({ selector: 'app-details-user', standalone: true, - imports: [SharedModule, GalleriaModule], - providers: [MessageService], + imports: [SharedModule], templateUrl: './details-user.component.html', styleUrl: './details-user.component.scss', }) @@ -44,7 +41,7 @@ export class DetailsUserComponent { private router: Router, private userService: UserService, private listingsService: ListingsService, - private messageService: MessageService, + public selectOptions: SelectOptionsService, private sanitizer: DomSanitizer, private imageService: ImageService, diff --git a/bizmatch/src/app/pages/home/home.component.ts b/bizmatch/src/app/pages/home/home.component.ts index 8c2ed17..1fb3218 100644 --- a/bizmatch/src/app/pages/home/home.component.ts +++ b/bizmatch/src/app/pages/home/home.component.ts @@ -5,11 +5,6 @@ import { ActivatedRoute, Router, RouterModule } from '@angular/router'; import { initFlowbite } from 'flowbite'; import { KeycloakService } from 'keycloak-angular'; import onChange from 'on-change'; -import { ButtonModule } from 'primeng/button'; -import { CheckboxModule } from 'primeng/checkbox'; -import { DropdownModule } from 'primeng/dropdown'; -import { InputTextModule } from 'primeng/inputtext'; -import { StyleClassModule } from 'primeng/styleclass'; import { KeycloakUser, ListingCriteria } from '../../../../../bizmatch-server/src/models/main.model'; import { ListingsService } from '../../services/listings.service'; import { SelectOptionsService } from '../../services/select-options.service'; @@ -17,7 +12,7 @@ import { getCriteriaStateObject, getSessionStorageHandler, map2User, resetCriter @Component({ selector: 'app-home', standalone: true, - imports: [CommonModule, StyleClassModule, ButtonModule, CheckboxModule, InputTextModule, DropdownModule, FormsModule, RouterModule], + imports: [CommonModule, FormsModule, RouterModule], templateUrl: './home.component.html', styleUrl: './home.component.scss', }) diff --git a/bizmatch/src/app/pages/listings/broker-listings/broker-listings.component.html b/bizmatch/src/app/pages/listings/broker-listings/broker-listings.component.html index 43d8e67..f479ec0 100644 --- a/bizmatch/src/app/pages/listings/broker-listings/broker-listings.component.html +++ b/bizmatch/src/app/pages/listings/broker-listings/broker-listings.component.html @@ -1,4 +1,4 @@ -
    + diff --git a/bizmatch/src/app/pages/listings/broker-listings/broker-listings.component.ts b/bizmatch/src/app/pages/listings/broker-listings/broker-listings.component.ts index ed5affb..e503d26 100644 --- a/bizmatch/src/app/pages/listings/broker-listings/broker-listings.component.ts +++ b/bizmatch/src/app/pages/listings/broker-listings/broker-listings.component.ts @@ -3,14 +3,6 @@ import { ChangeDetectorRef, Component } from '@angular/core'; import { FormsModule } from '@angular/forms'; import { ActivatedRoute, Router, RouterModule } from '@angular/router'; import onChange from 'on-change'; -import { ButtonModule } from 'primeng/button'; -import { CheckboxModule } from 'primeng/checkbox'; -import { DropdownModule } from 'primeng/dropdown'; -import { InputGroupModule } from 'primeng/inputgroup'; -import { InputTextModule } from 'primeng/inputtext'; -import { PaginatorModule } from 'primeng/paginator'; -import { StyleClassModule } from 'primeng/styleclass'; -import { ToggleButtonModule } from 'primeng/togglebutton'; import { BusinessListing, User } from '../../../../../../bizmatch-server/src/models/db.model'; import { ListingCriteria, ListingType, emailToDirName } from '../../../../../../bizmatch-server/src/models/main.model'; import { environment } from '../../../../environments/environment'; @@ -23,21 +15,7 @@ import { getCriteriaStateObject, getSessionStorageHandler, resetCriteria } from @Component({ selector: 'app-broker-listings', standalone: true, - imports: [ - CommonModule, - StyleClassModule, - ButtonModule, - CheckboxModule, - InputTextModule, - DropdownModule, - FormsModule, - StyleClassModule, - ToggleButtonModule, - RouterModule, - PaginatorModule, - InputGroupModule, - NgOptimizedImage, - ], + imports: [CommonModule, FormsModule, RouterModule, NgOptimizedImage], templateUrl: './broker-listings.component.html', styleUrls: ['./broker-listings.component.scss', '../../pages.scss'], }) diff --git a/bizmatch/src/app/pages/listings/business-listings/business-listings.component.ts b/bizmatch/src/app/pages/listings/business-listings/business-listings.component.ts index e464734..be870ea 100644 --- a/bizmatch/src/app/pages/listings/business-listings/business-listings.component.ts +++ b/bizmatch/src/app/pages/listings/business-listings/business-listings.component.ts @@ -3,15 +3,6 @@ import { ChangeDetectorRef, Component } from '@angular/core'; import { FormsModule } from '@angular/forms'; import { ActivatedRoute, Router, RouterModule } from '@angular/router'; import onChange from 'on-change'; -import { ButtonModule } from 'primeng/button'; -import { CheckboxModule } from 'primeng/checkbox'; -import { DropdownModule } from 'primeng/dropdown'; -import { InputGroupModule } from 'primeng/inputgroup'; -import { InputTextModule } from 'primeng/inputtext'; -import { PaginatorModule } from 'primeng/paginator'; -import { StyleClassModule } from 'primeng/styleclass'; -import { ToggleButtonModule } from 'primeng/togglebutton'; -import { TooltipModule } from 'primeng/tooltip'; import { BusinessListing } from '../../../../../../bizmatch-server/src/models/db.model'; import { ListingCriteria, ListingType, emailToDirName } from '../../../../../../bizmatch-server/src/models/main.model'; import { environment } from '../../../../environments/environment'; @@ -23,21 +14,7 @@ import { getCriteriaStateObject, getSessionStorageHandler, resetCriteria } from @Component({ selector: 'app-business-listings', standalone: true, - imports: [ - CommonModule, - StyleClassModule, - ButtonModule, - CheckboxModule, - InputTextModule, - DropdownModule, - FormsModule, - StyleClassModule, - ToggleButtonModule, - RouterModule, - PaginatorModule, - InputGroupModule, - TooltipModule, - ], + imports: [CommonModule, FormsModule, RouterModule], templateUrl: './business-listings.component.html', styleUrls: ['./business-listings.component.scss', '../../pages.scss'], }) diff --git a/bizmatch/src/app/pages/listings/commercial-property-listings/commercial-property-listings.component.html b/bizmatch/src/app/pages/listings/commercial-property-listings/commercial-property-listings.component.html index fd8e8c2..8e83309 100644 --- a/bizmatch/src/app/pages/listings/commercial-property-listings/commercial-property-listings.component.html +++ b/bizmatch/src/app/pages/listings/commercial-property-listings/commercial-property-listings.component.html @@ -1,47 +1,4 @@ -
    - +

    {{ listing.city }}

    @@ -94,12 +50,31 @@ }
    - -
    - -
    Total number of Listings: {{ totalRecords }}
    - - +
    + --> +
    +
    + + @for (listing of listings; track listing.id) { +
    + @if (listing.imageOrder?.length>0){ + Image + } @else { + Image + } +
    +
    + {{ selectOptions.getState(listing.state) }} + {{ selectOptions.getCommercialProperty(listing.type) }} +
    +

    {{ listing.title }}

    +

    {{ listing.city }}

    +

    {{ listing.price | currency }}

    + +
    + }
    diff --git a/bizmatch/src/app/pages/listings/commercial-property-listings/commercial-property-listings.component.ts b/bizmatch/src/app/pages/listings/commercial-property-listings/commercial-property-listings.component.ts index 45d1a84..f435506 100644 --- a/bizmatch/src/app/pages/listings/commercial-property-listings/commercial-property-listings.component.ts +++ b/bizmatch/src/app/pages/listings/commercial-property-listings/commercial-property-listings.component.ts @@ -3,14 +3,6 @@ import { ChangeDetectorRef, Component } from '@angular/core'; import { FormsModule } from '@angular/forms'; import { ActivatedRoute, Router, RouterModule } from '@angular/router'; import onChange from 'on-change'; -import { ButtonModule } from 'primeng/button'; -import { CheckboxModule } from 'primeng/checkbox'; -import { DropdownModule } from 'primeng/dropdown'; -import { InputGroupModule } from 'primeng/inputgroup'; -import { InputTextModule } from 'primeng/inputtext'; -import { PaginatorModule } from 'primeng/paginator'; -import { StyleClassModule } from 'primeng/styleclass'; -import { ToggleButtonModule } from 'primeng/togglebutton'; import { CommercialPropertyListing } from '../../../../../../bizmatch-server/src/models/db.model'; import { ListingCriteria } from '../../../../../../bizmatch-server/src/models/main.model'; import { environment } from '../../../../environments/environment'; @@ -22,7 +14,7 @@ import { getCriteriaStateObject, getSessionStorageHandler, resetCriteria } from @Component({ selector: 'app-commercial-property-listings', standalone: true, - imports: [CommonModule, StyleClassModule, ButtonModule, CheckboxModule, InputTextModule, DropdownModule, FormsModule, StyleClassModule, ToggleButtonModule, RouterModule, PaginatorModule, InputGroupModule], + imports: [CommonModule, FormsModule, RouterModule], templateUrl: './commercial-property-listings.component.html', styleUrls: ['./commercial-property-listings.component.scss', '../../pages.scss'], }) diff --git a/bizmatch/src/app/pages/menu-account/menu-account.component.html b/bizmatch/src/app/pages/menu-account/menu-account.component.html deleted file mode 100644 index 42a7cb6..0000000 --- a/bizmatch/src/app/pages/menu-account/menu-account.component.html +++ /dev/null @@ -1,57 +0,0 @@ - diff --git a/bizmatch/src/app/pages/menu-account/menu-account.component.scss b/bizmatch/src/app/pages/menu-account/menu-account.component.scss deleted file mode 100644 index 4fcf699..0000000 --- a/bizmatch/src/app/pages/menu-account/menu-account.component.scss +++ /dev/null @@ -1,3 +0,0 @@ -ul { - text-wrap: nowrap; -} \ No newline at end of file diff --git a/bizmatch/src/app/pages/menu-account/menu-account.component.ts b/bizmatch/src/app/pages/menu-account/menu-account.component.ts deleted file mode 100644 index 5394747..0000000 --- a/bizmatch/src/app/pages/menu-account/menu-account.component.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { CommonModule } from '@angular/common'; -import { Component } from '@angular/core'; -import { NavigationEnd, Router, RouterModule } from '@angular/router'; -import { FontAwesomeModule } from '@fortawesome/angular-fontawesome'; -import { faEnvelope } from '@fortawesome/free-regular-svg-icons'; -import { faRightFromBracket } from '@fortawesome/free-solid-svg-icons'; -import { KeycloakService } from 'keycloak-angular'; -import { ButtonModule } from 'primeng/button'; -import { DividerModule } from 'primeng/divider'; -import { RippleModule } from 'primeng/ripple'; -import { StyleClassModule } from 'primeng/styleclass'; - -@Component({ - selector: 'menu-account', - standalone: true, - imports: [CommonModule, StyleClassModule, ButtonModule, DividerModule, RouterModule, RippleModule, FontAwesomeModule], - templateUrl: './menu-account.component.html', - styleUrl: './menu-account.component.scss', -}) -export class MenuAccountComponent { - activeLink: string; - faEnvelope = faEnvelope; - faRightFromBracket = faRightFromBracket; - constructor(private router: Router, public keycloakService: KeycloakService) { - // Abonniere Router-Events, um den aktiven Link zu ermitteln - this.router.events.subscribe(event => { - if (event instanceof NavigationEnd) { - this.activeLink = event.url; - } - }); - } - logout() { - sessionStorage.removeItem('USERID'); - this.keycloakService.logout(window.location.origin + '/home'); - } -} diff --git a/bizmatch/src/app/pages/pricing/pricing.component.html b/bizmatch/src/app/pages/pricing/pricing.component.html index 455919f..34bfbf8 100644 --- a/bizmatch/src/app/pages/pricing/pricing.component.html +++ b/bizmatch/src/app/pages/pricing/pricing.component.html @@ -32,14 +32,6 @@ Monthly/Yearly package
  • - diff --git a/bizmatch/src/app/pages/privacy-statement/privacy-statement.component.html b/bizmatch/src/app/pages/privacy-statement/privacy-statement.component.html deleted file mode 100644 index 116980f..0000000 --- a/bizmatch/src/app/pages/privacy-statement/privacy-statement.component.html +++ /dev/null @@ -1,194 +0,0 @@ -
    -
    -
    -
    -

    - Privacy Policy
    - We are committed to protecting your privacy. We have established this statement as a testament to our commitment to your privacy. -

    -

    This Privacy Policy relates to the use of any personal information you provide to us through this websites.

    -

    - By accepting the Privacy Policy during registration or the sending of an enquiry, you expressly consent to our collection, storage, use and disclosure of your personal information as described in this Privacy - Policy. -

    -

    - We may update our Privacy Policy from time to time. Our Privacy Policy was last updated in Febuary 2018 and is effective upon acceptance for new users. By continuing to use our websites or otherwise continuing - to deal with us, you accept this Privacy Policy. -

    -

    - Collection of personal information
    - Anyone can browse our websites without revealing any personally identifiable information. -

    -

    However, should you wish to contact a business for sale, a franchise opportunity or an intermediary, we will require you to provide some personal information.

    -

    Should you wish to advertise your services, your business (es) or your franchise opportunity, we will require you to provide some personal information.

    -

    By providing personal information, you are consenting to the transfer and storage of that information on our servers located in the United States.

    -

    We may collect and store the following personal information:

    -

    - Your name, email address, physical address, telephone numbers, and (depending on the service used), your business information, financial information, such as credit / payment card details;
    - transactional information based on your activities on the site; information that you disclose in a forum on any of our websites, feedback, correspondence through our websites, and correspondence sent to us;
    - other information from your interaction with our websites, services, content and advertising, including computer and connection information, statistics on page views, traffic to and from the sites, ad data, IP - address and standard web log information;
    - supplemental information from third parties (for example, if you incur a debt, we will generally conduct a credit check by obtaining additional information about you from a credit bureau, as permitted by law; - or if the information you provide cannot be verified,
    - we may ask you to send us additional information, or to answer additional questions online to help verify your information). -

    -

    - How we use your information
    - The primary reason we collect your personal information is to improve the services we deliver to you through our website. By registering or sending an enquiry through our website, you agree that we may use your - personal information to:
    - provide the services and customer support you request;
    - connect you with relevant parties:
    - If you are a buyer we will pass some or all of your details on to the seller / intermediary along with any message you have typed. This allows the seller to contact you in order to pursue a possible sale of a - business;
    - If you are a seller / intermediary, we will disclose your details where you have given us permission to do so;
    - resolve disputes, collect fees, and troubleshoot problems;
    - prevent potentially prohibited or illegal activities, and enforce our Terms and Conditions;
    - customize, measure and improve our services, conduct internal market research, provide content and advertising;
    - tell you about other Biz-Match products and services, target marketing, send you service updates, and promotional offers based on your communication preferences. -

    -

    - Our disclosure of your information
    - We may disclose personal information to respond to legal requirements, enforce our policies, respond to claims that a listing or other content infringes the rights of others, or protect anyone’s rights, - property, or safety. -

    -

    - We may also share your personal information with
    - When you select to register an account as a business buyer, you provide your personal details and we will pass this on to a seller of a business or franchise when you request more information. -

    -

    - When you select to register an account as a business broker or seller on the site, we provide a public platform on which to establish your business profile. This profile consists of pertinent facts about your - business along with your personal information; namely, the contact information you provide to facilitate contact between you and other users’ of the site. Direct email addresses and telephone numbers will not - be publicly displayed unless you specifically include it on your profile. -

    -

    - The information a user includes within the forums provided on the site is publicly available to other users’ of the site. Please be aware that any personal information you elect to provide in a public forum may - be used to send you unsolicited messages; we are not responsible for the personal information a user elects to disclose within their public profile, or in the private communications that users’ engage in on the - site. -

    -

    - We post testimonials on the site obtained from users’. These testimonials may include the name, city, state or region and business of the user. We obtain permission from our users’ prior to posting their - testimonials on the site. We are not responsible for any personal information a user selects to include within their testimonial. -

    -

    - When you elect to email a friend about the site, or a particular business, we request the third party’s email address to send this one time email. We do not share this information with any third parties for - their promotional purposes and only store the information to gauge the effectiveness of our referral program. -

    -

    We may share your personal information with our service providers where necessary. We employ the services of a payment processor to fulfil payment for services purchased on the site.

    -

    - We works with a number of partners or affiliates, where we provide marketing services for these companies. These third party agents collect your personal information to facilitate your service request and the - information submitted here is governed by their privacy policy. -

    -

    - Masking Policy
    - In some cases, where the third party agent collects your information, the affiliate portal may appear within a BizMatch.net frame. It is presented as a BizMatch.net page for a streamlined user interface however - the data collected on such pages is governed by the third party agent’s privacy policy. -

    -

    - Legal Disclosure
    - In certain circumstances, we may be legally required to disclose information collected on the site to law enforcement, government agencies or other third parties. We reserve the right to disclose information to - our service providers and to law enforcement or government agencies where a formal request such as in response to a court order, subpoena or judicial proceeding is made. Where we believe in good faith that - disclosure of information is necessary to prevent imminent physical or financial harm, or loss, or in protecting against illegal activity on the site, we reserve to disclose information. -

    -

    - Should the company undergo the merger, acquisition or sale of some or all of its assets, your personal information may likely be a part of the transferred assets. In such an event, your personal information on - the site, would be governed by this privacy statement; any changes to the privacy practices governing your information as a result of transfer would be relayed to you by means of a prominent notice on the Site, - or by email. -

    -

    - Using information from BizMatch.net website
    - In certain cases, (where you are receiving contact details of buyers interested in your business opportunity or a business opportunity you represent), you must comply with data protection laws, and give other - users a chance to remove themselves from your database and a chance to review what information you have collected about them. -

    -

    - You agree to use BizMatch.net user information only for: -

    -

    - BizMatch.net transaction-related purposes that are not unsolicited commercial messages;
    - using services offered through BizMatch.net, or
    - other purposes that a user expressly chooses. -

    -

    - Marketing
    - We do not sell or rent your personal information to third parties for their marketing purposes without your explicit consent. Where you explicitly express your consent at the point of collection to receive - offers from third party partners or affiliates, we will communicate to you on their behalf. We will not pass your information on. -

    -

    - You will receive email marketing communications from us throughout the duration of your relationship with our websites. If you do not wish to receive marketing communications from us you may unsubscribe and / - or change your preferences at any time by following instructions included within a communication or emailing Customer Services. -

    -

    If you have an account with one of our websites you can also log in and click the email preferences link to unsubscribe and / or change your preferences.

    -

    - Please note that we reserve the right to send all website users notifications and administrative emails where necessary which are considered a part of the service. Given that these messages aren’t promotional - in nature, you will be unable to opt-out of them. -

    -

    - Cookies
    - A cookie is a small text file written to your hard drive that contains information about you. Cookies do not contain any personal information about users. Once you close your browser or log out of the website, - the cookie simply terminates. We use cookies so that we can personalise your experience of our websites. -

    -

    - If you set up your browser to reject the cookie, you may still use the website however; doing so may interfere with your use of some aspects of our websites. Some of our business partners use cookies on our - site (for example, advertisers). We have no access to or control over these cookies. -

    -

    For more information about how BizMatch.net uses cookies please read our Cookie Policy.

    -

    - Spam, spyware or spoofing
    - We and our users do not tolerate spam. Make sure to set your email preferences so we can communicate with you, as you prefer. Please add us to your safe senders list. To report spam or spoof emails, please - contact us using the contact information provided in the Contact Us section of this privacy statement. -

    -

    - You may not use our communication tools to send spam or otherwise send content that would breach our Terms and Conditions. We automatically scan and may manually filter messages to check for spam, viruses, - phishing attacks and other malicious activity or illegal or prohibited content. We may also store these messages for back up purposes only. -

    -

    - If you send an email to an email address that is not registered in our community, we do not permanently store that email or use that email address for any marketing purpose. We do not rent or sell these email - addresses. -

    -

    - Account protection
    - Your password is the key to your account. Make sure this is stored safely. Use unique numbers, letters and special characters, and do not disclose your password to anyone. If you do share your password or your - personal information with others, remember that you are responsible for all actions taken in the name of your account. If you lose control of your password, you may lose substantial control over your personal - information and may be subject to legally binding actions taken on your behalf. Therefore, if your password has been compromised for any reason, you should immediately notify us and change your password. -

    -

    - Accessing, reviewing and changing your personal information
    - You can view and amend your personal information at any time by logging in to your account online. You must promptly update your personal information if it changes or is inaccurate. -

    -

    If at any time you wish to close your account, please contact Customer Services and instruct us to do so. We will process your request as soon as we can.

    -

    You may also contact us at any time to find out what information we hold about you, what we do with it and ask us to update it for you.

    -

    - We do retain personal information from closed accounts to comply with law, prevent fraud, collect any fees owed, resolve disputes, troubleshoot problems, assist with any investigations, enforce our Terms and - Conditions, and take other actions otherwise permitted by law. -

    -

    - Security
    - Your information is stored on our servers located in the USA. We treat data as an asset that must be protected and use a variety of tools (encryption, passwords, physical security, etc.) to protect your - personal information against unauthorized access and disclosure. However, no method of security is 100% effective and while we take every measure to protect your personal information, we make no guarantees of - its absolute security. -

    -

    We employ the use of SSL encryption during the transmission of sensitive data across our websites.

    -

    - Third parties
    - Except as otherwise expressly included in this Privacy Policy, this document addresses only the use and disclosure of information we collect from you. If you disclose your information to others, whether they - are buyers or sellers on our websites or other sites throughout the internet, different rules may apply to their use or disclosure of the information you disclose to them. Dynamis does not control the privacy - policies of third parties, and you are subject to the privacy policies of those third parties where applicable. -

    -

    We encourage you to ask questions before you disclose your personal information to others.

    -

    - General
    - We may change this Privacy Policy from time to time as we add new products and applications, as we improve our current offerings, and as technologies and laws change. You can determine when this Privacy Policy - was last revised by referring to the “Last Updated” legend at the top of this page. -

    -

    - Any changes will become effective upon our posting of the revised Privacy Policy on our affected websites. We will provide notice to you if these changes are material and, where required by applicable law, we - will obtain your consent. This notice may be provided by email, by posting notice of the changes on our affected websites or by other means, consistent with applicable laws. -

    -

    - Contact Us
    - If you have any questions or comments about our privacy policy, and you can’t find the answer to your question on our help pages, please contact us using this form or email support@bizmatch.net, or write to - us at BizMatch, 715 S. Tanahua, Corpus Christi, TX 78401.) -

    -
    -
    -
    -
    diff --git a/bizmatch/src/app/pages/privacy-statement/privacy-statement.component.scss b/bizmatch/src/app/pages/privacy-statement/privacy-statement.component.scss deleted file mode 100644 index e69de29..0000000 diff --git a/bizmatch/src/app/pages/privacy-statement/privacy-statement.component.ts b/bizmatch/src/app/pages/privacy-statement/privacy-statement.component.ts deleted file mode 100644 index 0f90ed2..0000000 --- a/bizmatch/src/app/pages/privacy-statement/privacy-statement.component.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { Component } from '@angular/core'; - -@Component({ - selector: 'app-privacy-statement', - standalone: true, - imports: [], - templateUrl: './privacy-statement.component.html', - styleUrl: './privacy-statement.component.scss' -}) -export class PrivacyStatementComponent { - -} diff --git a/bizmatch/src/app/pages/subscription/account/account.component.html b/bizmatch/src/app/pages/subscription/account/account.component.html index 047673d..57da495 100644 --- a/bizmatch/src/app/pages/subscription/account/account.component.html +++ b/bizmatch/src/app/pages/subscription/account/account.component.html @@ -1,4 +1,4 @@ -
    +
    @@ -143,7 +142,6 @@  (Add more licenses or remove existing ones.) -
    } }
    @@ -160,7 +158,6 @@
    - } @else { } @@ -263,4 +260,4 @@ - + --> diff --git a/bizmatch/src/app/pages/subscription/account/account.component.ts b/bizmatch/src/app/pages/subscription/account/account.component.ts index 5374dd3..a4c4d12 100644 --- a/bizmatch/src/app/pages/subscription/account/account.component.ts +++ b/bizmatch/src/app/pages/subscription/account/account.component.ts @@ -1,22 +1,12 @@ -import { HttpEventType } from '@angular/common/http'; -import { ChangeDetectorRef, Component, ViewChild } from '@angular/core'; +import { ChangeDetectorRef, Component } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { faTrash } from '@fortawesome/free-solid-svg-icons'; import { AngularCropperjsModule } from 'angular-cropperjs'; import { KeycloakService } from 'keycloak-angular'; -import { ConfirmationService, MessageService } from 'primeng/api'; -import { ConfirmDialogModule } from 'primeng/confirmdialog'; -import { DialogModule } from 'primeng/dialog'; -import { DialogService, DynamicDialogModule, DynamicDialogRef } from 'primeng/dynamicdialog'; -import { EditorModule } from 'primeng/editor'; -import { FileUpload, FileUploadModule } from 'primeng/fileupload'; -import { InputMaskModule } from 'primeng/inputmask'; -import { SelectButtonModule } from 'primeng/selectbutton'; import { lastValueFrom } from 'rxjs'; import { User } from '../../../../../../bizmatch-server/src/models/db.model'; import { AutoCompleteCompleteEvent, Invoice, Subscription, emailToDirName } from '../../../../../../bizmatch-server/src/models/main.model'; import { environment } from '../../../../environments/environment'; -import { ImageCropperComponent, stateOptions } from '../../../components/image-cropper/image-cropper.component'; import { GeoService } from '../../../services/geo.service'; import { ImageService } from '../../../services/image.service'; import { LoadingService } from '../../../services/loading.service'; @@ -24,19 +14,19 @@ import { SelectOptionsService } from '../../../services/select-options.service'; import { SubscriptionsService } from '../../../services/subscriptions.service'; import { UserService } from '../../../services/user.service'; import { SharedModule } from '../../../shared/shared/shared.module'; -import { getDialogWidth, getImageDimensions, map2User } from '../../../utils/utils'; +import { map2User } from '../../../utils/utils'; import { TOOLBAR_OPTIONS } from '../../utils/defaults'; @Component({ selector: 'app-account', standalone: true, - imports: [SharedModule, FileUploadModule, EditorModule, AngularCropperjsModule, DialogModule, SelectButtonModule, DynamicDialogModule, ConfirmDialogModule, InputMaskModule], - providers: [MessageService, DialogService, ConfirmationService], + imports: [SharedModule, AngularCropperjsModule], + providers: [], templateUrl: './account.component.html', styleUrl: './account.component.scss', }) export class AccountComponent { - @ViewChild('companyUpload') public companyUpload: FileUpload; - @ViewChild('profileUpload') public profileUpload: FileUpload; + // @ViewChild('companyUpload') public companyUpload: FileUpload; + // @ViewChild('profileUpload') public profileUpload: FileUpload; private id: string | undefined = this.activatedRoute.snapshot.params['id'] as string | undefined; user: User; subscriptions: Array; @@ -45,7 +35,6 @@ export class AccountComponent { companyLogoUrl: string; profileUrl: string; type: 'company' | 'profile'; - dialogRef: DynamicDialogRef | undefined; environment = environment; editorModules = TOOLBAR_OPTIONS; env = environment; @@ -53,15 +42,12 @@ export class AccountComponent { constructor( public userService: UserService, private subscriptionService: SubscriptionsService, - private messageService: MessageService, private geoService: GeoService, public selectOptions: SelectOptionsService, private cdref: ChangeDetectorRef, private activatedRoute: ActivatedRoute, private loadingService: LoadingService, private imageUploadService: ImageService, - public dialogService: DialogService, - private confirmationService: ConfirmationService, private imageService: ImageService, private keycloakService: KeycloakService, ) {} @@ -98,7 +84,7 @@ export class AccountComponent { async updateProfile(user: User) { await this.userService.save(this.user); - this.messageService.add({ severity: 'info', summary: 'Confirmed', detail: 'Account changes have been persisted', life: 3000 }); + // this.messageService.add({ severity: 'info', summary: 'Confirmed', detail: 'Account changes have been persisted', life: 3000 }); } onUploadCompanyLogo(event: any) { @@ -134,77 +120,77 @@ export class AccountComponent { get isProfessional() { return this.user.customerType === 'professional'; } - select(event: any, type: 'company' | 'profile') { - const imageUrl = URL.createObjectURL(event.files[0]); - this.type = type; - const config = { aspectRatio: type === 'company' ? stateOptions[0].value : stateOptions[2].value }; - getImageDimensions(imageUrl).then(dimensions => { - const dialogWidth = getDialogWidth(dimensions); + // select(event: any, type: 'company' | 'profile') { + // const imageUrl = URL.createObjectURL(event.files[0]); + // this.type = type; + // const config = { aspectRatio: type === 'company' ? stateOptions[0].value : stateOptions[2].value }; + // getImageDimensions(imageUrl).then(dimensions => { + // const dialogWidth = getDialogWidth(dimensions); - this.dialogRef = this.dialogService.open(ImageCropperComponent, { - data: { - imageUrl: imageUrl, - fileUpload: type === 'company' ? this.companyUpload : this.profileUpload, - config: config, - ratioVariable: type === 'company' ? true : false, - }, - header: 'Edit Image', - width: dialogWidth, - modal: true, - closeOnEscape: true, - keepInViewport: true, - closable: false, - }); - this.dialogRef.onClose.subscribe(cropper => { - if (cropper) { - this.loadingService.startLoading('uploadImage'); - cropper.getCroppedCanvas().toBlob(async blob => { - this.imageUploadService.uploadImage(blob, type === 'company' ? 'uploadCompanyLogo' : 'uploadProfile', emailToDirName(this.user.email)).subscribe( - async event => { - if (event.type === HttpEventType.Response) { - this.loadingService.stopLoading('uploadImage'); - if (this.type === 'company') { - this.user.hasCompanyLogo = true; // - this.companyLogoUrl = `${this.env.imageBaseUrl}/pictures/logo/${emailToDirName(this.user.email)}.avif?_ts=${new Date().getTime()}`; - } else { - this.user.hasProfile = true; - this.profileUrl = `${this.env.imageBaseUrl}/pictures/profile/${emailToDirName(this.user.email)}.avif?_ts=${new Date().getTime()}`; - } - await this.userService.save(this.user); - } - }, - error => console.error('Fehler beim Upload:', error), - ); - }); - } - }); - }); - } - deleteConfirm(type: 'profile' | 'logo') { - this.confirmationService.confirm({ - target: event.target as EventTarget, - message: `Do you want to delete your ${type === 'logo' ? 'Logo' : 'Profile'} image`, - header: 'Delete Confirmation', - icon: 'pi pi-info-circle', - acceptButtonStyleClass: 'p-button-danger p-button-text', - rejectButtonStyleClass: 'p-button-text p-button-text', - acceptIcon: 'none', - rejectIcon: 'none', + // this.dialogRef = this.dialogService.open(ImageCropperComponent, { + // data: { + // imageUrl: imageUrl, + // fileUpload: type === 'company' ? this.companyUpload : this.profileUpload, + // config: config, + // ratioVariable: type === 'company' ? true : false, + // }, + // header: 'Edit Image', + // width: dialogWidth, + // modal: true, + // closeOnEscape: true, + // keepInViewport: true, + // closable: false, + // }); + // this.dialogRef.onClose.subscribe(cropper => { + // if (cropper) { + // this.loadingService.startLoading('uploadImage'); + // cropper.getCroppedCanvas().toBlob(async blob => { + // this.imageUploadService.uploadImage(blob, type === 'company' ? 'uploadCompanyLogo' : 'uploadProfile', emailToDirName(this.user.email)).subscribe( + // async event => { + // if (event.type === HttpEventType.Response) { + // this.loadingService.stopLoading('uploadImage'); + // if (this.type === 'company') { + // this.user.hasCompanyLogo = true; // + // this.companyLogoUrl = `${this.env.imageBaseUrl}/pictures/logo/${emailToDirName(this.user.email)}.avif?_ts=${new Date().getTime()}`; + // } else { + // this.user.hasProfile = true; + // this.profileUrl = `${this.env.imageBaseUrl}/pictures/profile/${emailToDirName(this.user.email)}.avif?_ts=${new Date().getTime()}`; + // } + // await this.userService.save(this.user); + // } + // }, + // error => console.error('Fehler beim Upload:', error), + // ); + // }); + // } + // }); + // }); + // } + // deleteConfirm(type: 'profile' | 'logo') { + // this.confirmationService.confirm({ + // target: event.target as EventTarget, + // message: `Do you want to delete your ${type === 'logo' ? 'Logo' : 'Profile'} image`, + // header: 'Delete Confirmation', + // icon: 'pi pi-info-circle', + // acceptButtonStyleClass: 'p-button-danger p-button-text', + // rejectButtonStyleClass: 'p-button-text p-button-text', + // acceptIcon: 'none', + // rejectIcon: 'none', - accept: async () => { - if (type === 'profile') { - this.user.hasProfile = false; - await Promise.all([this.imageService.deleteProfileImagesById(this.user.email), this.userService.save(this.user)]); - } else { - this.user.hasCompanyLogo = false; - await Promise.all([this.imageService.deleteLogoImagesById(this.user.email), this.userService.save(this.user)]); - } - this.messageService.add({ severity: 'info', summary: 'Confirmed', detail: 'Image deleted' }); - this.user = await this.userService.getById(this.user.id); - }, - reject: () => { - console.log('deny'); - }, - }); - } + // accept: async () => { + // if (type === 'profile') { + // this.user.hasProfile = false; + // await Promise.all([this.imageService.deleteProfileImagesById(this.user.email), this.userService.save(this.user)]); + // } else { + // this.user.hasCompanyLogo = false; + // await Promise.all([this.imageService.deleteLogoImagesById(this.user.email), this.userService.save(this.user)]); + // } + // this.messageService.add({ severity: 'info', summary: 'Confirmed', detail: 'Image deleted' }); + // this.user = await this.userService.getById(this.user.id); + // }, + // reject: () => { + // console.log('deny'); + // }, + // }); + // } } diff --git a/bizmatch/src/app/pages/subscription/edit-business-listing/edit-business-listing.component.html b/bizmatch/src/app/pages/subscription/edit-business-listing/edit-business-listing.component.html index 732cee7..f9bcf38 100644 --- a/bizmatch/src/app/pages/subscription/edit-business-listing/edit-business-listing.component.html +++ b/bizmatch/src/app/pages/subscription/edit-business-listing/edit-business-listing.component.html @@ -156,10 +156,11 @@ --> +

    Edit Listing

    -
    +
    -
    -
    +
    Draft Mode (Will not be shown as public listing)
    - - + @if (mode==='create'){ + + } @else { + + }
    diff --git a/bizmatch/src/app/pages/subscription/edit-business-listing/edit-business-listing.component.scss b/bizmatch/src/app/pages/subscription/edit-business-listing/edit-business-listing.component.scss index 4f41257..8681016 100644 --- a/bizmatch/src/app/pages/subscription/edit-business-listing/edit-business-listing.component.scss +++ b/bizmatch/src/app/pages/subscription/edit-business-listing/edit-business-listing.component.scss @@ -14,14 +14,14 @@ } } -input[type='checkbox'] { - &:checked + .dot { - transform: translateX(100%); - } - &:checked + .block { - background-color: #4299e1; - } -} +// input[type='checkbox'] { +// &:checked + .dot { +// transform: translateX(100%); +// } +// &:checked + .block { +// background-color: #4299e1; +// } +// } .dot { transition: all 0.3s ease-in-out; diff --git a/bizmatch/src/app/pages/subscription/edit-business-listing/edit-business-listing.component.ts b/bizmatch/src/app/pages/subscription/edit-business-listing/edit-business-listing.component.ts index e421b45..ba9058c 100644 --- a/bizmatch/src/app/pages/subscription/edit-business-listing/edit-business-listing.component.ts +++ b/bizmatch/src/app/pages/subscription/edit-business-listing/edit-business-listing.component.ts @@ -1,4 +1,4 @@ -import { Component, ViewChild } from '@angular/core'; +import { Component } from '@angular/core'; import { ActivatedRoute, NavigationEnd, Router } from '@angular/router'; import { lastValueFrom } from 'rxjs'; import { ListingsService } from '../../../services/listings.service'; @@ -11,17 +11,12 @@ import { AngularCropperjsModule } from 'angular-cropperjs'; import { MixedCdkDragDropModule } from 'angular-mixed-cdk-drag-drop'; import { KeycloakService } from 'keycloak-angular'; import { QuillModule } from 'ngx-quill'; -import { ConfirmationService, MessageService } from 'primeng/api'; -import { CarouselModule } from 'primeng/carousel'; -import { ConfirmDialogModule } from 'primeng/confirmdialog'; -import { DialogModule } from 'primeng/dialog'; -import { DialogService, DynamicDialogModule, DynamicDialogRef } from 'primeng/dynamicdialog'; -import { EditorModule } from 'primeng/editor'; -import { FileUpload, FileUploadModule } from 'primeng/fileupload'; + +import { NgSelectModule } from '@ng-select/ng-select'; +import { NgxCurrencyDirective } from 'ngx-currency'; import { BusinessListing, CommercialPropertyListing, User } from '../../../../../../bizmatch-server/src/models/db.model'; import { AutoCompleteCompleteEvent, ImageProperty, emailToDirName } from '../../../../../../bizmatch-server/src/models/main.model'; import { environment } from '../../../../environments/environment'; -import { InputNumberModule } from '../../../components/inputnumber/inputnumber.component'; import { ArrayToStringPipe } from '../../../pipes/array-to-string.pipe'; import { GeoService } from '../../../services/geo.service'; import { ImageService } from '../../../services/image.service'; @@ -32,27 +27,12 @@ import { TOOLBAR_OPTIONS } from '../../utils/defaults'; @Component({ selector: 'business-listing', standalone: true, - imports: [ - SharedModule, - ArrayToStringPipe, - InputNumberModule, - CarouselModule, - DialogModule, - AngularCropperjsModule, - FileUploadModule, - EditorModule, - DynamicDialogModule, - DragDropModule, - ConfirmDialogModule, - MixedCdkDragDropModule, - QuillModule, - ], - providers: [MessageService, DialogService, ConfirmationService], + imports: [SharedModule, ArrayToStringPipe, AngularCropperjsModule, DragDropModule, MixedCdkDragDropModule, QuillModule, NgxCurrencyDirective, NgSelectModule], + providers: [], templateUrl: './edit-business-listing.component.html', styleUrl: './edit-business-listing.component.scss', }) export class EditBusinessListingComponent { - @ViewChild(FileUpload) public fileUpload: FileUpload; listingsCategory = 'business'; category: string; location: string; @@ -82,7 +62,6 @@ export class EditBusinessListingComponent { ]; config = { aspectRatio: 16 / 9 }; editorModules = TOOLBAR_OPTIONS; - dialogRef: DynamicDialogRef | undefined; draggedImage: ImageProperty; faTrash = faTrash; data: CommercialPropertyListing; @@ -96,12 +75,10 @@ export class EditBusinessListingComponent { private activatedRoute: ActivatedRoute, private listingsService: ListingsService, public userService: UserService, - private messageService: MessageService, private geoService: GeoService, private imageService: ImageService, private loadingService: LoadingService, - public dialogService: DialogService, - private confirmationService: ConfirmationService, + private route: ActivatedRoute, private keycloakService: KeycloakService, ) { @@ -139,7 +116,7 @@ export class EditBusinessListingComponent { async save() { this.listing = await this.listingsService.save(this.listing, this.listing.listingsCategory); this.router.navigate(['editBusinessListing', this.listing.id]); - this.messageService.add({ severity: 'info', summary: 'Confirmed', detail: 'Listing changes have been persisted', life: 3000 }); + // this.messageService.add({ severity: 'info', summary: 'Confirmed', detail: 'Listing changes have been persisted', life: 3000 }); } suggestions: string[] | undefined; diff --git a/bizmatch/src/app/pages/subscription/edit-commercial-property-listing/edit-commercial-property-listing.component.html b/bizmatch/src/app/pages/subscription/edit-commercial-property-listing/edit-commercial-property-listing.component.html index 1cbde4c..1d5a32b 100644 --- a/bizmatch/src/app/pages/subscription/edit-commercial-property-listing/edit-commercial-property-listing.component.html +++ b/bizmatch/src/app/pages/subscription/edit-commercial-property-listing/edit-commercial-property-listing.component.html @@ -1,4 +1,4 @@ -
    + @@ -95,14 +94,12 @@
    -
    Property Pictures (Pictures can be uploaded once the listing is posted initially) - -
    +
    --> diff --git a/bizmatch/src/app/pages/subscription/edit-commercial-property-listing/edit-commercial-property-listing.component.ts b/bizmatch/src/app/pages/subscription/edit-commercial-property-listing/edit-commercial-property-listing.component.ts index 424fa8b..76b86d0 100644 --- a/bizmatch/src/app/pages/subscription/edit-commercial-property-listing/edit-commercial-property-listing.component.ts +++ b/bizmatch/src/app/pages/subscription/edit-commercial-property-listing/edit-commercial-property-listing.component.ts @@ -1,28 +1,18 @@ -import { Component, ViewChild } from '@angular/core'; +import { Component } from '@angular/core'; import { ActivatedRoute, NavigationEnd, Router } from '@angular/router'; import { lastValueFrom } from 'rxjs'; import { ListingsService } from '../../../services/listings.service'; import { SelectOptionsService } from '../../../services/select-options.service'; -import { createDefaultCommercialPropertyListing, getDialogWidth, getImageDimensions, map2User, routeListingWithState } from '../../../utils/utils'; +import { createDefaultCommercialPropertyListing, map2User, routeListingWithState } from '../../../utils/utils'; import { DragDropModule, moveItemInArray } from '@angular/cdk/drag-drop'; -import { HttpEventType } from '@angular/common/http'; import { faTrash } from '@fortawesome/free-solid-svg-icons'; import { AngularCropperjsModule } from 'angular-cropperjs'; import { MixedCdkDragDropModule } from 'angular-mixed-cdk-drag-drop'; import { KeycloakService } from 'keycloak-angular'; -import { ConfirmationService, MessageService } from 'primeng/api'; -import { CarouselModule } from 'primeng/carousel'; -import { ConfirmDialogModule } from 'primeng/confirmdialog'; -import { DialogModule } from 'primeng/dialog'; -import { DialogService, DynamicDialogModule, DynamicDialogRef } from 'primeng/dynamicdialog'; -import { EditorModule } from 'primeng/editor'; -import { FileUpload, FileUploadModule } from 'primeng/fileupload'; import { BusinessListing, CommercialPropertyListing, User } from '../../../../../../bizmatch-server/src/models/db.model'; import { AutoCompleteCompleteEvent, ImageProperty, emailToDirName } from '../../../../../../bizmatch-server/src/models/main.model'; import { environment } from '../../../../environments/environment'; -import { ImageCropperComponent } from '../../../components/image-cropper/image-cropper.component'; -import { InputNumberModule } from '../../../components/inputnumber/inputnumber.component'; import { ArrayToStringPipe } from '../../../pipes/array-to-string.pipe'; import { GeoService } from '../../../services/geo.service'; import { ImageService } from '../../../services/image.service'; @@ -33,26 +23,13 @@ import { TOOLBAR_OPTIONS } from '../../utils/defaults'; @Component({ selector: 'commercial-property-listing', standalone: true, - imports: [ - SharedModule, - ArrayToStringPipe, - InputNumberModule, - CarouselModule, - DialogModule, - AngularCropperjsModule, - FileUploadModule, - EditorModule, - DynamicDialogModule, - DragDropModule, - ConfirmDialogModule, - MixedCdkDragDropModule, - ], - providers: [MessageService, DialogService, ConfirmationService], + imports: [SharedModule, ArrayToStringPipe, AngularCropperjsModule, DragDropModule, MixedCdkDragDropModule], + providers: [], templateUrl: './edit-commercial-property-listing.component.html', styleUrl: './edit-commercial-property-listing.component.scss', }) export class EditCommercialPropertyListingComponent { - @ViewChild(FileUpload) public fileUpload: FileUpload; + // @ViewChild(FileUpload) public fileUpload: FileUpload; listingsCategory = 'commercialProperty'; category: string; location: string; @@ -82,7 +59,7 @@ export class EditCommercialPropertyListingComponent { ]; config = { aspectRatio: 16 / 9 }; editorModules = TOOLBAR_OPTIONS; - dialogRef: DynamicDialogRef | undefined; + draggedImage: ImageProperty; faTrash = faTrash; suggestions: string[] | undefined; @@ -97,12 +74,11 @@ export class EditCommercialPropertyListingComponent { private activatedRoute: ActivatedRoute, private listingsService: ListingsService, public userService: UserService, - private messageService: MessageService, + private geoService: GeoService, private imageService: ImageService, private loadingService: LoadingService, - public dialogService: DialogService, - private confirmationService: ConfirmationService, + private route: ActivatedRoute, private keycloakService: KeycloakService, ) { @@ -141,7 +117,7 @@ export class EditCommercialPropertyListingComponent { async save() { this.listing = await this.listingsService.save(this.listing, this.listing.listingsCategory); this.router.navigate(['editCommercialPropertyListing', this.listing.id]); - this.messageService.add({ severity: 'info', summary: 'Confirmed', detail: 'Listing changes have been persisted', life: 3000 }); + // this.messageService.add({ severity: 'info', summary: 'Confirmed', detail: 'Listing changes have been persisted', life: 3000 }); } async search(event: AutoCompleteCompleteEvent) { @@ -149,71 +125,71 @@ export class EditCommercialPropertyListingComponent { this.suggestions = result.map(r => r.city).slice(0, 5); } - select(event: any) { - const imageUrl = URL.createObjectURL(event.files[0]); - getImageDimensions(imageUrl).then(dimensions => { - const dialogWidth = getDialogWidth(dimensions); - this.dialogRef = this.dialogService.open(ImageCropperComponent, { - data: { - imageUrl: imageUrl, - fileUpload: this.fileUpload, - ratioVariable: false, - }, - header: 'Edit Image', - width: dialogWidth, - modal: true, - closeOnEscape: true, - keepInViewport: true, - closable: false, - breakpoints: { - '960px': '75vw', - '640px': '90vw', - }, - }); - this.dialogRef.onClose.subscribe(cropper => { - if (cropper) { - this.loadingService.startLoading('uploadImage'); - cropper.getCroppedCanvas().toBlob(async blob => { - this.imageService.uploadImage(blob, 'uploadPropertyPicture', this.listing.imagePath, this.listing.serialId).subscribe( - async event => { - if (event.type === HttpEventType.Response) { - this.ts = new Date().getTime(); - console.log('Upload abgeschlossen', event.body); - this.loadingService.stopLoading('uploadImage'); - this.listing = await lastValueFrom(this.listingsService.getListingById(this.id, 'commercialProperty')); - } - }, - error => console.error('Fehler beim Upload:', error), - ); - }, 'image/jpg'); - cropper.destroy(); - } - }); - }); - } + // select(event: any) { + // const imageUrl = URL.createObjectURL(event.files[0]); + // getImageDimensions(imageUrl).then(dimensions => { + // const dialogWidth = getDialogWidth(dimensions); + // this.dialogRef = this.dialogService.open(ImageCropperComponent, { + // data: { + // imageUrl: imageUrl, + // fileUpload: this.fileUpload, + // ratioVariable: false, + // }, + // header: 'Edit Image', + // width: dialogWidth, + // modal: true, + // closeOnEscape: true, + // keepInViewport: true, + // closable: false, + // breakpoints: { + // '960px': '75vw', + // '640px': '90vw', + // }, + // }); + // this.dialogRef.onClose.subscribe(cropper => { + // if (cropper) { + // this.loadingService.startLoading('uploadImage'); + // cropper.getCroppedCanvas().toBlob(async blob => { + // this.imageService.uploadImage(blob, 'uploadPropertyPicture', this.listing.imagePath, this.listing.serialId).subscribe( + // async event => { + // if (event.type === HttpEventType.Response) { + // this.ts = new Date().getTime(); + // console.log('Upload abgeschlossen', event.body); + // this.loadingService.stopLoading('uploadImage'); + // this.listing = await lastValueFrom(this.listingsService.getListingById(this.id, 'commercialProperty')); + // } + // }, + // error => console.error('Fehler beim Upload:', error), + // ); + // }, 'image/jpg'); + // cropper.destroy(); + // } + // }); + // }); + // } - deleteConfirm(imageName: string) { - this.confirmationService.confirm({ - target: event.target as EventTarget, - message: `Do you want to delete this image ${imageName}?`, - header: 'Delete Confirmation', - icon: 'pi pi-info-circle', - acceptButtonStyleClass: 'p-button-danger p-button-text', - rejectButtonStyleClass: 'p-button-text p-button-text', - acceptIcon: 'none', - rejectIcon: 'none', + // deleteConfirm(imageName: string) { + // this.confirmationService.confirm({ + // target: event.target as EventTarget, + // message: `Do you want to delete this image ${imageName}?`, + // header: 'Delete Confirmation', + // icon: 'pi pi-info-circle', + // acceptButtonStyleClass: 'p-button-danger p-button-text', + // rejectButtonStyleClass: 'p-button-text p-button-text', + // acceptIcon: 'none', + // rejectIcon: 'none', - accept: async () => { - this.listing.imageOrder = this.listing.imageOrder.filter(item => item !== imageName); - await Promise.all([this.imageService.deleteListingImage(this.listing.imagePath, this.listing.serialId, imageName), this.listingsService.save(this.listing, 'commercialProperty')]); - this.messageService.add({ severity: 'info', summary: 'Confirmed', detail: 'Image deleted' }); - }, - reject: () => { - // this.messageService.add({ severity: 'error', summary: 'Rejected', detail: 'You have rejected' }); - console.log('deny'); - }, - }); - } + // accept: async () => { + // this.listing.imageOrder = this.listing.imageOrder.filter(item => item !== imageName); + // await Promise.all([this.imageService.deleteListingImage(this.listing.imagePath, this.listing.serialId, imageName), this.listingsService.save(this.listing, 'commercialProperty')]); + // this.messageService.add({ severity: 'info', summary: 'Confirmed', detail: 'Image deleted' }); + // }, + // reject: () => { + // // this.messageService.add({ severity: 'error', summary: 'Rejected', detail: 'You have rejected' }); + // console.log('deny'); + // }, + // }); + // } onDrop(event: { previousIndex: number; currentIndex: number }) { moveItemInArray(this.listing.imageOrder, event.previousIndex, event.currentIndex); diff --git a/bizmatch/src/app/pages/subscription/email-us/email-us.component.html b/bizmatch/src/app/pages/subscription/email-us/email-us.component.html index 0d8cf69..72f1d24 100644 --- a/bizmatch/src/app/pages/subscription/email-us/email-us.component.html +++ b/bizmatch/src/app/pages/subscription/email-us/email-us.component.html @@ -1,4 +1,4 @@ -
    + diff --git a/bizmatch/src/app/pages/subscription/email-us/email-us.component.ts b/bizmatch/src/app/pages/subscription/email-us/email-us.component.ts index 7b69c9d..c80c44d 100644 --- a/bizmatch/src/app/pages/subscription/email-us/email-us.component.ts +++ b/bizmatch/src/app/pages/subscription/email-us/email-us.component.ts @@ -1,8 +1,6 @@ import { Component } from '@angular/core'; import { KeycloakService } from 'keycloak-angular'; -import { MessageService } from 'primeng/api'; -import { InputMaskModule } from 'primeng/inputmask'; import { User } from '../../../../../../bizmatch-server/src/models/db.model'; import { ErrorResponse, KeycloakUser, MailInfo } from '../../../../../../bizmatch-server/src/models/main.model'; import { environment } from '../../../../environments/environment'; @@ -13,8 +11,8 @@ import { map2User } from '../../../utils/utils'; @Component({ selector: 'app-email-us', standalone: true, - imports: [SharedModule, InputMaskModule], - providers: [MessageService], + imports: [SharedModule], + providers: [], templateUrl: './email-us.component.html', styleUrl: './email-us.component.scss', }) @@ -23,7 +21,7 @@ export class EmailUsComponent { keycloakUser: KeycloakUser; user: User; errorResponse: ErrorResponse; - constructor(private mailService: MailService, private userService: UserService, public keycloakService: KeycloakService, private messageService: MessageService) { + constructor(private mailService: MailService, private userService: UserService, public keycloakService: KeycloakService) { this.mailinfo = { sender: {}, userId: '', email: '', url: environment.mailinfoUrl }; } async ngOnInit() { @@ -41,7 +39,7 @@ export class EmailUsComponent { this.errorResponse = result as ErrorResponse; } else { this.errorResponse = null; - this.messageService.add({ severity: 'info', summary: 'Confirmed', detail: 'Your request has been forwarded to the support team of bizmatch.', life: 3000 }); + // this.messageService.add({ severity: 'info', summary: 'Confirmed', detail: 'Your request has been forwarded to the support team of bizmatch.', life: 3000 }); } } containsError(fieldname: string) { diff --git a/bizmatch/src/app/pages/subscription/favorites/favorites.component.html b/bizmatch/src/app/pages/subscription/favorites/favorites.component.html index 16cd4bf..fc8b0e9 100644 --- a/bizmatch/src/app/pages/subscription/favorites/favorites.component.html +++ b/bizmatch/src/app/pages/subscription/favorites/favorites.component.html @@ -1,4 +1,4 @@ - + diff --git a/bizmatch/src/app/pages/subscription/favorites/favorites.component.ts b/bizmatch/src/app/pages/subscription/favorites/favorites.component.ts index 492de0b..ebbb9a1 100644 --- a/bizmatch/src/app/pages/subscription/favorites/favorites.component.ts +++ b/bizmatch/src/app/pages/subscription/favorites/favorites.component.ts @@ -5,12 +5,11 @@ import { ListingsService } from '../../../services/listings.service'; import { SelectOptionsService } from '../../../services/select-options.service'; import { SharedModule } from '../../../shared/shared/shared.module'; import { map2User } from '../../../utils/utils'; -import { MenuAccountComponent } from '../../menu-account/menu-account.component'; @Component({ selector: 'app-favorites', standalone: true, - imports: [MenuAccountComponent, SharedModule], + imports: [SharedModule], templateUrl: './favorites.component.html', styleUrl: './favorites.component.scss', }) diff --git a/bizmatch/src/app/pages/subscription/my-listing/my-listing.component.html b/bizmatch/src/app/pages/subscription/my-listing/my-listing.component.html index 1f9b947..ea0e31e 100644 --- a/bizmatch/src/app/pages/subscription/my-listing/my-listing.component.html +++ b/bizmatch/src/app/pages/subscription/my-listing/my-listing.component.html @@ -1,4 +1,4 @@ -
    + diff --git a/bizmatch/src/app/pages/subscription/my-listing/my-listing.component.ts b/bizmatch/src/app/pages/subscription/my-listing/my-listing.component.ts index ca705b1..8921e3c 100644 --- a/bizmatch/src/app/pages/subscription/my-listing/my-listing.component.ts +++ b/bizmatch/src/app/pages/subscription/my-listing/my-listing.component.ts @@ -1,6 +1,5 @@ import { ChangeDetectorRef, Component } from '@angular/core'; import { KeycloakService } from 'keycloak-angular'; -import { ConfirmationService, MessageService } from 'primeng/api'; import { CommercialPropertyListing, User } from '../../../../../../bizmatch-server/src/models/db.model'; import { ListingType } from '../../../../../../bizmatch-server/src/models/main.model'; import { ListingsService } from '../../../services/listings.service'; @@ -8,12 +7,12 @@ import { SelectOptionsService } from '../../../services/select-options.service'; import { UserService } from '../../../services/user.service'; import { SharedModule } from '../../../shared/shared/shared.module'; import { map2User } from '../../../utils/utils'; -import { MenuAccountComponent } from '../../menu-account/menu-account.component'; + @Component({ selector: 'app-my-listing', standalone: true, - imports: [MenuAccountComponent, SharedModule], - providers: [ConfirmationService, MessageService], + imports: [SharedModule], + providers: [], templateUrl: './my-listing.component.html', styleUrl: './my-listing.component.scss', }) @@ -21,15 +20,7 @@ export class MyListingComponent { listings: Array = []; //dataListings as unknown as Array; myListings: Array; user: User; - constructor( - public userService: UserService, - public keycloakService: KeycloakService, - private listingsService: ListingsService, - private cdRef: ChangeDetectorRef, - public selectOptions: SelectOptionsService, - private confirmationService: ConfirmationService, - private messageService: MessageService, - ) {} + constructor(public userService: UserService, public keycloakService: KeycloakService, private listingsService: ListingsService, private cdRef: ChangeDetectorRef, public selectOptions: SelectOptionsService) {} async ngOnInit() { // const keycloakUser = this.userService.getKeycloakUser(); const token = await this.keycloakService.getToken(); @@ -51,14 +42,14 @@ export class MyListingComponent { } confirm(event: Event, listing: ListingType) { - this.confirmationService.confirm({ - target: event.target as EventTarget, - message: 'Are you sure you want to delet this listing?', - icon: 'pi pi-exclamation-triangle', - accept: () => { - this.messageService.add({ severity: 'info', summary: 'Confirmed', detail: 'Listing has been deleted', life: 3000 }); - this.deleteListing(listing); - }, - }); + // this.confirmationService.confirm({ + // target: event.target as EventTarget, + // message: 'Are you sure you want to delet this listing?', + // icon: 'pi pi-exclamation-triangle', + // accept: () => { + // this.messageService.add({ severity: 'info', summary: 'Confirmed', detail: 'Listing has been deleted', life: 3000 }); + // this.deleteListing(listing); + // }, + // }); } } diff --git a/bizmatch/src/app/pages/terms-of-use/terms-of-use.component.html b/bizmatch/src/app/pages/terms-of-use/terms-of-use.component.html deleted file mode 100644 index 44aa92d..0000000 --- a/bizmatch/src/app/pages/terms-of-use/terms-of-use.component.html +++ /dev/null @@ -1,455 +0,0 @@ -
    -
    -
    -
    - AGREEMENT BETWEEN USER AND BizMatch

    -

    - The BizMatch Web Site is comprised of various Web pages operated - by BizMatch. -

    -

    - The BizMatch Web Site is offered to you conditioned on your - acceptance without modification of the terms, conditions, and - notices contained herein. Your use of the BizMatch Web Site - constitutes your agreement to all such terms, conditions, and - notices. -

    -

    - MODIFICATION OF THESE TERMS OF USE -

    -

    - BizMatch reserves the right to change the terms, conditions, and - notices under which the BizMatch Web Site is offered, including - but not limited to the charges associated with the use of the - BizMatch Web Site. -

    -

    - LINKS TO THIRD PARTY SITES -

    -

    - The BizMatch Web Site may contain links to other Web Sites - ("Linked Sites"). The Linked Sites are not under the control of - BizMatch and BizMatch is not responsible for the contents of any - Linked Site, including without limitation any link contained in a - Linked Site, or any changes or updates to a Linked Site. BizMatch - is not responsible for webcasting or any other form of - transmission received from any Linked Site. BizMatch is providing - these links to you only as a convenience, and the inclusion of any - link does not imply endorsement by BizMatch of the site or any - association with its operators. -

    -

    - NO UNLAWFUL OR PROHIBITED USE -

    -

    - As a condition of your use of the BizMatch Web Site, you warrant - to BizMatch that you will not use the BizMatch Web Site for any - purpose that is unlawful or prohibited by these terms, conditions, - and notices. You may not use the BizMatch Web Site in any manner - which could damage, disable, overburden, or impair the BizMatch - Web Site or interfere with any other party’s use and enjoyment of - the BizMatch Web Site. You may not obtain or attempt to obtain any - materials or information through any means not intentionally made - available or provided for through the BizMatch Web Sites. -

    -

    - USE OF COMMUNICATION SERVICES -

    -

    - The BizMatch Web Site may contain bulletin board services, chat - areas, news groups, forums, communities, personal web pages, - calendars, and/or other message or communication facilities - designed to enable you to communicate with the public at large or - with a group (collectively, "Communication Services"), you agree - to use the Communication Services only to post, send and receive - messages and material that are proper and related to the - particular Communication Service. By way of example, and not as a - limitation, you agree that when using a Communication Service, you - will not: -

    -

     

    -

    -

    - §  Defame, abuse, harass, stalk, threaten or otherwise violate the - legal rights (such as rights of privacy and publicity) of - others. -

    -

     

    -

    - §  Publish, post, upload, distribute or disseminate any - inappropriate, profane, defamatory, infringing, obscene, indecent - or unlawful topic, name, material or information. -

    -

    - §  Upload files that contain software or other material protected by - intellectual property laws (or by rights of privacy of publicity) - unless you own or control the rights thereto or have received all - necessary consents. -

    -

    - §  Upload files that contain viruses, corrupted files, or any other - similar software or programs that may damage the operation of - another’s computer. -

    -

    - §  Advertise or offer to sell or buy any goods or services for any - business purpose, unless such Communication Service specifically - allows such messages. -

    -

    - §  Conduct or forward surveys, contests, pyramid schemes or chain - letters. -

    -

    - §  Download any file posted by another user of a Communication - Service that you know, or reasonably should know, cannot be - legally distributed in such manner. -

    -

    - §  Falsify or delete any author attributions, legal or other proper - notices or proprietary designations or labels of the origin or - source of software or other material contained in a file that is - uploaded. -

    -

    - §  Restrict or inhibit any other user from using and enjoying the - Communication Services. -

    -

    - §  Violate any code of conduct or other guidelines which may be - applicable for any particular Communication Service. -

    -

    - §  Harvest or otherwise collect information about others, including - e-mail addresses, without their consent. -

    -

    - §  Violate any applicable laws or regulations. -

    -

    - BizMatch has no obligation to monitor the Communication Services. - However, BizMatch reserves the right to review materials posted to - a Communication Service and to remove any materials in its sole - discretion. BizMatch reserves the right to terminate your access - to any or all of the Communication Services at any time without - notice for any reason whatsoever. -

    -

    - BizMatch reserves the right at all times to disclose any - information as necessary to satisfy any applicable law, - regulation, legal process or governmental request, or to edit, - refuse to post or to remove any information or materials, in whole - or in part, in BizMatch’s sole discretion. -

    -

    - Always use caution when giving out any personally identifying - information about yourself or your children in any Communication - Service. BizMatch does not control or endorse the content, - messages or information found in any Communication Service and, - therefore, BizMatch specifically disclaims any liability with - regard to the Communication Services and any actions resulting - from your participation in any Communication Service. Managers and - hosts are not authorized BizMatch spokespersons, and their views - do not necessarily reflect those of BizMatch. -

    -

    - Materials uploaded to a Communication Service may be subject to - posted limitations on usage, reproduction and/or dissemination. - You are responsible for adhering to such limitations if you - download the materials. -

    -

    - MATERIALS PROVIDED TO BizMatch OR POSTED AT ANY BizMatch WEB - SITE -

    -

    - BizMatch does not claim ownership of the materials you provide to - BizMatch (including feedback and suggestions) or post, upload, - input or submit to any BizMatch Web Site or its associated - services (collectively "Submissions"). However, by posting, - uploading, inputting, providing or submitting your Submission you - are granting BizMatch, its affiliated companies and necessary - sublicensees permission to use your Submission in connection with - the operation of their Internet businesses including, without - limitation, the rights to: copy, distribute, transmit, publicly - display, publicly perform, reproduce, edit, translate and reformat - your Submission; and to publish your name in connection with your - Submission. -

    -

    - No compensation will be paid with respect to the use of your - Submission, as provided herein. BizMatch is under no obligation to - post or use any Submission you may provide and may remove any - Submission at any time in BizMatch’s sole discretion. -

    -

    - By posting, uploading, inputting, providing or submitting your - Submission you warrant and represent that you own or otherwise - control all of the rights to your Submission as described in this - section including, without limitation, all the rights necessary - for you to provide, post, upload, input or submit the - Submissions. -

    -

    - LIABILITY DISCLAIMER -

    -

    - THE INFORMATION, SOFTWARE, PRODUCTS, AND SERVICES INCLUDED IN OR - AVAILABLE THROUGH THE BizMatch WEB SITE MAY INCLUDE INACCURACIES - OR TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLY ADDED TO THE - INFORMATION HEREIN. BizMatch AND/OR ITS SUPPLIERS MAY MAKE - IMPROVEMENTS AND/OR CHANGES IN THE BizMatch WEB SITE AT ANY TIME. - ADVICE RECEIVED VIA THE BizMatch WEB SITE SHOULD NOT BE RELIED - UPON FOR PERSONAL, MEDICAL, LEGAL OR FINANCIAL DECISIONS AND YOU - SHOULD CONSULT AN APPROPRIATE PROFESSIONAL FOR SPECIFIC ADVICE - TAILORED TO YOUR SITUATION. -

    -

    - BizMatch AND/OR ITS SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE - SUITABILITY, RELIABILITY, AVAILABILITY, TIMELINESS, AND ACCURACY - OF THE INFORMATION, SOFTWARE, PRODUCTS, SERVICES AND RELATED - GRAPHICS CONTAINED ON THE BizMatch WEB SITE FOR ANY PURPOSE. TO - THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, ALL SUCH - INFORMATION, SOFTWARE, PRODUCTS, SERVICES AND RELATED GRAPHICS ARE - PROVIDED "AS IS" WITHOUT WARRANTY OR CONDITION OF ANY KIND. - BizMatch AND/OR ITS SUPPLIERS HEREBY DISCLAIM ALL WARRANTIES AND - CONDITIONS WITH REGARD TO THIS INFORMATION, SOFTWARE, PRODUCTS, - SERVICES AND RELATED GRAPHICS, INCLUDING ALL IMPLIED WARRANTIES OR - CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, - TITLE AND NON-INFRINGEMENT. -

    -

    - TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT - SHALL BizMatch AND/OR ITS SUPPLIERS BE LIABLE FOR ANY DIRECT, - INDIRECT, PUNITIVE, INCIDENTAL, SPECIAL, CONSEQUENTIAL DAMAGES OR - ANY DAMAGES WHATSOEVER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR - LOSS OF USE, DATA OR PROFITS, ARISING OUT OF OR IN ANY WAY - CONNECTED WITH THE USE OR PERFORMANCE OF THE BizMatch WEB SITE, - WITH THE DELAY OR INABILITY TO USE THE BizMatch WEB SITE OR - RELATED SERVICES, THE PROVISION OF OR FAILURE TO PROVIDE SERVICES, - OR FOR ANY INFORMATION, SOFTWARE, PRODUCTS, SERVICES AND RELATED - GRAPHICS OBTAINED THROUGH THE BizMatch WEB SITE, OR OTHERWISE - ARISING OUT OF THE USE OF THE BizMatch WEB SITE, WHETHER BASED ON - CONTRACT, TORT, NEGLIGENCE, STRICT LIABILITY OR OTHERWISE, EVEN IF - BizMatch OR ANY OF ITS SUPPLIERS HAS BEEN ADVISED OF THE - POSSIBILITY OF DAMAGES. BECAUSE SOME STATES/JURISDICTIONS DO NOT - ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL - OR INCIDENTAL DAMAGES, THE ABOVE LIMITATION MAY NOT APPLY TO YOU. - IF YOU ARE DISSATISFIED WITH ANY PORTION OF THE BizMatch WEB SITE, - OR WITH ANY OF THESE TERMS OF USE, YOUR SOLE AND EXCLUSIVE REMEDY - IS TO DISCONTINUE USING THE BizMatch WEB SITE. -

    -

    - SERVICE CONTACT : bizmatch@biz-match.com -

    -

    - TERMINATION/ACCESS RESTRICTION -

    -

    - BizMatch reserves the right, in its sole discretion, to terminate - your access to the BizMatch Web Site and the related services or - any portion thereof at any time, without notice. GENERAL To the - maximum extent permitted by law, this agreement is governed by the - laws of the State of Washington, U.S.A. and you hereby consent to - the exclusive jurisdiction and venue of courts in King County, - Washington, U.S.A. in all disputes arising out of or relating to - the use of the BizMatch Web Site. Use of the BizMatch Web Site is - unauthorized in any jurisdiction that does not give effect to all - provisions of these terms and conditions, including without - limitation this paragraph. You agree that no joint venture, - partnership, employment, or agency relationship exists between you - and BizMatch as a result of this agreement or use of the BizMatch - Web Site. BizMatch’s performance of this agreement is subject to - existing laws and legal process, and nothing contained in this - agreement is in derogation of BizMatch’s right to comply with - governmental, court and law enforcement requests or requirements - relating to your use of the BizMatch Web Site or information - provided to or gathered by BizMatch with respect to such use. If - any part of this agreement is determined to be invalid or - unenforceable pursuant to applicable law including, but not - limited to, the warranty disclaimers and liability limitations set - forth above, then the invalid or unenforceable provision will be - deemed superseded by a valid, enforceable provision that most - closely matches the intent of the original provision and the - remainder of the agreement shall continue in effect. Unless - otherwise specified herein, this agreement constitutes the entire - agreement between the user and BizMatch with respect to the - BizMatch Web Site and it supersedes all prior or contemporaneous - communications and proposals, whether electronic, oral or written, - between the user and BizMatch with respect to the BizMatch Web - Site. A printed version of this agreement and of any notice given - in electronic form shall be admissible in judicial or - administrative proceedings based upon or relating to this - agreement to the same extent an d subject to the same conditions - as other business documents and records originally generated and - maintained in printed form. It is the express wish to the parties - that this agreement and all related documents be drawn up in - English. -

    -

    - COPYRIGHT AND TRADEMARK NOTICES: -

    -

    - All contents of the BizMatch Web Site are: Copyright 2011 by - Bizmatch Business Solutions and/or its suppliers. All rights - reserved. -

    -

    - TRADEMARKS -

    -

    - The names of actual companies and products mentioned herein may - be the trademarks of their respective owners. -

    -

    - The example companies, organizations, products, people and events - depicted herein are fictitious. No association with any real - company, organization, product, person, or event is intended or - should be inferred. -

    -

    - Any rights not expressly granted herein are reserved. -

    -

    - NOTICES AND PROCEDURE FOR MAKING CLAIMS OF COPYRIGHT - INFRINGEMENT -

    -

    - Pursuant to Title 17, United States Code, Section 512(c)(2), - notifications of claimed copyright infringement under United - States copyright law should be sent to Service Provider’s - Designated Agent. ALL INQUIRIES NOT RELEVANT TO THE FOLLOWING - PROCEDURE WILL RECEIVE NO RESPONSE. See Notice and Procedure for - Making Claims of Copyright Infringement.
    -
    -

    -

     

    -

    - We reserve the right to update or revise these Terms of Use at any - time without notice. Please check the Terms of Use periodically - for changes. The revised terms will be effective immediately as - soon as they are posted on the WebSite and by continuing to use - the Site you agree to be bound by the revised terms
    -
    -

    -
    -
    -
    -
    diff --git a/bizmatch/src/app/pages/terms-of-use/terms-of-use.component.scss b/bizmatch/src/app/pages/terms-of-use/terms-of-use.component.scss deleted file mode 100644 index e69de29..0000000 diff --git a/bizmatch/src/app/pages/terms-of-use/terms-of-use.component.ts b/bizmatch/src/app/pages/terms-of-use/terms-of-use.component.ts deleted file mode 100644 index 7b2dd03..0000000 --- a/bizmatch/src/app/pages/terms-of-use/terms-of-use.component.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { Component } from '@angular/core'; - -@Component({ - selector: 'app-terms-of-use', - standalone: true, - imports: [], - templateUrl: './terms-of-use.component.html', - styleUrl: './terms-of-use.component.scss' -}) -export class TermsOfUseComponent { - -} diff --git a/bizmatch/src/app/services/select-options.service.ts b/bizmatch/src/app/services/select-options.service.ts index 11a9c98..921ef64 100644 --- a/bizmatch/src/app/services/select-options.service.ts +++ b/bizmatch/src/app/services/select-options.service.ts @@ -64,4 +64,7 @@ export class SelectOptionsService { const category = this.typesOfBusiness.find(c => c.value === String(value)); return `${category?.icon} ${category?.textColorClass}`; } + getIconTypeOfCommercials(value: number): string { + return this.typesOfCommercialProperty.find(c => c.value === String(value))?.icon; + } } diff --git a/bizmatch/src/app/shared/shared/shared.module.ts b/bizmatch/src/app/shared/shared/shared.module.ts index 0eb3f9d..6e7a6be 100644 --- a/bizmatch/src/app/shared/shared/shared.module.ts +++ b/bizmatch/src/app/shared/shared/shared.module.ts @@ -3,72 +3,9 @@ import { NgModule } from '@angular/core'; import { FormsModule } from '@angular/forms'; import { RouterModule } from '@angular/router'; import { FontAwesomeModule } from '@fortawesome/angular-fontawesome'; -import { AutoCompleteModule } from 'primeng/autocomplete'; -import { ButtonModule } from 'primeng/button'; -import { CheckboxModule } from 'primeng/checkbox'; -import { ChipModule } from 'primeng/chip'; -import { ConfirmDialogModule } from 'primeng/confirmdialog'; -import { ConfirmPopupModule } from 'primeng/confirmpopup'; -import { DividerModule } from 'primeng/divider'; -import { DropdownModule } from 'primeng/dropdown'; -import { InputGroupModule } from 'primeng/inputgroup'; -import { InputNumberModule } from 'primeng/inputnumber'; -import { InputSwitchModule } from 'primeng/inputswitch'; -import { InputTextModule } from 'primeng/inputtext'; -import { InputTextareaModule } from 'primeng/inputtextarea'; -import { StyleClassModule } from 'primeng/styleclass'; -import { TableModule } from 'primeng/table'; -import { TagModule } from 'primeng/tag'; -import { ToastModule } from 'primeng/toast'; -import { MenuAccountComponent } from '../../pages/menu-account/menu-account.component'; @NgModule({ declarations: [], - imports: [ - CommonModule, - StyleClassModule, - DividerModule, - ButtonModule, - TableModule, - InputTextModule, - DropdownModule, - FormsModule, - ChipModule, - InputTextareaModule, - RouterModule, - FontAwesomeModule, - MenuAccountComponent, - InputNumberModule, - ConfirmDialogModule, - ConfirmPopupModule, - ToastModule, - CheckboxModule, - AutoCompleteModule, - InputSwitchModule, - InputGroupModule, - ], - exports: [ - CommonModule, - StyleClassModule, - DividerModule, - ButtonModule, - TableModule, - InputTextModule, - DropdownModule, - FormsModule, - ChipModule, - InputTextareaModule, - RouterModule, - FontAwesomeModule, - MenuAccountComponent, - InputNumberModule, - ConfirmDialogModule, - ConfirmPopupModule, - ToastModule, - CheckboxModule, - AutoCompleteModule, - TagModule, - InputSwitchModule, - InputGroupModule, - ], + imports: [CommonModule, FormsModule, RouterModule, FontAwesomeModule], + exports: [CommonModule, FormsModule, RouterModule, FontAwesomeModule], }) export class SharedModule {} diff --git a/bizmatch/src/styles.scss b/bizmatch/src/styles.scss index ba32201..8002dee 100644 --- a/bizmatch/src/styles.scss +++ b/bizmatch/src/styles.scss @@ -1,6 +1,6 @@ // @import 'primeng/resources/primeng.css'; // @import 'primeicons/primeicons.css'; - +@import '@ng-select/ng-select/themes/default.theme.css'; // @import 'primeflex/primeflex.css'; @import url('https://fonts.googleapis.com/css?family=Open+Sans&display=swap'); // @import 'primeng/resources/themes/lara-light-blue/theme.css';