@acoyfellow/kumo-vue 0.0.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/kumo.manifest.json +1140 -0
- package/package/button.css +1 -0
- package/package/components/autocomplete.content.d.ts +4 -0
- package/package/components/autocomplete.content.js +21 -0
- package/package/components/autocomplete.d.ts +8 -0
- package/package/components/autocomplete.input-group.d.ts +4 -0
- package/package/components/autocomplete.input-group.js +21 -0
- package/package/components/autocomplete.item.d.ts +4 -0
- package/package/components/autocomplete.item.js +21 -0
- package/package/components/autocomplete.js +102 -0
- package/package/components/autocomplete.list.d.ts +4 -0
- package/package/components/autocomplete.list.js +21 -0
- package/package/components/badge.d.ts +8 -0
- package/package/components/badge.js +57 -0
- package/package/components/banner.d.ts +8 -0
- package/package/components/banner.js +71 -0
- package/package/components/breadcrumbs.current.d.ts +4 -0
- package/package/components/breadcrumbs.current.js +21 -0
- package/package/components/breadcrumbs.d.ts +8 -0
- package/package/components/breadcrumbs.js +86 -0
- package/package/components/breadcrumbs.link.d.ts +4 -0
- package/package/components/breadcrumbs.link.js +21 -0
- package/package/components/breadcrumbs.separator.d.ts +4 -0
- package/package/components/breadcrumbs.separator.js +21 -0
- package/package/components/button.d.ts +8 -0
- package/package/components/button.js +93 -0
- package/package/components/checkbox.d.ts +8 -0
- package/package/components/checkbox.js +77 -0
- package/package/components/clipboard-text.d.ts +8 -0
- package/package/components/clipboard-text.js +54 -0
- package/package/components/cloudflare-logo.d.ts +8 -0
- package/package/components/cloudflare-logo.js +70 -0
- package/package/components/code.d.ts +8 -0
- package/package/components/code.js +56 -0
- package/package/components/combobox.content.d.ts +4 -0
- package/package/components/combobox.content.js +21 -0
- package/package/components/combobox.d.ts +8 -0
- package/package/components/combobox.item.d.ts +4 -0
- package/package/components/combobox.item.js +21 -0
- package/package/components/combobox.js +101 -0
- package/package/components/combobox.list.d.ts +4 -0
- package/package/components/combobox.list.js +21 -0
- package/package/components/combobox.trigger-input.d.ts +4 -0
- package/package/components/combobox.trigger-input.js +21 -0
- package/package/components/command-palette.d.ts +8 -0
- package/package/components/command-palette.highlighted-text.d.ts +4 -0
- package/package/components/command-palette.highlighted-text.js +21 -0
- package/package/components/command-palette.input.d.ts +4 -0
- package/package/components/command-palette.input.js +21 -0
- package/package/components/command-palette.item.d.ts +4 -0
- package/package/components/command-palette.item.js +21 -0
- package/package/components/command-palette.js +126 -0
- package/package/components/command-palette.list.d.ts +4 -0
- package/package/components/command-palette.list.js +21 -0
- package/package/components/command-palette.root.d.ts +4 -0
- package/package/components/command-palette.root.js +21 -0
- package/package/components/date-picker.d.ts +8 -0
- package/package/components/date-picker.js +119 -0
- package/package/components/date-range-picker.d.ts +8 -0
- package/package/components/date-range-picker.js +154 -0
- package/package/components/dialog.close.d.ts +4 -0
- package/package/components/dialog.close.js +21 -0
- package/package/components/dialog.d.ts +8 -0
- package/package/components/dialog.description.d.ts +4 -0
- package/package/components/dialog.description.js +21 -0
- package/package/components/dialog.js +107 -0
- package/package/components/dialog.root.d.ts +4 -0
- package/package/components/dialog.root.js +21 -0
- package/package/components/dialog.title.d.ts +4 -0
- package/package/components/dialog.title.js +21 -0
- package/package/components/dialog.trigger.d.ts +4 -0
- package/package/components/dialog.trigger.js +21 -0
- package/package/components/dropdown-menu.content.d.ts +4 -0
- package/package/components/dropdown-menu.content.js +21 -0
- package/package/components/dropdown-menu.d.ts +8 -0
- package/package/components/dropdown-menu.item.d.ts +4 -0
- package/package/components/dropdown-menu.item.js +21 -0
- package/package/components/dropdown-menu.js +172 -0
- package/package/components/dropdown-menu.sub-content.d.ts +4 -0
- package/package/components/dropdown-menu.sub-content.js +21 -0
- package/package/components/dropdown-menu.sub-trigger.d.ts +4 -0
- package/package/components/dropdown-menu.sub-trigger.js +21 -0
- package/package/components/dropdown-menu.sub.d.ts +4 -0
- package/package/components/dropdown-menu.sub.js +21 -0
- package/package/components/dropdown-menu.trigger.d.ts +4 -0
- package/package/components/dropdown-menu.trigger.js +21 -0
- package/package/components/empty.d.ts +8 -0
- package/package/components/empty.js +68 -0
- package/package/components/field.d.ts +7 -0
- package/package/components/field.js +2 -0
- package/package/components/field.legacy.js +49 -0
- package/package/components/field.native-input.d.ts +4 -0
- package/package/components/field.native-input.js +21 -0
- package/package/components/field.semantic.js +43 -0
- package/package/components/grid-item.d.ts +8 -0
- package/package/components/grid-item.js +52 -0
- package/package/components/grid.d.ts +8 -0
- package/package/components/grid.js +58 -0
- package/package/components/input-area.d.ts +8 -0
- package/package/components/input-area.js +70 -0
- package/package/components/input-group.addon.d.ts +4 -0
- package/package/components/input-group.addon.js +21 -0
- package/package/components/input-group.button.d.ts +4 -0
- package/package/components/input-group.button.js +21 -0
- package/package/components/input-group.d.ts +8 -0
- package/package/components/input-group.input.d.ts +4 -0
- package/package/components/input-group.input.js +21 -0
- package/package/components/input-group.js +96 -0
- package/package/components/input-group.suffix.d.ts +4 -0
- package/package/components/input-group.suffix.js +21 -0
- package/package/components/input.d.ts +8 -0
- package/package/components/input.js +70 -0
- package/package/components/label.d.ts +8 -0
- package/package/components/label.js +56 -0
- package/package/components/layer-card.d.ts +8 -0
- package/package/components/layer-card.js +60 -0
- package/package/components/layer-card.primary.d.ts +4 -0
- package/package/components/layer-card.primary.js +21 -0
- package/package/components/layer-card.secondary.d.ts +4 -0
- package/package/components/layer-card.secondary.js +21 -0
- package/package/components/link.d.ts +8 -0
- package/package/components/link.js +58 -0
- package/package/components/loader.d.ts +8 -0
- package/package/components/loader.js +67 -0
- package/package/components/menu-bar.d.ts +8 -0
- package/package/components/menu-bar.js +76 -0
- package/package/components/meter.d.ts +8 -0
- package/package/components/meter.js +97 -0
- package/package/components/pagination.d.ts +8 -0
- package/package/components/pagination.js +157 -0
- package/package/components/popover.close.d.ts +4 -0
- package/package/components/popover.close.js +21 -0
- package/package/components/popover.content.d.ts +4 -0
- package/package/components/popover.content.js +21 -0
- package/package/components/popover.d.ts +8 -0
- package/package/components/popover.description.d.ts +4 -0
- package/package/components/popover.description.js +21 -0
- package/package/components/popover.js +138 -0
- package/package/components/popover.title.d.ts +4 -0
- package/package/components/popover.title.js +21 -0
- package/package/components/popover.trigger.d.ts +4 -0
- package/package/components/popover.trigger.js +21 -0
- package/package/components/radio.d.ts +8 -0
- package/package/components/radio.js +91 -0
- package/package/components/select.d.ts +8 -0
- package/package/components/select.js +200 -0
- package/package/components/select.option.d.ts +4 -0
- package/package/components/select.option.js +21 -0
- package/package/components/sensitive-input.d.ts +8 -0
- package/package/components/sensitive-input.js +82 -0
- package/package/components/sidebar.collapsible-content.d.ts +4 -0
- package/package/components/sidebar.collapsible-content.js +21 -0
- package/package/components/sidebar.collapsible.d.ts +4 -0
- package/package/components/sidebar.collapsible.js +21 -0
- package/package/components/sidebar.content.d.ts +4 -0
- package/package/components/sidebar.content.js +21 -0
- package/package/components/sidebar.d.ts +8 -0
- package/package/components/sidebar.footer.d.ts +4 -0
- package/package/components/sidebar.footer.js +21 -0
- package/package/components/sidebar.group-label.d.ts +4 -0
- package/package/components/sidebar.group-label.js +21 -0
- package/package/components/sidebar.group.d.ts +4 -0
- package/package/components/sidebar.group.js +21 -0
- package/package/components/sidebar.header.d.ts +4 -0
- package/package/components/sidebar.header.js +21 -0
- package/package/components/sidebar.js +140 -0
- package/package/components/sidebar.menu-button.d.ts +4 -0
- package/package/components/sidebar.menu-button.js +21 -0
- package/package/components/sidebar.menu.d.ts +4 -0
- package/package/components/sidebar.menu.js +21 -0
- package/package/components/sidebar.provider.d.ts +4 -0
- package/package/components/sidebar.provider.js +21 -0
- package/package/components/sidebar.resize-handle.d.ts +4 -0
- package/package/components/sidebar.resize-handle.js +21 -0
- package/package/components/sidebar.sliding-view.d.ts +4 -0
- package/package/components/sidebar.sliding-view.js +21 -0
- package/package/components/sidebar.sliding-views.d.ts +4 -0
- package/package/components/sidebar.sliding-views.js +21 -0
- package/package/components/sidebar.trigger.d.ts +4 -0
- package/package/components/sidebar.trigger.js +21 -0
- package/package/components/surface.d.ts +8 -0
- package/package/components/surface.js +60 -0
- package/package/components/switch.d.ts +8 -0
- package/package/components/switch.js +78 -0
- package/package/components/table-of-contents.d.ts +8 -0
- package/package/components/table-of-contents.group.d.ts +4 -0
- package/package/components/table-of-contents.group.js +21 -0
- package/package/components/table-of-contents.item.d.ts +4 -0
- package/package/components/table-of-contents.item.js +21 -0
- package/package/components/table-of-contents.js +78 -0
- package/package/components/table-of-contents.list.d.ts +4 -0
- package/package/components/table-of-contents.list.js +21 -0
- package/package/components/table-of-contents.title.d.ts +4 -0
- package/package/components/table-of-contents.title.js +21 -0
- package/package/components/table.body.d.ts +4 -0
- package/package/components/table.body.js +21 -0
- package/package/components/table.cell.d.ts +4 -0
- package/package/components/table.cell.js +21 -0
- package/package/components/table.d.ts +8 -0
- package/package/components/table.head.d.ts +4 -0
- package/package/components/table.head.js +21 -0
- package/package/components/table.header.d.ts +4 -0
- package/package/components/table.header.js +21 -0
- package/package/components/table.js +66 -0
- package/package/components/table.row.d.ts +4 -0
- package/package/components/table.row.js +21 -0
- package/package/components/tabs.d.ts +8 -0
- package/package/components/tabs.js +98 -0
- package/package/components/text.d.ts +8 -0
- package/package/components/text.js +64 -0
- package/package/components/toasty.d.ts +8 -0
- package/package/components/toasty.js +101 -0
- package/package/dialog.css +1 -0
- package/package/form.css +1 -0
- package/package/index.d.ts +119 -0
- package/package/index.js +119 -0
- package/package/native-control.css +1 -0
- package/package/navigation.css +1 -0
- package/package/popover.css +1 -0
- package/package/selection-command-date.css +1 -0
- package/package/styles.css +23 -0
- package/package/tokens.css +1 -0
- package/package.json +441 -0
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { defineComponent as _defineComponent } from 'vue';
|
|
2
|
+
import { computed, getCurrentInstance, nextTick, ref, useAttrs, useSlots } from 'vue';
|
|
3
|
+
export const modelDigest = "bbb9a5923924fd49391fbcee50197c821eda77610c050fb355e378e852397b0d";
|
|
4
|
+
export const contentBindingDigest = "a6655036dbbdb2cd56a9e62bf5f2f8f75bb6a7bb4d3c5fbf41726fd8666277cd";
|
|
5
|
+
const __sfc__ = /*@__PURE__*/ _defineComponent({
|
|
6
|
+
...{ inheritAttrs: false },
|
|
7
|
+
__name: 'dialog',
|
|
8
|
+
props: {
|
|
9
|
+
Close: { type: null, required: false },
|
|
10
|
+
Description: { type: null, required: false },
|
|
11
|
+
Dialog: { type: null, required: false },
|
|
12
|
+
Root: { type: String, required: false },
|
|
13
|
+
Title: { type: null, required: false },
|
|
14
|
+
Trigger: { type: null, required: false },
|
|
15
|
+
open: { type: Boolean, required: false },
|
|
16
|
+
onOpenChange: { type: null, required: false },
|
|
17
|
+
role: { type: null, required: false },
|
|
18
|
+
fixture: { type: null, required: false },
|
|
19
|
+
semanticContent: { type: null, required: false }
|
|
20
|
+
},
|
|
21
|
+
setup(__props, { expose: __expose }) {
|
|
22
|
+
__expose();
|
|
23
|
+
const props = __props;
|
|
24
|
+
const instance = getCurrentInstance();
|
|
25
|
+
const controlled = computed(() => Object.prototype.hasOwnProperty.call(instance?.vnode.props ?? {}, 'open'));
|
|
26
|
+
const internalOpen = ref(false);
|
|
27
|
+
const currentOpen = computed(() => controlled.value ? Boolean(props.open) : internalOpen.value);
|
|
28
|
+
const triggerRef = ref(null);
|
|
29
|
+
const dialogRef = ref(null);
|
|
30
|
+
const dialogFixture = computed(() => props.fixture);
|
|
31
|
+
const fixtureChildren = (node) => node?.children ?? [];
|
|
32
|
+
const fixturePart = (name) => fixtureChildren(dialogFixture.value).find(node => node.export === name);
|
|
33
|
+
const contentRoot = computed(() => fixtureChildren(dialogFixture.value).find(node => node.export === 'root'));
|
|
34
|
+
const contentPart = (name) => fixtureChildren(contentRoot.value).find(node => node.export === name);
|
|
35
|
+
const partText = (node) => node ? String(node.text ?? '') + fixtureChildren(node).map(partText).join('') : '';
|
|
36
|
+
const triggerText = computed(() => partText(fixturePart('.Trigger')));
|
|
37
|
+
const titleText = computed(() => partText(contentPart('.Title')));
|
|
38
|
+
const descriptionText = computed(() => partText(contentPart('.Description')));
|
|
39
|
+
const closeText = computed(() => partText(contentPart('.Close')));
|
|
40
|
+
function setOpen(next) {
|
|
41
|
+
if (!controlled.value)
|
|
42
|
+
internalOpen.value = next;
|
|
43
|
+
props.onOpenChange?.(next);
|
|
44
|
+
nextTick(() => next ? dialogRef.value?.focus() : triggerRef.value?.focus());
|
|
45
|
+
}
|
|
46
|
+
const slots = useSlots();
|
|
47
|
+
const styles = {};
|
|
48
|
+
const normalizeSlotContent = (value) => Array.isArray(value) ? value.map(normalizeSlotContent).join('') : value == null || typeof value === 'boolean' ? '' : typeof value === 'string' || typeof value === 'number' ? String(value) : normalizeSlotContent(value.children);
|
|
49
|
+
const renderContent = () => props.semanticContent ?? normalizeSlotContent(slots.default?.());
|
|
50
|
+
const fixture = computed(() => props.fixture);
|
|
51
|
+
const semanticValues = Object.assign({}, useAttrs(), props);
|
|
52
|
+
const semanticEqual = (left, right) => JSON.stringify(left) === JSON.stringify(right);
|
|
53
|
+
const fixtureText = (value) => value && typeof value === 'object' ? String(typeof value.text === 'string' ? value.text : '') + (Array.isArray(value.children) ? value.children.map(fixtureText).join('') : '') : '';
|
|
54
|
+
const __returned__ = { modelDigest, contentBindingDigest, props, instance, controlled, internalOpen, currentOpen, triggerRef, dialogRef, dialogFixture, fixtureChildren, fixturePart, contentRoot, contentPart, partText, triggerText, titleText, descriptionText, closeText, setOpen, slots, styles, normalizeSlotContent, renderContent, fixture, semanticValues, semanticEqual, fixtureText };
|
|
55
|
+
Object.defineProperty(__returned__, '__isScriptSetup', { enumerable: false, value: true });
|
|
56
|
+
return __returned__;
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
import { toDisplayString as _toDisplayString, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, createElementVNode as _createElementVNode, Teleport as _Teleport, createBlock as _createBlock, createTextVNode as _createTextVNode } from "vue";
|
|
60
|
+
const _hoisted_1 = {
|
|
61
|
+
ref: "dialogRef",
|
|
62
|
+
role: "dialog",
|
|
63
|
+
tabindex: "-1"
|
|
64
|
+
};
|
|
65
|
+
const _hoisted_2 = { key: 0 };
|
|
66
|
+
const _hoisted_3 = { key: 1 };
|
|
67
|
+
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
68
|
+
return (_openBlock(), _createElementBlock("button", {
|
|
69
|
+
ref: "triggerRef",
|
|
70
|
+
type: "button",
|
|
71
|
+
"data-kumo-component": "Dialog",
|
|
72
|
+
"data-kumo-part": "trigger",
|
|
73
|
+
"aria-haspopup": "dialog",
|
|
74
|
+
onClick: _cache[1] || (_cache[1] = $event => ($setup.setOpen(true)))
|
|
75
|
+
}, [
|
|
76
|
+
_createTextVNode(_toDisplayString($setup.triggerText), 1 /* TEXT */),
|
|
77
|
+
($setup.currentOpen)
|
|
78
|
+
? (_openBlock(), _createBlock(_Teleport, {
|
|
79
|
+
key: 0,
|
|
80
|
+
to: "body"
|
|
81
|
+
}, [
|
|
82
|
+
_createElementVNode("div", _hoisted_1, [
|
|
83
|
+
($setup.titleText)
|
|
84
|
+
? (_openBlock(), _createElementBlock("h2", _hoisted_2, _toDisplayString($setup.titleText), 1 /* TEXT */))
|
|
85
|
+
: _createCommentVNode("v-if", true),
|
|
86
|
+
($setup.descriptionText)
|
|
87
|
+
? (_openBlock(), _createElementBlock("p", _hoisted_3, _toDisplayString($setup.descriptionText), 1 /* TEXT */))
|
|
88
|
+
: _createCommentVNode("v-if", true),
|
|
89
|
+
($setup.closeText)
|
|
90
|
+
? (_openBlock(), _createElementBlock("button", {
|
|
91
|
+
key: 2,
|
|
92
|
+
type: "button",
|
|
93
|
+
"data-kumo-part": "close",
|
|
94
|
+
onClick: _cache[0] || (_cache[0] = $event => ($setup.setOpen(false)))
|
|
95
|
+
}, _toDisplayString($setup.closeText), 1 /* TEXT */))
|
|
96
|
+
: _createCommentVNode("v-if", true)
|
|
97
|
+
], 512 /* NEED_PATCH */)
|
|
98
|
+
]))
|
|
99
|
+
: _createCommentVNode("v-if", true)
|
|
100
|
+
], 512 /* NEED_PATCH */));
|
|
101
|
+
}
|
|
102
|
+
__sfc__.render = render;
|
|
103
|
+
__sfc__.name = "KumoDialog";
|
|
104
|
+
__sfc__.__file = "components/dialog.vue";
|
|
105
|
+
export default __sfc__;
|
|
106
|
+
|
|
107
|
+
export { __sfc__ as Dialog }
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { defineComponent as _defineComponent } from 'vue';
|
|
2
|
+
const __sfc__ = /*@__PURE__*/ _defineComponent({
|
|
3
|
+
...{ inheritAttrs: false },
|
|
4
|
+
__name: 'dialog.root',
|
|
5
|
+
setup(__props, { expose: __expose }) {
|
|
6
|
+
__expose();
|
|
7
|
+
const __returned__ = {};
|
|
8
|
+
Object.defineProperty(__returned__, '__isScriptSetup', { enumerable: false, value: true });
|
|
9
|
+
return __returned__;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
import { renderSlot as _renderSlot, mergeProps as _mergeProps, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
|
|
13
|
+
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
14
|
+
return (_openBlock(), _createElementBlock("span", _mergeProps(_ctx.$attrs, { "data-kumo-part": "Root" }), [
|
|
15
|
+
_renderSlot(_ctx.$slots, "default")
|
|
16
|
+
], 16 /* FULL_PROPS */));
|
|
17
|
+
}
|
|
18
|
+
__sfc__.render = render;
|
|
19
|
+
__sfc__.name = "KumoDialogRoot";
|
|
20
|
+
__sfc__.__file = "components/dialog.root.vue";
|
|
21
|
+
export default __sfc__;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { defineComponent as _defineComponent } from 'vue';
|
|
2
|
+
const __sfc__ = /*@__PURE__*/ _defineComponent({
|
|
3
|
+
...{ inheritAttrs: false },
|
|
4
|
+
__name: 'dialog.title',
|
|
5
|
+
setup(__props, { expose: __expose }) {
|
|
6
|
+
__expose();
|
|
7
|
+
const __returned__ = {};
|
|
8
|
+
Object.defineProperty(__returned__, '__isScriptSetup', { enumerable: false, value: true });
|
|
9
|
+
return __returned__;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
import { renderSlot as _renderSlot, mergeProps as _mergeProps, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
|
|
13
|
+
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
14
|
+
return (_openBlock(), _createElementBlock("span", _mergeProps(_ctx.$attrs, { "data-kumo-part": "Title" }), [
|
|
15
|
+
_renderSlot(_ctx.$slots, "default")
|
|
16
|
+
], 16 /* FULL_PROPS */));
|
|
17
|
+
}
|
|
18
|
+
__sfc__.render = render;
|
|
19
|
+
__sfc__.name = "KumoDialogTitle";
|
|
20
|
+
__sfc__.__file = "components/dialog.title.vue";
|
|
21
|
+
export default __sfc__;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { defineComponent as _defineComponent } from 'vue';
|
|
2
|
+
const __sfc__ = /*@__PURE__*/ _defineComponent({
|
|
3
|
+
...{ inheritAttrs: false },
|
|
4
|
+
__name: 'dialog.trigger',
|
|
5
|
+
setup(__props, { expose: __expose }) {
|
|
6
|
+
__expose();
|
|
7
|
+
const __returned__ = {};
|
|
8
|
+
Object.defineProperty(__returned__, '__isScriptSetup', { enumerable: false, value: true });
|
|
9
|
+
return __returned__;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
import { renderSlot as _renderSlot, mergeProps as _mergeProps, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
|
|
13
|
+
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
14
|
+
return (_openBlock(), _createElementBlock("span", _mergeProps(_ctx.$attrs, { "data-kumo-part": "Trigger" }), [
|
|
15
|
+
_renderSlot(_ctx.$slots, "default")
|
|
16
|
+
], 16 /* FULL_PROPS */));
|
|
17
|
+
}
|
|
18
|
+
__sfc__.render = render;
|
|
19
|
+
__sfc__.name = "KumoDialogTrigger";
|
|
20
|
+
__sfc__.__file = "components/dialog.trigger.vue";
|
|
21
|
+
export default __sfc__;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { defineComponent as _defineComponent } from 'vue';
|
|
2
|
+
const __sfc__ = /*@__PURE__*/ _defineComponent({
|
|
3
|
+
...{ inheritAttrs: false },
|
|
4
|
+
__name: 'dropdown-menu.content',
|
|
5
|
+
setup(__props, { expose: __expose }) {
|
|
6
|
+
__expose();
|
|
7
|
+
const __returned__ = {};
|
|
8
|
+
Object.defineProperty(__returned__, '__isScriptSetup', { enumerable: false, value: true });
|
|
9
|
+
return __returned__;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
import { renderSlot as _renderSlot, mergeProps as _mergeProps, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
|
|
13
|
+
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
14
|
+
return (_openBlock(), _createElementBlock("span", _mergeProps(_ctx.$attrs, { "data-kumo-part": "Content" }), [
|
|
15
|
+
_renderSlot(_ctx.$slots, "default")
|
|
16
|
+
], 16 /* FULL_PROPS */));
|
|
17
|
+
}
|
|
18
|
+
__sfc__.render = render;
|
|
19
|
+
__sfc__.name = "KumoDropdownMenuContent";
|
|
20
|
+
__sfc__.__file = "components/dropdown-menu.content.vue";
|
|
21
|
+
export default __sfc__;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// @generated by src/kumo/emitters/vue/index.mjs; do not edit
|
|
2
|
+
import type { DefineComponent } from 'vue';
|
|
3
|
+
export interface DropdownMenuProps { [key: string]: unknown }
|
|
4
|
+
declare const component: DefineComponent<DropdownMenuProps>;
|
|
5
|
+
export default component;
|
|
6
|
+
export declare const modelDigest: "b7a7a7552e372c2e1ea240ec06c7dce7aef9118128e29322f995167f2f63016d";
|
|
7
|
+
|
|
8
|
+
export { component as DropdownMenu };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { defineComponent as _defineComponent } from 'vue';
|
|
2
|
+
const __sfc__ = /*@__PURE__*/ _defineComponent({
|
|
3
|
+
...{ inheritAttrs: false },
|
|
4
|
+
__name: 'dropdown-menu.item',
|
|
5
|
+
setup(__props, { expose: __expose }) {
|
|
6
|
+
__expose();
|
|
7
|
+
const __returned__ = {};
|
|
8
|
+
Object.defineProperty(__returned__, '__isScriptSetup', { enumerable: false, value: true });
|
|
9
|
+
return __returned__;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
import { renderSlot as _renderSlot, mergeProps as _mergeProps, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
|
|
13
|
+
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
14
|
+
return (_openBlock(), _createElementBlock("span", _mergeProps(_ctx.$attrs, { "data-kumo-part": "Item" }), [
|
|
15
|
+
_renderSlot(_ctx.$slots, "default")
|
|
16
|
+
], 16 /* FULL_PROPS */));
|
|
17
|
+
}
|
|
18
|
+
__sfc__.render = render;
|
|
19
|
+
__sfc__.name = "KumoDropdownMenuItem";
|
|
20
|
+
__sfc__.__file = "components/dropdown-menu.item.vue";
|
|
21
|
+
export default __sfc__;
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { defineComponent as _defineComponent } from 'vue';
|
|
2
|
+
import { computed, nextTick, ref, useAttrs, useSlots } from 'vue';
|
|
3
|
+
export const modelDigest = "b7a7a7552e372c2e1ea240ec06c7dce7aef9118128e29322f995167f2f63016d";
|
|
4
|
+
export const contentBindingDigest = "a6655036dbbdb2cd56a9e62bf5f2f8f75bb6a7bb4d3c5fbf41726fd8666277cd";
|
|
5
|
+
const __sfc__ = /*@__PURE__*/ _defineComponent({
|
|
6
|
+
...{ inheritAttrs: false },
|
|
7
|
+
__name: 'dropdown-menu',
|
|
8
|
+
props: {
|
|
9
|
+
CheckboxItem: { type: null, required: false },
|
|
10
|
+
"Content/SubContent": { type: null, required: false },
|
|
11
|
+
Item: { type: null, required: false },
|
|
12
|
+
"Label/Separator/Shortcut/Group": { type: null, required: false },
|
|
13
|
+
LinkItem: { type: null, required: false },
|
|
14
|
+
"RadioGroup/RadioItem/RadioItemIndicator": { type: null, required: false },
|
|
15
|
+
Root: { type: null, required: false },
|
|
16
|
+
"Sub/SubTrigger": { type: null, required: false },
|
|
17
|
+
Trigger: { type: null, required: false },
|
|
18
|
+
onOpenChange: { type: null, required: false },
|
|
19
|
+
onSelect: { type: null, required: false },
|
|
20
|
+
fixture: { type: null, required: false },
|
|
21
|
+
semanticContent: { type: null, required: false }
|
|
22
|
+
},
|
|
23
|
+
setup(__props, { expose: __expose }) {
|
|
24
|
+
__expose();
|
|
25
|
+
const props = __props;
|
|
26
|
+
const dropdownFixture = computed(() => props.fixture);
|
|
27
|
+
const fixtureChildren = (node) => node?.children ?? [];
|
|
28
|
+
const fixturePart = (node, name) => fixtureChildren(node).find(child => child.export === name);
|
|
29
|
+
const partText = (node) => node ? String(node.text ?? '') + fixtureChildren(node).map(partText).join('') : '';
|
|
30
|
+
const triggerPart = computed(() => fixturePart(dropdownFixture.value, '.Trigger'));
|
|
31
|
+
const contentPart = computed(() => fixturePart(dropdownFixture.value, '.Content'));
|
|
32
|
+
const menuEntries = computed(() => fixtureChildren(contentPart.value).flatMap(node => node.export === '.Item' || node.export === '.Sub' ? [node] : []));
|
|
33
|
+
const triggerRef = ref(null);
|
|
34
|
+
const itemRefs = ref([]);
|
|
35
|
+
const open = ref(false);
|
|
36
|
+
const submenuOpen = ref(false);
|
|
37
|
+
const activeIndex = ref(-1);
|
|
38
|
+
const disabledSkipped = ref(false);
|
|
39
|
+
function setOpen(next) { open.value = next; props.onOpenChange?.(next); }
|
|
40
|
+
function focusEntry(index) { activeIndex.value = index; nextTick(() => itemRefs.value[index]?.focus()); }
|
|
41
|
+
function openMenu(focusFirst = false) { if (!open.value)
|
|
42
|
+
setOpen(true); if (focusFirst) {
|
|
43
|
+
const index = menuEntries.value.findIndex(entry => !entry.props?.disabled);
|
|
44
|
+
if (index >= 0)
|
|
45
|
+
focusEntry(index);
|
|
46
|
+
} }
|
|
47
|
+
function triggerKey(event) { if (event.key !== 'ArrowDown')
|
|
48
|
+
return; event.preventDefault(); openMenu(true); }
|
|
49
|
+
function selectItem(entry) {
|
|
50
|
+
const label = partText(entry);
|
|
51
|
+
props.onSelect?.(label);
|
|
52
|
+
setOpen(false);
|
|
53
|
+
props.onOpenChange?.(false);
|
|
54
|
+
submenuOpen.value = false;
|
|
55
|
+
nextTick(() => { document.activeElement?.blur?.(); document.body.focus(); });
|
|
56
|
+
}
|
|
57
|
+
function entryKey(event) {
|
|
58
|
+
if (event.key.toLowerCase() === 'm') {
|
|
59
|
+
event.preventDefault();
|
|
60
|
+
const index = menuEntries.value.findIndex(entry => entry.export === '.Sub' && partText(fixturePart(entry, '.SubTrigger')).toLowerCase().startsWith('m'));
|
|
61
|
+
disabledSkipped.value = menuEntries.value.some((entry, entryIndex) => entryIndex < index && Boolean(entry.props?.disabled));
|
|
62
|
+
if (index >= 0)
|
|
63
|
+
focusEntry(index);
|
|
64
|
+
}
|
|
65
|
+
else if (event.key === 'ArrowRight') {
|
|
66
|
+
event.preventDefault();
|
|
67
|
+
submenuOpen.value = true;
|
|
68
|
+
}
|
|
69
|
+
else if (event.key === 'Escape') {
|
|
70
|
+
event.preventDefault();
|
|
71
|
+
open.value = false;
|
|
72
|
+
submenuOpen.value = false;
|
|
73
|
+
props.onOpenChange?.(false);
|
|
74
|
+
nextTick(() => triggerRef.value?.focus());
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
const slots = useSlots();
|
|
78
|
+
const styles = {};
|
|
79
|
+
const normalizeSlotContent = (value) => Array.isArray(value) ? value.map(normalizeSlotContent).join('') : value == null || typeof value === 'boolean' ? '' : typeof value === 'string' || typeof value === 'number' ? String(value) : normalizeSlotContent(value.children);
|
|
80
|
+
const renderContent = () => props.semanticContent ?? normalizeSlotContent(slots.default?.());
|
|
81
|
+
const fixture = computed(() => props.fixture);
|
|
82
|
+
const semanticValues = Object.assign({}, useAttrs(), props);
|
|
83
|
+
const semanticEqual = (left, right) => JSON.stringify(left) === JSON.stringify(right);
|
|
84
|
+
const fixtureText = (value) => value && typeof value === 'object' ? String(typeof value.text === 'string' ? value.text : '') + (Array.isArray(value.children) ? value.children.map(fixtureText).join('') : '') : '';
|
|
85
|
+
const __returned__ = { modelDigest, contentBindingDigest, props, dropdownFixture, fixtureChildren, fixturePart, partText, triggerPart, contentPart, menuEntries, triggerRef, itemRefs, open, submenuOpen, activeIndex, disabledSkipped, setOpen, focusEntry, openMenu, triggerKey, selectItem, entryKey, slots, styles, normalizeSlotContent, renderContent, fixture, semanticValues, semanticEqual, fixtureText };
|
|
86
|
+
Object.defineProperty(__returned__, '__isScriptSetup', { enumerable: false, value: true });
|
|
87
|
+
return __returned__;
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
import { toDisplayString as _toDisplayString, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, createElementVNode as _createElementVNode, Teleport as _Teleport, createBlock as _createBlock, createTextVNode as _createTextVNode, mergeProps as _mergeProps } from "vue";
|
|
91
|
+
const _hoisted_1 = ["aria-expanded", "data-disabled-skipped"];
|
|
92
|
+
const _hoisted_2 = { role: "menu" };
|
|
93
|
+
const _hoisted_3 = ["tabindex", "disabled", "data-highlighted", "onClick"];
|
|
94
|
+
const _hoisted_4 = ["tabindex", "data-highlighted", "aria-expanded"];
|
|
95
|
+
const _hoisted_5 = {
|
|
96
|
+
key: 2,
|
|
97
|
+
role: "menu"
|
|
98
|
+
};
|
|
99
|
+
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
100
|
+
return (_openBlock(), _createElementBlock("button", _mergeProps({ ref: "triggerRef" }, _ctx.$attrs, {
|
|
101
|
+
type: "button",
|
|
102
|
+
tabindex: "0",
|
|
103
|
+
"aria-haspopup": "menu",
|
|
104
|
+
"aria-expanded": $setup.open,
|
|
105
|
+
"data-kumo-component": "DropdownMenu",
|
|
106
|
+
"data-kumo-part": "trigger",
|
|
107
|
+
"data-disabled-skipped": $setup.disabledSkipped || undefined,
|
|
108
|
+
onClick: _cache[0] || (_cache[0] = $event => ($setup.openMenu(false))),
|
|
109
|
+
onKeydown: $setup.triggerKey
|
|
110
|
+
}), [
|
|
111
|
+
_createTextVNode(_toDisplayString($setup.partText($setup.triggerPart)), 1 /* TEXT */),
|
|
112
|
+
($setup.open)
|
|
113
|
+
? (_openBlock(), _createBlock(_Teleport, {
|
|
114
|
+
key: 0,
|
|
115
|
+
to: "body"
|
|
116
|
+
}, [
|
|
117
|
+
_createElementVNode("div", _hoisted_2, [
|
|
118
|
+
(_openBlock(true), _createElementBlock(_Fragment, null, _renderList($setup.menuEntries, (entry, index) => {
|
|
119
|
+
return (_openBlock(), _createElementBlock(_Fragment, { key: index }, [
|
|
120
|
+
(entry.export === '.Item')
|
|
121
|
+
? (_openBlock(), _createElementBlock("button", {
|
|
122
|
+
key: 0,
|
|
123
|
+
ref_for: true,
|
|
124
|
+
ref: el => { if (el)
|
|
125
|
+
$setup.itemRefs[index] = el; },
|
|
126
|
+
type: "button",
|
|
127
|
+
role: "menuitem",
|
|
128
|
+
tabindex: $setup.activeIndex === index ? 0 : -1,
|
|
129
|
+
disabled: entry.props?.disabled || undefined,
|
|
130
|
+
"data-highlighted": $setup.activeIndex === index || undefined,
|
|
131
|
+
onClick: $event => ($setup.selectItem(entry)),
|
|
132
|
+
onKeydown: $setup.entryKey
|
|
133
|
+
}, _toDisplayString($setup.partText(entry)), 41 /* TEXT, PROPS, NEED_HYDRATION */, _hoisted_3))
|
|
134
|
+
: (_openBlock(), _createElementBlock("button", {
|
|
135
|
+
key: 1,
|
|
136
|
+
ref_for: true,
|
|
137
|
+
ref: el => { if (el)
|
|
138
|
+
$setup.itemRefs[index] = el; },
|
|
139
|
+
type: "button",
|
|
140
|
+
role: "menuitem",
|
|
141
|
+
tabindex: $setup.activeIndex === index ? 0 : -1,
|
|
142
|
+
"data-highlighted": $setup.activeIndex === index || undefined,
|
|
143
|
+
"aria-haspopup": "menu",
|
|
144
|
+
"aria-expanded": $setup.submenuOpen,
|
|
145
|
+
onKeydown: $setup.entryKey
|
|
146
|
+
}, _toDisplayString($setup.partText($setup.fixturePart(entry, '.SubTrigger'))), 41 /* TEXT, PROPS, NEED_HYDRATION */, _hoisted_4)),
|
|
147
|
+
(entry.export === '.Sub' && $setup.submenuOpen)
|
|
148
|
+
? (_openBlock(), _createElementBlock("div", _hoisted_5, [
|
|
149
|
+
(_openBlock(true), _createElementBlock(_Fragment, null, _renderList($setup.fixtureChildren($setup.fixturePart(entry, '.SubContent')), (nested, nestedIndex) => {
|
|
150
|
+
return (_openBlock(), _createElementBlock("button", {
|
|
151
|
+
key: nestedIndex,
|
|
152
|
+
type: "button",
|
|
153
|
+
role: "menuitem",
|
|
154
|
+
tabindex: "-1",
|
|
155
|
+
onKeydown: $setup.entryKey
|
|
156
|
+
}, _toDisplayString($setup.partText(nested)), 33 /* TEXT, NEED_HYDRATION */));
|
|
157
|
+
}), 128 /* KEYED_FRAGMENT */))
|
|
158
|
+
]))
|
|
159
|
+
: _createCommentVNode("v-if", true)
|
|
160
|
+
], 64 /* STABLE_FRAGMENT */));
|
|
161
|
+
}), 128 /* KEYED_FRAGMENT */))
|
|
162
|
+
])
|
|
163
|
+
]))
|
|
164
|
+
: _createCommentVNode("v-if", true)
|
|
165
|
+
], 16 /* FULL_PROPS */, _hoisted_1));
|
|
166
|
+
}
|
|
167
|
+
__sfc__.render = render;
|
|
168
|
+
__sfc__.name = "KumoDropdownMenu";
|
|
169
|
+
__sfc__.__file = "components/dropdown-menu.vue";
|
|
170
|
+
export default __sfc__;
|
|
171
|
+
|
|
172
|
+
export { __sfc__ as DropdownMenu }
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { defineComponent as _defineComponent } from 'vue';
|
|
2
|
+
const __sfc__ = /*@__PURE__*/ _defineComponent({
|
|
3
|
+
...{ inheritAttrs: false },
|
|
4
|
+
__name: 'dropdown-menu.sub-content',
|
|
5
|
+
setup(__props, { expose: __expose }) {
|
|
6
|
+
__expose();
|
|
7
|
+
const __returned__ = {};
|
|
8
|
+
Object.defineProperty(__returned__, '__isScriptSetup', { enumerable: false, value: true });
|
|
9
|
+
return __returned__;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
import { renderSlot as _renderSlot, mergeProps as _mergeProps, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
|
|
13
|
+
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
14
|
+
return (_openBlock(), _createElementBlock("span", _mergeProps(_ctx.$attrs, { "data-kumo-part": "SubContent" }), [
|
|
15
|
+
_renderSlot(_ctx.$slots, "default")
|
|
16
|
+
], 16 /* FULL_PROPS */));
|
|
17
|
+
}
|
|
18
|
+
__sfc__.render = render;
|
|
19
|
+
__sfc__.name = "KumoDropdownMenuSubContent";
|
|
20
|
+
__sfc__.__file = "components/dropdown-menu.sub-content.vue";
|
|
21
|
+
export default __sfc__;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { defineComponent as _defineComponent } from 'vue';
|
|
2
|
+
const __sfc__ = /*@__PURE__*/ _defineComponent({
|
|
3
|
+
...{ inheritAttrs: false },
|
|
4
|
+
__name: 'dropdown-menu.sub-trigger',
|
|
5
|
+
setup(__props, { expose: __expose }) {
|
|
6
|
+
__expose();
|
|
7
|
+
const __returned__ = {};
|
|
8
|
+
Object.defineProperty(__returned__, '__isScriptSetup', { enumerable: false, value: true });
|
|
9
|
+
return __returned__;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
import { renderSlot as _renderSlot, mergeProps as _mergeProps, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
|
|
13
|
+
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
14
|
+
return (_openBlock(), _createElementBlock("span", _mergeProps(_ctx.$attrs, { "data-kumo-part": "SubTrigger" }), [
|
|
15
|
+
_renderSlot(_ctx.$slots, "default")
|
|
16
|
+
], 16 /* FULL_PROPS */));
|
|
17
|
+
}
|
|
18
|
+
__sfc__.render = render;
|
|
19
|
+
__sfc__.name = "KumoDropdownMenuSubTrigger";
|
|
20
|
+
__sfc__.__file = "components/dropdown-menu.sub-trigger.vue";
|
|
21
|
+
export default __sfc__;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { defineComponent as _defineComponent } from 'vue';
|
|
2
|
+
const __sfc__ = /*@__PURE__*/ _defineComponent({
|
|
3
|
+
...{ inheritAttrs: false },
|
|
4
|
+
__name: 'dropdown-menu.sub',
|
|
5
|
+
setup(__props, { expose: __expose }) {
|
|
6
|
+
__expose();
|
|
7
|
+
const __returned__ = {};
|
|
8
|
+
Object.defineProperty(__returned__, '__isScriptSetup', { enumerable: false, value: true });
|
|
9
|
+
return __returned__;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
import { renderSlot as _renderSlot, mergeProps as _mergeProps, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
|
|
13
|
+
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
14
|
+
return (_openBlock(), _createElementBlock("span", _mergeProps(_ctx.$attrs, { "data-kumo-part": "Sub" }), [
|
|
15
|
+
_renderSlot(_ctx.$slots, "default")
|
|
16
|
+
], 16 /* FULL_PROPS */));
|
|
17
|
+
}
|
|
18
|
+
__sfc__.render = render;
|
|
19
|
+
__sfc__.name = "KumoDropdownMenuSub";
|
|
20
|
+
__sfc__.__file = "components/dropdown-menu.sub.vue";
|
|
21
|
+
export default __sfc__;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { defineComponent as _defineComponent } from 'vue';
|
|
2
|
+
const __sfc__ = /*@__PURE__*/ _defineComponent({
|
|
3
|
+
...{ inheritAttrs: false },
|
|
4
|
+
__name: 'dropdown-menu.trigger',
|
|
5
|
+
setup(__props, { expose: __expose }) {
|
|
6
|
+
__expose();
|
|
7
|
+
const __returned__ = {};
|
|
8
|
+
Object.defineProperty(__returned__, '__isScriptSetup', { enumerable: false, value: true });
|
|
9
|
+
return __returned__;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
import { renderSlot as _renderSlot, mergeProps as _mergeProps, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
|
|
13
|
+
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
14
|
+
return (_openBlock(), _createElementBlock("span", _mergeProps(_ctx.$attrs, { "data-kumo-part": "Trigger" }), [
|
|
15
|
+
_renderSlot(_ctx.$slots, "default")
|
|
16
|
+
], 16 /* FULL_PROPS */));
|
|
17
|
+
}
|
|
18
|
+
__sfc__.render = render;
|
|
19
|
+
__sfc__.name = "KumoDropdownMenuTrigger";
|
|
20
|
+
__sfc__.__file = "components/dropdown-menu.trigger.vue";
|
|
21
|
+
export default __sfc__;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// @generated by src/kumo/emitters/vue/index.mjs; do not edit
|
|
2
|
+
import type { DefineComponent } from 'vue';
|
|
3
|
+
export interface EmptyProps { [key: string]: unknown }
|
|
4
|
+
declare const component: DefineComponent<EmptyProps>;
|
|
5
|
+
export default component;
|
|
6
|
+
export declare const modelDigest: "7c44f85a5193723c0aa68789e6ac8207071d68aca9e4b9d56bc93a57b3ecf50e";
|
|
7
|
+
|
|
8
|
+
export { component as Empty };
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { defineComponent as _defineComponent } from 'vue';
|
|
2
|
+
import { computed, useAttrs, useSlots } from 'vue';
|
|
3
|
+
export const modelDigest = "7c44f85a5193723c0aa68789e6ac8207071d68aca9e4b9d56bc93a57b3ecf50e";
|
|
4
|
+
export const contentBindingDigest = "a6655036dbbdb2cd56a9e62bf5f2f8f75bb6a7bb4d3c5fbf41726fd8666277cd";
|
|
5
|
+
const __sfc__ = /*@__PURE__*/ _defineComponent({
|
|
6
|
+
__name: 'empty',
|
|
7
|
+
props: {
|
|
8
|
+
className: { type: String, required: false },
|
|
9
|
+
commandLine: { type: String, required: false },
|
|
10
|
+
contents: { type: null, required: false },
|
|
11
|
+
description: { type: String, required: false },
|
|
12
|
+
icon: { type: null, required: false },
|
|
13
|
+
size: { type: String, required: false, default: "base" },
|
|
14
|
+
title: { type: String, required: true },
|
|
15
|
+
fixture: { type: null, required: false },
|
|
16
|
+
semanticContent: { type: null, required: false }
|
|
17
|
+
},
|
|
18
|
+
setup(__props, { expose: __expose }) {
|
|
19
|
+
__expose();
|
|
20
|
+
const props = __props;
|
|
21
|
+
const slots = useSlots();
|
|
22
|
+
const styles = {};
|
|
23
|
+
const normalizeSlotContent = (value) => Array.isArray(value) ? value.map(normalizeSlotContent).join('') : value == null || typeof value === 'boolean' ? '' : typeof value === 'string' || typeof value === 'number' ? String(value) : normalizeSlotContent(value.children);
|
|
24
|
+
const renderContent = () => props.semanticContent ?? normalizeSlotContent(slots.default?.());
|
|
25
|
+
const fixture = computed(() => props.fixture);
|
|
26
|
+
const semanticValues = Object.assign({}, useAttrs(), props);
|
|
27
|
+
const semanticEqual = (left, right) => JSON.stringify(left) === JSON.stringify(right);
|
|
28
|
+
const fixtureText = (value) => value && typeof value === 'object' ? String(typeof value.text === 'string' ? value.text : '') + (Array.isArray(value.children) ? value.children.map(fixtureText).join('') : '') : '';
|
|
29
|
+
const __returned__ = { modelDigest, contentBindingDigest, props, slots, styles, normalizeSlotContent, renderContent, fixture, semanticValues, semanticEqual, fixtureText };
|
|
30
|
+
Object.defineProperty(__returned__, '__isScriptSetup', { enumerable: false, value: true });
|
|
31
|
+
return __returned__;
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
import { toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, renderSlot as _renderSlot, createTextVNode as _createTextVNode, normalizeClass as _normalizeClass } from "vue";
|
|
35
|
+
const _hoisted_1 = {
|
|
36
|
+
key: 0,
|
|
37
|
+
class: "px-6 py-8 gap-4"
|
|
38
|
+
};
|
|
39
|
+
const _hoisted_2 = {
|
|
40
|
+
key: 1,
|
|
41
|
+
class: "px-10 py-16 gap-6"
|
|
42
|
+
};
|
|
43
|
+
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
44
|
+
return (Object.prototype.hasOwnProperty.call($setup.semanticValues, "description") && $setup.semanticEqual($setup.semanticValues.description, "Try again") && Object.prototype.hasOwnProperty.call($setup.semanticValues, "size") && $setup.semanticEqual($setup.semanticValues.size, "sm") && Object.prototype.hasOwnProperty.call($setup.semanticValues, "title") && $setup.semanticEqual($setup.semanticValues.title, "Empty"))
|
|
45
|
+
? (_openBlock(), _createElementBlock("div", _hoisted_1, [
|
|
46
|
+
_createElementVNode("h2", null, _toDisplayString($setup.semanticValues.title), 1 /* TEXT */),
|
|
47
|
+
_createElementVNode("p", null, _toDisplayString($setup.semanticValues.description), 1 /* TEXT */)
|
|
48
|
+
]))
|
|
49
|
+
: (Object.prototype.hasOwnProperty.call($setup.semanticValues, "title") && $setup.semanticEqual($setup.semanticValues.title, "No results"))
|
|
50
|
+
? (_openBlock(), _createElementBlock("div", _hoisted_2, [
|
|
51
|
+
_createElementVNode("h2", null, _toDisplayString($setup.semanticValues.title), 1 /* TEXT */)
|
|
52
|
+
]))
|
|
53
|
+
: (_openBlock(), _createElementBlock("section", {
|
|
54
|
+
key: 2,
|
|
55
|
+
class: _normalizeClass([$setup.styles["root"]])
|
|
56
|
+
}, [
|
|
57
|
+
_renderSlot(_ctx.$slots, "icon"),
|
|
58
|
+
_createTextVNode(_toDisplayString($setup.props.title), 1 /* TEXT */),
|
|
59
|
+
_renderSlot(_ctx.$slots, "description"),
|
|
60
|
+
_renderSlot(_ctx.$slots, "contents")
|
|
61
|
+
], 2 /* CLASS */));
|
|
62
|
+
}
|
|
63
|
+
__sfc__.render = render;
|
|
64
|
+
__sfc__.name = "KumoEmpty";
|
|
65
|
+
__sfc__.__file = "components/empty.vue";
|
|
66
|
+
export default __sfc__;
|
|
67
|
+
|
|
68
|
+
export { __sfc__ as Empty }
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { DefineComponent } from 'vue';
|
|
2
|
+
export interface FieldProps { [key: string]: unknown }
|
|
3
|
+
declare const component: DefineComponent<FieldProps>;
|
|
4
|
+
export default component;
|
|
5
|
+
export declare const modelDigest: "c8c1c62130c1f34d0061c3ea6adadfe4728a10920f9906960684ff48e50325c7";
|
|
6
|
+
|
|
7
|
+
export { component as Field };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{defineComponent,h}from'vue';import Semantic from'./field.semantic.js';import Legacy from'./field.legacy.js';
|
|
2
|
+
const variants=[{"id":"optional","when":[{"kind":"fixture-equals","value":{"export":"root","props":{"label":"Name","description":"Help","required":false},"children":[{"export":".NativeInput","props":{"id":"field-control"},"children":[]}]}}]}];const equal=(a,b)=>JSON.stringify(a)===JSON.stringify(b);const text=v=>Array.isArray(v)?v.map(text).join(''):v==null||typeof v==='boolean'?'':typeof v==='string'||typeof v==='number'?String(v):text(v.children);const matches=(when,values,fixture)=>when.every(p=>p.kind==='prop-equals'?equal(p.name==='children'?values.children:values[p.name],p.value):p.kind==='fixture-equals'?equal(fixture,p.value):false);const Bridge=defineComponent({name:"KumoFieldBridge",inheritAttrs:false,setup(_,{attrs,slots}){return()=>{const content=text(slots.default?.()),values={...attrs,children:content},semantic=variants.some(v=>matches(v.when,values,attrs.fixture));return h(semantic?Semantic:Legacy,semantic?{...attrs,semanticContent:content}:attrs,slots)}}});export{Bridge as Field};export default Bridge;
|