@sd-angular/core 1.3.72 → 1.3.74
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/img/plus-search-zoom-white.png +0 -0
- package/autocomplete/sd-angular-core-autocomplete.metadata.json +1 -1
- package/bundles/sd-angular-core-autocomplete.umd.js +1 -1
- package/bundles/sd-angular-core-autocomplete.umd.js.map +1 -1
- package/bundles/sd-angular-core-autocomplete.umd.min.js +2 -2
- package/bundles/sd-angular-core-autocomplete.umd.min.js.map +1 -1
- package/bundles/sd-angular-core-comment.umd.js +52 -10
- package/bundles/sd-angular-core-comment.umd.js.map +1 -1
- package/bundles/sd-angular-core-comment.umd.min.js +2 -2
- package/bundles/sd-angular-core-comment.umd.min.js.map +1 -1
- package/bundles/sd-angular-core-editor.umd.js +1 -1
- package/bundles/sd-angular-core-editor.umd.min.js +1 -1
- package/bundles/sd-angular-core-editor.umd.min.js.map +1 -1
- package/comment/sd-angular-core-comment.metadata.json +1 -1
- package/comment/src/lib/comment.component.d.ts +5 -1
- package/comment/src/lib/comment.model.d.ts +4 -0
- package/editor/sd-angular-core-editor.metadata.json +1 -1
- package/esm2015/autocomplete/src/lib/autocomplete.component.js +2 -2
- package/esm2015/comment/src/lib/comment.component.js +40 -7
- package/esm2015/comment/src/lib/comment.model.js +1 -1
- package/esm2015/editor/src/lib/editor.component.js +1 -1
- package/fesm2015/sd-angular-core-autocomplete.js +1 -1
- package/fesm2015/sd-angular-core-autocomplete.js.map +1 -1
- package/fesm2015/sd-angular-core-comment.js +39 -6
- package/fesm2015/sd-angular-core-comment.js.map +1 -1
- package/fesm2015/sd-angular-core-editor.js +1 -1
- package/package.json +1 -1
- package/sd-angular-core-1.3.74.tgz +0 -0
- package/sd-angular-core-1.3.72.tgz +0 -0
|
@@ -377,7 +377,7 @@ _model = new WeakMap(), _delay = new WeakMap(), _name = new WeakMap(), _form = n
|
|
|
377
377
|
SdAutocomplete.decorators = [
|
|
378
378
|
{ type: Component, args: [{
|
|
379
379
|
selector: 'sd-autocomplete',
|
|
380
|
-
template: "<label *ngIf=\"!appearance && label && !sdLabelDef?.templateRef\" class=\"d-block mb-0 T14M\">{{label}} <span
|
|
380
|
+
template: "<label *ngIf=\"!appearance && label && !sdLabelDef?.templateRef\" class=\"d-block mb-0 T14M\">{{label}} <span\r\n class=\"text-danger mb-2\" *ngIf=\"isRequired\">*</span></label>\r\n<ng-container *ngIf=\"sdLabelDef?.templateRef\" matSuffix>\r\n <ng-container *ngTemplateOutlet=\"sdLabelDef.templateRef\">\r\n </ng-container>\r\n</ng-container>\r\n<div class=\"d-flex align-items-center\" [class.sd-view]=\"sdView?.templateRef\" [class.c-focused]=\"isFocused\"\r\n [class.c-disabled]=\"formControl.disabled\" (click)=\"onClick()\">\r\n <ng-container *ngIf=\"sdView?.templateRef && !autocompleteTrigger?.panelOpen && !isFocused; else default\">\r\n <ng-container\r\n *ngTemplateOutlet=\"sdView.templateRef;context: { value: formControl.value, selectedItem: selected | async }\">\r\n </ng-container>\r\n </ng-container>\r\n <ng-template #default>\r\n <mat-form-field class=\"sd-md\" [ngClass]=\"{'sd-sm': size === 'sm', 'no-padding-wrapper': disableErrorMessage}\"\r\n [floatLabel]=\"size === 'sm' || formControl.value ? 'always':'auto'\" [appearance]=\"appearance || 'outline'\">\r\n <mat-label *ngIf=\"appearance && label\">{{ label }}</mat-label>\r\n <input [id]=\"id\" #autocompleteTrigger [formControl]=\"inputControl\" [placeholder]=\"controlPlaceHolder | async\"\r\n [ngClass]=\"{'c-selected': formControl?.value}\" [matAutocomplete]=\"auto\" (focus)=\"onFocus()\" (blur)=\"onBlur()\"\r\n matInput [autocomplete]=\"id\" autocorrect=\"off\" [errorStateMatcher]=\"matcher\" [required]=\"isRequired\"\r\n [attr.data-qclabel]=\"label\" [attr.data-qcid]=\"qcId\" [sdPopoverTriggerFor]=\"null\"\r\n [sdPopoverDisabled]=\"!disableErrorMessage || formControl.valid\" #input />\r\n <mat-icon *ngIf=\"!loading && formControl?.value && !inputControl.disabled\" class=\"pointer sd-suffix-icon\"\r\n (click)=\"clear($event)\" matSuffix>cancel\r\n </mat-icon>\r\n <mat-icon *ngIf=\"actionIcon && !loading && !formControl?.value && !inputControl.disabled\"\r\n class=\"pointer sd-suffix-icon\" (click)=\"onAction($event)\" matSuffix>{{actionIcon}}\r\n </mat-icon>\r\n <i [ngClass]=\"{'d-none': !loading}\" class=\"fa fa-spinner fa-pulse c-loading-icon\"></i>\r\n <mat-autocomplete #auto=\"matAutocomplete\" (optionSelected)=\"onSelect($event.option.value)\">\r\n <ng-container *ngIf=\"filteredItems | async as items\">\r\n <ng-container *ngIf=\"items.length\">\r\n <mat-option *ngFor=\"let item of items\" [value]=\"item\" matTooltipPosition=\"above\"\r\n [matTooltip]=\"displayField ? item[displayField] : item\">\r\n <ng-container *ngIf=\"autocompleteDisplayDef?.templateRef\">\r\n <ng-container *ngTemplateOutlet=\"autocompleteDisplayDef.templateRef;context:{item: item}\">\r\n </ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"!autocompleteDisplayDef?.templateRef\">\r\n {{ displayField ? item[displayField] : item }}\r\n </ng-container>\r\n </mat-option>\r\n </ng-container>\r\n <mat-option *ngIf=\"!items.length && inputControl.value && !isTyping && !loading\" [value]=\"\"\r\n class=\"T14R text-grey\">\r\n Kh\u00F4ng c\u00F3 d\u1EEF li\u1EC7u\r\n </mat-option>\r\n <mat-option class=\"sd__option--add\" *ngIf=\"!hiddenAdd && sdAdd?.observers?.length\"\r\n (keyup.Space)=\"$event.stopPropagation()\" disabled=\"true\">\r\n <div (click)=\"onAdd($event)\">\r\n <mat-icon class=\"mr-1\">add</mat-icon>\r\n {{'New item' | sdTranslate}}\r\n </div>\r\n </mat-option>\r\n </ng-container>\r\n </mat-autocomplete>\r\n <mat-error *ngIf=\"formControl?.errors?.required\">\r\n <ng-container *ngIf=\"!disableErrorMessage\">{{ \"This field is required\" | sdTranslate }}</ng-container>\r\n </mat-error>\r\n <mat-error *ngIf=\"formControl.errors?.customValidator\">\r\n <ng-container *ngIf=\"!disableErrorMessage\">{{formControl.errors?.customValidator}}</ng-container>\r\n </mat-error>\r\n </mat-form-field>\r\n </ng-template>\r\n</div>\r\n<!-- <sd-popover #error=\"sdPopover\" type=\"danger\" width=\"300px\">\r\n <span *ngIf=\"formControl.errors?.required\">\r\n {{ \"This field is required\" | sdTranslate }}\r\n </span>\r\n</sd-popover> -->",
|
|
381
381
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
382
382
|
styles: [":host{display:block;padding-top:5px}:host ::ng-deep .mat-form-field.no-padding-wrapper .mat-form-field-wrapper{padding-bottom:0}:host ::ng-deep .mat-form-field.mat-form-field-appearance-outline.mat-form-field-disabled .mat-form-field-outline{background:#f6f6f6;color:#e9e9e9}:host ::ng-deep .mat-form-field input.c-selected::-moz-placeholder{color:#000;opacity:1}:host ::ng-deep .mat-form-field input.c-selected::placeholder{color:#000;opacity:1}:host ::ng-deep .mat-form-field input.c-selected:-ms-input-placeholder{color:#000}:host ::ng-deep .mat-form-field input.c-selected::-ms-input-placeholder{color:#000}:host ::ng-deep .mat-form-field input.mat-input-element:disabled{color:#4d4d4d}:host ::ng-deep .mat-form-field input.mat-input-element:disabled.c-selected::-moz-placeholder{color:#4d4d4d}:host ::ng-deep .mat-form-field input.mat-input-element:disabled.c-selected::placeholder{color:#4d4d4d}:host ::ng-deep .mat-form-field input.mat-input-element:disabled.c-selected:-ms-input-placeholder{color:#4d4d4d}:host ::ng-deep .mat-form-field input.mat-input-element:disabled.c-selected::-ms-input-placeholder{color:#4d4d4d}:host ::ng-deep .mat-form-field .mat-placeholder-required{color:#f82c13}.sd-view:not(.c-focused):not(.c-disabled):hover{background-color:#ebecf0}.sd__option--add{background-color:#fff;bottom:0;color:rgba(0,0,0,.87);cursor:pointer!important;position:-webkit-sticky;position:sticky;z-index:10}.c-loading-icon{position:absolute;right:5px;top:5px}"]
|
|
383
383
|
},] }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-angular-core-autocomplete.js","sources":["../../../../projects/sd-core/autocomplete/src/lib/autocomplete-display-def.directive.ts","../../../../projects/sd-core/autocomplete/src/lib/autocomplete.component.ts","../../../../projects/sd-core/autocomplete/src/lib/autocomplete.module.ts","../../../../projects/sd-core/autocomplete/src/public-api.ts","../../../../projects/sd-core/autocomplete/sd-angular-core-autocomplete.ts"],"sourcesContent":["import { Directive, TemplateRef } from '@angular/core';\r\n\r\n@Directive({\r\n selector: '[sdAutocompleteDisplayDef]'\r\n})\r\nexport class SdAutocompleteDisplayDefDirective {\r\n constructor(public templateRef: TemplateRef<any>) { }\r\n}\r\n","import {\r\n Component,\r\n Input,\r\n ViewChild,\r\n Output,\r\n EventEmitter,\r\n OnInit,\r\n OnDestroy,\r\n AfterViewInit,\r\n ChangeDetectorRef,\r\n ContentChild,\r\n ChangeDetectionStrategy,\r\n ElementRef,\r\n Inject,\r\n Optional\r\n} from '@angular/core';\r\nimport { startWith, switchMap, debounceTime, map, finalize, catchError } from 'rxjs/operators';\r\n\r\nimport * as uuid from 'uuid';\r\nimport hash from 'object-hash';\r\nimport { FormControl, NgForm, Validators, FormGroupDirective, FormGroup, ValidatorFn, AsyncValidatorFn, AbstractControl } from '@angular/forms';\r\nimport { BehaviorSubject, combineLatest, defer, from, Observable, of, Subscription } from 'rxjs';\r\nimport { ErrorStateMatcher } from '@angular/material/core';\r\nimport { SdAutocompleteDisplayDefDirective } from './autocomplete-display-def.directive';\r\nimport { MatAutocompleteTrigger } from '@angular/material/autocomplete';\r\nimport { FORM_CONFIG, IFormConfiguration, SdFormControl, SdViewDefDirective } from '@sd-angular/core/common';\r\nimport { MatFormFieldAppearance } from '@angular/material/form-field';\r\nimport { SdLabelDefDirective } from '@sd-angular/core/common';\r\n\r\nclass SdAutocompleteErrotStateMatcher implements ErrorStateMatcher {\r\n constructor(private formControl: FormControl) { }\r\n isErrorState(control: FormControl | null, form: FormGroupDirective | NgForm | null): boolean {\r\n const isSubmitted = form && form.submitted;\r\n return !!(this.formControl?.invalid && (this.formControl?.dirty || this.formControl?.touched || isSubmitted));\r\n }\r\n}\r\n\r\n@Component({\r\n selector: 'sd-autocomplete',\r\n templateUrl: './autocomplete.component.html',\r\n styleUrls: ['./autocomplete.component.scss'],\r\n changeDetection: ChangeDetectionStrategy.OnPush\r\n})\r\nexport class SdAutocomplete<T = any> implements OnInit, OnDestroy, AfterViewInit {\r\n // @Input() set key(value: any) {\r\n // this.#cache = {};\r\n // this.#item = {};\r\n // }\r\n @ViewChild(MatAutocompleteTrigger, { read: MatAutocompleteTrigger }) autocompleteTrigger: MatAutocompleteTrigger;\r\n id = `I${uuid.v4()}`;\r\n #model: string | number;\r\n\r\n #delay = 0; // Sau khoảng thời gian delay nếu không có thay đổi thì thì mới bắt đầu thực hiện gọi hàm\r\n #name = uuid.v4();\r\n @Input() set name(val: string) {\r\n if (val) {\r\n this.#name = val;\r\n }\r\n }\r\n @Input() appearance: MatFormFieldAppearance;\r\n loading = false;\r\n inputControl = new SdFormControl();\r\n formControl = new SdFormControl();\r\n matcher = new SdAutocompleteErrotStateMatcher(this.formControl);\r\n @Input() size: 'sm' | 'lg';\r\n #form: FormGroup;\r\n @Input() set form(val: NgForm | FormGroup) {\r\n if (val) {\r\n if (val instanceof NgForm) {\r\n this.#form = val.form;\r\n } else {\r\n this.#form = val;\r\n }\r\n }\r\n }\r\n qcId: string;\r\n label: string;\r\n @Input('label') set _label(val: string) {\r\n this.label = val;\r\n this.qcId = hash({\r\n selector: 'sd-autocomplete',\r\n label: val\r\n });\r\n };\r\n @Input() valueField: string;\r\n @Input() displayField: string;\r\n @Input() placeholder: string;\r\n\r\n #itemsChanges = new BehaviorSubject<T[] | SearchFunc<T>>([]);\r\n @Input() set items(items: undefined | T[] | SearchFunc<T>) {\r\n if (!items) {\r\n this.#itemsChanges.next([]);\r\n } else if (Array.isArray(items)) {\r\n this.#itemsChanges.next(items.filter(e => e !== null && e !== undefined));\r\n } else {\r\n this.#itemsChanges.next(items);\r\n this.#delay = 500;\r\n }\r\n this.formControl.updateValueAndValidity();\r\n }\r\n\r\n @Input() limit = 100;\r\n filteredItems: Observable<any[]>;\r\n\r\n @Input() cacheChecksum: any;\r\n\r\n controlPlaceHolder: Observable<string | number>;\r\n @Input() set model(value: undefined | number | string) {\r\n if (this.#model !== value) {\r\n this.#model = value;\r\n this.formControl.setValue(value);\r\n }\r\n }\r\n @Input() hiddenAdd: boolean = false;\r\n\r\n @ContentChild(SdAutocompleteDisplayDefDirective) autocompleteDisplayDef: SdAutocompleteDisplayDefDirective;\r\n @ContentChild(SdLabelDefDirective) sdLabelDef: SdLabelDefDirective;\r\n\r\n @Input() actionIcon: string;\r\n @Output() action = new EventEmitter();\r\n @Output() modelChange = new EventEmitter();\r\n @Output() sdChange = new EventEmitter();\r\n @Output() sdAdd = new EventEmitter();\r\n\r\n // Optional\r\n @Input() set disabled(val: boolean | '') {\r\n val = (val === '') || val;\r\n if (val) {\r\n this.inputControl.disable();\r\n this.formControl.disable();\r\n } else {\r\n this.inputControl.enable();\r\n this.formControl.enable();\r\n }\r\n }\r\n isRequired = false;\r\n @Input() set required(val: boolean | '') {\r\n this.isRequired = (val === '') || val;\r\n this.#updateValidator();\r\n }\r\n #validator: (value: any, selectedItem?: T) => string | Promise<string>;\r\n @Input() set validator(validator: (value: any, selectedItem?: T) => string | Promise<string>) {\r\n this.#validator = validator;\r\n this.#updateValidator();\r\n }\r\n disableErrorMessage = false;\r\n @Input('disableErrorMessage') set _disableErrorMessage(val: boolean | '') {\r\n this.disableErrorMessage = (val === '') || val;\r\n val = (val === '') || val;\r\n }\r\n #subscription = new Subscription();\r\n @ViewChild('input') input: ElementRef;\r\n @ContentChild(SdViewDefDirective) sdView: SdViewDefDirective;\r\n isFocused = false;\r\n selected: Observable<T>;\r\n #selectedItem: T;\r\n #cache: {\r\n [key: string]: T[]\r\n } = {};\r\n #item: {\r\n [key: string]: T\r\n } = {};\r\n isTyping = false;\r\n constructor(\r\n private ref: ChangeDetectorRef,\r\n @Inject(FORM_CONFIG) @Optional() private formConfig: IFormConfiguration) {\r\n }\r\n\r\n ngOnInit() {\r\n this.appearance = this.appearance || this.formConfig?.appearance;\r\n this.#subscription.add(this.inputControl.touchChanges.subscribe(() => {\r\n this.formControl.markAsTouched();\r\n this.ref.markForCheck();\r\n }));\r\n this.#subscription.add(this.formControl.sdChanges.subscribe(() => {\r\n this.ref.markForCheck();\r\n }));\r\n this.#subscription.add(this.inputControl.sdChanges.subscribe(() => {\r\n this.ref.markForCheck();\r\n }));\r\n this.#subscription.add(this.inputControl.valueChanges.subscribe(() => {\r\n this.isTyping = true;\r\n }));\r\n this.filteredItems = combineLatest([\r\n this.#itemsChanges.asObservable(),\r\n this.inputControl.valueChanges.pipe(debounceTime(this.#delay))]).pipe(\r\n switchMap(([items, searchText]) => {\r\n this.isTyping = false;\r\n searchText = searchText || '';\r\n if (typeof (items) !== 'function') {\r\n return items\r\n .search(searchText, [this.valueField, this.displayField])\r\n .paging(this.limit)\r\n .asObservable();\r\n }\r\n const key = hash({\r\n checksum: this.cacheChecksum || null,\r\n searchText\r\n });\r\n if (this.#cache[key] !== undefined) {\r\n if (!this.#cache[key]?.length) {\r\n this.isTyping = true;\r\n }\r\n return this.#cache[key].asObservable();\r\n }\r\n let obs: Observable<T[]>;\r\n const func = items(searchText, false);\r\n if (func instanceof Promise) {\r\n obs = defer(() => from(func));\r\n } else {\r\n obs = func;\r\n }\r\n this.loading = true;\r\n this.ref.markForCheck();\r\n return obs.pipe(map(data => {\r\n this.#cache[key] = data || [];\r\n Object.assign(this.#item, Array.toObject(this.#cache[key], this.valueField));\r\n return this.#cache[key];\r\n }), catchError(() => of([]))\r\n , finalize(() => {\r\n this.loading = false;\r\n this.ref.markForCheck();\r\n }));\r\n })\r\n );\r\n this.selected = combineLatest([\r\n this.#itemsChanges.asObservable(),\r\n this.formControl.valueChanges.pipe(startWith(this.formControl.value))])\r\n .pipe(\r\n switchMap(([items]) => {\r\n // Vì một số lý do chưa xác định mà khi sử dụng sdViewDef thì khi chuyển sang dạng view sẽ trigger val = null\r\n // Nhưng formControl.value vẫn có giá trị đúng nên thực hiện gán val = this.formControl.value;\r\n const val = this.formControl.value;\r\n if (!this.valueField) {\r\n return of(val);\r\n }\r\n if (val || val === 0) {\r\n if (typeof (items) === 'function') {\r\n if (this.#item[val]) {\r\n return of(this.#item[val]);\r\n }\r\n let obs: Observable<T[]>;\r\n const func = items(val, true);\r\n if (func instanceof Promise) {\r\n obs = defer(() => from(func));\r\n } else {\r\n obs = func;\r\n }\r\n return obs.pipe(map(data => {\r\n Object.assign(this.#item, Array.toObject(data, this.valueField));\r\n return this.#item[val] || {\r\n [this.valueField]: val,\r\n [this.displayField]: val\r\n };\r\n }), catchError(() => {\r\n return of({\r\n [this.valueField]: val,\r\n [this.displayField]: val\r\n });\r\n }), finalize(() => {\r\n this.loading = false;\r\n this.ref.markForCheck();\r\n }));\r\n }\r\n return of(items.find(e => e[this.valueField] === val));\r\n }\r\n return of('');\r\n })\r\n );\r\n this.controlPlaceHolder = this.selected.pipe(\r\n map(item => {\r\n this.#selectedItem = item;\r\n return item?.[this.displayField] ?? item ?? this.placeholder ?? (this.appearance ? this.label : '')\r\n })\r\n );\r\n }\r\n\r\n ngAfterViewInit() {\r\n this.#form?.addControl(this.#name, this.formControl);\r\n }\r\n\r\n ngOnDestroy() {\r\n this.#subscription.unsubscribe();\r\n this.#form?.removeControl(this.#name);\r\n }\r\n\r\n onSelect = (item: T) => {\r\n if (item) {\r\n this.#selectedItem = item;\r\n if (typeof (item) === 'string' || typeof (item) === 'number') {\r\n if (this.formControl.value !== item) {\r\n this.formControl.setValue(item);\r\n this.modelChange.emit(item);\r\n this.sdChange.emit(item);\r\n }\r\n } else if (this.valueField && this.displayField) {\r\n const val = item?.[this.valueField] || null;\r\n if (this.formControl.value !== val) {\r\n this.formControl.setValue(val);\r\n this.modelChange.emit(val);\r\n this.sdChange.emit(item);\r\n }\r\n }\r\n this.inputControl.setValue('', {\r\n emitEvent: false\r\n });\r\n }\r\n }\r\n\r\n onFocus = () => {\r\n this.isFocused = true;\r\n this.inputControl.setValue('');\r\n // this.inputControl.updateValueAndValidity();\r\n }\r\n\r\n onBlur = () => {\r\n this.isFocused = false;\r\n this.inputControl.setValue('', {\r\n emitEvent: false\r\n });\r\n }\r\n\r\n onClick = () => {\r\n if (this.sdView?.templateRef) {\r\n if (!this.formControl.disabled && !this.isFocused) {\r\n this.focus();\r\n }\r\n }\r\n }\r\n\r\n blur = () => {\r\n this.input?.nativeElement?.blur();\r\n }\r\n\r\n focus = () => {\r\n this.isFocused = true;\r\n setTimeout(() => {\r\n this.autocompleteTrigger?.openPanel();\r\n this.input?.nativeElement?.focus();\r\n }, 100);\r\n }\r\n\r\n clear = ($event?: any) => {\r\n $event?.stopPropagation();\r\n this.inputControl?.setValue('');\r\n if (this.#model) {\r\n this.formControl.setValue(null);\r\n this.modelChange.emit(null);\r\n this.sdChange.emit(null);\r\n }\r\n }\r\n\r\n onAction = ($event: Event) => {\r\n $event?.stopPropagation();\r\n this.autocompleteTrigger?.closePanel();\r\n this.action.emit();\r\n }\r\n\r\n onAdd = ($event: Event) => {\r\n $event.stopPropagation();\r\n $event?.preventDefault();\r\n this.sdAdd.emit();\r\n }\r\n\r\n reValidate = () => {\r\n this.inputControl.updateValueAndValidity({ emitEvent: true });\r\n }\r\n\r\n #updateValidator = () => {\r\n this.formControl.clearValidators();\r\n this.formControl.clearAsyncValidators();\r\n const validators: ValidatorFn[] = [];\r\n const asyncValidators: AsyncValidatorFn[] = [];\r\n // const asyncValidators: AsyncValidatorFn[] = [];\r\n if (this.isRequired) {\r\n validators.push(Validators.required);\r\n }\r\n if (this.#validator) {\r\n asyncValidators.push(this.#customValidator(this.#validator));\r\n }\r\n this.formControl.setValidators(validators);\r\n this.formControl.setAsyncValidators(asyncValidators);\r\n this.formControl.updateValueAndValidity();\r\n }\r\n\r\n #customValidator = (func: (value: any, item?: T) => string | Promise<string>): AsyncValidatorFn => {\r\n return async (c: AbstractControl): Promise<{ [key: string]: any } | null> => {\r\n const value = c.value || null;\r\n if (func && typeof (func) === 'function') {\r\n\r\n const result = func(value, this.#selectedItem);\r\n if (result instanceof Promise) {\r\n const message = await result;\r\n if (message) {\r\n return {\r\n customValidator: message\r\n };\r\n }\r\n return null;\r\n }\r\n if (result) {\r\n return {\r\n customValidator: result\r\n };\r\n }\r\n return null;\r\n }\r\n return null;\r\n };\r\n }\r\n}\r\n\r\ntype SearchFunc<T = any> = (searchText?: string, isFormValue?: boolean) => Promise<T[]> | Observable<T[]>;","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\r\nimport { MatFormFieldModule } from '@angular/material/form-field';\r\nimport { MatInputModule } from '@angular/material/input';\r\nimport { SdAutocomplete } from './autocomplete.component';\r\nimport { MatAutocompleteModule } from '@angular/material/autocomplete';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { SdTranslateModule } from '@sd-angular/core/translate';\r\nimport { MatTooltipModule } from '@angular/material/tooltip';\r\nimport { MatProgressSpinnerModule } from '@angular/material/progress-spinner';\r\nimport { SdAutocompleteDisplayDefDirective } from './autocomplete-display-def.directive';\r\nimport { SdCommonModule } from '@sd-angular/core/common';\r\nimport { SdPopoverModule } from '@sd-angular/core/popover';\r\n\r\n@NgModule({\r\n imports: [\r\n CommonModule,\r\n FormsModule,\r\n ReactiveFormsModule,\r\n MatInputModule,\r\n MatTooltipModule,\r\n MatFormFieldModule,\r\n MatAutocompleteModule,\r\n MatIconModule,\r\n MatProgressSpinnerModule,\r\n SdTranslateModule,\r\n SdCommonModule,\r\n SdPopoverModule\r\n ],\r\n declarations: [\r\n SdAutocomplete,\r\n SdAutocompleteDisplayDefDirective\r\n ],\r\n exports: [\r\n SdAutocomplete,\r\n SdAutocompleteDisplayDefDirective,\r\n SdCommonModule\r\n ],\r\n providers: [\r\n ]\r\n})\r\nexport class SdAutocompleteModule {\r\n\r\n}\r\n","/*\r\n * Public API Surface of superdev-angular-core\r\n */\r\n\r\nexport * from './lib/autocomplete.module';\r\nexport * from './lib/autocomplete.component';\r\nexport * from './lib/autocomplete-display-def.directive';","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["uuid.v4"],"mappings":";;;;;;;;;;;;;;;;;;MAKa,iCAAiC;IAC5C,YAAmB,WAA6B;QAA7B,gBAAW,GAAX,WAAW,CAAkB;KAAK;;;YAJtD,SAAS,SAAC;gBACT,QAAQ,EAAE,4BAA4B;aACvC;;;YAJmB,WAAW;;;;AC6B/B,MAAM,+BAA+B;IACnC,YAAoB,WAAwB;QAAxB,gBAAW,GAAX,WAAW,CAAa;KAAK;IACjD,YAAY,CAAC,OAA2B,EAAE,IAAwC;;QAChF,MAAM,WAAW,GAAG,IAAI,IAAI,IAAI,CAAC,SAAS,CAAC;QAC3C,OAAO,CAAC,EAAE,OAAA,IAAI,CAAC,WAAW,0CAAE,OAAO,MAAK,OAAA,IAAI,CAAC,WAAW,0CAAE,KAAK,YAAI,IAAI,CAAC,WAAW,0CAAE,OAAO,CAAA,IAAI,WAAW,CAAC,CAAC,CAAC;KAC/G;CACF;MAQY,cAAc;IAwHzB,YACU,GAAsB,EACW,UAA8B;QAD/D,QAAG,GAAH,GAAG,CAAmB;QACW,eAAU,GAAV,UAAU,CAAoB;QApHzE,OAAE,GAAG,IAAIA,EAAO,EAAE,EAAE,CAAC;QACrB,yBAAwB;QAExB,iBAAS,CAAC,EAAC;QACX,gBAAQA,EAAO,EAAE,EAAC;QAOlB,YAAO,GAAG,KAAK,CAAC;QAChB,iBAAY,GAAG,IAAI,aAAa,EAAE,CAAC;QACnC,gBAAW,GAAG,IAAI,aAAa,EAAE,CAAC;QAClC,YAAO,GAAG,IAAI,+BAA+B,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAEhE,wBAAiB;QAuBjB,wBAAgB,IAAI,eAAe,CAAsB,EAAE,CAAC,EAA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E,sBAAsB,EAAE;mBAMlE,KAAK;yBAKL,KAAK;mBAKL,KAAK;mBAEL,KAAK;qBAWL,KAAK,SAAC,OAAO;yBAOb,KAAK;2BACL,KAAK;0BACL,KAAK;oBAGL,KAAK;oBAYL,KAAK;4BAGL,KAAK;oBAGL,KAAK;wBAML,KAAK;qCAEL,YAAY,SAAC,iCAAiC;yBAC9C,YAAY,SAAC,mBAAmB;yBAEhC,KAAK;qBACL,MAAM;0BACN,MAAM;uBACN,MAAM;oBACN,MAAM;uBAGN,KAAK;uBAWL,KAAK;wBAKL,KAAK;mCAKL,KAAK,SAAC,qBAAqB;oBAK3B,SAAS,SAAC,OAAO;qBACjB,YAAY,SAAC,kBAAkB;;;MC9GrB,oBAAoB;;;YA3BhC,QAAQ,SAAC;gBACR,OAAO,EAAE;oBACP,YAAY;oBACZ,WAAW;oBACX,mBAAmB;oBACnB,cAAc;oBACd,gBAAgB;oBAChB,kBAAkB;oBAClB,qBAAqB;oBACrB,aAAa;oBACb,wBAAwB;oBACxB,iBAAiB;oBACjB,cAAc;oBACd,eAAe;iBAChB;gBACD,YAAY,EAAE;oBACZ,cAAc;oBACd,iCAAiC;iBAClC;gBACD,OAAO,EAAE;oBACP,cAAc;oBACd,iCAAiC;oBACjC,cAAc;iBACf;gBACD,SAAS,EAAE,EACV;aACF;;;ACzCD;;;;ACAA;;;;;;"}
|
|
1
|
+
{"version":3,"file":"sd-angular-core-autocomplete.js","sources":["../../../../projects/sd-core/autocomplete/src/lib/autocomplete-display-def.directive.ts","../../../../projects/sd-core/autocomplete/src/lib/autocomplete.component.ts","../../../../projects/sd-core/autocomplete/src/lib/autocomplete.module.ts","../../../../projects/sd-core/autocomplete/src/public-api.ts","../../../../projects/sd-core/autocomplete/sd-angular-core-autocomplete.ts"],"sourcesContent":["import { Directive, TemplateRef } from '@angular/core';\r\n\r\n@Directive({\r\n selector: '[sdAutocompleteDisplayDef]'\r\n})\r\nexport class SdAutocompleteDisplayDefDirective {\r\n constructor(public templateRef: TemplateRef<any>) { }\r\n}\r\n","import {\r\n Component,\r\n Input,\r\n ViewChild,\r\n Output,\r\n EventEmitter,\r\n OnInit,\r\n OnDestroy,\r\n AfterViewInit,\r\n ChangeDetectorRef,\r\n ContentChild,\r\n ChangeDetectionStrategy,\r\n ElementRef,\r\n Inject,\r\n Optional\r\n} from '@angular/core';\r\nimport { startWith, switchMap, debounceTime, map, finalize, catchError } from 'rxjs/operators';\r\n\r\nimport * as uuid from 'uuid';\r\nimport hash from 'object-hash';\r\nimport { FormControl, NgForm, Validators, FormGroupDirective, FormGroup, ValidatorFn, AsyncValidatorFn, AbstractControl } from '@angular/forms';\r\nimport { BehaviorSubject, combineLatest, defer, from, Observable, of, Subscription } from 'rxjs';\r\nimport { ErrorStateMatcher } from '@angular/material/core';\r\nimport { SdAutocompleteDisplayDefDirective } from './autocomplete-display-def.directive';\r\nimport { MatAutocompleteTrigger } from '@angular/material/autocomplete';\r\nimport { FORM_CONFIG, IFormConfiguration, SdFormControl, SdViewDefDirective } from '@sd-angular/core/common';\r\nimport { MatFormFieldAppearance } from '@angular/material/form-field';\r\nimport { SdLabelDefDirective } from '@sd-angular/core/common';\r\n\r\nclass SdAutocompleteErrotStateMatcher implements ErrorStateMatcher {\r\n constructor(private formControl: FormControl) { }\r\n isErrorState(control: FormControl | null, form: FormGroupDirective | NgForm | null): boolean {\r\n const isSubmitted = form && form.submitted;\r\n return !!(this.formControl?.invalid && (this.formControl?.dirty || this.formControl?.touched || isSubmitted));\r\n }\r\n}\r\n\r\n@Component({\r\n selector: 'sd-autocomplete',\r\n templateUrl: './autocomplete.component.html',\r\n styleUrls: ['./autocomplete.component.scss'],\r\n changeDetection: ChangeDetectionStrategy.OnPush\r\n})\r\nexport class SdAutocomplete<T = any> implements OnInit, OnDestroy, AfterViewInit {\r\n // @Input() set key(value: any) {\r\n // this.#cache = {};\r\n // this.#item = {};\r\n // }\r\n @ViewChild(MatAutocompleteTrigger, { read: MatAutocompleteTrigger }) autocompleteTrigger: MatAutocompleteTrigger;\r\n id = `I${uuid.v4()}`;\r\n #model: string | number;\r\n\r\n #delay = 0; // Sau khoảng thời gian delay nếu không có thay đổi thì thì mới bắt đầu thực hiện gọi hàm\r\n #name = uuid.v4();\r\n @Input() set name(val: string) {\r\n if (val) {\r\n this.#name = val;\r\n }\r\n }\r\n @Input() appearance: MatFormFieldAppearance;\r\n loading = false;\r\n inputControl = new SdFormControl();\r\n formControl = new SdFormControl();\r\n matcher = new SdAutocompleteErrotStateMatcher(this.formControl);\r\n @Input() size: 'sm' | 'lg';\r\n #form: FormGroup;\r\n @Input() set form(val: NgForm | FormGroup) {\r\n if (val) {\r\n if (val instanceof NgForm) {\r\n this.#form = val.form;\r\n } else {\r\n this.#form = val;\r\n }\r\n }\r\n }\r\n qcId: string;\r\n label: string;\r\n @Input('label') set _label(val: string) {\r\n this.label = val;\r\n this.qcId = hash({\r\n selector: 'sd-autocomplete',\r\n label: val\r\n });\r\n };\r\n @Input() valueField: string;\r\n @Input() displayField: string;\r\n @Input() placeholder: string;\r\n\r\n #itemsChanges = new BehaviorSubject<T[] | SearchFunc<T>>([]);\r\n @Input() set items(items: undefined | T[] | SearchFunc<T>) {\r\n if (!items) {\r\n this.#itemsChanges.next([]);\r\n } else if (Array.isArray(items)) {\r\n this.#itemsChanges.next(items.filter(e => e !== null && e !== undefined));\r\n } else {\r\n this.#itemsChanges.next(items);\r\n this.#delay = 500;\r\n }\r\n this.formControl.updateValueAndValidity();\r\n }\r\n\r\n @Input() limit = 100;\r\n filteredItems: Observable<any[]>;\r\n\r\n @Input() cacheChecksum: any;\r\n\r\n controlPlaceHolder: Observable<string | number>;\r\n @Input() set model(value: undefined | number | string) {\r\n if (this.#model !== value) {\r\n this.#model = value;\r\n this.formControl.setValue(value);\r\n }\r\n }\r\n @Input() hiddenAdd: boolean = false;\r\n\r\n @ContentChild(SdAutocompleteDisplayDefDirective) autocompleteDisplayDef: SdAutocompleteDisplayDefDirective;\r\n @ContentChild(SdLabelDefDirective) sdLabelDef: SdLabelDefDirective;\r\n\r\n @Input() actionIcon: string;\r\n @Output() action = new EventEmitter();\r\n @Output() modelChange = new EventEmitter();\r\n @Output() sdChange = new EventEmitter();\r\n @Output() sdAdd = new EventEmitter();\r\n\r\n // Optional\r\n @Input() set disabled(val: boolean | '') {\r\n val = (val === '') || val;\r\n if (val) {\r\n this.inputControl.disable();\r\n this.formControl.disable();\r\n } else {\r\n this.inputControl.enable();\r\n this.formControl.enable();\r\n }\r\n }\r\n isRequired = false;\r\n @Input() set required(val: boolean | '') {\r\n this.isRequired = (val === '') || val;\r\n this.#updateValidator();\r\n }\r\n #validator: (value: any, selectedItem?: T) => string | Promise<string>;\r\n @Input() set validator(validator: (value: any, selectedItem?: T) => string | Promise<string>) {\r\n this.#validator = validator;\r\n this.#updateValidator();\r\n }\r\n disableErrorMessage = false;\r\n @Input('disableErrorMessage') set _disableErrorMessage(val: boolean | '') {\r\n this.disableErrorMessage = (val === '') || val;\r\n val = (val === '') || val;\r\n }\r\n #subscription = new Subscription();\r\n @ViewChild('input') input: ElementRef;\r\n @ContentChild(SdViewDefDirective) sdView: SdViewDefDirective;\r\n isFocused = false;\r\n selected: Observable<T>;\r\n #selectedItem: T;\r\n #cache: {\r\n [key: string]: T[]\r\n } = {};\r\n #item: {\r\n [key: string]: T\r\n } = {};\r\n isTyping = false;\r\n constructor(\r\n private ref: ChangeDetectorRef,\r\n @Inject(FORM_CONFIG) @Optional() private formConfig: IFormConfiguration) {\r\n }\r\n\r\n ngOnInit() {\r\n this.appearance = this.appearance || this.formConfig?.appearance;\r\n this.#subscription.add(this.inputControl.touchChanges.subscribe(() => {\r\n this.formControl.markAsTouched();\r\n this.ref.markForCheck();\r\n }));\r\n this.#subscription.add(this.formControl.sdChanges.subscribe(() => {\r\n this.ref.markForCheck();\r\n }));\r\n this.#subscription.add(this.inputControl.sdChanges.subscribe(() => {\r\n this.ref.markForCheck();\r\n }));\r\n this.#subscription.add(this.inputControl.valueChanges.subscribe(() => {\r\n this.isTyping = true;\r\n }));\r\n this.filteredItems = combineLatest([\r\n this.#itemsChanges.asObservable(),\r\n this.inputControl.valueChanges.pipe(debounceTime(this.#delay))]).pipe(\r\n switchMap(([items, searchText]) => {\r\n this.isTyping = false;\r\n searchText = searchText || '';\r\n if (typeof (items) !== 'function') {\r\n return items\r\n .search(searchText, [this.valueField, this.displayField])\r\n .paging(this.limit)\r\n .asObservable();\r\n }\r\n const key = hash({\r\n checksum: this.cacheChecksum || null,\r\n searchText\r\n });\r\n if (this.#cache[key] !== undefined) {\r\n if (!this.#cache[key]?.length) {\r\n this.isTyping = true;\r\n }\r\n return this.#cache[key].asObservable();\r\n }\r\n let obs: Observable<T[]>;\r\n const func = items(searchText, false);\r\n if (func instanceof Promise) {\r\n obs = defer(() => from(func));\r\n } else {\r\n obs = func;\r\n }\r\n this.loading = true;\r\n this.ref.markForCheck();\r\n return obs.pipe(map(data => {\r\n this.#cache[key] = data || [];\r\n Object.assign(this.#item, Array.toObject(this.#cache[key], this.valueField));\r\n return this.#cache[key];\r\n }), catchError(() => of([]))\r\n , finalize(() => {\r\n this.loading = false;\r\n this.ref.markForCheck();\r\n }));\r\n })\r\n );\r\n this.selected = combineLatest([\r\n this.#itemsChanges.asObservable(),\r\n this.formControl.valueChanges.pipe(startWith(this.formControl.value))])\r\n .pipe(\r\n switchMap(([items]) => {\r\n // Vì một số lý do chưa xác định mà khi sử dụng sdViewDef thì khi chuyển sang dạng view sẽ trigger val = null\r\n // Nhưng formControl.value vẫn có giá trị đúng nên thực hiện gán val = this.formControl.value;\r\n const val = this.formControl.value;\r\n if (!this.valueField) {\r\n return of(val);\r\n }\r\n if (val || val === 0) {\r\n if (typeof (items) === 'function') {\r\n if (this.#item[val]) {\r\n return of(this.#item[val]);\r\n }\r\n let obs: Observable<T[]>;\r\n const func = items(val, true);\r\n if (func instanceof Promise) {\r\n obs = defer(() => from(func));\r\n } else {\r\n obs = func;\r\n }\r\n return obs.pipe(map(data => {\r\n Object.assign(this.#item, Array.toObject(data, this.valueField));\r\n return this.#item[val] || {\r\n [this.valueField]: val,\r\n [this.displayField]: val\r\n };\r\n }), catchError(() => {\r\n return of({\r\n [this.valueField]: val,\r\n [this.displayField]: val\r\n });\r\n }), finalize(() => {\r\n this.loading = false;\r\n this.ref.markForCheck();\r\n }));\r\n }\r\n return of(items.find(e => e[this.valueField] === val));\r\n }\r\n return of('');\r\n })\r\n );\r\n this.controlPlaceHolder = this.selected.pipe(\r\n map(item => {\r\n this.#selectedItem = item;\r\n return item?.[this.displayField] ?? item ?? this.placeholder ?? (this.appearance ? this.label : '')\r\n })\r\n );\r\n }\r\n\r\n ngAfterViewInit() {\r\n this.#form?.addControl(this.#name, this.formControl);\r\n }\r\n\r\n ngOnDestroy() {\r\n this.#subscription.unsubscribe();\r\n this.#form?.removeControl(this.#name);\r\n }\r\n\r\n onSelect = (item: T) => {\r\n if (item) {\r\n this.#selectedItem = item;\r\n if (typeof (item) === 'string' || typeof (item) === 'number') {\r\n if (this.formControl.value !== item) {\r\n this.formControl.setValue(item);\r\n this.modelChange.emit(item);\r\n this.sdChange.emit(item);\r\n }\r\n } else if (this.valueField && this.displayField) {\r\n const val = item?.[this.valueField] || null;\r\n if (this.formControl.value !== val) {\r\n this.formControl.setValue(val);\r\n this.modelChange.emit(val);\r\n this.sdChange.emit(item);\r\n }\r\n }\r\n this.inputControl.setValue('', {\r\n emitEvent: false\r\n });\r\n }\r\n }\r\n\r\n onFocus = () => {\r\n this.isFocused = true;\r\n this.inputControl.setValue('');\r\n // this.inputControl.updateValueAndValidity();\r\n }\r\n\r\n onBlur = () => {\r\n this.isFocused = false;\r\n this.inputControl.setValue('', {\r\n emitEvent: false\r\n });\r\n }\r\n\r\n onClick = () => {\r\n if (this.sdView?.templateRef) {\r\n if (!this.formControl.disabled && !this.isFocused) {\r\n this.focus();\r\n }\r\n }\r\n }\r\n\r\n blur = () => {\r\n this.input?.nativeElement?.blur();\r\n }\r\n\r\n focus = () => {\r\n this.isFocused = true;\r\n setTimeout(() => {\r\n this.autocompleteTrigger?.openPanel();\r\n this.input?.nativeElement?.focus();\r\n }, 100);\r\n }\r\n\r\n clear = ($event?: any) => {\r\n $event?.stopPropagation();\r\n this.inputControl?.setValue('');\r\n if (this.#model) {\r\n this.formControl.setValue(null);\r\n this.modelChange.emit(null);\r\n this.sdChange.emit(null);\r\n }\r\n }\r\n\r\n onAction = ($event: Event) => {\r\n $event?.stopPropagation();\r\n this.autocompleteTrigger?.closePanel();\r\n this.action.emit();\r\n }\r\n\r\n onAdd = ($event: Event) => {\r\n $event.stopPropagation();\r\n $event?.preventDefault();\r\n this.sdAdd.emit();\r\n }\r\n\r\n reValidate = () => {\r\n this.inputControl.updateValueAndValidity({ emitEvent: true });\r\n }\r\n\r\n #updateValidator = () => {\r\n this.formControl.clearValidators();\r\n this.formControl.clearAsyncValidators();\r\n const validators: ValidatorFn[] = [];\r\n const asyncValidators: AsyncValidatorFn[] = [];\r\n // const asyncValidators: AsyncValidatorFn[] = [];\r\n if (this.isRequired) {\r\n validators.push(Validators.required);\r\n }\r\n if (this.#validator) {\r\n asyncValidators.push(this.#customValidator(this.#validator));\r\n }\r\n this.formControl.setValidators(validators);\r\n this.formControl.setAsyncValidators(asyncValidators);\r\n this.formControl.updateValueAndValidity();\r\n }\r\n\r\n #customValidator = (func: (value: any, item?: T) => string | Promise<string>): AsyncValidatorFn => {\r\n return async (c: AbstractControl): Promise<{ [key: string]: any } | null> => {\r\n const value = c.value || null;\r\n if (func && typeof (func) === 'function') {\r\n\r\n const result = func(value, this.#selectedItem);\r\n if (result instanceof Promise) {\r\n const message = await result;\r\n if (message) {\r\n return {\r\n customValidator: message\r\n };\r\n }\r\n return null;\r\n }\r\n if (result) {\r\n return {\r\n customValidator: result\r\n };\r\n }\r\n return null;\r\n }\r\n return null;\r\n };\r\n }\r\n}\r\n\r\ntype SearchFunc<T = any> = (searchText?: string, isFormValue?: boolean) => Promise<T[]> | Observable<T[]>;","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\r\nimport { MatFormFieldModule } from '@angular/material/form-field';\r\nimport { MatInputModule } from '@angular/material/input';\r\nimport { SdAutocomplete } from './autocomplete.component';\r\nimport { MatAutocompleteModule } from '@angular/material/autocomplete';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { SdTranslateModule } from '@sd-angular/core/translate';\r\nimport { MatTooltipModule } from '@angular/material/tooltip';\r\nimport { MatProgressSpinnerModule } from '@angular/material/progress-spinner';\r\nimport { SdAutocompleteDisplayDefDirective } from './autocomplete-display-def.directive';\r\nimport { SdCommonModule } from '@sd-angular/core/common';\r\nimport { SdPopoverModule } from '@sd-angular/core/popover';\r\n\r\n@NgModule({\r\n imports: [\r\n CommonModule,\r\n FormsModule,\r\n ReactiveFormsModule,\r\n MatInputModule,\r\n MatTooltipModule,\r\n MatFormFieldModule,\r\n MatAutocompleteModule,\r\n MatIconModule,\r\n MatProgressSpinnerModule,\r\n SdTranslateModule,\r\n SdCommonModule,\r\n SdPopoverModule\r\n ],\r\n declarations: [\r\n SdAutocomplete,\r\n SdAutocompleteDisplayDefDirective\r\n ],\r\n exports: [\r\n SdAutocomplete,\r\n SdAutocompleteDisplayDefDirective,\r\n SdCommonModule\r\n ],\r\n providers: [\r\n ]\r\n})\r\nexport class SdAutocompleteModule {\r\n\r\n}\r\n","/*\r\n * Public API Surface of superdev-angular-core\r\n */\r\n\r\nexport * from './lib/autocomplete.module';\r\nexport * from './lib/autocomplete.component';\r\nexport * from './lib/autocomplete-display-def.directive';","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["uuid.v4"],"mappings":";;;;;;;;;;;;;;;;;;MAKa,iCAAiC;IAC5C,YAAmB,WAA6B;QAA7B,gBAAW,GAAX,WAAW,CAAkB;KAAK;;;YAJtD,SAAS,SAAC;gBACT,QAAQ,EAAE,4BAA4B;aACvC;;;YAJmB,WAAW;;;;AC6B/B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B;oBAK3B,SAAS,SAAC,OAAO;qBACjB,YAAY,SAAC,kBAAkB;;;MC9GrB,oBAAoB;;;YA3BhC,QAAQ,SAAC;gBACR,OAAO,EAAE;oBACP,YAAY;oBACZ,WAAW;oBACX,mBAAmB;oBACnB,cAAc;oBACd,gBAAgB;oBAChB,kBAAkB;oBAClB,qBAAqB;oBACrB,aAAa;oBACb,wBAAwB;oBACxB,iBAAiB;oBACjB,cAAc;oBACd,eAAe;iBAChB;gBACD,YAAY,EAAE;oBACZ,cAAc;oBACd,iCAAiC;iBAClC;gBACD,OAAO,EAAE;oBACP,cAAc;oBACd,iCAAiC;oBACjC,cAAc;iBACf;gBACD,SAAS,EAAE,EACV;aACF;;;ACzCD;;;;ACAA;;;;;;"}
|
|
@@ -3,10 +3,11 @@ import { CommonModule } from '@angular/common';
|
|
|
3
3
|
import { SdTranslateModule } from '@sd-angular/core/translate';
|
|
4
4
|
import { MatIconModule } from '@angular/material/icon';
|
|
5
5
|
import { MatButtonModule } from '@angular/material/button';
|
|
6
|
-
import { __awaiter, __classPrivateFieldGet } from 'tslib';
|
|
6
|
+
import { __awaiter, __classPrivateFieldGet, __classPrivateFieldSet } from 'tslib';
|
|
7
7
|
import { SdTextarea, SdTextareaModule } from '@sd-angular/core/textarea';
|
|
8
8
|
import { BehaviorSubject } from 'rxjs';
|
|
9
9
|
import { map } from 'rxjs/operators';
|
|
10
|
+
import { SdLoadingService } from '@sd-angular/core/loading';
|
|
10
11
|
import { SdButtonModule } from '@sd-angular/core/button';
|
|
11
12
|
import { SdInputModule } from '@sd-angular/core/input';
|
|
12
13
|
import { SdUtilityModule } from '@sd-angular/core/utility';
|
|
@@ -14,11 +15,14 @@ import { MatTooltipModule } from '@angular/material/tooltip';
|
|
|
14
15
|
import { SdEditorModule } from '@sd-angular/core/editor';
|
|
15
16
|
import { SdModalModule } from '@sd-angular/core/modal';
|
|
16
17
|
|
|
17
|
-
var _items, _send, _load;
|
|
18
|
+
var _items, _send, _timerReload, _load, _scrollToBottom;
|
|
18
19
|
class SdComment {
|
|
19
|
-
constructor() {
|
|
20
|
+
constructor(loadingService) {
|
|
21
|
+
this.loadingService = loadingService;
|
|
20
22
|
_items.set(this, new BehaviorSubject([]));
|
|
21
23
|
_send.set(this, new BehaviorSubject(''));
|
|
24
|
+
_timerReload.set(this, void 0);
|
|
25
|
+
this.isReloading = false;
|
|
22
26
|
this.fullCommentStyles = {
|
|
23
27
|
'min-height': '150px'
|
|
24
28
|
};
|
|
@@ -39,11 +43,33 @@ class SdComment {
|
|
|
39
43
|
return results;
|
|
40
44
|
}));
|
|
41
45
|
this.reload = () => __awaiter(this, void 0, void 0, function* () {
|
|
46
|
+
var _a, _b;
|
|
47
|
+
this.loadingService.start('.c-comment-loading');
|
|
42
48
|
__classPrivateFieldGet(this, _items).next(yield __classPrivateFieldGet(this, _load).call(this));
|
|
49
|
+
this.loadingService.stop('.c-comment-loading');
|
|
50
|
+
__classPrivateFieldGet(this, _scrollToBottom).call(this);
|
|
51
|
+
if ((_b = (_a = this.commentOption) === null || _a === void 0 ? void 0 : _a.autoReload) === null || _b === void 0 ? void 0 : _b.timerMs) {
|
|
52
|
+
clearInterval(__classPrivateFieldGet(this, _timerReload));
|
|
53
|
+
__classPrivateFieldSet(this, _timerReload, setInterval(() => __awaiter(this, void 0, void 0, function* () {
|
|
54
|
+
this.loadingService.start('.c-comment-loading');
|
|
55
|
+
__classPrivateFieldGet(this, _items).next(yield __classPrivateFieldGet(this, _load).call(this));
|
|
56
|
+
this.loadingService.stop('.c-comment-loading');
|
|
57
|
+
__classPrivateFieldGet(this, _scrollToBottom).call(this);
|
|
58
|
+
}), this.commentOption.autoReload.timerMs));
|
|
59
|
+
}
|
|
43
60
|
});
|
|
44
61
|
this.clearAllData = () => {
|
|
45
62
|
this.message = '';
|
|
46
63
|
};
|
|
64
|
+
_scrollToBottom.set(this, () => {
|
|
65
|
+
try {
|
|
66
|
+
setTimeout(() => {
|
|
67
|
+
this.commentScroll.nativeElement.scrollTop = this.commentScroll.nativeElement.scrollHeight;
|
|
68
|
+
}, 500);
|
|
69
|
+
}
|
|
70
|
+
catch (err) {
|
|
71
|
+
}
|
|
72
|
+
});
|
|
47
73
|
}
|
|
48
74
|
set option(option) {
|
|
49
75
|
this.commentOption = option;
|
|
@@ -60,21 +86,28 @@ class SdComment {
|
|
|
60
86
|
this.count = this.items.pipe(map(items => items.length));
|
|
61
87
|
}
|
|
62
88
|
ngOnDestroy() {
|
|
89
|
+
var _a, _b;
|
|
90
|
+
if ((_b = (_a = this.commentOption) === null || _a === void 0 ? void 0 : _a.autoReload) === null || _b === void 0 ? void 0 : _b.timerMs) {
|
|
91
|
+
clearInterval(__classPrivateFieldGet(this, _timerReload));
|
|
92
|
+
}
|
|
63
93
|
}
|
|
64
94
|
ngAfterViewInit() {
|
|
65
95
|
}
|
|
66
96
|
}
|
|
67
|
-
_items = new WeakMap(), _send = new WeakMap(), _load = new WeakMap();
|
|
97
|
+
_items = new WeakMap(), _send = new WeakMap(), _timerReload = new WeakMap(), _load = new WeakMap(), _scrollToBottom = new WeakMap();
|
|
68
98
|
SdComment.decorators = [
|
|
69
99
|
{ type: Component, args: [{
|
|
70
100
|
selector: 'sd-comment',
|
|
71
|
-
template: "<div class=\"c-container\">\r\n <div class=\"c-header\">\r\n <div class=\"c-title\">{{'Comments' | sdTranslate}} <a href=\"javascript:;\">({{count | async}})</a></div>\r\n </div>\r\n <div class=\"c-body\" *ngIf=\"commentOption?.style==='basic'\">\r\n <ng-container *ngFor=\"let item of items | async\">\r\n <div class=\"d-flex my-8\">\r\n <div class=\"c-avatar mr-12\">\r\n <img height=\"32\" width=\"32px\" [src]=\"item.picture\">\r\n </div>\r\n <div class=\"c-comment\">\r\n <div class=\"c-info mb-4\">\r\n {{'By' | sdTranslate}}\r\n <span class=\"c-creator ml-2\">\r\n {{item.creator}}\r\n </span>\r\n <ng-container *ngIf=\"item.createdDate\">\r\n <span class=\"mx-4\">\u2022</span>\r\n <span\r\n [matTooltip]=\"item.createdDate | date:'dd/MM/yyyy HH:mm'\">{{item.createdDate | sdTimeDifferent:'dd/MM/yyyy HH:mm':'hour' | async}}</span>\r\n </ng-container>\r\n </div>\r\n <div class=\"c-content\" [innerHtml]=\"item.content\">\r\n </div>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </div>\r\n <div class=\"c-body-style1\" *ngIf=\"commentOption?.style==='style1'\" sdScroll>\r\n <ng-container *ngFor=\"let item of items | async; let i = index\">\r\n <div class=\"d-flex my-8\">\r\n <div class=\"c-avatar mr-12\">\r\n <img height=\"32\" width=\"32px\" [src]=\"item.picture\">\r\n </div>\r\n <div class=\"c-comment {{i + 1 === (count | async) ? 'c-comment-border': ''}}\">\r\n <div class=\"c-info mb-4\">\r\n <div class=\"c-col-left\">\r\n <div class=\"c-creator\">\r\n {{item.creator}}\r\n </div>\r\n <div class=\"c-email\">\r\n {{item.email}}\r\n </div>\r\n </div>\r\n <ng-container *ngIf=\"item.createdDate\">\r\n <div class=\"c-col-right\"\r\n [matTooltip]=\"item.createdDate | date:'dd/MM/yyyy H:mm'\">{{item.createdDate | date:'dd/MM/yyyy H:mm'}}</div>\r\n </ng-container>\r\n </div>\r\n <div class=\"c-content\" [innerHtml]=\"item.content\">\r\n </div>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </div>\r\n <div class=\"c-footer p-16\">\r\n <div class=\"row\">\r\n <div class=\"col-12 c-position-relative\">\r\n <ng-container *ngIf=\"commentOption?.editor?.enabled else noUseEditor\">\r\n <div class=\"mb-8\">\r\n <sd-editor [(model)]=\"message\" [styles]=\"commentOption?.editor?.styles\"\r\n [toolbar]=\"commentOption?.editor?.toolbar\"\r\n [mentionValues]=\"commentOption?.editor?.mentionValues\"\r\n [hashTagValues]=\"commentOption?.editor?.hashTagValues\"></sd-editor>\r\n </div>\r\n <div *ngIf=\"commentOption?.fullComment?.enabled\" class=\"c-full-comment-backdrop\"\r\n (click)=\"modalFullComment.open()\"></div>\r\n </ng-container>\r\n <ng-template #noUseEditor>\r\n <sd-textarea [(model)]=\"message\" rows=\"1\" autoHeight></sd-textarea>\r\n </ng-template>\r\n </div>\r\n </div>\r\n <div class=\"row\">\r\n <div class=\"col-12\">\r\n <sd-button class=\"float-right\" title=\"G\u1EEDi\" (action)=\"onSend()\" [disabled]=\"!message\" color=\"primary\" type=\"fill\"\r\n size=\"sm\">\r\n </sd-button>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<sd-modal [title]=\"'Comments' | sdTranslate\" width=\"sm\" [closeClickOutSide]=\"commentOption?.fullComment?.closeClickOutSide\" #modalFullComment>\r\n <sd-modal-body>\r\n <sd-editor [(model)]=\"message\" [styles]=\"fullCommentStyles\"\r\n [toolbar]=\"commentOption?.editor?.toolbar\"\r\n [mentionValues]=\"commentOption?.editor?.mentionValues\"\r\n [hashTagValues]=\"commentOption?.editor?.hashTagValues\"\r\n [args]=\"commentOption?.editor?.args\"></sd-editor>\r\n </sd-modal-body>\r\n <sd-modal-footer>\r\n <sd-button class=\"ml-8\" title=\"X\u00F3a to\u00E0n b\u1ED9\" size=\"sm\" type=\"link\"\r\n (action)=\"clearAllData()\">\r\n </sd-button>\r\n <sd-button *ngIf=\"!commentOption?.fullComment?.enableSendButton\" class=\"ml-8\" title=\"\u0110\u00F3ng\" size=\"sm\" (action)=\"modalFullComment.close()\"\r\n color=\"primary\" type=\"fill\">\r\n </sd-button>\r\n <sd-button *ngIf=\"commentOption?.fullComment?.enableSendButton\" class=\"ml-8\" title=\"G\u1EEDi\" size=\"sm\" (action)=\"onSend();modalFullComment.close();\" [disabled]=\"!message\"\r\n color=\"primary\" type=\"fill\">\r\n </sd-button>\r\n </sd-modal-footer>\r\n</sd-modal>\r\n",
|
|
101
|
+
template: "<div class=\"c-container\">\r\n <div class=\"c-header\">\r\n <div class=\"c-title\">{{'Comments' | sdTranslate}} <a href=\"javascript:;\">({{count | async}})</a></div>\r\n </div>\r\n <div class=\"c-body c-comment-loading\" *ngIf=\"commentOption?.style==='basic'\" #commentScroll>\r\n <ng-container *ngFor=\"let item of items | async\">\r\n <div class=\"d-flex my-8\">\r\n <div class=\"c-avatar mr-12\">\r\n <img height=\"32\" width=\"32px\" [src]=\"item.picture\">\r\n </div>\r\n <div class=\"c-comment\">\r\n <div class=\"c-info mb-4\">\r\n {{'By' | sdTranslate}}\r\n <span class=\"c-creator ml-2\">\r\n {{item.creator}}\r\n </span>\r\n <ng-container *ngIf=\"item.createdDate\">\r\n <span class=\"mx-4\">\u2022</span>\r\n <span\r\n [matTooltip]=\"item.createdDate | date:'dd/MM/yyyy HH:mm'\">{{item.createdDate | sdTimeDifferent:'dd/MM/yyyy HH:mm':'hour' | async}}</span>\r\n </ng-container>\r\n </div>\r\n <div class=\"c-content\" [innerHtml]=\"item.content\">\r\n </div>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </div>\r\n <div class=\"c-body-style1 c-comment-loading\" *ngIf=\"commentOption?.style==='style1'\" sdScroll #commentScroll>\r\n <ng-container *ngFor=\"let item of items | async; let i = index\">\r\n <div class=\"d-flex my-8\">\r\n <div class=\"c-avatar mr-12\">\r\n <img height=\"32\" width=\"32px\" [src]=\"item.picture\">\r\n </div>\r\n <div class=\"c-comment {{i + 1 === (count | async) ? 'c-comment-border': ''}}\">\r\n <div class=\"c-info mb-4\">\r\n <div class=\"c-col-left\">\r\n <div class=\"c-creator\">\r\n {{item.creator}}\r\n </div>\r\n <div class=\"c-email\">\r\n {{item.email}}\r\n </div>\r\n </div>\r\n <ng-container *ngIf=\"item.createdDate\">\r\n <div class=\"c-col-right\"\r\n [matTooltip]=\"item.createdDate | date:'dd/MM/yyyy H:mm'\">{{item.createdDate | date:'dd/MM/yyyy H:mm'}}</div>\r\n </ng-container>\r\n </div>\r\n <div class=\"c-content\" [innerHtml]=\"item.content\">\r\n </div>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </div>\r\n <div class=\"c-footer p-16\">\r\n <div class=\"row\">\r\n <div class=\"col-12 c-position-relative\">\r\n <ng-container *ngIf=\"commentOption?.editor?.enabled else noUseEditor\">\r\n <div class=\"mb-8\">\r\n <sd-editor [(model)]=\"message\" [styles]=\"commentOption?.editor?.styles\"\r\n [toolbar]=\"commentOption?.editor?.toolbar\"\r\n [mentionValues]=\"commentOption?.editor?.mentionValues\"\r\n [hashTagValues]=\"commentOption?.editor?.hashTagValues\"></sd-editor>\r\n </div>\r\n <div *ngIf=\"commentOption?.fullComment?.enabled\" class=\"c-full-comment-backdrop\"\r\n (click)=\"modalFullComment.open()\"></div>\r\n </ng-container>\r\n <ng-template #noUseEditor>\r\n <sd-textarea [(model)]=\"message\" rows=\"1\" autoHeight></sd-textarea>\r\n </ng-template>\r\n </div>\r\n </div>\r\n <div class=\"row\">\r\n <div class=\"col-12\">\r\n <sd-button class=\"float-right\" title=\"G\u1EEDi\" (action)=\"onSend()\" [disabled]=\"!message\" color=\"primary\" type=\"fill\"\r\n size=\"sm\">\r\n </sd-button>\r\n <sd-button class=\"float-right mr-8\" title=\"T\u1EA3i l\u1EA1i\" (action)=\"reload()\" *ngIf=\"commentOption?.autoReload?.enabledButton\" color=\"warning\" type=\"fill\"\r\n size=\"sm\">\r\n </sd-button>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<sd-modal [title]=\"'Comments' | sdTranslate\" width=\"sm\" [closeClickOutSide]=\"commentOption?.fullComment?.closeClickOutSide\" #modalFullComment>\r\n <sd-modal-body>\r\n <sd-editor [(model)]=\"message\" [styles]=\"fullCommentStyles\"\r\n [toolbar]=\"commentOption?.editor?.toolbar\"\r\n [mentionValues]=\"commentOption?.editor?.mentionValues\"\r\n [hashTagValues]=\"commentOption?.editor?.hashTagValues\"\r\n [args]=\"commentOption?.editor?.args\"></sd-editor>\r\n </sd-modal-body>\r\n <sd-modal-footer>\r\n <sd-button class=\"ml-8\" title=\"X\u00F3a to\u00E0n b\u1ED9\" size=\"sm\" type=\"link\"\r\n (action)=\"clearAllData()\">\r\n </sd-button>\r\n <sd-button *ngIf=\"!commentOption?.fullComment?.enableSendButton\" class=\"ml-8\" title=\"\u0110\u00F3ng\" size=\"sm\" (action)=\"modalFullComment.close()\"\r\n color=\"primary\" type=\"fill\">\r\n </sd-button>\r\n <sd-button class=\"ml-8\" title=\"T\u1EA3i l\u1EA1i\" (action)=\"reload()\" *ngIf=\"commentOption?.autoReload?.enabledButton\" color=\"warning\" type=\"fill\"\r\n size=\"sm\">\r\n </sd-button>\r\n <sd-button *ngIf=\"commentOption?.fullComment?.enableSendButton\" class=\"ml-8\" title=\"G\u1EEDi\" size=\"sm\" (action)=\"onSend();modalFullComment.close();\" [disabled]=\"!message\"\r\n color=\"primary\" type=\"fill\">\r\n </sd-button>\r\n </sd-modal-footer>\r\n</sd-modal>\r\n",
|
|
72
102
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
73
103
|
styles: [".text-black400{color:#757575}.c-container{display:flex;flex-direction:column;height:100%}.c-container .c-header{align-items:center;background-color:#fff;display:flex;height:40px;padding:0 16px}.c-container .c-header .c-title{font-weight:500}.c-container .c-body{background:#f8f9fa;flex:1;overflow-y:hidden;padding:16px}.c-container .c-body:hover{overflow-y:auto}.c-container .c-body .c-comment{background:#fff;border:1px solid #f2f2f2;border-radius:4px;flex:1;overflow-wrap:break-word;padding:12px 16px;white-space:pre-wrap;word-break:break-word}.c-container .c-body .c-comment .c-info{color:#757575}.c-container .c-body .c-comment .c-info .c-creator{color:#000;font-weight:500}.c-container .c-body-style1{background:#fff;flex:1;overflow-y:hidden;padding:16px}.c-container .c-body-style1 .c-comment{background:#fff;border-bottom:3px solid #f2f2f2;border-radius:4px;flex:1;overflow-wrap:break-word;white-space:pre-wrap;word-break:break-word}.c-container .c-body-style1 .c-comment .c-info{color:#757575}.c-container .c-body-style1 .c-comment .c-info .c-creator{color:#000;font-weight:500;white-space:nowrap}.c-container .c-body-style1 .c-comment .c-info .c-email{color:#000;font-weight:400;white-space:nowrap}.c-container .c-body-style1 .c-comment .c-info .c-col-left{display:inline-block;overflow:hidden;vertical-align:top;width:calc(100% - 128px)}.c-container .c-body-style1 .c-comment .c-info .c-col-right{display:inline-block;margin-left:8px;width:120px}.c-container .c-body-style1 .c-comment-border{border-bottom:none}.c-container .c-footer{background:#fff;min-height:120px}.c-container .c-footer .c-position-relative{position:relative}.c-container .c-footer .c-full-comment-backdrop{height:100%;left:0;position:absolute;top:0;width:100%;z-index:1}"]
|
|
74
104
|
},] }
|
|
75
105
|
];
|
|
76
|
-
SdComment.ctorParameters = () => [
|
|
106
|
+
SdComment.ctorParameters = () => [
|
|
107
|
+
{ type: SdLoadingService }
|
|
108
|
+
];
|
|
77
109
|
SdComment.propDecorators = {
|
|
110
|
+
commentScroll: [{ type: ViewChild, args: ['commentScroll',] }],
|
|
78
111
|
textarea: [{ type: ViewChild, args: [SdTextarea,] }],
|
|
79
112
|
option: [{ type: Input }]
|
|
80
113
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-angular-core-comment.js","sources":["../../../../projects/sd-core/comment/src/lib/comment.component.ts","../../../../projects/sd-core/comment/src/lib/comment.module.ts","../../../../projects/sd-core/comment/src/public-api.ts","../../../../projects/sd-core/comment/sd-angular-core-comment.ts"],"sourcesContent":["import {\r\n Component,\r\n AfterViewInit,\r\n OnInit,\r\n OnDestroy,\r\n Input,\r\n ChangeDetectionStrategy,\r\n ViewChild\r\n} from '@angular/core';\r\nimport {SdTextarea} from '@sd-angular/core/textarea';\r\nimport {BehaviorSubject, Observable} from 'rxjs';\r\nimport {map, switchMap} from 'rxjs/operators';\r\nimport {Comment, SdCommentOption} from './comment.model';\r\n\r\n@Component({\r\n selector: 'sd-comment',\r\n templateUrl: './comment.component.html',\r\n styleUrls: ['./comment.component.scss'],\r\n changeDetection: ChangeDetectionStrategy.OnPush\r\n})\r\nexport class SdComment implements OnInit, AfterViewInit, OnDestroy {\r\n @ViewChild(SdTextarea) textarea: SdTextarea;\r\n #items = new BehaviorSubject<Comment[]>([]);\r\n #send = new BehaviorSubject<string>('');\r\n commentOption: SdCommentOption;\r\n\r\n @Input() set option(option: SdCommentOption) {\r\n this.commentOption = option;\r\n this.reload();\r\n };\r\n\r\n fullCommentStyles = {\r\n 'min-height': '150px'\r\n };\r\n items: Observable<Comment[]>;\r\n count: Observable<number>;\r\n message: string;\r\n\r\n constructor() {\r\n }\r\n\r\n ngOnInit(): void {\r\n this.items = this.#items.pipe(map(items => {\r\n return items.map(e => ({\r\n ...e,\r\n picture: e.picture ?? `https://ui-avatars.com/api/?size=32&rounded=true&background=random&name=${e.creator}`\r\n }));\r\n }));\r\n this.count = this.items.pipe(map(items => items.length));\r\n }\r\n\r\n ngOnDestroy(): void {\r\n }\r\n\r\n ngAfterViewInit(): void {\r\n }\r\n\r\n onSend = () => {\r\n if (this.message) {\r\n this.commentOption?.event?.onSend(this.message);\r\n this.message = null;\r\n this.textarea?.focus();\r\n }\r\n }\r\n\r\n #load = async () => {\r\n const {items} = this.commentOption;\r\n const results = items();\r\n if (results instanceof Promise) {\r\n return await results;\r\n }\r\n return results;\r\n }\r\n\r\n reload = async () => {\r\n this.#items.next(await this.#load());\r\n }\r\n\r\n clearAllData = () => {\r\n this.message = '';\r\n }\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { SdTranslateModule } from '@sd-angular/core/translate';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { SdComment } from './comment.component';\r\nimport { SdButtonModule } from '@sd-angular/core/button';\r\nimport { SdInputModule } from '@sd-angular/core/input';\r\nimport { SdTextareaModule } from '@sd-angular/core/textarea';\r\nimport { SdUtilityModule } from '@sd-angular/core/utility';\r\nimport { MatTooltipModule } from '@angular/material/tooltip';\r\nimport {SdEditorModule} from '@sd-angular/core/editor';\r\nimport {SdModalModule} from '@sd-angular/core/modal';\r\n\r\n@NgModule({\r\n imports: [\r\n CommonModule,\r\n MatButtonModule,\r\n MatIconModule,\r\n MatTooltipModule,\r\n SdTranslateModule,\r\n SdButtonModule,\r\n SdInputModule,\r\n SdTextareaModule,\r\n SdEditorModule,\r\n SdUtilityModule,\r\n SdModalModule\r\n ],\r\n declarations: [\r\n SdComment\r\n ],\r\n exports: [\r\n SdComment\r\n ],\r\n providers: [\r\n ]\r\n})\r\nexport class SdCommentModule { }\r\n","/*\r\n * Public API Surface of superdev-angular-core\r\n */\r\n\r\nexport * from './lib/comment.module';\r\nexport * from './lib/comment.model';\r\nexport * from './lib/comment.component';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sd-angular-core-comment.js","sources":["../../../../projects/sd-core/comment/src/lib/comment.component.ts","../../../../projects/sd-core/comment/src/lib/comment.module.ts","../../../../projects/sd-core/comment/src/public-api.ts","../../../../projects/sd-core/comment/sd-angular-core-comment.ts"],"sourcesContent":["import {\r\n Component,\r\n AfterViewInit,\r\n OnInit,\r\n OnDestroy,\r\n Input,\r\n ChangeDetectionStrategy,\r\n ViewChild, ElementRef\r\n} from '@angular/core';\r\nimport {SdTextarea} from '@sd-angular/core/textarea';\r\nimport {BehaviorSubject, Observable} from 'rxjs';\r\nimport {map, switchMap} from 'rxjs/operators';\r\nimport {Comment, SdCommentOption} from './comment.model';\r\nimport {SdLoadingService} from '@sd-angular/core/loading';\r\n\r\n@Component({\r\n selector: 'sd-comment',\r\n templateUrl: './comment.component.html',\r\n styleUrls: ['./comment.component.scss'],\r\n changeDetection: ChangeDetectionStrategy.OnPush\r\n})\r\nexport class SdComment implements OnInit, AfterViewInit, OnDestroy {\r\n @ViewChild('commentScroll') private commentScroll: ElementRef;\r\n @ViewChild(SdTextarea) textarea: SdTextarea;\r\n #items = new BehaviorSubject<Comment[]>([]);\r\n #send = new BehaviorSubject<string>('');\r\n commentOption: SdCommentOption;\r\n #timerReload: any;\r\n isReloading = false;\r\n\r\n @Input() set option(option: SdCommentOption) {\r\n this.commentOption = option;\r\n this.reload();\r\n };\r\n\r\n fullCommentStyles = {\r\n 'min-height': '150px'\r\n };\r\n items: Observable<Comment[]>;\r\n count: Observable<number>;\r\n message: string;\r\n\r\n constructor(\r\n private loadingService: SdLoadingService,\r\n ) {\r\n }\r\n\r\n ngOnInit(): void {\r\n this.items = this.#items.pipe(map(items => {\r\n return items.map(e => ({\r\n ...e,\r\n picture: e.picture ?? `https://ui-avatars.com/api/?size=32&rounded=true&background=random&name=${e.creator}`\r\n }));\r\n }));\r\n this.count = this.items.pipe(map(items => items.length));\r\n }\r\n\r\n ngOnDestroy(): void {\r\n if (this.commentOption?.autoReload?.timerMs) {\r\n clearInterval(this.#timerReload);\r\n }\r\n }\r\n\r\n ngAfterViewInit(): void {\r\n }\r\n\r\n onSend = () => {\r\n if (this.message) {\r\n this.commentOption?.event?.onSend(this.message);\r\n this.message = null;\r\n this.textarea?.focus();\r\n }\r\n }\r\n\r\n #load = async () => {\r\n const {items} = this.commentOption;\r\n const results = items();\r\n if (results instanceof Promise) {\r\n return await results;\r\n }\r\n return results;\r\n }\r\n\r\n reload = async () => {\r\n this.loadingService.start('.c-comment-loading');\r\n this.#items.next(await this.#load());\r\n this.loadingService.stop('.c-comment-loading');\r\n this.#scrollToBottom();\r\n\r\n if (this.commentOption?.autoReload?.timerMs) {\r\n clearInterval(this.#timerReload);\r\n this.#timerReload = setInterval(async () => {\r\n this.loadingService.start('.c-comment-loading');\r\n this.#items.next(await this.#load());\r\n this.loadingService.stop('.c-comment-loading');\r\n this.#scrollToBottom();\r\n }, this.commentOption.autoReload.timerMs);\r\n }\r\n }\r\n\r\n clearAllData = () => {\r\n this.message = '';\r\n }\r\n\r\n #scrollToBottom = () => {\r\n try {\r\n setTimeout(() => {\r\n this.commentScroll.nativeElement.scrollTop = this.commentScroll.nativeElement.scrollHeight;\r\n }, 500);\r\n } catch (err) {\r\n }\r\n }\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { SdTranslateModule } from '@sd-angular/core/translate';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { SdComment } from './comment.component';\r\nimport { SdButtonModule } from '@sd-angular/core/button';\r\nimport { SdInputModule } from '@sd-angular/core/input';\r\nimport { SdTextareaModule } from '@sd-angular/core/textarea';\r\nimport { SdUtilityModule } from '@sd-angular/core/utility';\r\nimport { MatTooltipModule } from '@angular/material/tooltip';\r\nimport {SdEditorModule} from '@sd-angular/core/editor';\r\nimport {SdModalModule} from '@sd-angular/core/modal';\r\n\r\n@NgModule({\r\n imports: [\r\n CommonModule,\r\n MatButtonModule,\r\n MatIconModule,\r\n MatTooltipModule,\r\n SdTranslateModule,\r\n SdButtonModule,\r\n SdInputModule,\r\n SdTextareaModule,\r\n SdEditorModule,\r\n SdUtilityModule,\r\n SdModalModule\r\n ],\r\n declarations: [\r\n SdComment\r\n ],\r\n exports: [\r\n SdComment\r\n ],\r\n providers: [\r\n ]\r\n})\r\nexport class SdCommentModule { }\r\n","/*\r\n * Public API Surface of superdev-angular-core\r\n */\r\n\r\nexport * from './lib/comment.module';\r\nexport * from './lib/comment.model';\r\nexport * from './lib/comment.component';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;MAqBa,SAAS;IAqBpB,YACU,cAAgC;QAAhC,mBAAc,GAAd,cAAc,CAAkB;QAnB1C,iBAAS,IAAI,eAAe,CAAY,EAAE,CAAC,EAAC;QAC5C,gBAAQ,IAAI,eAAe,CAAS,EAAE,CAAC,EAAC;QAExC,+BAAkB;QAClB,gBAAW,GAAG,KAAK,CAAC;QAOpB,sBAAiB,GAAG;YAClB,YAAY,EAAE,OAAO;SACtB,CAAC;QA6BF,WAAM,GAAG;;YACP,IAAI,IAAI,CAAC,OAAO,EAAE;gBAChB,YAAA,IAAI,CAAC,aAAa,0CAAE,KAAK,0CAAE,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE;gBAChD,IAAI,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EAAE,EACV;aACF;;;ACpCD;;;;ACAA;;;;;;"}
|
|
@@ -514,7 +514,7 @@ SdEditor.decorators = [
|
|
|
514
514
|
selector: 'sd-editor',
|
|
515
515
|
template: "<div id=\"box-{{id}}\">\r\n <label *ngIf=\"label && !sdLabelDef?.templateRef\" class=\"d-block T14M\">{{label}} <span class=\"text-danger mb-2\"\r\n *ngIf=\"required\">*</span></label>\r\n <ng-container *ngIf=\"sdLabelDef?.templateRef\" matSuffix>\r\n <ng-container *ngTemplateOutlet=\"sdLabelDef.templateRef\">\r\n </ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"!formControl.disabled && !showHtmlEditor\">\r\n <quill-editor #editor [styles]=\"styles\" (onEditorCreated)=\"editorInit($event)\" [ngModel]=\"formControl.value\"\r\n (onSelectionChanged)=\"onSelectionChanged($event)\"\r\n (onContentChanged)=\"onContentChanged($event)\"\r\n (ngModelChange)=\"onModelChange($event)\" [id]=\"id\" [modules]=\"quillConfig\" [placeholder]=\"placeholder\"\r\n [maxLength]=\"maxlength\">\r\n </quill-editor>\r\n <span class=\"d-block text-danger mt-5\" *ngIf=\"formControl.errors?.required\">\r\n {{'This field is required' | sdTranslate}}\r\n </span>\r\n <span class=\"d-block text-danger mt-5\" *ngIf=\"formControl.errors?.minlength\">\r\n {{'Max length' | sdTranslate}} <strong>{{minlength}}</strong>\r\n </span>\r\n <span class=\"d-block text-danger mt-5\" *ngIf=\"formControl.errors?.maxlength\">\r\n {{'Max length' | sdTranslate}} <strong>{{maxlength}}</strong>\r\n </span>\r\n </ng-container>\r\n <ng-container *ngIf=\"formControl.disabled\">\r\n <div [innerHtml]=\"formControl.value\"></div>\r\n </ng-container>\r\n <ng-container *ngIf=\"enableHTMLButton\">\r\n <sd-textarea [(model)]=\"modelHTML\" *ngIf=\"showHtmlEditor\" rows=\"20\"\r\n (modelChange)=\"onModelChange($event)\"></sd-textarea>\r\n <sd-button\r\n title=\"{{showHtmlEditor?'\u1EA8n':'Hi\u1EC7n'}} m\u00E3 HTML\"\r\n class=\"mr-8\"\r\n fontSet=\"material-icons-outlined\"\r\n (action)=\"onClickShowHtmlEditor()\"\r\n type=\"light\"\r\n ></sd-button>\r\n </ng-container>\r\n</div>\r\n",
|
|
516
516
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
517
|
-
styles: ["::ng-deep img[alt=c-image-editor-quill]{max-width:
|
|
517
|
+
styles: ["::ng-deep img[alt=c-image-editor-quill]{max-height:50px}::ng-deep .c-image-editor-quill-box{background:#000;display:inline-block;position:relative}::ng-deep .c-image-editor-quill-box:hover:after{background:url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAACXBIWXMAAA7EAAAOxAGVKw4bAAACoklEQVRIia2WzUtVURTF1748RCQkHIhEiIiINJAGDqMcRYRNQgqiSCKoUUVE/0FIQ2lYJtGgQUhUUA36IIIggkD6HgU6iJz0IZpmrl+Dd67c7nv6hNqTe+5dZ++19zr7bG6oZEAmqU/SQUk7JHVLqgCzEfFK0i1JjyNisezb0Gx3AJeBOWAZ+AJM2X4JfALm0/cXwCCw8eBAJ/Caqj0Dhmy35UGAJmA7MAb8tD0PjNjeUPAO229tL9k+b7vSYP8A8DHtH24UPAPGU+bnbGcFTLb32z4DtJb8epOEM8DW9Qj6gXnbT9MBFzEBj2wDdJV9bR8DVmxfWI9g1PYysKcOJttPEkF3HbwFeG/7czm53DJJgxExCzyvh0eEIiLf+5dFxIKkhxHRoWpr11hF1T6fzrLsR8pqWNLR1D2ZpH5AETEOLKQ901mWnUjrtymBbknv6hE0AauXBuiRNFR4z5c783VEfChUsZi+N69VwWxEtNuuZFn2OyKuSLqTss8iYlzSgKR9ETGdSIsJbUkVzNYjEHDD9hzQW8Zsrx6y7Z46vgLup9u9uV78TNKkpBZJR8pgyqxmXbB+VefVw4j4tlYFm9KI+A70lTABN9Ic6iphFeAusGS7psX/Mtt7bS8BU0BnHZLiYefBLybpbgLrjpZ8XJwClm3PAAdsN62RzDbbt1NwbL+3fRI4BNT4rAqbbuIIMBoRbZLeSHqQ+vwXsDUidkkaBJoj4h6wPSJy6QxcjYjT6QKuKVeP7Uu2v1JrK2k2DSWZzuZAGicrtq81lCxV1JTG8gHbh23vBtpLe46noDlB/rwOtDQk2UASLanLaiq1PWH730lst9q+lVdQlAsY+2cCqSpnTlKUC/j6XwgSSSswWWqIif9GIK3KNUH1r+QasOkPpU8FJ4KtSqcAAAAASUVORK5CYII=\") 50% no-repeat;background-size:16px;bottom:0;content:\"\";left:0;position:absolute;top:0;width:100%}::ng-deep .c-image-editor-quill-box:hover img{opacity:.4}::ng-deep .ql-toolbar input.ql-customFile[type=file]{display:none}"]
|
|
518
518
|
},] }
|
|
519
519
|
];
|
|
520
520
|
SdEditor.ctorParameters = () => [
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|