@opentiny/vue-renderless 3.18.6 → 3.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/action-menu/index.js +2 -2
- package/action-menu/vue.js +2 -2
- package/anchor/index.js +8 -6
- package/anchor/vue.js +1 -1
- package/badge/index.js +4 -3
- package/base-select/index.js +3 -3
- package/breadcrumb-item/vue.js +1 -1
- package/bulletin-board/index.js +1 -1
- package/button/index.js +1 -1
- package/button-group/index.js +6 -1
- package/carousel-item/index.js +1 -1
- package/cascader/vue.js +17 -4
- package/chart-core/deps/utils.js +1 -1
- package/checkbox/index.js +1 -1
- package/common/deps/dom.js +9 -1
- package/common/deps/useWindowSize.js +23 -0
- package/common/deps/vue-popper.js +1 -1
- package/common/index.js +2 -2
- package/common/prop-util.js +43 -0
- package/common/runtime.js +1 -1
- package/crop/index.js +14 -22
- package/crop/vue.js +33 -29
- package/date-panel/index.js +13 -2
- package/date-panel/vue.js +16 -10
- package/dialog-select/index.js +78 -0
- package/dialog-select/vue.js +28 -6
- package/drawer/index.js +14 -1
- package/drawer/vue.js +4 -3
- package/dropdown-item/index.js +2 -2
- package/dropdown-item/vue.js +9 -6
- package/espace/index.js +1 -1
- package/fall-menu/index.js +5 -1
- package/fall-menu/vue.js +15 -2
- package/filter-box/vue.js +5 -2
- package/floatbar/index.js +1 -1
- package/form/index.js +7 -4
- package/form/vue.js +1 -1
- package/grid/plugins/export.js +1 -1
- package/grid/utils/dom.js +3 -1
- package/guide/index.js +17 -2
- package/guide/vue.js +5 -3
- package/image-viewer/vue.js +1 -1
- package/input/index.js +6 -7
- package/input/vue.js +10 -11
- package/ip-address/index.js +0 -10
- package/ip-address/vue.js +2 -5
- package/load-list/index.js +43 -0
- package/load-list/vue.js +69 -0
- package/locales/index.js +1 -5
- package/logout/index.js +1 -1
- package/milestone/index.js +55 -8
- package/milestone/vue.js +16 -3
- package/modal/index.js +6 -6
- package/modal/vue.js +4 -3
- package/nav-menu/index.js +1 -1
- package/package.json +1 -1
- package/pager/index.js +25 -0
- package/pager/vue.js +18 -4
- package/picker/index.js +3 -3
- package/picker/vue.js +1 -1
- package/popeditor/index.js +12 -1
- package/popeditor/vue.js +9 -5
- package/rich-text/table-module.js +4 -3
- package/roles/index.js +1 -1
- package/select/index.js +6 -6
- package/select/vue.js +2 -1
- package/selected-box/vue.js +2 -1
- package/slider/index.js +2 -2
- package/slider-button-group/vue.js +3 -2
- package/split/vue.js +4 -2
- package/sticky/index.js +89 -0
- package/sticky/vue.js +74 -0
- package/tabbar-item/vue.js +1 -1
- package/tall-storage/index.js +1 -1
- package/time/vue.js +2 -1
- package/time-range/vue.js +4 -1
- package/time-spinner/index.js +4 -1
- package/toggle-menu/index.js +1 -1
- package/transfer-panel/vue.js +7 -6
- package/tree/index.js +17 -7
- package/tree/vue.js +10 -6
- package/tree-node/index.js +2 -2
- package/tree-node/vue.js +6 -2
- package/tree-select/index.js +7 -1
- package/tree-select/vue.js +3 -3
- package/types/action-menu.type.d.ts +1 -1
- package/types/alert.type.d.ts +2 -0
- package/types/anchor.type.d.ts +5 -1
- package/types/badge.type.d.ts +1 -1
- package/types/button-group.type.d.ts +3 -0
- package/types/button.type.d.ts +1 -1
- package/types/date-picker.type.d.ts +3 -0
- package/types/drawer.type.d.ts +5 -1
- package/types/{dropdown-item.type-16d59fd0.d.ts → dropdown-item.type-c9badbc1.d.ts} +2 -2
- package/types/dropdown-item.type.d.ts +1 -1
- package/types/dropdown-menu.type.d.ts +1 -1
- package/types/fall-menu.type.d.ts +1 -0
- package/types/file-upload.type.d.ts +1 -1
- package/types/image.type.d.ts +4 -0
- package/types/input.type.d.ts +7 -3
- package/types/load-list.type.d.ts +58 -0
- package/types/milestone.type.d.ts +27 -1
- package/types/modal.type.d.ts +3 -2
- package/types/pager.type.d.ts +5 -1
- package/types/picker.type.d.ts +3 -0
- package/types/search.type.d.ts +0 -3
- package/types/steps.type.d.ts +1 -0
- package/types/tag.type.d.ts +1 -0
- package/types/tooltip.type.d.ts +3 -0
- package/types/tree-menu.type.d.ts +8 -0
- package/types/upload-dragger.type.d.ts +1 -1
- package/types/{upload-list.type-4194f534.d.ts → upload-list.type-8d9e2600.d.ts} +8 -0
- package/types/upload-list.type.d.ts +1 -1
- package/types/upload.type.d.ts +1 -1
- package/types/user-contact.type.d.ts +127 -1
- package/types/user-head.type.d.ts +1 -4
- package/upload-list/vue.js +7 -7
- package/virtual-scroll-box/index.js +294 -0
- package/virtual-scroll-box/vue.js +43 -0
- package/virtual-tree/index.js +168 -0
- package/virtual-tree/vue.js +53 -0
|
@@ -18,8 +18,8 @@ function addMatcherTr({ _quill, oper }) {
|
|
|
18
18
|
return delta;
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
|
-
function
|
|
22
|
-
_quill.clipboard.addMatcher(
|
|
21
|
+
function addMatcherTdOrTh({ _quill, oper, Delta, tagName }) {
|
|
22
|
+
_quill.clipboard.addMatcher(tagName, function(node, delta) {
|
|
23
23
|
const tableId = oper.getTableId();
|
|
24
24
|
const rowId = oper.getRowId();
|
|
25
25
|
const cellId = cellName();
|
|
@@ -84,7 +84,8 @@ function addMatcher({ qil: _quill, Delta }) {
|
|
|
84
84
|
};
|
|
85
85
|
addMatcherTable({ _quill, oper });
|
|
86
86
|
addMatcherTr({ _quill, oper });
|
|
87
|
-
|
|
87
|
+
addMatcherTdOrTh({ _quill, oper, Delta, tagName: "TD" });
|
|
88
|
+
addMatcherTdOrTh({ _quill, oper, Delta, tagName: "TH" });
|
|
88
89
|
addMatcher3(_quill);
|
|
89
90
|
addMatcherFont(_quill);
|
|
90
91
|
}
|
package/roles/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../chunk-G2ADBYYC.js";
|
|
2
|
-
import { xss } from "../common";
|
|
2
|
+
import { xss } from "../common/xss";
|
|
3
3
|
const 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
|
@@ -495,7 +495,7 @@ const resetInputHeight = ({ constants, nextTick, props, vm, state, api, designCo
|
|
|
495
495
|
return;
|
|
496
496
|
}
|
|
497
497
|
nextTick(() => {
|
|
498
|
-
var _a;
|
|
498
|
+
var _a, _b;
|
|
499
499
|
if (!vm.$refs.reference) {
|
|
500
500
|
return;
|
|
501
501
|
}
|
|
@@ -508,9 +508,9 @@ const resetInputHeight = ({ constants, nextTick, props, vm, state, api, designCo
|
|
|
508
508
|
if (!state.isDisplayOnly && (props.hoverExpand || props.clickExpand) && !props.disabled) {
|
|
509
509
|
api.calcCollapseTags();
|
|
510
510
|
}
|
|
511
|
-
const sizeInMap = (designConfig == null ? void 0 : designConfig.state.initialInputHeight) || Math.round(state.initialInputHeight) ||
|
|
511
|
+
const sizeInMap = (designConfig == null ? void 0 : designConfig.state.initialInputHeight) || Math.round(state.initialInputHeight) || 32;
|
|
512
512
|
const noSelected = state.selected.length === 0;
|
|
513
|
-
const spacingHeight =
|
|
513
|
+
const spacingHeight = (_b = (_a = designConfig == null ? void 0 : designConfig.state) == null ? void 0 : _a.spacingHeight) != null ? _b : constants.SPACING_HEIGHT;
|
|
514
514
|
if (!state.isDisplayOnly) {
|
|
515
515
|
if (!noSelected && tags) {
|
|
516
516
|
fastdom.measure(() => {
|
|
@@ -1431,7 +1431,7 @@ const mounted = ({ api, parent, state, props, vm, designConfig }) => () => {
|
|
|
1431
1431
|
document.activeElement.blur();
|
|
1432
1432
|
}
|
|
1433
1433
|
state.completed = true;
|
|
1434
|
-
const defaultSizeMap = { default:
|
|
1434
|
+
const defaultSizeMap = { default: 32, mini: 24, small: 36, medium: 40 };
|
|
1435
1435
|
const sizeMap = ((_a = designConfig == null ? void 0 : designConfig.state) == null ? void 0 : _a.sizeMap) || defaultSizeMap;
|
|
1436
1436
|
if (props.multiple && Array.isArray(props.modelValue) && props.modelValue.length > 0) {
|
|
1437
1437
|
state.currentPlaceholder = "";
|
|
@@ -1487,7 +1487,7 @@ const optmzApis = {
|
|
|
1487
1487
|
vm.$refs.scrollbar.$el.querySelectorAll(
|
|
1488
1488
|
'.tiny-recycle-scroller__slot, .tiny-recycle-scroller__item-view:not([style*="transform: translateY(-9999px) translateX(0px)"])'
|
|
1489
1489
|
)
|
|
1490
|
-
).map((item) => item.querySelector(`[data-tag="tiny-
|
|
1490
|
+
).map((item) => item.querySelector(`[data-tag="tiny-option"]:not(${querySelectKey})`)).filter((v) => v);
|
|
1491
1491
|
},
|
|
1492
1492
|
setScrollTop: ({ refs, state }) => {
|
|
1493
1493
|
const { optimizeStore } = state;
|
|
@@ -1642,7 +1642,7 @@ const computedShowTagText = ({ state }) => () => state.isDisplayOnly;
|
|
|
1642
1642
|
const isTagClosable = () => (item) => !item.required;
|
|
1643
1643
|
const computedGetIcon = ({ designConfig, props }) => () => {
|
|
1644
1644
|
return props.dropdownIcon ? { icon: props.dropdownIcon } : {
|
|
1645
|
-
icon: (designConfig == null ? void 0 : designConfig.icons.dropdownIcon) || "icon-
|
|
1645
|
+
icon: (designConfig == null ? void 0 : designConfig.icons.dropdownIcon) || "icon-down-ward",
|
|
1646
1646
|
isDefault: true
|
|
1647
1647
|
};
|
|
1648
1648
|
};
|
package/select/vue.js
CHANGED
package/selected-box/vue.js
CHANGED
|
@@ -52,7 +52,8 @@ const renderless = (props, { reactive, computed, onBeforeMount, onMounted, onBef
|
|
|
52
52
|
popoverContent: "",
|
|
53
53
|
dragInstance: null,
|
|
54
54
|
slotParams: computed(() => ({ inverse: state.inverse, total: state.total, select: state.select })),
|
|
55
|
-
showClear: computed(() => api2.computedShowClear())
|
|
55
|
+
showClear: computed(() => api2.computedShowClear()),
|
|
56
|
+
theme: vm.theme
|
|
56
57
|
});
|
|
57
58
|
const api2 = {
|
|
58
59
|
state,
|
package/slider/index.js
CHANGED
|
@@ -478,9 +478,9 @@ const handleSlotInput = ({ state, api }) => (event, isLeftInput = true) => {
|
|
|
478
478
|
state.activeValue = Number(inputValue);
|
|
479
479
|
api.updateSlotValue();
|
|
480
480
|
};
|
|
481
|
-
const inputOnChange = ({ api, emit, props, state }) => (
|
|
481
|
+
const inputOnChange = ({ api, emit, props, state }) => (currentValue) => {
|
|
482
482
|
if (!props.changeCompat) {
|
|
483
|
-
if (!/^\d+$/.test(
|
|
483
|
+
if (!/^\d+$/.test(currentValue)) {
|
|
484
484
|
state.activeValue = state.leftBtnValue;
|
|
485
485
|
return;
|
|
486
486
|
}
|
|
@@ -53,8 +53,9 @@ const renderless = (props, { reactive, provide, onMounted, onBeforeUnmount, watc
|
|
|
53
53
|
api2.watchSliderButtonChange();
|
|
54
54
|
});
|
|
55
55
|
onBeforeUnmount(() => {
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
var _a, _b;
|
|
57
|
+
(_a = state.mutationObserver) == null ? void 0 : _a.disconnect();
|
|
58
|
+
(_b = state.intersectionObserver) == null ? void 0 : _b.disconnect();
|
|
58
59
|
});
|
|
59
60
|
watch(
|
|
60
61
|
() => props.modelValue,
|
package/split/vue.js
CHANGED
|
@@ -18,7 +18,8 @@ import {
|
|
|
18
18
|
} from "./index";
|
|
19
19
|
import { on, off } from "../common/deps/dom";
|
|
20
20
|
const api = ["state", "handleMousedown", "buttonMousedown", "buttonLeftTopClick", "buttonRightBottomClick"];
|
|
21
|
-
const renderless = (props, hooks, { vm, nextTick, emit, constants }) => {
|
|
21
|
+
const renderless = (props, hooks, { vm, nextTick, emit, constants, designConfig }) => {
|
|
22
|
+
var _a;
|
|
22
23
|
const api2 = {};
|
|
23
24
|
const { computed, reactive } = hooks;
|
|
24
25
|
const getUseOffset = useOffset({ nextTick, props, vm, constants, hooks });
|
|
@@ -39,7 +40,8 @@ const renderless = (props, hooks, { vm, nextTick, emit, constants }) => {
|
|
|
39
40
|
paneClasses: computed(() => [
|
|
40
41
|
`${state.prefix}-pane ${props.scrollable ? "tiny-split-scroll" : ""}`,
|
|
41
42
|
{ [`${state.prefix}-pane-moving`]: state.isMoving }
|
|
42
|
-
])
|
|
43
|
+
]),
|
|
44
|
+
triggerBarConWithLine: (_a = designConfig == null ? void 0 : designConfig.triggerBarConWithLine) != null ? _a : true
|
|
43
45
|
}, getUseOffset.state));
|
|
44
46
|
Object.assign(api2, __spreadProps(__spreadValues({
|
|
45
47
|
state,
|
package/sticky/index.js
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import "../chunk-G2ADBYYC.js";
|
|
2
|
+
const computedRootStyle = ({ props, state }) => () => {
|
|
3
|
+
return {
|
|
4
|
+
height: state.isFixed ? `${state.rootHeight}px` : "",
|
|
5
|
+
width: state.isFixed ? `${state.rootWidth}px` : ""
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
const computedStickyStyle = ({ props, state }) => () => {
|
|
9
|
+
if (!state.isFixed)
|
|
10
|
+
return {};
|
|
11
|
+
const offset = props.offset ? typeof props.offset === "number" ? props.offset + "px" : props.offset : 0;
|
|
12
|
+
return {
|
|
13
|
+
height: `${state.rootHeight}px`,
|
|
14
|
+
width: `${state.rootWidth}px`,
|
|
15
|
+
top: props.position === "top" ? offset : "",
|
|
16
|
+
bottom: props.position === "bottom" ? offset : "",
|
|
17
|
+
transform: state.transform ? `translateY(${state.transform}px)` : "",
|
|
18
|
+
zIndex: props.zIndex
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
const updateRoot = ({ props, state, emit, api }) => () => {
|
|
22
|
+
if (!state.scrollParent || !state.target)
|
|
23
|
+
return;
|
|
24
|
+
api.getRootRect();
|
|
25
|
+
state.scrollTop = state.scrollParent instanceof Window ? document.documentElement.scrollTop : state.scrollParent.scrollTop || 0;
|
|
26
|
+
if (props.target) {
|
|
27
|
+
state.targetRect = api.useRect(state.target);
|
|
28
|
+
}
|
|
29
|
+
if (props.position === "top") {
|
|
30
|
+
if (props.target) {
|
|
31
|
+
const difference = state.targetRect.bottom - state.offset - state.rootHeight;
|
|
32
|
+
state.isFixed = state.offset > state.rootTop && state.targetRect.bottom > 0;
|
|
33
|
+
state.transform = difference < 0 ? difference : 0;
|
|
34
|
+
} else {
|
|
35
|
+
state.isFixed = state.offset > state.rootTop;
|
|
36
|
+
}
|
|
37
|
+
} else if (props.target) {
|
|
38
|
+
const difference = state.windowHeight - state.targetRect.top - state.offset - state.rootHeight;
|
|
39
|
+
state.isFixed = state.windowHeight - state.offset < state.rootBottom && state.windowHeight > state.targetRect.top;
|
|
40
|
+
state.transform = difference < 0 ? -difference : 0;
|
|
41
|
+
} else {
|
|
42
|
+
state.isFixed = state.windowHeight - state.offset < state.rootBottom;
|
|
43
|
+
}
|
|
44
|
+
emit("scroll", { scrollTop: state.scrollTop, isFixed: state.isFixed });
|
|
45
|
+
};
|
|
46
|
+
const getRootRect = ({ state, vm, api }) => () => {
|
|
47
|
+
const rootRect = api.useRect(vm.$refs.root);
|
|
48
|
+
state.rootHeight = rootRect.height;
|
|
49
|
+
state.rootWidth = rootRect.width;
|
|
50
|
+
state.rootTop = rootRect.top;
|
|
51
|
+
state.rootBottom = rootRect.bottom;
|
|
52
|
+
};
|
|
53
|
+
const getTarget = ({ state, props, api }) => () => {
|
|
54
|
+
var _a;
|
|
55
|
+
if (props.target) {
|
|
56
|
+
state.target = (_a = document.querySelector(props.target)) != null ? _a : void 0;
|
|
57
|
+
if (state.target) {
|
|
58
|
+
state.targetRect = api.useRect(state.target);
|
|
59
|
+
} else {
|
|
60
|
+
throw new Error(`[AUI Error][aui-sticky] Target does not exist: ${props.target}`);
|
|
61
|
+
}
|
|
62
|
+
} else {
|
|
63
|
+
state.target = document.documentElement;
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
const unitToPx = () => (value) => {
|
|
67
|
+
if (typeof value === "number") {
|
|
68
|
+
return value;
|
|
69
|
+
}
|
|
70
|
+
if (value.endsWith("rem")) {
|
|
71
|
+
const rootFontSize = parseFloat(window.getComputedStyle(document.documentElement).fontSize);
|
|
72
|
+
return parseFloat(value) * rootFontSize;
|
|
73
|
+
}
|
|
74
|
+
if (value.endsWith("vh")) {
|
|
75
|
+
return parseFloat(value) / 100 * window.innerHeight;
|
|
76
|
+
}
|
|
77
|
+
if (value.endsWith("vw")) {
|
|
78
|
+
return parseFloat(value) / 100 * window.innerWidth;
|
|
79
|
+
}
|
|
80
|
+
return parseFloat(value);
|
|
81
|
+
};
|
|
82
|
+
export {
|
|
83
|
+
computedRootStyle,
|
|
84
|
+
computedStickyStyle,
|
|
85
|
+
getRootRect,
|
|
86
|
+
getTarget,
|
|
87
|
+
unitToPx,
|
|
88
|
+
updateRoot
|
|
89
|
+
};
|
package/sticky/vue.js
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import "../chunk-G2ADBYYC.js";
|
|
2
|
+
import { useRect } from "../common/deps/useRect";
|
|
3
|
+
import { useWindowSize } from "../common/deps/useWindowSize";
|
|
4
|
+
import { useEventListener } from "../common/deps/useEventListener";
|
|
5
|
+
import { useScrollParent } from "../common/deps/dom";
|
|
6
|
+
import { computedRootStyle, computedStickyStyle, updateRoot, unitToPx, getRootRect, getTarget } from "./index";
|
|
7
|
+
const api = ["state"];
|
|
8
|
+
const renderless = (props, hooks, { vm, emit }) => {
|
|
9
|
+
const { reactive, computed, unref, ref, toRef, onMounted, watch } = hooks;
|
|
10
|
+
const state = reactive({
|
|
11
|
+
root: null,
|
|
12
|
+
target: null,
|
|
13
|
+
windowHeight: 0,
|
|
14
|
+
windowWidth: 0,
|
|
15
|
+
rootHeight: 0,
|
|
16
|
+
rootWidth: 0,
|
|
17
|
+
rootTop: 0,
|
|
18
|
+
rootBottom: 0,
|
|
19
|
+
isFixed: false,
|
|
20
|
+
scrollTop: 0,
|
|
21
|
+
transform: 0,
|
|
22
|
+
scrollParent: null,
|
|
23
|
+
targetRect: null,
|
|
24
|
+
offset: 0,
|
|
25
|
+
rootStyle: computed(() => api2.computedRootStyle()),
|
|
26
|
+
stickyStyle: computed(() => api2.computedStickyStyle())
|
|
27
|
+
});
|
|
28
|
+
const api2 = {};
|
|
29
|
+
Object.assign(api2, {
|
|
30
|
+
state,
|
|
31
|
+
computedRootStyle: computedRootStyle({ props, state }),
|
|
32
|
+
computedStickyStyle: computedStickyStyle({ props, state }),
|
|
33
|
+
updateRoot: updateRoot({ props, state, emit, api: api2 }),
|
|
34
|
+
getRootRect: getRootRect({ vm, state, api: api2 }),
|
|
35
|
+
getTarget: getTarget({ props, state, api: api2 }),
|
|
36
|
+
useEventListener: useEventListener(hooks),
|
|
37
|
+
useScrollParent: useScrollParent(hooks),
|
|
38
|
+
useWindowSize: useWindowSize(ref),
|
|
39
|
+
useRect: useRect(unref),
|
|
40
|
+
unitToPx: unitToPx()
|
|
41
|
+
});
|
|
42
|
+
watch(
|
|
43
|
+
() => state.isFixed,
|
|
44
|
+
(value) => {
|
|
45
|
+
emit("change", value);
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
watch(
|
|
49
|
+
() => props.offset,
|
|
50
|
+
(value) => {
|
|
51
|
+
state.offset = api2.unitToPx(value);
|
|
52
|
+
api2.updateRoot();
|
|
53
|
+
},
|
|
54
|
+
{ immediate: true }
|
|
55
|
+
);
|
|
56
|
+
const { width, height } = api2.useWindowSize();
|
|
57
|
+
state.windowHeight = height;
|
|
58
|
+
state.windowWidth = width;
|
|
59
|
+
state.scrollParent = api2.useScrollParent(toRef(state, "root"));
|
|
60
|
+
api2.useEventListener("scroll", api2.updateRoot, { target: toRef(state, "scrollParent"), passive: true });
|
|
61
|
+
onMounted(() => {
|
|
62
|
+
state.root = vm.$refs.root;
|
|
63
|
+
setTimeout(() => {
|
|
64
|
+
api2.getTarget();
|
|
65
|
+
api2.getRootRect();
|
|
66
|
+
api2.updateRoot();
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
return api2;
|
|
70
|
+
};
|
|
71
|
+
export {
|
|
72
|
+
api,
|
|
73
|
+
renderless
|
|
74
|
+
};
|
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 "../common";
|
|
3
|
+
import { xss } from "../common/xss";
|
|
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/tall-storage/index.js
CHANGED
|
@@ -92,7 +92,7 @@ const setLocalStorageage = (name, value, memorySpace = 5) => {
|
|
|
92
92
|
}
|
|
93
93
|
};
|
|
94
94
|
const addMemory = (props) => (value) => {
|
|
95
|
-
if (props.name && value) {
|
|
95
|
+
if (props.name && (value == null ? void 0 : value.trim())) {
|
|
96
96
|
setLocalStorageage(props.name, value, props.memorySpace);
|
|
97
97
|
}
|
|
98
98
|
};
|
package/time/vue.js
CHANGED
|
@@ -38,10 +38,11 @@ const initState = ({ reactive, props, computed, api: api2 }) => {
|
|
|
38
38
|
return state;
|
|
39
39
|
};
|
|
40
40
|
const renderless = (props, { computed, onMounted, reactive, watch, nextTick }, { t, emit: $emit, vm, designConfig }) => {
|
|
41
|
+
var _a;
|
|
41
42
|
const api2 = {};
|
|
42
43
|
const emit = props.emitter ? props.emitter.emit : $emit;
|
|
43
44
|
const state = initState({ reactive, props, computed, api: api2 });
|
|
44
|
-
state.showTimePickerButton = designConfig == null ? void 0 : designConfig.showTimePickerButton;
|
|
45
|
+
state.showTimePickerButton = (_a = designConfig == null ? void 0 : designConfig.showTimePickerButton) != null ? _a : true;
|
|
45
46
|
Object.assign(api2, {
|
|
46
47
|
t,
|
|
47
48
|
state,
|
package/time-range/vue.js
CHANGED
|
@@ -41,6 +41,7 @@ const initState = ({ reactive, computed, vm, api: api2 }) => {
|
|
|
41
41
|
arrowControl: false,
|
|
42
42
|
maxDate: /* @__PURE__ */ new Date(),
|
|
43
43
|
minDate: /* @__PURE__ */ new Date(),
|
|
44
|
+
showTimePickerRangeButton: false,
|
|
44
45
|
showSeconds: computed(() => (state.format || "").includes("ss")),
|
|
45
46
|
offset: computed(() => state.showSeconds ? 11 : 8),
|
|
46
47
|
spinner: computed(() => state.selectionRange[0] < state.offset ? vm.$refs.minSpinner : vm.$refs.maxSpinner),
|
|
@@ -49,12 +50,14 @@ const initState = ({ reactive, computed, vm, api: api2 }) => {
|
|
|
49
50
|
});
|
|
50
51
|
return state;
|
|
51
52
|
};
|
|
52
|
-
const renderless = (props, { computed, reactive, watch, nextTick }, { t, vm, emit: $emit }) => {
|
|
53
|
+
const renderless = (props, { computed, reactive, watch, nextTick }, { t, vm, emit: $emit, designConfig }) => {
|
|
54
|
+
var _a;
|
|
53
55
|
const api2 = {};
|
|
54
56
|
const emit = props.emitter ? props.emitter.emit : $emit;
|
|
55
57
|
const MIN_TIME = parseDate("00:00:00", "HH:mm:ss", t);
|
|
56
58
|
const MAX_TIME = parseDate("23:59:59", "HH:mm:ss", t);
|
|
57
59
|
const state = initState({ reactive, computed, vm, api: api2 });
|
|
60
|
+
state.showTimePickerRangeButton = (_a = designConfig == null ? void 0 : designConfig.showTimePickerRangeButton) != null ? _a : true;
|
|
58
61
|
Object.assign(api2, {
|
|
59
62
|
t,
|
|
60
63
|
state,
|
package/time-spinner/index.js
CHANGED
|
@@ -193,7 +193,10 @@ const amPm = (props) => (hour) => {
|
|
|
193
193
|
}
|
|
194
194
|
return content;
|
|
195
195
|
};
|
|
196
|
-
const typeItemHeight = ({ vm, designConfig }) => (type) =>
|
|
196
|
+
const typeItemHeight = ({ vm, designConfig }) => (type) => {
|
|
197
|
+
var _a;
|
|
198
|
+
return vm.$refs[type].$el.querySelector(DATEPICKER.Qurtyli).offsetHeight + ((_a = designConfig == null ? void 0 : designConfig.itemMarginSpace) != null ? _a : 12);
|
|
199
|
+
};
|
|
197
200
|
const scrollBarHeight = (vm) => (type) => vm.$refs[type].$el.offsetHeight;
|
|
198
201
|
export {
|
|
199
202
|
adjustCurrentSpinner,
|
package/toggle-menu/index.js
CHANGED
package/transfer-panel/vue.js
CHANGED
|
@@ -36,12 +36,12 @@ const api = [
|
|
|
36
36
|
"selectChange",
|
|
37
37
|
"handlePageChange"
|
|
38
38
|
];
|
|
39
|
-
const initState = ({ reactive, props, parent, computed, api: api2, slots }) => {
|
|
39
|
+
const initState = ({ reactive, props, parent, computed, api: api2, slots, designConfig }) => {
|
|
40
|
+
var _a;
|
|
40
41
|
const state = reactive({
|
|
41
42
|
query: "",
|
|
42
43
|
checked: [],
|
|
43
44
|
allChecked: false,
|
|
44
|
-
inputHover: false,
|
|
45
45
|
internalPage: props.pagerOp.pageVO.currentPage || 1,
|
|
46
46
|
pagerTotal: 0,
|
|
47
47
|
pageChangeData: parent.state.isToLeft,
|
|
@@ -54,14 +54,15 @@ const initState = ({ reactive, props, parent, computed, api: api2, slots }) => {
|
|
|
54
54
|
checkedSummary: computed(() => api2.getCheckedSummary()),
|
|
55
55
|
isIndeterminate: computed(() => api2.getDeteminate()),
|
|
56
56
|
hasNoMatch: computed(() => state.query.length > 0 && state.filteredData.length === 0),
|
|
57
|
-
inputIcon: computed(() => state.query.length > 0 && state.inputHover ? "circle-close" : "search"),
|
|
58
57
|
labelProp: computed(() => props.props.label || "label"),
|
|
59
58
|
keyProp: computed(() => props.props.key || "key"),
|
|
60
59
|
disabledProp: computed(() => props.props.disabled || "disabled"),
|
|
61
60
|
childrenProp: computed(() => props.treeOp && props.treeOp.props && props.treeOp.props.childern || "children"),
|
|
62
61
|
hasFooter: computed(() => (!!parent.slots["left-footer"] || !!parent.slots["right-footer"]) && !!slots.default),
|
|
63
62
|
renderType: computed(() => props.render && props.render.plugin.name),
|
|
64
|
-
expanded: []
|
|
63
|
+
expanded: [],
|
|
64
|
+
inputBoxType: (designConfig == null ? void 0 : designConfig.inputBoxType) || "underline",
|
|
65
|
+
showInputSearch: (_a = designConfig == null ? void 0 : designConfig.showInputSearch) != null ? _a : true
|
|
65
66
|
});
|
|
66
67
|
return state;
|
|
67
68
|
};
|
|
@@ -113,11 +114,11 @@ const initWatcher = ({ watch, state, api: api2, props, Table }) => {
|
|
|
113
114
|
}
|
|
114
115
|
);
|
|
115
116
|
};
|
|
116
|
-
const renderless = (props, { computed, reactive, watch, toRaw }, { $prefix, emit, parent, vm, slots }) => {
|
|
117
|
+
const renderless = (props, { computed, reactive, watch, toRaw }, { $prefix, emit, parent, vm, slots, designConfig }) => {
|
|
117
118
|
const api2 = {};
|
|
118
119
|
const Table = $prefix + "Table";
|
|
119
120
|
const Tree = $prefix + "Tree";
|
|
120
|
-
const state = initState({ reactive, props, parent, computed, api: api2, slots });
|
|
121
|
+
const state = initState({ reactive, props, parent, computed, api: api2, slots, designConfig });
|
|
121
122
|
Object.assign(api2, {
|
|
122
123
|
state,
|
|
123
124
|
toRaw,
|
package/tree/index.js
CHANGED
|
@@ -86,7 +86,7 @@ const setDropIndicatorTop = (dropNode, parent, dropType) => {
|
|
|
86
86
|
}
|
|
87
87
|
dropType === "inner" ? addClass(dropNode.$el, "is-drop-inner") : removeClass(dropNode.$el, "is-drop-inner");
|
|
88
88
|
};
|
|
89
|
-
const getDragDir = ({ draggingNode, dropNode, allowDrop, emit, dragState }) => {
|
|
89
|
+
const getDragDir = ({ draggingNode, dropNode, allowDrop, emit, dragState, event: event2 }) => {
|
|
90
90
|
let dropPrev = true;
|
|
91
91
|
let dropInner = true;
|
|
92
92
|
let dropNext = true;
|
|
@@ -97,10 +97,10 @@ const getDragDir = ({ draggingNode, dropNode, allowDrop, emit, dragState }) => {
|
|
|
97
97
|
userAllowDropInner = dropInner = allowDrop(draggingNode.node, dropNode.node, "inner");
|
|
98
98
|
dropNext = allowDrop(draggingNode.node, dropNode.node, "next");
|
|
99
99
|
}
|
|
100
|
-
|
|
100
|
+
event2.dataTransfer.dropEffect = dropInner ? "copy" : "none";
|
|
101
101
|
if ((dropPrev || dropInner || dropNext) && oldDropNode !== dropNode) {
|
|
102
|
-
oldDropNode && emit("node-drag-leave", draggingNode.node, oldDropNode.node,
|
|
103
|
-
emit("node-drag-enter", draggingNode.node, dropNode.node,
|
|
102
|
+
oldDropNode && emit("node-drag-leave", draggingNode.node, oldDropNode.node, event2);
|
|
103
|
+
emit("node-drag-enter", draggingNode.node, dropNode.node, event2);
|
|
104
104
|
}
|
|
105
105
|
if (dropPrev || dropInner || dropNext) {
|
|
106
106
|
dragState.dropNode = dropNode;
|
|
@@ -136,7 +136,8 @@ const dragOver = ({ state, emit, props, vm }) => (event2, dropNode) => {
|
|
|
136
136
|
dropNode,
|
|
137
137
|
allowDrop: props.allowDrop,
|
|
138
138
|
emit,
|
|
139
|
-
dragState
|
|
139
|
+
dragState,
|
|
140
|
+
event: event2
|
|
140
141
|
});
|
|
141
142
|
const dropType = getDropType(dropPrev, dropInner, dropNext, dropNode);
|
|
142
143
|
setDropIndicatorTop(dropNode, vm, dropType);
|
|
@@ -397,7 +398,7 @@ const initTabIndex = ({ vm, state }) => () => {
|
|
|
397
398
|
}
|
|
398
399
|
state.treeItems[0] && state.treeItems[0].setAttribute("tabindex", 0);
|
|
399
400
|
};
|
|
400
|
-
const handleKeydown = ({ vm, state }) => (event2) => {
|
|
401
|
+
const handleKeydown = ({ vm, state, TreeAdapter }) => (event2) => {
|
|
401
402
|
const currentItem = event2.target;
|
|
402
403
|
if (!JSON.stringify(currentItem.className).includes("tiny-tree-node")) {
|
|
403
404
|
return;
|
|
@@ -413,7 +414,16 @@ const handleKeydown = ({ vm, state }) => (event2) => {
|
|
|
413
414
|
} else {
|
|
414
415
|
nextIndex = currentIndex < state.treeItemArray.length - 1 ? currentIndex + 1 : 0;
|
|
415
416
|
}
|
|
416
|
-
state.treeItemArray[nextIndex]
|
|
417
|
+
const treeNode = state.treeItemArray[nextIndex];
|
|
418
|
+
if (TreeAdapter) {
|
|
419
|
+
const nodeContent = treeNode.querySelector("div.tiny-tree-node__content");
|
|
420
|
+
treeNode.focus({ preventScroll: true });
|
|
421
|
+
if (nodeContent && nodeContent.scrollIntoView) {
|
|
422
|
+
nodeContent.scrollIntoView({ behavior: "instant", block: "nearest", inline: "nearest" });
|
|
423
|
+
}
|
|
424
|
+
} else {
|
|
425
|
+
treeNode.focus();
|
|
426
|
+
}
|
|
417
427
|
} else if ([KEY_CODE.ArrowLeft, KEY_CODE.ArrowRight].includes(keyCode)) {
|
|
418
428
|
event2.preventDefault();
|
|
419
429
|
currentItem.click();
|
package/tree/vue.js
CHANGED
|
@@ -118,7 +118,7 @@ const api = [
|
|
|
118
118
|
"handleClickPlainNode",
|
|
119
119
|
"setCheckedByNodeKey"
|
|
120
120
|
];
|
|
121
|
-
const initState = ({ reactive, emitter, props, computed, api: api2 }) => {
|
|
121
|
+
const initState = ({ reactive, emitter, props, computed, api: api2, TreeAdapter }) => {
|
|
122
122
|
const state = reactive({
|
|
123
123
|
loaded: !props.lazy,
|
|
124
124
|
checkEasily: false,
|
|
@@ -164,13 +164,16 @@ const initState = ({ reactive, emitter, props, computed, api: api2 }) => {
|
|
|
164
164
|
newNodeId: Math.floor(random() * 1e4),
|
|
165
165
|
plainNodeStore: {},
|
|
166
166
|
allNodeKeys: [],
|
|
167
|
+
renderedChildNodes: computed(() => {
|
|
168
|
+
return state.root.childNodes.filter((childNode) => TreeAdapter ? TreeAdapter.shouldRender(childNode) : true);
|
|
169
|
+
}),
|
|
167
170
|
// tiny 新增
|
|
168
171
|
filterText: ""
|
|
169
172
|
// 记录当前过滤的内容
|
|
170
173
|
});
|
|
171
174
|
return state;
|
|
172
175
|
};
|
|
173
|
-
const initApi = ({ state, dispatch, broadcast, props, vm, constants, t, emit, api: api2 }) => ({
|
|
176
|
+
const initApi = ({ state, dispatch, broadcast, props, vm, constants, t, emit, api: api2, TreeAdapter }) => ({
|
|
174
177
|
state,
|
|
175
178
|
dispatch,
|
|
176
179
|
broadcast,
|
|
@@ -203,7 +206,7 @@ const initApi = ({ state, dispatch, broadcast, props, vm, constants, t, emit, ap
|
|
|
203
206
|
insertAfter: insertAfter(state),
|
|
204
207
|
updateKeyChildren: updateKeyChildren({ props, state }),
|
|
205
208
|
initTabIndex: initTabIndex({ vm, state }),
|
|
206
|
-
handleKeydown: handleKeydown({ vm, state }),
|
|
209
|
+
handleKeydown: handleKeydown({ vm, state, TreeAdapter }),
|
|
207
210
|
computedShowEmptyText: computedShowEmptyText({ constants, t }),
|
|
208
211
|
setCurrentRadio: setCurrentRadio({ props, state }),
|
|
209
212
|
expandAllNodes: expandAllNodes({ state }),
|
|
@@ -238,11 +241,12 @@ const initWatcher = ({ watch, props, api: api2, state, isVue2 }) => {
|
|
|
238
241
|
{ immediate: true }
|
|
239
242
|
);
|
|
240
243
|
};
|
|
241
|
-
const renderless = (props, { computed, onMounted, onUpdated, reactive, watch, provide, onBeforeUnmount }, { vm, t, emit, constants, broadcast, dispatch, service, emitter, nextTick }, { isVue2 }) => {
|
|
244
|
+
const renderless = (props, { computed, onMounted, onUpdated, reactive, watch, provide, onBeforeUnmount, inject }, { vm, t, emit, constants, broadcast, dispatch, service, emitter, nextTick }, { isVue2 }) => {
|
|
242
245
|
const api2 = {};
|
|
243
|
-
const
|
|
246
|
+
const TreeAdapter = inject("TreeAdapter", null);
|
|
247
|
+
const state = initState({ reactive, emitter, props, computed, api: api2, TreeAdapter });
|
|
244
248
|
provide("parentEmitter", state.emitter);
|
|
245
|
-
Object.assign(api2, initApi({ state, dispatch, broadcast, props, vm, constants, t, emit, api: api2 }), {
|
|
249
|
+
Object.assign(api2, initApi({ state, dispatch, broadcast, props, vm, constants, t, emit, api: api2, TreeAdapter }), {
|
|
246
250
|
closeMenu: closeMenu(state),
|
|
247
251
|
mounted: mounted({ api: api2, vm }),
|
|
248
252
|
created: created({ api: api2, props, state }),
|
package/tree-node/index.js
CHANGED
|
@@ -234,8 +234,8 @@ const computedExpandIcon = ({ designConfig }) => (treeRoot, state) => {
|
|
|
234
234
|
return state.tree.icon;
|
|
235
235
|
}
|
|
236
236
|
if (treeRoot.showLine) {
|
|
237
|
-
const expandIcon = ((_a = designConfig == null ? void 0 : designConfig.icons) == null ? void 0 : _a.expanded) || "icon-
|
|
238
|
-
const collapseIcon = ((_b = designConfig == null ? void 0 : designConfig.icons) == null ? void 0 : _b.collapse) || "icon-
|
|
237
|
+
const expandIcon = ((_a = designConfig == null ? void 0 : designConfig.icons) == null ? void 0 : _a.expanded) || "icon-expand";
|
|
238
|
+
const collapseIcon = ((_b = designConfig == null ? void 0 : designConfig.icons) == null ? void 0 : _b.collapse) || "icon-put-away";
|
|
239
239
|
return state.expanded ? expandIcon : collapseIcon;
|
|
240
240
|
}
|
|
241
241
|
return "icon-chevron-right";
|
package/tree-node/vue.js
CHANGED
|
@@ -48,7 +48,7 @@ const api = [
|
|
|
48
48
|
"deleteNode",
|
|
49
49
|
"handleCheckChange"
|
|
50
50
|
];
|
|
51
|
-
const initState = ({ reactive, treeRoot, props, emitter, $parentEmitter, vm, api: api2, computed }) => {
|
|
51
|
+
const initState = ({ reactive, treeRoot, props, emitter, $parentEmitter, vm, api: api2, TreeAdapter, computed }) => {
|
|
52
52
|
const state = reactive({
|
|
53
53
|
tree: treeRoot,
|
|
54
54
|
expanded: false,
|
|
@@ -66,6 +66,9 @@ const initState = ({ reactive, treeRoot, props, emitter, $parentEmitter, vm, api
|
|
|
66
66
|
parentEmitter: $parentEmitter,
|
|
67
67
|
isSaaSTheme: (props.theme || vm.theme) === "saas",
|
|
68
68
|
props: treeRoot.props,
|
|
69
|
+
renderedChildNodes: computed(() => {
|
|
70
|
+
return props.node.childNodes.filter((childNode) => TreeAdapter ? TreeAdapter.shouldRender(childNode) : true);
|
|
71
|
+
}),
|
|
69
72
|
computedExpandIcon: computed(() => api2.computedExpandIcon(treeRoot, state)),
|
|
70
73
|
computedIndent: computed(() => api2.computedIndent(props, state))
|
|
71
74
|
});
|
|
@@ -114,7 +117,8 @@ const renderless = (props, { reactive, watch, inject, provide, computed }, { vm,
|
|
|
114
117
|
const api2 = {};
|
|
115
118
|
const treeRoot = inject("TreeRoot");
|
|
116
119
|
const $parentEmitter = inject("parentEmitter");
|
|
117
|
-
const
|
|
120
|
+
const TreeAdapter = inject("TreeAdapter", null);
|
|
121
|
+
const state = initState({ reactive, treeRoot, props, emitter, $parentEmitter, vm, api: api2, TreeAdapter, computed });
|
|
118
122
|
if (state.tree.accordion) {
|
|
119
123
|
state.parentEmitter.on("sibling-node-toggle-expand", (event) => api2.onSiblingToggleExpand(event));
|
|
120
124
|
}
|
package/tree-select/index.js
CHANGED
|
@@ -14,19 +14,25 @@ const nodeClick = ({ props, vm }) => (data) => {
|
|
|
14
14
|
currentLabel: data[props.textField]
|
|
15
15
|
}
|
|
16
16
|
}));
|
|
17
|
+
emit("change", data[props.valueField]);
|
|
18
|
+
emit("update:modelValue", data[props.valueField]);
|
|
17
19
|
vm.$refs.baseSelectRef.hidePanel();
|
|
18
20
|
}
|
|
19
21
|
};
|
|
20
|
-
const check = ({ props, vm }) => (data, { checkedNodes }) => {
|
|
22
|
+
const check = ({ props, vm, emit: emit2 }) => (data, { checkedNodes }) => {
|
|
21
23
|
if (props.multiple) {
|
|
24
|
+
const currentValue = [];
|
|
22
25
|
vm.$refs.baseSelectRef.updateSelectedData(
|
|
23
26
|
checkedNodes.map((node) => {
|
|
27
|
+
currentValue.push(node[props.valueField]);
|
|
24
28
|
return __spreadProps(__spreadValues({}, node), {
|
|
25
29
|
currentLabel: node[props.textField],
|
|
26
30
|
value: node[props.valueField]
|
|
27
31
|
});
|
|
28
32
|
})
|
|
29
33
|
);
|
|
34
|
+
emit2("change", currentValue);
|
|
35
|
+
emit2("update:modelValue", currentValue);
|
|
30
36
|
}
|
|
31
37
|
};
|
|
32
38
|
export {
|
package/tree-select/vue.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import "../chunk-G2ADBYYC.js";
|
|
2
2
|
import { filter, nodeClick, check } from "./index";
|
|
3
3
|
const api = ["state", "filter", "nodeClick", "check"];
|
|
4
|
-
const renderless = (props, { reactive }, { vm }) => {
|
|
4
|
+
const renderless = (props, { reactive, computed }, { vm, emit }) => {
|
|
5
5
|
const api2 = {};
|
|
6
6
|
const state = reactive({
|
|
7
|
-
value: props.modelValue,
|
|
7
|
+
value: computed(() => props.modelValue),
|
|
8
8
|
treeData: props.treeOp.data
|
|
9
9
|
});
|
|
10
10
|
Object.assign(api2, {
|
|
11
11
|
state,
|
|
12
12
|
filter: filter({ vm }),
|
|
13
13
|
nodeClick: nodeClick({ props, vm }),
|
|
14
|
-
check: check({ props, vm })
|
|
14
|
+
check: check({ props, vm, emit })
|
|
15
15
|
});
|
|
16
16
|
return api2;
|
|
17
17
|
};
|
|
@@ -68,7 +68,7 @@ declare const actionMenuProps: {
|
|
|
68
68
|
*/
|
|
69
69
|
|
|
70
70
|
declare const computedMaxShowNum: ({ props, state }: Pick<IActionMenuRenderlessParams, 'props' | 'state'>) => () => number;
|
|
71
|
-
declare const computedSpacing: ({ props, state }:
|
|
71
|
+
declare const computedSpacing: ({ props, state, designConfig }: any) => () => string;
|
|
72
72
|
declare const computedMoreText: ({ props, state, t }: any) => () => string;
|
|
73
73
|
declare const computedSuffixIcon: ({ props, state }: Pick<IActionMenuRenderlessParams, 'props' | 'state'>) => () => string | Object;
|
|
74
74
|
declare const handleMoreClick: (emit: IActionMenuRenderlessParams['emit']) => () => void;
|