@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
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Directive, inject, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
|
|
3
|
+
import * as i1 from '@spartan-ng/brain/resizable';
|
|
4
|
+
import { BrnResizableGroup, BrnResizableHandle, BrnResizablePanel } from '@spartan-ng/brain/resizable';
|
|
5
|
+
import { classes } from '@egose/shadcn-theme-ng/utils';
|
|
6
|
+
|
|
7
|
+
class HlmResizableGroup {
|
|
8
|
+
constructor() {
|
|
9
|
+
classes(() => 'group flex h-full w-full data-[panel-group-direction=vertical]:flex-col');
|
|
10
|
+
}
|
|
11
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: HlmResizableGroup, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
12
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.7", type: HlmResizableGroup, isStandalone: true, selector: "[hlmResizableGroup],hlm-resizable-group", host: { attributes: { "data-slot": "resizable-group" } }, hostDirectives: [{ directive: i1.BrnResizableGroup, inputs: ["direction", "direction", "layout", "layout"], outputs: ["dragEnd", "dragEnd", "dragStart", "dragStart", "layoutChange", "layoutChange"] }], ngImport: i0 });
|
|
13
|
+
}
|
|
14
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: HlmResizableGroup, decorators: [{
|
|
15
|
+
type: Directive,
|
|
16
|
+
args: [{
|
|
17
|
+
selector: '[hlmResizableGroup],hlm-resizable-group',
|
|
18
|
+
hostDirectives: [
|
|
19
|
+
{
|
|
20
|
+
directive: BrnResizableGroup,
|
|
21
|
+
inputs: ['direction', 'layout'],
|
|
22
|
+
outputs: ['dragEnd', 'dragStart', 'layoutChange'],
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
host: {
|
|
26
|
+
'data-slot': 'resizable-group',
|
|
27
|
+
},
|
|
28
|
+
}]
|
|
29
|
+
}], ctorParameters: () => [] });
|
|
30
|
+
|
|
31
|
+
class HlmResizableHandle {
|
|
32
|
+
_brnResizableHandle = inject(BrnResizableHandle);
|
|
33
|
+
constructor() {
|
|
34
|
+
classes(() => [
|
|
35
|
+
'bg-border ring-offset-background focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:outline-hidden data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:translate-x-0 data-[panel-group-direction=vertical]:after:-translate-y-1/2 [&[data-panel-group-direction=vertical]>div]:rotate-90',
|
|
36
|
+
'data-[panel-group-direction=horizontal]:hover:cursor-ew-resize data-[panel-group-direction=vertical]:hover:cursor-ns-resize',
|
|
37
|
+
]);
|
|
38
|
+
}
|
|
39
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: HlmResizableHandle, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
40
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.7", type: HlmResizableHandle, isStandalone: true, selector: "hlm-resizable-handle", host: { attributes: { "data-slot": "resizable-handle" } }, exportAs: ["hlmResizableHandle"], hostDirectives: [{ directive: i1.BrnResizableHandle, inputs: ["withHandle", "withHandle", "disabled", "disabled"] }], ngImport: i0, template: `
|
|
41
|
+
@if (_brnResizableHandle.withHandle()) {
|
|
42
|
+
<div class="bg-border h-6 w-1 rounded-lg z-10 flex shrink-0"></div>
|
|
43
|
+
}
|
|
44
|
+
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
45
|
+
}
|
|
46
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: HlmResizableHandle, decorators: [{
|
|
47
|
+
type: Component,
|
|
48
|
+
args: [{
|
|
49
|
+
selector: 'hlm-resizable-handle',
|
|
50
|
+
exportAs: 'hlmResizableHandle',
|
|
51
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
52
|
+
hostDirectives: [{ directive: BrnResizableHandle, inputs: ['withHandle', 'disabled'] }],
|
|
53
|
+
host: {
|
|
54
|
+
'data-slot': 'resizable-handle',
|
|
55
|
+
},
|
|
56
|
+
template: `
|
|
57
|
+
@if (_brnResizableHandle.withHandle()) {
|
|
58
|
+
<div class="bg-border h-6 w-1 rounded-lg z-10 flex shrink-0"></div>
|
|
59
|
+
}
|
|
60
|
+
`,
|
|
61
|
+
}]
|
|
62
|
+
}], ctorParameters: () => [] });
|
|
63
|
+
|
|
64
|
+
class HlmResizablePanel {
|
|
65
|
+
_resizablePanel = inject(BrnResizablePanel);
|
|
66
|
+
setSize(size) {
|
|
67
|
+
this._resizablePanel.setSize(size);
|
|
68
|
+
}
|
|
69
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: HlmResizablePanel, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
70
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.7", type: HlmResizablePanel, isStandalone: true, selector: "[hlmResizablePanel],hlm-resizable-panel", host: { attributes: { "data-slot": "resizable-panel" } }, exportAs: ["hlmResizablePanel"], hostDirectives: [{ directive: i1.BrnResizablePanel, inputs: ["defaultSize", "defaultSize", "id", "id", "collapsible", "collapsible", "maxSize", "maxSize", "minSize", "minSize"] }], ngImport: i0 });
|
|
71
|
+
}
|
|
72
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: HlmResizablePanel, decorators: [{
|
|
73
|
+
type: Directive,
|
|
74
|
+
args: [{
|
|
75
|
+
selector: '[hlmResizablePanel],hlm-resizable-panel',
|
|
76
|
+
exportAs: 'hlmResizablePanel',
|
|
77
|
+
hostDirectives: [
|
|
78
|
+
{
|
|
79
|
+
directive: BrnResizablePanel,
|
|
80
|
+
inputs: ['defaultSize', 'id', 'collapsible', 'maxSize', 'minSize'],
|
|
81
|
+
},
|
|
82
|
+
],
|
|
83
|
+
host: {
|
|
84
|
+
'data-slot': 'resizable-panel',
|
|
85
|
+
},
|
|
86
|
+
}]
|
|
87
|
+
}] });
|
|
88
|
+
|
|
89
|
+
/*
|
|
90
|
+
* Public API Surface of resizable
|
|
91
|
+
*/
|
|
92
|
+
const HlmResizableImports = [HlmResizableGroup, HlmResizablePanel, HlmResizableHandle];
|
|
93
|
+
class HlmResizableModule {
|
|
94
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: HlmResizableModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
95
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.0.7", ngImport: i0, type: HlmResizableModule, imports: [HlmResizableGroup, HlmResizablePanel, HlmResizableHandle], exports: [HlmResizableGroup, HlmResizablePanel, HlmResizableHandle] });
|
|
96
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: HlmResizableModule });
|
|
97
|
+
}
|
|
98
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: HlmResizableModule, decorators: [{
|
|
99
|
+
type: NgModule,
|
|
100
|
+
args: [{
|
|
101
|
+
imports: [...HlmResizableImports],
|
|
102
|
+
exports: [...HlmResizableImports],
|
|
103
|
+
}]
|
|
104
|
+
}] });
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Generated bundle index. Do not edit.
|
|
108
|
+
*/
|
|
109
|
+
|
|
110
|
+
export { HlmResizableGroup, HlmResizableHandle, HlmResizableImports, HlmResizableModule, HlmResizablePanel };
|
|
111
|
+
//# sourceMappingURL=resizable.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resizable.mjs","sources":["../../../projects/resizable/src/lib/hlm-resizable-group.ts","../../../projects/resizable/src/lib/hlm-resizable-handle.ts","../../../projects/resizable/src/lib/hlm-resizable-panel.ts","../../../projects/resizable/src/public-api.ts","../../../projects/resizable/src/resizable.ts"],"sourcesContent":["import { Directive } from '@angular/core';\nimport { BrnResizableGroup } from '@spartan-ng/brain/resizable';\nimport { classes } from '@egose/shadcn-theme-ng/utils';\n\n@Directive({\n selector: '[hlmResizableGroup],hlm-resizable-group',\n hostDirectives: [\n {\n directive: BrnResizableGroup,\n inputs: ['direction', 'layout'],\n outputs: ['dragEnd', 'dragStart', 'layoutChange'],\n },\n ],\n host: {\n 'data-slot': 'resizable-group',\n },\n})\nexport class HlmResizableGroup {\n constructor() {\n classes(() => 'group flex h-full w-full data-[panel-group-direction=vertical]:flex-col');\n }\n}\n","import { ChangeDetectionStrategy, Component, inject } from '@angular/core';\nimport { BrnResizableHandle } from '@spartan-ng/brain/resizable';\nimport { classes } from '@egose/shadcn-theme-ng/utils';\n\n@Component({\n selector: 'hlm-resizable-handle',\n exportAs: 'hlmResizableHandle',\n changeDetection: ChangeDetectionStrategy.OnPush,\n hostDirectives: [{ directive: BrnResizableHandle, inputs: ['withHandle', 'disabled'] }],\n host: {\n 'data-slot': 'resizable-handle',\n },\n template: `\n @if (_brnResizableHandle.withHandle()) {\n <div class=\"bg-border h-6 w-1 rounded-lg z-10 flex shrink-0\"></div>\n }\n `,\n})\nexport class HlmResizableHandle {\n protected readonly _brnResizableHandle = inject(BrnResizableHandle);\n\n constructor() {\n classes(() => [\n 'bg-border ring-offset-background focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:outline-hidden data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:translate-x-0 data-[panel-group-direction=vertical]:after:-translate-y-1/2 [&[data-panel-group-direction=vertical]>div]:rotate-90',\n 'data-[panel-group-direction=horizontal]:hover:cursor-ew-resize data-[panel-group-direction=vertical]:hover:cursor-ns-resize',\n ]);\n }\n}\n","import { Directive, inject } from '@angular/core';\nimport { BrnResizablePanel } from '@spartan-ng/brain/resizable';\n\n@Directive({\n selector: '[hlmResizablePanel],hlm-resizable-panel',\n exportAs: 'hlmResizablePanel',\n hostDirectives: [\n {\n directive: BrnResizablePanel,\n inputs: ['defaultSize', 'id', 'collapsible', 'maxSize', 'minSize'],\n },\n ],\n host: {\n 'data-slot': 'resizable-panel',\n },\n})\nexport class HlmResizablePanel {\n private readonly _resizablePanel = inject(BrnResizablePanel);\n\n public setSize(size: number) {\n this._resizablePanel.setSize(size);\n }\n}\n","/*\n * Public API Surface of resizable\n */\n\nimport { NgModule } from '@angular/core';\n\nimport { HlmResizableGroup } from './lib/hlm-resizable-group';\nimport { HlmResizableHandle } from './lib/hlm-resizable-handle';\nimport { HlmResizablePanel } from './lib/hlm-resizable-panel';\n\nexport * from './lib/hlm-resizable-group';\nexport * from './lib/hlm-resizable-handle';\nexport * from './lib/hlm-resizable-panel';\n\nexport const HlmResizableImports = [HlmResizableGroup, HlmResizablePanel, HlmResizableHandle] as const;\n\n@NgModule({\n imports: [...HlmResizableImports],\n exports: [...HlmResizableImports],\n})\nexport class HlmResizableModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;MAiBa,iBAAiB,CAAA;AAC5B,IAAA,WAAA,GAAA;AACE,QAAA,OAAO,CAAC,MAAM,yEAAyE,CAAC;IAC1F;uGAHW,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAjB,iBAAiB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,yCAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,WAAA,EAAA,iBAAA,EAAA,EAAA,EAAA,cAAA,EAAA,CAAA,EAAA,SAAA,EAAA,EAAA,CAAA,iBAAA,EAAA,MAAA,EAAA,CAAA,WAAA,EAAA,WAAA,EAAA,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
{
|
|
2
|
+
"name": "resizable",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"peerDependencies": {
|
|
5
|
+
"@angular/common": "^22.0.0",
|
|
6
|
+
"@angular/core": "^22.0.0",
|
|
7
|
+
"@spartan-ng/brain": "^1.1.1"
|
|
8
|
+
},
|
|
9
|
+
"dependencies": {
|
|
10
|
+
"tslib": "^2.3.0"
|
|
11
|
+
},
|
|
12
|
+
"sideEffects": false,
|
|
13
|
+
"module": "fesm2022/resizable.mjs",
|
|
14
|
+
"typings": "types/resizable.d.ts",
|
|
15
|
+
"exports": {
|
|
16
|
+
"./package.json": {
|
|
17
|
+
"default": "./package.json"
|
|
18
|
+
},
|
|
19
|
+
".": {
|
|
20
|
+
"types": "./types/resizable.d.ts",
|
|
21
|
+
"default": "./fesm2022/resizable.mjs"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"type": "module"
|
|
25
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import * as i1 from '@spartan-ng/brain/resizable';
|
|
3
|
+
import { BrnResizableHandle } from '@spartan-ng/brain/resizable';
|
|
4
|
+
|
|
5
|
+
declare class HlmResizableGroup {
|
|
6
|
+
constructor();
|
|
7
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HlmResizableGroup, never>;
|
|
8
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<HlmResizableGroup, "[hlmResizableGroup],hlm-resizable-group", never, {}, {}, never, never, true, [{ directive: typeof i1.BrnResizableGroup; inputs: { "direction": "direction"; "layout": "layout"; }; outputs: { "dragEnd": "dragEnd"; "dragStart": "dragStart"; "layoutChange": "layoutChange"; }; }]>;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
declare class HlmResizableHandle {
|
|
12
|
+
protected readonly _brnResizableHandle: BrnResizableHandle;
|
|
13
|
+
constructor();
|
|
14
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HlmResizableHandle, never>;
|
|
15
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<HlmResizableHandle, "hlm-resizable-handle", ["hlmResizableHandle"], {}, {}, never, never, true, [{ directive: typeof i1.BrnResizableHandle; inputs: { "withHandle": "withHandle"; "disabled": "disabled"; }; outputs: {}; }]>;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
declare class HlmResizablePanel {
|
|
19
|
+
private readonly _resizablePanel;
|
|
20
|
+
setSize(size: number): void;
|
|
21
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HlmResizablePanel, never>;
|
|
22
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<HlmResizablePanel, "[hlmResizablePanel],hlm-resizable-panel", ["hlmResizablePanel"], {}, {}, never, never, true, [{ directive: typeof i1.BrnResizablePanel; inputs: { "defaultSize": "defaultSize"; "id": "id"; "collapsible": "collapsible"; "maxSize": "maxSize"; "minSize": "minSize"; }; outputs: {}; }]>;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
declare const HlmResizableImports: readonly [typeof HlmResizableGroup, typeof HlmResizablePanel, typeof HlmResizableHandle];
|
|
26
|
+
declare class HlmResizableModule {
|
|
27
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HlmResizableModule, never>;
|
|
28
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<HlmResizableModule, never, [typeof HlmResizableGroup, typeof HlmResizablePanel, typeof HlmResizableHandle], [typeof HlmResizableGroup, typeof HlmResizablePanel, typeof HlmResizableHandle]>;
|
|
29
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<HlmResizableModule>;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export { HlmResizableGroup, HlmResizableHandle, HlmResizableImports, HlmResizableModule, HlmResizablePanel };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Directive, NgModule } from '@angular/core';
|
|
3
|
+
import { classes } from '@egose/shadcn-theme-ng/utils';
|
|
4
|
+
import { provideScrollbarOptions } from 'ngx-scrollbar';
|
|
5
|
+
|
|
6
|
+
class HlmScrollArea {
|
|
7
|
+
constructor() {
|
|
8
|
+
classes(() => 'rounded-md [--scrollbar-thumb-shape:9999px] block');
|
|
9
|
+
}
|
|
10
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: HlmScrollArea, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
11
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.7", type: HlmScrollArea, isStandalone: true, selector: "ng-scrollbar[hlm],ng-scrollbar[hlmScrollbar]", host: { attributes: { "data-slot": "scroll-area" }, properties: { "style.--scrollbar-thumb-color": "\"var(--border)\"", "style.--scrollbar-thumb-hover-color": "\"var(--border)\"", "style.--scrollbar-track-color": "\"transparent\"", "style.--scrollbar-track-thickness": "\"0.625rem\"", "style.--scrollbar-track-offset": "\"1.5px\"" } }, providers: [provideScrollbarOptions({ visibility: 'hover' })], ngImport: i0 });
|
|
12
|
+
}
|
|
13
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: HlmScrollArea, decorators: [{
|
|
14
|
+
type: Directive,
|
|
15
|
+
args: [{
|
|
16
|
+
selector: 'ng-scrollbar[hlm],ng-scrollbar[hlmScrollbar]',
|
|
17
|
+
providers: [provideScrollbarOptions({ visibility: 'hover' })],
|
|
18
|
+
host: {
|
|
19
|
+
'data-slot': 'scroll-area',
|
|
20
|
+
'[style.--scrollbar-thumb-color]': '"var(--border)"',
|
|
21
|
+
'[style.--scrollbar-thumb-hover-color]': '"var(--border)"',
|
|
22
|
+
'[style.--scrollbar-track-color]': '"transparent"',
|
|
23
|
+
'[style.--scrollbar-track-thickness]': '"0.625rem"',
|
|
24
|
+
'[style.--scrollbar-track-offset]': '"1.5px"',
|
|
25
|
+
},
|
|
26
|
+
}]
|
|
27
|
+
}], ctorParameters: () => [] });
|
|
28
|
+
|
|
29
|
+
/*
|
|
30
|
+
* Public API Surface of scroll-area
|
|
31
|
+
*/
|
|
32
|
+
const HlmScrollAreaImports = [HlmScrollArea];
|
|
33
|
+
class HlmScrollAreaModule {
|
|
34
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: HlmScrollAreaModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
35
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.0.7", ngImport: i0, type: HlmScrollAreaModule, imports: [HlmScrollArea], exports: [HlmScrollArea] });
|
|
36
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: HlmScrollAreaModule });
|
|
37
|
+
}
|
|
38
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: HlmScrollAreaModule, decorators: [{
|
|
39
|
+
type: NgModule,
|
|
40
|
+
args: [{
|
|
41
|
+
imports: [...HlmScrollAreaImports],
|
|
42
|
+
exports: [...HlmScrollAreaImports],
|
|
43
|
+
}]
|
|
44
|
+
}] });
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Generated bundle index. Do not edit.
|
|
48
|
+
*/
|
|
49
|
+
|
|
50
|
+
export { HlmScrollArea, HlmScrollAreaImports, HlmScrollAreaModule };
|
|
51
|
+
//# sourceMappingURL=scroll-area.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scroll-area.mjs","sources":["../../../projects/scroll-area/src/lib/hlm-scroll-area.ts","../../../projects/scroll-area/src/public-api.ts","../../../projects/scroll-area/src/scroll-area.ts"],"sourcesContent":["import { Directive } from '@angular/core';\nimport { classes } from '@egose/shadcn-theme-ng/utils';\nimport { provideScrollbarOptions } from 'ngx-scrollbar';\n\n@Directive({\n selector: 'ng-scrollbar[hlm],ng-scrollbar[hlmScrollbar]',\n providers: [provideScrollbarOptions({ visibility: 'hover' })],\n host: {\n 'data-slot': 'scroll-area',\n '[style.--scrollbar-thumb-color]': '\"var(--border)\"',\n '[style.--scrollbar-thumb-hover-color]': '\"var(--border)\"',\n '[style.--scrollbar-track-color]': '\"transparent\"',\n '[style.--scrollbar-track-thickness]': '\"0.625rem\"',\n '[style.--scrollbar-track-offset]': '\"1.5px\"',\n },\n})\nexport class HlmScrollArea {\n constructor() {\n classes(() => 'rounded-md [--scrollbar-thumb-shape:9999px] block');\n }\n}\n","/*\n * Public API Surface of scroll-area\n */\n\nimport { NgModule } from '@angular/core';\n\nimport { HlmScrollArea } from './lib/hlm-scroll-area';\n\nexport * from './lib/hlm-scroll-area';\n\nexport const HlmScrollAreaImports = [HlmScrollArea] as const;\n\n@NgModule({\n imports: [...HlmScrollAreaImports],\n exports: [...HlmScrollAreaImports],\n})\nexport class HlmScrollAreaModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MAgBa,aAAa,CAAA;AACxB,IAAA,WAAA,GAAA;AACE,QAAA,OAAO,CAAC,MAAM,mDAAmD,CAAC;IACpE;uGAHW,aAAa,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAb,aAAa,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,8CAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,WAAA,EAAA,aAAA,EAAA,EAAA,UAAA,EAAA,EAAA,+BAAA,EAAA,mBAAA,EAAA,qCAAA,EAAA,mBAAA,EAAA,+BAAA,EAAA,iBAAA,EAAA,mCAAA,EAAA,cAAA,EAAA,gCAAA,EAAA,WAAA,EAAA,EAAA,EAAA,SAAA,EAVb,CAAC,uBAAuB,CAAC,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC,CAAC,EAAA,QAAA,EAAA,EAAA,EAAA,CA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
|
+
"dependencies": {
|
|
10
|
+
"tslib": "^2.3.0"
|
|
11
|
+
},
|
|
12
|
+
"sideEffects": false,
|
|
13
|
+
"module": "fesm2022/scroll-area.mjs",
|
|
14
|
+
"typings": "types/scroll-area.d.ts",
|
|
15
|
+
"exports": {
|
|
16
|
+
"./package.json": {
|
|
17
|
+
"default": "./package.json"
|
|
18
|
+
},
|
|
19
|
+
".": {
|
|
20
|
+
"types": "./types/scroll-area.d.ts",
|
|
21
|
+
"default": "./fesm2022/scroll-area.mjs"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"type": "module"
|
|
25
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
|
|
3
|
+
declare class HlmScrollArea {
|
|
4
|
+
constructor();
|
|
5
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HlmScrollArea, never>;
|
|
6
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<HlmScrollArea, "ng-scrollbar[hlm],ng-scrollbar[hlmScrollbar]", never, {}, {}, never, never, true, never>;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
declare const HlmScrollAreaImports: readonly [typeof HlmScrollArea];
|
|
10
|
+
declare class HlmScrollAreaModule {
|
|
11
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HlmScrollAreaModule, never>;
|
|
12
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<HlmScrollAreaModule, never, [typeof HlmScrollArea], [typeof HlmScrollArea]>;
|
|
13
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<HlmScrollAreaModule>;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export { HlmScrollArea, HlmScrollAreaImports, HlmScrollAreaModule };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# MultiselectAutocomplete
|
|
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 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/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,225 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, output, signal, computed, forwardRef, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
4
|
+
import { HlmPopover, HlmPopoverTrigger, HlmPopoverContent } from '@egose/shadcn-theme-ng/popover';
|
|
5
|
+
import { HlmButton } from '@egose/shadcn-theme-ng/button';
|
|
6
|
+
import { HlmCheckbox } from '@egose/shadcn-theme-ng/checkbox';
|
|
7
|
+
import { hlm } from '@egose/shadcn-theme-ng/utils';
|
|
8
|
+
|
|
9
|
+
class EgSearchableMultiselect {
|
|
10
|
+
/** Full option list with labels/values */
|
|
11
|
+
options = input([], /* @ts-ignore */
|
|
12
|
+
...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
|
|
13
|
+
placeholder = input('Start typing to add…', /* @ts-ignore */
|
|
14
|
+
...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
15
|
+
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
16
|
+
/** Value: array of selected values (string[]) */
|
|
17
|
+
value = input([], /* @ts-ignore */
|
|
18
|
+
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
19
|
+
valueChange = output();
|
|
20
|
+
selectedItems = signal([], /* @ts-ignore */
|
|
21
|
+
...(ngDevMode ? [{ debugName: "selectedItems" }] : /* istanbul ignore next */ []));
|
|
22
|
+
isDisabled = false;
|
|
23
|
+
isFormBound = false;
|
|
24
|
+
_hostClass = computed(() => hlm(this.userClass()), /* @ts-ignore */
|
|
25
|
+
...(ngDevMode ? [{ debugName: "_hostClass" }] : /* istanbul ignore next */ []));
|
|
26
|
+
isSelected(value) {
|
|
27
|
+
return this.selectedItems().some((s) => s.value === value);
|
|
28
|
+
}
|
|
29
|
+
toggle(value, checked) {
|
|
30
|
+
if (checked) {
|
|
31
|
+
this.addItem(value);
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
this.removeItem(value);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
addItem(value) {
|
|
38
|
+
if (!this.selectedItems().some((s) => s.value === value)) {
|
|
39
|
+
const opt = this.options()?.find((o) => o.value === value);
|
|
40
|
+
if (!opt)
|
|
41
|
+
return;
|
|
42
|
+
const updated = [...this.selectedItems(), opt];
|
|
43
|
+
this.updateValueFromSelected(updated);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
removeItem(value) {
|
|
47
|
+
const updated = this.selectedItems().filter((i) => i.value !== value);
|
|
48
|
+
this.updateValueFromSelected(updated);
|
|
49
|
+
}
|
|
50
|
+
updateSelectedFromValues(values) {
|
|
51
|
+
const opts = this.options() || [];
|
|
52
|
+
this.selectedItems.set(opts.filter((o) => values.includes(o.value)));
|
|
53
|
+
}
|
|
54
|
+
updateValueFromSelected(items) {
|
|
55
|
+
this.selectedItems.set(items);
|
|
56
|
+
const values = items.map((i) => i.value);
|
|
57
|
+
this.valueChange.emit(values);
|
|
58
|
+
this.onChange(values);
|
|
59
|
+
this.onTouched();
|
|
60
|
+
}
|
|
61
|
+
constructor() {
|
|
62
|
+
// No effect needed; we read `value` input directly via writeValue for form-bound usage.
|
|
63
|
+
}
|
|
64
|
+
// --- ControlValueAccessor ---
|
|
65
|
+
onChange = () => { };
|
|
66
|
+
onTouched = () => { };
|
|
67
|
+
writeValue(values) {
|
|
68
|
+
this.isFormBound = true;
|
|
69
|
+
this.updateSelectedFromValues(values || []);
|
|
70
|
+
}
|
|
71
|
+
registerOnChange(fn) {
|
|
72
|
+
this.onChange = fn;
|
|
73
|
+
}
|
|
74
|
+
registerOnTouched(fn) {
|
|
75
|
+
this.onTouched = fn;
|
|
76
|
+
}
|
|
77
|
+
setDisabledState(isDisabled) {
|
|
78
|
+
this.isDisabled = isDisabled;
|
|
79
|
+
}
|
|
80
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: EgSearchableMultiselect, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
81
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.7", type: EgSearchableMultiselect, isStandalone: true, selector: "eg-searchable-multiselect", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange" }, host: { properties: { "class": "_hostClass()" } }, providers: [
|
|
82
|
+
{
|
|
83
|
+
provide: NG_VALUE_ACCESSOR,
|
|
84
|
+
useExisting: forwardRef(() => EgSearchableMultiselect),
|
|
85
|
+
multi: true,
|
|
86
|
+
},
|
|
87
|
+
], ngImport: i0, template: `
|
|
88
|
+
<div class="flex flex-col gap-2 w-full">
|
|
89
|
+
<!-- Selected chips -->
|
|
90
|
+
<div class="flex flex-wrap gap-2">
|
|
91
|
+
@if (selectedItems().length === 0) {
|
|
92
|
+
<span
|
|
93
|
+
class="bg-gray-100 text-gray-400 rounded-full
|
|
94
|
+
px-2 py-1 inline-flex items-center text-xs"
|
|
95
|
+
>
|
|
96
|
+
{{ placeholder() }}
|
|
97
|
+
</span>
|
|
98
|
+
} @else {
|
|
99
|
+
@for (item of selectedItems(); track item.value) {
|
|
100
|
+
<span
|
|
101
|
+
class="bg-gray-200 rounded-full px-2 py-1
|
|
102
|
+
inline-flex items-center gap-2 text-xs"
|
|
103
|
+
>
|
|
104
|
+
{{ item.label }}
|
|
105
|
+
<button
|
|
106
|
+
type="button"
|
|
107
|
+
(click)="removeItem(item.value)"
|
|
108
|
+
class="bg-transparent border-0 text-gray-600
|
|
109
|
+
hover:text-red-500 cursor-pointer"
|
|
110
|
+
>
|
|
111
|
+
✕
|
|
112
|
+
</button>
|
|
113
|
+
</span>
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
</div>
|
|
117
|
+
|
|
118
|
+
<!-- Trigger -->
|
|
119
|
+
<hlm-popover>
|
|
120
|
+
<button hlmPopoverTrigger hlmButton variant="secondary" appearance="outline" type="button">
|
|
121
|
+
{{ selectedItems().length }} selected
|
|
122
|
+
</button>
|
|
123
|
+
|
|
124
|
+
<hlm-popover-content class="w-64 p-2">
|
|
125
|
+
<div class="max-h-60 overflow-auto flex flex-col gap-1">
|
|
126
|
+
@for (option of options(); track option.value) {
|
|
127
|
+
<label
|
|
128
|
+
class="flex items-center gap-2 cursor-pointer px-2 py-1 rounded-sm hover:bg-secondary"
|
|
129
|
+
>
|
|
130
|
+
<hlm-checkbox [checked]="isSelected(option.value)" (changed)="toggle(option.value, $event)" />
|
|
131
|
+
<span class="text-sm">{{ option.label }}</span>
|
|
132
|
+
</label>
|
|
133
|
+
} @empty {
|
|
134
|
+
<span class="text-xs text-muted-foreground px-2 py-1">No options</span>
|
|
135
|
+
}
|
|
136
|
+
</div>
|
|
137
|
+
</hlm-popover-content>
|
|
138
|
+
</hlm-popover>
|
|
139
|
+
</div>
|
|
140
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: HlmPopover, selector: "[hlmPopover],hlm-popover" }, { kind: "directive", type: HlmPopoverTrigger, selector: "button[hlmPopoverTrigger],button[hlmPopoverTriggerFor]" }, { kind: "directive", type: HlmPopoverContent, selector: "[hlmPopoverContent],hlm-popover-content" }, { kind: "component", type: HlmButton, selector: "button[hlmButton], a[hlmButton]", inputs: ["variant", "size", "appearance", "loading", "icon", "iconPosition", "class", "spinnerUserClass", "disabled", "type"] }, { kind: "component", type: HlmCheckbox, selector: "hlm-checkbox", inputs: ["class", "id", "aria-label", "aria-labelledby", "aria-describedby", "checked", "name", "required", "disabled"], outputs: ["checkedChange", "changed"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
141
|
+
}
|
|
142
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: EgSearchableMultiselect, decorators: [{
|
|
143
|
+
type: Component,
|
|
144
|
+
args: [{
|
|
145
|
+
selector: 'eg-searchable-multiselect',
|
|
146
|
+
standalone: true,
|
|
147
|
+
imports: [HlmPopover, HlmPopoverTrigger, HlmPopoverContent, HlmButton, HlmCheckbox],
|
|
148
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
149
|
+
providers: [
|
|
150
|
+
{
|
|
151
|
+
provide: NG_VALUE_ACCESSOR,
|
|
152
|
+
useExisting: forwardRef(() => EgSearchableMultiselect),
|
|
153
|
+
multi: true,
|
|
154
|
+
},
|
|
155
|
+
],
|
|
156
|
+
host: {
|
|
157
|
+
'[class]': '_hostClass()',
|
|
158
|
+
},
|
|
159
|
+
template: `
|
|
160
|
+
<div class="flex flex-col gap-2 w-full">
|
|
161
|
+
<!-- Selected chips -->
|
|
162
|
+
<div class="flex flex-wrap gap-2">
|
|
163
|
+
@if (selectedItems().length === 0) {
|
|
164
|
+
<span
|
|
165
|
+
class="bg-gray-100 text-gray-400 rounded-full
|
|
166
|
+
px-2 py-1 inline-flex items-center text-xs"
|
|
167
|
+
>
|
|
168
|
+
{{ placeholder() }}
|
|
169
|
+
</span>
|
|
170
|
+
} @else {
|
|
171
|
+
@for (item of selectedItems(); track item.value) {
|
|
172
|
+
<span
|
|
173
|
+
class="bg-gray-200 rounded-full px-2 py-1
|
|
174
|
+
inline-flex items-center gap-2 text-xs"
|
|
175
|
+
>
|
|
176
|
+
{{ item.label }}
|
|
177
|
+
<button
|
|
178
|
+
type="button"
|
|
179
|
+
(click)="removeItem(item.value)"
|
|
180
|
+
class="bg-transparent border-0 text-gray-600
|
|
181
|
+
hover:text-red-500 cursor-pointer"
|
|
182
|
+
>
|
|
183
|
+
✕
|
|
184
|
+
</button>
|
|
185
|
+
</span>
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
</div>
|
|
189
|
+
|
|
190
|
+
<!-- Trigger -->
|
|
191
|
+
<hlm-popover>
|
|
192
|
+
<button hlmPopoverTrigger hlmButton variant="secondary" appearance="outline" type="button">
|
|
193
|
+
{{ selectedItems().length }} selected
|
|
194
|
+
</button>
|
|
195
|
+
|
|
196
|
+
<hlm-popover-content class="w-64 p-2">
|
|
197
|
+
<div class="max-h-60 overflow-auto flex flex-col gap-1">
|
|
198
|
+
@for (option of options(); track option.value) {
|
|
199
|
+
<label
|
|
200
|
+
class="flex items-center gap-2 cursor-pointer px-2 py-1 rounded-sm hover:bg-secondary"
|
|
201
|
+
>
|
|
202
|
+
<hlm-checkbox [checked]="isSelected(option.value)" (changed)="toggle(option.value, $event)" />
|
|
203
|
+
<span class="text-sm">{{ option.label }}</span>
|
|
204
|
+
</label>
|
|
205
|
+
} @empty {
|
|
206
|
+
<span class="text-xs text-muted-foreground px-2 py-1">No options</span>
|
|
207
|
+
}
|
|
208
|
+
</div>
|
|
209
|
+
</hlm-popover-content>
|
|
210
|
+
</hlm-popover>
|
|
211
|
+
</div>
|
|
212
|
+
`,
|
|
213
|
+
}]
|
|
214
|
+
}], ctorParameters: () => [], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }] } });
|
|
215
|
+
|
|
216
|
+
/*
|
|
217
|
+
* Public API Surface of searchable-multiselect
|
|
218
|
+
*/
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* Generated bundle index. Do not edit.
|
|
222
|
+
*/
|
|
223
|
+
|
|
224
|
+
export { EgSearchableMultiselect };
|
|
225
|
+
//# sourceMappingURL=searchable-multiselect.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"searchable-multiselect.mjs","sources":["../../../projects/searchable-multiselect/src/lib/searchable-multiselect.ts","../../../projects/searchable-multiselect/src/public-api.ts","../../../projects/searchable-multiselect/src/searchable-multiselect.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed, forwardRef, input, output, signal } from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { HlmPopover, HlmPopoverContent, HlmPopoverTrigger } from '@egose/shadcn-theme-ng/popover';\nimport { HlmButton } from '@egose/shadcn-theme-ng/button';\nimport { HlmCheckbox } from '@egose/shadcn-theme-ng/checkbox';\nimport { hlm } from '@egose/shadcn-theme-ng/utils';\nimport { ClassValue } from 'clsx';\n\nexport interface SelectOption {\n label: string;\n value: string;\n}\n\n@Component({\n selector: 'eg-searchable-multiselect',\n standalone: true,\n imports: [HlmPopover, HlmPopoverTrigger, HlmPopoverContent, HlmButton, HlmCheckbox],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => EgSearchableMultiselect),\n multi: true,\n },\n ],\n host: {\n '[class]': '_hostClass()',\n },\n template: `\n <div class=\"tw:flex tw:flex-col tw:gap-2 tw:w-full\">\n <!-- Selected chips -->\n <div class=\"tw:flex tw:flex-wrap tw:gap-2\">\n @if (selectedItems().length === 0) {\n <span\n class=\"tw:bg-gray-100 tw:text-gray-400 tw:rounded-full\n tw:px-2 tw:py-1 tw:inline-flex tw:items-center tw:text-xs\"\n >\n {{ placeholder() }}\n </span>\n } @else {\n @for (item of selectedItems(); track item.value) {\n <span\n class=\"tw:bg-gray-200 tw:rounded-full tw:px-2 tw:py-1\n tw:inline-flex tw:items-center tw:gap-2 tw:text-xs\"\n >\n {{ item.label }}\n <button\n type=\"button\"\n (click)=\"removeItem(item.value)\"\n class=\"tw:bg-transparent tw:border-0 tw:text-gray-600\n tw:hover:text-red-500 tw:cursor-pointer\"\n >\n ✕\n </button>\n </span>\n }\n }\n </div>\n\n <!-- Trigger -->\n <hlm-popover>\n <button hlmPopoverTrigger hlmButton variant=\"secondary\" appearance=\"outline\" type=\"button\">\n {{ selectedItems().length }} selected\n </button>\n\n <hlm-popover-content class=\"tw:w-64 tw:p-2\">\n <div class=\"tw:max-h-60 tw:overflow-auto tw:flex tw:flex-col tw:gap-1\">\n @for (option of options(); track option.value) {\n <label\n class=\"tw:flex tw:items-center tw:gap-2 tw:cursor-pointer tw:px-2 tw:py-1 tw:rounded-sm tw:hover:bg-secondary\"\n >\n <hlm-checkbox [checked]=\"isSelected(option.value)\" (changed)=\"toggle(option.value, $event)\" />\n <span class=\"tw:text-sm\">{{ option.label }}</span>\n </label>\n } @empty {\n <span class=\"tw:text-xs tw:text-muted-foreground tw:px-2 tw:py-1\">No options</span>\n }\n </div>\n </hlm-popover-content>\n </hlm-popover>\n </div>\n `,\n})\nexport class EgSearchableMultiselect implements ControlValueAccessor {\n /** Full option list with labels/values */\n options = input<SelectOption[]>([]);\n placeholder = input<string>('Start typing to add…');\n\n userClass = input<ClassValue>('', { alias: 'class' });\n\n /** Value: array of selected values (string[]) */\n value = input<string[]>([]);\n valueChange = output<string[]>();\n\n protected readonly selectedItems = signal<SelectOption[]>([]);\n protected isDisabled = false;\n private isFormBound = false;\n\n protected readonly _hostClass = computed(() => hlm(this.userClass()));\n\n protected isSelected(value: string): boolean {\n return this.selectedItems().some((s) => s.value === value);\n }\n\n protected toggle(value: string, checked: boolean): void {\n if (checked) {\n this.addItem(value);\n } else {\n this.removeItem(value);\n }\n }\n\n protected addItem(value: string): void {\n if (!this.selectedItems().some((s) => s.value === value)) {\n const opt = this.options()?.find((o) => o.value === value);\n if (!opt) return;\n const updated = [...this.selectedItems(), opt];\n this.updateValueFromSelected(updated);\n }\n }\n\n protected removeItem(value: string): void {\n const updated = this.selectedItems().filter((i) => i.value !== value);\n this.updateValueFromSelected(updated);\n }\n\n private updateSelectedFromValues(values: string[]): void {\n const opts = this.options() || [];\n this.selectedItems.set(opts.filter((o) => values.includes(o.value)));\n }\n\n private updateValueFromSelected(items: SelectOption[]): void {\n this.selectedItems.set(items);\n const values = items.map((i) => i.value);\n this.valueChange.emit(values);\n this.onChange(values);\n this.onTouched();\n }\n\n constructor() {\n // No effect needed; we read `value` input directly via writeValue for form-bound usage.\n }\n\n // --- ControlValueAccessor ---\n private onChange: (value: string[]) => void = () => {};\n private onTouched: () => void = () => {};\n\n writeValue(values: string[] | null): void {\n this.isFormBound = true;\n this.updateSelectedFromValues(values || []);\n }\n\n registerOnChange(fn: (value: string[]) => void): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.isDisabled = isDisabled;\n }\n}\n","/*\n * Public API Surface of searchable-multiselect\n */\n\nexport * from './lib/searchable-multiselect';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;MAmFa,uBAAuB,CAAA;;IAElC,OAAO,GAAG,KAAK,CAAiB,EAAE;gFAAC;IACnC,WAAW,GAAG,KAAK,CAAS,sBAAsB;oFAAC;IAEnD,SAAS,GAAG,KAAK,CAAa,EAAE,iFAAI,KAAK,EAAE,OAAO,EAAA,CAAG;;IAGrD,KAAK,GAAG,KAAK,CAAW,EAAE;8EAAC;IAC3B,WAAW,GAAG,MAAM,EAAY;IAEb,aAAa,GAAG,MAAM,CAAiB,EAAE;sFAAC;IACnD,UAAU,GAAG,KAAK;IACpB,WAAW,GAAG,KAAK;AAER,IAAA,UAAU,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC;mFAAC;AAE3D,IAAA,UAAU,CAAC,KAAa,EAAA;AAChC,QAAA,OAAO,IAAI,CAAC,aAAa,EAAE,CAAC,IAAI,CAAC,CAAC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