@sheinx/base 3.7.7-beta.7 → 3.7.7-beta.8

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.
@@ -1 +1 @@
1
- {"version":3,"file":"form-fieldset.d.ts","sourceRoot":"","sources":["form-fieldset.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAGzD,QAAA,MAAM,YAAY,yCA6FjB,CAAC;AAEF,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"form-fieldset.d.ts","sourceRoot":"","sources":["form-fieldset.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAGzD,QAAA,MAAM,YAAY,yCAuGjB,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -94,8 +94,13 @@ var FormFieldSet = function FormFieldSet(props) {
94
94
  },
95
95
  onInsert: function onInsert(val) {
96
96
  var oldValue = formFunc === null || formFunc === void 0 ? void 0 : formFunc.getValue(name);
97
+ var insertValue = val;
98
+ var valueTemplate = oldValue[i];
99
+ if (insertValue === undefined) {
100
+ insertValue = _hooks.util.clearValue(_hooks.util.deepClone(valueTemplate));
101
+ }
97
102
  var newValue = produce(oldValue, function (draft) {
98
- draft.splice(i, 0, val);
103
+ draft.splice(i, 0, insertValue);
99
104
  });
100
105
  _onChange(newValue);
101
106
  // context.ids.splice(i, 0, util.generateUUID());
@@ -103,8 +108,13 @@ var FormFieldSet = function FormFieldSet(props) {
103
108
  },
104
109
  onAppend: function onAppend(val) {
105
110
  var oldValue = formFunc === null || formFunc === void 0 ? void 0 : formFunc.getValue(name);
111
+ var insertValue = val;
112
+ var valueTemplate = oldValue[i];
113
+ if (insertValue === undefined) {
114
+ insertValue = _hooks.util.clearValue(_hooks.util.deepClone(valueTemplate));
115
+ }
106
116
  var newValue = produce(oldValue, function (draft) {
107
- draft.splice(i + 1, 0, val);
117
+ draft.splice(i + 1, 0, insertValue);
108
118
  });
109
119
  _onChange(newValue);
110
120
  // context.ids.splice(i + 1, 0, util.generateUUID());
@@ -28,7 +28,7 @@ function getResetMore(onFilter, container, doms) {
28
28
  var paddingLeft = (0, _hooks.parsePxToNumber)(style.paddingLeft);
29
29
  var paddingRight = (0, _hooks.parsePxToNumber)(style.paddingRight);
30
30
  var minFilterWidth = onFilter ? 16 : 0;
31
- var contentWidth = clientWidth - paddingLeft - paddingRight - minFilterWidth - 1;
31
+ var contentWidth = clientWidth - paddingLeft - paddingRight - minFilterWidth;
32
32
  var hideEl = items.pop();
33
33
  var hideElStyle = getComputedStyle(hideEl);
34
34
  var hideMargin = (0, _hooks.parsePxToNumber)(hideElStyle.marginLeft) + (0, _hooks.parsePxToNumber)(hideElStyle.marginRight);
@@ -1 +1 @@
1
- {"version":3,"file":"form-fieldset.d.ts","sourceRoot":"","sources":["form-fieldset.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAGzD,QAAA,MAAM,YAAY,yCA6FjB,CAAC;AAEF,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"form-fieldset.d.ts","sourceRoot":"","sources":["form-fieldset.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAGzD,QAAA,MAAM,YAAY,yCAuGjB,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -87,8 +87,13 @@ var FormFieldSet = function FormFieldSet(props) {
87
87
  },
88
88
  onInsert: function onInsert(val) {
89
89
  var oldValue = formFunc === null || formFunc === void 0 ? void 0 : formFunc.getValue(name);
90
+ var insertValue = val;
91
+ var valueTemplate = oldValue[i];
92
+ if (insertValue === undefined) {
93
+ insertValue = util.clearValue(util.deepClone(valueTemplate));
94
+ }
90
95
  var newValue = produce(oldValue, function (draft) {
91
- draft.splice(i, 0, val);
96
+ draft.splice(i, 0, insertValue);
92
97
  });
93
98
  _onChange(newValue);
94
99
  // context.ids.splice(i, 0, util.generateUUID());
@@ -96,8 +101,13 @@ var FormFieldSet = function FormFieldSet(props) {
96
101
  },
97
102
  onAppend: function onAppend(val) {
98
103
  var oldValue = formFunc === null || formFunc === void 0 ? void 0 : formFunc.getValue(name);
104
+ var insertValue = val;
105
+ var valueTemplate = oldValue[i];
106
+ if (insertValue === undefined) {
107
+ insertValue = util.clearValue(util.deepClone(valueTemplate));
108
+ }
99
109
  var newValue = produce(oldValue, function (draft) {
100
- draft.splice(i + 1, 0, val);
110
+ draft.splice(i + 1, 0, insertValue);
101
111
  });
102
112
  _onChange(newValue);
103
113
  // context.ids.splice(i + 1, 0, util.generateUUID());
@@ -18,7 +18,7 @@ export function getResetMore(onFilter, container, doms) {
18
18
  var paddingLeft = parsePxToNumber(style.paddingLeft);
19
19
  var paddingRight = parsePxToNumber(style.paddingRight);
20
20
  var minFilterWidth = onFilter ? 16 : 0;
21
- var contentWidth = clientWidth - paddingLeft - paddingRight - minFilterWidth - 1;
21
+ var contentWidth = clientWidth - paddingLeft - paddingRight - minFilterWidth;
22
22
  var hideEl = items.pop();
23
23
  var hideElStyle = getComputedStyle(hideEl);
24
24
  var hideMargin = parsePxToNumber(hideElStyle.marginLeft) + parsePxToNumber(hideElStyle.marginRight);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sheinx/base",
3
- "version": "3.7.7-beta.7",
3
+ "version": "3.7.7-beta.8",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "license": "MIT",
@@ -10,7 +10,7 @@
10
10
  "module": "./esm/index.js",
11
11
  "typings": "./cjs/index.d.ts",
12
12
  "dependencies": {
13
- "@sheinx/hooks": "3.7.7-beta.7",
13
+ "@sheinx/hooks": "3.7.7-beta.8",
14
14
  "immer": "^10.0.0",
15
15
  "classnames": "^2.0.0",
16
16
  "@shined/reactive": "^0.1.3-alpha.0"