@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,389 @@
|
|
|
1
|
+
import { createElement as _createElement } from "react";
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { TransButton } from "../i18n/trans/button";
|
|
4
|
+
import { Fragment, useCallback, useMemo, useState } from 'react';
|
|
5
|
+
import { renderToString } from 'react-dom/server';
|
|
6
|
+
import { createStyles, withStyles, } from '@mui/styles';
|
|
7
|
+
import { lighten } from '@mui/material/styles';
|
|
8
|
+
import { Stack, Table as MuiTable, TableBody, TableCell, TableHead, TableRow, Typography, } from '@mui/material';
|
|
9
|
+
import classNames from 'classnames';
|
|
10
|
+
import { Icon, Input } from "../mui";
|
|
11
|
+
import { TablePagination } from "./Table/TablePagination";
|
|
12
|
+
import { DragDropContext, Draggable, Droppable, } from 'react-beautiful-dnd';
|
|
13
|
+
import { TableCell as TableCellDnD } from "./Table/TableCell";
|
|
14
|
+
import { swap } from "../utils/array";
|
|
15
|
+
import set from 'lodash/set';
|
|
16
|
+
import { capitalize } from "../helpers";
|
|
17
|
+
import { TableContextProvider, } from "./Table/TableContext";
|
|
18
|
+
import { TransQty } from "../i18n/trans/qty";
|
|
19
|
+
import { getAccessabilityValue, getSortArray } from "../utils";
|
|
20
|
+
export const tableStyles = (theme) => createStyles({
|
|
21
|
+
root: {
|
|
22
|
+
display: 'flex',
|
|
23
|
+
flexDirection: 'column',
|
|
24
|
+
flex: 1,
|
|
25
|
+
width: '100%',
|
|
26
|
+
minHeight: 0,
|
|
27
|
+
},
|
|
28
|
+
table: {
|
|
29
|
+
// ↓↓↓ comment for overflow
|
|
30
|
+
display: 'flex',
|
|
31
|
+
flexDirection: 'column',
|
|
32
|
+
// ↑ comment for overflow
|
|
33
|
+
flex: 1,
|
|
34
|
+
minHeight: 0,
|
|
35
|
+
// ↓↓↓ uncomment for overflow
|
|
36
|
+
// overflow: 'auto',
|
|
37
|
+
},
|
|
38
|
+
container: {
|
|
39
|
+
// ↓↓↓ comment for overflow on table
|
|
40
|
+
flex: 1,
|
|
41
|
+
overflow: 'auto',
|
|
42
|
+
// ↑ comment for overflow on table
|
|
43
|
+
},
|
|
44
|
+
thead: {
|
|
45
|
+
position: 'sticky',
|
|
46
|
+
top: 0,
|
|
47
|
+
zIndex: 3,
|
|
48
|
+
},
|
|
49
|
+
tbody: {
|
|
50
|
+
'& $row:hover': {
|
|
51
|
+
'& $cell:not($head):not($cellSelected):not($cellActive)': {
|
|
52
|
+
backgroundColor: lighten(theme.palette.action.hover, 0.6),
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
row: {},
|
|
57
|
+
pagination: {
|
|
58
|
+
flexDirection: 'row',
|
|
59
|
+
justifyContent: 'space-between',
|
|
60
|
+
alignItems: 'center',
|
|
61
|
+
paddingLeft: theme.spacing(3),
|
|
62
|
+
minHeight: theme.spacing(6),
|
|
63
|
+
borderBottom: `1px solid ${theme.palette.grey[100]}`,
|
|
64
|
+
},
|
|
65
|
+
accessibilityPagination: {
|
|
66
|
+
borderBottom: `1px solid ${theme.palette.grey[500]}`,
|
|
67
|
+
},
|
|
68
|
+
qty: {
|
|
69
|
+
color: theme.palette.grey[800],
|
|
70
|
+
},
|
|
71
|
+
accessibilityQty: {
|
|
72
|
+
color: theme.palette.secondary.main,
|
|
73
|
+
},
|
|
74
|
+
pointer: {
|
|
75
|
+
cursor: 'pointer',
|
|
76
|
+
},
|
|
77
|
+
rowEditable: {
|
|
78
|
+
verticalAlign: 'text-top',
|
|
79
|
+
},
|
|
80
|
+
head: {
|
|
81
|
+
lineHeight: theme.spacing(2),
|
|
82
|
+
'& $col': {
|
|
83
|
+
padding: `${theme.spacing()} ${theme.spacing(2)}`,
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
headCanSort: {
|
|
87
|
+
cursor: 'pointer',
|
|
88
|
+
'&:hover': {
|
|
89
|
+
color: theme.palette.action.focus,
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
cell: {
|
|
93
|
+
padding: '0 !important',
|
|
94
|
+
verticalAlign: 'middle',
|
|
95
|
+
'& a:any-link': {
|
|
96
|
+
textDecoration: 'unset',
|
|
97
|
+
},
|
|
98
|
+
'& $col': {
|
|
99
|
+
paddingTop: 4,
|
|
100
|
+
paddingBottom: 4,
|
|
101
|
+
paddingLeft: 8,
|
|
102
|
+
paddingRight: 8,
|
|
103
|
+
border: 0,
|
|
104
|
+
},
|
|
105
|
+
'&:first-of-type $col': {
|
|
106
|
+
paddingLeft: 24,
|
|
107
|
+
// ↓↓↓ we need that to fit checkbox as the first column in the header
|
|
108
|
+
minWidth: 48,
|
|
109
|
+
},
|
|
110
|
+
'&:last-of-type $col': {
|
|
111
|
+
paddingRight: 24,
|
|
112
|
+
},
|
|
113
|
+
'&:not($cellEditable)': {
|
|
114
|
+
wordBreak: 'break-word',
|
|
115
|
+
},
|
|
116
|
+
'&:hover, &$cellSorted': {
|
|
117
|
+
'& $sort': { display: 'inline-block' },
|
|
118
|
+
},
|
|
119
|
+
'&$cellIsActions': {
|
|
120
|
+
textAlign: 'right',
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
accessibilityCell: {
|
|
124
|
+
'& a:any-link': {
|
|
125
|
+
textDecoration: 'underline',
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
title: {
|
|
129
|
+
overflow: 'hidden',
|
|
130
|
+
textOverflow: 'ellipsis',
|
|
131
|
+
display: '-webkit-box',
|
|
132
|
+
WebkitLineClamp: 2,
|
|
133
|
+
WebkitBoxOrient: 'vertical',
|
|
134
|
+
},
|
|
135
|
+
sort: {
|
|
136
|
+
display: 'none',
|
|
137
|
+
flex: `0 0 ${theme.spacing(2)}`,
|
|
138
|
+
},
|
|
139
|
+
cellEditable: {},
|
|
140
|
+
cellSorted: {},
|
|
141
|
+
cellIsActions: {},
|
|
142
|
+
cellActive: {
|
|
143
|
+
backgroundColor: theme.palette.action.hover,
|
|
144
|
+
'& a:any-link': {
|
|
145
|
+
color: 'currentColor',
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
cellSelected: {},
|
|
149
|
+
cellSelectedSecondary: {
|
|
150
|
+
backgroundColor: theme.palette.secondary.main,
|
|
151
|
+
color: theme.palette.common.white,
|
|
152
|
+
'& a:any-link': {
|
|
153
|
+
color: 'currentColor',
|
|
154
|
+
},
|
|
155
|
+
'& .MuiButton-text': {
|
|
156
|
+
color: theme.palette.text.warning,
|
|
157
|
+
},
|
|
158
|
+
'& .MuiInputBase-formControl': {
|
|
159
|
+
fontSize: 12,
|
|
160
|
+
lineHeight: '16px',
|
|
161
|
+
padding: '6px 8px',
|
|
162
|
+
'& > input': {
|
|
163
|
+
height: 'auto',
|
|
164
|
+
},
|
|
165
|
+
},
|
|
166
|
+
'& .react-datepicker__input-container .MuiButtonBase-root': {
|
|
167
|
+
padding: '6px 8px',
|
|
168
|
+
marginRight: '-9px',
|
|
169
|
+
},
|
|
170
|
+
},
|
|
171
|
+
cellSelectedSuccess: {
|
|
172
|
+
backgroundColor: lighten(theme.palette.success.main, 0.9),
|
|
173
|
+
},
|
|
174
|
+
cellSelectedPrimary: {
|
|
175
|
+
backgroundColor: theme.palette.action.hover,
|
|
176
|
+
},
|
|
177
|
+
cellDragging: {
|
|
178
|
+
backgroundColor: '#E6F4EC',
|
|
179
|
+
color: theme.palette.text.primary,
|
|
180
|
+
},
|
|
181
|
+
col: {
|
|
182
|
+
width: 'inherit',
|
|
183
|
+
minWidth: '100%',
|
|
184
|
+
},
|
|
185
|
+
expandIcon: {
|
|
186
|
+
width: 10,
|
|
187
|
+
height: 10,
|
|
188
|
+
marginRight: '8px',
|
|
189
|
+
'& + .MuiFormControlLabel-root': {
|
|
190
|
+
display: 'inline-flex',
|
|
191
|
+
},
|
|
192
|
+
},
|
|
193
|
+
subRow: {
|
|
194
|
+
'&& > .MuiTableCell-root': {
|
|
195
|
+
paddingLeft: 0,
|
|
196
|
+
paddingRight: 0,
|
|
197
|
+
},
|
|
198
|
+
'& .MuiTableHead-root': {
|
|
199
|
+
zIndex: 2,
|
|
200
|
+
},
|
|
201
|
+
},
|
|
202
|
+
emptyLabel: {
|
|
203
|
+
padding: '12px 16px',
|
|
204
|
+
},
|
|
205
|
+
});
|
|
206
|
+
const DragDropContextWrapper = (props) => (_jsx(_Fragment, { children: !props.draggable ? (props.children()) : (_jsx(DragDropContext, { ...props, children: _jsx(Droppable, { droppableId: "droppable", children: props.children }) })) }));
|
|
207
|
+
const DraggableWrapper = ({ children, ...props }) => !props.draggable ? (children()) : (_jsx(Draggable, { draggableId: props.draggableId, index: props.index, children: children }));
|
|
208
|
+
function TableComponent(props) {
|
|
209
|
+
const { className, table, caption = null, emptyLabel = null, getTableProps, getHeaderGroupProps, getHeaderProps, getTableBodyProps, getRowProps, getCellProps, renderRowSubComponent, getSubRow, getSubRowProps, getSubRowCellProps, classes, selectedColor = 'secondary', tableId, getRowUrl, ...rest } = props;
|
|
210
|
+
const { className: tableBodyClassNameProp, ...tableBodyProps } = useMemo(() => table.getTableBodyProps(getTableBodyProps), [getTableBodyProps, table]);
|
|
211
|
+
const accessibility = useMemo(getAccessabilityValue, []);
|
|
212
|
+
const { headerGroups, rows, prepareRow } = table;
|
|
213
|
+
const {
|
|
214
|
+
// which has only the rows for the active page
|
|
215
|
+
gotoPage, page = [], // Instead of using 'rows', we'll use page?,
|
|
216
|
+
setPageSize, visibleColumns, manualPagination, state: { pageIndex, pageSize: rowsPerPage }, onPageChange, onSortingChange, total = -1, } = table;
|
|
217
|
+
const canPaginate = useMemo(() => Boolean(page?.length), [page]);
|
|
218
|
+
const data = useMemo(() => (canPaginate ? page : rows), [canPaginate, page, rows]);
|
|
219
|
+
const colSpan = useMemo(() => table.allColumns.length, [table.allColumns]);
|
|
220
|
+
const count = useMemo(() => (manualPagination ? total : table.rows.length), [manualPagination, total, table.rows.length]);
|
|
221
|
+
const contextValue = useMemo(() => ({
|
|
222
|
+
colSpan,
|
|
223
|
+
count,
|
|
224
|
+
page: pageIndex,
|
|
225
|
+
rowsPerPage,
|
|
226
|
+
pagination: canPaginate,
|
|
227
|
+
}), [canPaginate, colSpan, count, pageIndex, rowsPerPage]);
|
|
228
|
+
const handleRowClick = useCallback((row) => (event) => {
|
|
229
|
+
const url = getRowUrl?.(row);
|
|
230
|
+
if (url && (event.ctrlKey || event.metaKey)) {
|
|
231
|
+
event.preventDefault();
|
|
232
|
+
event.stopPropagation();
|
|
233
|
+
window.open(url, '_blank');
|
|
234
|
+
return;
|
|
235
|
+
}
|
|
236
|
+
if (url && event.button === 0 && !event.ctrlKey && !event.metaKey) {
|
|
237
|
+
// For normal left clicks with URL, use pushState to avoid full page reload
|
|
238
|
+
event.preventDefault();
|
|
239
|
+
event.stopPropagation();
|
|
240
|
+
window.history.pushState(null, '', url);
|
|
241
|
+
window.dispatchEvent(new PopStateEvent('popstate'));
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
244
|
+
row.toggleRowExpanded?.(!row.isExpanded);
|
|
245
|
+
row.toggleRowActive?.(!row.isActive);
|
|
246
|
+
}, [getRowUrl]);
|
|
247
|
+
const handleRowMouseDown = useCallback((row) => (event) => {
|
|
248
|
+
const url = getRowUrl?.(row);
|
|
249
|
+
if (url && event.button === 1) {
|
|
250
|
+
event.preventDefault();
|
|
251
|
+
event.stopPropagation();
|
|
252
|
+
window.open(url, '_blank');
|
|
253
|
+
}
|
|
254
|
+
}, [getRowUrl]);
|
|
255
|
+
const handleRowAuxClick = useCallback((row) => (event) => {
|
|
256
|
+
const url = getRowUrl?.(row);
|
|
257
|
+
// Handle middle-click for new tab (fallback)
|
|
258
|
+
if (url && event.button === 1) {
|
|
259
|
+
event.preventDefault();
|
|
260
|
+
event.stopPropagation();
|
|
261
|
+
window.open(url, '_blank');
|
|
262
|
+
}
|
|
263
|
+
}, [getRowUrl]);
|
|
264
|
+
const handlePageChange = useCallback(async (params) => await onPageChange?.(params), [onPageChange]);
|
|
265
|
+
const handleRowsPerPageChange = useCallback(async (e) => {
|
|
266
|
+
const nextPageSize = parseInt(e.target.value, 10);
|
|
267
|
+
await handlePageChange({ offset: 0, limit: nextPageSize });
|
|
268
|
+
setPageSize(nextPageSize);
|
|
269
|
+
}, [handlePageChange, setPageSize]);
|
|
270
|
+
const handleGoToPage = useCallback(async (e, page) => {
|
|
271
|
+
await handlePageChange?.({
|
|
272
|
+
offset: page * rowsPerPage,
|
|
273
|
+
limit: rowsPerPage,
|
|
274
|
+
});
|
|
275
|
+
gotoPage(page);
|
|
276
|
+
}, [handlePageChange, gotoPage, rowsPerPage]);
|
|
277
|
+
const [isDragging, setDragging] = useState(false);
|
|
278
|
+
const { draggable, onBeforeDragStart: propsOnBeforeDragStart, onDragEnd: propsOnDragEnd, dragShiftEnabled, } = rest;
|
|
279
|
+
const isDraggable = useMemo(() => draggable && data.length > 1, [data.length, draggable]);
|
|
280
|
+
const onBeforeDragStart = useCallback((initial) => {
|
|
281
|
+
setDragging(true);
|
|
282
|
+
isDraggable && propsOnBeforeDragStart?.(initial);
|
|
283
|
+
}, [isDraggable, propsOnBeforeDragStart]);
|
|
284
|
+
const { data: tableData } = table;
|
|
285
|
+
const onDragEnd = useCallback((result, provided) => {
|
|
286
|
+
setDragging(false);
|
|
287
|
+
// dropped outside the list
|
|
288
|
+
if (!result.destination)
|
|
289
|
+
return;
|
|
290
|
+
// no movement
|
|
291
|
+
if (result.destination.index === result.source.index)
|
|
292
|
+
return;
|
|
293
|
+
const shift = pageIndex * rowsPerPage;
|
|
294
|
+
const copyShift = manualPagination ? shift : 0;
|
|
295
|
+
const dragShift = dragShiftEnabled || manualPagination ? shift : 0;
|
|
296
|
+
const resultCopy = { ...result };
|
|
297
|
+
set(resultCopy, 'source.index', result.source.index + copyShift);
|
|
298
|
+
set(resultCopy, 'destination.index', result.destination.index + copyShift);
|
|
299
|
+
isDraggable &&
|
|
300
|
+
propsOnDragEnd?.({
|
|
301
|
+
data: swap(result.source.index + dragShift, result.destination.index + dragShift, tableData),
|
|
302
|
+
result,
|
|
303
|
+
provided,
|
|
304
|
+
});
|
|
305
|
+
}, [
|
|
306
|
+
isDraggable,
|
|
307
|
+
manualPagination,
|
|
308
|
+
pageIndex,
|
|
309
|
+
propsOnDragEnd,
|
|
310
|
+
rowsPerPage,
|
|
311
|
+
dragShiftEnabled,
|
|
312
|
+
tableData,
|
|
313
|
+
]);
|
|
314
|
+
const displayedRowsFrom = useMemo(() => (count === 0 ? 0 : pageIndex * rowsPerPage + 1), [count, pageIndex, rowsPerPage]);
|
|
315
|
+
const displayedRowsTo = useMemo(() => {
|
|
316
|
+
if (count === -1)
|
|
317
|
+
return (pageIndex + 1) * rowsPerPage;
|
|
318
|
+
return rowsPerPage === -1
|
|
319
|
+
? count
|
|
320
|
+
: Math.min(count, (pageIndex + 1) * rowsPerPage);
|
|
321
|
+
}, [count, pageIndex, rowsPerPage]);
|
|
322
|
+
return (_jsx(TableContextProvider, { value: contextValue, children: _jsx("div", { className: classNames(classes.root, className), "data-testid": rest['data-testid'] ?? 'table-component', children: _jsxs("div", { className: classes.table, children: [canPaginate && (_jsxs(Stack, { className: classNames(classes.pagination, {
|
|
323
|
+
[classes.accessibilityPagination]: accessibility,
|
|
324
|
+
}), children: [_jsx(Typography, { variant: "body2", className: classNames(classes.qty, {
|
|
325
|
+
[classes.accessibilityQty]: accessibility,
|
|
326
|
+
}), children: _jsx(TransQty, { i18nKey: "showingFromToOf", values: {
|
|
327
|
+
from: displayedRowsFrom,
|
|
328
|
+
to: displayedRowsTo,
|
|
329
|
+
count,
|
|
330
|
+
}, tOptions: { postProcess: 'interval' } }) }), _jsx(TablePagination, { colSpan: colSpan - 1, onPageChange: handleGoToPage, onRowsPerPageChange: handleRowsPerPageChange })] })), caption, _jsx(DragDropContextWrapper, { ...rest, ...(isDraggable && {
|
|
331
|
+
draggable: true,
|
|
332
|
+
onBeforeDragStart,
|
|
333
|
+
onDragEnd,
|
|
334
|
+
}), children: (droppableProvided) => (_jsxs("div", { ref: droppableProvided?.innerRef, className: classes.container, children: [_jsxs(MuiTable, { ref: table.node, size: "small", id: tableId, ...table.getTableProps(getTableProps), children: [_jsx(TableHead, { className: classes.thead, "data-testid": "table-head", children: headerGroups.map((headerGroup) => {
|
|
335
|
+
const { className, ...headerGroupProps } = headerGroup.getHeaderGroupProps(getHeaderGroupProps);
|
|
336
|
+
return (_jsx(TableRow, { ...headerGroup.getHeaderGroupProps(), ...headerGroupProps, className: classNames(classes.row, className), children: headerGroup.headers.map((column) => {
|
|
337
|
+
const { canSort, isSorted, isSortedDesc, width, getSortByToggleProps, } = column;
|
|
338
|
+
const { className, ...headerProps } = column.getHeaderProps({
|
|
339
|
+
...getHeaderProps,
|
|
340
|
+
...getSortByToggleProps?.(),
|
|
341
|
+
});
|
|
342
|
+
return (_jsxs(TableCell, { variant: "head", ...column.getHeaderProps(), ...headerProps, ...(canSort &&
|
|
343
|
+
onSortingChange && {
|
|
344
|
+
onClick: () => onSortingChange(getSortArray(column)),
|
|
345
|
+
}), sx: { width }, className: classNames(classes.cell, classes.head, className, {
|
|
346
|
+
[classes.headCanSort]: canSort,
|
|
347
|
+
[classes.cellSorted]: isSorted,
|
|
348
|
+
[classes.accessibilityCell]: accessibility,
|
|
349
|
+
}), children: [_jsxs(Stack, { direction: "row", alignItems: "center", spacing: 1, className: classes.col, children: [_jsx("div", { className: classes.title, children: column.render('Header') }), canSort && (_jsx(Icon, { className: classes.sort, name: `direction-${isSortedDesc ? 'bottom' : 'top'}` }))] }), column.canFilter && column.filter && (_jsx(Input, { value: column.filterValue, onClick: (e) => e.stopPropagation(), onChange: (e) => column.setFilter(e.target.value), placeholder: renderToString(_jsx(TransButton, { i18nKey: "search" })) }))] }));
|
|
350
|
+
}) }));
|
|
351
|
+
}) }), _jsxs(TableBody, { className: classNames(classes.tbody, tableBodyClassNameProp), ...tableBodyProps, children: [data.map((row, index) => {
|
|
352
|
+
prepareRow(row);
|
|
353
|
+
const { key, ...baseRowProps } = row.getRowProps();
|
|
354
|
+
const { className, ...rowProps } = row.getRowProps(getRowProps);
|
|
355
|
+
const subRow = (renderRowSubComponent ?? getSubRow)?.(row) ?? null;
|
|
356
|
+
const { className: subRowClassName, ...subRowProps } = row.getRowProps(getSubRowProps);
|
|
357
|
+
const { className: subRowCellClassName, ...subRowCellProps } = row.getRowProps(getSubRowCellProps);
|
|
358
|
+
return (_jsxs(Fragment, { children: [_jsx(DraggableWrapper, { draggable: isDraggable, ...(isDraggable && {
|
|
359
|
+
draggable: true,
|
|
360
|
+
draggableId: `${row.id}`,
|
|
361
|
+
index,
|
|
362
|
+
}), children: (draggableProvided, draggableSnapshot) => (_jsx(TableRow, { "data-testid": "table-row", ref: draggableProvided?.innerRef, ...baseRowProps, ...rowProps, onClick: handleRowClick(row), onMouseDown: handleRowMouseDown(row), onAuxClick: handleRowAuxClick(row), className: classNames(classes.row, className, {
|
|
363
|
+
[classes.rowEditable]: row.state?.creatable,
|
|
364
|
+
[classes.rowEditable]: row.state?.editable,
|
|
365
|
+
[classes.pointer]: Boolean(rowProps?.onClick || getRowUrl),
|
|
366
|
+
}), ...draggableProvided?.draggableProps, ...draggableProvided?.dragHandleProps, children: row.cells.map((cell) => {
|
|
367
|
+
const { className, ...cellProps } = cell.getCellProps(getCellProps);
|
|
368
|
+
return (_jsx(TableCellDnD, { variant: "body", isDragOccurring: isDragging, ...cell.getCellProps(), className: classNames(classes.cell, className, {
|
|
369
|
+
[classes.cellEditable]: row.state?.creatable ||
|
|
370
|
+
row.state?.editable,
|
|
371
|
+
[classes.cellActive]: row.isActive ||
|
|
372
|
+
row.isExpanded ||
|
|
373
|
+
row.state?.creatable ||
|
|
374
|
+
row.state?.editable,
|
|
375
|
+
[classes.cellSelected]: row?.isSelected,
|
|
376
|
+
[classes[`cellSelected${capitalize(selectedColor)}`]]: row?.isSelected,
|
|
377
|
+
[classes.cellDragging]: draggableSnapshot?.isDragging,
|
|
378
|
+
[classes.cellIsActions]: cell.column.id === 'actions',
|
|
379
|
+
[classes.accessibilityCell]: accessibility,
|
|
380
|
+
}), ...cellProps, children: _jsx("div", { className: classes.col, children: cell.render('Cell') }) }));
|
|
381
|
+
}) }, `${key}__row`)) }), row.isExpanded && subRow && (_createElement("tr", { ...subRowProps, key: `${key}__subRow`, className: classNames(classes.subRow, subRowClassName) },
|
|
382
|
+
_createElement("td", {
|
|
383
|
+
// + 1 here, see src/mui/theme, MuiTableRow-root:before
|
|
384
|
+
colSpan: visibleColumns.length + 1, className: classNames(subRowCellClassName), ...subRowCellProps, key: `${key}__subRow__cell` }, subRow)))] }, key));
|
|
385
|
+
}), isDraggable && droppableProvided.placeholder] })] }), emptyLabel && !data.length && (_jsx(Typography, { variant: "body2", color: "text.secondary", className: classes.emptyLabel, children: emptyLabel }))] })) })] }) }) }));
|
|
386
|
+
}
|
|
387
|
+
export const Table = withStyles(tableStyles, {
|
|
388
|
+
name: 'Table',
|
|
389
|
+
})(TableComponent);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { makeStyles } from '@mui/styles';
|
|
3
|
+
const useStyles = makeStyles((theme) => ({
|
|
4
|
+
root: {
|
|
5
|
+
position: 'fixed',
|
|
6
|
+
right: theme.spacing(3),
|
|
7
|
+
bottom: 0,
|
|
8
|
+
fontFamily: 'ui-monospace,"Cascadia Mono","Segoe UI Mono","Liberation Mono",Menlo,Monaco,Consolas,monospace',
|
|
9
|
+
fontSize: 11,
|
|
10
|
+
fontWeight: 400,
|
|
11
|
+
lineHeight: theme.spacing(3),
|
|
12
|
+
// Not `text.disabled`: that token is derived from the tenant's brand
|
|
13
|
+
// colours and lands around 2.7:1 on the light page background. grey[800]
|
|
14
|
+
// is a fixed value in the theme (6.74:1 on #F9F9F9).
|
|
15
|
+
color: theme.palette.grey[800],
|
|
16
|
+
},
|
|
17
|
+
}), {
|
|
18
|
+
name: 'AppVersion',
|
|
19
|
+
});
|
|
20
|
+
export const AppVersion = ({ version }) => {
|
|
21
|
+
const classes = useStyles();
|
|
22
|
+
return (_jsx("div", { className: classes.root, "data-testid": "app-version", children: version }));
|
|
23
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { SelectValue } from "../mui/Select";
|
|
2
|
+
import { Classifier } from "./classifier";
|
|
3
|
+
import { Option } from "./option";
|
|
4
|
+
export interface BusinessEntity<D extends SelectValue> {
|
|
5
|
+
contactType: string;
|
|
6
|
+
id: D;
|
|
7
|
+
isMain: boolean;
|
|
8
|
+
name: string;
|
|
9
|
+
roles: Array<Classifier>;
|
|
10
|
+
}
|
|
11
|
+
export declare type BusinessEntities<D extends SelectValue> = Array<BusinessEntity<D>>;
|
|
12
|
+
export interface BusinessEntityOption<D extends SelectValue> extends Option<D> {
|
|
13
|
+
contactType: string;
|
|
14
|
+
isValid?: boolean;
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface Classifier<T = string> {
|
|
2
|
+
id: T;
|
|
3
|
+
name: string;
|
|
4
|
+
}
|
|
5
|
+
export declare const mapClassifierValues: <T>(values: T) => MapClassifierInterface<T, Extract<keyof T, string>>;
|
|
6
|
+
declare type Primitive = Date | null | undefined | string | number | boolean | symbol | bigint;
|
|
7
|
+
declare type KeyOf<T> = Extract<keyof T, string>;
|
|
8
|
+
declare type ClassifierKey<T, P extends KeyOf<T>> = T[P] extends Classifier ? `${P}Id` : `${P}`;
|
|
9
|
+
declare type ClassifierVal<T, P extends KeyOf<T>, V extends T[P] = T[P]> = V extends Classifier ? V['id'] : V extends (infer Item)[] ? Array<ClassifierVal<Item, KeyOf<Item>>> : V extends Primitive ? V : MapClassifierInterface<V, KeyOf<V>>;
|
|
10
|
+
export declare type MapClassifierInterface<T, K extends KeyOf<T> = KeyOf<T>> = {
|
|
11
|
+
[P in K as ClassifierKey<T, P>]?: ClassifierVal<T, P>;
|
|
12
|
+
};
|
|
13
|
+
export {};
|
package/dto/common.d.ts
ADDED
package/dto/common.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dto/fare.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Classifier } from "./classifier";
|
|
2
|
+
export interface Stop {
|
|
3
|
+
id: string;
|
|
4
|
+
stop: Classifier<number> & {
|
|
5
|
+
city: Classifier<number> | null;
|
|
6
|
+
country: Classifier<number> | null;
|
|
7
|
+
county: Classifier<number> | null;
|
|
8
|
+
streetAddress?: string;
|
|
9
|
+
};
|
|
10
|
+
hasDistances?: boolean;
|
|
11
|
+
}
|
package/dto/fare.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export interface LineNetworkStop {
|
|
2
|
+
id: number;
|
|
3
|
+
guid: string;
|
|
4
|
+
code: string;
|
|
5
|
+
name: string;
|
|
6
|
+
streetAddress: string;
|
|
7
|
+
zipCode: string;
|
|
8
|
+
cityId: number;
|
|
9
|
+
countyId: number;
|
|
10
|
+
countryId: number;
|
|
11
|
+
latitude: number;
|
|
12
|
+
longitude: number;
|
|
13
|
+
isMultiLegHub: true;
|
|
14
|
+
minTransferTimeInMinutes: number;
|
|
15
|
+
isWheelChairAccessible: boolean;
|
|
16
|
+
localizations: Array<{
|
|
17
|
+
languageId: string;
|
|
18
|
+
name: string;
|
|
19
|
+
}>;
|
|
20
|
+
cityName: string;
|
|
21
|
+
countryName: string;
|
|
22
|
+
countyName: string;
|
|
23
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dto/option.d.ts
ADDED
package/dto/option.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { FC } from 'react';
|
|
2
|
+
import { ControllerProps } from 'react-hook-form';
|
|
3
|
+
export interface FormCheckboxProps {
|
|
4
|
+
name: string;
|
|
5
|
+
label: string;
|
|
6
|
+
rules?: ControllerProps['rules'];
|
|
7
|
+
labelPosition?: 'top' | 'left';
|
|
8
|
+
className?: string;
|
|
9
|
+
required?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare const FormCheckbox: FC<FormCheckboxProps>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Checkbox } from "../mui/Checkbox";
|
|
3
|
+
import { FormControl } from "../mui/FormControl";
|
|
4
|
+
import { FormController } from "./FormController";
|
|
5
|
+
export const FormCheckbox = ({ name, label, rules, labelPosition = 'top', required, className, }) => (_jsx(FormController, { name: name, rules: rules, required: required, render: ({ field: { onChange, value }, fieldState: { error } }) => (_jsx(FormControl, { error: error?.message, labelPosition: labelPosition, className: className, required: required, children: _jsx(Checkbox, { label: label, checked: value, onChange: onChange, required: required }) })) }));
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { FC } from 'react';
|
|
2
|
+
import { ControllerProps } from 'react-hook-form';
|
|
3
|
+
import { CheckboxGroupProps } from "../mui/Checkbox/CheckboxGroup";
|
|
4
|
+
export interface FormCheckboxGroupProps extends Pick<ControllerProps, 'rules'>, CheckboxGroupProps<object> {
|
|
5
|
+
}
|
|
6
|
+
export declare const FormCheckboxGroup: FC<FormCheckboxGroupProps>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useFormContext } from 'react-hook-form';
|
|
3
|
+
import { CheckboxGroup } from "../mui/Checkbox/CheckboxGroup";
|
|
4
|
+
import { useCallback } from 'react';
|
|
5
|
+
import { FormController } from "./FormController";
|
|
6
|
+
export const FormCheckboxGroup = (props) => {
|
|
7
|
+
const { name, rules, required, ...rest } = props;
|
|
8
|
+
const { setValue } = useFormContext();
|
|
9
|
+
const updateValue = useCallback(({ name, value }) => {
|
|
10
|
+
setValue(name, value, {
|
|
11
|
+
shouldValidate: true,
|
|
12
|
+
shouldDirty: true,
|
|
13
|
+
shouldTouch: true,
|
|
14
|
+
});
|
|
15
|
+
}, [setValue]);
|
|
16
|
+
const handleChange = useCallback((event, value) => {
|
|
17
|
+
updateValue(name ? { name, value } : event.target);
|
|
18
|
+
}, [name, updateValue]);
|
|
19
|
+
return (_jsx(FormController, { name: name, rules: rules, required: required, render: ({ field: { value }, fieldState: { error } }) => (_jsx(_Fragment, { children: _jsx(CheckboxGroup, { name: name, value: value, onChange: handleChange, error: error?.message, required: required, ...rest }) })) }));
|
|
20
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ControllerProps } from 'react-hook-form';
|
|
3
|
+
import { FieldPath, FieldValues } from 'react-hook-form/dist/types';
|
|
4
|
+
export interface FormControllerProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> extends ControllerProps<TFieldValues, TName> {
|
|
5
|
+
required?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function FormController<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>(props: FormControllerProps<TFieldValues, TName>): JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Controller, useFormContext } from 'react-hook-form';
|
|
3
|
+
import { useMemo } from 'react';
|
|
4
|
+
import { useTranslation } from "../hooks/useTranslation";
|
|
5
|
+
export function FormController(props) {
|
|
6
|
+
const { name, required, ...rest } = props;
|
|
7
|
+
const { t } = useTranslation();
|
|
8
|
+
const rules = useMemo(() => ({
|
|
9
|
+
...(required && {
|
|
10
|
+
required: t('error.required'),
|
|
11
|
+
}),
|
|
12
|
+
...props.rules,
|
|
13
|
+
}), [props.rules, required, t]);
|
|
14
|
+
const { control } = useFormContext();
|
|
15
|
+
return _jsx(Controller, { name: name, control: control, ...rest, rules: rules });
|
|
16
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { ControllerProps } from 'react-hook-form';
|
|
3
|
+
import { DatePickerProps } from "../mui/DatePicker";
|
|
4
|
+
export interface FormDatepickerProps<R extends boolean> extends DatePickerProps<R> {
|
|
5
|
+
name: string;
|
|
6
|
+
rules?: ControllerProps['rules'];
|
|
7
|
+
}
|
|
8
|
+
export declare function FormDatepicker<R extends boolean>(props: FormDatepickerProps<R>): JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { DatePicker } from "../mui/DatePicker";
|
|
3
|
+
import { FormController } from "./FormController";
|
|
4
|
+
export function FormDatepicker(props) {
|
|
5
|
+
const { name, label, rules, required, ...rest } = props;
|
|
6
|
+
return (_jsx(FormController, { name: name, required: required, rules: rules, render: ({ field: { onChange, value }, fieldState: { error } }) => (_jsx(DatePicker, { onChange: onChange, label: label, value: value, error: error?.message, required: required, ...rest })) }));
|
|
7
|
+
}
|