@sheinx/base 3.2.2-beta.1 → 3.2.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.
Files changed (39) hide show
  1. package/cjs/checkbox/use-checkbox-inputable.d.ts +1 -1
  2. package/cjs/config/locale/en_US.d.ts +0 -1
  3. package/cjs/config/locale/en_US.d.ts.map +1 -1
  4. package/cjs/config/locale/en_US.js +0 -1
  5. package/cjs/config/locale/zh-CN.d.ts +0 -1
  6. package/cjs/config/locale/zh-CN.d.ts.map +1 -1
  7. package/cjs/config/locale/zh-CN.js +0 -1
  8. package/cjs/icons/config.d.ts +1 -0
  9. package/cjs/icons/config.d.ts.map +1 -1
  10. package/cjs/input/input-number.d.ts.map +1 -1
  11. package/cjs/input/input-number.js +18 -9
  12. package/cjs/input/use-input-common.d.ts +2 -2
  13. package/cjs/modal/modal-content.js +1 -1
  14. package/cjs/table/table.d.ts.map +1 -1
  15. package/cjs/table/table.js +8 -0
  16. package/cjs/table/tr.js +2 -2
  17. package/cjs/virtual-scroll/scroll.d.ts +1 -0
  18. package/cjs/virtual-scroll/scroll.d.ts.map +1 -1
  19. package/cjs/virtual-scroll/scroll.js +8 -5
  20. package/esm/checkbox/use-checkbox-inputable.d.ts +1 -1
  21. package/esm/config/locale/en_US.d.ts +0 -1
  22. package/esm/config/locale/en_US.d.ts.map +1 -1
  23. package/esm/config/locale/en_US.js +0 -1
  24. package/esm/config/locale/zh-CN.d.ts +0 -1
  25. package/esm/config/locale/zh-CN.d.ts.map +1 -1
  26. package/esm/config/locale/zh-CN.js +0 -1
  27. package/esm/icons/config.d.ts +1 -0
  28. package/esm/icons/config.d.ts.map +1 -1
  29. package/esm/input/input-number.d.ts.map +1 -1
  30. package/esm/input/input-number.js +18 -9
  31. package/esm/input/use-input-common.d.ts +2 -2
  32. package/esm/modal/modal-content.js +1 -1
  33. package/esm/table/table.d.ts.map +1 -1
  34. package/esm/table/table.js +8 -0
  35. package/esm/table/tr.js +2 -2
  36. package/esm/virtual-scroll/scroll.d.ts +1 -0
  37. package/esm/virtual-scroll/scroll.d.ts.map +1 -1
  38. package/esm/virtual-scroll/scroll.js +8 -5
  39. package/package.json +2 -2
@@ -1,5 +1,5 @@
1
1
  import { CheckboxProps } from './checkbox.type';
2
- declare const useCheckboxInputable: <T>(props: Pick<CheckboxProps<T>, "onChange" | "value" | "checked" | "inputable">) => {
2
+ declare const useCheckboxInputable: <T>(props: Pick<CheckboxProps<T>, "value" | "onChange" | "checked" | "inputable">) => {
3
3
  checked: boolean | "indeterminate" | ((d: T) => boolean | "indeterminate") | undefined;
4
4
  onInputableCheckboxChange: (c: boolean) => void;
5
5
  onInputChange: (value?: string) => void;
@@ -30,7 +30,6 @@ declare const _default: {
30
30
  short: string[];
31
31
  long: string[];
32
32
  };
33
- pickerTitle: string[];
34
33
  timeOfDayValues: string[];
35
34
  ok: string;
36
35
  cancel: string;
@@ -1 +1 @@
1
- {"version":3,"file":"en_US.d.ts","sourceRoot":"","sources":["en_US.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wBAyFE"}
1
+ {"version":3,"file":"en_US.d.ts","sourceRoot":"","sources":["en_US.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wBAuFE"}
@@ -36,7 +36,6 @@ var _default = exports.default = {
36
36
  short: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
37
37
  long: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
38
38
  },
39
- pickerTitle: ['Start Time', 'End Time'],
40
39
  timeOfDayValues: ['a.m.', 'p.m.'],
41
40
  ok: 'Ok',
42
41
  cancel: 'Cancel',
@@ -30,7 +30,6 @@ declare const _default: {
30
30
  short: string[];
31
31
  long: string[];
32
32
  };
33
- pickerTitle: string[];
34
33
  timeOfDayValues: string[];
35
34
  ok: string;
36
35
  cancel: string;
@@ -1 +1 @@
1
- {"version":3,"file":"zh-CN.d.ts","sourceRoot":"","sources":["zh-CN.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wBA0FE"}
1
+ {"version":3,"file":"zh-CN.d.ts","sourceRoot":"","sources":["zh-CN.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wBAwFE"}
@@ -36,7 +36,6 @@ var _default = exports.default = {
36
36
  short: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
37
37
  long: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月']
38
38
  },
39
- pickerTitle: ['开始时间', '结束时间'],
40
39
  timeOfDayValues: ['上午', '下午'],
41
40
  ok: '确定',
42
41
  cancel: '取消',
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  declare const config: {
2
3
  alert: {
3
4
  Close: JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["config.tsx"],"names":[],"mappings":"AACA,QAAA,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwIX,CAAC;AAEF,KAAK,WAAW,CAAC,CAAC,IAAI;KACnB,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAC/B,CAAC;AACF,KAAK,cAAc,GAAG,WAAW,CAAC,OAAO,MAAM,CAAC,CAAC;AAGjD,eAAO,MAAM,QAAQ,cAAe,cAAc,SAYjD,CAAC;AAEF,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["config.tsx"],"names":[],"mappings":";AACA,QAAA,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwIX,CAAC;AAEF,KAAK,WAAW,CAAC,CAAC,IAAI;KACnB,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAC/B,CAAC;AACF,KAAK,cAAc,GAAG,WAAW,CAAC,OAAO,MAAM,CAAC,CAAC;AAGjD,eAAO,MAAM,QAAQ,cAAe,cAAc,SAYjD,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"input-number.d.ts","sourceRoot":"","sources":["input-number.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;;AAgFvD,wBAAuC"}
1
+ {"version":3,"file":"input-number.d.ts","sourceRoot":"","sources":["input-number.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;;AA4FvD,wBAAuC"}
@@ -12,7 +12,7 @@ var _hooks = require("@sheinx/hooks");
12
12
  var _classnames = _interopRequireDefault(require("classnames"));
13
13
  var _useInputCommon = _interopRequireDefault(require("./use-input-common"));
14
14
  var _jsxRuntime = require("react/jsx-runtime");
15
- var _excluded = ["jssStyle", "hideArrow"],
15
+ var _excluded = ["jssStyle", "hideArrow", "numType", "integerLimit", "digits", "min", "max", "step", "allowNull"],
16
16
  _excluded2 = ["onMinus", "onPlus"];
17
17
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
18
18
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
@@ -27,18 +27,25 @@ var InputNumber = function InputNumber(props) {
27
27
  var commonProps = (0, _useInputCommon.default)(props);
28
28
  var jssStyle = commonProps.jssStyle,
29
29
  hideArrow = commonProps.hideArrow,
30
+ numType = commonProps.numType,
31
+ integerLimit = commonProps.integerLimit,
32
+ digits = commonProps.digits,
33
+ min = commonProps.min,
34
+ max = commonProps.max,
35
+ step = commonProps.step,
36
+ allowNull = commonProps.allowNull,
30
37
  restProps = _objectWithoutProperties(commonProps, _excluded);
31
38
  var inputStyle = jssStyle === null || jssStyle === void 0 || (_jssStyle$input = jssStyle.input) === null || _jssStyle$input === void 0 ? void 0 : _jssStyle$input.call(jssStyle);
32
39
  var numberFormatParams = {
33
40
  onBlur: restProps.onBlur,
34
41
  onFocus: restProps.onFocus,
35
- digits: restProps.digits,
36
- integerLimit: restProps.integerLimit,
37
- numType: restProps.numType,
38
- min: restProps.min,
39
- max: restProps.max,
40
- step: restProps.step,
41
- allowNull: restProps.allowNull
42
+ digits: digits,
43
+ integerLimit: integerLimit,
44
+ numType: numType,
45
+ min: min,
46
+ max: max,
47
+ step: step,
48
+ allowNull: allowNull
42
49
  };
43
50
  var _useInputNumber = (0, _hooks.useInputNumber)(_objectSpread({
44
51
  value: commonProps.value,
@@ -48,7 +55,9 @@ var InputNumber = function InputNumber(props) {
48
55
  onMinus = _useInputNumber.onMinus,
49
56
  onPlus = _useInputNumber.onPlus,
50
57
  numberFormatProps = _objectWithoutProperties(_useInputNumber, _excluded2);
51
- var forwardProps = _hooks.util.removeProps(commonProps, _objectSpread({}, numberFormatParams));
58
+ var forwardProps = _hooks.util.removeProps(commonProps, _objectSpread(_objectSpread({}, numberFormatParams), {}, {
59
+ hideArrow: hideArrow
60
+ }));
52
61
  var addEnd = hideArrow ? null : /*#__PURE__*/(0, _jsxRuntime.jsx)(_react.default.Fragment, {
53
62
  children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
54
63
  className: inputStyle === null || inputStyle === void 0 ? void 0 : inputStyle.numberStep,
@@ -1,12 +1,12 @@
1
1
  import React from 'react';
2
2
  import { InputCommonProps } from './input.type';
3
- declare const useInputCommon: <Value, Props extends InputCommonProps<Value>>(props0: Props) => Omit<Props, "width" | "onChange" | "value" | "delay" | "defaultValue" | "beforeChange" | "disabled" | "error" | "status" | "style" | "size" | "onBlur" | "clearable" | "innerTitle" | "placeTitle" | "info" | "popover" | "tip" | "popoverProps" | "suffix" | "forwardRef" | "forwardedRef" | "htmlName" | "clearToUndefined"> & {
3
+ declare const useInputCommon: <Value, Props extends InputCommonProps<Value>>(props0: Props) => Omit<Props, "error" | "info" | "style" | "status" | "size" | "innerTitle" | "placeTitle" | "tip" | "value" | "onChange" | "disabled" | "width" | "defaultValue" | "popover" | "beforeChange" | "delay" | "onBlur" | "clearable" | "forwardedRef" | "popoverProps" | "suffix" | "forwardRef" | "htmlName" | "clearToUndefined"> & {
4
4
  name: string | undefined;
5
5
  style: React.CSSProperties;
6
6
  suffix: JSX.Element;
7
7
  status: "error" | undefined;
8
8
  disabled: boolean | undefined;
9
- size: "small" | "default" | "large" | undefined;
9
+ size: "small" | "large" | "default" | undefined;
10
10
  rootRef: React.RefObject<HTMLElement>;
11
11
  inputRef: React.Ref<HTMLInputElement> | undefined;
12
12
  renderInput: (el: React.ReactElement<any, string | React.JSXElementConstructor<any>>) => JSX.Element;
@@ -92,7 +92,7 @@ var Modal = function Modal(props) {
92
92
  hasMask = true;
93
93
  }
94
94
  };
95
- handleMaskVisible();
95
+ (0, _react.useEffect)(handleMaskVisible, [visible]);
96
96
  var updateOrigin = function updateOrigin() {
97
97
  // 更新transform-origin
98
98
  if (props.position || props.moveable || !props.zoom) return;
@@ -1 +1 @@
1
- {"version":3,"file":"table.d.ts","sourceRoot":"","sources":["table.tsx"],"names":[],"mappings":";AAsBA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;;AAyB1C,wBAycE"}
1
+ {"version":3,"file":"table.d.ts","sourceRoot":"","sources":["table.tsx"],"names":[],"mappings":";AAsBA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;;AAyB1C,wBAmdE"}
@@ -68,6 +68,10 @@ var _default = exports.default = function _default(props) {
68
68
  var tfootRef = (0, _react.useRef)(null);
69
69
  var scrollRef = (0, _react.useRef)(null);
70
70
  var tableRef = (0, _react.useRef)(null);
71
+ var _useRef = (0, _react.useRef)({
72
+ emptyHeight: 0
73
+ }),
74
+ context = _useRef.current;
71
75
  var virtual = ((_props$data = props.data) === null || _props$data === void 0 ? void 0 : _props$data.length) && props.rowsInView !== 0 && (!!props.virtual || props.fixed === 'both' || props.fixed === 'y' || props.fixed === 'auto');
72
76
 
73
77
  // 虚拟列表高度另外计算
@@ -237,6 +241,9 @@ var _default = exports.default = function _default(props) {
237
241
  if ((_props$data2 = props.data) !== null && _props$data2 !== void 0 && _props$data2.length) return null;
238
242
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
239
243
  className: tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.emptyWrapper,
244
+ ref: function ref(el) {
245
+ context.emptyHeight = (el === null || el === void 0 ? void 0 : el.clientHeight) || 0;
246
+ },
240
247
  children: props.empty || /*#__PURE__*/(0, _jsxRuntime.jsx)(_empty.default, {
241
248
  jssStyle: props.jssStyle
242
249
  })
@@ -353,6 +360,7 @@ var _default = exports.default = function _default(props) {
353
360
  scrollWidth: width || 1,
354
361
  scrollHeight: virtual ? virtualInfo.scrollHeight : tbodyHeight,
355
362
  onScroll: handleVirtualScroll,
363
+ defaultHeight: context.emptyHeight,
356
364
  children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("table", {
357
365
  style: {
358
366
  width: width,
package/cjs/table/tr.js CHANGED
@@ -68,8 +68,8 @@ var Tr = function Tr(props) {
68
68
  };
69
69
  (0, _react.useEffect)(function () {
70
70
  if (props.setRowHeight && trRef.current) {
71
- var expandHeight = expandRef.current ? expandRef.current.offsetHeight : 0;
72
- props.setRowHeight(props.rowIndex, trRef.current.offsetHeight + expandHeight);
71
+ var expandHeight = expandRef.current ? expandRef.current.getBoundingClientRect().height : 0;
72
+ props.setRowHeight(props.rowIndex, trRef.current.getBoundingClientRect().height + expandHeight);
73
73
  }
74
74
  }, [props.expanded, props.rowIndex, props.bodyScrollWidth, props.resizeFlag]);
75
75
  var renderTreeExpand = function renderTreeExpand(content) {
@@ -18,6 +18,7 @@ interface scrollProps {
18
18
  style?: React.CSSProperties;
19
19
  scrollerStyle?: React.CSSProperties;
20
20
  onMouseMove?: () => void;
21
+ defaultHeight?: number;
21
22
  }
22
23
  declare const Scroll: (props: scrollProps) => JSX.Element;
23
24
  export default Scroll;
@@ -1 +1 @@
1
- {"version":3,"file":"scroll.d.ts","sourceRoot":"","sources":["scroll.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiB,MAAM,OAAO,CAAC;AAItC,UAAU,WAAW;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,aAAa,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACpC,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IAC7C,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE;QAChB,UAAU,EAAE,MAAM,CAAC;QACnB,SAAS,EAAE,MAAM,CAAC;QAClB,CAAC,EAAE,MAAM,CAAC;QACV,CAAC,EAAE,MAAM,CAAC;QACV,QAAQ,EAAE,OAAO,CAAC;QAClB,MAAM,EAAE,MAAM,CAAC;QACf,KAAK,EAAE,MAAM,CAAC;KACf,KAAK,IAAI,CAAC;IACX,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,aAAa,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACpC,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;CAC1B;AAED,QAAA,MAAM,MAAM,UAAW,WAAW,gBA2FjC,CAAC;AAEF,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"scroll.d.ts","sourceRoot":"","sources":["scroll.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiB,MAAM,OAAO,CAAC;AAItC,UAAU,WAAW;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,aAAa,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACpC,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IAC7C,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE;QAChB,UAAU,EAAE,MAAM,CAAC;QACnB,SAAS,EAAE,MAAM,CAAC;QAClB,CAAC,EAAE,MAAM,CAAC;QACV,CAAC,EAAE,MAAM,CAAC;QACV,QAAQ,EAAE,OAAO,CAAC;QAClB,MAAM,EAAE,MAAM,CAAC;QACf,KAAK,EAAE,MAAM,CAAC;KACf,KAAK,IAAI,CAAC;IACX,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,aAAa,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACpC,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,QAAA,MAAM,MAAM,UAAW,WAAW,gBA2FjC,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -23,17 +23,20 @@ var Scroll = function Scroll(props) {
23
23
  isMouseDown: false
24
24
  }),
25
25
  context = _useRef.current;
26
+ var _props$scrollHeight = props.scrollHeight,
27
+ scrollHeight = _props$scrollHeight === void 0 ? 0 : _props$scrollHeight,
28
+ _props$scrollWidth = props.scrollWidth,
29
+ scrollWidth = _props$scrollWidth === void 0 ? 0 : _props$scrollWidth,
30
+ _props$defaultHeight = props.defaultHeight,
31
+ defaultHeight = _props$defaultHeight === void 0 ? 0 : _props$defaultHeight;
26
32
  var _useResize = (0, _hooks.useResize)({
27
33
  targetRef: containerRef
28
34
  }),
29
35
  width = _useResize.width,
30
- height = _useResize.height;
36
+ h = _useResize.height;
37
+ var height = h || defaultHeight;
31
38
  var config = (0, _config.useConfig)();
32
39
  var isRtl = config.direction === 'rtl';
33
- var _props$scrollHeight = props.scrollHeight,
34
- scrollHeight = _props$scrollHeight === void 0 ? 0 : _props$scrollHeight,
35
- _props$scrollWidth = props.scrollWidth,
36
- scrollWidth = _props$scrollWidth === void 0 ? 0 : _props$scrollWidth;
37
40
  var scrollerStyle = props.scrollerStyle || {
38
41
  height: '100%',
39
42
  width: '100%',
@@ -1,5 +1,5 @@
1
1
  import { CheckboxProps } from './checkbox.type';
2
- declare const useCheckboxInputable: <T>(props: Pick<CheckboxProps<T>, "onChange" | "value" | "checked" | "inputable">) => {
2
+ declare const useCheckboxInputable: <T>(props: Pick<CheckboxProps<T>, "value" | "onChange" | "checked" | "inputable">) => {
3
3
  checked: boolean | "indeterminate" | ((d: T) => boolean | "indeterminate") | undefined;
4
4
  onInputableCheckboxChange: (c: boolean) => void;
5
5
  onInputChange: (value?: string) => void;
@@ -30,7 +30,6 @@ declare const _default: {
30
30
  short: string[];
31
31
  long: string[];
32
32
  };
33
- pickerTitle: string[];
34
33
  timeOfDayValues: string[];
35
34
  ok: string;
36
35
  cancel: string;
@@ -1 +1 @@
1
- {"version":3,"file":"en_US.d.ts","sourceRoot":"","sources":["en_US.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wBAyFE"}
1
+ {"version":3,"file":"en_US.d.ts","sourceRoot":"","sources":["en_US.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wBAuFE"}
@@ -30,7 +30,6 @@ export default {
30
30
  short: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
31
31
  long: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
32
32
  },
33
- pickerTitle: ['Start Time', 'End Time'],
34
33
  timeOfDayValues: ['a.m.', 'p.m.'],
35
34
  ok: 'Ok',
36
35
  cancel: 'Cancel',
@@ -30,7 +30,6 @@ declare const _default: {
30
30
  short: string[];
31
31
  long: string[];
32
32
  };
33
- pickerTitle: string[];
34
33
  timeOfDayValues: string[];
35
34
  ok: string;
36
35
  cancel: string;
@@ -1 +1 @@
1
- {"version":3,"file":"zh-CN.d.ts","sourceRoot":"","sources":["zh-CN.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wBA0FE"}
1
+ {"version":3,"file":"zh-CN.d.ts","sourceRoot":"","sources":["zh-CN.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wBAwFE"}
@@ -30,7 +30,6 @@ export default {
30
30
  short: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
31
31
  long: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月']
32
32
  },
33
- pickerTitle: ['开始时间', '结束时间'],
34
33
  timeOfDayValues: ['上午', '下午'],
35
34
  ok: '确定',
36
35
  cancel: '取消',
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  declare const config: {
2
3
  alert: {
3
4
  Close: JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["config.tsx"],"names":[],"mappings":"AACA,QAAA,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwIX,CAAC;AAEF,KAAK,WAAW,CAAC,CAAC,IAAI;KACnB,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAC/B,CAAC;AACF,KAAK,cAAc,GAAG,WAAW,CAAC,OAAO,MAAM,CAAC,CAAC;AAGjD,eAAO,MAAM,QAAQ,cAAe,cAAc,SAYjD,CAAC;AAEF,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["config.tsx"],"names":[],"mappings":";AACA,QAAA,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwIX,CAAC;AAEF,KAAK,WAAW,CAAC,CAAC,IAAI;KACnB,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAC/B,CAAC;AACF,KAAK,cAAc,GAAG,WAAW,CAAC,OAAO,MAAM,CAAC,CAAC;AAGjD,eAAO,MAAM,QAAQ,cAAe,cAAc,SAYjD,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"input-number.d.ts","sourceRoot":"","sources":["input-number.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;;AAgFvD,wBAAuC"}
1
+ {"version":3,"file":"input-number.d.ts","sourceRoot":"","sources":["input-number.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;;AA4FvD,wBAAuC"}
@@ -1,5 +1,5 @@
1
1
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
- var _excluded = ["jssStyle", "hideArrow"],
2
+ var _excluded = ["jssStyle", "hideArrow", "numType", "integerLimit", "digits", "min", "max", "step", "allowNull"],
3
3
  _excluded2 = ["onMinus", "onPlus"];
4
4
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
5
5
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
@@ -21,18 +21,25 @@ var InputNumber = function InputNumber(props) {
21
21
  var commonProps = useInputCommon(props);
22
22
  var jssStyle = commonProps.jssStyle,
23
23
  hideArrow = commonProps.hideArrow,
24
+ numType = commonProps.numType,
25
+ integerLimit = commonProps.integerLimit,
26
+ digits = commonProps.digits,
27
+ min = commonProps.min,
28
+ max = commonProps.max,
29
+ step = commonProps.step,
30
+ allowNull = commonProps.allowNull,
24
31
  restProps = _objectWithoutProperties(commonProps, _excluded);
25
32
  var inputStyle = jssStyle === null || jssStyle === void 0 || (_jssStyle$input = jssStyle.input) === null || _jssStyle$input === void 0 ? void 0 : _jssStyle$input.call(jssStyle);
26
33
  var numberFormatParams = {
27
34
  onBlur: restProps.onBlur,
28
35
  onFocus: restProps.onFocus,
29
- digits: restProps.digits,
30
- integerLimit: restProps.integerLimit,
31
- numType: restProps.numType,
32
- min: restProps.min,
33
- max: restProps.max,
34
- step: restProps.step,
35
- allowNull: restProps.allowNull
36
+ digits: digits,
37
+ integerLimit: integerLimit,
38
+ numType: numType,
39
+ min: min,
40
+ max: max,
41
+ step: step,
42
+ allowNull: allowNull
36
43
  };
37
44
  var _useInputNumber = useInputNumber(_objectSpread({
38
45
  value: commonProps.value,
@@ -42,7 +49,9 @@ var InputNumber = function InputNumber(props) {
42
49
  onMinus = _useInputNumber.onMinus,
43
50
  onPlus = _useInputNumber.onPlus,
44
51
  numberFormatProps = _objectWithoutProperties(_useInputNumber, _excluded2);
45
- var forwardProps = util.removeProps(commonProps, _objectSpread({}, numberFormatParams));
52
+ var forwardProps = util.removeProps(commonProps, _objectSpread(_objectSpread({}, numberFormatParams), {}, {
53
+ hideArrow: hideArrow
54
+ }));
46
55
  var addEnd = hideArrow ? null : /*#__PURE__*/_jsx(React.Fragment, {
47
56
  children: /*#__PURE__*/_jsxs("div", {
48
57
  className: inputStyle === null || inputStyle === void 0 ? void 0 : inputStyle.numberStep,
@@ -1,12 +1,12 @@
1
1
  import React from 'react';
2
2
  import { InputCommonProps } from './input.type';
3
- declare const useInputCommon: <Value, Props extends InputCommonProps<Value>>(props0: Props) => Omit<Props, "width" | "onChange" | "value" | "delay" | "defaultValue" | "beforeChange" | "disabled" | "error" | "status" | "style" | "size" | "onBlur" | "clearable" | "innerTitle" | "placeTitle" | "info" | "popover" | "tip" | "popoverProps" | "suffix" | "forwardRef" | "forwardedRef" | "htmlName" | "clearToUndefined"> & {
3
+ declare const useInputCommon: <Value, Props extends InputCommonProps<Value>>(props0: Props) => Omit<Props, "error" | "info" | "style" | "status" | "size" | "innerTitle" | "placeTitle" | "tip" | "value" | "onChange" | "disabled" | "width" | "defaultValue" | "popover" | "beforeChange" | "delay" | "onBlur" | "clearable" | "forwardedRef" | "popoverProps" | "suffix" | "forwardRef" | "htmlName" | "clearToUndefined"> & {
4
4
  name: string | undefined;
5
5
  style: React.CSSProperties;
6
6
  suffix: JSX.Element;
7
7
  status: "error" | undefined;
8
8
  disabled: boolean | undefined;
9
- size: "small" | "default" | "large" | undefined;
9
+ size: "small" | "large" | "default" | undefined;
10
10
  rootRef: React.RefObject<HTMLElement>;
11
11
  inputRef: React.Ref<HTMLInputElement> | undefined;
12
12
  renderInput: (el: React.ReactElement<any, string | React.JSXElementConstructor<any>>) => JSX.Element;
@@ -86,7 +86,7 @@ var Modal = function Modal(props) {
86
86
  hasMask = true;
87
87
  }
88
88
  };
89
- handleMaskVisible();
89
+ useEffect(handleMaskVisible, [visible]);
90
90
  var updateOrigin = function updateOrigin() {
91
91
  // 更新transform-origin
92
92
  if (props.position || props.moveable || !props.zoom) return;
@@ -1 +1 @@
1
- {"version":3,"file":"table.d.ts","sourceRoot":"","sources":["table.tsx"],"names":[],"mappings":";AAsBA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;;AAyB1C,wBAycE"}
1
+ {"version":3,"file":"table.d.ts","sourceRoot":"","sources":["table.tsx"],"names":[],"mappings":";AAsBA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;;AAyB1C,wBAmdE"}
@@ -61,6 +61,10 @@ export default (function (props) {
61
61
  var tfootRef = useRef(null);
62
62
  var scrollRef = useRef(null);
63
63
  var tableRef = useRef(null);
64
+ var _useRef = useRef({
65
+ emptyHeight: 0
66
+ }),
67
+ context = _useRef.current;
64
68
  var virtual = ((_props$data = props.data) === null || _props$data === void 0 ? void 0 : _props$data.length) && props.rowsInView !== 0 && (!!props.virtual || props.fixed === 'both' || props.fixed === 'y' || props.fixed === 'auto');
65
69
 
66
70
  // 虚拟列表高度另外计算
@@ -230,6 +234,9 @@ export default (function (props) {
230
234
  if ((_props$data2 = props.data) !== null && _props$data2 !== void 0 && _props$data2.length) return null;
231
235
  return /*#__PURE__*/_jsx("div", {
232
236
  className: tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.emptyWrapper,
237
+ ref: function ref(el) {
238
+ context.emptyHeight = (el === null || el === void 0 ? void 0 : el.clientHeight) || 0;
239
+ },
233
240
  children: props.empty || /*#__PURE__*/_jsx(Empty, {
234
241
  jssStyle: props.jssStyle
235
242
  })
@@ -346,6 +353,7 @@ export default (function (props) {
346
353
  scrollWidth: width || 1,
347
354
  scrollHeight: virtual ? virtualInfo.scrollHeight : tbodyHeight,
348
355
  onScroll: handleVirtualScroll,
356
+ defaultHeight: context.emptyHeight,
349
357
  children: /*#__PURE__*/_jsxs("table", {
350
358
  style: {
351
359
  width: width,
package/esm/table/tr.js CHANGED
@@ -61,8 +61,8 @@ var Tr = function Tr(props) {
61
61
  };
62
62
  useEffect(function () {
63
63
  if (props.setRowHeight && trRef.current) {
64
- var expandHeight = expandRef.current ? expandRef.current.offsetHeight : 0;
65
- props.setRowHeight(props.rowIndex, trRef.current.offsetHeight + expandHeight);
64
+ var expandHeight = expandRef.current ? expandRef.current.getBoundingClientRect().height : 0;
65
+ props.setRowHeight(props.rowIndex, trRef.current.getBoundingClientRect().height + expandHeight);
66
66
  }
67
67
  }, [props.expanded, props.rowIndex, props.bodyScrollWidth, props.resizeFlag]);
68
68
  var renderTreeExpand = function renderTreeExpand(content) {
@@ -18,6 +18,7 @@ interface scrollProps {
18
18
  style?: React.CSSProperties;
19
19
  scrollerStyle?: React.CSSProperties;
20
20
  onMouseMove?: () => void;
21
+ defaultHeight?: number;
21
22
  }
22
23
  declare const Scroll: (props: scrollProps) => JSX.Element;
23
24
  export default Scroll;
@@ -1 +1 @@
1
- {"version":3,"file":"scroll.d.ts","sourceRoot":"","sources":["scroll.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiB,MAAM,OAAO,CAAC;AAItC,UAAU,WAAW;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,aAAa,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACpC,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IAC7C,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE;QAChB,UAAU,EAAE,MAAM,CAAC;QACnB,SAAS,EAAE,MAAM,CAAC;QAClB,CAAC,EAAE,MAAM,CAAC;QACV,CAAC,EAAE,MAAM,CAAC;QACV,QAAQ,EAAE,OAAO,CAAC;QAClB,MAAM,EAAE,MAAM,CAAC;QACf,KAAK,EAAE,MAAM,CAAC;KACf,KAAK,IAAI,CAAC;IACX,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,aAAa,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACpC,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;CAC1B;AAED,QAAA,MAAM,MAAM,UAAW,WAAW,gBA2FjC,CAAC;AAEF,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"scroll.d.ts","sourceRoot":"","sources":["scroll.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiB,MAAM,OAAO,CAAC;AAItC,UAAU,WAAW;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,aAAa,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACpC,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IAC7C,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE;QAChB,UAAU,EAAE,MAAM,CAAC;QACnB,SAAS,EAAE,MAAM,CAAC;QAClB,CAAC,EAAE,MAAM,CAAC;QACV,CAAC,EAAE,MAAM,CAAC;QACV,QAAQ,EAAE,OAAO,CAAC;QAClB,MAAM,EAAE,MAAM,CAAC;QACf,KAAK,EAAE,MAAM,CAAC;KACf,KAAK,IAAI,CAAC;IACX,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,aAAa,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACpC,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,QAAA,MAAM,MAAM,UAAW,WAAW,gBA2FjC,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -16,17 +16,20 @@ var Scroll = function Scroll(props) {
16
16
  isMouseDown: false
17
17
  }),
18
18
  context = _useRef.current;
19
+ var _props$scrollHeight = props.scrollHeight,
20
+ scrollHeight = _props$scrollHeight === void 0 ? 0 : _props$scrollHeight,
21
+ _props$scrollWidth = props.scrollWidth,
22
+ scrollWidth = _props$scrollWidth === void 0 ? 0 : _props$scrollWidth,
23
+ _props$defaultHeight = props.defaultHeight,
24
+ defaultHeight = _props$defaultHeight === void 0 ? 0 : _props$defaultHeight;
19
25
  var _useResize = useResize({
20
26
  targetRef: containerRef
21
27
  }),
22
28
  width = _useResize.width,
23
- height = _useResize.height;
29
+ h = _useResize.height;
30
+ var height = h || defaultHeight;
24
31
  var config = useConfig();
25
32
  var isRtl = config.direction === 'rtl';
26
- var _props$scrollHeight = props.scrollHeight,
27
- scrollHeight = _props$scrollHeight === void 0 ? 0 : _props$scrollHeight,
28
- _props$scrollWidth = props.scrollWidth,
29
- scrollWidth = _props$scrollWidth === void 0 ? 0 : _props$scrollWidth;
30
33
  var scrollerStyle = props.scrollerStyle || {
31
34
  height: '100%',
32
35
  width: '100%',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sheinx/base",
3
- "version": "3.2.2-beta.1",
3
+ "version": "3.2.2",
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.2.2-beta.1",
13
+ "@sheinx/hooks": "3.2.2",
14
14
  "immer": "^10.0.0",
15
15
  "classnames": "^2.0.0",
16
16
  "@shined/reactive": "^0.1.3-alpha.0"