@opentiny/vue-renderless 3.13.1 → 3.14.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/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/date.js +7 -5
- package/common/deps/clickoutside.js +6 -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 +14 -6
- package/date-table/index.js +5 -0
- package/date-table/vue.js +3 -1
- 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 +46 -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 +258 -49
- package/picker/mb.js +42 -0
- package/picker/vue.js +70 -17
- 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 +71 -32
- 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 +457 -389
- package/select/vue.js +257 -161
- 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 +31 -5
- 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/alert.type.d.ts +1 -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 +9 -3
- package/types/collapse.type.d.ts +20 -3
- package/types/date-picker.type.d.ts +37 -0
- 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-222799ae.d.ts} +5 -2
- 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 +1 -5
- 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/milestone.type.d.ts +1 -1
- 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 +13 -1
- package/types/picker.type.d.ts +18 -0
- package/types/popconfirm.type.d.ts +86 -1
- package/types/popeditor.type.d.ts +5 -1
- package/types/popover.type.d.ts +3 -3
- package/types/progress.type.d.ts +3 -1
- 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 +15 -4
- package/types/switch.type.d.ts +3 -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 +2 -2
- package/types/{upload-list.type-343e8c11.d.ts → upload-list.type-a29aea50.d.ts} +31 -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 +34 -25
- 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,11 @@ 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
|
+
confirmButtonProps: __spreadValues({
|
|
121
|
+
plain: true,
|
|
122
|
+
type: "default"
|
|
123
|
+
}, (_a = designConfig == null ? void 0 : designConfig.state) == null ? void 0 : _a.confirmButtonProps)
|
|
116
124
|
});
|
|
117
125
|
return state;
|
|
118
126
|
};
|
|
@@ -172,10 +180,10 @@ const initApi = ({ api: api2, state, t, vm, nextTick, emit, constants }) => {
|
|
|
172
180
|
watchPickerVisible: watchPickerVisible({ state, constants })
|
|
173
181
|
});
|
|
174
182
|
};
|
|
175
|
-
const renderless = (props, { computed, reactive, watch, nextTick }, { t, emit: $emit, vm, constants }) => {
|
|
183
|
+
const renderless = (props, { computed, reactive, watch, nextTick }, { t, emit: $emit, vm, constants, designConfig }) => {
|
|
176
184
|
const api2 = {};
|
|
177
185
|
const emit = props.emitter ? props.emitter.emit : $emit;
|
|
178
|
-
const state = initState({ reactive, computed, api: api2, constants });
|
|
186
|
+
const state = initState({ reactive, computed, api: api2, constants, designConfig });
|
|
179
187
|
initApi({ api: api2, state, t, vm, nextTick, emit, constants });
|
|
180
188
|
initWatch({ watch, state, api: api2 });
|
|
181
189
|
return api2;
|
package/date-table/index.js
CHANGED
|
@@ -357,6 +357,10 @@ const handleClick = ({ api, emit, props, state }) => (event) => {
|
|
|
357
357
|
emit("pick", newValue);
|
|
358
358
|
}
|
|
359
359
|
};
|
|
360
|
+
const getCssToken = ({ api }) => (cell, prexfix = "") => {
|
|
361
|
+
const cssStr = api.getCellClasses(cell) || "";
|
|
362
|
+
return cssStr.split(" ").map((className) => prexfix + className);
|
|
363
|
+
};
|
|
360
364
|
export {
|
|
361
365
|
arrayFind,
|
|
362
366
|
arrayFindIndex,
|
|
@@ -365,6 +369,7 @@ export {
|
|
|
365
369
|
getCell,
|
|
366
370
|
getCellClasses,
|
|
367
371
|
getCellRangeClasses,
|
|
372
|
+
getCssToken,
|
|
368
373
|
getDateOfCell,
|
|
369
374
|
getDateTimestamp,
|
|
370
375
|
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: [[], [], [], [], [], []],
|
|
@@ -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,
|
package/drawer/vue.js
CHANGED
|
@@ -11,22 +11,27 @@ import {
|
|
|
11
11
|
removeDragEvent,
|
|
12
12
|
showScrollbar,
|
|
13
13
|
hideScrollbar,
|
|
14
|
-
watchVisibleNotImmediate
|
|
14
|
+
watchVisibleNotImmediate,
|
|
15
|
+
handleClose,
|
|
16
|
+
computedWidth
|
|
15
17
|
} from "./index";
|
|
16
|
-
const api = ["state", "close", "confirm"];
|
|
17
|
-
const renderless = (props, { reactive, watch, onMounted, onBeforeUnmount, computed }, { emit, vm, mode, constants }) => {
|
|
18
|
+
const api = ["state", "close", "confirm", "handleClose"];
|
|
19
|
+
const renderless = (props, { reactive, watch, onMounted, onBeforeUnmount, computed }, { emit, vm, mode, constants, designConfig }) => {
|
|
20
|
+
var _a;
|
|
18
21
|
const lockScrollClass = constants.SCROLL_LOCK_CLASS(mode);
|
|
19
22
|
const api2 = {};
|
|
20
23
|
const state = reactive({
|
|
21
24
|
toggle: false,
|
|
22
25
|
width: 0,
|
|
23
26
|
dragEvent: { x: 0, isDrag: false, offsetWidth: 0 },
|
|
24
|
-
computedWidth: computed(() =>
|
|
27
|
+
computedWidth: computed(() => api2.computedWidth()),
|
|
28
|
+
btnOrderReversed: vm.theme === "saas" || ((_a = designConfig == null ? void 0 : designConfig.state) == null ? void 0 : _a.btnOrderReversed)
|
|
25
29
|
});
|
|
26
30
|
Object.assign(api2, {
|
|
27
31
|
state,
|
|
28
|
-
confirm: confirm({
|
|
29
|
-
close: close({
|
|
32
|
+
confirm: confirm({ api: api2 }),
|
|
33
|
+
close: close({ api: api2 }),
|
|
34
|
+
handleClose: handleClose({ emit, props, state }),
|
|
30
35
|
mousedown: mousedown({ state, vm }),
|
|
31
36
|
mousemove: mousemove({ state, props }),
|
|
32
37
|
mouseup: mouseup({ state }),
|
|
@@ -36,11 +41,13 @@ const renderless = (props, { reactive, watch, onMounted, onBeforeUnmount, comput
|
|
|
36
41
|
watchToggle: watchToggle({ emit }),
|
|
37
42
|
showScrollbar: showScrollbar(lockScrollClass),
|
|
38
43
|
hideScrollbar: hideScrollbar(lockScrollClass),
|
|
39
|
-
watchVisibleNotImmediate: watchVisibleNotImmediate({ api: api2, props })
|
|
44
|
+
watchVisibleNotImmediate: watchVisibleNotImmediate({ api: api2, props }),
|
|
45
|
+
computedWidth: computedWidth({ state, designConfig, props, constants })
|
|
40
46
|
});
|
|
41
47
|
onMounted(() => {
|
|
42
48
|
props.dragable && api2.addDragEvent();
|
|
43
49
|
if (props.lockScroll && props.visible) {
|
|
50
|
+
;
|
|
44
51
|
api2.showScrollbar();
|
|
45
52
|
}
|
|
46
53
|
});
|
package/dropdown/index.js
CHANGED
|
@@ -20,7 +20,7 @@ const show = ({ props, state }) => () => {
|
|
|
20
20
|
() => {
|
|
21
21
|
state.visible = true;
|
|
22
22
|
},
|
|
23
|
-
|
|
23
|
+
state.trigger === "click" ? 0 : props.showTimeout
|
|
24
24
|
);
|
|
25
25
|
};
|
|
26
26
|
const hide = ({ api, props, state }) => () => {
|
|
@@ -36,7 +36,7 @@ const hide = ({ api, props, state }) => () => {
|
|
|
36
36
|
() => {
|
|
37
37
|
state.visible = false;
|
|
38
38
|
},
|
|
39
|
-
|
|
39
|
+
state.trigger === "click" ? 0 : props.hideTimeout
|
|
40
40
|
);
|
|
41
41
|
};
|
|
42
42
|
const handleClick = ({ api, props, state, emit }) => () => {
|
|
@@ -128,12 +128,12 @@ const initEvent = ({ api, props, state, vm, mode }) => () => {
|
|
|
128
128
|
on(state.triggerElm, "blur", toggleFocus({ state, value: false }));
|
|
129
129
|
on(state.triggerElm, "click", toggleFocus({ state, value: false }));
|
|
130
130
|
}
|
|
131
|
-
if (
|
|
131
|
+
if (state.trigger === "hover") {
|
|
132
132
|
on(state.triggerElm, "mouseenter", api.show);
|
|
133
133
|
on(state.triggerElm, "mouseleave", api.hide);
|
|
134
134
|
on(state.dropdownElm, "mouseenter", api.show);
|
|
135
135
|
on(state.dropdownElm, "mouseleave", api.hide);
|
|
136
|
-
} else if (
|
|
136
|
+
} else if (state.trigger === "click") {
|
|
137
137
|
on(state.triggerElm, "click", api.handleClick);
|
|
138
138
|
}
|
|
139
139
|
if (mode === "mobile-first") {
|
|
@@ -173,8 +173,8 @@ const mounted = ({ api, vm, state, broadcast }) => () => {
|
|
|
173
173
|
}
|
|
174
174
|
vm.$on("menu-item-click", api.handleMenuItemClick);
|
|
175
175
|
vm.$on("current-item-click", api.handleMenuItemClick);
|
|
176
|
-
vm.$on("
|
|
177
|
-
broadcast("TinyDropdownMenu", "
|
|
176
|
+
vm.$on("selected-index", (selectedIndex) => {
|
|
177
|
+
broadcast("TinyDropdownMenu", "menu-selected-index", selectedIndex);
|
|
178
178
|
});
|
|
179
179
|
vm.$on("is-disabled", api.clickOutside);
|
|
180
180
|
};
|
|
@@ -196,7 +196,7 @@ const beforeDistory = ({ api, state }) => () => {
|
|
|
196
196
|
state.dropdownElm = null;
|
|
197
197
|
}
|
|
198
198
|
};
|
|
199
|
-
const clickOutside = ({ props, api
|
|
199
|
+
const clickOutside = ({ props, api }) => (disabled) => {
|
|
200
200
|
if (props.hideOnClick) {
|
|
201
201
|
disabled ? api.show() : api.hide();
|
|
202
202
|
}
|
package/dropdown/vue.js
CHANGED
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
clickOutside
|
|
22
22
|
} from "./index";
|
|
23
23
|
const api = ["state", "handleMainButtonClick", "hide", "show", "initDomOperation", "handleClick", "clickOutside"];
|
|
24
|
-
const renderless = (props, { reactive, watch, provide, onMounted }, { emit, parent, broadcast, vm, nextTick, mode, designConfig }) => {
|
|
24
|
+
const renderless = (props, { reactive, watch, provide, onMounted, computed }, { emit, parent, broadcast, vm, nextTick, mode, designConfig }) => {
|
|
25
25
|
const api2 = {};
|
|
26
26
|
const state = reactive({
|
|
27
27
|
visible: false,
|
|
@@ -34,7 +34,11 @@ const renderless = (props, { reactive, watch, provide, onMounted }, { emit, pare
|
|
|
34
34
|
listId: `dropdown-menu-${guid()}`,
|
|
35
35
|
showIcon: props.showIcon,
|
|
36
36
|
showSelfIcon: props.showSelfIcon,
|
|
37
|
-
designConfig
|
|
37
|
+
designConfig,
|
|
38
|
+
trigger: computed(() => {
|
|
39
|
+
var _a;
|
|
40
|
+
return props.trigger || ((_a = designConfig == null ? void 0 : designConfig.props) == null ? void 0 : _a.trigger) || "hover";
|
|
41
|
+
})
|
|
38
42
|
});
|
|
39
43
|
provide("dropdownVm", vm);
|
|
40
44
|
Object.assign(api2, {
|
package/dropdown-item/index.js
CHANGED
|
@@ -89,14 +89,22 @@ const clickOutside = (parent) => () => {
|
|
|
89
89
|
});
|
|
90
90
|
}
|
|
91
91
|
};
|
|
92
|
-
const handleClick = ({
|
|
92
|
+
const handleClick = ({
|
|
93
|
+
state,
|
|
94
|
+
props,
|
|
95
|
+
dispatch,
|
|
96
|
+
vm,
|
|
97
|
+
emit
|
|
98
|
+
}) => (event) => {
|
|
93
99
|
event.stopPropagation();
|
|
100
|
+
state.currentIndex = `${props.currentIndex}`;
|
|
94
101
|
const data = { itemData: props.itemData, vm, disabled: props.disabled };
|
|
95
102
|
if (!props.disabled) {
|
|
96
103
|
emit("item-click", data);
|
|
97
104
|
}
|
|
98
105
|
dispatch("TinyDropdown", "menu-item-click", data);
|
|
99
106
|
dispatch("TinyDropdown", "is-disabled", [props.disabled]);
|
|
107
|
+
dispatch("TinyDropdown", "selected-index", [state.currentIndex]);
|
|
100
108
|
};
|
|
101
109
|
const computedGetIcon = ({ constants, designConfig }) => (name = "leftWardArrow") => {
|
|
102
110
|
return (designConfig == null ? void 0 : designConfig.icons[name]) || (constants == null ? void 0 : constants.ICON_MAP[name]);
|