@douyinfe/semi-ui 2.49.0 → 2.49.1

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.
@@ -17286,6 +17286,8 @@ __webpack_require__.d(__webpack_exports__, {
17286
17286
  "BackTop": () => (/* reexport */ BackTop),
17287
17287
  "Badge": () => (/* reexport */ Badge),
17288
17288
  "Banner": () => (/* reexport */ Banner),
17289
+ "BaseComponent": () => (/* reexport */ BaseComponent),
17290
+ "BaseFoundation": () => (/* reexport */ foundation),
17289
17291
  "Breadcrumb": () => (/* reexport */ breadcrumb_0),
17290
17292
  "Button": () => (/* reexport */ button_0),
17291
17293
  "ButtonGroup": () => (/* reexport */ ButtonGroup),
@@ -17375,45 +17377,12 @@ __webpack_require__.d(__webpack_exports__, {
17375
17377
 
17376
17378
  // EXTERNAL MODULE: ./_base/base.scss
17377
17379
  var base = __webpack_require__("q7sR");
17378
- // EXTERNAL MODULE: ../../node_modules/lodash/throttle.js
17379
- var throttle = __webpack_require__("Bcqe");
17380
- var throttle_default = /*#__PURE__*/__webpack_require__.n(throttle);
17381
- // EXTERNAL MODULE: ../../node_modules/lodash/debounce.js
17382
- var debounce = __webpack_require__("RNvQ");
17383
- var debounce_default = /*#__PURE__*/__webpack_require__.n(debounce);
17384
17380
  // EXTERNAL MODULE: ../../node_modules/lodash/noop.js
17385
17381
  var noop = __webpack_require__("nnm9");
17386
17382
  var noop_default = /*#__PURE__*/__webpack_require__.n(noop);
17387
- // EXTERNAL MODULE: external {"root":"React","commonjs2":"react","commonjs":"react","amd":"react"}
17388
- var external_root_React_commonjs2_react_commonjs_react_amd_react_ = __webpack_require__("neV8");
17389
- var external_root_React_commonjs2_react_commonjs_react_amd_react_default = /*#__PURE__*/__webpack_require__.n(external_root_React_commonjs2_react_commonjs_react_amd_react_);
17390
- // EXTERNAL MODULE: ../../node_modules/classnames/index.js
17391
- var classnames = __webpack_require__("O94r");
17392
- var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
17393
- // EXTERNAL MODULE: ../../node_modules/prop-types/index.js
17394
- var prop_types = __webpack_require__("aWzz");
17395
- var prop_types_default = /*#__PURE__*/__webpack_require__.n(prop_types);
17396
- ;// CONCATENATED MODULE: ../semi-foundation/base/env.ts
17397
- const BASE_CLASS_PREFIX = 'semi';
17398
- ;// CONCATENATED MODULE: ../semi-foundation/anchor/constants.ts
17399
-
17400
- const cssClasses = {
17401
- PREFIX: `${BASE_CLASS_PREFIX}-anchor`
17402
- };
17403
- const constants_strings = {
17404
- SIZE: ['small', 'default'],
17405
- SLIDE_COLOR: ['primary', 'tertiary', 'muted'],
17406
- MAX_WIDTH: '200px',
17407
- MAX_HEIGHT: '750px',
17408
- POSITION_SET: ['top', 'topLeft', 'topRight', 'left', 'leftTop', 'leftBottom', 'right', 'rightTop', 'rightBottom', 'bottom', 'bottomLeft', 'bottomRight', 'leftTopOver', 'rightTopOver']
17409
- };
17410
-
17411
17383
  // EXTERNAL MODULE: ../../node_modules/lodash/get.js
17412
17384
  var get = __webpack_require__("2srY");
17413
17385
  var get_default = /*#__PURE__*/__webpack_require__.n(get);
17414
- // EXTERNAL MODULE: ../../node_modules/lodash/isArray.js
17415
- var isArray = __webpack_require__("wxYD");
17416
- var isArray_default = /*#__PURE__*/__webpack_require__.n(isArray);
17417
17386
  ;// CONCATENATED MODULE: ../semi-foundation/utils/log.ts
17418
17387
 
17419
17388
  const log = function (text) {
@@ -17540,6 +17509,115 @@ class BaseFoundation {
17540
17509
  }
17541
17510
  }
17542
17511
  /* harmony default export */ const foundation = (BaseFoundation);
17512
+ // EXTERNAL MODULE: external {"root":"React","commonjs2":"react","commonjs":"react","amd":"react"}
17513
+ var external_root_React_commonjs2_react_commonjs_react_amd_react_ = __webpack_require__("neV8");
17514
+ var external_root_React_commonjs2_react_commonjs_react_amd_react_default = /*#__PURE__*/__webpack_require__.n(external_root_React_commonjs2_react_commonjs_react_amd_react_);
17515
+ ;// CONCATENATED MODULE: ../semi-foundation/utils/getDataAttr.ts
17516
+ function getDataAttr(props) {
17517
+ return Object.keys(props).reduce((prev, key) => {
17518
+ if (key.substr(0, 5) === 'data-') {
17519
+ prev[key] = props[key];
17520
+ }
17521
+ return prev;
17522
+ }, {});
17523
+ }
17524
+ ;// CONCATENATED MODULE: ./_base/baseComponent.tsx
17525
+ /**
17526
+ * The Semi Foundation / Adapter architecture split was inspired by Material Component For Web. (https://github.com/material-components/material-components-web)
17527
+ * We re-implemented our own code based on the principle and added more functions we need according to actual needs.
17528
+ */
17529
+
17530
+
17531
+
17532
+ const {
17533
+ hasOwnProperty: baseComponent_hasOwnProperty
17534
+ } = Object.prototype;
17535
+ // eslint-disable-next-line
17536
+ class BaseComponent extends external_root_React_commonjs2_react_commonjs_react_amd_react_.Component {
17537
+ constructor(props) {
17538
+ super(props);
17539
+ // eslint-disable-next-line
17540
+ this.isControlled = key => Boolean(key && this.props && typeof this.props === 'object' && baseComponent_hasOwnProperty.call(this.props, key));
17541
+ this.cache = {};
17542
+ this.foundation = null;
17543
+ }
17544
+ componentDidMount() {
17545
+ this.foundation && typeof this.foundation.init === 'function' && this.foundation.init();
17546
+ }
17547
+ componentWillUnmount() {
17548
+ this.foundation && typeof this.foundation.destroy === 'function' && this.foundation.destroy();
17549
+ this.cache = {};
17550
+ }
17551
+ get adapter() {
17552
+ return {
17553
+ getContext: key => {
17554
+ if (this.context && key) {
17555
+ return this.context[key];
17556
+ }
17557
+ },
17558
+ getContexts: () => this.context,
17559
+ getProp: key => this.props[key],
17560
+ // return all props
17561
+ getProps: () => this.props,
17562
+ getState: key => this.state[key],
17563
+ getStates: () => this.state,
17564
+ setState: (states, cb) => this.setState(Object.assign({}, states), cb),
17565
+ getCache: key => key && this.cache[key],
17566
+ getCaches: () => this.cache,
17567
+ setCache: (key, value) => key && (this.cache[key] = value),
17568
+ stopPropagation: e => {
17569
+ try {
17570
+ e.stopPropagation();
17571
+ e.nativeEvent && e.nativeEvent.stopImmediatePropagation();
17572
+ } catch (error) {}
17573
+ },
17574
+ persistEvent: e => {
17575
+ e && e.persist && typeof e.persist === 'function' ? e.persist() : null;
17576
+ }
17577
+ };
17578
+ }
17579
+ log(text) {
17580
+ for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
17581
+ rest[_key - 1] = arguments[_key];
17582
+ }
17583
+ return utils_log(text, ...rest);
17584
+ }
17585
+ getDataAttr(props) {
17586
+ return getDataAttr(props);
17587
+ }
17588
+ }
17589
+ BaseComponent.propTypes = {};
17590
+ BaseComponent.defaultProps = {};
17591
+ // EXTERNAL MODULE: ../../node_modules/lodash/throttle.js
17592
+ var throttle = __webpack_require__("Bcqe");
17593
+ var throttle_default = /*#__PURE__*/__webpack_require__.n(throttle);
17594
+ // EXTERNAL MODULE: ../../node_modules/lodash/debounce.js
17595
+ var debounce = __webpack_require__("RNvQ");
17596
+ var debounce_default = /*#__PURE__*/__webpack_require__.n(debounce);
17597
+ // EXTERNAL MODULE: ../../node_modules/classnames/index.js
17598
+ var classnames = __webpack_require__("O94r");
17599
+ var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
17600
+ // EXTERNAL MODULE: ../../node_modules/prop-types/index.js
17601
+ var prop_types = __webpack_require__("aWzz");
17602
+ var prop_types_default = /*#__PURE__*/__webpack_require__.n(prop_types);
17603
+ ;// CONCATENATED MODULE: ../semi-foundation/base/env.ts
17604
+ const BASE_CLASS_PREFIX = 'semi';
17605
+ ;// CONCATENATED MODULE: ../semi-foundation/anchor/constants.ts
17606
+
17607
+ const cssClasses = {
17608
+ PREFIX: `${BASE_CLASS_PREFIX}-anchor`
17609
+ };
17610
+ const constants_strings = {
17611
+ SIZE: ['small', 'default'],
17612
+ SLIDE_COLOR: ['primary', 'tertiary', 'muted'],
17613
+ MAX_WIDTH: '200px',
17614
+ MAX_HEIGHT: '750px',
17615
+ POSITION_SET: ['top', 'topLeft', 'topRight', 'left', 'leftTop', 'leftBottom', 'right', 'rightTop', 'rightBottom', 'bottom', 'bottomLeft', 'bottomRight', 'leftTopOver', 'rightTopOver']
17616
+ };
17617
+
17618
+ // EXTERNAL MODULE: ../../node_modules/lodash/isArray.js
17619
+ var isArray = __webpack_require__("wxYD");
17620
+ var isArray_default = /*#__PURE__*/__webpack_require__.n(isArray);
17543
17621
  ;// CONCATENATED MODULE: ../../node_modules/compute-scroll-into-view/dist/index.mjs
17544
17622
  function t(t){return"object"==typeof t&&null!=t&&1===t.nodeType}function e(t,e){return(!e||"hidden"!==t)&&"visible"!==t&&"clip"!==t}function n(t,n){if(t.clientHeight<t.scrollHeight||t.clientWidth<t.scrollWidth){var r=getComputedStyle(t,null);return e(r.overflowY,n)||e(r.overflowX,n)||function(t){var e=function(t){if(!t.ownerDocument||!t.ownerDocument.defaultView)return null;try{return t.ownerDocument.defaultView.frameElement}catch(t){return null}}(t);return!!e&&(e.clientHeight<t.scrollHeight||e.clientWidth<t.scrollWidth)}(t)}return!1}function r(t,e,n,r,i,o,l,d){return o<t&&l>e||o>t&&l<e?0:o<=t&&d<=n||l>=e&&d>=n?o-t-r:l>e&&d<n||o<t&&d>n?l-e+i:0}var i=function(e,i){var o=window,l=i.scrollMode,d=i.block,f=i.inline,h=i.boundary,u=i.skipOverflowHiddenElements,s="function"==typeof h?h:function(t){return t!==h};if(!t(e))throw new TypeError("Invalid target");for(var a,c,g=document.scrollingElement||document.documentElement,p=[],m=e;t(m)&&s(m);){if((m=null==(c=(a=m).parentElement)?a.getRootNode().host||null:c)===g){p.push(m);break}null!=m&&m===document.body&&n(m)&&!n(document.documentElement)||null!=m&&n(m,u)&&p.push(m)}for(var w=o.visualViewport?o.visualViewport.width:innerWidth,v=o.visualViewport?o.visualViewport.height:innerHeight,W=window.scrollX||pageXOffset,H=window.scrollY||pageYOffset,b=e.getBoundingClientRect(),y=b.height,E=b.width,M=b.top,V=b.right,x=b.bottom,I=b.left,C="start"===d||"nearest"===d?M:"end"===d?x:M+y/2,R="center"===f?I+E/2:"end"===f?V:I,T=[],k=0;k<p.length;k++){var B=p[k],D=B.getBoundingClientRect(),O=D.height,X=D.width,Y=D.top,L=D.right,S=D.bottom,j=D.left;if("if-needed"===l&&M>=0&&I>=0&&x<=v&&V<=w&&M>=Y&&x<=S&&I>=j&&V<=L)return T;var N=getComputedStyle(B),q=parseInt(N.borderLeftWidth,10),z=parseInt(N.borderTopWidth,10),A=parseInt(N.borderRightWidth,10),F=parseInt(N.borderBottomWidth,10),G=0,J=0,K="offsetWidth"in B?B.offsetWidth-B.clientWidth-q-A:0,P="offsetHeight"in B?B.offsetHeight-B.clientHeight-z-F:0,Q="offsetWidth"in B?0===B.offsetWidth?0:X/B.offsetWidth:0,U="offsetHeight"in B?0===B.offsetHeight?0:O/B.offsetHeight:0;if(g===B)G="start"===d?C:"end"===d?C-v:"nearest"===d?r(H,H+v,v,z,F,H+C,H+C+y,y):C-v/2,J="start"===f?R:"center"===f?R-w/2:"end"===f?R-w:r(W,W+w,w,q,A,W+R,W+R+E,E),G=Math.max(0,G+H),J=Math.max(0,J+W);else{G="start"===d?C-Y-z:"end"===d?C-S+F+P:"nearest"===d?r(Y,S,O,z,F+P,C,C+y,y):C-(Y+O/2)+P/2,J="start"===f?R-j-q:"center"===f?R-(j+X/2)+K/2:"end"===f?R-L+A+K:r(j,L,X,q,A+K,R,R+E,E);var Z=B.scrollLeft,$=B.scrollTop;C+=$-(G=Math.max(0,Math.min($+G/U,B.scrollHeight-O/U+P))),R+=Z-(J=Math.max(0,Math.min(Z+J/Q,B.scrollWidth-X/Q+K)))}T.push({el:B,top:G,left:J})}return T};
17545
17623
  //# sourceMappingURL=index.mjs.map
@@ -17793,82 +17871,6 @@ class AnchorFoundation extends foundation {
17793
17871
  };
17794
17872
  }
17795
17873
  }
17796
- ;// CONCATENATED MODULE: ../semi-foundation/utils/getDataAttr.ts
17797
- function getDataAttr(props) {
17798
- return Object.keys(props).reduce((prev, key) => {
17799
- if (key.substr(0, 5) === 'data-') {
17800
- prev[key] = props[key];
17801
- }
17802
- return prev;
17803
- }, {});
17804
- }
17805
- ;// CONCATENATED MODULE: ./_base/baseComponent.tsx
17806
- /**
17807
- * The Semi Foundation / Adapter architecture split was inspired by Material Component For Web. (https://github.com/material-components/material-components-web)
17808
- * We re-implemented our own code based on the principle and added more functions we need according to actual needs.
17809
- */
17810
-
17811
-
17812
-
17813
- const {
17814
- hasOwnProperty: baseComponent_hasOwnProperty
17815
- } = Object.prototype;
17816
- // eslint-disable-next-line
17817
- class BaseComponent extends external_root_React_commonjs2_react_commonjs_react_amd_react_.Component {
17818
- constructor(props) {
17819
- super(props);
17820
- // eslint-disable-next-line
17821
- this.isControlled = key => Boolean(key && this.props && typeof this.props === 'object' && baseComponent_hasOwnProperty.call(this.props, key));
17822
- this.cache = {};
17823
- this.foundation = null;
17824
- }
17825
- componentDidMount() {
17826
- this.foundation && typeof this.foundation.init === 'function' && this.foundation.init();
17827
- }
17828
- componentWillUnmount() {
17829
- this.foundation && typeof this.foundation.destroy === 'function' && this.foundation.destroy();
17830
- this.cache = {};
17831
- }
17832
- get adapter() {
17833
- return {
17834
- getContext: key => {
17835
- if (this.context && key) {
17836
- return this.context[key];
17837
- }
17838
- },
17839
- getContexts: () => this.context,
17840
- getProp: key => this.props[key],
17841
- // return all props
17842
- getProps: () => this.props,
17843
- getState: key => this.state[key],
17844
- getStates: () => this.state,
17845
- setState: (states, cb) => this.setState(Object.assign({}, states), cb),
17846
- getCache: key => key && this.cache[key],
17847
- getCaches: () => this.cache,
17848
- setCache: (key, value) => key && (this.cache[key] = value),
17849
- stopPropagation: e => {
17850
- try {
17851
- e.stopPropagation();
17852
- e.nativeEvent && e.nativeEvent.stopImmediatePropagation();
17853
- } catch (error) {}
17854
- },
17855
- persistEvent: e => {
17856
- e && e.persist && typeof e.persist === 'function' ? e.persist() : null;
17857
- }
17858
- };
17859
- }
17860
- log(text) {
17861
- for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
17862
- rest[_key - 1] = arguments[_key];
17863
- }
17864
- return utils_log(text, ...rest);
17865
- }
17866
- getDataAttr(props) {
17867
- return getDataAttr(props);
17868
- }
17869
- }
17870
- BaseComponent.propTypes = {};
17871
- BaseComponent.defaultProps = {};
17872
17874
  // EXTERNAL MODULE: ../../node_modules/lodash/isObject.js
17873
17875
  var isObject = __webpack_require__("tQYX");
17874
17876
  var isObject_default = /*#__PURE__*/__webpack_require__.n(isObject);
@@ -101404,6 +101406,8 @@ Preview.defaultProps = {
101404
101406
 
101405
101407
 
101406
101408
 
101409
+
101410
+
101407
101411
 
101408
101412
 
101409
101413