@sheinx/base 3.7.7-beta.6 → 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":"table.d.ts","sourceRoot":"","sources":["table.tsx"],"names":[],"mappings":"AA0BA,OAAO,EAAgB,UAAU,EAAE,MAAM,cAAc,CAAC;;AAexD,wBA4rBE"}
1
+ {"version":3,"file":"table.d.ts","sourceRoot":"","sources":["table.tsx"],"names":[],"mappings":"AA0BA,OAAO,EAAgB,UAAU,EAAE,MAAM,cAAc,CAAC;;AAexD,wBA+rBE"}
@@ -93,7 +93,8 @@ var _default = exports.default = function _default(props) {
93
93
  };
94
94
  var _useRef = (0, _react.useRef)({
95
95
  emptyHeight: 0,
96
- theadAndTfootHeight: 0,
96
+ theadHeight: 0,
97
+ tfootHeight: 0,
97
98
  scrollingTimer: null
98
99
  }),
99
100
  context = _useRef.current;
@@ -231,9 +232,10 @@ var _default = exports.default = function _default(props) {
231
232
  var theadHeight = (theadRef === null || theadRef === void 0 || (_theadRef$current = theadRef.current) === null || _theadRef$current === void 0 ? void 0 : _theadRef$current.clientHeight) || 0;
232
233
  var tfootHeight = ((_tfootRef$current = tfootRef.current) === null || _tfootRef$current === void 0 ? void 0 : _tfootRef$current.clientHeight) || 0;
233
234
  if (props.sticky) {
234
- context.theadAndTfootHeight = tfootHeight;
235
+ context.tfootHeight = tfootHeight;
235
236
  } else {
236
- context.theadAndTfootHeight = theadHeight + tfootHeight;
237
+ context.theadHeight = theadHeight;
238
+ context.tfootHeight = tfootHeight;
237
239
  }
238
240
  });
239
241
  (0, _react.useEffect)(function () {
@@ -269,7 +271,8 @@ var _default = exports.default = function _default(props) {
269
271
  innerRef: tbodyRef,
270
272
  scrollLeft: props.scrollLeft,
271
273
  isRtl: isRtl,
272
- theadAndTfootHeight: context.theadAndTfootHeight
274
+ theadHeight: context.theadHeight,
275
+ tfootHeight: context.tfootHeight
273
276
  });
274
277
  var syncHeaderScroll = (0, _hooks.usePersistFn)(function (left) {
275
278
  var _tableRef$current;
@@ -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);
@@ -1 +1 @@
1
- {"version":3,"file":"table.d.ts","sourceRoot":"","sources":["table.tsx"],"names":[],"mappings":"AA0BA,OAAO,EAAgB,UAAU,EAAE,MAAM,cAAc,CAAC;;AAexD,wBA4rBE"}
1
+ {"version":3,"file":"table.d.ts","sourceRoot":"","sources":["table.tsx"],"names":[],"mappings":"AA0BA,OAAO,EAAgB,UAAU,EAAE,MAAM,cAAc,CAAC;;AAexD,wBA+rBE"}
@@ -86,7 +86,8 @@ export default (function (props) {
86
86
  };
87
87
  var _useRef = useRef({
88
88
  emptyHeight: 0,
89
- theadAndTfootHeight: 0,
89
+ theadHeight: 0,
90
+ tfootHeight: 0,
90
91
  scrollingTimer: null
91
92
  }),
92
93
  context = _useRef.current;
@@ -224,9 +225,10 @@ export default (function (props) {
224
225
  var theadHeight = (theadRef === null || theadRef === void 0 || (_theadRef$current = theadRef.current) === null || _theadRef$current === void 0 ? void 0 : _theadRef$current.clientHeight) || 0;
225
226
  var tfootHeight = ((_tfootRef$current = tfootRef.current) === null || _tfootRef$current === void 0 ? void 0 : _tfootRef$current.clientHeight) || 0;
226
227
  if (props.sticky) {
227
- context.theadAndTfootHeight = tfootHeight;
228
+ context.tfootHeight = tfootHeight;
228
229
  } else {
229
- context.theadAndTfootHeight = theadHeight + tfootHeight;
230
+ context.theadHeight = theadHeight;
231
+ context.tfootHeight = tfootHeight;
230
232
  }
231
233
  });
232
234
  useEffect(function () {
@@ -262,7 +264,8 @@ export default (function (props) {
262
264
  innerRef: tbodyRef,
263
265
  scrollLeft: props.scrollLeft,
264
266
  isRtl: isRtl,
265
- theadAndTfootHeight: context.theadAndTfootHeight
267
+ theadHeight: context.theadHeight,
268
+ tfootHeight: context.tfootHeight
266
269
  });
267
270
  var syncHeaderScroll = usePersistFn(function (left) {
268
271
  var _tableRef$current;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sheinx/base",
3
- "version": "3.7.7-beta.6",
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.6",
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"