@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,158 @@
|
|
|
1
|
+
import e from "../../_virtual/_plugin-vue_export-helper.js";
|
|
2
|
+
import t from "./icon.ce.js";
|
|
3
|
+
import { presenceTransition as n } from "../../utils/motion.js";
|
|
4
|
+
/* empty css */
|
|
5
|
+
import { Transition as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as ee, createVNode as c, getCurrentInstance as l, mergeProps as u, onBeforeUnmount as te, onMounted as ne, openBlock as d, ref as re, renderSlot as ie, toDisplayString as f, unref as p, useAttrs as m, useHost as h, useId as g, watch as _, withCtx as v } from "vue";
|
|
6
|
+
import { Alert02Icon as y, AlertCircleIcon as b, Cancel01Icon as x, CheckmarkCircle02Icon as S, InformationCircleIcon as C } from "@hugeicons/core-free-icons";
|
|
7
|
+
// src/components/core/notification.ce.vue
|
|
8
|
+
var w = [
|
|
9
|
+
"role",
|
|
10
|
+
"aria-live",
|
|
11
|
+
"aria-labelledby",
|
|
12
|
+
"aria-describedby"
|
|
13
|
+
], T = {
|
|
14
|
+
key: 0,
|
|
15
|
+
class: "kima-notification__icon",
|
|
16
|
+
"aria-hidden": "true"
|
|
17
|
+
}, ae = { class: "kima-notification__copy" }, oe = {
|
|
18
|
+
key: 2,
|
|
19
|
+
class: "kima-notification__action"
|
|
20
|
+
}, E = /*#__PURE__*/ e(/* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
|
|
21
|
+
__name: "notification.ce",
|
|
22
|
+
props: {
|
|
23
|
+
open: {
|
|
24
|
+
type: Boolean,
|
|
25
|
+
default: !1
|
|
26
|
+
},
|
|
27
|
+
heading: {
|
|
28
|
+
type: String,
|
|
29
|
+
default: ""
|
|
30
|
+
},
|
|
31
|
+
message: {
|
|
32
|
+
type: String,
|
|
33
|
+
default: ""
|
|
34
|
+
},
|
|
35
|
+
variant: {
|
|
36
|
+
type: String,
|
|
37
|
+
default: "neutral"
|
|
38
|
+
},
|
|
39
|
+
duration: {
|
|
40
|
+
type: Number,
|
|
41
|
+
default: 5e3
|
|
42
|
+
},
|
|
43
|
+
closable: {
|
|
44
|
+
type: Boolean,
|
|
45
|
+
default: !0
|
|
46
|
+
},
|
|
47
|
+
position: {
|
|
48
|
+
type: String,
|
|
49
|
+
default: "top-right"
|
|
50
|
+
},
|
|
51
|
+
icon: {
|
|
52
|
+
type: [Object, Array],
|
|
53
|
+
default: null
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
emits: ["update:open", "close"],
|
|
57
|
+
setup(e, { emit: E }) {
|
|
58
|
+
let D = e, O = E, k = m(), A = l().ce ? h() : null, j = re(D.open), M = g(), N = `kima-notification-${M}-title`, P = `kima-notification-${M}-message`, F = null, I = !1, L = 0, R = 0, z = !1, B = !1, V = i(() => [
|
|
59
|
+
"neutral",
|
|
60
|
+
"info",
|
|
61
|
+
"success",
|
|
62
|
+
"warning",
|
|
63
|
+
"danger"
|
|
64
|
+
].includes(D.variant) ? D.variant : "neutral"), H = i(() => [
|
|
65
|
+
"top",
|
|
66
|
+
"top-left",
|
|
67
|
+
"top-center",
|
|
68
|
+
"top-right",
|
|
69
|
+
"bottom",
|
|
70
|
+
"bottom-left",
|
|
71
|
+
"bottom-center",
|
|
72
|
+
"bottom-right"
|
|
73
|
+
].includes(D.position) ? D.position : "top-right"), U = i(() => ["warning", "danger"].includes(V.value) ? "alert" : "status"), W = i(() => U.value === "alert" ? "assertive" : "polite"), G = i(() => Number.isFinite(D.duration) ? Math.max(0, D.duration) : 0), K = {
|
|
74
|
+
info: C,
|
|
75
|
+
success: S,
|
|
76
|
+
warning: y,
|
|
77
|
+
danger: b
|
|
78
|
+
}, q = i(() => D.icon ?? K[V.value] ?? null);
|
|
79
|
+
function J() {
|
|
80
|
+
F !== null && (clearTimeout(F), F = null);
|
|
81
|
+
}
|
|
82
|
+
function Y(e = "close") {
|
|
83
|
+
j.value && (J(), j.value = !1, O("update:open", !1), O("close", e));
|
|
84
|
+
}
|
|
85
|
+
function X() {
|
|
86
|
+
J(), I && j.value && G.value !== 0 && !z && !B && (R = Date.now(), F = setTimeout(() => {
|
|
87
|
+
F = null, Y("timeout");
|
|
88
|
+
}, L));
|
|
89
|
+
}
|
|
90
|
+
function Z() {
|
|
91
|
+
F !== null && (L = Math.max(0, L - (Date.now() - R)), J());
|
|
92
|
+
}
|
|
93
|
+
function Q(e) {
|
|
94
|
+
z = e, e ? Z() : X();
|
|
95
|
+
}
|
|
96
|
+
function $(e) {
|
|
97
|
+
B = e.type === "focusin" || e.currentTarget.contains(e.relatedTarget), B ? Z() : X();
|
|
98
|
+
}
|
|
99
|
+
return _(() => D.open, (e) => {
|
|
100
|
+
j.value = e;
|
|
101
|
+
}), _([j, G], ([e]) => {
|
|
102
|
+
L = G.value, e ? X() : (J(), z = !1, B = !1);
|
|
103
|
+
}, { immediate: !0 }), ne(() => {
|
|
104
|
+
I = !0, L = G.value, X();
|
|
105
|
+
}), te(() => {
|
|
106
|
+
I = !1, J();
|
|
107
|
+
}), (i, l) => (d(), a(r, u({ name: "kima-notification" }, p(n)), {
|
|
108
|
+
default: v(() => [j.value ? (d(), s("div", u({ key: 0 }, {
|
|
109
|
+
...p(k),
|
|
110
|
+
id: p(A) ? void 0 : p(k).id,
|
|
111
|
+
title: void 0
|
|
112
|
+
}, {
|
|
113
|
+
class: ["kima-notification", [`kima-notification--${V.value}`, `kima-notification--${H.value}`]],
|
|
114
|
+
role: U.value,
|
|
115
|
+
"aria-live": W.value,
|
|
116
|
+
"aria-atomic": "true",
|
|
117
|
+
"aria-labelledby": e.heading || p(k).title ? N : void 0,
|
|
118
|
+
"aria-describedby": e.message ? P : void 0,
|
|
119
|
+
onMouseenter: l[1] ||= (e) => Q(!0),
|
|
120
|
+
onMouseleave: l[2] ||= (e) => Q(!1),
|
|
121
|
+
onFocusin: $,
|
|
122
|
+
onFocusout: $
|
|
123
|
+
}), [
|
|
124
|
+
q.value ? (d(), s("span", T, [c(t, {
|
|
125
|
+
icon: q.value,
|
|
126
|
+
size: 22
|
|
127
|
+
}, null, 8, ["icon"])])) : o("", !0),
|
|
128
|
+
ee("div", ae, [
|
|
129
|
+
e.heading || p(k).title ? (d(), s("strong", {
|
|
130
|
+
key: 0,
|
|
131
|
+
id: N,
|
|
132
|
+
class: "kima-notification__title"
|
|
133
|
+
}, f(e.heading || p(k).title), 1)) : o("", !0),
|
|
134
|
+
e.message ? (d(), s("span", {
|
|
135
|
+
key: 1,
|
|
136
|
+
id: P,
|
|
137
|
+
class: "kima-notification__message"
|
|
138
|
+
}, f(e.message), 1)) : o("", !0),
|
|
139
|
+
i.$slots.action || p(A) ? (d(), s("div", oe, [ie(i.$slots, "action", {}, void 0, !0)])) : o("", !0)
|
|
140
|
+
]),
|
|
141
|
+
e.closable ? (d(), s("button", {
|
|
142
|
+
key: 1,
|
|
143
|
+
class: "kima-notification__close",
|
|
144
|
+
type: "button",
|
|
145
|
+
"aria-label": "关闭通知",
|
|
146
|
+
title: "关闭通知",
|
|
147
|
+
onClick: l[0] ||= (e) => Y("button")
|
|
148
|
+
}, [c(t, {
|
|
149
|
+
icon: p(x),
|
|
150
|
+
size: 18,
|
|
151
|
+
"aria-hidden": "true"
|
|
152
|
+
}, null, 8, ["icon"])])) : o("", !0)
|
|
153
|
+
], 16, w)) : o("", !0)]),
|
|
154
|
+
_: 3
|
|
155
|
+
}, 16));
|
|
156
|
+
}
|
|
157
|
+
}), [["__scopeId", "data-v-8f69e04e"]]);
|
|
158
|
+
export { E as default };
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import e from "../../_virtual/_plugin-vue_export-helper.js";
|
|
2
|
+
import t from "./icon.ce.js";
|
|
3
|
+
import { activateMotionElement as n, presenceTransition as r, retireMotionElement as i } from "../../utils/motion.js";
|
|
4
|
+
/* empty css */
|
|
5
|
+
import { Fragment as a, Transition as o, TransitionGroup as s, computed as c, createBlock as l, createCommentVNode as u, createElementBlock as d, createElementVNode as f, createVNode as p, getCurrentInstance as m, mergeProps as h, nextTick as g, openBlock as _, ref as v, renderList as y, toDisplayString as b, unref as x, useAttrs as S, useHost as C, watch as w, withCtx as T } from "vue";
|
|
6
|
+
import { ArrowLeft01Icon as E, ArrowRight01Icon as D } from "@hugeicons/core-free-icons";
|
|
7
|
+
// src/components/core/pagination.ce.vue
|
|
8
|
+
var O = ["aria-label", "aria-disabled"], k = { class: "kima-pagination__list" }, A = ["tabindex", "disabled"], j = [
|
|
9
|
+
"tabindex",
|
|
10
|
+
"aria-label",
|
|
11
|
+
"data-page",
|
|
12
|
+
"aria-current",
|
|
13
|
+
"disabled",
|
|
14
|
+
"onClick",
|
|
15
|
+
"onKeydown"
|
|
16
|
+
], M = {
|
|
17
|
+
key: 1,
|
|
18
|
+
class: "kima-pagination__ellipsis",
|
|
19
|
+
"aria-hidden": "true"
|
|
20
|
+
}, N = ["tabindex", "disabled"], P = /*#__PURE__*/ e(/* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
|
|
21
|
+
__name: "pagination.ce",
|
|
22
|
+
props: {
|
|
23
|
+
modelValue: {
|
|
24
|
+
type: Number,
|
|
25
|
+
default: 1
|
|
26
|
+
},
|
|
27
|
+
total: {
|
|
28
|
+
type: Number,
|
|
29
|
+
default: 0
|
|
30
|
+
},
|
|
31
|
+
pageSize: {
|
|
32
|
+
type: Number,
|
|
33
|
+
default: 10
|
|
34
|
+
},
|
|
35
|
+
siblingCount: {
|
|
36
|
+
type: Number,
|
|
37
|
+
default: 1
|
|
38
|
+
},
|
|
39
|
+
disabled: Boolean,
|
|
40
|
+
compact: Boolean
|
|
41
|
+
},
|
|
42
|
+
emits: ["update:modelValue", "change"],
|
|
43
|
+
setup(e, { emit: P }) {
|
|
44
|
+
let F = e, I = P, L = S(), R = m()?.ce ? C() : null, z = c(() => R ? {
|
|
45
|
+
...L,
|
|
46
|
+
id: void 0
|
|
47
|
+
} : L), B = v(1), V = /* @__PURE__ */ new Map(), H = c(() => Number.isFinite(F.pageSize) && F.pageSize > 0 ? F.pageSize : 1), U = c(() => !Number.isFinite(F.total) || F.total <= 0 ? 0 : Math.ceil(F.total / H.value)), W = c(() => U.value ? q(B.value, U.value) : 0), G = c(() => Math.max(0, Math.floor(Number.isFinite(F.siblingCount) ? F.siblingCount : 0))), K = c(() => {
|
|
48
|
+
let e = U.value;
|
|
49
|
+
if (!e) return [];
|
|
50
|
+
let t = /* @__PURE__ */ new Set(), n = Math.min(1, e);
|
|
51
|
+
for (let e = 1; e <= n; e += 1) t.add(e);
|
|
52
|
+
for (let n = Math.max(1, W.value - G.value); n <= Math.min(e, W.value + G.value); n += 1) t.add(n);
|
|
53
|
+
for (let r = Math.max(1, e - n + 1); r <= e; r += 1) t.add(r);
|
|
54
|
+
let r = [...t].sort((e, t) => e - t), i = [];
|
|
55
|
+
return r.forEach((e, t) => {
|
|
56
|
+
let n = r[t - 1];
|
|
57
|
+
n && e - n > 1 && i.push({
|
|
58
|
+
type: "ellipsis",
|
|
59
|
+
key: `ellipsis-${n}-${e}`
|
|
60
|
+
}), i.push({
|
|
61
|
+
type: "page",
|
|
62
|
+
page: e,
|
|
63
|
+
key: `page-${e}`
|
|
64
|
+
});
|
|
65
|
+
}), i;
|
|
66
|
+
});
|
|
67
|
+
function q(e, t = U.value) {
|
|
68
|
+
return Math.max(1, Math.min(t, Number.isFinite(e) ? Math.floor(e) : 1));
|
|
69
|
+
}
|
|
70
|
+
let J = {
|
|
71
|
+
onBeforeLeave(e) {
|
|
72
|
+
i(e), e.removeAttribute("aria-current");
|
|
73
|
+
},
|
|
74
|
+
onBeforeEnter(e) {
|
|
75
|
+
n(e), Number(e.dataset.page) === W.value && e.setAttribute("aria-current", "page");
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
function Y(e, t) {
|
|
79
|
+
t ? V.set(e, t) : V.delete(e);
|
|
80
|
+
}
|
|
81
|
+
function X(e) {
|
|
82
|
+
if (F.disabled || !U.value) return;
|
|
83
|
+
let t = q(e);
|
|
84
|
+
t !== W.value && (B.value = t, I("update:modelValue", t), I("change", t));
|
|
85
|
+
}
|
|
86
|
+
function Z(e) {
|
|
87
|
+
g(() => V.get(e)?.focus());
|
|
88
|
+
}
|
|
89
|
+
function Q(e, t) {
|
|
90
|
+
if (![
|
|
91
|
+
"ArrowLeft",
|
|
92
|
+
"ArrowRight",
|
|
93
|
+
"Home",
|
|
94
|
+
"End"
|
|
95
|
+
].includes(t.key)) return;
|
|
96
|
+
let n = K.value.filter((e) => e.type === "page").map((e) => e.page), r = n.indexOf(e);
|
|
97
|
+
r < 0 || (t.preventDefault(), t.key === "Home" ? Z(n[0]) : t.key === "End" ? Z(n[n.length - 1]) : Z(n[Math.max(0, Math.min(n.length - 1, r + (t.key === "ArrowRight" ? 1 : -1)))]));
|
|
98
|
+
}
|
|
99
|
+
return w(() => F.modelValue, (e) => {
|
|
100
|
+
B.value = U.value ? q(e) : 0;
|
|
101
|
+
}, { immediate: !0 }), w(U, (e) => {
|
|
102
|
+
B.value = e ? q(B.value, e) : 0;
|
|
103
|
+
}, { immediate: !0 }), (n, i) => (_(), l(o, h({ name: "kima-content" }, x(r)), {
|
|
104
|
+
default: T(() => [U.value ? (_(), d("nav", h({ key: 0 }, z.value, {
|
|
105
|
+
class: ["kima-pagination", {
|
|
106
|
+
"kima-pagination--compact": e.compact,
|
|
107
|
+
"kima-pagination--disabled": e.disabled
|
|
108
|
+
}],
|
|
109
|
+
"aria-label": x(L)["aria-label"] || "分页",
|
|
110
|
+
"aria-disabled": e.disabled || void 0
|
|
111
|
+
}), [f("div", k, [
|
|
112
|
+
f("button", {
|
|
113
|
+
class: "kima-pagination__button kima-pagination__button--direction",
|
|
114
|
+
type: "button",
|
|
115
|
+
tabindex: e.disabled ? -1 : 0,
|
|
116
|
+
disabled: e.disabled || W.value <= 1,
|
|
117
|
+
"aria-label": "上一页",
|
|
118
|
+
onClick: i[0] ||= (e) => X(W.value - 1)
|
|
119
|
+
}, [p(t, {
|
|
120
|
+
icon: x(E),
|
|
121
|
+
size: 18,
|
|
122
|
+
"aria-hidden": "true"
|
|
123
|
+
}, null, 8, ["icon"])], 8, A),
|
|
124
|
+
p(s, h({ name: "kima-list" }, J), {
|
|
125
|
+
default: T(() => [(_(!0), d(a, null, y(K.value, (t) => (_(), d(a, { key: t.key }, [t.type === "page" ? (_(), d("button", {
|
|
126
|
+
key: 0,
|
|
127
|
+
ref_for: !0,
|
|
128
|
+
ref: (e) => Y(t.page, e),
|
|
129
|
+
class: "kima-pagination__button",
|
|
130
|
+
type: "button",
|
|
131
|
+
tabindex: e.disabled ? -1 : 0,
|
|
132
|
+
"aria-label": `第 ${t.page} 页`,
|
|
133
|
+
"data-page": t.page,
|
|
134
|
+
"aria-current": t.page === W.value ? "page" : void 0,
|
|
135
|
+
disabled: e.disabled,
|
|
136
|
+
onClick: (e) => X(t.page),
|
|
137
|
+
onKeydown: (e) => Q(t.page, e)
|
|
138
|
+
}, b(t.page), 41, j)) : (_(), d("span", M, "…"))], 64))), 128))]),
|
|
139
|
+
_: 1
|
|
140
|
+
}, 16),
|
|
141
|
+
f("button", {
|
|
142
|
+
class: "kima-pagination__button kima-pagination__button--direction",
|
|
143
|
+
type: "button",
|
|
144
|
+
tabindex: e.disabled ? -1 : 0,
|
|
145
|
+
disabled: e.disabled || W.value >= U.value,
|
|
146
|
+
"aria-label": "下一页",
|
|
147
|
+
onClick: i[1] ||= (e) => X(W.value + 1)
|
|
148
|
+
}, [p(t, {
|
|
149
|
+
icon: x(D),
|
|
150
|
+
size: 18,
|
|
151
|
+
"aria-hidden": "true"
|
|
152
|
+
}, null, 8, ["icon"])], 8, N)
|
|
153
|
+
])], 16, O)) : u("", !0)]),
|
|
154
|
+
_: 1
|
|
155
|
+
}, 16));
|
|
156
|
+
}
|
|
157
|
+
}), [["__scopeId", "data-v-d62e7dea"]]);
|
|
158
|
+
export { P as default };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import e from "../../_virtual/_plugin-vue_export-helper.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import { Transition as t, computed as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createVNode as o, getCurrentInstance as s, mergeProps as c, openBlock as l, unref as u, useAttrs as d, withCtx as f } from "vue";
|
|
4
|
+
// src/components/core/progress.ce.vue
|
|
5
|
+
var p = { class: "kima-progress" }, m = { class: "kima-progress__track" }, h = [
|
|
6
|
+
"value",
|
|
7
|
+
"max",
|
|
8
|
+
"aria-label"
|
|
9
|
+
], g = {
|
|
10
|
+
key: 0,
|
|
11
|
+
class: "kima-progress__motion",
|
|
12
|
+
"aria-hidden": "true"
|
|
13
|
+
}, _ = /*#__PURE__*/ e(/* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
|
|
14
|
+
__name: "progress.ce",
|
|
15
|
+
props: {
|
|
16
|
+
value: {
|
|
17
|
+
type: Number,
|
|
18
|
+
default: 0
|
|
19
|
+
},
|
|
20
|
+
max: {
|
|
21
|
+
type: Number,
|
|
22
|
+
default: 100
|
|
23
|
+
},
|
|
24
|
+
indeterminate: {
|
|
25
|
+
type: Boolean,
|
|
26
|
+
default: !1
|
|
27
|
+
},
|
|
28
|
+
label: {
|
|
29
|
+
type: String,
|
|
30
|
+
default: ""
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
setup(e) {
|
|
34
|
+
let _ = e, v = d(), y = !!s()?.ce, b = n(() => y ? {
|
|
35
|
+
...v,
|
|
36
|
+
id: void 0
|
|
37
|
+
} : v), x = n(() => Number.isFinite(_.max) && _.max > 0 ? _.max : 100), S = n(() => Number.isFinite(_.value) ? Math.max(0, Math.min(x.value, _.value)) : 0);
|
|
38
|
+
return (n, s) => (l(), i("div", p, [a("span", m, [a("progress", c(b.value, {
|
|
39
|
+
class: "kima-progress__bar",
|
|
40
|
+
value: e.indeterminate ? void 0 : S.value,
|
|
41
|
+
max: x.value,
|
|
42
|
+
"aria-label": u(v)["aria-label"] || e.label || void 0
|
|
43
|
+
}), null, 16, h), o(t, { name: "kima-fade" }, {
|
|
44
|
+
default: f(() => [e.indeterminate ? (l(), i("span", g, [...s[0] ||= [a("span", null, null, -1)]])) : r("", !0)]),
|
|
45
|
+
_: 1
|
|
46
|
+
})])]));
|
|
47
|
+
}
|
|
48
|
+
}), [["__scopeId", "data-v-84d44589"]]);
|
|
49
|
+
export { _ as default };
|
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
import { useRipple as e } from "../../utils/ripple.js";
|
|
2
|
+
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
3
|
+
import n from "./icon.ce.js";
|
|
4
|
+
import { presenceTransition as r } from "../../utils/motion.js";
|
|
5
|
+
import { useRemoteOptions as i } from "../../utils/remote-options.js";
|
|
6
|
+
/* empty css */
|
|
7
|
+
import { Fragment as a, Transition as o, computed as s, createBlock as ee, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createTextVNode as te, createVNode as d, getCurrentInstance as ne, mergeProps as f, nextTick as p, normalizeClass as m, onBeforeUnmount as re, onMounted as ie, openBlock as h, ref as g, renderList as _, shallowRef as ae, toDisplayString as v, unref as y, useAttrs as oe, useHost as se, useId as ce, vModelSelect as le, vModelText as ue, watch as b, withCtx as de, withDirectives as fe, withModifiers as x } from "vue";
|
|
8
|
+
import { ArrowDown01Icon as pe, Cancel01Icon as me, Search01Icon as he, Tick01Icon as ge } from "@hugeicons/core-free-icons";
|
|
9
|
+
// src/components/core/select.ce.vue
|
|
10
|
+
var _e = ["aria-disabled"], ve = [
|
|
11
|
+
"disabled",
|
|
12
|
+
"aria-expanded",
|
|
13
|
+
"aria-label",
|
|
14
|
+
"aria-required",
|
|
15
|
+
"aria-activedescendant"
|
|
16
|
+
], ye = ["disabled"], be = [
|
|
17
|
+
"name",
|
|
18
|
+
"required",
|
|
19
|
+
"disabled"
|
|
20
|
+
], xe = ["value", "disabled"], Se = {
|
|
21
|
+
key: 0,
|
|
22
|
+
class: "kima-select__popup"
|
|
23
|
+
}, Ce = {
|
|
24
|
+
key: 0,
|
|
25
|
+
class: "kima-select__search-wrap"
|
|
26
|
+
}, we = ["aria-activedescendant"], Te = ["aria-busy"], Ee = {
|
|
27
|
+
key: 0,
|
|
28
|
+
class: "kima-select__status",
|
|
29
|
+
role: "status"
|
|
30
|
+
}, De = {
|
|
31
|
+
key: 1,
|
|
32
|
+
class: "kima-select__status kima-select__status--error",
|
|
33
|
+
role: "alert"
|
|
34
|
+
}, Oe = [
|
|
35
|
+
"id",
|
|
36
|
+
"aria-selected",
|
|
37
|
+
"aria-disabled",
|
|
38
|
+
"onClick"
|
|
39
|
+
], ke = { class: "kima-select__option-copy" }, Ae = { class: "kima-select__option-label" }, je = {
|
|
40
|
+
key: 0,
|
|
41
|
+
class: "kima-select__option-description"
|
|
42
|
+
}, Me = {
|
|
43
|
+
key: 1,
|
|
44
|
+
class: "kima-select__empty",
|
|
45
|
+
role: "status"
|
|
46
|
+
}, S = /*#__PURE__*/ t(/* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
|
|
47
|
+
__name: "select.ce",
|
|
48
|
+
props: {
|
|
49
|
+
modelValue: {
|
|
50
|
+
type: [
|
|
51
|
+
String,
|
|
52
|
+
Number,
|
|
53
|
+
Boolean,
|
|
54
|
+
Object,
|
|
55
|
+
Array
|
|
56
|
+
],
|
|
57
|
+
default: null
|
|
58
|
+
},
|
|
59
|
+
items: {
|
|
60
|
+
type: Array,
|
|
61
|
+
default: () => []
|
|
62
|
+
},
|
|
63
|
+
label: {
|
|
64
|
+
type: String,
|
|
65
|
+
default: ""
|
|
66
|
+
},
|
|
67
|
+
placeholder: {
|
|
68
|
+
type: String,
|
|
69
|
+
default: "请选择"
|
|
70
|
+
},
|
|
71
|
+
disabled: Boolean,
|
|
72
|
+
required: Boolean,
|
|
73
|
+
name: String,
|
|
74
|
+
searchable: Boolean,
|
|
75
|
+
clearable: Boolean,
|
|
76
|
+
open: Boolean,
|
|
77
|
+
loader: {
|
|
78
|
+
type: Function,
|
|
79
|
+
default: void 0
|
|
80
|
+
},
|
|
81
|
+
debounce: {
|
|
82
|
+
type: Number,
|
|
83
|
+
default: 200
|
|
84
|
+
},
|
|
85
|
+
retry: {
|
|
86
|
+
type: Number,
|
|
87
|
+
default: 0
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
emits: [
|
|
91
|
+
"update:modelValue",
|
|
92
|
+
"change",
|
|
93
|
+
"update:open",
|
|
94
|
+
"options-loading",
|
|
95
|
+
"options-load",
|
|
96
|
+
"options-error"
|
|
97
|
+
],
|
|
98
|
+
setup(t, { emit: S }) {
|
|
99
|
+
let C = oe(), Ne = ne().ce ? se() : null, w = t, T = S, E = g(null), D = g(null), O = g(null);
|
|
100
|
+
e(O);
|
|
101
|
+
let k = g(null), A = g(null), j = g([]), M = g(""), N = g(-1), P = ae(w.modelValue), F = g(w.open && !w.disabled), I, L, R, z, B = !0, V = ce(), Pe = `kima-select-${V}-trigger`, H = `kima-select-${V}-listbox`, Fe = `kima-select-${V}-native`, Ie = s(() => C["aria-label"] || C.ariaLabel || w.label || void 0), Le = s(() => w.loader), Re = s(() => M.value), { items: ze, loading: U, error: W, retry: Be } = i(Le, Re, s(() => w.debounce), s(() => w.retry), T), G = s(() => typeof w.loader == "function" ? ze.value : w.items), K = s(() => {
|
|
102
|
+
let e = M.value.trim().toLocaleLowerCase();
|
|
103
|
+
return typeof w.loader == "function" || !e ? G.value : G.value.filter((t) => `${t.label} ${t.description || ""}`.toLocaleLowerCase().includes(e));
|
|
104
|
+
}), q = s(() => G.value.find((e) => Object.is(e.value, P.value))), Ve = s({
|
|
105
|
+
get: () => q.value ? P.value : "",
|
|
106
|
+
set: () => {
|
|
107
|
+
let e = A.value.selectedIndex;
|
|
108
|
+
Z(e > 0 ? G.value[e - 1].value : null);
|
|
109
|
+
}
|
|
110
|
+
}), J = s(() => K.value.flatMap((e, t) => e.disabled ? [] : [t])), He = s(() => F.value && N.value >= 0 ? `${H}-option-${N.value}` : void 0);
|
|
111
|
+
function Y(e) {
|
|
112
|
+
N.value = e, p(() => j.value[e]?.scrollIntoView({ block: "nearest" }));
|
|
113
|
+
}
|
|
114
|
+
function Ue(e) {
|
|
115
|
+
let t = J.value.length;
|
|
116
|
+
if (!t) return;
|
|
117
|
+
let n = J.value.indexOf(N.value), r = n < 0 ? e > 0 ? 0 : t - 1 : (n + e + t) % t;
|
|
118
|
+
Y(J.value[r]);
|
|
119
|
+
}
|
|
120
|
+
function We() {
|
|
121
|
+
w.disabled || F.value || (F.value = !0, T("update:open", !0));
|
|
122
|
+
}
|
|
123
|
+
function X(e = !0) {
|
|
124
|
+
F.value && (B = e, F.value = !1, T("update:open", !1));
|
|
125
|
+
}
|
|
126
|
+
function Ge() {
|
|
127
|
+
F.value ? X() : We();
|
|
128
|
+
}
|
|
129
|
+
function Z(e) {
|
|
130
|
+
w.disabled || Object.is(e, P.value) || (P.value = e, T("update:modelValue", e), T("change", e));
|
|
131
|
+
}
|
|
132
|
+
function Ke(e) {
|
|
133
|
+
w.disabled || e.disabled || (Z(e.value), X());
|
|
134
|
+
}
|
|
135
|
+
function qe() {
|
|
136
|
+
Z(null), X(), p(() => D.value?.focus());
|
|
137
|
+
}
|
|
138
|
+
function Je(e) {
|
|
139
|
+
clearTimeout(z), z = setTimeout(() => {
|
|
140
|
+
e.defaultPrevented || (P.value = R, A.value.selectedIndex = G.value.findIndex((e) => Object.is(e.value, R)) + 1, X(!1), T("update:modelValue", R));
|
|
141
|
+
}, 0);
|
|
142
|
+
}
|
|
143
|
+
function Q(e) {
|
|
144
|
+
if (!(w.disabled || e.isComposing)) {
|
|
145
|
+
if (e.key === "Tab") X(!1);
|
|
146
|
+
else if ((e.key !== " " || e.target !== k.value) && [
|
|
147
|
+
"ArrowDown",
|
|
148
|
+
"ArrowUp",
|
|
149
|
+
"Home",
|
|
150
|
+
"End",
|
|
151
|
+
"Enter",
|
|
152
|
+
" ",
|
|
153
|
+
"Escape"
|
|
154
|
+
].includes(e.key)) {
|
|
155
|
+
if (e.preventDefault(), e.stopPropagation(), e.key === "Escape") X();
|
|
156
|
+
else if (!F.value) We(), e.key === "ArrowUp" || e.key === "End" ? p(() => Y(J.value.at(-1) ?? -1)) : e.key === "Home" && p(() => Y(J.value[0] ?? -1));
|
|
157
|
+
else if (e.key === "ArrowDown") Ue(1);
|
|
158
|
+
else if (e.key === "ArrowUp") Ue(-1);
|
|
159
|
+
else if (e.key === "Home") Y(J.value[0] ?? -1);
|
|
160
|
+
else if (e.key === "End") Y(J.value.at(-1) ?? -1);
|
|
161
|
+
else {
|
|
162
|
+
let e = K.value[N.value];
|
|
163
|
+
e && Ke(e);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
function $(e) {
|
|
169
|
+
F.value && !e.composedPath().includes(E.value) && X(!1);
|
|
170
|
+
}
|
|
171
|
+
return b(() => w.modelValue, (e) => {
|
|
172
|
+
P.value = e;
|
|
173
|
+
}), b(() => w.open, (e) => {
|
|
174
|
+
F.value = e && !w.disabled;
|
|
175
|
+
}), b(() => w.disabled, (e) => {
|
|
176
|
+
e && X(!1);
|
|
177
|
+
}), b(F, async (e, t) => {
|
|
178
|
+
if (e) {
|
|
179
|
+
M.value = "";
|
|
180
|
+
let e = K.value.findIndex((e) => Object.is(e.value, P.value) && !e.disabled);
|
|
181
|
+
Y(e >= 0 ? e : J.value[0] ?? -1), await p(), F.value && (w.searchable ? k.value : D.value)?.focus();
|
|
182
|
+
} else t && B && p(() => {
|
|
183
|
+
F.value || D.value?.focus();
|
|
184
|
+
}), B = !0;
|
|
185
|
+
}, { immediate: !0 }), b(K, () => {
|
|
186
|
+
let e = K.value.findIndex((e) => Object.is(e.value, P.value) && !e.disabled);
|
|
187
|
+
Y(!M.value && e >= 0 ? e : J.value[0] ?? -1);
|
|
188
|
+
}), ie(() => {
|
|
189
|
+
R = w.modelValue, L = A.value.form, L?.addEventListener("reset", Je), I = E.value.ownerDocument, I.addEventListener("pointerdown", $), I.addEventListener("focusin", $);
|
|
190
|
+
}), re(() => {
|
|
191
|
+
clearTimeout(z), L?.removeEventListener("reset", Je), I.removeEventListener("pointerdown", $), I.removeEventListener("focusin", $);
|
|
192
|
+
}), (e, i) => (h(), l("div", f({
|
|
193
|
+
ref_key: "root",
|
|
194
|
+
ref: E
|
|
195
|
+
}, {
|
|
196
|
+
...y(C),
|
|
197
|
+
id: y(Ne) ? void 0 : y(C).id
|
|
198
|
+
}, { class: ["kima-select", {
|
|
199
|
+
"kima-select--open": F.value,
|
|
200
|
+
"kima-select--disabled": t.disabled
|
|
201
|
+
}] }), [
|
|
202
|
+
u("div", {
|
|
203
|
+
ref_key: "control",
|
|
204
|
+
ref: O,
|
|
205
|
+
class: "kima-select__control",
|
|
206
|
+
"aria-disabled": t.disabled || void 0
|
|
207
|
+
}, [u("button", {
|
|
208
|
+
id: Pe,
|
|
209
|
+
ref_key: "trigger",
|
|
210
|
+
ref: D,
|
|
211
|
+
class: "kima-select__trigger",
|
|
212
|
+
type: "button",
|
|
213
|
+
role: "combobox",
|
|
214
|
+
disabled: t.disabled,
|
|
215
|
+
"aria-expanded": F.value,
|
|
216
|
+
"aria-controls": H,
|
|
217
|
+
"aria-haspopup": "listbox",
|
|
218
|
+
"aria-label": Ie.value,
|
|
219
|
+
"aria-required": t.required || void 0,
|
|
220
|
+
"aria-activedescendant": t.searchable ? void 0 : He.value,
|
|
221
|
+
onClick: Ge,
|
|
222
|
+
onKeydown: Q
|
|
223
|
+
}, [u("span", { class: m(["kima-select__trigger-label", { "kima-select__trigger-label--placeholder": !q.value }]) }, v(q.value ? q.value.label : t.placeholder), 3), d(n, {
|
|
224
|
+
class: "kima-select__arrow",
|
|
225
|
+
icon: y(pe),
|
|
226
|
+
size: 20,
|
|
227
|
+
"aria-hidden": "true"
|
|
228
|
+
}, null, 8, ["icon"])], 40, ve), d(o, f({ name: "kima-fade" }, y(r)), {
|
|
229
|
+
default: de(() => [t.clearable && q.value ? (h(), l("button", {
|
|
230
|
+
key: 0,
|
|
231
|
+
class: "kima-select__clear",
|
|
232
|
+
type: "button",
|
|
233
|
+
"aria-label": "清除选择",
|
|
234
|
+
title: "清除选择",
|
|
235
|
+
disabled: t.disabled,
|
|
236
|
+
onClick: x(qe, ["stop"])
|
|
237
|
+
}, [d(n, {
|
|
238
|
+
icon: y(me),
|
|
239
|
+
size: 18,
|
|
240
|
+
"aria-hidden": "true"
|
|
241
|
+
}, null, 8, ["icon"])], 8, ye)) : c("", !0)]),
|
|
242
|
+
_: 1
|
|
243
|
+
}, 16)], 8, _e),
|
|
244
|
+
fe(u("select", {
|
|
245
|
+
ref_key: "nativeSelect",
|
|
246
|
+
ref: A,
|
|
247
|
+
"onUpdate:modelValue": i[0] ||= (e) => Ve.value = e,
|
|
248
|
+
id: Fe,
|
|
249
|
+
class: "kima-select__native",
|
|
250
|
+
name: t.name,
|
|
251
|
+
required: t.required,
|
|
252
|
+
disabled: t.disabled,
|
|
253
|
+
tabindex: "-1",
|
|
254
|
+
"aria-hidden": "true",
|
|
255
|
+
onInput: i[1] ||= x(() => {}, ["stop"]),
|
|
256
|
+
onChange: i[2] ||= x(() => {}, ["stop"]),
|
|
257
|
+
onInvalid: i[3] ||= x((e) => D.value?.focus(), ["prevent"])
|
|
258
|
+
}, [i[9] ||= u("option", { value: "" }, null, -1), (h(!0), l(a, null, _(G.value, (e, t) => (h(), l("option", {
|
|
259
|
+
key: t,
|
|
260
|
+
value: e.value,
|
|
261
|
+
disabled: e.disabled
|
|
262
|
+
}, v(e.label), 9, xe))), 128))], 40, be), [[le, Ve.value]]),
|
|
263
|
+
d(o, f({ name: "kima-popup" }, y(r)), {
|
|
264
|
+
default: de(() => [F.value ? (h(), l("div", Se, [
|
|
265
|
+
t.searchable ? (h(), l("div", Ce, [d(n, {
|
|
266
|
+
class: "kima-select__search-icon",
|
|
267
|
+
icon: y(he),
|
|
268
|
+
size: 18,
|
|
269
|
+
"aria-hidden": "true"
|
|
270
|
+
}, null, 8, ["icon"]), fe(u("input", {
|
|
271
|
+
ref_key: "searchInput",
|
|
272
|
+
ref: k,
|
|
273
|
+
"onUpdate:modelValue": i[4] ||= (e) => M.value = e,
|
|
274
|
+
class: "kima-select__search",
|
|
275
|
+
type: "search",
|
|
276
|
+
role: "combobox",
|
|
277
|
+
"aria-label": "搜索选项",
|
|
278
|
+
"aria-expanded": "true",
|
|
279
|
+
"aria-autocomplete": "list",
|
|
280
|
+
"aria-controls": H,
|
|
281
|
+
"aria-activedescendant": He.value,
|
|
282
|
+
onInput: i[5] ||= x(() => {}, ["stop"]),
|
|
283
|
+
onChange: i[6] ||= x(() => {}, ["stop"]),
|
|
284
|
+
onKeydown: Q
|
|
285
|
+
}, null, 40, we), [[ue, M.value]])])) : c("", !0),
|
|
286
|
+
u("div", {
|
|
287
|
+
id: H,
|
|
288
|
+
class: "kima-select__options",
|
|
289
|
+
role: "listbox",
|
|
290
|
+
"aria-labelledby": Pe,
|
|
291
|
+
"aria-busy": y(U) || void 0
|
|
292
|
+
}, [y(U) ? (h(), l("div", Ee, "加载中…")) : y(W) ? (h(), l("div", De, [te(v(y(W)) + " ", 1), u("button", {
|
|
293
|
+
type: "button",
|
|
294
|
+
onClick: i[7] ||= (...e) => y(Be) && y(Be)(...e)
|
|
295
|
+
}, "重试")])) : c("", !0), (h(!0), l(a, null, _(K.value, (e, t) => (h(), l("div", {
|
|
296
|
+
id: `${H}-option-${t}`,
|
|
297
|
+
key: t,
|
|
298
|
+
ref_for: !0,
|
|
299
|
+
ref: (e) => {
|
|
300
|
+
j.value[t] = e;
|
|
301
|
+
},
|
|
302
|
+
class: m(["kima-select__option", {
|
|
303
|
+
"kima-select__option--active": t === N.value,
|
|
304
|
+
"kima-select__option--selected": Object.is(e.value, P.value)
|
|
305
|
+
}]),
|
|
306
|
+
role: "option",
|
|
307
|
+
"aria-selected": Object.is(e.value, P.value),
|
|
308
|
+
"aria-disabled": e.disabled || void 0,
|
|
309
|
+
onPointerdown: i[8] ||= x(() => {}, ["prevent"]),
|
|
310
|
+
onClick: (t) => Ke(e)
|
|
311
|
+
}, [u("span", ke, [u("span", Ae, v(e.label), 1), e.description ? (h(), l("span", je, v(e.description), 1)) : c("", !0)]), Object.is(e.value, P.value) ? (h(), ee(n, {
|
|
312
|
+
key: 0,
|
|
313
|
+
class: "kima-select__check",
|
|
314
|
+
icon: y(ge),
|
|
315
|
+
size: 18,
|
|
316
|
+
"aria-hidden": "true"
|
|
317
|
+
}, null, 8, ["icon"])) : c("", !0)], 42, Oe))), 128))], 8, Te),
|
|
318
|
+
!y(U) && !y(W) && K.value.length === 0 ? (h(), l("div", Me, "没有匹配选项")) : c("", !0)
|
|
319
|
+
])) : c("", !0)]),
|
|
320
|
+
_: 1
|
|
321
|
+
}, 16)
|
|
322
|
+
], 16));
|
|
323
|
+
}
|
|
324
|
+
}), [["__scopeId", "data-v-8928e412"]]);
|
|
325
|
+
export { S as default };
|