@geajs/ui 0.1.1 → 0.1.3
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/dist/index.d.mts +295 -27
- package/dist/index.mjs +1017 -281
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -8
package/dist/index.mjs
CHANGED
|
@@ -46,9 +46,15 @@ var ZagComponent = class extends Component {
|
|
|
46
46
|
created(props) {
|
|
47
47
|
if (!this._spreadCleanups) this._spreadCleanups = /* @__PURE__ */ new Map();
|
|
48
48
|
if (this._spreadScheduled === void 0) this._spreadScheduled = false;
|
|
49
|
+
if (!this._zagIdMap) this._zagIdMap = /* @__PURE__ */ new Map();
|
|
49
50
|
const machineDef = this.createMachine(props);
|
|
50
51
|
if (!machineDef) return;
|
|
51
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
|
+
};
|
|
52
58
|
this._machine.start();
|
|
53
59
|
this._api = this.connectApi(this._machine.service);
|
|
54
60
|
this.syncState(this._api);
|
|
@@ -101,11 +107,20 @@ var ZagComponent = class extends Component {
|
|
|
101
107
|
const key = selector + ":" + i;
|
|
102
108
|
const nextProps = this._resolveProps(getter, el);
|
|
103
109
|
if (!nextProps) continue;
|
|
110
|
+
const bindingId = el.id;
|
|
104
111
|
const cleanup = spreadProps(el, nextProps);
|
|
112
|
+
if (bindingId && el.id !== bindingId) {
|
|
113
|
+
this._zagIdMap.set(el.id, el);
|
|
114
|
+
el.id = bindingId;
|
|
115
|
+
}
|
|
105
116
|
this._spreadCleanups.set(key, cleanup);
|
|
106
117
|
}
|
|
107
118
|
}
|
|
108
119
|
}
|
|
120
|
+
__geaSyncMap(idx) {
|
|
121
|
+
super.__geaSyncMap(idx);
|
|
122
|
+
this._scheduleSpreadApplication();
|
|
123
|
+
}
|
|
109
124
|
onAfterRender() {
|
|
110
125
|
this._cacheArrayContainers();
|
|
111
126
|
this._applyAllSpreads();
|
|
@@ -127,6 +142,7 @@ var ZagComponent = class extends Component {
|
|
|
127
142
|
this._machine = null;
|
|
128
143
|
}
|
|
129
144
|
this._api = null;
|
|
145
|
+
this._zagIdMap?.clear();
|
|
130
146
|
super.dispose();
|
|
131
147
|
}
|
|
132
148
|
static {
|
|
@@ -186,25 +202,30 @@ var Accordion = class extends ZagComponent {
|
|
|
186
202
|
this.value = api.value;
|
|
187
203
|
}
|
|
188
204
|
template(props) {
|
|
205
|
+
Component._register(ZagComponent);
|
|
189
206
|
const items = props.items || [];
|
|
190
|
-
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="${
|
|
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>`;
|
|
191
208
|
}
|
|
192
209
|
render__unresolved_0Item(item) {
|
|
193
210
|
const __v = (v) => v != null && typeof v === "object" ? v.valueOf() : v;
|
|
194
|
-
return `<div data-gea-item-id="${
|
|
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>`;
|
|
195
212
|
}
|
|
196
213
|
create__unresolved_0Item(item) {
|
|
197
214
|
var __c = this.____unresolved_0_container;
|
|
198
215
|
if (!__c.__geaTpl) try {
|
|
199
|
-
var __tw =
|
|
200
|
-
__tw.innerHTML = this.render__unresolved_0Item(
|
|
201
|
-
|
|
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;
|
|
202
223
|
} catch {}
|
|
203
224
|
if (__c.__geaTpl) var el = __c.__geaTpl.cloneNode(true);
|
|
204
225
|
else {
|
|
205
|
-
var __fw =
|
|
226
|
+
var __fw = document.createElement("template");
|
|
206
227
|
__fw.innerHTML = this.render__unresolved_0Item(item);
|
|
207
|
-
var el = __fw.firstElementChild;
|
|
228
|
+
var el = __fw.content.firstElementChild;
|
|
208
229
|
}
|
|
209
230
|
var __av = item.value;
|
|
210
231
|
if (__av == null || __av === false) el.removeAttribute("data-value");
|
|
@@ -219,7 +240,7 @@ var Accordion = class extends ZagComponent {
|
|
|
219
240
|
if (__av == null || __av === false) el.firstElementChild.nextElementSibling.removeAttribute("data-value");
|
|
220
241
|
else el.firstElementChild.nextElementSibling.setAttribute("data-value", String(__av));
|
|
221
242
|
el.firstElementChild.nextElementSibling.firstElementChild.textContent = `${item.content}`;
|
|
222
|
-
el.setAttribute("data-gea-item-id",
|
|
243
|
+
el.setAttribute("data-gea-item-id", item.value);
|
|
223
244
|
el.__geaItem = item;
|
|
224
245
|
return el;
|
|
225
246
|
}
|
|
@@ -246,11 +267,7 @@ var Accordion = class extends ZagComponent {
|
|
|
246
267
|
if (typeof this.__ensureArrayConfigs === "function") this.__ensureArrayConfigs();
|
|
247
268
|
this.__geaRegisterMap(0, "____unresolved_0_container", () => this.$(":scope"), () => {
|
|
248
269
|
return this.props.items || [];
|
|
249
|
-
}, (__item) => this.create__unresolved_0Item(__item));
|
|
250
|
-
}
|
|
251
|
-
dispose() {
|
|
252
|
-
if (this.__observer_removers__) this.__observer_removers__.forEach((fn) => fn());
|
|
253
|
-
super.dispose();
|
|
270
|
+
}, (__item) => this.create__unresolved_0Item(__item), "value");
|
|
254
271
|
}
|
|
255
272
|
};
|
|
256
273
|
//#endregion
|
|
@@ -259,14 +276,16 @@ var Avatar = class extends ZagComponent {
|
|
|
259
276
|
constructor(...args) {
|
|
260
277
|
super(...args);
|
|
261
278
|
this.loaded = false;
|
|
262
|
-
|
|
263
|
-
|
|
279
|
+
try {
|
|
280
|
+
this.props;
|
|
281
|
+
this.__geaCond_0 = !!this.props.src;
|
|
282
|
+
} catch {}
|
|
264
283
|
this.__geaRegisterCond(0, "c0", () => {
|
|
265
284
|
this.props;
|
|
266
285
|
return this.props.src;
|
|
267
286
|
}, () => {
|
|
268
287
|
const props = this.props;
|
|
269
|
-
return `<img data-part="image"${this.props.src == null ? "" : ` 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" />`;
|
|
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" />`;
|
|
270
289
|
}, () => {
|
|
271
290
|
this.props;
|
|
272
291
|
return "";
|
|
@@ -295,8 +314,9 @@ var Avatar = class extends ZagComponent {
|
|
|
295
314
|
this.loaded = api.loaded;
|
|
296
315
|
}
|
|
297
316
|
template(props) {
|
|
317
|
+
Component._register(ZagComponent);
|
|
298
318
|
const initials = props.fallback || (props.name ? props.name.split(" ").map((n) => n[0]).join("").toUpperCase() : "?");
|
|
299
|
-
return `<div id="${this.id}" data-part="root"
|
|
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>`;
|
|
300
320
|
}
|
|
301
321
|
__onPropChange(key, value) {
|
|
302
322
|
if (key === "class") try {
|
|
@@ -308,18 +328,15 @@ var Avatar = class extends ZagComponent {
|
|
|
308
328
|
if (__el.className !== __newClass) __el.className = __newClass;
|
|
309
329
|
}
|
|
310
330
|
} catch {}
|
|
311
|
-
if (key === "src") {
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
} catch {}
|
|
321
|
-
this.__geaPatchCond(0);
|
|
322
|
-
}
|
|
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 {}
|
|
323
340
|
if (key === "fallback") try {
|
|
324
341
|
const __el = document.getElementById(this.id + "-b1");
|
|
325
342
|
this.props;
|
|
@@ -336,6 +353,7 @@ var Avatar = class extends ZagComponent {
|
|
|
336
353
|
if (__el.textContent !== __boundValue) __el.textContent = __boundValue;
|
|
337
354
|
}
|
|
338
355
|
} catch {}
|
|
356
|
+
if (key === "src" || key === "name") this.__geaPatchCond(0);
|
|
339
357
|
}
|
|
340
358
|
};
|
|
341
359
|
//#endregion
|
|
@@ -344,8 +362,10 @@ var Checkbox = class extends ZagComponent {
|
|
|
344
362
|
constructor(...args) {
|
|
345
363
|
super(...args);
|
|
346
364
|
this.checked = false;
|
|
347
|
-
|
|
348
|
-
|
|
365
|
+
try {
|
|
366
|
+
this.props;
|
|
367
|
+
this.__geaCond_0 = !!this.props.label;
|
|
368
|
+
} catch {}
|
|
349
369
|
this.__geaRegisterCond(0, "c0", () => {
|
|
350
370
|
this.props;
|
|
351
371
|
return this.props.label;
|
|
@@ -391,7 +411,8 @@ var Checkbox = class extends ZagComponent {
|
|
|
391
411
|
this.checked = api.checkedState;
|
|
392
412
|
}
|
|
393
413
|
template(props) {
|
|
394
|
-
|
|
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>`;
|
|
395
416
|
}
|
|
396
417
|
__onPropChange(key, value) {
|
|
397
418
|
if (key === "class") try {
|
|
@@ -412,17 +433,12 @@ var Clipboard = class extends ZagComponent {
|
|
|
412
433
|
constructor(...args) {
|
|
413
434
|
super(...args);
|
|
414
435
|
this.copied = false;
|
|
415
|
-
|
|
416
|
-
this.__geaCond_0 = !!this.props.label;
|
|
417
|
-
this.__geaCond_1 = !!this.copied;
|
|
418
|
-
this.__geaRegisterCond(0, "c0", () => {
|
|
419
|
-
this.props;
|
|
420
|
-
return this.props.label;
|
|
421
|
-
}, () => {
|
|
436
|
+
try {
|
|
422
437
|
this.props;
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
438
|
+
this.__geaCond_0 = !!this.copied;
|
|
439
|
+
this.__geaCond_1 = !!this.props.label;
|
|
440
|
+
} catch {}
|
|
441
|
+
this.__geaRegisterCond(0, "c0", () => {
|
|
426
442
|
this.props;
|
|
427
443
|
return this.copied;
|
|
428
444
|
}, () => {
|
|
@@ -432,6 +448,13 @@ var Clipboard = class extends ZagComponent {
|
|
|
432
448
|
this.props;
|
|
433
449
|
return `<span data-part="indicator-not-copied">Copy</span>`;
|
|
434
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);
|
|
435
458
|
}
|
|
436
459
|
createMachine(_props) {
|
|
437
460
|
return clipboard.machine;
|
|
@@ -466,7 +489,8 @@ var Clipboard = class extends ZagComponent {
|
|
|
466
489
|
this.copied = api.copied;
|
|
467
490
|
}
|
|
468
491
|
template(props) {
|
|
469
|
-
|
|
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>`;
|
|
470
494
|
}
|
|
471
495
|
__onPropChange(key, value) {
|
|
472
496
|
if (key === "class") try {
|
|
@@ -478,23 +502,23 @@ var Clipboard = class extends ZagComponent {
|
|
|
478
502
|
if (__el.className !== __newClass) __el.className = __newClass;
|
|
479
503
|
}
|
|
480
504
|
} catch {}
|
|
481
|
-
|
|
482
|
-
this.__geaPatchCond(1);
|
|
505
|
+
this.__geaPatchCond(0);
|
|
506
|
+
if (key === "label") this.__geaPatchCond(1);
|
|
483
507
|
}
|
|
484
508
|
__observe_local_copied(value, change) {
|
|
485
509
|
if (this.rendered_) {
|
|
486
|
-
this.
|
|
487
|
-
if (this.
|
|
510
|
+
this.__geaCondPatched_0 = this.__geaPatchCond(0);
|
|
511
|
+
if (this.__geaCondPatched_0) return;
|
|
488
512
|
}
|
|
489
513
|
}
|
|
490
514
|
__setupLocalStateObservers() {
|
|
491
515
|
if (typeof this.__ensureArrayConfigs === "function") this.__ensureArrayConfigs();
|
|
492
516
|
if (!this.__store) return;
|
|
493
|
-
this.__observer_removers__.push(this.__store.observe(["copied"], (__v, __c) =>
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
517
|
+
this.__observer_removers__.push(this.__store.observe(["copied"], (__v, __c) => {
|
|
518
|
+
try {
|
|
519
|
+
this.__observe_local_copied(__v, __c);
|
|
520
|
+
} catch (_e) {}
|
|
521
|
+
}));
|
|
498
522
|
}
|
|
499
523
|
};
|
|
500
524
|
//#endregion
|
|
@@ -529,6 +553,7 @@ var Collapsible = class extends ZagComponent {
|
|
|
529
553
|
this.open = api.open;
|
|
530
554
|
}
|
|
531
555
|
template(props) {
|
|
556
|
+
Component._register(ZagComponent);
|
|
532
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>`;
|
|
533
558
|
}
|
|
534
559
|
__onPropChange(key, value) {
|
|
@@ -552,7 +577,11 @@ var Collapsible = class extends ZagComponent {
|
|
|
552
577
|
if (key === "children") try {
|
|
553
578
|
const __el = document.getElementById(this.id + "-b2");
|
|
554
579
|
if (__el) {
|
|
555
|
-
if (__el.
|
|
580
|
+
if (__el.innerHTML !== value) {
|
|
581
|
+
__el.innerHTML = value;
|
|
582
|
+
this.instantiateChildComponents_();
|
|
583
|
+
if (this.parentComponent) this.parentComponent.mountCompiledChildComponents_();
|
|
584
|
+
}
|
|
556
585
|
}
|
|
557
586
|
} catch {}
|
|
558
587
|
}
|
|
@@ -562,8 +591,10 @@ var Collapsible = class extends ZagComponent {
|
|
|
562
591
|
var Combobox = class extends ZagComponent {
|
|
563
592
|
constructor(...args) {
|
|
564
593
|
super(...args);
|
|
565
|
-
|
|
566
|
-
|
|
594
|
+
try {
|
|
595
|
+
this.props;
|
|
596
|
+
this.__geaCond_0 = !!this.props.label;
|
|
597
|
+
} catch {}
|
|
567
598
|
this.__geaRegisterCond(0, "c0", () => {
|
|
568
599
|
this.props;
|
|
569
600
|
return this.props.label;
|
|
@@ -680,6 +711,7 @@ var Combobox = class extends ZagComponent {
|
|
|
680
711
|
this.inputValue = api.inputValue;
|
|
681
712
|
}
|
|
682
713
|
template(props) {
|
|
714
|
+
Component._register(ZagComponent);
|
|
683
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>`;
|
|
684
716
|
}
|
|
685
717
|
__onPropChange(key, value) {
|
|
@@ -696,25 +728,24 @@ var Combobox = class extends ZagComponent {
|
|
|
696
728
|
}
|
|
697
729
|
renderFilteredItemsItem(item) {
|
|
698
730
|
const __v = (v) => v != null && typeof v === "object" ? v.valueOf() : v;
|
|
699
|
-
return `<div id="${this.id + "-b1-" + String(item.
|
|
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>`;
|
|
700
732
|
}
|
|
701
733
|
createFilteredItemsItem(item) {
|
|
702
734
|
var __c = this.__filteredItems_container;
|
|
703
735
|
if (!__c.__geaTpl) try {
|
|
704
|
-
var __tw =
|
|
736
|
+
var __tw = document.createElement("template");
|
|
705
737
|
__tw.innerHTML = this.renderFilteredItemsItem({
|
|
706
|
-
|
|
707
|
-
value: "",
|
|
738
|
+
value: 0,
|
|
708
739
|
label: ""
|
|
709
740
|
});
|
|
710
|
-
__c.__geaTpl = __tw.firstElementChild;
|
|
741
|
+
__c.__geaTpl = __tw.content.firstElementChild;
|
|
711
742
|
} catch {}
|
|
712
743
|
if (!__c.__geaIdPfx) __c.__geaIdPfx = this.id_ + "-b1-";
|
|
713
744
|
if (__c.__geaTpl) var el = __c.__geaTpl.cloneNode(true);
|
|
714
745
|
else {
|
|
715
|
-
var __fw =
|
|
746
|
+
var __fw = document.createElement("template");
|
|
716
747
|
__fw.innerHTML = this.renderFilteredItemsItem(item);
|
|
717
|
-
var el = __fw.firstElementChild;
|
|
748
|
+
var el = __fw.content.firstElementChild;
|
|
718
749
|
}
|
|
719
750
|
var __av = item.value;
|
|
720
751
|
if (__av == null || __av === false) el.removeAttribute("data-value");
|
|
@@ -737,8 +768,8 @@ var Combobox = class extends ZagComponent {
|
|
|
737
768
|
var __av = item.label;
|
|
738
769
|
if (__av == null || __av === false) el.firstElementChild.nextElementSibling.removeAttribute("data-label");
|
|
739
770
|
else el.firstElementChild.nextElementSibling.setAttribute("data-label", String(__av));
|
|
740
|
-
el.setAttribute("data-gea-item-id", item.
|
|
741
|
-
el.id = __c.__geaIdPfx + item.
|
|
771
|
+
el.setAttribute("data-gea-item-id", item.value);
|
|
772
|
+
el.id = __c.__geaIdPfx + item.value;
|
|
742
773
|
el.__geaItem = item;
|
|
743
774
|
return el;
|
|
744
775
|
}
|
|
@@ -782,6 +813,7 @@ var Combobox = class extends ZagComponent {
|
|
|
782
813
|
},
|
|
783
814
|
(row, value) => row.classList.toggle("value", value),
|
|
784
815
|
(row, value) => row.classList.toggle("value", value),
|
|
816
|
+
(row, value) => row.classList.toggle("value", value),
|
|
785
817
|
(row, value) => row.classList.toggle("value", value)
|
|
786
818
|
],
|
|
787
819
|
"label": [
|
|
@@ -825,11 +857,11 @@ var Combobox = class extends ZagComponent {
|
|
|
825
857
|
__setupLocalStateObservers() {
|
|
826
858
|
if (typeof this.__ensureArrayConfigs === "function") this.__ensureArrayConfigs();
|
|
827
859
|
if (!this.__store) return;
|
|
828
|
-
this.__observer_removers__.push(this.__store.observe(["filteredItems"], (__v, __c) =>
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
860
|
+
this.__observer_removers__.push(this.__store.observe(["filteredItems"], (__v, __c) => {
|
|
861
|
+
try {
|
|
862
|
+
this.__observe_local_filteredItems(__v, __c);
|
|
863
|
+
} catch (_e) {}
|
|
864
|
+
}));
|
|
833
865
|
}
|
|
834
866
|
};
|
|
835
867
|
//#endregion
|
|
@@ -837,9 +869,12 @@ var Combobox = class extends ZagComponent {
|
|
|
837
869
|
var Dialog = class extends ZagComponent {
|
|
838
870
|
constructor(...args) {
|
|
839
871
|
super(...args);
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
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 {}
|
|
843
878
|
this.__geaRegisterCond(0, "c0", () => {
|
|
844
879
|
this.props;
|
|
845
880
|
return this.props.title;
|
|
@@ -854,6 +889,13 @@ var Dialog = class extends ZagComponent {
|
|
|
854
889
|
this.props;
|
|
855
890
|
return `<p data-part="description" class="dialog-description text-sm text-gray-500 mb-4">${this.props.description}</p>`;
|
|
856
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);
|
|
857
899
|
}
|
|
858
900
|
createMachine(_props) {
|
|
859
901
|
return dialog.machine;
|
|
@@ -922,7 +964,8 @@ var Dialog = class extends ZagComponent {
|
|
|
922
964
|
this.open = api.open;
|
|
923
965
|
}
|
|
924
966
|
template(props) {
|
|
925
|
-
|
|
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>`;
|
|
926
969
|
}
|
|
927
970
|
__onPropChange(key, value) {
|
|
928
971
|
if (key === "class") try {
|
|
@@ -934,22 +977,19 @@ var Dialog = class extends ZagComponent {
|
|
|
934
977
|
if (__el.className !== __newClass) __el.className = __newClass;
|
|
935
978
|
}
|
|
936
979
|
} catch {}
|
|
937
|
-
if (key === "triggerLabel") try {
|
|
938
|
-
const __el = document.getElementById(this.id + "-b1");
|
|
939
|
-
this.props;
|
|
940
|
-
const __boundValue = this.props.triggerLabel || "Open";
|
|
941
|
-
if (__el) {
|
|
942
|
-
if (__el.textContent !== __boundValue) __el.textContent = __boundValue;
|
|
943
|
-
}
|
|
944
|
-
} catch {}
|
|
945
980
|
if (key === "children") try {
|
|
946
|
-
const __el = document.getElementById(this.id + "-
|
|
981
|
+
const __el = document.getElementById(this.id + "-b1");
|
|
947
982
|
if (__el) {
|
|
948
|
-
if (__el.
|
|
983
|
+
if (__el.innerHTML !== value) {
|
|
984
|
+
__el.innerHTML = value;
|
|
985
|
+
this.instantiateChildComponents_();
|
|
986
|
+
if (this.parentComponent) this.parentComponent.mountCompiledChildComponents_();
|
|
987
|
+
}
|
|
949
988
|
}
|
|
950
989
|
} catch {}
|
|
951
990
|
if (key === "title") this.__geaPatchCond(0);
|
|
952
991
|
if (key === "description") this.__geaPatchCond(1);
|
|
992
|
+
if (key === "triggerLabel") this.__geaPatchCond(2);
|
|
953
993
|
}
|
|
954
994
|
};
|
|
955
995
|
//#endregion
|
|
@@ -957,9 +997,11 @@ var Dialog = class extends ZagComponent {
|
|
|
957
997
|
var FileUpload = class extends ZagComponent {
|
|
958
998
|
constructor(...args) {
|
|
959
999
|
super(...args);
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
1000
|
+
try {
|
|
1001
|
+
this.props;
|
|
1002
|
+
this.__geaCond_0 = !!this.props.label;
|
|
1003
|
+
this.__geaCond_1 = !!(this.acceptedFiles.length > 0);
|
|
1004
|
+
} catch {}
|
|
963
1005
|
this.__geaRegisterCond(0, "c0", () => {
|
|
964
1006
|
this.props;
|
|
965
1007
|
return this.props.label;
|
|
@@ -1014,6 +1056,7 @@ var FileUpload = class extends ZagComponent {
|
|
|
1014
1056
|
this.rejectedFiles = api.rejectedFiles;
|
|
1015
1057
|
}
|
|
1016
1058
|
template(props) {
|
|
1059
|
+
Component._register(ZagComponent);
|
|
1017
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>`;
|
|
1018
1061
|
}
|
|
1019
1062
|
__onPropChange(key, value) {
|
|
@@ -1043,27 +1086,36 @@ var FileUpload = class extends ZagComponent {
|
|
|
1043
1086
|
if (typeof this.__ensureArrayConfigs === "function") this.__ensureArrayConfigs();
|
|
1044
1087
|
this.__applyListChanges(this.__acceptedFiles_container, value, change, this.__acceptedFilesListConfig);
|
|
1045
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
|
+
}
|
|
1046
1101
|
renderAcceptedFilesItem(file) {
|
|
1047
|
-
return `<div data-gea-item-id="${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>`;
|
|
1048
1103
|
}
|
|
1049
1104
|
createAcceptedFilesItem(item) {
|
|
1050
1105
|
var __c = this.__acceptedFiles_container;
|
|
1051
1106
|
if (!__c.__geaTpl) try {
|
|
1052
|
-
var __tw =
|
|
1053
|
-
__tw.innerHTML = this.renderAcceptedFilesItem({
|
|
1054
|
-
|
|
1055
|
-
name: ""
|
|
1056
|
-
});
|
|
1057
|
-
__c.__geaTpl = __tw.firstElementChild;
|
|
1107
|
+
var __tw = document.createElement("template");
|
|
1108
|
+
__tw.innerHTML = this.renderAcceptedFilesItem({ name: 0 });
|
|
1109
|
+
__c.__geaTpl = __tw.content.firstElementChild;
|
|
1058
1110
|
} catch {}
|
|
1059
1111
|
if (__c.__geaTpl) var el = __c.__geaTpl.cloneNode(true);
|
|
1060
1112
|
else {
|
|
1061
|
-
var __fw =
|
|
1113
|
+
var __fw = document.createElement("template");
|
|
1062
1114
|
__fw.innerHTML = this.renderAcceptedFilesItem(item);
|
|
1063
|
-
var el = __fw.firstElementChild;
|
|
1115
|
+
var el = __fw.content.firstElementChild;
|
|
1064
1116
|
}
|
|
1065
1117
|
el.firstElementChild.textContent = `${item.name}`;
|
|
1066
|
-
el.setAttribute("data-gea-item-id", item.
|
|
1118
|
+
el.setAttribute("data-gea-item-id", item.name);
|
|
1067
1119
|
el.__geaItem = item;
|
|
1068
1120
|
return el;
|
|
1069
1121
|
}
|
|
@@ -1076,17 +1128,27 @@ var FileUpload = class extends ZagComponent {
|
|
|
1076
1128
|
const __target = row.firstElementChild;
|
|
1077
1129
|
if (!__target) return;
|
|
1078
1130
|
__target.firstChild && (__target.firstChild.nodeValue = `${item.name}`) || (__target.textContent = `${item.name}`);
|
|
1079
|
-
}] }
|
|
1131
|
+
}, (row, value) => row.classList.toggle("name", value)] }
|
|
1080
1132
|
};
|
|
1081
1133
|
}
|
|
1082
1134
|
__setupLocalStateObservers() {
|
|
1083
1135
|
if (typeof this.__ensureArrayConfigs === "function") this.__ensureArrayConfigs();
|
|
1084
1136
|
if (!this.__store) return;
|
|
1085
|
-
this.__observer_removers__.push(this.__store.observe(["acceptedFiles"], (__v, __c) =>
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
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
|
+
}));
|
|
1090
1152
|
}
|
|
1091
1153
|
};
|
|
1092
1154
|
//#endregion
|
|
@@ -1125,6 +1187,7 @@ var HoverCard = class extends ZagComponent {
|
|
|
1125
1187
|
this.open = api.open;
|
|
1126
1188
|
}
|
|
1127
1189
|
template(props) {
|
|
1190
|
+
Component._register(ZagComponent);
|
|
1128
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>`;
|
|
1129
1192
|
}
|
|
1130
1193
|
__onPropChange(key, value) {
|
|
@@ -1155,7 +1218,11 @@ var HoverCard = class extends ZagComponent {
|
|
|
1155
1218
|
if (key === "children") try {
|
|
1156
1219
|
const __el = document.getElementById(this.id + "-b2");
|
|
1157
1220
|
if (__el) {
|
|
1158
|
-
if (__el.
|
|
1221
|
+
if (__el.innerHTML !== value) {
|
|
1222
|
+
__el.innerHTML = value;
|
|
1223
|
+
this.instantiateChildComponents_();
|
|
1224
|
+
if (this.parentComponent) this.parentComponent.mountCompiledChildComponents_();
|
|
1225
|
+
}
|
|
1159
1226
|
}
|
|
1160
1227
|
} catch {}
|
|
1161
1228
|
}
|
|
@@ -1199,11 +1266,12 @@ var Menu = class extends ZagComponent {
|
|
|
1199
1266
|
this.open = api.open;
|
|
1200
1267
|
}
|
|
1201
1268
|
template(props) {
|
|
1269
|
+
Component._register(ZagComponent);
|
|
1202
1270
|
const items = props.items || [];
|
|
1203
|
-
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) => 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-part="item"${item.value == null ? "" : ` 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>`;
|
|
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>`;
|
|
1204
1272
|
}
|
|
1205
|
-
render__unresolved_0Item(item) {
|
|
1206
|
-
return `<div id="${this.id + "-b2-" + String(
|
|
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>`;
|
|
1207
1275
|
}
|
|
1208
1276
|
__onPropChange(key, value) {
|
|
1209
1277
|
if (key === "class") try {
|
|
@@ -1236,11 +1304,7 @@ var Menu = class extends ZagComponent {
|
|
|
1236
1304
|
if (typeof this.__ensureArrayConfigs === "function") this.__ensureArrayConfigs();
|
|
1237
1305
|
this.__geaRegisterMap(0, "____unresolved_0_container", () => document.getElementById(this.id + "-b2"), () => {
|
|
1238
1306
|
return this.props.items || [];
|
|
1239
|
-
}, (__item) => this.create__unresolved_0Item(__item));
|
|
1240
|
-
}
|
|
1241
|
-
dispose() {
|
|
1242
|
-
if (this.__observer_removers__) this.__observer_removers__.forEach((fn) => fn());
|
|
1243
|
-
super.dispose();
|
|
1307
|
+
}, (__item, __idx) => this.create__unresolved_0Item(__item, __idx));
|
|
1244
1308
|
}
|
|
1245
1309
|
};
|
|
1246
1310
|
//#endregion
|
|
@@ -1248,8 +1312,10 @@ var Menu = class extends ZagComponent {
|
|
|
1248
1312
|
var NumberInput = class extends ZagComponent {
|
|
1249
1313
|
constructor(...args) {
|
|
1250
1314
|
super(...args);
|
|
1251
|
-
|
|
1252
|
-
|
|
1315
|
+
try {
|
|
1316
|
+
this.props;
|
|
1317
|
+
this.__geaCond_0 = !!this.props.label;
|
|
1318
|
+
} catch {}
|
|
1253
1319
|
this.__geaRegisterCond(0, "c0", () => {
|
|
1254
1320
|
this.props;
|
|
1255
1321
|
return this.props.label;
|
|
@@ -1305,6 +1371,7 @@ var NumberInput = class extends ZagComponent {
|
|
|
1305
1371
|
this.valueAsNumber = api.valueAsNumber;
|
|
1306
1372
|
}
|
|
1307
1373
|
template(props) {
|
|
1374
|
+
Component._register(ZagComponent);
|
|
1308
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>`;
|
|
1309
1376
|
}
|
|
1310
1377
|
__onPropChange(key, value) {
|
|
@@ -1374,7 +1441,8 @@ var Pagination = class extends ZagComponent {
|
|
|
1374
1441
|
this.totalPages = api.totalPages;
|
|
1375
1442
|
}
|
|
1376
1443
|
template(props) {
|
|
1377
|
-
|
|
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>`;
|
|
1378
1446
|
}
|
|
1379
1447
|
__onPropChange(key, value) {
|
|
1380
1448
|
if (key === "class") try {
|
|
@@ -1393,8 +1461,10 @@ var Pagination = class extends ZagComponent {
|
|
|
1393
1461
|
var PinInput = class extends ZagComponent {
|
|
1394
1462
|
constructor(...args) {
|
|
1395
1463
|
super(...args);
|
|
1396
|
-
|
|
1397
|
-
|
|
1464
|
+
try {
|
|
1465
|
+
this.props;
|
|
1466
|
+
this.__geaCond_0 = !!this.props.label;
|
|
1467
|
+
} catch {}
|
|
1398
1468
|
this.__geaRegisterCond(0, "c0", () => {
|
|
1399
1469
|
this.props;
|
|
1400
1470
|
return this.props.label;
|
|
@@ -1452,27 +1522,28 @@ var PinInput = class extends ZagComponent {
|
|
|
1452
1522
|
this.valueAsString = api.valueAsString;
|
|
1453
1523
|
}
|
|
1454
1524
|
template(props) {
|
|
1525
|
+
Component._register(ZagComponent);
|
|
1455
1526
|
const count = props.count ?? 4;
|
|
1456
1527
|
const inputs = Array.from({ length: count }, (_, i) => i);
|
|
1457
|
-
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 ? "" : ` 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>`;
|
|
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>`;
|
|
1458
1529
|
}
|
|
1459
1530
|
render__unresolved_0Item(i) {
|
|
1460
1531
|
const __v = (v) => v != null && typeof v === "object" ? v.valueOf() : v;
|
|
1461
|
-
return `<input id="${this.id + "-b1-" + String(String(i))}" data-gea-item-id="${String(i)}" data-part="input"${__v(String(i)) == __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" />`;
|
|
1462
1533
|
}
|
|
1463
1534
|
create__unresolved_0Item(item) {
|
|
1464
1535
|
var __c = this.____unresolved_0_container;
|
|
1465
1536
|
if (!__c.__geaTpl) try {
|
|
1466
|
-
var __tw =
|
|
1537
|
+
var __tw = document.createElement("template");
|
|
1467
1538
|
__tw.innerHTML = this.render__unresolved_0Item("__dummy__");
|
|
1468
|
-
__c.__geaTpl = __tw.firstElementChild;
|
|
1539
|
+
__c.__geaTpl = __tw.content.firstElementChild;
|
|
1469
1540
|
} catch {}
|
|
1470
1541
|
if (!__c.__geaIdPfx) __c.__geaIdPfx = this.id_ + "-b1-";
|
|
1471
1542
|
if (__c.__geaTpl) var el = __c.__geaTpl.cloneNode(true);
|
|
1472
1543
|
else {
|
|
1473
|
-
var __fw =
|
|
1544
|
+
var __fw = document.createElement("template");
|
|
1474
1545
|
__fw.innerHTML = this.render__unresolved_0Item(item);
|
|
1475
|
-
var el = __fw.firstElementChild;
|
|
1546
|
+
var el = __fw.content.firstElementChild;
|
|
1476
1547
|
}
|
|
1477
1548
|
var __av = String(item);
|
|
1478
1549
|
if (__av == null || __av === false) el.removeAttribute("data-index");
|
|
@@ -1509,19 +1580,17 @@ var PinInput = class extends ZagComponent {
|
|
|
1509
1580
|
return Array.from({ length: count }, (_, i) => i);
|
|
1510
1581
|
}, (__item) => this.create__unresolved_0Item(__item));
|
|
1511
1582
|
}
|
|
1512
|
-
dispose() {
|
|
1513
|
-
if (this.__observer_removers__) this.__observer_removers__.forEach((fn) => fn());
|
|
1514
|
-
super.dispose();
|
|
1515
|
-
}
|
|
1516
1583
|
};
|
|
1517
1584
|
//#endregion
|
|
1518
1585
|
//#region src/components/popover.tsx
|
|
1519
1586
|
var Popover = class extends ZagComponent {
|
|
1520
1587
|
constructor(...args) {
|
|
1521
1588
|
super(...args);
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1589
|
+
try {
|
|
1590
|
+
this.props;
|
|
1591
|
+
this.__geaCond_0 = !!this.props.title;
|
|
1592
|
+
this.__geaCond_1 = !!this.props.description;
|
|
1593
|
+
} catch {}
|
|
1525
1594
|
this.__geaRegisterCond(0, "c0", () => {
|
|
1526
1595
|
this.props;
|
|
1527
1596
|
return this.props.title;
|
|
@@ -1576,6 +1645,7 @@ var Popover = class extends ZagComponent {
|
|
|
1576
1645
|
this.open = api.open;
|
|
1577
1646
|
}
|
|
1578
1647
|
template(props) {
|
|
1648
|
+
Component._register(ZagComponent);
|
|
1579
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>`;
|
|
1580
1650
|
}
|
|
1581
1651
|
__onPropChange(key, value) {
|
|
@@ -1599,7 +1669,11 @@ var Popover = class extends ZagComponent {
|
|
|
1599
1669
|
if (key === "children") try {
|
|
1600
1670
|
const __el = document.getElementById(this.id + "-b2");
|
|
1601
1671
|
if (__el) {
|
|
1602
|
-
if (__el.
|
|
1672
|
+
if (__el.innerHTML !== value) {
|
|
1673
|
+
__el.innerHTML = value;
|
|
1674
|
+
this.instantiateChildComponents_();
|
|
1675
|
+
if (this.parentComponent) this.parentComponent.mountCompiledChildComponents_();
|
|
1676
|
+
}
|
|
1603
1677
|
}
|
|
1604
1678
|
} catch {}
|
|
1605
1679
|
if (key === "title") this.__geaPatchCond(0);
|
|
@@ -1612,8 +1686,10 @@ var Progress = class extends ZagComponent {
|
|
|
1612
1686
|
constructor(...args) {
|
|
1613
1687
|
super(...args);
|
|
1614
1688
|
this.percent = 0;
|
|
1615
|
-
|
|
1616
|
-
|
|
1689
|
+
try {
|
|
1690
|
+
this.props;
|
|
1691
|
+
this.__geaCond_0 = !!this.props.label;
|
|
1692
|
+
} catch {}
|
|
1617
1693
|
this.__geaRegisterCond(0, "c0", () => {
|
|
1618
1694
|
this.props;
|
|
1619
1695
|
return this.props.label;
|
|
@@ -1653,7 +1729,8 @@ var Progress = class extends ZagComponent {
|
|
|
1653
1729
|
this.percent = api.percent;
|
|
1654
1730
|
}
|
|
1655
1731
|
template(props) {
|
|
1656
|
-
|
|
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>`;
|
|
1657
1734
|
}
|
|
1658
1735
|
__observe_local_percent(percent, change) {
|
|
1659
1736
|
if (document.getElementById(this.id + "-b1")) document.getElementById(this.id + "-b1").textContent = `${this.percent}%`;
|
|
@@ -1673,11 +1750,11 @@ var Progress = class extends ZagComponent {
|
|
|
1673
1750
|
__setupLocalStateObservers() {
|
|
1674
1751
|
if (typeof this.__ensureArrayConfigs === "function") this.__ensureArrayConfigs();
|
|
1675
1752
|
if (!this.__store) return;
|
|
1676
|
-
this.__observer_removers__.push(this.__store.observe(["percent"], (__v, __c) =>
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1753
|
+
this.__observer_removers__.push(this.__store.observe(["percent"], (__v, __c) => {
|
|
1754
|
+
try {
|
|
1755
|
+
this.__observe_local_percent(__v, __c);
|
|
1756
|
+
} catch (_e) {}
|
|
1757
|
+
}));
|
|
1681
1758
|
}
|
|
1682
1759
|
};
|
|
1683
1760
|
//#endregion
|
|
@@ -1685,8 +1762,10 @@ var Progress = class extends ZagComponent {
|
|
|
1685
1762
|
var RadioGroup = class extends ZagComponent {
|
|
1686
1763
|
constructor(...args) {
|
|
1687
1764
|
super(...args);
|
|
1688
|
-
|
|
1689
|
-
|
|
1765
|
+
try {
|
|
1766
|
+
this.props;
|
|
1767
|
+
this.__geaCond_0 = !!this.props.label;
|
|
1768
|
+
} catch {}
|
|
1690
1769
|
this.__geaRegisterCond(0, "c0", () => {
|
|
1691
1770
|
this.props;
|
|
1692
1771
|
return this.props.label;
|
|
@@ -1732,25 +1811,29 @@ var RadioGroup = class extends ZagComponent {
|
|
|
1732
1811
|
this.value = api.value;
|
|
1733
1812
|
}
|
|
1734
1813
|
template(props) {
|
|
1814
|
+
Component._register(ZagComponent);
|
|
1735
1815
|
const items = props.items || [];
|
|
1736
|
-
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="${
|
|
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>`;
|
|
1737
1817
|
}
|
|
1738
1818
|
render__unresolved_0Item(item) {
|
|
1739
1819
|
const __v = (v) => v != null && typeof v === "object" ? v.valueOf() : v;
|
|
1740
|
-
return `<label data-gea-item-id="${
|
|
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>`;
|
|
1741
1821
|
}
|
|
1742
1822
|
create__unresolved_0Item(item) {
|
|
1743
1823
|
var __c = this.____unresolved_0_container;
|
|
1744
1824
|
if (!__c.__geaTpl) try {
|
|
1745
|
-
var __tw =
|
|
1746
|
-
__tw.innerHTML = this.render__unresolved_0Item(
|
|
1747
|
-
|
|
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;
|
|
1748
1831
|
} catch {}
|
|
1749
1832
|
if (__c.__geaTpl) var el = __c.__geaTpl.cloneNode(true);
|
|
1750
1833
|
else {
|
|
1751
|
-
var __fw =
|
|
1834
|
+
var __fw = document.createElement("template");
|
|
1752
1835
|
__fw.innerHTML = this.render__unresolved_0Item(item);
|
|
1753
|
-
var el = __fw.firstElementChild;
|
|
1836
|
+
var el = __fw.content.firstElementChild;
|
|
1754
1837
|
}
|
|
1755
1838
|
var __av = item.value;
|
|
1756
1839
|
if (__av == null || __av === false) el.removeAttribute("data-value");
|
|
@@ -1764,8 +1847,10 @@ var RadioGroup = class extends ZagComponent {
|
|
|
1764
1847
|
var __av = item.value;
|
|
1765
1848
|
if (__av == null || __av === false) el.firstElementChild.nextElementSibling.nextElementSibling.removeAttribute("data-value");
|
|
1766
1849
|
else el.firstElementChild.nextElementSibling.nextElementSibling.setAttribute("data-value", String(__av));
|
|
1767
|
-
el.firstElementChild.nextElementSibling.nextElementSibling.textContent =
|
|
1768
|
-
|
|
1850
|
+
el.firstElementChild.nextElementSibling.nextElementSibling.textContent = `
|
|
1851
|
+
${item.label}
|
|
1852
|
+
`;
|
|
1853
|
+
el.setAttribute("data-gea-item-id", item.value);
|
|
1769
1854
|
el.__geaItem = item;
|
|
1770
1855
|
return el;
|
|
1771
1856
|
}
|
|
@@ -1793,11 +1878,7 @@ var RadioGroup = class extends ZagComponent {
|
|
|
1793
1878
|
if (typeof this.__ensureArrayConfigs === "function") this.__ensureArrayConfigs();
|
|
1794
1879
|
this.__geaRegisterMap(0, "____unresolved_0_container", () => this.$(":scope"), () => {
|
|
1795
1880
|
return this.props.items || [];
|
|
1796
|
-
}, (__item) => this.create__unresolved_0Item(__item));
|
|
1797
|
-
}
|
|
1798
|
-
dispose() {
|
|
1799
|
-
if (this.__observer_removers__) this.__observer_removers__.forEach((fn) => fn());
|
|
1800
|
-
super.dispose();
|
|
1881
|
+
}, (__item) => this.create__unresolved_0Item(__item), "value");
|
|
1801
1882
|
}
|
|
1802
1883
|
};
|
|
1803
1884
|
//#endregion
|
|
@@ -1805,8 +1886,10 @@ var RadioGroup = class extends ZagComponent {
|
|
|
1805
1886
|
var RatingGroup = class extends ZagComponent {
|
|
1806
1887
|
constructor(...args) {
|
|
1807
1888
|
super(...args);
|
|
1808
|
-
|
|
1809
|
-
|
|
1889
|
+
try {
|
|
1890
|
+
this.props;
|
|
1891
|
+
this.__geaCond_0 = !!this.props.label;
|
|
1892
|
+
} catch {}
|
|
1810
1893
|
this.__geaRegisterCond(0, "c0", () => {
|
|
1811
1894
|
this.props;
|
|
1812
1895
|
return this.props.label;
|
|
@@ -1882,27 +1965,28 @@ var RatingGroup = class extends ZagComponent {
|
|
|
1882
1965
|
}
|
|
1883
1966
|
}
|
|
1884
1967
|
template(props) {
|
|
1968
|
+
Component._register(ZagComponent);
|
|
1885
1969
|
const count = props.count ?? 5;
|
|
1886
1970
|
const items = Array.from({ length: count }, (_, i) => i + 1);
|
|
1887
|
-
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 ? "" : ` 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>`;
|
|
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>`;
|
|
1888
1972
|
}
|
|
1889
1973
|
render__unresolved_0Item(i) {
|
|
1890
1974
|
const __v = (v) => v != null && typeof v === "object" ? v.valueOf() : v;
|
|
1891
|
-
return `<span id="${this.id + "-b1-" + String(String(i))}" data-gea-item-id="${String(i)}" data-part="item"${__v(String(i)) == __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>`;
|
|
1892
1976
|
}
|
|
1893
1977
|
create__unresolved_0Item(item) {
|
|
1894
1978
|
var __c = this.____unresolved_0_container;
|
|
1895
1979
|
if (!__c.__geaTpl) try {
|
|
1896
|
-
var __tw =
|
|
1980
|
+
var __tw = document.createElement("template");
|
|
1897
1981
|
__tw.innerHTML = this.render__unresolved_0Item("__dummy__");
|
|
1898
|
-
__c.__geaTpl = __tw.firstElementChild;
|
|
1982
|
+
__c.__geaTpl = __tw.content.firstElementChild;
|
|
1899
1983
|
} catch {}
|
|
1900
1984
|
if (!__c.__geaIdPfx) __c.__geaIdPfx = this.id_ + "-b1-";
|
|
1901
1985
|
if (__c.__geaTpl) var el = __c.__geaTpl.cloneNode(true);
|
|
1902
1986
|
else {
|
|
1903
|
-
var __fw =
|
|
1987
|
+
var __fw = document.createElement("template");
|
|
1904
1988
|
__fw.innerHTML = this.render__unresolved_0Item(item);
|
|
1905
|
-
var el = __fw.firstElementChild;
|
|
1989
|
+
var el = __fw.content.firstElementChild;
|
|
1906
1990
|
}
|
|
1907
1991
|
var __av = String(item);
|
|
1908
1992
|
if (__av == null || __av === false) el.removeAttribute("data-index");
|
|
@@ -1939,18 +2023,16 @@ var RatingGroup = class extends ZagComponent {
|
|
|
1939
2023
|
return Array.from({ length: count }, (_, i) => i + 1);
|
|
1940
2024
|
}, (__item) => this.create__unresolved_0Item(__item));
|
|
1941
2025
|
}
|
|
1942
|
-
dispose() {
|
|
1943
|
-
if (this.__observer_removers__) this.__observer_removers__.forEach((fn) => fn());
|
|
1944
|
-
super.dispose();
|
|
1945
|
-
}
|
|
1946
2026
|
};
|
|
1947
2027
|
//#endregion
|
|
1948
2028
|
//#region src/components/select.tsx
|
|
1949
2029
|
var Select = class extends ZagComponent {
|
|
1950
2030
|
constructor(...args) {
|
|
1951
2031
|
super(...args);
|
|
1952
|
-
|
|
1953
|
-
|
|
2032
|
+
try {
|
|
2033
|
+
this.props;
|
|
2034
|
+
this.__geaCond_0 = !!this.props.label;
|
|
2035
|
+
} catch {}
|
|
1954
2036
|
this.__geaRegisterCond(0, "c0", () => {
|
|
1955
2037
|
this.props;
|
|
1956
2038
|
return this.props.label;
|
|
@@ -2044,26 +2126,30 @@ var Select = class extends ZagComponent {
|
|
|
2044
2126
|
this.valueAsString = api.valueAsString;
|
|
2045
2127
|
}
|
|
2046
2128
|
template(props) {
|
|
2129
|
+
Component._register(ZagComponent);
|
|
2047
2130
|
const items = props.items || [];
|
|
2048
|
-
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(
|
|
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>`;
|
|
2049
2132
|
}
|
|
2050
2133
|
render__unresolved_0Item(item) {
|
|
2051
2134
|
const __v = (v) => v != null && typeof v === "object" ? v.valueOf() : v;
|
|
2052
|
-
return `<div id="${this.id + "-b2-" + String(
|
|
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>`;
|
|
2053
2136
|
}
|
|
2054
2137
|
create__unresolved_0Item(item) {
|
|
2055
2138
|
var __c = this.____unresolved_0_container;
|
|
2056
2139
|
if (!__c.__geaTpl) try {
|
|
2057
|
-
var __tw =
|
|
2058
|
-
__tw.innerHTML = this.render__unresolved_0Item(
|
|
2059
|
-
|
|
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;
|
|
2060
2146
|
} catch {}
|
|
2061
2147
|
if (!__c.__geaIdPfx) __c.__geaIdPfx = this.id_ + "-b2-";
|
|
2062
2148
|
if (__c.__geaTpl) var el = __c.__geaTpl.cloneNode(true);
|
|
2063
2149
|
else {
|
|
2064
|
-
var __fw =
|
|
2150
|
+
var __fw = document.createElement("template");
|
|
2065
2151
|
__fw.innerHTML = this.render__unresolved_0Item(item);
|
|
2066
|
-
var el = __fw.firstElementChild;
|
|
2152
|
+
var el = __fw.content.firstElementChild;
|
|
2067
2153
|
}
|
|
2068
2154
|
var __av = item.value;
|
|
2069
2155
|
if (__av == null || __av === false) el.removeAttribute("data-value");
|
|
@@ -2086,8 +2172,8 @@ var Select = class extends ZagComponent {
|
|
|
2086
2172
|
var __av = item.label;
|
|
2087
2173
|
if (__av == null || __av === false) el.firstElementChild.nextElementSibling.removeAttribute("data-label");
|
|
2088
2174
|
else el.firstElementChild.nextElementSibling.setAttribute("data-label", String(__av));
|
|
2089
|
-
el.setAttribute("data-gea-item-id",
|
|
2090
|
-
el.id = __c.__geaIdPfx +
|
|
2175
|
+
el.setAttribute("data-gea-item-id", item.value);
|
|
2176
|
+
el.id = __c.__geaIdPfx + item.value;
|
|
2091
2177
|
el.__geaItem = item;
|
|
2092
2178
|
return el;
|
|
2093
2179
|
}
|
|
@@ -2133,16 +2219,16 @@ var Select = class extends ZagComponent {
|
|
|
2133
2219
|
if (typeof this.__ensureArrayConfigs === "function") this.__ensureArrayConfigs();
|
|
2134
2220
|
this.__geaRegisterMap(0, "____unresolved_0_container", () => document.getElementById(this.id + "-b2"), () => {
|
|
2135
2221
|
return this.props.items || [];
|
|
2136
|
-
}, (__item) => this.create__unresolved_0Item(__item));
|
|
2222
|
+
}, (__item) => this.create__unresolved_0Item(__item), "value");
|
|
2137
2223
|
}
|
|
2138
2224
|
__setupLocalStateObservers() {
|
|
2139
2225
|
if (typeof this.__ensureArrayConfigs === "function") this.__ensureArrayConfigs();
|
|
2140
2226
|
if (!this.__store) return;
|
|
2141
|
-
this.__observer_removers__.push(this.__store.observe(["valueAsString"], (__v, __c) =>
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2227
|
+
this.__observer_removers__.push(this.__store.observe(["valueAsString"], (__v, __c) => {
|
|
2228
|
+
try {
|
|
2229
|
+
this.__observe_local_valueAsString(__v, __c);
|
|
2230
|
+
} catch (_e) {}
|
|
2231
|
+
}));
|
|
2146
2232
|
}
|
|
2147
2233
|
};
|
|
2148
2234
|
//#endregion
|
|
@@ -2151,8 +2237,10 @@ const THUMB_CLASS = "slider-thumb block h-5 w-5 rounded-full border-2 border-pri
|
|
|
2151
2237
|
var Slider = class extends ZagComponent {
|
|
2152
2238
|
constructor(...args) {
|
|
2153
2239
|
super(...args);
|
|
2154
|
-
|
|
2155
|
-
|
|
2240
|
+
try {
|
|
2241
|
+
this.props;
|
|
2242
|
+
this.__geaCond_0 = !!this.props.label;
|
|
2243
|
+
} catch {}
|
|
2156
2244
|
this.__geaRegisterCond(0, "c0", () => {
|
|
2157
2245
|
this.props;
|
|
2158
2246
|
return this.props.label;
|
|
@@ -2234,7 +2322,8 @@ var Slider = class extends ZagComponent {
|
|
|
2234
2322
|
super._applyAllSpreads();
|
|
2235
2323
|
}
|
|
2236
2324
|
template(props) {
|
|
2237
|
-
|
|
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>`;
|
|
2238
2327
|
}
|
|
2239
2328
|
__onPropChange(key, value) {
|
|
2240
2329
|
if (key === "class") try {
|
|
@@ -2255,8 +2344,10 @@ var Switch = class extends ZagComponent {
|
|
|
2255
2344
|
constructor(...args) {
|
|
2256
2345
|
super(...args);
|
|
2257
2346
|
this.checked = false;
|
|
2258
|
-
|
|
2259
|
-
|
|
2347
|
+
try {
|
|
2348
|
+
this.props;
|
|
2349
|
+
this.__geaCond_0 = !!this.props.label;
|
|
2350
|
+
} catch {}
|
|
2260
2351
|
this.__geaRegisterCond(0, "c0", () => {
|
|
2261
2352
|
this.props;
|
|
2262
2353
|
return this.props.label;
|
|
@@ -2302,7 +2393,8 @@ var Switch = class extends ZagComponent {
|
|
|
2302
2393
|
this.checked = api.checked;
|
|
2303
2394
|
}
|
|
2304
2395
|
template(props) {
|
|
2305
|
-
|
|
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>`;
|
|
2306
2398
|
}
|
|
2307
2399
|
__onPropChange(key, value) {
|
|
2308
2400
|
if (key === "class") try {
|
|
@@ -2366,62 +2458,69 @@ var Tabs = class extends ZagComponent {
|
|
|
2366
2458
|
if (this._api?.value && this._machine) this._machine.service.send({ type: "SET_INDICATOR_RECT" });
|
|
2367
2459
|
}
|
|
2368
2460
|
template(props) {
|
|
2461
|
+
Component._register(ZagComponent);
|
|
2369
2462
|
const items = props.items || [];
|
|
2370
|
-
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(
|
|
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>`;
|
|
2371
2464
|
}
|
|
2372
2465
|
render__unresolved_0Item(item) {
|
|
2373
2466
|
const __v = (v) => v != null && typeof v === "object" ? v.valueOf() : v;
|
|
2374
|
-
return `<
|
|
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>`;
|
|
2375
2468
|
}
|
|
2376
2469
|
create__unresolved_0Item(item) {
|
|
2377
2470
|
var __c = this.____unresolved_0_container;
|
|
2378
2471
|
if (!__c.__geaTpl) try {
|
|
2379
|
-
var __tw =
|
|
2380
|
-
__tw.innerHTML = this.render__unresolved_0Item(
|
|
2381
|
-
|
|
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;
|
|
2382
2478
|
} catch {}
|
|
2479
|
+
if (!__c.__geaIdPfx) __c.__geaIdPfx = this.id_ + "-b1-";
|
|
2383
2480
|
if (__c.__geaTpl) var el = __c.__geaTpl.cloneNode(true);
|
|
2384
2481
|
else {
|
|
2385
|
-
var __fw =
|
|
2482
|
+
var __fw = document.createElement("template");
|
|
2386
2483
|
__fw.innerHTML = this.render__unresolved_0Item(item);
|
|
2387
|
-
var el = __fw.firstElementChild;
|
|
2484
|
+
var el = __fw.content.firstElementChild;
|
|
2388
2485
|
}
|
|
2389
2486
|
var __av = item.value;
|
|
2390
2487
|
if (__av == null || __av === false) el.removeAttribute("data-value");
|
|
2391
2488
|
else el.setAttribute("data-value", String(__av));
|
|
2392
2489
|
el.textContent = `
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
el.setAttribute("data-gea-item-id",
|
|
2490
|
+
${item.label}
|
|
2491
|
+
`;
|
|
2492
|
+
el.setAttribute("data-gea-item-id", item.value);
|
|
2493
|
+
el.id = __c.__geaIdPfx + item.value;
|
|
2396
2494
|
el.__geaItem = item;
|
|
2397
2495
|
return el;
|
|
2398
2496
|
}
|
|
2399
2497
|
render__unresolved_1Item(item) {
|
|
2400
2498
|
const __v = (v) => v != null && typeof v === "object" ? v.valueOf() : v;
|
|
2401
|
-
return `<
|
|
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>`;
|
|
2402
2500
|
}
|
|
2403
2501
|
create__unresolved_1Item(item) {
|
|
2404
2502
|
var __c = this.____unresolved_1_container;
|
|
2405
2503
|
if (!__c.__geaTpl) try {
|
|
2406
|
-
var __tw =
|
|
2407
|
-
__tw.innerHTML = this.render__unresolved_1Item(
|
|
2408
|
-
|
|
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;
|
|
2409
2510
|
} catch {}
|
|
2410
|
-
if (!__c.__geaIdPfx) __c.__geaIdPfx = this.id_ + "-b1-";
|
|
2411
2511
|
if (__c.__geaTpl) var el = __c.__geaTpl.cloneNode(true);
|
|
2412
2512
|
else {
|
|
2413
|
-
var __fw =
|
|
2513
|
+
var __fw = document.createElement("template");
|
|
2414
2514
|
__fw.innerHTML = this.render__unresolved_1Item(item);
|
|
2415
|
-
var el = __fw.firstElementChild;
|
|
2515
|
+
var el = __fw.content.firstElementChild;
|
|
2416
2516
|
}
|
|
2417
2517
|
var __av = item.value;
|
|
2418
2518
|
if (__av == null || __av === false) el.removeAttribute("data-value");
|
|
2419
2519
|
else el.setAttribute("data-value", String(__av));
|
|
2420
2520
|
el.textContent = `
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
el.setAttribute("data-gea-item-id",
|
|
2424
|
-
el.id = __c.__geaIdPfx + String(item);
|
|
2521
|
+
${item.content}
|
|
2522
|
+
`;
|
|
2523
|
+
el.setAttribute("data-gea-item-id", item.value);
|
|
2425
2524
|
el.__geaItem = item;
|
|
2426
2525
|
return el;
|
|
2427
2526
|
}
|
|
@@ -2450,16 +2549,12 @@ var Tabs = class extends ZagComponent {
|
|
|
2450
2549
|
this.__observer_removers__.forEach((fn) => fn());
|
|
2451
2550
|
this.__observer_removers__ = [];
|
|
2452
2551
|
if (typeof this.__ensureArrayConfigs === "function") this.__ensureArrayConfigs();
|
|
2453
|
-
this.__geaRegisterMap(0, "____unresolved_0_container", () => this
|
|
2552
|
+
this.__geaRegisterMap(0, "____unresolved_0_container", () => document.getElementById(this.id + "-b1"), () => {
|
|
2454
2553
|
return this.props.items || [];
|
|
2455
|
-
}, (__item) => this.create__unresolved_0Item(__item));
|
|
2456
|
-
this.__geaRegisterMap(1, "____unresolved_1_container", () =>
|
|
2554
|
+
}, (__item) => this.create__unresolved_0Item(__item), "value");
|
|
2555
|
+
this.__geaRegisterMap(1, "____unresolved_1_container", () => this.$(":scope"), () => {
|
|
2457
2556
|
return this.props.items || [];
|
|
2458
|
-
}, (__item) => this.create__unresolved_1Item(__item));
|
|
2459
|
-
}
|
|
2460
|
-
dispose() {
|
|
2461
|
-
if (this.__observer_removers__) this.__observer_removers__.forEach((fn) => fn());
|
|
2462
|
-
super.dispose();
|
|
2557
|
+
}, (__item) => this.create__unresolved_1Item(__item), "value");
|
|
2463
2558
|
}
|
|
2464
2559
|
};
|
|
2465
2560
|
//#endregion
|
|
@@ -2467,8 +2562,10 @@ var Tabs = class extends ZagComponent {
|
|
|
2467
2562
|
var TagsInput = class extends ZagComponent {
|
|
2468
2563
|
constructor(...args) {
|
|
2469
2564
|
super(...args);
|
|
2470
|
-
|
|
2471
|
-
|
|
2565
|
+
try {
|
|
2566
|
+
this.props;
|
|
2567
|
+
this.__geaCond_0 = !!this.props.label;
|
|
2568
|
+
} catch {}
|
|
2472
2569
|
this.__geaRegisterCond(0, "c0", () => {
|
|
2473
2570
|
this.props;
|
|
2474
2571
|
return this.props.label;
|
|
@@ -2549,25 +2646,26 @@ var TagsInput = class extends ZagComponent {
|
|
|
2549
2646
|
this.value = api.value;
|
|
2550
2647
|
}
|
|
2551
2648
|
template(props) {
|
|
2552
|
-
|
|
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>`;
|
|
2553
2651
|
}
|
|
2554
2652
|
render__unresolved_0Item(tag, i) {
|
|
2555
2653
|
const __v = (v) => v != null && typeof v === "object" ? v.valueOf() : v;
|
|
2556
|
-
return `<span id="${this.id + "-b1-" + String(
|
|
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>`;
|
|
2557
2655
|
}
|
|
2558
2656
|
create__unresolved_0Item(item, __idx) {
|
|
2559
2657
|
var __c = this.____unresolved_0_container;
|
|
2560
2658
|
if (!__c.__geaTpl) try {
|
|
2561
|
-
var __tw =
|
|
2659
|
+
var __tw = document.createElement("template");
|
|
2562
2660
|
__tw.innerHTML = this.render__unresolved_0Item("__dummy__", 0);
|
|
2563
|
-
__c.__geaTpl = __tw.firstElementChild;
|
|
2661
|
+
__c.__geaTpl = __tw.content.firstElementChild;
|
|
2564
2662
|
} catch {}
|
|
2565
2663
|
if (!__c.__geaIdPfx) __c.__geaIdPfx = this.id_ + "-b1-";
|
|
2566
2664
|
if (__c.__geaTpl) var el = __c.__geaTpl.cloneNode(true);
|
|
2567
2665
|
else {
|
|
2568
|
-
var __fw =
|
|
2666
|
+
var __fw = document.createElement("template");
|
|
2569
2667
|
__fw.innerHTML = this.render__unresolved_0Item(item, __idx);
|
|
2570
|
-
var el = __fw.firstElementChild;
|
|
2668
|
+
var el = __fw.content.firstElementChild;
|
|
2571
2669
|
}
|
|
2572
2670
|
var __av = String(__idx);
|
|
2573
2671
|
if (__av == null || __av === false) el.removeAttribute("data-index");
|
|
@@ -2601,6 +2699,10 @@ var TagsInput = class extends ZagComponent {
|
|
|
2601
2699
|
el.__geaItem = item;
|
|
2602
2700
|
return el;
|
|
2603
2701
|
}
|
|
2702
|
+
__observe_local_value(value, change) {
|
|
2703
|
+
this.__geaSyncMap(0);
|
|
2704
|
+
this.__geaSyncMap(0);
|
|
2705
|
+
}
|
|
2604
2706
|
__onPropChange(key, value) {
|
|
2605
2707
|
if (key === "class") try {
|
|
2606
2708
|
const __el = this.$(":scope");
|
|
@@ -2613,9 +2715,6 @@ var TagsInput = class extends ZagComponent {
|
|
|
2613
2715
|
} catch {}
|
|
2614
2716
|
if (key === "label") this.__geaPatchCond(0);
|
|
2615
2717
|
}
|
|
2616
|
-
__observe_local_value(__v, __c) {
|
|
2617
|
-
this.__geaSyncMap(0);
|
|
2618
|
-
}
|
|
2619
2718
|
createdHooks() {
|
|
2620
2719
|
if (!this.__observer_removers__) this.__observer_removers__ = [];
|
|
2621
2720
|
if (!this.__stores) this.__stores = {};
|
|
@@ -2629,11 +2728,11 @@ var TagsInput = class extends ZagComponent {
|
|
|
2629
2728
|
__setupLocalStateObservers() {
|
|
2630
2729
|
if (typeof this.__ensureArrayConfigs === "function") this.__ensureArrayConfigs();
|
|
2631
2730
|
if (!this.__store) return;
|
|
2632
|
-
this.__observer_removers__.push(this.__store.observe(["value"], (__v, __c) =>
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2731
|
+
this.__observer_removers__.push(this.__store.observe(["value"], (__v, __c) => {
|
|
2732
|
+
try {
|
|
2733
|
+
this.__observe_local_value(__v, __c);
|
|
2734
|
+
} catch (_e) {}
|
|
2735
|
+
}));
|
|
2637
2736
|
}
|
|
2638
2737
|
};
|
|
2639
2738
|
//#endregion
|
|
@@ -2809,7 +2908,8 @@ var Toaster = class extends Component {
|
|
|
2809
2908
|
super.dispose();
|
|
2810
2909
|
}
|
|
2811
2910
|
template(props) {
|
|
2812
|
-
|
|
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>`;
|
|
2813
2913
|
}
|
|
2814
2914
|
__onPropChange(key, value) {
|
|
2815
2915
|
if (key === "class") try {
|
|
@@ -2858,25 +2958,29 @@ var ToggleGroup = class extends ZagComponent {
|
|
|
2858
2958
|
this.value = api.value;
|
|
2859
2959
|
}
|
|
2860
2960
|
template(props) {
|
|
2961
|
+
Component._register(ZagComponent);
|
|
2861
2962
|
const items = props.items || [];
|
|
2862
|
-
return `<div id="${this.id}" data-part="root"
|
|
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>`;
|
|
2863
2964
|
}
|
|
2864
2965
|
render__unresolved_0Item(item) {
|
|
2865
2966
|
const __v = (v) => v != null && typeof v === "object" ? v.valueOf() : v;
|
|
2866
|
-
return `<button data-gea-item-id="${
|
|
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>`;
|
|
2867
2968
|
}
|
|
2868
2969
|
create__unresolved_0Item(item) {
|
|
2869
2970
|
var __c = this.____unresolved_0_container;
|
|
2870
2971
|
if (!__c.__geaTpl) try {
|
|
2871
|
-
var __tw =
|
|
2872
|
-
__tw.innerHTML = this.render__unresolved_0Item(
|
|
2873
|
-
|
|
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;
|
|
2874
2978
|
} catch {}
|
|
2875
2979
|
if (__c.__geaTpl) var el = __c.__geaTpl.cloneNode(true);
|
|
2876
2980
|
else {
|
|
2877
|
-
var __fw =
|
|
2981
|
+
var __fw = document.createElement("template");
|
|
2878
2982
|
__fw.innerHTML = this.render__unresolved_0Item(item);
|
|
2879
|
-
var el = __fw.firstElementChild;
|
|
2983
|
+
var el = __fw.content.firstElementChild;
|
|
2880
2984
|
}
|
|
2881
2985
|
var __av = item.value;
|
|
2882
2986
|
if (__av == null || __av === false) el.removeAttribute("data-value");
|
|
@@ -2884,7 +2988,7 @@ var ToggleGroup = class extends ZagComponent {
|
|
|
2884
2988
|
el.textContent = `
|
|
2885
2989
|
${item.label}
|
|
2886
2990
|
`;
|
|
2887
|
-
el.setAttribute("data-gea-item-id",
|
|
2991
|
+
el.setAttribute("data-gea-item-id", item.value);
|
|
2888
2992
|
el.__geaItem = item;
|
|
2889
2993
|
return el;
|
|
2890
2994
|
}
|
|
@@ -2911,11 +3015,7 @@ var ToggleGroup = class extends ZagComponent {
|
|
|
2911
3015
|
if (typeof this.__ensureArrayConfigs === "function") this.__ensureArrayConfigs();
|
|
2912
3016
|
this.__geaRegisterMap(0, "____unresolved_0_container", () => this.$(":scope"), () => {
|
|
2913
3017
|
return this.props.items || [];
|
|
2914
|
-
}, (__item) => this.create__unresolved_0Item(__item));
|
|
2915
|
-
}
|
|
2916
|
-
dispose() {
|
|
2917
|
-
if (this.__observer_removers__) this.__observer_removers__.forEach((fn) => fn());
|
|
2918
|
-
super.dispose();
|
|
3018
|
+
}, (__item) => this.create__unresolved_0Item(__item), "value");
|
|
2919
3019
|
}
|
|
2920
3020
|
};
|
|
2921
3021
|
//#endregion
|
|
@@ -2960,6 +3060,7 @@ var Tooltip = class extends ZagComponent {
|
|
|
2960
3060
|
this.open = api.open;
|
|
2961
3061
|
}
|
|
2962
3062
|
template(props) {
|
|
3063
|
+
Component._register(ZagComponent);
|
|
2963
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>`;
|
|
2964
3065
|
}
|
|
2965
3066
|
__onPropChange(key, value) {
|
|
@@ -2975,7 +3076,11 @@ var Tooltip = class extends ZagComponent {
|
|
|
2975
3076
|
if (key === "children") try {
|
|
2976
3077
|
const __el = document.getElementById(this.id + "-b1");
|
|
2977
3078
|
if (__el) {
|
|
2978
|
-
if (__el.
|
|
3079
|
+
if (__el.innerHTML !== value) {
|
|
3080
|
+
__el.innerHTML = value;
|
|
3081
|
+
this.instantiateChildComponents_();
|
|
3082
|
+
if (this.parentComponent) this.parentComponent.mountCompiledChildComponents_();
|
|
3083
|
+
}
|
|
2979
3084
|
}
|
|
2980
3085
|
} catch {}
|
|
2981
3086
|
if (key === "content") try {
|
|
@@ -2993,8 +3098,10 @@ var TreeView = class extends ZagComponent {
|
|
|
2993
3098
|
super(...args);
|
|
2994
3099
|
this.selectedValue = [];
|
|
2995
3100
|
this.expandedValue = [];
|
|
2996
|
-
|
|
2997
|
-
|
|
3101
|
+
try {
|
|
3102
|
+
this.props;
|
|
3103
|
+
this.__geaCond_0 = !!this.props.label;
|
|
3104
|
+
} catch {}
|
|
2998
3105
|
this.__geaRegisterCond(0, "c0", () => {
|
|
2999
3106
|
this.props;
|
|
3000
3107
|
return this.props.label;
|
|
@@ -3041,6 +3148,7 @@ var TreeView = class extends ZagComponent {
|
|
|
3041
3148
|
this.expandedValue = api.expandedValue;
|
|
3042
3149
|
}
|
|
3043
3150
|
template(props) {
|
|
3151
|
+
Component._register(ZagComponent);
|
|
3044
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>`;
|
|
3045
3153
|
}
|
|
3046
3154
|
__onPropChange(key, value) {
|
|
@@ -3056,7 +3164,11 @@ var TreeView = class extends ZagComponent {
|
|
|
3056
3164
|
if (key === "children") try {
|
|
3057
3165
|
const __el = document.getElementById(this.id + "-b1");
|
|
3058
3166
|
if (__el) {
|
|
3059
|
-
if (__el.
|
|
3167
|
+
if (__el.innerHTML !== value) {
|
|
3168
|
+
__el.innerHTML = value;
|
|
3169
|
+
this.instantiateChildComponents_();
|
|
3170
|
+
if (this.parentComponent) this.parentComponent.mountCompiledChildComponents_();
|
|
3171
|
+
}
|
|
3060
3172
|
}
|
|
3061
3173
|
} catch {}
|
|
3062
3174
|
if (key === "label") this.__geaPatchCond(0);
|
|
@@ -3080,9 +3192,10 @@ const sizes = {
|
|
|
3080
3192
|
};
|
|
3081
3193
|
var Button = class extends Component {
|
|
3082
3194
|
template(props) {
|
|
3195
|
+
Component._register(Component);
|
|
3083
3196
|
const variant = variants$2[props.variant || "default"] || variants$2.default;
|
|
3084
3197
|
const size = sizes[props.size || "default"] || sizes.default;
|
|
3085
|
-
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 ? "" : ` 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 ? "" : ` disabled="${props.disabled}"`}>${props.children}</button>`;
|
|
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>`;
|
|
3086
3199
|
}
|
|
3087
3200
|
get events() {
|
|
3088
3201
|
return { click: { [`#${this.id}`]: this.__event_click_0 } };
|
|
@@ -3133,7 +3246,11 @@ var Button = class extends Component {
|
|
|
3133
3246
|
if (key === "children") try {
|
|
3134
3247
|
const __el = this.$(":scope");
|
|
3135
3248
|
if (__el) {
|
|
3136
|
-
if (__el.
|
|
3249
|
+
if (__el.innerHTML !== value) {
|
|
3250
|
+
__el.innerHTML = value;
|
|
3251
|
+
this.instantiateChildComponents_();
|
|
3252
|
+
if (this.parentComponent) this.parentComponent.mountCompiledChildComponents_();
|
|
3253
|
+
}
|
|
3137
3254
|
}
|
|
3138
3255
|
} catch {}
|
|
3139
3256
|
}
|
|
@@ -3142,7 +3259,13 @@ var Button = class extends Component {
|
|
|
3142
3259
|
//#region src/components/card.tsx
|
|
3143
3260
|
var Card = class extends Component {
|
|
3144
3261
|
template(props) {
|
|
3145
|
-
|
|
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>`;
|
|
3146
3269
|
}
|
|
3147
3270
|
__onPropChange(key, value) {
|
|
3148
3271
|
if (key === "class") try {
|
|
@@ -3157,14 +3280,24 @@ var Card = class extends Component {
|
|
|
3157
3280
|
if (key === "children") try {
|
|
3158
3281
|
const __el = this.$(":scope");
|
|
3159
3282
|
if (__el) {
|
|
3160
|
-
if (__el.
|
|
3283
|
+
if (__el.innerHTML !== value) {
|
|
3284
|
+
__el.innerHTML = value;
|
|
3285
|
+
this.instantiateChildComponents_();
|
|
3286
|
+
if (this.parentComponent) this.parentComponent.mountCompiledChildComponents_();
|
|
3287
|
+
}
|
|
3161
3288
|
}
|
|
3162
3289
|
} catch {}
|
|
3163
3290
|
}
|
|
3164
3291
|
};
|
|
3165
3292
|
var CardHeader = class extends Component {
|
|
3166
3293
|
template(props) {
|
|
3167
|
-
|
|
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>`;
|
|
3168
3301
|
}
|
|
3169
3302
|
__onPropChange(key, value) {
|
|
3170
3303
|
if (key === "class") try {
|
|
@@ -3179,14 +3312,24 @@ var CardHeader = class extends Component {
|
|
|
3179
3312
|
if (key === "children") try {
|
|
3180
3313
|
const __el = this.$(":scope");
|
|
3181
3314
|
if (__el) {
|
|
3182
|
-
if (__el.
|
|
3315
|
+
if (__el.innerHTML !== value) {
|
|
3316
|
+
__el.innerHTML = value;
|
|
3317
|
+
this.instantiateChildComponents_();
|
|
3318
|
+
if (this.parentComponent) this.parentComponent.mountCompiledChildComponents_();
|
|
3319
|
+
}
|
|
3183
3320
|
}
|
|
3184
3321
|
} catch {}
|
|
3185
3322
|
}
|
|
3186
3323
|
};
|
|
3187
3324
|
var CardTitle = class extends Component {
|
|
3188
3325
|
template(props) {
|
|
3189
|
-
|
|
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>`;
|
|
3190
3333
|
}
|
|
3191
3334
|
__onPropChange(key, value) {
|
|
3192
3335
|
if (key === "class") try {
|
|
@@ -3201,14 +3344,24 @@ var CardTitle = class extends Component {
|
|
|
3201
3344
|
if (key === "children") try {
|
|
3202
3345
|
const __el = this.$(":scope");
|
|
3203
3346
|
if (__el) {
|
|
3204
|
-
if (__el.
|
|
3347
|
+
if (__el.innerHTML !== value) {
|
|
3348
|
+
__el.innerHTML = value;
|
|
3349
|
+
this.instantiateChildComponents_();
|
|
3350
|
+
if (this.parentComponent) this.parentComponent.mountCompiledChildComponents_();
|
|
3351
|
+
}
|
|
3205
3352
|
}
|
|
3206
3353
|
} catch {}
|
|
3207
3354
|
}
|
|
3208
3355
|
};
|
|
3209
3356
|
var CardDescription = class extends Component {
|
|
3210
3357
|
template(props) {
|
|
3211
|
-
|
|
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>`;
|
|
3212
3365
|
}
|
|
3213
3366
|
__onPropChange(key, value) {
|
|
3214
3367
|
if (key === "class") try {
|
|
@@ -3223,14 +3376,24 @@ var CardDescription = class extends Component {
|
|
|
3223
3376
|
if (key === "children") try {
|
|
3224
3377
|
const __el = this.$(":scope");
|
|
3225
3378
|
if (__el) {
|
|
3226
|
-
if (__el.
|
|
3379
|
+
if (__el.innerHTML !== value) {
|
|
3380
|
+
__el.innerHTML = value;
|
|
3381
|
+
this.instantiateChildComponents_();
|
|
3382
|
+
if (this.parentComponent) this.parentComponent.mountCompiledChildComponents_();
|
|
3383
|
+
}
|
|
3227
3384
|
}
|
|
3228
3385
|
} catch {}
|
|
3229
3386
|
}
|
|
3230
3387
|
};
|
|
3231
3388
|
var CardContent = class extends Component {
|
|
3232
3389
|
template(props) {
|
|
3233
|
-
|
|
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>`;
|
|
3234
3397
|
}
|
|
3235
3398
|
__onPropChange(key, value) {
|
|
3236
3399
|
if (key === "class") try {
|
|
@@ -3245,14 +3408,24 @@ var CardContent = class extends Component {
|
|
|
3245
3408
|
if (key === "children") try {
|
|
3246
3409
|
const __el = this.$(":scope");
|
|
3247
3410
|
if (__el) {
|
|
3248
|
-
if (__el.
|
|
3411
|
+
if (__el.innerHTML !== value) {
|
|
3412
|
+
__el.innerHTML = value;
|
|
3413
|
+
this.instantiateChildComponents_();
|
|
3414
|
+
if (this.parentComponent) this.parentComponent.mountCompiledChildComponents_();
|
|
3415
|
+
}
|
|
3249
3416
|
}
|
|
3250
3417
|
} catch {}
|
|
3251
3418
|
}
|
|
3252
3419
|
};
|
|
3253
3420
|
var CardFooter = class extends Component {
|
|
3254
3421
|
template(props) {
|
|
3255
|
-
|
|
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>`;
|
|
3256
3429
|
}
|
|
3257
3430
|
__onPropChange(key, value) {
|
|
3258
3431
|
if (key === "class") try {
|
|
@@ -3267,7 +3440,11 @@ var CardFooter = class extends Component {
|
|
|
3267
3440
|
if (key === "children") try {
|
|
3268
3441
|
const __el = this.$(":scope");
|
|
3269
3442
|
if (__el) {
|
|
3270
|
-
if (__el.
|
|
3443
|
+
if (__el.innerHTML !== value) {
|
|
3444
|
+
__el.innerHTML = value;
|
|
3445
|
+
this.instantiateChildComponents_();
|
|
3446
|
+
if (this.parentComponent) this.parentComponent.mountCompiledChildComponents_();
|
|
3447
|
+
}
|
|
3271
3448
|
}
|
|
3272
3449
|
} catch {}
|
|
3273
3450
|
}
|
|
@@ -3276,7 +3453,8 @@ var CardFooter = class extends Component {
|
|
|
3276
3453
|
//#region src/components/input.tsx
|
|
3277
3454
|
var Input = class extends Component {
|
|
3278
3455
|
template(props) {
|
|
3279
|
-
|
|
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}"`} />`;
|
|
3280
3458
|
}
|
|
3281
3459
|
get events() {
|
|
3282
3460
|
return { input: { [`#${this.id}`]: this.__event_input_0 } };
|
|
@@ -3336,7 +3514,8 @@ var Input = class extends Component {
|
|
|
3336
3514
|
//#region src/components/textarea.tsx
|
|
3337
3515
|
var Textarea = class extends Component {
|
|
3338
3516
|
template(props) {
|
|
3339
|
-
|
|
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>`;
|
|
3340
3519
|
}
|
|
3341
3520
|
get events() {
|
|
3342
3521
|
return { input: { [`#${this.id}`]: this.__event_input_0 } };
|
|
@@ -3393,7 +3572,8 @@ var Textarea = class extends Component {
|
|
|
3393
3572
|
//#region src/components/label.tsx
|
|
3394
3573
|
var Label = class extends Component {
|
|
3395
3574
|
template(props) {
|
|
3396
|
-
|
|
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>`;
|
|
3397
3577
|
}
|
|
3398
3578
|
__onPropChange(key, value) {
|
|
3399
3579
|
if (key === "class") try {
|
|
@@ -3413,7 +3593,11 @@ var Label = class extends Component {
|
|
|
3413
3593
|
if (key === "children") try {
|
|
3414
3594
|
const __el = this.$(":scope");
|
|
3415
3595
|
if (__el) {
|
|
3416
|
-
if (__el.
|
|
3596
|
+
if (__el.innerHTML !== value) {
|
|
3597
|
+
__el.innerHTML = value;
|
|
3598
|
+
this.instantiateChildComponents_();
|
|
3599
|
+
if (this.parentComponent) this.parentComponent.mountCompiledChildComponents_();
|
|
3600
|
+
}
|
|
3417
3601
|
}
|
|
3418
3602
|
} catch {}
|
|
3419
3603
|
}
|
|
@@ -3428,8 +3612,9 @@ const variants$1 = {
|
|
|
3428
3612
|
};
|
|
3429
3613
|
var Badge = class extends Component {
|
|
3430
3614
|
template(props) {
|
|
3615
|
+
Component._register(Component);
|
|
3431
3616
|
const variant = variants$1[props.variant || "default"] || variants$1.default;
|
|
3432
|
-
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 ? "" : ` 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>`;
|
|
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>`;
|
|
3433
3618
|
}
|
|
3434
3619
|
__onPropChange(key, value) {
|
|
3435
3620
|
if (key === "variant") try {
|
|
@@ -3451,7 +3636,11 @@ var Badge = class extends Component {
|
|
|
3451
3636
|
if (key === "children") try {
|
|
3452
3637
|
const __el = this.$(":scope");
|
|
3453
3638
|
if (__el) {
|
|
3454
|
-
if (__el.
|
|
3639
|
+
if (__el.innerHTML !== value) {
|
|
3640
|
+
__el.innerHTML = value;
|
|
3641
|
+
this.instantiateChildComponents_();
|
|
3642
|
+
if (this.parentComponent) this.parentComponent.mountCompiledChildComponents_();
|
|
3643
|
+
}
|
|
3455
3644
|
}
|
|
3456
3645
|
} catch {}
|
|
3457
3646
|
}
|
|
@@ -3464,8 +3653,11 @@ const variants = {
|
|
|
3464
3653
|
};
|
|
3465
3654
|
var Alert = class extends Component {
|
|
3466
3655
|
template(props) {
|
|
3656
|
+
Component._register(Component);
|
|
3657
|
+
Component._register(Component);
|
|
3658
|
+
Component._register(Component);
|
|
3467
3659
|
const variant = variants[props.variant || "default"] || variants.default;
|
|
3468
|
-
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 ? "" : ` 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>`;
|
|
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>`;
|
|
3469
3661
|
}
|
|
3470
3662
|
__onPropChange(key, value) {
|
|
3471
3663
|
if (key === "variant") try {
|
|
@@ -3487,14 +3679,21 @@ var Alert = class extends Component {
|
|
|
3487
3679
|
if (key === "children") try {
|
|
3488
3680
|
const __el = this.$(":scope");
|
|
3489
3681
|
if (__el) {
|
|
3490
|
-
if (__el.
|
|
3682
|
+
if (__el.innerHTML !== value) {
|
|
3683
|
+
__el.innerHTML = value;
|
|
3684
|
+
this.instantiateChildComponents_();
|
|
3685
|
+
if (this.parentComponent) this.parentComponent.mountCompiledChildComponents_();
|
|
3686
|
+
}
|
|
3491
3687
|
}
|
|
3492
3688
|
} catch {}
|
|
3493
3689
|
}
|
|
3494
3690
|
};
|
|
3495
3691
|
var AlertTitle = class extends Component {
|
|
3496
3692
|
template(props) {
|
|
3497
|
-
|
|
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>`;
|
|
3498
3697
|
}
|
|
3499
3698
|
__onPropChange(key, value) {
|
|
3500
3699
|
if (key === "class") try {
|
|
@@ -3509,14 +3708,21 @@ var AlertTitle = class extends Component {
|
|
|
3509
3708
|
if (key === "children") try {
|
|
3510
3709
|
const __el = this.$(":scope");
|
|
3511
3710
|
if (__el) {
|
|
3512
|
-
if (__el.
|
|
3711
|
+
if (__el.innerHTML !== value) {
|
|
3712
|
+
__el.innerHTML = value;
|
|
3713
|
+
this.instantiateChildComponents_();
|
|
3714
|
+
if (this.parentComponent) this.parentComponent.mountCompiledChildComponents_();
|
|
3715
|
+
}
|
|
3513
3716
|
}
|
|
3514
3717
|
} catch {}
|
|
3515
3718
|
}
|
|
3516
3719
|
};
|
|
3517
3720
|
var AlertDescription = class extends Component {
|
|
3518
3721
|
template(props) {
|
|
3519
|
-
|
|
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>`;
|
|
3520
3726
|
}
|
|
3521
3727
|
__onPropChange(key, value) {
|
|
3522
3728
|
if (key === "class") try {
|
|
@@ -3531,7 +3737,11 @@ var AlertDescription = class extends Component {
|
|
|
3531
3737
|
if (key === "children") try {
|
|
3532
3738
|
const __el = this.$(":scope");
|
|
3533
3739
|
if (__el) {
|
|
3534
|
-
if (__el.
|
|
3740
|
+
if (__el.innerHTML !== value) {
|
|
3741
|
+
__el.innerHTML = value;
|
|
3742
|
+
this.instantiateChildComponents_();
|
|
3743
|
+
if (this.parentComponent) this.parentComponent.mountCompiledChildComponents_();
|
|
3744
|
+
}
|
|
3535
3745
|
}
|
|
3536
3746
|
} catch {}
|
|
3537
3747
|
}
|
|
@@ -3540,8 +3750,9 @@ var AlertDescription = class extends Component {
|
|
|
3540
3750
|
//#region src/components/separator.tsx
|
|
3541
3751
|
var Separator = class extends Component {
|
|
3542
3752
|
template(props) {
|
|
3753
|
+
Component._register(Component);
|
|
3543
3754
|
const isVertical = props.orientation === "vertical";
|
|
3544
|
-
return `<div id="${this.id}"${cn("shrink-0 bg-border", isVertical ? "h-full w-[1px]" : "h-[1px] w-full", props.class) == null ? "" : ` 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>`;
|
|
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>`;
|
|
3545
3756
|
}
|
|
3546
3757
|
__onPropChange(key, value) {
|
|
3547
3758
|
if (key === "orientation") try {
|
|
@@ -3577,7 +3788,8 @@ var Separator = class extends Component {
|
|
|
3577
3788
|
//#region src/components/skeleton.tsx
|
|
3578
3789
|
var Skeleton = class extends Component {
|
|
3579
3790
|
template(props) {
|
|
3580
|
-
|
|
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>`;
|
|
3581
3793
|
}
|
|
3582
3794
|
__onPropChange(key, value) {
|
|
3583
3795
|
if (key === "class") try {
|
|
@@ -3592,6 +3804,530 @@ var Skeleton = class extends Component {
|
|
|
3592
3804
|
}
|
|
3593
3805
|
};
|
|
3594
3806
|
//#endregion
|
|
3595
|
-
|
|
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
|
|
4331
|
+
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 };
|
|
3596
4332
|
|
|
3597
4333
|
//# sourceMappingURL=index.mjs.map
|