@rockshin/tao-ui 0.0.44 → 0.0.46
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/README.md +9 -1
- package/component-manifest.json +38 -4
- package/dist/components/alert/alert.js +20 -17
- package/dist/components/auto-complete/auto-complete.js +12 -3
- package/dist/components/avatar/avatar.js +2 -1
- package/dist/components/breadcrumb/breadcrumb.css +4 -0
- package/dist/components/breadcrumb/breadcrumb.js +82 -77
- package/dist/components/calendar/calendar.d.ts +1 -1
- package/dist/components/calendar/calendar.js +51 -33
- package/dist/components/card/card-tabs.js +204 -182
- package/dist/components/card/card.js +1 -1
- package/dist/components/carousel/carousel.js +11 -5
- package/dist/components/cascader/cascader.js +16 -4
- package/dist/components/collapse/collapse.css +8 -0
- package/dist/components/color-picker/color-picker.js +273 -269
- package/dist/components/context-menu/context-menu.d.ts +2 -1
- package/dist/components/context-menu/context-menu.js +57 -44
- package/dist/components/date-picker/calendar/calendar-grid.js +13 -6
- package/dist/components/date-picker/calendar/use-calendar.d.ts +2 -2
- package/dist/components/date-picker/calendar/use-calendar.js +2 -3
- package/dist/components/date-picker/date-localization.d.ts +3 -0
- package/dist/components/date-picker/date-localization.js +76 -0
- package/dist/components/date-picker/date-picker.css +4 -0
- package/dist/components/date-picker/date-picker.d.ts +1 -0
- package/dist/components/date-picker/date-picker.js +48 -30
- package/dist/components/date-picker/range-picker.d.ts +1 -0
- package/dist/components/date-picker/range-picker.js +41 -23
- package/dist/components/drawer/drawer.d.ts +2 -1
- package/dist/components/drawer/drawer.js +32 -20
- package/dist/components/dropdown/dropdown.d.ts +1 -0
- package/dist/components/dropdown/dropdown.js +160 -143
- package/dist/components/float-button/float-button.js +3 -2
- package/dist/components/form/form.js +88 -103
- package/dist/components/image/image.js +202 -137
- package/dist/components/list/list-pagination.js +148 -147
- package/dist/components/mentions/mentions.js +6 -2
- package/dist/components/modal/confirm-dialog.js +4 -2
- package/dist/components/modal/modal.d.ts +2 -1
- package/dist/components/modal/modal.js +387 -375
- package/dist/components/pagination/pagination.css +4 -0
- package/dist/components/pagination/pagination.js +115 -110
- package/dist/components/popconfirm/popconfirm.js +109 -107
- package/dist/components/popover/popover.d.ts +2 -1
- package/dist/components/popover/popover.js +185 -176
- package/dist/components/qr-code/qr-code.js +22 -21
- package/dist/components/rate/rate.js +114 -88
- package/dist/components/scroll-area/scroll-area.js +132 -120
- package/dist/components/segmented/segmented.js +52 -29
- package/dist/components/select/mobile-select.d.ts +3 -2
- package/dist/components/select/mobile-select.js +54 -48
- package/dist/components/select/select-types.d.ts +1 -0
- package/dist/components/select/select.js +19 -6
- package/dist/components/slider/slider.js +136 -133
- package/dist/components/sonner/sonner.js +10 -10
- package/dist/components/spinner/spinner.js +1 -1
- package/dist/components/splitter/splitter.css +4 -0
- package/dist/components/splitter/splitter.js +29 -24
- package/dist/components/statistic/statistic.d.ts +2 -0
- package/dist/components/statistic/statistic.js +203 -187
- package/dist/components/table/table-filter.js +61 -52
- package/dist/components/table/table-icons.js +3 -1
- package/dist/components/table/table.css +29 -11
- package/dist/components/table/table.d.ts +1 -1
- package/dist/components/table/table.js +384 -547
- package/dist/components/tabs/tabs.js +3 -2
- package/dist/components/tag/tag.js +22 -19
- package/dist/components/time-picker/time-picker.d.ts +0 -1
- package/dist/components/time-picker/time-picker.js +160 -103
- package/dist/components/tooltip/tooltip.d.ts +2 -1
- package/dist/components/tooltip/tooltip.js +82 -71
- package/dist/components/transfer/transfer-list.js +224 -488
- package/dist/components/transfer/transfer-parts.js +14 -4
- package/dist/components/transfer/transfer-types.d.ts +1 -0
- package/dist/components/transfer/transfer.js +23 -20
- package/dist/components/tree/tree-keyboard.d.ts +6 -0
- package/dist/components/tree/tree-keyboard.js +27 -0
- package/dist/components/tree/tree.js +14 -3
- package/dist/components/tree-select/select-engine.d.ts +2 -1
- package/dist/components/tree-select/select-engine.js +23 -15
- package/dist/components/tree-select/tree-select.js +20 -10
- package/dist/components/upload/upload.js +30 -26
- package/dist/docs/component-docs.d.ts +13 -2
- package/dist/docs/components/headless-input-number.doc.d.ts +5 -0
- package/dist/docs/components/headless-input-number.doc.js +7 -0
- package/dist/docs/components/input-number.doc.d.ts +5 -0
- package/dist/docs/components/input-number.doc.js +7 -0
- package/dist/docs/components/statistic.doc.d.ts +5 -0
- package/dist/docs/components/statistic.doc.js +7 -0
- package/dist/docs/components/tao-provider.doc.d.ts +8 -2
- package/dist/docs/components/tao-provider.doc.js +16 -3
- package/dist/docs/components/tooltip.doc.d.ts +2 -2
- package/dist/entries/provider.d.ts +2 -1
- package/dist/entries/provider.js +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -0
- package/dist/locales/ar-EG.d.ts +3 -0
- package/dist/locales/ar-EG.js +199 -0
- package/dist/locales/create-locale.d.ts +41 -0
- package/dist/locales/create-locale.js +88 -0
- package/dist/locales/de-DE.d.ts +3 -0
- package/dist/locales/de-DE.js +195 -0
- package/dist/locales/en-US.d.ts +2 -0
- package/dist/locales/en-US.js +194 -0
- package/dist/locales/es-ES.d.ts +3 -0
- package/dist/locales/es-ES.js +195 -0
- package/dist/locales/fr-FR.d.ts +3 -0
- package/dist/locales/fr-FR.js +195 -0
- package/dist/locales/hi-IN.d.ts +3 -0
- package/dist/locales/hi-IN.js +194 -0
- package/dist/locales/id-ID.d.ts +3 -0
- package/dist/locales/id-ID.js +194 -0
- package/dist/locales/index.d.ts +18 -0
- package/dist/locales/index.js +17 -0
- package/dist/locales/it-IT.d.ts +3 -0
- package/dist/locales/it-IT.js +195 -0
- package/dist/locales/ja-JP.d.ts +3 -0
- package/dist/locales/ja-JP.js +194 -0
- package/dist/locales/ko-KR.d.ts +3 -0
- package/dist/locales/ko-KR.js +194 -0
- package/dist/locales/pt-BR.d.ts +3 -0
- package/dist/locales/pt-BR.js +195 -0
- package/dist/locales/ru-RU.d.ts +3 -0
- package/dist/locales/ru-RU.js +197 -0
- package/dist/locales/th-TH.d.ts +3 -0
- package/dist/locales/th-TH.js +194 -0
- package/dist/locales/tr-TR.d.ts +3 -0
- package/dist/locales/tr-TR.js +194 -0
- package/dist/locales/types.d.ts +176 -0
- package/dist/locales/types.js +0 -0
- package/dist/locales/vi-VN.d.ts +3 -0
- package/dist/locales/vi-VN.js +194 -0
- package/dist/locales/zh-CN.d.ts +3 -0
- package/dist/locales/zh-CN.js +194 -0
- package/dist/locales/zh-TW.d.ts +3 -0
- package/dist/locales/zh-TW.js +194 -0
- package/dist/number-input/format.d.ts +4 -3
- package/dist/number-input/format.js +9 -7
- package/dist/number-input/locale.d.ts +19 -0
- package/dist/number-input/locale.js +44 -0
- package/dist/number-input/number-input.js +1 -0
- package/dist/number-input/use-number-input.d.ts +2 -0
- package/dist/number-input/use-number-input.js +180 -176
- package/dist/provider/locale.d.ts +3 -65
- package/dist/provider/locale.js +2 -146
- package/dist/provider/merge-locale.d.ts +8 -0
- package/dist/provider/merge-locale.js +53 -0
- package/dist/provider/tao-provider.d.ts +16 -5
- package/dist/provider/tao-provider.js +200 -92
- package/dist/utils/scroll-left.d.ts +3 -0
- package/dist/utils/scroll-left.js +7 -0
- package/llms.txt +3 -3
- package/package.json +5 -1
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { c } from "react-compiler-runtime";
|
|
3
3
|
import dayjs from "dayjs";
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import { TaoPortalScope, useTaoConfig } from "../../provider/tao-provider.js";
|
|
4
|
+
import { forwardRef, useCallback, useEffect, useId, useImperativeHandle, useMemo, useRef, useState } from "react";
|
|
5
|
+
import { TaoPortalScope, useTaoConfig, useTaoDirection } from "../../provider/tao-provider.js";
|
|
7
6
|
import { useIsMobile } from "../../utils/breakpoint.js";
|
|
8
7
|
import { useMobileTitle } from "../../utils/field-label.js";
|
|
8
|
+
import { mergeRefs } from "../../utils/refs.js";
|
|
9
9
|
import { cx } from "../../utils/semantic.js";
|
|
10
10
|
import { Drawer } from "../drawer/drawer.js";
|
|
11
11
|
import { CalendarGrid } from "./calendar/calendar-grid.js";
|
|
12
12
|
import "./date-picker.css";
|
|
13
13
|
import { Presets } from "./presets.js";
|
|
14
|
+
import { formatPickerDate, parsePickerDate } from "./date-localization.js";
|
|
14
15
|
import { getDefaultFormat } from "./types.js";
|
|
15
16
|
import * as __rspack_external__radix_ui_react_popover_c8444160 from "@radix-ui/react-popover";
|
|
16
|
-
dayjs.extend(customParseFormat);
|
|
17
17
|
const range_picker_RangePicker = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
18
18
|
const { value, defaultValue, onChange, picker = 'date', showTime, format: formatProp, disabledDate, minDate, maxDate, presets, placeholder: placeholderProp, separator = '~', size, variant, disabled, allowClear = true, status, mobile, open: controlledOpen, onOpenChange, className, style, classNames, styles } = props;
|
|
19
19
|
const popupId = useId();
|
|
@@ -34,6 +34,10 @@ const range_picker_RangePicker = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
34
34
|
const autoMobile = useIsMobile();
|
|
35
35
|
const isMobile = mobile ?? autoMobile;
|
|
36
36
|
const mobileTriggerRef = useRef(null);
|
|
37
|
+
const [direction, directionRef] = useTaoDirection(props.direction);
|
|
38
|
+
const mergedMobileRef = useMemo(()=>mergeRefs(mobileTriggerRef, directionRef), [
|
|
39
|
+
directionRef
|
|
40
|
+
]);
|
|
37
41
|
const startInputRef = useRef(null);
|
|
38
42
|
const endInputRef = useRef(null);
|
|
39
43
|
useImperativeHandle(ref, ()=>({
|
|
@@ -50,7 +54,13 @@ const range_picker_RangePicker = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
50
54
|
isMobile
|
|
51
55
|
]);
|
|
52
56
|
const fmt = formatProp ?? getDefaultFormat(picker, showTime);
|
|
53
|
-
const
|
|
57
|
+
const dayjsLocale = ctx.locale.dayjsLocale;
|
|
58
|
+
const numberLocale = ctx.locale.numberLocale;
|
|
59
|
+
const formatValue = useCallback((date)=>formatPickerDate(date, fmt, dayjsLocale), [
|
|
60
|
+
fmt,
|
|
61
|
+
dayjsLocale
|
|
62
|
+
]);
|
|
63
|
+
const isDateBlocked = useCallback((date_0)=>!date_0.isValid() || Boolean(disabledDate?.(date_0)) || null != minDate && date_0.isBefore(minDate, 'day') || null != maxDate && date_0.isAfter(maxDate, 'day'), [
|
|
54
64
|
disabledDate,
|
|
55
65
|
minDate,
|
|
56
66
|
maxDate
|
|
@@ -69,8 +79,8 @@ const range_picker_RangePicker = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
69
79
|
] : null;
|
|
70
80
|
if (!isValueControlled) setInternalValue(nextValue);
|
|
71
81
|
onChange?.(nextValue, [
|
|
72
|
-
start
|
|
73
|
-
end
|
|
82
|
+
formatValue(start),
|
|
83
|
+
formatValue(end)
|
|
74
84
|
]);
|
|
75
85
|
return true;
|
|
76
86
|
}, [
|
|
@@ -80,7 +90,7 @@ const range_picker_RangePicker = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
80
90
|
endDisabled,
|
|
81
91
|
resolvedDisabled,
|
|
82
92
|
resolvedValue,
|
|
83
|
-
|
|
93
|
+
formatValue
|
|
84
94
|
]);
|
|
85
95
|
const [internalOpen, setInternalOpen] = useState(false);
|
|
86
96
|
const isOpen = controlledOpen ?? internalOpen;
|
|
@@ -133,13 +143,13 @@ const range_picker_RangePicker = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
133
143
|
hover
|
|
134
144
|
} : current_0);
|
|
135
145
|
}, []);
|
|
136
|
-
const handleDateSelect = useCallback((
|
|
146
|
+
const handleDateSelect = useCallback((date_1)=>{
|
|
137
147
|
if (startDisabled || endDisabled) {
|
|
138
148
|
if (!emitChange(startDisabled ? [
|
|
139
149
|
rangeStart,
|
|
140
|
-
|
|
150
|
+
date_1
|
|
141
151
|
] : [
|
|
142
|
-
|
|
152
|
+
date_1,
|
|
143
153
|
rangeEnd
|
|
144
154
|
])) return;
|
|
145
155
|
setInteraction({
|
|
@@ -152,14 +162,14 @@ const range_picker_RangePicker = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
152
162
|
if ('idle' === interaction.phase && 'start' === interaction.activeInput) setInteraction({
|
|
153
163
|
phase: 'pickingEnd',
|
|
154
164
|
activeInput: 'end',
|
|
155
|
-
start:
|
|
165
|
+
start: date_1,
|
|
156
166
|
hover: null
|
|
157
167
|
});
|
|
158
168
|
else {
|
|
159
169
|
let start_0 = 'pickingEnd' === interaction.phase ? interaction.start : rangeStart;
|
|
160
|
-
let end_0 =
|
|
161
|
-
if (start_0 &&
|
|
162
|
-
|
|
170
|
+
let end_0 = date_1;
|
|
171
|
+
if (start_0 && date_1.isBefore(start_0)) [start_0, end_0] = [
|
|
172
|
+
date_1,
|
|
163
173
|
start_0
|
|
164
174
|
];
|
|
165
175
|
emitChange([
|
|
@@ -211,8 +221,8 @@ const range_picker_RangePicker = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
211
221
|
startDisabled,
|
|
212
222
|
endDisabled
|
|
213
223
|
]);
|
|
214
|
-
const displayStart = rangeStart
|
|
215
|
-
const displayEnd = rangeEnd
|
|
224
|
+
const displayStart = formatValue(rangeStart);
|
|
225
|
+
const displayEnd = formatValue(rangeEnd);
|
|
216
226
|
const [inputStart, setInputStart] = useState(displayStart);
|
|
217
227
|
const [inputEnd, setInputEnd] = useState(displayEnd);
|
|
218
228
|
useEffect(()=>setInputStart(displayStart), [
|
|
@@ -225,7 +235,7 @@ const range_picker_RangePicker = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
225
235
|
if ('start' === position_0 ? startDisabled : endDisabled) return;
|
|
226
236
|
const text = ('start' === position_0 ? inputStart : inputEnd).trim();
|
|
227
237
|
const currentValue = 'start' === position_0 ? displayStart : displayEnd;
|
|
228
|
-
const parsed = text ?
|
|
238
|
+
const parsed = text ? parsePickerDate(text, fmt, dayjsLocale, numberLocale) : null;
|
|
229
239
|
const isBlocked = null != parsed && (isDateBlocked(parsed) || 'start' === position_0 && null != rangeEnd && parsed.isAfter(rangeEnd) || 'end' === position_0 && null != rangeStart && parsed.isBefore(rangeStart));
|
|
230
240
|
if (isBlocked) {
|
|
231
241
|
if ('start' === position_0) setInputStart(currentValue);
|
|
@@ -235,8 +245,8 @@ const range_picker_RangePicker = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
235
245
|
const nextStart = 'start' === position_0 ? parsed : rangeStart;
|
|
236
246
|
const nextEnd = 'end' === position_0 ? parsed : rangeEnd;
|
|
237
247
|
const nextStrings = [
|
|
238
|
-
nextStart
|
|
239
|
-
nextEnd
|
|
248
|
+
formatValue(nextStart),
|
|
249
|
+
formatValue(nextEnd)
|
|
240
250
|
];
|
|
241
251
|
if (nextStrings[0] !== displayStart || nextStrings[1] !== displayEnd) emitChange(nextStart || nextEnd ? [
|
|
242
252
|
nextStart,
|
|
@@ -258,6 +268,9 @@ const range_picker_RangePicker = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
258
268
|
displayStart,
|
|
259
269
|
emitChange,
|
|
260
270
|
fmt,
|
|
271
|
+
dayjsLocale,
|
|
272
|
+
numberLocale,
|
|
273
|
+
formatValue,
|
|
261
274
|
inputEnd,
|
|
262
275
|
inputStart,
|
|
263
276
|
isValueControlled,
|
|
@@ -266,7 +279,7 @@ const range_picker_RangePicker = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
266
279
|
setOpen
|
|
267
280
|
]);
|
|
268
281
|
const showClearBtn = allowClear && (!startDisabled && rangeStart || !endDisabled && rangeEnd);
|
|
269
|
-
const isDateDisabled = (
|
|
282
|
+
const isDateDisabled = (date_2)=>Boolean(resolvedDisabled || disabledDate?.(date_2) || startDisabled && rangeStart && date_2.isBefore(rangeStart, 'day') || endDisabled && rangeEnd && date_2.isAfter(rangeEnd, 'day'));
|
|
270
283
|
const panelContent = /*#__PURE__*/ jsxs("div", {
|
|
271
284
|
"data-tao-range-panel": "",
|
|
272
285
|
className: isMobile ? classNames?.popup : void 0,
|
|
@@ -363,7 +376,7 @@ const range_picker_RangePicker = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
363
376
|
rangeEnd: rangeEnd,
|
|
364
377
|
hoverDate: hoverDate,
|
|
365
378
|
onSelect: handleDateSelect,
|
|
366
|
-
onViewDateChange: (
|
|
379
|
+
onViewDateChange: (date_3)=>setViewDateStart(date_3.subtract(1, 'month')),
|
|
367
380
|
onHover: setHoverDate,
|
|
368
381
|
disabledDate: isDateDisabled,
|
|
369
382
|
minDate: minDate,
|
|
@@ -448,7 +461,8 @@ const range_picker_RangePicker = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
448
461
|
if (!isOpen) setOpen(true);
|
|
449
462
|
};
|
|
450
463
|
const mobileTrigger = /*#__PURE__*/ jsxs("button", {
|
|
451
|
-
ref:
|
|
464
|
+
ref: mergedMobileRef,
|
|
465
|
+
dir: direction,
|
|
452
466
|
id: props.id,
|
|
453
467
|
...controlAria,
|
|
454
468
|
type: "button",
|
|
@@ -495,6 +509,8 @@ const range_picker_RangePicker = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
495
509
|
]
|
|
496
510
|
});
|
|
497
511
|
const desktopTrigger = /*#__PURE__*/ jsxs("div", {
|
|
512
|
+
ref: directionRef,
|
|
513
|
+
dir: direction,
|
|
498
514
|
"data-tao-control": "",
|
|
499
515
|
"data-tao-range-trigger": "",
|
|
500
516
|
onClick: ()=>!resolvedDisabled && setOpen(!isOpen),
|
|
@@ -619,6 +635,7 @@ const range_picker_RangePicker = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
619
635
|
children: [
|
|
620
636
|
mobileTrigger,
|
|
621
637
|
/*#__PURE__*/ jsx(Drawer, {
|
|
638
|
+
direction: direction,
|
|
622
639
|
open: isOpen,
|
|
623
640
|
onClose: ()=>setOpen(false),
|
|
624
641
|
placement: "bottom",
|
|
@@ -639,6 +656,7 @@ const range_picker_RangePicker = /*#__PURE__*/ forwardRef(function(props, ref) {
|
|
|
639
656
|
/*#__PURE__*/ jsx(__rspack_external__radix_ui_react_popover_c8444160.Portal, {
|
|
640
657
|
children: /*#__PURE__*/ jsx(TaoPortalScope, {
|
|
641
658
|
asChild: true,
|
|
659
|
+
direction: direction,
|
|
642
660
|
children: /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_popover_c8444160.Content, {
|
|
643
661
|
id: popupId,
|
|
644
662
|
ref: popupRef,
|
|
@@ -10,6 +10,7 @@ export interface DrawerResizableConfig {
|
|
|
10
10
|
onResizeEnd?: () => void;
|
|
11
11
|
}
|
|
12
12
|
export interface DrawerProps extends Pick<AriaAttributes, 'aria-label' | 'aria-labelledby' | 'aria-describedby'> {
|
|
13
|
+
direction?: 'ltr' | 'rtl';
|
|
13
14
|
open: boolean;
|
|
14
15
|
onClose?: () => void;
|
|
15
16
|
title?: ReactNode;
|
|
@@ -47,4 +48,4 @@ export interface DrawerProps extends Pick<AriaAttributes, 'aria-label' | 'aria-l
|
|
|
47
48
|
classNames?: SemanticClassNames<DrawerSemanticPart>;
|
|
48
49
|
styles?: SemanticStyles<DrawerSemanticPart>;
|
|
49
50
|
}
|
|
50
|
-
export declare function Drawer({ open, onClose, title, extra, footer, placement, size, width, height, closable, closeIcon, maskClosable, mask, keyboard, resizable, afterOpenChange, afterClose, destroyOnHidden, children, classNames, styles: stylesProp, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, 'aria-describedby': ariaDescribedBy, }: DrawerProps): import("react").JSX.Element;
|
|
51
|
+
export declare function Drawer({ direction, open, onClose, title, extra, footer, placement, size, width, height, closable, closeIcon, maskClosable, mask, keyboard, resizable, afterOpenChange, afterClose, destroyOnHidden, children, classNames, styles: stylesProp, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, 'aria-describedby': ariaDescribedBy, }: DrawerProps): import("react").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { c } from "react-compiler-runtime";
|
|
3
3
|
import { useEffect, useRef, useState } from "react";
|
|
4
|
-
import { TaoPortalScope, useTaoConfig } from "../../provider/tao-provider.js";
|
|
4
|
+
import { TaoPortalScope, TaoProvider, useTaoConfig } from "../../provider/tao-provider.js";
|
|
5
5
|
import { DialogContent } from "../../utils/dialog-content.js";
|
|
6
6
|
import { preventParentOutsideDismiss } from "../../utils/portal.js";
|
|
7
7
|
import { cx } from "../../utils/semantic.js";
|
|
@@ -14,8 +14,8 @@ const SIZE_PRESET = {
|
|
|
14
14
|
};
|
|
15
15
|
const MIN_DRAG_SIZE = 200;
|
|
16
16
|
function Drawer(t0) {
|
|
17
|
-
const $ = c(
|
|
18
|
-
const { open, onClose, title, extra, footer, placement: t1, size, width, height, closable: t2, closeIcon, maskClosable: t3, mask: t4, keyboard: t5, resizable, afterOpenChange, afterClose, destroyOnHidden: t6, children, classNames, styles: stylesProp, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy } = t0;
|
|
17
|
+
const $ = c(105);
|
|
18
|
+
const { direction, open, onClose, title, extra, footer, placement: t1, size, width, height, closable: t2, closeIcon, maskClosable: t3, mask: t4, keyboard: t5, resizable, afterOpenChange, afterClose, destroyOnHidden: t6, children, classNames, styles: stylesProp, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy } = t0;
|
|
19
19
|
const placement = void 0 === t1 ? "right" : t1;
|
|
20
20
|
const closable = void 0 === t2 ? true : t2;
|
|
21
21
|
const maskClosable = void 0 === t3 ? true : t3;
|
|
@@ -349,40 +349,52 @@ function Drawer(t0) {
|
|
|
349
349
|
$[90] = t27;
|
|
350
350
|
} else t27 = $[90];
|
|
351
351
|
let t28;
|
|
352
|
-
if ($[91] !==
|
|
352
|
+
if ($[91] !== direction || $[92] !== t15 || $[93] !== t27) {
|
|
353
353
|
t28 = /*#__PURE__*/ jsxs(TaoPortalScope, {
|
|
354
|
+
direction: direction,
|
|
354
355
|
children: [
|
|
355
356
|
t15,
|
|
356
357
|
t27
|
|
357
358
|
]
|
|
358
359
|
});
|
|
359
|
-
$[91] =
|
|
360
|
-
$[92] =
|
|
361
|
-
$[93] =
|
|
362
|
-
|
|
360
|
+
$[91] = direction;
|
|
361
|
+
$[92] = t15;
|
|
362
|
+
$[93] = t27;
|
|
363
|
+
$[94] = t28;
|
|
364
|
+
} else t28 = $[94];
|
|
363
365
|
let t29;
|
|
364
|
-
if ($[
|
|
366
|
+
if ($[95] !== forceMount || $[96] !== t28) {
|
|
365
367
|
t29 = /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_dialog_dabd8325.Portal, {
|
|
366
368
|
forceMount: forceMount,
|
|
367
369
|
children: t28
|
|
368
370
|
});
|
|
369
|
-
$[
|
|
370
|
-
$[
|
|
371
|
-
$[
|
|
372
|
-
} else t29 = $[
|
|
371
|
+
$[95] = forceMount;
|
|
372
|
+
$[96] = t28;
|
|
373
|
+
$[97] = t29;
|
|
374
|
+
} else t29 = $[97];
|
|
373
375
|
let t30;
|
|
374
|
-
if ($[
|
|
376
|
+
if ($[98] !== open || $[99] !== t14 || $[100] !== t29) {
|
|
375
377
|
t30 = /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_dialog_dabd8325.Root, {
|
|
376
378
|
open: open,
|
|
377
379
|
onOpenChange: t14,
|
|
378
380
|
children: t29
|
|
379
381
|
});
|
|
380
|
-
$[
|
|
381
|
-
$[
|
|
382
|
-
$[
|
|
383
|
-
$[
|
|
384
|
-
} else t30 = $[
|
|
385
|
-
|
|
382
|
+
$[98] = open;
|
|
383
|
+
$[99] = t14;
|
|
384
|
+
$[100] = t29;
|
|
385
|
+
$[101] = t30;
|
|
386
|
+
} else t30 = $[101];
|
|
387
|
+
let t31;
|
|
388
|
+
if ($[102] !== direction || $[103] !== t30) {
|
|
389
|
+
t31 = /*#__PURE__*/ jsx(TaoProvider, {
|
|
390
|
+
direction: direction,
|
|
391
|
+
children: t30
|
|
392
|
+
});
|
|
393
|
+
$[102] = direction;
|
|
394
|
+
$[103] = t30;
|
|
395
|
+
$[104] = t31;
|
|
396
|
+
} else t31 = $[104];
|
|
397
|
+
return t31;
|
|
386
398
|
}
|
|
387
399
|
function CloseIcon() {
|
|
388
400
|
const $ = c(1);
|
|
@@ -9,6 +9,7 @@ export type { MenuDividerType, MenuGroupType, MenuItem, MenuItemType, MenuProps,
|
|
|
9
9
|
export type DropdownPlacement = 'bottom' | 'bottomLeft' | 'bottomRight' | 'top' | 'topLeft' | 'topRight';
|
|
10
10
|
export type DropdownTrigger = 'click' | 'hover' | 'contextMenu';
|
|
11
11
|
export interface DropdownProps {
|
|
12
|
+
direction?: 'ltr' | 'rtl';
|
|
12
13
|
menu: MenuProps;
|
|
13
14
|
/** Trigger element (a single React element). */
|
|
14
15
|
children: ReactNode;
|