@sd-angular/core 1.3.248 → 1.3.250
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/bundles/sd-angular-core-date-full.umd.js +25 -2
- package/bundles/sd-angular-core-date-full.umd.js.map +1 -1
- package/bundles/sd-angular-core-date-full.umd.min.js +1 -1
- package/bundles/sd-angular-core-date-full.umd.min.js.map +1 -1
- package/bundles/sd-angular-core-modal.umd.js +1 -1
- package/bundles/sd-angular-core-modal.umd.min.js +1 -1
- package/bundles/sd-angular-core-modal.umd.min.js.map +1 -1
- package/bundles/sd-angular-core-month.umd.js +3 -3
- package/bundles/sd-angular-core-month.umd.js.map +1 -1
- package/bundles/sd-angular-core-month.umd.min.js +1 -1
- package/bundles/sd-angular-core-month.umd.min.js.map +1 -1
- package/bundles/sd-angular-core-select.umd.js +1 -1
- package/bundles/sd-angular-core-select.umd.min.js +2 -2
- package/bundles/sd-angular-core-select.umd.min.js.map +1 -1
- package/bundles/sd-angular-core-table.umd.js +1 -1
- package/bundles/sd-angular-core-table.umd.js.map +1 -1
- package/bundles/sd-angular-core-table.umd.min.js +1 -1
- package/bundles/sd-angular-core-table.umd.min.js.map +1 -1
- package/date-full/sd-angular-core-date-full.metadata.json +1 -1
- package/date-full/src/lib/date-full.component.d.ts +6 -1
- package/esm2015/date-full/src/lib/date-full.component.js +14 -3
- package/esm2015/modal/src/lib/modal/modal-header/modal-header.component.js +1 -1
- package/esm2015/month/src/lib/month.component.js +4 -4
- package/esm2015/select/src/lib/select.component.js +1 -1
- package/esm2015/table/src/lib/components/popup-filter/popup-filter.component.js +2 -2
- package/fesm2015/sd-angular-core-date-full.js +13 -2
- package/fesm2015/sd-angular-core-date-full.js.map +1 -1
- package/fesm2015/sd-angular-core-modal.js +1 -1
- package/fesm2015/sd-angular-core-month.js +3 -3
- package/fesm2015/sd-angular-core-month.js.map +1 -1
- package/fesm2015/sd-angular-core-select.js +1 -1
- package/fesm2015/sd-angular-core-table.js +1 -1
- package/fesm2015/sd-angular-core-table.js.map +1 -1
- package/modal/sd-angular-core-modal.metadata.json +1 -1
- package/month/sd-angular-core-month.metadata.json +1 -1
- package/package.json +1 -1
- package/{sd-angular-core-1.3.248.tgz → sd-angular-core-1.3.250.tgz} +0 -0
- package/select/sd-angular-core-select.metadata.json +1 -1
- package/table/sd-angular-core-table.metadata.json +1 -1
|
@@ -220,6 +220,15 @@ class SdDateFull {
|
|
|
220
220
|
label: val,
|
|
221
221
|
});
|
|
222
222
|
}
|
|
223
|
+
set _defaultHour(val) {
|
|
224
|
+
this.defaultHour = val;
|
|
225
|
+
}
|
|
226
|
+
set _defaultMinute(val) {
|
|
227
|
+
this.defaultMinute = val;
|
|
228
|
+
}
|
|
229
|
+
set _defaultSecond(val) {
|
|
230
|
+
this.defaultSecond = val;
|
|
231
|
+
}
|
|
223
232
|
set minDate(val) {
|
|
224
233
|
if (Date.isDate(val)) {
|
|
225
234
|
this.min = new Date(val);
|
|
@@ -276,7 +285,7 @@ _date = new WeakMap(), _name = new WeakMap(), _form = new WeakMap(), _subscripti
|
|
|
276
285
|
SdDateFull.decorators = [
|
|
277
286
|
{ type: Component, args: [{
|
|
278
287
|
selector: 'sd-date-full',
|
|
279
|
-
template: "<ng-container *ngIf=\"!appearance && sdLabelDef?.templateRef\">\r\n <ng-container *ngTemplateOutlet=\"sdLabelDef.templateRef\"> </ng-container>\r\n</ng-container>\r\n<label *ngIf=\"!appearance && label && !sdLabelDef?.templateRef\" class=\"d-block mb-0 T14M\"\r\n >{{ label }} <span class=\"text-danger mb-2\" *ngIf=\"required\">*</span></label\r\n>\r\n<div\r\n class=\"d-flex align-items-center\"\r\n [class.sd-view]=\"sdView?.templateRef\"\r\n [class.c-focused]=\"isFocused\"\r\n [class.c-disabled]=\"formControl.disabled\"\r\n (click)=\"onClick()\">\r\n <ng-container *ngIf=\"sdView?.templateRef && !isFocused && !dateTimePicker?.opened; else default\">\r\n <ng-container *ngTemplateOutlet=\"sdView.templateRef; context: { value: formControl.value }\"> </ng-container>\r\n </ng-container>\r\n <ng-template #default>\r\n <mat-form-field\r\n class=\"sd-md\"\r\n [ngClass]=\"{ 'sd-sm': size === 'sm', 'no-padding-wrapper': disableErrorMessage }\"\r\n [appearance]=\"appearance || 'outline'\">\r\n <mat-label *ngIf=\"appearance && label\">{{ label }}</mat-label>\r\n <input\r\n aria-hidden=\"true\"\r\n [id]=\"id\"\r\n matInput\r\n (keyup)=\"onKeyup($event)\"\r\n (keydown)=\"onKeyDown($event)\"\r\n (dateChange)=\"onChange($event)\"\r\n [autocomplete]=\"id\"\r\n autocorrect=\"off\"\r\n [formControl]=\"formControl\"\r\n [ngxMatDatetimePicker]=\"picker1\"\r\n [placeholder]=\"placeholder || (appearance ? label : '')\"\r\n [min]=\"min\"\r\n [required]=\"required\"\r\n [max]=\"max\"\r\n (focus)=\"onFocus()\"\r\n (blur)=\"onBlur()\"\r\n [attr.data-qclabel]=\"label\"\r\n [attr.data-qcid]=\"qcId\"\r\n #input\r\n [maxLength]=\"19\" />\r\n <ng-content select=\"[sdSuffixIcon]\" matSuffix></ng-content>\r\n <mat-icon\r\n *ngIf=\"formControl?.value && !required && !formControl.disabled\"\r\n class=\"pointer sd-suffix-icon\"\r\n (click)=\"clear($event)\"\r\n matSuffix\r\n >cancel\r\n </mat-icon>\r\n <mat-datepicker-toggle matSuffix [for]=\"picker1\"> </mat-datepicker-toggle>\r\n <ngx-mat-datetime-picker\r\n #picker1\r\n [
|
|
288
|
+
template: "<ng-container *ngIf=\"!appearance && sdLabelDef?.templateRef\">\r\n <ng-container *ngTemplateOutlet=\"sdLabelDef.templateRef\"> </ng-container>\r\n</ng-container>\r\n<label *ngIf=\"!appearance && label && !sdLabelDef?.templateRef\" class=\"d-block mb-0 T14M\"\r\n >{{ label }} <span class=\"text-danger mb-2\" *ngIf=\"required\">*</span></label\r\n>\r\n<div\r\n class=\"d-flex align-items-center\"\r\n [class.sd-view]=\"sdView?.templateRef\"\r\n [class.c-focused]=\"isFocused\"\r\n [class.c-disabled]=\"formControl.disabled\"\r\n (click)=\"onClick()\">\r\n <ng-container *ngIf=\"sdView?.templateRef && !isFocused && !dateTimePicker?.opened; else default\">\r\n <ng-container *ngTemplateOutlet=\"sdView.templateRef; context: { value: formControl.value }\"> </ng-container>\r\n </ng-container>\r\n <ng-template #default>\r\n <mat-form-field\r\n class=\"sd-md\"\r\n [ngClass]=\"{ 'sd-sm': size === 'sm', 'no-padding-wrapper': disableErrorMessage }\"\r\n [appearance]=\"appearance || 'outline'\">\r\n <mat-label *ngIf=\"appearance && label\">{{ label }}</mat-label>\r\n <input\r\n aria-hidden=\"true\"\r\n [id]=\"id\"\r\n matInput\r\n (keyup)=\"onKeyup($event)\"\r\n (keydown)=\"onKeyDown($event)\"\r\n (dateChange)=\"onChange($event)\"\r\n [autocomplete]=\"id\"\r\n autocorrect=\"off\"\r\n [formControl]=\"formControl\"\r\n [ngxMatDatetimePicker]=\"picker1\"\r\n [placeholder]=\"placeholder || (appearance ? label : '')\"\r\n [min]=\"min\"\r\n [required]=\"required\"\r\n [max]=\"max\"\r\n (focus)=\"onFocus()\"\r\n (blur)=\"onBlur()\"\r\n [attr.data-qclabel]=\"label\"\r\n [attr.data-qcid]=\"qcId\"\r\n #input\r\n [maxLength]=\"19\" />\r\n <ng-content select=\"[sdSuffixIcon]\" matSuffix></ng-content>\r\n <mat-icon\r\n *ngIf=\"formControl?.value && !required && !formControl.disabled\"\r\n class=\"pointer sd-suffix-icon\"\r\n (click)=\"clear($event)\"\r\n matSuffix\r\n >cancel\r\n </mat-icon>\r\n <mat-datepicker-toggle matSuffix [for]=\"picker1\"> </mat-datepicker-toggle>\r\n <ngx-mat-datetime-picker\r\n #picker1\r\n [showSeconds]=\"true\"\r\n [touchUi]=\"isMobileOrTablet\"\r\n [showSpinners]=\"false\"\r\n (opened)=\"onFocus()\"\r\n (closed)=\"onBlur(); focusInputElement()\">\r\n </ngx-mat-datetime-picker>\r\n <mat-error *ngIf=\"formControl?.errors?.required && formControl?.touched\">\r\n <ng-container *ngIf=\"!disableErrorMessage\">{{ 'This field is required' | sdTranslate }}</ng-container>\r\n </mat-error>\r\n <mat-error *ngIf=\"formControl?.errors?.matDatetimePickerMin && formControl?.touched && !isFocused\">\r\n <ng-container *ngIf=\"!disableErrorMessage\"\r\n >{{ 'Min date' | sdTranslate }}:\r\n <strong>{{ min | date : 'dd/MM/yyyy HH:mm:ss' }}</strong>\r\n </ng-container>\r\n </mat-error>\r\n <mat-error *ngIf=\"formControl?.errors?.matDatetimePickerMax && formControl?.touched && !isFocused\">\r\n <ng-container *ngIf=\"!disableErrorMessage\"\r\n >{{ 'Max date' | sdTranslate }}:\r\n <strong>{{ max | date : 'dd/MM/yyyy HH:mm:ss' }}</strong>\r\n </ng-container>\r\n </mat-error>\r\n <mat-error *ngIf=\"formControl?.errors?.matDatetimePickerParse && formControl?.touched && !isFocused\">\r\n <ng-container *ngIf=\"!disableErrorMessage\"\r\n >{{ 'Parse error' | sdTranslate }}:\r\n <strong>{{ formControl?.errors?.matDatetimePickerParse?.text }}</strong>\r\n </ng-container>\r\n </mat-error>\r\n <mat-error *ngIf=\"formControl?.errors?.customValidator && formControl?.touched && !disableErrorMessage\">\r\n <ng-container *ngIf=\"!disableErrorMessage\">{{ formControl?.errors?.customValidator }} </ng-container>\r\n </mat-error>\r\n <mat-error *ngIf=\"formControl?.errors?.date && formControl?.touched && !disableErrorMessage\">\r\n <ng-container *ngIf=\"!disableErrorMessage\">{{ formControl?.errors?.date }} </ng-container>\r\n </mat-error>\r\n <mat-error *ngIf=\"formControl.errors?.inlineError && formControl?.touched && !disableErrorMessage\">\r\n <ng-container *ngIf=\"!disableErrorMessage\">{{ inlineError }}</ng-container>\r\n </mat-error>\r\n </mat-form-field>\r\n </ng-template>\r\n</div>\r\n",
|
|
280
289
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
281
290
|
providers: [{ provide: NGX_MAT_DATE_FORMATS, useValue: ɵ0 }],
|
|
282
291
|
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.mat-input-element:disabled{color:#4d4d4d!important}:host ::ng-deep .mat-form-field .mat-placeholder-required{color:#f82c13}.sd-view:not(.c-focused):not(.c-disabled):hover{background-color:#ebecf0}"]
|
|
@@ -300,7 +309,9 @@ SdDateFull.propDecorators = {
|
|
|
300
309
|
_inlineError: [{ type: Input, args: ['inlineError',] }],
|
|
301
310
|
_label: [{ type: Input, args: ['label',] }],
|
|
302
311
|
placeholder: [{ type: Input }],
|
|
303
|
-
|
|
312
|
+
_defaultHour: [{ type: Input, args: ['defaultHour',] }],
|
|
313
|
+
_defaultMinute: [{ type: Input, args: ['defaultMinute',] }],
|
|
314
|
+
_defaultSecond: [{ type: Input, args: ['defaultSecond',] }],
|
|
304
315
|
minDate: [{ type: Input }],
|
|
305
316
|
maxDate: [{ type: Input }],
|
|
306
317
|
validator: [{ type: Input }],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-angular-core-date-full.js","sources":["../../../../projects/sd-core/date-full/src/lib/date-full.component.ts","../../../../projects/sd-core/date-full/src/lib/date-full.module.ts","../../../../projects/sd-core/date-full/sd-angular-core-date-full.ts"],"sourcesContent":["import { NGX_MAT_DATE_FORMATS, NgxMatDatetimePicker } from '@angular-material-components/datetime-picker';\r\nimport {\r\n AfterViewInit,\r\n ChangeDetectionStrategy,\r\n ChangeDetectorRef,\r\n Component,\r\n ContentChild,\r\n ElementRef,\r\n EventEmitter,\r\n Inject,\r\n Input,\r\n OnDestroy,\r\n OnInit,\r\n Optional,\r\n Output,\r\n ViewChild,\r\n} from '@angular/core';\r\nimport { AbstractControl, FormGroup, NgForm, ValidatorFn, Validators } from '@angular/forms';\r\nimport { MatDatepicker, MatDatepickerInputEvent } from '@angular/material/datepicker';\r\nimport { MatFormFieldAppearance } from '@angular/material/form-field';\r\nimport { FORM_CONFIG, IFormConfiguration, SdFormControl, SdLabelDefDirective, SdViewDefDirective } from '@sd-angular/core/common';\r\nimport moment, { Moment } from 'moment';\r\nimport { DeviceDetectorService } from 'ngx-device-detector';\r\nimport hash from 'object-hash';\r\nimport { Subscription } from 'rxjs';\r\nimport * as uuid from 'uuid';\r\n\r\nconst CUSTOM_DATETIME_FORMATS = {\r\n parse: {\r\n dateInput: 'DD/MM/YYYY HH:mm:ss',\r\n },\r\n display: {\r\n dateInput: 'DD/MM/YYYY HH:mm:ss',\r\n monthYearLabel: 'MMM YYYY',\r\n dateA11yLabel: 'LL',\r\n monthYearA11yLabel: 'MMMM YYYY',\r\n },\r\n};\r\n\r\n@Component({\r\n selector: 'sd-date-full',\r\n templateUrl: './date-full.component.html',\r\n styleUrls: ['./date-full.component.scss'],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n providers: [{ provide: NGX_MAT_DATE_FORMATS, useValue: CUSTOM_DATETIME_FORMATS }],\r\n})\r\nexport class SdDateFull implements OnDestroy, OnInit, AfterViewInit {\r\n id = `I${uuid.v4()}`;\r\n isMobileOrTablet = false;\r\n #date: any;\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\r\n @Input() appearance: MatFormFieldAppearance;\r\n disableErrorMessage = false;\r\n\r\n @Input('disableErrorMessage') set _disableErrorMessage(val: boolean | '') {\r\n this.disableErrorMessage = val === '' || val;\r\n val = val === '' || val;\r\n }\r\n\r\n formControl = new SdFormControl();\r\n min: Date;\r\n\r\n @Input('min') set _min(val: string | Date | number) {\r\n if (Date.isDate(val)) {\r\n this.min = new Date(val);\r\n } else {\r\n this.min = null;\r\n }\r\n }\r\n\r\n max: Date;\r\n\r\n @Input('max') set _max(val: string | Date | number) {\r\n if (Date.isDate(val)) {\r\n this.max = new Date(val);\r\n } else {\r\n this.max = null;\r\n }\r\n }\r\n\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\r\n @Input() set disabled(val: boolean | '') {\r\n val = val === '' || val;\r\n if (val) {\r\n this.formControl.disable();\r\n } else {\r\n this.formControl.enable();\r\n }\r\n }\r\n\r\n required = false;\r\n\r\n @Input('required') set _required(val: boolean | '') {\r\n this.required = val === '' || val;\r\n if (this.required) {\r\n this.formControl.setValidators([Validators.required]);\r\n } else {\r\n this.formControl.clearValidators();\r\n }\r\n }\r\n\r\n inlineError: string;\r\n\r\n @Input('inlineError') set _inlineError(val: string) {\r\n this.inlineError = val;\r\n // this.#updateValidator();\r\n if (this.inlineError) {\r\n this.formControl.setValidators([this.customInlineErrorValidator()]);\r\n this.formControl.updateValueAndValidity();\r\n } else {\r\n this.formControl.clearValidators();\r\n this.formControl.updateValueAndValidity();\r\n }\r\n }\r\n\r\n qcId: string;\r\n label: string;\r\n\r\n @Input('label') set _label(val: string) {\r\n this.label = val;\r\n this.qcId = hash({\r\n selector: 'sd-date-full',\r\n label: val,\r\n });\r\n }\r\n\r\n @Input() placeholder: string;\r\n @Input() defaultTime: any;\r\n\r\n @Input() set minDate(val: string | Date) {\r\n if (Date.isDate(val)) {\r\n this.min = new Date(val);\r\n } else {\r\n this.min = null;\r\n }\r\n }\r\n\r\n @Input() set maxDate(val: string | Date) {\r\n if (Date.isDate(val)) {\r\n this.max = new Date(val);\r\n } else {\r\n this.max = null;\r\n }\r\n }\r\n\r\n @Input() validator: (value: any) => string | Promise<string>;\r\n @Output() sdChange = new EventEmitter();\r\n @Output() sdFocus = new EventEmitter<any>();\r\n\r\n @Input() set model(val: any) {\r\n if (!Date.isDate(val)) {\r\n val = null;\r\n }\r\n if (this.#date !== val) {\r\n this.#date = val;\r\n const date = Date.isDate(this.#date) ? moment(Date.toFormat(this.#date, 'MM/dd/yyyy HH:mm:ss'), 'MM/DD/YYYY HH:mm:ss') : null;\r\n this.formControl.setValue(date);\r\n }\r\n }\r\n\r\n @Output() modelChange = new EventEmitter();\r\n #subscription = new Subscription();\r\n @ContentChild(SdViewDefDirective) sdView: SdViewDefDirective;\r\n @ContentChild(SdLabelDefDirective) sdLabelDef: SdLabelDefDirective;\r\n @ViewChild('input') input: ElementRef;\r\n @ViewChild(NgxMatDatetimePicker) dateTimePicker: NgxMatDatetimePicker<Moment>;\r\n isFocused = false;\r\n\r\n constructor(\r\n private ref: ChangeDetectorRef,\r\n deviceService: DeviceDetectorService,\r\n @Inject(FORM_CONFIG) @Optional() private formConfig: IFormConfiguration\r\n ) {\r\n this.isMobileOrTablet = !deviceService.isDesktop();\r\n }\r\n\r\n ngOnDestroy() {\r\n this.#form?.removeControl(this.#name);\r\n this.#subscription.unsubscribe();\r\n }\r\n\r\n ngOnInit() {\r\n this.appearance = this.appearance || this.formConfig?.appearance;\r\n this.#subscription.add(\r\n this.formControl.sdChanges.subscribe(() => {\r\n // this.formControl.updateValueAndValidity();\r\n this.ref.markForCheck();\r\n })\r\n );\r\n this.#form?.addControl(this.#name, this.formControl);\r\n }\r\n\r\n // Hàm tạo Validators tùy chỉnh cho inlineError\r\n customInlineErrorValidator(): ValidatorFn {\r\n return (control: AbstractControl): { [key: string]: any } | null => {\r\n return { inlineError: true };\r\n };\r\n }\r\n\r\n ngAfterViewInit() {}\r\n\r\n onFocus = () => {\r\n this.isFocused = true;\r\n this.sdFocus.emit();\r\n };\r\n\r\n onBlur = () => {\r\n this.isFocused = false;\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.input?.nativeElement?.focus();\r\n this.dateTimePicker?.open();\r\n }, 100);\r\n };\r\n\r\n focusInputElement() {\r\n this.input?.nativeElement?.focus();\r\n }\r\n\r\n isValid: boolean;\r\n onKeyDown = (event: KeyboardEvent) => {\r\n const key = event.keyCode || event.charCode;\r\n let isShift = false;\r\n if (key === 16) {\r\n isShift = true;\r\n }\r\n\r\n // cho phép copy parse\r\n if (event.ctrlKey && (key === 67 || key === 86)) {\r\n console.log('action copy parse... datepicker');\r\n return true;\r\n }\r\n\r\n // Allow only Numeric Keys.\r\n if (\r\n ((key >= 48 && key <= 57) ||\r\n key === 8 ||\r\n key <= 37 ||\r\n key <= 39 ||\r\n (key >= 96 && key <= 105) ||\r\n key === 191 ||\r\n key === 186 ||\r\n key === 59) &&\r\n isShift === false\r\n ) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n };\r\n\r\n onKeyup = event => {\r\n const currentVal: string = event.target.value;\r\n const formControl: AbstractControl = this.formControl;\r\n let regex = /^([1-9]|([012][0-9])|(3[01]))\\/([0]{0,1}[1-9]|1[012])\\/\\d\\d\\d\\d [012]{0,1}[0-9]:[0-6][0-9]:[0-6][0-9]$/g;\r\n\r\n if (currentVal && !regex.test(currentVal)) {\r\n setTimeout(() => {\r\n this.isValid = true;\r\n formControl.markAsDirty();\r\n formControl.markAsTouched();\r\n formControl.setErrors({ ...formControl.errors, date: `Sai định dạng` });\r\n }, 0);\r\n } else {\r\n setTimeout(() => {\r\n this.isValid = false;\r\n formControl.setErrors({ ...formControl.errors, date: null });\r\n this.formControl.updateValueAndValidity();\r\n }, 0);\r\n }\r\n };\r\n\r\n onChange = (event: MatDatepickerInputEvent<Moment>) => {\r\n const value = event.value?.toDate();\r\n if (!this.isValid) {\r\n if (new Date(this.#date) !== value) {\r\n this.modelChange.emit(value);\r\n this.sdChange.emit(value);\r\n }\r\n } else {\r\n this.isValid = false;\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 clear = ($event: any) => {\r\n $event?.stopPropagation();\r\n if (this.formControl.value) {\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","import { NgxMatDatetimePickerModule, NgxMatTimepickerModule } from '@angular-material-components/datetime-picker';\r\nimport { NgxMatMomentModule } from '@angular-material-components/moment-adapter';\r\nimport { CommonModule } from '@angular/common';\r\nimport { NgModule } from '@angular/core';\r\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\r\nimport { MatMomentDateModule } from '@angular/material-moment-adapter';\r\nimport { MatDatepickerModule } from '@angular/material/datepicker';\r\nimport { MatFormFieldModule } from '@angular/material/form-field';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatInputModule } from '@angular/material/input';\r\nimport { SdButtonModule } from '@sd-angular/core/button';\r\nimport { SdCommonModule } from '@sd-angular/core/common';\r\nimport { SdTranslateModule } from '@sd-angular/core/translate';\r\nimport { SdDateFull } from './date-full.component';\r\n\r\n@NgModule({\r\n imports: [\r\n CommonModule,\r\n FormsModule,\r\n ReactiveFormsModule,\r\n MatInputModule,\r\n MatIconModule,\r\n MatFormFieldModule,\r\n MatDatepickerModule,\r\n MatMomentDateModule,\r\n NgxMatDatetimePickerModule,\r\n NgxMatTimepickerModule,\r\n NgxMatMomentModule,\r\n SdTranslateModule,\r\n SdCommonModule,\r\n SdButtonModule,\r\n ],\r\n declarations: [SdDateFull],\r\n exports: [SdCommonModule, SdDateFull],\r\n providers: [],\r\n})\r\nexport class SdDateFullModule {}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["uuid.v4"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA2BA,MAAM,uBAAuB,GAAG;IAC9B,KAAK,EAAE;QACL,SAAS,EAAE,qBAAqB;KACjC;IACD,OAAO,EAAE;QACP,SAAS,EAAE,qBAAqB;QAChC,cAAc,EAAE,UAAU;QAC1B,aAAa,EAAE,IAA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Ac;gBACxB,i9IAAyC;gBAEzC,eAAe,EAAE,uBAAuB,CAAC,MAAM;gBAC/C,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,oBAAoB,EAAE,QAAQ,IAAyB,EAAE,CAAC;;aAClF;;;YAzCC,iBAAiB;YAkBV,qBAAqB;4CAsKzB,MAAM,SAAC,WAAW,cAAG,QAAQ;;;mBAzI/B,KAAK;yBAML,KAAK;mCAGL,KAAK,SAAC,qBAAqB;mBAQ3B,KAAK,SAAC,KAAK;mBAUX,KAAK,SAAC,KAAK;mBAQX,KAAK;mBAEL,KAAK;uBAUL,KAAK;wBAWL,KAAK,SAAC,UAAU;2BAWhB,KAAK,SAAC,aAAa;qBAenB,KAAK,SAAC,OAAO;0BAQb,KAAK;0BACL,KAAK;sBAEL,KAAK;sBAQL,KAAK;wBAQL,KAAK;uBACL,MAAM;sBACN,MAAM;oBAEN,KAAK;0BAWL,MAAM;qBAEN,YAAY,SAAC,kBAAkB;yBAC/B,YAAY,SAAC,mBAAmB;oBAChC,SAAS,SAAC,OAAO;6BACjB,SAAS,SAAC,oBAAoB;;;MClJpB,gBAAgB;;;YArB5B,QAAQ,SAAC;gBACR,OAAO,EAAE;oBACP,YAAY;oBACZ,WAAW;oBACX,mBAAmB;oBACnB,cAAc;oBACd,aAAa;oBACb,kBAAkB;oBAClB,mBAAmB;oBACnB,mBAAmB;oBACnB,0BAA0B;oBAC1B,sBAAsB;oBACtB,kBAAkB;oBAClB,iBAAiB;oBACjB,cAAc;oBACd,cAAc;iBACf;gBACD,YAAY,EAAE,CAAC,UAAU,CAAC;gBAC1B,OAAO,EAAE,CAAC,cAAc,EAAE,UAAU,CAAC;gBACrC,SAAS,EAAE,EAAE;aACd;;;ACnCD;;;;;;"}
|
|
1
|
+
{"version":3,"file":"sd-angular-core-date-full.js","sources":["../../../../projects/sd-core/date-full/src/lib/date-full.component.ts","../../../../projects/sd-core/date-full/src/lib/date-full.module.ts","../../../../projects/sd-core/date-full/sd-angular-core-date-full.ts"],"sourcesContent":["import { NGX_MAT_DATE_FORMATS, NgxMatDatetimePicker } from '@angular-material-components/datetime-picker';\r\nimport {\r\n AfterViewInit,\r\n ChangeDetectionStrategy,\r\n ChangeDetectorRef,\r\n Component,\r\n ContentChild,\r\n ElementRef,\r\n EventEmitter,\r\n Inject,\r\n Input,\r\n OnDestroy,\r\n OnInit,\r\n Optional,\r\n Output,\r\n ViewChild,\r\n} from '@angular/core';\r\nimport { AbstractControl, FormGroup, NgForm, ValidatorFn, Validators } from '@angular/forms';\r\nimport { MatDatepicker, MatDatepickerInputEvent } from '@angular/material/datepicker';\r\nimport { MatFormFieldAppearance } from '@angular/material/form-field';\r\nimport { FORM_CONFIG, IFormConfiguration, SdFormControl, SdLabelDefDirective, SdViewDefDirective } from '@sd-angular/core/common';\r\nimport moment, { Moment } from 'moment';\r\nimport { DeviceDetectorService } from 'ngx-device-detector';\r\nimport hash from 'object-hash';\r\nimport { Subscription } from 'rxjs';\r\nimport * as uuid from 'uuid';\r\n\r\nconst CUSTOM_DATETIME_FORMATS = {\r\n parse: {\r\n dateInput: 'DD/MM/YYYY HH:mm:ss',\r\n },\r\n display: {\r\n dateInput: 'DD/MM/YYYY HH:mm:ss',\r\n monthYearLabel: 'MMM YYYY',\r\n dateA11yLabel: 'LL',\r\n monthYearA11yLabel: 'MMMM YYYY',\r\n },\r\n};\r\n\r\n@Component({\r\n selector: 'sd-date-full',\r\n templateUrl: './date-full.component.html',\r\n styleUrls: ['./date-full.component.scss'],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n providers: [{ provide: NGX_MAT_DATE_FORMATS, useValue: CUSTOM_DATETIME_FORMATS }],\r\n})\r\nexport class SdDateFull implements OnDestroy, OnInit, AfterViewInit {\r\n id = `I${uuid.v4()}`;\r\n isMobileOrTablet = false;\r\n #date: any;\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\r\n @Input() appearance: MatFormFieldAppearance;\r\n disableErrorMessage = false;\r\n\r\n @Input('disableErrorMessage') set _disableErrorMessage(val: boolean | '') {\r\n this.disableErrorMessage = val === '' || val;\r\n val = val === '' || val;\r\n }\r\n\r\n formControl = new SdFormControl();\r\n min: Date;\r\n\r\n @Input('min') set _min(val: string | Date | number) {\r\n if (Date.isDate(val)) {\r\n this.min = new Date(val);\r\n } else {\r\n this.min = null;\r\n }\r\n }\r\n\r\n max: Date;\r\n\r\n @Input('max') set _max(val: string | Date | number) {\r\n if (Date.isDate(val)) {\r\n this.max = new Date(val);\r\n } else {\r\n this.max = null;\r\n }\r\n }\r\n\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\r\n @Input() set disabled(val: boolean | '') {\r\n val = val === '' || val;\r\n if (val) {\r\n this.formControl.disable();\r\n } else {\r\n this.formControl.enable();\r\n }\r\n }\r\n\r\n required = false;\r\n\r\n @Input('required') set _required(val: boolean | '') {\r\n this.required = val === '' || val;\r\n if (this.required) {\r\n this.formControl.setValidators([Validators.required]);\r\n } else {\r\n this.formControl.clearValidators();\r\n }\r\n }\r\n\r\n inlineError: string;\r\n\r\n @Input('inlineError') set _inlineError(val: string) {\r\n this.inlineError = val;\r\n // this.#updateValidator();\r\n if (this.inlineError) {\r\n this.formControl.setValidators([this.customInlineErrorValidator()]);\r\n this.formControl.updateValueAndValidity();\r\n } else {\r\n this.formControl.clearValidators();\r\n this.formControl.updateValueAndValidity();\r\n }\r\n }\r\n\r\n qcId: string;\r\n label: string;\r\n\r\n @Input('label') set _label(val: string) {\r\n this.label = val;\r\n this.qcId = hash({\r\n selector: 'sd-date-full',\r\n label: val,\r\n });\r\n }\r\n\r\n @Input() placeholder: string;\r\n\r\n defaultHour: number;\r\n @Input('defaultHour') set _defaultHour(val: number) {\r\n this.defaultHour = val;\r\n }\r\n defaultMinute: number;\r\n @Input('defaultMinute') set _defaultMinute(val: number) {\r\n this.defaultMinute = val;\r\n }\r\n defaultSecond: number;\r\n @Input('defaultSecond') set _defaultSecond(val: number) {\r\n this.defaultSecond = val;\r\n }\r\n\r\n @Input() set minDate(val: string | Date) {\r\n if (Date.isDate(val)) {\r\n this.min = new Date(val);\r\n } else {\r\n this.min = null;\r\n }\r\n }\r\n\r\n @Input() set maxDate(val: string | Date) {\r\n if (Date.isDate(val)) {\r\n this.max = new Date(val);\r\n } else {\r\n this.max = null;\r\n }\r\n }\r\n\r\n @Input() validator: (value: any) => string | Promise<string>;\r\n @Output() sdChange = new EventEmitter();\r\n @Output() sdFocus = new EventEmitter<any>();\r\n\r\n @Input() set model(val: any) {\r\n if (!Date.isDate(val)) {\r\n val = null;\r\n }\r\n if (this.#date !== val) {\r\n this.#date = val;\r\n const date = Date.isDate(this.#date) ? moment(Date.toFormat(this.#date, 'MM/dd/yyyy HH:mm:ss'), 'MM/DD/YYYY HH:mm:ss') : null;\r\n this.formControl.setValue(date);\r\n }\r\n }\r\n\r\n @Output() modelChange = new EventEmitter();\r\n #subscription = new Subscription();\r\n @ContentChild(SdViewDefDirective) sdView: SdViewDefDirective;\r\n @ContentChild(SdLabelDefDirective) sdLabelDef: SdLabelDefDirective;\r\n @ViewChild('input') input: ElementRef;\r\n @ViewChild(NgxMatDatetimePicker) dateTimePicker: NgxMatDatetimePicker<Moment>;\r\n isFocused = false;\r\n\r\n constructor(\r\n private ref: ChangeDetectorRef,\r\n deviceService: DeviceDetectorService,\r\n @Inject(FORM_CONFIG) @Optional() private formConfig: IFormConfiguration\r\n ) {\r\n this.isMobileOrTablet = !deviceService.isDesktop();\r\n }\r\n\r\n ngOnDestroy() {\r\n this.#form?.removeControl(this.#name);\r\n this.#subscription.unsubscribe();\r\n }\r\n\r\n ngOnInit() {\r\n this.appearance = this.appearance || this.formConfig?.appearance;\r\n this.#subscription.add(\r\n this.formControl.sdChanges.subscribe(() => {\r\n // this.formControl.updateValueAndValidity();\r\n this.ref.markForCheck();\r\n })\r\n );\r\n this.#form?.addControl(this.#name, this.formControl);\r\n }\r\n\r\n // Hàm tạo Validators tùy chỉnh cho inlineError\r\n customInlineErrorValidator(): ValidatorFn {\r\n return (control: AbstractControl): { [key: string]: any } | null => {\r\n return { inlineError: true };\r\n };\r\n }\r\n\r\n ngAfterViewInit() {}\r\n\r\n onFocus = () => {\r\n this.isFocused = true;\r\n this.sdFocus.emit();\r\n };\r\n\r\n onBlur = () => {\r\n this.isFocused = false;\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.input?.nativeElement?.focus();\r\n this.dateTimePicker?.open();\r\n }, 100);\r\n };\r\n\r\n focusInputElement() {\r\n this.input?.nativeElement?.focus();\r\n }\r\n\r\n isValid: boolean;\r\n onKeyDown = (event: KeyboardEvent) => {\r\n const key = event.keyCode || event.charCode;\r\n let isShift = false;\r\n if (key === 16) {\r\n isShift = true;\r\n }\r\n\r\n // cho phép copy parse\r\n if (event.ctrlKey && (key === 67 || key === 86)) {\r\n console.log('action copy parse... datepicker');\r\n return true;\r\n }\r\n\r\n // Allow only Numeric Keys.\r\n if (\r\n ((key >= 48 && key <= 57) ||\r\n key === 8 ||\r\n key <= 37 ||\r\n key <= 39 ||\r\n (key >= 96 && key <= 105) ||\r\n key === 191 ||\r\n key === 186 ||\r\n key === 59) &&\r\n isShift === false\r\n ) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n };\r\n\r\n onKeyup = event => {\r\n const currentVal: string = event.target.value;\r\n const formControl: AbstractControl = this.formControl;\r\n let regex = /^([1-9]|([012][0-9])|(3[01]))\\/([0]{0,1}[1-9]|1[012])\\/\\d\\d\\d\\d [012]{0,1}[0-9]:[0-6][0-9]:[0-6][0-9]$/g;\r\n\r\n if (currentVal && !regex.test(currentVal)) {\r\n setTimeout(() => {\r\n this.isValid = true;\r\n formControl.markAsDirty();\r\n formControl.markAsTouched();\r\n formControl.setErrors({ ...formControl.errors, date: `Sai định dạng` });\r\n }, 0);\r\n } else {\r\n setTimeout(() => {\r\n this.isValid = false;\r\n formControl.setErrors({ ...formControl.errors, date: null });\r\n this.formControl.updateValueAndValidity();\r\n }, 0);\r\n }\r\n };\r\n\r\n onChange = (event: MatDatepickerInputEvent<Moment>) => {\r\n const value = event.value?.toDate();\r\n if (!this.isValid) {\r\n if (new Date(this.#date) !== value) {\r\n this.modelChange.emit(value);\r\n this.sdChange.emit(value);\r\n }\r\n } else {\r\n this.isValid = false;\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 clear = ($event: any) => {\r\n $event?.stopPropagation();\r\n if (this.formControl.value) {\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","import { NgxMatDatetimePickerModule, NgxMatTimepickerModule } from '@angular-material-components/datetime-picker';\r\nimport { NgxMatMomentModule } from '@angular-material-components/moment-adapter';\r\nimport { CommonModule } from '@angular/common';\r\nimport { NgModule } from '@angular/core';\r\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\r\nimport { MatMomentDateModule } from '@angular/material-moment-adapter';\r\nimport { MatDatepickerModule } from '@angular/material/datepicker';\r\nimport { MatFormFieldModule } from '@angular/material/form-field';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatInputModule } from '@angular/material/input';\r\nimport { SdButtonModule } from '@sd-angular/core/button';\r\nimport { SdCommonModule } from '@sd-angular/core/common';\r\nimport { SdTranslateModule } from '@sd-angular/core/translate';\r\nimport { SdDateFull } from './date-full.component';\r\n\r\n@NgModule({\r\n imports: [\r\n CommonModule,\r\n FormsModule,\r\n ReactiveFormsModule,\r\n MatInputModule,\r\n MatIconModule,\r\n MatFormFieldModule,\r\n MatDatepickerModule,\r\n MatMomentDateModule,\r\n NgxMatDatetimePickerModule,\r\n NgxMatTimepickerModule,\r\n NgxMatMomentModule,\r\n SdTranslateModule,\r\n SdCommonModule,\r\n SdButtonModule,\r\n ],\r\n declarations: [SdDateFull],\r\n exports: [SdCommonModule, SdDateFull],\r\n providers: [],\r\n})\r\nexport class SdDateFullModule {}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["uuid.v4"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA2BA,MAAM,uBAAuB,GAAG;IAC9B,KAAK,EAAE;QACL,SAAS,EAAE,qBAAqB;KACjC;IACD,OAAO,EAAE;QACP,SAAS,EAAE,qBAAqB;QAChC,cAAc,EAAE,UAAU;QAC1B,aAAa,EAAE,IAAI;QACnB,kBAAkB,EAAE,WAAW;KAChC;CACF,CAAC;WAOuD,uBAAuB;MAEnE,UAAU;IAuJrB,YACU,GAAsB,EAC9B,aAAoC,EACK,UAA8B;QAF/D,QAAG,GAAH,GAAG,CAAmB;QAEW,eAAU,GAAV,UAAU,CAAoB;QAzJzE,OAAE,GAAG,IAAIA,EAAO,EAAE,EAAE,CAAC;QACrB,qBAAgB,GAAG,KAAK,CAAC;QACzB,wBAAW;QACX,gBAAQA,EAAO,EAAE,EAAC;QAQlB,wBAAmB,GAAG,KAAK,CAAC;QAO5B,gBAAW,GAAG,IAAI,aAAa,EAAE,CAAC;QAsBlC,wBAAiB;QAoBjB,aAAQ,GAAG,KAAK,CAAC;QAoEP,aAAQ,GAAG,IAAI,YAAY,EAAE,CAAC;QAC9B,YAAO,GAAG,IAAI,YAAY,EAAO,CAAC;QAalC,gBAAW,GAAG,IAAI,YAAY,EAAE,CAAC;QAC3C,wBAAgB,IAAI,YAAY,EAAE,EAAC;QAKnC,cAAS,GAAG,KAAK,CAAC;QAmClB,YAAO,GAAG;YACR,IAAI,CAA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K,SAAC,OAAO;0BAQb,KAAK;2BAGL,KAAK,SAAC,aAAa;6BAInB,KAAK,SAAC,eAAe;6BAIrB,KAAK,SAAC,eAAe;sBAIrB,KAAK;sBAQL,KAAK;wBAQL,KAAK;uBACL,MAAM;sBACN,MAAM;oBAEN,KAAK;0BAWL,MAAM;qBAEN,YAAY,SAAC,kBAAkB;yBAC/B,YAAY,SAAC,mBAAmB;oBAChC,SAAS,SAAC,OAAO;6BACjB,SAAS,SAAC,oBAAoB;;;MC9JpB,gBAAgB;;;YArB5B,QAAQ,SAAC;gBACR,OAAO,EAAE;oBACP,YAAY;oBACZ,WAAW;oBACX,mBAAmB;oBACnB,cAAc;oBACd,aAAa;oBACb,kBAAkB;oBAClB,mBAAmB;oBACnB,mBAAmB;oBACnB,0BAA0B;oBAC1B,sBAAsB;oBACtB,kBAAkB;oBAClB,iBAAiB;oBACjB,cAAc;oBACd,cAAc;iBACf;gBACD,YAAY,EAAE,CAAC,UAAU,CAAC;gBAC1B,OAAO,EAAE,CAAC,cAAc,EAAE,UAAU,CAAC;gBACrC,SAAS,EAAE,EAAE;aACd;;;ACnCD;;;;;;"}
|
|
@@ -118,7 +118,7 @@ SdModalHeader.decorators = [
|
|
|
118
118
|
selector: 'sd-modal-header',
|
|
119
119
|
template: "<h3 class=\"mb-0\" mat-dialog-title *ngIf=\"!isMobileOrTablet\">\r\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\r\n</h3>\r\n<sd-bottom-sheet-header *ngIf=\"isMobileOrTablet\">\r\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\r\n</sd-bottom-sheet-header>\r\n<ng-template #content>\r\n <ng-content></ng-content>\r\n</ng-template>",
|
|
120
120
|
encapsulation: ViewEncapsulation.None,
|
|
121
|
-
styles: [".mat-dialog-title{align-items:center;display:flex;justify-content:space-between}button:focus{outline:none!important}"]
|
|
121
|
+
styles: [".mat-dialog-title{align-items:center;display:flex!important;justify-content:space-between}button:focus{outline:none!important}"]
|
|
122
122
|
},] }
|
|
123
123
|
];
|
|
124
124
|
SdModalHeader.ctorParameters = () => [
|
|
@@ -32,10 +32,10 @@ const CUSTOM_DATETIME_FORMATS = {
|
|
|
32
32
|
};
|
|
33
33
|
const CUSTOM_DATE_FORMATS = {
|
|
34
34
|
parse: {
|
|
35
|
-
dateInput: '
|
|
35
|
+
dateInput: 'MM/YYYY',
|
|
36
36
|
},
|
|
37
37
|
display: {
|
|
38
|
-
dateInput: '
|
|
38
|
+
dateInput: 'MM/YYYY',
|
|
39
39
|
monthYearLabel: 'MMM YYYY',
|
|
40
40
|
dateA11yLabel: 'LL',
|
|
41
41
|
monthYearA11yLabel: 'MMMM YYYY',
|
|
@@ -263,7 +263,7 @@ class SdMonth {
|
|
|
263
263
|
}
|
|
264
264
|
if (__classPrivateFieldGet(this, _date) !== val) {
|
|
265
265
|
__classPrivateFieldSet(this, _date, val);
|
|
266
|
-
const date = Date.isDate(__classPrivateFieldGet(this, _date)) ? moment(Date.toFormat(__classPrivateFieldGet(this, _date), 'MM/dd/yyyy
|
|
266
|
+
const date = Date.isDate(__classPrivateFieldGet(this, _date)) ? moment(Date.toFormat(__classPrivateFieldGet(this, _date), 'MM/dd/yyyy'), 'MM/DD/YYYY') : null;
|
|
267
267
|
this.formControl.setValue(date);
|
|
268
268
|
}
|
|
269
269
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-angular-core-month.js","sources":["../../../../projects/sd-core/month/src/lib/month.component.ts","../../../../projects/sd-core/month/src/lib/month.module.ts","../../../../projects/sd-core/month/sd-angular-core-month.ts"],"sourcesContent":["import { NGX_MAT_DATE_FORMATS } from '@angular-material-components/datetime-picker';\r\nimport {\r\n AfterViewInit,\r\n ChangeDetectionStrategy,\r\n ChangeDetectorRef,\r\n Component,\r\n ContentChild,\r\n ElementRef,\r\n EventEmitter,\r\n Inject,\r\n Input,\r\n OnDestroy,\r\n OnInit,\r\n Optional,\r\n Output,\r\n ViewChild,\r\n} from '@angular/core';\r\nimport { AbstractControl, FormGroup, NgForm, ValidatorFn, Validators } from '@angular/forms';\r\nimport { MAT_DATE_FORMATS } from '@angular/material/core';\r\nimport { MatDatepicker, MatDatepickerInputEvent } from '@angular/material/datepicker';\r\nimport { MatFormFieldAppearance } from '@angular/material/form-field';\r\nimport { FORM_CONFIG, IFormConfiguration, SdFormControl, SdLabelDefDirective, SdViewDefDirective } from '@sd-angular/core/common';\r\nimport moment, { Moment } from 'moment';\r\nimport { DeviceDetectorService } from 'ngx-device-detector';\r\nimport hash from 'object-hash';\r\nimport { Subscription } from 'rxjs';\r\nimport * as uuid from 'uuid';\r\n\r\nconst CUSTOM_DATETIME_FORMATS = {\r\n parse: {\r\n dateInput: 'DD/MM/YYYY HH:mm',\r\n },\r\n display: {\r\n dateInput: 'DD/MM/YYYY HH:mm',\r\n monthYearLabel: 'MMM YYYY',\r\n dateA11yLabel: 'LL',\r\n monthYearA11yLabel: 'MMMM YYYY',\r\n },\r\n};\r\nconst CUSTOM_DATE_FORMATS = {\r\n parse: {\r\n dateInput: 'DD/MM/YYYY',\r\n },\r\n display: {\r\n dateInput: 'DD/MM/YYYY',\r\n monthYearLabel: 'MMM YYYY',\r\n dateA11yLabel: 'LL',\r\n monthYearA11yLabel: 'MMMM YYYY',\r\n },\r\n};\r\n\r\n@Component({\r\n selector: 'sd-month',\r\n templateUrl: './month.component.html',\r\n styleUrls: ['./month.component.scss'],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n providers: [\r\n { provide: MAT_DATE_FORMATS, useValue: CUSTOM_DATE_FORMATS },\r\n { provide: NGX_MAT_DATE_FORMATS, useValue: CUSTOM_DATETIME_FORMATS },\r\n ],\r\n})\r\nexport class SdMonth implements OnDestroy, OnInit, AfterViewInit {\r\n id = `I${uuid.v4()}`;\r\n isMobileOrTablet = false;\r\n #date: any;\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\r\n @Input() appearance: MatFormFieldAppearance;\r\n disableErrorMessage = false;\r\n\r\n @Input('disableErrorMessage') set _disableErrorMessage(val: boolean | '') {\r\n this.disableErrorMessage = val === '' || val;\r\n val = val === '' || val;\r\n }\r\n\r\n formControl = new SdFormControl();\r\n min: Date;\r\n\r\n @Input('min') set _min(val: string | Date | number) {\r\n if (Date.isDate(val)) {\r\n this.min = new Date(val);\r\n } else {\r\n this.min = null;\r\n }\r\n }\r\n\r\n max: Date;\r\n\r\n @Input('max') set _max(val: string | Date | number) {\r\n if (Date.isDate(val)) {\r\n this.max = new Date(val);\r\n } else {\r\n this.max = null;\r\n }\r\n }\r\n\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\r\n maxlength: number;\r\n\r\n @Input() set disabled(val: boolean | '') {\r\n val = val === '' || val;\r\n if (val) {\r\n this.formControl.disable();\r\n } else {\r\n this.formControl.enable();\r\n }\r\n }\r\n\r\n required = false;\r\n\r\n @Input('required') set _required(val: boolean | '') {\r\n this.required = val === '' || val;\r\n if (this.required) {\r\n this.formControl.setValidators([Validators.required]);\r\n } else {\r\n this.formControl.clearValidators();\r\n }\r\n }\r\n\r\n inlineError: string;\r\n\r\n @Input('inlineError') set _inlineError(val: string) {\r\n this.inlineError = val;\r\n if (this.inlineError) {\r\n this.formControl.setValidators([this.customInlineErrorValidator()]);\r\n this.formControl.updateValueAndValidity();\r\n } else {\r\n this.formControl.clearValidators();\r\n this.formControl.updateValueAndValidity();\r\n }\r\n }\r\n\r\n qcId: string;\r\n label: string;\r\n\r\n @Input('label') set _label(val: string) {\r\n this.label = val;\r\n this.qcId = hash({\r\n selector: 'sd-month',\r\n label: val,\r\n });\r\n }\r\n\r\n @Input() placeholder: string;\r\n\r\n @Input() set minDate(val: string | Date) {\r\n if (Date.isDate(val)) {\r\n this.min = new Date(val);\r\n } else {\r\n this.min = null;\r\n }\r\n }\r\n\r\n @Input() set maxDate(val: string | Date) {\r\n if (Date.isDate(val)) {\r\n this.max = new Date(val);\r\n } else {\r\n this.max = null;\r\n }\r\n }\r\n\r\n @Input() validator: (value: any) => string | Promise<string>;\r\n @Output() sdChange = new EventEmitter();\r\n @Output() sdFocus = new EventEmitter<any>();\r\n\r\n @Input() set model(val: any) {\r\n if (!Date.isDate(val)) {\r\n val = null;\r\n }\r\n if (this.#date !== val) {\r\n this.#date = val;\r\n const date = Date.isDate(this.#date) ? moment(Date.toFormat(this.#date, 'MM/dd/yyyy HH:mm:ss'), 'MM/DD/YYYY HH:mm:ss') : null;\r\n this.formControl.setValue(date);\r\n }\r\n }\r\n\r\n @Output() modelChange = new EventEmitter();\r\n #subscription = new Subscription();\r\n @ContentChild(SdViewDefDirective) sdView: SdViewDefDirective;\r\n @ContentChild(SdLabelDefDirective) sdLabelDef: SdLabelDefDirective;\r\n @ViewChild('input') input: ElementRef;\r\n @ViewChild(MatDatepicker) datePicker: MatDatepicker<Moment>;\r\n isFocused = false;\r\n\r\n constructor(\r\n private ref: ChangeDetectorRef,\r\n deviceService: DeviceDetectorService,\r\n @Inject(FORM_CONFIG) @Optional() private formConfig: IFormConfiguration\r\n ) {\r\n this.isMobileOrTablet = !deviceService.isDesktop();\r\n }\r\n\r\n ngOnDestroy() {\r\n this.#form?.removeControl(this.#name);\r\n this.#subscription.unsubscribe();\r\n }\r\n\r\n ngOnInit() {\r\n this.appearance = this.appearance || this.formConfig?.appearance;\r\n this.#subscription.add(\r\n this.formControl.sdChanges.subscribe(() => {\r\n // this.formControl.updateValueAndValidity();\r\n this.ref.markForCheck();\r\n })\r\n );\r\n this.#form?.addControl(this.#name, this.formControl);\r\n }\r\n\r\n // Hàm tạo Validators tùy chỉnh cho inlineError\r\n customInlineErrorValidator(): ValidatorFn {\r\n return (control: AbstractControl): { [key: string]: any } | null => {\r\n return { inlineError: true };\r\n };\r\n }\r\n\r\n ngAfterViewInit() {}\r\n\r\n onFocus = () => {\r\n this.isFocused = true;\r\n this.sdFocus.emit();\r\n };\r\n\r\n onBlur = () => {\r\n this.isFocused = false;\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.input?.nativeElement?.focus();\r\n this.datePicker?.open();\r\n //\r\n }, 100);\r\n };\r\n\r\n focusInputElement() {\r\n this.input?.nativeElement?.focus();\r\n }\r\n\r\n isValid: boolean;\r\n onKeyDown = (event: KeyboardEvent) => {\r\n const key = event.keyCode || event.charCode;\r\n let isShift = false;\r\n if (key === 16) {\r\n isShift = true;\r\n }\r\n\r\n // cho phép copy parse\r\n if (event.ctrlKey && (key === 67 || key === 86)) {\r\n console.log('action copy parse... datepicker');\r\n return true;\r\n }\r\n\r\n // Allow only Numeric Keys.\r\n if (\r\n ((key >= 48 && key <= 57) ||\r\n key === 8 ||\r\n key <= 37 ||\r\n key <= 39 ||\r\n (key >= 96 && key <= 105) ||\r\n key === 191 ||\r\n key === 186 ||\r\n key === 59) &&\r\n isShift === false\r\n ) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n };\r\n\r\n onKeyup = event => {\r\n const currentVal: string = event.target.value;\r\n const formControl: AbstractControl = this.formControl;\r\n let regex = /^([0]{0,1}[1-9]|1[012])\\/\\d\\d\\d\\d [012]{0,1}[0-9]:[0-6][0-9]$/g;\r\n\r\n if (currentVal && !regex.test(currentVal)) {\r\n setTimeout(() => {\r\n this.isValid = true;\r\n formControl.markAsDirty();\r\n formControl.markAsTouched();\r\n formControl.setErrors({ ...formControl.errors, date: `Sai định dạng` });\r\n }, 0);\r\n } else {\r\n setTimeout(() => {\r\n this.isValid = false;\r\n formControl.setErrors({ ...formControl.errors, date: null });\r\n this.formControl.updateValueAndValidity();\r\n }, 0);\r\n }\r\n };\r\n\r\n onChange = (event: MatDatepickerInputEvent<Moment>) => {\r\n const value = event.value?.toDate();\r\n this.input?.nativeElement?.focus();\r\n if (!this.isValid) {\r\n if (new Date(this.#date) !== value) {\r\n this.modelChange.emit(value);\r\n this.sdChange.emit(value);\r\n }\r\n } else {\r\n this.isValid = false;\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 clear = ($event: any) => {\r\n $event?.stopPropagation();\r\n if (this.formControl.value) {\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 onMonthSelected = (normalizedMonthAndYear: Moment) => {\r\n const ctrlValue = this.formControl.value || moment();\r\n ctrlValue.month(normalizedMonthAndYear.month());\r\n ctrlValue.year(normalizedMonthAndYear.year());\r\n this.formControl.setValue(ctrlValue);\r\n this.datePicker.close();\r\n this.modelChange.emit(ctrlValue);\r\n this.sdChange.emit(ctrlValue);\r\n };\r\n}\r\n","import { CommonModule } from '@angular/common';\r\nimport { NgModule } from '@angular/core';\r\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\r\nimport { MatDatepickerModule } from '@angular/material/datepicker';\r\nimport { MatFormFieldModule } from '@angular/material/form-field';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatInputModule } from '@angular/material/input';\r\nimport { SdButtonModule } from \"@sd-angular/core/button\";\r\nimport { SdCommonModule } from '@sd-angular/core/common';\r\nimport { SdPopoverModule } from '@sd-angular/core/popover';\r\nimport { SdTranslateModule } from '@sd-angular/core/translate';\r\nimport { SdMonth } from './month.component';\r\n\r\n@NgModule({\r\n imports: [\r\n CommonModule,\r\n FormsModule,\r\n ReactiveFormsModule,\r\n MatInputModule,\r\n MatIconModule,\r\n MatFormFieldModule,\r\n MatDatepickerModule,\r\n SdTranslateModule,\r\n SdCommonModule,\r\n SdPopoverModule,\r\n SdButtonModule\r\n ],\r\n declarations: [\r\n SdMonth\r\n ],\r\n exports: [\r\n SdCommonModule,\r\n SdMonth\r\n ],\r\n providers: [\r\n ]\r\n})\r\nexport class SdMonthModule {\r\n\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["uuid.v4"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA4BA,MAAM,uBAAuB,GAAG;IAC9B,KAAK,EAAE;QACL,SAAS,EAAE,kBAAkB;KAC9B;IACD,OAAO,EAAE;QACP,SAAS,EAAE,kBAAkB;QAC7B,cAAc,EAAE,UAAU;QAC1B,aAAa,EAAE,IAAI;QACnB,kBAAkB,EAAE,WAAW;KAChC;CACF,CAAC;AACF,MAAM,mBAAmB,GAAG;IAC1B,KAAK,EAAE;QACL,SAAS,EAAE,YAAY;KACxB;IACD,OAAO,EAAE;QACP,SAAS,EAAE,YAAY;QACvB,cAAc,EAAE,UAAU;QAC1B,aAAa,EAAE,IAAI;QACnB,kBAAkB,EAAE,WAAW;KAChC;CACF,CAAC;WAQyC,mBAAmB,OACf,uBAAuB;MAGzD,OAAO;IA2IlB,YACU,GAAsB,EAC9B,aAAoC,EACK,UAA8B;QAF/D,QAAG,GAAH,GAAG,CAAmB;QAEW,eAAU,GAAV,UAAU,CAAoB;QA7IzE,OAAE,GAAG,IAAIA,EAAO,EAAE,EAAE,CAAC;QACrB,qBAAgB,GAAG,KAAK,CAAC;QACzB,wBAAW;QACX,gBAAQA,EAAO,EAAE,EAAC;QAQlB,wBAAmB,GAAG,KAAK,CAAC;QAO5B,gBAAW,GAAG,IAAI,aAAa,EAAE,CAAC;QAsBlC,wBAAiB;QAsBjB,aAAQ,GAAG,KAAK,CAAC;QAsDP,aAAQ,GAAG,IAAI,YAAY,EAAE,CAAC;QAC9B,YAAO,GAAG,IAAI,YAAY,EAAO,CAAC;QAalC,gBAAW,GAAG,IAAI,YAAY,EAAE,CAAC;QAC3C,wBAAgB,IAAI,YAAY,EAA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C,MAAM;gBAC/C,SAAS,EAAE;oBACT,EAAE,OAAO,EAAE,gBAAgB,EAAE,QAAQ,IAAqB,EAAE;oBAC5D,EAAE,OAAO,EAAE,oBAAoB,EAAE,QAAQ,IAAyB,EAAE;iBACrE;;aACF;;;YAxDC,iBAAiB;YAmBV,qBAAqB;4CAoLzB,MAAM,SAAC,WAAW,cAAG,QAAQ;;;mBAzI/B,KAAK;yBAML,KAAK;mCAGL,KAAK,SAAC,qBAAqB;mBAQ3B,KAAK,SAAC,KAAK;mBAUX,KAAK,SAAC,KAAK;mBAQX,KAAK;mBAEL,KAAK;uBAYL,KAAK;wBAWL,KAAK,SAAC,UAAU;2BAWhB,KAAK,SAAC,aAAa;qBAcnB,KAAK,SAAC,OAAO;0BAQb,KAAK;sBAEL,KAAK;sBAQL,KAAK;wBAQL,KAAK;uBACL,MAAM;sBACN,MAAM;oBAEN,KAAK;0BAWL,MAAM;qBAEN,YAAY,SAAC,kBAAkB;yBAC/B,YAAY,SAAC,mBAAmB;oBAChC,SAAS,SAAC,OAAO;yBACjB,SAAS,SAAC,aAAa;;;MChKb,aAAa;;;YAxBzB,QAAQ,SAAC;gBACR,OAAO,EAAE;oBACP,YAAY;oBACZ,WAAW;oBACX,mBAAmB;oBACnB,cAAc;oBACd,aAAa;oBACb,kBAAkB;oBAClB,mBAAmB;oBACnB,iBAAiB;oBACjB,cAAc;oBACd,eAAe;oBACf,cAAc;iBACf;gBACD,YAAY,EAAE;oBACZ,OAAO;iBACR;gBACD,OAAO,EAAE;oBACP,cAAc;oBACd,OAAO;iBACR;gBACD,SAAS,EAAE,EACV;aACF;;;ACpCD;;;;;;"}
|
|
1
|
+
{"version":3,"file":"sd-angular-core-month.js","sources":["../../../../projects/sd-core/month/src/lib/month.component.ts","../../../../projects/sd-core/month/src/lib/month.module.ts","../../../../projects/sd-core/month/sd-angular-core-month.ts"],"sourcesContent":["import { NGX_MAT_DATE_FORMATS } from '@angular-material-components/datetime-picker';\r\nimport {\r\n AfterViewInit,\r\n ChangeDetectionStrategy,\r\n ChangeDetectorRef,\r\n Component,\r\n ContentChild,\r\n ElementRef,\r\n EventEmitter,\r\n Inject,\r\n Input,\r\n OnDestroy,\r\n OnInit,\r\n Optional,\r\n Output,\r\n ViewChild,\r\n} from '@angular/core';\r\nimport { AbstractControl, FormGroup, NgForm, ValidatorFn, Validators } from '@angular/forms';\r\nimport { MAT_DATE_FORMATS } from '@angular/material/core';\r\nimport { MatDatepicker, MatDatepickerInputEvent } from '@angular/material/datepicker';\r\nimport { MatFormFieldAppearance } from '@angular/material/form-field';\r\nimport { FORM_CONFIG, IFormConfiguration, SdFormControl, SdLabelDefDirective, SdViewDefDirective } from '@sd-angular/core/common';\r\nimport moment, { Moment } from 'moment';\r\nimport { DeviceDetectorService } from 'ngx-device-detector';\r\nimport hash from 'object-hash';\r\nimport { Subscription } from 'rxjs';\r\nimport * as uuid from 'uuid';\r\n\r\nconst CUSTOM_DATETIME_FORMATS = {\r\n parse: {\r\n dateInput: 'DD/MM/YYYY HH:mm',\r\n },\r\n display: {\r\n dateInput: 'DD/MM/YYYY HH:mm',\r\n monthYearLabel: 'MMM YYYY',\r\n dateA11yLabel: 'LL',\r\n monthYearA11yLabel: 'MMMM YYYY',\r\n },\r\n};\r\nconst CUSTOM_DATE_FORMATS = {\r\n parse: {\r\n dateInput: 'MM/YYYY',\r\n },\r\n display: {\r\n dateInput: 'MM/YYYY',\r\n monthYearLabel: 'MMM YYYY',\r\n dateA11yLabel: 'LL',\r\n monthYearA11yLabel: 'MMMM YYYY',\r\n },\r\n};\r\n\r\n@Component({\r\n selector: 'sd-month',\r\n templateUrl: './month.component.html',\r\n styleUrls: ['./month.component.scss'],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n providers: [\r\n { provide: MAT_DATE_FORMATS, useValue: CUSTOM_DATE_FORMATS },\r\n { provide: NGX_MAT_DATE_FORMATS, useValue: CUSTOM_DATETIME_FORMATS },\r\n ],\r\n})\r\nexport class SdMonth implements OnDestroy, OnInit, AfterViewInit {\r\n id = `I${uuid.v4()}`;\r\n isMobileOrTablet = false;\r\n #date: any;\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\r\n @Input() appearance: MatFormFieldAppearance;\r\n disableErrorMessage = false;\r\n\r\n @Input('disableErrorMessage') set _disableErrorMessage(val: boolean | '') {\r\n this.disableErrorMessage = val === '' || val;\r\n val = val === '' || val;\r\n }\r\n\r\n formControl = new SdFormControl();\r\n min: Date;\r\n\r\n @Input('min') set _min(val: string | Date | number) {\r\n if (Date.isDate(val)) {\r\n this.min = new Date(val);\r\n } else {\r\n this.min = null;\r\n }\r\n }\r\n\r\n max: Date;\r\n\r\n @Input('max') set _max(val: string | Date | number) {\r\n if (Date.isDate(val)) {\r\n this.max = new Date(val);\r\n } else {\r\n this.max = null;\r\n }\r\n }\r\n\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\r\n maxlength: number;\r\n\r\n @Input() set disabled(val: boolean | '') {\r\n val = val === '' || val;\r\n if (val) {\r\n this.formControl.disable();\r\n } else {\r\n this.formControl.enable();\r\n }\r\n }\r\n\r\n required = false;\r\n\r\n @Input('required') set _required(val: boolean | '') {\r\n this.required = val === '' || val;\r\n if (this.required) {\r\n this.formControl.setValidators([Validators.required]);\r\n } else {\r\n this.formControl.clearValidators();\r\n }\r\n }\r\n\r\n inlineError: string;\r\n\r\n @Input('inlineError') set _inlineError(val: string) {\r\n this.inlineError = val;\r\n if (this.inlineError) {\r\n this.formControl.setValidators([this.customInlineErrorValidator()]);\r\n this.formControl.updateValueAndValidity();\r\n } else {\r\n this.formControl.clearValidators();\r\n this.formControl.updateValueAndValidity();\r\n }\r\n }\r\n\r\n qcId: string;\r\n label: string;\r\n\r\n @Input('label') set _label(val: string) {\r\n this.label = val;\r\n this.qcId = hash({\r\n selector: 'sd-month',\r\n label: val,\r\n });\r\n }\r\n\r\n @Input() placeholder: string;\r\n\r\n @Input() set minDate(val: string | Date) {\r\n if (Date.isDate(val)) {\r\n this.min = new Date(val);\r\n } else {\r\n this.min = null;\r\n }\r\n }\r\n\r\n @Input() set maxDate(val: string | Date) {\r\n if (Date.isDate(val)) {\r\n this.max = new Date(val);\r\n } else {\r\n this.max = null;\r\n }\r\n }\r\n\r\n @Input() validator: (value: any) => string | Promise<string>;\r\n @Output() sdChange = new EventEmitter();\r\n @Output() sdFocus = new EventEmitter<any>();\r\n\r\n @Input() set model(val: any) {\r\n if (!Date.isDate(val)) {\r\n val = null;\r\n }\r\n if (this.#date !== val) {\r\n this.#date = val;\r\n const date = Date.isDate(this.#date) ? moment(Date.toFormat(this.#date, 'MM/dd/yyyy'), 'MM/DD/YYYY') : null;\r\n this.formControl.setValue(date);\r\n }\r\n }\r\n\r\n @Output() modelChange = new EventEmitter();\r\n #subscription = new Subscription();\r\n @ContentChild(SdViewDefDirective) sdView: SdViewDefDirective;\r\n @ContentChild(SdLabelDefDirective) sdLabelDef: SdLabelDefDirective;\r\n @ViewChild('input') input: ElementRef;\r\n @ViewChild(MatDatepicker) datePicker: MatDatepicker<Moment>;\r\n isFocused = false;\r\n\r\n constructor(\r\n private ref: ChangeDetectorRef,\r\n deviceService: DeviceDetectorService,\r\n @Inject(FORM_CONFIG) @Optional() private formConfig: IFormConfiguration\r\n ) {\r\n this.isMobileOrTablet = !deviceService.isDesktop();\r\n }\r\n\r\n ngOnDestroy() {\r\n this.#form?.removeControl(this.#name);\r\n this.#subscription.unsubscribe();\r\n }\r\n\r\n ngOnInit() {\r\n this.appearance = this.appearance || this.formConfig?.appearance;\r\n this.#subscription.add(\r\n this.formControl.sdChanges.subscribe(() => {\r\n // this.formControl.updateValueAndValidity();\r\n this.ref.markForCheck();\r\n })\r\n );\r\n this.#form?.addControl(this.#name, this.formControl);\r\n }\r\n\r\n // Hàm tạo Validators tùy chỉnh cho inlineError\r\n customInlineErrorValidator(): ValidatorFn {\r\n return (control: AbstractControl): { [key: string]: any } | null => {\r\n return { inlineError: true };\r\n };\r\n }\r\n\r\n ngAfterViewInit() {}\r\n\r\n onFocus = () => {\r\n this.isFocused = true;\r\n this.sdFocus.emit();\r\n };\r\n\r\n onBlur = () => {\r\n this.isFocused = false;\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.input?.nativeElement?.focus();\r\n this.datePicker?.open();\r\n //\r\n }, 100);\r\n };\r\n\r\n focusInputElement() {\r\n this.input?.nativeElement?.focus();\r\n }\r\n\r\n isValid: boolean;\r\n onKeyDown = (event: KeyboardEvent) => {\r\n const key = event.keyCode || event.charCode;\r\n let isShift = false;\r\n if (key === 16) {\r\n isShift = true;\r\n }\r\n\r\n // cho phép copy parse\r\n if (event.ctrlKey && (key === 67 || key === 86)) {\r\n console.log('action copy parse... datepicker');\r\n return true;\r\n }\r\n\r\n // Allow only Numeric Keys.\r\n if (\r\n ((key >= 48 && key <= 57) ||\r\n key === 8 ||\r\n key <= 37 ||\r\n key <= 39 ||\r\n (key >= 96 && key <= 105) ||\r\n key === 191 ||\r\n key === 186 ||\r\n key === 59) &&\r\n isShift === false\r\n ) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n };\r\n\r\n onKeyup = event => {\r\n const currentVal: string = event.target.value;\r\n const formControl: AbstractControl = this.formControl;\r\n let regex = /^([0]{0,1}[1-9]|1[012])\\/\\d\\d\\d\\d [012]{0,1}[0-9]:[0-6][0-9]$/g;\r\n\r\n if (currentVal && !regex.test(currentVal)) {\r\n setTimeout(() => {\r\n this.isValid = true;\r\n formControl.markAsDirty();\r\n formControl.markAsTouched();\r\n formControl.setErrors({ ...formControl.errors, date: `Sai định dạng` });\r\n }, 0);\r\n } else {\r\n setTimeout(() => {\r\n this.isValid = false;\r\n formControl.setErrors({ ...formControl.errors, date: null });\r\n this.formControl.updateValueAndValidity();\r\n }, 0);\r\n }\r\n };\r\n\r\n onChange = (event: MatDatepickerInputEvent<Moment>) => {\r\n const value = event.value?.toDate();\r\n this.input?.nativeElement?.focus();\r\n if (!this.isValid) {\r\n if (new Date(this.#date) !== value) {\r\n this.modelChange.emit(value);\r\n this.sdChange.emit(value);\r\n }\r\n } else {\r\n this.isValid = false;\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 clear = ($event: any) => {\r\n $event?.stopPropagation();\r\n if (this.formControl.value) {\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 onMonthSelected = (normalizedMonthAndYear: Moment) => {\r\n const ctrlValue = this.formControl.value || moment();\r\n ctrlValue.month(normalizedMonthAndYear.month());\r\n ctrlValue.year(normalizedMonthAndYear.year());\r\n this.formControl.setValue(ctrlValue);\r\n this.datePicker.close();\r\n this.modelChange.emit(ctrlValue);\r\n this.sdChange.emit(ctrlValue);\r\n };\r\n}\r\n","import { CommonModule } from '@angular/common';\r\nimport { NgModule } from '@angular/core';\r\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\r\nimport { MatDatepickerModule } from '@angular/material/datepicker';\r\nimport { MatFormFieldModule } from '@angular/material/form-field';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatInputModule } from '@angular/material/input';\r\nimport { SdButtonModule } from \"@sd-angular/core/button\";\r\nimport { SdCommonModule } from '@sd-angular/core/common';\r\nimport { SdPopoverModule } from '@sd-angular/core/popover';\r\nimport { SdTranslateModule } from '@sd-angular/core/translate';\r\nimport { SdMonth } from './month.component';\r\n\r\n@NgModule({\r\n imports: [\r\n CommonModule,\r\n FormsModule,\r\n ReactiveFormsModule,\r\n MatInputModule,\r\n MatIconModule,\r\n MatFormFieldModule,\r\n MatDatepickerModule,\r\n SdTranslateModule,\r\n SdCommonModule,\r\n SdPopoverModule,\r\n SdButtonModule\r\n ],\r\n declarations: [\r\n SdMonth\r\n ],\r\n exports: [\r\n SdCommonModule,\r\n SdMonth\r\n ],\r\n providers: [\r\n ]\r\n})\r\nexport class SdMonthModule {\r\n\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["uuid.v4"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA4BA,MAAM,uBAAuB,GAAG;IAC9B,KAAK,EAAE;QACL,SAAS,EAAE,kBAAkB;KAC9B;IACD,OAAO,EAAE;QACP,SAAS,EAAE,kBAAkB;QAC7B,cAAc,EAAE,UAAU;QAC1B,aAAa,EAAE,IAAI;QACnB,kBAAkB,EAAE,WAAW;KAChC;CACF,CAAC;AACF,MAAM,mBAAmB,GAAG;IAC1B,KAAK,EAAE;QACL,SAAS,EAAE,SAAS;KACrB;IACD,OAAO,EAAE;QACP,SAAS,EAAE,SAAS;QACpB,cAAc,EAAE,UAAU;QAC1B,aAAa,EAAE,IAAI;QACnB,kBAAkB,EAAE,WAAW;KAChC;CACF,CAAC;WAQyC,mBAAmB,OACf,uBAAuB;MAGzD,OAAO;IA2IlB,YACU,GAAsB,EAC9B,aAAoC,EACK,UAA8B;QAF/D,QAAG,GAAH,GAAG,CAAmB;QAEW,eAAU,GAAV,UAAU,CAAoB;QA7IzE,OAAE,GAAG,IAAIA,EAAO,EAAE,EAAE,CAAC;QACrB,qBAAgB,GAAG,KAAK,CAAC;QACzB,wBAAW;QACX,gBAAQA,EAAO,EAAE,EAAC;QAQlB,wBAAmB,GAAG,KAAK,CAAC;QAO5B,gBAAW,GAAG,IAAI,aAAa,EAAE,CAAC;QAsBlC,wBAAiB;QAsBjB,aAAQ,GAAG,KAAK,CAAC;QAsDP,aAAQ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
|
503
503
|
template: "<ng-container *ngIf=\"!appearance && sdLabelDef?.templateRef\">\r\n <ng-container *ngTemplateOutlet=\"sdLabelDef.templateRef\"> </ng-container>\r\n</ng-container>\r\n<label *ngIf=\"!appearance && label && !sdLabelDef?.templateRef\" class=\"d-block mb-0 T14M\"\r\n >{{ label }} <span class=\"text-danger mb-2\" *ngIf=\"isRequired\">*</span></label\r\n>\r\n<div\r\n class=\"d-flex align-items-center\"\r\n [class.sd-view]=\"sdView?.templateRef\"\r\n [class.c-focused]=\"isFocused\"\r\n [class.c-disabled]=\"formControl.disabled\"\r\n (click)=\"onClick()\">\r\n <ng-container *ngIf=\"sdView?.templateRef && !isFocused; else default\">\r\n <ng-container *ngTemplateOutlet=\"sdView.templateRef; context: { value: formControl.value, selectedItems: selectedItems | async }\">\r\n </ng-container>\r\n </ng-container>\r\n <ng-template #default>\r\n <mat-form-field\r\n class=\"sd-md\"\r\n [ngClass]=\"{ 'sd-sm': size === 'sm', 'no-padding-wrapper': disableErrorMessage }\"\r\n [appearance]=\"appearance || 'outline'\">\r\n <mat-label *ngIf=\"appearance && label\">{{ label }}</mat-label>\r\n <mat-select\r\n *ngIf=\"multiple\"\r\n #select\r\n [formControl]=\"formControl\"\r\n [placeholder]=\"placeholder || (appearance ? label : '')\"\r\n multiple\r\n (selectionChange)=\"onSelectionChange($event)\"\r\n disableOptionCentering=\"true\"\r\n panelClass=\"sd-select-panel\"\r\n [class.sd-selected]=\"!isRequired && formControl?.value?.length\"\r\n [required]=\"isRequired\"\r\n (openedChange)=\"onOpenedChange($event)\"\r\n [attr.data-qclabel]=\"label\"\r\n [attr.data-qcid]=\"qcId\"\r\n matTooltipClass=\"sd-multiline-tooltip\"\r\n [matTooltipDisabled]=\"!formControl.disabled || !formControl?.value?.length\"\r\n [matTooltip]=\"tooltip\">\r\n <mat-select-trigger>\r\n {{ display | async }}\r\n </mat-select-trigger>\r\n <mat-option *ngIf=\"filtered\" class=\"sd-filtered-input\" (keyup.Space)=\"$event.stopPropagation()\" disabled=\"true\">\r\n <mat-form-field class=\"sd-md\" appearance=\"outline\">\r\n <mat-icon matPrefix>search</mat-icon>\r\n <input\r\n aria-hidden=\"true\"\r\n #input\r\n placeholder=\"{{ 'Search' | sdTranslate }}\"\r\n matInput\r\n autocomplete=\"off\"\r\n (keydown)=\"$event.stopPropagation()\"\r\n (keyup)=\"searchTerm$.next($event.target.value)\" />\r\n </mat-form-field>\r\n </mat-option>\r\n <ng-container *ngIf=\"multiple && selectAll\">\r\n <mat-checkbox class=\"mat-option\" [(ngModel)]=\"allSelected\" [ngModelOptions]=\"{ standalone: true }\" (change)=\"onSelectAll()\">\r\n T\u1EA5t c\u1EA3</mat-checkbox\r\n >\r\n </ng-container>\r\n <ng-container *ngIf=\"valueField && displayField\">\r\n <mat-option *ngFor=\"let item of filteredItems | async; trackBy: trackByKey\" [value]=\"item[valueField]\">\r\n <div matTooltipPosition=\"above\" [matTooltip]=\"item[displayField]\">\r\n <ng-container *ngIf=\"selectDisplayDef?.templateRef\">\r\n <ng-container *ngTemplateOutlet=\"selectDisplayDef.templateRef; context: { item: item }\"> </ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"!selectDisplayDef?.templateRef\">\r\n {{ item[displayField] }}\r\n </ng-container>\r\n </div>\r\n </mat-option>\r\n </ng-container>\r\n <ng-container *ngIf=\"!valueField && !displayField\">\r\n <mat-option *ngFor=\"let item of filteredItems | async; trackBy: trackByKey\" [value]=\"item\">\r\n <div matTooltipPosition=\"above\" [matTooltip]=\"item\">\r\n <ng-container *ngIf=\"selectDisplayDef?.templateRef\">\r\n <ng-container *ngTemplateOutlet=\"selectDisplayDef.templateRef; context: { item: item }\"> </ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"!selectDisplayDef?.templateRef\">\r\n {{ item }}\r\n </ng-container>\r\n </div>\r\n </mat-option>\r\n </ng-container>\r\n </mat-select>\r\n <mat-select\r\n *ngIf=\"!multiple\"\r\n #select\r\n [formControl]=\"formControl\"\r\n [placeholder]=\"placeholder || (appearance ? label : '')\"\r\n (selectionChange)=\"onSelectionChange($event)\"\r\n disableOptionCentering=\"true\"\r\n panelClass=\"sd-select-panel\"\r\n [class.sd-selected]=\"!isRequired && formControl?.value != null\"\r\n [required]=\"isRequired\"\r\n (openedChange)=\"onOpenedChange($event)\"\r\n [attr.data-qclabel]=\"label\"\r\n [attr.data-qcid]=\"qcId\">\r\n <mat-select-trigger>\r\n {{ display | async }}\r\n </mat-select-trigger>\r\n <mat-option *ngIf=\"filtered\" class=\"sd-filtered-input\" (keyup.Space)=\"$event.stopPropagation()\" disabled=\"true\">\r\n <mat-form-field class=\"sd-md\" appearance=\"outline\">\r\n <mat-icon matPrefix>search</mat-icon>\r\n <input\r\n aria-hidden=\"true\"\r\n #input\r\n placeholder=\"{{ 'Search' | sdTranslate }}\"\r\n matInput\r\n autocomplete=\"off\"\r\n (keydown)=\"$event.stopPropagation()\"\r\n (keyup)=\"searchTerm$.next($event.target.value)\" />\r\n </mat-form-field>\r\n </mat-option>\r\n <ng-container *ngIf=\"valueField && displayField\">\r\n <mat-option *ngFor=\"let item of filteredItems | async; trackBy: trackByKey\" [value]=\"item[valueField]\">\r\n <div matTooltipPosition=\"above\" [matTooltip]=\"item[displayField]\">\r\n <ng-container *ngIf=\"selectDisplayDef?.templateRef\">\r\n <ng-container *ngTemplateOutlet=\"selectDisplayDef.templateRef; context: { item: item }\"> </ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"!selectDisplayDef?.templateRef\">\r\n {{ item[displayField] }}\r\n </ng-container>\r\n </div>\r\n </mat-option>\r\n </ng-container>\r\n <ng-container *ngIf=\"!valueField && !displayField\">\r\n <mat-option *ngFor=\"let item of filteredItems | async; trackBy: trackByKey\" [value]=\"item\">\r\n <div matTooltipPosition=\"above\" [matTooltip]=\"item\">\r\n <ng-container *ngIf=\"selectDisplayDef?.templateRef\">\r\n <ng-container *ngTemplateOutlet=\"selectDisplayDef.templateRef; context: { item: item }\"> </ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"!selectDisplayDef?.templateRef\">\r\n {{ item }}\r\n </ng-container>\r\n </div>\r\n </mat-option>\r\n </ng-container>\r\n </mat-select>\r\n <ng-content select=\"[sdSuffixIcon]\" matSuffix></ng-content>\r\n <svg\r\n #copyTooltip=\"matTooltip\"\r\n *ngIf=\"(multiple ? formControl?.value?.length : formControl?.value != null) && copyable\"\r\n matSuffix\r\n [matTooltip]=\"copied ? 'Copied' : 'Copy'\"\r\n class=\"icon-copy\"\r\n focusable=\"false\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n viewBox=\"0 0 448 512\"\r\n (click)=\"onCopyText($event)\">\r\n <path\r\n d=\"M433.941 65.941l-51.882-51.882A48 48 0 0 0 348.118 0H176c-26.51 0-48 21.49-48 48v48H48c-26.51 0-48 21.49-48 48v320c0 26.51 21.49 48 48 48h224c26.51 0 48-21.49 48-48v-48h80c26.51 0 48-21.49 48-48V99.882a48 48 0 0 0-14.059-33.941zM266 464H54a6 6 0 0 1-6-6V150a6 6 0 0 1 6-6h74v224c0 26.51 21.49 48 48 48h96v42a6 6 0 0 1-6 6zm128-96H182a6 6 0 0 1-6-6V54a6 6 0 0 1 6-6h106v88c0 13.255 10.745 24 24 24h88v202a6 6 0 0 1-6 6zm6-256h-64V48h9.632c1.591 0 3.117.632 4.243 1.757l48.368 48.368a6 6 0 0 1 1.757 4.243V112z\"></path>\r\n </svg>\r\n \r\n <mat-icon\r\n *ngIf=\"(multiple ? formControl?.value?.length : formControl?.value != null) && !isRequired && !formControl.disabled\"\r\n class=\"pointer sd-suffix-icon\"\r\n (click)=\"clear($event)\"\r\n matSuffix\r\n >cancel\r\n </mat-icon>\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-error *ngIf=\"formControl.errors?.inlineError\">\r\n <ng-container *ngIf=\"!disableErrorMessage\">{{ inlineError }}</ng-container>\r\n </mat-error>\r\n </mat-form-field>\r\n </ng-template>\r\n</div>\r\n<!-- <sd-popover #popoverValues=\"sdPopover\" width=\"auto\">\r\n <ng-container *ngIf=\"formControl?.value?.length\">\r\n <ng-container *sdLet=\"selectedItems | async as items\">\r\n <div *ngFor=\"let item of items\">\r\n <strong>{{ item[valueField] }}</strong> - {{ item[displayField] }}\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n</sd-popover> -->\r\n",
|
|
504
504
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
505
|
-
styles: [":host{display:block;padding-top:5px}:host ::ng-deep .mat-form-field.mat-form-field-appearance-outline .mat-select-arrow-wrapper{transform:none}:host ::ng-deep .sd-selected .mat-select-arrow{border:none}: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 mat-select.mat-select-disabled .mat-select-value{color:#4d4d4d!important}:host ::ng-deep .mat-form-field .mat-placeholder-required{color:#f82c13}:host ::ng-deep .mat-form-field:hover .icon-copy{opacity:1}:host ::ng-deep .mat-form-field .icon-copy{cursor:pointer;fill:rgba(0,0,0,.5);height:.9em;opacity:0;transition:opacity .2s linear;width:.9em}.sd-view:not(.c-focused):not(.c-disabled):hover{background-color:#ebecf0}::ng-deep .sd-select-panel .mat-option.sd-filtered-input{background-color:#fff;position:-webkit-sticky;position:sticky;top:0;z-index:10}::ng-deep .sd-select-panel .mat-option.sd-filtered-input .mat-form-field.mat-form-field-appearance-outline{width:100%}::ng-deep .sd-select-panel .mat-option.sd-filtered-input mat-pseudo-checkbox{display:none}::ng-deep .mat-select-panel .mat-option.sd-filtered-input{height:auto}::ng-deep .sd-select-panel .mat-option.sd-filtered-input input{color:#000}::ng-deep .sd-select-panel .mat-option.sd-filtered-input .mat-form-field-prefix .mat-icon{margin-right:0}::ng-deep .sd-select-panel .mat-option.sd-filtered-input .mat-form-field.mat-form-field-appearance-outline .mat-form-field-wrapper{padding:10px 0}::ng-deep .sd-select-panel .mat-option.sd-filtered-input .mat-form-field.mat-form-field-appearance-outline .mat-form-field-wrapper .mat-form-field-outline{background-color:rgba(0,0,0,.04)}::ng-deep .sd-multiline-tooltip{white-space:pre-line}"]
|
|
505
|
+
styles: [":host{display:block;padding-top:5px}:host ::ng-deep .mat-form-field.mat-form-field-appearance-outline .mat-select-arrow-wrapper{transform:none}:host ::ng-deep .sd-selected .mat-select-arrow{border:none}: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 mat-select.mat-select-disabled .mat-select-value{color:#4d4d4d!important}:host ::ng-deep .mat-form-field .mat-placeholder-required{color:#f82c13}:host ::ng-deep .mat-form-field:hover .icon-copy{opacity:1}:host ::ng-deep .mat-form-field .icon-copy{cursor:pointer;fill:rgba(0,0,0,.5);height:.9em;opacity:0;transition:opacity .2s linear;width:.9em}.sd-view:not(.c-focused):not(.c-disabled):hover{background-color:#ebecf0}::ng-deep .sd-select-panel .mat-option.sd-filtered-input{background-color:#fff;position:-webkit-sticky;position:sticky;top:0;z-index:10}::ng-deep .sd-select-panel .mat-option.sd-filtered-input .mat-form-field.mat-form-field-appearance-outline{width:100%}::ng-deep .sd-select-panel .mat-option.sd-filtered-input mat-pseudo-checkbox{display:none}::ng-deep .mat-select-panel .mat-option.sd-filtered-input{height:auto}::ng-deep .sd-select-panel .mat-option.sd-filtered-input input{color:#000}::ng-deep .sd-select-panel .mat-option.sd-filtered-input .mat-form-field-prefix .mat-icon{margin-right:0}::ng-deep .sd-select-panel .mat-option.sd-filtered-input .mat-form-field.mat-form-field-appearance-outline .mat-form-field-wrapper{padding:10px 0}::ng-deep .sd-select-panel .mat-option.sd-filtered-input .mat-form-field.mat-form-field-appearance-outline .mat-form-field-wrapper .mat-form-field-outline{background-color:rgba(0,0,0,.04)}::ng-deep .sd-multiline-tooltip{white-space:pre-line}::ng-deep .mat-select-panel{overflow:auto!important}"]
|
|
506
506
|
},] }
|
|
507
507
|
];
|
|
508
508
|
SdSelect.ctorParameters = () => [
|
|
@@ -141,7 +141,7 @@ _filterRegister = new WeakMap();
|
|
|
141
141
|
SdPopupFilter.decorators = [
|
|
142
142
|
{ type: Component, args: [{
|
|
143
143
|
selector: 'sd-popup-filter',
|
|
144
|
-
template: "<sd-modal width=\"500px\" [title]=\"'Filter' | sdTranslate\">\r\n <sd-modal-body class=\"c-popup-filter\">\r\n <ng-container *ngFor=\"let column of columns | sdFilterColumn\">\r\n <div class=\"d-flex align-items-baseline\">\r\n <ng-container>\r\n <div *sdDesktop class=\"c-checkable\">\r\n <mat-slide-toggle [(ngModel)]=\"inlineColumn[column.field]\" color=\"primary\"></mat-slide-toggle>\r\n </div>\r\n </ng-container>\r\n <div class=\"c-filterable\">\r\n <sd-input\r\n *ngIf=\"column.type === 'string'\"\r\n [label]=\"column.title\"\r\n type=\"text\"\r\n [(model)]=\"columnFilter[column.field]\"\r\n appearance=\"outline\">\r\n </sd-input>\r\n <sd-input\r\n *ngIf=\"column.type === 'number'\"\r\n [label]=\"column.title\"\r\n type=\" number\"\r\n [(model)]=\"columnFilter[column.field]\"\r\n appearance=\"outline\">\r\n </sd-input>\r\n <sd-select\r\n *ngIf=\"column.type === 'bool'\"\r\n [label]=\"column.title\"\r\n [items]=\"[\r\n { value: '1', display: column.trueValue || 'True' },\r\n { value: '0', display: column.falseValue || 'False' }\r\n ]\"\r\n valueField=\"value\"\r\n displayField=\"display\"\r\n [(model)]=\"columnFilter[column.field]\"\r\n appearance=\"outline\">\r\n </sd-select>\r\n <sd-autocomplete\r\n *ngIf=\"column.type === 'values' || column.type === 'lazy-values'\"\r\n [label]=\"column.title\"\r\n [items]=\"column.option.items\"\r\n [valueField]=\"column.option.valueField\"\r\n [displayField]=\"column.option.displayField\"\r\n [(model)]=\"columnFilter[column.field]\"\r\n appearance=\"outline\">\r\n </sd-autocomplete>\r\n <sd-date-time\r\n *ngIf=\"column.type === 'date' || column.type === 'datetime' || column.type === 'time'\"\r\n [label]=\"column.title\"\r\n [(model)]=\"columnFilter[column.field]\"\r\n type=\"date\"\r\n appearance=\"outline\">\r\n </sd-date-time>\r\n </div>\r\n </div>\r\n </ng-container>\r\n <ng-container *ngFor=\"let item of externalFilters | sdFilterExternal\">\r\n <div class=\"d-flex align-items-baseline\">\r\n <ng-container>\r\n <div *sdDesktop class=\"c-checkable\">\r\n <mat-slide-toggle [(ngModel)]=\"inlineExternal[item.field]\" color=\"primary\"></mat-slide-toggle>\r\n </div>\r\n </ng-container>\r\n <div class=\"c-filterable\">\r\n <sd-input\r\n [label]=\"item.title\"\r\n *ngIf=\"item.type === 'string'\"\r\n type=\"text\"\r\n [(model)]=\"externalFilter[item.field]\"\r\n appearance=\"outline\">\r\n </sd-input>\r\n <sd-input-number [label]=\"item.title\" *ngIf=\"item.type === 'number'\" [(model)]=\"externalFilter[item.field]\" appearance=\"outline\">\r\n </sd-input-number>\r\n <sd-select\r\n [label]=\"item.title\"\r\n *ngIf=\"item.type === 'bool'\"\r\n [items]=\"[\r\n { value: '1', display: item.option?.displayOnTrue || 'True' },\r\n { value: '0', display: item.option?.displayOnFalse || 'False' }\r\n ]\"\r\n valueField=\"value\"\r\n displayField=\"display\"\r\n [(model)]=\"externalFilter[item.field]\"\r\n appearance=\"outline\">\r\n </sd-select>\r\n <ng-container *ngIf=\"item.type === 'values'\">\r\n <sd-select\r\n *ngIf=\"item.option?.selection === 'MULTIPLE'\"\r\n [label]=\"item.title\"\r\n [items]=\"item.option.items\"\r\n [valueField]=\"item.option.valueField\"\r\n [displayField]=\"item.option.displayField\"\r\n [(model)]=\"externalFilter[item.field]\"\r\n appearance=\"outline\"\r\n multiple>\r\n </sd-select>\r\n <sd-autocomplete\r\n *ngIf=\"item.option?.selection === 'AUTOCOMPLETE'\"\r\n [label]=\"item.title\"\r\n [items]=\"item.option.items\"\r\n [valueField]=\"item.option.valueField\"\r\n [displayField]=\"item.option.displayField\"\r\n
|
|
144
|
+
template: "<sd-modal width=\"500px\" [title]=\"'Filter' | sdTranslate\">\r\n <sd-modal-body class=\"c-popup-filter\">\r\n <ng-container *ngFor=\"let column of columns | sdFilterColumn\">\r\n <div class=\"d-flex align-items-baseline\">\r\n <ng-container>\r\n <div *sdDesktop class=\"c-checkable\">\r\n <mat-slide-toggle [(ngModel)]=\"inlineColumn[column.field]\" color=\"primary\"></mat-slide-toggle>\r\n </div>\r\n </ng-container>\r\n <div class=\"c-filterable\">\r\n <sd-input\r\n *ngIf=\"column.type === 'string'\"\r\n [label]=\"column.title\"\r\n type=\"text\"\r\n [(model)]=\"columnFilter[column.field]\"\r\n appearance=\"outline\">\r\n </sd-input>\r\n <sd-input\r\n *ngIf=\"column.type === 'number'\"\r\n [label]=\"column.title\"\r\n type=\" number\"\r\n [(model)]=\"columnFilter[column.field]\"\r\n appearance=\"outline\">\r\n </sd-input>\r\n <sd-select\r\n *ngIf=\"column.type === 'bool'\"\r\n [label]=\"column.title\"\r\n [items]=\"[\r\n { value: '1', display: column.trueValue || 'True' },\r\n { value: '0', display: column.falseValue || 'False' }\r\n ]\"\r\n valueField=\"value\"\r\n displayField=\"display\"\r\n [(model)]=\"columnFilter[column.field]\"\r\n appearance=\"outline\">\r\n </sd-select>\r\n <sd-autocomplete\r\n *ngIf=\"column.type === 'values' || column.type === 'lazy-values'\"\r\n [label]=\"column.title\"\r\n [items]=\"column.option.items\"\r\n [valueField]=\"column.option.valueField\"\r\n [displayField]=\"column.option.displayField\"\r\n [(model)]=\"columnFilter[column.field]\"\r\n appearance=\"outline\">\r\n </sd-autocomplete>\r\n <sd-date-time\r\n *ngIf=\"column.type === 'date' || column.type === 'datetime' || column.type === 'time'\"\r\n [label]=\"column.title\"\r\n [(model)]=\"columnFilter[column.field]\"\r\n type=\"date\"\r\n appearance=\"outline\">\r\n </sd-date-time>\r\n </div>\r\n </div>\r\n </ng-container>\r\n <ng-container *ngFor=\"let item of externalFilters | sdFilterExternal\">\r\n <div class=\"d-flex align-items-baseline\">\r\n <ng-container>\r\n <div *sdDesktop class=\"c-checkable\">\r\n <mat-slide-toggle [(ngModel)]=\"inlineExternal[item.field]\" color=\"primary\"></mat-slide-toggle>\r\n </div>\r\n </ng-container>\r\n <div class=\"c-filterable\">\r\n <sd-input\r\n [label]=\"item.title\"\r\n *ngIf=\"item.type === 'string'\"\r\n type=\"text\"\r\n [(model)]=\"externalFilter[item.field]\"\r\n appearance=\"outline\">\r\n </sd-input>\r\n <sd-input-number [label]=\"item.title\" *ngIf=\"item.type === 'number'\" [(model)]=\"externalFilter[item.field]\" appearance=\"outline\">\r\n </sd-input-number>\r\n <sd-select\r\n [label]=\"item.title\"\r\n *ngIf=\"item.type === 'bool'\"\r\n [items]=\"[\r\n { value: '1', display: item.option?.displayOnTrue || 'True' },\r\n { value: '0', display: item.option?.displayOnFalse || 'False' }\r\n ]\"\r\n valueField=\"value\"\r\n displayField=\"display\"\r\n [(model)]=\"externalFilter[item.field]\"\r\n appearance=\"outline\">\r\n </sd-select>\r\n <ng-container *ngIf=\"item.type === 'values' && item.option\">\r\n <sd-select\r\n *ngIf=\"item.option?.selection === 'MULTIPLE'\"\r\n [label]=\"item.title\"\r\n [items]=\"item.option.items\"\r\n [valueField]=\"item.option.valueField\"\r\n [displayField]=\"item.option.displayField\"\r\n [(model)]=\"externalFilter[item.field]\"\r\n [selectAll]=\"item.option.selectAll\"\r\n appearance=\"outline\"\r\n multiple>\r\n </sd-select>\r\n <sd-autocomplete\r\n *ngIf=\"item.option?.selection === 'AUTOCOMPLETE'\"\r\n [label]=\"item.title\"\r\n [items]=\"item.option.items\"\r\n [valueField]=\"item.option.valueField\"\r\n [displayField]=\"item.option.displayField\"\r\n [(model)]=\"externalFilter[item.field]\"\r\n appearance=\"outline\">\r\n </sd-autocomplete>\r\n <sd-select\r\n *ngIf=\"item.option?.selection === 'MULTIPLEAUTOCOMPLETE'\"\r\n [label]=\"item.title\"\r\n [items]=\"item.option.items\"\r\n [valueField]=\"item.option.valueField\"\r\n [displayField]=\"item.option.displayField\"\r\n [(model)]=\"externalFilter[item.field]\"\r\n filtered\r\n appearance=\"outline\"\r\n multiple>\r\n </sd-select>\r\n <sd-select\r\n *ngIf=\"!item.option?.selection\"\r\n [label]=\"item.title\"\r\n [items]=\"item.option.items\"\r\n [valueField]=\"item.option.valueField\"\r\n [displayField]=\"item.option.displayField\"\r\n [(model)]=\"externalFilter[item.field]\"\r\n appearance=\"outline\">\r\n </sd-select>\r\n </ng-container>\r\n <ng-container *ngIf=\"item.type === 'lazy-values' && item.option\">\r\n <sd-select\r\n *ngIf=\"item.option?.selection === 'MULTIPLE'\"\r\n [label]=\"item.title\"\r\n [items]=\"item.option.items\"\r\n [valueField]=\"item.option.valueField\"\r\n [displayField]=\"item.option.displayField\"\r\n [(model)]=\"externalFilter[item.field]\"\r\n appearance=\"outline\"\r\n multiple\r\n filtered>\r\n </sd-select>\r\n <sd-autocomplete\r\n *ngIf=\"!item.option?.selection\"\r\n [label]=\"item.title\"\r\n [items]=\"item.option.items\"\r\n [valueField]=\"item.option.valueField\"\r\n [displayField]=\"item.option.displayField\"\r\n [(model)]=\"externalFilter[item.field]\"\r\n appearance=\"outline\">\r\n </sd-autocomplete>\r\n </ng-container>\r\n <sd-date-time\r\n [label]=\"item.title\"\r\n *ngIf=\"item.type === 'date' || item.type === 'datetime'\"\r\n [(model)]=\"externalFilter[item.field]\"\r\n [type]=\"item.type\"\r\n appearance=\"outline\">\r\n </sd-date-time>\r\n <sd-date-range\r\n [label]=\"item.title\"\r\n *ngIf=\"item.type === 'daterange' && externalFilter[item.field]\"\r\n [(from)]=\"externalFilter[item.field].from\"\r\n [(to)]=\"externalFilter[item.field].to\"\r\n [min]=\"item.minDate\"\r\n [max]=\"item.maxDate\"\r\n appearance=\"outline\">\r\n </sd-date-range>\r\n </div>\r\n </div>\r\n </ng-container>\r\n <ng-container *ngFor=\"let filter of filterDefs\">\r\n <div class=\"d-flex align-items-baseline\">\r\n <ng-container>\r\n <div *sdDesktop class=\"c-checkable\">\r\n <mat-slide-toggle [(ngModel)]=\"inlineFilterDef[filter.sdTableFilterDef]\" color=\"primary\"> </mat-slide-toggle>\r\n </div>\r\n </ng-container>\r\n <div class=\"c-filterable\">\r\n <ng-container *ngTemplateOutlet=\"filter.templateRef; context: { filterDef: filterDef }\"> </ng-container>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </sd-modal-body>\r\n <sd-modal-footer *sdDesktop>\r\n <sd-button class=\"mr-auto\" (action)=\"onClear()\" title=\"M\u1EB7c \u0111\u1ECBnh\" size=\"sm\" type=\"link\"> </sd-button>\r\n <sd-button (action)=\"onApply()\" title=\"\u0110\u1ED3ng \u00FD\" color=\"primary\" size=\"sm\" type=\"fill\"></sd-button>\r\n </sd-modal-footer>\r\n <sd-modal-footer *sdMobileTablet>\r\n <sd-button style=\"flex: 1; padding-right: 5px\" (action)=\"onClear()\" title=\"M\u1EB7c \u0111\u1ECBnh\" width=\"100%\" size=\"sm\" type=\"link\"></sd-button>\r\n <sd-button\r\n style=\"flex: 1; padding-left: 5px\"\r\n (action)=\"onApply()\"\r\n title=\"\u0110\u1ED3ng \u00FD\"\r\n color=\"primary\"\r\n width=\"100%\"\r\n size=\"sm\"\r\n type=\"fill\"></sd-button>\r\n </sd-modal-footer>\r\n</sd-modal>\r\n",
|
|
145
145
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
146
146
|
styles: [".c-checkable{width:50px}.c-filterable{flex:1}::ng-deep sd-modal-body.c-popup-filter .mat-form-field-wrapper{padding-bottom:0}"]
|
|
147
147
|
},] }
|