@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,200 @@
|
|
|
1
|
+
import { defineComponent as _defineComponent } from 'vue';
|
|
2
|
+
import { computed, getCurrentInstance, nextTick, onMounted, ref, useAttrs, useSlots } from 'vue';
|
|
3
|
+
export const modelDigest = "0c3f889199eb1006a83fb3d1f7315e54f420dbb14327c8661decd4eb1b7a3215";
|
|
4
|
+
export const contentBindingDigest = "a6655036dbbdb2cd56a9e62bf5f2f8f75bb6a7bb4d3c5fbf41726fd8666277cd";
|
|
5
|
+
const __sfc__ = /*@__PURE__*/ _defineComponent({
|
|
6
|
+
...{ inheritAttrs: false },
|
|
7
|
+
__name: 'select',
|
|
8
|
+
props: {
|
|
9
|
+
"aria-label/aria-labelledby": { type: null, required: false },
|
|
10
|
+
children: { type: null, required: false },
|
|
11
|
+
container: { type: null, required: false },
|
|
12
|
+
hideLabel: { type: Boolean, required: false },
|
|
13
|
+
items: { type: null, required: false },
|
|
14
|
+
label: { type: null, required: false },
|
|
15
|
+
"labelTooltip/description/error": { type: null, required: false },
|
|
16
|
+
"placeholder/loading/disabled/required": { type: null, required: false },
|
|
17
|
+
renderValue: { type: null, required: false },
|
|
18
|
+
Root: { type: null, required: false },
|
|
19
|
+
size: { type: String, required: false, default: "base" },
|
|
20
|
+
ariaLabel: { type: String, required: false },
|
|
21
|
+
placeholder: { type: String, required: false },
|
|
22
|
+
defaultValue: { type: null, required: false },
|
|
23
|
+
value: { type: null, required: false },
|
|
24
|
+
defaultOpen: { type: Boolean, required: false },
|
|
25
|
+
open: { type: Boolean, required: false },
|
|
26
|
+
multiple: { type: Boolean, required: false },
|
|
27
|
+
onOpenChange: { type: null, required: false },
|
|
28
|
+
onValueChange: { type: null, required: false },
|
|
29
|
+
"aria-label": { type: null, required: false },
|
|
30
|
+
fixture: { type: null, required: false },
|
|
31
|
+
semanticContent: { type: null, required: false }
|
|
32
|
+
},
|
|
33
|
+
setup(__props, { expose: __expose }) {
|
|
34
|
+
__expose();
|
|
35
|
+
const props = __props;
|
|
36
|
+
const instance = getCurrentInstance();
|
|
37
|
+
const supplied = (name) => Object.prototype.hasOwnProperty.call(instance?.vnode.props ?? {}, name);
|
|
38
|
+
const fixtureRoot = computed(() => props.fixture);
|
|
39
|
+
const fixtureTextContent = (node) => node ? String(node.text ?? '') + (node.children ?? []).map(fixtureTextContent).join('') : '';
|
|
40
|
+
const selectOptions = computed(() => (fixtureRoot.value?.children ?? []).filter(node => node.export === '.Option').map(node => ({ value: node.props?.value, label: fixtureTextContent(node), disabled: node.props?.disabled === true })));
|
|
41
|
+
const multiple = computed(() => Boolean(props.multiple));
|
|
42
|
+
const valueControlled = supplied('value');
|
|
43
|
+
const openControlled = supplied('open');
|
|
44
|
+
const internalValue = ref(supplied('defaultValue') ? props.defaultValue : (multiple.value ? [] : null));
|
|
45
|
+
const internalOpen = ref(supplied('defaultOpen') ? Boolean(props.defaultOpen) : false);
|
|
46
|
+
const selectedValue = computed(() => valueControlled ? props.value : internalValue.value);
|
|
47
|
+
const selectOpen = computed(() => openControlled ? Boolean(props.open) : internalOpen.value);
|
|
48
|
+
const triggerRef = ref(null);
|
|
49
|
+
const mounted = ref(false);
|
|
50
|
+
onMounted(() => { mounted.value = true; });
|
|
51
|
+
const optionRefs = ref([]);
|
|
52
|
+
const activeIndex = ref(-1);
|
|
53
|
+
const highlightScrolled = ref(false);
|
|
54
|
+
const selectLabel = computed(() => props.ariaLabel ?? props['aria-label']);
|
|
55
|
+
const equalValue = (a, b) => a === b || JSON.stringify(a) === JSON.stringify(b);
|
|
56
|
+
const isSelected = (value) => multiple.value ? (Array.isArray(selectedValue.value) && selectedValue.value.some(item => equalValue(item, value))) : equalValue(selectedValue.value, value);
|
|
57
|
+
function emitOpen(next) { if (!openControlled)
|
|
58
|
+
internalOpen.value = next; props.onOpenChange?.(next); }
|
|
59
|
+
function focusOption(index) {
|
|
60
|
+
activeIndex.value = index;
|
|
61
|
+
nextTick(() => { const element = optionRefs.value[index]; element?.focus(); if (element) {
|
|
62
|
+
element.scrollIntoView?.({ block: 'nearest' });
|
|
63
|
+
highlightScrolled.value = true;
|
|
64
|
+
} });
|
|
65
|
+
}
|
|
66
|
+
function firstEnabled() { return selectOptions.value.findIndex(item => !item.disabled); }
|
|
67
|
+
function lastEnabled() { for (let i = selectOptions.value.length - 1; i >= 0; i--)
|
|
68
|
+
if (!selectOptions.value[i].disabled)
|
|
69
|
+
return i; return -1; }
|
|
70
|
+
function openSelect() { if (selectOpen.value)
|
|
71
|
+
return; emitOpen(true); const index = firstEnabled(); if (index >= 0)
|
|
72
|
+
focusOption(index); }
|
|
73
|
+
function triggerKey(event) { if (event.key === 'ArrowDown') {
|
|
74
|
+
event.preventDefault();
|
|
75
|
+
openSelect();
|
|
76
|
+
if (selectOpen.value) {
|
|
77
|
+
const index = firstEnabled();
|
|
78
|
+
if (index >= 0)
|
|
79
|
+
focusOption(index);
|
|
80
|
+
}
|
|
81
|
+
} }
|
|
82
|
+
function selectItem(item, index) {
|
|
83
|
+
if (item.disabled)
|
|
84
|
+
return;
|
|
85
|
+
if (multiple.value) {
|
|
86
|
+
const current = Array.isArray(selectedValue.value) ? selectedValue.value : [];
|
|
87
|
+
const next = current.some(value => equalValue(value, item.value)) ? current : [...current, item.value];
|
|
88
|
+
if (!valueControlled)
|
|
89
|
+
internalValue.value = next;
|
|
90
|
+
props.onValueChange?.(next);
|
|
91
|
+
focusOption(index);
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
if (!valueControlled)
|
|
95
|
+
internalValue.value = item.value;
|
|
96
|
+
props.onValueChange?.(item.value);
|
|
97
|
+
emitOpen(false);
|
|
98
|
+
if (openControlled)
|
|
99
|
+
focusOption(index);
|
|
100
|
+
else
|
|
101
|
+
nextTick(() => triggerRef.value?.focus());
|
|
102
|
+
}
|
|
103
|
+
function optionKey(event) {
|
|
104
|
+
let index = -1;
|
|
105
|
+
if (event.key === 'Home')
|
|
106
|
+
index = firstEnabled();
|
|
107
|
+
else if (event.key === 'End')
|
|
108
|
+
index = lastEnabled();
|
|
109
|
+
else if (event.key.length === 1)
|
|
110
|
+
index = selectOptions.value.findIndex(item => !item.disabled && item.label.toLocaleLowerCase().startsWith(event.key.toLocaleLowerCase()));
|
|
111
|
+
else if (event.key === 'Escape') {
|
|
112
|
+
event.preventDefault();
|
|
113
|
+
emitOpen(false);
|
|
114
|
+
nextTick(() => triggerRef.value?.focus());
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
else if (event.key === 'Tab') {
|
|
118
|
+
event.preventDefault();
|
|
119
|
+
emitOpen(false);
|
|
120
|
+
nextTick(() => triggerRef.value?.focus());
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
else
|
|
124
|
+
return;
|
|
125
|
+
if (index >= 0) {
|
|
126
|
+
event.preventDefault();
|
|
127
|
+
focusOption(index);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
const slots = useSlots();
|
|
131
|
+
const styles = {};
|
|
132
|
+
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);
|
|
133
|
+
const renderContent = () => props.semanticContent ?? normalizeSlotContent(slots.default?.());
|
|
134
|
+
const fixture = computed(() => props.fixture);
|
|
135
|
+
const semanticValues = Object.assign({}, useAttrs(), props);
|
|
136
|
+
const semanticEqual = (left, right) => JSON.stringify(left) === JSON.stringify(right);
|
|
137
|
+
const fixtureText = (value) => value && typeof value === 'object' ? String(typeof value.text === 'string' ? value.text : '') + (Array.isArray(value.children) ? value.children.map(fixtureText).join('') : '') : '';
|
|
138
|
+
const __returned__ = { modelDigest, contentBindingDigest, props, instance, supplied, fixtureRoot, fixtureTextContent, selectOptions, multiple, valueControlled, openControlled, internalValue, internalOpen, selectedValue, selectOpen, triggerRef, mounted, optionRefs, activeIndex, highlightScrolled, selectLabel, equalValue, isSelected, emitOpen, focusOption, firstEnabled, lastEnabled, openSelect, triggerKey, selectItem, optionKey, slots, styles, normalizeSlotContent, renderContent, fixture, semanticValues, semanticEqual, fixtureText };
|
|
139
|
+
Object.defineProperty(__returned__, '__isScriptSetup', { enumerable: false, value: true });
|
|
140
|
+
return __returned__;
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
import { createElementVNode as _createElementVNode, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, Teleport as _Teleport, createBlock as _createBlock, createCommentVNode as _createCommentVNode, normalizeProps as _normalizeProps, guardReactiveProps as _guardReactiveProps } from "vue";
|
|
144
|
+
const _hoisted_1 = ["aria-expanded", "aria-label", "data-placeholder"];
|
|
145
|
+
const _hoisted_2 = ["aria-multiselectable", "data-highlight-scrolled"];
|
|
146
|
+
const _hoisted_3 = ["aria-selected", "aria-disabled", "data-value", "data-highlighted", "data-selected", "onClick"];
|
|
147
|
+
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
148
|
+
return (_openBlock(), _createElementBlock("div", _normalizeProps(_guardReactiveProps(_ctx.$attrs)), [
|
|
149
|
+
_createElementVNode("button", {
|
|
150
|
+
ref: "triggerRef",
|
|
151
|
+
type: "button",
|
|
152
|
+
tabindex: "0",
|
|
153
|
+
role: "combobox",
|
|
154
|
+
"aria-expanded": String($setup.selectOpen),
|
|
155
|
+
"aria-haspopup": "listbox",
|
|
156
|
+
"aria-label": $setup.selectLabel,
|
|
157
|
+
"data-kumo-component": "Select",
|
|
158
|
+
"data-kumo-part": "trigger",
|
|
159
|
+
"data-placeholder": $setup.selectedValue == null || ($setup.multiple && $setup.selectedValue.length === 0) ? '' : undefined,
|
|
160
|
+
onClick: $setup.openSelect,
|
|
161
|
+
onKeydown: $setup.triggerKey
|
|
162
|
+
}, null, 40 /* PROPS, NEED_HYDRATION */, _hoisted_1),
|
|
163
|
+
($setup.mounted && $setup.selectOpen)
|
|
164
|
+
? (_openBlock(), _createBlock(_Teleport, {
|
|
165
|
+
key: 0,
|
|
166
|
+
to: "body"
|
|
167
|
+
}, [
|
|
168
|
+
_createElementVNode("div", {
|
|
169
|
+
role: "listbox",
|
|
170
|
+
"aria-multiselectable": $setup.multiple || undefined,
|
|
171
|
+
"data-highlight-scrolled": $setup.highlightScrolled || undefined
|
|
172
|
+
}, [
|
|
173
|
+
(_openBlock(true), _createElementBlock(_Fragment, null, _renderList($setup.selectOptions, (item, index) => {
|
|
174
|
+
return (_openBlock(), _createElementBlock("div", {
|
|
175
|
+
key: index,
|
|
176
|
+
ref_for: true,
|
|
177
|
+
ref: element => { if (element)
|
|
178
|
+
$setup.optionRefs[index] = element; },
|
|
179
|
+
role: "option",
|
|
180
|
+
tabindex: "-1",
|
|
181
|
+
"aria-selected": $setup.isSelected(item.value),
|
|
182
|
+
"aria-disabled": item.disabled || undefined,
|
|
183
|
+
"data-value": typeof item.value === 'object' ? item.value?.id : item.value,
|
|
184
|
+
"data-highlighted": $setup.activeIndex === index || undefined,
|
|
185
|
+
"data-selected": $setup.isSelected(item.value) || undefined,
|
|
186
|
+
onClick: $event => ($setup.selectItem(item, index)),
|
|
187
|
+
onKeydown: $setup.optionKey
|
|
188
|
+
}, _toDisplayString(item.label), 41 /* TEXT, PROPS, NEED_HYDRATION */, _hoisted_3));
|
|
189
|
+
}), 128 /* KEYED_FRAGMENT */))
|
|
190
|
+
], 8 /* PROPS */, _hoisted_2)
|
|
191
|
+
]))
|
|
192
|
+
: _createCommentVNode("v-if", true)
|
|
193
|
+
], 16 /* FULL_PROPS */));
|
|
194
|
+
}
|
|
195
|
+
__sfc__.render = render;
|
|
196
|
+
__sfc__.name = "KumoSelect";
|
|
197
|
+
__sfc__.__file = "components/select.vue";
|
|
198
|
+
export default __sfc__;
|
|
199
|
+
|
|
200
|
+
export { __sfc__ as Select }
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { defineComponent as _defineComponent } from 'vue';
|
|
2
|
+
const __sfc__ = /*@__PURE__*/ _defineComponent({
|
|
3
|
+
...{ inheritAttrs: false },
|
|
4
|
+
__name: 'select.option',
|
|
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": "Option" }), [
|
|
15
|
+
_renderSlot(_ctx.$slots, "default")
|
|
16
|
+
], 16 /* FULL_PROPS */));
|
|
17
|
+
}
|
|
18
|
+
__sfc__.render = render;
|
|
19
|
+
__sfc__.name = "KumoSelectOption";
|
|
20
|
+
__sfc__.__file = "components/select.option.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 SensitiveInputProps { [key: string]: unknown }
|
|
4
|
+
declare const component: DefineComponent<SensitiveInputProps>;
|
|
5
|
+
export default component;
|
|
6
|
+
export declare const modelDigest: "929d4c3eecd153af78d2db33ff8ba69333a6f6f39415ee3c65cb1d8f9eabcc3c";
|
|
7
|
+
|
|
8
|
+
export { component as SensitiveInput };
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { defineComponent as _defineComponent } from 'vue';
|
|
2
|
+
import { computed, nextTick, ref, useAttrs, useSlots } from 'vue';
|
|
3
|
+
export const modelDigest = "929d4c3eecd153af78d2db33ff8ba69333a6f6f39415ee3c65cb1d8f9eabcc3c";
|
|
4
|
+
export const contentBindingDigest = "a6655036dbbdb2cd56a9e62bf5f2f8f75bb6a7bb4d3c5fbf41726fd8666277cd";
|
|
5
|
+
const __sfc__ = /*@__PURE__*/ _defineComponent({
|
|
6
|
+
...{ inheritAttrs: false },
|
|
7
|
+
__name: 'sensitive-input',
|
|
8
|
+
props: {
|
|
9
|
+
observable: { type: null, required: false },
|
|
10
|
+
onValueChange: { type: null, required: false },
|
|
11
|
+
onCopy: { type: null, required: false },
|
|
12
|
+
defaultValue: { type: null, required: false },
|
|
13
|
+
label: { type: null, required: false },
|
|
14
|
+
fixture: { type: null, required: false },
|
|
15
|
+
semanticContent: { type: null, required: false }
|
|
16
|
+
},
|
|
17
|
+
setup(__props, { expose: __expose }) {
|
|
18
|
+
__expose();
|
|
19
|
+
const props = __props;
|
|
20
|
+
const sensitiveValue = ref(props.defaultValue ?? '');
|
|
21
|
+
const revealed = ref(false);
|
|
22
|
+
const sensitiveInputRef = ref(null);
|
|
23
|
+
const copyAnnouncement = ref('');
|
|
24
|
+
function revealValue() {
|
|
25
|
+
revealed.value = true;
|
|
26
|
+
nextTick(() => sensitiveInputRef.value?.focus());
|
|
27
|
+
}
|
|
28
|
+
function updateSensitiveValue(event) {
|
|
29
|
+
sensitiveValue.value = event.currentTarget.value;
|
|
30
|
+
props.onValueChange?.(sensitiveValue.value);
|
|
31
|
+
}
|
|
32
|
+
async function copySensitiveValue() {
|
|
33
|
+
await navigator.clipboard.writeText(sensitiveValue.value);
|
|
34
|
+
copyAnnouncement.value = 'Copied to clipboard';
|
|
35
|
+
props.onCopy?.();
|
|
36
|
+
}
|
|
37
|
+
const slots = useSlots();
|
|
38
|
+
const styles = {};
|
|
39
|
+
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);
|
|
40
|
+
const renderContent = () => props.semanticContent ?? normalizeSlotContent(slots.default?.());
|
|
41
|
+
const fixture = computed(() => props.fixture);
|
|
42
|
+
const semanticValues = Object.assign({}, useAttrs(), props);
|
|
43
|
+
const semanticEqual = (left, right) => JSON.stringify(left) === JSON.stringify(right);
|
|
44
|
+
const fixtureText = (value) => value && typeof value === 'object' ? String(typeof value.text === 'string' ? value.text : '') + (Array.isArray(value.children) ? value.children.map(fixtureText).join('') : '') : '';
|
|
45
|
+
const __returned__ = { modelDigest, contentBindingDigest, props, sensitiveValue, revealed, sensitiveInputRef, copyAnnouncement, revealValue, updateSensitiveValue, copySensitiveValue, slots, styles, normalizeSlotContent, renderContent, fixture, semanticValues, semanticEqual, fixtureText };
|
|
46
|
+
Object.defineProperty(__returned__, '__isScriptSetup', { enumerable: false, value: true });
|
|
47
|
+
return __returned__;
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
import { toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, mergeProps as _mergeProps, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
|
|
51
|
+
const _hoisted_1 = ["value"];
|
|
52
|
+
const _hoisted_2 = { "aria-live": "polite" };
|
|
53
|
+
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
54
|
+
return (_openBlock(), _createElementBlock("div", _mergeProps(_ctx.$attrs, { "data-kumo-component": "SensitiveInput" }), [
|
|
55
|
+
_createElementVNode("label", null, _toDisplayString($setup.props.label), 1 /* TEXT */),
|
|
56
|
+
_createElementVNode("div", {
|
|
57
|
+
"data-kumo-part": "masked-container",
|
|
58
|
+
onClick: $setup.revealValue
|
|
59
|
+
}, _toDisplayString($setup.revealed ? $setup.sensitiveValue : 'Value hidden'), 1 /* TEXT */),
|
|
60
|
+
_createElementVNode("input", {
|
|
61
|
+
ref: "sensitiveInputRef",
|
|
62
|
+
type: "password",
|
|
63
|
+
value: $setup.sensitiveValue,
|
|
64
|
+
onInput: $setup.updateSensitiveValue
|
|
65
|
+
}, null, 40 /* PROPS, NEED_HYDRATION */, _hoisted_1),
|
|
66
|
+
_createElementVNode("button", {
|
|
67
|
+
type: "button",
|
|
68
|
+
onClick: $setup.revealValue
|
|
69
|
+
}, "Reveal"),
|
|
70
|
+
_createElementVNode("button", {
|
|
71
|
+
type: "button",
|
|
72
|
+
onClick: $setup.copySensitiveValue
|
|
73
|
+
}, "Copy"),
|
|
74
|
+
_createElementVNode("div", _hoisted_2, _toDisplayString($setup.copyAnnouncement), 1 /* TEXT */)
|
|
75
|
+
], 16 /* FULL_PROPS */));
|
|
76
|
+
}
|
|
77
|
+
__sfc__.render = render;
|
|
78
|
+
__sfc__.name = "KumoSensitiveInput";
|
|
79
|
+
__sfc__.__file = "components/sensitive-input.vue";
|
|
80
|
+
export default __sfc__;
|
|
81
|
+
|
|
82
|
+
export { __sfc__ as SensitiveInput }
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { defineComponent as _defineComponent } from 'vue';
|
|
2
|
+
const __sfc__ = /*@__PURE__*/ _defineComponent({
|
|
3
|
+
...{ inheritAttrs: false },
|
|
4
|
+
__name: 'sidebar.collapsible-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": "CollapsibleContent" }), [
|
|
15
|
+
_renderSlot(_ctx.$slots, "default")
|
|
16
|
+
], 16 /* FULL_PROPS */));
|
|
17
|
+
}
|
|
18
|
+
__sfc__.render = render;
|
|
19
|
+
__sfc__.name = "KumoSidebarCollapsibleContent";
|
|
20
|
+
__sfc__.__file = "components/sidebar.collapsible-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: 'sidebar.collapsible',
|
|
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": "Collapsible" }), [
|
|
15
|
+
_renderSlot(_ctx.$slots, "default")
|
|
16
|
+
], 16 /* FULL_PROPS */));
|
|
17
|
+
}
|
|
18
|
+
__sfc__.render = render;
|
|
19
|
+
__sfc__.name = "KumoSidebarCollapsible";
|
|
20
|
+
__sfc__.__file = "components/sidebar.collapsible.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: 'sidebar.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 = "KumoSidebarContent";
|
|
20
|
+
__sfc__.__file = "components/sidebar.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 SidebarProps { [key: string]: unknown }
|
|
4
|
+
declare const component: DefineComponent<SidebarProps>;
|
|
5
|
+
export default component;
|
|
6
|
+
export declare const modelDigest: "25a19cbe99e84a9f4daf06d56a4f43a039827812a3623bc39919eb4683550b77";
|
|
7
|
+
|
|
8
|
+
export { component as Sidebar };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { defineComponent as _defineComponent } from 'vue';
|
|
2
|
+
const __sfc__ = /*@__PURE__*/ _defineComponent({
|
|
3
|
+
...{ inheritAttrs: false },
|
|
4
|
+
__name: 'sidebar.footer',
|
|
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": "Footer" }), [
|
|
15
|
+
_renderSlot(_ctx.$slots, "default")
|
|
16
|
+
], 16 /* FULL_PROPS */));
|
|
17
|
+
}
|
|
18
|
+
__sfc__.render = render;
|
|
19
|
+
__sfc__.name = "KumoSidebarFooter";
|
|
20
|
+
__sfc__.__file = "components/sidebar.footer.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: 'sidebar.group-label',
|
|
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": "GroupLabel" }), [
|
|
15
|
+
_renderSlot(_ctx.$slots, "default")
|
|
16
|
+
], 16 /* FULL_PROPS */));
|
|
17
|
+
}
|
|
18
|
+
__sfc__.render = render;
|
|
19
|
+
__sfc__.name = "KumoSidebarGroupLabel";
|
|
20
|
+
__sfc__.__file = "components/sidebar.group-label.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: 'sidebar.group',
|
|
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": "Group" }), [
|
|
15
|
+
_renderSlot(_ctx.$slots, "default")
|
|
16
|
+
], 16 /* FULL_PROPS */));
|
|
17
|
+
}
|
|
18
|
+
__sfc__.render = render;
|
|
19
|
+
__sfc__.name = "KumoSidebarGroup";
|
|
20
|
+
__sfc__.__file = "components/sidebar.group.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: 'sidebar.header',
|
|
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": "Header" }), [
|
|
15
|
+
_renderSlot(_ctx.$slots, "default")
|
|
16
|
+
], 16 /* FULL_PROPS */));
|
|
17
|
+
}
|
|
18
|
+
__sfc__.render = render;
|
|
19
|
+
__sfc__.name = "KumoSidebarHeader";
|
|
20
|
+
__sfc__.__file = "components/sidebar.header.vue";
|
|
21
|
+
export default __sfc__;
|