@nutui/nutui-react-taro 2.0.12 → 2.0.14

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 (117) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/esm/Address.js +7 -5
  3. package/dist/esm/Audio.js +6 -4
  4. package/dist/esm/Calendar.js +6 -4
  5. package/dist/esm/CalendarItem.js +5 -3
  6. package/dist/esm/Cascader.js +4 -3
  7. package/dist/esm/Checkbox.js +3 -2
  8. package/dist/esm/CheckboxGroup.js +3 -2
  9. package/dist/esm/Collapse.js +3 -2
  10. package/dist/esm/ConfigProvider.js +3 -2
  11. package/dist/esm/CountDown.js +3 -2
  12. package/dist/esm/DatePicker.js +6 -4
  13. package/dist/esm/Dialog.js +6 -3
  14. package/dist/esm/Empty.js +3 -2
  15. package/dist/esm/FixedNav.js +3 -2
  16. package/dist/esm/Form.js +2 -2
  17. package/dist/esm/FormItem.js +1 -1
  18. package/dist/esm/Grid.js +4 -3
  19. package/dist/esm/GridItem.js +3 -2
  20. package/dist/esm/ImagePreview.js +3 -2
  21. package/dist/esm/InfiniteLoading.js +3 -2
  22. package/dist/esm/Input.js +5 -3
  23. package/dist/esm/InputNumber.js +3 -2
  24. package/dist/esm/Notify.js +4 -1
  25. package/dist/esm/NumberKeyboard.js +3 -2
  26. package/dist/esm/Pagination.js +5 -3
  27. package/dist/esm/Picker.js +5 -3
  28. package/dist/esm/PullToRefresh.js +3 -2
  29. package/dist/esm/Radio.js +3 -2
  30. package/dist/esm/RadioGroup.js +3 -2
  31. package/dist/esm/Range.js +3 -2
  32. package/dist/esm/Rate.js +3 -2
  33. package/dist/esm/SearchBar.js +3 -2
  34. package/dist/esm/ShortPassword.js +5 -3
  35. package/dist/esm/Skeleton/style/style.css +1 -1
  36. package/dist/esm/Switch.js +3 -2
  37. package/dist/esm/Tabbar.js +3 -2
  38. package/dist/esm/Table.js +3 -2
  39. package/dist/esm/Tabs.js +3 -2
  40. package/dist/esm/TextArea.js +5 -3
  41. package/dist/esm/TimeSelect.js +3 -2
  42. package/dist/esm/Toast.js +5 -1
  43. package/dist/esm/Uploader.js +3 -2
  44. package/dist/esm/WaterMark.js +3 -2
  45. package/dist/esm/{address.taro-fe8a0601.js → address.taro-b58603a5.js} +3 -3
  46. package/dist/esm/{audio.taro-e85bb3b8.js → audio.taro-ef39c1d9.js} +2 -2
  47. package/dist/esm/{calendar.taro-29726d55.js → calendar.taro-c8ddf452.js} +2 -2
  48. package/dist/esm/{calendaritem.taro-9b37d00c.js → calendaritem.taro-0bd17638.js} +2 -2
  49. package/dist/esm/{cascader.taro-e05fd966.js → cascader.taro-ec5179d6.js} +2 -2
  50. package/dist/esm/{checkbox.taro-07d5c9d5.js → checkbox.taro-22cd35c4.js} +1 -1
  51. package/dist/esm/{collapse.taro-bd6b2bb3.js → collapse.taro-4a3e417c.js} +1 -1
  52. package/dist/esm/configprovider.taro-c5ff4877.js +483 -0
  53. package/dist/esm/{countdown.taro-80f2110b.js → countdown.taro-7caa9578.js} +1 -1
  54. package/dist/esm/{datepicker.taro-b894c285.js → datepicker.taro-288d64bb.js} +3 -3
  55. package/dist/esm/{dialog.taro-51697911.js → dialog.taro-519e45af.js} +50 -46
  56. package/dist/esm/{empty.taro-cef66b01.js → empty.taro-05f15f93.js} +1 -1
  57. package/dist/esm/{fixednav.taro-04cf5ffb.js → fixednav.taro-0d998d65.js} +1 -1
  58. package/dist/esm/{form.taro-16cb71e2.js → form.taro-6166be06.js} +1 -1
  59. package/dist/esm/{formitem.taro-34af0204.js → formitem.taro-9e2d3898.js} +1 -1
  60. package/dist/esm/{grid.taro-6f1b764c.js → grid.taro-f72acab8.js} +1 -1
  61. package/dist/esm/{griditem.taro-0d03a061.js → griditem.taro-b7abc653.js} +1 -1
  62. package/dist/esm/{imagepreview.taro-167d1380.js → imagepreview.taro-bc96904b.js} +1 -1
  63. package/dist/esm/{configprovider.taro-3a23ea84.js → index-21e61675.js} +26 -504
  64. package/dist/esm/{infiniteloading.taro-590cfd4f.js → infiniteloading.taro-cb3b949e.js} +1 -1
  65. package/dist/esm/{input.taro-abe6d65e.js → input.taro-fbcb7090.js} +2 -2
  66. package/dist/esm/{inputnumber.taro-9c74cc1c.js → inputnumber.taro-2f6f30d7.js} +1 -1
  67. package/dist/esm/{notify.taro-687d6f8c.js → notify.taro-07e9ead7.js} +2 -24
  68. package/dist/esm/{numberkeyboard.taro-42950800.js → numberkeyboard.taro-f19c44a8.js} +1 -1
  69. package/dist/esm/nutui-react.es.js +44 -41
  70. package/dist/esm/{pagination.taro-c2521fdf.js → pagination.taro-47fad28d.js} +2 -2
  71. package/dist/esm/{picker.taro-bd10e4e7.js → picker.taro-0770a67f.js} +2 -2
  72. package/dist/esm/{pulltorefresh.taro-2b4a48be.js → pulltorefresh.taro-f3ab76c2.js} +1 -1
  73. package/dist/esm/{radio.taro-802db0e9.js → radio.taro-d1d370be.js} +1 -1
  74. package/dist/esm/{range.taro-70101605.js → range.taro-fbbf5522.js} +1 -1
  75. package/dist/esm/{rate.taro-f090e140.js → rate.taro-61bbf5a7.js} +1 -1
  76. package/dist/esm/{searchbar.taro-75cf9937.js → searchbar.taro-7daf43fc.js} +1 -1
  77. package/dist/esm/{shortpassword.taro-d400cd45.js → shortpassword.taro-86563915.js} +2 -2
  78. package/dist/esm/{switch.taro-9c344336.js → switch.taro-74b2bd0a.js} +1 -1
  79. package/dist/esm/{tabbar.taro-ac4f72b9.js → tabbar.taro-4397646a.js} +1 -1
  80. package/dist/esm/{table.taro-48e8265e.js → table.taro-072907bf.js} +1 -1
  81. package/dist/esm/{tabs.taro-eceaf324.js → tabs.taro-3ece2221.js} +2 -1
  82. package/dist/esm/{textarea.taro-115dc986.js → textarea.taro-6ebe789c.js} +2 -2
  83. package/dist/esm/{timeselect.taro-e115bfd7.js → timeselect.taro-6e9fc4d4.js} +1 -1
  84. package/dist/esm/{toast.taro-b6ecbca7.js → toast.taro-a907b5f5.js} +28 -9
  85. package/dist/esm/types/src/packages/dialog/config.d.ts +1 -0
  86. package/dist/esm/types/src/packages/dialog/content.taro.d.ts +1 -1
  87. package/dist/esm/types/src/packages/dialog/dialog.taro.d.ts +11 -3
  88. package/dist/esm/types/src/packages/toast/index.taro.d.ts +1 -1
  89. package/dist/esm/types/src/packages/toast/toast.taro.d.ts +12 -1
  90. package/dist/esm/types/src/utils/use-custom-event.d.ts +4 -0
  91. package/dist/esm/{uploader.taro-cdb38c18.js → uploader.taro-c0bcca89.js} +1 -1
  92. package/dist/esm/use-custom-event-e1689884.js +49 -0
  93. package/dist/esm/use-force-update-9cd7c164.js +8 -0
  94. package/dist/esm/{use-props-value-e8331e19.js → use-props-value-c78cbf9b.js} +2 -6
  95. package/dist/esm/{watermark.taro-cea2fceb.js → watermark.taro-311b59d2.js} +1 -1
  96. package/dist/locales/base.js +1 -1
  97. package/dist/locales/en-US.js +1 -1
  98. package/dist/locales/id-ID.js +1 -1
  99. package/dist/locales/tr-TR.js +1 -1
  100. package/dist/locales/zh-CN.js +1 -1
  101. package/dist/locales/zh-TW.js +1 -1
  102. package/dist/locales/zh-UG.js +1 -1
  103. package/dist/nutui.react.es.js +216 -179
  104. package/dist/nutui.react.umd.js +216 -179
  105. package/dist/packages/skeleton/skeleton.scss +3 -4
  106. package/dist/style.css +1 -1
  107. package/dist/style.mjs +1 -1
  108. package/dist/types/packages/dialog/config.d.ts +1 -0
  109. package/dist/types/packages/dialog/content.taro.d.ts +1 -1
  110. package/dist/types/packages/dialog/dialog.taro.d.ts +11 -3
  111. package/dist/types/packages/loading/loading.taro.d.ts +15 -3
  112. package/dist/types/packages/space/space.taro.d.ts +20 -4
  113. package/dist/types/packages/toast/index.taro.d.ts +1 -1
  114. package/dist/types/packages/toast/toast.taro.d.ts +12 -1
  115. package/dist/types/utils/use-custom-event.d.ts +4 -0
  116. package/package.json +5 -4
  117. package/dist/types/packages/dialog/dialogwrap.taro.d.ts +0 -14
@@ -8,7 +8,7 @@ var __publicField = (obj, key, value) => {
8
8
  return value;
9
9
  };
10
10
  /*!
11
- * @nutui/nutui-react-taro v2.0.12 Fri Aug 11 2023 10:38:48 GMT+0800 (China Standard Time)
11
+ * @nutui/nutui-react-taro v2.0.14 Fri Aug 18 2023 14:58:43 GMT+0800 (China Standard Time)
12
12
  * (c) 2023 @jdf2e.
13
13
  * Released under the MIT License.
14
14
  */
@@ -11033,7 +11033,7 @@ var __publicField = (obj, key, value) => {
11033
11033
  }
11034
11034
  const controlled = {
11035
11035
  ...children.props,
11036
- [this.props.valuePropName || "value"]: getFieldValue(name) || this.props.initialValue,
11036
+ [this.props.valuePropName || "value"]: getFieldValue(name) === void 0 ? this.props.initialValue : getFieldValue(name),
11037
11037
  [this.props.trigger || "onChange"]: (...args) => {
11038
11038
  const originOnChange = children.props[this.props.trigger || "onChange"];
11039
11039
  if (originOnChange) {
@@ -11669,18 +11669,18 @@ var __publicField = (obj, key, value) => {
11669
11669
  closeOnClickAway,
11670
11670
  children,
11671
11671
  activeColor,
11672
- show,
11672
+ show: show2,
11673
11673
  parent,
11674
11674
  index
11675
11675
  } = {
11676
11676
  ...defaultProps$U,
11677
11677
  ...props
11678
11678
  };
11679
- const [showPopup, setShowPopup] = React.useState(show);
11679
+ const [showPopup, setShowPopup] = React.useState(show2);
11680
11680
  const [innerValue, setValue] = React.useState(value);
11681
11681
  React.useEffect(() => {
11682
- setShowPopup(show);
11683
- }, [show]);
11682
+ setShowPopup(show2);
11683
+ }, [show2]);
11684
11684
  React.useEffect(() => {
11685
11685
  getParentOffset();
11686
11686
  }, [showPopup]);
@@ -14068,63 +14068,49 @@ var __publicField = (obj, key, value) => {
14068
14068
  ));
14069
14069
  };
14070
14070
  Content.displayName = "NutContent";
14071
- const defaultDialogProps = {
14072
- ...ComponentDefaults,
14073
- overlay: true,
14074
- overlayStyle: {},
14075
- overlayClassName: "",
14076
- onCancel: () => {
14077
- },
14078
- onClose: () => {
14079
- },
14080
- onOverlayClick: (e) => true,
14081
- ...defaultOverlayProps
14082
- };
14083
- const DialogWrap = (props) => {
14084
- const {
14085
- visible,
14086
- overlay,
14087
- overlayStyle,
14088
- overlayClassName,
14089
- closeOnOverlayClick,
14090
- lockScroll,
14091
- onClose,
14092
- onCancel,
14093
- onOverlayClick
14094
- } = props;
14095
- const onHandleClickOverlay = (e) => {
14096
- console.log("onClose?.()", closeOnOverlayClick);
14097
- if (closeOnOverlayClick && visible && e.target === e.currentTarget) {
14098
- const closed = onOverlayClick && onOverlayClick(e);
14099
- closed && (onClose == null ? void 0 : onClose());
14100
- closed && (onCancel == null ? void 0 : onCancel());
14101
- }
14071
+ const customEvents = new Taro.Events();
14072
+ function useCustomEventsPath(selector) {
14073
+ var _a;
14074
+ const path = (_a = Taro.getCurrentInstance().router) == null ? void 0 : _a.path;
14075
+ return path ? `${path}__${selector}` : selector;
14076
+ }
14077
+ function useCustomEvent(selector, cb) {
14078
+ const path = useCustomEventsPath(selector);
14079
+ React.useEffect(() => {
14080
+ customEvents.on(path, cb);
14081
+ return () => {
14082
+ customEvents.off(path);
14083
+ };
14084
+ }, []);
14085
+ const trigger = (args) => {
14086
+ customEvents.trigger(path, args);
14102
14087
  };
14103
- return /* @__PURE__ */ React.createElement(React.Fragment, null, overlay ? /* @__PURE__ */ React.createElement(
14104
- Overlay,
14105
- {
14106
- style: overlayStyle,
14107
- className: overlayClassName,
14108
- visible: true,
14109
- closeOnOverlayClick,
14110
- lockScroll,
14111
- onClick: onHandleClickOverlay
14112
- }
14113
- ) : null, /* @__PURE__ */ React.createElement(
14114
- CSSTransition$1,
14115
- {
14116
- in: visible,
14117
- timeout: 300,
14118
- classNames: "fadeDialog",
14119
- unmountOnExit: true,
14120
- appear: true
14121
- },
14122
- /* @__PURE__ */ React.createElement(Content, { ...props, visible })
14123
- ));
14124
- };
14125
- DialogWrap.defaultProps = defaultDialogProps;
14126
- DialogWrap.displayName = "NutDialogWrap";
14088
+ const off = () => {
14089
+ customEvents.off(path);
14090
+ };
14091
+ return [trigger, off];
14092
+ }
14093
+ function useParams(args) {
14094
+ const forceUpdate = useForceUpdate();
14095
+ const stateRef = React.useRef(args);
14096
+ const currentRef = React.useRef();
14097
+ const previousRef = React.useRef();
14098
+ if (!isequal(currentRef.current, args)) {
14099
+ previousRef.current = currentRef.current;
14100
+ currentRef.current = args;
14101
+ stateRef.current = args;
14102
+ }
14103
+ const setParams = (args2) => {
14104
+ stateRef.current = { ...stateRef.current, ...args2 };
14105
+ forceUpdate();
14106
+ };
14107
+ const params = stateRef.current;
14108
+ return { params, setParams };
14109
+ }
14127
14110
  const defaultProps$F = {
14111
+ title: "",
14112
+ content: "",
14113
+ footer: "",
14128
14114
  confirmText: "",
14129
14115
  cancelText: "",
14130
14116
  overlay: true,
@@ -14135,92 +14121,143 @@ var __publicField = (obj, key, value) => {
14135
14121
  footerDirection: "horizontal",
14136
14122
  lockScroll: true,
14137
14123
  beforeCancel: () => true,
14138
- beforeClose: () => true
14124
+ beforeClose: () => true,
14125
+ onOverlayClick: () => void 0
14139
14126
  };
14140
- const BaseDialog = React.forwardRef(
14141
- (props, ref) => {
14142
- const { locale } = useConfig$1();
14143
- const {
14127
+ const BaseDialog = (props) => {
14128
+ const classPrefix2 = "nut-dialog";
14129
+ const { locale } = useConfig$1();
14130
+ const {
14131
+ params: {
14132
+ id,
14144
14133
  visible,
14145
14134
  footer,
14135
+ title,
14136
+ footerDirection,
14146
14137
  hideConfirmButton,
14147
14138
  hideCancelButton,
14148
14139
  lockScroll,
14149
14140
  disableConfirmButton,
14150
14141
  closeOnOverlayClick,
14142
+ onOverlayClick,
14151
14143
  confirmText,
14152
14144
  cancelText,
14145
+ overlay,
14153
14146
  onClose,
14154
14147
  onCancel,
14155
14148
  onConfirm,
14156
14149
  beforeCancel,
14157
- beforeClose,
14158
- ...restProps
14159
- } = props;
14160
- const classPrefix2 = "nut-dialog";
14161
- const renderFooter = () => {
14162
- if (footer === null)
14163
- return "";
14164
- const handleCancel = (e) => {
14165
- e.stopPropagation();
14166
- if (!(beforeCancel == null ? void 0 : beforeCancel()))
14167
- return;
14168
- if (!(beforeClose == null ? void 0 : beforeClose()))
14169
- return;
14170
- onClose == null ? void 0 : onClose();
14171
- onCancel == null ? void 0 : onCancel();
14172
- };
14173
- const handleOk = (e) => {
14174
- e.stopPropagation();
14175
- onClose == null ? void 0 : onClose();
14176
- onConfirm == null ? void 0 : onConfirm(e);
14177
- };
14178
- return footer || /* @__PURE__ */ React.createElement(React.Fragment, null, !hideCancelButton && /* @__PURE__ */ React.createElement(
14179
- Button,
14180
- {
14181
- size: "small",
14182
- fill: "outline",
14183
- type: "primary",
14184
- className: `${classPrefix2}__footer-cancel`,
14185
- onClick: (e) => handleCancel(e)
14186
- },
14187
- cancelText || locale.cancel
14188
- ), !hideConfirmButton && /* @__PURE__ */ React.createElement(
14189
- Button,
14190
- {
14191
- size: "small",
14192
- type: "primary",
14193
- className: classNames(`${classPrefix2}__footer-ok`, {
14194
- disabled: disableConfirmButton
14195
- }),
14196
- disabled: disableConfirmButton,
14197
- onClick: (e) => handleOk(e)
14198
- },
14199
- confirmText || locale.confirm
14200
- ));
14150
+ beforeClose
14151
+ },
14152
+ setParams
14153
+ } = useParams({ ...defaultProps$F, ...props });
14154
+ useCustomEvent(
14155
+ id,
14156
+ ({ status, options }) => {
14157
+ if (status) {
14158
+ setParams({ ...options, visible: true });
14159
+ } else {
14160
+ setParams({ ...options, visible: false });
14161
+ }
14162
+ }
14163
+ );
14164
+ const renderFooter = () => {
14165
+ if (footer === null)
14166
+ return "";
14167
+ const handleCancel = (e) => {
14168
+ e.stopPropagation();
14169
+ if (!(beforeCancel == null ? void 0 : beforeCancel()))
14170
+ return;
14171
+ if (!(beforeClose == null ? void 0 : beforeClose()))
14172
+ return;
14173
+ onClose == null ? void 0 : onClose();
14174
+ onCancel == null ? void 0 : onCancel();
14201
14175
  };
14202
- return /* @__PURE__ */ React.createElement(
14203
- components.View,
14176
+ const handleOk = (e) => {
14177
+ e.stopPropagation();
14178
+ onClose == null ? void 0 : onClose();
14179
+ onConfirm == null ? void 0 : onConfirm(e);
14180
+ };
14181
+ return footer || /* @__PURE__ */ React.createElement(React.Fragment, null, !hideCancelButton && /* @__PURE__ */ React.createElement(
14182
+ Button,
14204
14183
  {
14205
- style: { display: visible ? "block" : "none" },
14206
- catchMove: lockScroll
14184
+ size: "small",
14185
+ fill: "outline",
14186
+ type: "primary",
14187
+ className: `${classPrefix2}__footer-cancel`,
14188
+ onClick: (e) => handleCancel(e)
14189
+ },
14190
+ cancelText || locale.cancel
14191
+ ), !hideConfirmButton && /* @__PURE__ */ React.createElement(
14192
+ Button,
14193
+ {
14194
+ size: "small",
14195
+ type: "primary",
14196
+ className: classNames(`${classPrefix2}__footer-ok`, {
14197
+ disabled: disableConfirmButton
14198
+ }),
14199
+ disabled: disableConfirmButton,
14200
+ onClick: (e) => handleOk(e)
14201
+ },
14202
+ confirmText || locale.confirm
14203
+ ));
14204
+ };
14205
+ const onHandleClickOverlay = (e) => {
14206
+ console.log("onClose?.()", closeOnOverlayClick);
14207
+ if (closeOnOverlayClick && visible && e.target === e.currentTarget) {
14208
+ const closed = onOverlayClick && onOverlayClick();
14209
+ closed && (onClose == null ? void 0 : onClose());
14210
+ closed && (onCancel == null ? void 0 : onCancel());
14211
+ }
14212
+ };
14213
+ console.log("props", props, visible);
14214
+ return /* @__PURE__ */ React.createElement(
14215
+ components.View,
14216
+ {
14217
+ style: { display: visible ? "block" : "none" },
14218
+ catchMove: lockScroll
14219
+ },
14220
+ /* @__PURE__ */ React.createElement(React.Fragment, null, overlay ? /* @__PURE__ */ React.createElement(
14221
+ Overlay,
14222
+ {
14223
+ visible: true,
14224
+ closeOnOverlayClick,
14225
+ lockScroll,
14226
+ onClick: onHandleClickOverlay
14227
+ }
14228
+ ) : null, /* @__PURE__ */ React.createElement(
14229
+ CSSTransition$1,
14230
+ {
14231
+ in: visible,
14232
+ timeout: 300,
14233
+ classNames: "fadeDialog",
14234
+ unmountOnExit: true,
14235
+ appear: true
14207
14236
  },
14208
14237
  /* @__PURE__ */ React.createElement(
14209
- DialogWrap,
14238
+ Content,
14210
14239
  {
14211
- ...props,
14212
- visible,
14213
- lockScroll,
14240
+ title,
14214
14241
  footer: renderFooter(),
14215
- onClose,
14216
- onCancel
14242
+ footerDirection,
14243
+ visible
14217
14244
  }
14218
14245
  )
14219
- );
14220
- }
14221
- );
14246
+ ))
14247
+ );
14248
+ };
14249
+ function open$1(selector, options) {
14250
+ const path = useCustomEventsPath(selector);
14251
+ customEvents.trigger(path, { status: true, options });
14252
+ }
14253
+ function close$1(selector) {
14254
+ const path = useCustomEventsPath(selector);
14255
+ customEvents.trigger(path, { status: false });
14256
+ }
14222
14257
  BaseDialog.defaultProps = defaultProps$F;
14223
14258
  BaseDialog.displayName = "NutDialog";
14259
+ BaseDialog.open = open$1;
14260
+ BaseDialog.close = close$1;
14224
14261
  const defaultProps$E = {
14225
14262
  ...ComponentDefaults,
14226
14263
  attract: false,
@@ -14958,28 +14995,6 @@ var __publicField = (obj, key, value) => {
14958
14995
  };
14959
14996
  NoticeBar.defaultProps = defaultProps$A;
14960
14997
  NoticeBar.displayName = "NutNoticeBar";
14961
- const customEvents = new Taro.Events();
14962
- function useCustomEventsPath(selector) {
14963
- var _a;
14964
- const path = (_a = Taro.getCurrentInstance().router) == null ? void 0 : _a.path;
14965
- return path ? `${path}__${selector}` : selector;
14966
- }
14967
- function useCustomEvent(selector, cb) {
14968
- const path = useCustomEventsPath(selector);
14969
- React.useEffect(() => {
14970
- customEvents.on(path, cb);
14971
- return () => {
14972
- customEvents.off(path);
14973
- };
14974
- }, []);
14975
- const trigger = (args) => {
14976
- customEvents.trigger(path, args);
14977
- };
14978
- const off = () => {
14979
- customEvents.off(path);
14980
- };
14981
- return [trigger, off];
14982
- }
14983
14998
  const defaultProps$z = {
14984
14999
  ...ComponentDefaults,
14985
15000
  id: "",
@@ -15008,26 +15023,26 @@ var __publicField = (obj, key, value) => {
15008
15023
  onClick
15009
15024
  } = { ...defaultProps$z, ...props };
15010
15025
  useCustomEvent(id, (status) => {
15011
- status ? show() : hide();
15026
+ status ? show2() : hide2();
15012
15027
  });
15013
15028
  let timer;
15014
15029
  const [showNotify, setShowNotify] = React.useState(false);
15015
15030
  React.useEffect(() => {
15016
15031
  if (visible) {
15017
- show();
15032
+ show2();
15018
15033
  } else {
15019
- hide();
15034
+ hide2();
15020
15035
  }
15021
15036
  }, [visible]);
15022
15037
  const clickHandle = () => {
15023
15038
  onClick();
15024
15039
  };
15025
- const show = () => {
15040
+ const show2 = () => {
15026
15041
  setShowNotify(true);
15027
15042
  clearTimer();
15028
15043
  if (duration) {
15029
15044
  timer = window.setTimeout(() => {
15030
- hide();
15045
+ hide2();
15031
15046
  }, duration);
15032
15047
  }
15033
15048
  };
@@ -15037,7 +15052,7 @@ var __publicField = (obj, key, value) => {
15037
15052
  timer = null;
15038
15053
  }
15039
15054
  };
15040
- const hide = () => {
15055
+ const hide2 = () => {
15041
15056
  setShowNotify(false);
15042
15057
  onClose();
15043
15058
  };
@@ -15905,57 +15920,69 @@ var __publicField = (obj, key, value) => {
15905
15920
  const classPrefix$8 = "nut-toast";
15906
15921
  const Toast = (props) => {
15907
15922
  const {
15908
- children,
15909
- id,
15910
- position,
15911
- contentStyle,
15912
- icon,
15913
- iconSize,
15914
- msg,
15915
- duration,
15916
- type: type2,
15917
- title,
15918
- closeOnOverlayClick,
15919
- lockScroll,
15920
- contentClassName,
15921
- size,
15922
- visible,
15923
- className,
15924
- style,
15925
- onClose,
15926
- ...rest
15927
- } = { ...defaultProps$s, ...props };
15923
+ params: {
15924
+ id,
15925
+ position,
15926
+ contentStyle,
15927
+ icon,
15928
+ iconSize,
15929
+ msg,
15930
+ duration,
15931
+ type: type2,
15932
+ title,
15933
+ closeOnOverlayClick,
15934
+ lockScroll,
15935
+ contentClassName,
15936
+ size,
15937
+ visible,
15938
+ className,
15939
+ style,
15940
+ onClose
15941
+ },
15942
+ setParams
15943
+ } = useParams({ ...defaultProps$s, ...props });
15928
15944
  let timer;
15929
15945
  const [openState, SetOpenState] = React.useState(false);
15930
15946
  React.useEffect(() => {
15931
15947
  if (visible) {
15932
- SetOpenState(true);
15933
- show();
15948
+ show2();
15934
15949
  } else {
15935
- hide();
15950
+ hide2();
15936
15951
  }
15937
15952
  }, [visible]);
15953
+ useCustomEvent(
15954
+ id,
15955
+ ({ status, options }) => {
15956
+ if (status) {
15957
+ setParams(options);
15958
+ show2();
15959
+ } else {
15960
+ hide2();
15961
+ }
15962
+ }
15963
+ );
15938
15964
  const clearTimer = () => {
15939
15965
  if (timer) {
15940
15966
  clearTimeout(timer);
15941
15967
  timer = null;
15942
15968
  }
15943
15969
  };
15944
- const hide = () => {
15970
+ const hide2 = () => {
15945
15971
  SetOpenState(false);
15946
- onClose();
15972
+ onClose == null ? void 0 : onClose();
15947
15973
  };
15948
- const show = () => {
15974
+ const show2 = () => {
15949
15975
  clearTimer();
15976
+ SetOpenState(true);
15950
15977
  if (duration) {
15951
15978
  timer = window.setTimeout(() => {
15952
- hide();
15979
+ hide2();
15953
15980
  }, duration * 1e3);
15954
15981
  }
15955
15982
  };
15956
15983
  const clickCover = () => {
15957
15984
  if (closeOnOverlayClick) {
15958
- hide();
15985
+ hide2();
15959
15986
  }
15960
15987
  };
15961
15988
  const hasIcon = () => {
@@ -16003,8 +16030,18 @@ var __publicField = (obj, key, value) => {
16003
16030
  ))
16004
16031
  ) : null);
16005
16032
  };
16033
+ function show(selector, options) {
16034
+ const path = useCustomEventsPath(selector);
16035
+ customEvents.trigger(path, { status: true, options });
16036
+ }
16037
+ function hide(selector) {
16038
+ const path = useCustomEventsPath(selector);
16039
+ customEvents.trigger(path, { status: false });
16040
+ }
16006
16041
  Toast.defaultProps = defaultProps$s;
16007
16042
  Toast.displayName = "NutToast";
16043
+ Toast.show = show;
16044
+ Toast.hide = hide;
16008
16045
  const defaultProps$r = {
16009
16046
  ...ComponentDefaults,
16010
16047
  type: "shake",
@@ -20,10 +20,6 @@
20
20
  background: $skeleton-background;
21
21
  margin-top: 10px;
22
22
  border-radius: $skeleton-line-border-radius;
23
-
24
- &:last-child {
25
- width: 70%;
26
- }
27
23
  }
28
24
 
29
25
  &-line {
@@ -36,6 +32,9 @@
36
32
  height: $skeleton-line-height;
37
33
  background: $skeleton-background;
38
34
  }
35
+ .nut-skeleton__block:last-child {
36
+ width: 70%;
37
+ }
39
38
  }
40
39
  }
41
40