@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/date-panel/vue.js
CHANGED
|
@@ -42,7 +42,9 @@ import {
|
|
|
42
42
|
computerVisibleTime,
|
|
43
43
|
computerVisibleDate,
|
|
44
44
|
computerTimeFormat,
|
|
45
|
-
watchVisible
|
|
45
|
+
watchVisible,
|
|
46
|
+
getDisabledNow,
|
|
47
|
+
getDisabledConfirm
|
|
46
48
|
} from "./index";
|
|
47
49
|
import { getWeekNumber, extractDateFormat } from "../common/deps/date-util";
|
|
48
50
|
import { DATEPICKER, DATE } from "../common";
|
|
@@ -102,6 +104,8 @@ const initState = ({ reactive, computed, api: api2, i18n }) => {
|
|
|
102
104
|
selectedTz: null,
|
|
103
105
|
animationName: "",
|
|
104
106
|
startYear: Math.floor((/* @__PURE__ */ new Date()).getFullYear() / 10) * 10,
|
|
107
|
+
disabledNow: computed(() => api2.getDisabledNow()),
|
|
108
|
+
disabledConfirm: computed(() => api2.getDisabledConfirm()),
|
|
105
109
|
year: computed(() => !Array.isArray(state.date) && state.date.getFullYear()),
|
|
106
110
|
month: computed(() => !Array.isArray(state.date) && state.date.getMonth()),
|
|
107
111
|
week: computed(() => getWeekNumber(state.date)),
|
|
@@ -192,7 +196,9 @@ const initApi = ({ api: api2, state, t, emit, nextTick, vm, watch }) => {
|
|
|
192
196
|
handleShortcutClick: handleShortcutClick(api2),
|
|
193
197
|
computerVisibleDate: computerVisibleDate({ state, t }),
|
|
194
198
|
handleVisibleTimeChange: handleVisibleTimeChange({ api: api2, vm, state, t }),
|
|
195
|
-
computerTimeFormat: computerTimeFormat({ state })
|
|
199
|
+
computerTimeFormat: computerTimeFormat({ state }),
|
|
200
|
+
getDisabledNow: getDisabledNow({ state }),
|
|
201
|
+
getDisabledConfirm: getDisabledConfirm({ state })
|
|
196
202
|
});
|
|
197
203
|
};
|
|
198
204
|
const renderless = (props, { computed, reactive, watch, nextTick }, { t, emit: $emit, vm, i18n }) => {
|
|
@@ -273,7 +273,19 @@ const scrollEnd = ({ state, api }) => () => {
|
|
|
273
273
|
state.loading = true;
|
|
274
274
|
state.isYearMonthPanel ? api.loadYearMonth("down") : api.loadingDate("down");
|
|
275
275
|
};
|
|
276
|
+
const clear = ({ state, emit, api }) => () => {
|
|
277
|
+
state.date = Array.isArray(state.date) ? [] : "";
|
|
278
|
+
emit("update:modelValue", state.date);
|
|
279
|
+
emit("clear", state.date);
|
|
280
|
+
api.close();
|
|
281
|
+
};
|
|
282
|
+
const close = ({ emit, vm }) => () => {
|
|
283
|
+
vm.$refs.actionSheet.close();
|
|
284
|
+
emit("close");
|
|
285
|
+
};
|
|
276
286
|
export {
|
|
287
|
+
clear,
|
|
288
|
+
close,
|
|
277
289
|
confirm,
|
|
278
290
|
formatDate,
|
|
279
291
|
getCurrentDate,
|
|
@@ -17,6 +17,8 @@ import {
|
|
|
17
17
|
loadingDate,
|
|
18
18
|
scrollStart,
|
|
19
19
|
scrollEnd,
|
|
20
|
+
clear,
|
|
21
|
+
close,
|
|
20
22
|
confirm
|
|
21
23
|
} from "./index";
|
|
22
24
|
import { initYearMonthPanel, getOffsetMonth, loadYearMonth } from "./year-month";
|
|
@@ -33,6 +35,8 @@ const api = [
|
|
|
33
35
|
"scrollStart",
|
|
34
36
|
"scrollEnd",
|
|
35
37
|
"loadingDate",
|
|
38
|
+
"clear",
|
|
39
|
+
"close",
|
|
36
40
|
"formatDate"
|
|
37
41
|
];
|
|
38
42
|
const renderless = (props, { computed, reactive, watch, onMounted }, { emit, vm, nextTick, constants }) => {
|
|
@@ -86,7 +90,9 @@ const renderless = (props, { computed, reactive, watch, onMounted }, { emit, vm,
|
|
|
86
90
|
loadingDate: loadingDate({ state, api: api2 }),
|
|
87
91
|
loadYearMonth: loadYearMonth({ state, api: api2 }),
|
|
88
92
|
getOffsetMonth: getOffsetMonth(),
|
|
89
|
-
formatDate: formatDate({ props, constants })
|
|
93
|
+
formatDate: formatDate({ props, constants }),
|
|
94
|
+
clear: clear({ state, emit, api: api2 }),
|
|
95
|
+
close: close({ emit, vm })
|
|
90
96
|
});
|
|
91
97
|
watch(() => props.visible, api2.watchVisible);
|
|
92
98
|
watch(() => props.modelValue, api2.watchModelValue, { immediate: true });
|
package/date-range/vue.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import {
|
|
2
|
+
__spreadValues
|
|
3
|
+
} from "../chunk-G2ADBYYC.js";
|
|
2
4
|
import {
|
|
3
5
|
getMinVisibleDate,
|
|
4
6
|
watchValue,
|
|
@@ -64,9 +66,11 @@ const api = [
|
|
|
64
66
|
"handleTimeInput",
|
|
65
67
|
"handleMinTimeClose",
|
|
66
68
|
"handleDateChange",
|
|
67
|
-
"handleMaxTimeClose"
|
|
69
|
+
"handleMaxTimeClose",
|
|
70
|
+
"isValidValue"
|
|
68
71
|
];
|
|
69
|
-
const initState = ({ reactive, computed, api: api2, constants }) => {
|
|
72
|
+
const initState = ({ reactive, computed, api: api2, constants, designConfig }) => {
|
|
73
|
+
var _a;
|
|
70
74
|
const state = reactive({
|
|
71
75
|
popperElm: null,
|
|
72
76
|
popperClass: "",
|
|
@@ -112,7 +116,12 @@ const initState = ({ reactive, computed, api: api2, constants }) => {
|
|
|
112
116
|
timeFormat: computed(() => state.format ? extractTimeFormat(state.format) : "HH:mm:ss"),
|
|
113
117
|
dateFormat: computed(() => state.format ? extractDateFormat(state.format) : "yyyy-MM-dd"),
|
|
114
118
|
enableMonthArrow: computed(() => api2.getEnableMonthArrow()),
|
|
115
|
-
enableYearArrow: computed(() => api2.computerEnableYearArrow())
|
|
119
|
+
enableYearArrow: computed(() => api2.computerEnableYearArrow()),
|
|
120
|
+
// tiny 新增
|
|
121
|
+
confirmButtonProps: __spreadValues({
|
|
122
|
+
plain: true,
|
|
123
|
+
type: "default"
|
|
124
|
+
}, (_a = designConfig == null ? void 0 : designConfig.state) == null ? void 0 : _a.confirmButtonProps)
|
|
116
125
|
});
|
|
117
126
|
return state;
|
|
118
127
|
};
|
|
@@ -172,10 +181,10 @@ const initApi = ({ api: api2, state, t, vm, nextTick, emit, constants }) => {
|
|
|
172
181
|
watchPickerVisible: watchPickerVisible({ state, constants })
|
|
173
182
|
});
|
|
174
183
|
};
|
|
175
|
-
const renderless = (props, { computed, reactive, watch, nextTick }, { t, emit: $emit, vm, constants }) => {
|
|
184
|
+
const renderless = (props, { computed, reactive, watch, nextTick }, { t, emit: $emit, vm, constants, designConfig }) => {
|
|
176
185
|
const api2 = {};
|
|
177
186
|
const emit = props.emitter ? props.emitter.emit : $emit;
|
|
178
|
-
const state = initState({ reactive, computed, api: api2, constants });
|
|
187
|
+
const state = initState({ reactive, computed, api: api2, constants, designConfig });
|
|
179
188
|
initApi({ api: api2, state, t, vm, nextTick, emit, constants });
|
|
180
189
|
initWatch({ watch, state, api: api2 });
|
|
181
190
|
return api2;
|
package/date-table/index.js
CHANGED
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
} from "../common/deps/date-util";
|
|
12
12
|
import { DATEPICKER } from "../common";
|
|
13
13
|
const formatJudg = ({ day, offset, j, i, cell, count, dateCountOfLastMonth }) => {
|
|
14
|
-
const nodfpm = day + offset
|
|
14
|
+
const nodfpm = day + offset <= 0 ? 7 + day + offset : day + offset;
|
|
15
15
|
if (j + i * 7 >= nodfpm) {
|
|
16
16
|
cell.text = count++;
|
|
17
17
|
} else {
|
|
@@ -36,19 +36,7 @@ const getDateTimestamp = (time) => {
|
|
|
36
36
|
}
|
|
37
37
|
return NaN;
|
|
38
38
|
};
|
|
39
|
-
const
|
|
40
|
-
for (let i = 0, len = arr.length; i !== len; ++i) {
|
|
41
|
-
if (pred(arr[i])) {
|
|
42
|
-
return i;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
return -1;
|
|
46
|
-
};
|
|
47
|
-
const arrayFind = (arr, pred) => {
|
|
48
|
-
const idx = arrayFindIndex(arr, pred);
|
|
49
|
-
return ~idx ? arr[idx] : void 0;
|
|
50
|
-
};
|
|
51
|
-
const getSelected = ({ props, cell, format, t, cellDate, selectedDate }) => {
|
|
39
|
+
const getSelected = (props, cell, format, t, cellDate, selectedDate) => {
|
|
52
40
|
let selected = cell.selected;
|
|
53
41
|
if (props.selectionMode === "dates") {
|
|
54
42
|
selected = arrayFind(selectedDate, (date) => formatDate(date, format, t) === formatDate(cellDate, format, t));
|
|
@@ -61,14 +49,7 @@ const getCell = ({ state, props }) => (row, i, j) => {
|
|
|
61
49
|
const now = getDateTimestamp(/* @__PURE__ */ new Date());
|
|
62
50
|
let cell = row[props.showWeekNumber ? j + 1 : j];
|
|
63
51
|
if (!cell) {
|
|
64
|
-
cell = {
|
|
65
|
-
row: i,
|
|
66
|
-
column: j,
|
|
67
|
-
inRange: false,
|
|
68
|
-
start: false,
|
|
69
|
-
end: false,
|
|
70
|
-
type: DATEPICKER.Normal
|
|
71
|
-
};
|
|
52
|
+
cell = { row: i, column: j, inRange: false, start: false, end: false, type: DATEPICKER.Normal };
|
|
72
53
|
}
|
|
73
54
|
cell.type = DATEPICKER.Normal;
|
|
74
55
|
const index = i * 7 + j;
|
|
@@ -81,15 +62,7 @@ const getCell = ({ state, props }) => (row, i, j) => {
|
|
|
81
62
|
};
|
|
82
63
|
const doCount = ({ i, day, offset, j, cell, count, dateCountOfLastMonth, dateCountOfMonth }) => {
|
|
83
64
|
if (i >= 0 && i <= 1) {
|
|
84
|
-
const ret = formatJudg({
|
|
85
|
-
day,
|
|
86
|
-
offset,
|
|
87
|
-
j,
|
|
88
|
-
i,
|
|
89
|
-
cell,
|
|
90
|
-
count,
|
|
91
|
-
dateCountOfLastMonth
|
|
92
|
-
});
|
|
65
|
+
const ret = formatJudg({ day, offset, j, i, cell, count, dateCountOfLastMonth });
|
|
93
66
|
count = ret.count;
|
|
94
67
|
} else {
|
|
95
68
|
if (count <= dateCountOfMonth) {
|
|
@@ -101,7 +74,6 @@ const doCount = ({ i, day, offset, j, cell, count, dateCountOfLastMonth, dateCou
|
|
|
101
74
|
}
|
|
102
75
|
return count;
|
|
103
76
|
};
|
|
104
|
-
const coerceTruthyValueToArray = (val) => Array.isArray(val) ? val : val ? [val] : [];
|
|
105
77
|
const getRows = ({ api, props, state, t, vm }) => () => {
|
|
106
78
|
const date = new Date(state.year, state.month, 1);
|
|
107
79
|
let day = getFirstDayOfMonth(date);
|
|
@@ -133,15 +105,7 @@ const getRows = ({ api, props, state, t, vm }) => () => {
|
|
|
133
105
|
const { cell, cellDate } = api.getCell(row, i, j, DATEPICKER.Normal, props);
|
|
134
106
|
count = doCount({ i, day, offset, j, cell, count, dateCountOfLastMonth, dateCountOfMonth });
|
|
135
107
|
cell.disabled = typeof disabledDate === "function" && disabledDate(cellDate);
|
|
136
|
-
cell.selected = getSelected(
|
|
137
|
-
props,
|
|
138
|
-
cell,
|
|
139
|
-
api,
|
|
140
|
-
format: DATEPICKER.DateFormats.date,
|
|
141
|
-
t,
|
|
142
|
-
cellDate,
|
|
143
|
-
selectedDate
|
|
144
|
-
});
|
|
108
|
+
cell.selected = getSelected(props, cell, DATEPICKER.DateFormats.date, t, cellDate, selectedDate);
|
|
145
109
|
cell.customClass = typeof cellClassName === "function" && cellClassName(cellDate);
|
|
146
110
|
vm.$set(row, props.showWeekNumber ? j + 1 : j, cell);
|
|
147
111
|
arr[i].push(cellDate);
|
|
@@ -165,6 +129,19 @@ const getRows = ({ api, props, state, t, vm }) => () => {
|
|
|
165
129
|
}
|
|
166
130
|
return rows;
|
|
167
131
|
};
|
|
132
|
+
const arrayFindIndex = (arr, pred) => {
|
|
133
|
+
for (let i = 0, len = arr.length; i !== len; ++i) {
|
|
134
|
+
if (pred(arr[i])) {
|
|
135
|
+
return i;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
return -1;
|
|
139
|
+
};
|
|
140
|
+
const arrayFind = (arr, pred) => {
|
|
141
|
+
const idx = arrayFindIndex(arr, pred);
|
|
142
|
+
return ~idx ? arr[idx] : void 0;
|
|
143
|
+
};
|
|
144
|
+
const coerceTruthyValueToArray = (val) => Array.isArray(val) ? val : val ? [val] : [];
|
|
168
145
|
const watchMinDate = ({ api, props }) => (value, oldvalue) => {
|
|
169
146
|
if (getDateTimestamp(value) !== getDateTimestamp(oldvalue)) {
|
|
170
147
|
api.markRange(props.minDate, props.maxDate);
|
|
@@ -259,14 +236,14 @@ const markRange = ({ props, state }) => (minDate, maxDate) => {
|
|
|
259
236
|
for (let i = 0, k = rows.length; i < k; i++) {
|
|
260
237
|
const row = rows[i];
|
|
261
238
|
for (let j = 0, l = row.length; j < l; j++) {
|
|
262
|
-
if (
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
239
|
+
if (props.showWeekNumber && j === 0)
|
|
240
|
+
continue;
|
|
241
|
+
const cell = row[j];
|
|
242
|
+
const index = i * 7 + j + (props.showWeekNumber ? -1 : 0);
|
|
243
|
+
const time = nextDate(startDate, index - state.offsetDay).getTime();
|
|
244
|
+
cell.inRange = minDate && time >= minDate && time <= maxDate;
|
|
245
|
+
cell.start = minDate && time === minDate;
|
|
246
|
+
cell.end = maxDate && time === maxDate;
|
|
270
247
|
}
|
|
271
248
|
}
|
|
272
249
|
};
|
|
@@ -312,10 +289,6 @@ const getTarget = (event) => {
|
|
|
312
289
|
}
|
|
313
290
|
return target;
|
|
314
291
|
};
|
|
315
|
-
const removeFromArray = (arr, pred) => {
|
|
316
|
-
const idx = typeof pred === "function" ? arrayFindIndex(arr, pred) : arr.indexOf(pred);
|
|
317
|
-
return idx >= 0 ? [...arr.slice(0, idx), ...arr.slice(idx + 1)] : arr;
|
|
318
|
-
};
|
|
319
292
|
const handleClick = ({ api, emit, props, state }) => (event) => {
|
|
320
293
|
let target = getTarget(event);
|
|
321
294
|
if (target.tagName !== "TD") {
|
|
@@ -357,6 +330,14 @@ const handleClick = ({ api, emit, props, state }) => (event) => {
|
|
|
357
330
|
emit("pick", newValue);
|
|
358
331
|
}
|
|
359
332
|
};
|
|
333
|
+
const removeFromArray = (arr, pred) => {
|
|
334
|
+
const idx = typeof pred === "function" ? arrayFindIndex(arr, pred) : arr.indexOf(pred);
|
|
335
|
+
return idx >= 0 ? [...arr.slice(0, idx), ...arr.slice(idx + 1)] : arr;
|
|
336
|
+
};
|
|
337
|
+
const getCssToken = ({ api }) => (cell, prexfix = "") => {
|
|
338
|
+
const cssStr = api.getCellClasses(cell) || "";
|
|
339
|
+
return cssStr.split(" ").map((className) => prexfix + className);
|
|
340
|
+
};
|
|
360
341
|
export {
|
|
361
342
|
arrayFind,
|
|
362
343
|
arrayFindIndex,
|
|
@@ -365,6 +346,7 @@ export {
|
|
|
365
346
|
getCell,
|
|
366
347
|
getCellClasses,
|
|
367
348
|
getCellRangeClasses,
|
|
349
|
+
getCssToken,
|
|
368
350
|
getDateOfCell,
|
|
369
351
|
getDateTimestamp,
|
|
370
352
|
getOffsetDay,
|
package/date-table/vue.js
CHANGED
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
watchMaxDate,
|
|
9
9
|
cellMatchesDate,
|
|
10
10
|
getCellClasses,
|
|
11
|
+
getCssToken,
|
|
11
12
|
getDateOfCell,
|
|
12
13
|
isWeekActive,
|
|
13
14
|
markRange,
|
|
@@ -16,7 +17,7 @@ import {
|
|
|
16
17
|
getCell
|
|
17
18
|
} from "./index";
|
|
18
19
|
import { getStartDateOfMonth } from "../common/deps/date-util";
|
|
19
|
-
const api = ["state", "getCellClasses", "isWeekActive", "handleMouseMove", "handleClick"];
|
|
20
|
+
const api = ["state", "getCellClasses", "getCssToken", "isWeekActive", "handleMouseMove", "handleClick"];
|
|
20
21
|
const initState = ({ reactive, computed, api: api2, props }) => {
|
|
21
22
|
const state = reactive({
|
|
22
23
|
tableRows: [[], [], [], [], [], []],
|
|
@@ -28,7 +29,7 @@ const initState = ({ reactive, computed, api: api2, props }) => {
|
|
|
28
29
|
month: computed(() => !Array.isArray(props.date) && props.date.getMonth()),
|
|
29
30
|
offsetDay: computed(() => api2.getOffsetDay()),
|
|
30
31
|
year: computed(() => !Array.isArray(props.date) && props.date.getFullYear()),
|
|
31
|
-
startDate: computed(() => getStartDateOfMonth(state.year, state.month)),
|
|
32
|
+
startDate: computed(() => getStartDateOfMonth(state.year, state.month, state.offsetDay)),
|
|
32
33
|
date: props.value
|
|
33
34
|
});
|
|
34
35
|
return state;
|
|
@@ -50,6 +51,7 @@ const initApi = ({ api: api2, state, props, emit, t, vm }) => {
|
|
|
50
51
|
getRows: getRows({ api: api2, props, state, t, vm }),
|
|
51
52
|
handleClick: handleClick({ api: api2, emit, props, state }),
|
|
52
53
|
getCellClasses: getCellClasses({ api: api2, props, state }),
|
|
54
|
+
getCssToken: getCssToken({ api: api2 }),
|
|
53
55
|
getCellRangeClasses: getCellRangeClasses({ props })
|
|
54
56
|
});
|
|
55
57
|
};
|
package/dialog-box/index.js
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
import
|
|
1
|
+
import {
|
|
2
|
+
__spreadValues
|
|
3
|
+
} from "../chunk-G2ADBYYC.js";
|
|
2
4
|
import { on, off, addClass, removeClass } from "../common/deps/dom";
|
|
3
5
|
import { emitEvent } from "../common/event";
|
|
4
6
|
import { getDomNode } from "../common/deps/dom";
|
|
5
7
|
const computedAnimationName = ({ constants, props }) => () => props.rightSlide ? constants.DIALOG_SLIDER_RIGHT : constants.DIALOG_FADE;
|
|
6
8
|
const computedAddUnit = (value) => isNaN(Number(value)) ? value : value + "px";
|
|
7
|
-
const computedStyle = ({ props, state }) => () => {
|
|
8
|
-
|
|
9
|
+
const computedStyle = ({ props, state, designConfig }) => () => {
|
|
10
|
+
var _a;
|
|
11
|
+
let style = {};
|
|
9
12
|
let { width, top, rightSlide, maxHeight } = props;
|
|
10
13
|
if (top === void 0) {
|
|
11
|
-
top = rightSlide ? "0" : "15vh";
|
|
14
|
+
top = rightSlide ? "0" : ((_a = designConfig == null ? void 0 : designConfig.state) == null ? void 0 : _a.top) ? "" : "15vh";
|
|
12
15
|
}
|
|
13
16
|
width = computedAddUnit(width);
|
|
14
17
|
top = computedAddUnit(top);
|
|
@@ -24,6 +27,9 @@ const computedStyle = ({ props, state }) => () => {
|
|
|
24
27
|
style.left = state.left || "calc((100vw - " + width + ") / 2)";
|
|
25
28
|
}
|
|
26
29
|
}
|
|
30
|
+
if (state.dragStyle) {
|
|
31
|
+
style = __spreadValues(__spreadValues({}, style), state.dragStyle);
|
|
32
|
+
}
|
|
27
33
|
return style;
|
|
28
34
|
};
|
|
29
35
|
const computedBodyStyle = ({ props }) => () => {
|
|
@@ -97,11 +103,25 @@ const unMounted = ({ api, parent, props }) => () => {
|
|
|
97
103
|
el.parentNode.removeChild(el);
|
|
98
104
|
}
|
|
99
105
|
};
|
|
100
|
-
const
|
|
106
|
+
const useMouseEventDown = ({ state }) => (event) => {
|
|
107
|
+
state.mouseDownWrapperFlag = false;
|
|
108
|
+
if (/tiny-dialog-box__wrapper/.test(event.target.className) && event.type === "mousedown") {
|
|
109
|
+
state.mouseDownWrapperFlag = true;
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
const useMouseEventUp = ({ state }) => (event) => {
|
|
113
|
+
state.mouseUpWrapperFlag = false;
|
|
114
|
+
if (/tiny-dialog-box__wrapper/.test(event.target.className) && event.type === "mouseup") {
|
|
115
|
+
state.mouseUpWrapperFlag = true;
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
const handleWrapperClick = ({ api, props, state }) => () => {
|
|
101
119
|
if (!props.closeOnClickModal) {
|
|
102
120
|
return;
|
|
103
121
|
}
|
|
104
|
-
|
|
122
|
+
if (state.mouseDownWrapperFlag && state.mouseUpWrapperFlag) {
|
|
123
|
+
api.handleClose("mask");
|
|
124
|
+
}
|
|
105
125
|
};
|
|
106
126
|
const handleClose = ({
|
|
107
127
|
api,
|
|
@@ -193,14 +213,24 @@ const handleDrag = ({ parent, props, state, emit }) => (event) => {
|
|
|
193
213
|
}
|
|
194
214
|
let offsetWidth = modalBoxElem.offsetWidth;
|
|
195
215
|
let offsetHeight = modalBoxElem.offsetHeight;
|
|
196
|
-
let
|
|
197
|
-
let
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
216
|
+
let left;
|
|
217
|
+
let top;
|
|
218
|
+
if (!props.dragOutsideWindow) {
|
|
219
|
+
let maxX = Math.max(visibleWidth - offsetWidth, 0);
|
|
220
|
+
let maxY = Math.max(visibleHeight - offsetHeight, 0);
|
|
221
|
+
left = event2.clientX - disX;
|
|
222
|
+
top = event2.clientY - disY;
|
|
223
|
+
left = left < 0 ? 0 : left > maxX ? maxX : left;
|
|
224
|
+
top = top < 0 ? 0 : top > maxY ? maxY : top;
|
|
225
|
+
} else {
|
|
226
|
+
let maxX = visibleWidth - 10;
|
|
227
|
+
let maxY = visibleHeight - 10;
|
|
228
|
+
left = event2.clientX - disX;
|
|
229
|
+
top = event2.clientY - disY;
|
|
230
|
+
left = event2.clientX < 0 ? -disX : left > maxX ? maxX : left;
|
|
231
|
+
top = event2.clientY < 0 ? -disY : top > maxY ? maxY : top;
|
|
232
|
+
}
|
|
233
|
+
state.dragStyle = { left: `${left}px`, top: `${top}px` };
|
|
204
234
|
state.left = `${left}px`;
|
|
205
235
|
state.top = `${top}px`;
|
|
206
236
|
state.emitter.emit("boxdrag");
|
|
@@ -237,5 +267,7 @@ export {
|
|
|
237
267
|
showScrollbar,
|
|
238
268
|
unMounted,
|
|
239
269
|
updatePopper,
|
|
270
|
+
useMouseEventDown,
|
|
271
|
+
useMouseEventUp,
|
|
240
272
|
watchVisible
|
|
241
273
|
};
|
package/dialog-box/vue.js
CHANGED
|
@@ -12,6 +12,8 @@ import {
|
|
|
12
12
|
hide,
|
|
13
13
|
handleClose,
|
|
14
14
|
handleWrapperClick,
|
|
15
|
+
useMouseEventDown,
|
|
16
|
+
useMouseEventUp,
|
|
15
17
|
mounted,
|
|
16
18
|
unMounted,
|
|
17
19
|
updatePopper,
|
|
@@ -26,6 +28,8 @@ const api = [
|
|
|
26
28
|
"afterLeave",
|
|
27
29
|
"handleClose",
|
|
28
30
|
"handleWrapperClick",
|
|
31
|
+
"useMouseEventDown",
|
|
32
|
+
"useMouseEventUp",
|
|
29
33
|
"handleCancel",
|
|
30
34
|
"handleConfirm",
|
|
31
35
|
"handleDrag",
|
|
@@ -36,8 +40,10 @@ const initState = ({
|
|
|
36
40
|
computed,
|
|
37
41
|
api: api2,
|
|
38
42
|
emitter,
|
|
39
|
-
props
|
|
43
|
+
props,
|
|
44
|
+
useBreakpoint
|
|
40
45
|
}) => {
|
|
46
|
+
const { current } = useBreakpoint();
|
|
41
47
|
const state = reactive({
|
|
42
48
|
emitter: emitter(),
|
|
43
49
|
key: 0,
|
|
@@ -52,7 +58,9 @@ const initState = ({
|
|
|
52
58
|
isFull: props.fullscreen,
|
|
53
59
|
style: computed(() => api2.computedStyle()),
|
|
54
60
|
bodyStyle: computed(() => api2.computedBodyStyle()),
|
|
55
|
-
animationName: computed(() => api2.computedAnimationName())
|
|
61
|
+
animationName: computed(() => api2.computedAnimationName()),
|
|
62
|
+
current,
|
|
63
|
+
dragStyle: null
|
|
56
64
|
});
|
|
57
65
|
return state;
|
|
58
66
|
};
|
|
@@ -75,6 +83,7 @@ const initApi = ({
|
|
|
75
83
|
usePopups,
|
|
76
84
|
nextTick,
|
|
77
85
|
broadcast,
|
|
86
|
+
designConfig,
|
|
78
87
|
vm
|
|
79
88
|
}) => {
|
|
80
89
|
const { open, close } = usePopups;
|
|
@@ -86,7 +95,9 @@ const initApi = ({
|
|
|
86
95
|
handleCancel: handleCancel({ api: api2, emit }),
|
|
87
96
|
handleConfirm: handleConfirm({ api: api2, emit }),
|
|
88
97
|
updatePopper: updatePopper({ api: api2, constants }),
|
|
89
|
-
handleWrapperClick: handleWrapperClick({ api: api2, props }),
|
|
98
|
+
handleWrapperClick: handleWrapperClick({ api: api2, props, state }),
|
|
99
|
+
useMouseEventDown: useMouseEventDown({ state }),
|
|
100
|
+
useMouseEventUp: useMouseEventUp({ state }),
|
|
90
101
|
hide: hide({ api: api2, emit, state, props }),
|
|
91
102
|
handleClose: handleClose({ api: api2, constants, emit, parent, props }),
|
|
92
103
|
watchVisible: watchVisible({
|
|
@@ -99,7 +110,7 @@ const initApi = ({
|
|
|
99
110
|
vm,
|
|
100
111
|
state
|
|
101
112
|
}),
|
|
102
|
-
computedStyle: computedStyle({ state, props }),
|
|
113
|
+
computedStyle: computedStyle({ state, props, designConfig }),
|
|
103
114
|
computedBodyStyle: computedBodyStyle({ props }),
|
|
104
115
|
mounted: mounted({ api: api2, parent, props }),
|
|
105
116
|
unMounted: unMounted({ api: api2, parent, props }),
|
|
@@ -120,10 +131,21 @@ const initWatch = ({ watch, state, api: api2, props }) => {
|
|
|
120
131
|
}
|
|
121
132
|
);
|
|
122
133
|
};
|
|
123
|
-
const renderless = (props, { computed, onBeforeUnmount, onMounted, toRefs, reactive, watch }, {
|
|
134
|
+
const renderless = (props, { computed, onBeforeUnmount, onMounted, toRefs, reactive, watch }, {
|
|
135
|
+
vm,
|
|
136
|
+
emitter,
|
|
137
|
+
parent,
|
|
138
|
+
emit,
|
|
139
|
+
constants,
|
|
140
|
+
nextTick,
|
|
141
|
+
mode,
|
|
142
|
+
broadcast,
|
|
143
|
+
designConfig,
|
|
144
|
+
useBreakpoint
|
|
145
|
+
}) => {
|
|
124
146
|
const api2 = {};
|
|
125
147
|
const lockScrollClass = constants.scrollLockClass(mode);
|
|
126
|
-
let state = initState({ reactive, computed, api: api2, emitter, props });
|
|
148
|
+
let state = initState({ reactive, computed, api: api2, emitter, props, useBreakpoint });
|
|
127
149
|
const usePopups = usePopup({
|
|
128
150
|
api: api2,
|
|
129
151
|
nextTick,
|
|
@@ -146,7 +168,8 @@ const renderless = (props, { computed, onBeforeUnmount, onMounted, toRefs, react
|
|
|
146
168
|
lockScrollClass,
|
|
147
169
|
nextTick,
|
|
148
170
|
vm,
|
|
149
|
-
broadcast
|
|
171
|
+
broadcast,
|
|
172
|
+
designConfig
|
|
150
173
|
});
|
|
151
174
|
state = mergeState({ reactive, state, toRefs, usePopups });
|
|
152
175
|
initWatch({ watch, state, api: api2, props });
|
package/dialog-select/index.js
CHANGED
|
@@ -47,7 +47,7 @@ const queryGridData = ({ api, props, state }) => () => {
|
|
|
47
47
|
const multiGridSelectAll = ({ api, props, state }) => ({ selection, checked }) => {
|
|
48
48
|
if (checked) {
|
|
49
49
|
arrayEach(selection, (item) => {
|
|
50
|
-
const index = findIndexOf(state.selectedValues, (val) => val
|
|
50
|
+
const index = findIndexOf(state.selectedValues, (val) => val === item[props.valueField]);
|
|
51
51
|
if (!~index) {
|
|
52
52
|
state.selectedValues = [...state.selectedValues, item[props.valueField]];
|
|
53
53
|
state.selectedDatas = [...state.selectedDatas, item];
|
|
@@ -62,7 +62,7 @@ const multiGridSelectAll = ({ api, props, state }) => ({ selection, checked }) =
|
|
|
62
62
|
api.selectedBoxInit();
|
|
63
63
|
};
|
|
64
64
|
const multiGridSelectChange = ({ api, props, state }) => ({ row, checked }) => {
|
|
65
|
-
const index = findIndexOf(state.selectedValues, (val) => val
|
|
65
|
+
const index = findIndexOf(state.selectedValues, (val) => val === row[props.valueField]);
|
|
66
66
|
if (checked) {
|
|
67
67
|
if (!~index) {
|
|
68
68
|
state.selectedValues = [...state.selectedValues, row[props.valueField]];
|
|
@@ -109,7 +109,7 @@ const selectedBoxDelete = ({ props, state, vm }) => ({ option: row }) => {
|
|
|
109
109
|
if (multi && popseletor === "tree") {
|
|
110
110
|
vm.$refs.multiTree.setCheckedByNodeKey(row[props.valueField], false);
|
|
111
111
|
}
|
|
112
|
-
const index = findIndexOf(state.selectedValues, (val) => val
|
|
112
|
+
const index = findIndexOf(state.selectedValues, (val) => val === row[props.valueField]);
|
|
113
113
|
if (~index) {
|
|
114
114
|
state.selectedValues = [...state.selectedValues.slice(0, index), ...state.selectedValues.slice(index + 1)];
|
|
115
115
|
state.selectedDatas = [...state.selectedDatas.slice(0, index), ...state.selectedDatas.slice(index + 1)];
|
|
@@ -136,6 +136,7 @@ const doMultiTreeFilter = ({ props, state, nextTick, vm }) => () => {
|
|
|
136
136
|
}
|
|
137
137
|
state.multiTreeStore.viewType = "plain";
|
|
138
138
|
state.multiTreeStore.expandedKeys = expandedKeys;
|
|
139
|
+
vm.$refs.multiTree.filter(state.multiTreeStore.filterText);
|
|
139
140
|
});
|
|
140
141
|
}
|
|
141
142
|
} else {
|
|
@@ -339,7 +340,9 @@ const watchMulti = ({ api, state, props }) => () => {
|
|
|
339
340
|
state.lookupStore.datas = [];
|
|
340
341
|
api.doAutoLookup();
|
|
341
342
|
};
|
|
343
|
+
const clearStatus = (api) => () => api.watchMulti();
|
|
342
344
|
export {
|
|
345
|
+
clearStatus,
|
|
343
346
|
computedConfig,
|
|
344
347
|
computedGridColumns,
|
|
345
348
|
doAutoLookup,
|
package/dialog-select/vue.js
CHANGED
|
@@ -23,7 +23,8 @@ import {
|
|
|
23
23
|
doAutoLookup,
|
|
24
24
|
multiTreeRadio,
|
|
25
25
|
multiGridRadioChange,
|
|
26
|
-
watchMulti
|
|
26
|
+
watchMulti,
|
|
27
|
+
clearStatus
|
|
27
28
|
} from "./index";
|
|
28
29
|
const api = [
|
|
29
30
|
"state",
|
|
@@ -43,7 +44,8 @@ const api = [
|
|
|
43
44
|
"onFooterCancel",
|
|
44
45
|
"onFooterConfirm",
|
|
45
46
|
"multiTreeRadio",
|
|
46
|
-
"multiGridRadioChange"
|
|
47
|
+
"multiGridRadioChange",
|
|
48
|
+
"clearStatus"
|
|
47
49
|
];
|
|
48
50
|
const renderless = (props, { reactive, computed, watch }, { vm, nextTick, emit }) => {
|
|
49
51
|
const state = reactive({
|
|
@@ -68,7 +70,8 @@ const renderless = (props, { reactive, computed, watch }, { vm, nextTick, emit }
|
|
|
68
70
|
},
|
|
69
71
|
lookupStore: {
|
|
70
72
|
datas: []
|
|
71
|
-
}
|
|
73
|
+
},
|
|
74
|
+
theme: vm.theme
|
|
72
75
|
});
|
|
73
76
|
state.temporary = {};
|
|
74
77
|
const api2 = {
|
|
@@ -98,7 +101,8 @@ const renderless = (props, { reactive, computed, watch }, { vm, nextTick, emit }
|
|
|
98
101
|
queryGridData: queryGridData({ api: api2, props, state }),
|
|
99
102
|
setChecked: setChecked({ api: api2, props, state }),
|
|
100
103
|
multiTreeRadio: multiTreeRadio({ api: api2, props }),
|
|
101
|
-
watchMulti: watchMulti({ api: api2, state, props })
|
|
104
|
+
watchMulti: watchMulti({ api: api2, state, props }),
|
|
105
|
+
clearStatus: clearStatus(api2)
|
|
102
106
|
});
|
|
103
107
|
watch(
|
|
104
108
|
() => props.visible,
|
package/drawer/index.js
CHANGED
|
@@ -1,9 +1,20 @@
|
|
|
1
1
|
import "../chunk-G2ADBYYC.js";
|
|
2
2
|
import debounce from "../common/deps/debounce";
|
|
3
3
|
import { addClass, removeClass } from "../common/deps/dom";
|
|
4
|
-
const
|
|
5
|
-
state
|
|
6
|
-
|
|
4
|
+
const computedWidth = ({
|
|
5
|
+
state,
|
|
6
|
+
designConfig,
|
|
7
|
+
props,
|
|
8
|
+
constants
|
|
9
|
+
}) => () => {
|
|
10
|
+
var _a;
|
|
11
|
+
if (state.width) {
|
|
12
|
+
return state.width + "px";
|
|
13
|
+
}
|
|
14
|
+
return props.width || ((_a = designConfig == null ? void 0 : designConfig.constants) == null ? void 0 : _a.DEFAULT_WIDTH) || constants.DEFAULT_WIDTH;
|
|
15
|
+
};
|
|
16
|
+
const close = ({ api }) => (force = false) => {
|
|
17
|
+
api.handleClose("close", force);
|
|
7
18
|
};
|
|
8
19
|
const watchVisible = ({ state }) => (bool) => {
|
|
9
20
|
setTimeout(() => {
|
|
@@ -15,9 +26,17 @@ const watchToggle = ({ emit }) => (bool) => {
|
|
|
15
26
|
emit("update:visible", bool);
|
|
16
27
|
}, 0);
|
|
17
28
|
};
|
|
18
|
-
const confirm = ({
|
|
29
|
+
const confirm = ({ api }) => () => {
|
|
30
|
+
api.handleClose("confirm");
|
|
31
|
+
};
|
|
32
|
+
const handleClose = ({ emit, props, state }) => (type, force) => {
|
|
33
|
+
const isMaskNotClosable = type === "mask" && !props.maskClosable;
|
|
34
|
+
const isBlockClose = !force && typeof props.beforeClose === "function" && props.beforeClose(type) === false;
|
|
35
|
+
if (isMaskNotClosable || isBlockClose) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
19
38
|
state.toggle = false;
|
|
20
|
-
emit("confirm", state);
|
|
39
|
+
emit(["close", "confirm"].includes(type) ? type : "close", state);
|
|
21
40
|
};
|
|
22
41
|
const mousedown = ({ state, vm }) => (event2) => {
|
|
23
42
|
event2.preventDefault();
|
|
@@ -50,6 +69,7 @@ const mouseup = ({ state }) => () => {
|
|
|
50
69
|
if (!state.dragEvent.isDrag) {
|
|
51
70
|
return;
|
|
52
71
|
}
|
|
72
|
+
;
|
|
53
73
|
event.preventDefault();
|
|
54
74
|
state.dragEvent.isDrag = false;
|
|
55
75
|
};
|
|
@@ -85,7 +105,9 @@ const watchVisibleNotImmediate = ({ api, props }) => (visible) => {
|
|
|
85
105
|
export {
|
|
86
106
|
addDragEvent,
|
|
87
107
|
close,
|
|
108
|
+
computedWidth,
|
|
88
109
|
confirm,
|
|
110
|
+
handleClose,
|
|
89
111
|
hideScrollbar,
|
|
90
112
|
mousedown,
|
|
91
113
|
mousemove,
|