@cloudbase/weda-ui 3.8.0 → 3.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/configs/components/wd-input-number.d.ts +8 -0
- package/dist/configs/components/wd-input-number.js +9 -0
- package/dist/configs/components/wd-menu-layout.d.ts +8 -0
- package/dist/configs/components/wd-menu-layout.js +5 -0
- package/dist/configs/index.d.ts +24 -0
- package/dist/configs/type-utils/type-form.js +1 -1
- package/dist/configs/utils/layout.js +0 -8
- package/dist/web/components/form/select/index.d.ts +2 -0
- package/dist/web/components/form/select/index.js +2 -2
- package/dist/web/components/form/uploader/uploader.h5.js +6 -1
- package/dist/web/components/form/uploaderFile/uploadFile.h5.js +4 -1
- package/dist/web/components/wd-input-number/wd-input-number.js +16 -9
- package/dist/web/components/wd-menu-layout/style.d.ts +1 -0
- package/dist/web/components/wd-menu-layout/style.js +1 -0
- package/package.json +2 -2
|
@@ -318,6 +318,14 @@ declare const config: {
|
|
|
318
318
|
detail: {
|
|
319
319
|
value: import("@sinclair/typebox").TNumber;
|
|
320
320
|
};
|
|
321
|
+
description: string;
|
|
322
|
+
}, {
|
|
323
|
+
readonly name: "input";
|
|
324
|
+
readonly title: "用户输入";
|
|
325
|
+
readonly detail: import("@sinclair/typebox").TObject<{
|
|
326
|
+
value: import("@sinclair/typebox").TNumber;
|
|
327
|
+
}>;
|
|
328
|
+
readonly description: "用户输入值时触发,得到的是计算后的值";
|
|
321
329
|
}, {
|
|
322
330
|
name: string;
|
|
323
331
|
title: string;
|
|
@@ -190,7 +190,16 @@ const config = defineConfig({
|
|
|
190
190
|
events: [
|
|
191
191
|
Object.assign({}, FORM_ITEM_EVENTS.change, {
|
|
192
192
|
detail: { value: Type.Number({ description: '输入值' }) },
|
|
193
|
+
description: '用户修改值后,组件失去焦点时触发,得到的是计算后的最终值',
|
|
193
194
|
}),
|
|
195
|
+
{
|
|
196
|
+
name: 'input',
|
|
197
|
+
title: '用户输入',
|
|
198
|
+
detail: Type.Object({
|
|
199
|
+
value: Type.Number({ description: '输入值' }),
|
|
200
|
+
}),
|
|
201
|
+
description: '用户输入值时触发,得到的是计算后的值',
|
|
202
|
+
},
|
|
194
203
|
Object.assign({}, FORM_ITEM_EVENTS.focus, {
|
|
195
204
|
detail: { value: Type.Number({ description: '输入值' }) },
|
|
196
205
|
}),
|
|
@@ -108,6 +108,10 @@ export declare const configInfo: {
|
|
|
108
108
|
readonly name: "布局导航头部";
|
|
109
109
|
readonly selector: ".wd-menulayout-header";
|
|
110
110
|
readonly description: "可以为布局导航头部编写样式";
|
|
111
|
+
}, {
|
|
112
|
+
readonly name: "布局导航品牌插槽";
|
|
113
|
+
readonly selector: ".wd-menulayout-header__logo-wrap";
|
|
114
|
+
readonly description: "可以为布局导航品牌插槽编写样式";
|
|
111
115
|
}, {
|
|
112
116
|
readonly name: "布局导航主体";
|
|
113
117
|
readonly selector: ".wd-menulayout-body";
|
|
@@ -312,6 +316,10 @@ declare const config: {
|
|
|
312
316
|
readonly name: "布局导航头部";
|
|
313
317
|
readonly selector: ".wd-menulayout-header";
|
|
314
318
|
readonly description: "可以为布局导航头部编写样式";
|
|
319
|
+
}, {
|
|
320
|
+
readonly name: "布局导航品牌插槽";
|
|
321
|
+
readonly selector: ".wd-menulayout-header__logo-wrap";
|
|
322
|
+
readonly description: "可以为布局导航品牌插槽编写样式";
|
|
315
323
|
}, {
|
|
316
324
|
readonly name: "布局导航主体";
|
|
317
325
|
readonly selector: ".wd-menulayout-body";
|
|
@@ -166,6 +166,11 @@ export const configInfo = {
|
|
|
166
166
|
selector: '.wd-menulayout-header',
|
|
167
167
|
description: '可以为布局导航头部编写样式',
|
|
168
168
|
},
|
|
169
|
+
{
|
|
170
|
+
name: '布局导航品牌插槽',
|
|
171
|
+
selector: '.wd-menulayout-header__logo-wrap',
|
|
172
|
+
description: '可以为布局导航品牌插槽编写样式',
|
|
173
|
+
},
|
|
169
174
|
{
|
|
170
175
|
name: '布局导航主体',
|
|
171
176
|
selector: '.wd-menulayout-body',
|
package/dist/configs/index.d.ts
CHANGED
|
@@ -17319,6 +17319,14 @@ export declare const components: {
|
|
|
17319
17319
|
detail: {
|
|
17320
17320
|
value: import("@sinclair/typebox").TNumber;
|
|
17321
17321
|
};
|
|
17322
|
+
description: string;
|
|
17323
|
+
}, {
|
|
17324
|
+
readonly name: "input";
|
|
17325
|
+
readonly title: "用户输入";
|
|
17326
|
+
readonly detail: import("@sinclair/typebox").TObject<{
|
|
17327
|
+
value: import("@sinclair/typebox").TNumber;
|
|
17328
|
+
}>;
|
|
17329
|
+
readonly description: "用户输入值时触发,得到的是计算后的值";
|
|
17322
17330
|
}, {
|
|
17323
17331
|
name: string;
|
|
17324
17332
|
title: string;
|
|
@@ -18714,6 +18722,10 @@ export declare const components: {
|
|
|
18714
18722
|
readonly name: "布局导航头部";
|
|
18715
18723
|
readonly selector: ".wd-menulayout-header";
|
|
18716
18724
|
readonly description: "可以为布局导航头部编写样式";
|
|
18725
|
+
}, {
|
|
18726
|
+
readonly name: "布局导航品牌插槽";
|
|
18727
|
+
readonly selector: ".wd-menulayout-header__logo-wrap";
|
|
18728
|
+
readonly description: "可以为布局导航品牌插槽编写样式";
|
|
18717
18729
|
}, {
|
|
18718
18730
|
readonly name: "布局导航主体";
|
|
18719
18731
|
readonly selector: ".wd-menulayout-body";
|
|
@@ -37407,6 +37419,14 @@ declare const _default: {
|
|
|
37407
37419
|
detail: {
|
|
37408
37420
|
value: import("@sinclair/typebox").TNumber;
|
|
37409
37421
|
};
|
|
37422
|
+
description: string;
|
|
37423
|
+
}, {
|
|
37424
|
+
readonly name: "input";
|
|
37425
|
+
readonly title: "用户输入";
|
|
37426
|
+
readonly detail: import("@sinclair/typebox").TObject<{
|
|
37427
|
+
value: import("@sinclair/typebox").TNumber;
|
|
37428
|
+
}>;
|
|
37429
|
+
readonly description: "用户输入值时触发,得到的是计算后的值";
|
|
37410
37430
|
}, {
|
|
37411
37431
|
name: string;
|
|
37412
37432
|
title: string;
|
|
@@ -38802,6 +38822,10 @@ declare const _default: {
|
|
|
38802
38822
|
readonly name: "布局导航头部";
|
|
38803
38823
|
readonly selector: ".wd-menulayout-header";
|
|
38804
38824
|
readonly description: "可以为布局导航头部编写样式";
|
|
38825
|
+
}, {
|
|
38826
|
+
readonly name: "布局导航品牌插槽";
|
|
38827
|
+
readonly selector: ".wd-menulayout-header__logo-wrap";
|
|
38828
|
+
readonly description: "可以为布局导航品牌插槽编写样式";
|
|
38805
38829
|
}, {
|
|
38806
38830
|
readonly name: "布局导航主体";
|
|
38807
38831
|
readonly selector: ".wd-menulayout-body";
|
|
@@ -497,10 +497,6 @@ export const getItems = (template = 'horizontal') => {
|
|
|
497
497
|
id: 'headSlot',
|
|
498
498
|
component: '',
|
|
499
499
|
},
|
|
500
|
-
{
|
|
501
|
-
id: 'headRightSlot',
|
|
502
|
-
component: '',
|
|
503
|
-
},
|
|
504
500
|
]);
|
|
505
501
|
}
|
|
506
502
|
else if (template === 'base') {
|
|
@@ -513,10 +509,6 @@ export const getItems = (template = 'horizontal') => {
|
|
|
513
509
|
id: 'headSlot',
|
|
514
510
|
component: '',
|
|
515
511
|
},
|
|
516
|
-
{
|
|
517
|
-
id: 'headRightSlot',
|
|
518
|
-
component: '',
|
|
519
|
-
},
|
|
520
512
|
]);
|
|
521
513
|
}
|
|
522
514
|
else {
|
|
@@ -4,6 +4,7 @@ import './style';
|
|
|
4
4
|
import type { CommonFormPropsType } from '../types';
|
|
5
5
|
import { IUseoptionsParams } from './request';
|
|
6
6
|
import { TSingleForeignFormat } from './formats-util';
|
|
7
|
+
import { AttachContainer } from 'tea-component/lib/_util/get-overlay-root';
|
|
7
8
|
export declare const moment: any;
|
|
8
9
|
declare const Select: React.NamedExoticComponent<PropsType>;
|
|
9
10
|
export default Select;
|
|
@@ -57,6 +58,7 @@ export interface PropsType extends CommonFormPropsType {
|
|
|
57
58
|
readOnly?: boolean;
|
|
58
59
|
ignoreCase?: boolean;
|
|
59
60
|
staticSearchable?: boolean;
|
|
61
|
+
popupContainer?: AttachContainer;
|
|
60
62
|
}
|
|
61
63
|
export declare const defaultProps: {
|
|
62
64
|
events: {};
|
|
@@ -70,7 +70,7 @@ export const defaultProps = {
|
|
|
70
70
|
separator: ',',
|
|
71
71
|
};
|
|
72
72
|
// const button = <Button type="icon" icon="more" />;
|
|
73
|
-
function SelectPc({ name, where, dataSourceName, viewId, format, primaryField, enumName, defaultValue, placeholder = '请选择', mode = 'selector', dateMode = 'day', events = emptyObject, disabled = false, range = defaultProps.range, startDate, endDate, defaultDate, defaultTime, startTime, endTime, defaultRegion, defaultMutiRegion, regionType, separator = defaultProps.separator, size = defaultProps.size, clearable = false, onChange, onSearchValueInput, readOnly, ignoreCase, staticSearchable, }) {
|
|
73
|
+
function SelectPc({ name, where, dataSourceName, viewId, format, primaryField, enumName, defaultValue, placeholder = '请选择', mode = 'selector', dateMode = 'day', events = emptyObject, disabled = false, range = defaultProps.range, startDate, endDate, defaultDate, defaultTime, startTime, endTime, defaultRegion, defaultMutiRegion, regionType, separator = defaultProps.separator, size = defaultProps.size, clearable = false, onChange, onSearchValueInput, readOnly, ignoreCase, staticSearchable, popupContainer, }) {
|
|
74
74
|
const { classPrefix } = useConfig();
|
|
75
75
|
// 两次默认值不同, 需要刷新
|
|
76
76
|
const prevDefaultRef = React.useRef();
|
|
@@ -251,5 +251,5 @@ function SelectPc({ name, where, dataSourceName, viewId, format, primaryField, e
|
|
|
251
251
|
}
|
|
252
252
|
};
|
|
253
253
|
const dropdown = createDropdown();
|
|
254
|
-
return _jsx(ConfigProvider, { classPrefix: "wedatea2td", children: dropdown });
|
|
254
|
+
return (_jsx(ConfigProvider, { classPrefix: "wedatea2td", popupContainer: popupContainer, children: dropdown }));
|
|
255
255
|
}
|
|
@@ -23,6 +23,7 @@ export function ImageUploaderH5({ title: label, maxUploadCount, maxSize = 10, ac
|
|
|
23
23
|
'weda-ui': true,
|
|
24
24
|
[className]: className,
|
|
25
25
|
});
|
|
26
|
+
const inputRef = React.useRef(null);
|
|
26
27
|
// 上传中
|
|
27
28
|
const [uploading, setUploading] = React.useState(false);
|
|
28
29
|
//上传进度
|
|
@@ -173,7 +174,11 @@ export function ImageUploaderH5({ title: label, maxUploadCount, maxSize = 10, ac
|
|
|
173
174
|
};
|
|
174
175
|
return (_jsx("div", { className: cls, id: id, style: style, children: _jsxs("div", { className: classNames('weui-uploader weui-cells weui-cells_form weda-formcells', layout, layoutCls), children: [_jsx("div", { className: classNames('weui-uploader__hd', layout), children: _jsx(UploaderLabel, { layout: layout, label: label, labelVisible: labelVisible, currentCount: fileIdList.length, maxCount: finalMaxImgCount, requiredFlag: requiredFlag }) }), _jsxs("div", { className: "weui-uploader__bd", children: [_jsxs("ul", { className: "weui-uploader__files", id: "uploaderFiles", children: [(fileIdList !== null && fileIdList !== void 0 ? fileIdList : []).map((f) => (_jsx(SingleImage, { src: f, deleteBySrc: deleteFile, disabled: disabled || readOnly || sourceType === 'album', imgTypeCls: imgTypeCls }, f))), fileIdList.length < 1 && readOnly && _jsx(_Fragment, { children: "\u2014" }), uploading && (_jsx("li", { className: `weui-uploader__file weui-uploader__file_status ${imgTypeCls}`, children: _jsxs("div", { className: "weui-uploader__file-content", children: [progress, "%"] }) }))] }), showAdd && !readOnly && (_jsx("div", { className: `weui-uploader__input-box ${imgTypeCls}`, children: !disabled &&
|
|
175
176
|
sourceType !== 'album' &&
|
|
176
|
-
(sourceType === 'camera' ? (_jsx("input", {
|
|
177
|
+
(sourceType === 'camera' ? (_jsx("input", { ref: inputRef, onClick: () => {
|
|
178
|
+
inputRef.current && (inputRef.current.value = '');
|
|
179
|
+
}, "data-testid": "uploaderh5_input", id: "uploaderInput", className: "weui-uploader__input", type: "file", accept: accepts.join(','), multiple: !single && !(browserEnv().android && browserEnv().weixin), capture: true, onChange: uploadChange })) : (_jsx("input", { ref: inputRef, onClick: () => {
|
|
180
|
+
inputRef.current && (inputRef.current.value = '');
|
|
181
|
+
}, "data-testid": "uploaderh5_input", id: "uploaderInput", className: "weui-uploader__input", type: "file", accept: accepts.join(','), multiple: !single && !(browserEnv().android && browserEnv().weixin), onChange: uploadChange }))) }))] })] }) }));
|
|
177
182
|
}
|
|
178
183
|
function SingleImage({ src, deleteBySrc, disabled, imgTypeCls, }) {
|
|
179
184
|
const cls = classNames({
|
|
@@ -48,6 +48,7 @@ events = emptyObject, defaultValue, uploadPath = 'weda-uploader', single = true,
|
|
|
48
48
|
// 两次默认值不同, 需要刷新
|
|
49
49
|
const prevDefaultRef = React.useRef([]);
|
|
50
50
|
const fileRef = React.useRef(fileIDList);
|
|
51
|
+
const inputRef = React.useRef(null);
|
|
51
52
|
const maxSizeLimit = maxSize;
|
|
52
53
|
const formType = ((_a = getParentForm($node)) === null || _a === void 0 ? void 0 : _a.formType) || 'create';
|
|
53
54
|
const changeTypeRef = React.useRef('');
|
|
@@ -131,7 +132,9 @@ events = emptyObject, defaultValue, uploadPath = 'weda-uploader', single = true,
|
|
|
131
132
|
isEdit,
|
|
132
133
|
events,
|
|
133
134
|
fileSizeObj,
|
|
134
|
-
}, children: _jsx("div", { "data-testid": "uploadFileH5", className: cls, id: id, style: style, children: _jsxs("div", { className: classNames(`${CLASS_PREFIX}`), children: [isEdit && (_jsx("div", { className: classNames(`${CLASS_PREFIX}__hd`, layout), children: _jsx("div", { children: btnDisabled ? (readOnly ? null : (_jsx(WdButton, { variant: "outline", className: classNames(`${CLASS_PREFIX}__btn--weak`), disabled: btnDisabled, text: btnTitle }))) : (_jsxs("div", { children: [_jsx("input", { id: "uploaderInput", type: "file", "data-testid": "button-up", className: "weui-uploader-mobile__input", accept: accepts.join(','), multiple: !single,
|
|
135
|
+
}, children: _jsx("div", { "data-testid": "uploadFileH5", className: cls, id: id, style: style, children: _jsxs("div", { className: classNames(`${CLASS_PREFIX}`), children: [isEdit && (_jsx("div", { className: classNames(`${CLASS_PREFIX}__hd`, layout), children: _jsx("div", { children: btnDisabled ? (readOnly ? null : (_jsx(WdButton, { variant: "outline", className: classNames(`${CLASS_PREFIX}__btn--weak`), disabled: btnDisabled, text: btnTitle }))) : (_jsxs("div", { children: [_jsx("input", { ref: inputRef, id: "uploaderInput", type: "file", "data-testid": "button-up", className: "weui-uploader-mobile__input", accept: accepts.join(','), multiple: !single, onClick: () => {
|
|
136
|
+
inputRef.current && (inputRef.current.value = '');
|
|
137
|
+
}, onChange: async (e) => {
|
|
135
138
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
136
139
|
let fileList = [...e.target.files];
|
|
137
140
|
if (single && fileList.length > 1) {
|
|
@@ -322,6 +322,7 @@ export const WdInputNumber = forwardRef(function WdInputNumber(props, ref) {
|
|
|
322
322
|
const onChange = (e) => {
|
|
323
323
|
const value = typeof e === 'string' ? e : e.target.value;
|
|
324
324
|
setShowValue(value);
|
|
325
|
+
onRealChange(e, '', { needSetData: false, value });
|
|
325
326
|
};
|
|
326
327
|
/**
|
|
327
328
|
* 真实值变化
|
|
@@ -329,22 +330,28 @@ export const WdInputNumber = forwardRef(function WdInputNumber(props, ref) {
|
|
|
329
330
|
* @param type
|
|
330
331
|
* @returns
|
|
331
332
|
*/
|
|
332
|
-
const onRealChange = (e, type = '') => {
|
|
333
|
-
var _a, _b;
|
|
333
|
+
const onRealChange = (e, type = '', { needSetData = true, value = '' } = {}) => {
|
|
334
|
+
var _a, _b, _c, _d;
|
|
334
335
|
if (editDisabled)
|
|
335
336
|
return realValue;
|
|
336
337
|
if (['plus', 'minus'].includes(type)) {
|
|
337
338
|
if (!isNumber(props.step) ||
|
|
338
339
|
(type === 'plus' && stepPlusDisabled) ||
|
|
339
|
-
(type === 'minus' && stepMinusDisabled))
|
|
340
|
-
return Number(showValue);
|
|
340
|
+
(type === 'minus' && stepMinusDisabled)) {
|
|
341
|
+
return Number(value || showValue);
|
|
342
|
+
}
|
|
341
343
|
}
|
|
342
|
-
const toShow = getShowValue(filterDigit(showValue), type);
|
|
344
|
+
const toShow = getShowValue(filterDigit(value || showValue), type);
|
|
343
345
|
const toReal = getRealValue(toShow);
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
346
|
+
if (needSetData) {
|
|
347
|
+
setShowValue(toShow);
|
|
348
|
+
setRealValue(toReal);
|
|
349
|
+
changeForm(toReal);
|
|
350
|
+
(_b = (_a = props.events) === null || _a === void 0 ? void 0 : _a.change) === null || _b === void 0 ? void 0 : _b.call(_a, { value: toReal }, { originEvent: e });
|
|
351
|
+
}
|
|
352
|
+
else {
|
|
353
|
+
(_d = (_c = props.events) === null || _c === void 0 ? void 0 : _c.input) === null || _d === void 0 ? void 0 : _d.call(_c, { value: toReal }, { originEvent: e });
|
|
354
|
+
}
|
|
348
355
|
return toReal;
|
|
349
356
|
};
|
|
350
357
|
const onClear = (e) => {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '../style';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '../style';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudbase/weda-ui",
|
|
3
|
-
"version": "3.8.
|
|
3
|
+
"version": "3.8.2",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"module": "./dist/index",
|
|
6
6
|
"miniprogram": "mpdist",
|
|
@@ -123,7 +123,7 @@
|
|
|
123
123
|
"spark-md5": "^3.0.2",
|
|
124
124
|
"swr": "^2.2.2",
|
|
125
125
|
"tdesign-icons-react": "0.0.8",
|
|
126
|
-
"tea-component": "
|
|
126
|
+
"tea-component": "~2.7.8",
|
|
127
127
|
"uuid": "8.3.2",
|
|
128
128
|
"video.js": "7.20.3",
|
|
129
129
|
"weui": "2.5.9",
|