@opentiny/vue-renderless 3.9.2 → 3.10.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/action-sheet/vue.js +25 -2
- package/anchor/index.js +3 -3
- package/anchor/vue.js +7 -1
- package/area/index.js +4 -4
- package/button/vue.js +4 -2
- package/button-group/index.js +8 -1
- package/button-group/vue.js +5 -10
- package/calendar/index.js +14 -14
- package/calendar-bar/index.js +3 -3
- package/carousel-item/index.js +1 -1
- package/cascader/vue.js +1 -1
- package/cascader-mobile/index.js +299 -0
- package/cascader-mobile/vue.js +102 -0
- package/cascader-panel/store.js +3 -1
- package/chart-boxplot/index.js +0 -1
- package/chart-core/deps/constants.js +20 -2
- package/chart-core/index.js +9 -1
- package/chart-core/modules/extend.js +14 -1
- package/chart-gauge/index.js +3 -1
- package/chart-graph/index.js +3 -1
- package/chart-map/index.js +11 -1
- package/chart-scatter/index.js +10 -2
- package/chart-waterfall/index.js +4 -1
- package/checkbox/index.js +16 -14
- package/checkbox/vue.js +14 -10
- package/checkbox-button/vue.js +7 -3
- package/column-list-item/vue.js +10 -1
- package/common/bigInt.js +4 -11
- package/common/date.js +2 -2
- package/common/deps/ResizeObserver.js +3 -1
- package/common/deps/date-util.js +9 -1
- package/common/deps/date.js +18 -5
- package/common/deps/fastdom/async.js +41 -0
- package/common/deps/fastdom/index.js +9 -0
- package/common/deps/fastdom/sandbox.js +53 -0
- package/common/deps/fastdom/singleton.js +80 -0
- package/common/deps/fullscreen/screenfull.js +16 -2
- package/common/deps/memorize.js +3 -3
- package/common/deps/popup-manager.js +0 -1
- package/common/deps/requestAnimationFrame.js +1 -1
- package/common/deps/throttle.js +2 -2
- package/common/deps/tree-model/node.js +23 -11
- package/common/deps/tree-model/tree-store.js +28 -7
- package/common/deps/vue-popper.js +14 -2
- package/common/deps/vue-popup.js +16 -23
- package/common/index.js +7 -35
- package/common/runtime.js +1 -1
- package/common/validate/rules/type.js +3 -1
- package/credit-card-form/vue.js +2 -2
- package/date-panel/index.js +35 -31
- package/date-panel/vue.js +12 -12
- package/date-picker/index.js +9 -5
- package/date-picker/vue.js +20 -8
- package/date-picker-mobile/index.js +3 -3
- package/date-range/index.js +91 -19
- package/date-range/vue.js +19 -11
- package/date-table/index.js +39 -6
- package/date-table/vue.js +2 -2
- package/dept/index.js +1 -1
- package/detail-page/vue.js +9 -1
- package/dialog-box/index.js +11 -2
- package/dialog-box/vue.js +30 -6
- package/dialog-select/index.js +27 -5
- package/dialog-select/vue.js +11 -4
- package/drop-roles/index.js +3 -1
- package/dropdown/index.js +28 -7
- package/dropdown/vue.js +12 -7
- package/dropdown-item/index.js +9 -1
- package/dropdown-item/mf.js +3 -3
- package/dropdown-item/vue.js +12 -10
- package/dropdown-menu/index.js +13 -14
- package/dropdown-menu/vue.js +8 -7
- package/espace/vue.js +9 -1
- package/fall-menu/vue.js +12 -1
- package/file-upload/index.js +137 -89
- package/file-upload/vue.js +24 -14
- package/filter/index.js +1 -1
- package/filter/vue.js +1 -3
- package/floating-button/index.js +73 -0
- package/floating-button/vue.js +35 -0
- package/form/index.js +13 -4
- package/form/vue.js +7 -2
- package/form-item/index.js +4 -1
- package/form-item/vue.js +6 -3
- package/fullscreen/vue.js +24 -3
- package/grid/plugins/exportExcel.js +54 -8
- package/grid/static/base/helperGetHGSKeys.js +1 -4
- package/grid/utils/common.js +15 -11
- package/grid/utils/dom.js +5 -1
- package/guide/index.js +2 -3
- package/hrapprover/index.js +3 -1
- package/index-bar/vue.js +8 -1
- package/input/index.js +1 -11
- package/input/vue.js +6 -12
- package/ip-address/index.js +66 -33
- package/ip-address/vue.js +8 -1
- package/link-menu/vue.js +22 -2
- package/locales/index.js +4 -2
- package/logon-user/index.js +3 -1
- package/logout/index.js +6 -2
- package/milestone/vue.js +1 -1
- package/mini-picker/index.js +12 -10
- package/mini-picker/vue.js +10 -10
- package/modal/index.js +5 -3
- package/modal/vue.js +4 -2
- package/month-range/index.js +18 -18
- package/month-range/vue.js +16 -4
- package/month-table/index.js +7 -3
- package/multi-select/vue.js +1 -9
- package/nav-menu/index.js +33 -4
- package/nav-menu/vue.js +9 -1
- package/notify/vue.js +12 -1
- package/numeric/vue.js +6 -2
- package/option/index.js +10 -2
- package/option/vue.js +20 -9
- package/option-group/index.js +3 -1
- package/package.json +2 -1
- package/picker/index.js +88 -17
- package/picker/vue.js +42 -17
- package/picker-column/index.js +6 -6
- package/picker-column/vue.js +5 -5
- package/popconfirm/vue.js +3 -1
- package/popeditor/index.js +55 -13
- package/popeditor/vue.js +23 -7
- package/popover/vue.js +1 -2
- package/popup/vue.js +15 -2
- package/progress/index.js +9 -7
- package/progress/vue.js +12 -4
- package/pull-refresh/vue.js +10 -1
- package/query-builder/index.js +9 -0
- package/query-builder/vue.js +18 -0
- package/radio/vue.js +3 -1
- package/radio-button/vue.js +1 -1
- package/rate/index.js +8 -2
- package/rate/vue.js +27 -4
- package/recycle-scroller/index.js +0 -1
- package/scrollbar/vue-bar.js +18 -2
- package/search/index.js +12 -5
- package/search/vue.js +7 -5
- package/select/index.js +596 -304
- package/select/vue.js +167 -101
- package/select-dropdown/vue.js +8 -6
- package/select-mobile/index.js +26 -13
- package/select-mobile/vue.js +14 -5
- package/select-view/index.js +5 -21
- package/select-view/vue.js +0 -3
- package/selected-box/index.js +3 -1
- package/slider/index.js +5 -5
- package/slider/vue.js +16 -0
- package/slider-button/index.js +41 -0
- package/slider-button/vue.js +36 -0
- package/slider-button-group/slide-button.js +142 -0
- package/slider-button-group/vue.js +52 -0
- package/steps/slide-bar.js +0 -1
- package/switch/index.js +1 -1
- package/switch/vue.js +1 -1
- package/tab-bar/index.js +8 -6
- package/tab-nav/index.js +19 -13
- package/tab-nav/vue.js +10 -9
- package/tabs/index.js +21 -17
- package/tabs/vue.js +1 -4
- package/tag/vue.js +2 -1
- package/tag-group/index.js +23 -10
- package/tag-group/vue.js +5 -4
- package/time/index.js +8 -8
- package/time/vue.js +9 -9
- package/time-line/index.js +24 -2
- package/time-line/vue.js +30 -4
- package/time-panel/index.js +2 -2
- package/time-panel/vue.js +2 -2
- package/time-range/index.js +24 -21
- package/time-range/vue.js +26 -16
- package/time-spinner/index.js +32 -21
- package/time-spinner/vue.js +37 -12
- package/timeline-item/index.js +77 -0
- package/timeline-item/vue.js +44 -0
- package/toggle-menu/vue.js +0 -1
- package/tooltip/index.js +11 -12
- package/tooltip/vue.js +11 -1
- package/top-box/vue.js +13 -1
- package/tree/index.js +228 -15
- package/tree/vue.js +119 -15
- package/tree-menu/index.js +35 -0
- package/tree-menu/vue.js +27 -5
- package/tree-node/index.js +75 -10
- package/tree-node/vue.js +45 -23
- package/upload/index.js +90 -49
- package/upload/vue.js +22 -10
- package/upload-dragger/index.js +4 -3
- package/upload-list/index.js +67 -16
- package/upload-list/vue.js +26 -9
- package/user/index.js +7 -4
- package/user-link/index.js +2 -1
- package/wizard/index.js +4 -1
- package/wizard/vue.js +19 -2
- package/year-range/index.js +1 -1
- package/year-range/vue.js +3 -3
- package/year-table/index.js +2 -2
package/input/vue.js
CHANGED
|
@@ -30,9 +30,7 @@ import {
|
|
|
30
30
|
handleEnterDisplayOnlyContent,
|
|
31
31
|
hiddenPassword,
|
|
32
32
|
dispatchDisplayedValue,
|
|
33
|
-
getDisplayedValue
|
|
34
|
-
handleDrop,
|
|
35
|
-
handleDragStart
|
|
33
|
+
getDisplayedValue
|
|
36
34
|
} from "./index";
|
|
37
35
|
import useStorageBox from "../tall-storage/vue-storage-box";
|
|
38
36
|
const api = [
|
|
@@ -65,11 +63,9 @@ const api = [
|
|
|
65
63
|
"isMemoryStorage",
|
|
66
64
|
"hasSelection",
|
|
67
65
|
"handleEnterDisplayOnlyContent",
|
|
68
|
-
"hiddenPassword"
|
|
69
|
-
"handleDrop",
|
|
70
|
-
"handleDragStart"
|
|
66
|
+
"hiddenPassword"
|
|
71
67
|
];
|
|
72
|
-
const initState = ({ reactive, computed, mode, props, parent, constants }) => {
|
|
68
|
+
const initState = ({ reactive, computed, mode, props, parent, constants, api: api2 }) => {
|
|
73
69
|
const state = reactive({
|
|
74
70
|
mode,
|
|
75
71
|
focused: false,
|
|
@@ -111,7 +107,7 @@ const initState = ({ reactive, computed, mode, props, parent, constants }) => {
|
|
|
111
107
|
() => (props.displayOnly || (parent.tinyForm || {}).displayOnly) && ["text", "textarea", "password", "number"].includes(props.type)
|
|
112
108
|
),
|
|
113
109
|
displayOnlyTooltip: "",
|
|
114
|
-
hiddenPassword: computed(() =>
|
|
110
|
+
hiddenPassword: computed(() => api2.hiddenPassword())
|
|
115
111
|
});
|
|
116
112
|
return state;
|
|
117
113
|
};
|
|
@@ -131,9 +127,7 @@ const initApi = ({ api: api2, state, dispatch, broadcast, emit, refs, props, CLA
|
|
|
131
127
|
handleCompositionStart: handleCompositionStart(state),
|
|
132
128
|
handleCompositionUpdate: handleCompositionUpdate(state),
|
|
133
129
|
dispatchDisplayedValue: dispatchDisplayedValue({ state, props, dispatch, api: api2 }),
|
|
134
|
-
getDisplayedValue: getDisplayedValue({ state, props })
|
|
135
|
-
handleDrop: handleDrop(emit),
|
|
136
|
-
handleDragStart: handleDragStart(emit)
|
|
130
|
+
getDisplayedValue: getDisplayedValue({ state, props })
|
|
137
131
|
});
|
|
138
132
|
};
|
|
139
133
|
const mergeApi = ({ storages, api: api2, componentName, props, emit, eventName, nextTick, parent, state, refs }) => {
|
|
@@ -233,7 +227,7 @@ const renderless = (props, { computed, onMounted, onUpdated, reactive, toRefs, w
|
|
|
233
227
|
Input: constants.inputMode(mode),
|
|
234
228
|
InputGroup: constants.inputGroupMode(mode)
|
|
235
229
|
};
|
|
236
|
-
const state = initState({ reactive, computed, mode, props, parent, constants });
|
|
230
|
+
const state = initState({ reactive, computed, mode, props, parent, constants, api: api2 });
|
|
237
231
|
initApi({ api: api2, state, dispatch, broadcast, emit, refs, props, CLASS_PREFIX, parent });
|
|
238
232
|
const storages = useStorageBox({ api: api2, props, reactive, toRefs });
|
|
239
233
|
parent.tinyForm = parent.tinyForm || inject("form", null);
|
package/ip-address/index.js
CHANGED
|
@@ -6,7 +6,7 @@ const ipValidator = ({ props, api }) => (value) => {
|
|
|
6
6
|
let result = true;
|
|
7
7
|
if (props.type) {
|
|
8
8
|
if (api.isIP6(props.type)) {
|
|
9
|
-
result =
|
|
9
|
+
result = /^(((([\da-fA-F]{1,4}):){7}([\da-fA-F]{1,4}))|(((([\da-fA-F]{1,4}):){1,7}:)|((([\da-fA-F]{1,4}):){6}:([\da-fA-F]{1,4}))|((([\da-fA-F]{1,4}):){5}:(([\da-fA-F]{1,4}):)?([\da-fA-F]{1,4}))|((([\da-fA-F]{1,4}):){4}:(([\da-fA-F]{1,4}):){0,2}([\da-fA-F]{1,4}))|((([\da-fA-F]{1,4}):){3}:(([\da-fA-F]{1,4}):){0,3}([\da-fA-F]{1,4}))|((([\da-fA-F]{1,4}):){2}:(([\da-fA-F]{1,4}):){0,4}([\da-fA-F]{1,4}))|((([\da-fA-F]{1,4}):){1}:(([\da-fA-F]{1,4}):){0,5}([\da-fA-F]{1,4}))|(::(([\da-fA-F]{1,4}):){0,6}([\da-fA-F]{1,4}))|(::([\da-fA-F]{1,4})?))|(((([\da-fA-F]{1,4}):){6}(((1?[1-9]?\d)|(10\d)|(2[0-4]\d)|(25[0-5]))\.){3}((1?[1-9]?\d)|(10\d)|(2[0-4]\d)|(25[0-5])))|((([\da-fA-F]{1,4}):){5}:(((1?[1-9]?\d)|(10\d)|(2[0-4]\d)|(25[0-5]))\.){3}((1?[1-9]?\d)|(10\d)|(2[0-4]\d)|(25[0-5])))|((([\da-fA-F]{1,4}):){4}:(([\da-fA-F]{1,4}):)?(((1?[1-9]?\d)|(10\d)|(2[0-4]\d)|(25[0-5]))\.){3}((1?[1-9]?\d)|(10\d)|(2[0-4]\d)|(25[0-5])))|((([\da-fA-F]{1,4}):){3}:(([\da-fA-F]{1,4}):){0,2}(((1?[1-9]?\d)|(10\d)|(2[0-4]\d)|(25[0-5]))\.){3}((1?[1-9]?\d)|(10\d)|(2[0-4]\d)|(25[0-5])))|((([\da-fA-F]{1,4}):){2}:(([\da-fA-F]{1,4}):){0,3}(((1?[1-9]?\d)|(10\d)|(2[0-4]\d)|(25[0-5]))\.){3}((1?[1-9]?\d)|(10\d)|(2[0-4]\d)|(25[0-5])))|(([\da-fA-F]{1,4})::(([\da-fA-F]{1,4}):){0,4}(((1?[1-9]?\d)|(10\d)|(2[0-4]\d)|(25[0-5]))\.){3}((1?[1-9]?\d)|(10\d)|(2[0-4]\d)|(25[0-5])))|(::(([\da-fA-F]{1,4}):){0,5}(((1?[1-9]?\d)|(10\d)|(2[0-4]\d)|(25[0-5]))\.){3}((1?[1-9]?\d)|(10\d)|(2[0-4]\d)|(25[0-5])))))$/.test(value);
|
|
10
10
|
} else if (api.isIP4(props.type)) {
|
|
11
11
|
result = /^((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})(\.((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})){3}$/.test(value);
|
|
12
12
|
}
|
|
@@ -30,7 +30,13 @@ const getValue = ({ api, props, state }) => () => {
|
|
|
30
30
|
const valueArr = [];
|
|
31
31
|
let result = "";
|
|
32
32
|
if (api.isIP6(props.type)) {
|
|
33
|
-
|
|
33
|
+
state.address.forEach((item) => {
|
|
34
|
+
if (item.value) {
|
|
35
|
+
item.value = item.value.replace(/[^a-fA-F\d]/g, "");
|
|
36
|
+
}
|
|
37
|
+
item.value && valueArr.push(item.value);
|
|
38
|
+
});
|
|
39
|
+
result = state.address.filter((item) => item.value).length === 8 ? valueArr.join(":") : "";
|
|
34
40
|
} else {
|
|
35
41
|
state.address.forEach((item) => {
|
|
36
42
|
if (api.isIP4(props.type) && item.value) {
|
|
@@ -46,13 +52,25 @@ const setValue = ({ api, props, state }) => (value) => {
|
|
|
46
52
|
if (value) {
|
|
47
53
|
if (api.ipValidator(value)) {
|
|
48
54
|
if (api.isIP6(props.type)) {
|
|
49
|
-
state.address =
|
|
55
|
+
state.address = value.split(":").map((item) => ({ value: item }));
|
|
56
|
+
if (state.address.length < 8) {
|
|
57
|
+
let insertIndex = 0;
|
|
58
|
+
state.address.forEach((item, index) => {
|
|
59
|
+
if (item.value === "") {
|
|
60
|
+
item.value = "0000";
|
|
61
|
+
insertIndex = index;
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
for (var i = 0; i <= 8 - state.address.length; i++) {
|
|
65
|
+
state.address.splice(insertIndex, 0, { value: "0000" });
|
|
66
|
+
}
|
|
67
|
+
}
|
|
50
68
|
} else {
|
|
51
69
|
state.address = value.split(".").map((item) => ({ value: item }));
|
|
52
70
|
}
|
|
53
71
|
}
|
|
54
72
|
} else {
|
|
55
|
-
state.address = api.isIP6(props.type) ?
|
|
73
|
+
state.address = api.isIP6(props.type) ? new Array(8).fill({ value: "" }) : new Array(4).fill({ value: "" });
|
|
56
74
|
}
|
|
57
75
|
};
|
|
58
76
|
const activeEvent = ({ emit, parent, state, index, event, type }) => {
|
|
@@ -87,7 +105,11 @@ const inputEvent = ({ api, componentName, emit, eventName, props }) => ({ item,
|
|
|
87
105
|
item.value = "";
|
|
88
106
|
}
|
|
89
107
|
} else {
|
|
90
|
-
|
|
108
|
+
if (!index && api.ipValidator(val)) {
|
|
109
|
+
api.setValue(val);
|
|
110
|
+
} else if (val.length > 4) {
|
|
111
|
+
item.value = item.value.slice(0, 4);
|
|
112
|
+
}
|
|
91
113
|
}
|
|
92
114
|
value = api.getValue();
|
|
93
115
|
emit("update:modelValue", value, index);
|
|
@@ -125,6 +147,17 @@ const keyup = ({ api, props }) => ({ item, index, event }) => {
|
|
|
125
147
|
return false;
|
|
126
148
|
}
|
|
127
149
|
}
|
|
150
|
+
if (api.isIP6(props.type)) {
|
|
151
|
+
if ([KEY_CODE.Tab, KEY_CODE.Space, KEY_CODE.NumpadDecimal, KEY_CODE.NumpadComma].includes(keyCode) && value) {
|
|
152
|
+
api.select({ index: nextIndex });
|
|
153
|
+
return false;
|
|
154
|
+
}
|
|
155
|
+
if ((value.length === 4 || value === "0000") && (!isNaN(event.key) || keyCode >= KEY_CODE.KeyA && keyCode <= KEY_CODE.KeyF)) {
|
|
156
|
+
api.focus({ index: nextIndex });
|
|
157
|
+
api.select({ index: nextIndex });
|
|
158
|
+
return false;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
128
161
|
};
|
|
129
162
|
const checkError1 = ({ Tab, Space, NumpadDecimal, NumpadComma, keyCode, value }) => [Tab, Space, NumpadDecimal, NumpadComma].includes(keyCode) && value;
|
|
130
163
|
const checkError2 = (newValue) => newValue && (isNaN(newValue) || newValue > IPTHRESHOLD.Max);
|
|
@@ -146,34 +179,34 @@ const keydown = ({ api, props, state }) => ({ item, index, event }) => {
|
|
|
146
179
|
const nextIndex = index + 1;
|
|
147
180
|
const lastIndex = index - 1;
|
|
148
181
|
const newValue = isSelected && !isfilterKeyCodes && value.substr(0, selectionStart) + key + value.substr(selectionEnd);
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
182
|
+
state.isDel = keyCode === KEY_CODE.Backspace || keyCode === KEY_CODE.Delete;
|
|
183
|
+
if (keyCode === KEY_CODE.Backspace && cursorPosition === 0 && !selectionEnd) {
|
|
184
|
+
api.focus({ index: lastIndex });
|
|
185
|
+
return false;
|
|
186
|
+
}
|
|
187
|
+
if (keyCode === KEY_CODE.ArrowLeft && cursorPosition === 0) {
|
|
188
|
+
api.focus({ index: lastIndex });
|
|
189
|
+
event.preventDefault();
|
|
190
|
+
return false;
|
|
191
|
+
}
|
|
192
|
+
if (keyCode === KEY_CODE.ArrowRight && cursorPosition === value.length) {
|
|
193
|
+
api.focus({ index: nextIndex });
|
|
194
|
+
event.preventDefault();
|
|
195
|
+
return false;
|
|
196
|
+
}
|
|
197
|
+
if (isError({
|
|
198
|
+
key,
|
|
199
|
+
value,
|
|
200
|
+
isSelected,
|
|
201
|
+
isfilterKeyCodes,
|
|
202
|
+
ctrlKey,
|
|
203
|
+
keyCode,
|
|
204
|
+
newValue,
|
|
205
|
+
api,
|
|
206
|
+
props
|
|
207
|
+
})) {
|
|
208
|
+
event.preventDefault();
|
|
209
|
+
return false;
|
|
177
210
|
}
|
|
178
211
|
};
|
|
179
212
|
const getHeightOfSize = (size, isLineHeight = "height") => {
|
package/ip-address/vue.js
CHANGED
|
@@ -24,7 +24,14 @@ const initState = ({ reactive, computed, handleValue, parent, props }) => {
|
|
|
24
24
|
const state = reactive(__spreadProps(__spreadValues({}, handleValue.state), {
|
|
25
25
|
active: false,
|
|
26
26
|
isSelected: false,
|
|
27
|
-
filterKeyCodes: [
|
|
27
|
+
filterKeyCodes: [
|
|
28
|
+
KEY_CODE.AtMark,
|
|
29
|
+
KEY_CODE.Backspace,
|
|
30
|
+
KEY_CODE.ArrowLeft,
|
|
31
|
+
KEY_CODE.ArrowRight,
|
|
32
|
+
KEY_CODE.Tab,
|
|
33
|
+
KEY_CODE.Delete
|
|
34
|
+
],
|
|
28
35
|
formDisabled: computed(() => (parent.tinyForm || {}).disabled),
|
|
29
36
|
disabled: computed(() => props.disabled || state.formDisabled),
|
|
30
37
|
heightStyle: computed(() => getHeightOfSize(props.size)),
|
package/link-menu/vue.js
CHANGED
|
@@ -1,8 +1,28 @@
|
|
|
1
1
|
import "../chunk-PKUHTIDK.js";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
initData,
|
|
4
|
+
dialogTitle,
|
|
5
|
+
disabledParentNode,
|
|
6
|
+
filterNode,
|
|
7
|
+
getValue,
|
|
8
|
+
hideDialog,
|
|
9
|
+
showDialog,
|
|
10
|
+
sureNodevalue,
|
|
11
|
+
disabledTreeNode,
|
|
12
|
+
initService
|
|
13
|
+
} from "./index";
|
|
3
14
|
import { copyArray } from "../common/object";
|
|
4
15
|
import { setMenuKey } from "../tree-menu";
|
|
5
|
-
const api = [
|
|
16
|
+
const api = [
|
|
17
|
+
"state",
|
|
18
|
+
"initData",
|
|
19
|
+
"filterNode",
|
|
20
|
+
"getValue",
|
|
21
|
+
"hideDialog",
|
|
22
|
+
"setMenuKey",
|
|
23
|
+
"showDialog",
|
|
24
|
+
"sureNodevalue"
|
|
25
|
+
];
|
|
6
26
|
const initState = ({ reactive, computed, api: api2 }) => {
|
|
7
27
|
const state = reactive({
|
|
8
28
|
filterText: "",
|
package/locales/index.js
CHANGED
|
@@ -17,7 +17,7 @@ const switchLanguage = ({ api, state, service }) => (lang) => {
|
|
|
17
17
|
const domain = service.getDomain();
|
|
18
18
|
const hasMultiLocale = state.locales.length === 2;
|
|
19
19
|
state.current = hasMultiLocale ? state.current = locales.indexOf(current) === 0 ? locales[1] : locales[0] : lang;
|
|
20
|
-
const expires = new Date(
|
|
20
|
+
const expires = new Date(new Date().getTime() + 36e5).toGMTString();
|
|
21
21
|
const currLang = state.current.substring(0, 2) === "zh" ? "zh" : "en";
|
|
22
22
|
document.cookie = `lang=${currLang};expires=${expires};domain=${domain};path=/`;
|
|
23
23
|
api.setText();
|
|
@@ -59,7 +59,9 @@ const initService = ({ props, service }) => {
|
|
|
59
59
|
const { options = {} } = setting;
|
|
60
60
|
const noopFnCreator = (propName) => () => {
|
|
61
61
|
if (propName) {
|
|
62
|
-
return Promise.reject(
|
|
62
|
+
return Promise.reject(
|
|
63
|
+
new Error(`[TINY Error][Locale] Prop ${propName} is mandatory when the framework service is not used`)
|
|
64
|
+
);
|
|
63
65
|
} else {
|
|
64
66
|
return Promise.resolve(null);
|
|
65
67
|
}
|
package/logon-user/index.js
CHANGED
|
@@ -7,7 +7,9 @@ const init = ({ service, state }) => () => {
|
|
|
7
7
|
};
|
|
8
8
|
const initService = ({ props, service }) => {
|
|
9
9
|
const { base = {} } = service || {};
|
|
10
|
-
const getUserInfoNoop = () => Promise.reject(
|
|
10
|
+
const getUserInfoNoop = () => Promise.reject(
|
|
11
|
+
new Error("[TINY Error][LogonUser] Prop getUserInfo is mandatory when the framework service is not used")
|
|
12
|
+
);
|
|
11
13
|
return {
|
|
12
14
|
getUserInfo: props.getUserInfo || base.getUserInfo || getUserInfoNoop
|
|
13
15
|
};
|
package/logout/index.js
CHANGED
|
@@ -38,9 +38,13 @@ const logout = ({ service, state, props }) => () => {
|
|
|
38
38
|
const initService = ({ props, service }) => {
|
|
39
39
|
const noopFnCreator = (propName) => () => {
|
|
40
40
|
if (propName) {
|
|
41
|
-
return Promise.reject(
|
|
41
|
+
return Promise.reject(
|
|
42
|
+
new Error(`[TINY Error][Logout] Prop ${propName} is mandatory when the framework service is not used`)
|
|
43
|
+
);
|
|
42
44
|
} else {
|
|
43
|
-
return Promise.reject(
|
|
45
|
+
return Promise.reject(
|
|
46
|
+
new Error("[TINY Error][Logout] Prop service is mandatory when the framework service is not used")
|
|
47
|
+
);
|
|
44
48
|
}
|
|
45
49
|
};
|
|
46
50
|
const { base = {}, common = {}, setting = {}, network = {}, ajax = {}, message = {} } = service || {};
|
package/milestone/vue.js
CHANGED
|
@@ -21,7 +21,7 @@ const renderless = (props, { reactive }, { emit, refs, constants }) => {
|
|
|
21
21
|
getLineColor: getLineColor(props),
|
|
22
22
|
getMileContent: getMileContent(props),
|
|
23
23
|
handleFlagClick: handleFlagClick(emit),
|
|
24
|
-
handleClick: handleClick({ emit
|
|
24
|
+
handleClick: handleClick({ emit }),
|
|
25
25
|
getMileIcon: getMileIcon({ constants, props }),
|
|
26
26
|
flagOprate: flagOprate({ constants, refs, state })
|
|
27
27
|
};
|
package/mini-picker/index.js
CHANGED
|
@@ -56,8 +56,8 @@ const getColumnValue = (api) => (index) => {
|
|
|
56
56
|
const column = api.getColumn(index);
|
|
57
57
|
return column && column.getValue();
|
|
58
58
|
};
|
|
59
|
-
const confirm = ({ api,
|
|
60
|
-
const children =
|
|
59
|
+
const confirm = ({ api, childrenPickerRefs }) => () => {
|
|
60
|
+
const children = childrenPickerRefs.childrenPicker;
|
|
61
61
|
children && children.forEach((child) => child.onTransitionEnd());
|
|
62
62
|
api.emitEvent("confirm");
|
|
63
63
|
api.visibleHandle();
|
|
@@ -73,13 +73,13 @@ const emitEvent = ({ api, state, emit }) => (event) => {
|
|
|
73
73
|
emit(event, api.getValues(), api.getIndexes());
|
|
74
74
|
}
|
|
75
75
|
};
|
|
76
|
-
const getColumn = (
|
|
77
|
-
const children =
|
|
76
|
+
const getColumn = (childrenPickerRefs) => (index) => {
|
|
77
|
+
const children = childrenPickerRefs.childrenPicker;
|
|
78
78
|
return children[index];
|
|
79
79
|
};
|
|
80
80
|
const getColumnIndex = (api) => (columnIndex) => (api.getColumn(columnIndex) || {}).state.currentIndex;
|
|
81
|
-
const getValues = (
|
|
82
|
-
const getIndexes = (
|
|
81
|
+
const getValues = (childrenPickerRefs) => () => childrenPickerRefs.childrenPicker && childrenPickerRefs.childrenPicker.map((child) => child.getValue());
|
|
82
|
+
const getIndexes = (childrenPickerRefs) => () => childrenPickerRefs.childrenPicker && childrenPickerRefs.childrenPicker.map((child) => child.state.currentIndex);
|
|
83
83
|
const setIndexes = (api) => (indexes) => {
|
|
84
84
|
indexes.forEach((optionIndex, columnIndex) => {
|
|
85
85
|
api.setColumnIndex(columnIndex, optionIndex);
|
|
@@ -89,9 +89,9 @@ const setColumnIndex = (api) => (columnIndex, optionIndex) => {
|
|
|
89
89
|
const column = api.getColumn(columnIndex);
|
|
90
90
|
column && column.setIndex(optionIndex);
|
|
91
91
|
};
|
|
92
|
-
const getColumnValues = (
|
|
93
|
-
const setColumnValues = (
|
|
94
|
-
const children =
|
|
92
|
+
const getColumnValues = (childrenPickerRefs) => (index) => (childrenPickerRefs.childrenPicker[index] || {}).state.columnsItem.values;
|
|
93
|
+
const setColumnValues = (childrenPickerRefs) => (index, options) => {
|
|
94
|
+
const children = childrenPickerRefs.childrenPicker;
|
|
95
95
|
const column = children[index];
|
|
96
96
|
if (column) {
|
|
97
97
|
column.setOptions(options);
|
|
@@ -132,7 +132,9 @@ const getChildrenComponent = ({ state, vm, constants }) => {
|
|
|
132
132
|
const childrenName = constants.CHILDREN_PICKER;
|
|
133
133
|
const children = [];
|
|
134
134
|
for (let index = 0; index < state.formattedColumns.length; index++) {
|
|
135
|
-
children.push(
|
|
135
|
+
children.push(
|
|
136
|
+
Array.isArray(vm.$refs[childrenName + index]) ? vm.$refs[childrenName + index][0] : vm.$refs[childrenName + index]
|
|
137
|
+
);
|
|
136
138
|
}
|
|
137
139
|
return children;
|
|
138
140
|
};
|
package/mini-picker/vue.js
CHANGED
|
@@ -59,22 +59,22 @@ const initState = ({ reactive, computed, props, api: api2 }) => {
|
|
|
59
59
|
});
|
|
60
60
|
return state;
|
|
61
61
|
};
|
|
62
|
-
const initApi = ({ api: api2, props, state, emit,
|
|
62
|
+
const initApi = ({ api: api2, props, state, emit, childrenPickerRefs }) => {
|
|
63
63
|
Object.assign(api2, {
|
|
64
64
|
state,
|
|
65
|
-
getColumn: getColumn(
|
|
66
|
-
getValues: getValues(
|
|
67
|
-
getIndexes: getIndexes(
|
|
65
|
+
getColumn: getColumn(childrenPickerRefs),
|
|
66
|
+
getValues: getValues(childrenPickerRefs),
|
|
67
|
+
getIndexes: getIndexes(childrenPickerRefs),
|
|
68
68
|
getDataType: getDataType(state),
|
|
69
69
|
visibleHandle: visibleHandle(emit),
|
|
70
70
|
formatCascade: formatCascade({ state, props }),
|
|
71
|
-
getColumnValues: getColumnValues(
|
|
72
|
-
setColumnValues: setColumnValues(
|
|
71
|
+
getColumnValues: getColumnValues(childrenPickerRefs),
|
|
72
|
+
setColumnValues: setColumnValues(childrenPickerRefs),
|
|
73
73
|
emitEvent: emitEvent({ api: api2, state, emit }),
|
|
74
74
|
change: change(api2),
|
|
75
75
|
onChange: onChange({ api: api2, state, emit }),
|
|
76
76
|
cancel: cancel({ api: api2, emit }),
|
|
77
|
-
confirm: confirm({ api: api2,
|
|
77
|
+
confirm: confirm({ api: api2, childrenPickerRefs }),
|
|
78
78
|
format: format({ state, api: api2 }),
|
|
79
79
|
setValues: setValues(api2),
|
|
80
80
|
setIndexes: setIndexes(api2),
|
|
@@ -103,13 +103,13 @@ const initWatch = ({ watch, props, state, api: api2 }) => {
|
|
|
103
103
|
};
|
|
104
104
|
const renderless = (props, { computed, onMounted, reactive, watch }, { emit, nextTick, vm, constants }) => {
|
|
105
105
|
const api2 = {};
|
|
106
|
-
const
|
|
106
|
+
const childrenPickerRefs = { childrenPicker: null };
|
|
107
107
|
const state = initState({ reactive, computed, props, api: api2 });
|
|
108
|
-
initApi({ api: api2, props, state, emit,
|
|
108
|
+
initApi({ api: api2, props, state, emit, childrenPickerRefs });
|
|
109
109
|
initWatch({ watch, props, state, api: api2 });
|
|
110
110
|
onMounted(() => {
|
|
111
111
|
nextTick(() => {
|
|
112
|
-
|
|
112
|
+
childrenPickerRefs.childrenPicker = getChildrenComponent({ state, vm, constants });
|
|
113
113
|
});
|
|
114
114
|
api2.format();
|
|
115
115
|
state.clumnsWrapHeight = state.itemHeight * state.visibleItemCount;
|
package/modal/index.js
CHANGED
|
@@ -132,14 +132,16 @@ const removeMsgQueue = ({ api, parent }) => () => {
|
|
|
132
132
|
}
|
|
133
133
|
api.updateStyle();
|
|
134
134
|
};
|
|
135
|
-
const updateStyle = (nextTick) => () => {
|
|
135
|
+
const updateStyle = ({ nextTick, props }) => () => {
|
|
136
136
|
nextTick(() => {
|
|
137
137
|
let offsetTop = 0;
|
|
138
|
+
let distance = props.top;
|
|
138
139
|
MsgQueue.forEach((comp) => {
|
|
139
|
-
offsetTop += parseFloat(
|
|
140
|
+
offsetTop += parseFloat(distance);
|
|
140
141
|
comp.state.modalTop = offsetTop;
|
|
141
|
-
const modalBox = comp.$
|
|
142
|
+
const modalBox = comp.$refs.modalBox;
|
|
142
143
|
offsetTop += modalBox.clientHeight;
|
|
144
|
+
distance = 15;
|
|
143
145
|
});
|
|
144
146
|
});
|
|
145
147
|
};
|
package/modal/vue.js
CHANGED
|
@@ -55,13 +55,15 @@ const renderless = (props, { computed, onMounted, onBeforeUnmount, reactive, wat
|
|
|
55
55
|
modalZindex: 0,
|
|
56
56
|
zoomLocat: null,
|
|
57
57
|
isMsg: computed(() => api2.computedIsMsg(props)),
|
|
58
|
-
prevEvent: null
|
|
58
|
+
prevEvent: null,
|
|
59
|
+
options: [],
|
|
60
|
+
theme: props.tiny_theme
|
|
59
61
|
});
|
|
60
62
|
Object.assign(api2, {
|
|
61
63
|
state,
|
|
62
64
|
broadcast,
|
|
63
65
|
computedIsMsg: computedIsMsg(),
|
|
64
|
-
updateStyle: updateStyle(nextTick),
|
|
66
|
+
updateStyle: updateStyle({ nextTick, props }),
|
|
65
67
|
getBox: getBox(refs),
|
|
66
68
|
watchValue: watchValue(api2),
|
|
67
69
|
created: created({ api: api2, props, state }),
|
package/month-range/index.js
CHANGED
|
@@ -6,20 +6,20 @@ const calcDefaultValue = (defaultValue) => {
|
|
|
6
6
|
} else if (defaultValue) {
|
|
7
7
|
return [new Date(defaultValue), nextMonth(new Date(defaultValue))];
|
|
8
8
|
}
|
|
9
|
-
return [
|
|
9
|
+
return [new Date(), nextMonth(new Date())];
|
|
10
10
|
};
|
|
11
|
-
const watchValue = ({ state }) => (
|
|
12
|
-
if (!
|
|
11
|
+
const watchValue = ({ state }) => (val) => {
|
|
12
|
+
if (!val) {
|
|
13
13
|
state.maxDate = null;
|
|
14
14
|
state.minDate = null;
|
|
15
|
-
} else if (Array.isArray(
|
|
16
|
-
if (isDate(
|
|
17
|
-
state.minDate = new Date(
|
|
15
|
+
} else if (Array.isArray(val)) {
|
|
16
|
+
if (isDate(val[0])) {
|
|
17
|
+
state.minDate = new Date(val[0]);
|
|
18
18
|
} else {
|
|
19
19
|
state.minDate = null;
|
|
20
20
|
}
|
|
21
|
-
if (isDate(
|
|
22
|
-
state.maxDate = new Date(
|
|
21
|
+
if (isDate(val[1])) {
|
|
22
|
+
state.maxDate = new Date(val[1]);
|
|
23
23
|
} else {
|
|
24
24
|
state.maxDate = null;
|
|
25
25
|
}
|
|
@@ -59,33 +59,33 @@ const handleChangeRange = (state) => (val) => {
|
|
|
59
59
|
};
|
|
60
60
|
const handleRangePick = ({ api, state, t }) => (val, close = true) => {
|
|
61
61
|
const defaultTime = state.defaultTime || [];
|
|
62
|
-
const
|
|
63
|
-
const
|
|
64
|
-
if (state.minDate ===
|
|
62
|
+
const max = modifyWithTimeString(val.maxDate, defaultTime[1], t);
|
|
63
|
+
const min = modifyWithTimeString(val.minDate, defaultTime[0], t);
|
|
64
|
+
if (state.minDate === min && state.maxDate === max) {
|
|
65
65
|
return;
|
|
66
66
|
}
|
|
67
67
|
if (state.onPick) {
|
|
68
68
|
state.onPick(val);
|
|
69
69
|
}
|
|
70
|
-
state.minDate =
|
|
71
|
-
state.maxDate =
|
|
70
|
+
state.minDate = min;
|
|
71
|
+
state.maxDate = max;
|
|
72
72
|
setTimeout(() => {
|
|
73
|
-
state.minDate =
|
|
74
|
-
state.maxDate =
|
|
73
|
+
state.minDate = min;
|
|
74
|
+
state.maxDate = max;
|
|
75
75
|
}, 10);
|
|
76
76
|
if (!close) {
|
|
77
77
|
return;
|
|
78
78
|
}
|
|
79
79
|
api.handleConfirm();
|
|
80
80
|
};
|
|
81
|
-
const handleShortcutClick = (api) => (
|
|
82
|
-
if (
|
|
81
|
+
const handleShortcutClick = (api) => (shortcutObj) => {
|
|
82
|
+
if (shortcutObj.onClick) {
|
|
83
83
|
const choose = {
|
|
84
84
|
$emit: (type, [start, end]) => {
|
|
85
85
|
api.doPick(start, end);
|
|
86
86
|
}
|
|
87
87
|
};
|
|
88
|
-
|
|
88
|
+
shortcutObj.onClick(choose);
|
|
89
89
|
}
|
|
90
90
|
};
|
|
91
91
|
const doPick = (emit) => (begin, end) => {
|
package/month-range/vue.js
CHANGED
|
@@ -16,7 +16,17 @@ import {
|
|
|
16
16
|
doPick
|
|
17
17
|
} from "./index";
|
|
18
18
|
import { nextYear } from "../common/deps/date-util";
|
|
19
|
-
const api = [
|
|
19
|
+
const api = [
|
|
20
|
+
"state",
|
|
21
|
+
"rightNextYear",
|
|
22
|
+
"rightPrevYear",
|
|
23
|
+
"handleRangePick",
|
|
24
|
+
"handleShortcutClick",
|
|
25
|
+
"handleChangeRange",
|
|
26
|
+
"leftPrevYear",
|
|
27
|
+
"leftNextYear",
|
|
28
|
+
"isValidValue"
|
|
29
|
+
];
|
|
20
30
|
const initState = ({ reactive, computed, api: api2, t }) => {
|
|
21
31
|
const state = reactive({
|
|
22
32
|
popperClass: "",
|
|
@@ -25,8 +35,8 @@ const initState = ({ reactive, computed, api: api2, t }) => {
|
|
|
25
35
|
defaultTime: null,
|
|
26
36
|
minDate: "",
|
|
27
37
|
maxDate: "",
|
|
28
|
-
leftDate:
|
|
29
|
-
rightDate: nextYear(
|
|
38
|
+
leftDate: new Date(),
|
|
39
|
+
rightDate: nextYear(new Date()),
|
|
30
40
|
rangeState: { endDate: null, selecting: false, row: null, column: null },
|
|
31
41
|
shortcuts: "",
|
|
32
42
|
visible: "",
|
|
@@ -34,7 +44,9 @@ const initState = ({ reactive, computed, api: api2, t }) => {
|
|
|
34
44
|
format: "",
|
|
35
45
|
arrowControl: false,
|
|
36
46
|
unlinkPanels: false,
|
|
37
|
-
btnDisabled: computed(
|
|
47
|
+
btnDisabled: computed(
|
|
48
|
+
() => !(state.minDate && state.maxDate && !state.selecting && api2.isValidValue([state.minDate, state.maxDate]))
|
|
49
|
+
),
|
|
38
50
|
leftLabel: computed(() => state.leftDate.getFullYear() + " " + t("ui.datepicker.year")),
|
|
39
51
|
rightLabel: computed(() => state.rightDate.getFullYear() + " " + t("ui.datepicker.year")),
|
|
40
52
|
leftYear: computed(() => state.leftDate.getFullYear()),
|
package/month-table/index.js
CHANGED
|
@@ -22,7 +22,7 @@ const getRows = ({ props, state, vm }) => () => {
|
|
|
22
22
|
const tableRows = state.tableRows;
|
|
23
23
|
const disabledDate = state.disabledDate;
|
|
24
24
|
const selectedDate = [];
|
|
25
|
-
const now = getMonthTimestamp(
|
|
25
|
+
const now = getMonthTimestamp(new Date());
|
|
26
26
|
const { date, minDate, maxDate } = props;
|
|
27
27
|
for (let i = 0; i < 3; i++) {
|
|
28
28
|
const row = tableRows[i];
|
|
@@ -61,6 +61,7 @@ const markRange = ({ props, state }) => (minDate, maxDate) => {
|
|
|
61
61
|
minDate = getMonthTimestamp(minDate);
|
|
62
62
|
maxDate = getMonthTimestamp(maxDate);
|
|
63
63
|
if (minDate > maxDate) {
|
|
64
|
+
;
|
|
64
65
|
[minDate, maxDate] = [maxDate, minDate];
|
|
65
66
|
}
|
|
66
67
|
const rows = state.rows;
|
|
@@ -155,12 +156,15 @@ const cellMatchesDate = (props) => (cell, date) => {
|
|
|
155
156
|
const getCellStyle = ({ api, props }) => (cell) => {
|
|
156
157
|
const style = {};
|
|
157
158
|
const year = props.date.getFullYear();
|
|
158
|
-
const today =
|
|
159
|
+
const today = new Date();
|
|
159
160
|
const month = cell.text;
|
|
160
161
|
const defaultValue = props.defaultValue ? Array.isArray(props.defaultValue) ? props.defaultValue : [props.defaultValue] : [];
|
|
161
162
|
style.disabled = typeof props.disabledDate === "function" ? datesInMonth(year, month).every(props.disabledDate) : false;
|
|
162
163
|
const execDate = typeof props.value === "object" ? props.value : toDate(props.value);
|
|
163
|
-
style.current = arrayFindIndex(
|
|
164
|
+
style.current = arrayFindIndex(
|
|
165
|
+
coerceTruthyValueToArray(execDate),
|
|
166
|
+
(date) => date.getFullYear() === year && date.getMonth() === month
|
|
167
|
+
) >= 0;
|
|
164
168
|
style.today = today.getFullYear() === year && today.getMonth() === month;
|
|
165
169
|
style.default = defaultValue.some((date) => api.cellMatchesDate(cell, date));
|
|
166
170
|
if (cell.inRange) {
|
package/multi-select/vue.js
CHANGED
|
@@ -1,13 +1,5 @@
|
|
|
1
1
|
import "../chunk-PKUHTIDK.js";
|
|
2
|
-
import {
|
|
3
|
-
created,
|
|
4
|
-
handleClick,
|
|
5
|
-
confirm,
|
|
6
|
-
reset,
|
|
7
|
-
wheelChange,
|
|
8
|
-
clickWheelItem,
|
|
9
|
-
loadDefault
|
|
10
|
-
} from "./index";
|
|
2
|
+
import { created, handleClick, confirm, reset, wheelChange, clickWheelItem, loadDefault } from "./index";
|
|
11
3
|
const api = [
|
|
12
4
|
"state",
|
|
13
5
|
"created",
|