@opentiny/vue-renderless 3.20.3 → 3.21.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/badge/vue.js +1 -1
- package/base-select/index.js +3 -0
- package/bulletin-board/index.js +1 -1
- package/button/index.js +1 -1
- package/cascader/index.js +10 -8
- package/cascader-panel/vue.js +1 -1
- package/cascader-select/column-index.js +3 -0
- package/chart-core/deps/utils.js +1 -1
- package/chart-core/index.js +1 -1
- package/common/browser.js +2 -0
- package/common/deps/eSpaceCtrl.js +3 -2
- package/common/deps/fastdom/singleton.js +9 -1
- package/common/deps/fullscreen/screenfull.js +54 -25
- package/common/deps/popper.js +18 -18
- package/common/deps/touch-emulator.js +15 -10
- package/common/deps/upload-ajax.js +1 -1
- package/common/index.js +2 -2
- package/common/runtime.js +1 -1
- package/common/string.js +5 -2
- package/common/validate/util.js +1 -1
- package/dialog-box/index.js +6 -3
- package/divider/index.js +47 -0
- package/divider/vue.js +24 -3
- package/dropdown/index.js +7 -6
- package/dropdown/vue.js +7 -3
- package/espace/index.js +1 -1
- package/fall-menu/index.js +1 -1
- package/file-upload/index.js +71 -67
- package/file-upload/vue.js +6 -6
- package/floatbar/index.js +1 -1
- package/fluent-editor/index.js +25 -9
- package/form/vue.js +1 -1
- package/grid/plugins/export.js +1 -1
- package/guide/index.js +1 -1
- package/image/index.js +1 -1
- package/image-viewer/index.js +3 -2
- package/input/vue.js +3 -0
- package/link/vue.js +1 -1
- package/locales/index.js +1 -1
- package/logout/index.js +1 -1
- package/menu/index.js +1 -1
- package/milestone/index.js +2 -1
- package/modal/index.js +0 -1
- package/nav-menu/index.js +80 -11
- package/nav-menu/vue.js +13 -1
- package/package.json +2 -2
- package/picker/index.js +10 -0
- package/rich-text/index.js +1 -1
- package/rich-text/module/file-upload.js +1 -1
- package/rich-text/module/image-upload.js +1 -1
- package/rich-text-editor/vue.js +11 -10
- package/roles/index.js +1 -1
- package/select/index.js +27 -17
- package/select/vue.js +33 -5
- package/select-dropdown/vue.js +2 -1
- package/split/index.js +2 -1
- package/statistic/index.js +5 -2
- package/tabbar-item/vue.js +1 -1
- package/tabs-mf/wheel.js +14 -9
- package/time-panel/index.js +8 -1
- package/time-panel/vue.js +2 -0
- package/time-spinner/index.js +2 -1
- package/toggle-menu/index.js +1 -1
- package/transfer/index.js +1 -5
- package/tree-menu/index.js +5 -1
- package/tree-menu/vue.js +5 -2
- package/types/alert.type.d.ts +4 -0
- package/types/dialog-box.type.d.ts +10 -0
- package/types/divider.type.d.ts +94 -0
- package/types/dropdown.type.d.ts +2 -0
- package/types/file-upload.type.d.ts +1 -1
- package/types/float-button.type.d.ts +2 -2
- package/types/form-item.type.d.ts +1 -1
- package/types/{form.type-f6fb4c38.d.ts → form.type-4e0ec0a1.d.ts} +2 -1
- package/types/form.type.d.ts +1 -1
- package/types/image.type.d.ts +1 -1
- package/types/nav-menu.type.d.ts +1 -0
- package/types/statistic.type.d.ts +2 -5
- package/types/tree-menu.type.d.ts +19 -0
- package/types/upload-dragger.type.d.ts +2 -2
- package/types/{upload-list.type-6189e4c9.d.ts → upload-list.type-eaf82b7a.d.ts} +4 -8
- package/types/upload-list.type.d.ts +1 -1
- package/types/upload.type.d.ts +1 -1
- package/types/user-contact.type.d.ts +1 -1
- package/upload-dragger/index.js +49 -24
- package/upload-dragger/vue.js +1 -0
- package/upload-list/index.js +1 -1
- package/upload-list/vue.js +2 -1
- package/user/index.js +1 -1
- package/user-contact/index.js +1 -1
- package/year-table/index.js +2 -2
- package/common/xss.js +0 -191
package/nav-menu/index.js
CHANGED
|
@@ -5,7 +5,8 @@ import PopupManager from "../common/deps/popup-manager";
|
|
|
5
5
|
import { mapTree } from "../grid/static";
|
|
6
6
|
import { transformTreeData } from "../common/array";
|
|
7
7
|
import { on, off } from "../common/deps/dom";
|
|
8
|
-
import { xss } from "
|
|
8
|
+
import { xss } from "@opentiny/utils";
|
|
9
|
+
import { isBrowser } from "../common/browser";
|
|
9
10
|
const { nextZIndex } = PopupManager;
|
|
10
11
|
const computedIsShowMore = ({ props, state }) => () => !/^(retract|fixed|hidden)$/.test(props.overflow) && state.more && state.more.length;
|
|
11
12
|
const computedPopClass = (state) => () => {
|
|
@@ -97,6 +98,9 @@ const initData = ({
|
|
|
97
98
|
props,
|
|
98
99
|
state
|
|
99
100
|
}) => () => {
|
|
101
|
+
if (props.defaultActive) {
|
|
102
|
+
state.defaultActiveId = props.defaultActive;
|
|
103
|
+
}
|
|
100
104
|
const { textField = "title", urlField = "url", key = "id" } = fields || {};
|
|
101
105
|
const { parentKey, data } = props;
|
|
102
106
|
const isFullUrl = (url) => /^(https?:\/\/|\/\/)[\s\S]+$/.test(url);
|
|
@@ -303,12 +307,17 @@ const clickMenu = ({ api, props, state }) => (item, index, parentIndex) => {
|
|
|
303
307
|
if (index === void 0) {
|
|
304
308
|
return;
|
|
305
309
|
}
|
|
310
|
+
if (state.defaultActiveId) {
|
|
311
|
+
state.defaultActiveId = item.id;
|
|
312
|
+
state.selectedIndex = -1;
|
|
313
|
+
}
|
|
306
314
|
if (state.enterMenu) {
|
|
307
315
|
state.subIndex = -1;
|
|
308
316
|
state.subItemSelectedIndex = -1;
|
|
309
317
|
api.setActiveMenu(index);
|
|
310
318
|
}
|
|
311
319
|
if (state.enterMoreMenu) {
|
|
320
|
+
state.selectedIndex = -1;
|
|
312
321
|
state.moreItemSelectedIndex = index;
|
|
313
322
|
} else {
|
|
314
323
|
state.subItemSelectedIndex = index;
|
|
@@ -339,18 +348,22 @@ const skip = ({ api, router, fields }) => (item, flag = false) => {
|
|
|
339
348
|
}
|
|
340
349
|
};
|
|
341
350
|
const getPoint = ({ api, parent }) => () => {
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
351
|
+
if (!isBrowser)
|
|
352
|
+
return 0;
|
|
353
|
+
else {
|
|
354
|
+
const items = parent.$el.querySelectorAll(".menu>li");
|
|
355
|
+
let index = 0;
|
|
356
|
+
if (items) {
|
|
357
|
+
index = items.length;
|
|
358
|
+
for (let i = 0; i < items.length; i++) {
|
|
359
|
+
if (api.isHide(items[i])) {
|
|
360
|
+
index = index - (items.length - i);
|
|
361
|
+
break;
|
|
362
|
+
}
|
|
350
363
|
}
|
|
351
364
|
}
|
|
365
|
+
return index;
|
|
352
366
|
}
|
|
353
|
-
return index;
|
|
354
367
|
};
|
|
355
368
|
const classify = ({ api, props, state }) => () => {
|
|
356
369
|
var _a;
|
|
@@ -364,7 +377,7 @@ const calcWidth = ({ parent, props, state }) => () => {
|
|
|
364
377
|
let toolbarWidth = parent.$slots.toolbar ? el.querySelector(".slot-toolbar").offsetWidth : 0;
|
|
365
378
|
let menuWidth = el.offsetWidth;
|
|
366
379
|
let width = props.overflow === "retract" ? 0 : menuWidth - toolbarWidth - logoWidth;
|
|
367
|
-
width = width -
|
|
380
|
+
width = width - 90;
|
|
368
381
|
state.width = width < 200 ? 0 : width;
|
|
369
382
|
state.popMenuTop = el.offsetHeight;
|
|
370
383
|
};
|
|
@@ -403,6 +416,58 @@ const handleTitleMouseenter = ({ state, vm }) => ($event) => {
|
|
|
403
416
|
const handleTitleMouseleave = ({ state }) => () => {
|
|
404
417
|
state.tooltipVisible = false;
|
|
405
418
|
};
|
|
419
|
+
const getMoreSelected = ({ state }) => () => {
|
|
420
|
+
let isSelected = false;
|
|
421
|
+
if (state == null ? void 0 : state.more.length) {
|
|
422
|
+
state.more.forEach((item) => {
|
|
423
|
+
var _a;
|
|
424
|
+
if ((item == null ? void 0 : item.id) === state.defaultActiveId) {
|
|
425
|
+
isSelected = true;
|
|
426
|
+
} else if ((_a = item == null ? void 0 : item.children) == null ? void 0 : _a.length) {
|
|
427
|
+
isSelected = getSelectedState(item.children, state.defaultActiveId);
|
|
428
|
+
}
|
|
429
|
+
});
|
|
430
|
+
}
|
|
431
|
+
return isSelected;
|
|
432
|
+
};
|
|
433
|
+
const getTabSelected = ({ state }) => (item, index) => {
|
|
434
|
+
var _a;
|
|
435
|
+
let isChildSelected = false;
|
|
436
|
+
if ((item == null ? void 0 : item.id) && ((_a = item == null ? void 0 : item.children) == null ? void 0 : _a.length)) {
|
|
437
|
+
isChildSelected = getSelectedState(item.children, state.defaultActiveId);
|
|
438
|
+
}
|
|
439
|
+
let isSelected = (item == null ? void 0 : item.id) === state.defaultActiveId || isChildSelected || index === state.selectedIndex;
|
|
440
|
+
return isSelected;
|
|
441
|
+
};
|
|
442
|
+
const getLeftSelected = ({ state }) => (item, index) => {
|
|
443
|
+
var _a;
|
|
444
|
+
let isLeftChildSelected = false;
|
|
445
|
+
if ((item == null ? void 0 : item.id) && ((_a = item == null ? void 0 : item.children) == null ? void 0 : _a.length)) {
|
|
446
|
+
isLeftChildSelected = getSelectedState(item.children, state.defaultActiveId);
|
|
447
|
+
}
|
|
448
|
+
let isSelected = (item == null ? void 0 : item.id) === state.defaultActiveId || isLeftChildSelected || index === state.moreItemSelectedIndex;
|
|
449
|
+
return isSelected;
|
|
450
|
+
};
|
|
451
|
+
const getLastChildSelected = ({ state }) => (item, i, index) => {
|
|
452
|
+
let isSelected = (item == null ? void 0 : item.id) === state.defaultActiveId || i === state.subItemSelectedIndex && index === state.subIndex;
|
|
453
|
+
return isSelected;
|
|
454
|
+
};
|
|
455
|
+
const getSelectedState = (itemData, id) => {
|
|
456
|
+
let isSelected = false;
|
|
457
|
+
itemData.forEach((data) => {
|
|
458
|
+
var _a;
|
|
459
|
+
if ((data == null ? void 0 : data.id) === id) {
|
|
460
|
+
isSelected = true;
|
|
461
|
+
} else if ((_a = data == null ? void 0 : data.children) == null ? void 0 : _a.length) {
|
|
462
|
+
data == null ? void 0 : data.children.forEach((dataChildren) => {
|
|
463
|
+
if ((dataChildren == null ? void 0 : dataChildren.id) === id) {
|
|
464
|
+
isSelected = true;
|
|
465
|
+
}
|
|
466
|
+
});
|
|
467
|
+
}
|
|
468
|
+
});
|
|
469
|
+
return isSelected;
|
|
470
|
+
};
|
|
406
471
|
export {
|
|
407
472
|
calcWidth,
|
|
408
473
|
classify,
|
|
@@ -412,9 +477,13 @@ export {
|
|
|
412
477
|
computedPopClass,
|
|
413
478
|
computedPopStyle,
|
|
414
479
|
computedSubMenus,
|
|
480
|
+
getLastChildSelected,
|
|
481
|
+
getLeftSelected,
|
|
482
|
+
getMoreSelected,
|
|
415
483
|
getPoint,
|
|
416
484
|
getRoute,
|
|
417
485
|
getSelectedIndex,
|
|
486
|
+
getTabSelected,
|
|
418
487
|
getTag,
|
|
419
488
|
getUrl,
|
|
420
489
|
handleTitleMouseenter,
|
package/nav-menu/vue.js
CHANGED
|
@@ -31,6 +31,10 @@ import {
|
|
|
31
31
|
setActiveMenu,
|
|
32
32
|
initService,
|
|
33
33
|
handleTitleMouseenter,
|
|
34
|
+
getMoreSelected,
|
|
35
|
+
getTabSelected,
|
|
36
|
+
getLeftSelected,
|
|
37
|
+
getLastChildSelected,
|
|
34
38
|
handleTitleMouseleave
|
|
35
39
|
} from "./index";
|
|
36
40
|
const api = [
|
|
@@ -56,6 +60,10 @@ const api = [
|
|
|
56
60
|
"getRoute",
|
|
57
61
|
"setActiveMenu",
|
|
58
62
|
"handleTitleMouseenter",
|
|
63
|
+
"getMoreSelected",
|
|
64
|
+
"getLeftSelected",
|
|
65
|
+
"getLastChildSelected",
|
|
66
|
+
"getTabSelected",
|
|
59
67
|
"handleTitleMouseleave"
|
|
60
68
|
];
|
|
61
69
|
const initState = ({ reactive, api: api2, computed, vm }) => reactive({
|
|
@@ -64,6 +72,7 @@ const initState = ({ reactive, api: api2, computed, vm }) => reactive({
|
|
|
64
72
|
width: -1,
|
|
65
73
|
enterMenu: false,
|
|
66
74
|
popMenuTop: 0,
|
|
75
|
+
defaultActiveId: null,
|
|
67
76
|
subMenu: [],
|
|
68
77
|
showMore: false,
|
|
69
78
|
showPopmenu: false,
|
|
@@ -78,7 +87,6 @@ const initState = ({ reactive, api: api2, computed, vm }) => reactive({
|
|
|
78
87
|
isShowSetting: false,
|
|
79
88
|
tooltipVisible: false,
|
|
80
89
|
tooltipContent: "",
|
|
81
|
-
marginLeft: 0,
|
|
82
90
|
isSaaSTheme: vm.theme === "saas",
|
|
83
91
|
menuClass: "",
|
|
84
92
|
isShowMore: computed(() => api2.computedIsShowMore()),
|
|
@@ -120,6 +128,10 @@ const initApi = ({ api: api2, state, props, parent, fetchMenuData, fields, route
|
|
|
120
128
|
hideSubMenu: hideSubMenu({ api: api2, parent, state }),
|
|
121
129
|
showSubMenu: showSubMenu({ api: api2, nextTick, parent, state, vm }),
|
|
122
130
|
handleTitleMouseenter: handleTitleMouseenter({ state, vm }),
|
|
131
|
+
getMoreSelected: getMoreSelected({ state }),
|
|
132
|
+
getLeftSelected: getLeftSelected({ state }),
|
|
133
|
+
getLastChildSelected: getLastChildSelected({ state }),
|
|
134
|
+
getTabSelected: getTabSelected({ state }),
|
|
123
135
|
handleTitleMouseleave: handleTitleMouseleave({ state })
|
|
124
136
|
});
|
|
125
137
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opentiny/vue-renderless",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.21.0",
|
|
4
4
|
"description": "An enterprise-class UI component library, support both Vue.js 2 and Vue.js 3, as well as PC and mobile.",
|
|
5
5
|
"author": "OpenTiny Team",
|
|
6
6
|
"license": "MIT",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"sideEffects": false,
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"color": "4.2.3",
|
|
29
|
-
"
|
|
29
|
+
"@opentiny/utils": "^1.0.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"esno": "^4.7.0",
|
package/picker/index.js
CHANGED
|
@@ -403,6 +403,10 @@ const handleInput = ({ state, props, api }) => (val, event) => {
|
|
|
403
403
|
const val2 = event.target.value;
|
|
404
404
|
state.userInput = val2;
|
|
405
405
|
}
|
|
406
|
+
if (state.type === "time-select") {
|
|
407
|
+
state.picker.state.isFilter = true;
|
|
408
|
+
state.picker.state.filterVal = state.userInput;
|
|
409
|
+
}
|
|
406
410
|
};
|
|
407
411
|
const formatInputValue = ({ props, state }) => ({ event, prevValue = "" }) => {
|
|
408
412
|
const val = event.target.value;
|
|
@@ -739,6 +743,9 @@ const handleKeydown = ({ api, state }) => (event) => {
|
|
|
739
743
|
}
|
|
740
744
|
if (keyCode === 13) {
|
|
741
745
|
if (state.userInput === "" || api.isValidValue(api.parseString(state.displayValue))) {
|
|
746
|
+
if (state.type === "time-select") {
|
|
747
|
+
state.userInput = state.picker.state.items.length ? state.picker.state.items[0].value : "";
|
|
748
|
+
}
|
|
742
749
|
api.handleChange();
|
|
743
750
|
state.pickerVisible = state.picker.state.visible = false;
|
|
744
751
|
api.blur();
|
|
@@ -756,6 +763,9 @@ const handleKeydown = ({ api, state }) => (event) => {
|
|
|
756
763
|
};
|
|
757
764
|
const hidePicker = ({ destroyPopper, state }) => () => {
|
|
758
765
|
if (state.picker) {
|
|
766
|
+
if (state.type === "time-select") {
|
|
767
|
+
state.picker.state.isFilter = false;
|
|
768
|
+
}
|
|
759
769
|
state.picker.resetView && state.picker.resetView();
|
|
760
770
|
state.pickerVisible = state.picker.visible = state.picker.state.visible = false;
|
|
761
771
|
destroyPopper();
|
package/rich-text/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "../chunk-G2ADBYYC.js";
|
|
2
2
|
import { extend } from "../common/object";
|
|
3
|
-
import { xss } from "
|
|
3
|
+
import { xss } from "@opentiny/utils";
|
|
4
4
|
import { getToolbarTips, defaultOptions } from "./options";
|
|
5
5
|
import registerTableModule from "./table-module";
|
|
6
6
|
import registerCustomClipboard from "./clipboard";
|
package/rich-text-editor/vue.js
CHANGED
|
@@ -3,16 +3,16 @@ import {
|
|
|
3
3
|
__spreadValues
|
|
4
4
|
} from "../chunk-G2ADBYYC.js";
|
|
5
5
|
import {
|
|
6
|
+
Active,
|
|
7
|
+
closeTablePanel,
|
|
8
|
+
eventClick,
|
|
9
|
+
eventImg,
|
|
6
10
|
handleChange,
|
|
7
11
|
setLink,
|
|
8
|
-
tableMouseMove,
|
|
9
|
-
tableChoose,
|
|
10
|
-
toggleTablePanel,
|
|
11
|
-
closeTablePanel,
|
|
12
12
|
shouldShow,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
tableChoose,
|
|
14
|
+
tableMouseMove,
|
|
15
|
+
toggleTablePanel
|
|
16
16
|
} from "./index";
|
|
17
17
|
const api = [
|
|
18
18
|
"state",
|
|
@@ -184,7 +184,7 @@ const renderless = (props, { computed, onBeforeUnmount, reactive, watch }, { vm,
|
|
|
184
184
|
};
|
|
185
185
|
}
|
|
186
186
|
});
|
|
187
|
-
const defaultOptions =
|
|
187
|
+
const defaultOptions = {
|
|
188
188
|
extensions: [
|
|
189
189
|
StarterKit == null ? void 0 : StarterKit.configure({
|
|
190
190
|
// 开启多人协作功能要关闭默认的history模式
|
|
@@ -254,8 +254,9 @@ const renderless = (props, { computed, onBeforeUnmount, reactive, watch }, { vm,
|
|
|
254
254
|
onDestroy() {
|
|
255
255
|
emit("destroy");
|
|
256
256
|
}
|
|
257
|
-
}
|
|
258
|
-
let options =
|
|
257
|
+
};
|
|
258
|
+
let options = __spreadValues(__spreadValues({}, defaultOptions), props.options);
|
|
259
|
+
options.extensions = [.../* @__PURE__ */ new Set([...defaultOptions.extensions, ...props.options.extensions || []])];
|
|
259
260
|
const state = reactive({
|
|
260
261
|
editor: new Editor(options),
|
|
261
262
|
toolbar: computed(() => props.customToolBar.length ? props.customToolBar : defaultToolBar),
|
package/roles/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../chunk-G2ADBYYC.js";
|
|
2
|
-
import { xss } from "
|
|
2
|
+
import { xss } from "@opentiny/utils";
|
|
3
3
|
const showList = (state) => () => state.showPopover = true;
|
|
4
4
|
const show = (state) => () => state.showIcon = false;
|
|
5
5
|
const hide = (state) => () => state.showIcon = true;
|
package/select/index.js
CHANGED
|
@@ -20,6 +20,7 @@ import { fastdom } from "../common/deps/fastdom";
|
|
|
20
20
|
import { deepClone } from "../picker-column";
|
|
21
21
|
import { escapeRegexpString } from "../option";
|
|
22
22
|
import { correctTarget } from "../common/event";
|
|
23
|
+
import { isBrowser } from "../common/browser";
|
|
23
24
|
const handleComposition = ({ api, nextTick, state }) => (event) => {
|
|
24
25
|
const text = event.target.value;
|
|
25
26
|
if (event.type === "compositionend") {
|
|
@@ -396,18 +397,28 @@ const toggleCheckAll = ({ api, state, props }) => (filtered) => {
|
|
|
396
397
|
api.directEmitChange(value);
|
|
397
398
|
};
|
|
398
399
|
const handleFocus = ({ emit, props, state }) => (event) => {
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
400
|
+
state.willFocusRun = true;
|
|
401
|
+
state.willFocusTimer && clearTimeout(state.willFocusTimer);
|
|
402
|
+
state.willFocusTimer = setTimeout(() => {
|
|
403
|
+
state.willFocusTimer = 0;
|
|
404
|
+
if (!state.willFocusRun)
|
|
405
|
+
return;
|
|
406
|
+
if (!state.softFocus) {
|
|
407
|
+
if (props.shape === "filter") {
|
|
408
|
+
return;
|
|
409
|
+
}
|
|
410
|
+
if (props.automaticDropdown || props.filterable || props.searchable) {
|
|
411
|
+
state.visible = true;
|
|
412
|
+
state.softFocus = true;
|
|
413
|
+
}
|
|
407
414
|
emit("focus", event);
|
|
415
|
+
} else {
|
|
416
|
+
if (state.searchSingleCopy && state.selectedLabel) {
|
|
417
|
+
emit("focus", event);
|
|
418
|
+
}
|
|
419
|
+
state.softFocus = false;
|
|
408
420
|
}
|
|
409
|
-
|
|
410
|
-
}
|
|
421
|
+
}, 10);
|
|
411
422
|
};
|
|
412
423
|
const focus = ({ vm, state }) => () => {
|
|
413
424
|
if (!state.softFocus) {
|
|
@@ -420,6 +431,7 @@ const blur = ({ vm, state }) => () => {
|
|
|
420
431
|
};
|
|
421
432
|
const handleBlur = ({ constants, dispatch, emit, state, designConfig }) => (event) => {
|
|
422
433
|
var _a;
|
|
434
|
+
state.willFocusRun = false;
|
|
423
435
|
clearTimeout(state.timer);
|
|
424
436
|
const target = event.target;
|
|
425
437
|
state.timer = setTimeout(() => {
|
|
@@ -1624,12 +1636,8 @@ const computedShowNewOption = ({ props, state }) => () => {
|
|
|
1624
1636
|
};
|
|
1625
1637
|
const computedShowCopy = ({ props, state }) => () => props.multiple && props.copyable && state.inputHovering && state.selected.length;
|
|
1626
1638
|
const computedOptionsAllDisabled = (state) => () => state.options.filter((option) => option.visible).every((option) => option.disabled);
|
|
1627
|
-
const computedDisabledTooltipContent = ({
|
|
1628
|
-
|
|
1629
|
-
return state.selected.map((item) => item.state ? item.state.currentLabel : item.currentLabel).join(";");
|
|
1630
|
-
} else {
|
|
1631
|
-
return state.selected.state ? state.selected.state.currentLabel : state.selected.currentLabel;
|
|
1632
|
-
}
|
|
1639
|
+
const computedDisabledTooltipContent = ({ state }) => () => {
|
|
1640
|
+
return state.displayOnlyContent;
|
|
1633
1641
|
};
|
|
1634
1642
|
const computedSelectDisabled = ({ state }) => () => state.isDisabled || state.isDisplayOnly;
|
|
1635
1643
|
const computedIsExpand = ({ props, state }) => () => {
|
|
@@ -1675,12 +1683,14 @@ const watchInitValue = ({ props, emit }) => (value) => {
|
|
|
1675
1683
|
}
|
|
1676
1684
|
};
|
|
1677
1685
|
const watchShowClose = ({ nextTick, state, parent }) => () => {
|
|
1686
|
+
if (!isBrowser)
|
|
1687
|
+
return;
|
|
1678
1688
|
nextTick(() => {
|
|
1679
1689
|
const parentEl = parent.$el;
|
|
1680
1690
|
const inputEl = parentEl.querySelector('input[data-tag="tiny-input-inner"]');
|
|
1681
1691
|
if (inputEl) {
|
|
1682
1692
|
const { paddingRight } = getComputedStyle(inputEl);
|
|
1683
|
-
state.inputPaddingRight = parseFloat(paddingRight);
|
|
1693
|
+
state.inputPaddingRight = parseFloat(paddingRight) || 0;
|
|
1684
1694
|
}
|
|
1685
1695
|
});
|
|
1686
1696
|
};
|
package/select/vue.js
CHANGED
|
@@ -118,6 +118,7 @@ import {
|
|
|
118
118
|
import debounce from "../common/deps/debounce";
|
|
119
119
|
import { isNumber } from "../common/type";
|
|
120
120
|
import { useUserAgent } from "../common/deps/useUserAgent";
|
|
121
|
+
import { isBrowser } from "../common/browser";
|
|
121
122
|
const api = [
|
|
122
123
|
"state",
|
|
123
124
|
"nodeCollapse",
|
|
@@ -206,7 +207,7 @@ const initState = ({ reactive, computed, props, api: api2, emitter, parent, cons
|
|
|
206
207
|
optionsAllDisabled: computed(() => api2.computedOptionsAllDisabled()),
|
|
207
208
|
collapseTagSize: computed(() => api2.computedCollapseTagSize()),
|
|
208
209
|
showNewOption: computed(() => api2.computedShowNewOption()),
|
|
209
|
-
selectSize: computed(() => props.size || state.formItemSize),
|
|
210
|
+
selectSize: computed(() => isBrowser ? props.size || state.formItemSize : 0),
|
|
210
211
|
optimizeOpts: computed(() => api2.computeOptimizeOpts()),
|
|
211
212
|
optimizeStore: { valueIndex: 0, recycleScrollerHeight: computed(() => api2.recycleScrollerHeight()) },
|
|
212
213
|
collapseTags: computed(() => api2.computeCollapseTags()),
|
|
@@ -225,9 +226,33 @@ const initState = ({ reactive, computed, props, api: api2, emitter, parent, cons
|
|
|
225
226
|
selectedVal: computed(
|
|
226
227
|
() => state.device === "mb" && props.multiple && state.visible ? state.selectedCopy : state.selected
|
|
227
228
|
),
|
|
228
|
-
displayOnlyContent: computed(
|
|
229
|
-
(
|
|
230
|
-
|
|
229
|
+
displayOnlyContent: computed(() => {
|
|
230
|
+
if (props.multiple) {
|
|
231
|
+
if (Array.isArray(state.selected)) {
|
|
232
|
+
if (state.isDisplayOnly && props.options && props.options.length > 0) {
|
|
233
|
+
return state.selected.map((item) => {
|
|
234
|
+
const find = props.options.find((opt) => opt[props.valueField] === item.value);
|
|
235
|
+
return find ? find[props.textField] : "";
|
|
236
|
+
}).join("; ");
|
|
237
|
+
} else {
|
|
238
|
+
return state.selected.map((item) => item.state ? item.state.currentLabel : item.currentLabel).join("; ");
|
|
239
|
+
}
|
|
240
|
+
} else {
|
|
241
|
+
return "";
|
|
242
|
+
}
|
|
243
|
+
} else {
|
|
244
|
+
if (state.selected) {
|
|
245
|
+
if (state.isDisplayOnly && props.options && props.options.length > 0) {
|
|
246
|
+
const find = props.options.find((opt) => opt[props.valueField] === state.selected.value);
|
|
247
|
+
return find ? find[props.textField] : "";
|
|
248
|
+
} else {
|
|
249
|
+
return (state.selected.state ? state.selected.state.currentLabel : state.selected.currentLabel || state.selected.label) || "";
|
|
250
|
+
}
|
|
251
|
+
} else {
|
|
252
|
+
return "";
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
}),
|
|
231
256
|
breakpoint: useBreakpoint ? useBreakpoint().current : "",
|
|
232
257
|
isSaaSTheme: vm.theme === "saas",
|
|
233
258
|
disabledOptionHover: false,
|
|
@@ -307,8 +332,11 @@ const initStateAdd = ({ computed, props, api: api2, parent }) => {
|
|
|
307
332
|
showCollapseTag: false,
|
|
308
333
|
exceedMaxVisibleRow: false,
|
|
309
334
|
// 是否超出默认最大显示行数
|
|
310
|
-
toHideIndex: Infinity
|
|
335
|
+
toHideIndex: Infinity,
|
|
311
336
|
// 第一个超出被隐藏的索引
|
|
337
|
+
willFocusRun: false,
|
|
338
|
+
// 进入focus时,延时等一下看是否触发blur,触发则不进入focus
|
|
339
|
+
willFocusTimer: 0
|
|
312
340
|
};
|
|
313
341
|
};
|
|
314
342
|
const initApi = ({
|
package/select-dropdown/vue.js
CHANGED
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
import userPopper from "../common/deps/vue-popper";
|
|
14
14
|
import PopupManager from "../common/deps/popup-manager";
|
|
15
15
|
import debounce from "../common/deps/debounce";
|
|
16
|
+
import { isBrowser } from "../common/browser";
|
|
16
17
|
const api = [
|
|
17
18
|
"state",
|
|
18
19
|
"doDestroy",
|
|
@@ -75,7 +76,7 @@ const initApi = ({ api: api2, popper, state, selectEmitter, constants, selectVm,
|
|
|
75
76
|
};
|
|
76
77
|
const initWatch = ({ watch, selectVm, state, nextTick }) => {
|
|
77
78
|
watch(
|
|
78
|
-
() => selectVm.state.inputWidth,
|
|
79
|
+
() => isBrowser ? selectVm.state.inputWidth : void 0,
|
|
79
80
|
(val) => {
|
|
80
81
|
nextTick(() => {
|
|
81
82
|
state.minWidth = (selectVm && selectVm.$el && selectVm.$el.getBoundingClientRect().width || val) + "px";
|
package/split/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import "../chunk-G2ADBYYC.js";
|
|
2
|
+
import { isBrowser } from "../common/browser";
|
|
2
3
|
const px2percent = ({ numerator, denominator }) => parseFloat(numerator) / parseFloat(denominator);
|
|
3
4
|
const getComputedThresholdValue = ({ api, props, vm, state }) => (type) => {
|
|
4
5
|
const size = vm.$refs.outerWrapper[state.offsetSize];
|
|
@@ -100,7 +101,7 @@ const buttonRightBottomClick = ({ emit, props, state }) => () => {
|
|
|
100
101
|
};
|
|
101
102
|
const computeOffset = ({ api, nextTick, props, vm, state }) => () => {
|
|
102
103
|
setTimeout(() => {
|
|
103
|
-
if (state) {
|
|
104
|
+
if (state && isBrowser) {
|
|
104
105
|
state.totalPane = vm.$refs.outerWrapper[state.offsetSize];
|
|
105
106
|
state.leftTopPane = state.totalPane * (state.offset / 100);
|
|
106
107
|
}
|
package/statistic/index.js
CHANGED
|
@@ -11,9 +11,12 @@ const getIntegerAndDecimal = ({ props }) => () => {
|
|
|
11
11
|
if (!isNumber(props.value)) {
|
|
12
12
|
return props.value;
|
|
13
13
|
}
|
|
14
|
-
let displayValue =
|
|
14
|
+
let displayValue = String(props.value).split(".");
|
|
15
15
|
let integer = (_a = displayValue[0]) == null ? void 0 : _a.replace(/\B(?=(\d{3})+(?!\d))/g, props.groupSeparator);
|
|
16
|
-
let decimal = (_b = displayValue[1]) == null ? void 0 : _b.padEnd(props.precision, "0")
|
|
16
|
+
let decimal = (_b = displayValue[1]) == null ? void 0 : _b.padEnd(props.precision, "0");
|
|
17
|
+
if (props.precision >= 0) {
|
|
18
|
+
decimal = decimal == null ? void 0 : decimal.slice(0, props.precision > 0 ? props.precision : 0);
|
|
19
|
+
}
|
|
17
20
|
if (!displayValue) {
|
|
18
21
|
integer = "0";
|
|
19
22
|
}
|
package/tabbar-item/vue.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "../chunk-G2ADBYYC.js";
|
|
2
2
|
import { getRouteActive, onClick, bindChildren, routeTab, getTabbarItemsWidth } from "./index";
|
|
3
|
-
import { xss } from "
|
|
3
|
+
import { xss } from "@opentiny/utils";
|
|
4
4
|
const api = ["state", "onClick", "getTabbarItemsWidth"];
|
|
5
5
|
const renderless = (props, { computed, onMounted, reactive, inject }, { parent, emit, nextTick, route, router, dispatch, vm }) => {
|
|
6
6
|
const api2 = {};
|
package/tabs-mf/wheel.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import "../chunk-G2ADBYYC.js";
|
|
2
|
+
import { isBrowser } from "../common/browser";
|
|
2
3
|
const getAddWheelListener = (window, document) => {
|
|
3
4
|
const { addApiName, removeApiName, prefix } = detectEventModel(window);
|
|
4
5
|
const support = detectAvailableWheelEvent(document);
|
|
@@ -14,22 +15,26 @@ const getAddWheelListener = (window, document) => {
|
|
|
14
15
|
};
|
|
15
16
|
};
|
|
16
17
|
const detectEventModel = (window) => {
|
|
17
|
-
const flag = window.addEventListener;
|
|
18
|
+
const flag = isBrowser ? window.addEventListener : null;
|
|
18
19
|
const addApiName = flag ? "addEventListener" : "attachEvent";
|
|
19
20
|
const removeApiName = flag ? "removeEventListener" : "detachEvent";
|
|
20
21
|
const prefix = flag ? "" : "on";
|
|
21
22
|
return { addApiName, removeApiName, prefix };
|
|
22
23
|
};
|
|
23
24
|
const detectAvailableWheelEvent = (document) => {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
25
|
+
if (!isBrowser)
|
|
26
|
+
return null;
|
|
27
|
+
else {
|
|
28
|
+
let support;
|
|
29
|
+
if ("onwheel" in document.createElement("div")) {
|
|
30
|
+
support = "wheel";
|
|
31
|
+
} else if (document.onmousewheel !== void 0) {
|
|
32
|
+
support = "mousewheel";
|
|
33
|
+
} else {
|
|
34
|
+
support = "DOMMouseScroll";
|
|
35
|
+
}
|
|
36
|
+
return support;
|
|
31
37
|
}
|
|
32
|
-
return support;
|
|
33
38
|
};
|
|
34
39
|
const elemCbMap = /* @__PURE__ */ new WeakMap();
|
|
35
40
|
const getWheelListener = ({ addApiName, removeApiName, prefix, support, window }) => ({
|
package/time-panel/index.js
CHANGED
|
@@ -66,7 +66,14 @@ const computItems = ({ api, state }) => () => {
|
|
|
66
66
|
current = api.nextTime(current, step);
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
|
-
|
|
69
|
+
if (state.isFilter) {
|
|
70
|
+
const newItems = result.filter((item) => {
|
|
71
|
+
return item.value.includes(state.filterVal);
|
|
72
|
+
});
|
|
73
|
+
return newItems;
|
|
74
|
+
} else {
|
|
75
|
+
return result;
|
|
76
|
+
}
|
|
70
77
|
};
|
|
71
78
|
const handleClick = (api) => (item) => !item.disabled && api.emitPick({ value: item.value });
|
|
72
79
|
const handleClear = ({ api, state }) => () => {
|
package/time-panel/vue.js
CHANGED
|
@@ -33,6 +33,8 @@ const initState = ({ reactive, computed, api: api2 }) => {
|
|
|
33
33
|
maxTime: "",
|
|
34
34
|
width: 0,
|
|
35
35
|
lastEmitValue: "",
|
|
36
|
+
isFilter: false,
|
|
37
|
+
filterVal: "",
|
|
36
38
|
items: computed(() => api2.computItems()),
|
|
37
39
|
default: computed(() => state.defaultValue || state.defaultTime || ""),
|
|
38
40
|
value: computed({
|
package/time-spinner/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import "../chunk-G2ADBYYC.js";
|
|
2
2
|
import { modifyTime } from "../common/deps/date-util";
|
|
3
3
|
import { DATEPICKER } from "../common";
|
|
4
|
+
import { isBrowser } from "../common/browser";
|
|
4
5
|
const getArrowHourList = (state) => () => {
|
|
5
6
|
const hours = state.hours;
|
|
6
7
|
const step = state.step.hours;
|
|
@@ -142,7 +143,7 @@ const adjustCurrentSpinner = ({ api, state }) => (type) => {
|
|
|
142
143
|
api.adjustSpinner(type, state[type]);
|
|
143
144
|
};
|
|
144
145
|
const adjustSpinner = ({ api, props, vm, state }) => (type, value) => {
|
|
145
|
-
if (props.arrowControl) {
|
|
146
|
+
if (props.arrowControl || !isBrowser) {
|
|
146
147
|
return;
|
|
147
148
|
}
|
|
148
149
|
const el = vm.$refs[type].$refs.wrap;
|
package/toggle-menu/index.js
CHANGED
package/transfer/index.js
CHANGED
|
@@ -105,11 +105,7 @@ const addToRight = ({
|
|
|
105
105
|
const itemsToBeMoved = [];
|
|
106
106
|
const key = props.props.key;
|
|
107
107
|
if (props.render && props.render.plugin.name === Tree) {
|
|
108
|
-
|
|
109
|
-
currentValue = refs.leftPanel.$refs.plugin.getCheckedKeys();
|
|
110
|
-
} else {
|
|
111
|
-
state.leftChecked.forEach((item) => !currentValue.includes(item) && currentValue.push(item));
|
|
112
|
-
}
|
|
108
|
+
state.leftChecked.forEach((item) => !currentValue.includes(item) && currentValue.push(item));
|
|
113
109
|
} else {
|
|
114
110
|
if (value === "all") {
|
|
115
111
|
state.leftData.forEach((item) => {
|