@opentiny/vue-renderless 3.13.2 → 3.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/action-sheet/index.js +20 -13
- package/action-sheet/vue.js +8 -7
- package/amount/index.js +100 -25
- package/amount/vue.js +102 -26
- package/anchor/index.js +1 -0
- package/area/index.js +8 -8
- package/area/vue.js +5 -5
- package/async-flowchart/index.js +16 -3
- package/autocomplete/index.js +58 -14
- package/autocomplete/vue.js +40 -12
- package/badge/index.js +12 -0
- package/badge/vue.js +6 -4
- package/breadcrumb/vue.js +3 -1
- package/breadcrumb-item/vue.js +6 -2
- package/button/index.js +5 -1
- package/calendar/index.js +2 -86
- package/calendar-bar/index.js +18 -4
- package/calendar-view/index.js +5 -1
- package/calendar-view/vue.js +16 -3
- package/card-group/vue.js +4 -2
- package/cascader/index.js +86 -34
- package/cascader/vue.js +61 -20
- package/cascader-menu/index.js +7 -7
- package/cascader-menu/vue.js +2 -3
- package/cascader-mobile/index.js +36 -23
- package/cascader-mobile/vue.js +6 -0
- package/cascader-node/index.js +13 -1
- package/cascader-node/vue.js +15 -4
- package/cascader-panel/index.js +1 -1
- package/cascader-select/column-index.js +150 -0
- package/cascader-select/column.js +120 -0
- package/cascader-select/index.js +29 -165
- package/cascader-select/usePicker.js +251 -0
- package/cascader-select/useTouch.js +65 -0
- package/cascader-select/vue.js +35 -47
- package/cell/vue.js +2 -1
- package/chart-bar/index.js +2 -3
- package/chart-core/deps/constants.js +43 -43
- package/chart-core/index.js +1 -1
- package/chart-gauge/index.js +2 -2
- package/chart-heatmap/index.js +17 -10
- package/chart-line/index.js +8 -9
- package/chart-tree/index.js +2 -2
- package/chart-waterfall/index.js +4 -6
- package/checkbox/index.js +18 -1
- package/checkbox/vue.js +15 -7
- package/checkbox-group/vue.js +1 -0
- package/col/vue.js +1 -1
- package/collapse/index.js +3 -3
- package/color-select-panel/vue.js +0 -7
- package/column-list-item/index.js +17 -1
- package/column-list-item/vue.js +8 -3
- package/common/bigInt.js +2 -2
- package/common/date.js +7 -5
- package/common/deps/clickoutside.js +6 -2
- package/common/deps/date-util.js +4 -2
- package/common/deps/dom.js +19 -4
- package/common/deps/popper.js +44 -11
- package/common/deps/resize-event.js +1 -0
- package/common/deps/touch-emulator.js +4 -1
- package/common/deps/tree-model/node.js +2 -2
- package/common/deps/tree-model/tree-store.js +2 -13
- package/common/deps/useRect.js +25 -0
- package/common/deps/vue-popper.js +38 -20
- package/common/index.js +2 -2
- package/common/runtime.js +1 -1
- package/common/string.js +2 -2
- package/common/type.js +2 -1
- package/common/validate/rules/enum.js +1 -1
- package/common/validate/rules/pattern.js +2 -2
- package/common/validate/rules/range.js +8 -5
- package/common/validate/rules/required.js +1 -1
- package/common/validate/rules/type.js +5 -5
- package/common/validate/rules/whitespace.js +1 -1
- package/common/validate/util.js +15 -16
- package/common/validate/validations/integer.js +1 -1
- package/common/validate/validations/method.js +1 -1
- package/currency/index.js +74 -7
- package/currency/vue.js +21 -5
- package/date-panel/index.js +16 -0
- package/date-panel/vue.js +8 -2
- package/date-picker-mobile/index.js +12 -0
- package/date-picker-mobile/vue.js +7 -1
- package/date-range/vue.js +15 -6
- package/date-table/index.js +35 -53
- package/date-table/vue.js +4 -2
- package/dialog-box/index.js +46 -14
- package/dialog-box/vue.js +30 -7
- package/dialog-select/index.js +6 -3
- package/dialog-select/vue.js +8 -4
- package/drawer/index.js +27 -5
- package/drawer/vue.js +14 -7
- package/dropdown/index.js +7 -7
- package/dropdown/vue.js +6 -2
- package/dropdown-item/index.js +9 -1
- package/dropdown-item/mf.js +6 -10
- package/dropdown-item/vue.js +20 -7
- package/dropdown-menu/index.js +20 -7
- package/dropdown-menu/vue.js +4 -3
- package/exception/index.js +2 -7
- package/exception/vue.js +7 -10
- package/fall-menu/index.js +5 -1
- package/fall-menu/vue.js +13 -2
- package/file-upload/index.js +68 -18
- package/file-upload/vue.js +38 -8
- package/filter-box/index.js +1 -0
- package/float-button/index.js +42 -0
- package/float-button/vue.js +101 -0
- package/floating-button/index.js +62 -16
- package/floating-button/vue.js +27 -9
- package/flowchart/index.js +134 -25
- package/flowchart/node.js +13 -4
- package/flowchart/vue.js +16 -4
- package/form/vue.js +8 -0
- package/form-item/index.js +5 -5
- package/form-item/vue.js +3 -1
- package/fullscreen/index.js +5 -5
- package/fullscreen/vue.js +3 -3
- package/grid/plugins/export.js +5 -2
- package/grid/utils/column.js +1 -0
- package/grid/utils/dom.js +7 -1
- package/image/index.js +6 -1
- package/image/vue.js +6 -3
- package/image-viewer/index.js +62 -51
- package/image-viewer/vue.js +17 -5
- package/input/index.js +81 -20
- package/input/vue.js +44 -18
- package/ip-address/index.js +61 -19
- package/ip-address/vue.js +22 -4
- package/link/vue.js +3 -1
- package/loading/index.js +2 -2
- package/loading/vue.js +8 -2
- package/logout/index.js +1 -1
- package/menu/index.js +15 -2
- package/menu/vue.js +22 -17
- package/mind-map/index.js +47 -0
- package/mind-map/vue.js +53 -0
- package/modal/index.js +44 -4
- package/modal/vue.js +18 -4
- package/multi-select/index.js +186 -11
- package/multi-select/vue.js +60 -15
- package/multi-select-item/index.js +23 -0
- package/multi-select-item/vue.js +31 -0
- package/numeric/index.js +48 -12
- package/numeric/vue.js +44 -19
- package/option/index.js +27 -9
- package/option/vue.js +37 -21
- package/option-group/index.js +3 -3
- package/package.json +1 -1
- package/pager/index.js +18 -4
- package/pager/vue.js +16 -5
- package/picker/index.js +290 -77
- package/picker/mb.js +42 -0
- package/picker/vue.js +76 -20
- package/picker-column/index.js +1 -1
- package/pop-upload/vue.js +3 -0
- package/popconfirm/index.js +3 -6
- package/popconfirm/vue.js +1 -1
- package/popeditor/index.js +73 -34
- package/popeditor/vue.js +15 -11
- package/popover/index.js +4 -4
- package/popover/vue.js +6 -6
- package/popup/index.js +3 -3
- package/popup/vue.js +5 -5
- package/pull-refresh/index.js +13 -13
- package/pull-refresh/vue.js +5 -4
- package/radio/index.js +0 -17
- package/radio/vue.js +4 -10
- package/rate/index.js +1 -1
- package/rate/vue.js +0 -2
- package/record/index.js +4 -1
- package/rich-text/clipboard.js +54 -0
- package/rich-text/index.js +192 -0
- package/rich-text/module/file-upload.js +107 -0
- package/rich-text/module/image-drop.js +63 -0
- package/rich-text/module/image-upload.js +89 -0
- package/rich-text/options.js +141 -0
- package/rich-text/table-module.js +382 -0
- package/rich-text/vue.js +102 -0
- package/{rich-text-edtior → rich-text-editor}/index.js +2 -2
- package/{rich-text-edtior → rich-text-editor}/vue.js +2 -5
- package/scrollbar/index.js +11 -11
- package/scrollbar/vue-bar.js +3 -3
- package/scrollbar/vue.js +5 -5
- package/search/index.js +9 -9
- package/search/vue.js +8 -6
- package/select/index.js +442 -393
- package/select/vue.js +278 -164
- package/select-dropdown/index.js +61 -3
- package/select-dropdown/vue.js +85 -8
- package/select-view/index.js +3 -1
- package/selected-box/index.js +2 -0
- package/selected-box/vue.js +6 -3
- package/signature/index.js +241 -0
- package/signature/vue.js +88 -0
- package/skeleton/index.js +14 -0
- package/skeleton/vue.js +15 -0
- package/skeleton-item/vue.js +15 -0
- package/slider/index.js +70 -17
- package/slider/vue.js +16 -7
- package/split/index.js +5 -3
- package/split/vue.js +4 -6
- package/standard-list-item/index.js +15 -1
- package/standard-list-item/vue.js +6 -5
- package/steps/index.js +25 -2
- package/steps/slide-bar.js +8 -1
- package/steps/vue.js +15 -3
- package/tab-item-mf/vue.js +14 -8
- package/tab-nav/index.js +30 -5
- package/tab-nav/vue.js +16 -4
- package/tabbar/vue.js +9 -3
- package/tabbar-item/vue.js +3 -2
- package/tabs/index.js +16 -4
- package/tabs/vue.js +2 -1
- package/tabs-mf/index.js +20 -6
- package/tabs-mf/vue-nav.js +26 -11
- package/tabs-mf/vue.js +7 -7
- package/tabs-mf/wheel.js +1 -0
- package/tag/index.js +1 -1
- package/tag-group/index.js +2 -1
- package/time/index.js +5 -2
- package/time/vue.js +1 -1
- package/time-line/index.js +3 -3
- package/time-line/vue.js +2 -2
- package/time-picker-mobile/index.js +24 -5
- package/time-picker-mobile/vue.js +17 -7
- package/time-range/index.js +2 -0
- package/timeline-item/vue.js +1 -1
- package/tooltip/index.js +6 -3
- package/tooltip/vue.js +4 -4
- package/transfer/index.js +20 -22
- package/transfer/vue.js +1 -6
- package/transfer-panel/vue.js +3 -5
- package/tree/index.js +21 -4
- package/tree/vue.js +10 -8
- package/tree-menu/index.js +29 -3
- package/tree-menu/vue.js +28 -15
- package/tree-node/index.js +18 -18
- package/tree-node/vue.js +6 -5
- package/types/action-sheet.type.d.ts +118 -1
- package/types/amount.type.d.ts +168 -1
- package/types/area.type.d.ts +134 -1
- package/types/async-flowchart.type.d.ts +72 -0
- package/types/autocomplete.type.d.ts +199 -1
- package/types/badge.type.d.ts +3 -1
- package/types/breadcrumb-item.type.d.ts +2 -0
- package/types/breadcrumb.type.d.ts +2 -0
- package/types/button-group.type.d.ts +3 -3
- package/types/button.type.d.ts +4 -0
- package/types/cascader-menu.type.d.ts +3 -4
- package/types/cascader-node.type.d.ts +5 -2
- package/types/cascader-panel.type-2bd03be3.d.ts +241 -0
- package/types/cascader-panel.type.d.ts +3 -241
- package/types/cascader.type.d.ts +329 -1
- package/types/checkbox.type.d.ts +6 -0
- package/types/collapse.type.d.ts +19 -2
- package/types/date-picker.type.d.ts +38 -1
- package/types/dialog-box.type.d.ts +13 -3
- package/types/drawer.type.d.ts +133 -1
- package/types/{dropdown-item.type-8ea6c633.d.ts → dropdown-item.type-8475a549.d.ts} +7 -13
- package/types/dropdown-item.type.d.ts +1 -1
- package/types/dropdown-menu.type.d.ts +1 -1
- package/types/dropdown.type.d.ts +1 -5
- package/types/fall-menu.type.d.ts +94 -1
- package/types/file-upload.type.d.ts +1 -1
- package/types/float-button.type.d.ts +123 -0
- package/types/form-item.type.d.ts +1 -1
- package/types/{form.type-d0fd42f3.d.ts → form.type-a2dc0099.d.ts} +4 -1
- package/types/form.type.d.ts +1 -1
- package/types/{index-e0250f63.d.ts → index-b012f687.d.ts} +9 -0
- package/types/input.type.d.ts +2 -6
- package/types/ip-address.type.d.ts +160 -1
- package/types/link.type.d.ts +6 -3
- package/types/loading.type.d.ts +7 -0
- package/types/mind-map.type.d.ts +20 -0
- package/types/modal.type.d.ts +29 -2
- package/types/numeric.type.d.ts +41 -10
- package/types/pager.type.d.ts +12 -0
- package/types/picker.type.d.ts +18 -0
- package/types/popconfirm.type.d.ts +86 -1
- package/types/popeditor.type.d.ts +4 -0
- package/types/popover.type.d.ts +3 -3
- package/types/progress.type.d.ts +2 -0
- package/types/radio.type.d.ts +0 -4
- package/types/rate.type.d.ts +236 -1
- package/types/search.type.d.ts +88 -1
- package/types/shared.type.d.ts +1 -1
- package/types/skeleton-item.type.d.ts +38 -0
- package/types/skeleton.type.d.ts +45 -0
- package/types/slider.type.d.ts +49 -10
- package/types/steps.type.d.ts +14 -3
- package/types/tab-bar.type.d.ts +1 -1
- package/types/tab-nav.type.d.ts +7 -2
- package/types/tabs.type.d.ts +9 -1
- package/types/tag-group.type.d.ts +64 -1
- package/types/{time-line.type-d7daa669.d.ts → time-line.type-b155cb4f.d.ts} +12 -0
- package/types/time-line.type.d.ts +1 -1
- package/types/timeline-item.type.d.ts +1 -1
- package/types/tooltip.type.d.ts +2 -2
- package/types/transfer.type.d.ts +185 -1
- package/types/tree-menu.type.d.ts +210 -1
- package/types/upload-dragger.type.d.ts +1 -1
- package/types/{upload-list.type-343e8c11.d.ts → upload-list.type-6d6e3d0e.d.ts} +35 -8
- package/types/upload-list.type.d.ts +1 -1
- package/types/upload.type.d.ts +1 -1
- package/types/user-head.type.d.ts +146 -1
- package/types/wizard.type.d.ts +1 -0
- package/upload/index.js +64 -34
- package/upload/vue.js +9 -5
- package/upload-dragger/index.js +22 -20
- package/upload-list/index.js +24 -18
- package/upload-list/vue.js +9 -4
- package/user/index.js +35 -26
- package/user/vue.js +1 -1
- package/user-head/index.js +3 -3
- package/watermark/index.js +11 -0
- package/wheel/index.js +3 -0
- package/wizard/vue.js +4 -2
- package/common/deps/modal-queue.js +0 -6
- package/common/deps/requestAnimationFrame.js +0 -25
package/autocomplete/index.js
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import "../chunk-G2ADBYYC.js";
|
|
2
|
-
const getData = ({
|
|
2
|
+
const getData = ({
|
|
3
|
+
props,
|
|
4
|
+
state,
|
|
5
|
+
updatePopper,
|
|
6
|
+
nextTick
|
|
7
|
+
}) => (queryString) => {
|
|
8
|
+
var _a;
|
|
3
9
|
if (state.suggestionDisabled) {
|
|
4
10
|
return;
|
|
5
11
|
}
|
|
6
12
|
state.loading = true;
|
|
7
|
-
props.fetchSuggestions(queryString, (suggestions) => {
|
|
13
|
+
(_a = props == null ? void 0 : props.fetchSuggestions) == null ? void 0 : _a.call(props, queryString, (suggestions) => {
|
|
8
14
|
state.loading = false;
|
|
9
15
|
if (state.suggestionDisabled) {
|
|
10
16
|
return;
|
|
@@ -18,7 +24,12 @@ const getData = ({ props, state, updatePopper, nextTick }) => (queryString) => {
|
|
|
18
24
|
nextTick(updatePopper);
|
|
19
25
|
});
|
|
20
26
|
};
|
|
21
|
-
const handleChange = ({
|
|
27
|
+
const handleChange = ({
|
|
28
|
+
api,
|
|
29
|
+
emit,
|
|
30
|
+
state,
|
|
31
|
+
props
|
|
32
|
+
}) => (value) => {
|
|
22
33
|
state.activated = true;
|
|
23
34
|
emit("update:modelValue", value);
|
|
24
35
|
state.suggestionDisabled = false;
|
|
@@ -29,10 +40,17 @@ const handleChange = ({ api, emit, state, props }) => (value) => {
|
|
|
29
40
|
}
|
|
30
41
|
api.debouncedGetData(value);
|
|
31
42
|
};
|
|
32
|
-
const handleFocus = ({
|
|
43
|
+
const handleFocus = ({
|
|
44
|
+
api,
|
|
45
|
+
emit,
|
|
46
|
+
props,
|
|
47
|
+
state
|
|
48
|
+
}) => (event) => {
|
|
33
49
|
state.activated = true;
|
|
34
50
|
emit("focus", event);
|
|
35
51
|
if (props.triggerOnFocus) {
|
|
52
|
+
state.suggestions = [];
|
|
53
|
+
state.highlightedIndex = -1;
|
|
36
54
|
state.suggestionDisabled = false;
|
|
37
55
|
api.debouncedGetData(props.modelValue);
|
|
38
56
|
}
|
|
@@ -48,7 +66,16 @@ const handleClear = ({ emit, state }) => () => {
|
|
|
48
66
|
const close = (state) => () => {
|
|
49
67
|
state.activated = false;
|
|
50
68
|
};
|
|
51
|
-
const
|
|
69
|
+
const open = (api) => () => {
|
|
70
|
+
api.handleFocus();
|
|
71
|
+
};
|
|
72
|
+
const handleKeyEnter = ({
|
|
73
|
+
api,
|
|
74
|
+
emit,
|
|
75
|
+
nextTick,
|
|
76
|
+
props,
|
|
77
|
+
state
|
|
78
|
+
}) => (event) => {
|
|
52
79
|
if (state.suggestionVisible && state.highlightedIndex >= 0 && state.highlightedIndex < state.suggestions.length) {
|
|
53
80
|
event.preventDefault();
|
|
54
81
|
api.select(state.suggestions[state.highlightedIndex]);
|
|
@@ -60,7 +87,12 @@ const handleKeyEnter = ({ api, emit, nextTick, props, state }) => (event) => {
|
|
|
60
87
|
});
|
|
61
88
|
}
|
|
62
89
|
};
|
|
63
|
-
const select = ({
|
|
90
|
+
const select = ({
|
|
91
|
+
emit,
|
|
92
|
+
nextTick,
|
|
93
|
+
props,
|
|
94
|
+
state
|
|
95
|
+
}) => (item) => {
|
|
64
96
|
emit("update:modelValue", item[props.valueKey]);
|
|
65
97
|
emit("select", item);
|
|
66
98
|
nextTick(() => {
|
|
@@ -69,7 +101,11 @@ const select = ({ emit, nextTick, props, state }) => (item) => {
|
|
|
69
101
|
state.highlightedIndex = -1;
|
|
70
102
|
});
|
|
71
103
|
};
|
|
72
|
-
const highlight = ({
|
|
104
|
+
const highlight = ({
|
|
105
|
+
constants,
|
|
106
|
+
vm,
|
|
107
|
+
state
|
|
108
|
+
}) => (index) => {
|
|
73
109
|
if (!state.suggestionVisible || state.loading) {
|
|
74
110
|
return;
|
|
75
111
|
}
|
|
@@ -80,7 +116,7 @@ const highlight = ({ constants, refs, state }) => (index) => {
|
|
|
80
116
|
if (index >= state.suggestions.length) {
|
|
81
117
|
index = state.suggestions.length - 1;
|
|
82
118
|
}
|
|
83
|
-
const suggestion = refs.popper.querySelector(constants.WARP_CLS);
|
|
119
|
+
const suggestion = vm.$refs.popper.querySelector(constants.WARP_CLS);
|
|
84
120
|
const suggestionList = suggestion.querySelectorAll(constants.ITEM_CLS);
|
|
85
121
|
let highlightItem = suggestionList[index];
|
|
86
122
|
let scrollTop = suggestion.scrollTop;
|
|
@@ -92,7 +128,7 @@ const highlight = ({ constants, refs, state }) => (index) => {
|
|
|
92
128
|
suggestion.scrollTop -= highlightItem.scrollHeight;
|
|
93
129
|
}
|
|
94
130
|
state.highlightedIndex = index;
|
|
95
|
-
let $input = refs.input.getInput();
|
|
131
|
+
let $input = vm.$refs.input.getInput();
|
|
96
132
|
$input.setAttribute("aria-activedescendant", `${state.id}-item-${state.highlightedIndex}`);
|
|
97
133
|
};
|
|
98
134
|
const computedVisible = (state) => {
|
|
@@ -100,17 +136,24 @@ const computedVisible = (state) => {
|
|
|
100
136
|
let isValidData = Array.isArray(suggestions) && suggestions.length > 0;
|
|
101
137
|
return (isValidData || state.loading) && state.activated;
|
|
102
138
|
};
|
|
103
|
-
const watchVisible = ({
|
|
104
|
-
|
|
139
|
+
const watchVisible = ({
|
|
140
|
+
suggestionState,
|
|
141
|
+
vm
|
|
142
|
+
}) => (val) => {
|
|
143
|
+
let $input = vm.$refs.input.getInput();
|
|
105
144
|
if ($input) {
|
|
106
145
|
suggestionState.dropdownWidth = $input.offsetWidth + "px";
|
|
107
146
|
suggestionState.showPopper = val;
|
|
108
147
|
}
|
|
109
148
|
};
|
|
110
|
-
const mounted = ({
|
|
111
|
-
|
|
149
|
+
const mounted = ({
|
|
150
|
+
vm,
|
|
151
|
+
state,
|
|
152
|
+
suggestionState
|
|
153
|
+
}) => () => {
|
|
154
|
+
const input = vm.$refs.input;
|
|
112
155
|
const $input = input.getInput();
|
|
113
|
-
suggestionState.popperElm = refs.popper;
|
|
156
|
+
suggestionState.popperElm = state.popperElm = vm.$refs.popper;
|
|
114
157
|
suggestionState.referenceElm = $input;
|
|
115
158
|
$input.setAttribute("role", "textbox");
|
|
116
159
|
$input.setAttribute("aria-autocomplete", "list");
|
|
@@ -128,6 +171,7 @@ export {
|
|
|
128
171
|
handleKeyEnter,
|
|
129
172
|
highlight,
|
|
130
173
|
mounted,
|
|
174
|
+
open,
|
|
131
175
|
select,
|
|
132
176
|
watchVisible
|
|
133
177
|
};
|
package/autocomplete/vue.js
CHANGED
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
handleBlur,
|
|
13
13
|
handleClear,
|
|
14
14
|
close,
|
|
15
|
+
open,
|
|
15
16
|
handleKeyEnter,
|
|
16
17
|
select,
|
|
17
18
|
highlight
|
|
@@ -23,6 +24,7 @@ const api = [
|
|
|
23
24
|
"getInput",
|
|
24
25
|
"handleChange",
|
|
25
26
|
"close",
|
|
27
|
+
"open",
|
|
26
28
|
"handleFocus",
|
|
27
29
|
"handleBlur",
|
|
28
30
|
"handleClear",
|
|
@@ -31,8 +33,15 @@ const api = [
|
|
|
31
33
|
"select",
|
|
32
34
|
"doDestroy"
|
|
33
35
|
];
|
|
34
|
-
const initState = ({
|
|
36
|
+
const initState = ({
|
|
37
|
+
reactive,
|
|
38
|
+
$prefix,
|
|
39
|
+
computed,
|
|
40
|
+
inject
|
|
41
|
+
}) => {
|
|
35
42
|
const state = reactive({
|
|
43
|
+
showAutoWidth: inject("showAutoWidth", null),
|
|
44
|
+
popperElm: null,
|
|
36
45
|
activated: false,
|
|
37
46
|
suggestions: [],
|
|
38
47
|
loading: false,
|
|
@@ -43,39 +52,57 @@ const initState = ({ reactive, $prefix, computed }) => {
|
|
|
43
52
|
});
|
|
44
53
|
return state;
|
|
45
54
|
};
|
|
46
|
-
const initSuggestionState = ({
|
|
55
|
+
const initSuggestionState = ({
|
|
56
|
+
reactive,
|
|
47
57
|
parent,
|
|
48
|
-
dropdownWidth: "",
|
|
49
58
|
showPopper,
|
|
50
59
|
popperElm,
|
|
51
60
|
referenceElm
|
|
52
|
-
})
|
|
53
|
-
|
|
61
|
+
}) => {
|
|
62
|
+
return reactive({
|
|
63
|
+
parent,
|
|
64
|
+
dropdownWidth: "",
|
|
65
|
+
showPopper,
|
|
66
|
+
popperElm,
|
|
67
|
+
referenceElm
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
const initApi = ({ api: api2, state, doDestroy, suggestionState, emit, vm, props, updatePopper, nextTick, constants }) => {
|
|
54
71
|
api2.getData = getData({ props, state, updatePopper, nextTick });
|
|
55
72
|
Object.assign(api2, {
|
|
56
73
|
state,
|
|
57
74
|
doDestroy,
|
|
58
75
|
suggestionState,
|
|
59
76
|
close: close(state),
|
|
77
|
+
open: open(api2),
|
|
60
78
|
handleBlur: handleBlur({ emit, state }),
|
|
61
|
-
mounted: mounted({
|
|
62
|
-
highlight: highlight({ constants,
|
|
79
|
+
mounted: mounted({ vm, state, suggestionState }),
|
|
80
|
+
highlight: highlight({ constants, vm, state }),
|
|
63
81
|
handleClear: handleClear({ emit, state }),
|
|
64
82
|
select: select({ emit, nextTick, props, state }),
|
|
65
|
-
watchVisible: watchVisible({ suggestionState,
|
|
83
|
+
watchVisible: watchVisible({ suggestionState, vm }),
|
|
66
84
|
handleChange: handleChange({ api: api2, emit, state, props }),
|
|
67
85
|
handleFocus: handleFocus({ api: api2, emit, props, state }),
|
|
68
86
|
handleKeyEnter: handleKeyEnter({ api: api2, emit, nextTick, props, state }),
|
|
69
87
|
debouncedGetData: debounce(props.debounce, api2.getData)
|
|
70
88
|
});
|
|
71
89
|
};
|
|
72
|
-
const renderless = (props, {
|
|
90
|
+
const renderless = (props, {
|
|
91
|
+
computed,
|
|
92
|
+
onBeforeUnmount,
|
|
93
|
+
onMounted,
|
|
94
|
+
reactive,
|
|
95
|
+
watch,
|
|
96
|
+
toRefs,
|
|
97
|
+
onDeactivated,
|
|
98
|
+
inject
|
|
99
|
+
}, { $prefix, vm, parent, emit, constants, nextTick, slots }) => {
|
|
73
100
|
const api2 = {};
|
|
74
|
-
const state = initState({ reactive, $prefix, computed });
|
|
101
|
+
const state = initState({ reactive, $prefix, computed, inject });
|
|
75
102
|
const { showPopper, popperElm, referenceElm, doDestroy, updatePopper } = userPopper({
|
|
76
103
|
reactive,
|
|
77
104
|
watch,
|
|
78
|
-
|
|
105
|
+
vm,
|
|
79
106
|
emit,
|
|
80
107
|
slots,
|
|
81
108
|
nextTick,
|
|
@@ -85,12 +112,13 @@ const renderless = (props, { computed, onBeforeUnmount, onMounted, reactive, wat
|
|
|
85
112
|
onDeactivated
|
|
86
113
|
});
|
|
87
114
|
const suggestionState = initSuggestionState({ reactive, parent, showPopper, popperElm, referenceElm });
|
|
88
|
-
initApi({ api: api2, state, doDestroy, suggestionState, emit,
|
|
115
|
+
initApi({ api: api2, state, doDestroy, suggestionState, emit, vm, props, updatePopper, nextTick, constants });
|
|
89
116
|
watch(() => state.suggestionVisible, api2.watchVisible);
|
|
90
117
|
onMounted(api2.mounted);
|
|
91
118
|
return api2;
|
|
92
119
|
};
|
|
93
120
|
export {
|
|
94
121
|
api,
|
|
122
|
+
initSuggestionState,
|
|
95
123
|
renderless
|
|
96
124
|
};
|
package/badge/index.js
CHANGED
|
@@ -6,7 +6,19 @@ const computedValueRef = ({ props }) => () => {
|
|
|
6
6
|
}
|
|
7
7
|
return typeof props.modelValue === "number" ? props.modelValue : void 0;
|
|
8
8
|
};
|
|
9
|
+
const computedTransform = ({ designConfig, props }) => () => {
|
|
10
|
+
if ((designConfig == null ? void 0 : designConfig.transform) === "unset") {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
return {
|
|
14
|
+
transform: `translate(
|
|
15
|
+
${props.offset[0]}${typeof props.offset[0] === "number" ? "px" : ""},
|
|
16
|
+
${props.offset[1]}${typeof props.offset[1] === "number" ? "px" : ""}
|
|
17
|
+
)`
|
|
18
|
+
};
|
|
19
|
+
};
|
|
9
20
|
export {
|
|
10
21
|
computedContent,
|
|
22
|
+
computedTransform,
|
|
11
23
|
computedValueRef
|
|
12
24
|
};
|
package/badge/vue.js
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
import "../chunk-G2ADBYYC.js";
|
|
2
|
-
import { computedContent, computedValueRef } from "./index";
|
|
2
|
+
import { computedContent, computedValueRef, computedTransform } from "./index";
|
|
3
3
|
import { xss } from "../common/xss";
|
|
4
4
|
const api = ["state"];
|
|
5
|
-
const renderless = (props, { computed, reactive }) => {
|
|
5
|
+
const renderless = (props, { computed, reactive }, { designConfig }) => {
|
|
6
6
|
const state = reactive({
|
|
7
7
|
isOverstep: false,
|
|
8
8
|
valueRef: computed(() => api2.computedValueRef()),
|
|
9
9
|
content: computed(() => api2.computedContent()),
|
|
10
|
-
href: computed(() => xss.filterUrl(props.href))
|
|
10
|
+
href: computed(() => xss.filterUrl(props.href)),
|
|
11
|
+
transform: computed(() => api2.computedTransform())
|
|
11
12
|
});
|
|
12
13
|
const api2 = {
|
|
13
14
|
state,
|
|
14
15
|
computedValueRef: computedValueRef({ props }),
|
|
15
|
-
computedContent: computedContent({ props, state })
|
|
16
|
+
computedContent: computedContent({ props, state }),
|
|
17
|
+
computedTransform: computedTransform({ props, designConfig })
|
|
16
18
|
};
|
|
17
19
|
return api2;
|
|
18
20
|
};
|
package/breadcrumb/vue.js
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import "../chunk-G2ADBYYC.js";
|
|
2
2
|
import { breadcrumbItemSelect } from "./index";
|
|
3
|
-
const api = ["breadcrumbItemSelect"];
|
|
3
|
+
const api = ["breadcrumbItemSelect", "state"];
|
|
4
4
|
const renderless = (props, { reactive, provide }, { emit, constants, emitter }) => {
|
|
5
5
|
const state = reactive({
|
|
6
6
|
breadcrumbEmitter: emitter(),
|
|
7
|
+
size: props.size,
|
|
7
8
|
currentBreadcrumbItem: {}
|
|
8
9
|
});
|
|
9
10
|
const api2 = {
|
|
10
11
|
state,
|
|
11
12
|
breadcrumbItemSelect: () => breadcrumbItemSelect({ api: api2, emit, state, constants })
|
|
12
13
|
};
|
|
14
|
+
provide("size", state.size);
|
|
13
15
|
provide("breadcrumbEmitter", state.breadcrumbEmitter);
|
|
14
16
|
api2.breadcrumbItemSelect();
|
|
15
17
|
return api2;
|
package/breadcrumb-item/vue.js
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import "../chunk-G2ADBYYC.js";
|
|
2
2
|
import { linkClick } from "./index";
|
|
3
|
-
const api = ["linkClick"];
|
|
4
|
-
const renderless = (props, { inject }, { refs, router, emit }) => {
|
|
3
|
+
const api = ["linkClick", "state"];
|
|
4
|
+
const renderless = (props, { reactive, inject }, { refs, router, emit }) => {
|
|
5
5
|
const breadcrumbEmitter = inject("breadcrumbEmitter");
|
|
6
6
|
const breadcrumb = inject("breadcrumb");
|
|
7
7
|
const constants = breadcrumb._constants;
|
|
8
|
+
const state = reactive({
|
|
9
|
+
size: inject("size", null)
|
|
10
|
+
});
|
|
8
11
|
const api2 = {
|
|
12
|
+
state,
|
|
9
13
|
linkClick: linkClick({ props, refs, router, emit, breadcrumbEmitter, constants })
|
|
10
14
|
};
|
|
11
15
|
return api2;
|
package/button/index.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import "../chunk-G2ADBYYC.js";
|
|
2
|
+
import { xss } from "../common";
|
|
2
3
|
const handleClick = ({ emit, props, state }) => (event) => {
|
|
3
|
-
|
|
4
|
+
const urlHref = xss.filterUrl(props.href);
|
|
5
|
+
if (urlHref) {
|
|
6
|
+
location.href = urlHref;
|
|
7
|
+
} else if (props.nativeType === "button" && props.resetTime > 0) {
|
|
4
8
|
state.disabled = true;
|
|
5
9
|
state.timer = window.setTimeout(() => {
|
|
6
10
|
state.disabled = false;
|
package/calendar/index.js
CHANGED
|
@@ -1,83 +1,6 @@
|
|
|
1
1
|
import "../chunk-G2ADBYYC.js";
|
|
2
|
-
import { isLeapYear } from "../common/date";
|
|
3
2
|
import { copyArray } from "../common/object";
|
|
4
|
-
|
|
5
|
-
const getWeek = (year, month, day) => (/* @__PURE__ */ new Date(`${year}/${month}/${day}`)).getDay();
|
|
6
|
-
const lastMonth = (year, month) => {
|
|
7
|
-
year = Number(year);
|
|
8
|
-
month = Number(month);
|
|
9
|
-
if (month === 1) {
|
|
10
|
-
year--;
|
|
11
|
-
month = 12;
|
|
12
|
-
} else {
|
|
13
|
-
month--;
|
|
14
|
-
}
|
|
15
|
-
return { year, month };
|
|
16
|
-
};
|
|
17
|
-
const nextMonth = (year, month) => {
|
|
18
|
-
year = Number(year);
|
|
19
|
-
month = Number(month);
|
|
20
|
-
if (month === 12) {
|
|
21
|
-
year++;
|
|
22
|
-
month = 1;
|
|
23
|
-
} else {
|
|
24
|
-
month++;
|
|
25
|
-
}
|
|
26
|
-
return { year, month };
|
|
27
|
-
};
|
|
28
|
-
const getCalendar = (year, month) => {
|
|
29
|
-
if (year && month && month <= 12) {
|
|
30
|
-
const days = getDays(year, month);
|
|
31
|
-
const firstWeek = getWeek(year, month, 1);
|
|
32
|
-
const lastWeek = getWeek(year, month, days);
|
|
33
|
-
const last = lastMonth(year, month);
|
|
34
|
-
const lastDays = getDays(last.year, last.month);
|
|
35
|
-
let remainDays = 0;
|
|
36
|
-
const totalDays = days + firstWeek + 7 - lastWeek - 1;
|
|
37
|
-
if (totalDays / 7 < 6 && totalDays / 7 >= 5) {
|
|
38
|
-
remainDays = 6 * 7 - totalDays;
|
|
39
|
-
}
|
|
40
|
-
return {
|
|
41
|
-
last: {
|
|
42
|
-
start: lastDays - (firstWeek - 1),
|
|
43
|
-
end: lastDays
|
|
44
|
-
},
|
|
45
|
-
current: {
|
|
46
|
-
start: 1,
|
|
47
|
-
end: days
|
|
48
|
-
},
|
|
49
|
-
next: {
|
|
50
|
-
start: 1,
|
|
51
|
-
end: 7 - lastWeek - 1 + remainDays
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
const transformArray = (array) => {
|
|
57
|
-
const result = [];
|
|
58
|
-
let index = 0;
|
|
59
|
-
if (array && array.length) {
|
|
60
|
-
const length = array.length / 7;
|
|
61
|
-
for (let i = 0; i < length; i++) {
|
|
62
|
-
result[i] = [];
|
|
63
|
-
for (let j = 0; j < 7; j++) {
|
|
64
|
-
result[i][j] = array[index++];
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
return result;
|
|
69
|
-
};
|
|
70
|
-
const parseDate = (time) => {
|
|
71
|
-
const date = new Date(time && typeof time === "number" ? time : 0);
|
|
72
|
-
return {
|
|
73
|
-
year: date.getFullYear(),
|
|
74
|
-
month: date.getMonth() + 1,
|
|
75
|
-
day: date.getDate(),
|
|
76
|
-
hours: date.getHours(),
|
|
77
|
-
minutes: date.getMinutes(),
|
|
78
|
-
seconds: date.getSeconds()
|
|
79
|
-
};
|
|
80
|
-
};
|
|
3
|
+
import { lastMonth, nextMonth, getCalendar, transformArray, parseDate } from "../common/calendar/calendar";
|
|
81
4
|
const computedCalendar = ({ state }) => () => {
|
|
82
5
|
const calendar = getCalendar(state.activeYear, state.activeMonth);
|
|
83
6
|
const result = [];
|
|
@@ -223,22 +146,15 @@ export {
|
|
|
223
146
|
computedCalendar,
|
|
224
147
|
computedEventList,
|
|
225
148
|
genMonths,
|
|
226
|
-
getCalendar,
|
|
227
149
|
getCurrentDate,
|
|
228
|
-
getDays,
|
|
229
150
|
getEventByDay,
|
|
230
151
|
getEventByMonth,
|
|
231
152
|
getTime,
|
|
232
|
-
getWeek,
|
|
233
153
|
getYearList,
|
|
234
154
|
isThisMonth,
|
|
235
155
|
isToday,
|
|
236
|
-
lastMonth,
|
|
237
|
-
nextMonth,
|
|
238
|
-
parseDate,
|
|
239
156
|
selectDay,
|
|
240
157
|
selectMonth,
|
|
241
158
|
toToday,
|
|
242
|
-
toggeModel
|
|
243
|
-
transformArray
|
|
159
|
+
toggeModel
|
|
244
160
|
};
|
package/calendar-bar/index.js
CHANGED
|
@@ -192,7 +192,7 @@ const getWeekOfDate = ({ api }) => (type, date) => {
|
|
|
192
192
|
};
|
|
193
193
|
const showWeekChange = ({ state }) => (value) => {
|
|
194
194
|
if (value) {
|
|
195
|
-
|
|
195
|
+
getWeekDatesByActiveRow(state);
|
|
196
196
|
} else {
|
|
197
197
|
state.calendarDays.forEach((date) => {
|
|
198
198
|
if (state.activeDate === date.dateStr) {
|
|
@@ -207,6 +207,13 @@ const formatDate = (date) => {
|
|
|
207
207
|
const newDate = new Date(date);
|
|
208
208
|
return newDate.getFullYear() + "-" + pad0(newDate.getMonth() + 1) + "-" + pad0(newDate.getDate());
|
|
209
209
|
};
|
|
210
|
+
const getWeekDatesByActiveRow = (state) => {
|
|
211
|
+
state.weekDates = state.calendarDays.filter((day) => day.row === state.activeRow);
|
|
212
|
+
if (!state.weekDates.length) {
|
|
213
|
+
state.activeRow = 0;
|
|
214
|
+
state.weekDates = state.calendarDays.filter((day) => day.row === state.activeRow);
|
|
215
|
+
}
|
|
216
|
+
};
|
|
210
217
|
const computedCurrentRow = (state) => () => {
|
|
211
218
|
const { calendarDays } = state;
|
|
212
219
|
if (Array.isArray(calendarDays) && calendarDays.length) {
|
|
@@ -249,10 +256,17 @@ const handleClickDay = ({ api, emit, props, state }) => (day) => {
|
|
|
249
256
|
api.getCalendarDays(day.dateStr, props.config, "next");
|
|
250
257
|
}
|
|
251
258
|
const showCalendarDays = [...state.calendarDays, ...state.weekDates];
|
|
252
|
-
|
|
259
|
+
state.activeRow = day.row;
|
|
260
|
+
showCalendarDays.forEach((date) => {
|
|
261
|
+
if (day.dateStr === date.dateStr) {
|
|
262
|
+
date.isCur = true;
|
|
263
|
+
state.activeRow = date.row;
|
|
264
|
+
} else {
|
|
265
|
+
date.isCur = false;
|
|
266
|
+
}
|
|
267
|
+
});
|
|
253
268
|
state.activeDate = day.dateStr;
|
|
254
269
|
state.currentDate = day.dateArr[2];
|
|
255
|
-
state.activeRow = day.row;
|
|
256
270
|
emit("update:modelValue", day.dateStr);
|
|
257
271
|
}
|
|
258
272
|
};
|
|
@@ -368,7 +382,7 @@ const handleCascaderChange = ({ api, emit, props, state }) => (val) => {
|
|
|
368
382
|
api.getCalendarDays(dateStr, props.config, "last");
|
|
369
383
|
api.getCalendarDays(dateStr, props.config, "next");
|
|
370
384
|
emit("update:modelValue", dateStr);
|
|
371
|
-
|
|
385
|
+
getWeekDatesByActiveRow(state);
|
|
372
386
|
};
|
|
373
387
|
const computeCascaderOptions = (t) => () => [
|
|
374
388
|
{
|
package/calendar-view/index.js
CHANGED
|
@@ -60,7 +60,7 @@ const isSelectedDate = ({ state }) => (day) => {
|
|
|
60
60
|
const getDayBgColor = ({ props }) => (day) => {
|
|
61
61
|
const date = day.year + "-" + day.month + "-" + day.value;
|
|
62
62
|
const isFunction = props.setDayBgColor instanceof Function;
|
|
63
|
-
const bgColor = isFunction ? props.setDayBgColor(date) : "";
|
|
63
|
+
const bgColor = isFunction ? props.setDayBgColor(date) : "white";
|
|
64
64
|
return bgColor;
|
|
65
65
|
};
|
|
66
66
|
const parseDate = (time) => {
|
|
@@ -195,7 +195,9 @@ const selectDay = ({ state, emit }) => (day, i) => {
|
|
|
195
195
|
} else {
|
|
196
196
|
state.selectedDates.push(date);
|
|
197
197
|
}
|
|
198
|
+
emit("update:modelValue", state.selectedDates);
|
|
198
199
|
emit("selected-date-change", state.selectedDates);
|
|
200
|
+
emit("date-click", date);
|
|
199
201
|
} else {
|
|
200
202
|
if (day.isNext) {
|
|
201
203
|
const { year, month } = nextMonth(state.activeYear, state.activeMonth);
|
|
@@ -209,6 +211,8 @@ const selectDay = ({ state, emit }) => (day, i) => {
|
|
|
209
211
|
}
|
|
210
212
|
state.selectedDate = day.value.toString().length > 2 ? day.value : `${state.activeYear}-${state.activeMonth}-${day.value}`;
|
|
211
213
|
state.showSelectedDateEvents = true;
|
|
214
|
+
emit("update:modelValue", state.selectedDate);
|
|
215
|
+
emit("date-click", state.selectedDate);
|
|
212
216
|
}
|
|
213
217
|
};
|
|
214
218
|
const getEventByMonth = ({ state }) => (year, month) => {
|
package/calendar-view/vue.js
CHANGED
|
@@ -135,6 +135,19 @@ const initState = ({ reactive, props, computed, api: api2, images, modesIcon })
|
|
|
135
135
|
return state;
|
|
136
136
|
};
|
|
137
137
|
const initWatch = ({ watch, props, state, emit, api: api2, nextTick }) => {
|
|
138
|
+
watch(
|
|
139
|
+
() => props.modelValue,
|
|
140
|
+
(value) => {
|
|
141
|
+
if (value) {
|
|
142
|
+
if (props.multiSelect && Array.isArray(value)) {
|
|
143
|
+
state.selectedDates = value;
|
|
144
|
+
} else {
|
|
145
|
+
state.selectedDate = value;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
{ immediate: true, deep: true }
|
|
150
|
+
);
|
|
138
151
|
watch(
|
|
139
152
|
() => props.mode,
|
|
140
153
|
() => {
|
|
@@ -151,9 +164,6 @@ const initWatch = ({ watch, props, state, emit, api: api2, nextTick }) => {
|
|
|
151
164
|
watch(
|
|
152
165
|
() => state.selectedDate,
|
|
153
166
|
() => {
|
|
154
|
-
if (state.mode === "month") {
|
|
155
|
-
api2.getEventByDate(state.selectedDate, state.selectedDateEvents);
|
|
156
|
-
}
|
|
157
167
|
emit("selected-date-change", state.selectedDate);
|
|
158
168
|
},
|
|
159
169
|
{ deep: true }
|
|
@@ -184,6 +194,9 @@ const initWatch = ({ watch, props, state, emit, api: api2, nextTick }) => {
|
|
|
184
194
|
});
|
|
185
195
|
}
|
|
186
196
|
);
|
|
197
|
+
addWatch({ watch, props, state, emit, api: api2 });
|
|
198
|
+
};
|
|
199
|
+
const addWatch = ({ watch, props, state, emit, api: api2 }) => {
|
|
187
200
|
watch(
|
|
188
201
|
() => props.month,
|
|
189
202
|
(val, oldVal) => {
|
package/card-group/vue.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import "../chunk-G2ADBYYC.js";
|
|
2
2
|
const api = ["state"];
|
|
3
|
-
const renderless = (props, { reactive }, { vm }) => {
|
|
3
|
+
const renderless = (props, { reactive, computed }, { vm }) => {
|
|
4
4
|
const api2 = {};
|
|
5
|
-
const state = reactive({
|
|
5
|
+
const state = reactive({
|
|
6
|
+
size: computed(() => props.size)
|
|
7
|
+
});
|
|
6
8
|
Object.assign(api2, {
|
|
7
9
|
state
|
|
8
10
|
});
|