@threadlabs/looma 0.6.1 → 0.6.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/components/ui-avatar/ui-avatar.html +13 -0
- package/components/ui-avatar-group/ui-avatar-group.html +7 -2
- package/components/ui-avatar-group/ui-avatar-group.js +3 -3
- package/components/ui-badge/ui-badge.html +14 -0
- package/components/ui-combobox/ui-combobox.html +112 -46
- package/components/ui-combobox/ui-combobox.js +14 -2
- package/components/ui-menu-item/ui-menu-item.html +13 -0
- package/components/ui-tabs/ui-tabs.html +13 -0
- package/components/ui-tooltip/ui-tooltip.html +3 -0
- package/components/ui-tooltip/ui-tooltip.js +24 -3
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/styles/ui-avatar-group.css +7 -2
- package/styles/ui-avatar.css +19 -0
- package/styles/ui-badge.css +21 -1
- package/styles/ui-combobox.css +52 -1
- package/styles/ui-menu-item.css +20 -1
- package/styles/ui-tabs.css +19 -0
- package/vanilla/UiCombobox.js +141 -119
- package/vanilla/UiTooltip.d.ts +1 -0
- package/vanilla/UiTooltip.js +1 -1
- package/vue/UiAvatar.vue +13 -0
- package/vue/UiAvatarGroup.vue +7 -2
- package/vue/UiBadge.vue +14 -0
- package/vue/UiCombobox.vue +135 -53
- package/vue/UiMenuItem.vue +13 -0
- package/vue/UiTabs.vue +13 -0
- package/vue/UiTooltip.d.ts +4 -0
- package/vue/UiTooltip.vue +6 -0
- package/vue/chunks/UiAvatar.js +1 -1
- package/vue/chunks/UiAvatarGroup.js +1 -1
- package/vue/chunks/UiBadge.js +1 -1
- package/vue/chunks/UiCombobox.js +66 -41
- package/vue/chunks/UiMenuItem.js +1 -1
- package/vue/chunks/UiTabs.js +1 -1
- package/vue/chunks/UiTooltip.js +5 -2
- package/vue/components.css +191 -89
- package/vue/editor/index.js +44 -4
package/vue/chunks/UiCombobox.js
CHANGED
|
@@ -6,16 +6,17 @@ import * as controllerModule from "@threadlabs/looma/components/ui-combobox/ui-c
|
|
|
6
6
|
//#region .build/vue/UiCombobox.vue?vue&type=script&setup=true&lang.ts
|
|
7
7
|
var _hoisted_1 = ["data-ui-combobox-state"];
|
|
8
8
|
var _hoisted_2 = ["for"];
|
|
9
|
-
var _hoisted_3 = {
|
|
9
|
+
var _hoisted_3 = { class: "control" };
|
|
10
|
+
var _hoisted_4 = {
|
|
10
11
|
class: "field",
|
|
11
12
|
ref: "field"
|
|
12
13
|
};
|
|
13
|
-
var
|
|
14
|
+
var _hoisted_5 = [
|
|
14
15
|
"data-index",
|
|
15
16
|
"disabled",
|
|
16
17
|
"aria-label"
|
|
17
18
|
];
|
|
18
|
-
var
|
|
19
|
+
var _hoisted_6 = [
|
|
19
20
|
"id",
|
|
20
21
|
"aria-controls",
|
|
21
22
|
"aria-expanded",
|
|
@@ -28,45 +29,45 @@ var _hoisted_5 = [
|
|
|
28
29
|
"readonly",
|
|
29
30
|
"required"
|
|
30
31
|
];
|
|
31
|
-
var
|
|
32
|
+
var _hoisted_7 = {
|
|
32
33
|
key: 1,
|
|
33
34
|
type: "button",
|
|
34
35
|
"data-combobox-action": "clear",
|
|
35
36
|
"aria-label": "Clear"
|
|
36
37
|
};
|
|
37
|
-
var _hoisted_7 = ["id", "disabled"];
|
|
38
38
|
var _hoisted_8 = ["aria-controls"];
|
|
39
|
-
var _hoisted_9 = ["
|
|
40
|
-
var _hoisted_10 = [
|
|
39
|
+
var _hoisted_9 = ["id", "disabled"];
|
|
40
|
+
var _hoisted_10 = ["hidden"];
|
|
41
|
+
var _hoisted_11 = [
|
|
41
42
|
"id",
|
|
42
43
|
"aria-label",
|
|
43
44
|
"aria-busy"
|
|
44
45
|
];
|
|
45
|
-
var
|
|
46
|
-
var
|
|
46
|
+
var _hoisted_12 = ["role", "aria-label"];
|
|
47
|
+
var _hoisted_13 = {
|
|
47
48
|
key: 0,
|
|
48
49
|
class: "group"
|
|
49
50
|
};
|
|
50
|
-
var
|
|
51
|
+
var _hoisted_14 = [
|
|
51
52
|
"id",
|
|
52
53
|
"aria-selected",
|
|
53
54
|
"aria-disabled",
|
|
54
55
|
"data-index"
|
|
55
56
|
];
|
|
56
|
-
var
|
|
57
|
-
var
|
|
58
|
-
var
|
|
57
|
+
var _hoisted_15 = { class: "primary" };
|
|
58
|
+
var _hoisted_16 = ["id", "data-index"];
|
|
59
|
+
var _hoisted_17 = {
|
|
59
60
|
key: 1,
|
|
60
61
|
class: "message"
|
|
61
62
|
};
|
|
62
|
-
var
|
|
63
|
-
var
|
|
63
|
+
var _hoisted_18 = ["id", "hidden"];
|
|
64
|
+
var _hoisted_19 = {
|
|
64
65
|
class: "sr-only",
|
|
65
66
|
role: "status",
|
|
66
67
|
"aria-live": "polite",
|
|
67
68
|
"aria-atomic": "true"
|
|
68
69
|
};
|
|
69
|
-
var
|
|
70
|
+
var _hoisted_20 = {
|
|
70
71
|
class: "authored-options",
|
|
71
72
|
hidden: "",
|
|
72
73
|
"aria-hidden": "true",
|
|
@@ -143,6 +144,7 @@ var UiCombobox_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__P
|
|
|
143
144
|
const popupElement = useTemplateRef("popup");
|
|
144
145
|
const listboxElement = useTemplateRef("listbox");
|
|
145
146
|
const optionsElement = useTemplateRef("options");
|
|
147
|
+
const internalItems = ref([]);
|
|
146
148
|
const raw = ref("");
|
|
147
149
|
const display = ref("");
|
|
148
150
|
const selected = ref(null);
|
|
@@ -327,6 +329,7 @@ var UiCombobox_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__P
|
|
|
327
329
|
})) ?? true;
|
|
328
330
|
}
|
|
329
331
|
function read(name) {
|
|
332
|
+
if (name === "internalItems") return internalItems.value;
|
|
330
333
|
if (name === "raw") return raw.value;
|
|
331
334
|
if (name === "display") return display.value;
|
|
332
335
|
if (name === "selected") return selected.value;
|
|
@@ -347,6 +350,10 @@ var UiCombobox_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__P
|
|
|
347
350
|
return props[name];
|
|
348
351
|
}
|
|
349
352
|
function write(name, value) {
|
|
353
|
+
if (name === "internalItems") {
|
|
354
|
+
internalItems.value = value;
|
|
355
|
+
return true;
|
|
356
|
+
}
|
|
350
357
|
if (name === "raw") {
|
|
351
358
|
raw.value = value;
|
|
352
359
|
return true;
|
|
@@ -512,9 +519,9 @@ var UiCombobox_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__P
|
|
|
512
519
|
for: `${uid.value}-input`,
|
|
513
520
|
class: normalizeClass({ "sr-only": __props.labelVisibility === "sr-only" })
|
|
514
521
|
}, [createTextVNode(toDisplayString(__props.label) + " ", 1), __props.required ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createTextVNode(" *")], 64)) : createCommentVNode("v-if", true)], 10, _hoisted_2),
|
|
515
|
-
createElementVNode("div", _hoisted_3, [
|
|
522
|
+
createElementVNode("div", _hoisted_3, [createElementVNode("div", _hoisted_4, [
|
|
516
523
|
renderSlot(_ctx.$slots, "start", {}, void 0, true),
|
|
517
|
-
__props.multiple ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(
|
|
524
|
+
__props.multiple ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(internalItems.value, (item, index) => {
|
|
518
525
|
return openBlock(), createElementBlock("button", {
|
|
519
526
|
key: item.id,
|
|
520
527
|
class: "item",
|
|
@@ -526,7 +533,7 @@ var UiCombobox_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__P
|
|
|
526
533
|
}, [renderSlot(_ctx.$slots, `item-${item.id}`, {}, () => [createVNode(UiBadge_default, null, {
|
|
527
534
|
default: withCtx(() => [createTextVNode(toDisplayString(item.label), 1)]),
|
|
528
535
|
_: 2
|
|
529
|
-
}, 1024)], true)], 8,
|
|
536
|
+
}, 1024)], true)], 8, _hoisted_5);
|
|
530
537
|
}), 128)) : createCommentVNode("v-if", true),
|
|
531
538
|
createElementVNode("input", {
|
|
532
539
|
role: "combobox",
|
|
@@ -544,8 +551,8 @@ var UiCombobox_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__P
|
|
|
544
551
|
readonly: __props.readonly,
|
|
545
552
|
required: __props.required,
|
|
546
553
|
ref: "input"
|
|
547
|
-
}, null, 40,
|
|
548
|
-
__props.clearable ? (openBlock(), createElementBlock("button",
|
|
554
|
+
}, null, 40, _hoisted_6),
|
|
555
|
+
__props.clearable ? (openBlock(), createElementBlock("button", _hoisted_7, [..._cache[0] || (_cache[0] = [createElementVNode("svg", {
|
|
549
556
|
class: "affordance-icon",
|
|
550
557
|
"aria-hidden": "true",
|
|
551
558
|
viewBox: "0 0 24 24",
|
|
@@ -554,21 +561,14 @@ var UiCombobox_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__P
|
|
|
554
561
|
"stroke-width": "2",
|
|
555
562
|
"stroke-linecap": "round"
|
|
556
563
|
}, [createElementVNode("path", { d: "M7 7l10 10M17 7 7 17" })], -1)])])) : createCommentVNode("v-if", true),
|
|
557
|
-
__props.help ? (openBlock(), createElementBlock("button", {
|
|
558
|
-
key: 2,
|
|
559
|
-
type: "button",
|
|
560
|
-
"aria-label": "Help",
|
|
561
|
-
id: `${uid.value}-help`,
|
|
562
|
-
disabled: __props.disabled
|
|
563
|
-
}, [..._cache[1] || (_cache[1] = [createElementVNode("span", { "aria-hidden": "true" }, "?", -1)])], 8, _hoisted_7)) : createCommentVNode("v-if", true),
|
|
564
564
|
__props.disclosure ? (openBlock(), createElementBlock("button", {
|
|
565
|
-
key:
|
|
565
|
+
key: 2,
|
|
566
566
|
type: "button",
|
|
567
567
|
"data-combobox-action": "disclosure",
|
|
568
568
|
tabindex: "-1",
|
|
569
569
|
"aria-label": "Show suggestions",
|
|
570
570
|
"aria-controls": `${uid.value}-listbox`
|
|
571
|
-
}, [..._cache[
|
|
571
|
+
}, [..._cache[1] || (_cache[1] = [createElementVNode("svg", {
|
|
572
572
|
class: "affordance-icon",
|
|
573
573
|
"aria-hidden": "true",
|
|
574
574
|
viewBox: "0 0 24 24",
|
|
@@ -578,9 +578,34 @@ var UiCombobox_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__P
|
|
|
578
578
|
"stroke-linecap": "round",
|
|
579
579
|
"stroke-linejoin": "round"
|
|
580
580
|
}, [createElementVNode("path", { d: "m6 9 6 6 6-6" })], -1)])], 8, _hoisted_8)) : createCommentVNode("v-if", true)
|
|
581
|
-
], 512),
|
|
581
|
+
], 512), __props.help ? (openBlock(), createElementBlock("button", {
|
|
582
|
+
key: 0,
|
|
583
|
+
class: "help",
|
|
584
|
+
type: "button",
|
|
585
|
+
"aria-label": "Help",
|
|
586
|
+
id: `${uid.value}-help`,
|
|
587
|
+
disabled: __props.disabled
|
|
588
|
+
}, [..._cache[2] || (_cache[2] = [createElementVNode("svg", {
|
|
589
|
+
class: "help-icon",
|
|
590
|
+
"aria-hidden": "true",
|
|
591
|
+
viewBox: "0 0 24 24",
|
|
592
|
+
fill: "none",
|
|
593
|
+
stroke: "currentColor",
|
|
594
|
+
"stroke-width": "2",
|
|
595
|
+
"stroke-linecap": "round",
|
|
596
|
+
"stroke-linejoin": "round"
|
|
597
|
+
}, [
|
|
598
|
+
createElementVNode("circle", {
|
|
599
|
+
cx: "12",
|
|
600
|
+
cy: "12",
|
|
601
|
+
r: "10"
|
|
602
|
+
}),
|
|
603
|
+
createElementVNode("path", { d: "M9.1 9a3 3 0 0 1 5.8 1c0 2-3 3-3 3" }),
|
|
604
|
+
createElementVNode("path", { d: "M12 17h.01" })
|
|
605
|
+
], -1)])], 8, _hoisted_9)) : createCommentVNode("v-if", true)]),
|
|
582
606
|
__props.help ? (openBlock(), createBlock(UiTooltip_default, {
|
|
583
607
|
key: 0,
|
|
608
|
+
trigger: "click",
|
|
584
609
|
id: `${uid.value}-help-text`,
|
|
585
610
|
for: `${uid.value}-help`
|
|
586
611
|
}, {
|
|
@@ -603,7 +628,7 @@ var UiCombobox_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__P
|
|
|
603
628
|
key: group.name,
|
|
604
629
|
role: group.role,
|
|
605
630
|
"aria-label": group.label ?? void 0
|
|
606
|
-
}, [group.name ? (openBlock(), createElementBlock("div",
|
|
631
|
+
}, [group.name ? (openBlock(), createElementBlock("div", _hoisted_13, toDisplayString(group.name), 1)) : createCommentVNode("v-if", true), (openBlock(true), createElementBlock(Fragment, null, renderList(group.rows, (row) => {
|
|
607
632
|
return openBlock(), createElementBlock("div", {
|
|
608
633
|
key: row.id,
|
|
609
634
|
class: normalizeClass(["option", { active: row.index === active.value }]),
|
|
@@ -612,8 +637,8 @@ var UiCombobox_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__P
|
|
|
612
637
|
"aria-selected": row.value === selected.value,
|
|
613
638
|
"aria-disabled": row.disabled,
|
|
614
639
|
"data-index": row.index
|
|
615
|
-
}, [renderSlot(_ctx.$slots, `option-${row.id}`, {}, () => [createElementVNode("span",
|
|
616
|
-
}), 128))], 8,
|
|
640
|
+
}, [renderSlot(_ctx.$slots, `option-${row.id}`, {}, () => [createElementVNode("span", _hoisted_15, toDisplayString(row.label), 1)], true)], 10, _hoisted_14);
|
|
641
|
+
}), 128))], 8, _hoisted_12);
|
|
617
642
|
}), 128)),
|
|
618
643
|
creatable.value ? (openBlock(), createElementBlock("div", {
|
|
619
644
|
key: 0,
|
|
@@ -622,21 +647,21 @@ var UiCombobox_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__P
|
|
|
622
647
|
"aria-selected": "false",
|
|
623
648
|
id: `${uid.value}-option-${createIndex.value}`,
|
|
624
649
|
"data-index": createIndex.value
|
|
625
|
-
}, toDisplayString(`Create “${raw.value}”`), 11,
|
|
626
|
-
message.value ? (openBlock(), createElementBlock("div",
|
|
627
|
-
], 8,
|
|
650
|
+
}, toDisplayString(`Create “${raw.value}”`), 11, _hoisted_16)) : createCommentVNode("v-if", true),
|
|
651
|
+
message.value ? (openBlock(), createElementBlock("div", _hoisted_17, toDisplayString(message.value), 1)) : createCommentVNode("v-if", true)
|
|
652
|
+
], 8, _hoisted_11), renderSlot(_ctx.$slots, "footer", {}, void 0, true)], 8, _hoisted_10),
|
|
628
653
|
createElementVNode("div", {
|
|
629
654
|
class: "message",
|
|
630
655
|
id: `${uid.value}-validation`,
|
|
631
656
|
hidden: !validation.value.issues.length
|
|
632
657
|
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(validation.value.issues, (issue, index) => {
|
|
633
658
|
return openBlock(), createElementBlock("div", { key: index }, toDisplayString(issue.message), 1);
|
|
634
|
-
}), 128))], 8,
|
|
635
|
-
createElementVNode("div",
|
|
636
|
-
createElementVNode("div",
|
|
659
|
+
}), 128))], 8, _hoisted_18),
|
|
660
|
+
createElementVNode("div", _hoisted_19, toDisplayString(statusText.value), 1),
|
|
661
|
+
createElementVNode("div", _hoisted_20, [renderSlot(_ctx.$slots, "default", {}, void 0, true)], 512)
|
|
637
662
|
], 16, _hoisted_1);
|
|
638
663
|
};
|
|
639
664
|
}
|
|
640
|
-
}), [["__scopeId", "data-v-
|
|
665
|
+
}), [["__scopeId", "data-v-f1d9bb8a"]]);
|
|
641
666
|
//#endregion
|
|
642
667
|
export { UiCombobox_default as t };
|
package/vue/chunks/UiMenuItem.js
CHANGED
|
@@ -26,6 +26,6 @@ var UiMenuItem_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__P
|
|
|
26
26
|
}), [renderSlot(_ctx.$slots, "default", {}, void 0, true)], 16, _hoisted_1);
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
|
-
}), [["__scopeId", "data-v-
|
|
29
|
+
}), [["__scopeId", "data-v-69407da9"]]);
|
|
30
30
|
//#endregion
|
|
31
31
|
export { UiMenuItem_default as t };
|
package/vue/chunks/UiTabs.js
CHANGED
|
@@ -172,6 +172,6 @@ var UiTabs_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE_
|
|
|
172
172
|
}), 128))], 8, _hoisted_2), createElementVNode("div", _hoisted_4, [renderSlot(_ctx.$slots, "default")], 512)], 16, _hoisted_1);
|
|
173
173
|
};
|
|
174
174
|
}
|
|
175
|
-
}), [["__scopeId", "data-v-
|
|
175
|
+
}), [["__scopeId", "data-v-3e89baea"]]);
|
|
176
176
|
//#endregion
|
|
177
177
|
export { UiTabs_default as t };
|
package/vue/chunks/UiTooltip.js
CHANGED
|
@@ -21,10 +21,12 @@ var UiTooltip_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PU
|
|
|
21
21
|
default: false
|
|
22
22
|
},
|
|
23
23
|
placement: { default: "top-start" },
|
|
24
|
-
showDelay: { default: 500 }
|
|
24
|
+
showDelay: { default: 500 },
|
|
25
|
+
trigger: { default: "hover" }
|
|
25
26
|
},
|
|
26
27
|
emits: [
|
|
27
28
|
"update:open",
|
|
29
|
+
"update:trigger",
|
|
28
30
|
"open",
|
|
29
31
|
"close"
|
|
30
32
|
],
|
|
@@ -69,6 +71,7 @@ var UiTooltip_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PU
|
|
|
69
71
|
const emitEvent = emit;
|
|
70
72
|
emitEvent(name, detail);
|
|
71
73
|
if (detail !== null && typeof detail === "object" && "open" in detail) emitEvent("update:open", detail["open"]);
|
|
74
|
+
if (detail !== null && typeof detail === "object" && "trigger" in detail) emitEvent("update:trigger", detail["trigger"]);
|
|
72
75
|
return root.value?.dispatchEvent(new CustomEvent(name, {
|
|
73
76
|
bubbles: true,
|
|
74
77
|
composed: true,
|
|
@@ -157,6 +160,6 @@ var UiTooltip_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PU
|
|
|
157
160
|
}), [createElementVNode("div", _hoisted_2, [renderSlot(_ctx.$slots, "default", {}, void 0, true)])], 16, _hoisted_1);
|
|
158
161
|
};
|
|
159
162
|
}
|
|
160
|
-
}), [["__scopeId", "data-v-
|
|
163
|
+
}), [["__scopeId", "data-v-3af2132e"]]);
|
|
161
164
|
//#endregion
|
|
162
165
|
export { UiTooltip_default as t };
|