@sqrzro/admin 2.0.0 → 2.1.0-bz.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/.babelrc.json +16 -0
- package/.eslintignore +6 -0
- package/.eslintrc +1 -4
- package/.sqrzrorc +5 -0
- package/.storybook/main.js +10 -11
- package/.turbo/turbo-build.log +20 -0
- package/.turbo/turbo-prettier.log +41 -213
- package/COMPONENTS.md +45 -0
- package/dist/components/AppLayout/index.d.ts +2 -2
- package/dist/components/AppLayout/index.js +7 -15
- package/dist/components/AppNavigation/index.d.ts +3 -0
- package/dist/components/AppNavigation/index.js +15 -0
- package/dist/components/BooleanFilter/index.d.ts +5 -0
- package/dist/components/BooleanFilter/index.js +19 -0
- package/dist/components/Config/index.d.ts +6 -0
- package/dist/components/Config/index.js +9 -0
- package/dist/components/Dashboard/index.d.ts +7 -0
- package/dist/components/Dashboard/index.js +5 -0
- package/dist/components/DateFilter/index.d.ts +6 -0
- package/dist/components/DateFilter/index.js +32 -0
- package/dist/components/DropdownFilter/index.d.ts +6 -0
- package/dist/components/DropdownFilter/index.js +9 -0
- package/dist/components/FilterBar/index.d.ts +8 -0
- package/dist/components/FilterBar/index.js +12 -0
- package/dist/components/FilterBarItem/index.d.ts +14 -0
- package/dist/components/FilterBarItem/index.js +31 -0
- package/dist/components/GridList/index.d.ts +5 -0
- package/dist/components/GridList/index.js +7 -0
- package/dist/components/GridListItem/index.d.ts +4 -0
- package/dist/components/GridListItem/index.js +7 -0
- package/dist/components/Icon/index.d.ts +8 -0
- package/dist/components/Icon/index.js +22 -0
- package/dist/components/List/index.d.ts +19 -33
- package/dist/components/List/index.js +19 -43
- package/dist/components/ListAction/index.d.ts +7 -0
- package/dist/components/ListAction/index.js +9 -0
- package/dist/components/ListActions/index.d.ts +6 -16
- package/dist/components/ListActions/index.js +9 -11
- package/dist/components/ListItem/index.d.ts +14 -0
- package/dist/components/ListItem/index.js +12 -0
- package/dist/components/LoginForm/index.d.ts +5 -2
- package/dist/components/LoginForm/index.js +4 -44
- package/dist/components/MeActions/index.d.ts +3 -0
- package/dist/components/MeActions/index.js +13 -0
- package/dist/components/MePanel/index.d.ts +3 -0
- package/dist/components/MePanel/index.js +9 -0
- package/dist/components/Page/index.d.ts +12 -0
- package/dist/components/Page/index.js +8 -0
- package/dist/components/PageActions/index.d.ts +6 -0
- package/dist/components/PageActions/index.js +13 -0
- package/dist/components/Panel/index.d.ts +7 -0
- package/dist/components/Panel/index.js +5 -0
- package/dist/components/RootLayout/index.d.ts +5 -3
- package/dist/components/RootLayout/index.js +12 -5
- package/dist/components/Table/index.d.ts +7 -26
- package/dist/components/Table/index.js +14 -52
- package/dist/components/TableClientComponent/index.d.ts +16 -0
- package/dist/components/TableClientComponent/index.js +44 -0
- package/dist/components/Tabs/index.d.ts +8 -0
- package/dist/components/Tabs/index.js +6 -0
- package/dist/components/index.d.ts +24 -0
- package/dist/components/index.js +13 -0
- package/dist/icons/ErrorIcon/index.d.ts +3 -0
- package/dist/icons/ErrorIcon/index.js +5 -0
- package/dist/icons/InfoIcon/index.d.ts +3 -0
- package/dist/icons/InfoIcon/index.js +5 -0
- package/dist/icons/SuccessIcon/index.d.ts +3 -0
- package/dist/icons/SuccessIcon/index.js +5 -0
- package/dist/icons/WarningIcon/index.d.ts +3 -0
- package/dist/icons/WarningIcon/index.js +5 -0
- package/dist/index.d.ts +2 -208
- package/dist/index.js +2 -212
- package/dist/interfaces.d.ts +4 -0
- package/dist/services/ConfigService.d.ts +7 -40
- package/dist/services/ConfigService.js +10 -48
- package/dist/styles/config.d.ts +3 -0
- package/dist/styles/config.js +82 -0
- package/dist/styles.css +873 -134
- package/dist/utility/formatters.d.ts +1 -0
- package/dist/utility/formatters.js +8 -0
- package/next-env.d.ts +5 -0
- package/package.json +75 -64
- package/src/components/AppLayout/index.tsx +21 -11
- package/src/components/AppNavigation/index.tsx +39 -0
- package/src/components/BooleanFilter/index.tsx +28 -0
- package/src/components/Config/index.tsx +17 -0
- package/src/components/Dashboard/index.tsx +15 -0
- package/src/components/DateFilter/index.tsx +49 -0
- package/src/components/DropdownFilter/index.tsx +19 -0
- package/src/components/FilterBar/index.tsx +35 -0
- package/src/components/FilterBarItem/index.tsx +126 -0
- package/src/components/GridList/index.tsx +11 -0
- package/src/components/GridListItem/index.tsx +31 -0
- package/src/components/Icon/index.tsx +33 -0
- package/src/components/List/index.tsx +52 -72
- package/src/components/ListAction/index.tsx +25 -0
- package/src/components/ListActions/index.tsx +32 -19
- package/src/components/ListItem/index.tsx +56 -0
- package/src/components/LoginForm/index.tsx +25 -105
- package/src/components/MeActions/index.tsx +21 -0
- package/src/components/MePanel/index.tsx +21 -0
- package/src/components/Page/index.tsx +60 -0
- package/src/components/PageActions/index.tsx +22 -0
- package/src/components/Panel/Panel.spec.tsx +10 -0
- package/src/components/Panel/Panel.stories.tsx +9 -0
- package/src/components/Panel/index.tsx +15 -0
- package/src/components/RootLayout/index.tsx +23 -29
- package/src/components/Table/index.tsx +22 -111
- package/src/components/TableClientComponent/index.tsx +112 -0
- package/src/components/Tabs/index.tsx +25 -0
- package/src/components/index.ts +68 -0
- package/src/icons/ErrorIcon/index.tsx +19 -0
- package/src/icons/InfoIcon/index.tsx +19 -0
- package/src/icons/SuccessIcon/index.tsx +19 -0
- package/src/icons/WarningIcon/index.tsx +19 -0
- package/src/index.ts +2 -214
- package/src/interfaces.ts +3 -0
- package/src/react.d.ts +12 -0
- package/src/services/ConfigService.ts +15 -84
- package/src/styles/config.ts +95 -0
- package/src/styles/tailwind.css +25 -35
- package/src/utility/formatters.ts +9 -0
- package/tailwind.config.js +8 -3
- package/tsconfig.build.json +4 -0
- package/tsconfig.json +3 -3
- package/.turbo/turbo-docs.log +0 -0
- package/.turbo/turbo-lint.log +0 -112
- package/.turbo/turbo-test.log +0 -6
- package/dist/components/Alert/index.d.ts +0 -4
- package/dist/components/Alert/index.js +0 -15
- package/dist/components/Allow/index.d.ts +0 -20
- package/dist/components/Allow/index.js +0 -29
- package/dist/components/AppLayout/AppLayout.stories.d.ts +0 -5
- package/dist/components/AppLayout/AppLayout.stories.js +0 -11
- package/dist/components/AutoSuggest/index.d.ts +0 -74
- package/dist/components/AutoSuggest/index.js +0 -143
- package/dist/components/Button/Button.stories.d.ts +0 -11
- package/dist/components/Button/Button.stories.js +0 -41
- package/dist/components/Button/index.d.ts +0 -49
- package/dist/components/Button/index.js +0 -50
- package/dist/components/CalendarInput/index.d.ts +0 -24
- package/dist/components/CalendarInput/index.js +0 -54
- package/dist/components/CheckboxList/index.d.ts +0 -17
- package/dist/components/CheckboxList/index.js +0 -25
- package/dist/components/CodeInput/index.d.ts +0 -9
- package/dist/components/CodeInput/index.js +0 -51
- package/dist/components/ConnectedDropdown/index.d.ts +0 -14
- package/dist/components/ConnectedDropdown/index.js +0 -36
- package/dist/components/ConnectedList/index.d.ts +0 -5
- package/dist/components/ConnectedList/index.js +0 -7
- package/dist/components/ConnectedTable/index.d.ts +0 -5
- package/dist/components/ConnectedTable/index.js +0 -7
- package/dist/components/ContentBlock/index.d.ts +0 -16
- package/dist/components/ContentBlock/index.js +0 -13
- package/dist/components/DataPanel/index.d.ts +0 -8
- package/dist/components/DataPanel/index.js +0 -8
- package/dist/components/DateInput/index.d.ts +0 -18
- package/dist/components/DateInput/index.js +0 -81
- package/dist/components/Dropdown/index.d.ts +0 -36
- package/dist/components/Dropdown/index.js +0 -122
- package/dist/components/ErrorMessage/index.d.ts +0 -16
- package/dist/components/ErrorMessage/index.js +0 -17
- package/dist/components/Fieldset/index.d.ts +0 -18
- package/dist/components/Fieldset/index.js +0 -19
- package/dist/components/FileInput/index.d.ts +0 -10
- package/dist/components/FileInput/index.js +0 -26
- package/dist/components/FilterLink/index.d.ts +0 -14
- package/dist/components/FilterLink/index.js +0 -15
- package/dist/components/Form/index.d.ts +0 -14
- package/dist/components/Form/index.js +0 -15
- package/dist/components/FormActions/index.d.ts +0 -18
- package/dist/components/FormActions/index.js +0 -14
- package/dist/components/FormField/index.d.ts +0 -14
- package/dist/components/FormField/index.js +0 -40
- package/dist/components/FormRepeater/index.d.ts +0 -18
- package/dist/components/FormRepeater/index.js +0 -65
- package/dist/components/ImageInput/index.d.ts +0 -13
- package/dist/components/ImageInput/index.js +0 -45
- package/dist/components/InfoPanel/index.d.ts +0 -14
- package/dist/components/InfoPanel/index.js +0 -11
- package/dist/components/Link/__mocks__/index.d.ts +0 -6
- package/dist/components/Link/__mocks__/index.js +0 -12
- package/dist/components/Link/index.d.ts +0 -23
- package/dist/components/Link/index.js +0 -21
- package/dist/components/Message/index.d.ts +0 -14
- package/dist/components/Message/index.js +0 -14
- package/dist/components/Modal/index.d.ts +0 -4
- package/dist/components/Modal/index.js +0 -18
- package/dist/components/ModalActions/index.d.ts +0 -21
- package/dist/components/ModalActions/index.js +0 -18
- package/dist/components/MoneyInput/index.d.ts +0 -10
- package/dist/components/MoneyInput/index.js +0 -13
- package/dist/components/PasswordForm/index.d.ts +0 -35
- package/dist/components/PasswordForm/index.js +0 -21
- package/dist/components/PasswordInput/index.d.ts +0 -4
- package/dist/components/PasswordInput/index.js +0 -12
- package/dist/components/RadioList/index.d.ts +0 -9
- package/dist/components/RadioList/index.js +0 -7
- package/dist/components/SummaryList/index.d.ts +0 -18
- package/dist/components/SummaryList/index.js +0 -15
- package/dist/components/Switch/index.d.ts +0 -21
- package/dist/components/Switch/index.js +0 -31
- package/dist/components/Tag/index.d.ts +0 -15
- package/dist/components/Tag/index.js +0 -13
- package/dist/components/TextArea/index.d.ts +0 -18
- package/dist/components/TextArea/index.js +0 -26
- package/dist/components/TextInput/index.d.ts +0 -14
- package/dist/components/TextInput/index.js +0 -27
- package/dist/components/WebsiteInput/index.d.ts +0 -10
- package/dist/components/WebsiteInput/index.js +0 -13
- package/dist/components/WeekCalendar/index.d.ts +0 -24
- package/dist/components/WeekCalendar/index.js +0 -48
- package/dist/core/AlertComponent/index.d.ts +0 -26
- package/dist/core/AlertComponent/index.js +0 -35
- package/dist/core/AppHeader/index.d.ts +0 -3
- package/dist/core/AppHeader/index.js +0 -17
- package/dist/core/AppLogo/index.d.ts +0 -12
- package/dist/core/AppLogo/index.js +0 -16
- package/dist/core/AppLogoImage/index.d.ts +0 -3
- package/dist/core/AppLogoImage/index.js +0 -11
- package/dist/core/AppLogoPlaceholder/index.d.ts +0 -3
- package/dist/core/AppLogoPlaceholder/index.js +0 -10
- package/dist/core/Assistive/index.d.ts +0 -12
- package/dist/core/Assistive/index.js +0 -9
- package/dist/core/AuthForm/index.d.ts +0 -10
- package/dist/core/AuthForm/index.js +0 -13
- package/dist/core/Banner/index.d.ts +0 -3
- package/dist/core/Banner/index.js +0 -14
- package/dist/core/Calendar/index.d.ts +0 -21
- package/dist/core/Calendar/index.js +0 -69
- package/dist/core/CalendarDay/index.d.ts +0 -30
- package/dist/core/CalendarDay/index.js +0 -30
- package/dist/core/CalendarMonth/index.d.ts +0 -23
- package/dist/core/CalendarMonth/index.js +0 -45
- package/dist/core/CalendarNavigation/index.d.ts +0 -17
- package/dist/core/CalendarNavigation/index.js +0 -24
- package/dist/core/CalendarWeek/index.d.ts +0 -28
- package/dist/core/CalendarWeek/index.js +0 -46
- package/dist/core/ChkRad/index.d.ts +0 -26
- package/dist/core/ChkRad/index.js +0 -33
- package/dist/core/ChkRadIcon/index.d.ts +0 -14
- package/dist/core/ChkRadIcon/index.js +0 -12
- package/dist/core/ChkRadList/index.d.ts +0 -32
- package/dist/core/ChkRadList/index.js +0 -37
- package/dist/core/CloseButton/index.d.ts +0 -17
- package/dist/core/CloseButton/index.js +0 -12
- package/dist/core/ConfirmModal/index.d.ts +0 -3
- package/dist/core/ConfirmModal/index.js +0 -38
- package/dist/core/ConnectedRepeater/index.d.ts +0 -50
- package/dist/core/ConnectedRepeater/index.js +0 -154
- package/dist/core/ConnectedRepeaterComponent/index.d.ts +0 -24
- package/dist/core/ConnectedRepeaterComponent/index.js +0 -25
- package/dist/core/Container/index.d.ts +0 -14
- package/dist/core/Container/index.js +0 -12
- package/dist/core/DataPanelItem/index.d.ts +0 -8
- package/dist/core/DataPanelItem/index.js +0 -7
- package/dist/core/DropdownPanel/index.d.ts +0 -31
- package/dist/core/DropdownPanel/index.js +0 -32
- package/dist/core/EmptyMessage/index.d.ts +0 -21
- package/dist/core/EmptyMessage/index.js +0 -21
- package/dist/core/FilterItem/index.d.ts +0 -25
- package/dist/core/FilterItem/index.js +0 -82
- package/dist/core/Filters/index.d.ts +0 -31
- package/dist/core/Filters/index.js +0 -85
- package/dist/core/FixedActions/index.d.ts +0 -24
- package/dist/core/FixedActions/index.js +0 -22
- package/dist/core/FormError/index.d.ts +0 -12
- package/dist/core/FormError/index.js +0 -9
- package/dist/core/FormLabel/index.d.ts +0 -16
- package/dist/core/FormLabel/index.js +0 -13
- package/dist/core/FormLegend/index.d.ts +0 -12
- package/dist/core/FormLegend/index.js +0 -9
- package/dist/core/Header/Header.stories.d.ts +0 -5
- package/dist/core/Header/Header.stories.js +0 -11
- package/dist/core/Header/index.d.ts +0 -14
- package/dist/core/Header/index.js +0 -12
- package/dist/core/Icon/index.d.ts +0 -14
- package/dist/core/Icon/index.js +0 -32
- package/dist/core/IconButton/index.d.ts +0 -22
- package/dist/core/IconButton/index.js +0 -20
- package/dist/core/InputPanel/index.d.ts +0 -16
- package/dist/core/InputPanel/index.js +0 -11
- package/dist/core/ListItem/index.d.ts +0 -39
- package/dist/core/ListItem/index.js +0 -44
- package/dist/core/ListItemAction/index.d.ts +0 -11
- package/dist/core/ListItemAction/index.js +0 -13
- package/dist/core/ListItemActions/index.d.ts +0 -8
- package/dist/core/ListItemActions/index.js +0 -16
- package/dist/core/ListItemMetaItem/index.d.ts +0 -19
- package/dist/core/ListItemMetaItem/index.js +0 -29
- package/dist/core/ListItemTitle/index.d.ts +0 -19
- package/dist/core/ListItemTitle/index.js +0 -44
- package/dist/core/Loader/index.d.ts +0 -15
- package/dist/core/Loader/index.js +0 -16
- package/dist/core/MeActions/index.d.ts +0 -3
- package/dist/core/MeActions/index.js +0 -48
- package/dist/core/MePanel/index.d.ts +0 -19
- package/dist/core/MePanel/index.js +0 -29
- package/dist/core/ModalComponent/index.d.ts +0 -22
- package/dist/core/ModalComponent/index.js +0 -29
- package/dist/core/Navigation/index.d.ts +0 -3
- package/dist/core/Navigation/index.js +0 -33
- package/dist/core/NavigationDivider/index.d.ts +0 -3
- package/dist/core/NavigationDivider/index.js +0 -8
- package/dist/core/NavigationItem/index.d.ts +0 -16
- package/dist/core/NavigationItem/index.js +0 -21
- package/dist/core/Pagination/index.d.ts +0 -15
- package/dist/core/Pagination/index.js +0 -64
- package/dist/core/PaginationItem/index.d.ts +0 -10
- package/dist/core/PaginationItem/index.js +0 -17
- package/dist/core/Panel/index.d.ts +0 -17
- package/dist/core/Panel/index.js +0 -13
- package/dist/core/PasswordForgotForm/index.d.ts +0 -7
- package/dist/core/PasswordForgotForm/index.js +0 -40
- package/dist/core/PasswordResetForm/index.d.ts +0 -7
- package/dist/core/PasswordResetForm/index.js +0 -34
- package/dist/core/RadialProgress/index.d.ts +0 -16
- package/dist/core/RadialProgress/index.js +0 -23
- package/dist/core/SettingsForm/index.d.ts +0 -3
- package/dist/core/SettingsForm/index.js +0 -14
- package/dist/core/StaticTextInput/index.d.ts +0 -29
- package/dist/core/StaticTextInput/index.js +0 -39
- package/dist/core/Styled/index.d.ts +0 -6
- package/dist/core/Styled/index.js +0 -39
- package/dist/core/SummaryListItem/index.d.ts +0 -23
- package/dist/core/SummaryListItem/index.js +0 -31
- package/dist/core/TabItem/index.d.ts +0 -4
- package/dist/core/TabItem/index.js +0 -13
- package/dist/core/TableActionsCell/index.d.ts +0 -8
- package/dist/core/TableActionsCell/index.js +0 -8
- package/dist/core/TableCell/index.d.ts +0 -15
- package/dist/core/TableCell/index.js +0 -20
- package/dist/core/TableHead/index.d.ts +0 -18
- package/dist/core/TableHead/index.js +0 -18
- package/dist/core/TableRow/index.d.ts +0 -13
- package/dist/core/TableRow/index.js +0 -18
- package/dist/core/Tabs/index.d.ts +0 -7
- package/dist/core/Tabs/index.js +0 -13
- package/dist/core/TextInputAncillary/index.d.ts +0 -29
- package/dist/core/TextInputAncillary/index.js +0 -31
- package/dist/core/Toast/index.d.ts +0 -3
- package/dist/core/Toast/index.js +0 -47
- package/dist/core/TwoFactor/index.d.ts +0 -13
- package/dist/core/TwoFactor/index.js +0 -49
- package/dist/core/TwoFactorAuthenticator/index.d.ts +0 -10
- package/dist/core/TwoFactorAuthenticator/index.js +0 -9
- package/dist/core/TwoFactorMethodList/index.d.ts +0 -10
- package/dist/core/TwoFactorMethodList/index.js +0 -22
- package/dist/core/TwoFactorSetup/index.d.ts +0 -12
- package/dist/core/TwoFactorSetup/index.js +0 -43
- package/dist/core/TwoFactorSetupAuthenticator/index.d.ts +0 -20
- package/dist/core/TwoFactorSetupAuthenticator/index.js +0 -42
- package/dist/core/TwoFactorSetupYubikey/index.d.ts +0 -16
- package/dist/core/TwoFactorSetupYubikey/index.js +0 -14
- package/dist/core/TwoFactorYubikey/index.d.ts +0 -9
- package/dist/core/TwoFactorYubikey/index.js +0 -14
- package/dist/core/WeekCalendarDay/index.d.ts +0 -27
- package/dist/core/WeekCalendarDay/index.js +0 -35
- package/dist/core/YubikeyInput/index.d.ts +0 -4
- package/dist/core/YubikeyInput/index.js +0 -14
- package/dist/filters/BooleanFilter/index.d.ts +0 -14
- package/dist/filters/BooleanFilter/index.js +0 -35
- package/dist/filters/DateFilter/index.d.ts +0 -5
- package/dist/filters/DateFilter/index.js +0 -24
- package/dist/filters/DropdownFilter/index.d.ts +0 -17
- package/dist/filters/DropdownFilter/index.js +0 -32
- package/dist/filters/QuickDateFilter/index.d.ts +0 -13
- package/dist/filters/QuickDateFilter/index.js +0 -40
- package/dist/filters/interfaces.d.ts +0 -35
- package/dist/hooks/useAlert.d.ts +0 -12
- package/dist/hooks/useAlert.js +0 -18
- package/dist/hooks/useAppConfig.d.ts +0 -3
- package/dist/hooks/useAppConfig.js +0 -5
- package/dist/hooks/useConnectedList.d.ts +0 -7
- package/dist/hooks/useConnectedList.js +0 -6
- package/dist/hooks/useConnectedRepeater.d.ts +0 -7
- package/dist/hooks/useConnectedRepeater.js +0 -14
- package/dist/hooks/useConnectedTable.d.ts +0 -7
- package/dist/hooks/useConnectedTable.js +0 -6
- package/dist/hooks/useFilters.d.ts +0 -9
- package/dist/hooks/useFilters.js +0 -24
- package/dist/hooks/useLayout.d.ts +0 -7
- package/dist/hooks/useLayout.js +0 -10
- package/dist/hooks/useLayout.spec.d.ts +0 -1
- package/dist/hooks/useLayout.spec.js +0 -24
- package/dist/hooks/useModal.d.ts +0 -12
- package/dist/hooks/useModal.js +0 -39
- package/dist/hooks/useModalOffset.d.ts +0 -2
- package/dist/hooks/useModalOffset.js +0 -16
- package/dist/hooks/useModalOffset.spec.d.ts +0 -1
- package/dist/hooks/useModalOffset.spec.js +0 -19
- package/dist/hooks/useNavigation.d.ts +0 -7
- package/dist/hooks/useNavigation.js +0 -113
- package/dist/hooks/useRemote.d.ts +0 -7
- package/dist/hooks/useRemote.js +0 -29
- package/dist/hooks/useVariant.d.ts +0 -9
- package/dist/hooks/useVariant.js +0 -14
- package/dist/scenes/Error404Scene.d.ts +0 -3
- package/dist/scenes/Error404Scene.js +0 -5
- package/dist/services/AppService.d.ts +0 -5
- package/dist/services/AppService.js +0 -11
- package/dist/services/ConfirmService.d.ts +0 -12
- package/dist/services/ConfirmService.js +0 -10
- package/dist/services/DateService.d.ts +0 -26
- package/dist/services/DateService.js +0 -132
- package/dist/services/DateService.spec.d.ts +0 -1
- package/dist/services/DateService.spec.js +0 -83
- package/dist/services/DownloadService.d.ts +0 -7
- package/dist/services/DownloadService.js +0 -16
- package/dist/services/DownloadService.spec.d.ts +0 -1
- package/dist/services/DownloadService.spec.js +0 -18
- package/dist/services/FilterComponentService.d.ts +0 -25
- package/dist/services/FilterComponentService.js +0 -54
- package/dist/services/FilterService.d.ts +0 -34
- package/dist/services/FilterService.js +0 -58
- package/dist/services/FilterService.spec.d.ts +0 -1
- package/dist/services/FilterService.spec.js +0 -67
- package/dist/services/FormatService.d.ts +0 -11
- package/dist/services/FormatService.js +0 -45
- package/dist/services/FormatService.spec.d.ts +0 -1
- package/dist/services/FormatService.spec.js +0 -66
- package/dist/services/ToastService.d.ts +0 -7
- package/dist/services/ToastService.js +0 -17
- package/dist/services/ToastService.spec.d.ts +0 -1
- package/dist/services/ToastService.spec.js +0 -34
- package/dist/utility/MockRouter/index.d.ts +0 -2
- package/dist/utility/MockRouter/index.js +0 -37
- package/dist/utility/StorybookPanel/index.d.ts +0 -14
- package/dist/utility/StorybookPanel/index.js +0 -12
- package/dist/utility/TestChangeHandler/index.d.ts +0 -15
- package/dist/utility/TestChangeHandler/index.js +0 -30
- package/dist/utility/icons.d.ts +0 -3
- package/dist/utility/icons.js +0 -12
- package/dist/utility/interfaces.d.ts +0 -79
- package/dist/utility/interfaces.js +0 -18
- package/dist/utility/middleware.d.ts +0 -4
- package/dist/utility/middleware.js +0 -9
- package/dist/utility/prop-types.d.ts +0 -57
- package/dist/utility/prop-types.js +0 -77
- package/dist/utility/register.d.ts +0 -3
- package/dist/utility/register.js +0 -9
- package/src/components/Alert/index.tsx +0 -111
- package/src/components/Allow/Allow.spec.tsx +0 -37
- package/src/components/Allow/index.tsx +0 -42
- package/src/components/AppLayout/AppLayout.stories.tsx +0 -20
- package/src/components/AutoSuggest/AutoSuggest.module.css +0 -8
- package/src/components/AutoSuggest/AutoSuggest.spec.tsx +0 -222
- package/src/components/AutoSuggest/AutoSuggest.story.tsx +0 -32
- package/src/components/AutoSuggest/index.tsx +0 -215
- package/src/components/Button/Button.spec.tsx +0 -61
- package/src/components/Button/Button.stories.tsx +0 -62
- package/src/components/Button/index.tsx +0 -15
- package/src/components/CalendarInput/CalendarInput.module.css +0 -8
- package/src/components/CalendarInput/CalendarInput.spec.tsx +0 -222
- package/src/components/CalendarInput/CalendarInput.story.tsx +0 -62
- package/src/components/CalendarInput/index.tsx +0 -126
- package/src/components/CheckboxList/CheckboxList.spec.tsx +0 -93
- package/src/components/CheckboxList/index.tsx +0 -51
- package/src/components/ConnectedDropdown/index.tsx +0 -53
- package/src/components/ConnectedList/index.tsx +0 -19
- package/src/components/ConnectedTable/index.tsx +0 -21
- package/src/components/ContentBlock/ContentBlock.module.css +0 -17
- package/src/components/ContentBlock/ContentBlock.spec.tsx +0 -25
- package/src/components/ContentBlock/index.tsx +0 -28
- package/src/components/DataPanel/index.tsx +0 -25
- package/src/components/DateInput/DateInput.module.css +0 -15
- package/src/components/DateInput/DateInput.spec.tsx +0 -87
- package/src/components/DateInput/index.tsx +0 -145
- package/src/components/ErrorMessage/ErrorMessage.module.css +0 -25
- package/src/components/ErrorMessage/ErrorMessage.spec.tsx +0 -31
- package/src/components/ErrorMessage/index.tsx +0 -36
- package/src/components/Fieldset/Fieldset.spec.tsx +0 -22
- package/src/components/Fieldset/Fieldset.story.tsx +0 -25
- package/src/components/Fieldset/index.tsx +0 -32
- package/src/components/FileInput/FileInput.module.css +0 -18
- package/src/components/FileInput/FileInput.spec.tsx +0 -52
- package/src/components/FileInput/FileInput.story.tsx +0 -8
- package/src/components/FileInput/index.tsx +0 -75
- package/src/components/FilterLink/FilterLink.module.css +0 -9
- package/src/components/FilterLink/FilterLink.spec.tsx +0 -34
- package/src/components/FilterLink/index.tsx +0 -36
- package/src/components/Form/Form.spec.tsx +0 -39
- package/src/components/Form/index.tsx +0 -25
- package/src/components/FormActions/FormActions.spec.tsx +0 -10
- package/src/components/FormActions/FormActions.story.tsx +0 -27
- package/src/components/FormActions/index.tsx +0 -35
- package/src/components/FormField/FormField.module.css +0 -71
- package/src/components/FormField/FormField.spec.tsx +0 -177
- package/src/components/FormField/FormField.stories.tsx +0 -44
- package/src/components/FormField/index.tsx +0 -14
- package/src/components/FormRepeater/FormRepeater.module.css +0 -7
- package/src/components/FormRepeater/FormRepeater.spec.tsx +0 -156
- package/src/components/FormRepeater/index.tsx +0 -121
- package/src/components/ImageInput/ImageInput.module.css +0 -74
- package/src/components/ImageInput/ImageInput.spec.tsx +0 -47
- package/src/components/ImageInput/ImageInput.story.tsx +0 -8
- package/src/components/ImageInput/index.tsx +0 -93
- package/src/components/InfoPanel/InfoPanel.module.css +0 -20
- package/src/components/InfoPanel/InfoPanel.spec.tsx +0 -15
- package/src/components/InfoPanel/InfoPanel.story.tsx +0 -32
- package/src/components/InfoPanel/index.tsx +0 -25
- package/src/components/Link/Link.spec.tsx +0 -64
- package/src/components/Link/__mocks__/index.tsx +0 -24
- package/src/components/Link/index.tsx +0 -60
- package/src/components/List/List.module.css +0 -9
- package/src/components/List/List.spec.tsx +0 -379
- package/src/components/List/List.story.tsx +0 -119
- package/src/components/ListActions/ListActions.spec.tsx +0 -10
- package/src/components/ListActions/ListActions.story.tsx +0 -8
- package/src/components/LoginForm/LoginForm.spec.tsx +0 -68
- package/src/components/LoginForm/LoginForm.story.tsx +0 -25
- package/src/components/Message/Message.module.css +0 -14
- package/src/components/Message/Message.spec.tsx +0 -20
- package/src/components/Message/index.tsx +0 -29
- package/src/components/Modal/index.tsx +0 -27
- package/src/components/ModalActions/ModalActions.module.css +0 -5
- package/src/components/ModalActions/ModalActions.spec.tsx +0 -49
- package/src/components/ModalActions/ModalActions.story.tsx +0 -8
- package/src/components/ModalActions/index.tsx +0 -51
- package/src/components/MoneyInput/MoneyInput.spec.tsx +0 -17
- package/src/components/MoneyInput/MoneyInput.story.tsx +0 -8
- package/src/components/MoneyInput/index.tsx +0 -18
- package/src/components/PasswordForm/index.tsx +0 -36
- package/src/components/RadioList/RadioList.spec.tsx +0 -47
- package/src/components/RadioList/index.tsx +0 -19
- package/src/components/SummaryList/SummaryList.module.css +0 -31
- package/src/components/SummaryList/SummaryList.spec.tsx +0 -89
- package/src/components/SummaryList/SummaryList.story.tsx +0 -13
- package/src/components/SummaryList/index.tsx +0 -39
- package/src/components/Switch/Switch.module.css +0 -86
- package/src/components/Switch/Switch.spec.tsx +0 -64
- package/src/components/Switch/index.tsx +0 -89
- package/src/components/Table/Table.module.css +0 -14
- package/src/components/Table/Table.spec.tsx +0 -136
- package/src/components/Table/Table.story.tsx +0 -108
- package/src/components/TextArea/TextArea.module.css +0 -23
- package/src/components/TextArea/TextArea.spec.tsx +0 -77
- package/src/components/TextArea/index.tsx +0 -61
- package/src/components/TextInput/TextInput.module.css +0 -62
- package/src/components/TextInput/TextInput.spec.tsx +0 -127
- package/src/components/TextInput/TextInput.stories.tsx +0 -46
- package/src/components/TextInput/index.tsx +0 -11
- package/src/components/WebsiteInput/WebsiteInput.spec.tsx +0 -17
- package/src/components/WebsiteInput/index.tsx +0 -18
- package/src/components/WeekCalendar/WeekCalendar.module.css +0 -19
- package/src/components/WeekCalendar/index.tsx +0 -80
- package/src/core/AlertComponent/AlertComponent.module.css +0 -110
- package/src/core/AlertComponent/AlertComponent.spec.tsx +0 -85
- package/src/core/AlertComponent/AlertComponent.story.tsx +0 -29
- package/src/core/AlertComponent/index.tsx +0 -109
- package/src/core/AppHeader/index.tsx +0 -25
- package/src/core/AppLogo/AppLogo.module.css +0 -18
- package/src/core/AppLogo/index.tsx +0 -35
- package/src/core/AppLogoImage/index.tsx +0 -19
- package/src/core/AppLogoPlaceholder/index.tsx +0 -32
- package/src/core/Assistive/index.tsx +0 -1
- package/src/core/AuthForm/AuthForm.module.css +0 -35
- package/src/core/AuthForm/AuthForm.spec.tsx +0 -72
- package/src/core/AuthForm/index.tsx +0 -63
- package/src/core/Banner/Banner.module.css +0 -34
- package/src/core/Banner/index.tsx +0 -25
- package/src/core/Calendar/index.tsx +0 -118
- package/src/core/CalendarDay/CalendarDay.module.css +0 -61
- package/src/core/CalendarDay/index.tsx +0 -82
- package/src/core/CalendarMonth/CalendarMonth.module.css +0 -13
- package/src/core/CalendarMonth/index.tsx +0 -103
- package/src/core/CalendarNavigation/CalendarNavigation.module.css +0 -26
- package/src/core/CalendarNavigation/index.tsx +0 -55
- package/src/core/CalendarWeek/index.tsx +0 -97
- package/src/core/ChkRadList/ChkRadList.module.css +0 -12
- package/src/core/ChkRadList/index.tsx +0 -88
- package/src/core/CloseButton/CloseButton.spec.tsx +0 -38
- package/src/core/CloseButton/index.tsx +0 -33
- package/src/core/ConfirmModal/ConfirmModal.spec.tsx +0 -94
- package/src/core/ConfirmModal/index.tsx +0 -59
- package/src/core/ConnectedRepeater/index.tsx +0 -284
- package/src/core/ConnectedRepeaterComponent/index.tsx +0 -71
- package/src/core/Container/Container.module.css +0 -13
- package/src/core/Container/index.tsx +0 -29
- package/src/core/DataPanelItem/index.tsx +0 -19
- package/src/core/EmptyMessage/EmptyMessage.module.css +0 -18
- package/src/core/EmptyMessage/EmptyMessage.stories.tsx +0 -33
- package/src/core/EmptyMessage/index.tsx +0 -15
- package/src/core/FilterItem/FilterItem.module.css +0 -104
- package/src/core/FilterItem/index.tsx +0 -172
- package/src/core/Filters/Filters.module.css +0 -86
- package/src/core/Filters/Filters.spec.tsx +0 -573
- package/src/core/Filters/index.tsx +0 -168
- package/src/core/FixedActions/FixedActions.module.css +0 -23
- package/src/core/FixedActions/FixedActions.spec.tsx +0 -53
- package/src/core/FixedActions/index.tsx +0 -54
- package/src/core/FormLegend/FormLegend.module.css +0 -13
- package/src/core/FormLegend/index.tsx +0 -18
- package/src/core/Header/Header.stories.tsx +0 -20
- package/src/core/Header/index.tsx +0 -32
- package/src/core/Icon/Icon.spec.tsx +0 -30
- package/src/core/Icon/index.tsx +0 -70
- package/src/core/IconButton/IconButton.module.css +0 -32
- package/src/core/IconButton/index.tsx +0 -53
- package/src/core/ListItem/ListItem.module.css +0 -28
- package/src/core/ListItem/ListItem.story.tsx +0 -32
- package/src/core/ListItem/index.tsx +0 -109
- package/src/core/ListItemAction/ListItemAction.module.css +0 -33
- package/src/core/ListItemAction/index.tsx +0 -30
- package/src/core/ListItemActions/ListItemActions.module.css +0 -94
- package/src/core/ListItemActions/index.tsx +0 -42
- package/src/core/ListItemMetaItem/ListItemMetaItem.module.css +0 -18
- package/src/core/ListItemMetaItem/index.tsx +0 -54
- package/src/core/ListItemTitle/ListItemTitle.module.css +0 -22
- package/src/core/ListItemTitle/ListItemTitle.spec.tsx +0 -53
- package/src/core/ListItemTitle/index.tsx +0 -82
- package/src/core/Loader/Loader.module.css +0 -57
- package/src/core/Loader/Loader.stories.tsx +0 -22
- package/src/core/Loader/index.tsx +0 -2
- package/src/core/MeActions/MeActions.module.css +0 -47
- package/src/core/MeActions/index.tsx +0 -74
- package/src/core/MePanel/MePanel.module.css +0 -79
- package/src/core/MePanel/index.tsx +0 -58
- package/src/core/ModalComponent/ModalComponent.module.css +0 -86
- package/src/core/ModalComponent/ModalComponent.spec.tsx +0 -55
- package/src/core/ModalComponent/index.tsx +0 -66
- package/src/core/Navigation/Navigation.module.css +0 -89
- package/src/core/Navigation/Navigation.spec.tsx +0 -121
- package/src/core/Navigation/index.tsx +0 -69
- package/src/core/NavigationDivider/NavigationDivider.module.css +0 -3
- package/src/core/NavigationDivider/index.tsx +0 -13
- package/src/core/NavigationItem/NavigationItem.module.css +0 -46
- package/src/core/NavigationItem/index.tsx +0 -50
- package/src/core/Panel/Panel.module.css +0 -26
- package/src/core/Panel/Panel.spec.tsx +0 -16
- package/src/core/Panel/index.tsx +0 -35
- package/src/core/PasswordForgotForm/index.tsx +0 -62
- package/src/core/PasswordResetForm/index.tsx +0 -65
- package/src/core/RadialProgress/RadialProgress.module.css +0 -78
- package/src/core/RadialProgress/index.tsx +0 -49
- package/src/core/SettingsForm/index.tsx +0 -26
- package/src/core/SummaryListItem/SummaryListItem.module.css +0 -20
- package/src/core/SummaryListItem/index.tsx +0 -65
- package/src/core/TabItem/TabItem.module.css +0 -28
- package/src/core/TabItem/index.tsx +0 -42
- package/src/core/Tabs/Tabs.module.css +0 -19
- package/src/core/Tabs/Tabs.spec.tsx +0 -30
- package/src/core/Tabs/index.tsx +0 -36
- package/src/core/Toast/Toast.module.css +0 -54
- package/src/core/Toast/Toast.spec.tsx +0 -80
- package/src/core/Toast/index.tsx +0 -79
- package/src/core/TwoFactor/TwoFactor.spec.tsx +0 -183
- package/src/core/TwoFactor/index.tsx +0 -102
- package/src/core/TwoFactorAuthenticator/index.tsx +0 -39
- package/src/core/TwoFactorMethodList/TwoFactorMethodList.module.css +0 -50
- package/src/core/TwoFactorMethodList/index.tsx +0 -49
- package/src/core/TwoFactorSetup/index.tsx +0 -91
- package/src/core/TwoFactorSetupAuthenticator/TwoFactorSetupAuthenticator.module.css +0 -6
- package/src/core/TwoFactorSetupAuthenticator/index.tsx +0 -100
- package/src/core/TwoFactorSetupYubikey/index.tsx +0 -49
- package/src/core/TwoFactorYubikey/index.tsx +0 -41
- package/src/core/WeekCalendarDay/WeekCalendarDay.module.css +0 -32
- package/src/core/WeekCalendarDay/index.tsx +0 -68
- package/src/core/YubikeyInput/YubikeyInput.module.css +0 -27
- package/src/core/YubikeyInput/YubikeyInput.spec.tsx +0 -77
- package/src/core/YubikeyInput/index.tsx +0 -76
- package/src/filters/BooleanFilter/index.tsx +0 -47
- package/src/filters/DateFilter/index.tsx +0 -36
- package/src/filters/DropdownFilter/index.tsx +0 -51
- package/src/filters/QuickDateFilter/index.tsx +0 -74
- package/src/filters/interfaces.ts +0 -39
- package/src/hooks/useAlert.spec.tsx +0 -72
- package/src/hooks/useAlert.ts +0 -37
- package/src/hooks/useConfig.ts +0 -31
- package/src/hooks/useConnectedList.ts +0 -15
- package/src/hooks/useConnectedRepeater.ts +0 -25
- package/src/hooks/useConnectedTable.ts +0 -15
- package/src/hooks/useFilters.ts +0 -34
- package/src/hooks/useLayout.spec.ts +0 -31
- package/src/hooks/useLayout.ts +0 -23
- package/src/hooks/useModal.spec.tsx +0 -72
- package/src/hooks/useModal.ts +0 -62
- package/src/hooks/useModalOffset.spec.ts +0 -27
- package/src/hooks/useModalOffset.ts +0 -26
- package/src/hooks/useNavigation.ts +0 -160
- package/src/hooks/useRemote.ts +0 -43
- package/src/scenes/Error404Scene.tsx +0 -7
- package/src/services/AppService.ts +0 -16
- package/src/services/ConfirmService.ts +0 -26
- package/src/services/DateService.spec.ts +0 -102
- package/src/services/DateService.ts +0 -182
- package/src/services/DownloadService.spec.ts +0 -23
- package/src/services/DownloadService.ts +0 -21
- package/src/services/FilterComponentService.tsx +0 -67
- package/src/services/FilterService.spec.ts +0 -105
- package/src/services/FilterService.ts +0 -80
- package/src/services/FormatService.spec.ts +0 -85
- package/src/services/FormatService.ts +0 -60
- package/src/services/ToastService.spec.ts +0 -44
- package/src/services/ToastService.ts +0 -24
- package/src/typings.d.ts +0 -4
- package/src/utility/MockRouter/index.ts +0 -46
- package/src/utility/icons.tsx +0 -51
- package/src/utility/interfaces.ts +0 -142
- package/src/utility/middleware.ts +0 -10
- package/src/utility/prop-types.ts +0 -89
- package/src/utility/register.tsx +0 -11
- package/tsconfig.eslint.json +0 -4
- /package/dist/{filters/interfaces.js → interfaces.js} +0 -0
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import React, { memo, useEffect, useState } from 'react';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
import { ApiService } from '@sqrzro/utility';
|
|
5
|
-
import { useClickOutside } from '@sqrzro/hooks';
|
|
6
|
-
import CloseButton from '../../core/CloseButton';
|
|
7
|
-
import Icon from '../../core/Icon';
|
|
8
|
-
import InputPanel from '../../core/InputPanel';
|
|
9
|
-
const DEFAULT_PANEL_OPTIONS = { size: 'md' };
|
|
10
|
-
const parseRemote = (remote) => {
|
|
11
|
-
if (Array.isArray(remote)) {
|
|
12
|
-
return [remote[0], { ...remote[1], simpleview: '1' }];
|
|
13
|
-
}
|
|
14
|
-
return [remote, { simpleview: '1' }];
|
|
15
|
-
};
|
|
16
|
-
function FilterItem({ data, label, name, props, remote, renderField, renderSummary, onCancel, onChange, panelOptions, value, }) {
|
|
17
|
-
const [isOpen, setIsOpen, node] = useClickOutside();
|
|
18
|
-
const [isDisabled, setIsDisabled] = useState(Boolean(remote));
|
|
19
|
-
const [remoteData, setRemoteData] = useState([]);
|
|
20
|
-
const [panelIndex, setPanelIndex] = useState(0);
|
|
21
|
-
const toggleIsOpen = () => setIsOpen(!isOpen);
|
|
22
|
-
const handleChange = (event) => {
|
|
23
|
-
if (event.target.value !== '[internal]') {
|
|
24
|
-
onChange(event);
|
|
25
|
-
if (!props?.isMultiple) {
|
|
26
|
-
setIsOpen(false);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
const handleCancel = () => {
|
|
31
|
-
onCancel({ target: { name, value: name } });
|
|
32
|
-
setPanelIndex(0);
|
|
33
|
-
setIsOpen(false);
|
|
34
|
-
};
|
|
35
|
-
const handleRemote = async () => {
|
|
36
|
-
if (!remote) {
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
const response = await ApiService.get(parseRemote(remote));
|
|
40
|
-
setRemoteData(response.data);
|
|
41
|
-
setIsDisabled(false);
|
|
42
|
-
};
|
|
43
|
-
useEffect(() => {
|
|
44
|
-
void handleRemote();
|
|
45
|
-
}, []);
|
|
46
|
-
const summaryArgs = {
|
|
47
|
-
data: remote ? remoteData : data,
|
|
48
|
-
props,
|
|
49
|
-
value,
|
|
50
|
-
};
|
|
51
|
-
const summary = renderSummary ? renderSummary(summaryArgs) : value;
|
|
52
|
-
const field = renderField({
|
|
53
|
-
data: remote ? remoteData : data,
|
|
54
|
-
extraProps: props,
|
|
55
|
-
name,
|
|
56
|
-
onChange: handleChange,
|
|
57
|
-
panelIndex,
|
|
58
|
-
setPanelIndex,
|
|
59
|
-
value,
|
|
60
|
-
});
|
|
61
|
-
const parsedPanelOptions = Array.isArray(panelOptions) ? panelOptions : [panelOptions];
|
|
62
|
-
return (React.createElement("div", { ref: node, className: "/*clsx(styles.root, isDisabled && styles.rootIsDisabled)*/", "data-testid": "filter-item-root" },
|
|
63
|
-
React.createElement("div", { className: "/*clsx(styles.inner, value && styles.innerHasValue)*/" },
|
|
64
|
-
React.createElement("div", { className: "/*styles.icon*/" }, Array.isArray(value) && value.length > 1 ? (React.createElement("span", { className: "/*styles.count*/" }, value.length)) : (React.createElement(Icon, { icon: "filter", size: 12 }))),
|
|
65
|
-
React.createElement("div", { className: "/*styles.label*/", "data-testid": "filter-item-label" }, summary || label),
|
|
66
|
-
value ? (React.createElement("i", { className: "/*styles.close*/" },
|
|
67
|
-
React.createElement(CloseButton, { label: "Cancel", onClick: handleCancel, size: "sm" }))) : null,
|
|
68
|
-
React.createElement("button", { className: "/*clsx(styles.control, value && styles.controlHasValue)*/", onClick: toggleIsOpen, type: "button" }, isOpen ? 'Close' : 'Open')),
|
|
69
|
-
isOpen ? (React.createElement(InputPanel, { ...DEFAULT_PANEL_OPTIONS, ...(parsedPanelOptions[panelIndex] || {}) }, field)) : null));
|
|
70
|
-
}
|
|
71
|
-
FilterItem.propTypes = {
|
|
72
|
-
label: PropTypes.string.isRequired,
|
|
73
|
-
name: PropTypes.string.isRequired,
|
|
74
|
-
renderField: PropTypes.func.isRequired,
|
|
75
|
-
onCancel: PropTypes.func.isRequired,
|
|
76
|
-
onChange: PropTypes.func.isRequired,
|
|
77
|
-
props: PropTypes.shape({
|
|
78
|
-
isMultiple: PropTypes.bool,
|
|
79
|
-
}),
|
|
80
|
-
renderSummary: PropTypes.func,
|
|
81
|
-
};
|
|
82
|
-
export default memo(FilterItem);
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import type { FilterField } from '../../filters/interfaces';
|
|
4
|
-
import type { Action } from '../../utility/interfaces';
|
|
5
|
-
interface FiltersProps {
|
|
6
|
-
actions?: Action[];
|
|
7
|
-
fields?: FilterField[];
|
|
8
|
-
hasSearch?: boolean;
|
|
9
|
-
isDisabled?: boolean;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Render a series of `FilterFields`. It will also render a search input if `hasSearch` is true, and
|
|
13
|
-
* a series of `Actions` if `actions` is provided.
|
|
14
|
-
*/
|
|
15
|
-
declare function Filters({ actions, fields, hasSearch, isDisabled }: FiltersProps): React.ReactElement;
|
|
16
|
-
declare namespace Filters {
|
|
17
|
-
var propTypes: {
|
|
18
|
-
actions: PropTypes.Requireable<NonNullable<PropTypes.InferProps<{
|
|
19
|
-
label: PropTypes.Validator<string>;
|
|
20
|
-
onClick: PropTypes.Validator<(...args: any[]) => any>;
|
|
21
|
-
}>>[]>;
|
|
22
|
-
fields: PropTypes.Requireable<NonNullable<PropTypes.InferProps<{
|
|
23
|
-
label: PropTypes.Validator<string>;
|
|
24
|
-
name: PropTypes.Validator<string>;
|
|
25
|
-
renderField: PropTypes.Validator<(...args: any[]) => any>;
|
|
26
|
-
}>>[]>;
|
|
27
|
-
hasSearch: PropTypes.Requireable<boolean>;
|
|
28
|
-
isDisabled: PropTypes.Requireable<boolean>;
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
export default Filters;
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import React, { useEffect, useState } from 'react';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
import Button from '../../components/Button';
|
|
5
|
-
import TextInput from '../../components/TextInput';
|
|
6
|
-
import FilterItem from '../../core/FilterItem';
|
|
7
|
-
import useFilters from '../../hooks/useFilters';
|
|
8
|
-
const flattenFilter = (filter) => {
|
|
9
|
-
if (!filter) {
|
|
10
|
-
return filter;
|
|
11
|
-
}
|
|
12
|
-
if (Array.isArray(filter)) {
|
|
13
|
-
return filter.map((item) => item.toString());
|
|
14
|
-
}
|
|
15
|
-
return filter.toString();
|
|
16
|
-
};
|
|
17
|
-
/**
|
|
18
|
-
* Render a series of `FilterFields`. It will also render a search input if `hasSearch` is true, and
|
|
19
|
-
* a series of `Actions` if `actions` is provided.
|
|
20
|
-
*/
|
|
21
|
-
function Filters({ actions, fields, hasSearch, isDisabled }) {
|
|
22
|
-
const [filters, setFilters] = useFilters();
|
|
23
|
-
const [pendingSearch, setPendingSearch] = useState('');
|
|
24
|
-
const [isOpen, setIsOpen] = useState(false);
|
|
25
|
-
const toggleIsOpen = () => setIsOpen(!isOpen);
|
|
26
|
-
useEffect(() => {
|
|
27
|
-
setPendingSearch(filters.get('search')?.toString() || '');
|
|
28
|
-
}, [filters.get('search')]);
|
|
29
|
-
const handleCancel = (event) => {
|
|
30
|
-
const newFilters = new Map(filters);
|
|
31
|
-
newFilters.delete(event.target.value);
|
|
32
|
-
setFilters(newFilters);
|
|
33
|
-
};
|
|
34
|
-
const handleChange = (event) => {
|
|
35
|
-
const newFilters = new Map(filters);
|
|
36
|
-
/*
|
|
37
|
-
* `event.target.value` can be null, so the optional check (?.) is required for typescript.
|
|
38
|
-
* However, no null value can be passed from a filter, so this can be ignored by test
|
|
39
|
-
* coverage.
|
|
40
|
-
*/
|
|
41
|
-
/* istanbul ignore next */
|
|
42
|
-
const value = Array.isArray(event.target.value)
|
|
43
|
-
? event.target.value.map((item) => item?.toString() || '')
|
|
44
|
-
: event.target.value?.toString() || '';
|
|
45
|
-
newFilters.set(event.target.name, value);
|
|
46
|
-
setFilters(newFilters);
|
|
47
|
-
};
|
|
48
|
-
const handleSearch = (event) => {
|
|
49
|
-
if (event.key === 'Enter') {
|
|
50
|
-
handleChange({ target: { name: 'search', value: pendingSearch } });
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
const handleSearchClear = () => {
|
|
54
|
-
handleChange({ target: { name: 'search', value: '' } });
|
|
55
|
-
setPendingSearch('');
|
|
56
|
-
};
|
|
57
|
-
return (React.createElement("aside", { className: "/*styles.root*/", "data-testid": "filters-root" },
|
|
58
|
-
React.createElement("div", { className: "/*clsx(styles.control, isOpen && styles.controlIsOpen)*/" },
|
|
59
|
-
React.createElement(Button, { onClick: toggleIsOpen, variant: "bordered" },
|
|
60
|
-
"Filters",
|
|
61
|
-
filters.size ? ` (${filters.size})` : '...')),
|
|
62
|
-
React.createElement("div", { className: "/*clsx(styles.content, isOpen && styles.contentIsOpen)*/", "data-testid": "filters-content" },
|
|
63
|
-
React.createElement("div", { className: "/*styles.section*/" },
|
|
64
|
-
hasSearch ? (React.createElement("div", { className: "/*styles.search*/" },
|
|
65
|
-
React.createElement(TextInput, { name: "search", onChange: (event) => setPendingSearch(event.target.value), onClear: handleSearchClear, onKeyDown: handleSearch, placeholder: "Search...", value: pendingSearch, isClearable: true }))) : null,
|
|
66
|
-
hasSearch && fields?.length ? (React.createElement("i", { className: "/*styles.divider*/", "data-testid": "filters-divider" })) : null,
|
|
67
|
-
fields?.map((item) => (React.createElement(FilterItem, { key: item.label, onCancel: handleCancel, onChange: handleChange, value: flattenFilter(filters.get(item.name)), ...item })))),
|
|
68
|
-
actions?.length ? (React.createElement("div", { className: "/*styles.actions*/" }, actions.map((item) => (React.createElement(Button, { key: item.label, isDisabled: isDisabled || item.isDisabled, onClick: item.onClick, variant: item.variant || 'bordered' }, item.label))))) : null),
|
|
69
|
-
React.createElement("div", { className: "/*clsx(styles.close, isOpen && styles.closeIsOpen)*/" },
|
|
70
|
-
React.createElement(Button, { onClick: toggleIsOpen, variant: "link" }, "Close Filters"))));
|
|
71
|
-
}
|
|
72
|
-
Filters.propTypes = {
|
|
73
|
-
actions: PropTypes.arrayOf(PropTypes.shape({
|
|
74
|
-
label: PropTypes.string.isRequired,
|
|
75
|
-
onClick: PropTypes.func.isRequired,
|
|
76
|
-
}).isRequired),
|
|
77
|
-
fields: PropTypes.arrayOf(PropTypes.shape({
|
|
78
|
-
label: PropTypes.string.isRequired,
|
|
79
|
-
name: PropTypes.string.isRequired,
|
|
80
|
-
renderField: PropTypes.func.isRequired,
|
|
81
|
-
}).isRequired),
|
|
82
|
-
hasSearch: PropTypes.bool,
|
|
83
|
-
isDisabled: PropTypes.bool,
|
|
84
|
-
};
|
|
85
|
-
export default Filters;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
export interface FixedActionsProps {
|
|
4
|
-
children?: React.ReactNode;
|
|
5
|
-
isDisabled?: boolean;
|
|
6
|
-
isLoading?: boolean;
|
|
7
|
-
label: string;
|
|
8
|
-
onClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
9
|
-
to?: string;
|
|
10
|
-
type?: 'button' | 'submit';
|
|
11
|
-
}
|
|
12
|
-
declare function FixedActions({ children, label, isDisabled, isLoading, onClick, to, type, }: FixedActionsProps): React.ReactElement;
|
|
13
|
-
declare namespace FixedActions {
|
|
14
|
-
var propTypes: {
|
|
15
|
-
label: PropTypes.Validator<string>;
|
|
16
|
-
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
17
|
-
isDisabled: PropTypes.Requireable<boolean>;
|
|
18
|
-
isLoading: PropTypes.Requireable<boolean>;
|
|
19
|
-
to: PropTypes.Requireable<string>;
|
|
20
|
-
type: PropTypes.Requireable<string>;
|
|
21
|
-
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
export default FixedActions;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import useLayout from '../../hooks/useLayout';
|
|
4
|
-
import useModalOffset from '../../hooks/useModalOffset';
|
|
5
|
-
import Button from '../../components/Button';
|
|
6
|
-
function FixedActions({ children, label, isDisabled, isLoading, onClick, to, type, }) {
|
|
7
|
-
const { applyLayoutClassName } = useLayout();
|
|
8
|
-
const style = useModalOffset('marginRight');
|
|
9
|
-
return (React.createElement("div", { className: "/*clsx(styles.root, applyLayoutClassName(styles))*/", style: style },
|
|
10
|
-
children,
|
|
11
|
-
React.createElement(Button, { isDisabled: isDisabled || isLoading, onClick: onClick, to: to, type: type }, label)));
|
|
12
|
-
}
|
|
13
|
-
FixedActions.propTypes = {
|
|
14
|
-
label: PropTypes.string.isRequired,
|
|
15
|
-
children: PropTypes.node,
|
|
16
|
-
isDisabled: PropTypes.bool,
|
|
17
|
-
isLoading: PropTypes.bool,
|
|
18
|
-
to: PropTypes.string,
|
|
19
|
-
type: PropTypes.oneOf(['button', 'submit']),
|
|
20
|
-
onClick: PropTypes.func,
|
|
21
|
-
};
|
|
22
|
-
export default FixedActions;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
interface FormErrorProps {
|
|
4
|
-
message: string;
|
|
5
|
-
}
|
|
6
|
-
declare function FormError({ message }: FormErrorProps): React.ReactElement;
|
|
7
|
-
declare namespace FormError {
|
|
8
|
-
var propTypes: {
|
|
9
|
-
message: PropTypes.Validator<string>;
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
export default FormError;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
function FormError({ message }) {
|
|
4
|
-
return React.createElement("div", { className: "/*styles.root*/" }, message);
|
|
5
|
-
}
|
|
6
|
-
FormError.propTypes = {
|
|
7
|
-
message: PropTypes.string.isRequired,
|
|
8
|
-
};
|
|
9
|
-
export default FormError;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
interface FormLabelProps {
|
|
4
|
-
children: React.ReactNode;
|
|
5
|
-
htmlFor: string;
|
|
6
|
-
isOptional?: boolean;
|
|
7
|
-
}
|
|
8
|
-
declare function FormLabel({ children, htmlFor, isOptional }: FormLabelProps): React.ReactElement;
|
|
9
|
-
declare namespace FormLabel {
|
|
10
|
-
var propTypes: {
|
|
11
|
-
children: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>;
|
|
12
|
-
htmlFor: PropTypes.Validator<string>;
|
|
13
|
-
isOptional: PropTypes.Requireable<boolean>;
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
export default FormLabel;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
function FormLabel({ children, htmlFor, isOptional }) {
|
|
4
|
-
return (React.createElement("label", { className: "/*styles.root*/", htmlFor: htmlFor },
|
|
5
|
-
children,
|
|
6
|
-
isOptional ? React.createElement("small", { className: "/*styles.optional*/" }, "(Optional)") : null));
|
|
7
|
-
}
|
|
8
|
-
FormLabel.propTypes = {
|
|
9
|
-
children: PropTypes.node.isRequired,
|
|
10
|
-
htmlFor: PropTypes.string.isRequired,
|
|
11
|
-
isOptional: PropTypes.bool,
|
|
12
|
-
};
|
|
13
|
-
export default FormLabel;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
interface FormLegendProps {
|
|
4
|
-
children: React.ReactNode;
|
|
5
|
-
}
|
|
6
|
-
declare function FormLegend({ children }: FormLegendProps): React.ReactElement;
|
|
7
|
-
declare namespace FormLegend {
|
|
8
|
-
var propTypes: {
|
|
9
|
-
children: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>;
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
export default FormLegend;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
function FormLegend({ children }) {
|
|
4
|
-
return React.createElement("legend", { className: "/*styles.root*/" }, children);
|
|
5
|
-
}
|
|
6
|
-
FormLegend.propTypes = {
|
|
7
|
-
children: PropTypes.node.isRequired,
|
|
8
|
-
};
|
|
9
|
-
export default FormLegend;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import Header from './index';
|
|
3
|
-
export default {
|
|
4
|
-
title: 'Core/Header',
|
|
5
|
-
component: Header,
|
|
6
|
-
};
|
|
7
|
-
const Template = (args) => (React.createElement(Header, { ...args }));
|
|
8
|
-
export const Basic = Template.bind({});
|
|
9
|
-
Basic.args = {
|
|
10
|
-
title: 'Lorem Ipsum',
|
|
11
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import type { StyleVariant } from '../../utility/interfaces';
|
|
4
|
-
export interface HeaderProps {
|
|
5
|
-
title?: string | null;
|
|
6
|
-
variant?: StyleVariant;
|
|
7
|
-
}
|
|
8
|
-
declare function Header({ title, variant }: HeaderProps): React.ReactElement;
|
|
9
|
-
declare namespace Header {
|
|
10
|
-
var propTypes: {
|
|
11
|
-
title: PropTypes.Requireable<string>;
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
export default Header;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import useLayout from '../../hooks/useLayout';
|
|
4
|
-
function Header({ title, variant }) {
|
|
5
|
-
const { applyLayoutClassName } = useLayout();
|
|
6
|
-
return (React.createElement("header", { className: "border-b border-b-gray-300 p-4" },
|
|
7
|
-
React.createElement("h1", { className: "text-gray-600 text-2xl", "data-testid": "header-title" }, title || '•••')));
|
|
8
|
-
}
|
|
9
|
-
Header.propTypes = {
|
|
10
|
-
title: PropTypes.string,
|
|
11
|
-
};
|
|
12
|
-
export default Header;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
interface IconProps {
|
|
4
|
-
icon: string;
|
|
5
|
-
size?: number;
|
|
6
|
-
}
|
|
7
|
-
declare function Icon({ icon, size }: IconProps): React.ReactElement | null;
|
|
8
|
-
declare namespace Icon {
|
|
9
|
-
var propTypes: {
|
|
10
|
-
icon: PropTypes.Validator<string>;
|
|
11
|
-
size: PropTypes.Requireable<number>;
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
export default Icon;
|
package/dist/core/Icon/index.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/* eslint-disable react/forbid-component-props */
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { ArrowLeftIcon, ArrowRightIcon, ArrowUpTrayIcon, CalendarIcon, CheckCircleIcon, CheckIcon, ChevronDownIcon, ExclamationCircleIcon, FunnelIcon, LockClosedIcon, XMarkIcon, } from '@heroicons/react/20/solid';
|
|
4
|
-
import PropTypes from 'prop-types';
|
|
5
|
-
const DEFAULT_SIZE = 20;
|
|
6
|
-
const iconMap = {
|
|
7
|
-
arrowLeft: ArrowLeftIcon,
|
|
8
|
-
arrowRight: ArrowRightIcon,
|
|
9
|
-
calendar: CalendarIcon,
|
|
10
|
-
checkCircle: CheckCircleIcon,
|
|
11
|
-
check: CheckIcon,
|
|
12
|
-
chevronDown: ChevronDownIcon,
|
|
13
|
-
exclamationCircle: ExclamationCircleIcon,
|
|
14
|
-
filter: FunnelIcon,
|
|
15
|
-
lockClosed: LockClosedIcon,
|
|
16
|
-
upload: ArrowUpTrayIcon,
|
|
17
|
-
x: XMarkIcon, // eslint-disable-line id-length
|
|
18
|
-
};
|
|
19
|
-
function Icon({ icon, size }) {
|
|
20
|
-
const Component = iconMap[icon];
|
|
21
|
-
return Component ? (React.createElement(Component, { "data-testid": "icon-root", role: "img", style: {
|
|
22
|
-
display: 'block',
|
|
23
|
-
fill: 'inherit',
|
|
24
|
-
stroke: 'inherit',
|
|
25
|
-
width: `${size || DEFAULT_SIZE}px`,
|
|
26
|
-
} })) : null;
|
|
27
|
-
}
|
|
28
|
-
Icon.propTypes = {
|
|
29
|
-
icon: PropTypes.string.isRequired,
|
|
30
|
-
size: PropTypes.number,
|
|
31
|
-
};
|
|
32
|
-
export default Icon;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
interface IconButtonProps {
|
|
4
|
-
children: React.ReactNode;
|
|
5
|
-
icon: string;
|
|
6
|
-
onClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
7
|
-
size?: 'sm' | 'md' | 'lg';
|
|
8
|
-
type?: 'button' | 'submit';
|
|
9
|
-
variant?: 'white';
|
|
10
|
-
}
|
|
11
|
-
declare function IconButton({ children, icon, onClick, size, type, variant, }: IconButtonProps): React.ReactElement;
|
|
12
|
-
declare namespace IconButton {
|
|
13
|
-
var propTypes: {
|
|
14
|
-
children: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>;
|
|
15
|
-
icon: PropTypes.Validator<string>;
|
|
16
|
-
size: PropTypes.Requireable<string>;
|
|
17
|
-
type: PropTypes.Requireable<string>;
|
|
18
|
-
variant: PropTypes.Requireable<string>;
|
|
19
|
-
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
export default IconButton;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import Assistive from '../../core/Assistive';
|
|
4
|
-
import Icon from '../../core/Icon';
|
|
5
|
-
// Import styles from './IconButton.module.css';
|
|
6
|
-
const iconSizeMap = { sm: 16, md: 24 };
|
|
7
|
-
function IconButton({ children, icon, onClick, size, type, variant, }) {
|
|
8
|
-
return (React.createElement("button", { className: "clsx(styles.root, styles[`root${ucwords(size || 'md')}`], variant && styles[`root${ucwords(variant)}`])", onClick: onClick, type: type === 'submit' ? 'submit' : 'button' },
|
|
9
|
-
React.createElement(Icon, { icon: icon, size: iconSizeMap[size || 'md'] }),
|
|
10
|
-
React.createElement(Assistive, null, children)));
|
|
11
|
-
}
|
|
12
|
-
IconButton.propTypes = {
|
|
13
|
-
children: PropTypes.node.isRequired,
|
|
14
|
-
icon: PropTypes.string.isRequired,
|
|
15
|
-
size: PropTypes.oneOf(['sm', 'md', 'lg']),
|
|
16
|
-
type: PropTypes.oneOf(['button', 'submit']),
|
|
17
|
-
variant: PropTypes.oneOf(['white']),
|
|
18
|
-
onClick: PropTypes.func,
|
|
19
|
-
};
|
|
20
|
-
export default IconButton;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
interface InputPanelProps {
|
|
4
|
-
children: React.ReactNode;
|
|
5
|
-
isScrollable?: boolean;
|
|
6
|
-
size?: 'sm' | 'md' | 'lg';
|
|
7
|
-
}
|
|
8
|
-
declare function InputPanel({ children, isScrollable, size }: InputPanelProps): React.ReactElement;
|
|
9
|
-
declare namespace InputPanel {
|
|
10
|
-
var propTypes: {
|
|
11
|
-
children: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>;
|
|
12
|
-
isScrollable: PropTypes.Requireable<boolean>;
|
|
13
|
-
size: PropTypes.Requireable<string>;
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
export default InputPanel;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
function InputPanel({ children, isScrollable, size }) {
|
|
4
|
-
return (React.createElement("div", { className: "/*clsx(styles.root, size && styles[`root${ucwords(size)`])*/" }, isScrollable ? React.createElement("div", { className: "/*styles.inner*/" }, children) : children));
|
|
5
|
-
}
|
|
6
|
-
InputPanel.propTypes = {
|
|
7
|
-
children: PropTypes.node.isRequired,
|
|
8
|
-
isScrollable: PropTypes.bool,
|
|
9
|
-
size: PropTypes.oneOf(['sm', 'md', 'lg']),
|
|
10
|
-
};
|
|
11
|
-
export default InputPanel;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import type { ValueObject } from '../../core/ListItemMetaItem';
|
|
4
|
-
import type { SimpleObject, TransformedObject } from '../../utility/interfaces';
|
|
5
|
-
export interface ListItemObject<T extends SimpleObject = SimpleObject> extends TransformedObject<T> {
|
|
6
|
-
$shouldPreloadTitle?: boolean;
|
|
7
|
-
content?: string;
|
|
8
|
-
meta?: (React.ReactElement | ValueObject | string | null | undefined)[];
|
|
9
|
-
onClick?: React.MouseEventHandler<HTMLAnchorElement | HTMLHeadingElement>;
|
|
10
|
-
reference?: string;
|
|
11
|
-
secondary?: {
|
|
12
|
-
title: string;
|
|
13
|
-
};
|
|
14
|
-
title?: string;
|
|
15
|
-
to?: string;
|
|
16
|
-
}
|
|
17
|
-
declare function ListItem<T extends SimpleObject>({ $actions, $original, $shouldPreloadTitle, content, meta, onClick, reference, secondary, title, to, }: ListItemObject<T>): React.ReactElement;
|
|
18
|
-
declare namespace ListItem {
|
|
19
|
-
var propTypes: {
|
|
20
|
-
$original: PropTypes.Validator<NonNullable<PropTypes.InferProps<{}>>>;
|
|
21
|
-
$actions: PropTypes.Requireable<NonNullable<((...args: any[]) => any) | NonNullable<PropTypes.InferProps<{
|
|
22
|
-
label: PropTypes.Validator<string>;
|
|
23
|
-
onClick: PropTypes.Validator<(...args: any[]) => any>;
|
|
24
|
-
}>>[] | null | undefined>>;
|
|
25
|
-
$shouldPreloadTitle: PropTypes.Requireable<boolean>;
|
|
26
|
-
content: PropTypes.Requireable<string>;
|
|
27
|
-
meta: PropTypes.Requireable<(NonNullable<string | PropTypes.ReactElementLike | PropTypes.InferProps<{
|
|
28
|
-
to: PropTypes.Validator<string>;
|
|
29
|
-
label: PropTypes.Validator<string>;
|
|
30
|
-
}> | null | undefined> | null | undefined)[]>;
|
|
31
|
-
secondary: PropTypes.Requireable<PropTypes.InferProps<{
|
|
32
|
-
title: PropTypes.Validator<string>;
|
|
33
|
-
}>>;
|
|
34
|
-
title: PropTypes.Requireable<string>;
|
|
35
|
-
to: PropTypes.Requireable<string>;
|
|
36
|
-
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
export default ListItem;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import ListItemActions from '../../core/ListItemActions';
|
|
4
|
-
import ListItemMetaItem from '../../core/ListItemMetaItem';
|
|
5
|
-
import ListItemTitle from '../../core/ListItemTitle';
|
|
6
|
-
import Panel from '../../core/Panel';
|
|
7
|
-
function ListItem({ $actions, $original, $shouldPreloadTitle, content, meta, onClick, reference, secondary, title, to, }) {
|
|
8
|
-
return (React.createElement(Panel, null,
|
|
9
|
-
React.createElement("article", null,
|
|
10
|
-
title ? (React.createElement("div", { className: "/*styles.inner*/" },
|
|
11
|
-
React.createElement(ListItemTitle, { isPreload: $shouldPreloadTitle, onClick: onClick, reference: reference, to: to }, title),
|
|
12
|
-
secondary ? React.createElement("p", { className: "/*styles.title*/" }, secondary.title) : null)) : null,
|
|
13
|
-
content ? React.createElement("div", { className: "/*styles.content*/" }, content) : null,
|
|
14
|
-
meta || $actions ? (React.createElement("footer", { className: "/*styles.footer*/" },
|
|
15
|
-
meta ? (React.createElement("ul", { className: "/*styles.meta*/" }, meta.map((item, index) => (React.createElement(ListItemMetaItem, { key: index, value: item }))))) : null,
|
|
16
|
-
$actions ? React.createElement(ListItemActions, { actions: $actions, data: $original }) : null)) : null)));
|
|
17
|
-
}
|
|
18
|
-
ListItem.propTypes = {
|
|
19
|
-
$original: PropTypes.shape({}).isRequired,
|
|
20
|
-
$actions: PropTypes.oneOfType([
|
|
21
|
-
PropTypes.arrayOf(PropTypes.shape({
|
|
22
|
-
label: PropTypes.string.isRequired,
|
|
23
|
-
onClick: PropTypes.func.isRequired,
|
|
24
|
-
}).isRequired),
|
|
25
|
-
PropTypes.func,
|
|
26
|
-
]),
|
|
27
|
-
$shouldPreloadTitle: PropTypes.bool,
|
|
28
|
-
content: PropTypes.string,
|
|
29
|
-
meta: PropTypes.arrayOf(PropTypes.oneOfType([
|
|
30
|
-
PropTypes.string,
|
|
31
|
-
PropTypes.shape({
|
|
32
|
-
to: PropTypes.string.isRequired,
|
|
33
|
-
label: PropTypes.string.isRequired,
|
|
34
|
-
}),
|
|
35
|
-
PropTypes.element,
|
|
36
|
-
])),
|
|
37
|
-
secondary: PropTypes.shape({
|
|
38
|
-
title: PropTypes.string.isRequired,
|
|
39
|
-
}),
|
|
40
|
-
title: PropTypes.string,
|
|
41
|
-
to: PropTypes.string,
|
|
42
|
-
onClick: PropTypes.func,
|
|
43
|
-
};
|
|
44
|
-
export default ListItem;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import type { Action } from '../../utility/interfaces';
|
|
4
|
-
declare function ListItemAction({ isDisabled, label, onClick, variant }: Action): React.ReactElement;
|
|
5
|
-
declare namespace ListItemAction {
|
|
6
|
-
var propTypes: {
|
|
7
|
-
label: PropTypes.Validator<string>;
|
|
8
|
-
onClick: PropTypes.Validator<(...args: any[]) => any>;
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
export default ListItemAction;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import useVariant from '../../hooks/useVariant';
|
|
4
|
-
// Import styles from './ListItemAction.module.css';
|
|
5
|
-
function ListItemAction({ isDisabled, label, onClick, variant }) {
|
|
6
|
-
const { applyVariantClassName } = useVariant(variant);
|
|
7
|
-
return (React.createElement("button", { className: "clsx(styles.root, applyVariantClassName(styles), {[styles.rootIsDisabled]: isDisabled })", onClick: onClick, type: "button" }, label));
|
|
8
|
-
}
|
|
9
|
-
ListItemAction.propTypes = {
|
|
10
|
-
label: PropTypes.string.isRequired,
|
|
11
|
-
onClick: PropTypes.func.isRequired,
|
|
12
|
-
};
|
|
13
|
-
export default ListItemAction;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { Action, ActionFunction } from '../../utility/interfaces';
|
|
3
|
-
interface ListItemActionsProps<T> {
|
|
4
|
-
actions: Action[] | ActionFunction<T>;
|
|
5
|
-
data?: T;
|
|
6
|
-
}
|
|
7
|
-
declare function ListItemActions<T>({ actions, data }: ListItemActionsProps<T>): React.ReactElement;
|
|
8
|
-
export default ListItemActions;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { useClickOutside } from '@sqrzro/hooks';
|
|
4
|
-
import ListItemAction from '../../core/ListItemAction';
|
|
5
|
-
function ListItemActions({ actions, data }) {
|
|
6
|
-
const [isOpen, setIsOpen, node] = useClickOutside();
|
|
7
|
-
const toggleOpen = () => setIsOpen(!isOpen);
|
|
8
|
-
const transformed = typeof actions === 'function' ? actions(data) : actions;
|
|
9
|
-
return (React.createElement("div", { ref: node, className: "/*styles.root*/" },
|
|
10
|
-
React.createElement("button", { className: "/*styles.control*/", onClick: toggleOpen, type: "button" },
|
|
11
|
-
isOpen ? 'Close' : 'Open',
|
|
12
|
-
React.createElement("i", null)),
|
|
13
|
-
React.createElement("ul", { className: "/*clsx(styles.list, isOpen && styles.listIsOpen)*/" }, transformed.filter(Boolean).map((item) => (React.createElement("li", { key: item.label, className: "/*styles.item*/" },
|
|
14
|
-
React.createElement(ListItemAction, { ...item })))))));
|
|
15
|
-
}
|
|
16
|
-
export default ListItemActions;
|