x-next 1.1.0 → 1.2.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 +26 -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 +3 -3
- package/dist/components/dropdown/DropdownButton.vue.d.ts +4 -4
- package/dist/components/dropdown/DropdownSubmenu.vue.d.ts +4 -4
- package/dist/components/dropdown/index.d.ts +22 -22
- 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/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-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 +67 -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 +154 -132
- 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 +75 -71
- 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 +99 -98
- 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.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,16 +1,42 @@
|
|
|
1
|
-
import { inject as
|
|
1
|
+
import { inject as f, computed as n, toRef as t, useId as b, shallowRef as v, onBeforeUpdate as c, watchEffect as g, onBeforeUnmount as y } from "vue";
|
|
2
2
|
import { formItemInjectionKey as I } from "../components/form/context.js";
|
|
3
|
-
const
|
|
4
|
-
const
|
|
3
|
+
const B = ({ size: r, disabled: i, error: o, uninject: s } = {}) => {
|
|
4
|
+
const a = s ? {} : f(I, {}), d = n(() => (r == null ? void 0 : r.value) ?? a.size), e = n(() => (i == null ? void 0 : i.value) || a.disabled), l = n(() => (o == null ? void 0 : o.value) || a.error), u = t(a, "feedback"), m = t(a, "eventHandlers");
|
|
5
5
|
return {
|
|
6
|
-
formItemCtx:
|
|
7
|
-
mergedSize:
|
|
8
|
-
mergedDisabled:
|
|
9
|
-
mergedError:
|
|
10
|
-
feedback:
|
|
11
|
-
eventHandlers:
|
|
6
|
+
formItemCtx: a,
|
|
7
|
+
mergedSize: d,
|
|
8
|
+
mergedDisabled: e,
|
|
9
|
+
mergedError: l,
|
|
10
|
+
feedback: u,
|
|
11
|
+
eventHandlers: m
|
|
12
12
|
};
|
|
13
|
+
}, h = (r, i = () => ({}), o = {}) => {
|
|
14
|
+
const s = b(), a = v({ ...i() });
|
|
15
|
+
c(() => {
|
|
16
|
+
const e = i();
|
|
17
|
+
(Object.keys(e).length !== Object.keys(a.value).length || Object.keys(e).some((l) => e[l] !== a.value[l])) && (a.value = { ...e });
|
|
18
|
+
});
|
|
19
|
+
const d = n(() => {
|
|
20
|
+
const e = { ...a.value, ...i() }, l = [e["aria-describedby"], r.describedBy].filter(Boolean).join(" ").split(/\s+/).filter(Boolean);
|
|
21
|
+
return {
|
|
22
|
+
...e,
|
|
23
|
+
id: e.id ?? (r.registerControl ? `x-form-control-${s}` : void 0),
|
|
24
|
+
"aria-labelledby": e["aria-labelledby"] ?? (e["aria-label"] ? void 0 : r.labelId),
|
|
25
|
+
"aria-describedby": l.length ? [...new Set(l)].join(" ") : void 0,
|
|
26
|
+
"aria-required": e["aria-required"] ?? (o.required !== !1 && r.required ? !0 : void 0),
|
|
27
|
+
"aria-invalid": r.error ? !0 : e["aria-invalid"],
|
|
28
|
+
"aria-errormessage": r.error ? e["aria-errormessage"] ?? r.errorId : e["aria-errormessage"]
|
|
29
|
+
};
|
|
30
|
+
});
|
|
31
|
+
return g(() => {
|
|
32
|
+
var e;
|
|
33
|
+
d.value.id && ((e = r.registerControl) == null || e.call(r, s, String(d.value.id), o.labelable !== !1));
|
|
34
|
+
}), y(() => {
|
|
35
|
+
var e;
|
|
36
|
+
return (e = r.unregisterControl) == null ? void 0 : e.call(r, s);
|
|
37
|
+
}), d;
|
|
13
38
|
};
|
|
14
39
|
export {
|
|
15
|
-
|
|
40
|
+
B as useFormItem,
|
|
41
|
+
h as useFormItemControl
|
|
16
42
|
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { ref as P, useId as k, watch as x, nextTick as c } from "vue";
|
|
2
|
+
const b = ({
|
|
3
|
+
visible: s,
|
|
4
|
+
canOpen: d,
|
|
5
|
+
setVisible: l,
|
|
6
|
+
focusInput: n,
|
|
7
|
+
selector: p,
|
|
8
|
+
inputContains: g
|
|
9
|
+
}) => {
|
|
10
|
+
const o = P(), y = `x-picker-panel-${k()}`;
|
|
11
|
+
let r = !1;
|
|
12
|
+
const f = () => c(() => {
|
|
13
|
+
var t, a;
|
|
14
|
+
if (!s.value || !r) return;
|
|
15
|
+
(a = ((t = o.value) == null ? void 0 : t.querySelector(p)) ?? o.value) == null || a.focus(), r = !1;
|
|
16
|
+
}), m = (e) => {
|
|
17
|
+
d() && (r = !!e, l(!0), f());
|
|
18
|
+
};
|
|
19
|
+
x(s, (e) => {
|
|
20
|
+
var t;
|
|
21
|
+
if (e)
|
|
22
|
+
f();
|
|
23
|
+
else {
|
|
24
|
+
const a = (t = o.value) == null ? void 0 : t.contains(document.activeElement);
|
|
25
|
+
r = !1, a && c(n);
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
const h = (e) => {
|
|
29
|
+
var t;
|
|
30
|
+
if (e.key === "Escape")
|
|
31
|
+
e.preventDefault(), e.stopPropagation(), l(!1), n();
|
|
32
|
+
else if (e.key === "Tab") {
|
|
33
|
+
const a = Array.from(
|
|
34
|
+
((t = o.value) == null ? void 0 : t.querySelectorAll(
|
|
35
|
+
'button:not([disabled]), [tabindex="0"], input:not([disabled]), a[href]'
|
|
36
|
+
)) ?? []
|
|
37
|
+
).filter((i) => i.getAttribute("tabindex") !== "-1" && !i.hidden);
|
|
38
|
+
e.shiftKey && e.target === a[0] ? (e.preventDefault(), l(!1), n()) : !e.shiftKey && e.target === a.at(-1) && (l(!1), n());
|
|
39
|
+
}
|
|
40
|
+
}, u = (e) => {
|
|
41
|
+
var t;
|
|
42
|
+
return e instanceof Node && (((t = o.value) == null ? void 0 : t.contains(e)) || g(e));
|
|
43
|
+
};
|
|
44
|
+
return { popupRef: o, panelId: y, openPanel: m, handlePanelKeydown: h, isInternalFocus: u, handlePanelFocusout: (e, t) => {
|
|
45
|
+
if (!u(e.relatedTarget))
|
|
46
|
+
if (!e.relatedTarget && e.target instanceof HTMLElement) {
|
|
47
|
+
const a = e.target;
|
|
48
|
+
c(() => {
|
|
49
|
+
s.value ? document.activeElement === document.body && a.isConnected && a.focus() : n();
|
|
50
|
+
});
|
|
51
|
+
} else
|
|
52
|
+
t(e);
|
|
53
|
+
} };
|
|
54
|
+
};
|
|
55
|
+
export {
|
|
56
|
+
b as usePickerFocus
|
|
57
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const o = ["mini", "small", "medium", "large"], n = ["info", "success", "warning", "error"],
|
|
1
|
+
const o = ["mini", "small", "medium", "large"], n = ["info", "success", "warning", "error"], e = [
|
|
2
2
|
"top",
|
|
3
3
|
"tl",
|
|
4
4
|
"tr",
|
|
@@ -11,7 +11,7 @@ const o = ["mini", "small", "medium", "large"], n = ["info", "success", "warning
|
|
|
11
11
|
"right",
|
|
12
12
|
"rt",
|
|
13
13
|
"rb"
|
|
14
|
-
],
|
|
14
|
+
], t = [
|
|
15
15
|
// focus events
|
|
16
16
|
"onFocus",
|
|
17
17
|
"onFocusin",
|
|
@@ -46,11 +46,23 @@ const o = ["mini", "small", "medium", "large"], n = ["info", "success", "warning
|
|
|
46
46
|
"name",
|
|
47
47
|
"pattern",
|
|
48
48
|
"readonly",
|
|
49
|
-
"required"
|
|
49
|
+
"required",
|
|
50
|
+
"id",
|
|
51
|
+
"title",
|
|
52
|
+
"form",
|
|
53
|
+
"inputmode",
|
|
54
|
+
"enterkeyhint",
|
|
55
|
+
"spellcheck",
|
|
56
|
+
"aria-label",
|
|
57
|
+
"aria-labelledby",
|
|
58
|
+
"aria-describedby",
|
|
59
|
+
"aria-invalid",
|
|
60
|
+
"aria-required",
|
|
61
|
+
"aria-errormessage"
|
|
50
62
|
];
|
|
51
63
|
export {
|
|
52
|
-
|
|
64
|
+
t as INPUT_EVENTS,
|
|
53
65
|
n as MESSAGE_TYPES,
|
|
54
66
|
o as SIZES,
|
|
55
|
-
|
|
67
|
+
e as TRIGGER_POSITIONS
|
|
56
68
|
};
|
|
@@ -1,92 +1,82 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { resolveComponent as
|
|
3
|
-
import
|
|
4
|
-
const N = ["disabled", "placeholder", "value"], F = ["disabled", "placeholder", "value"];
|
|
5
|
-
function B(e, o,
|
|
6
|
-
const f =
|
|
7
|
-
return r(), i("div", {
|
|
8
|
-
class: s(e.classNames)
|
|
9
|
-
}, [
|
|
1
|
+
import v from "./input-range.vue2.js";
|
|
2
|
+
import { resolveComponent as a, openBlock as r, createElementBlock as i, mergeProps as d, normalizeClass as l, renderSlot as p, createCommentVNode as u, createElementVNode as s, withKeys as t, createTextVNode as k, createBlock as m, withCtx as I, createVNode as b } from "vue";
|
|
3
|
+
import g from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const N = ["disabled", "placeholder", "value", "readonly"], F = ["disabled", "placeholder", "value", "readonly"];
|
|
5
|
+
function B(e, o, $, w, E, V) {
|
|
6
|
+
const f = a("IconClose"), C = a("IconHover"), y = a("FeedbackIcon");
|
|
7
|
+
return r(), i("div", d(e.wrapperAttrs, { class: e.classNames }), [
|
|
10
8
|
e.$slots.prefix ? (r(), i("div", {
|
|
11
9
|
key: 0,
|
|
12
|
-
class:
|
|
10
|
+
class: l(e.className.element("prefix"))
|
|
13
11
|
}, [
|
|
14
|
-
|
|
15
|
-
], 2)) :
|
|
16
|
-
|
|
17
|
-
class:
|
|
12
|
+
p(e.$slots, "prefix")
|
|
13
|
+
], 2)) : u("", !0),
|
|
14
|
+
s("div", {
|
|
15
|
+
class: l(e.getInputWrapClassName(0))
|
|
18
16
|
}, [
|
|
19
|
-
|
|
20
|
-
ref: "refInput0",
|
|
17
|
+
s("input", d({ ref: "refInput0" }, e.formControlAttrs0, {
|
|
21
18
|
disabled: e.disabled0,
|
|
22
19
|
placeholder: e.placeholder[0],
|
|
23
|
-
value: e.displayValue0
|
|
24
|
-
|
|
20
|
+
value: e.displayValue0,
|
|
21
|
+
readonly: e.readonly || void 0,
|
|
25
22
|
onInput: o[0] || (o[0] = (...n) => e.onChange && e.onChange(...n)),
|
|
26
23
|
onFocus: o[1] || (o[1] = (...n) => e.onFocus && e.onFocus(...n)),
|
|
27
24
|
onBlur: o[2] || (o[2] = (...n) => e.onBlur && e.onBlur(...n)),
|
|
28
|
-
onKeydown: [
|
|
29
|
-
|
|
30
|
-
o[4] || (o[4] = a((...n) => e.onPressTab && e.onPressTab(...n), ["tab"]))
|
|
31
|
-
],
|
|
32
|
-
onClick: o[5] || (o[5] = () => e.changeFocusedInput(0))
|
|
25
|
+
onKeydown: o[3] || (o[3] = t((...n) => e.onPressEnter && e.onPressEnter(...n), ["enter"])),
|
|
26
|
+
onClick: o[4] || (o[4] = () => e.changeFocusedInput(0))
|
|
33
27
|
}), null, 16, N)
|
|
34
28
|
], 2),
|
|
35
|
-
|
|
36
|
-
class:
|
|
29
|
+
s("span", {
|
|
30
|
+
class: l(e.className.element("separator"))
|
|
37
31
|
}, [
|
|
38
|
-
|
|
39
|
-
o[
|
|
32
|
+
p(e.$slots, "separator", {}, () => [
|
|
33
|
+
o[10] || (o[10] = k(" - ", -1))
|
|
40
34
|
])
|
|
41
35
|
], 2),
|
|
42
|
-
|
|
43
|
-
class:
|
|
36
|
+
s("div", {
|
|
37
|
+
class: l(e.getInputWrapClassName(1))
|
|
44
38
|
}, [
|
|
45
|
-
|
|
46
|
-
ref: "refInput1",
|
|
39
|
+
s("input", d({ ref: "refInput1" }, e.formControlAttrs1, {
|
|
47
40
|
disabled: e.disabled1,
|
|
48
41
|
placeholder: e.placeholder[1],
|
|
49
|
-
value: e.displayValue1
|
|
50
|
-
|
|
51
|
-
onInput: o[
|
|
52
|
-
onFocus: o[
|
|
53
|
-
onBlur: o[
|
|
54
|
-
onKeydown: [
|
|
55
|
-
|
|
56
|
-
o[10] || (o[10] = a((...n) => e.onPressTab && e.onPressTab(...n), ["tab"]))
|
|
57
|
-
],
|
|
58
|
-
onClick: o[11] || (o[11] = () => e.changeFocusedInput(1))
|
|
42
|
+
value: e.displayValue1,
|
|
43
|
+
readonly: e.readonly || void 0,
|
|
44
|
+
onInput: o[5] || (o[5] = (...n) => e.onChange && e.onChange(...n)),
|
|
45
|
+
onFocus: o[6] || (o[6] = (...n) => e.onFocus && e.onFocus(...n)),
|
|
46
|
+
onBlur: o[7] || (o[7] = (...n) => e.onBlur && e.onBlur(...n)),
|
|
47
|
+
onKeydown: o[8] || (o[8] = t((...n) => e.onPressEnter && e.onPressEnter(...n), ["enter"])),
|
|
48
|
+
onClick: o[9] || (o[9] = () => e.changeFocusedInput(1))
|
|
59
49
|
}), null, 16, F)
|
|
60
50
|
], 2),
|
|
61
|
-
|
|
62
|
-
class:
|
|
51
|
+
s("div", {
|
|
52
|
+
class: l(e.className.element("suffix"))
|
|
63
53
|
}, [
|
|
64
|
-
e.allowClear && !e.mergedDisabled && (e.value[0] || e.value[1]) ? (r(), m(
|
|
54
|
+
e.allowClear && !e.mergedDisabled && (e.value[0] || e.value[1]) ? (r(), m(C, {
|
|
65
55
|
key: 0,
|
|
66
56
|
as: "button",
|
|
67
57
|
"aria-label": e.t("common.clearTarget", { target: e.t(e.clearTargetKey) }),
|
|
68
58
|
prefix: "picker",
|
|
69
|
-
class:
|
|
59
|
+
class: l(e.className.element("clear-icon")),
|
|
70
60
|
onClick: e.onClear
|
|
71
61
|
}, {
|
|
72
62
|
default: I(() => [
|
|
73
|
-
|
|
63
|
+
b(f)
|
|
74
64
|
]),
|
|
75
65
|
_: 1
|
|
76
|
-
}, 8, ["aria-label", "class", "onClick"])) :
|
|
77
|
-
|
|
78
|
-
class:
|
|
66
|
+
}, 8, ["aria-label", "class", "onClick"])) : u("", !0),
|
|
67
|
+
s("span", {
|
|
68
|
+
class: l(e.className.element("suffix-icon"))
|
|
79
69
|
}, [
|
|
80
|
-
|
|
70
|
+
p(e.$slots, "suffix-icon")
|
|
81
71
|
], 2),
|
|
82
|
-
e.feedback ? (r(), m(
|
|
72
|
+
e.feedback ? (r(), m(y, {
|
|
83
73
|
key: 1,
|
|
84
74
|
type: e.feedback
|
|
85
|
-
}, null, 8, ["type"])) :
|
|
75
|
+
}, null, 8, ["type"])) : u("", !0)
|
|
86
76
|
], 2)
|
|
87
|
-
],
|
|
77
|
+
], 16);
|
|
88
78
|
}
|
|
89
|
-
const
|
|
79
|
+
const T = /* @__PURE__ */ g(v, [["render", B]]);
|
|
90
80
|
export {
|
|
91
|
-
|
|
81
|
+
T as default
|
|
92
82
|
};
|
|
@@ -1,18 +1,22 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { isNumber as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { useFormItem as
|
|
7
|
-
import { useLocale as
|
|
8
|
-
import { useSize as
|
|
9
|
-
import {
|
|
10
|
-
|
|
1
|
+
import { defineComponent as J, toRefs as Q, computed as i, ref as x } from "vue";
|
|
2
|
+
import X from "../feedback-icon/index.vue.js";
|
|
3
|
+
import { isNumber as Y, isUndefined as Z, isArray as ee, isDayjs as re, isFunction as oe } from "../../../_utils/is.js";
|
|
4
|
+
import te from "../../../icons/default/close-circle-fill.js";
|
|
5
|
+
import ae from "../icon-hover/index.vue.js";
|
|
6
|
+
import { useFormItem as ne, useFormItemControl as N } from "../../../_hooks/use-form-item.js";
|
|
7
|
+
import { useLocale as ie } from "../../../locale/index.js";
|
|
8
|
+
import { useSize as se } from "../../../_hooks/use-size.js";
|
|
9
|
+
import { INPUT_EVENTS as F } from "../../../_utils/constant.js";
|
|
10
|
+
import le from "../../../_utils/pick.js";
|
|
11
|
+
import { omit as ue } from "../../../_utils/omit.js";
|
|
12
|
+
import { getClassNameMixin as ce } from "../../../_utils/config.js";
|
|
13
|
+
const xe = J({
|
|
11
14
|
name: "DateInputRange",
|
|
15
|
+
inheritAttrs: !1,
|
|
12
16
|
components: {
|
|
13
|
-
IconHover:
|
|
14
|
-
IconClose:
|
|
15
|
-
FeedbackIcon:
|
|
17
|
+
IconHover: ae,
|
|
18
|
+
IconClose: te,
|
|
19
|
+
FeedbackIcon: X
|
|
16
20
|
},
|
|
17
21
|
props: {
|
|
18
22
|
size: {
|
|
@@ -69,95 +73,126 @@ const ce = K({
|
|
|
69
73
|
"focus",
|
|
70
74
|
"blur"
|
|
71
75
|
],
|
|
72
|
-
setup(
|
|
73
|
-
const { t:
|
|
76
|
+
setup(a, { emit: r, slots: s, attrs: o }) {
|
|
77
|
+
const { t: S } = ie(), {
|
|
78
|
+
error: z,
|
|
79
|
+
focused: E,
|
|
80
|
+
disabled: u,
|
|
81
|
+
size: B,
|
|
82
|
+
value: c,
|
|
83
|
+
format: f,
|
|
84
|
+
focusedIndex: d,
|
|
85
|
+
inputValue: n,
|
|
86
|
+
placeholder: g
|
|
87
|
+
} = Q(a), {
|
|
88
|
+
formItemCtx: b,
|
|
74
89
|
mergedSize: D,
|
|
75
|
-
mergedDisabled:
|
|
76
|
-
mergedError:
|
|
77
|
-
feedback:
|
|
78
|
-
} =
|
|
79
|
-
|
|
80
|
-
o.
|
|
81
|
-
|
|
90
|
+
mergedDisabled: m,
|
|
91
|
+
mergedError: $,
|
|
92
|
+
feedback: j
|
|
93
|
+
} = ne({ size: B, error: z }), { mergedSize: k } = se(D), _ = i(() => ue(o, [
|
|
94
|
+
...F,
|
|
95
|
+
...Object.keys(o).filter((e) => e.startsWith("aria-") || e === "role")
|
|
96
|
+
])), v = () => ({
|
|
97
|
+
...le(o, F),
|
|
98
|
+
...Object.fromEntries(
|
|
99
|
+
Object.entries(o).filter(([e]) => e.startsWith("aria-") || e === "role")
|
|
100
|
+
)
|
|
101
|
+
}), O = N(b, () => {
|
|
102
|
+
var e;
|
|
103
|
+
return {
|
|
104
|
+
...v(),
|
|
105
|
+
"aria-label": o["aria-label"] ? `${o["aria-label"]} ${((e = g.value) == null ? void 0 : e[0]) ?? ""}` : void 0
|
|
106
|
+
};
|
|
107
|
+
}), P = N(b, () => {
|
|
108
|
+
var e;
|
|
109
|
+
return {
|
|
110
|
+
...v(),
|
|
111
|
+
id: o.id ? `${o.id}-end` : void 0,
|
|
112
|
+
"aria-label": o["aria-label"] ? `${o["aria-label"]} ${((e = g.value) == null ? void 0 : e[1]) ?? ""}` : void 0
|
|
113
|
+
};
|
|
114
|
+
}), R = x(), T = x(), p = (e) => m.value ? m.value : ee(u.value) ? u.value[e] : u.value, y = i(() => p(0)), I = i(() => p(1)), t = ce("picker"), V = i(() => [
|
|
115
|
+
t.block,
|
|
116
|
+
t.modifier("range"),
|
|
117
|
+
t.modifier(`size-${k.value}`),
|
|
82
118
|
{
|
|
83
|
-
[
|
|
84
|
-
[
|
|
85
|
-
[
|
|
86
|
-
[
|
|
119
|
+
[t.modifier("focused")]: E.value,
|
|
120
|
+
[t.modifier("disabled")]: y.value && I.value,
|
|
121
|
+
[t.modifier("error")]: $.value,
|
|
122
|
+
[t.modifier("has-prefix")]: s.prefix
|
|
87
123
|
}
|
|
88
124
|
]);
|
|
89
|
-
function
|
|
125
|
+
function W(e) {
|
|
90
126
|
return [
|
|
91
|
-
|
|
127
|
+
t.element("input"),
|
|
92
128
|
{
|
|
93
|
-
[
|
|
129
|
+
[t.element("input-active")]: e === (d == null ? void 0 : d.value)
|
|
94
130
|
}
|
|
95
131
|
];
|
|
96
132
|
}
|
|
97
|
-
function
|
|
98
|
-
var
|
|
133
|
+
function h(e) {
|
|
134
|
+
var C, A;
|
|
99
135
|
if (n != null && n.value)
|
|
100
|
-
return (
|
|
101
|
-
const
|
|
102
|
-
if (
|
|
103
|
-
return
|
|
136
|
+
return (C = n == null ? void 0 : n.value) == null ? void 0 : C[e];
|
|
137
|
+
const l = (A = c == null ? void 0 : c.value) == null ? void 0 : A[e];
|
|
138
|
+
if (l && re(l))
|
|
139
|
+
return oe(f.value) ? f.value(l) : l.format(f.value);
|
|
104
140
|
}
|
|
105
|
-
const
|
|
106
|
-
function
|
|
141
|
+
const w = i(() => h(0)), U = i(() => h(1));
|
|
142
|
+
function q(e) {
|
|
107
143
|
r("focused-index-change", e), r("update:focusedIndex", e);
|
|
108
144
|
}
|
|
109
|
-
function
|
|
145
|
+
function H(e) {
|
|
110
146
|
e.stopPropagation(), r("change", e);
|
|
111
147
|
}
|
|
112
|
-
function
|
|
148
|
+
function K() {
|
|
113
149
|
r("press-enter");
|
|
114
150
|
}
|
|
115
|
-
function
|
|
151
|
+
function L(e) {
|
|
116
152
|
r("focus", e);
|
|
117
153
|
}
|
|
118
|
-
function
|
|
154
|
+
function M(e) {
|
|
119
155
|
r("blur", e);
|
|
120
156
|
}
|
|
121
|
-
function
|
|
122
|
-
e.preventDefault();
|
|
123
|
-
}
|
|
124
|
-
function H(e) {
|
|
157
|
+
function G(e) {
|
|
125
158
|
r("clear", e);
|
|
126
159
|
}
|
|
127
160
|
return {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
161
|
+
wrapperAttrs: _,
|
|
162
|
+
formControlAttrs0: O,
|
|
163
|
+
formControlAttrs1: P,
|
|
164
|
+
t: S,
|
|
165
|
+
className: t,
|
|
166
|
+
classNames: V,
|
|
167
|
+
refInput0: R,
|
|
168
|
+
refInput1: T,
|
|
169
|
+
disabled0: y,
|
|
170
|
+
disabled1: I,
|
|
171
|
+
mergedDisabled: m,
|
|
136
172
|
getDisabled: p,
|
|
137
|
-
getInputWrapClassName:
|
|
138
|
-
displayValue0:
|
|
139
|
-
displayValue1:
|
|
140
|
-
changeFocusedInput:
|
|
141
|
-
onChange:
|
|
142
|
-
onFocus:
|
|
143
|
-
onBlur:
|
|
144
|
-
onPressEnter:
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
feedback: S
|
|
173
|
+
getInputWrapClassName: W,
|
|
174
|
+
displayValue0: w,
|
|
175
|
+
displayValue1: U,
|
|
176
|
+
changeFocusedInput: q,
|
|
177
|
+
onChange: H,
|
|
178
|
+
onFocus: L,
|
|
179
|
+
onBlur: M,
|
|
180
|
+
onPressEnter: K,
|
|
181
|
+
onClear: G,
|
|
182
|
+
feedback: j
|
|
148
183
|
};
|
|
149
184
|
},
|
|
150
185
|
methods: {
|
|
151
|
-
focus(
|
|
152
|
-
const r =
|
|
153
|
-
!
|
|
186
|
+
focus(a) {
|
|
187
|
+
const r = Y(a) ? a : this.focusedIndex, s = r === 0 ? this.refInput0 : this.refInput1;
|
|
188
|
+
!Z(r) && !this.getDisabled(r) && s && s.focus && s.focus();
|
|
154
189
|
},
|
|
155
190
|
blur() {
|
|
156
|
-
const
|
|
157
|
-
|
|
191
|
+
const a = this.focusedIndex === 0 ? this.refInput0 : this.refInput1;
|
|
192
|
+
a && a.blur && a.blur();
|
|
158
193
|
}
|
|
159
194
|
}
|
|
160
195
|
});
|
|
161
196
|
export {
|
|
162
|
-
|
|
197
|
+
xe as default
|
|
163
198
|
};
|
|
@@ -1,29 +1,26 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { resolveComponent as r, openBlock as n, createElementBlock as
|
|
1
|
+
import k from "./input.vue2.js";
|
|
2
|
+
import { resolveComponent as r, openBlock as n, createElementBlock as i, mergeProps as m, normalizeClass as l, renderSlot as d, createCommentVNode as t, createElementVNode as a, withKeys as y, createBlock as p, withCtx as C, createVNode as b } from "vue";
|
|
3
3
|
import N from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const v = ["disabled", "placeholder", "value"];
|
|
5
|
-
function I(e, o, g, $, B,
|
|
6
|
-
const
|
|
7
|
-
return n(),
|
|
8
|
-
|
|
9
|
-
}, [
|
|
10
|
-
e.$slots.prefix ? (n(), t("div", {
|
|
4
|
+
const v = ["disabled", "placeholder", "value", "readonly"];
|
|
5
|
+
function I(e, o, g, $, B, w) {
|
|
6
|
+
const u = r("IconClose"), f = r("IconHover"), c = r("FeedbackIcon");
|
|
7
|
+
return n(), i("div", m(e.wrapperAttrs, { class: e.classNames }), [
|
|
8
|
+
e.$slots.prefix ? (n(), i("div", {
|
|
11
9
|
key: 0,
|
|
12
10
|
class: l(e.className.element("prefix"))
|
|
13
11
|
}, [
|
|
14
|
-
|
|
15
|
-
], 2)) :
|
|
12
|
+
d(e.$slots, "prefix")
|
|
13
|
+
], 2)) : t("", !0),
|
|
16
14
|
a("div", {
|
|
17
15
|
class: l(e.className.element("input"))
|
|
18
16
|
}, [
|
|
19
|
-
a("input",
|
|
20
|
-
ref: "refInput",
|
|
17
|
+
a("input", m({ ref: "refInput" }, e.formControlAttrs, {
|
|
21
18
|
disabled: e.mergedDisabled,
|
|
22
19
|
placeholder: e.placeholder,
|
|
23
20
|
class: e.className.element("start-time"),
|
|
24
|
-
value: e.displayValue
|
|
25
|
-
|
|
26
|
-
onKeydown: o[0] || (o[0] =
|
|
21
|
+
value: e.displayValue,
|
|
22
|
+
readonly: e.readonly || void 0,
|
|
23
|
+
onKeydown: o[0] || (o[0] = y((...s) => e.onPressEnter && e.onPressEnter(...s), ["enter"])),
|
|
27
24
|
onInput: o[1] || (o[1] = (...s) => e.onChange && e.onChange(...s)),
|
|
28
25
|
onFocus: o[2] || (o[2] = (...s) => e.onFocus && e.onFocus(...s)),
|
|
29
26
|
onBlur: o[3] || (o[3] = (...s) => e.onBlur && e.onBlur(...s))
|
|
@@ -32,7 +29,7 @@ function I(e, o, g, $, B, F) {
|
|
|
32
29
|
a("div", {
|
|
33
30
|
class: l(e.className.element("suffix"))
|
|
34
31
|
}, [
|
|
35
|
-
e.allowClear && !e.mergedDisabled && e.displayValue ? (n(),
|
|
32
|
+
e.allowClear && !e.mergedDisabled && e.displayValue ? (n(), p(f, {
|
|
36
33
|
key: 0,
|
|
37
34
|
as: "button",
|
|
38
35
|
"aria-label": e.t("common.clearTarget", { target: e.t(e.clearTargetKey) }),
|
|
@@ -40,24 +37,24 @@ function I(e, o, g, $, B, F) {
|
|
|
40
37
|
class: l(e.className.element("clear-icon")),
|
|
41
38
|
onClick: e.onClear
|
|
42
39
|
}, {
|
|
43
|
-
default:
|
|
44
|
-
|
|
40
|
+
default: C(() => [
|
|
41
|
+
b(u)
|
|
45
42
|
]),
|
|
46
43
|
_: 1
|
|
47
|
-
}, 8, ["aria-label", "prefix", "class", "onClick"])) :
|
|
44
|
+
}, 8, ["aria-label", "prefix", "class", "onClick"])) : t("", !0),
|
|
48
45
|
a("span", {
|
|
49
46
|
class: l(e.className.element("suffix-icon"))
|
|
50
47
|
}, [
|
|
51
|
-
|
|
48
|
+
d(e.$slots, "suffix-icon")
|
|
52
49
|
], 2),
|
|
53
|
-
e.feedback ? (n(),
|
|
50
|
+
e.feedback ? (n(), p(c, {
|
|
54
51
|
key: 1,
|
|
55
52
|
type: e.feedback
|
|
56
|
-
}, null, 8, ["type"])) :
|
|
53
|
+
}, null, 8, ["type"])) : t("", !0)
|
|
57
54
|
], 2)
|
|
58
|
-
],
|
|
55
|
+
], 16);
|
|
59
56
|
}
|
|
60
|
-
const D = /* @__PURE__ */ N(
|
|
57
|
+
const D = /* @__PURE__ */ N(k, [["render", I]]);
|
|
61
58
|
export {
|
|
62
59
|
D as default
|
|
63
60
|
};
|