@sqrzro/admin 1.0.0-beta.7 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc +5 -1
- package/.storybook/main.js +6 -34
- package/.storybook/preview-head.html +3 -0
- package/.storybook/preview.js +1 -11
- package/.turbo/turbo-docs.log +0 -0
- package/.turbo/turbo-lint.log +112 -0
- package/.turbo/turbo-prettier.log +215 -0
- package/.turbo/turbo-test.log +6 -0
- package/LICENSE +1 -1
- package/dist/{types/components → components}/Alert/index.d.ts +4 -4
- package/dist/components/Alert/index.js +15 -0
- package/dist/{types/components → components}/Allow/index.d.ts +20 -13
- package/dist/components/Allow/index.js +29 -0
- package/dist/components/AppLayout/AppLayout.stories.d.ts +5 -0
- package/dist/components/AppLayout/AppLayout.stories.js +11 -0
- package/dist/components/AppLayout/index.d.ts +6 -0
- package/dist/components/AppLayout/index.js +18 -0
- package/dist/{types/components → components}/AutoSuggest/index.d.ts +74 -60
- package/dist/components/AutoSuggest/index.js +143 -0
- package/dist/components/Button/Button.stories.d.ts +11 -0
- package/{src/components/Button/Button.story.tsx → dist/components/Button/Button.stories.js} +16 -14
- package/dist/{types/components → components}/Button/index.d.ts +49 -36
- package/dist/components/Button/index.js +50 -0
- package/dist/components/CalendarInput/index.d.ts +24 -0
- package/dist/components/CalendarInput/index.js +54 -0
- package/dist/{types/components → components}/CheckboxList/index.d.ts +17 -17
- package/dist/components/CheckboxList/index.js +25 -0
- package/dist/components/CodeInput/index.d.ts +9 -0
- package/dist/components/CodeInput/index.js +51 -0
- package/dist/{types/components → components}/ConnectedDropdown/index.d.ts +14 -14
- package/dist/components/ConnectedDropdown/index.js +36 -0
- package/dist/{types/components → components}/ConnectedList/index.d.ts +5 -5
- package/dist/components/ConnectedList/index.js +7 -0
- package/dist/{types/components → components}/ConnectedTable/index.d.ts +5 -5
- package/dist/components/ConnectedTable/index.js +7 -0
- package/dist/{types/components → components}/ContentBlock/index.d.ts +16 -16
- package/dist/components/ContentBlock/index.js +13 -0
- package/dist/components/DataPanel/index.d.ts +8 -0
- package/dist/components/DataPanel/index.js +8 -0
- package/dist/components/DateInput/index.d.ts +18 -0
- package/dist/components/DateInput/index.js +81 -0
- package/dist/{types/components → components}/Dropdown/index.d.ts +36 -36
- package/dist/components/Dropdown/index.js +122 -0
- package/dist/components/ErrorMessage/index.d.ts +16 -0
- package/dist/components/ErrorMessage/index.js +17 -0
- package/dist/components/Fieldset/index.d.ts +18 -0
- package/dist/components/Fieldset/index.js +19 -0
- package/dist/{types/components → components}/FileInput/index.d.ts +10 -10
- package/dist/components/FileInput/index.js +26 -0
- package/dist/components/FilterLink/index.d.ts +14 -0
- package/dist/components/FilterLink/index.js +15 -0
- package/dist/components/Form/index.d.ts +14 -0
- package/dist/components/Form/index.js +15 -0
- package/dist/components/FormActions/index.d.ts +18 -0
- package/dist/components/FormActions/index.js +14 -0
- package/dist/{types/components → components}/FormField/index.d.ts +14 -14
- package/dist/components/FormField/index.js +40 -0
- package/dist/components/FormRepeater/index.d.ts +18 -0
- package/dist/components/FormRepeater/index.js +65 -0
- package/dist/{types/components → components}/ImageInput/index.d.ts +13 -13
- package/dist/components/ImageInput/index.js +45 -0
- package/dist/components/InfoPanel/index.d.ts +14 -0
- package/dist/components/InfoPanel/index.js +11 -0
- package/dist/{types/components → components}/Link/__mocks__/index.d.ts +6 -6
- package/dist/components/Link/__mocks__/index.js +12 -0
- package/dist/components/Link/index.d.ts +23 -0
- package/dist/components/Link/index.js +21 -0
- package/dist/{types/components → components}/List/index.d.ts +36 -36
- package/dist/components/List/index.js +46 -0
- package/dist/components/ListActions/index.d.ts +18 -0
- package/dist/components/ListActions/index.js +14 -0
- package/dist/components/LoginForm/index.d.ts +3 -0
- package/dist/components/LoginForm/index.js +47 -0
- package/dist/components/Message/index.d.ts +14 -0
- package/dist/components/Message/index.js +14 -0
- package/dist/{types/components → components}/Modal/index.d.ts +4 -4
- package/dist/components/Modal/index.js +18 -0
- package/dist/components/ModalActions/index.d.ts +21 -0
- package/dist/components/ModalActions/index.js +18 -0
- package/dist/{types/components → components}/MoneyInput/index.d.ts +10 -10
- package/dist/components/MoneyInput/index.js +13 -0
- package/dist/components/PasswordForm/index.d.ts +35 -0
- package/dist/components/PasswordForm/index.js +21 -0
- package/dist/components/PasswordInput/index.d.ts +4 -0
- package/dist/components/PasswordInput/index.js +12 -0
- package/dist/{types/components → components}/RadioList/index.d.ts +9 -9
- package/dist/components/RadioList/index.js +7 -0
- package/dist/components/RootLayout/index.d.ts +6 -0
- package/dist/components/RootLayout/index.js +7 -0
- package/dist/components/SummaryList/index.d.ts +18 -0
- package/dist/components/SummaryList/index.js +15 -0
- package/dist/components/Switch/index.d.ts +21 -0
- package/dist/components/Switch/index.js +31 -0
- package/dist/{types/components → components}/Table/index.d.ts +28 -28
- package/dist/components/Table/index.js +55 -0
- package/dist/components/Tag/index.d.ts +15 -0
- package/dist/components/Tag/index.js +13 -0
- package/dist/components/TextArea/index.d.ts +18 -0
- package/dist/components/TextArea/index.js +26 -0
- package/dist/{types/components → components}/TextInput/index.d.ts +14 -14
- package/dist/components/TextInput/index.js +27 -0
- package/dist/{types/components → components}/WebsiteInput/index.d.ts +10 -10
- package/dist/components/WebsiteInput/index.js +13 -0
- package/dist/components/WeekCalendar/index.d.ts +24 -0
- package/dist/components/WeekCalendar/index.js +48 -0
- package/dist/{types/core → core}/AlertComponent/index.d.ts +26 -26
- package/dist/core/AlertComponent/index.js +35 -0
- package/dist/{types/core → core}/AppHeader/index.d.ts +3 -3
- package/dist/core/AppHeader/index.js +17 -0
- package/dist/core/AppLogo/index.d.ts +12 -0
- package/dist/core/AppLogo/index.js +16 -0
- package/dist/{types/core → core}/AppLogoImage/index.d.ts +3 -3
- package/dist/core/AppLogoImage/index.js +11 -0
- package/dist/{types/core → core}/AppLogoPlaceholder/index.d.ts +3 -3
- package/dist/core/AppLogoPlaceholder/index.js +10 -0
- package/dist/core/Assistive/index.d.ts +12 -0
- package/dist/core/Assistive/index.js +9 -0
- package/dist/core/AuthForm/index.d.ts +10 -0
- package/dist/core/AuthForm/index.js +13 -0
- package/dist/{types/core → core}/Banner/index.d.ts +3 -3
- package/dist/core/Banner/index.js +14 -0
- package/dist/core/Calendar/index.d.ts +21 -0
- package/dist/core/Calendar/index.js +69 -0
- package/dist/core/CalendarDay/index.d.ts +30 -0
- package/dist/core/CalendarDay/index.js +30 -0
- package/dist/core/CalendarMonth/index.d.ts +23 -0
- package/dist/core/CalendarMonth/index.js +45 -0
- package/dist/core/CalendarNavigation/index.d.ts +17 -0
- package/dist/core/CalendarNavigation/index.js +24 -0
- package/dist/core/CalendarWeek/index.d.ts +28 -0
- package/dist/core/CalendarWeek/index.js +46 -0
- package/dist/core/ChkRad/index.d.ts +26 -0
- package/dist/core/ChkRad/index.js +33 -0
- package/dist/core/ChkRadIcon/index.d.ts +14 -0
- package/dist/core/ChkRadIcon/index.js +12 -0
- package/dist/{types/core → core}/ChkRadList/index.d.ts +32 -32
- package/dist/core/ChkRadList/index.js +37 -0
- package/dist/core/CloseButton/index.d.ts +17 -0
- package/dist/core/CloseButton/index.js +12 -0
- package/dist/{types/core → core}/ConfirmModal/index.d.ts +3 -3
- package/dist/core/ConfirmModal/index.js +38 -0
- package/dist/{types/core → core}/ConnectedRepeater/index.d.ts +50 -50
- package/dist/core/ConnectedRepeater/index.js +154 -0
- package/dist/{types/core → core}/ConnectedRepeaterComponent/index.d.ts +24 -24
- package/dist/core/ConnectedRepeaterComponent/index.js +25 -0
- package/dist/core/Container/index.d.ts +14 -0
- package/dist/core/Container/index.js +12 -0
- package/dist/core/DataPanelItem/index.d.ts +8 -0
- package/dist/core/DataPanelItem/index.js +7 -0
- package/dist/core/DropdownPanel/index.d.ts +31 -0
- package/dist/core/DropdownPanel/index.js +32 -0
- package/dist/{types/core → core}/EmptyMessage/index.d.ts +21 -14
- package/dist/core/EmptyMessage/index.js +21 -0
- package/dist/core/FilterItem/index.d.ts +25 -0
- package/dist/core/FilterItem/index.js +82 -0
- package/dist/core/Filters/index.d.ts +31 -0
- package/dist/core/Filters/index.js +85 -0
- package/dist/{types/core → core}/FixedActions/index.d.ts +24 -24
- package/dist/core/FixedActions/index.js +22 -0
- package/dist/core/FormError/index.d.ts +12 -0
- package/dist/core/FormError/index.js +9 -0
- package/dist/core/FormLabel/index.d.ts +16 -0
- package/dist/core/FormLabel/index.js +13 -0
- package/dist/core/FormLegend/index.d.ts +12 -0
- package/dist/core/FormLegend/index.js +9 -0
- package/dist/core/Header/Header.stories.d.ts +5 -0
- package/dist/core/Header/Header.stories.js +11 -0
- package/dist/core/Header/index.d.ts +14 -0
- package/dist/core/Header/index.js +12 -0
- package/dist/core/Icon/index.d.ts +14 -0
- package/dist/core/Icon/index.js +32 -0
- package/dist/core/IconButton/index.d.ts +22 -0
- package/dist/core/IconButton/index.js +20 -0
- package/dist/core/InputPanel/index.d.ts +16 -0
- package/dist/core/InputPanel/index.js +11 -0
- package/dist/{types/core → core}/ListItem/index.d.ts +39 -38
- package/dist/core/ListItem/index.js +44 -0
- package/dist/core/ListItemAction/index.d.ts +11 -0
- package/dist/core/ListItemAction/index.js +13 -0
- package/dist/{types/core → core}/ListItemActions/index.d.ts +8 -8
- package/dist/core/ListItemActions/index.js +16 -0
- package/dist/core/ListItemMetaItem/index.d.ts +19 -0
- package/dist/core/ListItemMetaItem/index.js +29 -0
- package/dist/core/ListItemTitle/index.d.ts +19 -0
- package/dist/core/ListItemTitle/index.js +44 -0
- package/dist/core/Loader/index.d.ts +15 -0
- package/dist/core/Loader/index.js +16 -0
- package/dist/core/MeActions/index.d.ts +3 -0
- package/dist/core/MeActions/index.js +48 -0
- package/dist/{types/core → core}/MePanel/index.d.ts +19 -19
- package/dist/core/MePanel/index.js +29 -0
- package/dist/core/ModalComponent/index.d.ts +22 -0
- package/dist/core/ModalComponent/index.js +29 -0
- package/dist/{types/core → core}/Navigation/index.d.ts +3 -3
- package/dist/core/Navigation/index.js +33 -0
- package/dist/{types/core → core}/NavigationDivider/index.d.ts +3 -3
- package/dist/core/NavigationDivider/index.js +8 -0
- package/dist/core/NavigationItem/index.d.ts +16 -0
- package/dist/core/NavigationItem/index.js +21 -0
- package/dist/core/Pagination/index.d.ts +15 -0
- package/{src/core/Pagination/index.tsx → dist/core/Pagination/index.js} +10 -46
- package/dist/core/PaginationItem/index.d.ts +10 -0
- package/dist/core/PaginationItem/index.js +17 -0
- package/dist/core/Panel/index.d.ts +17 -0
- package/dist/core/Panel/index.js +13 -0
- package/dist/{types/core → core}/PasswordForgotForm/index.d.ts +7 -7
- package/dist/core/PasswordForgotForm/index.js +40 -0
- package/dist/{types/core → core}/PasswordResetForm/index.d.ts +7 -7
- package/dist/core/PasswordResetForm/index.js +34 -0
- package/dist/core/RadialProgress/index.d.ts +16 -0
- package/dist/core/RadialProgress/index.js +23 -0
- package/dist/core/SettingsForm/index.d.ts +3 -0
- package/dist/core/SettingsForm/index.js +14 -0
- package/dist/core/StaticTextInput/index.d.ts +29 -0
- package/dist/core/StaticTextInput/index.js +39 -0
- package/dist/{types/core → core}/Styled/index.d.ts +6 -6
- package/{src/core/Styled/index.tsx → dist/core/Styled/index.js} +7 -30
- package/dist/core/SummaryListItem/index.d.ts +23 -0
- package/dist/core/SummaryListItem/index.js +31 -0
- package/dist/core/TabItem/index.d.ts +4 -0
- package/dist/core/TabItem/index.js +13 -0
- package/dist/{types/core → core}/TableActionsCell/index.d.ts +8 -8
- package/dist/core/TableActionsCell/index.js +8 -0
- package/dist/core/TableCell/index.d.ts +15 -0
- package/dist/core/TableCell/index.js +20 -0
- package/dist/core/TableHead/index.d.ts +18 -0
- package/dist/core/TableHead/index.js +18 -0
- package/dist/{types/core → core}/TableRow/index.d.ts +13 -13
- package/dist/core/TableRow/index.js +18 -0
- package/dist/core/Tabs/index.d.ts +7 -0
- package/dist/core/Tabs/index.js +13 -0
- package/dist/core/TextInputAncillary/index.d.ts +29 -0
- package/dist/core/TextInputAncillary/index.js +31 -0
- package/dist/{types/core → core}/Toast/index.d.ts +3 -3
- package/dist/core/Toast/index.js +47 -0
- package/dist/core/TwoFactor/index.d.ts +13 -0
- package/dist/core/TwoFactor/index.js +49 -0
- package/dist/{types/core/LoginFormAuthenticator → core/TwoFactorAuthenticator}/index.d.ts +10 -10
- package/dist/core/TwoFactorAuthenticator/index.js +9 -0
- package/dist/core/TwoFactorMethodList/index.d.ts +10 -0
- package/dist/core/TwoFactorMethodList/index.js +22 -0
- package/dist/core/TwoFactorSetup/index.d.ts +12 -0
- package/dist/core/TwoFactorSetup/index.js +43 -0
- package/dist/core/TwoFactorSetupAuthenticator/index.d.ts +20 -0
- package/dist/core/TwoFactorSetupAuthenticator/index.js +42 -0
- package/dist/core/TwoFactorSetupYubikey/index.d.ts +16 -0
- package/dist/core/TwoFactorSetupYubikey/index.js +14 -0
- package/dist/{types/core/LoginFormYubikey → core/TwoFactorYubikey}/index.d.ts +9 -9
- package/dist/core/TwoFactorYubikey/index.js +14 -0
- package/dist/core/WeekCalendarDay/index.d.ts +27 -0
- package/dist/core/WeekCalendarDay/index.js +35 -0
- package/dist/core/YubikeyInput/index.d.ts +4 -0
- package/dist/core/YubikeyInput/index.js +14 -0
- package/dist/filters/BooleanFilter/index.d.ts +14 -0
- package/dist/filters/BooleanFilter/index.js +35 -0
- package/dist/filters/DateFilter/index.d.ts +5 -0
- package/dist/filters/DateFilter/index.js +24 -0
- package/dist/filters/DropdownFilter/index.d.ts +17 -0
- package/dist/filters/DropdownFilter/index.js +32 -0
- package/dist/filters/QuickDateFilter/index.d.ts +13 -0
- package/dist/filters/QuickDateFilter/index.js +40 -0
- package/dist/{types/filters → filters}/interfaces.d.ts +35 -35
- package/dist/filters/interfaces.js +1 -0
- package/dist/{types/hooks → hooks}/useAlert.d.ts +12 -12
- package/dist/hooks/useAlert.js +18 -0
- package/dist/hooks/useAppConfig.d.ts +3 -0
- package/dist/hooks/useAppConfig.js +5 -0
- package/dist/{types/hooks → hooks}/useConnectedList.d.ts +7 -7
- package/dist/hooks/useConnectedList.js +6 -0
- package/dist/{types/hooks → hooks}/useConnectedRepeater.d.ts +7 -7
- package/dist/hooks/useConnectedRepeater.js +14 -0
- package/dist/{types/hooks → hooks}/useConnectedTable.d.ts +7 -7
- package/dist/hooks/useConnectedTable.js +6 -0
- package/dist/hooks/useFilters.d.ts +9 -0
- package/dist/hooks/useFilters.js +24 -0
- package/dist/{types/hooks → hooks}/useLayout.d.ts +7 -7
- package/dist/hooks/useLayout.js +10 -0
- package/dist/hooks/useLayout.spec.d.ts +1 -0
- package/dist/hooks/useLayout.spec.js +24 -0
- package/dist/{types/hooks → hooks}/useModal.d.ts +12 -12
- package/dist/hooks/useModal.js +39 -0
- package/dist/hooks/useModalOffset.d.ts +2 -0
- package/dist/hooks/useModalOffset.js +16 -0
- package/dist/hooks/useModalOffset.spec.d.ts +1 -0
- package/dist/hooks/useModalOffset.spec.js +19 -0
- package/dist/hooks/useNavigation.d.ts +7 -0
- package/dist/hooks/useNavigation.js +113 -0
- package/dist/hooks/useRemote.d.ts +7 -0
- package/dist/hooks/useRemote.js +29 -0
- package/dist/hooks/useVariant.d.ts +9 -0
- package/dist/hooks/useVariant.js +14 -0
- package/dist/{types/index.d.ts → index.d.ts} +209 -203
- package/dist/index.js +213 -5459
- package/dist/{types/scenes → scenes}/Error404Scene.d.ts +3 -3
- package/dist/scenes/Error404Scene.js +5 -0
- package/dist/services/AppService.d.ts +5 -0
- package/dist/services/AppService.js +11 -0
- package/dist/services/ConfigService.d.ts +42 -0
- package/dist/services/ConfigService.js +52 -0
- package/dist/{types/services → services}/ConfirmService.d.ts +12 -12
- package/dist/services/ConfirmService.js +10 -0
- package/dist/services/DateService.d.ts +26 -0
- package/dist/services/DateService.js +132 -0
- package/dist/services/DateService.spec.d.ts +1 -0
- package/dist/services/DateService.spec.js +83 -0
- package/dist/services/DownloadService.d.ts +7 -0
- package/dist/services/DownloadService.js +16 -0
- package/dist/services/DownloadService.spec.d.ts +1 -0
- package/dist/services/DownloadService.spec.js +18 -0
- package/dist/{types/services → services}/FilterComponentService.d.ts +25 -25
- package/dist/services/FilterComponentService.js +54 -0
- package/dist/services/FilterService.d.ts +34 -0
- package/dist/services/FilterService.js +58 -0
- package/dist/services/FilterService.spec.d.ts +1 -0
- package/dist/services/FilterService.spec.js +67 -0
- package/dist/services/FormatService.d.ts +11 -0
- package/dist/services/FormatService.js +45 -0
- package/dist/services/FormatService.spec.d.ts +1 -0
- package/dist/services/FormatService.spec.js +66 -0
- package/dist/services/ToastService.d.ts +7 -0
- package/dist/services/ToastService.js +17 -0
- package/dist/services/ToastService.spec.d.ts +1 -0
- package/dist/services/ToastService.spec.js +34 -0
- package/dist/styles.css +984 -0
- package/dist/utility/MockRouter/index.d.ts +2 -0
- package/dist/utility/MockRouter/index.js +37 -0
- package/dist/utility/StorybookPanel/index.d.ts +14 -0
- package/dist/utility/StorybookPanel/index.js +12 -0
- package/dist/utility/TestChangeHandler/index.d.ts +15 -0
- package/dist/utility/TestChangeHandler/index.js +30 -0
- package/dist/utility/icons.d.ts +3 -0
- package/dist/utility/icons.js +12 -0
- package/dist/{types/utility → utility}/interfaces.d.ts +79 -69
- package/dist/utility/interfaces.js +18 -0
- package/dist/utility/middleware.d.ts +4 -0
- package/dist/utility/middleware.js +9 -0
- package/dist/{types/utility → utility}/prop-types.d.ts +57 -55
- package/dist/utility/prop-types.js +77 -0
- package/dist/utility/register.d.ts +3 -0
- package/dist/utility/register.js +9 -0
- package/package.json +53 -88
- package/postcss.config.js +1 -1
- package/prettier.config.js +1 -0
- package/src/components/Alert/index.tsx +103 -13
- package/src/components/Allow/Allow.spec.tsx +2 -2
- package/src/components/Allow/index.tsx +8 -8
- package/src/components/AppLayout/AppLayout.stories.tsx +20 -0
- package/src/components/AppLayout/index.tsx +22 -0
- package/src/components/AutoSuggest/AutoSuggest.spec.tsx +38 -18
- package/src/components/AutoSuggest/AutoSuggest.story.tsx +8 -6
- package/src/components/AutoSuggest/index.tsx +30 -30
- package/src/components/Button/Button.spec.tsx +8 -0
- package/src/components/Button/Button.stories.tsx +62 -0
- package/src/components/Button/index.tsx +9 -93
- package/src/components/CalendarInput/CalendarInput.spec.tsx +38 -22
- package/src/components/CalendarInput/CalendarInput.story.tsx +2 -2
- package/src/components/CalendarInput/index.tsx +23 -19
- package/src/components/CheckboxList/CheckboxList.spec.tsx +20 -10
- package/src/components/CheckboxList/index.tsx +9 -12
- package/src/components/ConnectedDropdown/index.tsx +7 -5
- package/src/components/ConnectedList/index.tsx +13 -11
- package/src/components/ConnectedTable/index.tsx +15 -13
- package/src/components/ContentBlock/index.tsx +10 -8
- package/src/components/DataPanel/index.tsx +25 -0
- package/src/components/DateInput/DateInput.spec.tsx +10 -6
- package/src/components/DateInput/index.tsx +11 -12
- package/src/components/ErrorMessage/index.tsx +18 -20
- package/src/components/Fieldset/Fieldset.story.tsx +17 -13
- package/src/components/Fieldset/index.tsx +12 -10
- package/src/components/FileInput/FileInput.spec.tsx +9 -5
- package/src/components/FileInput/FileInput.story.tsx +3 -1
- package/src/components/FileInput/index.tsx +12 -10
- package/src/components/FilterLink/FilterLink.spec.tsx +18 -4
- package/src/components/FilterLink/index.tsx +19 -14
- package/src/components/Form/Form.spec.tsx +7 -5
- package/src/components/Form/index.tsx +5 -3
- package/src/components/FormActions/FormActions.story.tsx +19 -15
- package/src/components/FormActions/index.tsx +11 -7
- package/src/components/FormField/FormField.spec.tsx +28 -39
- package/src/components/FormField/FormField.stories.tsx +44 -0
- package/src/components/FormField/index.tsx +8 -103
- package/src/components/FormRepeater/FormRepeater.spec.tsx +26 -14
- package/src/components/FormRepeater/index.tsx +9 -7
- package/src/components/ImageInput/ImageInput.spec.tsx +3 -1
- package/src/components/ImageInput/ImageInput.story.tsx +3 -1
- package/src/components/ImageInput/index.tsx +16 -14
- package/src/components/InfoPanel/index.tsx +7 -7
- package/src/components/Link/Link.spec.tsx +4 -2
- package/src/components/Link/__mocks__/index.tsx +3 -3
- package/src/components/Link/index.tsx +6 -6
- package/src/components/List/List.spec.tsx +57 -20
- package/src/components/List/List.story.tsx +21 -2
- package/src/components/List/index.tsx +13 -13
- package/src/components/ListActions/ListActions.story.tsx +3 -1
- package/src/components/ListActions/index.tsx +10 -11
- package/src/components/LoginForm/LoginForm.spec.tsx +19 -7
- package/src/components/LoginForm/LoginForm.story.tsx +25 -0
- package/src/components/LoginForm/index.tsx +72 -171
- package/src/components/Message/index.tsx +12 -10
- package/src/components/Modal/index.tsx +18 -12
- package/src/components/ModalActions/ModalActions.spec.tsx +4 -2
- package/src/components/ModalActions/ModalActions.story.tsx +3 -1
- package/src/components/ModalActions/index.tsx +22 -18
- package/src/components/MoneyInput/MoneyInput.story.tsx +3 -1
- package/src/components/MoneyInput/index.tsx +7 -5
- package/src/components/PasswordForm/index.tsx +12 -24
- package/src/components/RadioList/RadioList.spec.tsx +4 -2
- package/src/components/RadioList/index.tsx +8 -6
- package/src/components/RootLayout/index.tsx +45 -0
- package/src/components/SummaryList/SummaryList.module.css +19 -4
- package/src/components/SummaryList/SummaryList.spec.tsx +14 -2
- package/src/components/SummaryList/SummaryList.story.tsx +3 -1
- package/src/components/SummaryList/index.tsx +16 -14
- package/src/components/Switch/Switch.spec.tsx +8 -4
- package/src/components/Switch/index.tsx +16 -14
- package/src/components/Table/Table.spec.tsx +11 -7
- package/src/components/Table/Table.story.tsx +3 -3
- package/src/components/Table/index.tsx +20 -22
- package/src/components/TextArea/TextArea.spec.tsx +12 -6
- package/src/components/TextArea/index.tsx +10 -8
- package/src/components/TextInput/TextInput.module.css +1 -0
- package/src/components/TextInput/TextInput.spec.tsx +12 -6
- package/src/components/TextInput/TextInput.stories.tsx +46 -0
- package/src/components/TextInput/index.tsx +6 -99
- package/src/components/WebsiteInput/index.tsx +7 -5
- package/src/components/WeekCalendar/index.tsx +8 -8
- package/src/core/AlertComponent/AlertComponent.spec.tsx +17 -4
- package/src/core/AlertComponent/AlertComponent.story.tsx +19 -15
- package/src/core/AlertComponent/index.tsx +30 -25
- package/src/core/AppHeader/index.tsx +5 -3
- package/src/core/AppLogo/index.tsx +9 -7
- package/src/core/AppLogoImage/index.tsx +6 -6
- package/src/core/AppLogoPlaceholder/index.tsx +28 -22
- package/src/core/Assistive/index.tsx +1 -18
- package/src/{components/LoginForm/LoginForm.module.css → core/AuthForm/AuthForm.module.css} +4 -0
- package/src/core/AuthForm/AuthForm.spec.tsx +72 -0
- package/src/core/AuthForm/index.tsx +63 -0
- package/src/core/Banner/index.tsx +11 -11
- package/src/core/Calendar/index.tsx +9 -7
- package/src/core/CalendarDay/index.tsx +12 -12
- package/src/core/CalendarMonth/index.tsx +14 -12
- package/src/core/CalendarNavigation/index.tsx +14 -14
- package/src/core/CalendarWeek/index.tsx +21 -19
- package/src/core/ChkRadList/index.tsx +25 -23
- package/src/core/CloseButton/CloseButton.spec.tsx +4 -2
- package/src/core/CloseButton/index.tsx +10 -8
- package/src/core/ConfirmModal/ConfirmModal.spec.tsx +10 -4
- package/src/core/ConfirmModal/index.tsx +9 -7
- package/src/core/ConnectedRepeater/index.tsx +46 -19
- package/src/core/ConnectedRepeaterComponent/index.tsx +13 -9
- package/src/core/Container/index.tsx +6 -12
- package/src/core/DataPanelItem/index.tsx +19 -0
- package/src/core/EmptyMessage/EmptyMessage.stories.tsx +33 -0
- package/src/core/EmptyMessage/index.tsx +9 -42
- package/src/core/FilterItem/index.tsx +41 -33
- package/src/core/Filters/Filters.spec.tsx +103 -69
- package/src/core/Filters/index.tsx +39 -31
- package/src/core/FixedActions/FixedActions.module.css +6 -0
- package/src/core/FixedActions/FixedActions.spec.tsx +8 -3
- package/src/core/FixedActions/index.tsx +9 -9
- package/src/core/FormLegend/index.tsx +4 -4
- package/src/core/Header/Header.stories.tsx +20 -0
- package/src/core/Header/index.tsx +8 -13
- package/src/core/Icon/Icon.spec.tsx +1 -3
- package/src/core/Icon/index.tsx +14 -10
- package/src/core/IconButton/index.tsx +18 -20
- package/src/core/ListItem/ListItem.story.tsx +23 -19
- package/src/core/ListItem/index.tsx +46 -37
- package/src/core/ListItemAction/index.tsx +7 -14
- package/src/core/ListItemActions/index.tsx +13 -12
- package/src/core/ListItemMetaItem/index.tsx +8 -8
- package/src/core/ListItemTitle/ListItemTitle.module.css +9 -1
- package/src/core/ListItemTitle/ListItemTitle.spec.tsx +24 -2
- package/src/core/ListItemTitle/index.tsx +20 -10
- package/src/core/Loader/Loader.module.css +3 -3
- package/src/core/Loader/Loader.stories.tsx +22 -0
- package/src/core/Loader/index.tsx +2 -27
- package/src/core/MeActions/index.tsx +28 -18
- package/src/core/MePanel/index.tsx +10 -10
- package/src/core/ModalComponent/ModalComponent.spec.tsx +8 -4
- package/src/core/ModalComponent/index.tsx +13 -13
- package/src/core/Navigation/Navigation.spec.tsx +47 -36
- package/src/core/Navigation/index.tsx +18 -58
- package/src/core/NavigationDivider/index.tsx +6 -6
- package/src/core/NavigationItem/index.tsx +12 -21
- package/src/core/Panel/Panel.module.css +11 -0
- package/src/core/Panel/Panel.spec.tsx +16 -0
- package/src/core/Panel/index.tsx +17 -13
- package/src/core/PasswordForgotForm/index.tsx +15 -12
- package/src/core/PasswordResetForm/index.tsx +15 -12
- package/src/core/RadialProgress/index.tsx +11 -14
- package/src/core/SettingsForm/index.tsx +9 -8
- package/src/core/SummaryListItem/SummaryListItem.module.css +3 -11
- package/src/core/SummaryListItem/index.tsx +19 -14
- package/src/core/TabItem/TabItem.module.css +28 -0
- package/src/core/TabItem/index.tsx +42 -0
- package/src/core/Tabs/Tabs.module.css +0 -24
- package/src/core/Tabs/Tabs.spec.tsx +30 -0
- package/src/core/Tabs/index.tsx +18 -76
- package/src/core/Toast/Toast.spec.tsx +4 -2
- package/src/core/Toast/index.tsx +16 -18
- package/src/core/TwoFactor/TwoFactor.spec.tsx +183 -0
- package/src/core/TwoFactor/index.tsx +102 -0
- package/src/core/TwoFactorAuthenticator/index.tsx +39 -0
- package/src/core/{LoginFormTwoFactor/LoginFormTwoFactor.module.css → TwoFactorMethodList/TwoFactorMethodList.module.css} +1 -1
- package/src/core/TwoFactorMethodList/index.tsx +49 -0
- package/src/core/TwoFactorSetup/index.tsx +91 -0
- package/src/core/TwoFactorSetupAuthenticator/TwoFactorSetupAuthenticator.module.css +6 -0
- package/src/core/TwoFactorSetupAuthenticator/index.tsx +100 -0
- package/src/core/TwoFactorSetupYubikey/index.tsx +49 -0
- package/src/core/TwoFactorYubikey/index.tsx +41 -0
- package/src/core/WeekCalendarDay/index.tsx +7 -7
- package/src/core/{LoginFormYubikey/LoginFormYubikey.module.css → YubikeyInput/YubikeyInput.module.css} +5 -0
- package/src/core/YubikeyInput/YubikeyInput.spec.tsx +77 -0
- package/src/core/YubikeyInput/index.tsx +76 -0
- package/src/filters/BooleanFilter/index.tsx +13 -12
- package/src/filters/DateFilter/index.tsx +8 -8
- package/src/filters/DropdownFilter/index.tsx +19 -17
- package/src/filters/QuickDateFilter/index.tsx +12 -12
- package/src/filters/interfaces.ts +2 -2
- package/src/hooks/useAlert.spec.tsx +72 -0
- package/src/hooks/useAlert.ts +7 -5
- package/src/hooks/useConfig.ts +31 -0
- package/src/hooks/useConnectedList.ts +4 -4
- package/src/hooks/useConnectedRepeater.ts +8 -6
- package/src/hooks/useConnectedTable.ts +4 -4
- package/src/hooks/useFilters.ts +21 -13
- package/src/hooks/useLayout.spec.ts +3 -11
- package/src/hooks/useLayout.ts +8 -7
- package/src/hooks/useModal.spec.tsx +23 -15
- package/src/hooks/useModal.ts +17 -17
- package/src/hooks/useModalOffset.ts +4 -2
- package/src/hooks/useNavigation.ts +160 -0
- package/src/hooks/useRemote.ts +43 -0
- package/src/index.ts +31 -26
- package/src/scenes/Error404Scene.tsx +3 -1
- package/src/services/AppService.ts +16 -0
- package/src/services/ConfigService.ts +93 -0
- package/src/services/ConfirmService.ts +7 -2
- package/src/services/DateService.ts +48 -32
- package/src/services/DownloadService.spec.ts +4 -10
- package/src/services/DownloadService.ts +16 -9
- package/src/services/FilterComponentService.tsx +9 -5
- package/src/services/FilterService.spec.ts +57 -39
- package/src/services/FilterService.ts +62 -40
- package/src/services/FormatService.spec.ts +2 -0
- package/src/services/FormatService.ts +13 -8
- package/src/services/ToastService.ts +9 -4
- package/src/styles/tailwind.css +57 -0
- package/src/typings.d.ts +2 -2
- package/src/utility/MockRouter/index.ts +1 -0
- package/src/utility/icons.tsx +46 -30
- package/src/utility/interfaces.ts +39 -21
- package/src/utility/middleware.ts +10 -0
- package/src/utility/prop-types.ts +6 -2
- package/src/utility/register.tsx +11 -0
- package/tailwind.config.js +11 -0
- package/tsconfig.eslint.json +4 -0
- package/tsconfig.json +7 -15
- package/.gitattributes +0 -1
- package/.github/workflows/development.yml +0 -47
- package/.prettierrc +0 -9
- package/.storybook/manager.js +0 -4
- package/.storybook/postcss.config.js +0 -3
- package/.storybook/theme.js +0 -7
- package/.stylelintrc +0 -9
- package/__mocks__/@sqrzro/utility.ts +0 -43
- package/assets/logo-horizontal-dark.svg +0 -21
- package/assets/logo-horizontal-white.svg +0 -21
- package/assets/logo-vertical-dark.svg +0 -21
- package/assets/logo-vertical-white.svg +0 -21
- package/dist/index.css +0 -3812
- package/dist/index.js.map +0 -1
- package/dist/types/components/App/index.d.ts +0 -18
- package/dist/types/components/CalendarInput/index.d.ts +0 -10
- package/dist/types/components/CodeInput/index.d.ts +0 -9
- package/dist/types/components/ConnectedListScene/index.d.ts +0 -7
- package/dist/types/components/ConnectedScene/index.d.ts +0 -11
- package/dist/types/components/DateInput/index.d.ts +0 -7
- package/dist/types/components/Document/index.d.ts +0 -3
- package/dist/types/components/ErrorMessage/index.d.ts +0 -8
- package/dist/types/components/Fieldset/index.d.ts +0 -11
- package/dist/types/components/FilterLink/index.d.ts +0 -7
- package/dist/types/components/Form/index.d.ts +0 -14
- package/dist/types/components/FormActions/index.d.ts +0 -9
- package/dist/types/components/FormRepeater/index.d.ts +0 -9
- package/dist/types/components/InfoPanel/index.d.ts +0 -8
- package/dist/types/components/Link/index.d.ts +0 -13
- package/dist/types/components/ListActions/index.d.ts +0 -9
- package/dist/types/components/LoginForm/index.d.ts +0 -3
- package/dist/types/components/Message/index.d.ts +0 -7
- package/dist/types/components/ModalActions/index.d.ts +0 -11
- package/dist/types/components/PasswordForm/index.d.ts +0 -3
- package/dist/types/components/PasswordInput/index.d.ts +0 -4
- package/dist/types/components/Scene/index.d.ts +0 -10
- package/dist/types/components/SummaryList/index.d.ts +0 -8
- package/dist/types/components/Switch/index.d.ts +0 -9
- package/dist/types/components/Tag/index.d.ts +0 -8
- package/dist/types/components/TextArea/index.d.ts +0 -4
- package/dist/types/components/WeekCalendar/index.d.ts +0 -12
- package/dist/types/core/App/index.d.ts +0 -19
- package/dist/types/core/AppLogo/index.d.ts +0 -6
- package/dist/types/core/Assistive/index.d.ts +0 -6
- package/dist/types/core/BuildModal/index.d.ts +0 -3
- package/dist/types/core/Calendar/index.d.ts +0 -11
- package/dist/types/core/CalendarDay/index.d.ts +0 -16
- package/dist/types/core/CalendarMonth/index.d.ts +0 -12
- package/dist/types/core/CalendarNavigation/index.d.ts +0 -9
- package/dist/types/core/CalendarWeek/index.d.ts +0 -14
- package/dist/types/core/ChkRad/index.d.ts +0 -13
- package/dist/types/core/ChkRadIcon/index.d.ts +0 -7
- package/dist/types/core/CloseButton/index.d.ts +0 -9
- package/dist/types/core/ConnectedList/index.d.ts +0 -4
- package/dist/types/core/ConnectedTable/index.d.ts +0 -4
- package/dist/types/core/Container/index.d.ts +0 -7
- package/dist/types/core/DropdownPanel/index.d.ts +0 -18
- package/dist/types/core/ErrorBoundary/index.d.ts +0 -15
- package/dist/types/core/ErrorMessage/index.d.ts +0 -8
- package/dist/types/core/FilterItem/index.d.ts +0 -10
- package/dist/types/core/Filters/index.d.ts +0 -15
- package/dist/types/core/Form/index.d.ts +0 -12
- package/dist/types/core/FormError/index.d.ts +0 -6
- package/dist/types/core/FormLabel/index.d.ts +0 -8
- package/dist/types/core/FormLegend/index.d.ts +0 -6
- package/dist/types/core/Header/index.d.ts +0 -8
- package/dist/types/core/Icon/index.d.ts +0 -7
- package/dist/types/core/IconButton/Icon/index.d.ts +0 -7
- package/dist/types/core/IconButton/index.d.ts +0 -11
- package/dist/types/core/InputPanel/index.d.ts +0 -8
- package/dist/types/core/ListItemAction/index.d.ts +0 -4
- package/dist/types/core/ListItemMetaItem/index.d.ts +0 -10
- package/dist/types/core/ListItemTitle/index.d.ts +0 -9
- package/dist/types/core/Loader/index.d.ts +0 -6
- package/dist/types/core/LoginFormTwoFactor/index.d.ts +0 -13
- package/dist/types/core/MeActions/index.d.ts +0 -3
- package/dist/types/core/Modal/index.d.ts +0 -12
- package/dist/types/core/ModalComponent/index.d.ts +0 -12
- package/dist/types/core/NavigationItem/index.d.ts +0 -7
- package/dist/types/core/Pagination/index.d.ts +0 -7
- package/dist/types/core/PaginationItem/index.d.ts +0 -7
- package/dist/types/core/Panel/index.d.ts +0 -8
- package/dist/types/core/RadialProgress/index.d.ts +0 -8
- package/dist/types/core/SettingsForm/index.d.ts +0 -3
- package/dist/types/core/StaticTextInput/index.d.ts +0 -13
- package/dist/types/core/SummaryListItem/index.d.ts +0 -15
- package/dist/types/core/TableCell/index.d.ts +0 -8
- package/dist/types/core/TableHead/index.d.ts +0 -8
- package/dist/types/core/Tabs/index.d.ts +0 -11
- package/dist/types/core/TextInputAncillary/index.d.ts +0 -12
- package/dist/types/core/WeekCalendarDay/index.d.ts +0 -14
- package/dist/types/filters/BooleanFilter/index.d.ts +0 -5
- package/dist/types/filters/DateFilter/index.d.ts +0 -5
- package/dist/types/filters/DropdownFilter/index.d.ts +0 -17
- package/dist/types/filters/QuickDateFilter/index.d.ts +0 -5
- package/dist/types/hooks/useAccessiblePanel.d.ts +0 -13
- package/dist/types/hooks/useAppContext.d.ts +0 -55
- package/dist/types/hooks/useClickOutside.d.ts +0 -3
- package/dist/types/hooks/useComponentId.d.ts +0 -2
- package/dist/types/hooks/useFilters.d.ts +0 -3
- package/dist/types/hooks/useForm.d.ts +0 -41
- package/dist/types/hooks/useFormData.d.ts +0 -12
- package/dist/types/hooks/useModalOffset.d.ts +0 -2
- package/dist/types/hooks/useVariant.d.ts +0 -6
- package/dist/types/services/BuildService.d.ts +0 -5
- package/dist/types/services/DateService.d.ts +0 -17
- package/dist/types/services/DownloadService.d.ts +0 -5
- package/dist/types/services/FilterService.d.ts +0 -13
- package/dist/types/services/FormatService.d.ts +0 -7
- package/dist/types/services/OLD_ApiService.d.ts +0 -19
- package/dist/types/services/ToastService.d.ts +0 -5
- package/dist/types/utility/MockRouter/index.d.ts +0 -2
- package/dist/types/utility/StorybookPanel/index.d.ts +0 -7
- package/dist/types/utility/TestChangeHandler/index.d.ts +0 -15
- package/dist/types/utility/create-app.d.ts +0 -4
- package/dist/types/utility/icons.d.ts +0 -3
- package/docs/guides/01-installation.story.mdx +0 -33
- package/docs/guides/02-configuration.story.mdx +0 -80
- package/docs/guides/03-pages.story.mdx +0 -18
- package/docs/guides/04-integration.story.mdx +0 -33
- package/docs/guides/a11y.story.mdx +0 -7
- package/docs/guides/theming.story.mdx +0 -7
- package/docs/introduction.story.mdx +0 -17
- package/jest.config.js +0 -19
- package/rollup.config.js +0 -36
- package/scripts/create-exports.js +0 -74
- package/scripts/update-license.js +0 -8
- package/squarezero.config.js +0 -5
- package/src/components/Button/Button.module.css +0 -100
- package/src/components/CodeInput/CodeInput.module.css +0 -33
- package/src/components/CodeInput/CodeInput.spec.tsx +0 -180
- package/src/components/CodeInput/index.tsx +0 -138
- package/src/components/ConnectedScene/index.tsx +0 -96
- package/src/components/Document/index.tsx +0 -14
- package/src/components/Dropdown/Dropdown.module.css +0 -8
- package/src/components/Dropdown/Dropdown.spec.tsx +0 -304
- package/src/components/Dropdown/Dropdown.story.tsx +0 -53
- package/src/components/Dropdown/index.tsx +0 -228
- package/src/components/FormField/FormField.story.tsx +0 -29
- package/src/components/PasswordForm/PasswordForm.module.css +0 -21
- package/src/components/PasswordInput/PasswordInput.module.css +0 -23
- package/src/components/PasswordInput/PasswordInput.spec.tsx +0 -28
- package/src/components/PasswordInput/PasswordInput.story.tsx +0 -16
- package/src/components/PasswordInput/index.tsx +0 -23
- package/src/components/Scene/Scene.spec.tsx +0 -123
- package/src/components/Scene/Scene.story.tsx +0 -6
- package/src/components/Scene/index.tsx +0 -58
- package/src/components/Tag/Tag.module.css +0 -37
- package/src/components/Tag/Tag.spec.tsx +0 -10
- package/src/components/Tag/Tag.story.tsx +0 -55
- package/src/components/Tag/index.tsx +0 -27
- package/src/components/TextInput/TextInput.story.tsx +0 -24
- package/src/core/App/App.module.css +0 -24
- package/src/core/App/App.spec.tsx +0 -265
- package/src/core/App/index.tsx +0 -115
- package/src/core/Assistive/Assistive.module.css +0 -10
- package/src/core/ChkRad/ChkRad.module.css +0 -31
- package/src/core/ChkRad/ChkRad.spec.tsx +0 -79
- package/src/core/ChkRad/index.tsx +0 -75
- package/src/core/ChkRadIcon/ChkRadIcon.module.css +0 -29
- package/src/core/ChkRadIcon/index.tsx +0 -33
- package/src/core/DropdownPanel/DropdownPanel.module.css +0 -68
- package/src/core/DropdownPanel/index.tsx +0 -93
- package/src/core/ErrorBoundary/ErrorBoundary.spec.tsx +0 -33
- package/src/core/ErrorBoundary/index.tsx +0 -42
- package/src/core/FormError/FormError.module.css +0 -7
- package/src/core/FormError/index.tsx +0 -18
- package/src/core/FormLabel/FormLabel.module.css +0 -15
- package/src/core/FormLabel/index.tsx +0 -25
- package/src/core/Header/Header.module.css +0 -28
- package/src/core/InputPanel/InputPanel.module.css +0 -70
- package/src/core/InputPanel/index.tsx +0 -28
- package/src/core/Loader/Loader.story.tsx +0 -8
- package/src/core/LoginFormAuthenticator/index.tsx +0 -36
- package/src/core/LoginFormTwoFactor/index.tsx +0 -133
- package/src/core/LoginFormYubikey/index.tsx +0 -59
- package/src/core/Pagination/Pagination.module.css +0 -15
- package/src/core/PaginationItem/PaginationItem.module.css +0 -33
- package/src/core/PaginationItem/index.tsx +0 -46
- package/src/core/StaticTextInput/StaticTextInput.module.css +0 -79
- package/src/core/StaticTextInput/StaticTextInput.spec.tsx +0 -126
- package/src/core/StaticTextInput/index.tsx +0 -112
- package/src/core/Styled/Styled.spec.tsx +0 -32
- package/src/core/Styled/Styled.story.tsx +0 -10
- package/src/core/TableActionsCell/TableActionsCell.module.css +0 -3
- package/src/core/TableActionsCell/index.tsx +0 -26
- package/src/core/TableCell/TableCell.module.css +0 -16
- package/src/core/TableCell/index.tsx +0 -39
- package/src/core/TableHead/TableHead.module.css +0 -12
- package/src/core/TableHead/index.tsx +0 -48
- package/src/core/TableRow/index.tsx +0 -49
- package/src/core/TextInputAncillary/TextInputAncillary.module.css +0 -69
- package/src/core/TextInputAncillary/index.tsx +0 -84
- package/src/hooks/useAccessiblePanel.spec.tsx +0 -88
- package/src/hooks/useAccessiblePanel.ts +0 -74
- package/src/hooks/useAppContext.spec.ts +0 -38
- package/src/hooks/useAppContext.ts +0 -110
- package/src/hooks/useClickOutside.ts +0 -49
- package/src/hooks/useComponentId.spec.ts +0 -19
- package/src/hooks/useComponentId.ts +0 -16
- package/src/hooks/useForm.spec.ts +0 -251
- package/src/hooks/useForm.ts +0 -179
- package/src/hooks/useVariant.spec.ts +0 -14
- package/src/hooks/useVariant.ts +0 -34
- package/src/styles/layout.css +0 -64
- package/src/styles/variables.css +0 -85
- package/src/utility/StorybookPanel/StorybookPanel.module.css +0 -9
- package/src/utility/StorybookPanel/index.tsx +0 -25
- package/src/utility/TestChangeHandler/TestChangeHandler.module.css +0 -7
- package/src/utility/TestChangeHandler/TestChangeHandler.spec.tsx +0 -24
- package/src/utility/TestChangeHandler/index.tsx +0 -51
- package/src/utility/create-app.tsx +0 -28
- package/tests/setupFilesAfterEnv.js +0 -16
- package/tsconfig.types.json +0 -9
|
@@ -1,87 +1,105 @@
|
|
|
1
|
+
import type { FilterMap } from '../utility/interfaces';
|
|
2
|
+
|
|
1
3
|
import FilterService from './FilterService';
|
|
2
4
|
|
|
3
5
|
describe('FilterService', () => {
|
|
4
|
-
describe('
|
|
6
|
+
describe('getFiltersFromContext', () => {
|
|
5
7
|
it('should handle no arguments', () => {
|
|
6
|
-
expect(FilterService.
|
|
8
|
+
expect(FilterService.getFiltersFromContext(null)).toEqual(new Map());
|
|
7
9
|
});
|
|
8
10
|
|
|
9
|
-
it('should parse a value', () => {
|
|
10
|
-
const
|
|
11
|
+
it('should parse a value (location)', () => {
|
|
12
|
+
const location = { pathname: '', search: 'filter[lorem]=ipsum' };
|
|
11
13
|
|
|
12
14
|
const result = new Map();
|
|
13
15
|
result.set('lorem', 'ipsum');
|
|
14
16
|
|
|
15
|
-
expect(FilterService.
|
|
17
|
+
expect(FilterService.getFiltersFromContext({ location })).toEqual(result);
|
|
16
18
|
});
|
|
17
19
|
|
|
18
|
-
it('should parse an array', () => {
|
|
19
|
-
const
|
|
20
|
+
it('should parse an array (location)', () => {
|
|
21
|
+
const location = { pathname: '', search: 'filter[lorem][0]=1&filter[lorem][1]=2' };
|
|
20
22
|
|
|
21
23
|
const result = new Map();
|
|
22
24
|
result.set('lorem', ['1', '2']);
|
|
23
25
|
|
|
24
|
-
expect(FilterService.
|
|
26
|
+
expect(FilterService.getFiltersFromContext({ location })).toEqual(result);
|
|
25
27
|
});
|
|
26
28
|
|
|
27
|
-
it('should filter
|
|
28
|
-
const
|
|
29
|
+
it('should filter no value (location)', () => {
|
|
30
|
+
const location = { pathname: '', search: 'filter[lorem]=' };
|
|
29
31
|
const result = new Map();
|
|
30
32
|
|
|
31
|
-
expect(FilterService.
|
|
33
|
+
expect(FilterService.getFiltersFromContext({ location })).toEqual(result);
|
|
32
34
|
});
|
|
33
35
|
|
|
34
|
-
it('should
|
|
35
|
-
const
|
|
36
|
+
it('should parse a value (query)', () => {
|
|
37
|
+
const query = { filter: { lorem: 'ipsum' } };
|
|
38
|
+
|
|
36
39
|
const result = new Map();
|
|
40
|
+
result.set('lorem', 'ipsum');
|
|
37
41
|
|
|
38
|
-
expect(FilterService.
|
|
42
|
+
expect(FilterService.getFiltersFromContext({ query })).toEqual(result);
|
|
39
43
|
});
|
|
40
44
|
|
|
41
|
-
it('should
|
|
42
|
-
const
|
|
45
|
+
it('should parse an array (query)', () => {
|
|
46
|
+
const query = { filter: { lorem: ['1', '2'] } };
|
|
43
47
|
|
|
44
48
|
const result = new Map();
|
|
45
|
-
result.set('
|
|
49
|
+
result.set('lorem', ['1', '2']);
|
|
46
50
|
|
|
47
|
-
expect(FilterService.
|
|
51
|
+
expect(FilterService.getFiltersFromContext({ query })).toEqual(result);
|
|
48
52
|
});
|
|
49
53
|
|
|
50
|
-
it('should filter
|
|
51
|
-
const
|
|
54
|
+
it('should filter no value (query)', () => {
|
|
55
|
+
const query = { filter: { lorem: '' } };
|
|
52
56
|
const result = new Map();
|
|
53
57
|
|
|
54
|
-
expect(FilterService.
|
|
58
|
+
expect(FilterService.getFiltersFromContext({ query })).toEqual(result);
|
|
55
59
|
});
|
|
56
60
|
});
|
|
57
61
|
|
|
58
|
-
describe('
|
|
59
|
-
it('should make url', () => {
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
+
describe('setFiltersUrlFromContext', () => {
|
|
63
|
+
it('should make basic url (location)', () => {
|
|
64
|
+
const location = { pathname: 'lorem', search: '' };
|
|
65
|
+
|
|
66
|
+
const filters: FilterMap = new Map();
|
|
67
|
+
filters.set('lorem', 'ipsum');
|
|
62
68
|
|
|
63
|
-
expect(FilterService.
|
|
69
|
+
expect(FilterService.setFiltersUrlFromContext({ location }, filters)).toBe(
|
|
70
|
+
encodeURI('/lorem?filter[lorem]=ipsum')
|
|
71
|
+
);
|
|
64
72
|
});
|
|
65
73
|
|
|
66
|
-
it('should make url
|
|
67
|
-
const
|
|
68
|
-
data.set('lorem', 'ipsum');
|
|
74
|
+
it('should make url with an array (location)', () => {
|
|
75
|
+
const location = { pathname: 'lorem', search: '' };
|
|
69
76
|
|
|
70
|
-
|
|
77
|
+
const filters: FilterMap = new Map();
|
|
78
|
+
filters.set('lorem', ['1', '2']);
|
|
79
|
+
|
|
80
|
+
expect(FilterService.setFiltersUrlFromContext({ location }, filters)).toBe(
|
|
81
|
+
encodeURI('/lorem?filter[lorem][0]=1&filter[lorem][1]=2')
|
|
82
|
+
);
|
|
71
83
|
});
|
|
72
84
|
|
|
73
|
-
it('should make url with
|
|
74
|
-
const
|
|
75
|
-
|
|
85
|
+
it('should make url with no value (location)', () => {
|
|
86
|
+
const location = { pathname: 'lorem', search: '' };
|
|
87
|
+
const filters: FilterMap = new Map();
|
|
76
88
|
|
|
77
|
-
expect(FilterService.
|
|
89
|
+
expect(FilterService.setFiltersUrlFromContext({ location }, filters)).toBe(
|
|
90
|
+
encodeURI('/lorem')
|
|
91
|
+
);
|
|
78
92
|
});
|
|
79
|
-
});
|
|
80
93
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
94
|
+
it('should make basic url with existing query (location)', () => {
|
|
95
|
+
const location = { pathname: 'lorem', search: '?ipsum=dolor' };
|
|
96
|
+
|
|
97
|
+
const filters: FilterMap = new Map();
|
|
98
|
+
filters.set('lorem', 'ipsum');
|
|
99
|
+
|
|
100
|
+
expect(FilterService.setFiltersUrlFromContext({ location }, filters)).toBe(
|
|
101
|
+
encodeURI('/lorem?ipsum=dolor&filter[lorem]=ipsum')
|
|
102
|
+
);
|
|
85
103
|
});
|
|
86
104
|
});
|
|
87
105
|
});
|
|
@@ -1,58 +1,80 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UrlService, ifWindow, parseSearch } from '@sqrzro/utility';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
interface Query {
|
|
5
|
-
[key: string]: Query | Query[] | string[] | string;
|
|
6
|
-
}
|
|
7
|
-
/* eslint-enable */
|
|
3
|
+
import type { FilterMap } from '../utility/interfaces';
|
|
8
4
|
|
|
9
|
-
|
|
5
|
+
interface FilterContext {
|
|
6
|
+
location?: { pathname: string; search: string };
|
|
7
|
+
path?: string;
|
|
8
|
+
query?: { filter?: Record<string, string[] | string> };
|
|
9
|
+
}
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
function getDefaultContext(context: FilterContext | null): FilterContext | null {
|
|
12
|
+
if (context) {
|
|
13
|
+
return context;
|
|
14
|
+
}
|
|
15
|
+
return ifWindow((win) => win, null);
|
|
13
16
|
}
|
|
14
17
|
|
|
15
|
-
|
|
18
|
+
/**
|
|
19
|
+
* Take either a query string (from a window.location.search, for example) or a query object (e.g.
|
|
20
|
+
* from an Express-style Request object), and return a filter map.
|
|
21
|
+
*
|
|
22
|
+
* @param ctx Either a window element or an Express-style Request object
|
|
23
|
+
* @returns A filter map for the specified filters
|
|
24
|
+
*/
|
|
25
|
+
function getFiltersFromContext(ctx: FilterContext | null): FilterMap {
|
|
26
|
+
const map: FilterMap = new Map();
|
|
27
|
+
const context = getDefaultContext(ctx);
|
|
16
28
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
return entry.map((item) => item.toString());
|
|
29
|
+
if (!context) {
|
|
30
|
+
return map;
|
|
20
31
|
}
|
|
21
32
|
|
|
22
|
-
|
|
23
|
-
};
|
|
33
|
+
const search = context.location ? parseSearch(context.location.search) : context.query;
|
|
24
34
|
|
|
25
|
-
|
|
26
|
-
|
|
35
|
+
if (!search?.filter || typeof search.filter !== 'object') {
|
|
36
|
+
return map;
|
|
37
|
+
}
|
|
27
38
|
|
|
28
|
-
const
|
|
29
|
-
if (value
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
return false;
|
|
34
|
-
}
|
|
35
|
-
if (options?.shouldFilterPage && key === 'page') {
|
|
36
|
-
return false;
|
|
37
|
-
}
|
|
38
|
-
return true;
|
|
39
|
-
});
|
|
39
|
+
for (const [key, value] of Object.entries(search.filter)) {
|
|
40
|
+
if (value) {
|
|
41
|
+
const stringValue = Array.isArray(value)
|
|
42
|
+
? value.map((item) => String(item))
|
|
43
|
+
: value.toString();
|
|
40
44
|
|
|
41
|
-
|
|
42
|
-
|
|
45
|
+
map.set(key, stringValue);
|
|
46
|
+
}
|
|
43
47
|
}
|
|
44
48
|
|
|
45
49
|
return map;
|
|
46
|
-
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Take either a query string (from a window.location.search, for example) or a query object (e.g.
|
|
54
|
+
* from an Express-style Request object), and a filter map of the specified filter values, and
|
|
55
|
+
* return a url that can be used to apply those specified filters.
|
|
56
|
+
*
|
|
57
|
+
* @param ctx Either a window element or an Express-style Request object
|
|
58
|
+
* @param filters A filter map for the specified filters
|
|
59
|
+
* @returns A url with the specified filters applied
|
|
60
|
+
*/
|
|
61
|
+
function setFiltersUrlFromContext(ctx: FilterContext | null, filters: FilterMap): string {
|
|
62
|
+
const context = getDefaultContext(ctx);
|
|
47
63
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
64
|
+
if (!context) {
|
|
65
|
+
return '';
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const pathname = context.location ? context.location.pathname : context.path;
|
|
69
|
+
const search = context.location ? parseSearch(context.location.search) : context.query;
|
|
70
|
+
|
|
71
|
+
return UrlService.build(pathname || '', search, filters);
|
|
72
|
+
}
|
|
52
73
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
74
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
75
|
+
const FilterService = {
|
|
76
|
+
getFiltersFromContext,
|
|
77
|
+
setFiltersUrlFromContext,
|
|
56
78
|
};
|
|
57
79
|
|
|
58
|
-
export default
|
|
80
|
+
export default FilterService;
|
|
@@ -2,7 +2,7 @@ import { format as fnsFormat, parseISO } from 'date-fns';
|
|
|
2
2
|
|
|
3
3
|
const TWO_DIGITS = 10;
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
function formatDate(value?: unknown, formatString: string = 'dd/MM/Y'): string {
|
|
6
6
|
if (!value || (typeof value !== 'string' && !(value instanceof Date))) {
|
|
7
7
|
return '';
|
|
8
8
|
}
|
|
@@ -14,14 +14,18 @@ const formatDate = (value?: unknown, formatString: string = 'dd/MM/Y'): string =
|
|
|
14
14
|
} catch (err) {
|
|
15
15
|
return '';
|
|
16
16
|
}
|
|
17
|
-
}
|
|
17
|
+
}
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
function formatDatetime(value?: unknown): string {
|
|
20
|
+
return formatDate(value, 'dd/MM/Y HH:mm');
|
|
21
|
+
}
|
|
20
22
|
|
|
21
23
|
// eslint-disable-next-line prefer-named-capture-group
|
|
22
|
-
|
|
24
|
+
function addCommas(value: string): string {
|
|
25
|
+
return value.replace(/(\d)(?=(\d{3})+(?!\d))/gu, '$1,');
|
|
26
|
+
}
|
|
23
27
|
|
|
24
|
-
|
|
28
|
+
function formatMoney(value?: unknown): string {
|
|
25
29
|
if (!value || (typeof value !== 'string' && typeof value !== 'number')) {
|
|
26
30
|
return '';
|
|
27
31
|
}
|
|
@@ -30,9 +34,9 @@ const formatMoney = (value?: unknown): string => {
|
|
|
30
34
|
const numberValue = isNegative ? value.toString().substring(1) : value.toString();
|
|
31
35
|
|
|
32
36
|
return `${isNegative ? '-' : ''}£${addCommas(parseFloat(numberValue).toFixed(2))}`;
|
|
33
|
-
}
|
|
37
|
+
}
|
|
34
38
|
|
|
35
|
-
|
|
39
|
+
function formatTwoDigits(value?: unknown): string {
|
|
36
40
|
if (!value || (typeof value !== 'string' && typeof value !== 'number')) {
|
|
37
41
|
return '';
|
|
38
42
|
}
|
|
@@ -43,8 +47,9 @@ const formatTwoDigits = (value?: unknown): string => {
|
|
|
43
47
|
return `${isNegative ? '-' : ''}${
|
|
44
48
|
parseInt(numberValue, 10) < TWO_DIGITS ? '0' : ''
|
|
45
49
|
}${numberValue}`;
|
|
46
|
-
}
|
|
50
|
+
}
|
|
47
51
|
|
|
52
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
48
53
|
const FormatService = {
|
|
49
54
|
date: formatDate,
|
|
50
55
|
datetime: formatDatetime,
|
|
@@ -2,18 +2,23 @@ import { EventService } from '@sqrzro/utility';
|
|
|
2
2
|
|
|
3
3
|
const INTERVAL = 200;
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
function send(type: string, message: string): void {
|
|
6
6
|
EventService.publish('@toast/send', {});
|
|
7
7
|
|
|
8
8
|
setTimeout(() => {
|
|
9
9
|
EventService.publish('@toast/send', { type, message });
|
|
10
10
|
}, INTERVAL);
|
|
11
|
-
}
|
|
11
|
+
}
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
function success(message: string): void {
|
|
14
|
+
return send('success', message);
|
|
15
|
+
}
|
|
14
16
|
|
|
15
|
-
|
|
17
|
+
function error(message: string): void {
|
|
18
|
+
return send('error', message);
|
|
19
|
+
}
|
|
16
20
|
|
|
21
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
17
22
|
const ToastService = { success, error };
|
|
18
23
|
|
|
19
24
|
export default ToastService;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
@tailwind base;
|
|
2
|
+
@tailwind components;
|
|
3
|
+
@tailwind utilities;
|
|
4
|
+
|
|
5
|
+
@layer base {
|
|
6
|
+
@keyframes backdropEnter {
|
|
7
|
+
from {
|
|
8
|
+
opacity: 0;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
to {
|
|
12
|
+
opacity: 1;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
dialog {
|
|
17
|
+
background-color: transparent;
|
|
18
|
+
padding: 0;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
dialog::backdrop {
|
|
22
|
+
animation: backdropEnter .3s;
|
|
23
|
+
@apply bg-slate-800/80;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
svg {
|
|
27
|
+
height: 100%;
|
|
28
|
+
width: 100%;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
@layer components {
|
|
33
|
+
@keyframes alertEnter {
|
|
34
|
+
0% {
|
|
35
|
+
opacity: 0;
|
|
36
|
+
transform: translate3d(0, 2rem, 0);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
100% {
|
|
40
|
+
opacity: 1;
|
|
41
|
+
transform: translate3d(0, 0, 0);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.alert {
|
|
46
|
+
animation: alertEnter .15s ease-in-out;
|
|
47
|
+
animation-delay: .2s;
|
|
48
|
+
animation-fill-mode: both;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.app-logo svg {
|
|
52
|
+
height: calc(100% - 1.5rem);
|
|
53
|
+
max-height: 2.5rem;
|
|
54
|
+
max-width: 2.5rem;
|
|
55
|
+
width: calc(100% - 1.5rem);
|
|
56
|
+
}
|
|
57
|
+
}
|
package/src/typings.d.ts
CHANGED
package/src/utility/icons.tsx
CHANGED
|
@@ -2,34 +2,50 @@
|
|
|
2
2
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
<
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
5
|
+
export function AuthenticatorIcon(): JSX.Element {
|
|
6
|
+
return (
|
|
7
|
+
<svg
|
|
8
|
+
fill="none"
|
|
9
|
+
height="24"
|
|
10
|
+
viewBox="0 0 24 24"
|
|
11
|
+
width="24"
|
|
12
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
13
|
+
>
|
|
14
|
+
<path
|
|
15
|
+
clipRule="evenodd"
|
|
16
|
+
d="M6.19881 1.39934C6.65631 0.84017 7.30087 0.5 8 0.5H16C16.6991 0.5 17.3437 0.84017 17.8012 1.39934C18.2564 1.95572 18.5 2.69238 18.5 3.44444V20.5556C18.5 21.3076 18.2564 22.0443 17.8012 22.6007C17.3437 23.1598 16.6991 23.5 16 23.5H8C7.30087 23.5 6.65631 23.1598 6.19881 22.6007C5.74359 22.0443 5.5 21.3076 5.5 20.5556V3.44444C5.5 2.69238 5.74359 1.95572 6.19881 1.39934ZM8 1.5C7.63826 1.5 7.26541 1.67491 6.97276 2.03258C6.67784 2.39304 6.5 2.8999 6.5 3.44444V20.5556C6.5 21.1001 6.67784 21.607 6.97276 21.9674C7.26541 22.3251 7.63826 22.5 8 22.5H16C16.3617 22.5 16.7346 22.3251 17.0272 21.9674C17.3222 21.607 17.5 21.1001 17.5 20.5556V3.44444C17.5 2.8999 17.3222 2.39304 17.0272 2.03258C16.7346 1.67491 16.3617 1.5 16 1.5H8ZM11.5 19.3333C11.5 19.0572 11.7239 18.8333 12 18.8333H12.01C12.2861 18.8333 12.51 19.0572 12.51 19.3333C12.51 19.6095 12.2861 19.8333 12.01 19.8333H12C11.7239 19.8333 11.5 19.6095 11.5 19.3333Z"
|
|
17
|
+
fill="currentColor"
|
|
18
|
+
fillRule="evenodd"
|
|
19
|
+
/>
|
|
20
|
+
</svg>
|
|
21
|
+
);
|
|
22
|
+
}
|
|
15
23
|
|
|
16
|
-
export
|
|
17
|
-
|
|
18
|
-
<
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
24
|
+
export function YubikeyIcon(): JSX.Element {
|
|
25
|
+
return (
|
|
26
|
+
<svg
|
|
27
|
+
fill="none"
|
|
28
|
+
height="24"
|
|
29
|
+
viewBox="0 0 24 24"
|
|
30
|
+
width="24"
|
|
31
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
32
|
+
>
|
|
33
|
+
<path
|
|
34
|
+
d="M11.5 20.1667C11.5 19.8905 11.7239 19.6667 12 19.6667H12.01C12.2861 19.6667 12.51 19.8905 12.51 20.1667C12.51 20.4428 12.2861 20.6667 12.01 20.6667H12C11.7239 20.6667 11.5 20.4428 11.5 20.1667Z"
|
|
35
|
+
fill="currentColor"
|
|
36
|
+
/>
|
|
37
|
+
<path
|
|
38
|
+
clipRule="evenodd"
|
|
39
|
+
d="M12 9C9.79086 9 8 10.7909 8 13C8 15.2091 9.79086 17 12 17C14.2091 17 16 15.2091 16 13C16 10.7909 14.2091 9 12 9ZM9 13C9 11.3431 10.3431 10 12 10C13.6569 10 15 11.3431 15 13C15 14.6569 13.6569 16 12 16C10.3431 16 9 14.6569 9 13Z"
|
|
40
|
+
fill="currentColor"
|
|
41
|
+
fillRule="evenodd"
|
|
42
|
+
/>
|
|
43
|
+
<path
|
|
44
|
+
clipRule="evenodd"
|
|
45
|
+
d="M7.5 0.5H16.5V5.54825C16.97 5.6399 17.4083 5.85994 17.7575 6.18974C18.2292 6.63525 18.5 7.24579 18.5 7.88889V21.1111C18.5 21.7542 18.2292 22.3648 17.7575 22.8103C17.2868 23.2549 16.6541 23.5 16 23.5H8C7.34589 23.5 6.71322 23.2549 6.24247 22.8103C5.77076 22.3648 5.5 21.7542 5.5 21.1111V7.88889C5.5 7.2458 5.77076 6.63525 6.24247 6.18974C6.59167 5.85994 7.02995 5.6399 7.5 5.54825V0.5ZM15.5 1.5V5.5H15V2H14V5.5H13.5V3H12.5V5.5H11.5V3H10.5V5.5H10V2H9V5.5H8.5V1.5H15.5ZM8 6.5C7.59325 6.5 7.2085 6.65287 6.9291 6.91675C6.65067 7.17971 6.5 7.53005 6.5 7.88889V21.1111C6.5 21.4699 6.65067 21.8203 6.9291 22.0833C7.2085 22.3471 7.59325 22.5 8 22.5H16C16.4068 22.5 16.7915 22.3471 17.0709 22.0833C17.3493 21.8203 17.5 21.4699 17.5 21.1111V7.88889C17.5 7.53005 17.3493 7.17971 17.0709 6.91675C16.7915 6.65287 16.4068 6.5 16 6.5H8Z"
|
|
46
|
+
fill="currentColor"
|
|
47
|
+
fillRule="evenodd"
|
|
48
|
+
/>
|
|
49
|
+
</svg>
|
|
50
|
+
);
|
|
51
|
+
}
|
|
@@ -22,13 +22,18 @@ export interface InputEvent<
|
|
|
22
22
|
target: InputEventTarget<T>;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
+
export type InputEventHandler<
|
|
26
|
+
T extends InputValue = InputValue,
|
|
27
|
+
O extends SimpleObject = SimpleObject
|
|
28
|
+
> = (event: InputEvent<T, O>) => void;
|
|
29
|
+
|
|
25
30
|
export interface InputProps<V extends InputValue, T extends V = V, E = HTMLInputElement> {
|
|
26
31
|
hasError?: boolean;
|
|
27
32
|
id?: string;
|
|
28
33
|
isAutoFocus?: boolean;
|
|
29
34
|
isDisabled?: boolean;
|
|
30
35
|
name: string;
|
|
31
|
-
onChange?:
|
|
36
|
+
onChange?: InputEventHandler<T>;
|
|
32
37
|
onKeyDown?: KeyboardEventHandler<E>;
|
|
33
38
|
value?: V;
|
|
34
39
|
}
|
|
@@ -55,14 +60,31 @@ export interface Action {
|
|
|
55
60
|
variant?: ButtonVariant | ButtonVariant[];
|
|
56
61
|
}
|
|
57
62
|
|
|
63
|
+
type NavigationObjectDisabledFunction = (
|
|
64
|
+
item: NavigationObject,
|
|
65
|
+
sceneData?: Record<string, unknown>
|
|
66
|
+
) => boolean;
|
|
67
|
+
|
|
58
68
|
export interface NavigationObject {
|
|
69
|
+
isActive?: boolean;
|
|
70
|
+
isDisabled?: NavigationObjectDisabledFunction | boolean;
|
|
59
71
|
label: string;
|
|
60
72
|
to?: string;
|
|
61
73
|
onClick?: MouseEventHandler<HTMLAnchorElement | HTMLButtonElement>;
|
|
62
74
|
permission?: string;
|
|
63
75
|
}
|
|
64
76
|
|
|
65
|
-
export type
|
|
77
|
+
export type NavigationData = NavigationObject[] | [string, NavigationObject[]];
|
|
78
|
+
|
|
79
|
+
export interface Query {
|
|
80
|
+
[key: string]: Query | Query[] | string[] | string;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export type QueryValue = Query | Query[] | string[] | string;
|
|
84
|
+
|
|
85
|
+
export type FilterMap = Map<string, QueryValue>;
|
|
86
|
+
|
|
87
|
+
export type Remote = string | [string, Query?, FilterMap?];
|
|
66
88
|
|
|
67
89
|
export interface SimpleObject {
|
|
68
90
|
[key: string]: unknown;
|
|
@@ -89,17 +111,6 @@ export type TransformerWithActions<T extends SimpleObject = SimpleObject, O = Tr
|
|
|
89
111
|
| Transformer<T, O>
|
|
90
112
|
| [Transformer<T, O>, Action[] | ActionFunction<T>];
|
|
91
113
|
|
|
92
|
-
export type StyleVariant =
|
|
93
|
-
| 'bordered'
|
|
94
|
-
| 'danger'
|
|
95
|
-
| 'primary'
|
|
96
|
-
| 'secondary'
|
|
97
|
-
| 'success'
|
|
98
|
-
| 'tertiary'
|
|
99
|
-
| 'warning';
|
|
100
|
-
|
|
101
|
-
export type ButtonVariant = StyleVariant | 'link';
|
|
102
|
-
|
|
103
114
|
export interface PaginationObject {
|
|
104
115
|
activePage: number;
|
|
105
116
|
pageCount: number;
|
|
@@ -111,14 +122,21 @@ export interface PaginationObject {
|
|
|
111
122
|
* ---------------------------------------------------------------------------------
|
|
112
123
|
*/
|
|
113
124
|
|
|
114
|
-
export
|
|
125
|
+
export function isString(variable: unknown): variable is string {
|
|
126
|
+
return typeof variable === 'string';
|
|
127
|
+
}
|
|
115
128
|
|
|
116
|
-
export
|
|
117
|
-
Array.isArray(variable) && (variable.length === 0 || isString(variable[0]));
|
|
129
|
+
export function isStringArray(variable: unknown): variable is string[] {
|
|
130
|
+
return Array.isArray(variable) && (variable.length === 0 || isString(variable[0]));
|
|
131
|
+
}
|
|
118
132
|
|
|
119
|
-
export
|
|
120
|
-
|
|
121
|
-
|
|
133
|
+
export function isStrictSimpleObject(variable: unknown): variable is StrictSimpleObject {
|
|
134
|
+
return (
|
|
135
|
+
isString((variable as StrictSimpleObject).id) &&
|
|
136
|
+
isString((variable as StrictSimpleObject).name)
|
|
137
|
+
);
|
|
138
|
+
}
|
|
122
139
|
|
|
123
|
-
export
|
|
124
|
-
Array.isArray(variable) && (variable.length === 0 || isStrictSimpleObject(variable[0]));
|
|
140
|
+
export function isStrictSimpleObjectArray(variable: unknown): variable is StrictSimpleObject[] {
|
|
141
|
+
return Array.isArray(variable) && (variable.length === 0 || isStrictSimpleObject(variable[0]));
|
|
142
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { NextResponse } from 'next/server';
|
|
2
|
+
import type { NextRequest } from 'next/server';
|
|
3
|
+
|
|
4
|
+
import { ApiService, TestService } from '@sqrzro/utility';
|
|
5
|
+
|
|
6
|
+
async function middleware(request: NextRequest): Promise<NextResponse> {
|
|
7
|
+
//return NextResponse.redirect(new URL('/auth/login', request.url));
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export default middleware;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
2
|
+
|
|
1
3
|
import PropTypes from 'prop-types';
|
|
4
|
+
import { AuthIdentifier } from '@sqrzro/hooks';
|
|
2
5
|
|
|
3
|
-
import { AppLayout
|
|
4
|
-
import type { ButtonVariant, StyleVariant } from '
|
|
6
|
+
import { AppLayout } from '../services/ConfigService';
|
|
7
|
+
import type { ButtonVariant, StyleVariant } from '../utility/interfaces';
|
|
5
8
|
|
|
6
9
|
export const NextRouterPropType = PropTypes.shape({
|
|
7
10
|
asPath: PropTypes.string.isRequired,
|
|
@@ -13,6 +16,7 @@ export const NextRouterPropType = PropTypes.shape({
|
|
|
13
16
|
off: PropTypes.func.isRequired,
|
|
14
17
|
on: PropTypes.func.isRequired,
|
|
15
18
|
}),
|
|
19
|
+
forward: PropTypes.func.isRequired,
|
|
16
20
|
isFallback: PropTypes.bool.isRequired,
|
|
17
21
|
isLocaleDomain: PropTypes.bool.isRequired,
|
|
18
22
|
isPreview: PropTypes.bool.isRequired,
|