@sheinx/base 3.6.0-beta.7 → 3.6.0-beta.9

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 (63) hide show
  1. package/cjs/alert/alert.js +1 -1
  2. package/cjs/alert/alert.type.d.ts +1 -1
  3. package/cjs/alert/alert.type.d.ts.map +1 -1
  4. package/cjs/avatar/group.d.ts.map +1 -1
  5. package/cjs/avatar/group.js +8 -5
  6. package/cjs/form/form-field-context.js +2 -1
  7. package/cjs/form/form-field.d.ts.map +1 -1
  8. package/cjs/form/form-field.js +8 -1
  9. package/cjs/form/form-item.d.ts.map +1 -1
  10. package/cjs/form/form-item.js +19 -6
  11. package/cjs/form/form-item.type.d.ts +3 -0
  12. package/cjs/form/form-item.type.d.ts.map +1 -1
  13. package/cjs/icons/icons.d.ts.map +1 -1
  14. package/cjs/icons/icons.js +109 -102
  15. package/cjs/input/simple-input.d.ts +4 -1
  16. package/cjs/input/simple-input.d.ts.map +1 -1
  17. package/cjs/input/simple-input.js +1 -0
  18. package/cjs/input/use-input-common.d.ts.map +1 -1
  19. package/cjs/input/use-input-common.js +4 -1
  20. package/cjs/menu/item.js +1 -1
  21. package/cjs/popover/popover.d.ts.map +1 -1
  22. package/cjs/popover/popover.js +3 -1
  23. package/cjs/popover/popover.type.d.ts +9 -0
  24. package/cjs/popover/popover.type.d.ts.map +1 -1
  25. package/cjs/progress/circle.d.ts.map +1 -1
  26. package/cjs/progress/circle.js +0 -5
  27. package/cjs/spin/spin.d.ts.map +1 -1
  28. package/cjs/spin/spin.js +9 -9
  29. package/cjs/transfer/transfer-list.d.ts.map +1 -1
  30. package/cjs/transfer/transfer-list.js +24 -2
  31. package/cjs/transfer/transfer.js +2 -2
  32. package/esm/alert/alert.js +1 -1
  33. package/esm/alert/alert.type.d.ts +1 -1
  34. package/esm/alert/alert.type.d.ts.map +1 -1
  35. package/esm/avatar/group.d.ts.map +1 -1
  36. package/esm/avatar/group.js +8 -5
  37. package/esm/form/form-field-context.js +2 -1
  38. package/esm/form/form-field.d.ts.map +1 -1
  39. package/esm/form/form-field.js +9 -2
  40. package/esm/form/form-item.d.ts.map +1 -1
  41. package/esm/form/form-item.js +19 -6
  42. package/esm/form/form-item.type.d.ts +3 -0
  43. package/esm/form/form-item.type.d.ts.map +1 -1
  44. package/esm/icons/icons.d.ts.map +1 -1
  45. package/esm/icons/icons.js +109 -102
  46. package/esm/input/simple-input.d.ts +4 -1
  47. package/esm/input/simple-input.d.ts.map +1 -1
  48. package/esm/input/simple-input.js +1 -0
  49. package/esm/input/use-input-common.d.ts.map +1 -1
  50. package/esm/input/use-input-common.js +4 -1
  51. package/esm/menu/item.js +1 -1
  52. package/esm/popover/popover.d.ts.map +1 -1
  53. package/esm/popover/popover.js +3 -1
  54. package/esm/popover/popover.type.d.ts +9 -0
  55. package/esm/popover/popover.type.d.ts.map +1 -1
  56. package/esm/progress/circle.d.ts.map +1 -1
  57. package/esm/progress/circle.js +0 -5
  58. package/esm/spin/spin.d.ts.map +1 -1
  59. package/esm/spin/spin.js +9 -9
  60. package/esm/transfer/transfer-list.d.ts.map +1 -1
  61. package/esm/transfer/transfer-list.js +24 -2
  62. package/esm/transfer/transfer.js +2 -2
  63. package/package.json +2 -2
@@ -1,9 +1,16 @@
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
2
  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; }
3
3
  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; }
4
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
5
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
6
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
7
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
8
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
9
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
4
10
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
11
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
12
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
13
+ import { useLayoutEffect, useRef, useState } from 'react';
7
14
  import classNames from 'classnames';
8
15
  import { util } from '@sheinx/hooks';
9
16
  import { getLocale, useConfig } from "../config";
@@ -30,7 +37,7 @@ var TransferList = function TransferList(props) {
30
37
  listStyle = props.listStyle,
31
38
  listClassName = props.listClassName,
32
39
  _props$listHeight = props.listHeight,
33
- listHeight = _props$listHeight === void 0 ? 180 : _props$listHeight,
40
+ listHeightProp = _props$listHeight === void 0 ? 180 : _props$listHeight,
34
41
  lineHeightProp = props.lineHeight,
35
42
  listType = props.listType,
36
43
  _props$rowsInView = props.rowsInView,
@@ -55,9 +62,23 @@ var TransferList = function TransferList(props) {
55
62
  var styles = (jssStyle === null || jssStyle === void 0 || (_jssStyle$transfer = jssStyle.transfer) === null || _jssStyle$transfer === void 0 ? void 0 : _jssStyle$transfer.call(jssStyle)) || {};
56
63
  var rootClass = classNames(styles.view, _defineProperty(_defineProperty({}, styles.source, listType === 'source'), styles.target, listType === 'target'));
57
64
  var listClass = classNames(styles.list, listClassName);
65
+ var _useState = useState(0),
66
+ _useState2 = _slicedToArray(_useState, 2),
67
+ addonHeight = _useState2[0],
68
+ setAddonHeight = _useState2[1];
69
+ var listContainerRef = useRef(null);
70
+ useLayoutEffect(function () {
71
+ if (!listContainerRef.current) return;
72
+ var $list = listContainerRef.current.querySelector(".".concat(styles.list));
73
+ var containerBottom = listContainerRef.current.getBoundingClientRect().bottom;
74
+ var listBottom = ($list === null || $list === void 0 ? void 0 : $list.getBoundingClientRect().bottom) || containerBottom;
75
+ if (containerBottom - listBottom > 1) {
76
+ setAddonHeight(containerBottom - listBottom - 1);
77
+ }
78
+ }, []);
79
+ var listHeight = listHeightProp + addonHeight;
58
80
  var getLineHeight = function getLineHeight() {
59
81
  if (lineHeightProp) {
60
- // console.log('lineHeightProp', lineHeightProp);
61
82
  return lineHeightProp;
62
83
  }
63
84
  if (size === 'small') {
@@ -195,6 +216,7 @@ var TransferList = function TransferList(props) {
195
216
  };
196
217
  return /*#__PURE__*/_jsxs("div", {
197
218
  className: rootClass,
219
+ ref: listContainerRef,
198
220
  children: [renderHeader(), /*#__PURE__*/_jsxs(Spin, {
199
221
  className: styles.spinContainer,
200
222
  jssStyle: jssStyle,
@@ -165,10 +165,10 @@ var Transfer = function Transfer(props) {
165
165
  };
166
166
  var renderSourceList = useMemo(function () {
167
167
  return renderList('source');
168
- }, [source, size, filterSourceText, sourceSelectedKeys, renderFilter]);
168
+ }, [source, size, filterSourceText, sourceSelectedKeys, renderFilter, children]);
169
169
  var renderTargetList = useMemo(function () {
170
170
  return renderList('target');
171
- }, [target, size, filterTargetText, targetSelectedKeys, renderFilter]);
171
+ }, [target, size, filterTargetText, targetSelectedKeys, renderFilter, children]);
172
172
  var _useContext = useContext(FormFieldContext),
173
173
  fieldId = _useContext.fieldId;
174
174
  return /*#__PURE__*/_jsxs("div", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sheinx/base",
3
- "version": "3.6.0-beta.7",
3
+ "version": "3.6.0-beta.9",
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.6.0-beta.7",
13
+ "@sheinx/hooks": "3.6.0-beta.9",
14
14
  "immer": "^10.0.0",
15
15
  "classnames": "^2.0.0",
16
16
  "@shined/reactive": "^0.1.3-alpha.0"