@opentiny/vue-renderless 3.17.6 → 3.18.0-beta.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/README.md +12 -3
- package/action-menu/index.js +2 -2
- package/action-menu/vue.js +2 -2
- package/anchor/index.js +11 -4
- package/autocomplete/index.js +20 -14
- package/autocomplete/vue.js +36 -9
- package/badge/index.js +4 -3
- package/base-select/index.js +3 -3
- package/breadcrumb-item/vue.js +1 -1
- package/button-group/index.js +6 -1
- package/carousel-item/index.js +1 -1
- package/checkbox/index.js +1 -1
- package/collapse-item/index.js +7 -1
- package/collapse-item/vue.js +12 -2
- package/color-picker/index.js +20 -32
- package/color-picker/vue.js +31 -54
- package/color-select-panel/index.js +8 -5
- package/color-select-panel/vue.js +1 -2
- package/common/deps/clickoutside.js +10 -3
- package/common/deps/dom.js +9 -1
- package/common/deps/tree-model/tree-store.js +13 -2
- package/common/deps/useRelation.js +24 -7
- package/common/deps/useWindowSize.js +23 -0
- package/common/form/const.js +10 -0
- package/common/index.js +1 -1
- package/common/prop-util.js +43 -0
- package/common/runtime.js +1 -1
- package/common/xss.js +2 -2
- 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-box/index.js +1 -1
- package/dialog-select/index.js +40 -13
- package/dialog-select/vue.js +3 -3
- package/drawer/index.js +13 -0
- package/drawer/vue.js +4 -3
- package/dropdown-item/index.js +2 -2
- package/dropdown-item/mf.js +1 -1
- package/dropdown-item/vue.js +9 -6
- package/dropdown-menu/index.js +3 -0
- package/dropdown-menu/vue.js +5 -3
- package/fall-menu/index.js +4 -0
- package/fall-menu/vue.js +15 -2
- package/file-upload/index.js +4 -4
- package/filter-box/vue.js +5 -2
- package/fluent-editor/index.js +10 -3
- package/fluent-editor/options.js +93 -27
- package/fluent-editor/vue.js +8 -8
- package/form/index.js +7 -4
- package/form/vue.js +1 -1
- package/form-item/index.js +6 -1
- package/form-item/vue.js +3 -1
- package/grid/utils/dom.js +3 -1
- package/guide/index.js +21 -6
- package/input/index.js +17 -1
- package/input/vue.js +19 -8
- 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/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 +7 -3
- package/option/index.js +0 -15
- package/option/vue.js +2 -13
- package/package.json +7 -7
- package/pager/index.js +25 -0
- package/pager/vue.js +18 -4
- package/pager-item/index.js +4 -7
- package/picker/index.js +27 -7
- package/picker/vue.js +2 -1
- package/pop-upload/index.js +13 -4
- package/pop-upload/vue.js +4 -0
- package/popeditor/index.js +14 -2
- package/popeditor/vue.js +9 -5
- package/rich-text-editor/vue.js +9 -3
- package/select/index.js +12 -11
- package/select/vue.js +14 -5
- package/slider/index.js +2 -2
- package/slider-button/index.js +8 -3
- package/slider-button/vue.js +6 -2
- package/slider-button-group/index.js +46 -9
- package/slider-button-group/vue.js +40 -18
- package/split/vue.js +4 -2
- package/sticky/index.js +89 -0
- package/sticky/vue.js +74 -0
- package/tab-item-mf/vue.js +6 -1
- package/tabs-mf/index.js +58 -3
- package/tabs-mf/vue-bar.js +0 -6
- package/tabs-mf/vue-swipe.js +20 -0
- package/tabs-mf/vue.js +22 -4
- package/time/index.js +6 -1
- package/time/vue.js +8 -2
- package/time-line/index.js +1 -1
- package/time-line-new/index.js +53 -0
- package/time-line-new/vue.js +41 -0
- package/time-range/vue.js +4 -1
- package/time-spinner/index.js +4 -1
- package/time-spinner/vue.js +2 -2
- package/tooltip/vue.js +16 -3
- package/transfer-panel/vue.js +7 -6
- package/tree/index.js +18 -7
- package/tree/vue.js +14 -7
- package/tree-node/index.js +2 -2
- package/tree-node/vue.js +6 -2
- package/tree-select/index.js +6 -6
- package/tree-select/vue.js +1 -1
- package/types/action-menu.type.d.ts +1 -1
- package/types/alert.type.d.ts +2 -0
- package/types/autocomplete.type.d.ts +17 -13
- package/types/badge.type.d.ts +1 -1
- package/types/button-group.type.d.ts +3 -0
- package/types/button.type.d.ts +21 -0
- package/types/checkbox.type.d.ts +1 -0
- package/types/date-picker.type.d.ts +3 -0
- package/types/drawer.type.d.ts +5 -1
- package/types/{dropdown-item.type-678794c9.d.ts → dropdown-item.type-c9badbc1.d.ts} +6 -2
- package/types/dropdown-item.type.d.ts +1 -1
- package/types/dropdown-menu.type.d.ts +1 -1
- package/types/dropdown.type.d.ts +4 -0
- package/types/fall-menu.type.d.ts +1 -0
- package/types/file-upload.type.d.ts +1 -1
- package/types/form-item.type.d.ts +1 -1
- package/types/{form.type-33aa784a.d.ts → form.type-f6fb4c38.d.ts} +5 -0
- package/types/form.type.d.ts +1 -1
- package/types/input.type.d.ts +12 -2
- package/types/link.type.d.ts +6 -1
- 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/popover.type.d.ts +1 -1
- package/types/search.type.d.ts +4 -0
- 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/transfer.type.d.ts +3 -3
- package/types/tree-menu.type.d.ts +4 -1
- package/types/upload-dragger.type.d.ts +1 -1
- package/types/{upload-list.type-02a1effb.d.ts → upload-list.type-26173587.d.ts} +17 -3
- package/types/upload-list.type.d.ts +1 -1
- package/types/upload.type.d.ts +1 -1
- 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/LICENSE +0 -22
package/modal/vue.js
CHANGED
|
@@ -68,7 +68,8 @@ const renderless = (props, { computed, onMounted, onBeforeUnmount, reactive, wat
|
|
|
68
68
|
prevEvent: null,
|
|
69
69
|
options: [],
|
|
70
70
|
theme: props.tiny_theme,
|
|
71
|
-
boxStyle: computed(() => api2.computedBoxStyle())
|
|
71
|
+
boxStyle: computed(() => api2.computedBoxStyle()),
|
|
72
|
+
timer: 0
|
|
72
73
|
});
|
|
73
74
|
Object.assign(api2, {
|
|
74
75
|
state,
|
|
@@ -81,8 +82,8 @@ const renderless = (props, { computed, onMounted, onBeforeUnmount, reactive, wat
|
|
|
81
82
|
mounted: mounted({ api: api2, parent, props, isMobileFirstMode, state }),
|
|
82
83
|
beforeUnmouted: beforeUnmouted({ api: api2, parent, isMobileFirstMode }),
|
|
83
84
|
selfClickEvent: selfClickEvent({ api: api2, parent, props }),
|
|
84
|
-
mouseEnterEvent: mouseEnterEvent(),
|
|
85
|
-
mouseLeaveEvent: mouseLeaveEvent({ api: api2, props }),
|
|
85
|
+
mouseEnterEvent: mouseEnterEvent(state),
|
|
86
|
+
mouseLeaveEvent: mouseLeaveEvent({ api: api2, props, state }),
|
|
86
87
|
updateZindex: updateZindex({ state, props }),
|
|
87
88
|
handleEvent: handleEvent({ api: api2, emit, parent, props, isMobileFirstMode }),
|
|
88
89
|
closeEvent: closeEvent(api2),
|
package/nav-menu/index.js
CHANGED
|
@@ -144,8 +144,8 @@ const mounted = ({
|
|
|
144
144
|
api.calcWidth();
|
|
145
145
|
on(window, "resize", api.calcWidth);
|
|
146
146
|
if (router) {
|
|
147
|
-
state.afterEach = () => {
|
|
148
|
-
api.setActiveMenu(api.getSelectedIndex(
|
|
147
|
+
state.afterEach = (to) => {
|
|
148
|
+
api.setActiveMenu(api.getSelectedIndex(to.path));
|
|
149
149
|
};
|
|
150
150
|
router.afterEach(state.afterEach);
|
|
151
151
|
}
|
|
@@ -160,6 +160,8 @@ const unMounted = ({ api, state, router }) => () => {
|
|
|
160
160
|
off(window, "resize", api.calcWidth);
|
|
161
161
|
};
|
|
162
162
|
const getSelectedIndex = (state) => (path) => {
|
|
163
|
+
if (!path)
|
|
164
|
+
return;
|
|
163
165
|
let length = state.data.length;
|
|
164
166
|
let index = -1;
|
|
165
167
|
if (path !== "/") {
|
|
@@ -322,6 +324,8 @@ const clickMenu = ({ api, props, state }) => (item, index, parentIndex) => {
|
|
|
322
324
|
}
|
|
323
325
|
};
|
|
324
326
|
const skip = ({ api, router, fields }) => (item, flag = false) => {
|
|
327
|
+
if (!router)
|
|
328
|
+
return;
|
|
325
329
|
if (item.isFullUrl) {
|
|
326
330
|
const { urlField = "url" } = fields || {};
|
|
327
331
|
const router2 = item[urlField] || item.route;
|
|
@@ -329,7 +333,7 @@ const skip = ({ api, router, fields }) => (item, flag = false) => {
|
|
|
329
333
|
}
|
|
330
334
|
const address = !item.route || !flag ? api.getUrl(item).replace(/^#/, "") : `/${item.route || ""}`.replace(/^\/+/, "/").replace("#/", "");
|
|
331
335
|
if (address) {
|
|
332
|
-
return router.push(address);
|
|
336
|
+
return router == null ? void 0 : router.push(address);
|
|
333
337
|
} else {
|
|
334
338
|
return "";
|
|
335
339
|
}
|
package/option/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import "../chunk-G2ADBYYC.js";
|
|
2
2
|
import { getObj } from "../common/object";
|
|
3
|
-
import { omitText } from "../common/string";
|
|
4
3
|
const escapeRegexpString = (value = "") => String(value).replace(/[|\\{}()[\]^$+*?.]/g, "\\$&");
|
|
5
4
|
const isEqual = ({ select, state }) => (a, b) => {
|
|
6
5
|
if (!state.isObject) {
|
|
@@ -24,19 +23,6 @@ const handleGroupDisabled = ({ state, vm }) => (val) => {
|
|
|
24
23
|
state.groupDisabled = val;
|
|
25
24
|
vm.groupDisabled = val;
|
|
26
25
|
};
|
|
27
|
-
const hoverItem = ({ select, props, state }) => (e) => {
|
|
28
|
-
const dom = e.target;
|
|
29
|
-
const text = dom.textContent;
|
|
30
|
-
const style = window.getComputedStyle(dom);
|
|
31
|
-
const font = style.font;
|
|
32
|
-
const rect = dom.getBoundingClientRect();
|
|
33
|
-
const textWidth = rect.width - parseInt(style.paddingLeft || 0) - parseInt(style.paddingRight || 0);
|
|
34
|
-
const res = omitText(text, font, textWidth);
|
|
35
|
-
state.showTitle = res.o;
|
|
36
|
-
if (!props.disabled && !state.groupDisabled && !select.state.disabledOptionHover) {
|
|
37
|
-
select.state.hoverIndex = select.state.optionIndexArr.indexOf(state.index);
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
26
|
const selectOptionClick = ({ props, state, select, constants, vm }) => () => {
|
|
41
27
|
if (props.disabled !== true && state.groupDisabled !== true) {
|
|
42
28
|
if (select.multiple && props.required === true)
|
|
@@ -67,7 +53,6 @@ export {
|
|
|
67
53
|
contains,
|
|
68
54
|
escapeRegexpString,
|
|
69
55
|
handleGroupDisabled,
|
|
70
|
-
hoverItem,
|
|
71
56
|
initValue,
|
|
72
57
|
isEqual,
|
|
73
58
|
queryChange,
|
package/option/vue.js
CHANGED
|
@@ -2,17 +2,8 @@ import {
|
|
|
2
2
|
__spreadProps,
|
|
3
3
|
__spreadValues
|
|
4
4
|
} from "../chunk-G2ADBYYC.js";
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
contains,
|
|
8
|
-
handleGroupDisabled,
|
|
9
|
-
hoverItem,
|
|
10
|
-
selectOptionClick,
|
|
11
|
-
queryChange,
|
|
12
|
-
toggleEvent,
|
|
13
|
-
initValue
|
|
14
|
-
} from "./index";
|
|
15
|
-
const api = ["state", "visible", "hoverItem", "selectOptionClick"];
|
|
5
|
+
import { isEqual, contains, handleGroupDisabled, selectOptionClick, queryChange, toggleEvent, initValue } from "./index";
|
|
6
|
+
const api = ["state", "visible", "selectOptionClick"];
|
|
16
7
|
const initState = ({ reactive, computed, props, api: api2, markRaw, select, parent }) => {
|
|
17
8
|
const state = reactive({
|
|
18
9
|
parent: markRaw(parent),
|
|
@@ -26,7 +17,6 @@ const initState = ({ reactive, computed, props, api: api2, markRaw, select, pare
|
|
|
26
17
|
disabled: computed(() => props.disabled || state.groupDisabled),
|
|
27
18
|
isObject: computed(() => Object.prototype.toString.call(props.value).toLowerCase() === "[object object]"),
|
|
28
19
|
currentLabel: computed(() => props.label || (state.isObject ? "" : props.value)),
|
|
29
|
-
showTitle: false,
|
|
30
20
|
currentValue: computed(() => props.value || props.label || ""),
|
|
31
21
|
itemSelected: computed(() => {
|
|
32
22
|
if (!select.multiple) {
|
|
@@ -54,7 +44,6 @@ const initApi = ({ api: api2, props, state, select, constants, vm }) => {
|
|
|
54
44
|
state,
|
|
55
45
|
isEqual: isEqual({ select, state }),
|
|
56
46
|
contains: contains({ select, state }),
|
|
57
|
-
hoverItem: hoverItem({ select, props, state }),
|
|
58
47
|
queryChange: queryChange({ select, props, state }),
|
|
59
48
|
selectOptionClick: selectOptionClick({ constants, vm, props, state, select }),
|
|
60
49
|
handleGroupDisabled: handleGroupDisabled({ state, vm }),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opentiny/vue-renderless",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.18.0-beta.1",
|
|
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",
|
|
@@ -24,6 +24,12 @@
|
|
|
24
24
|
"headless-components"
|
|
25
25
|
],
|
|
26
26
|
"sideEffects": false,
|
|
27
|
+
"scripts": {
|
|
28
|
+
"build": "tsup",
|
|
29
|
+
"build:fast": "npm run build && npm run release",
|
|
30
|
+
"postversion": "pnpm build",
|
|
31
|
+
"release": "esno ./scripts/postbuild.ts && shx cp README.md dist"
|
|
32
|
+
},
|
|
27
33
|
"dependencies": {
|
|
28
34
|
"color": "4.2.3",
|
|
29
35
|
"xss": "1.0.11"
|
|
@@ -31,11 +37,5 @@
|
|
|
31
37
|
"devDependencies": {
|
|
32
38
|
"esno": "^4.7.0",
|
|
33
39
|
"tsup": "7.2.0"
|
|
34
|
-
},
|
|
35
|
-
"scripts": {
|
|
36
|
-
"build": "tsup",
|
|
37
|
-
"build:fast": "npm run build && npm run release",
|
|
38
|
-
"postversion": "pnpm build",
|
|
39
|
-
"release": "esno ./scripts/postbuild.ts && shx cp README.md dist"
|
|
40
40
|
}
|
|
41
41
|
}
|
package/pager/index.js
CHANGED
|
@@ -13,6 +13,7 @@ const computedInternalLayout = ({ props }) => () => {
|
|
|
13
13
|
props.mode === "simple" && (layout = "sizes, total, prev, current, next");
|
|
14
14
|
props.mode === "complete" && (layout = "sizes, total, prev, pager, next, jumper");
|
|
15
15
|
props.mode === "fixed" && (layout = "prev,pager,next");
|
|
16
|
+
props.mode === "simplest" && (layout = "total, prev, simplest-pager, next");
|
|
16
17
|
} else if (!props.mode && props.layout || props.mode && props.layout) {
|
|
17
18
|
layout = props.layout;
|
|
18
19
|
} else {
|
|
@@ -52,6 +53,27 @@ const computedInternalPageCount = ({ props, state }) => () => {
|
|
|
52
53
|
}
|
|
53
54
|
return null;
|
|
54
55
|
};
|
|
56
|
+
const computedSimplestPagerOption = ({ props, state }) => () => {
|
|
57
|
+
const itemSizes = Math.max(1, Math.ceil(props.total / state.internalPageSize));
|
|
58
|
+
return Array.from({ length: itemSizes }).map((item, index) => ({
|
|
59
|
+
value: index + 1,
|
|
60
|
+
label: `${index + 1}/${itemSizes}`
|
|
61
|
+
}));
|
|
62
|
+
};
|
|
63
|
+
const computedSimplestPagerWidth = ({ state }) => () => {
|
|
64
|
+
const baseWidth = 60;
|
|
65
|
+
const num = String(state.internalCurrentPage).length + String(state.simplestPagerOption.length).length;
|
|
66
|
+
return baseWidth + num * 8;
|
|
67
|
+
};
|
|
68
|
+
const computedPageSizeText = ({ props, designConfig }) => () => {
|
|
69
|
+
if (props.pageSizeText) {
|
|
70
|
+
return props.pageSizeText;
|
|
71
|
+
}
|
|
72
|
+
if ((designConfig == null ? void 0 : designConfig.state) && Object.hasOwnProperty.call(designConfig.state, "pageSizeText")) {
|
|
73
|
+
return designConfig.state.pageSizeText;
|
|
74
|
+
}
|
|
75
|
+
return "";
|
|
76
|
+
};
|
|
55
77
|
const handleJumperFocus = ({ state }) => (e) => {
|
|
56
78
|
var _a;
|
|
57
79
|
state.jumperBackup = (_a = e.target) == null ? void 0 : _a.value;
|
|
@@ -344,7 +366,10 @@ export {
|
|
|
344
366
|
clickSizes,
|
|
345
367
|
computedInternalLayout,
|
|
346
368
|
computedInternalPageCount,
|
|
369
|
+
computedPageSizeText,
|
|
347
370
|
computedShowPager,
|
|
371
|
+
computedSimplestPagerOption,
|
|
372
|
+
computedSimplestPagerWidth,
|
|
348
373
|
computedTotalText,
|
|
349
374
|
copyEmit,
|
|
350
375
|
emitChange,
|
package/pager/vue.js
CHANGED
|
@@ -4,6 +4,9 @@ import {
|
|
|
4
4
|
computedInternalLayout,
|
|
5
5
|
computedTotalText,
|
|
6
6
|
computedInternalPageCount,
|
|
7
|
+
computedSimplestPagerOption,
|
|
8
|
+
computedSimplestPagerWidth,
|
|
9
|
+
computedPageSizeText,
|
|
7
10
|
handleJumperFocus,
|
|
8
11
|
handleSizeChange,
|
|
9
12
|
handleJumperInput,
|
|
@@ -60,7 +63,7 @@ const api = [
|
|
|
60
63
|
"clickSizes"
|
|
61
64
|
];
|
|
62
65
|
const renderless = (props, { reactive, computed, watch }, { emit, vm, nextTick, t, designConfig }) => {
|
|
63
|
-
var _a, _b, _c, _d
|
|
66
|
+
var _a, _b, _c, _d;
|
|
64
67
|
const api2 = {};
|
|
65
68
|
const state = reactive({
|
|
66
69
|
showSizes: false,
|
|
@@ -71,14 +74,22 @@ const renderless = (props, { reactive, computed, watch }, { emit, vm, nextTick,
|
|
|
71
74
|
internalTotal: props.total,
|
|
72
75
|
jumperValue: "1",
|
|
73
76
|
jumperBackup: "1",
|
|
77
|
+
simplestPagerOption: computed(() => api2.computedSimplestPagerOption()),
|
|
78
|
+
simplestPagerWidth: computed(() => api2.computedSimplestPagerWidth()),
|
|
74
79
|
showPager: computed(() => api2.computedShowPager()),
|
|
75
80
|
internalLayout: computed(() => api2.computedInternalLayout()),
|
|
76
81
|
totalText: computed(() => api2.computedTotalText()),
|
|
77
82
|
internalPageCount: computed(() => api2.computedInternalPageCount()),
|
|
78
|
-
|
|
79
|
-
align: props.align || ((_c = designConfig == null ? void 0 : designConfig.state) == null ? void 0 : _c.align) || "
|
|
83
|
+
showJumperSuffix: (_b = (_a = designConfig == null ? void 0 : designConfig.state) == null ? void 0 : _a.showJumperSuffix) != null ? _b : true,
|
|
84
|
+
align: props.align || ((_c = designConfig == null ? void 0 : designConfig.state) == null ? void 0 : _c.align) || "right",
|
|
80
85
|
totalI18n: ((_d = designConfig == null ? void 0 : designConfig.state) == null ? void 0 : _d.totalI18n) || "totals",
|
|
81
|
-
totalFixedLeft: (
|
|
86
|
+
totalFixedLeft: computed(
|
|
87
|
+
() => {
|
|
88
|
+
var _a2, _b2, _c2, _d2;
|
|
89
|
+
return (_d2 = (_c2 = (_b2 = props.totalFixedLeft) != null ? _b2 : (_a2 = designConfig == null ? void 0 : designConfig.state) == null ? void 0 : _a2.totalFixedLeft) != null ? _c2 : props.mode !== "simplest") != null ? _d2 : true;
|
|
90
|
+
}
|
|
91
|
+
),
|
|
92
|
+
pageSizeText: computed(() => api2.computedPageSizeText())
|
|
82
93
|
});
|
|
83
94
|
Object.assign(api2, {
|
|
84
95
|
state,
|
|
@@ -86,6 +97,9 @@ const renderless = (props, { reactive, computed, watch }, { emit, vm, nextTick,
|
|
|
86
97
|
computedInternalLayout: computedInternalLayout({ props }),
|
|
87
98
|
computedTotalText: computedTotalText({ props, t }),
|
|
88
99
|
computedInternalPageCount: computedInternalPageCount({ props, state }),
|
|
100
|
+
computedSimplestPagerOption: computedSimplestPagerOption({ props, state }),
|
|
101
|
+
computedSimplestPagerWidth: computedSimplestPagerWidth({ state }),
|
|
102
|
+
computedPageSizeText: computedPageSizeText({ props, designConfig }),
|
|
89
103
|
getValidCurrentPage: getValidCurrentPage({ state }),
|
|
90
104
|
handleJumperFocus: handleJumperFocus({ state }),
|
|
91
105
|
handleSizeChange: handleSizeChange({ props, state, api: api2, emit, vm }),
|
package/pager-item/index.js
CHANGED
|
@@ -65,13 +65,10 @@ const onPagerClick = ({ emit, props, vm }) => (event) => {
|
|
|
65
65
|
const pageCount = props.pageCount;
|
|
66
66
|
const currentPage = props.currentPage;
|
|
67
67
|
const pagerCountOffset = props.pagerCount - 2;
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
} else if (classListVal.includes("quicknext")) {
|
|
73
|
-
newPage = currentPage + pagerCountOffset;
|
|
74
|
-
}
|
|
68
|
+
if (parentEl === vm.$refs.prev) {
|
|
69
|
+
newPage = currentPage - pagerCountOffset;
|
|
70
|
+
} else if (parentEl === vm.$refs.next) {
|
|
71
|
+
newPage = currentPage + pagerCountOffset;
|
|
75
72
|
}
|
|
76
73
|
if (!isNaN(newPage)) {
|
|
77
74
|
if (newPage < 1) {
|
package/picker/index.js
CHANGED
|
@@ -47,7 +47,7 @@ const watchMobileVisible = ({ api, props, state, nextTick }) => ([dateMobileVisi
|
|
|
47
47
|
}
|
|
48
48
|
};
|
|
49
49
|
const watchPickerVisible = ({ api, vm, dispatch, emit, props, state, nextTick }) => (value) => {
|
|
50
|
-
if (props.readonly || state.pickerDisabled || state.
|
|
50
|
+
if (props.readonly || state.pickerDisabled || state.isMobileMode)
|
|
51
51
|
return;
|
|
52
52
|
if (value) {
|
|
53
53
|
api.showPicker();
|
|
@@ -167,7 +167,7 @@ const getTimezone = ({ props, utils }) => () => {
|
|
|
167
167
|
const setting = utils.getDateFormat && utils.getDateFormat();
|
|
168
168
|
const { DbTimezone, Timezone, TimezoneOffset } = setting || {};
|
|
169
169
|
const cur = getLocalTimezone();
|
|
170
|
-
const isTzNumber = (z) => typeof z === "number" && z >= -12 && z <=
|
|
170
|
+
const isTzNumber = (z) => typeof z === "number" && z >= -12 && z <= 14;
|
|
171
171
|
if (!~type.indexOf("datetime")) {
|
|
172
172
|
return { from: cur, to: cur };
|
|
173
173
|
}
|
|
@@ -429,15 +429,35 @@ const getSelectionStart = ({ value, format, regx, event }) => {
|
|
|
429
429
|
}
|
|
430
430
|
return { selectionStart, I };
|
|
431
431
|
};
|
|
432
|
+
const getEffectiveDateString = (formatStr) => {
|
|
433
|
+
const serializationList = [{ "MM": "01" }, { "M": "1" }, { "dd": "01" }, { "d": "1" }];
|
|
434
|
+
let result = formatStr;
|
|
435
|
+
serializationList.forEach((item) => {
|
|
436
|
+
const itemKey = Object.keys(item)[0];
|
|
437
|
+
if (result.includes(itemKey)) {
|
|
438
|
+
result = result.replace(itemKey, item[itemKey]);
|
|
439
|
+
}
|
|
440
|
+
});
|
|
441
|
+
return result;
|
|
442
|
+
};
|
|
432
443
|
const getNum = (value, format, regx) => {
|
|
433
444
|
let len = value.length;
|
|
445
|
+
let formatStr = "";
|
|
434
446
|
if (format && regx) {
|
|
435
447
|
const formatMatchArr = format.match(regx);
|
|
436
|
-
|
|
448
|
+
formatStr = formatMatchArr.join("");
|
|
449
|
+
len = Math.max(len, formatStr.length);
|
|
437
450
|
}
|
|
438
|
-
|
|
451
|
+
const num = { str: "", arr: [] };
|
|
439
452
|
for (let i = 0; i < len; i++) {
|
|
440
|
-
let
|
|
453
|
+
let fillStr = "0";
|
|
454
|
+
if (formatStr && len > value.length) {
|
|
455
|
+
const validStr = getEffectiveDateString(formatStr);
|
|
456
|
+
if (/[0-9]/.test(validStr[i])) {
|
|
457
|
+
fillStr = validStr[i];
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
const char = value.charAt(i) ? value.charAt(i) : fillStr;
|
|
441
461
|
if (/[0-9]/.test(char)) {
|
|
442
462
|
num.str += char;
|
|
443
463
|
} else {
|
|
@@ -683,9 +703,9 @@ const handleClose = ({ api, props, state }) => () => {
|
|
|
683
703
|
const handleFocus = ({ emit, vm, state, api }) => () => {
|
|
684
704
|
const type = state.type;
|
|
685
705
|
if (DATEPICKER.TriggerTypes.includes(type)) {
|
|
686
|
-
if (state.
|
|
706
|
+
if (state.isMobileMode && state.isDateMobileComponent) {
|
|
687
707
|
api.dateMobileToggle(true);
|
|
688
|
-
} else if (state.
|
|
708
|
+
} else if (state.isMobileMode && state.isTimeMobileComponent) {
|
|
689
709
|
api.timeMobileToggle(true);
|
|
690
710
|
} else {
|
|
691
711
|
state.pickerVisible = true;
|
package/picker/vue.js
CHANGED
|
@@ -123,7 +123,7 @@ const initState = ({ api: api2, reactive, vm, computed, props, utils, parent, br
|
|
|
123
123
|
labelTooltip: "",
|
|
124
124
|
displayOnlyTooltip: "",
|
|
125
125
|
isDisplayOnly: computed(() => props.displayOnly || (parent.tinyForm || {}).displayOnly),
|
|
126
|
-
|
|
126
|
+
isMobileMode: computed(() => vm.$mode.includes("mobile")),
|
|
127
127
|
dateMobileOption: {
|
|
128
128
|
visible: false,
|
|
129
129
|
type: props.type,
|
|
@@ -254,6 +254,7 @@ const initWatch = ({ api: api2, state, props, watch, markRaw }) => {
|
|
|
254
254
|
(value) => state.picker && (state.picker.state.value = value),
|
|
255
255
|
{ immediate: true }
|
|
256
256
|
);
|
|
257
|
+
watch(() => props.type, api2.mountPicker);
|
|
257
258
|
watch(() => props.isRange, api2.watchIsRange);
|
|
258
259
|
watch(() => props.modelValue, api2.watchModelValue);
|
|
259
260
|
watch(() => props.pickerOptions, api2.updateOptions, { deep: true });
|
package/pop-upload/index.js
CHANGED
|
@@ -6,6 +6,14 @@ const computedconfirm = ({ constants, props, t }) => () => props.submitButtonTex
|
|
|
6
6
|
const computedFileName = ({ constants, t }) => () => t(constants.FILE_NAME);
|
|
7
7
|
const computedUploadError = ({ constants, t }) => () => t(constants.UPLOAD_ERROR);
|
|
8
8
|
const computedFileStatus = ({ constants, t }) => () => t(constants.FILE_STATUS);
|
|
9
|
+
const computedFileWords = ({ t }) => () => ({
|
|
10
|
+
operation: t("ui.popupload.operation"),
|
|
11
|
+
waitUpload: t("ui.popupload.waitUpload"),
|
|
12
|
+
success: t("ui.popupload.success"),
|
|
13
|
+
uploadError: t("ui.popupload.uploadError"),
|
|
14
|
+
confirmDeleteTips: t("ui.popupload.confirmDeleteTips"),
|
|
15
|
+
delete: t("ui.popupload.delete")
|
|
16
|
+
});
|
|
9
17
|
const computedFileSize = ({ constants, t }) => () => t(constants.FILE_SIZE);
|
|
10
18
|
const computedErrorSizeTips = ({ constants, t }) => () => t(constants.ERROR_SIZE_TIPS);
|
|
11
19
|
const computedErrorNumTips = ({ constants, t }) => () => t(constants.ERROR_NUM_TIPS);
|
|
@@ -45,7 +53,7 @@ const closeErrorTips = (state) => () => state.errorTips = [];
|
|
|
45
53
|
const closeSuccessTips = (state) => () => state.successTips = [];
|
|
46
54
|
const watchLimit = (state) => (value) => {
|
|
47
55
|
state.limit = value;
|
|
48
|
-
if (value
|
|
56
|
+
if (value !== void 0 && value > 0) {
|
|
49
57
|
state.tipsTitle[0] = {
|
|
50
58
|
count: value
|
|
51
59
|
};
|
|
@@ -65,7 +73,7 @@ const watchUploaFileType = (state) => (value) => {
|
|
|
65
73
|
};
|
|
66
74
|
const watchMaxUploadFileSize = ({ constants, state }) => (value) => {
|
|
67
75
|
state.maxUploadFileSize = value;
|
|
68
|
-
if (value
|
|
76
|
+
if (value !== void 0 && value !== 0) {
|
|
69
77
|
state.tipsTitle[2] = {
|
|
70
78
|
size: Math.floor(value / 1024) + constants.KB
|
|
71
79
|
};
|
|
@@ -106,7 +114,7 @@ const beforeAvatarUpload = ({ props, state }) => (file) => {
|
|
|
106
114
|
let filepath = file.name;
|
|
107
115
|
let isnext = false;
|
|
108
116
|
let isSize = false;
|
|
109
|
-
if (state.uploadFileType && state.uploadFileType.length
|
|
117
|
+
if (state.uploadFileType && state.uploadFileType.length !== 0) {
|
|
110
118
|
let arr = filepath.split(".");
|
|
111
119
|
let fileend = "." + arr[arr.length - 1];
|
|
112
120
|
isnext = !~state.uploadFileType.indexOf(fileend);
|
|
@@ -114,7 +122,7 @@ const beforeAvatarUpload = ({ props, state }) => (file) => {
|
|
|
114
122
|
state.errorTips.push({ type: file.name });
|
|
115
123
|
}
|
|
116
124
|
}
|
|
117
|
-
if (state.maxUploadFileSize && state.maxUploadFileSize
|
|
125
|
+
if (state.maxUploadFileSize && state.maxUploadFileSize !== 0) {
|
|
118
126
|
if (file.size > state.maxUploadFileSize) {
|
|
119
127
|
state.errorTips.push({ size: file.name });
|
|
120
128
|
isSize = true;
|
|
@@ -135,6 +143,7 @@ export {
|
|
|
135
143
|
computedFileName,
|
|
136
144
|
computedFileSize,
|
|
137
145
|
computedFileStatus,
|
|
146
|
+
computedFileWords,
|
|
138
147
|
computedLimitCountTips,
|
|
139
148
|
computedLimitSizeTips,
|
|
140
149
|
computedLimitTypeTips,
|
package/pop-upload/vue.js
CHANGED
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
computedErrorTypeTips,
|
|
17
17
|
computedFileName,
|
|
18
18
|
computedFileStatus,
|
|
19
|
+
computedFileWords,
|
|
19
20
|
computedFileSize,
|
|
20
21
|
computedLimitSizeTips,
|
|
21
22
|
computedLimitTypeTips,
|
|
@@ -77,6 +78,8 @@ const initState = ({ reactive, props, computed, api: api2 }) => reactive({
|
|
|
77
78
|
fileSize: computed(() => api2.computedFileSize()),
|
|
78
79
|
fileName: computed(() => api2.computedFileName()),
|
|
79
80
|
fileStatus: computed(() => api2.computedFileStatus()),
|
|
81
|
+
// tiny新增
|
|
82
|
+
fileWords: computed(() => api2.computedFileWords()),
|
|
80
83
|
cancelButtonText: computed(() => api2.computedCancel()),
|
|
81
84
|
submitButtonText: computed(() => api2.computedconfirm()),
|
|
82
85
|
errorNumTips: computed(() => api2.computedErrorNumTips()),
|
|
@@ -120,6 +123,7 @@ const initApi = ({ api: api2, state, refs, emit, props, constants, t }) => {
|
|
|
120
123
|
computedFileSize: computedFileSize({ constants, t }),
|
|
121
124
|
computedCancel: computedCancel({ constants, props, t }),
|
|
122
125
|
computedFileStatus: computedFileStatus({ constants, t }),
|
|
126
|
+
computedFileWords: computedFileWords({ t }),
|
|
123
127
|
computedconfirm: computedconfirm({ constants, props, t }),
|
|
124
128
|
computedUploadError: computedUploadError({ constants, t }),
|
|
125
129
|
computedErrorNumTips: computedErrorNumTips({ constants, t }),
|
package/popeditor/index.js
CHANGED
|
@@ -27,7 +27,8 @@ const createSearchForm = (props) => (isRest) => props.conditions.reduce((acc, it
|
|
|
27
27
|
return acc;
|
|
28
28
|
}, {});
|
|
29
29
|
const getColumns = ({ constants, props }) => {
|
|
30
|
-
const { columns } = props.gridOp;
|
|
30
|
+
const { columns: preColumns } = props.gridOp;
|
|
31
|
+
const columns = preColumns.slice(0);
|
|
31
32
|
const selectionCol = find(
|
|
32
33
|
columns,
|
|
33
34
|
(col) => col.type === constants.COLUMNS_TYPE.selection || col.type === constants.COLUMNS_TYPE.radio
|
|
@@ -253,7 +254,7 @@ const initDisplay = ({ api, constants, props, state, nextTick }) => (value) => {
|
|
|
253
254
|
});
|
|
254
255
|
}
|
|
255
256
|
};
|
|
256
|
-
const openDialog = ({ api, props, state, emit }) => () => {
|
|
257
|
+
const openDialog = ({ api, props, state, emit, nextTick }) => () => {
|
|
257
258
|
if (state.disabled) {
|
|
258
259
|
return;
|
|
259
260
|
}
|
|
@@ -263,6 +264,9 @@ const openDialog = ({ api, props, state, emit }) => () => {
|
|
|
263
264
|
state.showContent = true;
|
|
264
265
|
emit("popup");
|
|
265
266
|
props.autoLookup && props.alwaysLoad && api.query();
|
|
267
|
+
nextTick(() => {
|
|
268
|
+
api.computedTreeMaxHeight();
|
|
269
|
+
});
|
|
266
270
|
};
|
|
267
271
|
const localFilter = ({ props, state }) => {
|
|
268
272
|
const keys = Object.keys(state.search);
|
|
@@ -650,10 +654,18 @@ const selectedBoxDrag = ({ props, state }) => ({ state: { select } }) => {
|
|
|
650
654
|
state.selectedValues = values;
|
|
651
655
|
}
|
|
652
656
|
};
|
|
657
|
+
const computedTreeMaxHeight = ({ vm, state }) => () => {
|
|
658
|
+
var _a;
|
|
659
|
+
const dialogBoxEl = vm.$refs.popeditorDialogBox.$el;
|
|
660
|
+
const searchInputBottom = 20;
|
|
661
|
+
const searchInputHeight = ((_a = dialogBoxEl.querySelector(".tiny-popeditor__filter-input")) == null ? void 0 : _a.clientHeight) || 0;
|
|
662
|
+
state.treeWrapperMaxHeight = `${dialogBoxEl.querySelector(".tiny-dialog-box__body").clientHeight - searchInputHeight - searchInputBottom}px`;
|
|
663
|
+
};
|
|
653
664
|
export {
|
|
654
665
|
closeSuggestPanel,
|
|
655
666
|
computedGetTitle,
|
|
656
667
|
computedModalWidth,
|
|
668
|
+
computedTreeMaxHeight,
|
|
657
669
|
computedTreeOp,
|
|
658
670
|
createSearchForm,
|
|
659
671
|
doClear,
|
package/popeditor/vue.js
CHANGED
|
@@ -46,7 +46,8 @@ import {
|
|
|
46
46
|
selectedBoxClear,
|
|
47
47
|
selectedBoxDelete,
|
|
48
48
|
selectedBoxDrag,
|
|
49
|
-
radioChangeFn
|
|
49
|
+
radioChangeFn,
|
|
50
|
+
computedTreeMaxHeight
|
|
50
51
|
} from "./index";
|
|
51
52
|
const api = [
|
|
52
53
|
"state",
|
|
@@ -76,7 +77,8 @@ const api = [
|
|
|
76
77
|
"selectedBoxClear",
|
|
77
78
|
"selectedBoxDelete",
|
|
78
79
|
"selectedBoxDrag",
|
|
79
|
-
"radioChangeFn"
|
|
80
|
+
"radioChangeFn",
|
|
81
|
+
"computedTreeMaxHeight"
|
|
80
82
|
];
|
|
81
83
|
const initState = ({ reactive, computed, props, api: api2, constants, t, parent, vm }) => {
|
|
82
84
|
const state = reactive({
|
|
@@ -117,7 +119,8 @@ const initState = ({ reactive, computed, props, api: api2, constants, t, parent,
|
|
|
117
119
|
showSuggestPanel: false,
|
|
118
120
|
inputHover: false,
|
|
119
121
|
search: null,
|
|
120
|
-
closeSuggestPanelInvoker: null
|
|
122
|
+
closeSuggestPanelInvoker: null,
|
|
123
|
+
treeWrapperMaxHeight: "auto"
|
|
121
124
|
});
|
|
122
125
|
return state;
|
|
123
126
|
};
|
|
@@ -140,7 +143,7 @@ const initApi = ({ api: api2, props, state, parent, vm, emit, popper, constants,
|
|
|
140
143
|
selectedGridSelectAll: selectedGridSelectAll({ constants, props, vm, state }),
|
|
141
144
|
selectedGridSelectChange: selectedGridSelectChange({ constants, props, vm, state }),
|
|
142
145
|
handleReset: handleReset({ api: api2, state, props }),
|
|
143
|
-
openDialog: openDialog({ api: api2, emit, props, state }),
|
|
146
|
+
openDialog: openDialog({ api: api2, emit, props, state, nextTick }),
|
|
144
147
|
initDisplay: initDisplay({ api: api2, constants, props, state, nextTick }),
|
|
145
148
|
handleSearch: handleSearch({ api: api2, props, state, vm, constants }),
|
|
146
149
|
computedTreeOp: computedTreeOp({ api: api2, constants }),
|
|
@@ -167,7 +170,8 @@ const initApi = ({ api: api2, props, state, parent, vm, emit, popper, constants,
|
|
|
167
170
|
selectedBoxClear: selectedBoxClear(api2),
|
|
168
171
|
selectedBoxDelete: selectedBoxDelete(api2),
|
|
169
172
|
selectedBoxDrag: selectedBoxDrag({ props, state }),
|
|
170
|
-
radioChangeFn: radioChangeFn({ props, api: api2 })
|
|
173
|
+
radioChangeFn: radioChangeFn({ props, api: api2 }),
|
|
174
|
+
computedTreeMaxHeight: computedTreeMaxHeight({ vm, state })
|
|
171
175
|
});
|
|
172
176
|
state.search = api2.createSearchForm(false);
|
|
173
177
|
};
|
package/rich-text-editor/vue.js
CHANGED
|
@@ -27,7 +27,7 @@ const api = [
|
|
|
27
27
|
"eventClick",
|
|
28
28
|
"Active"
|
|
29
29
|
];
|
|
30
|
-
const renderless = (props, { computed, onBeforeUnmount, reactive }, { vm, emit }, {
|
|
30
|
+
const renderless = (props, { computed, onBeforeUnmount, reactive, watch }, { vm, emit }, {
|
|
31
31
|
Editor,
|
|
32
32
|
StarterKit,
|
|
33
33
|
Table,
|
|
@@ -117,7 +117,7 @@ const renderless = (props, { computed, onBeforeUnmount, reactive }, { vm, emit }
|
|
|
117
117
|
addAttributes() {
|
|
118
118
|
return {
|
|
119
119
|
level: {
|
|
120
|
-
default: 1
|
|
120
|
+
default: 1.5
|
|
121
121
|
}
|
|
122
122
|
};
|
|
123
123
|
},
|
|
@@ -143,7 +143,7 @@ const renderless = (props, { computed, onBeforeUnmount, reactive }, { vm, emit }
|
|
|
143
143
|
addAttributes() {
|
|
144
144
|
return {
|
|
145
145
|
size: {
|
|
146
|
-
default:
|
|
146
|
+
default: 14
|
|
147
147
|
}
|
|
148
148
|
};
|
|
149
149
|
},
|
|
@@ -282,6 +282,12 @@ const renderless = (props, { computed, onBeforeUnmount, reactive }, { vm, emit }
|
|
|
282
282
|
onBeforeUnmount(() => {
|
|
283
283
|
state.editor.destroy();
|
|
284
284
|
});
|
|
285
|
+
watch(
|
|
286
|
+
() => props.modelValue,
|
|
287
|
+
(value) => {
|
|
288
|
+
state.editor.commands.setContent(value);
|
|
289
|
+
}
|
|
290
|
+
);
|
|
285
291
|
return api2;
|
|
286
292
|
};
|
|
287
293
|
export {
|