@sixbell-telco/sdk 0.3.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +53 -0
- package/README.md +96 -55
- package/assets/styles/combobox.scss +17 -17
- package/components/accordion/accordion-item/accordion-item.component.d.ts +1 -2
- package/components/avatar/src/avatar.component.d.ts +11 -18
- package/components/button/src/button.component.d.ts +12 -19
- package/components/card/card-actions/card-actions.component.d.ts +8 -0
- package/components/card/card-content/card-content.component.d.ts +5 -0
- package/components/card/card-title/card-title.component.d.ts +5 -0
- package/components/card/public-api.d.ts +3 -0
- package/components/card/src/card.component.d.ts +19 -20
- package/components/countdown/src/countdown.component.d.ts +6 -1
- package/components/dropdown/dropdown-item/dropdown-item.component.d.ts +10 -0
- package/components/dropdown/public-api.d.ts +1 -0
- package/components/dropdown/src/dropdown.component.d.ts +24 -42
- package/components/file-upload/file-uploader/src/file-uploader.component.d.ts +2 -5
- package/components/forms/checkbox/src/checkbox.component.d.ts +2 -3
- package/components/forms/input/src/input.component.d.ts +7 -8
- package/components/forms/radio/src/radio.component.d.ts +2 -6
- package/components/forms/select/src/select.component.d.ts +5 -8
- package/components/forms/textarea/src/textarea.component.d.ts +5 -11
- package/components/link/src/link.component.d.ts +18 -45
- package/components/modal/modal-actions/modal-actions.component.d.ts +8 -0
- package/components/modal/modal-content/modal-content.component.d.ts +5 -0
- package/components/modal/modal-title/modal-title.component.d.ts +5 -0
- package/components/modal/public-api.d.ts +3 -0
- package/components/modal/src/modal.component.d.ts +9 -13
- package/components/product-card/src/product-card.component.d.ts +5 -9
- package/components/tab/src/tab.component.d.ts +1 -2
- package/directives/click-outside/index.d.ts +5 -0
- package/directives/click-outside/public-api.d.ts +1 -0
- package/directives/click-outside/src/click-outside.directive.d.ts +10 -0
- package/directives/typography/src/typography.directive.d.ts +3 -4
- package/esm2022/components/accordion/accordion-item/accordion-item.component.mjs +5 -6
- package/esm2022/components/avatar/src/avatar.component.mjs +27 -43
- package/esm2022/components/button/src/button.component.mjs +12 -22
- package/esm2022/components/card/card-actions/card-actions.component.mjs +22 -0
- package/esm2022/components/card/card-content/card-content.component.mjs +12 -0
- package/esm2022/components/card/card-title/card-title.component.mjs +12 -0
- package/esm2022/components/card/public-api.mjs +4 -1
- package/esm2022/components/card/src/card.component.mjs +20 -45
- package/esm2022/components/countdown/src/countdown.component.mjs +10 -3
- package/esm2022/components/dropdown/dropdown-item/dropdown-item.component.mjs +24 -0
- package/esm2022/components/dropdown/public-api.mjs +2 -1
- package/esm2022/components/dropdown/src/dropdown.component.mjs +65 -101
- package/esm2022/components/dual-list/src/dual-list.component.mjs +3 -3
- package/esm2022/components/file-upload/file-dropzone/src/file-dropzone.component.mjs +3 -3
- package/esm2022/components/file-upload/file-uploader/src/file-uploader.component.mjs +3 -7
- package/esm2022/components/forms/checkbox/src/checkbox.component.mjs +9 -8
- package/esm2022/components/forms/combobox/src/combobox.component.mjs +3 -3
- package/esm2022/components/forms/datepicker/src/datepicker.component.mjs +2 -2
- package/esm2022/components/forms/form-error/src/form-error.component.mjs +3 -3
- package/esm2022/components/forms/input/src/input.component.mjs +51 -45
- package/esm2022/components/forms/radio/src/radio.component.mjs +5 -18
- package/esm2022/components/forms/range/src/range.component.mjs +3 -3
- package/esm2022/components/forms/select/src/select.component.mjs +24 -34
- package/esm2022/components/forms/switch/src/switch.component.mjs +3 -3
- package/esm2022/components/forms/textarea/src/textarea.component.mjs +35 -48
- package/esm2022/components/forms/toggle/src/toggle.component.mjs +3 -3
- package/esm2022/components/link/src/link.component.mjs +27 -183
- package/esm2022/components/modal/modal-actions/modal-actions.component.mjs +22 -0
- package/esm2022/components/modal/modal-content/modal-content.component.mjs +12 -0
- package/esm2022/components/modal/modal-title/modal-title.component.mjs +13 -0
- package/esm2022/components/modal/public-api.mjs +4 -1
- package/esm2022/components/modal/src/modal.component.mjs +31 -31
- package/esm2022/components/notification/src/notification.component.mjs +2 -5
- package/esm2022/components/paginator/components/pagination-item/pagination-item.component.mjs +24 -24
- package/esm2022/components/product-card/src/product-card.component.mjs +5 -14
- package/esm2022/components/progress/src/progress.component.mjs +3 -3
- package/esm2022/components/tab/src/tab.component.mjs +2 -4
- package/esm2022/components/table/src/table.component.mjs +4 -4
- package/esm2022/components/table/table-header-checkbox/table-header-checkbox.component.mjs +1 -1
- package/esm2022/components/table/table-row-checkbox/table-row-checkbox.component.mjs +1 -1
- package/esm2022/components/toast/toast-message/toast-message.component.mjs +4 -4
- package/esm2022/components/wizard/wizard-marker/wizard-marker.component.mjs +4 -4
- package/esm2022/components/wizard/wizard-step/wizard-step.component.mjs +3 -3
- package/esm2022/components/wizard/wizard-wrapper/wizard-wrapper.component.mjs +3 -3
- package/esm2022/directives/click-outside/public-api.mjs +2 -0
- package/esm2022/directives/click-outside/sixbell-telco-sdk-directives-click-outside.mjs +5 -0
- package/esm2022/directives/click-outside/src/click-outside.directive.mjs +30 -0
- package/esm2022/directives/typography/src/typography.directive.mjs +19 -18
- package/fesm2022/sixbell-telco-sdk-components-accordion.mjs +4 -5
- package/fesm2022/sixbell-telco-sdk-components-accordion.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-avatar.mjs +26 -42
- package/fesm2022/sixbell-telco-sdk-components-avatar.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-button.mjs +11 -21
- package/fesm2022/sixbell-telco-sdk-components-button.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-card.mjs +57 -46
- package/fesm2022/sixbell-telco-sdk-components-card.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-countdown.mjs +9 -2
- package/fesm2022/sixbell-telco-sdk-components-countdown.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dropdown.mjs +86 -101
- package/fesm2022/sixbell-telco-sdk-components-dropdown.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dual-list.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-dual-list.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-file-upload-file-dropzone.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-file-upload-file-dropzone.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-file-upload-file-uploader.mjs +2 -6
- package/fesm2022/sixbell-telco-sdk-components-file-upload-file-uploader.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-checkbox.mjs +8 -7
- package/fesm2022/sixbell-telco-sdk-components-forms-checkbox.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-combobox.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-forms-combobox.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-datepicker.mjs +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-datepicker.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-form-error.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-forms-form-error.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-input.mjs +51 -45
- package/fesm2022/sixbell-telco-sdk-components-forms-input.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-radio.mjs +4 -17
- package/fesm2022/sixbell-telco-sdk-components-forms-radio.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-range.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-forms-range.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-select.mjs +23 -33
- package/fesm2022/sixbell-telco-sdk-components-forms-select.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-switch.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-forms-switch.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-textarea.mjs +34 -47
- package/fesm2022/sixbell-telco-sdk-components-forms-textarea.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-toggle.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-forms-toggle.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-link.mjs +27 -183
- package/fesm2022/sixbell-telco-sdk-components-link.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-modal.mjs +71 -33
- package/fesm2022/sixbell-telco-sdk-components-modal.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-notification.mjs +1 -4
- package/fesm2022/sixbell-telco-sdk-components-notification.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-paginator.mjs +23 -23
- package/fesm2022/sixbell-telco-sdk-components-paginator.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-product-card.mjs +4 -13
- package/fesm2022/sixbell-telco-sdk-components-product-card.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-progress.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-progress.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-tab.mjs +1 -3
- package/fesm2022/sixbell-telco-sdk-components-tab.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-table.mjs +5 -5
- package/fesm2022/sixbell-telco-sdk-components-table.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-toast.mjs +3 -3
- package/fesm2022/sixbell-telco-sdk-components-toast.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-wizard.mjs +7 -7
- package/fesm2022/sixbell-telco-sdk-components-wizard.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-directives-click-outside.mjs +37 -0
- package/fesm2022/sixbell-telco-sdk-directives-click-outside.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-directives-typography.mjs +18 -17
- package/fesm2022/sixbell-telco-sdk-directives-typography.mjs.map +1 -1
- package/package.json +31 -25
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sixbell-telco-sdk-components-forms-radio.mjs","sources":["../../../projects/sdk/components/forms/radio/src/radio.component.ts","../../../projects/sdk/components/forms/radio/src/radio.component.html","../../../projects/sdk/components/forms/radio/sixbell-telco-sdk-components-forms-radio.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { ChangeDetectionStrategy, Component, input, model, output } from '@angular/core';\nimport { ControlValueAccessor, FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { TypographyDirective } from '@sixbell-telco/sdk/directives/typography';\nimport { cn } from '@sixbell-telco/sdk/utils/cn';\nimport { cva } from 'class-variance-authority';\n\nconst radioComponent = cva(['radio'], {\n\tvariants: {\n\t\tvariant: {\n\t\t\tprimary: ['radio-primary'],\n\t\t\tsecondary: ['radio-secondary'],\n\t\t\
|
|
1
|
+
{"version":3,"file":"sixbell-telco-sdk-components-forms-radio.mjs","sources":["../../../projects/sdk/components/forms/radio/src/radio.component.ts","../../../projects/sdk/components/forms/radio/src/radio.component.html","../../../projects/sdk/components/forms/radio/sixbell-telco-sdk-components-forms-radio.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { ChangeDetectionStrategy, Component, input, model, output } from '@angular/core';\nimport { ControlValueAccessor, FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { TypographyDirective } from '@sixbell-telco/sdk/directives/typography';\nimport { cn } from '@sixbell-telco/sdk/utils/cn';\nimport { cva } from 'class-variance-authority';\n\nconst radioComponent = cva(['radio'], {\n\tvariants: {\n\t\tvariant: {\n\t\t\tprimary: ['radio-primary'],\n\t\t\tsecondary: ['radio-secondary'],\n\t\t\ttertiary: ['radio-tertiary'],\n\t\t\taccent: ['radio-accent'],\n\t\t\tsuccess: ['radio-success'],\n\t\t\twarning: ['radio-warning'],\n\t\t\tinfo: ['radio-info'],\n\t\t\terror: ['radio-error'],\n\t\t},\n\t\tsize: {\n\t\t\txs: ['radio-xs'],\n\t\t\tsm: ['radio-sm'],\n\t\t\tmd: ['radio-md'],\n\t\t\tlg: ['radio-lg'],\n\t\t},\n\t},\n\tcompoundVariants: [],\n\tdefaultVariants: {\n\t\tvariant: 'primary',\n\t\tsize: 'md',\n\t},\n});\n\nexport type RadioVariantProps = 'primary' | 'secondary' | 'tertiary' | 'accent' | 'success' | 'warning' | 'info' | 'error' | null | undefined;\nexport type RadioSizeProps = 'xs' | 'sm' | 'md' | 'lg' | null | undefined;\n\nexport type RadioProps = {\n\tvariant?: RadioVariantProps;\n\tsize?: RadioSizeProps;\n};\n\n@Component({\n\tselector: 'st-radio',\n\tstandalone: true,\n\timports: [FormsModule, TypographyDirective],\n\tproviders: [\n\t\t{\n\t\t\tprovide: NG_VALUE_ACCESSOR,\n\t\t\tuseExisting: RadioComponent,\n\t\t\tmulti: true,\n\t\t},\n\t],\n\ttemplateUrl: './radio.component.html',\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class RadioComponent implements ControlValueAccessor {\n\t// Base radio properties\n\tvariant = input<RadioVariantProps>();\n\tsize = input<RadioSizeProps>();\n\tlabel = input<string>('');\n\tname = input<string | null>(null);\n\n\t// Radio value model\n\tvalue = input.required();\n\tselected = model();\n\n\t// ControlValueAccessor attributes\n\tprivate onControlChange: any = () => {};\n\tprivate onControlTouch: any = () => {};\n\tdisabled = model<boolean>(false);\n\n\t// ControlValueAccessor methods\n\twriteValue(obj: any): void {\n\t\tthis.selected.set(obj);\n\t}\n\n\tregisterOnChange(fn: any): void {\n\t\tthis.onControlChange = fn;\n\t}\n\n\tregisterOnTouched(fn: any): void {\n\t\tthis.onControlTouch = fn;\n\t}\n\n\tsetDisabledState?(isDisabled: boolean): void {\n\t\tthis.disabled.set(isDisabled);\n\t}\n\n\t// Change handler\n\tonChange = output<any>();\n\thandleChange(): void {\n\t\tthis.onControlChange(this.value());\n\t\tthis.onChange.emit(this.value());\n\t\tthis.selected.set(this.value());\n\t}\n\n\t// Blur handler\n\thandleBlur() {\n\t\tthis.onControlTouch();\n\t}\n\n\t// classes\n\tget componentClass() {\n\t\treturn cn(\n\t\t\tradioComponent({\n\t\t\t\tvariant: this.variant(),\n\t\t\t\tsize: this.size(),\n\t\t\t}),\n\t\t);\n\t}\n}\n","<label class=\"mb-2 flex cursor-pointer items-center justify-start gap-4\">\n\t<input\n\t\ttype=\"radio\"\n\t\t[class]=\"componentClass\"\n\t\t[value]=\"value()\"\n\t\t[checked]=\"selected() === value()\"\n\t\t[disabled]=\"disabled()\"\n\t\t[attr.name]=\"name()\"\n\t\t(change)=\"handleChange()\"\n\t\t(blur)=\"handleBlur()\"\n\t/>\n\t<span typography [tyVariant]=\"'body'\" [tyColor]=\"'base'\">{{ label() }}</span>\n</label>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;AAAA;AAOA,MAAM,cAAc,GAAG,GAAG,CAAC,CAAC,OAAO,CAAC,EAAE;AACrC,IAAA,QAAQ,EAAE;AACT,QAAA,OAAO,EAAE;YACR,OAAO,EAAE,CAAC,eAAe,CAAC;YAC1B,SAAS,EAAE,CAAC,iBAAiB,CAAC;YAC9B,QAAQ,EAAE,CAAC,gBAAgB,CAAC;YAC5B,MAAM,EAAE,CAAC,cAAc,CAAC;YACxB,OAAO,EAAE,CAAC,eAAe,CAAC;YAC1B,OAAO,EAAE,CAAC,eAAe,CAAC;YAC1B,IAAI,EAAE,CAAC,YAAY,CAAC;YACpB,KAAK,EAAE,CAAC,aAAa,CAAC;AACtB,SAAA;AACD,QAAA,IAAI,EAAE;YACL,EAAE,EAAE,CAAC,UAAU,CAAC;YAChB,EAAE,EAAE,CAAC,UAAU,CAAC;YAChB,EAAE,EAAE,CAAC,UAAU,CAAC;YAChB,EAAE,EAAE,CAAC,UAAU,CAAC;AAChB,SAAA;AACD,KAAA;AACD,IAAA,gBAAgB,EAAE,EAAE;AACpB,IAAA,eAAe,EAAE;AAChB,QAAA,OAAO,EAAE,SAAS;AAClB,QAAA,IAAI,EAAE,IAAI;AACV,KAAA;AACD,CAAA,CAAC,CAAC;MAwBU,cAAc,CAAA;;IAE1B,OAAO,GAAG,KAAK,EAAqB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|
|
|
89
89
|
useExisting: RangeComponent,
|
|
90
90
|
multi: true,
|
|
91
91
|
},
|
|
92
|
-
], ngImport: i0, template: "@if (label()) {\n\t<label [for]=\"this.name()\">\n\t\t<span typography [
|
|
92
|
+
], ngImport: i0, template: "@if (label()) {\n\t<label [for]=\"this.name()\">\n\t\t<span typography [tyVariant]=\"'body'\" [tyColor]=\"'base'\" [tyFontWeight]=\"'normal'\">{{ label() }}</span>\n\t</label>\n}\n\n@if (showRange()) {\n\t<div class=\"flex justify-between\">\n\t\t<span typography [tyVariant]=\"'body-sm'\">{{ min() }}</span>\n\t\t<span typography [tyVariant]=\"'body-sm'\">{{ max() }}</span>\n\t</div>\n}\n\n<input\n\t[class]=\"componentClass\"\n\t[attr.name]=\"name()\"\n\ttype=\"range\"\n\t[min]=\"min()\"\n\t[max]=\"max()\"\n\t[step]=\"jumpSize()\"\n\t[value]=\"value()\"\n\t[(ngModel)]=\"value\"\n\t[disabled]=\"disabled()\"\n\t(ngModelChange)=\"handleChange()\"\n/>\n\n@if (steps() > 0) {\n\t<div class=\"flex w-full justify-between px-2 text-xs\">\n\t\t@for (step of stepsQuantity(); track $index) {\n\t\t\t<span>|</span>\n\t\t}\n\t</div>\n}\n", dependencies: [{ kind: "directive", type: TypographyDirective, selector: "[typography]", inputs: ["tyVariant", "tyColor", "tyFontWeight"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.RangeValueAccessor, selector: "input[type=range][formControlName],input[type=range][formControl],input[type=range][ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
93
93
|
}
|
|
94
94
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: RangeComponent, decorators: [{
|
|
95
95
|
type: Component,
|
|
@@ -99,7 +99,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImpo
|
|
|
99
99
|
useExisting: RangeComponent,
|
|
100
100
|
multi: true,
|
|
101
101
|
},
|
|
102
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (label()) {\n\t<label [for]=\"this.name()\">\n\t\t<span typography [
|
|
102
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (label()) {\n\t<label [for]=\"this.name()\">\n\t\t<span typography [tyVariant]=\"'body'\" [tyColor]=\"'base'\" [tyFontWeight]=\"'normal'\">{{ label() }}</span>\n\t</label>\n}\n\n@if (showRange()) {\n\t<div class=\"flex justify-between\">\n\t\t<span typography [tyVariant]=\"'body-sm'\">{{ min() }}</span>\n\t\t<span typography [tyVariant]=\"'body-sm'\">{{ max() }}</span>\n\t</div>\n}\n\n<input\n\t[class]=\"componentClass\"\n\t[attr.name]=\"name()\"\n\ttype=\"range\"\n\t[min]=\"min()\"\n\t[max]=\"max()\"\n\t[step]=\"jumpSize()\"\n\t[value]=\"value()\"\n\t[(ngModel)]=\"value\"\n\t[disabled]=\"disabled()\"\n\t(ngModelChange)=\"handleChange()\"\n/>\n\n@if (steps() > 0) {\n\t<div class=\"flex w-full justify-between px-2 text-xs\">\n\t\t@for (step of stepsQuantity(); track $index) {\n\t\t\t<span>|</span>\n\t\t}\n\t</div>\n}\n" }]
|
|
103
103
|
}] });
|
|
104
104
|
|
|
105
105
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sixbell-telco-sdk-components-forms-range.mjs","sources":["../../../projects/sdk/components/forms/range/src/range.component.ts","../../../projects/sdk/components/forms/range/src/range.component.html","../../../projects/sdk/components/forms/range/sixbell-telco-sdk-components-forms-range.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { ChangeDetectionStrategy, Component, computed, input, model, output } from '@angular/core';\nimport { ControlValueAccessor, FormControl, FormGroup, FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { TypographyDirective } from '@sixbell-telco/sdk/directives/typography';\nimport { cn } from '@sixbell-telco/sdk/utils/cn';\nimport { cva } from 'class-variance-authority';\n\nconst rangeComponent = cva(['range'], {\n\tvariants: {\n\t\tvariant: {\n\t\t\tprimary: ['range-primary'],\n\t\t\tsecondary: ['range-secondary'],\n\t\t\tsuccess: ['range-success'],\n\t\t\tinfo: ['range-info'],\n\t\t\terror: ['range-error'],\n\t\t\twarning: ['range-warning'],\n\t\t\taccent: ['range-accent'],\n\t\t},\n\t\tsize: {\n\t\t\txs: ['range-xs'],\n\t\t\tsm: ['range-sm'],\n\t\t\tmd: ['range-md'],\n\t\t\tlg: ['range-mlg'],\n\t\t},\n\t},\n\tcompoundVariants: [],\n\tdefaultVariants: {\n\t\tvariant: 'primary',\n\t\tsize: 'xs',\n\t},\n});\n\nexport type RangeVariantProps = 'primary' | 'secondary' | 'success' | 'info' | 'error' | 'warning' | 'accent' | null | undefined;\nexport type RangeSizeProps = 'xs' | 'sm' | 'md' | 'lg' | null | undefined;\n\nexport type RangeProps = {\n\tvariant?: RangeVariantProps;\n\tsize?: RangeSizeProps;\n};\n\n@Component({\n\tselector: 'st-range',\n\ttemplateUrl: './range.component.html',\n\tstandalone: true,\n\timports: [TypographyDirective, FormsModule],\n\tproviders: [\n\t\t{\n\t\t\tprovide: NG_VALUE_ACCESSOR,\n\t\t\tuseExisting: RangeComponent,\n\t\t\tmulti: true,\n\t\t},\n\t],\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class RangeComponent implements ControlValueAccessor {\n\tvariant = input<RangeVariantProps>();\n\tsize = input<RangeSizeProps>();\n\tclasses = input<string>('');\n\tlabel = input<string>('');\n\tname = input<string | null>(null);\n\tmin = input<number>(0);\n\tmax = input<number>(100);\n\tshowRange = input<boolean>(true);\n\n\tsteps = input<number>(0);\n\tstepsQuantity = computed(() => Array.from({ length: this.steps() + 1 }));\n\tjumpSize = computed(() => (this.max() - this.min()) / this.steps());\n\n\tvalue = model<number>(0);\n\n\t// Form control properties\n\tparentForm = input<FormGroup | null>(null);\n\tformControlName = input<string>('');\n\n\tget formField(): FormControl | null {\n\t\tif (!this.parentForm()) return null;\n\t\treturn this.parentForm()?.get(this.formControlName()) as FormControl;\n\t}\n\n\t// ControlValueAccessor attributes\n\tprivate onControlChange: any = () => {};\n\tprivate onControlTouch: any = () => {};\n\tdisabled = model<boolean>(false);\n\n\t// ControlValueAccessor methods\n\twriteValue(obj: any): void {\n\t\tthis.value.set(obj);\n\t}\n\n\tregisterOnChange(fn: any): void {\n\t\tthis.onControlChange = fn;\n\t}\n\n\tregisterOnTouched(fn: any): void {\n\t\tthis.onControlTouch = fn;\n\t}\n\n\tsetDisabledState(isDisabled: boolean): void {\n\t\tthis.disabled.set(isDisabled);\n\t}\n\n\t// Change handler\n\tonChange = output<number>();\n\thandleChange() {\n\t\tthis.onControlChange(this.value());\n\t\tthis.onChange.emit(this.value());\n\t}\n\n\tget componentClass() {\n\t\treturn cn(\n\t\t\trangeComponent({\n\t\t\t\tvariant: this.variant(),\n\t\t\t\tsize: this.size(),\n\t\t\t\tclass: this.classes(),\n\t\t\t}),\n\t\t);\n\t}\n}\n","@if (label()) {\n\t<label [for]=\"this.name()\">\n\t\t<span typography [typographyVariant]=\"'body'\" [typographyColor]=\"'black'\" [typographyFontWeight]=\"'normal'\">{{ label() }}</span>\n\t</label>\n}\n\n@if (showRange()) {\n\t<div class=\"flex justify-between\">\n\t\t<span typography [typographyVariant]=\"'body-sm'\">{{ min() }}</span>\n\t\t<span typography [typographyVariant]=\"'body-sm'\">{{ max() }}</span>\n\t</div>\n}\n\n<input\n\t[class]=\"componentClass\"\n\t[attr.name]=\"name()\"\n\ttype=\"range\"\n\t[min]=\"min()\"\n\t[max]=\"max()\"\n\t[step]=\"jumpSize()\"\n\t[value]=\"value()\"\n\t[(ngModel)]=\"value\"\n\t[disabled]=\"disabled()\"\n\t(ngModelChange)=\"handleChange()\"\n/>\n\n@if (steps() > 0) {\n\t<div class=\"flex w-full justify-between px-2 text-xs\">\n\t\t@for (step of stepsQuantity(); track $index) {\n\t\t\t<span>|</span>\n\t\t}\n\t</div>\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;AAAA;AAOA,MAAM,cAAc,GAAG,GAAG,CAAC,CAAC,OAAO,CAAC,EAAE;AACrC,IAAA,QAAQ,EAAE;AACT,QAAA,OAAO,EAAE;YACR,OAAO,EAAE,CAAC,eAAe,CAAC;YAC1B,SAAS,EAAE,CAAC,iBAAiB,CAAC;YAC9B,OAAO,EAAE,CAAC,eAAe,CAAC;YAC1B,IAAI,EAAE,CAAC,YAAY,CAAC;YACpB,KAAK,EAAE,CAAC,aAAa,CAAC;YACtB,OAAO,EAAE,CAAC,eAAe,CAAC;YAC1B,MAAM,EAAE,CAAC,cAAc,CAAC;AACxB,SAAA;AACD,QAAA,IAAI,EAAE;YACL,EAAE,EAAE,CAAC,UAAU,CAAC;YAChB,EAAE,EAAE,CAAC,UAAU,CAAC;YAChB,EAAE,EAAE,CAAC,UAAU,CAAC;YAChB,EAAE,EAAE,CAAC,WAAW,CAAC;AACjB,SAAA;AACD,KAAA;AACD,IAAA,gBAAgB,EAAE,EAAE;AACpB,IAAA,eAAe,EAAE;AAChB,QAAA,OAAO,EAAE,SAAS;AAClB,QAAA,IAAI,EAAE,IAAI;AACV,KAAA;AACD,CAAA,CAAC,CAAC;MAwBU,cAAc,CAAA;IAC1B,OAAO,GAAG,KAAK,EAAqB,CAAC;IACrC,IAAI,GAAG,KAAK,EAAkB,CAAC;AAC/B,IAAA,OAAO,GAAG,KAA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,kBAAA,EAAA,QAAA,EAAA,8FAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,eAAA,EAAA,QAAA,EAAA,2CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,OAAA,EAAA,QAAA,EAAA,qDAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,UAAA,EAAA,SAAA,EAAA,gBAAA,CAAA,EAAA,OAAA,EAAA,CAAA,eAAA,CAAA,EAAA,QAAA,EAAA,CAAA,SAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;4FAU9B,cAAc,EAAA,UAAA,EAAA,CAAA;kBAd1B,SAAS;+BACC,UAAU,EAAA,UAAA,EAER,IAAI,EACP,OAAA,EAAA,CAAC,mBAAmB,EAAE,WAAW,CAAC,EAChC,SAAA,EAAA;AACV,wBAAA;AACC,4BAAA,OAAO,EAAE,iBAAiB;AAC1B,4BAAA,WAAW,EAAgB,cAAA;AAC3B,4BAAA,KAAK,EAAE,IAAI;AACX,yBAAA;qBACD,EACgB,eAAA,EAAA,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,42BAAA,EAAA,CAAA;;;AEpDhD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"sixbell-telco-sdk-components-forms-range.mjs","sources":["../../../projects/sdk/components/forms/range/src/range.component.ts","../../../projects/sdk/components/forms/range/src/range.component.html","../../../projects/sdk/components/forms/range/sixbell-telco-sdk-components-forms-range.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { ChangeDetectionStrategy, Component, computed, input, model, output } from '@angular/core';\nimport { ControlValueAccessor, FormControl, FormGroup, FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { TypographyDirective } from '@sixbell-telco/sdk/directives/typography';\nimport { cn } from '@sixbell-telco/sdk/utils/cn';\nimport { cva } from 'class-variance-authority';\n\nconst rangeComponent = cva(['range'], {\n\tvariants: {\n\t\tvariant: {\n\t\t\tprimary: ['range-primary'],\n\t\t\tsecondary: ['range-secondary'],\n\t\t\tsuccess: ['range-success'],\n\t\t\tinfo: ['range-info'],\n\t\t\terror: ['range-error'],\n\t\t\twarning: ['range-warning'],\n\t\t\taccent: ['range-accent'],\n\t\t},\n\t\tsize: {\n\t\t\txs: ['range-xs'],\n\t\t\tsm: ['range-sm'],\n\t\t\tmd: ['range-md'],\n\t\t\tlg: ['range-mlg'],\n\t\t},\n\t},\n\tcompoundVariants: [],\n\tdefaultVariants: {\n\t\tvariant: 'primary',\n\t\tsize: 'xs',\n\t},\n});\n\nexport type RangeVariantProps = 'primary' | 'secondary' | 'success' | 'info' | 'error' | 'warning' | 'accent' | null | undefined;\nexport type RangeSizeProps = 'xs' | 'sm' | 'md' | 'lg' | null | undefined;\n\nexport type RangeProps = {\n\tvariant?: RangeVariantProps;\n\tsize?: RangeSizeProps;\n};\n\n@Component({\n\tselector: 'st-range',\n\ttemplateUrl: './range.component.html',\n\tstandalone: true,\n\timports: [TypographyDirective, FormsModule],\n\tproviders: [\n\t\t{\n\t\t\tprovide: NG_VALUE_ACCESSOR,\n\t\t\tuseExisting: RangeComponent,\n\t\t\tmulti: true,\n\t\t},\n\t],\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class RangeComponent implements ControlValueAccessor {\n\tvariant = input<RangeVariantProps>();\n\tsize = input<RangeSizeProps>();\n\tclasses = input<string>('');\n\tlabel = input<string>('');\n\tname = input<string | null>(null);\n\tmin = input<number>(0);\n\tmax = input<number>(100);\n\tshowRange = input<boolean>(true);\n\n\tsteps = input<number>(0);\n\tstepsQuantity = computed(() => Array.from({ length: this.steps() + 1 }));\n\tjumpSize = computed(() => (this.max() - this.min()) / this.steps());\n\n\tvalue = model<number>(0);\n\n\t// Form control properties\n\tparentForm = input<FormGroup | null>(null);\n\tformControlName = input<string>('');\n\n\tget formField(): FormControl | null {\n\t\tif (!this.parentForm()) return null;\n\t\treturn this.parentForm()?.get(this.formControlName()) as FormControl;\n\t}\n\n\t// ControlValueAccessor attributes\n\tprivate onControlChange: any = () => {};\n\tprivate onControlTouch: any = () => {};\n\tdisabled = model<boolean>(false);\n\n\t// ControlValueAccessor methods\n\twriteValue(obj: any): void {\n\t\tthis.value.set(obj);\n\t}\n\n\tregisterOnChange(fn: any): void {\n\t\tthis.onControlChange = fn;\n\t}\n\n\tregisterOnTouched(fn: any): void {\n\t\tthis.onControlTouch = fn;\n\t}\n\n\tsetDisabledState(isDisabled: boolean): void {\n\t\tthis.disabled.set(isDisabled);\n\t}\n\n\t// Change handler\n\tonChange = output<number>();\n\thandleChange() {\n\t\tthis.onControlChange(this.value());\n\t\tthis.onChange.emit(this.value());\n\t}\n\n\tget componentClass() {\n\t\treturn cn(\n\t\t\trangeComponent({\n\t\t\t\tvariant: this.variant(),\n\t\t\t\tsize: this.size(),\n\t\t\t\tclass: this.classes(),\n\t\t\t}),\n\t\t);\n\t}\n}\n","@if (label()) {\n\t<label [for]=\"this.name()\">\n\t\t<span typography [tyVariant]=\"'body'\" [tyColor]=\"'base'\" [tyFontWeight]=\"'normal'\">{{ label() }}</span>\n\t</label>\n}\n\n@if (showRange()) {\n\t<div class=\"flex justify-between\">\n\t\t<span typography [tyVariant]=\"'body-sm'\">{{ min() }}</span>\n\t\t<span typography [tyVariant]=\"'body-sm'\">{{ max() }}</span>\n\t</div>\n}\n\n<input\n\t[class]=\"componentClass\"\n\t[attr.name]=\"name()\"\n\ttype=\"range\"\n\t[min]=\"min()\"\n\t[max]=\"max()\"\n\t[step]=\"jumpSize()\"\n\t[value]=\"value()\"\n\t[(ngModel)]=\"value\"\n\t[disabled]=\"disabled()\"\n\t(ngModelChange)=\"handleChange()\"\n/>\n\n@if (steps() > 0) {\n\t<div class=\"flex w-full justify-between px-2 text-xs\">\n\t\t@for (step of stepsQuantity(); track $index) {\n\t\t\t<span>|</span>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,OAAA,EAAA,CAAA,eAAA,CAAA,EAAA,QAAA,EAAA,CAAA,SAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;4FAU9B,cAAc,EAAA,UAAA,EAAA,CAAA;kBAd1B,SAAS;+BACC,UAAU,EAAA,UAAA,EAER,IAAI,EACP,OAAA,EAAA,CAAC,mBAAmB,EAAE,WAAW,CAAC,EAChC,SAAA,EAAA;AACV,wBAAA;AACC,4BAAA,OAAO,EAAE,iBAAiB;AAC1B,4BAAA,WAAW,EAAgB,cAAA;AAC3B,4BAAA,KAAK,EAAE,IAAI;AACX,yBAAA;qBACD,EACgB,eAAA,EAAA,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,m0BAAA,EAAA,CAAA;;;AEpDhD;;AAEG;;;;"}
|
|
@@ -7,43 +7,39 @@ import { cn } from '@sixbell-telco/sdk/utils/cn';
|
|
|
7
7
|
import { cva } from 'class-variance-authority';
|
|
8
8
|
|
|
9
9
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
10
|
-
const selectComponent = cva(['w-full', 'font-body', '
|
|
10
|
+
const selectComponent = cva(['w-full', 'min-w-fit', 'text-pretty', 'font-body', 'font-normal', 'rounded-btn', 'select', 'leading-normal'], {
|
|
11
11
|
variants: {
|
|
12
12
|
variant: {
|
|
13
|
-
primary: ['select
|
|
14
|
-
secondary: ['select
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
'round-sm': ['rounded-btn-sm'],
|
|
22
|
-
'round-md': ['rounded-btn-md'],
|
|
23
|
-
'round-lg': ['rounded-btn-lg'],
|
|
13
|
+
primary: ['select-primary'],
|
|
14
|
+
secondary: ['select-secondary'],
|
|
15
|
+
tertiary: ['select-tertiary'],
|
|
16
|
+
accent: ['select-accent'],
|
|
17
|
+
info: ['select-info'],
|
|
18
|
+
success: ['select-success'],
|
|
19
|
+
error: ['select-error'],
|
|
20
|
+
warning: ['select-warning'],
|
|
24
21
|
},
|
|
25
22
|
size: {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
xs: ['select-xs', 'text-xs'],
|
|
24
|
+
sm: ['select-sm', 'text-sm'],
|
|
25
|
+
md: ['select-md', 'text-base'],
|
|
26
|
+
lg: ['select-lg', 'text-lg'],
|
|
29
27
|
},
|
|
30
28
|
},
|
|
31
29
|
compoundVariants: [],
|
|
32
30
|
defaultVariants: {
|
|
33
31
|
variant: 'secondary',
|
|
34
|
-
shape: 'round-sm',
|
|
35
32
|
size: 'md',
|
|
36
33
|
},
|
|
37
34
|
});
|
|
38
35
|
class SelectComponent {
|
|
39
36
|
// Base input properties
|
|
40
|
-
variant = input(
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
classes = input('');
|
|
44
|
-
label = input('');
|
|
37
|
+
variant = input();
|
|
38
|
+
size = input();
|
|
39
|
+
ghost = input(false);
|
|
45
40
|
name = input(null);
|
|
46
41
|
placeholder = input('');
|
|
42
|
+
label = input('');
|
|
47
43
|
value = model();
|
|
48
44
|
options = input([]);
|
|
49
45
|
emptyOptionText = input('');
|
|
@@ -93,26 +89,20 @@ class SelectComponent {
|
|
|
93
89
|
get componentClass() {
|
|
94
90
|
return cn(selectComponent({
|
|
95
91
|
variant: this.variant(),
|
|
96
|
-
shape: this.shape(),
|
|
97
92
|
size: this.size(),
|
|
98
|
-
|
|
99
|
-
}));
|
|
93
|
+
}), { 'select-bordered': !this.ghost() });
|
|
100
94
|
}
|
|
101
95
|
get errorClass() {
|
|
102
96
|
return cn(selectComponent({
|
|
103
97
|
variant: 'error',
|
|
104
|
-
shape: this.shape(),
|
|
105
98
|
size: this.size(),
|
|
106
|
-
|
|
107
|
-
}));
|
|
99
|
+
}), { 'select-bordered': !this.ghost() });
|
|
108
100
|
}
|
|
109
101
|
get successClass() {
|
|
110
102
|
return cn(selectComponent({
|
|
111
103
|
variant: 'success',
|
|
112
|
-
shape: this.shape(),
|
|
113
104
|
size: this.size(),
|
|
114
|
-
|
|
115
|
-
}));
|
|
105
|
+
}), { 'select-bordered': !this.ghost() });
|
|
116
106
|
}
|
|
117
107
|
get validationClass() {
|
|
118
108
|
if (!this.formField)
|
|
@@ -128,13 +118,13 @@ class SelectComponent {
|
|
|
128
118
|
return this.componentClass;
|
|
129
119
|
}
|
|
130
120
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: SelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
131
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.12", type: SelectComponent, isStandalone: true, selector: "st-select", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null },
|
|
121
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.12", type: SelectComponent, isStandalone: true, selector: "st-select", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, ghost: { classPropertyName: "ghost", publicName: "ghost", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, emptyOptionText: { classPropertyName: "emptyOptionText", publicName: "emptyOptionText", isSignal: true, isRequired: false, transformFunction: null }, trackBy: { classPropertyName: "trackBy", publicName: "trackBy", isSignal: true, isRequired: false, transformFunction: null }, key: { classPropertyName: "key", publicName: "key", isSignal: true, isRequired: false, transformFunction: null }, parentForm: { classPropertyName: "parentForm", publicName: "parentForm", isSignal: true, isRequired: false, transformFunction: null }, formControlName: { classPropertyName: "formControlName", publicName: "formControlName", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", disabled: "disabledChange", onChange: "onChange" }, providers: [
|
|
132
122
|
{
|
|
133
123
|
provide: NG_VALUE_ACCESSOR,
|
|
134
124
|
useExisting: SelectComponent,
|
|
135
125
|
multi: true,
|
|
136
126
|
},
|
|
137
|
-
], ngImport: i0, template: "<div class=\"flex flex-col gap-1\">\n\t@if (label()) {\n\t\t<label [for]=\"this.name()\" class=\"block\"
|
|
127
|
+
], ngImport: i0, template: "<div class=\"flex flex-col gap-1\">\n\t@if (label()) {\n\t\t<label [for]=\"this.name()\" class=\"block\">{{ label() }}</label>\n\t}\n\t<select\n\t\t[class]=\"validationClass\"\n\t\t[attr.name]=\"name()\"\n\t\t[(ngModel)]=\"value\"\n\t\t[disabled]=\"disabled()\"\n\t\t(ngModelChange)=\"handleSelect()\"\n\t\t(blur)=\"handleBlur()\"\n\t>\n\t\t@if (emptyOptionText()) {\n\t\t\t<option value=\"\">\n\t\t\t\t<span typography [tyVariant]=\"'body'\" [tyColor]=\"'base'\" [tyFontWeight]=\"'normal'\">{{ emptyOptionText() }}</span>\n\t\t\t</option>\n\t\t}\n\n\t\t@if (simpleOption) {\n\t\t\t@for (option of options(); track option) {\n\t\t\t\t<option [ngValue]=\"option\">\n\t\t\t\t\t<span typography [tyVariant]=\"'body'\" [tyColor]=\"'base'\" [tyFontWeight]=\"'normal'\">{{ option }}</span>\n\t\t\t\t</option>\n\t\t\t}\n\t\t} @else {\n\t\t\t@for (option of options(); track option[trackBy()]) {\n\t\t\t\t<option [ngValue]=\"option\">\n\t\t\t\t\t<span typography [tyVariant]=\"'body'\" [tyColor]=\"'base'\" [tyFontWeight]=\"'normal'\">{{ option[key()] }}</span>\n\t\t\t\t</option>\n\t\t\t}\n\t\t}\n\t</select>\n</div>\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: TypographyDirective, selector: "[typography]", inputs: ["tyVariant", "tyColor", "tyFontWeight"] }] });
|
|
138
128
|
}
|
|
139
129
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: SelectComponent, decorators: [{
|
|
140
130
|
type: Component,
|
|
@@ -144,7 +134,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImpo
|
|
|
144
134
|
useExisting: SelectComponent,
|
|
145
135
|
multi: true,
|
|
146
136
|
},
|
|
147
|
-
], template: "<div class=\"flex flex-col gap-1\">\n\t@if (label()) {\n\t\t<label [for]=\"this.name()\" class=\"block\"
|
|
137
|
+
], template: "<div class=\"flex flex-col gap-1\">\n\t@if (label()) {\n\t\t<label [for]=\"this.name()\" class=\"block\">{{ label() }}</label>\n\t}\n\t<select\n\t\t[class]=\"validationClass\"\n\t\t[attr.name]=\"name()\"\n\t\t[(ngModel)]=\"value\"\n\t\t[disabled]=\"disabled()\"\n\t\t(ngModelChange)=\"handleSelect()\"\n\t\t(blur)=\"handleBlur()\"\n\t>\n\t\t@if (emptyOptionText()) {\n\t\t\t<option value=\"\">\n\t\t\t\t<span typography [tyVariant]=\"'body'\" [tyColor]=\"'base'\" [tyFontWeight]=\"'normal'\">{{ emptyOptionText() }}</span>\n\t\t\t</option>\n\t\t}\n\n\t\t@if (simpleOption) {\n\t\t\t@for (option of options(); track option) {\n\t\t\t\t<option [ngValue]=\"option\">\n\t\t\t\t\t<span typography [tyVariant]=\"'body'\" [tyColor]=\"'base'\" [tyFontWeight]=\"'normal'\">{{ option }}</span>\n\t\t\t\t</option>\n\t\t\t}\n\t\t} @else {\n\t\t\t@for (option of options(); track option[trackBy()]) {\n\t\t\t\t<option [ngValue]=\"option\">\n\t\t\t\t\t<span typography [tyVariant]=\"'body'\" [tyColor]=\"'base'\" [tyFontWeight]=\"'normal'\">{{ option[key()] }}</span>\n\t\t\t\t</option>\n\t\t\t}\n\t\t}\n\t</select>\n</div>\n" }]
|
|
148
138
|
}] });
|
|
149
139
|
|
|
150
140
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sixbell-telco-sdk-components-forms-select.mjs","sources":["../../../projects/sdk/components/forms/select/src/select.component.ts","../../../projects/sdk/components/forms/select/src/select.component.html","../../../projects/sdk/components/forms/select/sixbell-telco-sdk-components-forms-select.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { Component, effect, input, model, output } from '@angular/core';\nimport { FormControl, FormGroup, FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { TypographyDirective } from '@sixbell-telco/sdk/directives/typography';\nimport { cn } from '@sixbell-telco/sdk/utils/cn';\nimport { cva } from 'class-variance-authority';\n\nconst selectComponent = cva(['w-full', 'font-body', 'min-h-[auto]', 'h-auto', 'min-w-fit'], {\n\tvariants: {\n\t\tvariant: {\n\t\t\tprimary: ['select', 'select-bordered', 'select-primary'],\n\t\t\tsecondary: ['select', 'select-bordered', 'select-secondary'],\n\t\t\tsuccess: ['select', 'select-bordered', 'select-success'],\n\t\t\terror: ['select', 'select-bordered', 'select-error'],\n\t\t\twarning: ['select', 'select-bordered', 'select-warning'],\n\t\t},\n\t\tshape: {\n\t\t\t'round-none': ['rounded-none'],\n\t\t\t'round-sm': ['rounded-btn-sm'],\n\t\t\t'round-md': ['rounded-btn-md'],\n\t\t\t'round-lg': ['rounded-btn-lg'],\n\t\t},\n\t\tsize: {\n\t\t\tsm: ['pl-2 pr-[50]', 'py-1'],\n\t\t\tmd: ['pl-3 pr-[50]', 'py-2'],\n\t\t\tlg: ['pl-4 pr-[50]', 'py-3'],\n\t\t},\n\t},\n\tcompoundVariants: [],\n\tdefaultVariants: {\n\t\tvariant: 'secondary',\n\t\tshape: 'round-sm',\n\t\tsize: 'md',\n\t},\n});\n\nexport type SelectVariantProps = 'primary' | 'secondary' | 'success' | 'error' | 'warning' | null | undefined;\nexport type SelectShapeProps = 'round-none' | 'round-sm' | 'round-md' | 'round-lg' | null | undefined;\nexport type SelectSizeProps = 'sm' | 'md' | 'lg' | null | undefined;\n\nexport type SelectProps = {\n\tvariant?: SelectVariantProps;\n\tshape?: SelectShapeProps;\n\tsize?: SelectSizeProps;\n};\n\n@Component({\n\tselector: 'st-select',\n\tstandalone: true,\n\timports: [FormsModule, TypographyDirective],\n\tproviders: [\n\t\t{\n\t\t\tprovide: NG_VALUE_ACCESSOR,\n\t\t\tuseExisting: SelectComponent,\n\t\t\tmulti: true,\n\t\t},\n\t],\n\ttemplateUrl: './select.component.html',\n\t// changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SelectComponent {\n\t// Base input properties\n\tvariant = input<SelectVariantProps>('secondary');\n\tshape = input<SelectShapeProps>('round-sm');\n\tsize = input<SelectSizeProps>('md');\n\tclasses = input<string>('');\n\tlabel = input<string>('');\n\tname = input<string | null>(null);\n\tplaceholder = input<string>('');\n\tvalue = model();\n\toptions = input<any[]>([]);\n\temptyOptionText = input<string>('');\n\n\t// Options properties\n\ttrackBy = input<string>('id');\n\tkey = input<string>('name');\n\n\t// Form control properties\n\tparentForm = input<FormGroup | null>(null);\n\tformControlName = input<string>('');\n\n\tget formField(): FormControl | null {\n\t\tif (!this.parentForm()) return null;\n\t\treturn this.parentForm()?.get(this.formControlName()) as FormControl;\n\t}\n\n\t// ControlValueAccessor attributes\n\tprivate onControlChange: any = () => {};\n\tprivate onControlTouch: any = () => {};\n\tdisabled = model<boolean>(false);\n\n\t// ControlValueAccessor methods\n\twriteValue(obj: any): void {\n\t\tthis.value.set(obj);\n\t}\n\n\tregisterOnChange(fn: any): void {\n\t\tthis.onControlChange = fn;\n\t}\n\n\tregisterOnTouched(fn: any): void {\n\t\tthis.onControlTouch = fn;\n\t}\n\n\tsetDisabledState?(isDisabled: boolean): void {\n\t\tthis.disabled.set(isDisabled);\n\t}\n\n\t// Select handler\n\tonChange = output<any>();\n\thandleSelect() {\n\t\tthis.onChange.emit(this.value());\n\t\tthis.onControlChange(this.value());\n\t}\n\n\t// Blur handler\n\thandleBlur() {\n\t\tthis.onControlTouch();\n\t}\n\n\t// Checks if options are primitives or not\n\tsimpleOption = false;\n\toptionsEffect = effect(() => {\n\t\tthis.simpleOption = this.options().every((option) => typeof option !== 'object');\n\t});\n\n\tget componentClass() {\n\t\treturn cn(\n\t\t\tselectComponent({\n\t\t\t\tvariant: this.variant(),\n\t\t\t\tshape: this.shape(),\n\t\t\t\tsize: this.size(),\n\t\t\t\tclass: this.classes(),\n\t\t\t}),\n\t\t);\n\t}\n\n\tget errorClass() {\n\t\treturn cn(\n\t\t\tselectComponent({\n\t\t\t\tvariant: 'error',\n\t\t\t\tshape: this.shape(),\n\t\t\t\tsize: this.size(),\n\t\t\t\tclass: this.classes(),\n\t\t\t}),\n\t\t);\n\t}\n\n\tget successClass() {\n\t\treturn cn(\n\t\t\tselectComponent({\n\t\t\t\tvariant: 'success',\n\t\t\t\tshape: this.shape(),\n\t\t\t\tsize: this.size(),\n\t\t\t\tclass: this.classes(),\n\t\t\t}),\n\t\t);\n\t}\n\n\tget validationClass() {\n\t\tif (!this.formField) return this.componentClass;\n\n\t\tif (this.formField.dirty || this.formField.touched) {\n\t\t\tif (this.formField.invalid) {\n\t\t\t\treturn this.errorClass;\n\t\t\t} else if (this.formField.valid) {\n\t\t\t\treturn this.successClass;\n\t\t\t}\n\t\t}\n\n\t\treturn this.componentClass;\n\t}\n}\n","<div class=\"flex flex-col gap-1\">\n\t@if (label()) {\n\t\t<label [for]=\"this.name()\" class=\"block\"\n\t\t\t><span typography [typographyVariant]=\"'body'\" [typographyColor]=\"'black'\" [typographyFontWeight]=\"'normal'\">{{ label() }}</span></label\n\t\t>\n\t}\n\n\t<select\n\t\t[class]=\"validationClass\"\n\t\t[attr.name]=\"name()\"\n\t\t[(ngModel)]=\"value\"\n\t\t[disabled]=\"disabled()\"\n\t\t(ngModelChange)=\"handleSelect()\"\n\t\t(blur)=\"handleBlur()\"\n\t>\n\t\t@if (emptyOptionText()) {\n\t\t\t<option value=\"\">\n\t\t\t\t<span typography [typographyVariant]=\"'body'\" [typographyColor]=\"'black'\" [typographyFontWeight]=\"'normal'\">{{ emptyOptionText() }}</span>\n\t\t\t</option>\n\t\t}\n\n\t\t@if (simpleOption) {\n\t\t\t@for (option of options(); track option) {\n\t\t\t\t<option [ngValue]=\"option\">\n\t\t\t\t\t<span typography [typographyVariant]=\"'body'\" [typographyColor]=\"'black'\" [typographyFontWeight]=\"'normal'\">{{ option }}</span>\n\t\t\t\t</option>\n\t\t\t}\n\t\t} @else {\n\t\t\t@for (option of options(); track option[trackBy()]) {\n\t\t\t\t<option [ngValue]=\"option\">\n\t\t\t\t\t<span typography [typographyVariant]=\"'body'\" [typographyColor]=\"'black'\" [typographyFontWeight]=\"'normal'\">{{ option[key()] }}</span>\n\t\t\t\t</option>\n\t\t\t}\n\t\t}\n\t</select>\n\n\t<ng-content></ng-content>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;AAAA;AAOA,MAAM,eAAe,GAAG,GAAG,CAAC,CAAC,QAAQ,EAAE,WAAW,EAAE,cAAc,EAA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A,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,uBAAA,EAAA,QAAA,EAAA,QAAA,EAAA,MAAA,EAAA,CAAA,SAAA,EAAA,OAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,0BAAA,EAAA,QAAA,EAAA,6GAAA,EAAA,MAAA,EAAA,CAAA,aAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,eAAA,EAAA,QAAA,EAAA,2CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,OAAA,EAAA,QAAA,EAAA,qDAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,UAAA,EAAA,SAAA,EAAA,gBAAA,CAAA,EAAA,OAAA,EAAA,CAAA,eAAA,CAAA,EAAA,QAAA,EAAA,CAAA,SAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,mBAAmB,EAAA,QAAA,EAAA,cAAA,EAAA,MAAA,EAAA,CAAA,mBAAA,EAAA,iBAAA,EAAA,sBAAA,EAAA,SAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;4FAW9B,eAAe,EAAA,UAAA,EAAA,CAAA;kBAd3B,SAAS;+BACC,WAAW,EAAA,UAAA,EACT,IAAI,EACP,OAAA,EAAA,CAAC,WAAW,EAAE,mBAAmB,CAAC,EAChC,SAAA,EAAA;AACV,wBAAA;AACC,4BAAA,OAAO,EAAE,iBAAiB;AAC1B,4BAAA,WAAW,EAAiB,eAAA;AAC5B,4BAAA,KAAK,EAAE,IAAI;AACX,yBAAA;AACD,qBAAA,EAAA,QAAA,EAAA,40CAAA,EAAA,CAAA;;;AExDF;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"sixbell-telco-sdk-components-forms-select.mjs","sources":["../../../projects/sdk/components/forms/select/src/select.component.ts","../../../projects/sdk/components/forms/select/src/select.component.html","../../../projects/sdk/components/forms/select/sixbell-telco-sdk-components-forms-select.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { Component, effect, input, model, output } from '@angular/core';\nimport { FormControl, FormGroup, FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { TypographyDirective } from '@sixbell-telco/sdk/directives/typography';\nimport { cn } from '@sixbell-telco/sdk/utils/cn';\nimport { cva } from 'class-variance-authority';\n\nconst selectComponent = cva(['w-full', 'min-w-fit', 'text-pretty', 'font-body', 'font-normal', 'rounded-btn', 'select', 'leading-normal'], {\n\tvariants: {\n\t\tvariant: {\n\t\t\tprimary: ['select-primary'],\n\t\t\tsecondary: ['select-secondary'],\n\t\t\ttertiary: ['select-tertiary'],\n\t\t\taccent: ['select-accent'],\n\t\t\tinfo: ['select-info'],\n\t\t\tsuccess: ['select-success'],\n\t\t\terror: ['select-error'],\n\t\t\twarning: ['select-warning'],\n\t\t},\n\t\tsize: {\n\t\t\txs: ['select-xs', 'text-xs'],\n\t\t\tsm: ['select-sm', 'text-sm'],\n\t\t\tmd: ['select-md', 'text-base'],\n\t\t\tlg: ['select-lg', 'text-lg'],\n\t\t},\n\t},\n\tcompoundVariants: [],\n\tdefaultVariants: {\n\t\tvariant: 'secondary',\n\t\tsize: 'md',\n\t},\n});\n\nexport type SelectVariantProps = 'primary' | 'secondary' | 'tertiary' | 'accent' | 'info' | 'success' | 'error' | 'warning' | null | undefined;\nexport type SelectSizeProps = 'xs' | 'sm' | 'md' | 'lg' | null | undefined;\n\nexport type SelectProps = {\n\tvariant?: SelectVariantProps;\n\tsize?: SelectSizeProps;\n};\n\n@Component({\n\tselector: 'st-select',\n\tstandalone: true,\n\timports: [FormsModule, TypographyDirective],\n\tproviders: [\n\t\t{\n\t\t\tprovide: NG_VALUE_ACCESSOR,\n\t\t\tuseExisting: SelectComponent,\n\t\t\tmulti: true,\n\t\t},\n\t],\n\ttemplateUrl: './select.component.html',\n\t// changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SelectComponent {\n\t// Base input properties\n\tvariant = input<SelectVariantProps>();\n\tsize = input<SelectSizeProps>();\n\tghost = input<boolean>(false);\n\tname = input<string | null>(null);\n\tplaceholder = input<string>('');\n\tlabel = input<string>('');\n\tvalue = model();\n\toptions = input<any[]>([]);\n\temptyOptionText = input<string>('');\n\n\t// Options properties\n\ttrackBy = input<string>('id');\n\tkey = input<string>('name');\n\n\t// Form control properties\n\tparentForm = input<FormGroup | null>(null);\n\tformControlName = input<string>('');\n\n\tget formField(): FormControl | null {\n\t\tif (!this.parentForm()) return null;\n\t\treturn this.parentForm()?.get(this.formControlName()) as FormControl;\n\t}\n\n\t// ControlValueAccessor attributes\n\tprivate onControlChange: any = () => {};\n\tprivate onControlTouch: any = () => {};\n\tdisabled = model<boolean>(false);\n\n\t// ControlValueAccessor methods\n\twriteValue(obj: any): void {\n\t\tthis.value.set(obj);\n\t}\n\n\tregisterOnChange(fn: any): void {\n\t\tthis.onControlChange = fn;\n\t}\n\n\tregisterOnTouched(fn: any): void {\n\t\tthis.onControlTouch = fn;\n\t}\n\n\tsetDisabledState?(isDisabled: boolean): void {\n\t\tthis.disabled.set(isDisabled);\n\t}\n\n\t// Select handler\n\tonChange = output<any>();\n\thandleSelect() {\n\t\tthis.onChange.emit(this.value());\n\t\tthis.onControlChange(this.value());\n\t}\n\n\t// Blur handler\n\thandleBlur() {\n\t\tthis.onControlTouch();\n\t}\n\n\t// Checks if options are primitives or not\n\tsimpleOption = false;\n\toptionsEffect = effect(() => {\n\t\tthis.simpleOption = this.options().every((option) => typeof option !== 'object');\n\t});\n\n\tget componentClass() {\n\t\treturn cn(\n\t\t\tselectComponent({\n\t\t\t\tvariant: this.variant(),\n\t\t\t\tsize: this.size(),\n\t\t\t}),\n\t\t\t{ 'select-bordered': !this.ghost() },\n\t\t);\n\t}\n\n\tget errorClass() {\n\t\treturn cn(\n\t\t\tselectComponent({\n\t\t\t\tvariant: 'error',\n\t\t\t\tsize: this.size(),\n\t\t\t}),\n\t\t\t{ 'select-bordered': !this.ghost() },\n\t\t);\n\t}\n\n\tget successClass() {\n\t\treturn cn(\n\t\t\tselectComponent({\n\t\t\t\tvariant: 'success',\n\t\t\t\tsize: this.size(),\n\t\t\t}),\n\t\t\t{ 'select-bordered': !this.ghost() },\n\t\t);\n\t}\n\n\tget validationClass() {\n\t\tif (!this.formField) return this.componentClass;\n\n\t\tif (this.formField.dirty || this.formField.touched) {\n\t\t\tif (this.formField.invalid) {\n\t\t\t\treturn this.errorClass;\n\t\t\t} else if (this.formField.valid) {\n\t\t\t\treturn this.successClass;\n\t\t\t}\n\t\t}\n\n\t\treturn this.componentClass;\n\t}\n}\n","<div class=\"flex flex-col gap-1\">\n\t@if (label()) {\n\t\t<label [for]=\"this.name()\" class=\"block\">{{ label() }}</label>\n\t}\n\t<select\n\t\t[class]=\"validationClass\"\n\t\t[attr.name]=\"name()\"\n\t\t[(ngModel)]=\"value\"\n\t\t[disabled]=\"disabled()\"\n\t\t(ngModelChange)=\"handleSelect()\"\n\t\t(blur)=\"handleBlur()\"\n\t>\n\t\t@if (emptyOptionText()) {\n\t\t\t<option value=\"\">\n\t\t\t\t<span typography [tyVariant]=\"'body'\" [tyColor]=\"'base'\" [tyFontWeight]=\"'normal'\">{{ emptyOptionText() }}</span>\n\t\t\t</option>\n\t\t}\n\n\t\t@if (simpleOption) {\n\t\t\t@for (option of options(); track option) {\n\t\t\t\t<option [ngValue]=\"option\">\n\t\t\t\t\t<span typography [tyVariant]=\"'body'\" [tyColor]=\"'base'\" [tyFontWeight]=\"'normal'\">{{ option }}</span>\n\t\t\t\t</option>\n\t\t\t}\n\t\t} @else {\n\t\t\t@for (option of options(); track option[trackBy()]) {\n\t\t\t\t<option [ngValue]=\"option\">\n\t\t\t\t\t<span typography [tyVariant]=\"'body'\" [tyColor]=\"'base'\" [tyFontWeight]=\"'normal'\">{{ option[key()] }}</span>\n\t\t\t\t</option>\n\t\t\t}\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AA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,OAAA,EAAA,QAAA,EAAA,qDAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,UAAA,EAAA,SAAA,EAAA,gBAAA,CAAA,EAAA,OAAA,EAAA,CAAA,eAAA,CAAA,EAAA,QAAA,EAAA,CAAA,SAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,mBAAmB,EAAA,QAAA,EAAA,cAAA,EAAA,MAAA,EAAA,CAAA,WAAA,EAAA,SAAA,EAAA,cAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;4FAW9B,eAAe,EAAA,UAAA,EAAA,CAAA;kBAd3B,SAAS;+BACC,WAAW,EAAA,UAAA,EACT,IAAI,EACP,OAAA,EAAA,CAAC,WAAW,EAAE,mBAAmB,CAAC,EAChC,SAAA,EAAA;AACV,wBAAA;AACC,4BAAA,OAAO,EAAE,iBAAiB;AAC1B,4BAAA,WAAW,EAAiB,eAAA;AAC5B,4BAAA,KAAK,EAAE,IAAI;AACX,yBAAA;AACD,qBAAA,EAAA,QAAA,EAAA,ylCAAA,EAAA,CAAA;;;AEnDF;;AAEG;;;;"}
|
|
@@ -94,7 +94,7 @@ class SwitchComponent {
|
|
|
94
94
|
useExisting: SwitchComponent,
|
|
95
95
|
multi: true,
|
|
96
96
|
},
|
|
97
|
-
], ngImport: i0, template: "<div class=\"mb-2 flex items-center gap-4\">\n\t@if (label()) {\n\t\t<label [for]=\"this.name()\"\n\t\t\t><span typography [
|
|
97
|
+
], ngImport: i0, template: "<div class=\"mb-2 flex items-center gap-4\">\n\t@if (label()) {\n\t\t<label [for]=\"this.name()\"\n\t\t\t><span typography [tyVariant]=\"'body'\" [tyColor]=\"'base'\">{{ label() }}</span></label\n\t\t>\n\t}\n\n\t<input\n\t\ttype=\"checkbox\"\n\t\t[class]=\"componentClass\"\n\t\t[attr.name]=\"name()\"\n\t\t[(ngModel)]=\"value\"\n\t\t[disabled]=\"disabled()\"\n\t\t(change)=\"handleChange()\"\n\t\t(blur)=\"handleBlur()\"\n\t/>\n</div>\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: TypographyDirective, selector: "[typography]", inputs: ["tyVariant", "tyColor", "tyFontWeight"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
98
98
|
}
|
|
99
99
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: SwitchComponent, decorators: [{
|
|
100
100
|
type: Component,
|
|
@@ -104,7 +104,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImpo
|
|
|
104
104
|
useExisting: SwitchComponent,
|
|
105
105
|
multi: true,
|
|
106
106
|
},
|
|
107
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"mb-2 flex items-center gap-4\">\n\t@if (label()) {\n\t\t<label [for]=\"this.name()\"\n\t\t\t><span typography [
|
|
107
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"mb-2 flex items-center gap-4\">\n\t@if (label()) {\n\t\t<label [for]=\"this.name()\"\n\t\t\t><span typography [tyVariant]=\"'body'\" [tyColor]=\"'base'\">{{ label() }}</span></label\n\t\t>\n\t}\n\n\t<input\n\t\ttype=\"checkbox\"\n\t\t[class]=\"componentClass\"\n\t\t[attr.name]=\"name()\"\n\t\t[(ngModel)]=\"value\"\n\t\t[disabled]=\"disabled()\"\n\t\t(change)=\"handleChange()\"\n\t\t(blur)=\"handleBlur()\"\n\t/>\n</div>\n" }]
|
|
108
108
|
}] });
|
|
109
109
|
|
|
110
110
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sixbell-telco-sdk-components-forms-switch.mjs","sources":["../../../projects/sdk/components/forms/switch/src/switch.component.ts","../../../projects/sdk/components/forms/switch/src/switch.component.html","../../../projects/sdk/components/forms/switch/sixbell-telco-sdk-components-forms-switch.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { ChangeDetectionStrategy, Component, input, model, output } from '@angular/core';\nimport { ControlValueAccessor, FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { TypographyDirective } from '@sixbell-telco/sdk/directives/typography';\nimport { cn } from '@sixbell-telco/sdk/utils/cn';\nimport { cva } from 'class-variance-authority';\n\nconst switchComponent = cva(\n\t['toggle', 'border-transparent checked:border-transparent bg-base-100 [--tglbg:var(--fallback-b1,oklch(var(--s)/1))] hover:bg-base-100'],\n\t{\n\t\tvariants: {\n\t\t\tvariant: {\n\t\t\t\tprimary: [\n\t\t\t\t\t'checked:border-transparent',\n\t\t\t\t\t'checked:outline-primary',\n\t\t\t\t\t'checked:bg-primary-content',\n\t\t\t\t\t'checked:hover:bg-primary-content',\n\t\t\t\t\t'checked:[--tglbg:var(--fallback-p,oklch(var(--p)/var(--tw-bg-opacity)))]',\n\t\t\t\t],\n\t\t\t\twarning: [\n\t\t\t\t\t'checked:border-transparent',\n\t\t\t\t\t'checked:outline-warning',\n\t\t\t\t\t'checked:bg-base-100',\n\t\t\t\t\t'checked:hover:bg-base-100',\n\t\t\t\t\t'checked:[--tglbg:var(--fallback-wa,oklch(var(--wa)/var(--tw-bg-opacity)))]',\n\t\t\t\t],\n\t\t\t\terror: [\n\t\t\t\t\t'checked:border-transparent',\n\t\t\t\t\t'checked:outline-error',\n\t\t\t\t\t'checked:bg-error-content',\n\t\t\t\t\t'checked:hover:bg-error-content',\n\t\t\t\t\t'checked:[--tglbg:var(--fallback-er,oklch(var(--er)/var(--tw-bg-opacity)))]',\n\t\t\t\t],\n\t\t\t},\n\t\t\tsize: {\n\t\t\t\txs: ['toggle-xs'],\n\t\t\t\tsm: ['toggle-sm'],\n\t\t\t\tmd: ['toggle-md'],\n\t\t\t\tlg: ['toggle-lg'],\n\t\t\t},\n\t\t},\n\t\tcompoundVariants: [],\n\t\tdefaultVariants: {\n\t\t\tvariant: 'primary',\n\t\t\tsize: 'md',\n\t\t},\n\t},\n);\n\nexport type SwitchVariantProps = 'primary' | 'warning' | 'error' | null | undefined;\nexport type SwitchSizeProps = 'xs' | 'sm' | 'md' | 'lg' | null | undefined;\n\nexport type SwitchProps = {\n\tvariant?: SwitchVariantProps;\n\tsize?: SwitchSizeProps;\n};\n\n@Component({\n\tselector: 'st-switch',\n\tstandalone: true,\n\timports: [FormsModule, TypographyDirective],\n\tproviders: [\n\t\t{\n\t\t\tprovide: NG_VALUE_ACCESSOR,\n\t\t\tuseExisting: SwitchComponent,\n\t\t\tmulti: true,\n\t\t},\n\t],\n\ttemplateUrl: './switch.component.html',\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SwitchComponent implements ControlValueAccessor {\n\t// Base switch properties\n\tvariant = input<SwitchVariantProps>('primary');\n\tsize = input<SwitchSizeProps>('md');\n\tclasses = input<string>('');\n\tlabel = input<string>('');\n\tname = input<string | null>(null);\n\n\tvalue = model<boolean>(false);\n\n\t// ControlValueAccessor attributes\n\tprivate onControlChange: any = () => {};\n\tprivate onControlTouch: any = () => {};\n\tdisabled = model<boolean>(false);\n\n\t// ControlValueAccessor methods\n\twriteValue(obj: any): void {\n\t\tthis.value.set(obj);\n\t}\n\n\tregisterOnChange(fn: any): void {\n\t\tthis.onControlChange = fn;\n\t}\n\n\tregisterOnTouched(fn: any): void {\n\t\tthis.onControlTouch = fn;\n\t}\n\n\tsetDisabledState?(isDisabled: boolean): void {\n\t\tthis.disabled.set(isDisabled);\n\t}\n\n\t// Change handler\n\tonChange = output<boolean>();\n\n\tget componentClass() {\n\t\treturn cn(\n\t\t\tswitchComponent({\n\t\t\t\tvariant: this.variant(),\n\t\t\t\tsize: this.size(),\n\t\t\t\tclass: this.classes(),\n\t\t\t}),\n\t\t);\n\t}\n\thandleChange(): void {\n\t\tthis.onControlChange(this.value());\n\t\tthis.onChange.emit(this.value());\n\t}\n\n\t// Blur handler\n\thandleBlur() {\n\t\tthis.onControlTouch();\n\t}\n}\n","<div class=\"mb-2 flex items-center gap-4\">\n\t@if (label()) {\n\t\t<label [for]=\"this.name()\"\n\t\t\t><span typography [
|
|
1
|
+
{"version":3,"file":"sixbell-telco-sdk-components-forms-switch.mjs","sources":["../../../projects/sdk/components/forms/switch/src/switch.component.ts","../../../projects/sdk/components/forms/switch/src/switch.component.html","../../../projects/sdk/components/forms/switch/sixbell-telco-sdk-components-forms-switch.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { ChangeDetectionStrategy, Component, input, model, output } from '@angular/core';\nimport { ControlValueAccessor, FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { TypographyDirective } from '@sixbell-telco/sdk/directives/typography';\nimport { cn } from '@sixbell-telco/sdk/utils/cn';\nimport { cva } from 'class-variance-authority';\n\nconst switchComponent = cva(\n\t['toggle', 'border-transparent checked:border-transparent bg-base-100 [--tglbg:var(--fallback-b1,oklch(var(--s)/1))] hover:bg-base-100'],\n\t{\n\t\tvariants: {\n\t\t\tvariant: {\n\t\t\t\tprimary: [\n\t\t\t\t\t'checked:border-transparent',\n\t\t\t\t\t'checked:outline-primary',\n\t\t\t\t\t'checked:bg-primary-content',\n\t\t\t\t\t'checked:hover:bg-primary-content',\n\t\t\t\t\t'checked:[--tglbg:var(--fallback-p,oklch(var(--p)/var(--tw-bg-opacity)))]',\n\t\t\t\t],\n\t\t\t\twarning: [\n\t\t\t\t\t'checked:border-transparent',\n\t\t\t\t\t'checked:outline-warning',\n\t\t\t\t\t'checked:bg-base-100',\n\t\t\t\t\t'checked:hover:bg-base-100',\n\t\t\t\t\t'checked:[--tglbg:var(--fallback-wa,oklch(var(--wa)/var(--tw-bg-opacity)))]',\n\t\t\t\t],\n\t\t\t\terror: [\n\t\t\t\t\t'checked:border-transparent',\n\t\t\t\t\t'checked:outline-error',\n\t\t\t\t\t'checked:bg-error-content',\n\t\t\t\t\t'checked:hover:bg-error-content',\n\t\t\t\t\t'checked:[--tglbg:var(--fallback-er,oklch(var(--er)/var(--tw-bg-opacity)))]',\n\t\t\t\t],\n\t\t\t},\n\t\t\tsize: {\n\t\t\t\txs: ['toggle-xs'],\n\t\t\t\tsm: ['toggle-sm'],\n\t\t\t\tmd: ['toggle-md'],\n\t\t\t\tlg: ['toggle-lg'],\n\t\t\t},\n\t\t},\n\t\tcompoundVariants: [],\n\t\tdefaultVariants: {\n\t\t\tvariant: 'primary',\n\t\t\tsize: 'md',\n\t\t},\n\t},\n);\n\nexport type SwitchVariantProps = 'primary' | 'warning' | 'error' | null | undefined;\nexport type SwitchSizeProps = 'xs' | 'sm' | 'md' | 'lg' | null | undefined;\n\nexport type SwitchProps = {\n\tvariant?: SwitchVariantProps;\n\tsize?: SwitchSizeProps;\n};\n\n@Component({\n\tselector: 'st-switch',\n\tstandalone: true,\n\timports: [FormsModule, TypographyDirective],\n\tproviders: [\n\t\t{\n\t\t\tprovide: NG_VALUE_ACCESSOR,\n\t\t\tuseExisting: SwitchComponent,\n\t\t\tmulti: true,\n\t\t},\n\t],\n\ttemplateUrl: './switch.component.html',\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SwitchComponent implements ControlValueAccessor {\n\t// Base switch properties\n\tvariant = input<SwitchVariantProps>('primary');\n\tsize = input<SwitchSizeProps>('md');\n\tclasses = input<string>('');\n\tlabel = input<string>('');\n\tname = input<string | null>(null);\n\n\tvalue = model<boolean>(false);\n\n\t// ControlValueAccessor attributes\n\tprivate onControlChange: any = () => {};\n\tprivate onControlTouch: any = () => {};\n\tdisabled = model<boolean>(false);\n\n\t// ControlValueAccessor methods\n\twriteValue(obj: any): void {\n\t\tthis.value.set(obj);\n\t}\n\n\tregisterOnChange(fn: any): void {\n\t\tthis.onControlChange = fn;\n\t}\n\n\tregisterOnTouched(fn: any): void {\n\t\tthis.onControlTouch = fn;\n\t}\n\n\tsetDisabledState?(isDisabled: boolean): void {\n\t\tthis.disabled.set(isDisabled);\n\t}\n\n\t// Change handler\n\tonChange = output<boolean>();\n\n\tget componentClass() {\n\t\treturn cn(\n\t\t\tswitchComponent({\n\t\t\t\tvariant: this.variant(),\n\t\t\t\tsize: this.size(),\n\t\t\t\tclass: this.classes(),\n\t\t\t}),\n\t\t);\n\t}\n\thandleChange(): void {\n\t\tthis.onControlChange(this.value());\n\t\tthis.onChange.emit(this.value());\n\t}\n\n\t// Blur handler\n\thandleBlur() {\n\t\tthis.onControlTouch();\n\t}\n}\n","<div class=\"mb-2 flex items-center gap-4\">\n\t@if (label()) {\n\t\t<label [for]=\"this.name()\"\n\t\t\t><span typography [tyVariant]=\"'body'\" [tyColor]=\"'base'\">{{ label() }}</span></label\n\t\t>\n\t}\n\n\t<input\n\t\ttype=\"checkbox\"\n\t\t[class]=\"componentClass\"\n\t\t[attr.name]=\"name()\"\n\t\t[(ngModel)]=\"value\"\n\t\t[disabled]=\"disabled()\"\n\t\t(change)=\"handleChange()\"\n\t\t(blur)=\"handleBlur()\"\n\t/>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;AAAA;AAOA,MAAM,eAAe,GAAG,GAAG,CAC1B,CAAC,QAAQ,EAAE,4HAA4H,CAAC,EACxI;AACC,IAAA,QAAQ,EAAE;AACT,QAAA,OAAO,EAAE;AACR,YAAA,OAAO,EAAE;gBACR,4BAA4B;gBAC5B,yBAAyB;gBACzB,4BAA4B;gBAC5B,kCAAkC;gBAClC,0EAA0E;AAC1E,aAAA;AACD,YAAA,OAAO,EAAE;gBACR,4BAA4B;g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AAA,IAAA,EAAA,EAAA,CAAA,4BAAA,EAAA,QAAA,EAAA,uGAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,eAAA,EAAA,QAAA,EAAA,2CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,OAAA,EAAA,QAAA,EAAA,qDAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,UAAA,EAAA,SAAA,EAAA,gBAAA,CAAA,EAAA,OAAA,EAAA,CAAA,eAAA,CAAA,EAAA,QAAA,EAAA,CAAA,SAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,mBAAmB,EAAA,QAAA,EAAA,cAAA,EAAA,MAAA,EAAA,CAAA,WAAA,EAAA,SAAA,EAAA,cAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;4FAW9B,eAAe,EAAA,UAAA,EAAA,CAAA;kBAd3B,SAAS;+BACC,WAAW,EAAA,UAAA,EACT,IAAI,EACP,OAAA,EAAA,CAAC,WAAW,EAAE,mBAAmB,CAAC,EAChC,SAAA,EAAA;AACV,wBAAA;AACC,4BAAA,OAAO,EAAE,iBAAiB;AAC1B,4BAAA,WAAW,EAAiB,eAAA;AAC5B,4BAAA,KAAK,EAAE,IAAI;AACX,yBAAA;qBACD,EAEgB,eAAA,EAAA,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,ubAAA,EAAA,CAAA;;;AErEhD;;AAEG;;;;"}
|
|
@@ -10,52 +10,48 @@ import { cva } from 'class-variance-authority';
|
|
|
10
10
|
import { Subject, switchMap, skip, debounceTime, distinctUntilChanged } from 'rxjs';
|
|
11
11
|
|
|
12
12
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
13
|
-
const textareaComponent = cva([
|
|
13
|
+
const textareaComponent = cva([
|
|
14
|
+
'textarea',
|
|
15
|
+
'transition',
|
|
16
|
+
'duration-300',
|
|
17
|
+
'ease-ease-out-back',
|
|
18
|
+
'w-full',
|
|
19
|
+
'text-pretty',
|
|
20
|
+
'font-body',
|
|
21
|
+
'font-normal',
|
|
22
|
+
'rounded-btn',
|
|
23
|
+
'leading-normal',
|
|
24
|
+
], {
|
|
14
25
|
variants: {
|
|
15
26
|
variant: {
|
|
16
|
-
primary: ['textarea
|
|
17
|
-
secondary: ['textarea
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
'round-sm': ['rounded-btn-sm'],
|
|
25
|
-
'round-md': ['rounded-btn-md'],
|
|
26
|
-
'round-lg': ['rounded-btn-lg'],
|
|
27
|
+
primary: ['textarea-primary'],
|
|
28
|
+
secondary: ['textarea-secondary'],
|
|
29
|
+
tertiary: ['textarea-tertiary'],
|
|
30
|
+
accent: ['textarea-accent'],
|
|
31
|
+
info: ['textarea-info'],
|
|
32
|
+
success: ['textarea-success'],
|
|
33
|
+
warning: ['textarea-warning'],
|
|
34
|
+
error: ['textarea-error'],
|
|
27
35
|
},
|
|
28
36
|
size: {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
'2xl': ['min-h-16', 'h-16'],
|
|
34
|
-
'3xl': ['min-h-20', 'h-20'],
|
|
35
|
-
'4xl': ['min-h-24', 'h-24'],
|
|
36
|
-
},
|
|
37
|
-
padding: {
|
|
38
|
-
sm: ['px-4'],
|
|
39
|
-
md: ['px-6'],
|
|
40
|
-
lg: ['px-8'],
|
|
37
|
+
xs: ['textarea-xs', 'text-xs'],
|
|
38
|
+
sm: ['textarea-sm', 'text-sm'],
|
|
39
|
+
md: ['textarea-md', 'text-base'],
|
|
40
|
+
lg: ['textarea-lg', 'text-lg'],
|
|
41
41
|
},
|
|
42
42
|
},
|
|
43
43
|
compoundVariants: [],
|
|
44
44
|
defaultVariants: {
|
|
45
45
|
variant: 'secondary',
|
|
46
|
-
shape: 'round-sm',
|
|
47
46
|
size: 'md',
|
|
48
|
-
padding: 'md',
|
|
49
47
|
},
|
|
50
48
|
});
|
|
51
49
|
class TextareaComponent {
|
|
52
50
|
// Base input properties
|
|
53
|
-
variant = input(
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
classes = input('');
|
|
58
|
-
label = input('');
|
|
51
|
+
variant = input();
|
|
52
|
+
size = input();
|
|
53
|
+
ghost = input(false);
|
|
54
|
+
label = input(null);
|
|
59
55
|
name = input(null);
|
|
60
56
|
placeholder = input('');
|
|
61
57
|
rows = input(3);
|
|
@@ -122,29 +118,20 @@ class TextareaComponent {
|
|
|
122
118
|
get componentClass() {
|
|
123
119
|
return cn(textareaComponent({
|
|
124
120
|
variant: this.variant(),
|
|
125
|
-
shape: this.shape(),
|
|
126
121
|
size: this.size(),
|
|
127
|
-
|
|
128
|
-
class: this.classes(),
|
|
129
|
-
}));
|
|
122
|
+
}), { 'textarea-bordered': !this.ghost() });
|
|
130
123
|
}
|
|
131
124
|
get errorClass() {
|
|
132
125
|
return cn(textareaComponent({
|
|
133
126
|
variant: 'error',
|
|
134
|
-
shape: this.shape(),
|
|
135
127
|
size: this.size(),
|
|
136
|
-
|
|
137
|
-
class: this.classes(),
|
|
138
|
-
}));
|
|
128
|
+
}), { 'textarea-bordered': !this.ghost() });
|
|
139
129
|
}
|
|
140
130
|
get successClass() {
|
|
141
131
|
return cn(textareaComponent({
|
|
142
132
|
variant: 'success',
|
|
143
|
-
shape: this.shape(),
|
|
144
133
|
size: this.size(),
|
|
145
|
-
|
|
146
|
-
class: this.classes(),
|
|
147
|
-
}));
|
|
134
|
+
}), { 'textarea-bordered': !this.ghost() });
|
|
148
135
|
}
|
|
149
136
|
get validationClass() {
|
|
150
137
|
if (!this.formField)
|
|
@@ -160,13 +147,13 @@ class TextareaComponent {
|
|
|
160
147
|
return this.componentClass;
|
|
161
148
|
}
|
|
162
149
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: TextareaComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
163
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.12", type: TextareaComponent, isStandalone: true, selector: "st-textarea", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null },
|
|
150
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.12", type: TextareaComponent, isStandalone: true, selector: "st-textarea", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, ghost: { classPropertyName: "ghost", publicName: "ghost", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, rows: { classPropertyName: "rows", publicName: "rows", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, maxCharacters: { classPropertyName: "maxCharacters", publicName: "maxCharacters", isSignal: true, isRequired: false, transformFunction: null }, parentForm: { classPropertyName: "parentForm", publicName: "parentForm", isSignal: true, isRequired: false, transformFunction: null }, formControlName: { classPropertyName: "formControlName", publicName: "formControlName", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, debounceTime: { classPropertyName: "debounceTime", publicName: "debounceTime", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", disabled: "disabledChange", onEnter: "onEnter", onDebounceChange: "onDebounceChange" }, providers: [
|
|
164
151
|
{
|
|
165
152
|
provide: NG_VALUE_ACCESSOR,
|
|
166
153
|
useExisting: TextareaComponent,
|
|
167
154
|
multi: true,
|
|
168
155
|
},
|
|
169
|
-
], ngImport: i0, template: "<div class=\"flex flex-col gap-1\">\n\t@if (label()) {\n\t\t<label [for]=\"this.name()\">\n\t\t\t<span typography [
|
|
156
|
+
], ngImport: i0, template: "<div class=\"flex flex-col gap-1\">\n\t@if (label()) {\n\t\t<label [for]=\"this.name()\">\n\t\t\t<span typography [tyVariant]=\"'body'\" [tyColor]=\"'base'\">{{ label() }}</span></label\n\t\t>\n\t}\n\n\t<textarea\n\t\t[class]=\"validationClass\"\n\t\t[attr.rows]=\"rows()\"\n\t\t[attr.name]=\"name()\"\n\t\t[attr.placeholder]=\"placeholder()\"\n\t\t[(ngModel)]=\"value\"\n\t\t[disabled]=\"disabled()\"\n\t\t(ngModelChange)=\"handleChange()\"\n\t\t(blur)=\"handleBlur()\"\n\t></textarea>\n\n\t<div class=\"flex justify-between\">\n\t\t<div>\n\t\t\t<ng-content></ng-content>\n\t\t</div>\n\n\t\t@if (maxCharacters()) {\n\t\t\t<p\n\t\t\t\ttypography\n\t\t\t\t[tyVariant]=\"'body-sm'\"\n\t\t\t\t[tyFontWeight]=\"'normal'\"\n\t\t\t\t[ngClass]=\"{\n\t\t\t\t\t'text-base-content transition-colors duration-300 ease-ease-out-back': invalidMaxCharacters() === false,\n\t\t\t\t\t'text-error transition-colors duration-300 ease-ease-out-back': invalidMaxCharacters() === true,\n\t\t\t\t}\"\n\t\t\t>\n\t\t\t\t{{ value().length }} de {{ maxCharacters() }} caracteres\n\t\t\t</p>\n\t\t}\n\t</div>\n</div>\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: TypographyDirective, selector: "[typography]", inputs: ["tyVariant", "tyColor", "tyFontWeight"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
170
157
|
}
|
|
171
158
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: TextareaComponent, decorators: [{
|
|
172
159
|
type: Component,
|
|
@@ -176,7 +163,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImpo
|
|
|
176
163
|
useExisting: TextareaComponent,
|
|
177
164
|
multi: true,
|
|
178
165
|
},
|
|
179
|
-
], template: "<div class=\"flex flex-col gap-1\">\n\t@if (label()) {\n\t\t<label [for]=\"this.name()\">\n\t\t\t<span typography [
|
|
166
|
+
], template: "<div class=\"flex flex-col gap-1\">\n\t@if (label()) {\n\t\t<label [for]=\"this.name()\">\n\t\t\t<span typography [tyVariant]=\"'body'\" [tyColor]=\"'base'\">{{ label() }}</span></label\n\t\t>\n\t}\n\n\t<textarea\n\t\t[class]=\"validationClass\"\n\t\t[attr.rows]=\"rows()\"\n\t\t[attr.name]=\"name()\"\n\t\t[attr.placeholder]=\"placeholder()\"\n\t\t[(ngModel)]=\"value\"\n\t\t[disabled]=\"disabled()\"\n\t\t(ngModelChange)=\"handleChange()\"\n\t\t(blur)=\"handleBlur()\"\n\t></textarea>\n\n\t<div class=\"flex justify-between\">\n\t\t<div>\n\t\t\t<ng-content></ng-content>\n\t\t</div>\n\n\t\t@if (maxCharacters()) {\n\t\t\t<p\n\t\t\t\ttypography\n\t\t\t\t[tyVariant]=\"'body-sm'\"\n\t\t\t\t[tyFontWeight]=\"'normal'\"\n\t\t\t\t[ngClass]=\"{\n\t\t\t\t\t'text-base-content transition-colors duration-300 ease-ease-out-back': invalidMaxCharacters() === false,\n\t\t\t\t\t'text-error transition-colors duration-300 ease-ease-out-back': invalidMaxCharacters() === true,\n\t\t\t\t}\"\n\t\t\t>\n\t\t\t\t{{ value().length }} de {{ maxCharacters() }} caracteres\n\t\t\t</p>\n\t\t}\n\t</div>\n</div>\n" }]
|
|
180
167
|
}], ctorParameters: () => [] });
|
|
181
168
|
|
|
182
169
|
/**
|