shineout 3.0.0-rc.4 → 3.0.0-rc.6

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.
package/cjs/index.js CHANGED
@@ -481,5 +481,5 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
481
481
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
482
482
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
483
483
  var _default = exports.default = {
484
- version: '3.0.0-rc.4'
484
+ version: '3.0.0-rc.6'
485
485
  };
@@ -5,7 +5,7 @@ export declare const TRANSFORMS: {
5
5
  MozTransform: string;
6
6
  transform: string;
7
7
  };
8
- export declare function getTransformName(): "transform" | "msTransform" | "OTransform" | "webkitTransform" | "MozTransform";
8
+ export declare function getTransformName(): "transform" | "webkitTransform" | "msTransform" | "OTransform" | "MozTransform";
9
9
  export declare function has3d(): boolean;
10
10
  export declare const eventPassive: boolean | {
11
11
  passive: boolean;
package/dist/shineout.js CHANGED
@@ -11368,8 +11368,6 @@ var css_jss_esm_css = createCss();
11368
11368
  /* harmony default export */ var css_jss_esm = (css_jss_esm_css);
11369
11369
 
11370
11370
  ;// CONCATENATED MODULE: ../../node_modules/.pnpm/react-jss@10.9.2_react@18.2.0/node_modules/react-jss/dist/react-jss.esm.js
11371
- "use client";
11372
-
11373
11371
 
11374
11372
 
11375
11373
 
@@ -12022,7 +12020,7 @@ var handleStyle = function handleStyle(style) {
12022
12020
  };
12023
12021
  /* harmony default export */ var jss_style_handleStyle = (handleStyle);
12024
12022
  ;// CONCATENATED MODULE: ../shineout-style/src/version.ts
12025
- /* harmony default export */ var version = ('3.0.0-rc.4');
12023
+ /* harmony default export */ var version = ('3.0.0-rc.6');
12026
12024
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
12027
12025
 
12028
12026
 
@@ -31713,6 +31711,10 @@ var checkbox_Checkbox = function Checkbox(props) {
31713
31711
  inputable = props.inputable,
31714
31712
  rest = objectWithoutProperties_default()(props, checkbox_excluded);
31715
31713
  var checkboxStyle = jssStyle === null || jssStyle === void 0 || (_jssStyle$checkbox = jssStyle.checkbox) === null || _jssStyle$checkbox === void 0 ? void 0 : _jssStyle$checkbox.call(jssStyle);
31714
+ var disabled = props.disabled;
31715
+ if (htmlValue !== undefined && typeof disabled === 'function') {
31716
+ disabled = disabled(htmlValue);
31717
+ }
31716
31718
  var _useInputAble = useInputAble({
31717
31719
  value: valuePo,
31718
31720
  defaultValue: defaultValuePo,
@@ -31757,6 +31759,7 @@ var checkbox_Checkbox = function Checkbox(props) {
31757
31759
  return /*#__PURE__*/(0,jsx_runtime.jsx)(simple_checkbox, objectSpread2_default()(objectSpread2_default()({
31758
31760
  jssStyle: jssStyle
31759
31761
  }, rest), {}, {
31762
+ disabled: disabled,
31760
31763
  checked: getChecked(),
31761
31764
  onChange: handleChange,
31762
31765
  renderFooter: function renderFooter(c) {
@@ -35283,6 +35286,7 @@ var result_Result = function Result(props) {
35283
35286
  var renderMultipleResultMore = /*#__PURE__*/(0,jsx_runtime.jsx)(result_more, {
35284
35287
  keygen: keygen,
35285
35288
  classes: props.classes,
35289
+ jssStyle: props.jssStyle,
35286
35290
  data: result,
35287
35291
  size: size,
35288
35292
  more: moreNumber,
@@ -41826,6 +41830,10 @@ DrawerComp.Submit = src_modal_0.Submit;
41826
41830
 
41827
41831
 
41828
41832
 
41833
+ var Item_excluded = ["className"],
41834
+ Item_excluded2 = ["className"];
41835
+
41836
+
41829
41837
 
41830
41838
 
41831
41839
  var DefaultProps = {
@@ -41876,7 +41884,18 @@ var Item_Item = /*#__PURE__*/function (_React$PureComponent) {
41876
41884
  content = render_render(renderItem, data);
41877
41885
  }
41878
41886
  if ( /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.isValidElement)(content)) {
41879
- return /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.cloneElement)(content, Object.assign(props, content.props));
41887
+ var _ref = props,
41888
+ _ref$className = _ref.className,
41889
+ propsClassName = _ref$className === void 0 ? '' : _ref$className,
41890
+ otherProps = objectWithoutProperties_default()(_ref, Item_excluded);
41891
+ var _ref2 = content.props,
41892
+ _ref2$className = _ref2.className,
41893
+ contentPropsClassName = _ref2$className === void 0 ? '' : _ref2$className,
41894
+ otherContentProps = objectWithoutProperties_default()(_ref2, Item_excluded2);
41895
+ var className = classnames_default()(propsClassName, contentPropsClassName);
41896
+ return /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.cloneElement)(content, Object.assign(otherProps, otherContentProps, {
41897
+ className: className
41898
+ }));
41880
41899
  }
41881
41900
  return /*#__PURE__*/(0,jsx_runtime.jsx)("a", objectSpread2_default()(objectSpread2_default()({}, props), {}, {
41882
41901
  children: content
@@ -48924,6 +48943,9 @@ var usePagination = function usePagination(props) {
48924
48943
  _useState6 = slicedToArray_default()(_useState5, 2),
48925
48944
  pageSize = _useState6[0],
48926
48945
  setPageSize = _useState6[1];
48946
+ (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
48947
+ if (pageSizeProp !== pageSize) setPageSize(pageSizeProp);
48948
+ }, [pageSizeProp]);
48927
48949
  var handleChange = function handleChange(current, size) {
48928
48950
  setCurrent(current);
48929
48951
  setPageSize(size || pageSizeProp);
@@ -52250,28 +52272,29 @@ StepsComp.Step = StepsStep;
52250
52272
  var sticky_cssSupport = cssSupport;
52251
52273
  var supportSticky = sticky_cssSupport('position', 'sticky');
52252
52274
  var defaultZIndex = 900;
52253
- var getFirstScrollParent = function getFirstScrollParent(el) {
52254
- var parent = el.parentNode;
52255
- while (parent) {
52256
- if (parent === document.body || parent === document.documentElement) {
52257
- parent = document.body;
52258
- break;
52259
- }
52260
- var _window$getComputedSt = window.getComputedStyle(parent),
52261
- overflowY = _window$getComputedSt.overflowY;
52262
- if (overflowY === 'scroll' || overflowY === 'auto') {
52263
- break;
52264
- }
52265
- parent = parent.parentNode;
52266
- }
52267
- return parent;
52268
- };
52275
+
52276
+ // const getFirstScrollParent = (el: HTMLElement) => {
52277
+ // let parent = el.parentNode as HTMLElement;
52278
+ // while (parent) {
52279
+ // if (parent === document.body || parent === document.documentElement) {
52280
+ // parent = document.body;
52281
+ // break;
52282
+ // }
52283
+ // const { overflowY } = window.getComputedStyle(parent);
52284
+ // if (overflowY === 'scroll' || overflowY === 'auto') {
52285
+ // break;
52286
+ // }
52287
+ // parent = parent.parentNode as HTMLElement;
52288
+ // }
52289
+ // return parent;
52290
+ // };
52291
+
52269
52292
  var Sticky = function Sticky(props) {
52270
52293
  var _props$style;
52271
- var css = props.css,
52272
- children = props.children,
52294
+ var children = props.children,
52273
52295
  top = props.top,
52274
52296
  bottom = props.bottom;
52297
+ var css = props.css || props.target;
52275
52298
  var _useRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)({
52276
52299
  target: null,
52277
52300
  div: null,
@@ -52299,15 +52322,15 @@ var Sticky = function Sticky(props) {
52299
52322
  timer: 0
52300
52323
  });
52301
52324
  var getTarget = function getTarget() {
52302
- var target = props.target;
52303
- if (typeof props.target === 'string') {
52304
- target = document.querySelector(props.target);
52325
+ var scrollContainer = props.scrollContainer;
52326
+ if (typeof scrollContainer === 'string') {
52327
+ scrollContainer = document.querySelector(scrollContainer);
52305
52328
  }
52306
52329
  // 判断是否是dom元素
52307
- if (target && target.nodeType === 1) {
52308
- return target;
52330
+ if (scrollContainer && scrollContainer.nodeType === 1) {
52331
+ return scrollContainer;
52309
52332
  }
52310
- return getFirstScrollParent(elementRef.current);
52333
+ return document.body;
52311
52334
  };
52312
52335
  var updateStyle = usePersistFn(function () {
52313
52336
  if (context.div && !context.isTop && show) {
@@ -52403,7 +52426,7 @@ var Sticky = function Sticky(props) {
52403
52426
  };
52404
52427
  var createObserver = function createObserver() {
52405
52428
  var target = getTarget();
52406
- if (!context.div) {
52429
+ if (!context.div && target !== document.body) {
52407
52430
  context.div = document.createElement('div');
52408
52431
  context.div.style.position = 'relative';
52409
52432
  }
@@ -52411,18 +52434,21 @@ var Sticky = function Sticky(props) {
52411
52434
  forceRender();
52412
52435
  context.target = target;
52413
52436
  cleanEvents();
52414
- if (target === document.body) {
52415
- document.body.appendChild(context.div);
52416
- } else {
52417
- target.parentNode.insertBefore(context.div, target);
52418
- }
52419
- var _style4 = window.getComputedStyle(target);
52420
- if (_style4.position === 'absolute' || _style4.position === 'fixed') {
52421
- context.div.style.position = _style4.position;
52422
- context.div.style.top = _style4.top;
52423
- context.div.style.left = _style4.left;
52424
- context.div.style.right = _style4.right;
52425
- context.div.style.bottom = _style4.bottom;
52437
+ if (context.div) {
52438
+ // append div
52439
+ if (target === document.body) {
52440
+ document.body.appendChild(context.div);
52441
+ } else {
52442
+ target.parentNode.insertBefore(context.div, target);
52443
+ }
52444
+ var _style4 = window.getComputedStyle(target);
52445
+ if (_style4.position === 'absolute' || _style4.position === 'fixed') {
52446
+ context.div.style.position = _style4.position;
52447
+ context.div.style.top = _style4.top;
52448
+ context.div.style.left = _style4.left;
52449
+ context.div.style.right = _style4.right;
52450
+ context.div.style.bottom = _style4.bottom;
52451
+ }
52426
52452
  }
52427
52453
  if (window.IntersectionObserver) {
52428
52454
  var observer = new IntersectionObserver(handlePosition, {
@@ -52499,8 +52525,9 @@ var Sticky = function Sticky(props) {
52499
52525
  children: children
52500
52526
  })
52501
52527
  }) : null;
52528
+ var isFixed = style.position === 'fixed';
52502
52529
  return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
52503
- children: [context.target && context.div && /*#__PURE__*/(0,external_root_ReactDOM_commonjs2_react_dom_commonjs_react_dom_amd_react_dom_.createPortal)(StickyEl, context.div), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
52530
+ children: [isFixed ? StickyEl : context.target && context.div && /*#__PURE__*/(0,external_root_ReactDOM_commonjs2_react_dom_commonjs_react_dom_amd_react_dom_.createPortal)(StickyEl, context.div), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
52504
52531
  className: props.className,
52505
52532
  style: objectSpread2_default()(objectSpread2_default()({}, props.style), {}, {
52506
52533
  opacity: show && parentVisible ? 0 : (_props$style = props.style) === null || _props$style === void 0 ? void 0 : _props$style.opacity
@@ -54579,6 +54606,7 @@ var tfoot_isArray = isArray;
54579
54606
  ;// CONCATENATED MODULE: ../base/src/table/table.tsx
54580
54607
 
54581
54608
 
54609
+
54582
54610
  var table_excluded = ["data"];
54583
54611
 
54584
54612
 
@@ -54596,6 +54624,7 @@ var table_excluded = ["data"];
54596
54624
 
54597
54625
 
54598
54626
 
54627
+
54599
54628
  var table_emptyArr = [];
54600
54629
  var virtualScrollerStyle = {
54601
54630
  flex: 1,
@@ -54617,6 +54646,7 @@ var scrollWrapperStyle = {
54617
54646
  var theadRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
54618
54647
  var tfootRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
54619
54648
  var scrollRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
54649
+ var tableRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
54620
54650
  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');
54621
54651
  var _props$verticalAlign = props.verticalAlign,
54622
54652
  verticalAlign = _props$verticalAlign === void 0 ? 'top' : _props$verticalAlign,
@@ -54800,7 +54830,7 @@ var scrollWrapperStyle = {
54800
54830
  });
54801
54831
  };
54802
54832
  var renderTable = function renderTable() {
54803
- var _props$data3;
54833
+ var _props$data3, _sticky$top;
54804
54834
  var Group = /*#__PURE__*/(0,jsx_runtime.jsx)(table_colgroup, {
54805
54835
  colgroup: colgroup,
54806
54836
  columns: columns,
@@ -54924,28 +54954,30 @@ var scrollWrapperStyle = {
54924
54954
  children: [Group, !props.hideHeader && /*#__PURE__*/(0,jsx_runtime.jsx)(thead, objectSpread2_default()({}, headCommonProps)), /*#__PURE__*/(0,jsx_runtime.jsx)(tbody, objectSpread2_default()({}, bodyCommonProps)), /*#__PURE__*/(0,jsx_runtime.jsx)(tfoot, objectSpread2_default()({}, footCommonProps))]
54925
54955
  })
54926
54956
  });
54927
- var sticky = props.sticky === true ? {
54957
+ var Wrapper = props.sticky ? src_sticky_sticky : (external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment;
54958
+ var sticky = typeof_default()(props.sticky) === 'object' ? props.sticky : {
54928
54959
  top: 0
54929
- } : props.sticky || {
54930
- top: undefined
54931
54960
  };
54932
- var top = sticky.top;
54933
- var stickyStyle = top !== undefined ? {
54934
- top: top,
54935
- position: 'sticky'
54936
- } : undefined;
54961
+ var stickyProps = {
54962
+ // @ts-ignore
54963
+ target: sticky === null || sticky === void 0 ? void 0 : sticky.target,
54964
+ top: (_sticky$top = sticky === null || sticky === void 0 ? void 0 : sticky.top) !== null && _sticky$top !== void 0 ? _sticky$top : 0,
54965
+ css: sticky === null || sticky === void 0 ? void 0 : sticky.css,
54966
+ parent: tableRef === null || tableRef === void 0 ? void 0 : tableRef.current
54967
+ };
54937
54968
  return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
54938
- children: [!props.hideHeader && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
54939
- className: headWrapperClass,
54940
- style: stickyStyle,
54941
- children: /*#__PURE__*/(0,jsx_runtime.jsxs)("table", {
54942
- style: {
54943
- width: width
54944
- },
54945
- ref: theadRef,
54946
- children: [Group, /*#__PURE__*/(0,jsx_runtime.jsx)(thead, objectSpread2_default()({}, headCommonProps))]
54969
+ children: [!props.hideHeader && /*#__PURE__*/(0,jsx_runtime.jsx)(Wrapper, objectSpread2_default()(objectSpread2_default()({}, props.sticky ? stickyProps : {}), {}, {
54970
+ children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
54971
+ className: headWrapperClass,
54972
+ children: /*#__PURE__*/(0,jsx_runtime.jsxs)("table", {
54973
+ style: {
54974
+ width: width
54975
+ },
54976
+ ref: theadRef,
54977
+ children: [Group, /*#__PURE__*/(0,jsx_runtime.jsx)(thead, objectSpread2_default()({}, headCommonProps))]
54978
+ })
54947
54979
  })
54948
- }), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
54980
+ })), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
54949
54981
  ref: scrollRef,
54950
54982
  className: tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.bodyWrapper,
54951
54983
  onScroll: handleBodyScroll,
@@ -55038,6 +55070,7 @@ var scrollWrapperStyle = {
55038
55070
  height: props.height
55039
55071
  }, props.style)
55040
55072
  }, selection.getTableProps()), {}, {
55073
+ ref: tableRef,
55041
55074
  children: /*#__PURE__*/(0,jsx_runtime.jsxs)(absolute_context.Provider, {
55042
55075
  value: true,
55043
55076
  children: [renderTable(), renderLoading(), props.children]
@@ -58714,24 +58747,41 @@ UploadComp.Button = UploadButtonComp;
58714
58747
  /* harmony default export */ var src_upload_0 = (UploadComp);
58715
58748
  ;// CONCATENATED MODULE: ../theme/src/hooks/useToken/use-token.ts
58716
58749
 
58750
+
58751
+
58752
+
58717
58753
  var use_token_require = __webpack_require__(297),
58718
58754
  use_token_figma = use_token_require.figma;
58719
58755
  var useToken = function useToken(props) {
58720
58756
  var _ref = props || {},
58721
58757
  tokenProps = _ref.token;
58758
+ var _getConfig = getConfig(),
58759
+ prefix = _getConfig.prefix;
58760
+
58722
58761
  // 后期会从 figma 中获取全部 token
58723
58762
  var unLockedToken = use_token_figma.filter(function (i) {
58724
58763
  return i.locked === false;
58725
58764
  });
58726
- var token = {};
58765
+ var colorToken = {};
58727
58766
  unLockedToken.forEach(function (i) {
58728
- token[i.name] = i.value;
58767
+ var k = "var(--".concat(prefix, "-").concat(replaceNonAlphanumeric(i.token), ",").concat(i.value, ")");
58768
+ colorToken[i.name] = k;
58729
58769
  });
58730
58770
  if (tokenProps) {
58731
58771
  return {
58732
- token: objectSpread2_default()(objectSpread2_default()({}, token), tokenProps)
58772
+ token: objectSpread2_default()(objectSpread2_default()({}, colorToken), tokenProps)
58733
58773
  };
58734
58774
  }
58775
+ var baseToken = {};
58776
+ Object.keys(token_token).forEach(function (key) {
58777
+ var k = key.replace('-', '_').toLocaleLowerCase();
58778
+ if (/^\d/.test(k)) {
58779
+ return;
58780
+ }
58781
+ var token = "var(--".concat(prefix, "-").concat(replaceNonAlphanumeric(key), ")");
58782
+ baseToken[k] = token;
58783
+ });
58784
+ var token = Object.assign({}, colorToken, baseToken);
58735
58785
  return {
58736
58786
  token: token
58737
58787
  };
@@ -60995,7 +61045,7 @@ var upload_interface = __webpack_require__(4412);
60995
61045
 
60996
61046
 
60997
61047
  /* harmony default export */ var src_0 = ({
60998
- version: '3.0.0-rc.4'
61048
+ version: '3.0.0-rc.6'
60999
61049
  });
61000
61050
  }();
61001
61051
  /******/ return __webpack_exports__;