@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,47 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { makeStyles } from '@mui/styles';
|
|
3
|
+
import { usePrompt } from "../hooks/usePrompt";
|
|
4
|
+
import { useCallback } from 'react';
|
|
5
|
+
import classNames from 'classnames';
|
|
6
|
+
import { TransButton } from "../i18n/trans/button";
|
|
7
|
+
import { Button, Icon, Modal } from "../mui";
|
|
8
|
+
import { useModal } from "../hooks";
|
|
9
|
+
const useStyles = makeStyles(() => ({
|
|
10
|
+
root: {},
|
|
11
|
+
}), {
|
|
12
|
+
name: 'ConfirmButton',
|
|
13
|
+
});
|
|
14
|
+
export function ConfirmButton({ onConfirm, onCancel, className, title, children, color, description, modalProps, ...props }) {
|
|
15
|
+
const modal = useModal();
|
|
16
|
+
const prompt = usePrompt();
|
|
17
|
+
const handleClick = useCallback(async () => {
|
|
18
|
+
modal.onOpen();
|
|
19
|
+
try {
|
|
20
|
+
await prompt.show();
|
|
21
|
+
await onConfirm?.();
|
|
22
|
+
}
|
|
23
|
+
catch (e) {
|
|
24
|
+
onCancel?.(e);
|
|
25
|
+
}
|
|
26
|
+
finally {
|
|
27
|
+
modal.onClose();
|
|
28
|
+
}
|
|
29
|
+
}, [modal, onCancel, onConfirm, prompt]);
|
|
30
|
+
const handleConfirm = useCallback(async () => await prompt.confirm(), [prompt]);
|
|
31
|
+
const handleCancel = useCallback(async () => await prompt.cancel(), [prompt]);
|
|
32
|
+
const classes = useStyles();
|
|
33
|
+
return (_jsxs(_Fragment, { children: [_jsx(Button, { className: classNames(classes.root, className), onClick: handleClick, color: color, ...props, children: children }), _jsx(Modal, { title: title ?? _jsxs(_Fragment, { children: [children, " ?"] }), actionButton: {
|
|
34
|
+
label: _jsx(TransButton, { i18nKey: "confirm" }),
|
|
35
|
+
onClick: handleConfirm,
|
|
36
|
+
color,
|
|
37
|
+
}, maxWidth: "xs", open: modal.open, onClose: handleCancel, ...modalProps, children: description })] }));
|
|
38
|
+
}
|
|
39
|
+
export function ConfirmDeleteButton({ children, isOnlyIcon = false, ...props }) {
|
|
40
|
+
const renderChildren = useCallback(() => {
|
|
41
|
+
if (isOnlyIcon) {
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
return children ?? _jsx(TransButton, { i18nKey: "delete" });
|
|
45
|
+
}, [children, isOnlyIcon]);
|
|
46
|
+
return (_jsx(ConfirmButton, { variant: "text", color: "error", startIcon: _jsx(Icon, { name: "delete" }), ...props, children: renderChildren() }));
|
|
47
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { DrawerProps } from '@mui/material/Drawer';
|
|
3
|
+
export { DrawerProps };
|
|
4
|
+
export declare const Drawer: import("react").ForwardRefExoticComponent<Pick<DrawerProps, "open" | "placeholder" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "children" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "components" | "anchor" | "transitionDuration" | "classes" | "sx" | "elevation" | "variant" | "componentsProps" | "disablePortal" | "onClose" | "container" | "keepMounted" | "BackdropComponent" | "BackdropProps" | "closeAfterTransition" | "disableAutoFocus" | "disableEnforceFocus" | "disableEscapeKeyDown" | "disableRestoreFocus" | "disableScrollLock" | "hideBackdrop" | "onBackdropClick" | "PaperProps" | "ModalProps" | "SlideProps"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import MuiDrawer from '@mui/material/Drawer';
|
|
3
|
+
import { forwardRef } from 'react';
|
|
4
|
+
import { makeStyles } from '@mui/styles';
|
|
5
|
+
import { EnvBannerClass, EnvBannerHeight } from "./EnvironmentBanner";
|
|
6
|
+
import classNames from 'classnames';
|
|
7
|
+
const useStyles = makeStyles(() => ({
|
|
8
|
+
headerAlignment: {
|
|
9
|
+
top: 48,
|
|
10
|
+
'& .MuiDrawer-paper': {
|
|
11
|
+
position: 'absolute',
|
|
12
|
+
paddingTop: ({ isEnvBannerVisible }) => `${isEnvBannerVisible ? EnvBannerHeight : 0}px`,
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
}), {
|
|
16
|
+
name: 'Drawer',
|
|
17
|
+
});
|
|
18
|
+
export const Drawer = forwardRef(({ className, children, ...props }, ref) => {
|
|
19
|
+
const isEnvBannerVisible = !!document.querySelector(`[class*="${EnvBannerClass}"]`);
|
|
20
|
+
const classes = useStyles({ isEnvBannerVisible });
|
|
21
|
+
return (_jsx(MuiDrawer, { ref: ref, className: classNames(className, {
|
|
22
|
+
[classes.headerAlignment]: props.disablePortal !== true,
|
|
23
|
+
}), "data-testid": "drawer-component", ...props, children: children }));
|
|
24
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { makeStyles } from '@mui/styles';
|
|
3
|
+
import CardActions from '@mui/material/CardActions';
|
|
4
|
+
import classNames from 'classnames';
|
|
5
|
+
const useStyles = makeStyles((theme) => ({
|
|
6
|
+
root: {
|
|
7
|
+
justifyContent: 'flex-end',
|
|
8
|
+
background: theme.palette.common.white,
|
|
9
|
+
boxShadow: theme.shadows[3],
|
|
10
|
+
padding: theme.spacing(3),
|
|
11
|
+
position: 'sticky',
|
|
12
|
+
bottom: 0,
|
|
13
|
+
zIndex: 1,
|
|
14
|
+
},
|
|
15
|
+
}), {
|
|
16
|
+
name: 'DrawerFormCardActions',
|
|
17
|
+
});
|
|
18
|
+
export const DrawerFormCardActions = ({ className, ...props }) => {
|
|
19
|
+
const classes = useStyles();
|
|
20
|
+
return (_jsx(CardActions, { className: classNames(classes.root, className), ...props }));
|
|
21
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { IconButton } from '@mui/material';
|
|
3
|
+
import { Icon, Tooltip } from "../../mui";
|
|
4
|
+
import { TransButton } from "../../i18n/trans/button";
|
|
5
|
+
export const DrawerFormCloseButton = (props) => (_jsx(IconButton, { "aria-label": "close", ...props, children: _jsx(Tooltip, { content: _jsx(TransButton, { i18nKey: "close" }), delay: 500, children: _jsx(Icon, { name: "close", size: 24 }) }) }));
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface DrawerFormContextValue {
|
|
3
|
+
handleClose: (event?: object, reason?: 'backdropClick' | 'escapeKeyDown' | 'close') => void;
|
|
4
|
+
}
|
|
5
|
+
export declare const DrawerFormContext: import("react").Context<DrawerFormContextValue>;
|
|
6
|
+
export declare const DrawerFormContextProvider: import("react").Provider<DrawerFormContextValue>, DrawerFormContextConsumer: import("react").Consumer<DrawerFormContextValue>;
|
|
7
|
+
export declare const useDrawerForm: () => DrawerFormContextValue;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { createContext, useContext } from 'react';
|
|
2
|
+
export const DrawerFormContext = createContext(null);
|
|
3
|
+
export const { Provider: DrawerFormContextProvider, Consumer: DrawerFormContextConsumer, } = DrawerFormContext;
|
|
4
|
+
export const useDrawerForm = () => useContext(DrawerFormContext);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { type DrawerProps } from "./Drawer";
|
|
3
|
+
import { DrawerFormContextValue } from "./DrawerForm/DrawerFormContext";
|
|
4
|
+
export interface DrawerFormProps extends DrawerProps {
|
|
5
|
+
arrow?: boolean;
|
|
6
|
+
width?: string | number;
|
|
7
|
+
onClose?: DrawerFormContextValue['handleClose'];
|
|
8
|
+
['data-testid']?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function DrawerForm(inProps: DrawerFormProps): JSX.Element;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useRef } from 'react';
|
|
3
|
+
import { makeStyles, useTheme } from '@mui/styles';
|
|
4
|
+
import Paper from '@mui/material/Paper';
|
|
5
|
+
import ClickAwayListener from '@mui/material/ClickAwayListener';
|
|
6
|
+
import { Icon } from "../mui/Icon";
|
|
7
|
+
import classNames from 'classnames';
|
|
8
|
+
import { alpha } from '@mui/material/styles';
|
|
9
|
+
import { Drawer } from "./Drawer";
|
|
10
|
+
import { DrawerFormContextProvider, } from "./DrawerForm/DrawerFormContext";
|
|
11
|
+
import { useInertBackground } from "../hooks/useInertBackground";
|
|
12
|
+
import { useTranslation } from "../hooks/useTranslation";
|
|
13
|
+
const useStyles = makeStyles((theme) => ({
|
|
14
|
+
modal: ({ width, disablePortal }) => ({
|
|
15
|
+
width,
|
|
16
|
+
left: 'auto',
|
|
17
|
+
zIndex: theme.zIndex.drawer,
|
|
18
|
+
...(!width && { minWidth: 768, width: '80%' }),
|
|
19
|
+
...(disablePortal !== false && { position: 'absolute' }),
|
|
20
|
+
}),
|
|
21
|
+
paper: {
|
|
22
|
+
position: 'relative',
|
|
23
|
+
width: '100%',
|
|
24
|
+
height: '100%',
|
|
25
|
+
overflowY: 'auto',
|
|
26
|
+
display: 'flex',
|
|
27
|
+
flexDirection: 'row',
|
|
28
|
+
marginLeft: 'auto',
|
|
29
|
+
overflow: 'auto',
|
|
30
|
+
border: 'none',
|
|
31
|
+
},
|
|
32
|
+
arrow: {
|
|
33
|
+
display: 'flex',
|
|
34
|
+
alignItems: 'center',
|
|
35
|
+
justifyContent: 'center',
|
|
36
|
+
width: 24,
|
|
37
|
+
height: '100%',
|
|
38
|
+
background: theme.palette.common.white,
|
|
39
|
+
border: 0,
|
|
40
|
+
borderRight: `1px solid ${theme.palette.divider}`,
|
|
41
|
+
color: theme.palette.primary.main,
|
|
42
|
+
cursor: 'pointer',
|
|
43
|
+
padding: 0,
|
|
44
|
+
'&:hover': {
|
|
45
|
+
background: alpha(theme.palette.action.hover, 0.1),
|
|
46
|
+
'& .Icon-root': {
|
|
47
|
+
color: theme.palette.primary.main,
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
content: {
|
|
52
|
+
display: 'flex',
|
|
53
|
+
flexDirection: 'column',
|
|
54
|
+
flex: 1,
|
|
55
|
+
overflow: 'auto',
|
|
56
|
+
},
|
|
57
|
+
}), {
|
|
58
|
+
name: 'DrawerForm',
|
|
59
|
+
});
|
|
60
|
+
export function DrawerForm(inProps) {
|
|
61
|
+
const { open, onClose, className, arrow = true, width, children, ...props } = inProps;
|
|
62
|
+
const theme = useTheme();
|
|
63
|
+
const { t } = useTranslation();
|
|
64
|
+
const transitionDuration = {
|
|
65
|
+
enter: theme.transitions.duration.shorter,
|
|
66
|
+
exit: theme.transitions.duration.shortest,
|
|
67
|
+
};
|
|
68
|
+
const handleClickClose = useCallback((event) => {
|
|
69
|
+
onClose?.(event, 'close');
|
|
70
|
+
}, [onClose]);
|
|
71
|
+
const handleClickAway = useCallback((event) => {
|
|
72
|
+
if (open)
|
|
73
|
+
onClose?.(event, 'backdropClick');
|
|
74
|
+
}, [open, onClose]);
|
|
75
|
+
const classes = useStyles({ width, ...props });
|
|
76
|
+
// The drawer is a modal: MUI moves focus into it on open, keeps it there
|
|
77
|
+
// while it is open and puts it back on close. The page behind it is hidden
|
|
78
|
+
// and made inert so it is neither announced nor tabbable (see the hook for
|
|
79
|
+
// why MUI's own aria-hidden is not enough here).
|
|
80
|
+
const drawerRef = useRef(null);
|
|
81
|
+
useInertBackground(Boolean(open), drawerRef);
|
|
82
|
+
return (_jsx(ClickAwayListener, { onClickAway: handleClickAway, children: _jsx(Drawer, { ref: drawerRef, anchor: "right", open: open, onClose: onClose, className: classNames(classes.modal, className), disablePortal: true, hideBackdrop: true, PaperProps: {
|
|
83
|
+
className: classes.paper,
|
|
84
|
+
elevation: 4,
|
|
85
|
+
square: true,
|
|
86
|
+
// Focus target for MUI's focus trap when the drawer opens.
|
|
87
|
+
tabIndex: -1,
|
|
88
|
+
}, SlideProps: { timeout: transitionDuration }, ...props, children: _jsxs(_Fragment, { children: [arrow && (_jsx("button", { type: "button", className: classNames(classes.arrow, 'drawer-button'), "aria-label": t('button.collapse', 'Collapse'), onClick: handleClickClose, children: _jsx(Icon, { name: "chevron-right" }) })), _jsx(Paper, { className: classes.content, ...(arrow && { variant: 'surface' }), children: _jsx(DrawerFormContextProvider, { value: { handleClose: handleClickClose }, children: children }) })] }) }) }));
|
|
89
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import "./editor.scss";
|
|
2
|
+
import { FocusEvent } from 'react';
|
|
3
|
+
import { Remirror } from '@remirror/react';
|
|
4
|
+
export interface EditorProps {
|
|
5
|
+
value: string;
|
|
6
|
+
onChange: (value: string) => void;
|
|
7
|
+
onBlur: (e?: FocusEvent<HTMLElement>) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const Editor: import("react").ForwardRefExoticComponent<EditorProps & import("react").RefAttributes<typeof Remirror>>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import "./editor.scss";
|
|
3
|
+
import { forwardRef, useCallback } from 'react';
|
|
4
|
+
import { htmlToProsemirrorNode, prosemirrorNodeToHtml, } from 'remirror';
|
|
5
|
+
import { ThemeProvider, Remirror, useRemirror, EditorComponent, } from '@remirror/react';
|
|
6
|
+
import { makeStyles } from '@mui/styles';
|
|
7
|
+
import { Paper } from '@mui/material';
|
|
8
|
+
import { Toolbar, extensions } from "./Toolbar";
|
|
9
|
+
const useStyles = makeStyles((theme) => ({
|
|
10
|
+
root: {
|
|
11
|
+
fontWeight: 400,
|
|
12
|
+
paddingLeft: theme.spacing(2),
|
|
13
|
+
paddingRight: theme.spacing(2),
|
|
14
|
+
'&:focus': {
|
|
15
|
+
outline: 0,
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
}), {
|
|
19
|
+
name: 'Editor',
|
|
20
|
+
});
|
|
21
|
+
export const Editor = forwardRef(
|
|
22
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
23
|
+
({ value, onChange, onBlur }, ref) => {
|
|
24
|
+
const remirror = useRemirror({
|
|
25
|
+
extensions,
|
|
26
|
+
content: value,
|
|
27
|
+
stringHandler: htmlToProsemirrorNode,
|
|
28
|
+
});
|
|
29
|
+
const { manager, state, onChange: handleRemirrorChange } = remirror;
|
|
30
|
+
const classes = useStyles();
|
|
31
|
+
const handleChange = useCallback((params) => {
|
|
32
|
+
handleRemirrorChange(params);
|
|
33
|
+
onChange(prosemirrorNodeToHtml(params.state.doc));
|
|
34
|
+
}, [handleRemirrorChange, onChange]);
|
|
35
|
+
return (_jsx(Paper, { variant: "outlined", children: _jsx(ThemeProvider, { children: _jsxs(Remirror, { manager: manager, onChange: handleChange, onBlur: () => onBlur(), initialContent: state, autoRender: false, classNames: [classes.root], children: [_jsx(Toolbar, {}), _jsx(EditorComponent, {})] }) }) }));
|
|
36
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { BlockquoteExtension, BoldExtension, BulletListExtension, CodeBlockExtension, HeadingExtension, ImageExtension, ItalicExtension, LinkExtension, NodeFormattingExtension, OrderedListExtension, StrikeExtension, UnderlineExtension } from 'remirror/extensions';
|
|
3
|
+
export declare const extensions: () => (BlockquoteExtension | LinkExtension | BoldExtension | StrikeExtension | HeadingExtension | ImageExtension | ItalicExtension | UnderlineExtension | CodeBlockExtension | BulletListExtension | OrderedListExtension | NodeFormattingExtension)[];
|
|
4
|
+
interface ToolbarProps {
|
|
5
|
+
}
|
|
6
|
+
export declare const Toolbar: FC<ToolbarProps>;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { makeStyles } from '@mui/styles';
|
|
3
|
+
import { FormatAlignCenterButton, FormatAlignLeftButton, FormatAlignRightButton, FormatBoldButton, FormatCodeButton, FormatHeadingButtons, FormatItalicButton, FormatLinkButton, FormatListBulletedButton, FormatListNumberedButton, FormatQuoteButton, FormatStrikeButton, FormatUnderlinedButton, InsertImageButton, } from "./buttons";
|
|
4
|
+
import { Divider, Stack } from '@mui/material';
|
|
5
|
+
import { BlockquoteExtension, BoldExtension, BulletListExtension, CodeBlockExtension, HeadingExtension, ImageExtension, ItalicExtension, LinkExtension, NodeFormattingExtension, OrderedListExtension, StrikeExtension, UnderlineExtension, } from 'remirror/extensions';
|
|
6
|
+
// quote, link, image, heading, undo, redo
|
|
7
|
+
export const extensions = () => [
|
|
8
|
+
new BoldExtension({}),
|
|
9
|
+
new ItalicExtension(),
|
|
10
|
+
new StrikeExtension(),
|
|
11
|
+
new UnderlineExtension(),
|
|
12
|
+
new NodeFormattingExtension({}),
|
|
13
|
+
new BulletListExtension({}),
|
|
14
|
+
new OrderedListExtension(),
|
|
15
|
+
new BlockquoteExtension(),
|
|
16
|
+
new CodeBlockExtension({}),
|
|
17
|
+
new HeadingExtension({}),
|
|
18
|
+
new LinkExtension({}),
|
|
19
|
+
new ImageExtension({ enableResizing: true }),
|
|
20
|
+
];
|
|
21
|
+
const useStyles = makeStyles((theme) => ({
|
|
22
|
+
root: {
|
|
23
|
+
color: theme.palette.text.secondary,
|
|
24
|
+
},
|
|
25
|
+
}), {
|
|
26
|
+
name: 'Toolbar',
|
|
27
|
+
});
|
|
28
|
+
export const Toolbar = () => {
|
|
29
|
+
const classes = useStyles();
|
|
30
|
+
return (_jsxs(_Fragment, { children: [_jsxs(Stack, { direction: "row", className: classes.root, children: [_jsx(FormatBoldButton, {}), _jsx(FormatItalicButton, {}), _jsx(FormatStrikeButton, {}), _jsx(FormatUnderlinedButton, {}), _jsx(FormatHeadingButtons, {}), _jsx(FormatLinkButton, {}), _jsx(InsertImageButton, {})] }), _jsxs(Stack, { direction: "row", className: classes.root, children: [_jsx(FormatAlignLeftButton, {}), _jsx(FormatAlignCenterButton, {}), _jsx(FormatAlignRightButton, {}), _jsx(FormatListBulletedButton, {}), _jsx(FormatListNumberedButton, {}), _jsx(FormatQuoteButton, {}), _jsx(FormatCodeButton, {})] }), _jsx(Divider, {})] }));
|
|
31
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useEffect, useState, } from 'react';
|
|
3
|
+
import { makeStyles } from '@mui/styles';
|
|
4
|
+
import { useAttrs, useChainedCommands } from '@remirror/react';
|
|
5
|
+
import { ToolbarButton } from "../createButton";
|
|
6
|
+
import FormatLinkIcon from '@mui/icons-material/InsertLink';
|
|
7
|
+
import { Popper } from "../../../mui";
|
|
8
|
+
import { useTranslation } from "../../../hooks/useTranslation";
|
|
9
|
+
import { InputBase } from '@mui/material';
|
|
10
|
+
const useStyles = makeStyles((theme) => ({
|
|
11
|
+
root: {},
|
|
12
|
+
input: {
|
|
13
|
+
zIndex: 1,
|
|
14
|
+
padding: 8,
|
|
15
|
+
},
|
|
16
|
+
popper: {
|
|
17
|
+
zIndex: theme.zIndex.drawer + 1,
|
|
18
|
+
background: theme.palette.common.white,
|
|
19
|
+
'& .input': {
|
|
20
|
+
border: 0,
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
}), {
|
|
24
|
+
name: 'FormatLinkButton',
|
|
25
|
+
});
|
|
26
|
+
export const FormatLinkButton = () => {
|
|
27
|
+
const url = useAttrs().link()?.href ?? '';
|
|
28
|
+
const [href, setHref] = useState(url);
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
setHref(url);
|
|
31
|
+
}, [url]);
|
|
32
|
+
// @ts-ignore
|
|
33
|
+
const chain = useChainedCommands();
|
|
34
|
+
const [selection, setSelection] = useState({ to: 0 });
|
|
35
|
+
const [anchorEl, setAnchorEl] = useState(null);
|
|
36
|
+
const handleClick = useCallback((event, context) => {
|
|
37
|
+
const { currentTarget } = event;
|
|
38
|
+
const selection = context.getState().selection;
|
|
39
|
+
setSelection(selection);
|
|
40
|
+
setAnchorEl((prev) => (prev ? null : currentTarget));
|
|
41
|
+
}, []);
|
|
42
|
+
const handleClose = useCallback(() => setAnchorEl(null), []);
|
|
43
|
+
const handleChange = useCallback((event) => {
|
|
44
|
+
setHref(event.target.value);
|
|
45
|
+
}, []);
|
|
46
|
+
const handleSubmit = useCallback((event) => {
|
|
47
|
+
const { code } = event;
|
|
48
|
+
if (['Enter', 'Escape'].includes(code)) {
|
|
49
|
+
if (code === 'Enter') {
|
|
50
|
+
if (href === '') {
|
|
51
|
+
chain.removeLink();
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
chain.updateLink({ href, auto: false });
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
chain.focus(selection.to).run();
|
|
58
|
+
handleClose();
|
|
59
|
+
}
|
|
60
|
+
}, [chain, handleClose, href, selection.to]);
|
|
61
|
+
const classes = useStyles();
|
|
62
|
+
const { t } = useTranslation();
|
|
63
|
+
return (_jsxs(_Fragment, { children: [_jsx(ToolbarButton, { commandName: "updateLink", onClick: handleClick, className: classes.root, children: _jsx(FormatLinkIcon, {}) }), _jsx(Popper, { open: Boolean(anchorEl), reference: anchorEl, onClickOutside: handleClose, className: classes.popper, children: _jsx(InputBase, { className: classes.input, autoFocus: true, placeholder: t('label.link'), onChange: handleChange, value: href, onKeyPress: handleSubmit }) })] }));
|
|
64
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useState, } from 'react';
|
|
3
|
+
import { makeStyles } from '@mui/styles';
|
|
4
|
+
import { useAttrs, useChainedCommands, useCommands } from '@remirror/react';
|
|
5
|
+
import { ToolbarButton } from "../createButton";
|
|
6
|
+
import InsertImageIcon from '@mui/icons-material/InsertPhoto';
|
|
7
|
+
import { Popper } from "../../../mui";
|
|
8
|
+
import { useTranslation } from "../../../hooks/useTranslation";
|
|
9
|
+
import { InputBase } from '@mui/material';
|
|
10
|
+
const useStyles = makeStyles((theme) => ({
|
|
11
|
+
root: {},
|
|
12
|
+
input: {
|
|
13
|
+
zIndex: 1,
|
|
14
|
+
padding: 8,
|
|
15
|
+
},
|
|
16
|
+
popper: {
|
|
17
|
+
zIndex: theme.zIndex.drawer + 1,
|
|
18
|
+
background: theme.palette.common.white,
|
|
19
|
+
'& .input': {
|
|
20
|
+
border: 0,
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
}), {
|
|
24
|
+
name: 'InsertImageButton',
|
|
25
|
+
});
|
|
26
|
+
export const InsertImageButton = () => {
|
|
27
|
+
const url = useAttrs().link()?.href ?? '';
|
|
28
|
+
const [href, setHref] = useState(url);
|
|
29
|
+
//@ts-ignore
|
|
30
|
+
const chain = useChainedCommands();
|
|
31
|
+
const commands = useCommands();
|
|
32
|
+
const [selection, setSelection] = useState({ to: 0 });
|
|
33
|
+
const [anchorEl, setAnchorEl] = useState(null);
|
|
34
|
+
const handleClick = useCallback((event, context) => {
|
|
35
|
+
const { currentTarget } = event;
|
|
36
|
+
setSelection(context.getState().selection);
|
|
37
|
+
setAnchorEl((prev) => (prev ? null : currentTarget));
|
|
38
|
+
}, []);
|
|
39
|
+
const handleClose = useCallback(() => {
|
|
40
|
+
setAnchorEl(null);
|
|
41
|
+
setHref('');
|
|
42
|
+
}, []);
|
|
43
|
+
const handleChange = useCallback((event) => {
|
|
44
|
+
setHref(event.target.value);
|
|
45
|
+
}, []);
|
|
46
|
+
const handleSubmit = useCallback((event) => {
|
|
47
|
+
const { code } = event;
|
|
48
|
+
if (['Enter', 'Escape'].includes(code)) {
|
|
49
|
+
if (code === 'Enter') {
|
|
50
|
+
commands.insertImage({ src: href });
|
|
51
|
+
}
|
|
52
|
+
chain.focus(selection.to).run();
|
|
53
|
+
handleClose();
|
|
54
|
+
}
|
|
55
|
+
}, [commands, chain, handleClose, href, selection.to]);
|
|
56
|
+
const classes = useStyles();
|
|
57
|
+
const { t } = useTranslation();
|
|
58
|
+
return (_jsxs(_Fragment, { children: [_jsx(ToolbarButton, { commandName: "insertImage", onClick: handleClick, className: classes.root, children: _jsx(InsertImageIcon, {}) }), _jsx(Popper, { open: Boolean(anchorEl), reference: anchorEl, onClickOutside: handleClose, className: classes.popper, children: _jsx(InputBase, { className: classes.input, autoFocus: true, placeholder: t('label.link'), onChange: handleChange, value: href, onKeyPress: handleSubmit }) })] }));
|
|
59
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const FormatBoldButton: () => JSX.Element;
|
|
3
|
+
export declare const FormatItalicButton: () => JSX.Element;
|
|
4
|
+
export declare const FormatStrikeButton: () => JSX.Element;
|
|
5
|
+
export declare const FormatUnderlinedButton: () => JSX.Element;
|
|
6
|
+
export declare const FormatHeadingButtons: () => JSX.Element;
|
|
7
|
+
export { FormatLinkButton } from "./buttons/FormatLinkButton";
|
|
8
|
+
export { InsertImageButton } from "./buttons/InsertImageButton";
|
|
9
|
+
export declare const FormatAlignLeftButton: () => JSX.Element;
|
|
10
|
+
export declare const FormatAlignCenterButton: () => JSX.Element;
|
|
11
|
+
export declare const FormatAlignRightButton: () => JSX.Element;
|
|
12
|
+
export declare const FormatListBulletedButton: () => JSX.Element;
|
|
13
|
+
export declare const FormatListNumberedButton: () => JSX.Element;
|
|
14
|
+
export declare const FormatQuoteButton: () => JSX.Element;
|
|
15
|
+
export declare const FormatCodeButton: () => JSX.Element;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { createButton, ToolbarButton, ToolbarButtonLabel, } from "./createButton";
|
|
3
|
+
import FormatBoldIcon from '@mui/icons-material/FormatBold';
|
|
4
|
+
import FormatItalicIcon from '@mui/icons-material/FormatItalic';
|
|
5
|
+
import FormatStrikethroughIcon from '@mui/icons-material/FormatStrikethrough';
|
|
6
|
+
import FormatUnderlinedIcon from '@mui/icons-material/FormatUnderlined';
|
|
7
|
+
import FormatAlignLeftIcon from '@mui/icons-material/FormatAlignLeft';
|
|
8
|
+
import FormatAlignCenterIcon from '@mui/icons-material/FormatAlignCenter';
|
|
9
|
+
import FormatAlignRightIcon from '@mui/icons-material/FormatAlignRight';
|
|
10
|
+
import FormatListBulletedIcon from '@mui/icons-material/FormatListBulleted';
|
|
11
|
+
import FormatListNumberedIcon from '@mui/icons-material/FormatListNumbered';
|
|
12
|
+
import FormatQuoteIcon from '@mui/icons-material/FormatQuote';
|
|
13
|
+
import FormatCodeIcon from '@mui/icons-material/Code';
|
|
14
|
+
//
|
|
15
|
+
export const FormatBoldButton = createButton({
|
|
16
|
+
commandName: 'toggleBold',
|
|
17
|
+
children: _jsx(FormatBoldIcon, {}),
|
|
18
|
+
});
|
|
19
|
+
export const FormatItalicButton = createButton({
|
|
20
|
+
commandName: 'toggleItalic',
|
|
21
|
+
children: _jsx(FormatItalicIcon, {}),
|
|
22
|
+
});
|
|
23
|
+
export const FormatStrikeButton = createButton({
|
|
24
|
+
commandName: 'toggleStrike',
|
|
25
|
+
children: _jsx(FormatStrikethroughIcon, {}),
|
|
26
|
+
});
|
|
27
|
+
export const FormatUnderlinedButton = createButton({
|
|
28
|
+
commandName: 'toggleUnderline',
|
|
29
|
+
children: _jsx(FormatUnderlinedIcon, {}),
|
|
30
|
+
});
|
|
31
|
+
export const FormatHeadingButtons = () => (_jsx(_Fragment, { children: [1, 2, 3, 4, 5, 6].map((level) => (_jsx(ToolbarButton, { commandName: "toggleHeading", attrs: { level }, children: _jsxs(ToolbarButtonLabel, { children: ["H", level] }) }, level))) }));
|
|
32
|
+
export { FormatLinkButton } from "./buttons/FormatLinkButton";
|
|
33
|
+
export { InsertImageButton } from "./buttons/InsertImageButton";
|
|
34
|
+
export const FormatAlignLeftButton = createButton({
|
|
35
|
+
commandName: 'leftAlign',
|
|
36
|
+
children: _jsx(FormatAlignLeftIcon, {}),
|
|
37
|
+
attrs: {
|
|
38
|
+
nodeTextAlignment: 'left',
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
export const FormatAlignCenterButton = createButton({
|
|
42
|
+
commandName: 'centerAlign',
|
|
43
|
+
children: _jsx(FormatAlignCenterIcon, {}),
|
|
44
|
+
attrs: {
|
|
45
|
+
nodeTextAlignment: 'center',
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
export const FormatAlignRightButton = createButton({
|
|
49
|
+
commandName: 'rightAlign',
|
|
50
|
+
children: _jsx(FormatAlignRightIcon, {}),
|
|
51
|
+
attrs: {
|
|
52
|
+
nodeTextAlignment: 'right',
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
export const FormatListBulletedButton = createButton({
|
|
56
|
+
commandName: 'toggleBulletList',
|
|
57
|
+
children: _jsx(FormatListBulletedIcon, {}),
|
|
58
|
+
});
|
|
59
|
+
export const FormatListNumberedButton = createButton({
|
|
60
|
+
commandName: 'toggleOrderedList',
|
|
61
|
+
children: _jsx(FormatListNumberedIcon, {}),
|
|
62
|
+
});
|
|
63
|
+
export const FormatQuoteButton = createButton({
|
|
64
|
+
commandName: 'toggleBlockquote',
|
|
65
|
+
children: _jsx(FormatQuoteIcon, {}),
|
|
66
|
+
});
|
|
67
|
+
export const FormatCodeButton = createButton({
|
|
68
|
+
commandName: 'toggleCode',
|
|
69
|
+
children: _jsx(FormatCodeIcon, {}),
|
|
70
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { FC, MouseEvent, PropsWithChildren } from 'react';
|
|
2
|
+
import { ProsemirrorAttributes } from '@remirror/core';
|
|
3
|
+
import { ReactFrameworkOutput } from '@remirror/react-core/dist/declarations/src/react-types';
|
|
4
|
+
interface ToolbarButtonProps {
|
|
5
|
+
key?: string | number;
|
|
6
|
+
className?: string;
|
|
7
|
+
/**
|
|
8
|
+
* The name of the command to use.
|
|
9
|
+
*/
|
|
10
|
+
commandName: Remirror.AllUiCommandNames;
|
|
11
|
+
/**
|
|
12
|
+
* The attributes to pass through when the command is called.
|
|
13
|
+
*/
|
|
14
|
+
attrs?: ProsemirrorAttributes;
|
|
15
|
+
/**
|
|
16
|
+
* Whether to display the shortcut.
|
|
17
|
+
*
|
|
18
|
+
* @default true
|
|
19
|
+
*/
|
|
20
|
+
displayShortcut?: boolean;
|
|
21
|
+
onClick?: (event: MouseEvent<HTMLButtonElement>, context: ReactFrameworkOutput<Remirror.Extensions>) => void;
|
|
22
|
+
}
|
|
23
|
+
export declare const createButton: (props: PropsWithChildren<ToolbarButtonProps>) => () => JSX.Element;
|
|
24
|
+
interface ToolbarButtonLabelProps {
|
|
25
|
+
}
|
|
26
|
+
export declare const ToolbarButtonLabel: FC<ToolbarButtonLabelProps>;
|
|
27
|
+
export declare const ToolbarButton: FC<ToolbarButtonProps>;
|
|
28
|
+
export {};
|