hys-ui 0.2.0 → 0.3.0
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/CHANGELOG.md +38 -0
- package/README.md +15 -1
- package/dist/components/HysAlert/HysAlert.vue.js +5 -54
- package/dist/components/HysAlert/HysAlert2.vue.js +159 -2
- package/dist/components/HysAutocomplete/HysAutocomplete.vue.js +2 -2
- package/dist/components/HysAutocomplete/HysAutocomplete2.vue.js +285 -273
- package/dist/components/HysAvatarGroup/HysAvatarGroup.vue.js +1 -1
- package/dist/components/HysAvatarGroup/HysAvatarGroup2.vue.js +102 -98
- package/dist/components/HysBreadcrumb/HysBreadcrumb.vue.js +1 -1
- package/dist/components/HysBreadcrumb/HysBreadcrumb2.vue.js +273 -59
- package/dist/components/HysCalendar/HysCalendar.vue.js +3 -3
- package/dist/components/HysCalendar/HysCalendar2.vue.js +237 -225
- package/dist/components/HysCascader/HysCascader.vue.js +2 -2
- package/dist/components/HysCascader/HysCascader2.vue.js +337 -324
- package/dist/components/HysColorPicker/HysColorPanel.vue.js +7 -0
- package/dist/components/HysColorPicker/HysColorPanel2.vue.js +238 -0
- package/dist/components/HysColorPicker/HysColorPicker.vue.js +2 -2
- package/dist/components/HysColorPicker/HysColorPicker2.vue.js +239 -217
- package/dist/components/HysCommandPalette/HysCommandPalette.vue.js +90 -76
- package/dist/components/HysContextMenu/HysContextMenu.vue.js +5 -89
- package/dist/components/HysContextMenu/HysContextMenu2.vue.js +247 -2
- package/dist/components/HysContextMenu/HysMenuPanel.vue.js +7 -0
- package/dist/components/HysContextMenu/HysMenuPanel2.vue.js +208 -0
- package/dist/components/HysContextMenu/HysMenuSlot.js +10 -0
- package/dist/components/HysDataGrid/HysDataGrid.vue.js +1 -1
- package/dist/components/HysDataGrid/HysDataGrid2.vue.js +1008 -559
- package/dist/components/HysDatePicker/HysDatePicker.vue.js +2 -0
- package/dist/components/HysDatePicker/HysDatePickerControl.vue.js +2 -2
- package/dist/components/HysDatePicker/HysDatePickerControl2.vue.js +539 -526
- package/dist/components/HysDateRangePicker/HysDateRangePicker.vue.js +5 -3
- package/dist/components/HysDrawer/HysDrawer.vue.js +1 -1
- package/dist/components/HysDrawer/HysDrawer2.vue.js +434 -84
- package/dist/components/HysEmpty/HysEmpty.vue.js +5 -41
- package/dist/components/HysEmpty/HysEmpty2.vue.js +181 -2
- package/dist/components/HysFormItem/HysFormItem.vue.js +2 -2
- package/dist/components/HysFormItem/HysFormItem2.vue.js +171 -164
- package/dist/components/HysGantt/HysGantt.vue.js +1 -1
- package/dist/components/HysGantt/HysGantt2.vue.js +810 -795
- package/dist/components/HysMention/HysMention.vue.js +1 -1
- package/dist/components/HysMention/HysMention2.vue.js +112 -100
- package/dist/components/HysModal/HysModal.vue.js +2 -2
- package/dist/components/HysModal/HysModal2.vue.js +490 -85
- package/dist/components/HysPopover/HysPopover.vue.js +5 -91
- package/dist/components/HysPopover/HysPopover2.vue.js +120 -2
- package/dist/components/HysProgress/HysProgress.vue.js +2 -2
- package/dist/components/HysProgress/HysProgress2.vue.js +319 -52
- package/dist/components/HysSelect/HysSelect.vue.js +2 -2
- package/dist/components/HysSelect/HysSelect2.vue.js +730 -594
- package/dist/components/HysSlider/HysSlider.vue.js +2 -2
- package/dist/components/HysSlider/HysSlider2.vue.js +192 -188
- package/dist/components/HysSlider/SliderTooltip.vue.js +2 -2
- package/dist/components/HysSlider/SliderTooltip2.vue.js +103 -89
- package/dist/components/HysTable/HysTable.vue.js +2 -2
- package/dist/components/HysTable/HysTable2.vue.js +389 -368
- package/dist/components/HysTagInput/HysTagInput.vue.js +5 -82
- package/dist/components/HysTagInput/HysTagInput2.vue.js +396 -2
- package/dist/components/HysTimeline/HysTimeline.vue.js +2 -2
- package/dist/components/HysTimeline/HysTimeline2.vue.js +243 -24
- package/dist/components/HysTooltip/HysTooltip.vue.js +5 -64
- package/dist/components/HysTooltip/HysTooltip2.vue.js +110 -2
- package/dist/components/HysTour/HysTour.vue.js +46 -42
- package/dist/components/HysTransfer/HysTransfer.vue.js +2 -2
- package/dist/components/HysTransfer/HysTransfer2.vue.js +237 -207
- package/dist/components/HysTransfer/HysTransferPanel.vue.js +1 -1
- package/dist/components/HysTransfer/HysTransferPanel2.vue.js +320 -271
- package/dist/components/HysTree/HysTree.vue.js +2 -2
- package/dist/components/HysTree/HysTree2.vue.js +195 -184
- package/dist/components/HysTreeSelect/HysTreeSelect.vue.js +4 -4
- package/dist/components/HysTreeSelect/HysTreeSelect2.vue.js +389 -377
- package/dist/components/HysUpload/HysUpload.vue.js +2 -2
- package/dist/components/HysUpload/HysUpload2.vue.js +459 -125
- package/dist/components/HysVirtualTable/HysVirtualTable.vue.js +5 -94
- package/dist/components/HysVirtualTable/HysVirtualTable2.vue.js +656 -2
- package/dist/composables/color.js +97 -0
- package/dist/composables/dataGrid.js +68 -0
- package/dist/composables/drawer.js +17 -0
- package/dist/composables/feedback.js +14 -0
- package/dist/composables/menu.js +96 -0
- package/dist/composables/modal.js +14 -0
- package/dist/composables/overlayManager.js +48 -18
- package/dist/composables/progress.js +94 -0
- package/dist/composables/tagInput.js +16 -0
- package/dist/composables/timeline.js +19 -0
- package/dist/composables/transfer.js +19 -17
- package/dist/composables/upload.js +55 -0
- package/dist/composables/uploadRequest.js +58 -0
- package/dist/composables/useAlert.js +124 -0
- package/dist/composables/useColorPicker.js +402 -0
- package/dist/composables/useContextMenu.js +514 -0
- package/dist/composables/useDataGridRemote.js +67 -0
- package/dist/composables/useDialog.js +86 -43
- package/dist/composables/useDrawerPush.js +33 -0
- package/dist/composables/useDrawerResize.js +221 -0
- package/dist/composables/useFloating.js +110 -76
- package/dist/composables/useHysModal.js +185 -0
- package/dist/composables/useModal.js +295 -0
- package/dist/composables/useModalInteraction.js +394 -0
- package/dist/composables/usePopupSurface.js +458 -0
- package/dist/composables/useTagInput.js +313 -0
- package/dist/composables/useTransferMotion.js +185 -0
- package/dist/composables/useUpload.js +472 -0
- package/dist/composables/useUploadModel.js +65 -0
- package/dist/composables/useUploadRequests.js +266 -0
- package/dist/composables/useVirtualTableLayout.js +277 -0
- package/dist/composables/virtualTable.js +43 -0
- package/dist/index.js +27 -24
- package/dist/internal/PopupReference.js +39 -0
- package/dist/internal/PopupSurfacePanel.vue.js +7 -0
- package/dist/internal/PopupSurfacePanel2.vue.js +92 -0
- package/dist/motion/PopupMotion.js +105 -0
- package/dist/motion/popup.js +10 -0
- package/dist/style.css +1 -1
- package/dist/types/components/HysAlert/HysAlert.vue.d.ts +32 -22
- package/dist/types/components/HysAutocomplete/HysAutocomplete.vue.d.ts +7 -7
- package/dist/types/components/HysAvatarGroup/HysAvatarGroup.vue.d.ts +6 -1
- package/dist/types/components/HysBadge/HysBadge.vue.d.ts +3 -3
- package/dist/types/components/HysBreadcrumb/HysBreadcrumb.vue.d.ts +54 -31
- package/dist/types/components/HysCalendar/HysCalendar.vue.d.ts +3 -2
- package/dist/types/components/HysCascader/HysCascader.vue.d.ts +7 -7
- package/dist/types/components/HysCascader/HysCascaderColumn.vue.d.ts +2 -2
- package/dist/types/components/HysColorPicker/HysColorPanel.vue.d.ts +58 -0
- package/dist/types/components/HysColorPicker/HysColorPicker.vue.d.ts +63 -10
- package/dist/types/components/HysCommandPalette/HysCommandPalette.vue.d.ts +2 -1
- package/dist/types/components/HysContextMenu/HysContextMenu.vue.d.ts +50 -34
- package/dist/types/components/HysContextMenu/HysMenuPanel.vue.d.ts +79 -0
- package/dist/types/components/HysContextMenu/HysMenuSlot.d.ts +8 -0
- package/dist/types/components/HysDataGrid/HysDataGrid.vue.d.ts +65 -118
- package/dist/types/components/HysDatePicker/HysDatePickerControl.vue.d.ts +1 -1
- package/dist/types/components/HysDrawer/HysDrawer.vue.d.ts +92 -35
- package/dist/types/components/HysEmpty/HysEmpty.vue.d.ts +24 -20
- package/dist/types/components/HysFileManager/HysFileManager.vue.d.ts +2 -2
- package/dist/types/components/HysGantt/HysGantt.vue.d.ts +2 -1
- package/dist/types/components/HysMention/HysMention.vue.d.ts +2 -1
- package/dist/types/components/HysModal/HysModal.vue.d.ts +111 -34
- package/dist/types/components/HysPopover/HysPopover.vue.d.ts +41 -29
- package/dist/types/components/HysProgress/HysProgress.vue.d.ts +18 -24
- package/dist/types/components/HysResizablePanel/HysResizablePanel.vue.d.ts +2 -2
- package/dist/types/components/HysSelect/HysSelect.vue.d.ts +13 -4
- package/dist/types/components/HysSlider/HysSlider.vue.d.ts +5 -4
- package/dist/types/components/HysSlider/SliderTooltip.vue.d.ts +3 -1
- package/dist/types/components/HysSplitPane/HysSplitPane.vue.d.ts +2 -2
- package/dist/types/components/HysTable/HysTable.vue.d.ts +4 -4
- package/dist/types/components/HysTabs/HysTabs.vue.d.ts +2 -2
- package/dist/types/components/HysTagInput/HysTagInput.vue.d.ts +47 -25
- package/dist/types/components/HysTimeline/HysTimeline.vue.d.ts +19 -32
- package/dist/types/components/HysTooltip/HysTooltip.vue.d.ts +39 -19
- package/dist/types/components/HysTour/HysTour.vue.d.ts +2 -1
- package/dist/types/components/HysTransfer/HysTransfer.vue.d.ts +2 -2
- package/dist/types/components/HysTransfer/HysTransferPanel.vue.d.ts +5 -3
- package/dist/types/components/HysTree/HysTree.vue.d.ts +2 -2
- package/dist/types/components/HysUpload/HysUpload.vue.d.ts +55 -67
- package/dist/types/components/HysVirtualTable/HysVirtualTable.vue.d.ts +71 -40
- package/dist/types/composables/autocomplete.d.ts +3 -0
- package/dist/types/composables/avatar.d.ts +3 -0
- package/dist/types/composables/cascader.d.ts +3 -0
- package/dist/types/composables/color.d.ts +97 -0
- package/dist/types/composables/dataGrid.d.ts +100 -0
- package/dist/types/composables/datePicker.d.ts +3 -0
- package/dist/types/composables/drawer.d.ts +102 -0
- package/dist/types/composables/feedback.d.ts +98 -0
- package/dist/types/composables/formContext.d.ts +2 -0
- package/dist/types/composables/menu.d.ts +183 -0
- package/dist/types/composables/modal.d.ts +183 -0
- package/dist/types/composables/overlayManager.d.ts +7 -3
- package/dist/types/composables/popupSurface.d.ts +83 -0
- package/dist/types/composables/progress.d.ts +92 -0
- package/dist/types/composables/selectOptions.d.ts +2 -0
- package/dist/types/composables/table.d.ts +3 -0
- package/dist/types/composables/tagInput.d.ts +96 -0
- package/dist/types/composables/timeline.d.ts +82 -0
- package/dist/types/composables/transfer.d.ts +7 -0
- package/dist/types/composables/tree.d.ts +3 -0
- package/dist/types/composables/treeSelect.d.ts +3 -0
- package/dist/types/composables/upload.d.ts +202 -0
- package/dist/types/composables/uploadRequest.d.ts +3 -0
- package/dist/types/composables/useAlert.d.ts +21 -0
- package/dist/types/composables/useCascader.d.ts +1 -1
- package/dist/types/composables/useColorPicker.d.ts +101 -0
- package/dist/types/composables/useContextMenu.d.ts +81 -0
- package/dist/types/composables/useDataGridRemote.d.ts +15 -0
- package/dist/types/composables/useDialog.d.ts +16 -3
- package/dist/types/composables/useDrawerPush.d.ts +6 -0
- package/dist/types/composables/useDrawerResize.d.ts +27 -0
- package/dist/types/composables/useFloating.d.ts +21 -2
- package/dist/types/composables/useHysModal.d.ts +44 -0
- package/dist/types/composables/useModal.d.ts +62 -0
- package/dist/types/composables/useModalInteraction.d.ts +27 -0
- package/dist/types/composables/usePopupSurface.d.ts +3341 -0
- package/dist/types/composables/useTagInput.d.ts +66 -0
- package/dist/types/composables/useTransferMotion.d.ts +36 -0
- package/dist/types/composables/useUpload.d.ts +94 -0
- package/dist/types/composables/useUploadModel.d.ts +14 -0
- package/dist/types/composables/useUploadRequests.d.ts +38 -0
- package/dist/types/composables/useVirtualTableLayout.d.ts +51 -0
- package/dist/types/composables/virtualTable.d.ts +126 -0
- package/dist/types/index.d.ts +17 -2
- package/dist/types/internal/PopupReference.d.ts +18 -0
- package/dist/types/internal/PopupSurfacePanel.vue.d.ts +37 -0
- package/dist/types/motion/PopupMotion.d.ts +59 -0
- package/dist/types/motion/popup.d.ts +12 -0
- package/package.json +1 -1
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { useHysControlState as
|
|
5
|
-
import { decimalText as
|
|
6
|
-
import { useHysRootAttrs as
|
|
7
|
-
const
|
|
1
|
+
import { defineComponent as fa, inject as Ge, useAttrs as ma, useId as xe, ref as A, shallowRef as Ee, computed as g, watch as Le, onMounted as ha, onActivated as pa, nextTick as Se, onDeactivated as ya, onBeforeUnmount as ba, openBlock as m, createElementBlock as w, mergeProps as ga, unref as h, toDisplayString as ie, createCommentVNode as K, createElementVNode as re, normalizeStyle as ne, normalizeClass as ge, withModifiers as Je, Fragment as oe, renderList as se, renderSlot as Ne, createVNode as wa, withCtx as ka, createTextVNode as Qe, createBlock as Ma } from "vue";
|
|
2
|
+
import Ba from "../HysNumberInput/HysNumberInput.vue.js";
|
|
3
|
+
import xa from "./SliderTooltip.vue.js";
|
|
4
|
+
import { useHysControlState as Ea, fieldKey as La, formKey as Sa } from "../../composables/formContext.js";
|
|
5
|
+
import { decimalText as j, decimalAdd as U, decimal as p, normalizeDecimal as Ze } from "../../composables/numberInput.js";
|
|
6
|
+
import { useHysRootAttrs as Na } from "../../config.js";
|
|
7
|
+
const Ta = ["id"], Va = { class: "hys-ui-slider-layout" }, Ca = ["id", "tabindex", "aria-label", "aria-labelledby", "aria-valuemin", "aria-valuemax", "aria-valuenow", "aria-valuetext", "aria-orientation", "aria-disabled", "aria-readonly", "aria-required", "aria-invalid", "aria-describedby", "onPointerdown", "onKeydown", "onMouseenter", "onFocus"], za = { class: "hys-ui-slider-handle" }, Aa = {
|
|
8
8
|
key: 0,
|
|
9
9
|
class: "hys-ui-slider-marks"
|
|
10
|
-
}, Ra = ["disabled", "onClick"],
|
|
10
|
+
}, Ra = ["disabled", "onClick"], Pa = {
|
|
11
11
|
key: 0,
|
|
12
12
|
class: "hys-ui-slider-inputs"
|
|
13
|
-
},
|
|
13
|
+
}, Ia = ["name", "value", "disabled"], Da = ["id"], Ya = /* @__PURE__ */ fa({
|
|
14
14
|
inheritAttrs: !1,
|
|
15
15
|
__name: "HysSlider",
|
|
16
16
|
props: {
|
|
17
|
+
popupTransition: {},
|
|
18
|
+
popupTransitionDuration: {},
|
|
17
19
|
modelValue: {},
|
|
18
20
|
defaultValue: {},
|
|
19
21
|
range: { type: Boolean, default: void 0 },
|
|
@@ -51,138 +53,138 @@ const Na = ["id"], Ca = { class: "hys-ui-slider-layout" }, Va = ["id", "tabindex
|
|
|
51
53
|
error: {}
|
|
52
54
|
},
|
|
53
55
|
emits: ["update:modelValue", "input", "change", "dragStart", "dragEnd", "focus", "blur"],
|
|
54
|
-
setup(o, { expose:
|
|
55
|
-
const l = o,
|
|
56
|
-
disabled:
|
|
56
|
+
setup(o, { expose: _e, emit: ea }) {
|
|
57
|
+
const l = o, R = ea, {
|
|
58
|
+
disabled: Te,
|
|
57
59
|
size: Ve,
|
|
58
|
-
label:
|
|
59
|
-
} =
|
|
60
|
+
label: Ce
|
|
61
|
+
} = Ea(l), S = Ge(La, void 0), we = Ge(Sa, void 0), q = ma(), aa = Na(), ta = xe(), ze = xe(), ke = xe(), ve = A(), f = A(), W = Ee({ width: 0, height: 0 }), de = A([]), Ae = Ee(
|
|
60
62
|
l.defaultValue ?? (l.range ? [l.min, l.max] : l.min)
|
|
61
|
-
), V = Ee(),
|
|
62
|
-
() => l.modelValue === void 0 ?
|
|
63
|
-
), c = g(() => l.range ?? Array.isArray(
|
|
64
|
-
() => Number.isFinite(l.max) ? Math.max(
|
|
63
|
+
), V = Ee(), Re = g(
|
|
64
|
+
() => l.modelValue === void 0 ? Ae.value : l.modelValue
|
|
65
|
+
), c = g(() => l.range ?? Array.isArray(Re.value)), r = g(() => Number.isFinite(l.min) ? l.min : 0), s = g(
|
|
66
|
+
() => Number.isFinite(l.max) ? Math.max(r.value, l.max) : Math.max(r.value, 100)
|
|
65
67
|
), M = g(
|
|
66
68
|
() => Object.entries(l.marks ?? {}).map(([e, a]) => ({
|
|
67
69
|
value: Number(e),
|
|
68
70
|
label: typeof a == "string" ? a : a.label,
|
|
69
71
|
style: typeof a == "string" ? void 0 : a.style
|
|
70
72
|
})).filter(
|
|
71
|
-
(e) => Number.isFinite(e.value) && e.value >=
|
|
73
|
+
(e) => Number.isFinite(e.value) && e.value >= r.value && e.value <= s.value
|
|
72
74
|
).sort((e, a) => e.value - a.value)
|
|
73
75
|
), x = g(() => l.step === "mark" || l.step === null), G = g(
|
|
74
76
|
() => typeof l.step == "number" && Number.isFinite(l.step) && l.step > 0 ? l.step : 1
|
|
75
|
-
),
|
|
76
|
-
() => l.max <
|
|
77
|
-
),
|
|
77
|
+
), la = g(
|
|
78
|
+
() => l.max < r.value || s.value <= r.value || x.value && !M.value.length
|
|
79
|
+
), C = g(() => Te.value || la.value), P = g(() => !C.value && !l.readonly), ce = g(
|
|
78
80
|
() => {
|
|
79
81
|
var e, a;
|
|
80
82
|
return l.error || l.status === "error" || (e = S == null ? void 0 : S.invalid) != null && e.value ? "error" : l.status ?? ((a = S == null ? void 0 : S.status) == null ? void 0 : a.value);
|
|
81
83
|
}
|
|
82
84
|
);
|
|
83
85
|
function J(e) {
|
|
84
|
-
var
|
|
85
|
-
const a = Number.isFinite(e) ? Math.max(
|
|
86
|
+
var i;
|
|
87
|
+
const a = Number.isFinite(e) ? Math.max(r.value, Math.min(s.value, e)) : r.value;
|
|
86
88
|
if (x.value) {
|
|
87
|
-
let v = ((
|
|
89
|
+
let v = ((i = M.value[0]) == null ? void 0 : i.value) ?? r.value;
|
|
88
90
|
for (const d of M.value)
|
|
89
91
|
Math.abs(d.value - a) < Math.abs(v - a) && (v = d.value);
|
|
90
92
|
return v;
|
|
91
93
|
}
|
|
92
94
|
if (a === s.value) return a;
|
|
93
|
-
const t =
|
|
94
|
-
step:
|
|
95
|
-
base:
|
|
96
|
-
min:
|
|
97
|
-
max:
|
|
95
|
+
const t = Ze(p(a), {
|
|
96
|
+
step: p(G.value),
|
|
97
|
+
base: p(r.value),
|
|
98
|
+
min: p(r.value),
|
|
99
|
+
max: p(s.value),
|
|
98
100
|
strict: !0
|
|
99
|
-
}), u = t ? Number(
|
|
101
|
+
}), u = t ? Number(j(t)) : r.value;
|
|
100
102
|
return Math.abs(s.value - a) < Math.abs(u - a) ? s.value : u;
|
|
101
103
|
}
|
|
102
104
|
function Pe(e) {
|
|
103
105
|
const a = Array.isArray(e) ? e : [e];
|
|
104
106
|
return c.value ? [J(a[0]), J(a[1] ?? s.value)].sort(
|
|
105
|
-
(u,
|
|
107
|
+
(u, i) => u - i
|
|
106
108
|
) : [J(a[0])];
|
|
107
109
|
}
|
|
108
|
-
const Q = g(() => Pe(
|
|
109
|
-
let N = !0,
|
|
110
|
-
const he = (e, a) => e.length === a.length && e.every((t, u) => t === a[u]),
|
|
110
|
+
const Q = g(() => Pe(Re.value)), n = g(() => V.value ?? Q.value), k = A(!1), I = A(), fe = A(), E = A(0), Z = A(!1);
|
|
111
|
+
let N = !0, z = 0, _ = 0, D, H, $, ee, T, ae, te = [], me = 0;
|
|
112
|
+
const he = (e, a) => e.length === a.length && e.every((t, u) => t === a[u]), X = (e) => c.value ? [e[0], e[1]] : e[0], ua = () => Object.fromEntries(
|
|
111
113
|
Object.entries(q).filter(
|
|
112
114
|
([e]) => e !== "id" && !e.startsWith("aria-")
|
|
113
115
|
)
|
|
114
116
|
);
|
|
115
117
|
function Ie(e) {
|
|
116
|
-
const a = l.ariaLabel || q["aria-label"] || l.label ||
|
|
118
|
+
const a = l.ariaLabel || q["aria-label"] || l.label || Ce.value || "数值";
|
|
117
119
|
return c.value ? e === 0 ? l.rangeStartLabel || a + "下限" : l.rangeEndLabel || a + "上限" : a;
|
|
118
120
|
}
|
|
119
|
-
function
|
|
121
|
+
function pe(e) {
|
|
120
122
|
try {
|
|
121
123
|
return l.formatTooltip ? l.formatTooltip(e) : String(e);
|
|
122
124
|
} catch {
|
|
123
125
|
return String(e);
|
|
124
126
|
}
|
|
125
127
|
}
|
|
126
|
-
function
|
|
127
|
-
return l.showTooltip &&
|
|
128
|
+
function De(e, a) {
|
|
129
|
+
return l.showTooltip && pe(a) !== null && (l.tooltipVisible ?? (I.value === e || fe.value === e || k.value && E.value === e));
|
|
128
130
|
}
|
|
129
131
|
function ia(e) {
|
|
130
132
|
var a;
|
|
131
133
|
try {
|
|
132
|
-
return ((a = l.formatValueText) == null ? void 0 : a.call(l, e)) ?? String(
|
|
134
|
+
return ((a = l.formatValueText) == null ? void 0 : a.call(l, e)) ?? String(pe(e) ?? e);
|
|
133
135
|
} catch {
|
|
134
136
|
return String(e);
|
|
135
137
|
}
|
|
136
138
|
}
|
|
137
|
-
const
|
|
139
|
+
const $e = (e) => s.value === r.value ? 0 : Math.max(
|
|
138
140
|
0,
|
|
139
|
-
Math.min(1, (e -
|
|
140
|
-
),
|
|
141
|
-
transform: l.vertical ? `translate3d(-50%, ${W.value.height * (1 -
|
|
142
|
-
}),
|
|
143
|
-
const e =
|
|
141
|
+
Math.min(1, (e - r.value) / (s.value - r.value))
|
|
142
|
+
), F = (e) => 100 * (l.reverse ? 1 - $e(e) : $e(e)), Fe = (e) => l.vertical ? { bottom: F(e) + "%" } : { left: F(e) + "%" }, ra = (e) => ({
|
|
143
|
+
transform: l.vertical ? `translate3d(-50%, ${W.value.height * (1 - F(e) / 100)}px, 0) translateY(-50%)` : `translate3d(${W.value.width * F(e) / 100}px, -50%, 0) translateX(-50%)`
|
|
144
|
+
}), na = g(() => {
|
|
145
|
+
const e = F(c.value ? n.value[0] : r.value), a = F(n.value[c.value ? 1 : 0]);
|
|
144
146
|
return l.vertical ? {
|
|
145
147
|
transform: `translate3d(-50%, ${100 - Math.max(e, a)}%, 0) scaleY(${Math.abs(a - e) / 100})`
|
|
146
148
|
} : {
|
|
147
149
|
transform: `translate3d(${Math.min(e, a)}%, -50%, 0) scaleX(${Math.abs(a - e) / 100})`
|
|
148
150
|
};
|
|
149
|
-
}),
|
|
151
|
+
}), oa = g(() => {
|
|
150
152
|
if (!l.showStops) return [];
|
|
151
|
-
if (x.value) return M.value.map((
|
|
152
|
-
const e = Math.floor((s.value -
|
|
153
|
-
for (let
|
|
153
|
+
if (x.value) return M.value.map((i) => i.value);
|
|
154
|
+
const e = Math.floor((s.value - r.value) / G.value), a = Math.max(2, Math.min(1e3, Math.floor(l.maxStops || 200))), t = Math.max(1, Math.ceil(e / a)), u = [];
|
|
155
|
+
for (let i = 1; i < e && u.length < a; i += t)
|
|
154
156
|
u.push(
|
|
155
157
|
Number(
|
|
156
|
-
|
|
157
|
-
U(
|
|
158
|
+
j(
|
|
159
|
+
U(p(r.value), p(G.value), i)
|
|
158
160
|
)
|
|
159
161
|
)
|
|
160
162
|
);
|
|
161
163
|
return u;
|
|
162
164
|
});
|
|
163
|
-
function
|
|
165
|
+
function ye(e) {
|
|
164
166
|
if (!N || !P.value || he(e, n.value)) return !1;
|
|
165
|
-
V.value = e,
|
|
167
|
+
V.value = e, D = e;
|
|
166
168
|
const a = ++_;
|
|
167
|
-
return l.modelValue === void 0 && (
|
|
168
|
-
!N || a !== _ || ((!he(Q.value, e) || !k.value) && (V.value = void 0),
|
|
169
|
+
return l.modelValue === void 0 && (Ae.value = X(e)), R("update:modelValue", X(e)), R("input", X(e)), Se(() => {
|
|
170
|
+
!N || a !== _ || ((!he(Q.value, e) || !k.value) && (V.value = void 0), D = void 0);
|
|
169
171
|
}), !0;
|
|
170
172
|
}
|
|
171
173
|
function le(e) {
|
|
172
|
-
const a =
|
|
174
|
+
const a = z;
|
|
173
175
|
Se(() => {
|
|
174
|
-
N && a ===
|
|
176
|
+
N && a === z && P.value && !he(Q.value, e) && R("change", X(Q.value));
|
|
175
177
|
});
|
|
176
178
|
}
|
|
177
179
|
function ue(e, a) {
|
|
178
180
|
const t = [...n.value];
|
|
179
181
|
return t[e] = Math.max(
|
|
180
|
-
e === 1 ? t[0] :
|
|
182
|
+
e === 1 ? t[0] : r.value,
|
|
181
183
|
Math.min(
|
|
182
184
|
c.value && e === 0 ? t[1] : s.value,
|
|
183
185
|
J(a)
|
|
184
186
|
)
|
|
185
|
-
),
|
|
187
|
+
), ye(t);
|
|
186
188
|
}
|
|
187
189
|
function Oe(e) {
|
|
188
190
|
if (!c.value) return 0;
|
|
@@ -190,91 +192,91 @@ const Na = ["id"], Ca = { class: "hys-ui-slider-layout" }, Va = ["id", "tabindex
|
|
|
190
192
|
return a === t ? I.value ?? (e < n.value[0] ? 0 : 1) : a < t ? 0 : 1;
|
|
191
193
|
}
|
|
192
194
|
function je(e, a) {
|
|
193
|
-
var
|
|
194
|
-
const t = ee ?? ((
|
|
195
|
-
if (!t) return
|
|
195
|
+
var i;
|
|
196
|
+
const t = ee ?? ((i = f.value) == null ? void 0 : i.getBoundingClientRect());
|
|
197
|
+
if (!t) return r.value;
|
|
196
198
|
let u = l.vertical ? (t.bottom - a) / (t.height || 1) : (e - t.left) / (t.width || 1);
|
|
197
|
-
return l.reverse && (u = 1 - u),
|
|
199
|
+
return l.reverse && (u = 1 - u), r.value + Math.max(0, Math.min(1, u)) * (s.value - r.value);
|
|
198
200
|
}
|
|
199
201
|
function He() {
|
|
200
|
-
if (
|
|
201
|
-
const e = je(
|
|
202
|
+
if (H = void 0, !k.value || !$ || !N) return;
|
|
203
|
+
const e = je($.x, $.y);
|
|
202
204
|
if (Z.value) {
|
|
203
|
-
const a = e - me, t = U(
|
|
204
|
-
|
|
205
|
+
const a = e - me, t = U(p(te[1]), p(te[0]), -1), u = Number(
|
|
206
|
+
j(U(p(s.value), t, -1))
|
|
205
207
|
);
|
|
206
|
-
let
|
|
207
|
-
|
|
208
|
+
let i = J(te[0] + a);
|
|
209
|
+
i = Math.max(r.value, Math.min(u, i)), ye([i, Number(j(U(p(i), t)))]);
|
|
208
210
|
} else ue(E.value, e);
|
|
209
211
|
}
|
|
210
212
|
function Me(e) {
|
|
211
|
-
return e.pointerId === void 0 ||
|
|
213
|
+
return e.pointerId === void 0 || T === void 0 || e.pointerId === T;
|
|
212
214
|
}
|
|
213
215
|
function Xe(e) {
|
|
214
|
-
!k.value || !Me(e) || (
|
|
216
|
+
!k.value || !Me(e) || ($ = { x: e.clientX, y: e.clientY }, e.cancelable && e.preventDefault(), H === void 0 && (H = requestAnimationFrame(He)));
|
|
215
217
|
}
|
|
216
218
|
function B(e = !1, a = !1) {
|
|
217
|
-
var
|
|
219
|
+
var i, v;
|
|
218
220
|
if (!k.value) return;
|
|
219
|
-
|
|
221
|
+
H !== void 0 && cancelAnimationFrame(H), H = void 0, !e && $ && He();
|
|
220
222
|
const t = te.slice(), u = { index: E.value, track: Z.value, cancelled: e };
|
|
221
|
-
k.value = !1,
|
|
223
|
+
k.value = !1, $ = void 0, ae == null || ae(), ae = void 0;
|
|
222
224
|
try {
|
|
223
|
-
|
|
225
|
+
T !== void 0 && ((v = (i = f.value) == null ? void 0 : i.hasPointerCapture) != null && v.call(i, T)) && f.value.releasePointerCapture(T);
|
|
224
226
|
} catch {
|
|
225
227
|
}
|
|
226
|
-
|
|
228
|
+
T = void 0, e ? (z++, a && P.value ? ye(t) : V.value = void 0) : le(t), N && R("dragEnd", X(n.value), u);
|
|
227
229
|
}
|
|
228
230
|
function Be(e, a, t = !1) {
|
|
229
|
-
var O,
|
|
230
|
-
if (!N || !P.value || e.button !== 0 && e.pointerType !== "touch" || !
|
|
231
|
-
e.preventDefault(),
|
|
231
|
+
var O, b, We;
|
|
232
|
+
if (!N || !P.value || e.button !== 0 && e.pointerType !== "touch" || !f.value || (B(!0), z++, ee = f.value.getBoundingClientRect(), l.vertical ? !ee.height : !ee.width)) return;
|
|
233
|
+
e.preventDefault(), T = e.pointerId, te = [...n.value], me = je(e.clientX, e.clientY), Z.value = t && c.value && !!l.draggableTrack && !x.value, E.value = a ?? Oe(me), k.value = !0, I.value = E.value, (O = de.value[E.value]) == null || O.focus({ preventScroll: !0 }), R("dragStart", X(n.value), {
|
|
232
234
|
index: E.value,
|
|
233
235
|
track: Z.value,
|
|
234
236
|
cancelled: !1
|
|
235
237
|
}), a === void 0 && !Z.value && ue(E.value, me);
|
|
236
238
|
const u = (L) => {
|
|
237
|
-
Me(L) && (Number.isFinite(L.clientX) && Number.isFinite(L.clientY) && (
|
|
238
|
-
},
|
|
239
|
+
Me(L) && (Number.isFinite(L.clientX) && Number.isFinite(L.clientY) && ($ = { x: L.clientX, y: L.clientY }), B());
|
|
240
|
+
}, i = (L) => {
|
|
239
241
|
Me(L) && B(!0);
|
|
240
242
|
}, v = () => B(!0), d = () => {
|
|
241
243
|
var L;
|
|
242
|
-
ee = (L =
|
|
244
|
+
ee = (L = f.value) == null ? void 0 : L.getBoundingClientRect();
|
|
243
245
|
};
|
|
244
|
-
document.addEventListener("pointermove", Xe, { passive: !1 }), document.addEventListener("pointerup", u), document.addEventListener("pointercancel",
|
|
245
|
-
const
|
|
246
|
-
|
|
247
|
-
document.removeEventListener("pointermove", Xe), document.removeEventListener("pointerup", u), document.removeEventListener("pointercancel",
|
|
246
|
+
document.addEventListener("pointermove", Xe, { passive: !1 }), document.addEventListener("pointerup", u), document.addEventListener("pointercancel", i), document.addEventListener("scroll", d, !0), window.addEventListener("resize", d), window.addEventListener("blur", v);
|
|
247
|
+
const y = typeof ResizeObserver < "u" ? new ResizeObserver(d) : void 0;
|
|
248
|
+
y == null || y.observe(f.value), ae = () => {
|
|
249
|
+
document.removeEventListener("pointermove", Xe), document.removeEventListener("pointerup", u), document.removeEventListener("pointercancel", i), document.removeEventListener("scroll", d, !0), window.removeEventListener("resize", d), window.removeEventListener("blur", v), y == null || y.disconnect();
|
|
248
250
|
};
|
|
249
251
|
try {
|
|
250
|
-
|
|
252
|
+
T !== void 0 && ((We = (b = f.value).setPointerCapture) == null || We.call(b, T));
|
|
251
253
|
} catch {
|
|
252
254
|
}
|
|
253
255
|
}
|
|
254
|
-
function
|
|
256
|
+
function sa(e, a, t) {
|
|
255
257
|
if (x.value) {
|
|
256
|
-
const d = M.value.map((O) => O.value),
|
|
258
|
+
const d = M.value.map((O) => O.value), y = d.indexOf(e);
|
|
257
259
|
return d[Math.max(
|
|
258
260
|
0,
|
|
259
261
|
Math.min(
|
|
260
262
|
d.length - 1,
|
|
261
|
-
(
|
|
263
|
+
(y < 0 ? 0 : y) + a * t
|
|
262
264
|
)
|
|
263
265
|
)] ?? e;
|
|
264
266
|
}
|
|
265
|
-
const u =
|
|
267
|
+
const u = p(G.value), i = p(r.value), v = Ze(p(s.value), {
|
|
266
268
|
step: u,
|
|
267
|
-
base:
|
|
268
|
-
min:
|
|
269
|
-
max:
|
|
269
|
+
base: i,
|
|
270
|
+
min: i,
|
|
271
|
+
max: p(s.value),
|
|
270
272
|
strict: !0
|
|
271
273
|
});
|
|
272
|
-
return a < 0 && e === s.value && Number(
|
|
273
|
-
|
|
274
|
+
return a < 0 && e === s.value && Number(j(v)) !== e ? Number(j(U(v, u, -(t - 1)))) : Number(
|
|
275
|
+
j(U(p(e), u, a * t))
|
|
274
276
|
);
|
|
275
277
|
}
|
|
276
|
-
function
|
|
277
|
-
var d,
|
|
278
|
+
function va(e, a) {
|
|
279
|
+
var d, y;
|
|
278
280
|
if (e.isComposing || e.keyCode === 229) return;
|
|
279
281
|
if (e.key === "Escape" && k.value) {
|
|
280
282
|
e.preventDefault(), B(!0, !0);
|
|
@@ -283,34 +285,34 @@ const Na = ["id"], Ca = { class: "hys-ui-slider-layout" }, Va = ["id", "tabindex
|
|
|
283
285
|
const t = ["ArrowRight", "ArrowUp", "PageUp"], u = ["ArrowLeft", "ArrowDown", "PageDown"];
|
|
284
286
|
if (![...t, ...u, "Home", "End"].includes(e.key) || !P.value || !l.keyboard) return;
|
|
285
287
|
e.preventDefault(), k.value && B(!0);
|
|
286
|
-
const
|
|
288
|
+
const i = [...n.value];
|
|
287
289
|
let v;
|
|
288
|
-
e.key === "Home" ? v = x.value ? ((d = M.value[0]) == null ? void 0 : d.value) ??
|
|
290
|
+
e.key === "Home" ? v = x.value ? ((d = M.value[0]) == null ? void 0 : d.value) ?? r.value : r.value : e.key === "End" ? v = x.value ? ((y = M.value.at(-1)) == null ? void 0 : y.value) ?? s.value : s.value : v = sa(
|
|
289
291
|
n.value[a],
|
|
290
292
|
(t.includes(e.key) ? 1 : -1) * (l.reverse ? -1 : 1),
|
|
291
293
|
e.key.startsWith("Page") || e.shiftKey ? 10 : 1
|
|
292
|
-
), ue(a, v) && le(
|
|
294
|
+
), ue(a, v) && le(i);
|
|
293
295
|
}
|
|
294
|
-
function
|
|
296
|
+
function da(e) {
|
|
295
297
|
const a = [...n.value];
|
|
296
|
-
|
|
298
|
+
ye(Pe(e)) && le(a);
|
|
297
299
|
}
|
|
298
|
-
function
|
|
300
|
+
function ca(e) {
|
|
299
301
|
if (!P.value) return;
|
|
300
302
|
const a = [...n.value];
|
|
301
303
|
ue(Oe(e), e) && le(a);
|
|
302
304
|
}
|
|
303
305
|
function Ye(e = 0) {
|
|
304
306
|
var a;
|
|
305
|
-
|
|
307
|
+
C.value || (a = de.value[Math.max(0, Math.min(n.value.length - 1, e))]) == null || a.focus();
|
|
306
308
|
}
|
|
307
309
|
function Ke() {
|
|
308
|
-
Ue(), B(!0), N = !1,
|
|
310
|
+
Ue(), B(!0), N = !1, z++, _++, D = void 0, V.value = void 0, I.value = void 0, fe.value = void 0;
|
|
309
311
|
}
|
|
310
312
|
Le(
|
|
311
313
|
() => l.modelValue,
|
|
312
314
|
() => {
|
|
313
|
-
|
|
315
|
+
D && he(Q.value, D) || (B(!0), z++, _++, V.value = void 0, D = void 0);
|
|
314
316
|
},
|
|
315
317
|
{ deep: !0, flush: "sync" }
|
|
316
318
|
), Le(
|
|
@@ -321,39 +323,39 @@ const Na = ["id"], Ca = { class: "hys-ui-slider-layout" }, Va = ["id", "tabindex
|
|
|
321
323
|
() => l.range,
|
|
322
324
|
() => l.vertical,
|
|
323
325
|
() => l.reverse,
|
|
324
|
-
() =>
|
|
326
|
+
() => Te.value,
|
|
325
327
|
() => l.readonly,
|
|
326
328
|
// Inline marks objects may be recreated by every model update. Only a
|
|
327
329
|
// changed set of available stops affects an active mark-only interaction.
|
|
328
330
|
() => x.value ? M.value.map((e) => e.value).join(",") : ""
|
|
329
331
|
],
|
|
330
332
|
() => {
|
|
331
|
-
B(!0),
|
|
333
|
+
B(!0), z++, V.value = void 0;
|
|
332
334
|
}
|
|
333
335
|
), Le(
|
|
334
336
|
() => we == null ? void 0 : we.resetting.value,
|
|
335
337
|
(e) => {
|
|
336
|
-
e && (B(!0),
|
|
338
|
+
e && (B(!0), z++, _++, D = void 0, V.value = void 0);
|
|
337
339
|
},
|
|
338
340
|
{ flush: "sync" }
|
|
339
341
|
);
|
|
340
|
-
let
|
|
341
|
-
function
|
|
342
|
-
if (!N || !
|
|
343
|
-
const e =
|
|
342
|
+
let Y;
|
|
343
|
+
function be() {
|
|
344
|
+
if (!N || !f.value) return;
|
|
345
|
+
const e = f.value.clientWidth || f.value.getBoundingClientRect().width, a = f.value.clientHeight || f.value.getBoundingClientRect().height;
|
|
344
346
|
(e !== W.value.width || a !== W.value.height) && (W.value = { width: e, height: a });
|
|
345
347
|
}
|
|
346
348
|
function Ue() {
|
|
347
|
-
|
|
349
|
+
Y == null || Y.disconnect(), Y = void 0, window.removeEventListener("resize", be);
|
|
348
350
|
}
|
|
349
351
|
function qe() {
|
|
350
|
-
Ue(),
|
|
352
|
+
Ue(), be(), typeof ResizeObserver < "u" && f.value && (Y = new ResizeObserver(be), Y.observe(f.value)), window.addEventListener("resize", be);
|
|
351
353
|
}
|
|
352
|
-
return
|
|
354
|
+
return ha(() => {
|
|
353
355
|
qe(), l.autofocus && Ye();
|
|
354
|
-
}),
|
|
356
|
+
}), pa(() => {
|
|
355
357
|
N = !0, Se(qe);
|
|
356
|
-
}),
|
|
358
|
+
}), ya(Ke), ba(Ke), _e({
|
|
357
359
|
element: ve,
|
|
358
360
|
dragging: k,
|
|
359
361
|
values: n,
|
|
@@ -363,16 +365,16 @@ const Na = ["id"], Ca = { class: "hys-ui-slider-layout" }, Va = ["id", "tabindex
|
|
|
363
365
|
const e = document.activeElement;
|
|
364
366
|
e && ((a = ve.value) != null && a.contains(e)) && e.blur();
|
|
365
367
|
},
|
|
366
|
-
setValue:
|
|
368
|
+
setValue: da,
|
|
367
369
|
cancel: () => B(!0, !0)
|
|
368
|
-
}), (e, a) => (
|
|
370
|
+
}), (e, a) => (m(), w("div", ga({ ...h(aa), ...ua() }, {
|
|
369
371
|
ref_key: "root",
|
|
370
372
|
ref: ve,
|
|
371
373
|
class: ["hys-ui-slider-wrap hys-ui-ex-field", [
|
|
372
374
|
"hys-ui-slider-" + h(Ve),
|
|
373
375
|
{
|
|
374
376
|
"hys-ui-slider-vertical": o.vertical,
|
|
375
|
-
"hys-ui-slider-disabled":
|
|
377
|
+
"hys-ui-slider-disabled": C.value,
|
|
376
378
|
"hys-ui-slider-readonly": o.readonly,
|
|
377
379
|
"hys-ui-slider-dragging": k.value,
|
|
378
380
|
"hys-ui-slider-error": ce.value === "error",
|
|
@@ -381,170 +383,172 @@ const Na = ["id"], Ca = { class: "hys-ui-slider-layout" }, Va = ["id", "tabindex
|
|
|
381
383
|
}
|
|
382
384
|
]]
|
|
383
385
|
}), [
|
|
384
|
-
o.showValue ? (
|
|
386
|
+
o.showValue ? (m(), w("span", {
|
|
385
387
|
key: 0,
|
|
386
|
-
id: h(
|
|
388
|
+
id: h(ta),
|
|
387
389
|
class: "hys-ui-slider-value"
|
|
388
|
-
},
|
|
389
|
-
|
|
390
|
-
|
|
390
|
+
}, ie(o.label || h(Ce) || "数值") + ":" + ie(n.value.map((t) => pe(t) ?? t).join(" ~ ")), 9, Ta)) : K("", !0),
|
|
391
|
+
re("div", Va, [
|
|
392
|
+
re("div", {
|
|
391
393
|
class: "hys-ui-slider-axis",
|
|
392
394
|
style: ne(
|
|
393
395
|
o.vertical ? { height: typeof o.height == "number" ? o.height + "px" : o.height } : void 0
|
|
394
396
|
)
|
|
395
397
|
}, [
|
|
396
|
-
|
|
398
|
+
re("div", {
|
|
397
399
|
ref_key: "rail",
|
|
398
|
-
ref:
|
|
400
|
+
ref: f,
|
|
399
401
|
class: ge(["hys-ui-slider-rail", { "hys-ui-slider-range": c.value }]),
|
|
400
402
|
onPointerdown: a[3] || (a[3] = (t) => Be(t)),
|
|
401
403
|
onLostpointercapture: a[4] || (a[4] = (t) => k.value && B(!0))
|
|
402
404
|
}, [
|
|
403
|
-
a[5] || (a[5] =
|
|
404
|
-
o.included ? (
|
|
405
|
+
a[5] || (a[5] = re("div", { class: "hys-ui-slider-background" }, null, -1)),
|
|
406
|
+
o.included ? (m(), w("div", {
|
|
405
407
|
key: 0,
|
|
406
408
|
class: ge(["hys-ui-slider-selection", {
|
|
407
409
|
"hys-ui-slider-selection-draggable": c.value && o.draggableTrack && !x.value && P.value
|
|
408
410
|
}]),
|
|
409
|
-
style: ne(
|
|
411
|
+
style: ne(na.value),
|
|
410
412
|
onPointerdown: a[0] || (a[0] = Je((t) => Be(t, void 0, !0), ["stop"]))
|
|
411
|
-
}, null, 38)) :
|
|
412
|
-
(
|
|
413
|
+
}, null, 38)) : K("", !0),
|
|
414
|
+
(m(!0), w(oe, null, se(oa.value, (t) => (m(), w("span", {
|
|
413
415
|
key: t,
|
|
414
416
|
class: ge(["hys-ui-slider-stop", {
|
|
415
|
-
"hys-ui-slider-stop-active": t >= (c.value ? n.value[0] :
|
|
417
|
+
"hys-ui-slider-stop-active": t >= (c.value ? n.value[0] : r.value) && t <= n.value[c.value ? 1 : 0]
|
|
416
418
|
}]),
|
|
417
|
-
style: ne(
|
|
419
|
+
style: ne(Fe(t))
|
|
418
420
|
}, null, 6))), 128)),
|
|
419
|
-
(
|
|
420
|
-
var
|
|
421
|
-
return
|
|
421
|
+
(m(!0), w(oe, null, se(n.value, (t, u) => {
|
|
422
|
+
var i, v, d, y, O;
|
|
423
|
+
return m(), w("div", {
|
|
422
424
|
key: u,
|
|
423
|
-
style: ne(
|
|
425
|
+
style: ne(ra(t)),
|
|
424
426
|
ref_for: !0,
|
|
425
|
-
ref: (
|
|
426
|
-
|
|
427
|
+
ref: (b) => {
|
|
428
|
+
b && (de.value[u] = b);
|
|
427
429
|
},
|
|
428
430
|
role: "slider",
|
|
429
431
|
"data-hys-ui-field-managed": "",
|
|
430
432
|
class: ge(["hys-ui-slider-thumb", {
|
|
431
433
|
"hys-ui-slider-thumb-active": I.value === u || k.value && E.value === u
|
|
432
434
|
}]),
|
|
433
|
-
id: u === 0 ? h(q).id || (c.value || (
|
|
434
|
-
tabindex:
|
|
435
|
+
id: u === 0 ? h(q).id || (c.value || (i = h(S)) == null ? void 0 : i.id.value) : void 0,
|
|
436
|
+
tabindex: C.value ? -1 : o.tabindex ?? 0,
|
|
435
437
|
"aria-label": Ie(u),
|
|
436
438
|
"aria-labelledby": h(q)["aria-labelledby"],
|
|
437
|
-
"aria-valuemin": u === 1 ? n.value[0] : x.value ? ((v = M.value[0]) == null ? void 0 : v.value) ??
|
|
439
|
+
"aria-valuemin": u === 1 ? n.value[0] : x.value ? ((v = M.value[0]) == null ? void 0 : v.value) ?? r.value : r.value,
|
|
438
440
|
"aria-valuemax": c.value && u === 0 ? n.value[1] : x.value ? ((d = M.value.at(-1)) == null ? void 0 : d.value) ?? s.value : s.value,
|
|
439
441
|
"aria-valuenow": t,
|
|
440
442
|
"aria-valuetext": ia(t),
|
|
441
443
|
"aria-orientation": o.vertical ? "vertical" : "horizontal",
|
|
442
|
-
"aria-disabled":
|
|
444
|
+
"aria-disabled": C.value || void 0,
|
|
443
445
|
"aria-readonly": o.readonly || void 0,
|
|
444
|
-
"aria-required": ((
|
|
446
|
+
"aria-required": ((y = h(S)) == null ? void 0 : y.required.value) || void 0,
|
|
445
447
|
"aria-invalid": ce.value === "error" || void 0,
|
|
446
448
|
"aria-describedby": [
|
|
447
|
-
o.error ? h(
|
|
449
|
+
o.error ? h(ze) : (O = h(S)) == null ? void 0 : O.describedBy.value,
|
|
448
450
|
h(q)["aria-describedby"],
|
|
449
|
-
|
|
451
|
+
De(u, t) ? h(ke) + "-tooltip-" + u : void 0
|
|
450
452
|
].filter(Boolean).join(" ") || void 0,
|
|
451
|
-
onPointerdown: Je((
|
|
452
|
-
onKeydown: (
|
|
453
|
-
onMouseenter: (
|
|
454
|
-
onMouseleave: a[1] || (a[1] = (
|
|
455
|
-
onFocus: (
|
|
456
|
-
I.value = u,
|
|
453
|
+
onPointerdown: Je((b) => Be(b, u), ["stop"]),
|
|
454
|
+
onKeydown: (b) => va(b, u),
|
|
455
|
+
onMouseenter: (b) => fe.value = u,
|
|
456
|
+
onMouseleave: a[1] || (a[1] = (b) => fe.value = void 0),
|
|
457
|
+
onFocus: (b) => {
|
|
458
|
+
I.value = u, R("focus", b);
|
|
457
459
|
},
|
|
458
|
-
onBlur: a[2] || (a[2] = (
|
|
459
|
-
I.value = void 0,
|
|
460
|
+
onBlur: a[2] || (a[2] = (b) => {
|
|
461
|
+
I.value = void 0, R("blur", b);
|
|
460
462
|
})
|
|
461
463
|
}, [
|
|
462
|
-
|
|
464
|
+
re("span", za, [
|
|
463
465
|
Ne(e.$slots, "thumb", {
|
|
464
466
|
value: t,
|
|
465
467
|
index: u,
|
|
466
468
|
dragging: k.value && E.value === u
|
|
467
469
|
}, void 0, !0)
|
|
468
470
|
]),
|
|
469
|
-
|
|
470
|
-
|
|
471
|
+
wa(xa, {
|
|
472
|
+
"popup-transition": l.popupTransition,
|
|
473
|
+
"popup-transition-duration": l.popupTransitionDuration,
|
|
474
|
+
visible: De(u, t),
|
|
471
475
|
id: h(ke) + "-tooltip-" + u,
|
|
472
476
|
anchor: de.value[u],
|
|
473
477
|
container: ve.value,
|
|
474
478
|
placement: o.tooltipPlacement,
|
|
475
|
-
position:
|
|
479
|
+
position: F(t)
|
|
476
480
|
}, {
|
|
477
481
|
default: ka(() => [
|
|
478
482
|
Ne(e.$slots, "tooltip", {
|
|
479
483
|
value: t,
|
|
480
484
|
index: u
|
|
481
485
|
}, () => [
|
|
482
|
-
|
|
486
|
+
Qe(ie(pe(t)), 1)
|
|
483
487
|
], !0)
|
|
484
488
|
]),
|
|
485
489
|
_: 2
|
|
486
|
-
}, 1032, ["id", "anchor", "container", "placement", "position"])
|
|
487
|
-
], 46,
|
|
490
|
+
}, 1032, ["popup-transition", "popup-transition-duration", "visible", "id", "anchor", "container", "placement", "position"])
|
|
491
|
+
], 46, Ca);
|
|
488
492
|
}), 128))
|
|
489
493
|
], 34),
|
|
490
|
-
M.value.length ? (
|
|
491
|
-
(
|
|
494
|
+
M.value.length ? (m(), w("div", Aa, [
|
|
495
|
+
(m(!0), w(oe, null, se(M.value, (t) => (m(), w("button", {
|
|
492
496
|
key: t.value,
|
|
493
497
|
type: "button",
|
|
494
498
|
tabindex: "-1",
|
|
495
499
|
class: "hys-ui-slider-mark",
|
|
496
|
-
disabled:
|
|
497
|
-
style: ne({ ...
|
|
498
|
-
onClick: (u) =>
|
|
500
|
+
disabled: C.value || o.readonly,
|
|
501
|
+
style: ne({ ...Fe(t.value), ...t.style }),
|
|
502
|
+
onClick: (u) => ca(t.value)
|
|
499
503
|
}, [
|
|
500
504
|
Ne(e.$slots, "mark", {
|
|
501
505
|
value: t.value,
|
|
502
506
|
label: t.label,
|
|
503
|
-
active: t.value >= (c.value ? n.value[0] :
|
|
507
|
+
active: t.value >= (c.value ? n.value[0] : r.value) && t.value <= n.value[c.value ? 1 : 0]
|
|
504
508
|
}, () => [
|
|
505
|
-
|
|
509
|
+
Qe(ie(t.label), 1)
|
|
506
510
|
], !0)
|
|
507
511
|
], 12, Ra))), 128))
|
|
508
|
-
])) :
|
|
512
|
+
])) : K("", !0)
|
|
509
513
|
], 4),
|
|
510
|
-
o.showInput ? (
|
|
511
|
-
(
|
|
514
|
+
o.showInput ? (m(), w("div", Pa, [
|
|
515
|
+
(m(!0), w(oe, null, se(n.value, (t, u) => (m(), Ma(Ba, {
|
|
512
516
|
key: u,
|
|
513
517
|
id: h(ke) + "-number-" + u,
|
|
514
518
|
"model-value": t,
|
|
515
|
-
min: u === 1 ? n.value[0] :
|
|
519
|
+
min: u === 1 ? n.value[0] : r.value,
|
|
516
520
|
max: c.value && u === 0 ? n.value[1] : s.value,
|
|
517
521
|
step: G.value,
|
|
518
522
|
"show-controls": o.showInputControls,
|
|
519
523
|
size: h(Ve),
|
|
520
|
-
disabled:
|
|
524
|
+
disabled: C.value,
|
|
521
525
|
readonly: o.readonly,
|
|
522
526
|
"aria-label": Ie(u) + "输入",
|
|
523
|
-
"onUpdate:modelValue": (
|
|
524
|
-
if (
|
|
527
|
+
"onUpdate:modelValue": (i) => {
|
|
528
|
+
if (i !== null) {
|
|
525
529
|
const v = [...n.value];
|
|
526
|
-
ue(u, Number(
|
|
530
|
+
ue(u, Number(i)) && le(v);
|
|
527
531
|
}
|
|
528
532
|
}
|
|
529
533
|
}, null, 8, ["id", "model-value", "min", "max", "step", "show-controls", "size", "disabled", "readonly", "aria-label", "onUpdate:modelValue"]))), 128))
|
|
530
|
-
])) :
|
|
534
|
+
])) : K("", !0)
|
|
531
535
|
]),
|
|
532
|
-
o.name ? (
|
|
536
|
+
o.name ? (m(!0), w(oe, { key: 1 }, se(n.value, (t, u) => (m(), w("input", {
|
|
533
537
|
key: u,
|
|
534
538
|
type: "hidden",
|
|
535
539
|
name: o.name,
|
|
536
540
|
value: t,
|
|
537
|
-
disabled:
|
|
538
|
-
}, null, 8,
|
|
539
|
-
o.error ? (
|
|
541
|
+
disabled: C.value
|
|
542
|
+
}, null, 8, Ia))), 128)) : K("", !0),
|
|
543
|
+
o.error ? (m(), w("small", {
|
|
540
544
|
key: 2,
|
|
541
|
-
id: h(
|
|
545
|
+
id: h(ze),
|
|
542
546
|
class: "hys-ui-slider-error-text",
|
|
543
547
|
role: "alert"
|
|
544
|
-
},
|
|
548
|
+
}, ie(o.error), 9, Da)) : K("", !0)
|
|
545
549
|
], 16));
|
|
546
550
|
}
|
|
547
551
|
});
|
|
548
552
|
export {
|
|
549
|
-
|
|
553
|
+
Ya as default
|
|
550
554
|
};
|