@egose/shadcn-theme-ng 0.0.27 → 0.0.28
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/accordion/README.md +64 -0
- package/accordion/fesm2022/accordion.mjs +160 -0
- package/accordion/fesm2022/accordion.mjs.map +1 -0
- package/accordion/package.json +25 -0
- package/accordion/types/accordion.d.ts +49 -0
- package/alert/fesm2022/alert.mjs +29 -24
- package/alert/fesm2022/alert.mjs.map +1 -1
- package/alert/package.json +25 -0
- package/alert-dialog/README.md +11 -0
- package/alert-dialog/fesm2022/alert-dialog.mjs +287 -0
- package/alert-dialog/fesm2022/alert-dialog.mjs.map +1 -0
- package/alert-dialog/package.json +25 -0
- package/alert-dialog/types/alert-dialog.d.ts +90 -0
- package/aspect-ratio/README.md +11 -0
- package/aspect-ratio/fesm2022/aspect-ratio.mjs +62 -0
- package/aspect-ratio/fesm2022/aspect-ratio.mjs.map +1 -0
- package/aspect-ratio/package.json +25 -0
- package/aspect-ratio/types/aspect-ratio.d.ts +21 -0
- package/autocomplete/README.md +64 -0
- package/autocomplete/fesm2022/autocomplete.mjs +409 -0
- package/autocomplete/fesm2022/autocomplete.mjs.map +1 -0
- package/autocomplete/package.json +24 -0
- package/autocomplete/types/autocomplete.d.ts +96 -0
- package/avatar/README.md +11 -0
- package/avatar/fesm2022/avatar.mjs +178 -0
- package/avatar/fesm2022/avatar.mjs.map +1 -0
- package/avatar/package.json +25 -0
- package/avatar/types/avatar.d.ts +50 -0
- package/badge/fesm2022/badge.mjs +15 -9
- package/badge/fesm2022/badge.mjs.map +1 -1
- package/badge/package.json +25 -0
- package/basic-alert/fesm2022/basic-alert.mjs +11 -7
- package/basic-alert/fesm2022/basic-alert.mjs.map +1 -1
- package/basic-alert/package.json +24 -0
- package/breadcrumb/README.md +11 -0
- package/breadcrumb/fesm2022/breadcrumb.mjs +224 -0
- package/breadcrumb/fesm2022/breadcrumb.mjs.map +1 -0
- package/breadcrumb/package.json +25 -0
- package/breadcrumb/types/breadcrumb.d.ts +57 -0
- package/button/fesm2022/button.mjs +99 -25
- package/button/fesm2022/button.mjs.map +1 -1
- package/button/package.json +25 -0
- package/button/{index.d.ts → types/button.d.ts} +30 -9
- package/button-group/README.md +11 -0
- package/button-group/fesm2022/button-group.mjs +102 -0
- package/button-group/fesm2022/button-group.mjs.map +1 -0
- package/button-group/package.json +25 -0
- package/button-group/types/button-group.d.ts +30 -0
- package/calendar/fesm2022/calendar.mjs +868 -546
- package/calendar/fesm2022/calendar.mjs.map +1 -1
- package/calendar/package.json +24 -0
- package/calendar/types/calendar.d.ts +94 -0
- package/card/README.md +11 -0
- package/card/fesm2022/card.mjs +169 -0
- package/card/fesm2022/card.mjs.map +1 -0
- package/card/package.json +25 -0
- package/card/types/card.d.ts +54 -0
- package/carousel/README.md +11 -0
- package/carousel/fesm2022/carousel.mjs +309 -0
- package/carousel/fesm2022/carousel.mjs.map +1 -0
- package/carousel/package.json +25 -0
- package/carousel/types/carousel.d.ts +84 -0
- package/checkbox/README.md +64 -0
- package/checkbox/fesm2022/checkbox.mjs +151 -0
- package/checkbox/fesm2022/checkbox.mjs.map +1 -0
- package/checkbox/package.json +24 -0
- package/checkbox/types/checkbox.d.ts +55 -0
- package/collapsible/README.md +11 -0
- package/collapsible/fesm2022/collapsible.mjs +77 -0
- package/collapsible/fesm2022/collapsible.mjs.map +1 -0
- package/collapsible/package.json +25 -0
- package/collapsible/types/collapsible.d.ts +27 -0
- package/combobox/README.md +11 -0
- package/combobox/fesm2022/combobox.mjs +683 -0
- package/combobox/fesm2022/combobox.mjs.map +1 -0
- package/combobox/package.json +25 -0
- package/combobox/types/combobox.d.ts +151 -0
- package/command/README.md +11 -0
- package/command/fesm2022/command.mjs +361 -0
- package/command/fesm2022/command.mjs.map +1 -0
- package/command/package.json +25 -0
- package/command/types/command.d.ts +89 -0
- package/confirmation-dialog/README.md +64 -0
- package/confirmation-dialog/fesm2022/confirmation-dialog.mjs +104 -0
- package/confirmation-dialog/fesm2022/confirmation-dialog.mjs.map +1 -0
- package/confirmation-dialog/package.json +24 -0
- package/confirmation-dialog/types/confirmation-dialog.d.ts +24 -0
- package/context-menu/README.md +11 -0
- package/context-menu/fesm2022/context-menu.mjs +89 -0
- package/context-menu/fesm2022/context-menu.mjs.map +1 -0
- package/context-menu/package.json +25 -0
- package/context-menu/types/context-menu.d.ts +34 -0
- package/date-picker/fesm2022/date-picker.mjs +1262 -307
- package/date-picker/fesm2022/date-picker.mjs.map +1 -1
- package/date-picker/package.json +24 -0
- package/date-picker/types/date-picker.d.ts +551 -0
- package/dialog/README.md +64 -0
- package/dialog/fesm2022/dialog.mjs +307 -0
- package/dialog/fesm2022/dialog.mjs.map +1 -0
- package/dialog/package.json +24 -0
- package/dialog/types/dialog.d.ts +95 -0
- package/drawer/README.md +11 -0
- package/drawer/fesm2022/drawer.mjs +271 -0
- package/drawer/fesm2022/drawer.mjs.map +1 -0
- package/drawer/package.json +25 -0
- package/drawer/types/drawer.d.ts +76 -0
- package/dropdown-menu/README.md +11 -0
- package/dropdown-menu/fesm2022/dropdown-menu.mjs +542 -0
- package/dropdown-menu/fesm2022/dropdown-menu.mjs.map +1 -0
- package/dropdown-menu/package.json +25 -0
- package/dropdown-menu/types/dropdown-menu.d.ts +176 -0
- package/empty/README.md +11 -0
- package/empty/fesm2022/empty.mjs +151 -0
- package/empty/fesm2022/empty.mjs.map +1 -0
- package/empty/package.json +25 -0
- package/empty/types/empty.d.ts +54 -0
- package/field/README.md +11 -0
- package/field/fesm2022/field.mjs +367 -0
- package/field/fesm2022/field.mjs.map +1 -0
- package/field/package.json +25 -0
- package/field/types/field.d.ts +107 -0
- package/form-checkbox/README.md +64 -0
- package/form-checkbox/fesm2022/form-checkbox.mjs +154 -0
- package/form-checkbox/fesm2022/form-checkbox.mjs.map +1 -0
- package/form-checkbox/package.json +24 -0
- package/form-checkbox/types/form-checkbox.d.ts +27 -0
- package/form-date-picker/fesm2022/form-date-picker.mjs +57 -50
- package/form-date-picker/fesm2022/form-date-picker.mjs.map +1 -1
- package/form-date-picker/package.json +24 -0
- package/form-field/fesm2022/form-field.mjs +37 -25
- package/form-field/fesm2022/form-field.mjs.map +1 -1
- package/form-field/package.json +25 -0
- package/form-field/{index.d.ts → types/form-field.d.ts} +4 -3
- package/form-field-simple/fesm2022/form-field-simple.mjs +14 -9
- package/form-field-simple/fesm2022/form-field-simple.mjs.map +1 -1
- package/form-field-simple/package.json +24 -0
- package/form-searchable-multiselect/README.md +64 -0
- package/form-searchable-multiselect/fesm2022/form-searchable-multiselect.mjs +158 -0
- package/form-searchable-multiselect/fesm2022/form-searchable-multiselect.mjs.map +1 -0
- package/form-searchable-multiselect/package.json +24 -0
- package/form-searchable-multiselect/types/form-searchable-multiselect.d.ts +30 -0
- package/form-select/fesm2022/form-select.mjs +131 -70
- package/form-select/fesm2022/form-select.mjs.map +1 -1
- package/form-select/package.json +24 -0
- package/form-text-input/fesm2022/form-text-input.mjs +66 -37
- package/form-text-input/fesm2022/form-text-input.mjs.map +1 -1
- package/form-text-input/package.json +24 -0
- package/form-textarea/fesm2022/form-textarea.mjs +53 -29
- package/form-textarea/fesm2022/form-textarea.mjs.map +1 -1
- package/form-textarea/package.json +24 -0
- package/hover-card/README.md +11 -0
- package/hover-card/fesm2022/hover-card.mjs +123 -0
- package/hover-card/fesm2022/hover-card.mjs.map +1 -0
- package/hover-card/package.json +25 -0
- package/hover-card/types/hover-card.d.ts +36 -0
- package/icon/fesm2022/icon.mjs +11 -9
- package/icon/fesm2022/icon.mjs.map +1 -1
- package/icon/package.json +25 -0
- package/input/fesm2022/input.mjs +21 -71
- package/input/fesm2022/input.mjs.map +1 -1
- package/input/package.json +25 -0
- package/input/types/input.d.ts +18 -0
- package/input-group/README.md +11 -0
- package/input-group/fesm2022/input-group.mjs +199 -0
- package/input-group/fesm2022/input-group.mjs.map +1 -0
- package/input-group/package.json +25 -0
- package/input-group/types/input-group.d.ts +52 -0
- package/input-otp/README.md +11 -0
- package/input-otp/fesm2022/input-otp.mjs +141 -0
- package/input-otp/fesm2022/input-otp.mjs.map +1 -0
- package/input-otp/package.json +25 -0
- package/input-otp/types/input-otp.d.ts +43 -0
- package/item/README.md +11 -0
- package/item/fesm2022/item.mjs +278 -0
- package/item/fesm2022/item.mjs.map +1 -0
- package/item/package.json +25 -0
- package/item/types/item.d.ts +101 -0
- package/kbd/README.md +11 -0
- package/kbd/fesm2022/kbd.mjs +61 -0
- package/kbd/fesm2022/kbd.mjs.map +1 -0
- package/kbd/package.json +25 -0
- package/kbd/types/kbd.d.ts +22 -0
- package/label/fesm2022/label.mjs +10 -9
- package/label/fesm2022/label.mjs.map +1 -1
- package/label/package.json +25 -0
- package/layout-simple/README.md +64 -0
- package/layout-simple/fesm2022/layout-simple.mjs +719 -0
- package/layout-simple/fesm2022/layout-simple.mjs.map +1 -0
- package/layout-simple/package.json +24 -0
- package/layout-simple/types/layout-simple.d.ts +153 -0
- package/menubar/README.md +11 -0
- package/menubar/fesm2022/menubar.mjs +108 -0
- package/menubar/fesm2022/menubar.mjs.map +1 -0
- package/menubar/package.json +25 -0
- package/menubar/types/menubar.d.ts +40 -0
- package/native-select/README.md +11 -0
- package/native-select/fesm2022/native-select.mjs +207 -0
- package/native-select/fesm2022/native-select.mjs.map +1 -0
- package/native-select/package.json +25 -0
- package/native-select/types/native-select.d.ts +70 -0
- package/navigation-menu/README.md +11 -0
- package/navigation-menu/fesm2022/navigation-menu.mjs +206 -0
- package/navigation-menu/fesm2022/navigation-menu.mjs.map +1 -0
- package/navigation-menu/package.json +25 -0
- package/navigation-menu/types/navigation-menu.d.ts +54 -0
- package/package.json +239 -47
- package/pagination/README.md +11 -0
- package/pagination/fesm2022/pagination.mjs +808 -0
- package/pagination/fesm2022/pagination.mjs.map +1 -0
- package/pagination/package.json +25 -0
- package/pagination/types/pagination.d.ts +192 -0
- package/popover/fesm2022/popover.mjs +123 -29
- package/popover/fesm2022/popover.mjs.map +1 -1
- package/popover/package.json +24 -0
- package/popover/types/popover.d.ts +54 -0
- package/progress/README.md +11 -0
- package/progress/fesm2022/progress.mjs +77 -0
- package/progress/fesm2022/progress.mjs.map +1 -0
- package/progress/package.json +25 -0
- package/progress/types/progress.d.ts +27 -0
- package/radio-group/README.md +64 -0
- package/radio-group/fesm2022/radio-group.mjs +204 -0
- package/radio-group/fesm2022/radio-group.mjs.map +1 -0
- package/radio-group/package.json +25 -0
- package/radio-group/types/radio-group.d.ts +71 -0
- package/resizable/README.md +11 -0
- package/resizable/fesm2022/resizable.mjs +111 -0
- package/resizable/fesm2022/resizable.mjs.map +1 -0
- package/resizable/package.json +25 -0
- package/resizable/types/resizable.d.ts +32 -0
- package/scroll-area/README.md +11 -0
- package/scroll-area/fesm2022/scroll-area.mjs +51 -0
- package/scroll-area/fesm2022/scroll-area.mjs.map +1 -0
- package/scroll-area/package.json +25 -0
- package/scroll-area/types/scroll-area.d.ts +16 -0
- package/searchable-multiselect/README.md +64 -0
- package/searchable-multiselect/fesm2022/searchable-multiselect.mjs +225 -0
- package/searchable-multiselect/fesm2022/searchable-multiselect.mjs.map +1 -0
- package/searchable-multiselect/package.json +24 -0
- package/searchable-multiselect/types/searchable-multiselect.d.ts +39 -0
- package/select/fesm2022/select.mjs +373 -191
- package/select/fesm2022/select.mjs.map +1 -1
- package/select/package.json +25 -0
- package/select/types/select.d.ts +119 -0
- package/separator/fesm2022/separator.mjs +16 -14
- package/separator/fesm2022/separator.mjs.map +1 -1
- package/separator/package.json +24 -0
- package/separator/{index.d.ts → types/separator.d.ts} +4 -5
- package/sheet/fesm2022/sheet.mjs +49 -42
- package/sheet/fesm2022/sheet.mjs.map +1 -1
- package/sheet/package.json +24 -0
- package/sidebar/README.md +11 -0
- package/sidebar/fesm2022/sidebar.mjs +948 -0
- package/sidebar/fesm2022/sidebar.mjs.map +1 -0
- package/sidebar/package.json +25 -0
- package/sidebar/types/sidebar.d.ts +237 -0
- package/skeleton/README.md +11 -0
- package/skeleton/fesm2022/skeleton.mjs +44 -0
- package/skeleton/fesm2022/skeleton.mjs.map +1 -0
- package/skeleton/package.json +25 -0
- package/skeleton/types/skeleton.d.ts +16 -0
- package/slider/README.md +11 -0
- package/slider/fesm2022/slider.mjs +144 -0
- package/slider/fesm2022/slider.mjs.map +1 -0
- package/slider/package.json +25 -0
- package/slider/types/slider.d.ts +19 -0
- package/sonner/fesm2022/sonner.mjs +29 -34
- package/sonner/fesm2022/sonner.mjs.map +1 -1
- package/sonner/package.json +25 -0
- package/spinner/fesm2022/spinner.mjs +17 -13
- package/spinner/fesm2022/spinner.mjs.map +1 -1
- package/spinner/package.json +25 -0
- package/switch/fesm2022/switch.mjs +27 -24
- package/switch/fesm2022/switch.mjs.map +1 -1
- package/switch/package.json +25 -0
- package/table/README.md +11 -0
- package/table/fesm2022/table.mjs +211 -0
- package/table/fesm2022/table.mjs.map +1 -0
- package/table/package.json +25 -0
- package/table/types/table.d.ts +87 -0
- package/tabs/README.md +64 -0
- package/tabs/fesm2022/tabs.mjs +286 -0
- package/tabs/fesm2022/tabs.mjs.map +1 -0
- package/tabs/package.json +25 -0
- package/tabs/types/tabs.d.ts +71 -0
- package/textarea/README.md +11 -0
- package/textarea/fesm2022/textarea.mjs +47 -0
- package/textarea/fesm2022/textarea.mjs.map +1 -0
- package/textarea/package.json +25 -0
- package/textarea/types/textarea.d.ts +18 -0
- package/toggle/README.md +11 -0
- package/toggle/fesm2022/toggle.mjs +78 -0
- package/toggle/fesm2022/toggle.mjs.map +1 -0
- package/toggle/package.json +25 -0
- package/toggle/types/toggle.d.ts +27 -0
- package/toggle-group/README.md +11 -0
- package/toggle-group/fesm2022/toggle-group.mjs +117 -0
- package/toggle-group/fesm2022/toggle-group.mjs.map +1 -0
- package/toggle-group/package.json +25 -0
- package/toggle-group/types/toggle-group.d.ts +39 -0
- package/tooltip/README.md +64 -0
- package/tooltip/fesm2022/tooltip.mjs +72 -0
- package/tooltip/fesm2022/tooltip.mjs.map +1 -0
- package/tooltip/package.json +25 -0
- package/tooltip/types/tooltip.d.ts +22 -0
- package/typography/README.md +11 -0
- package/typography/fesm2022/typography.mjs +242 -0
- package/typography/fesm2022/typography.mjs.map +1 -0
- package/typography/package.json +25 -0
- package/typography/types/typography.d.ts +94 -0
- package/utils/fesm2022/utils.mjs +184 -1
- package/utils/fesm2022/utils.mjs.map +1 -1
- package/utils/package.json +25 -0
- package/utils/types/utils.d.ts +13 -0
- package/calendar/index.d.ts +0 -111
- package/date-picker/index.d.ts +0 -227
- package/input/index.d.ts +0 -41
- package/popover/index.d.ts +0 -30
- package/select/index.d.ts +0 -92
- package/utils/index.d.ts +0 -5
- /package/alert/{index.d.ts → types/alert.d.ts} +0 -0
- /package/badge/{index.d.ts → types/badge.d.ts} +0 -0
- /package/basic-alert/{index.d.ts → types/basic-alert.d.ts} +0 -0
- /package/form-date-picker/{index.d.ts → types/form-date-picker.d.ts} +0 -0
- /package/form-field-simple/{index.d.ts → types/form-field-simple.d.ts} +0 -0
- /package/form-select/{index.d.ts → types/form-select.d.ts} +0 -0
- /package/form-text-input/{index.d.ts → types/form-text-input.d.ts} +0 -0
- /package/form-textarea/{index.d.ts → types/form-textarea.d.ts} +0 -0
- /package/icon/{index.d.ts → types/icon.d.ts} +0 -0
- /package/label/{index.d.ts → types/label.d.ts} +0 -0
- /package/sheet/{index.d.ts → types/sheet.d.ts} +0 -0
- /package/sonner/{index.d.ts → types/sonner.d.ts} +0 -0
- /package/spinner/{index.d.ts → types/spinner.d.ts} +0 -0
- /package/switch/{index.d.ts → types/switch.d.ts} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-field.mjs","sources":["../../../projects/form-field/src/lib/error.ts","../../../projects/form-field/src/lib/form-field.ts","../../../projects/form-field/src/lib/hint.ts","../../../projects/form-field/src/public-api.ts","../../../projects/form-field/src/form-field.ts"],"sourcesContent":["import { computed, Directive, input } from '@angular/core';\nimport { hlm } from '@egose/shadcn-theme-ng/utils';\nimport { ClassValue } from 'clsx';\n\n@Directive({\n selector: 'hlm-error',\n host: {\n '[class]': '_computedClass()',\n },\n})\nexport class HlmError {\n public readonly userClass = input<ClassValue>('', { alias: 'class' });\n protected readonly _computedClass = computed(() =>\n hlm('tw:text-destructive tw:block tw:text-sm tw:font-medium', this.userClass()),\n );\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n contentChild,\n contentChildren,\n effect,\n input,\n} from '@angular/core';\nimport { ControlContainer, FormGroupDirective } from '@angular/forms';\nimport {
|
|
1
|
+
{"version":3,"file":"form-field.mjs","sources":["../../../projects/form-field/src/lib/error.ts","../../../projects/form-field/src/lib/form-field.ts","../../../projects/form-field/src/lib/hint.ts","../../../projects/form-field/src/public-api.ts","../../../projects/form-field/src/form-field.ts"],"sourcesContent":["import { computed, Directive, input } from '@angular/core';\nimport { hlm } from '@egose/shadcn-theme-ng/utils';\nimport { ClassValue } from 'clsx';\n\n@Directive({\n selector: 'hlm-error',\n host: {\n '[class]': '_computedClass()',\n },\n})\nexport class HlmError {\n public readonly userClass = input<ClassValue>('', { alias: 'class' });\n protected readonly _computedClass = computed(() =>\n hlm('tw:text-destructive tw:block tw:text-sm tw:font-medium', this.userClass()),\n );\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n contentChild,\n contentChildren,\n effect,\n input,\n} from '@angular/core';\nimport { ControlContainer, FormGroupDirective } from '@angular/forms';\nimport { BrnField, BrnFieldControl } from '@spartan-ng/brain/field';\nimport { hlm } from '@egose/shadcn-theme-ng/utils';\nimport { ClassValue } from 'clsx';\nimport { HlmError } from './error';\n\n@Component({\n selector: 'hlm-form-field',\n template: `\n <ng-content />\n\n @switch (_hasDisplayedMessage()) {\n @case ('error') {\n <ng-content select=\"hlm-error\" />\n }\n @default {\n <ng-content select=\"hlm-hint\" />\n }\n }\n `,\n providers: [{ provide: ControlContainer, useExisting: FormGroupDirective }],\n hostDirectives: [BrnField],\n host: {\n '[class]': '_computedClass()',\n },\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class HlmFormField {\n public readonly userClass = input<ClassValue>('', { alias: 'class' });\n protected readonly _computedClass = computed(() => hlm('tw:block tw:space-y-2', this.userClass()));\n public readonly control = contentChild(BrnFieldControl);\n\n public readonly errorChildren = contentChildren(HlmError);\n\n protected readonly _hasDisplayedMessage = computed<'error' | 'hint'>(() => {\n const errors = this.control()?.errors();\n const hasErrors = !!errors && Object.keys(errors).length > 0;\n return this.errorChildren() && this.errorChildren().length > 0 && hasErrors ? 'error' : 'hint';\n });\n\n constructor() {\n effect(() => {\n if (!this.control()) {\n throw new Error('hlm-form-field must contain a BrnFieldControl.');\n }\n });\n }\n}\n","import { computed, Directive, input } from '@angular/core';\nimport { hlm } from '@egose/shadcn-theme-ng/utils';\nimport { ClassValue } from 'clsx';\n\n@Directive({\n selector: 'hlm-hint',\n host: {\n '[class]': '_computedClass()',\n },\n})\nexport class HlmHint {\n public readonly userClass = input<ClassValue>('', { alias: 'class' });\n protected readonly _computedClass = computed(() =>\n hlm('tw:text-muted-foreground tw:block tw:text-sm', this.userClass()),\n );\n}\n","/*\n * Public API Surface of form-field\n */\n\nimport { NgModule } from '@angular/core';\nimport { HlmError } from './lib/error';\nimport { HlmFormField } from './lib/form-field';\nimport { HlmHint } from './lib/hint';\n\nexport * from './lib/error';\nexport * from './lib/form-field';\nexport * from './lib/hint';\n\nexport const HlmFormFieldImports = [HlmFormField, HlmError, HlmHint];\n\n@NgModule({\n imports: [...HlmFormFieldImports],\n exports: [...HlmFormFieldImports],\n})\nexport class HlmFormFieldModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;MAUa,QAAQ,CAAA;IACH,SAAS,GAAG,KAAK,CAAa,EAAE,iFAAI,KAAK,EAAE,OAAO,EAAA,CAAG;AAClD,IAAA,cAAc,GAAG,QAAQ,CAAC,MAC3C,GAAG,CAAC,wDAAwD,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC;uFAChF;uGAJU,QAAQ,EAAA,IAA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Effects": false,
|
|
13
|
+
"module": "fesm2022/form-field.mjs",
|
|
14
|
+
"typings": "types/form-field.d.ts",
|
|
15
|
+
"exports": {
|
|
16
|
+
"./package.json": {
|
|
17
|
+
"default": "./package.json"
|
|
18
|
+
},
|
|
19
|
+
".": {
|
|
20
|
+
"types": "./types/form-field.d.ts",
|
|
21
|
+
"default": "./fesm2022/form-field.mjs"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"type": "module"
|
|
25
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
2
|
import { ClassValue } from 'clsx';
|
|
3
|
-
import
|
|
3
|
+
import * as i1 from '@spartan-ng/brain/field';
|
|
4
|
+
import { BrnFieldControl } from '@spartan-ng/brain/field';
|
|
4
5
|
|
|
5
6
|
declare class HlmError {
|
|
6
7
|
readonly userClass: _angular_core.InputSignal<ClassValue>;
|
|
@@ -12,12 +13,12 @@ declare class HlmError {
|
|
|
12
13
|
declare class HlmFormField {
|
|
13
14
|
readonly userClass: _angular_core.InputSignal<ClassValue>;
|
|
14
15
|
protected readonly _computedClass: _angular_core.Signal<string>;
|
|
15
|
-
readonly control: _angular_core.Signal<
|
|
16
|
+
readonly control: _angular_core.Signal<BrnFieldControl | undefined>;
|
|
16
17
|
readonly errorChildren: _angular_core.Signal<readonly HlmError[]>;
|
|
17
18
|
protected readonly _hasDisplayedMessage: _angular_core.Signal<"error" | "hint">;
|
|
18
19
|
constructor();
|
|
19
20
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<HlmFormField, never>;
|
|
20
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<HlmFormField, "hlm-form-field", never, { "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, {}, ["control", "errorChildren"], ["*", "hlm-error", "hlm-hint"], true,
|
|
21
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<HlmFormField, "hlm-form-field", never, { "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, {}, ["control", "errorChildren"], ["*", "hlm-error", "hlm-hint"], true, [{ directive: typeof i1.BrnField; inputs: {}; outputs: {}; }]>;
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
declare class HlmHint {
|
|
@@ -5,12 +5,15 @@ import { hlm } from '@egose/shadcn-theme-ng/utils';
|
|
|
5
5
|
import { Subscription } from 'rxjs';
|
|
6
6
|
|
|
7
7
|
class EgFormField {
|
|
8
|
-
userClass = input('', ...(ngDevMode ?
|
|
9
|
-
_computedClass = computed(() => hlm('', this.userClass()),
|
|
10
|
-
|
|
8
|
+
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
9
|
+
_computedClass = computed(() => hlm('', this.userClass()), /* @ts-ignore */
|
|
10
|
+
...(ngDevMode ? [{ debugName: "_computedClass" }] : /* istanbul ignore next */ []));
|
|
11
|
+
control = contentChild(FormControlName, /* @ts-ignore */
|
|
12
|
+
...(ngDevMode ? [{ debugName: "control" }] : /* istanbul ignore next */ []));
|
|
11
13
|
formGroupDirective = inject(FormGroupDirective);
|
|
12
14
|
form = this.formGroupDirective.form;
|
|
13
|
-
statusSignal = signal(null,
|
|
15
|
+
statusSignal = signal(null, /* @ts-ignore */
|
|
16
|
+
...(ngDevMode ? [{ debugName: "statusSignal" }] : /* istanbul ignore next */ []));
|
|
14
17
|
sub = new Subscription();
|
|
15
18
|
ngAfterContentInit() {
|
|
16
19
|
const ctrlDir = this.control();
|
|
@@ -30,16 +33,18 @@ class EgFormField {
|
|
|
30
33
|
return false;
|
|
31
34
|
this.statusSignal();
|
|
32
35
|
return !!ctrlDir.control.errors && (ctrlDir.control.touched || ctrlDir.control.dirty);
|
|
33
|
-
},
|
|
36
|
+
}, /* @ts-ignore */
|
|
37
|
+
...(ngDevMode ? [{ debugName: "hasError" }] : /* istanbul ignore next */ []));
|
|
34
38
|
firstErrorKey = computed(() => {
|
|
35
39
|
const ctrlDir = this.control();
|
|
36
40
|
if (!ctrlDir || !ctrlDir.control.errors)
|
|
37
41
|
return null;
|
|
38
42
|
this.statusSignal();
|
|
39
43
|
return Object.keys(ctrlDir.control.errors)[0] ?? null;
|
|
40
|
-
},
|
|
41
|
-
|
|
42
|
-
static
|
|
44
|
+
}, /* @ts-ignore */
|
|
45
|
+
...(ngDevMode ? [{ debugName: "firstErrorKey" }] : /* istanbul ignore next */ []));
|
|
46
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: EgFormField, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
47
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.7", type: EgFormField, isStandalone: true, selector: "eg-form-field", inputs: { userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "_computedClass()" } }, providers: [{ provide: ControlContainer, useExisting: FormGroupDirective }], queries: [{ propertyName: "control", first: true, predicate: FormControlName, descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
43
48
|
<ng-content></ng-content>
|
|
44
49
|
|
|
45
50
|
@if (hasError()) {
|
|
@@ -49,7 +54,7 @@ class EgFormField {
|
|
|
49
54
|
}
|
|
50
55
|
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
51
56
|
}
|
|
52
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
57
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: EgFormField, decorators: [{
|
|
53
58
|
type: Component,
|
|
54
59
|
args: [{
|
|
55
60
|
selector: 'eg-form-field',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-field-simple.mjs","sources":["../../../projects/form-field-simple/src/lib/form-field-simple.ts","../../../projects/form-field-simple/src/public-api.ts","../../../projects/form-field-simple/src/form-field-simple.ts"],"sourcesContent":["import {\n Component,\n ChangeDetectionStrategy,\n computed,\n input,\n inject,\n contentChild,\n signal,\n AfterContentInit,\n OnDestroy,\n} from '@angular/core';\nimport { ControlContainer, FormControlName, FormGroup, FormGroupDirective } from '@angular/forms';\nimport { hlm } from '@egose/shadcn-theme-ng/utils';\nimport { ClassValue } from 'clsx';\nimport { Subscription } from 'rxjs';\n\n@Component({\n selector: 'eg-form-field',\n template: `\n <ng-content></ng-content>\n\n @if (hasError()) {\n <ng-content select=\"hlm-error\"></ng-content>\n } @else {\n <ng-content select=\"hlm-hint\"></ng-content>\n }\n `,\n providers: [{ provide: ControlContainer, useExisting: FormGroupDirective }],\n host: {\n '[class]': '_computedClass()',\n },\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class EgFormField implements AfterContentInit, OnDestroy {\n public readonly userClass = input<ClassValue>('', { alias: 'class' });\n protected readonly _computedClass = computed(() => hlm('', this.userClass()));\n\n public readonly control = contentChild(FormControlName);\n\n private readonly formGroupDirective = inject(FormGroupDirective);\n public readonly form: FormGroup = this.formGroupDirective.form;\n\n private statusSignal = signal<string | null>(null);\n\n private sub = new Subscription();\n\n ngAfterContentInit() {\n const ctrlDir = this.control();\n if (ctrlDir) {\n this.sub.add(\n ctrlDir.control.statusChanges.subscribe((status) => {\n this.statusSignal.set(status);\n }),\n );\n\n this.statusSignal.set(ctrlDir.control.status);\n }\n }\n\n ngOnDestroy() {\n this.sub.unsubscribe();\n }\n\n public readonly hasError = computed(() => {\n const ctrlDir = this.control();\n if (!ctrlDir) return false;\n\n this.statusSignal();\n\n return !!ctrlDir.control.errors && (ctrlDir.control.touched || ctrlDir.control.dirty);\n });\n\n public readonly firstErrorKey = computed(() => {\n const ctrlDir = this.control();\n if (!ctrlDir || !ctrlDir.control.errors) return null;\n this.statusSignal();\n return Object.keys(ctrlDir.control.errors)[0] ?? null;\n });\n}\n","/*\n * Public API Surface of form-field-simple\n */\n\nexport * from './lib/form-field-simple';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;MAiCa,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"form-field-simple.mjs","sources":["../../../projects/form-field-simple/src/lib/form-field-simple.ts","../../../projects/form-field-simple/src/public-api.ts","../../../projects/form-field-simple/src/form-field-simple.ts"],"sourcesContent":["import {\n Component,\n ChangeDetectionStrategy,\n computed,\n input,\n inject,\n contentChild,\n signal,\n AfterContentInit,\n OnDestroy,\n} from '@angular/core';\nimport { ControlContainer, FormControlName, FormGroup, FormGroupDirective } from '@angular/forms';\nimport { hlm } from '@egose/shadcn-theme-ng/utils';\nimport { ClassValue } from 'clsx';\nimport { Subscription } from 'rxjs';\n\n@Component({\n selector: 'eg-form-field',\n template: `\n <ng-content></ng-content>\n\n @if (hasError()) {\n <ng-content select=\"hlm-error\"></ng-content>\n } @else {\n <ng-content select=\"hlm-hint\"></ng-content>\n }\n `,\n providers: [{ provide: ControlContainer, useExisting: FormGroupDirective }],\n host: {\n '[class]': '_computedClass()',\n },\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class EgFormField implements AfterContentInit, OnDestroy {\n public readonly userClass = input<ClassValue>('', { alias: 'class' });\n protected readonly _computedClass = computed(() => hlm('', this.userClass()));\n\n public readonly control = contentChild(FormControlName);\n\n private readonly formGroupDirective = inject(FormGroupDirective);\n public readonly form: FormGroup = this.formGroupDirective.form;\n\n private statusSignal = signal<string | null>(null);\n\n private sub = new Subscription();\n\n ngAfterContentInit() {\n const ctrlDir = this.control();\n if (ctrlDir) {\n this.sub.add(\n ctrlDir.control.statusChanges.subscribe((status) => {\n this.statusSignal.set(status);\n }),\n );\n\n this.statusSignal.set(ctrlDir.control.status);\n }\n }\n\n ngOnDestroy() {\n this.sub.unsubscribe();\n }\n\n public readonly hasError = computed(() => {\n const ctrlDir = this.control();\n if (!ctrlDir) return false;\n\n this.statusSignal();\n\n return !!ctrlDir.control.errors && (ctrlDir.control.touched || ctrlDir.control.dirty);\n });\n\n public readonly firstErrorKey = computed(() => {\n const ctrlDir = this.control();\n if (!ctrlDir || !ctrlDir.control.errors) return null;\n this.statusSignal();\n return Object.keys(ctrlDir.control.errors)[0] ?? null;\n });\n}\n","/*\n * Public API Surface of form-field-simple\n */\n\nexport * from './lib/form-field-simple';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;MAiCa,WAAW,CAAA;IACN,SAAS,GAAG,KAAK,CAAa,EAAE,iFAAI,KAAK,EAAE,OAAO,EAAA,CAAG;AAClD,IAAA,cAAc,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC;uFAAC;IAE7D,OAAO,GAAG,YAAY,CAAC,eAAe;gFAAC;AAEtC,IAAA,kBAAkB,GAAG,MAAM,CAAC,kBAAkB,CAAC;AAChD,IAAA,IAAI,GAAc,IAAI,CAAC,kBAAkB,CAAC,IAAI;IAEtD,YAAY,GAAG,MAAM,CAAgB,IAAI;qFAAC;AAE1C,IAAA,GAAG,GAAG,IAAI,YAAY,EAAE;IAEhC,kBAAkB,GAAA;AAChB,QAAA,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,EAAE;QAC9B,IAAI,OAAO,EAAE;AACX,YAAA,IAAI,CAAC,GAAG,CAAC,GAAG,CACV,OAAO,CAAC,OAAO,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC,MAAM,KAAI;AACjD,gBAAA,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,MAAM,CAAC;YAC/B,CAAC,CAAC,CACH;YAED,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC;QAC/C;IACF;IAEA,WAAW,GAAA;AACT,QAAA,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE;IACxB;AAEgB,IAAA,QAAQ,GAAG,QAAQ,CAAC,MAAK;AACvC,QAAA,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,EAAE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AAA,SAAA,EAAA,KAAA,EAAA,IAAA,EAAA,SAAA,EAUpC,eAAe,EAAA,WAAA,EAAA,IAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAnB5C;;;;;;;;AAQT,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAOU,WAAW,EAAA,UAAA,EAAA,CAAA;kBAjBvB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,eAAe;AACzB,oBAAA,QAAQ,EAAE;;;;;;;;AAQT,EAAA,CAAA;oBACD,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,kBAAkB,EAAE,CAAC;AAC3E,oBAAA,IAAI,EAAE;AACJ,wBAAA,SAAS,EAAE,kBAAkB;AAC9B,qBAAA;oBACD,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAChD,iBAAA;0LAKwC,eAAe,CAAA,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;ACrCxD;;AAEG;;ACFH;;AAEG;;;;"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "form-field-simple",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"peerDependencies": {
|
|
5
|
+
"@angular/common": "^20.3.0 || ^22.0.0",
|
|
6
|
+
"@angular/core": "^20.3.0 || ^22.0.0"
|
|
7
|
+
},
|
|
8
|
+
"dependencies": {
|
|
9
|
+
"tslib": "^2.3.0"
|
|
10
|
+
},
|
|
11
|
+
"sideEffects": false,
|
|
12
|
+
"module": "fesm2022/form-field-simple.mjs",
|
|
13
|
+
"typings": "types/form-field-simple.d.ts",
|
|
14
|
+
"exports": {
|
|
15
|
+
"./package.json": {
|
|
16
|
+
"default": "./package.json"
|
|
17
|
+
},
|
|
18
|
+
".": {
|
|
19
|
+
"types": "./types/form-field-simple.d.ts",
|
|
20
|
+
"default": "./fesm2022/form-field-simple.mjs"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"type": "module"
|
|
24
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# FormSearchableMultiselect
|
|
2
|
+
|
|
3
|
+
This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 20.3.0.
|
|
4
|
+
|
|
5
|
+
## Code scaffolding
|
|
6
|
+
|
|
7
|
+
Angular CLI includes powerful code scaffolding tools. To generate a new component, run:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
ng generate component component-name
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
ng generate --help
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Building
|
|
20
|
+
|
|
21
|
+
To build the library, run:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
ng build form-searchable-multiselect
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
This command will compile your project, and the build artifacts will be placed in the `dist/` directory.
|
|
28
|
+
|
|
29
|
+
### Publishing the Library
|
|
30
|
+
|
|
31
|
+
Once the project is built, you can publish your library by following these steps:
|
|
32
|
+
|
|
33
|
+
1. Navigate to the `dist` directory:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
cd dist/form-searchable-multiselect
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
2. Run the `npm publish` command to publish your library to the npm registry:
|
|
40
|
+
```bash
|
|
41
|
+
npm publish
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Running unit tests
|
|
45
|
+
|
|
46
|
+
To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
ng test
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Running end-to-end tests
|
|
53
|
+
|
|
54
|
+
For end-to-end (e2e) testing, run:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
ng e2e
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs.
|
|
61
|
+
|
|
62
|
+
## Additional Resources
|
|
63
|
+
|
|
64
|
+
For more information on using the Angular CLI, including detailed command references, visit the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, computed, Component } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/forms';
|
|
4
|
+
import { ReactiveFormsModule, FormGroupDirective, ControlContainer } from '@angular/forms';
|
|
5
|
+
import { HlmLabel } from '@egose/shadcn-theme-ng/label';
|
|
6
|
+
import { EgFormField } from '@egose/shadcn-theme-ng/form-field-simple';
|
|
7
|
+
import { HlmError, HlmHint } from '@egose/shadcn-theme-ng/form-field';
|
|
8
|
+
import { hlm } from '@egose/shadcn-theme-ng/utils';
|
|
9
|
+
import { EgSearchableMultiselect } from '@egose/shadcn-theme-ng/searchable-multiselect';
|
|
10
|
+
|
|
11
|
+
class EgFormSearchableMultiselect {
|
|
12
|
+
// Form field inputs
|
|
13
|
+
label = input(undefined, /* @ts-ignore */
|
|
14
|
+
...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
15
|
+
controlId = input(undefined, /* @ts-ignore */
|
|
16
|
+
...(ngDevMode ? [{ debugName: "controlId" }] : /* istanbul ignore next */ []));
|
|
17
|
+
controlName = input('', /* @ts-ignore */
|
|
18
|
+
...(ngDevMode ? [{ debugName: "controlName" }] : /* istanbul ignore next */ [])); // required for form binding
|
|
19
|
+
error = input(undefined, /* @ts-ignore */
|
|
20
|
+
...(ngDevMode ? [{ debugName: "error" }] : /* istanbul ignore next */ []));
|
|
21
|
+
hint = input(undefined, /* @ts-ignore */
|
|
22
|
+
...(ngDevMode ? [{ debugName: "hint" }] : /* istanbul ignore next */ []));
|
|
23
|
+
// HTML/control attributes
|
|
24
|
+
id = input(crypto.randomUUID(), /* @ts-ignore */
|
|
25
|
+
...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
26
|
+
placeholder = input('Start typing to add…', /* @ts-ignore */
|
|
27
|
+
...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
28
|
+
disabled = input(false, /* @ts-ignore */
|
|
29
|
+
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
30
|
+
required = input(false, /* @ts-ignore */
|
|
31
|
+
...(ngDevMode ? [{ debugName: "required" }] : /* istanbul ignore next */ []));
|
|
32
|
+
// Multiselect-specific
|
|
33
|
+
options = input([], /* @ts-ignore */
|
|
34
|
+
...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ [])); // [{ label, value }]
|
|
35
|
+
// Styling classes
|
|
36
|
+
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
37
|
+
labelClass = input('', /* @ts-ignore */
|
|
38
|
+
...(ngDevMode ? [{ debugName: "labelClass" }] : /* istanbul ignore next */ []));
|
|
39
|
+
controlClass = input('', /* @ts-ignore */
|
|
40
|
+
...(ngDevMode ? [{ debugName: "controlClass" }] : /* istanbul ignore next */ [])); // for EgMultiselectAutocomplete
|
|
41
|
+
errorClass = input('', /* @ts-ignore */
|
|
42
|
+
...(ngDevMode ? [{ debugName: "errorClass" }] : /* istanbul ignore next */ []));
|
|
43
|
+
hintClass = input('', /* @ts-ignore */
|
|
44
|
+
...(ngDevMode ? [{ debugName: "hintClass" }] : /* istanbul ignore next */ []));
|
|
45
|
+
// Computed class names
|
|
46
|
+
$userClass = computed(() => hlm('flex flex-col', this.userClass()), /* @ts-ignore */
|
|
47
|
+
...(ngDevMode ? [{ debugName: "$userClass" }] : /* istanbul ignore next */ []));
|
|
48
|
+
$labelClass = computed(() => hlm('mb-1 gap-0', this.labelClass()), /* @ts-ignore */
|
|
49
|
+
...(ngDevMode ? [{ debugName: "$labelClass" }] : /* istanbul ignore next */ []));
|
|
50
|
+
$controlClass = computed(() => hlm('w-full', this.controlClass()), /* @ts-ignore */
|
|
51
|
+
...(ngDevMode ? [{ debugName: "$controlClass" }] : /* istanbul ignore next */ []));
|
|
52
|
+
$errorClass = computed(() => hlm('mt-0', this.errorClass()), /* @ts-ignore */
|
|
53
|
+
...(ngDevMode ? [{ debugName: "$errorClass" }] : /* istanbul ignore next */ []));
|
|
54
|
+
$hintClass = computed(() => hlm('mt-0', this.hintClass()), /* @ts-ignore */
|
|
55
|
+
...(ngDevMode ? [{ debugName: "$hintClass" }] : /* istanbul ignore next */ []));
|
|
56
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: EgFormSearchableMultiselect, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
57
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.7", type: EgFormSearchableMultiselect, isStandalone: true, selector: "eg-form-searchable-multiselect", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, controlId: { classPropertyName: "controlId", publicName: "controlId", isSignal: true, isRequired: false, transformFunction: null }, controlName: { classPropertyName: "controlName", publicName: "controlName", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, labelClass: { classPropertyName: "labelClass", publicName: "labelClass", isSignal: true, isRequired: false, transformFunction: null }, controlClass: { classPropertyName: "controlClass", publicName: "controlClass", isSignal: true, isRequired: false, transformFunction: null }, errorClass: { classPropertyName: "errorClass", publicName: "errorClass", isSignal: true, isRequired: false, transformFunction: null }, hintClass: { classPropertyName: "hintClass", publicName: "hintClass", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "w-full" }, providers: [{ provide: ControlContainer, useExisting: FormGroupDirective }], ngImport: i0, template: `
|
|
58
|
+
@let lbl = label();
|
|
59
|
+
@let cid = controlId();
|
|
60
|
+
@let cnm = controlName();
|
|
61
|
+
@let err = error();
|
|
62
|
+
@let hnt = hint();
|
|
63
|
+
@let rqrd = required();
|
|
64
|
+
|
|
65
|
+
<eg-form-field>
|
|
66
|
+
@if (lbl) {
|
|
67
|
+
<span hlmLabel [class]="$labelClass()">
|
|
68
|
+
{{ lbl }}
|
|
69
|
+
@if (rqrd) {
|
|
70
|
+
<span class="text-red-500">*</span>
|
|
71
|
+
}
|
|
72
|
+
</span>
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
<eg-searchable-multiselect
|
|
76
|
+
[id]="cid || id()"
|
|
77
|
+
[options]="options()"
|
|
78
|
+
[placeholder]="placeholder()"
|
|
79
|
+
[formControlName]="cnm"
|
|
80
|
+
[required]="rqrd"
|
|
81
|
+
[class]="$controlClass()"
|
|
82
|
+
></eg-searchable-multiselect>
|
|
83
|
+
|
|
84
|
+
@if (err) {
|
|
85
|
+
<hlm-error [class]="$errorClass()">
|
|
86
|
+
{{ err }}
|
|
87
|
+
</hlm-error>
|
|
88
|
+
}
|
|
89
|
+
@if (hnt) {
|
|
90
|
+
<hlm-hint [class]="$hintClass()">
|
|
91
|
+
{{ hnt }}
|
|
92
|
+
</hlm-hint>
|
|
93
|
+
}
|
|
94
|
+
</eg-form-field>
|
|
95
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: EgFormField, selector: "eg-form-field", inputs: ["class"] }, { kind: "directive", type: HlmError, selector: "hlm-error", inputs: ["class"] }, { kind: "directive", type: HlmHint, selector: "hlm-hint", inputs: ["class"] }, { kind: "directive", type: HlmLabel, selector: "[hlmLabel]", inputs: ["class"] }, { kind: "component", type: EgSearchableMultiselect, selector: "eg-searchable-multiselect", inputs: ["options", "placeholder", "class", "value"], outputs: ["valueChange"] }] });
|
|
96
|
+
}
|
|
97
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: EgFormSearchableMultiselect, decorators: [{
|
|
98
|
+
type: Component,
|
|
99
|
+
args: [{
|
|
100
|
+
selector: 'eg-form-searchable-multiselect',
|
|
101
|
+
standalone: true,
|
|
102
|
+
host: {
|
|
103
|
+
class: 'w-full',
|
|
104
|
+
},
|
|
105
|
+
imports: [ReactiveFormsModule, EgFormField, HlmError, HlmHint, HlmLabel, EgSearchableMultiselect],
|
|
106
|
+
providers: [{ provide: ControlContainer, useExisting: FormGroupDirective }],
|
|
107
|
+
template: `
|
|
108
|
+
@let lbl = label();
|
|
109
|
+
@let cid = controlId();
|
|
110
|
+
@let cnm = controlName();
|
|
111
|
+
@let err = error();
|
|
112
|
+
@let hnt = hint();
|
|
113
|
+
@let rqrd = required();
|
|
114
|
+
|
|
115
|
+
<eg-form-field>
|
|
116
|
+
@if (lbl) {
|
|
117
|
+
<span hlmLabel [class]="$labelClass()">
|
|
118
|
+
{{ lbl }}
|
|
119
|
+
@if (rqrd) {
|
|
120
|
+
<span class="text-red-500">*</span>
|
|
121
|
+
}
|
|
122
|
+
</span>
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
<eg-searchable-multiselect
|
|
126
|
+
[id]="cid || id()"
|
|
127
|
+
[options]="options()"
|
|
128
|
+
[placeholder]="placeholder()"
|
|
129
|
+
[formControlName]="cnm"
|
|
130
|
+
[required]="rqrd"
|
|
131
|
+
[class]="$controlClass()"
|
|
132
|
+
></eg-searchable-multiselect>
|
|
133
|
+
|
|
134
|
+
@if (err) {
|
|
135
|
+
<hlm-error [class]="$errorClass()">
|
|
136
|
+
{{ err }}
|
|
137
|
+
</hlm-error>
|
|
138
|
+
}
|
|
139
|
+
@if (hnt) {
|
|
140
|
+
<hlm-hint [class]="$hintClass()">
|
|
141
|
+
{{ hnt }}
|
|
142
|
+
</hlm-hint>
|
|
143
|
+
}
|
|
144
|
+
</eg-form-field>
|
|
145
|
+
`,
|
|
146
|
+
}]
|
|
147
|
+
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], controlId: [{ type: i0.Input, args: [{ isSignal: true, alias: "controlId", required: false }] }], controlName: [{ type: i0.Input, args: [{ isSignal: true, alias: "controlName", required: false }] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], labelClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelClass", required: false }] }], controlClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "controlClass", required: false }] }], errorClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorClass", required: false }] }], hintClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "hintClass", required: false }] }] } });
|
|
148
|
+
|
|
149
|
+
/*
|
|
150
|
+
* Public API Surface of form-searchable-multiselect
|
|
151
|
+
*/
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Generated bundle index. Do not edit.
|
|
155
|
+
*/
|
|
156
|
+
|
|
157
|
+
export { EgFormSearchableMultiselect };
|
|
158
|
+
//# sourceMappingURL=form-searchable-multiselect.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-searchable-multiselect.mjs","sources":["../../../projects/form-searchable-multiselect/src/lib/form-searchable-multiselect.ts","../../../projects/form-searchable-multiselect/src/public-api.ts","../../../projects/form-searchable-multiselect/src/form-searchable-multiselect.ts"],"sourcesContent":["import { Component, computed, input } from '@angular/core';\nimport { ControlContainer, FormGroupDirective, ReactiveFormsModule } from '@angular/forms';\nimport { HlmLabel } from '@egose/shadcn-theme-ng/label';\nimport { EgFormField } from '@egose/shadcn-theme-ng/form-field-simple';\nimport { HlmError, HlmHint } from '@egose/shadcn-theme-ng/form-field';\nimport { hlm } from '@egose/shadcn-theme-ng/utils';\nimport { ClassValue } from 'clsx';\nimport { EgSearchableMultiselect, SelectOption } from '@egose/shadcn-theme-ng/searchable-multiselect';\n\n@Component({\n selector: 'eg-form-searchable-multiselect',\n standalone: true,\n host: {\n class: 'tw:w-full',\n },\n imports: [ReactiveFormsModule, EgFormField, HlmError, HlmHint, HlmLabel, EgSearchableMultiselect],\n providers: [{ provide: ControlContainer, useExisting: FormGroupDirective }],\n template: `\n @let lbl = label();\n @let cid = controlId();\n @let cnm = controlName();\n @let err = error();\n @let hnt = hint();\n @let rqrd = required();\n\n <eg-form-field>\n @if (lbl) {\n <span hlmLabel [class]=\"$labelClass()\">\n {{ lbl }}\n @if (rqrd) {\n <span class=\"tw:text-red-500\">*</span>\n }\n </span>\n }\n\n <eg-searchable-multiselect\n [id]=\"cid || id()\"\n [options]=\"options()\"\n [placeholder]=\"placeholder()\"\n [formControlName]=\"cnm\"\n [required]=\"rqrd\"\n [class]=\"$controlClass()\"\n ></eg-searchable-multiselect>\n\n @if (err) {\n <hlm-error [class]=\"$errorClass()\">\n {{ err }}\n </hlm-error>\n }\n @if (hnt) {\n <hlm-hint [class]=\"$hintClass()\">\n {{ hnt }}\n </hlm-hint>\n }\n </eg-form-field>\n `,\n})\nexport class EgFormSearchableMultiselect {\n // Form field inputs\n label = input<string | undefined>(undefined);\n controlId = input<string | undefined>(undefined);\n controlName = input<string>(''); // required for form binding\n error = input<string | undefined>(undefined);\n hint = input<string | undefined>(undefined);\n\n // HTML/control attributes\n id = input<string>(crypto.randomUUID());\n placeholder = input<string>('Start typing to add…');\n disabled = input<boolean>(false);\n required = input<boolean>(false);\n\n // Multiselect-specific\n options = input<SelectOption[]>([]); // [{ label, value }]\n\n // Styling classes\n userClass = input<ClassValue>('', { alias: 'class' });\n labelClass = input<string>('');\n controlClass = input<string>(''); // for EgMultiselectAutocomplete\n errorClass = input<string>('');\n hintClass = input<string>('');\n\n // Computed class names\n $userClass = computed(() => hlm('tw:flex tw:flex-col', this.userClass()));\n $labelClass = computed(() => hlm('tw:mb-1 tw:gap-0', this.labelClass()));\n $controlClass = computed(() => hlm('tw:w-full', this.controlClass()));\n $errorClass = computed(() => hlm('tw:mt-0', this.errorClass()));\n $hintClass = computed(() => hlm('tw:mt-0', this.hintClass()));\n}\n","/*\n * Public API Surface of form-searchable-multiselect\n */\n\nexport * from './lib/form-searchable-multiselect';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;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^22.0.0",
|
|
6
|
+
"@angular/core": "^20.3.0 || ^22.0.0"
|
|
7
|
+
},
|
|
8
|
+
"dependencies": {
|
|
9
|
+
"tslib": "^2.3.0"
|
|
10
|
+
},
|
|
11
|
+
"sideEffects": false,
|
|
12
|
+
"module": "fesm2022/form-searchable-multiselect.mjs",
|
|
13
|
+
"typings": "types/form-searchable-multiselect.d.ts",
|
|
14
|
+
"exports": {
|
|
15
|
+
"./package.json": {
|
|
16
|
+
"default": "./package.json"
|
|
17
|
+
},
|
|
18
|
+
".": {
|
|
19
|
+
"types": "./types/form-searchable-multiselect.d.ts",
|
|
20
|
+
"default": "./fesm2022/form-searchable-multiselect.mjs"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"type": "module"
|
|
24
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { ClassValue } from 'clsx';
|
|
3
|
+
import { SelectOption } from '@egose/shadcn-theme-ng/searchable-multiselect';
|
|
4
|
+
|
|
5
|
+
declare class EgFormSearchableMultiselect {
|
|
6
|
+
label: _angular_core.InputSignal<string | undefined>;
|
|
7
|
+
controlId: _angular_core.InputSignal<string | undefined>;
|
|
8
|
+
controlName: _angular_core.InputSignal<string>;
|
|
9
|
+
error: _angular_core.InputSignal<string | undefined>;
|
|
10
|
+
hint: _angular_core.InputSignal<string | undefined>;
|
|
11
|
+
id: _angular_core.InputSignal<string>;
|
|
12
|
+
placeholder: _angular_core.InputSignal<string>;
|
|
13
|
+
disabled: _angular_core.InputSignal<boolean>;
|
|
14
|
+
required: _angular_core.InputSignal<boolean>;
|
|
15
|
+
options: _angular_core.InputSignal<SelectOption[]>;
|
|
16
|
+
userClass: _angular_core.InputSignal<ClassValue>;
|
|
17
|
+
labelClass: _angular_core.InputSignal<string>;
|
|
18
|
+
controlClass: _angular_core.InputSignal<string>;
|
|
19
|
+
errorClass: _angular_core.InputSignal<string>;
|
|
20
|
+
hintClass: _angular_core.InputSignal<string>;
|
|
21
|
+
$userClass: _angular_core.Signal<string>;
|
|
22
|
+
$labelClass: _angular_core.Signal<string>;
|
|
23
|
+
$controlClass: _angular_core.Signal<string>;
|
|
24
|
+
$errorClass: _angular_core.Signal<string>;
|
|
25
|
+
$hintClass: _angular_core.Signal<string>;
|
|
26
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<EgFormSearchableMultiselect, never>;
|
|
27
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<EgFormSearchableMultiselect, "eg-form-searchable-multiselect", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "controlId": { "alias": "controlId"; "required": false; "isSignal": true; }; "controlName": { "alias": "controlName"; "required": false; "isSignal": true; }; "error": { "alias": "error"; "required": false; "isSignal": true; }; "hint": { "alias": "hint"; "required": false; "isSignal": true; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "options": { "alias": "options"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; "labelClass": { "alias": "labelClass"; "required": false; "isSignal": true; }; "controlClass": { "alias": "controlClass"; "required": false; "isSignal": true; }; "errorClass": { "alias": "errorClass"; "required": false; "isSignal": true; }; "hintClass": { "alias": "hintClass"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export { EgFormSearchableMultiselect };
|