@kernel4632/kima 0.0.0-stage → 0.6.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/LICENSE +21 -0
- package/README.md +209 -2
- package/dist/THIRD_PARTY_NOTICES.txt +2676 -0
- package/dist/kima-elements-core.js +53209 -0
- package/dist/kima-elements.js +126371 -0
- package/dist/kima-theme.js +1583 -0
- package/dist/kima.js +141 -0
- package/dist/style.css +2 -0
- package/dist/vue/_virtual/_plugin-vue_export-helper.js +7 -0
- package/dist/vue/components/advanced-input/calendar.ce.js +216 -0
- package/dist/vue/components/advanced-input/date-range-picker.ce.js +224 -0
- package/dist/vue/components/advanced-input/editable.ce.js +160 -0
- package/dist/vue/components/advanced-input/mention.ce.js +181 -0
- package/dist/vue/components/advanced-input/range-slider.ce.js +111 -0
- package/dist/vue/components/advanced-input/time-range-picker.ce.js +120 -0
- package/dist/vue/components/advanced-input/transfer.ce.js +192 -0
- package/dist/vue/components/content/chart.ce.js +282 -0
- package/dist/vue/components/content/code-editor.ce.js +309 -0
- package/dist/vue/components/content/equation.ce.js +69 -0
- package/dist/vue/components/content/heatmap.ce.js +148 -0
- package/dist/vue/components/content/rich-text-editor.ce.js +319 -0
- package/dist/vue/components/core/badge.ce.js +66 -0
- package/dist/vue/components/core/button-group.ce.js +142 -0
- package/dist/vue/components/core/button.ce.js +73 -0
- package/dist/vue/components/core/card.ce.js +73 -0
- package/dist/vue/components/core/cascader.ce.js +329 -0
- package/dist/vue/components/core/checkbox.ce.js +116 -0
- package/dist/vue/components/core/code-block.ce.js +108 -0
- package/dist/vue/components/core/combobox.ce.js +354 -0
- package/dist/vue/components/core/date-picker.ce.js +433 -0
- package/dist/vue/components/core/dialog.ce.js +118 -0
- package/dist/vue/components/core/divider.ce.js +49 -0
- package/dist/vue/components/core/drawer.ce.js +235 -0
- package/dist/vue/components/core/empty-state.ce.js +58 -0
- package/dist/vue/components/core/icon-button.ce.js +93 -0
- package/dist/vue/components/core/icon.ce.js +42 -0
- package/dist/vue/components/core/layout.ce.js +68 -0
- package/dist/vue/components/core/menu.ce.js +178 -0
- package/dist/vue/components/core/notification.ce.js +158 -0
- package/dist/vue/components/core/pagination.ce.js +158 -0
- package/dist/vue/components/core/progress.ce.js +49 -0
- package/dist/vue/components/core/select.ce.js +325 -0
- package/dist/vue/components/core/slider.ce.js +116 -0
- package/dist/vue/components/core/switch.ce.js +100 -0
- package/dist/vue/components/core/tabs.ce.js +193 -0
- package/dist/vue/components/core/text-field.ce.js +194 -0
- package/dist/vue/components/core/time-picker.ce.js +486 -0
- package/dist/vue/components/core/tooltip.ce.js +125 -0
- package/dist/vue/components/core/tree.ce.js +248 -0
- package/dist/vue/components/core/virtual-scroll.ce.js +176 -0
- package/dist/vue/components/data/copy-button.ce.js +75 -0
- package/dist/vue/components/data/image-preview.ce.js +226 -0
- package/dist/vue/components/data/infinite-scroll.ce.js +126 -0
- package/dist/vue/components/data/long-text.ce.js +70 -0
- package/dist/vue/components/data/relative-time.ce.js +77 -0
- package/dist/vue/components/data/ring-progress.ce.js +87 -0
- package/dist/vue/components/data/table.ce.js +491 -0
- package/dist/vue/components/data/virtual-table.ce.js +178 -0
- package/dist/vue/components/data/virtual-tree.ce.js +213 -0
- package/dist/vue/components/display/alert.ce.js +101 -0
- package/dist/vue/components/display/avatar-group.ce.js +65 -0
- package/dist/vue/components/display/avatar.ce.js +84 -0
- package/dist/vue/components/display/blockquote.ce.js +44 -0
- package/dist/vue/components/display/countdown.ce.js +77 -0
- package/dist/vue/components/display/descriptions.ce.js +43 -0
- package/dist/vue/components/display/highlight.ce.js +48 -0
- package/dist/vue/components/display/image.ce.js +146 -0
- package/dist/vue/components/display/list.ce.js +68 -0
- package/dist/vue/components/display/result.ce.js +57 -0
- package/dist/vue/components/display/skeleton.ce.js +67 -0
- package/dist/vue/components/display/spinner.ce.js +42 -0
- package/dist/vue/components/display/statistic.ce.js +71 -0
- package/dist/vue/components/display/timeline.ce.js +59 -0
- package/dist/vue/components/form-completion/angle-slider.ce.js +103 -0
- package/dist/vue/components/form-completion/color-picker.ce.js +286 -0
- package/dist/vue/components/form-completion/date-field.ce.js +131 -0
- package/dist/vue/components/form-completion/dynamic-input.ce.js +158 -0
- package/dist/vue/components/form-completion/form.ce.js +248 -0
- package/dist/vue/components/form-completion/json-input.ce.js +114 -0
- package/dist/vue/components/form-completion/masked-input.ce.js +88 -0
- package/dist/vue/components/form-completion/period-picker.ce.js +147 -0
- package/dist/vue/components/form-completion/time-field.ce.js +120 -0
- package/dist/vue/components/form-completion/upload-manager.ce.js +223 -0
- package/dist/vue/components/foundation/banner.ce.js +106 -0
- package/dist/vue/components/foundation/error-state.ce.js +108 -0
- package/dist/vue/components/foundation/field-group.ce.js +146 -0
- package/dist/vue/components/foundation/flex.ce.js +60 -0
- package/dist/vue/components/foundation/grid.ce.js +52 -0
- package/dist/vue/components/foundation/input-group.ce.js +34 -0
- package/dist/vue/components/foundation/page-header.ce.js +55 -0
- package/dist/vue/components/foundation/time-display.ce.js +129 -0
- package/dist/vue/components/foundation/typography.ce.js +71 -0
- package/dist/vue/components/input/checkbox-group.ce.js +93 -0
- package/dist/vue/components/input/field.ce.js +74 -0
- package/dist/vue/components/input/file-upload.ce.js +142 -0
- package/dist/vue/components/input/number-field.ce.js +103 -0
- package/dist/vue/components/input/pin-input.ce.js +112 -0
- package/dist/vue/components/input/radio-group.ce.js +96 -0
- package/dist/vue/components/input/rating.ce.js +115 -0
- package/dist/vue/components/input/tags-input.ce.js +153 -0
- package/dist/vue/components/input/textarea.ce.js +180 -0
- package/dist/vue/components/input/toggle.ce.js +58 -0
- package/dist/vue/components/interaction/chip.ce.js +95 -0
- package/dist/vue/components/interaction/command.ce.js +161 -0
- package/dist/vue/components/interaction/context-menu.ce.js +113 -0
- package/dist/vue/components/interaction/hover-card.ce.js +92 -0
- package/dist/vue/components/interaction/loading-overlay.ce.js +70 -0
- package/dist/vue/components/interaction/menubar.ce.js +134 -0
- package/dist/vue/components/interaction/multi-select.ce.js +264 -0
- package/dist/vue/components/interaction/popconfirm.ce.js +95 -0
- package/dist/vue/components/interaction/popover.ce.js +83 -0
- package/dist/vue/components/interaction/tree-select.ce.js +195 -0
- package/dist/vue/components/navigation/accordion.ce.js +114 -0
- package/dist/vue/components/navigation/anchor.ce.js +125 -0
- package/dist/vue/components/navigation/back-top.ce.js +67 -0
- package/dist/vue/components/navigation/breadcrumb.ce.js +48 -0
- package/dist/vue/components/navigation/carousel.ce.js +114 -0
- package/dist/vue/components/navigation/collapsible.ce.js +57 -0
- package/dist/vue/components/navigation/link.ce.js +62 -0
- package/dist/vue/components/navigation/navigation-menu.ce.js +91 -0
- package/dist/vue/components/navigation/overflow-list.ce.js +67 -0
- package/dist/vue/components/navigation/scroll-area.ce.js +47 -0
- package/dist/vue/components/navigation/splitter.ce.js +131 -0
- package/dist/vue/components/navigation/stepper.ce.js +74 -0
- package/dist/vue/components/navigation/toolbar.ce.js +93 -0
- package/dist/vue/components/navigation/visually-hidden.ce.js +16 -0
- package/dist/vue/components/shell/app-shell.ce.js +87 -0
- package/dist/vue/components/shell/config-provider.ce.js +110 -0
- package/dist/vue/components/shell/marquee.ce.js +92 -0
- package/dist/vue/components/shell/masonry.ce.js +50 -0
- package/dist/vue/components/shell/sidebar.ce.js +125 -0
- package/dist/vue/components/utility/affix.ce.js +64 -0
- package/dist/vue/components/utility/alert-dialog.ce.js +124 -0
- package/dist/vue/components/utility/animated-number.ce.js +66 -0
- package/dist/vue/components/utility/float-button.ce.js +104 -0
- package/dist/vue/components/utility/listbox.ce.js +81 -0
- package/dist/vue/components/utility/loading-bar.ce.js +85 -0
- package/dist/vue/components/utility/log-viewer.ce.js +124 -0
- package/dist/vue/components/utility/notification-queue.ce.js +109 -0
- package/dist/vue/components/utility/progress-group.ce.js +59 -0
- package/dist/vue/components/utility/qr-code.ce.js +62 -0
- package/dist/vue/components/utility/tag-group.ce.js +124 -0
- package/dist/vue/components/utility/tour.ce.js +214 -0
- package/dist/vue/components/utility/virtual-select.ce.js +207 -0
- package/dist/vue/components/utility/watermark.ce.js +44 -0
- package/dist/vue/internal/menu-items.js +184 -0
- package/dist/vue/internal/navigation-items.js +110 -0
- package/dist/vue/utils/code-highlight.js +142 -0
- package/dist/vue/utils/config.js +47 -0
- package/dist/vue/utils/content-motion.js +37 -0
- package/dist/vue/utils/content.js +83 -0
- package/dist/vue/utils/display-status.js +31 -0
- package/dist/vue/utils/foundation.js +65 -0
- package/dist/vue/utils/input-state.js +38 -0
- package/dist/vue/utils/interaction.js +103 -0
- package/dist/vue/utils/local-date.js +48 -0
- package/dist/vue/utils/motion.js +80 -0
- package/dist/vue/utils/native-slots.js +30 -0
- package/dist/vue/utils/navigation.js +44 -0
- package/dist/vue/utils/notifications.js +60 -0
- package/dist/vue/utils/qr.js +20 -0
- package/dist/vue/utils/remote-options.js +65 -0
- package/dist/vue/utils/ripple.js +20 -0
- package/dist/vue/utils/scoped-slots.js +22 -0
- package/dist/vue/utils/shell.js +43 -0
- package/dist/vue/utils/theme.js +50 -0
- package/dist/vue/utils/utility-choice.js +56 -0
- package/package.json +105 -4
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import e from "../../_virtual/_plugin-vue_export-helper.js";
|
|
2
|
+
import t from "../core/icon.ce.js";
|
|
3
|
+
/* empty css */
|
|
4
|
+
import { Fragment as n, computed as r, createElementBlock as i, createElementVNode as a, createTextVNode as o, createVNode as s, getCurrentInstance as c, mergeProps as ee, normalizeClass as te, normalizeStyle as l, onBeforeUnmount as u, onMounted as ne, openBlock as d, ref as f, renderList as p, renderSlot as m, toDisplayString as h, unref as g, useAttrs as _, useHost as v, useId as y, watch as b, withModifiers as x } from "vue";
|
|
5
|
+
import { ArrowRight01Icon as S } from "@hugeicons/core-free-icons";
|
|
6
|
+
// src/components/data/virtual-tree.ce.vue
|
|
7
|
+
var C = ["aria-multiselectable", "aria-disabled"], w = [
|
|
8
|
+
"id",
|
|
9
|
+
"aria-level",
|
|
10
|
+
"aria-posinset",
|
|
11
|
+
"aria-setsize",
|
|
12
|
+
"aria-expanded",
|
|
13
|
+
"aria-selected",
|
|
14
|
+
"tabindex",
|
|
15
|
+
"onClick",
|
|
16
|
+
"onKeydown"
|
|
17
|
+
], T = [
|
|
18
|
+
"disabled",
|
|
19
|
+
"aria-label",
|
|
20
|
+
"aria-expanded",
|
|
21
|
+
"onClick"
|
|
22
|
+
], E = {
|
|
23
|
+
key: 1,
|
|
24
|
+
class: "kima-virtual-tree__toggle--empty",
|
|
25
|
+
"aria-hidden": "true"
|
|
26
|
+
}, re = { class: "kima-virtual-tree__label" }, D = /*#__PURE__*/ e(/* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
|
|
27
|
+
__name: "virtual-tree.ce",
|
|
28
|
+
props: {
|
|
29
|
+
items: {
|
|
30
|
+
type: Array,
|
|
31
|
+
default: () => []
|
|
32
|
+
},
|
|
33
|
+
expanded: {
|
|
34
|
+
type: Array,
|
|
35
|
+
default: () => []
|
|
36
|
+
},
|
|
37
|
+
modelValue: {
|
|
38
|
+
type: [
|
|
39
|
+
String,
|
|
40
|
+
Number,
|
|
41
|
+
Boolean,
|
|
42
|
+
Array
|
|
43
|
+
],
|
|
44
|
+
default: null
|
|
45
|
+
},
|
|
46
|
+
multiple: Boolean,
|
|
47
|
+
selectable: Boolean,
|
|
48
|
+
itemHeight: {
|
|
49
|
+
type: Number,
|
|
50
|
+
default: 48
|
|
51
|
+
},
|
|
52
|
+
height: {
|
|
53
|
+
type: [Number, String],
|
|
54
|
+
default: 360
|
|
55
|
+
},
|
|
56
|
+
overscan: {
|
|
57
|
+
type: Number,
|
|
58
|
+
default: 4
|
|
59
|
+
},
|
|
60
|
+
disabled: Boolean
|
|
61
|
+
},
|
|
62
|
+
emits: [
|
|
63
|
+
"update:modelValue",
|
|
64
|
+
"update:expanded",
|
|
65
|
+
"select"
|
|
66
|
+
],
|
|
67
|
+
setup(e, { emit: D }) {
|
|
68
|
+
let O = e, k = D, A = _(), j = c()?.ce ? v() : null, M = f(null), N = f(0), P = f(0), F = f(0), I, L = f([...O.expanded]), R = f(O.modelValue), z = `kima-virtual-tree-${y()}`, B = r(() => new Set(L.value)), V = r(() => {
|
|
69
|
+
let e = [];
|
|
70
|
+
function t(n, r = 1, i = null) {
|
|
71
|
+
n.forEach((a, o) => {
|
|
72
|
+
let s = Array.isArray(a.children) ? a.children : [], c = {
|
|
73
|
+
item: a,
|
|
74
|
+
value: a.value,
|
|
75
|
+
children: s,
|
|
76
|
+
level: r,
|
|
77
|
+
parentValue: i,
|
|
78
|
+
position: o + 1,
|
|
79
|
+
setSize: n.length,
|
|
80
|
+
expanded: B.value.has(a.value)
|
|
81
|
+
};
|
|
82
|
+
e.push(c), c.expanded && t(s, r + 1, a.value);
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
return t(O.items), e;
|
|
86
|
+
}), H = r(() => Math.max(1, Math.floor(Number(O.itemHeight) || 48))), U = r(() => P.value || Number.parseFloat(O.height) || H.value * 7), W = r(() => {
|
|
87
|
+
if (!V.value.length) return {
|
|
88
|
+
start: 0,
|
|
89
|
+
end: -1
|
|
90
|
+
};
|
|
91
|
+
let e = Math.max(0, Math.floor(Number(O.overscan) || 0));
|
|
92
|
+
return {
|
|
93
|
+
start: Math.max(0, Math.floor(N.value / H.value) - e),
|
|
94
|
+
end: Math.min(V.value.length - 1, Math.ceil((N.value + U.value) / H.value) + e - 1)
|
|
95
|
+
};
|
|
96
|
+
}), G = r(() => V.value.slice(W.value.start, W.value.end + 1).map((e, t) => ({
|
|
97
|
+
...e,
|
|
98
|
+
index: W.value.start + t
|
|
99
|
+
}))), K = r(() => new Set(O.multiple && Array.isArray(R.value) ? R.value : [])), q = r(() => typeof O.height == "number" ? `${Math.max(0, O.height)}px` : O.height || "360px"), J = r(() => j ? {
|
|
100
|
+
...A,
|
|
101
|
+
id: void 0
|
|
102
|
+
} : A);
|
|
103
|
+
function Y(e) {
|
|
104
|
+
return O.multiple ? K.value.has(e.value) : Object.is(R.value, e.value);
|
|
105
|
+
}
|
|
106
|
+
function X(e) {
|
|
107
|
+
if (!e.children.length || O.disabled || e.item.disabled) return;
|
|
108
|
+
let t = new Set(L.value);
|
|
109
|
+
t.has(e.value) ? t.delete(e.value) : t.add(e.value), L.value = [...t], k("update:expanded", L.value);
|
|
110
|
+
}
|
|
111
|
+
function Z(e) {
|
|
112
|
+
if (!(!O.selectable || O.disabled || e.item.disabled)) {
|
|
113
|
+
if (O.multiple) {
|
|
114
|
+
let t = new Set(K.value);
|
|
115
|
+
t.has(e.value) ? t.delete(e.value) : t.add(e.value), R.value = [...t];
|
|
116
|
+
} else R.value = e.value;
|
|
117
|
+
k("update:modelValue", R.value), k("select", e.value, e.item);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
function Q(e) {
|
|
121
|
+
let t = Math.max(0, Math.min(V.value.length - 1, e));
|
|
122
|
+
F.value = t;
|
|
123
|
+
let n = t * H.value;
|
|
124
|
+
M.value && n < M.value.scrollTop ? M.value.scrollTop = n : M.value && n + H.value > M.value.scrollTop + M.value.clientHeight && (M.value.scrollTop = n + H.value - M.value.clientHeight), queueMicrotask(() => document.getElementById($(t))?.focus());
|
|
125
|
+
}
|
|
126
|
+
function ie(e, t, n) {
|
|
127
|
+
if (!(n.isComposing || n.altKey || n.ctrlKey || n.metaKey)) {
|
|
128
|
+
if (n.key === "ArrowRight") n.preventDefault(), e.children.length && !e.expanded ? X(e) : Q(t + 1);
|
|
129
|
+
else if (n.key === "ArrowLeft") {
|
|
130
|
+
if (n.preventDefault(), e.children.length && e.expanded) X(e);
|
|
131
|
+
else {
|
|
132
|
+
let t = V.value.findIndex((t) => t.value === e.parentValue);
|
|
133
|
+
t >= 0 && Q(t);
|
|
134
|
+
}
|
|
135
|
+
} else n.key === "ArrowDown" ? (n.preventDefault(), Q(t + 1)) : n.key === "ArrowUp" ? (n.preventDefault(), Q(t - 1)) : n.key === "Home" ? (n.preventDefault(), Q(0)) : n.key === "End" ? (n.preventDefault(), Q(V.value.length - 1)) : (n.key === "Enter" || n.key === " ") && (n.preventDefault(), Z(e));
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
function $(e) {
|
|
139
|
+
return `${z}-node-${e}`;
|
|
140
|
+
}
|
|
141
|
+
return ne(() => {
|
|
142
|
+
P.value = M.value?.clientHeight || 0, typeof ResizeObserver < "u" && M.value && (I = new ResizeObserver((e) => {
|
|
143
|
+
P.value = e[0]?.contentRect.height || M.value.clientHeight;
|
|
144
|
+
}), I.observe(M.value));
|
|
145
|
+
}), u(() => I?.disconnect()), b(() => O.expanded, (e) => {
|
|
146
|
+
L.value = [...e];
|
|
147
|
+
}, { deep: !0 }), b(() => O.modelValue, (e) => {
|
|
148
|
+
R.value = e;
|
|
149
|
+
}, { deep: !0 }), (r, c) => (d(), i("div", ee({
|
|
150
|
+
ref_key: "root",
|
|
151
|
+
ref: M
|
|
152
|
+
}, J.value, {
|
|
153
|
+
class: "kima-virtual-tree",
|
|
154
|
+
style: { height: q.value },
|
|
155
|
+
role: "tree",
|
|
156
|
+
"aria-multiselectable": e.multiple || void 0,
|
|
157
|
+
"aria-disabled": e.disabled || void 0,
|
|
158
|
+
onScroll: c[0] ||= (e) => N.value = e.currentTarget.scrollTop
|
|
159
|
+
}), [a("div", {
|
|
160
|
+
class: "kima-virtual-tree__content",
|
|
161
|
+
style: l({ height: `${V.value.length * H.value}px` })
|
|
162
|
+
}, [
|
|
163
|
+
a("div", {
|
|
164
|
+
class: "kima-virtual-tree__spacer",
|
|
165
|
+
style: l({ height: `${W.value.start * H.value}px` }),
|
|
166
|
+
"aria-hidden": "true"
|
|
167
|
+
}, null, 4),
|
|
168
|
+
(d(!0), i(n, null, p(G.value, (n) => (d(), i("div", {
|
|
169
|
+
id: $(n.index),
|
|
170
|
+
key: n.value,
|
|
171
|
+
class: te(["kima-virtual-tree__node", {
|
|
172
|
+
"kima-virtual-tree__node--selected": Y(n),
|
|
173
|
+
"kima-virtual-tree__node--disabled": n.item.disabled
|
|
174
|
+
}]),
|
|
175
|
+
role: "treeitem",
|
|
176
|
+
"aria-level": n.level,
|
|
177
|
+
"aria-posinset": n.position,
|
|
178
|
+
"aria-setsize": n.setSize,
|
|
179
|
+
"aria-expanded": n.children.length ? n.expanded : void 0,
|
|
180
|
+
"aria-selected": e.selectable ? Y(n) : void 0,
|
|
181
|
+
tabindex: n.index === F.value ? 0 : -1,
|
|
182
|
+
style: l({
|
|
183
|
+
"--kima-tree-level": n.level - 1,
|
|
184
|
+
height: `${H.value}px`
|
|
185
|
+
}),
|
|
186
|
+
onClick: (e) => Z(n),
|
|
187
|
+
onKeydown: (e) => ie(n, n.index, e)
|
|
188
|
+
}, [n.children.length ? (d(), i("button", {
|
|
189
|
+
key: 0,
|
|
190
|
+
class: "kima-virtual-tree__toggle",
|
|
191
|
+
type: "button",
|
|
192
|
+
disabled: e.disabled || n.item.disabled,
|
|
193
|
+
"aria-label": `${n.expanded ? "收起" : "展开"} ${n.item.label}`,
|
|
194
|
+
"aria-expanded": n.expanded,
|
|
195
|
+
onClick: x((e) => X(n), ["stop"])
|
|
196
|
+
}, [s(t, {
|
|
197
|
+
icon: g(S),
|
|
198
|
+
size: 18,
|
|
199
|
+
"aria-hidden": "true"
|
|
200
|
+
}, null, 8, ["icon"])], 8, T)) : (d(), i("span", E)), a("span", re, [m(r.$slots, "default", {
|
|
201
|
+
item: n.item,
|
|
202
|
+
level: n.level,
|
|
203
|
+
expanded: n.expanded
|
|
204
|
+
}, () => [o(h(n.item.label), 1)], !0)])], 46, w))), 128)),
|
|
205
|
+
a("div", {
|
|
206
|
+
class: "kima-virtual-tree__spacer",
|
|
207
|
+
style: l({ height: `${Math.max(0, V.value.length * H.value - (W.value.end + 1) * H.value)}px` }),
|
|
208
|
+
"aria-hidden": "true"
|
|
209
|
+
}, null, 4)
|
|
210
|
+
], 4)], 16, C));
|
|
211
|
+
}
|
|
212
|
+
}), [["__scopeId", "data-v-5d8790bf"]]);
|
|
213
|
+
export { D as default };
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { useNativeSlots as e } from "../../utils/native-slots.js";
|
|
2
|
+
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
3
|
+
import n from "../core/button.ce.js";
|
|
4
|
+
import r from "../core/icon.ce.js";
|
|
5
|
+
import { collapseTransition as i } from "../../utils/motion.js";
|
|
6
|
+
import { displayStatus as a } from "../../utils/display-status.js";
|
|
7
|
+
/* empty css */
|
|
8
|
+
import { Transition as o, computed as s, createBlock as c, createCommentVNode as l, createElementBlock as u, createElementVNode as d, createTextVNode as f, createVNode as p, mergeProps as m, openBlock as h, ref as g, renderSlot as _, toDisplayString as v, unref as y, useAttrs as b, vShow as x, watch as S, withCtx as C, withDirectives as w } from "vue";
|
|
9
|
+
import { Cancel01Icon as T } from "@hugeicons/core-free-icons";
|
|
10
|
+
// src/components/display/alert.ce.vue
|
|
11
|
+
var E = ["inert", "aria-hidden"], D = ["data-variant", "role"], O = ["aria-label"], k = { class: "kima-alert__body" }, A = {
|
|
12
|
+
key: 0,
|
|
13
|
+
class: "kima-alert__heading"
|
|
14
|
+
}, j = {
|
|
15
|
+
key: 1,
|
|
16
|
+
class: "kima-alert__action"
|
|
17
|
+
}, M = /*#__PURE__*/ t(/* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
|
|
18
|
+
__name: "alert.ce",
|
|
19
|
+
props: {
|
|
20
|
+
open: {
|
|
21
|
+
type: Boolean,
|
|
22
|
+
default: !0
|
|
23
|
+
},
|
|
24
|
+
variant: {
|
|
25
|
+
type: String,
|
|
26
|
+
default: "info"
|
|
27
|
+
},
|
|
28
|
+
heading: {
|
|
29
|
+
type: String,
|
|
30
|
+
default: ""
|
|
31
|
+
},
|
|
32
|
+
description: {
|
|
33
|
+
type: String,
|
|
34
|
+
default: ""
|
|
35
|
+
},
|
|
36
|
+
closable: Boolean,
|
|
37
|
+
closeLabel: {
|
|
38
|
+
type: String,
|
|
39
|
+
default: "关闭提示"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
emits: ["update:open", "close"],
|
|
43
|
+
setup(t, { emit: M }) {
|
|
44
|
+
let N = t, P = M, F = b(), I = g(null), { isCustomElement: L, hasNativeSlot: R } = e(I), z = g(N.open);
|
|
45
|
+
S(() => N.open, (e) => {
|
|
46
|
+
z.value = e;
|
|
47
|
+
});
|
|
48
|
+
let B = s(() => a(N.variant));
|
|
49
|
+
function V() {
|
|
50
|
+
z.value && (z.value = !1, P("update:open", !1), P("close"));
|
|
51
|
+
}
|
|
52
|
+
return (e, a) => (h(), c(o, m({ css: !1 }, y(i)), {
|
|
53
|
+
default: C(() => [w(d("div", {
|
|
54
|
+
class: "kima-alert__collapse",
|
|
55
|
+
inert: !z.value,
|
|
56
|
+
"aria-hidden": !z.value
|
|
57
|
+
}, [d("section", m({
|
|
58
|
+
ref_key: "root",
|
|
59
|
+
ref: I
|
|
60
|
+
}, {
|
|
61
|
+
...y(F),
|
|
62
|
+
id: y(L) ? void 0 : y(F).id
|
|
63
|
+
}, {
|
|
64
|
+
class: "kima-alert",
|
|
65
|
+
"data-variant": B.value.variant,
|
|
66
|
+
role: ["danger", "warning"].includes(B.value.variant) ? "alert" : "status",
|
|
67
|
+
"aria-atomic": "true"
|
|
68
|
+
}), [
|
|
69
|
+
d("span", {
|
|
70
|
+
class: "kima-alert__icon",
|
|
71
|
+
role: "img",
|
|
72
|
+
"aria-label": B.value.label
|
|
73
|
+
}, [_(e.$slots, "icon", {}, () => [p(r, {
|
|
74
|
+
icon: B.value.icon,
|
|
75
|
+
size: 28
|
|
76
|
+
}, null, 8, ["icon"])], !0)], 8, O),
|
|
77
|
+
d("div", k, [
|
|
78
|
+
t.heading ? (h(), u("strong", A, v(t.heading), 1)) : l("", !0),
|
|
79
|
+
d("div", null, [_(e.$slots, "default", {}, () => [f(v(t.description), 1)], !0)]),
|
|
80
|
+
e.$slots.action || y(R)("action") || y(L) ? (h(), u("div", j, [_(e.$slots, "action", {}, void 0, !0)])) : l("", !0)
|
|
81
|
+
]),
|
|
82
|
+
t.closable ? (h(), c(n, {
|
|
83
|
+
key: 0,
|
|
84
|
+
variant: "text",
|
|
85
|
+
class: "kima-alert__close",
|
|
86
|
+
"aria-label": t.closeLabel,
|
|
87
|
+
onClick: V
|
|
88
|
+
}, {
|
|
89
|
+
default: C(() => [p(r, {
|
|
90
|
+
icon: y(T),
|
|
91
|
+
size: 20,
|
|
92
|
+
"aria-hidden": "true"
|
|
93
|
+
}, null, 8, ["icon"])]),
|
|
94
|
+
_: 1
|
|
95
|
+
}, 8, ["aria-label"])) : l("", !0)
|
|
96
|
+
], 16, D)], 8, E), [[x, z.value]])]),
|
|
97
|
+
_: 3
|
|
98
|
+
}, 16));
|
|
99
|
+
}
|
|
100
|
+
}), [["__scopeId", "data-v-d31c4df3"]]);
|
|
101
|
+
export { M as default };
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { useNativeSlots as e } from "../../utils/native-slots.js";
|
|
2
|
+
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
3
|
+
import n from "./avatar.ce.js";
|
|
4
|
+
/* empty css */
|
|
5
|
+
import { Fragment as r, TransitionGroup as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createVNode as l, mergeProps as u, openBlock as d, ref as f, renderList as p, renderSlot as m, toDisplayString as h, unref as g, useAttrs as _, withCtx as v } from "vue";
|
|
6
|
+
// src/components/display/avatar-group.ce.vue
|
|
7
|
+
var y = ["aria-label"], b = ["aria-label", "title"], x = /*#__PURE__*/ t(/* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
|
|
8
|
+
__name: "avatar-group.ce",
|
|
9
|
+
props: {
|
|
10
|
+
items: {
|
|
11
|
+
type: Array,
|
|
12
|
+
default: () => []
|
|
13
|
+
},
|
|
14
|
+
max: {
|
|
15
|
+
type: Number,
|
|
16
|
+
default: 5
|
|
17
|
+
},
|
|
18
|
+
label: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: "成员"
|
|
21
|
+
},
|
|
22
|
+
size: {
|
|
23
|
+
type: String,
|
|
24
|
+
default: "medium"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
setup(t) {
|
|
28
|
+
let x = t, S = _(), C = f(null), { isCustomElement: w } = e(C), T = a(() => Number.isFinite(x.max) ? Math.max(0, Math.floor(x.max)) : x.items.length), E = a(() => x.items.slice(0, T.value)), D = a(() => Math.max(0, x.items.length - E.value.length)), O = a(() => x.items.slice(T.value).map((e) => e.name).filter(Boolean).join("、"));
|
|
29
|
+
return (e, a) => (d(), c("div", u({
|
|
30
|
+
ref_key: "root",
|
|
31
|
+
ref: C
|
|
32
|
+
}, {
|
|
33
|
+
...g(S),
|
|
34
|
+
id: g(w) ? void 0 : g(S).id
|
|
35
|
+
}, {
|
|
36
|
+
class: "kima-avatar-group",
|
|
37
|
+
role: "group",
|
|
38
|
+
"aria-label": t.label
|
|
39
|
+
}), [m(e.$slots, "default", {}, () => [l(i, {
|
|
40
|
+
name: "kima-list",
|
|
41
|
+
tag: "div",
|
|
42
|
+
class: "kima-avatar-group__items"
|
|
43
|
+
}, {
|
|
44
|
+
default: v(() => [(d(!0), c(r, null, p(E.value, (e, r) => (d(), o(n, {
|
|
45
|
+
key: `avatar-${e.id ?? r}`,
|
|
46
|
+
src: e.src,
|
|
47
|
+
name: e.name,
|
|
48
|
+
alt: e.alt,
|
|
49
|
+
size: t.size
|
|
50
|
+
}, null, 8, [
|
|
51
|
+
"src",
|
|
52
|
+
"name",
|
|
53
|
+
"alt",
|
|
54
|
+
"size"
|
|
55
|
+
]))), 128)), D.value ? (d(), c("span", {
|
|
56
|
+
key: "more",
|
|
57
|
+
class: "kima-avatar-group__more",
|
|
58
|
+
"aria-label": `另有 ${D.value} 位成员${O.value ? ":" + O.value : ""}`,
|
|
59
|
+
title: O.value
|
|
60
|
+
}, "+" + h(D.value), 9, b)) : s("", !0)]),
|
|
61
|
+
_: 1
|
|
62
|
+
})], !0)], 16, y));
|
|
63
|
+
}
|
|
64
|
+
}), [["__scopeId", "data-v-9545415b"]]);
|
|
65
|
+
export { x as default };
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { useNativeSlots as e } from "../../utils/native-slots.js";
|
|
2
|
+
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
3
|
+
import n from "../core/icon.ce.js";
|
|
4
|
+
/* empty css */
|
|
5
|
+
import { Transition as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createVNode as c, mergeProps as l, normalizeClass as u, openBlock as d, ref as f, toDisplayString as p, unref as m, useAttrs as h, watch as g, withCtx as _ } from "vue";
|
|
6
|
+
import { UserCircleIcon as v } from "@hugeicons/core-free-icons";
|
|
7
|
+
// src/components/display/avatar.ce.vue
|
|
8
|
+
var y = [
|
|
9
|
+
"role",
|
|
10
|
+
"aria-label",
|
|
11
|
+
"aria-hidden"
|
|
12
|
+
], b = ["src", "alt"], x = {
|
|
13
|
+
key: 0,
|
|
14
|
+
class: "kima-avatar__fallback",
|
|
15
|
+
"aria-hidden": "true"
|
|
16
|
+
}, S = { key: 0 }, C = /*#__PURE__*/ t(/* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
|
|
17
|
+
__name: "avatar.ce",
|
|
18
|
+
props: {
|
|
19
|
+
src: {
|
|
20
|
+
type: String,
|
|
21
|
+
default: ""
|
|
22
|
+
},
|
|
23
|
+
name: {
|
|
24
|
+
type: String,
|
|
25
|
+
default: ""
|
|
26
|
+
},
|
|
27
|
+
alt: {
|
|
28
|
+
type: String,
|
|
29
|
+
default: void 0
|
|
30
|
+
},
|
|
31
|
+
size: {
|
|
32
|
+
type: String,
|
|
33
|
+
default: "medium"
|
|
34
|
+
},
|
|
35
|
+
shape: {
|
|
36
|
+
type: String,
|
|
37
|
+
default: "rounded"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
emits: ["load", "error"],
|
|
41
|
+
setup(t, { emit: C }) {
|
|
42
|
+
let w = t, T = C, E = h(), D = f(null), { isCustomElement: O } = e(D), k = f(!1), A = f(!1);
|
|
43
|
+
g(() => w.src, () => {
|
|
44
|
+
k.value = !1, A.value = !1;
|
|
45
|
+
});
|
|
46
|
+
function j(e) {
|
|
47
|
+
A.value = !0, T("load", e);
|
|
48
|
+
}
|
|
49
|
+
function M(e) {
|
|
50
|
+
k.value = !0, A.value = !1, T("error", e);
|
|
51
|
+
}
|
|
52
|
+
let N = i(() => w.alt ?? w.name), P = i(() => {
|
|
53
|
+
let e = w.name.trim().split(/\s+/u);
|
|
54
|
+
return e.length > 1 ? e.slice(0, 2).map((e) => Array.from(e)[0]).join("").toUpperCase() : Array.from(e[0]).slice(0, 2).join("");
|
|
55
|
+
});
|
|
56
|
+
return (e, i) => (d(), s("span", l({
|
|
57
|
+
ref_key: "root",
|
|
58
|
+
ref: D
|
|
59
|
+
}, {
|
|
60
|
+
...m(E),
|
|
61
|
+
id: m(O) ? void 0 : m(E).id
|
|
62
|
+
}, {
|
|
63
|
+
class: ["kima-avatar", [`kima-avatar--${t.size}`, { "kima-avatar--circle": t.shape === "circle" }]],
|
|
64
|
+
role: !t.src || k.value ? "img" : void 0,
|
|
65
|
+
"aria-label": (!t.src || k.value) && N.value || void 0,
|
|
66
|
+
"aria-hidden": (!t.src || k.value) && !N.value ? !0 : void 0
|
|
67
|
+
}), [t.src && !k.value ? (d(), s("img", {
|
|
68
|
+
key: t.src,
|
|
69
|
+
src: t.src,
|
|
70
|
+
alt: N.value,
|
|
71
|
+
class: u({ "kima-avatar__image--loaded": A.value }),
|
|
72
|
+
onLoad: j,
|
|
73
|
+
onError: M
|
|
74
|
+
}, null, 42, b)) : o("", !0), c(r, { name: "kima-fade" }, {
|
|
75
|
+
default: _(() => [A.value ? o("", !0) : (d(), s("span", x, [P.value ? (d(), s("span", S, p(P.value), 1)) : (d(), a(n, {
|
|
76
|
+
key: 1,
|
|
77
|
+
icon: m(v),
|
|
78
|
+
size: 28
|
|
79
|
+
}, null, 8, ["icon"]))]))]),
|
|
80
|
+
_: 1
|
|
81
|
+
})], 16, y));
|
|
82
|
+
}
|
|
83
|
+
}), [["__scopeId", "data-v-eb8fc9ea"]]);
|
|
84
|
+
export { C as default };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { useNativeSlots as e } from "../../utils/native-slots.js";
|
|
2
|
+
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
3
|
+
import n from "../core/icon.ce.js";
|
|
4
|
+
/* empty css */
|
|
5
|
+
import { createCommentVNode as r, createElementBlock as i, createElementVNode as a, createVNode as o, mergeProps as s, openBlock as c, ref as l, renderSlot as u, toDisplayString as d, unref as f, useAttrs as p } from "vue";
|
|
6
|
+
import { QuoteUpIcon as m } from "@hugeicons/core-free-icons";
|
|
7
|
+
// src/components/display/blockquote.ce.vue
|
|
8
|
+
var h = ["cite"], g = { key: 0 }, _ = { key: 0 }, v = { key: 1 }, y = /*#__PURE__*/ t(/* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
|
|
9
|
+
__name: "blockquote.ce",
|
|
10
|
+
props: {
|
|
11
|
+
cite: {
|
|
12
|
+
type: String,
|
|
13
|
+
default: void 0
|
|
14
|
+
},
|
|
15
|
+
author: {
|
|
16
|
+
type: String,
|
|
17
|
+
default: ""
|
|
18
|
+
},
|
|
19
|
+
source: {
|
|
20
|
+
type: String,
|
|
21
|
+
default: ""
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
setup(t) {
|
|
25
|
+
let y = p(), b = l(null), { isCustomElement: x, hasNativeSlot: S } = e(b);
|
|
26
|
+
return (e, l) => (c(), i("figure", s({
|
|
27
|
+
ref_key: "root",
|
|
28
|
+
ref: b
|
|
29
|
+
}, {
|
|
30
|
+
...f(y),
|
|
31
|
+
id: f(x) ? void 0 : f(y).id
|
|
32
|
+
}, { class: "kima-blockquote" }), [
|
|
33
|
+
o(n, {
|
|
34
|
+
icon: f(m),
|
|
35
|
+
size: 32,
|
|
36
|
+
class: "kima-blockquote__icon",
|
|
37
|
+
"aria-hidden": "true"
|
|
38
|
+
}, null, 8, ["icon"]),
|
|
39
|
+
a("blockquote", { cite: t.cite }, [u(e.$slots, "default", {}, void 0, !0)], 8, h),
|
|
40
|
+
t.author || t.source || e.$slots.caption || f(S)("caption") || f(x) ? (c(), i("figcaption", g, [u(e.$slots, "caption", {}, () => [t.author ? (c(), i("span", _, "— " + d(t.author), 1)) : r("", !0), t.source ? (c(), i("cite", v, d(t.source), 1)) : r("", !0)], !0)])) : r("", !0)
|
|
41
|
+
], 16));
|
|
42
|
+
}
|
|
43
|
+
}), [["__scopeId", "data-v-e56b05b8"]]);
|
|
44
|
+
export { y as default };
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { useNativeSlots as e } from "../../utils/native-slots.js";
|
|
2
|
+
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
3
|
+
/* empty css */
|
|
4
|
+
import { computed as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createTextVNode as o, mergeProps as s, onBeforeUnmount as c, onMounted as l, openBlock as u, ref as d, renderSlot as f, toDisplayString as p, unref as m, useAttrs as h, watch as g } from "vue";
|
|
5
|
+
// src/components/display/countdown.ce.vue
|
|
6
|
+
var _ = {
|
|
7
|
+
key: 0,
|
|
8
|
+
class: "kima-countdown__label"
|
|
9
|
+
}, v = ["aria-label"], y = /*#__PURE__*/ t(/* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
|
|
10
|
+
__name: "countdown.ce",
|
|
11
|
+
props: {
|
|
12
|
+
value: {
|
|
13
|
+
type: [
|
|
14
|
+
Number,
|
|
15
|
+
String,
|
|
16
|
+
Date
|
|
17
|
+
],
|
|
18
|
+
default: void 0
|
|
19
|
+
},
|
|
20
|
+
label: {
|
|
21
|
+
type: String,
|
|
22
|
+
default: "倒计时"
|
|
23
|
+
},
|
|
24
|
+
showDays: Boolean
|
|
25
|
+
},
|
|
26
|
+
emits: ["finish"],
|
|
27
|
+
setup(t, { emit: y }) {
|
|
28
|
+
let b = t, x = y, S = h(), C = d(null), { isCustomElement: w } = e(C), T = d(null), E = n(() => b.value == null || b.value === "" ? NaN : b.value instanceof Date ? b.value.getTime() : typeof b.value == "number" ? b.value : Date.parse(b.value)), D = !1, O = null, k = !1;
|
|
29
|
+
function A() {
|
|
30
|
+
O !== null && clearTimeout(O), O = null;
|
|
31
|
+
}
|
|
32
|
+
function j() {
|
|
33
|
+
if (A(), !D || !Number.isFinite(E.value)) {
|
|
34
|
+
T.value = null;
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
let e = Math.max(0, E.value - Date.now());
|
|
38
|
+
T.value = Math.ceil(e / 1e3), e === 0 ? k || (k = !0, x("finish")) : O = setTimeout(j, Math.min(250, e));
|
|
39
|
+
}
|
|
40
|
+
g(E, () => {
|
|
41
|
+
k = !1, D && j();
|
|
42
|
+
}), l(() => {
|
|
43
|
+
D = !0, j();
|
|
44
|
+
}), c(() => {
|
|
45
|
+
D = !1, A();
|
|
46
|
+
});
|
|
47
|
+
let M = n(() => {
|
|
48
|
+
let e = T.value ?? 0;
|
|
49
|
+
return {
|
|
50
|
+
days: Math.floor(e / 86400),
|
|
51
|
+
hours: b.showDays ? Math.floor(e / 3600) % 24 : Math.floor(e / 3600),
|
|
52
|
+
minutes: Math.floor(e / 60) % 60,
|
|
53
|
+
seconds: e % 60
|
|
54
|
+
};
|
|
55
|
+
}), N = (e) => String(e).padStart(2, "0"), P = n(() => T.value === null ? "--:--:--" : `${b.showDays ? M.value.days + "天 " : ""}${N(M.value.hours)}:${N(M.value.minutes)}:${N(M.value.seconds)}`);
|
|
56
|
+
return (e, n) => (u(), i("div", s({
|
|
57
|
+
ref_key: "root",
|
|
58
|
+
ref: C
|
|
59
|
+
}, {
|
|
60
|
+
...m(S),
|
|
61
|
+
id: m(w) ? void 0 : m(S).id
|
|
62
|
+
}, { class: "kima-countdown" }), [t.label ? (u(), i("div", _, p(t.label), 1)) : r("", !0), a("div", {
|
|
63
|
+
class: "kima-countdown__value",
|
|
64
|
+
role: "timer",
|
|
65
|
+
"aria-label": t.label,
|
|
66
|
+
"aria-live": "off"
|
|
67
|
+
}, [f(e.$slots, "default", {
|
|
68
|
+
remaining: T.value,
|
|
69
|
+
formatted: P.value,
|
|
70
|
+
days: M.value.days,
|
|
71
|
+
hours: M.value.hours,
|
|
72
|
+
minutes: M.value.minutes,
|
|
73
|
+
seconds: M.value.seconds
|
|
74
|
+
}, () => [o(p(P.value), 1)], !0)], 8, v)], 16));
|
|
75
|
+
}
|
|
76
|
+
}), [["__scopeId", "data-v-7f10ca60"]]);
|
|
77
|
+
export { y as default };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { useNativeSlots as e } from "../../utils/native-slots.js";
|
|
2
|
+
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
3
|
+
/* empty css */
|
|
4
|
+
import { Fragment as n, computed as r, createElementBlock as i, createElementVNode as a, createTextVNode as o, mergeProps as s, openBlock as c, ref as l, renderList as u, renderSlot as d, toDisplayString as f, unref as p, useAttrs as m } from "vue";
|
|
5
|
+
// src/components/display/descriptions.ce.vue
|
|
6
|
+
var h = ["aria-label"], g = /*#__PURE__*/ t(/* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
|
|
7
|
+
__name: "descriptions.ce",
|
|
8
|
+
props: {
|
|
9
|
+
items: {
|
|
10
|
+
type: Array,
|
|
11
|
+
default: () => []
|
|
12
|
+
},
|
|
13
|
+
columns: {
|
|
14
|
+
type: Number,
|
|
15
|
+
default: 2
|
|
16
|
+
},
|
|
17
|
+
label: {
|
|
18
|
+
type: String,
|
|
19
|
+
default: "详细信息"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
setup(t) {
|
|
23
|
+
let g = t, _ = m(), v = l(null), { isCustomElement: y } = e(v), b = r(() => Number.isFinite(g.columns) ? Math.min(4, Math.max(1, Math.floor(g.columns))) : 2);
|
|
24
|
+
return (e, r) => (c(), i("dl", s({
|
|
25
|
+
ref_key: "root",
|
|
26
|
+
ref: v
|
|
27
|
+
}, {
|
|
28
|
+
...p(_),
|
|
29
|
+
id: p(y) ? void 0 : p(_).id
|
|
30
|
+
}, {
|
|
31
|
+
class: "kima-descriptions",
|
|
32
|
+
"aria-label": t.label,
|
|
33
|
+
style: { "--kima-description-columns": b.value }
|
|
34
|
+
}), [d(e.$slots, "default", {}, () => [(c(!0), i(n, null, u(t.items, (t, n) => (c(), i("div", {
|
|
35
|
+
key: t.id ?? n,
|
|
36
|
+
class: "kima-descriptions__item"
|
|
37
|
+
}, [a("dt", null, f(t.label), 1), a("dd", null, [d(e.$slots, "value", {
|
|
38
|
+
item: t,
|
|
39
|
+
index: n
|
|
40
|
+
}, () => [o(f(t.value ?? "—"), 1)], !0)])]))), 128))], !0)], 16, h));
|
|
41
|
+
}
|
|
42
|
+
}), [["__scopeId", "data-v-501a9489"]]);
|
|
43
|
+
export { g as default };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { useNativeSlots as e } from "../../utils/native-slots.js";
|
|
2
|
+
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
3
|
+
/* empty css */
|
|
4
|
+
import { Fragment as n, computed as r, createElementBlock as i, createTextVNode as a, mergeProps as o, openBlock as s, ref as c, renderList as l, toDisplayString as u, unref as d, useAttrs as f } from "vue";
|
|
5
|
+
// src/components/display/highlight.ce.vue
|
|
6
|
+
var p = { key: 0 }, m = /*#__PURE__*/ t(/* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
|
|
7
|
+
__name: "highlight.ce",
|
|
8
|
+
props: {
|
|
9
|
+
text: {
|
|
10
|
+
type: String,
|
|
11
|
+
default: ""
|
|
12
|
+
},
|
|
13
|
+
keywords: {
|
|
14
|
+
type: [String, Array],
|
|
15
|
+
default: ""
|
|
16
|
+
},
|
|
17
|
+
caseSensitive: Boolean
|
|
18
|
+
},
|
|
19
|
+
setup(t) {
|
|
20
|
+
let m = t, h = f(), g = c(null), { isCustomElement: _ } = e(g), v = r(() => {
|
|
21
|
+
let e = [...new Set((Array.isArray(m.keywords) ? m.keywords : [m.keywords]).filter((e) => typeof e == "string" && e.length))].sort((e, t) => t.length - e.length);
|
|
22
|
+
if (!e.length) return [{
|
|
23
|
+
text: m.text,
|
|
24
|
+
marked: !1
|
|
25
|
+
}];
|
|
26
|
+
let t = new RegExp(e.map((e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|"), m.caseSensitive ? "gu" : "giu"), n = [], r = 0;
|
|
27
|
+
for (let e of m.text.matchAll(t)) e.index > r && n.push({
|
|
28
|
+
text: m.text.slice(r, e.index),
|
|
29
|
+
marked: !1
|
|
30
|
+
}), n.push({
|
|
31
|
+
text: e[0],
|
|
32
|
+
marked: !0
|
|
33
|
+
}), r = e.index + e[0].length;
|
|
34
|
+
return r < m.text.length && n.push({
|
|
35
|
+
text: m.text.slice(r),
|
|
36
|
+
marked: !1
|
|
37
|
+
}), n;
|
|
38
|
+
});
|
|
39
|
+
return (e, t) => (s(), i("span", o({
|
|
40
|
+
ref_key: "root",
|
|
41
|
+
ref: g
|
|
42
|
+
}, {
|
|
43
|
+
...d(h),
|
|
44
|
+
id: d(_) ? void 0 : d(h).id
|
|
45
|
+
}, { class: "kima-highlight" }), [(s(!0), i(n, null, l(v.value, (e, t) => (s(), i(n, { key: t }, [e.marked ? (s(), i("mark", p, u(e.text), 1)) : (s(), i(n, { key: 1 }, [a(u(e.text), 1)], 64))], 64))), 128))], 16));
|
|
46
|
+
}
|
|
47
|
+
}), [["__scopeId", "data-v-f876f7db"]]);
|
|
48
|
+
export { m as default };
|