@hiai-gg/docsmint 0.3.7 → 0.3.8
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/backend/src/lib/logger.ts +45 -15
- package/dist/backend/index.js +238 -150
- package/dist/frontend/CategoryDialog-DphkZqIB.js +611 -0
- package/dist/frontend/ConfirmDialog-BLF3x_hr.js +214 -0
- package/dist/frontend/CreateSnapshotDialog-D5vPvFTL.js +216 -0
- package/dist/frontend/DatePicker-CLNTdvTk.js +259 -0
- package/dist/frontend/DeleteDialog-DxYFJivN.js +174 -0
- package/dist/frontend/FolderDialog-CRVZM2Oi.js +250 -0
- package/dist/frontend/FolderNode-C2zG7uii.js +298 -0
- package/dist/frontend/FolderTreeSelector-CyB8y2Sm.js +103 -0
- package/dist/frontend/Icon-CooFj4Ee.js +64 -0
- package/dist/frontend/SettingsDialog-DCM4-N6_.js +1016 -0
- package/dist/frontend/ShareDialog-DYu3RKQu.js +165 -0
- package/dist/frontend/TagCreateDialog-DXQs2bL9.js +260 -0
- package/dist/frontend/camera-iKXDOOWT.js +29 -0
- package/dist/frontend/check-D-UuvBuh.js +25 -0
- package/dist/frontend/chevron-down-CiPtYyFh.js +25 -0
- package/dist/frontend/circle-check-tSPE1V6t.js +29 -0
- package/dist/frontend/clock-DJHbHZb8.js +29 -0
- package/dist/frontend/{bundle-mjs-CP6Owz-8.js → clsx-C7bIvsDS.js} +16 -1
- package/dist/frontend/components/category-dialog.js +1 -1
- package/dist/frontend/components/create-snapshot-dialog.js +1 -1
- package/dist/frontend/components/delete-dialog.js +1 -1
- package/dist/frontend/components/editor/document-editor.js +1364 -1353
- package/dist/frontend/components/editor/document-title.js +25 -25
- package/dist/frontend/components/editor/markdown-toggle.js +45 -45
- package/dist/frontend/components/folder-node.js +1 -1
- package/dist/frontend/components/folder-tree-selector.js +1 -1
- package/dist/frontend/components/save-as-dialog.js +169 -151
- package/dist/frontend/components/settings.js +1 -1
- package/dist/frontend/components/share-dialog.js +1 -1
- package/dist/frontend/components/sidebar.js +1161 -1153
- package/dist/frontend/components/tag-create-dialog.js +1 -1
- package/dist/frontend/components/version-history.js +188 -187
- package/dist/frontend/copy-GppwRMjX.js +32 -0
- package/dist/frontend/dashboard.js +1188 -1156
- package/dist/frontend/dialog-D6NxYVmy.js +213 -0
- package/dist/frontend/doc-tabs.js +2 -2
- package/dist/frontend/ellipsis-vertical-P9MHvCps.js +530 -0
- package/dist/frontend/extension.js +8 -8
- package/dist/frontend/{floating-layer-anchor-C51M4l6v.js → floating-layer-anchor-CPwucTfd.js} +1414 -1412
- package/dist/frontend/folder-DeWhnD7O.js +45 -0
- package/dist/frontend/folder-refresh.js +1 -1
- package/dist/frontend/input-B5Rak-5G.js +23 -0
- package/dist/frontend/keyboard.js +1 -1
- package/dist/frontend/{keyboard.svelte-D7H8DihC.js → keyboard.svelte-CApmX0vl.js} +53 -53
- package/dist/frontend/label-CW9rxoAb.js +30 -0
- package/dist/frontend/{loader-circle-Bk-WFz9g.js → loader-circle-BA6aLO71.js} +86 -85
- package/dist/frontend/rotate-ccw-B4Q7brmV.js +25 -0
- package/dist/frontend/search.js +680 -654
- package/dist/frontend/select-value-sF86Geyh.js +1446 -0
- package/dist/frontend/shared-document.js +94 -94
- package/dist/frontend/subfolders-refresh-store.svelte-B2dKVmgz.js +65 -0
- package/dist/frontend/tag-HxRazVN_.js +54 -0
- package/dist/frontend/tag-store.svelte-CqrUXo0o.js +29 -0
- package/dist/frontend/textarea-i1720bE7.js +23 -0
- package/dist/frontend/theme.js +1 -1
- package/dist/frontend/theme.svelte-DKfCy12k.js +49 -0
- package/dist/frontend/{utils-C0OW2678.js → utils-CffiyuTo.js} +2 -3
- package/dist/frontend/{utils-D8kmM3ub.js → utils-hzdMVeCv.js} +2 -3
- package/dist/frontend/utils.js +1 -1
- package/dist/frontend/x-CzBsnJ2x.js +25 -0
- package/dist/frontend-ssr/api/attachments.js +2 -0
- package/dist/frontend-ssr/api/categories.js +2 -0
- package/dist/frontend-ssr/api/documents.js +2 -0
- package/dist/frontend-ssr/api/folders.js +2 -0
- package/dist/frontend-ssr/api/settings.js +2 -0
- package/dist/frontend-ssr/api/share.js +2 -0
- package/dist/frontend-ssr/api/tags.js +2 -0
- package/dist/frontend-ssr/assets/CategoryDialog-C2xaZKHq.js +584 -0
- package/dist/frontend-ssr/assets/ConfirmDialog-DjMFKc0V.js +420 -0
- package/dist/frontend-ssr/assets/CreateSnapshotDialog-BRw1xJW1.js +214 -0
- package/dist/frontend-ssr/assets/DatePicker-DnXniwlZ.js +312 -0
- package/dist/frontend-ssr/assets/DeleteDialog-BCfZy3Zn.js +154 -0
- package/dist/frontend-ssr/assets/FolderDialog-Dq7I2cKZ.js +429 -0
- package/dist/frontend-ssr/assets/FolderNode-DRfBfpft.js +171 -0
- package/dist/frontend-ssr/assets/FolderTreeSelector-DZNZ2oI6.js +147 -0
- package/dist/frontend-ssr/assets/Icon-B0Zqppjo.js +231 -0
- package/dist/frontend-ssr/assets/SettingsDialog-CX8Noa8A.js +1107 -0
- package/dist/frontend-ssr/assets/ShareDialog-Cge49ZdJ.js +54 -0
- package/dist/frontend-ssr/assets/TagCreateDialog-EAChgBF-.js +264 -0
- package/dist/frontend-ssr/assets/api-keys-DFqX39MT.js +35 -0
- package/dist/frontend-ssr/assets/attachments-CWBxE3Vz.js +85 -0
- package/dist/frontend-ssr/assets/auth-client-x26kqY8Z.js +1286 -0
- package/dist/frontend-ssr/assets/camera-CdxscTw-.js +84 -0
- package/dist/frontend-ssr/assets/categories-AOqgcsn4.js +75 -0
- package/dist/frontend-ssr/assets/chevron-down-CSSNGNh_.js +80 -0
- package/dist/frontend-ssr/assets/chevron-right-B4p7Sk6X.js +80 -0
- package/dist/frontend-ssr/assets/circle-check-CI1v4vYh.js +84 -0
- package/dist/frontend-ssr/assets/client-DZMkDkDn.js +129 -0
- package/dist/frontend-ssr/assets/clipboard-CXOaoz2W.js +30 -0
- package/dist/frontend-ssr/assets/clock-IL-eX2di.js +84 -0
- package/dist/frontend-ssr/assets/context-jz1GGEUi.js +45 -0
- package/dist/frontend-ssr/assets/copy-CjV57nGQ.js +87 -0
- package/dist/frontend-ssr/assets/db-CnxeO66n.js +65 -0
- package/dist/frontend-ssr/assets/dialog-BOV1u6zP.js +157 -0
- package/dist/frontend-ssr/assets/dndzone-DMvTO_Jz.js +2114 -0
- package/dist/frontend-ssr/assets/document-drop-coordinator-CEaYACsC.js +109 -0
- package/dist/frontend-ssr/assets/documents-BnOTRdTY.js +108 -0
- package/dist/frontend-ssr/assets/editorExtensions-DUzwndMy.js +186 -0
- package/dist/frontend-ssr/assets/ellipsis-vertical-C-0hgkZn.js +555 -0
- package/dist/frontend-ssr/assets/floating-layer-anchor-uzw9K8qN.js +6114 -0
- package/dist/frontend-ssr/assets/folder-DChhG7qN.js +80 -0
- package/dist/frontend-ssr/assets/folders-CTfbS24J.js +127 -0
- package/dist/frontend-ssr/assets/identity-B3uHoDtf.js +99 -0
- package/dist/frontend-ssr/assets/input-DezGsU3y.js +19 -0
- package/dist/frontend-ssr/assets/keyboard.svelte-BgF47N3L.js +174 -0
- package/dist/frontend-ssr/assets/label-Bj8-TfFN.js +21 -0
- package/dist/frontend-ssr/assets/loader-circle-DZsrZ-er.js +80 -0
- package/dist/frontend-ssr/assets/markdown-CjqvGi5W.js +20 -0
- package/dist/frontend-ssr/assets/messages-DhXqlcJI.js +11125 -0
- package/dist/frontend-ssr/assets/resolve-BqHozBXl.js +32 -0
- package/dist/frontend-ssr/assets/rotate-ccw-BlgWwaiq.js +80 -0
- package/dist/frontend-ssr/assets/select-value-DngdSmLI.js +1526 -0
- package/dist/frontend-ssr/assets/settings-E6qSAWM2.js +64 -0
- package/dist/frontend-ssr/assets/share-BTBJelxA.js +30 -0
- package/dist/frontend-ssr/assets/subfolders-refresh-store.svelte-DAh4gT16.js +77 -0
- package/dist/frontend-ssr/assets/tag-GZEuGWk1.js +166 -0
- package/dist/frontend-ssr/assets/tag-store.svelte-DPodKj6Z.js +21 -0
- package/dist/frontend-ssr/assets/tags-BId2wdYd.js +49 -0
- package/dist/frontend-ssr/assets/textarea-Dev-qSEc.js +21 -0
- package/dist/frontend-ssr/assets/theme.svelte-Co0-ssaD.js +67 -0
- package/dist/frontend-ssr/assets/utils-DtlPPXpJ.js +9 -0
- package/dist/frontend-ssr/assets/utils-DvZnctjz.js +23 -0
- package/dist/frontend-ssr/collaboration.js +39 -0
- package/dist/frontend-ssr/components/category-dialog.js +2 -0
- package/dist/frontend-ssr/components/create-snapshot-dialog.js +2 -0
- package/dist/frontend-ssr/components/delete-dialog.js +2 -0
- package/dist/frontend-ssr/components/editor/document-editor.js +2499 -0
- package/dist/frontend-ssr/components/editor/document-title.js +11 -0
- package/dist/frontend-ssr/components/editor/docx-serializer.js +186 -0
- package/dist/frontend-ssr/components/editor/extensions.js +2 -0
- package/dist/frontend-ssr/components/editor/markdown-toggle.js +20 -0
- package/dist/frontend-ssr/components/editor/markdown.js +2 -0
- package/dist/frontend-ssr/components/folder-node.js +2 -0
- package/dist/frontend-ssr/components/folder-tree-selector.js +2 -0
- package/dist/frontend-ssr/components/save-as-dialog.js +280 -0
- package/dist/frontend-ssr/components/settings.js +2 -0
- package/dist/frontend-ssr/components/share-dialog.js +2 -0
- package/dist/frontend-ssr/components/sidebar.js +2033 -0
- package/dist/frontend-ssr/components/tag-create-dialog.js +2 -0
- package/dist/frontend-ssr/components/version-history.js +370 -0
- package/dist/frontend-ssr/dashboard.js +2542 -0
- package/dist/frontend-ssr/doc-tabs.js +23 -0
- package/dist/frontend-ssr/document-drop-coordinator.js +2 -0
- package/dist/frontend-ssr/extension.js +13 -0
- package/dist/frontend-ssr/folder-refresh.js +2 -0
- package/dist/frontend-ssr/i18n.js +10 -0
- package/dist/frontend-ssr/keyboard.js +2 -0
- package/dist/frontend-ssr/offline/identity.js +2 -0
- package/dist/frontend-ssr/search.js +332 -0
- package/dist/frontend-ssr/shared-document.js +273 -0
- package/dist/frontend-ssr/theme.js +9 -0
- package/dist/frontend-ssr/types.js +1 -0
- package/dist/frontend-ssr/utils/clipboard.js +2 -0
- package/dist/frontend-ssr/utils/dndzone.js +2 -0
- package/dist/frontend-ssr/utils.js +2 -0
- package/package.json +22 -1
- package/packages/cli/src/index.ts +1 -1
- package/packages/db/src/schema.ts +3 -0
- package/packages/mcp-server/src/index.ts +1 -1
- package/dist/frontend/CategoryDialog--rIE7FrH.js +0 -580
- package/dist/frontend/ConfirmDialog-Cpzyb55f.js +0 -212
- package/dist/frontend/CreateSnapshotDialog-CmkV-n2A.js +0 -216
- package/dist/frontend/DatePicker-Byynca7V.js +0 -257
- package/dist/frontend/DeleteDialog-ap6nOywZ.js +0 -174
- package/dist/frontend/FolderDialog-DmN_trV0.js +0 -247
- package/dist/frontend/FolderNode-C4B8a2fd.js +0 -317
- package/dist/frontend/FolderTreeSelector-D6ijiZTA.js +0 -100
- package/dist/frontend/Icon-DtNo0N1U.js +0 -64
- package/dist/frontend/SettingsDialog-2kTaTXAs.js +0 -992
- package/dist/frontend/ShareDialog-BBDGNF5n.js +0 -165
- package/dist/frontend/TagCreateDialog-DiLZnJo4.js +0 -258
- package/dist/frontend/camera-B7dAOd4s.js +0 -28
- package/dist/frontend/check-CDwRlG9T.js +0 -24
- package/dist/frontend/chevron-down-B7ZrjUmT.js +0 -24
- package/dist/frontend/circle-check-CDqeMB2d.js +0 -28
- package/dist/frontend/client-Bc5Fzx40.js +0 -2785
- package/dist/frontend/clock-Ck5Sn-Zl.js +0 -28
- package/dist/frontend/clsx-nmtDPO_P.js +0 -16
- package/dist/frontend/copy-CMAA6GP0.js +0 -31
- package/dist/frontend/dialog-BDkiG42a.js +0 -213
- package/dist/frontend/disclose-version-5I57E3LD.js +0 -3
- package/dist/frontend/ellipsis-vertical-BBuPldbW.js +0 -519
- package/dist/frontend/folder-TQjKY4yn.js +0 -44
- package/dist/frontend/index-client-jobkrWVL.js +0 -86
- package/dist/frontend/input-CBI6p4Xl.js +0 -23
- package/dist/frontend/label-C-GkhEp4.js +0 -30
- package/dist/frontend/rotate-ccw-CleZtJ5D.js +0 -24
- package/dist/frontend/select-value-CvrWRkXW.js +0 -1436
- package/dist/frontend/subfolders-refresh-store.svelte-BsheoQma.js +0 -65
- package/dist/frontend/tag-Dx3SmucJ.js +0 -53
- package/dist/frontend/tag-store.svelte-CIaF4sdZ.js +0 -29
- package/dist/frontend/textarea-Dfp78XlL.js +0 -23
- package/dist/frontend/theme.svelte-CROg1Hi5.js +0 -49
- package/dist/frontend/x-DaTdeDXv.js +0 -24
|
@@ -0,0 +1,1526 @@
|
|
|
1
|
+
import { t as cn } from "./utils-DtlPPXpJ.js";
|
|
2
|
+
import { $ as boxWith, A as isIOS, C as prev, D as createBitsAttrs, E as boolToTrueOrUndef, G as watch, H as PAGE_UP, J as DOMContext, K as Context, O as getDataOpenClosed, P as ARROW_UP, Q as styleToString, S as next, T as boolToStr, V as PAGE_DOWN, W as Previous, Y as afterTick, Z as mergeProps, _ as boxAutoReset, a as Floating_layer, b as forward, g as DOMTypeahead, h as PresenceManager, i as createId, j as ARROW_DOWN, k as getDataTransitionAttrs, n as Popper_layer_force_mount, o as getFloatingContentCSSVars, q as attachRef, r as Popper_layer, t as Floating_layer_anchor, v as noop, w as boolToEmptyStrOrUndef, x as getNextMatch, y as backward, z as HOME } from "./floating-layer-anchor-uzw9K8qN.js";
|
|
3
|
+
import * as $ from "svelte/internal/server";
|
|
4
|
+
import "svelte";
|
|
5
|
+
import { on } from "svelte/events";
|
|
6
|
+
//#region ../node_modules/.bun/svelte-toolbelt@0.10.6+68f06e2e1fdd21f8/node_modules/svelte-toolbelt/dist/utils/sr-only-styles.js
|
|
7
|
+
var srOnlyStyles = {
|
|
8
|
+
position: "absolute",
|
|
9
|
+
width: "1px",
|
|
10
|
+
height: "1px",
|
|
11
|
+
padding: "0",
|
|
12
|
+
margin: "-1px",
|
|
13
|
+
overflow: "hidden",
|
|
14
|
+
clip: "rect(0, 0, 0, 0)",
|
|
15
|
+
whiteSpace: "nowrap",
|
|
16
|
+
borderWidth: "0",
|
|
17
|
+
transform: "translateX(-100%)"
|
|
18
|
+
};
|
|
19
|
+
styleToString(srOnlyStyles);
|
|
20
|
+
//#endregion
|
|
21
|
+
//#region ../node_modules/.bun/bits-ui@2.18.1+203cd734255b50e4/node_modules/bits-ui/dist/internal/data-typeahead.svelte.js
|
|
22
|
+
var DataTypeahead = class {
|
|
23
|
+
#opts;
|
|
24
|
+
#candidateValues = $.derived(() => this.#opts.candidateValues());
|
|
25
|
+
#search;
|
|
26
|
+
constructor(opts) {
|
|
27
|
+
this.#opts = opts;
|
|
28
|
+
this.#search = boxAutoReset("", {
|
|
29
|
+
afterMs: 1e3,
|
|
30
|
+
getWindow: this.#opts.getWindow
|
|
31
|
+
});
|
|
32
|
+
this.handleTypeaheadSearch = this.handleTypeaheadSearch.bind(this);
|
|
33
|
+
this.resetTypeahead = this.resetTypeahead.bind(this);
|
|
34
|
+
}
|
|
35
|
+
handleTypeaheadSearch(key) {
|
|
36
|
+
if (!this.#opts.enabled() || !this.#candidateValues().length) return;
|
|
37
|
+
this.#search.current = this.#search.current + key;
|
|
38
|
+
const currentItem = this.#opts.getCurrentItem();
|
|
39
|
+
const currentMatch = this.#candidateValues().find((item) => item === currentItem) ?? "";
|
|
40
|
+
const nextMatch = getNextMatch(this.#candidateValues().map((item) => item ?? ""), this.#search.current, currentMatch);
|
|
41
|
+
const newItem = this.#candidateValues().find((item) => item === nextMatch);
|
|
42
|
+
if (newItem) this.#opts.onMatch(newItem);
|
|
43
|
+
return newItem;
|
|
44
|
+
}
|
|
45
|
+
resetTypeahead() {
|
|
46
|
+
this.#search.current = "";
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
var FIRST_KEYS = [
|
|
50
|
+
ARROW_DOWN,
|
|
51
|
+
PAGE_UP,
|
|
52
|
+
HOME
|
|
53
|
+
];
|
|
54
|
+
var LAST_KEYS = [
|
|
55
|
+
ARROW_UP,
|
|
56
|
+
PAGE_DOWN,
|
|
57
|
+
"End"
|
|
58
|
+
];
|
|
59
|
+
var FIRST_LAST_KEYS = [...FIRST_KEYS, ...LAST_KEYS];
|
|
60
|
+
var selectAttrs = createBitsAttrs({
|
|
61
|
+
component: "select",
|
|
62
|
+
parts: [
|
|
63
|
+
"trigger",
|
|
64
|
+
"content",
|
|
65
|
+
"item",
|
|
66
|
+
"viewport",
|
|
67
|
+
"scroll-up-button",
|
|
68
|
+
"scroll-down-button",
|
|
69
|
+
"group",
|
|
70
|
+
"group-label",
|
|
71
|
+
"separator",
|
|
72
|
+
"arrow",
|
|
73
|
+
"input",
|
|
74
|
+
"content-wrapper",
|
|
75
|
+
"item-text",
|
|
76
|
+
"value"
|
|
77
|
+
]
|
|
78
|
+
});
|
|
79
|
+
var SelectRootContext = new Context("Select.Root | Combobox.Root");
|
|
80
|
+
new Context("Select.Group | Combobox.Group");
|
|
81
|
+
var SelectContentContext = new Context("Select.Content | Combobox.Content");
|
|
82
|
+
var SelectBaseRootState = class {
|
|
83
|
+
opts;
|
|
84
|
+
touchedInput = false;
|
|
85
|
+
inputNode = null;
|
|
86
|
+
contentNode = null;
|
|
87
|
+
contentPresence;
|
|
88
|
+
viewportNode = null;
|
|
89
|
+
triggerNode = null;
|
|
90
|
+
valueNode = null;
|
|
91
|
+
valueId = "";
|
|
92
|
+
highlightedNode = null;
|
|
93
|
+
#highlightedValue = $.derived(() => {
|
|
94
|
+
if (!this.highlightedNode) return null;
|
|
95
|
+
return this.highlightedNode.getAttribute("data-value");
|
|
96
|
+
});
|
|
97
|
+
get highlightedValue() {
|
|
98
|
+
return this.#highlightedValue();
|
|
99
|
+
}
|
|
100
|
+
set highlightedValue($$value) {
|
|
101
|
+
return this.#highlightedValue($$value);
|
|
102
|
+
}
|
|
103
|
+
#highlightedId = $.derived(() => {
|
|
104
|
+
if (!this.highlightedNode) return void 0;
|
|
105
|
+
return this.highlightedNode.id;
|
|
106
|
+
});
|
|
107
|
+
get highlightedId() {
|
|
108
|
+
return this.#highlightedId();
|
|
109
|
+
}
|
|
110
|
+
set highlightedId($$value) {
|
|
111
|
+
return this.#highlightedId($$value);
|
|
112
|
+
}
|
|
113
|
+
#highlightedLabel = $.derived(() => {
|
|
114
|
+
if (!this.highlightedNode) return null;
|
|
115
|
+
return this.highlightedNode.getAttribute("data-label");
|
|
116
|
+
});
|
|
117
|
+
get highlightedLabel() {
|
|
118
|
+
return this.#highlightedLabel();
|
|
119
|
+
}
|
|
120
|
+
set highlightedLabel($$value) {
|
|
121
|
+
return this.#highlightedLabel($$value);
|
|
122
|
+
}
|
|
123
|
+
contentIsPositioned = false;
|
|
124
|
+
isUsingKeyboard = false;
|
|
125
|
+
isCombobox = false;
|
|
126
|
+
domContext = new DOMContext(() => null);
|
|
127
|
+
constructor(opts) {
|
|
128
|
+
this.opts = opts;
|
|
129
|
+
this.isCombobox = opts.isCombobox;
|
|
130
|
+
this.contentPresence = new PresenceManager({
|
|
131
|
+
ref: boxWith(() => this.contentNode),
|
|
132
|
+
open: this.opts.open,
|
|
133
|
+
onComplete: () => {
|
|
134
|
+
this.opts.onOpenChangeComplete.current(this.opts.open.current);
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
setHighlightedNode(node, initial = false) {
|
|
139
|
+
this.highlightedNode = node;
|
|
140
|
+
if (node && (this.isUsingKeyboard || initial)) this.scrollHighlightedNodeIntoView(node);
|
|
141
|
+
}
|
|
142
|
+
scrollHighlightedNodeIntoView(node) {
|
|
143
|
+
if (!this.viewportNode || !this.contentIsPositioned) return;
|
|
144
|
+
node.scrollIntoView({ block: this.opts.scrollAlignment.current });
|
|
145
|
+
}
|
|
146
|
+
getCandidateNodes() {
|
|
147
|
+
const node = this.contentNode;
|
|
148
|
+
if (!node) return [];
|
|
149
|
+
return Array.from(node.querySelectorAll(`[${this.getBitsAttr("item")}]:not([data-disabled])`));
|
|
150
|
+
}
|
|
151
|
+
setHighlightedToFirstCandidate(initial = false) {
|
|
152
|
+
this.setHighlightedNode(null);
|
|
153
|
+
let nodes = this.getCandidateNodes();
|
|
154
|
+
if (!nodes.length) return;
|
|
155
|
+
if (this.viewportNode) {
|
|
156
|
+
const viewportRect = this.viewportNode.getBoundingClientRect();
|
|
157
|
+
nodes = nodes.filter((node) => {
|
|
158
|
+
if (!this.viewportNode) return false;
|
|
159
|
+
const nodeRect = node.getBoundingClientRect();
|
|
160
|
+
return nodeRect.right <= viewportRect.right && nodeRect.left >= viewportRect.left && nodeRect.bottom <= viewportRect.bottom && nodeRect.top >= viewportRect.top;
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
this.setHighlightedNode(nodes[0], initial);
|
|
164
|
+
}
|
|
165
|
+
getNodeByValue(value) {
|
|
166
|
+
return this.getCandidateNodes().find((node) => node.dataset.value === value) ?? null;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Resolves the display label for a value: `items` entry when present, otherwise the
|
|
170
|
+
* mounted item's `data-label` or its text content.
|
|
171
|
+
*/
|
|
172
|
+
getLabelForValue(value) {
|
|
173
|
+
if (value === "") return "";
|
|
174
|
+
const fromItems = this.opts.items.current.find((item) => item.value === value)?.label;
|
|
175
|
+
if (fromItems !== void 0) return fromItems;
|
|
176
|
+
const node = this.getNodeByValue(value);
|
|
177
|
+
if (node) {
|
|
178
|
+
const dataLabel = node.getAttribute("data-label");
|
|
179
|
+
if (dataLabel !== null && dataLabel !== "") return dataLabel;
|
|
180
|
+
return node.textContent?.trim() ?? value;
|
|
181
|
+
}
|
|
182
|
+
return value;
|
|
183
|
+
}
|
|
184
|
+
setOpen(open) {
|
|
185
|
+
this.opts.open.current = open;
|
|
186
|
+
}
|
|
187
|
+
toggleOpen() {
|
|
188
|
+
this.opts.open.current = !this.opts.open.current;
|
|
189
|
+
}
|
|
190
|
+
handleOpen() {
|
|
191
|
+
this.setOpen(true);
|
|
192
|
+
}
|
|
193
|
+
handleClose() {
|
|
194
|
+
this.setHighlightedNode(null);
|
|
195
|
+
this.setOpen(false);
|
|
196
|
+
}
|
|
197
|
+
toggleMenu() {
|
|
198
|
+
this.toggleOpen();
|
|
199
|
+
}
|
|
200
|
+
getBitsAttr = (part) => {
|
|
201
|
+
return selectAttrs.getAttr(part, this.isCombobox ? "combobox" : void 0);
|
|
202
|
+
};
|
|
203
|
+
};
|
|
204
|
+
var SelectSingleRootState = class extends SelectBaseRootState {
|
|
205
|
+
opts;
|
|
206
|
+
isMulti = false;
|
|
207
|
+
#hasValue = $.derived(() => this.opts.value.current !== "");
|
|
208
|
+
get hasValue() {
|
|
209
|
+
return this.#hasValue();
|
|
210
|
+
}
|
|
211
|
+
set hasValue($$value) {
|
|
212
|
+
return this.#hasValue($$value);
|
|
213
|
+
}
|
|
214
|
+
#currentLabel = $.derived(() => {
|
|
215
|
+
if (!this.opts.items.current.length) return "";
|
|
216
|
+
return this.opts.items.current.find((item) => item.value === this.opts.value.current)?.label ?? "";
|
|
217
|
+
});
|
|
218
|
+
get currentLabel() {
|
|
219
|
+
return this.#currentLabel();
|
|
220
|
+
}
|
|
221
|
+
set currentLabel($$value) {
|
|
222
|
+
return this.#currentLabel($$value);
|
|
223
|
+
}
|
|
224
|
+
#candidateLabels = $.derived(() => {
|
|
225
|
+
if (!this.opts.items.current.length) return [];
|
|
226
|
+
return this.opts.items.current.filter((item) => !item.disabled).map((item) => item.label);
|
|
227
|
+
});
|
|
228
|
+
get candidateLabels() {
|
|
229
|
+
return this.#candidateLabels();
|
|
230
|
+
}
|
|
231
|
+
set candidateLabels($$value) {
|
|
232
|
+
return this.#candidateLabels($$value);
|
|
233
|
+
}
|
|
234
|
+
#dataTypeaheadEnabled = $.derived(() => {
|
|
235
|
+
if (this.isMulti) return false;
|
|
236
|
+
if (this.opts.items.current.length === 0) return false;
|
|
237
|
+
return true;
|
|
238
|
+
});
|
|
239
|
+
get dataTypeaheadEnabled() {
|
|
240
|
+
return this.#dataTypeaheadEnabled();
|
|
241
|
+
}
|
|
242
|
+
set dataTypeaheadEnabled($$value) {
|
|
243
|
+
return this.#dataTypeaheadEnabled($$value);
|
|
244
|
+
}
|
|
245
|
+
constructor(opts) {
|
|
246
|
+
super(opts);
|
|
247
|
+
this.opts = opts;
|
|
248
|
+
watch(() => this.opts.open.current, () => {
|
|
249
|
+
if (!this.opts.open.current) return;
|
|
250
|
+
this.setInitialHighlightedNode();
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
includesItem(itemValue) {
|
|
254
|
+
return this.opts.value.current === itemValue;
|
|
255
|
+
}
|
|
256
|
+
toggleItem(itemValue, itemLabel = itemValue) {
|
|
257
|
+
const newValue = this.includesItem(itemValue) ? "" : itemValue;
|
|
258
|
+
this.opts.value.current = newValue;
|
|
259
|
+
if (newValue !== "") this.opts.inputValue.current = itemLabel;
|
|
260
|
+
}
|
|
261
|
+
setInitialHighlightedNode() {
|
|
262
|
+
afterTick(() => {
|
|
263
|
+
if (this.highlightedNode && this.domContext.getDocument().contains(this.highlightedNode)) return;
|
|
264
|
+
if (this.opts.value.current !== "") {
|
|
265
|
+
const node = this.getNodeByValue(this.opts.value.current);
|
|
266
|
+
if (node) {
|
|
267
|
+
this.setHighlightedNode(node, true);
|
|
268
|
+
return;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
this.setHighlightedToFirstCandidate(true);
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
};
|
|
275
|
+
var SelectMultipleRootState = class extends SelectBaseRootState {
|
|
276
|
+
opts;
|
|
277
|
+
isMulti = true;
|
|
278
|
+
#hasValue = $.derived(() => this.opts.value.current.length > 0);
|
|
279
|
+
get hasValue() {
|
|
280
|
+
return this.#hasValue();
|
|
281
|
+
}
|
|
282
|
+
set hasValue($$value) {
|
|
283
|
+
return this.#hasValue($$value);
|
|
284
|
+
}
|
|
285
|
+
constructor(opts) {
|
|
286
|
+
super(opts);
|
|
287
|
+
this.opts = opts;
|
|
288
|
+
watch(() => this.opts.open.current, () => {
|
|
289
|
+
if (!this.opts.open.current) return;
|
|
290
|
+
this.setInitialHighlightedNode();
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
includesItem(itemValue) {
|
|
294
|
+
return this.opts.value.current.includes(itemValue);
|
|
295
|
+
}
|
|
296
|
+
toggleItem(itemValue, itemLabel = itemValue) {
|
|
297
|
+
if (this.includesItem(itemValue)) this.opts.value.current = this.opts.value.current.filter((v) => v !== itemValue);
|
|
298
|
+
else this.opts.value.current = [...this.opts.value.current, itemValue];
|
|
299
|
+
this.opts.inputValue.current = itemLabel;
|
|
300
|
+
}
|
|
301
|
+
setInitialHighlightedNode() {
|
|
302
|
+
afterTick(() => {
|
|
303
|
+
if (!this.domContext) return;
|
|
304
|
+
if (this.highlightedNode && this.domContext.getDocument().contains(this.highlightedNode)) return;
|
|
305
|
+
if (this.opts.value.current.length && this.opts.value.current[0] !== "") {
|
|
306
|
+
const node = this.getNodeByValue(this.opts.value.current[0]);
|
|
307
|
+
if (node) {
|
|
308
|
+
this.setHighlightedNode(node, true);
|
|
309
|
+
return;
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
this.setHighlightedToFirstCandidate(true);
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
};
|
|
316
|
+
var SelectRootState = class {
|
|
317
|
+
static create(props) {
|
|
318
|
+
const { type, ...rest } = props;
|
|
319
|
+
const rootState = type === "single" ? new SelectSingleRootState(rest) : new SelectMultipleRootState(rest);
|
|
320
|
+
return SelectRootContext.set(rootState);
|
|
321
|
+
}
|
|
322
|
+
};
|
|
323
|
+
var SelectValueState = class SelectValueState {
|
|
324
|
+
static create(opts) {
|
|
325
|
+
return new SelectValueState(opts, SelectRootContext.get());
|
|
326
|
+
}
|
|
327
|
+
root;
|
|
328
|
+
opts;
|
|
329
|
+
attachment;
|
|
330
|
+
constructor(opts, root) {
|
|
331
|
+
this.root = root;
|
|
332
|
+
this.opts = opts;
|
|
333
|
+
this.attachment = attachRef(opts.ref, (v) => this.root.valueNode = v);
|
|
334
|
+
this.setValue = this.setValue.bind(this);
|
|
335
|
+
}
|
|
336
|
+
setValue(value) {
|
|
337
|
+
if (this.root.isMulti && !Array.isArray(value)) return;
|
|
338
|
+
if (!this.root.isMulti && typeof value !== "string") return;
|
|
339
|
+
this.root.opts.value.current = value;
|
|
340
|
+
}
|
|
341
|
+
#snippetProps = $.derived(() => {
|
|
342
|
+
if (this.root.isMulti) return {
|
|
343
|
+
selection: {
|
|
344
|
+
type: "multiple",
|
|
345
|
+
selected: this.root.opts.value.current.length > 0 ? this.root.opts.value.current.map((value) => ({
|
|
346
|
+
value,
|
|
347
|
+
label: this.root.getLabelForValue(value)
|
|
348
|
+
})) : [],
|
|
349
|
+
setValue: this.setValue
|
|
350
|
+
},
|
|
351
|
+
placeholder: this.opts.placeholder.current ?? null,
|
|
352
|
+
disabled: this.root.opts.disabled.current
|
|
353
|
+
};
|
|
354
|
+
const value = this.root.opts.value.current;
|
|
355
|
+
return {
|
|
356
|
+
selection: {
|
|
357
|
+
type: "single",
|
|
358
|
+
selected: value !== "" ? {
|
|
359
|
+
value,
|
|
360
|
+
label: value === "" ? "" : this.root.getLabelForValue(value)
|
|
361
|
+
} : void 0,
|
|
362
|
+
setValue: this.setValue
|
|
363
|
+
},
|
|
364
|
+
placeholder: this.opts.placeholder.current ?? null,
|
|
365
|
+
disabled: this.root.opts.disabled.current
|
|
366
|
+
};
|
|
367
|
+
});
|
|
368
|
+
get snippetProps() {
|
|
369
|
+
return this.#snippetProps();
|
|
370
|
+
}
|
|
371
|
+
set snippetProps($$value) {
|
|
372
|
+
return this.#snippetProps($$value);
|
|
373
|
+
}
|
|
374
|
+
#props = $.derived(() => ({
|
|
375
|
+
id: this.opts.id.current,
|
|
376
|
+
"data-placeholder": this.root.hasValue ? void 0 : "",
|
|
377
|
+
"data-select-value": "",
|
|
378
|
+
...this.attachment
|
|
379
|
+
}));
|
|
380
|
+
get props() {
|
|
381
|
+
return this.#props();
|
|
382
|
+
}
|
|
383
|
+
set props($$value) {
|
|
384
|
+
return this.#props($$value);
|
|
385
|
+
}
|
|
386
|
+
};
|
|
387
|
+
var SelectTriggerState = class SelectTriggerState {
|
|
388
|
+
static create(opts) {
|
|
389
|
+
return new SelectTriggerState(opts, SelectRootContext.get());
|
|
390
|
+
}
|
|
391
|
+
opts;
|
|
392
|
+
root;
|
|
393
|
+
attachment;
|
|
394
|
+
#domTypeahead;
|
|
395
|
+
#dataTypeahead;
|
|
396
|
+
constructor(opts, root) {
|
|
397
|
+
this.opts = opts;
|
|
398
|
+
this.root = root;
|
|
399
|
+
this.attachment = attachRef(opts.ref, (v) => this.root.triggerNode = v);
|
|
400
|
+
this.root.domContext = new DOMContext(opts.ref);
|
|
401
|
+
this.#domTypeahead = new DOMTypeahead({
|
|
402
|
+
getCurrentItem: () => this.root.highlightedNode,
|
|
403
|
+
onMatch: (node) => {
|
|
404
|
+
this.root.setHighlightedNode(node);
|
|
405
|
+
},
|
|
406
|
+
getActiveElement: () => this.root.domContext.getActiveElement(),
|
|
407
|
+
getWindow: () => this.root.domContext.getWindow()
|
|
408
|
+
});
|
|
409
|
+
this.#dataTypeahead = new DataTypeahead({
|
|
410
|
+
getCurrentItem: () => {
|
|
411
|
+
if (this.root.isMulti) return "";
|
|
412
|
+
return this.root.currentLabel;
|
|
413
|
+
},
|
|
414
|
+
onMatch: (label) => {
|
|
415
|
+
if (this.root.isMulti) return;
|
|
416
|
+
if (!this.root.opts.items.current) return;
|
|
417
|
+
const matchedItem = this.root.opts.items.current.find((item) => item.label === label);
|
|
418
|
+
if (!matchedItem) return;
|
|
419
|
+
this.root.opts.value.current = matchedItem.value;
|
|
420
|
+
},
|
|
421
|
+
enabled: () => !this.root.isMulti && this.root.dataTypeaheadEnabled,
|
|
422
|
+
candidateValues: () => this.root.isMulti ? [] : this.root.candidateLabels,
|
|
423
|
+
getWindow: () => this.root.domContext.getWindow()
|
|
424
|
+
});
|
|
425
|
+
this.onkeydown = this.onkeydown.bind(this);
|
|
426
|
+
this.onpointerdown = this.onpointerdown.bind(this);
|
|
427
|
+
this.onpointerup = this.onpointerup.bind(this);
|
|
428
|
+
this.onclick = this.onclick.bind(this);
|
|
429
|
+
}
|
|
430
|
+
#handleOpen() {
|
|
431
|
+
this.root.opts.open.current = true;
|
|
432
|
+
this.#dataTypeahead.resetTypeahead();
|
|
433
|
+
this.#domTypeahead.resetTypeahead();
|
|
434
|
+
}
|
|
435
|
+
#handlePointerOpen(_) {
|
|
436
|
+
this.#handleOpen();
|
|
437
|
+
}
|
|
438
|
+
/**
|
|
439
|
+
* Logic used to handle keyboard selection/deselection.
|
|
440
|
+
*
|
|
441
|
+
* If it returns true, it means the item was selected and whatever is calling
|
|
442
|
+
* this function should return early
|
|
443
|
+
*
|
|
444
|
+
*/
|
|
445
|
+
#handleKeyboardSelection() {
|
|
446
|
+
const isCurrentSelectedValue = this.root.highlightedValue === this.root.opts.value.current;
|
|
447
|
+
if (!this.root.opts.allowDeselect.current && isCurrentSelectedValue && !this.root.isMulti) {
|
|
448
|
+
this.root.handleClose();
|
|
449
|
+
return true;
|
|
450
|
+
}
|
|
451
|
+
if (this.root.highlightedValue !== null) this.root.toggleItem(this.root.highlightedValue, this.root.highlightedLabel ?? void 0);
|
|
452
|
+
if (!this.root.isMulti && !isCurrentSelectedValue) {
|
|
453
|
+
this.root.handleClose();
|
|
454
|
+
return true;
|
|
455
|
+
}
|
|
456
|
+
return false;
|
|
457
|
+
}
|
|
458
|
+
onkeydown(e) {
|
|
459
|
+
this.root.isUsingKeyboard = true;
|
|
460
|
+
if (e.key === "ArrowUp" || e.key === "ArrowDown") e.preventDefault();
|
|
461
|
+
if (!this.root.opts.open.current) {
|
|
462
|
+
if (e.key === "Enter" || e.key === " " || e.key === "ArrowDown" || e.key === "ArrowUp") {
|
|
463
|
+
e.preventDefault();
|
|
464
|
+
this.root.handleOpen();
|
|
465
|
+
} else if (!this.root.isMulti && this.root.dataTypeaheadEnabled) {
|
|
466
|
+
this.#dataTypeahead.handleTypeaheadSearch(e.key);
|
|
467
|
+
return;
|
|
468
|
+
}
|
|
469
|
+
if (this.root.hasValue) return;
|
|
470
|
+
const candidateNodes = this.root.getCandidateNodes();
|
|
471
|
+
if (!candidateNodes.length) return;
|
|
472
|
+
if (e.key === "ArrowDown") {
|
|
473
|
+
const firstCandidate = candidateNodes[0];
|
|
474
|
+
this.root.setHighlightedNode(firstCandidate);
|
|
475
|
+
} else if (e.key === "ArrowUp") {
|
|
476
|
+
const lastCandidate = candidateNodes[candidateNodes.length - 1];
|
|
477
|
+
this.root.setHighlightedNode(lastCandidate);
|
|
478
|
+
}
|
|
479
|
+
return;
|
|
480
|
+
}
|
|
481
|
+
if (e.key === "Tab") {
|
|
482
|
+
this.root.handleClose();
|
|
483
|
+
return;
|
|
484
|
+
}
|
|
485
|
+
if ((e.key === "Enter" || e.key === " " && this.#domTypeahead.search === "") && !e.isComposing) {
|
|
486
|
+
e.preventDefault();
|
|
487
|
+
if (this.#handleKeyboardSelection()) return;
|
|
488
|
+
}
|
|
489
|
+
if (e.key === "ArrowUp" && e.altKey) this.root.handleClose();
|
|
490
|
+
if (FIRST_LAST_KEYS.includes(e.key)) {
|
|
491
|
+
e.preventDefault();
|
|
492
|
+
const candidateNodes = this.root.getCandidateNodes();
|
|
493
|
+
const currHighlightedNode = this.root.highlightedNode;
|
|
494
|
+
const currIndex = currHighlightedNode ? candidateNodes.indexOf(currHighlightedNode) : -1;
|
|
495
|
+
const loop = this.root.opts.loop.current;
|
|
496
|
+
let nextItem;
|
|
497
|
+
if (e.key === "ArrowDown") nextItem = next(candidateNodes, currIndex, loop);
|
|
498
|
+
else if (e.key === "ArrowUp") nextItem = prev(candidateNodes, currIndex, loop);
|
|
499
|
+
else if (e.key === "PageDown") nextItem = forward(candidateNodes, currIndex, 10, loop);
|
|
500
|
+
else if (e.key === "PageUp") nextItem = backward(candidateNodes, currIndex, 10, loop);
|
|
501
|
+
else if (e.key === "Home") nextItem = candidateNodes[0];
|
|
502
|
+
else if (e.key === "End") nextItem = candidateNodes[candidateNodes.length - 1];
|
|
503
|
+
if (!nextItem) return;
|
|
504
|
+
this.root.setHighlightedNode(nextItem);
|
|
505
|
+
return;
|
|
506
|
+
}
|
|
507
|
+
const isModifierKey = e.ctrlKey || e.altKey || e.metaKey;
|
|
508
|
+
const isCharacterKey = e.key.length === 1;
|
|
509
|
+
const isSpaceKey = e.key === " ";
|
|
510
|
+
const candidateNodes = this.root.getCandidateNodes();
|
|
511
|
+
if (e.key === "Tab") return;
|
|
512
|
+
if (!isModifierKey && (isCharacterKey || isSpaceKey)) {
|
|
513
|
+
if (!this.#domTypeahead.handleTypeaheadSearch(e.key, candidateNodes) && isSpaceKey) {
|
|
514
|
+
e.preventDefault();
|
|
515
|
+
this.#handleKeyboardSelection();
|
|
516
|
+
}
|
|
517
|
+
return;
|
|
518
|
+
}
|
|
519
|
+
if (!this.root.highlightedNode) this.root.setHighlightedToFirstCandidate();
|
|
520
|
+
}
|
|
521
|
+
onclick(e) {
|
|
522
|
+
e.currentTarget.focus();
|
|
523
|
+
}
|
|
524
|
+
onpointerdown(e) {
|
|
525
|
+
if (this.root.opts.disabled.current) return;
|
|
526
|
+
if (e.pointerType === "touch") return e.preventDefault();
|
|
527
|
+
const target = e.target;
|
|
528
|
+
if (target?.hasPointerCapture(e.pointerId)) target?.releasePointerCapture(e.pointerId);
|
|
529
|
+
if (e.button === 0 && e.ctrlKey === false) if (this.root.opts.open.current === false) this.#handlePointerOpen(e);
|
|
530
|
+
else this.root.handleClose();
|
|
531
|
+
}
|
|
532
|
+
onpointerup(e) {
|
|
533
|
+
if (this.root.opts.disabled.current) return;
|
|
534
|
+
e.preventDefault();
|
|
535
|
+
if (e.pointerType === "touch") if (this.root.opts.open.current === false) this.#handlePointerOpen(e);
|
|
536
|
+
else this.root.handleClose();
|
|
537
|
+
}
|
|
538
|
+
#props = $.derived(() => ({
|
|
539
|
+
id: this.opts.id.current,
|
|
540
|
+
disabled: this.root.opts.disabled.current ? true : void 0,
|
|
541
|
+
"aria-haspopup": "listbox",
|
|
542
|
+
"aria-expanded": boolToStr(this.root.opts.open.current),
|
|
543
|
+
"aria-activedescendant": this.root.highlightedId,
|
|
544
|
+
"data-state": getDataOpenClosed(this.root.opts.open.current),
|
|
545
|
+
"data-disabled": boolToEmptyStrOrUndef(this.root.opts.disabled.current),
|
|
546
|
+
"data-placeholder": this.root.hasValue ? void 0 : "",
|
|
547
|
+
[this.root.getBitsAttr("trigger")]: "",
|
|
548
|
+
onpointerdown: this.onpointerdown,
|
|
549
|
+
onkeydown: this.onkeydown,
|
|
550
|
+
onclick: this.onclick,
|
|
551
|
+
onpointerup: this.onpointerup,
|
|
552
|
+
...this.attachment
|
|
553
|
+
}));
|
|
554
|
+
get props() {
|
|
555
|
+
return this.#props();
|
|
556
|
+
}
|
|
557
|
+
set props($$value) {
|
|
558
|
+
return this.#props($$value);
|
|
559
|
+
}
|
|
560
|
+
};
|
|
561
|
+
var SelectContentState = class SelectContentState {
|
|
562
|
+
static create(opts) {
|
|
563
|
+
return SelectContentContext.set(new SelectContentState(opts, SelectRootContext.get()));
|
|
564
|
+
}
|
|
565
|
+
opts;
|
|
566
|
+
root;
|
|
567
|
+
attachment;
|
|
568
|
+
isPositioned = false;
|
|
569
|
+
domContext;
|
|
570
|
+
constructor(opts, root) {
|
|
571
|
+
this.opts = opts;
|
|
572
|
+
this.root = root;
|
|
573
|
+
this.attachment = attachRef(opts.ref, (v) => this.root.contentNode = v);
|
|
574
|
+
this.domContext = new DOMContext(this.opts.ref);
|
|
575
|
+
if (this.root.domContext === null) this.root.domContext = this.domContext;
|
|
576
|
+
watch(() => this.root.opts.open.current, () => {
|
|
577
|
+
if (this.root.opts.open.current) return;
|
|
578
|
+
this.root.contentIsPositioned = false;
|
|
579
|
+
this.isPositioned = false;
|
|
580
|
+
});
|
|
581
|
+
watch([() => this.isPositioned, () => this.root.highlightedNode], () => {
|
|
582
|
+
if (!this.isPositioned || !this.root.highlightedNode) return;
|
|
583
|
+
this.root.scrollHighlightedNodeIntoView(this.root.highlightedNode);
|
|
584
|
+
});
|
|
585
|
+
this.onpointermove = this.onpointermove.bind(this);
|
|
586
|
+
}
|
|
587
|
+
onpointermove(_) {
|
|
588
|
+
this.root.isUsingKeyboard = false;
|
|
589
|
+
}
|
|
590
|
+
#styles = $.derived(() => {
|
|
591
|
+
return getFloatingContentCSSVars(this.root.isCombobox ? "combobox" : "select");
|
|
592
|
+
});
|
|
593
|
+
onInteractOutside = (e) => {
|
|
594
|
+
if (e.target === this.root.triggerNode || e.target === this.root.inputNode) {
|
|
595
|
+
e.preventDefault();
|
|
596
|
+
return;
|
|
597
|
+
}
|
|
598
|
+
this.opts.onInteractOutside.current(e);
|
|
599
|
+
if (e.defaultPrevented) return;
|
|
600
|
+
this.root.handleClose();
|
|
601
|
+
};
|
|
602
|
+
onEscapeKeydown = (e) => {
|
|
603
|
+
this.opts.onEscapeKeydown.current(e);
|
|
604
|
+
if (e.defaultPrevented) return;
|
|
605
|
+
this.root.handleClose();
|
|
606
|
+
};
|
|
607
|
+
onOpenAutoFocus = (e) => {
|
|
608
|
+
e.preventDefault();
|
|
609
|
+
};
|
|
610
|
+
onCloseAutoFocus = (e) => {
|
|
611
|
+
e.preventDefault();
|
|
612
|
+
};
|
|
613
|
+
get shouldRender() {
|
|
614
|
+
return this.root.contentPresence.shouldRender;
|
|
615
|
+
}
|
|
616
|
+
#snippetProps = $.derived(() => ({ open: this.root.opts.open.current }));
|
|
617
|
+
get snippetProps() {
|
|
618
|
+
return this.#snippetProps();
|
|
619
|
+
}
|
|
620
|
+
set snippetProps($$value) {
|
|
621
|
+
return this.#snippetProps($$value);
|
|
622
|
+
}
|
|
623
|
+
#props = $.derived(() => ({
|
|
624
|
+
id: this.opts.id.current,
|
|
625
|
+
role: "listbox",
|
|
626
|
+
"aria-multiselectable": this.root.isMulti ? "true" : void 0,
|
|
627
|
+
"data-state": getDataOpenClosed(this.root.opts.open.current),
|
|
628
|
+
...getDataTransitionAttrs(this.root.contentPresence.transitionStatus),
|
|
629
|
+
[this.root.getBitsAttr("content")]: "",
|
|
630
|
+
style: {
|
|
631
|
+
display: "flex",
|
|
632
|
+
flexDirection: "column",
|
|
633
|
+
outline: "none",
|
|
634
|
+
boxSizing: "border-box",
|
|
635
|
+
pointerEvents: "auto",
|
|
636
|
+
...this.#styles()
|
|
637
|
+
},
|
|
638
|
+
onpointermove: this.onpointermove,
|
|
639
|
+
...this.attachment
|
|
640
|
+
}));
|
|
641
|
+
get props() {
|
|
642
|
+
return this.#props();
|
|
643
|
+
}
|
|
644
|
+
set props($$value) {
|
|
645
|
+
return this.#props($$value);
|
|
646
|
+
}
|
|
647
|
+
popperProps = {
|
|
648
|
+
onInteractOutside: this.onInteractOutside,
|
|
649
|
+
onEscapeKeydown: this.onEscapeKeydown,
|
|
650
|
+
onOpenAutoFocus: this.onOpenAutoFocus,
|
|
651
|
+
onCloseAutoFocus: this.onCloseAutoFocus,
|
|
652
|
+
trapFocus: false,
|
|
653
|
+
loop: false,
|
|
654
|
+
onPlaced: () => {
|
|
655
|
+
if (this.root.opts.open.current) {
|
|
656
|
+
this.root.contentIsPositioned = true;
|
|
657
|
+
this.isPositioned = true;
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
};
|
|
661
|
+
};
|
|
662
|
+
var SelectItemState = class SelectItemState {
|
|
663
|
+
static create(opts) {
|
|
664
|
+
return new SelectItemState(opts, SelectRootContext.get());
|
|
665
|
+
}
|
|
666
|
+
opts;
|
|
667
|
+
root;
|
|
668
|
+
attachment;
|
|
669
|
+
#isSelected = $.derived(() => this.root.includesItem(this.opts.value.current));
|
|
670
|
+
get isSelected() {
|
|
671
|
+
return this.#isSelected();
|
|
672
|
+
}
|
|
673
|
+
set isSelected($$value) {
|
|
674
|
+
return this.#isSelected($$value);
|
|
675
|
+
}
|
|
676
|
+
#isHighlighted = $.derived(() => this.root.highlightedValue === this.opts.value.current);
|
|
677
|
+
get isHighlighted() {
|
|
678
|
+
return this.#isHighlighted();
|
|
679
|
+
}
|
|
680
|
+
set isHighlighted($$value) {
|
|
681
|
+
return this.#isHighlighted($$value);
|
|
682
|
+
}
|
|
683
|
+
prevHighlighted = new Previous(() => this.isHighlighted);
|
|
684
|
+
mounted = false;
|
|
685
|
+
constructor(opts, root) {
|
|
686
|
+
this.opts = opts;
|
|
687
|
+
this.root = root;
|
|
688
|
+
this.attachment = attachRef(opts.ref);
|
|
689
|
+
watch([() => this.isHighlighted, () => this.prevHighlighted.current], () => {
|
|
690
|
+
if (this.isHighlighted) this.opts.onHighlight.current();
|
|
691
|
+
else if (this.prevHighlighted.current) this.opts.onUnhighlight.current();
|
|
692
|
+
});
|
|
693
|
+
watch(() => this.mounted, () => {
|
|
694
|
+
if (!this.mounted) return;
|
|
695
|
+
this.root.setInitialHighlightedNode();
|
|
696
|
+
});
|
|
697
|
+
this.onpointerdown = this.onpointerdown.bind(this);
|
|
698
|
+
this.onpointerup = this.onpointerup.bind(this);
|
|
699
|
+
this.onpointermove = this.onpointermove.bind(this);
|
|
700
|
+
}
|
|
701
|
+
handleSelect() {
|
|
702
|
+
if (this.opts.disabled.current) return;
|
|
703
|
+
const isCurrentSelectedValue = this.opts.value.current === this.root.opts.value.current;
|
|
704
|
+
if (!this.root.opts.allowDeselect.current && isCurrentSelectedValue && !this.root.isMulti) {
|
|
705
|
+
this.root.handleClose();
|
|
706
|
+
return;
|
|
707
|
+
}
|
|
708
|
+
this.root.toggleItem(this.opts.value.current, this.opts.label.current);
|
|
709
|
+
if (!this.root.isMulti && !isCurrentSelectedValue) this.root.handleClose();
|
|
710
|
+
}
|
|
711
|
+
#snippetProps = $.derived(() => ({
|
|
712
|
+
selected: this.isSelected,
|
|
713
|
+
highlighted: this.isHighlighted
|
|
714
|
+
}));
|
|
715
|
+
get snippetProps() {
|
|
716
|
+
return this.#snippetProps();
|
|
717
|
+
}
|
|
718
|
+
set snippetProps($$value) {
|
|
719
|
+
return this.#snippetProps($$value);
|
|
720
|
+
}
|
|
721
|
+
onpointerdown(e) {
|
|
722
|
+
e.preventDefault();
|
|
723
|
+
}
|
|
724
|
+
/**
|
|
725
|
+
* Using `pointerup` instead of `click` allows power users to pointerdown
|
|
726
|
+
* the trigger, then release pointerup on an item to select it vs having to do
|
|
727
|
+
* multiple clicks.
|
|
728
|
+
*/
|
|
729
|
+
onpointerup(e) {
|
|
730
|
+
if (e.defaultPrevented || !this.opts.ref.current) return;
|
|
731
|
+
/**
|
|
732
|
+
* For one reason or another, when it's a touch pointer and _not_ on IOS,
|
|
733
|
+
* we need to listen for the immediate click event to handle the selection,
|
|
734
|
+
* otherwise a click event will fire on the element _behind_ the item.
|
|
735
|
+
*/
|
|
736
|
+
if (e.pointerType === "touch" && !isIOS) {
|
|
737
|
+
on(this.opts.ref.current, "click", () => {
|
|
738
|
+
this.handleSelect();
|
|
739
|
+
this.root.setHighlightedNode(this.opts.ref.current);
|
|
740
|
+
}, { once: true });
|
|
741
|
+
return;
|
|
742
|
+
}
|
|
743
|
+
e.preventDefault();
|
|
744
|
+
this.handleSelect();
|
|
745
|
+
if (e.pointerType === "touch") this.root.setHighlightedNode(this.opts.ref.current);
|
|
746
|
+
}
|
|
747
|
+
onpointermove(e) {
|
|
748
|
+
/**
|
|
749
|
+
* We don't want to highlight items on touch devices when scrolling,
|
|
750
|
+
* as this is confusing behavior, so we return here and instead handle
|
|
751
|
+
* the highlighting on the `pointerup` (or following `click`) event for
|
|
752
|
+
* touch devices only.
|
|
753
|
+
*/
|
|
754
|
+
if (e.pointerType === "touch") return;
|
|
755
|
+
if (this.root.highlightedNode !== this.opts.ref.current) this.root.setHighlightedNode(this.opts.ref.current);
|
|
756
|
+
}
|
|
757
|
+
#props = $.derived(() => ({
|
|
758
|
+
id: this.opts.id.current,
|
|
759
|
+
role: "option",
|
|
760
|
+
"aria-selected": this.root.includesItem(this.opts.value.current) ? "true" : void 0,
|
|
761
|
+
"data-value": this.opts.value.current,
|
|
762
|
+
"data-disabled": boolToEmptyStrOrUndef(this.opts.disabled.current),
|
|
763
|
+
"data-highlighted": this.root.highlightedValue === this.opts.value.current && !this.opts.disabled.current ? "" : void 0,
|
|
764
|
+
"data-selected": this.root.includesItem(this.opts.value.current) ? "" : void 0,
|
|
765
|
+
"data-label": this.opts.label.current,
|
|
766
|
+
[this.root.getBitsAttr("item")]: "",
|
|
767
|
+
onpointermove: this.onpointermove,
|
|
768
|
+
onpointerdown: this.onpointerdown,
|
|
769
|
+
onpointerup: this.onpointerup,
|
|
770
|
+
...this.attachment
|
|
771
|
+
}));
|
|
772
|
+
get props() {
|
|
773
|
+
return this.#props();
|
|
774
|
+
}
|
|
775
|
+
set props($$value) {
|
|
776
|
+
return this.#props($$value);
|
|
777
|
+
}
|
|
778
|
+
};
|
|
779
|
+
var SelectHiddenInputState = class SelectHiddenInputState {
|
|
780
|
+
static create(opts) {
|
|
781
|
+
return new SelectHiddenInputState(opts, SelectRootContext.get());
|
|
782
|
+
}
|
|
783
|
+
opts;
|
|
784
|
+
root;
|
|
785
|
+
#shouldRender = $.derived(() => this.root.opts.name.current !== "");
|
|
786
|
+
get shouldRender() {
|
|
787
|
+
return this.#shouldRender();
|
|
788
|
+
}
|
|
789
|
+
set shouldRender($$value) {
|
|
790
|
+
return this.#shouldRender($$value);
|
|
791
|
+
}
|
|
792
|
+
constructor(opts, root) {
|
|
793
|
+
this.opts = opts;
|
|
794
|
+
this.root = root;
|
|
795
|
+
this.onfocus = this.onfocus.bind(this);
|
|
796
|
+
}
|
|
797
|
+
onfocus(e) {
|
|
798
|
+
e.preventDefault();
|
|
799
|
+
if (!this.root.isCombobox) this.root.triggerNode?.focus();
|
|
800
|
+
else this.root.inputNode?.focus();
|
|
801
|
+
}
|
|
802
|
+
#props = $.derived(() => ({
|
|
803
|
+
disabled: boolToTrueOrUndef(this.root.opts.disabled.current),
|
|
804
|
+
required: boolToTrueOrUndef(this.root.opts.required.current),
|
|
805
|
+
name: this.root.opts.name.current,
|
|
806
|
+
value: this.opts.value.current,
|
|
807
|
+
onfocus: this.onfocus
|
|
808
|
+
}));
|
|
809
|
+
get props() {
|
|
810
|
+
return this.#props();
|
|
811
|
+
}
|
|
812
|
+
set props($$value) {
|
|
813
|
+
return this.#props($$value);
|
|
814
|
+
}
|
|
815
|
+
};
|
|
816
|
+
var SelectViewportState = class SelectViewportState {
|
|
817
|
+
static create(opts) {
|
|
818
|
+
return new SelectViewportState(opts, SelectContentContext.get());
|
|
819
|
+
}
|
|
820
|
+
opts;
|
|
821
|
+
content;
|
|
822
|
+
root;
|
|
823
|
+
attachment;
|
|
824
|
+
prevScrollTop = 0;
|
|
825
|
+
constructor(opts, content) {
|
|
826
|
+
this.opts = opts;
|
|
827
|
+
this.content = content;
|
|
828
|
+
this.root = content.root;
|
|
829
|
+
this.attachment = attachRef(opts.ref, (v) => {
|
|
830
|
+
this.root.viewportNode = v;
|
|
831
|
+
});
|
|
832
|
+
}
|
|
833
|
+
#props = $.derived(() => ({
|
|
834
|
+
id: this.opts.id.current,
|
|
835
|
+
role: "presentation",
|
|
836
|
+
[this.root.getBitsAttr("viewport")]: "",
|
|
837
|
+
style: {
|
|
838
|
+
position: "relative",
|
|
839
|
+
flex: 1,
|
|
840
|
+
overflow: "auto"
|
|
841
|
+
},
|
|
842
|
+
...this.attachment
|
|
843
|
+
}));
|
|
844
|
+
get props() {
|
|
845
|
+
return this.#props();
|
|
846
|
+
}
|
|
847
|
+
set props($$value) {
|
|
848
|
+
return this.#props($$value);
|
|
849
|
+
}
|
|
850
|
+
};
|
|
851
|
+
//#endregion
|
|
852
|
+
//#region ../node_modules/.bun/bits-ui@2.18.1+203cd734255b50e4/node_modules/bits-ui/dist/bits/utilities/hidden-input.svelte
|
|
853
|
+
function Hidden_input($$renderer, $$props) {
|
|
854
|
+
$$renderer.component(($$renderer) => {
|
|
855
|
+
let { value = void 0, $$slots, $$events, ...restProps } = $$props;
|
|
856
|
+
const mergedProps = $.derived(() => mergeProps(restProps, {
|
|
857
|
+
"aria-hidden": "true",
|
|
858
|
+
tabindex: -1,
|
|
859
|
+
style: {
|
|
860
|
+
...srOnlyStyles,
|
|
861
|
+
position: "absolute",
|
|
862
|
+
top: "0",
|
|
863
|
+
left: "0"
|
|
864
|
+
}
|
|
865
|
+
}));
|
|
866
|
+
if (mergedProps().type === "checkbox") {
|
|
867
|
+
$$renderer.push("<!--[0-->");
|
|
868
|
+
$$renderer.push(`<input${$.attributes({
|
|
869
|
+
...mergedProps(),
|
|
870
|
+
value
|
|
871
|
+
}, void 0, void 0, void 0, 4)}/>`);
|
|
872
|
+
} else {
|
|
873
|
+
$$renderer.push("<!--[-1-->");
|
|
874
|
+
$$renderer.push(`<input${$.attributes({
|
|
875
|
+
value,
|
|
876
|
+
...mergedProps()
|
|
877
|
+
}, void 0, void 0, void 0, 4)}/>`);
|
|
878
|
+
}
|
|
879
|
+
$$renderer.push(`<!--]-->`);
|
|
880
|
+
$.bind_props($$props, { value });
|
|
881
|
+
});
|
|
882
|
+
}
|
|
883
|
+
//#endregion
|
|
884
|
+
//#region ../node_modules/.bun/bits-ui@2.18.1+203cd734255b50e4/node_modules/bits-ui/dist/bits/select/components/select-hidden-input.svelte
|
|
885
|
+
function Select_hidden_input($$renderer, $$props) {
|
|
886
|
+
$$renderer.component(($$renderer) => {
|
|
887
|
+
let { value = void 0, autocomplete } = $$props;
|
|
888
|
+
const hiddenInputState = SelectHiddenInputState.create({ value: boxWith(() => value) });
|
|
889
|
+
let $$settled = true;
|
|
890
|
+
let $$inner_renderer;
|
|
891
|
+
function $$render_inner($$renderer) {
|
|
892
|
+
if (hiddenInputState.shouldRender) {
|
|
893
|
+
$$renderer.push("<!--[0-->");
|
|
894
|
+
Hidden_input($$renderer, $.spread_props([hiddenInputState.props, {
|
|
895
|
+
autocomplete,
|
|
896
|
+
get value() {
|
|
897
|
+
return value;
|
|
898
|
+
},
|
|
899
|
+
set value($$value) {
|
|
900
|
+
value = $$value;
|
|
901
|
+
$$settled = false;
|
|
902
|
+
}
|
|
903
|
+
}]));
|
|
904
|
+
} else $$renderer.push("<!--[-1-->");
|
|
905
|
+
$$renderer.push(`<!--]-->`);
|
|
906
|
+
}
|
|
907
|
+
do {
|
|
908
|
+
$$settled = true;
|
|
909
|
+
$$inner_renderer = $$renderer.copy();
|
|
910
|
+
$$render_inner($$inner_renderer);
|
|
911
|
+
} while (!$$settled);
|
|
912
|
+
$$renderer.subsume($$inner_renderer);
|
|
913
|
+
$.bind_props($$props, { value });
|
|
914
|
+
});
|
|
915
|
+
}
|
|
916
|
+
//#endregion
|
|
917
|
+
//#region ../node_modules/.bun/bits-ui@2.18.1+203cd734255b50e4/node_modules/bits-ui/dist/bits/select/components/select.svelte
|
|
918
|
+
function Select$1($$renderer, $$props) {
|
|
919
|
+
$$renderer.component(($$renderer) => {
|
|
920
|
+
let { value = void 0, onValueChange = noop, name = "", disabled = false, type, open = false, onOpenChange = noop, onOpenChangeComplete = noop, loop = false, scrollAlignment = "nearest", required = false, items = [], allowDeselect = false, autocomplete, children } = $$props;
|
|
921
|
+
function handleDefaultValue() {
|
|
922
|
+
if (value !== void 0) return;
|
|
923
|
+
value = type === "single" ? "" : [];
|
|
924
|
+
}
|
|
925
|
+
handleDefaultValue();
|
|
926
|
+
watch.pre(() => value, () => {
|
|
927
|
+
handleDefaultValue();
|
|
928
|
+
});
|
|
929
|
+
let inputValue = "";
|
|
930
|
+
const rootState = SelectRootState.create({
|
|
931
|
+
type,
|
|
932
|
+
value: boxWith(() => value, (v) => {
|
|
933
|
+
value = v;
|
|
934
|
+
onValueChange(v);
|
|
935
|
+
}),
|
|
936
|
+
disabled: boxWith(() => disabled),
|
|
937
|
+
required: boxWith(() => required),
|
|
938
|
+
open: boxWith(() => open, (v) => {
|
|
939
|
+
open = v;
|
|
940
|
+
onOpenChange(v);
|
|
941
|
+
}),
|
|
942
|
+
loop: boxWith(() => loop),
|
|
943
|
+
scrollAlignment: boxWith(() => scrollAlignment),
|
|
944
|
+
name: boxWith(() => name),
|
|
945
|
+
isCombobox: false,
|
|
946
|
+
items: boxWith(() => items),
|
|
947
|
+
allowDeselect: boxWith(() => allowDeselect),
|
|
948
|
+
inputValue: boxWith(() => inputValue, (v) => inputValue = v),
|
|
949
|
+
onOpenChangeComplete: boxWith(() => onOpenChangeComplete)
|
|
950
|
+
});
|
|
951
|
+
let $$settled = true;
|
|
952
|
+
let $$inner_renderer;
|
|
953
|
+
function $$render_inner($$renderer) {
|
|
954
|
+
Floating_layer($$renderer, {
|
|
955
|
+
children: ($$renderer) => {
|
|
956
|
+
children?.($$renderer);
|
|
957
|
+
$$renderer.push(`<!---->`);
|
|
958
|
+
},
|
|
959
|
+
$$slots: { default: true }
|
|
960
|
+
});
|
|
961
|
+
$$renderer.push(`<!----> `);
|
|
962
|
+
if (Array.isArray(rootState.opts.value.current)) {
|
|
963
|
+
$$renderer.push("<!--[0-->");
|
|
964
|
+
if (rootState.opts.value.current.length === 0) {
|
|
965
|
+
$$renderer.push("<!--[0-->");
|
|
966
|
+
Select_hidden_input($$renderer, { autocomplete });
|
|
967
|
+
} else {
|
|
968
|
+
$$renderer.push("<!--[-1-->");
|
|
969
|
+
$$renderer.push(`<!--[-->`);
|
|
970
|
+
const each_array = $.ensure_array_like(rootState.opts.value.current);
|
|
971
|
+
for (let $$index = 0, $$length = each_array.length; $$index < $$length; $$index++) {
|
|
972
|
+
let item = each_array[$$index];
|
|
973
|
+
Select_hidden_input($$renderer, {
|
|
974
|
+
value: item,
|
|
975
|
+
autocomplete
|
|
976
|
+
});
|
|
977
|
+
}
|
|
978
|
+
$$renderer.push(`<!--]-->`);
|
|
979
|
+
}
|
|
980
|
+
$$renderer.push(`<!--]-->`);
|
|
981
|
+
} else {
|
|
982
|
+
$$renderer.push("<!--[-1-->");
|
|
983
|
+
Select_hidden_input($$renderer, {
|
|
984
|
+
autocomplete,
|
|
985
|
+
get value() {
|
|
986
|
+
return rootState.opts.value.current;
|
|
987
|
+
},
|
|
988
|
+
set value($$value) {
|
|
989
|
+
rootState.opts.value.current = $$value;
|
|
990
|
+
$$settled = false;
|
|
991
|
+
}
|
|
992
|
+
});
|
|
993
|
+
}
|
|
994
|
+
$$renderer.push(`<!--]-->`);
|
|
995
|
+
}
|
|
996
|
+
do {
|
|
997
|
+
$$settled = true;
|
|
998
|
+
$$inner_renderer = $$renderer.copy();
|
|
999
|
+
$$render_inner($$inner_renderer);
|
|
1000
|
+
} while (!$$settled);
|
|
1001
|
+
$$renderer.subsume($$inner_renderer);
|
|
1002
|
+
$.bind_props($$props, {
|
|
1003
|
+
value,
|
|
1004
|
+
open
|
|
1005
|
+
});
|
|
1006
|
+
});
|
|
1007
|
+
}
|
|
1008
|
+
//#endregion
|
|
1009
|
+
//#region ../node_modules/.bun/bits-ui@2.18.1+203cd734255b50e4/node_modules/bits-ui/dist/bits/select/components/select-value.svelte
|
|
1010
|
+
function Select_value$1($$renderer, $$props) {
|
|
1011
|
+
$$renderer.component(($$renderer) => {
|
|
1012
|
+
const uid = $.props_id($$renderer);
|
|
1013
|
+
let { ref = null, id = createId(uid), placeholder, child, children, $$slots, $$events, ...restProps } = $$props;
|
|
1014
|
+
const valueState = SelectValueState.create({
|
|
1015
|
+
id: boxWith(() => id),
|
|
1016
|
+
ref: boxWith(() => ref, (v) => ref = v),
|
|
1017
|
+
placeholder: boxWith(() => placeholder)
|
|
1018
|
+
});
|
|
1019
|
+
const mergedProps = $.derived(() => mergeProps(restProps, valueState.props));
|
|
1020
|
+
if (child) {
|
|
1021
|
+
$$renderer.push("<!--[0-->");
|
|
1022
|
+
child($$renderer, {
|
|
1023
|
+
props: mergedProps(),
|
|
1024
|
+
...valueState.snippetProps
|
|
1025
|
+
});
|
|
1026
|
+
$$renderer.push(`<!---->`);
|
|
1027
|
+
} else {
|
|
1028
|
+
$$renderer.push("<!--[-1-->");
|
|
1029
|
+
$$renderer.push(`<span${$.attributes({ ...mergedProps() })}>`);
|
|
1030
|
+
if (children) {
|
|
1031
|
+
$$renderer.push("<!--[0-->");
|
|
1032
|
+
children?.($$renderer, valueState.snippetProps);
|
|
1033
|
+
$$renderer.push(`<!---->`);
|
|
1034
|
+
} else if (valueState.snippetProps.selection.type === "single") {
|
|
1035
|
+
$$renderer.push("<!--[1-->");
|
|
1036
|
+
$$renderer.push(`${$.escape(valueState.snippetProps.selection.selected?.label ?? placeholder)}`);
|
|
1037
|
+
} else if (valueState.snippetProps.selection.type === "multiple" && valueState.snippetProps.selection.selected) {
|
|
1038
|
+
$$renderer.push("<!--[2-->");
|
|
1039
|
+
$$renderer.push(`${$.escape(valueState.snippetProps.selection.selected.length > 0 ? valueState.snippetProps.selection.selected.map((selected) => selected.label).join(", ") : placeholder)}`);
|
|
1040
|
+
} else {
|
|
1041
|
+
$$renderer.push("<!--[-1-->");
|
|
1042
|
+
$$renderer.push(`${$.escape(placeholder)}`);
|
|
1043
|
+
}
|
|
1044
|
+
$$renderer.push(`<!--]--></span>`);
|
|
1045
|
+
}
|
|
1046
|
+
$$renderer.push(`<!--]-->`);
|
|
1047
|
+
$.bind_props($$props, { ref });
|
|
1048
|
+
});
|
|
1049
|
+
}
|
|
1050
|
+
//#endregion
|
|
1051
|
+
//#region ../node_modules/.bun/bits-ui@2.18.1+203cd734255b50e4/node_modules/bits-ui/dist/bits/select/components/select-content.svelte
|
|
1052
|
+
function Select_content$1($$renderer, $$props) {
|
|
1053
|
+
$$renderer.component(($$renderer) => {
|
|
1054
|
+
const uid = $.props_id($$renderer);
|
|
1055
|
+
let { id = createId(uid), ref = null, forceMount = false, side = "bottom", onInteractOutside = noop, onEscapeKeydown = noop, children, child, preventScroll = false, style, $$slots, $$events, ...restProps } = $$props;
|
|
1056
|
+
const contentState = SelectContentState.create({
|
|
1057
|
+
id: boxWith(() => id),
|
|
1058
|
+
ref: boxWith(() => ref, (v) => ref = v),
|
|
1059
|
+
onInteractOutside: boxWith(() => onInteractOutside),
|
|
1060
|
+
onEscapeKeydown: boxWith(() => onEscapeKeydown)
|
|
1061
|
+
});
|
|
1062
|
+
const mergedProps = $.derived(() => mergeProps(restProps, contentState.props));
|
|
1063
|
+
if (forceMount) {
|
|
1064
|
+
$$renderer.push("<!--[0-->");
|
|
1065
|
+
{
|
|
1066
|
+
function popper($$renderer, { props, wrapperProps }) {
|
|
1067
|
+
const finalProps = mergeProps(props, { style: contentState.props.style }, { style });
|
|
1068
|
+
if (child) {
|
|
1069
|
+
$$renderer.push("<!--[0-->");
|
|
1070
|
+
child($$renderer, {
|
|
1071
|
+
props: finalProps,
|
|
1072
|
+
wrapperProps,
|
|
1073
|
+
...contentState.snippetProps
|
|
1074
|
+
});
|
|
1075
|
+
$$renderer.push(`<!---->`);
|
|
1076
|
+
} else {
|
|
1077
|
+
$$renderer.push("<!--[-1-->");
|
|
1078
|
+
$$renderer.push(`<div${$.attributes({ ...wrapperProps })}><div${$.attributes({ ...finalProps })}>`);
|
|
1079
|
+
children?.($$renderer);
|
|
1080
|
+
$$renderer.push(`<!----></div></div>`);
|
|
1081
|
+
}
|
|
1082
|
+
$$renderer.push(`<!--]-->`);
|
|
1083
|
+
}
|
|
1084
|
+
Popper_layer_force_mount($$renderer, $.spread_props([
|
|
1085
|
+
mergedProps(),
|
|
1086
|
+
contentState.popperProps,
|
|
1087
|
+
{
|
|
1088
|
+
ref: contentState.opts.ref,
|
|
1089
|
+
side,
|
|
1090
|
+
enabled: contentState.root.opts.open.current,
|
|
1091
|
+
id,
|
|
1092
|
+
preventScroll,
|
|
1093
|
+
forceMount: true,
|
|
1094
|
+
shouldRender: contentState.shouldRender,
|
|
1095
|
+
popper,
|
|
1096
|
+
$$slots: { popper: true }
|
|
1097
|
+
}
|
|
1098
|
+
]));
|
|
1099
|
+
}
|
|
1100
|
+
} else if (!forceMount) {
|
|
1101
|
+
$$renderer.push("<!--[1-->");
|
|
1102
|
+
{
|
|
1103
|
+
function popper($$renderer, { props, wrapperProps }) {
|
|
1104
|
+
const finalProps = mergeProps(props, { style: contentState.props.style }, { style });
|
|
1105
|
+
if (child) {
|
|
1106
|
+
$$renderer.push("<!--[0-->");
|
|
1107
|
+
child($$renderer, {
|
|
1108
|
+
props: finalProps,
|
|
1109
|
+
wrapperProps,
|
|
1110
|
+
...contentState.snippetProps
|
|
1111
|
+
});
|
|
1112
|
+
$$renderer.push(`<!---->`);
|
|
1113
|
+
} else {
|
|
1114
|
+
$$renderer.push("<!--[-1-->");
|
|
1115
|
+
$$renderer.push(`<div${$.attributes({ ...wrapperProps })}><div${$.attributes({ ...finalProps })}>`);
|
|
1116
|
+
children?.($$renderer);
|
|
1117
|
+
$$renderer.push(`<!----></div></div>`);
|
|
1118
|
+
}
|
|
1119
|
+
$$renderer.push(`<!--]-->`);
|
|
1120
|
+
}
|
|
1121
|
+
Popper_layer($$renderer, $.spread_props([
|
|
1122
|
+
mergedProps(),
|
|
1123
|
+
contentState.popperProps,
|
|
1124
|
+
{
|
|
1125
|
+
ref: contentState.opts.ref,
|
|
1126
|
+
side,
|
|
1127
|
+
open: contentState.root.opts.open.current,
|
|
1128
|
+
id,
|
|
1129
|
+
preventScroll,
|
|
1130
|
+
forceMount: false,
|
|
1131
|
+
shouldRender: contentState.shouldRender,
|
|
1132
|
+
popper,
|
|
1133
|
+
$$slots: { popper: true }
|
|
1134
|
+
}
|
|
1135
|
+
]));
|
|
1136
|
+
}
|
|
1137
|
+
} else $$renderer.push("<!--[-1-->");
|
|
1138
|
+
$$renderer.push(`<!--]-->`);
|
|
1139
|
+
$.bind_props($$props, { ref });
|
|
1140
|
+
});
|
|
1141
|
+
}
|
|
1142
|
+
//#endregion
|
|
1143
|
+
//#region ../node_modules/.bun/bits-ui@2.18.1+203cd734255b50e4/node_modules/bits-ui/dist/bits/utilities/mounted.svelte
|
|
1144
|
+
function Mounted($$renderer, $$props) {
|
|
1145
|
+
$$renderer.component(($$renderer) => {
|
|
1146
|
+
let { mounted = false, onMountedChange = noop } = $$props;
|
|
1147
|
+
$.bind_props($$props, { mounted });
|
|
1148
|
+
});
|
|
1149
|
+
}
|
|
1150
|
+
//#endregion
|
|
1151
|
+
//#region ../node_modules/.bun/bits-ui@2.18.1+203cd734255b50e4/node_modules/bits-ui/dist/bits/select/components/select-item.svelte
|
|
1152
|
+
function Select_item$1($$renderer, $$props) {
|
|
1153
|
+
$$renderer.component(($$renderer) => {
|
|
1154
|
+
const uid = $.props_id($$renderer);
|
|
1155
|
+
let { id = createId(uid), ref = null, value, label = value, disabled = false, children, child, onHighlight = noop, onUnhighlight = noop, $$slots, $$events, ...restProps } = $$props;
|
|
1156
|
+
const itemState = SelectItemState.create({
|
|
1157
|
+
id: boxWith(() => id),
|
|
1158
|
+
ref: boxWith(() => ref, (v) => ref = v),
|
|
1159
|
+
value: boxWith(() => value),
|
|
1160
|
+
disabled: boxWith(() => disabled),
|
|
1161
|
+
label: boxWith(() => label),
|
|
1162
|
+
onHighlight: boxWith(() => onHighlight),
|
|
1163
|
+
onUnhighlight: boxWith(() => onUnhighlight)
|
|
1164
|
+
});
|
|
1165
|
+
const mergedProps = $.derived(() => mergeProps(restProps, itemState.props));
|
|
1166
|
+
let $$settled = true;
|
|
1167
|
+
let $$inner_renderer;
|
|
1168
|
+
function $$render_inner($$renderer) {
|
|
1169
|
+
if (child) {
|
|
1170
|
+
$$renderer.push("<!--[0-->");
|
|
1171
|
+
child($$renderer, {
|
|
1172
|
+
props: mergedProps(),
|
|
1173
|
+
...itemState.snippetProps
|
|
1174
|
+
});
|
|
1175
|
+
$$renderer.push(`<!---->`);
|
|
1176
|
+
} else {
|
|
1177
|
+
$$renderer.push("<!--[-1-->");
|
|
1178
|
+
$$renderer.push(`<div${$.attributes({ ...mergedProps() })}>`);
|
|
1179
|
+
children?.($$renderer, itemState.snippetProps);
|
|
1180
|
+
$$renderer.push(`<!----></div>`);
|
|
1181
|
+
}
|
|
1182
|
+
$$renderer.push(`<!--]--> `);
|
|
1183
|
+
Mounted($$renderer, {
|
|
1184
|
+
get mounted() {
|
|
1185
|
+
return itemState.mounted;
|
|
1186
|
+
},
|
|
1187
|
+
set mounted($$value) {
|
|
1188
|
+
itemState.mounted = $$value;
|
|
1189
|
+
$$settled = false;
|
|
1190
|
+
}
|
|
1191
|
+
});
|
|
1192
|
+
$$renderer.push(`<!---->`);
|
|
1193
|
+
}
|
|
1194
|
+
do {
|
|
1195
|
+
$$settled = true;
|
|
1196
|
+
$$inner_renderer = $$renderer.copy();
|
|
1197
|
+
$$render_inner($$inner_renderer);
|
|
1198
|
+
} while (!$$settled);
|
|
1199
|
+
$$renderer.subsume($$inner_renderer);
|
|
1200
|
+
$.bind_props($$props, { ref });
|
|
1201
|
+
});
|
|
1202
|
+
}
|
|
1203
|
+
//#endregion
|
|
1204
|
+
//#region ../node_modules/.bun/bits-ui@2.18.1+203cd734255b50e4/node_modules/bits-ui/dist/bits/select/components/select-trigger.svelte
|
|
1205
|
+
function Select_trigger$1($$renderer, $$props) {
|
|
1206
|
+
$$renderer.component(($$renderer) => {
|
|
1207
|
+
const uid = $.props_id($$renderer);
|
|
1208
|
+
let { id = createId(uid), ref = null, child, children, type = "button", $$slots, $$events, ...restProps } = $$props;
|
|
1209
|
+
const triggerState = SelectTriggerState.create({
|
|
1210
|
+
id: boxWith(() => id),
|
|
1211
|
+
ref: boxWith(() => ref, (v) => ref = v)
|
|
1212
|
+
});
|
|
1213
|
+
const mergedProps = $.derived(() => mergeProps(restProps, triggerState.props, { type }));
|
|
1214
|
+
if (Floating_layer_anchor) {
|
|
1215
|
+
$$renderer.push("<!--[-->");
|
|
1216
|
+
Floating_layer_anchor($$renderer, {
|
|
1217
|
+
id,
|
|
1218
|
+
ref: triggerState.opts.ref,
|
|
1219
|
+
children: ($$renderer) => {
|
|
1220
|
+
if (child) {
|
|
1221
|
+
$$renderer.push("<!--[0-->");
|
|
1222
|
+
child($$renderer, { props: mergedProps() });
|
|
1223
|
+
$$renderer.push(`<!---->`);
|
|
1224
|
+
} else {
|
|
1225
|
+
$$renderer.push("<!--[-1-->");
|
|
1226
|
+
$$renderer.push(`<button${$.attributes({ ...mergedProps() })}>`);
|
|
1227
|
+
children?.($$renderer);
|
|
1228
|
+
$$renderer.push(`<!----></button>`);
|
|
1229
|
+
}
|
|
1230
|
+
$$renderer.push(`<!--]-->`);
|
|
1231
|
+
},
|
|
1232
|
+
$$slots: { default: true }
|
|
1233
|
+
});
|
|
1234
|
+
$$renderer.push("<!--]-->");
|
|
1235
|
+
} else {
|
|
1236
|
+
$$renderer.push("<!--[!-->");
|
|
1237
|
+
$$renderer.push("<!--]-->");
|
|
1238
|
+
}
|
|
1239
|
+
$.bind_props($$props, { ref });
|
|
1240
|
+
});
|
|
1241
|
+
}
|
|
1242
|
+
//#endregion
|
|
1243
|
+
//#region ../node_modules/.bun/bits-ui@2.18.1+203cd734255b50e4/node_modules/bits-ui/dist/bits/select/components/select-viewport.svelte
|
|
1244
|
+
function Select_viewport($$renderer, $$props) {
|
|
1245
|
+
$$renderer.component(($$renderer) => {
|
|
1246
|
+
const uid = $.props_id($$renderer);
|
|
1247
|
+
let { id = createId(uid), ref = null, children, child, $$slots, $$events, ...restProps } = $$props;
|
|
1248
|
+
const viewportState = SelectViewportState.create({
|
|
1249
|
+
id: boxWith(() => id),
|
|
1250
|
+
ref: boxWith(() => ref, (v) => ref = v)
|
|
1251
|
+
});
|
|
1252
|
+
const mergedProps = $.derived(() => mergeProps(restProps, viewportState.props));
|
|
1253
|
+
if (child) {
|
|
1254
|
+
$$renderer.push("<!--[0-->");
|
|
1255
|
+
child($$renderer, { props: mergedProps() });
|
|
1256
|
+
$$renderer.push(`<!---->`);
|
|
1257
|
+
} else {
|
|
1258
|
+
$$renderer.push("<!--[-1-->");
|
|
1259
|
+
$$renderer.push(`<div${$.attributes({ ...mergedProps() })}>`);
|
|
1260
|
+
children?.($$renderer);
|
|
1261
|
+
$$renderer.push(`<!----></div>`);
|
|
1262
|
+
}
|
|
1263
|
+
$$renderer.push(`<!--]-->`);
|
|
1264
|
+
$.bind_props($$props, { ref });
|
|
1265
|
+
});
|
|
1266
|
+
}
|
|
1267
|
+
//#endregion
|
|
1268
|
+
//#region ../node_modules/.bun/@hiai-gg+hiai-ui@0.0.8+3149ccaa93f654b8/node_modules/@hiai-gg/hiai-ui/dist/components/ui/select/select.svelte
|
|
1269
|
+
function Select($$renderer, $$props) {
|
|
1270
|
+
$$renderer.component(($$renderer) => {
|
|
1271
|
+
let { value = void 0, children, $$slots, $$events, ...restProps } = $$props;
|
|
1272
|
+
let $$settled = true;
|
|
1273
|
+
let $$inner_renderer;
|
|
1274
|
+
function $$render_inner($$renderer) {
|
|
1275
|
+
if (Select$1) {
|
|
1276
|
+
$$renderer.push("<!--[-->");
|
|
1277
|
+
Select$1($$renderer, $.spread_props([restProps, {
|
|
1278
|
+
get value() {
|
|
1279
|
+
return value;
|
|
1280
|
+
},
|
|
1281
|
+
set value($$value) {
|
|
1282
|
+
value = $$value;
|
|
1283
|
+
$$settled = false;
|
|
1284
|
+
},
|
|
1285
|
+
children: ($$renderer) => {
|
|
1286
|
+
if (children) {
|
|
1287
|
+
$$renderer.push("<!--[0-->");
|
|
1288
|
+
children($$renderer);
|
|
1289
|
+
$$renderer.push(`<!---->`);
|
|
1290
|
+
} else $$renderer.push("<!--[-1-->");
|
|
1291
|
+
$$renderer.push(`<!--]-->`);
|
|
1292
|
+
},
|
|
1293
|
+
$$slots: { default: true }
|
|
1294
|
+
}]));
|
|
1295
|
+
$$renderer.push("<!--]-->");
|
|
1296
|
+
} else {
|
|
1297
|
+
$$renderer.push("<!--[!-->");
|
|
1298
|
+
$$renderer.push("<!--]-->");
|
|
1299
|
+
}
|
|
1300
|
+
}
|
|
1301
|
+
do {
|
|
1302
|
+
$$settled = true;
|
|
1303
|
+
$$inner_renderer = $$renderer.copy();
|
|
1304
|
+
$$render_inner($$inner_renderer);
|
|
1305
|
+
} while (!$$settled);
|
|
1306
|
+
$$renderer.subsume($$inner_renderer);
|
|
1307
|
+
$.bind_props($$props, { value });
|
|
1308
|
+
});
|
|
1309
|
+
}
|
|
1310
|
+
//#endregion
|
|
1311
|
+
//#region ../node_modules/.bun/@hiai-gg+hiai-ui@0.0.8+3149ccaa93f654b8/node_modules/@hiai-gg/hiai-ui/dist/components/ui/select/select-content.svelte
|
|
1312
|
+
function Select_content($$renderer, $$props) {
|
|
1313
|
+
$$renderer.component(($$renderer) => {
|
|
1314
|
+
let { ref = null, class: className, sideOffset = 4, children, $$slots, $$events, ...restProps } = $$props;
|
|
1315
|
+
let $$settled = true;
|
|
1316
|
+
let $$inner_renderer;
|
|
1317
|
+
function $$render_inner($$renderer) {
|
|
1318
|
+
if (Select_content$1) {
|
|
1319
|
+
$$renderer.push("<!--[-->");
|
|
1320
|
+
Select_content$1($$renderer, $.spread_props([
|
|
1321
|
+
{
|
|
1322
|
+
sideOffset,
|
|
1323
|
+
class: cn("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md", className)
|
|
1324
|
+
},
|
|
1325
|
+
restProps,
|
|
1326
|
+
{
|
|
1327
|
+
get ref() {
|
|
1328
|
+
return ref;
|
|
1329
|
+
},
|
|
1330
|
+
set ref($$value) {
|
|
1331
|
+
ref = $$value;
|
|
1332
|
+
$$settled = false;
|
|
1333
|
+
},
|
|
1334
|
+
children: ($$renderer) => {
|
|
1335
|
+
if (Select_viewport) {
|
|
1336
|
+
$$renderer.push("<!--[-->");
|
|
1337
|
+
Select_viewport($$renderer, {
|
|
1338
|
+
class: "p-1",
|
|
1339
|
+
children: ($$renderer) => {
|
|
1340
|
+
if (children) {
|
|
1341
|
+
$$renderer.push("<!--[0-->");
|
|
1342
|
+
children($$renderer);
|
|
1343
|
+
$$renderer.push(`<!---->`);
|
|
1344
|
+
} else $$renderer.push("<!--[-1-->");
|
|
1345
|
+
$$renderer.push(`<!--]-->`);
|
|
1346
|
+
},
|
|
1347
|
+
$$slots: { default: true }
|
|
1348
|
+
});
|
|
1349
|
+
$$renderer.push("<!--]-->");
|
|
1350
|
+
} else {
|
|
1351
|
+
$$renderer.push("<!--[!-->");
|
|
1352
|
+
$$renderer.push("<!--]-->");
|
|
1353
|
+
}
|
|
1354
|
+
},
|
|
1355
|
+
$$slots: { default: true }
|
|
1356
|
+
}
|
|
1357
|
+
]));
|
|
1358
|
+
$$renderer.push("<!--]-->");
|
|
1359
|
+
} else {
|
|
1360
|
+
$$renderer.push("<!--[!-->");
|
|
1361
|
+
$$renderer.push("<!--]-->");
|
|
1362
|
+
}
|
|
1363
|
+
}
|
|
1364
|
+
do {
|
|
1365
|
+
$$settled = true;
|
|
1366
|
+
$$inner_renderer = $$renderer.copy();
|
|
1367
|
+
$$render_inner($$inner_renderer);
|
|
1368
|
+
} while (!$$settled);
|
|
1369
|
+
$$renderer.subsume($$inner_renderer);
|
|
1370
|
+
$.bind_props($$props, { ref });
|
|
1371
|
+
});
|
|
1372
|
+
}
|
|
1373
|
+
//#endregion
|
|
1374
|
+
//#region ../node_modules/.bun/@hiai-gg+hiai-ui@0.0.8+3149ccaa93f654b8/node_modules/@hiai-gg/hiai-ui/dist/components/ui/select/select-item.svelte
|
|
1375
|
+
function Select_item($$renderer, $$props) {
|
|
1376
|
+
$$renderer.component(($$renderer) => {
|
|
1377
|
+
let { ref = null, class: className, children, $$slots, $$events, ...restProps } = $$props;
|
|
1378
|
+
let $$settled = true;
|
|
1379
|
+
let $$inner_renderer;
|
|
1380
|
+
function $$render_inner($$renderer) {
|
|
1381
|
+
if (Select_item$1) {
|
|
1382
|
+
$$renderer.push("<!--[-->");
|
|
1383
|
+
Select_item$1($$renderer, $.spread_props([
|
|
1384
|
+
{ class: cn("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 pr-8 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0", className) },
|
|
1385
|
+
restProps,
|
|
1386
|
+
{
|
|
1387
|
+
get ref() {
|
|
1388
|
+
return ref;
|
|
1389
|
+
},
|
|
1390
|
+
set ref($$value) {
|
|
1391
|
+
ref = $$value;
|
|
1392
|
+
$$settled = false;
|
|
1393
|
+
},
|
|
1394
|
+
children: ($$renderer) => {
|
|
1395
|
+
if (children) {
|
|
1396
|
+
$$renderer.push("<!--[0-->");
|
|
1397
|
+
children($$renderer);
|
|
1398
|
+
$$renderer.push(`<!---->`);
|
|
1399
|
+
} else $$renderer.push("<!--[-1-->");
|
|
1400
|
+
$$renderer.push(`<!--]-->`);
|
|
1401
|
+
},
|
|
1402
|
+
$$slots: { default: true }
|
|
1403
|
+
}
|
|
1404
|
+
]));
|
|
1405
|
+
$$renderer.push("<!--]-->");
|
|
1406
|
+
} else {
|
|
1407
|
+
$$renderer.push("<!--[!-->");
|
|
1408
|
+
$$renderer.push("<!--]-->");
|
|
1409
|
+
}
|
|
1410
|
+
}
|
|
1411
|
+
do {
|
|
1412
|
+
$$settled = true;
|
|
1413
|
+
$$inner_renderer = $$renderer.copy();
|
|
1414
|
+
$$render_inner($$inner_renderer);
|
|
1415
|
+
} while (!$$settled);
|
|
1416
|
+
$$renderer.subsume($$inner_renderer);
|
|
1417
|
+
$.bind_props($$props, { ref });
|
|
1418
|
+
});
|
|
1419
|
+
}
|
|
1420
|
+
//#endregion
|
|
1421
|
+
//#region ../node_modules/.bun/@hiai-gg+hiai-ui@0.0.8+3149ccaa93f654b8/node_modules/@hiai-gg/hiai-ui/dist/components/ui/select/select-trigger.svelte
|
|
1422
|
+
function Select_trigger($$renderer, $$props) {
|
|
1423
|
+
$$renderer.component(($$renderer) => {
|
|
1424
|
+
let { ref = null, class: className, child, children, $$slots, $$events, ...restProps } = $$props;
|
|
1425
|
+
let $$settled = true;
|
|
1426
|
+
let $$inner_renderer;
|
|
1427
|
+
function $$render_inner($$renderer) {
|
|
1428
|
+
if (child) {
|
|
1429
|
+
$$renderer.push("<!--[0-->");
|
|
1430
|
+
function renderChild($$renderer, snippetProps) {
|
|
1431
|
+
child?.($$renderer, snippetProps);
|
|
1432
|
+
$$renderer.push(`<!---->`);
|
|
1433
|
+
}
|
|
1434
|
+
if (Select_trigger$1) {
|
|
1435
|
+
$$renderer.push("<!--[-->");
|
|
1436
|
+
Select_trigger$1($$renderer, $.spread_props([restProps, {
|
|
1437
|
+
child: renderChild,
|
|
1438
|
+
class: cn("flex h-9 items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1", className),
|
|
1439
|
+
get ref() {
|
|
1440
|
+
return ref;
|
|
1441
|
+
},
|
|
1442
|
+
set ref($$value) {
|
|
1443
|
+
ref = $$value;
|
|
1444
|
+
$$settled = false;
|
|
1445
|
+
}
|
|
1446
|
+
}]));
|
|
1447
|
+
$$renderer.push("<!--]-->");
|
|
1448
|
+
} else {
|
|
1449
|
+
$$renderer.push("<!--[!-->");
|
|
1450
|
+
$$renderer.push("<!--]-->");
|
|
1451
|
+
}
|
|
1452
|
+
} else {
|
|
1453
|
+
$$renderer.push("<!--[-1-->");
|
|
1454
|
+
if (Select_trigger$1) {
|
|
1455
|
+
$$renderer.push("<!--[-->");
|
|
1456
|
+
Select_trigger$1($$renderer, $.spread_props([restProps, {
|
|
1457
|
+
class: cn("flex h-9 items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1", className),
|
|
1458
|
+
get ref() {
|
|
1459
|
+
return ref;
|
|
1460
|
+
},
|
|
1461
|
+
set ref($$value) {
|
|
1462
|
+
ref = $$value;
|
|
1463
|
+
$$settled = false;
|
|
1464
|
+
},
|
|
1465
|
+
children: ($$renderer) => {
|
|
1466
|
+
if (children) {
|
|
1467
|
+
$$renderer.push("<!--[0-->");
|
|
1468
|
+
children($$renderer);
|
|
1469
|
+
$$renderer.push(`<!---->`);
|
|
1470
|
+
} else $$renderer.push("<!--[-1-->");
|
|
1471
|
+
$$renderer.push(`<!--]-->`);
|
|
1472
|
+
},
|
|
1473
|
+
$$slots: { default: true }
|
|
1474
|
+
}]));
|
|
1475
|
+
$$renderer.push("<!--]-->");
|
|
1476
|
+
} else {
|
|
1477
|
+
$$renderer.push("<!--[!-->");
|
|
1478
|
+
$$renderer.push("<!--]-->");
|
|
1479
|
+
}
|
|
1480
|
+
}
|
|
1481
|
+
$$renderer.push(`<!--]-->`);
|
|
1482
|
+
}
|
|
1483
|
+
do {
|
|
1484
|
+
$$settled = true;
|
|
1485
|
+
$$inner_renderer = $$renderer.copy();
|
|
1486
|
+
$$render_inner($$inner_renderer);
|
|
1487
|
+
} while (!$$settled);
|
|
1488
|
+
$$renderer.subsume($$inner_renderer);
|
|
1489
|
+
$.bind_props($$props, { ref });
|
|
1490
|
+
});
|
|
1491
|
+
}
|
|
1492
|
+
//#endregion
|
|
1493
|
+
//#region ../node_modules/.bun/@hiai-gg+hiai-ui@0.0.8+3149ccaa93f654b8/node_modules/@hiai-gg/hiai-ui/dist/components/ui/select/select-value.svelte
|
|
1494
|
+
function Select_value($$renderer, $$props) {
|
|
1495
|
+
let { children, $$slots, $$events, ...restProps } = $$props;
|
|
1496
|
+
if (children) {
|
|
1497
|
+
$$renderer.push("<!--[0-->");
|
|
1498
|
+
if (Select_value$1) {
|
|
1499
|
+
$$renderer.push("<!--[-->");
|
|
1500
|
+
Select_value$1($$renderer, $.spread_props([restProps, {
|
|
1501
|
+
children: ($$renderer) => {
|
|
1502
|
+
children($$renderer);
|
|
1503
|
+
$$renderer.push(`<!---->`);
|
|
1504
|
+
},
|
|
1505
|
+
$$slots: { default: true }
|
|
1506
|
+
}]));
|
|
1507
|
+
$$renderer.push("<!--]-->");
|
|
1508
|
+
} else {
|
|
1509
|
+
$$renderer.push("<!--[!-->");
|
|
1510
|
+
$$renderer.push("<!--]-->");
|
|
1511
|
+
}
|
|
1512
|
+
} else {
|
|
1513
|
+
$$renderer.push("<!--[-1-->");
|
|
1514
|
+
if (Select_value$1) {
|
|
1515
|
+
$$renderer.push("<!--[-->");
|
|
1516
|
+
Select_value$1($$renderer, $.spread_props([restProps]));
|
|
1517
|
+
$$renderer.push("<!--]-->");
|
|
1518
|
+
} else {
|
|
1519
|
+
$$renderer.push("<!--[!-->");
|
|
1520
|
+
$$renderer.push("<!--]-->");
|
|
1521
|
+
}
|
|
1522
|
+
}
|
|
1523
|
+
$$renderer.push(`<!--]-->`);
|
|
1524
|
+
}
|
|
1525
|
+
//#endregion
|
|
1526
|
+
export { Select as a, Select_content as i, Select_trigger as n, Select_item as r, Select_value as t };
|