@envisiongroup/porygon 1.0.0-rc.9 → 1.0.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/README.md +50 -14
- package/dist/index.d.ts +9 -15
- package/dist/index.js +95 -55
- package/dist/react-components/buttons/EFWButton/EFWButton.d.ts +1 -1
- package/dist/react-components/buttons/EFWButton/EFWButton.hooks.js +32 -31
- package/dist/react-components/buttons/EFWButton/EFWButton.js +158 -90
- package/dist/react-components/buttons/EFWButton/EFWButton.types.d.ts +32 -6
- package/dist/react-components/buttons/EFWButton/index.d.ts +1 -1
- package/dist/react-components/buttons/EFWDrawerButton/EFWDrawerButton.d.ts +1 -1
- package/dist/react-components/buttons/EFWDrawerButton/EFWDrawerButton.types.d.ts +1 -1
- package/dist/react-components/buttons/EFWGroupButton/EFWGroupButton.d.ts +1 -63
- package/dist/react-components/buttons/EFWGroupButton/EFWGroupButton.js +120 -85
- package/dist/react-components/buttons/EFWGroupButton/EFWGroupButton.types.d.ts +7 -1
- package/dist/react-components/buttons/EFWGroupButton/index.d.ts +1 -1
- package/dist/react-components/commons/caretPositioning.d.ts +35 -0
- package/dist/react-components/commons/caretPositioning.js +28 -0
- package/dist/react-components/commons/utils.d.ts +1 -1
- package/dist/react-components/commons/utils.js +1 -1
- package/dist/react-components/commons/valueNormalization.d.ts +28 -0
- package/dist/react-components/commons/valueNormalization.js +6 -0
- package/dist/react-components/fields/Attachments/EFWAttachments.js +205 -0
- package/dist/react-components/fields/{EFWAttachments → Attachments}/EFWAttachments.types.d.ts +32 -2
- package/dist/react-components/fields/Attachments/EFWAttachments.utils.d.ts +8 -0
- package/dist/react-components/fields/Attachments/EFWAttachments.utils.js +4 -0
- package/dist/react-components/fields/{EFWAttachments/EFWAttachmentsCard → Attachments}/EFWAttachmentsCard.d.ts +2 -11
- package/dist/react-components/fields/Attachments/EFWAttachmentsCard.js +164 -0
- package/dist/react-components/fields/{EFWAttachments/EFWAttachmentsCard → Attachments}/EFWAttachmentsCard.types.d.ts +21 -1
- package/dist/react-components/fields/Attachments/EFWAttachmentsField.js +70 -0
- package/dist/react-components/fields/{EFWAttachmentsField → Attachments}/EFWAttachmentsField.types.d.ts +2 -2
- package/dist/react-components/fields/Attachments/index.d.ts +5 -0
- package/dist/react-components/fields/Attachments/index.js +8 -0
- package/dist/react-components/fields/{EFWDatePicker → DatePicker}/EFWDatePicker.d.ts +1 -3
- package/dist/react-components/fields/DatePicker/EFWDatePicker.js +134 -0
- package/dist/react-components/fields/{EFWDatePicker → DatePicker}/EFWDatePicker.types.d.ts +19 -7
- package/dist/react-components/fields/DatePicker/EFWDatePicker.utils.d.ts +19 -0
- package/dist/react-components/fields/DatePicker/EFWDatePicker.utils.js +179 -0
- package/dist/react-components/fields/DatePicker/EFWDatePickerField.js +251 -0
- package/dist/react-components/fields/DatePicker/EFWDatePickerField.types.d.ts +15 -0
- package/dist/react-components/fields/DatePicker/index.d.ts +6 -0
- package/dist/react-components/fields/DatePicker/index.js +11 -0
- package/dist/react-components/fields/Input/EFWInput.d.ts +10 -0
- package/dist/react-components/fields/Input/EFWInput.js +260 -0
- package/dist/react-components/fields/{EFWInput → Input}/EFWInput.types.d.ts +120 -25
- package/dist/react-components/fields/Input/EFWInput.utils.d.ts +101 -0
- package/dist/react-components/fields/Input/EFWInput.utils.js +222 -0
- package/dist/react-components/fields/Input/EFWInput.validation.d.ts +20 -0
- package/dist/react-components/fields/Input/EFWInput.validation.js +72 -0
- package/dist/react-components/fields/Input/EFWInputField.js +86 -0
- package/dist/react-components/fields/{EFWInputField → Input}/EFWInputField.types.d.ts +2 -2
- package/dist/react-components/fields/Input/index.d.ts +5 -0
- package/dist/react-components/fields/Input/index.js +8 -0
- package/dist/react-components/fields/NumberInput/EFWNumberInput.js +339 -0
- package/dist/react-components/fields/{EFWNumberInput → NumberInput}/EFWNumberInput.types.d.ts +33 -14
- package/dist/react-components/fields/{EFWNumberInput → NumberInput}/EFWNumberInput.utils.d.ts +20 -14
- package/dist/react-components/fields/NumberInput/EFWNumberInput.utils.js +86 -0
- package/dist/react-components/fields/NumberInput/EFWNumberInputField.js +84 -0
- package/dist/react-components/fields/{EFWNumberInputField → NumberInput}/EFWNumberInputField.types.d.ts +2 -2
- package/dist/react-components/fields/NumberInput/index.d.ts +5 -0
- package/dist/react-components/fields/NumberInput/index.js +8 -0
- package/dist/react-components/fields/Switch/EFWSwitch.js +75 -0
- package/dist/react-components/fields/{EFWSwitch → Switch}/EFWSwitch.types.d.ts +18 -10
- package/dist/react-components/fields/Switch/EFWSwitch.utils.d.ts +9 -0
- package/dist/react-components/fields/Switch/EFWSwitch.utils.js +4 -0
- package/dist/react-components/fields/Switch/EFWSwitchField.js +62 -0
- package/dist/react-components/fields/{EFWSwitchField → Switch}/EFWSwitchField.types.d.ts +6 -2
- package/dist/react-components/fields/Switch/index.d.ts +5 -0
- package/dist/react-components/fields/Switch/index.js +8 -0
- package/dist/react-components/fields/TagPicker/EFWTagPicker.js +384 -0
- package/dist/react-components/fields/{EFWTagPicker → TagPicker}/EFWTagPicker.types.d.ts +30 -17
- package/dist/react-components/fields/TagPicker/EFWTagPicker.utils.d.ts +6 -0
- package/dist/react-components/fields/TagPicker/EFWTagPicker.utils.js +4 -0
- package/dist/react-components/fields/TagPicker/EFWTagPickerField.js +83 -0
- package/dist/react-components/fields/{EFWTagPickerField → TagPicker}/EFWTagPickerField.types.d.ts +2 -2
- package/dist/react-components/fields/TagPicker/index.d.ts +5 -0
- package/dist/react-components/fields/TagPicker/index.js +8 -0
- package/dist/react-components/fields/TextArea/EFWTextArea.js +153 -0
- package/dist/react-components/fields/{EFWTextArea → TextArea}/EFWTextArea.types.d.ts +26 -8
- package/dist/react-components/fields/TextArea/EFWTextArea.utils.d.ts +6 -0
- package/dist/react-components/fields/TextArea/EFWTextArea.utils.js +4 -0
- package/dist/react-components/fields/TextArea/EFWTextAreaField.js +80 -0
- package/dist/react-components/fields/{EFWTextAreaField → TextArea}/EFWTextAreaField.types.d.ts +2 -2
- package/dist/react-components/fields/TextArea/index.d.ts +5 -0
- package/dist/react-components/fields/TextArea/index.js +8 -0
- package/dist/react-components/fields/_shared/EFWField/EFWField.js +119 -0
- package/dist/react-components/fields/{EFWField → _shared/EFWField}/EFWField.types.d.ts +24 -13
- package/dist/react-components/fields/_shared/EFWField/EFWField.utils.js +20 -0
- package/dist/react-components/fields/_shared/EFWField/useSyncedValidationState.d.ts +50 -0
- package/dist/react-components/fields/_shared/EFWField/useSyncedValidationState.js +41 -0
- package/dist/react-components/fields/test-utils/testUtils.js +10 -0
- package/dist/react-components/forms/EFWForm/EFWForm.converter.d.ts +16 -1
- package/dist/react-components/forms/EFWForm/EFWForm.converter.js +51 -20
- package/dist/react-components/forms/EFWForm/EFWForm.flatConverter.d.ts +130 -0
- package/dist/react-components/forms/EFWForm/EFWForm.flatConverter.js +279 -0
- package/dist/react-components/forms/EFWForm/EFWForm.hooks.js +21 -18
- package/dist/react-components/forms/EFWForm/EFWForm.js +866 -403
- package/dist/react-components/forms/EFWForm/EFWForm.types.d.ts +213 -89
- package/dist/react-components/forms/EFWForm/EFWForm.utils.d.ts +10 -5
- package/dist/react-components/forms/EFWForm/EFWForm.utils.js +356 -229
- package/dist/react-components/forms/EFWForm/index.d.ts +5 -2
- package/dist/react-components/forms/EFWForm/index.js +10 -6
- package/dist/react-components/forms/EFWFormMessageBarGroup/EFWFormMessageBarGroup.js +55 -55
- package/dist/react-components/forms/EFWMessageBarManager/EFWMessageBarManager.js +38 -29
- package/dist/react-components/hooks/useDrawer/component/EFWDrawer/EFWDrawer.js +49 -47
- package/dist/react-components/hooks/useDrawer/component/EFWDrawer/EFWDrawer.types.d.ts +1 -0
- package/dist/react-components/hooks/useDrawer/component/EFWDrawerLoader/EFWDrawerLoader.d.ts +5 -3
- package/dist/react-components/hooks/useDrawer/component/EFWDrawerLoader/EFWDrawerLoader.js +6 -6
- package/dist/react-components/hooks/useDrawer/index.d.ts +1 -1
- package/dist/react-components/hooks/useDrawer/useDrawer.d.ts +4 -2
- package/dist/react-components/hooks/useDrawer/useDrawer.js +216 -111
- package/dist/react-components/hooks/useDrawer/useDrawer.types.d.ts +15 -2
- package/dist/react-components/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.d.ts +42 -0
- package/dist/react-components/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js +5 -0
- package/dist/react-components/i18n/PorygonI18nProvider.d.ts +13 -0
- package/dist/react-components/i18n/PorygonI18nProvider.js +145 -0
- package/dist/react-components/i18n/defaultLocaleText.d.ts +6 -0
- package/dist/react-components/i18n/defaultLocaleText.js +176 -0
- package/dist/react-components/i18n/index.d.ts +4 -0
- package/dist/react-components/i18n/index.js +19 -0
- package/dist/react-components/i18n/localePresets.d.ts +10 -0
- package/dist/react-components/i18n/localePresets.js +366 -0
- package/dist/react-components/i18n/porygonI18n.types.d.ts +169 -0
- package/dist/react-components/layout/MainNavItems/MainNavItems.js +13 -13
- package/dist/react-components/tables/EFWTable/EFWTable.d.ts +2 -5
- package/dist/react-components/tables/EFWTable/EFWTable.js +916 -525
- package/dist/react-components/tables/EFWTable/EFWTable.types.d.ts +256 -62
- package/dist/react-components/tables/EFWTable/components/EFWTableBody/EFWTableBody.d.ts +5 -1
- package/dist/react-components/tables/EFWTable/components/EFWTableBody/EFWTableBody.js +97 -52
- package/dist/react-components/tables/EFWTable/components/EFWTableBody/EFWTableBody.types.d.ts +4 -1
- package/dist/react-components/tables/EFWTable/components/EFWTableCell/EFWTableCell.d.ts +1 -12
- package/dist/react-components/tables/EFWTable/components/EFWTableCell/EFWTableCell.js +47 -22
- package/dist/react-components/tables/EFWTable/components/EFWTableCell/EFWTableCell.types.d.ts +13 -0
- package/dist/react-components/tables/EFWTable/components/EFWTableCommandBar/EFWTableCommandBar.d.ts +1 -1
- package/dist/react-components/tables/EFWTable/components/EFWTableCommandBar/EFWTableCommandBar.js +94 -69
- package/dist/react-components/tables/EFWTable/components/EFWTableCommandBar/EFWTableCommandBar.types.d.ts +7 -16
- package/dist/react-components/tables/EFWTable/components/EFWTableCommandBar/index.d.ts +1 -1
- package/dist/react-components/tables/EFWTable/components/EFWTableHeader/EFWTableHeader.d.ts +1 -1
- package/dist/react-components/tables/EFWTable/components/EFWTableHeader/EFWTableHeader.js +218 -83
- package/dist/react-components/tables/EFWTable/components/EFWTableHeader/EFWTableHeader.types.d.ts +3 -0
- package/dist/react-components/tables/EFWTable/components/EFWTableOverlay/EFWTableOverlay.js +90 -88
- package/dist/react-components/tables/EFWTable/components/EFWTableOverlay/EFWTableOverlay.types.d.ts +5 -0
- package/dist/react-components/tables/EFWTable/components/EFWTableRow/EFWTableRow.d.ts +1 -18
- package/dist/react-components/tables/EFWTable/components/EFWTableRow/EFWTableRow.js +83 -45
- package/dist/react-components/tables/EFWTable/components/EFWTableRow/EFWTableRow.types.d.ts +23 -0
- package/dist/react-components/tables/EFWTable/hooks/useDefaultAddButton/useDefaultAddButton.d.ts +2 -1
- package/dist/react-components/tables/EFWTable/hooks/useDefaultAddButton/useDefaultAddButton.js +65 -48
- package/dist/react-components/tables/EFWTable/hooks/useDefaultDeleteButton/useDefaultDeleteButton.d.ts +2 -1
- package/dist/react-components/tables/EFWTable/hooks/useDefaultDeleteButton/useDefaultDeleteButton.js +71 -48
- package/dist/react-components/tables/EFWTable/hooks/useDefaultFilterButton/useDefaultFilterButton.d.ts +17 -0
- package/dist/react-components/tables/EFWTable/hooks/useDefaultFilterButton/useDefaultFilterButton.js +255 -0
- package/dist/react-components/tables/EFWTable/hooks/useDefaultUpdateButton/useDefaultUpdateButton.d.ts +2 -1
- package/dist/react-components/tables/EFWTable/hooks/useDefaultUpdateButton/useDefaultUpdateButton.js +72 -52
- package/dist/react-components/tables/EFWTable/hooks/useStableColumnRenderers/useStableColumnRenderers.d.ts +10 -0
- package/dist/react-components/tables/EFWTable/hooks/useStableColumnRenderers/useStableColumnRenderers.js +28 -0
- package/dist/react-components/tables/EFWTable/hooks/useTableController/useTableController.js +151 -115
- package/dist/react-components/tables/EFWTable/hooks/useTableSelection/useTableSelection.d.ts +1 -1
- package/dist/react-components/tables/EFWTable/hooks/useTableSelection/useTableSelection.js +100 -53
- package/dist/react-components/tables/EFWTable/hooks/useTableSelection/useTableSelection.types.d.ts +5 -1
- package/dist/react-components/tables/EFWTable/index.d.ts +4 -1
- package/dist/react-components/tables/EFWTable/index.js +7 -5
- package/dist/react-components/tables/EFWTable/utils/CellRenderer/CellRenderer.js +26 -23
- package/dist/react-components/tables/EFWTable/utils/cache.d.ts +1 -8
- package/dist/react-components/tables/EFWTable/utils/cache.js +40 -49
- package/dist/react-components/tables/EFWTable/utils/filterFunctions.d.ts +16 -0
- package/dist/react-components/tables/EFWTable/utils/filterFunctions.js +52 -0
- package/dist/react-components/tables/EFWTable/utils/hashing.d.ts +2 -2
- package/dist/react-components/tables/EFWTable/utils/hashing.js +2 -2
- package/package.json +49 -22
- package/dist/react-components/fields/EFWAttachments/EFWAttachments.js +0 -125
- package/dist/react-components/fields/EFWAttachments/EFWAttachmentsCard/EFWAttachmentsCard.js +0 -107
- package/dist/react-components/fields/EFWAttachments/EFWAttachmentsCard/index.d.ts +0 -1
- package/dist/react-components/fields/EFWAttachments/index.d.ts +0 -2
- package/dist/react-components/fields/EFWAttachments/index.js +0 -4
- package/dist/react-components/fields/EFWAttachmentsField/EFWAttachmentsField.js +0 -57
- package/dist/react-components/fields/EFWAttachmentsField/index.d.ts +0 -2
- package/dist/react-components/fields/EFWAttachmentsField/index.js +0 -4
- package/dist/react-components/fields/EFWDatePicker/EFWDatePicker.js +0 -114
- package/dist/react-components/fields/EFWDatePicker/EFWDatePicker.utils.d.ts +0 -24
- package/dist/react-components/fields/EFWDatePicker/EFWDatePicker.utils.js +0 -90
- package/dist/react-components/fields/EFWDatePicker/index.d.ts +0 -2
- package/dist/react-components/fields/EFWDatePicker/index.js +0 -4
- package/dist/react-components/fields/EFWDatePickerField/EFWDatePickerField.js +0 -65
- package/dist/react-components/fields/EFWDatePickerField/EFWDatePickerField.types.d.ts +0 -7
- package/dist/react-components/fields/EFWDatePickerField/index.d.ts +0 -2
- package/dist/react-components/fields/EFWDatePickerField/index.js +0 -4
- package/dist/react-components/fields/EFWField/EFWField.js +0 -96
- package/dist/react-components/fields/EFWField/EFWField.utils.js +0 -17
- package/dist/react-components/fields/EFWInput/EFWInput.d.ts +0 -26
- package/dist/react-components/fields/EFWInput/EFWInput.js +0 -119
- package/dist/react-components/fields/EFWInput/EFWInput.utils.d.ts +0 -20
- package/dist/react-components/fields/EFWInput/EFWInput.utils.js +0 -83
- package/dist/react-components/fields/EFWInput/index.d.ts +0 -2
- package/dist/react-components/fields/EFWInput/index.js +0 -4
- package/dist/react-components/fields/EFWInputField/EFWInputField.js +0 -73
- package/dist/react-components/fields/EFWInputField/EFWInputField.utils.d.ts +0 -1
- package/dist/react-components/fields/EFWInputField/EFWInputField.utils.js +0 -0
- package/dist/react-components/fields/EFWInputField/index.d.ts +0 -2
- package/dist/react-components/fields/EFWInputField/index.js +0 -4
- package/dist/react-components/fields/EFWNumberInput/EFWNumberInput.js +0 -198
- package/dist/react-components/fields/EFWNumberInput/EFWNumberInput.utils.js +0 -76
- package/dist/react-components/fields/EFWNumberInput/index.d.ts +0 -2
- package/dist/react-components/fields/EFWNumberInput/index.js +0 -4
- package/dist/react-components/fields/EFWNumberInputField/EFWNumberInputField.js +0 -67
- package/dist/react-components/fields/EFWNumberInputField/EFWNumberInputField.utils.d.ts +0 -1
- package/dist/react-components/fields/EFWNumberInputField/EFWNumberInputField.utils.js +0 -0
- package/dist/react-components/fields/EFWNumberInputField/index.d.ts +0 -2
- package/dist/react-components/fields/EFWNumberInputField/index.js +0 -4
- package/dist/react-components/fields/EFWSwitch/EFWSwitch.js +0 -55
- package/dist/react-components/fields/EFWSwitch/index.d.ts +0 -2
- package/dist/react-components/fields/EFWSwitch/index.js +0 -4
- package/dist/react-components/fields/EFWSwitchField/EFWSwitchField.js +0 -55
- package/dist/react-components/fields/EFWSwitchField/index.d.ts +0 -2
- package/dist/react-components/fields/EFWSwitchField/index.js +0 -4
- package/dist/react-components/fields/EFWTagPicker/EFWTagPicker.js +0 -244
- package/dist/react-components/fields/EFWTagPicker/index.d.ts +0 -2
- package/dist/react-components/fields/EFWTagPicker/index.js +0 -4
- package/dist/react-components/fields/EFWTagPickerField/EFWTagPickerField.js +0 -74
- package/dist/react-components/fields/EFWTagPickerField/EFWTagPickerField.utils.d.ts +0 -1
- package/dist/react-components/fields/EFWTagPickerField/EFWTagPickerField.utils.js +0 -0
- package/dist/react-components/fields/EFWTagPickerField/index.d.ts +0 -2
- package/dist/react-components/fields/EFWTagPickerField/index.js +0 -4
- package/dist/react-components/fields/EFWTextArea/EFWTextArea.js +0 -105
- package/dist/react-components/fields/EFWTextArea/EFWTextArea.utils.d.ts +0 -1
- package/dist/react-components/fields/EFWTextArea/EFWTextArea.utils.js +0 -0
- package/dist/react-components/fields/EFWTextArea/index.d.ts +0 -2
- package/dist/react-components/fields/EFWTextArea/index.js +0 -4
- package/dist/react-components/fields/EFWTextAreaField/EFWTextAreaField.js +0 -71
- package/dist/react-components/fields/EFWTextAreaField/EFWTextAreaField.utils.d.ts +0 -1
- package/dist/react-components/fields/EFWTextAreaField/EFWTextAreaField.utils.js +0 -0
- package/dist/react-components/fields/EFWTextAreaField/index.d.ts +0 -2
- package/dist/react-components/fields/EFWTextAreaField/index.js +0 -4
- package/dist/react-components/fields/types.d.ts +0 -1
- package/dist/react-components/fields/types.js +0 -0
- package/dist/utils/htmlConverter.d.ts +0 -15
- package/dist/utils/htmlConverter.js +0 -12
- /package/dist/react-components/fields/{EFWAttachments → Attachments}/EFWAttachments.d.ts +0 -0
- /package/dist/react-components/fields/{EFWAttachmentsField → Attachments}/EFWAttachmentsField.d.ts +0 -0
- /package/dist/react-components/fields/{EFWDatePickerField → DatePicker}/EFWDatePickerField.d.ts +0 -0
- /package/dist/react-components/fields/{EFWInputField → Input}/EFWInputField.d.ts +0 -0
- /package/dist/react-components/fields/{EFWNumberInput → NumberInput}/EFWNumberInput.d.ts +0 -0
- /package/dist/react-components/fields/{EFWNumberInputField → NumberInput}/EFWNumberInputField.d.ts +0 -0
- /package/dist/react-components/fields/{EFWSwitch → Switch}/EFWSwitch.d.ts +0 -0
- /package/dist/react-components/fields/{EFWSwitchField → Switch}/EFWSwitchField.d.ts +0 -0
- /package/dist/react-components/fields/{EFWTagPicker → TagPicker}/EFWTagPicker.d.ts +0 -0
- /package/dist/react-components/fields/{EFWTagPickerField → TagPicker}/EFWTagPickerField.d.ts +0 -0
- /package/dist/react-components/fields/{EFWTextArea → TextArea}/EFWTextArea.d.ts +0 -0
- /package/dist/react-components/fields/{EFWTextAreaField → TextArea}/EFWTextAreaField.d.ts +0 -0
- /package/dist/react-components/fields/{EFWField → _shared/EFWField}/EFWField.d.ts +0 -0
- /package/dist/react-components/fields/{EFWField → _shared/EFWField}/EFWField.utils.d.ts +0 -0
- /package/dist/react-components/fields/{EFWField → _shared/EFWField}/index.d.ts +0 -0
- /package/dist/react-components/fields/{EFWField → _shared/EFWField}/index.js +0 -0
- /package/dist/{react-components/fields/EFWAttachments/EFWAttachmentsCard/index.js → vite-raw.d.js} +0 -0
|
@@ -1,44 +1,85 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
3
|
-
import { useRef as
|
|
4
|
-
import { useReactTable as
|
|
5
|
-
import { makeStyles as
|
|
6
|
-
import { useTableSelection as
|
|
7
|
-
import { renderCellContent as
|
|
8
|
-
import { useDefaultAddButton as
|
|
9
|
-
import { useDefaultUpdateButton as
|
|
10
|
-
import { useDefaultDeleteButton as
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
import { jsx as D, jsxs as ct } from "react/jsx-runtime";
|
|
2
|
+
import * as fr from "react";
|
|
3
|
+
import { useMemo as se, useRef as w, useState as te, useCallback as f, useEffect as oe, useLayoutEffect as kn } from "react";
|
|
4
|
+
import { useReactTable as mr, getSortedRowModel as hr, getFilteredRowModel as pr, getCoreRowModel as gr } from "@tanstack/react-table";
|
|
5
|
+
import { makeStyles as Sr, tokens as $, mergeClasses as wr, Card as xr, Checkbox as Hn, Spinner as Ir } from "@fluentui/react-components";
|
|
6
|
+
import { useTableSelection as br } from "./hooks/useTableSelection/useTableSelection.js";
|
|
7
|
+
import { renderCellContent as yr } from "./utils/index.js";
|
|
8
|
+
import { useDefaultAddButton as Rr } from "./hooks/useDefaultAddButton/useDefaultAddButton.js";
|
|
9
|
+
import { useDefaultUpdateButton as vr } from "./hooks/useDefaultUpdateButton/useDefaultUpdateButton.js";
|
|
10
|
+
import { useDefaultDeleteButton as Cr } from "./hooks/useDefaultDeleteButton/useDefaultDeleteButton.js";
|
|
11
|
+
import { useDefaultFilterButton as Tr } from "./hooks/useDefaultFilterButton/useDefaultFilterButton.js";
|
|
12
|
+
import { useStableColumnRenderers as Er } from "./hooks/useStableColumnRenderers/useStableColumnRenderers.js";
|
|
13
|
+
import { getFilterFn as zr, isEmptyFilterValue as Fr } from "./utils/filterFunctions.js";
|
|
14
|
+
import { useTableLocaleText as Mr, PorygonI18nProvider as Ar } from "../../i18n/PorygonI18nProvider.js";
|
|
15
|
+
import { generateId as it } from "./utils/general.js";
|
|
16
|
+
import { addRowId as We, ensureItemRowId as Ln } from "./utils/typeHelpers.js";
|
|
17
|
+
import { EFWTableCommandBar as Nr } from "./components/EFWTableCommandBar/EFWTableCommandBar.js";
|
|
18
|
+
import { EFWTableOverlay as _n } from "./components/EFWTableOverlay/EFWTableOverlay.js";
|
|
19
|
+
import { EFWTableHeader as kr } from "./components/EFWTableHeader/EFWTableHeader.js";
|
|
20
|
+
import { EFWTableBody as Lr } from "./components/EFWTableBody/EFWTableBody.js";
|
|
21
|
+
const de = {}, _r = /* @__PURE__ */ new Set(), Wn = [], Be = [], Wr = {}, De = (g) => g, Br = (g) => Object.entries(g).filter(([, p]) => !Fr(p)).map(([p, y]) => ({ id: p, value: y })), Oe = (g) => Object.fromEntries(g.map((p) => [p.id, p.value])), Bn = (g) => g.map(({ id: p, desc: y }) => ({ id: p, desc: y })), Me = (g) => g.map(({ id: p, desc: y }) => ({ id: p, desc: y })), O = 120, Ae = 40, he = 120, Pe = 2500, Dn = 500, Dr = 20, Or = (g) => {
|
|
22
|
+
switch (g) {
|
|
23
|
+
case "Date":
|
|
24
|
+
return (p, y, a) => {
|
|
25
|
+
const C = p.getValue(a), v = y.getValue(a), M = C?.[0] ? new Date(C[0]).getTime() : 0, z = v?.[0] ? new Date(v[0]).getTime() : 0;
|
|
26
|
+
return M < z ? -1 : M > z ? 1 : 0;
|
|
27
|
+
};
|
|
28
|
+
case "Choice":
|
|
29
|
+
return (p, y, a) => {
|
|
30
|
+
const C = p.getValue(a), v = y.getValue(a), M = C?.map((k) => k.text).join(", ") ?? "", z = v?.map((k) => k.text).join(", ") ?? "";
|
|
31
|
+
return M.localeCompare(z);
|
|
32
|
+
};
|
|
33
|
+
case "Number":
|
|
34
|
+
return "basic";
|
|
35
|
+
case "Boolean":
|
|
36
|
+
return (p, y, a) => {
|
|
37
|
+
const C = p.getValue(a), v = y.getValue(a);
|
|
38
|
+
return (C ? 1 : 0) - (v ? 1 : 0);
|
|
39
|
+
};
|
|
40
|
+
default:
|
|
41
|
+
return "alphanumeric";
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
function fe(g, p, y) {
|
|
45
|
+
return p.length === 0 ? g : y === "start" ? [...p, ...g] : [...g, ...p];
|
|
46
|
+
}
|
|
47
|
+
function me(g, p, y) {
|
|
48
|
+
const a = y === "start" ? 0 : p;
|
|
49
|
+
return g.map((C, v) => ({
|
|
50
|
+
index: a + v,
|
|
51
|
+
item: C
|
|
52
|
+
}));
|
|
53
|
+
}
|
|
54
|
+
const Pr = ({
|
|
55
|
+
table: g,
|
|
56
|
+
dense: p
|
|
57
|
+
}) => /* @__PURE__ */ D(
|
|
58
|
+
Hn,
|
|
21
59
|
{
|
|
22
60
|
shape: "circular",
|
|
23
|
-
checked:
|
|
24
|
-
onChange:
|
|
61
|
+
checked: g.getIsAllRowsSelected(),
|
|
62
|
+
onChange: g.getToggleAllRowsSelectedHandler(),
|
|
63
|
+
style: p ? void 0 : { marginTop: "4px" },
|
|
25
64
|
"data-checkbox": "true"
|
|
26
65
|
}
|
|
27
|
-
),
|
|
28
|
-
row:
|
|
29
|
-
toggleMultiple:
|
|
30
|
-
|
|
31
|
-
|
|
66
|
+
), Hr = ({
|
|
67
|
+
row: g,
|
|
68
|
+
toggleMultiple: p,
|
|
69
|
+
dense: y
|
|
70
|
+
}) => /* @__PURE__ */ D(
|
|
71
|
+
Hn,
|
|
32
72
|
{
|
|
33
73
|
shape: "circular",
|
|
34
|
-
checked:
|
|
35
|
-
onChange: (
|
|
36
|
-
|
|
74
|
+
checked: g.getIsSelected(),
|
|
75
|
+
onChange: (a) => {
|
|
76
|
+
a.stopPropagation(), p(g.index);
|
|
37
77
|
},
|
|
38
|
-
onClick: (
|
|
78
|
+
onClick: (a) => a.stopPropagation(),
|
|
79
|
+
style: y ? void 0 : { marginTop: "6px" },
|
|
39
80
|
"data-checkbox": "true"
|
|
40
81
|
}
|
|
41
|
-
),
|
|
82
|
+
), jr = Sr({
|
|
42
83
|
"efw-table": {},
|
|
43
84
|
/* Transición suave para el box-shadow en las celdas y cabeceras fijas */
|
|
44
85
|
"efw-table-scroll-container": {
|
|
@@ -48,7 +89,7 @@ const re = {}, nn = /* @__PURE__ */ new Set(), pt = [], ce = [], x = 120, F = 80
|
|
|
48
89
|
transform: "translateZ(0)"
|
|
49
90
|
},
|
|
50
91
|
"& .table-header": {
|
|
51
|
-
boxShadow: `0px 1px 0 0px ${
|
|
92
|
+
boxShadow: `0px 1px 0 0px ${$.colorNeutralStroke2}`
|
|
52
93
|
},
|
|
53
94
|
"& .header-cell": {
|
|
54
95
|
"&.sticky-column": {
|
|
@@ -65,12 +106,12 @@ const re = {}, nn = /* @__PURE__ */ new Set(), pt = [], ce = [], x = 120, F = 80
|
|
|
65
106
|
"&.is-scrolling-x": {
|
|
66
107
|
"& .header-cell": {
|
|
67
108
|
"&.sticky-column": {
|
|
68
|
-
boxShadow:
|
|
109
|
+
boxShadow: `2px 0 4px -2px ${$.colorNeutralStroke1}`
|
|
69
110
|
}
|
|
70
111
|
},
|
|
71
112
|
"& .table-cell": {
|
|
72
113
|
"&.sticky-column": {
|
|
73
|
-
boxShadow:
|
|
114
|
+
boxShadow: `2px 0 4px -2px ${$.colorNeutralStroke1}`
|
|
74
115
|
}
|
|
75
116
|
}
|
|
76
117
|
},
|
|
@@ -78,698 +119,1048 @@ const re = {}, nn = /* @__PURE__ */ new Set(), pt = [], ce = [], x = 120, F = 80
|
|
|
78
119
|
/* Aplica una sombra debajo de TODAS las cabeceras cuando hay scroll en el eje Y */
|
|
79
120
|
"&.is-scrolling-y": {
|
|
80
121
|
"& .table-header": {
|
|
81
|
-
boxShadow:
|
|
122
|
+
boxShadow: `0 2px 4px -2px ${$.colorNeutralStroke1}`
|
|
82
123
|
}
|
|
83
124
|
}
|
|
84
125
|
}
|
|
85
|
-
})
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
126
|
+
});
|
|
127
|
+
function On(g, p, y, a) {
|
|
128
|
+
let C = 0, v = 0;
|
|
129
|
+
const M = [];
|
|
130
|
+
if (p.forEach((I) => {
|
|
131
|
+
const G = y.find((T) => T.internalName === I.id)?.typeAsString === "Note" ? O * 2 : O, U = a[I.id] || (typeof I.size == "number" ? I.size : G);
|
|
132
|
+
I.id === "select" ? C += U : (v += U, M.push(I));
|
|
133
|
+
}), M.length === 0) return null;
|
|
134
|
+
const z = C + v;
|
|
135
|
+
if (Math.abs(z - g) < 1) return null;
|
|
136
|
+
const k = g - C, q = k / v, ne = { ...a };
|
|
137
|
+
let ce = 0;
|
|
138
|
+
return M.forEach((I, Y) => {
|
|
139
|
+
const G = a[I.id] || (typeof I.size == "number" ? I.size : O), U = I.minSize || he;
|
|
140
|
+
let T;
|
|
141
|
+
Y === M.length - 1 ? T = k - ce : T = Math.round(G * q), T = Math.max(U, T), ne[I.id] = T, ce += T;
|
|
142
|
+
}), ne;
|
|
143
|
+
}
|
|
144
|
+
function Pn(g, p, y, a, C) {
|
|
145
|
+
const v = g - C;
|
|
146
|
+
if (Math.abs(v) < 1) return null;
|
|
147
|
+
const M = p.filter((T) => T.id && T.id !== "select");
|
|
148
|
+
if (M.length === 0) return null;
|
|
149
|
+
const z = M[M.length - 1], k = z.id, ne = y.find((T) => T.internalName === k)?.typeAsString === "Note" ? O * 2 : O, I = (a[k] || (typeof z.size == "number" ? z.size : ne)) + v, Y = z.minSize || he, G = Math.max(Y, I), U = a[k];
|
|
150
|
+
return U !== void 0 && Math.abs(U - G) < 1 ? null : { [k]: G };
|
|
151
|
+
}
|
|
152
|
+
const ls = ({
|
|
153
|
+
appearance: g = "outline",
|
|
154
|
+
style: p = de,
|
|
155
|
+
className: y = "",
|
|
156
|
+
fields: a,
|
|
157
|
+
localeText: C,
|
|
158
|
+
items: v,
|
|
159
|
+
defaultItems: M,
|
|
160
|
+
height: z,
|
|
161
|
+
itemSize: k,
|
|
162
|
+
dense: q = !0,
|
|
163
|
+
rowAnimationConfig: ne = Wr,
|
|
164
|
+
cellLineClamp: ce,
|
|
94
165
|
// tableStyle = 'row',
|
|
95
|
-
enableSelection:
|
|
96
|
-
enableCommandBar:
|
|
97
|
-
defaultSelectedItems:
|
|
98
|
-
onSelectionChange:
|
|
99
|
-
onRowClick:
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
166
|
+
enableSelection: I = !0,
|
|
167
|
+
enableCommandBar: Y = !0,
|
|
168
|
+
defaultSelectedItems: G = _r,
|
|
169
|
+
onSelectionChange: U,
|
|
170
|
+
onRowClick: T,
|
|
171
|
+
onRowDoubleClick: He,
|
|
172
|
+
resizableColumns: je = !1,
|
|
173
|
+
columnConfig: P = de,
|
|
174
|
+
useVirtualization: lt = !1,
|
|
175
|
+
autoSizeColumns: ie = !1,
|
|
176
|
+
tableRef: jn,
|
|
177
|
+
onItemsChange: at,
|
|
178
|
+
onScroll: ut,
|
|
179
|
+
onScrollEnd: dt,
|
|
180
|
+
scrollEndThreshold: ft = Dn,
|
|
181
|
+
loadingMore: pe = !1,
|
|
182
|
+
addButtonConfig: Un = de,
|
|
183
|
+
updateButtonConfig: Vn = de,
|
|
184
|
+
deleteButtonConfig: $n = de,
|
|
185
|
+
filterButtonConfig: qn = de,
|
|
186
|
+
alwaysButtons: mt = Be,
|
|
187
|
+
noSelectionButtons: Yn = Be,
|
|
188
|
+
singleSelectionButtons: ht = Be,
|
|
189
|
+
multiSelectionButtons: pt = Be,
|
|
190
|
+
beforeAddItems: gt,
|
|
191
|
+
beforeUpdateItems: St,
|
|
192
|
+
beforeDeleteItems: wt,
|
|
193
|
+
defaultSorting: Gn,
|
|
194
|
+
onSortChange: Ue,
|
|
195
|
+
onFilterChange: Ve,
|
|
196
|
+
columnRenderers: Kn,
|
|
197
|
+
useDefaultRendererAsFallback: xt = !0,
|
|
119
198
|
// Overlay state props
|
|
120
|
-
overlayState:
|
|
121
|
-
defaultOverlayState:
|
|
122
|
-
onOverlayStateChange:
|
|
123
|
-
overlayCustomization:
|
|
124
|
-
overlayHeight:
|
|
199
|
+
overlayState: It,
|
|
200
|
+
defaultOverlayState: Xn,
|
|
201
|
+
onOverlayStateChange: j,
|
|
202
|
+
overlayCustomization: le,
|
|
203
|
+
overlayHeight: $e = 200
|
|
125
204
|
}) => {
|
|
126
|
-
|
|
205
|
+
const bt = se(() => {
|
|
206
|
+
const {
|
|
207
|
+
form: e,
|
|
208
|
+
fields: t,
|
|
209
|
+
buttons: n,
|
|
210
|
+
...r
|
|
211
|
+
} = C ?? {}, o = Object.keys(r).length > 0 ? r : void 0, c = e || t || n ? {
|
|
212
|
+
...e ? { form: e } : {},
|
|
213
|
+
...t ? { fields: t } : {},
|
|
214
|
+
...n ? { buttons: n } : {}
|
|
215
|
+
} : void 0;
|
|
216
|
+
return {
|
|
217
|
+
tableOverrides: o,
|
|
218
|
+
i18nProviderLocale: c
|
|
219
|
+
};
|
|
220
|
+
}, [C]), W = Mr(bt.tableOverrides), yt = bt.i18nProviderLocale, Rt = Er(Kn);
|
|
221
|
+
lt && z === void 0 && console.warn(
|
|
127
222
|
'[EFWTable] La prop "height" es requerida cuando "useVirtualization" está habilitado. La virtualización necesita una altura fija para calcular las filas visibles.'
|
|
128
223
|
);
|
|
129
|
-
const
|
|
130
|
-
() =>
|
|
131
|
-
),
|
|
224
|
+
const ge = z !== void 0 ? Y ? z - 40 : z : void 0, qe = k ?? (q ? 32 : 44), vt = jr(), Jn = wr(y, "efw-table", vt["efw-table"]), K = w(!1), Se = w(null), we = w(null), Ye = v !== void 0, H = It !== void 0, [Zn, xe] = te(
|
|
225
|
+
() => Xn || { state: "none" }
|
|
226
|
+
), Ne = H ? It : Zn, [Qn, er] = te(() => (M || Wn).map((t) => ({
|
|
132
227
|
...t,
|
|
133
|
-
_rowId: t._rowId ||
|
|
134
|
-
}))),
|
|
228
|
+
_rowId: t._rowId || it()
|
|
229
|
+
}))), X = Ye ? v || Wn : Qn, Ct = w(/* @__PURE__ */ new WeakMap()), ke = f((e, t) => {
|
|
230
|
+
if (e._rowId)
|
|
231
|
+
return String(e._rowId);
|
|
232
|
+
const n = Ct.current.get(e);
|
|
233
|
+
if (n)
|
|
234
|
+
return n;
|
|
235
|
+
const r = it();
|
|
236
|
+
return Ct.current.set(e, r), r;
|
|
237
|
+
}, []), [L, Ie] = te(() => {
|
|
135
238
|
const e = {};
|
|
136
|
-
return
|
|
137
|
-
const n =
|
|
239
|
+
return a.forEach((t) => {
|
|
240
|
+
const n = P[t.internalName];
|
|
138
241
|
if (n?.width) {
|
|
139
|
-
const
|
|
140
|
-
e[t.internalName] = Math.min(Math.max(n.width ?? 0,
|
|
242
|
+
const r = n.minWidth ?? he, o = n.maxWidth ?? Pe;
|
|
243
|
+
e[t.internalName] = Math.min(Math.max(n.width ?? 0, r), o);
|
|
141
244
|
}
|
|
142
245
|
}), e;
|
|
143
|
-
}),
|
|
144
|
-
|
|
145
|
-
|
|
246
|
+
}), Tt = w(P), [J, Ge] = te(() => Bn(Gn ?? [])), [Z, Ke] = te([]), Et = w(Z);
|
|
247
|
+
Et.current = Z;
|
|
248
|
+
const [Q, zt] = te(0), [tr, nr] = te({}), Xe = w(ne);
|
|
249
|
+
Xe.current = ne;
|
|
250
|
+
const {
|
|
251
|
+
rowSelection: ae,
|
|
252
|
+
setRowSelection: Ft,
|
|
146
253
|
// selectedIndexes,
|
|
147
|
-
deselectAll:
|
|
148
|
-
selectSingle:
|
|
149
|
-
toggleMultiple:
|
|
254
|
+
deselectAll: Mt,
|
|
255
|
+
selectSingle: At,
|
|
256
|
+
toggleMultiple: Nt,
|
|
150
257
|
// selectMultiple,
|
|
151
|
-
getSelectedItems:
|
|
152
|
-
getSelectedRows:
|
|
153
|
-
} =
|
|
154
|
-
initialSelection:
|
|
155
|
-
onSelectionChange:
|
|
156
|
-
enableSelection:
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
},
|
|
160
|
-
|
|
161
|
-
|
|
258
|
+
getSelectedItems: kt,
|
|
259
|
+
getSelectedRows: Lt
|
|
260
|
+
} = br({
|
|
261
|
+
initialSelection: G,
|
|
262
|
+
onSelectionChange: U,
|
|
263
|
+
enableSelection: I,
|
|
264
|
+
items: X,
|
|
265
|
+
getRowId: ke
|
|
266
|
+
}), re = w(null), ue = w(null), [Je, rr] = te(null), sr = f((e) => {
|
|
267
|
+
re.current = e, rr(e);
|
|
268
|
+
}, []), ee = f(() => {
|
|
269
|
+
if (Qe.current && !be.current) {
|
|
270
|
+
ue.current = null;
|
|
271
|
+
return;
|
|
272
|
+
}
|
|
273
|
+
const e = re.current;
|
|
274
|
+
if (!e) {
|
|
275
|
+
ue.current = null;
|
|
276
|
+
return;
|
|
277
|
+
}
|
|
278
|
+
ue.current = {
|
|
279
|
+
top: e.scrollTop,
|
|
280
|
+
left: e.scrollLeft
|
|
281
|
+
};
|
|
282
|
+
}, []), Ze = f((e, t) => {
|
|
283
|
+
e.scrollTop !== t.top && (e.scrollTop = t.top), e.scrollLeft !== t.left && (e.scrollLeft = t.left);
|
|
284
|
+
}, []), A = f((e, t, n) => {
|
|
285
|
+
!(n?.animateRows ?? (t === "add" ? Xe.current.addRows : Xe.current.updateRows)) || e.length === 0 || nr((o) => {
|
|
286
|
+
const c = { ...o };
|
|
287
|
+
return e.forEach(({ item: u }, s) => {
|
|
288
|
+
if (!u._rowId)
|
|
289
|
+
return;
|
|
290
|
+
const i = String(u._rowId);
|
|
291
|
+
c[i] = {
|
|
292
|
+
delay: s * Dr,
|
|
293
|
+
token: (c[i]?.token ?? 0) + 1
|
|
294
|
+
};
|
|
295
|
+
}), c;
|
|
296
|
+
});
|
|
297
|
+
}, []), R = w(X), Le = w(/* @__PURE__ */ new Map()), Qe = w(Ye);
|
|
298
|
+
Qe.current = Ye;
|
|
299
|
+
const be = w(at);
|
|
300
|
+
be.current = at;
|
|
301
|
+
const ye = w(gt);
|
|
302
|
+
ye.current = gt;
|
|
303
|
+
const Re = w(St);
|
|
304
|
+
Re.current = St;
|
|
305
|
+
const ve = w(wt);
|
|
306
|
+
ve.current = wt;
|
|
307
|
+
const _ = w(null), _t = w(pe);
|
|
308
|
+
_t.current = pe;
|
|
309
|
+
const Wt = w(ut);
|
|
310
|
+
Wt.current = ut;
|
|
311
|
+
const et = w(dt);
|
|
312
|
+
et.current = dt;
|
|
313
|
+
const tt = w(ft);
|
|
314
|
+
tt.current = ft, oe(() => {
|
|
315
|
+
R.current = X;
|
|
162
316
|
const e = /* @__PURE__ */ new Map();
|
|
163
|
-
|
|
317
|
+
X.forEach((t, n) => {
|
|
164
318
|
t._rowId && e.set(String(t._rowId), n);
|
|
165
|
-
}),
|
|
166
|
-
}, [
|
|
167
|
-
|
|
319
|
+
}), Le.current = e;
|
|
320
|
+
}, [X]), kn(() => {
|
|
321
|
+
const e = ue.current;
|
|
322
|
+
if (!e)
|
|
323
|
+
return;
|
|
324
|
+
ue.current = null;
|
|
325
|
+
const t = re.current;
|
|
326
|
+
if (!t)
|
|
327
|
+
return;
|
|
328
|
+
Ze(t, e);
|
|
329
|
+
const n = requestAnimationFrame(() => {
|
|
330
|
+
const r = re.current;
|
|
331
|
+
r && Ze(r, e);
|
|
332
|
+
});
|
|
333
|
+
return () => {
|
|
334
|
+
cancelAnimationFrame(n);
|
|
335
|
+
};
|
|
336
|
+
}, [X, Ze]);
|
|
337
|
+
const nt = w(/* @__PURE__ */ new Set()), Ce = w(!1), Bt = w(0), Dt = w(0), Ot = w(!1);
|
|
338
|
+
oe(() => {
|
|
339
|
+
pe || (re.current?.scrollHeight ?? 0) > Dt.current && (Ce.current = !1);
|
|
340
|
+
}, [pe]);
|
|
341
|
+
const Pt = se(() => {
|
|
168
342
|
const e = [], t = {};
|
|
169
343
|
let n = 0;
|
|
170
|
-
return
|
|
171
|
-
const
|
|
172
|
-
if (!
|
|
173
|
-
e.push(
|
|
174
|
-
const c =
|
|
344
|
+
return I && (e.push("select"), t.select = n, n += Ae), a.forEach((r) => {
|
|
345
|
+
const o = P[r.internalName] || {};
|
|
346
|
+
if (!o.hidden && o.sticky) {
|
|
347
|
+
e.push(r.internalName), t[r.internalName] = n;
|
|
348
|
+
const c = L[r.internalName] || o.width || O;
|
|
175
349
|
n += c;
|
|
176
350
|
}
|
|
177
351
|
}), { stickyColumns: e, stickyPositions: t };
|
|
178
|
-
}, [
|
|
352
|
+
}, [a, I, P, L]), B = se(() => {
|
|
179
353
|
const e = [];
|
|
180
|
-
return
|
|
354
|
+
return I && e.push({
|
|
181
355
|
id: "select",
|
|
182
|
-
header: ({ table: t }) => /* @__PURE__ */
|
|
183
|
-
cell: ({ row: t }) => /* @__PURE__ */
|
|
184
|
-
size:
|
|
185
|
-
minSize:
|
|
186
|
-
maxSize:
|
|
356
|
+
header: ({ table: t }) => /* @__PURE__ */ D(Pr, { table: t, dense: q }),
|
|
357
|
+
cell: ({ row: t }) => /* @__PURE__ */ D(Hr, { row: t, toggleMultiple: Nt, dense: q }),
|
|
358
|
+
size: Ae,
|
|
359
|
+
minSize: Ae,
|
|
360
|
+
maxSize: Ae,
|
|
187
361
|
enableResizing: !1
|
|
188
|
-
}),
|
|
189
|
-
const n =
|
|
362
|
+
}), a.forEach((t) => {
|
|
363
|
+
const n = P[t.internalName] || {};
|
|
190
364
|
if (n.hidden)
|
|
191
365
|
return;
|
|
192
|
-
const
|
|
366
|
+
const r = t.typeAsString === "Note" ? O * 2 : O, o = n.width || r, c = n.minWidth || he, u = n.maxWidth || Pe;
|
|
193
367
|
e.push({
|
|
194
368
|
id: t.internalName,
|
|
195
369
|
accessorKey: t.internalName,
|
|
196
370
|
header: t.title || t.internalName,
|
|
197
|
-
cell: ({ row:
|
|
371
|
+
cell: ({ row: s }) => yr(
|
|
198
372
|
t,
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
373
|
+
s.original[t.internalName],
|
|
374
|
+
s.original,
|
|
375
|
+
s.index,
|
|
376
|
+
Rt,
|
|
377
|
+
xt
|
|
204
378
|
),
|
|
205
|
-
size: Math.min(Math.max(
|
|
379
|
+
size: Math.min(Math.max(o, c), u),
|
|
206
380
|
minSize: c,
|
|
207
|
-
maxSize:
|
|
208
|
-
enableResizing:
|
|
381
|
+
maxSize: u,
|
|
382
|
+
enableResizing: je,
|
|
383
|
+
enableSorting: n.sortable !== !1,
|
|
384
|
+
sortingFn: Or(t.typeAsString),
|
|
385
|
+
filterFn: zr(t.typeAsString),
|
|
386
|
+
meta: {
|
|
387
|
+
typeAsString: t.typeAsString,
|
|
388
|
+
cellLineClamp: n.cellLineClamp ?? ce
|
|
389
|
+
}
|
|
209
390
|
});
|
|
210
391
|
}), e;
|
|
211
392
|
}, [
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
393
|
+
a,
|
|
394
|
+
I,
|
|
395
|
+
je,
|
|
396
|
+
P,
|
|
397
|
+
ce,
|
|
398
|
+
Rt,
|
|
399
|
+
xt,
|
|
400
|
+
Nt
|
|
219
401
|
]);
|
|
220
|
-
|
|
221
|
-
const e =
|
|
222
|
-
|
|
402
|
+
oe(() => {
|
|
403
|
+
const e = Tt.current;
|
|
404
|
+
Ie((t) => {
|
|
223
405
|
let n = !1;
|
|
224
|
-
const
|
|
225
|
-
return Object.keys(
|
|
226
|
-
|
|
227
|
-
}),
|
|
228
|
-
const
|
|
229
|
-
if (
|
|
230
|
-
const
|
|
231
|
-
|
|
232
|
-
} else
|
|
233
|
-
}), n ?
|
|
234
|
-
}),
|
|
235
|
-
}, [
|
|
236
|
-
const
|
|
237
|
-
const
|
|
238
|
-
return e +
|
|
239
|
-
}, 0), [
|
|
240
|
-
|
|
241
|
-
|
|
406
|
+
const r = { ...t }, o = new Set(a.map((c) => c.internalName));
|
|
407
|
+
return Object.keys(r).forEach((c) => {
|
|
408
|
+
o.has(c) || (delete r[c], n = !0);
|
|
409
|
+
}), a.forEach((c) => {
|
|
410
|
+
const u = c.internalName, s = P[u], i = e[u];
|
|
411
|
+
if (s?.width !== void 0) {
|
|
412
|
+
const S = s.minWidth ?? he, x = s.maxWidth ?? Pe, l = Math.min(Math.max(s.width, S), x);
|
|
413
|
+
r[u] !== l && (r[u] = l, n = !0);
|
|
414
|
+
} else i?.width !== void 0 && r[u] !== void 0 && (delete r[u], n = !0);
|
|
415
|
+
}), n ? r : t;
|
|
416
|
+
}), Tt.current = P;
|
|
417
|
+
}, [P, a]);
|
|
418
|
+
const Te = se(() => B.reduce((e, t) => {
|
|
419
|
+
const r = a.find((c) => c.internalName === t.id)?.typeAsString === "Note" ? O * 2 : O, o = L[t.id] || (typeof t.size == "number" ? t.size : r);
|
|
420
|
+
return e + o;
|
|
421
|
+
}, 0), [B, L, a]), or = se(
|
|
422
|
+
() => Math.max(Te, Q || 0, 300),
|
|
423
|
+
[Te, Q]
|
|
424
|
+
), Ee = w(Ue);
|
|
425
|
+
Ee.current = Ue;
|
|
426
|
+
const ze = w(Ve);
|
|
427
|
+
ze.current = Ve;
|
|
428
|
+
const rt = mr({
|
|
429
|
+
data: X,
|
|
430
|
+
columns: B,
|
|
242
431
|
state: {
|
|
243
|
-
rowSelection:
|
|
244
|
-
columnSizing:
|
|
432
|
+
rowSelection: ae,
|
|
433
|
+
columnSizing: L,
|
|
434
|
+
sorting: J,
|
|
435
|
+
columnFilters: Z
|
|
436
|
+
},
|
|
437
|
+
onRowSelectionChange: Ft,
|
|
438
|
+
onSortingChange: (e) => {
|
|
439
|
+
const t = typeof e == "function" ? e(J) : e;
|
|
440
|
+
Ge(t), Ee.current && Ee.current(Me(t), _.current);
|
|
441
|
+
},
|
|
442
|
+
onColumnFiltersChange: (e) => {
|
|
443
|
+
const t = typeof e == "function" ? e(Et.current) : e;
|
|
444
|
+
Ke(t), ze.current && ze.current(Oe(t), _.current);
|
|
245
445
|
},
|
|
246
|
-
onRowSelectionChange: Ne,
|
|
247
446
|
onColumnSizingChange: (e) => {
|
|
248
|
-
|
|
249
|
-
const n = typeof e == "function" ? e(t) : e,
|
|
250
|
-
return Object.keys(n).forEach((
|
|
251
|
-
const c =
|
|
447
|
+
Ie((t) => {
|
|
448
|
+
const n = typeof e == "function" ? e(t) : e, r = {};
|
|
449
|
+
return Object.keys(n).forEach((o) => {
|
|
450
|
+
const c = B.find((u) => u.id === o);
|
|
252
451
|
if (c) {
|
|
253
|
-
const
|
|
254
|
-
|
|
452
|
+
const u = c.minSize || he, s = c.maxSize || Pe;
|
|
453
|
+
K.current ? r[o] = Math.max(n[o], u) : r[o] = Math.min(Math.max(n[o], u), s);
|
|
255
454
|
}
|
|
256
|
-
}), { ...t, ...
|
|
455
|
+
}), { ...t, ...r };
|
|
257
456
|
});
|
|
258
457
|
},
|
|
259
|
-
|
|
260
|
-
getCoreRowModel:
|
|
261
|
-
getFilteredRowModel:
|
|
262
|
-
getSortedRowModel:
|
|
458
|
+
getRowId: (e, t) => ke(e, t),
|
|
459
|
+
getCoreRowModel: gr(),
|
|
460
|
+
getFilteredRowModel: pr(),
|
|
461
|
+
getSortedRowModel: hr(),
|
|
462
|
+
manualSorting: !!Ue,
|
|
463
|
+
manualFiltering: !!Ve,
|
|
263
464
|
columnResizeMode: "onChange",
|
|
264
465
|
enableRowSelection: !0,
|
|
265
|
-
enableMultiRowSelection:
|
|
466
|
+
enableMultiRowSelection: I
|
|
266
467
|
});
|
|
267
|
-
|
|
468
|
+
oe(() => {
|
|
268
469
|
const e = /* @__PURE__ */ new Set();
|
|
269
|
-
Object.keys(
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
470
|
+
Object.keys(ae).forEach((t) => {
|
|
471
|
+
ae[t] && e.add(t);
|
|
472
|
+
}), nt.current = e;
|
|
473
|
+
}, [ae]);
|
|
474
|
+
const cr = f((e) => {
|
|
475
|
+
if (Wt.current?.(e), !et.current || _t.current)
|
|
476
|
+
return;
|
|
477
|
+
const t = e.currentTarget, n = Number.isFinite(tt.current) ? Math.max(0, tt.current) : Dn, { scrollTop: r, scrollHeight: o, clientHeight: c } = t, s = o - r - c <= n, i = Bt.current;
|
|
478
|
+
if (Bt.current = o, o > i && !s) {
|
|
479
|
+
Ce.current = !1;
|
|
480
|
+
return;
|
|
481
|
+
}
|
|
482
|
+
if (!s) {
|
|
483
|
+
Ce.current = !1;
|
|
484
|
+
return;
|
|
485
|
+
}
|
|
486
|
+
Ce.current || (Ce.current = !0, Dt.current = o, et.current());
|
|
487
|
+
}, []), Ht = (e) => {
|
|
488
|
+
const t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), o = new Set(
|
|
489
|
+
Object.keys(ae).filter((s) => ae[s])
|
|
490
|
+
), c = e.map(
|
|
491
|
+
(s, i) => s ? ke(s, i) : ""
|
|
492
|
+
), u = new Set(c.filter(Boolean));
|
|
493
|
+
return e.forEach((s, i) => {
|
|
494
|
+
if (!s)
|
|
282
495
|
return;
|
|
283
|
-
const c =
|
|
284
|
-
|
|
496
|
+
const S = c[i], x = o.has(S), l = i.toString(), m = !u.has(l) && o.has(l);
|
|
497
|
+
!x && !m || (r.add(i), t.add(S), n.add(s));
|
|
285
498
|
}), {
|
|
286
|
-
hasSelection: t.size > 0 || n.size > 0 ||
|
|
499
|
+
hasSelection: t.size > 0 || n.size > 0 || r.size > 0,
|
|
287
500
|
selectedIds: t,
|
|
288
501
|
selectedRefs: n,
|
|
289
|
-
selectedIndexes:
|
|
502
|
+
selectedIndexes: r,
|
|
290
503
|
sourceLength: e.length
|
|
291
504
|
};
|
|
292
|
-
},
|
|
505
|
+
}, jt = (e, t) => {
|
|
293
506
|
if (!t.hasSelection)
|
|
294
507
|
return;
|
|
295
|
-
const n = t.sourceLength !== e.length,
|
|
296
|
-
e.forEach((
|
|
297
|
-
if (!
|
|
508
|
+
const n = t.sourceLength !== e.length, r = {};
|
|
509
|
+
e.forEach((o, c) => {
|
|
510
|
+
if (!o)
|
|
298
511
|
return;
|
|
299
|
-
const
|
|
300
|
-
(
|
|
301
|
-
}),
|
|
302
|
-
},
|
|
303
|
-
if (
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
const
|
|
307
|
-
|
|
308
|
-
|
|
512
|
+
const u = ke(o, c), s = t.selectedIds.has(u), i = t.selectedRefs.has(o), S = !n && t.selectedIndexes.has(c);
|
|
513
|
+
(s || i || S) && (r[u] = !0);
|
|
514
|
+
}), Ft(r);
|
|
515
|
+
}, b = f((e) => {
|
|
516
|
+
if (Qe.current) {
|
|
517
|
+
if (!be.current)
|
|
518
|
+
return ue.current = null, Ot.current || (console.warn("[EFWTable] Modo controlled detectado sin onItemsChange. Las operaciones CRUD locales no se aplicarán."), Ot.current = !0), !1;
|
|
519
|
+
const t = R.current, n = typeof e == "function" ? e(t) : e;
|
|
520
|
+
R.current = n;
|
|
521
|
+
const r = Ht(t);
|
|
522
|
+
return nt.current = r.selectedIds, jt(n, r), be.current(n), !0;
|
|
309
523
|
}
|
|
310
|
-
|
|
524
|
+
return er((t) => {
|
|
311
525
|
const n = typeof e == "function" ? e(t) : e;
|
|
312
|
-
|
|
313
|
-
const
|
|
314
|
-
return
|
|
315
|
-
});
|
|
316
|
-
},
|
|
526
|
+
R.current = n;
|
|
527
|
+
const r = Ht(t);
|
|
528
|
+
return nt.current = r.selectedIds, jt(n, r), be.current?.(n), n;
|
|
529
|
+
}), !0;
|
|
530
|
+
}, []), Ut = f(() => a, [a]), Vt = f(() => Me(J), [J]), $t = f(() => Me(J)[0] ?? null, [J]), qt = f(() => J.length > 0, [J]), Yt = f((e) => {
|
|
531
|
+
const t = Bn(e);
|
|
532
|
+
Ge(t), Ee.current?.(Me(t), _.current);
|
|
533
|
+
}, []), Gt = f(() => {
|
|
534
|
+
const e = [];
|
|
535
|
+
Ge(e), Ee.current?.(Me(e), _.current);
|
|
536
|
+
}, []), Kt = f(() => a.filter(
|
|
537
|
+
(e) => e.typeAsString !== "Attachments" && P?.[e.internalName]?.filterable !== !1
|
|
538
|
+
), [a, P]), Xt = f(() => Oe(Z), [Z]), Jt = f(() => Z.length > 0, [Z]), Zt = f((e) => {
|
|
539
|
+
const t = Br(e);
|
|
540
|
+
Ke(t), ze.current?.(Oe(t), _.current);
|
|
541
|
+
}, []), Qt = f(() => {
|
|
542
|
+
const e = [];
|
|
543
|
+
Ke(e), ze.current?.(Oe(e), _.current);
|
|
544
|
+
}, []), en = f(async (e, t = {}) => {
|
|
545
|
+
const { position: n = "end" } = t;
|
|
317
546
|
try {
|
|
318
|
-
if (
|
|
319
|
-
const
|
|
320
|
-
if (
|
|
321
|
-
if (
|
|
322
|
-
const
|
|
323
|
-
(
|
|
547
|
+
if (ye.current) {
|
|
548
|
+
const r = We(e), o = await ye.current([r], _.current);
|
|
549
|
+
if (o) {
|
|
550
|
+
if (o.successful.length > 0) {
|
|
551
|
+
const i = R.current.length, S = o.successful.map(
|
|
552
|
+
(m) => Ln(m.item)
|
|
324
553
|
);
|
|
325
|
-
|
|
554
|
+
if (ee(), !b((m) => fe(m, S, n)))
|
|
555
|
+
return { successful: [], failed: S.map((m, h) => ({ index: h, item: m, error: "Controlled mode without onItemsChange" })) };
|
|
556
|
+
const l = me(S, i, n);
|
|
557
|
+
return A(l, "add", t), {
|
|
558
|
+
...o,
|
|
559
|
+
successful: l
|
|
560
|
+
};
|
|
326
561
|
}
|
|
327
|
-
return
|
|
562
|
+
return { ...o, successful: [] };
|
|
328
563
|
}
|
|
329
|
-
|
|
330
|
-
|
|
564
|
+
const c = R.current.length;
|
|
565
|
+
if (ee(), !b((i) => fe(i, [r], n)))
|
|
566
|
+
return { successful: [], failed: [{ index: -1, item: r, error: "Controlled mode without onItemsChange" }] };
|
|
567
|
+
const s = me([r], c, n);
|
|
568
|
+
return A(s, "add", t), {
|
|
569
|
+
successful: s,
|
|
331
570
|
failed: []
|
|
332
571
|
};
|
|
333
572
|
} else {
|
|
334
|
-
const
|
|
335
|
-
|
|
336
|
-
successful: [{ index:
|
|
573
|
+
const r = We(e), o = R.current.length;
|
|
574
|
+
if (ee(), !b((s) => fe(s, [r], n)))
|
|
575
|
+
return { successful: [], failed: [{ index: -1, item: r, error: "Controlled mode without onItemsChange" }] };
|
|
576
|
+
const u = me([r], o, n);
|
|
577
|
+
return A(u, "add", t), {
|
|
578
|
+
successful: u,
|
|
337
579
|
failed: []
|
|
338
580
|
};
|
|
339
581
|
}
|
|
340
|
-
} catch (
|
|
582
|
+
} catch (r) {
|
|
341
583
|
return {
|
|
342
584
|
successful: [],
|
|
343
|
-
failed: [{ index: -1, item: e, error: String(
|
|
585
|
+
failed: [{ index: -1, item: e, error: String(r) }]
|
|
344
586
|
};
|
|
345
587
|
}
|
|
346
|
-
},
|
|
588
|
+
}, [b, ee, A]), tn = f(async (e, t = {}) => {
|
|
589
|
+
const { position: n = "end" } = t;
|
|
347
590
|
if (e.length === 0)
|
|
348
591
|
return {
|
|
349
592
|
successful: [],
|
|
350
593
|
failed: []
|
|
351
594
|
};
|
|
352
595
|
try {
|
|
353
|
-
if (
|
|
354
|
-
const
|
|
355
|
-
if (
|
|
356
|
-
if (
|
|
357
|
-
const
|
|
358
|
-
(
|
|
596
|
+
if (ye.current) {
|
|
597
|
+
const r = e.map((i) => We(i)), o = await ye.current(r, _.current);
|
|
598
|
+
if (o) {
|
|
599
|
+
if (o.successful.length > 0) {
|
|
600
|
+
const i = R.current.length, S = o.successful.map(
|
|
601
|
+
(m) => Ln(m.item)
|
|
359
602
|
);
|
|
360
|
-
|
|
603
|
+
if (ee(), !b((m) => fe(m, S, n)))
|
|
604
|
+
return { successful: [], failed: S.map((m, h) => ({ index: h, item: m, error: "Controlled mode without onItemsChange" })) };
|
|
605
|
+
const l = me(S, i, n);
|
|
606
|
+
return A(l, "add", t), {
|
|
607
|
+
...o,
|
|
608
|
+
successful: l
|
|
609
|
+
};
|
|
361
610
|
}
|
|
362
|
-
return
|
|
611
|
+
return { ...o, successful: [] };
|
|
363
612
|
}
|
|
364
|
-
|
|
365
|
-
|
|
613
|
+
const c = R.current.length;
|
|
614
|
+
if (ee(), !b((i) => fe(i, r, n)))
|
|
615
|
+
return { successful: [], failed: r.map((i, S) => ({ index: S, item: i, error: "Controlled mode without onItemsChange" })) };
|
|
616
|
+
const s = me(r, c, n);
|
|
617
|
+
return A(s, "add", t), {
|
|
618
|
+
successful: s,
|
|
366
619
|
failed: []
|
|
367
620
|
};
|
|
368
621
|
} else {
|
|
369
|
-
const
|
|
370
|
-
|
|
371
|
-
successful:
|
|
622
|
+
const r = e.map((s) => We(s)), o = R.current.length;
|
|
623
|
+
if (ee(), !b((s) => fe(s, r, n)))
|
|
624
|
+
return { successful: [], failed: r.map((s, i) => ({ index: i, item: s, error: "Controlled mode without onItemsChange" })) };
|
|
625
|
+
const u = me(r, o, n);
|
|
626
|
+
return A(u, "add", t), {
|
|
627
|
+
successful: u,
|
|
372
628
|
failed: []
|
|
373
629
|
};
|
|
374
630
|
}
|
|
375
|
-
} catch (
|
|
631
|
+
} catch (r) {
|
|
376
632
|
return {
|
|
377
633
|
successful: [],
|
|
378
|
-
failed: e.map((
|
|
379
|
-
index:
|
|
380
|
-
item:
|
|
381
|
-
error: String(
|
|
634
|
+
failed: e.map((o, c) => ({
|
|
635
|
+
index: c,
|
|
636
|
+
item: o,
|
|
637
|
+
error: String(r)
|
|
382
638
|
}))
|
|
383
639
|
};
|
|
384
640
|
}
|
|
385
|
-
},
|
|
386
|
-
const
|
|
387
|
-
if (e < 0 || e >=
|
|
641
|
+
}, [b, ee, A]), nn = f(async (e, t, n = {}) => {
|
|
642
|
+
const r = R.current;
|
|
643
|
+
if (e < 0 || e >= r.length)
|
|
388
644
|
return {
|
|
389
645
|
successful: [],
|
|
390
646
|
failed: [{ index: e, item: t, error: "Invalid index" }]
|
|
391
647
|
};
|
|
392
648
|
try {
|
|
393
|
-
if (
|
|
394
|
-
const
|
|
395
|
-
if (
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
649
|
+
if (Re.current) {
|
|
650
|
+
const s = await Re.current([{ index: e, item: t }], _.current);
|
|
651
|
+
if (s) {
|
|
652
|
+
const S = s.successful.filter(
|
|
653
|
+
({ index: h }) => h >= 0 && h < r.length
|
|
654
|
+
).map(({ index: h, item: E }) => {
|
|
655
|
+
const V = sn(
|
|
656
|
+
r,
|
|
657
|
+
h,
|
|
658
|
+
E,
|
|
659
|
+
h === e ? t : void 0
|
|
660
|
+
);
|
|
661
|
+
return V ? { index: h, item: V } : null;
|
|
662
|
+
}).filter((h) => h !== null);
|
|
663
|
+
if (S.length) {
|
|
664
|
+
if (!b((E) => {
|
|
665
|
+
const V = [...E];
|
|
666
|
+
return S.forEach(({ index: d, item: N }) => {
|
|
667
|
+
V[d] = N;
|
|
668
|
+
}), V;
|
|
669
|
+
}))
|
|
670
|
+
return { successful: [], failed: S.map(({ index: E, item: V }) => ({ index: E, item: V, error: "Controlled mode without onItemsChange" })) };
|
|
671
|
+
A(S, "update", n);
|
|
672
|
+
}
|
|
673
|
+
const x = new Set(s.failed.map((h) => h.index)), l = [...s.failed];
|
|
674
|
+
return s.successful.filter(({ index: h }) => h < 0 || h >= r.length).map(({ index: h, item: E }) => ({
|
|
675
|
+
index: h,
|
|
676
|
+
item: E,
|
|
677
|
+
error: "Invalid index"
|
|
678
|
+
})).forEach((h) => {
|
|
679
|
+
x.has(h.index) || l.push(h);
|
|
680
|
+
}), { successful: S, failed: l };
|
|
681
|
+
}
|
|
400
682
|
}
|
|
401
|
-
let
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
const
|
|
405
|
-
return
|
|
406
|
-
})
|
|
407
|
-
|
|
683
|
+
let o;
|
|
684
|
+
if (!b((s) => {
|
|
685
|
+
o = { ...s[e], ...t };
|
|
686
|
+
const i = [...s];
|
|
687
|
+
return i[e] = o, i;
|
|
688
|
+
}))
|
|
689
|
+
return { successful: [], failed: [{ index: e, item: t, error: "Controlled mode without onItemsChange" }] };
|
|
690
|
+
const u = [{ index: e, item: o }];
|
|
691
|
+
return A(u, "update", n), { successful: u, failed: [] };
|
|
692
|
+
} catch (o) {
|
|
408
693
|
return {
|
|
409
694
|
successful: [],
|
|
410
|
-
failed: [{ index: e, item: t, error: String(
|
|
695
|
+
failed: [{ index: e, item: t, error: String(o) }]
|
|
411
696
|
};
|
|
412
697
|
}
|
|
413
|
-
},
|
|
698
|
+
}, [b, A]), rn = f(async (e, t = {}) => {
|
|
414
699
|
if (!e.length) return { successful: [], failed: [] };
|
|
415
|
-
const
|
|
700
|
+
const n = R.current, r = (s) => s >= 0 && s < n.length, o = e.filter(({ index: s }) => !r(s)).map(({ index: s, item: i }) => ({ index: s, item: i, error: "Invalid index" })), c = e.filter(({ index: s }) => r(s)), u = /* @__PURE__ */ new Map();
|
|
701
|
+
c.forEach(({ index: s, item: i }) => {
|
|
702
|
+
u.set(s, i);
|
|
703
|
+
});
|
|
416
704
|
try {
|
|
417
|
-
if (
|
|
418
|
-
const
|
|
419
|
-
if (
|
|
420
|
-
const
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
})
|
|
429
|
-
|
|
430
|
-
|
|
705
|
+
if (Re.current) {
|
|
706
|
+
const x = await Re.current(e, _.current);
|
|
707
|
+
if (x) {
|
|
708
|
+
const m = x.successful.filter(({ index: d }) => r(d)).map(({ index: d, item: N }) => {
|
|
709
|
+
const F = sn(
|
|
710
|
+
n,
|
|
711
|
+
d,
|
|
712
|
+
N,
|
|
713
|
+
u.get(d)
|
|
714
|
+
);
|
|
715
|
+
return F ? { index: d, item: F } : null;
|
|
716
|
+
}).filter((d) => d !== null);
|
|
717
|
+
if (m.length) {
|
|
718
|
+
if (!b((N) => {
|
|
719
|
+
const F = [...N];
|
|
720
|
+
return m.forEach(({ index: Nn, item: ot }) => {
|
|
721
|
+
F[Nn] = ot;
|
|
722
|
+
}), F;
|
|
723
|
+
}))
|
|
724
|
+
return { successful: [], failed: m.map(({ index: N, item: F }) => ({ index: N, item: F, error: "Controlled mode without onItemsChange" })) };
|
|
725
|
+
A(m, "update", t);
|
|
726
|
+
}
|
|
727
|
+
const h = new Set(x.failed.map((d) => d.index)), E = [...x.failed];
|
|
728
|
+
return o.forEach((d) => {
|
|
729
|
+
h.has(d.index) || E.push(d);
|
|
730
|
+
}), x.successful.filter(({ index: d }) => !r(d)).map(({ index: d, item: N }) => ({ index: d, item: N, error: "Invalid index" })).forEach((d) => {
|
|
731
|
+
h.has(d.index) || E.push(d);
|
|
732
|
+
}), { successful: m, failed: E };
|
|
431
733
|
}
|
|
432
734
|
}
|
|
433
|
-
const
|
|
434
|
-
return
|
|
435
|
-
const
|
|
436
|
-
return
|
|
437
|
-
|
|
438
|
-
}),
|
|
439
|
-
}), { successful:
|
|
440
|
-
} catch (
|
|
735
|
+
const s = [], i = [...o];
|
|
736
|
+
return b((x) => {
|
|
737
|
+
const l = [...x];
|
|
738
|
+
return c.forEach(({ index: m, item: h }) => {
|
|
739
|
+
l[m] = { ...l[m], ...h }, s.push({ index: m, item: l[m] });
|
|
740
|
+
}), l;
|
|
741
|
+
}) ? (A(s, "update", t), { successful: s, failed: i }) : { successful: [], failed: c.map(({ index: x, item: l }) => ({ index: x, item: l, error: "Controlled mode without onItemsChange" })) };
|
|
742
|
+
} catch (s) {
|
|
441
743
|
return {
|
|
442
744
|
successful: [],
|
|
443
|
-
failed: e.map(({ index:
|
|
444
|
-
index:
|
|
445
|
-
item:
|
|
446
|
-
error: String(
|
|
745
|
+
failed: e.map(({ index: i, item: S }) => ({
|
|
746
|
+
index: i,
|
|
747
|
+
item: S,
|
|
748
|
+
error: String(s)
|
|
447
749
|
}))
|
|
448
750
|
};
|
|
449
751
|
}
|
|
450
|
-
},
|
|
451
|
-
const
|
|
752
|
+
}, [b, A]), sn = (e, t, n, r) => {
|
|
753
|
+
const o = e[t];
|
|
754
|
+
if (!o)
|
|
755
|
+
return null;
|
|
756
|
+
const c = n ?? r;
|
|
757
|
+
return c ? {
|
|
758
|
+
...o,
|
|
759
|
+
...c,
|
|
760
|
+
_rowId: c._rowId ?? o._rowId
|
|
761
|
+
} : o;
|
|
762
|
+
}, on = (e, t, n) => {
|
|
763
|
+
const r = e[t];
|
|
764
|
+
return r ? n ? {
|
|
765
|
+
...r,
|
|
766
|
+
...n,
|
|
767
|
+
_rowId: n._rowId ?? r._rowId
|
|
768
|
+
} : r : null;
|
|
769
|
+
}, cn = f(async (e) => {
|
|
770
|
+
const t = R.current;
|
|
452
771
|
if (e < 0 || e >= t.length)
|
|
453
772
|
return {
|
|
454
773
|
successful: [],
|
|
455
774
|
failed: [{ index: e, error: "Invalid index" }]
|
|
456
775
|
};
|
|
457
776
|
try {
|
|
458
|
-
if (
|
|
459
|
-
const
|
|
460
|
-
if (
|
|
461
|
-
|
|
777
|
+
if (ve.current) {
|
|
778
|
+
const o = t[e], c = await ve.current([{ index: e, item: o }], _.current);
|
|
779
|
+
if (c) {
|
|
780
|
+
const s = c.successful.filter(
|
|
781
|
+
({ index: l }) => l >= 0 && l < t.length
|
|
782
|
+
).map(({ index: l, item: m }) => {
|
|
783
|
+
const h = on(t, l, m);
|
|
784
|
+
return h ? { index: l, item: h } : null;
|
|
785
|
+
}).filter((l) => l !== null);
|
|
786
|
+
if (s.length && !b((m) => m.filter((h, E) => E !== e)))
|
|
787
|
+
return { successful: [], failed: [{ index: e, error: "Controlled mode without onItemsChange" }] };
|
|
788
|
+
const i = new Set(c.failed.map((l) => l.index)), S = [...c.failed];
|
|
789
|
+
return c.successful.filter(({ index: l }) => l < 0 || l >= t.length).map(({ index: l, item: m }) => ({
|
|
790
|
+
index: l,
|
|
791
|
+
item: m,
|
|
792
|
+
error: "Invalid index"
|
|
793
|
+
})).forEach((l) => {
|
|
794
|
+
i.has(l.index) || S.push(l);
|
|
795
|
+
}), { successful: s, failed: S };
|
|
796
|
+
}
|
|
462
797
|
}
|
|
463
798
|
let n;
|
|
464
|
-
return
|
|
799
|
+
return b((o) => (n = o[e], o.filter((c, u) => u !== e))) ? { successful: [{ index: e, item: n }], failed: [] } : { successful: [], failed: [{ index: e, error: "Controlled mode without onItemsChange" }] };
|
|
465
800
|
} catch (n) {
|
|
466
801
|
return {
|
|
467
802
|
successful: [],
|
|
468
803
|
failed: [{ index: e, error: String(n) }]
|
|
469
804
|
};
|
|
470
805
|
}
|
|
471
|
-
},
|
|
806
|
+
}, [b]), ln = f(async (e) => {
|
|
472
807
|
if (!e.length) return { successful: [], failed: [] };
|
|
473
|
-
const t =
|
|
474
|
-
(
|
|
808
|
+
const t = R.current, n = Array.from(new Set(e)), { validIndexes: r, invalidFailures: o } = n.reduce(
|
|
809
|
+
(s, i) => (i >= 0 && i < t.length ? s.validIndexes.push(i) : s.invalidFailures.push({ index: i, error: "Invalid index" }), s),
|
|
475
810
|
{ validIndexes: [], invalidFailures: [] }
|
|
476
|
-
), c = n.map((
|
|
811
|
+
), c = n.map((s) => ({ index: s, item: t[s] })), u = new Set(r);
|
|
477
812
|
try {
|
|
478
|
-
if (
|
|
479
|
-
const
|
|
480
|
-
if (
|
|
481
|
-
const
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
813
|
+
if (ve.current) {
|
|
814
|
+
const x = await ve.current(c, _.current);
|
|
815
|
+
if (x) {
|
|
816
|
+
const l = x.successful.filter(({ index: d }) => u.has(d)), m = l.map(({ index: d, item: N }) => {
|
|
817
|
+
const F = on(t, d, N);
|
|
818
|
+
return F ? { index: d, item: F } : null;
|
|
819
|
+
}).filter((d) => d !== null);
|
|
820
|
+
if (l.length) {
|
|
821
|
+
const d = new Set(m.map((F) => F.index));
|
|
822
|
+
if (!b((F) => F.filter((Nn, ot) => !d.has(ot))))
|
|
823
|
+
return { successful: [], failed: m.map(({ index: F }) => ({ index: F, error: "Controlled mode without onItemsChange" })) };
|
|
485
824
|
}
|
|
486
|
-
const
|
|
487
|
-
return
|
|
488
|
-
|
|
489
|
-
}),
|
|
490
|
-
|
|
491
|
-
}), { successful: m, failed:
|
|
825
|
+
const h = new Set(x.failed.map((d) => d.index)), E = [...x.failed];
|
|
826
|
+
return o.forEach((d) => {
|
|
827
|
+
h.has(d.index) || E.push(d);
|
|
828
|
+
}), x.successful.filter(({ index: d }) => !u.has(d)).map(({ index: d, item: N }) => ({ index: d, item: N, error: "Invalid index" })).forEach((d) => {
|
|
829
|
+
h.has(d.index) || E.push(d);
|
|
830
|
+
}), { successful: m, failed: E };
|
|
492
831
|
}
|
|
493
832
|
}
|
|
494
|
-
const
|
|
495
|
-
return
|
|
496
|
-
const
|
|
497
|
-
return
|
|
498
|
-
|
|
499
|
-
}),
|
|
500
|
-
}), { successful:
|
|
501
|
-
} catch (
|
|
833
|
+
const s = new Set(r), i = [];
|
|
834
|
+
return b((x) => {
|
|
835
|
+
const l = [];
|
|
836
|
+
return x.forEach((m, h) => {
|
|
837
|
+
s.has(h) ? i.push({ index: h, item: m }) : l.push(m);
|
|
838
|
+
}), l;
|
|
839
|
+
}) ? { successful: i, failed: o } : { successful: [], failed: r.map((x) => ({ index: x, error: "Controlled mode without onItemsChange" })) };
|
|
840
|
+
} catch (s) {
|
|
502
841
|
return {
|
|
503
842
|
successful: [],
|
|
504
|
-
failed: n.map((
|
|
843
|
+
failed: n.map((i) => ({ index: i, error: String(s) }))
|
|
505
844
|
};
|
|
506
845
|
}
|
|
507
|
-
},
|
|
508
|
-
const t =
|
|
509
|
-
return t !== void 0 ?
|
|
510
|
-
}, []),
|
|
511
|
-
|
|
512
|
-
e.map((t) => ({ ...t, _rowId: t._rowId ??
|
|
846
|
+
}, [b]), an = f((e) => {
|
|
847
|
+
const t = Le.current.get(String(e));
|
|
848
|
+
return t !== void 0 ? R.current[t] : void 0;
|
|
849
|
+
}, []), un = f((e) => R.current[e], []), dn = f((e) => {
|
|
850
|
+
b(
|
|
851
|
+
e.map((t) => ({ ...t, _rowId: t._rowId ?? it() }))
|
|
513
852
|
);
|
|
514
|
-
},
|
|
515
|
-
|
|
516
|
-
},
|
|
853
|
+
}, [b]), fn = f(() => {
|
|
854
|
+
b([]);
|
|
855
|
+
}, [b]), mn = f((e) => Le.current.get(String(e)) ?? -1, []), hn = f((e) => Le.current.has(String(e)), []), pn = f(() => R.current.length, []), gn = f(() => [...R.current], []), Sn = f(() => kt(R.current), [kt]), wn = f(() => Lt(R.current), [Lt]), xn = f((e, t) => {
|
|
517
856
|
const n = e ? {
|
|
518
857
|
state: "loading",
|
|
519
858
|
message: t?.title,
|
|
520
859
|
description: t?.description
|
|
521
860
|
} : { state: "none" };
|
|
522
|
-
|
|
523
|
-
}, [
|
|
861
|
+
H || xe(n), j?.(n);
|
|
862
|
+
}, [H, j]), In = f((e, t) => {
|
|
524
863
|
const n = e ? {
|
|
525
864
|
state: "error",
|
|
526
865
|
message: t?.title,
|
|
527
866
|
description: t?.description,
|
|
528
|
-
onRetry: t?.onRetry
|
|
867
|
+
onRetry: t?.onRetry,
|
|
868
|
+
retryButtonText: t?.retryButtonText
|
|
529
869
|
} : { state: "none" };
|
|
530
|
-
|
|
531
|
-
}, [
|
|
870
|
+
H || xe(n), j?.(n);
|
|
871
|
+
}, [H, j]), bn = f((e, t) => {
|
|
532
872
|
const n = e ? {
|
|
533
873
|
state: "partial-loading",
|
|
534
874
|
message: t?.title,
|
|
535
875
|
description: t?.description
|
|
536
876
|
} : { state: "none" };
|
|
537
|
-
|
|
538
|
-
}, [
|
|
877
|
+
H || xe(n), j?.(n);
|
|
878
|
+
}, [H, j]), yn = f((e, t) => {
|
|
539
879
|
const n = e ? {
|
|
540
880
|
state: "empty",
|
|
541
881
|
message: t?.title,
|
|
542
882
|
description: t?.description,
|
|
543
883
|
imageUrl: t?.imageUrl
|
|
544
884
|
} : { state: "none" };
|
|
545
|
-
|
|
546
|
-
}, [
|
|
885
|
+
H || xe(n), j?.(n);
|
|
886
|
+
}, [H, j]), Rn = f(() => {
|
|
547
887
|
const e = { state: "none" };
|
|
548
|
-
|
|
549
|
-
}, [
|
|
550
|
-
getFields:
|
|
551
|
-
addItem:
|
|
552
|
-
addItems:
|
|
553
|
-
updateItem:
|
|
554
|
-
updateItems:
|
|
555
|
-
deleteItem:
|
|
556
|
-
deleteItems:
|
|
557
|
-
getItem:
|
|
558
|
-
getItemByIndex:
|
|
559
|
-
getItems:
|
|
560
|
-
getItemsCount:
|
|
561
|
-
itemExists:
|
|
562
|
-
getItemIndex:
|
|
563
|
-
replaceAllItems:
|
|
564
|
-
clearItems:
|
|
565
|
-
deselectAllRows:
|
|
566
|
-
getSelectedItems:
|
|
567
|
-
getSelectedRows:
|
|
888
|
+
H || xe(e), j?.(e);
|
|
889
|
+
}, [H, j]), vn = f(() => Ne.state, [Ne.state]), Fe = se(() => ({
|
|
890
|
+
getFields: Ut,
|
|
891
|
+
addItem: en,
|
|
892
|
+
addItems: tn,
|
|
893
|
+
updateItem: nn,
|
|
894
|
+
updateItems: rn,
|
|
895
|
+
deleteItem: cn,
|
|
896
|
+
deleteItems: ln,
|
|
897
|
+
getItem: an,
|
|
898
|
+
getItemByIndex: un,
|
|
899
|
+
getItems: gn,
|
|
900
|
+
getItemsCount: pn,
|
|
901
|
+
itemExists: hn,
|
|
902
|
+
getItemIndex: mn,
|
|
903
|
+
replaceAllItems: dn,
|
|
904
|
+
clearItems: fn,
|
|
905
|
+
deselectAllRows: Mt,
|
|
906
|
+
getSelectedItems: Sn,
|
|
907
|
+
getSelectedRows: wn,
|
|
568
908
|
// Overlay methods
|
|
569
|
-
setLoading:
|
|
570
|
-
setError:
|
|
571
|
-
setPartialLoading:
|
|
572
|
-
setEmpty:
|
|
573
|
-
clearOverlay:
|
|
574
|
-
getOverlayState:
|
|
909
|
+
setLoading: xn,
|
|
910
|
+
setError: In,
|
|
911
|
+
setPartialLoading: bn,
|
|
912
|
+
setEmpty: yn,
|
|
913
|
+
clearOverlay: Rn,
|
|
914
|
+
getOverlayState: vn,
|
|
915
|
+
// Sorting methods
|
|
916
|
+
getSortingState: Vt,
|
|
917
|
+
getPrimarySortedColumn: $t,
|
|
918
|
+
hasActiveSorting: qt,
|
|
919
|
+
setSortingState: Yt,
|
|
920
|
+
clearSorting: Gt,
|
|
921
|
+
// Filter methods
|
|
922
|
+
getFilterableFields: Kt,
|
|
923
|
+
getColumnFilters: Xt,
|
|
924
|
+
hasActiveFilters: Jt,
|
|
925
|
+
setColumnFilters: Zt,
|
|
926
|
+
clearColumnFilters: Qt
|
|
575
927
|
}), [
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
928
|
+
en,
|
|
929
|
+
tn,
|
|
930
|
+
fn,
|
|
931
|
+
Rn,
|
|
932
|
+
cn,
|
|
933
|
+
ln,
|
|
934
|
+
Mt,
|
|
935
|
+
a,
|
|
936
|
+
Ut,
|
|
937
|
+
an,
|
|
938
|
+
un,
|
|
939
|
+
mn,
|
|
940
|
+
gn,
|
|
941
|
+
pn,
|
|
942
|
+
vn,
|
|
943
|
+
Sn,
|
|
944
|
+
wn,
|
|
945
|
+
Vt,
|
|
946
|
+
$t,
|
|
947
|
+
qt,
|
|
948
|
+
hn,
|
|
949
|
+
dn,
|
|
950
|
+
Gt,
|
|
951
|
+
yn,
|
|
952
|
+
In,
|
|
953
|
+
xn,
|
|
954
|
+
Yt,
|
|
955
|
+
bn,
|
|
956
|
+
nn,
|
|
957
|
+
rn,
|
|
958
|
+
// Filter methods
|
|
959
|
+
Qt,
|
|
960
|
+
Xt,
|
|
961
|
+
Kt,
|
|
962
|
+
Jt,
|
|
963
|
+
Zt
|
|
601
964
|
]);
|
|
602
|
-
|
|
603
|
-
const
|
|
604
|
-
t?.target && t.target.closest('[data-checkbox="true"]') || (
|
|
605
|
-
}, [
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
965
|
+
_.current = Fe, fr.useImperativeHandle(jn, () => Fe, [Fe]);
|
|
966
|
+
const ir = f((e, t) => {
|
|
967
|
+
t?.target && t.target.closest('[data-checkbox="true"]') || (I && At(e.index), T && T(e.original, e.index));
|
|
968
|
+
}, [I, T, At]), lr = f((e, t) => {
|
|
969
|
+
t?.target && t.target.closest('[data-checkbox="true"]') || He && He(e.original, e.index);
|
|
970
|
+
}, [He]), Cn = se(() => B.map((e) => {
|
|
971
|
+
const n = a.find((o) => o.internalName === e.id)?.typeAsString === "Note" ? O * 2 : O, r = L[e.id] || (typeof e.size == "number" ? e.size : n);
|
|
972
|
+
return e.id === "select" ? `${Ae}px` : `${r}px`;
|
|
973
|
+
}).join(" "), [B, L, a]), Tn = w(!1);
|
|
974
|
+
kn(() => {
|
|
975
|
+
if (Tn.current) return;
|
|
976
|
+
const e = re.current;
|
|
977
|
+
if (!e) return;
|
|
978
|
+
const t = e.clientWidth;
|
|
979
|
+
if (t <= 0) return;
|
|
980
|
+
Tn.current = !0, zt(t);
|
|
981
|
+
const n = ie ? On(t, B, a, L) : Pn(t, B, a, L, Te);
|
|
982
|
+
n && (K.current = !0, Ie((r) => ie ? n : { ...r, ...n }), requestAnimationFrame(() => {
|
|
983
|
+
K.current = !1;
|
|
984
|
+
}));
|
|
985
|
+
}), oe(() => {
|
|
986
|
+
if (!Je) return;
|
|
611
987
|
const e = new ResizeObserver((t) => {
|
|
612
988
|
for (const n of t)
|
|
613
|
-
|
|
989
|
+
zt(n.contentRect.width);
|
|
614
990
|
});
|
|
615
|
-
return e.observe(
|
|
616
|
-
}, [
|
|
617
|
-
if (!(!
|
|
618
|
-
return
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
!(o.id === "select") ? (t += d, n.push(o)) : e += d;
|
|
624
|
-
}), n.length === 0)
|
|
625
|
-
return;
|
|
626
|
-
const s = e + t;
|
|
627
|
-
if (Math.abs(s - C) < 1) return;
|
|
628
|
-
const r = C - e, c = r / t, a = { ...S };
|
|
629
|
-
let i = 0;
|
|
630
|
-
n.forEach((o, u) => {
|
|
631
|
-
const m = S[o.id] || (typeof o.size == "number" ? o.size : x), d = o.minSize || F;
|
|
632
|
-
let l;
|
|
633
|
-
u === n.length - 1 ? l = r - i : l = Math.round(m * c), l = Math.max(d, l), a[o.id] = l, i += l;
|
|
634
|
-
}), _.current = !0, Z(a), requestAnimationFrame(() => {
|
|
635
|
-
_.current = !1;
|
|
636
|
-
});
|
|
991
|
+
return e.observe(Je), () => e.disconnect();
|
|
992
|
+
}, [Je]), oe(() => {
|
|
993
|
+
if (!(!ie || Q <= 0) && !K.current)
|
|
994
|
+
return Se.current && clearTimeout(Se.current), Se.current = setTimeout(() => {
|
|
995
|
+
const e = On(Q, B, a, L);
|
|
996
|
+
e && (K.current = !0, Ie(e), requestAnimationFrame(() => {
|
|
997
|
+
K.current = !1;
|
|
998
|
+
}));
|
|
637
999
|
}, 50), () => {
|
|
638
|
-
|
|
1000
|
+
Se.current && clearTimeout(Se.current);
|
|
639
1001
|
};
|
|
640
|
-
}, [
|
|
641
|
-
if (!(
|
|
642
|
-
return
|
|
643
|
-
const e =
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
if (t.length === 0) return;
|
|
648
|
-
const n = t[t.length - 1], s = n.id, c = f.find((d) => d.internalName === s)?.typeAsString === "Note" ? x * 2 : x, i = (S[s] || (typeof n.size == "number" ? n.size : c)) + e, o = n.minSize || F, u = Math.max(o, i), m = S[s];
|
|
649
|
-
Math.abs(m - u) < 1 || (_.current = !0, Z((d) => ({
|
|
650
|
-
...d,
|
|
651
|
-
[s]: u
|
|
652
|
-
})), _.current = !1);
|
|
1002
|
+
}, [ie, Q, B, a]), oe(() => {
|
|
1003
|
+
if (!(ie || Q <= 0))
|
|
1004
|
+
return we.current && clearTimeout(we.current), we.current = setTimeout(() => {
|
|
1005
|
+
const e = Pn(Q, B, a, L, Te);
|
|
1006
|
+
e && (K.current = !0, Ie((t) => ({ ...t, ...e })), requestAnimationFrame(() => {
|
|
1007
|
+
K.current = !1;
|
|
1008
|
+
}));
|
|
653
1009
|
}, 50), () => {
|
|
654
|
-
|
|
1010
|
+
we.current && clearTimeout(we.current);
|
|
655
1011
|
};
|
|
656
|
-
}, [
|
|
657
|
-
const
|
|
658
|
-
|
|
659
|
-
const
|
|
660
|
-
|
|
661
|
-
Xt,
|
|
1012
|
+
}, [ie, Q, Te, B, a]);
|
|
1013
|
+
const En = Rr(Un, W), zn = vr(Vn, W), _e = Cr($n, W), Fn = Tr(qn, W), Mn = Fn ? [...mt, Fn] : mt, ar = En ? [...Mn, En] : Mn, st = [];
|
|
1014
|
+
zn && st.push(zn);
|
|
1015
|
+
const ur = _e ? [...st, ...ht, _e] : [...st, ...ht], dr = _e ? [...pt, _e] : pt, An = /* @__PURE__ */ ct(
|
|
1016
|
+
xr,
|
|
662
1017
|
{
|
|
663
1018
|
size: "small",
|
|
664
|
-
appearance:
|
|
665
|
-
className:
|
|
1019
|
+
appearance: g,
|
|
1020
|
+
className: Jn,
|
|
666
1021
|
style: {
|
|
667
|
-
backgroundColor:
|
|
1022
|
+
backgroundColor: $.colorNeutralBackground1,
|
|
668
1023
|
maxWidth: "100%",
|
|
669
1024
|
// margin: "20px 20px",
|
|
670
1025
|
padding: "0px",
|
|
671
1026
|
gap: "0px",
|
|
672
|
-
...
|
|
1027
|
+
...p
|
|
673
1028
|
},
|
|
674
1029
|
children: [
|
|
675
|
-
|
|
676
|
-
|
|
1030
|
+
Y && /* @__PURE__ */ D(
|
|
1031
|
+
Nr,
|
|
677
1032
|
{
|
|
678
|
-
tableMethods:
|
|
679
|
-
alwaysButtons:
|
|
680
|
-
noSelectionButtons:
|
|
681
|
-
singleSelectionButtons:
|
|
682
|
-
multiSelectionButtons:
|
|
683
|
-
selectedRows:
|
|
1033
|
+
tableMethods: Fe,
|
|
1034
|
+
alwaysButtons: De(ar),
|
|
1035
|
+
noSelectionButtons: De(Yn),
|
|
1036
|
+
singleSelectionButtons: De(ur),
|
|
1037
|
+
multiSelectionButtons: De(dr),
|
|
1038
|
+
selectedRows: Fe.getSelectedRows(),
|
|
1039
|
+
localeText: W
|
|
684
1040
|
}
|
|
685
1041
|
),
|
|
686
1042
|
(() => {
|
|
687
|
-
const e =
|
|
1043
|
+
const e = rt.getRowModel().rows.length, t = Z.length > 0, n = Ne.state !== "none" ? Ne : t && e === 0 ? {
|
|
1044
|
+
state: "empty",
|
|
1045
|
+
message: W.filteredEmptyTitle,
|
|
1046
|
+
description: W.filteredEmptyDescription,
|
|
1047
|
+
imageUrl: le?.empty?.imageUrl
|
|
1048
|
+
} : X.length === 0 ? {
|
|
688
1049
|
state: "empty",
|
|
689
|
-
message:
|
|
690
|
-
description:
|
|
691
|
-
imageUrl:
|
|
692
|
-
} : { state: "none" },
|
|
1050
|
+
message: le?.empty?.title,
|
|
1051
|
+
description: le?.empty?.description,
|
|
1052
|
+
imageUrl: le?.empty?.imageUrl
|
|
1053
|
+
} : { state: "none" }, r = /* @__PURE__ */ ct(
|
|
693
1054
|
"div",
|
|
694
1055
|
{
|
|
695
|
-
ref:
|
|
696
|
-
onScroll:
|
|
697
|
-
className:
|
|
1056
|
+
ref: sr,
|
|
1057
|
+
onScroll: cr,
|
|
1058
|
+
className: vt["efw-table-scroll-container"],
|
|
698
1059
|
style: {
|
|
699
|
-
...
|
|
700
|
-
maxHeight:
|
|
1060
|
+
...ge !== void 0 && {
|
|
1061
|
+
maxHeight: ge
|
|
701
1062
|
},
|
|
702
|
-
overflowY:
|
|
1063
|
+
overflowY: ge !== void 0 ? "auto" : "visible",
|
|
703
1064
|
overflowX: "auto",
|
|
704
|
-
border: `1px solid ${
|
|
705
|
-
borderTop:
|
|
1065
|
+
border: `1px solid ${$.colorNeutralStroke2}`,
|
|
1066
|
+
borderTop: Y ? "none" : `1px solid ${$.colorNeutralStroke2}`,
|
|
706
1067
|
position: "relative"
|
|
707
1068
|
},
|
|
708
|
-
children:
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
1069
|
+
children: [
|
|
1070
|
+
/* @__PURE__ */ ct(
|
|
1071
|
+
"div",
|
|
1072
|
+
{
|
|
1073
|
+
className: "table-container",
|
|
1074
|
+
style: {
|
|
1075
|
+
minWidth: "100%",
|
|
1076
|
+
width: or
|
|
1077
|
+
},
|
|
1078
|
+
children: [
|
|
1079
|
+
/* @__PURE__ */ D(
|
|
1080
|
+
kr,
|
|
1081
|
+
{
|
|
1082
|
+
table: rt,
|
|
1083
|
+
gridTemplateColumns: Cn,
|
|
1084
|
+
columnSizing: L,
|
|
1085
|
+
dense: q,
|
|
1086
|
+
stickyColumnsInfo: Pt,
|
|
1087
|
+
resizableColumns: je,
|
|
1088
|
+
localeText: W
|
|
1089
|
+
}
|
|
1090
|
+
),
|
|
1091
|
+
/* @__PURE__ */ D(
|
|
1092
|
+
Lr,
|
|
1093
|
+
{
|
|
1094
|
+
table: rt,
|
|
1095
|
+
fields: a,
|
|
1096
|
+
tableContainerRef: re,
|
|
1097
|
+
useVirtualization: lt,
|
|
1098
|
+
enableSelection: I,
|
|
1099
|
+
itemSize: qe,
|
|
1100
|
+
dense: q,
|
|
1101
|
+
rowAnimationSignals: tr,
|
|
1102
|
+
gridTemplateColumns: Cn,
|
|
1103
|
+
columnSizing: L,
|
|
1104
|
+
stickyColumnsInfo: Pt,
|
|
1105
|
+
onRowClick: ir,
|
|
1106
|
+
onRowDoubleClick: lr
|
|
1107
|
+
}
|
|
1108
|
+
)
|
|
1109
|
+
]
|
|
1110
|
+
}
|
|
1111
|
+
),
|
|
1112
|
+
pe && /* @__PURE__ */ D(
|
|
1113
|
+
"div",
|
|
1114
|
+
{
|
|
1115
|
+
style: {
|
|
1116
|
+
height: qe,
|
|
1117
|
+
minHeight: qe,
|
|
1118
|
+
display: "flex",
|
|
1119
|
+
alignItems: "center",
|
|
1120
|
+
justifyContent: "center",
|
|
1121
|
+
backgroundColor: $.colorNeutralBackground1,
|
|
1122
|
+
borderTop: `1px solid ${$.colorNeutralStroke1}`,
|
|
1123
|
+
position: "sticky",
|
|
1124
|
+
left: 0,
|
|
1125
|
+
width: "100%",
|
|
1126
|
+
minWidth: "100%",
|
|
1127
|
+
maxWidth: "100%",
|
|
1128
|
+
zIndex: 1
|
|
1129
|
+
},
|
|
1130
|
+
"aria-live": "polite",
|
|
1131
|
+
"aria-label": W.loadingMoreAriaLabel,
|
|
1132
|
+
children: /* @__PURE__ */ D(Ir, { size: "tiny", label: W.loadingMoreSpinnerLabel })
|
|
1133
|
+
}
|
|
1134
|
+
)
|
|
1135
|
+
]
|
|
745
1136
|
}
|
|
746
1137
|
);
|
|
747
|
-
return
|
|
748
|
-
|
|
1138
|
+
return n.state === "partial-loading" ? /* @__PURE__ */ D(
|
|
1139
|
+
_n,
|
|
749
1140
|
{
|
|
750
|
-
config:
|
|
751
|
-
customization:
|
|
752
|
-
height:
|
|
753
|
-
|
|
1141
|
+
config: n,
|
|
1142
|
+
customization: le,
|
|
1143
|
+
height: ge !== void 0 ? Math.max($e, ge) : $e,
|
|
1144
|
+
localeText: W,
|
|
1145
|
+
children: r
|
|
754
1146
|
}
|
|
755
|
-
) :
|
|
756
|
-
|
|
1147
|
+
) : n.state !== "none" ? /* @__PURE__ */ D(
|
|
1148
|
+
_n,
|
|
757
1149
|
{
|
|
758
|
-
config:
|
|
759
|
-
height:
|
|
760
|
-
customization:
|
|
1150
|
+
config: n,
|
|
1151
|
+
height: $e,
|
|
1152
|
+
customization: le,
|
|
1153
|
+
localeText: W
|
|
761
1154
|
}
|
|
762
|
-
) :
|
|
1155
|
+
) : r;
|
|
763
1156
|
})()
|
|
764
1157
|
]
|
|
765
1158
|
}
|
|
766
1159
|
);
|
|
1160
|
+
return yt ? /* @__PURE__ */ D(Ar, { localeText: yt, children: An }) : An;
|
|
767
1161
|
};
|
|
768
1162
|
export {
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
En as EFWTable,
|
|
773
|
-
zn as SELECTOR_CELL_HEIGHT,
|
|
774
|
-
G as SELECTOR_CELL_WIDTH
|
|
1163
|
+
Pe as COLS_MAX_WIDTH,
|
|
1164
|
+
he as COLS_MIN_WIDTH,
|
|
1165
|
+
ls as EFWTable
|
|
775
1166
|
};
|