x-next 1.1.0 → 1.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/dist/_hooks/use-form-item.d.ts +5 -0
- package/dist/_hooks/use-picker-focus.d.ts +17 -0
- package/dist/components/_components/feedback-icon/index.vue.d.ts +4 -4
- package/dist/components/_components/picker/input-range.vue.d.ts +10 -6
- package/dist/components/_components/picker/input.vue.d.ts +9 -5
- package/dist/components/alert/Alert.vue.d.ts +5 -5
- package/dist/components/alert/index.d.ts +10 -10
- package/dist/components/date-picker/DatePanel.vue.d.ts +5 -0
- package/dist/components/date-picker/DatePicker.vue.d.ts +36 -16
- package/dist/components/date-picker/index.d.ts +77 -33
- package/dist/components/dialog/Dialog.d.ts +1 -1
- package/dist/components/dialog/index.d.ts +3 -3
- package/dist/components/drawer/index.d.ts +3 -3
- package/dist/components/drawer/src/Drawer.vue.d.ts +1 -1
- package/dist/components/dropdown/Dropdown.vue.d.ts +30 -4
- package/dist/components/dropdown/DropdownButton.vue.d.ts +31 -5
- package/dist/components/dropdown/DropdownOption.vue.d.ts +2 -0
- package/dist/components/dropdown/DropdownSubmenu.vue.d.ts +162 -5
- package/dist/components/dropdown/context.d.ts +14 -1
- package/dist/components/dropdown/dropdown-panel.vue.d.ts +7 -1
- package/dist/components/dropdown/index.d.ts +610 -28
- package/dist/components/dropdown/use-keyboard.d.ts +10 -0
- package/dist/components/form/FormItem.vue.d.ts +12 -4
- package/dist/components/form/context.d.ts +6 -0
- package/dist/components/form/form-item-label.vue.d.ts +4 -4
- package/dist/components/form/form-item-message.vue.d.ts +2 -0
- package/dist/components/form/index.d.ts +30 -8
- package/dist/components/form/interface.d.ts +2 -2
- package/dist/components/form-input/InputPassword.vue.d.ts +20 -2
- package/dist/components/form-input/index.d.ts +22 -4
- package/dist/components/form-select/Select.d.ts +3 -3
- package/dist/components/form-select/hooks/use-select.d.ts +2 -1
- package/dist/components/form-select/index.d.ts +6 -6
- package/dist/components/form-slider/Slider.vue.d.ts +10 -3
- package/dist/components/form-slider/index.d.ts +26 -6
- package/dist/components/form-slider/slider-button.vue.d.ts +4 -3
- package/dist/components/form-switch/Switch.vue.d.ts +2 -1
- package/dist/components/form-switch/index.d.ts +5 -2
- package/dist/components/form-textarea/Textarea.vue.d.ts +2 -2
- package/dist/components/form-textarea/index.d.ts +5 -5
- package/dist/components/image/Image.vue.d.ts +10 -9
- package/dist/components/image/ImagePreview.vue.d.ts +8 -7
- package/dist/components/image/ImagePreviewAction.d.ts +3 -3
- package/dist/components/image/ImagePreviewGroup.vue.d.ts +8 -7
- package/dist/components/image/index.d.ts +59 -52
- package/dist/components/image/preview-arrow.vue.d.ts +2 -2
- package/dist/components/image/preview-toolbar.vue.d.ts +3 -3
- package/dist/components/layout/LayoutSidebar.vue.d.ts +2 -2
- package/dist/components/layout/index.d.ts +4 -4
- package/dist/components/link/Link.vue.d.ts +2 -2
- package/dist/components/link/index.d.ts +4 -4
- package/dist/components/menu/Menu.d.ts +2 -2
- package/dist/components/menu/base-menu.vue.d.ts +2 -2
- package/dist/components/menu/index.d.ts +4 -4
- package/dist/components/menu/sub-menu-pop.vue.d.ts +5 -5
- package/dist/components/message/index.d.ts +17 -17
- package/dist/components/message/message.vue.d.ts +8 -8
- package/dist/components/notification/Notification.d.ts +1 -1
- package/dist/components/notification/index.d.ts +3 -3
- package/dist/components/pagination/page-item-ellipsis.vue.d.ts +1 -1
- package/dist/components/pagination/page-item-step.vue.d.ts +2 -2
- package/dist/components/pagination/page-options.vue.d.ts +6 -6
- package/dist/components/popconfirm/src/popup.vue.d.ts +1 -1
- package/dist/components/popover/Popover.d.ts +1 -1
- package/dist/components/popover/index.d.ts +3 -3
- package/dist/components/popup/Popup.d.ts +1 -1
- package/dist/components/popup/index.d.ts +3 -3
- package/dist/components/progress/Progress.vue.d.ts +4 -4
- package/dist/components/progress/circle.vue.d.ts +2 -2
- package/dist/components/progress/index.d.ts +8 -8
- package/dist/components/progress/line.vue.d.ts +1 -1
- package/dist/components/progress/steps.vue.d.ts +1 -1
- package/dist/components/steps/Step.vue.d.ts +2 -2
- package/dist/components/steps/index.d.ts +4 -4
- package/dist/components/tabs/Tabs.d.ts +1 -1
- package/dist/components/tabs/index.d.ts +3 -3
- package/dist/components/tabs/tabs-tab.vue.d.ts +1 -1
- package/dist/components/tag/Tag.vue.d.ts +2 -2
- package/dist/components/tag/index.d.ts +4 -4
- package/dist/components/time-picker/TimeColumn.vue.d.ts +3 -0
- package/dist/components/time-picker/TimePanel.vue.d.ts +3 -0
- package/dist/components/time-picker/TimePicker.vue.d.ts +33 -17
- package/dist/components/time-picker/index.d.ts +73 -36
- package/dist/components/time-range-selector/TimeRangeSelector.vue.d.ts +8 -0
- package/dist/components/time-range-selector/index.d.ts +22 -0
- package/dist/components/tooltip/Tooltip.vue.d.ts +1 -1
- package/dist/components/tooltip/index.d.ts +3 -3
- package/dist/components/trigger/Trigger.d.ts +1 -1
- package/dist/components/trigger/index.d.ts +3 -3
- package/dist/es/_hooks/use-form-item.js +36 -10
- package/dist/es/_hooks/use-overflow.js +45 -40
- package/dist/es/_hooks/use-picker-focus.js +57 -0
- package/dist/es/_utils/constant.js +17 -5
- package/dist/es/components/_components/picker/input-range.vue.js +45 -55
- package/dist/es/components/_components/picker/input-range.vue2.js +105 -70
- package/dist/es/components/_components/picker/input.vue.js +22 -25
- package/dist/es/components/_components/picker/input.vue2.js +58 -43
- package/dist/es/components/_components/select-view/select-view.js +61 -66
- package/dist/es/components/date-picker/DatePanel.vue.js +102 -94
- package/dist/es/components/date-picker/DatePanel.vue2.js +97 -44
- package/dist/es/components/date-picker/DatePicker.vue.js +71 -58
- package/dist/es/components/date-picker/DatePicker.vue2.js +285 -231
- package/dist/es/components/dialog/Dialog.js +159 -128
- package/dist/es/components/dropdown/Dropdown.vue.js +18 -15
- package/dist/es/components/dropdown/Dropdown.vue2.js +52 -31
- package/dist/es/components/dropdown/DropdownOption.vue.js +22 -21
- package/dist/es/components/dropdown/DropdownOption.vue2.js +23 -19
- package/dist/es/components/dropdown/DropdownSubmenu.vue.js +49 -36
- package/dist/es/components/dropdown/DropdownSubmenu.vue2.js +45 -24
- package/dist/es/components/dropdown/context.js +3 -2
- package/dist/es/components/dropdown/dropdown-panel.vue.js +24 -21
- package/dist/es/components/dropdown/dropdown-panel.vue2.js +83 -31
- package/dist/es/components/dropdown/use-keyboard.js +45 -0
- package/dist/es/components/form/Form.vue2.js +113 -101
- package/dist/es/components/form/FormItem.vue.js +26 -22
- package/dist/es/components/form/FormItem.vue2.js +162 -125
- package/dist/es/components/form/form-item-message.vue.js +31 -24
- package/dist/es/components/form/form-item-message.vue2.js +4 -2
- package/dist/es/components/form-checkbox/Checkbox.js +80 -76
- package/dist/es/components/form-checkbox/CheckboxGroup.js +43 -38
- package/dist/es/components/form-input/Input.js +83 -79
- package/dist/es/components/form-input/InputPassword.vue.js +19 -16
- package/dist/es/components/form-input/InputPassword.vue2.js +39 -29
- package/dist/es/components/form-input/InputSearch.js +47 -37
- package/dist/es/components/form-input-number/InputNumber.js +134 -133
- package/dist/es/components/form-input-tag/InputTag.js +173 -162
- package/dist/es/components/form-radio/Radio.js +74 -71
- package/dist/es/components/form-radio/RadioGroup.js +55 -49
- package/dist/es/components/form-select/Select.js +116 -114
- package/dist/es/components/form-select/hooks/use-select.js +128 -128
- package/dist/es/components/form-slider/Slider.vue.js +28 -28
- package/dist/es/components/form-slider/Slider.vue2.js +139 -132
- package/dist/es/components/form-slider/slider-button.vue.js +6 -6
- package/dist/es/components/form-slider/slider-button.vue2.js +39 -34
- package/dist/es/components/form-switch/Switch.vue.js +9 -9
- package/dist/es/components/form-switch/Switch.vue2.js +81 -74
- package/dist/es/components/form-textarea/Textarea.vue2.js +123 -108
- package/dist/es/components/image/Image.vue2.js +77 -76
- package/dist/es/components/image/ImagePreview.vue.js +13 -12
- package/dist/es/components/image/ImagePreview.vue2.js +141 -136
- package/dist/es/components/image/ImagePreviewGroup.vue.js +1 -1
- package/dist/es/components/image/ImagePreviewGroup.vue2.js +82 -83
- package/dist/es/components/rate/Rate.js +106 -103
- package/dist/es/components/time-picker/TimeColumn.vue.js +34 -23
- package/dist/es/components/time-picker/TimeColumn.vue2.js +37 -28
- package/dist/es/components/time-picker/TimePicker.vue.js +83 -64
- package/dist/es/components/time-picker/TimePicker.vue2.js +192 -156
- package/dist/es/components/time-range-selector/TimeRangeSelector.vue.js +327 -193
- package/dist/es/locale/en-US.js +6 -0
- package/dist/es/locale/zh-CN.js +6 -0
- package/dist/es/style.css +1 -1
- package/dist/icons/_self/down.d.ts +1 -1
- package/dist/icons/_self/dropdown/more.d.ts +1 -1
- package/dist/icons/_self/empty-better.d.ts +1 -1
- package/dist/icons/_self/empty.d.ts +1 -1
- package/dist/icons/_self/eye-invisible.d.ts +1 -1
- package/dist/icons/_self/eye.d.ts +1 -1
- package/dist/icons/_self/full-screen.d.ts +1 -1
- package/dist/icons/_self/left.d.ts +1 -1
- package/dist/icons/_self/menu/down.d.ts +1 -1
- package/dist/icons/_self/minus.d.ts +1 -1
- package/dist/icons/_self/more-dot.d.ts +1 -1
- package/dist/icons/_self/next.d.ts +1 -1
- package/dist/icons/_self/original-size.d.ts +1 -1
- package/dist/icons/_self/plus.d.ts +1 -1
- package/dist/icons/_self/prev.d.ts +1 -1
- package/dist/icons/_self/question-message.d.ts +1 -1
- package/dist/icons/_self/right.d.ts +1 -1
- package/dist/icons/_self/rotate-left.d.ts +1 -1
- package/dist/icons/_self/rotate-right.d.ts +1 -1
- package/dist/icons/_self/search.d.ts +1 -1
- package/dist/icons/_self/up.d.ts +1 -1
- package/dist/icons/_self/zoom-in.d.ts +1 -1
- package/dist/icons/_self/zoom-out.d.ts +1 -1
- package/dist/icons/_ui/alone-left.d.ts +1 -1
- package/dist/icons/_ui/alone-margin-left.d.ts +1 -1
- package/dist/icons/_ui/alone-margin-right.d.ts +1 -1
- package/dist/icons/_ui/alone-right.d.ts +1 -1
- package/dist/icons/_ui/calendar.d.ts +1 -1
- package/dist/icons/_ui/time.d.ts +1 -1
- package/dist/icons/animation/animation-loading.d.ts +1 -1
- package/dist/icons/default/check-circle-fill.d.ts +1 -1
- package/dist/icons/default/check.d.ts +1 -1
- package/dist/icons/default/close-circle-fill.d.ts +1 -1
- package/dist/icons/default/close.d.ts +1 -1
- package/dist/icons/default/exclamation-circle-fill.d.ts +1 -1
- package/dist/icons/default/exclamation.d.ts +1 -1
- package/dist/icons/default/filter.d.ts +1 -1
- package/dist/icons/default/info-circle-fill.d.ts +1 -1
- package/dist/icons/default/link.d.ts +1 -1
- package/dist/icons/default/logo-simple.d.ts +1 -1
- package/dist/icons/default/minus-circle-fill.d.ts +1 -1
- package/dist/icons/icon.d.ts +2 -2
- package/dist/icons/index.d.ts +3 -3
- package/dist/index.cjs +4 -4
- package/dist/index.d.ts +1 -1
- package/dist/index.umd.js +4 -4
- package/dist/locale/interface.d.ts +6 -0
- package/dist/style/base.css +1 -1
- package/dist/style/date-picker.css +1 -1
- package/dist/style/form.css +1 -1
- package/dist/style/image.css +1 -1
- package/dist/style/time-range-selector.css +1 -1
- package/dist/style.css +1 -1
- package/package.json +2 -2
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as T, toRefs as q, reactive as b, computed as r, ref as D, watch as E, provide as F } from "vue";
|
|
2
|
+
import C from "../../_hooks/use-merge-state.js";
|
|
3
3
|
import H from "./ImagePreview.vue.js";
|
|
4
4
|
import { PreviewGroupInjectionKey as J } from "./context.js";
|
|
5
|
-
import { isArray as
|
|
6
|
-
const $ = /* @__PURE__ */
|
|
5
|
+
import { isArray as A, isUndefined as s } from "../../_utils/is.js";
|
|
6
|
+
const $ = /* @__PURE__ */ T({
|
|
7
7
|
name: "ImagePreviewGroup",
|
|
8
8
|
components: {
|
|
9
9
|
ImagePreview: H
|
|
@@ -116,109 +116,108 @@ const $ = /* @__PURE__ */ D({
|
|
|
116
116
|
* @slot actions
|
|
117
117
|
* @version 2.46.0
|
|
118
118
|
*/
|
|
119
|
-
setup(
|
|
120
|
-
emit:
|
|
119
|
+
setup(B, {
|
|
120
|
+
emit: m
|
|
121
121
|
}) {
|
|
122
122
|
const {
|
|
123
|
-
srcList:
|
|
124
|
-
visible:
|
|
125
|
-
defaultVisible:
|
|
126
|
-
current:
|
|
127
|
-
defaultCurrent:
|
|
128
|
-
infinite:
|
|
129
|
-
} =
|
|
130
|
-
value:
|
|
131
|
-
})),
|
|
132
|
-
e !==
|
|
133
|
-
},
|
|
123
|
+
srcList: n,
|
|
124
|
+
visible: U,
|
|
125
|
+
defaultVisible: M,
|
|
126
|
+
current: S,
|
|
127
|
+
defaultCurrent: N,
|
|
128
|
+
infinite: w
|
|
129
|
+
} = q(B), [h, O] = C(M.value, b({
|
|
130
|
+
value: U
|
|
131
|
+
})), g = (e) => {
|
|
132
|
+
e !== h.value && (m("visible-change", e), m("update:visible", e), O(e));
|
|
133
|
+
}, k = r(() => new Map(A(n == null ? void 0 : n.value) ? n == null ? void 0 : n.value.map((e, t) => [t, {
|
|
134
134
|
url: e,
|
|
135
135
|
canPreview: !0
|
|
136
|
-
}]) : [])),
|
|
137
|
-
function
|
|
138
|
-
return
|
|
136
|
+
}]) : [])), x = r(() => A(n == null ? void 0 : n.value)), c = D(/* @__PURE__ */ new Map()), f = r(() => x.value ? k.value : c.value), z = r(() => Array.from(c.value.keys())), d = r(() => Array.from(f.value.keys())), i = r(() => d.value.length);
|
|
137
|
+
function L(e, t, u) {
|
|
138
|
+
return c.value.set(e, {
|
|
139
139
|
url: t,
|
|
140
|
-
canPreview:
|
|
141
|
-
}), p.value.includes(e) || p.value.push(e), function() {
|
|
142
|
-
x.value.delete(e), p.value = p.value.filter((s) => s !== e);
|
|
143
|
-
}) : (v.value.set(e, {
|
|
144
|
-
url: t,
|
|
145
|
-
canPreview: r
|
|
140
|
+
canPreview: u
|
|
146
141
|
}), function() {
|
|
147
|
-
|
|
148
|
-
}
|
|
142
|
+
c.value.delete(e);
|
|
143
|
+
};
|
|
149
144
|
}
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
})
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
})), f = (e) => {
|
|
156
|
-
e !== n.value && (g("change", e), g("update:current", e), k(e));
|
|
157
|
-
}, G = u(() => d.value[n.value]), V = (e) => {
|
|
145
|
+
const [a, R] = C(N.value, b({
|
|
146
|
+
value: S
|
|
147
|
+
})), v = (e) => {
|
|
148
|
+
e !== a.value && (m("change", e), m("update:current", e), R(e));
|
|
149
|
+
}, _ = r(() => d.value[a.value]), j = (e) => {
|
|
158
150
|
const t = d.value.indexOf(e);
|
|
159
|
-
t >= 0 && t !==
|
|
160
|
-
},
|
|
151
|
+
t >= 0 && t !== a.value && v(t);
|
|
152
|
+
}, G = r(() => {
|
|
161
153
|
var e;
|
|
162
|
-
return (e =
|
|
154
|
+
return (e = f.value.get(_.value)) == null ? void 0 : e.url;
|
|
163
155
|
});
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
156
|
+
E(
|
|
157
|
+
[i, a],
|
|
158
|
+
() => {
|
|
159
|
+
if (i.value === 0) {
|
|
160
|
+
g(!1);
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
if (a.value < 0) {
|
|
164
|
+
v(0);
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
a.value >= i.value && v(i.value - 1);
|
|
168
|
+
},
|
|
169
|
+
// 自动收集模式须等子图片注册;显式列表在 setup 时即可检查边界。
|
|
170
|
+
{
|
|
171
|
+
immediate: x.value
|
|
172
172
|
}
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
registerImageUrl: j,
|
|
173
|
+
), F(J, b({
|
|
174
|
+
registerImageUrl: L,
|
|
176
175
|
preview: (e) => {
|
|
177
|
-
if (
|
|
178
|
-
const
|
|
179
|
-
|
|
176
|
+
if (x.value) {
|
|
177
|
+
const u = c.value.get(e), o = u != null && u.canPreview ? z.value.indexOf(e) : -1;
|
|
178
|
+
o >= 0 && o < i.value && (v(o), g(!0));
|
|
180
179
|
return;
|
|
181
180
|
}
|
|
182
|
-
const t =
|
|
183
|
-
t != null && t.canPreview && (
|
|
181
|
+
const t = f.value.get(e);
|
|
182
|
+
t != null && t.canPreview && (j(e), g(!0));
|
|
184
183
|
}
|
|
185
184
|
}));
|
|
186
|
-
const y =
|
|
187
|
-
const e = (
|
|
188
|
-
var
|
|
189
|
-
for (let
|
|
190
|
-
const P = d.value[
|
|
191
|
-
if ((
|
|
192
|
-
return
|
|
185
|
+
const y = r(() => {
|
|
186
|
+
const e = (u, o) => {
|
|
187
|
+
var p;
|
|
188
|
+
for (let l = u; l <= o; l++) {
|
|
189
|
+
const P = d.value[l];
|
|
190
|
+
if ((p = f.value.get(P)) != null && p.canPreview)
|
|
191
|
+
return l;
|
|
193
192
|
}
|
|
194
|
-
}, t = e(
|
|
195
|
-
return
|
|
196
|
-
}), I =
|
|
197
|
-
const e = (
|
|
198
|
-
var
|
|
199
|
-
for (let
|
|
200
|
-
const P = d.value[
|
|
201
|
-
if ((
|
|
202
|
-
return
|
|
193
|
+
}, t = e(a.value + 1, i.value - 1);
|
|
194
|
+
return s(t) && w.value ? e(0, a.value - 1) : t;
|
|
195
|
+
}), I = r(() => {
|
|
196
|
+
const e = (u, o) => {
|
|
197
|
+
var p;
|
|
198
|
+
for (let l = u; l >= o; l--) {
|
|
199
|
+
const P = d.value[l];
|
|
200
|
+
if ((p = f.value.get(P)) != null && p.canPreview)
|
|
201
|
+
return l;
|
|
203
202
|
}
|
|
204
|
-
}, t = e(
|
|
205
|
-
return
|
|
206
|
-
}),
|
|
207
|
-
!
|
|
208
|
-
}),
|
|
209
|
-
!
|
|
203
|
+
}, t = e(a.value - 1, 0);
|
|
204
|
+
return s(t) && w.value ? e(i.value - 1, a.value + 1) : t;
|
|
205
|
+
}), V = r(() => s(I.value) ? void 0 : () => {
|
|
206
|
+
!s(I.value) && v(I.value);
|
|
207
|
+
}), K = r(() => s(y.value) ? void 0 : () => {
|
|
208
|
+
!s(y.value) && v(y.value);
|
|
210
209
|
});
|
|
211
210
|
return {
|
|
212
|
-
mergedVisible:
|
|
213
|
-
currentUrl:
|
|
211
|
+
mergedVisible: h,
|
|
212
|
+
currentUrl: G,
|
|
214
213
|
prevIndex: I,
|
|
215
214
|
nextIndex: y,
|
|
216
215
|
onClose() {
|
|
217
|
-
|
|
216
|
+
g(!1);
|
|
218
217
|
},
|
|
219
|
-
groupArrowProps:
|
|
220
|
-
onPrev:
|
|
221
|
-
onNext:
|
|
218
|
+
groupArrowProps: b({
|
|
219
|
+
onPrev: V,
|
|
220
|
+
onNext: K
|
|
222
221
|
})
|
|
223
222
|
};
|
|
224
223
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { getClassNameMixin as
|
|
4
|
-
import { isUndefined as
|
|
5
|
-
import { useFormItem as
|
|
6
|
-
const
|
|
1
|
+
import { defineComponent as ee, toRefs as le, toRef as ae, ref as b, computed as v, watch as te, onMounted as re, createVNode as r, mergeProps as ne } from "vue";
|
|
2
|
+
import x from "../../node_modules/.pnpm/number-precision@1.6.0/node_modules/number-precision/build/index.es.js";
|
|
3
|
+
import { getClassNameMixin as oe } from "../../_utils/config.js";
|
|
4
|
+
import { isUndefined as ue, isNull as ce, isString as ie, isObject as se } from "../../_utils/is.js";
|
|
5
|
+
import { useFormItem as de, useFormItemControl as fe } from "../../_hooks/use-form-item.js";
|
|
6
|
+
const ve = () => r("svg", {
|
|
7
7
|
viewBox: "0 0 24 24",
|
|
8
8
|
"aria-hidden": "true",
|
|
9
9
|
focusable: "false"
|
|
10
10
|
}, [r("path", {
|
|
11
11
|
d: "M12 2.8l2.75 5.57 6.15.9-4.45 4.33 1.05 6.12L12 16.83l-5.5 2.89 1.05-6.12L3.1 9.27l6.15-.9L12 2.8z",
|
|
12
12
|
fill: "currentColor"
|
|
13
|
-
}, null)]),
|
|
13
|
+
}, null)]), me = () => r("svg", {
|
|
14
14
|
viewBox: "0 0 24 24",
|
|
15
15
|
"aria-hidden": "true",
|
|
16
16
|
focusable: "false"
|
|
@@ -60,7 +60,7 @@ const se = () => r("svg", {
|
|
|
60
60
|
stroke: "var(--x-rate-face-detail-color)",
|
|
61
61
|
"stroke-width": "1.7",
|
|
62
62
|
"stroke-linecap": "round"
|
|
63
|
-
}, null)]),
|
|
63
|
+
}, null)]), he = () => r("svg", {
|
|
64
64
|
viewBox: "0 0 24 24",
|
|
65
65
|
"aria-hidden": "true",
|
|
66
66
|
focusable: "false"
|
|
@@ -85,7 +85,7 @@ const se = () => r("svg", {
|
|
|
85
85
|
stroke: "var(--x-rate-face-detail-color)",
|
|
86
86
|
"stroke-width": "1.7",
|
|
87
87
|
"stroke-linecap": "round"
|
|
88
|
-
}, null)]),
|
|
88
|
+
}, null)]), ke = /* @__PURE__ */ ee({
|
|
89
89
|
name: "Rate",
|
|
90
90
|
inheritAttrs: !1,
|
|
91
91
|
props: {
|
|
@@ -223,168 +223,171 @@ const se = () => r("svg", {
|
|
|
223
223
|
* @binding {boolean} disabled
|
|
224
224
|
*/
|
|
225
225
|
setup(t, {
|
|
226
|
-
attrs:
|
|
226
|
+
attrs: w,
|
|
227
227
|
emit: c,
|
|
228
228
|
expose: _,
|
|
229
|
-
slots:
|
|
229
|
+
slots: I
|
|
230
230
|
}) {
|
|
231
|
-
const o =
|
|
231
|
+
const o = oe("rate"), {
|
|
232
232
|
modelValue: p
|
|
233
|
-
} =
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
233
|
+
} = le(t), {
|
|
234
|
+
formItemCtx: z,
|
|
235
|
+
mergedDisabled: E,
|
|
236
|
+
eventHandlers: C
|
|
237
|
+
} = de({
|
|
238
|
+
disabled: ae(t, "disabled")
|
|
239
|
+
}), K = fe(z, () => w, {
|
|
240
|
+
labelable: !1
|
|
241
|
+
}), B = b(null), k = b(t.defaultValue), y = b(), V = b(!1), M = b(), i = v(() => Math.max(0, t.grading ? 5 : Math.floor(t.count))), s = v(() => E.value), N = v(() => !s.value && !t.readonly), A = (e) => {
|
|
242
|
+
const l = i.value, a = Number(e ?? 0);
|
|
240
243
|
if (!Number.isFinite(a) || a <= 0 || l <= 0)
|
|
241
244
|
return 0;
|
|
242
|
-
const n = t.allowHalf ?
|
|
245
|
+
const n = t.allowHalf ? x.times(x.round(x.divide(a, 0.5), 0), 0.5) : Math.round(a);
|
|
243
246
|
return Math.min(l, Math.max(0, n));
|
|
244
|
-
},
|
|
245
|
-
|
|
246
|
-
(
|
|
247
|
+
}, d = v(() => A(t.modelValue ?? k.value)), m = v(() => A(y.value ?? d.value));
|
|
248
|
+
te(p, (e) => {
|
|
249
|
+
(ue(e) || ce(e)) && (k.value = 0);
|
|
247
250
|
});
|
|
248
251
|
const H = v(() => {
|
|
249
|
-
if (
|
|
252
|
+
if (ie(t.color))
|
|
250
253
|
return Array.from({
|
|
251
|
-
length:
|
|
254
|
+
length: i.value
|
|
252
255
|
}, () => t.color);
|
|
253
|
-
if (
|
|
256
|
+
if (se(t.color)) {
|
|
254
257
|
const e = Object.keys(t.color).map(Number).filter((l) => Number.isFinite(l)).sort((l, a) => l - a);
|
|
255
258
|
return Array.from({
|
|
256
|
-
length:
|
|
259
|
+
length: i.value
|
|
257
260
|
}, (l, a) => {
|
|
258
|
-
const n = a + 1, u = e.find((
|
|
261
|
+
const n = a + 1, u = e.find((h) => n <= h) ?? e[e.length - 1];
|
|
259
262
|
return u ? t.color[u] : void 0;
|
|
260
263
|
});
|
|
261
264
|
}
|
|
262
|
-
}),
|
|
263
|
-
var
|
|
264
|
-
const
|
|
265
|
-
if (
|
|
266
|
-
t.allowClear &&
|
|
265
|
+
}), R = (e, l, a = !1) => {
|
|
266
|
+
var u, h, f, g;
|
|
267
|
+
const n = A(e);
|
|
268
|
+
if (n === d.value) {
|
|
269
|
+
a && t.allowClear && n !== 0 && (k.value = 0, c("update:modelValue", 0), c("change", 0), (h = (u = C.value) == null ? void 0 : u.onChange) == null || h.call(u, l));
|
|
267
270
|
return;
|
|
268
271
|
}
|
|
269
|
-
|
|
270
|
-
},
|
|
272
|
+
k.value = n, M.value = n, c("update:modelValue", n), c("change", n), (g = (f = C.value) == null ? void 0 : f.onChange) == null || g.call(f, l);
|
|
273
|
+
}, L = (e, l) => {
|
|
271
274
|
if (!t.allowHalf)
|
|
272
275
|
return e + 1;
|
|
273
276
|
const n = l.currentTarget.getBoundingClientRect(), u = l.clientX - n.left <= n.width / 2;
|
|
274
277
|
return e + (u ? 0.5 : 1);
|
|
275
|
-
}, E = (e, l) => {
|
|
276
|
-
if (!B.value)
|
|
277
|
-
return;
|
|
278
|
-
const a = R(e, l);
|
|
279
|
-
h.value !== a && (h.value = a, c("hoverChange", a));
|
|
280
|
-
}, K = () => {
|
|
281
|
-
h.value !== void 0 && (h.value = void 0, c("hoverChange", void 0));
|
|
282
278
|
}, P = (e, l) => {
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
279
|
+
if (!N.value)
|
|
280
|
+
return;
|
|
281
|
+
const a = L(e, l);
|
|
282
|
+
y.value !== a && (y.value = a, c("hoverChange", a));
|
|
283
|
+
}, U = () => {
|
|
284
|
+
y.value !== void 0 && (y.value = void 0, c("hoverChange", void 0));
|
|
285
|
+
}, G = (e, l) => {
|
|
286
|
+
N.value && R(L(e, l), l, !0);
|
|
287
|
+
}, T = (e) => {
|
|
288
|
+
if (c("keydown", e), !N.value)
|
|
286
289
|
return;
|
|
287
290
|
const l = t.allowHalf ? 0.5 : 1;
|
|
288
291
|
let a;
|
|
289
292
|
if (e.key === "ArrowRight" || e.key === "ArrowUp")
|
|
290
|
-
a =
|
|
293
|
+
a = x.plus(d.value, l);
|
|
291
294
|
else if (e.key === "ArrowLeft" || e.key === "ArrowDown")
|
|
292
|
-
a =
|
|
295
|
+
a = x.minus(d.value, l);
|
|
293
296
|
else if (e.key === "Home")
|
|
294
297
|
a = 0;
|
|
295
298
|
else if (e.key === "End")
|
|
296
|
-
a =
|
|
299
|
+
a = i.value;
|
|
297
300
|
else {
|
|
298
301
|
const n = Number(e.key);
|
|
299
|
-
Number.isInteger(n) && n >= 0 && n <=
|
|
302
|
+
Number.isInteger(n) && n >= 0 && n <= i.value && (a = n);
|
|
300
303
|
}
|
|
301
|
-
a !== void 0 && (e.preventDefault(),
|
|
302
|
-
},
|
|
304
|
+
a !== void 0 && (e.preventDefault(), R(a, e));
|
|
305
|
+
}, X = (e) => {
|
|
303
306
|
var l, a;
|
|
304
|
-
|
|
305
|
-
},
|
|
307
|
+
V.value = !0, c("focus", e), (a = (l = C.value) == null ? void 0 : l.onFocus) == null || a.call(l, e);
|
|
308
|
+
}, q = (e) => {
|
|
306
309
|
var l, a;
|
|
307
|
-
|
|
308
|
-
},
|
|
309
|
-
|
|
310
|
-
},
|
|
310
|
+
V.value = !1, c("blur", e), (a = (l = C.value) == null ? void 0 : l.onBlur) == null || a.call(l, e);
|
|
311
|
+
}, J = () => {
|
|
312
|
+
M.value = void 0;
|
|
313
|
+
}, S = () => {
|
|
311
314
|
var e;
|
|
312
|
-
|
|
315
|
+
s.value || (e = B.value) == null || e.focus();
|
|
313
316
|
};
|
|
314
317
|
_({
|
|
315
|
-
focus:
|
|
318
|
+
focus: S,
|
|
316
319
|
blur: () => {
|
|
317
320
|
var e;
|
|
318
|
-
(e =
|
|
321
|
+
(e = B.value) == null || e.blur();
|
|
319
322
|
}
|
|
320
|
-
}),
|
|
321
|
-
t.autofocus &&
|
|
323
|
+
}), re(() => {
|
|
324
|
+
t.autofocus && S();
|
|
322
325
|
});
|
|
323
|
-
const
|
|
326
|
+
const Q = (e) => e + 1 > m.value ? r(O, null, null) : m.value <= 2 ? r(me, null, null) : m.value <= 3 ? r(O, null, null) : r(he, null, null), j = (e) => t.grading ? Q(e) : I.character ? I.character({
|
|
324
327
|
index: e,
|
|
325
|
-
value:
|
|
326
|
-
count:
|
|
327
|
-
disabled:
|
|
328
|
-
}) : r(
|
|
328
|
+
value: d.value,
|
|
329
|
+
count: i.value,
|
|
330
|
+
disabled: s.value
|
|
331
|
+
}) : r(ve, null, null), W = (e) => {
|
|
329
332
|
var a, n;
|
|
330
333
|
const l = Math.max(0, Math.ceil(m.value) - 1);
|
|
331
334
|
return ((a = H.value) == null ? void 0 : a[l]) ?? ((n = H.value) == null ? void 0 : n[e]);
|
|
332
|
-
},
|
|
335
|
+
}, Y = (e, l) => {
|
|
333
336
|
var D;
|
|
334
|
-
const a = l + 1, n = t.allowHalf && m.value === l + 0.5, u = a <= m.value,
|
|
335
|
-
color:
|
|
336
|
-
} : void 0,
|
|
337
|
+
const a = l + 1, n = t.allowHalf && m.value === l + 0.5, u = a <= m.value, h = a <= d.value, f = W(l), g = f ? {
|
|
338
|
+
color: f
|
|
339
|
+
} : void 0, $ = [o.element("character"), {
|
|
337
340
|
[o.element("character-full")]: u,
|
|
338
341
|
[o.element("character-half")]: n,
|
|
339
|
-
[o.element("character-checked")]:
|
|
340
|
-
[o.element("character-focused")]:
|
|
341
|
-
[o.element("character-scale")]:
|
|
342
|
-
[o.element("character-disabled")]:
|
|
342
|
+
[o.element("character-checked")]: h,
|
|
343
|
+
[o.element("character-focused")]: V.value && Math.ceil(d.value) === a,
|
|
344
|
+
[o.element("character-scale")]: M.value !== void 0 && a <= Math.ceil(M.value),
|
|
345
|
+
[o.element("character-disabled")]: s.value
|
|
343
346
|
}];
|
|
344
347
|
return r("div", {
|
|
345
348
|
key: l,
|
|
346
|
-
class:
|
|
349
|
+
class: $,
|
|
347
350
|
title: (D = t.tooltips) == null ? void 0 : D[l],
|
|
348
351
|
role: "radio",
|
|
349
|
-
"aria-checked":
|
|
352
|
+
"aria-checked": Math.ceil(d.value) === a,
|
|
350
353
|
"aria-posinset": a,
|
|
351
|
-
"aria-setsize":
|
|
352
|
-
"aria-disabled":
|
|
353
|
-
onMousemove: (
|
|
354
|
-
onClick: (
|
|
355
|
-
onAnimationend:
|
|
354
|
+
"aria-setsize": i.value,
|
|
355
|
+
"aria-disabled": s.value || void 0,
|
|
356
|
+
onMousemove: (F) => P(l, F),
|
|
357
|
+
onClick: (F) => G(l, F),
|
|
358
|
+
onAnimationend: J
|
|
356
359
|
}, [r("div", {
|
|
357
360
|
class: o.element("character-left"),
|
|
358
|
-
style: n ?
|
|
359
|
-
}, [
|
|
361
|
+
style: n ? g : void 0
|
|
362
|
+
}, [j(l)]), r("div", {
|
|
360
363
|
class: o.element("character-right"),
|
|
361
|
-
style: u ?
|
|
362
|
-
}, [
|
|
363
|
-
},
|
|
364
|
-
[o.modifier("disabled")]:
|
|
364
|
+
style: u ? g : void 0
|
|
365
|
+
}, [j(l)])]);
|
|
366
|
+
}, Z = v(() => [o.block, w.class, {
|
|
367
|
+
[o.modifier("disabled")]: s.value,
|
|
365
368
|
[o.modifier("readonly")]: t.readonly,
|
|
366
369
|
[o.modifier("grading")]: t.grading,
|
|
367
|
-
[o.modifier("focused")]:
|
|
370
|
+
[o.modifier("focused")]: V.value
|
|
368
371
|
}]);
|
|
369
372
|
return () => {
|
|
370
|
-
const e = Object.fromEntries(Object.entries(
|
|
371
|
-
return r("div",
|
|
372
|
-
ref:
|
|
373
|
-
class:
|
|
374
|
-
style:
|
|
373
|
+
const e = Object.fromEntries(Object.entries(w).filter(([l]) => l !== "class" && l !== "style"));
|
|
374
|
+
return r("div", ne(e, K.value, {
|
|
375
|
+
ref: B,
|
|
376
|
+
class: Z.value,
|
|
377
|
+
style: w.style,
|
|
375
378
|
role: "radiogroup",
|
|
376
|
-
tabindex:
|
|
377
|
-
"aria-disabled":
|
|
378
|
-
onMouseleave:
|
|
379
|
-
onKeydown:
|
|
380
|
-
onFocus:
|
|
381
|
-
onBlur:
|
|
379
|
+
tabindex: s.value ? -1 : t.tabindex,
|
|
380
|
+
"aria-disabled": s.value || void 0,
|
|
381
|
+
onMouseleave: U,
|
|
382
|
+
onKeydown: T,
|
|
383
|
+
onFocus: X,
|
|
384
|
+
onBlur: q
|
|
382
385
|
}), [Array.from({
|
|
383
|
-
length:
|
|
384
|
-
}).map(
|
|
386
|
+
length: i.value
|
|
387
|
+
}).map(Y)]);
|
|
385
388
|
};
|
|
386
389
|
}
|
|
387
390
|
});
|
|
388
391
|
export {
|
|
389
|
-
|
|
392
|
+
ke as default
|
|
390
393
|
};
|
|
@@ -1,34 +1,41 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { resolveComponent as
|
|
3
|
-
import
|
|
4
|
-
const
|
|
5
|
-
function
|
|
6
|
-
const
|
|
7
|
-
return
|
|
1
|
+
import v from "./TimeColumn.vue2.js";
|
|
2
|
+
import { resolveComponent as u, openBlock as n, createElementBlock as t, withKeys as o, withModifiers as s, normalizeClass as i, createVNode as b, withCtx as p, createElementVNode as c, Fragment as f, renderList as $, toDisplayString as y } from "vue";
|
|
3
|
+
import I from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const N = ["aria-label", "aria-activedescendant", "aria-disabled", "tabindex"], g = ["id", "aria-selected", "aria-disabled", "disabled", "onClick"];
|
|
5
|
+
function B(e, a, C, k, w, S) {
|
|
6
|
+
const d = u("Scrollbar");
|
|
7
|
+
return n(), t("div", {
|
|
8
8
|
ref: "columnRef",
|
|
9
|
-
class:
|
|
9
|
+
class: i(e.className.element("column")),
|
|
10
10
|
role: "listbox",
|
|
11
11
|
"aria-label": e.label,
|
|
12
|
-
|
|
12
|
+
"aria-activedescendant": e.activeItem ? e.getItemId(e.activeItem) : void 0,
|
|
13
|
+
"aria-disabled": !e.activeItem || void 0,
|
|
14
|
+
tabindex: e.activeItem ? 0 : -1,
|
|
13
15
|
onKeydown: [
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
a[1] || (a[1] = o(s((l) => e.moveActive(-1), ["prevent"]), ["up"])),
|
|
17
|
+
a[2] || (a[2] = o(s((l) => e.moveActive(1), ["prevent"]), ["down"])),
|
|
18
|
+
a[3] || (a[3] = o(s((...l) => e.selectActive && e.selectActive(...l), ["prevent"]), ["enter"])),
|
|
19
|
+
a[4] || (a[4] = o(s((l) => e.moveBoundary(!1), ["prevent"]), ["home"])),
|
|
20
|
+
a[5] || (a[5] = o(s((l) => e.moveBoundary(!0), ["prevent"]), ["end"]))
|
|
17
21
|
]
|
|
18
22
|
}, [
|
|
19
|
-
|
|
23
|
+
b(d, {
|
|
24
|
+
tabindex: "-1",
|
|
20
25
|
"outer-class": e.className.element("column-scrollbar"),
|
|
21
26
|
"outer-style": { height: "100%" },
|
|
22
27
|
"disable-horizontal": ""
|
|
23
28
|
}, {
|
|
24
|
-
default:
|
|
25
|
-
|
|
26
|
-
class:
|
|
29
|
+
default: p(() => [
|
|
30
|
+
c("div", {
|
|
31
|
+
class: i(e.className.element("column-list"))
|
|
27
32
|
}, [
|
|
28
|
-
(
|
|
33
|
+
(n(!0), t(f, null, $(e.items, (l) => (n(), t("button", {
|
|
29
34
|
key: String(l.value),
|
|
35
|
+
id: e.getItemId(l),
|
|
36
|
+
tabindex: "-1",
|
|
30
37
|
type: "button",
|
|
31
|
-
class:
|
|
38
|
+
class: i([
|
|
32
39
|
e.className.element("cell"),
|
|
33
40
|
{
|
|
34
41
|
[e.className.is("selected")]: l.selected,
|
|
@@ -39,15 +46,19 @@ function C(e, s, k, w, S, g) {
|
|
|
39
46
|
"aria-selected": !!l.selected,
|
|
40
47
|
"aria-disabled": !!l.disabled,
|
|
41
48
|
disabled: l.disabled,
|
|
42
|
-
onClick: (
|
|
43
|
-
|
|
49
|
+
onClick: (m) => e.handleSelect(l),
|
|
50
|
+
onFocus: a[0] || (a[0] = (m) => {
|
|
51
|
+
var r;
|
|
52
|
+
return (r = e.columnRef) == null ? void 0 : r.focus();
|
|
53
|
+
})
|
|
54
|
+
}, y(l.label), 43, g))), 128))
|
|
44
55
|
], 2)
|
|
45
56
|
]),
|
|
46
57
|
_: 1
|
|
47
58
|
}, 8, ["outer-class"])
|
|
48
|
-
], 42,
|
|
59
|
+
], 42, N);
|
|
49
60
|
}
|
|
50
|
-
const
|
|
61
|
+
const F = /* @__PURE__ */ I(v, [["render", B]]);
|
|
51
62
|
export {
|
|
52
|
-
|
|
63
|
+
F as default
|
|
53
64
|
};
|