@opentiny/vue-renderless 3.25.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/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/dropdown/vue.js +3 -1
- package/file-upload/vue.js +1 -1
- package/fluent-editor/index.js +1 -1
- package/input/index.js +2 -1
- package/package.json +3 -3
- package/pager/vue.js +1 -1
- package/popeditor/index.js +3 -3
- package/search/index.js +6 -2
- package/search/vue.js +1 -1
- 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 +2 -1
- package/types/dialog-box.type.d.ts +4 -11
- package/types/pager.type.d.ts +2 -1
- 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
|
@@ -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/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/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
|
};
|
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") {
|
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
|
@@ -135,8 +135,8 @@ const renderless = (props, { reactive, computed, watch }, { emit, vm, nextTick,
|
|
|
135
135
|
watchShowSizes: watchShowSizes({ nextTick, vm }),
|
|
136
136
|
watchInternalPageSize: watchInternalPageSize({ emit, props })
|
|
137
137
|
});
|
|
138
|
-
state.internalCurrentPage = api2.getValidCurrentPage(props.currentPage);
|
|
139
138
|
state.internalPageSize = api2.getInternalPageSize();
|
|
139
|
+
state.internalCurrentPage = api2.getValidCurrentPage(props.currentPage);
|
|
140
140
|
watch(() => state.internalCurrentPage, api2.watchInternalCurrentPage);
|
|
141
141
|
watch(() => state.internalPageSize, api2.watchInternalPageSize);
|
|
142
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,11 +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
|
+
const clickOutside = ({ parent, props, state, emit }) => (event) => {
|
|
41
42
|
const path = (event == null ? void 0 : event.composedPath) && event.composedPath();
|
|
42
43
|
if (path ? !path.includes(parent.$el) : !parent.$el.contains(event.target)) {
|
|
43
44
|
state.show = false;
|
|
44
|
-
props.mini && !state.currentValue &&
|
|
45
|
+
if (props.mini && !state.currentValue && !state.collapse) {
|
|
46
|
+
state.collapse = true;
|
|
47
|
+
emit("collapse");
|
|
48
|
+
}
|
|
45
49
|
}
|
|
46
50
|
};
|
|
47
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/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: {
|
|
@@ -80,7 +81,7 @@ declare const buttonProps: {
|
|
|
80
81
|
type: PropType<(ev: MouseEvent) => void>;
|
|
81
82
|
};
|
|
82
83
|
tiny_mode: StringConstructor;
|
|
83
|
-
tiny_mode_root: BooleanConstructor;
|
|
84
|
+
tiny_mode_root: BooleanConstructor;
|
|
84
85
|
tiny_template: (FunctionConstructor | ObjectConstructor)[];
|
|
85
86
|
tiny_renderless: FunctionConstructor;
|
|
86
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: {
|
|
@@ -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 }),
|