@opentiny/vue-renderless 3.8.0 → 3.8.2
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/button-group/vue.js +5 -4
- package/common/deps/vue-popper.js +3 -3
- package/common/index.js +1 -1
- package/common/runtime.js +1 -1
- package/dropdown/vue.js +3 -2
- package/dropdown-item/index.js +4 -0
- package/dropdown-item/vue.js +9 -6
- package/package.json +1 -1
- package/pager/vue.js +10 -0
- package/select/index.js +4 -0
- package/select/vue.js +25 -8
- package/tab-item/index.js +1 -1
- package/tab-item/vue.js +3 -2
- package/tooltip/vue.js +1 -1
package/button-group/vue.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../chunk-PKUHTIDK.js";
|
|
2
|
-
import { handleClick } from "./index";
|
|
2
|
+
import { handleClick, moreNodeClick } from "./index";
|
|
3
3
|
const api = ["state", "handleClick", "moreNodeClick"];
|
|
4
|
-
|
|
4
|
+
function renderless(props, { computed, reactive, watch, inject }, { emit, parent }) {
|
|
5
5
|
var _a, _b;
|
|
6
6
|
parent.tinyForm = parent.tinyForm || inject("form", null);
|
|
7
7
|
const state = reactive({
|
|
@@ -28,10 +28,11 @@ const renderless = (props, { computed, reactive, watch, inject }, { emit, parent
|
|
|
28
28
|
);
|
|
29
29
|
const api2 = {
|
|
30
30
|
state,
|
|
31
|
-
handleClick: handleClick({ emit, props, state })
|
|
31
|
+
handleClick: handleClick({ emit, props, state }),
|
|
32
|
+
moreNodeClick: moreNodeClick({ emit, props, state })
|
|
32
33
|
};
|
|
33
34
|
return api2;
|
|
34
|
-
}
|
|
35
|
+
}
|
|
35
36
|
export {
|
|
36
37
|
api,
|
|
37
38
|
renderless
|
|
@@ -24,11 +24,11 @@ const getReferMaxZIndex = (reference) => {
|
|
|
24
24
|
let getZIndex = (dom) => parseInt(window.getComputedStyle(dom).zIndex, 10) || 0;
|
|
25
25
|
let max = getZIndex(reference);
|
|
26
26
|
let z;
|
|
27
|
-
|
|
27
|
+
while (reference !== document.body && ((_a = reference == null ? void 0 : reference.parentNode) == null ? void 0 : _a.nodeType) !== 11 && reference.parentNode) {
|
|
28
28
|
reference = reference.parentNode;
|
|
29
29
|
z = getZIndex(reference);
|
|
30
|
-
max =
|
|
31
|
-
}
|
|
30
|
+
max = Math.max(z, max);
|
|
31
|
+
}
|
|
32
32
|
return `${max + 1}`;
|
|
33
33
|
};
|
|
34
34
|
const appendPopper = ({ options, props, state, parent }) => {
|
package/common/index.js
CHANGED
package/common/runtime.js
CHANGED
package/dropdown/vue.js
CHANGED
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
beforeDistory
|
|
21
21
|
} from "./index";
|
|
22
22
|
const api = ["state", "handleMainButtonClick", "hide", "show", "initDomOperation", "handleClick"];
|
|
23
|
-
const renderless = (props, { reactive, watch, provide, onMounted }, { emit, parent, broadcast, vm, nextTick }) => {
|
|
23
|
+
const renderless = (props, { reactive, watch, provide, onMounted }, { emit, parent, broadcast, vm, nextTick, designConfig }) => {
|
|
24
24
|
const api2 = {};
|
|
25
25
|
const state = reactive({
|
|
26
26
|
visible: false,
|
|
@@ -30,7 +30,8 @@ const renderless = (props, { reactive, watch, provide, onMounted }, { emit, pare
|
|
|
30
30
|
menuItemsArray: null,
|
|
31
31
|
triggerElm: null,
|
|
32
32
|
dropdownElm: null,
|
|
33
|
-
listId: `dropdown-menu-${guid()}
|
|
33
|
+
listId: `dropdown-menu-${guid()}`,
|
|
34
|
+
designConfig
|
|
34
35
|
});
|
|
35
36
|
provide("dropdown", vm);
|
|
36
37
|
Object.assign(api2, {
|
package/dropdown-item/index.js
CHANGED
|
@@ -95,6 +95,9 @@ const handleClick = ({ props, dispatch, vm, emit }) => (event) => {
|
|
|
95
95
|
emit("item-click", data);
|
|
96
96
|
dispatch("TinyDropdown", "menu-item-click", data);
|
|
97
97
|
};
|
|
98
|
+
const computedGetIcon = ({ constants, designConfig }) => (name = "leftWardArrow") => {
|
|
99
|
+
return (designConfig == null ? void 0 : designConfig.icons[name]) || (constants == null ? void 0 : constants.ICON_MAP[name]);
|
|
100
|
+
};
|
|
98
101
|
export {
|
|
99
102
|
bindScroll,
|
|
100
103
|
clickItem,
|
|
@@ -102,6 +105,7 @@ export {
|
|
|
102
105
|
clickWrapper,
|
|
103
106
|
close,
|
|
104
107
|
closed,
|
|
108
|
+
computedGetIcon,
|
|
105
109
|
confirm,
|
|
106
110
|
getItemStyle,
|
|
107
111
|
getOptionStyle,
|
package/dropdown-item/vue.js
CHANGED
|
@@ -16,7 +16,8 @@ import {
|
|
|
16
16
|
clickItem,
|
|
17
17
|
clickWrapper,
|
|
18
18
|
getItemStyle,
|
|
19
|
-
handleClick
|
|
19
|
+
handleClick,
|
|
20
|
+
computedGetIcon
|
|
20
21
|
} from "./index";
|
|
21
22
|
const api = [
|
|
22
23
|
"state",
|
|
@@ -51,11 +52,12 @@ const initState = ({ reactive, computed, api: api2, props, parent, dropdownMenu
|
|
|
51
52
|
closeOnClickOverlay: computed(() => parent.closeOnClickOverlay),
|
|
52
53
|
children: [],
|
|
53
54
|
textField: (dropdownMenu == null ? void 0 : dropdownMenu.textField) || props.textField,
|
|
54
|
-
popperClass: (dropdownMenu == null ? void 0 : dropdownMenu.popperClass) || ""
|
|
55
|
+
popperClass: (dropdownMenu == null ? void 0 : dropdownMenu.popperClass) || "",
|
|
56
|
+
getIcon: computed(() => api2.computedGetIcon())
|
|
55
57
|
});
|
|
56
58
|
return state;
|
|
57
59
|
};
|
|
58
|
-
const initApi = ({ api: api2, state, emit, props, parent, dispatch, vm }) => {
|
|
60
|
+
const initApi = ({ api: api2, state, emit, props, parent, dispatch, vm, constants, designConfig }) => {
|
|
59
61
|
Object.assign(api2, {
|
|
60
62
|
state,
|
|
61
63
|
open: open(emit),
|
|
@@ -74,10 +76,11 @@ const initApi = ({ api: api2, state, emit, props, parent, dispatch, vm }) => {
|
|
|
74
76
|
getItemStyle: getItemStyle({ parent, state }),
|
|
75
77
|
bindScroll: bindScroll({ api: api2, parent }),
|
|
76
78
|
confirm: confirm({ emit, props, state }),
|
|
77
|
-
handleClick: handleClick({ props, dispatch, vm, emit })
|
|
79
|
+
handleClick: handleClick({ props, dispatch, vm, emit }),
|
|
80
|
+
computedGetIcon: computedGetIcon({ constants, designConfig })
|
|
78
81
|
});
|
|
79
82
|
};
|
|
80
|
-
const renderless = (props, { computed, reactive, watch, inject }, { parent, emit, vm, dispatch, mode }) => {
|
|
83
|
+
const renderless = (props, { computed, reactive, watch, inject }, { parent, emit, vm, dispatch, mode, constants, designConfig }) => {
|
|
81
84
|
const api2 = {};
|
|
82
85
|
const dropdownMenu = inject("dropdownMenu", null);
|
|
83
86
|
if (mode === "mobile") {
|
|
@@ -85,7 +88,7 @@ const renderless = (props, { computed, reactive, watch, inject }, { parent, emit
|
|
|
85
88
|
}
|
|
86
89
|
parent = parent.$parent;
|
|
87
90
|
const state = initState({ reactive, computed, api: api2, props, parent, dropdownMenu });
|
|
88
|
-
initApi({ api: api2, state, emit, props, parent, dispatch, vm });
|
|
91
|
+
initApi({ api: api2, state, emit, props, parent, dispatch, vm, constants, designConfig });
|
|
89
92
|
watch(() => state.showPopup, api2.bindScroll);
|
|
90
93
|
return api2;
|
|
91
94
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opentiny/vue-renderless",
|
|
3
|
-
"version": "3.8.
|
|
3
|
+
"version": "3.8.2",
|
|
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
|
"homepage": "https://opentiny.design/tiny-vue",
|
|
6
6
|
"keywords": [
|
package/pager/vue.js
ADDED
package/select/index.js
CHANGED
|
@@ -1227,6 +1227,9 @@ const computeMultipleLimit = ({ props, state }) => () => {
|
|
|
1227
1227
|
const { optimizeOpts, optimizeStore } = state;
|
|
1228
1228
|
return optmzApis.natural(multiple && optimizeStore.flag ? multipleLimit || optimizeOpts.limit : multipleLimit);
|
|
1229
1229
|
};
|
|
1230
|
+
const computedGetIcon = ({ constants, designConfig }) => (name = "downWard") => {
|
|
1231
|
+
return (designConfig == null ? void 0 : designConfig.icons[name]) || (constants == null ? void 0 : constants.ICON_MAP[name]);
|
|
1232
|
+
};
|
|
1230
1233
|
export {
|
|
1231
1234
|
blur,
|
|
1232
1235
|
buildRadioConfig,
|
|
@@ -1236,6 +1239,7 @@ export {
|
|
|
1236
1239
|
computeCollapseTags,
|
|
1237
1240
|
computeMultipleLimit,
|
|
1238
1241
|
computeOptimizeOpts,
|
|
1242
|
+
computedGetIcon,
|
|
1239
1243
|
debouncRquest,
|
|
1240
1244
|
defaultOnQueryChange,
|
|
1241
1245
|
deletePrevTag,
|
package/select/vue.js
CHANGED
|
@@ -74,7 +74,8 @@ import {
|
|
|
74
74
|
getScrollListener,
|
|
75
75
|
computeCollapseTags,
|
|
76
76
|
computeMultipleLimit,
|
|
77
|
-
resetFilter
|
|
77
|
+
resetFilter,
|
|
78
|
+
computedGetIcon
|
|
78
79
|
} from "./index";
|
|
79
80
|
import { BROWSER_NAME } from "../common";
|
|
80
81
|
import browserInfo from "../common/browser";
|
|
@@ -215,11 +216,12 @@ const initState = ({ reactive, computed, props, api: api2, emitter, parent, cons
|
|
|
215
216
|
collapseTags: computed(() => api2.computeCollapseTags()),
|
|
216
217
|
multipleLimit: computed(() => api2.computeMultipleLimit()),
|
|
217
218
|
isSelectAll: computed(() => state.selectCls === "checked-sur"),
|
|
218
|
-
isHalfSelect: computed(() => state.selectCls === "halfselect")
|
|
219
|
+
isHalfSelect: computed(() => state.selectCls === "halfselect"),
|
|
220
|
+
getIcon: computed(() => api2.computedGetIcon())
|
|
219
221
|
}));
|
|
220
222
|
return state;
|
|
221
223
|
};
|
|
222
|
-
const addApi = ({ api: api2, props, state, refs, emit, constants, parent, nextTick, dispatch, vm }) => {
|
|
224
|
+
const addApi = ({ api: api2, props, state, refs, emit, constants, parent, nextTick, dispatch, vm, designConfig }) => {
|
|
223
225
|
Object.assign(api2, {
|
|
224
226
|
resetInputHeight: resetInputHeight({ api: api2, constants, nextTick, props, refs, state }),
|
|
225
227
|
calcOverFlow: calcOverFlow({ refs, props, state }),
|
|
@@ -256,10 +258,25 @@ const addApi = ({ api: api2, props, state, refs, emit, constants, parent, nextTi
|
|
|
256
258
|
mounted: mounted({ api: api2, parent, state, props, refs }),
|
|
257
259
|
unMount: unMount({ api: api2, parent, refs, state }),
|
|
258
260
|
watchOptimizeOpts: watchOptimizeOpts({ api: api2, props, refs, state }),
|
|
259
|
-
resetFilter: resetFilter({ state, api: api2 })
|
|
261
|
+
resetFilter: resetFilter({ state, api: api2 }),
|
|
262
|
+
computedGetIcon: computedGetIcon({ constants, designConfig })
|
|
260
263
|
});
|
|
261
264
|
};
|
|
262
|
-
const initApi = ({
|
|
265
|
+
const initApi = ({
|
|
266
|
+
api: api2,
|
|
267
|
+
props,
|
|
268
|
+
state,
|
|
269
|
+
refs,
|
|
270
|
+
emit,
|
|
271
|
+
maskState,
|
|
272
|
+
constants,
|
|
273
|
+
parent,
|
|
274
|
+
nextTick,
|
|
275
|
+
dispatch,
|
|
276
|
+
t,
|
|
277
|
+
vm,
|
|
278
|
+
designConfig
|
|
279
|
+
}) => {
|
|
263
280
|
Object.assign(api2, {
|
|
264
281
|
state,
|
|
265
282
|
maskState,
|
|
@@ -306,7 +323,7 @@ const initApi = ({ api: api2, props, state, refs, emit, maskState, constants, pa
|
|
|
306
323
|
computeCollapseTags: computeCollapseTags(props),
|
|
307
324
|
computeMultipleLimit: computeMultipleLimit({ props, state })
|
|
308
325
|
});
|
|
309
|
-
addApi({ api: api2, props, state, refs, emit, constants, parent, nextTick, dispatch, vm });
|
|
326
|
+
addApi({ api: api2, props, state, refs, emit, constants, parent, nextTick, dispatch, vm, designConfig });
|
|
310
327
|
};
|
|
311
328
|
const addWatch = ({ watch, props, api: api2, state }) => {
|
|
312
329
|
watch(() => [...state.options], api2.watchOptions);
|
|
@@ -354,13 +371,13 @@ const initWatch = ({ watch, props, api: api2, state, nextTick, refs }) => {
|
|
|
354
371
|
);
|
|
355
372
|
addWatch({ watch, props, api: api2, state });
|
|
356
373
|
};
|
|
357
|
-
const renderless = (props, { computed, onBeforeUnmount, onMounted, reactive, watch, provide }, { vm, refs, parent, emit, constants, nextTick, dispatch, t, emitter }) => {
|
|
374
|
+
const renderless = (props, { computed, onBeforeUnmount, onMounted, reactive, watch, provide }, { vm, refs, parent, emit, constants, nextTick, dispatch, t, emitter, designConfig }) => {
|
|
358
375
|
const api2 = {};
|
|
359
376
|
const state = initState({ reactive, computed, props, api: api2, emitter, parent, constants });
|
|
360
377
|
provide("selectEmitter", state.selectEmitter);
|
|
361
378
|
provide("selectVm", vm);
|
|
362
379
|
const maskState = reactive({ width: "", height: "", top: "" });
|
|
363
|
-
initApi({ api: api2, props, state, refs, emit, maskState, constants, parent, nextTick, dispatch, t, vm });
|
|
380
|
+
initApi({ api: api2, props, state, refs, emit, maskState, constants, parent, nextTick, dispatch, t, vm, designConfig });
|
|
364
381
|
initWatch({ watch, props, api: api2, state, nextTick, refs });
|
|
365
382
|
onMounted(api2.mounted);
|
|
366
383
|
onBeforeUnmount(api2.unMount);
|
package/tab-item/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../chunk-PKUHTIDK.js";
|
|
2
|
-
const computedIsClosable = ({
|
|
2
|
+
const computedIsClosable = ({ rootTabs, props }) => () => props.withClose || rootTabs.withClose;
|
|
3
3
|
const computedActive = ({ nextTick, props, state }) => () => {
|
|
4
4
|
const active = state.rootTabs.state.currentName === (props.name || state.index);
|
|
5
5
|
if (active) {
|
package/tab-item/vue.js
CHANGED
|
@@ -2,15 +2,16 @@ import "../chunk-PKUHTIDK.js";
|
|
|
2
2
|
import { computedIsClosable, computedActive, computedPaneName, watchTitle } from "./index";
|
|
3
3
|
const api = ["state"];
|
|
4
4
|
const renderless = (props, { computed, inject, reactive, watch }, { parent, nextTick }) => {
|
|
5
|
+
const rootTabs = inject("rootTabs");
|
|
5
6
|
const api2 = {
|
|
6
7
|
watchTitle: watchTitle(parent),
|
|
7
|
-
computedIsClosable: computedIsClosable({
|
|
8
|
+
computedIsClosable: computedIsClosable({ rootTabs, props })
|
|
8
9
|
};
|
|
9
10
|
const state = reactive({
|
|
10
11
|
index: null,
|
|
11
12
|
loaded: false,
|
|
12
13
|
animateShow: true,
|
|
13
|
-
rootTabs
|
|
14
|
+
rootTabs,
|
|
14
15
|
active: computed(() => api2.computedActive()),
|
|
15
16
|
paneName: computed(() => api2.computedPaneName()),
|
|
16
17
|
isClosable: computed(() => api2.computedIsClosable())
|
package/tooltip/vue.js
CHANGED
|
@@ -51,7 +51,7 @@ const initState = ({ reactive, showPopper, popperElm, referenceElm, props, markR
|
|
|
51
51
|
});
|
|
52
52
|
const renderless = (props, { watch, toRefs, reactive, onBeforeUnmount, onDeactivated, onMounted, onUnmounted, markRaw, inject }, { vm, emit, refs, slots, nextTick, parent }) => {
|
|
53
53
|
const api2 = {};
|
|
54
|
-
const popperParam = { emit, props, nextTick, toRefs, reactive, parent, refs };
|
|
54
|
+
const popperParam = { emit, props, nextTick, toRefs, reactive, parent: parent.$parent, refs };
|
|
55
55
|
const popperVmRef = {};
|
|
56
56
|
Object.assign(popperParam, { slots, onBeforeUnmount, onDeactivated, watch });
|
|
57
57
|
const { showPopper, updatePopper, popperElm, referenceElm, doDestroy } = userPopper(popperParam);
|