@area8975/ui 0.2.2-dev.48 → 0.2.2-dev.50
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/README.md +3 -2
- package/fesm2022/area8975-ui-alert.mjs +113 -0
- package/fesm2022/area8975-ui-alert.mjs.map +1 -0
- package/fesm2022/area8975-ui-avatar.mjs +157 -0
- package/fesm2022/area8975-ui-avatar.mjs.map +1 -0
- package/fesm2022/area8975-ui-badge.mjs +116 -0
- package/fesm2022/area8975-ui-badge.mjs.map +1 -0
- package/fesm2022/area8975-ui-button.mjs +314 -0
- package/fesm2022/area8975-ui-button.mjs.map +1 -0
- package/fesm2022/area8975-ui-calendar.mjs +549 -0
- package/fesm2022/area8975-ui-calendar.mjs.map +1 -0
- package/fesm2022/area8975-ui-card-header.mjs +96 -0
- package/fesm2022/area8975-ui-card-header.mjs.map +1 -0
- package/fesm2022/area8975-ui-card.mjs +73 -0
- package/fesm2022/area8975-ui-card.mjs.map +1 -0
- package/fesm2022/area8975-ui-chart-palette.mjs +225 -0
- package/fesm2022/area8975-ui-chart-palette.mjs.map +1 -0
- package/fesm2022/area8975-ui-charts.mjs +2813 -0
- package/fesm2022/area8975-ui-charts.mjs.map +1 -0
- package/fesm2022/area8975-ui-checkbox.mjs +202 -0
- package/fesm2022/area8975-ui-checkbox.mjs.map +1 -0
- package/fesm2022/area8975-ui-colour.mjs +200 -0
- package/fesm2022/area8975-ui-colour.mjs.map +1 -0
- package/fesm2022/area8975-ui-container.mjs +40 -0
- package/fesm2022/area8975-ui-container.mjs.map +1 -0
- package/fesm2022/area8975-ui-counter.mjs +246 -0
- package/fesm2022/area8975-ui-counter.mjs.map +1 -0
- package/fesm2022/area8975-ui-date-range-picker.mjs +554 -0
- package/fesm2022/area8975-ui-date-range-picker.mjs.map +1 -0
- package/fesm2022/area8975-ui-datepicker.mjs +547 -0
- package/fesm2022/area8975-ui-datepicker.mjs.map +1 -0
- package/fesm2022/area8975-ui-disclosure.mjs +279 -0
- package/fesm2022/area8975-ui-disclosure.mjs.map +1 -0
- package/fesm2022/area8975-ui-drawer.mjs +106 -0
- package/fesm2022/area8975-ui-drawer.mjs.map +1 -0
- package/fesm2022/area8975-ui-dropdown-button.mjs +141 -0
- package/fesm2022/area8975-ui-dropdown-button.mjs.map +1 -0
- package/fesm2022/area8975-ui-dropdown-menu.mjs +96 -0
- package/fesm2022/area8975-ui-dropdown-menu.mjs.map +1 -0
- package/fesm2022/area8975-ui-dropdown.mjs +208 -0
- package/fesm2022/area8975-ui-dropdown.mjs.map +1 -0
- package/fesm2022/area8975-ui-dropzone.mjs +332 -0
- package/fesm2022/area8975-ui-dropzone.mjs.map +1 -0
- package/fesm2022/area8975-ui-field.mjs +191 -0
- package/fesm2022/area8975-ui-field.mjs.map +1 -0
- package/fesm2022/area8975-ui-file-input.mjs +340 -0
- package/fesm2022/area8975-ui-file-input.mjs.map +1 -0
- package/fesm2022/area8975-ui-file.mjs +47 -0
- package/fesm2022/area8975-ui-file.mjs.map +1 -0
- package/fesm2022/area8975-ui-format.mjs +70 -0
- package/fesm2022/area8975-ui-format.mjs.map +1 -0
- package/fesm2022/area8975-ui-input-addon.mjs +42 -0
- package/fesm2022/area8975-ui-input-addon.mjs.map +1 -0
- package/fesm2022/area8975-ui-input-group.mjs +86 -0
- package/fesm2022/area8975-ui-input-group.mjs.map +1 -0
- package/fesm2022/area8975-ui-input.mjs +682 -0
- package/fesm2022/area8975-ui-input.mjs.map +1 -0
- package/fesm2022/area8975-ui-kpi.mjs +167 -0
- package/fesm2022/area8975-ui-kpi.mjs.map +1 -0
- package/fesm2022/area8975-ui-layout.mjs +63 -0
- package/fesm2022/area8975-ui-layout.mjs.map +1 -0
- package/fesm2022/area8975-ui-loading.mjs +76 -0
- package/fesm2022/area8975-ui-loading.mjs.map +1 -0
- package/fesm2022/area8975-ui-modal-close-btn.mjs +89 -0
- package/fesm2022/area8975-ui-modal-close-btn.mjs.map +1 -0
- package/fesm2022/area8975-ui-modal.mjs +235 -0
- package/fesm2022/area8975-ui-modal.mjs.map +1 -0
- package/fesm2022/area8975-ui-money.mjs +230 -0
- package/fesm2022/area8975-ui-money.mjs.map +1 -0
- package/fesm2022/area8975-ui-overlay.mjs +317 -0
- package/fesm2022/area8975-ui-overlay.mjs.map +1 -0
- package/fesm2022/area8975-ui-pagination.mjs +152 -0
- package/fesm2022/area8975-ui-pagination.mjs.map +1 -0
- package/fesm2022/area8975-ui-private.mjs +63 -0
- package/fesm2022/area8975-ui-private.mjs.map +1 -0
- package/fesm2022/area8975-ui-progress.mjs +307 -0
- package/fesm2022/area8975-ui-progress.mjs.map +1 -0
- package/fesm2022/area8975-ui-radio.mjs +199 -0
- package/fesm2022/area8975-ui-radio.mjs.map +1 -0
- package/fesm2022/area8975-ui-rich-text-editor.mjs +778 -0
- package/fesm2022/area8975-ui-rich-text-editor.mjs.map +1 -0
- package/fesm2022/area8975-ui-search.mjs +266 -0
- package/fesm2022/area8975-ui-search.mjs.map +1 -0
- package/fesm2022/area8975-ui-segmented.mjs +118 -0
- package/fesm2022/area8975-ui-segmented.mjs.map +1 -0
- package/fesm2022/area8975-ui-select.mjs +926 -0
- package/fesm2022/area8975-ui-select.mjs.map +1 -0
- package/fesm2022/area8975-ui-sidebar-group.mjs +60 -0
- package/fesm2022/area8975-ui-sidebar-group.mjs.map +1 -0
- package/fesm2022/area8975-ui-sidebar-item.mjs +107 -0
- package/fesm2022/area8975-ui-sidebar-item.mjs.map +1 -0
- package/fesm2022/area8975-ui-sidebar.mjs +109 -0
- package/fesm2022/area8975-ui-sidebar.mjs.map +1 -0
- package/fesm2022/area8975-ui-skeleton.mjs +116 -0
- package/fesm2022/area8975-ui-skeleton.mjs.map +1 -0
- package/fesm2022/area8975-ui-stat.mjs +55 -0
- package/fesm2022/area8975-ui-stat.mjs.map +1 -0
- package/fesm2022/area8975-ui-switch.mjs +132 -0
- package/fesm2022/area8975-ui-switch.mjs.map +1 -0
- package/fesm2022/area8975-ui-tab.mjs +217 -0
- package/fesm2022/area8975-ui-tab.mjs.map +1 -0
- package/fesm2022/area8975-ui-table-filters.mjs +499 -0
- package/fesm2022/area8975-ui-table-filters.mjs.map +1 -0
- package/fesm2022/area8975-ui-table.mjs +1237 -0
- package/fesm2022/area8975-ui-table.mjs.map +1 -0
- package/fesm2022/area8975-ui-textarea.mjs +375 -0
- package/fesm2022/area8975-ui-textarea.mjs.map +1 -0
- package/fesm2022/area8975-ui-theme.mjs +246 -0
- package/fesm2022/area8975-ui-theme.mjs.map +1 -0
- package/fesm2022/area8975-ui-time-select.mjs +170 -0
- package/fesm2022/area8975-ui-time-select.mjs.map +1 -0
- package/fesm2022/area8975-ui-toast.mjs +269 -0
- package/fesm2022/area8975-ui-toast.mjs.map +1 -0
- package/fesm2022/area8975-ui-toaster.mjs +117 -0
- package/fesm2022/area8975-ui-toaster.mjs.map +1 -0
- package/fesm2022/area8975-ui-tooltip.mjs +196 -0
- package/fesm2022/area8975-ui-tooltip.mjs.map +1 -0
- package/fesm2022/area8975-ui-user-menu.mjs +186 -0
- package/fesm2022/area8975-ui-user-menu.mjs.map +1 -0
- package/fesm2022/area8975-ui.mjs +0 -16269
- package/package.json +237 -1
- package/types/area8975-ui-alert.d.ts +25 -0
- package/types/area8975-ui-avatar.d.ts +40 -0
- package/types/area8975-ui-badge.d.ts +31 -0
- package/types/area8975-ui-button.d.ts +129 -0
- package/types/area8975-ui-calendar.d.ts +177 -0
- package/types/area8975-ui-card-header.d.ts +28 -0
- package/types/area8975-ui-card.d.ts +18 -0
- package/types/area8975-ui-chart-palette.d.ts +176 -0
- package/types/area8975-ui-charts.d.ts +747 -0
- package/types/area8975-ui-checkbox.d.ts +61 -0
- package/types/area8975-ui-colour.d.ts +31 -0
- package/types/area8975-ui-container.d.ts +5 -0
- package/types/area8975-ui-counter.d.ts +43 -0
- package/types/area8975-ui-date-range-picker.d.ts +132 -0
- package/types/area8975-ui-datepicker.d.ts +124 -0
- package/types/area8975-ui-disclosure.d.ts +79 -0
- package/types/area8975-ui-drawer.d.ts +25 -0
- package/types/area8975-ui-dropdown-button.d.ts +32 -0
- package/types/area8975-ui-dropdown-menu.d.ts +25 -0
- package/types/area8975-ui-dropdown.d.ts +56 -0
- package/types/area8975-ui-dropzone.d.ts +96 -0
- package/types/area8975-ui-field.d.ts +72 -0
- package/types/area8975-ui-file-input.d.ts +72 -0
- package/types/area8975-ui-file.d.ts +21 -0
- package/types/area8975-ui-format.d.ts +37 -0
- package/types/area8975-ui-input-addon.d.ts +10 -0
- package/types/area8975-ui-input-group.d.ts +18 -0
- package/types/area8975-ui-input.d.ts +224 -0
- package/types/area8975-ui-kpi.d.ts +36 -0
- package/types/area8975-ui-layout.d.ts +7 -0
- package/types/area8975-ui-loading.d.ts +16 -0
- package/types/area8975-ui-modal-close-btn.d.ts +14 -0
- package/types/area8975-ui-modal.d.ts +45 -0
- package/types/area8975-ui-money.d.ts +77 -0
- package/types/area8975-ui-overlay.d.ts +75 -0
- package/types/area8975-ui-pagination.d.ts +27 -0
- package/types/area8975-ui-private.d.ts +20 -0
- package/types/area8975-ui-progress.d.ts +127 -0
- package/types/area8975-ui-radio.d.ts +61 -0
- package/types/area8975-ui-rich-text-editor.d.ts +165 -0
- package/types/area8975-ui-search.d.ts +56 -0
- package/types/area8975-ui-segmented.d.ts +41 -0
- package/types/area8975-ui-select.d.ts +293 -0
- package/types/area8975-ui-sidebar-group.d.ts +15 -0
- package/types/area8975-ui-sidebar-item.d.ts +20 -0
- package/types/area8975-ui-sidebar.d.ts +16 -0
- package/types/area8975-ui-skeleton.d.ts +35 -0
- package/types/area8975-ui-stat.d.ts +13 -0
- package/types/area8975-ui-switch.d.ts +32 -0
- package/types/area8975-ui-tab.d.ts +45 -0
- package/types/area8975-ui-table-filters.d.ts +138 -0
- package/types/area8975-ui-table.d.ts +371 -0
- package/types/area8975-ui-textarea.d.ts +126 -0
- package/types/area8975-ui-theme.d.ts +61 -0
- package/types/area8975-ui-time-select.d.ts +35 -0
- package/types/area8975-ui-toast.d.ts +78 -0
- package/types/area8975-ui-toaster.d.ts +23 -0
- package/types/area8975-ui-tooltip.d.ts +47 -0
- package/types/area8975-ui-user-menu.d.ts +39 -0
- package/types/area8975-ui.d.ts +1 -4464
- package/fesm2022/area8975-ui.mjs.map +0 -1
|
@@ -0,0 +1,926 @@
|
|
|
1
|
+
import { NgTemplateOutlet } from "@angular/common";
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
import { ChangeDetectorRef, Component, DestroyRef, ElementRef, Injector, afterNextRender, booleanAttribute, computed, contentChild, effect, inject, input, model, output, signal, untracked } from "@angular/core";
|
|
4
|
+
import { takeUntilDestroyed, toObservable } from "@angular/core/rxjs-interop";
|
|
5
|
+
import { UiBadgeComponent } from "@area8975/ui/badge";
|
|
6
|
+
import { UiCardComponent } from "@area8975/ui/card";
|
|
7
|
+
import { UiDropdownComponent, UiDropdownDirective } from "@area8975/ui/dropdown";
|
|
8
|
+
import { UiInputComponent } from "@area8975/ui/input";
|
|
9
|
+
import { NgIcon, provideIcons } from "@ng-icons/core";
|
|
10
|
+
import { heroCheck, heroChevronDown, heroPlus, heroXMark } from "@ng-icons/heroicons/outline";
|
|
11
|
+
import { Subject, catchError, debounceTime, of, skip, switchMap } from "rxjs";
|
|
12
|
+
let nextId = 0;
|
|
13
|
+
var UiSelectComponent = class UiSelectComponent {
|
|
14
|
+
isOpen = signal(false, ...ngDevMode ? [{ debugName: "isOpen" }] : /* istanbul ignore next */ []);
|
|
15
|
+
placement = input("bottom-start", ...ngDevMode ? [{ debugName: "placement" }] : /* istanbul ignore next */ []);
|
|
16
|
+
closeBehaviour = input("whenClickOutside", ...ngDevMode ? [{ debugName: "closeBehaviour" }] : /* istanbul ignore next */ []);
|
|
17
|
+
dataSource = input.required(...ngDevMode ? [{ debugName: "dataSource" }] : /* istanbul ignore next */ []);
|
|
18
|
+
items = signal([], ...ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []);
|
|
19
|
+
placeholder = input("Select an option", ...ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []);
|
|
20
|
+
id = input("", ...ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []);
|
|
21
|
+
describedBy = input("", ...ngDevMode ? [{ debugName: "describedBy" }] : /* istanbul ignore next */ []);
|
|
22
|
+
pageSize = input(10, ...ngDevMode ? [{ debugName: "pageSize" }] : /* istanbul ignore next */ []);
|
|
23
|
+
searchMode = input("none", ...ngDevMode ? [{ debugName: "searchMode" }] : /* istanbul ignore next */ []);
|
|
24
|
+
disabled = input(false, {
|
|
25
|
+
...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
|
|
26
|
+
transform: booleanAttribute
|
|
27
|
+
});
|
|
28
|
+
validationState = model(null, ...ngDevMode ? [{ debugName: "validationState" }] : /* istanbul ignore next */ []);
|
|
29
|
+
clearable = input(false, {
|
|
30
|
+
...ngDevMode ? { debugName: "clearable" } : /* istanbul ignore next */ {},
|
|
31
|
+
transform: booleanAttribute
|
|
32
|
+
});
|
|
33
|
+
clearLabel = input("None", ...ngDevMode ? [{ debugName: "clearLabel" }] : /* istanbul ignore next */ []);
|
|
34
|
+
creatable = input(false, {
|
|
35
|
+
...ngDevMode ? { debugName: "creatable" } : /* istanbul ignore next */ {},
|
|
36
|
+
transform: booleanAttribute
|
|
37
|
+
});
|
|
38
|
+
createLabel = input((query) => `Create "${query}"`, ...ngDevMode ? [{ debugName: "createLabel" }] : /* istanbul ignore next */ []);
|
|
39
|
+
groupBy = input(null, ...ngDevMode ? [{ debugName: "groupBy" }] : /* istanbul ignore next */ []);
|
|
40
|
+
scrollToSelected = input(true, {
|
|
41
|
+
...ngDevMode ? { debugName: "scrollToSelected" } : /* istanbul ignore next */ {},
|
|
42
|
+
transform: booleanAttribute
|
|
43
|
+
});
|
|
44
|
+
multiple = input(false, {
|
|
45
|
+
...ngDevMode ? { debugName: "multiple" } : /* istanbul ignore next */ {},
|
|
46
|
+
transform: booleanAttribute
|
|
47
|
+
});
|
|
48
|
+
multipleDisplay = input("text", ...ngDevMode ? [{ debugName: "multipleDisplay" }] : /* istanbul ignore next */ []);
|
|
49
|
+
counterAfter = input(null, ...ngDevMode ? [{ debugName: "counterAfter" }] : /* istanbul ignore next */ []);
|
|
50
|
+
counterLabel = input((count) => `${count} selected`, ...ngDevMode ? [{ debugName: "counterLabel" }] : /* istanbul ignore next */ []);
|
|
51
|
+
compareWith = input((a, b) => a === b, ...ngDevMode ? [{ debugName: "compareWith" }] : /* istanbul ignore next */ []);
|
|
52
|
+
displayWith = input((item) => `${item}`, ...ngDevMode ? [{ debugName: "displayWith" }] : /* istanbul ignore next */ []);
|
|
53
|
+
selectionChange = output();
|
|
54
|
+
create = output();
|
|
55
|
+
selectedItem = model(null, ...ngDevMode ? [{ debugName: "selectedItem" }] : /* istanbul ignore next */ []);
|
|
56
|
+
selectedItems = model([], ...ngDevMode ? [{ debugName: "selectedItems" }] : /* istanbul ignore next */ []);
|
|
57
|
+
query = signal("", ...ngDevMode ? [{ debugName: "query" }] : /* istanbul ignore next */ []);
|
|
58
|
+
loading = signal(false, ...ngDevMode ? [{ debugName: "loading" }] : /* istanbul ignore next */ []);
|
|
59
|
+
hasMore = signal(true, ...ngDevMode ? [{ debugName: "hasMore" }] : /* istanbul ignore next */ []);
|
|
60
|
+
optionTemplate = contentChild("option", ...ngDevMode ? [{ debugName: "optionTemplate" }] : /* istanbul ignore next */ []);
|
|
61
|
+
triggerTemplate = contentChild("trigger", ...ngDevMode ? [{ debugName: "triggerTemplate" }] : /* istanbul ignore next */ []);
|
|
62
|
+
leadingTemplate = contentChild("leading", ...ngDevMode ? [{ debugName: "leadingTemplate" }] : /* istanbul ignore next */ []);
|
|
63
|
+
activeIndex = signal(0, ...ngDevMode ? [{ debugName: "activeIndex" }] : /* istanbul ignore next */ []);
|
|
64
|
+
listId = `ui-select-${nextId++}`;
|
|
65
|
+
hasSelection = computed(() => this.multiple() ? this.selectedItems().length > 0 : this.selectedItem() !== null, ...ngDevMode ? [{ debugName: "hasSelection" }] : /* istanbul ignore next */ []);
|
|
66
|
+
triggerLabel = computed(() => {
|
|
67
|
+
const display = this.displayWith();
|
|
68
|
+
if (!this.multiple()) {
|
|
69
|
+
const selected = this.selectedItem();
|
|
70
|
+
return selected !== null ? display(selected) : this.placeholder();
|
|
71
|
+
}
|
|
72
|
+
const selected = this.selectedItems();
|
|
73
|
+
const counterAfter = this.counterAfter();
|
|
74
|
+
if (!selected.length) return this.placeholder();
|
|
75
|
+
return counterAfter !== null && selected.length > counterAfter ? this.counterLabel()(selected.length) : selected.map(display).join(", ");
|
|
76
|
+
}, ...ngDevMode ? [{ debugName: "triggerLabel" }] : /* istanbul ignore next */ []);
|
|
77
|
+
isEmpty = computed(() => this.multiple() ? !this.selectedItems().length : this.selectedItem() === null, ...ngDevMode ? [{ debugName: "isEmpty" }] : /* istanbul ignore next */ []);
|
|
78
|
+
showTags = computed(() => this.multiple() && this.multipleDisplay() === "tags" && this.searchMode() !== "inline", ...ngDevMode ? [{ debugName: "showTags" }] : /* istanbul ignore next */ []);
|
|
79
|
+
showLeading = computed(() => !!this.leadingTemplate() && !this.multiple() && this.selectedItem() !== null, ...ngDevMode ? [{ debugName: "showLeading" }] : /* istanbul ignore next */ []);
|
|
80
|
+
leadingHidden = computed(() => this.isOpen() && this.query() !== "", ...ngDevMode ? [{ debugName: "leadingHidden" }] : /* istanbul ignore next */ []);
|
|
81
|
+
createQuery = computed(() => {
|
|
82
|
+
const query = this.query().trim();
|
|
83
|
+
const display = this.displayWith();
|
|
84
|
+
if (!this.creatable() || !query || this.loading()) return null;
|
|
85
|
+
return this.items().some((item) => display(item).toLowerCase() === query.toLowerCase()) ? null : query;
|
|
86
|
+
}, ...ngDevMode ? [{ debugName: "createQuery" }] : /* istanbul ignore next */ []);
|
|
87
|
+
rows = computed(() => {
|
|
88
|
+
const rows = [];
|
|
89
|
+
const groupBy = this.groupBy();
|
|
90
|
+
const display = this.displayWith();
|
|
91
|
+
const createQuery = this.createQuery();
|
|
92
|
+
let index = 0;
|
|
93
|
+
let group;
|
|
94
|
+
if (this.clearable() && this.hasSelection()) rows.push({
|
|
95
|
+
kind: "clear",
|
|
96
|
+
id: this.rowId(index),
|
|
97
|
+
index: index++
|
|
98
|
+
});
|
|
99
|
+
for (const item of this.items()) {
|
|
100
|
+
if (groupBy) {
|
|
101
|
+
const next = groupBy(item);
|
|
102
|
+
if (next !== group && next) rows.push({
|
|
103
|
+
kind: "group",
|
|
104
|
+
id: `${this.listId}-group-${rows.length}`,
|
|
105
|
+
label: next
|
|
106
|
+
});
|
|
107
|
+
group = next;
|
|
108
|
+
}
|
|
109
|
+
rows.push({
|
|
110
|
+
kind: "item",
|
|
111
|
+
id: this.rowId(index),
|
|
112
|
+
index: index++,
|
|
113
|
+
item,
|
|
114
|
+
label: display(item),
|
|
115
|
+
selected: this.isSelected(item)
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
if (createQuery) rows.push({
|
|
119
|
+
kind: "create",
|
|
120
|
+
id: this.rowId(index),
|
|
121
|
+
index,
|
|
122
|
+
query: createQuery
|
|
123
|
+
});
|
|
124
|
+
return rows;
|
|
125
|
+
}, ...ngDevMode ? [{ debugName: "rows" }] : /* istanbul ignore next */ []);
|
|
126
|
+
pickable = computed(() => this.rows().filter((row) => row.kind !== "group"), ...ngDevMode ? [{ debugName: "pickable" }] : /* istanbul ignore next */ []);
|
|
127
|
+
activeId = computed(() => this.isOpen() ? this.pickable()[this.activeIndex()]?.id ?? null : null, ...ngDevMode ? [{ debugName: "activeId" }] : /* istanbul ignore next */ []);
|
|
128
|
+
page = 0;
|
|
129
|
+
load$ = new Subject();
|
|
130
|
+
host = inject(ElementRef);
|
|
131
|
+
injector = inject(Injector);
|
|
132
|
+
destroyRef = inject(DestroyRef);
|
|
133
|
+
cdr = inject(ChangeDetectorRef);
|
|
134
|
+
constructor() {
|
|
135
|
+
effect(() => {
|
|
136
|
+
this.dataSource();
|
|
137
|
+
untracked(() => this.loadFirstPage());
|
|
138
|
+
});
|
|
139
|
+
effect(() => {
|
|
140
|
+
if (!this.isOpen()) return;
|
|
141
|
+
untracked(() => {
|
|
142
|
+
const selected = this.pickable().findIndex((row) => row.kind === "item" && row.selected);
|
|
143
|
+
this.activeIndex.set(this.scrollToSelected() && selected >= 0 ? selected : 0);
|
|
144
|
+
afterNextRender(() => {
|
|
145
|
+
if (this.scrollToSelected()) this.scrollActiveIntoView();
|
|
146
|
+
if (this.searchMode() === "dropdown") this.searchInput()?.focus();
|
|
147
|
+
}, { injector: this.injector });
|
|
148
|
+
});
|
|
149
|
+
});
|
|
150
|
+
toObservable(this.query).pipe(debounceTime(300), skip(1), takeUntilDestroyed(this.destroyRef)).subscribe(() => this.loadFirstPage());
|
|
151
|
+
this.load$.pipe(switchMap(() => this.fetchPage()), takeUntilDestroyed(this.destroyRef)).subscribe((result) => this.applyResult(result));
|
|
152
|
+
}
|
|
153
|
+
fetchPage() {
|
|
154
|
+
this.loading.set(true);
|
|
155
|
+
return this.dataSource().load({
|
|
156
|
+
query: this.query(),
|
|
157
|
+
page: this.page,
|
|
158
|
+
size: this.pageSize()
|
|
159
|
+
}).pipe(catchError(() => of(null)));
|
|
160
|
+
}
|
|
161
|
+
applyResult(result) {
|
|
162
|
+
this.loading.set(false);
|
|
163
|
+
if (result) {
|
|
164
|
+
this.items.update((items) => [...items, ...result.items]);
|
|
165
|
+
this.hasMore.set(result.hasMore);
|
|
166
|
+
}
|
|
167
|
+
this.cdr.markForCheck();
|
|
168
|
+
}
|
|
169
|
+
open() {
|
|
170
|
+
if (!this.disabled()) this.isOpen.set(true);
|
|
171
|
+
}
|
|
172
|
+
toggle() {
|
|
173
|
+
if (this.isOpen()) this.isOpen.set(false);
|
|
174
|
+
else this.open();
|
|
175
|
+
}
|
|
176
|
+
select(item) {
|
|
177
|
+
this.selectedItem.set(item);
|
|
178
|
+
this.selectionChange.emit(item);
|
|
179
|
+
}
|
|
180
|
+
isSelected(item) {
|
|
181
|
+
const compare = this.compareWith();
|
|
182
|
+
if (item === null) return false;
|
|
183
|
+
if (this.multiple()) return this.selectedItems().some((selected) => compare(selected, item));
|
|
184
|
+
const selected = this.selectedItem();
|
|
185
|
+
return selected !== null && compare(selected, item);
|
|
186
|
+
}
|
|
187
|
+
toggleItem(item) {
|
|
188
|
+
const compare = this.compareWith();
|
|
189
|
+
this.selectedItems.update((selected) => this.isSelected(item) ? selected.filter((existing) => !compare(existing, item)) : [...selected, item]);
|
|
190
|
+
}
|
|
191
|
+
removeItem(item) {
|
|
192
|
+
const compare = this.compareWith();
|
|
193
|
+
this.selectedItems.update((selected) => selected.filter((existing) => !compare(existing, item)));
|
|
194
|
+
}
|
|
195
|
+
clear() {
|
|
196
|
+
if (this.multiple()) this.selectedItems.set([]);
|
|
197
|
+
else {
|
|
198
|
+
this.selectedItem.set(null);
|
|
199
|
+
this.selectionChange.emit(null);
|
|
200
|
+
}
|
|
201
|
+
this.isOpen.set(false);
|
|
202
|
+
this.focusTrigger();
|
|
203
|
+
if (this.searchMode() === "inline") this.query.set("");
|
|
204
|
+
}
|
|
205
|
+
onItemClick(item) {
|
|
206
|
+
if (this.multiple()) {
|
|
207
|
+
this.toggleItem(item);
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
210
|
+
this.select(item);
|
|
211
|
+
this.isOpen.set(false);
|
|
212
|
+
this.focusTrigger();
|
|
213
|
+
if (this.searchMode() === "inline") this.query.set("");
|
|
214
|
+
}
|
|
215
|
+
onCreate() {
|
|
216
|
+
const query = this.createQuery();
|
|
217
|
+
if (!query) return;
|
|
218
|
+
this.create.emit(query);
|
|
219
|
+
this.query.set("");
|
|
220
|
+
if (!this.multiple()) {
|
|
221
|
+
this.isOpen.set(false);
|
|
222
|
+
this.focusTrigger();
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
onKeydown(event) {
|
|
226
|
+
const count = this.pickable().length;
|
|
227
|
+
const isSpacePick = event.key === " " && this.searchMode() === "none";
|
|
228
|
+
switch (event.key) {
|
|
229
|
+
case "ArrowDown":
|
|
230
|
+
case "ArrowUp":
|
|
231
|
+
event.preventDefault();
|
|
232
|
+
if (!this.isOpen()) {
|
|
233
|
+
this.open();
|
|
234
|
+
return;
|
|
235
|
+
}
|
|
236
|
+
this.moveActive(event.key === "ArrowDown" ? 1 : -1, count);
|
|
237
|
+
return;
|
|
238
|
+
case "Home":
|
|
239
|
+
case "End":
|
|
240
|
+
if (this.isOpen() && count && this.searchMode() === "none") {
|
|
241
|
+
event.preventDefault();
|
|
242
|
+
this.setActive(event.key === "Home" ? 0 : count - 1);
|
|
243
|
+
}
|
|
244
|
+
return;
|
|
245
|
+
case "Enter":
|
|
246
|
+
case " ":
|
|
247
|
+
if (event.key === " " && !isSpacePick) return;
|
|
248
|
+
event.preventDefault();
|
|
249
|
+
if (!this.isOpen()) this.open();
|
|
250
|
+
else this.pickActive();
|
|
251
|
+
return;
|
|
252
|
+
case "Escape":
|
|
253
|
+
this.focusTrigger();
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
onFocusOut(event) {
|
|
258
|
+
const next = event.relatedTarget;
|
|
259
|
+
if (this.closeBehaviour() === "none") return;
|
|
260
|
+
if (!(next instanceof Node) || !this.host.nativeElement.contains(next)) this.isOpen.set(false);
|
|
261
|
+
}
|
|
262
|
+
setActive(index) {
|
|
263
|
+
this.activeIndex.set(index);
|
|
264
|
+
afterNextRender(() => this.scrollActiveIntoView(), { injector: this.injector });
|
|
265
|
+
}
|
|
266
|
+
loadFirstPage() {
|
|
267
|
+
this.page = 0;
|
|
268
|
+
this.items.set([]);
|
|
269
|
+
this.hasMore.set(true);
|
|
270
|
+
this.load$.next();
|
|
271
|
+
}
|
|
272
|
+
loadNextPage() {
|
|
273
|
+
if (this.loading() || !this.hasMore()) return;
|
|
274
|
+
this.page++;
|
|
275
|
+
this.load$.next();
|
|
276
|
+
}
|
|
277
|
+
onQueryChange(query) {
|
|
278
|
+
this.query.set(query);
|
|
279
|
+
this.activeIndex.set(0);
|
|
280
|
+
this.open();
|
|
281
|
+
}
|
|
282
|
+
onScroll(scrollContainer) {
|
|
283
|
+
if (scrollContainer.scrollHeight - scrollContainer.scrollTop - scrollContainer.clientHeight < 48) this.loadNextPage();
|
|
284
|
+
}
|
|
285
|
+
pickActive() {
|
|
286
|
+
const row = this.pickable()[this.activeIndex()];
|
|
287
|
+
if (!row) return;
|
|
288
|
+
if (row.kind === "clear") this.clear();
|
|
289
|
+
else if (row.kind === "create") this.onCreate();
|
|
290
|
+
else if (row.kind === "item") this.onItemClick(row.item);
|
|
291
|
+
}
|
|
292
|
+
moveActive(step, count) {
|
|
293
|
+
if (count) this.setActive((this.activeIndex() + step + count) % count);
|
|
294
|
+
}
|
|
295
|
+
scrollActiveIntoView() {
|
|
296
|
+
const id = this.activeId();
|
|
297
|
+
if (id) this.host.nativeElement.querySelector(`#${id}`)?.scrollIntoView({ block: "nearest" });
|
|
298
|
+
}
|
|
299
|
+
focusTrigger() {
|
|
300
|
+
(this.searchMode() === "inline" ? this.searchInput() : this.host.nativeElement.querySelector(".ui-select"))?.focus();
|
|
301
|
+
}
|
|
302
|
+
searchInput() {
|
|
303
|
+
return this.host.nativeElement.querySelector("ui-input input");
|
|
304
|
+
}
|
|
305
|
+
rowId(index) {
|
|
306
|
+
return `${this.listId}-${index}`;
|
|
307
|
+
}
|
|
308
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
309
|
+
minVersion: "12.0.0",
|
|
310
|
+
version: "22.2.1",
|
|
311
|
+
ngImport: i0,
|
|
312
|
+
type: UiSelectComponent,
|
|
313
|
+
deps: [],
|
|
314
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
315
|
+
});
|
|
316
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
317
|
+
minVersion: "17.0.0",
|
|
318
|
+
version: "22.2.1",
|
|
319
|
+
type: UiSelectComponent,
|
|
320
|
+
isStandalone: true,
|
|
321
|
+
selector: "ui-select",
|
|
322
|
+
inputs: {
|
|
323
|
+
placement: {
|
|
324
|
+
classPropertyName: "placement",
|
|
325
|
+
publicName: "placement",
|
|
326
|
+
isSignal: true,
|
|
327
|
+
isRequired: false,
|
|
328
|
+
transformFunction: null
|
|
329
|
+
},
|
|
330
|
+
closeBehaviour: {
|
|
331
|
+
classPropertyName: "closeBehaviour",
|
|
332
|
+
publicName: "closeBehaviour",
|
|
333
|
+
isSignal: true,
|
|
334
|
+
isRequired: false,
|
|
335
|
+
transformFunction: null
|
|
336
|
+
},
|
|
337
|
+
dataSource: {
|
|
338
|
+
classPropertyName: "dataSource",
|
|
339
|
+
publicName: "dataSource",
|
|
340
|
+
isSignal: true,
|
|
341
|
+
isRequired: true,
|
|
342
|
+
transformFunction: null
|
|
343
|
+
},
|
|
344
|
+
placeholder: {
|
|
345
|
+
classPropertyName: "placeholder",
|
|
346
|
+
publicName: "placeholder",
|
|
347
|
+
isSignal: true,
|
|
348
|
+
isRequired: false,
|
|
349
|
+
transformFunction: null
|
|
350
|
+
},
|
|
351
|
+
id: {
|
|
352
|
+
classPropertyName: "id",
|
|
353
|
+
publicName: "id",
|
|
354
|
+
isSignal: true,
|
|
355
|
+
isRequired: false,
|
|
356
|
+
transformFunction: null
|
|
357
|
+
},
|
|
358
|
+
describedBy: {
|
|
359
|
+
classPropertyName: "describedBy",
|
|
360
|
+
publicName: "describedBy",
|
|
361
|
+
isSignal: true,
|
|
362
|
+
isRequired: false,
|
|
363
|
+
transformFunction: null
|
|
364
|
+
},
|
|
365
|
+
pageSize: {
|
|
366
|
+
classPropertyName: "pageSize",
|
|
367
|
+
publicName: "pageSize",
|
|
368
|
+
isSignal: true,
|
|
369
|
+
isRequired: false,
|
|
370
|
+
transformFunction: null
|
|
371
|
+
},
|
|
372
|
+
searchMode: {
|
|
373
|
+
classPropertyName: "searchMode",
|
|
374
|
+
publicName: "searchMode",
|
|
375
|
+
isSignal: true,
|
|
376
|
+
isRequired: false,
|
|
377
|
+
transformFunction: null
|
|
378
|
+
},
|
|
379
|
+
disabled: {
|
|
380
|
+
classPropertyName: "disabled",
|
|
381
|
+
publicName: "disabled",
|
|
382
|
+
isSignal: true,
|
|
383
|
+
isRequired: false,
|
|
384
|
+
transformFunction: null
|
|
385
|
+
},
|
|
386
|
+
validationState: {
|
|
387
|
+
classPropertyName: "validationState",
|
|
388
|
+
publicName: "validationState",
|
|
389
|
+
isSignal: true,
|
|
390
|
+
isRequired: false,
|
|
391
|
+
transformFunction: null
|
|
392
|
+
},
|
|
393
|
+
clearable: {
|
|
394
|
+
classPropertyName: "clearable",
|
|
395
|
+
publicName: "clearable",
|
|
396
|
+
isSignal: true,
|
|
397
|
+
isRequired: false,
|
|
398
|
+
transformFunction: null
|
|
399
|
+
},
|
|
400
|
+
clearLabel: {
|
|
401
|
+
classPropertyName: "clearLabel",
|
|
402
|
+
publicName: "clearLabel",
|
|
403
|
+
isSignal: true,
|
|
404
|
+
isRequired: false,
|
|
405
|
+
transformFunction: null
|
|
406
|
+
},
|
|
407
|
+
creatable: {
|
|
408
|
+
classPropertyName: "creatable",
|
|
409
|
+
publicName: "creatable",
|
|
410
|
+
isSignal: true,
|
|
411
|
+
isRequired: false,
|
|
412
|
+
transformFunction: null
|
|
413
|
+
},
|
|
414
|
+
createLabel: {
|
|
415
|
+
classPropertyName: "createLabel",
|
|
416
|
+
publicName: "createLabel",
|
|
417
|
+
isSignal: true,
|
|
418
|
+
isRequired: false,
|
|
419
|
+
transformFunction: null
|
|
420
|
+
},
|
|
421
|
+
groupBy: {
|
|
422
|
+
classPropertyName: "groupBy",
|
|
423
|
+
publicName: "groupBy",
|
|
424
|
+
isSignal: true,
|
|
425
|
+
isRequired: false,
|
|
426
|
+
transformFunction: null
|
|
427
|
+
},
|
|
428
|
+
scrollToSelected: {
|
|
429
|
+
classPropertyName: "scrollToSelected",
|
|
430
|
+
publicName: "scrollToSelected",
|
|
431
|
+
isSignal: true,
|
|
432
|
+
isRequired: false,
|
|
433
|
+
transformFunction: null
|
|
434
|
+
},
|
|
435
|
+
multiple: {
|
|
436
|
+
classPropertyName: "multiple",
|
|
437
|
+
publicName: "multiple",
|
|
438
|
+
isSignal: true,
|
|
439
|
+
isRequired: false,
|
|
440
|
+
transformFunction: null
|
|
441
|
+
},
|
|
442
|
+
multipleDisplay: {
|
|
443
|
+
classPropertyName: "multipleDisplay",
|
|
444
|
+
publicName: "multipleDisplay",
|
|
445
|
+
isSignal: true,
|
|
446
|
+
isRequired: false,
|
|
447
|
+
transformFunction: null
|
|
448
|
+
},
|
|
449
|
+
counterAfter: {
|
|
450
|
+
classPropertyName: "counterAfter",
|
|
451
|
+
publicName: "counterAfter",
|
|
452
|
+
isSignal: true,
|
|
453
|
+
isRequired: false,
|
|
454
|
+
transformFunction: null
|
|
455
|
+
},
|
|
456
|
+
counterLabel: {
|
|
457
|
+
classPropertyName: "counterLabel",
|
|
458
|
+
publicName: "counterLabel",
|
|
459
|
+
isSignal: true,
|
|
460
|
+
isRequired: false,
|
|
461
|
+
transformFunction: null
|
|
462
|
+
},
|
|
463
|
+
compareWith: {
|
|
464
|
+
classPropertyName: "compareWith",
|
|
465
|
+
publicName: "compareWith",
|
|
466
|
+
isSignal: true,
|
|
467
|
+
isRequired: false,
|
|
468
|
+
transformFunction: null
|
|
469
|
+
},
|
|
470
|
+
displayWith: {
|
|
471
|
+
classPropertyName: "displayWith",
|
|
472
|
+
publicName: "displayWith",
|
|
473
|
+
isSignal: true,
|
|
474
|
+
isRequired: false,
|
|
475
|
+
transformFunction: null
|
|
476
|
+
},
|
|
477
|
+
selectedItem: {
|
|
478
|
+
classPropertyName: "selectedItem",
|
|
479
|
+
publicName: "selectedItem",
|
|
480
|
+
isSignal: true,
|
|
481
|
+
isRequired: false,
|
|
482
|
+
transformFunction: null
|
|
483
|
+
},
|
|
484
|
+
selectedItems: {
|
|
485
|
+
classPropertyName: "selectedItems",
|
|
486
|
+
publicName: "selectedItems",
|
|
487
|
+
isSignal: true,
|
|
488
|
+
isRequired: false,
|
|
489
|
+
transformFunction: null
|
|
490
|
+
}
|
|
491
|
+
},
|
|
492
|
+
outputs: {
|
|
493
|
+
validationState: "validationStateChange",
|
|
494
|
+
selectionChange: "selectionChange",
|
|
495
|
+
create: "create",
|
|
496
|
+
selectedItem: "selectedItemChange",
|
|
497
|
+
selectedItems: "selectedItemsChange"
|
|
498
|
+
},
|
|
499
|
+
host: {
|
|
500
|
+
listeners: { "focusout": "onFocusOut($event)" },
|
|
501
|
+
properties: { "attr.id": "null" }
|
|
502
|
+
},
|
|
503
|
+
providers: [provideIcons({
|
|
504
|
+
heroChevronDown,
|
|
505
|
+
heroXMark,
|
|
506
|
+
heroCheck,
|
|
507
|
+
heroPlus
|
|
508
|
+
})],
|
|
509
|
+
queries: [
|
|
510
|
+
{
|
|
511
|
+
propertyName: "optionTemplate",
|
|
512
|
+
first: true,
|
|
513
|
+
predicate: ["option"],
|
|
514
|
+
descendants: true,
|
|
515
|
+
isSignal: true
|
|
516
|
+
},
|
|
517
|
+
{
|
|
518
|
+
propertyName: "triggerTemplate",
|
|
519
|
+
first: true,
|
|
520
|
+
predicate: ["trigger"],
|
|
521
|
+
descendants: true,
|
|
522
|
+
isSignal: true
|
|
523
|
+
},
|
|
524
|
+
{
|
|
525
|
+
propertyName: "leadingTemplate",
|
|
526
|
+
first: true,
|
|
527
|
+
predicate: ["leading"],
|
|
528
|
+
descendants: true,
|
|
529
|
+
isSignal: true
|
|
530
|
+
}
|
|
531
|
+
],
|
|
532
|
+
ngImport: i0,
|
|
533
|
+
template: "<ui-dropdown\n [isOpen]=\"isOpen\"\n [placement]=\"placement()\"\n [closeBehaviour]=\"closeBehaviour()\"\n matchWidth=\"minWidth\"\n class=\"w-full\"\n>\n @if (searchMode() === 'inline') {\n <ui-input\n [value]=\"isOpen() ? query() : triggerLabel()\"\n (valueChange)=\"onQueryChange($event)\"\n [placeholder]=\"triggerLabel()\"\n [disabled]=\"disabled()\"\n [id]=\"id()\"\n [describedBy]=\"describedBy()\"\n [ariaExpanded]=\"isOpen()\"\n [ariaControls]=\"listId\"\n [ariaActiveDescendant]=\"activeId()\"\n inputRole=\"combobox\"\n ariaAutocomplete=\"list\"\n ariaHasPopup=\"listbox\"\n class=\"border-0!\"\n [classes]=\"showLeading() ? 'h-auto! py-1.5! ps-2!' : 'h-auto! py-1.5!'\"\n autocomplete=\"off\"\n (click)=\"toggle()\"\n (keydown)=\"onKeydown($event)\"\n >\n @if (showLeading()) {\n <ng-template #leading>\n <!-- hidden rather than removed, so the text doesn't move -->\n <span class=\"ui-select-leading\" [class.invisible]=\"leadingHidden()\">\n <ng-container\n *ngTemplateOutlet=\"leadingTemplate()!; context: { $implicit: selectedItem()! }\"\n />\n </span>\n </ng-template>\n }\n\n <ng-template #trailing>\n <ng-icon\n name=\"heroChevronDown\"\n class=\"mx-3 size-4 text-muted-foreground transition-transform duration-100 shrink-0\"\n [class.rotate-180]=\"isOpen()\"\n />\n </ng-template>\n </ui-input>\n } @else {\n <div\n class=\"ui-select-trigger\"\n [class.ui-select-trigger--tags]=\"showTags()\"\n >\n <button\n type=\"button\"\n class=\"flex justify-between items-center gap-2 px-3 py-1.5 text-left ui-select\"\n aria-haspopup=\"listbox\"\n [attr.id]=\"id() || null\"\n [attr.aria-describedby]=\"describedBy() || null\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-controls]=\"listId\"\n [attr.aria-activedescendant]=\"searchMode() === 'none' ? activeId() : null\"\n [disabled]=\"disabled()\"\n [attr.data-invalid]=\"validationState() === false ? '' : null\"\n [attr.data-valid]=\"validationState() === true ? '' : null\"\n (click)=\"toggle()\"\n (keydown)=\"onKeydown($event)\"\n >\n @if (showTags()) {\n <!-- the visible tags sit on top, this names the button for screen readers -->\n <span class=\"sr-only\">{{ triggerLabel() }}</span>\n } @else if (!multiple() && triggerTemplate() && selectedItem() !== null) {\n <span class=\"flex items-center gap-2 min-w-0 ui-text-body\">\n <ng-container\n *ngTemplateOutlet=\"triggerTemplate()!; context: { $implicit: selectedItem()! }\"\n />\n </span>\n } @else if (multiple()) {\n <span class=\"ui-text-body ui-select-label\" [class.text-muted-foreground-1]=\"isEmpty()\">\n <span\n class=\"ui-select-label-sizer\"\n aria-hidden=\"true\"\n >{{ placeholder() }}</span>\n <span class=\"ui-select-label-text\">{{\n triggerLabel()\n }}</span>\n </span>\n } @else {\n <span class=\"ui-text-body truncate\" [class.text-muted-foreground-1]=\"isEmpty()\">{{\n triggerLabel()\n }}</span>\n }\n\n <ng-icon\n name=\"heroChevronDown\"\n class=\"ms-auto size-4 text-muted-foreground transition-transform duration-100 shrink-0\"\n [class.rotate-180]=\"isOpen()\"\n />\n </button>\n\n @if (showTags()) {\n <span\n class=\"ui-text-body ui-select-tags-sizer\"\n aria-hidden=\"true\"\n >\n {{ placeholder() }}\n </span>\n\n <div class=\"ui-select-tags\">\n @for (item of selectedItems(); track $index) {\n <ui-badge\n intent=\"secondary\"\n appearance=\"soft\"\n size=\"xs\"\n class=\"ui-select-tag ui-text-caption\"\n >\n <span class=\"truncate\">{{\n displayWith()(item)\n }}</span>\n\n @if (!disabled()) {\n <button\n type=\"button\"\n class=\"ui-select-tag-remove\"\n [attr.aria-label]=\"'Remove ' + displayWith()(item)\"\n (click)=\"removeItem(item)\"\n >\n <ng-icon\n name=\"heroXMark\"\n class=\"size-3 shrink-0\"\n />\n </button>\n }\n </ui-badge>\n } @empty {\n <span\n class=\"text-muted-foreground-1 ui-text-body truncate\"\n >\n {{ placeholder() }}\n </span>\n }\n </div>\n }\n </div>\n }\n\n @if (isOpen()) {\n <div uiDropdownContent class=\"py-2\">\n <ui-card radius=\"lg\" class=\"divide-y overflow-hidden\">\n @if (searchMode() === 'dropdown') {\n <div class=\"p-2\">\n <ui-input\n [value]=\"query()\"\n (valueChange)=\"onQueryChange($event)\"\n (keydown)=\"onKeydown($event)\"\n [ariaExpanded]=\"true\"\n [ariaControls]=\"listId\"\n [ariaActiveDescendant]=\"activeId()\"\n inputRole=\"combobox\"\n ariaAutocomplete=\"list\"\n ariaLabel=\"Search options\"\n autocomplete=\"off\"\n placeholder=\"Search...\"\n />\n </div>\n }\n\n <div\n #scrollContainer\n class=\"py-1 max-h-60 overflow-y-auto\"\n role=\"listbox\"\n [attr.id]=\"listId\"\n [attr.aria-multiselectable]=\"multiple() || null\"\n (scroll)=\"onScroll(scrollContainer)\"\n >\n @for (row of rows(); track row.id) {\n @switch (row.kind) {\n @case ('group') {\n <div\n class=\"ui-text-caption ui-select-group\"\n role=\"presentation\"\n >\n {{ row.label }}\n </div>\n }\n @case ('clear') {\n <button\n type=\"button\"\n role=\"option\"\n aria-selected=\"false\"\n tabindex=\"-1\"\n class=\"text-muted-foreground-1 ui-text-body-alt ui-select-option\"\n [attr.id]=\"row.id\"\n [attr.data-active]=\"row.index === activeIndex() ? '' : null\"\n (mousedown)=\"$event.preventDefault()\"\n (mouseenter)=\"activeIndex.set(row.index)\"\n (click)=\"clear()\"\n >\n <span class=\"truncate\">{{\n clearLabel()\n }}</span>\n </button>\n }\n @case ('item') {\n <button\n type=\"button\"\n role=\"option\"\n tabindex=\"-1\"\n class=\"text-dropdown-item-foreground ui-text-body-alt ui-select-option\"\n [attr.id]=\"row.id\"\n [attr.aria-selected]=\"row.selected\"\n [attr.data-active]=\"row.index === activeIndex() ? '' : null\"\n (mousedown)=\"$event.preventDefault()\"\n (mouseenter)=\"activeIndex.set(row.index)\"\n (click)=\"onItemClick(row.item)\"\n >\n @if (optionTemplate(); as template) {\n <span\n class=\"flex items-center gap-2 min-w-0 grow\"\n >\n <ng-container\n *ngTemplateOutlet=\"template; context: {\n $implicit: row.item,\n selected: row.selected,\n active: row.index === activeIndex()\n }\"\n />\n </span>\n } @else {\n <span class=\"truncate\">{{\n row.label\n }}</span>\n }\n\n @if (row.selected) {\n <ng-icon\n name=\"heroCheck\"\n class=\"size-4 text-primary-600! shrink-0\"\n strokeWidth=\"2.5\"\n />\n }\n </button>\n }\n @case ('create') {\n <button\n type=\"button\"\n role=\"option\"\n aria-selected=\"false\"\n tabindex=\"-1\"\n class=\"justify-start! text-primary-600 ui-text-body-alt ui-select-option\"\n [attr.id]=\"row.id\"\n [attr.data-active]=\"row.index === activeIndex() ? '' : null\"\n (mousedown)=\"$event.preventDefault()\"\n (mouseenter)=\"activeIndex.set(row.index)\"\n (click)=\"onCreate()\"\n >\n <ng-icon\n name=\"heroPlus\"\n class=\"size-4 shrink-0\"\n />\n <span class=\"truncate\">{{\n createLabel()(row.query)\n }}</span>\n </button>\n }\n }\n }\n\n @if (loading()) {\n <div class=\"px-3 py-2 text-muted-foreground ui-text-body-alt text-center\">\n Loading...\n </div>\n }\n\n @if (!loading() && items().length === 0 && !createQuery()) {\n <div class=\"px-3 py-2 text-muted-foreground ui-text-body-alt text-center\">\n No results\n </div>\n }\n </div>\n </ui-card>\n </div>\n }\n</ui-dropdown>\n",
|
|
534
|
+
styles: ["@layer properties;@layer components{:host{width:100%}}:host{position:relative;display:inline-flex;align-items:center;overflow:hidden;border-radius:var(--radius-md, .375rem);border-style:var(--tw-border-style);border-width:1px;border-color:var(--border-line-2);background-color:var(--layer)}:host:focus-within{z-index:10}:host:focus-within{border-color:var(--primary-focus)}:host:focus-within{--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}:host:focus-within{--tw-ring-color: color-mix(in srgb, oklch(88.2% .059 254.128) 50%, transparent)}@supports (color: color-mix(in lab,red,red)){:host:focus-within{--tw-ring-color: color-mix(in oklab, var(--color-primary-200, var(--color-blue-200)) 50%, transparent)}}:host:has(.ui-select:disabled){opacity:50%}:host:has(.ui-select[data-invalid]){border-color:var(--color-danger-500, var(--color-red-500))}:host:has(.ui-select[data-invalid]):focus-within{--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}:host:has(.ui-select[data-invalid]):focus-within{--tw-ring-color: color-mix(in srgb, oklch(88.5% .062 18.334) 50%, transparent)}@supports (color: color-mix(in lab,red,red)){:host:has(.ui-select[data-invalid]):focus-within{--tw-ring-color: color-mix(in oklab, var(--color-danger-200, var(--color-red-200)) 50%, transparent)}}:host:has(.ui-select[data-valid]){border-color:var(--color-success-500, var(--color-teal-500))}:host:has(.ui-select[data-valid]):focus-within{--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}:host:has(.ui-select[data-valid]):focus-within{--tw-ring-color: color-mix(in srgb, oklch(91% .096 180.426) 50%, transparent)}@supports (color: color-mix(in lab,red,red)){:host:has(.ui-select[data-valid]):focus-within{--tw-ring-color: color-mix(in oklab, var(--color-success-200, var(--color-teal-200)) 50%, transparent)}}:host-context(ui-input-group):has(.ui-select[data-invalid]){border-color:var(--color-danger-500, var(--color-red-500))!important;--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor) !important;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)!important}:host-context(ui-input-group):has(.ui-select[data-valid]){border-color:var(--color-success-500, var(--color-teal-500))!important;--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor) !important;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)!important}:host-context(ui-input-group:focus-within){border-color:var(--primary-focus)!important;--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor) !important;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)!important}.ui-select{width:100%;height:100%;border-style:var(--tw-border-style);border-width:0px}.ui-select:focus{--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ui-select:focus{--tw-outline-style: none;outline-style:none}.ui-select-trigger{display:flex;width:100%;min-width:0px;align-items:center}.ui-select-leading{margin-inline-start:calc(var(--spacing, .25rem) * 3);display:flex;flex-shrink:0;align-items:center;gap:calc(var(--spacing, .25rem) * 2)}.ui-select-label{position:relative;min-width:0px;flex:1}.ui-select-label-sizer{visibility:hidden;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ui-select-label-text{position:absolute;inset:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ui-select-trigger--tags{position:relative;display:grid}.ui-select-tags-sizer,.ui-select-tags{grid-column-start:1;grid-row-start:1}.ui-select-tags-sizer{visibility:hidden;height:0px;overflow:hidden;padding-inline-start:calc(var(--spacing, .25rem) * 3);padding-inline-end:calc(var(--spacing, .25rem) * 9);white-space:nowrap}.ui-select-trigger--tags .ui-select{position:absolute;inset:0}.ui-select-tags{pointer-events:none;position:relative;z-index:10;display:flex;min-height:calc(var(--spacing, .25rem) * 9);min-width:0px;flex:1;flex-wrap:wrap;align-items:center;gap:var(--spacing, .25rem);padding-block:var(--spacing, .25rem);padding-inline-start:calc(var(--spacing, .25rem) * 2);padding-inline-end:calc(var(--spacing, .25rem) * 9);--tw-contain-size: inline-size;contain:var(--tw-contain-size,) var(--tw-contain-layout,) var(--tw-contain-paint,) var(--tw-contain-style,)}.ui-select-tags>span{padding-inline:var(--spacing, .25rem)}.ui-select-tag{max-width:100%;min-width:0px;column-gap:var(--spacing, .25rem)}.ui-select-tag-remove{pointer-events:auto;display:inline-flex;align-items:center;justify-content:center;border-radius:var(--radius-full, calc(infinity * 1px))}.ui-select-tag-remove:hover{color:var(--foreground)}.ui-select-tag-remove:focus{--tw-outline-style: none;outline-style:none}.ui-select-tag-remove:focus-visible{--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ui-select-tag-remove:focus-visible{--tw-ring-color: color-mix(in srgb, oklch(88.2% .059 254.128) 50%, transparent)}@supports (color: color-mix(in lab,red,red)){.ui-select-tag-remove:focus-visible{--tw-ring-color: color-mix(in oklab, var(--color-primary-200, var(--color-blue-200)) 50%, transparent)}}.ui-select-option{display:flex;width:100%;align-items:center;justify-content:space-between;gap:calc(var(--spacing, .25rem) * 2);padding-inline:calc(var(--spacing, .25rem) * 3);padding-block:calc(var(--spacing, .25rem) * 2);text-align:left}.ui-select-option:focus{--tw-outline-style: none !important;outline-style:none!important}@media(forced-colors:active){.ui-select-option:focus{outline:2px solid transparent!important;outline-offset:2px!important}}.ui-select-option[data-active]{background-color:var(--dropdown-item-hover)}.ui-select-group{padding-inline:calc(var(--spacing, .25rem) * 3);padding-top:calc(var(--spacing, .25rem) * 3);padding-bottom:var(--spacing, .25rem);--tw-tracking: var(--tracking-wide, .025em);letter-spacing:var(--tracking-wide, .025em);color:var(--muted-foreground-1);text-transform:uppercase}.ui-select-group:first-child{padding-top:var(--spacing, .25rem)}ui-input-group>:host{border-radius:0!important;border-style:var(--tw-border-style)!important;border-width:0px!important}ui-input-group>:host:focus-within{--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}ui-input-group>:host(:not(:last-child)){border-right-style:var(--tw-border-style)!important;border-right-width:1px!important;border-color:var(--border-line-2)}@property --tw-border-style{syntax: \"*\"; inherits: false; initial-value: solid;}@property --tw-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-shadow-color{syntax: \"*\"; inherits: false;}@property --tw-shadow-alpha{syntax: \"<percentage>\"; inherits: false; initial-value: 100%;}@property --tw-inset-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-shadow-color{syntax: \"*\"; inherits: false;}@property --tw-inset-shadow-alpha{syntax: \"<percentage>\"; inherits: false; initial-value: 100%;}@property --tw-ring-color{syntax: \"*\"; inherits: false;}@property --tw-ring-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-ring-color{syntax: \"*\"; inherits: false;}@property --tw-inset-ring-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-ring-inset{syntax: \"*\"; inherits: false;}@property --tw-ring-offset-width{syntax: \"<length>\"; inherits: false; initial-value: 0px;}@property --tw-ring-offset-color{syntax: \"*\"; inherits: false; initial-value: #fff;}@property --tw-ring-offset-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-contain-size{syntax: \"*\"; inherits: false;}@property --tw-contain-layout{syntax: \"*\"; inherits: false;}@property --tw-contain-paint{syntax: \"*\"; inherits: false;}@property --tw-contain-style{syntax: \"*\"; inherits: false;}@property --tw-tracking{syntax: \"*\"; inherits: false;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style: solid;--tw-shadow: 0 0 #0000;--tw-shadow-color: initial;--tw-shadow-alpha: 100%;--tw-inset-shadow: 0 0 #0000;--tw-inset-shadow-color: initial;--tw-inset-shadow-alpha: 100%;--tw-ring-color: initial;--tw-ring-shadow: 0 0 #0000;--tw-inset-ring-color: initial;--tw-inset-ring-shadow: 0 0 #0000;--tw-ring-inset: initial;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-offset-shadow: 0 0 #0000;--tw-contain-size: initial;--tw-contain-layout: initial;--tw-contain-paint: initial;--tw-contain-style: initial;--tw-tracking: initial}}}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"],
|
|
535
|
+
dependencies: [
|
|
536
|
+
{
|
|
537
|
+
kind: "component",
|
|
538
|
+
type: UiDropdownComponent,
|
|
539
|
+
selector: "ui-dropdown",
|
|
540
|
+
inputs: [
|
|
541
|
+
"isOpen",
|
|
542
|
+
"placement",
|
|
543
|
+
"closeBehaviour",
|
|
544
|
+
"offset",
|
|
545
|
+
"viewportPadding",
|
|
546
|
+
"matchWidth"
|
|
547
|
+
],
|
|
548
|
+
exportAs: ["uiDropdown"]
|
|
549
|
+
},
|
|
550
|
+
{
|
|
551
|
+
kind: "directive",
|
|
552
|
+
type: UiDropdownDirective,
|
|
553
|
+
selector: "[uiDropdownContent]"
|
|
554
|
+
},
|
|
555
|
+
{
|
|
556
|
+
kind: "component",
|
|
557
|
+
type: UiInputComponent,
|
|
558
|
+
selector: "ui-input",
|
|
559
|
+
inputs: [
|
|
560
|
+
"value",
|
|
561
|
+
"classes",
|
|
562
|
+
"type",
|
|
563
|
+
"id",
|
|
564
|
+
"name",
|
|
565
|
+
"placeholder",
|
|
566
|
+
"autocomplete",
|
|
567
|
+
"inputmode",
|
|
568
|
+
"required",
|
|
569
|
+
"disabled",
|
|
570
|
+
"readonly",
|
|
571
|
+
"validationState",
|
|
572
|
+
"min",
|
|
573
|
+
"max",
|
|
574
|
+
"step",
|
|
575
|
+
"pattern",
|
|
576
|
+
"minlength",
|
|
577
|
+
"maxlength",
|
|
578
|
+
"autofocus",
|
|
579
|
+
"spellcheck",
|
|
580
|
+
"revealable",
|
|
581
|
+
"list",
|
|
582
|
+
"ariaLabel",
|
|
583
|
+
"describedBy",
|
|
584
|
+
"inputRole",
|
|
585
|
+
"ariaExpanded",
|
|
586
|
+
"ariaControls",
|
|
587
|
+
"ariaActiveDescendant",
|
|
588
|
+
"ariaAutocomplete",
|
|
589
|
+
"ariaHasPopup"
|
|
590
|
+
],
|
|
591
|
+
outputs: [
|
|
592
|
+
"valueChange",
|
|
593
|
+
"validationStateChange",
|
|
594
|
+
"focused",
|
|
595
|
+
"blurred"
|
|
596
|
+
]
|
|
597
|
+
},
|
|
598
|
+
{
|
|
599
|
+
kind: "component",
|
|
600
|
+
type: UiBadgeComponent,
|
|
601
|
+
selector: "ui-badge",
|
|
602
|
+
inputs: [
|
|
603
|
+
"appearance",
|
|
604
|
+
"intent",
|
|
605
|
+
"size"
|
|
606
|
+
]
|
|
607
|
+
},
|
|
608
|
+
{
|
|
609
|
+
kind: "component",
|
|
610
|
+
type: UiCardComponent,
|
|
611
|
+
selector: "ui-card",
|
|
612
|
+
inputs: ["radius"]
|
|
613
|
+
},
|
|
614
|
+
{
|
|
615
|
+
kind: "component",
|
|
616
|
+
type: NgIcon,
|
|
617
|
+
selector: "ng-icon",
|
|
618
|
+
inputs: [
|
|
619
|
+
"name",
|
|
620
|
+
"svg",
|
|
621
|
+
"size",
|
|
622
|
+
"strokeWidth",
|
|
623
|
+
"color"
|
|
624
|
+
]
|
|
625
|
+
},
|
|
626
|
+
{
|
|
627
|
+
kind: "directive",
|
|
628
|
+
type: NgTemplateOutlet,
|
|
629
|
+
selector: "[ngTemplateOutlet]",
|
|
630
|
+
inputs: [
|
|
631
|
+
"ngTemplateOutletContext",
|
|
632
|
+
"ngTemplateOutlet",
|
|
633
|
+
"ngTemplateOutletInjector"
|
|
634
|
+
]
|
|
635
|
+
}
|
|
636
|
+
]
|
|
637
|
+
});
|
|
638
|
+
};
|
|
639
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
640
|
+
minVersion: "12.0.0",
|
|
641
|
+
version: "22.2.1",
|
|
642
|
+
ngImport: i0,
|
|
643
|
+
type: UiSelectComponent,
|
|
644
|
+
decorators: [{
|
|
645
|
+
type: Component,
|
|
646
|
+
args: [{
|
|
647
|
+
selector: "ui-select",
|
|
648
|
+
imports: [
|
|
649
|
+
UiDropdownComponent,
|
|
650
|
+
UiDropdownDirective,
|
|
651
|
+
UiInputComponent,
|
|
652
|
+
UiBadgeComponent,
|
|
653
|
+
UiCardComponent,
|
|
654
|
+
NgIcon,
|
|
655
|
+
NgTemplateOutlet
|
|
656
|
+
],
|
|
657
|
+
host: {
|
|
658
|
+
"[attr.id]": "null",
|
|
659
|
+
"(focusout)": "onFocusOut($event)"
|
|
660
|
+
},
|
|
661
|
+
providers: [provideIcons({
|
|
662
|
+
heroChevronDown,
|
|
663
|
+
heroXMark,
|
|
664
|
+
heroCheck,
|
|
665
|
+
heroPlus
|
|
666
|
+
})],
|
|
667
|
+
template: "<ui-dropdown\n [isOpen]=\"isOpen\"\n [placement]=\"placement()\"\n [closeBehaviour]=\"closeBehaviour()\"\n matchWidth=\"minWidth\"\n class=\"w-full\"\n>\n @if (searchMode() === 'inline') {\n <ui-input\n [value]=\"isOpen() ? query() : triggerLabel()\"\n (valueChange)=\"onQueryChange($event)\"\n [placeholder]=\"triggerLabel()\"\n [disabled]=\"disabled()\"\n [id]=\"id()\"\n [describedBy]=\"describedBy()\"\n [ariaExpanded]=\"isOpen()\"\n [ariaControls]=\"listId\"\n [ariaActiveDescendant]=\"activeId()\"\n inputRole=\"combobox\"\n ariaAutocomplete=\"list\"\n ariaHasPopup=\"listbox\"\n class=\"border-0!\"\n [classes]=\"showLeading() ? 'h-auto! py-1.5! ps-2!' : 'h-auto! py-1.5!'\"\n autocomplete=\"off\"\n (click)=\"toggle()\"\n (keydown)=\"onKeydown($event)\"\n >\n @if (showLeading()) {\n <ng-template #leading>\n <!-- hidden rather than removed, so the text doesn't move -->\n <span class=\"ui-select-leading\" [class.invisible]=\"leadingHidden()\">\n <ng-container\n *ngTemplateOutlet=\"leadingTemplate()!; context: { $implicit: selectedItem()! }\"\n />\n </span>\n </ng-template>\n }\n\n <ng-template #trailing>\n <ng-icon\n name=\"heroChevronDown\"\n class=\"mx-3 size-4 text-muted-foreground transition-transform duration-100 shrink-0\"\n [class.rotate-180]=\"isOpen()\"\n />\n </ng-template>\n </ui-input>\n } @else {\n <div\n class=\"ui-select-trigger\"\n [class.ui-select-trigger--tags]=\"showTags()\"\n >\n <button\n type=\"button\"\n class=\"flex justify-between items-center gap-2 px-3 py-1.5 text-left ui-select\"\n aria-haspopup=\"listbox\"\n [attr.id]=\"id() || null\"\n [attr.aria-describedby]=\"describedBy() || null\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-controls]=\"listId\"\n [attr.aria-activedescendant]=\"searchMode() === 'none' ? activeId() : null\"\n [disabled]=\"disabled()\"\n [attr.data-invalid]=\"validationState() === false ? '' : null\"\n [attr.data-valid]=\"validationState() === true ? '' : null\"\n (click)=\"toggle()\"\n (keydown)=\"onKeydown($event)\"\n >\n @if (showTags()) {\n <!-- the visible tags sit on top, this names the button for screen readers -->\n <span class=\"sr-only\">{{ triggerLabel() }}</span>\n } @else if (!multiple() && triggerTemplate() && selectedItem() !== null) {\n <span class=\"flex items-center gap-2 min-w-0 ui-text-body\">\n <ng-container\n *ngTemplateOutlet=\"triggerTemplate()!; context: { $implicit: selectedItem()! }\"\n />\n </span>\n } @else if (multiple()) {\n <span class=\"ui-text-body ui-select-label\" [class.text-muted-foreground-1]=\"isEmpty()\">\n <span\n class=\"ui-select-label-sizer\"\n aria-hidden=\"true\"\n >{{ placeholder() }}</span>\n <span class=\"ui-select-label-text\">{{\n triggerLabel()\n }}</span>\n </span>\n } @else {\n <span class=\"ui-text-body truncate\" [class.text-muted-foreground-1]=\"isEmpty()\">{{\n triggerLabel()\n }}</span>\n }\n\n <ng-icon\n name=\"heroChevronDown\"\n class=\"ms-auto size-4 text-muted-foreground transition-transform duration-100 shrink-0\"\n [class.rotate-180]=\"isOpen()\"\n />\n </button>\n\n @if (showTags()) {\n <span\n class=\"ui-text-body ui-select-tags-sizer\"\n aria-hidden=\"true\"\n >\n {{ placeholder() }}\n </span>\n\n <div class=\"ui-select-tags\">\n @for (item of selectedItems(); track $index) {\n <ui-badge\n intent=\"secondary\"\n appearance=\"soft\"\n size=\"xs\"\n class=\"ui-select-tag ui-text-caption\"\n >\n <span class=\"truncate\">{{\n displayWith()(item)\n }}</span>\n\n @if (!disabled()) {\n <button\n type=\"button\"\n class=\"ui-select-tag-remove\"\n [attr.aria-label]=\"'Remove ' + displayWith()(item)\"\n (click)=\"removeItem(item)\"\n >\n <ng-icon\n name=\"heroXMark\"\n class=\"size-3 shrink-0\"\n />\n </button>\n }\n </ui-badge>\n } @empty {\n <span\n class=\"text-muted-foreground-1 ui-text-body truncate\"\n >\n {{ placeholder() }}\n </span>\n }\n </div>\n }\n </div>\n }\n\n @if (isOpen()) {\n <div uiDropdownContent class=\"py-2\">\n <ui-card radius=\"lg\" class=\"divide-y overflow-hidden\">\n @if (searchMode() === 'dropdown') {\n <div class=\"p-2\">\n <ui-input\n [value]=\"query()\"\n (valueChange)=\"onQueryChange($event)\"\n (keydown)=\"onKeydown($event)\"\n [ariaExpanded]=\"true\"\n [ariaControls]=\"listId\"\n [ariaActiveDescendant]=\"activeId()\"\n inputRole=\"combobox\"\n ariaAutocomplete=\"list\"\n ariaLabel=\"Search options\"\n autocomplete=\"off\"\n placeholder=\"Search...\"\n />\n </div>\n }\n\n <div\n #scrollContainer\n class=\"py-1 max-h-60 overflow-y-auto\"\n role=\"listbox\"\n [attr.id]=\"listId\"\n [attr.aria-multiselectable]=\"multiple() || null\"\n (scroll)=\"onScroll(scrollContainer)\"\n >\n @for (row of rows(); track row.id) {\n @switch (row.kind) {\n @case ('group') {\n <div\n class=\"ui-text-caption ui-select-group\"\n role=\"presentation\"\n >\n {{ row.label }}\n </div>\n }\n @case ('clear') {\n <button\n type=\"button\"\n role=\"option\"\n aria-selected=\"false\"\n tabindex=\"-1\"\n class=\"text-muted-foreground-1 ui-text-body-alt ui-select-option\"\n [attr.id]=\"row.id\"\n [attr.data-active]=\"row.index === activeIndex() ? '' : null\"\n (mousedown)=\"$event.preventDefault()\"\n (mouseenter)=\"activeIndex.set(row.index)\"\n (click)=\"clear()\"\n >\n <span class=\"truncate\">{{\n clearLabel()\n }}</span>\n </button>\n }\n @case ('item') {\n <button\n type=\"button\"\n role=\"option\"\n tabindex=\"-1\"\n class=\"text-dropdown-item-foreground ui-text-body-alt ui-select-option\"\n [attr.id]=\"row.id\"\n [attr.aria-selected]=\"row.selected\"\n [attr.data-active]=\"row.index === activeIndex() ? '' : null\"\n (mousedown)=\"$event.preventDefault()\"\n (mouseenter)=\"activeIndex.set(row.index)\"\n (click)=\"onItemClick(row.item)\"\n >\n @if (optionTemplate(); as template) {\n <span\n class=\"flex items-center gap-2 min-w-0 grow\"\n >\n <ng-container\n *ngTemplateOutlet=\"template; context: {\n $implicit: row.item,\n selected: row.selected,\n active: row.index === activeIndex()\n }\"\n />\n </span>\n } @else {\n <span class=\"truncate\">{{\n row.label\n }}</span>\n }\n\n @if (row.selected) {\n <ng-icon\n name=\"heroCheck\"\n class=\"size-4 text-primary-600! shrink-0\"\n strokeWidth=\"2.5\"\n />\n }\n </button>\n }\n @case ('create') {\n <button\n type=\"button\"\n role=\"option\"\n aria-selected=\"false\"\n tabindex=\"-1\"\n class=\"justify-start! text-primary-600 ui-text-body-alt ui-select-option\"\n [attr.id]=\"row.id\"\n [attr.data-active]=\"row.index === activeIndex() ? '' : null\"\n (mousedown)=\"$event.preventDefault()\"\n (mouseenter)=\"activeIndex.set(row.index)\"\n (click)=\"onCreate()\"\n >\n <ng-icon\n name=\"heroPlus\"\n class=\"size-4 shrink-0\"\n />\n <span class=\"truncate\">{{\n createLabel()(row.query)\n }}</span>\n </button>\n }\n }\n }\n\n @if (loading()) {\n <div class=\"px-3 py-2 text-muted-foreground ui-text-body-alt text-center\">\n Loading...\n </div>\n }\n\n @if (!loading() && items().length === 0 && !createQuery()) {\n <div class=\"px-3 py-2 text-muted-foreground ui-text-body-alt text-center\">\n No results\n </div>\n }\n </div>\n </ui-card>\n </div>\n }\n</ui-dropdown>\n",
|
|
668
|
+
styles: ["@layer properties;@layer components{:host{width:100%}}:host{position:relative;display:inline-flex;align-items:center;overflow:hidden;border-radius:var(--radius-md, .375rem);border-style:var(--tw-border-style);border-width:1px;border-color:var(--border-line-2);background-color:var(--layer)}:host:focus-within{z-index:10}:host:focus-within{border-color:var(--primary-focus)}:host:focus-within{--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}:host:focus-within{--tw-ring-color: color-mix(in srgb, oklch(88.2% .059 254.128) 50%, transparent)}@supports (color: color-mix(in lab,red,red)){:host:focus-within{--tw-ring-color: color-mix(in oklab, var(--color-primary-200, var(--color-blue-200)) 50%, transparent)}}:host:has(.ui-select:disabled){opacity:50%}:host:has(.ui-select[data-invalid]){border-color:var(--color-danger-500, var(--color-red-500))}:host:has(.ui-select[data-invalid]):focus-within{--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}:host:has(.ui-select[data-invalid]):focus-within{--tw-ring-color: color-mix(in srgb, oklch(88.5% .062 18.334) 50%, transparent)}@supports (color: color-mix(in lab,red,red)){:host:has(.ui-select[data-invalid]):focus-within{--tw-ring-color: color-mix(in oklab, var(--color-danger-200, var(--color-red-200)) 50%, transparent)}}:host:has(.ui-select[data-valid]){border-color:var(--color-success-500, var(--color-teal-500))}:host:has(.ui-select[data-valid]):focus-within{--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}:host:has(.ui-select[data-valid]):focus-within{--tw-ring-color: color-mix(in srgb, oklch(91% .096 180.426) 50%, transparent)}@supports (color: color-mix(in lab,red,red)){:host:has(.ui-select[data-valid]):focus-within{--tw-ring-color: color-mix(in oklab, var(--color-success-200, var(--color-teal-200)) 50%, transparent)}}:host-context(ui-input-group):has(.ui-select[data-invalid]){border-color:var(--color-danger-500, var(--color-red-500))!important;--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor) !important;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)!important}:host-context(ui-input-group):has(.ui-select[data-valid]){border-color:var(--color-success-500, var(--color-teal-500))!important;--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor) !important;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)!important}:host-context(ui-input-group:focus-within){border-color:var(--primary-focus)!important;--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor) !important;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)!important}.ui-select{width:100%;height:100%;border-style:var(--tw-border-style);border-width:0px}.ui-select:focus{--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ui-select:focus{--tw-outline-style: none;outline-style:none}.ui-select-trigger{display:flex;width:100%;min-width:0px;align-items:center}.ui-select-leading{margin-inline-start:calc(var(--spacing, .25rem) * 3);display:flex;flex-shrink:0;align-items:center;gap:calc(var(--spacing, .25rem) * 2)}.ui-select-label{position:relative;min-width:0px;flex:1}.ui-select-label-sizer{visibility:hidden;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ui-select-label-text{position:absolute;inset:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ui-select-trigger--tags{position:relative;display:grid}.ui-select-tags-sizer,.ui-select-tags{grid-column-start:1;grid-row-start:1}.ui-select-tags-sizer{visibility:hidden;height:0px;overflow:hidden;padding-inline-start:calc(var(--spacing, .25rem) * 3);padding-inline-end:calc(var(--spacing, .25rem) * 9);white-space:nowrap}.ui-select-trigger--tags .ui-select{position:absolute;inset:0}.ui-select-tags{pointer-events:none;position:relative;z-index:10;display:flex;min-height:calc(var(--spacing, .25rem) * 9);min-width:0px;flex:1;flex-wrap:wrap;align-items:center;gap:var(--spacing, .25rem);padding-block:var(--spacing, .25rem);padding-inline-start:calc(var(--spacing, .25rem) * 2);padding-inline-end:calc(var(--spacing, .25rem) * 9);--tw-contain-size: inline-size;contain:var(--tw-contain-size,) var(--tw-contain-layout,) var(--tw-contain-paint,) var(--tw-contain-style,)}.ui-select-tags>span{padding-inline:var(--spacing, .25rem)}.ui-select-tag{max-width:100%;min-width:0px;column-gap:var(--spacing, .25rem)}.ui-select-tag-remove{pointer-events:auto;display:inline-flex;align-items:center;justify-content:center;border-radius:var(--radius-full, calc(infinity * 1px))}.ui-select-tag-remove:hover{color:var(--foreground)}.ui-select-tag-remove:focus{--tw-outline-style: none;outline-style:none}.ui-select-tag-remove:focus-visible{--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ui-select-tag-remove:focus-visible{--tw-ring-color: color-mix(in srgb, oklch(88.2% .059 254.128) 50%, transparent)}@supports (color: color-mix(in lab,red,red)){.ui-select-tag-remove:focus-visible{--tw-ring-color: color-mix(in oklab, var(--color-primary-200, var(--color-blue-200)) 50%, transparent)}}.ui-select-option{display:flex;width:100%;align-items:center;justify-content:space-between;gap:calc(var(--spacing, .25rem) * 2);padding-inline:calc(var(--spacing, .25rem) * 3);padding-block:calc(var(--spacing, .25rem) * 2);text-align:left}.ui-select-option:focus{--tw-outline-style: none !important;outline-style:none!important}@media(forced-colors:active){.ui-select-option:focus{outline:2px solid transparent!important;outline-offset:2px!important}}.ui-select-option[data-active]{background-color:var(--dropdown-item-hover)}.ui-select-group{padding-inline:calc(var(--spacing, .25rem) * 3);padding-top:calc(var(--spacing, .25rem) * 3);padding-bottom:var(--spacing, .25rem);--tw-tracking: var(--tracking-wide, .025em);letter-spacing:var(--tracking-wide, .025em);color:var(--muted-foreground-1);text-transform:uppercase}.ui-select-group:first-child{padding-top:var(--spacing, .25rem)}ui-input-group>:host{border-radius:0!important;border-style:var(--tw-border-style)!important;border-width:0px!important}ui-input-group>:host:focus-within{--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}ui-input-group>:host(:not(:last-child)){border-right-style:var(--tw-border-style)!important;border-right-width:1px!important;border-color:var(--border-line-2)}@property --tw-border-style{syntax: \"*\"; inherits: false; initial-value: solid;}@property --tw-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-shadow-color{syntax: \"*\"; inherits: false;}@property --tw-shadow-alpha{syntax: \"<percentage>\"; inherits: false; initial-value: 100%;}@property --tw-inset-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-shadow-color{syntax: \"*\"; inherits: false;}@property --tw-inset-shadow-alpha{syntax: \"<percentage>\"; inherits: false; initial-value: 100%;}@property --tw-ring-color{syntax: \"*\"; inherits: false;}@property --tw-ring-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-ring-color{syntax: \"*\"; inherits: false;}@property --tw-inset-ring-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-ring-inset{syntax: \"*\"; inherits: false;}@property --tw-ring-offset-width{syntax: \"<length>\"; inherits: false; initial-value: 0px;}@property --tw-ring-offset-color{syntax: \"*\"; inherits: false; initial-value: #fff;}@property --tw-ring-offset-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-contain-size{syntax: \"*\"; inherits: false;}@property --tw-contain-layout{syntax: \"*\"; inherits: false;}@property --tw-contain-paint{syntax: \"*\"; inherits: false;}@property --tw-contain-style{syntax: \"*\"; inherits: false;}@property --tw-tracking{syntax: \"*\"; inherits: false;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style: solid;--tw-shadow: 0 0 #0000;--tw-shadow-color: initial;--tw-shadow-alpha: 100%;--tw-inset-shadow: 0 0 #0000;--tw-inset-shadow-color: initial;--tw-inset-shadow-alpha: 100%;--tw-ring-color: initial;--tw-ring-shadow: 0 0 #0000;--tw-inset-ring-color: initial;--tw-inset-ring-shadow: 0 0 #0000;--tw-ring-inset: initial;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-offset-shadow: 0 0 #0000;--tw-contain-size: initial;--tw-contain-layout: initial;--tw-contain-paint: initial;--tw-contain-style: initial;--tw-tracking: initial}}}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"]
|
|
669
|
+
}]
|
|
670
|
+
}],
|
|
671
|
+
ctorParameters: () => [],
|
|
672
|
+
propDecorators: {
|
|
673
|
+
placement: [{
|
|
674
|
+
type: i0.Input,
|
|
675
|
+
args: [{
|
|
676
|
+
isSignal: true,
|
|
677
|
+
alias: "placement",
|
|
678
|
+
required: false
|
|
679
|
+
}]
|
|
680
|
+
}],
|
|
681
|
+
closeBehaviour: [{
|
|
682
|
+
type: i0.Input,
|
|
683
|
+
args: [{
|
|
684
|
+
isSignal: true,
|
|
685
|
+
alias: "closeBehaviour",
|
|
686
|
+
required: false
|
|
687
|
+
}]
|
|
688
|
+
}],
|
|
689
|
+
dataSource: [{
|
|
690
|
+
type: i0.Input,
|
|
691
|
+
args: [{
|
|
692
|
+
isSignal: true,
|
|
693
|
+
alias: "dataSource",
|
|
694
|
+
required: true
|
|
695
|
+
}]
|
|
696
|
+
}],
|
|
697
|
+
placeholder: [{
|
|
698
|
+
type: i0.Input,
|
|
699
|
+
args: [{
|
|
700
|
+
isSignal: true,
|
|
701
|
+
alias: "placeholder",
|
|
702
|
+
required: false
|
|
703
|
+
}]
|
|
704
|
+
}],
|
|
705
|
+
id: [{
|
|
706
|
+
type: i0.Input,
|
|
707
|
+
args: [{
|
|
708
|
+
isSignal: true,
|
|
709
|
+
alias: "id",
|
|
710
|
+
required: false
|
|
711
|
+
}]
|
|
712
|
+
}],
|
|
713
|
+
describedBy: [{
|
|
714
|
+
type: i0.Input,
|
|
715
|
+
args: [{
|
|
716
|
+
isSignal: true,
|
|
717
|
+
alias: "describedBy",
|
|
718
|
+
required: false
|
|
719
|
+
}]
|
|
720
|
+
}],
|
|
721
|
+
pageSize: [{
|
|
722
|
+
type: i0.Input,
|
|
723
|
+
args: [{
|
|
724
|
+
isSignal: true,
|
|
725
|
+
alias: "pageSize",
|
|
726
|
+
required: false
|
|
727
|
+
}]
|
|
728
|
+
}],
|
|
729
|
+
searchMode: [{
|
|
730
|
+
type: i0.Input,
|
|
731
|
+
args: [{
|
|
732
|
+
isSignal: true,
|
|
733
|
+
alias: "searchMode",
|
|
734
|
+
required: false
|
|
735
|
+
}]
|
|
736
|
+
}],
|
|
737
|
+
disabled: [{
|
|
738
|
+
type: i0.Input,
|
|
739
|
+
args: [{
|
|
740
|
+
isSignal: true,
|
|
741
|
+
alias: "disabled",
|
|
742
|
+
required: false
|
|
743
|
+
}]
|
|
744
|
+
}],
|
|
745
|
+
validationState: [{
|
|
746
|
+
type: i0.Input,
|
|
747
|
+
args: [{
|
|
748
|
+
isSignal: true,
|
|
749
|
+
alias: "validationState",
|
|
750
|
+
required: false
|
|
751
|
+
}]
|
|
752
|
+
}, {
|
|
753
|
+
type: i0.Output,
|
|
754
|
+
args: ["validationStateChange"]
|
|
755
|
+
}],
|
|
756
|
+
clearable: [{
|
|
757
|
+
type: i0.Input,
|
|
758
|
+
args: [{
|
|
759
|
+
isSignal: true,
|
|
760
|
+
alias: "clearable",
|
|
761
|
+
required: false
|
|
762
|
+
}]
|
|
763
|
+
}],
|
|
764
|
+
clearLabel: [{
|
|
765
|
+
type: i0.Input,
|
|
766
|
+
args: [{
|
|
767
|
+
isSignal: true,
|
|
768
|
+
alias: "clearLabel",
|
|
769
|
+
required: false
|
|
770
|
+
}]
|
|
771
|
+
}],
|
|
772
|
+
creatable: [{
|
|
773
|
+
type: i0.Input,
|
|
774
|
+
args: [{
|
|
775
|
+
isSignal: true,
|
|
776
|
+
alias: "creatable",
|
|
777
|
+
required: false
|
|
778
|
+
}]
|
|
779
|
+
}],
|
|
780
|
+
createLabel: [{
|
|
781
|
+
type: i0.Input,
|
|
782
|
+
args: [{
|
|
783
|
+
isSignal: true,
|
|
784
|
+
alias: "createLabel",
|
|
785
|
+
required: false
|
|
786
|
+
}]
|
|
787
|
+
}],
|
|
788
|
+
groupBy: [{
|
|
789
|
+
type: i0.Input,
|
|
790
|
+
args: [{
|
|
791
|
+
isSignal: true,
|
|
792
|
+
alias: "groupBy",
|
|
793
|
+
required: false
|
|
794
|
+
}]
|
|
795
|
+
}],
|
|
796
|
+
scrollToSelected: [{
|
|
797
|
+
type: i0.Input,
|
|
798
|
+
args: [{
|
|
799
|
+
isSignal: true,
|
|
800
|
+
alias: "scrollToSelected",
|
|
801
|
+
required: false
|
|
802
|
+
}]
|
|
803
|
+
}],
|
|
804
|
+
multiple: [{
|
|
805
|
+
type: i0.Input,
|
|
806
|
+
args: [{
|
|
807
|
+
isSignal: true,
|
|
808
|
+
alias: "multiple",
|
|
809
|
+
required: false
|
|
810
|
+
}]
|
|
811
|
+
}],
|
|
812
|
+
multipleDisplay: [{
|
|
813
|
+
type: i0.Input,
|
|
814
|
+
args: [{
|
|
815
|
+
isSignal: true,
|
|
816
|
+
alias: "multipleDisplay",
|
|
817
|
+
required: false
|
|
818
|
+
}]
|
|
819
|
+
}],
|
|
820
|
+
counterAfter: [{
|
|
821
|
+
type: i0.Input,
|
|
822
|
+
args: [{
|
|
823
|
+
isSignal: true,
|
|
824
|
+
alias: "counterAfter",
|
|
825
|
+
required: false
|
|
826
|
+
}]
|
|
827
|
+
}],
|
|
828
|
+
counterLabel: [{
|
|
829
|
+
type: i0.Input,
|
|
830
|
+
args: [{
|
|
831
|
+
isSignal: true,
|
|
832
|
+
alias: "counterLabel",
|
|
833
|
+
required: false
|
|
834
|
+
}]
|
|
835
|
+
}],
|
|
836
|
+
compareWith: [{
|
|
837
|
+
type: i0.Input,
|
|
838
|
+
args: [{
|
|
839
|
+
isSignal: true,
|
|
840
|
+
alias: "compareWith",
|
|
841
|
+
required: false
|
|
842
|
+
}]
|
|
843
|
+
}],
|
|
844
|
+
displayWith: [{
|
|
845
|
+
type: i0.Input,
|
|
846
|
+
args: [{
|
|
847
|
+
isSignal: true,
|
|
848
|
+
alias: "displayWith",
|
|
849
|
+
required: false
|
|
850
|
+
}]
|
|
851
|
+
}],
|
|
852
|
+
selectionChange: [{
|
|
853
|
+
type: i0.Output,
|
|
854
|
+
args: ["selectionChange"]
|
|
855
|
+
}],
|
|
856
|
+
create: [{
|
|
857
|
+
type: i0.Output,
|
|
858
|
+
args: ["create"]
|
|
859
|
+
}],
|
|
860
|
+
selectedItem: [{
|
|
861
|
+
type: i0.Input,
|
|
862
|
+
args: [{
|
|
863
|
+
isSignal: true,
|
|
864
|
+
alias: "selectedItem",
|
|
865
|
+
required: false
|
|
866
|
+
}]
|
|
867
|
+
}, {
|
|
868
|
+
type: i0.Output,
|
|
869
|
+
args: ["selectedItemChange"]
|
|
870
|
+
}],
|
|
871
|
+
selectedItems: [{
|
|
872
|
+
type: i0.Input,
|
|
873
|
+
args: [{
|
|
874
|
+
isSignal: true,
|
|
875
|
+
alias: "selectedItems",
|
|
876
|
+
required: false
|
|
877
|
+
}]
|
|
878
|
+
}, {
|
|
879
|
+
type: i0.Output,
|
|
880
|
+
args: ["selectedItemsChange"]
|
|
881
|
+
}],
|
|
882
|
+
optionTemplate: [{
|
|
883
|
+
type: i0.ContentChild,
|
|
884
|
+
args: ["option", { isSignal: true }]
|
|
885
|
+
}],
|
|
886
|
+
triggerTemplate: [{
|
|
887
|
+
type: i0.ContentChild,
|
|
888
|
+
args: ["trigger", { isSignal: true }]
|
|
889
|
+
}],
|
|
890
|
+
leadingTemplate: [{
|
|
891
|
+
type: i0.ContentChild,
|
|
892
|
+
args: ["leading", { isSignal: true }]
|
|
893
|
+
}]
|
|
894
|
+
}
|
|
895
|
+
});
|
|
896
|
+
var SelectLocalDataSource = class {
|
|
897
|
+
items;
|
|
898
|
+
search;
|
|
899
|
+
constructor(items, search) {
|
|
900
|
+
this.items = items;
|
|
901
|
+
this.search = search;
|
|
902
|
+
}
|
|
903
|
+
load(params) {
|
|
904
|
+
const query = params.query.trim();
|
|
905
|
+
const filteredItems = query ? this.items.filter((item) => this.search(item, query)) : this.items;
|
|
906
|
+
const start = params.page * params.size;
|
|
907
|
+
const end = start + params.size;
|
|
908
|
+
return of({
|
|
909
|
+
items: filteredItems.slice(start, end),
|
|
910
|
+
hasMore: end < filteredItems.length
|
|
911
|
+
});
|
|
912
|
+
}
|
|
913
|
+
};
|
|
914
|
+
var SelectRemoteDataSource = class {
|
|
915
|
+
fetch;
|
|
916
|
+
constructor(fetch) {
|
|
917
|
+
this.fetch = fetch;
|
|
918
|
+
}
|
|
919
|
+
load(params) {
|
|
920
|
+
return this.fetch(params);
|
|
921
|
+
}
|
|
922
|
+
};
|
|
923
|
+
const SelectMultipleDisplays = ["text", "tags"];
|
|
924
|
+
export { SelectLocalDataSource, SelectMultipleDisplays, SelectRemoteDataSource, UiSelectComponent };
|
|
925
|
+
|
|
926
|
+
//# sourceMappingURL=area8975-ui-select.mjs.map
|