asma-ui-core 3.138.2 → 3.139.0
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/index.js +89 -85
- package/dist/src/table/helpers/migrateLegacyTableSettings.d.ts +73 -0
- package/dist/src/table/helpers/migrateLegacyTableSettings.test.d.ts +1 -0
- package/dist/src/table/helpers/tableStorage.d.ts +2 -0
- package/dist/src/table/hooks/useColumnLayoutPersistence.d.ts +14 -0
- package/dist/src/table/hooks/useLegacyTableSettingsMigration.d.ts +17 -0
- package/dist/src/table/index.d.ts +2 -0
- package/dist/table/helpers/migrateLegacyTableSettings.js +73 -0
- package/dist/table/helpers/tableStorage.js +7 -0
- package/dist/table/hooks/useColumnLayoutPersistence.js +107 -100
- package/dist/table/hooks/useLegacyTableSettingsMigration.js +8 -0
- package/dist/table/index.js +4 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -7,11 +7,11 @@ import { ChevronRightIcon as l } from "./components/icons/chevron-right-icon/Che
|
|
|
7
7
|
import { VisibilityOutlineIcon as I } from "./components/icons/visibility-outline-icon/VisibilityOutlineIcon.js";
|
|
8
8
|
import { WarningAmberOutlineIcon as u } from "./components/icons/warning-icon/WarningAmberOutlineIcon.js";
|
|
9
9
|
import { CARD_LABELS as S } from "./components/data-display/card/Card.types.js";
|
|
10
|
-
import { getOverdueDays as C, useCardContext as
|
|
10
|
+
import { getOverdueDays as C, useCardContext as g } from "./components/data-display/card/cardModel.js";
|
|
11
11
|
import { StyledTooltip as h } from "./components/data-display/tooltip/StyledTooltip.js";
|
|
12
12
|
import { DotsVerticalIcon as b } from "./components/icons/dots-vertical-icon/DotsVerticalIcon.js";
|
|
13
13
|
import { BellOutlineIcon as P } from "./components/icons/bell-outline-icon/BellOutlineIcon.js";
|
|
14
|
-
import { BellIcon as
|
|
14
|
+
import { BellIcon as T } from "./components/icons/bell-icon/BellIcon.js";
|
|
15
15
|
import { HamburgerIcon as A } from "./components/icons/hamburger-icon/HamburgerIcon.js";
|
|
16
16
|
import { ChevronLeftIcon as M } from "./components/icons/chevron-left-icon/ChevronLeftIcon.js";
|
|
17
17
|
import { ChevronDoubleLeftIcon as v } from "./components/icons/chevron-double-left-icon/ChevronDoubleLeftIcon.js";
|
|
@@ -34,11 +34,11 @@ import { AssignmentOutlineIcon as ao } from "./components/icons/assignment-outli
|
|
|
34
34
|
import { ListNumberedIcon as uo } from "./components/icons/list-numbered-icon/ListNumberedIcon.js";
|
|
35
35
|
import { MessageProcessingIcon as So } from "./components/icons/message-processing-icon/MessageProcessingIcon.js";
|
|
36
36
|
import { MessageProcessingOutlineIcon as Co } from "./components/icons/message-processing-outline-icon/MessageProcessingOutlineIcon.js";
|
|
37
|
-
import { ReportBoxIcon as
|
|
37
|
+
import { ReportBoxIcon as Oo } from "./components/icons/report-box-icon/ReportBoxIcon.js";
|
|
38
38
|
import { ReportBoxOutlineIcon as Do } from "./components/icons/report-box-outline-icon/ReportBoxOutlineIcon.js";
|
|
39
39
|
import { SettingsIcon as Lo } from "./components/icons/settings-icon/SettingsIcon.js";
|
|
40
40
|
import { SettingsOutlineIcon as ko } from "./components/icons/settings-outline-icon/SettingsOutlineIcon.js";
|
|
41
|
-
import { FindReplaceIcon as
|
|
41
|
+
import { FindReplaceIcon as Fo } from "./components/icons/find-replace-icon/FindReplaceIcon.js";
|
|
42
42
|
import { FindReplacePeopleIcon as Ro } from "./components/icons/find-replace-people-icon/FindReplacePeopleIcon.js";
|
|
43
43
|
import { PersonIcon as Bo } from "./components/icons/person-icon/PersonIcon.js";
|
|
44
44
|
import { PersonOutlineIcon as Ho } from "./components/icons/person-outline-icon/PersonOutlineIcon.js";
|
|
@@ -61,11 +61,11 @@ import { TopicIcon as Ir } from "./components/icons/topic-icon/TopicIcon.js";
|
|
|
61
61
|
import { EmptyPageIcon as ur } from "./components/icons/empty-page-icon/EmptyPageIcon.js";
|
|
62
62
|
import { DragHorizontalIcon as Sr } from "./components/icons/drag-horizontal-icon/DragHorizontalIcon.js";
|
|
63
63
|
import { FilePdfIcon as Cr } from "./components/icons/file-pdf-icon/FilePdfIcon.js";
|
|
64
|
-
import { DeleteOutlineIcon as
|
|
64
|
+
import { DeleteOutlineIcon as Or } from "./components/icons/delete-outline-icon/DeleteOutlineIcon.js";
|
|
65
65
|
import { FilterIcon as Dr } from "./components/icons/filter-icon/FilterIcon.js";
|
|
66
66
|
import { FilterIconOff as Lr } from "./components/icons/filter-icon-off/FilterIconOff.js";
|
|
67
67
|
import { LockIcon as kr } from "./components/icons/lock-icon/LockIcon.js";
|
|
68
|
-
import { DvrIcon as
|
|
68
|
+
import { DvrIcon as Fr } from "./components/icons/dvr-icon/DvrIcon.js";
|
|
69
69
|
import { ErrorOutlineIcon as Rr } from "./components/icons/error-outline-icon/ErrorOutlineIcon.js";
|
|
70
70
|
import { ReplayIcon as Br } from "./components/icons/replay-icon/ReplayIcon.js";
|
|
71
71
|
import { CalendarBlankOutlineIcon as Hr } from "./components/icons/calendar-blank-outline-icon/CalendarBlankOutlineIcon.js";
|
|
@@ -88,11 +88,11 @@ import { BadgeIcon as Im } from "./components/icons/badge-icon/BadgeIcon.js";
|
|
|
88
88
|
import { EditSquareIcon as um } from "./components/icons/edit-square-icon/EditSquareIcon.js";
|
|
89
89
|
import { PlusIcon as Sm } from "./components/icons/plus-icon/PlusIcon.js";
|
|
90
90
|
import { PlusIconCircle as Cm } from "./components/icons/plus-icon-circle/PlusIconCircle.js";
|
|
91
|
-
import { HandymanOutlineIcon as
|
|
91
|
+
import { HandymanOutlineIcon as Om } from "./components/icons/handyman-outline-icon/HandymanOutlineIcon.js";
|
|
92
92
|
import { HandymanIcon as Dm } from "./components/icons/handyman-icon/HandymanIcon.js";
|
|
93
93
|
import { PinIcon as Lm } from "./components/icons/pin-icon/PinIcon.js";
|
|
94
94
|
import { WorkIcon as km } from "./components/icons/work-icon/WorkIcon.js";
|
|
95
|
-
import { LocationIcon as
|
|
95
|
+
import { LocationIcon as Fm } from "./components/icons/location-icon/LocationIcon.js";
|
|
96
96
|
import { LocationFilledIcon as Rm } from "./components/icons/location-filled-icon/LocationFilledIcon.js";
|
|
97
97
|
import { FormIcon as Bm } from "./components/icons/form-icon/FormIcon.js";
|
|
98
98
|
import { RepeatOutlineIcon as Hm } from "./components/icons/repeat-outline-icon/RepeatOutlineIcon.js";
|
|
@@ -115,11 +115,11 @@ import { DescriptionOutlineIcon as It } from "./components/icons/description-out
|
|
|
115
115
|
import { FormatListBulletedIcon as ut } from "./components/icons/format-list-bulleted-icon/FormatListBulletedIcon.js";
|
|
116
116
|
import { FormatListBulletedOutlineIcon as St } from "./components/icons/format-list-bulleted-outline-icon/FormatListBulletedOutlineIcon.js";
|
|
117
117
|
import { PersonSearchOutlineIcon as Ct } from "./components/icons/person-search-outline-icon/PersonSearchOutlineIcon.js";
|
|
118
|
-
import { PersonSearchIcon as
|
|
118
|
+
import { PersonSearchIcon as Ot } from "./components/icons/person-search-icon/PersonSearchIcon.js";
|
|
119
119
|
import { RuleIcon as Dt } from "./components/icons/rule-icon/RuleIcon.js";
|
|
120
120
|
import { RuleOutlineIcon as Lt } from "./components/icons/rule-outline-icon/RuleOutlineIcon.js";
|
|
121
121
|
import { ContentCopyIcon as kt } from "./components/icons/content-copy-icon/ContentCopyIcon.js";
|
|
122
|
-
import { ContentCutIcon as
|
|
122
|
+
import { ContentCutIcon as Ft } from "./components/icons/content-cut-icon/ContentCutIcon.js";
|
|
123
123
|
import { ContentPasteIcon as Rt } from "./components/icons/content-paste-icon/ContentPasteIcon.js";
|
|
124
124
|
import { ContentCopyOutlineIcon as Bt } from "./components/icons/content-copy-outline-icon/ContentCopyOutlineIcon.js";
|
|
125
125
|
import { RefreshIcon as Ht } from "./components/icons/refresh-icon/RefreshIcon.js";
|
|
@@ -142,11 +142,11 @@ import { ConversionPathIcon as Ii } from "./components/icons/conversion-path/Con
|
|
|
142
142
|
import { GraphIcon as ui } from "./components/icons/graph-icon/GraphIcon.js";
|
|
143
143
|
import { GraphOutlineIcon as Si } from "./components/icons/graph-outline-icon/GraphOutlineIcon.js";
|
|
144
144
|
import { GridViewOutlineIcon as Ci } from "./components/icons/grid-view-outline-icon/GridViewOutlineIcon.js";
|
|
145
|
-
import { NotesIcon as
|
|
145
|
+
import { NotesIcon as Oi } from "./components/icons/notes-icon/NotesIcon.js";
|
|
146
146
|
import { SaveIcon as Di } from "./components/icons/save-icon/SaveIcon.js";
|
|
147
147
|
import { SaveAsDraftIcon as Li } from "./components/icons/save-as-draft-icon/SaveAsDraftIcon.js";
|
|
148
148
|
import { RemoveIcon as ki } from "./components/icons/remove-icon/RemoveIcon.js";
|
|
149
|
-
import { EnvelopeIcon as
|
|
149
|
+
import { EnvelopeIcon as Fi } from "./components/icons/envelope-icon/EnvelopeIcon.js";
|
|
150
150
|
import { FingerprintIcon as Ri } from "./components/icons/fingerprint-icon/FingerprintIcon.js";
|
|
151
151
|
import { UploadIcon as Bi } from "./components/icons/upload-icon/UploadIcon.js";
|
|
152
152
|
import { CancelOutlineIcon as Hi } from "./components/icons/cancel-outline-icon/CancelOutlineIcon.js";
|
|
@@ -169,11 +169,11 @@ import { VisibilityOffOutlineIcon as Ie } from "./components/icons/visibility-of
|
|
|
169
169
|
import { SmsIcon as ue } from "./components/icons/sms-icon/SmsIcon.js";
|
|
170
170
|
import { ArrowLeftIcon as Se } from "./components/icons/arrow-left-icon/ArrowLeftIcon.js";
|
|
171
171
|
import { TimelapseOutlineIcon as Ce } from "./components/icons/timelapse-outline-icon/TimelapseOutlineIcon.js";
|
|
172
|
-
import { WandStarsIcon as
|
|
172
|
+
import { WandStarsIcon as Oe } from "./components/icons/wand-stars-icon/WandStarsIcon.js";
|
|
173
173
|
import { ResetSettingsIcon as De } from "./components/icons/reset-settings-icon/ResetSettingsIcon.js";
|
|
174
174
|
import { HistoryToggleOffIcon as Le } from "./components/icons/history-toggle-off-icon/HistoryToggleOffIcon.js";
|
|
175
175
|
import { CheckReadIcon as ke } from "./components/icons/check-read-icon/CheckReadIcon.js";
|
|
176
|
-
import { EditNotesIcon as
|
|
176
|
+
import { EditNotesIcon as Fe } from "./components/icons/edit-notes-icon/EditNotesIcon.js";
|
|
177
177
|
import { FileXlsIcon as Re } from "./components/icons/file-xls-icon/FileXlsIcon.js";
|
|
178
178
|
import { FileImageIcon as Be } from "./components/icons/file-image-icon/FileImageIcon.js";
|
|
179
179
|
import { DrawIcon as He } from "./components/icons/draw-icon/DrawIcon.js";
|
|
@@ -195,10 +195,10 @@ import { RotateAutoIcon as an } from "./components/icons/rotate-auto-icon/Rotate
|
|
|
195
195
|
import { MoveUpIcon as dn } from "./components/icons/move-up-icon/MoveUpIcon.js";
|
|
196
196
|
import { CallIcon as sn } from "./components/icons/call-icon/CallIcon.js";
|
|
197
197
|
import { ArrowRightIcon as yn } from "./components/icons/arrow-right-icon/ArrowRightIcon.js";
|
|
198
|
-
import { DialogBusyContext as
|
|
198
|
+
import { DialogBusyContext as gn, useDialogBusyBoundary as On, useReportDialogBusy as hn } from "./components/feedback/dialog/DialogBusyContext.js";
|
|
199
199
|
import { StyledButton as bn } from "./components/inputs/button/StyledButton.js";
|
|
200
200
|
import { StyledCheckbox as Pn } from "./components/inputs/checkbox/base-ui/StyledCheckbox.js";
|
|
201
|
-
import { OverlayBackOwnerContext as
|
|
201
|
+
import { OverlayBackOwnerContext as Tn, useBackCloses as Fn } from "./hooks/useBackCloses.hook.js";
|
|
202
202
|
import { StyledPopover as Rn } from "./components/utils/popover/StyledPopover.js";
|
|
203
203
|
import { useShortScreenMediaQuery as Bn } from "./hooks/useMediaQuery.hook.js";
|
|
204
204
|
import { formatResultsLabel as Hn } from "./components/utils/bottom-sheet/formatResultsLabel.js";
|
|
@@ -220,10 +220,10 @@ import { StyledReadOnlyText as Ip } from "./components/data-display/read-only-te
|
|
|
220
220
|
import { StyledAIDisclosure as up } from "./components/data-display/ai-disclosure/StyledAIDisclosure.js";
|
|
221
221
|
import { useElementHeightPx as Sp } from "./hooks/useElementHeightPx.js";
|
|
222
222
|
import { useLayoutViewportHeight as Cp } from "./hooks/useLayoutViewportHeight.js";
|
|
223
|
-
import { isOnScreenKeyboardOpen as
|
|
223
|
+
import { isOnScreenKeyboardOpen as Op, useOnScreenKeyboardOpen as hp } from "./hooks/useOnScreenKeyboard.js";
|
|
224
224
|
import { PINNED_HEADER_MAX_VIEWPORT_SHARE as bp, useDialogHeaderPinning as Lp } from "./components/feedback/dialog/useDialogHeaderPinning.js";
|
|
225
225
|
import { StyledDialog as kp } from "./components/feedback/dialog/StyledDialog.js";
|
|
226
|
-
import { StyledDialogActions as
|
|
226
|
+
import { StyledDialogActions as Fp } from "./components/feedback/dialog/StyledDialogActions.js";
|
|
227
227
|
import { StyledDialogContent as Rp } from "./components/feedback/dialog/StyledDialogContent.js";
|
|
228
228
|
import { StyledDialogTitle as Bp } from "./components/feedback/dialog/StyledDialogTitle.js";
|
|
229
229
|
import { ACTION_GAP_PX as Hp, MORE_BUTTON_PX as wp, estimateToolbarActionWidth as xp, planBulkToolbarActions as Ep, planToolbarActions as Np, resolveToolbarActionWidth as _p } from "./components/custom/module/header-layout/planToolbarActions.js";
|
|
@@ -241,11 +241,11 @@ import { processInfoSnackbar as cf } from "./components/feedback/snack-bar/proce
|
|
|
241
241
|
import { message as af } from "./components/feedback/snack-bar/message.js";
|
|
242
242
|
import { useSnackbar as df } from "./components/feedback/snack-bar/index.js";
|
|
243
243
|
import { fieldLabelAboveClass as sf, fieldWidthForMaxLength as Sf, fieldWidthStyle as yf } from "./components/inputs/field-styles.js";
|
|
244
|
-
import { StyledInputField as
|
|
244
|
+
import { StyledInputField as gf } from "./components/inputs/input-field/StyledInputField.js";
|
|
245
245
|
import { StyledSearchField as hf } from "./components/inputs/search-field/StyledSearchField.js";
|
|
246
246
|
import { StyledTextarea as bf } from "./components/inputs/textarea/StyledTextarea.js";
|
|
247
247
|
import { StyledSelect as Pf } from "./components/inputs/select/StyledSelect.js";
|
|
248
|
-
import { StyledSelectItem as
|
|
248
|
+
import { StyledSelectItem as Tf } from "./components/inputs/select/StyledSelectItem.js";
|
|
249
249
|
import { useAnnouncer as Af } from "./components/inputs/full-screen-picker/PickerLiveRegion.js";
|
|
250
250
|
import { useVisualViewportHeight as Mf } from "./hooks/useVisualViewportHeight.js";
|
|
251
251
|
import { FullScreenPicker as vf } from "./components/inputs/full-screen-picker/FullScreenPicker.js";
|
|
@@ -266,11 +266,11 @@ import { defaultDatePickerValidationMessages as pc, useDatePickerValidation as f
|
|
|
266
266
|
import { StyledDrawer as lc } from "./components/navigation/drawer/StyledDrawer.js";
|
|
267
267
|
import { StyledDatePicker as Ic } from "./datetime/components/date-picker/StyledDatePicker.js";
|
|
268
268
|
import { PopupState as uc, bindPopover as sc, bindPopper as Sc, bindTrigger as yc, usePopupState as Cc } from "./hooks/usePopupState.js";
|
|
269
|
-
import { ClickAwayListener as
|
|
269
|
+
import { ClickAwayListener as Oc } from "./components/mui-compat/ClickAwayListener.js";
|
|
270
270
|
import { Paper as Dc } from "./components/mui-compat/Paper.js";
|
|
271
271
|
import { Stack as Lc } from "./components/mui-compat/Stack.js";
|
|
272
272
|
import { Container as kc } from "./components/mui-compat/Container.js";
|
|
273
|
-
import { Avatar as
|
|
273
|
+
import { Avatar as Fc } from "./components/mui-compat/Avatar.js";
|
|
274
274
|
import { Skeleton as Rc } from "./components/mui-compat/Skeleton.js";
|
|
275
275
|
import { FormLabel as Bc } from "./components/mui-compat/FormLabel.js";
|
|
276
276
|
import { Fade as Hc } from "./components/mui-compat/Fade.js";
|
|
@@ -289,28 +289,30 @@ import { Listbox as el } from "./components/navigation/listbox/Listbox.js";
|
|
|
289
289
|
import { StyledAccordion as pl } from "./components/utils/accordion/base-ui/StyledAccordion.js";
|
|
290
290
|
import { StyledAccordionSummary as cl } from "./components/utils/accordion/base-ui/StyledAccordionSummary.js";
|
|
291
291
|
import { StyledAccordionDetails as al } from "./components/utils/accordion/base-ui/StyledAccordionDetails.js";
|
|
292
|
-
import { ACTIONS_COLUMN_ID as dl, DND_HANDLE_COLUMN_ID as ul, EXPAND_COLUMN_ID as sl, INTERNAL_COLUMN_IDS as Sl, SELECT_COLUMN_ID as yl, SHOW_FULL_TEXT_ID as Cl, isCustomAction as
|
|
292
|
+
import { ACTIONS_COLUMN_ID as dl, DND_HANDLE_COLUMN_ID as ul, EXPAND_COLUMN_ID as sl, INTERNAL_COLUMN_IDS as Sl, SELECT_COLUMN_ID as yl, SHOW_FULL_TEXT_ID as Cl, isCustomAction as gl } from "./table/types.js";
|
|
293
293
|
import { readPersistedSorting as hl, usePersistedSorting as Dl } from "./table/hooks/usePersistedSorting.js";
|
|
294
294
|
import { RowDragHandleCell as Ll } from "./table/components/columns/dndHandleColumn.js";
|
|
295
295
|
import { StyledTable as kl } from "./table/components/StyledTableIndex.js";
|
|
296
|
-
import {
|
|
297
|
-
import {
|
|
298
|
-
import {
|
|
299
|
-
import {
|
|
300
|
-
import {
|
|
301
|
-
import {
|
|
302
|
-
import {
|
|
303
|
-
import {
|
|
304
|
-
import {
|
|
305
|
-
import {
|
|
306
|
-
import {
|
|
307
|
-
import {
|
|
308
|
-
import {
|
|
309
|
-
import {
|
|
310
|
-
import {
|
|
311
|
-
import {
|
|
312
|
-
import {
|
|
313
|
-
import {
|
|
296
|
+
import { migrateLegacyTableSettings as Fl } from "./table/helpers/migrateLegacyTableSettings.js";
|
|
297
|
+
import { useLegacyTableSettingsMigration as Rl } from "./table/hooks/useLegacyTableSettingsMigration.js";
|
|
298
|
+
import { createColumnHelper as Bl } from "./table/index.js";
|
|
299
|
+
import { DynamicToolbarLayoutContext as Hl, useDynamicToolbarLayout as wl } from "./components/custom/module/header-layout/DynamicToolbarLayoutContext.js";
|
|
300
|
+
import { StyledFilterButton as El } from "./components/utils/filter-menu/StyledFilterButton.js";
|
|
301
|
+
import { StyledFilterMenu as _l } from "./components/utils/filter-menu/StyledFilterMenu.js";
|
|
302
|
+
import { CopyButton as Vl } from "./components/utils/copy-wrapper/CopyButton.js";
|
|
303
|
+
import { CopyWrapper as zl } from "./components/utils/copy-wrapper/CopyWrapper.js";
|
|
304
|
+
import { VirtualList as Xl } from "./components/utils/virtual-list/VirtualList.js";
|
|
305
|
+
import { StyledWidgetTitle as ql } from "./components/custom/widget/widget-title/StyledWidgetTitle.js";
|
|
306
|
+
import { StyledWidgetHeader as jl } from "./components/custom/widget/widget-header/StyledWidgetHeader.js";
|
|
307
|
+
import { StyledWidget as Jl } from "./components/custom/widget/widget/StyledWidget.js";
|
|
308
|
+
import { StyledModuleTitle as $l } from "./components/custom/module/module-title/StyledModuleTitle.js";
|
|
309
|
+
import { DynamicToolbar as ra } from "./components/custom/module/header-layout/DynamicToolbar.js";
|
|
310
|
+
import { PageHeader as ta } from "./components/custom/page/page-header/PageHeader.js";
|
|
311
|
+
import { MinimizableDialog as ea } from "./components/feedback/minimizable-dialog/MinimizableDialog.js";
|
|
312
|
+
import { MinimizableDialogV2 as pa } from "./components/feedback/minimizable-dialog/v2/MinimizableDialogV2.js";
|
|
313
|
+
import { createDialogStack as ca } from "./components/feedback/minimizable-dialog/stack/createDialogStack.js";
|
|
314
|
+
import { PathfinderCard as aa } from "./components/custom/pathfinder-card/PathfinderCard.js";
|
|
315
|
+
import { useRouteHeadingFocus as da } from "./hooks/useRouteHeadingFocus.js";
|
|
314
316
|
export {
|
|
315
317
|
dl as ACTIONS_COLUMN_ID,
|
|
316
318
|
Hp as ACTION_GAP_PX,
|
|
@@ -323,11 +325,11 @@ export {
|
|
|
323
325
|
co as AssignmentIcon,
|
|
324
326
|
ao as AssignmentOutlineIcon,
|
|
325
327
|
Gt as AttachFileIcon,
|
|
326
|
-
|
|
328
|
+
Fc as Avatar,
|
|
327
329
|
Qm as BackIcon,
|
|
328
330
|
Gi as BackupIcon,
|
|
329
331
|
Im as BadgeIcon,
|
|
330
|
-
|
|
332
|
+
T as BellIcon,
|
|
331
333
|
P as BellOutlineIcon,
|
|
332
334
|
S as CARD_LABELS,
|
|
333
335
|
Hr as CalendarBlankOutlineIcon,
|
|
@@ -357,7 +359,7 @@ export {
|
|
|
357
359
|
l as ChevronRightIcon,
|
|
358
360
|
Yo as ChevronUpIcon,
|
|
359
361
|
oe as CircleWarningOutlineIcon,
|
|
360
|
-
|
|
362
|
+
Oc as ClickAwayListener,
|
|
361
363
|
xm as ClockOutlineIcon,
|
|
362
364
|
or as CloseIcon,
|
|
363
365
|
Wt as CloudDoneOutlineIcon,
|
|
@@ -367,18 +369,18 @@ export {
|
|
|
367
369
|
kc as Container,
|
|
368
370
|
kt as ContentCopyIcon,
|
|
369
371
|
Bt as ContentCopyOutlineIcon,
|
|
370
|
-
|
|
372
|
+
Ft as ContentCutIcon,
|
|
371
373
|
Rt as ContentPasteIcon,
|
|
372
374
|
Ii as ConversionPathIcon,
|
|
373
|
-
|
|
374
|
-
|
|
375
|
+
Vl as CopyButton,
|
|
376
|
+
zl as CopyWrapper,
|
|
375
377
|
ul as DND_HANDLE_COLUMN_ID,
|
|
376
378
|
V as DashboardViewIcon,
|
|
377
379
|
z as DashboardViewOutlineIcon,
|
|
378
|
-
|
|
380
|
+
Or as DeleteOutlineIcon,
|
|
379
381
|
lt as DescriptionIcon,
|
|
380
382
|
It as DescriptionOutlineIcon,
|
|
381
|
-
|
|
383
|
+
gn as DialogBusyContext,
|
|
382
384
|
nt as DnsIcon,
|
|
383
385
|
ft as DnsOutlineIcon,
|
|
384
386
|
mt as DoneAllIcon,
|
|
@@ -390,16 +392,16 @@ export {
|
|
|
390
392
|
He as DrawIcon,
|
|
391
393
|
Uo as DropDownIcon,
|
|
392
394
|
Wo as DropUpIcon,
|
|
393
|
-
|
|
395
|
+
Fr as DvrIcon,
|
|
394
396
|
Ui as DvrIconOutline,
|
|
395
|
-
|
|
396
|
-
|
|
397
|
+
ra as DynamicToolbar,
|
|
398
|
+
Hl as DynamicToolbarLayoutContext,
|
|
397
399
|
sl as EXPAND_COLUMN_ID,
|
|
398
400
|
Zr as EarthIcon,
|
|
399
|
-
|
|
401
|
+
Fe as EditNotesIcon,
|
|
400
402
|
um as EditSquareIcon,
|
|
401
403
|
ur as EmptyPageIcon,
|
|
402
|
-
|
|
404
|
+
Fi as EnvelopeIcon,
|
|
403
405
|
Rr as ErrorOutlineIcon,
|
|
404
406
|
Hc as Fade,
|
|
405
407
|
Nr as FastCheckOutlineIcon,
|
|
@@ -410,7 +412,7 @@ export {
|
|
|
410
412
|
Re as FileXlsIcon,
|
|
411
413
|
Dr as FilterIcon,
|
|
412
414
|
Lr as FilterIconOff,
|
|
413
|
-
|
|
415
|
+
Fo as FindReplaceIcon,
|
|
414
416
|
Ro as FindReplacePeopleIcon,
|
|
415
417
|
Ri as FingerprintIcon,
|
|
416
418
|
Bm as FormIcon,
|
|
@@ -423,7 +425,7 @@ export {
|
|
|
423
425
|
Ci as GridViewOutlineIcon,
|
|
424
426
|
A as HamburgerIcon,
|
|
425
427
|
Dm as HandymanIcon,
|
|
426
|
-
|
|
428
|
+
Om as HandymanOutlineIcon,
|
|
427
429
|
Zm as HelpIcon,
|
|
428
430
|
Ym as HelpOutlineIcon,
|
|
429
431
|
li as HistoryIcon,
|
|
@@ -447,7 +449,7 @@ export {
|
|
|
447
449
|
cn as LoadCurrentIcon,
|
|
448
450
|
No as LoadingIcon,
|
|
449
451
|
Rm as LocationFilledIcon,
|
|
450
|
-
|
|
452
|
+
Fm as LocationIcon,
|
|
451
453
|
kr as LockIcon,
|
|
452
454
|
Um as LoginIcon,
|
|
453
455
|
Gm as LogoutIcon,
|
|
@@ -457,23 +459,23 @@ export {
|
|
|
457
459
|
Co as MessageProcessingOutlineIcon,
|
|
458
460
|
lm as MessageReplyIcon,
|
|
459
461
|
Wm as MicrosoftOutlookIcon,
|
|
460
|
-
|
|
461
|
-
|
|
462
|
+
ea as MinimizableDialog,
|
|
463
|
+
pa as MinimizableDialogV2,
|
|
462
464
|
nm as MinimizeIcon,
|
|
463
465
|
dn as MoveUpIcon,
|
|
464
466
|
to as NewCalendarIcon,
|
|
465
467
|
ot as NewWindowIcon,
|
|
466
|
-
|
|
468
|
+
Oi as NotesIcon,
|
|
467
469
|
mm as OutlineCalendarMonth,
|
|
468
470
|
ni as OutlineCheckboxIconBlank,
|
|
469
471
|
ii as OutlineCheckboxIconChecked,
|
|
470
472
|
fi as OutlineCheckboxIconIndeterminate,
|
|
471
473
|
oi as OutlineNotificationsIcon,
|
|
472
|
-
|
|
474
|
+
Tn as OverlayBackOwnerContext,
|
|
473
475
|
bp as PINNED_HEADER_MAX_VIEWPORT_SHARE,
|
|
474
|
-
|
|
476
|
+
ta as PageHeader,
|
|
475
477
|
Dc as Paper,
|
|
476
|
-
|
|
478
|
+
aa as PathfinderCard,
|
|
477
479
|
_ as PdfIcon,
|
|
478
480
|
om as PencilOutlineIcon,
|
|
479
481
|
q as PeopleIcon,
|
|
@@ -482,7 +484,7 @@ export {
|
|
|
482
484
|
nr as PermMediaOutline,
|
|
483
485
|
Bo as PersonIcon,
|
|
484
486
|
Ho as PersonOutlineIcon,
|
|
485
|
-
|
|
487
|
+
Ot as PersonSearchIcon,
|
|
486
488
|
Ct as PersonSearchOutlineIcon,
|
|
487
489
|
Lm as PinIcon,
|
|
488
490
|
Sm as PlusIcon,
|
|
@@ -498,7 +500,7 @@ export {
|
|
|
498
500
|
ki as RemoveIcon,
|
|
499
501
|
Hm as RepeatOutlineIcon,
|
|
500
502
|
Br as ReplayIcon,
|
|
501
|
-
|
|
503
|
+
Oo as ReportBoxIcon,
|
|
502
504
|
Do as ReportBoxOutlineIcon,
|
|
503
505
|
De as ResetSettingsIcon,
|
|
504
506
|
pn as RocketLaunchIcon,
|
|
@@ -534,7 +536,7 @@ export {
|
|
|
534
536
|
$f as StyledCountryFlag,
|
|
535
537
|
Ic as StyledDatePicker,
|
|
536
538
|
kp as StyledDialog,
|
|
537
|
-
|
|
539
|
+
Fp as StyledDialogActions,
|
|
538
540
|
Rp as StyledDialogContent,
|
|
539
541
|
Vp as StyledDialogFooter,
|
|
540
542
|
Bp as StyledDialogTitle,
|
|
@@ -543,8 +545,8 @@ export {
|
|
|
543
545
|
qf as StyledEmojiChoice,
|
|
544
546
|
zp as StyledEmptyPage,
|
|
545
547
|
rc as StyledFieldPair,
|
|
546
|
-
|
|
547
|
-
|
|
548
|
+
El as StyledFilterButton,
|
|
549
|
+
_l as StyledFilterMenu,
|
|
548
550
|
Xp as StyledFilteredEmptyState,
|
|
549
551
|
tc as StyledFormColumn,
|
|
550
552
|
ec as StyledFormControl,
|
|
@@ -552,7 +554,7 @@ export {
|
|
|
552
554
|
Jc as StyledFormGroup,
|
|
553
555
|
qc as StyledFormHelperText,
|
|
554
556
|
lp as StyledFormLabel,
|
|
555
|
-
|
|
557
|
+
gf as StyledInputField,
|
|
556
558
|
jc as StyledInputLabel,
|
|
557
559
|
ip as StyledInteractiveChip,
|
|
558
560
|
zf as StyledLabel,
|
|
@@ -561,7 +563,7 @@ export {
|
|
|
561
563
|
Un as StyledMenu,
|
|
562
564
|
Gn as StyledMenuItem,
|
|
563
565
|
Wn as StyledMenuList,
|
|
564
|
-
|
|
566
|
+
$l as StyledModuleTitle,
|
|
565
567
|
Jf as StyledPhoneField,
|
|
566
568
|
Rn as StyledPopover,
|
|
567
569
|
mp as StyledRadio,
|
|
@@ -570,7 +572,7 @@ export {
|
|
|
570
572
|
hf as StyledSearchField,
|
|
571
573
|
Pf as StyledSelect,
|
|
572
574
|
wf as StyledSelectAutocomplete,
|
|
573
|
-
|
|
575
|
+
Tf as StyledSelectItem,
|
|
574
576
|
Ef as StyledSlider,
|
|
575
577
|
mf as StyledSnackbar,
|
|
576
578
|
_f as StyledSwitch,
|
|
@@ -582,9 +584,9 @@ export {
|
|
|
582
584
|
tl as StyledTitleChevron,
|
|
583
585
|
h as StyledTooltip,
|
|
584
586
|
fp as StyledTypography,
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
587
|
+
Jl as StyledWidget,
|
|
588
|
+
jl as StyledWidgetHeader,
|
|
589
|
+
ql as StyledWidgetTitle,
|
|
588
590
|
We as StylusNoteIcon,
|
|
589
591
|
Ue as StylusNoteLargeIcon,
|
|
590
592
|
mi as SyncIcon,
|
|
@@ -598,11 +600,11 @@ export {
|
|
|
598
600
|
Wr as UnknownDocumentOutlineRoundedIcon,
|
|
599
601
|
it as UnlockIcon,
|
|
600
602
|
Bi as UploadIcon,
|
|
601
|
-
|
|
603
|
+
Xl as VirtualList,
|
|
602
604
|
np as VirtualizedList,
|
|
603
605
|
Ie as VisibilityOffOutlineIcon,
|
|
604
606
|
I as VisibilityOutlineIcon,
|
|
605
|
-
|
|
607
|
+
Oe as WandStarsIcon,
|
|
606
608
|
u as WarningAmberOutlineIcon,
|
|
607
609
|
mn as WidgetIcon,
|
|
608
610
|
en as WidgetIconFilled,
|
|
@@ -612,8 +614,8 @@ export {
|
|
|
612
614
|
yc as bindTrigger,
|
|
613
615
|
Jp as closeSnackbar,
|
|
614
616
|
m as cn,
|
|
615
|
-
|
|
616
|
-
|
|
617
|
+
Bl as createColumnHelper,
|
|
618
|
+
ca as createDialogStack,
|
|
617
619
|
pc as defaultDatePickerValidationMessages,
|
|
618
620
|
Nc as defaultTimePickerHelperMessages,
|
|
619
621
|
Yp as enqueueSnackbar,
|
|
@@ -623,9 +625,10 @@ export {
|
|
|
623
625
|
yf as fieldWidthStyle,
|
|
624
626
|
Hn as formatResultsLabel,
|
|
625
627
|
C as getOverdueDays,
|
|
626
|
-
|
|
627
|
-
|
|
628
|
+
gl as isCustomAction,
|
|
629
|
+
Op as isOnScreenKeyboardOpen,
|
|
628
630
|
af as message,
|
|
631
|
+
Fl as migrateLegacyTableSettings,
|
|
629
632
|
i as omit,
|
|
630
633
|
Ep as planBulkToolbarActions,
|
|
631
634
|
Np as planToolbarActions,
|
|
@@ -638,19 +641,20 @@ export {
|
|
|
638
641
|
Uc as setMidnightTime,
|
|
639
642
|
zc as setZeroTime,
|
|
640
643
|
Af as useAnnouncer,
|
|
641
|
-
|
|
642
|
-
|
|
644
|
+
Fn as useBackCloses,
|
|
645
|
+
g as useCardContext,
|
|
643
646
|
fc as useDatePickerValidation,
|
|
644
|
-
|
|
647
|
+
On as useDialogBusyBoundary,
|
|
645
648
|
Lp as useDialogHeaderPinning,
|
|
646
|
-
|
|
649
|
+
wl as useDynamicToolbarLayout,
|
|
647
650
|
Sp as useElementHeightPx,
|
|
648
651
|
Cp as useLayoutViewportHeight,
|
|
652
|
+
Rl as useLegacyTableSettingsMigration,
|
|
649
653
|
hp as useOnScreenKeyboardOpen,
|
|
650
654
|
Dl as usePersistedSorting,
|
|
651
655
|
Cc as usePopupState,
|
|
652
656
|
hn as useReportDialogBusy,
|
|
653
|
-
|
|
657
|
+
da as useRouteHeadingFocus,
|
|
654
658
|
Bn as useShortScreenMediaQuery,
|
|
655
659
|
df as useSnackbar,
|
|
656
660
|
Mf as useVisualViewportHeight
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What `StyledTable` saves under a table's `uniqueKey`, each setting in its own entry: `${uniqueKey}${suffix}`. The sorting
|
|
3
|
+
* (`:sorting`), column widths (`:column-sizing`), page size (`:page-size`), column order (`:column-order`) and column visibility
|
|
4
|
+
* (`:column-visibility`). A test pins this list to the key functions of the hooks that write them.
|
|
5
|
+
*/
|
|
6
|
+
export declare const TABLE_SETTINGS_SUFFIXES: readonly [":sorting", ":column-sizing", ":page-size", ":column-order", ":column-visibility"];
|
|
7
|
+
/** One entry kept under a key that is not the table's `uniqueKey` plus a suffix, moved from its old key to its new one. */
|
|
8
|
+
export interface LegacyRawEntry {
|
|
9
|
+
/** The old key, named exactly. */
|
|
10
|
+
from: string;
|
|
11
|
+
/** The key that holds the entry now. */
|
|
12
|
+
to: string;
|
|
13
|
+
}
|
|
14
|
+
export interface LegacyTableSettings {
|
|
15
|
+
/** The table's `uniqueKey` now, the one the entries are copied to. Without one there is nothing to migrate to. */
|
|
16
|
+
newKey: string | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* The old key, or the old keys, of the **current scope**: the current user, tenant and context, and the current patient or
|
|
19
|
+
* record where the old key held one. Name them exactly: the entries under these keys are copied to `newKey` and removed.
|
|
20
|
+
* When an entry exists under several, the first key listed wins; the others are removed. An empty list, or none, means the
|
|
21
|
+
* app has no current scope to name, and then nothing is copied and **nothing is removed**: the old entries are what the next
|
|
22
|
+
* visit with a scope can still carry over, and a clean-up must never run before the copy has been tried.
|
|
23
|
+
*/
|
|
24
|
+
oldKeys?: string | readonly (string | undefined)[];
|
|
25
|
+
/**
|
|
26
|
+
* More old keys to remove without copying them, for entries that cannot be merged into one (another patient's, another
|
|
27
|
+
* record's of the same table). It is given each stored key that ends in a known suffix, **with the suffix taken off**, and
|
|
28
|
+
* answers whether that is an old key of this table. Match only this table's own old prefix for the current user and
|
|
29
|
+
* tenant, never another table's, user's or tenant's; escape every part you put in a pattern. It is asked only when
|
|
30
|
+
* `oldKeys` names a current scope, never about `newKey` or one of `oldKeys`, and a matcher that throws is ignored: the
|
|
31
|
+
* entries of `oldKeys` are still migrated.
|
|
32
|
+
*/
|
|
33
|
+
matchOldKey?: (oldKey: string) => boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Entries kept under keys that are **not** `newKey` plus a suffix, which the app named itself: a `persistColumnOrderKey`
|
|
36
|
+
* that carried a record id (`…ColumnOrder-${row.id}`), the key of an app's own visibility hook. Name them as old → new
|
|
37
|
+
* pairs for the current scope. The same rules as for `oldKeys`: each is copied to its `to` once, only if `to` has no entry
|
|
38
|
+
* of its own, and `from` is removed once that copy has been tried (not when it was refused); with no pairs, nothing is
|
|
39
|
+
* copied or removed. When several pairs share a `to`, the first `from` that has an entry wins.
|
|
40
|
+
*/
|
|
41
|
+
rawEntries?: readonly LegacyRawEntry[];
|
|
42
|
+
/**
|
|
43
|
+
* More old raw keys to remove without copying them: another record's of the same table. It is asked about a stored key only
|
|
44
|
+
* if the key starts with the `to` of a pair, so it can never reach a key that does not begin with the name the table's
|
|
45
|
+
* settings now have; and never about a `to`, a `from`, `newKey` itself, or a table-settings entry (`newKey`, a `to` or a
|
|
46
|
+
* `from`, plus a suffix). Asked
|
|
47
|
+
* only when `rawEntries` names a current scope. Match exactly, and anchor both ends: a name that merely starts the same is
|
|
48
|
+
* another table's. A matcher that throws is ignored.
|
|
49
|
+
*/
|
|
50
|
+
matchRawKey?: (storedKey: string) => boolean;
|
|
51
|
+
}
|
|
52
|
+
/** The scope of a migration as one string, `''` when the app names none: what the hook runs again for. */
|
|
53
|
+
export declare const legacyTableSettingsScope: ({ newKey, oldKeys, rawEntries }: LegacyTableSettings) => string;
|
|
54
|
+
/**
|
|
55
|
+
* Carries a table's saved settings from its old keys to its current ones (ASMA-8698). An app that changes a table's key, for
|
|
56
|
+
* example to take a patient id out of it, would otherwise lose every user's saved sort, widths, page size, order and
|
|
57
|
+
* visibility. For each of the five entries `StyledTable` saves under `newKey` (`TABLE_SETTINGS_SUFFIXES`), and for each
|
|
58
|
+
* old → new pair of `rawEntries` (the keys the app named itself):
|
|
59
|
+
*
|
|
60
|
+
* 1. the entry of the first old key that has one is **copied** to the new key, but only if the new key has no entry of its own:
|
|
61
|
+
* what the user saved under the new key is never overwritten;
|
|
62
|
+
* 2. then the old entries are **removed**: those of every old key named, and those the matchers accept.
|
|
63
|
+
*
|
|
64
|
+
* Nothing is removed before its copy is written: when storage is full or blocked the old entries stay, and the next call tries
|
|
65
|
+
* again. A call changes nothing once the old entries are gone, so it is safe to repeat (React StrictMode runs it twice). With
|
|
66
|
+
* nothing to migrate it only looks for the old entries (one read for each old key and suffix, one for each `from`, none for a
|
|
67
|
+
* new key) and writes nothing. With no current scope named (`oldKeys` empty, `rawEntries` empty) nothing is copied and nothing
|
|
68
|
+
* is removed, whatever a matcher would match. It never throws.
|
|
69
|
+
*
|
|
70
|
+
* Key generation stays in the app: it builds `newKey`, `oldKeys` and the raw pairs with the same helpers that build the table's
|
|
71
|
+
* keys. Run it before the table first reads its storage; {@link useLegacyTableSettingsMigration} does that.
|
|
72
|
+
*/
|
|
73
|
+
export declare const migrateLegacyTableSettings: (settings: LegacyTableSettings) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -8,6 +8,8 @@ export declare const tableStorage: {
|
|
|
8
8
|
/** `true` when the value was written, `false` when storage refused it (quota, blocked): the setting stays in memory only. */
|
|
9
9
|
set(key: string, value: string): boolean;
|
|
10
10
|
remove(key: string): void;
|
|
11
|
+
/** A snapshot of every key in storage, safe to remove from while walking it. Empty when storage is blocked. */
|
|
12
|
+
keys(): string[];
|
|
11
13
|
};
|
|
12
14
|
/** Parses a saved value; anything that is not valid JSON counts as nothing saved. */
|
|
13
15
|
export declare const readJson: (key: string) => unknown;
|
|
@@ -2,6 +2,20 @@ import { ColumnOrderState, Table, VisibilityState } from '@tanstack/react-table'
|
|
|
2
2
|
import { LeafColumnInfo } from '../helpers/columnIds';
|
|
3
3
|
export declare const getColumnOrderStorageKey: (uniqueKey?: string) => string | undefined;
|
|
4
4
|
export declare const getColumnVisibilityStorageKey: (uniqueKey?: string) => string | undefined;
|
|
5
|
+
/**
|
|
6
|
+
* Whether a parsed `:column-order` value has the shape of an entry, **even one with nothing in it** (`{"v":1,"order":[]}`): the
|
|
7
|
+
* right version and a list. That tells a well-formed entry (which confirms the user's own layout, empty or equal to the default
|
|
8
|
+
* included) from a malformed one (which confirms nothing), where `sanitizeColumnOrder` answers `undefined` for both.
|
|
9
|
+
*/
|
|
10
|
+
export declare const isColumnOrderEntry: (raw: unknown) => raw is {
|
|
11
|
+
v: number;
|
|
12
|
+
order: unknown[];
|
|
13
|
+
};
|
|
14
|
+
/** The same for a parsed `:column-visibility` value: the right version and a map (`{"v":1,"visibility":{}}` is well formed). */
|
|
15
|
+
export declare const isColumnVisibilityEntry: (raw: unknown) => raw is {
|
|
16
|
+
v: number;
|
|
17
|
+
visibility: Record<string, unknown>;
|
|
18
|
+
};
|
|
5
19
|
/**
|
|
6
20
|
* Checks a parsed `:column-order` value. Ids that no column has are kept: an order saved for columns that are not there at
|
|
7
21
|
* the moment survives, and TanStack ignores them (ASMA-8597, DEC-W). `undefined` means nothing usable is saved.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { LegacyTableSettings } from '../helpers/migrateLegacyTableSettings';
|
|
2
|
+
/**
|
|
3
|
+
* Runs {@link migrateLegacyTableSettings} while the component renders, so it has run before the `StyledTable` it renders reads
|
|
4
|
+
* its storage for the first time (a parent renders before its children), and again whenever the current scope changes: `newKey`
|
|
5
|
+
* or `oldKeys`, which carry the user, tenant, context and patient or record. With no scope (`oldKeys` empty or missing, or no
|
|
6
|
+
* `newKey`) it does nothing, and it does nothing again for the same scope.
|
|
7
|
+
*
|
|
8
|
+
* `matchOldKey` is read at the moment the scope changes and is not a dependency: whatever it depends on must also be in
|
|
9
|
+
* `oldKeys`, so that a change of it changes the scope. The migration is idempotent, so StrictMode and a re-render that runs
|
|
10
|
+
* it again change nothing.
|
|
11
|
+
*
|
|
12
|
+
* ```tsx
|
|
13
|
+
* useLegacyTableSettingsMigration({ newKey: tableKey, oldKeys: patientId ? [oldKeyFor(patientId)] : undefined })
|
|
14
|
+
* <StyledTable uniqueKey={tableKey} … />
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export declare const useLegacyTableSettingsMigration: (migration: LegacyTableSettings) => void;
|
|
@@ -2,4 +2,6 @@ export * from './types';
|
|
|
2
2
|
export * from './components/StyledTableIndex';
|
|
3
3
|
export { RowDragHandleCell } from './components/columns/dndHandleColumn';
|
|
4
4
|
export { readPersistedSorting, usePersistedSorting, type PersistedSortingOptions, } from './hooks/usePersistedSorting';
|
|
5
|
+
export { migrateLegacyTableSettings, type LegacyRawEntry, type LegacyTableSettings, } from './helpers/migrateLegacyTableSettings';
|
|
6
|
+
export { useLegacyTableSettingsMigration } from './hooks/useLegacyTableSettingsMigration';
|
|
5
7
|
export { createColumnHelper, type Table, type Row, type ColumnDef, type CellContext } from '@tanstack/react-table';
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { tableStorage as u } from "./tableStorage.js";
|
|
2
|
+
var m = [
|
|
3
|
+
":sorting",
|
|
4
|
+
":column-sizing",
|
|
5
|
+
":page-size",
|
|
6
|
+
":column-order",
|
|
7
|
+
":column-visibility"
|
|
8
|
+
], v = (e) => (typeof e == "string" ? [e] : [...e ?? []]).filter((r) => !!r), $ = (e) => (e ?? []).filter(({ from: r, to: a }) => !!r && !!a && r !== a), T = ({ newKey: e, oldKeys: r, rawEntries: a }) => {
|
|
9
|
+
const f = v(r), i = e && f.length > 0 ? [e, ...f].join("\0") : "", n = $(a).map(({ from: c, to: s }) => `${c}\0${s}`).join("");
|
|
10
|
+
return i || n ? `${i}${n}` : "";
|
|
11
|
+
}, S = ({ newKey: e, oldKeys: r, matchOldKey: a }) => {
|
|
12
|
+
const f = v(r).filter((n) => n !== e);
|
|
13
|
+
if (!e || f.length === 0) return;
|
|
14
|
+
const i = /* @__PURE__ */ new Map();
|
|
15
|
+
if (a) try {
|
|
16
|
+
for (const n of u.keys()) {
|
|
17
|
+
const c = m.find((t) => n.endsWith(t));
|
|
18
|
+
if (c === void 0) continue;
|
|
19
|
+
const s = n.slice(0, n.length - c.length);
|
|
20
|
+
s === e || f.includes(s) || !a(s) || i.set(c, [...i.get(c) ?? [], n]);
|
|
21
|
+
}
|
|
22
|
+
} catch {
|
|
23
|
+
i.clear();
|
|
24
|
+
}
|
|
25
|
+
for (const n of m) {
|
|
26
|
+
let c = null;
|
|
27
|
+
const s = [];
|
|
28
|
+
for (const o of f) {
|
|
29
|
+
const l = u.get(`${o}${n}`);
|
|
30
|
+
l !== null && (s.push(`${o}${n}`), c ??= l);
|
|
31
|
+
}
|
|
32
|
+
const t = i.get(n) ?? [];
|
|
33
|
+
if (!(s.length === 0 && t.length === 0) && !(c !== null && u.get(`${e}${n}`) === null && !u.set(`${e}${n}`, c)))
|
|
34
|
+
for (const o of [...s, ...t]) u.remove(o);
|
|
35
|
+
}
|
|
36
|
+
}, d = ({ newKey: e, rawEntries: r, matchRawKey: a }) => {
|
|
37
|
+
const f = $(r);
|
|
38
|
+
if (f.length === 0) return;
|
|
39
|
+
const i = [...new Set(f.map(({ to: t }) => t))], n = new Set(f.map(({ from: t }) => t)), c = (t) => i.includes(t) || n.has(t) || t === e || [
|
|
40
|
+
e,
|
|
41
|
+
...i,
|
|
42
|
+
...n
|
|
43
|
+
].some((o) => !!o && m.some((l) => t === `${o}${l}`)), s = /* @__PURE__ */ new Map();
|
|
44
|
+
if (a) try {
|
|
45
|
+
for (const t of u.keys()) {
|
|
46
|
+
const o = i.filter((l) => t.startsWith(l)).sort((l, h) => h.length - l.length)[0];
|
|
47
|
+
o === void 0 || c(t) || !a(t) || s.set(o, [...s.get(o) ?? [], t]);
|
|
48
|
+
}
|
|
49
|
+
} catch {
|
|
50
|
+
s.clear();
|
|
51
|
+
}
|
|
52
|
+
for (const t of i) {
|
|
53
|
+
let o = null;
|
|
54
|
+
const l = [];
|
|
55
|
+
for (const g of f) {
|
|
56
|
+
if (g.to !== t) continue;
|
|
57
|
+
const p = u.get(g.from);
|
|
58
|
+
p !== null && (l.push(g.from), o ??= p);
|
|
59
|
+
}
|
|
60
|
+
const h = s.get(t) ?? [];
|
|
61
|
+
if (!(l.length === 0 && h.length === 0) && !(o !== null && u.get(t) === null && !u.set(t, o)))
|
|
62
|
+
for (const g of [...l, ...h]) u.remove(g);
|
|
63
|
+
}
|
|
64
|
+
}, b = (e) => {
|
|
65
|
+
for (const r of [S, d]) try {
|
|
66
|
+
r(e);
|
|
67
|
+
} catch {
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
export {
|
|
71
|
+
T as legacyTableSettingsScope,
|
|
72
|
+
b as migrateLegacyTableSettings
|
|
73
|
+
};
|
|
@@ -18,6 +18,13 @@ var e = {
|
|
|
18
18
|
localStorage.removeItem(r);
|
|
19
19
|
} catch {
|
|
20
20
|
}
|
|
21
|
+
},
|
|
22
|
+
keys() {
|
|
23
|
+
try {
|
|
24
|
+
return Array.from({ length: localStorage.length }, (r, t) => localStorage.key(t)).filter((r) => r !== null);
|
|
25
|
+
} catch {
|
|
26
|
+
return [];
|
|
27
|
+
}
|
|
21
28
|
}
|
|
22
29
|
}, a = (r) => {
|
|
23
30
|
const t = e.get(r);
|
|
@@ -1,139 +1,146 @@
|
|
|
1
|
-
import { INTERNAL_COLUMN_IDS as
|
|
2
|
-
import { readJson as O, tableStorage as
|
|
3
|
-
import { columnVisibilitySignature as
|
|
4
|
-
import { usePersistedStateWriter as
|
|
5
|
-
import { useEffect as
|
|
6
|
-
var
|
|
7
|
-
if (!
|
|
8
|
-
const i =
|
|
1
|
+
import { INTERNAL_COLUMN_IDS as A } from "../types.js";
|
|
2
|
+
import { readJson as O, tableStorage as c } from "../helpers/tableStorage.js";
|
|
3
|
+
import { columnVisibilitySignature as J, diffColumnVisibility as K, effectiveColumnOrder as m, getDefinitionColumnOrder as R, insertMissingColumns as C } from "../custom-features/order-columns/columnLayout.js";
|
|
4
|
+
import { usePersistedStateWriter as E } from "./usePersistedStateWriter.js";
|
|
5
|
+
import { useEffect as _, useLayoutEffect as F, useMemo as M } from "react";
|
|
6
|
+
var D = ":column-order", $ = ":column-visibility", f = 1, L = (e) => e ? `${e}${D}` : void 0, h = (e) => e ? `${e}${$}` : void 0, S = (e) => typeof e == "object" && e !== null && !Array.isArray(e), j = (e) => [...new Set(e.filter((i) => typeof i == "string"))], k = (e) => S(e) && e.v === f && Array.isArray(e.order), N = (e) => S(e) && e.v === f && S(e.visibility), x = (e) => {
|
|
7
|
+
if (!k(e)) return;
|
|
8
|
+
const i = j(e.order);
|
|
9
9
|
return i.length > 0 ? i : void 0;
|
|
10
|
-
}, p = (e, i) => !
|
|
11
|
-
if (!
|
|
12
|
-
const
|
|
13
|
-
return Object.keys(t).length > 0 ? t : void 0;
|
|
14
|
-
}, x = (e) => {
|
|
15
|
-
if (!Array.isArray(e)) return;
|
|
16
|
-
const i = C(e);
|
|
17
|
-
return i.length > 0 ? i : void 0;
|
|
18
|
-
}, T = (e, i, t) => {
|
|
19
|
-
if (!S(e) || !Object.values(e).every((o) => typeof o == "boolean")) return;
|
|
20
|
-
const r = K(Object.fromEntries(Object.entries(e).filter(([o]) => p(o, i))), t);
|
|
10
|
+
}, p = (e, i) => !A.includes(e) && i.find((r) => r.id === e)?.canHide !== !1, T = (e, i) => {
|
|
11
|
+
if (!N(e)) return;
|
|
12
|
+
const r = Object.fromEntries(Object.entries(e.visibility).filter((t) => typeof t[1] == "boolean" && p(t[0], i)));
|
|
21
13
|
return Object.keys(r).length > 0 ? r : void 0;
|
|
22
14
|
}, U = (e) => {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
15
|
+
if (!Array.isArray(e)) return;
|
|
16
|
+
const i = j(e);
|
|
17
|
+
return i.length > 0 ? i : void 0;
|
|
18
|
+
}, W = (e, i, r) => {
|
|
19
|
+
if (!S(e) || !Object.values(e).every((n) => typeof n == "boolean")) return;
|
|
20
|
+
const t = K(Object.fromEntries(Object.entries(e).filter(([n]) => p(n, i))), r);
|
|
21
|
+
return Object.keys(t).length > 0 ? t : void 0;
|
|
22
|
+
}, Y = (e) => {
|
|
23
|
+
const { enabled: i, uniqueKey: r, legacyOrderKey: t, legacyVisibilityKey: n, columns: l, defaultOrder: g, defaultVisibility: u } = e, s = i ? L(r) : void 0, v = i ? h(r) : void 0, y = l.map((o) => o.id), d = [];
|
|
24
|
+
let b, a;
|
|
25
|
+
if (s) {
|
|
26
|
+
if (c.get(s) !== null) {
|
|
27
|
+
const o = O(s);
|
|
28
|
+
b = x(o), k(o) && t && c.get(t) !== null && d.push({ legacyKey: t });
|
|
29
|
+
} else if (t && c.get(t) !== null) {
|
|
30
|
+
const o = U(O(t)), I = o === void 0 || m(C(o, y), y).join() === m(g, y).join();
|
|
31
|
+
o && !I && (b = o), d.push({
|
|
32
|
+
legacyKey: t,
|
|
33
|
+
...o && !I && { write: {
|
|
34
|
+
key: s,
|
|
33
35
|
value: JSON.stringify({
|
|
34
36
|
v: f,
|
|
35
|
-
order:
|
|
37
|
+
order: o
|
|
36
38
|
})
|
|
37
39
|
} }
|
|
38
40
|
});
|
|
39
41
|
}
|
|
40
42
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
43
|
+
if (v)
|
|
44
|
+
if (c.get(v) !== null) {
|
|
45
|
+
const o = O(v);
|
|
46
|
+
a = T(o, l), N(o) && n && c.get(n) !== null && d.push({ legacyKey: n });
|
|
47
|
+
} else n && c.get(n) !== null && (a = W(O(n), l, u), d.push({
|
|
48
|
+
legacyKey: n,
|
|
49
|
+
...a && { write: {
|
|
50
|
+
key: v,
|
|
51
|
+
value: JSON.stringify({
|
|
52
|
+
v: f,
|
|
53
|
+
visibility: a
|
|
54
|
+
})
|
|
55
|
+
} }
|
|
56
|
+
}));
|
|
57
|
+
return {
|
|
58
|
+
orderKey: s,
|
|
59
|
+
visibilityKey: v,
|
|
53
60
|
order: b,
|
|
54
|
-
visibility:
|
|
55
|
-
migration:
|
|
61
|
+
visibility: a,
|
|
62
|
+
migration: d
|
|
56
63
|
};
|
|
57
|
-
},
|
|
58
|
-
const
|
|
64
|
+
}, q = (e, i, r) => {
|
|
65
|
+
const t = e.visibility && Object.fromEntries(Object.entries(e.visibility).filter(([n]) => p(n, i)));
|
|
59
66
|
return {
|
|
60
67
|
orderKey: e.orderKey,
|
|
61
68
|
visibilityKey: e.visibilityKey,
|
|
62
|
-
order: e.order &&
|
|
63
|
-
visibility:
|
|
64
|
-
...
|
|
65
|
-
...
|
|
69
|
+
order: e.order && C(e.order, i.map((n) => n.id)),
|
|
70
|
+
visibility: t && Object.keys(t).length > 0 ? {
|
|
71
|
+
...r,
|
|
72
|
+
...t
|
|
66
73
|
} : void 0
|
|
67
74
|
};
|
|
68
|
-
},
|
|
69
|
-
const i =
|
|
70
|
-
e.enabled ?
|
|
71
|
-
e.enabled ?
|
|
75
|
+
}, Q = (e) => {
|
|
76
|
+
const i = M(() => Y(e), [
|
|
77
|
+
e.enabled ? L(e.uniqueKey) : void 0,
|
|
78
|
+
e.enabled ? h(e.uniqueKey) : void 0,
|
|
72
79
|
e.legacyOrderKey,
|
|
73
80
|
e.legacyVisibilityKey
|
|
74
81
|
]);
|
|
75
|
-
return
|
|
76
|
-
for (const { legacyKey:
|
|
77
|
-
|
|
78
|
-
}, [i]),
|
|
79
|
-
}, V = /* @__PURE__ */ new WeakMap(),
|
|
80
|
-
const { enabled:
|
|
82
|
+
return _(() => {
|
|
83
|
+
for (const { legacyKey: r, write: t } of i.migration)
|
|
84
|
+
t && !c.set(t.key, t.value) || c.remove(r);
|
|
85
|
+
}, [i]), q(i, e.columns, e.defaultVisibility);
|
|
86
|
+
}, V = /* @__PURE__ */ new WeakMap(), z = (e, i) => [.../* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(i)])].every((r) => (e[r] ?? !0) === (i[r] ?? !0)), Z = (e, i) => {
|
|
87
|
+
const { enabled: r, definitionIds: t, defaultOrder: n, defaultVisibility: l, controlledVisibility: g } = i, u = {
|
|
81
88
|
signature: JSON.stringify([
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
Object.entries(
|
|
89
|
+
t,
|
|
90
|
+
n,
|
|
91
|
+
Object.entries(l).sort()
|
|
85
92
|
]),
|
|
86
|
-
definitionIds:
|
|
87
|
-
defaultOrder:
|
|
88
|
-
defaultVisibility:
|
|
89
|
-
},
|
|
90
|
-
return
|
|
93
|
+
definitionIds: t,
|
|
94
|
+
defaultOrder: n,
|
|
95
|
+
defaultVisibility: l
|
|
96
|
+
}, s = V.get(e) ?? u, v = r && s.signature !== u.signature;
|
|
97
|
+
return F(() => {
|
|
91
98
|
const y = V.get(e);
|
|
92
|
-
if (V.set(e,
|
|
93
|
-
const
|
|
99
|
+
if (V.set(e, u), !r || !y || y.signature === u.signature) return;
|
|
100
|
+
const d = e.getState().columnOrder, b = m(d, y.definitionIds).join() === m(y.defaultOrder, y.definitionIds).join() ? n : C(d, t);
|
|
94
101
|
if (e.setColumnOrder(b), !g) {
|
|
95
|
-
const
|
|
96
|
-
...
|
|
97
|
-
...K(
|
|
102
|
+
const a = e.getState().columnVisibility, o = {
|
|
103
|
+
...l,
|
|
104
|
+
...K(a, y.defaultVisibility)
|
|
98
105
|
};
|
|
99
|
-
|
|
106
|
+
z(o, a) || e.setColumnVisibility(o);
|
|
100
107
|
}
|
|
101
108
|
}, [
|
|
102
109
|
e,
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
]),
|
|
106
|
-
},
|
|
107
|
-
const { saved:
|
|
108
|
-
|
|
109
|
-
storageKey:
|
|
110
|
+
r,
|
|
111
|
+
u.signature
|
|
112
|
+
]), v;
|
|
113
|
+
}, w = (e, i) => {
|
|
114
|
+
const { saved: r, reconciling: t, defaultOrder: n, defaultVisibility: l, controlledVisibility: g } = i, u = R(e);
|
|
115
|
+
E({
|
|
116
|
+
storageKey: r.orderKey,
|
|
110
117
|
state: e.getState().columnOrder,
|
|
111
|
-
defaultValue:
|
|
112
|
-
saved:
|
|
113
|
-
settled: !
|
|
114
|
-
toSignature: (
|
|
115
|
-
toStorage: (
|
|
118
|
+
defaultValue: n,
|
|
119
|
+
saved: r.order,
|
|
120
|
+
settled: !t,
|
|
121
|
+
toSignature: (s) => JSON.stringify(m(s, u)),
|
|
122
|
+
toStorage: (s) => JSON.stringify({
|
|
116
123
|
v: f,
|
|
117
|
-
order:
|
|
124
|
+
order: j(s)
|
|
118
125
|
}),
|
|
119
|
-
applyState: (
|
|
120
|
-
}),
|
|
121
|
-
storageKey:
|
|
126
|
+
applyState: (s) => e.setColumnOrder(s)
|
|
127
|
+
}), E({
|
|
128
|
+
storageKey: r.visibilityKey,
|
|
122
129
|
state: e.getState().columnVisibility,
|
|
123
|
-
defaultValue:
|
|
124
|
-
saved:
|
|
125
|
-
settled: !
|
|
130
|
+
defaultValue: l,
|
|
131
|
+
saved: r.visibility,
|
|
132
|
+
settled: !t,
|
|
126
133
|
controlled: g,
|
|
127
|
-
toSignature: (
|
|
128
|
-
toStorage: (
|
|
134
|
+
toSignature: (s) => J(s, l),
|
|
135
|
+
toStorage: (s) => JSON.stringify({
|
|
129
136
|
v: f,
|
|
130
|
-
visibility: K(
|
|
137
|
+
visibility: K(s, l)
|
|
131
138
|
}),
|
|
132
|
-
applyState: (
|
|
139
|
+
applyState: (s) => e.setColumnVisibility(s)
|
|
133
140
|
});
|
|
134
141
|
};
|
|
135
142
|
export {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
143
|
+
Z as useColumnLayoutReconcile,
|
|
144
|
+
w as useColumnLayoutWriter,
|
|
145
|
+
Q as useSavedColumnLayout
|
|
139
146
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { legacyTableSettingsScope as t, migrateLegacyTableSettings as a } from "../helpers/migrateLegacyTableSettings.js";
|
|
2
|
+
import { useMemo as g } from "react";
|
|
3
|
+
var i = (e) => {
|
|
4
|
+
g(() => a(e), [t(e)]);
|
|
5
|
+
};
|
|
6
|
+
export {
|
|
7
|
+
i as useLegacyTableSettingsMigration
|
|
8
|
+
};
|
package/dist/table/index.js
CHANGED
|
@@ -2,7 +2,9 @@ import "./types.js";
|
|
|
2
2
|
import "./hooks/usePersistedSorting.js";
|
|
3
3
|
import "./components/columns/dndHandleColumn.js";
|
|
4
4
|
import "./components/StyledTableIndex.js";
|
|
5
|
-
import
|
|
5
|
+
import "./helpers/migrateLegacyTableSettings.js";
|
|
6
|
+
import "./hooks/useLegacyTableSettingsMigration.js";
|
|
7
|
+
import { createColumnHelper as f } from "@tanstack/react-table";
|
|
6
8
|
export {
|
|
7
|
-
|
|
9
|
+
f as createColumnHelper
|
|
8
10
|
};
|