@sheinx/base 3.8.0 → 3.8.1-beta.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.
@@ -1 +1 @@
1
- {"version":3,"file":"cascader.d.ts","sourceRoot":"","sources":["cascader.tsx"],"names":[],"mappings":"AAEA,OAAO,EAML,YAAY,EAIb,MAAM,eAAe,CAAC;AAMvB,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAahD,QAAA,MAAM,QAAQ,6HAmxBb,CAAC;AACF,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"cascader.d.ts","sourceRoot":"","sources":["cascader.tsx"],"names":[],"mappings":"AAEA,OAAO,EAML,YAAY,EAIb,MAAM,eAAe,CAAC;AAMvB,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAahD,QAAA,MAAM,QAAQ,6HAoxBb,CAAC;AACF,eAAe,QAAQ,CAAC"}
@@ -630,6 +630,7 @@ var Cascader = function Cascader(props0) {
630
630
  return renderLoading();
631
631
  }
632
632
  if (isDataEmpty) {
633
+ // todo: 空数据时 是否 支持一下也能走到renderOptionList
633
634
  return renderEmpty();
634
635
  }
635
636
  if (!filterText || filterText && mode !== undefined || data && data.length === 0) {
@@ -1 +1 @@
1
- {"version":3,"file":"modal-content.d.ts","sourceRoot":"","sources":["modal-content.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AA0C9D,QAAA,MAAM,KAAK,UAAW,iBAAiB,mDA0YtC,CAAC;AAEF,eAAe,KAAK,CAAC"}
1
+ {"version":3,"file":"modal-content.d.ts","sourceRoot":"","sources":["modal-content.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AA8C9D,QAAA,MAAM,KAAK,UAAW,iBAAiB,mDA0YtC,CAAC;AAEF,eAAe,KAAK,CAAC"}
@@ -43,6 +43,9 @@ var removeModalInstance = function removeModalInstance(instanceId) {
43
43
  return id !== instanceId;
44
44
  });
45
45
  };
46
+ var getInstanceIds = function getInstanceIds() {
47
+ return state.mutate.instanceIds;
48
+ };
46
49
  var mousePosition = null;
47
50
  var getClickPosition = function getClickPosition(e) {
48
51
  mousePosition = {
@@ -229,8 +232,7 @@ var Modal = function Modal(props) {
229
232
  if (visible) {
230
233
  setDocumentOverflow();
231
234
  } else {
232
- if (config.instanceIds.length && config.instanceIds[config.instanceIds.length - 1] === context.instanceId) return;
233
- resetDocumentOverflow();
235
+ if (config.instanceIds.length === 0) resetDocumentOverflow();
234
236
  }
235
237
  }
236
238
  }, [visible, config.instanceIds]);
@@ -245,10 +247,10 @@ var Modal = function Modal(props) {
245
247
  return function () {
246
248
  var _props$shouldDestroy2;
247
249
  removeModalInstance(context.instanceId);
248
- if (context.isMask) {
250
+ var instanceIds = getInstanceIds();
251
+ if (instanceIds.length === 0) {
249
252
  resetDocumentOverflow();
250
253
  }
251
- ;
252
254
  (_props$shouldDestroy2 = props.shouldDestroy) === null || _props$shouldDestroy2 === void 0 || _props$shouldDestroy2.call(props, true);
253
255
  if (context.isMask) {
254
256
  context.isMask = false;
@@ -1 +1 @@
1
- {"version":3,"file":"select.d.ts","sourceRoot":"","sources":["select.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAE,eAAe,EAAqB,MAAM,eAAe,CAAC;AAenE,iBAAS,MAAM,CAAC,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,eAAe,CAAC,QAAQ,EAAE,KAAK,CAAC,2CAmxBxE;AAED,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"select.d.ts","sourceRoot":"","sources":["select.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAE,eAAe,EAAqB,MAAM,eAAe,CAAC;AAenE,iBAAS,MAAM,CAAC,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,eAAe,CAAC,QAAQ,EAAE,KAAK,CAAC,2CAqxBxE;AAED,eAAe,MAAM,CAAC"}
@@ -666,6 +666,7 @@ function Select(props0) {
666
666
  });
667
667
  };
668
668
  var renderEmpty = function renderEmpty() {
669
+ if (props.emptyText === false) return null;
669
670
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
670
671
  className: styles === null || styles === void 0 ? void 0 : styles.option,
671
672
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
@@ -680,13 +681,13 @@ function Select(props0) {
680
681
  var renderOptions = function renderOptions() {
681
682
  if (loading) return renderLoading();
682
683
  var isEmpty = !(filterData !== null && filterData !== void 0 && filterData.length);
683
- if (isEmpty && props.emptyText !== false) return renderEmpty();
684
684
  var options = 'treeData' in props ? renderTreeList() : renderList();
685
685
  if (renderOptionList) {
686
- return renderOptionList(options, {
686
+ return renderOptionList(isEmpty ? renderEmpty() : options, {
687
687
  loading: loading
688
688
  });
689
689
  }
690
+ if (isEmpty) return renderEmpty();
690
691
  return options;
691
692
  };
692
693
  var renderHeader = function renderHeader() {
@@ -1 +1 @@
1
- {"version":3,"file":"cascader.d.ts","sourceRoot":"","sources":["cascader.tsx"],"names":[],"mappings":"AAEA,OAAO,EAML,YAAY,EAIb,MAAM,eAAe,CAAC;AAMvB,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAahD,QAAA,MAAM,QAAQ,6HAmxBb,CAAC;AACF,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"cascader.d.ts","sourceRoot":"","sources":["cascader.tsx"],"names":[],"mappings":"AAEA,OAAO,EAML,YAAY,EAIb,MAAM,eAAe,CAAC;AAMvB,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAahD,QAAA,MAAM,QAAQ,6HAoxBb,CAAC;AACF,eAAe,QAAQ,CAAC"}
@@ -623,6 +623,7 @@ var Cascader = function Cascader(props0) {
623
623
  return renderLoading();
624
624
  }
625
625
  if (isDataEmpty) {
626
+ // todo: 空数据时 是否 支持一下也能走到renderOptionList
626
627
  return renderEmpty();
627
628
  }
628
629
  if (!filterText || filterText && mode !== undefined || data && data.length === 0) {
@@ -1 +1 @@
1
- {"version":3,"file":"modal-content.d.ts","sourceRoot":"","sources":["modal-content.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AA0C9D,QAAA,MAAM,KAAK,UAAW,iBAAiB,mDA0YtC,CAAC;AAEF,eAAe,KAAK,CAAC"}
1
+ {"version":3,"file":"modal-content.d.ts","sourceRoot":"","sources":["modal-content.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AA8C9D,QAAA,MAAM,KAAK,UAAW,iBAAiB,mDA0YtC,CAAC;AAEF,eAAe,KAAK,CAAC"}
@@ -37,6 +37,9 @@ var removeModalInstance = function removeModalInstance(instanceId) {
37
37
  return id !== instanceId;
38
38
  });
39
39
  };
40
+ var getInstanceIds = function getInstanceIds() {
41
+ return state.mutate.instanceIds;
42
+ };
40
43
  var mousePosition = null;
41
44
  var getClickPosition = function getClickPosition(e) {
42
45
  mousePosition = {
@@ -223,8 +226,7 @@ var Modal = function Modal(props) {
223
226
  if (visible) {
224
227
  setDocumentOverflow();
225
228
  } else {
226
- if (config.instanceIds.length && config.instanceIds[config.instanceIds.length - 1] === context.instanceId) return;
227
- resetDocumentOverflow();
229
+ if (config.instanceIds.length === 0) resetDocumentOverflow();
228
230
  }
229
231
  }
230
232
  }, [visible, config.instanceIds]);
@@ -239,10 +241,10 @@ var Modal = function Modal(props) {
239
241
  return function () {
240
242
  var _props$shouldDestroy2;
241
243
  removeModalInstance(context.instanceId);
242
- if (context.isMask) {
244
+ var instanceIds = getInstanceIds();
245
+ if (instanceIds.length === 0) {
243
246
  resetDocumentOverflow();
244
247
  }
245
- ;
246
248
  (_props$shouldDestroy2 = props.shouldDestroy) === null || _props$shouldDestroy2 === void 0 || _props$shouldDestroy2.call(props, true);
247
249
  if (context.isMask) {
248
250
  context.isMask = false;
@@ -1 +1 @@
1
- {"version":3,"file":"select.d.ts","sourceRoot":"","sources":["select.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAE,eAAe,EAAqB,MAAM,eAAe,CAAC;AAenE,iBAAS,MAAM,CAAC,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,eAAe,CAAC,QAAQ,EAAE,KAAK,CAAC,2CAmxBxE;AAED,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"select.d.ts","sourceRoot":"","sources":["select.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAE,eAAe,EAAqB,MAAM,eAAe,CAAC;AAenE,iBAAS,MAAM,CAAC,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,eAAe,CAAC,QAAQ,EAAE,KAAK,CAAC,2CAqxBxE;AAED,eAAe,MAAM,CAAC"}
@@ -659,6 +659,7 @@ function Select(props0) {
659
659
  });
660
660
  };
661
661
  var renderEmpty = function renderEmpty() {
662
+ if (props.emptyText === false) return null;
662
663
  return /*#__PURE__*/_jsx("div", {
663
664
  className: styles === null || styles === void 0 ? void 0 : styles.option,
664
665
  children: /*#__PURE__*/_jsx("div", {
@@ -673,13 +674,13 @@ function Select(props0) {
673
674
  var renderOptions = function renderOptions() {
674
675
  if (loading) return renderLoading();
675
676
  var isEmpty = !(filterData !== null && filterData !== void 0 && filterData.length);
676
- if (isEmpty && props.emptyText !== false) return renderEmpty();
677
677
  var options = 'treeData' in props ? renderTreeList() : renderList();
678
678
  if (renderOptionList) {
679
- return renderOptionList(options, {
679
+ return renderOptionList(isEmpty ? renderEmpty() : options, {
680
680
  loading: loading
681
681
  });
682
682
  }
683
+ if (isEmpty) return renderEmpty();
683
684
  return options;
684
685
  };
685
686
  var renderHeader = function renderHeader() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sheinx/base",
3
- "version": "3.8.0",
3
+ "version": "3.8.1-beta.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.8.0",
13
+ "@sheinx/hooks": "3.8.1-beta.2",
14
14
  "immer": "^10.0.0",
15
15
  "classnames": "^2.0.0",
16
16
  "@shined/reactive": "^0.1.3-alpha.0"