@geajs/ui 0.1.4 → 0.2.0
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 +14 -19
- package/dist/accordion.d.mts +34 -0
- package/dist/accordion.mjs +167 -0
- package/dist/accordion.mjs.map +1 -0
- package/dist/alert.d.mts +15 -0
- package/dist/alert.mjs +101 -0
- package/dist/alert.mjs.map +1 -0
- package/dist/avatar.d.mts +26 -0
- package/dist/avatar.mjs +97 -0
- package/dist/avatar.mjs.map +1 -0
- package/dist/badge.d.mts +9 -0
- package/dist/badge.mjs +49 -0
- package/dist/badge.mjs.map +1 -0
- package/dist/button.d.mts +21 -0
- package/dist/button.mjs +96 -0
- package/dist/button.mjs.map +1 -0
- package/dist/card.d.mts +24 -0
- package/dist/card.mjs +169 -0
- package/dist/card.mjs.map +1 -0
- package/dist/checkbox.d.mts +37 -0
- package/dist/checkbox.mjs +80 -0
- package/dist/checkbox.mjs.map +1 -0
- package/dist/clipboard.d.mts +33 -0
- package/dist/clipboard.mjs +100 -0
- package/dist/clipboard.mjs.map +1 -0
- package/dist/cn.mjs +10 -0
- package/dist/cn.mjs.map +1 -0
- package/dist/collapsible.d.mts +29 -0
- package/dist/collapsible.mjs +77 -0
- package/dist/collapsible.mjs.map +1 -0
- package/dist/combobox.d.mts +67 -0
- package/dist/combobox.mjs +375 -0
- package/dist/combobox.mjs.map +1 -0
- package/dist/dialog.d.mts +57 -0
- package/dist/dialog.mjs +139 -0
- package/dist/dialog.mjs.map +1 -0
- package/dist/dnd-manager.d.mts +67 -0
- package/dist/dnd-manager.mjs +387 -0
- package/dist/dnd-manager.mjs.map +1 -0
- package/dist/drag-drop-context.d.mts +11 -0
- package/dist/drag-drop-context.mjs +43 -0
- package/dist/drag-drop-context.mjs.map +1 -0
- package/dist/draggable.d.mts +11 -0
- package/dist/draggable.mjs +72 -0
- package/dist/draggable.mjs.map +1 -0
- package/dist/droppable.d.mts +14 -0
- package/dist/droppable.mjs +66 -0
- package/dist/droppable.mjs.map +1 -0
- package/dist/file-upload.d.mts +38 -0
- package/dist/file-upload.mjs +170 -0
- package/dist/file-upload.mjs.map +1 -0
- package/dist/hover-card.d.mts +33 -0
- package/dist/hover-card.mjs +92 -0
- package/dist/hover-card.mjs.map +1 -0
- package/dist/index.d.mts +41 -1068
- package/dist/index.mjs +41 -4332
- package/dist/input.d.mts +9 -0
- package/dist/input.mjs +82 -0
- package/dist/input.mjs.map +1 -0
- package/dist/label.d.mts +9 -0
- package/dist/label.mjs +42 -0
- package/dist/label.mjs.map +1 -0
- package/dist/menu.d.mts +36 -0
- package/dist/menu.mjs +88 -0
- package/dist/menu.mjs.map +1 -0
- package/dist/number-input.d.mts +46 -0
- package/dist/number-input.mjs +89 -0
- package/dist/number-input.mjs.map +1 -0
- package/dist/pagination.d.mts +37 -0
- package/dist/pagination.mjs +97 -0
- package/dist/pagination.mjs.map +1 -0
- package/dist/pin-input.d.mts +45 -0
- package/dist/pin-input.mjs +147 -0
- package/dist/pin-input.mjs.map +1 -0
- package/dist/popover.d.mts +39 -0
- package/dist/popover.mjs +109 -0
- package/dist/popover.mjs.map +1 -0
- package/dist/progress.d.mts +34 -0
- package/dist/progress.mjs +86 -0
- package/dist/progress.mjs.map +1 -0
- package/dist/radio-group.d.mts +37 -0
- package/dist/radio-group.mjs +184 -0
- package/dist/radio-group.mjs.map +1 -0
- package/dist/rating-group.d.mts +38 -0
- package/dist/rating-group.mjs +171 -0
- package/dist/rating-group.mjs.map +1 -0
- package/dist/select.d.mts +54 -0
- package/dist/select.mjs +277 -0
- package/dist/select.mjs.map +1 -0
- package/dist/separator.d.mts +9 -0
- package/dist/separator.mjs +49 -0
- package/dist/separator.mjs.map +1 -0
- package/dist/skeleton.d.mts +9 -0
- package/dist/skeleton.mjs +43 -0
- package/dist/skeleton.mjs.map +1 -0
- package/dist/slider.d.mts +44 -0
- package/dist/slider.mjs +117 -0
- package/dist/slider.mjs.map +1 -0
- package/dist/switch.d.mts +37 -0
- package/dist/switch.mjs +80 -0
- package/dist/switch.mjs.map +1 -0
- package/dist/tabs.d.mts +36 -0
- package/dist/tabs.mjs +197 -0
- package/dist/tabs.mjs.map +1 -0
- package/dist/tags-input.d.mts +48 -0
- package/dist/tags-input.mjs +267 -0
- package/dist/tags-input.mjs.map +1 -0
- package/dist/textarea.d.mts +9 -0
- package/dist/textarea.mjs +73 -0
- package/dist/textarea.mjs.map +1 -0
- package/dist/toast.d.mts +33 -0
- package/dist/toast.mjs +213 -0
- package/dist/toast.mjs.map +1 -0
- package/dist/toggle-group.d.mts +32 -0
- package/dist/toggle-group.mjs +124 -0
- package/dist/toggle-group.mjs.map +1 -0
- package/dist/tooltip.d.mts +39 -0
- package/dist/tooltip.mjs +85 -0
- package/dist/tooltip.mjs.map +1 -0
- package/dist/tree-view.d.mts +35 -0
- package/dist/tree-view.mjs +94 -0
- package/dist/tree-view.mjs.map +1 -0
- package/dist/zag-component.d.mts +40 -0
- package/dist/zag-component.mjs +135 -0
- package/dist/zag-component.mjs.map +1 -0
- package/package.json +8 -8
- package/dist/index.mjs.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -1,4333 +1,42 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import
|
|
29
|
-
import
|
|
30
|
-
import
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
getSpreadMap() {
|
|
43
|
-
return {};
|
|
44
|
-
}
|
|
45
|
-
syncState(_api) {}
|
|
46
|
-
created(props) {
|
|
47
|
-
if (!this._spreadCleanups) this._spreadCleanups = /* @__PURE__ */ new Map();
|
|
48
|
-
if (this._spreadScheduled === void 0) this._spreadScheduled = false;
|
|
49
|
-
if (!this._zagIdMap) this._zagIdMap = /* @__PURE__ */ new Map();
|
|
50
|
-
const machineDef = this.createMachine(props);
|
|
51
|
-
if (!machineDef) return;
|
|
52
|
-
this._machine = new VanillaMachine(machineDef, this.getMachineProps(props));
|
|
53
|
-
const zagIdMap = this._zagIdMap;
|
|
54
|
-
const origGetById = this._machine.scope.getById;
|
|
55
|
-
this._machine.scope.getById = (id) => {
|
|
56
|
-
return origGetById(id) || zagIdMap.get(id) || null;
|
|
57
|
-
};
|
|
58
|
-
this._machine.start();
|
|
59
|
-
this._api = this.connectApi(this._machine.service);
|
|
60
|
-
this.syncState(this._api);
|
|
61
|
-
this._machine.subscribe(() => {
|
|
62
|
-
if (!this._machine) return;
|
|
63
|
-
this._api = this.connectApi(this._machine.service);
|
|
64
|
-
this._scheduleSpreadApplication();
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
_syncMachineProps() {
|
|
68
|
-
const machine = this._machine;
|
|
69
|
-
if (!machine?.userPropsRef) return;
|
|
70
|
-
const next = this.getMachineProps(this.props);
|
|
71
|
-
machine.userPropsRef.current = next;
|
|
72
|
-
this._api = this.connectApi(this._machine.service);
|
|
73
|
-
this._scheduleSpreadApplication();
|
|
74
|
-
}
|
|
75
|
-
__geaUpdateProps(nextProps) {
|
|
76
|
-
super.__geaUpdateProps(nextProps);
|
|
77
|
-
this._syncMachineProps();
|
|
78
|
-
}
|
|
79
|
-
_scheduleSpreadApplication() {
|
|
80
|
-
if (this._spreadScheduled) return;
|
|
81
|
-
this._spreadScheduled = true;
|
|
82
|
-
queueMicrotask(() => {
|
|
83
|
-
this._spreadScheduled = false;
|
|
84
|
-
this._applyAllSpreads();
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
_resolveProps(getter, el) {
|
|
88
|
-
if (typeof getter === "function") return getter(this._api, el);
|
|
89
|
-
const method = this._api[getter];
|
|
90
|
-
if (typeof method !== "function") return null;
|
|
91
|
-
return method.call(this._api);
|
|
92
|
-
}
|
|
93
|
-
_queryAllIncludingSelf(selector) {
|
|
94
|
-
const results = this.$$(selector);
|
|
95
|
-
const root = this.el;
|
|
96
|
-
if (root && root.matches(selector) && !results.includes(root)) results.unshift(root);
|
|
97
|
-
return results;
|
|
98
|
-
}
|
|
99
|
-
_applyAllSpreads() {
|
|
100
|
-
if (!this.rendered_ || !this._api) return;
|
|
101
|
-
const map = this.getSpreadMap();
|
|
102
|
-
for (const selector in map) {
|
|
103
|
-
const getter = map[selector];
|
|
104
|
-
const elements = this._queryAllIncludingSelf(selector);
|
|
105
|
-
for (let i = 0; i < elements.length; i++) {
|
|
106
|
-
const el = elements[i];
|
|
107
|
-
const key = selector + ":" + i;
|
|
108
|
-
const nextProps = this._resolveProps(getter, el);
|
|
109
|
-
if (!nextProps) continue;
|
|
110
|
-
const bindingId = el.id;
|
|
111
|
-
const cleanup = spreadProps(el, nextProps);
|
|
112
|
-
if (bindingId && el.id !== bindingId) {
|
|
113
|
-
this._zagIdMap.set(el.id, el);
|
|
114
|
-
el.id = bindingId;
|
|
115
|
-
}
|
|
116
|
-
this._spreadCleanups.set(key, cleanup);
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
__geaSyncMap(idx) {
|
|
121
|
-
super.__geaSyncMap(idx);
|
|
122
|
-
this._scheduleSpreadApplication();
|
|
123
|
-
}
|
|
124
|
-
onAfterRender() {
|
|
125
|
-
this._cacheArrayContainers();
|
|
126
|
-
this._applyAllSpreads();
|
|
127
|
-
}
|
|
128
|
-
_cacheArrayContainers() {
|
|
129
|
-
const maps = this.__geaMaps;
|
|
130
|
-
if (!maps) return;
|
|
131
|
-
for (const idx in maps) {
|
|
132
|
-
const map = maps[idx];
|
|
133
|
-
map.container = map.getContainer();
|
|
134
|
-
if (map.container) this[map.containerProp] = map.container;
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
dispose() {
|
|
138
|
-
for (const cleanup of this._spreadCleanups.values()) cleanup();
|
|
139
|
-
this._spreadCleanups.clear();
|
|
140
|
-
if (this._machine) {
|
|
141
|
-
this._machine.stop();
|
|
142
|
-
this._machine = null;
|
|
143
|
-
}
|
|
144
|
-
this._api = null;
|
|
145
|
-
this._zagIdMap?.clear();
|
|
146
|
-
super.dispose();
|
|
147
|
-
}
|
|
148
|
-
static {
|
|
149
|
-
this.normalizeProps = normalizeProps;
|
|
150
|
-
}
|
|
151
|
-
};
|
|
152
|
-
//#endregion
|
|
153
|
-
//#region src/utils/cn.ts
|
|
154
|
-
function cn(...inputs) {
|
|
155
|
-
return twMerge(clsx(inputs));
|
|
156
|
-
}
|
|
157
|
-
//#endregion
|
|
158
|
-
//#region \0virtual:gea-hmr
|
|
159
|
-
var hot = void 0;
|
|
160
|
-
var componentInstances = hot && hot.data && hot.data.componentInstances || /* @__PURE__ */ new Map();
|
|
161
|
-
if (hot) hot.data.componentInstances = componentInstances;
|
|
162
|
-
var hmrGlobal = globalThis.__geaHMRGlobal || (globalThis.__geaHMRGlobal = {
|
|
163
|
-
componentModules: /* @__PURE__ */ new Map(),
|
|
164
|
-
componentProxies: /* @__PURE__ */ new Map()
|
|
165
|
-
});
|
|
166
|
-
hmrGlobal.componentModules;
|
|
167
|
-
hmrGlobal.componentProxies;
|
|
168
|
-
//#endregion
|
|
169
|
-
//#region src/components/accordion.tsx
|
|
170
|
-
var Accordion = class extends ZagComponent {
|
|
171
|
-
createMachine(_props) {
|
|
172
|
-
return accordion.machine;
|
|
173
|
-
}
|
|
174
|
-
getMachineProps(props) {
|
|
175
|
-
return {
|
|
176
|
-
id: this.id,
|
|
177
|
-
value: props.value,
|
|
178
|
-
defaultValue: props.defaultValue,
|
|
179
|
-
multiple: props.multiple ?? false,
|
|
180
|
-
collapsible: props.collapsible ?? false,
|
|
181
|
-
disabled: props.disabled,
|
|
182
|
-
orientation: props.orientation ?? "vertical",
|
|
183
|
-
onValueChange: (details) => {
|
|
184
|
-
this.value = details.value;
|
|
185
|
-
props.onValueChange?.(details);
|
|
186
|
-
}
|
|
187
|
-
};
|
|
188
|
-
}
|
|
189
|
-
connectApi(service) {
|
|
190
|
-
return accordion.connect(service, normalizeProps);
|
|
191
|
-
}
|
|
192
|
-
getSpreadMap() {
|
|
193
|
-
return {
|
|
194
|
-
"[data-part=\"root\"]": "getRootProps",
|
|
195
|
-
"[data-part=\"item\"]": (api, el) => api.getItemProps({ value: el.dataset.value }),
|
|
196
|
-
"[data-part=\"item-trigger\"]": (api, el) => api.getItemTriggerProps({ value: el.dataset.value }),
|
|
197
|
-
"[data-part=\"item-content\"]": (api, el) => api.getItemContentProps({ value: el.dataset.value }),
|
|
198
|
-
"[data-part=\"item-indicator\"]": (api, el) => api.getItemIndicatorProps({ value: el.dataset.value })
|
|
199
|
-
};
|
|
200
|
-
}
|
|
201
|
-
syncState(api) {
|
|
202
|
-
this.value = api.value;
|
|
203
|
-
}
|
|
204
|
-
template(props) {
|
|
205
|
-
Component._register(ZagComponent);
|
|
206
|
-
const items = props.items || [];
|
|
207
|
-
return `<div id="${this.id}" data-part="root"${(props.class || "") == null || (props.class || "") === false ? "" : ` class="${(props.class || "").trim()}"`}>${items.map((item) => `<div data-gea-item-id="${item.value}" data-part="item"${item.value == null || item.value === false ? "" : ` data-value="${item.value}"`} class="accordion-item border-b"><h3><button data-part="item-trigger"${item.value == null || item.value === false ? "" : ` data-value="${item.value}"`} class="accordion-trigger flex w-full items-center justify-between py-4 text-sm font-medium transition-all">${item.label}<span data-part="item-indicator"${item.value == null || item.value === false ? "" : ` data-value="${item.value}"`} class="accordion-indicator h-4 w-4 shrink-0 transition-transform duration-200">▶</span></button></h3><div data-part="item-content"${item.value == null || item.value === false ? "" : ` data-value="${item.value}"`} class="accordion-content overflow-hidden text-sm"><div class="pb-4 pt-0">${item.content}</div></div></div>`).join("") + "<!---->"}</div>`;
|
|
208
|
-
}
|
|
209
|
-
render__unresolved_0Item(item) {
|
|
210
|
-
const __v = (v) => v != null && typeof v === "object" ? v.valueOf() : v;
|
|
211
|
-
return `<div data-gea-item-id="${item.value}" data-part="item"${__v(item.value) == null || __v(item.value) === false ? "" : ` data-value="${item.value}"`} class="accordion-item border-b"><h3><button data-part="item-trigger"${__v(item.value) == null || __v(item.value) === false ? "" : ` data-value="${item.value}"`} class="accordion-trigger flex w-full items-center justify-between py-4 text-sm font-medium transition-all">${item.label}<span data-part="item-indicator"${__v(item.value) == null || __v(item.value) === false ? "" : ` data-value="${item.value}"`} class="accordion-indicator h-4 w-4 shrink-0 transition-transform duration-200">▶</span></button></h3><div data-part="item-content"${__v(item.value) == null || __v(item.value) === false ? "" : ` data-value="${item.value}"`} class="accordion-content overflow-hidden text-sm"><div class="pb-4 pt-0">${item.content}</div></div></div>`;
|
|
212
|
-
}
|
|
213
|
-
create__unresolved_0Item(item) {
|
|
214
|
-
var __c = this.____unresolved_0_container;
|
|
215
|
-
if (!__c.__geaTpl) try {
|
|
216
|
-
var __tw = document.createElement("template");
|
|
217
|
-
__tw.innerHTML = this.render__unresolved_0Item({
|
|
218
|
-
value: 0,
|
|
219
|
-
label: "",
|
|
220
|
-
content: ""
|
|
221
|
-
});
|
|
222
|
-
__c.__geaTpl = __tw.content.firstElementChild;
|
|
223
|
-
} catch {}
|
|
224
|
-
if (__c.__geaTpl) var el = __c.__geaTpl.cloneNode(true);
|
|
225
|
-
else {
|
|
226
|
-
var __fw = document.createElement("template");
|
|
227
|
-
__fw.innerHTML = this.render__unresolved_0Item(item);
|
|
228
|
-
var el = __fw.content.firstElementChild;
|
|
229
|
-
}
|
|
230
|
-
var __av = item.value;
|
|
231
|
-
if (__av == null || __av === false) el.removeAttribute("data-value");
|
|
232
|
-
else el.setAttribute("data-value", String(__av));
|
|
233
|
-
var __av = item.value;
|
|
234
|
-
if (__av == null || __av === false) el.firstElementChild.firstElementChild.removeAttribute("data-value");
|
|
235
|
-
else el.firstElementChild.firstElementChild.setAttribute("data-value", String(__av));
|
|
236
|
-
var __av = item.value;
|
|
237
|
-
if (__av == null || __av === false) el.firstElementChild.firstElementChild.firstElementChild.removeAttribute("data-value");
|
|
238
|
-
else el.firstElementChild.firstElementChild.firstElementChild.setAttribute("data-value", String(__av));
|
|
239
|
-
var __av = item.value;
|
|
240
|
-
if (__av == null || __av === false) el.firstElementChild.nextElementSibling.removeAttribute("data-value");
|
|
241
|
-
else el.firstElementChild.nextElementSibling.setAttribute("data-value", String(__av));
|
|
242
|
-
el.firstElementChild.nextElementSibling.firstElementChild.textContent = `${item.content}`;
|
|
243
|
-
el.setAttribute("data-gea-item-id", item.value);
|
|
244
|
-
el.__geaItem = item;
|
|
245
|
-
return el;
|
|
246
|
-
}
|
|
247
|
-
__onPropChange(key, value) {
|
|
248
|
-
if (key === "class") try {
|
|
249
|
-
const __el = this.$(":scope");
|
|
250
|
-
this.props;
|
|
251
|
-
const __boundValue = this.props.class || "";
|
|
252
|
-
if (__el) {
|
|
253
|
-
const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
|
|
254
|
-
if (__el.className !== __newClass) __el.className = __newClass;
|
|
255
|
-
}
|
|
256
|
-
} catch {}
|
|
257
|
-
if (key === "items") this.__geaSyncMap(0);
|
|
258
|
-
}
|
|
259
|
-
__observe_local_props(__v, __c) {
|
|
260
|
-
this.__geaSyncMap(0);
|
|
261
|
-
}
|
|
262
|
-
createdHooks() {
|
|
263
|
-
if (!this.__observer_removers__) this.__observer_removers__ = [];
|
|
264
|
-
if (!this.__stores) this.__stores = {};
|
|
265
|
-
this.__observer_removers__.forEach((fn) => fn());
|
|
266
|
-
this.__observer_removers__ = [];
|
|
267
|
-
if (typeof this.__ensureArrayConfigs === "function") this.__ensureArrayConfigs();
|
|
268
|
-
this.__geaRegisterMap(0, "____unresolved_0_container", () => this.$(":scope"), () => {
|
|
269
|
-
return this.props.items || [];
|
|
270
|
-
}, (__item) => this.create__unresolved_0Item(__item), "value");
|
|
271
|
-
}
|
|
272
|
-
};
|
|
273
|
-
//#endregion
|
|
274
|
-
//#region src/components/avatar.tsx
|
|
275
|
-
var Avatar = class extends ZagComponent {
|
|
276
|
-
constructor(...args) {
|
|
277
|
-
super(...args);
|
|
278
|
-
this.loaded = false;
|
|
279
|
-
try {
|
|
280
|
-
this.props;
|
|
281
|
-
this.__geaCond_0 = !!this.props.src;
|
|
282
|
-
} catch {}
|
|
283
|
-
this.__geaRegisterCond(0, "c0", () => {
|
|
284
|
-
this.props;
|
|
285
|
-
return this.props.src;
|
|
286
|
-
}, () => {
|
|
287
|
-
const props = this.props;
|
|
288
|
-
return `<img data-part="image"${this.props.src == null || props.src === false ? "" : ` src="${this.props.src}"`}${(this.props.name || "") == null || (props.name || "") === false ? "" : ` alt="${this.props.name || ""}"`} class="avatar-image absolute inset-0 h-full w-full object-cover" />`;
|
|
289
|
-
}, () => {
|
|
290
|
-
this.props;
|
|
291
|
-
return "";
|
|
292
|
-
});
|
|
293
|
-
}
|
|
294
|
-
createMachine(_props) {
|
|
295
|
-
return avatar.machine;
|
|
296
|
-
}
|
|
297
|
-
getMachineProps(props) {
|
|
298
|
-
return {
|
|
299
|
-
id: this.id,
|
|
300
|
-
onStatusChange: props.onStatusChange
|
|
301
|
-
};
|
|
302
|
-
}
|
|
303
|
-
connectApi(service) {
|
|
304
|
-
return avatar.connect(service, normalizeProps);
|
|
305
|
-
}
|
|
306
|
-
getSpreadMap() {
|
|
307
|
-
return {
|
|
308
|
-
"[data-part=\"root\"]": "getRootProps",
|
|
309
|
-
"[data-part=\"image\"]": "getImageProps",
|
|
310
|
-
"[data-part=\"fallback\"]": "getFallbackProps"
|
|
311
|
-
};
|
|
312
|
-
}
|
|
313
|
-
syncState(api) {
|
|
314
|
-
this.loaded = api.loaded;
|
|
315
|
-
}
|
|
316
|
-
template(props) {
|
|
317
|
-
Component._register(ZagComponent);
|
|
318
|
-
const initials = props.fallback || (props.name ? props.name.split(" ").map((n) => n[0]).join("").toUpperCase() : "?");
|
|
319
|
-
return `<div id="${this.id}" data-part="root" class="${`avatar-root relative inline-flex h-10 w-10 shrink-0 overflow-hidden rounded-full ${props.class || ""}`.trim()}"><!--${this.id + "-c0"}-->${(props.src ? `<img data-part="image"${props.src == null || props.src === false ? "" : ` src="${props.src}"`}${(props.name || "") == null || (props.name || "") === false ? "" : ` alt="${props.name || ""}"`} class="avatar-image absolute inset-0 h-full w-full object-cover" />` : "") || ""}<!--${this.id + "-c0-end"}--><div id="${this.id + "-b1"}" data-part="fallback" class="${`avatar-fallback flex h-full w-full items-center justify-center rounded-full bg-muted text-muted-foreground text-sm font-medium ${props.src ? "absolute inset-0" : ""}`.trim()}">${initials}</div></div>`;
|
|
320
|
-
}
|
|
321
|
-
__onPropChange(key, value) {
|
|
322
|
-
if (key === "class") try {
|
|
323
|
-
const __el = this.$(":scope");
|
|
324
|
-
this.props;
|
|
325
|
-
const __boundValue = `avatar-root relative inline-flex h-10 w-10 shrink-0 overflow-hidden rounded-full ${this.props.class || ""}`;
|
|
326
|
-
if (__el) {
|
|
327
|
-
const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
|
|
328
|
-
if (__el.className !== __newClass) __el.className = __newClass;
|
|
329
|
-
}
|
|
330
|
-
} catch {}
|
|
331
|
-
if (key === "src") try {
|
|
332
|
-
const __el = document.getElementById(this.id + "-b1");
|
|
333
|
-
this.props;
|
|
334
|
-
const __boundValue = `avatar-fallback flex h-full w-full items-center justify-center rounded-full bg-muted text-muted-foreground text-sm font-medium ${this.props.src ? "absolute inset-0" : ""}`;
|
|
335
|
-
if (__el) {
|
|
336
|
-
const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
|
|
337
|
-
if (__el.className !== __newClass) __el.className = __newClass;
|
|
338
|
-
}
|
|
339
|
-
} catch {}
|
|
340
|
-
if (key === "fallback") try {
|
|
341
|
-
const __el = document.getElementById(this.id + "-b1");
|
|
342
|
-
this.props;
|
|
343
|
-
const __boundValue = this.props.fallback || (this.props.name ? this.props.name.split(" ").map((n) => n[0]).join("").toUpperCase() : "?");
|
|
344
|
-
if (__el) {
|
|
345
|
-
if (__el.textContent !== __boundValue) __el.textContent = __boundValue;
|
|
346
|
-
}
|
|
347
|
-
} catch {}
|
|
348
|
-
if (key === "name") try {
|
|
349
|
-
const __el = document.getElementById(this.id + "-b1");
|
|
350
|
-
this.props;
|
|
351
|
-
const __boundValue = this.props.fallback || (this.props.name ? this.props.name.split(" ").map((n) => n[0]).join("").toUpperCase() : "?");
|
|
352
|
-
if (__el) {
|
|
353
|
-
if (__el.textContent !== __boundValue) __el.textContent = __boundValue;
|
|
354
|
-
}
|
|
355
|
-
} catch {}
|
|
356
|
-
if (key === "src" || key === "name") this.__geaPatchCond(0);
|
|
357
|
-
}
|
|
358
|
-
};
|
|
359
|
-
//#endregion
|
|
360
|
-
//#region src/components/checkbox.tsx
|
|
361
|
-
var Checkbox = class extends ZagComponent {
|
|
362
|
-
constructor(...args) {
|
|
363
|
-
super(...args);
|
|
364
|
-
this.checked = false;
|
|
365
|
-
try {
|
|
366
|
-
this.props;
|
|
367
|
-
this.__geaCond_0 = !!this.props.label;
|
|
368
|
-
} catch {}
|
|
369
|
-
this.__geaRegisterCond(0, "c0", () => {
|
|
370
|
-
this.props;
|
|
371
|
-
return this.props.label;
|
|
372
|
-
}, () => {
|
|
373
|
-
this.props;
|
|
374
|
-
return `<span data-part="label" class="checkbox-label text-sm font-medium leading-none">${this.props.label}</span>`;
|
|
375
|
-
}, null);
|
|
376
|
-
}
|
|
377
|
-
createMachine(_props) {
|
|
378
|
-
return checkbox.machine;
|
|
379
|
-
}
|
|
380
|
-
getMachineProps(props) {
|
|
381
|
-
return {
|
|
382
|
-
id: this.id,
|
|
383
|
-
checked: props.checked,
|
|
384
|
-
defaultChecked: props.defaultChecked,
|
|
385
|
-
disabled: props.disabled,
|
|
386
|
-
invalid: props.invalid,
|
|
387
|
-
required: props.required,
|
|
388
|
-
readOnly: props.readOnly,
|
|
389
|
-
name: props.name,
|
|
390
|
-
form: props.form,
|
|
391
|
-
value: props.value ?? "on",
|
|
392
|
-
onCheckedChange: (details) => {
|
|
393
|
-
this.checked = details.checked;
|
|
394
|
-
props.onCheckedChange?.(details);
|
|
395
|
-
}
|
|
396
|
-
};
|
|
397
|
-
}
|
|
398
|
-
connectApi(service) {
|
|
399
|
-
return checkbox.connect(service, normalizeProps);
|
|
400
|
-
}
|
|
401
|
-
getSpreadMap() {
|
|
402
|
-
return {
|
|
403
|
-
"[data-part=\"root\"]": "getRootProps",
|
|
404
|
-
"[data-part=\"label\"]": "getLabelProps",
|
|
405
|
-
"[data-part=\"control\"]": "getControlProps",
|
|
406
|
-
"[data-part=\"indicator\"]": "getIndicatorProps",
|
|
407
|
-
"[data-part=\"hidden-input\"]": "getHiddenInputProps"
|
|
408
|
-
};
|
|
409
|
-
}
|
|
410
|
-
syncState(api) {
|
|
411
|
-
this.checked = api.checkedState;
|
|
412
|
-
}
|
|
413
|
-
template(props) {
|
|
414
|
-
Component._register(ZagComponent);
|
|
415
|
-
return `<label id="${this.id}" data-part="root" class="${`checkbox-root inline-flex items-center gap-2 cursor-pointer ${props.class || ""}`.trim()}"><input data-part="hidden-input" type="checkbox" class="sr-only" /><div data-part="control" class="checkbox-control h-4 w-4 shrink-0 rounded-sm border border-primary shadow transition-colors data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground"><span data-part="indicator" class="checkbox-indicator flex items-center justify-center text-current h-full w-full"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" class="h-3 w-3"><polyline points="20 6 9 17 4 12"></polyline></svg></span></div><!--${this.id + "-c0"}-->${props.label && `<span data-part="label" class="checkbox-label text-sm font-medium leading-none">${props.label}</span>` || ""}<!--${this.id + "-c0-end"}--></label>`;
|
|
416
|
-
}
|
|
417
|
-
__onPropChange(key, value) {
|
|
418
|
-
if (key === "class") try {
|
|
419
|
-
const __el = this.$(":scope");
|
|
420
|
-
this.props;
|
|
421
|
-
const __boundValue = `checkbox-root inline-flex items-center gap-2 cursor-pointer ${this.props.class || ""}`;
|
|
422
|
-
if (__el) {
|
|
423
|
-
const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
|
|
424
|
-
if (__el.className !== __newClass) __el.className = __newClass;
|
|
425
|
-
}
|
|
426
|
-
} catch {}
|
|
427
|
-
if (key === "label") this.__geaPatchCond(0);
|
|
428
|
-
}
|
|
429
|
-
};
|
|
430
|
-
//#endregion
|
|
431
|
-
//#region src/components/clipboard.tsx
|
|
432
|
-
var Clipboard = class extends ZagComponent {
|
|
433
|
-
constructor(...args) {
|
|
434
|
-
super(...args);
|
|
435
|
-
this.copied = false;
|
|
436
|
-
try {
|
|
437
|
-
this.props;
|
|
438
|
-
this.__geaCond_0 = !!this.copied;
|
|
439
|
-
this.__geaCond_1 = !!this.props.label;
|
|
440
|
-
} catch {}
|
|
441
|
-
this.__geaRegisterCond(0, "c0", () => {
|
|
442
|
-
this.props;
|
|
443
|
-
return this.copied;
|
|
444
|
-
}, () => {
|
|
445
|
-
this.props;
|
|
446
|
-
return `<span data-part="indicator-copied">✓ Copied</span>`;
|
|
447
|
-
}, () => {
|
|
448
|
-
this.props;
|
|
449
|
-
return `<span data-part="indicator-not-copied">Copy</span>`;
|
|
450
|
-
});
|
|
451
|
-
this.__geaRegisterCond(1, "c1", () => {
|
|
452
|
-
this.props;
|
|
453
|
-
return this.props.label;
|
|
454
|
-
}, () => {
|
|
455
|
-
this.props;
|
|
456
|
-
return `<label data-part="label" class="clipboard-label text-sm font-medium mb-1 block">${this.props.label}</label>`;
|
|
457
|
-
}, null);
|
|
458
|
-
}
|
|
459
|
-
createMachine(_props) {
|
|
460
|
-
return clipboard.machine;
|
|
461
|
-
}
|
|
462
|
-
getMachineProps(props) {
|
|
463
|
-
return {
|
|
464
|
-
id: this.id,
|
|
465
|
-
value: props.value,
|
|
466
|
-
defaultValue: props.defaultValue,
|
|
467
|
-
timeout: props.timeout ?? 2e3,
|
|
468
|
-
onStatusChange: (details) => {
|
|
469
|
-
this.copied = details.copied;
|
|
470
|
-
props.onStatusChange?.(details);
|
|
471
|
-
}
|
|
472
|
-
};
|
|
473
|
-
}
|
|
474
|
-
connectApi(service) {
|
|
475
|
-
return clipboard.connect(service, normalizeProps);
|
|
476
|
-
}
|
|
477
|
-
getSpreadMap() {
|
|
478
|
-
return {
|
|
479
|
-
"[data-part=\"root\"]": "getRootProps",
|
|
480
|
-
"[data-part=\"label\"]": "getLabelProps",
|
|
481
|
-
"[data-part=\"control\"]": "getControlProps",
|
|
482
|
-
"[data-part=\"trigger\"]": "getTriggerProps",
|
|
483
|
-
"[data-part=\"input\"]": "getInputProps",
|
|
484
|
-
"[data-part=\"indicator-copied\"]": (api) => api.getIndicatorProps({ copied: true }),
|
|
485
|
-
"[data-part=\"indicator-not-copied\"]": (api) => api.getIndicatorProps({ copied: false })
|
|
486
|
-
};
|
|
487
|
-
}
|
|
488
|
-
syncState(api) {
|
|
489
|
-
this.copied = api.copied;
|
|
490
|
-
}
|
|
491
|
-
template(props) {
|
|
492
|
-
Component._register(ZagComponent);
|
|
493
|
-
return `<div id="${this.id}" data-part="root"${(props.class || "") == null || (props.class || "") === false ? "" : ` class="${(props.class || "").trim()}"`}><!--${this.id + "-c1"}-->${props.label && `<label data-part="label" class="clipboard-label text-sm font-medium mb-1 block">${props.label}</label>` || ""}<!--${this.id + "-c1-end"}--><div data-part="control" class="clipboard-control flex gap-2"><input data-part="input" class="clipboard-input flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm" /><button data-part="trigger" class="clipboard-trigger inline-flex h-9 items-center justify-center rounded-md border border-input bg-background px-3 text-sm shadow-sm hover:bg-accent"><!--${this.id + "-c0"}-->${(this.copied ? `<span data-part="indicator-copied">✓ Copied</span>` : `<span data-part="indicator-not-copied">Copy</span>`) || ""}<!--${this.id + "-c0-end"}--></button></div></div>`;
|
|
494
|
-
}
|
|
495
|
-
__onPropChange(key, value) {
|
|
496
|
-
if (key === "class") try {
|
|
497
|
-
const __el = this.$(":scope");
|
|
498
|
-
this.props;
|
|
499
|
-
const __boundValue = this.props.class || "";
|
|
500
|
-
if (__el) {
|
|
501
|
-
const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
|
|
502
|
-
if (__el.className !== __newClass) __el.className = __newClass;
|
|
503
|
-
}
|
|
504
|
-
} catch {}
|
|
505
|
-
this.__geaPatchCond(0);
|
|
506
|
-
if (key === "label") this.__geaPatchCond(1);
|
|
507
|
-
}
|
|
508
|
-
__observe_local_copied(value, change) {
|
|
509
|
-
if (this.rendered_) {
|
|
510
|
-
this.__geaCondPatched_0 = this.__geaPatchCond(0);
|
|
511
|
-
if (this.__geaCondPatched_0) return;
|
|
512
|
-
}
|
|
513
|
-
}
|
|
514
|
-
__setupLocalStateObservers() {
|
|
515
|
-
if (typeof this.__ensureArrayConfigs === "function") this.__ensureArrayConfigs();
|
|
516
|
-
if (!this.__store) return;
|
|
517
|
-
this.__observer_removers__.push(this.__store.observe(["copied"], (__v, __c) => {
|
|
518
|
-
try {
|
|
519
|
-
this.__observe_local_copied(__v, __c);
|
|
520
|
-
} catch (_e) {}
|
|
521
|
-
}));
|
|
522
|
-
}
|
|
523
|
-
};
|
|
524
|
-
//#endregion
|
|
525
|
-
//#region src/components/collapsible.tsx
|
|
526
|
-
var Collapsible = class extends ZagComponent {
|
|
527
|
-
createMachine(_props) {
|
|
528
|
-
return collapsible.machine;
|
|
529
|
-
}
|
|
530
|
-
getMachineProps(props) {
|
|
531
|
-
return {
|
|
532
|
-
id: this.id,
|
|
533
|
-
open: props.open,
|
|
534
|
-
defaultOpen: props.defaultOpen,
|
|
535
|
-
disabled: props.disabled,
|
|
536
|
-
onOpenChange: (details) => {
|
|
537
|
-
this.open = details.open;
|
|
538
|
-
props.onOpenChange?.(details);
|
|
539
|
-
}
|
|
540
|
-
};
|
|
541
|
-
}
|
|
542
|
-
connectApi(service) {
|
|
543
|
-
return collapsible.connect(service, normalizeProps);
|
|
544
|
-
}
|
|
545
|
-
getSpreadMap() {
|
|
546
|
-
return {
|
|
547
|
-
"[data-part=\"root\"]": "getRootProps",
|
|
548
|
-
"[data-part=\"trigger\"]": "getTriggerProps",
|
|
549
|
-
"[data-part=\"content\"]": "getContentProps"
|
|
550
|
-
};
|
|
551
|
-
}
|
|
552
|
-
syncState(api) {
|
|
553
|
-
this.open = api.open;
|
|
554
|
-
}
|
|
555
|
-
template(props) {
|
|
556
|
-
Component._register(ZagComponent);
|
|
557
|
-
return `<div id="${this.id}" data-part="root"${(props.class || "") == null || (props.class || "") === false ? "" : ` class="${(props.class || "").trim()}"`}><button id="${this.id + "-b1"}" data-part="trigger" class="collapsible-trigger flex w-full items-center justify-between py-2 text-sm font-medium">${props.label || "Toggle"}</button><div data-part="content" class="collapsible-content overflow-hidden"><div id="${this.id + "-b2"}" class="pb-4">${props.children}</div></div></div>`;
|
|
558
|
-
}
|
|
559
|
-
__onPropChange(key, value) {
|
|
560
|
-
if (key === "class") try {
|
|
561
|
-
const __el = this.$(":scope");
|
|
562
|
-
this.props;
|
|
563
|
-
const __boundValue = this.props.class || "";
|
|
564
|
-
if (__el) {
|
|
565
|
-
const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
|
|
566
|
-
if (__el.className !== __newClass) __el.className = __newClass;
|
|
567
|
-
}
|
|
568
|
-
} catch {}
|
|
569
|
-
if (key === "label") try {
|
|
570
|
-
const __el = document.getElementById(this.id + "-b1");
|
|
571
|
-
this.props;
|
|
572
|
-
const __boundValue = this.props.label || "Toggle";
|
|
573
|
-
if (__el) {
|
|
574
|
-
if (__el.textContent !== __boundValue) __el.textContent = __boundValue;
|
|
575
|
-
}
|
|
576
|
-
} catch {}
|
|
577
|
-
if (key === "children") try {
|
|
578
|
-
const __el = document.getElementById(this.id + "-b2");
|
|
579
|
-
if (__el) {
|
|
580
|
-
if (__el.innerHTML !== value) {
|
|
581
|
-
__el.innerHTML = value;
|
|
582
|
-
this.instantiateChildComponents_();
|
|
583
|
-
if (this.parentComponent) this.parentComponent.mountCompiledChildComponents_();
|
|
584
|
-
}
|
|
585
|
-
}
|
|
586
|
-
} catch {}
|
|
587
|
-
}
|
|
588
|
-
};
|
|
589
|
-
//#endregion
|
|
590
|
-
//#region src/components/combobox.tsx
|
|
591
|
-
var Combobox = class extends ZagComponent {
|
|
592
|
-
constructor(...args) {
|
|
593
|
-
super(...args);
|
|
594
|
-
try {
|
|
595
|
-
this.props;
|
|
596
|
-
this.__geaCond_0 = !!this.props.label;
|
|
597
|
-
} catch {}
|
|
598
|
-
this.__geaRegisterCond(0, "c0", () => {
|
|
599
|
-
this.props;
|
|
600
|
-
return this.props.label;
|
|
601
|
-
}, () => {
|
|
602
|
-
this.props;
|
|
603
|
-
return `<label data-part="label" class="combobox-label text-sm font-medium mb-1 block">${this.props.label}</label>`;
|
|
604
|
-
}, null);
|
|
605
|
-
}
|
|
606
|
-
created(props) {
|
|
607
|
-
this._allItems = props.items || [];
|
|
608
|
-
this.filteredItems = [...this._allItems];
|
|
609
|
-
super.created(props);
|
|
610
|
-
}
|
|
611
|
-
createMachine(_props) {
|
|
612
|
-
return combobox.machine;
|
|
613
|
-
}
|
|
614
|
-
_buildCollection(items) {
|
|
615
|
-
return combobox.collection({
|
|
616
|
-
items,
|
|
617
|
-
itemToValue: (item) => item.value,
|
|
618
|
-
itemToString: (item) => item.label || item.value
|
|
619
|
-
});
|
|
620
|
-
}
|
|
621
|
-
_filterItems(query) {
|
|
622
|
-
const q = query.toLowerCase();
|
|
623
|
-
const filtered = q ? this._allItems.filter((item) => (item.label || item.value).toLowerCase().includes(q)) : [...this._allItems];
|
|
624
|
-
this.filteredItems = filtered;
|
|
625
|
-
this._machine?.updateProps({ collection: this._buildCollection(filtered) });
|
|
626
|
-
}
|
|
627
|
-
getMachineProps(props) {
|
|
628
|
-
const col = props.collection || this._buildCollection(this._allItems);
|
|
629
|
-
return {
|
|
630
|
-
id: this.id,
|
|
631
|
-
collection: col,
|
|
632
|
-
value: props.value,
|
|
633
|
-
defaultValue: props.defaultValue,
|
|
634
|
-
inputValue: props.inputValue,
|
|
635
|
-
defaultInputValue: props.defaultInputValue,
|
|
636
|
-
open: props.open,
|
|
637
|
-
defaultOpen: props.defaultOpen,
|
|
638
|
-
multiple: props.multiple,
|
|
639
|
-
disabled: props.disabled,
|
|
640
|
-
readOnly: props.readOnly,
|
|
641
|
-
invalid: props.invalid,
|
|
642
|
-
required: props.required,
|
|
643
|
-
placeholder: props.placeholder,
|
|
644
|
-
inputBehavior: props.inputBehavior ?? "none",
|
|
645
|
-
selectionBehavior: props.selectionBehavior ?? "replace",
|
|
646
|
-
closeOnSelect: props.closeOnSelect ?? true,
|
|
647
|
-
allowCustomValue: props.allowCustomValue,
|
|
648
|
-
loopFocus: props.loopFocus ?? true,
|
|
649
|
-
openOnClick: props.openOnClick ?? false,
|
|
650
|
-
name: props.name,
|
|
651
|
-
form: props.form,
|
|
652
|
-
positioning: props.positioning,
|
|
653
|
-
onValueChange: (details) => {
|
|
654
|
-
this.value = details.value;
|
|
655
|
-
props.onValueChange?.(details);
|
|
656
|
-
},
|
|
657
|
-
onInputValueChange: (details) => {
|
|
658
|
-
this.inputValue = details.inputValue;
|
|
659
|
-
this._filterItems(details.inputValue);
|
|
660
|
-
props.onInputValueChange?.(details);
|
|
661
|
-
},
|
|
662
|
-
onOpenChange: (details) => {
|
|
663
|
-
this.open = details.open;
|
|
664
|
-
props.onOpenChange?.(details);
|
|
665
|
-
}
|
|
666
|
-
};
|
|
667
|
-
}
|
|
668
|
-
connectApi(service) {
|
|
669
|
-
return combobox.connect(service, normalizeProps);
|
|
670
|
-
}
|
|
671
|
-
getSpreadMap() {
|
|
672
|
-
return {
|
|
673
|
-
"[data-part=\"root\"]": "getRootProps",
|
|
674
|
-
"[data-part=\"label\"]": "getLabelProps",
|
|
675
|
-
"[data-part=\"control\"]": "getControlProps",
|
|
676
|
-
"[data-part=\"input\"]": "getInputProps",
|
|
677
|
-
"[data-part=\"trigger\"]": "getTriggerProps",
|
|
678
|
-
"[data-part=\"clear-trigger\"]": "getClearTriggerProps",
|
|
679
|
-
"[data-part=\"positioner\"]": "getPositionerProps",
|
|
680
|
-
"[data-part=\"content\"]": "getContentProps",
|
|
681
|
-
"[data-part=\"list\"]": "getListProps",
|
|
682
|
-
"[data-part=\"item\"]": (api, el) => {
|
|
683
|
-
const value = el.dataset.value;
|
|
684
|
-
const label = el.dataset.label || value;
|
|
685
|
-
return api.getItemProps({ item: {
|
|
686
|
-
value,
|
|
687
|
-
label
|
|
688
|
-
} });
|
|
689
|
-
},
|
|
690
|
-
"[data-part=\"item-text\"]": (api, el) => {
|
|
691
|
-
const value = el.dataset.value;
|
|
692
|
-
const label = el.dataset.label || value;
|
|
693
|
-
return api.getItemTextProps({ item: {
|
|
694
|
-
value,
|
|
695
|
-
label
|
|
696
|
-
} });
|
|
697
|
-
},
|
|
698
|
-
"[data-part=\"item-indicator\"]": (api, el) => {
|
|
699
|
-
const value = el.dataset.value;
|
|
700
|
-
const label = el.dataset.label || value;
|
|
701
|
-
return api.getItemIndicatorProps({ item: {
|
|
702
|
-
value,
|
|
703
|
-
label
|
|
704
|
-
} });
|
|
705
|
-
}
|
|
706
|
-
};
|
|
707
|
-
}
|
|
708
|
-
syncState(api) {
|
|
709
|
-
this.open = api.open;
|
|
710
|
-
this.value = api.value;
|
|
711
|
-
this.inputValue = api.inputValue;
|
|
712
|
-
}
|
|
713
|
-
template(props) {
|
|
714
|
-
Component._register(ZagComponent);
|
|
715
|
-
return `<div id="${this.id}" data-part="root"${(props.class || "") == null || (props.class || "") === false ? "" : ` class="${(props.class || "").trim()}"`}><!--${this.id + "-c0"}-->${props.label && `<label data-part="label" class="combobox-label text-sm font-medium mb-1 block">${props.label}</label>` || ""}<!--${this.id + "-c0-end"}--><div data-part="control" class="combobox-control flex"><input data-part="input" class="combobox-input flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring" /><button data-part="trigger" class="combobox-trigger inline-flex h-9 items-center justify-center rounded-r-md border border-l-0 border-input px-2">▼</button></div><div data-part="positioner" class="combobox-positioner"><div data-part="content" class="combobox-content z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md"><div id="${this.id + "-b1"}" data-part="list">${this.filteredItems.map((item) => this.renderFilteredItemsItem(item)).join("")}</div></div></div></div>`;
|
|
716
|
-
}
|
|
717
|
-
__onPropChange(key, value) {
|
|
718
|
-
if (key === "class") try {
|
|
719
|
-
const __el = this.$(":scope");
|
|
720
|
-
this.props;
|
|
721
|
-
const __boundValue = this.props.class || "";
|
|
722
|
-
if (__el) {
|
|
723
|
-
const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
|
|
724
|
-
if (__el.className !== __newClass) __el.className = __newClass;
|
|
725
|
-
}
|
|
726
|
-
} catch {}
|
|
727
|
-
if (key === "label") this.__geaPatchCond(0);
|
|
728
|
-
}
|
|
729
|
-
renderFilteredItemsItem(item) {
|
|
730
|
-
const __v = (v) => v != null && typeof v === "object" ? v.valueOf() : v;
|
|
731
|
-
return `<div id="${this.id + "-b1-" + String(item.value)}" data-gea-item-id="${item.value}" data-part="item"${__v(item.value) == null || __v(item.value) === false ? "" : ` data-value="${item.value}"`}${__v(item.label) == null || __v(item.label) === false ? "" : ` data-label="${item.label}"`} class="combobox-item relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground"><span data-part="item-text"${__v(item.value) == null || __v(item.value) === false ? "" : ` data-value="${item.value}"`}${__v(item.label) == null || __v(item.label) === false ? "" : ` data-label="${item.label}"`}>${item.label}</span><span data-part="item-indicator"${__v(item.value) == null || __v(item.value) === false ? "" : ` data-value="${item.value}"`}${__v(item.label) == null || __v(item.label) === false ? "" : ` data-label="${item.label}"`} class="combobox-item-indicator ml-auto">✓</span></div>`;
|
|
732
|
-
}
|
|
733
|
-
createFilteredItemsItem(item) {
|
|
734
|
-
var __c = this.__filteredItems_container;
|
|
735
|
-
if (!__c.__geaTpl) try {
|
|
736
|
-
var __tw = document.createElement("template");
|
|
737
|
-
__tw.innerHTML = this.renderFilteredItemsItem({
|
|
738
|
-
value: 0,
|
|
739
|
-
label: ""
|
|
740
|
-
});
|
|
741
|
-
__c.__geaTpl = __tw.content.firstElementChild;
|
|
742
|
-
} catch {}
|
|
743
|
-
if (!__c.__geaIdPfx) __c.__geaIdPfx = this.id_ + "-b1-";
|
|
744
|
-
if (__c.__geaTpl) var el = __c.__geaTpl.cloneNode(true);
|
|
745
|
-
else {
|
|
746
|
-
var __fw = document.createElement("template");
|
|
747
|
-
__fw.innerHTML = this.renderFilteredItemsItem(item);
|
|
748
|
-
var el = __fw.content.firstElementChild;
|
|
749
|
-
}
|
|
750
|
-
var __av = item.value;
|
|
751
|
-
if (__av == null || __av === false) el.removeAttribute("data-value");
|
|
752
|
-
else el.setAttribute("data-value", String(__av));
|
|
753
|
-
var __av = item.label;
|
|
754
|
-
if (__av == null || __av === false) el.removeAttribute("data-label");
|
|
755
|
-
else el.setAttribute("data-label", String(__av));
|
|
756
|
-
var __av = item.value;
|
|
757
|
-
if (__av == null || __av === false) el.firstElementChild.removeAttribute("data-value");
|
|
758
|
-
else el.firstElementChild.setAttribute("data-value", String(__av));
|
|
759
|
-
var __av = item.label;
|
|
760
|
-
if (__av == null || __av === false) el.firstElementChild.removeAttribute("data-label");
|
|
761
|
-
else el.firstElementChild.setAttribute("data-label", String(__av));
|
|
762
|
-
el.firstElementChild.textContent = `
|
|
763
|
-
${item.label}
|
|
764
|
-
`;
|
|
765
|
-
var __av = item.value;
|
|
766
|
-
if (__av == null || __av === false) el.firstElementChild.nextElementSibling.removeAttribute("data-value");
|
|
767
|
-
else el.firstElementChild.nextElementSibling.setAttribute("data-value", String(__av));
|
|
768
|
-
var __av = item.label;
|
|
769
|
-
if (__av == null || __av === false) el.firstElementChild.nextElementSibling.removeAttribute("data-label");
|
|
770
|
-
else el.firstElementChild.nextElementSibling.setAttribute("data-label", String(__av));
|
|
771
|
-
el.setAttribute("data-gea-item-id", item.value);
|
|
772
|
-
el.id = __c.__geaIdPfx + item.value;
|
|
773
|
-
el.__geaItem = item;
|
|
774
|
-
return el;
|
|
775
|
-
}
|
|
776
|
-
__observe_local_filteredItems(filteredItems, change) {
|
|
777
|
-
if (!this.__filteredItems_container) this.__filteredItems_container = document.getElementById(this.id + "-b1");
|
|
778
|
-
if (!this.__filteredItems_container) return;
|
|
779
|
-
if (Array.isArray(filteredItems) && filteredItems.length === 0 && this.__filteredItems_container.children.length > 0) {
|
|
780
|
-
this.__filteredItems_container.textContent = "";
|
|
781
|
-
return;
|
|
782
|
-
}
|
|
783
|
-
if (typeof this.__ensureArrayConfigs === "function") this.__ensureArrayConfigs();
|
|
784
|
-
this.__applyListChanges(this.__filteredItems_container, filteredItems, change, this.__filteredItemsListConfig);
|
|
785
|
-
}
|
|
786
|
-
__ensureArrayConfigs() {
|
|
787
|
-
if (!this.__filteredItemsListConfig) this.__filteredItemsListConfig = {
|
|
788
|
-
arrayPathParts: ["filteredItems"],
|
|
789
|
-
render: (item) => this.renderFilteredItemsItem(item),
|
|
790
|
-
create: (item) => this.createFilteredItemsItem(item),
|
|
791
|
-
propPatchers: {
|
|
792
|
-
"value": [
|
|
793
|
-
(row, value, item) => {
|
|
794
|
-
const __target = row;
|
|
795
|
-
if (!__target) return;
|
|
796
|
-
const __attrValue = item.value;
|
|
797
|
-
if (__attrValue == null || __attrValue === false) __target.removeAttribute("data-value");
|
|
798
|
-
else __target.setAttribute("data-value", String(__attrValue));
|
|
799
|
-
},
|
|
800
|
-
(row, value, item) => {
|
|
801
|
-
const __target = row.firstElementChild;
|
|
802
|
-
if (!__target) return;
|
|
803
|
-
const __attrValue = item.value;
|
|
804
|
-
if (__attrValue == null || __attrValue === false) __target.removeAttribute("data-value");
|
|
805
|
-
else __target.setAttribute("data-value", String(__attrValue));
|
|
806
|
-
},
|
|
807
|
-
(row, value, item) => {
|
|
808
|
-
const __target = row.firstElementChild.nextElementSibling;
|
|
809
|
-
if (!__target) return;
|
|
810
|
-
const __attrValue = item.value;
|
|
811
|
-
if (__attrValue == null || __attrValue === false) __target.removeAttribute("data-value");
|
|
812
|
-
else __target.setAttribute("data-value", String(__attrValue));
|
|
813
|
-
},
|
|
814
|
-
(row, value) => row.classList.toggle("value", value),
|
|
815
|
-
(row, value) => row.classList.toggle("value", value),
|
|
816
|
-
(row, value) => row.classList.toggle("value", value),
|
|
817
|
-
(row, value) => row.classList.toggle("value", value)
|
|
818
|
-
],
|
|
819
|
-
"label": [
|
|
820
|
-
(row, value, item) => {
|
|
821
|
-
const __target = row;
|
|
822
|
-
if (!__target) return;
|
|
823
|
-
const __attrValue = item.label;
|
|
824
|
-
if (__attrValue == null || __attrValue === false) __target.removeAttribute("data-label");
|
|
825
|
-
else __target.setAttribute("data-label", String(__attrValue));
|
|
826
|
-
},
|
|
827
|
-
(row, value, item) => {
|
|
828
|
-
const __target = row.firstElementChild;
|
|
829
|
-
if (!__target) return;
|
|
830
|
-
const __attrValue = item.label;
|
|
831
|
-
if (__attrValue == null || __attrValue === false) __target.removeAttribute("data-label");
|
|
832
|
-
else __target.setAttribute("data-label", String(__attrValue));
|
|
833
|
-
},
|
|
834
|
-
(row, value, item) => {
|
|
835
|
-
const __target = row.firstElementChild;
|
|
836
|
-
if (!__target) return;
|
|
837
|
-
__target.firstChild && (__target.firstChild.nodeValue = `
|
|
838
|
-
${item.label}
|
|
839
|
-
`) || (__target.textContent = `
|
|
840
|
-
${item.label}
|
|
841
|
-
`);
|
|
842
|
-
},
|
|
843
|
-
(row, value, item) => {
|
|
844
|
-
const __target = row.firstElementChild.nextElementSibling;
|
|
845
|
-
if (!__target) return;
|
|
846
|
-
const __attrValue = item.label;
|
|
847
|
-
if (__attrValue == null || __attrValue === false) __target.removeAttribute("data-label");
|
|
848
|
-
else __target.setAttribute("data-label", String(__attrValue));
|
|
849
|
-
},
|
|
850
|
-
(row, value) => row.classList.toggle("label", value),
|
|
851
|
-
(row, value) => row.classList.toggle("label", value),
|
|
852
|
-
(row, value) => row.classList.toggle("label", value)
|
|
853
|
-
]
|
|
854
|
-
}
|
|
855
|
-
};
|
|
856
|
-
}
|
|
857
|
-
__setupLocalStateObservers() {
|
|
858
|
-
if (typeof this.__ensureArrayConfigs === "function") this.__ensureArrayConfigs();
|
|
859
|
-
if (!this.__store) return;
|
|
860
|
-
this.__observer_removers__.push(this.__store.observe(["filteredItems"], (__v, __c) => {
|
|
861
|
-
try {
|
|
862
|
-
this.__observe_local_filteredItems(__v, __c);
|
|
863
|
-
} catch (_e) {}
|
|
864
|
-
}));
|
|
865
|
-
}
|
|
866
|
-
};
|
|
867
|
-
//#endregion
|
|
868
|
-
//#region src/components/dialog.tsx
|
|
869
|
-
var Dialog = class extends ZagComponent {
|
|
870
|
-
constructor(...args) {
|
|
871
|
-
super(...args);
|
|
872
|
-
try {
|
|
873
|
-
this.props;
|
|
874
|
-
this.__geaCond_0 = !!this.props.title;
|
|
875
|
-
this.__geaCond_1 = !!this.props.description;
|
|
876
|
-
this.__geaCond_2 = !!this.props.triggerLabel;
|
|
877
|
-
} catch {}
|
|
878
|
-
this.__geaRegisterCond(0, "c0", () => {
|
|
879
|
-
this.props;
|
|
880
|
-
return this.props.title;
|
|
881
|
-
}, () => {
|
|
882
|
-
this.props;
|
|
883
|
-
return `<h2 data-part="title" class="dialog-title text-lg font-semibold mb-2">${this.props.title}</h2>`;
|
|
884
|
-
}, null);
|
|
885
|
-
this.__geaRegisterCond(1, "c1", () => {
|
|
886
|
-
this.props;
|
|
887
|
-
return this.props.description;
|
|
888
|
-
}, () => {
|
|
889
|
-
this.props;
|
|
890
|
-
return `<p data-part="description" class="dialog-description text-sm text-gray-500 mb-4">${this.props.description}</p>`;
|
|
891
|
-
}, null);
|
|
892
|
-
this.__geaRegisterCond(2, "c2", () => {
|
|
893
|
-
this.props;
|
|
894
|
-
return this.props.triggerLabel;
|
|
895
|
-
}, () => {
|
|
896
|
-
this.props;
|
|
897
|
-
return `<button data-part="trigger" class="dialog-trigger">${this.props.triggerLabel}</button>`;
|
|
898
|
-
}, null);
|
|
899
|
-
}
|
|
900
|
-
createMachine(_props) {
|
|
901
|
-
return dialog.machine;
|
|
902
|
-
}
|
|
903
|
-
getMachineProps(props) {
|
|
904
|
-
return {
|
|
905
|
-
id: this.id,
|
|
906
|
-
open: props.open,
|
|
907
|
-
defaultOpen: props.defaultOpen,
|
|
908
|
-
modal: props.modal ?? true,
|
|
909
|
-
closeOnInteractOutside: props.closeOnInteractOutside ?? true,
|
|
910
|
-
closeOnEscape: props.closeOnEscape ?? true,
|
|
911
|
-
trapFocus: props.trapFocus ?? true,
|
|
912
|
-
preventScroll: props.preventScroll ?? true,
|
|
913
|
-
role: props.role ?? "dialog",
|
|
914
|
-
"aria-label": props["aria-label"],
|
|
915
|
-
onOpenChange: (details) => {
|
|
916
|
-
this.open = details.open;
|
|
917
|
-
props.onOpenChange?.(details);
|
|
918
|
-
}
|
|
919
|
-
};
|
|
920
|
-
}
|
|
921
|
-
connectApi(service) {
|
|
922
|
-
return dialog.connect(service, normalizeProps);
|
|
923
|
-
}
|
|
924
|
-
getSpreadMap() {
|
|
925
|
-
return {
|
|
926
|
-
"[data-part=\"backdrop\"]": "getBackdropProps",
|
|
927
|
-
"[data-part=\"positioner\"]": (api) => ({
|
|
928
|
-
...api.getPositionerProps(),
|
|
929
|
-
hidden: !api.open
|
|
930
|
-
}),
|
|
931
|
-
"[data-part=\"content\"]": "getContentProps",
|
|
932
|
-
"[data-part=\"title\"]": "getTitleProps",
|
|
933
|
-
"[data-part=\"description\"]": "getDescriptionProps",
|
|
934
|
-
"[data-part=\"close-trigger\"]": (api) => {
|
|
935
|
-
const { id: _, ...props } = api.getCloseTriggerProps();
|
|
936
|
-
return {
|
|
937
|
-
...props,
|
|
938
|
-
onclick: (e) => {
|
|
939
|
-
if (e.defaultPrevented) return;
|
|
940
|
-
api.setOpen(false);
|
|
941
|
-
}
|
|
942
|
-
};
|
|
943
|
-
},
|
|
944
|
-
"[data-part=\"trigger\"]": (api) => {
|
|
945
|
-
const props = api.getTriggerProps();
|
|
946
|
-
const origOnClick = props.onclick;
|
|
947
|
-
const preventTriggerFocus = (e) => {
|
|
948
|
-
if ("button" in e && e.button !== 0) return;
|
|
949
|
-
e.preventDefault();
|
|
950
|
-
};
|
|
951
|
-
return {
|
|
952
|
-
...props,
|
|
953
|
-
onpointerdown: preventTriggerFocus,
|
|
954
|
-
onmousedown: preventTriggerFocus,
|
|
955
|
-
onclick: (e) => {
|
|
956
|
-
e.currentTarget?.blur();
|
|
957
|
-
origOnClick?.(e);
|
|
958
|
-
}
|
|
959
|
-
};
|
|
960
|
-
}
|
|
961
|
-
};
|
|
962
|
-
}
|
|
963
|
-
syncState(api) {
|
|
964
|
-
this.open = api.open;
|
|
965
|
-
}
|
|
966
|
-
template(props) {
|
|
967
|
-
Component._register(ZagComponent);
|
|
968
|
-
return `<div id="${this.id}"${(props.class || "") == null || (props.class || "") === false ? "" : ` class="${(props.class || "").trim()}"`}><!--${this.id + "-c2"}-->${props.triggerLabel && `<button data-part="trigger" class="dialog-trigger">${props.triggerLabel}</button>` || ""}<!--${this.id + "-c2-end"}--><div data-part="backdrop" class="dialog-backdrop fixed inset-0 bg-black/50 z-50" hidden></div><div data-part="positioner" class="dialog-positioner fixed inset-0 flex items-center justify-center z-50" hidden><div data-part="content" class="dialog-content bg-white rounded-lg shadow-xl p-6 w-full max-w-md mx-4"><!--${this.id + "-c0"}-->${props.title && `<h2 data-part="title" class="dialog-title text-lg font-semibold mb-2">${props.title}</h2>` || ""}<!--${this.id + "-c0-end"}--><!--${this.id + "-c1"}-->${props.description && `<p data-part="description" class="dialog-description text-sm text-gray-500 mb-4">${props.description}</p>` || ""}<!--${this.id + "-c1-end"}--><div id="${this.id + "-b1"}" class="dialog-body">${props.children}</div><button data-part="close-trigger" class="dialog-close-trigger absolute top-3 right-3 text-gray-400 hover:text-gray-600">✕</button></div></div></div>`;
|
|
969
|
-
}
|
|
970
|
-
__onPropChange(key, value) {
|
|
971
|
-
if (key === "class") try {
|
|
972
|
-
const __el = this.$(":scope");
|
|
973
|
-
this.props;
|
|
974
|
-
const __boundValue = this.props.class || "";
|
|
975
|
-
if (__el) {
|
|
976
|
-
const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
|
|
977
|
-
if (__el.className !== __newClass) __el.className = __newClass;
|
|
978
|
-
}
|
|
979
|
-
} catch {}
|
|
980
|
-
if (key === "children") try {
|
|
981
|
-
const __el = document.getElementById(this.id + "-b1");
|
|
982
|
-
if (__el) {
|
|
983
|
-
if (__el.innerHTML !== value) {
|
|
984
|
-
__el.innerHTML = value;
|
|
985
|
-
this.instantiateChildComponents_();
|
|
986
|
-
if (this.parentComponent) this.parentComponent.mountCompiledChildComponents_();
|
|
987
|
-
}
|
|
988
|
-
}
|
|
989
|
-
} catch {}
|
|
990
|
-
if (key === "title") this.__geaPatchCond(0);
|
|
991
|
-
if (key === "description") this.__geaPatchCond(1);
|
|
992
|
-
if (key === "triggerLabel") this.__geaPatchCond(2);
|
|
993
|
-
}
|
|
994
|
-
};
|
|
995
|
-
//#endregion
|
|
996
|
-
//#region src/components/file-upload.tsx
|
|
997
|
-
var FileUpload = class extends ZagComponent {
|
|
998
|
-
constructor(...args) {
|
|
999
|
-
super(...args);
|
|
1000
|
-
try {
|
|
1001
|
-
this.props;
|
|
1002
|
-
this.__geaCond_0 = !!this.props.label;
|
|
1003
|
-
this.__geaCond_1 = !!(this.acceptedFiles.length > 0);
|
|
1004
|
-
} catch {}
|
|
1005
|
-
this.__geaRegisterCond(0, "c0", () => {
|
|
1006
|
-
this.props;
|
|
1007
|
-
return this.props.label;
|
|
1008
|
-
}, () => {
|
|
1009
|
-
this.props;
|
|
1010
|
-
return `<label data-part="label" class="file-upload-label text-sm font-medium mb-2 block">${this.props.label}</label>`;
|
|
1011
|
-
}, null);
|
|
1012
|
-
this.__geaRegisterCond(1, "c1", () => {
|
|
1013
|
-
this.props;
|
|
1014
|
-
return this.acceptedFiles.length > 0;
|
|
1015
|
-
}, () => {
|
|
1016
|
-
this.props;
|
|
1017
|
-
return `<div class="file-upload-file-list mt-3 space-y-1">${this.acceptedFiles.map((file) => this.renderAcceptedFilesItem(file)).join("")}<button data-part="clear-trigger" class="file-upload-clear text-xs text-muted-foreground hover:text-foreground mt-1">Clear all</button></div>`;
|
|
1018
|
-
}, null);
|
|
1019
|
-
}
|
|
1020
|
-
createMachine(_props) {
|
|
1021
|
-
return fileUpload.machine;
|
|
1022
|
-
}
|
|
1023
|
-
getMachineProps(props) {
|
|
1024
|
-
return {
|
|
1025
|
-
id: this.id,
|
|
1026
|
-
accept: props.accept,
|
|
1027
|
-
maxFiles: props.maxFiles,
|
|
1028
|
-
maxFileSize: props.maxFileSize,
|
|
1029
|
-
minFileSize: props.minFileSize,
|
|
1030
|
-
multiple: props.multiple ?? false,
|
|
1031
|
-
disabled: props.disabled,
|
|
1032
|
-
allowDrop: props.allowDrop ?? true,
|
|
1033
|
-
name: props.name,
|
|
1034
|
-
onFileChange: (details) => {
|
|
1035
|
-
this.acceptedFiles = details.acceptedFiles;
|
|
1036
|
-
this.rejectedFiles = details.rejectedFiles;
|
|
1037
|
-
props.onFileChange?.(details);
|
|
1038
|
-
}
|
|
1039
|
-
};
|
|
1040
|
-
}
|
|
1041
|
-
connectApi(service) {
|
|
1042
|
-
return fileUpload.connect(service, normalizeProps);
|
|
1043
|
-
}
|
|
1044
|
-
getSpreadMap() {
|
|
1045
|
-
return {
|
|
1046
|
-
"[data-part=\"root\"]": "getRootProps",
|
|
1047
|
-
"[data-part=\"label\"]": "getLabelProps",
|
|
1048
|
-
"[data-part=\"dropzone\"]": "getDropzoneProps",
|
|
1049
|
-
"[data-part=\"trigger\"]": "getTriggerProps",
|
|
1050
|
-
"[data-part=\"hidden-input\"]": "getHiddenInputProps",
|
|
1051
|
-
"[data-part=\"clear-trigger\"]": "getClearTriggerProps"
|
|
1052
|
-
};
|
|
1053
|
-
}
|
|
1054
|
-
syncState(api) {
|
|
1055
|
-
this.acceptedFiles = api.acceptedFiles;
|
|
1056
|
-
this.rejectedFiles = api.rejectedFiles;
|
|
1057
|
-
}
|
|
1058
|
-
template(props) {
|
|
1059
|
-
Component._register(ZagComponent);
|
|
1060
|
-
return `<div id="${this.id}" data-part="root"${(props.class || "") == null || (props.class || "") === false ? "" : ` class="${(props.class || "").trim()}"`}><!--${this.id + "-c0"}-->${props.label && `<label data-part="label" class="file-upload-label text-sm font-medium mb-2 block">${props.label}</label>` || ""}<!--${this.id + "-c0-end"}--><div data-part="dropzone" class="file-upload-dropzone flex flex-col items-center justify-center rounded-lg border-2 border-dashed border-muted-foreground/25 p-8 text-center hover:border-muted-foreground/50 transition-colors"><p class="text-sm text-muted-foreground mb-2">Drag and drop files here</p><button data-part="trigger" class="file-upload-trigger inline-flex h-9 items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground shadow hover:bg-primary/90">Choose Files</button></div><input data-part="hidden-input" type="file" class="sr-only" /><!--${this.id + "-c1"}-->${this.acceptedFiles.length > 0 && `<div class="file-upload-file-list mt-3 space-y-1">${this.acceptedFiles.map((file) => this.renderAcceptedFilesItem(file)).join("")}<button data-part="clear-trigger" class="file-upload-clear text-xs text-muted-foreground hover:text-foreground mt-1">Clear all</button></div>` || ""}<!--${this.id + "-c1-end"}--></div>`;
|
|
1061
|
-
}
|
|
1062
|
-
__onPropChange(key, value) {
|
|
1063
|
-
if (key === "class") try {
|
|
1064
|
-
const __el = this.$(":scope");
|
|
1065
|
-
this.props;
|
|
1066
|
-
const __boundValue = this.props.class || "";
|
|
1067
|
-
if (__el) {
|
|
1068
|
-
const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
|
|
1069
|
-
if (__el.className !== __newClass) __el.className = __newClass;
|
|
1070
|
-
}
|
|
1071
|
-
} catch {}
|
|
1072
|
-
if (key === "label") this.__geaPatchCond(0);
|
|
1073
|
-
this.__geaPatchCond(1);
|
|
1074
|
-
}
|
|
1075
|
-
__observe_local_acceptedFiles(value, change) {
|
|
1076
|
-
if (this.rendered_) {
|
|
1077
|
-
this.__geaCondPatched_1 = this.__geaPatchCond(1);
|
|
1078
|
-
if (this.__geaCondPatched_1) return;
|
|
1079
|
-
}
|
|
1080
|
-
if (!this.__acceptedFiles_container) this.__acceptedFiles_container = this.$(":scope");
|
|
1081
|
-
if (!this.__acceptedFiles_container) return;
|
|
1082
|
-
if (Array.isArray(value) && value.length === 0 && this.__acceptedFiles_container.children.length > 0) {
|
|
1083
|
-
this.__acceptedFiles_container.textContent = "";
|
|
1084
|
-
return;
|
|
1085
|
-
}
|
|
1086
|
-
if (typeof this.__ensureArrayConfigs === "function") this.__ensureArrayConfigs();
|
|
1087
|
-
this.__applyListChanges(this.__acceptedFiles_container, value, change, this.__acceptedFilesListConfig);
|
|
1088
|
-
}
|
|
1089
|
-
__observe_local_acceptedFiles__join(value, change) {
|
|
1090
|
-
if (this.rendered_) {
|
|
1091
|
-
this.__geaCondPatched_1 = this.__geaPatchCond(1);
|
|
1092
|
-
if (this.__geaCondPatched_1) return;
|
|
1093
|
-
}
|
|
1094
|
-
}
|
|
1095
|
-
__observe_local_acceptedFiles__map(value, change) {
|
|
1096
|
-
if (this.rendered_) {
|
|
1097
|
-
this.__geaCondPatched_1 = this.__geaPatchCond(1);
|
|
1098
|
-
if (this.__geaCondPatched_1) return;
|
|
1099
|
-
}
|
|
1100
|
-
}
|
|
1101
|
-
renderAcceptedFilesItem(file) {
|
|
1102
|
-
return `<div data-gea-item-id="${file.name}" class="flex items-center justify-between rounded-md border px-3 py-2 text-sm"><span>${file.name}</span></div>`;
|
|
1103
|
-
}
|
|
1104
|
-
createAcceptedFilesItem(item) {
|
|
1105
|
-
var __c = this.__acceptedFiles_container;
|
|
1106
|
-
if (!__c.__geaTpl) try {
|
|
1107
|
-
var __tw = document.createElement("template");
|
|
1108
|
-
__tw.innerHTML = this.renderAcceptedFilesItem({ name: 0 });
|
|
1109
|
-
__c.__geaTpl = __tw.content.firstElementChild;
|
|
1110
|
-
} catch {}
|
|
1111
|
-
if (__c.__geaTpl) var el = __c.__geaTpl.cloneNode(true);
|
|
1112
|
-
else {
|
|
1113
|
-
var __fw = document.createElement("template");
|
|
1114
|
-
__fw.innerHTML = this.renderAcceptedFilesItem(item);
|
|
1115
|
-
var el = __fw.content.firstElementChild;
|
|
1116
|
-
}
|
|
1117
|
-
el.firstElementChild.textContent = `${item.name}`;
|
|
1118
|
-
el.setAttribute("data-gea-item-id", item.name);
|
|
1119
|
-
el.__geaItem = item;
|
|
1120
|
-
return el;
|
|
1121
|
-
}
|
|
1122
|
-
__ensureArrayConfigs() {
|
|
1123
|
-
if (!this.__acceptedFilesListConfig) this.__acceptedFilesListConfig = {
|
|
1124
|
-
arrayPathParts: ["acceptedFiles"],
|
|
1125
|
-
render: (item) => this.renderAcceptedFilesItem(item),
|
|
1126
|
-
create: (item) => this.createAcceptedFilesItem(item),
|
|
1127
|
-
propPatchers: { "name": [(row, value, item) => {
|
|
1128
|
-
const __target = row.firstElementChild;
|
|
1129
|
-
if (!__target) return;
|
|
1130
|
-
__target.firstChild && (__target.firstChild.nodeValue = `${item.name}`) || (__target.textContent = `${item.name}`);
|
|
1131
|
-
}, (row, value) => row.classList.toggle("name", value)] }
|
|
1132
|
-
};
|
|
1133
|
-
}
|
|
1134
|
-
__setupLocalStateObservers() {
|
|
1135
|
-
if (typeof this.__ensureArrayConfigs === "function") this.__ensureArrayConfigs();
|
|
1136
|
-
if (!this.__store) return;
|
|
1137
|
-
this.__observer_removers__.push(this.__store.observe(["acceptedFiles"], (__v, __c) => {
|
|
1138
|
-
try {
|
|
1139
|
-
this.__observe_local_acceptedFiles(__v, __c);
|
|
1140
|
-
} catch (_e) {}
|
|
1141
|
-
}));
|
|
1142
|
-
this.__observer_removers__.push(this.__store.observe(["acceptedFiles", "join"], (__v, __c) => {
|
|
1143
|
-
try {
|
|
1144
|
-
this.__observe_local_acceptedFiles__join(__v, __c);
|
|
1145
|
-
} catch (_e) {}
|
|
1146
|
-
}));
|
|
1147
|
-
this.__observer_removers__.push(this.__store.observe(["acceptedFiles", "map"], (__v, __c) => {
|
|
1148
|
-
try {
|
|
1149
|
-
this.__observe_local_acceptedFiles__map(__v, __c);
|
|
1150
|
-
} catch (_e) {}
|
|
1151
|
-
}));
|
|
1152
|
-
}
|
|
1153
|
-
};
|
|
1154
|
-
//#endregion
|
|
1155
|
-
//#region src/components/hover-card.tsx
|
|
1156
|
-
var HoverCard = class extends ZagComponent {
|
|
1157
|
-
createMachine(_props) {
|
|
1158
|
-
return hoverCard.machine;
|
|
1159
|
-
}
|
|
1160
|
-
getMachineProps(props) {
|
|
1161
|
-
return {
|
|
1162
|
-
id: this.id,
|
|
1163
|
-
open: props.open,
|
|
1164
|
-
defaultOpen: props.defaultOpen,
|
|
1165
|
-
openDelay: props.openDelay,
|
|
1166
|
-
closeDelay: props.closeDelay,
|
|
1167
|
-
positioning: props.positioning,
|
|
1168
|
-
onOpenChange: (details) => {
|
|
1169
|
-
this.open = details.open;
|
|
1170
|
-
props.onOpenChange?.(details);
|
|
1171
|
-
}
|
|
1172
|
-
};
|
|
1173
|
-
}
|
|
1174
|
-
connectApi(service) {
|
|
1175
|
-
return hoverCard.connect(service, normalizeProps);
|
|
1176
|
-
}
|
|
1177
|
-
getSpreadMap() {
|
|
1178
|
-
return {
|
|
1179
|
-
"[data-part=\"trigger\"]": "getTriggerProps",
|
|
1180
|
-
"[data-part=\"positioner\"]": "getPositionerProps",
|
|
1181
|
-
"[data-part=\"content\"]": "getContentProps",
|
|
1182
|
-
"[data-part=\"arrow\"]": "getArrowProps",
|
|
1183
|
-
"[data-part=\"arrow-tip\"]": "getArrowTipProps"
|
|
1184
|
-
};
|
|
1185
|
-
}
|
|
1186
|
-
syncState(api) {
|
|
1187
|
-
this.open = api.open;
|
|
1188
|
-
}
|
|
1189
|
-
template(props) {
|
|
1190
|
-
Component._register(ZagComponent);
|
|
1191
|
-
return `<div id="${this.id}"${(props.class || "") == null || (props.class || "") === false ? "" : ` class="${(props.class || "").trim()}"`} style="display: inline-block;"><a id="${this.id + "-b1"}" data-part="trigger"${(props.href || "#") == null || (props.href || "#") === false ? "" : ` href="${props.href || "#"}"`} class="hover-card-trigger inline-block">${props.triggerLabel || "Hover me"}</a><div data-part="positioner" class="hover-card-positioner"><div id="${this.id + "-b2"}" data-part="content" class="hover-card-content z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none">${props.children}</div></div></div>`;
|
|
1192
|
-
}
|
|
1193
|
-
__onPropChange(key, value) {
|
|
1194
|
-
if (key === "class") try {
|
|
1195
|
-
const __el = this.$(":scope");
|
|
1196
|
-
this.props;
|
|
1197
|
-
const __boundValue = this.props.class || "";
|
|
1198
|
-
if (__el) {
|
|
1199
|
-
const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
|
|
1200
|
-
if (__el.className !== __newClass) __el.className = __newClass;
|
|
1201
|
-
}
|
|
1202
|
-
} catch {}
|
|
1203
|
-
if (key === "href") try {
|
|
1204
|
-
const __el = document.getElementById(this.id + "-b1");
|
|
1205
|
-
this.props;
|
|
1206
|
-
const __boundValue = this.props.href || "#";
|
|
1207
|
-
if (__el) if (__boundValue === null || __boundValue === void 0) __el.removeAttribute("href");
|
|
1208
|
-
else __el.setAttribute("href", String(__boundValue));
|
|
1209
|
-
} catch {}
|
|
1210
|
-
if (key === "triggerLabel") try {
|
|
1211
|
-
const __el = document.getElementById(this.id + "-b1");
|
|
1212
|
-
this.props;
|
|
1213
|
-
const __boundValue = this.props.triggerLabel || "Hover me";
|
|
1214
|
-
if (__el) {
|
|
1215
|
-
if (__el.textContent !== __boundValue) __el.textContent = __boundValue;
|
|
1216
|
-
}
|
|
1217
|
-
} catch {}
|
|
1218
|
-
if (key === "children") try {
|
|
1219
|
-
const __el = document.getElementById(this.id + "-b2");
|
|
1220
|
-
if (__el) {
|
|
1221
|
-
if (__el.innerHTML !== value) {
|
|
1222
|
-
__el.innerHTML = value;
|
|
1223
|
-
this.instantiateChildComponents_();
|
|
1224
|
-
if (this.parentComponent) this.parentComponent.mountCompiledChildComponents_();
|
|
1225
|
-
}
|
|
1226
|
-
}
|
|
1227
|
-
} catch {}
|
|
1228
|
-
}
|
|
1229
|
-
};
|
|
1230
|
-
//#endregion
|
|
1231
|
-
//#region src/components/menu.tsx
|
|
1232
|
-
var Menu = class extends ZagComponent {
|
|
1233
|
-
createMachine(_props) {
|
|
1234
|
-
return menu.machine;
|
|
1235
|
-
}
|
|
1236
|
-
getMachineProps(props) {
|
|
1237
|
-
return {
|
|
1238
|
-
id: this.id,
|
|
1239
|
-
open: props.open,
|
|
1240
|
-
defaultOpen: props.defaultOpen,
|
|
1241
|
-
closeOnSelect: props.closeOnSelect ?? true,
|
|
1242
|
-
loopFocus: props.loopFocus ?? false,
|
|
1243
|
-
positioning: props.positioning,
|
|
1244
|
-
onOpenChange: (details) => {
|
|
1245
|
-
this.open = details.open;
|
|
1246
|
-
props.onOpenChange?.(details);
|
|
1247
|
-
},
|
|
1248
|
-
onSelect: props.onSelect
|
|
1249
|
-
};
|
|
1250
|
-
}
|
|
1251
|
-
connectApi(service) {
|
|
1252
|
-
return menu.connect(service, normalizeProps);
|
|
1253
|
-
}
|
|
1254
|
-
getSpreadMap() {
|
|
1255
|
-
return {
|
|
1256
|
-
"[data-part=\"trigger\"]": "getTriggerProps",
|
|
1257
|
-
"[data-part=\"positioner\"]": "getPositionerProps",
|
|
1258
|
-
"[data-part=\"content\"]": "getContentProps",
|
|
1259
|
-
"[data-part=\"separator\"]": "getSeparatorProps",
|
|
1260
|
-
"[data-part=\"item\"]": (api, el) => api.getItemProps({ value: el.dataset.value }),
|
|
1261
|
-
"[data-part=\"item-group\"]": (api, el) => api.getItemGroupProps({ id: el.dataset.groupId }),
|
|
1262
|
-
"[data-part=\"item-group-label\"]": (api, el) => api.getItemGroupLabelProps({ htmlFor: el.dataset.htmlFor })
|
|
1263
|
-
};
|
|
1264
|
-
}
|
|
1265
|
-
syncState(api) {
|
|
1266
|
-
this.open = api.open;
|
|
1267
|
-
}
|
|
1268
|
-
template(props) {
|
|
1269
|
-
Component._register(ZagComponent);
|
|
1270
|
-
const items = props.items || [];
|
|
1271
|
-
return `<div id="${this.id}"${(props.class || "") == null || (props.class || "") === false ? "" : ` class="${(props.class || "").trim()}"`}><button id="${this.id + "-b1"}" data-part="trigger" class="menu-trigger inline-flex items-center justify-center gap-1 rounded-md border border-input bg-background px-4 py-2 text-sm font-medium shadow-sm hover:bg-accent hover:text-accent-foreground">${props.triggerLabel || "Menu"}</button><div data-part="positioner" class="menu-positioner"><div id="${this.id + "-b2"}" data-part="content" class="menu-content z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md">${items.map((item, i) => item.type === "separator" ? `<div id="${this.id + "-b2-" + String(String(item))}" data-gea-item-id="${String(item)}" data-part="separator" class="menu-separator -mx-1 my-1 h-px bg-muted"></div>` : `<div data-gea-item-id="${item.id}" data-part="item"${item.value == null || item.value === false ? "" : ` data-value="${item.value}"`} class="menu-item relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50">${item.label}</div>`).join("") + "<!---->"}</div></div></div>`;
|
|
1272
|
-
}
|
|
1273
|
-
render__unresolved_0Item(item, i) {
|
|
1274
|
-
return `<div id="${this.id + "-b2-" + String(item.id)}" data-gea-item-id="${item.id}" data-part="separator" class="menu-separator -mx-1 my-1 h-px bg-muted"></div>`;
|
|
1275
|
-
}
|
|
1276
|
-
__onPropChange(key, value) {
|
|
1277
|
-
if (key === "class") try {
|
|
1278
|
-
const __el = this.$(":scope");
|
|
1279
|
-
this.props;
|
|
1280
|
-
const __boundValue = this.props.class || "";
|
|
1281
|
-
if (__el) {
|
|
1282
|
-
const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
|
|
1283
|
-
if (__el.className !== __newClass) __el.className = __newClass;
|
|
1284
|
-
}
|
|
1285
|
-
} catch {}
|
|
1286
|
-
if (key === "triggerLabel") try {
|
|
1287
|
-
const __el = document.getElementById(this.id + "-b1");
|
|
1288
|
-
this.props;
|
|
1289
|
-
const __boundValue = this.props.triggerLabel || "Menu";
|
|
1290
|
-
if (__el) {
|
|
1291
|
-
if (__el.textContent !== __boundValue) __el.textContent = __boundValue;
|
|
1292
|
-
}
|
|
1293
|
-
} catch {}
|
|
1294
|
-
if (key === "items") this.__geaSyncMap(0);
|
|
1295
|
-
}
|
|
1296
|
-
__observe_local_props(__v, __c) {
|
|
1297
|
-
this.__geaSyncMap(0);
|
|
1298
|
-
}
|
|
1299
|
-
createdHooks() {
|
|
1300
|
-
if (!this.__observer_removers__) this.__observer_removers__ = [];
|
|
1301
|
-
if (!this.__stores) this.__stores = {};
|
|
1302
|
-
this.__observer_removers__.forEach((fn) => fn());
|
|
1303
|
-
this.__observer_removers__ = [];
|
|
1304
|
-
if (typeof this.__ensureArrayConfigs === "function") this.__ensureArrayConfigs();
|
|
1305
|
-
this.__geaRegisterMap(0, "____unresolved_0_container", () => document.getElementById(this.id + "-b2"), () => {
|
|
1306
|
-
return this.props.items || [];
|
|
1307
|
-
}, (__item, __idx) => this.create__unresolved_0Item(__item, __idx));
|
|
1308
|
-
}
|
|
1309
|
-
};
|
|
1310
|
-
//#endregion
|
|
1311
|
-
//#region src/components/number-input.tsx
|
|
1312
|
-
var NumberInput = class extends ZagComponent {
|
|
1313
|
-
constructor(...args) {
|
|
1314
|
-
super(...args);
|
|
1315
|
-
try {
|
|
1316
|
-
this.props;
|
|
1317
|
-
this.__geaCond_0 = !!this.props.label;
|
|
1318
|
-
} catch {}
|
|
1319
|
-
this.__geaRegisterCond(0, "c0", () => {
|
|
1320
|
-
this.props;
|
|
1321
|
-
return this.props.label;
|
|
1322
|
-
}, () => {
|
|
1323
|
-
this.props;
|
|
1324
|
-
return `<label data-part="label" class="number-input-label text-sm font-medium mb-1 block">${this.props.label}</label>`;
|
|
1325
|
-
}, null);
|
|
1326
|
-
}
|
|
1327
|
-
createMachine(_props) {
|
|
1328
|
-
return numberInput.machine;
|
|
1329
|
-
}
|
|
1330
|
-
getMachineProps(props) {
|
|
1331
|
-
return {
|
|
1332
|
-
id: this.id,
|
|
1333
|
-
value: props.value,
|
|
1334
|
-
defaultValue: props.defaultValue,
|
|
1335
|
-
min: props.min,
|
|
1336
|
-
max: props.max,
|
|
1337
|
-
step: props.step ?? 1,
|
|
1338
|
-
disabled: props.disabled,
|
|
1339
|
-
readOnly: props.readOnly,
|
|
1340
|
-
invalid: props.invalid,
|
|
1341
|
-
required: props.required,
|
|
1342
|
-
name: props.name,
|
|
1343
|
-
form: props.form,
|
|
1344
|
-
allowMouseWheel: props.allowMouseWheel,
|
|
1345
|
-
clampValueOnBlur: props.clampValueOnBlur ?? true,
|
|
1346
|
-
formatOptions: props.formatOptions,
|
|
1347
|
-
locale: props.locale,
|
|
1348
|
-
onValueChange: (details) => {
|
|
1349
|
-
this.value = details.value;
|
|
1350
|
-
this.valueAsNumber = details.valueAsNumber;
|
|
1351
|
-
props.onValueChange?.(details);
|
|
1352
|
-
}
|
|
1353
|
-
};
|
|
1354
|
-
}
|
|
1355
|
-
connectApi(service) {
|
|
1356
|
-
return numberInput.connect(service, normalizeProps);
|
|
1357
|
-
}
|
|
1358
|
-
getSpreadMap() {
|
|
1359
|
-
return {
|
|
1360
|
-
"[data-part=\"root\"]": "getRootProps",
|
|
1361
|
-
"[data-part=\"label\"]": "getLabelProps",
|
|
1362
|
-
"[data-part=\"control\"]": "getControlProps",
|
|
1363
|
-
"[data-part=\"input\"]": "getInputProps",
|
|
1364
|
-
"[data-part=\"increment-trigger\"]": "getIncrementTriggerProps",
|
|
1365
|
-
"[data-part=\"decrement-trigger\"]": "getDecrementTriggerProps",
|
|
1366
|
-
"[data-part=\"scrubber\"]": "getScrubberProps"
|
|
1367
|
-
};
|
|
1368
|
-
}
|
|
1369
|
-
syncState(api) {
|
|
1370
|
-
this.value = api.value;
|
|
1371
|
-
this.valueAsNumber = api.valueAsNumber;
|
|
1372
|
-
}
|
|
1373
|
-
template(props) {
|
|
1374
|
-
Component._register(ZagComponent);
|
|
1375
|
-
return `<div id="${this.id}" data-part="root"${(props.class || "") == null || (props.class || "") === false ? "" : ` class="${(props.class || "").trim()}"`}><!--${this.id + "-c0"}-->${props.label && `<label data-part="label" class="number-input-label text-sm font-medium mb-1 block">${props.label}</label>` || ""}<!--${this.id + "-c0-end"}--><div data-part="control" class="number-input-control flex"><button data-part="decrement-trigger" class="number-input-decrement inline-flex h-9 items-center justify-center rounded-l-md border border-r-0 border-input px-2 hover:bg-accent">−</button><input data-part="input" class="number-input-input h-9 w-full border border-input bg-transparent px-3 text-center text-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring" /><button data-part="increment-trigger" class="number-input-increment inline-flex h-9 items-center justify-center rounded-r-md border border-l-0 border-input px-2 hover:bg-accent">+</button></div></div>`;
|
|
1376
|
-
}
|
|
1377
|
-
__onPropChange(key, value) {
|
|
1378
|
-
if (key === "class") try {
|
|
1379
|
-
const __el = this.$(":scope");
|
|
1380
|
-
this.props;
|
|
1381
|
-
const __boundValue = this.props.class || "";
|
|
1382
|
-
if (__el) {
|
|
1383
|
-
const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
|
|
1384
|
-
if (__el.className !== __newClass) __el.className = __newClass;
|
|
1385
|
-
}
|
|
1386
|
-
} catch {}
|
|
1387
|
-
if (key === "label") this.__geaPatchCond(0);
|
|
1388
|
-
}
|
|
1389
|
-
};
|
|
1390
|
-
//#endregion
|
|
1391
|
-
//#region src/components/pagination.tsx
|
|
1392
|
-
var Pagination = class extends ZagComponent {
|
|
1393
|
-
constructor(..._args) {
|
|
1394
|
-
super(..._args);
|
|
1395
|
-
this.page = 1;
|
|
1396
|
-
this.totalPages = 1;
|
|
1397
|
-
}
|
|
1398
|
-
createMachine(_props) {
|
|
1399
|
-
return pagination.machine;
|
|
1400
|
-
}
|
|
1401
|
-
getMachineProps(props) {
|
|
1402
|
-
return {
|
|
1403
|
-
id: this.id,
|
|
1404
|
-
count: props.count ?? 0,
|
|
1405
|
-
page: props.page,
|
|
1406
|
-
defaultPage: props.defaultPage ?? 1,
|
|
1407
|
-
pageSize: props.pageSize,
|
|
1408
|
-
defaultPageSize: props.defaultPageSize ?? 10,
|
|
1409
|
-
siblingCount: props.siblingCount ?? 1,
|
|
1410
|
-
type: props.type ?? "button",
|
|
1411
|
-
onPageChange: (details) => {
|
|
1412
|
-
this.page = details.page;
|
|
1413
|
-
props.onPageChange?.(details);
|
|
1414
|
-
},
|
|
1415
|
-
onPageSizeChange: props.onPageSizeChange
|
|
1416
|
-
};
|
|
1417
|
-
}
|
|
1418
|
-
connectApi(service) {
|
|
1419
|
-
return pagination.connect(service, normalizeProps);
|
|
1420
|
-
}
|
|
1421
|
-
getSpreadMap() {
|
|
1422
|
-
return {
|
|
1423
|
-
"[data-part=\"root\"]": "getRootProps",
|
|
1424
|
-
"[data-part=\"prev-trigger\"]": "getPrevTriggerProps",
|
|
1425
|
-
"[data-part=\"next-trigger\"]": "getNextTriggerProps",
|
|
1426
|
-
"[data-part=\"item\"]": (api, el) => {
|
|
1427
|
-
const value = parseInt(el.dataset.value || "1", 10);
|
|
1428
|
-
return api.getItemProps({
|
|
1429
|
-
type: "page",
|
|
1430
|
-
value
|
|
1431
|
-
});
|
|
1432
|
-
},
|
|
1433
|
-
"[data-part=\"ellipsis\"]": (api, el) => {
|
|
1434
|
-
const index = parseInt(el.dataset.index || "0", 10);
|
|
1435
|
-
return api.getEllipsisProps({ index });
|
|
1436
|
-
}
|
|
1437
|
-
};
|
|
1438
|
-
}
|
|
1439
|
-
syncState(api) {
|
|
1440
|
-
this.page = api.page;
|
|
1441
|
-
this.totalPages = api.totalPages;
|
|
1442
|
-
}
|
|
1443
|
-
template(props) {
|
|
1444
|
-
Component._register(ZagComponent);
|
|
1445
|
-
return `<nav id="${this.id}" data-part="root" class="${`pagination-root ${props.class || ""}`.trim()}"><div class="flex items-center gap-1"><button data-part="prev-trigger" class="pagination-prev inline-flex h-9 items-center justify-center rounded-md border border-input bg-background px-3 text-sm shadow-sm hover:bg-accent disabled:opacity-50">‹ Prev</button><button data-part="next-trigger" class="pagination-next inline-flex h-9 items-center justify-center rounded-md border border-input bg-background px-3 text-sm shadow-sm hover:bg-accent disabled:opacity-50">Next ›</button></div></nav>`;
|
|
1446
|
-
}
|
|
1447
|
-
__onPropChange(key, value) {
|
|
1448
|
-
if (key === "class") try {
|
|
1449
|
-
const __el = this.$(":scope");
|
|
1450
|
-
this.props;
|
|
1451
|
-
const __boundValue = `pagination-root ${this.props.class || ""}`;
|
|
1452
|
-
if (__el) {
|
|
1453
|
-
const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
|
|
1454
|
-
if (__el.className !== __newClass) __el.className = __newClass;
|
|
1455
|
-
}
|
|
1456
|
-
} catch {}
|
|
1457
|
-
}
|
|
1458
|
-
};
|
|
1459
|
-
//#endregion
|
|
1460
|
-
//#region src/components/pin-input.tsx
|
|
1461
|
-
var PinInput = class extends ZagComponent {
|
|
1462
|
-
constructor(...args) {
|
|
1463
|
-
super(...args);
|
|
1464
|
-
try {
|
|
1465
|
-
this.props;
|
|
1466
|
-
this.__geaCond_0 = !!this.props.label;
|
|
1467
|
-
} catch {}
|
|
1468
|
-
this.__geaRegisterCond(0, "c0", () => {
|
|
1469
|
-
this.props;
|
|
1470
|
-
return this.props.label;
|
|
1471
|
-
}, () => {
|
|
1472
|
-
this.props;
|
|
1473
|
-
return `<label data-part="label" class="pin-input-label text-sm font-medium mb-2 block">${this.props.label}</label>`;
|
|
1474
|
-
}, null);
|
|
1475
|
-
}
|
|
1476
|
-
createMachine(_props) {
|
|
1477
|
-
return pinInput.machine;
|
|
1478
|
-
}
|
|
1479
|
-
getMachineProps(props) {
|
|
1480
|
-
return {
|
|
1481
|
-
id: this.id,
|
|
1482
|
-
value: props.value,
|
|
1483
|
-
defaultValue: props.defaultValue,
|
|
1484
|
-
count: props.count ?? 4,
|
|
1485
|
-
type: props.type ?? "numeric",
|
|
1486
|
-
otp: props.otp ?? false,
|
|
1487
|
-
mask: props.mask ?? false,
|
|
1488
|
-
placeholder: props.placeholder ?? "○",
|
|
1489
|
-
disabled: props.disabled,
|
|
1490
|
-
readOnly: props.readOnly,
|
|
1491
|
-
invalid: props.invalid,
|
|
1492
|
-
name: props.name,
|
|
1493
|
-
form: props.form,
|
|
1494
|
-
blurOnComplete: props.blurOnComplete ?? false,
|
|
1495
|
-
autoFocus: props.autoFocus,
|
|
1496
|
-
onValueChange: (details) => {
|
|
1497
|
-
this.value = details.value;
|
|
1498
|
-
this.valueAsString = details.valueAsString;
|
|
1499
|
-
props.onValueChange?.(details);
|
|
1500
|
-
},
|
|
1501
|
-
onValueComplete: props.onValueComplete,
|
|
1502
|
-
onValueInvalid: props.onValueInvalid
|
|
1503
|
-
};
|
|
1504
|
-
}
|
|
1505
|
-
connectApi(service) {
|
|
1506
|
-
return pinInput.connect(service, normalizeProps);
|
|
1507
|
-
}
|
|
1508
|
-
getSpreadMap() {
|
|
1509
|
-
return {
|
|
1510
|
-
"[data-part=\"root\"]": "getRootProps",
|
|
1511
|
-
"[data-part=\"label\"]": "getLabelProps",
|
|
1512
|
-
"[data-part=\"control\"]": "getControlProps",
|
|
1513
|
-
"[data-part=\"hidden-input\"]": "getHiddenInputProps",
|
|
1514
|
-
"[data-part=\"input\"]": (api, el) => {
|
|
1515
|
-
const index = parseInt(el.dataset.index || "0", 10);
|
|
1516
|
-
return api.getInputProps({ index });
|
|
1517
|
-
}
|
|
1518
|
-
};
|
|
1519
|
-
}
|
|
1520
|
-
syncState(api) {
|
|
1521
|
-
this.value = api.value;
|
|
1522
|
-
this.valueAsString = api.valueAsString;
|
|
1523
|
-
}
|
|
1524
|
-
template(props) {
|
|
1525
|
-
Component._register(ZagComponent);
|
|
1526
|
-
const count = props.count ?? 4;
|
|
1527
|
-
const inputs = Array.from({ length: count }, (_, i) => i);
|
|
1528
|
-
return `<div id="${this.id}" data-part="root"${(props.class || "") == null || (props.class || "") === false ? "" : ` class="${(props.class || "").trim()}"`}><!--${this.id + "-c0"}-->${props.label && `<label data-part="label" class="pin-input-label text-sm font-medium mb-2 block">${props.label}</label>` || ""}<!--${this.id + "-c0-end"}--><div id="${this.id + "-b1"}" data-part="control" class="pin-input-control flex gap-2">${inputs.map((i) => `<input id="${this.id + "-b1-" + String(String(i))}" data-gea-item-id="${String(i)}" data-part="input"${String(i) == null || String(i) === false ? "" : ` data-index="${String(i)}"`} class="pin-input-field h-9 w-9 rounded-md border border-input bg-transparent text-center text-sm shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring" />`).join("") + "<!---->"}</div><input data-part="hidden-input" type="hidden" /></div>`;
|
|
1529
|
-
}
|
|
1530
|
-
render__unresolved_0Item(i) {
|
|
1531
|
-
const __v = (v) => v != null && typeof v === "object" ? v.valueOf() : v;
|
|
1532
|
-
return `<input id="${this.id + "-b1-" + String(String(i))}" data-gea-item-id="${String(i)}" data-part="input"${__v(String(i)) == null || __v(String(i)) === false ? "" : ` data-index="${String(i)}"`} class="pin-input-field h-9 w-9 rounded-md border border-input bg-transparent text-center text-sm shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring" />`;
|
|
1533
|
-
}
|
|
1534
|
-
create__unresolved_0Item(item) {
|
|
1535
|
-
var __c = this.____unresolved_0_container;
|
|
1536
|
-
if (!__c.__geaTpl) try {
|
|
1537
|
-
var __tw = document.createElement("template");
|
|
1538
|
-
__tw.innerHTML = this.render__unresolved_0Item("__dummy__");
|
|
1539
|
-
__c.__geaTpl = __tw.content.firstElementChild;
|
|
1540
|
-
} catch {}
|
|
1541
|
-
if (!__c.__geaIdPfx) __c.__geaIdPfx = this.id_ + "-b1-";
|
|
1542
|
-
if (__c.__geaTpl) var el = __c.__geaTpl.cloneNode(true);
|
|
1543
|
-
else {
|
|
1544
|
-
var __fw = document.createElement("template");
|
|
1545
|
-
__fw.innerHTML = this.render__unresolved_0Item(item);
|
|
1546
|
-
var el = __fw.content.firstElementChild;
|
|
1547
|
-
}
|
|
1548
|
-
var __av = String(item);
|
|
1549
|
-
if (__av == null || __av === false) el.removeAttribute("data-index");
|
|
1550
|
-
else el.setAttribute("data-index", String(__av));
|
|
1551
|
-
el.setAttribute("data-gea-item-id", String(item));
|
|
1552
|
-
el.id = __c.__geaIdPfx + String(item);
|
|
1553
|
-
el.__geaItem = item;
|
|
1554
|
-
return el;
|
|
1555
|
-
}
|
|
1556
|
-
__onPropChange(key, value) {
|
|
1557
|
-
if (key === "class") try {
|
|
1558
|
-
const __el = this.$(":scope");
|
|
1559
|
-
this.props;
|
|
1560
|
-
const __boundValue = this.props.class || "";
|
|
1561
|
-
if (__el) {
|
|
1562
|
-
const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
|
|
1563
|
-
if (__el.className !== __newClass) __el.className = __newClass;
|
|
1564
|
-
}
|
|
1565
|
-
} catch {}
|
|
1566
|
-
if (key === "label") this.__geaPatchCond(0);
|
|
1567
|
-
if (key === "count") this.__geaSyncMap(0);
|
|
1568
|
-
}
|
|
1569
|
-
__observe_local_props(__v, __c) {
|
|
1570
|
-
this.__geaSyncMap(0);
|
|
1571
|
-
}
|
|
1572
|
-
createdHooks() {
|
|
1573
|
-
if (!this.__observer_removers__) this.__observer_removers__ = [];
|
|
1574
|
-
if (!this.__stores) this.__stores = {};
|
|
1575
|
-
this.__observer_removers__.forEach((fn) => fn());
|
|
1576
|
-
this.__observer_removers__ = [];
|
|
1577
|
-
if (typeof this.__ensureArrayConfigs === "function") this.__ensureArrayConfigs();
|
|
1578
|
-
this.__geaRegisterMap(0, "____unresolved_0_container", () => document.getElementById(this.id + "-b1"), () => {
|
|
1579
|
-
const count = this.props.count ?? 4;
|
|
1580
|
-
return Array.from({ length: count }, (_, i) => i);
|
|
1581
|
-
}, (__item) => this.create__unresolved_0Item(__item));
|
|
1582
|
-
}
|
|
1583
|
-
};
|
|
1584
|
-
//#endregion
|
|
1585
|
-
//#region src/components/popover.tsx
|
|
1586
|
-
var Popover = class extends ZagComponent {
|
|
1587
|
-
constructor(...args) {
|
|
1588
|
-
super(...args);
|
|
1589
|
-
try {
|
|
1590
|
-
this.props;
|
|
1591
|
-
this.__geaCond_0 = !!this.props.title;
|
|
1592
|
-
this.__geaCond_1 = !!this.props.description;
|
|
1593
|
-
} catch {}
|
|
1594
|
-
this.__geaRegisterCond(0, "c0", () => {
|
|
1595
|
-
this.props;
|
|
1596
|
-
return this.props.title;
|
|
1597
|
-
}, () => {
|
|
1598
|
-
this.props;
|
|
1599
|
-
return `<div data-part="title" class="popover-title font-medium leading-none mb-2">${this.props.title}</div>`;
|
|
1600
|
-
}, null);
|
|
1601
|
-
this.__geaRegisterCond(1, "c1", () => {
|
|
1602
|
-
this.props;
|
|
1603
|
-
return this.props.description;
|
|
1604
|
-
}, () => {
|
|
1605
|
-
this.props;
|
|
1606
|
-
return `<p data-part="description" class="popover-description text-sm text-muted-foreground mb-3">${this.props.description}</p>`;
|
|
1607
|
-
}, null);
|
|
1608
|
-
}
|
|
1609
|
-
createMachine(_props) {
|
|
1610
|
-
return popover.machine;
|
|
1611
|
-
}
|
|
1612
|
-
getMachineProps(props) {
|
|
1613
|
-
return {
|
|
1614
|
-
id: this.id,
|
|
1615
|
-
open: props.open,
|
|
1616
|
-
defaultOpen: props.defaultOpen,
|
|
1617
|
-
modal: props.modal ?? false,
|
|
1618
|
-
portalled: props.portalled ?? true,
|
|
1619
|
-
autoFocus: props.autoFocus ?? true,
|
|
1620
|
-
closeOnInteractOutside: props.closeOnInteractOutside ?? true,
|
|
1621
|
-
closeOnEscape: props.closeOnEscape ?? true,
|
|
1622
|
-
positioning: props.positioning,
|
|
1623
|
-
onOpenChange: (details) => {
|
|
1624
|
-
this.open = details.open;
|
|
1625
|
-
props.onOpenChange?.(details);
|
|
1626
|
-
}
|
|
1627
|
-
};
|
|
1628
|
-
}
|
|
1629
|
-
connectApi(service) {
|
|
1630
|
-
return popover.connect(service, normalizeProps);
|
|
1631
|
-
}
|
|
1632
|
-
getSpreadMap() {
|
|
1633
|
-
return {
|
|
1634
|
-
"[data-part=\"trigger\"]": "getTriggerProps",
|
|
1635
|
-
"[data-part=\"positioner\"]": "getPositionerProps",
|
|
1636
|
-
"[data-part=\"content\"]": "getContentProps",
|
|
1637
|
-
"[data-part=\"title\"]": "getTitleProps",
|
|
1638
|
-
"[data-part=\"description\"]": "getDescriptionProps",
|
|
1639
|
-
"[data-part=\"close-trigger\"]": "getCloseTriggerProps",
|
|
1640
|
-
"[data-part=\"arrow\"]": "getArrowProps",
|
|
1641
|
-
"[data-part=\"arrow-tip\"]": "getArrowTipProps"
|
|
1642
|
-
};
|
|
1643
|
-
}
|
|
1644
|
-
syncState(api) {
|
|
1645
|
-
this.open = api.open;
|
|
1646
|
-
}
|
|
1647
|
-
template(props) {
|
|
1648
|
-
Component._register(ZagComponent);
|
|
1649
|
-
return `<div id="${this.id}"${(props.class || "") == null || (props.class || "") === false ? "" : ` class="${(props.class || "").trim()}"`}><button id="${this.id + "-b1"}" data-part="trigger" class="popover-trigger">${props.triggerLabel || "Open"}</button><div data-part="positioner" class="popover-positioner"><div data-part="content" class="popover-content z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none"><!--${this.id + "-c0"}-->${props.title && `<div data-part="title" class="popover-title font-medium leading-none mb-2">${props.title}</div>` || ""}<!--${this.id + "-c0-end"}--><!--${this.id + "-c1"}-->${props.description && `<p data-part="description" class="popover-description text-sm text-muted-foreground mb-3">${props.description}</p>` || ""}<!--${this.id + "-c1-end"}--><div id="${this.id + "-b2"}" class="popover-body">${props.children}</div><button data-part="close-trigger" class="popover-close-trigger absolute top-2 right-2 text-gray-400 hover:text-gray-600 text-sm">✕</button></div></div></div>`;
|
|
1650
|
-
}
|
|
1651
|
-
__onPropChange(key, value) {
|
|
1652
|
-
if (key === "class") try {
|
|
1653
|
-
const __el = this.$(":scope");
|
|
1654
|
-
this.props;
|
|
1655
|
-
const __boundValue = this.props.class || "";
|
|
1656
|
-
if (__el) {
|
|
1657
|
-
const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
|
|
1658
|
-
if (__el.className !== __newClass) __el.className = __newClass;
|
|
1659
|
-
}
|
|
1660
|
-
} catch {}
|
|
1661
|
-
if (key === "triggerLabel") try {
|
|
1662
|
-
const __el = document.getElementById(this.id + "-b1");
|
|
1663
|
-
this.props;
|
|
1664
|
-
const __boundValue = this.props.triggerLabel || "Open";
|
|
1665
|
-
if (__el) {
|
|
1666
|
-
if (__el.textContent !== __boundValue) __el.textContent = __boundValue;
|
|
1667
|
-
}
|
|
1668
|
-
} catch {}
|
|
1669
|
-
if (key === "children") try {
|
|
1670
|
-
const __el = document.getElementById(this.id + "-b2");
|
|
1671
|
-
if (__el) {
|
|
1672
|
-
if (__el.innerHTML !== value) {
|
|
1673
|
-
__el.innerHTML = value;
|
|
1674
|
-
this.instantiateChildComponents_();
|
|
1675
|
-
if (this.parentComponent) this.parentComponent.mountCompiledChildComponents_();
|
|
1676
|
-
}
|
|
1677
|
-
}
|
|
1678
|
-
} catch {}
|
|
1679
|
-
if (key === "title") this.__geaPatchCond(0);
|
|
1680
|
-
if (key === "description") this.__geaPatchCond(1);
|
|
1681
|
-
}
|
|
1682
|
-
};
|
|
1683
|
-
//#endregion
|
|
1684
|
-
//#region src/components/progress.tsx
|
|
1685
|
-
var Progress = class extends ZagComponent {
|
|
1686
|
-
constructor(...args) {
|
|
1687
|
-
super(...args);
|
|
1688
|
-
this.percent = 0;
|
|
1689
|
-
try {
|
|
1690
|
-
this.props;
|
|
1691
|
-
this.__geaCond_0 = !!this.props.label;
|
|
1692
|
-
} catch {}
|
|
1693
|
-
this.__geaRegisterCond(0, "c0", () => {
|
|
1694
|
-
this.props;
|
|
1695
|
-
return this.props.label;
|
|
1696
|
-
}, () => {
|
|
1697
|
-
this.props;
|
|
1698
|
-
return `<label data-part="label" class="progress-label text-sm font-medium">${this.props.label}</label>`;
|
|
1699
|
-
}, null);
|
|
1700
|
-
}
|
|
1701
|
-
createMachine(_props) {
|
|
1702
|
-
return progress.machine;
|
|
1703
|
-
}
|
|
1704
|
-
getMachineProps(props) {
|
|
1705
|
-
return {
|
|
1706
|
-
id: this.id,
|
|
1707
|
-
value: props.value,
|
|
1708
|
-
defaultValue: props.defaultValue ?? 0,
|
|
1709
|
-
min: props.min ?? 0,
|
|
1710
|
-
max: props.max ?? 100,
|
|
1711
|
-
orientation: props.orientation,
|
|
1712
|
-
onValueChange: props.onValueChange
|
|
1713
|
-
};
|
|
1714
|
-
}
|
|
1715
|
-
connectApi(service) {
|
|
1716
|
-
return progress.connect(service, normalizeProps);
|
|
1717
|
-
}
|
|
1718
|
-
getSpreadMap() {
|
|
1719
|
-
return {
|
|
1720
|
-
"[data-part=\"root\"]": "getRootProps",
|
|
1721
|
-
"[data-part=\"label\"]": "getLabelProps",
|
|
1722
|
-
"[data-part=\"track\"]": "getTrackProps",
|
|
1723
|
-
"[data-part=\"range\"]": "getRangeProps",
|
|
1724
|
-
"[data-part=\"value-text\"]": "getValueTextProps"
|
|
1725
|
-
};
|
|
1726
|
-
}
|
|
1727
|
-
syncState(api) {
|
|
1728
|
-
this.value = api.value;
|
|
1729
|
-
this.percent = api.percent;
|
|
1730
|
-
}
|
|
1731
|
-
template(props) {
|
|
1732
|
-
Component._register(ZagComponent);
|
|
1733
|
-
return `<div id="${this.id}" data-part="root"${(props.class || "") == null || (props.class || "") === false ? "" : ` class="${(props.class || "").trim()}"`}><div class="flex justify-between mb-1"><!--${this.id + "-c0"}-->${props.label && `<label data-part="label" class="progress-label text-sm font-medium">${props.label}</label>` || ""}<!--${this.id + "-c0-end"}--><span id="${this.id + "-b1"}" data-part="value-text" class="progress-value-text text-sm text-muted-foreground">${this.percent}%</span></div><div data-part="track" class="progress-track relative h-2 w-full overflow-hidden rounded-full bg-primary/20"><div id="${this.id + "-b2"}" data-part="range" class="progress-range h-full w-full flex-1 bg-primary transition-all" style="${`width: ${this.percent}%`}"></div></div></div>`;
|
|
1734
|
-
}
|
|
1735
|
-
__observe_local_percent(percent, change) {
|
|
1736
|
-
if (document.getElementById(this.id + "-b1")) document.getElementById(this.id + "-b1").textContent = `${this.percent}%`;
|
|
1737
|
-
}
|
|
1738
|
-
__onPropChange(key, value) {
|
|
1739
|
-
if (key === "class") try {
|
|
1740
|
-
const __el = this.$(":scope");
|
|
1741
|
-
this.props;
|
|
1742
|
-
const __boundValue = this.props.class || "";
|
|
1743
|
-
if (__el) {
|
|
1744
|
-
const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
|
|
1745
|
-
if (__el.className !== __newClass) __el.className = __newClass;
|
|
1746
|
-
}
|
|
1747
|
-
} catch {}
|
|
1748
|
-
if (key === "label") this.__geaPatchCond(0);
|
|
1749
|
-
}
|
|
1750
|
-
__setupLocalStateObservers() {
|
|
1751
|
-
if (typeof this.__ensureArrayConfigs === "function") this.__ensureArrayConfigs();
|
|
1752
|
-
if (!this.__store) return;
|
|
1753
|
-
this.__observer_removers__.push(this.__store.observe(["percent"], (__v, __c) => {
|
|
1754
|
-
try {
|
|
1755
|
-
this.__observe_local_percent(__v, __c);
|
|
1756
|
-
} catch (_e) {}
|
|
1757
|
-
}));
|
|
1758
|
-
}
|
|
1759
|
-
};
|
|
1760
|
-
//#endregion
|
|
1761
|
-
//#region src/components/radio-group.tsx
|
|
1762
|
-
var RadioGroup = class extends ZagComponent {
|
|
1763
|
-
constructor(...args) {
|
|
1764
|
-
super(...args);
|
|
1765
|
-
try {
|
|
1766
|
-
this.props;
|
|
1767
|
-
this.__geaCond_0 = !!this.props.label;
|
|
1768
|
-
} catch {}
|
|
1769
|
-
this.__geaRegisterCond(0, "c0", () => {
|
|
1770
|
-
this.props;
|
|
1771
|
-
return this.props.label;
|
|
1772
|
-
}, () => {
|
|
1773
|
-
this.props;
|
|
1774
|
-
return `<span data-part="label" class="radio-group-label text-sm font-medium mb-2 block">${this.props.label}</span>`;
|
|
1775
|
-
}, null);
|
|
1776
|
-
}
|
|
1777
|
-
createMachine(_props) {
|
|
1778
|
-
return radioGroup.machine;
|
|
1779
|
-
}
|
|
1780
|
-
getMachineProps(props) {
|
|
1781
|
-
return {
|
|
1782
|
-
id: this.id,
|
|
1783
|
-
value: props.value,
|
|
1784
|
-
defaultValue: props.defaultValue,
|
|
1785
|
-
name: props.name,
|
|
1786
|
-
form: props.form,
|
|
1787
|
-
disabled: props.disabled,
|
|
1788
|
-
readOnly: props.readOnly,
|
|
1789
|
-
orientation: props.orientation ?? "vertical",
|
|
1790
|
-
onValueChange: (details) => {
|
|
1791
|
-
this.value = details.value;
|
|
1792
|
-
props.onValueChange?.(details);
|
|
1793
|
-
}
|
|
1794
|
-
};
|
|
1795
|
-
}
|
|
1796
|
-
connectApi(service) {
|
|
1797
|
-
return radioGroup.connect(service, normalizeProps);
|
|
1798
|
-
}
|
|
1799
|
-
getSpreadMap() {
|
|
1800
|
-
return {
|
|
1801
|
-
"[data-part=\"root\"]": "getRootProps",
|
|
1802
|
-
"[data-part=\"label\"]": "getLabelProps",
|
|
1803
|
-
"[data-part=\"indicator\"]": "getIndicatorProps",
|
|
1804
|
-
"[data-part=\"item\"]": (api, el) => api.getItemProps({ value: el.dataset.value }),
|
|
1805
|
-
"[data-part=\"item-text\"]": (api, el) => api.getItemTextProps({ value: el.dataset.value }),
|
|
1806
|
-
"[data-part=\"item-control\"]": (api, el) => api.getItemControlProps({ value: el.dataset.value }),
|
|
1807
|
-
"[data-part=\"item-hidden-input\"]": (api, el) => api.getItemHiddenInputProps({ value: el.dataset.value })
|
|
1808
|
-
};
|
|
1809
|
-
}
|
|
1810
|
-
syncState(api) {
|
|
1811
|
-
this.value = api.value;
|
|
1812
|
-
}
|
|
1813
|
-
template(props) {
|
|
1814
|
-
Component._register(ZagComponent);
|
|
1815
|
-
const items = props.items || [];
|
|
1816
|
-
return `<div id="${this.id}" data-part="root"${(props.class || "") == null || (props.class || "") === false ? "" : ` class="${(props.class || "").trim()}"`}><!--${this.id + "-c0"}-->${props.label && `<span data-part="label" class="radio-group-label text-sm font-medium mb-2 block">${props.label}</span>` || ""}<!--${this.id + "-c0-end"}--><div data-part="indicator" class="radio-group-indicator"></div>${items.map((item) => `<label data-gea-item-id="${item.value}" data-part="item"${item.value == null || item.value === false ? "" : ` data-value="${item.value}"`} class="radio-group-item flex items-center gap-2 cursor-pointer py-1"><div data-part="item-control"${item.value == null || item.value === false ? "" : ` data-value="${item.value}"`} class="radio-group-item-control h-4 w-4 rounded-full border border-primary flex items-center justify-center"><span class="radio-dot"></span></div><input data-part="item-hidden-input"${item.value == null || item.value === false ? "" : ` data-value="${item.value}"`} type="radio" class="sr-only" /><span data-part="item-text"${item.value == null || item.value === false ? "" : ` data-value="${item.value}"`} class="radio-group-item-text text-sm">${item.label}</span></label>`).join("") + "<!---->"}</div>`;
|
|
1817
|
-
}
|
|
1818
|
-
render__unresolved_0Item(item) {
|
|
1819
|
-
const __v = (v) => v != null && typeof v === "object" ? v.valueOf() : v;
|
|
1820
|
-
return `<label data-gea-item-id="${item.value}" data-part="item"${__v(item.value) == null || __v(item.value) === false ? "" : ` data-value="${item.value}"`} class="radio-group-item flex items-center gap-2 cursor-pointer py-1"><div data-part="item-control"${__v(item.value) == null || __v(item.value) === false ? "" : ` data-value="${item.value}"`} class="radio-group-item-control h-4 w-4 rounded-full border border-primary flex items-center justify-center"><span class="radio-dot"></span></div><input data-part="item-hidden-input"${__v(item.value) == null || __v(item.value) === false ? "" : ` data-value="${item.value}"`} type="radio" class="sr-only" /><span data-part="item-text"${__v(item.value) == null || __v(item.value) === false ? "" : ` data-value="${item.value}"`} class="radio-group-item-text text-sm">${item.label}</span></label>`;
|
|
1821
|
-
}
|
|
1822
|
-
create__unresolved_0Item(item) {
|
|
1823
|
-
var __c = this.____unresolved_0_container;
|
|
1824
|
-
if (!__c.__geaTpl) try {
|
|
1825
|
-
var __tw = document.createElement("template");
|
|
1826
|
-
__tw.innerHTML = this.render__unresolved_0Item({
|
|
1827
|
-
value: 0,
|
|
1828
|
-
label: ""
|
|
1829
|
-
});
|
|
1830
|
-
__c.__geaTpl = __tw.content.firstElementChild;
|
|
1831
|
-
} catch {}
|
|
1832
|
-
if (__c.__geaTpl) var el = __c.__geaTpl.cloneNode(true);
|
|
1833
|
-
else {
|
|
1834
|
-
var __fw = document.createElement("template");
|
|
1835
|
-
__fw.innerHTML = this.render__unresolved_0Item(item);
|
|
1836
|
-
var el = __fw.content.firstElementChild;
|
|
1837
|
-
}
|
|
1838
|
-
var __av = item.value;
|
|
1839
|
-
if (__av == null || __av === false) el.removeAttribute("data-value");
|
|
1840
|
-
else el.setAttribute("data-value", String(__av));
|
|
1841
|
-
var __av = item.value;
|
|
1842
|
-
if (__av == null || __av === false) el.firstElementChild.removeAttribute("data-value");
|
|
1843
|
-
else el.firstElementChild.setAttribute("data-value", String(__av));
|
|
1844
|
-
var __av = item.value;
|
|
1845
|
-
if (__av == null || __av === false) el.firstElementChild.nextElementSibling.removeAttribute("data-value");
|
|
1846
|
-
else el.firstElementChild.nextElementSibling.setAttribute("data-value", String(__av));
|
|
1847
|
-
var __av = item.value;
|
|
1848
|
-
if (__av == null || __av === false) el.firstElementChild.nextElementSibling.nextElementSibling.removeAttribute("data-value");
|
|
1849
|
-
else el.firstElementChild.nextElementSibling.nextElementSibling.setAttribute("data-value", String(__av));
|
|
1850
|
-
el.firstElementChild.nextElementSibling.nextElementSibling.textContent = `
|
|
1851
|
-
${item.label}
|
|
1852
|
-
`;
|
|
1853
|
-
el.setAttribute("data-gea-item-id", item.value);
|
|
1854
|
-
el.__geaItem = item;
|
|
1855
|
-
return el;
|
|
1856
|
-
}
|
|
1857
|
-
__onPropChange(key, value) {
|
|
1858
|
-
if (key === "class") try {
|
|
1859
|
-
const __el = this.$(":scope");
|
|
1860
|
-
this.props;
|
|
1861
|
-
const __boundValue = this.props.class || "";
|
|
1862
|
-
if (__el) {
|
|
1863
|
-
const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
|
|
1864
|
-
if (__el.className !== __newClass) __el.className = __newClass;
|
|
1865
|
-
}
|
|
1866
|
-
} catch {}
|
|
1867
|
-
if (key === "label") this.__geaPatchCond(0);
|
|
1868
|
-
if (key === "items") this.__geaSyncMap(0);
|
|
1869
|
-
}
|
|
1870
|
-
__observe_local_props(__v, __c) {
|
|
1871
|
-
this.__geaSyncMap(0);
|
|
1872
|
-
}
|
|
1873
|
-
createdHooks() {
|
|
1874
|
-
if (!this.__observer_removers__) this.__observer_removers__ = [];
|
|
1875
|
-
if (!this.__stores) this.__stores = {};
|
|
1876
|
-
this.__observer_removers__.forEach((fn) => fn());
|
|
1877
|
-
this.__observer_removers__ = [];
|
|
1878
|
-
if (typeof this.__ensureArrayConfigs === "function") this.__ensureArrayConfigs();
|
|
1879
|
-
this.__geaRegisterMap(0, "____unresolved_0_container", () => this.$(":scope"), () => {
|
|
1880
|
-
return this.props.items || [];
|
|
1881
|
-
}, (__item) => this.create__unresolved_0Item(__item), "value");
|
|
1882
|
-
}
|
|
1883
|
-
};
|
|
1884
|
-
//#endregion
|
|
1885
|
-
//#region src/components/rating-group.tsx
|
|
1886
|
-
var RatingGroup = class extends ZagComponent {
|
|
1887
|
-
constructor(...args) {
|
|
1888
|
-
super(...args);
|
|
1889
|
-
try {
|
|
1890
|
-
this.props;
|
|
1891
|
-
this.__geaCond_0 = !!this.props.label;
|
|
1892
|
-
} catch {}
|
|
1893
|
-
this.__geaRegisterCond(0, "c0", () => {
|
|
1894
|
-
this.props;
|
|
1895
|
-
return this.props.label;
|
|
1896
|
-
}, () => {
|
|
1897
|
-
this.props;
|
|
1898
|
-
return `<label data-part="label" class="rating-group-label text-sm font-medium mb-1 block">${this.props.label}</label>`;
|
|
1899
|
-
}, null);
|
|
1900
|
-
}
|
|
1901
|
-
createMachine(_props) {
|
|
1902
|
-
return ratingGroup.machine;
|
|
1903
|
-
}
|
|
1904
|
-
getMachineProps(props) {
|
|
1905
|
-
this._allowHalf = !!props.allowHalf;
|
|
1906
|
-
return {
|
|
1907
|
-
id: this.id,
|
|
1908
|
-
value: props.value,
|
|
1909
|
-
defaultValue: props.defaultValue,
|
|
1910
|
-
count: props.count ?? 5,
|
|
1911
|
-
allowHalf: !!props.allowHalf,
|
|
1912
|
-
readOnly: props.readOnly,
|
|
1913
|
-
disabled: props.disabled,
|
|
1914
|
-
name: props.name,
|
|
1915
|
-
form: props.form,
|
|
1916
|
-
onValueChange: (details) => {
|
|
1917
|
-
this.value = details.value;
|
|
1918
|
-
props.onValueChange?.(details);
|
|
1919
|
-
}
|
|
1920
|
-
};
|
|
1921
|
-
}
|
|
1922
|
-
connectApi(service) {
|
|
1923
|
-
return ratingGroup.connect(service, normalizeProps);
|
|
1924
|
-
}
|
|
1925
|
-
getSpreadMap() {
|
|
1926
|
-
return {
|
|
1927
|
-
"[data-part=\"root\"]": "getRootProps",
|
|
1928
|
-
"[data-part=\"label\"]": "getLabelProps",
|
|
1929
|
-
"[data-part=\"control\"]": "getControlProps",
|
|
1930
|
-
"[data-part=\"hidden-input\"]": "getHiddenInputProps",
|
|
1931
|
-
"[data-part=\"item\"]": (api, el) => {
|
|
1932
|
-
const htmlEl = el;
|
|
1933
|
-
const index = parseInt(htmlEl.dataset.index || "0", 10);
|
|
1934
|
-
const props = api.getItemProps({ index });
|
|
1935
|
-
if (this._allowHalf) props.onpointerdown = (e) => {
|
|
1936
|
-
const rect = htmlEl.getBoundingClientRect();
|
|
1937
|
-
const isLeftHalf = e.clientX - rect.left < rect.width / 2;
|
|
1938
|
-
api.setValue(isLeftHalf ? index - .5 : index);
|
|
1939
|
-
};
|
|
1940
|
-
return props;
|
|
1941
|
-
}
|
|
1942
|
-
};
|
|
1943
|
-
}
|
|
1944
|
-
syncState(api) {
|
|
1945
|
-
this.value = api.value;
|
|
1946
|
-
}
|
|
1947
|
-
_applyAllSpreads() {
|
|
1948
|
-
super._applyAllSpreads();
|
|
1949
|
-
if (!this._api || !this.el) return;
|
|
1950
|
-
const items = this.el.querySelectorAll("[data-part=\"item\"]");
|
|
1951
|
-
for (let i = 0; i < items.length; i++) {
|
|
1952
|
-
const el = items[i];
|
|
1953
|
-
const index = parseInt(el.dataset.index || "0", 10);
|
|
1954
|
-
if (this._api.getItemState({ index }).half) {
|
|
1955
|
-
el.style.background = "linear-gradient(90deg, #facc15 50%, hsl(var(--muted-foreground)) 50%)";
|
|
1956
|
-
el.style.backgroundClip = "text";
|
|
1957
|
-
el.style.setProperty("-webkit-background-clip", "text");
|
|
1958
|
-
el.style.setProperty("-webkit-text-fill-color", "transparent");
|
|
1959
|
-
} else {
|
|
1960
|
-
el.style.background = "";
|
|
1961
|
-
el.style.backgroundClip = "";
|
|
1962
|
-
el.style.setProperty("-webkit-background-clip", "");
|
|
1963
|
-
el.style.setProperty("-webkit-text-fill-color", "");
|
|
1964
|
-
}
|
|
1965
|
-
}
|
|
1966
|
-
}
|
|
1967
|
-
template(props) {
|
|
1968
|
-
Component._register(ZagComponent);
|
|
1969
|
-
const count = props.count ?? 5;
|
|
1970
|
-
const items = Array.from({ length: count }, (_, i) => i + 1);
|
|
1971
|
-
return `<div id="${this.id}" data-part="root"${(props.class || "") == null || (props.class || "") === false ? "" : ` class="${(props.class || "").trim()}"`}><!--${this.id + "-c0"}-->${props.label && `<label data-part="label" class="rating-group-label text-sm font-medium mb-1 block">${props.label}</label>` || ""}<!--${this.id + "-c0-end"}--><div id="${this.id + "-b1"}" data-part="control" class="rating-group-control flex gap-0.5">${items.map((i) => `<span id="${this.id + "-b1-" + String(String(i))}" data-gea-item-id="${String(i)}" data-part="item"${String(i) == null || String(i) === false ? "" : ` data-index="${String(i)}"`} class="rating-group-item cursor-pointer text-2xl text-muted-foreground data-[highlighted]:text-yellow-400 data-[checked]:text-yellow-400" style="line-height: 1;">★</span>`).join("") + "<!---->"}</div><input data-part="hidden-input" type="hidden" /></div>`;
|
|
1972
|
-
}
|
|
1973
|
-
render__unresolved_0Item(i) {
|
|
1974
|
-
const __v = (v) => v != null && typeof v === "object" ? v.valueOf() : v;
|
|
1975
|
-
return `<span id="${this.id + "-b1-" + String(String(i))}" data-gea-item-id="${String(i)}" data-part="item"${__v(String(i)) == null || __v(String(i)) === false ? "" : ` data-index="${String(i)}"`} class="rating-group-item cursor-pointer text-2xl text-muted-foreground data-[highlighted]:text-yellow-400 data-[checked]:text-yellow-400" style="line-height: 1;">★</span>`;
|
|
1976
|
-
}
|
|
1977
|
-
create__unresolved_0Item(item) {
|
|
1978
|
-
var __c = this.____unresolved_0_container;
|
|
1979
|
-
if (!__c.__geaTpl) try {
|
|
1980
|
-
var __tw = document.createElement("template");
|
|
1981
|
-
__tw.innerHTML = this.render__unresolved_0Item("__dummy__");
|
|
1982
|
-
__c.__geaTpl = __tw.content.firstElementChild;
|
|
1983
|
-
} catch {}
|
|
1984
|
-
if (!__c.__geaIdPfx) __c.__geaIdPfx = this.id_ + "-b1-";
|
|
1985
|
-
if (__c.__geaTpl) var el = __c.__geaTpl.cloneNode(true);
|
|
1986
|
-
else {
|
|
1987
|
-
var __fw = document.createElement("template");
|
|
1988
|
-
__fw.innerHTML = this.render__unresolved_0Item(item);
|
|
1989
|
-
var el = __fw.content.firstElementChild;
|
|
1990
|
-
}
|
|
1991
|
-
var __av = String(item);
|
|
1992
|
-
if (__av == null || __av === false) el.removeAttribute("data-index");
|
|
1993
|
-
else el.setAttribute("data-index", String(__av));
|
|
1994
|
-
el.setAttribute("data-gea-item-id", String(item));
|
|
1995
|
-
el.id = __c.__geaIdPfx + String(item);
|
|
1996
|
-
el.__geaItem = item;
|
|
1997
|
-
return el;
|
|
1998
|
-
}
|
|
1999
|
-
__onPropChange(key, value) {
|
|
2000
|
-
if (key === "class") try {
|
|
2001
|
-
const __el = this.$(":scope");
|
|
2002
|
-
this.props;
|
|
2003
|
-
const __boundValue = this.props.class || "";
|
|
2004
|
-
if (__el) {
|
|
2005
|
-
const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
|
|
2006
|
-
if (__el.className !== __newClass) __el.className = __newClass;
|
|
2007
|
-
}
|
|
2008
|
-
} catch {}
|
|
2009
|
-
if (key === "label") this.__geaPatchCond(0);
|
|
2010
|
-
if (key === "count") this.__geaSyncMap(0);
|
|
2011
|
-
}
|
|
2012
|
-
__observe_local_props(__v, __c) {
|
|
2013
|
-
this.__geaSyncMap(0);
|
|
2014
|
-
}
|
|
2015
|
-
createdHooks() {
|
|
2016
|
-
if (!this.__observer_removers__) this.__observer_removers__ = [];
|
|
2017
|
-
if (!this.__stores) this.__stores = {};
|
|
2018
|
-
this.__observer_removers__.forEach((fn) => fn());
|
|
2019
|
-
this.__observer_removers__ = [];
|
|
2020
|
-
if (typeof this.__ensureArrayConfigs === "function") this.__ensureArrayConfigs();
|
|
2021
|
-
this.__geaRegisterMap(0, "____unresolved_0_container", () => document.getElementById(this.id + "-b1"), () => {
|
|
2022
|
-
const count = this.props.count ?? 5;
|
|
2023
|
-
return Array.from({ length: count }, (_, i) => i + 1);
|
|
2024
|
-
}, (__item) => this.create__unresolved_0Item(__item));
|
|
2025
|
-
}
|
|
2026
|
-
};
|
|
2027
|
-
//#endregion
|
|
2028
|
-
//#region src/components/select.tsx
|
|
2029
|
-
var Select = class extends ZagComponent {
|
|
2030
|
-
constructor(...args) {
|
|
2031
|
-
super(...args);
|
|
2032
|
-
try {
|
|
2033
|
-
this.props;
|
|
2034
|
-
this.__geaCond_0 = !!this.props.label;
|
|
2035
|
-
} catch {}
|
|
2036
|
-
this.__geaRegisterCond(0, "c0", () => {
|
|
2037
|
-
this.props;
|
|
2038
|
-
return this.props.label;
|
|
2039
|
-
}, () => {
|
|
2040
|
-
this.props;
|
|
2041
|
-
return `<label data-part="label" class="select-label text-sm font-medium mb-1 block">${this.props.label}</label>`;
|
|
2042
|
-
}, null);
|
|
2043
|
-
}
|
|
2044
|
-
createMachine(_props) {
|
|
2045
|
-
return select.machine;
|
|
2046
|
-
}
|
|
2047
|
-
getMachineProps(props) {
|
|
2048
|
-
const items = props.items || [];
|
|
2049
|
-
const col = props.collection || select.collection({
|
|
2050
|
-
items,
|
|
2051
|
-
itemToValue: (item) => item.value,
|
|
2052
|
-
itemToString: (item) => item.label || item.value
|
|
2053
|
-
});
|
|
2054
|
-
return {
|
|
2055
|
-
id: this.id,
|
|
2056
|
-
collection: col,
|
|
2057
|
-
value: props.value,
|
|
2058
|
-
defaultValue: props.defaultValue,
|
|
2059
|
-
open: props.open,
|
|
2060
|
-
defaultOpen: props.defaultOpen,
|
|
2061
|
-
multiple: props.multiple,
|
|
2062
|
-
disabled: props.disabled,
|
|
2063
|
-
invalid: props.invalid,
|
|
2064
|
-
readOnly: props.readOnly,
|
|
2065
|
-
required: props.required,
|
|
2066
|
-
name: props.name,
|
|
2067
|
-
form: props.form,
|
|
2068
|
-
closeOnSelect: props.closeOnSelect ?? true,
|
|
2069
|
-
positioning: props.positioning,
|
|
2070
|
-
loopFocus: props.loopFocus ?? false,
|
|
2071
|
-
onValueChange: (details) => {
|
|
2072
|
-
this.value = details.value;
|
|
2073
|
-
this.valueAsString = details.items.map((i) => i.label || i.value).join(", ");
|
|
2074
|
-
props.onValueChange?.(details);
|
|
2075
|
-
},
|
|
2076
|
-
onOpenChange: (details) => {
|
|
2077
|
-
this.open = details.open;
|
|
2078
|
-
props.onOpenChange?.(details);
|
|
2079
|
-
}
|
|
2080
|
-
};
|
|
2081
|
-
}
|
|
2082
|
-
connectApi(service) {
|
|
2083
|
-
return select.connect(service, normalizeProps);
|
|
2084
|
-
}
|
|
2085
|
-
getSpreadMap() {
|
|
2086
|
-
return {
|
|
2087
|
-
"[data-part=\"root\"]": "getRootProps",
|
|
2088
|
-
"[data-part=\"label\"]": "getLabelProps",
|
|
2089
|
-
"[data-part=\"control\"]": "getControlProps",
|
|
2090
|
-
"[data-part=\"trigger\"]": "getTriggerProps",
|
|
2091
|
-
"[data-part=\"indicator\"]": "getIndicatorProps",
|
|
2092
|
-
"[data-part=\"clear-trigger\"]": "getClearTriggerProps",
|
|
2093
|
-
"[data-part=\"value-text\"]": "getValueTextProps",
|
|
2094
|
-
"[data-part=\"positioner\"]": "getPositionerProps",
|
|
2095
|
-
"[data-part=\"content\"]": "getContentProps",
|
|
2096
|
-
"[data-part=\"list\"]": "getListProps",
|
|
2097
|
-
"[data-part=\"item\"]": (api, el) => {
|
|
2098
|
-
const value = el.dataset.value;
|
|
2099
|
-
const label = el.dataset.label || value;
|
|
2100
|
-
return api.getItemProps({ item: {
|
|
2101
|
-
value,
|
|
2102
|
-
label
|
|
2103
|
-
} });
|
|
2104
|
-
},
|
|
2105
|
-
"[data-part=\"item-text\"]": (api, el) => {
|
|
2106
|
-
const value = el.dataset.value;
|
|
2107
|
-
const label = el.dataset.label || value;
|
|
2108
|
-
return api.getItemTextProps({ item: {
|
|
2109
|
-
value,
|
|
2110
|
-
label
|
|
2111
|
-
} });
|
|
2112
|
-
},
|
|
2113
|
-
"[data-part=\"item-indicator\"]": (api, el) => {
|
|
2114
|
-
const value = el.dataset.value;
|
|
2115
|
-
const label = el.dataset.label || value;
|
|
2116
|
-
return api.getItemIndicatorProps({ item: {
|
|
2117
|
-
value,
|
|
2118
|
-
label
|
|
2119
|
-
} });
|
|
2120
|
-
}
|
|
2121
|
-
};
|
|
2122
|
-
}
|
|
2123
|
-
syncState(api) {
|
|
2124
|
-
this.open = api.open;
|
|
2125
|
-
this.value = api.value;
|
|
2126
|
-
this.valueAsString = api.valueAsString;
|
|
2127
|
-
}
|
|
2128
|
-
template(props) {
|
|
2129
|
-
Component._register(ZagComponent);
|
|
2130
|
-
const items = props.items || [];
|
|
2131
|
-
return `<div id="${this.id}" data-part="root"${(props.class || "") == null || (props.class || "") === false ? "" : ` class="${(props.class || "").trim()}"`}><!--${this.id + "-c0"}-->${props.label && `<label data-part="label" class="select-label text-sm font-medium mb-1 block">${props.label}</label>` || ""}<!--${this.id + "-c0-end"}--><div data-part="control" class="select-control"><button data-part="trigger" class="select-trigger flex h-9 w-full items-center justify-between 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 id="${this.id + "-b1"}" data-part="value-text" class="select-value-text">${this.valueAsString || props.placeholder || "Select..."}</span><span data-part="indicator" class="select-indicator">▼</span></button></div><div data-part="positioner" class="select-positioner"><div data-part="content" class="select-content z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md"><div id="${this.id + "-b2"}" data-part="list">${items.map((item) => `<div id="${this.id + "-b2-" + String(item.value)}" data-gea-item-id="${item.value}" data-part="item"${item.value == null || item.value === false ? "" : ` data-value="${item.value}"`}${item.label == null || item.label === false ? "" : ` data-label="${item.label}"`} class="select-item relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50"><span data-part="item-text"${item.value == null || item.value === false ? "" : ` data-value="${item.value}"`}${item.label == null || item.label === false ? "" : ` data-label="${item.label}"`}>${item.label}</span><span data-part="item-indicator"${item.value == null || item.value === false ? "" : ` data-value="${item.value}"`}${item.label == null || item.label === false ? "" : ` data-label="${item.label}"`} class="select-item-indicator ml-auto">✓</span></div>`).join("") + "<!---->"}</div></div></div></div>`;
|
|
2132
|
-
}
|
|
2133
|
-
render__unresolved_0Item(item) {
|
|
2134
|
-
const __v = (v) => v != null && typeof v === "object" ? v.valueOf() : v;
|
|
2135
|
-
return `<div id="${this.id + "-b2-" + String(item.value)}" data-gea-item-id="${item.value}" data-part="item"${__v(item.value) == null || __v(item.value) === false ? "" : ` data-value="${item.value}"`}${__v(item.label) == null || __v(item.label) === false ? "" : ` data-label="${item.label}"`} class="select-item relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50"><span data-part="item-text"${__v(item.value) == null || __v(item.value) === false ? "" : ` data-value="${item.value}"`}${__v(item.label) == null || __v(item.label) === false ? "" : ` data-label="${item.label}"`}>${item.label}</span><span data-part="item-indicator"${__v(item.value) == null || __v(item.value) === false ? "" : ` data-value="${item.value}"`}${__v(item.label) == null || __v(item.label) === false ? "" : ` data-label="${item.label}"`} class="select-item-indicator ml-auto">✓</span></div>`;
|
|
2136
|
-
}
|
|
2137
|
-
create__unresolved_0Item(item) {
|
|
2138
|
-
var __c = this.____unresolved_0_container;
|
|
2139
|
-
if (!__c.__geaTpl) try {
|
|
2140
|
-
var __tw = document.createElement("template");
|
|
2141
|
-
__tw.innerHTML = this.render__unresolved_0Item({
|
|
2142
|
-
value: 0,
|
|
2143
|
-
label: ""
|
|
2144
|
-
});
|
|
2145
|
-
__c.__geaTpl = __tw.content.firstElementChild;
|
|
2146
|
-
} catch {}
|
|
2147
|
-
if (!__c.__geaIdPfx) __c.__geaIdPfx = this.id_ + "-b2-";
|
|
2148
|
-
if (__c.__geaTpl) var el = __c.__geaTpl.cloneNode(true);
|
|
2149
|
-
else {
|
|
2150
|
-
var __fw = document.createElement("template");
|
|
2151
|
-
__fw.innerHTML = this.render__unresolved_0Item(item);
|
|
2152
|
-
var el = __fw.content.firstElementChild;
|
|
2153
|
-
}
|
|
2154
|
-
var __av = item.value;
|
|
2155
|
-
if (__av == null || __av === false) el.removeAttribute("data-value");
|
|
2156
|
-
else el.setAttribute("data-value", String(__av));
|
|
2157
|
-
var __av = item.label;
|
|
2158
|
-
if (__av == null || __av === false) el.removeAttribute("data-label");
|
|
2159
|
-
else el.setAttribute("data-label", String(__av));
|
|
2160
|
-
var __av = item.value;
|
|
2161
|
-
if (__av == null || __av === false) el.firstElementChild.removeAttribute("data-value");
|
|
2162
|
-
else el.firstElementChild.setAttribute("data-value", String(__av));
|
|
2163
|
-
var __av = item.label;
|
|
2164
|
-
if (__av == null || __av === false) el.firstElementChild.removeAttribute("data-label");
|
|
2165
|
-
else el.firstElementChild.setAttribute("data-label", String(__av));
|
|
2166
|
-
el.firstElementChild.textContent = `
|
|
2167
|
-
${item.label}
|
|
2168
|
-
`;
|
|
2169
|
-
var __av = item.value;
|
|
2170
|
-
if (__av == null || __av === false) el.firstElementChild.nextElementSibling.removeAttribute("data-value");
|
|
2171
|
-
else el.firstElementChild.nextElementSibling.setAttribute("data-value", String(__av));
|
|
2172
|
-
var __av = item.label;
|
|
2173
|
-
if (__av == null || __av === false) el.firstElementChild.nextElementSibling.removeAttribute("data-label");
|
|
2174
|
-
else el.firstElementChild.nextElementSibling.setAttribute("data-label", String(__av));
|
|
2175
|
-
el.setAttribute("data-gea-item-id", item.value);
|
|
2176
|
-
el.id = __c.__geaIdPfx + item.value;
|
|
2177
|
-
el.__geaItem = item;
|
|
2178
|
-
return el;
|
|
2179
|
-
}
|
|
2180
|
-
__onPropChange(key, value) {
|
|
2181
|
-
if (key === "class") try {
|
|
2182
|
-
const __el = this.$(":scope");
|
|
2183
|
-
this.props;
|
|
2184
|
-
const __boundValue = this.props.class || "";
|
|
2185
|
-
if (__el) {
|
|
2186
|
-
const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
|
|
2187
|
-
if (__el.className !== __newClass) __el.className = __newClass;
|
|
2188
|
-
}
|
|
2189
|
-
} catch {}
|
|
2190
|
-
if (key === "placeholder") try {
|
|
2191
|
-
const __el = document.getElementById(this.id + "-b1");
|
|
2192
|
-
this.props;
|
|
2193
|
-
const __boundValue = this.valueAsString || this.props.placeholder || "Select...";
|
|
2194
|
-
if (__el) {
|
|
2195
|
-
if (__el.textContent !== __boundValue) __el.textContent = __boundValue;
|
|
2196
|
-
}
|
|
2197
|
-
} catch {}
|
|
2198
|
-
if (key === "label") this.__geaPatchCond(0);
|
|
2199
|
-
if (key === "items") this.__geaSyncMap(0);
|
|
2200
|
-
}
|
|
2201
|
-
__observe_local_valueAsString(value, change) {
|
|
2202
|
-
if (this.rendered_) {
|
|
2203
|
-
const __el = document.getElementById(this.id + "-b1");
|
|
2204
|
-
this.props;
|
|
2205
|
-
const __boundValue = this.valueAsString || this.props.placeholder || "Select...";
|
|
2206
|
-
if (__el) {
|
|
2207
|
-
if (__el.textContent !== __boundValue) __el.textContent = __boundValue;
|
|
2208
|
-
}
|
|
2209
|
-
}
|
|
2210
|
-
}
|
|
2211
|
-
__observe_local_props(__v, __c) {
|
|
2212
|
-
this.__geaSyncMap(0);
|
|
2213
|
-
}
|
|
2214
|
-
createdHooks() {
|
|
2215
|
-
if (!this.__observer_removers__) this.__observer_removers__ = [];
|
|
2216
|
-
if (!this.__stores) this.__stores = {};
|
|
2217
|
-
this.__observer_removers__.forEach((fn) => fn());
|
|
2218
|
-
this.__observer_removers__ = [];
|
|
2219
|
-
if (typeof this.__ensureArrayConfigs === "function") this.__ensureArrayConfigs();
|
|
2220
|
-
this.__geaRegisterMap(0, "____unresolved_0_container", () => document.getElementById(this.id + "-b2"), () => {
|
|
2221
|
-
return this.props.items || [];
|
|
2222
|
-
}, (__item) => this.create__unresolved_0Item(__item), "value");
|
|
2223
|
-
}
|
|
2224
|
-
__setupLocalStateObservers() {
|
|
2225
|
-
if (typeof this.__ensureArrayConfigs === "function") this.__ensureArrayConfigs();
|
|
2226
|
-
if (!this.__store) return;
|
|
2227
|
-
this.__observer_removers__.push(this.__store.observe(["valueAsString"], (__v, __c) => {
|
|
2228
|
-
try {
|
|
2229
|
-
this.__observe_local_valueAsString(__v, __c);
|
|
2230
|
-
} catch (_e) {}
|
|
2231
|
-
}));
|
|
2232
|
-
}
|
|
2233
|
-
};
|
|
2234
|
-
//#endregion
|
|
2235
|
-
//#region src/components/slider.tsx
|
|
2236
|
-
const THUMB_CLASS = "slider-thumb block h-5 w-5 rounded-full border-2 border-primary bg-background shadow ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2";
|
|
2237
|
-
var Slider = class extends ZagComponent {
|
|
2238
|
-
constructor(...args) {
|
|
2239
|
-
super(...args);
|
|
2240
|
-
try {
|
|
2241
|
-
this.props;
|
|
2242
|
-
this.__geaCond_0 = !!this.props.label;
|
|
2243
|
-
} catch {}
|
|
2244
|
-
this.__geaRegisterCond(0, "c0", () => {
|
|
2245
|
-
this.props;
|
|
2246
|
-
return this.props.label;
|
|
2247
|
-
}, () => {
|
|
2248
|
-
this.props;
|
|
2249
|
-
return `<div class="flex justify-between mb-2"><label data-part="label" class="slider-label text-sm font-medium">${this.props.label}</label></div>`;
|
|
2250
|
-
}, null);
|
|
2251
|
-
}
|
|
2252
|
-
createMachine(_props) {
|
|
2253
|
-
return slider.machine;
|
|
2254
|
-
}
|
|
2255
|
-
getMachineProps(props) {
|
|
2256
|
-
return {
|
|
2257
|
-
id: this.id,
|
|
2258
|
-
value: props.value,
|
|
2259
|
-
defaultValue: props.defaultValue ?? [50],
|
|
2260
|
-
min: props.min ?? 0,
|
|
2261
|
-
max: props.max ?? 100,
|
|
2262
|
-
step: props.step ?? 1,
|
|
2263
|
-
orientation: props.orientation ?? "horizontal",
|
|
2264
|
-
thumbAlignment: props.thumbAlignment ?? "center",
|
|
2265
|
-
disabled: props.disabled,
|
|
2266
|
-
readOnly: props.readOnly,
|
|
2267
|
-
name: props.name,
|
|
2268
|
-
"aria-label": props["aria-label"],
|
|
2269
|
-
onValueChange: (details) => {
|
|
2270
|
-
this.value = details.value;
|
|
2271
|
-
props.onValueChange?.(details);
|
|
2272
|
-
},
|
|
2273
|
-
onValueChangeEnd: props.onValueChangeEnd
|
|
2274
|
-
};
|
|
2275
|
-
}
|
|
2276
|
-
connectApi(service) {
|
|
2277
|
-
return slider.connect(service, normalizeProps);
|
|
2278
|
-
}
|
|
2279
|
-
getSpreadMap() {
|
|
2280
|
-
return {
|
|
2281
|
-
"[data-part=\"root\"]": "getRootProps",
|
|
2282
|
-
"[data-part=\"label\"]": "getLabelProps",
|
|
2283
|
-
"[data-part=\"control\"]": "getControlProps",
|
|
2284
|
-
"[data-part=\"track\"]": "getTrackProps",
|
|
2285
|
-
"[data-part=\"range\"]": "getRangeProps",
|
|
2286
|
-
"[data-part=\"thumb\"]": (api, el) => {
|
|
2287
|
-
const index = parseInt(el.dataset.index || "0", 10);
|
|
2288
|
-
return api.getThumbProps({ index });
|
|
2289
|
-
},
|
|
2290
|
-
"[data-part=\"hidden-input\"]": (api, el) => {
|
|
2291
|
-
const index = parseInt(el.dataset.index || "0", 10);
|
|
2292
|
-
return api.getHiddenInputProps({ index });
|
|
2293
|
-
}
|
|
2294
|
-
};
|
|
2295
|
-
}
|
|
2296
|
-
_syncThumbs() {
|
|
2297
|
-
if (!this._api || !this.el) return;
|
|
2298
|
-
const control = this.el.querySelector("[data-part=\"control\"]");
|
|
2299
|
-
if (!control) return;
|
|
2300
|
-
const thumbCount = this._api.value.length;
|
|
2301
|
-
const existing = control.querySelectorAll(":scope > [data-part=\"thumb\"]");
|
|
2302
|
-
if (existing.length === thumbCount) return;
|
|
2303
|
-
if (existing.length < thumbCount) for (let i = existing.length; i < thumbCount; i++) {
|
|
2304
|
-
const thumb = document.createElement("div");
|
|
2305
|
-
thumb.setAttribute("data-part", "thumb");
|
|
2306
|
-
thumb.setAttribute("data-index", String(i));
|
|
2307
|
-
thumb.className = THUMB_CLASS;
|
|
2308
|
-
const input = document.createElement("input");
|
|
2309
|
-
input.setAttribute("data-part", "hidden-input");
|
|
2310
|
-
input.setAttribute("data-index", String(i));
|
|
2311
|
-
input.type = "hidden";
|
|
2312
|
-
thumb.appendChild(input);
|
|
2313
|
-
control.appendChild(thumb);
|
|
2314
|
-
}
|
|
2315
|
-
else for (let i = existing.length - 1; i >= thumbCount; i--) existing[i].remove();
|
|
2316
|
-
}
|
|
2317
|
-
syncState(api) {
|
|
2318
|
-
this.value = api.value;
|
|
2319
|
-
}
|
|
2320
|
-
_applyAllSpreads() {
|
|
2321
|
-
this._syncThumbs();
|
|
2322
|
-
super._applyAllSpreads();
|
|
2323
|
-
}
|
|
2324
|
-
template(props) {
|
|
2325
|
-
Component._register(ZagComponent);
|
|
2326
|
-
return `<div id="${this.id}" data-part="root"${"w-full " + (props.class || "") == null || "w-full " + (props.class || "") === false ? "" : ` class="${("w-full " + (props.class || "")).trim()}"`}><!--${this.id + "-c0"}-->${props.label && `<div class="flex justify-between mb-2"><label data-part="label" class="slider-label text-sm font-medium">${props.label}</label></div>` || ""}<!--${this.id + "-c0-end"}--><div data-part="control" class="slider-control relative flex items-center"><div data-part="track" class="slider-track relative h-1.5 w-full grow overflow-hidden rounded-full bg-primary/20"><div data-part="range" class="slider-range absolute h-full bg-primary"></div></div><div data-part="thumb" data-index="0"${THUMB_CLASS == null || THUMB_CLASS === false ? "" : ` class="${THUMB_CLASS.trim()}"`}><input data-part="hidden-input" data-index="0" type="hidden" /></div></div></div>`;
|
|
2327
|
-
}
|
|
2328
|
-
__onPropChange(key, value) {
|
|
2329
|
-
if (key === "class") try {
|
|
2330
|
-
const __el = this.$(":scope");
|
|
2331
|
-
this.props;
|
|
2332
|
-
const __boundValue = "w-full " + (this.props.class || "");
|
|
2333
|
-
if (__el) {
|
|
2334
|
-
const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
|
|
2335
|
-
if (__el.className !== __newClass) __el.className = __newClass;
|
|
2336
|
-
}
|
|
2337
|
-
} catch {}
|
|
2338
|
-
if (key === "label") this.__geaPatchCond(0);
|
|
2339
|
-
}
|
|
2340
|
-
};
|
|
2341
|
-
//#endregion
|
|
2342
|
-
//#region src/components/switch.tsx
|
|
2343
|
-
var Switch = class extends ZagComponent {
|
|
2344
|
-
constructor(...args) {
|
|
2345
|
-
super(...args);
|
|
2346
|
-
this.checked = false;
|
|
2347
|
-
try {
|
|
2348
|
-
this.props;
|
|
2349
|
-
this.__geaCond_0 = !!this.props.label;
|
|
2350
|
-
} catch {}
|
|
2351
|
-
this.__geaRegisterCond(0, "c0", () => {
|
|
2352
|
-
this.props;
|
|
2353
|
-
return this.props.label;
|
|
2354
|
-
}, () => {
|
|
2355
|
-
this.props;
|
|
2356
|
-
return `<span data-part="label" class="switch-label text-sm font-medium">${this.props.label}</span>`;
|
|
2357
|
-
}, null);
|
|
2358
|
-
}
|
|
2359
|
-
createMachine(_props) {
|
|
2360
|
-
return switchMachine.machine;
|
|
2361
|
-
}
|
|
2362
|
-
getMachineProps(props) {
|
|
2363
|
-
return {
|
|
2364
|
-
id: this.id,
|
|
2365
|
-
checked: props.checked,
|
|
2366
|
-
defaultChecked: props.defaultChecked,
|
|
2367
|
-
disabled: props.disabled,
|
|
2368
|
-
invalid: props.invalid,
|
|
2369
|
-
required: props.required,
|
|
2370
|
-
readOnly: props.readOnly,
|
|
2371
|
-
name: props.name,
|
|
2372
|
-
form: props.form,
|
|
2373
|
-
value: props.value ?? "on",
|
|
2374
|
-
onCheckedChange: (details) => {
|
|
2375
|
-
this.checked = details.checked;
|
|
2376
|
-
props.onCheckedChange?.(details);
|
|
2377
|
-
}
|
|
2378
|
-
};
|
|
2379
|
-
}
|
|
2380
|
-
connectApi(service) {
|
|
2381
|
-
return switchMachine.connect(service, normalizeProps);
|
|
2382
|
-
}
|
|
2383
|
-
getSpreadMap() {
|
|
2384
|
-
return {
|
|
2385
|
-
"[data-part=\"root\"]": "getRootProps",
|
|
2386
|
-
"[data-part=\"label\"]": "getLabelProps",
|
|
2387
|
-
"[data-part=\"control\"]": "getControlProps",
|
|
2388
|
-
"[data-part=\"thumb\"]": "getThumbProps",
|
|
2389
|
-
"[data-part=\"hidden-input\"]": "getHiddenInputProps"
|
|
2390
|
-
};
|
|
2391
|
-
}
|
|
2392
|
-
syncState(api) {
|
|
2393
|
-
this.checked = api.checked;
|
|
2394
|
-
}
|
|
2395
|
-
template(props) {
|
|
2396
|
-
Component._register(ZagComponent);
|
|
2397
|
-
return `<label id="${this.id}" data-part="root" class="${`switch-root inline-flex items-center gap-2 cursor-pointer ${props.class || ""}`.trim()}"><input data-part="hidden-input" type="checkbox" /><span data-part="control" class="switch-control inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors data-[state=checked]:bg-primary data-[state=unchecked]:bg-input"><span data-part="thumb" class="switch-thumb pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0"></span></span><!--${this.id + "-c0"}-->${props.label && `<span data-part="label" class="switch-label text-sm font-medium">${props.label}</span>` || ""}<!--${this.id + "-c0-end"}--></label>`;
|
|
2398
|
-
}
|
|
2399
|
-
__onPropChange(key, value) {
|
|
2400
|
-
if (key === "class") try {
|
|
2401
|
-
const __el = this.$(":scope");
|
|
2402
|
-
this.props;
|
|
2403
|
-
const __boundValue = `switch-root inline-flex items-center gap-2 cursor-pointer ${this.props.class || ""}`;
|
|
2404
|
-
if (__el) {
|
|
2405
|
-
const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
|
|
2406
|
-
if (__el.className !== __newClass) __el.className = __newClass;
|
|
2407
|
-
}
|
|
2408
|
-
} catch {}
|
|
2409
|
-
if (key === "label") this.__geaPatchCond(0);
|
|
2410
|
-
}
|
|
2411
|
-
};
|
|
2412
|
-
//#endregion
|
|
2413
|
-
//#region src/components/tabs.tsx
|
|
2414
|
-
var Tabs = class extends ZagComponent {
|
|
2415
|
-
createMachine(_props) {
|
|
2416
|
-
return tabs.machine;
|
|
2417
|
-
}
|
|
2418
|
-
getMachineProps(props) {
|
|
2419
|
-
return {
|
|
2420
|
-
id: this.id,
|
|
2421
|
-
value: props.value,
|
|
2422
|
-
defaultValue: props.defaultValue,
|
|
2423
|
-
orientation: props.orientation ?? "horizontal",
|
|
2424
|
-
activationMode: props.activationMode ?? "automatic",
|
|
2425
|
-
loopFocus: props.loopFocus ?? true,
|
|
2426
|
-
onValueChange: (details) => {
|
|
2427
|
-
this.value = details.value;
|
|
2428
|
-
props.onValueChange?.(details);
|
|
2429
|
-
},
|
|
2430
|
-
onFocusChange: props.onFocusChange
|
|
2431
|
-
};
|
|
2432
|
-
}
|
|
2433
|
-
connectApi(service) {
|
|
2434
|
-
return tabs.connect(service, normalizeProps);
|
|
2435
|
-
}
|
|
2436
|
-
_syncMachineProps() {
|
|
2437
|
-
super._syncMachineProps();
|
|
2438
|
-
if (this._machine && this.rendered_) this._machine.service.send({ type: "SET_INDICATOR_RECT" });
|
|
2439
|
-
}
|
|
2440
|
-
getSpreadMap() {
|
|
2441
|
-
return {
|
|
2442
|
-
"[data-part=\"root\"]": "getRootProps",
|
|
2443
|
-
"[data-part=\"list\"]": "getListProps",
|
|
2444
|
-
"[data-part=\"indicator\"]": (api) => {
|
|
2445
|
-
const props = api.getIndicatorProps();
|
|
2446
|
-
props.style = (props.style || "") + "bottom:0;width:var(--width);height:2px;";
|
|
2447
|
-
return props;
|
|
2448
|
-
},
|
|
2449
|
-
"[data-part=\"trigger\"]": (api, el) => api.getTriggerProps({ value: el.dataset.value }),
|
|
2450
|
-
"[data-part=\"content\"]": (api, el) => api.getContentProps({ value: el.dataset.value })
|
|
2451
|
-
};
|
|
2452
|
-
}
|
|
2453
|
-
syncState(api) {
|
|
2454
|
-
this.value = api.value;
|
|
2455
|
-
}
|
|
2456
|
-
onAfterRender() {
|
|
2457
|
-
super.onAfterRender();
|
|
2458
|
-
if (this._api?.value && this._machine) this._machine.service.send({ type: "SET_INDICATOR_RECT" });
|
|
2459
|
-
}
|
|
2460
|
-
template(props) {
|
|
2461
|
-
Component._register(ZagComponent);
|
|
2462
|
-
const items = props.items || [];
|
|
2463
|
-
return `<div id="${this.id}" data-part="root"${(props.class || "") == null || (props.class || "") === false ? "" : ` class="${(props.class || "").trim()}"`}><div id="${this.id + "-b1"}" data-part="list" class="tabs-list relative flex border-b border-gray-200 dark:border-gray-700">${items.map((item) => `<button id="${this.id + "-b1-" + String(item.value)}" data-gea-item-id="${item.value}" data-part="trigger"${item.value == null || item.value === false ? "" : ` data-value="${item.value}"`} class="tabs-trigger px-4 py-2 text-sm font-medium text-gray-600 hover:text-gray-900 data-[selected]:text-blue-600 dark:text-gray-400 dark:hover:text-gray-100 dark:data-[selected]:text-blue-400">${item.label}</button>`).join("") + "<!---->"}<div data-part="indicator" class="tabs-indicator bg-blue-600 dark:bg-blue-400"></div></div>${items.map((item) => `<div data-gea-item-id="${item.value}" data-part="content"${item.value == null || item.value === false ? "" : ` data-value="${item.value}"`} class="tabs-content p-4">${item.content}</div>`).join("") + "<!---->"}</div>`;
|
|
2464
|
-
}
|
|
2465
|
-
render__unresolved_0Item(item) {
|
|
2466
|
-
const __v = (v) => v != null && typeof v === "object" ? v.valueOf() : v;
|
|
2467
|
-
return `<button id="${this.id + "-b1-" + String(item.value)}" data-gea-item-id="${item.value}" data-part="trigger"${__v(item.value) == null || __v(item.value) === false ? "" : ` data-value="${item.value}"`} class="tabs-trigger px-4 py-2 text-sm font-medium text-gray-600 hover:text-gray-900 data-[selected]:text-blue-600 dark:text-gray-400 dark:hover:text-gray-100 dark:data-[selected]:text-blue-400">${item.label}</button>`;
|
|
2468
|
-
}
|
|
2469
|
-
create__unresolved_0Item(item) {
|
|
2470
|
-
var __c = this.____unresolved_0_container;
|
|
2471
|
-
if (!__c.__geaTpl) try {
|
|
2472
|
-
var __tw = document.createElement("template");
|
|
2473
|
-
__tw.innerHTML = this.render__unresolved_0Item({
|
|
2474
|
-
value: 0,
|
|
2475
|
-
label: ""
|
|
2476
|
-
});
|
|
2477
|
-
__c.__geaTpl = __tw.content.firstElementChild;
|
|
2478
|
-
} catch {}
|
|
2479
|
-
if (!__c.__geaIdPfx) __c.__geaIdPfx = this.id_ + "-b1-";
|
|
2480
|
-
if (__c.__geaTpl) var el = __c.__geaTpl.cloneNode(true);
|
|
2481
|
-
else {
|
|
2482
|
-
var __fw = document.createElement("template");
|
|
2483
|
-
__fw.innerHTML = this.render__unresolved_0Item(item);
|
|
2484
|
-
var el = __fw.content.firstElementChild;
|
|
2485
|
-
}
|
|
2486
|
-
var __av = item.value;
|
|
2487
|
-
if (__av == null || __av === false) el.removeAttribute("data-value");
|
|
2488
|
-
else el.setAttribute("data-value", String(__av));
|
|
2489
|
-
el.textContent = `
|
|
2490
|
-
${item.label}
|
|
2491
|
-
`;
|
|
2492
|
-
el.setAttribute("data-gea-item-id", item.value);
|
|
2493
|
-
el.id = __c.__geaIdPfx + item.value;
|
|
2494
|
-
el.__geaItem = item;
|
|
2495
|
-
return el;
|
|
2496
|
-
}
|
|
2497
|
-
render__unresolved_1Item(item) {
|
|
2498
|
-
const __v = (v) => v != null && typeof v === "object" ? v.valueOf() : v;
|
|
2499
|
-
return `<div data-gea-item-id="${item.value}" data-part="content"${__v(item.value) == null || __v(item.value) === false ? "" : ` data-value="${item.value}"`} class="tabs-content p-4">${item.content}</div>`;
|
|
2500
|
-
}
|
|
2501
|
-
create__unresolved_1Item(item) {
|
|
2502
|
-
var __c = this.____unresolved_1_container;
|
|
2503
|
-
if (!__c.__geaTpl) try {
|
|
2504
|
-
var __tw = document.createElement("template");
|
|
2505
|
-
__tw.innerHTML = this.render__unresolved_1Item({
|
|
2506
|
-
value: 0,
|
|
2507
|
-
content: ""
|
|
2508
|
-
});
|
|
2509
|
-
__c.__geaTpl = __tw.content.firstElementChild;
|
|
2510
|
-
} catch {}
|
|
2511
|
-
if (__c.__geaTpl) var el = __c.__geaTpl.cloneNode(true);
|
|
2512
|
-
else {
|
|
2513
|
-
var __fw = document.createElement("template");
|
|
2514
|
-
__fw.innerHTML = this.render__unresolved_1Item(item);
|
|
2515
|
-
var el = __fw.content.firstElementChild;
|
|
2516
|
-
}
|
|
2517
|
-
var __av = item.value;
|
|
2518
|
-
if (__av == null || __av === false) el.removeAttribute("data-value");
|
|
2519
|
-
else el.setAttribute("data-value", String(__av));
|
|
2520
|
-
el.textContent = `
|
|
2521
|
-
${item.content}
|
|
2522
|
-
`;
|
|
2523
|
-
el.setAttribute("data-gea-item-id", item.value);
|
|
2524
|
-
el.__geaItem = item;
|
|
2525
|
-
return el;
|
|
2526
|
-
}
|
|
2527
|
-
__onPropChange(key, value) {
|
|
2528
|
-
if (key === "class") try {
|
|
2529
|
-
const __el = this.$(":scope");
|
|
2530
|
-
this.props;
|
|
2531
|
-
const __boundValue = this.props.class || "";
|
|
2532
|
-
if (__el) {
|
|
2533
|
-
const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
|
|
2534
|
-
if (__el.className !== __newClass) __el.className = __newClass;
|
|
2535
|
-
}
|
|
2536
|
-
} catch {}
|
|
2537
|
-
if (key === "items") {
|
|
2538
|
-
this.__geaSyncMap(0);
|
|
2539
|
-
this.__geaSyncMap(1);
|
|
2540
|
-
}
|
|
2541
|
-
}
|
|
2542
|
-
__observe_local_props(__v, __c) {
|
|
2543
|
-
this.__geaSyncMap(0);
|
|
2544
|
-
this.__geaSyncMap(1);
|
|
2545
|
-
}
|
|
2546
|
-
createdHooks() {
|
|
2547
|
-
if (!this.__observer_removers__) this.__observer_removers__ = [];
|
|
2548
|
-
if (!this.__stores) this.__stores = {};
|
|
2549
|
-
this.__observer_removers__.forEach((fn) => fn());
|
|
2550
|
-
this.__observer_removers__ = [];
|
|
2551
|
-
if (typeof this.__ensureArrayConfigs === "function") this.__ensureArrayConfigs();
|
|
2552
|
-
this.__geaRegisterMap(0, "____unresolved_0_container", () => document.getElementById(this.id + "-b1"), () => {
|
|
2553
|
-
return this.props.items || [];
|
|
2554
|
-
}, (__item) => this.create__unresolved_0Item(__item), "value");
|
|
2555
|
-
this.__geaRegisterMap(1, "____unresolved_1_container", () => this.$(":scope"), () => {
|
|
2556
|
-
return this.props.items || [];
|
|
2557
|
-
}, (__item) => this.create__unresolved_1Item(__item), "value");
|
|
2558
|
-
}
|
|
2559
|
-
};
|
|
2560
|
-
//#endregion
|
|
2561
|
-
//#region src/components/tags-input.tsx
|
|
2562
|
-
var TagsInput = class extends ZagComponent {
|
|
2563
|
-
constructor(...args) {
|
|
2564
|
-
super(...args);
|
|
2565
|
-
try {
|
|
2566
|
-
this.props;
|
|
2567
|
-
this.__geaCond_0 = !!this.props.label;
|
|
2568
|
-
} catch {}
|
|
2569
|
-
this.__geaRegisterCond(0, "c0", () => {
|
|
2570
|
-
this.props;
|
|
2571
|
-
return this.props.label;
|
|
2572
|
-
}, () => {
|
|
2573
|
-
this.props;
|
|
2574
|
-
return `<label data-part="label" class="tags-input-label text-sm font-medium mb-1 block">${this.props.label}</label>`;
|
|
2575
|
-
}, null);
|
|
2576
|
-
}
|
|
2577
|
-
createMachine(_props) {
|
|
2578
|
-
return tagsInput.machine;
|
|
2579
|
-
}
|
|
2580
|
-
getMachineProps(props) {
|
|
2581
|
-
return {
|
|
2582
|
-
id: this.id,
|
|
2583
|
-
value: props.value,
|
|
2584
|
-
defaultValue: props.defaultValue,
|
|
2585
|
-
max: props.max,
|
|
2586
|
-
maxLength: props.maxLength,
|
|
2587
|
-
disabled: props.disabled,
|
|
2588
|
-
readOnly: props.readOnly,
|
|
2589
|
-
invalid: props.invalid,
|
|
2590
|
-
addOnPaste: props.addOnPaste ?? false,
|
|
2591
|
-
editable: props.editable ?? true,
|
|
2592
|
-
allowDuplicates: props.allowDuplicates ?? false,
|
|
2593
|
-
name: props.name,
|
|
2594
|
-
form: props.form,
|
|
2595
|
-
placeholder: props.placeholder,
|
|
2596
|
-
blurBehavior: props.blurBehavior,
|
|
2597
|
-
delimiter: props.delimiter,
|
|
2598
|
-
onValueChange: (details) => {
|
|
2599
|
-
this.value = details.value;
|
|
2600
|
-
props.onValueChange?.(details);
|
|
2601
|
-
}
|
|
2602
|
-
};
|
|
2603
|
-
}
|
|
2604
|
-
connectApi(service) {
|
|
2605
|
-
return tagsInput.connect(service, normalizeProps);
|
|
2606
|
-
}
|
|
2607
|
-
getSpreadMap() {
|
|
2608
|
-
return {
|
|
2609
|
-
"[data-part=\"root\"]": "getRootProps",
|
|
2610
|
-
"[data-part=\"label\"]": "getLabelProps",
|
|
2611
|
-
"[data-part=\"control\"]": "getControlProps",
|
|
2612
|
-
"[data-part=\"input\"]": "getInputProps",
|
|
2613
|
-
"[data-part=\"hidden-input\"]": "getHiddenInputProps",
|
|
2614
|
-
"[data-part=\"clear-trigger\"]": "getClearTriggerProps",
|
|
2615
|
-
"[data-part=\"item\"]": (api, el) => {
|
|
2616
|
-
const ds = el.dataset;
|
|
2617
|
-
return api.getItemProps({
|
|
2618
|
-
index: ds.index,
|
|
2619
|
-
value: ds.value
|
|
2620
|
-
});
|
|
2621
|
-
},
|
|
2622
|
-
"[data-part=\"item-preview\"]": (api, el) => {
|
|
2623
|
-
const ds = el.dataset;
|
|
2624
|
-
return api.getItemPreviewProps({
|
|
2625
|
-
index: ds.index,
|
|
2626
|
-
value: ds.value
|
|
2627
|
-
});
|
|
2628
|
-
},
|
|
2629
|
-
"[data-part=\"item-text\"]": (api, el) => {
|
|
2630
|
-
const ds = el.dataset;
|
|
2631
|
-
return api.getItemTextProps({
|
|
2632
|
-
index: ds.index,
|
|
2633
|
-
value: ds.value
|
|
2634
|
-
});
|
|
2635
|
-
},
|
|
2636
|
-
"[data-part=\"item-delete-trigger\"]": (api, el) => {
|
|
2637
|
-
const ds = el.dataset;
|
|
2638
|
-
return api.getItemDeleteTriggerProps({
|
|
2639
|
-
index: ds.index,
|
|
2640
|
-
value: ds.value
|
|
2641
|
-
});
|
|
2642
|
-
}
|
|
2643
|
-
};
|
|
2644
|
-
}
|
|
2645
|
-
syncState(api) {
|
|
2646
|
-
this.value = api.value;
|
|
2647
|
-
}
|
|
2648
|
-
template(props) {
|
|
2649
|
-
Component._register(ZagComponent);
|
|
2650
|
-
return `<div id="${this.id}" data-part="root"${(props.class || "") == null || (props.class || "") === false ? "" : ` class="${(props.class || "").trim()}"`}><!--${this.id + "-c0"}-->${props.label && `<label data-part="label" class="tags-input-label text-sm font-medium mb-1 block">${props.label}</label>` || ""}<!--${this.id + "-c0-end"}--><div id="${this.id + "-b1"}" data-part="control" class="tags-input-control flex flex-wrap gap-1.5 rounded-md border border-input bg-transparent px-3 py-2 shadow-sm focus-within:ring-1 focus-within:ring-ring">${(this.value || []).map((tag, i) => `<span id="${this.id + "-b1-" + String(String(tag))}" data-gea-item-id="${String(tag)}" data-part="item"${String(i) == null || String(i) === false ? "" : ` data-index="${String(i)}"`}${tag == null || tag === false ? "" : ` data-value="${tag}"`} class="tags-input-item inline-flex items-center gap-1 rounded-md bg-secondary px-2 py-0.5 text-xs font-medium"><span data-part="item-preview"${String(i) == null || String(i) === false ? "" : ` data-index="${String(i)}"`}${tag == null || tag === false ? "" : ` data-value="${tag}"`} class="inline-flex items-center gap-1 data-[highlighted]:ring-2 data-[highlighted]:ring-ring data-[highlighted]:rounded-sm"><span data-part="item-text"${String(i) == null || String(i) === false ? "" : ` data-index="${String(i)}"`}${tag == null || tag === false ? "" : ` data-value="${tag}"`}>${tag}</span></span><button data-part="item-delete-trigger"${String(i) == null || String(i) === false ? "" : ` data-index="${String(i)}"`}${tag == null || tag === false ? "" : ` data-value="${tag}"`} class="tags-input-item-delete text-muted-foreground hover:text-foreground">✕</button></span>`).join("") + "<!---->"}<input data-part="input" class="tags-input-input flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground min-w-[60px]" /></div><input data-part="hidden-input" type="hidden" /></div>`;
|
|
2651
|
-
}
|
|
2652
|
-
render__unresolved_0Item(tag, i) {
|
|
2653
|
-
const __v = (v) => v != null && typeof v === "object" ? v.valueOf() : v;
|
|
2654
|
-
return `<span id="${this.id + "-b1-" + String(tag.id)}" data-gea-item-id="${tag.id}" data-part="item"${__v(String(i)) == null || __v(String(i)) === false ? "" : ` data-index="${String(i)}"`}${__v(tag) == null || __v(tag) === false ? "" : ` data-value="${tag}"`} class="tags-input-item inline-flex items-center gap-1 rounded-md bg-secondary px-2 py-0.5 text-xs font-medium"><span data-part="item-preview"${__v(String(i)) == null || __v(String(i)) === false ? "" : ` data-index="${String(i)}"`}${__v(tag) == null || __v(tag) === false ? "" : ` data-value="${tag}"`} class="inline-flex items-center gap-1 data-[highlighted]:ring-2 data-[highlighted]:ring-ring data-[highlighted]:rounded-sm"><span data-part="item-text"${__v(String(i)) == null || __v(String(i)) === false ? "" : ` data-index="${String(i)}"`}${__v(tag) == null || __v(tag) === false ? "" : ` data-value="${tag}"`}>${tag}</span></span><button data-part="item-delete-trigger"${__v(String(i)) == null || __v(String(i)) === false ? "" : ` data-index="${String(i)}"`}${__v(tag) == null || __v(tag) === false ? "" : ` data-value="${tag}"`} class="tags-input-item-delete text-muted-foreground hover:text-foreground">✕</button></span>`;
|
|
2655
|
-
}
|
|
2656
|
-
create__unresolved_0Item(item, __idx) {
|
|
2657
|
-
var __c = this.____unresolved_0_container;
|
|
2658
|
-
if (!__c.__geaTpl) try {
|
|
2659
|
-
var __tw = document.createElement("template");
|
|
2660
|
-
__tw.innerHTML = this.render__unresolved_0Item("__dummy__", 0);
|
|
2661
|
-
__c.__geaTpl = __tw.content.firstElementChild;
|
|
2662
|
-
} catch {}
|
|
2663
|
-
if (!__c.__geaIdPfx) __c.__geaIdPfx = this.id_ + "-b1-";
|
|
2664
|
-
if (__c.__geaTpl) var el = __c.__geaTpl.cloneNode(true);
|
|
2665
|
-
else {
|
|
2666
|
-
var __fw = document.createElement("template");
|
|
2667
|
-
__fw.innerHTML = this.render__unresolved_0Item(item, __idx);
|
|
2668
|
-
var el = __fw.content.firstElementChild;
|
|
2669
|
-
}
|
|
2670
|
-
var __av = String(__idx);
|
|
2671
|
-
if (__av == null || __av === false) el.removeAttribute("data-index");
|
|
2672
|
-
else el.setAttribute("data-index", String(__av));
|
|
2673
|
-
var __av = item;
|
|
2674
|
-
if (__av == null || __av === false) el.removeAttribute("data-value");
|
|
2675
|
-
else el.setAttribute("data-value", String(__av));
|
|
2676
|
-
var __av = String(__idx);
|
|
2677
|
-
if (__av == null || __av === false) el.firstElementChild.removeAttribute("data-index");
|
|
2678
|
-
else el.firstElementChild.setAttribute("data-index", String(__av));
|
|
2679
|
-
var __av = item;
|
|
2680
|
-
if (__av == null || __av === false) el.firstElementChild.removeAttribute("data-value");
|
|
2681
|
-
else el.firstElementChild.setAttribute("data-value", String(__av));
|
|
2682
|
-
var __av = String(__idx);
|
|
2683
|
-
if (__av == null || __av === false) el.firstElementChild.firstElementChild.removeAttribute("data-index");
|
|
2684
|
-
else el.firstElementChild.firstElementChild.setAttribute("data-index", String(__av));
|
|
2685
|
-
var __av = item;
|
|
2686
|
-
if (__av == null || __av === false) el.firstElementChild.firstElementChild.removeAttribute("data-value");
|
|
2687
|
-
else el.firstElementChild.firstElementChild.setAttribute("data-value", String(__av));
|
|
2688
|
-
el.firstElementChild.firstElementChild.textContent = `
|
|
2689
|
-
${item}
|
|
2690
|
-
`;
|
|
2691
|
-
var __av = String(__idx);
|
|
2692
|
-
if (__av == null || __av === false) el.firstElementChild.nextElementSibling.removeAttribute("data-index");
|
|
2693
|
-
else el.firstElementChild.nextElementSibling.setAttribute("data-index", String(__av));
|
|
2694
|
-
var __av = item;
|
|
2695
|
-
if (__av == null || __av === false) el.firstElementChild.nextElementSibling.removeAttribute("data-value");
|
|
2696
|
-
else el.firstElementChild.nextElementSibling.setAttribute("data-value", String(__av));
|
|
2697
|
-
el.setAttribute("data-gea-item-id", String(item));
|
|
2698
|
-
el.id = __c.__geaIdPfx + String(item);
|
|
2699
|
-
el.__geaItem = item;
|
|
2700
|
-
return el;
|
|
2701
|
-
}
|
|
2702
|
-
__observe_local_value(value, change) {
|
|
2703
|
-
this.__geaSyncMap(0);
|
|
2704
|
-
this.__geaSyncMap(0);
|
|
2705
|
-
}
|
|
2706
|
-
__onPropChange(key, value) {
|
|
2707
|
-
if (key === "class") try {
|
|
2708
|
-
const __el = this.$(":scope");
|
|
2709
|
-
this.props;
|
|
2710
|
-
const __boundValue = this.props.class || "";
|
|
2711
|
-
if (__el) {
|
|
2712
|
-
const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
|
|
2713
|
-
if (__el.className !== __newClass) __el.className = __newClass;
|
|
2714
|
-
}
|
|
2715
|
-
} catch {}
|
|
2716
|
-
if (key === "label") this.__geaPatchCond(0);
|
|
2717
|
-
}
|
|
2718
|
-
createdHooks() {
|
|
2719
|
-
if (!this.__observer_removers__) this.__observer_removers__ = [];
|
|
2720
|
-
if (!this.__stores) this.__stores = {};
|
|
2721
|
-
this.__observer_removers__.forEach((fn) => fn());
|
|
2722
|
-
this.__observer_removers__ = [];
|
|
2723
|
-
if (typeof this.__ensureArrayConfigs === "function") this.__ensureArrayConfigs();
|
|
2724
|
-
this.__geaRegisterMap(0, "____unresolved_0_container", () => document.getElementById(this.id + "-b1"), () => {
|
|
2725
|
-
return this.value || [];
|
|
2726
|
-
}, (__item, __idx) => this.create__unresolved_0Item(__item, __idx));
|
|
2727
|
-
}
|
|
2728
|
-
__setupLocalStateObservers() {
|
|
2729
|
-
if (typeof this.__ensureArrayConfigs === "function") this.__ensureArrayConfigs();
|
|
2730
|
-
if (!this.__store) return;
|
|
2731
|
-
this.__observer_removers__.push(this.__store.observe(["value"], (__v, __c) => {
|
|
2732
|
-
try {
|
|
2733
|
-
this.__observe_local_value(__v, __c);
|
|
2734
|
-
} catch (_e) {}
|
|
2735
|
-
}));
|
|
2736
|
-
}
|
|
2737
|
-
};
|
|
2738
|
-
//#endregion
|
|
2739
|
-
//#region src/components/toast.tsx
|
|
2740
|
-
function stripStyle(props) {
|
|
2741
|
-
const { style: _style, ...rest } = props;
|
|
2742
|
-
return rest;
|
|
2743
|
-
}
|
|
2744
|
-
let _store = null;
|
|
2745
|
-
function getStore(props) {
|
|
2746
|
-
if (!_store) _store = toast.createStore({
|
|
2747
|
-
placement: "bottom-end",
|
|
2748
|
-
duration: 5e3,
|
|
2749
|
-
removeDelay: 200,
|
|
2750
|
-
max: 5,
|
|
2751
|
-
...props
|
|
2752
|
-
});
|
|
2753
|
-
return _store;
|
|
2754
|
-
}
|
|
2755
|
-
var ToastStore = class {
|
|
2756
|
-
static {
|
|
2757
|
-
this.getStore = getStore;
|
|
2758
|
-
}
|
|
2759
|
-
static create(options) {
|
|
2760
|
-
return getStore().create(options);
|
|
2761
|
-
}
|
|
2762
|
-
static success(options) {
|
|
2763
|
-
return getStore().create({
|
|
2764
|
-
...options,
|
|
2765
|
-
type: "success"
|
|
2766
|
-
});
|
|
2767
|
-
}
|
|
2768
|
-
static error(options) {
|
|
2769
|
-
return getStore().create({
|
|
2770
|
-
...options,
|
|
2771
|
-
type: "error"
|
|
2772
|
-
});
|
|
2773
|
-
}
|
|
2774
|
-
static info(options) {
|
|
2775
|
-
return getStore().create({
|
|
2776
|
-
...options,
|
|
2777
|
-
type: "info"
|
|
2778
|
-
});
|
|
2779
|
-
}
|
|
2780
|
-
static loading(options) {
|
|
2781
|
-
return getStore().create({
|
|
2782
|
-
...options,
|
|
2783
|
-
type: "loading"
|
|
2784
|
-
});
|
|
2785
|
-
}
|
|
2786
|
-
static dismiss(id) {
|
|
2787
|
-
if (id) getStore().dismiss(id);
|
|
2788
|
-
else getStore().dismiss();
|
|
2789
|
-
}
|
|
2790
|
-
};
|
|
2791
|
-
var Toaster = class extends Component {
|
|
2792
|
-
created(props) {
|
|
2793
|
-
this._toastMachines = /* @__PURE__ */ new Map();
|
|
2794
|
-
this._spreadCleanups = /* @__PURE__ */ new Map();
|
|
2795
|
-
this._currentToasts = [];
|
|
2796
|
-
const store = getStore(props.storeProps);
|
|
2797
|
-
this._machine = new VanillaMachine(toast.group.machine, { store });
|
|
2798
|
-
this._machine.start();
|
|
2799
|
-
this._api = toast.group.connect(this._machine.service, normalizeProps);
|
|
2800
|
-
this._machine.subscribe(() => {
|
|
2801
|
-
if (!this._machine) return;
|
|
2802
|
-
this._api = toast.group.connect(this._machine.service, normalizeProps);
|
|
2803
|
-
const nextToasts = this._api.getToasts();
|
|
2804
|
-
this._syncToastDOM(nextToasts);
|
|
2805
|
-
this._currentToasts = nextToasts;
|
|
2806
|
-
this._syncToastMachines();
|
|
2807
|
-
queueMicrotask(() => this._applyGroupSpreads());
|
|
2808
|
-
});
|
|
2809
|
-
}
|
|
2810
|
-
_createToastElement(t) {
|
|
2811
|
-
const div = document.createElement("div");
|
|
2812
|
-
div.setAttribute("data-part", "toast-root");
|
|
2813
|
-
div.setAttribute("data-toast-id", t.id);
|
|
2814
|
-
div.className = "toast-root group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 shadow-lg transition-all bg-background text-foreground";
|
|
2815
|
-
let inner = "<div class=\"grid gap-1\">";
|
|
2816
|
-
if (t.title) inner += `<div data-part="title" class="toast-title text-sm font-semibold">${t.title}</div>`;
|
|
2817
|
-
if (t.description) inner += `<div data-part="description" class="toast-description text-sm opacity-90">${t.description}</div>`;
|
|
2818
|
-
inner += "</div>";
|
|
2819
|
-
inner += "<button data-part=\"close-trigger\" class=\"toast-close-trigger text-foreground/50 hover:text-foreground\">✕</button>";
|
|
2820
|
-
div.innerHTML = inner;
|
|
2821
|
-
return div;
|
|
2822
|
-
}
|
|
2823
|
-
_syncToastDOM(nextToasts) {
|
|
2824
|
-
const container = this.el;
|
|
2825
|
-
if (!container) return;
|
|
2826
|
-
const currentIds = new Set(this._currentToasts.map((t) => t.id));
|
|
2827
|
-
const nextIds = new Set(nextToasts.map((t) => t.id));
|
|
2828
|
-
for (const id of currentIds) if (!nextIds.has(id)) {
|
|
2829
|
-
const el = container.querySelector(`[data-toast-id="${id}"]`);
|
|
2830
|
-
if (el) {
|
|
2831
|
-
const cleanups = this._spreadCleanups.get(id);
|
|
2832
|
-
if (cleanups) cleanups.forEach((fn) => fn());
|
|
2833
|
-
this._spreadCleanups.delete(id);
|
|
2834
|
-
el.remove();
|
|
2835
|
-
}
|
|
2836
|
-
}
|
|
2837
|
-
for (const t of nextToasts) if (!currentIds.has(t.id)) {
|
|
2838
|
-
const el = this._createToastElement(t);
|
|
2839
|
-
container.appendChild(el);
|
|
2840
|
-
}
|
|
2841
|
-
}
|
|
2842
|
-
_syncToastMachines() {
|
|
2843
|
-
if (!this._machine) return;
|
|
2844
|
-
const currentIds = new Set(this._currentToasts.map((t) => t.id));
|
|
2845
|
-
for (const [id, machine] of this._toastMachines) if (!currentIds.has(id)) {
|
|
2846
|
-
machine.stop();
|
|
2847
|
-
this._toastMachines.delete(id);
|
|
2848
|
-
}
|
|
2849
|
-
for (let i = 0; i < this._currentToasts.length; i++) {
|
|
2850
|
-
const t = this._currentToasts[i];
|
|
2851
|
-
if (!this._toastMachines.has(t.id)) {
|
|
2852
|
-
const toastMachine = new VanillaMachine(toast.machine, {
|
|
2853
|
-
...t,
|
|
2854
|
-
parent: this._machine.service,
|
|
2855
|
-
index: i,
|
|
2856
|
-
stacked: true,
|
|
2857
|
-
removeDelay: t.removeDelay ?? 200
|
|
2858
|
-
});
|
|
2859
|
-
toastMachine.start();
|
|
2860
|
-
this._toastMachines.set(t.id, toastMachine);
|
|
2861
|
-
toastMachine.subscribe(() => {
|
|
2862
|
-
queueMicrotask(() => this._applyGroupSpreads());
|
|
2863
|
-
});
|
|
2864
|
-
}
|
|
2865
|
-
}
|
|
2866
|
-
}
|
|
2867
|
-
_applyGroupSpreads() {
|
|
2868
|
-
if (!this.rendered_ || !this._api) return;
|
|
2869
|
-
const groupEl = this.el;
|
|
2870
|
-
if (groupEl) spreadProps(groupEl, stripStyle(this._api.getGroupProps()));
|
|
2871
|
-
const toastEls = this.$$("[data-toast-id]");
|
|
2872
|
-
for (const el of toastEls) {
|
|
2873
|
-
const toastId = el.dataset.toastId;
|
|
2874
|
-
if (!toastId) continue;
|
|
2875
|
-
const toastMachine = this._toastMachines.get(toastId);
|
|
2876
|
-
if (!toastMachine) continue;
|
|
2877
|
-
const api = toast.connect(toastMachine.service, normalizeProps);
|
|
2878
|
-
const prevCleanups = this._spreadCleanups.get(toastId);
|
|
2879
|
-
if (prevCleanups) prevCleanups.forEach((fn) => fn());
|
|
2880
|
-
const cleanups = [];
|
|
2881
|
-
const rootProps = stripStyle(api.getRootProps());
|
|
2882
|
-
delete rootProps["data-part"];
|
|
2883
|
-
cleanups.push(spreadProps(el, rootProps));
|
|
2884
|
-
const title = el.querySelector("[data-part=\"title\"]");
|
|
2885
|
-
if (title) cleanups.push(spreadProps(title, api.getTitleProps()));
|
|
2886
|
-
const desc = el.querySelector("[data-part=\"description\"]");
|
|
2887
|
-
if (desc) cleanups.push(spreadProps(desc, api.getDescriptionProps()));
|
|
2888
|
-
const close = el.querySelector("[data-part=\"close-trigger\"]");
|
|
2889
|
-
if (close) cleanups.push(spreadProps(close, api.getCloseTriggerProps()));
|
|
2890
|
-
const action = el.querySelector("[data-part=\"action-trigger\"]");
|
|
2891
|
-
if (action) cleanups.push(spreadProps(action, api.getActionTriggerProps()));
|
|
2892
|
-
this._spreadCleanups.set(toastId, cleanups);
|
|
2893
|
-
}
|
|
2894
|
-
}
|
|
2895
|
-
onAfterRender() {
|
|
2896
|
-
this._applyGroupSpreads();
|
|
2897
|
-
}
|
|
2898
|
-
dispose() {
|
|
2899
|
-
for (const cleanups of this._spreadCleanups.values()) cleanups.forEach((fn) => fn());
|
|
2900
|
-
this._spreadCleanups.clear();
|
|
2901
|
-
for (const machine of this._toastMachines.values()) machine.stop();
|
|
2902
|
-
this._toastMachines.clear();
|
|
2903
|
-
if (this._machine) {
|
|
2904
|
-
this._machine.stop();
|
|
2905
|
-
this._machine = null;
|
|
2906
|
-
}
|
|
2907
|
-
this._api = null;
|
|
2908
|
-
super.dispose();
|
|
2909
|
-
}
|
|
2910
|
-
template(props) {
|
|
2911
|
-
Component._register(Component);
|
|
2912
|
-
return `<div id="${this.id}" data-part="group" class="${`toaster fixed z-[100] flex max-h-screen flex-col-reverse gap-2 p-4 ${props.class || "bottom-0 right-0"}`.trim()}"></div>`;
|
|
2913
|
-
}
|
|
2914
|
-
__onPropChange(key, value) {
|
|
2915
|
-
if (key === "class") try {
|
|
2916
|
-
const __el = this.$(":scope");
|
|
2917
|
-
this.props;
|
|
2918
|
-
const __boundValue = `toaster fixed z-[100] flex max-h-screen flex-col-reverse gap-2 p-4 ${this.props.class || "bottom-0 right-0"}`;
|
|
2919
|
-
if (__el) {
|
|
2920
|
-
const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
|
|
2921
|
-
if (__el.className !== __newClass) __el.className = __newClass;
|
|
2922
|
-
}
|
|
2923
|
-
} catch {}
|
|
2924
|
-
}
|
|
2925
|
-
};
|
|
2926
|
-
//#endregion
|
|
2927
|
-
//#region src/components/toggle-group.tsx
|
|
2928
|
-
var ToggleGroup = class extends ZagComponent {
|
|
2929
|
-
createMachine(_props) {
|
|
2930
|
-
return toggleGroup.machine;
|
|
2931
|
-
}
|
|
2932
|
-
getMachineProps(props) {
|
|
2933
|
-
return {
|
|
2934
|
-
id: this.id,
|
|
2935
|
-
value: props.value,
|
|
2936
|
-
defaultValue: props.defaultValue,
|
|
2937
|
-
multiple: props.multiple ?? false,
|
|
2938
|
-
disabled: props.disabled,
|
|
2939
|
-
orientation: props.orientation ?? "horizontal",
|
|
2940
|
-
loopFocus: props.loopFocus ?? true,
|
|
2941
|
-
rovingFocus: props.rovingFocus ?? true,
|
|
2942
|
-
onValueChange: (details) => {
|
|
2943
|
-
this.value = details.value;
|
|
2944
|
-
props.onValueChange?.(details);
|
|
2945
|
-
}
|
|
2946
|
-
};
|
|
2947
|
-
}
|
|
2948
|
-
connectApi(service) {
|
|
2949
|
-
return toggleGroup.connect(service, normalizeProps);
|
|
2950
|
-
}
|
|
2951
|
-
getSpreadMap() {
|
|
2952
|
-
return {
|
|
2953
|
-
"[data-part=\"root\"]": "getRootProps",
|
|
2954
|
-
"[data-part=\"item\"]": (api, el) => api.getItemProps({ value: el.dataset.value })
|
|
2955
|
-
};
|
|
2956
|
-
}
|
|
2957
|
-
syncState(api) {
|
|
2958
|
-
this.value = api.value;
|
|
2959
|
-
}
|
|
2960
|
-
template(props) {
|
|
2961
|
-
Component._register(ZagComponent);
|
|
2962
|
-
const items = props.items || [];
|
|
2963
|
-
return `<div id="${this.id}" data-part="root" class="${`toggle-group-root inline-flex rounded-md border ${props.class || ""}`.trim()}">${items.map((item) => `<button data-gea-item-id="${item.value}" data-part="item"${item.value == null || item.value === false ? "" : ` data-value="${item.value}"`} class="toggle-group-item inline-flex items-center justify-center rounded-md px-3 py-2 text-sm font-medium transition-colors hover:bg-muted hover:text-muted-foreground data-[state=on]:bg-accent data-[state=on]:text-accent-foreground">${item.label}</button>`).join("") + "<!---->"}</div>`;
|
|
2964
|
-
}
|
|
2965
|
-
render__unresolved_0Item(item) {
|
|
2966
|
-
const __v = (v) => v != null && typeof v === "object" ? v.valueOf() : v;
|
|
2967
|
-
return `<button data-gea-item-id="${item.value}" data-part="item"${__v(item.value) == null || __v(item.value) === false ? "" : ` data-value="${item.value}"`} class="toggle-group-item inline-flex items-center justify-center rounded-md px-3 py-2 text-sm font-medium transition-colors hover:bg-muted hover:text-muted-foreground data-[state=on]:bg-accent data-[state=on]:text-accent-foreground">${item.label}</button>`;
|
|
2968
|
-
}
|
|
2969
|
-
create__unresolved_0Item(item) {
|
|
2970
|
-
var __c = this.____unresolved_0_container;
|
|
2971
|
-
if (!__c.__geaTpl) try {
|
|
2972
|
-
var __tw = document.createElement("template");
|
|
2973
|
-
__tw.innerHTML = this.render__unresolved_0Item({
|
|
2974
|
-
value: 0,
|
|
2975
|
-
label: ""
|
|
2976
|
-
});
|
|
2977
|
-
__c.__geaTpl = __tw.content.firstElementChild;
|
|
2978
|
-
} catch {}
|
|
2979
|
-
if (__c.__geaTpl) var el = __c.__geaTpl.cloneNode(true);
|
|
2980
|
-
else {
|
|
2981
|
-
var __fw = document.createElement("template");
|
|
2982
|
-
__fw.innerHTML = this.render__unresolved_0Item(item);
|
|
2983
|
-
var el = __fw.content.firstElementChild;
|
|
2984
|
-
}
|
|
2985
|
-
var __av = item.value;
|
|
2986
|
-
if (__av == null || __av === false) el.removeAttribute("data-value");
|
|
2987
|
-
else el.setAttribute("data-value", String(__av));
|
|
2988
|
-
el.textContent = `
|
|
2989
|
-
${item.label}
|
|
2990
|
-
`;
|
|
2991
|
-
el.setAttribute("data-gea-item-id", item.value);
|
|
2992
|
-
el.__geaItem = item;
|
|
2993
|
-
return el;
|
|
2994
|
-
}
|
|
2995
|
-
__onPropChange(key, value) {
|
|
2996
|
-
if (key === "class") try {
|
|
2997
|
-
const __el = this.$(":scope");
|
|
2998
|
-
this.props;
|
|
2999
|
-
const __boundValue = `toggle-group-root inline-flex rounded-md border ${this.props.class || ""}`;
|
|
3000
|
-
if (__el) {
|
|
3001
|
-
const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
|
|
3002
|
-
if (__el.className !== __newClass) __el.className = __newClass;
|
|
3003
|
-
}
|
|
3004
|
-
} catch {}
|
|
3005
|
-
if (key === "items") this.__geaSyncMap(0);
|
|
3006
|
-
}
|
|
3007
|
-
__observe_local_props(__v, __c) {
|
|
3008
|
-
this.__geaSyncMap(0);
|
|
3009
|
-
}
|
|
3010
|
-
createdHooks() {
|
|
3011
|
-
if (!this.__observer_removers__) this.__observer_removers__ = [];
|
|
3012
|
-
if (!this.__stores) this.__stores = {};
|
|
3013
|
-
this.__observer_removers__.forEach((fn) => fn());
|
|
3014
|
-
this.__observer_removers__ = [];
|
|
3015
|
-
if (typeof this.__ensureArrayConfigs === "function") this.__ensureArrayConfigs();
|
|
3016
|
-
this.__geaRegisterMap(0, "____unresolved_0_container", () => this.$(":scope"), () => {
|
|
3017
|
-
return this.props.items || [];
|
|
3018
|
-
}, (__item) => this.create__unresolved_0Item(__item), "value");
|
|
3019
|
-
}
|
|
3020
|
-
};
|
|
3021
|
-
//#endregion
|
|
3022
|
-
//#region src/components/tooltip.tsx
|
|
3023
|
-
var Tooltip = class extends ZagComponent {
|
|
3024
|
-
createMachine(_props) {
|
|
3025
|
-
return tooltip.machine;
|
|
3026
|
-
}
|
|
3027
|
-
getMachineProps(props) {
|
|
3028
|
-
return {
|
|
3029
|
-
id: this.id,
|
|
3030
|
-
open: props.open,
|
|
3031
|
-
defaultOpen: props.defaultOpen,
|
|
3032
|
-
openDelay: props.openDelay ?? 400,
|
|
3033
|
-
closeDelay: props.closeDelay ?? 150,
|
|
3034
|
-
closeOnPointerDown: props.closeOnPointerDown ?? true,
|
|
3035
|
-
closeOnEscape: props.closeOnEscape ?? true,
|
|
3036
|
-
closeOnScroll: props.closeOnScroll ?? true,
|
|
3037
|
-
interactive: props.interactive ?? false,
|
|
3038
|
-
disabled: props.disabled,
|
|
3039
|
-
positioning: props.positioning,
|
|
3040
|
-
"aria-label": props["aria-label"],
|
|
3041
|
-
onOpenChange: (details) => {
|
|
3042
|
-
this.open = details.open;
|
|
3043
|
-
props.onOpenChange?.(details);
|
|
3044
|
-
}
|
|
3045
|
-
};
|
|
3046
|
-
}
|
|
3047
|
-
connectApi(service) {
|
|
3048
|
-
return tooltip.connect(service, normalizeProps);
|
|
3049
|
-
}
|
|
3050
|
-
getSpreadMap() {
|
|
3051
|
-
return {
|
|
3052
|
-
"[data-part=\"trigger\"]": "getTriggerProps",
|
|
3053
|
-
"[data-part=\"positioner\"]": "getPositionerProps",
|
|
3054
|
-
"[data-part=\"content\"]": "getContentProps",
|
|
3055
|
-
"[data-part=\"arrow\"]": "getArrowProps",
|
|
3056
|
-
"[data-part=\"arrow-tip\"]": "getArrowTipProps"
|
|
3057
|
-
};
|
|
3058
|
-
}
|
|
3059
|
-
syncState(api) {
|
|
3060
|
-
this.open = api.open;
|
|
3061
|
-
}
|
|
3062
|
-
template(props) {
|
|
3063
|
-
Component._register(ZagComponent);
|
|
3064
|
-
return `<div id="${this.id}"${(props.class || "") == null || (props.class || "") === false ? "" : ` class="${(props.class || "").trim()}"`} style="display: inline-block;"><div id="${this.id + "-b1"}" data-part="trigger" class="tooltip-trigger" style="display: inline-block;">${props.children}</div><div data-part="positioner" class="tooltip-positioner"><div id="${this.id + "-b2"}" data-part="content" class="tooltip-content z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground shadow-md">${props.content}</div></div></div>`;
|
|
3065
|
-
}
|
|
3066
|
-
__onPropChange(key, value) {
|
|
3067
|
-
if (key === "class") try {
|
|
3068
|
-
const __el = this.$(":scope");
|
|
3069
|
-
this.props;
|
|
3070
|
-
const __boundValue = this.props.class || "";
|
|
3071
|
-
if (__el) {
|
|
3072
|
-
const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
|
|
3073
|
-
if (__el.className !== __newClass) __el.className = __newClass;
|
|
3074
|
-
}
|
|
3075
|
-
} catch {}
|
|
3076
|
-
if (key === "children") try {
|
|
3077
|
-
const __el = document.getElementById(this.id + "-b1");
|
|
3078
|
-
if (__el) {
|
|
3079
|
-
if (__el.innerHTML !== value) {
|
|
3080
|
-
__el.innerHTML = value;
|
|
3081
|
-
this.instantiateChildComponents_();
|
|
3082
|
-
if (this.parentComponent) this.parentComponent.mountCompiledChildComponents_();
|
|
3083
|
-
}
|
|
3084
|
-
}
|
|
3085
|
-
} catch {}
|
|
3086
|
-
if (key === "content") try {
|
|
3087
|
-
const __el = document.getElementById(this.id + "-b2");
|
|
3088
|
-
if (__el) {
|
|
3089
|
-
if (__el.textContent !== value) __el.textContent = value;
|
|
3090
|
-
}
|
|
3091
|
-
} catch {}
|
|
3092
|
-
}
|
|
3093
|
-
};
|
|
3094
|
-
//#endregion
|
|
3095
|
-
//#region src/components/tree-view.tsx
|
|
3096
|
-
var TreeView = class extends ZagComponent {
|
|
3097
|
-
constructor(...args) {
|
|
3098
|
-
super(...args);
|
|
3099
|
-
this.selectedValue = [];
|
|
3100
|
-
this.expandedValue = [];
|
|
3101
|
-
try {
|
|
3102
|
-
this.props;
|
|
3103
|
-
this.__geaCond_0 = !!this.props.label;
|
|
3104
|
-
} catch {}
|
|
3105
|
-
this.__geaRegisterCond(0, "c0", () => {
|
|
3106
|
-
this.props;
|
|
3107
|
-
return this.props.label;
|
|
3108
|
-
}, () => {
|
|
3109
|
-
this.props;
|
|
3110
|
-
return `<label data-part="label" class="tree-view-label text-sm font-medium mb-2 block">${this.props.label}</label>`;
|
|
3111
|
-
}, null);
|
|
3112
|
-
}
|
|
3113
|
-
createMachine(_props) {
|
|
3114
|
-
return treeView.machine;
|
|
3115
|
-
}
|
|
3116
|
-
getMachineProps(props) {
|
|
3117
|
-
return {
|
|
3118
|
-
id: this.id,
|
|
3119
|
-
collection: props.collection,
|
|
3120
|
-
selectedValue: props.selectedValue,
|
|
3121
|
-
defaultSelectedValue: props.defaultSelectedValue,
|
|
3122
|
-
expandedValue: props.expandedValue,
|
|
3123
|
-
defaultExpandedValue: props.defaultExpandedValue,
|
|
3124
|
-
selectionMode: props.selectionMode ?? "single",
|
|
3125
|
-
expandOnClick: props.expandOnClick ?? true,
|
|
3126
|
-
onSelectionChange: (details) => {
|
|
3127
|
-
this.selectedValue = details.selectedValue;
|
|
3128
|
-
props.onSelectionChange?.(details);
|
|
3129
|
-
},
|
|
3130
|
-
onExpandedChange: (details) => {
|
|
3131
|
-
this.expandedValue = details.expandedValue;
|
|
3132
|
-
props.onExpandedChange?.(details);
|
|
3133
|
-
}
|
|
3134
|
-
};
|
|
3135
|
-
}
|
|
3136
|
-
connectApi(service) {
|
|
3137
|
-
return treeView.connect(service, normalizeProps);
|
|
3138
|
-
}
|
|
3139
|
-
getSpreadMap() {
|
|
3140
|
-
return {
|
|
3141
|
-
"[data-part=\"root\"]": "getRootProps",
|
|
3142
|
-
"[data-part=\"label\"]": "getLabelProps",
|
|
3143
|
-
"[data-part=\"tree\"]": "getTreeProps"
|
|
3144
|
-
};
|
|
3145
|
-
}
|
|
3146
|
-
syncState(api) {
|
|
3147
|
-
this.selectedValue = api.selectedValue;
|
|
3148
|
-
this.expandedValue = api.expandedValue;
|
|
3149
|
-
}
|
|
3150
|
-
template(props) {
|
|
3151
|
-
Component._register(ZagComponent);
|
|
3152
|
-
return `<div id="${this.id}" data-part="root"${(props.class || "") == null || (props.class || "") === false ? "" : ` class="${(props.class || "").trim()}"`}><!--${this.id + "-c0"}-->${props.label && `<label data-part="label" class="tree-view-label text-sm font-medium mb-2 block">${props.label}</label>` || ""}<!--${this.id + "-c0-end"}--><div id="${this.id + "-b1"}" data-part="tree" class="tree-view-tree" role="tree">${props.children}</div></div>`;
|
|
3153
|
-
}
|
|
3154
|
-
__onPropChange(key, value) {
|
|
3155
|
-
if (key === "class") try {
|
|
3156
|
-
const __el = this.$(":scope");
|
|
3157
|
-
this.props;
|
|
3158
|
-
const __boundValue = this.props.class || "";
|
|
3159
|
-
if (__el) {
|
|
3160
|
-
const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
|
|
3161
|
-
if (__el.className !== __newClass) __el.className = __newClass;
|
|
3162
|
-
}
|
|
3163
|
-
} catch {}
|
|
3164
|
-
if (key === "children") try {
|
|
3165
|
-
const __el = document.getElementById(this.id + "-b1");
|
|
3166
|
-
if (__el) {
|
|
3167
|
-
if (__el.innerHTML !== value) {
|
|
3168
|
-
__el.innerHTML = value;
|
|
3169
|
-
this.instantiateChildComponents_();
|
|
3170
|
-
if (this.parentComponent) this.parentComponent.mountCompiledChildComponents_();
|
|
3171
|
-
}
|
|
3172
|
-
}
|
|
3173
|
-
} catch {}
|
|
3174
|
-
if (key === "label") this.__geaPatchCond(0);
|
|
3175
|
-
}
|
|
3176
|
-
};
|
|
3177
|
-
//#endregion
|
|
3178
|
-
//#region src/components/button.tsx
|
|
3179
|
-
const variants$2 = {
|
|
3180
|
-
default: "bg-primary text-primary-foreground shadow-sm hover:bg-primary/90",
|
|
3181
|
-
destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
|
|
3182
|
-
outline: "border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
|
|
3183
|
-
secondary: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
|
|
3184
|
-
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
3185
|
-
link: "text-primary underline-offset-4 hover:underline"
|
|
3186
|
-
};
|
|
3187
|
-
const sizes = {
|
|
3188
|
-
default: "h-9 px-4 py-2",
|
|
3189
|
-
sm: "h-8 rounded-md px-3 text-xs",
|
|
3190
|
-
lg: "h-10 rounded-md px-8",
|
|
3191
|
-
icon: "h-9 w-9"
|
|
3192
|
-
};
|
|
3193
|
-
var Button = class extends Component {
|
|
3194
|
-
template(props) {
|
|
3195
|
-
Component._register(Component);
|
|
3196
|
-
const variant = variants$2[props.variant || "default"] || variants$2.default;
|
|
3197
|
-
const size = sizes[props.size || "default"] || sizes.default;
|
|
3198
|
-
return `<button id="${this.id}"${cn("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50", variant, size, props.class) == null || cn("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50", variant, size, props.class) === false ? "" : ` class="${cn("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50", variant, size, props.class).trim()}"`}${(props.type || "button") == null || (props.type || "button") === false ? "" : ` type="${props.type || "button"}"`}${props.disabled == null || props.disabled === false ? "" : ` disabled="${props.disabled}"`}>${props.children}</button>`;
|
|
3199
|
-
}
|
|
3200
|
-
get events() {
|
|
3201
|
-
return { click: { [`#${this.id}`]: this.__event_click_0 } };
|
|
3202
|
-
}
|
|
3203
|
-
__event_click_0(e, targetComponent) {
|
|
3204
|
-
(this.props.click || this.props.onClick)?.(e);
|
|
3205
|
-
}
|
|
3206
|
-
__onPropChange(key, value) {
|
|
3207
|
-
if (key === "variant") try {
|
|
3208
|
-
const __el = this.$(":scope");
|
|
3209
|
-
const props = this.props;
|
|
3210
|
-
const __boundValue = cn("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50", variants$2[props.variant || "default"] || variants$2.default, sizes[props.size || "default"] || sizes.default, this.props.class);
|
|
3211
|
-
if (__el) {
|
|
3212
|
-
const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
|
|
3213
|
-
if (__el.className !== __newClass) __el.className = __newClass;
|
|
3214
|
-
}
|
|
3215
|
-
} catch {}
|
|
3216
|
-
if (key === "size") try {
|
|
3217
|
-
const __el = this.$(":scope");
|
|
3218
|
-
const props = this.props;
|
|
3219
|
-
const __boundValue = cn("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50", variants$2[props.variant || "default"] || variants$2.default, sizes[props.size || "default"] || sizes.default, this.props.class);
|
|
3220
|
-
if (__el) {
|
|
3221
|
-
const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
|
|
3222
|
-
if (__el.className !== __newClass) __el.className = __newClass;
|
|
3223
|
-
}
|
|
3224
|
-
} catch {}
|
|
3225
|
-
if (key === "class") try {
|
|
3226
|
-
const __el = this.$(":scope");
|
|
3227
|
-
const props = this.props;
|
|
3228
|
-
const __boundValue = cn("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50", variants$2[props.variant || "default"] || variants$2.default, sizes[props.size || "default"] || sizes.default, this.props.class);
|
|
3229
|
-
if (__el) {
|
|
3230
|
-
const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
|
|
3231
|
-
if (__el.className !== __newClass) __el.className = __newClass;
|
|
3232
|
-
}
|
|
3233
|
-
} catch {}
|
|
3234
|
-
if (key === "type") try {
|
|
3235
|
-
const __el = this.$(":scope");
|
|
3236
|
-
this.props;
|
|
3237
|
-
const __boundValue = this.props.type || "button";
|
|
3238
|
-
if (__el) if (__boundValue === null || __boundValue === void 0) __el.removeAttribute("type");
|
|
3239
|
-
else __el.setAttribute("type", String(__boundValue));
|
|
3240
|
-
} catch {}
|
|
3241
|
-
if (key === "disabled") try {
|
|
3242
|
-
const __el = this.$(":scope");
|
|
3243
|
-
if (__el) if (!value) __el.removeAttribute("disabled");
|
|
3244
|
-
else __el.setAttribute("disabled", "");
|
|
3245
|
-
} catch {}
|
|
3246
|
-
if (key === "children") try {
|
|
3247
|
-
const __el = this.$(":scope");
|
|
3248
|
-
if (__el) {
|
|
3249
|
-
if (__el.innerHTML !== value) {
|
|
3250
|
-
__el.innerHTML = value;
|
|
3251
|
-
this.instantiateChildComponents_();
|
|
3252
|
-
if (this.parentComponent) this.parentComponent.mountCompiledChildComponents_();
|
|
3253
|
-
}
|
|
3254
|
-
}
|
|
3255
|
-
} catch {}
|
|
3256
|
-
}
|
|
3257
|
-
};
|
|
3258
|
-
//#endregion
|
|
3259
|
-
//#region src/components/card.tsx
|
|
3260
|
-
var Card = class extends Component {
|
|
3261
|
-
template(props) {
|
|
3262
|
-
Component._register(Component);
|
|
3263
|
-
Component._register(Component);
|
|
3264
|
-
Component._register(Component);
|
|
3265
|
-
Component._register(Component);
|
|
3266
|
-
Component._register(Component);
|
|
3267
|
-
Component._register(Component);
|
|
3268
|
-
return `<div id="${this.id}"${cn("rounded-xl border bg-card text-card-foreground shadow", props.class) == null || cn("rounded-xl border bg-card text-card-foreground shadow", props.class) === false ? "" : ` class="${cn("rounded-xl border bg-card text-card-foreground shadow", props.class).trim()}"`}>${props.children}</div>`;
|
|
3269
|
-
}
|
|
3270
|
-
__onPropChange(key, value) {
|
|
3271
|
-
if (key === "class") try {
|
|
3272
|
-
const __el = this.$(":scope");
|
|
3273
|
-
this.props;
|
|
3274
|
-
const __boundValue = cn("rounded-xl border bg-card text-card-foreground shadow", this.props.class);
|
|
3275
|
-
if (__el) {
|
|
3276
|
-
const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
|
|
3277
|
-
if (__el.className !== __newClass) __el.className = __newClass;
|
|
3278
|
-
}
|
|
3279
|
-
} catch {}
|
|
3280
|
-
if (key === "children") try {
|
|
3281
|
-
const __el = this.$(":scope");
|
|
3282
|
-
if (__el) {
|
|
3283
|
-
if (__el.innerHTML !== value) {
|
|
3284
|
-
__el.innerHTML = value;
|
|
3285
|
-
this.instantiateChildComponents_();
|
|
3286
|
-
if (this.parentComponent) this.parentComponent.mountCompiledChildComponents_();
|
|
3287
|
-
}
|
|
3288
|
-
}
|
|
3289
|
-
} catch {}
|
|
3290
|
-
}
|
|
3291
|
-
};
|
|
3292
|
-
var CardHeader = class extends Component {
|
|
3293
|
-
template(props) {
|
|
3294
|
-
Component._register(Component);
|
|
3295
|
-
Component._register(Component);
|
|
3296
|
-
Component._register(Component);
|
|
3297
|
-
Component._register(Component);
|
|
3298
|
-
Component._register(Component);
|
|
3299
|
-
Component._register(Component);
|
|
3300
|
-
return `<div id="${this.id}"${cn("flex flex-col space-y-1.5 p-6", props.class) == null || cn("flex flex-col space-y-1.5 p-6", props.class) === false ? "" : ` class="${cn("flex flex-col space-y-1.5 p-6", props.class).trim()}"`}>${props.children}</div>`;
|
|
3301
|
-
}
|
|
3302
|
-
__onPropChange(key, value) {
|
|
3303
|
-
if (key === "class") try {
|
|
3304
|
-
const __el = this.$(":scope");
|
|
3305
|
-
this.props;
|
|
3306
|
-
const __boundValue = cn("flex flex-col space-y-1.5 p-6", this.props.class);
|
|
3307
|
-
if (__el) {
|
|
3308
|
-
const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
|
|
3309
|
-
if (__el.className !== __newClass) __el.className = __newClass;
|
|
3310
|
-
}
|
|
3311
|
-
} catch {}
|
|
3312
|
-
if (key === "children") try {
|
|
3313
|
-
const __el = this.$(":scope");
|
|
3314
|
-
if (__el) {
|
|
3315
|
-
if (__el.innerHTML !== value) {
|
|
3316
|
-
__el.innerHTML = value;
|
|
3317
|
-
this.instantiateChildComponents_();
|
|
3318
|
-
if (this.parentComponent) this.parentComponent.mountCompiledChildComponents_();
|
|
3319
|
-
}
|
|
3320
|
-
}
|
|
3321
|
-
} catch {}
|
|
3322
|
-
}
|
|
3323
|
-
};
|
|
3324
|
-
var CardTitle = class extends Component {
|
|
3325
|
-
template(props) {
|
|
3326
|
-
Component._register(Component);
|
|
3327
|
-
Component._register(Component);
|
|
3328
|
-
Component._register(Component);
|
|
3329
|
-
Component._register(Component);
|
|
3330
|
-
Component._register(Component);
|
|
3331
|
-
Component._register(Component);
|
|
3332
|
-
return `<h3 id="${this.id}"${cn("font-semibold leading-none tracking-tight", props.class) == null || cn("font-semibold leading-none tracking-tight", props.class) === false ? "" : ` class="${cn("font-semibold leading-none tracking-tight", props.class).trim()}"`}>${props.children}</h3>`;
|
|
3333
|
-
}
|
|
3334
|
-
__onPropChange(key, value) {
|
|
3335
|
-
if (key === "class") try {
|
|
3336
|
-
const __el = this.$(":scope");
|
|
3337
|
-
this.props;
|
|
3338
|
-
const __boundValue = cn("font-semibold leading-none tracking-tight", this.props.class);
|
|
3339
|
-
if (__el) {
|
|
3340
|
-
const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
|
|
3341
|
-
if (__el.className !== __newClass) __el.className = __newClass;
|
|
3342
|
-
}
|
|
3343
|
-
} catch {}
|
|
3344
|
-
if (key === "children") try {
|
|
3345
|
-
const __el = this.$(":scope");
|
|
3346
|
-
if (__el) {
|
|
3347
|
-
if (__el.innerHTML !== value) {
|
|
3348
|
-
__el.innerHTML = value;
|
|
3349
|
-
this.instantiateChildComponents_();
|
|
3350
|
-
if (this.parentComponent) this.parentComponent.mountCompiledChildComponents_();
|
|
3351
|
-
}
|
|
3352
|
-
}
|
|
3353
|
-
} catch {}
|
|
3354
|
-
}
|
|
3355
|
-
};
|
|
3356
|
-
var CardDescription = class extends Component {
|
|
3357
|
-
template(props) {
|
|
3358
|
-
Component._register(Component);
|
|
3359
|
-
Component._register(Component);
|
|
3360
|
-
Component._register(Component);
|
|
3361
|
-
Component._register(Component);
|
|
3362
|
-
Component._register(Component);
|
|
3363
|
-
Component._register(Component);
|
|
3364
|
-
return `<p id="${this.id}"${cn("text-sm text-muted-foreground", props.class) == null || cn("text-sm text-muted-foreground", props.class) === false ? "" : ` class="${cn("text-sm text-muted-foreground", props.class).trim()}"`}>${props.children}</p>`;
|
|
3365
|
-
}
|
|
3366
|
-
__onPropChange(key, value) {
|
|
3367
|
-
if (key === "class") try {
|
|
3368
|
-
const __el = this.$(":scope");
|
|
3369
|
-
this.props;
|
|
3370
|
-
const __boundValue = cn("text-sm text-muted-foreground", this.props.class);
|
|
3371
|
-
if (__el) {
|
|
3372
|
-
const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
|
|
3373
|
-
if (__el.className !== __newClass) __el.className = __newClass;
|
|
3374
|
-
}
|
|
3375
|
-
} catch {}
|
|
3376
|
-
if (key === "children") try {
|
|
3377
|
-
const __el = this.$(":scope");
|
|
3378
|
-
if (__el) {
|
|
3379
|
-
if (__el.innerHTML !== value) {
|
|
3380
|
-
__el.innerHTML = value;
|
|
3381
|
-
this.instantiateChildComponents_();
|
|
3382
|
-
if (this.parentComponent) this.parentComponent.mountCompiledChildComponents_();
|
|
3383
|
-
}
|
|
3384
|
-
}
|
|
3385
|
-
} catch {}
|
|
3386
|
-
}
|
|
3387
|
-
};
|
|
3388
|
-
var CardContent = class extends Component {
|
|
3389
|
-
template(props) {
|
|
3390
|
-
Component._register(Component);
|
|
3391
|
-
Component._register(Component);
|
|
3392
|
-
Component._register(Component);
|
|
3393
|
-
Component._register(Component);
|
|
3394
|
-
Component._register(Component);
|
|
3395
|
-
Component._register(Component);
|
|
3396
|
-
return `<div id="${this.id}"${cn("p-6 pt-0", props.class) == null || cn("p-6 pt-0", props.class) === false ? "" : ` class="${cn("p-6 pt-0", props.class).trim()}"`}>${props.children}</div>`;
|
|
3397
|
-
}
|
|
3398
|
-
__onPropChange(key, value) {
|
|
3399
|
-
if (key === "class") try {
|
|
3400
|
-
const __el = this.$(":scope");
|
|
3401
|
-
this.props;
|
|
3402
|
-
const __boundValue = cn("p-6 pt-0", this.props.class);
|
|
3403
|
-
if (__el) {
|
|
3404
|
-
const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
|
|
3405
|
-
if (__el.className !== __newClass) __el.className = __newClass;
|
|
3406
|
-
}
|
|
3407
|
-
} catch {}
|
|
3408
|
-
if (key === "children") try {
|
|
3409
|
-
const __el = this.$(":scope");
|
|
3410
|
-
if (__el) {
|
|
3411
|
-
if (__el.innerHTML !== value) {
|
|
3412
|
-
__el.innerHTML = value;
|
|
3413
|
-
this.instantiateChildComponents_();
|
|
3414
|
-
if (this.parentComponent) this.parentComponent.mountCompiledChildComponents_();
|
|
3415
|
-
}
|
|
3416
|
-
}
|
|
3417
|
-
} catch {}
|
|
3418
|
-
}
|
|
3419
|
-
};
|
|
3420
|
-
var CardFooter = class extends Component {
|
|
3421
|
-
template(props) {
|
|
3422
|
-
Component._register(Component);
|
|
3423
|
-
Component._register(Component);
|
|
3424
|
-
Component._register(Component);
|
|
3425
|
-
Component._register(Component);
|
|
3426
|
-
Component._register(Component);
|
|
3427
|
-
Component._register(Component);
|
|
3428
|
-
return `<div id="${this.id}"${cn("flex items-center p-6 pt-0", props.class) == null || cn("flex items-center p-6 pt-0", props.class) === false ? "" : ` class="${cn("flex items-center p-6 pt-0", props.class).trim()}"`}>${props.children}</div>`;
|
|
3429
|
-
}
|
|
3430
|
-
__onPropChange(key, value) {
|
|
3431
|
-
if (key === "class") try {
|
|
3432
|
-
const __el = this.$(":scope");
|
|
3433
|
-
this.props;
|
|
3434
|
-
const __boundValue = cn("flex items-center p-6 pt-0", this.props.class);
|
|
3435
|
-
if (__el) {
|
|
3436
|
-
const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
|
|
3437
|
-
if (__el.className !== __newClass) __el.className = __newClass;
|
|
3438
|
-
}
|
|
3439
|
-
} catch {}
|
|
3440
|
-
if (key === "children") try {
|
|
3441
|
-
const __el = this.$(":scope");
|
|
3442
|
-
if (__el) {
|
|
3443
|
-
if (__el.innerHTML !== value) {
|
|
3444
|
-
__el.innerHTML = value;
|
|
3445
|
-
this.instantiateChildComponents_();
|
|
3446
|
-
if (this.parentComponent) this.parentComponent.mountCompiledChildComponents_();
|
|
3447
|
-
}
|
|
3448
|
-
}
|
|
3449
|
-
} catch {}
|
|
3450
|
-
}
|
|
3451
|
-
};
|
|
3452
|
-
//#endregion
|
|
3453
|
-
//#region src/components/input.tsx
|
|
3454
|
-
var Input = class extends Component {
|
|
3455
|
-
template(props) {
|
|
3456
|
-
Component._register(Component);
|
|
3457
|
-
return `<input id="${this.id}"${cn("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", props.class) == null || cn("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", props.class) === false ? "" : ` class="${cn("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", props.class).trim()}"`}${(props.type || "text") == null || (props.type || "text") === false ? "" : ` type="${props.type || "text"}"`}${props.placeholder == null || props.placeholder === false ? "" : ` placeholder="${props.placeholder}"`}${props.value == null || props.value === false ? "" : ` value="${props.value}"`}${props.disabled == null || props.disabled === false ? "" : ` disabled="${props.disabled}"`}${props.name == null || props.name === false ? "" : ` name="${props.name}"`} />`;
|
|
3458
|
-
}
|
|
3459
|
-
get events() {
|
|
3460
|
-
return { input: { [`#${this.id}`]: this.__event_input_0 } };
|
|
3461
|
-
}
|
|
3462
|
-
__event_input_0(e, targetComponent) {
|
|
3463
|
-
this.props.onInput(e);
|
|
3464
|
-
}
|
|
3465
|
-
__onPropChange(key, value) {
|
|
3466
|
-
if (key === "class") try {
|
|
3467
|
-
const __el = this.$(":scope");
|
|
3468
|
-
this.props;
|
|
3469
|
-
const __boundValue = cn("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", this.props.class);
|
|
3470
|
-
if (__el) {
|
|
3471
|
-
const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
|
|
3472
|
-
if (__el.className !== __newClass) __el.className = __newClass;
|
|
3473
|
-
}
|
|
3474
|
-
} catch {}
|
|
3475
|
-
if (key === "type") try {
|
|
3476
|
-
const __el = this.$(":scope");
|
|
3477
|
-
this.props;
|
|
3478
|
-
const __boundValue = this.props.type || "text";
|
|
3479
|
-
if (__el) if (__boundValue === null || __boundValue === void 0) __el.removeAttribute("type");
|
|
3480
|
-
else __el.setAttribute("type", String(__boundValue));
|
|
3481
|
-
} catch {}
|
|
3482
|
-
if (key === "placeholder") try {
|
|
3483
|
-
const __el = this.$(":scope");
|
|
3484
|
-
if (__el) if (value === null || value === void 0) __el.removeAttribute("placeholder");
|
|
3485
|
-
else __el.setAttribute("placeholder", String(value));
|
|
3486
|
-
} catch {}
|
|
3487
|
-
if (key === "value") try {
|
|
3488
|
-
const __el = this.$(":scope");
|
|
3489
|
-
if (__el) __el.value = value === null || value === void 0 ? "" : String(value);
|
|
3490
|
-
} catch {}
|
|
3491
|
-
if (key === "disabled") try {
|
|
3492
|
-
const __el = this.$(":scope");
|
|
3493
|
-
if (__el) if (!value) __el.removeAttribute("disabled");
|
|
3494
|
-
else __el.setAttribute("disabled", "");
|
|
3495
|
-
} catch {}
|
|
3496
|
-
if (key === "name") try {
|
|
3497
|
-
const __el = this.$(":scope");
|
|
3498
|
-
if (__el) if (value === null || value === void 0) __el.removeAttribute("name");
|
|
3499
|
-
else __el.setAttribute("name", String(value));
|
|
3500
|
-
} catch {}
|
|
3501
|
-
if (key === "inputId") try {
|
|
3502
|
-
const __el = this.$(":scope");
|
|
3503
|
-
if (__el) if (value === null || value === void 0) __el.removeAttribute("id");
|
|
3504
|
-
else __el.setAttribute("id", String(value));
|
|
3505
|
-
} catch {}
|
|
3506
|
-
if (key === "onInput") try {
|
|
3507
|
-
const __el = this.$(":scope");
|
|
3508
|
-
if (__el) if (value === null || value === void 0) __el.removeAttribute("onInput");
|
|
3509
|
-
else __el.setAttribute("onInput", String(value));
|
|
3510
|
-
} catch {}
|
|
3511
|
-
}
|
|
3512
|
-
};
|
|
3513
|
-
//#endregion
|
|
3514
|
-
//#region src/components/textarea.tsx
|
|
3515
|
-
var Textarea = class extends Component {
|
|
3516
|
-
template(props) {
|
|
3517
|
-
Component._register(Component);
|
|
3518
|
-
return `<textarea id="${this.id}"${cn("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", props.class) == null || cn("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", props.class) === false ? "" : ` class="${cn("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", props.class).trim()}"`}${props.placeholder == null || props.placeholder === false ? "" : ` placeholder="${props.placeholder}"`}${props.disabled == null || props.disabled === false ? "" : ` disabled="${props.disabled}"`}${props.name == null || props.name === false ? "" : ` name="${props.name}"`}${props.rows == null || props.rows === false ? "" : ` rows="${props.rows}"`}>${props.value || ""}</textarea>`;
|
|
3519
|
-
}
|
|
3520
|
-
get events() {
|
|
3521
|
-
return { input: { [`#${this.id}`]: this.__event_input_0 } };
|
|
3522
|
-
}
|
|
3523
|
-
__event_input_0(e, targetComponent) {
|
|
3524
|
-
this.props.onInput(e);
|
|
3525
|
-
}
|
|
3526
|
-
__onPropChange(key, value) {
|
|
3527
|
-
if (key === "class") try {
|
|
3528
|
-
const __el = this.$(":scope");
|
|
3529
|
-
this.props;
|
|
3530
|
-
const __boundValue = cn("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", this.props.class);
|
|
3531
|
-
if (__el) {
|
|
3532
|
-
const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
|
|
3533
|
-
if (__el.className !== __newClass) __el.className = __newClass;
|
|
3534
|
-
}
|
|
3535
|
-
} catch {}
|
|
3536
|
-
if (key === "placeholder") try {
|
|
3537
|
-
const __el = this.$(":scope");
|
|
3538
|
-
if (__el) if (value === null || value === void 0) __el.removeAttribute("placeholder");
|
|
3539
|
-
else __el.setAttribute("placeholder", String(value));
|
|
3540
|
-
} catch {}
|
|
3541
|
-
if (key === "disabled") try {
|
|
3542
|
-
const __el = this.$(":scope");
|
|
3543
|
-
if (__el) if (!value) __el.removeAttribute("disabled");
|
|
3544
|
-
else __el.setAttribute("disabled", "");
|
|
3545
|
-
} catch {}
|
|
3546
|
-
if (key === "name") try {
|
|
3547
|
-
const __el = this.$(":scope");
|
|
3548
|
-
if (__el) if (value === null || value === void 0) __el.removeAttribute("name");
|
|
3549
|
-
else __el.setAttribute("name", String(value));
|
|
3550
|
-
} catch {}
|
|
3551
|
-
if (key === "rows") try {
|
|
3552
|
-
const __el = this.$(":scope");
|
|
3553
|
-
if (__el) if (value === null || value === void 0) __el.removeAttribute("rows");
|
|
3554
|
-
else __el.setAttribute("rows", String(value));
|
|
3555
|
-
} catch {}
|
|
3556
|
-
if (key === "onInput") try {
|
|
3557
|
-
const __el = this.$(":scope");
|
|
3558
|
-
if (__el) if (value === null || value === void 0) __el.removeAttribute("onInput");
|
|
3559
|
-
else __el.setAttribute("onInput", String(value));
|
|
3560
|
-
} catch {}
|
|
3561
|
-
if (key === "value") try {
|
|
3562
|
-
const __el = this.$(":scope");
|
|
3563
|
-
this.props;
|
|
3564
|
-
const __boundValue = this.props.value || "";
|
|
3565
|
-
if (__el) {
|
|
3566
|
-
if (__el.textContent !== __boundValue) __el.textContent = __boundValue;
|
|
3567
|
-
}
|
|
3568
|
-
} catch {}
|
|
3569
|
-
}
|
|
3570
|
-
};
|
|
3571
|
-
//#endregion
|
|
3572
|
-
//#region src/components/label.tsx
|
|
3573
|
-
var Label = class extends Component {
|
|
3574
|
-
template(props) {
|
|
3575
|
-
Component._register(Component);
|
|
3576
|
-
return `<label id="${this.id}"${cn("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70", props.class) == null || cn("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70", props.class) === false ? "" : ` class="${cn("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70", props.class).trim()}"`}${props.htmlFor == null || props.htmlFor === false ? "" : ` for="${props.htmlFor}"`}>${props.children}</label>`;
|
|
3577
|
-
}
|
|
3578
|
-
__onPropChange(key, value) {
|
|
3579
|
-
if (key === "class") try {
|
|
3580
|
-
const __el = this.$(":scope");
|
|
3581
|
-
this.props;
|
|
3582
|
-
const __boundValue = cn("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70", this.props.class);
|
|
3583
|
-
if (__el) {
|
|
3584
|
-
const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
|
|
3585
|
-
if (__el.className !== __newClass) __el.className = __newClass;
|
|
3586
|
-
}
|
|
3587
|
-
} catch {}
|
|
3588
|
-
if (key === "htmlFor") try {
|
|
3589
|
-
const __el = this.$(":scope");
|
|
3590
|
-
if (__el) if (value === null || value === void 0) __el.removeAttribute("for");
|
|
3591
|
-
else __el.setAttribute("for", String(value));
|
|
3592
|
-
} catch {}
|
|
3593
|
-
if (key === "children") try {
|
|
3594
|
-
const __el = this.$(":scope");
|
|
3595
|
-
if (__el) {
|
|
3596
|
-
if (__el.innerHTML !== value) {
|
|
3597
|
-
__el.innerHTML = value;
|
|
3598
|
-
this.instantiateChildComponents_();
|
|
3599
|
-
if (this.parentComponent) this.parentComponent.mountCompiledChildComponents_();
|
|
3600
|
-
}
|
|
3601
|
-
}
|
|
3602
|
-
} catch {}
|
|
3603
|
-
}
|
|
3604
|
-
};
|
|
3605
|
-
//#endregion
|
|
3606
|
-
//#region src/components/badge.tsx
|
|
3607
|
-
const variants$1 = {
|
|
3608
|
-
default: "border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",
|
|
3609
|
-
secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
3610
|
-
destructive: "border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",
|
|
3611
|
-
outline: "text-foreground"
|
|
3612
|
-
};
|
|
3613
|
-
var Badge = class extends Component {
|
|
3614
|
-
template(props) {
|
|
3615
|
-
Component._register(Component);
|
|
3616
|
-
const variant = variants$1[props.variant || "default"] || variants$1.default;
|
|
3617
|
-
return `<span id="${this.id}"${cn("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2", variant, props.class) == null || cn("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2", variant, props.class) === false ? "" : ` class="${cn("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2", variant, props.class).trim()}"`}>${props.children}</span>`;
|
|
3618
|
-
}
|
|
3619
|
-
__onPropChange(key, value) {
|
|
3620
|
-
if (key === "variant") try {
|
|
3621
|
-
const __el = this.$(":scope");
|
|
3622
|
-
const __boundValue = cn("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2", variants$1[this.props.variant || "default"] || variants$1.default, this.props.class);
|
|
3623
|
-
if (__el) {
|
|
3624
|
-
const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
|
|
3625
|
-
if (__el.className !== __newClass) __el.className = __newClass;
|
|
3626
|
-
}
|
|
3627
|
-
} catch {}
|
|
3628
|
-
if (key === "class") try {
|
|
3629
|
-
const __el = this.$(":scope");
|
|
3630
|
-
const __boundValue = cn("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2", variants$1[this.props.variant || "default"] || variants$1.default, this.props.class);
|
|
3631
|
-
if (__el) {
|
|
3632
|
-
const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
|
|
3633
|
-
if (__el.className !== __newClass) __el.className = __newClass;
|
|
3634
|
-
}
|
|
3635
|
-
} catch {}
|
|
3636
|
-
if (key === "children") try {
|
|
3637
|
-
const __el = this.$(":scope");
|
|
3638
|
-
if (__el) {
|
|
3639
|
-
if (__el.innerHTML !== value) {
|
|
3640
|
-
__el.innerHTML = value;
|
|
3641
|
-
this.instantiateChildComponents_();
|
|
3642
|
-
if (this.parentComponent) this.parentComponent.mountCompiledChildComponents_();
|
|
3643
|
-
}
|
|
3644
|
-
}
|
|
3645
|
-
} catch {}
|
|
3646
|
-
}
|
|
3647
|
-
};
|
|
3648
|
-
//#endregion
|
|
3649
|
-
//#region src/components/alert.tsx
|
|
3650
|
-
const variants = {
|
|
3651
|
-
default: "bg-background text-foreground",
|
|
3652
|
-
destructive: "border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"
|
|
3653
|
-
};
|
|
3654
|
-
var Alert = class extends Component {
|
|
3655
|
-
template(props) {
|
|
3656
|
-
Component._register(Component);
|
|
3657
|
-
Component._register(Component);
|
|
3658
|
-
Component._register(Component);
|
|
3659
|
-
const variant = variants[props.variant || "default"] || variants.default;
|
|
3660
|
-
return `<div id="${this.id}"${cn("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7", variant, props.class) == null || cn("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7", variant, props.class) === false ? "" : ` class="${cn("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7", variant, props.class).trim()}"`} role="alert">${props.children}</div>`;
|
|
3661
|
-
}
|
|
3662
|
-
__onPropChange(key, value) {
|
|
3663
|
-
if (key === "variant") try {
|
|
3664
|
-
const __el = this.$(":scope");
|
|
3665
|
-
const __boundValue = cn("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7", variants[this.props.variant || "default"] || variants.default, this.props.class);
|
|
3666
|
-
if (__el) {
|
|
3667
|
-
const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
|
|
3668
|
-
if (__el.className !== __newClass) __el.className = __newClass;
|
|
3669
|
-
}
|
|
3670
|
-
} catch {}
|
|
3671
|
-
if (key === "class") try {
|
|
3672
|
-
const __el = this.$(":scope");
|
|
3673
|
-
const __boundValue = cn("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7", variants[this.props.variant || "default"] || variants.default, this.props.class);
|
|
3674
|
-
if (__el) {
|
|
3675
|
-
const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
|
|
3676
|
-
if (__el.className !== __newClass) __el.className = __newClass;
|
|
3677
|
-
}
|
|
3678
|
-
} catch {}
|
|
3679
|
-
if (key === "children") try {
|
|
3680
|
-
const __el = this.$(":scope");
|
|
3681
|
-
if (__el) {
|
|
3682
|
-
if (__el.innerHTML !== value) {
|
|
3683
|
-
__el.innerHTML = value;
|
|
3684
|
-
this.instantiateChildComponents_();
|
|
3685
|
-
if (this.parentComponent) this.parentComponent.mountCompiledChildComponents_();
|
|
3686
|
-
}
|
|
3687
|
-
}
|
|
3688
|
-
} catch {}
|
|
3689
|
-
}
|
|
3690
|
-
};
|
|
3691
|
-
var AlertTitle = class extends Component {
|
|
3692
|
-
template(props) {
|
|
3693
|
-
Component._register(Component);
|
|
3694
|
-
Component._register(Component);
|
|
3695
|
-
Component._register(Component);
|
|
3696
|
-
return `<h5 id="${this.id}"${cn("mb-1 font-medium leading-none tracking-tight", props.class) == null || cn("mb-1 font-medium leading-none tracking-tight", props.class) === false ? "" : ` class="${cn("mb-1 font-medium leading-none tracking-tight", props.class).trim()}"`}>${props.children}</h5>`;
|
|
3697
|
-
}
|
|
3698
|
-
__onPropChange(key, value) {
|
|
3699
|
-
if (key === "class") try {
|
|
3700
|
-
const __el = this.$(":scope");
|
|
3701
|
-
this.props;
|
|
3702
|
-
const __boundValue = cn("mb-1 font-medium leading-none tracking-tight", this.props.class);
|
|
3703
|
-
if (__el) {
|
|
3704
|
-
const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
|
|
3705
|
-
if (__el.className !== __newClass) __el.className = __newClass;
|
|
3706
|
-
}
|
|
3707
|
-
} catch {}
|
|
3708
|
-
if (key === "children") try {
|
|
3709
|
-
const __el = this.$(":scope");
|
|
3710
|
-
if (__el) {
|
|
3711
|
-
if (__el.innerHTML !== value) {
|
|
3712
|
-
__el.innerHTML = value;
|
|
3713
|
-
this.instantiateChildComponents_();
|
|
3714
|
-
if (this.parentComponent) this.parentComponent.mountCompiledChildComponents_();
|
|
3715
|
-
}
|
|
3716
|
-
}
|
|
3717
|
-
} catch {}
|
|
3718
|
-
}
|
|
3719
|
-
};
|
|
3720
|
-
var AlertDescription = class extends Component {
|
|
3721
|
-
template(props) {
|
|
3722
|
-
Component._register(Component);
|
|
3723
|
-
Component._register(Component);
|
|
3724
|
-
Component._register(Component);
|
|
3725
|
-
return `<div id="${this.id}"${cn("text-sm [&_p]:leading-relaxed", props.class) == null || cn("text-sm [&_p]:leading-relaxed", props.class) === false ? "" : ` class="${cn("text-sm [&_p]:leading-relaxed", props.class).trim()}"`}>${props.children}</div>`;
|
|
3726
|
-
}
|
|
3727
|
-
__onPropChange(key, value) {
|
|
3728
|
-
if (key === "class") try {
|
|
3729
|
-
const __el = this.$(":scope");
|
|
3730
|
-
this.props;
|
|
3731
|
-
const __boundValue = cn("text-sm [&_p]:leading-relaxed", this.props.class);
|
|
3732
|
-
if (__el) {
|
|
3733
|
-
const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
|
|
3734
|
-
if (__el.className !== __newClass) __el.className = __newClass;
|
|
3735
|
-
}
|
|
3736
|
-
} catch {}
|
|
3737
|
-
if (key === "children") try {
|
|
3738
|
-
const __el = this.$(":scope");
|
|
3739
|
-
if (__el) {
|
|
3740
|
-
if (__el.innerHTML !== value) {
|
|
3741
|
-
__el.innerHTML = value;
|
|
3742
|
-
this.instantiateChildComponents_();
|
|
3743
|
-
if (this.parentComponent) this.parentComponent.mountCompiledChildComponents_();
|
|
3744
|
-
}
|
|
3745
|
-
}
|
|
3746
|
-
} catch {}
|
|
3747
|
-
}
|
|
3748
|
-
};
|
|
3749
|
-
//#endregion
|
|
3750
|
-
//#region src/components/separator.tsx
|
|
3751
|
-
var Separator = class extends Component {
|
|
3752
|
-
template(props) {
|
|
3753
|
-
Component._register(Component);
|
|
3754
|
-
const isVertical = props.orientation === "vertical";
|
|
3755
|
-
return `<div id="${this.id}"${cn("shrink-0 bg-border", isVertical ? "h-full w-[1px]" : "h-[1px] w-full", props.class) == null || cn("shrink-0 bg-border", isVertical ? "h-full w-[1px]" : "h-[1px] w-full", props.class) === false ? "" : ` class="${cn("shrink-0 bg-border", isVertical ? "h-full w-[1px]" : "h-[1px] w-full", props.class).trim()}"`} role="separator"${(props.orientation || "horizontal") == null || (props.orientation || "horizontal") === false ? "" : ` aria-orientation="${props.orientation || "horizontal"}"`}></div>`;
|
|
3756
|
-
}
|
|
3757
|
-
__onPropChange(key, value) {
|
|
3758
|
-
if (key === "orientation") try {
|
|
3759
|
-
{
|
|
3760
|
-
const __el = this.$(":scope");
|
|
3761
|
-
this.props;
|
|
3762
|
-
const __boundValue = cn("shrink-0 bg-border", this.props.orientation === "vertical" ? "h-full w-[1px]" : "h-[1px] w-full", this.props.class);
|
|
3763
|
-
if (__el) {
|
|
3764
|
-
const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
|
|
3765
|
-
if (__el.className !== __newClass) __el.className = __newClass;
|
|
3766
|
-
}
|
|
3767
|
-
}
|
|
3768
|
-
{
|
|
3769
|
-
const __el = this.$(":scope");
|
|
3770
|
-
this.props;
|
|
3771
|
-
const __boundValue = this.props.orientation || "horizontal";
|
|
3772
|
-
if (__el) if (__boundValue === null || __boundValue === void 0) __el.removeAttribute("aria-orientation");
|
|
3773
|
-
else __el.setAttribute("aria-orientation", String(__boundValue));
|
|
3774
|
-
}
|
|
3775
|
-
} catch {}
|
|
3776
|
-
if (key === "class") try {
|
|
3777
|
-
const __el = this.$(":scope");
|
|
3778
|
-
this.props;
|
|
3779
|
-
const __boundValue = cn("shrink-0 bg-border", this.props.orientation === "vertical" ? "h-full w-[1px]" : "h-[1px] w-full", this.props.class);
|
|
3780
|
-
if (__el) {
|
|
3781
|
-
const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
|
|
3782
|
-
if (__el.className !== __newClass) __el.className = __newClass;
|
|
3783
|
-
}
|
|
3784
|
-
} catch {}
|
|
3785
|
-
}
|
|
3786
|
-
};
|
|
3787
|
-
//#endregion
|
|
3788
|
-
//#region src/components/skeleton.tsx
|
|
3789
|
-
var Skeleton = class extends Component {
|
|
3790
|
-
template(props) {
|
|
3791
|
-
Component._register(Component);
|
|
3792
|
-
return `<div id="${this.id}"${cn("animate-pulse rounded-md bg-primary/10", props.class) == null || cn("animate-pulse rounded-md bg-primary/10", props.class) === false ? "" : ` class="${cn("animate-pulse rounded-md bg-primary/10", props.class).trim()}"`}></div>`;
|
|
3793
|
-
}
|
|
3794
|
-
__onPropChange(key, value) {
|
|
3795
|
-
if (key === "class") try {
|
|
3796
|
-
const __el = this.$(":scope");
|
|
3797
|
-
this.props;
|
|
3798
|
-
const __boundValue = cn("animate-pulse rounded-md bg-primary/10", this.props.class);
|
|
3799
|
-
if (__el) {
|
|
3800
|
-
const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
|
|
3801
|
-
if (__el.className !== __newClass) __el.className = __newClass;
|
|
3802
|
-
}
|
|
3803
|
-
} catch {}
|
|
3804
|
-
}
|
|
3805
|
-
};
|
|
3806
|
-
//#endregion
|
|
3807
|
-
//#region src/components/dnd-manager.ts
|
|
3808
|
-
const DRAG_THRESHOLD_SQ = 25;
|
|
3809
|
-
const DRAGGABLE_SEL = "[data-draggable-id]";
|
|
3810
|
-
const DROPPABLE_SEL = "[data-droppable-id]";
|
|
3811
|
-
var DndManager = class {
|
|
3812
|
-
constructor() {
|
|
3813
|
-
this.droppables = /* @__PURE__ */ new Map();
|
|
3814
|
-
this._onDragEnd = null;
|
|
3815
|
-
this._dragging = false;
|
|
3816
|
-
this._started = false;
|
|
3817
|
-
this._draggedId = "";
|
|
3818
|
-
this._sourceDroppableId = "";
|
|
3819
|
-
this._sourceIndex = 0;
|
|
3820
|
-
this._sourceEl = null;
|
|
3821
|
-
this._sourceHeight = 0;
|
|
3822
|
-
this._sourceRect = null;
|
|
3823
|
-
this._savedCssText = "";
|
|
3824
|
-
this._placeholder = null;
|
|
3825
|
-
this._startX = 0;
|
|
3826
|
-
this._startY = 0;
|
|
3827
|
-
this._offsetX = 0;
|
|
3828
|
-
this._offsetY = 0;
|
|
3829
|
-
this._currentDroppableId = null;
|
|
3830
|
-
this._currentIndex = 0;
|
|
3831
|
-
this._lastClientY = 0;
|
|
3832
|
-
this._cleanedUp = false;
|
|
3833
|
-
this._boundMove = this._onPointerMove.bind(this);
|
|
3834
|
-
this._boundUp = this._onPointerUp.bind(this);
|
|
3835
|
-
this._boundKeyDown = this._onKeyDown.bind(this);
|
|
3836
|
-
this._boundDocDown = this._onDocumentPointerDown.bind(this);
|
|
3837
|
-
this._docListenerAttached = false;
|
|
3838
|
-
}
|
|
3839
|
-
get onDragEnd() {
|
|
3840
|
-
return this._onDragEnd;
|
|
3841
|
-
}
|
|
3842
|
-
set onDragEnd(fn) {
|
|
3843
|
-
this._onDragEnd = fn;
|
|
3844
|
-
if (fn) this._ensureDocListener();
|
|
3845
|
-
}
|
|
3846
|
-
get isDragging() {
|
|
3847
|
-
return this._started;
|
|
3848
|
-
}
|
|
3849
|
-
_ensureDocListener() {
|
|
3850
|
-
if (this._docListenerAttached || typeof document === "undefined") return;
|
|
3851
|
-
document.addEventListener("pointerdown", this._boundDocDown, true);
|
|
3852
|
-
this._docListenerAttached = true;
|
|
3853
|
-
}
|
|
3854
|
-
_onDocumentPointerDown(e) {
|
|
3855
|
-
const el = e.target.closest?.(DRAGGABLE_SEL);
|
|
3856
|
-
if (!el) return;
|
|
3857
|
-
this.startTracking(e, el.dataset.draggableId, el);
|
|
3858
|
-
}
|
|
3859
|
-
registerDroppable(id, el) {
|
|
3860
|
-
this.droppables.set(id, el);
|
|
3861
|
-
this._ensureDocListener();
|
|
3862
|
-
}
|
|
3863
|
-
unregisterDroppable(id) {
|
|
3864
|
-
this.droppables.delete(id);
|
|
3865
|
-
}
|
|
3866
|
-
startTracking(e, draggableId, el) {
|
|
3867
|
-
if (this._dragging || e.button !== 0) return;
|
|
3868
|
-
this._ensureDocListener();
|
|
3869
|
-
const droppableEl = el.closest(DROPPABLE_SEL);
|
|
3870
|
-
if (!droppableEl) return;
|
|
3871
|
-
const droppableId = droppableEl.dataset.droppableId;
|
|
3872
|
-
const sourceIndex = Array.from(droppableEl.querySelectorAll(`:scope > ${DRAGGABLE_SEL}`)).indexOf(el);
|
|
3873
|
-
if (sourceIndex === -1) return;
|
|
3874
|
-
this._dragging = true;
|
|
3875
|
-
this._started = false;
|
|
3876
|
-
this._cleanedUp = false;
|
|
3877
|
-
this._draggedId = draggableId;
|
|
3878
|
-
this._sourceDroppableId = droppableId;
|
|
3879
|
-
this._sourceIndex = sourceIndex;
|
|
3880
|
-
this._sourceEl = el;
|
|
3881
|
-
const rect = el.getBoundingClientRect();
|
|
3882
|
-
this._sourceHeight = rect.height;
|
|
3883
|
-
this._sourceRect = rect;
|
|
3884
|
-
this._startX = e.clientX;
|
|
3885
|
-
this._startY = e.clientY;
|
|
3886
|
-
this._lastClientY = e.clientY;
|
|
3887
|
-
this._offsetX = e.clientX - rect.left;
|
|
3888
|
-
this._offsetY = e.clientY - rect.top;
|
|
3889
|
-
document.addEventListener("pointermove", this._boundMove);
|
|
3890
|
-
document.addEventListener("pointerup", this._boundUp);
|
|
3891
|
-
document.addEventListener("keydown", this._boundKeyDown);
|
|
3892
|
-
e.preventDefault();
|
|
3893
|
-
}
|
|
3894
|
-
_onPointerMove(e) {
|
|
3895
|
-
if (!this._dragging) return;
|
|
3896
|
-
if (!this._started) {
|
|
3897
|
-
const dx = e.clientX - this._startX;
|
|
3898
|
-
const dy = e.clientY - this._startY;
|
|
3899
|
-
if (dx * dx + dy * dy < DRAG_THRESHOLD_SQ) return;
|
|
3900
|
-
this._initDrag();
|
|
3901
|
-
this._updateTarget(e.clientX, e.clientY);
|
|
3902
|
-
return;
|
|
3903
|
-
}
|
|
3904
|
-
this._sourceEl.style.transform = `translate(${e.clientX - this._offsetX}px, ${e.clientY - this._offsetY}px)`;
|
|
3905
|
-
this._updateTarget(e.clientX, e.clientY);
|
|
3906
|
-
this._lastClientY = e.clientY;
|
|
3907
|
-
}
|
|
3908
|
-
_initDrag() {
|
|
3909
|
-
this._started = true;
|
|
3910
|
-
const el = this._sourceEl;
|
|
3911
|
-
const rect = this._sourceRect;
|
|
3912
|
-
document.querySelectorAll(DROPPABLE_SEL).forEach((dropEl) => {
|
|
3913
|
-
const id = dropEl.dataset.droppableId;
|
|
3914
|
-
if (!this.droppables.has(id)) this.droppables.set(id, dropEl);
|
|
3915
|
-
});
|
|
3916
|
-
const elMargin = getComputedStyle(el).marginBottom;
|
|
3917
|
-
this._savedCssText = el.style.cssText;
|
|
3918
|
-
const placeholder = document.createElement("div");
|
|
3919
|
-
placeholder.className = "gea-dnd-placeholder";
|
|
3920
|
-
placeholder.style.height = rect.height + "px";
|
|
3921
|
-
placeholder.style.marginBottom = elMargin;
|
|
3922
|
-
placeholder.style.transition = "none";
|
|
3923
|
-
el.parentElement.insertBefore(placeholder, el);
|
|
3924
|
-
document.body.appendChild(el);
|
|
3925
|
-
Object.assign(el.style, {
|
|
3926
|
-
position: "fixed",
|
|
3927
|
-
top: "0px",
|
|
3928
|
-
left: "0",
|
|
3929
|
-
width: rect.width + "px",
|
|
3930
|
-
height: rect.height + "px",
|
|
3931
|
-
transform: `translate(${rect.left}px, ${rect.top}px)`,
|
|
3932
|
-
pointerEvents: "none",
|
|
3933
|
-
zIndex: "99999",
|
|
3934
|
-
margin: "0",
|
|
3935
|
-
willChange: "transform",
|
|
3936
|
-
boxShadow: "none"
|
|
3937
|
-
});
|
|
3938
|
-
el.offsetHeight;
|
|
3939
|
-
el.style.boxShadow = "5px 10px 30px 0px rgba(9, 30, 66, 0.15)";
|
|
3940
|
-
this._placeholder = placeholder;
|
|
3941
|
-
this._currentDroppableId = this._sourceDroppableId;
|
|
3942
|
-
this._currentIndex = this._sourceIndex;
|
|
3943
|
-
}
|
|
3944
|
-
_updateTarget(clientX, clientY) {
|
|
3945
|
-
let foundId = null;
|
|
3946
|
-
let foundEl = null;
|
|
3947
|
-
for (const [id, el] of this.droppables) {
|
|
3948
|
-
const r = el.getBoundingClientRect();
|
|
3949
|
-
if (clientX >= r.left && clientX <= r.right && clientY >= r.top && clientY <= r.bottom) {
|
|
3950
|
-
foundId = id;
|
|
3951
|
-
foundEl = el;
|
|
3952
|
-
break;
|
|
3953
|
-
}
|
|
3954
|
-
}
|
|
3955
|
-
if (!foundEl || foundId === null) {
|
|
3956
|
-
this._currentDroppableId = null;
|
|
3957
|
-
return;
|
|
3958
|
-
}
|
|
3959
|
-
const items = Array.from(foundEl.querySelectorAll(`:scope > ${DRAGGABLE_SEL}`));
|
|
3960
|
-
const threshold = clientY >= this._lastClientY ? 0 : 1;
|
|
3961
|
-
let insertIndex = items.length;
|
|
3962
|
-
for (let i = 0; i < items.length; i++) {
|
|
3963
|
-
const r = items[i].getBoundingClientRect();
|
|
3964
|
-
if (clientY < r.top + r.height * threshold) {
|
|
3965
|
-
insertIndex = i;
|
|
3966
|
-
break;
|
|
3967
|
-
}
|
|
3968
|
-
}
|
|
3969
|
-
this._currentDroppableId = foundId;
|
|
3970
|
-
this._currentIndex = insertIndex;
|
|
3971
|
-
if (!this._placeholder) return;
|
|
3972
|
-
const refNode = items[insertIndex] || null;
|
|
3973
|
-
if (this._placeholder.parentElement !== foundEl || this._placeholder.nextElementSibling !== refNode) {
|
|
3974
|
-
if (this._placeholder.parentElement) {
|
|
3975
|
-
const ghost = document.createElement("div");
|
|
3976
|
-
ghost.style.height = this._sourceHeight + "px";
|
|
3977
|
-
ghost.style.marginBottom = this._placeholder.style.marginBottom;
|
|
3978
|
-
ghost.style.transition = "height 0.2s cubic-bezier(0.2, 0, 0, 1)";
|
|
3979
|
-
ghost.style.overflow = "hidden";
|
|
3980
|
-
this._placeholder.parentElement.insertBefore(ghost, this._placeholder);
|
|
3981
|
-
ghost.offsetHeight;
|
|
3982
|
-
ghost.style.height = "0px";
|
|
3983
|
-
ghost.style.marginBottom = "0px";
|
|
3984
|
-
ghost.addEventListener("transitionend", () => ghost.remove(), { once: true });
|
|
3985
|
-
setTimeout(() => ghost.remove(), 250);
|
|
3986
|
-
}
|
|
3987
|
-
this._placeholder.style.transition = "none";
|
|
3988
|
-
this._placeholder.style.height = "0px";
|
|
3989
|
-
foundEl.insertBefore(this._placeholder, refNode);
|
|
3990
|
-
this._placeholder.offsetHeight;
|
|
3991
|
-
this._placeholder.style.transition = "height 0.2s cubic-bezier(0.2, 0, 0, 1)";
|
|
3992
|
-
this._placeholder.style.height = this._sourceHeight + "px";
|
|
3993
|
-
}
|
|
3994
|
-
}
|
|
3995
|
-
_onKeyDown(e) {
|
|
3996
|
-
if (e.key === "Escape" && this._dragging) this._cancelDrag();
|
|
3997
|
-
}
|
|
3998
|
-
_cancelDrag() {
|
|
3999
|
-
this._removeGlobalListeners();
|
|
4000
|
-
if (!this._started) {
|
|
4001
|
-
this._dragging = false;
|
|
4002
|
-
return;
|
|
4003
|
-
}
|
|
4004
|
-
this._animateReturn().then(() => {
|
|
4005
|
-
this._returnToSource();
|
|
4006
|
-
this._cleanup();
|
|
4007
|
-
});
|
|
4008
|
-
}
|
|
4009
|
-
_onPointerUp(_e) {
|
|
4010
|
-
this._removeGlobalListeners();
|
|
4011
|
-
if (!this._started) {
|
|
4012
|
-
this._dragging = false;
|
|
4013
|
-
return;
|
|
4014
|
-
}
|
|
4015
|
-
const destination = this._currentDroppableId !== null ? {
|
|
4016
|
-
droppableId: this._currentDroppableId,
|
|
4017
|
-
index: this._currentIndex
|
|
4018
|
-
} : null;
|
|
4019
|
-
const samePosition = destination && destination.droppableId === this._sourceDroppableId && destination.index === this._sourceIndex;
|
|
4020
|
-
if (destination && this._placeholder && !samePosition) {
|
|
4021
|
-
const result = {
|
|
4022
|
-
draggableId: this._draggedId,
|
|
4023
|
-
source: {
|
|
4024
|
-
droppableId: this._sourceDroppableId,
|
|
4025
|
-
index: this._sourceIndex
|
|
4026
|
-
},
|
|
4027
|
-
destination
|
|
4028
|
-
};
|
|
4029
|
-
this._animateDrop().then(() => {
|
|
4030
|
-
this._restoreElStyles();
|
|
4031
|
-
this._performTransfer(destination);
|
|
4032
|
-
this._cleanup();
|
|
4033
|
-
this._onDragEnd?.(result);
|
|
4034
|
-
});
|
|
4035
|
-
} else this._animateReturn().then(() => {
|
|
4036
|
-
this._returnToSource();
|
|
4037
|
-
this._cleanup();
|
|
4038
|
-
});
|
|
4039
|
-
}
|
|
4040
|
-
_getComponentFromElement(el) {
|
|
4041
|
-
let current = el;
|
|
4042
|
-
while (current) {
|
|
4043
|
-
if (current.__geaComponent) return current.__geaComponent;
|
|
4044
|
-
current = current.parentElement;
|
|
4045
|
-
}
|
|
4046
|
-
return null;
|
|
4047
|
-
}
|
|
4048
|
-
_restoreElStyles() {
|
|
4049
|
-
if (!this._sourceEl) return;
|
|
4050
|
-
this._sourceEl.style.cssText = this._savedCssText;
|
|
4051
|
-
}
|
|
4052
|
-
_returnToSource() {
|
|
4053
|
-
if (!this._sourceEl) return;
|
|
4054
|
-
this._restoreElStyles();
|
|
4055
|
-
if (this._placeholder?.parentElement) this._placeholder.parentElement.insertBefore(this._sourceEl, this._placeholder);
|
|
4056
|
-
else {
|
|
4057
|
-
const container = this.droppables.get(this._sourceDroppableId);
|
|
4058
|
-
if (container) {
|
|
4059
|
-
const items = Array.from(container.querySelectorAll(`:scope > ${DRAGGABLE_SEL}`));
|
|
4060
|
-
container.insertBefore(this._sourceEl, items[this._sourceIndex] || null);
|
|
4061
|
-
}
|
|
4062
|
-
}
|
|
4063
|
-
}
|
|
4064
|
-
_performTransfer(destination) {
|
|
4065
|
-
const sourceEl = this._sourceEl;
|
|
4066
|
-
if (!sourceEl) return;
|
|
4067
|
-
const destContainer = this.droppables.get(destination.droppableId);
|
|
4068
|
-
if (!destContainer) return;
|
|
4069
|
-
const refNode = Array.from(destContainer.querySelectorAll(`:scope > ${DRAGGABLE_SEL}`))[destination.index] || null;
|
|
4070
|
-
destContainer.insertBefore(sourceEl, refNode);
|
|
4071
|
-
const draggedComp = this._getComponentFromElement(sourceEl);
|
|
4072
|
-
if (!draggedComp) return;
|
|
4073
|
-
const sourceParent = draggedComp.parentComponent;
|
|
4074
|
-
if (!sourceParent) return;
|
|
4075
|
-
const srcArr = this._findCompiledArray(sourceParent, draggedComp);
|
|
4076
|
-
if (!srcArr) return;
|
|
4077
|
-
const destParent = this._getComponentFromElement(destContainer);
|
|
4078
|
-
if (!destParent) return;
|
|
4079
|
-
srcArr.arr.splice(srcArr.index, 1);
|
|
4080
|
-
const destArr = destParent[srcArr.key];
|
|
4081
|
-
if (Array.isArray(destArr)) destArr.splice(destination.index, 0, draggedComp);
|
|
4082
|
-
const srcChildren = sourceParent.__childComponents;
|
|
4083
|
-
if (Array.isArray(srcChildren)) {
|
|
4084
|
-
const ci = srcChildren.indexOf(draggedComp);
|
|
4085
|
-
if (ci !== -1) srcChildren.splice(ci, 1);
|
|
4086
|
-
}
|
|
4087
|
-
const destChildren = destParent.__childComponents;
|
|
4088
|
-
if (Array.isArray(destChildren) && !destChildren.includes(draggedComp)) destChildren.push(draggedComp);
|
|
4089
|
-
draggedComp.parentComponent = destParent;
|
|
4090
|
-
}
|
|
4091
|
-
_findCompiledArray(parent, child) {
|
|
4092
|
-
for (const key of Object.keys(parent)) if (key.startsWith("_") && key.endsWith("Items") && Array.isArray(parent[key])) {
|
|
4093
|
-
const idx = parent[key].indexOf(child);
|
|
4094
|
-
if (idx !== -1) return {
|
|
4095
|
-
key,
|
|
4096
|
-
arr: parent[key],
|
|
4097
|
-
index: idx
|
|
4098
|
-
};
|
|
4099
|
-
}
|
|
4100
|
-
return null;
|
|
4101
|
-
}
|
|
4102
|
-
_animateDrop() {
|
|
4103
|
-
return new Promise((resolve) => {
|
|
4104
|
-
if (!this._sourceEl || !this._placeholder) return resolve();
|
|
4105
|
-
const phRect = this._placeholder.getBoundingClientRect();
|
|
4106
|
-
this._sourceEl.style.transition = "transform 0.2s cubic-bezier(0.2, 0, 0, 1), rotate 0.2s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.2s cubic-bezier(0.2, 0, 0, 1)";
|
|
4107
|
-
this._sourceEl.style.transform = `translate(${phRect.left}px, ${phRect.top}px)`;
|
|
4108
|
-
this._sourceEl.style.rotate = "0deg";
|
|
4109
|
-
this._sourceEl.style.boxShadow = "none";
|
|
4110
|
-
let done = false;
|
|
4111
|
-
const finish = () => {
|
|
4112
|
-
if (done) return;
|
|
4113
|
-
done = true;
|
|
4114
|
-
resolve();
|
|
4115
|
-
};
|
|
4116
|
-
this._sourceEl.addEventListener("transitionend", finish, { once: true });
|
|
4117
|
-
setTimeout(finish, 250);
|
|
4118
|
-
});
|
|
4119
|
-
}
|
|
4120
|
-
_animateReturn() {
|
|
4121
|
-
return new Promise((resolve) => {
|
|
4122
|
-
if (!this._sourceEl || !this._sourceRect) return resolve();
|
|
4123
|
-
let targetX = this._sourceRect.left;
|
|
4124
|
-
let targetY = this._sourceRect.top;
|
|
4125
|
-
if (this._placeholder?.parentElement) {
|
|
4126
|
-
const phRect = this._placeholder.getBoundingClientRect();
|
|
4127
|
-
targetX = phRect.left;
|
|
4128
|
-
targetY = phRect.top;
|
|
4129
|
-
}
|
|
4130
|
-
this._sourceEl.style.transition = "transform 0.2s cubic-bezier(0.2, 0, 0, 1), rotate 0.2s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.2s cubic-bezier(0.2, 0, 0, 1)";
|
|
4131
|
-
this._sourceEl.style.transform = `translate(${targetX}px, ${targetY}px)`;
|
|
4132
|
-
this._sourceEl.style.rotate = "0deg";
|
|
4133
|
-
this._sourceEl.style.boxShadow = "none";
|
|
4134
|
-
let done = false;
|
|
4135
|
-
const finish = () => {
|
|
4136
|
-
if (done) return;
|
|
4137
|
-
done = true;
|
|
4138
|
-
resolve();
|
|
4139
|
-
};
|
|
4140
|
-
this._sourceEl.addEventListener("transitionend", finish, { once: true });
|
|
4141
|
-
setTimeout(finish, 250);
|
|
4142
|
-
});
|
|
4143
|
-
}
|
|
4144
|
-
_removeGlobalListeners() {
|
|
4145
|
-
document.removeEventListener("pointermove", this._boundMove);
|
|
4146
|
-
document.removeEventListener("pointerup", this._boundUp);
|
|
4147
|
-
document.removeEventListener("keydown", this._boundKeyDown);
|
|
4148
|
-
}
|
|
4149
|
-
_cleanup() {
|
|
4150
|
-
if (this._cleanedUp) return;
|
|
4151
|
-
this._cleanedUp = true;
|
|
4152
|
-
this._placeholder?.remove();
|
|
4153
|
-
this._placeholder = null;
|
|
4154
|
-
this._sourceEl = null;
|
|
4155
|
-
this._sourceRect = null;
|
|
4156
|
-
this._dragging = false;
|
|
4157
|
-
this._started = false;
|
|
4158
|
-
this._draggedId = "";
|
|
4159
|
-
this._currentDroppableId = null;
|
|
4160
|
-
}
|
|
4161
|
-
destroy() {
|
|
4162
|
-
this._removeGlobalListeners();
|
|
4163
|
-
if (this._dragging) {
|
|
4164
|
-
if (this._sourceEl) this._returnToSource();
|
|
4165
|
-
this._cleanup();
|
|
4166
|
-
}
|
|
4167
|
-
if (this._docListenerAttached && typeof document !== "undefined") {
|
|
4168
|
-
document.removeEventListener("pointerdown", this._boundDocDown, true);
|
|
4169
|
-
this._docListenerAttached = false;
|
|
4170
|
-
}
|
|
4171
|
-
this.droppables.clear();
|
|
4172
|
-
this.onDragEnd = null;
|
|
4173
|
-
}
|
|
4174
|
-
};
|
|
4175
|
-
const dndManager = new DndManager();
|
|
4176
|
-
//#endregion
|
|
4177
|
-
//#region src/components/draggable.tsx
|
|
4178
|
-
var Draggable = class extends Component {
|
|
4179
|
-
constructor(..._args) {
|
|
4180
|
-
super(..._args);
|
|
4181
|
-
this._didDrag = false;
|
|
4182
|
-
}
|
|
4183
|
-
_onPointerDown(e) {
|
|
4184
|
-
const el = e.currentTarget.closest(".gea-draggable");
|
|
4185
|
-
if (!el) return;
|
|
4186
|
-
this._didDrag = false;
|
|
4187
|
-
dndManager.startTracking(e, this.props.draggableId, el);
|
|
4188
|
-
}
|
|
4189
|
-
template(props) {
|
|
4190
|
-
Component._register(Component);
|
|
4191
|
-
return `<div id="${this.id}" class="${`gea-draggable ${props.class || ""}`.trim()}"${props.draggableId == null || props.draggableId === false ? "" : ` data-draggable-id="${props.draggableId}"`}${props.index == null || props.index === false ? "" : ` data-index="${props.index}"`}${` pointerdown="${(e) => this._onPointerDown(e)}"`}>${props.children}</div>`;
|
|
4192
|
-
}
|
|
4193
|
-
get events() {
|
|
4194
|
-
return { click: { [`#${this.id}`]: this.__event_click_0 } };
|
|
4195
|
-
}
|
|
4196
|
-
__event_click_0(e, targetComponent) {
|
|
4197
|
-
if (dndManager.isDragging) {
|
|
4198
|
-
e.preventDefault();
|
|
4199
|
-
e.stopPropagation();
|
|
4200
|
-
}
|
|
4201
|
-
}
|
|
4202
|
-
__onPropChange(key, value) {
|
|
4203
|
-
if (key === "class") try {
|
|
4204
|
-
const __el = this.$(":scope");
|
|
4205
|
-
this.props;
|
|
4206
|
-
const __boundValue = `gea-draggable ${this.props.class || ""}`;
|
|
4207
|
-
if (__el) {
|
|
4208
|
-
const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
|
|
4209
|
-
if (__el.className !== __newClass) __el.className = __newClass;
|
|
4210
|
-
}
|
|
4211
|
-
} catch {}
|
|
4212
|
-
if (key === "draggableId") try {
|
|
4213
|
-
const __el = this.$(":scope");
|
|
4214
|
-
if (__el) if (value === null || value === void 0) __el.removeAttribute("data-draggable-id");
|
|
4215
|
-
else __el.setAttribute("data-draggable-id", String(value));
|
|
4216
|
-
} catch {}
|
|
4217
|
-
if (key === "index") try {
|
|
4218
|
-
const __el = this.$(":scope");
|
|
4219
|
-
if (__el) if (value === null || value === void 0) __el.removeAttribute("data-index");
|
|
4220
|
-
else __el.setAttribute("data-index", String(value));
|
|
4221
|
-
} catch {}
|
|
4222
|
-
if (key === "children") try {
|
|
4223
|
-
const __el = this.$(":scope");
|
|
4224
|
-
if (__el) {
|
|
4225
|
-
if (__el.innerHTML !== value) {
|
|
4226
|
-
__el.innerHTML = value;
|
|
4227
|
-
this.instantiateChildComponents_();
|
|
4228
|
-
if (this.parentComponent) this.parentComponent.mountCompiledChildComponents_();
|
|
4229
|
-
}
|
|
4230
|
-
}
|
|
4231
|
-
} catch {}
|
|
4232
|
-
}
|
|
4233
|
-
};
|
|
4234
|
-
//#endregion
|
|
4235
|
-
//#region src/components/droppable.tsx
|
|
4236
|
-
var Droppable = class extends Component {
|
|
4237
|
-
constructor(..._args) {
|
|
4238
|
-
super(..._args);
|
|
4239
|
-
this._registered = false;
|
|
4240
|
-
}
|
|
4241
|
-
_registerWithManager() {
|
|
4242
|
-
const el = this.el?.querySelector("[data-droppable-id]");
|
|
4243
|
-
if (el && !this._registered) {
|
|
4244
|
-
dndManager.registerDroppable(this.props.droppableId, el);
|
|
4245
|
-
this._registered = true;
|
|
4246
|
-
}
|
|
4247
|
-
}
|
|
4248
|
-
created() {
|
|
4249
|
-
queueMicrotask(() => this._registerWithManager());
|
|
4250
|
-
}
|
|
4251
|
-
onAfterRender() {
|
|
4252
|
-
this._registerWithManager();
|
|
4253
|
-
}
|
|
4254
|
-
dispose() {
|
|
4255
|
-
if (this._registered) {
|
|
4256
|
-
dndManager.unregisterDroppable(this.props.droppableId);
|
|
4257
|
-
this._registered = false;
|
|
4258
|
-
}
|
|
4259
|
-
super.dispose();
|
|
4260
|
-
}
|
|
4261
|
-
template(props) {
|
|
4262
|
-
Component._register(Component);
|
|
4263
|
-
return `<div id="${this.id}" class="${`gea-droppable ${props.class || ""}`.trim()}"${props.droppableId == null || props.droppableId === false ? "" : ` data-droppable-id="${props.droppableId}"`}>${props.children}</div>`;
|
|
4264
|
-
}
|
|
4265
|
-
__onPropChange(key, value) {
|
|
4266
|
-
if (key === "class") try {
|
|
4267
|
-
const __el = this.$(":scope");
|
|
4268
|
-
this.props;
|
|
4269
|
-
const __boundValue = `gea-droppable ${this.props.class || ""}`;
|
|
4270
|
-
if (__el) {
|
|
4271
|
-
const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
|
|
4272
|
-
if (__el.className !== __newClass) __el.className = __newClass;
|
|
4273
|
-
}
|
|
4274
|
-
} catch {}
|
|
4275
|
-
if (key === "droppableId") try {
|
|
4276
|
-
const __el = this.$(":scope");
|
|
4277
|
-
if (__el) if (value === null || value === void 0) __el.removeAttribute("data-droppable-id");
|
|
4278
|
-
else __el.setAttribute("data-droppable-id", String(value));
|
|
4279
|
-
} catch {}
|
|
4280
|
-
if (key === "children") try {
|
|
4281
|
-
const __el = this.$(":scope");
|
|
4282
|
-
if (__el) {
|
|
4283
|
-
if (__el.innerHTML !== value) {
|
|
4284
|
-
__el.innerHTML = value;
|
|
4285
|
-
this.instantiateChildComponents_();
|
|
4286
|
-
if (this.parentComponent) this.parentComponent.mountCompiledChildComponents_();
|
|
4287
|
-
}
|
|
4288
|
-
}
|
|
4289
|
-
} catch {}
|
|
4290
|
-
}
|
|
4291
|
-
};
|
|
4292
|
-
//#endregion
|
|
4293
|
-
//#region src/components/drag-drop-context.tsx
|
|
4294
|
-
var DragDropContext = class extends Component {
|
|
4295
|
-
created() {
|
|
4296
|
-
dndManager.onDragEnd = (result) => {
|
|
4297
|
-
this.props.onDragEnd?.(result);
|
|
4298
|
-
};
|
|
4299
|
-
}
|
|
4300
|
-
dispose() {
|
|
4301
|
-
dndManager.destroy();
|
|
4302
|
-
super.dispose();
|
|
4303
|
-
}
|
|
4304
|
-
template(props) {
|
|
4305
|
-
Component._register(Component);
|
|
4306
|
-
return `<div id="${this.id}" class="${`gea-dnd-context ${props.class || ""}`.trim()}">${props.children}</div>`;
|
|
4307
|
-
}
|
|
4308
|
-
__onPropChange(key, value) {
|
|
4309
|
-
if (key === "class") try {
|
|
4310
|
-
const __el = this.$(":scope");
|
|
4311
|
-
this.props;
|
|
4312
|
-
const __boundValue = `gea-dnd-context ${this.props.class || ""}`;
|
|
4313
|
-
if (__el) {
|
|
4314
|
-
const __newClass = __boundValue != null ? String(__boundValue).trim() : "";
|
|
4315
|
-
if (__el.className !== __newClass) __el.className = __newClass;
|
|
4316
|
-
}
|
|
4317
|
-
} catch {}
|
|
4318
|
-
if (key === "children") try {
|
|
4319
|
-
const __el = this.$(":scope");
|
|
4320
|
-
if (__el) {
|
|
4321
|
-
if (__el.innerHTML !== value) {
|
|
4322
|
-
__el.innerHTML = value;
|
|
4323
|
-
this.instantiateChildComponents_();
|
|
4324
|
-
if (this.parentComponent) this.parentComponent.mountCompiledChildComponents_();
|
|
4325
|
-
}
|
|
4326
|
-
}
|
|
4327
|
-
} catch {}
|
|
4328
|
-
}
|
|
4329
|
-
};
|
|
4330
|
-
//#endregion
|
|
1
|
+
import { t as ZagComponent } from "./zag-component.mjs";
|
|
2
|
+
import { t as cn } from "./cn.mjs";
|
|
3
|
+
import Accordion from "./accordion.mjs";
|
|
4
|
+
import Avatar from "./avatar.mjs";
|
|
5
|
+
import Checkbox from "./checkbox.mjs";
|
|
6
|
+
import Clipboard from "./clipboard.mjs";
|
|
7
|
+
import Collapsible from "./collapsible.mjs";
|
|
8
|
+
import Combobox from "./combobox.mjs";
|
|
9
|
+
import Dialog from "./dialog.mjs";
|
|
10
|
+
import FileUpload from "./file-upload.mjs";
|
|
11
|
+
import HoverCard from "./hover-card.mjs";
|
|
12
|
+
import Menu from "./menu.mjs";
|
|
13
|
+
import NumberInput from "./number-input.mjs";
|
|
14
|
+
import Pagination from "./pagination.mjs";
|
|
15
|
+
import PinInput from "./pin-input.mjs";
|
|
16
|
+
import Popover from "./popover.mjs";
|
|
17
|
+
import Progress from "./progress.mjs";
|
|
18
|
+
import RadioGroup from "./radio-group.mjs";
|
|
19
|
+
import RatingGroup from "./rating-group.mjs";
|
|
20
|
+
import Select from "./select.mjs";
|
|
21
|
+
import Slider from "./slider.mjs";
|
|
22
|
+
import Switch from "./switch.mjs";
|
|
23
|
+
import Tabs from "./tabs.mjs";
|
|
24
|
+
import TagsInput from "./tags-input.mjs";
|
|
25
|
+
import { ToastStore, Toaster } from "./toast.mjs";
|
|
26
|
+
import ToggleGroup from "./toggle-group.mjs";
|
|
27
|
+
import Tooltip from "./tooltip.mjs";
|
|
28
|
+
import TreeView from "./tree-view.mjs";
|
|
29
|
+
import Button from "./button.mjs";
|
|
30
|
+
import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "./card.mjs";
|
|
31
|
+
import Input from "./input.mjs";
|
|
32
|
+
import Textarea from "./textarea.mjs";
|
|
33
|
+
import Label from "./label.mjs";
|
|
34
|
+
import Badge from "./badge.mjs";
|
|
35
|
+
import { Alert, AlertDescription, AlertTitle } from "./alert.mjs";
|
|
36
|
+
import Separator from "./separator.mjs";
|
|
37
|
+
import Skeleton from "./skeleton.mjs";
|
|
38
|
+
import { dndManager } from "./dnd-manager.mjs";
|
|
39
|
+
import Draggable from "./draggable.mjs";
|
|
40
|
+
import Droppable from "./droppable.mjs";
|
|
41
|
+
import DragDropContext from "./drag-drop-context.mjs";
|
|
4331
42
|
export { Accordion, Alert, AlertDescription, AlertTitle, Avatar, Badge, Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Clipboard, Collapsible, Combobox, Dialog, DragDropContext, Draggable, Droppable, FileUpload, HoverCard, Input, Label, Menu, NumberInput, Pagination, PinInput, Popover, Progress, RadioGroup, RatingGroup, Select, Separator, Skeleton, Slider, Switch, Tabs, TagsInput, Textarea, ToastStore, Toaster, ToggleGroup, Tooltip, TreeView, ZagComponent, cn, dndManager };
|
|
4332
|
-
|
|
4333
|
-
//# sourceMappingURL=index.mjs.map
|