@threadlabs/looma 0.5.1 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/components/ui-button/ui-button.html +13 -0
- package/components/ui-combobox/ui-combobox.html +12 -4
- package/components/ui-dialog/ui-dialog.html +13 -0
- package/components/ui-editor-insert-table-grid/ui-editor-insert-table-grid.html +1 -1
- package/components/ui-editor-mention-menu/ui-editor-mention-menu.html +1 -1
- package/components/ui-editor-table-context-menu/ui-editor-table-context-menu.html +6 -2
- package/components/ui-editor-table-overlay/ui-editor-table-overlay.html +20 -4
- package/components/ui-editor-table-toolbar/ui-editor-table-toolbar.html +8 -4
- package/components/ui-form-field/ui-form-field.html +18 -7
- package/components/ui-icon/ui-icon.html +5 -1
- package/components/ui-icon-button/ui-icon-button.html +30 -0
- package/components/ui-popover/ui-popover.js +10 -2
- package/components/ui-search-shell/ui-search-shell.html +7 -0
- package/components/ui-search-shell/ui-search-shell.js +9 -0
- package/components/ui-tabs/ui-tabs.html +1 -1
- package/components/ui-toast-region/ui-toast-region.html +1 -1
- package/components/ui-tree-item/ui-tree-item.html +6 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/package.json +2 -2
- package/styles/ui-affordance-scope.css +1 -1
- package/styles/ui-avatar-group.css +1 -1
- package/styles/ui-avatar.css +1 -1
- package/styles/ui-badge.css +1 -1
- package/styles/ui-button.css +11 -1
- package/styles/ui-callout.css +1 -1
- package/styles/ui-checkbox.css +1 -1
- package/styles/ui-cluster.css +1 -1
- package/styles/ui-combobox.css +1 -1
- package/styles/ui-container.css +1 -1
- package/styles/ui-context-menu.css +1 -1
- package/styles/ui-dialog.css +18 -1
- package/styles/ui-disclosure.css +1 -1
- package/styles/ui-editable.css +1 -1
- package/styles/ui-editor-insert-table-grid.css +1 -1
- package/styles/ui-editor-mention-menu.css +1 -1
- package/styles/ui-editor-slash-menu.css +1 -1
- package/styles/ui-editor-table-context-menu.css +1 -1
- package/styles/ui-editor-table-overlay.css +1 -1
- package/styles/ui-editor-table-toolbar.css +1 -1
- package/styles/ui-editor-toolbar.css +1 -1
- package/styles/ui-floating-action-button.css +1 -1
- package/styles/ui-form-field.css +24 -10
- package/styles/ui-grid.css +1 -1
- package/styles/ui-icon-button.css +36 -1
- package/styles/ui-icon.css +1 -1
- package/styles/ui-input.css +1 -1
- package/styles/ui-menu-item.css +1 -1
- package/styles/ui-menu.css +1 -1
- package/styles/ui-popover.css +1 -1
- package/styles/ui-radio-group.css +1 -1
- package/styles/ui-radio.css +1 -1
- package/styles/ui-reel.css +1 -1
- package/styles/ui-search-result-row.css +1 -1
- package/styles/ui-search-shell.css +11 -2
- package/styles/ui-select.css +1 -1
- package/styles/ui-separator.css +1 -1
- package/styles/ui-sidebar.css +1 -1
- package/styles/ui-stack.css +1 -1
- package/styles/ui-switch.css +1 -1
- package/styles/ui-switcher.css +1 -1
- package/styles/ui-tabs.css +1 -1
- package/styles/ui-textarea.css +1 -1
- package/styles/ui-toast-region.css +1 -1
- package/styles/ui-tooltip.css +1 -1
- package/styles/ui-top-bar.css +1 -1
- package/styles/ui-tree-item.css +10 -2
- package/styles/ui-tree.css +1 -1
- package/vanilla/UiAffordanceScope.d.ts +1 -1
- package/vanilla/UiAffordanceScope.js +2 -2
- package/vanilla/UiAvatar.d.ts +1 -1
- package/vanilla/UiAvatar.js +2 -2
- package/vanilla/UiAvatarGroup.d.ts +1 -1
- package/vanilla/UiAvatarGroup.js +2 -2
- package/vanilla/UiBadge.d.ts +1 -1
- package/vanilla/UiBadge.js +2 -2
- package/vanilla/UiButton.d.ts +3 -1
- package/vanilla/UiButton.js +3 -3
- package/vanilla/UiCallout.d.ts +1 -1
- package/vanilla/UiCallout.js +2 -2
- package/vanilla/UiCheckbox.d.ts +1 -1
- package/vanilla/UiCheckbox.js +2 -2
- package/vanilla/UiCluster.d.ts +1 -1
- package/vanilla/UiCluster.js +2 -2
- package/vanilla/UiCombobox.d.ts +1 -1
- package/vanilla/UiCombobox.js +3 -3
- package/vanilla/UiContainer.d.ts +1 -1
- package/vanilla/UiContainer.js +2 -2
- package/vanilla/UiContextMenu.d.ts +1 -1
- package/vanilla/UiContextMenu.js +2 -2
- package/vanilla/UiDialog.d.ts +1 -1
- package/vanilla/UiDialog.js +2 -2
- package/vanilla/UiDisclosure.d.ts +1 -1
- package/vanilla/UiDisclosure.js +2 -2
- package/vanilla/UiEditable.d.ts +1 -1
- package/vanilla/UiEditable.js +2 -2
- package/vanilla/UiEditorInsertTableGrid.d.ts +1 -1
- package/vanilla/UiEditorInsertTableGrid.js +3 -3
- package/vanilla/UiEditorMentionMenu.d.ts +1 -1
- package/vanilla/UiEditorMentionMenu.js +3 -3
- package/vanilla/UiEditorSlashMenu.d.ts +1 -1
- package/vanilla/UiEditorSlashMenu.js +2 -2
- package/vanilla/UiEditorTableContextMenu.d.ts +1 -1
- package/vanilla/UiEditorTableContextMenu.js +3 -3
- package/vanilla/UiEditorTableOverlay.d.ts +1 -1
- package/vanilla/UiEditorTableOverlay.js +3 -3
- package/vanilla/UiEditorTableToolbar.d.ts +1 -1
- package/vanilla/UiEditorTableToolbar.js +3 -3
- package/vanilla/UiEditorToolbar.d.ts +1 -1
- package/vanilla/UiEditorToolbar.js +2 -2
- package/vanilla/UiFloatingActionButton.d.ts +1 -1
- package/vanilla/UiFloatingActionButton.js +2 -2
- package/vanilla/UiFormField.d.ts +1 -1
- package/vanilla/UiFormField.js +15 -6
- package/vanilla/UiGrid.d.ts +1 -1
- package/vanilla/UiGrid.js +2 -2
- package/vanilla/UiIcon.d.ts +1 -1
- package/vanilla/UiIcon.js +3 -3
- package/vanilla/UiIconButton.d.ts +1 -1
- package/vanilla/UiIconButton.js +2 -2
- package/vanilla/UiInput.d.ts +1 -1
- package/vanilla/UiInput.js +2 -2
- package/vanilla/UiMenu.d.ts +1 -1
- package/vanilla/UiMenu.js +2 -2
- package/vanilla/UiMenuItem.d.ts +1 -1
- package/vanilla/UiMenuItem.js +2 -2
- package/vanilla/UiPopover.d.ts +1 -1
- package/vanilla/UiPopover.js +2 -2
- package/vanilla/UiRadio.d.ts +1 -1
- package/vanilla/UiRadio.js +2 -2
- package/vanilla/UiRadioGroup.d.ts +1 -1
- package/vanilla/UiRadioGroup.js +2 -2
- package/vanilla/UiReel.d.ts +1 -1
- package/vanilla/UiReel.js +2 -2
- package/vanilla/UiSearchResultRow.d.ts +1 -1
- package/vanilla/UiSearchResultRow.js +2 -2
- package/vanilla/UiSearchShell.d.ts +1 -1
- package/vanilla/UiSearchShell.js +2 -2
- package/vanilla/UiSelect.d.ts +1 -1
- package/vanilla/UiSelect.js +2 -2
- package/vanilla/UiSeparator.d.ts +1 -1
- package/vanilla/UiSeparator.js +2 -2
- package/vanilla/UiSidebar.d.ts +1 -1
- package/vanilla/UiSidebar.js +2 -2
- package/vanilla/UiStack.d.ts +1 -1
- package/vanilla/UiStack.js +2 -2
- package/vanilla/UiSwitch.d.ts +1 -1
- package/vanilla/UiSwitch.js +2 -2
- package/vanilla/UiSwitcher.d.ts +1 -1
- package/vanilla/UiSwitcher.js +2 -2
- package/vanilla/UiTabs.d.ts +1 -1
- package/vanilla/UiTabs.js +3 -3
- package/vanilla/UiTextarea.d.ts +1 -1
- package/vanilla/UiTextarea.js +2 -2
- package/vanilla/UiToastRegion.d.ts +1 -1
- package/vanilla/UiToastRegion.js +3 -3
- package/vanilla/UiTooltip.d.ts +1 -1
- package/vanilla/UiTooltip.js +2 -2
- package/vanilla/UiTopBar.d.ts +1 -1
- package/vanilla/UiTopBar.js +1 -1
- package/vanilla/UiTree.d.ts +1 -1
- package/vanilla/UiTree.js +2 -2
- package/vanilla/UiTreeItem.d.ts +1 -1
- package/vanilla/UiTreeItem.js +2 -2
- package/vue/UiAffordanceScope.d.ts +2 -2
- package/vue/UiAffordanceScope.vue +92 -73
- package/vue/UiAvatar.d.ts +7 -7
- package/vue/UiAvatar.vue +145 -105
- package/vue/UiAvatarGroup.d.ts +4 -4
- package/vue/UiAvatarGroup.vue +134 -118
- package/vue/UiBadge.d.ts +4 -4
- package/vue/UiBadge.vue +113 -114
- package/vue/UiButton.d.ts +10 -6
- package/vue/UiButton.vue +289 -248
- package/vue/UiCallout.d.ts +2 -2
- package/vue/UiCallout.vue +154 -87
- package/vue/UiCheckbox.d.ts +14 -10
- package/vue/UiCheckbox.vue +228 -162
- package/vue/UiCluster.d.ts +2 -2
- package/vue/UiCluster.vue +53 -60
- package/vue/UiCombobox.d.ts +36 -32
- package/vue/UiCombobox.vue +1005 -416
- package/vue/UiContainer.d.ts +2 -2
- package/vue/UiContainer.vue +48 -51
- package/vue/UiContextMenu.d.ts +6 -4
- package/vue/UiContextMenu.vue +205 -116
- package/vue/UiDialog.d.ts +11 -9
- package/vue/UiDialog.vue +287 -212
- package/vue/UiDisclosure.d.ts +8 -6
- package/vue/UiDisclosure.vue +248 -159
- package/vue/UiEditable.d.ts +16 -12
- package/vue/UiEditable.vue +325 -205
- package/vue/UiEditorInsertTableGrid.d.ts +8 -8
- package/vue/UiEditorInsertTableGrid.vue +216 -157
- package/vue/UiEditorMentionMenu.d.ts +9 -9
- package/vue/UiEditorMentionMenu.vue +265 -222
- package/vue/UiEditorSlashMenu.d.ts +7 -7
- package/vue/UiEditorSlashMenu.vue +286 -240
- package/vue/UiEditorTableContextMenu.d.ts +5 -5
- package/vue/UiEditorTableContextMenu.vue +306 -193
- package/vue/UiEditorTableOverlay.d.ts +2 -2
- package/vue/UiEditorTableOverlay.vue +609 -369
- package/vue/UiEditorTableToolbar.d.ts +7 -7
- package/vue/UiEditorTableToolbar.vue +443 -268
- package/vue/UiEditorToolbar.d.ts +2 -2
- package/vue/UiEditorToolbar.vue +134 -121
- package/vue/UiFloatingActionButton.d.ts +6 -6
- package/vue/UiFloatingActionButton.vue +100 -99
- package/vue/UiFormField.d.ts +6 -6
- package/vue/UiFormField.vue +112 -80
- package/vue/UiGrid.d.ts +2 -2
- package/vue/UiGrid.vue +51 -57
- package/vue/UiIcon.d.ts +2 -2
- package/vue/UiIcon.vue +118 -89
- package/vue/UiIconButton.d.ts +11 -11
- package/vue/UiIconButton.vue +283 -217
- package/vue/UiInput.d.ts +9 -9
- package/vue/UiInput.vue +153 -127
- package/vue/UiMenu.d.ts +8 -6
- package/vue/UiMenu.vue +217 -143
- package/vue/UiMenuItem.d.ts +4 -4
- package/vue/UiMenuItem.vue +52 -46
- package/vue/UiPopover.d.ts +8 -6
- package/vue/UiPopover.vue +197 -137
- package/vue/UiRadio.d.ts +14 -10
- package/vue/UiRadio.vue +183 -117
- package/vue/UiRadioGroup.d.ts +14 -12
- package/vue/UiRadioGroup.vue +172 -111
- package/vue/UiReel.d.ts +3 -3
- package/vue/UiReel.vue +77 -77
- package/vue/UiSearchResultRow.d.ts +4 -4
- package/vue/UiSearchResultRow.vue +124 -115
- package/vue/UiSearchShell.d.ts +10 -8
- package/vue/UiSearchShell.vue +245 -176
- package/vue/UiSelect.d.ts +9 -9
- package/vue/UiSelect.vue +162 -134
- package/vue/UiSeparator.d.ts +2 -2
- package/vue/UiSeparator.vue +22 -27
- package/vue/UiSidebar.d.ts +20 -18
- package/vue/UiSidebar.vue +312 -224
- package/vue/UiStack.d.ts +3 -3
- package/vue/UiStack.vue +64 -70
- package/vue/UiSwitch.d.ts +12 -8
- package/vue/UiSwitch.vue +218 -150
- package/vue/UiSwitcher.d.ts +3 -3
- package/vue/UiSwitcher.vue +73 -75
- package/vue/UiTabs.d.ts +10 -8
- package/vue/UiTabs.vue +251 -210
- package/vue/UiTextarea.d.ts +11 -11
- package/vue/UiTextarea.vue +155 -128
- package/vue/UiToastRegion.d.ts +10 -8
- package/vue/UiToastRegion.vue +261 -198
- package/vue/UiTooltip.d.ts +14 -12
- package/vue/UiTooltip.vue +241 -177
- package/vue/UiTopBar.vue +51 -42
- package/vue/UiTree.d.ts +8 -6
- package/vue/UiTree.vue +157 -70
- package/vue/UiTreeItem.d.ts +24 -22
- package/vue/UiTreeItem.vue +456 -339
- package/vue/chunks/UiAffordanceScope.js +9 -16
- package/vue/chunks/UiAvatar.js +23 -29
- package/vue/chunks/UiAvatarGroup.js +16 -39
- package/vue/chunks/UiBadge.js +3 -12
- package/vue/chunks/UiButton.js +15 -18
- package/vue/chunks/UiCallout.js +8 -17
- package/vue/chunks/UiCheckbox.js +37 -40
- package/vue/chunks/UiCluster.js +3 -12
- package/vue/chunks/UiCombobox.js +224 -266
- package/vue/chunks/UiContainer.js +3 -12
- package/vue/chunks/UiContextMenu.js +39 -34
- package/vue/chunks/UiDialog.js +36 -39
- package/vue/chunks/UiDisclosure.js +43 -48
- package/vue/chunks/UiEditable.js +55 -57
- package/vue/chunks/UiEditorInsertTableGrid.js +55 -73
- package/vue/chunks/UiEditorMentionMenu.js +40 -81
- package/vue/chunks/UiEditorSlashMenu.js +28 -52
- package/vue/chunks/UiEditorTableContextMenu.js +32 -56
- package/vue/chunks/UiEditorTableOverlay.js +58 -82
- package/vue/chunks/UiEditorTableToolbar.js +61 -85
- package/vue/chunks/UiEditorToolbar.js +4 -13
- package/vue/chunks/UiFloatingActionButton.js +7 -21
- package/vue/chunks/UiFormField.js +15 -12
- package/vue/chunks/UiGrid.js +3 -12
- package/vue/chunks/UiIcon.js +20 -43
- package/vue/chunks/UiIconButton.js +16 -28
- package/vue/chunks/UiInput.js +20 -25
- package/vue/chunks/UiMenu.js +29 -33
- package/vue/chunks/UiMenuItem.js +4 -10
- package/vue/chunks/UiPopover.js +28 -29
- package/vue/chunks/UiRadio.js +36 -39
- package/vue/chunks/UiRadioGroup.js +30 -34
- package/vue/chunks/UiReel.js +6 -15
- package/vue/chunks/UiSearchResultRow.js +6 -19
- package/vue/chunks/UiSearchShell.js +25 -28
- package/vue/chunks/UiSelect.js +20 -23
- package/vue/chunks/UiSeparator.js +2 -8
- package/vue/chunks/UiSidebar.js +39 -44
- package/vue/chunks/UiStack.js +6 -15
- package/vue/chunks/UiSwitch.js +35 -38
- package/vue/chunks/UiSwitcher.js +6 -15
- package/vue/chunks/UiTabs.js +47 -85
- package/vue/chunks/UiTextarea.js +21 -26
- package/vue/chunks/UiToastRegion.js +38 -72
- package/vue/chunks/UiTooltip.js +34 -35
- package/vue/chunks/UiTopBar.js +1 -1
- package/vue/chunks/UiTree.js +20 -15
- package/vue/chunks/UiTreeItem.js +85 -102
- package/vue/components.css +3994 -3801
|
@@ -71,53 +71,29 @@ var UiEditorTableToolbar_default = /*#__PURE__*/ _plugin_vue_export_helper_defau
|
|
|
71
71
|
cellAlignment: { default: "left" },
|
|
72
72
|
cellBackground: { default: "" },
|
|
73
73
|
open: {
|
|
74
|
-
type:
|
|
74
|
+
type: Boolean,
|
|
75
75
|
default: false
|
|
76
76
|
}
|
|
77
77
|
},
|
|
78
78
|
emits: ["action"],
|
|
79
79
|
setup(__props, { emit: __emit }) {
|
|
80
|
-
const hn = {
|
|
81
|
-
t: (v) => v === true || (typeof v === "string" ? v.length > 0 : typeof v === "number" ? v !== 0 && v === v : Array.isArray(v) ? v.length > 0 : v !== null && typeof v === "object" ? Object.keys(v).length > 0 : false),
|
|
82
|
-
text: (v) => v === void 0 || v === null ? "" : Array.isArray(v) ? v.map(hn.text).join(" ") : typeof v === "object" ? "" : String(v),
|
|
83
|
-
attr: (v) => v === void 0 || v === null || v === false ? void 0 : v === true ? "" : Array.isArray(v) ? v.map(hn.text).join(" ") : typeof v === "object" ? void 0 : String(v),
|
|
84
|
-
enumerated: (v) => typeof v === "boolean" ? String(v) : hn.attr(v),
|
|
85
|
-
shape: (items, where, sort, limit) => {
|
|
86
|
-
let list = Array.isArray(items) ? items.slice() : [];
|
|
87
|
-
if (where !== void 0) list = list.filter((item) => hn.t(where(item)));
|
|
88
|
-
if (sort.length > 0) {
|
|
89
|
-
const field = (item, path) => item !== null && typeof item === "object" && !Array.isArray(item) ? path.split(".").reduce((value, key) => value?.[key], item) : item;
|
|
90
|
-
const compare = (a, b) => typeof a === "number" && typeof b === "number" ? a - b : hn.text(a).localeCompare(hn.text(b));
|
|
91
|
-
list.sort((a, b) => {
|
|
92
|
-
for (const key of sort) {
|
|
93
|
-
const descending = key.startsWith("-");
|
|
94
|
-
const order = compare(field(a, descending ? key.slice(1) : key), field(b, descending ? key.slice(1) : key));
|
|
95
|
-
if (order !== 0) return descending ? -order : order;
|
|
96
|
-
}
|
|
97
|
-
return 0;
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
return typeof limit === "number" ? list.slice(0, Math.max(0, Math.trunc(limit))) : list;
|
|
101
|
-
}
|
|
102
|
-
};
|
|
103
80
|
const props = __props;
|
|
104
81
|
const emit = __emit;
|
|
105
82
|
const root = ref(null);
|
|
106
|
-
const
|
|
107
|
-
const
|
|
108
|
-
const
|
|
109
|
-
const
|
|
110
|
-
const
|
|
111
|
-
const
|
|
112
|
-
const state_overflowOpen = ref(false);
|
|
83
|
+
const alignments = ref([]);
|
|
84
|
+
const structure = ref([]);
|
|
85
|
+
const swatches = ref([]);
|
|
86
|
+
const sections = ref([]);
|
|
87
|
+
const hasOverflow = ref(false);
|
|
88
|
+
const overflowOpen = ref(false);
|
|
113
89
|
/** Dispatches a component event to Vue listeners and, for controllers and page code, on the root. */
|
|
114
|
-
|
|
115
|
-
const declared = {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
90
|
+
function dispatch(name, detail) {
|
|
91
|
+
const declared = { action: {
|
|
92
|
+
bubbles: true,
|
|
93
|
+
composed: true,
|
|
94
|
+
cancelable: false
|
|
119
95
|
} };
|
|
120
|
-
const checks = {
|
|
96
|
+
const checks = { action: (detail) => detail !== null && typeof detail === "object" && !Array.isArray(detail) && (detail["action"] === "align-left" || detail["action"] === "align-center" || detail["action"] === "align-right" || detail["action"] === "background-none" || detail["action"] === "background-gray" || detail["action"] === "background-yellow" || detail["action"] === "background-blue" || detail["action"] === "background-green" || detail["action"] === "background-red" || detail["action"] === "add-row-before" || detail["action"] === "add-row-after" || detail["action"] === "add-column-before" || detail["action"] === "add-column-after" || detail["action"] === "clear-cells" || detail["action"] === "merge-cells" || detail["action"] === "split-cell" || detail["action"] === "delete-row" || detail["action"] === "delete-column" || detail["action"] === "delete-table") && Object.keys(detail).every((key) => ["action"].includes(key)) };
|
|
121
97
|
if (detail !== void 0 && checks[name] !== void 0 && !checks[name](detail)) throw new TypeError(`HR002: Event \`${name}\` detail does not satisfy its declared type.`);
|
|
122
98
|
emit(name, detail);
|
|
123
99
|
return root.value?.dispatchEvent(new CustomEvent(name, {
|
|
@@ -126,39 +102,39 @@ var UiEditorTableToolbar_default = /*#__PURE__*/ _plugin_vue_export_helper_defau
|
|
|
126
102
|
...declared[name],
|
|
127
103
|
detail
|
|
128
104
|
})) ?? true;
|
|
129
|
-
}
|
|
105
|
+
}
|
|
130
106
|
function read(name) {
|
|
131
|
-
if (name === "alignments") return
|
|
132
|
-
if (name === "structure") return
|
|
133
|
-
if (name === "swatches") return
|
|
134
|
-
if (name === "sections") return
|
|
135
|
-
if (name === "hasOverflow") return
|
|
136
|
-
if (name === "overflowOpen") return
|
|
107
|
+
if (name === "alignments") return alignments.value;
|
|
108
|
+
if (name === "structure") return structure.value;
|
|
109
|
+
if (name === "swatches") return swatches.value;
|
|
110
|
+
if (name === "sections") return sections.value;
|
|
111
|
+
if (name === "hasOverflow") return hasOverflow.value;
|
|
112
|
+
if (name === "overflowOpen") return overflowOpen.value;
|
|
137
113
|
return props[name];
|
|
138
114
|
}
|
|
139
115
|
function write(name, value) {
|
|
140
116
|
if (name === "alignments") {
|
|
141
|
-
|
|
117
|
+
alignments.value = value;
|
|
142
118
|
return true;
|
|
143
119
|
}
|
|
144
120
|
if (name === "structure") {
|
|
145
|
-
|
|
121
|
+
structure.value = value;
|
|
146
122
|
return true;
|
|
147
123
|
}
|
|
148
124
|
if (name === "swatches") {
|
|
149
|
-
|
|
125
|
+
swatches.value = value;
|
|
150
126
|
return true;
|
|
151
127
|
}
|
|
152
128
|
if (name === "sections") {
|
|
153
|
-
|
|
129
|
+
sections.value = value;
|
|
154
130
|
return true;
|
|
155
131
|
}
|
|
156
132
|
if (name === "hasOverflow") {
|
|
157
|
-
|
|
133
|
+
hasOverflow.value = value;
|
|
158
134
|
return true;
|
|
159
135
|
}
|
|
160
136
|
if (name === "overflowOpen") {
|
|
161
|
-
|
|
137
|
+
overflowOpen.value = value;
|
|
162
138
|
return true;
|
|
163
139
|
}
|
|
164
140
|
throw new TypeError(`Only declared state is writable; \`${name}\` is not.`);
|
|
@@ -172,7 +148,7 @@ var UiEditorTableToolbar_default = /*#__PURE__*/ _plugin_vue_export_helper_defau
|
|
|
172
148
|
get: (_target, name) => typeof name === "string" ? read(name) : void 0,
|
|
173
149
|
set: (_target, name, value) => typeof name === "string" && write(name, value)
|
|
174
150
|
}),
|
|
175
|
-
refs,
|
|
151
|
+
refs: {},
|
|
176
152
|
elements: new Proxy({}, { get: (_target, name) => {
|
|
177
153
|
if (typeof name !== "string" || root.value === null) return void 0;
|
|
178
154
|
return (root.value instanceof HTMLFormElement ? root.value : root.value.querySelector("form"))?.elements.namedItem(name) ?? root.value.querySelector(`[name="${CSS.escape(name)}"]`) ?? void 0;
|
|
@@ -227,73 +203,73 @@ var UiEditorTableToolbar_default = /*#__PURE__*/ _plugin_vue_export_helper_defau
|
|
|
227
203
|
role: "toolbar",
|
|
228
204
|
"aria-label": "Table actions"
|
|
229
205
|
}, _ctx.$attrs, {
|
|
230
|
-
hidden:
|
|
206
|
+
hidden: !__props.open,
|
|
231
207
|
ref_key: "root",
|
|
232
208
|
ref: root
|
|
233
209
|
}), [
|
|
234
|
-
|
|
210
|
+
alignments.value.length ? (openBlock(), createElementBlock("div", _hoisted_2, [(openBlock(true), createElementBlock(Fragment, null, renderList(alignments.value, (item) => {
|
|
235
211
|
return openBlock(), createElementBlock("button", {
|
|
236
|
-
key: item
|
|
212
|
+
key: item.action,
|
|
237
213
|
type: "button",
|
|
238
|
-
class: normalizeClass(["icon-button", {
|
|
239
|
-
"data-action":
|
|
240
|
-
"aria-label":
|
|
241
|
-
title:
|
|
242
|
-
"aria-pressed":
|
|
243
|
-
}, [createVNode(UiIcon_default, { name: item
|
|
214
|
+
class: normalizeClass(["icon-button", { active: item.active }]),
|
|
215
|
+
"data-action": item.action,
|
|
216
|
+
"aria-label": item.label,
|
|
217
|
+
title: item.label,
|
|
218
|
+
"aria-pressed": item.active
|
|
219
|
+
}, [createVNode(UiIcon_default, { name: item.action }, null, 8, ["name"])], 10, _hoisted_3);
|
|
244
220
|
}), 128))])) : createCommentVNode("v-if", true),
|
|
245
|
-
|
|
246
|
-
|
|
221
|
+
alignments.value.length && structure.value.length ? (openBlock(), createElementBlock("div", _hoisted_4)) : createCommentVNode("v-if", true),
|
|
222
|
+
structure.value.length ? (openBlock(), createElementBlock("div", _hoisted_5, [(openBlock(true), createElementBlock(Fragment, null, renderList(structure.value, (item) => {
|
|
247
223
|
return openBlock(), createElementBlock("button", {
|
|
248
|
-
key: item
|
|
224
|
+
key: item.action,
|
|
249
225
|
type: "button",
|
|
250
|
-
"data-action":
|
|
251
|
-
}, [createVNode(UiIcon_default, { name: item
|
|
226
|
+
"data-action": item.action
|
|
227
|
+
}, [createVNode(UiIcon_default, { name: item.icon }, null, 8, ["name"]), createElementVNode("span", null, toDisplayString(item.label), 1)], 8, _hoisted_6);
|
|
252
228
|
}), 128))])) : createCommentVNode("v-if", true),
|
|
253
|
-
|
|
254
|
-
|
|
229
|
+
(alignments.value.length || structure.value.length) && hasOverflow.value ? (openBlock(), createElementBlock("div", _hoisted_7)) : createCommentVNode("v-if", true),
|
|
230
|
+
hasOverflow.value ? (openBlock(), createElementBlock("div", _hoisted_8, [createElementVNode("button", {
|
|
255
231
|
type: "button",
|
|
256
232
|
class: "more",
|
|
257
233
|
"data-action": "toggle-overflow",
|
|
258
234
|
"aria-haspopup": "menu",
|
|
259
|
-
"aria-expanded":
|
|
235
|
+
"aria-expanded": overflowOpen.value
|
|
260
236
|
}, [
|
|
261
237
|
createVNode(UiIcon_default, { name: "table" }),
|
|
262
238
|
_cache[0] || (_cache[0] = createElementVNode("span", null, "Table options", -1)),
|
|
263
239
|
createElementVNode("span", _hoisted_10, [createVNode(UiIcon_default, { name: "chevron-down" })])
|
|
264
|
-
], 8, _hoisted_9),
|
|
240
|
+
], 8, _hoisted_9), overflowOpen.value ? (openBlock(), createElementBlock("div", _hoisted_11, [swatches.value.length ? (openBlock(), createElementBlock("div", _hoisted_12, [_cache[1] || (_cache[1] = createElementVNode("div", {
|
|
265
241
|
class: "menu-heading",
|
|
266
242
|
role: "presentation"
|
|
267
|
-
}, "Background", -1)), createElementVNode("div", _hoisted_13, [(openBlock(true), createElementBlock(Fragment, null, renderList(
|
|
243
|
+
}, "Background", -1)), createElementVNode("div", _hoisted_13, [(openBlock(true), createElementBlock(Fragment, null, renderList(swatches.value, (swatch) => {
|
|
268
244
|
return openBlock(), createElementBlock("button", {
|
|
269
|
-
key: swatch
|
|
245
|
+
key: swatch.action,
|
|
270
246
|
type: "button",
|
|
271
|
-
class: normalizeClass(["swatch-button", {
|
|
247
|
+
class: normalizeClass(["swatch-button", { selected: swatch.selected }]),
|
|
272
248
|
role: "menuitemradio",
|
|
273
|
-
"aria-checked":
|
|
274
|
-
"data-action":
|
|
249
|
+
"aria-checked": swatch.selected,
|
|
250
|
+
"data-action": swatch.action
|
|
275
251
|
}, [createElementVNode("span", {
|
|
276
|
-
class: normalizeClass(["swatch", {
|
|
277
|
-
style: normalizeStyle({ "--ui-editor-table-toolbar-swatch":
|
|
278
|
-
}, null, 6), createElementVNode("span", null, toDisplayString(
|
|
279
|
-
}), 128))])])) : createCommentVNode("v-if", true), (openBlock(true), createElementBlock(Fragment, null, renderList(
|
|
252
|
+
class: normalizeClass(["swatch", { default: !swatch.color }]),
|
|
253
|
+
style: normalizeStyle({ "--ui-editor-table-toolbar-swatch": swatch.color })
|
|
254
|
+
}, null, 6), createElementVNode("span", null, toDisplayString(swatch.label), 1)], 10, _hoisted_14);
|
|
255
|
+
}), 128))])])) : createCommentVNode("v-if", true), (openBlock(true), createElementBlock(Fragment, null, renderList(sections.value, (section) => {
|
|
280
256
|
return openBlock(), createElementBlock("div", {
|
|
281
|
-
key: section
|
|
257
|
+
key: section.heading,
|
|
282
258
|
class: "menu-section divided",
|
|
283
259
|
role: "none"
|
|
284
|
-
}, [createElementVNode("div", _hoisted_15, toDisplayString(
|
|
260
|
+
}, [createElementVNode("div", _hoisted_15, toDisplayString(section.heading), 1), (openBlock(true), createElementBlock(Fragment, null, renderList(section.items, (item) => {
|
|
285
261
|
return openBlock(), createElementBlock("button", {
|
|
286
|
-
key: item
|
|
262
|
+
key: item.action,
|
|
287
263
|
type: "button",
|
|
288
264
|
role: "menuitem",
|
|
289
|
-
"data-action":
|
|
290
|
-
class: normalizeClass({
|
|
291
|
-
}, [createVNode(UiIcon_default, { name: item
|
|
265
|
+
"data-action": item.action,
|
|
266
|
+
class: normalizeClass({ danger: item.danger })
|
|
267
|
+
}, [createVNode(UiIcon_default, { name: item.icon }, null, 8, ["name"]), createElementVNode("span", null, toDisplayString(item.label), 1)], 10, _hoisted_16);
|
|
292
268
|
}), 128))]);
|
|
293
269
|
}), 128))])) : createCommentVNode("v-if", true)])) : createCommentVNode("v-if", true)
|
|
294
270
|
], 16, _hoisted_1);
|
|
295
271
|
};
|
|
296
272
|
}
|
|
297
|
-
}), [["__scopeId", "data-v-
|
|
273
|
+
}), [["__scopeId", "data-v-b2b27930"]]);
|
|
298
274
|
//#endregion
|
|
299
275
|
export { UiEditorTableToolbar_default as t };
|
|
@@ -8,22 +8,13 @@ var UiEditorToolbar_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/*
|
|
|
8
8
|
inheritAttrs: false,
|
|
9
9
|
__name: "UiEditorToolbar",
|
|
10
10
|
props: { floating: {
|
|
11
|
-
type:
|
|
11
|
+
type: Boolean,
|
|
12
12
|
default: false
|
|
13
13
|
} },
|
|
14
14
|
setup(__props) {
|
|
15
|
-
const hn = { t: (v) => v === true || (typeof v === "string" ? v.length > 0 : typeof v === "number" ? v !== 0 && v === v : Array.isArray(v) ? v.length > 0 : v !== null && typeof v === "object" ? Object.keys(v).length > 0 : false) };
|
|
16
15
|
const props = __props;
|
|
17
|
-
/** The
|
|
18
|
-
const hostState = computed(() => ["floating"].
|
|
19
|
-
const value = read(name);
|
|
20
|
-
const tokens = hn.t(value) ? [name] : [];
|
|
21
|
-
if (typeof value === "string" || typeof value === "number") tokens.push(`${name}=${encodeURIComponent(String(value))}`);
|
|
22
|
-
return tokens;
|
|
23
|
-
}).join(" "));
|
|
24
|
-
function read(name) {
|
|
25
|
-
return props[name];
|
|
26
|
-
}
|
|
16
|
+
/** The values the styles' :host-state() rules test. */
|
|
17
|
+
const hostState = computed(() => [props.floating && "floating"].filter(Boolean).join(" "));
|
|
27
18
|
return (_ctx, _cache) => {
|
|
28
19
|
return openBlock(), createElementBlock("div", mergeProps({
|
|
29
20
|
"data-component": "ui-editor-toolbar",
|
|
@@ -32,6 +23,6 @@ var UiEditorToolbar_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/*
|
|
|
32
23
|
}, _ctx.$attrs, { "data-ui-editor-toolbar-state": hostState.value || void 0 }), [renderSlot(_ctx.$slots, "default")], 16, _hoisted_1);
|
|
33
24
|
};
|
|
34
25
|
}
|
|
35
|
-
}), [["__scopeId", "data-v-
|
|
26
|
+
}), [["__scopeId", "data-v-890a1e69"]]);
|
|
36
27
|
//#endregion
|
|
37
28
|
export { UiEditorToolbar_default as t };
|
|
@@ -13,44 +13,30 @@ var UiFloatingActionButton_default = /*#__PURE__*/ _plugin_vue_export_helper_def
|
|
|
13
13
|
__name: "UiFloatingActionButton",
|
|
14
14
|
props: {
|
|
15
15
|
disabled: {
|
|
16
|
-
type:
|
|
16
|
+
type: Boolean,
|
|
17
17
|
default: false
|
|
18
18
|
},
|
|
19
19
|
label: { default: "" },
|
|
20
20
|
mobileOnly: {
|
|
21
|
-
type:
|
|
21
|
+
type: Boolean,
|
|
22
22
|
default: false
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
25
|
setup(__props) {
|
|
26
|
-
const hn = {
|
|
27
|
-
t: (v) => v === true || (typeof v === "string" ? v.length > 0 : typeof v === "number" ? v !== 0 && v === v : Array.isArray(v) ? v.length > 0 : v !== null && typeof v === "object" ? Object.keys(v).length > 0 : false),
|
|
28
|
-
text: (v) => v === void 0 || v === null ? "" : Array.isArray(v) ? v.map(hn.text).join(" ") : typeof v === "object" ? "" : String(v),
|
|
29
|
-
attr: (v) => v === void 0 || v === null || v === false ? void 0 : v === true ? "" : Array.isArray(v) ? v.map(hn.text).join(" ") : typeof v === "object" ? void 0 : String(v),
|
|
30
|
-
enumerated: (v) => typeof v === "boolean" ? String(v) : hn.attr(v)
|
|
31
|
-
};
|
|
32
26
|
const props = __props;
|
|
33
|
-
/** The
|
|
34
|
-
const hostState = computed(() => ["mobileOnly"].
|
|
35
|
-
const value = read(name);
|
|
36
|
-
const tokens = hn.t(value) ? [name] : [];
|
|
37
|
-
if (typeof value === "string" || typeof value === "number") tokens.push(`${name}=${encodeURIComponent(String(value))}`);
|
|
38
|
-
return tokens;
|
|
39
|
-
}).join(" "));
|
|
40
|
-
function read(name) {
|
|
41
|
-
return props[name];
|
|
42
|
-
}
|
|
27
|
+
/** The values the styles' :host-state() rules test. */
|
|
28
|
+
const hostState = computed(() => [props.mobileOnly && "mobileOnly"].filter(Boolean).join(" "));
|
|
43
29
|
return (_ctx, _cache) => {
|
|
44
30
|
return openBlock(), createElementBlock("button", mergeProps({
|
|
45
31
|
"data-component": "ui-floating-action-button",
|
|
46
32
|
type: "button"
|
|
47
33
|
}, _ctx.$attrs, {
|
|
48
|
-
"aria-label":
|
|
49
|
-
disabled:
|
|
34
|
+
"aria-label": __props.label,
|
|
35
|
+
disabled: __props.disabled,
|
|
50
36
|
"data-ui-floating-action-button-state": hostState.value || void 0
|
|
51
37
|
}), [renderSlot(_ctx.$slots, "default")], 16, _hoisted_1);
|
|
52
38
|
};
|
|
53
39
|
}
|
|
54
|
-
}), [["__scopeId", "data-v-
|
|
40
|
+
}), [["__scopeId", "data-v-a6b9e9ca"]]);
|
|
55
41
|
//#endregion
|
|
56
42
|
export { UiFloatingActionButton_default as t };
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { t as _plugin_vue_export_helper_default } from "./_plugin-vue_export-helper.js";
|
|
2
|
-
import { computed, createElementBlock, defineComponent, mergeProps, onBeforeUnmount, onMounted, openBlock, ref, renderSlot, shallowRef, watchEffect } from "vue";
|
|
2
|
+
import { computed, createElementBlock, createElementVNode, defineComponent, mergeProps, onBeforeUnmount, onMounted, openBlock, ref, renderSlot, shallowRef, watchEffect } from "vue";
|
|
3
3
|
import * as controllerModule from "@threadlabs/looma/components/ui-form-field/ui-form-field.js";
|
|
4
|
+
//#region .build/vue/UiFormField.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
+
var _hoisted_1 = { class: "label" };
|
|
6
|
+
var _hoisted_2 = { class: "help" };
|
|
7
|
+
var _hoisted_3 = { class: "error" };
|
|
4
8
|
//#endregion
|
|
5
9
|
//#region .build/vue/UiFormField.vue
|
|
6
10
|
var UiFormField_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
|
|
@@ -8,30 +12,29 @@ var UiFormField_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__
|
|
|
8
12
|
__name: "UiFormField",
|
|
9
13
|
props: {
|
|
10
14
|
disabled: {
|
|
11
|
-
type:
|
|
15
|
+
type: Boolean,
|
|
12
16
|
default: false
|
|
13
17
|
},
|
|
14
18
|
invalid: {
|
|
15
|
-
type:
|
|
19
|
+
type: Boolean,
|
|
16
20
|
default: false
|
|
17
21
|
},
|
|
18
22
|
required: {
|
|
19
|
-
type:
|
|
23
|
+
type: Boolean,
|
|
20
24
|
default: false
|
|
21
25
|
}
|
|
22
26
|
},
|
|
23
27
|
setup(__props) {
|
|
24
28
|
const props = __props;
|
|
25
29
|
const root = ref(null);
|
|
26
|
-
const refs = {};
|
|
27
30
|
/** Dispatches a component event to Vue listeners and, for controllers and page code, on the root. */
|
|
28
|
-
|
|
31
|
+
function dispatch(name, detail) {
|
|
29
32
|
return root.value?.dispatchEvent(new CustomEvent(name, {
|
|
30
33
|
bubbles: true,
|
|
31
34
|
composed: true,
|
|
32
35
|
detail
|
|
33
36
|
})) ?? true;
|
|
34
|
-
}
|
|
37
|
+
}
|
|
35
38
|
function read(name) {
|
|
36
39
|
return props[name];
|
|
37
40
|
}
|
|
@@ -47,7 +50,7 @@ var UiFormField_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__
|
|
|
47
50
|
get: (_target, name) => typeof name === "string" ? read(name) : void 0,
|
|
48
51
|
set: (_target, name, value) => typeof name === "string" && write(name, value)
|
|
49
52
|
}),
|
|
50
|
-
refs,
|
|
53
|
+
refs: {},
|
|
51
54
|
elements: new Proxy({}, { get: (_target, name) => {
|
|
52
55
|
if (typeof name !== "string" || root.value === null) return void 0;
|
|
53
56
|
return (root.value instanceof HTMLFormElement ? root.value : root.value.querySelector("form"))?.elements.namedItem(name) ?? root.value.querySelector(`[name="${CSS.escape(name)}"]`) ?? void 0;
|
|
@@ -101,13 +104,13 @@ var UiFormField_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__
|
|
|
101
104
|
ref_key: "root",
|
|
102
105
|
ref: root
|
|
103
106
|
}), [
|
|
104
|
-
renderSlot(_ctx.$slots, "label"),
|
|
107
|
+
createElementVNode("div", _hoisted_1, [renderSlot(_ctx.$slots, "label")]),
|
|
105
108
|
renderSlot(_ctx.$slots, "default"),
|
|
106
|
-
renderSlot(_ctx.$slots, "help"),
|
|
107
|
-
renderSlot(_ctx.$slots, "error")
|
|
109
|
+
createElementVNode("div", _hoisted_2, [renderSlot(_ctx.$slots, "help")]),
|
|
110
|
+
createElementVNode("div", _hoisted_3, [renderSlot(_ctx.$slots, "error")])
|
|
108
111
|
], 16);
|
|
109
112
|
};
|
|
110
113
|
}
|
|
111
|
-
}), [["__scopeId", "data-v-
|
|
114
|
+
}), [["__scopeId", "data-v-ae3bcdfb"]]);
|
|
112
115
|
//#endregion
|
|
113
116
|
export { UiFormField_default as t };
|
package/vue/chunks/UiGrid.js
CHANGED
|
@@ -12,22 +12,13 @@ var UiGrid_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE_
|
|
|
12
12
|
min: {}
|
|
13
13
|
},
|
|
14
14
|
setup(__props) {
|
|
15
|
-
const hn = { t: (v) => v === true || (typeof v === "string" ? v.length > 0 : typeof v === "number" ? v !== 0 && v === v : Array.isArray(v) ? v.length > 0 : v !== null && typeof v === "object" ? Object.keys(v).length > 0 : false) };
|
|
16
15
|
const props = __props;
|
|
17
|
-
/** The
|
|
18
|
-
const hostState = computed(() => [
|
|
19
|
-
const value = read(name);
|
|
20
|
-
const tokens = hn.t(value) ? [name] : [];
|
|
21
|
-
if (typeof value === "string" || typeof value === "number") tokens.push(`${name}=${encodeURIComponent(String(value))}`);
|
|
22
|
-
return tokens;
|
|
23
|
-
}).join(" "));
|
|
24
|
-
function read(name) {
|
|
25
|
-
return props[name];
|
|
26
|
-
}
|
|
16
|
+
/** The values the styles' :host-state() rules test. */
|
|
17
|
+
const hostState = computed(() => [props.gap && `gap gap=${props.gap}`, props.min && `min min=${props.min}`].filter(Boolean).join(" "));
|
|
27
18
|
return (_ctx, _cache) => {
|
|
28
19
|
return openBlock(), createElementBlock("div", mergeProps({ "data-component": "ui-grid" }, _ctx.$attrs, { "data-ui-grid-state": hostState.value || void 0 }), [renderSlot(_ctx.$slots, "default", {}, void 0, true)], 16, _hoisted_1);
|
|
29
20
|
};
|
|
30
21
|
}
|
|
31
|
-
}), [["__scopeId", "data-v-
|
|
22
|
+
}), [["__scopeId", "data-v-c390a71d"]]);
|
|
32
23
|
//#endregion
|
|
33
24
|
export { UiGrid_default as t };
|
package/vue/chunks/UiIcon.js
CHANGED
|
@@ -31,47 +31,24 @@ var UiIcon_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE_
|
|
|
31
31
|
__name: "UiIcon",
|
|
32
32
|
props: { name: { default: "" } },
|
|
33
33
|
setup(__props) {
|
|
34
|
-
const hn = {
|
|
35
|
-
t: (v) => v === true || (typeof v === "string" ? v.length > 0 : typeof v === "number" ? v !== 0 && v === v : Array.isArray(v) ? v.length > 0 : v !== null && typeof v === "object" ? Object.keys(v).length > 0 : false),
|
|
36
|
-
text: (v) => v === void 0 || v === null ? "" : Array.isArray(v) ? v.map(hn.text).join(" ") : typeof v === "object" ? "" : String(v),
|
|
37
|
-
attr: (v) => v === void 0 || v === null || v === false ? void 0 : v === true ? "" : Array.isArray(v) ? v.map(hn.text).join(" ") : typeof v === "object" ? void 0 : String(v),
|
|
38
|
-
shape: (items, where, sort, limit) => {
|
|
39
|
-
let list = Array.isArray(items) ? items.slice() : [];
|
|
40
|
-
if (where !== void 0) list = list.filter((item) => hn.t(where(item)));
|
|
41
|
-
if (sort.length > 0) {
|
|
42
|
-
const field = (item, path) => item !== null && typeof item === "object" && !Array.isArray(item) ? path.split(".").reduce((value, key) => value?.[key], item) : item;
|
|
43
|
-
const compare = (a, b) => typeof a === "number" && typeof b === "number" ? a - b : hn.text(a).localeCompare(hn.text(b));
|
|
44
|
-
list.sort((a, b) => {
|
|
45
|
-
for (const key of sort) {
|
|
46
|
-
const descending = key.startsWith("-");
|
|
47
|
-
const order = compare(field(a, descending ? key.slice(1) : key), field(b, descending ? key.slice(1) : key));
|
|
48
|
-
if (order !== 0) return descending ? -order : order;
|
|
49
|
-
}
|
|
50
|
-
return 0;
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
return typeof limit === "number" ? list.slice(0, Math.max(0, Math.trunc(limit))) : list;
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
34
|
const props = __props;
|
|
57
35
|
const root = ref(null);
|
|
58
|
-
const
|
|
59
|
-
const state_shapes = ref([]);
|
|
36
|
+
const shapes = ref([]);
|
|
60
37
|
/** Dispatches a component event to Vue listeners and, for controllers and page code, on the root. */
|
|
61
|
-
|
|
38
|
+
function dispatch(name, detail) {
|
|
62
39
|
return root.value?.dispatchEvent(new CustomEvent(name, {
|
|
63
40
|
bubbles: true,
|
|
64
41
|
composed: true,
|
|
65
42
|
detail
|
|
66
43
|
})) ?? true;
|
|
67
|
-
}
|
|
44
|
+
}
|
|
68
45
|
function read(name) {
|
|
69
|
-
if (name === "shapes") return
|
|
46
|
+
if (name === "shapes") return shapes.value;
|
|
70
47
|
return props[name];
|
|
71
48
|
}
|
|
72
49
|
function write(name, value) {
|
|
73
50
|
if (name === "shapes") {
|
|
74
|
-
|
|
51
|
+
shapes.value = value;
|
|
75
52
|
return true;
|
|
76
53
|
}
|
|
77
54
|
throw new TypeError(`Only declared state is writable; \`${name}\` is not.`);
|
|
@@ -85,7 +62,7 @@ var UiIcon_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE_
|
|
|
85
62
|
get: (_target, name) => typeof name === "string" ? read(name) : void 0,
|
|
86
63
|
set: (_target, name, value) => typeof name === "string" && write(name, value)
|
|
87
64
|
}),
|
|
88
|
-
refs,
|
|
65
|
+
refs: {},
|
|
89
66
|
elements: new Proxy({}, { get: (_target, name) => {
|
|
90
67
|
if (typeof name !== "string" || root.value === null) return void 0;
|
|
91
68
|
return (root.value instanceof HTMLFormElement ? root.value : root.value.querySelector("form"))?.elements.namedItem(name) ?? root.value.querySelector(`[name="${CSS.escape(name)}"]`) ?? void 0;
|
|
@@ -141,30 +118,30 @@ var UiIcon_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE_
|
|
|
141
118
|
}, _ctx.$attrs, {
|
|
142
119
|
ref_key: "root",
|
|
143
120
|
ref: root
|
|
144
|
-
}), [(openBlock(), createElementBlock("svg", _hoisted_1, [(openBlock(true), createElementBlock(Fragment, null, renderList(
|
|
121
|
+
}), [(openBlock(), createElementBlock("svg", _hoisted_1, [(openBlock(true), createElementBlock(Fragment, null, renderList(shapes.value, (shape, index) => {
|
|
145
122
|
return openBlock(), createElementBlock("g", { key: index }, [
|
|
146
|
-
|
|
123
|
+
shape.tag === "path" ? (openBlock(), createElementBlock("path", {
|
|
147
124
|
key: 0,
|
|
148
|
-
d:
|
|
125
|
+
d: shape.d
|
|
149
126
|
}, null, 8, _hoisted_2)) : createCommentVNode("v-if", true),
|
|
150
|
-
|
|
127
|
+
shape.tag === "circle" ? (openBlock(), createElementBlock("circle", {
|
|
151
128
|
key: 1,
|
|
152
|
-
cx:
|
|
153
|
-
cy:
|
|
154
|
-
r:
|
|
129
|
+
cx: shape.cx,
|
|
130
|
+
cy: shape.cy,
|
|
131
|
+
r: shape.r
|
|
155
132
|
}, null, 8, _hoisted_3)) : createCommentVNode("v-if", true),
|
|
156
|
-
|
|
133
|
+
shape.tag === "rect" ? (openBlock(), createElementBlock("rect", {
|
|
157
134
|
key: 2,
|
|
158
|
-
x:
|
|
159
|
-
y:
|
|
160
|
-
width:
|
|
161
|
-
height:
|
|
162
|
-
rx:
|
|
135
|
+
x: shape.x,
|
|
136
|
+
y: shape.y,
|
|
137
|
+
width: shape.width,
|
|
138
|
+
height: shape.height,
|
|
139
|
+
rx: shape.rx
|
|
163
140
|
}, null, 8, _hoisted_4)) : createCommentVNode("v-if", true)
|
|
164
141
|
]);
|
|
165
142
|
}), 128))]))], 16);
|
|
166
143
|
};
|
|
167
144
|
}
|
|
168
|
-
}), [["__scopeId", "data-v-
|
|
145
|
+
}), [["__scopeId", "data-v-b2b50d17"]]);
|
|
169
146
|
//#endregion
|
|
170
147
|
export { UiIcon_default as t };
|
|
@@ -14,51 +14,39 @@ var UiIconButton_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @_
|
|
|
14
14
|
__name: "UiIconButton",
|
|
15
15
|
props: {
|
|
16
16
|
anticipatory: {
|
|
17
|
-
type:
|
|
17
|
+
type: Boolean,
|
|
18
18
|
default: false
|
|
19
19
|
},
|
|
20
20
|
disabled: {
|
|
21
|
-
type:
|
|
21
|
+
type: Boolean,
|
|
22
22
|
default: false
|
|
23
23
|
},
|
|
24
24
|
label: {},
|
|
25
25
|
round: {
|
|
26
|
-
type:
|
|
26
|
+
type: Boolean,
|
|
27
27
|
default: false
|
|
28
28
|
},
|
|
29
29
|
size: { default: "md" },
|
|
30
30
|
variant: { default: "ghost" }
|
|
31
31
|
},
|
|
32
32
|
setup(__props) {
|
|
33
|
-
const hn = {
|
|
34
|
-
t: (v) => v === true || (typeof v === "string" ? v.length > 0 : typeof v === "number" ? v !== 0 && v === v : Array.isArray(v) ? v.length > 0 : v !== null && typeof v === "object" ? Object.keys(v).length > 0 : false),
|
|
35
|
-
text: (v) => v === void 0 || v === null ? "" : Array.isArray(v) ? v.map(hn.text).join(" ") : typeof v === "object" ? "" : String(v),
|
|
36
|
-
attr: (v) => v === void 0 || v === null || v === false ? void 0 : v === true ? "" : Array.isArray(v) ? v.map(hn.text).join(" ") : typeof v === "object" ? void 0 : String(v),
|
|
37
|
-
enumerated: (v) => typeof v === "boolean" ? String(v) : hn.attr(v)
|
|
38
|
-
};
|
|
39
33
|
const props = __props;
|
|
40
34
|
const root = ref(null);
|
|
41
|
-
|
|
35
|
+
/** The values the styles' :host-state() rules test. */
|
|
36
|
+
const hostState = computed(() => [
|
|
37
|
+
props.anticipatory && "anticipatory",
|
|
38
|
+
props.variant && `variant variant=${props.variant}`,
|
|
39
|
+
props.size && `size size=${props.size}`,
|
|
40
|
+
props.round && "round"
|
|
41
|
+
].filter(Boolean).join(" "));
|
|
42
42
|
/** Dispatches a component event to Vue listeners and, for controllers and page code, on the root. */
|
|
43
|
-
|
|
43
|
+
function dispatch(name, detail) {
|
|
44
44
|
return root.value?.dispatchEvent(new CustomEvent(name, {
|
|
45
45
|
bubbles: true,
|
|
46
46
|
composed: true,
|
|
47
47
|
detail
|
|
48
48
|
})) ?? true;
|
|
49
|
-
}
|
|
50
|
-
/** The resolved values the styles' :host-state() rules test. */
|
|
51
|
-
const hostState = computed(() => [
|
|
52
|
-
"anticipatory",
|
|
53
|
-
"variant",
|
|
54
|
-
"size",
|
|
55
|
-
"round"
|
|
56
|
-
].flatMap((name) => {
|
|
57
|
-
const value = read(name);
|
|
58
|
-
const tokens = hn.t(value) ? [name] : [];
|
|
59
|
-
if (typeof value === "string" || typeof value === "number") tokens.push(`${name}=${encodeURIComponent(String(value))}`);
|
|
60
|
-
return tokens;
|
|
61
|
-
}).join(" "));
|
|
49
|
+
}
|
|
62
50
|
function read(name) {
|
|
63
51
|
return props[name];
|
|
64
52
|
}
|
|
@@ -74,7 +62,7 @@ var UiIconButton_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @_
|
|
|
74
62
|
get: (_target, name) => typeof name === "string" ? read(name) : void 0,
|
|
75
63
|
set: (_target, name, value) => typeof name === "string" && write(name, value)
|
|
76
64
|
}),
|
|
77
|
-
refs,
|
|
65
|
+
refs: {},
|
|
78
66
|
elements: new Proxy({}, { get: (_target, name) => {
|
|
79
67
|
if (typeof name !== "string" || root.value === null) return void 0;
|
|
80
68
|
return (root.value instanceof HTMLFormElement ? root.value : root.value.querySelector("form"))?.elements.namedItem(name) ?? root.value.querySelector(`[name="${CSS.escape(name)}"]`) ?? void 0;
|
|
@@ -128,14 +116,14 @@ var UiIconButton_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @_
|
|
|
128
116
|
"data-component": "ui-icon-button",
|
|
129
117
|
type: "button"
|
|
130
118
|
}, _ctx.$attrs, {
|
|
131
|
-
disabled:
|
|
132
|
-
"aria-label":
|
|
119
|
+
disabled: __props.disabled,
|
|
120
|
+
"aria-label": __props.label,
|
|
133
121
|
"data-ui-icon-button-state": hostState.value || void 0,
|
|
134
122
|
ref_key: "root",
|
|
135
123
|
ref: root
|
|
136
124
|
}), [renderSlot(_ctx.$slots, "default")], 16, _hoisted_1);
|
|
137
125
|
};
|
|
138
126
|
}
|
|
139
|
-
}), [["__scopeId", "data-v-
|
|
127
|
+
}), [["__scopeId", "data-v-9ff7e192"]]);
|
|
140
128
|
//#endregion
|
|
141
129
|
export { UiIconButton_default as t };
|