@opentiny/vue-renderless 3.24.0 → 3.26.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/anchor/index.js +1 -1
- package/cascader-node/vue.js +1 -0
- package/color-select-panel/hue-select/index.js +10 -10
- package/color-select-panel/index.js +44 -0
- package/color-select-panel/vue.js +6 -1
- package/date-range/index.js +1 -1
- package/dropdown/vue.js +3 -1
- package/file-upload/index.js +2 -0
- package/file-upload/vue.js +1 -1
- package/fluent-editor/index.js +1 -1
- package/grid/plugins/exportExcel.js +1 -2
- package/grid/utils/column.js +96 -64
- package/grid/utils/common.js +79 -20
- package/grid/utils/dom.js +70 -97
- package/grid-select/index.js +2 -2
- package/input/index.js +4 -3
- package/input/vue.js +1 -2
- package/package.json +3 -3
- package/pager/vue.js +2 -1
- package/popeditor/index.js +3 -3
- package/search/index.js +8 -3
- package/search/vue.js +1 -1
- package/select/index.js +2 -2
- package/select/vue.js +5 -1
- package/slider-button/vue.js +1 -0
- package/slider-button-group/vue.js +1 -0
- package/tabs/vue.js +2 -1
- package/tabs-mf/index.js +4 -1
- package/types/button-group.type.d.ts +2 -1
- package/types/button.type.d.ts +7 -1
- package/types/dialog-box.type.d.ts +4 -11
- package/types/pager.type.d.ts +2 -2
- package/types/radio-button.type.d.ts +1 -0
- package/types/radio-group.type.d.ts +2 -1
- package/types/radio.type.d.ts +2 -1
- package/types/slider.type.d.ts +2 -1
- package/types/tabs.type.d.ts +2 -0
- package/types/user-contact.type.d.ts +1 -11
- package/user/index.js +6 -5
- package/user/vue.js +1 -1
package/anchor/index.js
CHANGED
package/cascader-node/vue.js
CHANGED
|
@@ -20,6 +20,7 @@ const renderless = (props, { computed, reactive, inject, watch }, { dispatch })
|
|
|
20
20
|
inActivePath: computed(() => api2.isInPath(parent.state.activePath)),
|
|
21
21
|
inCheckedPath: computed(() => api2.comptCheckPath()),
|
|
22
22
|
value: computed(() => props.node.getValueByOption()),
|
|
23
|
+
// 仅 mf 用到nodeLabel
|
|
23
24
|
nodeLabel: computed(() => {
|
|
24
25
|
return parent.state.renderLabelFn ? parent.state.renderLabelFn({ node: props.node, data: props.node.data }) : props.node.label;
|
|
25
26
|
})
|
|
@@ -2,8 +2,8 @@ import "../../chunk-G2ADBYYC.js";
|
|
|
2
2
|
import { getClientXY } from "../utils/getClientXY";
|
|
3
3
|
const initState = (props, { reactive, ref, computed }) => {
|
|
4
4
|
const hueValue = computed(() => props.color.get("hue"));
|
|
5
|
-
const
|
|
6
|
-
const state = reactive({ hueValue,
|
|
5
|
+
const thumbLeft = ref(0);
|
|
6
|
+
const state = reactive({ hueValue, thumbLeft });
|
|
7
7
|
return state;
|
|
8
8
|
};
|
|
9
9
|
const initDom = ({ ref }) => {
|
|
@@ -25,10 +25,10 @@ const useEvent = ({ thumb, bar }, state, props, { emit }) => {
|
|
|
25
25
|
if (!bar.value) {
|
|
26
26
|
return 0;
|
|
27
27
|
}
|
|
28
|
-
return hue * (bar.value.
|
|
28
|
+
return hue * (bar.value.offsetWidth - thumb.value.offsetWidth / 2) / 360;
|
|
29
29
|
};
|
|
30
30
|
const update = () => {
|
|
31
|
-
state.
|
|
31
|
+
state.thumbLeft = getThumbTop();
|
|
32
32
|
};
|
|
33
33
|
const onDrag = (event) => {
|
|
34
34
|
if (!bar.value || !thumb.value) {
|
|
@@ -39,12 +39,12 @@ const useEvent = ({ thumb, bar }, state, props, { emit }) => {
|
|
|
39
39
|
return;
|
|
40
40
|
}
|
|
41
41
|
const rect = el == null ? void 0 : el.getBoundingClientRect();
|
|
42
|
-
const {
|
|
43
|
-
let
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
const hue = Math.round((
|
|
47
|
-
state.
|
|
42
|
+
const { clientX } = getClientXY(event);
|
|
43
|
+
let left = clientX - rect.left;
|
|
44
|
+
left = Math.min(left, rect.width - thumb.value.offsetWidth / 2);
|
|
45
|
+
left = Math.max(thumb.value.offsetWidth / 2, left);
|
|
46
|
+
const hue = Math.round((left - thumb.value.offsetWidth / 2) / (rect.width - thumb.value.offsetWidth) * 360);
|
|
47
|
+
state.thumbLeft = left;
|
|
48
48
|
emit("hueUpdate", hue);
|
|
49
49
|
props.color.set("hue", hue);
|
|
50
50
|
};
|
|
@@ -114,6 +114,32 @@ const initApi = (props, state, { emit, nextTick }) => {
|
|
|
114
114
|
onClickOutside
|
|
115
115
|
};
|
|
116
116
|
};
|
|
117
|
+
const parseCustomRGBA = (str, type) => {
|
|
118
|
+
if (!str || typeof str !== "string") {
|
|
119
|
+
return [0, 0, 0, 0];
|
|
120
|
+
}
|
|
121
|
+
let content = "";
|
|
122
|
+
let match = null;
|
|
123
|
+
if (type === "hsl") {
|
|
124
|
+
match = str.match(/hsla?\(([^)]+)\)/);
|
|
125
|
+
} else if (type === "rgb") {
|
|
126
|
+
match = str.match(/rgba?\(([^)]+)\)/);
|
|
127
|
+
} else if (type === "hsv") {
|
|
128
|
+
match = str.match(/hsva?\(([^)]+)\)/);
|
|
129
|
+
}
|
|
130
|
+
if (!match || !match[1]) {
|
|
131
|
+
return [0, 0, 0, 0];
|
|
132
|
+
}
|
|
133
|
+
content = match[1];
|
|
134
|
+
const parts = content.split(",").map((item) => item.trim());
|
|
135
|
+
const result = parts.map((item, index) => {
|
|
136
|
+
if (index === 0 || index === parts.length - 1 && parts.length === 4) {
|
|
137
|
+
return parseFloat(item);
|
|
138
|
+
}
|
|
139
|
+
return item;
|
|
140
|
+
});
|
|
141
|
+
return result;
|
|
142
|
+
};
|
|
117
143
|
const initState = (props, { reactive, ref, computed }) => {
|
|
118
144
|
var _a, _b;
|
|
119
145
|
const stack = ref([...(_a = props.history) != null ? _a : []]);
|
|
@@ -130,6 +156,12 @@ const initState = (props, { reactive, ref, computed }) => {
|
|
|
130
156
|
})
|
|
131
157
|
);
|
|
132
158
|
const input = ref("");
|
|
159
|
+
const hexInput1 = ref();
|
|
160
|
+
const hexInput2 = ref();
|
|
161
|
+
const hexInput4 = ref();
|
|
162
|
+
const hexInput5 = ref();
|
|
163
|
+
const hexInput6 = ref();
|
|
164
|
+
const hexInput7 = ref();
|
|
133
165
|
const showPicker = ref(props.visible);
|
|
134
166
|
const showPanel = ref(false);
|
|
135
167
|
const panelColor = computed(() => {
|
|
@@ -142,6 +174,12 @@ const initState = (props, { reactive, ref, computed }) => {
|
|
|
142
174
|
const state = reactive({
|
|
143
175
|
color,
|
|
144
176
|
input,
|
|
177
|
+
hexInput1,
|
|
178
|
+
hexInput2,
|
|
179
|
+
hexInput4,
|
|
180
|
+
hexInput5,
|
|
181
|
+
hexInput6,
|
|
182
|
+
hexInput7,
|
|
145
183
|
showPicker,
|
|
146
184
|
showPanel,
|
|
147
185
|
panelColor,
|
|
@@ -195,6 +233,11 @@ const initWatch = (state, props, { nextTick, watch }, { emit }) => {
|
|
|
195
233
|
() => state.currentColor,
|
|
196
234
|
() => {
|
|
197
235
|
state.input = state.currentColor;
|
|
236
|
+
const result = parseCustomRGBA(state.currentColor, state.currentFormat);
|
|
237
|
+
state.hexInput4 = Math.ceil(Number(result[0]));
|
|
238
|
+
state.hexInput5 = result[1];
|
|
239
|
+
state.hexInput6 = result[2];
|
|
240
|
+
state.hexInput7 = `${(Number(result[3]) || 1) * 100}%`;
|
|
198
241
|
triggerColorUpdate(state.input, emit);
|
|
199
242
|
},
|
|
200
243
|
{ flush: "sync" }
|
|
@@ -236,6 +279,7 @@ export {
|
|
|
236
279
|
initState,
|
|
237
280
|
initWatch,
|
|
238
281
|
panelRgb,
|
|
282
|
+
parseCustomRGBA,
|
|
239
283
|
triggerCancel,
|
|
240
284
|
triggerColorUpdate,
|
|
241
285
|
triggerConfirm,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../chunk-G2ADBYYC.js";
|
|
2
|
-
import { initApi, initState, initWatch } from "./index";
|
|
2
|
+
import { initApi, initState, initWatch, parseCustomRGBA } from "./index";
|
|
3
3
|
const api = [
|
|
4
4
|
"state",
|
|
5
5
|
"open",
|
|
@@ -53,6 +53,11 @@ const renderless = (props, hooks, utils) => {
|
|
|
53
53
|
hooks.onMounted(() => {
|
|
54
54
|
if (props.modelValue) {
|
|
55
55
|
state.input = state.currentColor;
|
|
56
|
+
const result = parseCustomRGBA(state.currentColor, state.currentFormat) || [0, 0, 0, 0];
|
|
57
|
+
state.hexInput4 = Math.ceil(Number(result[0]));
|
|
58
|
+
state.hexInput5 = result[1];
|
|
59
|
+
state.hexInput6 = result[2];
|
|
60
|
+
state.hexInput7 = `${(Number(result[3]) || 1) * 100}%`;
|
|
56
61
|
}
|
|
57
62
|
});
|
|
58
63
|
return api2;
|
package/date-range/index.js
CHANGED
|
@@ -139,7 +139,7 @@ const handleClear = ({ emit, state }) => () => {
|
|
|
139
139
|
state.rightDate = nextMonth1(state.leftDate);
|
|
140
140
|
state.rangeState.selecting = false;
|
|
141
141
|
state.rangeState.endDate = null;
|
|
142
|
-
emit("pick",
|
|
142
|
+
emit("pick", []);
|
|
143
143
|
};
|
|
144
144
|
const handleChangeRange = (state, props) => (val) => {
|
|
145
145
|
if (props.readonly) {
|
package/dropdown/vue.js
CHANGED
|
@@ -22,9 +22,11 @@ import {
|
|
|
22
22
|
toggleFocus
|
|
23
23
|
} from "./index";
|
|
24
24
|
const api = ["state", "handleMainButtonClick", "hide", "show", "initDomOperation", "handleClick", "clickOutside"];
|
|
25
|
-
const renderless = (props, { reactive, watch, provide, onMounted, computed, onBeforeUnmount }, { emit, parent, broadcast, vm, nextTick, mode, designConfig }) => {
|
|
25
|
+
const renderless = (props, { reactive, watch, provide, onMounted, computed, onBeforeUnmount }, { emit, parent, broadcast, vm, nextTick, mode, designConfig, useBreakpoint }) => {
|
|
26
26
|
const api2 = {};
|
|
27
|
+
const { current } = useBreakpoint();
|
|
27
28
|
const state = reactive({
|
|
29
|
+
current,
|
|
28
30
|
visible: false,
|
|
29
31
|
timeout: null,
|
|
30
32
|
focusing: false,
|
package/file-upload/index.js
CHANGED
package/file-upload/vue.js
CHANGED
package/fluent-editor/index.js
CHANGED
|
@@ -109,7 +109,7 @@ const keyDownHandler = ({ state }) => (e) => {
|
|
|
109
109
|
if (e.keyCode === 27 && state.isFullscreen) {
|
|
110
110
|
state.isFullscreen = !state.isFullscreen;
|
|
111
111
|
}
|
|
112
|
-
} else {
|
|
112
|
+
} else if (e.type === "click") {
|
|
113
113
|
state.isFullscreen = !state.isFullscreen;
|
|
114
114
|
}
|
|
115
115
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import "../../chunk-G2ADBYYC.js";
|
|
2
|
-
import { extend } from "@opentiny/utils";
|
|
3
|
-
import { browserInfo } from "@opentiny/utils";
|
|
2
|
+
import { extend, browserInfo } from "@opentiny/utils";
|
|
4
3
|
const isIE = browserInfo.name === "ie";
|
|
5
4
|
const rgbRegExp = /^rgba?\((\d+),\s(\d+),\s(\d+)([\s\S]*)\)$/;
|
|
6
5
|
const hexRegExp = /^#([a-zA-Z0-9]{3}|[a-zA-Z0-9]{6})$/;
|
package/grid/utils/column.js
CHANGED
|
@@ -2,72 +2,104 @@ import "../../chunk-G2ADBYYC.js";
|
|
|
2
2
|
import { isBoolean } from "../static";
|
|
3
3
|
import { initFilter } from "./common";
|
|
4
4
|
let columnUniqueId = 0;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
column.footerClassName = context.footerClassName;
|
|
29
|
-
column.indexMethod = context.indexMethod;
|
|
30
|
-
column.formatText = context.formatText;
|
|
31
|
-
column.formatValue = context.formatValue;
|
|
32
|
-
setColumnFormat(column, context);
|
|
33
|
-
column.sortable = context.sortable;
|
|
34
|
-
column.sortBy = context.sortBy;
|
|
35
|
-
column.sortMethod = context.sortMethod;
|
|
36
|
-
column.remoteSort = context.remoteSort;
|
|
37
|
-
column.filterMultiple = isBoolean(context.filterMultiple) ? context.filterMultiple : true;
|
|
38
|
-
column.filterMethod = context.filterMethod;
|
|
39
|
-
column.filterRender = context.filterRender;
|
|
40
|
-
column.filter = context.filter && initFilter(context.filter);
|
|
41
|
-
column.treeNode = context.treeNode;
|
|
42
|
-
column.renderer = context.renderer;
|
|
43
|
-
column.editor = context.editor;
|
|
44
|
-
column.operationConfig = context.operationConfig;
|
|
45
|
-
column.equals = context.equals;
|
|
5
|
+
class FixedDetails {
|
|
6
|
+
constructor(fixedType) {
|
|
7
|
+
this.isLeft = fixedType === "left";
|
|
8
|
+
this.isLeftLast = false;
|
|
9
|
+
this.isRight = fixedType === "right";
|
|
10
|
+
this.isRightFirst = false;
|
|
11
|
+
this.left = 0;
|
|
12
|
+
this.right = 0;
|
|
13
|
+
}
|
|
14
|
+
getStyle(rightExtra = 0) {
|
|
15
|
+
const { isLeft, left, isRight, right } = this;
|
|
16
|
+
return {
|
|
17
|
+
left: isLeft ? `${left}px` : void 0,
|
|
18
|
+
right: isRight ? `${right + rightExtra}px` : void 0
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
getClass() {
|
|
22
|
+
const { isLeftLast, isRightFirst } = this;
|
|
23
|
+
return {
|
|
24
|
+
"fixed-left-last__column": isLeftLast,
|
|
25
|
+
"fixed-right-first__column": isRightFirst
|
|
26
|
+
};
|
|
27
|
+
}
|
|
46
28
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
29
|
+
class ColumnConfig {
|
|
30
|
+
constructor(context, { renderHeader, renderCell, renderData } = {}, config = {}) {
|
|
31
|
+
this.id = `col_${++columnUniqueId}`;
|
|
32
|
+
this.type = context.type;
|
|
33
|
+
this.prop = context.prop;
|
|
34
|
+
this.rules = context.rules;
|
|
35
|
+
this.required = context.required;
|
|
36
|
+
this.property = context.field || context.prop;
|
|
37
|
+
this.title = context.title;
|
|
38
|
+
this.label = context.label;
|
|
39
|
+
this.width = context.width;
|
|
40
|
+
this.minWidth = context.minWidth;
|
|
41
|
+
this.resizable = context.resizable;
|
|
42
|
+
this._fixed = context.fixed;
|
|
43
|
+
this._fixedDetails = context.fixed ? new FixedDetails(context.fixed) : void 0;
|
|
44
|
+
this.align = context.align;
|
|
45
|
+
this.headerAlign = context.headerAlign;
|
|
46
|
+
this.footerAlign = context.footerAlign;
|
|
47
|
+
this.showOverflow = context.showOverflow;
|
|
48
|
+
this.showHeaderOverflow = context.showHeaderOverflow;
|
|
49
|
+
this.showTip = context.showTip;
|
|
50
|
+
this.showHeaderTip = context.showHeaderTip;
|
|
51
|
+
this.className = context.class || context.className;
|
|
52
|
+
this.headerClassName = context.headerClassName;
|
|
53
|
+
this.footerClassName = context.footerClassName;
|
|
54
|
+
this.indexMethod = context.indexMethod;
|
|
55
|
+
this.formatText = context.formatText;
|
|
56
|
+
this.formatValue = context.formatValue;
|
|
57
|
+
this.format = context.formatConfig;
|
|
58
|
+
this.sortable = context.sortable;
|
|
59
|
+
this.sortBy = context.sortBy;
|
|
60
|
+
this.sortMethod = context.sortMethod;
|
|
61
|
+
this.remoteSort = context.remoteSort;
|
|
62
|
+
this.filterMultiple = isBoolean(context.filterMultiple) ? context.filterMultiple : true;
|
|
63
|
+
this.filterMethod = context.filterMethod;
|
|
64
|
+
this.filterRender = context.filterRender;
|
|
65
|
+
this.filter = context.filter && initFilter(context.filter);
|
|
66
|
+
this.treeNode = context.treeNode;
|
|
67
|
+
this.renderer = context.renderer;
|
|
68
|
+
this.editor = context.editor;
|
|
69
|
+
this.operationConfig = context.operationConfig;
|
|
70
|
+
this.equals = context.equals;
|
|
71
|
+
this.params = context.params;
|
|
72
|
+
this.visible = true;
|
|
73
|
+
this.level = 1;
|
|
74
|
+
this.rowSpan = 1;
|
|
75
|
+
this.colSpan = 1;
|
|
76
|
+
this.order = null;
|
|
77
|
+
this.renderWidth = 0;
|
|
78
|
+
this.renderHeight = 0;
|
|
79
|
+
this.resizeWidth = 0;
|
|
80
|
+
this.renderLeft = 0;
|
|
81
|
+
this.model = {};
|
|
82
|
+
this.renderHeader = renderHeader || context.renderHeader;
|
|
83
|
+
this.renderCell = renderCell || context.renderCell;
|
|
84
|
+
this.renderData = renderData;
|
|
85
|
+
this.showIcon = isBoolean(context.showIcon) ? context.showIcon : true;
|
|
86
|
+
this.loading = false;
|
|
87
|
+
this.slots = context.slots;
|
|
88
|
+
this.own = context;
|
|
89
|
+
this.asyncPrefix = config.constant.asyncPrefix;
|
|
90
|
+
}
|
|
91
|
+
set fixed(val) {
|
|
92
|
+
this._fixed = val;
|
|
93
|
+
this._fixedDetails = val ? new FixedDetails(val) : void 0;
|
|
94
|
+
}
|
|
95
|
+
get fixed() {
|
|
96
|
+
return this._fixed;
|
|
97
|
+
}
|
|
98
|
+
get fixedDetails() {
|
|
99
|
+
return this._fixedDetails;
|
|
100
|
+
}
|
|
68
101
|
}
|
|
69
102
|
const getColumnConfig = (context, options, config) => context instanceof ColumnConfig ? context : new ColumnConfig(context, options, config);
|
|
70
103
|
export {
|
|
71
|
-
getColumnConfig
|
|
72
|
-
setColumnFormat
|
|
104
|
+
getColumnConfig
|
|
73
105
|
};
|
package/grid/utils/common.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
__spreadValues
|
|
3
3
|
} from "../../chunk-G2ADBYYC.js";
|
|
4
|
-
import { isNull } from "@opentiny/utils";
|
|
5
|
-
import {
|
|
6
|
-
import { get, isFunction, set } from "../static";
|
|
4
|
+
import { isNull, find, isFunction } from "@opentiny/utils";
|
|
5
|
+
import { get, set } from "../static";
|
|
7
6
|
const gridSize = ["medium", "small", "mini"];
|
|
8
7
|
const getSize = ({ size, $parent }) => size || ($parent && gridSize.includes($parent.size) ? $parent.size : null);
|
|
9
8
|
const getFuncText = (content) => isFunction(content) ? content() : content;
|
|
@@ -12,17 +11,42 @@ const getRowid = ($table, row) => {
|
|
|
12
11
|
const rowId = get(row, getRowkey($table));
|
|
13
12
|
return rowId ? encodeURIComponent(rowId) : "";
|
|
14
13
|
};
|
|
15
|
-
const getColumnList = (columns) => {
|
|
14
|
+
const getColumnList = (columns, options = {}, level = 0) => {
|
|
16
15
|
const result = [];
|
|
17
|
-
columns.forEach((column) => {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
columns.forEach((column, index) => {
|
|
17
|
+
var _a;
|
|
18
|
+
const hasChildren = (_a = column.children) == null ? void 0 : _a.length;
|
|
19
|
+
if (!options.hasFixed && column.fixed) {
|
|
20
|
+
options.hasFixed = true;
|
|
21
|
+
}
|
|
22
|
+
if (!options.isCheckable && column.type === "selection") {
|
|
23
|
+
options.isCheckable = true;
|
|
22
24
|
}
|
|
25
|
+
if (level === 0 && !options.isGroup && hasChildren) {
|
|
26
|
+
options.isGroup = true;
|
|
27
|
+
}
|
|
28
|
+
options.columnCaches.push({ colid: column.id, column, index });
|
|
29
|
+
result.push.apply(result, hasChildren ? getColumnList(column.children, options, level + 1) : [column]);
|
|
23
30
|
});
|
|
24
31
|
return result;
|
|
25
32
|
};
|
|
33
|
+
const repairFixed = (root) => {
|
|
34
|
+
const subtree = [];
|
|
35
|
+
let fixed;
|
|
36
|
+
const recursive = (col) => {
|
|
37
|
+
subtree.push(col);
|
|
38
|
+
if (!fixed && col.fixed) {
|
|
39
|
+
fixed = col.fixed;
|
|
40
|
+
}
|
|
41
|
+
if (Array.isArray(col.children) && col.children.length > 0) {
|
|
42
|
+
col.children.forEach((col2) => recursive(col2));
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
recursive(root);
|
|
46
|
+
if (fixed) {
|
|
47
|
+
subtree.forEach((c) => c.fixed = fixed);
|
|
48
|
+
}
|
|
49
|
+
};
|
|
26
50
|
const getClass = (property, params) => property ? isFunction(property) ? property(params) : property : "";
|
|
27
51
|
const getFilters = (filters) => (filters || []).map(({ label, value, data, checked }) => ({
|
|
28
52
|
label,
|
|
@@ -32,17 +56,25 @@ const getFilters = (filters) => (filters || []).map(({ label, value, data, check
|
|
|
32
56
|
checked: !!checked
|
|
33
57
|
}));
|
|
34
58
|
const initFilter = (filter) => {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
59
|
+
var _a, _b, _c;
|
|
60
|
+
const {
|
|
61
|
+
values,
|
|
62
|
+
value: valueKey = "value",
|
|
63
|
+
checked: checkedKey = "checked",
|
|
64
|
+
condition,
|
|
65
|
+
enumable,
|
|
66
|
+
multi,
|
|
67
|
+
inputFilter
|
|
68
|
+
} = filter;
|
|
69
|
+
const value = ((_a = values == null ? void 0 : values.filter) == null ? void 0 : _a.call(values, (i) => i[checkedKey]).map((i) => i[valueKey])) || [];
|
|
70
|
+
const hasChecked = (_c = (_b = values == null ? void 0 : values.some) == null ? void 0 : _b.call(values, (i) => i[checkedKey])) != null ? _c : false;
|
|
71
|
+
const filterOptions = {
|
|
72
|
+
condition: { input: "", relation: "equals", empty: null, type: null, value },
|
|
73
|
+
hasFilter: inputFilter && !!(condition == null ? void 0 : condition.input) || enumable && multi && hasChecked || false,
|
|
74
|
+
custom: null,
|
|
75
|
+
showClear: true
|
|
76
|
+
};
|
|
77
|
+
return __spreadValues(__spreadValues({}, filterOptions), filter);
|
|
46
78
|
};
|
|
47
79
|
const formatText = (value) => `${isNull(value) ? "" : value}`;
|
|
48
80
|
const setCellValue = (row, column, value) => {
|
|
@@ -116,8 +148,33 @@ const getListeners = ($attrs, $listeners) => {
|
|
|
116
148
|
});
|
|
117
149
|
return listeners;
|
|
118
150
|
};
|
|
151
|
+
function dfsCopy(tree, callback, parent = void 0, isTree = false, childrenKey = "children") {
|
|
152
|
+
let copy;
|
|
153
|
+
if (Array.isArray(tree)) {
|
|
154
|
+
copy = [];
|
|
155
|
+
tree.forEach((node, index) => {
|
|
156
|
+
const copyItem = callback(node, index, parent);
|
|
157
|
+
if (copyItem) {
|
|
158
|
+
copy.push(copyItem);
|
|
159
|
+
}
|
|
160
|
+
if (isTree) {
|
|
161
|
+
const children = node[childrenKey];
|
|
162
|
+
if (children) {
|
|
163
|
+
const childrenCopy = dfsCopy(children, callback, node, isTree, childrenKey);
|
|
164
|
+
if (copyItem) {
|
|
165
|
+
copyItem[childrenKey] = childrenCopy;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
return copy;
|
|
172
|
+
}
|
|
173
|
+
let rowUniqueId = 0;
|
|
174
|
+
const getRowUniqueId = () => `row_${++rowUniqueId}`;
|
|
119
175
|
export {
|
|
120
176
|
assemColumn,
|
|
177
|
+
dfsCopy,
|
|
121
178
|
emitEvent,
|
|
122
179
|
formatText,
|
|
123
180
|
getCellValue,
|
|
@@ -126,11 +183,13 @@ export {
|
|
|
126
183
|
getFilters,
|
|
127
184
|
getFuncText,
|
|
128
185
|
getListeners,
|
|
186
|
+
getRowUniqueId,
|
|
129
187
|
getRowid,
|
|
130
188
|
getRowkey,
|
|
131
189
|
getSize,
|
|
132
190
|
gridSize,
|
|
133
191
|
hasChildrenList,
|
|
134
192
|
initFilter,
|
|
193
|
+
repairFixed,
|
|
135
194
|
setCellValue
|
|
136
195
|
};
|
package/grid/utils/dom.js
CHANGED
|
@@ -8,8 +8,12 @@ const CELL_CLS = ".tiny-grid-cell";
|
|
|
8
8
|
const ROW_CLS = ".tiny-grid-body__row";
|
|
9
9
|
const isPx = (val) => val && /^\d+(px)?$/.test(val);
|
|
10
10
|
const isScale = (val) => val && /^\d+%$/.test(val);
|
|
11
|
-
const updateCellTitle = (event) => {
|
|
12
|
-
|
|
11
|
+
const updateCellTitle = (event, td) => {
|
|
12
|
+
var _a;
|
|
13
|
+
const cellEl = td ? td.querySelector(".tiny-grid-cell-text") || td.querySelector(CELL_CLS) : (_a = event.currentTarget) == null ? void 0 : _a.querySelector(CELL_CLS);
|
|
14
|
+
if (!cellEl) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
13
17
|
const content = cellEl.innerText;
|
|
14
18
|
if (cellEl.getAttribute("title") !== content) {
|
|
15
19
|
cellEl.setAttribute("title", content);
|
|
@@ -17,109 +21,75 @@ const updateCellTitle = (event) => {
|
|
|
17
21
|
};
|
|
18
22
|
const rowToVisible = ($table, row) => {
|
|
19
23
|
$table.$nextTick(() => {
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
24
|
+
const { $refs, scrollYLoad, rowHeight, headerHeight, footerHeight, _tileInfo, _graphInfo } = $table;
|
|
25
|
+
const { tableBody: bodyVm } = $refs;
|
|
26
|
+
const { $el } = bodyVm;
|
|
27
|
+
const { map } = _tileInfo;
|
|
28
|
+
const { graphed } = _graphInfo;
|
|
29
|
+
const trEl = $el.querySelector(`[${ATTR_NAME}="${getRowid($table, row)}"]`);
|
|
30
|
+
const visibleStart = headerHeight;
|
|
31
|
+
const visibleEnd = $el.clientHeight - footerHeight;
|
|
32
|
+
const scrollTop = $el.scrollTop;
|
|
33
|
+
let position, trHeight;
|
|
34
|
+
let flag = false;
|
|
35
|
+
if (scrollYLoad) {
|
|
36
|
+
position = headerHeight + rowHeight * graphed.indexOf(map.get(row)) - scrollTop;
|
|
37
|
+
trHeight = rowHeight;
|
|
38
|
+
flag = true;
|
|
39
|
+
} else if (trEl) {
|
|
40
|
+
position = trEl.offsetTop - scrollTop;
|
|
41
|
+
trHeight = trEl.clientHeight;
|
|
42
|
+
flag = true;
|
|
43
|
+
}
|
|
44
|
+
if (flag) {
|
|
45
|
+
if (position < visibleStart) {
|
|
46
|
+
$el.scrollTop = scrollTop - (visibleStart - position);
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
position += trHeight;
|
|
50
|
+
if (position > visibleEnd) {
|
|
51
|
+
$el.scrollTop = scrollTop + (position - visibleEnd);
|
|
43
52
|
}
|
|
44
53
|
}
|
|
45
54
|
});
|
|
46
55
|
};
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
from.fixed === "left" && (scrollLeft = 0);
|
|
51
|
-
from.fixed === "right" && (scrollLeft = body.scrollWidth);
|
|
56
|
+
const colToVisible = ($table, column) => {
|
|
57
|
+
if (column.fixed) {
|
|
58
|
+
return;
|
|
52
59
|
}
|
|
53
|
-
return scrollLeft;
|
|
54
|
-
}
|
|
55
|
-
function computeScrollLeft($table, td) {
|
|
56
|
-
const { tableBody } = $table.$refs;
|
|
57
|
-
const { visibleColumn } = $table;
|
|
58
|
-
const { scrollLeft: bodyLeft, clientWidth: bodyWidth } = tableBody.$el;
|
|
59
|
-
let leftWidth = 0;
|
|
60
|
-
let rightWidth = 0;
|
|
61
|
-
visibleColumn.forEach((column) => {
|
|
62
|
-
if (column.fixed === "left") {
|
|
63
|
-
leftWidth += column.renderWidth;
|
|
64
|
-
} else if (column.fixed === "right") {
|
|
65
|
-
rightWidth += column.renderWidth;
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
const tdLeft = td._accumulateRenderWidth || td.offsetLeft + (td.offsetParent ? td.offsetParent.offsetLeft : 0);
|
|
69
|
-
const tdWidth = td._renderWidth || td.clientWidth;
|
|
70
|
-
let scrollLeft;
|
|
71
|
-
if (tdLeft < bodyLeft + leftWidth) {
|
|
72
|
-
scrollLeft = tdLeft - leftWidth;
|
|
73
|
-
} else if (tdLeft + tdWidth > bodyLeft + bodyWidth - rightWidth) {
|
|
74
|
-
scrollLeft = tdLeft + tdWidth - bodyWidth + rightWidth;
|
|
75
|
-
} else {
|
|
76
|
-
scrollLeft = bodyLeft;
|
|
77
|
-
}
|
|
78
|
-
return scrollLeft;
|
|
79
|
-
}
|
|
80
|
-
function setBodyLeft(body, td, $table, column, move) {
|
|
81
|
-
const { isLeftArrow, isRightArrow, from } = move || {};
|
|
82
|
-
const bodyScollLeft = computeScrollLeft($table, td);
|
|
83
|
-
$table.scrollTo(bodyScollLeft);
|
|
84
|
-
$table.lastScrollLeft = bodyScollLeft;
|
|
85
|
-
if (from) {
|
|
86
|
-
const direction = isLeftArrow ? "left" : isRightArrow ? "right" : null;
|
|
87
|
-
const fixedDom = $table.elemStore[`${direction}-body-list`];
|
|
88
|
-
const mainBody = $table.elemStore["main-body-wrapper"];
|
|
89
|
-
const { left, right } = td.getBoundingClientRect();
|
|
90
|
-
let offset = 0;
|
|
91
|
-
if (isLeftArrow && fixedDom) {
|
|
92
|
-
const div = fixedDom.querySelector("td.fixed__column");
|
|
93
|
-
const division = div ? div.getBoundingClientRect().left : fixedDom.getBoundingClientRect().right;
|
|
94
|
-
division > left && (offset = left - division);
|
|
95
|
-
}
|
|
96
|
-
if (isRightArrow && fixedDom) {
|
|
97
|
-
const div = fixedDom.querySelector("td:not(.fixed__column)") || fixedDom;
|
|
98
|
-
const division = div.getBoundingClientRect().left;
|
|
99
|
-
division < right && (offset = right - division);
|
|
100
|
-
}
|
|
101
|
-
mainBody.scrollLeft = getFixedLeft($table, from, column, body, offset);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
const colToVisible = ($table, column, move) => {
|
|
105
60
|
$table.$nextTick(() => {
|
|
106
|
-
const
|
|
107
|
-
const
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
61
|
+
const { $refs, scrollXLoad, visibleColumn, columnStore } = $table;
|
|
62
|
+
const { tableBody: bodyVm } = $refs;
|
|
63
|
+
const { $el } = bodyVm;
|
|
64
|
+
const { leftList, rightList } = columnStore;
|
|
65
|
+
const tdEl = $el.querySelector(`.${column.id}`);
|
|
66
|
+
const visibleStart = leftList.reduce((p, c) => p += c.renderWidth, 0);
|
|
67
|
+
const visibleEnd = $el.clientWidth - rightList.reduce((p, c) => p += c.renderWidth, 0);
|
|
68
|
+
const scrollLeft = $el.scrollLeft;
|
|
69
|
+
const colWidth = column.renderWidth;
|
|
70
|
+
let position;
|
|
71
|
+
let flag = false;
|
|
72
|
+
if (scrollXLoad) {
|
|
73
|
+
flag = true;
|
|
74
|
+
position = -scrollLeft;
|
|
75
|
+
for (const col of visibleColumn) {
|
|
76
|
+
if (col === column)
|
|
115
77
|
break;
|
|
116
|
-
|
|
117
|
-
|
|
78
|
+
position += col.renderWidth;
|
|
79
|
+
}
|
|
80
|
+
} else if (tdEl) {
|
|
81
|
+
flag = true;
|
|
82
|
+
position = tdEl.offsetLeft - scrollLeft;
|
|
83
|
+
}
|
|
84
|
+
if (flag) {
|
|
85
|
+
if (position < visibleStart) {
|
|
86
|
+
$el.scrollLeft = scrollLeft - (visibleStart - position);
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
position += colWidth;
|
|
90
|
+
if (position > visibleEnd) {
|
|
91
|
+
$el.scrollLeft = scrollLeft + (position - visibleEnd);
|
|
118
92
|
}
|
|
119
|
-
gridbodyEl.scrollLeft = computeScrollLeft($table, {
|
|
120
|
-
_accumulateRenderWidth: scrollLeft,
|
|
121
|
-
_renderWidth: column.renderWidth
|
|
122
|
-
});
|
|
123
93
|
}
|
|
124
94
|
});
|
|
125
95
|
};
|
|
@@ -130,6 +100,9 @@ const hasDataTag = (el, value) => {
|
|
|
130
100
|
if (el.host) {
|
|
131
101
|
el = el.host;
|
|
132
102
|
}
|
|
103
|
+
if (!(el == null ? void 0 : el.getAttribute)) {
|
|
104
|
+
return false;
|
|
105
|
+
}
|
|
133
106
|
return (" " + el.getAttribute("data-tag") + " ").includes(" " + value + " ");
|
|
134
107
|
};
|
|
135
108
|
const getEventTargetNode = (event, container, queryCls) => {
|
package/grid-select/index.js
CHANGED
|
@@ -17,9 +17,9 @@ const filter = ({ props, state, vm }) => (value) => {
|
|
|
17
17
|
const { multiple, valueField, filterMethod, remote, remoteMethod } = props;
|
|
18
18
|
if ((props.filterable || props.searchable) && typeof filterMethod === "function") {
|
|
19
19
|
const table = vm.$refs.gridRef.$refs.tinyTable;
|
|
20
|
-
const fullData = table.
|
|
20
|
+
const fullData = table.getTableData().fullData;
|
|
21
21
|
vm.$refs.gridRef.scrollTo(null, 0);
|
|
22
|
-
table.
|
|
22
|
+
table.loadTableData(filterMethod(value, fullData) || []);
|
|
23
23
|
vm.$refs.gridRef.handleTableData(!value);
|
|
24
24
|
state.previousQuery = value;
|
|
25
25
|
} else if (remote && typeof remoteMethod === "function") {
|
package/input/index.js
CHANGED
|
@@ -71,7 +71,8 @@ const calcTextareaHeight = ({
|
|
|
71
71
|
}
|
|
72
72
|
const { paddingSize, borderSize, boxSizing, contextStyle } = api.calculateNodeStyling(targetElement);
|
|
73
73
|
hiddenTextarea.setAttribute("style", `${contextStyle};${HIDDEN_STYLE}`);
|
|
74
|
-
|
|
74
|
+
const safePlaceholder = targetElement.placeholder ? targetElement.placeholder.trim().split("\n")[0] : "";
|
|
75
|
+
hiddenTextarea.value = targetElement.value || safePlaceholder || "";
|
|
75
76
|
let height = hiddenTextarea.scrollHeight;
|
|
76
77
|
const textareaStyle = {};
|
|
77
78
|
if (mode === "mobile") {
|
|
@@ -89,7 +90,7 @@ const calcTextareaHeight = ({
|
|
|
89
90
|
if (boxSizing === STYLE.BorderBox) {
|
|
90
91
|
minHeight = minHeight + paddingSize + borderSize;
|
|
91
92
|
}
|
|
92
|
-
if (props.size) {
|
|
93
|
+
if (props.size || minRows === 1) {
|
|
93
94
|
minHeight = props.size === "mini" ? minHeight * 0.67 : props.size === "small" ? minHeight : minHeight * 1.17;
|
|
94
95
|
}
|
|
95
96
|
if (props.height) {
|
|
@@ -97,7 +98,7 @@ const calcTextareaHeight = ({
|
|
|
97
98
|
}
|
|
98
99
|
if (!state.isDisplayOnly) {
|
|
99
100
|
height = Math.max(minHeight, height);
|
|
100
|
-
textareaStyle.minHeight = `${minHeight}px`;
|
|
101
|
+
textareaStyle.minHeight = `${Math.floor(minHeight)}px`;
|
|
101
102
|
} else {
|
|
102
103
|
textareaStyle.minHeight = `0px`;
|
|
103
104
|
}
|
package/input/vue.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opentiny/vue-renderless",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.26.0",
|
|
4
4
|
"description": "An enterprise-class UI component library, support both Vue.js 2 and Vue.js 3, as well as PC and mobile.",
|
|
5
5
|
"author": "OpenTiny Team",
|
|
6
6
|
"license": "MIT",
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
],
|
|
26
26
|
"sideEffects": false,
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@opentiny/utils": "~3.
|
|
29
|
-
"@opentiny/vue-hooks": "~3.
|
|
28
|
+
"@opentiny/utils": "~3.26.0",
|
|
29
|
+
"@opentiny/vue-hooks": "~3.26.0",
|
|
30
30
|
"color": "4.2.3"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
package/pager/vue.js
CHANGED
|
@@ -79,6 +79,7 @@ const renderless = (props, { reactive, computed, watch }, { emit, vm, nextTick,
|
|
|
79
79
|
showPager: computed(() => api2.computedShowPager()),
|
|
80
80
|
internalLayout: computed(() => api2.computedInternalLayout()),
|
|
81
81
|
totalText: computed(() => api2.computedTotalText()),
|
|
82
|
+
internalPageSizes: computed(() => props.pageSizes || [10, 20, 30, 40, 50, 100]),
|
|
82
83
|
internalPageCount: computed(() => api2.computedInternalPageCount()),
|
|
83
84
|
showJumperSuffix: (_b = (_a = designConfig == null ? void 0 : designConfig.state) == null ? void 0 : _a.showJumperSuffix) != null ? _b : true,
|
|
84
85
|
align: computed(() => {
|
|
@@ -134,8 +135,8 @@ const renderless = (props, { reactive, computed, watch }, { emit, vm, nextTick,
|
|
|
134
135
|
watchShowSizes: watchShowSizes({ nextTick, vm }),
|
|
135
136
|
watchInternalPageSize: watchInternalPageSize({ emit, props })
|
|
136
137
|
});
|
|
137
|
-
state.internalCurrentPage = api2.getValidCurrentPage(props.currentPage);
|
|
138
138
|
state.internalPageSize = api2.getInternalPageSize();
|
|
139
|
+
state.internalCurrentPage = api2.getValidCurrentPage(props.currentPage);
|
|
139
140
|
watch(() => state.internalCurrentPage, api2.watchInternalCurrentPage);
|
|
140
141
|
watch(() => state.internalPageSize, api2.watchInternalPageSize);
|
|
141
142
|
watch(() => props.currentPage, api2.watchCurrentPage);
|
package/popeditor/index.js
CHANGED
|
@@ -106,9 +106,6 @@ const handleConfirm = ({ api, constants, emit, props, state }) => (skipBeforeClo
|
|
|
106
106
|
if (skipBeforeClose !== true && typeof props.beforeClose === "function" && props.beforeClose("confirm") === false) {
|
|
107
107
|
return;
|
|
108
108
|
}
|
|
109
|
-
if (props.autoReset) {
|
|
110
|
-
handleReset({ api, state, props })();
|
|
111
|
-
}
|
|
112
109
|
if (props.popseletor === constants.TYPE_GRID) {
|
|
113
110
|
props.multi ? api.getMultiSelectedData({ props, state }) : api.getRadioSelectedData();
|
|
114
111
|
if (!isNull(state.commitValue)) {
|
|
@@ -130,6 +127,9 @@ const handleConfirm = ({ api, constants, emit, props, state }) => (skipBeforeClo
|
|
|
130
127
|
emit("change", commitValue, state.treeSelectList);
|
|
131
128
|
}
|
|
132
129
|
}
|
|
130
|
+
if (props.autoReset) {
|
|
131
|
+
handleReset({ api, state, props })();
|
|
132
|
+
}
|
|
133
133
|
state.open = false;
|
|
134
134
|
};
|
|
135
135
|
const handleReset = ({ api, state, props }) => () => {
|
package/search/index.js
CHANGED
|
@@ -27,6 +27,7 @@ const searchClick = ({ emit, props, state }) => (event) => {
|
|
|
27
27
|
event.preventDefault();
|
|
28
28
|
if (props.mini && state.collapse) {
|
|
29
29
|
state.collapse = false;
|
|
30
|
+
emit("expand");
|
|
30
31
|
} else {
|
|
31
32
|
emit("search", state.searchValue, state.currentValue);
|
|
32
33
|
}
|
|
@@ -37,10 +38,14 @@ const searchEnterKey = ({ api, props, vm, nextTick }) => (event) => {
|
|
|
37
38
|
nextTick(() => vm.$refs.input.blur());
|
|
38
39
|
}
|
|
39
40
|
};
|
|
40
|
-
const clickOutside = ({ parent, props, state }) => (event) => {
|
|
41
|
-
|
|
41
|
+
const clickOutside = ({ parent, props, state, emit }) => (event) => {
|
|
42
|
+
const path = (event == null ? void 0 : event.composedPath) && event.composedPath();
|
|
43
|
+
if (path ? !path.includes(parent.$el) : !parent.$el.contains(event.target)) {
|
|
42
44
|
state.show = false;
|
|
43
|
-
props.mini && !state.currentValue &&
|
|
45
|
+
if (props.mini && !state.currentValue && !state.collapse) {
|
|
46
|
+
state.collapse = true;
|
|
47
|
+
emit("collapse");
|
|
48
|
+
}
|
|
44
49
|
}
|
|
45
50
|
};
|
|
46
51
|
const setDefaultType = (searchTypes, typeValue) => {
|
package/search/vue.js
CHANGED
|
@@ -76,7 +76,7 @@ const renderless = (props, { computed, onBeforeUnmount, onMounted, reactive, toR
|
|
|
76
76
|
handleChange: handleChange({ emit, state }),
|
|
77
77
|
showSelector: showSelector({ vm, state }),
|
|
78
78
|
searchClick: searchClick({ emit, props, state }),
|
|
79
|
-
clickOutside: clickOutside({ parent, props, state }),
|
|
79
|
+
clickOutside: clickOutside({ parent, props, state, emit }),
|
|
80
80
|
emitInput: emitInput({ emit })
|
|
81
81
|
}, formatSearchTypes2.api);
|
|
82
82
|
Object.assign(api2, {
|
package/select/index.js
CHANGED
|
@@ -57,9 +57,9 @@ const gridOnQueryChange = ({ props, vm, constants, state }) => (value) => {
|
|
|
57
57
|
const { multiple, valueField, filterMethod, remote, remoteMethod } = props;
|
|
58
58
|
if ((props.filterable || props.searchable) && typeof filterMethod === "function") {
|
|
59
59
|
const table = vm.$refs.selectGrid.$refs.tinyTable;
|
|
60
|
-
const fullData = table.
|
|
60
|
+
const fullData = table.getTableData().fullData;
|
|
61
61
|
vm.$refs.selectGrid.scrollTo(null, 0);
|
|
62
|
-
table.
|
|
62
|
+
table.loadTableData(filterMethod(value, fullData) || []);
|
|
63
63
|
vm.$refs.selectGrid.handleTableData(!value).then(() => state.selectEmitter.emit(constants.EVENT_NAME.updatePopper));
|
|
64
64
|
state.previousQuery = value;
|
|
65
65
|
} else if (remote && typeof remoteMethod === "function") {
|
package/select/vue.js
CHANGED
|
@@ -269,7 +269,11 @@ const initState = ({ reactive, computed, props, api: api2, emitter, parent, cons
|
|
|
269
269
|
return true;
|
|
270
270
|
})(),
|
|
271
271
|
designConfig,
|
|
272
|
-
currentSizeMap: computed(() => api2.computedCurrentSizeMap())
|
|
272
|
+
currentSizeMap: computed(() => api2.computedCurrentSizeMap()),
|
|
273
|
+
rootAutoTipConfig: computed(() => __spreadValues({
|
|
274
|
+
content: state.displayOnlyContent,
|
|
275
|
+
always: !!state.displayOnlyContent
|
|
276
|
+
}, props.tooltipConfig))
|
|
273
277
|
}));
|
|
274
278
|
return state;
|
|
275
279
|
};
|
package/slider-button/vue.js
CHANGED
|
@@ -4,6 +4,7 @@ const api = ["state", "handleChange"];
|
|
|
4
4
|
const renderless = (props, { computed, reactive, onMounted, inject, onBeforeUnmount, watch }, { emit, parent, dispatch, constants, nextTick, vm }) => {
|
|
5
5
|
const state = reactive({
|
|
6
6
|
disabled: inject("disabled", null) || props.disabled,
|
|
7
|
+
displayed: inject("displayed", null) || props.displayed,
|
|
7
8
|
type: inject("sliderType", null),
|
|
8
9
|
value: computed({
|
|
9
10
|
get: () => api2.getValue(),
|
|
@@ -47,6 +47,7 @@ const renderless = (props, { reactive, provide, onMounted, onBeforeUnmount, watc
|
|
|
47
47
|
provide("sliderType", props.type);
|
|
48
48
|
provide("sliderSize", props.size);
|
|
49
49
|
provide("disabled", props.disabled);
|
|
50
|
+
provide("displayed", props.displayed);
|
|
50
51
|
onMounted(() => {
|
|
51
52
|
api2.getChangePosition(props.modelValue);
|
|
52
53
|
api2.watchVisible();
|
package/tabs/vue.js
CHANGED
package/tabs-mf/index.js
CHANGED
|
@@ -203,7 +203,10 @@ const wheelListener = ({ vm, api, tabs, state }) => debounce(10, (e) => {
|
|
|
203
203
|
Object.assign(state, { moreList, moreLeft, moreRight });
|
|
204
204
|
});
|
|
205
205
|
const getBoundRect = (vm) => () => vm.$el.getBoundingClientRect();
|
|
206
|
-
const handleClickDropdownItem = (tabs) => (
|
|
206
|
+
const handleClickDropdownItem = (tabs) => (navItem, event) => {
|
|
207
|
+
tabs.$emit("click", navItem, event);
|
|
208
|
+
tabs.clickMore(navItem.name);
|
|
209
|
+
};
|
|
207
210
|
const scrollToLeft = (tabs) => () => {
|
|
208
211
|
tabs.scrollTo(tabs.state.navs[0].name);
|
|
209
212
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ExtractPropTypes } from 'vue';
|
|
2
|
+
import { PropType } from '@opentiny/vue-common';
|
|
2
3
|
import { IButtonGroupNode as IButtonGroupNode$1 } from '@opentiny/vue-renderless/types/button-group.type';
|
|
3
4
|
import { ISharedRenderlessFunctionParams, ISharedRenderlessParamUtils } from './shared.type.js';
|
|
4
5
|
|
package/types/button.type.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ComputedRef, ExtractPropTypes } from 'vue';
|
|
2
|
+
import { PropType } from '@opentiny/vue-common';
|
|
2
3
|
import { ISharedRenderlessFunctionParams, ISharedRenderlessParamUtils } from './shared.type.js';
|
|
3
4
|
|
|
4
5
|
declare const buttonProps: {
|
|
@@ -68,6 +69,11 @@ declare const buttonProps: {
|
|
|
68
69
|
type: BooleanConstructor;
|
|
69
70
|
default: boolean;
|
|
70
71
|
};
|
|
72
|
+
/** 自定义样式 */
|
|
73
|
+
customStyle: {
|
|
74
|
+
type: ObjectConstructor;
|
|
75
|
+
default: () => {};
|
|
76
|
+
};
|
|
71
77
|
/** 是否幽灵按钮 */
|
|
72
78
|
ghost: BooleanConstructor;
|
|
73
79
|
/** 点击事件 */
|
|
@@ -75,7 +81,7 @@ declare const buttonProps: {
|
|
|
75
81
|
type: PropType<(ev: MouseEvent) => void>;
|
|
76
82
|
};
|
|
77
83
|
tiny_mode: StringConstructor;
|
|
78
|
-
tiny_mode_root: BooleanConstructor;
|
|
84
|
+
tiny_mode_root: BooleanConstructor;
|
|
79
85
|
tiny_template: (FunctionConstructor | ObjectConstructor)[];
|
|
80
86
|
tiny_renderless: FunctionConstructor;
|
|
81
87
|
tiny_theme: StringConstructor;
|
|
@@ -1,17 +1,7 @@
|
|
|
1
1
|
import { ExtractPropTypes } from 'vue';
|
|
2
|
+
import { PropType } from '@opentiny/vue-common';
|
|
2
3
|
import { ISharedRenderlessParamUtils, ISharedRenderlessFunctionParams, ISharedRenderlessParamHooks } from './shared.type.js';
|
|
3
4
|
|
|
4
|
-
/**
|
|
5
|
-
* Copyright (c) 2022 - present TinyVue Authors.
|
|
6
|
-
* Copyright (c) 2022 - present Huawei Cloud Computing Technologies Co., Ltd.
|
|
7
|
-
*
|
|
8
|
-
* Use of this source code is governed by an MIT-style license.
|
|
9
|
-
*
|
|
10
|
-
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
|
|
11
|
-
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
|
|
12
|
-
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
|
|
13
|
-
*
|
|
14
|
-
*/
|
|
15
5
|
declare const $constants: {
|
|
16
6
|
DIALOG_SLIDER_RIGHT: string;
|
|
17
7
|
DIALOG_FADE: string;
|
|
@@ -138,6 +128,9 @@ declare const dialogBoxProps: {
|
|
|
138
128
|
type: ObjectConstructor;
|
|
139
129
|
default: () => {};
|
|
140
130
|
};
|
|
131
|
+
onClose: {
|
|
132
|
+
type: PropType<() => void>;
|
|
133
|
+
};
|
|
141
134
|
tiny_mode: StringConstructor;
|
|
142
135
|
tiny_mode_root: BooleanConstructor;
|
|
143
136
|
tiny_template: (FunctionConstructor | ObjectConstructor)[];
|
package/types/pager.type.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ExtractPropTypes } from 'vue';
|
|
2
|
+
import { PropType } from '@opentiny/vue-common';
|
|
2
3
|
import { ISharedRenderlessFunctionParams, ISharedRenderlessParamUtils } from './shared.type.js';
|
|
3
4
|
|
|
4
5
|
declare const pagerProps: {
|
|
@@ -33,7 +34,6 @@ declare const pagerProps: {
|
|
|
33
34
|
};
|
|
34
35
|
pageSizes: {
|
|
35
36
|
type: PropType<number[]>;
|
|
36
|
-
default: () => number[];
|
|
37
37
|
};
|
|
38
38
|
pagerCount: {
|
|
39
39
|
type: NumberConstructor;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { StyleValue, ExtractPropTypes } from 'vue';
|
|
2
2
|
import { ISharedRenderlessFunctionParams, ISharedRenderlessParamUtils } from './shared.type.js';
|
|
3
3
|
import { IRadioGroupProps } from './radio-group.type.js';
|
|
4
|
+
import '@opentiny/vue-common';
|
|
4
5
|
|
|
5
6
|
declare const $constants: {
|
|
6
7
|
RADIO_GROUP: string;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ExtractPropTypes } from 'vue';
|
|
2
|
+
import { PropType } from '@opentiny/vue-common';
|
|
2
3
|
import { ISharedRenderlessFunctionParams, ISharedRenderlessParamUtils } from './shared.type.js';
|
|
3
4
|
|
|
4
5
|
declare const radioGroupProps: {
|
package/types/radio.type.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ExtractPropTypes } from 'vue';
|
|
2
|
+
import { PropType } from '@opentiny/vue-common';
|
|
2
3
|
import { ISharedRenderlessParamUtils, ISharedRenderlessFunctionParams } from './shared.type.js';
|
|
3
4
|
|
|
4
5
|
declare const $constants: {
|
package/types/slider.type.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ExtractPropTypes, CSSProperties, ComputedRef } from 'vue';
|
|
2
|
+
import { PropType } from '@opentiny/vue-common';
|
|
2
3
|
import { ISharedRenderlessFunctionParams, ISharedRenderlessParamUtils } from './shared.type.js';
|
|
3
4
|
|
|
4
5
|
declare const $constants: {
|
package/types/tabs.type.d.ts
CHANGED
|
@@ -57,6 +57,7 @@ declare const tabsProps: {
|
|
|
57
57
|
moreShowAll: BooleanConstructor;
|
|
58
58
|
panelMaxHeight: StringConstructor;
|
|
59
59
|
panelWidth: StringConstructor;
|
|
60
|
+
headerOnly: BooleanConstructor;
|
|
60
61
|
tiny_mode: StringConstructor;
|
|
61
62
|
tiny_mode_root: BooleanConstructor;
|
|
62
63
|
tiny_template: (FunctionConstructor | ObjectConstructor)[];
|
|
@@ -108,6 +109,7 @@ interface ITabsState {
|
|
|
108
109
|
activeIndex: number;
|
|
109
110
|
morePanes?: ITabsPaneVm[];
|
|
110
111
|
separator?: boolean;
|
|
112
|
+
headerOnly?: boolean;
|
|
111
113
|
}
|
|
112
114
|
/**
|
|
113
115
|
*tab根元素实例对象
|
|
@@ -1,17 +1,7 @@
|
|
|
1
1
|
import { ExtractPropTypes, ref } from 'vue';
|
|
2
|
+
import { PropType } from '@opentiny/vue-common';
|
|
2
3
|
import { ISharedRenderlessFunctionParams, ISharedRenderlessParamUtils } from './shared.type.js';
|
|
3
4
|
|
|
4
|
-
/**
|
|
5
|
-
* Copyright (c) 2022 - present TinyVue Authors.
|
|
6
|
-
* Copyright (c) 2022 - present Huawei Cloud Computing Technologies Co., Ltd.
|
|
7
|
-
*
|
|
8
|
-
* Use of this source code is governed by an MIT-style license.
|
|
9
|
-
*
|
|
10
|
-
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
|
|
11
|
-
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
|
|
12
|
-
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
|
|
13
|
-
*
|
|
14
|
-
*/
|
|
15
5
|
declare const userContactProps: {
|
|
16
6
|
showName: {
|
|
17
7
|
type: BooleanConstructor;
|
package/user/index.js
CHANGED
|
@@ -91,7 +91,7 @@ const request = {
|
|
|
91
91
|
cb({ error: e });
|
|
92
92
|
});
|
|
93
93
|
},
|
|
94
|
-
batchRequest(api) {
|
|
94
|
+
batchRequest(api, emit) {
|
|
95
95
|
const me = this;
|
|
96
96
|
const reqParamsSeq = me.getParams();
|
|
97
97
|
let reqLen = reqParamsSeq.length;
|
|
@@ -112,6 +112,7 @@ const request = {
|
|
|
112
112
|
});
|
|
113
113
|
});
|
|
114
114
|
errors.length && logger.warn(`user [${errors.join(",")}] not found`);
|
|
115
|
+
emit("error", errors);
|
|
115
116
|
this.clearRequest();
|
|
116
117
|
}
|
|
117
118
|
}
|
|
@@ -142,12 +143,12 @@ const request = {
|
|
|
142
143
|
this.batch = batch;
|
|
143
144
|
}
|
|
144
145
|
},
|
|
145
|
-
getusers({ param, api, batch, cb }) {
|
|
146
|
+
getusers({ param, api, batch, cb, emit }) {
|
|
146
147
|
if (batch !== false) {
|
|
147
148
|
this.setBatch(batch);
|
|
148
149
|
clearTimeout(this.timmer);
|
|
149
150
|
this.addRequest({ param, cb });
|
|
150
|
-
this.timmer = setTimeout(() => this.batchRequest(api), 100);
|
|
151
|
+
this.timmer = setTimeout(() => this.batchRequest(api, emit), 100);
|
|
151
152
|
} else {
|
|
152
153
|
this.singleRequest(param, api, cb);
|
|
153
154
|
}
|
|
@@ -316,7 +317,7 @@ const syncCacheIds = ({ props, state }) => (ids, queryIds, cacheData) => {
|
|
|
316
317
|
}
|
|
317
318
|
});
|
|
318
319
|
};
|
|
319
|
-
const getUsers = ({ api, props, state }) => (value) => {
|
|
320
|
+
const getUsers = ({ api, props, state, emit }) => (value) => {
|
|
320
321
|
const { cache } = props;
|
|
321
322
|
const { valueField } = state;
|
|
322
323
|
const ids = Array.isArray(value) ? value : value.split(props.valueSplit);
|
|
@@ -339,7 +340,7 @@ const getUsers = ({ api, props, state }) => (value) => {
|
|
|
339
340
|
resolve(data.concat(filterData));
|
|
340
341
|
}
|
|
341
342
|
};
|
|
342
|
-
request.getusers({ param, api, batch: state.batch, cb });
|
|
343
|
+
request.getusers({ param, api, batch: state.batch, cb, emit });
|
|
343
344
|
});
|
|
344
345
|
};
|
|
345
346
|
const updateCache = ({ props, state }) => () => {
|
package/user/vue.js
CHANGED
|
@@ -57,7 +57,7 @@ const renderless = (props, { reactive, watch, computed, provide }, { emit, nextT
|
|
|
57
57
|
suggestUser: suggestUser(api2),
|
|
58
58
|
cacheUser: cacheUser({ api: api2, props, service: $service, state }),
|
|
59
59
|
initUser: initUser({ api: api2, props, state }),
|
|
60
|
-
getUsers: getUsers({ api: api2, props, state }),
|
|
60
|
+
getUsers: getUsers({ api: api2, props, state, emit }),
|
|
61
61
|
setSelected: setSelected({ api: api2, props, state }),
|
|
62
62
|
searchMethod: searchMethod({ api: api2, props, state, emit }),
|
|
63
63
|
userChange: userChange({ api: api2, emit, props, state, dispatch, constants }),
|