@turnit-ou/shared 0.0.0-stage → 2.18.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/@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 +89 -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,79 @@
|
|
|
1
|
+
import { useRef, useState, useEffect, useCallback } from 'react';
|
|
2
|
+
export function useEllipsis({ nodeRef, observeRef, text, lines = 1, suffix = '...', }) {
|
|
3
|
+
const [isEllipsis, setIsEllipsis] = useState(false);
|
|
4
|
+
const [ellipsisText, setEllipsisText] = useState(text);
|
|
5
|
+
const targetHeight = useRef(0);
|
|
6
|
+
const calculateCurrentHeight = useCallback(() => {
|
|
7
|
+
return (nodeRef.current.offsetHeight ||
|
|
8
|
+
nodeRef.current.getBoundingClientRect().height);
|
|
9
|
+
}, [nodeRef]);
|
|
10
|
+
const bisection = useCallback((start, end) => {
|
|
11
|
+
if (start > end) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
const index = Math.floor((start + end) / 2);
|
|
15
|
+
const str = text.substring(0, index);
|
|
16
|
+
nodeRef.current.innerText = str + suffix;
|
|
17
|
+
const currentHeight = calculateCurrentHeight();
|
|
18
|
+
if (currentHeight < targetHeight.current) {
|
|
19
|
+
bisection(index + 1, end);
|
|
20
|
+
}
|
|
21
|
+
if (currentHeight > targetHeight.current) {
|
|
22
|
+
bisection(start, index - 1);
|
|
23
|
+
}
|
|
24
|
+
if (currentHeight === targetHeight.current && index < end) {
|
|
25
|
+
if (index + 1 === end) {
|
|
26
|
+
const last = text.substring(0, end);
|
|
27
|
+
nodeRef.current.innerText = last + suffix;
|
|
28
|
+
if (nodeRef.current.offsetHeight > targetHeight.current) {
|
|
29
|
+
nodeRef.current.innerText = str + suffix;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
bisection(index, end);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}, [text, nodeRef, suffix, calculateCurrentHeight]);
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
let resizeObserver;
|
|
39
|
+
const ro = new ResizeObserver((_, observer) => {
|
|
40
|
+
if (!nodeRef.current) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
resizeObserver = observer;
|
|
44
|
+
nodeRef.current.innerText = text;
|
|
45
|
+
const lineHeight = parseInt(getComputedStyle(nodeRef.current, null).lineHeight || '10', 10);
|
|
46
|
+
const currentHeight = calculateCurrentHeight();
|
|
47
|
+
targetHeight.current =
|
|
48
|
+
lines === 'auto'
|
|
49
|
+
? Math.floor(nodeRef.current.parentElement.offsetHeight / lineHeight) * lineHeight
|
|
50
|
+
: lines * lineHeight;
|
|
51
|
+
const isOk = currentHeight > targetHeight.current;
|
|
52
|
+
if (isOk) {
|
|
53
|
+
bisection(0, (text?.length || 1) - 1);
|
|
54
|
+
}
|
|
55
|
+
if (nodeRef.current.innerText !== ellipsisText) {
|
|
56
|
+
setEllipsisText(nodeRef.current.innerText);
|
|
57
|
+
}
|
|
58
|
+
setIsEllipsis(isOk);
|
|
59
|
+
});
|
|
60
|
+
const observedElement = observeRef?.current || nodeRef.current?.parentElement;
|
|
61
|
+
if (observedElement) {
|
|
62
|
+
ro.observe(observedElement);
|
|
63
|
+
}
|
|
64
|
+
return () => {
|
|
65
|
+
if (resizeObserver) {
|
|
66
|
+
resizeObserver.disconnect();
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
}, [
|
|
70
|
+
bisection,
|
|
71
|
+
calculateCurrentHeight,
|
|
72
|
+
ellipsisText,
|
|
73
|
+
lines,
|
|
74
|
+
nodeRef,
|
|
75
|
+
observeRef,
|
|
76
|
+
text,
|
|
77
|
+
]);
|
|
78
|
+
return isEllipsis;
|
|
79
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useFavicon: (url?: string) => void;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
export const useFavicon = (url) => {
|
|
3
|
+
useEffect(() => {
|
|
4
|
+
if (!url)
|
|
5
|
+
return;
|
|
6
|
+
const link = document.querySelector("link[rel*='icon']") ||
|
|
7
|
+
document.createElement('link');
|
|
8
|
+
link.type = 'image/x-icon';
|
|
9
|
+
link.rel = 'shortcut icon';
|
|
10
|
+
link.href = url;
|
|
11
|
+
document.getElementsByTagName('head')[0].appendChild(link);
|
|
12
|
+
}, [url]);
|
|
13
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Dispatch, SetStateAction } from 'react';
|
|
2
|
+
import type { PluginHook, Row, TableInstance, TableOptions, FormTableRowValue } from 'react-table';
|
|
3
|
+
import { UseFormTableControlsInstance } from "./useFormTableControls";
|
|
4
|
+
export interface UpdateRow<D extends object> {
|
|
5
|
+
(row: Row<D>, value: D): void;
|
|
6
|
+
}
|
|
7
|
+
export interface FormTableTableInstance<D extends object> extends TableInstance<D>, UseFormTableControlsInstance<D> {
|
|
8
|
+
editable?: boolean;
|
|
9
|
+
updateRow: UpdateRow<D>;
|
|
10
|
+
deleteRow: UpdateRow<D>;
|
|
11
|
+
updateData: Dispatch<SetStateAction<FormTableRowValue<D>>>;
|
|
12
|
+
setAutoReset: (value: SetStateAction<boolean>) => void;
|
|
13
|
+
}
|
|
14
|
+
export interface FormTableRowUpdate<D extends object> {
|
|
15
|
+
(value: D, values: FormTableRowValue<D>, index: number): void | D | Promise<void | D>;
|
|
16
|
+
}
|
|
17
|
+
export interface FormTableOptions<D extends object, E extends object = {}> extends TableOptions<D, E> {
|
|
18
|
+
editable?: boolean;
|
|
19
|
+
autoResetOnDataChange?: boolean;
|
|
20
|
+
onRowUpdate?: FormTableRowUpdate<D>;
|
|
21
|
+
onRowDelete?: FormTableRowUpdate<D>;
|
|
22
|
+
onRowsDelete?: (rows: FormTableRowValue<D>) => Promise<void>;
|
|
23
|
+
}
|
|
24
|
+
export declare function useFormTable<D extends object, E extends object = {}>(options: FormTableOptions<D, E>, ...plugins: Array<PluginHook<D>>): FormTableTableInstance<D>;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { useRowState } from 'react-table';
|
|
2
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
3
|
+
import { useFieldArray } from "../form/hooks/useFieldArray";
|
|
4
|
+
import { TableCellEditable } from "../components/Table/TableCellEditable";
|
|
5
|
+
import { useTable } from "./useTable";
|
|
6
|
+
import { useFormTableControls, } from "./useFormTableControls";
|
|
7
|
+
const defaultColumn = {
|
|
8
|
+
Cell: TableCellEditable,
|
|
9
|
+
};
|
|
10
|
+
export function useFormTable(options, ...plugins) {
|
|
11
|
+
const { data: initialData, form, onRowUpdate, onRowDelete, onRowsDelete, editable = true, autoResetOnDataChange = false, ...rest } = options;
|
|
12
|
+
const [autoReset, setAutoReset] = useState(true);
|
|
13
|
+
const [updateRowIdx, setUpdateRowIdx] = useState();
|
|
14
|
+
const [data, setData] = useState(initialData);
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
setData(initialData);
|
|
17
|
+
}, [initialData]);
|
|
18
|
+
const fieldArray = useFieldArray('rows', {
|
|
19
|
+
form,
|
|
20
|
+
initialValue: data,
|
|
21
|
+
});
|
|
22
|
+
const initial = fieldArray.meta.initial;
|
|
23
|
+
const values = fieldArray.fields.value;
|
|
24
|
+
const updateRow = useCallback(async (row, value) => {
|
|
25
|
+
setAutoReset(false);
|
|
26
|
+
setUpdateRowIdx(row.index);
|
|
27
|
+
const values = initial.slice();
|
|
28
|
+
values.splice(row.index, 1, value);
|
|
29
|
+
try {
|
|
30
|
+
const updated = await onRowUpdate?.(value, values, row.index);
|
|
31
|
+
row.setState((prev) => ({
|
|
32
|
+
...prev,
|
|
33
|
+
creatable: false,
|
|
34
|
+
editable: false,
|
|
35
|
+
}));
|
|
36
|
+
if (updated) {
|
|
37
|
+
values.splice(row.index, 1, updated);
|
|
38
|
+
setData(values);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
catch (e) {
|
|
42
|
+
row.setState((prev) => ({
|
|
43
|
+
...prev,
|
|
44
|
+
creatable: !editable,
|
|
45
|
+
editable: !!editable,
|
|
46
|
+
}));
|
|
47
|
+
}
|
|
48
|
+
finally {
|
|
49
|
+
setUpdateRowIdx(undefined);
|
|
50
|
+
}
|
|
51
|
+
}, [editable, initial, onRowUpdate]);
|
|
52
|
+
const deleteRow = useCallback(async (row, value) => {
|
|
53
|
+
setAutoReset(false);
|
|
54
|
+
setUpdateRowIdx(row.index);
|
|
55
|
+
try {
|
|
56
|
+
const values = initial.slice();
|
|
57
|
+
await onRowDelete?.(value, values, row.index);
|
|
58
|
+
values.splice(row.index, 1);
|
|
59
|
+
setData(values);
|
|
60
|
+
}
|
|
61
|
+
catch (e) {
|
|
62
|
+
//
|
|
63
|
+
}
|
|
64
|
+
finally {
|
|
65
|
+
setUpdateRowIdx(undefined);
|
|
66
|
+
}
|
|
67
|
+
}, [initial, onRowDelete]);
|
|
68
|
+
useEffect(() => {
|
|
69
|
+
// update on fieldArray push/remove
|
|
70
|
+
if (values.length !== initial.length) {
|
|
71
|
+
form.reset({ rows: values });
|
|
72
|
+
}
|
|
73
|
+
}, [form, initial.length, values]);
|
|
74
|
+
useEffect(() => {
|
|
75
|
+
// form.setConfig('initialValues', { rows: data });
|
|
76
|
+
form.reset({ rows: data });
|
|
77
|
+
}, [data, form]);
|
|
78
|
+
useEffect(() => {
|
|
79
|
+
autoResetOnDataChange && setAutoReset(true);
|
|
80
|
+
}, [autoResetOnDataChange, initial]);
|
|
81
|
+
const node = useRef();
|
|
82
|
+
const table = useTable({
|
|
83
|
+
node,
|
|
84
|
+
data: initial,
|
|
85
|
+
defaultColumn,
|
|
86
|
+
updateRow,
|
|
87
|
+
deleteRow,
|
|
88
|
+
editable,
|
|
89
|
+
setAutoReset,
|
|
90
|
+
updateData: setData,
|
|
91
|
+
autoResetRowState: autoReset,
|
|
92
|
+
autoResetSortBy: autoReset,
|
|
93
|
+
autoResetPage: autoReset,
|
|
94
|
+
updateRowIdx,
|
|
95
|
+
form: form,
|
|
96
|
+
fieldArray,
|
|
97
|
+
...rest,
|
|
98
|
+
}, useRowState, ...plugins);
|
|
99
|
+
const controls = useFormTableControls({
|
|
100
|
+
form,
|
|
101
|
+
table,
|
|
102
|
+
removeQuery: onRowsDelete,
|
|
103
|
+
});
|
|
104
|
+
return useMemo(() => ({ ...table, ...controls }), [controls, table]);
|
|
105
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { TableInstance } from 'react-table';
|
|
2
|
+
import { SetStateAction, SyntheticEvent } from 'react';
|
|
3
|
+
import { FormApi } from 'final-form';
|
|
4
|
+
import { UpdateRow } from "./useFormTable";
|
|
5
|
+
interface UseFormTableControlsProps<D extends object, R extends {
|
|
6
|
+
rows: Array<D>;
|
|
7
|
+
} = {
|
|
8
|
+
rows: Array<D>;
|
|
9
|
+
}> {
|
|
10
|
+
table: TableInstance<D> & {
|
|
11
|
+
editable?: boolean;
|
|
12
|
+
updateRow?: UpdateRow<D>;
|
|
13
|
+
setAutoReset: (value: SetStateAction<boolean>) => void;
|
|
14
|
+
newRowDefaultValues?: Partial<D>;
|
|
15
|
+
};
|
|
16
|
+
form?: FormApi<R>;
|
|
17
|
+
removeQuery?: (rows: R['rows']) => Promise<void>;
|
|
18
|
+
}
|
|
19
|
+
export interface UseFormTableControlsInstance<D extends object> {
|
|
20
|
+
addRow: (event?: SyntheticEvent, value?: Partial<D>) => Promise<void>;
|
|
21
|
+
removeSelectedRows: () => Promise<void>;
|
|
22
|
+
}
|
|
23
|
+
export declare const useFormTableControls: <D extends object, R extends {
|
|
24
|
+
rows: D[];
|
|
25
|
+
} = {
|
|
26
|
+
rows: D[];
|
|
27
|
+
}>(props: UseFormTableControlsProps<D, R>) => {
|
|
28
|
+
addRow: (event?: SyntheticEvent, value?: Partial<D>) => Promise<never>;
|
|
29
|
+
removeSelectedRows: () => Promise<void>;
|
|
30
|
+
};
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { useCallback, useMemo } from 'react';
|
|
2
|
+
export const useFormTableControls = (props) => {
|
|
3
|
+
const { table, removeQuery } = props;
|
|
4
|
+
const { fieldArray: { fields: { value, ...fields }, }, newRowDefaultValues, setRowState, editable, form, } = table;
|
|
5
|
+
const selectedRowIds = useMemo(() => (table?.selectedFlatRows ?? []).map(({ index }) => index), [table?.selectedFlatRows]);
|
|
6
|
+
const selectedRowsData = useMemo(() => selectedRowIds.map((idx) => value[idx]), [selectedRowIds, value]);
|
|
7
|
+
const addRow = useCallback(async (event, value) => {
|
|
8
|
+
const { values, invalid } = form.getState();
|
|
9
|
+
if (invalid) {
|
|
10
|
+
await form.submit();
|
|
11
|
+
return Promise.reject(values);
|
|
12
|
+
}
|
|
13
|
+
const addRowId = `${values.rows.length}`;
|
|
14
|
+
await table.setAutoReset(false);
|
|
15
|
+
fields.push(value ?? newRowDefaultValues ?? {});
|
|
16
|
+
table.gotoPage?.(table.pageCount - 1);
|
|
17
|
+
setTimeout(() => {
|
|
18
|
+
setRowState([addRowId], {
|
|
19
|
+
creatable: !editable,
|
|
20
|
+
editable: !!editable,
|
|
21
|
+
});
|
|
22
|
+
const [row] = Array.from(table.node.current.rows).slice(-1);
|
|
23
|
+
row.scrollIntoView({ behavior: 'smooth' });
|
|
24
|
+
}, 0);
|
|
25
|
+
}, [editable, fields, form, newRowDefaultValues, setRowState, table]);
|
|
26
|
+
const removeSelectedRows = useCallback(async () => {
|
|
27
|
+
await removeQuery?.(selectedRowsData);
|
|
28
|
+
fields.removeBatch(selectedRowIds);
|
|
29
|
+
}, [removeQuery, fields, selectedRowIds, selectedRowsData]);
|
|
30
|
+
return useMemo(() => ({
|
|
31
|
+
addRow,
|
|
32
|
+
removeSelectedRows,
|
|
33
|
+
}), [addRow, removeSelectedRows]);
|
|
34
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* While `active`, hides everything outside `elementRef` from assistive
|
|
4
|
+
* technology *and* takes it out of the tab order.
|
|
5
|
+
*
|
|
6
|
+
* MUI's Modal already aria-hides the background, but it always measures from
|
|
7
|
+
* `document.body`, no matter where the modal itself is rendered. A modal with
|
|
8
|
+
* `disablePortal` renders inline, so the element MUI hides (the app root) is
|
|
9
|
+
* the modal's own ancestor: the drawer disappears from the accessibility tree
|
|
10
|
+
* together with the page, while everything inside stays tabbable — axe
|
|
11
|
+
* `aria-hidden-focus`.
|
|
12
|
+
*
|
|
13
|
+
* This walks the element's ancestor chain instead. Every sibling on the way up
|
|
14
|
+
* to `<body>` is marked `aria-hidden` and `inert`, and the ancestors carrying
|
|
15
|
+
* MUI's misplaced `aria-hidden` are cleared, so the background is neither
|
|
16
|
+
* announced nor focusable and the modal itself stays reachable. Attributes are
|
|
17
|
+
* only reverted where this hook added them; the ones MUI owns are left for MUI
|
|
18
|
+
* to remove on close.
|
|
19
|
+
*/
|
|
20
|
+
export declare const useInertBackground: (active: boolean, elementRef: RefObject<HTMLElement | null>) => void;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
const IGNORED_TAG_NAMES = ['SCRIPT', 'STYLE', 'TEMPLATE', 'LINK', 'META'];
|
|
3
|
+
/**
|
|
4
|
+
* While `active`, hides everything outside `elementRef` from assistive
|
|
5
|
+
* technology *and* takes it out of the tab order.
|
|
6
|
+
*
|
|
7
|
+
* MUI's Modal already aria-hides the background, but it always measures from
|
|
8
|
+
* `document.body`, no matter where the modal itself is rendered. A modal with
|
|
9
|
+
* `disablePortal` renders inline, so the element MUI hides (the app root) is
|
|
10
|
+
* the modal's own ancestor: the drawer disappears from the accessibility tree
|
|
11
|
+
* together with the page, while everything inside stays tabbable — axe
|
|
12
|
+
* `aria-hidden-focus`.
|
|
13
|
+
*
|
|
14
|
+
* This walks the element's ancestor chain instead. Every sibling on the way up
|
|
15
|
+
* to `<body>` is marked `aria-hidden` and `inert`, and the ancestors carrying
|
|
16
|
+
* MUI's misplaced `aria-hidden` are cleared, so the background is neither
|
|
17
|
+
* announced nor focusable and the modal itself stays reachable. Attributes are
|
|
18
|
+
* only reverted where this hook added them; the ones MUI owns are left for MUI
|
|
19
|
+
* to remove on close.
|
|
20
|
+
*/
|
|
21
|
+
export const useInertBackground = (active, elementRef) => {
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
const element = elementRef.current;
|
|
24
|
+
if (!active || !element)
|
|
25
|
+
return;
|
|
26
|
+
const { body } = element.ownerDocument;
|
|
27
|
+
const touched = [];
|
|
28
|
+
const hide = (target) => {
|
|
29
|
+
touched.push({
|
|
30
|
+
element: target,
|
|
31
|
+
addedAriaHidden: !target.hasAttribute('aria-hidden'),
|
|
32
|
+
addedInert: !target.hasAttribute('inert'),
|
|
33
|
+
});
|
|
34
|
+
target.setAttribute('aria-hidden', 'true');
|
|
35
|
+
target.setAttribute('inert', '');
|
|
36
|
+
};
|
|
37
|
+
for (let node = element; node && node !== body; node = node.parentElement) {
|
|
38
|
+
const parent = node.parentElement;
|
|
39
|
+
if (!parent)
|
|
40
|
+
break;
|
|
41
|
+
parent.removeAttribute('aria-hidden');
|
|
42
|
+
Array.from(parent.children).forEach((sibling) => {
|
|
43
|
+
if (sibling !== node && !IGNORED_TAG_NAMES.includes(sibling.tagName)) {
|
|
44
|
+
hide(sibling);
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
return () => {
|
|
49
|
+
touched.forEach(({ element, addedAriaHidden, addedInert }) => {
|
|
50
|
+
if (addedAriaHidden)
|
|
51
|
+
element.removeAttribute('aria-hidden');
|
|
52
|
+
if (addedInert)
|
|
53
|
+
element.removeAttribute('inert');
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
}, [active, elementRef]);
|
|
57
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useLanguage: () => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useLoaded(loading: boolean): boolean;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { useEffect, useRef, useState } from 'react';
|
|
2
|
+
export function useLoaded(loading) {
|
|
3
|
+
const isMounted = useRef(false);
|
|
4
|
+
const [isLoaded, setLoaded] = useState(false);
|
|
5
|
+
useEffect(() => {
|
|
6
|
+
if (isMounted.current && !isLoaded && !loading) {
|
|
7
|
+
setLoaded(true);
|
|
8
|
+
}
|
|
9
|
+
else {
|
|
10
|
+
isMounted.current = true;
|
|
11
|
+
}
|
|
12
|
+
}, [isLoaded, loading]);
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
return () => {
|
|
15
|
+
isMounted.current = false;
|
|
16
|
+
};
|
|
17
|
+
}, []);
|
|
18
|
+
return isLoaded;
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useLocale: () => globalThis.Locale;
|