@threadlabs/looma 0.49.4 → 0.50.1
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/components/ui-cluster/ui-cluster.html +30 -2
- package/components/ui-cluster/ui-cluster.js +107 -0
- package/components/ui-combobox/ui-combobox.html +7 -5
- package/components/ui-combobox/ui-combobox.js +2 -2
- package/dist/index.js +60 -59
- package/docs/catalog.json +75 -11
- package/docs/framework-examples.mjs +26 -22
- package/editor/components.css +19 -1
- package/editor/index.js +248 -30
- package/package.json +1 -1
- package/styles/ui-cluster.css +19 -1
- package/styles/ui-combobox.css +2 -2
- package/vanilla/UiCluster.d.ts +2 -0
- package/vanilla/UiCluster.js +52 -14
- package/vanilla/UiCombobox.d.ts +1 -0
- package/vanilla/UiCombobox.js +38 -34
package/editor/index.js
CHANGED
|
@@ -2369,8 +2369,8 @@ function setCodeBlockLanguage(editor, pos, value, names) {
|
|
|
2369
2369
|
}
|
|
2370
2370
|
//#endregion
|
|
2371
2371
|
//#region components/ui-button/ui-button.js
|
|
2372
|
-
var ui_button_exports = /* @__PURE__ */ __exportAll({ connect: () => connect$
|
|
2373
|
-
function connect$
|
|
2372
|
+
var ui_button_exports = /* @__PURE__ */ __exportAll({ connect: () => connect$12 });
|
|
2373
|
+
function connect$12(host) {
|
|
2374
2374
|
const onClick = (event) => {
|
|
2375
2375
|
if (!host.props.disabled.value && !host.props.loading.value && !host.props.pending.value) return;
|
|
2376
2376
|
event.preventDefault();
|
|
@@ -2409,12 +2409,12 @@ var T0$16 = [
|
|
|
2409
2409
|
"\n "
|
|
2410
2410
|
];
|
|
2411
2411
|
var T1$16 = ["ui-spinner", ["size", "sm"]];
|
|
2412
|
-
var T2$
|
|
2412
|
+
var T2$12 = [
|
|
2413
2413
|
"",
|
|
2414
2414
|
[],
|
|
2415
2415
|
4
|
|
2416
2416
|
];
|
|
2417
|
-
var T3$
|
|
2417
|
+
var T3$8 = ["", []];
|
|
2418
2418
|
var T4$6 = ["", []];
|
|
2419
2419
|
var T5$5 = [
|
|
2420
2420
|
"",
|
|
@@ -2522,8 +2522,8 @@ var T18$1 = ["", []];
|
|
|
2522
2522
|
var T19$1 = ["", []];
|
|
2523
2523
|
var P0$16;
|
|
2524
2524
|
var P1$16;
|
|
2525
|
-
var P2$
|
|
2526
|
-
var P3$
|
|
2525
|
+
var P2$12;
|
|
2526
|
+
var P3$8;
|
|
2527
2527
|
var P4$6;
|
|
2528
2528
|
var P5$5;
|
|
2529
2529
|
var P6$3;
|
|
@@ -2547,7 +2547,7 @@ var S$18 = {
|
|
|
2547
2547
|
g: "ui-button",
|
|
2548
2548
|
k: 0,
|
|
2549
2549
|
r: readonlyView,
|
|
2550
|
-
a: (host, I) => C$
|
|
2550
|
+
a: (host, I) => C$12(host, I),
|
|
2551
2551
|
b: generatedInputs
|
|
2552
2552
|
};
|
|
2553
2553
|
var A$3 = [
|
|
@@ -2847,7 +2847,7 @@ var D$18 = {
|
|
|
2847
2847
|
}
|
|
2848
2848
|
}
|
|
2849
2849
|
};
|
|
2850
|
-
var C$
|
|
2850
|
+
var C$12 = (host) => activateModule(ui_button_exports, host);
|
|
2851
2851
|
function createUiButton(options = {}, html) {
|
|
2852
2852
|
const { attributes = {}, children = [], slots = {}, ...componentProps } = options;
|
|
2853
2853
|
const v = [
|
|
@@ -2982,7 +2982,7 @@ function createUiButton(options = {}, html) {
|
|
|
2982
2982
|
return { n: (P1$16 ??= buildTemplate(T1$16)).cloneNode(true) };
|
|
2983
2983
|
};
|
|
2984
2984
|
const m2 = (d) => {
|
|
2985
|
-
const n = (P2$
|
|
2985
|
+
const n = (P2$12 ??= buildTemplate(T2$12)).cloneNode(true);
|
|
2986
2986
|
const t0 = n.firstChild;
|
|
2987
2987
|
const r = {
|
|
2988
2988
|
n,
|
|
@@ -3009,7 +3009,7 @@ function createUiButton(options = {}, html) {
|
|
|
3009
3009
|
} else if (r.b0 !== void 0) r.b0;
|
|
3010
3010
|
};
|
|
3011
3011
|
const m3 = (d) => {
|
|
3012
|
-
return { n: (P3$
|
|
3012
|
+
return { n: (P3$8 ??= buildTemplate(T3$8)).cloneNode(true) };
|
|
3013
3013
|
};
|
|
3014
3014
|
const m4 = (d) => {
|
|
3015
3015
|
return { n: (P4$6 ??= buildTemplate(T4$6)).cloneNode(true) };
|
|
@@ -4331,13 +4331,13 @@ function createIdResolver(document, onLate) {
|
|
|
4331
4331
|
}
|
|
4332
4332
|
//#endregion
|
|
4333
4333
|
//#region components/ui-affordance-scope/ui-affordance-scope.js
|
|
4334
|
-
var ui_affordance_scope_exports = /* @__PURE__ */ __exportAll({ connect: () => connect$
|
|
4334
|
+
var ui_affordance_scope_exports = /* @__PURE__ */ __exportAll({ connect: () => connect$11 });
|
|
4335
4335
|
function distance(point, rect) {
|
|
4336
4336
|
const dx = Math.max(rect.left - point.x, 0, point.x - rect.right);
|
|
4337
4337
|
const dy = Math.max(rect.top - point.y, 0, point.y - rect.bottom);
|
|
4338
4338
|
return Math.hypot(dx, dy);
|
|
4339
4339
|
}
|
|
4340
|
-
function connect$
|
|
4340
|
+
function connect$11(host) {
|
|
4341
4341
|
const element = host.element;
|
|
4342
4342
|
const owner = element.ownerDocument.defaultView;
|
|
4343
4343
|
let anchors = [];
|
|
@@ -4429,7 +4429,7 @@ var S$17 = {
|
|
|
4429
4429
|
t: ["b"],
|
|
4430
4430
|
f: import.meta.url,
|
|
4431
4431
|
g: "ui-affordance-scope",
|
|
4432
|
-
a: (host, I) => C$
|
|
4432
|
+
a: (host, I) => C$11(host, I),
|
|
4433
4433
|
b: generatedInputs,
|
|
4434
4434
|
i: [false]
|
|
4435
4435
|
};
|
|
@@ -4455,7 +4455,7 @@ var D$17 = {
|
|
|
4455
4455
|
}
|
|
4456
4456
|
}
|
|
4457
4457
|
};
|
|
4458
|
-
var C$
|
|
4458
|
+
var C$11 = (host) => activateModule(ui_affordance_scope_exports, host);
|
|
4459
4459
|
function createUiAffordanceScope(options = {}, html) {
|
|
4460
4460
|
const { attributes = {}, children = [], slots = {}, ...componentProps } = options;
|
|
4461
4461
|
const element = document.createElement("span");
|
|
@@ -4513,21 +4513,172 @@ function createUiAffordanceScope(options = {}, html) {
|
|
|
4513
4513
|
}
|
|
4514
4514
|
defineComponent("ui-affordance-scope", createUiAffordanceScope, ["guide", "nearRadius"]);
|
|
4515
4515
|
//#endregion
|
|
4516
|
+
//#region components/ui-cluster/ui-cluster.js
|
|
4517
|
+
var ui_cluster_exports = /* @__PURE__ */ __exportAll({ connect: () => connect$10 });
|
|
4518
|
+
/** Bound a wrapping group by complete rows while preserving its overflow action. */
|
|
4519
|
+
function connect$10(host) {
|
|
4520
|
+
const element = host.element;
|
|
4521
|
+
const view = element.ownerDocument.defaultView;
|
|
4522
|
+
const overflow = host.refs.overflow;
|
|
4523
|
+
const trailing = host.refs.trailing;
|
|
4524
|
+
const collapsed = /* @__PURE__ */ new Set();
|
|
4525
|
+
const observed = /* @__PURE__ */ new Set();
|
|
4526
|
+
let limit = 0;
|
|
4527
|
+
let frame = 0;
|
|
4528
|
+
let count = 0;
|
|
4529
|
+
let alive = true;
|
|
4530
|
+
function report(next) {
|
|
4531
|
+
overflow.hidden = next === 0;
|
|
4532
|
+
host.state.overflowCount = next;
|
|
4533
|
+
if (next !== count) host.dispatch("overflow-change", { count: next });
|
|
4534
|
+
count = next;
|
|
4535
|
+
}
|
|
4536
|
+
function restore() {
|
|
4537
|
+
for (const item of collapsed) item.removeAttribute("hidden");
|
|
4538
|
+
collapsed.clear();
|
|
4539
|
+
}
|
|
4540
|
+
function rows(items) {
|
|
4541
|
+
let total = 0;
|
|
4542
|
+
let end = -Infinity;
|
|
4543
|
+
for (const item of items) {
|
|
4544
|
+
const box = item.getBoundingClientRect();
|
|
4545
|
+
if (!box.width || !box.height) continue;
|
|
4546
|
+
if (box.top >= end - .5) total++;
|
|
4547
|
+
end = Math.max(end, box.bottom);
|
|
4548
|
+
}
|
|
4549
|
+
return total;
|
|
4550
|
+
}
|
|
4551
|
+
function measure() {
|
|
4552
|
+
frame = 0;
|
|
4553
|
+
if (!alive || !limit) return;
|
|
4554
|
+
const active = element.ownerDocument.activeElement;
|
|
4555
|
+
restore();
|
|
4556
|
+
overflow.hidden = true;
|
|
4557
|
+
const items = Array.from(element.children).filter((item) => item !== overflow && item !== trailing && !item.hasAttribute("hidden"));
|
|
4558
|
+
for (const item of observed) if (!items.includes(item)) {
|
|
4559
|
+
resize.unobserve(item);
|
|
4560
|
+
observed.delete(item);
|
|
4561
|
+
}
|
|
4562
|
+
for (const item of items) if (!observed.has(item)) {
|
|
4563
|
+
resize.observe(item);
|
|
4564
|
+
observed.add(item);
|
|
4565
|
+
}
|
|
4566
|
+
if (!element.clientWidth || !overflow.childElementCount || getComputedStyle(element).flexWrap === "nowrap" || rows([...items, trailing]) <= limit) {
|
|
4567
|
+
report(0);
|
|
4568
|
+
return;
|
|
4569
|
+
}
|
|
4570
|
+
overflow.hidden = false;
|
|
4571
|
+
const showPrefix = (count) => {
|
|
4572
|
+
for (const [index, item] of items.entries()) {
|
|
4573
|
+
item.toggleAttribute("hidden", index >= count);
|
|
4574
|
+
if (index >= count) collapsed.add(item);
|
|
4575
|
+
else collapsed.delete(item);
|
|
4576
|
+
}
|
|
4577
|
+
};
|
|
4578
|
+
let visible = 0;
|
|
4579
|
+
let upper = items.length;
|
|
4580
|
+
while (visible < upper) {
|
|
4581
|
+
const candidate = Math.ceil((visible + upper) / 2);
|
|
4582
|
+
showPrefix(candidate);
|
|
4583
|
+
if (rows([
|
|
4584
|
+
...items.slice(0, candidate),
|
|
4585
|
+
overflow,
|
|
4586
|
+
trailing
|
|
4587
|
+
]) <= limit) visible = candidate;
|
|
4588
|
+
else upper = candidate - 1;
|
|
4589
|
+
}
|
|
4590
|
+
showPrefix(visible);
|
|
4591
|
+
report(items.length - visible);
|
|
4592
|
+
if (active && Array.from(collapsed).some((item) => item.contains(active))) overflow.querySelector("button, a[href], input, [tabindex=\"0\"]")?.focus({ preventScroll: true });
|
|
4593
|
+
}
|
|
4594
|
+
const schedule = () => {
|
|
4595
|
+
if (alive && limit && !frame) frame = view.requestAnimationFrame(measure);
|
|
4596
|
+
};
|
|
4597
|
+
let resize;
|
|
4598
|
+
let changes;
|
|
4599
|
+
const stop = host.effect(() => {
|
|
4600
|
+
const requested = Number(host.props.maxRows.value);
|
|
4601
|
+
host.props.wrap.value;
|
|
4602
|
+
limit = Number.isFinite(requested) ? Math.max(0, Math.floor(requested)) : 0;
|
|
4603
|
+
resize?.disconnect();
|
|
4604
|
+
observed.clear();
|
|
4605
|
+
changes?.disconnect();
|
|
4606
|
+
element.ownerDocument.fonts?.removeEventListener("loadingdone", schedule);
|
|
4607
|
+
if (limit) {
|
|
4608
|
+
resize ??= new view.ResizeObserver(schedule);
|
|
4609
|
+
changes ??= new view.MutationObserver(schedule);
|
|
4610
|
+
resize.observe(element);
|
|
4611
|
+
resize.observe(overflow);
|
|
4612
|
+
resize.observe(trailing);
|
|
4613
|
+
changes.observe(element, {
|
|
4614
|
+
childList: true,
|
|
4615
|
+
subtree: true,
|
|
4616
|
+
characterData: true
|
|
4617
|
+
});
|
|
4618
|
+
element.ownerDocument.fonts?.addEventListener("loadingdone", schedule);
|
|
4619
|
+
schedule();
|
|
4620
|
+
} else {
|
|
4621
|
+
restore();
|
|
4622
|
+
report(0);
|
|
4623
|
+
}
|
|
4624
|
+
});
|
|
4625
|
+
return () => {
|
|
4626
|
+
alive = false;
|
|
4627
|
+
stop();
|
|
4628
|
+
resize?.disconnect();
|
|
4629
|
+
changes?.disconnect();
|
|
4630
|
+
element.ownerDocument.fonts?.removeEventListener("loadingdone", schedule);
|
|
4631
|
+
if (frame) view.cancelAnimationFrame(frame);
|
|
4632
|
+
restore();
|
|
4633
|
+
};
|
|
4634
|
+
}
|
|
4635
|
+
//#endregion
|
|
4516
4636
|
//#region vanilla/UiCluster.js
|
|
4517
4637
|
var T0$14 = [
|
|
4518
4638
|
"",
|
|
4519
4639
|
[],
|
|
4520
|
-
|
|
4640
|
+
"\n ",
|
|
4641
|
+
4,
|
|
4642
|
+
"\n ",
|
|
4643
|
+
[
|
|
4644
|
+
"span",
|
|
4645
|
+
["class", "overflow"],
|
|
4646
|
+
4
|
|
4647
|
+
],
|
|
4648
|
+
"\n ",
|
|
4649
|
+
[
|
|
4650
|
+
"span",
|
|
4651
|
+
["class", "trailing"],
|
|
4652
|
+
4
|
|
4653
|
+
],
|
|
4654
|
+
"\n "
|
|
4521
4655
|
];
|
|
4522
4656
|
var T1$14 = ["", []];
|
|
4657
|
+
var T2$11 = ["", []];
|
|
4658
|
+
var T3$7 = ["", []];
|
|
4523
4659
|
var P0$14;
|
|
4524
4660
|
var P1$14;
|
|
4661
|
+
var P2$11;
|
|
4662
|
+
var P3$7;
|
|
4525
4663
|
var S$16 = {
|
|
4526
|
-
n: [],
|
|
4527
|
-
t: [],
|
|
4664
|
+
n: ["overflowCount"],
|
|
4665
|
+
t: ["i"],
|
|
4528
4666
|
f: import.meta.url,
|
|
4529
4667
|
g: "ui-cluster",
|
|
4530
|
-
|
|
4668
|
+
d: { "overflow-change": [
|
|
4669
|
+
detailCheck(checkObject([[
|
|
4670
|
+
"count",
|
|
4671
|
+
checkInteger,
|
|
4672
|
+
false
|
|
4673
|
+
]], false)),
|
|
4674
|
+
true,
|
|
4675
|
+
true,
|
|
4676
|
+
false
|
|
4677
|
+
] },
|
|
4678
|
+
x: dispatchDeclared,
|
|
4679
|
+
a: (host, I) => C$10(host, I),
|
|
4680
|
+
b: generatedInputs,
|
|
4681
|
+
i: [0]
|
|
4531
4682
|
};
|
|
4532
4683
|
var D$16 = {
|
|
4533
4684
|
g: "ui-cluster",
|
|
@@ -4581,6 +4732,14 @@ var D$16 = {
|
|
|
4581
4732
|
j: 0,
|
|
4582
4733
|
m: ["p", formatOf(keywordFormat)]
|
|
4583
4734
|
},
|
|
4735
|
+
"maxRows": {
|
|
4736
|
+
"required": false,
|
|
4737
|
+
"default": 0,
|
|
4738
|
+
c: checkInteger,
|
|
4739
|
+
t: "integer",
|
|
4740
|
+
j: 0,
|
|
4741
|
+
m: "i"
|
|
4742
|
+
},
|
|
4584
4743
|
"padding": {
|
|
4585
4744
|
"required": false,
|
|
4586
4745
|
"values": [
|
|
@@ -4620,6 +4779,7 @@ var D$16 = {
|
|
|
4620
4779
|
}
|
|
4621
4780
|
}
|
|
4622
4781
|
};
|
|
4782
|
+
var C$10 = (host) => activateModule(ui_cluster_exports, host);
|
|
4623
4783
|
function createUiCluster(options = {}, html) {
|
|
4624
4784
|
const { attributes = {}, children = [], slots = {}, ...componentProps } = options;
|
|
4625
4785
|
const element = document.createElement("div");
|
|
@@ -4630,6 +4790,8 @@ function createUiCluster(options = {}, html) {
|
|
|
4630
4790
|
element.setAttribute("data-component", "ui-cluster");
|
|
4631
4791
|
element.append((P0$14 ??= buildTemplate(T0$14)).cloneNode(true));
|
|
4632
4792
|
const v = [
|
|
4793
|
+
0,
|
|
4794
|
+
null,
|
|
4633
4795
|
null,
|
|
4634
4796
|
null,
|
|
4635
4797
|
null,
|
|
@@ -4642,9 +4804,20 @@ function createUiCluster(options = {}, html) {
|
|
|
4642
4804
|
const m1 = (d) => {
|
|
4643
4805
|
return { n: (P1$14 ??= buildTemplate(T1$14)).cloneNode(true) };
|
|
4644
4806
|
};
|
|
4807
|
+
const m2 = (d) => {
|
|
4808
|
+
return { n: (P2$11 ??= buildTemplate(T2$11)).cloneNode(true) };
|
|
4809
|
+
};
|
|
4810
|
+
const m3 = (d) => {
|
|
4811
|
+
return { n: (P3$7 ??= buildTemplate(T3$7)).cloneNode(true) };
|
|
4812
|
+
};
|
|
4645
4813
|
const p0 = (r, c, d) => {
|
|
4646
|
-
if (c &
|
|
4647
|
-
const
|
|
4814
|
+
if (c & 1) {
|
|
4815
|
+
const x0 = v[0] === 0;
|
|
4816
|
+
const s0 = toAttribute(x0, "hidden");
|
|
4817
|
+
if (s0 !== r.v0) writeAttribute(r.a1, "hidden", r.v0 = s0);
|
|
4818
|
+
}
|
|
4819
|
+
if (c & 478) {
|
|
4820
|
+
const s1 = hostState([
|
|
4648
4821
|
"fixed",
|
|
4649
4822
|
"padding",
|
|
4650
4823
|
"paddingEnd",
|
|
@@ -4653,16 +4826,40 @@ function createUiCluster(options = {}, html) {
|
|
|
4653
4826
|
"justify",
|
|
4654
4827
|
"wrap"
|
|
4655
4828
|
], [
|
|
4656
|
-
v[1],
|
|
4657
|
-
v[4],
|
|
4658
|
-
v[5],
|
|
4659
4829
|
v[2],
|
|
4660
|
-
v[
|
|
4830
|
+
v[6],
|
|
4831
|
+
v[7],
|
|
4661
4832
|
v[3],
|
|
4662
|
-
v[
|
|
4833
|
+
v[1],
|
|
4834
|
+
v[4],
|
|
4835
|
+
v[8]
|
|
4663
4836
|
]);
|
|
4664
|
-
if (
|
|
4837
|
+
if (s1 !== r.v1) writeAttribute(r.n, "data-ui-cluster-state", (r.v1 = s1) === "" ? null : s1);
|
|
4665
4838
|
}
|
|
4839
|
+
if (r.f1 === void 0) {
|
|
4840
|
+
r.f1 = 1;
|
|
4841
|
+
const at = fillSlot(r.a2, r.e1, "overflow", J, false, void 0, d);
|
|
4842
|
+
if (Array.isArray(at)) (r.z ??= []).push(() => {
|
|
4843
|
+
at[0].l.delete(at[1]);
|
|
4844
|
+
dispose(at[1]);
|
|
4845
|
+
});
|
|
4846
|
+
else if (at !== void 0) {
|
|
4847
|
+
r.b1 = m2(d);
|
|
4848
|
+
at.before(r.b1.n);
|
|
4849
|
+
}
|
|
4850
|
+
} else if (r.b1 !== void 0) r.b1;
|
|
4851
|
+
if (r.f2 === void 0) {
|
|
4852
|
+
r.f2 = 1;
|
|
4853
|
+
const at = fillSlot(r.a4, r.e2, "trailing", J, false, void 0, d);
|
|
4854
|
+
if (Array.isArray(at)) (r.z ??= []).push(() => {
|
|
4855
|
+
at[0].l.delete(at[1]);
|
|
4856
|
+
dispose(at[1]);
|
|
4857
|
+
});
|
|
4858
|
+
else if (at !== void 0) {
|
|
4859
|
+
r.b2 = m3(d);
|
|
4860
|
+
at.before(r.b2.n);
|
|
4861
|
+
}
|
|
4862
|
+
} else if (r.b2 !== void 0) r.b2;
|
|
4666
4863
|
if (r.f0 === void 0) {
|
|
4667
4864
|
r.f0 = 1;
|
|
4668
4865
|
const at = fillSlot(r.a0, r.e0, "", J, false, void 0, d);
|
|
@@ -4676,19 +4873,39 @@ function createUiCluster(options = {}, html) {
|
|
|
4676
4873
|
}
|
|
4677
4874
|
} else if (r.b0 !== void 0) r.b0;
|
|
4678
4875
|
};
|
|
4679
|
-
const t0 = element.firstChild;
|
|
4876
|
+
const t0 = element.firstChild.nextSibling;
|
|
4877
|
+
const t1 = t0.nextSibling.nextSibling.nextSibling;
|
|
4878
|
+
const t2 = t1.firstChild;
|
|
4879
|
+
const t3 = t1.nextSibling.nextSibling;
|
|
4880
|
+
const t4 = t3.firstChild;
|
|
4680
4881
|
const R = {
|
|
4681
4882
|
n: element,
|
|
4682
|
-
|
|
4883
|
+
a1: t1,
|
|
4884
|
+
v0: null,
|
|
4885
|
+
v1: void 0,
|
|
4683
4886
|
a0: t0,
|
|
4684
4887
|
e0: t0.nextSibling,
|
|
4685
4888
|
b0: void 0,
|
|
4686
|
-
f0: void 0
|
|
4889
|
+
f0: void 0,
|
|
4890
|
+
a2: t2,
|
|
4891
|
+
e1: t2.nextSibling,
|
|
4892
|
+
b1: void 0,
|
|
4893
|
+
f1: void 0,
|
|
4894
|
+
a4: t4,
|
|
4895
|
+
e2: t4.nextSibling,
|
|
4896
|
+
b2: void 0,
|
|
4897
|
+
f2: void 0
|
|
4687
4898
|
};
|
|
4688
4899
|
const I = { B };
|
|
4689
4900
|
const J = project(I, children, slots);
|
|
4690
|
-
|
|
4901
|
+
I.R = /* @__PURE__ */ new Set();
|
|
4902
|
+
attachGeneratedController(element, S$16, v, (c, d) => {
|
|
4903
|
+
((c, d) => p0(R, c, d))(c, d);
|
|
4904
|
+
for (const f of I.R) f(c, d);
|
|
4905
|
+
}, void 0, void 0, I);
|
|
4691
4906
|
manageProps(I);
|
|
4907
|
+
I.r["overflow"] = t1;
|
|
4908
|
+
I.r["trailing"] = t3;
|
|
4692
4909
|
return element;
|
|
4693
4910
|
}
|
|
4694
4911
|
defineComponent("ui-cluster", createUiCluster, [
|
|
@@ -4696,6 +4913,7 @@ defineComponent("ui-cluster", createUiCluster, [
|
|
|
4696
4913
|
"fixed",
|
|
4697
4914
|
"gap",
|
|
4698
4915
|
"justify",
|
|
4916
|
+
"maxRows",
|
|
4699
4917
|
"padding",
|
|
4700
4918
|
"paddingEnd",
|
|
4701
4919
|
"wrap"
|
package/package.json
CHANGED
package/styles/ui-cluster.css
CHANGED
|
@@ -18,6 +18,20 @@
|
|
|
18
18
|
margin: 0 !important;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
.overflow,
|
|
22
|
+
.trailing {
|
|
23
|
+
display: flex !important;
|
|
24
|
+
align-items: center !important;
|
|
25
|
+
gap: inherit !important;
|
|
26
|
+
min-inline-size: 0;
|
|
27
|
+
max-inline-size: 100%;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.overflow[hidden],
|
|
31
|
+
.trailing:empty {
|
|
32
|
+
display: none !important;
|
|
33
|
+
}
|
|
34
|
+
|
|
21
35
|
:scope:where([data-component~="ui-cluster"])[data-ui-cluster-state~="fixed"] {
|
|
22
36
|
flex: none;
|
|
23
37
|
}
|
|
@@ -89,5 +103,9 @@
|
|
|
89
103
|
}
|
|
90
104
|
}
|
|
91
105
|
@scope ([data-component~="ui-cluster"]) to ([data-component]) {
|
|
92
|
-
|
|
106
|
+
:where([data-slotted], [data-slotted] *):is([hidden]) {
|
|
107
|
+
display: none !important;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/* A component that sets its display still honours the hidden attribute on its root. */
|
|
93
111
|
}
|
package/styles/ui-combobox.css
CHANGED
|
@@ -329,7 +329,7 @@
|
|
|
329
329
|
--_entry-row: max(1.5rem, var(--_item-row));
|
|
330
330
|
flex-wrap: wrap !important;
|
|
331
331
|
align-content: flex-start !important;
|
|
332
|
-
max-block-size: calc(var(--_max-rows) * var(--_entry-row) + (var(--_max-rows) - 1) * var(--ui-space-1));
|
|
332
|
+
max-block-size: calc(max(1, var(--_max-rows)) * var(--_entry-row) + (max(1, var(--_max-rows)) - 1) * var(--ui-space-1));
|
|
333
333
|
overflow-x: hidden;
|
|
334
334
|
overflow-y: auto;
|
|
335
335
|
}
|
|
@@ -703,7 +703,7 @@
|
|
|
703
703
|
--_entry-row: max(1.5rem, var(--_item-row));
|
|
704
704
|
flex-wrap: wrap !important;
|
|
705
705
|
align-content: flex-start !important;
|
|
706
|
-
max-block-size: calc(var(--_max-rows) * var(--_entry-row) + (var(--_max-rows) - 1) * var(--ui-space-1));
|
|
706
|
+
max-block-size: calc(max(1, var(--_max-rows)) * var(--_entry-row) + (max(1, var(--_max-rows)) - 1) * var(--ui-space-1));
|
|
707
707
|
overflow-x: hidden;
|
|
708
708
|
overflow-y: auto;
|
|
709
709
|
}
|
package/vanilla/UiCluster.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// Generated by HTML Next 1.0.0-alpha.76 for Vanilla DOM. Do not edit.
|
|
2
2
|
export interface UiClusterEventMap {
|
|
3
|
+
"overflow-change": CustomEvent<{ readonly count: number }>;
|
|
3
4
|
}
|
|
4
5
|
export interface UiClusterElement extends HTMLDivElement {
|
|
5
6
|
addEventListener<K extends keyof UiClusterEventMap>(type: K, listener: (this: UiClusterElement, event: UiClusterEventMap[K]) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
@@ -14,6 +15,7 @@ export interface UiClusterProps {
|
|
|
14
15
|
fixed?: boolean | null;
|
|
15
16
|
gap?: "xs" | "s" | "m" | "l" | "xl" | null;
|
|
16
17
|
justify?: "start" | "center" | "end" | "between" | null;
|
|
18
|
+
maxRows?: number | null;
|
|
17
19
|
padding?: "none" | "s" | "m" | "l" | null;
|
|
18
20
|
paddingEnd?: "none" | "s" | "m" | "l" | "xl" | null;
|
|
19
21
|
wrap?: "wrap" | "nowrap" | null;
|
package/vanilla/UiCluster.js
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
// Generated by HTML Next 1.0.0-alpha.76 for Vanilla DOM. Do not edit.
|
|
2
|
-
import { attachGeneratedController, buildTemplate, writeAttribute, dispose, formatOf, keywordFormat, hostState, acceptProps, manageProps, generatedInputs, project, fillSlot, checkBoolean, checkFormat, defineComponent } from "@nextwebwg/html-next/generated-runtime";
|
|
2
|
+
import { attachGeneratedController, buildTemplate, toAttribute, writeAttribute, dispatchDeclared, detailCheck, dispose, formatOf, keywordFormat, hostState, acceptProps, manageProps, generatedInputs, project, fillSlot, checkBoolean, checkFormat, checkInteger, checkObject, defineComponent, activateModule } from "@nextwebwg/html-next/generated-runtime";
|
|
3
|
+
import * as controller from "../components/ui-cluster/ui-cluster.js";
|
|
3
4
|
import "../styles/ui-cluster.css";
|
|
4
5
|
|
|
5
|
-
const T0 = ["",[],4];
|
|
6
|
+
const T0 = ["",[],"\n ",4,"\n ",["span",["class","overflow"],4],"\n ",["span",["class","trailing"],4],"\n "];
|
|
6
7
|
const T1 = ["",[]];
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
|
|
8
|
+
const T2 = ["",[]];
|
|
9
|
+
const T3 = ["",[]];
|
|
10
|
+
let P0, P1, P2, P3;
|
|
11
|
+
const S = { n: ["overflowCount"], t: ["i"], f: import.meta.url, g: "ui-cluster", d: { "overflow-change": [detailCheck(checkObject([["count", checkInteger, false]], false)), true, true, false] }, x: dispatchDeclared, a: (host, I) => C(host, I), b: generatedInputs, i: [0] };
|
|
12
|
+
const D = { g: "ui-cluster", props: { "align": { "required":false,"values":["start","center","end","stretch","baseline"], c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat)] }, "fixed": { "required":false,"default":false, c: checkBoolean, t: "boolean", j: 0, m: "b" }, "gap": { "required":false,"values":["xs","s","m","l","xl"], c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat)] }, "justify": { "required":false,"values":["start","center","end","between"], c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat)] }, "maxRows": { "required":false,"default":0, c: checkInteger, t: "integer", j: 0, m: "i" }, "padding": { "required":false,"values":["none","s","m","l"],"default":"none", c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat)] }, "paddingEnd": { "required":false,"values":["none","s","m","l","xl"],"default":"none", c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat)] }, "wrap": { "required":false,"values":["wrap","nowrap"], c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat)] } } };
|
|
13
|
+
const C = (host) => activateModule(controller, host);
|
|
10
14
|
|
|
11
15
|
export function createUiCluster(options = {}, html) {
|
|
12
16
|
const { attributes = {}, children = [], slots = {}, ...componentProps } = options;
|
|
@@ -17,7 +21,7 @@ export function createUiCluster(options = {}, html) {
|
|
|
17
21
|
}
|
|
18
22
|
element.setAttribute("data-component", "ui-cluster");
|
|
19
23
|
element.append((P0 ??= buildTemplate(T0)).cloneNode(true));
|
|
20
|
-
const v = [null, null, null, null, null, null, null];
|
|
24
|
+
const v = [0, null, null, null, null, null, null, null, null];
|
|
21
25
|
const B = acceptProps(element, D, S.n, v, componentProps, [], html);
|
|
22
26
|
const m1 = (d) => {
|
|
23
27
|
const n = (P1 ??= buildTemplate(T1)).cloneNode(true);
|
|
@@ -27,22 +31,56 @@ export function createUiCluster(options = {}, html) {
|
|
|
27
31
|
};
|
|
28
32
|
const p1 = (r, c, d) => {
|
|
29
33
|
};
|
|
34
|
+
const m2 = (d) => {
|
|
35
|
+
const n = (P2 ??= buildTemplate(T2)).cloneNode(true);
|
|
36
|
+
const r = { n };
|
|
37
|
+
p2(r, -1, d);
|
|
38
|
+
return r;
|
|
39
|
+
};
|
|
40
|
+
const p2 = (r, c, d) => {
|
|
41
|
+
};
|
|
42
|
+
const m3 = (d) => {
|
|
43
|
+
const n = (P3 ??= buildTemplate(T3)).cloneNode(true);
|
|
44
|
+
const r = { n };
|
|
45
|
+
p3(r, -1, d);
|
|
46
|
+
return r;
|
|
47
|
+
};
|
|
48
|
+
const p3 = (r, c, d) => {
|
|
49
|
+
};
|
|
30
50
|
const p0 = (r, c, d) => {
|
|
31
|
-
if (c &
|
|
32
|
-
const x0 =
|
|
33
|
-
const s0 = x0;
|
|
34
|
-
if (s0 !== r.v0) writeAttribute(r.
|
|
51
|
+
if (c & 1) {
|
|
52
|
+
const x0 = (v[0] === 0);
|
|
53
|
+
const s0 = toAttribute(x0, "hidden");
|
|
54
|
+
if (s0 !== r.v0) writeAttribute(r.a1, "hidden", r.v0 = s0);
|
|
55
|
+
}
|
|
56
|
+
if (c & 478) {
|
|
57
|
+
const x1 = hostState(["fixed","padding","paddingEnd","gap","align","justify","wrap"], [v[2], v[6], v[7], v[3], v[1], v[4], v[8]]);
|
|
58
|
+
const s1 = x1;
|
|
59
|
+
if (s1 !== r.v1) writeAttribute(r.n, "data-ui-cluster-state", (r.v1 = s1) === "" ? null : s1);
|
|
35
60
|
}
|
|
61
|
+
if (r.f1 === undefined) { r.f1 = 1; const at = fillSlot(r.a2, r.e1, "overflow", J, false, undefined, d);
|
|
62
|
+
if (Array.isArray(at)) (r.z ??= []).push(() => { at[0].l.delete(at[1]); dispose(at[1]); }); else if (at !== undefined) { r.b1 = m2(d); at.before(r.b1.n); } }
|
|
63
|
+
else if (r.b1 !== undefined) p2(r.b1, c, d);
|
|
64
|
+
if (r.f2 === undefined) { r.f2 = 1; const at = fillSlot(r.a4, r.e2, "trailing", J, false, undefined, d);
|
|
65
|
+
if (Array.isArray(at)) (r.z ??= []).push(() => { at[0].l.delete(at[1]); dispose(at[1]); }); else if (at !== undefined) { r.b2 = m3(d); at.before(r.b2.n); } }
|
|
66
|
+
else if (r.b2 !== undefined) p3(r.b2, c, d);
|
|
36
67
|
if (r.f0 === undefined) { r.f0 = 1; const at = fillSlot(r.a0, r.e0, "", J, false, undefined, d);
|
|
37
68
|
if (Array.isArray(at)) (r.z ??= []).push(() => { at[0].l.delete(at[1]); dispose(at[1]); }); else if (at !== undefined) { r.b0 = m1(d); at.before(r.b0.n); } }
|
|
38
69
|
else if (r.b0 !== undefined) p1(r.b0, c, d);
|
|
39
70
|
};
|
|
40
|
-
const t0 = element.firstChild;
|
|
41
|
-
const
|
|
71
|
+
const t0 = element.firstChild.nextSibling;
|
|
72
|
+
const t1 = t0.nextSibling.nextSibling.nextSibling;
|
|
73
|
+
const t2 = t1.firstChild;
|
|
74
|
+
const t3 = t1.nextSibling.nextSibling;
|
|
75
|
+
const t4 = t3.firstChild;
|
|
76
|
+
const R = { n: element, a1: t1, v0: null, v1: undefined, a0: t0, e0: t0.nextSibling, b0: undefined, f0: undefined, a2: t2, e1: t2.nextSibling, b1: undefined, f1: undefined, a4: t4, e2: t4.nextSibling, b2: undefined, f2: undefined };
|
|
42
77
|
const I = { B };
|
|
43
78
|
const J = project(I, children, slots);
|
|
44
|
-
|
|
79
|
+
I.R = new Set();
|
|
80
|
+
attachGeneratedController(element, S, v, (c, d) => { ((c, d) => p0(R, c, d))(c, d); for (const f of I.R) f(c, d); }, undefined, undefined, I);
|
|
45
81
|
manageProps(I);
|
|
82
|
+
I.r["overflow"] = t1;
|
|
83
|
+
I.r["trailing"] = t3;
|
|
46
84
|
return element;
|
|
47
85
|
}
|
|
48
|
-
defineComponent("ui-cluster", createUiCluster, ["align","fixed","gap","justify","padding","paddingEnd","wrap"]);
|
|
86
|
+
defineComponent("ui-cluster", createUiCluster, ["align","fixed","gap","justify","maxRows","padding","paddingEnd","wrap"]);
|
package/vanilla/UiCombobox.d.ts
CHANGED
|
@@ -29,6 +29,7 @@ export interface UiComboboxProps {
|
|
|
29
29
|
disabled?: boolean | null;
|
|
30
30
|
disclosure?: boolean | null;
|
|
31
31
|
filter?: "label" | "none" | null;
|
|
32
|
+
grow?: boolean | null;
|
|
32
33
|
help?: string | null;
|
|
33
34
|
invalid?: boolean | null;
|
|
34
35
|
items?: readonly ({ readonly id: string; readonly value: string; readonly label: string; readonly group?: string | null; readonly disabled?: boolean | null; readonly description?: string | null; readonly tag?: { readonly label: string; readonly tone?: "neutral" | "accent" | "info" | "success" | "warning" | "danger" | null; readonly color?: string | null } | null })[] | null;
|