@sd-angular/core 1.3.214 → 1.3.216

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.
Files changed (39) hide show
  1. package/bundles/sd-angular-core-checkbox.umd.js +29 -3
  2. package/bundles/sd-angular-core-checkbox.umd.js.map +1 -1
  3. package/bundles/sd-angular-core-checkbox.umd.min.js +2 -2
  4. package/bundles/sd-angular-core-checkbox.umd.min.js.map +1 -1
  5. package/bundles/sd-angular-core-input-number.umd.js +3 -0
  6. package/bundles/sd-angular-core-input-number.umd.js.map +1 -1
  7. package/bundles/sd-angular-core-input-number.umd.min.js +1 -1
  8. package/bundles/sd-angular-core-input-number.umd.min.js.map +1 -1
  9. package/bundles/sd-angular-core-radio.umd.js +22 -2
  10. package/bundles/sd-angular-core-radio.umd.js.map +1 -1
  11. package/bundles/sd-angular-core-radio.umd.min.js +2 -2
  12. package/bundles/sd-angular-core-radio.umd.min.js.map +1 -1
  13. package/bundles/sd-angular-core-switch.umd.js +34 -7
  14. package/bundles/sd-angular-core-switch.umd.js.map +1 -1
  15. package/bundles/sd-angular-core-switch.umd.min.js +2 -2
  16. package/bundles/sd-angular-core-switch.umd.min.js.map +1 -1
  17. package/checkbox/sd-angular-core-checkbox.metadata.json +1 -1
  18. package/checkbox/src/lib/checkbox.component.d.ts +4 -1
  19. package/esm2015/checkbox/src/lib/checkbox.component.js +26 -4
  20. package/esm2015/input-number/src/lib/input-number.component.js +4 -1
  21. package/esm2015/radio/src/lib/radio.component.js +19 -3
  22. package/esm2015/switch/src/lib/switch.component.js +26 -4
  23. package/esm2015/switch/src/lib/switch.module.js +3 -1
  24. package/fesm2015/sd-angular-core-checkbox.js +25 -3
  25. package/fesm2015/sd-angular-core-checkbox.js.map +1 -1
  26. package/fesm2015/sd-angular-core-input-number.js +3 -0
  27. package/fesm2015/sd-angular-core-input-number.js.map +1 -1
  28. package/fesm2015/sd-angular-core-radio.js +18 -2
  29. package/fesm2015/sd-angular-core-radio.js.map +1 -1
  30. package/fesm2015/sd-angular-core-switch.js +27 -3
  31. package/fesm2015/sd-angular-core-switch.js.map +1 -1
  32. package/input-number/sd-angular-core-input-number.metadata.json +1 -1
  33. package/input-number/src/lib/input-number.component.d.ts +1 -0
  34. package/package.json +1 -1
  35. package/radio/sd-angular-core-radio.metadata.json +1 -1
  36. package/radio/src/lib/radio.component.d.ts +4 -1
  37. package/{sd-angular-core-1.3.214.tgz → sd-angular-core-1.3.216.tgz} +0 -0
  38. package/switch/sd-angular-core-switch.metadata.json +1 -1
  39. package/switch/src/lib/switch.component.d.ts +4 -1
@@ -1 +1 @@
1
- {"version":3,"file":"sd-angular-core-input-number.js","sources":["../../../../projects/sd-core/input-number/src/lib/input-number.component.ts","../../../../projects/sd-core/input-number/src/lib/input-number.module.ts","../../../../projects/sd-core/input-number/src/public-api.ts","../../../../projects/sd-core/input-number/sd-angular-core-input-number.ts"],"sourcesContent":["import {\r\n Component,\r\n Input,\r\n ViewChild,\r\n Output,\r\n EventEmitter,\r\n ChangeDetectorRef,\r\n OnDestroy,\r\n AfterViewInit,\r\n ElementRef,\r\n OnInit,\r\n ContentChild,\r\n ChangeDetectionStrategy,\r\n HostListener,\r\n Inject,\r\n SimpleChanges,\r\n Optional\r\n} from '@angular/core';\r\nimport { AbstractControl, NgForm, ValidatorFn, Validators, AsyncValidatorFn, FormGroup, FormControl, FormGroupDirective } from '@angular/forms';\r\nimport * as uuid from 'uuid';\r\nimport hash from 'object-hash';\r\n\r\nimport { Subscription } from 'rxjs';\r\nimport { SdFormControl, SdSuffixDirective } from '@sd-angular/core/common';\r\nimport { SdViewDefDirective } from '@sd-angular/core/common';\r\nimport { FORM_CONFIG } from '@sd-angular/core/common';\r\nimport { IFormConfiguration } from '@sd-angular/core/common';\r\nimport { MatFormFieldAppearance } from '@angular/material/form-field';\r\nimport { ErrorStateMatcher } from '@angular/material/core';\r\nimport { SdLabelDefDirective } from '@sd-angular/core/common';\r\nimport { debounceTime } from 'rxjs/operators';\r\nimport { MatTooltip } from '@angular/material/tooltip';\r\nclass SdInputNumberErrotStateMatcher 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@Component({\r\n selector: 'sd-input-number',\r\n templateUrl: './input-number.component.html',\r\n styleUrls: ['./input-number.component.scss'],\r\n changeDetection: ChangeDetectionStrategy.OnPush\r\n})\r\nexport class SdInputNumber implements OnDestroy, OnInit, AfterViewInit {\r\n id = `I${uuid.v4()}`;\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() 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-input-number',\r\n label: val\r\n });\r\n };\r\n @Input() placeholder: string;\r\n disableErrorMessage = false;\r\n @Input('disableErrorMessage') set _disableErrorMessage(val: boolean | '') {\r\n this.disableErrorMessage = (val === '') || val;\r\n }\r\n #blurOnEnter = false;\r\n @Input('blurOnEnter') set _blurOnEnter(val: boolean | '') {\r\n this.#blurOnEnter = (val === '') || val;\r\n }\r\n #model: any;\r\n @Input() set model(value: any) {\r\n if (this.#model !== value) {\r\n this.#model = value;\r\n this.formControl.setValue(this.#model, {\r\n emitEvent: false\r\n });\r\n if (value || value === 0) {\r\n const val = value.toString().replace(/\\./g, ',');\r\n this.inputControl.setValue(this.#getValueWithFormat(val), {\r\n emitEvent: false\r\n });\r\n } else {\r\n this.inputControl.setValue('', {\r\n emitEvent: false\r\n });\r\n }\r\n }\r\n }\r\n @Output() modelChange = new EventEmitter();\r\n\r\n // Validator\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 @Input() type: 'negative' | 'positive'; //negative: chỉ nhập số âm, positive: chỉ số dương\r\n @Input() precision: number = 3; //số chữ số thập phân \r\n\r\n isReadonly = false;\r\n @Input() set readonly(val: boolean | '') {\r\n this.isReadonly = (val === '') || val;\r\n }\r\n\r\n minNumber: number;\r\n @Input() set min(val: number) {\r\n this.minNumber = val;\r\n this.#updateValidator();\r\n }\r\n\r\n maxNumber: number;\r\n @Input() set max(val: number) {\r\n this.maxNumber = val;\r\n this.#updateValidator();\r\n }\r\n\r\n #validator: (value: any) => string | Promise<string>;\r\n @Input() set validator(validator: (value: any) => string | Promise<string>) {\r\n this.#validator = validator;\r\n this.#updateValidator();\r\n }\r\n\r\n inlineError: string;\r\n @Input('inlineError') set _inlineError(val: string) {\r\n this.inlineError = val;\r\n this.#updateValidator();\r\n }\r\n\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 @Input() appearance: MatFormFieldAppearance;\r\n\r\n @ViewChild('copyTooltip') copyTooltip: MatTooltip;\r\n copyable = false;\r\n @Input('copyable') set _copyable(val: boolean | '') {\r\n this.copyable = (val === '') || val;\r\n }\r\n copied = false;\r\n\r\n @Output() sdChange = new EventEmitter<any>();\r\n @Output() sdFocus = new EventEmitter<any>();\r\n @Output() sdFocusForceBlur = new EventEmitter<any>();\r\n @Output() keyupEnter = new EventEmitter();\r\n\r\n @ViewChild('control') control: ElementRef;\r\n formControl = new SdFormControl();\r\n inputControl = new SdFormControl();\r\n #subscription = new Subscription();\r\n matcher = new SdInputNumberErrotStateMatcher(this.formControl);\r\n\r\n @ContentChild(SdViewDefDirective) sdView: SdViewDefDirective;\r\n @ContentChild(SdSuffixDirective) sdSuffix: SdSuffixDirective;\r\n @ContentChild(SdLabelDefDirective) sdLabelDef: SdLabelDefDirective;\r\n isFocused = 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 }\r\n\r\n private get regex() {\r\n let result = `(([0-9]+(\\\\.[0-9])?)+(\\\\,[0-9]{0,${this.precision}}){0,1})$`;\r\n if (this.precision === 0) {\r\n result = `(([0-9]+(\\\\.[0-9])?)+)$`;\r\n }\r\n if (this.type === 'negative') {\r\n result = `[-]${result}`;\r\n }\r\n if (!this.type) {\r\n result = `[-]?${result}`;\r\n }\r\n return result;\r\n }\r\n\r\n ngAfterViewInit() {\r\n this.#subscription.add(this.inputControl.valueChanges.subscribe(() => {\r\n const val = this.inputControl.value;\r\n if (!val) {\r\n this.#onChange(undefined);\r\n return;\r\n }\r\n const value = this.#toNumber(val);\r\n if (!isNaN(value)) {\r\n this.inputControl.setValue(this.#getValueWithFormat(val), {\r\n emitEvent: false\r\n });\r\n this.#onChange(value);\r\n }\r\n }));\r\n this.#form?.addControl(this.#name, this.formControl);\r\n this.ref.detectChanges();\r\n }\r\n\r\n #getValueWithFormat = (value: string) => {\r\n const arrayNext = value.split(',');\r\n if (arrayNext.length >= 2) {\r\n return `${this.#formatNumber(arrayNext[0])},${arrayNext[1]}`;\r\n }\r\n return this.#formatNumber(value);\r\n }\r\n\r\n #formatNumber = (text: any) => {\r\n return Number.toVNCurrency((text?.toString() || '').replace(/\\./g, ''));\r\n // const arrs: string[] = (text?.toString() || '').replace(/\\./g, '').split('');\r\n // return arrs.reverse().reduce((acc, num, index) => {\r\n // return num + (num !== '-' && index && !(index % 3) ? '.' : '') + acc;\r\n // }, '');\r\n }\r\n\r\n #toNumber = (text: any) => +((text?.toString() || '').replace(/\\./g, '').replace(/,/g, '.'));\r\n\r\n ngOnDestroy() {\r\n this.#form?.removeControl(this.#name);\r\n this.#subscription.unsubscribe();\r\n }\r\n\r\n reValidate = () => {\r\n this.formControl.updateValueAndValidity();\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 if (this.isRequired) {\r\n validators.push(Validators.required);\r\n }\r\n if (this.minNumber || this.minNumber === 0) {\r\n validators.push(Validators.min(this.minNumber));\r\n }\r\n if (this.maxNumber || this.maxNumber === 0) {\r\n validators.push(Validators.max(this.maxNumber));\r\n }\r\n if (this.#validator) {\r\n asyncValidators.push(this.#customValidator(this.#validator));\r\n }\r\n if (this.inlineError) {\r\n validators.push(this.customInlineErrorValidator());\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 // 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 #onChange = (value: any) => {\r\n this.#model = value ?? null;\r\n this.modelChange.emit(this.#model);\r\n this.sdChange.emit(this.#model);\r\n this.formControl.setValue(this.#model);\r\n }\r\n\r\n onKeyupEnter = () => {\r\n const val: string = (this.inputControl.value ?? '').toString();\r\n if (val.length > val.trim().length) {\r\n this.inputControl.setValue(val.trim());\r\n }\r\n this.keyupEnter.emit(this.inputControl.value);\r\n if (this.#blurOnEnter) {\r\n this.blur();\r\n }\r\n }\r\n\r\n onKeydown = (event: KeyboardEvent) => {\r\n if (event.ctrlKey && event.key == 'v') {\r\n this.#checkValue(event, '');\r\n return;\r\n }\r\n const key = event.keyCode || event.charCode;\r\n if (key == 8 || key == 46 || key == 37 || key == 39 || key == 35 || key == 36 || key == 9) {\r\n return;\r\n }\r\n if (event.ctrlKey && (event.key == 'c' || event.key == 'x' || event.key == 'a')) {\r\n return;\r\n }\r\n if (event.shiftKey && key == 9) {\r\n return;\r\n }\r\n this.#checkValue(event, event.key);\r\n }\r\n\r\n onPaste(event: ClipboardEvent) {\r\n const nextKey = event.clipboardData.getData('text');\r\n this.#checkValue(event, nextKey)\r\n }\r\n\r\n #checkValue = (event, nextKey) => {\r\n const current: string = event.target.value;\r\n // if(this.maxNumber === +current.toString().replace(/\\./g, '').replace(/,/g, '.')){\r\n // event.preventDefault();\r\n // return;\r\n // }\r\n const curval_arr = current.split(\"\");\r\n curval_arr.splice(event.target.selectionStart, (event.target.selectionEnd - event.target.selectionStart), nextKey);\r\n const newval = curval_arr.join(\"\");\r\n if (this.type !== 'positive' && newval === '-') {\r\n return;\r\n }\r\n const regExp: RegExp = new RegExp(`^${this.regex}`, 'g');\r\n if (newval && !String(newval).match(regExp)) {\r\n event.preventDefault();\r\n return;\r\n }\r\n // const value = (newval.toString().replace(/\\./g, '').replace(/,/g, '.'));\r\n // if ((this.maxNumber || this.maxNumber === 0) && +value > this.maxNumber) {\r\n // setTimeout(() => {\r\n // this.inputControl.setValue(this.#getValueWithFormat(this.maxNumber.toString().replace(/\\./g, ',')));\r\n // }, 10);\r\n // event.preventDefault();\r\n // }\r\n }\r\n\r\n onFocus = () => {\r\n this.isFocused = true;\r\n this.sdFocus.emit();\r\n if (this.sdFocusForceBlur.observers?.length > 0) {\r\n this.blur();\r\n this.sdFocusForceBlur.emit();\r\n }\r\n }\r\n\r\n onBlur = () => {\r\n this.isFocused = false;\r\n const val: string = (this.inputControl.value ?? '').toString();\r\n const arrayValue = val.split(',');\r\n if (arrayValue.length >= 2 && arrayValue[1] == '') {\r\n this.inputControl.setValue(this.#formatNumber(arrayValue[0]));\r\n return;\r\n }\r\n if (val.length > val.trim().length) {\r\n this.inputControl.setValue(val.trim());\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.isFocused = false;\r\n this.control?.nativeElement?.blur();\r\n }\r\n\r\n focus = () => {\r\n this.isFocused = true;\r\n setTimeout(() => {\r\n this.control?.nativeElement?.focus();\r\n }, 100);\r\n }\r\n\r\n #customValidator = (func: (value: any) => 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 const result = func(value);\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 onCopyText() {\r\n SdUtility.copyToClipboard(this.inputControl.value);\r\n this.copied = true;\r\n setTimeout(() => {\r\n this.copied = false;\r\n }, 2000);\r\n }\r\n\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { SdInputNumber } from './input-number.component';\r\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\r\nimport { MatFormFieldModule } from '@angular/material/form-field';\r\nimport { MatInputModule } from '@angular/material/input';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatTooltipModule } from '@angular/material/tooltip';\r\nimport { SdTranslateModule } from '@sd-angular/core/translate';\r\nimport { SdCommonModule } from '@sd-angular/core/common';\r\nimport { SdPopoverModule } from '@sd-angular/core/popover';\r\n\r\n@NgModule({\r\n declarations: [SdInputNumber],\r\n imports: [\r\n CommonModule,\r\n FormsModule,\r\n ReactiveFormsModule,\r\n MatFormFieldModule,\r\n MatInputModule,\r\n MatIconModule,\r\n MatTooltipModule,\r\n SdTranslateModule,\r\n SdCommonModule,\r\n SdPopoverModule,\r\n MatButtonModule\r\n ],\r\n exports: [\r\n SdInputNumber\r\n ]\r\n})\r\nexport class SdInputNumberModule { }\r\n","/*\r\n * Public API Surface of superdev-angular-core\r\n */\r\n\r\nexport * from './lib/input-number.module';\r\nexport * from './lib/input-number.component';","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["uuid.v4"],"mappings":";;;;;;;;;;;;;;;;;AAgCA,MAAM,8BAA8B;IAClC,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;MAOY,aAAa;IAkIxB,YACU,GAAsB,EACW,UAA8B;QAD/D,QAAG,GAAH,GAAG,CAAmB;QACW,eAAU,GAAV,UAAU,CAAoB;QAnIzE,OAAE,GAAG,IAAIA,EAAO,EAAE,EAAE,CAAC;QACrB,gBAAQA,EAAO,EAAE,EAAC;QAOlB,wBAAiB;QAoBjB,wBAAmB,GAAG,KAAK,CAAC;QAI5B,yBAAe,KAAK,EAAC;QAIrB,yBAAY;QAmBF,gBAAW,GAAG,IAAI,YAAY,EAAE,CAAC;;QAG3C,eAAU,GAAG,KAAK,CAAC;QAMV,cAAS,GAAW,CAAC,CAAC;QAE/B,eAAU,GAAG,KAAK,CA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/src/lib/input-number.component.ts","../../../../projects/sd-core/input-number/src/lib/input-number.module.ts","../../../../projects/sd-core/input-number/src/public-api.ts","../../../../projects/sd-core/input-number/sd-angular-core-input-number.ts"],"sourcesContent":["import {\r\n Component,\r\n Input,\r\n ViewChild,\r\n Output,\r\n EventEmitter,\r\n ChangeDetectorRef,\r\n OnDestroy,\r\n AfterViewInit,\r\n ElementRef,\r\n OnInit,\r\n ContentChild,\r\n ChangeDetectionStrategy,\r\n HostListener,\r\n Inject,\r\n SimpleChanges,\r\n Optional\r\n} from '@angular/core';\r\nimport { AbstractControl, NgForm, ValidatorFn, Validators, AsyncValidatorFn, FormGroup, FormControl, FormGroupDirective } from '@angular/forms';\r\nimport * as uuid from 'uuid';\r\nimport hash from 'object-hash';\r\n\r\nimport { Subscription } from 'rxjs';\r\nimport { SdFormControl, SdSuffixDirective } from '@sd-angular/core/common';\r\nimport { SdViewDefDirective } from '@sd-angular/core/common';\r\nimport { FORM_CONFIG } from '@sd-angular/core/common';\r\nimport { IFormConfiguration } from '@sd-angular/core/common';\r\nimport { MatFormFieldAppearance } from '@angular/material/form-field';\r\nimport { ErrorStateMatcher } from '@angular/material/core';\r\nimport { SdLabelDefDirective } from '@sd-angular/core/common';\r\nimport { debounceTime } from 'rxjs/operators';\r\nimport { MatTooltip } from '@angular/material/tooltip';\r\nclass SdInputNumberErrotStateMatcher 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@Component({\r\n selector: 'sd-input-number',\r\n templateUrl: './input-number.component.html',\r\n styleUrls: ['./input-number.component.scss'],\r\n changeDetection: ChangeDetectionStrategy.OnPush\r\n})\r\nexport class SdInputNumber implements OnDestroy, OnInit, AfterViewInit {\r\n id = `I${uuid.v4()}`;\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() 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-input-number',\r\n label: val\r\n });\r\n };\r\n @Input() placeholder: string;\r\n disableErrorMessage = false;\r\n @Input('disableErrorMessage') set _disableErrorMessage(val: boolean | '') {\r\n this.disableErrorMessage = (val === '') || val;\r\n }\r\n #blurOnEnter = false;\r\n @Input('blurOnEnter') set _blurOnEnter(val: boolean | '') {\r\n this.#blurOnEnter = (val === '') || val;\r\n }\r\n #model: any;\r\n @Input() set model(value: any) {\r\n if (this.#model !== value) {\r\n this.#model = value;\r\n this.formControl.setValue(this.#model, {\r\n emitEvent: false\r\n });\r\n if (value || value === 0) {\r\n const val = value.toString().replace(/\\./g, ',');\r\n this.inputControl.setValue(this.#getValueWithFormat(val), {\r\n emitEvent: false\r\n });\r\n } else {\r\n this.inputControl.setValue('', {\r\n emitEvent: false\r\n });\r\n }\r\n }\r\n }\r\n @Output() modelChange = new EventEmitter();\r\n\r\n // Validator\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 @Input() type: 'negative' | 'positive'; //negative: chỉ nhập số âm, positive: chỉ số dương\r\n @Input() precision: number = 3; //số chữ số thập phân \r\n\r\n isReadonly = false;\r\n @Input() set readonly(val: boolean | '') {\r\n this.isReadonly = (val === '') || val;\r\n }\r\n\r\n minNumber: number;\r\n @Input() set min(val: number) {\r\n this.minNumber = val;\r\n this.#updateValidator();\r\n }\r\n\r\n maxNumber: number;\r\n @Input() set max(val: number) {\r\n this.maxNumber = val;\r\n this.#updateValidator();\r\n }\r\n\r\n #validator: (value: any) => string | Promise<string>;\r\n @Input() set validator(validator: (value: any) => string | Promise<string>) {\r\n this.#validator = validator;\r\n this.#updateValidator();\r\n }\r\n\r\n inlineError: string;\r\n @Input('inlineError') set _inlineError(val: string) {\r\n this.inlineError = val;\r\n this.#updateValidator();\r\n }\r\n\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 @Input() appearance: MatFormFieldAppearance;\r\n\r\n @ViewChild('copyTooltip') copyTooltip: MatTooltip;\r\n copyable = false;\r\n @Input('copyable') set _copyable(val: boolean | '') {\r\n this.copyable = (val === '') || val;\r\n }\r\n copied = false;\r\n\r\n @Output() sdChange = new EventEmitter<any>();\r\n @Output() sdFocus = new EventEmitter<any>();\r\n @Output() sdBlur = new EventEmitter<any>();\r\n @Output() sdFocusForceBlur = new EventEmitter<any>();\r\n @Output() keyupEnter = new EventEmitter();\r\n\r\n @ViewChild('control') control: ElementRef;\r\n formControl = new SdFormControl();\r\n inputControl = new SdFormControl();\r\n #subscription = new Subscription();\r\n matcher = new SdInputNumberErrotStateMatcher(this.formControl);\r\n\r\n @ContentChild(SdViewDefDirective) sdView: SdViewDefDirective;\r\n @ContentChild(SdSuffixDirective) sdSuffix: SdSuffixDirective;\r\n @ContentChild(SdLabelDefDirective) sdLabelDef: SdLabelDefDirective;\r\n isFocused = 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 }\r\n\r\n private get regex() {\r\n let result = `(([0-9]+(\\\\.[0-9])?)+(\\\\,[0-9]{0,${this.precision}}){0,1})$`;\r\n if (this.precision === 0) {\r\n result = `(([0-9]+(\\\\.[0-9])?)+)$`;\r\n }\r\n if (this.type === 'negative') {\r\n result = `[-]${result}`;\r\n }\r\n if (!this.type) {\r\n result = `[-]?${result}`;\r\n }\r\n return result;\r\n }\r\n\r\n ngAfterViewInit() {\r\n this.#subscription.add(this.inputControl.valueChanges.subscribe(() => {\r\n const val = this.inputControl.value;\r\n if (!val) {\r\n this.#onChange(undefined);\r\n return;\r\n }\r\n const value = this.#toNumber(val);\r\n if (!isNaN(value)) {\r\n this.inputControl.setValue(this.#getValueWithFormat(val), {\r\n emitEvent: false\r\n });\r\n this.#onChange(value);\r\n }\r\n }));\r\n this.#form?.addControl(this.#name, this.formControl);\r\n this.ref.detectChanges();\r\n }\r\n\r\n #getValueWithFormat = (value: string) => {\r\n const arrayNext = value.split(',');\r\n if (arrayNext.length >= 2) {\r\n return `${this.#formatNumber(arrayNext[0])},${arrayNext[1]}`;\r\n }\r\n return this.#formatNumber(value);\r\n }\r\n\r\n #formatNumber = (text: any) => {\r\n return Number.toVNCurrency((text?.toString() || '').replace(/\\./g, ''));\r\n // const arrs: string[] = (text?.toString() || '').replace(/\\./g, '').split('');\r\n // return arrs.reverse().reduce((acc, num, index) => {\r\n // return num + (num !== '-' && index && !(index % 3) ? '.' : '') + acc;\r\n // }, '');\r\n }\r\n\r\n #toNumber = (text: any) => +((text?.toString() || '').replace(/\\./g, '').replace(/,/g, '.'));\r\n\r\n ngOnDestroy() {\r\n this.#form?.removeControl(this.#name);\r\n this.#subscription.unsubscribe();\r\n }\r\n\r\n reValidate = () => {\r\n this.formControl.updateValueAndValidity();\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 if (this.isRequired) {\r\n validators.push(Validators.required);\r\n }\r\n if (this.minNumber || this.minNumber === 0) {\r\n validators.push(Validators.min(this.minNumber));\r\n }\r\n if (this.maxNumber || this.maxNumber === 0) {\r\n validators.push(Validators.max(this.maxNumber));\r\n }\r\n if (this.#validator) {\r\n asyncValidators.push(this.#customValidator(this.#validator));\r\n }\r\n if (this.inlineError) {\r\n validators.push(this.customInlineErrorValidator());\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 // 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 #onChange = (value: any) => {\r\n this.#model = value ?? null;\r\n this.modelChange.emit(this.#model);\r\n this.sdChange.emit(this.#model);\r\n this.formControl.setValue(this.#model);\r\n }\r\n\r\n onKeyupEnter = () => {\r\n const val: string = (this.inputControl.value ?? '').toString();\r\n if (val.length > val.trim().length) {\r\n this.inputControl.setValue(val.trim());\r\n }\r\n this.keyupEnter.emit(this.inputControl.value);\r\n if (this.#blurOnEnter) {\r\n this.blur();\r\n }\r\n }\r\n\r\n onKeydown = (event: KeyboardEvent) => {\r\n if (event.ctrlKey && event.key == 'v') {\r\n this.#checkValue(event, '');\r\n return;\r\n }\r\n const key = event.keyCode || event.charCode;\r\n if (key == 8 || key == 46 || key == 37 || key == 39 || key == 35 || key == 36 || key == 9) {\r\n return;\r\n }\r\n if (event.ctrlKey && (event.key == 'c' || event.key == 'x' || event.key == 'a')) {\r\n return;\r\n }\r\n if (event.shiftKey && key == 9) {\r\n return;\r\n }\r\n this.#checkValue(event, event.key);\r\n }\r\n\r\n onPaste(event: ClipboardEvent) {\r\n const nextKey = event.clipboardData.getData('text');\r\n this.#checkValue(event, nextKey)\r\n }\r\n\r\n #checkValue = (event, nextKey) => {\r\n const current: string = event.target.value;\r\n // if(this.maxNumber === +current.toString().replace(/\\./g, '').replace(/,/g, '.')){\r\n // event.preventDefault();\r\n // return;\r\n // }\r\n const curval_arr = current.split(\"\");\r\n curval_arr.splice(event.target.selectionStart, (event.target.selectionEnd - event.target.selectionStart), nextKey);\r\n const newval = curval_arr.join(\"\");\r\n if (this.type !== 'positive' && newval === '-') {\r\n return;\r\n }\r\n const regExp: RegExp = new RegExp(`^${this.regex}`, 'g');\r\n if (newval && !String(newval).match(regExp)) {\r\n event.preventDefault();\r\n return;\r\n }\r\n // const value = (newval.toString().replace(/\\./g, '').replace(/,/g, '.'));\r\n // if ((this.maxNumber || this.maxNumber === 0) && +value > this.maxNumber) {\r\n // setTimeout(() => {\r\n // this.inputControl.setValue(this.#getValueWithFormat(this.maxNumber.toString().replace(/\\./g, ',')));\r\n // }, 10);\r\n // event.preventDefault();\r\n // }\r\n }\r\n\r\n onFocus = () => {\r\n this.isFocused = true;\r\n this.sdFocus.emit();\r\n if (this.sdFocusForceBlur.observers?.length > 0) {\r\n this.blur();\r\n this.sdFocusForceBlur.emit();\r\n }\r\n }\r\n\r\n onBlur = () => {\r\n this.isFocused = false;\r\n const val: string = (this.inputControl.value ?? '').toString();\r\n const arrayValue = val.split(',');\r\n if (arrayValue.length >= 2 && arrayValue[1] == '') {\r\n this.inputControl.setValue(this.#formatNumber(arrayValue[0]));\r\n return;\r\n }\r\n if (val.length > val.trim().length) {\r\n this.inputControl.setValue(val.trim());\r\n }\r\n this.sdBlur.emit(this.formControl.value);\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.isFocused = false;\r\n this.control?.nativeElement?.blur();\r\n }\r\n\r\n focus = () => {\r\n this.isFocused = true;\r\n setTimeout(() => {\r\n this.control?.nativeElement?.focus();\r\n }, 100);\r\n }\r\n\r\n #customValidator = (func: (value: any) => 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 const result = func(value);\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 onCopyText() {\r\n SdUtility.copyToClipboard(this.inputControl.value);\r\n this.copied = true;\r\n setTimeout(() => {\r\n this.copied = false;\r\n }, 2000);\r\n }\r\n\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { SdInputNumber } from './input-number.component';\r\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\r\nimport { MatFormFieldModule } from '@angular/material/form-field';\r\nimport { MatInputModule } from '@angular/material/input';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatTooltipModule } from '@angular/material/tooltip';\r\nimport { SdTranslateModule } from '@sd-angular/core/translate';\r\nimport { SdCommonModule } from '@sd-angular/core/common';\r\nimport { SdPopoverModule } from '@sd-angular/core/popover';\r\n\r\n@NgModule({\r\n declarations: [SdInputNumber],\r\n imports: [\r\n CommonModule,\r\n FormsModule,\r\n ReactiveFormsModule,\r\n MatFormFieldModule,\r\n MatInputModule,\r\n MatIconModule,\r\n MatTooltipModule,\r\n SdTranslateModule,\r\n SdCommonModule,\r\n SdPopoverModule,\r\n MatButtonModule\r\n ],\r\n exports: [\r\n SdInputNumber\r\n ]\r\n})\r\nexport class SdInputNumberModule { }\r\n","/*\r\n * Public API Surface of superdev-angular-core\r\n */\r\n\r\nexport * from './lib/input-number.module';\r\nexport * from './lib/input-number.component';","/**\n * Generated bundle index. Do not edit.\n */\n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AM;;aAChD;;;YAtCC,iBAAiB;4CA4Kd,MAAM,SAAC,WAAW,cAAG,QAAQ;;;mBAlI/B,KAAK;mBAKL,KAAK;mBAEL,KAAK;qBAWL,KAAK,SAAC,OAAO;0BAOb,KAAK;mCAEL,KAAK,SAAC,qBAAqB;2BAI3B,KAAK,SAAC,aAAa;oBAInB,KAAK;0BAkBL,MAAM;uBAIN,KAAK;mBAIL,KAAK;wBACL,KAAK;uBAGL,KAAK;kBAKL,KAAK;kBAML,KAAK;wBAML,KAAK;2BAML,KAAK,SAAC,aAAa;uBAKnB,KAAK;yBAUL,KAAK;0BAEL,SAAS,SAAC,aAAa;wBAEvB,KAAK,SAAC,UAAU;uBAKhB,MAAM;sBACN,MAAM;qBACN,MAAM;+BACN,MAAM;yBACN,MAAM;sBAEN,SAAS,SAAC,SAAS;qBAMnB,YAAY,SAAC,kBAAkB;uBAC/B,YAAY,SAAC,iBAAiB;yBAC9B,YAAY,SAAC,mBAAmB;;;MC9ItB,mBAAmB;;;YAnB/B,QAAQ,SAAC;gBACR,YAAY,EAAE,CAAC,aAAa,CAAC;gBAC7B,OAAO,EAAE;oBACP,YAAY;oBACZ,WAAW;oBACX,mBAAmB;oBACnB,kBAAkB;oBAClB,cAAc;oBACd,aAAa;oBACb,gBAAgB;oBAChB,iBAAiB;oBACjB,cAAc;oBACd,eAAe;oBACf,eAAe;iBAChB;gBACD,OAAO,EAAE;oBACP,aAAa;iBACd;aACF;;;AC/BD;;;;ACAA;;;;;;"}
@@ -48,9 +48,14 @@ class SdRadio {
48
48
  if (__classPrivateFieldGet(this, _required)) {
49
49
  validators.push(Validators.required);
50
50
  }
51
+ if (this.inlineError) {
52
+ validators.push(this.customInlineErrorValidator());
53
+ }
51
54
  this.formControl.setValidators(validators);
52
55
  this.formControl.updateValueAndValidity();
53
- });
56
+ }
57
+ // Hàm tạo Validators tùy chỉnh cho inlineError
58
+ );
54
59
  this.reValidate = () => {
55
60
  this.formControl.updateValueAndValidity({ emitEvent: true });
56
61
  };
@@ -88,6 +93,10 @@ class SdRadio {
88
93
  __classPrivateFieldSet(this, _required, (val === '') || val);
89
94
  __classPrivateFieldGet(this, _updateValidator).call(this);
90
95
  }
96
+ set _inlineError(val) {
97
+ this.inlineError = val;
98
+ __classPrivateFieldGet(this, _updateValidator).call(this);
99
+ }
91
100
  // Optional
92
101
  set disabled(val) {
93
102
  val = (val === '') || val;
@@ -126,12 +135,18 @@ class SdRadio {
126
135
  __classPrivateFieldGet(this, _subscription).unsubscribe();
127
136
  (_a = __classPrivateFieldGet(this, _form)) === null || _a === void 0 ? void 0 : _a.removeControl(__classPrivateFieldGet(this, _name));
128
137
  }
138
+ // Hàm tạo Validators tùy chỉnh cho inlineError
139
+ customInlineErrorValidator() {
140
+ return (control) => {
141
+ return { inlineError: true };
142
+ };
143
+ }
129
144
  }
130
145
  _name = new WeakMap(), _form = new WeakMap(), _model = new WeakMap(), _required = new WeakMap(), _subscription = new WeakMap(), _updateValidator = new WeakMap();
131
146
  SdRadio.decorators = [
132
147
  { type: Component, args: [{
133
148
  selector: 'sd-radio',
134
- template: "<section [ngClass]=\"{'c-section': display == 'row'}\">\r\n <ng-container *ngIf=\"sdLabelDef?.templateRef\">\r\n <ng-container *ngTemplateOutlet=\"sdLabelDef.templateRef\">\r\n </ng-container>\r\n </ng-container>\r\n <label *ngIf=\"label&&!sdLabelDef?.templateRef\" class=\"d-block T14M\" [class.mb-0]=\"display === 'row'\">{{label}} <span class=\"text-danger mb-2\" *ngIf=\"required\">*</span></label>\r\n <mat-radio-group [ngClass]=\"{'c-radio-group-column': display === 'column', 'c-radio-group-row': display === 'row'}\"\r\n [formControl]=\"formControl\">\r\n <mat-radio-button color=\"primary\" [ngClass]=\"{'m-0': display === 'column', 'mr-16': display === 'row'}\"\r\n *ngFor=\"let item of items\" [value]=\"item[valueField]\">\r\n {{item[displayField]}}\r\n </mat-radio-button>\r\n </mat-radio-group>\r\n</section>",
149
+ template: "<section [ngClass]=\"{'c-section': display == 'row'}\">\r\n <ng-container *ngIf=\"sdLabelDef?.templateRef\">\r\n <ng-container *ngTemplateOutlet=\"sdLabelDef.templateRef\">\r\n </ng-container>\r\n </ng-container>\r\n <label *ngIf=\"label&&!sdLabelDef?.templateRef\" class=\"d-block T14M\" [class.mb-0]=\"display === 'row'\">{{label}} <span class=\"text-danger mb-2\" *ngIf=\"required\">*</span></label>\r\n <mat-radio-group [ngClass]=\"{'c-radio-group-column': display === 'column', 'c-radio-group-row': display === 'row'}\"\r\n [formControl]=\"formControl\">\r\n <mat-radio-button color=\"primary\" [ngClass]=\"{'m-0': display === 'column', 'mr-16': display === 'row'}\"\r\n *ngFor=\"let item of items\" [value]=\"item[valueField]\">\r\n {{item[displayField]}}\r\n </mat-radio-button>\r\n </mat-radio-group>\r\n \r\n <mat-error *ngIf=\"formControl.errors?.inlineError && formControl?.touched\">\r\n {{inlineError}}\r\n </mat-error>\r\n</section>",
135
150
  changeDetection: ChangeDetectionStrategy.OnPush,
136
151
  styles: [":host{display:flex;flex-direction:column;height:100%}.c-section{align-content:center;align-items:center}.c-radio-group-column{align-items:flex-start;display:flex;flex:1;flex-direction:column}.c-radio-group-row{align-items:center;display:flex;flex:1;flex-direction:row}"]
137
152
  },] }
@@ -150,6 +165,7 @@ SdRadio.propDecorators = {
150
165
  valueField: [{ type: Input }],
151
166
  displayField: [{ type: Input }],
152
167
  required: [{ type: Input }],
168
+ _inlineError: [{ type: Input, args: ['inlineError',] }],
153
169
  disabled: [{ type: Input }],
154
170
  sdLabelDef: [{ type: ContentChild, args: [SdLabelDefDirective,] }],
155
171
  modelChange: [{ type: Output }],
@@ -1 +1 @@
1
- {"version":3,"file":"sd-angular-core-radio.js","sources":["../../../../projects/sd-core/radio/src/lib/radio.component.ts","../../../../projects/sd-core/radio/src/lib/radio.module.ts","../../../../projects/sd-core/radio/sd-angular-core-radio.ts"],"sourcesContent":["import { Component, Input, Output, EventEmitter, ChangeDetectorRef, AfterViewInit, OnDestroy, OnInit, ChangeDetectionStrategy, ContentChild } from '@angular/core';\r\nimport { NgForm, Validators, ValidatorFn, FormGroup } from '@angular/forms';\r\nimport { SdLabelDefDirective } from '@sd-angular/core/common';\r\nimport { SdFormControl } from '@sd-angular/core/common';\r\nimport { Subscription } from 'rxjs';\r\nimport * as uuid from 'uuid';\r\n\r\n@Component({\r\n selector: 'sd-radio',\r\n templateUrl: './radio.component.html',\r\n styleUrls: ['./radio.component.scss'],\r\n changeDetection: ChangeDetectionStrategy.OnPush\r\n})\r\nexport class SdRadio implements OnInit, AfterViewInit, OnDestroy {\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 formControl = new SdFormControl();\r\n // get isNumber() {\r\n // if (this.#model || this.#model === 0) {\r\n // return typeof (this.#model) === 'number';\r\n // }\r\n // if (this.items?.length) {\r\n // if (this.valueField) {\r\n // return typeof (this.items[0][this.valueField]) === 'number';\r\n // } else {\r\n // return typeof (this.items[0]) === 'number';\r\n // }\r\n // }\r\n // return false;\r\n // }\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 @Input() label: string;\r\n @Input() placeholder: string;\r\n @Input() display: 'row' | 'column' = 'row';\r\n // Model\r\n #model: number | string | boolean;\r\n @Input() set model(value: number | string | boolean) {\r\n this.#model = value;\r\n if (value !== this.formControl.value) {\r\n this.formControl.setValue(value, {\r\n emitEvent: false\r\n });\r\n }\r\n }\r\n // Items\r\n items: any[] = [];\r\n @Input('items') set pItems(items: any[]) {\r\n if (!Array.isArray(items)) {\r\n this.items = [];\r\n }\r\n this.items = items;\r\n }\r\n @Input() valueField: string;\r\n @Input() displayField: string;\r\n\r\n // Validator\r\n #required = false;\r\n @Input() set required(val: boolean | '') {\r\n this.#required = (val === '') || val;\r\n this.#updateValidator();\r\n }\r\n // Optional\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 @ContentChild(SdLabelDefDirective) sdLabelDef: SdLabelDefDirective;\r\n @Output() modelChange = new EventEmitter();\r\n @Output() sdChange = new EventEmitter();\r\n @Output() sdSelection = new EventEmitter<{ value: any | any[], item?: any }>();\r\n #subscription = new Subscription();\r\n constructor(\r\n public ref: ChangeDetectorRef\r\n ) { }\r\n\r\n ngOnInit() {\r\n this.#subscription.add(this.formControl.sdChanges.subscribe(() => {\r\n // this.formControl.updateValueAndValidity();\r\n this.ref.markForCheck();\r\n }));\r\n }\r\n\r\n ngAfterViewInit() {\r\n this.#subscription.add(this.formControl.valueChanges.subscribe(value => {\r\n let val = value;\r\n // if (this.isNumber && Number.isNumber(value)) {\r\n // val = +value;\r\n // }\r\n this.modelChange.emit(val);\r\n this.sdChange.emit(val);\r\n this.sdSelection.emit({\r\n value: val,\r\n item: this.items?.find(e => val?.toString() === e?.[this.valueField]?.toString())\r\n });\r\n }));\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 #updateValidator = () => {\r\n this.formControl.clearValidators();\r\n const validators: ValidatorFn[] = [];\r\n if (this.#required) {\r\n validators.push(Validators.required);\r\n }\r\n this.formControl.setValidators(validators);\r\n this.formControl.updateValueAndValidity();\r\n }\r\n\r\n reValidate = () => {\r\n this.formControl.updateValueAndValidity({ emitEvent: true });\r\n }\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { ReactiveFormsModule } from '@angular/forms';\r\nimport { MatFormFieldModule } from '@angular/material/form-field';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatTooltipModule } from '@angular/material/tooltip';\r\nimport { SdRadio } from './radio.component';\r\nimport { SdTranslateModule } from '@sd-angular/core/translate';\r\nimport { MatRadioModule } from '@angular/material/radio';\r\n\r\n@NgModule({\r\n imports: [\r\n CommonModule,\r\n ReactiveFormsModule,\r\n MatTooltipModule,\r\n MatFormFieldModule,\r\n MatIconModule,\r\n MatRadioModule,\r\n SdTranslateModule\r\n ],\r\n declarations: [\r\n SdRadio\r\n ],\r\n exports: [\r\n SdRadio\r\n ],\r\n providers: [\r\n ]\r\n})\r\nexport class SdRadioModule {\r\n\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["uuid.v4"],"mappings":";;;;;;;;;;;;;;MAaa,OAAO;IA2ElB,YACS,GAAsB;QAAtB,QAAG,GAAH,GAAG,CAAmB;QA3E/B,gBAAQA,EAAO,EAAE,EAAC;QAMlB,gBAAW,GAAG,IAAI,aAAa,EAAE,CAAC;;;;;;;;;;;;;;QAclC,wBAAiB;QAYR,YAAO,GAAqB,KAAK,CAAC;;QAE3C,yBAAkC;;QAUlC,UAAK,GAAU,EAAE,CAAC;;QAWlB,oBAAY,KAAK,EAAC;QAeR,gBAAW,GAAG,IAAI,YAAY,EAAE,CAAC;QACjC,aAAQ,GAAG,IAAI,YAAY,EAAE,CAAC;QAC9B,gBAAW,GAAG,IAAI,YAAY,EAAsC,CAAC;QAC/E,wBAAgB,IAAI,YAAY,EAAE,EAAC;QAiCnC,2BAAmB;YACjB,IAAI,CAAC,WAAW,CAAC,eAAe,EAAE,CAAC;YACnC,MAAM,UAAU,GAAkB,EAAE,CAAC;YACrC,6CAAoB;gBAClB,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;aACtC;YACD,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;YAC3C,IAAI,CAAC,WAAW,CAAC,sBAAsB,EAAE,CAAC;SAC3C,EAAA;QAED,eAAU,GAAG;YACX,IAAI,CAAC,WAAW,CAAC,sBAAsB,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;S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,gBAAgB;oBAChB,kBAAkB;oBAClB,aAAa;oBACb,cAAc;oBACd,iBAAiB;iBAClB;gBACD,YAAY,EAAE;oBACZ,OAAO;iBACR;gBACD,OAAO,EAAE;oBACP,OAAO;iBACR;gBACD,SAAS,EAAE,EACV;aACF;;;AC5BD;;;;;;"}
1
+ {"version":3,"file":"sd-angular-core-radio.js","sources":["../../../../projects/sd-core/radio/src/lib/radio.component.ts","../../../../projects/sd-core/radio/src/lib/radio.module.ts","../../../../projects/sd-core/radio/sd-angular-core-radio.ts"],"sourcesContent":["import { Component, Input, Output, EventEmitter, ChangeDetectorRef, AfterViewInit, OnDestroy, OnInit, ChangeDetectionStrategy, ContentChild } from '@angular/core';\r\nimport { NgForm, Validators, ValidatorFn, FormGroup, AbstractControl } from '@angular/forms';\r\nimport { SdLabelDefDirective } from '@sd-angular/core/common';\r\nimport { SdFormControl } from '@sd-angular/core/common';\r\nimport { Subscription } from 'rxjs';\r\nimport * as uuid from 'uuid';\r\n\r\n@Component({\r\n selector: 'sd-radio',\r\n templateUrl: './radio.component.html',\r\n styleUrls: ['./radio.component.scss'],\r\n changeDetection: ChangeDetectionStrategy.OnPush\r\n})\r\nexport class SdRadio implements OnInit, AfterViewInit, OnDestroy {\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 formControl = new SdFormControl();\r\n // get isNumber() {\r\n // if (this.#model || this.#model === 0) {\r\n // return typeof (this.#model) === 'number';\r\n // }\r\n // if (this.items?.length) {\r\n // if (this.valueField) {\r\n // return typeof (this.items[0][this.valueField]) === 'number';\r\n // } else {\r\n // return typeof (this.items[0]) === 'number';\r\n // }\r\n // }\r\n // return false;\r\n // }\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 @Input() label: string;\r\n @Input() placeholder: string;\r\n @Input() display: 'row' | 'column' = 'row';\r\n // Model\r\n #model: number | string | boolean;\r\n @Input() set model(value: number | string | boolean) {\r\n this.#model = value;\r\n if (value !== this.formControl.value) {\r\n this.formControl.setValue(value, {\r\n emitEvent: false\r\n });\r\n }\r\n }\r\n // Items\r\n items: any[] = [];\r\n @Input('items') set pItems(items: any[]) {\r\n if (!Array.isArray(items)) {\r\n this.items = [];\r\n }\r\n this.items = items;\r\n }\r\n @Input() valueField: string;\r\n @Input() displayField: string;\r\n\r\n // Validator\r\n #required = false;\r\n @Input() set required(val: boolean | '') {\r\n this.#required = (val === '') || val;\r\n this.#updateValidator();\r\n }\r\n \r\n inlineError: string;\r\n @Input('inlineError') set _inlineError(val: string) {\r\n this.inlineError = val;\r\n this.#updateValidator();\r\n }\r\n\r\n // Optional\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 @ContentChild(SdLabelDefDirective) sdLabelDef: SdLabelDefDirective;\r\n @Output() modelChange = new EventEmitter();\r\n @Output() sdChange = new EventEmitter();\r\n @Output() sdSelection = new EventEmitter<{ value: any | any[], item?: any }>();\r\n #subscription = new Subscription();\r\n constructor(\r\n public ref: ChangeDetectorRef\r\n ) { }\r\n\r\n ngOnInit() {\r\n this.#subscription.add(this.formControl.sdChanges.subscribe(() => {\r\n // this.formControl.updateValueAndValidity();\r\n this.ref.markForCheck();\r\n }));\r\n }\r\n\r\n ngAfterViewInit() {\r\n this.#subscription.add(this.formControl.valueChanges.subscribe(value => {\r\n let val = value;\r\n // if (this.isNumber && Number.isNumber(value)) {\r\n // val = +value;\r\n // }\r\n this.modelChange.emit(val);\r\n this.sdChange.emit(val);\r\n this.sdSelection.emit({\r\n value: val,\r\n item: this.items?.find(e => val?.toString() === e?.[this.valueField]?.toString())\r\n });\r\n }));\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 #updateValidator = () => {\r\n this.formControl.clearValidators();\r\n const validators: ValidatorFn[] = [];\r\n if (this.#required) {\r\n validators.push(Validators.required);\r\n }\r\n if (this.inlineError) {\r\n validators.push(this.customInlineErrorValidator());\r\n }\r\n this.formControl.setValidators(validators);\r\n this.formControl.updateValueAndValidity();\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 reValidate = () => {\r\n this.formControl.updateValueAndValidity({ emitEvent: true });\r\n }\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { ReactiveFormsModule } from '@angular/forms';\r\nimport { MatFormFieldModule } from '@angular/material/form-field';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatTooltipModule } from '@angular/material/tooltip';\r\nimport { SdRadio } from './radio.component';\r\nimport { SdTranslateModule } from '@sd-angular/core/translate';\r\nimport { MatRadioModule } from '@angular/material/radio';\r\n\r\n@NgModule({\r\n imports: [\r\n CommonModule,\r\n ReactiveFormsModule,\r\n MatTooltipModule,\r\n MatFormFieldModule,\r\n MatIconModule,\r\n MatRadioModule,\r\n SdTranslateModule\r\n ],\r\n declarations: [\r\n SdRadio\r\n ],\r\n exports: [\r\n SdRadio\r\n ],\r\n providers: [\r\n ]\r\n})\r\nexport class SdRadioModule {\r\n\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["uuid.v4"],"mappings":";;;;;;;;;;;;;;MAaa,OAAO;IAkFlB,YACS,GAAsB;QAAtB,QAAG,GAAH,GAAG,CAAmB;QAlF/B,gBAAQA,EAAO,EAAE,EAAC;QAMlB,gBAAW,GAAG,IAAI,aAAa,EAAE,CAAC;;;;;;;;;;;;;;QAclC,wBAAiB;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BD;;;;;;"}
@@ -5,8 +5,9 @@ import { MatSlideToggleModule } from '@angular/material/slide-toggle';
5
5
  import { __classPrivateFieldSet, __classPrivateFieldGet } from 'tslib';
6
6
  import { Subscription } from 'rxjs';
7
7
  import { v4 } from 'uuid';
8
+ import { MatFormFieldModule } from '@angular/material/form-field';
8
9
 
9
- var _name, _form, _subscription, _onChange;
10
+ var _name, _form, _subscription, _onChange, _updateValidator;
10
11
  class SdSwitch {
11
12
  constructor(ref) {
12
13
  this.ref = ref;
@@ -21,6 +22,17 @@ class SdSwitch {
21
22
  this.modelChange.emit(value);
22
23
  this.sdChange.emit(value);
23
24
  });
25
+ _updateValidator.set(this, () => {
26
+ this.formControl.clearValidators();
27
+ const validators = [];
28
+ if (this.inlineError) {
29
+ validators.push(this.customInlineErrorValidator());
30
+ }
31
+ this.formControl.setValidators(validators);
32
+ this.formControl.updateValueAndValidity();
33
+ }
34
+ // Hàm tạo Validators tùy chỉnh cho inlineError
35
+ );
24
36
  }
25
37
  set form(val) {
26
38
  if (val) {
@@ -48,6 +60,10 @@ class SdSwitch {
48
60
  });
49
61
  }
50
62
  }
63
+ set _inlineError(val) {
64
+ this.inlineError = val;
65
+ __classPrivateFieldGet(this, _updateValidator).call(this);
66
+ }
51
67
  ngOnInit() {
52
68
  }
53
69
  ngAfterViewInit() {
@@ -61,12 +77,18 @@ class SdSwitch {
61
77
  (_a = __classPrivateFieldGet(this, _form)) === null || _a === void 0 ? void 0 : _a.removeControl(__classPrivateFieldGet(this, _name));
62
78
  __classPrivateFieldGet(this, _subscription).unsubscribe();
63
79
  }
80
+ // Hàm tạo Validators tùy chỉnh cho inlineError
81
+ customInlineErrorValidator() {
82
+ return (control) => {
83
+ return { inlineError: true };
84
+ };
85
+ }
64
86
  }
65
- _name = new WeakMap(), _form = new WeakMap(), _subscription = new WeakMap(), _onChange = new WeakMap();
87
+ _name = new WeakMap(), _form = new WeakMap(), _subscription = new WeakMap(), _onChange = new WeakMap(), _updateValidator = new WeakMap();
66
88
  SdSwitch.decorators = [
67
89
  { type: Component, args: [{
68
90
  selector: 'sd-switch',
69
- template: "<mat-slide-toggle [formControl]=\"formControl\" [color]=\"color\"><span\r\n class=\"c-label\">{{label}}</span></mat-slide-toggle>",
91
+ template: "<mat-slide-toggle [formControl]=\"formControl\" [color]=\"color\"><span\r\n class=\"c-label\">{{label}}</span></mat-slide-toggle>\r\n <mat-error *ngIf=\"formControl.errors?.inlineError && formControl?.touched\">\r\n {{inlineError}}\r\n </mat-error>",
70
92
  changeDetection: ChangeDetectionStrategy.OnPush,
71
93
  styles: [""]
72
94
  },] }
@@ -81,6 +103,7 @@ SdSwitch.propDecorators = {
81
103
  color: [{ type: Input }],
82
104
  disabled: [{ type: Input }],
83
105
  model: [{ type: Input }],
106
+ _inlineError: [{ type: Input, args: ['inlineError',] }],
84
107
  modelChange: [{ type: Output }],
85
108
  sdChange: [{ type: Output }]
86
109
  };
@@ -94,6 +117,7 @@ SdSwitchModule.decorators = [
94
117
  FormsModule,
95
118
  ReactiveFormsModule,
96
119
  MatSlideToggleModule,
120
+ MatFormFieldModule
97
121
  ],
98
122
  declarations: [
99
123
  SdSwitch
@@ -1 +1 @@
1
- {"version":3,"file":"sd-angular-core-switch.js","sources":["../../../../projects/sd-core/switch/src/lib/switch.component.ts","../../../../projects/sd-core/switch/src/lib/switch.module.ts","../../../../projects/sd-core/switch/src/public-api.ts","../../../../projects/sd-core/switch/sd-angular-core-switch.ts"],"sourcesContent":["import { Component, Input, Output, EventEmitter, ChangeDetectorRef, ChangeDetectionStrategy } from '@angular/core';\r\nimport { FormControl, FormGroup, NgForm } from '@angular/forms';\r\nimport { Subscription } from 'rxjs';\r\nimport * as uuid from 'uuid';\r\n\r\n@Component({\r\n selector: 'sd-switch',\r\n templateUrl: './switch.component.html',\r\n styleUrls: ['./switch.component.scss'],\r\n changeDetection: ChangeDetectionStrategy.OnPush\r\n})\r\nexport class SdSwitch {\r\n #name = uuid.v4();\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 @Input() label: string;\r\n @Input() color: 'primary' | 'warn' = 'primary';\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 @Input() set model(value: any) {\r\n if (this.formControl.value !== value) {\r\n this.formControl.setValue(value, {\r\n emitEvent: false\r\n });\r\n }\r\n }\r\n\r\n @Output() modelChange = new EventEmitter();\r\n @Output() sdChange = new EventEmitter();\r\n formControl = new FormControl();\r\n #subscription = new Subscription();\r\n constructor(private ref: ChangeDetectorRef) {\r\n }\r\n\r\n ngOnInit() {\r\n }\r\n ngAfterViewInit() {\r\n this.#subscription.add(this.formControl.valueChanges.subscribe(this.#onChange));\r\n this.#form?.addControl(this.#name, this.formControl);\r\n this.ref.detectChanges();\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 #onChange = (value: any) => {\r\n this.modelChange.emit(value);\r\n this.sdChange.emit(value);\r\n }\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\r\nimport { CommonModule } from '@angular/common';\r\nimport { MatSlideToggleModule } from '@angular/material/slide-toggle';\r\nimport { SdSwitch } from './switch.component';\r\n\r\n@NgModule({\r\n imports: [\r\n CommonModule,\r\n FormsModule,\r\n ReactiveFormsModule,\r\n MatSlideToggleModule,\r\n ],\r\n declarations: [\r\n SdSwitch\r\n ],\r\n exports: [\r\n SdSwitch\r\n ]\r\n})\r\nexport class SdSwitchModule { }\r\n","/*\r\n * Public API Surface of superdev-angular-core\r\n */\r\n\r\nexport * from './lib/switch.module';\r\nexport * from './lib/switch.component';\r\n","/**\n * Generated b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ACb,4CAAmB,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,SAAS,yCAAgB,CAAC,CAAC;QAChF,mFAAY,UAAU,sCAAa,IAAI,CAAC,WAAW,EAAE;QACrD,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,CAAC;KAC1B;IAED,WAAW;;QACT,mFAAY,aAAa,sCAAa;QACtC,4CAAmB,WAAW,EAAE,CAAC;KAClC;;;;YAxDF,SAAS,SAAC;gBACT,QAAQ,EAAE,WAAW;gBACrB,gJAAsC;gBAEtC,eAAe,EAAE,uBAAuB,CAAC,MAAM;;aAChD;;;YAVgD,iBAAiB;;;mBAa/D,KAAK;mBAEL,KAAK;oBASL,KAAK;oBACL,KAAK;uBACL,KAAK;oBASL,KAAK;0BAQL,MAAM;uBACN,MAAM;;;MCxBI,cAAc;;;YAd1B,QAAQ,SAAC;gBACR,OAAO,EAAE;oBACP,YAAY;oBACZ,WAAW;oBACX,mBAAmB;oBACnB,oBAAoB;iBACrB;gBACD,YAAY,EAAE;oBACZ,QAAQ;iBACT;gBACD,OAAO,EAAE;oBACP,QAAQ;iBACT;aACF;;;ACnBD;;;;ACAA;;;;;;"}
1
+ {"version":3,"file":"sd-angular-core-switch.js","sources":["../../../../projects/sd-core/switch/src/lib/switch.component.ts","../../../../projects/sd-core/switch/src/lib/switch.module.ts","../../../../projects/sd-core/switch/src/public-api.ts","../../../../projects/sd-core/switch/sd-angular-core-switch.ts"],"sourcesContent":["import { Component, Input, Output, EventEmitter, ChangeDetectorRef, ChangeDetectionStrategy } from '@angular/core';\r\nimport { AbstractControl, FormControl, FormGroup, NgForm, ValidatorFn } from '@angular/forms';\r\nimport { Subscription } from 'rxjs';\r\nimport * as uuid from 'uuid';\r\n\r\n@Component({\r\n selector: 'sd-switch',\r\n templateUrl: './switch.component.html',\r\n styleUrls: ['./switch.component.scss'],\r\n changeDetection: ChangeDetectionStrategy.OnPush\r\n})\r\nexport class SdSwitch {\r\n #name = uuid.v4();\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 @Input() label: string;\r\n @Input() color: 'primary' | 'warn' = 'primary';\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 @Input() set model(value: any) {\r\n if (this.formControl.value !== value) {\r\n this.formControl.setValue(value, {\r\n emitEvent: false\r\n });\r\n }\r\n }\r\n\r\n inlineError: string;\r\n @Input('inlineError') set _inlineError(val: string) {\r\n this.inlineError = val;\r\n this.#updateValidator();\r\n }\r\n\r\n @Output() modelChange = new EventEmitter();\r\n @Output() sdChange = new EventEmitter();\r\n formControl = new FormControl();\r\n #subscription = new Subscription();\r\n constructor(private ref: ChangeDetectorRef) {\r\n }\r\n\r\n ngOnInit() {\r\n }\r\n ngAfterViewInit() {\r\n this.#subscription.add(this.formControl.valueChanges.subscribe(this.#onChange));\r\n this.#form?.addControl(this.#name, this.formControl);\r\n this.ref.detectChanges();\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 #onChange = (value: any) => {\r\n this.modelChange.emit(value);\r\n this.sdChange.emit(value);\r\n }\r\n #updateValidator = () => {\r\n this.formControl.clearValidators();\r\n const validators: ValidatorFn[] = [];\r\n \r\n if (this.inlineError) {\r\n validators.push(this.customInlineErrorValidator());\r\n }\r\n this.formControl.setValidators(validators);\r\n this.formControl.updateValueAndValidity();\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","import { NgModule } from '@angular/core';\r\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\r\nimport { CommonModule } from '@angular/common';\r\nimport { MatSlideToggleModule } from '@angular/material/slide-toggle';\r\nimport { SdSwitch } from './switch.component';\r\nimport { MatFormFieldModule } from '@angular/material/form-field';\r\n\r\n@NgModule({\r\n imports: [\r\n CommonModule,\r\n FormsModule,\r\n ReactiveFormsModule,\r\n MatSlideToggleModule,\r\n MatFormFieldModule\r\n ],\r\n declarations: [\r\n SdSwitch\r\n ],\r\n exports: [\r\n SdSwitch\r\n ]\r\n})\r\nexport class SdSwitchModule { }\r\n","/*\r\n * Public API Surface of superdev-angular-core\r\n */\r\n\r\nexport * from './lib/switch.module';\r\nexport * from './lib/switch.component';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["uuid.v4"],"mappings":";;;;;;;;;;MAWa,QAAQ;IA0CnB,YAAoB,GAAsB;QAAtB,QAAG,GAAH,GAAG,CAAmB;QAzC1C,gBAAQA,EAAO,EAAE,EAAC;QAElB,wBAAiB;QAWR,UAAK,GAAuB,SAAS,CAAC;QAwBrC,gBAAW,GAAG,IAAI,YAAY,EAAE,CAAC;QACjC,aAAQ,GAAG,IAAI,YAAY,EAAE,CAAC;QACxC,gBAAW,GAAG,IAAI,WAAW,EAAE,CAAC;QAChC,wBAAgB,IAAI,YAAY,EAAE,EAAC;QAiBnC,oBAAY,CAAC,KAAU;YACrB,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAC7B,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SAC3B,EAAA;QACD,2BAAmB;YACjB,IAAI,CAAC,WAAW,CAAC,eAAe,EAAE,CAAC;YACnC,MAAM,UAAU,GAAkB,EAAE,CAAC;YAErC,IAAI,IAAI,CAAC,WAAW,EAAE;gBACpB,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,0BAA0B,EAAE,CAAC,CAAC;aACpD;YACD,IAAI,CAAC,WAAW,CA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AAE,IAAI,EAAE,CAAC;SAC9B,CAAC;KACH;;;;YAnFJ,SAAS,SAAC;gBACT,QAAQ,EAAE,WAAW;gBACrB,kRAAsC;gBAEtC,eAAe,EAAE,uBAAuB,CAAC,MAAM;;aAChD;;;YAVgD,iBAAiB;;;mBAa/D,KAAK;mBAEL,KAAK;oBASL,KAAK;oBACL,KAAK;uBACL,KAAK;oBASL,KAAK;2BASL,KAAK,SAAC,aAAa;0BAKnB,MAAM;uBACN,MAAM;;;MC5BI,cAAc;;;YAf1B,QAAQ,SAAC;gBACR,OAAO,EAAE;oBACP,YAAY;oBACZ,WAAW;oBACX,mBAAmB;oBACnB,oBAAoB;oBACpB,kBAAkB;iBACnB;gBACD,YAAY,EAAE;oBACZ,QAAQ;iBACT;gBACD,OAAO,EAAE;oBACP,QAAQ;iBACT;aACF;;;ACrBD;;;;ACAA;;;;;;"}
@@ -1 +1 @@
1
- {"__symbolic":"module","version":4,"metadata":{"SdInputNumberModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":13,"character":1},"arguments":[{"declarations":[{"__symbolic":"reference","name":"SdInputNumber"}],"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":16,"character":4},{"__symbolic":"reference","module":"@angular/forms","name":"FormsModule","line":17,"character":4},{"__symbolic":"reference","module":"@angular/forms","name":"ReactiveFormsModule","line":18,"character":4},{"__symbolic":"reference","module":"@angular/material/form-field","name":"MatFormFieldModule","line":19,"character":4},{"__symbolic":"reference","module":"@angular/material/input","name":"MatInputModule","line":20,"character":4},{"__symbolic":"reference","module":"@angular/material/icon","name":"MatIconModule","line":21,"character":4},{"__symbolic":"reference","module":"@angular/material/tooltip","name":"MatTooltipModule","line":22,"character":4},{"__symbolic":"reference","module":"@sd-angular/core/translate","name":"SdTranslateModule","line":23,"character":4},{"__symbolic":"reference","module":"@sd-angular/core/common","name":"SdCommonModule","line":24,"character":4},{"__symbolic":"reference","module":"@sd-angular/core/popover","name":"SdPopoverModule","line":25,"character":4},{"__symbolic":"reference","module":"@angular/material/button","name":"MatButtonModule","line":26,"character":4}],"exports":[{"__symbolic":"reference","name":"SdInputNumber"}]}]}],"members":{}},"SdInputNumber":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":39,"character":1},"arguments":[{"selector":"sd-input-number","changeDetection":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectionStrategy","line":43,"character":19},"member":"OnPush"},"template":"<ng-container *ngIf=\"!appearance && sdLabelDef?.templateRef\">\r\n <ng-container *ngTemplateOutlet=\"sdLabelDef.templateRef\">\r\n </ng-container>\r\n</ng-container>\r\n<label *ngIf=\"!appearance && label && !sdLabelDef?.templateRef\" class=\"d-block mb-0 T14M\">{{label}} <span class=\"text-danger mb-2\"\r\n *ngIf=\"isRequired\">*</span></label>\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 && !isFocused; else default\">\r\n <ng-container *ngTemplateOutlet=\"sdView.templateRef;context: { value: formControl.value }\">\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 [appearance]=\"appearance || 'outline'\">\r\n <mat-label *ngIf=\"appearance && label\">{{label}}</mat-label>\r\n <input aria-hidden=\"true\" [id]=\"id\" [formControl]=\"inputControl\" #control matInput\r\n [placeholder]=\"placeholder || (appearance ? label : '')\" [errorStateMatcher]=\"matcher\"\r\n (keyup.enter)=\"onKeyupEnter()\" (focus)=\"onFocus()\" (blur)=\"onBlur()\" (keydown)=\"onKeydown($event)\"\r\n [required]=\"isRequired\" [readonly]=\"isReadonly\" [autocomplete]=\"id\" (paste)=\"onPaste($event)\" autocorrect=\"off\"\r\n [attr.data-qclabel]=\"label\" [attr.data-qcid]=\"qcId\"\r\n [sdPopoverTriggerFor]=\"null\" [sdPopoverDisabled]=\"!disableErrorMessage || formControl.valid\">\r\n <ng-container *ngIf=\"sdSuffix?.templateRef\" matSuffix>\r\n <ng-container *ngTemplateOutlet=\"sdSuffix.templateRef\">\r\n </ng-container>\r\n </ng-container>\r\n <svg \r\n #copyTooltip=\"matTooltip\" \r\n *ngIf=\"copyable\" \r\n matSuffix \r\n [matTooltip]=\"copied ? 'Copied' : 'Copy'\" \r\n class=\"icon-copy\" \r\n focusable=\"false\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 448 512\" \r\n (click)=\"onCopyText()\">\r\n <path 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 <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?.min\"> \r\n <ng-container *ngIf=\"!disableErrorMessage\">{{'Không nhập bé hơn '}} <strong>{{minNumber}}</strong></ng-container>\r\n </mat-error>\r\n <mat-error *ngIf=\"formControl.errors?.max\">\r\n <ng-container *ngIf=\"!disableErrorMessage\">{{'Không nhập lớn hơn '}} <strong>{{maxNumber}}</strong></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 #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 <span *ngIf=\"formControl.errors?.customValidator\">\r\n {{formControl.errors?.customValidator}}\r\n </span>\r\n</sd-popover> -->","styles":[":host ::ng-deep .mat-form-field.sd-form-tooltip{width:calc(100% - 30px)}: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}: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}.sd-tooltip{display:inline-block;margin:auto;text-align:center;width:30px}:host{display:block;padding-top:5px}.sd-md:hover .btn-copy{visibility:visible}.btn-copy{background:#e9e9e9!important;font-size:12px;line-height:26px!important;margin-bottom:3px;visibility:hidden}"]}]}],"members":{"name":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":48,"character":3}}]}],"size":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":53,"character":3}}]}],"form":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":55,"character":3}}]}],"_label":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":66,"character":3},"arguments":["label"]}]}],"placeholder":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":73,"character":3}}]}],"_disableErrorMessage":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":75,"character":3},"arguments":["disableErrorMessage"]}]}],"_blurOnEnter":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":79,"character":3},"arguments":["blurOnEnter"]}]}],"model":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":83,"character":3}}]}],"modelChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":101,"character":3}}]}],"required":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":105,"character":3}}]}],"type":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":109,"character":3}}]}],"precision":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":110,"character":3}}]}],"readonly":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":113,"character":3}}]}],"min":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":118,"character":3}}]}],"max":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":124,"character":3}}]}],"validator":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":130,"character":3}}]}],"_inlineError":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":136,"character":3},"arguments":["inlineError"]}]}],"disabled":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":141,"character":3}}]}],"appearance":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":151,"character":3}}]}],"copyTooltip":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":153,"character":3},"arguments":["copyTooltip"]}]}],"_copyable":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":155,"character":3},"arguments":["copyable"]}]}],"sdChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":160,"character":3}}]}],"sdFocus":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":161,"character":3}}]}],"sdFocusForceBlur":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":162,"character":3}}]}],"keyupEnter":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":163,"character":3}}]}],"control":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":165,"character":3},"arguments":["control"]}]}],"sdView":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChild","line":171,"character":3},"arguments":[{"__symbolic":"reference","module":"@sd-angular/core/common","name":"SdViewDefDirective","line":171,"character":16}]}]}],"sdSuffix":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChild","line":172,"character":3},"arguments":[{"__symbolic":"reference","module":"@sd-angular/core/common","name":"SdSuffixDirective","line":172,"character":16}]}]}],"sdLabelDef":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChild","line":173,"character":3},"arguments":[{"__symbolic":"reference","module":"@sd-angular/core/common","name":"SdLabelDefDirective","line":173,"character":16}]}]}],"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":177,"character":5},"arguments":[{"__symbolic":"reference","module":"@sd-angular/core/common","name":"FORM_CONFIG","line":177,"character":12}]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":177,"character":26}}]],"parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectorRef","line":176,"character":17},{"__symbolic":"reference","module":"@sd-angular/core/common","name":"IFormConfiguration","line":177,"character":57}]}],"ngOnInit":[{"__symbolic":"method"}],"ngAfterViewInit":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}],"customInlineErrorValidator":[{"__symbolic":"method"}],"onPaste":[{"__symbolic":"method"}],"onCopyText":[{"__symbolic":"method"}]}}},"origins":{"SdInputNumberModule":"./src/lib/input-number.module","SdInputNumber":"./src/lib/input-number.component"},"importAs":"@sd-angular/core/input-number"}
1
+ {"__symbolic":"module","version":4,"metadata":{"SdInputNumberModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":13,"character":1},"arguments":[{"declarations":[{"__symbolic":"reference","name":"SdInputNumber"}],"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":16,"character":4},{"__symbolic":"reference","module":"@angular/forms","name":"FormsModule","line":17,"character":4},{"__symbolic":"reference","module":"@angular/forms","name":"ReactiveFormsModule","line":18,"character":4},{"__symbolic":"reference","module":"@angular/material/form-field","name":"MatFormFieldModule","line":19,"character":4},{"__symbolic":"reference","module":"@angular/material/input","name":"MatInputModule","line":20,"character":4},{"__symbolic":"reference","module":"@angular/material/icon","name":"MatIconModule","line":21,"character":4},{"__symbolic":"reference","module":"@angular/material/tooltip","name":"MatTooltipModule","line":22,"character":4},{"__symbolic":"reference","module":"@sd-angular/core/translate","name":"SdTranslateModule","line":23,"character":4},{"__symbolic":"reference","module":"@sd-angular/core/common","name":"SdCommonModule","line":24,"character":4},{"__symbolic":"reference","module":"@sd-angular/core/popover","name":"SdPopoverModule","line":25,"character":4},{"__symbolic":"reference","module":"@angular/material/button","name":"MatButtonModule","line":26,"character":4}],"exports":[{"__symbolic":"reference","name":"SdInputNumber"}]}]}],"members":{}},"SdInputNumber":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":39,"character":1},"arguments":[{"selector":"sd-input-number","changeDetection":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectionStrategy","line":43,"character":19},"member":"OnPush"},"template":"<ng-container *ngIf=\"!appearance && sdLabelDef?.templateRef\">\r\n <ng-container *ngTemplateOutlet=\"sdLabelDef.templateRef\">\r\n </ng-container>\r\n</ng-container>\r\n<label *ngIf=\"!appearance && label && !sdLabelDef?.templateRef\" class=\"d-block mb-0 T14M\">{{label}} <span class=\"text-danger mb-2\"\r\n *ngIf=\"isRequired\">*</span></label>\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 && !isFocused; else default\">\r\n <ng-container *ngTemplateOutlet=\"sdView.templateRef;context: { value: formControl.value }\">\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 [appearance]=\"appearance || 'outline'\">\r\n <mat-label *ngIf=\"appearance && label\">{{label}}</mat-label>\r\n <input aria-hidden=\"true\" [id]=\"id\" [formControl]=\"inputControl\" #control matInput\r\n [placeholder]=\"placeholder || (appearance ? label : '')\" [errorStateMatcher]=\"matcher\"\r\n (keyup.enter)=\"onKeyupEnter()\" (focus)=\"onFocus()\" (blur)=\"onBlur()\" (keydown)=\"onKeydown($event)\"\r\n [required]=\"isRequired\" [readonly]=\"isReadonly\" [autocomplete]=\"id\" (paste)=\"onPaste($event)\" autocorrect=\"off\"\r\n [attr.data-qclabel]=\"label\" [attr.data-qcid]=\"qcId\"\r\n [sdPopoverTriggerFor]=\"null\" [sdPopoverDisabled]=\"!disableErrorMessage || formControl.valid\">\r\n <ng-container *ngIf=\"sdSuffix?.templateRef\" matSuffix>\r\n <ng-container *ngTemplateOutlet=\"sdSuffix.templateRef\">\r\n </ng-container>\r\n </ng-container>\r\n <svg \r\n #copyTooltip=\"matTooltip\" \r\n *ngIf=\"copyable\" \r\n matSuffix \r\n [matTooltip]=\"copied ? 'Copied' : 'Copy'\" \r\n class=\"icon-copy\" \r\n focusable=\"false\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 448 512\" \r\n (click)=\"onCopyText()\">\r\n <path 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 <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?.min\"> \r\n <ng-container *ngIf=\"!disableErrorMessage\">{{'Không nhập bé hơn '}} <strong>{{minNumber}}</strong></ng-container>\r\n </mat-error>\r\n <mat-error *ngIf=\"formControl.errors?.max\">\r\n <ng-container *ngIf=\"!disableErrorMessage\">{{'Không nhập lớn hơn '}} <strong>{{maxNumber}}</strong></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 #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 <span *ngIf=\"formControl.errors?.customValidator\">\r\n {{formControl.errors?.customValidator}}\r\n </span>\r\n</sd-popover> -->","styles":[":host ::ng-deep .mat-form-field.sd-form-tooltip{width:calc(100% - 30px)}: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}: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}.sd-tooltip{display:inline-block;margin:auto;text-align:center;width:30px}:host{display:block;padding-top:5px}.sd-md:hover .btn-copy{visibility:visible}.btn-copy{background:#e9e9e9!important;font-size:12px;line-height:26px!important;margin-bottom:3px;visibility:hidden}"]}]}],"members":{"name":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":48,"character":3}}]}],"size":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":53,"character":3}}]}],"form":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":55,"character":3}}]}],"_label":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":66,"character":3},"arguments":["label"]}]}],"placeholder":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":73,"character":3}}]}],"_disableErrorMessage":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":75,"character":3},"arguments":["disableErrorMessage"]}]}],"_blurOnEnter":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":79,"character":3},"arguments":["blurOnEnter"]}]}],"model":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":83,"character":3}}]}],"modelChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":101,"character":3}}]}],"required":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":105,"character":3}}]}],"type":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":109,"character":3}}]}],"precision":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":110,"character":3}}]}],"readonly":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":113,"character":3}}]}],"min":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":118,"character":3}}]}],"max":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":124,"character":3}}]}],"validator":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":130,"character":3}}]}],"_inlineError":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":136,"character":3},"arguments":["inlineError"]}]}],"disabled":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":141,"character":3}}]}],"appearance":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":151,"character":3}}]}],"copyTooltip":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":153,"character":3},"arguments":["copyTooltip"]}]}],"_copyable":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":155,"character":3},"arguments":["copyable"]}]}],"sdChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":160,"character":3}}]}],"sdFocus":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":161,"character":3}}]}],"sdBlur":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":162,"character":3}}]}],"sdFocusForceBlur":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":163,"character":3}}]}],"keyupEnter":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":164,"character":3}}]}],"control":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":166,"character":3},"arguments":["control"]}]}],"sdView":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChild","line":172,"character":3},"arguments":[{"__symbolic":"reference","module":"@sd-angular/core/common","name":"SdViewDefDirective","line":172,"character":16}]}]}],"sdSuffix":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChild","line":173,"character":3},"arguments":[{"__symbolic":"reference","module":"@sd-angular/core/common","name":"SdSuffixDirective","line":173,"character":16}]}]}],"sdLabelDef":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChild","line":174,"character":3},"arguments":[{"__symbolic":"reference","module":"@sd-angular/core/common","name":"SdLabelDefDirective","line":174,"character":16}]}]}],"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":178,"character":5},"arguments":[{"__symbolic":"reference","module":"@sd-angular/core/common","name":"FORM_CONFIG","line":178,"character":12}]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":178,"character":26}}]],"parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectorRef","line":177,"character":17},{"__symbolic":"reference","module":"@sd-angular/core/common","name":"IFormConfiguration","line":178,"character":57}]}],"ngOnInit":[{"__symbolic":"method"}],"ngAfterViewInit":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}],"customInlineErrorValidator":[{"__symbolic":"method"}],"onPaste":[{"__symbolic":"method"}],"onCopyText":[{"__symbolic":"method"}]}}},"origins":{"SdInputNumberModule":"./src/lib/input-number.module","SdInputNumber":"./src/lib/input-number.component"},"importAs":"@sd-angular/core/input-number"}
@@ -50,6 +50,7 @@ export declare class SdInputNumber implements OnDestroy, OnInit, AfterViewInit {
50
50
  copied: boolean;
51
51
  sdChange: EventEmitter<any>;
52
52
  sdFocus: EventEmitter<any>;
53
+ sdBlur: EventEmitter<any>;
53
54
  sdFocusForceBlur: EventEmitter<any>;
54
55
  keyupEnter: EventEmitter<any>;
55
56
  control: ElementRef;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sd-angular/core",
3
- "version": "1.3.214",
3
+ "version": "1.3.216",
4
4
  "homepage": "https://www.facebook.com/DarkP3ter",
5
5
  "author": {
6
6
  "name": "darkpeter",
@@ -1 +1 @@
1
- {"__symbolic":"module","version":4,"metadata":{"SdRadioModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":10,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":12,"character":4},{"__symbolic":"reference","module":"@angular/forms","name":"ReactiveFormsModule","line":13,"character":4},{"__symbolic":"reference","module":"@angular/material/tooltip","name":"MatTooltipModule","line":14,"character":4},{"__symbolic":"reference","module":"@angular/material/form-field","name":"MatFormFieldModule","line":15,"character":4},{"__symbolic":"reference","module":"@angular/material/icon","name":"MatIconModule","line":16,"character":4},{"__symbolic":"reference","module":"@angular/material/radio","name":"MatRadioModule","line":17,"character":4},{"__symbolic":"reference","module":"@sd-angular/core/translate","name":"SdTranslateModule","line":18,"character":4}],"declarations":[{"__symbolic":"reference","name":"SdRadio"}],"exports":[{"__symbolic":"reference","name":"SdRadio"}],"providers":[]}]}],"members":{}},"SdRadio":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":7,"character":1},"arguments":[{"selector":"sd-radio","changeDetection":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectionStrategy","line":11,"character":19},"member":"OnPush"},"template":"<section [ngClass]=\"{'c-section': display == 'row'}\">\r\n <ng-container *ngIf=\"sdLabelDef?.templateRef\">\r\n <ng-container *ngTemplateOutlet=\"sdLabelDef.templateRef\">\r\n </ng-container>\r\n </ng-container>\r\n <label *ngIf=\"label&&!sdLabelDef?.templateRef\" class=\"d-block T14M\" [class.mb-0]=\"display === 'row'\">{{label}} <span class=\"text-danger mb-2\" *ngIf=\"required\">*</span></label>\r\n <mat-radio-group [ngClass]=\"{'c-radio-group-column': display === 'column', 'c-radio-group-row': display === 'row'}\"\r\n [formControl]=\"formControl\">\r\n <mat-radio-button color=\"primary\" [ngClass]=\"{'m-0': display === 'column', 'mr-16': display === 'row'}\"\r\n *ngFor=\"let item of items\" [value]=\"item[valueField]\">\r\n {{item[displayField]}}\r\n </mat-radio-button>\r\n </mat-radio-group>\r\n</section>","styles":[":host{display:flex;flex-direction:column;height:100%}.c-section{align-content:center;align-items:center}.c-radio-group-column{align-items:flex-start;display:flex;flex:1;flex-direction:column}.c-radio-group-row{align-items:center;display:flex;flex:1;flex-direction:row}"]}]}],"members":{"name":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":15,"character":3}}]}],"form":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":35,"character":3}}]}],"label":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":44,"character":3}}]}],"placeholder":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":45,"character":3}}]}],"display":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":46,"character":3}}]}],"model":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":49,"character":3}}]}],"pItems":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":59,"character":3},"arguments":["items"]}]}],"valueField":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":65,"character":3}}]}],"displayField":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":66,"character":3}}]}],"required":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":70,"character":3}}]}],"disabled":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":75,"character":3}}]}],"sdLabelDef":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChild","line":83,"character":3},"arguments":[{"__symbolic":"reference","module":"@sd-angular/core/common","name":"SdLabelDefDirective","line":83,"character":16}]}]}],"modelChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":84,"character":3}}]}],"sdChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":85,"character":3}}]}],"sdSelection":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":86,"character":3}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectorRef","line":89,"character":16}]}],"ngOnInit":[{"__symbolic":"method"}],"ngAfterViewInit":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}]}}},"origins":{"SdRadioModule":"./src/lib/radio.module","SdRadio":"./src/lib/radio.component"},"importAs":"@sd-angular/core/radio"}
1
+ {"__symbolic":"module","version":4,"metadata":{"SdRadioModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":10,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":12,"character":4},{"__symbolic":"reference","module":"@angular/forms","name":"ReactiveFormsModule","line":13,"character":4},{"__symbolic":"reference","module":"@angular/material/tooltip","name":"MatTooltipModule","line":14,"character":4},{"__symbolic":"reference","module":"@angular/material/form-field","name":"MatFormFieldModule","line":15,"character":4},{"__symbolic":"reference","module":"@angular/material/icon","name":"MatIconModule","line":16,"character":4},{"__symbolic":"reference","module":"@angular/material/radio","name":"MatRadioModule","line":17,"character":4},{"__symbolic":"reference","module":"@sd-angular/core/translate","name":"SdTranslateModule","line":18,"character":4}],"declarations":[{"__symbolic":"reference","name":"SdRadio"}],"exports":[{"__symbolic":"reference","name":"SdRadio"}],"providers":[]}]}],"members":{}},"SdRadio":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":7,"character":1},"arguments":[{"selector":"sd-radio","changeDetection":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectionStrategy","line":11,"character":19},"member":"OnPush"},"template":"<section [ngClass]=\"{'c-section': display == 'row'}\">\r\n <ng-container *ngIf=\"sdLabelDef?.templateRef\">\r\n <ng-container *ngTemplateOutlet=\"sdLabelDef.templateRef\">\r\n </ng-container>\r\n </ng-container>\r\n <label *ngIf=\"label&&!sdLabelDef?.templateRef\" class=\"d-block T14M\" [class.mb-0]=\"display === 'row'\">{{label}} <span class=\"text-danger mb-2\" *ngIf=\"required\">*</span></label>\r\n <mat-radio-group [ngClass]=\"{'c-radio-group-column': display === 'column', 'c-radio-group-row': display === 'row'}\"\r\n [formControl]=\"formControl\">\r\n <mat-radio-button color=\"primary\" [ngClass]=\"{'m-0': display === 'column', 'mr-16': display === 'row'}\"\r\n *ngFor=\"let item of items\" [value]=\"item[valueField]\">\r\n {{item[displayField]}}\r\n </mat-radio-button>\r\n </mat-radio-group>\r\n \r\n <mat-error *ngIf=\"formControl.errors?.inlineError && formControl?.touched\">\r\n {{inlineError}}\r\n </mat-error>\r\n</section>","styles":[":host{display:flex;flex-direction:column;height:100%}.c-section{align-content:center;align-items:center}.c-radio-group-column{align-items:flex-start;display:flex;flex:1;flex-direction:column}.c-radio-group-row{align-items:center;display:flex;flex:1;flex-direction:row}"]}]}],"members":{"name":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":15,"character":3}}]}],"form":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":35,"character":3}}]}],"label":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":44,"character":3}}]}],"placeholder":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":45,"character":3}}]}],"display":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":46,"character":3}}]}],"model":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":49,"character":3}}]}],"pItems":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":59,"character":3},"arguments":["items"]}]}],"valueField":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":65,"character":3}}]}],"displayField":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":66,"character":3}}]}],"required":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":70,"character":3}}]}],"_inlineError":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":76,"character":3},"arguments":["inlineError"]}]}],"disabled":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":82,"character":3}}]}],"sdLabelDef":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChild","line":90,"character":3},"arguments":[{"__symbolic":"reference","module":"@sd-angular/core/common","name":"SdLabelDefDirective","line":90,"character":16}]}]}],"modelChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":91,"character":3}}]}],"sdChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":92,"character":3}}]}],"sdSelection":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":93,"character":3}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectorRef","line":96,"character":16}]}],"ngOnInit":[{"__symbolic":"method"}],"ngAfterViewInit":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}],"customInlineErrorValidator":[{"__symbolic":"method"}]}}},"origins":{"SdRadioModule":"./src/lib/radio.module","SdRadio":"./src/lib/radio.component"},"importAs":"@sd-angular/core/radio"}
@@ -1,5 +1,5 @@
1
1
  import { EventEmitter, ChangeDetectorRef, AfterViewInit, OnDestroy, OnInit } from '@angular/core';
2
- import { NgForm, FormGroup } from '@angular/forms';
2
+ import { NgForm, ValidatorFn, FormGroup } from '@angular/forms';
3
3
  import { SdLabelDefDirective } from '@sd-angular/core/common';
4
4
  import { SdFormControl } from '@sd-angular/core/common';
5
5
  export declare class SdRadio implements OnInit, AfterViewInit, OnDestroy {
@@ -17,6 +17,8 @@ export declare class SdRadio implements OnInit, AfterViewInit, OnDestroy {
17
17
  valueField: string;
18
18
  displayField: string;
19
19
  set required(val: boolean | '');
20
+ inlineError: string;
21
+ set _inlineError(val: string);
20
22
  set disabled(val: boolean | '');
21
23
  sdLabelDef: SdLabelDefDirective;
22
24
  modelChange: EventEmitter<any>;
@@ -29,5 +31,6 @@ export declare class SdRadio implements OnInit, AfterViewInit, OnDestroy {
29
31
  ngOnInit(): void;
30
32
  ngAfterViewInit(): void;
31
33
  ngOnDestroy(): void;
34
+ customInlineErrorValidator(): ValidatorFn;
32
35
  reValidate: () => void;
33
36
  }
@@ -1 +1 @@
1
- {"__symbolic":"module","version":4,"metadata":{"SdSwitchModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":6,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":8,"character":4},{"__symbolic":"reference","module":"@angular/forms","name":"FormsModule","line":9,"character":4},{"__symbolic":"reference","module":"@angular/forms","name":"ReactiveFormsModule","line":10,"character":4},{"__symbolic":"reference","module":"@angular/material/slide-toggle","name":"MatSlideToggleModule","line":11,"character":4}],"declarations":[{"__symbolic":"reference","name":"SdSwitch"}],"exports":[{"__symbolic":"reference","name":"SdSwitch"}]}]}],"members":{}},"SdSwitch":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":5,"character":1},"arguments":[{"selector":"sd-switch","changeDetection":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectionStrategy","line":9,"character":19},"member":"OnPush"},"template":"<mat-slide-toggle [formControl]=\"formControl\" [color]=\"color\"><span\r\n class=\"c-label\">{{label}}</span></mat-slide-toggle>","styles":[""]}]}],"members":{"size":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":13,"character":3}}]}],"form":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":15,"character":3}}]}],"label":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":24,"character":3}}]}],"color":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":25,"character":3}}]}],"disabled":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":26,"character":3}}]}],"model":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":35,"character":3}}]}],"modelChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":43,"character":3}}]}],"sdChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":44,"character":3}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectorRef","line":47,"character":27}]}],"ngOnInit":[{"__symbolic":"method"}],"ngAfterViewInit":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}]}}},"origins":{"SdSwitchModule":"./src/lib/switch.module","SdSwitch":"./src/lib/switch.component"},"importAs":"@sd-angular/core/switch"}
1
+ {"__symbolic":"module","version":4,"metadata":{"SdSwitchModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":7,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":9,"character":4},{"__symbolic":"reference","module":"@angular/forms","name":"FormsModule","line":10,"character":4},{"__symbolic":"reference","module":"@angular/forms","name":"ReactiveFormsModule","line":11,"character":4},{"__symbolic":"reference","module":"@angular/material/slide-toggle","name":"MatSlideToggleModule","line":12,"character":4},{"__symbolic":"reference","module":"@angular/material/form-field","name":"MatFormFieldModule","line":13,"character":4}],"declarations":[{"__symbolic":"reference","name":"SdSwitch"}],"exports":[{"__symbolic":"reference","name":"SdSwitch"}]}]}],"members":{}},"SdSwitch":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":5,"character":1},"arguments":[{"selector":"sd-switch","changeDetection":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectionStrategy","line":9,"character":19},"member":"OnPush"},"template":"<mat-slide-toggle [formControl]=\"formControl\" [color]=\"color\"><span\r\n class=\"c-label\">{{label}}</span></mat-slide-toggle>\r\n <mat-error *ngIf=\"formControl.errors?.inlineError && formControl?.touched\">\r\n {{inlineError}}\r\n </mat-error>","styles":[""]}]}],"members":{"size":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":13,"character":3}}]}],"form":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":15,"character":3}}]}],"label":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":24,"character":3}}]}],"color":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":25,"character":3}}]}],"disabled":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":26,"character":3}}]}],"model":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":35,"character":3}}]}],"_inlineError":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":44,"character":3},"arguments":["inlineError"]}]}],"modelChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":49,"character":3}}]}],"sdChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":50,"character":3}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectorRef","line":53,"character":27}]}],"ngOnInit":[{"__symbolic":"method"}],"ngAfterViewInit":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}],"customInlineErrorValidator":[{"__symbolic":"method"}]}}},"origins":{"SdSwitchModule":"./src/lib/switch.module","SdSwitch":"./src/lib/switch.component"},"importAs":"@sd-angular/core/switch"}