@turnit-ou/shared 0.0.0-stage → 2.18.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/@types/@mui/index.d.ts +125 -0
- package/@types/axios/index.d.ts +7 -0
- package/@types/openapi-client-axios/index.d.ts +5 -0
- package/@types/openapi-typescript/index.d.ts +71 -0
- package/@types/react-final-form-arrays/index.d.ts +75 -0
- package/@types/react-table/index.d.ts +292 -0
- package/components/Alert/AlertTemplate.d.ts +3 -0
- package/components/Alert/AlertTemplate.js +66 -0
- package/components/Alert/index.d.ts +4 -0
- package/components/Alert/index.js +17 -0
- package/components/ConfirmButton.d.ts +15 -0
- package/components/ConfirmButton.js +47 -0
- package/components/Drawer.d.ts +4 -0
- package/components/Drawer.js +24 -0
- package/components/DrawerForm/DrawerFormCardActions.d.ts +5 -0
- package/components/DrawerForm/DrawerFormCardActions.js +21 -0
- package/components/DrawerForm/DrawerFormCloseButton.d.ts +3 -0
- package/components/DrawerForm/DrawerFormCloseButton.js +5 -0
- package/components/DrawerForm/DrawerFormContext.d.ts +7 -0
- package/components/DrawerForm/DrawerFormContext.js +4 -0
- package/components/DrawerForm.d.ts +10 -0
- package/components/DrawerForm.js +84 -0
- package/components/Editor/Editor.d.ts +9 -0
- package/components/Editor/Editor.js +36 -0
- package/components/Editor/Toolbar.d.ts +7 -0
- package/components/Editor/Toolbar.js +31 -0
- package/components/Editor/buttons/FormatLinkButton.d.ts +5 -0
- package/components/Editor/buttons/FormatLinkButton.js +64 -0
- package/components/Editor/buttons/InsertImageButton.d.ts +5 -0
- package/components/Editor/buttons/InsertImageButton.js +59 -0
- package/components/Editor/buttons.d.ts +15 -0
- package/components/Editor/buttons.js +70 -0
- package/components/Editor/createButton.d.ts +28 -0
- package/components/Editor/createButton.js +68 -0
- package/components/Editor/editor.scss +45 -0
- package/components/Ellipsis.d.ts +9 -0
- package/components/Ellipsis.js +22 -0
- package/components/EllipsisText.d.ts +8 -0
- package/components/EllipsisText.js +25 -0
- package/components/EnvironmentBanner.d.ts +8 -0
- package/components/EnvironmentBanner.js +25 -0
- package/components/Header/AccessibilityModal.d.ts +5 -0
- package/components/Header/AccessibilityModal.js +28 -0
- package/components/Header/AllowedBusinessEntityModal.d.ts +9 -0
- package/components/Header/AllowedBusinessEntityModal.js +24 -0
- package/components/Header/LanguageSelect.d.ts +2 -0
- package/components/Header/LanguageSelect.js +80 -0
- package/components/Header/MenuItems.d.ts +9 -0
- package/components/Header/MenuItems.js +55 -0
- package/components/Header/ModuleIcon.d.ts +7 -0
- package/components/Header/ModuleIcon.js +119 -0
- package/components/Header/index.d.ts +44 -0
- package/components/Header/index.js +89 -0
- package/components/Layout/LayoutCol.d.ts +8 -0
- package/components/Layout/LayoutCol.js +26 -0
- package/components/Layout/index.d.ts +32 -0
- package/components/Layout/index.js +56 -0
- package/components/Loadable.d.ts +11 -0
- package/components/Loadable.js +3 -0
- package/components/SearchCard.d.ts +8 -0
- package/components/SearchCard.js +81 -0
- package/components/SearchForm.d.ts +14 -0
- package/components/SearchForm.js +51 -0
- package/components/SearchFormTable.d.ts +8 -0
- package/components/SearchFormTable.js +32 -0
- package/components/SearchResult.d.ts +13 -0
- package/components/SearchResult.js +67 -0
- package/components/Table/TableCaption.d.ts +6 -0
- package/components/Table/TableCaption.js +25 -0
- package/components/Table/TableCell.d.ts +17 -0
- package/components/Table/TableCell.js +45 -0
- package/components/Table/TableCellEditable.d.ts +28 -0
- package/components/Table/TableCellEditable.js +151 -0
- package/components/Table/TableCellEditableAction.d.ts +13 -0
- package/components/Table/TableCellEditableAction.js +70 -0
- package/components/Table/TableCellEditableField.d.ts +17 -0
- package/components/Table/TableCellEditableField.js +1 -0
- package/components/Table/TableCellEditableTimeDuration.d.ts +13 -0
- package/components/Table/TableCellEditableTimeDuration.js +12 -0
- package/components/Table/TableContext.d.ts +11 -0
- package/components/Table/TableContext.js +4 -0
- package/components/Table/TablePagination.d.ts +5 -0
- package/components/Table/TablePagination.js +84 -0
- package/components/Table.d.ts +53 -0
- package/components/Table.js +389 -0
- package/components/Version.d.ts +5 -0
- package/components/Version.js +23 -0
- package/dto/businessEntity.d.ts +15 -0
- package/dto/businessEntity.js +1 -0
- package/dto/classification.d.ts +9 -0
- package/dto/classification.js +1 -0
- package/dto/classifier.d.ts +13 -0
- package/dto/classifier.js +4 -0
- package/dto/common.d.ts +5 -0
- package/dto/common.js +1 -0
- package/dto/fare.d.ts +11 -0
- package/dto/fare.js +1 -0
- package/dto/line-network.d.ts +23 -0
- package/dto/line-network.js +1 -0
- package/dto/option.d.ts +7 -0
- package/dto/option.js +1 -0
- package/dto/pagination.d.ts +10 -0
- package/dto/pagination.js +1 -0
- package/fields/FormCheckbox.d.ts +11 -0
- package/fields/FormCheckbox.js +5 -0
- package/fields/FormCheckboxGroup.d.ts +6 -0
- package/fields/FormCheckboxGroup.js +20 -0
- package/fields/FormController.d.ts +7 -0
- package/fields/FormController.js +16 -0
- package/fields/FormDatepicker.d.ts +8 -0
- package/fields/FormDatepicker.js +7 -0
- package/fields/FormInput.d.ts +8 -0
- package/fields/FormInput.js +4 -0
- package/fields/FormRadioGroup.d.ts +10 -0
- package/fields/FormRadioGroup.js +6 -0
- package/fields/FormSelect.d.ts +11 -0
- package/fields/FormSelect.js +9 -0
- package/fields/FormSwitch.d.ts +11 -0
- package/fields/FormSwitch.js +5 -0
- package/fields/FormTimeZoneSelect.d.ts +4 -0
- package/fields/FormTimeZoneSelect.js +8 -0
- package/fields/index.d.ts +9 -0
- package/fields/index.js +9 -0
- package/form/ArrayField.d.ts +27 -0
- package/form/ArrayField.js +69 -0
- package/form/CheckboxField.d.ts +8 -0
- package/form/CheckboxField.js +14 -0
- package/form/CheckboxGroupField.d.ts +6 -0
- package/form/CheckboxGroupField.js +15 -0
- package/form/ConditionField.d.ts +7 -0
- package/form/ConditionField.js +20 -0
- package/form/ContentField.d.ts +7 -0
- package/form/ContentField.js +15 -0
- package/form/CounterField.d.ts +5 -0
- package/form/CounterField.js +7 -0
- package/form/DateField.d.ts +8 -0
- package/form/DateField.js +52 -0
- package/form/DatesArrayField.d.ts +8 -0
- package/form/DatesArrayField.js +79 -0
- package/form/DependSelectField.d.ts +8 -0
- package/form/DependSelectField.js +12 -0
- package/form/EditorField.d.ts +5 -0
- package/form/EditorField.js +7 -0
- package/form/FileField.d.ts +12 -0
- package/form/FileField.js +9 -0
- package/form/FormField.d.ts +15 -0
- package/form/FormField.js +22 -0
- package/form/ModalFieldArray.d.ts +13 -0
- package/form/ModalFieldArray.js +62 -0
- package/form/PeriodField.d.ts +24 -0
- package/form/PeriodField.js +111 -0
- package/form/RadioGroupField.d.ts +10 -0
- package/form/RadioGroupField.js +21 -0
- package/form/SearchField.d.ts +19 -0
- package/form/SearchField.js +51 -0
- package/form/SelectField.d.ts +8 -0
- package/form/SelectField.js +13 -0
- package/form/SelectOwnerField.d.ts +11 -0
- package/form/SelectOwnerField.js +11 -0
- package/form/StopsSelect/StopSelectWithSearch.d.ts +28 -0
- package/form/StopsSelect/StopSelectWithSearch.js +181 -0
- package/form/StopsSelect/StopsSelect.d.ts +19 -0
- package/form/StopsSelect/StopsSelect.js +65 -0
- package/form/StopsSelect/StopsSelectModal.d.ts +26 -0
- package/form/StopsSelect/StopsSelectModal.js +280 -0
- package/form/StopsSelect/StopsSelectSearchForm.d.ts +22 -0
- package/form/StopsSelect/StopsSelectSearchForm.js +43 -0
- package/form/SwitchField.d.ts +9 -0
- package/form/SwitchField.js +16 -0
- package/form/TextField.d.ts +6 -0
- package/form/TextField.js +21 -0
- package/form/TimeDurationField.d.ts +6 -0
- package/form/TimeDurationField.js +54 -0
- package/form/TimeZoneField.d.ts +6 -0
- package/form/TimeZoneField.js +8 -0
- package/form/ToggleButtonGroupField.d.ts +12 -0
- package/form/ToggleButtonGroupField.js +16 -0
- package/form/hooks/addLazyFieldMetaState.d.ts +3 -0
- package/form/hooks/addLazyFieldMetaState.js +55 -0
- package/form/hooks/getValue.d.ts +3 -0
- package/form/hooks/getValue.js +60 -0
- package/form/hooks/useConstant.d.ts +13 -0
- package/form/hooks/useConstant.js +20 -0
- package/form/hooks/useConstantCallback.d.ts +7 -0
- package/form/hooks/useConstantCallback.js +14 -0
- package/form/hooks/useField.d.ts +3 -0
- package/form/hooks/useField.js +175 -0
- package/form/hooks/useFieldArray.d.ts +6 -0
- package/form/hooks/useFieldArray.js +87 -0
- package/form/hooks/useLatest.d.ts +3 -0
- package/form/hooks/useLatest.js +8 -0
- package/form/hooks/useModalTableSelectedRows.d.ts +12 -0
- package/form/hooks/useModalTableSelectedRows.js +66 -0
- package/form/hooks/useWatch.d.ts +12 -0
- package/form/hooks/useWatch.js +16 -0
- package/form/index.d.ts +45 -0
- package/form/index.js +58 -0
- package/form/mutators/change.d.ts +2 -0
- package/form/mutators/change.js +9 -0
- package/form/validate.d.ts +14 -0
- package/form/validate.js +39 -0
- package/helpers/capitalize.d.ts +1 -0
- package/helpers/capitalize.js +1 -0
- package/helpers/filter.d.ts +4 -0
- package/helpers/filter.js +21 -0
- package/helpers/formSubmit.d.ts +5 -0
- package/helpers/formSubmit.js +21 -0
- package/helpers/index.d.ts +7 -0
- package/helpers/index.js +7 -0
- package/helpers/makeClassificationOptions.d.ts +30 -0
- package/helpers/makeClassificationOptions.js +29 -0
- package/helpers/map.d.ts +1 -0
- package/helpers/map.js +1 -0
- package/helpers/openapi.d.ts +10 -0
- package/helpers/openapi.js +10 -0
- package/helpers/renderRangeError.d.ts +1 -0
- package/helpers/renderRangeError.js +20 -0
- package/helpers/sentry/assertEnvVariable.d.ts +1 -0
- package/helpers/sentry/assertEnvVariable.js +7 -0
- package/helpers/sentry/sentryConfig.d.ts +2 -0
- package/helpers/sentry/sentryConfig.js +18 -0
- package/helpers/serializeErrors.d.ts +2 -0
- package/helpers/serializeErrors.js +13 -0
- package/hooks/index.d.ts +26 -0
- package/hooks/index.js +26 -0
- package/hooks/useAllowedBusinessEntities.d.ts +4 -0
- package/hooks/useAllowedBusinessEntities.js +9 -0
- package/hooks/useBusinessEntitiesByType.d.ts +8 -0
- package/hooks/useBusinessEntitiesByType.js +17 -0
- package/hooks/useChangePassword.d.ts +14 -0
- package/hooks/useChangePassword.js +48 -0
- package/hooks/useClassification.d.ts +9 -0
- package/hooks/useClassification.js +16 -0
- package/hooks/useDraggable.d.ts +5 -0
- package/hooks/useDraggable.js +11 -0
- package/hooks/useEllipsis.d.ts +10 -0
- package/hooks/useEllipsis.js +79 -0
- package/hooks/useFavicon.d.ts +1 -0
- package/hooks/useFavicon.js +13 -0
- package/hooks/useFormTable.d.ts +24 -0
- package/hooks/useFormTable.js +105 -0
- package/hooks/useFormTableControls.d.ts +31 -0
- package/hooks/useFormTableControls.js +34 -0
- package/hooks/useInertBackground.d.ts +20 -0
- package/hooks/useInertBackground.js +57 -0
- package/hooks/useIsMounted.d.ts +2 -0
- package/hooks/useIsMounted.js +11 -0
- package/hooks/useLanguage.d.ts +1 -0
- package/hooks/useLanguage.js +2 -0
- package/hooks/useLoaded.d.ts +1 -0
- package/hooks/useLoaded.js +19 -0
- package/hooks/useLocale.d.ts +1 -0
- package/hooks/useLocale.js +7 -0
- package/hooks/useModal.d.ts +307 -0
- package/hooks/useModal.js +12 -0
- package/hooks/useOptions.d.ts +13 -0
- package/hooks/useOptions.js +24 -0
- package/hooks/usePrevious.d.ts +1 -0
- package/hooks/usePrevious.js +12 -0
- package/hooks/usePrompt.d.ts +8 -0
- package/hooks/usePrompt.js +17 -0
- package/hooks/useRowActive.d.ts +6 -0
- package/hooks/useRowActive.js +104 -0
- package/hooks/useRowEditActions.d.ts +5 -0
- package/hooks/useRowEditActions.js +12 -0
- package/hooks/useRowExpandToggle.d.ts +5 -0
- package/hooks/useRowExpandToggle.js +13 -0
- package/hooks/useRowHidden.d.ts +4 -0
- package/hooks/useRowHidden.js +6 -0
- package/hooks/useRowSelectCheckbox.d.ts +27 -0
- package/hooks/useRowSelectCheckbox.js +48 -0
- package/hooks/useTable.d.ts +4 -0
- package/hooks/useTable.js +38 -0
- package/hooks/useTableRowHighlight.d.ts +4 -0
- package/hooks/useTableRowHighlight.js +16 -0
- package/hooks/useTranslation.d.ts +3 -0
- package/hooks/useTranslation.js +3 -0
- package/hooks/useWeekdayOptions.d.ts +40 -0
- package/hooks/useWeekdayOptions.js +66 -0
- package/i18n/index.d.ts +13 -0
- package/i18n/index.js +82 -0
- package/i18n/resources/de.json +115 -0
- package/i18n/resources/el.json +116 -0
- package/i18n/resources/en-AE.json +115 -0
- package/i18n/resources/en.json +118 -0
- package/i18n/resources/es.json +115 -0
- package/i18n/resources/fr.json +115 -0
- package/i18n/resources/index.d.ts +1295 -0
- package/i18n/resources/index.js +24 -0
- package/i18n/resources/it.json +115 -0
- package/i18n/resources/lt.json +115 -0
- package/i18n/resources/pt.json +115 -0
- package/i18n/resources/sk.json +115 -0
- package/i18n/resources/sv.json +116 -0
- package/i18n/trans/alert.d.ts +8 -0
- package/i18n/trans/alert.js +10 -0
- package/i18n/trans/button.d.ts +24 -0
- package/i18n/trans/button.js +26 -0
- package/i18n/trans/error.d.ts +10 -0
- package/i18n/trans/error.js +12 -0
- package/i18n/trans/field.d.ts +19 -0
- package/i18n/trans/field.js +21 -0
- package/i18n/trans/index.d.ts +13 -0
- package/i18n/trans/index.js +20 -0
- package/i18n/trans/label.d.ts +18 -0
- package/i18n/trans/label.js +20 -0
- package/i18n/trans/option.d.ts +6 -0
- package/i18n/trans/option.js +8 -0
- package/i18n/trans/qty.d.ts +5 -0
- package/i18n/trans/qty.js +7 -0
- package/i18n/trans/table.d.ts +8 -0
- package/i18n/trans/table.js +10 -0
- package/i18n/trans/title.d.ts +6 -0
- package/i18n/trans/title.js +8 -0
- package/i18n/trans/tooltip.d.ts +8 -0
- package/i18n/trans/tooltip.js +10 -0
- package/icons/1-class.svg +4 -0
- package/icons/2-class-calm.svg +5 -0
- package/icons/2-class-crossed.svg +5 -0
- package/icons/2-class.svg +4 -0
- package/icons/3-class.svg +4 -0
- package/icons/4-class.svg +4 -0
- package/icons/ac-crossed.svg +6 -0
- package/icons/ac.svg +9 -0
- package/icons/accessibility.svg +5 -0
- package/icons/add-journey-segment.svg +9 -0
- package/icons/add-person.svg +6 -0
- package/icons/add.svg +4 -0
- package/icons/air-condition.svg +11 -0
- package/icons/airport.svg +4 -0
- package/icons/alert-circle.svg +5 -0
- package/icons/arrow-down.svg +4 -0
- package/icons/arrow-left-circle.svg +5 -0
- package/icons/arrow-left.svg +4 -0
- package/icons/arrow-right.svg +4 -0
- package/icons/arrow-up.svg +4 -0
- package/icons/baby-care.svg +7 -0
- package/icons/bar.svg +6 -0
- package/icons/bed.svg +3 -0
- package/icons/bicycle-crossed.svg +6 -0
- package/icons/bicycle.svg +8 -0
- package/icons/bin.svg +6 -0
- package/icons/break.svg +5 -0
- package/icons/breakfast-1-class.svg +5 -0
- package/icons/breakfast-2-class.svg +5 -0
- package/icons/breakfast.svg +3 -0
- package/icons/bus.svg +7 -0
- package/icons/business-area.svg +6 -0
- package/icons/by-aisle.svg +8 -0
- package/icons/by-window.svg +6 -0
- package/icons/cafe-1-class.svg +5 -0
- package/icons/calendar.svg +6 -0
- package/icons/cancel.svg +5 -0
- package/icons/cargo.svg +4 -0
- package/icons/carriage-bot.svg +6 -0
- package/icons/carriage-mid.svg +4 -0
- package/icons/carriage-top.svg +12 -0
- package/icons/carriage.svg +3 -0
- package/icons/cart.svg +3 -0
- package/icons/cd.svg +4 -0
- package/icons/check-circle.svg +4 -0
- package/icons/check.svg +3 -0
- package/icons/checkbox-checked.svg +4 -0
- package/icons/checkbox-indeterminate.svg +5 -0
- package/icons/checkbox-mark.svg +3 -0
- package/icons/checkbox.svg +3 -0
- package/icons/chevron-down.svg +3 -0
- package/icons/chevron-left.svg +3 -0
- package/icons/chevron-right.svg +3 -0
- package/icons/chevron-up.svg +3 -0
- package/icons/circle.svg +3 -0
- package/icons/clock.svg +5 -0
- package/icons/clone.svg +4 -0
- package/icons/close-bold.svg +4 -0
- package/icons/close.svg +4 -0
- package/icons/coffee-machine-crossed.svg +6 -0
- package/icons/coffee-machine.svg +7 -0
- package/icons/coin.svg +4 -0
- package/icons/comment.svg +3 -0
- package/icons/compartment.svg +6 -0
- package/icons/couchette.svg +6 -0
- package/icons/cube.svg +1 -0
- package/icons/currency.svg +4 -0
- package/icons/deactivate.svg +4 -0
- package/icons/delete.svg +4 -0
- package/icons/dining.svg +7 -0
- package/icons/direction-bottom.svg +4 -0
- package/icons/direction-forward-v.svg +4 -0
- package/icons/direction-forward.svg +4 -0
- package/icons/direction-left.svg +4 -0
- package/icons/direction-reverse-v.svg +4 -0
- package/icons/direction-reverse.svg +4 -0
- package/icons/direction-right.svg +4 -0
- package/icons/direction-top.svg +4 -0
- package/icons/dots.svg +5 -0
- package/icons/download.svg +5 -0
- package/icons/drag-n-drop.svg +3 -0
- package/icons/draggable.svg +5 -0
- package/icons/duplicate.svg +4 -0
- package/icons/dvd.svg +5 -0
- package/icons/edit.svg +3 -0
- package/icons/empty-search.svg +9 -0
- package/icons/empty-state.svg +13 -0
- package/icons/empty.svg +9 -0
- package/icons/empty_search_purple.svg +6 -0
- package/icons/error-circle.svg +4 -0
- package/icons/eu-law.svg +5 -0
- package/icons/external_link.svg +5 -0
- package/icons/family-area.svg +7 -0
- package/icons/file-settings.svg +3 -0
- package/icons/file.svg +11 -0
- package/icons/filter.svg +3 -0
- package/icons/flip.svg +11 -0
- package/icons/food-1-class.svg +5 -0
- package/icons/food-plus.svg +5 -0
- package/icons/food.svg +7 -0
- package/icons/grid-cell.svg +1 -0
- package/icons/grid.svg +6 -0
- package/icons/headphones.svg +5 -0
- package/icons/helping-hand-crossed.svg +12 -0
- package/icons/helping-hand.svg +3 -0
- package/icons/hide.svg +4 -0
- package/icons/home.svg +4 -0
- package/icons/index.json +228 -0
- package/icons/info-circle.svg +5 -0
- package/icons/insurance.svg +6 -0
- package/icons/journey-changeover.svg +5 -0
- package/icons/journey-light.svg +5 -0
- package/icons/journey.svg +5 -0
- package/icons/key.svg +4 -0
- package/icons/language.svg +3 -0
- package/icons/link.svg +4 -0
- package/icons/list.svg +8 -0
- package/icons/locker.svg +8 -0
- package/icons/logout.svg +5 -0
- package/icons/luggage.svg +9 -0
- package/icons/mail.svg +4 -0
- package/icons/meeting-lounge.svg +10 -0
- package/icons/metro.svg +3 -0
- package/icons/middle-seat.svg +7 -0
- package/icons/minus.svg +3 -0
- package/icons/minus24.svg +3 -0
- package/icons/mobile-crossed.svg +7 -0
- package/icons/mobile.svg +6 -0
- package/icons/movingo.svg +3 -0
- package/icons/multimedia.svg +9 -0
- package/icons/near-bicycle.svg +5 -0
- package/icons/near-pet.svg +5 -0
- package/icons/near-wheelchair.svg +8 -0
- package/icons/night-train.svg +4 -0
- package/icons/nonstop.svg +3 -0
- package/icons/occupancy-seat-hover.svg +11 -0
- package/icons/occupancy-seat-selected.svg +11 -0
- package/icons/occupancy-seat.svg +4 -0
- package/icons/oneway.svg +4 -0
- package/icons/pet-crossed.svg +5 -0
- package/icons/pet.svg +7 -0
- package/icons/pic.svg +5 -0
- package/icons/playground.svg +7 -0
- package/icons/plus.svg +4 -0
- package/icons/plus24.svg +4 -0
- package/icons/popup-controls.svg +15 -0
- package/icons/power-socket.svg +6 -0
- package/icons/preview.svg +3 -0
- package/icons/print.svg +5 -0
- package/icons/priority-seat-elderly.svg +6 -0
- package/icons/priority-seat-pregnant.svg +5 -0
- package/icons/profile.svg +4 -0
- package/icons/question.svg +5 -0
- package/icons/radio-filled.svg +4 -0
- package/icons/radio.svg +3 -0
- package/icons/reclining-seat.svg +9 -0
- package/icons/refresh.svg +6 -0
- package/icons/reload.svg +4 -0
- package/icons/remove-circle.svg +3 -0
- package/icons/replace.svg +6 -0
- package/icons/reservation-crossed.svg +4 -0
- package/icons/reservation-mandatory.svg +4 -0
- package/icons/reservation-optional.svg +5 -0
- package/icons/resplus-horizontal.svg +1 -0
- package/icons/resplus.svg +3 -0
- package/icons/restaurant.svg +3 -0
- package/icons/roundtrip.svg +6 -0
- package/icons/save.svg +5 -0
- package/icons/search.svg +4 -0
- package/icons/seat-compartment.svg +8 -0
- package/icons/seat-selected.svg +3 -0
- package/icons/seat.svg +5 -0
- package/icons/sent.svg +34 -0
- package/icons/service-dog.svg +4 -0
- package/icons/settings.svg +4 -0
- package/icons/shift.svg +3 -0
- package/icons/ship.svg +3 -0
- package/icons/show.svg +4 -0
- package/icons/shower.svg +9 -0
- package/icons/silence.svg +6 -0
- package/icons/sink.svg +5 -0
- package/icons/skis.svg +8 -0
- package/icons/sleeper-car-bedding.svg +6 -0
- package/icons/sleeper-car.svg +5 -0
- package/icons/smoking-crossed.svg +6 -0
- package/icons/sort.svg +6 -0
- package/icons/stairs-down.svg +5 -0
- package/icons/stairs-up.svg +5 -0
- package/icons/star-filled.svg +3 -0
- package/icons/star.svg +3 -0
- package/icons/stroller.svg +6 -0
- package/icons/sw-law.svg +5 -0
- package/icons/switch.svg +3 -0
- package/icons/table.svg +6 -0
- package/icons/tag.svg +4 -0
- package/icons/taxi.svg +3 -0
- package/icons/tick.svg +3 -0
- package/icons/ticket-cancel.svg +8 -0
- package/icons/ticket-change.svg +3 -0
- package/icons/ticket-manage.svg +7 -0
- package/icons/ticket-refund.svg +8 -0
- package/icons/ticket-travel-pass.svg +4 -0
- package/icons/ticket.svg +6 -0
- package/icons/tickets.svg +4 -0
- package/icons/train.svg +3 -0
- package/icons/transfer.svg +3 -0
- package/icons/trash.svg +6 -0
- package/icons/triange.svg +17 -0
- package/icons/tv.svg +5 -0
- package/icons/unaccompanied-minor.svg +8 -0
- package/icons/upload.svg +5 -0
- package/icons/usb.svg +9 -0
- package/icons/visibility-off.svg +4 -0
- package/icons/visibility-on.svg +4 -0
- package/icons/voucher.svg +5 -0
- package/icons/wardrobe.svg +4 -0
- package/icons/warning.svg +3 -0
- package/icons/water.svg +5 -0
- package/icons/wc.svg +4 -0
- package/icons/wheelchair-lift-reservation.svg +8 -0
- package/icons/wheelchair-lift.svg +6 -0
- package/icons/wheelchair-ramp.svg +8 -0
- package/icons/wheelchair-space-reservation.svg +13 -0
- package/icons/wheelchair-space.svg +4 -0
- package/icons/wheelchair.svg +5 -0
- package/icons/wifi-crossed.svg +9 -0
- package/icons/wifi.svg +6 -0
- package/index.css +327 -0
- package/index.d.ts +31 -0
- package/index.js +32 -0
- package/mui/Accordion.d.ts +17 -0
- package/mui/Accordion.js +46 -0
- package/mui/Button/index.d.ts +16 -0
- package/mui/Button/index.js +35 -0
- package/mui/Card/CardHeader.d.ts +7 -0
- package/mui/Card/CardHeader.js +43 -0
- package/mui/Card/index.d.ts +4 -0
- package/mui/Card/index.js +4 -0
- package/mui/Checkbox/CheckboxGroup.d.ts +26 -0
- package/mui/Checkbox/CheckboxGroup.js +81 -0
- package/mui/Checkbox/index.d.ts +18 -0
- package/mui/Checkbox/index.js +40 -0
- package/mui/Chip/ChipSecondarySmall.d.ts +10 -0
- package/mui/Chip/ChipSecondarySmall.js +40 -0
- package/mui/CircularProgress/index.d.ts +3 -0
- package/mui/CircularProgress/index.js +36 -0
- package/mui/Collapsible/index.d.ts +9 -0
- package/mui/Collapsible/index.js +66 -0
- package/mui/Counter/index.d.ts +9 -0
- package/mui/Counter/index.js +37 -0
- package/mui/DatePicker/DatePicker.scss +276 -0
- package/mui/DatePicker/DatePickerContext.d.ts +8 -0
- package/mui/DatePicker/DatePickerContext.js +2 -0
- package/mui/DatePicker/DatePickerHeader.d.ts +3 -0
- package/mui/DatePicker/DatePickerHeader.js +63 -0
- package/mui/DatePicker/DatePickerHeaderSelect.d.ts +10 -0
- package/mui/DatePicker/DatePickerHeaderSelect.js +72 -0
- package/mui/DatePicker/DatePickerInput.d.ts +6 -0
- package/mui/DatePicker/DatePickerInput.js +28 -0
- package/mui/DatePicker/TimeInput.d.ts +10 -0
- package/mui/DatePicker/TimeInput.js +63 -0
- package/mui/DatePicker/index.d.ts +52 -0
- package/mui/DatePicker/index.js +187 -0
- package/mui/Dropdown/index.d.ts +22 -0
- package/mui/Dropdown/index.js +90 -0
- package/mui/EditableLabel/index.d.ts +7 -0
- package/mui/EditableLabel/index.js +81 -0
- package/mui/ExternalLink/index.d.ts +8 -0
- package/mui/ExternalLink/index.js +11 -0
- package/mui/FileInput/index.d.ts +27 -0
- package/mui/FileInput/index.js +66 -0
- package/mui/FormControl/index.d.ts +23 -0
- package/mui/FormControl/index.js +36 -0
- package/mui/FormField/index.d.ts +8 -0
- package/mui/FormField/index.js +12 -0
- package/mui/Icon/index.d.ts +21 -0
- package/mui/Icon/index.js +47 -0
- package/mui/Input/index.d.ts +28 -0
- package/mui/Input/index.js +102 -0
- package/mui/Loader/index.d.ts +9 -0
- package/mui/Loader/index.js +47 -0
- package/mui/Modal/index.d.ts +16 -0
- package/mui/Modal/index.js +64 -0
- package/mui/Pagination/index.d.ts +6 -0
- package/mui/Pagination/index.js +23 -0
- package/mui/Paper/index.d.ts +4 -0
- package/mui/Paper/index.js +3 -0
- package/mui/Popper/index.d.ts +13 -0
- package/mui/Popper/index.js +139 -0
- package/mui/RadioGroup/index.d.ts +26 -0
- package/mui/RadioGroup/index.js +41 -0
- package/mui/ReadOnlyField/index.d.ts +8 -0
- package/mui/ReadOnlyField/index.js +35 -0
- package/mui/Select/index.d.ts +47 -0
- package/mui/Select/index.js +164 -0
- package/mui/Stepper/StepIconComponent.d.ts +6 -0
- package/mui/Stepper/StepIconComponent.js +93 -0
- package/mui/Stepper/index.d.ts +6 -0
- package/mui/Stepper/index.js +13 -0
- package/mui/Switch/index.d.ts +3 -0
- package/mui/Switch/index.js +2 -0
- package/mui/Tab/index.d.ts +60 -0
- package/mui/Tab/index.js +12 -0
- package/mui/Tabs/index.d.ts +22 -0
- package/mui/Tabs/index.js +70 -0
- package/mui/TimeDurationLabel/index.d.ts +7 -0
- package/mui/TimeDurationLabel/index.js +13 -0
- package/mui/ToggleButton/index.d.ts +4 -0
- package/mui/ToggleButton/index.js +57 -0
- package/mui/ToggleButtonGroup/index.d.ts +25 -0
- package/mui/ToggleButtonGroup/index.js +61 -0
- package/mui/ToggleList/index.d.ts +11 -0
- package/mui/ToggleList/index.js +54 -0
- package/mui/Tooltip/index.d.ts +11 -0
- package/mui/Tooltip/index.js +36 -0
- package/mui/index.d.ts +36 -0
- package/mui/index.js +36 -0
- package/mui/provider.d.ts +9 -0
- package/mui/provider.js +22 -0
- package/mui/theme.d.ts +17 -0
- package/mui/theme.js +1228 -0
- package/package.json +197 -4
- package/services/api.d.ts +28 -0
- package/services/api.js +141 -0
- package/services/index.d.ts +2 -0
- package/services/index.js +2 -0
- package/services/openapi.d.ts +6 -0
- package/services/openapi.js +112 -0
- package/store/index.d.ts +6 -0
- package/store/index.js +1 -0
- package/store/useClassificationOptions.d.ts +3 -0
- package/store/useClassificationOptions.js +2 -0
- package/types.d.ts +2423 -0
- package/utils/array.d.ts +2 -0
- package/utils/array.js +21 -0
- package/utils/auth.d.ts +2 -0
- package/utils/auth.js +31 -0
- package/utils/color.d.ts +29 -0
- package/utils/color.js +132 -0
- package/utils/date.d.ts +40 -0
- package/utils/date.js +51 -0
- package/utils/filter.d.ts +3 -0
- package/utils/filter.js +11 -0
- package/utils/getScrollbarSize.d.ts +1 -0
- package/utils/getScrollbarSize.js +8 -0
- package/utils/index.d.ts +12 -0
- package/utils/index.js +12 -0
- package/utils/input.d.ts +2 -0
- package/utils/input.js +2 -0
- package/utils/knowledge-owl-script.d.ts +64 -0
- package/utils/knowledge-owl-script.js +226 -0
- package/utils/locales.d.ts +3 -0
- package/utils/locales.js +24 -0
- package/utils/noop.d.ts +1 -0
- package/utils/noop.js +1 -0
- package/utils/percentage.d.ts +6 -0
- package/utils/percentage.js +43 -0
- package/utils/redirect.d.ts +1 -0
- package/utils/redirect.js +6 -0
- package/utils/sort.d.ts +21 -0
- package/utils/sort.js +32 -0
- package/utils/storage.d.ts +2 -0
- package/utils/storage.js +2 -0
- package/utils/timeDuration.d.ts +26 -0
- package/utils/timeDuration.js +78 -0
- package/utils/wallClock.d.ts +17 -0
- package/utils/wallClock.js +178 -0
- package/wrappers/ApiInitializer.d.ts +9 -0
- package/wrappers/ApiInitializer.js +21 -0
- package/wrappers/AuthWrapper.d.ts +6 -0
- package/wrappers/AuthWrapper.js +38 -0
- package/wrappers/AxiosErrorsInterceptorWrapper.d.ts +2 -0
- package/wrappers/AxiosErrorsInterceptorWrapper.js +30 -0
- package/README.md +0 -3
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useMemo } from 'react';
|
|
3
|
+
import { makeStyles } from '@mui/styles';
|
|
4
|
+
import { CheckboxField, DateField, EditorField, FileField, SelectField, TextField, TimeZoneField, } from "../../form";
|
|
5
|
+
import { useWatch } from "../../form/hooks/useWatch";
|
|
6
|
+
import { Icon, } from "../../mui";
|
|
7
|
+
import _mapValues from 'lodash/mapValues';
|
|
8
|
+
import _keyBy from 'lodash/keyBy';
|
|
9
|
+
import get from 'lodash/get';
|
|
10
|
+
import { Ellipsis } from "../Ellipsis";
|
|
11
|
+
import { Stack } from '@mui/material';
|
|
12
|
+
const useStyles = makeStyles((theme) => ({
|
|
13
|
+
root: {
|
|
14
|
+
width: 'inherit',
|
|
15
|
+
},
|
|
16
|
+
color: {
|
|
17
|
+
width: 60,
|
|
18
|
+
height: 12,
|
|
19
|
+
border: `1px solid ${theme.palette.common.black}`,
|
|
20
|
+
},
|
|
21
|
+
}), {
|
|
22
|
+
name: 'TableCellEditableField',
|
|
23
|
+
});
|
|
24
|
+
const defaultWrapper = (field) => field;
|
|
25
|
+
export const TableCellEditable = function TableCellEditable(cell) {
|
|
26
|
+
const { row: { index: rowIndex, state: { creatable, editable }, }, column: { conditions, type, wrapper = defaultWrapper }, } = cell;
|
|
27
|
+
const editableProps = useMemo(() => {
|
|
28
|
+
const { editableProps } = cell.column;
|
|
29
|
+
if (!editableProps)
|
|
30
|
+
return {};
|
|
31
|
+
if (typeof editableProps === 'function')
|
|
32
|
+
return editableProps(cell);
|
|
33
|
+
return editableProps;
|
|
34
|
+
}, [cell]);
|
|
35
|
+
const baseFieldName = `rows[${rowIndex}]`;
|
|
36
|
+
const conditionKeys = conditions && Object.keys(conditions);
|
|
37
|
+
const watchFieldMap = useMemo(() => {
|
|
38
|
+
if (!conditions)
|
|
39
|
+
return [];
|
|
40
|
+
return Array.from(new Set(conditionKeys.reduce((acc, key) => {
|
|
41
|
+
const condition = conditions[key];
|
|
42
|
+
return Array.isArray(condition)
|
|
43
|
+
? [...acc, ...condition.map(({ when }) => when)]
|
|
44
|
+
: [...acc, condition.when];
|
|
45
|
+
}, [])).values()).reduce((acc, name) => ({ ...acc, [`${baseFieldName}.${name}`]: name }), {});
|
|
46
|
+
}, [baseFieldName, conditionKeys, conditions]);
|
|
47
|
+
const watchFieldNames = Object.keys(watchFieldMap);
|
|
48
|
+
const state = useWatch(watchFieldNames, { subscription: { value: true } });
|
|
49
|
+
const values = Object.entries(state).reduce((acc, [name, value]) => ({
|
|
50
|
+
...acc,
|
|
51
|
+
[watchFieldMap[name]]: value,
|
|
52
|
+
}), {});
|
|
53
|
+
const conditionalProperties = useMemo(() => {
|
|
54
|
+
if (!conditions)
|
|
55
|
+
return;
|
|
56
|
+
const conditional = (condition) => {
|
|
57
|
+
const { when } = condition;
|
|
58
|
+
const value = values[when].value;
|
|
59
|
+
if ('is' in condition) {
|
|
60
|
+
if (typeof condition.is === 'function')
|
|
61
|
+
return condition.is(value, cell);
|
|
62
|
+
if (Array.isArray(condition.is))
|
|
63
|
+
return condition.is.includes(value);
|
|
64
|
+
return value === condition.is;
|
|
65
|
+
}
|
|
66
|
+
if ('is!' in condition) {
|
|
67
|
+
if (Array.isArray(condition['is!']))
|
|
68
|
+
return !condition['is!'].includes(value);
|
|
69
|
+
return value !== condition['is!'];
|
|
70
|
+
}
|
|
71
|
+
return false;
|
|
72
|
+
};
|
|
73
|
+
return conditionKeys.reduce((acc, key) => {
|
|
74
|
+
const condition = conditions[key];
|
|
75
|
+
return {
|
|
76
|
+
...acc,
|
|
77
|
+
[key]: Array.isArray(condition)
|
|
78
|
+
? condition.map(conditional).includes(true)
|
|
79
|
+
: conditional(condition),
|
|
80
|
+
};
|
|
81
|
+
}, {});
|
|
82
|
+
}, [cell, conditionKeys, conditions, values]);
|
|
83
|
+
const Component = useMemo(() => {
|
|
84
|
+
switch (type) {
|
|
85
|
+
case 'editor':
|
|
86
|
+
return EditorField;
|
|
87
|
+
case 'file':
|
|
88
|
+
return FileField;
|
|
89
|
+
case 'checkbox':
|
|
90
|
+
return CheckboxField;
|
|
91
|
+
case 'date':
|
|
92
|
+
return DateField;
|
|
93
|
+
case 'select':
|
|
94
|
+
return SelectField;
|
|
95
|
+
case 'timezone':
|
|
96
|
+
return TimeZoneField;
|
|
97
|
+
default:
|
|
98
|
+
return TextField;
|
|
99
|
+
}
|
|
100
|
+
}, [type]);
|
|
101
|
+
const classes = useStyles();
|
|
102
|
+
const readModeValue = useMemo(() => {
|
|
103
|
+
if (type === 'select') {
|
|
104
|
+
const { multiple, options } = editableProps;
|
|
105
|
+
const optionsMap = _keyBy(options, 'value');
|
|
106
|
+
const values = multiple ? [].concat(cell.value) : [cell.value];
|
|
107
|
+
return values
|
|
108
|
+
.map((val) => optionsMap[val])
|
|
109
|
+
.map((option, index) => (_jsx("span", { style: option?.isValid === false ? { color: 'red' } : {}, children: option?.label }, index)))
|
|
110
|
+
.filter(Boolean)
|
|
111
|
+
.reduce((acc, curr, index) => index === 0
|
|
112
|
+
? [curr]
|
|
113
|
+
: [...acc, _jsx("span", { children: ", " }, `sep-${index}`), curr], []);
|
|
114
|
+
}
|
|
115
|
+
if (type === 'checkbox' && typeof cell.value === 'boolean') {
|
|
116
|
+
return cell.value ? (_jsx(Icon, { name: "check", color: "success" })) : (_jsx(Icon, { name: "close" }));
|
|
117
|
+
}
|
|
118
|
+
if (type === 'color') {
|
|
119
|
+
return cell.value ? (_jsxs(Stack, { direction: "row", spacing: 1, alignItems: "center", children: [_jsx("div", { children: cell.value }), _jsx("div", { className: classes.color, style: { backgroundColor: cell.value } })] })) : (cell.value);
|
|
120
|
+
}
|
|
121
|
+
return cell.value ? (_jsx(Ellipsis, { ellipsis: true, tooltip: true, content: cell.value, lines: 2 })) : (cell.value);
|
|
122
|
+
}, [type, cell.value, editableProps, classes.color]);
|
|
123
|
+
const handleClick = useCallback((event) => {
|
|
124
|
+
event.stopPropagation();
|
|
125
|
+
editableProps.onClick?.(event);
|
|
126
|
+
}, [editableProps]);
|
|
127
|
+
const { validate } = editableProps;
|
|
128
|
+
const editableValidate = useCallback((value, allValues, meta) => validate?.(value, get(allValues, baseFieldName), meta), [baseFieldName, validate]);
|
|
129
|
+
const preparedEditableProps = useMemo(() => {
|
|
130
|
+
if (!editableProps)
|
|
131
|
+
return {};
|
|
132
|
+
const watchValues = _mapValues(values, ({ value }) => value);
|
|
133
|
+
const { minDate, maxDate, validate, ...props } = editableProps;
|
|
134
|
+
return {
|
|
135
|
+
...(minDate && { minDate: minDate(watchValues) }),
|
|
136
|
+
...(maxDate && { maxDate: maxDate(watchValues) }),
|
|
137
|
+
...(validate && { validate: editableValidate }),
|
|
138
|
+
...props,
|
|
139
|
+
};
|
|
140
|
+
}, [editableProps, values, editableValidate]);
|
|
141
|
+
const field = useMemo(() => (_jsx(Component, { name: `${baseFieldName}.${cell.column.id}`, variant: "filled", options: [], required: true, ...preparedEditableProps, ...conditionalProperties, onClick: handleClick, ...(type === 'color' && { type: 'color' }) })), [
|
|
142
|
+
Component,
|
|
143
|
+
baseFieldName,
|
|
144
|
+
cell.column.id,
|
|
145
|
+
conditionalProperties,
|
|
146
|
+
handleClick,
|
|
147
|
+
preparedEditableProps,
|
|
148
|
+
type,
|
|
149
|
+
]);
|
|
150
|
+
return (_jsx("div", { className: classes.root, children: wrapper(creatable || editable ? field : readModeValue, cell) }));
|
|
151
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { CellProps } from 'react-table';
|
|
2
|
+
import { SetStateAction } from 'react';
|
|
3
|
+
import { UpdateRow } from "../../hooks/useFormTable";
|
|
4
|
+
declare type TableCellEditableActionProps<D extends object> = CellProps<D> & {
|
|
5
|
+
editable?: boolean;
|
|
6
|
+
updateRow: UpdateRow<D>;
|
|
7
|
+
deleteRow: UpdateRow<D>;
|
|
8
|
+
setAutoReset: (value: SetStateAction<boolean>) => void;
|
|
9
|
+
updateRowIdx?: number;
|
|
10
|
+
newRowDefaultValues?: Partial<D>;
|
|
11
|
+
};
|
|
12
|
+
export declare function TableCellEditableAction<D extends object>(cell: TableCellEditableActionProps<D>): JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { makeStyles } from '@mui/styles';
|
|
3
|
+
import { useCallback, useMemo } from 'react';
|
|
4
|
+
import { IconButton, Stack } from '@mui/material';
|
|
5
|
+
import { Icon } from "../../mui";
|
|
6
|
+
import { useTranslation } from "../../hooks/useTranslation";
|
|
7
|
+
import { useField, useForm } from 'react-final-form';
|
|
8
|
+
import _startsWith from 'lodash/startsWith';
|
|
9
|
+
import _isEmpty from 'lodash/isEmpty';
|
|
10
|
+
import isEqual from 'lodash/isEqual';
|
|
11
|
+
const useStyles = makeStyles(() => ({
|
|
12
|
+
root: {
|
|
13
|
+
display: 'inline-flex',
|
|
14
|
+
},
|
|
15
|
+
}), {
|
|
16
|
+
name: 'TableCellEditAction',
|
|
17
|
+
});
|
|
18
|
+
export function TableCellEditableAction(cell) {
|
|
19
|
+
const classes = useStyles();
|
|
20
|
+
const { t } = useTranslation();
|
|
21
|
+
const iconProps = useMemo(() => ({
|
|
22
|
+
color: 'inherit',
|
|
23
|
+
size: 'small',
|
|
24
|
+
}), []);
|
|
25
|
+
const handleSetCreatable = useCallback((creatable) => cell.row.setState((prev) => ({ ...prev, creatable })), [cell.row]);
|
|
26
|
+
const handleSetEditable = useCallback((editable) => cell.row.setState((prev) => ({ ...prev, editable })), [cell.row]);
|
|
27
|
+
const handleClickEdit = useCallback(() => handleSetEditable(true), [handleSetEditable]);
|
|
28
|
+
const { getRegisteredFields, reset, getState, getFieldState, focus, blur } = useForm();
|
|
29
|
+
// register field without subscriptions
|
|
30
|
+
useField(`rows[${cell.row.index}]`, { subscription: {} });
|
|
31
|
+
const handleClickSave = useCallback(async () => {
|
|
32
|
+
const { invalid, value } = getFieldState(`rows[${cell.row.index}]`);
|
|
33
|
+
if (invalid) {
|
|
34
|
+
getRegisteredFields()
|
|
35
|
+
.filter((field) => _startsWith(field, `rows[${cell.row.index}].`))
|
|
36
|
+
.forEach((name) => {
|
|
37
|
+
focus(name);
|
|
38
|
+
blur(name);
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
await cell.setAutoReset(false);
|
|
43
|
+
cell.updateRow(cell.row, value);
|
|
44
|
+
}
|
|
45
|
+
}, [getRegisteredFields, getFieldState, focus, blur, cell]);
|
|
46
|
+
const handleClickDelete = useCallback(async () => {
|
|
47
|
+
const { value } = getFieldState(`rows[${cell.row.index}]`);
|
|
48
|
+
cell.deleteRow(cell.row, value);
|
|
49
|
+
}, [getFieldState, cell]);
|
|
50
|
+
const handleClickDismiss = useCallback(async () => {
|
|
51
|
+
const { rows } = getState().values;
|
|
52
|
+
const { row, newRowDefaultValues, setAutoReset } = cell;
|
|
53
|
+
const shouldRemoveRow = newRowDefaultValues
|
|
54
|
+
? isEqual(row.original, newRowDefaultValues)
|
|
55
|
+
: _isEmpty(row.original);
|
|
56
|
+
if (!shouldRemoveRow) {
|
|
57
|
+
handleSetCreatable(false);
|
|
58
|
+
handleSetEditable(false);
|
|
59
|
+
}
|
|
60
|
+
await setAutoReset(false);
|
|
61
|
+
reset({
|
|
62
|
+
rows: [
|
|
63
|
+
...rows.slice(0, row.index),
|
|
64
|
+
...(shouldRemoveRow ? [] : [row.original]),
|
|
65
|
+
...rows.slice(row.index + 1),
|
|
66
|
+
],
|
|
67
|
+
});
|
|
68
|
+
}, [getState, cell, reset, handleSetCreatable, handleSetEditable]);
|
|
69
|
+
return (_jsx(Stack, { className: classes.root, children: [cell.row.state.editable, cell.row.state.creatable].includes(true) ? (_jsxs(_Fragment, { children: [_jsx(IconButton, { onClick: handleClickSave, disabled: Number.isInteger(cell.updateRowIdx), ...iconProps, sx: { p: '2px' }, "aria-label": t('button.save', 'Save'), "data-testid": "editable-table-cell-submit-button", children: _jsx(Icon, { name: "check" }) }), _jsx(IconButton, { onClick: handleClickDismiss, disabled: Number.isInteger(cell.updateRowIdx), ...iconProps, sx: { p: '2px' }, "aria-label": t('button.cancel', 'Cancel'), "data-testid": "editable-table-cell-cancel-button", children: _jsx(Icon, { name: "close" }) })] })) : (_jsx(_Fragment, { children: cell.editable === false ? (_jsx(IconButton, { onClick: handleClickDelete, ...iconProps, color: "error", "aria-label": t('button.delete', 'Delete'), "data-testid": "table-cell-delete-button", children: _jsx(Icon, { name: "delete" }) })) : (_jsx(IconButton, { onClick: handleClickEdit, ...iconProps, "aria-label": t('button.edit', 'Edit'), "data-testid": "table-cell-edit-button", children: _jsx(Icon, { name: "edit" }) })) })) }));
|
|
70
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { FieldPath, FieldPathValue, UnpackNestedValue } from 'react-hook-form';
|
|
2
|
+
import { CellProps, ColumnInstance } from 'react-table';
|
|
3
|
+
import { ColumnEditableProps, TableColumnConditions } from "./TableCellEditable";
|
|
4
|
+
export declare type ColumnConditionsInstance<D extends object> = {
|
|
5
|
+
conditions?: TableColumnConditions<D>;
|
|
6
|
+
};
|
|
7
|
+
export interface TableCellEditableFieldProps<D extends object> extends CellProps<D> {
|
|
8
|
+
column: ColumnInstance<D> & ColumnConditionsInstance<D> & ColumnEditableProps<D>;
|
|
9
|
+
}
|
|
10
|
+
export declare type ConditionFunc<D extends object, N extends FieldPath<D> = FieldPath<D>, V extends UnpackNestedValue<FieldPathValue<D, N>> = UnpackNestedValue<FieldPathValue<D, N>>> = (value: V, cell: TableCellEditableFieldProps<D>) => boolean;
|
|
11
|
+
export declare type Condition<D extends object, N extends FieldPath<D> = FieldPath<D>, V extends UnpackNestedValue<FieldPathValue<D, N>> = UnpackNestedValue<FieldPathValue<D, N>>> = {
|
|
12
|
+
when: N;
|
|
13
|
+
} & ({
|
|
14
|
+
[key in 'is' | 'is!']?: V | Array<V>;
|
|
15
|
+
} | {
|
|
16
|
+
is?: ConditionFunc<D>;
|
|
17
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { TimeDuration, TimeDurationExcludedUnits } from "../../utils/timeDuration";
|
|
3
|
+
import { CellProps, ColumnInstance } from 'react-table';
|
|
4
|
+
export interface ColumnEditableTimeDurationProps {
|
|
5
|
+
editableProps: {
|
|
6
|
+
required?: boolean;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
} & TimeDurationExcludedUnits;
|
|
9
|
+
}
|
|
10
|
+
export interface TableCellEditableTimeDurationProps<T extends object> extends CellProps<T, TimeDuration> {
|
|
11
|
+
column: ColumnInstance<T> & ColumnEditableTimeDurationProps;
|
|
12
|
+
}
|
|
13
|
+
export declare function TableCellEditableTimeDuration<T extends object>({ cell, column, row, value, }: TableCellEditableTimeDurationProps<T>): JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { TimeDurationField } from "../../form/TimeDurationField";
|
|
3
|
+
import { TimeDurationLabel } from "../../mui";
|
|
4
|
+
import { useMemo } from 'react';
|
|
5
|
+
export function TableCellEditableTimeDuration({ cell, column, row, value, }) {
|
|
6
|
+
const { required, disabled, excludedUnits } = column.editableProps;
|
|
7
|
+
const name = useMemo(() => `rows[${cell.row.id}].${column.id}`, [cell.row.id, column.id]);
|
|
8
|
+
if (row.state.editable) {
|
|
9
|
+
return (_jsx(TimeDurationField, { name: name, excludedUnits: excludedUnits, required: required, disabled: disabled }));
|
|
10
|
+
}
|
|
11
|
+
return (_jsx(TimeDurationLabel, { value: value, prefixKey: name, excludedUnits: excludedUnits }));
|
|
12
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface TableContextValue {
|
|
3
|
+
colSpan: number;
|
|
4
|
+
count: number;
|
|
5
|
+
page: number;
|
|
6
|
+
rowsPerPage: number;
|
|
7
|
+
pagination: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare const TableContext: import("react").Context<TableContextValue>;
|
|
10
|
+
export declare const TableContextProvider: import("react").Provider<TableContextValue>;
|
|
11
|
+
export declare const TableContextConsumer: import("react").Consumer<TableContextValue>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { FC } from 'react';
|
|
2
|
+
import { TableContextValue } from "./TableContext";
|
|
3
|
+
import { type TablePaginationProps as MuiTablePaginationProps } from '@mui/material';
|
|
4
|
+
export declare type TablePaginationProps = Omit<MuiTablePaginationProps, keyof TableContextValue> & Partial<Pick<MuiTablePaginationProps, keyof Omit<TableContextValue, 'pagination'>>> & {};
|
|
5
|
+
export declare const TablePagination: FC<TablePaginationProps>;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, useCallback, useContext, useMemo } from 'react';
|
|
3
|
+
import { makeStyles } from '@mui/styles';
|
|
4
|
+
import { TableContext } from "./TableContext";
|
|
5
|
+
import { Pagination, TablePagination as MuiTablePagination, } from '@mui/material';
|
|
6
|
+
import { TransLabel } from "../../i18n/trans/label";
|
|
7
|
+
import classNames from 'classnames';
|
|
8
|
+
import { Icon } from "../../mui";
|
|
9
|
+
import { getAccessabilityValue } from "../../utils";
|
|
10
|
+
const useStyles = makeStyles((theme) => ({
|
|
11
|
+
root: {
|
|
12
|
+
'& .MuiTablePagination-selectLabel': {
|
|
13
|
+
color: theme.palette.grey[800],
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
select: {
|
|
17
|
+
padding: 0,
|
|
18
|
+
marginRight: 0,
|
|
19
|
+
color: theme.palette.grey[800],
|
|
20
|
+
'& .MuiTablePagination-select.MuiSelect-select': {
|
|
21
|
+
padding: '5px 32px 5px 8px',
|
|
22
|
+
borderWidth: 1,
|
|
23
|
+
borderStyle: 'solid',
|
|
24
|
+
borderColor: theme.palette.grey[400],
|
|
25
|
+
borderRadius: 4,
|
|
26
|
+
height: 20,
|
|
27
|
+
fontSize: 13,
|
|
28
|
+
position: 'relative',
|
|
29
|
+
cursor: 'pointer',
|
|
30
|
+
},
|
|
31
|
+
'& span': {
|
|
32
|
+
color: theme.palette.grey[900],
|
|
33
|
+
},
|
|
34
|
+
'& .chevron': {
|
|
35
|
+
position: 'absolute',
|
|
36
|
+
top: 0,
|
|
37
|
+
right: 8,
|
|
38
|
+
bottom: 0,
|
|
39
|
+
margin: 'auto',
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
accessibilitySelect: {
|
|
43
|
+
'& .MuiTablePagination-select.MuiSelect-select': {
|
|
44
|
+
color: theme.palette.secondary.main,
|
|
45
|
+
border: `1px solid ${theme.palette.common.black}`,
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
}), {
|
|
49
|
+
name: 'TablePagination',
|
|
50
|
+
});
|
|
51
|
+
const arrowIconButtonProps = {
|
|
52
|
+
size: 'medium',
|
|
53
|
+
};
|
|
54
|
+
const ActionsComponent = forwardRef((props, ref) => {
|
|
55
|
+
const { className, count, rowsPerPage, page, onPageChange } = props;
|
|
56
|
+
const handlePageChange = useCallback((event, page) => {
|
|
57
|
+
onPageChange(event, page - 1);
|
|
58
|
+
}, [onPageChange]);
|
|
59
|
+
return (_jsx(Pagination, { ref: ref, className: className, count: Math.ceil(count / rowsPerPage), page: page + 1, color: "primary", onChange: handlePageChange, siblingCount: 1, boundaryCount: 1 }));
|
|
60
|
+
});
|
|
61
|
+
export const TablePagination = ({ className, ...props }) => {
|
|
62
|
+
const { colSpan, count, page, rowsPerPage } = useContext(TableContext);
|
|
63
|
+
const accessibility = useMemo(getAccessabilityValue, []);
|
|
64
|
+
const labelDisplayedRows = useCallback(() => null, []);
|
|
65
|
+
const rowsPerPageOptions = useMemo(() => {
|
|
66
|
+
const options = [10, 15, 20, 25, 50, 100, 300];
|
|
67
|
+
if (!options.includes(rowsPerPage))
|
|
68
|
+
options.push(rowsPerPage);
|
|
69
|
+
return options.sort((a, b) => a - b);
|
|
70
|
+
}, [rowsPerPage]);
|
|
71
|
+
const classes = useStyles();
|
|
72
|
+
const SelectProps = useMemo(() => ({
|
|
73
|
+
className: classNames(classes.select, {
|
|
74
|
+
[classes.accessibilitySelect]: accessibility,
|
|
75
|
+
}),
|
|
76
|
+
renderValue: (count) => (_jsx(TransLabel, { i18nKey: "perPage", values: { count }, components: { s: _jsx("span", {}) } })),
|
|
77
|
+
IconComponent: () => _jsx(Icon, { name: "chevron-down", className: "chevron" }),
|
|
78
|
+
// Stable hook for E2E (was reached via `.MuiTablePagination-select`).
|
|
79
|
+
SelectDisplayProps: {
|
|
80
|
+
'data-testid': 'rows-per-page-select',
|
|
81
|
+
},
|
|
82
|
+
}), [accessibility, classes.accessibilitySelect, classes.select]);
|
|
83
|
+
return (_jsx(MuiTablePagination, { component: "div", ActionsComponent: ActionsComponent, className: classNames(classes.root, className), labelRowsPerPage: null, labelDisplayedRows: labelDisplayedRows, backIconButtonProps: arrowIconButtonProps, nextIconButtonProps: arrowIconButtonProps, colSpan: colSpan, count: count, page: page, rowsPerPage: rowsPerPage, rowsPerPageOptions: rowsPerPageOptions, SelectProps: SelectProps, ...props }));
|
|
84
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { ReactElement, ReactNode } from 'react';
|
|
2
|
+
import type { CellPropGetter, Column, HeaderGroupPropGetter, HeaderPropGetter, Row, RowPropGetter, TableBodyPropGetter, TableInstance, TablePropGetter } from 'react-table';
|
|
3
|
+
import { ClassKeyOfStyles } from '@mui/styles';
|
|
4
|
+
import { Theme } from "../mui";
|
|
5
|
+
import type { StyledComponentProps } from '@mui/styles/withStyles/withStyles';
|
|
6
|
+
import type { TableColumnConditions } from "./Table/TableCellEditable";
|
|
7
|
+
import { ColumnEditableProps } from "./Table/TableCellEditable";
|
|
8
|
+
import { DragDropContextProps, DropResult, ResponderProvided } from 'react-beautiful-dnd';
|
|
9
|
+
export declare type TableColumn<D extends object> = Column<D> & ColumnEditableProps<D> & {
|
|
10
|
+
conditions?: TableColumnConditions<D>;
|
|
11
|
+
};
|
|
12
|
+
export declare type TableColumns<D extends object> = ReadonlyArray<TableColumn<D>>;
|
|
13
|
+
export declare const tableStyles: (theme: Theme) => import("@mui/styles").StyleRules<{}, "title" | "col" | "head" | "table" | "tbody" | "thead" | "cell" | "row" | "sort" | "pointer" | "root" | "container" | "expandIcon" | "pagination" | "accessibilityPagination" | "qty" | "accessibilityQty" | "rowEditable" | "headCanSort" | "accessibilityCell" | "cellEditable" | "cellSorted" | "cellIsActions" | "cellActive" | "cellSelected" | "cellSelectedSecondary" | "cellSelectedSuccess" | "cellSelectedPrimary" | "cellDragging" | "subRow" | "emptyLabel">;
|
|
14
|
+
export declare type TableStylesType = typeof tableStyles;
|
|
15
|
+
export interface GetSubRow<D extends object> {
|
|
16
|
+
(row: Row<D>): ReactNode;
|
|
17
|
+
}
|
|
18
|
+
export interface TableProps<D extends object> {
|
|
19
|
+
className?: string;
|
|
20
|
+
table: TableInstance<D>;
|
|
21
|
+
getTableProps?: TablePropGetter<D>;
|
|
22
|
+
getHeaderGroupProps?: HeaderGroupPropGetter<D>;
|
|
23
|
+
getHeaderProps?: HeaderPropGetter<D>;
|
|
24
|
+
getTableBodyProps?: TableBodyPropGetter<D>;
|
|
25
|
+
getRowProps?: RowPropGetter<D>;
|
|
26
|
+
getCellProps?: CellPropGetter<D>;
|
|
27
|
+
getSubRow?: GetSubRow<D>;
|
|
28
|
+
getSubRowProps?: RowPropGetter<D>;
|
|
29
|
+
getSubRowCellProps?: RowPropGetter<D>;
|
|
30
|
+
/** @deprecated use getSubRow instead */
|
|
31
|
+
renderRowSubComponent?: GetSubRow<D>;
|
|
32
|
+
caption?: ReactNode;
|
|
33
|
+
emptyLabel?: ReactNode;
|
|
34
|
+
selectedColor?: 'secondary' | 'success' | 'primary';
|
|
35
|
+
'data-testid'?: string;
|
|
36
|
+
tableId?: string;
|
|
37
|
+
getRowUrl?: (row: Row<D>) => string;
|
|
38
|
+
}
|
|
39
|
+
declare type DragDropContextWrapperProps = ({
|
|
40
|
+
draggable?: false;
|
|
41
|
+
} & Partial<Omit<DragDropContextProps, 'children'>>) | ({
|
|
42
|
+
draggable: true;
|
|
43
|
+
} & Omit<DragDropContextProps, 'children'>);
|
|
44
|
+
export interface TableDragDropProps<D extends object> extends Omit<DragDropContextWrapperProps, 'onDragEnd'> {
|
|
45
|
+
onDragEnd: (result: {
|
|
46
|
+
data: Array<D>;
|
|
47
|
+
result: DropResult;
|
|
48
|
+
provided: ResponderProvided;
|
|
49
|
+
}) => void;
|
|
50
|
+
dragShiftEnabled?: boolean;
|
|
51
|
+
}
|
|
52
|
+
export declare const Table: <D extends object>(props: TableProps<D> & StyledComponentProps<"title" | "col" | "head" | "table" | "tbody" | "thead" | "cell" | "row" | "sort" | "pointer" | "root" | "container" | "expandIcon" | "pagination" | "accessibilityPagination" | "qty" | "accessibilityQty" | "rowEditable" | "headCanSort" | "accessibilityCell" | "cellEditable" | "cellSorted" | "cellIsActions" | "cellActive" | "cellSelected" | "cellSelectedSecondary" | "cellSelectedSuccess" | "cellSelectedPrimary" | "cellDragging" | "subRow" | "emptyLabel"> & Partial<TableDragDropProps<D>>) => ReactElement;
|
|
53
|
+
export {};
|