@koalarx/ui 21.1.3 → 21.1.4
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.
|
@@ -36,11 +36,11 @@ class Dropdown {
|
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: Dropdown, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
39
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.0.6", type: Dropdown, isStandalone: true, selector: "kl-dropdown", viewQueries: [{ propertyName: "dropdownTriggerElement", first: true, predicate: ["dropdownTrigger"], descendants: true, isSignal: true }, { propertyName: "dropdownContentElement", first: true, predicate: ["dropdownContent"], descendants: true, isSignal: true }], ngImport: i0, template: "<
|
|
39
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.0.6", type: Dropdown, isStandalone: true, selector: "kl-dropdown", viewQueries: [{ propertyName: "dropdownTriggerElement", first: true, predicate: ["dropdownTrigger"], descendants: true, isSignal: true }, { propertyName: "dropdownContentElement", first: true, predicate: ["dropdownContent"], descendants: true, isSignal: true }], ngImport: i0, template: "<button #dropdownTrigger\n type=\"button\"\n class=\"p-0!\"\n tabindex=\"0\"\n role=\"button\"\n [attr.popovertarget]=\"id\"\n (click)=\"ajustPosition()\">\n <ng-content select=\"[trigger]\" />\n</button>\n\n<div #dropdownContent\n tabindex=\"0\"\n popover\n [id]=\"id\"\n class=\"dropdown bg-base-200 rounded-box mt-3 min-w-52 w-auto max-w-[30vw] max-h-[40vh] shadow-sm border-2 border-neutral-200 dark:border-neutral-800 rounded-md overflow-y-auto\">\n <ng-content select=\"[options]\" />\n</div>\n", changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
40
40
|
}
|
|
41
41
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: Dropdown, decorators: [{
|
|
42
42
|
type: Component,
|
|
43
|
-
args: [{ selector: 'kl-dropdown', changeDetection: ChangeDetectionStrategy.OnPush, template: "<
|
|
43
|
+
args: [{ selector: 'kl-dropdown', changeDetection: ChangeDetectionStrategy.OnPush, template: "<button #dropdownTrigger\n type=\"button\"\n class=\"p-0!\"\n tabindex=\"0\"\n role=\"button\"\n [attr.popovertarget]=\"id\"\n (click)=\"ajustPosition()\">\n <ng-content select=\"[trigger]\" />\n</button>\n\n<div #dropdownContent\n tabindex=\"0\"\n popover\n [id]=\"id\"\n class=\"dropdown bg-base-200 rounded-box mt-3 min-w-52 w-auto max-w-[30vw] max-h-[40vh] shadow-sm border-2 border-neutral-200 dark:border-neutral-800 rounded-md overflow-y-auto\">\n <ng-content select=\"[options]\" />\n</div>\n" }]
|
|
44
44
|
}], ctorParameters: () => [], propDecorators: { dropdownTriggerElement: [{ type: i0.ViewChild, args: ['dropdownTrigger', { isSignal: true }] }], dropdownContentElement: [{ type: i0.ViewChild, args: ['dropdownContent', { isSignal: true }] }] } });
|
|
45
45
|
|
|
46
46
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"koalarx-ui-shared-components-dropdown.mjs","sources":["../../projects/koala-ui/shared/components/dropdown/dropdown.ts","../../projects/koala-ui/shared/components/dropdown/dropdown.html","../../projects/koala-ui/shared/components/dropdown/koalarx-ui-shared-components-dropdown.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n effect,\n ElementRef,\n viewChild,\n} from '@angular/core';\nimport { KlString, randomString } from '@koalarx/utils/KlString';\n\n@Component({\n selector: 'kl-dropdown',\n templateUrl: './dropdown.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class Dropdown {\n private readonly dropdownTriggerElement =\n viewChild<ElementRef<HTMLButtonElement>>('dropdownTrigger');\n private readonly dropdownContentElement =\n viewChild<ElementRef<HTMLDivElement>>('dropdownContent');\n\n id = randomString(10, { numbers: true, uppercase: false, lowercase: false });\n\n private readonly anchorName = new KlString('--anchor-').concat(this.id);\n\n constructor() {\n effect(() => {\n const triggerElement = this.dropdownTriggerElement()?.nativeElement;\n const contentElement = this.dropdownContentElement()?.nativeElement;\n\n if (triggerElement && contentElement) {\n triggerElement.style = `anchor-name: ${this.anchorName};`;\n contentElement.style = `position-anchor: ${this.anchorName};`;\n }\n });\n }\n\n ajustPosition() {\n const triggerElement = this.dropdownTriggerElement()?.nativeElement;\n const contentElement = this.dropdownContentElement()?.nativeElement;\n\n if (triggerElement && contentElement) {\n setTimeout(() => {\n const position = contentElement.getBoundingClientRect();\n const screenWidth = document.body.clientWidth;\n const screenHeight = document.body.clientHeight;\n\n if (position.right > screenWidth) {\n contentElement.classList.add('dropdown-left');\n contentElement.classList.add('dropdown-start');\n }\n\n if (position.bottom > screenHeight) {\n contentElement.classList.add('dropdown-top');\n }\n });\n }\n }\n}\n","<
|
|
1
|
+
{"version":3,"file":"koalarx-ui-shared-components-dropdown.mjs","sources":["../../projects/koala-ui/shared/components/dropdown/dropdown.ts","../../projects/koala-ui/shared/components/dropdown/dropdown.html","../../projects/koala-ui/shared/components/dropdown/koalarx-ui-shared-components-dropdown.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n effect,\n ElementRef,\n viewChild,\n} from '@angular/core';\nimport { KlString, randomString } from '@koalarx/utils/KlString';\n\n@Component({\n selector: 'kl-dropdown',\n templateUrl: './dropdown.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class Dropdown {\n private readonly dropdownTriggerElement =\n viewChild<ElementRef<HTMLButtonElement>>('dropdownTrigger');\n private readonly dropdownContentElement =\n viewChild<ElementRef<HTMLDivElement>>('dropdownContent');\n\n id = randomString(10, { numbers: true, uppercase: false, lowercase: false });\n\n private readonly anchorName = new KlString('--anchor-').concat(this.id);\n\n constructor() {\n effect(() => {\n const triggerElement = this.dropdownTriggerElement()?.nativeElement;\n const contentElement = this.dropdownContentElement()?.nativeElement;\n\n if (triggerElement && contentElement) {\n triggerElement.style = `anchor-name: ${this.anchorName};`;\n contentElement.style = `position-anchor: ${this.anchorName};`;\n }\n });\n }\n\n ajustPosition() {\n const triggerElement = this.dropdownTriggerElement()?.nativeElement;\n const contentElement = this.dropdownContentElement()?.nativeElement;\n\n if (triggerElement && contentElement) {\n setTimeout(() => {\n const position = contentElement.getBoundingClientRect();\n const screenWidth = document.body.clientWidth;\n const screenHeight = document.body.clientHeight;\n\n if (position.right > screenWidth) {\n contentElement.classList.add('dropdown-left');\n contentElement.classList.add('dropdown-start');\n }\n\n if (position.bottom > screenHeight) {\n contentElement.classList.add('dropdown-top');\n }\n });\n }\n }\n}\n","<button #dropdownTrigger\n type=\"button\"\n class=\"p-0!\"\n tabindex=\"0\"\n role=\"button\"\n [attr.popovertarget]=\"id\"\n (click)=\"ajustPosition()\">\n <ng-content select=\"[trigger]\" />\n</button>\n\n<div #dropdownContent\n tabindex=\"0\"\n popover\n [id]=\"id\"\n class=\"dropdown bg-base-200 rounded-box mt-3 min-w-52 w-auto max-w-[30vw] max-h-[40vh] shadow-sm border-2 border-neutral-200 dark:border-neutral-800 rounded-md overflow-y-auto\">\n <ng-content select=\"[options]\" />\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAca,QAAQ,CAAA;AACF,IAAA,sBAAsB,GACrC,SAAS,CAAgC,iBAAiB,kEAAC;AAC5C,IAAA,sBAAsB,GACrC,SAAS,CAA6B,iBAAiB,kEAAC;AAE1D,IAAA,EAAE,GAAG,YAAY,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;AAE3D,IAAA,UAAU,GAAG,IAAI,QAAQ,CAAC,WAAW,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;AAEvE,IAAA,WAAA,GAAA;QACE,MAAM,CAAC,MAAK;YACV,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