@cloudbase/weda-ui 3.8.1 → 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.
@@ -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
  }),
@@ -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;
@@ -37411,6 +37419,14 @@ declare const _default: {
37411
37419
  detail: {
37412
37420
  value: import("@sinclair/typebox").TNumber;
37413
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: "用户输入值时触发,得到的是计算后的值";
37414
37430
  }, {
37415
37431
  name: string;
37416
37432
  title: string;
@@ -596,7 +596,7 @@ export const FORM_ITEM_DATA = {
596
596
  _modeInFormArr: Type.StringEnum({
597
597
  title: '嵌套表单项类型',
598
598
  type: 'string',
599
- 'x-runtime-default': 'obj',
599
+ default: 'obj',
600
600
  enum: [
601
601
  { label: '对象', value: 'obj' },
602
602
  { label: '字段', value: 'field' },
@@ -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
- setShowValue(toShow);
345
- setRealValue(toReal);
346
- changeForm(toReal);
347
- (_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 });
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.1",
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": "^2.7.8",
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",