@smwb/ui-solid 0.7.0 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/styles/less/components/confirmDialog/confirmDialog.entry.css +1 -0
- package/dist/components/clickAwayListener/clickAwayListener.js +12 -8
- package/dist/components/clickAwayListener/clickAwayListener.js.map +1 -1
- package/dist/components/dataDisplay/treeView/treeView.d.ts +5 -1
- package/dist/components/dataDisplay/treeView/treeView.js +60 -50
- package/dist/components/dataDisplay/treeView/treeView.js.map +1 -1
- package/dist/components/feedBack/confirmDialog/confirmDialog.d.ts +27 -0
- package/dist/components/feedBack/confirmDialog/confirmDialog.js +108 -0
- package/dist/components/feedBack/confirmDialog/confirmDialog.js.map +1 -0
- package/dist/components/feedBack/confirmDialog/index.d.ts +2 -0
- package/dist/components/feedBack/modal/modal.js +49 -48
- package/dist/components/feedBack/modal/modal.js.map +1 -1
- package/dist/components/inputs/datePicker/datePicker.js +22 -22
- package/dist/components/inputs/datePicker/datePicker.js.map +1 -1
- package/dist/components/inputs/dateTimePicker/dateTimePicker.js +21 -21
- package/dist/components/inputs/dateTimePicker/dateTimePicker.js.map +1 -1
- package/dist/components/inputs/selectField/dropdownMenu.js +1 -0
- package/dist/components/inputs/selectField/dropdownMenu.js.map +1 -1
- package/dist/components/inputs/timePicker/timePicker.js +16 -16
- package/dist/components/inputs/timePicker/timePicker.js.map +1 -1
- package/dist/components/layout/sheet/sheet.js +95 -92
- package/dist/components/layout/sheet/sheet.js.map +1 -1
- package/dist/headless/components/clickAwayListener/clickAwayListener.js +12 -8
- package/dist/headless/components/clickAwayListener/clickAwayListener.js.map +1 -1
- package/dist/headless/components/dataDisplay/treeView/treeView.js +60 -50
- package/dist/headless/components/dataDisplay/treeView/treeView.js.map +1 -1
- package/dist/headless/components/feedBack/confirmDialog/confirmDialog.js +107 -0
- package/dist/headless/components/feedBack/confirmDialog/confirmDialog.js.map +1 -0
- package/dist/headless/components/feedBack/modal/modal.js +49 -48
- package/dist/headless/components/feedBack/modal/modal.js.map +1 -1
- package/dist/headless/components/inputs/datePicker/datePicker.js +19 -19
- package/dist/headless/components/inputs/datePicker/datePicker.js.map +1 -1
- package/dist/headless/components/inputs/dateTimePicker/dateTimePicker.js +21 -21
- package/dist/headless/components/inputs/dateTimePicker/dateTimePicker.js.map +1 -1
- package/dist/headless/components/inputs/selectField/dropdownMenu.js +1 -0
- package/dist/headless/components/inputs/selectField/dropdownMenu.js.map +1 -1
- package/dist/headless/components/inputs/timePicker/timePicker.js +16 -16
- package/dist/headless/components/inputs/timePicker/timePicker.js.map +1 -1
- package/dist/headless/components/layout/sheet/sheet.js +95 -92
- package/dist/headless/components/layout/sheet/sheet.js.map +1 -1
- package/dist/headless/index.js +201 -199
- package/dist/headless/index.js.map +1 -1
- package/dist/headless/primitives/overlayLayer.js +11 -0
- package/dist/headless/primitives/overlayLayer.js.map +1 -0
- package/dist/headless/source/components/clickAwayListener/clickAwayListener.jsx +2 -0
- package/dist/headless/source/components/clickAwayListener/clickAwayListener.jsx.map +1 -1
- package/dist/headless/source/components/dataDisplay/treeView/treeView.jsx +10 -2
- package/dist/headless/source/components/dataDisplay/treeView/treeView.jsx.map +1 -1
- package/dist/headless/source/components/feedBack/confirmDialog/confirmDialog.jsx +76 -0
- package/dist/headless/source/components/feedBack/confirmDialog/confirmDialog.jsx.map +1 -0
- package/dist/headless/source/components/feedBack/confirmDialog/index.js +5 -0
- package/dist/headless/source/components/feedBack/confirmDialog/index.js.map +7 -0
- package/dist/headless/source/components/feedBack/modal/modal.jsx +5 -1
- package/dist/headless/source/components/feedBack/modal/modal.jsx.map +1 -1
- package/dist/headless/source/components/inputs/datePicker/datePicker.jsx +1 -0
- package/dist/headless/source/components/inputs/datePicker/datePicker.jsx.map +1 -1
- package/dist/headless/source/components/inputs/dateTimePicker/dateTimePicker.jsx +1 -0
- package/dist/headless/source/components/inputs/dateTimePicker/dateTimePicker.jsx.map +1 -1
- package/dist/headless/source/components/inputs/selectField/dropdownMenu.jsx +1 -0
- package/dist/headless/source/components/inputs/selectField/dropdownMenu.jsx.map +1 -1
- package/dist/headless/source/components/inputs/timePicker/timePicker.jsx +1 -0
- package/dist/headless/source/components/inputs/timePicker/timePicker.jsx.map +1 -1
- package/dist/headless/source/components/layout/sheet/sheet.jsx +13 -3
- package/dist/headless/source/components/layout/sheet/sheet.jsx.map +1 -1
- package/dist/headless/source/index.js +2 -0
- package/dist/headless/source/index.js.map +2 -2
- package/dist/headless/source/primitives/overlayLayer.js +18 -0
- package/dist/headless/source/primitives/overlayLayer.js.map +7 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +201 -199
- package/dist/index.js.map +1 -1
- package/dist/primitives/overlayLayer.d.ts +13 -0
- package/dist/primitives/overlayLayer.js +11 -0
- package/dist/primitives/overlayLayer.js.map +1 -0
- package/dist/source/components/clickAwayListener/clickAwayListener.jsx +2 -0
- package/dist/source/components/clickAwayListener/clickAwayListener.jsx.map +1 -1
- package/dist/source/components/dataDisplay/treeView/treeView.jsx +10 -2
- package/dist/source/components/dataDisplay/treeView/treeView.jsx.map +1 -1
- package/dist/source/components/feedBack/confirmDialog/confirmDialog.jsx +77 -0
- package/dist/source/components/feedBack/confirmDialog/confirmDialog.jsx.map +1 -0
- package/dist/source/components/feedBack/confirmDialog/index.js +5 -0
- package/dist/source/components/feedBack/confirmDialog/index.js.map +7 -0
- package/dist/source/components/feedBack/modal/modal.jsx +5 -1
- package/dist/source/components/feedBack/modal/modal.jsx.map +1 -1
- package/dist/source/components/inputs/datePicker/datePicker.jsx +1 -0
- package/dist/source/components/inputs/datePicker/datePicker.jsx.map +1 -1
- package/dist/source/components/inputs/dateTimePicker/dateTimePicker.jsx +1 -0
- package/dist/source/components/inputs/dateTimePicker/dateTimePicker.jsx.map +1 -1
- package/dist/source/components/inputs/selectField/dropdownMenu.jsx +1 -0
- package/dist/source/components/inputs/selectField/dropdownMenu.jsx.map +1 -1
- package/dist/source/components/inputs/timePicker/timePicker.jsx +1 -0
- package/dist/source/components/inputs/timePicker/timePicker.jsx.map +1 -1
- package/dist/source/components/layout/sheet/sheet.jsx +13 -3
- package/dist/source/components/layout/sheet/sheet.jsx.map +1 -1
- package/dist/source/index.js +2 -0
- package/dist/source/index.js.map +2 -2
- package/dist/source/primitives/overlayLayer.js +18 -0
- package/dist/source/primitives/overlayLayer.js.map +7 -0
- package/package.json +11 -5
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import { Theme as f, createTheme as i } from "./primitives/createTheme.js";
|
|
|
5
5
|
import { createFloating as n } from "./primitives/createFloating.js";
|
|
6
6
|
import { createFocusTrap as u } from "./primitives/createFocusTrap.js";
|
|
7
7
|
import { createCssTransition as C } from "./primitives/createCssTransition.js";
|
|
8
|
-
import { createDropzone as
|
|
8
|
+
import { createDropzone as g } from "./primitives/createDropzone.js";
|
|
9
9
|
import { createVirtualList as h } from "./primitives/createVirtualList.js";
|
|
10
10
|
import { createMaskedInput as M } from "./primitives/createMaskedInput.js";
|
|
11
11
|
import { createMediaQuery as I } from "./primitives/createMediaQuery.js";
|
|
@@ -29,7 +29,7 @@ import { Chat as se } from "./components/dataDisplay/chat/chat.js";
|
|
|
29
29
|
import { ChatAttachmentImage as le } from "./components/dataDisplay/chat/chatAttachmentImage.js";
|
|
30
30
|
import { ChatAttachments as ce } from "./components/dataDisplay/chat/chatAttachments.js";
|
|
31
31
|
import { ChatComposer as Te } from "./components/dataDisplay/chat/chatComposer.js";
|
|
32
|
-
import { ChatHeader as
|
|
32
|
+
import { ChatHeader as de } from "./components/dataDisplay/chat/chatHeader.js";
|
|
33
33
|
import { ChatIconButton as Se } from "./components/dataDisplay/chat/chatIconButton.js";
|
|
34
34
|
import { ChatLayout as Ae } from "./components/dataDisplay/chat/chatLayout.js";
|
|
35
35
|
import { ChatMessageAvatar as De } from "./components/dataDisplay/chat/chatMessageAvatar.js";
|
|
@@ -49,93 +49,94 @@ import { ChipGroup as qe } from "./components/dataDisplay/chipGroup/chipGroup.js
|
|
|
49
49
|
import { CircularProgress as Ze, ProgressIndicator as $e } from "./components/feedBack/progressIndicator/progressIndicator.js";
|
|
50
50
|
import { ClickAwayListener as rr } from "./components/clickAwayListener/clickAwayListener.js";
|
|
51
51
|
import { Column as tr, Container as ar, Grid as mr, Row as pr } from "./components/layout/grid/grid.js";
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
58
|
-
import {
|
|
59
|
-
import {
|
|
60
|
-
import {
|
|
61
|
-
import {
|
|
62
|
-
import {
|
|
63
|
-
import {
|
|
64
|
-
import {
|
|
65
|
-
import {
|
|
66
|
-
import {
|
|
67
|
-
import {
|
|
68
|
-
import {
|
|
69
|
-
import {
|
|
70
|
-
import {
|
|
71
|
-
import {
|
|
72
|
-
import {
|
|
73
|
-
import {
|
|
74
|
-
import {
|
|
75
|
-
import {
|
|
76
|
-
import {
|
|
77
|
-
import {
|
|
78
|
-
import {
|
|
79
|
-
import {
|
|
80
|
-
import {
|
|
81
|
-
import {
|
|
82
|
-
import {
|
|
83
|
-
import {
|
|
84
|
-
import {
|
|
85
|
-
import {
|
|
86
|
-
import {
|
|
87
|
-
import {
|
|
88
|
-
import {
|
|
89
|
-
import {
|
|
90
|
-
import {
|
|
91
|
-
import {
|
|
92
|
-
import {
|
|
93
|
-
import {
|
|
94
|
-
import {
|
|
95
|
-
import {
|
|
96
|
-
import {
|
|
97
|
-
import {
|
|
98
|
-
import {
|
|
99
|
-
import {
|
|
100
|
-
import {
|
|
101
|
-
import {
|
|
102
|
-
import {
|
|
103
|
-
import {
|
|
104
|
-
import {
|
|
105
|
-
import {
|
|
106
|
-
import {
|
|
107
|
-
import {
|
|
108
|
-
import {
|
|
109
|
-
import {
|
|
110
|
-
import {
|
|
111
|
-
import {
|
|
112
|
-
import {
|
|
113
|
-
import {
|
|
114
|
-
import {
|
|
115
|
-
import {
|
|
116
|
-
import {
|
|
117
|
-
import {
|
|
118
|
-
import {
|
|
119
|
-
import {
|
|
120
|
-
import {
|
|
121
|
-
import {
|
|
122
|
-
import {
|
|
123
|
-
import {
|
|
124
|
-
import {
|
|
125
|
-
import {
|
|
126
|
-
import {
|
|
127
|
-
import {
|
|
128
|
-
import {
|
|
129
|
-
import {
|
|
130
|
-
import {
|
|
131
|
-
import {
|
|
132
|
-
import {
|
|
133
|
-
import {
|
|
134
|
-
import {
|
|
135
|
-
import {
|
|
136
|
-
import {
|
|
137
|
-
import {
|
|
138
|
-
import {
|
|
52
|
+
import { ConfirmDialog as fr } from "./components/feedBack/confirmDialog/confirmDialog.js";
|
|
53
|
+
import { CountPreview as sr } from "./components/inputs/fileDrop/countPreview.js";
|
|
54
|
+
import { DEFAULT_TIME_FORMAT as lr } from "./components/inputs/timePicker/timeUtils.js";
|
|
55
|
+
import { DataPickerDays as cr } from "./components/inputs/datePicker/dataPickerDays.js";
|
|
56
|
+
import { DataPickerHeader as Tr } from "./components/inputs/datePicker/dataPickerHeader.js";
|
|
57
|
+
import { DataPickerInput as dr } from "./components/inputs/datePicker/dataPickerInput.js";
|
|
58
|
+
import { DatePicker as Sr } from "./components/inputs/datePicker/datePicker.js";
|
|
59
|
+
import { DatePickerActionLabel as Ar } from "./components/inputs/datePicker/datePickerActionLabel.js";
|
|
60
|
+
import { DatePickerDay as Dr } from "./components/inputs/datePicker/datePickerDay.js";
|
|
61
|
+
import { DatePickerIconButton as br } from "./components/inputs/datePicker/datePickerIconButton.js";
|
|
62
|
+
import { DatePickerList as kr } from "./components/inputs/datePicker/datePickerList.js";
|
|
63
|
+
import { DateTimePicker as Br } from "./components/inputs/dateTimePicker/dateTimePicker.js";
|
|
64
|
+
import { DateTimePickerInput as yr } from "./components/inputs/dateTimePicker/dateTimePickerInput.js";
|
|
65
|
+
import { Divider as _r } from "./components/layout/divider/divider.js";
|
|
66
|
+
import { DropdownMenu as Hr } from "./components/inputs/selectField/dropdownMenu.js";
|
|
67
|
+
import { ExpansionPanel as Ur } from "./components/dataDisplay/expansionPanel/expansionPanel.js";
|
|
68
|
+
import { FileDrop as Rr } from "./components/inputs/fileDrop/fileDrop.js";
|
|
69
|
+
import { FileInput as Nr } from "./components/inputs/fileInput/fileInput.js";
|
|
70
|
+
import { FloatingButton as Wr } from "./components/inputs/floatingButton/floatingButton.js";
|
|
71
|
+
import { Icon as Yr } from "./components/base/icon/icon.js";
|
|
72
|
+
import { ImagesList as Qr } from "./components/dataDisplay/imagesList/imagesList.js";
|
|
73
|
+
import { ImagesListItem as qr } from "./components/dataDisplay/imagesList/imagesListItem/imagesListItem.js";
|
|
74
|
+
import { ImagesListItemModal as Zr } from "./components/dataDisplay/imagesList/imagesListItem/imagesListItemModal.js";
|
|
75
|
+
import { LazyImage as eo } from "./components/dataDisplay/lazyImage/lazyImage.js";
|
|
76
|
+
import { List as oo } from "./components/dataDisplay/list/list.js";
|
|
77
|
+
import { ListItem as ao } from "./components/dataDisplay/list/listItem.js";
|
|
78
|
+
import { Menu as po } from "./components/navigation/menu/menu.js";
|
|
79
|
+
import { MenuContext as fo, useMenuContext as io } from "./components/navigation/menu/menuContext.js";
|
|
80
|
+
import { MenuDivider as no } from "./components/navigation/menu/menuDivider.js";
|
|
81
|
+
import { MenuFloating as uo, buildMenuFloatingMiddleware as co } from "./components/navigation/menu/menuFloating.js";
|
|
82
|
+
import { MenuItem as To } from "./components/navigation/menu/menuItem.js";
|
|
83
|
+
import { MenuItemIcon as ho } from "./components/navigation/menu/menuItemIcon.js";
|
|
84
|
+
import { MenuItemText as Mo } from "./components/navigation/menu/menuItemText.js";
|
|
85
|
+
import { MenuList as Io } from "./components/navigation/menu/menuList.js";
|
|
86
|
+
import { MenuSubmenu as Po } from "./components/navigation/menu/menuSubmenu.js";
|
|
87
|
+
import { Message as Lo, MessageContainer as ko } from "./components/feedBack/message/message.js";
|
|
88
|
+
import { Modal as Bo } from "./components/feedBack/modal/modal.js";
|
|
89
|
+
import { OpenView as yo } from "./components/inputs/datePicker/openView.js";
|
|
90
|
+
import { OverflowMenu as _o } from "./components/navigation/overflowMenu/overflowMenu.js";
|
|
91
|
+
import { Page as Ho } from "./components/layout/page/page.js";
|
|
92
|
+
import { PageHeader as Uo } from "./components/layout/pageHeader/pageHeader.js";
|
|
93
|
+
import { Pagination as Ro } from "./components/navigation/pagination/pagination.js";
|
|
94
|
+
import { Preview as No } from "./components/inputs/fileDrop/preview.js";
|
|
95
|
+
import { PreviewWrapper as Wo } from "./components/inputs/fileDrop/previewWrapper.js";
|
|
96
|
+
import { RadioButton as Yo } from "./components/inputs/radioButton/radioButton.js";
|
|
97
|
+
import { Rating as Qo } from "./components/inputs/rating/rating.js";
|
|
98
|
+
import { Ripple as qo } from "./components/base/ripple/ripple.js";
|
|
99
|
+
import { SaveAssetDialog as Zo } from "./components/feedBack/saveAssetDialog/saveAssetDialog.js";
|
|
100
|
+
import { ScreenDivider as et } from "./components/layout/screenDivider/screenDivider.js";
|
|
101
|
+
import { SelectField as ot } from "./components/inputs/selectField/selectField.js";
|
|
102
|
+
import { Sheet as at } from "./components/layout/sheet/sheet.js";
|
|
103
|
+
import { Sidebar as pt } from "./components/navigation/sidebar/sidebar.js";
|
|
104
|
+
import { Skeleton as ft } from "./components/feedBack/skeleton/skeleton.js";
|
|
105
|
+
import { Slider as st } from "./components/inputs/slider/slider.js";
|
|
106
|
+
import { Snackbar as lt, SnackbarProvider as ut, useSnackbar as ct } from "./components/feedBack/snackbar/snackbar.js";
|
|
107
|
+
import { Stack as Tt } from "./components/layout/stack/stack.js";
|
|
108
|
+
import { Stepper as dt } from "./components/navigation/stepper/stepper.js";
|
|
109
|
+
import { Tab as St } from "./components/navigation/tabs/tab/tab.js";
|
|
110
|
+
import { Table as At } from "./components/dataDisplay/table/table.js";
|
|
111
|
+
import { TableBody as Dt } from "./components/dataDisplay/table/tableBody.js";
|
|
112
|
+
import { TableCell as bt } from "./components/dataDisplay/table/tableCell.js";
|
|
113
|
+
import { TableHead as kt } from "./components/dataDisplay/table/tableHead.js";
|
|
114
|
+
import { TableHeadCell as Bt } from "./components/dataDisplay/table/tableHeadCell.js";
|
|
115
|
+
import { TablePagination as yt } from "./components/dataDisplay/table/tablePagination/tablePagination.js";
|
|
116
|
+
import { TableRow as _t } from "./components/dataDisplay/table/tableRow.js";
|
|
117
|
+
import { Tabs as Ht } from "./components/navigation/tabs/tabs.js";
|
|
118
|
+
import { TabsContext as Ut, useTabsContext as Gt } from "./components/navigation/tabs/tabsContext.js";
|
|
119
|
+
import { TextField as Vt } from "./components/inputs/textField/textField.js";
|
|
120
|
+
import { TextFieldAdornment as zt } from "./components/inputs/textField/textFieldAdornment.js";
|
|
121
|
+
import { TextFieldWrapper as Xt } from "./components/inputs/textField/textFieldWrapper.js";
|
|
122
|
+
import { ThumbCard as Jt } from "./components/dataDisplay/thumbCard/thumbCard.js";
|
|
123
|
+
import { TimePicker as jt } from "./components/inputs/timePicker/timePicker.js";
|
|
124
|
+
import { TimePickerColumns as Kt } from "./components/inputs/timePicker/timePickerColumns.js";
|
|
125
|
+
import { TimePickerInput as $t } from "./components/inputs/timePicker/timePickerInput.js";
|
|
126
|
+
import { Toggle as ra } from "./components/inputs/toggle/toggle.js";
|
|
127
|
+
import { Tooltip as ta } from "./components/feedBack/tooltip/tooltip.js";
|
|
128
|
+
import { TreeView as ma } from "./components/dataDisplay/treeView/treeView.js";
|
|
129
|
+
import { Typography as xa } from "./components/dataDisplay/typography/typography.js";
|
|
130
|
+
import { ValueSlider as ia } from "./components/inputs/valueSlider/valueSlider.js";
|
|
131
|
+
import { createChatFileUpload as na, resolveChatFileUploadMaxFiles as la } from "./components/dataDisplay/chat/useChatFileUpload.js";
|
|
132
|
+
import { createChatInfiniteScroll as ca } from "./components/dataDisplay/chat/useChatInfiniteScroll.js";
|
|
133
|
+
import { createChatStickToBottom as Ta, isScrolledToBottom as ga, scrollChatToBottom as da } from "./components/dataDisplay/chat/useChatStickToBottom.js";
|
|
134
|
+
import { createDateInput as Sa } from "./components/inputs/datePicker/useDateInput.js";
|
|
135
|
+
import { createDateTimeInput as Aa, getCurrentDateTimeFormat as Ia, getDisplayDateTime as Da } from "./components/inputs/dateTimePicker/useDateTimeInput.js";
|
|
136
|
+
import { createTimeInput as ba } from "./components/inputs/timePicker/useTimeInput.js";
|
|
137
|
+
import { formatChatTimestamp as ka, getChatLayoutActions as Fa, isChatMessageDeliveryStatus as Ba, isImageAttachment as va, resolveAllowedLayouts as ya, resolveChatMessageStatusIcon as Ea, resolveChatMessageStatusLabel as _a, shouldComposerNewlineOnEnter as wa, shouldShowChatCloseButton as Ha } from "./components/dataDisplay/chat/utils.js";
|
|
138
|
+
import { formatDateTimeByPattern as Ua, isDateTimePatternMatch as Ga, parseDateTimeByPattern as Ra } from "./components/inputs/dateTimePicker/dateTimeFormat.js";
|
|
139
|
+
import { isImageFile as Na } from "./components/inputs/fileDrop/utils.js";
|
|
139
140
|
export {
|
|
140
141
|
v as Accordion,
|
|
141
142
|
E as AnimateHeight,
|
|
@@ -160,7 +161,7 @@ export {
|
|
|
160
161
|
le as ChatAttachmentImage,
|
|
161
162
|
ce as ChatAttachments,
|
|
162
163
|
Te as ChatComposer,
|
|
163
|
-
|
|
164
|
+
de as ChatHeader,
|
|
164
165
|
Se as ChatIconButton,
|
|
165
166
|
Ae as ChatLayout,
|
|
166
167
|
De as ChatMessageAvatar,
|
|
@@ -180,101 +181,102 @@ export {
|
|
|
180
181
|
Ze as CircularProgress,
|
|
181
182
|
rr as ClickAwayListener,
|
|
182
183
|
tr as Column,
|
|
184
|
+
fr as ConfirmDialog,
|
|
183
185
|
ar as Container,
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
186
|
+
sr as CountPreview,
|
|
187
|
+
lr as DEFAULT_TIME_FORMAT,
|
|
188
|
+
cr as DataPickerDays,
|
|
189
|
+
Tr as DataPickerHeader,
|
|
190
|
+
dr as DataPickerInput,
|
|
191
|
+
Sr as DatePicker,
|
|
192
|
+
Ar as DatePickerActionLabel,
|
|
193
|
+
Dr as DatePickerDay,
|
|
194
|
+
br as DatePickerIconButton,
|
|
195
|
+
kr as DatePickerList,
|
|
196
|
+
Br as DateTimePicker,
|
|
197
|
+
yr as DateTimePickerInput,
|
|
198
|
+
_r as Divider,
|
|
199
|
+
Hr as DropdownMenu,
|
|
200
|
+
Ur as ExpansionPanel,
|
|
201
|
+
Rr as FileDrop,
|
|
202
|
+
Nr as FileInput,
|
|
203
|
+
Wr as FloatingButton,
|
|
202
204
|
mr as Grid,
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
205
|
+
Yr as Icon,
|
|
206
|
+
Qr as ImagesList,
|
|
207
|
+
qr as ImagesListItem,
|
|
208
|
+
Zr as ImagesListItemModal,
|
|
209
|
+
eo as LazyImage,
|
|
210
|
+
oo as List,
|
|
211
|
+
ao as ListItem,
|
|
212
|
+
po as Menu,
|
|
213
|
+
fo as MenuContext,
|
|
214
|
+
no as MenuDivider,
|
|
215
|
+
uo as MenuFloating,
|
|
216
|
+
To as MenuItem,
|
|
217
|
+
ho as MenuItemIcon,
|
|
218
|
+
Mo as MenuItemText,
|
|
219
|
+
Io as MenuList,
|
|
220
|
+
Po as MenuSubmenu,
|
|
221
|
+
Lo as Message,
|
|
222
|
+
ko as MessageContainer,
|
|
223
|
+
Bo as Modal,
|
|
224
|
+
yo as OpenView,
|
|
225
|
+
_o as OverflowMenu,
|
|
226
|
+
Ho as Page,
|
|
227
|
+
Uo as PageHeader,
|
|
228
|
+
Ro as Pagination,
|
|
229
|
+
No as Preview,
|
|
230
|
+
Wo as PreviewWrapper,
|
|
229
231
|
$e as ProgressIndicator,
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
232
|
+
Yo as RadioButton,
|
|
233
|
+
Qo as Rating,
|
|
234
|
+
qo as Ripple,
|
|
233
235
|
pr as Row,
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
236
|
+
Zo as SaveAssetDialog,
|
|
237
|
+
et as ScreenDivider,
|
|
238
|
+
ot as SelectField,
|
|
239
|
+
at as Sheet,
|
|
240
|
+
pt as Sidebar,
|
|
241
|
+
ft as Skeleton,
|
|
242
|
+
st as Slider,
|
|
243
|
+
lt as Snackbar,
|
|
244
|
+
ut as SnackbarProvider,
|
|
245
|
+
Tt as Stack,
|
|
246
|
+
dt as Stepper,
|
|
247
|
+
St as Tab,
|
|
248
|
+
At as Table,
|
|
249
|
+
Dt as TableBody,
|
|
250
|
+
bt as TableCell,
|
|
251
|
+
kt as TableHead,
|
|
252
|
+
Bt as TableHeadCell,
|
|
253
|
+
yt as TablePagination,
|
|
254
|
+
_t as TableRow,
|
|
255
|
+
Ht as Tabs,
|
|
256
|
+
Ut as TabsContext,
|
|
257
|
+
Vt as TextField,
|
|
258
|
+
zt as TextFieldAdornment,
|
|
259
|
+
Xt as TextFieldWrapper,
|
|
258
260
|
f as Theme,
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
261
|
+
Jt as ThumbCard,
|
|
262
|
+
jt as TimePicker,
|
|
263
|
+
Kt as TimePickerColumns,
|
|
264
|
+
$t as TimePickerInput,
|
|
265
|
+
ra as Toggle,
|
|
266
|
+
ta as Tooltip,
|
|
267
|
+
ma as TreeView,
|
|
268
|
+
xa as Typography,
|
|
269
|
+
ia as ValueSlider,
|
|
268
270
|
L as buildFloatingMiddleware,
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
271
|
+
co as buildMenuFloatingMiddleware,
|
|
272
|
+
na as createChatFileUpload,
|
|
273
|
+
ca as createChatInfiniteScroll,
|
|
274
|
+
Ta as createChatStickToBottom,
|
|
273
275
|
p as createControllableState,
|
|
274
276
|
C as createCssTransition,
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
277
|
+
Sa as createDateInput,
|
|
278
|
+
Aa as createDateTimeInput,
|
|
279
|
+
g as createDropzone,
|
|
278
280
|
n as createFloating,
|
|
279
281
|
u as createFocusTrap,
|
|
280
282
|
a as createId,
|
|
@@ -282,31 +284,31 @@ export {
|
|
|
282
284
|
I as createMediaQuery,
|
|
283
285
|
P as createPersistedJson,
|
|
284
286
|
i as createTheme,
|
|
285
|
-
|
|
287
|
+
ba as createTimeInput,
|
|
286
288
|
h as createVirtualList,
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
289
|
+
ka as formatChatTimestamp,
|
|
290
|
+
Ua as formatDateTimeByPattern,
|
|
291
|
+
Fa as getChatLayoutActions,
|
|
292
|
+
Ia as getCurrentDateTimeFormat,
|
|
293
|
+
Da as getDisplayDateTime,
|
|
294
|
+
Ba as isChatMessageDeliveryStatus,
|
|
295
|
+
Ga as isDateTimePatternMatch,
|
|
296
|
+
va as isImageAttachment,
|
|
297
|
+
Na as isImageFile,
|
|
298
|
+
ga as isScrolledToBottom,
|
|
297
299
|
o as mergeRefs,
|
|
298
|
-
|
|
300
|
+
Ra as parseDateTimeByPattern,
|
|
299
301
|
k as placements,
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
302
|
+
ya as resolveAllowedLayouts,
|
|
303
|
+
la as resolveChatFileUploadMaxFiles,
|
|
304
|
+
Ea as resolveChatMessageStatusIcon,
|
|
305
|
+
_a as resolveChatMessageStatusLabel,
|
|
304
306
|
F as resolvePlacement,
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
307
|
+
da as scrollChatToBottom,
|
|
308
|
+
wa as shouldComposerNewlineOnEnter,
|
|
309
|
+
Ha as shouldShowChatCloseButton,
|
|
310
|
+
io as useMenuContext,
|
|
311
|
+
ct as useSnackbar,
|
|
312
|
+
Gt as useTabsContext
|
|
311
313
|
};
|
|
312
314
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** Attribute marking the root of a portaled overlay layer (modal, sheet wrapper, dropdown, …). */
|
|
2
|
+
export declare const OVERLAY_LAYER_ATTR = "data-smwb-overlay-layer";
|
|
3
|
+
/**
|
|
4
|
+
* True when `event` happened inside an overlay layer that does NOT contain
|
|
5
|
+
* `node` — i.e. `node` sits underneath that layer, so the interaction is not
|
|
6
|
+
* a "click away" from `node`.
|
|
7
|
+
*/
|
|
8
|
+
export declare const isEventInForeignOverlay: (event: Event, node: Element) => boolean;
|
|
9
|
+
/**
|
|
10
|
+
* True when `el` belongs to the topmost open overlay layer (or no layers are
|
|
11
|
+
* open). Used to make Escape close only the top layer instead of every layer.
|
|
12
|
+
*/
|
|
13
|
+
export declare const isTopOverlayLayer: (el: Element | undefined) => boolean;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const e = "data-smwb-overlay-layer", r = () => typeof document > "u" ? [] : Array.from(document.querySelectorAll(`[${e}]`)), a = (n, o) => typeof n.composedPath != "function" ? !1 : n.composedPath().some((t) => t instanceof Element && t.hasAttribute(e) && !t.contains(o)), s = (n) => {
|
|
2
|
+
if (!n) return !0;
|
|
3
|
+
const o = r(), t = o[o.length - 1];
|
|
4
|
+
return !t || t === n || t.contains(n) || n.contains(t);
|
|
5
|
+
};
|
|
6
|
+
export {
|
|
7
|
+
e as OVERLAY_LAYER_ATTR,
|
|
8
|
+
a as isEventInForeignOverlay,
|
|
9
|
+
s as isTopOverlayLayer
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=overlayLayer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"overlayLayer.js","sources":["../../src/primitives/overlayLayer.ts"],"sourcesContent":["/** Attribute marking the root of a portaled overlay layer (modal, sheet wrapper, dropdown, …). */\nexport const OVERLAY_LAYER_ATTR = \"data-smwb-overlay-layer\";\n\n/** All open overlay layers in document order (last = topmost). */\nconst overlayLayers = (): Element[] =>\n typeof document === \"undefined\" ? [] : Array.from(document.querySelectorAll(`[${OVERLAY_LAYER_ATTR}]`));\n\n/**\n * True when `event` happened inside an overlay layer that does NOT contain\n * `node` — i.e. `node` sits underneath that layer, so the interaction is not\n * a \"click away\" from `node`.\n */\nexport const isEventInForeignOverlay = (event: Event, node: Element): boolean => {\n if (typeof event.composedPath !== \"function\") return false;\n return event\n .composedPath()\n .some((el) => el instanceof Element && el.hasAttribute(OVERLAY_LAYER_ATTR) && !el.contains(node));\n};\n\n/**\n * True when `el` belongs to the topmost open overlay layer (or no layers are\n * open). Used to make Escape close only the top layer instead of every layer.\n */\nexport const isTopOverlayLayer = (el: Element | undefined): boolean => {\n if (!el) return true;\n const all = overlayLayers();\n const top = all[all.length - 1];\n return !top || top === el || top.contains(el) || el.contains(top);\n};\n"],"names":["OVERLAY_LAYER_ATTR","overlayLayers","isEventInForeignOverlay","event","node","el","isTopOverlayLayer","all","top"],"mappings":"AACO,MAAMA,IAAqB,2BAG5BC,IAAgB,MACpB,OAAO,WAAa,MAAc,CAAA,IAAK,MAAM,KAAK,SAAS,iBAAiB,IAAID,CAAkB,GAAG,CAAC,GAO3FE,IAA0B,CAACC,GAAcC,MAChD,OAAOD,EAAM,gBAAiB,aAAmB,KAC9CA,EACJ,aAAA,EACA,KAAK,CAACE,MAAOA,aAAc,WAAWA,EAAG,aAAaL,CAAkB,KAAK,CAACK,EAAG,SAASD,CAAI,CAAC,GAOvFE,IAAoB,CAACD,MAAqC;AACrE,MAAI,CAACA,EAAI,QAAO;AAChB,QAAME,IAAMN,EAAA,GACNO,IAAMD,EAAIA,EAAI,SAAS,CAAC;AAC9B,SAAO,CAACC,KAAOA,MAAQH,KAAMG,EAAI,SAASH,CAAE,KAAKA,EAAG,SAASG,CAAG;AAClE;"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { children as resolveChildren, createEffect, mergeProps, onCleanup, onMount } from "solid-js";
|
|
2
|
+
import { isEventInForeignOverlay } from "../../primitives/overlayLayer";
|
|
2
3
|
function mapEventPropToEvent(eventProp) {
|
|
3
4
|
return eventProp.substring(2).toLowerCase();
|
|
4
5
|
}
|
|
@@ -41,6 +42,7 @@ function ClickAwayListener(props) {
|
|
|
41
42
|
insideDOM = !document.documentElement.contains(target) || node.contains(target);
|
|
42
43
|
}
|
|
43
44
|
if (!insideDOM) {
|
|
45
|
+
if (isEventInForeignOverlay(event, node)) return;
|
|
44
46
|
merged.onClickAway(event);
|
|
45
47
|
}
|
|
46
48
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/clickAwayListener/clickAwayListener.tsx"],"sourcesContent":["import { type JSX, children as resolveChildren, createEffect, mergeProps, onCleanup, onMount } from \"solid-js\";\n\ntype ClickAwayMouseEventHandler = \"onClick\" | \"onMouseDown\" | \"onMouseUp\" | \"onPointerDown\" | \"onPointerUp\";\ntype ClickAwayTouchEventHandler = \"onTouchStart\" | \"onTouchEnd\";\n\ntype MappedEvent = \"click\" | \"mousedown\" | \"mouseup\" | \"touchstart\" | \"touchend\" | \"pointerdown\" | \"pointerup\";\n\nfunction mapEventPropToEvent(eventProp: ClickAwayMouseEventHandler | ClickAwayTouchEventHandler): MappedEvent {\n return eventProp.substring(2).toLowerCase() as MappedEvent;\n}\n\nfunction clickedRootScrollbar(event: MouseEvent, doc: Document): boolean {\n return doc.documentElement.clientWidth < event.clientX || doc.documentElement.clientHeight < event.clientY;\n}\n\nexport interface ClickAwayListenerProps {\n children: JSX.Element;\n mouseEvent?: ClickAwayMouseEventHandler | false;\n onClickAway: (event: MouseEvent | TouchEvent) => void;\n touchEvent?: ClickAwayTouchEventHandler | false;\n /** When false, the listener is inert without unmounting the child. */\n enabled?: boolean;\n}\n\n/**\n * Solid redesign of MUI's ClickAwayListener. React's version cloned the child\n * to inject a ref + synthetic handlers; Solid resolves the child to its DOM\n * node and uses `composedPath`/`contains` containment checks against document\n * listeners — no element cloning.\n */\nexport function ClickAwayListener(props: ClickAwayListenerProps): JSX.Element {\n const merged = mergeProps(\n { mouseEvent: \"onMouseUp\" as ClickAwayMouseEventHandler, touchEvent: \"onTouchEnd\" as ClickAwayTouchEventHandler, enabled: true },\n props\n );\n const resolved = resolveChildren(() => merged.children);\n\n const getNode = (): Element | undefined => {\n const c = resolved();\n const el = Array.isArray(c) ? c.find((x) => x instanceof Element) : c;\n return el instanceof Element ? el : undefined;\n };\n\n let activated = false;\n let moved = false;\n\n onMount(() => {\n // Defer activation a tick so the opening interaction doesn't immediately\n // trigger a click-away (see facebook/react#20074).\n const timer = setTimeout(() => {\n activated = true;\n }, 0);\n onCleanup(() => clearTimeout(timer));\n });\n\n const handleClickAway = (event: MouseEvent | TouchEvent): void => {\n const node = getNode();\n if (!merged.enabled || !activated || !node || (\"clientX\" in event && clickedRootScrollbar(event, document))) {\n return;\n }\n if (moved) {\n moved = false;\n return;\n }\n let insideDOM: boolean;\n if (event.composedPath) {\n insideDOM = event.composedPath().indexOf(node) > -1;\n } else {\n const target = event.target as HTMLElement;\n insideDOM = !document.documentElement.contains(target) || node.contains(target);\n }\n if (!insideDOM) {\n merged.onClickAway(event);\n }\n };\n\n createEffect(() => {\n const handleTouchMove = (): void => {\n moved = true;\n };\n if (merged.touchEvent !== false) {\n const mapped = mapEventPropToEvent(merged.touchEvent);\n document.addEventListener(mapped, handleClickAway as EventListener);\n document.addEventListener(\"touchmove\", handleTouchMove);\n onCleanup(() => {\n document.removeEventListener(mapped, handleClickAway as EventListener);\n document.removeEventListener(\"touchmove\", handleTouchMove);\n });\n }\n if (merged.mouseEvent !== false) {\n const mapped = mapEventPropToEvent(merged.mouseEvent);\n document.addEventListener(mapped, handleClickAway as EventListener);\n onCleanup(() => document.removeEventListener(mapped, handleClickAway as EventListener));\n }\n });\n\n return <>{resolved()}</>;\n}\n\nexport default ClickAwayListener;\n"],"mappings":"AAAA,SAAmB,YAAY,iBAAiB,cAAc,YAAY,WAAW,eAAe;
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/clickAwayListener/clickAwayListener.tsx"],"sourcesContent":["import { type JSX, children as resolveChildren, createEffect, mergeProps, onCleanup, onMount } from \"solid-js\";\nimport { isEventInForeignOverlay } from \"../../primitives/overlayLayer\";\n\ntype ClickAwayMouseEventHandler = \"onClick\" | \"onMouseDown\" | \"onMouseUp\" | \"onPointerDown\" | \"onPointerUp\";\ntype ClickAwayTouchEventHandler = \"onTouchStart\" | \"onTouchEnd\";\n\ntype MappedEvent = \"click\" | \"mousedown\" | \"mouseup\" | \"touchstart\" | \"touchend\" | \"pointerdown\" | \"pointerup\";\n\nfunction mapEventPropToEvent(eventProp: ClickAwayMouseEventHandler | ClickAwayTouchEventHandler): MappedEvent {\n return eventProp.substring(2).toLowerCase() as MappedEvent;\n}\n\nfunction clickedRootScrollbar(event: MouseEvent, doc: Document): boolean {\n return doc.documentElement.clientWidth < event.clientX || doc.documentElement.clientHeight < event.clientY;\n}\n\nexport interface ClickAwayListenerProps {\n children: JSX.Element;\n mouseEvent?: ClickAwayMouseEventHandler | false;\n onClickAway: (event: MouseEvent | TouchEvent) => void;\n touchEvent?: ClickAwayTouchEventHandler | false;\n /** When false, the listener is inert without unmounting the child. */\n enabled?: boolean;\n}\n\n/**\n * Solid redesign of MUI's ClickAwayListener. React's version cloned the child\n * to inject a ref + synthetic handlers; Solid resolves the child to its DOM\n * node and uses `composedPath`/`contains` containment checks against document\n * listeners — no element cloning.\n */\nexport function ClickAwayListener(props: ClickAwayListenerProps): JSX.Element {\n const merged = mergeProps(\n { mouseEvent: \"onMouseUp\" as ClickAwayMouseEventHandler, touchEvent: \"onTouchEnd\" as ClickAwayTouchEventHandler, enabled: true },\n props\n );\n const resolved = resolveChildren(() => merged.children);\n\n const getNode = (): Element | undefined => {\n const c = resolved();\n const el = Array.isArray(c) ? c.find((x) => x instanceof Element) : c;\n return el instanceof Element ? el : undefined;\n };\n\n let activated = false;\n let moved = false;\n\n onMount(() => {\n // Defer activation a tick so the opening interaction doesn't immediately\n // trigger a click-away (see facebook/react#20074).\n const timer = setTimeout(() => {\n activated = true;\n }, 0);\n onCleanup(() => clearTimeout(timer));\n });\n\n const handleClickAway = (event: MouseEvent | TouchEvent): void => {\n const node = getNode();\n if (!merged.enabled || !activated || !node || (\"clientX\" in event && clickedRootScrollbar(event, document))) {\n return;\n }\n if (moved) {\n moved = false;\n return;\n }\n let insideDOM: boolean;\n if (event.composedPath) {\n insideDOM = event.composedPath().indexOf(node) > -1;\n } else {\n const target = event.target as HTMLElement;\n insideDOM = !document.documentElement.contains(target) || node.contains(target);\n }\n if (!insideDOM) {\n // Interactions inside a portaled overlay layer above the child (modal,\n // dropdown, picker…) are not \"away\" from the child.\n if (isEventInForeignOverlay(event, node)) return;\n merged.onClickAway(event);\n }\n };\n\n createEffect(() => {\n const handleTouchMove = (): void => {\n moved = true;\n };\n if (merged.touchEvent !== false) {\n const mapped = mapEventPropToEvent(merged.touchEvent);\n document.addEventListener(mapped, handleClickAway as EventListener);\n document.addEventListener(\"touchmove\", handleTouchMove);\n onCleanup(() => {\n document.removeEventListener(mapped, handleClickAway as EventListener);\n document.removeEventListener(\"touchmove\", handleTouchMove);\n });\n }\n if (merged.mouseEvent !== false) {\n const mapped = mapEventPropToEvent(merged.mouseEvent);\n document.addEventListener(mapped, handleClickAway as EventListener);\n onCleanup(() => document.removeEventListener(mapped, handleClickAway as EventListener));\n }\n });\n\n return <>{resolved()}</>;\n}\n\nexport default ClickAwayListener;\n"],"mappings":"AAAA,SAAmB,YAAY,iBAAiB,cAAc,YAAY,WAAW,eAAe;AACpG,SAAS,+BAA+B;AAOxC,SAAS,oBAAoB,WAAiF;AAC5G,SAAO,UAAU,UAAU,CAAC,EAAE,YAAY;AAC5C;AAEA,SAAS,qBAAqB,OAAmB,KAAwB;AACvE,SAAO,IAAI,gBAAgB,cAAc,MAAM,WAAW,IAAI,gBAAgB,eAAe,MAAM;AACrG;AAiBO,SAAS,kBAAkB,OAA4C;AAC5E,QAAM,SAAS;AAAA,IACb,EAAE,YAAY,aAA2C,YAAY,cAA4C,SAAS,KAAK;AAAA,IAC/H;AAAA,EACF;AACA,QAAM,WAAW,gBAAgB,MAAM,OAAO,QAAQ;AAEtD,QAAM,UAAU,MAA2B;AACzC,UAAM,IAAI,SAAS;AACnB,UAAM,KAAK,MAAM,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,MAAM,aAAa,OAAO,IAAI;AACpE,WAAO,cAAc,UAAU,KAAK;AAAA,EACtC;AAEA,MAAI,YAAY;AAChB,MAAI,QAAQ;AAEZ,UAAQ,MAAM;AAGZ,UAAM,QAAQ,WAAW,MAAM;AAC7B,kBAAY;AAAA,IACd,GAAG,CAAC;AACJ,cAAU,MAAM,aAAa,KAAK,CAAC;AAAA,EACrC,CAAC;AAED,QAAM,kBAAkB,CAAC,UAAyC;AAChE,UAAM,OAAO,QAAQ;AACrB,QAAI,CAAC,OAAO,WAAW,CAAC,aAAa,CAAC,QAAS,aAAa,SAAS,qBAAqB,OAAO,QAAQ,GAAI;AAC3G;AAAA,IACF;AACA,QAAI,OAAO;AACT,cAAQ;AACR;AAAA,IACF;AACA,QAAI;AACJ,QAAI,MAAM,cAAc;AACtB,kBAAY,MAAM,aAAa,EAAE,QAAQ,IAAI,IAAI;AAAA,IACnD,OAAO;AACL,YAAM,SAAS,MAAM;AACrB,kBAAY,CAAC,SAAS,gBAAgB,SAAS,MAAM,KAAK,KAAK,SAAS,MAAM;AAAA,IAChF;AACA,QAAI,CAAC,WAAW;AAGd,UAAI,wBAAwB,OAAO,IAAI,EAAG;AAC1C,aAAO,YAAY,KAAK;AAAA,IAC1B;AAAA,EACF;AAEA,eAAa,MAAM;AACjB,UAAM,kBAAkB,MAAY;AAClC,cAAQ;AAAA,IACV;AACA,QAAI,OAAO,eAAe,OAAO;AAC/B,YAAM,SAAS,oBAAoB,OAAO,UAAU;AACpD,eAAS,iBAAiB,QAAQ,eAAgC;AAClE,eAAS,iBAAiB,aAAa,eAAe;AACtD,gBAAU,MAAM;AACd,iBAAS,oBAAoB,QAAQ,eAAgC;AACrE,iBAAS,oBAAoB,aAAa,eAAe;AAAA,MAC3D,CAAC;AAAA,IACH;AACA,QAAI,OAAO,eAAe,OAAO;AAC/B,YAAM,SAAS,oBAAoB,OAAO,UAAU;AACpD,eAAS,iBAAiB,QAAQ,eAAgC;AAClE,gBAAU,MAAM,SAAS,oBAAoB,QAAQ,eAAgC,CAAC;AAAA,IACxF;AAAA,EACF,CAAC;AAED,SAAO,GAAG,SAAS,EAAE;AACvB;AAEA,IAAO,4BAAQ;","names":[],"file":"clickAwayListener.jsx"}
|
|
@@ -109,10 +109,15 @@ function TreeView(props) {
|
|
|
109
109
|
defaultValue: local.defaultExpanded,
|
|
110
110
|
onChange: (next) => local.onExpandedChange?.(next)
|
|
111
111
|
});
|
|
112
|
+
let lastToggled;
|
|
112
113
|
const [selectedIds, setSelectedIds] = createControllableState({
|
|
113
114
|
value: () => local.selected,
|
|
114
115
|
defaultValue: local.defaultSelected,
|
|
115
|
-
onChange: (next) =>
|
|
116
|
+
onChange: (next) => {
|
|
117
|
+
const changed = lastToggled;
|
|
118
|
+
lastToggled = void 0;
|
|
119
|
+
local.onSelectedChange?.(next, changed);
|
|
120
|
+
}
|
|
116
121
|
});
|
|
117
122
|
const toggleExpanded = (id) => setExpandedIds((prev) => prev.includes(id) ? prev.filter((x) => x !== id) : [...prev, id]);
|
|
118
123
|
const setOpen = (id, open) => setExpandedIds((prev) => {
|
|
@@ -121,7 +126,10 @@ function TreeView(props) {
|
|
|
121
126
|
if (!open && has) return prev.filter((x) => x !== id);
|
|
122
127
|
return prev;
|
|
123
128
|
});
|
|
124
|
-
const toggleSelected = (id) =>
|
|
129
|
+
const toggleSelected = (id) => {
|
|
130
|
+
lastToggled = { id, selected: !selectedIds().includes(id) };
|
|
131
|
+
setSelectedIds((prev) => prev.includes(id) ? prev.filter((x) => x !== id) : [...prev, id]);
|
|
132
|
+
};
|
|
125
133
|
const ensureLoaded = (item, nodeId) => {
|
|
126
134
|
if (!local.loadChildren || loadedChildren()[nodeId] || item.children && item.children.length > 0) return;
|
|
127
135
|
setLoadingIds((prev) => prev.includes(nodeId) ? prev : [...prev, nodeId]);
|