@indico-data/design-system 3.18.0 → 3.20.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/.eslintrc.js +87 -2
- package/.husky/pre-commit +2 -0
- package/.vscode/settings.json +10 -1
- package/lib/components/badge/Badge.d.ts +1 -1
- package/lib/components/badge/Badge.stories.d.ts +1 -1
- package/lib/components/button/Button.d.ts +2 -2
- package/lib/components/button/Button.stories.d.ts +1 -1
- package/lib/components/button/types.d.ts +1 -1
- package/lib/components/card/Card.d.ts +1 -1
- package/lib/components/card/Card.stories.d.ts +1 -1
- package/lib/components/floatUI/FloatUI.d.ts +1 -1
- package/lib/components/floatUI/FloatUI.stories.d.ts +2 -2
- package/lib/components/floatUI/types.d.ts +2 -2
- package/lib/components/forms/checkbox/Checkbox.stories.d.ts +1 -1
- package/lib/components/forms/date/datePicker/DatePicker.d.ts +1 -1
- package/lib/components/forms/date/datePicker/DatePicker.stories.d.ts +1 -1
- package/lib/components/forms/date/datePicker/contants.d.ts +1 -1
- package/lib/components/forms/date/datePicker/types.d.ts +8 -1
- package/lib/components/forms/date/iconTriggerDatePicker/IconTriggerDatePicker.d.ts +7 -4
- package/lib/components/forms/date/iconTriggerDatePicker/IconTriggerDatePicker.stories.d.ts +1 -1
- package/lib/components/forms/date/iconTriggerDatePicker/types.d.ts +5 -0
- package/lib/components/forms/date/inputDatePicker/SingleInputDatePicker.d.ts +4 -3
- package/lib/components/forms/date/inputDatePicker/SingleInputDatePicker.stories.d.ts +1 -1
- package/lib/components/forms/date/inputDateRangePicker/InputDateRangePicker.d.ts +7 -4
- package/lib/components/forms/date/inputDateRangePicker/InputDateRangePicker.stories.d.ts +1 -1
- package/lib/components/forms/date/inputDateRangePicker/types.d.ts +7 -0
- package/lib/components/forms/date/inputDateTimePicker/SingleInputDateTimePicker.d.ts +4 -3
- package/lib/components/forms/date/inputDateTimePicker/SingleInputDateTimePicker.stories.d.ts +1 -1
- package/lib/components/forms/form/Form.d.ts +1 -1
- package/lib/components/forms/form/Form.stories.d.ts +1 -1
- package/lib/components/forms/input/Input.d.ts +2 -2
- package/lib/components/forms/input/Input.stories.d.ts +1 -1
- package/lib/components/forms/numberInput/NumberInput.d.ts +2 -2
- package/lib/components/forms/numberInput/NumberInput.stories.d.ts +1 -1
- package/lib/components/forms/passwordInput/PasswordInput.d.ts +1 -1
- package/lib/components/forms/passwordInput/PasswordInput.stories.d.ts +1 -1
- package/lib/components/forms/radio/Radio.stories.d.ts +1 -1
- package/lib/components/forms/select/Select.d.ts +4 -2
- package/lib/components/forms/select/Select.stories.d.ts +4 -4
- package/lib/components/forms/select/types.d.ts +11 -1
- package/lib/components/forms/subcomponents/Label.d.ts +5 -1
- package/lib/components/forms/subcomponents/types.d.ts +5 -0
- package/lib/components/forms/textarea/Textarea.d.ts +1 -1
- package/lib/components/forms/textarea/Textarea.stories.d.ts +1 -1
- package/lib/components/forms/timePicker/TimePicker.d.ts +4 -1
- package/lib/components/forms/timePicker/types.d.ts +5 -0
- package/lib/components/forms/toggle/Toggle.stories.d.ts +1 -1
- package/lib/components/grid/col/Col.d.ts +1 -1
- package/lib/components/grid/col/Col.stories.d.ts +1 -1
- package/lib/components/grid/container/Container.d.ts +1 -1
- package/lib/components/grid/container/Container.stories.d.ts +1 -1
- package/lib/components/grid/row/Row.d.ts +1 -1
- package/lib/components/grid/row/Row.stories.d.ts +1 -1
- package/lib/components/icons/Icon.d.ts +1 -1
- package/lib/components/icons/Icon.stories.d.ts +2 -2
- package/lib/components/icons/indicons.d.ts +1 -1
- package/lib/components/icons/types.d.ts +4 -4
- package/lib/components/loading-indicators/BarSpinner/BarSpinner.stories.d.ts +1 -1
- package/lib/components/loading-indicators/CirclePulse/CirclePulse.stories.d.ts +1 -1
- package/lib/components/menu/Menu.stories.d.ts +2 -2
- package/lib/components/modal/ConfirmationModal.d.ts +2 -2
- package/lib/components/modal/Modal.d.ts +2 -2
- package/lib/components/modal/Modal.stories.d.ts +6 -2
- package/lib/components/modal/types.d.ts +21 -7
- package/lib/components/pagination/Pagination.d.ts +2 -2
- package/lib/components/pagination/Pagination.stories.d.ts +1 -1
- package/lib/components/pagination/index.d.ts +1 -0
- package/lib/components/pagination/types.d.ts +13 -0
- package/lib/components/pill/Pill.d.ts +1 -1
- package/lib/components/pill/Pill.stories.d.ts +1 -1
- package/lib/components/pill/types.d.ts +2 -2
- package/lib/components/skeleton/Skeleton.stories.d.ts +1 -1
- package/lib/components/stepper/Stepper.d.ts +2 -2
- package/lib/components/stepper/Stepper.stories.d.ts +1 -1
- package/lib/components/stepper/components/BackNavigation.d.ts +2 -1
- package/lib/components/stepper/components/Legend.d.ts +1 -1
- package/lib/components/stepper/components/NextNavigation.d.ts +3 -1
- package/lib/components/stepper/types.d.ts +12 -1
- package/lib/components/table/LoadingComponent.d.ts +5 -1
- package/lib/components/table/Table.d.ts +1 -1
- package/lib/components/table/Table.stories.d.ts +2 -2
- package/lib/components/table/components/HorizontalStickyHeader.d.ts +4 -1
- package/lib/components/table/components/helpers.d.ts +1 -1
- package/lib/components/table/hooks/usePinnedColumnsManager.d.ts +2 -2
- package/lib/components/table/sampleData.d.ts +1 -1
- package/lib/components/table/types.d.ts +20 -2
- package/lib/components/table/utils/processColumns.d.ts +2 -2
- package/lib/components/tanstackTable/TankstackTable.types.d.ts +20 -3
- package/lib/components/tanstackTable/TanstackTable.d.ts +2 -2
- package/lib/components/tanstackTable/TanstackTable.stories.d.ts +2 -2
- package/lib/components/tanstackTable/__tests__/__mocks__/test-mock-data.d.ts +1 -1
- package/lib/components/tanstackTable/components/ActionBar/ActionBar.d.ts +2 -2
- package/lib/components/tanstackTable/components/ActionBar/ActionBar.stories.d.ts +1 -1
- package/lib/components/tanstackTable/components/NoResults/NoResults.d.ts +2 -1
- package/lib/components/tanstackTable/components/TableBody/TableBody.d.ts +1 -1
- package/lib/components/tanstackTable/components/TableHeader/TableHeader.d.ts +1 -1
- package/lib/components/tanstackTable/components/TableLoading/TableLoading.d.ts +1 -1
- package/lib/components/tanstackTable/components/TablePagination/TablePagination.d.ts +3 -1
- package/lib/components/tanstackTable/docs/internalSorting/InternalClientSideSorting.stories.d.ts +2 -2
- package/lib/components/tanstackTable/docs/pinnedColumns/PinnedColumn.stories.d.ts +2 -2
- package/lib/components/tanstackTable/docs/withRowClick/WithRowClick.stories.d.ts +2 -2
- package/lib/components/tanstackTable/helpers.d.ts +2 -2
- package/lib/components/tanstackTable/mock-data/table-configuration.d.ts +2 -2
- package/lib/components/tanstackTable/useTanstackTable.d.ts +1 -1
- package/lib/components/toast/Toast.stories.d.ts +1 -1
- package/lib/components/tooltip/Tooltip.d.ts +2 -2
- package/lib/components/tooltip/Tooltip.stories.d.ts +1 -1
- package/lib/components/truncate/Truncate.d.ts +1 -1
- package/lib/components/truncate/Truncate.stories.d.ts +2 -2
- package/lib/components/truncate/types.d.ts +1 -1
- package/lib/docs/BaseColorPalette/BaseColorsPalette.stories.d.ts +1 -1
- package/lib/docs/SemanticTokens/ColorSwatch.d.ts +1 -1
- package/lib/docs/SemanticTokens/SemanticTokens.stories.d.ts +1 -1
- package/lib/index.d.ts +165 -45
- package/lib/index.esm.js +253 -170
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +253 -170
- package/lib/index.js.map +1 -1
- package/lib/setup/setupIcons.d.ts +1 -1
- package/lib/storybook/formArgTypes.d.ts +1 -1
- package/lib/stylesAndAnimations/borders/BorderColor.stories.d.ts +1 -1
- package/lib/stylesAndAnimations/borders/BorderRadius.stories.d.ts +1 -1
- package/lib/stylesAndAnimations/borders/BorderStyles.stories.d.ts +1 -1
- package/lib/stylesAndAnimations/borders/BorderThickness.stories.d.ts +1 -1
- package/lib/stylesAndAnimations/colors/UtilityClasses.stories.d.ts +1 -1
- package/lib/stylesAndAnimations/sizing/Sizing.stories.d.ts +1 -1
- package/lib/stylesAndAnimations/typography/Typography.stories.d.ts +1 -1
- package/lib/stylesAndAnimations/utilityClasses/UtilityClassesTable.stories.d.ts +1 -1
- package/lib/types.d.ts +4 -4
- package/package.json +8 -2
- package/src/components/badge/Badge.stories.tsx +4 -3
- package/src/components/badge/Badge.tsx +2 -1
- package/src/components/badge/__tests__/Badge.test.tsx +1 -0
- package/src/components/button/Button.stories.tsx +5 -4
- package/src/components/button/Button.tsx +12 -22
- package/src/components/button/__tests__/Button.test.tsx +31 -28
- package/src/components/button/types.ts +1 -1
- package/src/components/card/Card.stories.tsx +2 -1
- package/src/components/card/Card.tsx +2 -1
- package/src/components/card/__tests__/Card.test.tsx +1 -0
- package/src/components/floatUI/FloatUI.stories.tsx +3 -2
- package/src/components/floatUI/FloatUI.tsx +6 -7
- package/src/components/floatUI/__tests__/FloatUI.test.tsx +5 -3
- package/src/components/floatUI/types.ts +2 -2
- package/src/components/forms/checkbox/Checkbox.stories.tsx +3 -2
- package/src/components/forms/checkbox/Checkbox.tsx +1 -1
- package/src/components/forms/checkbox/__tests__/Checkbox.test.tsx +2 -1
- package/src/components/forms/date/datePicker/DatePicker.stories.tsx +12 -1
- package/src/components/forms/date/datePicker/DatePicker.tsx +35 -25
- package/src/components/forms/date/datePicker/__tests__/DatePicker.test.tsx +1 -0
- package/src/components/forms/date/datePicker/contants.ts +1 -1
- package/src/components/forms/date/datePicker/types.ts +16 -8
- package/src/components/forms/date/iconTriggerDatePicker/IconTriggerDatePicker.stories.tsx +16 -2
- package/src/components/forms/date/iconTriggerDatePicker/IconTriggerDatePicker.tsx +21 -8
- package/src/components/forms/date/iconTriggerDatePicker/__tests__/IconTriggerDatePicker.test.tsx +2 -1
- package/src/components/forms/date/iconTriggerDatePicker/types.ts +5 -0
- package/src/components/forms/date/inputDatePicker/SingleInputDatePicker.stories.tsx +4 -2
- package/src/components/forms/date/inputDatePicker/SingleInputDatePicker.tsx +18 -13
- package/src/components/forms/date/inputDatePicker/__tests__/SingleInputDatePicker.test.tsx +4 -2
- package/src/components/forms/date/inputDateRangePicker/InputDateRangePicker.stories.tsx +15 -4
- package/src/components/forms/date/inputDateRangePicker/InputDateRangePicker.tsx +29 -23
- package/src/components/forms/date/inputDateRangePicker/__tests__/InputDateRangePicker.test.tsx +2 -2
- package/src/components/forms/date/inputDateRangePicker/types.ts +7 -0
- package/src/components/forms/date/inputDateTimePicker/SingleInputDateTimePicker.stories.tsx +9 -5
- package/src/components/forms/date/inputDateTimePicker/SingleInputDateTimePicker.tsx +18 -13
- package/src/components/forms/form/Form.stories.tsx +7 -6
- package/src/components/forms/form/Form.tsx +1 -1
- package/src/components/forms/form/__tests__/Form.test.tsx +7 -4
- package/src/components/forms/input/Input.stories.tsx +6 -3
- package/src/components/forms/input/Input.tsx +4 -3
- package/src/components/forms/input/__tests__/Input.test.tsx +5 -3
- package/src/components/forms/numberInput/NumberInput.stories.tsx +5 -2
- package/src/components/forms/numberInput/NumberInput.tsx +6 -3
- package/src/components/forms/numberInput/__tests__/NumberInput.test.tsx +2 -1
- package/src/components/forms/passwordInput/PasswordInput.stories.tsx +6 -3
- package/src/components/forms/passwordInput/PasswordInput.tsx +12 -3
- package/src/components/forms/passwordInput/__tests__/PasswordInput.test.tsx +3 -4
- package/src/components/forms/radio/Radio.stories.tsx +5 -2
- package/src/components/forms/radio/__tests__/Radio.test.tsx +3 -2
- package/src/components/forms/select/Select.stories.tsx +11 -9
- package/src/components/forms/select/Select.tsx +21 -6
- package/src/components/forms/select/__tests__/Select.test.tsx +2 -2
- package/src/components/forms/select/types.ts +13 -1
- package/src/components/forms/subcomponents/Label.tsx +24 -4
- package/src/components/forms/subcomponents/__tests__/Label.test.tsx +1 -0
- package/src/components/forms/subcomponents/types.ts +5 -0
- package/src/components/forms/textarea/Textarea.stories.tsx +5 -2
- package/src/components/forms/textarea/Textarea.tsx +5 -4
- package/src/components/forms/textarea/__tests__/Textarea.test.tsx +3 -3
- package/src/components/forms/timePicker/TimePicker.stories.tsx +14 -2
- package/src/components/forms/timePicker/TimePicker.tsx +15 -5
- package/src/components/forms/timePicker/__tests__/TimePicker.test.tsx +2 -1
- package/src/components/forms/timePicker/types.ts +5 -0
- package/src/components/forms/toggle/Toggle.stories.tsx +3 -2
- package/src/components/forms/toggle/__tests__/Toggle.test.tsx +3 -2
- package/src/components/grid/col/Col.stories.tsx +2 -1
- package/src/components/grid/col/Col.tsx +1 -1
- package/src/components/grid/container/Container.stories.tsx +2 -1
- package/src/components/grid/container/Container.tsx +1 -1
- package/src/components/grid/row/Row.stories.tsx +2 -1
- package/src/components/grid/row/Row.tsx +1 -1
- package/src/components/icons/Icon.stories.tsx +11 -4
- package/src/components/icons/Icon.tsx +4 -3
- package/src/components/icons/__tests__/Icon.test.tsx +1 -0
- package/src/components/icons/indicons.tsx +3 -3
- package/src/components/icons/types.ts +5 -4
- package/src/components/loading-indicators/BarSpinner/BarSpinner.stories.tsx +2 -1
- package/src/components/loading-indicators/BarSpinner/__tests__/BarSpinner.test.tsx +1 -0
- package/src/components/loading-indicators/CirclePulse/CirclePulse.stories.tsx +2 -1
- package/src/components/menu/Menu.stories.tsx +3 -2
- package/src/components/menu/Menu.test.tsx +1 -1
- package/src/components/menu/Menu.tsx +1 -1
- package/src/components/modal/ConfirmationModal.tsx +25 -18
- package/src/components/modal/Modal.stories.tsx +62 -28
- package/src/components/modal/Modal.tsx +9 -2
- package/src/components/modal/__tests__/Modal.test.tsx +1 -0
- package/src/components/modal/types.ts +23 -7
- package/src/components/pagination/Pagination.stories.tsx +14 -2
- package/src/components/pagination/Pagination.tsx +18 -8
- package/src/components/pagination/__tests__/Pagination.test.tsx +1 -0
- package/src/components/pagination/index.ts +1 -0
- package/src/components/pagination/types.ts +14 -0
- package/src/components/pill/Pill.stories.tsx +10 -6
- package/src/components/pill/Pill.tsx +2 -1
- package/src/components/pill/__tests__/Pill.test.tsx +4 -1
- package/src/components/pill/types.ts +4 -2
- package/src/components/skeleton/Skeleton.stories.tsx +2 -1
- package/src/components/skeleton/__tests__/Skeleton.test.tsx +1 -0
- package/src/components/stepper/Stepper.stories.tsx +20 -7
- package/src/components/stepper/Stepper.tsx +18 -3
- package/src/components/stepper/__tests__/Stepper.tests.tsx +5 -4
- package/src/components/stepper/components/BackNavigation.tsx +5 -3
- package/src/components/stepper/components/Legend.tsx +4 -3
- package/src/components/stepper/components/NextNavigation.tsx +15 -5
- package/src/components/stepper/examples/MixedExample.tsx +4 -3
- package/src/components/stepper/examples/OptionalStepsExample.tsx +4 -3
- package/src/components/stepper/examples/RequiredStepsExample.tsx +4 -3
- package/src/components/stepper/examples/commonExample/CommonExample.tsx +4 -3
- package/src/components/stepper/examples/commonExample/steps/StepOne.tsx +1 -0
- package/src/components/stepper/examples/commonExample/steps/StepThree.tsx +1 -0
- package/src/components/stepper/examples/commonExample/steps/StepTwo.tsx +1 -0
- package/src/components/stepper/types.ts +13 -1
- package/src/components/table/LoadingComponent.tsx +6 -2
- package/src/components/table/Table.stories.tsx +19 -5
- package/src/components/table/Table.tsx +16 -5
- package/src/components/table/__tests__/Table.test.tsx +2 -1
- package/src/components/table/components/HorizontalStickyHeader.tsx +14 -2
- package/src/components/table/components/TablePagination.tsx +1 -1
- package/src/components/table/components/__tests__/HorizontalStickyHeader.test.tsx +3 -3
- package/src/components/table/components/__tests__/TablePagination.test.tsx +1 -0
- package/src/components/table/components/helpers.ts +1 -1
- package/src/components/table/hooks/usePinnedColumnsManager.ts +7 -2
- package/src/components/table/sampleData.tsx +1 -3
- package/src/components/table/types.ts +25 -6
- package/src/components/table/utils/processColumns.tsx +4 -2
- package/src/components/tanstackTable/TankstackTable.types.ts +21 -3
- package/src/components/tanstackTable/TanstackTable.stories.tsx +14 -11
- package/src/components/tanstackTable/TanstackTable.tsx +28 -18
- package/src/components/tanstackTable/__tests__/TanstackTable.test.tsx +2 -1
- package/src/components/tanstackTable/__tests__/__mocks__/test-mock-data.tsx +2 -1
- package/src/components/tanstackTable/components/ActionBar/ActionBar.stories.tsx +6 -3
- package/src/components/tanstackTable/components/ActionBar/ActionBar.tsx +7 -3
- package/src/components/tanstackTable/components/ActionBar/__tests__/ActionBar.test.tsx +4 -1
- package/src/components/tanstackTable/components/NoResults/NoResults.tsx +9 -3
- package/src/components/tanstackTable/components/NoResults/__tests__/NoResult.test.tsx +1 -0
- package/src/components/tanstackTable/components/TableBody/TableBody.tsx +2 -1
- package/src/components/tanstackTable/components/TableHeader/TableHeader.tsx +3 -2
- package/src/components/tanstackTable/components/TableLoading/TableLoading.tsx +2 -1
- package/src/components/tanstackTable/components/TablePagination/TablePagination.tsx +4 -1
- package/src/components/tanstackTable/components/TablePagination/__tests__/TablePagination.test.tsx +1 -0
- package/src/components/tanstackTable/docs/internalSorting/InternalClientSideSorting.stories.tsx +5 -5
- package/src/components/tanstackTable/docs/pinnedColumns/PinnedColumn.stories.tsx +5 -4
- package/src/components/tanstackTable/docs/withRowClick/WithRowClick.stories.tsx +5 -4
- package/src/components/tanstackTable/helpers.ts +2 -2
- package/src/components/tanstackTable/mock-data/table-configuration.tsx +7 -4
- package/src/components/tanstackTable/useTanstackTable.tsx +1 -2
- package/src/components/toast/Toast.stories.tsx +2 -1
- package/src/components/tooltip/Tooltip.stories.tsx +3 -2
- package/src/components/tooltip/Tooltip.tsx +2 -2
- package/src/components/truncate/Truncate.stories.tsx +3 -2
- package/src/components/truncate/Truncate.tsx +5 -4
- package/src/components/truncate/__tests__/Truncate.test.tsx +1 -0
- package/src/components/truncate/types.ts +1 -1
- package/src/docs/BaseColorPalette/BaseColorPalette.tsx +1 -0
- package/src/docs/BaseColorPalette/BaseColorsPalette.stories.tsx +2 -1
- package/src/docs/BaseColorPalette/Swatch.tsx +2 -1
- package/src/docs/SemanticTokens/ColorSwatch.tsx +1 -1
- package/src/docs/SemanticTokens/SemanticTokens.stories.tsx +2 -2
- package/src/index.ts +1 -1
- package/src/setup/setupIcons.ts +2 -2
- package/src/storybook/formArgTypes.ts +12 -1
- package/src/storybook/iconNames.ts +1 -0
- package/src/storybookDocs/Permafrost.mdx +8 -0
- package/src/stylesAndAnimations/borders/BorderColor.stories.tsx +2 -1
- package/src/stylesAndAnimations/borders/BorderColor.tsx +0 -1
- package/src/stylesAndAnimations/borders/BorderRadius.stories.tsx +2 -1
- package/src/stylesAndAnimations/borders/BorderRadius.tsx +0 -1
- package/src/stylesAndAnimations/borders/BorderStyles.stories.tsx +2 -1
- package/src/stylesAndAnimations/borders/BorderStyles.tsx +0 -1
- package/src/stylesAndAnimations/borders/BorderThickness.stories.tsx +2 -1
- package/src/stylesAndAnimations/borders/BorderThickness.tsx +0 -1
- package/src/stylesAndAnimations/colors/UtilityClasses.stories.tsx +2 -1
- package/src/stylesAndAnimations/colors/UtilityClasses.tsx +1 -2
- package/src/stylesAndAnimations/sizing/Sizing.stories.tsx +2 -1
- package/src/stylesAndAnimations/sizing/Sizing.tsx +0 -1
- package/src/stylesAndAnimations/typography/Typography.stories.tsx +2 -1
- package/src/stylesAndAnimations/typography/Typography.tsx +0 -1
- package/src/stylesAndAnimations/utilityClasses/UtilityClassesTable.stories.tsx +2 -1
- package/src/stylesAndAnimations/utilityClasses/UtilityClassesTable.tsx +6 -3
- package/src/types.ts +12 -6
package/lib/index.esm.js
CHANGED
|
@@ -175,7 +175,7 @@ function indiconToIconDef([name, customIcon]) {
|
|
|
175
175
|
if (pathElements.length === 1 && !pathElements[0].props.d)
|
|
176
176
|
throw new Error(`Monotone indicon '${name}' must have a 'd' attribute.`);
|
|
177
177
|
if (pathElements.length === 2) {
|
|
178
|
-
|
|
178
|
+
const [primary, secondary] = pathElements;
|
|
179
179
|
if (!primary.props.d || !secondary.props.d)
|
|
180
180
|
throw new Error(`Duotone indicon '${name}' must have 'd' attributes on both paths.`);
|
|
181
181
|
const op1 = parseFloat(primary.props.opacity);
|
|
@@ -5042,7 +5042,9 @@ const Icon = (_a) => {
|
|
|
5042
5042
|
};
|
|
5043
5043
|
|
|
5044
5044
|
const Button$1 = forwardRef((props, ref) => {
|
|
5045
|
-
const { ariaLabel, children, isLoading, isDisabled, variant = 'solid', isPill, iconLeft, iconRight, onClick, type = 'button', size = 'md', onMouseExit, className,
|
|
5045
|
+
const { ariaLabel, children, isLoading, isDisabled, variant = 'solid', isPill, iconLeft, iconRight, onClick, type = 'button', size = 'md', onMouseExit, className,
|
|
5046
|
+
// Destructure unused prop to prevent leaking to DOM
|
|
5047
|
+
href: _href } = props, rest = __rest(props, ["ariaLabel", "children", "isLoading", "isDisabled", "variant", "isPill", "iconLeft", "iconRight", "onClick", "type", "size", "onMouseExit", "className", "href"]);
|
|
5046
5048
|
const buttonClasses = classNames('btn', {
|
|
5047
5049
|
[`btn--${variant}`]: variant,
|
|
5048
5050
|
[`btn--${size}`]: size,
|
|
@@ -5074,7 +5076,7 @@ const Button$1 = forwardRef((props, ref) => {
|
|
|
5074
5076
|
onClick(event);
|
|
5075
5077
|
}
|
|
5076
5078
|
};
|
|
5077
|
-
return (jsxs("button", Object.assign({ ref: ref, disabled: isLoading || isDisabled, className: buttonClasses, role: "button", onClick: handleOnClick, "aria-label": ariaLabel || 'button', "aria-disabled": isLoading || isDisabled, "aria-busy": isLoading, type: type, onMouseLeave: onMouseExit }, rest, { children: [isLoading && !iconRight && (jsx(Icon, { name: "indico-o", style: { animation: 'spin 1s linear infinite' },
|
|
5079
|
+
return (jsxs("button", Object.assign({ ref: ref, disabled: isLoading || isDisabled, className: buttonClasses, role: "button", onClick: handleOnClick, "aria-label": ariaLabel || 'button', "aria-disabled": isLoading || isDisabled, "aria-busy": isLoading, type: type, onMouseLeave: onMouseExit }, rest, { children: [isLoading && !iconRight && (jsx(Icon, { name: "indico-o", style: { animation: 'spin 1s linear infinite' }, size: iconSize })), iconLeft && !isLoading && jsx(Icon, { name: iconLeft, ariaLabel: iconLeft, size: iconSize }), children, iconRight && !isLoading && jsx(Icon, { name: iconRight, ariaLabel: iconRight, size: iconSize }), isLoading && iconRight && (jsx(Icon, { name: "indico-o", style: { animation: 'spin 1s linear infinite' }, size: iconSize }))] })));
|
|
5078
5080
|
});
|
|
5079
5081
|
|
|
5080
5082
|
var l;function r$1(e,t){return e[t]}function i(e=[],t,n=0){return [...e.slice(0,n),t,...e.slice(n)]}function s(e=[],t,n="id"){const o=e.slice(),a=r$1(t,n);return a?o.splice(o.findIndex((e=>r$1(e,n)===a)),1):o.splice(o.findIndex((e=>e===t)),1),o}function d(e){return e.map(((e,t)=>{const n=Object.assign(Object.assign({},e),{sortable:e.sortable||!!e.sortFunction||void 0});return e.id||(n.id=t+1),n}))}function c(e,t){return Math.ceil(e/t)}function g(e,t){return Math.min(e,t)}!function(e){e.ASC="asc",e.DESC="desc";}(l||(l={}));const u=()=>null;function p(e,t=[],n=[]){let o={},a=[...n];return t.length&&t.forEach((t=>{if(!t.when||"function"!=typeof t.when)throw new Error('"when" must be defined in the conditional style object and must be function');t.when(e)&&(o=t.style||{},t.classNames&&(a=[...a,...t.classNames]),"function"==typeof t.style&&(o=t.style(e)||{}));})),{conditionalStyle:o,classNames:a.join(" ")}}function b$1(e,t=[],n="id"){const o=r$1(e,n);return o?t.some((e=>r$1(e,n)===o)):t.some((t=>t===e))}function m(e,t){return t?e.findIndex((e=>h$1(e.id,t))):-1}function h$1(e,t){return e==t}function w$1(e,t){const n=!e.toggleOnSelectedRowsChange;switch(t.type){case"SELECT_ALL_ROWS":{const{keyField:n,rows:o,rowCount:a,mergeSelections:l}=t,r=!e.allSelected,i=!e.toggleOnSelectedRowsChange;if(l){const t=r?[...e.selectedRows,...o.filter((t=>!b$1(t,e.selectedRows,n)))]:e.selectedRows.filter((e=>!b$1(e,o,n)));return Object.assign(Object.assign({},e),{allSelected:r,selectedCount:t.length,selectedRows:t,toggleOnSelectedRowsChange:i})}return Object.assign(Object.assign({},e),{allSelected:r,selectedCount:r?a:0,selectedRows:r?o:[],toggleOnSelectedRowsChange:i})}case"SELECT_SINGLE_ROW":{const{keyField:o,row:a,isSelected:l,rowCount:r,singleSelect:d}=t;return d?l?Object.assign(Object.assign({},e),{selectedCount:0,allSelected:!1,selectedRows:[],toggleOnSelectedRowsChange:n}):Object.assign(Object.assign({},e),{selectedCount:1,allSelected:!1,selectedRows:[a],toggleOnSelectedRowsChange:n}):l?Object.assign(Object.assign({},e),{selectedCount:e.selectedRows.length>0?e.selectedRows.length-1:0,allSelected:!1,selectedRows:s(e.selectedRows,a,o),toggleOnSelectedRowsChange:n}):Object.assign(Object.assign({},e),{selectedCount:e.selectedRows.length+1,allSelected:e.selectedRows.length+1===r,selectedRows:i(e.selectedRows,a),toggleOnSelectedRowsChange:n})}case"SELECT_MULTIPLE_ROWS":{const{keyField:o,selectedRows:a,totalRows:l,mergeSelections:r}=t;if(r){const t=[...e.selectedRows,...a.filter((t=>!b$1(t,e.selectedRows,o)))];return Object.assign(Object.assign({},e),{selectedCount:t.length,allSelected:!1,selectedRows:t,toggleOnSelectedRowsChange:n})}return Object.assign(Object.assign({},e),{selectedCount:a.length,allSelected:a.length===l,selectedRows:a,toggleOnSelectedRowsChange:n})}case"CLEAR_SELECTED_ROWS":{const{selectedRowsFlag:n}=t;return Object.assign(Object.assign({},e),{allSelected:!1,selectedCount:0,selectedRows:[],selectedRowsFlag:n})}case"SORT_CHANGE":{const{sortDirection:o,selectedColumn:a,clearSelectedOnSort:l}=t;return Object.assign(Object.assign(Object.assign({},e),{selectedColumn:a,sortDirection:o,currentPage:1}),l&&{allSelected:!1,selectedCount:0,selectedRows:[],toggleOnSelectedRowsChange:n})}case"CHANGE_PAGE":{const{page:o,paginationServer:a,visibleOnly:l,persistSelectedOnPageChange:r}=t,i=a&&r,s=a&&!r||l;return Object.assign(Object.assign(Object.assign(Object.assign({},e),{currentPage:o}),i&&{allSelected:!1}),s&&{allSelected:!1,selectedCount:0,selectedRows:[],toggleOnSelectedRowsChange:n})}case"CHANGE_ROWS_PER_PAGE":{const{rowsPerPage:n,page:o}=t;return Object.assign(Object.assign({},e),{currentPage:o,rowsPerPage:n})}}}const f=css`
|
|
@@ -5461,32 +5463,32 @@ var l;function r$1(e,t){return e[t]}function i(e=[],t,n=0){return [...e.slice(0,
|
|
|
5461
5463
|
margin: 0 4px;
|
|
5462
5464
|
`;var Me=React.memo((function({rowsPerPage:t,rowCount:n,currentPage:o,direction:a=ke.direction,paginationRowsPerPageOptions:l=ke.paginationRowsPerPageOptions,paginationIconLastPage:r=ke.paginationIconLastPage,paginationIconFirstPage:i=ke.paginationIconFirstPage,paginationIconNext:s=ke.paginationIconNext,paginationIconPrevious:d=ke.paginationIconPrevious,paginationComponentOptions:g=ke.paginationComponentOptions,onChangeRowsPerPage:u=ke.onChangeRowsPerPage,onChangePage:p=ke.onChangePage}){const b=(()=>{const t="object"==typeof window;function n(){return {width:t?window.innerWidth:void 0,height:t?window.innerHeight:void 0}}const[o,a]=React.useState(n);return React.useEffect((()=>{if(!t)return ()=>null;function e(){a(n());}return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[]),o})(),m=le(a),h=b.width&&b.width>599,w=c(n,t),f=o*t,x=f-t+1,C=1===o,y=o===w,R=Object.assign(Object.assign({},Pe),g),v=o===w?`${x}-${n} ${R.rangeSeparatorText} ${n}`:`${x}-${f} ${R.rangeSeparatorText} ${n}`,S=React.useCallback((()=>p(o-1)),[o,p]),E=React.useCallback((()=>p(o+1)),[o,p]),O=React.useCallback((()=>p(1)),[p]),$=React.useCallback((()=>p(c(n,t))),[p,n,t]),k=React.useCallback((e=>u(Number(e.target.value),o)),[o,u]),P=l.map((t=>React.createElement("option",{key:t,value:t},t)));R.selectAllRowsItem&&P.push(React.createElement("option",{key:-1,value:n},R.selectAllRowsItemText));const D=React.createElement($e,{onChange:k,defaultValue:t,"aria-label":R.rowsPerPageText},P);return React.createElement(De,{className:"rdt_Pagination"},!R.noRowsPerPage&&h&&React.createElement(React.Fragment,null,React.createElement(Te,null,R.rowsPerPageText),D),h&&React.createElement(Ie,null,v),React.createElement(Fe,null,React.createElement(He,{id:"pagination-first-page",type:"button","aria-label":"First Page","aria-disabled":C,onClick:O,disabled:C,$isRTL:m},i),React.createElement(He,{id:"pagination-previous-page",type:"button","aria-label":"Previous Page","aria-disabled":C,onClick:S,disabled:C,$isRTL:m},d),!R.noRowsPerPage&&!h&&D,React.createElement(He,{id:"pagination-next-page",type:"button","aria-label":"Next Page","aria-disabled":y,onClick:E,disabled:y,$isRTL:m},s),React.createElement(He,{id:"pagination-last-page",type:"button","aria-label":"Last Page","aria-disabled":y,onClick:$,disabled:y,$isRTL:m},r)))}));const Le=(t,n)=>{const o=React.useRef(!0);React.useEffect((()=>{o.current?o.current=!1:t();}),n);};function Ae(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var _e=function(e){return function(e){return !!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return "[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===Ne}(e)}(e)};var Ne="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function ze(e,t){return !1!==t.clone&&t.isMergeableObject(e)?Ue((n=e,Array.isArray(n)?[]:{}),e,t):e;var n;}function We(e,t,n){return e.concat(t).map((function(e){return ze(e,n)}))}function Be(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return Object.propertyIsEnumerable.call(e,t)})):[]}(e))}function Ge(e,t){try{return t in e}catch(e){return !1}}function Ve(e,t,n){var o={};return n.isMergeableObject(e)&&Be(e).forEach((function(t){o[t]=ze(e[t],n);})),Be(t).forEach((function(a){(function(e,t){return Ge(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,a)||(Ge(e,a)&&n.isMergeableObject(t[a])?o[a]=function(e,t){if(!t.customMerge)return Ue;var n=t.customMerge(e);return "function"==typeof n?n:Ue}(a,n)(e[a],t[a],n):o[a]=ze(t[a],n));})),o}function Ue(e,t,n){(n=n||{}).arrayMerge=n.arrayMerge||We,n.isMergeableObject=n.isMergeableObject||_e,n.cloneUnlessOtherwiseSpecified=ze;var o=Array.isArray(t);return o===Array.isArray(e)?o?n.arrayMerge(e,t,n):Ve(e,t,n):ze(t,n)}Ue.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,n){return Ue(e,n,t)}),{})};var Ye=Ae(Ue);const Ke={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.54)",disabled:"rgba(0, 0, 0, 0.38)"},background:{default:"#FFFFFF"},context:{background:"#e3f2fd",text:"rgba(0, 0, 0, 0.87)"},divider:{default:"rgba(0,0,0,.12)"},button:{default:"rgba(0,0,0,.54)",focus:"rgba(0,0,0,.12)",hover:"rgba(0,0,0,.12)",disabled:"rgba(0, 0, 0, .18)"},selected:{default:"#e3f2fd",text:"rgba(0, 0, 0, 0.87)"},highlightOnHover:{default:"#EEEEEE",text:"rgba(0, 0, 0, 0.87)"},striped:{default:"#FAFAFA",text:"rgba(0, 0, 0, 0.87)"}},qe={default:Ke,light:Ke,dark:{text:{primary:"#FFFFFF",secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(0,0,0,.12)"},background:{default:"#424242"},context:{background:"#E91E63",text:"#FFFFFF"},divider:{default:"rgba(81, 81, 81, 1)"},button:{default:"#FFFFFF",focus:"rgba(255, 255, 255, .54)",hover:"rgba(255, 255, 255, .12)",disabled:"rgba(255, 255, 255, .18)"},selected:{default:"rgba(0, 0, 0, .7)",text:"#FFFFFF"},highlightOnHover:{default:"rgba(0, 0, 0, .7)",text:"#FFFFFF"},striped:{default:"rgba(0, 0, 0, .87)",text:"#FFFFFF"}}};function Qe(t,n,o,a){const[r,i]=React.useState((()=>d(t))),[s,c]=React.useState(""),g=React.useRef("");Le((()=>{i(d(t));}),[t]);const u=React.useCallback((e=>{var t,n,o;const{attributes:a}=e.target,l=null===(t=a.getNamedItem("data-column-id"))||void 0===t?void 0:t.value;l&&(g.current=(null===(o=null===(n=r[m(r,l)])||void 0===n?void 0:n.id)||void 0===o?void 0:o.toString())||"",c(g.current));}),[r]),p=React.useCallback((e=>{var t;const{attributes:o}=e.target,a=null===(t=o.getNamedItem("data-column-id"))||void 0===t?void 0:t.value;if(a&&g.current&&a!==g.current){const e=m(r,g.current),t=m(r,a),o=[...r];o[e]=r[t],o[t]=r[e],i(o),n(o);}}),[n,r]),b=React.useCallback((e=>{e.preventDefault();}),[]),h=React.useCallback((e=>{e.preventDefault();}),[]),w=React.useCallback((e=>{e.preventDefault(),g.current="",c("");}),[]),f=function(e=!1){return e?l.ASC:l.DESC}(a),x=React.useMemo((()=>r[m(r,null==o?void 0:o.toString())]||{}),[o,r]);return {tableColumns:r,draggingColumnId:s,handleDragStart:u,handleDragEnter:p,handleDragOver:b,handleDragLeave:h,handleDragEnd:w,defaultSortDirection:f,defaultSortColumn:x}}var Xe=React.memo((function(t){const{data:n=ke.data,columns:o=ke.columns,title:i=ke.title,actions:s=ke.actions,keyField:d=ke.keyField,striped:u=ke.striped,highlightOnHover:p=ke.highlightOnHover,pointerOnHover:m=ke.pointerOnHover,dense:h=ke.dense,selectableRows:f=ke.selectableRows,selectableRowsSingle:C=ke.selectableRowsSingle,selectableRowsHighlight:v=ke.selectableRowsHighlight,selectableRowsNoSelectAll:S=ke.selectableRowsNoSelectAll,selectableRowsVisibleOnly:E=ke.selectableRowsVisibleOnly,selectableRowSelected:O=ke.selectableRowSelected,selectableRowDisabled:k=ke.selectableRowDisabled,selectableRowsComponent:P=ke.selectableRowsComponent,selectableRowsComponentProps:D=ke.selectableRowsComponentProps,onRowExpandToggled:H=ke.onRowExpandToggled,onSelectedRowsChange:F=ke.onSelectedRowsChange,expandableIcon:j=ke.expandableIcon,onChangeRowsPerPage:I=ke.onChangeRowsPerPage,onChangePage:T=ke.onChangePage,paginationServer:M=ke.paginationServer,paginationServerOptions:L=ke.paginationServerOptions,paginationTotalRows:A=ke.paginationTotalRows,paginationDefaultPage:_=ke.paginationDefaultPage,paginationResetDefaultPage:N=ke.paginationResetDefaultPage,paginationPerPage:z=ke.paginationPerPage,paginationRowsPerPageOptions:W=ke.paginationRowsPerPageOptions,paginationIconLastPage:B=ke.paginationIconLastPage,paginationIconFirstPage:G=ke.paginationIconFirstPage,paginationIconNext:V=ke.paginationIconNext,paginationIconPrevious:U=ke.paginationIconPrevious,paginationComponent:Y=ke.paginationComponent,paginationComponentOptions:K=ke.paginationComponentOptions,responsive:J=ke.responsive,progressPending:Q=ke.progressPending,progressComponent:X=ke.progressComponent,persistTableHead:Z=ke.persistTableHead,noDataComponent:ee=ke.noDataComponent,disabled:te=ke.disabled,noTableHead:oe=ke.noTableHead,noHeader:le=ke.noHeader,fixedHeader:re=ke.fixedHeader,fixedHeaderScrollHeight:ie=ke.fixedHeaderScrollHeight,pagination:se=ke.pagination,subHeader:de=ke.subHeader,subHeaderAlign:ce=ke.subHeaderAlign,subHeaderWrap:ge=ke.subHeaderWrap,subHeaderComponent:ue=ke.subHeaderComponent,noContextMenu:be=ke.noContextMenu,contextMessage:me=ke.contextMessage,contextActions:he=ke.contextActions,contextComponent:Se=ke.contextComponent,expandableRows:Ee=ke.expandableRows,onRowClicked:Oe=ke.onRowClicked,onRowDoubleClicked:$e=ke.onRowDoubleClicked,onRowMouseEnter:Pe=ke.onRowMouseEnter,onRowMouseLeave:De=ke.onRowMouseLeave,sortIcon:He=ke.sortIcon,onSort:Fe=ke.onSort,sortFunction:je=ke.sortFunction,sortServer:Ie=ke.sortServer,expandableRowsComponent:Te=ke.expandableRowsComponent,expandableRowsComponentProps:Ae=ke.expandableRowsComponentProps,expandableRowDisabled:_e=ke.expandableRowDisabled,expandableRowsHideExpander:Ne=ke.expandableRowsHideExpander,expandOnRowClicked:ze=ke.expandOnRowClicked,expandOnRowDoubleClicked:We=ke.expandOnRowDoubleClicked,expandableRowExpanded:Be=ke.expandableRowExpanded,expandableInheritConditionalStyles:Ge=ke.expandableInheritConditionalStyles,defaultSortFieldId:Ve=ke.defaultSortFieldId,defaultSortAsc:Ue=ke.defaultSortAsc,clearSelectedRows:Ke=ke.clearSelectedRows,conditionalRowStyles:Je=ke.conditionalRowStyles,theme:Xe=ke.theme,customStyles:Ze=ke.customStyles,direction:et=ke.direction,onColumnOrderChange:tt=ke.onColumnOrderChange,className:nt}=t,{tableColumns:ot,draggingColumnId:at,handleDragStart:lt,handleDragEnter:rt,handleDragOver:it,handleDragLeave:st,handleDragEnd:dt,defaultSortDirection:ct,defaultSortColumn:gt}=Qe(o,tt,Ve,Ue),[{rowsPerPage:ut,currentPage:pt,selectedRows:bt,allSelected:mt,selectedCount:ht,selectedColumn:wt,sortDirection:ft,toggleOnSelectedRowsChange:xt},Ct]=React.useReducer(w$1,{allSelected:!1,selectedCount:0,selectedRows:[],selectedColumn:gt,toggleOnSelectedRowsChange:!1,sortDirection:ct,currentPage:_,rowsPerPage:z,selectedRowsFlag:!1,contextMessage:ke.contextMessage}),{persistSelectedOnSort:yt=!1,persistSelectedOnPageChange:Rt=!1}=L,vt=!(!M||!Rt&&!yt),St=se&&!Q&&n.length>0,Et=Y||Me,Ot=React.useMemo((()=>((e={},t="default",n="default")=>{const o=qe[t]?t:n;return Ye({table:{style:{color:(a=qe[o]).text.primary,backgroundColor:a.background.default}},tableWrapper:{style:{display:"table"}},responsiveWrapper:{style:{}},header:{style:{fontSize:"22px",color:a.text.primary,backgroundColor:a.background.default,minHeight:"56px",paddingLeft:"16px",paddingRight:"8px"}},subHeader:{style:{backgroundColor:a.background.default,minHeight:"52px"}},head:{style:{color:a.text.primary,fontSize:"12px",fontWeight:500}},headRow:{style:{backgroundColor:a.background.default,minHeight:"52px",borderBottomWidth:"1px",borderBottomColor:a.divider.default,borderBottomStyle:"solid"},denseStyle:{minHeight:"32px"}},headCells:{style:{paddingLeft:"16px",paddingRight:"16px"},draggingStyle:{cursor:"move"}},contextMenu:{style:{backgroundColor:a.context.background,fontSize:"18px",fontWeight:400,color:a.context.text,paddingLeft:"16px",paddingRight:"8px",transform:"translate3d(0, -100%, 0)",transitionDuration:"125ms",transitionTimingFunction:"cubic-bezier(0, 0, 0.2, 1)",willChange:"transform"},activeStyle:{transform:"translate3d(0, 0, 0)"}},cells:{style:{paddingLeft:"16px",paddingRight:"16px",wordBreak:"break-word"},draggingStyle:{}},rows:{style:{fontSize:"13px",fontWeight:400,color:a.text.primary,backgroundColor:a.background.default,minHeight:"48px","&:not(:last-of-type)":{borderBottomStyle:"solid",borderBottomWidth:"1px",borderBottomColor:a.divider.default}},denseStyle:{minHeight:"32px"},selectedHighlightStyle:{"&:nth-of-type(n)":{color:a.selected.text,backgroundColor:a.selected.default,borderBottomColor:a.background.default}},highlightOnHoverStyle:{color:a.highlightOnHover.text,backgroundColor:a.highlightOnHover.default,transitionDuration:"0.15s",transitionProperty:"background-color",borderBottomColor:a.background.default,outlineStyle:"solid",outlineWidth:"1px",outlineColor:a.background.default},stripedStyle:{color:a.striped.text,backgroundColor:a.striped.default}},expanderRow:{style:{color:a.text.primary,backgroundColor:a.background.default}},expanderCell:{style:{flex:"0 0 48px"}},expanderButton:{style:{color:a.button.default,fill:a.button.default,backgroundColor:"transparent",borderRadius:"2px",transition:"0.25s",height:"100%",width:"100%","&:hover:enabled":{cursor:"pointer"},"&:disabled":{color:a.button.disabled},"&:hover:not(:disabled)":{cursor:"pointer",backgroundColor:a.button.hover},"&:focus":{outline:"none",backgroundColor:a.button.focus},svg:{margin:"auto"}}},pagination:{style:{color:a.text.secondary,fontSize:"13px",minHeight:"56px",backgroundColor:a.background.default,borderTopStyle:"solid",borderTopWidth:"1px",borderTopColor:a.divider.default},pageButtonsStyle:{borderRadius:"50%",height:"40px",width:"40px",padding:"8px",margin:"px",cursor:"pointer",transition:"0.4s",color:a.button.default,fill:a.button.default,backgroundColor:"transparent","&:disabled":{cursor:"unset",color:a.button.disabled,fill:a.button.disabled},"&:hover:not(:disabled)":{backgroundColor:a.button.hover},"&:focus":{outline:"none",backgroundColor:a.button.focus}}},noData:{style:{display:"flex",alignItems:"center",justifyContent:"center",color:a.text.primary,backgroundColor:a.background.default}},progress:{style:{display:"flex",alignItems:"center",justifyContent:"center",color:a.text.primary,backgroundColor:a.background.default}}},e);var a;})(Ze,Xe)),[Ze,Xe]),$t=React.useMemo((()=>Object.assign({},"auto"!==et&&{dir:et})),[et]),kt=React.useMemo((()=>{if(Ie)return n;if((null==wt?void 0:wt.sortFunction)&&"function"==typeof wt.sortFunction){const e=wt.sortFunction,t=ft===l.ASC?e:(t,n)=>-1*e(t,n);return [...n].sort(t)}return function(e,t,n,o){return t?o&&"function"==typeof o?o(e.slice(0),t,n):e.slice(0).sort(((e,o)=>{const a=t(e),l=t(o);if("asc"===n){if(a<l)return -1;if(a>l)return 1}if("desc"===n){if(a>l)return -1;if(a<l)return 1}return 0})):e}(n,null==wt?void 0:wt.selector,ft,je)}),[Ie,wt,ft,n,je]),Pt=React.useMemo((()=>{if(se&&!M){const e=pt*ut,t=e-ut;return kt.slice(t,e)}return kt}),[pt,se,M,ut,kt]),Dt=React.useCallback((e=>{Ct(e);}),[]),Ht=React.useCallback((e=>{Ct(e);}),[]),Ft=React.useCallback((e=>{Ct(e);}),[]),jt=React.useCallback(((e,t)=>Oe(e,t)),[Oe]),It=React.useCallback(((e,t)=>$e(e,t)),[$e]),Tt=React.useCallback(((e,t)=>Pe(e,t)),[Pe]),Mt=React.useCallback(((e,t)=>De(e,t)),[De]),Lt=React.useCallback((e=>Ct({type:"CHANGE_PAGE",page:e,paginationServer:M,visibleOnly:E,persistSelectedOnPageChange:Rt})),[M,Rt,E]),At=React.useCallback((e=>{const t=c(A||Pt.length,e),n=g(pt,t);M||Lt(n),Ct({type:"CHANGE_ROWS_PER_PAGE",page:n,rowsPerPage:e});}),[pt,Lt,M,A,Pt.length]);if(se&&!M&&kt.length>0&&0===Pt.length){const e=c(kt.length,ut),t=g(pt,e);Lt(t);}Le((()=>{F({allSelected:mt,selectedCount:ht,selectedRows:bt.slice(0)});}),[xt]),Le((()=>{Fe(wt,ft,kt.slice(0));}),[wt,ft]),Le((()=>{T(pt,A||kt.length);}),[pt]),Le((()=>{I(ut,pt);}),[ut]),Le((()=>{Lt(_);}),[_,N]),Le((()=>{if(se&&M&&A>0){const e=c(A,ut),t=g(pt,e);pt!==t&&Lt(t);}}),[A]),React.useEffect((()=>{Ct({type:"CLEAR_SELECTED_ROWS",selectedRowsFlag:Ke});}),[C,Ke]),React.useEffect((()=>{if(!O)return;const e=kt.filter((e=>O(e))),t=C?e.slice(0,1):e;Ct({type:"SELECT_MULTIPLE_ROWS",keyField:d,selectedRows:t,totalRows:kt.length,mergeSelections:vt});}),[n,O]);const _t=E?Pt:kt,Nt=Rt||C||S;return React.createElement(ThemeProvider,{theme:Ot},!le&&(!!i||!!s)&&React.createElement(pe,{title:i,actions:s,showMenu:!be,selectedCount:ht,direction:et,contextActions:he,contextComponent:Se,contextMessage:me}),de&&React.createElement(we,{align:ce,wrapContent:ge},ue),React.createElement(xe,Object.assign({$responsive:J,$fixedHeader:re,$fixedHeaderScrollHeight:ie,className:nt},$t),React.createElement(ye,null,Q&&!Z&&React.createElement(Ce,null,X),React.createElement(x$1,{disabled:te,className:"rdt_Table",role:"table"},!oe&&(!!Z||kt.length>0&&!Q)&&React.createElement(y$1,{className:"rdt_TableHead",role:"rowgroup",$fixedHeader:re},React.createElement(R$1,{className:"rdt_TableHeadRow",role:"row",$dense:h},f&&(Nt?React.createElement($$2,{style:{flex:"0 0 48px"}}):React.createElement(ae,{allSelected:mt,selectedRows:bt,selectableRowsComponent:P,selectableRowsComponentProps:D,selectableRowDisabled:k,rowData:_t,keyField:d,mergeSelections:vt,onSelectAllRows:Ht})),Ee&&!Ne&&React.createElement(Re,null),ot.map((t=>React.createElement(ne,{key:t.id,column:t,selectedColumn:wt,disabled:Q||0===kt.length,pagination:se,paginationServer:M,persistSelectedOnSort:yt,selectableRowsVisibleOnly:E,sortDirection:ft,sortIcon:He,sortServer:Ie,onSort:Dt,onDragStart:lt,onDragOver:it,onDragEnd:dt,onDragEnter:rt,onDragLeave:st,draggingColumnId:at}))))),!kt.length&&!Q&&React.createElement(ve,null,ee),Q&&Z&&React.createElement(Ce,null,X),!Q&&kt.length>0&&React.createElement(fe,{className:"rdt_TableBody",role:"rowgroup"},Pt.map(((t,n)=>{const o=r$1(t,d),a=function(e=""){return "number"!=typeof e&&(!e||0===e.length)}(o)?n:o,l=b$1(t,bt,d),i=!!(Ee&&Be&&Be(t)),s=!!(Ee&&_e&&_e(t));return React.createElement(q$1,{id:a,key:a,keyField:d,"data-row-id":a,columns:ot,row:t,rowCount:kt.length,rowIndex:n,selectableRows:f,expandableRows:Ee,expandableIcon:j,highlightOnHover:p,pointerOnHover:m,dense:h,expandOnRowClicked:ze,expandOnRowDoubleClicked:We,expandableRowsComponent:Te,expandableRowsComponentProps:Ae,expandableRowsHideExpander:Ne,defaultExpanderDisabled:s,defaultExpanded:i,expandableInheritConditionalStyles:Ge,conditionalRowStyles:Je,selected:l,selectableRowsHighlight:v,selectableRowsComponent:P,selectableRowsComponentProps:D,selectableRowDisabled:k,selectableRowsSingle:C,striped:u,onRowExpandToggled:H,onRowClicked:jt,onRowDoubleClicked:It,onRowMouseEnter:Tt,onRowMouseLeave:Mt,onSelectedRow:Ft,draggingColumnId:at,onDragStart:lt,onDragOver:it,onDragEnd:dt,onDragEnter:rt,onDragLeave:st})})))))),St&&React.createElement("div",null,React.createElement(Et,{onChangePage:Lt,onChangeRowsPerPage:At,rowCount:A||kt.length,currentPage:pt,rowsPerPage:ut,direction:et,paginationRowsPerPageOptions:W,paginationIconLastPage:B,paginationIconFirstPage:G,paginationIconNext:V,paginationIconPrevious:U,paginationComponentOptions:K})))}));
|
|
5463
5465
|
|
|
5464
|
-
const
|
|
5465
|
-
|
|
5466
|
+
const DisplayFormError = (_a) => {
|
|
5467
|
+
var { message } = _a, rest = __rest(_a, ["message"]);
|
|
5468
|
+
return (jsx("p", Object.assign({ className: "form-errors" }, rest, { children: message })));
|
|
5466
5469
|
};
|
|
5467
5470
|
|
|
5471
|
+
const DEFAULT_TEXT$c = {
|
|
5472
|
+
required: '(required)',
|
|
5473
|
+
};
|
|
5468
5474
|
const Label = ({ label, name, isRequired }) => {
|
|
5469
5475
|
return (jsx("div", { "data-testid": `${name}-testId`, className: `form-label`, children: jsxs("label", { htmlFor: `${name}`, children: [label, isRequired ? jsx("span", { className: "text-error", children: " *" }) : ''] }) }));
|
|
5470
5476
|
};
|
|
5471
5477
|
// HOC to add common label functionality to components
|
|
5472
5478
|
function withLabel(WrappedComponent) {
|
|
5473
5479
|
const WithLabelComponent = (_a, ref) => {
|
|
5474
|
-
var { label, hasHiddenLabel = false, name, isRequired } = _a, rest = __rest(_a, ["label", "hasHiddenLabel", "name", "isRequired"]);
|
|
5480
|
+
var { label, hasHiddenLabel = false, name, isRequired, text: textProp } = _a, rest = __rest(_a, ["label", "hasHiddenLabel", "name", "isRequired", "text"]);
|
|
5481
|
+
const text = Object.assign(Object.assign({}, DEFAULT_TEXT$c), textProp);
|
|
5475
5482
|
const ariaLabel = hasHiddenLabel
|
|
5476
|
-
? { 'aria-label': isRequired ? `${label}
|
|
5483
|
+
? { 'aria-label': isRequired ? `${label} ${text.required}` : label }
|
|
5477
5484
|
: {};
|
|
5478
|
-
return (jsxs("div", { className: "form-control", children: [!hasHiddenLabel && jsx(Label, { label: label, name: name, isRequired: isRequired }), jsx(WrappedComponent, Object.assign({}, rest, { id: name, name: name }, ariaLabel, { ref: ref }))] }));
|
|
5485
|
+
return (jsxs("div", { className: "form-control", children: [!hasHiddenLabel && jsx(Label, { label: label, name: name, isRequired: isRequired }), jsx(WrappedComponent, Object.assign({}, rest, { id: name, name: name }, ariaLabel, { text: textProp, ref: ref }))] }));
|
|
5479
5486
|
};
|
|
5480
5487
|
return forwardRef(WithLabelComponent);
|
|
5481
5488
|
}
|
|
5482
5489
|
|
|
5483
|
-
const DisplayFormError = (_a) => {
|
|
5484
|
-
var { message } = _a, rest = __rest(_a, ["message"]);
|
|
5485
|
-
return (jsx("p", Object.assign({ className: "form-errors" }, rest, { children: message })));
|
|
5486
|
-
};
|
|
5487
|
-
|
|
5488
5490
|
const Input = React__default.forwardRef((_a, ref) => {
|
|
5489
|
-
var { id, name, placeholder, isRequired, isDisabled, readonly, isClearable, errorMessage, helpText, maxLength, iconName, tabIndex, onChange, onBlur, onKeyDown, className } = _a, rest = __rest(_a, ["id", "name", "placeholder", "isRequired", "isDisabled", "readonly", "isClearable", "errorMessage", "helpText", "maxLength", "iconName", "tabIndex", "onChange", "onBlur", "onKeyDown", "className"]);
|
|
5491
|
+
var { id, name, placeholder, isRequired, isDisabled, readonly, isClearable, errorMessage, helpText, maxLength, iconName, tabIndex, onChange, onBlur, onKeyDown, className, text: _text } = _a, rest = __rest(_a, ["id", "name", "placeholder", "isRequired", "isDisabled", "readonly", "isClearable", "errorMessage", "helpText", "maxLength", "iconName", "tabIndex", "onChange", "onBlur", "onKeyDown", "className", "text"]);
|
|
5490
5492
|
const hasErrors = errorMessage && errorMessage.length > 0;
|
|
5491
5493
|
const handleClear = () => {
|
|
5492
5494
|
onChange === null || onChange === void 0 ? void 0 : onChange({ target: { value: '' } });
|
|
@@ -5500,10 +5502,17 @@ const Input = React__default.forwardRef((_a, ref) => {
|
|
|
5500
5502
|
});
|
|
5501
5503
|
const LabeledInput = withLabel(Input);
|
|
5502
5504
|
|
|
5505
|
+
const DEFAULT_TEXT$b = {
|
|
5506
|
+
previousPage: 'Previous Page',
|
|
5507
|
+
nextPage: 'Next Page',
|
|
5508
|
+
currentPage: 'Current Page',
|
|
5509
|
+
of: 'of',
|
|
5510
|
+
};
|
|
5503
5511
|
const Pagination = (_a) => {
|
|
5504
|
-
var { totalPages, currentPage = 1, onChange, className } = _a, rest = __rest(_a, ["totalPages", "currentPage", "onChange", "className"]);
|
|
5512
|
+
var { totalPages, currentPage = 1, onChange, className, text: textProp } = _a, rest = __rest(_a, ["totalPages", "currentPage", "onChange", "className", "text"]);
|
|
5513
|
+
const text = Object.assign(Object.assign({}, DEFAULT_TEXT$b), textProp);
|
|
5505
5514
|
const [inputValue, setInputValue] = useState(currentPage.toString());
|
|
5506
|
-
const totalPagesText =
|
|
5515
|
+
const totalPagesText = `${text.of} ${totalPages}`;
|
|
5507
5516
|
const classes = classNames('pagination', className);
|
|
5508
5517
|
useEffect(() => {
|
|
5509
5518
|
setInputValue(currentPage.toString());
|
|
@@ -5535,9 +5544,9 @@ const Pagination = (_a) => {
|
|
|
5535
5544
|
const isNextButtonDisabled = currentPage === totalPages;
|
|
5536
5545
|
const isPreviousButtonDisabled = currentPage === 1;
|
|
5537
5546
|
const hasError = Number(inputValue) > totalPages || Number(inputValue) < 1;
|
|
5538
|
-
return (jsx("div", Object.assign({ className: classes }, rest, { children: jsx(Container, { children: jsxs(Row, { gutterWidth: 12, align: "center", children: [jsx(Col, { xs: "content", children: jsx("div", { className: "pagination__previous", children: jsx(Button$1, { "data-testid": "pagination-previous-button", ariaLabel:
|
|
5547
|
+
return (jsx("div", Object.assign({ className: classes }, rest, { children: jsx(Container, { children: jsxs(Row, { gutterWidth: 12, align: "center", children: [jsx(Col, { xs: "content", children: jsx("div", { className: "pagination__previous", children: jsx(Button$1, { "data-testid": "pagination-previous-button", ariaLabel: text.previousPage, variant: "link", onClick: handlePreviousPage, iconLeft: "chevron-left", size: "sm", isDisabled: isPreviousButtonDisabled || totalPages === 0 }) }) }), jsx(Col, { xs: "content", children: jsx("div", { className: "pagination__current-page", children: jsx(LabeledInput, { "data-testid": "pagination-current-page-input", className: classNames('pagination__current-page-input', {
|
|
5539
5548
|
'has-error': hasError,
|
|
5540
|
-
}), value: totalPages === 0 ? '0' : inputValue, name: "currentPage", label:
|
|
5549
|
+
}), value: totalPages === 0 ? '0' : inputValue, name: "currentPage", label: text.currentPage, hasHiddenLabel: true, onKeyDown: (e) => {
|
|
5541
5550
|
if (e.key === 'Enter') {
|
|
5542
5551
|
validateAndUpdatePage(e.currentTarget.value);
|
|
5543
5552
|
}
|
|
@@ -5547,7 +5556,7 @@ const Pagination = (_a) => {
|
|
|
5547
5556
|
if (value === '' || /^\d*$/.test(value)) {
|
|
5548
5557
|
setInputValue(value);
|
|
5549
5558
|
}
|
|
5550
|
-
}, onBlur: (e) => validateAndUpdatePage(e.currentTarget.value) }) }) }), jsx(Col, { xs: "content", children: jsx("p", { className: "pagination__page-total", children: totalPagesText }) }), jsx(Col, { xs: "content", children: jsx("div", { className: "pagination__next", children: jsx(Button$1, { "data-testid": "pagination-next-button", ariaLabel:
|
|
5559
|
+
}, onBlur: (e) => validateAndUpdatePage(e.currentTarget.value) }) }) }), jsx(Col, { xs: "content", children: jsx("p", { className: "pagination__page-total", children: totalPagesText }) }), jsx(Col, { xs: "content", children: jsx("div", { className: "pagination__next", children: jsx(Button$1, { "data-testid": "pagination-next-button", ariaLabel: text.nextPage, variant: "link", onClick: handleNextPage, iconLeft: "chevron-right", isDisabled: isNextButtonDisabled || totalPages === 0, size: "sm" }) }) })] }) }) })));
|
|
5551
5560
|
};
|
|
5552
5561
|
|
|
5553
5562
|
const TablePagination$1 = ({ rowsPerPage, rowCount, onChangePage, currentPage, totalEntriesText, }) => {
|
|
@@ -5632,7 +5641,12 @@ const clearStickyStyles = (header) => {
|
|
|
5632
5641
|
header.style.backgroundColor = '';
|
|
5633
5642
|
};
|
|
5634
5643
|
|
|
5635
|
-
const
|
|
5644
|
+
const DEFAULT_TEXT$a = {
|
|
5645
|
+
unpinColumn: 'Unpin column',
|
|
5646
|
+
pinColumn: 'Pin column',
|
|
5647
|
+
};
|
|
5648
|
+
const HorizontalStickyHeader = ({ children, position, onPinColumn, isPinned = false, pinnedColumnIds, text: textProp, }) => {
|
|
5649
|
+
const text = Object.assign(Object.assign({}, DEFAULT_TEXT$a), textProp);
|
|
5636
5650
|
useEffect(() => {
|
|
5637
5651
|
const calculateWidth = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
5638
5652
|
yield new Promise((resolve) => setTimeout(resolve, 0));
|
|
@@ -5649,14 +5663,14 @@ const HorizontalStickyHeader = ({ children, position, onPinColumn, isPinned = fa
|
|
|
5649
5663
|
});
|
|
5650
5664
|
calculateWidth();
|
|
5651
5665
|
}, [position, isPinned, pinnedColumnIds]);
|
|
5652
|
-
return (jsxs("div", { className: "table__header-cell", "data-testid": `sticky-column-${position}`, children: [jsx(Button$1, { "data-testid": `sticky-header-pin-button-${position}`, variant: "link", size: "sm", iconLeft: "pin", onClick: () => onPinColumn === null || onPinColumn === void 0 ? void 0 : onPinColumn(`sticky-column-${position}`), ariaLabel: isPinned ?
|
|
5666
|
+
return (jsxs("div", { className: "table__header-cell", "data-testid": `sticky-column-${position}`, children: [jsx(Button$1, { "data-testid": `sticky-header-pin-button-${position}`, variant: "link", size: "sm", iconLeft: "pin", onClick: () => onPinColumn === null || onPinColumn === void 0 ? void 0 : onPinColumn(`sticky-column-${position}`), ariaLabel: isPinned ? text.unpinColumn : text.pinColumn, className: `table__column--${isPinned ? 'is-pinned' : 'is-not-pinned'} table__column__pin-action` }), jsx("div", { className: "table__header-content", children: children })] }));
|
|
5653
5667
|
};
|
|
5654
5668
|
|
|
5655
|
-
const processColumns = (columns, pinnedColumnIds, togglePinnedColumn) => {
|
|
5669
|
+
const processColumns = (columns, pinnedColumnIds, togglePinnedColumn, text) => {
|
|
5656
5670
|
return columns.map((column, index) => {
|
|
5657
5671
|
const dataColumnId = `sticky-column-${index}`;
|
|
5658
5672
|
const isPinned = pinnedColumnIds.includes(dataColumnId);
|
|
5659
|
-
const headerContent = column.isPinned !== undefined ? (jsx(HorizontalStickyHeader, { position: index, isPinned: isPinned, onPinColumn: () => togglePinnedColumn(column.id), pinnedColumnIds: pinnedColumnIds, children: column.name })) : (jsx(Fragment, { children: column.name }));
|
|
5673
|
+
const headerContent = column.isPinned !== undefined ? (jsx(HorizontalStickyHeader, { position: index, isPinned: isPinned, onPinColumn: () => togglePinnedColumn(column.id), pinnedColumnIds: pinnedColumnIds, text: text, children: column.name })) : (jsx(Fragment, { children: column.name }));
|
|
5660
5674
|
return Object.assign(Object.assign({}, column), { name: headerContent, id: dataColumnId, style: getPinnedColumnStyles(isPinned, index, pinnedColumnIds) });
|
|
5661
5675
|
});
|
|
5662
5676
|
};
|
|
@@ -5665,7 +5679,7 @@ const processColumns = (columns, pinnedColumnIds, togglePinnedColumn) => {
|
|
|
5665
5679
|
* Hook to manage pinned columns in a table
|
|
5666
5680
|
* Handles initialization, toggling, positioning and resizing of pinned columns
|
|
5667
5681
|
*/
|
|
5668
|
-
const usePinnedColumnsManager = (columns, canPinColumns, onPinnedColumnsChange) => {
|
|
5682
|
+
const usePinnedColumnsManager = (columns, canPinColumns, onPinnedColumnsChange, text) => {
|
|
5669
5683
|
const pinnedColumnIds = columns.filter((column) => column.isPinned).map((column) => column.id);
|
|
5670
5684
|
// `dataColumnIds` is the list of IDs used as `data-column-id` attributes on the table headers and cells
|
|
5671
5685
|
const dataColumnIds = useMemo(() => {
|
|
@@ -5772,17 +5786,27 @@ const usePinnedColumnsManager = (columns, canPinColumns, onPinnedColumnsChange)
|
|
|
5772
5786
|
}, [canPinColumns, dataColumnIds]);
|
|
5773
5787
|
// Process columns for rendering with pin state
|
|
5774
5788
|
const columnsWithPinning = canPinColumns
|
|
5775
|
-
? sortPinnedColumns(processColumns(columns, dataColumnIds, togglePinnedColumn), dataColumnIds)
|
|
5789
|
+
? sortPinnedColumns(processColumns(columns, dataColumnIds, togglePinnedColumn, text), dataColumnIds)
|
|
5776
5790
|
: columns;
|
|
5777
5791
|
return {
|
|
5778
5792
|
columnsWithPinning, // Columns with pin state and handlers applied
|
|
5779
5793
|
};
|
|
5780
5794
|
};
|
|
5781
5795
|
|
|
5796
|
+
const LoadingComponent = ({ loadingText }) => {
|
|
5797
|
+
return jsx("div", { className: "table-loading", children: loadingText });
|
|
5798
|
+
};
|
|
5799
|
+
|
|
5800
|
+
const DEFAULT_TEXT$9 = {
|
|
5801
|
+
loading: 'Loading...',
|
|
5802
|
+
unpinColumn: 'Unpin column',
|
|
5803
|
+
pinColumn: 'Pin column',
|
|
5804
|
+
};
|
|
5782
5805
|
const Table = (props) => {
|
|
5783
|
-
const { responsive = true, direction = 'auto', keyField = 'id', striped = false, noDataComponent = 'built-in', isDisabled, isLoading, isFullHeight = false, subHeaderAlign = 'left', className, paginationTotalRows, totalEntriesText, data, columns: initialColumns, canPinColumns = false, onPinnedColumnsChange } = props, rest = __rest(props, ["responsive", "direction", "keyField", "striped", "noDataComponent", "isDisabled", "isLoading", "isFullHeight", "subHeaderAlign", "className", "paginationTotalRows", "totalEntriesText", "data", "columns", "canPinColumns", "onPinnedColumnsChange"]);
|
|
5806
|
+
const { responsive = true, direction = 'auto', keyField = 'id', striped = false, noDataComponent = 'built-in', isDisabled, isLoading, isFullHeight = false, subHeaderAlign = 'left', className, paginationTotalRows, totalEntriesText, data, columns: initialColumns, canPinColumns = false, onPinnedColumnsChange, text: textProp } = props, rest = __rest(props, ["responsive", "direction", "keyField", "striped", "noDataComponent", "isDisabled", "isLoading", "isFullHeight", "subHeaderAlign", "className", "paginationTotalRows", "totalEntriesText", "data", "columns", "canPinColumns", "onPinnedColumnsChange", "text"]);
|
|
5807
|
+
const text = Object.assign(Object.assign({}, DEFAULT_TEXT$9), textProp);
|
|
5784
5808
|
// Turns on/off column pinning.
|
|
5785
|
-
const { columnsWithPinning } = usePinnedColumnsManager(initialColumns, canPinColumns, onPinnedColumnsChange);
|
|
5809
|
+
const { columnsWithPinning } = usePinnedColumnsManager(initialColumns, canPinColumns, onPinnedColumnsChange, { unpinColumn: text.unpinColumn, pinColumn: text.pinColumn });
|
|
5786
5810
|
const combinedClassName = classNames(className, {
|
|
5787
5811
|
'table--striped': striped,
|
|
5788
5812
|
'table-body': true,
|
|
@@ -5790,7 +5814,7 @@ const Table = (props) => {
|
|
|
5790
5814
|
const tableWrapperClassName = classNames('table', {
|
|
5791
5815
|
'table--full-height': isFullHeight,
|
|
5792
5816
|
});
|
|
5793
|
-
return (jsx("div", { className: tableWrapperClassName, "data-testid": "table", children: jsx(Xe, Object.assign({ data: data, columns: columnsWithPinning, responsive: responsive, direction: direction, subHeaderAlign: subHeaderAlign, keyField: keyField, striped: striped, className: combinedClassName, disabled: isDisabled, noDataComponent: noDataComponent, progressPending: isLoading, progressComponent: jsx(LoadingComponent, {}), pagination: true, paginationComponent: (props) => (jsx(TablePagination$1, Object.assign({}, props, { totalEntriesText: totalEntriesText }))), paginationTotalRows: paginationTotalRows, highlightOnHover: true, pointerOnHover: true }, rest)) }));
|
|
5817
|
+
return (jsx("div", { className: tableWrapperClassName, "data-testid": "table", children: jsx(Xe, Object.assign({ data: data, columns: columnsWithPinning, responsive: responsive, direction: direction, subHeaderAlign: subHeaderAlign, keyField: keyField, striped: striped, className: combinedClassName, disabled: isDisabled, noDataComponent: noDataComponent, progressPending: isLoading, progressComponent: jsx(LoadingComponent, { loadingText: text.loading }), pagination: true, paginationComponent: (props) => (jsx(TablePagination$1, Object.assign({}, props, { totalEntriesText: totalEntriesText }))), paginationTotalRows: paginationTotalRows, highlightOnHover: true, pointerOnHover: true }, rest)) }));
|
|
5794
5818
|
};
|
|
5795
5819
|
|
|
5796
5820
|
const Radio = React__default.forwardRef((_a, ref) => {
|
|
@@ -5809,7 +5833,7 @@ const Toggle = React__default.forwardRef((_a, ref) => {
|
|
|
5809
5833
|
});
|
|
5810
5834
|
|
|
5811
5835
|
const Textarea = React__default.forwardRef((_a, ref) => {
|
|
5812
|
-
var { label, name, placeholder, value, onChange, onKeyDown, isRequired, isDisabled, errorMessage, helpText, hasHiddenLabel, rows, cols, readonly, wrap, form, maxLength, autofocus, defaultValue, tabIndex } = _a, rest = __rest(_a, ["label", "name", "placeholder", "value", "onChange", "onKeyDown", "isRequired", "isDisabled", "errorMessage", "helpText", "hasHiddenLabel", "rows", "cols", "readonly", "wrap", "form", "maxLength", "autofocus", "defaultValue", "tabIndex"]);
|
|
5836
|
+
var { label: _label, name, placeholder, value, onChange, onKeyDown, isRequired, isDisabled, errorMessage, helpText, hasHiddenLabel: _hasHiddenLabel, rows, cols, readonly, wrap, form, maxLength, autofocus, defaultValue, tabIndex, text: _text } = _a, rest = __rest(_a, ["label", "name", "placeholder", "value", "onChange", "onKeyDown", "isRequired", "isDisabled", "errorMessage", "helpText", "hasHiddenLabel", "rows", "cols", "readonly", "wrap", "form", "maxLength", "autofocus", "defaultValue", "tabIndex", "text"]);
|
|
5813
5837
|
const hasErrors = errorMessage && errorMessage.length > 0;
|
|
5814
5838
|
const textareaClasses = classNames('textarea', { error: hasErrors });
|
|
5815
5839
|
return (jsxs(Fragment, { children: [jsx("div", { className: "textarea-wrapper", children: jsx("textarea", Object.assign({ ref: ref, rows: rows, cols: cols, autoFocus: autofocus, wrap: wrap, form: form, maxLength: maxLength, readOnly: readonly, "data-testid": `form-textarea-${name}`, name: name, disabled: isDisabled, placeholder: placeholder, onChange: onChange, onKeyDown: onKeyDown, className: textareaClasses, "aria-invalid": hasErrors ? true : undefined, "aria-describedby": hasErrors || helpText ? `${name}-helper` : undefined, "aria-required": isRequired, value: value, defaultValue: defaultValue, tabIndex: tabIndex }, rest)) }), hasErrors && jsx(DisplayFormError, { message: errorMessage }), helpText && (jsx("div", { "data-testid": `${name}-help-text`, className: "help-text", id: `${name}-helper`, children: helpText }))] }));
|
|
@@ -5817,7 +5841,7 @@ const Textarea = React__default.forwardRef((_a, ref) => {
|
|
|
5817
5841
|
const LabeledTextarea = withLabel(Textarea);
|
|
5818
5842
|
|
|
5819
5843
|
const PasswordInput = React__default.forwardRef((_a, ref) => {
|
|
5820
|
-
var { name, placeholder, onChange, onBlur, onKeyDown, isRequired, isDisabled, errorMessage, helpText, hasShowPassword = true } = _a, rest = __rest(_a, ["name", "placeholder", "onChange", "onBlur", "onKeyDown", "isRequired", "isDisabled", "errorMessage", "helpText", "hasShowPassword"]);
|
|
5844
|
+
var { name, placeholder, onChange, onBlur, onKeyDown, isRequired, isDisabled, errorMessage, helpText, hasShowPassword = true, text: _text } = _a, rest = __rest(_a, ["name", "placeholder", "onChange", "onBlur", "onKeyDown", "isRequired", "isDisabled", "errorMessage", "helpText", "hasShowPassword", "text"]);
|
|
5821
5845
|
const hasErrors = errorMessage && errorMessage.length > 0;
|
|
5822
5846
|
const [showPassword, setShowPassword] = useState(false);
|
|
5823
5847
|
const handleShowPassword = () => {
|
|
@@ -5830,18 +5854,25 @@ const PasswordInput = React__default.forwardRef((_a, ref) => {
|
|
|
5830
5854
|
});
|
|
5831
5855
|
const LabeledPasswordInput = withLabel(PasswordInput);
|
|
5832
5856
|
|
|
5857
|
+
const DEFAULT_TEXT$8 = {
|
|
5858
|
+
placeholder: 'Select...',
|
|
5859
|
+
noOptions: 'No options',
|
|
5860
|
+
loading: 'Loading...',
|
|
5861
|
+
required: '(required)',
|
|
5862
|
+
};
|
|
5833
5863
|
const OptionComponent = (_a) => {
|
|
5834
5864
|
var _b, _c, _d;
|
|
5835
5865
|
var props = __rest(_a, []);
|
|
5836
5866
|
return (jsx(components$1.Option, Object.assign({}, props, { children: jsxs("div", { className: "select__items", children: [jsx("div", { className: "select__item-value", children: (_b = props === null || props === void 0 ? void 0 : props.data) === null || _b === void 0 ? void 0 : _b.label }), ((_c = props === null || props === void 0 ? void 0 : props.data) === null || _c === void 0 ? void 0 : _c.detail) && jsx("div", { className: "select__item-detail", children: (_d = props === null || props === void 0 ? void 0 : props.data) === null || _d === void 0 ? void 0 : _d.detail })] }) })));
|
|
5837
5867
|
};
|
|
5838
5868
|
const Select$1 = React__default.forwardRef((_a, ref) => {
|
|
5839
|
-
var { classNamePrefix = 'select', className, components: customComponents, label, hasHiddenLabel, name } = _a, props = __rest(_a, ["classNamePrefix", "className", "components", "label", "hasHiddenLabel", "name"]);
|
|
5869
|
+
var { classNamePrefix = 'select', className, components: customComponents, label: _label, hasHiddenLabel: _hasHiddenLabel, name: _name, text: textProp } = _a, props = __rest(_a, ["classNamePrefix", "className", "components", "label", "hasHiddenLabel", "name", "text"]);
|
|
5870
|
+
const text = Object.assign(Object.assign({}, DEFAULT_TEXT$8), textProp);
|
|
5840
5871
|
const defaultComponents = {
|
|
5841
5872
|
Option: OptionComponent,
|
|
5842
5873
|
};
|
|
5843
5874
|
const mergedComponents = Object.assign(Object.assign({}, defaultComponents), customComponents);
|
|
5844
|
-
return (jsx(ReactSelect, Object.assign({ ref: ref, classNamePrefix: classNamePrefix, className: classNames('select-wrapper', className), components: mergedComponents }, props)));
|
|
5875
|
+
return (jsx(ReactSelect, Object.assign({ ref: ref, classNamePrefix: classNamePrefix, className: classNames('select-wrapper', className), components: mergedComponents, placeholder: text.placeholder, noOptionsMessage: () => text.noOptions, loadingMessage: () => text.loading }, props)));
|
|
5845
5876
|
});
|
|
5846
5877
|
const LabeledSelect = withLabel(Select$1);
|
|
5847
5878
|
|
|
@@ -13841,48 +13872,6 @@ function useInteractions(propsList) {
|
|
|
13841
13872
|
}), [getReferenceProps, getFloatingProps, getItemProps]);
|
|
13842
13873
|
}
|
|
13843
13874
|
|
|
13844
|
-
const defaultOptions$1 = {
|
|
13845
|
-
placement: 'bottom-start',
|
|
13846
|
-
middleware: [offset$2(5), flip$2(), shift$2()],
|
|
13847
|
-
};
|
|
13848
|
-
function FloatUI({ children, ariaLabel, isOpen: controlledIsOpen, setIsOpen: controlledSetIsOpen, isPortal = false, portalOptions = {}, floatingOptions = defaultOptions$1, className, hover = false, onOpenChange, disableAutoUpdate = false, }) {
|
|
13849
|
-
var _a, _b;
|
|
13850
|
-
const [internalIsOpen, setInternalIsOpen] = useState(false);
|
|
13851
|
-
// Determine whether the component is controlled or uncontrolled
|
|
13852
|
-
const isControlled = controlledIsOpen !== undefined && controlledSetIsOpen !== undefined;
|
|
13853
|
-
const isOpen = isControlled ? controlledIsOpen : internalIsOpen;
|
|
13854
|
-
const setIsOpen = isControlled ? controlledSetIsOpen : setInternalIsOpen;
|
|
13855
|
-
const floatUIContentRef = useRef();
|
|
13856
|
-
const referenceElementRef = useRef(null);
|
|
13857
|
-
const childrenArray = React__default.Children.toArray(children);
|
|
13858
|
-
if (childrenArray.length !== 2) {
|
|
13859
|
-
throw new Error('FloatUI requires exactly two children: a trigger element and a content element.');
|
|
13860
|
-
}
|
|
13861
|
-
const [trigger, content] = childrenArray;
|
|
13862
|
-
if (!isValidElement(trigger) || !isValidElement(content)) {
|
|
13863
|
-
throw new Error('Both children of FloatUI must be valid React elements.');
|
|
13864
|
-
}
|
|
13865
|
-
const referenceElement = ((_a = floatingOptions.elements) === null || _a === void 0 ? void 0 : _a.reference) || referenceElementRef.current;
|
|
13866
|
-
const { refs, floatingStyles, context } = useFloating(Object.assign(Object.assign({}, floatingOptions), { open: isOpen, onOpenChange: (isOpen) => {
|
|
13867
|
-
setIsOpen(isOpen);
|
|
13868
|
-
onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(isOpen);
|
|
13869
|
-
}, whileElementsMounted: disableAutoUpdate
|
|
13870
|
-
? undefined
|
|
13871
|
-
: ((_b = floatingOptions.whileElementsMounted) !== null && _b !== void 0 ? _b : autoUpdate$1), elements: {
|
|
13872
|
-
reference: referenceElement,
|
|
13873
|
-
} }));
|
|
13874
|
-
// Can't call hooks conditionally so this enabled option is needed.
|
|
13875
|
-
const click = useClick(context, { enabled: !hover });
|
|
13876
|
-
const hoverHook = useHover(context, { enabled: hover });
|
|
13877
|
-
const dismiss = useDismiss(context, {
|
|
13878
|
-
bubbles: true,
|
|
13879
|
-
});
|
|
13880
|
-
const { getReferenceProps, getFloatingProps } = useInteractions([click, hoverHook, dismiss]);
|
|
13881
|
-
const tooltipContent = (jsx("div", Object.assign({ ref: refs.setFloating }, getFloatingProps(), { style: floatingStyles, role: "dialog", "aria-label": ariaLabel, className: `floatui-container ${className}`, children: jsx("div", { ref: floatUIContentRef, className: "floatui-content", children: content }) })));
|
|
13882
|
-
return (jsxs(Fragment, { children: [jsx("div", Object.assign({ ref: refs.setReference }, getReferenceProps(), { children: trigger })), isOpen &&
|
|
13883
|
-
(isPortal ? (jsx(FloatingPortal, { id: portalOptions === null || portalOptions === void 0 ? void 0 : portalOptions.rootId, children: tooltipContent })) : (tooltipContent))] }));
|
|
13884
|
-
}
|
|
13885
|
-
|
|
13886
13875
|
const formatTimeValue = (value) => {
|
|
13887
13876
|
if (!value || value.trim() === '') {
|
|
13888
13877
|
return '';
|
|
@@ -13932,8 +13921,54 @@ const validateInputValue = (value) => {
|
|
|
13932
13921
|
return ''; // Valid time format
|
|
13933
13922
|
};
|
|
13934
13923
|
|
|
13924
|
+
const defaultOptions$1 = {
|
|
13925
|
+
placement: 'bottom-start',
|
|
13926
|
+
middleware: [offset$2(5), flip$2(), shift$2()],
|
|
13927
|
+
};
|
|
13928
|
+
function FloatUI({ children, ariaLabel, isOpen: controlledIsOpen, setIsOpen: controlledSetIsOpen, isPortal = false, portalOptions = {}, floatingOptions = defaultOptions$1, className, hover = false, onOpenChange, disableAutoUpdate = false, }) {
|
|
13929
|
+
var _a, _b;
|
|
13930
|
+
const [internalIsOpen, setInternalIsOpen] = useState(false);
|
|
13931
|
+
// Determine whether the component is controlled or uncontrolled
|
|
13932
|
+
const isControlled = controlledIsOpen !== undefined && controlledSetIsOpen !== undefined;
|
|
13933
|
+
const isOpen = isControlled ? controlledIsOpen : internalIsOpen;
|
|
13934
|
+
const setIsOpen = isControlled ? controlledSetIsOpen : setInternalIsOpen;
|
|
13935
|
+
const floatUIContentRef = useRef();
|
|
13936
|
+
const referenceElementRef = useRef(null);
|
|
13937
|
+
const childrenArray = React__default.Children.toArray(children);
|
|
13938
|
+
if (childrenArray.length !== 2) {
|
|
13939
|
+
throw new Error('FloatUI requires exactly two children: a trigger element and a content element.');
|
|
13940
|
+
}
|
|
13941
|
+
const [trigger, content] = childrenArray;
|
|
13942
|
+
if (!isValidElement(trigger) || !isValidElement(content)) {
|
|
13943
|
+
throw new Error('Both children of FloatUI must be valid React elements.');
|
|
13944
|
+
}
|
|
13945
|
+
const referenceElement = ((_a = floatingOptions.elements) === null || _a === void 0 ? void 0 : _a.reference) || referenceElementRef.current;
|
|
13946
|
+
const { refs, floatingStyles, context } = useFloating(Object.assign(Object.assign({}, floatingOptions), { open: isOpen, onOpenChange: (isOpen) => {
|
|
13947
|
+
setIsOpen(isOpen);
|
|
13948
|
+
onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(isOpen);
|
|
13949
|
+
}, whileElementsMounted: disableAutoUpdate
|
|
13950
|
+
? undefined
|
|
13951
|
+
: (_b = floatingOptions.whileElementsMounted) !== null && _b !== void 0 ? _b : autoUpdate$1, elements: {
|
|
13952
|
+
reference: referenceElement,
|
|
13953
|
+
} }));
|
|
13954
|
+
// Can't call hooks conditionally so this enabled option is needed.
|
|
13955
|
+
const click = useClick(context, { enabled: !hover });
|
|
13956
|
+
const hoverHook = useHover(context, { enabled: hover });
|
|
13957
|
+
const dismiss = useDismiss(context, {
|
|
13958
|
+
bubbles: true,
|
|
13959
|
+
});
|
|
13960
|
+
const { getReferenceProps, getFloatingProps } = useInteractions([click, hoverHook, dismiss]);
|
|
13961
|
+
const tooltipContent = (jsx("div", Object.assign({ ref: refs.setFloating }, getFloatingProps(), { style: floatingStyles, role: "dialog", "aria-label": ariaLabel, className: `floatui-container ${className}`, children: jsx("div", { ref: floatUIContentRef, className: "floatui-content", children: content }) })));
|
|
13962
|
+
return (jsxs(Fragment, { children: [jsx("div", Object.assign({ ref: refs.setReference }, getReferenceProps(), { children: trigger })), isOpen &&
|
|
13963
|
+
(isPortal ? (jsx(FloatingPortal, { id: portalOptions === null || portalOptions === void 0 ? void 0 : portalOptions.rootId, children: tooltipContent })) : (tooltipContent))] }));
|
|
13964
|
+
}
|
|
13965
|
+
|
|
13966
|
+
const DEFAULT_TEXT$7 = {
|
|
13967
|
+
validationError: 'Time validation error',
|
|
13968
|
+
};
|
|
13935
13969
|
const TimePicker = (_a) => {
|
|
13936
|
-
var { ref, timeValue = '', label = 'Time Picker', name = 'time-picker', hasHiddenLabel = false, onTimeChange, className, isDisabled, isReadOnly, tabIndex } = _a, rest = __rest(_a, ["ref", "timeValue", "label", "name", "hasHiddenLabel", "onTimeChange", "className", "isDisabled", "isReadOnly", "tabIndex"]);
|
|
13970
|
+
var { ref, timeValue = '', label = 'Time Picker', name = 'time-picker', hasHiddenLabel = false, onTimeChange, className, isDisabled, isReadOnly, tabIndex, text: textProp } = _a, rest = __rest(_a, ["ref", "timeValue", "label", "name", "hasHiddenLabel", "onTimeChange", "className", "isDisabled", "isReadOnly", "tabIndex", "text"]);
|
|
13971
|
+
const text = Object.assign(Object.assign({}, DEFAULT_TEXT$7), textProp);
|
|
13937
13972
|
const [validationError, setValidationError] = useState('');
|
|
13938
13973
|
const [inputValue, setInputValue] = useState(timeValue);
|
|
13939
13974
|
const handleTimeChange = (e) => {
|
|
@@ -13955,7 +13990,7 @@ const TimePicker = (_a) => {
|
|
|
13955
13990
|
onTimeChange === null || onTimeChange === void 0 ? void 0 : onTimeChange(formattedValue);
|
|
13956
13991
|
}
|
|
13957
13992
|
};
|
|
13958
|
-
return (jsxs("div", { className: "time-input-wrapper", children: [jsx(LabeledInput, Object.assign({ ref: ref, tabIndex: tabIndex, className: className, "data-testid": `${name}-input`, label: label, hasHiddenLabel: hasHiddenLabel, value: inputValue, maxLength: 8, onChange: handleTimeChange, onBlur: handleBlur, name: name, readonly: isReadOnly, isDisabled: isDisabled }, rest)), jsxs(FloatUI, { ariaLabel:
|
|
13993
|
+
return (jsxs("div", { className: "time-input-wrapper", children: [jsx(LabeledInput, Object.assign({ ref: ref, tabIndex: tabIndex, className: className, "data-testid": `${name}-input`, label: label, hasHiddenLabel: hasHiddenLabel, value: inputValue, maxLength: 8, onChange: handleTimeChange, onBlur: handleBlur, name: name, readonly: isReadOnly, isDisabled: isDisabled }, rest)), jsxs(FloatUI, { ariaLabel: text.validationError, isOpen: !!validationError, setIsOpen: () => { }, isPortal: true, portalOptions: {
|
|
13959
13994
|
rootId: 'theme-root' ,
|
|
13960
13995
|
}, floatingOptions: {
|
|
13961
13996
|
placement: 'bottom-start',
|
|
@@ -13963,8 +13998,15 @@ const TimePicker = (_a) => {
|
|
|
13963
13998
|
}, children: [jsx("div", {}), jsx("div", { className: "time-validation-error", children: validationError && jsx("div", { className: "error-message", children: validationError }) })] })] }));
|
|
13964
13999
|
};
|
|
13965
14000
|
|
|
14001
|
+
const DEFAULT_TEXT$6 = {
|
|
14002
|
+
selectTime: 'Select Time',
|
|
14003
|
+
};
|
|
13966
14004
|
const DatePicker = (props) => {
|
|
13967
|
-
const { mode = 'single',
|
|
14005
|
+
const { mode = 'single', selected, hasTimePicker = false, endMonth, numberOfMonths, timeValue, onTimeChange, onSelect, isReadOnly, ref, timeTabIndex, text: textProp,
|
|
14006
|
+
// Destructure props handled by getCommonProps to prevent them from
|
|
14007
|
+
// leaking through ...rest and overriding the transformed values
|
|
14008
|
+
className: _className, captionLayout: _captionLayout, id: _id, month: _month, defaultMonth: _defaultMonth, startMonth: _startMonth, components: _components, isDisabled: _isDisabled, formatters: _formatters, weekStartsOn: _weekStartsOn, firstWeekContainsDate: _firstWeekContainsDate, today: _today, isRequired: _isRequired, min: _min, max: _max, onMonthChange: _onMonthChange, onNextClick: _onNextClick, onPrevClick: _onPrevClick, onDayClick: _onDayClick, dateTabIndex: _dateTabIndex } = props, rest = __rest(props, ["mode", "selected", "hasTimePicker", "endMonth", "numberOfMonths", "timeValue", "onTimeChange", "onSelect", "isReadOnly", "ref", "timeTabIndex", "text", "className", "captionLayout", "id", "month", "defaultMonth", "startMonth", "components", "isDisabled", "formatters", "weekStartsOn", "firstWeekContainsDate", "today", "isRequired", "min", "max", "onMonthChange", "onNextClick", "onPrevClick", "onDayClick", "dateTabIndex"]);
|
|
14009
|
+
const text = Object.assign(Object.assign({}, DEFAULT_TEXT$6), textProp);
|
|
13968
14010
|
const futureDateByYear = (year) => new Date(new Date().getFullYear() + year, 11, 31);
|
|
13969
14011
|
const endMonthDefault = endMonth !== null && endMonth !== void 0 ? endMonth : futureDateByYear(5);
|
|
13970
14012
|
const modeMap = {
|
|
@@ -14015,11 +14057,17 @@ const DatePicker = (props) => {
|
|
|
14015
14057
|
}
|
|
14016
14058
|
return () => observer.disconnect();
|
|
14017
14059
|
}, []);
|
|
14018
|
-
return (jsxs("div", { className: "date-picker-wrapper", tabIndex: -1, ref: wrapperRef, children: [hasTimePicker && (jsx("div", { className: "time-picker-wrapper", children: jsxs(Row, { align: "center", children: [jsx(Col, { xs: "content", children: jsx("p", { className: "ma-0", children:
|
|
14060
|
+
return (jsxs("div", { className: "date-picker-wrapper", tabIndex: -1, ref: wrapperRef, children: [hasTimePicker && (jsx("div", { className: "time-picker-wrapper", children: jsxs(Row, { align: "center", children: [jsx(Col, { xs: "content", children: jsx("p", { className: "ma-0", children: text.selectTime }) }), jsx(Col, { children: jsx(TimePicker, { ref: ref, timeValue: timeValue !== null && timeValue !== void 0 ? timeValue : '', onTimeChange: handleTimeChange, readonly: isReadOnly, tabIndex: timeTabIndex }) })] }) })), jsx(DayPicker, Object.assign({}, finalProps))] }));
|
|
14019
14061
|
};
|
|
14020
14062
|
|
|
14063
|
+
const DEFAULT_TEXT$5 = {
|
|
14064
|
+
triggerIcon: 'Open date picker',
|
|
14065
|
+
};
|
|
14021
14066
|
const IconTriggerDatePicker = (props) => {
|
|
14022
|
-
const { ariaLabel,
|
|
14067
|
+
const { ariaLabel, isDisabled, disableBeforeDate, disableAfterDate, id,
|
|
14068
|
+
// Destructure unused props to prevent leaking into ...rest
|
|
14069
|
+
className: _className, label: _label, onSelect, selected, triggerIcon, triggerIconSize, mode, isOpen, clearOnClose, initialMonth, portalOptions, floatingOptions, isPortal, text: textProp } = props, rest = __rest(props, ["ariaLabel", "isDisabled", "disableBeforeDate", "disableAfterDate", "id", "className", "label", "onSelect", "selected", "triggerIcon", "triggerIconSize", "mode", "isOpen", "clearOnClose", "initialMonth", "portalOptions", "floatingOptions", "isPortal", "text"]);
|
|
14070
|
+
const text = Object.assign(Object.assign({}, DEFAULT_TEXT$5), textProp);
|
|
14023
14071
|
const [localMonth, setLocalMonth] = useState(initialMonth !== null && initialMonth !== void 0 ? initialMonth : new Date());
|
|
14024
14072
|
const handleSelect = (date) => {
|
|
14025
14073
|
if (!date) {
|
|
@@ -14035,7 +14083,7 @@ const IconTriggerDatePicker = (props) => {
|
|
|
14035
14083
|
onSelect && onSelect(undefined);
|
|
14036
14084
|
}
|
|
14037
14085
|
}, [isOpen, clearOnClose]);
|
|
14038
|
-
return (jsxs(FloatUI, { isOpen: isOpen, ariaLabel: ariaLabel, isPortal: isPortal, portalOptions: portalOptions, floatingOptions: floatingOptions, children: [jsx(Icon, { "aria-label":
|
|
14086
|
+
return (jsxs(FloatUI, { isOpen: isOpen, ariaLabel: ariaLabel, isPortal: isPortal, portalOptions: portalOptions, floatingOptions: floatingOptions, children: [jsx(Icon, { "aria-label": text.triggerIcon, name: triggerIcon, size: triggerIconSize, className: "date__picker__trigger", "data-testid": `datepicker-trigger-for-${id}` }), jsx(DatePicker, Object.assign({ isDisabled: isDisabled, mode: mode, selected: selected, onSelect: handleSelect, month: localMonth, startMonth: disableBeforeDate, endMonth: disableAfterDate, onMonthChange: setLocalMonth }, rest))] }));
|
|
14039
14087
|
};
|
|
14040
14088
|
|
|
14041
14089
|
/**
|
|
@@ -19428,7 +19476,9 @@ const formatDateAsString$1 = (date) => format(date, 'MM/dd/yyyy');
|
|
|
19428
19476
|
|
|
19429
19477
|
function SingleInputDatePicker(props) {
|
|
19430
19478
|
var _a;
|
|
19431
|
-
const { ariaLabel,
|
|
19479
|
+
const { ariaLabel, isDisabled, captionLayout, initialMonth, label, selected, isOpen, inputPlaceholder, clearOnClose, inputIconName, isClearable, errorMessage, onSelect, hasHiddenLabel, ref, isReadOnly, tabIndex, portalOptions, floatingOptions, isPortal,
|
|
19480
|
+
// Destructure unused props to prevent leaking into ...rest
|
|
19481
|
+
className: _className, disableBeforeDate: _disableBeforeDate, disableAfterDate: _disableAfterDate, id: _id } = props, rest = __rest(props, ["ariaLabel", "isDisabled", "captionLayout", "initialMonth", "label", "selected", "isOpen", "inputPlaceholder", "clearOnClose", "inputIconName", "isClearable", "errorMessage", "onSelect", "hasHiddenLabel", "ref", "isReadOnly", "tabIndex", "portalOptions", "floatingOptions", "isPortal", "className", "disableBeforeDate", "disableAfterDate", "id"]);
|
|
19432
19482
|
const inputId = useId$1();
|
|
19433
19483
|
// The text value is assumed to be unneeded by the consumer.
|
|
19434
19484
|
const [localTextValue, setLocalTextValue] = useState(selected ? formatDateAsString$1(selected) : '');
|
|
@@ -19462,11 +19512,18 @@ function SingleInputDatePicker(props) {
|
|
|
19462
19512
|
setLocalTextValue('');
|
|
19463
19513
|
}
|
|
19464
19514
|
}, [isOpen, clearOnClose]);
|
|
19465
|
-
return (jsxs(FloatUI, { isOpen: isOpen, ariaLabel: ariaLabel, isPortal: isPortal, portalOptions: portalOptions, floatingOptions: floatingOptions, children: [jsx(LabeledInput, { id: inputId, value: localTextValue, placeholder: inputPlaceholder, isDisabled: isDisabled, hasHiddenLabel: hasHiddenLabel, iconName: inputIconName, isClearable: isClearable, onChange: handleInputChange, errorMessage: errorMessage, label:
|
|
19515
|
+
return (jsxs(FloatUI, { isOpen: isOpen, ariaLabel: ariaLabel, isPortal: isPortal, portalOptions: portalOptions, floatingOptions: floatingOptions, children: [jsx(LabeledInput, { id: inputId, value: localTextValue, placeholder: inputPlaceholder, isDisabled: isDisabled, hasHiddenLabel: hasHiddenLabel, iconName: inputIconName, isClearable: isClearable, onChange: handleInputChange, errorMessage: errorMessage, label: label, tabIndex: tabIndex, name: label, ref: ref, readonly: isReadOnly }), jsx(DatePicker, Object.assign({ captionLayout: captionLayout, mode: "single", selected: selected, onSelect: handleDayPickerSelect, month: localMonth, onMonthChange: setLocalMonth }, rest))] }));
|
|
19466
19516
|
}
|
|
19467
19517
|
|
|
19518
|
+
const DEFAULT_TEXT$4 = {
|
|
19519
|
+
fromDate: 'From Date',
|
|
19520
|
+
toDate: 'To Date',
|
|
19521
|
+
};
|
|
19468
19522
|
function InputDateRangePicker(props) {
|
|
19469
|
-
const { ariaLabel,
|
|
19523
|
+
const { ariaLabel, isDisabled, captionLayout,
|
|
19524
|
+
// Destructure unused props to prevent leaking into ...rest
|
|
19525
|
+
className: _className, disableBeforeDate: _disableBeforeDate, disableAfterDate: _disableAfterDate, month: _month, id: _id, isPortal: _isPortal, onSelect, selected, isOpen, setIsOpen, inputPlaceholder, inputIconName, toErrorMessage, fromErrorMessage, gutterWidth, fromLabel, toLabel, closeOnSelect, clearOnClose, hasHiddenLabel, ref, isFromReadOnly, isToReadOnly, toTabIndex, fromTabIndex, portalOptions, floatingOptions, text: textProp } = props, rest = __rest(props, ["ariaLabel", "isDisabled", "captionLayout", "className", "disableBeforeDate", "disableAfterDate", "month", "id", "isPortal", "onSelect", "selected", "isOpen", "setIsOpen", "inputPlaceholder", "inputIconName", "toErrorMessage", "fromErrorMessage", "gutterWidth", "fromLabel", "toLabel", "closeOnSelect", "clearOnClose", "hasHiddenLabel", "ref", "isFromReadOnly", "isToReadOnly", "toTabIndex", "fromTabIndex", "portalOptions", "floatingOptions", "text"]);
|
|
19526
|
+
const text = Object.assign(Object.assign({}, DEFAULT_TEXT$4), textProp);
|
|
19470
19527
|
const inputId = useId$1();
|
|
19471
19528
|
// Hold the input values in state
|
|
19472
19529
|
const [localTextValueFrom, setLocalTextValueFrom] = useState((selected === null || selected === void 0 ? void 0 : selected.from) ? formatDateAsString$1(selected.from) : '');
|
|
@@ -19525,14 +19582,16 @@ function InputDateRangePicker(props) {
|
|
|
19525
19582
|
setLocalTextValueTo('');
|
|
19526
19583
|
}
|
|
19527
19584
|
}, [isOpen, clearOnClose]);
|
|
19528
|
-
return (jsxs(FloatUI, { isOpen: isOpen, setIsOpen: setIsOpen, ariaLabel: ariaLabel, portalOptions: portalOptions, floatingOptions: floatingOptions, children: [jsxs(Row, { gutterWidth: gutterWidth, children: [jsx(Col, { children: jsx(LabeledInput, { id: `${inputId}-from`, value: localTextValueFrom, placeholder: inputPlaceholder, isDisabled: isDisabled, iconName: inputIconName, onChange: (e) => handleInputChange(e, 'from'), errorMessage: fromErrorMessage, label: fromLabel, name:
|
|
19585
|
+
return (jsxs(FloatUI, { isOpen: isOpen, setIsOpen: setIsOpen, ariaLabel: ariaLabel, portalOptions: portalOptions, floatingOptions: floatingOptions, children: [jsxs(Row, { gutterWidth: gutterWidth, children: [jsx(Col, { children: jsx(LabeledInput, { id: `${inputId}-from`, value: localTextValueFrom, placeholder: inputPlaceholder, isDisabled: isDisabled, iconName: inputIconName, onChange: (e) => handleInputChange(e, 'from'), errorMessage: fromErrorMessage, label: fromLabel, name: text.fromDate, "data-testid": "date-picker-from", hasHiddenLabel: hasHiddenLabel, ref: ref, readonly: isFromReadOnly, tabIndex: fromTabIndex }) }), jsx(Col, { children: jsx(LabeledInput, { id: `${inputId}-to`, value: localTextValueTo, placeholder: inputPlaceholder, isDisabled: isDisabled, iconName: inputIconName, onChange: (e) => handleInputChange(e, 'to'), errorMessage: toErrorMessage, label: toLabel, name: text.toDate, "data-testid": "date-picker-to", hasHiddenLabel: hasHiddenLabel, ref: ref, readonly: isToReadOnly, tabIndex: toTabIndex }) })] }), jsx(DatePicker, Object.assign({ captionLayout: captionLayout, month: localMonth, onMonthChange: (date) => setLocalMonth(date), mode: "range", selected: selected, onSelect: handleDayPickerSelect }, rest))] }));
|
|
19529
19586
|
}
|
|
19530
19587
|
|
|
19531
19588
|
const formatDateAsString = (date) => format(date, 'MM/dd/yyyy');
|
|
19532
19589
|
|
|
19533
19590
|
function SingleInputDateTimePicker(props) {
|
|
19534
19591
|
var _a;
|
|
19535
|
-
const { ariaLabel,
|
|
19592
|
+
const { ariaLabel, isDisabled, captionLayout, initialMonth, id, label, selected, isOpen, inputPlaceholder, clearOnClose, inputIconName, isClearable, errorMessage, onSelect, timeValue, onTimeChange, hasHiddenLabel, isReadOnly, timePickerRef, dateTabIndex, timeTabIndex, ref, portalOptions, floatingOptions, isPortal,
|
|
19593
|
+
// Destructure unused props to prevent leaking into ...rest
|
|
19594
|
+
className: _className, disableBeforeDate: _disableBeforeDate, disableAfterDate: _disableAfterDate } = props, rest = __rest(props, ["ariaLabel", "isDisabled", "captionLayout", "initialMonth", "id", "label", "selected", "isOpen", "inputPlaceholder", "clearOnClose", "inputIconName", "isClearable", "errorMessage", "onSelect", "timeValue", "onTimeChange", "hasHiddenLabel", "isReadOnly", "timePickerRef", "dateTabIndex", "timeTabIndex", "ref", "portalOptions", "floatingOptions", "isPortal", "className", "disableBeforeDate", "disableAfterDate"]);
|
|
19536
19595
|
const inputId = useId$1();
|
|
19537
19596
|
// The text value is assumed to be unneeded by the consumer.
|
|
19538
19597
|
const [localTextValue, setLocalTextValue] = useState(selected ? formatDateAsString(selected) : '');
|
|
@@ -19569,7 +19628,7 @@ function SingleInputDateTimePicker(props) {
|
|
|
19569
19628
|
const handleTimeChange = (time) => {
|
|
19570
19629
|
onTimeChange === null || onTimeChange === void 0 ? void 0 : onTimeChange(time);
|
|
19571
19630
|
};
|
|
19572
|
-
return (jsxs(Row, { className: "date-time-picker-row", children: [jsx(Col, { className: "date-picker-col", children: jsxs(FloatUI, { className: "date-picker-float-ui", isOpen: isOpen, ariaLabel: ariaLabel, isPortal: isPortal, portalOptions: portalOptions, floatingOptions: floatingOptions, children: [jsx(LabeledInput, { ref: ref, className: `date-picker-input`, id: inputId, value: localTextValue, placeholder: inputPlaceholder, isDisabled: isReadOnly || isDisabled, readonly: isReadOnly, iconName: inputIconName, isClearable: isClearable, onChange: handleInputChange, errorMessage: errorMessage, hasHiddenLabel: hasHiddenLabel, label:
|
|
19631
|
+
return (jsxs(Row, { className: "date-time-picker-row", children: [jsx(Col, { className: "date-picker-col", children: jsxs(FloatUI, { className: "date-picker-float-ui", isOpen: isOpen, ariaLabel: ariaLabel, isPortal: isPortal, portalOptions: portalOptions, floatingOptions: floatingOptions, children: [jsx(LabeledInput, { ref: ref, className: `date-picker-input`, id: inputId, value: localTextValue, placeholder: inputPlaceholder, isDisabled: isReadOnly || isDisabled, readonly: isReadOnly, iconName: inputIconName, isClearable: isClearable, onChange: handleInputChange, errorMessage: errorMessage, hasHiddenLabel: hasHiddenLabel, label: label, name: `${id}-date-picker`, tabIndex: dateTabIndex }), jsx(DatePicker, Object.assign({ captionLayout: captionLayout, mode: "single", selected: selected, onSelect: handleDayPickerSelect, month: localMonth, onMonthChange: setLocalMonth, isReadOnly: isReadOnly }, rest))] }) }), jsx(Col, { xs: "content", className: "time-picker-col", children: jsx(TimePicker, { ref: timePickerRef, className: `time-picker-input`, timeValue: timeValue, name: `${id}-time-picker`, hasHiddenLabel: true, onTimeChange: handleTimeChange, isReadOnly: isReadOnly, isDisabled: isDisabled, tabIndex: timeTabIndex }) })] }));
|
|
19573
19632
|
}
|
|
19574
19633
|
|
|
19575
19634
|
const Form = (_a) => {
|
|
@@ -21451,32 +21510,42 @@ Modal$2.default = Modal$1;
|
|
|
21451
21510
|
var libExports = lib.exports;
|
|
21452
21511
|
var ReactModal = /*@__PURE__*/getDefaultExportFromCjs(libExports);
|
|
21453
21512
|
|
|
21513
|
+
const DEFAULT_TEXT$3 = {
|
|
21514
|
+
closeButton: 'Close',
|
|
21515
|
+
};
|
|
21454
21516
|
const Modal = (_a) => {
|
|
21455
21517
|
var { className = '', children, isOpen, onRequestClose, portalClassName, overlayClassName, appElement = document.getElementById('theme-root') ||
|
|
21456
21518
|
document.getElementById('root') ||
|
|
21457
21519
|
document.body, shouldCloseOnOverlayClick, shouldCloseOnEsc, testId, contentElement, overlayElement, position = 'center', parentSelector = () => document.getElementById('theme-root') || document.getElementById('root'), // default for our apps, storybook needs a different one
|
|
21458
|
-
title, subtitle, footer, maxWidthInPixels } = _a, rest = __rest(_a, ["className", "children", "isOpen", "onRequestClose", "portalClassName", "overlayClassName", "appElement", "shouldCloseOnOverlayClick", "shouldCloseOnEsc", "testId", "contentElement", "overlayElement", "position", "parentSelector", "title", "subtitle", "footer", "maxWidthInPixels"]);
|
|
21520
|
+
title, subtitle, footer, maxWidthInPixels, text: textProp } = _a, rest = __rest(_a, ["className", "children", "isOpen", "onRequestClose", "portalClassName", "overlayClassName", "appElement", "shouldCloseOnOverlayClick", "shouldCloseOnEsc", "testId", "contentElement", "overlayElement", "position", "parentSelector", "title", "subtitle", "footer", "maxWidthInPixels", "text"]);
|
|
21521
|
+
const text = Object.assign(Object.assign({}, DEFAULT_TEXT$3), textProp);
|
|
21459
21522
|
const modalClasses = classNames('modal', `modal--${position}`, className);
|
|
21460
21523
|
const overlayClasses = classNames('modal-overlay', overlayClassName);
|
|
21461
21524
|
const hasHeader = title || subtitle;
|
|
21462
|
-
return (jsx(ReactModal, Object.assign({ className: modalClasses, overlayClassName: overlayClasses, testId: testId, isOpen: isOpen, onRequestClose: onRequestClose, portalClassName: portalClassName, appElement: appElement, parentSelector: parentSelector, shouldCloseOnOverlayClick: shouldCloseOnOverlayClick, shouldCloseOnEsc: shouldCloseOnEsc, contentElement: contentElement, overlayElement: overlayElement }, rest, { children: jsxs("div", { className: "modal-content", style: { maxWidth: `${maxWidthInPixels}px` }, children: [jsx(Button$1, { className: "modal-close-button", onClick: onRequestClose, variant: "link", size: "md", iconLeft: "x-close", ariaLabel:
|
|
21525
|
+
return (jsx(ReactModal, Object.assign({ className: modalClasses, overlayClassName: overlayClasses, testId: testId, isOpen: isOpen, onRequestClose: onRequestClose, portalClassName: portalClassName, appElement: appElement, parentSelector: parentSelector, shouldCloseOnOverlayClick: shouldCloseOnOverlayClick, shouldCloseOnEsc: shouldCloseOnEsc, contentElement: contentElement, overlayElement: overlayElement }, rest, { children: jsxs("div", { className: "modal-content", style: { maxWidth: `${maxWidthInPixels}px` }, children: [jsx(Button$1, { className: "modal-close-button", onClick: onRequestClose, variant: "link", size: "md", iconLeft: "x-close", ariaLabel: text.closeButton }), hasHeader && (jsx("div", { className: "modal-header", children: jsx(Row, { justify: "between", align: "center", children: jsxs(Col, { children: [title && jsx("h2", { className: "modal-title", children: title }), subtitle && jsx("p", { className: "modal-subtitle", children: subtitle })] }) }) })), jsx("div", { className: "modal-body", children: children }), footer && jsx("div", { className: "modal-footer", children: footer })] }) })));
|
|
21463
21526
|
};
|
|
21464
21527
|
|
|
21465
|
-
const
|
|
21466
|
-
|
|
21528
|
+
const DEFAULT_TEXT$2 = {
|
|
21529
|
+
closeButton: 'Close',
|
|
21530
|
+
dontShowAgain: "Don't display this again.",
|
|
21531
|
+
confirm: 'Confirm',
|
|
21532
|
+
cancel: 'Cancel',
|
|
21533
|
+
};
|
|
21534
|
+
const defaultFooter = ({ onCancelRequest, onConfirmRequest, text, confirmationButtonVariant, hasDontShowAgainCheckbox, isChecked, onDontShowAgainChange, }) => (jsxs(Row, { gutterWidth: 12, justify: "end", align: "center", children: [hasDontShowAgainCheckbox && (jsx(Col, { children: jsx(Checkbox, { label: text.dontShowAgain, onChange: (e) => onDontShowAgainChange === null || onDontShowAgainChange === void 0 ? void 0 : onDontShowAgainChange(e.target.checked), isChecked: isChecked, id: "dont-show-again", name: "dont-show-again" }) })), jsx(Col, { xs: "content", children: jsx(Button$1, { onClick: onCancelRequest, ariaLabel: text.cancel, variant: "outline", children: text.cancel }) }), jsx(Col, { xs: "content", children: jsx(Button$1, { onClick: () => onConfirmRequest === null || onConfirmRequest === void 0 ? void 0 : onConfirmRequest({ dontShowAgain: isChecked }), ariaLabel: text.confirm, variant: confirmationButtonVariant, children: text.confirm }) })] }));
|
|
21535
|
+
const ConfirmationModal = ({ className, overlayClassName, testId, isOpen, onRequestClose, portalClassName, appElement, parentSelector, shouldCloseOnOverlayClick, shouldCloseOnEsc, contentElement, overlayElement, footer, children, onConfirmRequest, onCancelRequest, confirmationButtonVariant = 'solid', icon, title, status = 'info', maxWidthInPixels, hasDontShowAgainCheckbox, text: textProp, }) => {
|
|
21536
|
+
const text = Object.assign(Object.assign({}, DEFAULT_TEXT$2), textProp);
|
|
21467
21537
|
const [dontShowAgain, setDontShowAgain] = useState(false);
|
|
21468
21538
|
const modalFooter = footer ||
|
|
21469
21539
|
defaultFooter({
|
|
21470
21540
|
onCancelRequest,
|
|
21471
21541
|
onConfirmRequest,
|
|
21472
|
-
|
|
21473
|
-
cancelButtonText,
|
|
21542
|
+
text,
|
|
21474
21543
|
confirmationButtonVariant,
|
|
21475
21544
|
hasDontShowAgainCheckbox,
|
|
21476
21545
|
isChecked: dontShowAgain,
|
|
21477
21546
|
onDontShowAgainChange: setDontShowAgain,
|
|
21478
21547
|
});
|
|
21479
|
-
return (jsxs(Modal, { className: classNames('confirmation-modal', className), overlayClassName: overlayClassName, testId: testId, isOpen: isOpen, onRequestClose: onRequestClose, portalClassName: portalClassName, appElement: appElement, parentSelector: parentSelector, shouldCloseOnOverlayClick: shouldCloseOnOverlayClick, shouldCloseOnEsc: shouldCloseOnEsc, contentElement: contentElement, overlayElement: overlayElement, footer: modalFooter, maxWidthInPixels: maxWidthInPixels, children: [icon && (jsx(Icon, { name: icon, className: classNames('confirmation-modal-icon', `color-${status}`), size: "xl" })), title && jsx("h2", { className: "confirmation-modal-title", children: title }), children] }));
|
|
21548
|
+
return (jsxs(Modal, { className: classNames('confirmation-modal', className), overlayClassName: overlayClassName, testId: testId, isOpen: isOpen, onRequestClose: onRequestClose, portalClassName: portalClassName, appElement: appElement, parentSelector: parentSelector, shouldCloseOnOverlayClick: shouldCloseOnOverlayClick, shouldCloseOnEsc: shouldCloseOnEsc, contentElement: contentElement, overlayElement: overlayElement, footer: modalFooter, maxWidthInPixels: maxWidthInPixels, text: { closeButton: text.closeButton }, children: [icon && (jsx(Icon, { name: icon, className: classNames('confirmation-modal-icon', `color-${status}`), size: "xl" })), title && jsx("h2", { className: "confirmation-modal-title", children: title }), children] }));
|
|
21480
21549
|
};
|
|
21481
21550
|
|
|
21482
21551
|
/**
|
|
@@ -24570,20 +24639,6 @@ function useReactTable(options) {
|
|
|
24570
24639
|
return tableRef.current;
|
|
24571
24640
|
}
|
|
24572
24641
|
|
|
24573
|
-
function ActionBar({ table, TableActions, className, children, }) {
|
|
24574
|
-
const selectedItems = table.getRowModel().rows.filter((row) => row.getIsSelected());
|
|
24575
|
-
const unselectRows = () => {
|
|
24576
|
-
table.getRowModel().rows.forEach((row) => {
|
|
24577
|
-
row.toggleSelected(false);
|
|
24578
|
-
});
|
|
24579
|
-
};
|
|
24580
|
-
return (jsx(Card, { className: classNames('tanstack-table__action-bar', className), children: children !== null && children !== void 0 ? children : (jsx("div", { className: "tanstack-table__action-bar__container", children: TableActions && (jsx("div", { className: "tanstack-table__action-bar__button-container", children: jsx(TableActions, { selectedItems: selectedItems, unselectRows: unselectRows }) })) })) }));
|
|
24581
|
-
}
|
|
24582
|
-
|
|
24583
|
-
function NoResults({ clearFilters, hasFilters, message }) {
|
|
24584
|
-
return (jsxs("div", { className: "tanstack-table__no-results", "data-testid": "tanstack-table-no-results", children: [jsx("p", { className: "tanstack-table__no-results__text", children: message }), hasFilters && (jsx("p", { className: "tanstack-table__no-results__text", children: jsx(Button$1, { ariaLabel: "Reset filters", variant: "link", onClick: clearFilters, children: "Reset filters" }) }))] }));
|
|
24585
|
-
}
|
|
24586
|
-
|
|
24587
24642
|
var lodash = {exports: {}};
|
|
24588
24643
|
|
|
24589
24644
|
/**
|
|
@@ -41788,36 +41843,18 @@ lodash.exports;
|
|
|
41788
41843
|
|
|
41789
41844
|
var lodashExports = lodash.exports;
|
|
41790
41845
|
|
|
41791
|
-
|
|
41792
|
-
const
|
|
41793
|
-
|
|
41794
|
-
|
|
41795
|
-
|
|
41796
|
-
|
|
41797
|
-
const columns = useMemo(() => defaultColumns, []);
|
|
41798
|
-
const defaultData = useMemo(() => [], []);
|
|
41799
|
-
const [windowWidth, setWindowWidth] = useState(window.innerWidth);
|
|
41800
|
-
const [rowSelection, setRowSelection] = useState({});
|
|
41801
|
-
const [formattedColumns, setFormattedColumns] = useState(columns);
|
|
41802
|
-
// Tracks changes to browser width to allow for updating of column widths
|
|
41803
|
-
useEffect(() => {
|
|
41804
|
-
const handleResize = () => {
|
|
41805
|
-
setWindowWidth(window.innerWidth);
|
|
41806
|
-
};
|
|
41807
|
-
window.addEventListener('resize', handleResize);
|
|
41808
|
-
return () => {
|
|
41809
|
-
window.removeEventListener('resize', handleResize);
|
|
41810
|
-
};
|
|
41811
|
-
}, []);
|
|
41812
|
-
return {
|
|
41813
|
-
columns,
|
|
41814
|
-
defaultData,
|
|
41815
|
-
rowSelection,
|
|
41816
|
-
setRowSelection,
|
|
41817
|
-
windowWidth,
|
|
41818
|
-
formattedColumns,
|
|
41819
|
-
setFormattedColumns,
|
|
41846
|
+
function ActionBar({ table, TableActions, className, children, }) {
|
|
41847
|
+
const selectedItems = table.getRowModel().rows.filter((row) => row.getIsSelected());
|
|
41848
|
+
const unselectRows = () => {
|
|
41849
|
+
table.getRowModel().rows.forEach((row) => {
|
|
41850
|
+
row.toggleSelected(false);
|
|
41851
|
+
});
|
|
41820
41852
|
};
|
|
41853
|
+
return (jsx(Card, { className: classNames('tanstack-table__action-bar', className), children: children !== null && children !== void 0 ? children : (jsx("div", { className: "tanstack-table__action-bar__container", children: TableActions && (jsx("div", { className: "tanstack-table__action-bar__button-container", children: jsx(TableActions, { selectedItems: selectedItems, unselectRows: unselectRows }) })) })) }));
|
|
41854
|
+
}
|
|
41855
|
+
|
|
41856
|
+
function NoResults({ clearFilters, hasFilters, message, resetFiltersText = 'Reset filters', }) {
|
|
41857
|
+
return (jsxs("div", { className: "tanstack-table__no-results", "data-testid": "tanstack-table-no-results", children: [jsx("p", { className: "tanstack-table__no-results__text", children: message }), hasFilters && (jsx("p", { className: "tanstack-table__no-results__text", children: jsx(Button$1, { ariaLabel: resetFiltersText, variant: "link", onClick: clearFilters, children: resetFiltersText }) }))] }));
|
|
41821
41858
|
}
|
|
41822
41859
|
|
|
41823
41860
|
// Sets style attributes for pinned columns
|
|
@@ -41852,25 +41889,6 @@ const getTdStyles = (column, textAlign, hasDefinedColumnSize, width) => {
|
|
|
41852
41889
|
return styles;
|
|
41853
41890
|
};
|
|
41854
41891
|
|
|
41855
|
-
const TableHeader = forwardRef(({ table }, ref) => {
|
|
41856
|
-
const getStyles = (column, header) => {
|
|
41857
|
-
var _a, _b, _c, _d, _e, _f;
|
|
41858
|
-
return Object.assign(Object.assign({}, getThStyles(column)), (((_c = (_b = (_a = header.column.columnDef.meta) === null || _a === void 0 ? void 0 : _a.styles) === null || _b === void 0 ? void 0 : _b.header) === null || _c === void 0 ? void 0 : _c.textAlign)
|
|
41859
|
-
? { textAlign: (_f = (_e = (_d = header.column.columnDef.meta) === null || _d === void 0 ? void 0 : _d.styles) === null || _e === void 0 ? void 0 : _e.header) === null || _f === void 0 ? void 0 : _f.textAlign }
|
|
41860
|
-
: {}));
|
|
41861
|
-
};
|
|
41862
|
-
return (jsx(Fragment, { children: table.getHeaderGroups().map((headerGroup) => (jsx("tr", { children: headerGroup.headers.map((header) => {
|
|
41863
|
-
var _a, _b, _c;
|
|
41864
|
-
const { column } = header;
|
|
41865
|
-
return (jsx("th", { className: classNames('tanstack-table__thead__th', {
|
|
41866
|
-
'pa-0': !!((_c = (_b = (_a = header.column.columnDef.meta) === null || _a === void 0 ? void 0 : _a.styles) === null || _b === void 0 ? void 0 : _b.header) === null || _c === void 0 ? void 0 : _c.hasNoPadding),
|
|
41867
|
-
}), ref: (el) => {
|
|
41868
|
-
if (el)
|
|
41869
|
-
ref.current[column.id] = el;
|
|
41870
|
-
}, colSpan: header.colSpan, style: Object.assign({}, getStyles(column, header)), children: flexRender(header.column.columnDef.header, header.getContext()) }, header.id));
|
|
41871
|
-
}) }, headerGroup.id))) }));
|
|
41872
|
-
});
|
|
41873
|
-
|
|
41874
41892
|
const TableBody = ({ table, onRowClick, activeRows }) => {
|
|
41875
41893
|
return (jsx(Fragment, { children: table.getRowModel().rows.map((row) => (jsx("tr", { className: classNames('tanstack-table__tbody__tr', {
|
|
41876
41894
|
'is-selected': row.getIsSelected(),
|
|
@@ -41891,6 +41909,25 @@ const TableBody = ({ table, onRowClick, activeRows }) => {
|
|
|
41891
41909
|
}) }, row.id))) }));
|
|
41892
41910
|
};
|
|
41893
41911
|
|
|
41912
|
+
const TableHeader = forwardRef(({ table }, ref) => {
|
|
41913
|
+
const getStyles = (column, header) => {
|
|
41914
|
+
var _a, _b, _c, _d, _e, _f;
|
|
41915
|
+
return Object.assign(Object.assign({}, getThStyles(column)), (((_c = (_b = (_a = header.column.columnDef.meta) === null || _a === void 0 ? void 0 : _a.styles) === null || _b === void 0 ? void 0 : _b.header) === null || _c === void 0 ? void 0 : _c.textAlign)
|
|
41916
|
+
? { textAlign: (_f = (_e = (_d = header.column.columnDef.meta) === null || _d === void 0 ? void 0 : _d.styles) === null || _e === void 0 ? void 0 : _e.header) === null || _f === void 0 ? void 0 : _f.textAlign }
|
|
41917
|
+
: {}));
|
|
41918
|
+
};
|
|
41919
|
+
return (jsx(Fragment, { children: table.getHeaderGroups().map((headerGroup) => (jsx("tr", { children: headerGroup.headers.map((header) => {
|
|
41920
|
+
var _a, _b, _c;
|
|
41921
|
+
const { column } = header;
|
|
41922
|
+
return (jsx("th", { className: classNames('tanstack-table__thead__th', {
|
|
41923
|
+
'pa-0': !!((_c = (_b = (_a = header.column.columnDef.meta) === null || _a === void 0 ? void 0 : _a.styles) === null || _b === void 0 ? void 0 : _b.header) === null || _c === void 0 ? void 0 : _c.hasNoPadding),
|
|
41924
|
+
}), ref: (el) => {
|
|
41925
|
+
if (el)
|
|
41926
|
+
ref.current[column.id] = el;
|
|
41927
|
+
}, colSpan: header.colSpan, style: Object.assign({}, getStyles(column, header)), children: flexRender(header.column.columnDef.header, header.getContext()) }, header.id));
|
|
41928
|
+
}) }, headerGroup.id))) }));
|
|
41929
|
+
});
|
|
41930
|
+
|
|
41894
41931
|
function CirclePulse(_a) {
|
|
41895
41932
|
var { size = 'md', className } = _a, rest = __rest(_a, ["size", "className"]);
|
|
41896
41933
|
return (jsx("div", Object.assign({ className: `circle-pulse circle-pulse-${size} ${className}`, "aria-hidden": true }, rest)));
|
|
@@ -41900,8 +41937,50 @@ const TableLoading = ({ columns, message }) => {
|
|
|
41900
41937
|
return (jsx("tr", { className: "tanstack-table__tbody__tr ", children: jsxs("td", { className: "tanstack-table__centered-row pa-6", colSpan: columns.length, children: [jsx("h2", { className: "my-12", children: message }), jsx(CirclePulse, { "data-testid": "loading-indicator", className: "mb-14" })] }) }));
|
|
41901
41938
|
};
|
|
41902
41939
|
|
|
41940
|
+
const TablePagination = ({ rowsPerPage, rowCount, onChangePage, currentPage, totalEntriesText, text, }) => {
|
|
41941
|
+
const totalPages = Math.ceil(rowCount / rowsPerPage);
|
|
41942
|
+
return (jsx("div", { className: "table__pagination", "data-testid": "tanstack-table-pagination", children: jsxs(Row, { align: "center", justify: "between", children: [jsx(Col, { xs: "content", children: totalEntriesText && (jsx("span", { "data-testid": "table-pagination-total-entries", className: "table__pagination-total-entries", children: totalEntriesText })) }), jsx(Col, { xs: "content", children: jsx(Pagination, { "data-testid": "table-pagination-component", totalPages: totalPages, currentPage: currentPage, onChange: (page) => onChangePage(page), text: text }) })] }) }));
|
|
41943
|
+
};
|
|
41944
|
+
|
|
41945
|
+
function useTanstackTable({ defaultColumns }) {
|
|
41946
|
+
const columns = useMemo(() => defaultColumns, []);
|
|
41947
|
+
const defaultData = useMemo(() => [], []);
|
|
41948
|
+
const [windowWidth, setWindowWidth] = useState(window.innerWidth);
|
|
41949
|
+
const [rowSelection, setRowSelection] = useState({});
|
|
41950
|
+
const [formattedColumns, setFormattedColumns] = useState(columns);
|
|
41951
|
+
// Tracks changes to browser width to allow for updating of column widths
|
|
41952
|
+
useEffect(() => {
|
|
41953
|
+
const handleResize = () => {
|
|
41954
|
+
setWindowWidth(window.innerWidth);
|
|
41955
|
+
};
|
|
41956
|
+
window.addEventListener('resize', handleResize);
|
|
41957
|
+
return () => {
|
|
41958
|
+
window.removeEventListener('resize', handleResize);
|
|
41959
|
+
};
|
|
41960
|
+
}, []);
|
|
41961
|
+
return {
|
|
41962
|
+
columns,
|
|
41963
|
+
defaultData,
|
|
41964
|
+
rowSelection,
|
|
41965
|
+
setRowSelection,
|
|
41966
|
+
windowWidth,
|
|
41967
|
+
formattedColumns,
|
|
41968
|
+
setFormattedColumns,
|
|
41969
|
+
};
|
|
41970
|
+
}
|
|
41971
|
+
|
|
41972
|
+
const DEFAULT_TEXT$1 = {
|
|
41973
|
+
loading: 'Table is loading...',
|
|
41974
|
+
noResults: 'No results found.',
|
|
41975
|
+
error: 'There was an error loading the data.',
|
|
41976
|
+
resetFilters: 'Reset filters',
|
|
41977
|
+
entry: 'entry',
|
|
41978
|
+
entries: 'entries',
|
|
41979
|
+
of: 'of',
|
|
41980
|
+
};
|
|
41903
41981
|
function TanstackTable(_a) {
|
|
41904
|
-
var { columns: defaultColumns, data, className, currentPage, rowCount, rowsPerPage = 1000, onChangePage, totalEntriesText, TableActions, error, enableRowSelection = true, clearFilters, hasFilters, showPagination = true, isLoading = false,
|
|
41982
|
+
var { columns: defaultColumns, data, className, currentPage, rowCount, rowsPerPage = 1000, onChangePage, totalEntriesText, TableActions, error, enableRowSelection = true, clearFilters, hasFilters, showPagination = true, isLoading = false, defaultPinnedColumns, onRowClick, activeRows = [], isStriped = true, actionBarClassName, defaultSorting, text: textProp } = _a, rest = __rest(_a, ["columns", "data", "className", "currentPage", "rowCount", "rowsPerPage", "onChangePage", "totalEntriesText", "TableActions", "error", "enableRowSelection", "clearFilters", "hasFilters", "showPagination", "isLoading", "defaultPinnedColumns", "onRowClick", "activeRows", "isStriped", "actionBarClassName", "defaultSorting", "text"]);
|
|
41983
|
+
const text = Object.assign(Object.assign({}, DEFAULT_TEXT$1), textProp);
|
|
41905
41984
|
const { columns, defaultData, windowWidth, rowSelection, // This refers to the checkboxes.
|
|
41906
41985
|
setRowSelection, formattedColumns, setFormattedColumns, } = useTanstackTable({
|
|
41907
41986
|
defaultColumns,
|
|
@@ -41940,20 +42019,18 @@ function TanstackTable(_a) {
|
|
|
41940
42019
|
const renderBody = () => {
|
|
41941
42020
|
var _a;
|
|
41942
42021
|
if (hasErrorAndIsNotLoading || hasNoResults) {
|
|
41943
|
-
return (jsx("tr", { className: "tanstack-table__tbody__tr", children: jsx("td", { className: "tanstack-table__centered-row", colSpan: columns.length, children: jsx(NoResults, { clearFilters: clearFilters, hasFilters: hasFilters, message: hasErrorAndIsNotLoading
|
|
41944
|
-
? (_a = error === null || error === void 0 ? void 0 : error.errorMessage) !== null && _a !== void 0 ? _a : 'There was an error isLoading the data.'
|
|
41945
|
-
: 'No results found.' }) }) }));
|
|
42022
|
+
return (jsx("tr", { className: "tanstack-table__tbody__tr", children: jsx("td", { className: "tanstack-table__centered-row", colSpan: columns.length, children: jsx(NoResults, { clearFilters: clearFilters, hasFilters: hasFilters, resetFiltersText: text.resetFilters, message: hasErrorAndIsNotLoading ? (_a = error === null || error === void 0 ? void 0 : error.errorMessage) !== null && _a !== void 0 ? _a : text.error : text.noResults }) }) }));
|
|
41946
42023
|
}
|
|
41947
42024
|
if (isLoading) {
|
|
41948
|
-
return jsx(TableLoading, { columns: columns, message:
|
|
42025
|
+
return jsx(TableLoading, { columns: columns, message: text.loading });
|
|
41949
42026
|
}
|
|
41950
42027
|
return (jsx(TableBody, { table: table, onRowClick: onRowClick, activeRows: activeRows }));
|
|
41951
42028
|
};
|
|
41952
42029
|
return (jsxs("div", { className: "tanstack-table__outer-container", children: [jsxs("div", { className: "tanstack-table__container", children: [jsxs("table", { className: classNames('tanstack-table', className, {
|
|
41953
42030
|
'is-striped': isStriped,
|
|
41954
|
-
}), children: [jsx("thead", { className: "tanstack-table__thead", children: jsx(TableHeader, { table: table, ref: thRefs }) }), jsx("tbody", { className: "tanstack-table__tbody", children: renderBody() })] }), hasSelectedRows && (jsx(ActionBar, { table: table, TableActions: TableActions, className: actionBarClassName }))] }), shouldRenderPagination ? (jsx(TablePagination, { currentPage: currentPage, rowCount: rowCount, onChangePage: onChangePage, rowsPerPage: rowsPerPage, totalEntriesText:
|
|
41955
|
-
?
|
|
41956
|
-
: `${totalRowsOnPage} of ${rowCount} entries` })) : null] }));
|
|
42031
|
+
}), children: [jsx("thead", { className: "tanstack-table__thead", children: jsx(TableHeader, { table: table, ref: thRefs }) }), jsx("tbody", { className: "tanstack-table__tbody", children: renderBody() })] }), hasSelectedRows && (jsx(ActionBar, { table: table, TableActions: TableActions, className: actionBarClassName }))] }), shouldRenderPagination ? (jsx(TablePagination, { currentPage: currentPage, rowCount: rowCount, onChangePage: onChangePage, rowsPerPage: rowsPerPage, totalEntriesText: totalEntriesText !== null && totalEntriesText !== void 0 ? totalEntriesText : (rowCount === 1
|
|
42032
|
+
? `1 ${text.entry}`
|
|
42033
|
+
: `${totalRowsOnPage} ${text.of} ${rowCount} ${text.entries}`), text: { of: text.of } })) : null] }));
|
|
41957
42034
|
}
|
|
41958
42035
|
|
|
41959
42036
|
/**
|
|
@@ -43482,6 +43559,10 @@ function BarSpinner(_a) {
|
|
|
43482
43559
|
return (jsx("div", Object.assign({ className: `bar-spinner ${className}`, id: id, style: style }, rest, { children: jsx("span", {}) })));
|
|
43483
43560
|
}
|
|
43484
43561
|
|
|
43562
|
+
const BackNavigation = ({ isDisabled, onBackClick, label }) => {
|
|
43563
|
+
return (jsx("div", { className: "stepper-navigation-back", children: jsx(Button$1, { "data-testid": "stepper-back-button", ariaLabel: label, iconLeft: "fa-arrow-left", onClick: onBackClick, variant: "outline", isDisabled: isDisabled, children: label }) }));
|
|
43564
|
+
};
|
|
43565
|
+
|
|
43485
43566
|
const Legend = ({ currentStep, steps, onStepClick }) => {
|
|
43486
43567
|
const totalSteps = (steps === null || steps === void 0 ? void 0 : steps.length) || 0;
|
|
43487
43568
|
return (jsx("div", { className: "stepper-legend", children: steps === null || steps === void 0 ? void 0 : steps.map((step, index) => {
|
|
@@ -43501,15 +43582,17 @@ const Legend = ({ currentStep, steps, onStepClick }) => {
|
|
|
43501
43582
|
}) }));
|
|
43502
43583
|
};
|
|
43503
43584
|
|
|
43504
|
-
const
|
|
43505
|
-
return (jsx("div", { className: "stepper-navigation-
|
|
43585
|
+
const NextNavigation = ({ isLastStep, onNextClick, onFinishClick, isDisabled, nextLabel, finishLabel, }) => {
|
|
43586
|
+
return (jsx("div", { className: "stepper-navigation", children: !isLastStep ? (jsx("div", { className: "stepper-navigation-next", children: jsx(Button$1, { "data-testid": "stepper-next-button", iconRight: "fa-arrow-right", ariaLabel: nextLabel, onClick: onNextClick, isDisabled: isDisabled, children: nextLabel }) })) : (jsx("div", { className: "stepper-navigation-finish", children: jsx(Button$1, { "data-testid": "stepper-finish-button", ariaLabel: finishLabel, onClick: onFinishClick, isDisabled: isDisabled, children: finishLabel }) })) }));
|
|
43506
43587
|
};
|
|
43507
43588
|
|
|
43508
|
-
const
|
|
43509
|
-
|
|
43589
|
+
const DEFAULT_TEXT = {
|
|
43590
|
+
previousStep: 'Previous Step',
|
|
43591
|
+
nextStep: 'Next Step',
|
|
43592
|
+
finish: 'Finish',
|
|
43510
43593
|
};
|
|
43511
|
-
|
|
43512
|
-
const
|
|
43594
|
+
const Stepper = ({ currentStep: externalCurrentStep, legendHeader, legendFooter, steps, onBackClick, onNextClick, onFinishClick, children, onStepClick, text: textProp, }) => {
|
|
43595
|
+
const text = Object.assign(Object.assign({}, DEFAULT_TEXT), textProp);
|
|
43513
43596
|
const [internalCurrentStep, setInternalCurrentStep] = useState(0);
|
|
43514
43597
|
const currentStep = externalCurrentStep !== undefined ? externalCurrentStep : internalCurrentStep;
|
|
43515
43598
|
// Convert children to array to access by index
|
|
@@ -43545,7 +43628,7 @@ const Stepper = ({ currentStep: externalCurrentStep, legendHeader, legendFooter,
|
|
|
43545
43628
|
const disableNextButton = (step) => {
|
|
43546
43629
|
return steps[step].isOptional || !steps[step].isCompleted;
|
|
43547
43630
|
};
|
|
43548
|
-
return (jsxs("div", { className: "stepper", children: [jsxs("div", { className: "legend", children: [jsx("div", { className: "legend-header", children: legendHeader }), jsx("div", { className: "legend-body", children: jsx(Legend, { currentStep: currentStep, steps: steps, onStepClick: handleStepClick }) }), jsx("div", { className: "legend-footer", children: legendFooter })] }), jsxs("div", { className: "stepper-body", children: [jsx("div", { className: "stepper-content", children: jsx("div", { className: "stepper-steps", children: childrenArray[currentStep] }) }), jsxs("div", { className: "stepper-actions", children: [jsx(BackNavigation, { isDisabled: isFirstStep, onBackClick: handleBackClick }), jsx(NextNavigation, { isLastStep: isLastStep, onNextClick: handleNextClick, onFinishClick: handleFinishClick, isDisabled: disableNextButton(currentStep) })] })] })] }));
|
|
43631
|
+
return (jsxs("div", { className: "stepper", children: [jsxs("div", { className: "legend", children: [jsx("div", { className: "legend-header", children: legendHeader }), jsx("div", { className: "legend-body", children: jsx(Legend, { currentStep: currentStep, steps: steps, onStepClick: handleStepClick }) }), jsx("div", { className: "legend-footer", children: legendFooter })] }), jsxs("div", { className: "stepper-body", children: [jsx("div", { className: "stepper-content", children: jsx("div", { className: "stepper-steps", children: childrenArray[currentStep] }) }), jsxs("div", { className: "stepper-actions", children: [jsx(BackNavigation, { isDisabled: isFirstStep, onBackClick: handleBackClick, label: text.previousStep }), jsx(NextNavigation, { isLastStep: isLastStep, onNextClick: handleNextClick, onFinishClick: handleFinishClick, isDisabled: disableNextButton(currentStep), nextLabel: text.nextStep, finishLabel: text.finish })] })] })] }));
|
|
43549
43632
|
};
|
|
43550
43633
|
|
|
43551
43634
|
// Unique ID creation requires a high quality random # generator. In the browser we therefore
|