shineout 3.0.0-rc.4 → 3.0.0-rc.5

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.5'
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.5');
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,
@@ -52250,28 +52254,29 @@ StepsComp.Step = StepsStep;
52250
52254
  var sticky_cssSupport = cssSupport;
52251
52255
  var supportSticky = sticky_cssSupport('position', 'sticky');
52252
52256
  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
- };
52257
+
52258
+ // const getFirstScrollParent = (el: HTMLElement) => {
52259
+ // let parent = el.parentNode as HTMLElement;
52260
+ // while (parent) {
52261
+ // if (parent === document.body || parent === document.documentElement) {
52262
+ // parent = document.body;
52263
+ // break;
52264
+ // }
52265
+ // const { overflowY } = window.getComputedStyle(parent);
52266
+ // if (overflowY === 'scroll' || overflowY === 'auto') {
52267
+ // break;
52268
+ // }
52269
+ // parent = parent.parentNode as HTMLElement;
52270
+ // }
52271
+ // return parent;
52272
+ // };
52273
+
52269
52274
  var Sticky = function Sticky(props) {
52270
52275
  var _props$style;
52271
- var css = props.css,
52272
- children = props.children,
52276
+ var children = props.children,
52273
52277
  top = props.top,
52274
52278
  bottom = props.bottom;
52279
+ var css = props.css || props.target;
52275
52280
  var _useRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)({
52276
52281
  target: null,
52277
52282
  div: null,
@@ -52299,15 +52304,15 @@ var Sticky = function Sticky(props) {
52299
52304
  timer: 0
52300
52305
  });
52301
52306
  var getTarget = function getTarget() {
52302
- var target = props.target;
52303
- if (typeof props.target === 'string') {
52304
- target = document.querySelector(props.target);
52307
+ var scrollContainer = props.scrollContainer;
52308
+ if (typeof scrollContainer === 'string') {
52309
+ scrollContainer = document.querySelector(scrollContainer);
52305
52310
  }
52306
52311
  // 判断是否是dom元素
52307
- if (target && target.nodeType === 1) {
52308
- return target;
52312
+ if (scrollContainer && scrollContainer.nodeType === 1) {
52313
+ return scrollContainer;
52309
52314
  }
52310
- return getFirstScrollParent(elementRef.current);
52315
+ return document.body;
52311
52316
  };
52312
52317
  var updateStyle = usePersistFn(function () {
52313
52318
  if (context.div && !context.isTop && show) {
@@ -52403,7 +52408,7 @@ var Sticky = function Sticky(props) {
52403
52408
  };
52404
52409
  var createObserver = function createObserver() {
52405
52410
  var target = getTarget();
52406
- if (!context.div) {
52411
+ if (!context.div && target !== document.body) {
52407
52412
  context.div = document.createElement('div');
52408
52413
  context.div.style.position = 'relative';
52409
52414
  }
@@ -52411,18 +52416,21 @@ var Sticky = function Sticky(props) {
52411
52416
  forceRender();
52412
52417
  context.target = target;
52413
52418
  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;
52419
+ if (context.div) {
52420
+ // append div
52421
+ if (target === document.body) {
52422
+ document.body.appendChild(context.div);
52423
+ } else {
52424
+ target.parentNode.insertBefore(context.div, target);
52425
+ }
52426
+ var _style4 = window.getComputedStyle(target);
52427
+ if (_style4.position === 'absolute' || _style4.position === 'fixed') {
52428
+ context.div.style.position = _style4.position;
52429
+ context.div.style.top = _style4.top;
52430
+ context.div.style.left = _style4.left;
52431
+ context.div.style.right = _style4.right;
52432
+ context.div.style.bottom = _style4.bottom;
52433
+ }
52426
52434
  }
52427
52435
  if (window.IntersectionObserver) {
52428
52436
  var observer = new IntersectionObserver(handlePosition, {
@@ -52499,8 +52507,9 @@ var Sticky = function Sticky(props) {
52499
52507
  children: children
52500
52508
  })
52501
52509
  }) : null;
52510
+ var isFixed = style.position === 'fixed';
52502
52511
  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", {
52512
+ 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
52513
  className: props.className,
52505
52514
  style: objectSpread2_default()(objectSpread2_default()({}, props.style), {}, {
52506
52515
  opacity: show && parentVisible ? 0 : (_props$style = props.style) === null || _props$style === void 0 ? void 0 : _props$style.opacity
@@ -60995,7 +61004,7 @@ var upload_interface = __webpack_require__(4412);
60995
61004
 
60996
61005
 
60997
61006
  /* harmony default export */ var src_0 = ({
60998
- version: '3.0.0-rc.4'
61007
+ version: '3.0.0-rc.5'
60999
61008
  });
61000
61009
  }();
61001
61010
  /******/ return __webpack_exports__;