@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/badge/vue.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "../chunk-G2ADBYYC.js";
|
|
2
2
|
import { computedContent, computedValueRef, computedTransform } from "./index";
|
|
3
|
-
import { xss } from "
|
|
3
|
+
import { xss } from "@opentiny/utils";
|
|
4
4
|
const api = ["state"];
|
|
5
5
|
const renderless = (props, { computed, reactive }, { designConfig }) => {
|
|
6
6
|
const state = reactive({
|
package/base-select/index.js
CHANGED
|
@@ -19,6 +19,7 @@ import { isNull } from "../common/type";
|
|
|
19
19
|
import { fastdom } from "../common/deps/fastdom";
|
|
20
20
|
import { deepClone } from "../picker-column";
|
|
21
21
|
import { escapeRegexpString } from "../option";
|
|
22
|
+
import { isBrowser } from "../common/browser";
|
|
22
23
|
const handleComposition = ({ api, nextTick, state }) => (event) => {
|
|
23
24
|
const text = event.target.value;
|
|
24
25
|
if (event.type === "compositionend") {
|
|
@@ -1291,6 +1292,8 @@ const watchInitValue = ({ props, emit }) => (value) => {
|
|
|
1291
1292
|
}
|
|
1292
1293
|
};
|
|
1293
1294
|
const watchShowClose = ({ nextTick, state, parent }) => () => {
|
|
1295
|
+
if (!isBrowser)
|
|
1296
|
+
return;
|
|
1294
1297
|
nextTick(() => {
|
|
1295
1298
|
const parentEl = parent.$el;
|
|
1296
1299
|
const inputEl = parentEl.querySelector('input[data-tag="tiny-input-inner"]');
|
package/bulletin-board/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 getRoute = (route) => `/${route || ""}`.replace(/^\/+/, "/");
|
|
4
4
|
const computedDataList = ({ props, state }) => () => {
|
|
5
5
|
const list = props.data[Number(state.actName) - 1] || [];
|
package/button/index.js
CHANGED
package/cascader/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../chunk-G2ADBYYC.js";
|
|
2
|
-
import browser from "../common/browser";
|
|
2
|
+
import browser, { isBrowser } from "../common/browser";
|
|
3
3
|
import { isNull } from "../common/type";
|
|
4
4
|
import debounce from "../common/deps/debounce";
|
|
5
5
|
import { isEqual } from "../common/object";
|
|
@@ -237,15 +237,17 @@ const focusFirstNode = ({ vm, state }) => () => {
|
|
|
237
237
|
}
|
|
238
238
|
};
|
|
239
239
|
const computePresentText = ({ props, state }) => () => {
|
|
240
|
-
if (
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
state.
|
|
244
|
-
|
|
240
|
+
if (isBrowser) {
|
|
241
|
+
if (!isEmpty(state.checkedValue)) {
|
|
242
|
+
const node = state.panel.getNodeByValue(state.checkedValue);
|
|
243
|
+
if (node && (state.config.checkStrictly || node.isLeaf)) {
|
|
244
|
+
state.presentText = node.getText(props.showAllLevels, props.separator);
|
|
245
|
+
return;
|
|
246
|
+
}
|
|
245
247
|
}
|
|
248
|
+
state.inputValue = null;
|
|
249
|
+
state.presentText = null;
|
|
246
250
|
}
|
|
247
|
-
state.inputValue = null;
|
|
248
|
-
state.presentText = null;
|
|
249
251
|
};
|
|
250
252
|
const computePresentTags = ({ api, props, state }) => () => {
|
|
251
253
|
const checkedNodes = api.getCheckedNodes(state.leafOnly);
|
package/cascader-panel/vue.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import "../chunk-G2ADBYYC.js";
|
|
2
|
+
import { isBrowser } from "../common/browser";
|
|
2
3
|
const DEFAULT_DURATION = 200;
|
|
3
4
|
const INERTIA_TIME = 300;
|
|
4
5
|
const INERTIA_DISTANCE = 15;
|
|
@@ -23,6 +24,8 @@ const setRollerStyle = ({ state }) => (index) => {
|
|
|
23
24
|
return `transform: rotate3d(1, 0, 0, ${-state.rotation * index}deg) translate3d(0px, 0px, 104px)`;
|
|
24
25
|
};
|
|
25
26
|
const onTouchStart = ({ state, props, touch, vm }) => (event) => {
|
|
27
|
+
if (!isBrowser)
|
|
28
|
+
return;
|
|
26
29
|
touch.start(event);
|
|
27
30
|
if (state.moving) {
|
|
28
31
|
const dom = vm.$refs.roller;
|
package/chart-core/deps/utils.js
CHANGED
|
@@ -7,7 +7,7 @@ import { isObject, typeOf as getType, isNull } from "../../common/type";
|
|
|
7
7
|
import _debounce from "../../common/deps/debounce";
|
|
8
8
|
import _numerify from "./numerify";
|
|
9
9
|
import { escapeHtml } from "../../common/string";
|
|
10
|
-
import { xss } from "
|
|
10
|
+
import { xss } from "@opentiny/utils";
|
|
11
11
|
import { setObj, getObj, isEqual } from "../../common/object";
|
|
12
12
|
import { typeOf, isObject as isObject2 } from "../../common/type";
|
|
13
13
|
const debounce = (callback, delay) => _debounce(delay, false, callback);
|
package/chart-core/index.js
CHANGED
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
DEFAULT_CONFIG
|
|
13
13
|
} from "./deps/constants";
|
|
14
14
|
import { getType, debounce, isObject, cloneDeep, isEqual, htmlHandler, get } from "./deps/utils";
|
|
15
|
-
import { xss } from "
|
|
15
|
+
import { xss } from "@opentiny/utils";
|
|
16
16
|
import setAnimation from "./modules/animation";
|
|
17
17
|
import setExtend from "./modules/extend";
|
|
18
18
|
import setMark from "./modules/mark";
|
package/common/browser.js
CHANGED
|
@@ -23,6 +23,7 @@ const isEdge = (browser) => {
|
|
|
23
23
|
}
|
|
24
24
|
};
|
|
25
25
|
const isBrowser = typeof window !== "undefined" && typeof document !== "undefined" && window.document === document;
|
|
26
|
+
const globalEnvironment = isBrowser ? window : global;
|
|
26
27
|
var browser_default = (() => {
|
|
27
28
|
const browser = {
|
|
28
29
|
name: void 0,
|
|
@@ -75,5 +76,6 @@ var browser_default = (() => {
|
|
|
75
76
|
})();
|
|
76
77
|
export {
|
|
77
78
|
browser_default as default,
|
|
79
|
+
globalEnvironment,
|
|
78
80
|
isBrowser
|
|
79
81
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import "../../chunk-G2ADBYYC.js";
|
|
2
|
+
import { isBrowser } from "../browser";
|
|
2
3
|
let ws = null;
|
|
3
4
|
const url = "ws://localhost";
|
|
4
5
|
const ports = [27197, 27198, 27199];
|
|
@@ -268,7 +269,7 @@ out.addContactList = function(account, cb) {
|
|
|
268
269
|
cb
|
|
269
270
|
);
|
|
270
271
|
};
|
|
271
|
-
if (!window.WebSocket) {
|
|
272
|
+
if (!isBrowser || !window.WebSocket) {
|
|
272
273
|
const notFn = function() {
|
|
273
274
|
return void 0;
|
|
274
275
|
};
|
|
@@ -283,7 +284,7 @@ if (!window.WebSocket) {
|
|
|
283
284
|
}
|
|
284
285
|
let initialized = false;
|
|
285
286
|
function init() {
|
|
286
|
-
if (!initialized) {
|
|
287
|
+
if (!initialized && isBrowser) {
|
|
287
288
|
localStorage.setItem("eSpaceCtrl_initialized", 0);
|
|
288
289
|
out.init({ timeout: 3e3, pollingInterval: 1e3 });
|
|
289
290
|
out.ready(() => {
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import "../../../chunk-G2ADBYYC.js";
|
|
2
|
-
|
|
2
|
+
import { isBrowser } from "../../browser";
|
|
3
|
+
const RAF = function() {
|
|
4
|
+
if (isBrowser) {
|
|
5
|
+
return window.requestAnimationFrame.bind(window);
|
|
6
|
+
}
|
|
7
|
+
return function(callback) {
|
|
8
|
+
setTimeout(() => callback(Date.now()), 1e3 / 60);
|
|
9
|
+
};
|
|
10
|
+
}();
|
|
3
11
|
const scheduleFlush = (fastdom) => {
|
|
4
12
|
if (!fastdom.scheduled) {
|
|
5
13
|
fastdom.scheduled = true;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import "../../../chunk-G2ADBYYC.js";
|
|
2
2
|
import { on, off } from "../dom";
|
|
3
|
+
import { isBrowser } from "../../browser";
|
|
3
4
|
const fullscreenApi = [
|
|
4
5
|
"fullscreenElement",
|
|
5
6
|
"fullscreenEnabled",
|
|
@@ -36,6 +37,8 @@ const fullscreenApiMap = [fullscreenApi, fullscreenApiWebkit, fullscreenApiMoz,
|
|
|
36
37
|
const document = typeof window !== "undefined" && typeof window.document !== "undefined" ? window.document : {};
|
|
37
38
|
let fullscreenEvents = null;
|
|
38
39
|
const getFullScreenEvents = () => {
|
|
40
|
+
if (!isBrowser)
|
|
41
|
+
return;
|
|
39
42
|
for (let i = 0, len = fullscreenApiMap.length; i < len; i++) {
|
|
40
43
|
let eventName = fullscreenApiMap[i];
|
|
41
44
|
if (eventName && eventName[1] in document) {
|
|
@@ -60,12 +63,14 @@ const screenfull = {
|
|
|
60
63
|
resolve();
|
|
61
64
|
};
|
|
62
65
|
this.on("change", onFullscreenEntered);
|
|
63
|
-
element = element || document.documentElement;
|
|
64
|
-
if (element
|
|
65
|
-
const promiseReturn = element[fullscreenEvents
|
|
66
|
+
element = element || (isBrowser ? document.documentElement : null);
|
|
67
|
+
if (element && fullscreenEvents && element[fullscreenEvents.requestFullscreen]) {
|
|
68
|
+
const promiseReturn = element[fullscreenEvents.requestFullscreen](options);
|
|
66
69
|
if (promiseReturn instanceof Promise) {
|
|
67
70
|
promiseReturn.then(onFullscreenEntered).catch(reject);
|
|
68
71
|
}
|
|
72
|
+
} else {
|
|
73
|
+
reject(new Error("Fullscreen API not supported or element is null."));
|
|
69
74
|
}
|
|
70
75
|
});
|
|
71
76
|
},
|
|
@@ -80,11 +85,13 @@ const screenfull = {
|
|
|
80
85
|
resolve();
|
|
81
86
|
};
|
|
82
87
|
this.on("change", onFullscreenExit);
|
|
83
|
-
if (
|
|
84
|
-
const promiseReturn = document[fullscreenEvents
|
|
88
|
+
if (isBrowser && fullscreenEvents && document[fullscreenEvents.exitFullscreen]) {
|
|
89
|
+
const promiseReturn = document[fullscreenEvents.exitFullscreen]();
|
|
85
90
|
if (promiseReturn instanceof Promise) {
|
|
86
91
|
promiseReturn.then(onFullscreenExit).catch(reject);
|
|
87
92
|
}
|
|
93
|
+
} else {
|
|
94
|
+
reject(new Error("Fullscreen API not supported."));
|
|
88
95
|
}
|
|
89
96
|
});
|
|
90
97
|
},
|
|
@@ -99,37 +106,59 @@ const screenfull = {
|
|
|
99
106
|
},
|
|
100
107
|
on(event, callback) {
|
|
101
108
|
const eventName = eventNameMap[event];
|
|
102
|
-
if (eventName) {
|
|
109
|
+
if (eventName && isBrowser) {
|
|
103
110
|
on(document, eventName, callback);
|
|
104
111
|
}
|
|
105
112
|
},
|
|
106
113
|
off(event, callback) {
|
|
107
114
|
const eventName = eventNameMap[event];
|
|
108
|
-
if (eventName) {
|
|
115
|
+
if (eventName && isBrowser) {
|
|
109
116
|
off(document, eventName, callback);
|
|
110
117
|
}
|
|
111
118
|
},
|
|
112
|
-
raw: fullscreenEvents
|
|
119
|
+
raw: fullscreenEvents || {}
|
|
113
120
|
};
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
121
|
+
if (isBrowser) {
|
|
122
|
+
Object.defineProperties(screenfull, {
|
|
123
|
+
isFullscreen: {
|
|
124
|
+
get() {
|
|
125
|
+
return !!document[fullscreenEvents && fullscreenEvents.fullscreenElement];
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
element: {
|
|
129
|
+
enumerable: true,
|
|
130
|
+
get() {
|
|
131
|
+
return document[fullscreenEvents && fullscreenEvents.fullscreenElement];
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
isEnabled: {
|
|
135
|
+
enumerable: true,
|
|
136
|
+
get() {
|
|
137
|
+
return !!document[fullscreenEvents && fullscreenEvents.fullscreenEnabled];
|
|
138
|
+
}
|
|
124
139
|
}
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
140
|
+
});
|
|
141
|
+
} else {
|
|
142
|
+
Object.defineProperties(screenfull, {
|
|
143
|
+
isFullscreen: {
|
|
144
|
+
get() {
|
|
145
|
+
return false;
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
element: {
|
|
149
|
+
enumerable: true,
|
|
150
|
+
get() {
|
|
151
|
+
return null;
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
isEnabled: {
|
|
155
|
+
enumerable: true,
|
|
156
|
+
get() {
|
|
157
|
+
return false;
|
|
158
|
+
}
|
|
130
159
|
}
|
|
131
|
-
}
|
|
132
|
-
}
|
|
160
|
+
});
|
|
161
|
+
}
|
|
133
162
|
var screenfull_default = screenfull;
|
|
134
163
|
export {
|
|
135
164
|
screenfull_default as default
|
package/common/deps/popper.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
__spreadValues
|
|
3
3
|
} from "../../chunk-G2ADBYYC.js";
|
|
4
|
-
import { on, off, isDisplayNone
|
|
4
|
+
import { on, off, isDisplayNone } from "./dom";
|
|
5
5
|
import PopupManager from "./popup-manager";
|
|
6
6
|
import globalConfig from "../global";
|
|
7
7
|
import { typeOf } from "../type";
|
|
8
|
+
import { isBrowser } from "../browser";
|
|
8
9
|
const positions = ["left", "right", "top", "bottom"];
|
|
9
10
|
const modifiers = ["shift", "offset", "preventOverflow", "keepTogether", "arrow", "flip", "applyStyle"];
|
|
10
11
|
const DEFAULTS = {
|
|
@@ -186,16 +187,13 @@ const getOffsetRect = (el) => {
|
|
|
186
187
|
const stopFn = (ev) => {
|
|
187
188
|
ev.stopPropagation();
|
|
188
189
|
};
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
entry.target.popperVm.update();
|
|
195
|
-
}
|
|
196
|
-
});
|
|
190
|
+
const resizeOb = isBrowser && typeof ResizeObserver === "function" ? new ResizeObserver((entries) => {
|
|
191
|
+
entries.forEach((entry) => {
|
|
192
|
+
if (entry.target.popperVm && entry.contentRect.height > 50) {
|
|
193
|
+
entry.target.popperVm.update();
|
|
194
|
+
}
|
|
197
195
|
});
|
|
198
|
-
}
|
|
196
|
+
}) : null;
|
|
199
197
|
class Popper {
|
|
200
198
|
constructor(reference, popper, options) {
|
|
201
199
|
this.modifiers = {};
|
|
@@ -208,15 +206,17 @@ class Popper {
|
|
|
208
206
|
this._options.modifierFns = modifiers.map((modifier) => {
|
|
209
207
|
return this[modifier];
|
|
210
208
|
});
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
this._popper
|
|
216
|
-
|
|
209
|
+
if (isBrowser) {
|
|
210
|
+
this._popper.setAttribute("x-placement", this._options.placement);
|
|
211
|
+
this.state.position = this._getPopperPositionByRefernce(this._reference);
|
|
212
|
+
setStyle(this._popper, { position: this.state.position, top: 0 });
|
|
213
|
+
if (this._popper) {
|
|
214
|
+
this._popper.popperVm = this;
|
|
215
|
+
resizeOb && resizeOb.observe(this._popper);
|
|
216
|
+
}
|
|
217
|
+
this.update();
|
|
218
|
+
this._setupEventListeners();
|
|
217
219
|
}
|
|
218
|
-
this.update();
|
|
219
|
-
this._setupEventListeners();
|
|
220
220
|
}
|
|
221
221
|
destroy() {
|
|
222
222
|
this._popper.removeAttribute("x-placement");
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import "../../chunk-G2ADBYYC.js";
|
|
2
|
+
import { isBrowser } from "../browser";
|
|
2
3
|
let emulated = false;
|
|
3
4
|
let initiated = false;
|
|
4
5
|
let eventTarget = null;
|
|
5
6
|
let mouseTarget = null;
|
|
6
|
-
const matches = Element.prototype.matches;
|
|
7
|
+
const matches = isBrowser ? Element.prototype.matches : null;
|
|
7
8
|
const closest = (el, s) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
if (isBrowser) {
|
|
10
|
+
do {
|
|
11
|
+
if (matches.call(el, s))
|
|
12
|
+
return el;
|
|
13
|
+
el = el.parentElement || el.parentNode;
|
|
14
|
+
} while (el !== null && el.nodeType === 1);
|
|
15
|
+
}
|
|
13
16
|
return null;
|
|
14
17
|
};
|
|
15
18
|
class Touch {
|
|
@@ -86,10 +89,12 @@ const touchEmulator = () => {
|
|
|
86
89
|
window.addEventListener("mouseup", onMouse("touchend"), true);
|
|
87
90
|
};
|
|
88
91
|
const emulate = () => {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
emulated
|
|
92
|
-
|
|
92
|
+
if (isBrowser) {
|
|
93
|
+
const supportTouch = "ontouchstart" in window;
|
|
94
|
+
if (!emulated && !supportTouch) {
|
|
95
|
+
emulated = true;
|
|
96
|
+
touchEmulator();
|
|
97
|
+
}
|
|
93
98
|
}
|
|
94
99
|
};
|
|
95
100
|
var touch_emulator_default = emulate;
|
package/common/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../chunk-G2ADBYYC.js";
|
|
2
|
-
import { log as uLog, xss } from "
|
|
2
|
+
import { log as uLog, xss } from "@opentiny/utils";
|
|
3
3
|
const KEY_CODE = {
|
|
4
4
|
Backspace: 8,
|
|
5
5
|
Tab: 9,
|
|
@@ -237,7 +237,7 @@ const CASCADER = {
|
|
|
237
237
|
PropsHover: "hoverThreshold",
|
|
238
238
|
MenuConnector: "cascader-menu-"
|
|
239
239
|
};
|
|
240
|
-
const version = "3.
|
|
240
|
+
const version = "3.21.0";
|
|
241
241
|
const log = (data, type = "log") => {
|
|
242
242
|
uLog.logger[type](data);
|
|
243
243
|
};
|
package/common/runtime.js
CHANGED
package/common/string.js
CHANGED
|
@@ -2,6 +2,7 @@ import "../chunk-G2ADBYYC.js";
|
|
|
2
2
|
import { isPlainObject, isNumber, isNumeric, isNull } from "./type";
|
|
3
3
|
import { getObj, toJsonStr } from "./object";
|
|
4
4
|
import { toFixed, Decimal } from "./decimal";
|
|
5
|
+
import { globalEnvironment, isBrowser } from "./browser";
|
|
5
6
|
const formatTypes = {
|
|
6
7
|
text: "text",
|
|
7
8
|
url: "url",
|
|
@@ -117,7 +118,7 @@ const fillChar = (string, length, append, chr = "0") => {
|
|
|
117
118
|
};
|
|
118
119
|
const random = () => {
|
|
119
120
|
let MAX_UINT32_PLUS_ONE = 4294967296;
|
|
120
|
-
return
|
|
121
|
+
return globalEnvironment.crypto.getRandomValues(new globalEnvironment.Uint32Array(1))[0] / MAX_UINT32_PLUS_ONE;
|
|
121
122
|
};
|
|
122
123
|
const guid = (prefix = "", length = 8) => prefix + random().toString().substr(2, length);
|
|
123
124
|
const escapeHtml = (string, isReplaceSpace) => {
|
|
@@ -362,11 +363,13 @@ const formatFileSize = (size, baseUnit = "") => {
|
|
|
362
363
|
};
|
|
363
364
|
const isKorean = (text) => /([(\uAC00-\uD7AF)|(\u3130-\u318F)])+/gi.test(text);
|
|
364
365
|
const omitText = (text, font, w) => {
|
|
366
|
+
let t;
|
|
367
|
+
if (!isBrowser)
|
|
368
|
+
return { t: text, o: false };
|
|
365
369
|
const canvas = document.createElement("canvas");
|
|
366
370
|
const ctx = canvas.getContext("2d");
|
|
367
371
|
ctx.font = font;
|
|
368
372
|
let metric = ctx.measureText(text);
|
|
369
|
-
let t;
|
|
370
373
|
if (metric.width < w) {
|
|
371
374
|
return { t: text, o: false };
|
|
372
375
|
} else {
|
package/common/validate/util.js
CHANGED
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
__spreadValues
|
|
3
3
|
} from "../../chunk-G2ADBYYC.js";
|
|
4
4
|
import { hasOwn, isNull } from "../type";
|
|
5
|
-
import { log } from "
|
|
5
|
+
import { log } from "@opentiny/utils";
|
|
6
6
|
const formatRegExp = /%[sdj%]/g;
|
|
7
7
|
const warning = () => void 0;
|
|
8
8
|
function convertFieldsError(errors) {
|
package/dialog-box/index.js
CHANGED
|
@@ -33,6 +33,9 @@ const computedStyle = ({ props, state, designConfig }) => () => {
|
|
|
33
33
|
style = { left: "0px", top: "0px" };
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
|
+
if (props.customStyle) {
|
|
37
|
+
style = Object.assign(style, props.customStyle);
|
|
38
|
+
}
|
|
36
39
|
return style;
|
|
37
40
|
};
|
|
38
41
|
const watchVisible = ({
|
|
@@ -71,9 +74,9 @@ const watchVisible = ({
|
|
|
71
74
|
if (props.destroyOnClose) {
|
|
72
75
|
nextTick(() => state.key++);
|
|
73
76
|
}
|
|
74
|
-
if (props.rightSlide) {
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
+
if (props.rightSlide && state.current !== "default") {
|
|
78
|
+
const selector = `[data-tag=${constants.DIALOG_BOX_DATA_TAG}]`;
|
|
79
|
+
props.rightSlide && (el.querySelector(selector).style.left = "");
|
|
77
80
|
}
|
|
78
81
|
}
|
|
79
82
|
};
|
package/divider/index.js
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import "../chunk-G2ADBYYC.js";
|
|
2
|
+
const computedRootStyle = ({ state, props }) => () => {
|
|
3
|
+
return {
|
|
4
|
+
height: props.height || state.height,
|
|
5
|
+
margin: props.margin || state.margin,
|
|
6
|
+
fontSize: props.fontSize
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
const computedLineStyle = ({ props }) => () => {
|
|
10
|
+
const lineStyle = {
|
|
11
|
+
borderTopStyle: props.borderStyle
|
|
12
|
+
};
|
|
13
|
+
if (props.color) {
|
|
14
|
+
Object.assign(lineStyle, { borderTopColor: props.color });
|
|
15
|
+
}
|
|
16
|
+
return lineStyle;
|
|
17
|
+
};
|
|
18
|
+
const computedTextStyle = ({ props }) => () => {
|
|
19
|
+
const textStyle = {
|
|
20
|
+
left: "unset",
|
|
21
|
+
right: "unset"
|
|
22
|
+
};
|
|
23
|
+
const defaultOffset = "5%";
|
|
24
|
+
if (props.contentPosition === "left") {
|
|
25
|
+
textStyle.left = props.offset || defaultOffset;
|
|
26
|
+
} else if (props.contentPosition === "right") {
|
|
27
|
+
textStyle.right = props.offset || defaultOffset;
|
|
28
|
+
}
|
|
29
|
+
return textStyle;
|
|
30
|
+
};
|
|
31
|
+
const setDividerHeight = ({ state, props, vm, nextTick }) => () => {
|
|
32
|
+
const verticalHeight = "12px";
|
|
33
|
+
if (props.direction === "vertical") {
|
|
34
|
+
state.height = props.height || verticalHeight;
|
|
35
|
+
} else {
|
|
36
|
+
nextTick(() => {
|
|
37
|
+
const offsetHeight = vm.$refs.text && vm.$refs.text.offsetHeight;
|
|
38
|
+
state.height = props.height || offsetHeight ? offsetHeight + "px" : "auto";
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
export {
|
|
43
|
+
computedLineStyle,
|
|
44
|
+
computedRootStyle,
|
|
45
|
+
computedTextStyle,
|
|
46
|
+
setDividerHeight
|
|
47
|
+
};
|
package/divider/vue.js
CHANGED
|
@@ -1,7 +1,28 @@
|
|
|
1
1
|
import "../chunk-G2ADBYYC.js";
|
|
2
|
-
|
|
3
|
-
const
|
|
4
|
-
|
|
2
|
+
import { computedLineStyle, computedTextStyle, computedRootStyle, setDividerHeight } from "./index";
|
|
3
|
+
const api = ["state"];
|
|
4
|
+
const renderless = (props, { reactive, onMounted, computed }, { vm, nextTick }) => {
|
|
5
|
+
const defaultMargin = "16px 0";
|
|
6
|
+
const verticalMargin = "0 8px";
|
|
7
|
+
const api2 = {};
|
|
8
|
+
const state = reactive({
|
|
9
|
+
height: "auto",
|
|
10
|
+
margin: props.direction === "vertical" ? verticalMargin : defaultMargin,
|
|
11
|
+
lineStyle: computed(() => api2.computedLineStyle()),
|
|
12
|
+
textStyle: computed(() => api2.computedTextStyle()),
|
|
13
|
+
rootStyle: computed(() => api2.computedRootStyle())
|
|
14
|
+
});
|
|
15
|
+
Object.assign(api2, {
|
|
16
|
+
state,
|
|
17
|
+
computedLineStyle: computedLineStyle({ props }),
|
|
18
|
+
computedTextStyle: computedTextStyle({ props }),
|
|
19
|
+
computedRootStyle: computedRootStyle({ props, state }),
|
|
20
|
+
setDividerHeight: setDividerHeight({ props, state, vm, nextTick })
|
|
21
|
+
});
|
|
22
|
+
onMounted(() => {
|
|
23
|
+
api2.setDividerHeight();
|
|
24
|
+
});
|
|
25
|
+
return api2;
|
|
5
26
|
};
|
|
6
27
|
export {
|
|
7
28
|
api,
|
package/dropdown/index.js
CHANGED
|
@@ -124,9 +124,9 @@ const initEvent = ({ api, props, state, vm, mode }) => () => {
|
|
|
124
124
|
on(state.triggerElm, "keydown", api.handleTriggerKeyDown);
|
|
125
125
|
(_a = state.dropdownElm) == null ? void 0 : _a.addEventListener("keydown", api.handleItemKeyDown, true);
|
|
126
126
|
if (!props.splitButton || !props.singleButton) {
|
|
127
|
-
on(state.triggerElm, "focus",
|
|
128
|
-
on(state.triggerElm, "blur",
|
|
129
|
-
on(state.triggerElm, "click",
|
|
127
|
+
on(state.triggerElm, "focus", api.toggleFocusOnTrue);
|
|
128
|
+
on(state.triggerElm, "blur", api.toggleFocusOnFalse);
|
|
129
|
+
on(state.triggerElm, "click", api.toggleFocusOnFalse);
|
|
130
130
|
}
|
|
131
131
|
if (state.trigger === "hover") {
|
|
132
132
|
on(state.triggerElm, "mouseenter", api.show);
|
|
@@ -181,9 +181,9 @@ const mounted = ({ api, vm, state, broadcast }) => () => {
|
|
|
181
181
|
const beforeDistory = ({ vm, api, state }) => () => {
|
|
182
182
|
if (state.triggerElm) {
|
|
183
183
|
off(state.triggerElm, "keydown", api.handleTriggerKeyDown);
|
|
184
|
-
off(state.triggerElm, "focus",
|
|
185
|
-
off(state.triggerElm, "blur",
|
|
186
|
-
off(state.triggerElm, "click",
|
|
184
|
+
off(state.triggerElm, "focus", api.toggleFocusOnTrue);
|
|
185
|
+
off(state.triggerElm, "blur", api.toggleFocusOnFalse);
|
|
186
|
+
off(state.triggerElm, "click", api.toggleFocusOnFalse);
|
|
187
187
|
off(state.triggerElm, "mouseenter", api.show);
|
|
188
188
|
off(state.triggerElm, "mouseleave", api.hide);
|
|
189
189
|
off(state.triggerElm, "click", api.handleClick);
|
|
@@ -221,6 +221,7 @@ export {
|
|
|
221
221
|
removeTabindex,
|
|
222
222
|
resetTabindex,
|
|
223
223
|
show,
|
|
224
|
+
toggleFocus,
|
|
224
225
|
triggerElmFocus,
|
|
225
226
|
watchFocusing,
|
|
226
227
|
watchVisible
|
package/dropdown/vue.js
CHANGED
|
@@ -18,10 +18,11 @@ import {
|
|
|
18
18
|
initDomOperation,
|
|
19
19
|
mounted,
|
|
20
20
|
beforeDistory,
|
|
21
|
-
clickOutside
|
|
21
|
+
clickOutside,
|
|
22
|
+
toggleFocus
|
|
22
23
|
} from "./index";
|
|
23
24
|
const api = ["state", "handleMainButtonClick", "hide", "show", "initDomOperation", "handleClick", "clickOutside"];
|
|
24
|
-
const renderless = (props, { reactive, watch, provide, onMounted, computed }, { emit, parent, broadcast, vm, nextTick, mode, designConfig }) => {
|
|
25
|
+
const renderless = (props, { reactive, watch, provide, onMounted, computed, onBeforeUnmount }, { emit, parent, broadcast, vm, nextTick, mode, designConfig }) => {
|
|
25
26
|
const api2 = {};
|
|
26
27
|
const state = reactive({
|
|
27
28
|
visible: false,
|
|
@@ -60,11 +61,14 @@ const renderless = (props, { reactive, watch, provide, onMounted, computed }, {
|
|
|
60
61
|
triggerElmFocus: triggerElmFocus(state),
|
|
61
62
|
initDomOperation: initDomOperation({ api: api2, state, vm }),
|
|
62
63
|
beforeDistory: beforeDistory({ vm, api: api2, state }),
|
|
63
|
-
clickOutside: clickOutside({ props, api: api2 })
|
|
64
|
+
clickOutside: clickOutside({ props, api: api2 }),
|
|
65
|
+
toggleFocusOnTrue: toggleFocus({ state, value: true }),
|
|
66
|
+
toggleFocusOnFalse: toggleFocus({ state, value: false })
|
|
64
67
|
});
|
|
65
68
|
watch(() => state.visible, api2.watchVisible);
|
|
66
69
|
watch(() => state.focusing, api2.watchFocusing);
|
|
67
70
|
onMounted(api2.mounted);
|
|
71
|
+
onBeforeUnmount(api2.beforeDistory);
|
|
68
72
|
return api2;
|
|
69
73
|
};
|
|
70
74
|
export {
|