@opentiny/vue-renderless 3.18.6 → 3.19.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-menu/index.js +2 -2
- package/action-menu/vue.js +2 -2
- package/anchor/index.js +8 -6
- package/anchor/vue.js +1 -1
- package/badge/index.js +4 -3
- package/base-select/index.js +3 -3
- package/breadcrumb-item/vue.js +1 -1
- package/bulletin-board/index.js +1 -1
- package/button/index.js +1 -1
- package/button-group/index.js +6 -1
- package/carousel-item/index.js +1 -1
- package/cascader/vue.js +17 -4
- package/chart-core/deps/utils.js +1 -1
- package/checkbox/index.js +1 -1
- package/common/deps/dom.js +9 -1
- package/common/deps/useWindowSize.js +23 -0
- package/common/deps/vue-popper.js +1 -1
- package/common/index.js +2 -2
- package/common/prop-util.js +43 -0
- package/common/runtime.js +1 -1
- package/crop/index.js +14 -22
- package/crop/vue.js +33 -29
- package/date-panel/index.js +13 -2
- package/date-panel/vue.js +16 -10
- package/dialog-select/index.js +78 -0
- package/dialog-select/vue.js +28 -6
- package/drawer/index.js +14 -1
- package/drawer/vue.js +4 -3
- package/dropdown-item/index.js +2 -2
- package/dropdown-item/vue.js +9 -6
- package/espace/index.js +1 -1
- package/fall-menu/index.js +5 -1
- package/fall-menu/vue.js +15 -2
- package/filter-box/vue.js +5 -2
- package/floatbar/index.js +1 -1
- package/form/index.js +7 -4
- package/form/vue.js +1 -1
- package/grid/plugins/export.js +1 -1
- package/grid/utils/dom.js +3 -1
- package/guide/index.js +17 -2
- package/guide/vue.js +5 -3
- package/image-viewer/vue.js +1 -1
- package/input/index.js +6 -7
- package/input/vue.js +10 -11
- package/ip-address/index.js +0 -10
- package/ip-address/vue.js +2 -5
- package/load-list/index.js +43 -0
- package/load-list/vue.js +69 -0
- package/locales/index.js +1 -5
- package/logout/index.js +1 -1
- package/milestone/index.js +55 -8
- package/milestone/vue.js +16 -3
- package/modal/index.js +6 -6
- package/modal/vue.js +4 -3
- package/nav-menu/index.js +1 -1
- package/package.json +1 -1
- package/pager/index.js +25 -0
- package/pager/vue.js +18 -4
- package/picker/index.js +3 -3
- package/picker/vue.js +1 -1
- package/popeditor/index.js +12 -1
- package/popeditor/vue.js +9 -5
- package/rich-text/table-module.js +4 -3
- package/roles/index.js +1 -1
- package/select/index.js +6 -6
- package/select/vue.js +2 -1
- package/selected-box/vue.js +2 -1
- package/slider/index.js +2 -2
- package/slider-button-group/vue.js +3 -2
- package/split/vue.js +4 -2
- package/sticky/index.js +89 -0
- package/sticky/vue.js +74 -0
- package/tabbar-item/vue.js +1 -1
- package/tall-storage/index.js +1 -1
- package/time/vue.js +2 -1
- package/time-range/vue.js +4 -1
- package/time-spinner/index.js +4 -1
- package/toggle-menu/index.js +1 -1
- package/transfer-panel/vue.js +7 -6
- package/tree/index.js +17 -7
- package/tree/vue.js +10 -6
- package/tree-node/index.js +2 -2
- package/tree-node/vue.js +6 -2
- package/tree-select/index.js +7 -1
- package/tree-select/vue.js +3 -3
- package/types/action-menu.type.d.ts +1 -1
- package/types/alert.type.d.ts +2 -0
- package/types/anchor.type.d.ts +5 -1
- package/types/badge.type.d.ts +1 -1
- package/types/button-group.type.d.ts +3 -0
- package/types/button.type.d.ts +1 -1
- package/types/date-picker.type.d.ts +3 -0
- package/types/drawer.type.d.ts +5 -1
- package/types/{dropdown-item.type-16d59fd0.d.ts → dropdown-item.type-c9badbc1.d.ts} +2 -2
- package/types/dropdown-item.type.d.ts +1 -1
- package/types/dropdown-menu.type.d.ts +1 -1
- package/types/fall-menu.type.d.ts +1 -0
- package/types/file-upload.type.d.ts +1 -1
- package/types/image.type.d.ts +4 -0
- package/types/input.type.d.ts +7 -3
- package/types/load-list.type.d.ts +58 -0
- package/types/milestone.type.d.ts +27 -1
- package/types/modal.type.d.ts +3 -2
- package/types/pager.type.d.ts +5 -1
- package/types/picker.type.d.ts +3 -0
- package/types/search.type.d.ts +0 -3
- package/types/steps.type.d.ts +1 -0
- package/types/tag.type.d.ts +1 -0
- package/types/tooltip.type.d.ts +3 -0
- package/types/tree-menu.type.d.ts +8 -0
- package/types/upload-dragger.type.d.ts +1 -1
- package/types/{upload-list.type-4194f534.d.ts → upload-list.type-8d9e2600.d.ts} +8 -0
- package/types/upload-list.type.d.ts +1 -1
- package/types/upload.type.d.ts +1 -1
- package/types/user-contact.type.d.ts +127 -1
- package/types/user-head.type.d.ts +1 -4
- package/upload-list/vue.js +7 -7
- package/virtual-scroll-box/index.js +294 -0
- package/virtual-scroll-box/vue.js +43 -0
- package/virtual-tree/index.js +168 -0
- package/virtual-tree/vue.js +53 -0
package/date-panel/vue.js
CHANGED
|
@@ -44,7 +44,8 @@ import {
|
|
|
44
44
|
computerTimeFormat,
|
|
45
45
|
watchVisible,
|
|
46
46
|
getDisabledNow,
|
|
47
|
-
getDisabledConfirm
|
|
47
|
+
getDisabledConfirm,
|
|
48
|
+
getNowTime
|
|
48
49
|
} from "./index";
|
|
49
50
|
import { getWeekNumber, extractDateFormat } from "../common/deps/date-util";
|
|
50
51
|
import { DATEPICKER, DATE } from "../common";
|
|
@@ -72,9 +73,11 @@ const api = [
|
|
|
72
73
|
"handleVisibleDateChange",
|
|
73
74
|
"handleLeave",
|
|
74
75
|
"handleShortcutClick",
|
|
75
|
-
"handleTimePickClose"
|
|
76
|
+
"handleTimePickClose",
|
|
77
|
+
"getNowTime"
|
|
76
78
|
];
|
|
77
|
-
const initState = ({ reactive, computed, api: api2, i18n }) => {
|
|
79
|
+
const initState = ({ reactive, computed, api: api2, i18n, designConfig }) => {
|
|
80
|
+
var _a, _b;
|
|
78
81
|
const state = reactive({
|
|
79
82
|
popperClass: "",
|
|
80
83
|
date: /* @__PURE__ */ new Date(),
|
|
@@ -118,7 +121,9 @@ const initState = ({ reactive, computed, api: api2, i18n }) => {
|
|
|
118
121
|
dateFormat: computed(() => state.format ? extractDateFormat(state.format.replace(state.timefmt, "")) : DATE.Date),
|
|
119
122
|
lang: computed(() => i18n ? i18n.locale.replace(/_/g, "-") : "zh-CN"),
|
|
120
123
|
isShowTz: computed(() => state.showTimezone && state.showTime),
|
|
121
|
-
isShowFooter: computed(() => state.footerVisible && [DATEPICKER.Date, DATEPICKER.Year].includes(state.currentView))
|
|
124
|
+
isShowFooter: computed(() => state.footerVisible && [DATEPICKER.Date, DATEPICKER.Year].includes(state.currentView)),
|
|
125
|
+
buttonType: ((_a = designConfig == null ? void 0 : designConfig.state) == null ? void 0 : _a.buttonType) || "default",
|
|
126
|
+
buttonSize: ((_b = designConfig == null ? void 0 : designConfig.state) == null ? void 0 : _b.buttonSize) || ""
|
|
122
127
|
});
|
|
123
128
|
state.needChangeTimezoneData = true;
|
|
124
129
|
return state;
|
|
@@ -150,7 +155,7 @@ const initWatch = ({ watch, state, api: api2, nextTick }) => {
|
|
|
150
155
|
);
|
|
151
156
|
watch(() => state.visible, api2.watchVisible);
|
|
152
157
|
};
|
|
153
|
-
const initApi = ({ api: api2, state, t, emit, nextTick, vm, watch }) => {
|
|
158
|
+
const initApi = ({ api: api2, state, t, emit, nextTick, vm, watch, props }) => {
|
|
154
159
|
Object.assign(api2, {
|
|
155
160
|
t,
|
|
156
161
|
state,
|
|
@@ -181,7 +186,7 @@ const initApi = ({ api: api2, state, t, emit, nextTick, vm, watch }) => {
|
|
|
181
186
|
searchTz: searchTz({ api: api2, state }),
|
|
182
187
|
handleEnter: handleEnter(api2),
|
|
183
188
|
handleLeave: handleLeave({ api: api2, emit }),
|
|
184
|
-
changeToNow: changeToNow({ api: api2, state }),
|
|
189
|
+
changeToNow: changeToNow({ api: api2, state, props }),
|
|
185
190
|
isValidValue: isValidValue({ api: api2, state }),
|
|
186
191
|
handleClear: handleClear({ api: api2, state, emit }),
|
|
187
192
|
watchValue: watchValue({ api: api2, state }),
|
|
@@ -198,14 +203,15 @@ const initApi = ({ api: api2, state, t, emit, nextTick, vm, watch }) => {
|
|
|
198
203
|
handleVisibleTimeChange: handleVisibleTimeChange({ api: api2, vm, state, t }),
|
|
199
204
|
computerTimeFormat: computerTimeFormat({ state }),
|
|
200
205
|
getDisabledNow: getDisabledNow({ state }),
|
|
201
|
-
getDisabledConfirm: getDisabledConfirm({ state })
|
|
206
|
+
getDisabledConfirm: getDisabledConfirm({ state }),
|
|
207
|
+
getNowTime: getNowTime({ props })
|
|
202
208
|
});
|
|
203
209
|
};
|
|
204
|
-
const renderless = (props, { computed, reactive, watch, nextTick }, { t, emit: $emit, vm, i18n }) => {
|
|
210
|
+
const renderless = (props, { computed, reactive, watch, nextTick }, { t, emit: $emit, vm, i18n, designConfig }) => {
|
|
205
211
|
const api2 = {};
|
|
206
212
|
const emit = props.emitter ? props.emitter.emit : $emit;
|
|
207
|
-
const state = initState({ reactive, computed, api: api2, i18n });
|
|
208
|
-
initApi({ api: api2, state, t, emit, nextTick, vm, watch });
|
|
213
|
+
const state = initState({ reactive, computed, api: api2, i18n, designConfig });
|
|
214
|
+
initApi({ api: api2, state, t, emit, nextTick, vm, watch, props });
|
|
209
215
|
initWatch({ watch, state, api: api2, nextTick });
|
|
210
216
|
return api2;
|
|
211
217
|
};
|
package/dialog-select/index.js
CHANGED
|
@@ -124,6 +124,80 @@ const selectedBoxClear = ({ props, state, vm }) => () => {
|
|
|
124
124
|
state.selectedDatas = [];
|
|
125
125
|
state.selectedChanged = true;
|
|
126
126
|
};
|
|
127
|
+
const setTreeSelection = ({ api, state, vm, props }) => (keys, value) => {
|
|
128
|
+
const tree = vm.$refs.multiTree;
|
|
129
|
+
if (!tree) {
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
if (value) {
|
|
133
|
+
keys.forEach((key) => {
|
|
134
|
+
if (!state.selectedValues.includes(key)) {
|
|
135
|
+
tree.setCheckedByNodeKey(key, true);
|
|
136
|
+
const datas = getTreeSelect({ vm, props });
|
|
137
|
+
const values = datas.map((item) => item[props.valueField]);
|
|
138
|
+
state.selectedDatas = datas;
|
|
139
|
+
state.selectedValues = values;
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
} else {
|
|
143
|
+
keys.forEach((key) => {
|
|
144
|
+
if (state.selectedValues.includes(key)) {
|
|
145
|
+
tree.setCheckedByNodeKey(key, false);
|
|
146
|
+
const datas = getTreeSelect({ vm, props });
|
|
147
|
+
const values = datas.map((item) => item[props.valueField]);
|
|
148
|
+
state.selectedDatas = datas;
|
|
149
|
+
state.selectedValues = values;
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
api.selectedBoxInit();
|
|
154
|
+
};
|
|
155
|
+
const setGridSelection = ({ api, state, vm }) => (keys, value) => {
|
|
156
|
+
const grid = vm.$refs.multiGrid;
|
|
157
|
+
if (!grid) {
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
const gridRows = [];
|
|
161
|
+
if (value) {
|
|
162
|
+
keys.forEach((key) => {
|
|
163
|
+
if (!state.selectedValues.includes(key)) {
|
|
164
|
+
const row = grid.getRowById(key);
|
|
165
|
+
state.selectedValues = [...state.selectedValues, key];
|
|
166
|
+
state.selectedDatas = [...state.selectedDatas, row];
|
|
167
|
+
gridRows.push(row);
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
} else {
|
|
171
|
+
keys.forEach((key) => {
|
|
172
|
+
if (state.selectedValues.includes(key)) {
|
|
173
|
+
const index = state.selectedValues.indexOf(key);
|
|
174
|
+
state.selectedValues.splice(index, 1);
|
|
175
|
+
state.selectedDatas.splice(index, 1);
|
|
176
|
+
gridRows.push(grid.getRowById(key));
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
grid.setSelection(gridRows, Boolean(value));
|
|
181
|
+
api.selectedBoxInit();
|
|
182
|
+
};
|
|
183
|
+
const setSelection = ({ props, api }) => (data, value) => {
|
|
184
|
+
const { multi, popseletor, valueField } = props;
|
|
185
|
+
if (!multi) {
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
const dataArr = Array.isArray(data) ? data : [data];
|
|
189
|
+
const keys = dataArr.map((i) => i[valueField]).filter((i) => i);
|
|
190
|
+
if (keys.length === 0) {
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
if (popseletor === "grid") {
|
|
194
|
+
return api.setGridSelection(keys, value);
|
|
195
|
+
}
|
|
196
|
+
if (popseletor === "tree") {
|
|
197
|
+
return api.setTreeSelection(keys, value);
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
const getSelection = ({ state }) => () => state.selectedDatas;
|
|
127
201
|
const selectedBoxDelete = ({ props, state, vm }) => ({ option: row }) => {
|
|
128
202
|
const { multi, popseletor } = props;
|
|
129
203
|
if (multi && popseletor === "grid") {
|
|
@@ -376,6 +450,7 @@ export {
|
|
|
376
450
|
doMultiTreeFilter,
|
|
377
451
|
emitChange,
|
|
378
452
|
emitClose,
|
|
453
|
+
getSelection,
|
|
379
454
|
multiGridRadioChange,
|
|
380
455
|
multiGridSelectAll,
|
|
381
456
|
multiGridSelectChange,
|
|
@@ -393,5 +468,8 @@ export {
|
|
|
393
468
|
selectedBoxDrag,
|
|
394
469
|
selectedBoxInit,
|
|
395
470
|
setChecked,
|
|
471
|
+
setGridSelection,
|
|
472
|
+
setSelection,
|
|
473
|
+
setTreeSelection,
|
|
396
474
|
watchMulti
|
|
397
475
|
};
|
package/dialog-select/vue.js
CHANGED
|
@@ -24,7 +24,11 @@ import {
|
|
|
24
24
|
multiTreeRadio,
|
|
25
25
|
multiGridRadioChange,
|
|
26
26
|
watchMulti,
|
|
27
|
-
clearStatus
|
|
27
|
+
clearStatus,
|
|
28
|
+
setGridSelection,
|
|
29
|
+
setTreeSelection,
|
|
30
|
+
setSelection,
|
|
31
|
+
getSelection
|
|
28
32
|
} from "./index";
|
|
29
33
|
const api = [
|
|
30
34
|
"state",
|
|
@@ -45,9 +49,11 @@ const api = [
|
|
|
45
49
|
"onFooterConfirm",
|
|
46
50
|
"multiTreeRadio",
|
|
47
51
|
"multiGridRadioChange",
|
|
48
|
-
"clearStatus"
|
|
52
|
+
"clearStatus",
|
|
53
|
+
"setSelection",
|
|
54
|
+
"getSelection"
|
|
49
55
|
];
|
|
50
|
-
const renderless = (props, { reactive, computed, watch }, { vm, nextTick, emit }) => {
|
|
56
|
+
const renderless = (props, { reactive, computed, watch }, { vm, nextTick, emit, constants, designConfig }) => {
|
|
51
57
|
const state = reactive({
|
|
52
58
|
splitValue: 0,
|
|
53
59
|
gridColumns: computed(() => api2.computedGridColumns()),
|
|
@@ -71,7 +77,15 @@ const renderless = (props, { reactive, computed, watch }, { vm, nextTick, emit }
|
|
|
71
77
|
lookupStore: {
|
|
72
78
|
datas: []
|
|
73
79
|
},
|
|
74
|
-
theme: vm.theme
|
|
80
|
+
theme: vm.theme,
|
|
81
|
+
isBorder: computed(() => {
|
|
82
|
+
if (typeof props.gridOp.border === "boolean") {
|
|
83
|
+
return props.gridOp.border;
|
|
84
|
+
} else {
|
|
85
|
+
return vm.theme !== "saas";
|
|
86
|
+
}
|
|
87
|
+
}),
|
|
88
|
+
constants: (designConfig == null ? void 0 : designConfig.constants) || constants
|
|
75
89
|
});
|
|
76
90
|
state.temporary = {};
|
|
77
91
|
const api2 = {
|
|
@@ -102,11 +116,19 @@ const renderless = (props, { reactive, computed, watch }, { vm, nextTick, emit }
|
|
|
102
116
|
setChecked: setChecked({ api: api2, props, state }),
|
|
103
117
|
multiTreeRadio: multiTreeRadio({ api: api2, props }),
|
|
104
118
|
watchMulti: watchMulti({ api: api2, state, props }),
|
|
105
|
-
clearStatus: clearStatus(api2)
|
|
119
|
+
clearStatus: clearStatus(api2),
|
|
120
|
+
setSelection: setSelection({ api: api2, props }),
|
|
121
|
+
getSelection: getSelection({ state }),
|
|
122
|
+
setTreeSelection: setTreeSelection({ api: api2, state, vm, props }),
|
|
123
|
+
setGridSelection: setGridSelection({ api: api2, state, vm })
|
|
106
124
|
});
|
|
107
125
|
watch(
|
|
108
126
|
() => props.visible,
|
|
109
|
-
(value) =>
|
|
127
|
+
(value) => {
|
|
128
|
+
if (value && !state.multiGridStore.inited) {
|
|
129
|
+
api2.queryGridData();
|
|
130
|
+
}
|
|
131
|
+
}
|
|
110
132
|
);
|
|
111
133
|
watch(
|
|
112
134
|
() => props.multi,
|
package/drawer/index.js
CHANGED
|
@@ -13,7 +13,19 @@ const computedWidth = ({
|
|
|
13
13
|
}
|
|
14
14
|
return props.width || ((_a = designConfig == null ? void 0 : designConfig.constants) == null ? void 0 : _a.DEFAULT_WIDTH) || constants.DEFAULT_WIDTH;
|
|
15
15
|
};
|
|
16
|
-
const
|
|
16
|
+
const computedHeight = ({
|
|
17
|
+
state,
|
|
18
|
+
designConfig,
|
|
19
|
+
props,
|
|
20
|
+
constants
|
|
21
|
+
}) => () => {
|
|
22
|
+
var _a;
|
|
23
|
+
if (state.height) {
|
|
24
|
+
return state.height + "px";
|
|
25
|
+
}
|
|
26
|
+
return props.height || ((_a = designConfig == null ? void 0 : designConfig.constants) == null ? void 0 : _a.DEFAULT_HEIGHT) || constants.DEFAULT_HEIGHT;
|
|
27
|
+
};
|
|
28
|
+
const close = ({ api }) => (force = true) => {
|
|
17
29
|
api.handleClose("close", typeof force === "boolean" ? force : false);
|
|
18
30
|
};
|
|
19
31
|
const watchVisible = ({ state, api }) => (value) => {
|
|
@@ -116,6 +128,7 @@ const hideScrollbar = (lockScrollClass) => () => {
|
|
|
116
128
|
export {
|
|
117
129
|
addDragEvent,
|
|
118
130
|
close,
|
|
131
|
+
computedHeight,
|
|
119
132
|
computedWidth,
|
|
120
133
|
confirm,
|
|
121
134
|
handleClose,
|
package/drawer/vue.js
CHANGED
|
@@ -12,11 +12,11 @@ import {
|
|
|
12
12
|
hideScrollbar,
|
|
13
13
|
handleClose,
|
|
14
14
|
computedWidth,
|
|
15
|
+
computedHeight,
|
|
15
16
|
open
|
|
16
17
|
} from "./index";
|
|
17
18
|
const api = ["state", "close", "confirm", "handleClose", "open"];
|
|
18
19
|
const renderless = (props, { reactive, watch, onMounted, onBeforeUnmount, computed }, { emit, vm, mode, constants, designConfig }) => {
|
|
19
|
-
var _a;
|
|
20
20
|
const lockScrollClass = constants.SCROLL_LOCK_CLASS(mode);
|
|
21
21
|
const api2 = {};
|
|
22
22
|
const state = reactive({
|
|
@@ -25,7 +25,7 @@ const renderless = (props, { reactive, watch, onMounted, onBeforeUnmount, comput
|
|
|
25
25
|
height: 0,
|
|
26
26
|
dragEvent: { x: 0, y: 0, isDrag: false, offsetWidth: 0, offsetHeight: 0 },
|
|
27
27
|
computedWidth: computed(() => api2.computedWidth()),
|
|
28
|
-
|
|
28
|
+
computedHeight: computed(() => api2.computedHeight())
|
|
29
29
|
});
|
|
30
30
|
Object.assign(api2, {
|
|
31
31
|
state,
|
|
@@ -41,7 +41,8 @@ const renderless = (props, { reactive, watch, onMounted, onBeforeUnmount, comput
|
|
|
41
41
|
watchVisible: watchVisible({ state, api: api2 }),
|
|
42
42
|
showScrollbar: showScrollbar(lockScrollClass),
|
|
43
43
|
hideScrollbar: hideScrollbar(lockScrollClass),
|
|
44
|
-
computedWidth: computedWidth({ state, designConfig, props, constants })
|
|
44
|
+
computedWidth: computedWidth({ state, designConfig, props, constants }),
|
|
45
|
+
computedHeight: computedHeight({ state, designConfig, props, constants })
|
|
45
46
|
});
|
|
46
47
|
onMounted(() => {
|
|
47
48
|
props.dragable && api2.addDragEvent();
|
package/dropdown-item/index.js
CHANGED
|
@@ -109,7 +109,7 @@ const handleClick = ({
|
|
|
109
109
|
const computedGetIcon = ({ constants, designConfig }) => (name = "leftWardArrow") => {
|
|
110
110
|
return (designConfig == null ? void 0 : designConfig.icons[name]) || (constants == null ? void 0 : constants.ICON_MAP[name]);
|
|
111
111
|
};
|
|
112
|
-
const
|
|
112
|
+
const computedTip = ({ props, vm }) => () => {
|
|
113
113
|
if (props.tip && typeof props.tip === "function") {
|
|
114
114
|
return props.tip({ itemData: props.itemData, vm });
|
|
115
115
|
}
|
|
@@ -123,10 +123,10 @@ export {
|
|
|
123
123
|
close,
|
|
124
124
|
closed,
|
|
125
125
|
computedGetIcon,
|
|
126
|
+
computedTip,
|
|
126
127
|
confirm,
|
|
127
128
|
getItemStyle,
|
|
128
129
|
getOptionStyle,
|
|
129
|
-
getTip,
|
|
130
130
|
getTitle,
|
|
131
131
|
handleClick,
|
|
132
132
|
onScroll,
|
package/dropdown-item/vue.js
CHANGED
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
getItemStyle,
|
|
19
19
|
handleClick,
|
|
20
20
|
computedGetIcon,
|
|
21
|
-
|
|
21
|
+
computedTip
|
|
22
22
|
} from "./index";
|
|
23
23
|
const api = [
|
|
24
24
|
"state",
|
|
@@ -35,9 +35,9 @@ const api = [
|
|
|
35
35
|
"close",
|
|
36
36
|
"closed",
|
|
37
37
|
"handleClick",
|
|
38
|
-
"
|
|
38
|
+
"computedTip"
|
|
39
39
|
];
|
|
40
|
-
const initState = ({ reactive, computed, api: api2, props, parent, dropdownMenuVm }) => {
|
|
40
|
+
const initState = ({ reactive, computed, api: api2, props, parent, dropdownMenuVm, dropdownVm }) => {
|
|
41
41
|
const state = reactive({
|
|
42
42
|
checkedStatus: dropdownMenuVm == null ? void 0 : dropdownMenuVm.checkedStatus,
|
|
43
43
|
sort: props.modelValue,
|
|
@@ -57,8 +57,10 @@ const initState = ({ reactive, computed, api: api2, props, parent, dropdownMenuV
|
|
|
57
57
|
currentIndex: props.currentIndex,
|
|
58
58
|
textField: (dropdownMenuVm == null ? void 0 : dropdownMenuVm.textField) || props.textField,
|
|
59
59
|
popperClass: (dropdownMenuVm == null ? void 0 : dropdownMenuVm.popperClass) || "",
|
|
60
|
+
sizeClass: (dropdownVm == null ? void 0 : dropdownVm.size) ? `tiny-dropdown-item--${dropdownVm == null ? void 0 : dropdownVm.size}` : "",
|
|
60
61
|
getIcon: computed(() => api2.computedGetIcon()),
|
|
61
|
-
children: []
|
|
62
|
+
children: [],
|
|
63
|
+
computedTip: computed(() => api2.computedTip())
|
|
62
64
|
});
|
|
63
65
|
return state;
|
|
64
66
|
};
|
|
@@ -83,13 +85,14 @@ const initApi = ({ api: api2, state, emit, props, parent, dispatch, vm, constant
|
|
|
83
85
|
confirm: confirm({ emit, props, state }),
|
|
84
86
|
handleClick: handleClick({ state, props, dispatch, vm, emit }),
|
|
85
87
|
computedGetIcon: computedGetIcon({ constants, designConfig }),
|
|
86
|
-
|
|
88
|
+
computedTip: computedTip({ props, vm })
|
|
87
89
|
});
|
|
88
90
|
};
|
|
89
91
|
const renderless = (props, { computed, onMounted, reactive, watch, inject }, { parent, emit, vm, dispatch, constants, designConfig }) => {
|
|
90
92
|
const api2 = {};
|
|
91
93
|
const dropdownMenuVm = inject("dropdownMenuVm", null);
|
|
92
|
-
const
|
|
94
|
+
const dropdownVm = inject("dropdownVm", null);
|
|
95
|
+
const state = initState({ reactive, computed, api: api2, props, parent, dropdownMenuVm, dropdownVm });
|
|
93
96
|
initApi({ api: api2, state, emit, props, parent, dispatch, vm, constants, designConfig });
|
|
94
97
|
watch(() => state.showPopup, api2.bindScroll);
|
|
95
98
|
onMounted(() => {
|
package/espace/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../chunk-G2ADBYYC.js";
|
|
2
|
-
import { xss } from "../common";
|
|
2
|
+
import { xss } from "../common/xss";
|
|
3
3
|
const getUserHref = ({ api, props }) => (item) => {
|
|
4
4
|
const type = item.type ? String(item.type).toLocaleLowerCase() : "";
|
|
5
5
|
const value = item.value ? String(item.value).toLocaleLowerCase() : "";
|
package/fall-menu/index.js
CHANGED
|
@@ -2,13 +2,16 @@ import "../chunk-G2ADBYYC.js";
|
|
|
2
2
|
import { REFRESH_INTERVAL } from "../common";
|
|
3
3
|
import { on, off } from "../common/deps/dom";
|
|
4
4
|
import PopupManager from "../common/deps/popup-manager";
|
|
5
|
-
import { xss } from "../common/xss
|
|
5
|
+
import { xss } from "../common/xss";
|
|
6
6
|
const arrowClick = (state) => (opt) => {
|
|
7
7
|
state.pager += opt;
|
|
8
8
|
};
|
|
9
9
|
const overContent = (state) => (on2) => {
|
|
10
10
|
state.isActive = on2;
|
|
11
11
|
};
|
|
12
|
+
const clickActive = (state) => (index) => {
|
|
13
|
+
state.active = index;
|
|
14
|
+
};
|
|
12
15
|
const mouseover = ({ fall, props, state }) => (index) => {
|
|
13
16
|
const popupBox = fall.value;
|
|
14
17
|
state.activeNode = index;
|
|
@@ -85,6 +88,7 @@ const computeData = ({ props }) => () => {
|
|
|
85
88
|
export {
|
|
86
89
|
arrowClick,
|
|
87
90
|
beforeDestroy,
|
|
91
|
+
clickActive,
|
|
88
92
|
computeData,
|
|
89
93
|
computeLeft,
|
|
90
94
|
computePx,
|
package/fall-menu/vue.js
CHANGED
|
@@ -2,6 +2,7 @@ import "../chunk-G2ADBYYC.js";
|
|
|
2
2
|
import {
|
|
3
3
|
mouseover,
|
|
4
4
|
mouseout,
|
|
5
|
+
clickActive,
|
|
5
6
|
computePx,
|
|
6
7
|
reRender,
|
|
7
8
|
arrowClick,
|
|
@@ -11,7 +12,17 @@ import {
|
|
|
11
12
|
computeLeft,
|
|
12
13
|
computeData
|
|
13
14
|
} from "./index";
|
|
14
|
-
const api = [
|
|
15
|
+
const api = [
|
|
16
|
+
"state",
|
|
17
|
+
"fall",
|
|
18
|
+
"arrowClick",
|
|
19
|
+
"mouseover",
|
|
20
|
+
"mouseout",
|
|
21
|
+
"clickActive",
|
|
22
|
+
"overContent",
|
|
23
|
+
"reRender",
|
|
24
|
+
"left"
|
|
25
|
+
];
|
|
15
26
|
const initState = ({
|
|
16
27
|
reactive,
|
|
17
28
|
computed,
|
|
@@ -25,7 +36,8 @@ const initState = ({
|
|
|
25
36
|
isActive: props.value,
|
|
26
37
|
pagerData: { data: [], offset: [], index: [] },
|
|
27
38
|
left: computed(() => api2.computeLeft()),
|
|
28
|
-
data: computed(() => api2.computeData())
|
|
39
|
+
data: computed(() => api2.computeData()),
|
|
40
|
+
active: 0
|
|
29
41
|
});
|
|
30
42
|
return state;
|
|
31
43
|
};
|
|
@@ -48,6 +60,7 @@ const initApi = ({
|
|
|
48
60
|
overContent: overContent(state),
|
|
49
61
|
mouseout: mouseout(state),
|
|
50
62
|
mouseover: mouseover({ props, fall, state }),
|
|
63
|
+
clickActive: clickActive(state),
|
|
51
64
|
reRender: reRender({ api: api2, state })
|
|
52
65
|
});
|
|
53
66
|
};
|
package/filter-box/vue.js
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import "../chunk-G2ADBYYC.js";
|
|
2
2
|
import { handleClear, handeClick } from "./index";
|
|
3
3
|
const api = ["state", "handleClear", "focus", "blur", "handeClick"];
|
|
4
|
-
const renderless = (props, { reactive }, { dispatch, emit }) => {
|
|
5
|
-
|
|
4
|
+
const renderless = (props, { reactive }, { dispatch, emit, designConfig }) => {
|
|
5
|
+
var _a;
|
|
6
|
+
const state = reactive({
|
|
7
|
+
expandButtonIcon: ((_a = designConfig == null ? void 0 : designConfig.icons) == null ? void 0 : _a.expandButton) || "IconDownWard"
|
|
8
|
+
});
|
|
6
9
|
const api2 = {};
|
|
7
10
|
Object.assign(api2, {
|
|
8
11
|
state,
|
package/floatbar/index.js
CHANGED
package/form/index.js
CHANGED
|
@@ -22,11 +22,11 @@ const computedAutoLabelWidth = ({ state }) => () => {
|
|
|
22
22
|
};
|
|
23
23
|
const computedHideRequiredAsterisk = ({ props, designConfig }) => () => {
|
|
24
24
|
var _a, _b;
|
|
25
|
-
return (_b = (_a = props.hideRequiredAsterisk) != null ? _a : designConfig == null ? void 0 : designConfig.hideRequiredAsterisk) != null ? _b :
|
|
25
|
+
return (_b = (_a = props.hideRequiredAsterisk) != null ? _a : designConfig == null ? void 0 : designConfig.hideRequiredAsterisk) != null ? _b : true;
|
|
26
26
|
};
|
|
27
27
|
const computedValidateIcon = ({ props, designConfig }) => () => {
|
|
28
28
|
var _a, _b, _c;
|
|
29
|
-
return (_c = (_b = props.validateIcon) != null ? _b : (_a = designConfig == null ? void 0 : designConfig.icons) == null ? void 0 : _a.validateIcon) != null ? _c :
|
|
29
|
+
return (_c = (_b = props.validateIcon) != null ? _b : (_a = designConfig == null ? void 0 : designConfig.icons) == null ? void 0 : _a.validateIcon) != null ? _c : "icon-error";
|
|
30
30
|
};
|
|
31
31
|
const computedIsErrorInline = ({ props, designConfig }) => () => {
|
|
32
32
|
if (props.messageType) {
|
|
@@ -35,13 +35,16 @@ const computedIsErrorInline = ({ props, designConfig }) => () => {
|
|
|
35
35
|
if (typeof props.inlineMessage === "boolean") {
|
|
36
36
|
return props.inlineMessage;
|
|
37
37
|
}
|
|
38
|
-
return (designConfig == null ? void 0 : designConfig.messageType) === "inline"
|
|
38
|
+
return (designConfig == null ? void 0 : designConfig.messageType) === "inline";
|
|
39
39
|
};
|
|
40
40
|
const computedIsErrorBlock = ({ props, designConfig }) => () => {
|
|
41
41
|
if (props.messageType) {
|
|
42
42
|
return props.messageType === "block";
|
|
43
43
|
}
|
|
44
|
-
|
|
44
|
+
if (designConfig && Object.hasOwnProperty.call(designConfig, "messageType")) {
|
|
45
|
+
return designConfig.messageType === "block";
|
|
46
|
+
}
|
|
47
|
+
return true;
|
|
45
48
|
};
|
|
46
49
|
const created = ({ parent, state }) => () => {
|
|
47
50
|
parent.$on("form:addField", (field) => {
|
package/form/vue.js
CHANGED
|
@@ -63,7 +63,7 @@ const renderless = (props, { computed, inject, provide, reactive, watch, onBefor
|
|
|
63
63
|
}),
|
|
64
64
|
labelWidth: computed(() => {
|
|
65
65
|
var _a;
|
|
66
|
-
return props.labelWidth || ((_a = designConfig == null ? void 0 : designConfig.state) == null ? void 0 : _a.labelWidth) || "
|
|
66
|
+
return props.labelWidth || ((_a = designConfig == null ? void 0 : designConfig.state) == null ? void 0 : _a.labelWidth) || "84px";
|
|
67
67
|
}),
|
|
68
68
|
tooltipType: computed(() => {
|
|
69
69
|
var _a;
|
package/grid/plugins/export.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
__spreadValues
|
|
3
3
|
} from "../../chunk-G2ADBYYC.js";
|
|
4
|
-
import { xss } from "../../common/xss
|
|
4
|
+
import { xss } from "../../common/xss";
|
|
5
5
|
import browser from "../../common/browser";
|
|
6
6
|
import { toTreeArray } from "../static";
|
|
7
7
|
import { getCellValue, getFuncText } from "../utils";
|
package/grid/utils/dom.js
CHANGED
|
@@ -74,7 +74,9 @@ function computeScrollLeft($table, td) {
|
|
|
74
74
|
}
|
|
75
75
|
function setBodyLeft(body, td, $table, column, move) {
|
|
76
76
|
const { isLeftArrow, isRightArrow, from } = move || {};
|
|
77
|
-
|
|
77
|
+
const bodyScollLeft = computeScrollLeft($table, td);
|
|
78
|
+
$table.scrollTo(bodyScollLeft);
|
|
79
|
+
$table.lastScrollLeft = bodyScollLeft;
|
|
78
80
|
if (from) {
|
|
79
81
|
const direction = isLeftArrow ? "left" : isRightArrow ? "right" : null;
|
|
80
82
|
const fixedDom = $table.elemStore[`${direction}-body-list`];
|
package/guide/index.js
CHANGED
|
@@ -51,6 +51,9 @@ const mounted = ({ state, api }) => () => {
|
|
|
51
51
|
api.createShepherd();
|
|
52
52
|
}
|
|
53
53
|
};
|
|
54
|
+
const beforeUnmount = (state) => () => {
|
|
55
|
+
state.tour.hide();
|
|
56
|
+
};
|
|
54
57
|
const getItemCopy = (props, tour, result) => {
|
|
55
58
|
const { domData } = props;
|
|
56
59
|
result = domData.map((item) => {
|
|
@@ -65,9 +68,9 @@ const getItemCopy = (props, tour, result) => {
|
|
|
65
68
|
return result;
|
|
66
69
|
};
|
|
67
70
|
const newTour = (state, Shepherd, offset, designConfig) => {
|
|
68
|
-
var _a;
|
|
71
|
+
var _a, _b;
|
|
69
72
|
const tour = new Shepherd.Tour({
|
|
70
|
-
useModalOverlay:
|
|
73
|
+
useModalOverlay: (_b = (_a = designConfig == null ? void 0 : designConfig.state) == null ? void 0 : _a.isUseModalOverlay) != null ? _b : false,
|
|
71
74
|
defaultStepOptions: {
|
|
72
75
|
modalOverlayOpeningPadding: state.modalOverlayOpeningPadding,
|
|
73
76
|
modalOverlayOpeningRadius: state.modalOverlayOpeningRadius,
|
|
@@ -117,6 +120,17 @@ const itemStep = (item, state, deepCopy, index, Shepherd) => {
|
|
|
117
120
|
const currentStep = Shepherd.activeTour && Shepherd.activeTour.getCurrentStep();
|
|
118
121
|
const currentStepElement = currentStep && currentStep.getElement();
|
|
119
122
|
const footer = currentStepElement && currentStepElement.querySelector(".shepherd-footer");
|
|
123
|
+
const cancelIcon = currentStepElement && currentStepElement.querySelector(".shepherd-header .shepherd-cancel-icon span");
|
|
124
|
+
const cloesIcon = `<svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
125
|
+
<desc fill="none">
|
|
126
|
+
Created with Pixso.
|
|
127
|
+
</desc>
|
|
128
|
+
<defs fill="none" />
|
|
129
|
+
<g>
|
|
130
|
+
<path id="path" d="M12.49 3.3C12.66 3.47 12.66 3.74 12.54 3.92L8.58 7.89L12.49 11.77C12.7 11.96 12.72 12.25 12.54 12.48C12.37 12.67 12.05 12.72 11.83 12.54L7.88 8.58L4 12.49C3.82 12.66 3.5 12.67 3.32 12.5C3.13 12.33 3.08 12.05 3.24 11.83L7.17 7.89L3.29 4C3.12 3.79 3.13 3.48 3.33 3.29C3.5 3.15 3.75 3.13 3.91 3.24L7.88 7.17L11.78 3.3C11.96 3.08 12.29 3.08 12.49 3.3Z" fill-opacity="1.000000" fill-rule="evenodd"/>
|
|
131
|
+
</g>
|
|
132
|
+
</svg>`;
|
|
133
|
+
cancelIcon.innerHTML = cloesIcon;
|
|
120
134
|
const progress = document.createElement("span");
|
|
121
135
|
progress.classList.add("progress-style");
|
|
122
136
|
progress.innerText = `${Shepherd.activeTour && Shepherd.activeTour.steps.indexOf(currentStep) + 1}/${Shepherd.activeTour && Shepherd.activeTour.steps.length}`;
|
|
@@ -164,6 +178,7 @@ const callBack = (step, item, tour) => {
|
|
|
164
178
|
});
|
|
165
179
|
};
|
|
166
180
|
export {
|
|
181
|
+
beforeUnmount,
|
|
167
182
|
createShepherd,
|
|
168
183
|
mounted
|
|
169
184
|
};
|
package/guide/vue.js
CHANGED
|
@@ -2,9 +2,9 @@ import {
|
|
|
2
2
|
__spreadProps,
|
|
3
3
|
__spreadValues
|
|
4
4
|
} from "../chunk-G2ADBYYC.js";
|
|
5
|
-
import { createShepherd, mounted } from "./index";
|
|
5
|
+
import { createShepherd, mounted, beforeUnmount } from "./index";
|
|
6
6
|
const api = ["state"];
|
|
7
|
-
const renderless = (props, { reactive, onMounted, watch }, { designConfig }, { Shepherd, offset }) => {
|
|
7
|
+
const renderless = (props, { reactive, onMounted, onBeforeUnmount, watch }, { designConfig }, { Shepherd, offset }) => {
|
|
8
8
|
const state = reactive({
|
|
9
9
|
tour: null,
|
|
10
10
|
tour1: null,
|
|
@@ -24,10 +24,12 @@ const renderless = (props, { reactive, onMounted, watch }, { designConfig }, { S
|
|
|
24
24
|
createShepherd: createShepherd({ state, props, Shepherd, offset, designConfig })
|
|
25
25
|
};
|
|
26
26
|
const api2 = __spreadProps(__spreadValues({}, baseApi), {
|
|
27
|
-
mounted: mounted({ state, api: baseApi })
|
|
27
|
+
mounted: mounted({ state, api: baseApi }),
|
|
28
|
+
beforeUnmount: beforeUnmount(state)
|
|
28
29
|
});
|
|
29
30
|
watch(() => props.showStep, api2.createShepherd);
|
|
30
31
|
onMounted(api2.mounted);
|
|
32
|
+
onBeforeUnmount(api2.beforeUnmount);
|
|
31
33
|
return api2;
|
|
32
34
|
};
|
|
33
35
|
export {
|
package/image-viewer/vue.js
CHANGED
|
@@ -80,7 +80,7 @@ const initState = ({ reactive, computed, api: api2, mode, props, constants, inje
|
|
|
80
80
|
infinite: true,
|
|
81
81
|
loading: false,
|
|
82
82
|
transform: { scale: 1, deg: 0, offsetX: 0, offsetY: 0, objfit: "contain", enableTransition: false },
|
|
83
|
-
urlList: props.urlList || inject("urlList"
|
|
83
|
+
urlList: props.urlList || Array.isArray(inject("urlList")) && inject("urlList").length !== 0 ? inject("urlList") : null,
|
|
84
84
|
mode: constants.MODE.CONTAIN,
|
|
85
85
|
previewVisible: props.previewVisible,
|
|
86
86
|
fullScreen: props.imageFullCurrent,
|
package/input/index.js
CHANGED
|
@@ -202,10 +202,8 @@ const handleCompositionEnd = ({ api, state }) => (event) => {
|
|
|
202
202
|
api.handleInput(event);
|
|
203
203
|
}
|
|
204
204
|
};
|
|
205
|
-
const calcIconOffset = ({
|
|
206
|
-
const elList = []
|
|
207
|
-
parent.$el.querySelectorAll(`.${CLASS_PREFIX.Input}${place}`) || []
|
|
208
|
-
);
|
|
205
|
+
const calcIconOffset = ({ vm, parent }) => (place) => {
|
|
206
|
+
const elList = vm.$refs[place] ? [vm.$refs[place]] : [];
|
|
209
207
|
if (!elList.length) {
|
|
210
208
|
return;
|
|
211
209
|
}
|
|
@@ -222,10 +220,10 @@ const calcIconOffset = ({ CLASS_PREFIX, parent }) => (place) => {
|
|
|
222
220
|
const pendantMap = { suffix: "append", prefix: "prepend" };
|
|
223
221
|
const pendant = pendantMap[place];
|
|
224
222
|
if (parent.$slots[pendant]) {
|
|
225
|
-
const dom =
|
|
223
|
+
const dom = vm.$refs[pendant];
|
|
226
224
|
let transform;
|
|
227
225
|
if (place === "suffix") {
|
|
228
|
-
transform = `translateX(-${dom.offsetWidth}px)`;
|
|
226
|
+
transform = `translateX(-${dom.offsetWidth}px) translateY(-50%)`;
|
|
229
227
|
} else if (place === "prefix") {
|
|
230
228
|
transform = `translate(${dom.offsetWidth}px, -50%)`;
|
|
231
229
|
}
|
|
@@ -284,7 +282,8 @@ const handleEnterDisplayOnlyContent = ({ state, props }) => ($event, type) => {
|
|
|
284
282
|
const font = window.getComputedStyle(target).font;
|
|
285
283
|
const rect = target.getBoundingClientRect();
|
|
286
284
|
const iconWidth = 16 + 15;
|
|
287
|
-
|
|
285
|
+
const calcText = (text == null ? void 0 : text.trim()) || "";
|
|
286
|
+
isOverTextWhenMask = omitText(calcText, font, rect.width - iconWidth).o;
|
|
288
287
|
}
|
|
289
288
|
if (isOverTextWhenMask) {
|
|
290
289
|
state.displayOnlyTooltip = props.displayOnlyContent || state.nativeInputValue;
|