@rockshin/tao-ui 0.0.57 → 0.0.59

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 (109) hide show
  1. package/dist/components/affix/affix.js +38 -4
  2. package/dist/components/app/app-modals.js +11 -6
  3. package/dist/components/app/app-notices.js +112 -47
  4. package/dist/components/auto-complete/auto-complete.js +9 -2
  5. package/dist/components/avatar/avatar.js +1 -1
  6. package/dist/components/badge/badge.js +2 -2
  7. package/dist/components/breadcrumb/breadcrumb.js +5 -1
  8. package/dist/components/calendar/calendar.js +24 -17
  9. package/dist/components/carousel/carousel.js +35 -16
  10. package/dist/components/cascader/cascader.js +17 -12
  11. package/dist/components/checkbox/checkbox.d.ts +3 -1
  12. package/dist/components/checkbox/checkbox.js +65 -58
  13. package/dist/components/collapse/collapse-panels.js +68 -67
  14. package/dist/components/color-picker/color-picker.js +383 -360
  15. package/dist/components/date-picker/calendar/calendar-grid.d.ts +5 -3
  16. package/dist/components/date-picker/calendar/calendar-grid.js +9 -4
  17. package/dist/components/date-picker/calendar/month-grid.d.ts +2 -1
  18. package/dist/components/date-picker/calendar/month-grid.js +61 -45
  19. package/dist/components/date-picker/calendar/time-panel.d.ts +8 -1
  20. package/dist/components/date-picker/calendar/time-panel.js +89 -88
  21. package/dist/components/date-picker/calendar/year-grid.d.ts +2 -1
  22. package/dist/components/date-picker/calendar/year-grid.js +60 -44
  23. package/dist/components/date-picker/date-localization.js +12 -14
  24. package/dist/components/date-picker/date-picker.css +9 -0
  25. package/dist/components/date-picker/date-picker.js +22 -13
  26. package/dist/components/date-picker/range-picker.d.ts +2 -0
  27. package/dist/components/date-picker/range-picker.js +127 -70
  28. package/dist/components/date-picker/types.js +1 -1
  29. package/dist/components/divider/divider.js +1 -1
  30. package/dist/components/drawer/drawer.d.ts +1 -1
  31. package/dist/components/drawer/drawer.js +4 -3
  32. package/dist/components/dropdown/dropdown.js +11 -9
  33. package/dist/components/float-button/float-button.js +11 -9
  34. package/dist/components/form/form-item.d.ts +1 -1
  35. package/dist/components/form/form-item.js +160 -120
  36. package/dist/components/form-field/form-field-view.d.ts +2 -1
  37. package/dist/components/form-field/form-field-view.js +173 -108
  38. package/dist/components/image/image.js +135 -143
  39. package/dist/components/input/input-shared.js +3 -2
  40. package/dist/components/input/otp.js +120 -110
  41. package/dist/components/input/password.js +55 -61
  42. package/dist/components/input/search.js +13 -7
  43. package/dist/components/list/list.js +106 -105
  44. package/dist/components/masonry/masonry.js +1 -1
  45. package/dist/components/mentions/mentions.js +1 -0
  46. package/dist/components/menu/menu-render.js +1 -0
  47. package/dist/components/modal/confirm-dialog.js +11 -4
  48. package/dist/components/modal/modal.js +320 -315
  49. package/dist/components/pagination/pagination.d.ts +3 -0
  50. package/dist/components/pagination/pagination.js +5 -0
  51. package/dist/components/popover/popover.js +325 -289
  52. package/dist/components/qr-code/qr-code.js +157 -150
  53. package/dist/components/radio/radio.d.ts +3 -1
  54. package/dist/components/radio/radio.js +73 -64
  55. package/dist/components/rate/rate.js +83 -72
  56. package/dist/components/scroll-area/scroll-area.css +1 -1
  57. package/dist/components/scroll-area/scroll-area.js +294 -222
  58. package/dist/components/select/mobile-select.js +6 -3
  59. package/dist/components/select/select-model.js +2 -2
  60. package/dist/components/select/select.js +78 -39
  61. package/dist/components/select/use-select-selection.d.ts +1 -1
  62. package/dist/components/select/use-select-selection.js +91 -84
  63. package/dist/components/slider/slider.d.ts +2 -2
  64. package/dist/components/slider/slider.js +13 -2
  65. package/dist/components/sonner/sonner.js +2 -2
  66. package/dist/components/splitter/splitter.css +1 -0
  67. package/dist/components/splitter/splitter.js +152 -126
  68. package/dist/components/statistic/statistic.js +84 -78
  69. package/dist/components/steps/steps.js +1 -1
  70. package/dist/components/switch/switch.js +45 -39
  71. package/dist/components/table/table.js +5 -1
  72. package/dist/components/table/use-table-data.js +2 -2
  73. package/dist/components/time-picker/time-picker.js +31 -1
  74. package/dist/components/tooltip/tooltip.js +237 -99
  75. package/dist/components/tree/tree.js +31 -3
  76. package/dist/components/tree-select/tree-select.js +1 -1
  77. package/dist/components/upload/upload.js +69 -42
  78. package/dist/locales/ar-EG.js +2 -0
  79. package/dist/locales/de-DE.js +2 -0
  80. package/dist/locales/en-US.js +2 -0
  81. package/dist/locales/es-ES.js +2 -0
  82. package/dist/locales/fr-FR.js +2 -0
  83. package/dist/locales/hi-IN.js +2 -0
  84. package/dist/locales/id-ID.js +2 -0
  85. package/dist/locales/it-IT.js +2 -0
  86. package/dist/locales/ja-JP.js +2 -0
  87. package/dist/locales/ko-KR.js +2 -0
  88. package/dist/locales/pt-BR.js +2 -0
  89. package/dist/locales/ru-RU.js +2 -0
  90. package/dist/locales/th-TH.js +2 -0
  91. package/dist/locales/tr-TR.js +2 -0
  92. package/dist/locales/types.d.ts +2 -0
  93. package/dist/locales/vi-VN.js +2 -0
  94. package/dist/locales/zh-CN.js +2 -0
  95. package/dist/locales/zh-TW.js +2 -0
  96. package/dist/number-input/cursor.js +20 -8
  97. package/dist/number-input/format.js +13 -5
  98. package/dist/number-input/use-number-input.js +166 -318
  99. package/dist/number-input/validate.d.ts +1 -0
  100. package/dist/number-input/validate.js +1 -1
  101. package/dist/provider/tao-provider.d.ts +2 -2
  102. package/dist/provider/tao-provider.js +49 -49
  103. package/dist/utils/composed-parent.d.ts +1 -0
  104. package/dist/utils/composed-parent.js +7 -0
  105. package/dist/utils/portal.d.ts +5 -0
  106. package/dist/utils/portal.js +7 -1
  107. package/dist/utils/refs.d.ts +3 -1
  108. package/dist/utils/refs.js +25 -1
  109. package/package.json +1 -1
@@ -6,7 +6,7 @@ import { RemoveScroll } from "react-remove-scroll";
6
6
  import { TaoPortalScope, TaoProvider, useTaoConfig } from "../../provider/tao-provider.js";
7
7
  import { resolveResponsiveValue, useBreakpoint } from "../../utils/breakpoint.js";
8
8
  import { DialogContent } from "../../utils/dialog-content.js";
9
- import { preventParentOutsideDismiss } from "../../utils/portal.js";
9
+ import { isEscapeForOpenCombobox, preventParentOutsideDismiss } from "../../utils/portal.js";
10
10
  import { cx } from "../../utils/semantic.js";
11
11
  import { Button } from "../button/button.js";
12
12
  import { useWatermarkPanelRef } from "../watermark/watermark-context.js";
@@ -24,7 +24,7 @@ function CancelBtn() {
24
24
  return useContext(ModalActionContext).cancel;
25
25
  }
26
26
  function Modal(t0) {
27
- const $ = c(173);
27
+ const $ = c(174);
28
28
  const { direction, open, onClose, title, footer, onOk, okText, cancelText, confirmLoading, okButtonProps, cancelButtonProps, width: t1, centered: t2, closable: t3, maskClosable: t4, keyboard: t5, getContainer, mask: t6, zIndex, scrollLock: t7, closeIcon, modalRender, wrapProps, transitionName, maskTransitionName, focusTriggerAfterClose, autoFocusButton, focusable, afterClose, destroyOnHidden: t8, children, classNames, styles: stylesProp, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy } = t0;
29
29
  const width = void 0 === t1 ? 520 : t1;
30
30
  const centered = void 0 === t2 ? true : t2;
@@ -101,85 +101,88 @@ function Modal(t0) {
101
101
  $[13] = t16;
102
102
  } else t16 = $[13];
103
103
  const contentStyle = t16;
104
- let t17;
104
+ const t17 = cancelButtonProps?.disabled ?? false;
105
+ let t18;
105
106
  if ($[14] !== cancelButtonProps || $[15] !== onClose) {
106
- t17 = (event)=>{
107
+ t18 = (event)=>{
107
108
  cancelButtonProps?.onClick?.(event);
108
109
  if (!event.defaultPrevented) onClose?.();
109
110
  };
110
111
  $[14] = cancelButtonProps;
111
112
  $[15] = onClose;
112
- $[16] = t17;
113
- } else t17 = $[16];
114
- const t18 = void 0 === cancelText ? locale.cancel : cancelText;
115
- let t19;
116
- if ($[17] !== cancelButtonProps || $[18] !== t17 || $[19] !== t18) {
117
- t19 = /*#__PURE__*/ jsx(Button, {
113
+ $[16] = t18;
114
+ } else t18 = $[16];
115
+ const t19 = void 0 === cancelText ? locale.cancel : cancelText;
116
+ let t20;
117
+ if ($[17] !== cancelButtonProps || $[18] !== t17 || $[19] !== t18 || $[20] !== t19) {
118
+ t20 = /*#__PURE__*/ jsx(Button, {
118
119
  variant: "secondary",
119
120
  "data-tao-modal-action": "cancel",
120
121
  ...cancelButtonProps,
121
- onClick: t17,
122
- children: t18
122
+ disabled: t17,
123
+ onClick: t18,
124
+ children: t19
123
125
  });
124
126
  $[17] = cancelButtonProps;
125
127
  $[18] = t17;
126
128
  $[19] = t18;
127
129
  $[20] = t19;
128
- } else t19 = $[20];
129
- const cancelButton = t19;
130
- const t20 = confirmLoading || okButtonProps?.loading;
131
- let t21;
132
- if ($[21] !== okButtonProps || $[22] !== onOk) {
133
- t21 = (event_0)=>{
130
+ $[21] = t20;
131
+ } else t20 = $[21];
132
+ const cancelButton = t20;
133
+ const t21 = confirmLoading || okButtonProps?.loading;
134
+ let t22;
135
+ if ($[22] !== okButtonProps || $[23] !== onOk) {
136
+ t22 = (event_0)=>{
134
137
  okButtonProps?.onClick?.(event_0);
135
138
  if (!event_0.defaultPrevented) onOk?.();
136
139
  };
137
- $[21] = okButtonProps;
138
- $[22] = onOk;
139
- $[23] = t21;
140
- } else t21 = $[23];
141
- const t22 = void 0 === okText ? locale.ok : okText;
142
- let t23;
143
- if ($[24] !== okButtonProps || $[25] !== t20 || $[26] !== t21 || $[27] !== t22) {
144
- t23 = /*#__PURE__*/ jsx(Button, {
140
+ $[22] = okButtonProps;
141
+ $[23] = onOk;
142
+ $[24] = t22;
143
+ } else t22 = $[24];
144
+ const t23 = void 0 === okText ? locale.ok : okText;
145
+ let t24;
146
+ if ($[25] !== okButtonProps || $[26] !== t21 || $[27] !== t22 || $[28] !== t23) {
147
+ t24 = /*#__PURE__*/ jsx(Button, {
145
148
  variant: "primary",
146
149
  "data-tao-modal-action": "ok",
147
150
  ...okButtonProps,
148
- loading: t20,
149
- onClick: t21,
150
- children: t22
151
+ loading: t21,
152
+ onClick: t22,
153
+ children: t23
151
154
  });
152
- $[24] = okButtonProps;
153
- $[25] = t20;
155
+ $[25] = okButtonProps;
154
156
  $[26] = t21;
155
157
  $[27] = t22;
156
158
  $[28] = t23;
157
- } else t23 = $[28];
158
- const okButton = t23;
159
- let t24;
160
- if ($[29] === Symbol.for("react.memo_cache_sentinel")) {
161
- t24 = /*#__PURE__*/ jsxs(Fragment, {
159
+ $[29] = t24;
160
+ } else t24 = $[29];
161
+ const okButton = t24;
162
+ let t25;
163
+ if ($[30] === Symbol.for("react.memo_cache_sentinel")) {
164
+ t25 = /*#__PURE__*/ jsxs(Fragment, {
162
165
  children: [
163
166
  /*#__PURE__*/ jsx(CancelBtn, {}),
164
167
  /*#__PURE__*/ jsx(OkBtn, {})
165
168
  ]
166
169
  });
167
- $[29] = t24;
168
- } else t24 = $[29];
169
- const defaultFooter = t24;
170
+ $[30] = t25;
171
+ } else t25 = $[30];
172
+ const defaultFooter = t25;
170
173
  let footerContent;
171
174
  if (void 0 === footer) footerContent = defaultFooter;
172
175
  else if ("function" == typeof footer) {
173
- let t25;
174
- if ($[30] !== footer) {
175
- t25 = footer(defaultFooter, {
176
+ let t26;
177
+ if ($[31] !== footer) {
178
+ t26 = footer(defaultFooter, {
176
179
  OkBtn: OkBtn,
177
180
  CancelBtn: CancelBtn
178
181
  });
179
- $[30] = footer;
180
- $[31] = t25;
181
- } else t25 = $[31];
182
- footerContent = t25;
182
+ $[31] = footer;
183
+ $[32] = t26;
184
+ } else t26 = $[32];
185
+ footerContent = t26;
183
186
  } else footerContent = footer;
184
187
  const keepAlive = !destroyOnHidden;
185
188
  const forceMount = keepAlive ? true : void 0;
@@ -190,9 +193,9 @@ function Modal(t0) {
190
193
  const showClose = closable && null !== mergedCloseIcon && false !== mergedCloseIcon;
191
194
  const trapFocus = focusable?.trap ?? true;
192
195
  const customInteraction = !scrollLock || !trapFocus;
193
- let t25;
194
- if ($[32] !== autoFocusButton || $[33] !== focusable) {
195
- t25 = (event_1)=>{
196
+ let t26;
197
+ if ($[33] !== autoFocusButton || $[34] !== focusable) {
198
+ t26 = (event_1)=>{
196
199
  restoreFocusRef.current = document.activeElement;
197
200
  const button = focusable?.autoFocusButton !== void 0 ? focusable.autoFocusButton : autoFocusButton;
198
201
  if (null === button) event_1.preventDefault();
@@ -202,26 +205,26 @@ function Modal(t0) {
202
205
  if (target && document.activeElement === target) event_1.preventDefault();
203
206
  }
204
207
  };
205
- $[32] = autoFocusButton;
206
- $[33] = focusable;
207
- $[34] = t25;
208
- } else t25 = $[34];
209
- const openAutoFocus = t25;
210
- let t26;
211
- if ($[35] !== focusTriggerAfterClose || $[36] !== focusable?.focusTriggerAfterClose) {
212
- t26 = (event_2)=>{
208
+ $[33] = autoFocusButton;
209
+ $[34] = focusable;
210
+ $[35] = t26;
211
+ } else t26 = $[35];
212
+ const openAutoFocus = t26;
213
+ let t27;
214
+ if ($[36] !== focusTriggerAfterClose || $[37] !== focusable?.focusTriggerAfterClose) {
215
+ t27 = (event_2)=>{
213
216
  const restore = focusable?.focusTriggerAfterClose ?? focusTriggerAfterClose;
214
217
  if (void 0 !== restore) event_2.preventDefault();
215
218
  if (restore) restoreFocusRef.current?.focus();
216
219
  };
217
- $[35] = focusTriggerAfterClose;
218
- $[36] = focusable?.focusTriggerAfterClose;
219
- $[37] = t26;
220
- } else t26 = $[37];
221
- const closeAutoFocus = t26;
222
- let t27;
223
- if ($[38] !== classNames?.close || $[39] !== classNames?.header || $[40] !== classNames?.title || $[41] !== closeConfig || $[42] !== locale || $[43] !== mergedCloseIcon || $[44] !== onClose || $[45] !== showClose || $[46] !== stylesProp?.close || $[47] !== stylesProp?.header || $[48] !== stylesProp?.title || $[49] !== title) {
224
- t27 = (null != title || showClose) && /*#__PURE__*/ jsxs("div", {
220
+ $[36] = focusTriggerAfterClose;
221
+ $[37] = focusable?.focusTriggerAfterClose;
222
+ $[38] = t27;
223
+ } else t27 = $[38];
224
+ const closeAutoFocus = t27;
225
+ let t28;
226
+ if ($[39] !== classNames?.close || $[40] !== classNames?.header || $[41] !== classNames?.title || $[42] !== closeConfig || $[43] !== locale || $[44] !== mergedCloseIcon || $[45] !== onClose || $[46] !== showClose || $[47] !== stylesProp?.close || $[48] !== stylesProp?.header || $[49] !== stylesProp?.title || $[50] !== title) {
227
+ t28 = (null != title || showClose) && /*#__PURE__*/ jsxs("div", {
225
228
  "data-tao-modal-header": "",
226
229
  className: cx(classNames?.header),
227
230
  style: stylesProp?.header,
@@ -252,44 +255,44 @@ function Modal(t0) {
252
255
  })
253
256
  ]
254
257
  });
255
- $[38] = classNames?.close;
256
- $[39] = classNames?.header;
257
- $[40] = classNames?.title;
258
- $[41] = closeConfig;
259
- $[42] = locale;
260
- $[43] = mergedCloseIcon;
261
- $[44] = onClose;
262
- $[45] = showClose;
263
- $[46] = stylesProp?.close;
264
- $[47] = stylesProp?.header;
265
- $[48] = stylesProp?.title;
266
- $[49] = title;
267
- $[50] = t27;
268
- } else t27 = $[50];
269
- const t28 = classNames?.body;
270
- let t29;
271
- if ($[51] !== t28) {
272
- t29 = cx(t28);
258
+ $[39] = classNames?.close;
259
+ $[40] = classNames?.header;
260
+ $[41] = classNames?.title;
261
+ $[42] = closeConfig;
262
+ $[43] = locale;
263
+ $[44] = mergedCloseIcon;
264
+ $[45] = onClose;
265
+ $[46] = showClose;
266
+ $[47] = stylesProp?.close;
267
+ $[48] = stylesProp?.header;
268
+ $[49] = stylesProp?.title;
269
+ $[50] = title;
273
270
  $[51] = t28;
271
+ } else t28 = $[51];
272
+ const t29 = classNames?.body;
273
+ let t30;
274
+ if ($[52] !== t29) {
275
+ t30 = cx(t29);
274
276
  $[52] = t29;
275
- } else t29 = $[52];
276
- const t30 = stylesProp?.body;
277
- let t31;
278
- if ($[53] !== children || $[54] !== t29 || $[55] !== t30) {
279
- t31 = /*#__PURE__*/ jsx("div", {
277
+ $[53] = t30;
278
+ } else t30 = $[53];
279
+ const t31 = stylesProp?.body;
280
+ let t32;
281
+ if ($[54] !== children || $[55] !== t30 || $[56] !== t31) {
282
+ t32 = /*#__PURE__*/ jsx("div", {
280
283
  "data-tao-modal-body": "",
281
- className: t29,
282
- style: t30,
284
+ className: t30,
285
+ style: t31,
283
286
  children: children
284
287
  });
285
- $[53] = children;
286
- $[54] = t29;
288
+ $[54] = children;
287
289
  $[55] = t30;
288
290
  $[56] = t31;
289
- } else t31 = $[56];
290
- let t32;
291
- if ($[57] !== cancelButton || $[58] !== classNames?.footer || $[59] !== footerContent || $[60] !== okButton || $[61] !== stylesProp?.footer) {
292
- t32 = null != footerContent && /*#__PURE__*/ jsx("div", {
291
+ $[57] = t32;
292
+ } else t32 = $[57];
293
+ let t33;
294
+ if ($[58] !== cancelButton || $[59] !== classNames?.footer || $[60] !== footerContent || $[61] !== okButton || $[62] !== stylesProp?.footer) {
295
+ t33 = null != footerContent && /*#__PURE__*/ jsx("div", {
293
296
  "data-tao-modal-footer": "",
294
297
  className: cx(classNames?.footer),
295
298
  style: stylesProp?.footer,
@@ -301,120 +304,120 @@ function Modal(t0) {
301
304
  children: footerContent
302
305
  })
303
306
  });
304
- $[57] = cancelButton;
305
- $[58] = classNames?.footer;
306
- $[59] = footerContent;
307
- $[60] = okButton;
308
- $[61] = stylesProp?.footer;
309
- $[62] = t32;
310
- } else t32 = $[62];
311
- let t33;
312
- if ($[63] !== t27 || $[64] !== t31 || $[65] !== t32) {
313
- t33 = /*#__PURE__*/ jsxs(Fragment, {
307
+ $[58] = cancelButton;
308
+ $[59] = classNames?.footer;
309
+ $[60] = footerContent;
310
+ $[61] = okButton;
311
+ $[62] = stylesProp?.footer;
312
+ $[63] = t33;
313
+ } else t33 = $[63];
314
+ let t34;
315
+ if ($[64] !== t28 || $[65] !== t32 || $[66] !== t33) {
316
+ t34 = /*#__PURE__*/ jsxs(Fragment, {
314
317
  children: [
315
- t27,
316
- t31,
317
- t32
318
+ t28,
319
+ t32,
320
+ t33
318
321
  ]
319
322
  });
320
- $[63] = t27;
321
- $[64] = t31;
323
+ $[64] = t28;
322
324
  $[65] = t32;
323
325
  $[66] = t33;
324
- } else t33 = $[66];
325
- const contents = t33;
326
- const t34 = classNames?.root;
327
- const t35 = classNames?.container;
328
- let t36;
329
- if ($[67] !== t34 || $[68] !== t35 || $[69] !== transitionName) {
330
- t36 = cx(t34, t35, transitionName);
331
326
  $[67] = t34;
332
- $[68] = t35;
333
- $[69] = transitionName;
334
- $[70] = t36;
335
- } else t36 = $[70];
327
+ } else t34 = $[67];
328
+ const contents = t34;
329
+ const t35 = classNames?.root;
330
+ const t36 = classNames?.container;
336
331
  let t37;
337
- if ($[71] !== ariaLabel || $[72] !== ariaLabelledBy) {
338
- t37 = ariaLabel || ariaLabelledBy ? {
332
+ if ($[68] !== t35 || $[69] !== t36 || $[70] !== transitionName) {
333
+ t37 = cx(t35, t36, transitionName);
334
+ $[68] = t35;
335
+ $[69] = t36;
336
+ $[70] = transitionName;
337
+ $[71] = t37;
338
+ } else t37 = $[71];
339
+ let t38;
340
+ if ($[72] !== ariaLabel || $[73] !== ariaLabelledBy) {
341
+ t38 = ariaLabel || ariaLabelledBy ? {
339
342
  "aria-labelledby": ariaLabelledBy
340
343
  } : {};
341
- $[71] = ariaLabel;
342
- $[72] = ariaLabelledBy;
343
- $[73] = t37;
344
- } else t37 = $[73];
345
- let t38;
346
- if ($[74] !== customInteraction || $[75] !== openAutoFocus) {
347
- t38 = customInteraction ? _temp : openAutoFocus;
348
- $[74] = customInteraction;
349
- $[75] = openAutoFocus;
350
- $[76] = t38;
351
- } else t38 = $[76];
344
+ $[72] = ariaLabel;
345
+ $[73] = ariaLabelledBy;
346
+ $[74] = t38;
347
+ } else t38 = $[74];
352
348
  let t39;
353
- if ($[77] !== closeAutoFocus || $[78] !== customInteraction) {
354
- t39 = customInteraction ? _temp2 : closeAutoFocus;
355
- $[77] = closeAutoFocus;
356
- $[78] = customInteraction;
357
- $[79] = t39;
358
- } else t39 = $[79];
349
+ if ($[75] !== customInteraction || $[76] !== openAutoFocus) {
350
+ t39 = customInteraction ? _temp : openAutoFocus;
351
+ $[75] = customInteraction;
352
+ $[76] = openAutoFocus;
353
+ $[77] = t39;
354
+ } else t39 = $[77];
359
355
  let t40;
360
- if ($[80] !== keyboard) {
361
- t40 = (event_5)=>{
362
- if (!keyboard) event_5.preventDefault();
363
- };
364
- $[80] = keyboard;
365
- $[81] = t40;
366
- } else t40 = $[81];
356
+ if ($[78] !== closeAutoFocus || $[79] !== customInteraction) {
357
+ t40 = customInteraction ? _temp2 : closeAutoFocus;
358
+ $[78] = closeAutoFocus;
359
+ $[79] = customInteraction;
360
+ $[80] = t40;
361
+ } else t40 = $[80];
367
362
  let t41;
368
- if ($[82] !== contents || $[83] !== customInteraction || $[84] !== focusRegistry) {
369
- t41 = customInteraction ? /*#__PURE__*/ jsx(ModalBranchProvider, {
363
+ if ($[81] !== keyboard) {
364
+ t41 = (event_5)=>{
365
+ if (!keyboard || isEscapeForOpenCombobox(event_5)) event_5.preventDefault();
366
+ };
367
+ $[81] = keyboard;
368
+ $[82] = t41;
369
+ } else t41 = $[82];
370
+ let t42;
371
+ if ($[83] !== contents || $[84] !== customInteraction || $[85] !== focusRegistry) {
372
+ t42 = customInteraction ? /*#__PURE__*/ jsx(ModalBranchProvider, {
370
373
  registry: focusRegistry,
371
374
  children: contents
372
375
  }) : contents;
373
- $[82] = contents;
374
- $[83] = customInteraction;
375
- $[84] = focusRegistry;
376
- $[85] = t41;
377
- } else t41 = $[85];
378
- let t42;
379
- if ($[86] !== ariaDescribedBy || $[87] !== ariaLabel || $[88] !== contentStyle || $[89] !== forceMount || $[90] !== keepAlive || $[91] !== open || $[92] !== setContentRef || $[93] !== t36 || $[94] !== t37 || $[95] !== t38 || $[96] !== t39 || $[97] !== t40 || $[98] !== t41) {
380
- t42 = /*#__PURE__*/ jsx(DialogContent, {
376
+ $[83] = contents;
377
+ $[84] = customInteraction;
378
+ $[85] = focusRegistry;
379
+ $[86] = t42;
380
+ } else t42 = $[86];
381
+ let t43;
382
+ if ($[87] !== ariaDescribedBy || $[88] !== ariaLabel || $[89] !== contentStyle || $[90] !== forceMount || $[91] !== keepAlive || $[92] !== open || $[93] !== setContentRef || $[94] !== t37 || $[95] !== t38 || $[96] !== t39 || $[97] !== t40 || $[98] !== t41 || $[99] !== t42) {
383
+ t43 = /*#__PURE__*/ jsx(DialogContent, {
381
384
  contentRef: setContentRef,
382
385
  open: open,
383
386
  keepAlive: keepAlive,
384
387
  forceMount: forceMount,
385
388
  "data-tao-modal": "",
386
389
  style: contentStyle,
387
- className: t36,
390
+ className: t37,
388
391
  "aria-modal": true,
389
392
  "aria-label": ariaLabel,
390
- ...t37,
393
+ ...t38,
391
394
  "aria-describedby": ariaDescribedBy,
392
- onOpenAutoFocus: t38,
393
- onCloseAutoFocus: t39,
394
- onEscapeKeyDown: t40,
395
+ onOpenAutoFocus: t39,
396
+ onCloseAutoFocus: t40,
397
+ onEscapeKeyDown: t41,
395
398
  onPointerDownOutside: preventParentOutsideDismiss,
396
399
  onInteractOutside: preventParentOutsideDismiss,
397
- children: t41
400
+ children: t42
398
401
  });
399
- $[86] = ariaDescribedBy;
400
- $[87] = ariaLabel;
401
- $[88] = contentStyle;
402
- $[89] = forceMount;
403
- $[90] = keepAlive;
404
- $[91] = open;
405
- $[92] = setContentRef;
406
- $[93] = t36;
402
+ $[87] = ariaDescribedBy;
403
+ $[88] = ariaLabel;
404
+ $[89] = contentStyle;
405
+ $[90] = forceMount;
406
+ $[91] = keepAlive;
407
+ $[92] = open;
408
+ $[93] = setContentRef;
407
409
  $[94] = t37;
408
410
  $[95] = t38;
409
411
  $[96] = t39;
410
412
  $[97] = t40;
411
413
  $[98] = t41;
412
414
  $[99] = t42;
413
- } else t42 = $[99];
414
- const content = t42;
415
- let t43;
416
- if ($[100] !== classNames?.mask || $[101] !== classNames?.overlay || $[102] !== closeOnMask || $[103] !== customInteraction || $[104] !== forceMount || $[105] !== keepAlive || $[106] !== mask || $[107] !== maskTransitionName || $[108] !== onClose || $[109] !== open || $[110] !== showMask || $[111] !== stylesProp?.mask || $[112] !== stylesProp?.overlay || $[113] !== zIndex) {
417
- t43 = !customInteraction && (!keepAlive || open) && /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_dialog_dabd8325.Overlay, {
415
+ $[100] = t43;
416
+ } else t43 = $[100];
417
+ const content = t43;
418
+ let t44;
419
+ if ($[101] !== classNames?.mask || $[102] !== classNames?.overlay || $[103] !== closeOnMask || $[104] !== customInteraction || $[105] !== forceMount || $[106] !== keepAlive || $[107] !== mask || $[108] !== maskTransitionName || $[109] !== onClose || $[110] !== open || $[111] !== showMask || $[112] !== stylesProp?.mask || $[113] !== stylesProp?.overlay || $[114] !== zIndex) {
420
+ t44 = !customInteraction && (!keepAlive || open) && /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_dialog_dabd8325.Overlay, {
418
421
  forceMount: forceMount,
419
422
  "data-tao-modal-overlay": "",
420
423
  className: cx(classNames?.overlay, classNames?.mask, maskTransitionName),
@@ -433,25 +436,25 @@ function Modal(t0) {
433
436
  },
434
437
  onClick: closeOnMask ? onClose : void 0
435
438
  });
436
- $[100] = classNames?.mask;
437
- $[101] = classNames?.overlay;
438
- $[102] = closeOnMask;
439
- $[103] = customInteraction;
440
- $[104] = forceMount;
441
- $[105] = keepAlive;
442
- $[106] = mask;
443
- $[107] = maskTransitionName;
444
- $[108] = onClose;
445
- $[109] = open;
446
- $[110] = showMask;
447
- $[111] = stylesProp?.mask;
448
- $[112] = stylesProp?.overlay;
449
- $[113] = zIndex;
450
- $[114] = t43;
451
- } else t43 = $[114];
452
- let t44;
453
- if ($[115] !== classNames?.mask || $[116] !== classNames?.overlay || $[117] !== closeOnMask || $[118] !== customInteraction || $[119] !== mask || $[120] !== maskTransitionName || $[121] !== onClose || $[122] !== open || $[123] !== showMask || $[124] !== stylesProp?.mask || $[125] !== stylesProp?.overlay || $[126] !== zIndex) {
454
- t44 = customInteraction && showMask && open && /*#__PURE__*/ jsx("div", {
439
+ $[101] = classNames?.mask;
440
+ $[102] = classNames?.overlay;
441
+ $[103] = closeOnMask;
442
+ $[104] = customInteraction;
443
+ $[105] = forceMount;
444
+ $[106] = keepAlive;
445
+ $[107] = mask;
446
+ $[108] = maskTransitionName;
447
+ $[109] = onClose;
448
+ $[110] = open;
449
+ $[111] = showMask;
450
+ $[112] = stylesProp?.mask;
451
+ $[113] = stylesProp?.overlay;
452
+ $[114] = zIndex;
453
+ $[115] = t44;
454
+ } else t44 = $[115];
455
+ let t45;
456
+ if ($[116] !== classNames?.mask || $[117] !== classNames?.overlay || $[118] !== closeOnMask || $[119] !== customInteraction || $[120] !== mask || $[121] !== maskTransitionName || $[122] !== onClose || $[123] !== open || $[124] !== showMask || $[125] !== stylesProp?.mask || $[126] !== stylesProp?.overlay || $[127] !== zIndex) {
457
+ t45 = customInteraction && showMask && open && /*#__PURE__*/ jsx("div", {
455
458
  "data-tao-modal-overlay": "",
456
459
  role: "presentation",
457
460
  className: cx(classNames?.overlay, classNames?.mask, maskTransitionName),
@@ -467,50 +470,50 @@ function Modal(t0) {
467
470
  if (closeOnMask && 0 === event_6.button) onClose?.();
468
471
  }
469
472
  });
470
- $[115] = classNames?.mask;
471
- $[116] = classNames?.overlay;
472
- $[117] = closeOnMask;
473
- $[118] = customInteraction;
474
- $[119] = mask;
475
- $[120] = maskTransitionName;
476
- $[121] = onClose;
477
- $[122] = open;
478
- $[123] = showMask;
479
- $[124] = stylesProp?.mask;
480
- $[125] = stylesProp?.overlay;
481
- $[126] = zIndex;
482
- $[127] = t44;
483
- } else t44 = $[127];
484
- const t45 = centered ? "" : void 0;
485
- const t46 = open ? "" : void 0;
486
- const t47 = classNames?.wrapper;
487
- const t48 = wrapProps?.className;
488
- let t49;
489
- if ($[128] !== t47 || $[129] !== t48) {
490
- t49 = cx(t47, t48);
491
- $[128] = t47;
473
+ $[116] = classNames?.mask;
474
+ $[117] = classNames?.overlay;
475
+ $[118] = closeOnMask;
476
+ $[119] = customInteraction;
477
+ $[120] = mask;
478
+ $[121] = maskTransitionName;
479
+ $[122] = onClose;
480
+ $[123] = open;
481
+ $[124] = showMask;
482
+ $[125] = stylesProp?.mask;
483
+ $[126] = stylesProp?.overlay;
484
+ $[127] = zIndex;
485
+ $[128] = t45;
486
+ } else t45 = $[128];
487
+ const t46 = centered ? "" : void 0;
488
+ const t47 = open ? "" : void 0;
489
+ const t48 = classNames?.wrapper;
490
+ const t49 = wrapProps?.className;
491
+ let t50;
492
+ if ($[129] !== t48 || $[130] !== t49) {
493
+ t50 = cx(t48, t49);
492
494
  $[129] = t48;
493
495
  $[130] = t49;
494
- } else t49 = $[130];
495
- const t50 = void 0 === zIndex ? void 0 : zIndex + 1;
496
- const t51 = stylesProp?.wrapper;
497
- const t52 = wrapProps?.style;
498
- let t53;
499
- if ($[131] !== t50 || $[132] !== t51 || $[133] !== t52) {
500
- t53 = {
496
+ $[131] = t50;
497
+ } else t50 = $[131];
498
+ const t51 = void 0 === zIndex ? void 0 : zIndex + 1;
499
+ const t52 = stylesProp?.wrapper;
500
+ const t53 = wrapProps?.style;
501
+ let t54;
502
+ if ($[132] !== t51 || $[133] !== t52 || $[134] !== t53) {
503
+ t54 = {
501
504
  pointerEvents: "none",
502
- zIndex: t50,
503
- ...t51,
504
- ...t52
505
+ zIndex: t51,
506
+ ...t52,
507
+ ...t53
505
508
  };
506
- $[131] = t50;
507
509
  $[132] = t51;
508
510
  $[133] = t52;
509
511
  $[134] = t53;
510
- } else t53 = $[134];
511
- let t54;
512
- if ($[135] !== closeAutoFocus || $[136] !== content || $[137] !== customInteraction || $[138] !== focusBranches || $[139] !== modalRender || $[140] !== open || $[141] !== openAutoFocus || $[142] !== scrollLock || $[143] !== trapFocus) {
513
- t54 = customInteraction ? /*#__PURE__*/ jsx(ModalInteractionScope, {
512
+ $[135] = t54;
513
+ } else t54 = $[135];
514
+ let t55;
515
+ if ($[136] !== closeAutoFocus || $[137] !== content || $[138] !== customInteraction || $[139] !== focusBranches || $[140] !== modalRender || $[141] !== open || $[142] !== openAutoFocus || $[143] !== scrollLock || $[144] !== trapFocus) {
516
+ t55 = customInteraction ? /*#__PURE__*/ jsx(ModalInteractionScope, {
514
517
  open: open,
515
518
  scrollLock: scrollLock,
516
519
  trapFocus: trapFocus,
@@ -519,110 +522,112 @@ function Modal(t0) {
519
522
  onCloseAutoFocus: closeAutoFocus,
520
523
  children: modalRender ? modalRender(content) : content
521
524
  }) : modalRender ? modalRender(content) : content;
522
- $[135] = closeAutoFocus;
523
- $[136] = content;
524
- $[137] = customInteraction;
525
- $[138] = focusBranches;
526
- $[139] = modalRender;
527
- $[140] = open;
528
- $[141] = openAutoFocus;
529
- $[142] = scrollLock;
530
- $[143] = trapFocus;
531
- $[144] = t54;
532
- } else t54 = $[144];
533
- let t55;
534
- if ($[145] !== t45 || $[146] !== t46 || $[147] !== t49 || $[148] !== t53 || $[149] !== t54 || $[150] !== wrapProps) {
535
- t55 = /*#__PURE__*/ jsx("div", {
525
+ $[136] = closeAutoFocus;
526
+ $[137] = content;
527
+ $[138] = customInteraction;
528
+ $[139] = focusBranches;
529
+ $[140] = modalRender;
530
+ $[141] = open;
531
+ $[142] = openAutoFocus;
532
+ $[143] = scrollLock;
533
+ $[144] = trapFocus;
534
+ $[145] = t55;
535
+ } else t55 = $[145];
536
+ let t56;
537
+ if ($[146] !== t46 || $[147] !== t47 || $[148] !== t50 || $[149] !== t54 || $[150] !== t55 || $[151] !== wrapProps) {
538
+ t56 = /*#__PURE__*/ jsx("div", {
536
539
  ...wrapProps,
537
540
  role: "presentation",
538
541
  "data-tao-modal-wrap": "",
539
- "data-tao-centered": t45,
540
- "data-tao-open": t46,
541
- className: t49,
542
- style: t53,
543
- children: t54
542
+ "data-tao-centered": t46,
543
+ "data-tao-open": t47,
544
+ className: t50,
545
+ style: t54,
546
+ children: t55
544
547
  });
545
- $[145] = t45;
546
548
  $[146] = t46;
547
- $[147] = t49;
548
- $[148] = t53;
549
+ $[147] = t47;
550
+ $[148] = t50;
549
551
  $[149] = t54;
550
- $[150] = wrapProps;
551
- $[151] = t55;
552
- } else t55 = $[151];
553
- let t56;
554
- if ($[152] !== t43 || $[153] !== t44 || $[154] !== t55) {
555
- t56 = /*#__PURE__*/ jsxs(TaoPortalScope, {
552
+ $[150] = t55;
553
+ $[151] = wrapProps;
554
+ $[152] = t56;
555
+ } else t56 = $[152];
556
+ let t57;
557
+ if ($[153] !== t44 || $[154] !== t45 || $[155] !== t56) {
558
+ t57 = /*#__PURE__*/ jsxs(TaoPortalScope, {
556
559
  children: [
557
- t43,
558
560
  t44,
559
- t55
561
+ t45,
562
+ t56
560
563
  ]
561
564
  });
562
- $[152] = t43;
563
565
  $[153] = t44;
564
- $[154] = t55;
566
+ $[154] = t45;
565
567
  $[155] = t56;
566
- } else t56 = $[155];
567
- const layer = t56;
568
- let container;
569
- if (getContainer && "u" > typeof document) {
570
- let t57;
571
- if ($[156] !== getContainer) {
572
- t57 = "string" == typeof getContainer ? document.querySelector(getContainer) ?? void 0 : "function" == typeof getContainer ? getContainer() : getContainer;
573
- $[156] = getContainer;
574
- $[157] = t57;
575
- } else t57 = $[157];
576
- container = t57;
577
- if (!container) throw new Error(`Modal getContainer did not resolve an element: ${getContainer}`);
578
- }
579
- const t57 = !customInteraction;
568
+ $[156] = t57;
569
+ } else t57 = $[156];
570
+ const layer = t57;
571
+ const [container, setContainer] = useState();
580
572
  let t58;
581
- if ($[158] !== onClose) {
582
- t58 = (value)=>{
573
+ if ($[157] !== getContainer) {
574
+ t58 = ()=>{
575
+ if (!getContainer) return;
576
+ const next = "string" == typeof getContainer ? document.querySelector(getContainer) : "function" == typeof getContainer ? getContainer() : getContainer;
577
+ if (!next) throw new Error(`Modal getContainer did not resolve an element: ${getContainer}`);
578
+ setContainer(next);
579
+ };
580
+ $[157] = getContainer;
581
+ $[158] = t58;
582
+ } else t58 = $[158];
583
+ useLayoutEffect(t58);
584
+ const t59 = !customInteraction;
585
+ let t60;
586
+ if ($[159] !== onClose) {
587
+ t60 = (value)=>{
583
588
  if (!value) onClose?.();
584
589
  };
585
- $[158] = onClose;
586
- $[159] = t58;
587
- } else t58 = $[159];
588
- let t59;
589
- if ($[160] !== container || $[161] !== forceMount || $[162] !== getContainer || $[163] !== layer) {
590
- t59 = false === getContainer ? layer : /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_dialog_dabd8325.Portal, {
590
+ $[159] = onClose;
591
+ $[160] = t60;
592
+ } else t60 = $[160];
593
+ let t61;
594
+ if ($[161] !== container || $[162] !== forceMount || $[163] !== getContainer || $[164] !== layer) {
595
+ t61 = false === getContainer ? layer : getContainer && !container ? null : /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_dialog_dabd8325.Portal, {
591
596
  forceMount: forceMount,
592
- container: container,
597
+ container: getContainer ? container : void 0,
593
598
  children: layer
594
599
  });
595
- $[160] = container;
596
- $[161] = forceMount;
597
- $[162] = getContainer;
598
- $[163] = layer;
599
- $[164] = t59;
600
- } else t59 = $[164];
601
- let t60;
602
- if ($[165] !== open || $[166] !== t57 || $[167] !== t58 || $[168] !== t59) {
603
- t60 = /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_dialog_dabd8325.Root, {
600
+ $[161] = container;
601
+ $[162] = forceMount;
602
+ $[163] = getContainer;
603
+ $[164] = layer;
604
+ $[165] = t61;
605
+ } else t61 = $[165];
606
+ let t62;
607
+ if ($[166] !== open || $[167] !== t59 || $[168] !== t60 || $[169] !== t61) {
608
+ t62 = /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_dialog_dabd8325.Root, {
604
609
  open: open,
605
- modal: t57,
606
- onOpenChange: t58,
607
- children: t59
610
+ modal: t59,
611
+ onOpenChange: t60,
612
+ children: t61
608
613
  });
609
- $[165] = open;
610
- $[166] = t57;
611
- $[167] = t58;
612
- $[168] = t59;
613
- $[169] = t60;
614
- } else t60 = $[169];
615
- let t61;
616
- if ($[170] !== direction || $[171] !== t60) {
617
- t61 = /*#__PURE__*/ jsx(TaoProvider, {
614
+ $[166] = open;
615
+ $[167] = t59;
616
+ $[168] = t60;
617
+ $[169] = t61;
618
+ $[170] = t62;
619
+ } else t62 = $[170];
620
+ let t63;
621
+ if ($[171] !== direction || $[172] !== t62) {
622
+ t63 = /*#__PURE__*/ jsx(TaoProvider, {
618
623
  direction: direction,
619
- children: t60
624
+ children: t62
620
625
  });
621
- $[170] = direction;
622
- $[171] = t60;
623
- $[172] = t61;
624
- } else t61 = $[172];
625
- return t61;
626
+ $[171] = direction;
627
+ $[172] = t62;
628
+ $[173] = t63;
629
+ } else t63 = $[173];
630
+ return t63;
626
631
  }
627
632
  function _temp2(event_4) {
628
633
  return event_4.preventDefault();