@steroidsjs/core 2.0.0-rc.7 → 2.0.1-beta.113
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/LICENSE +1 -1
- package/actions/auth.ts +55 -0
- package/actions/fields.ts +5 -0
- package/actions/list.ts +303 -0
- package/actions/modal.ts +33 -0
- package/actions/notifications.ts +37 -0
- package/actions/router.ts +111 -0
- package/actions/screen.ts +28 -0
- package/base/Enum.ts +28 -0
- package/build/docs-autogen-result.json +33256 -0
- package/build/docs-autogen.js +124 -0
- package/build/helpers.js +276 -0
- package/components/ClientStorageComponent.ts +117 -0
- package/components/HtmlComponent.ts +77 -0
- package/components/HttpComponent.tsx +300 -0
- package/components/LocaleComponent.tsx +136 -0
- package/components/MetaComponent.ts +226 -0
- package/components/ResourceComponent.ts +140 -0
- package/components/SocialComponent.ts +39 -0
- package/components/StoreComponent.ts +169 -0
- package/components/UiComponent.ts +107 -0
- package/components/WebSocketComponent.ts +222 -0
- package/components/index.ts +19 -0
- package/components/social/FacebookProvider.ts +55 -0
- package/components/social/GoogleProvider.ts +47 -0
- package/components/social/SteamProvider.ts +69 -0
- package/components/social/VkProvider.ts +70 -0
- package/components/social/index.ts +10 -0
- package/hoc/application.tsx +103 -0
- package/hoc/bem.tsx +55 -0
- package/hoc/components.tsx +67 -0
- package/hoc/connect.ts +16 -0
- package/hoc/dataProvider.tsx +521 -0
- package/hoc/fetch.tsx +175 -0
- package/hoc/field.tsx +285 -0
- package/hoc/file.tsx +322 -0
- package/hoc/form.tsx +88 -0
- package/hoc/formSubmit.tsx +158 -0
- package/hoc/http.tsx +112 -0
- package/hoc/index.ts +37 -0
- package/hoc/layout.tsx +205 -0
- package/hoc/list.tsx +549 -0
- package/hoc/normalize.tsx +60 -0
- package/hoc/props.tsx +27 -0
- package/hoc/screen.tsx +66 -0
- package/hoc/theme.tsx +56 -0
- package/index.d.ts +80 -89
- package/package.json +18 -58
- package/reducers/auth.ts +57 -0
- package/reducers/fields.ts +44 -0
- package/reducers/index.ts +23 -0
- package/reducers/list.ts +191 -0
- package/reducers/modal.ts +79 -0
- package/reducers/notifications.ts +39 -0
- package/reducers/router.ts +322 -0
- package/reducers/screen.ts +43 -0
- package/tsconfig.json +7 -0
- package/ui/crud/Crud/Crud.tsx +454 -0
- package/ui/crud/Crud/CrudDetail.tsx +17 -0
- package/ui/crud/Crud/CrudForm.tsx +33 -0
- package/ui/crud/Crud/CrudGrid.tsx +25 -0
- package/ui/crud/Crud/demo/default.tsx +58 -0
- package/ui/crud/Crud/{index.d.ts → index.ts} +0 -0
- package/ui/crud/index.ts +31 -0
- package/ui/form/AutoCompleteField/AutoCompleteField.story.js +9 -0
- package/ui/form/AutoCompleteField/AutoCompleteField.tsx +161 -0
- package/ui/form/AutoCompleteField/demo/basic.tsx +19 -0
- package/ui/form/AutoCompleteField/{index.d.ts → index.ts} +0 -0
- package/ui/form/BlankField/BlankField.tsx +23 -0
- package/ui/form/BlankField/{index.d.ts → index.ts} +0 -0
- package/ui/form/Button/Button.story.js +17 -0
- package/ui/form/Button/Button.tsx +383 -0
- package/ui/form/Button/demo/block.tsx +17 -0
- package/ui/form/Button/demo/colors.tsx +40 -0
- package/ui/form/Button/demo/disabled.tsx +16 -0
- package/ui/form/Button/demo/link.tsx +19 -0
- package/ui/form/Button/demo/sizes.tsx +28 -0
- package/ui/form/Button/index.ts +2 -0
- package/ui/form/CheckboxField/CheckboxField.story.js +15 -0
- package/ui/form/CheckboxField/CheckboxField.tsx +80 -0
- package/ui/form/CheckboxField/demo/basic.tsx +14 -0
- package/ui/form/CheckboxField/demo/disabled.tsx +15 -0
- package/ui/form/CheckboxField/demo/errors.tsx +15 -0
- package/ui/form/CheckboxField/demo/required.tsx +15 -0
- package/ui/form/CheckboxField/{index.d.ts → index.ts} +0 -0
- package/ui/form/CheckboxListField/CheckboxListField.tsx +81 -0
- package/ui/form/CheckboxListField/{index.d.ts → index.ts} +0 -0
- package/ui/form/DateField/DateField.story.js +19 -0
- package/ui/form/DateField/DateField.tsx +165 -0
- package/ui/form/DateField/demo/disabled.tsx +11 -0
- package/ui/form/DateField/demo/errors.tsx +10 -0
- package/ui/form/DateField/demo/icon.tsx +13 -0
- package/ui/form/DateField/demo/placeholder.tsx +10 -0
- package/ui/form/DateField/demo/required.tsx +10 -0
- package/ui/form/DateField/demo/sizes.tsx +20 -0
- package/ui/form/DateField/{index.d.ts → index.ts} +0 -0
- package/ui/form/DateTimeField/DateTimeField.story.js +15 -0
- package/ui/form/DateTimeField/DateTimeField.tsx +153 -0
- package/ui/form/DateTimeField/demo/disabled.tsx +10 -0
- package/ui/form/DateTimeField/demo/errors.tsx +10 -0
- package/ui/form/DateTimeField/demo/required.tsx +10 -0
- package/ui/form/DateTimeField/demo/sizes.tsx +20 -0
- package/ui/form/DateTimeField/{index.d.ts → index.ts} +0 -0
- package/ui/form/DropDownField/DropDownField.story.js +23 -0
- package/ui/form/DropDownField/DropDownField.tsx +146 -0
- package/ui/form/DropDownField/demo/auto-complete.tsx +31 -0
- package/ui/form/DropDownField/demo/disabled.tsx +13 -0
- package/ui/form/DropDownField/demo/errors.tsx +13 -0
- package/ui/form/DropDownField/demo/multiple.tsx +13 -0
- package/ui/form/DropDownField/demo/no-border.tsx +16 -0
- package/ui/form/DropDownField/demo/placeholder.tsx +14 -0
- package/ui/form/DropDownField/demo/required.tsx +13 -0
- package/ui/form/DropDownField/demo/show-reset.tsx +13 -0
- package/ui/form/DropDownField/{index.d.ts → index.ts} +0 -0
- package/ui/form/Field/Field.tsx +34 -0
- package/ui/form/Field/{index.d.ts → index.ts} +0 -0
- package/ui/form/FieldLayout/FieldLayout.story.js +13 -0
- package/ui/form/FieldLayout/FieldLayout.tsx +73 -0
- package/ui/form/FieldLayout/demo/default.tsx +8 -0
- package/ui/form/FieldLayout/demo/horizontal.tsx +8 -0
- package/ui/form/FieldLayout/demo/inline.tsx +9 -0
- package/ui/form/FieldLayout/{index.d.ts → index.ts} +0 -0
- package/ui/form/FieldList/FieldList.story.js +9 -0
- package/ui/form/FieldList/FieldList.tsx +204 -0
- package/ui/form/FieldList/demo/basic.tsx +29 -0
- package/ui/form/FieldList/{index.d.ts → index.ts} +0 -0
- package/ui/form/FieldList/tableNavigationHandler.ts +41 -0
- package/ui/form/FieldSet/FieldSet.tsx +69 -0
- package/ui/form/FieldSet/{index.d.ts → index.ts} +0 -0
- package/ui/form/FileField/FileField.story.js +9 -0
- package/ui/form/FileField/FileField.tsx +204 -0
- package/ui/form/FileField/demo/basic.tsx +12 -0
- package/ui/form/FileField/{index.d.ts → index.ts} +0 -0
- package/ui/form/Form/AutoSaveHelper.ts +23 -0
- package/ui/form/Form/Form.story.js +9 -0
- package/ui/form/Form/Form.tsx +274 -0
- package/ui/form/Form/SyncAddressBarHelper.ts +82 -0
- package/ui/form/Form/demo/basic.tsx +42 -0
- package/ui/form/Form/{index.d.ts → index.ts} +0 -0
- package/ui/form/HtmlField/HtmlField.tsx +291 -0
- package/ui/form/HtmlField/demo/basic.tsx +41 -0
- package/ui/form/HtmlField/{index.d.ts → index.ts} +0 -0
- package/ui/form/InputField/InputField.story.js +27 -0
- package/ui/form/InputField/InputField.tsx +180 -0
- package/ui/form/InputField/demo/addons.tsx +14 -0
- package/ui/form/InputField/demo/basic.tsx +14 -0
- package/ui/form/InputField/demo/disabled.tsx +14 -0
- package/ui/form/InputField/demo/errors.tsx +14 -0
- package/ui/form/InputField/demo/mask.tsx +19 -0
- package/ui/form/InputField/demo/placeholder.tsx +14 -0
- package/ui/form/InputField/demo/required.tsx +14 -0
- package/ui/form/InputField/demo/sizes.tsx +24 -0
- package/ui/form/InputField/demo/textAddons.tsx +14 -0
- package/ui/form/InputField/demo/types.tsx +26 -0
- package/ui/form/InputField/{index.d.ts → index.ts} +0 -0
- package/ui/form/NavField/NavField.tsx +36 -0
- package/ui/form/NavField/{index.d.ts → index.ts} +0 -0
- package/ui/form/NumberField/NumberField.story.js +19 -0
- package/ui/form/NumberField/NumberField.tsx +90 -0
- package/ui/form/NumberField/demo/basic.tsx +14 -0
- package/ui/form/NumberField/demo/disabled.tsx +14 -0
- package/ui/form/NumberField/demo/errors.tsx +14 -0
- package/ui/form/NumberField/demo/placeholder.tsx +14 -0
- package/ui/form/NumberField/demo/required.tsx +14 -0
- package/ui/form/NumberField/demo/sizes.tsx +24 -0
- package/ui/form/NumberField/{index.d.ts → index.ts} +0 -0
- package/ui/form/PasswordField/PasswordField.story.js +21 -0
- package/ui/form/PasswordField/PasswordField.tsx +127 -0
- package/ui/form/PasswordField/demo/basic.tsx +14 -0
- package/ui/form/PasswordField/demo/disabled.tsx +14 -0
- package/ui/form/PasswordField/demo/errors.tsx +14 -0
- package/ui/form/PasswordField/demo/placeholder.tsx +14 -0
- package/ui/form/PasswordField/demo/required.tsx +14 -0
- package/ui/form/PasswordField/demo/security.tsx +14 -0
- package/ui/form/PasswordField/demo/sizes.tsx +24 -0
- package/ui/form/PasswordField/{index.d.ts → index.ts} +0 -0
- package/ui/form/RadioListField/RadioListField.story.js +13 -0
- package/ui/form/RadioListField/RadioListField.tsx +70 -0
- package/ui/form/RadioListField/demo/disabled.tsx +31 -0
- package/ui/form/RadioListField/demo/errors.tsx +13 -0
- package/ui/form/RadioListField/demo/required.tsx +13 -0
- package/ui/form/RadioListField/{index.d.ts → index.ts} +0 -0
- package/ui/form/RangeField/RangeField.story.js +19 -0
- package/ui/form/RangeField/RangeField.tsx +173 -0
- package/ui/form/RangeField/demo/date.tsx +11 -0
- package/ui/form/RangeField/demo/disabled.tsx +8 -0
- package/ui/form/RangeField/demo/errors.tsx +11 -0
- package/ui/form/RangeField/demo/placeholders.tsx +12 -0
- package/ui/form/RangeField/demo/required.tsx +8 -0
- package/ui/form/RangeField/demo/sizes.tsx +18 -0
- package/ui/form/RangeField/demo/types.tsx +17 -0
- package/ui/form/RangeField/index.ts +2 -0
- package/ui/form/ReCaptchaField/ReCaptchaField.tsx +40 -0
- package/ui/form/ReCaptchaField/{index.d.ts → index.ts} +0 -0
- package/ui/form/SliderField/SliderField.tsx +80 -0
- package/ui/form/SliderField/{index.d.ts → index.ts} +0 -0
- package/ui/form/SwitcherField/SwitcherField.tsx +60 -0
- package/ui/form/SwitcherField/{index.d.ts → index.ts} +0 -0
- package/ui/form/TextField/TextField.story.js +19 -0
- package/ui/form/TextField/TextField.tsx +93 -0
- package/ui/form/TextField/demo/disabled.tsx +8 -0
- package/ui/form/TextField/demo/errors.tsx +8 -0
- package/ui/form/TextField/demo/placeholder.tsx +8 -0
- package/ui/form/TextField/demo/required.tsx +8 -0
- package/ui/form/TextField/demo/sizes.tsx +18 -0
- package/ui/form/TextField/demo/submit.tsx +8 -0
- package/ui/form/TextField/{index.d.ts → index.ts} +0 -0
- package/ui/form/TimeField/TimeField.story.js +17 -0
- package/ui/form/TimeField/TimeField.tsx +107 -0
- package/ui/form/TimeField/demo/disabled.tsx +8 -0
- package/ui/form/TimeField/demo/errors.tsx +8 -0
- package/ui/form/TimeField/demo/placeholder.tsx +8 -0
- package/ui/form/TimeField/demo/required.tsx +8 -0
- package/ui/form/TimeField/demo/sizes.tsx +18 -0
- package/ui/form/TimeField/{index.d.ts → index.ts} +0 -0
- package/ui/form/index.ts +84 -0
- package/ui/form/validate.ts +90 -0
- package/ui/format/BooleanFormatter/BooleanFormatter.tsx +23 -0
- package/ui/format/BooleanFormatter/{index.d.ts → index.ts} +0 -0
- package/ui/format/DateFormatter/DateFormatter.tsx +40 -0
- package/ui/format/DateFormatter/demo/basic.tsx +11 -0
- package/ui/format/DateFormatter/{index.d.ts → index.ts} +0 -0
- package/ui/format/DateTimeFormatter/DateTimeFormatter.tsx +52 -0
- package/ui/format/DateTimeFormatter/demo/basic.tsx +11 -0
- package/ui/format/DateTimeFormatter/{index.d.ts → index.ts} +0 -0
- package/ui/format/EnumFormatter/EnumFormatter.tsx +62 -0
- package/ui/format/EnumFormatter/{index.d.ts → index.ts} +0 -0
- package/ui/format/FileSize/FileSize.tsx +60 -0
- package/ui/format/FileSize/{index.d.ts → index.ts} +0 -0
- package/ui/format/Format/Format.tsx +80 -0
- package/ui/format/Format/{index.d.ts → index.ts} +0 -0
- package/ui/format/MoneyFormatter/MoneyFormatter.tsx +67 -0
- package/ui/format/MoneyFormatter/{index.d.ts → index.ts} +0 -0
- package/ui/format/PhotosFormatter/PhotosFormatter.tsx +63 -0
- package/ui/format/PhotosFormatter/index.ts +2 -0
- package/ui/format/index.ts +27 -0
- package/ui/icon/Icon/Icon.tsx +98 -0
- package/ui/icon/Icon/demo/icon.tsx +70 -0
- package/ui/icon/Icon/index.ts +2 -0
- package/ui/layout/Header/Header.tsx +40 -0
- package/ui/layout/Header/{index.d.ts → index.ts} +0 -0
- package/ui/layout/Loader/Loader.tsx +23 -0
- package/ui/layout/Loader/{index.d.ts → index.ts} +0 -0
- package/ui/layout/Notifications/Notifications.tsx +145 -0
- package/ui/layout/Notifications/demo/basic.tsx +48 -0
- package/ui/layout/Notifications/{index.d.ts → index.ts} +0 -0
- package/ui/layout/Portal.tsx +31 -0
- package/ui/layout/Tooltip/Tooltip.tsx +500 -0
- package/ui/layout/Tooltip/TooltipPortalInner.tsx +18 -0
- package/ui/layout/Tooltip/demo/basic.tsx +23 -0
- package/ui/layout/Tooltip/{index.d.ts → index.tsx} +0 -0
- package/ui/layout/index.ts +10 -0
- package/ui/list/Accordion/Accordion.tsx +146 -0
- package/ui/list/Accordion/index.ts +2 -0
- package/ui/list/CheckboxColumn/CheckboxColumn.tsx +82 -0
- package/ui/list/CheckboxColumn/{index.d.ts → index.ts} +0 -0
- package/ui/list/ControlsColumn/ControlsColumn.tsx +49 -0
- package/ui/list/ControlsColumn/{index.d.ts → index.ts} +0 -0
- package/ui/list/Detail/Detail.tsx +116 -0
- package/ui/list/Detail/index.ts +2 -0
- package/ui/list/Empty/Empty.tsx +28 -0
- package/ui/list/Empty/demo/basic.tsx +11 -0
- package/ui/list/Empty/{index.d.ts → index.ts} +0 -0
- package/ui/list/Grid/Grid.tsx +169 -0
- package/ui/list/Grid/demo/load-more.tsx +71 -0
- package/ui/list/Grid/demo/pagination.tsx +40 -0
- package/ui/list/Grid/demo/visible.tsx +36 -0
- package/ui/list/Grid/{index.d.ts → index.ts} +0 -0
- package/ui/list/List/List.tsx +75 -0
- package/ui/list/List/demo/basic.tsx +42 -0
- package/ui/list/List/demo/empty.tsx +16 -0
- package/ui/list/List/demo/pagination-layout.tsx +36 -0
- package/ui/list/List/demo/pagination-more-size.tsx +28 -0
- package/ui/list/List/demo/pagination-pages.tsx +28 -0
- package/ui/list/List/demo/pagination-search.tsx +42 -0
- package/ui/list/List/{index.d.ts → index.ts} +0 -0
- package/ui/list/Pagination/Pagination.tsx +125 -0
- package/ui/list/Pagination/demo/basic.tsx +49 -0
- package/ui/list/Pagination/demo/load-more.tsx +18 -0
- package/ui/list/Pagination/demo/sizes.tsx +28 -0
- package/ui/list/Pagination/{index.d.ts → index.ts} +0 -0
- package/ui/list/PaginationSize/PaginationSize.tsx +76 -0
- package/ui/list/PaginationSize/demo/basic.tsx +31 -0
- package/ui/list/PaginationSize/{index.d.ts → index.ts} +0 -0
- package/ui/list/index.ts +7 -0
- package/ui/modal/Modal/Modal.tsx +55 -0
- package/ui/modal/Modal/demo/basic.tsx +50 -0
- package/ui/modal/Modal/{index.d.ts → index.ts} +0 -0
- package/ui/modal/ModalPortal/ModalPortal.tsx +75 -0
- package/ui/modal/ModalPortal/{index.d.ts → index.ts} +0 -0
- package/ui/modal/TwoFactorModal/TwoFactorModal.tsx +80 -0
- package/ui/modal/TwoFactorModal/{index.d.ts → index.ts} +0 -0
- package/ui/modal/index.ts +6 -0
- package/ui/nav/Breadcrumbs/Breadcrumbs.tsx +40 -0
- package/ui/nav/Breadcrumbs/{index.d.ts → index.ts} +0 -0
- package/ui/nav/Controls/Controls.tsx +87 -0
- package/ui/nav/Controls/{index.d.ts → index.ts} +0 -0
- package/ui/nav/Link/Link.tsx +25 -0
- package/ui/nav/Link/{index.d.ts → index.ts} +0 -0
- package/ui/nav/Nav/Nav.tsx +147 -0
- package/ui/nav/Nav/demo/buttons.tsx +48 -0
- package/ui/nav/Nav/demo/links.tsx +13 -0
- package/ui/nav/Nav/demo/navbar.tsx +34 -0
- package/ui/nav/Nav/demo/tabs.tsx +13 -0
- package/ui/nav/Nav/{index.d.ts → index.ts} +0 -0
- package/ui/nav/Router/Router.tsx +235 -0
- package/ui/nav/Router/SsrProvider.tsx +32 -0
- package/ui/nav/Router/{index.d.ts → index.ts} +0 -0
- package/ui/nav/Router/navigationHoc.tsx +135 -0
- package/ui/nav/Tree/Tree.tsx +279 -0
- package/ui/nav/Tree/demo/level-tree-routes.tsx +10 -0
- package/ui/nav/Tree/demo/level-tree.tsx +44 -0
- package/ui/nav/Tree/{index.d.ts → index.ts} +0 -0
- package/ui/nav/{index.d.ts → index.ts} +0 -0
- package/utils/collection.ts +13 -0
- package/utils/data.ts +120 -0
- package/utils/query.ts +147 -0
- package/utils/text.ts +82 -0
- package/actions/auth.d.ts +0 -24
- package/actions/auth.js +0 -65
- package/actions/fields.d.ts +0 -5
- package/actions/fields.js +0 -9
- package/actions/form.d.ts +0 -59
- package/actions/form.js +0 -68
- package/actions/list.d.ts +0 -103
- package/actions/list.js +0 -293
- package/actions/modal.d.ts +0 -20
- package/actions/modal.js +0 -44
- package/actions/notifications.d.ts +0 -13
- package/actions/notifications.js +0 -50
- package/actions/router.d.ts +0 -15
- package/actions/router.js +0 -51
- package/actions/screen.d.ts +0 -7
- package/actions/screen.js +0 -33
- package/base/Enum.d.ts +0 -11
- package/base/Enum.js +0 -32
- package/components/ClientStorageComponent.d.ts +0 -33
- package/components/ClientStorageComponent.js +0 -129
- package/components/HtmlComponent.d.ts +0 -15
- package/components/HtmlComponent.js +0 -93
- package/components/HttpComponent.d.ts +0 -49
- package/components/HttpComponent.js +0 -333
- package/components/LocaleComponent.d.ts +0 -30
- package/components/LocaleComponent.js +0 -156
- package/components/MetaComponent.d.ts +0 -136
- package/components/MetaComponent.js +0 -175
- package/components/MetricsComponent.d.ts +0 -39
- package/components/MetricsComponent.js +0 -156
- package/components/ResourceComponent.d.ts +0 -22
- package/components/ResourceComponent.js +0 -144
- package/components/SocialComponent.d.ts +0 -12
- package/components/SocialComponent.js +0 -41
- package/components/StoreComponent.d.ts +0 -29
- package/components/StoreComponent.js +0 -146
- package/components/UiComponent.d.ts +0 -37
- package/components/UiComponent.js +0 -173
- package/components/WebSocketComponent.d.ts +0 -31
- package/components/WebSocketComponent.js +0 -234
- package/components/social/FacebookProvider.d.ts +0 -8
- package/components/social/FacebookProvider.js +0 -93
- package/components/social/GoogleProvider.d.ts +0 -9
- package/components/social/GoogleProvider.js +0 -98
- package/components/social/SteamProvider.d.ts +0 -7
- package/components/social/SteamProvider.js +0 -126
- package/components/social/VkProvider.d.ts +0 -8
- package/components/social/VkProvider.js +0 -128
- package/components/social/index.d.ts +0 -11
- package/components/social/index.js +0 -15
- package/hoc/application.d.ts +0 -8
- package/hoc/application.js +0 -46
- package/hoc/bem.d.ts +0 -14
- package/hoc/bem.js +0 -38
- package/hoc/components.d.ts +0 -11
- package/hoc/components.js +0 -58
- package/hoc/connect.d.ts +0 -6
- package/hoc/connect.js +0 -3
- package/hoc/fetch.d.ts +0 -13
- package/hoc/fetch.js +0 -56
- package/hoc/file.d.ts +0 -23
- package/hoc/file.js +0 -41
- package/hoc/http.d.ts +0 -7
- package/hoc/http.js +0 -49
- package/hoc/index.d.ts +0 -8
- package/hoc/index.js +0 -20
- package/hoc/layout.d.ts +0 -31
- package/hoc/layout.js +0 -44
- package/hooks/index.d.ts +0 -7
- package/hooks/index.js +0 -18
- package/hooks/useAddressBar.d.ts +0 -23
- package/hooks/useAddressBar.js +0 -127
- package/hooks/useApplication.d.ts +0 -33
- package/hooks/useApplication.js +0 -119
- package/hooks/useBem.d.ts +0 -10
- package/hooks/useBem.js +0 -14
- package/hooks/useComponents.d.ts +0 -14
- package/hooks/useComponents.js +0 -12
- package/hooks/useDataProvider.d.ts +0 -92
- package/hooks/useDataProvider.js +0 -144
- package/hooks/useDataSelect.d.ts +0 -42
- package/hooks/useDataSelect.js +0 -155
- package/hooks/useDispatch.d.ts +0 -1
- package/hooks/useDispatch.js +0 -7
- package/hooks/useFetch.d.ts +0 -30
- package/hooks/useFetch.js +0 -147
- package/hooks/useFile.d.ts +0 -2
- package/hooks/useFile.js +0 -194
- package/hooks/useForm.d.ts +0 -8
- package/hooks/useForm.js +0 -18
- package/hooks/useInitial.d.ts +0 -1
- package/hooks/useInitial.js +0 -11
- package/hooks/useLayout.d.ts +0 -12
- package/hooks/useLayout.js +0 -127
- package/hooks/useList.d.ts +0 -155
- package/hooks/useList.js +0 -238
- package/hooks/useModel.d.ts +0 -2
- package/hooks/useModel.js +0 -16
- package/hooks/useSelector.d.ts +0 -1
- package/hooks/useSelector.js +0 -7
- package/hooks/useUniqueId.d.ts +0 -1
- package/hooks/useUniqueId.js +0 -15
- package/reducers/auth.d.ts +0 -21
- package/reducers/auth.js +0 -61
- package/reducers/fields.d.ts +0 -11
- package/reducers/fields.js +0 -55
- package/reducers/form.d.ts +0 -9
- package/reducers/form.js +0 -66
- package/reducers/index.d.ts +0 -13
- package/reducers/index.js +0 -41
- package/reducers/list.d.ts +0 -12
- package/reducers/list.js +0 -143
- package/reducers/modal.d.ts +0 -12
- package/reducers/modal.js +0 -78
- package/reducers/notifications.d.ts +0 -10
- package/reducers/notifications.js +0 -44
- package/reducers/router.d.ts +0 -62
- package/reducers/router.js +0 -221
- package/reducers/screen.d.ts +0 -26
- package/reducers/screen.js +0 -54
- package/ui/crud/Crud/Crud.d.ts +0 -85
- package/ui/crud/Crud/Crud.js +0 -359
- package/ui/crud/Crud/CrudDetail.d.ts +0 -2
- package/ui/crud/Crud/CrudDetail.js +0 -14
- package/ui/crud/Crud/CrudForm.d.ts +0 -3
- package/ui/crud/Crud/CrudForm.js +0 -49
- package/ui/crud/Crud/CrudGrid.d.ts +0 -3
- package/ui/crud/Crud/CrudGrid.js +0 -46
- package/ui/crud/Crud/demo/default.d.ts +0 -8
- package/ui/crud/Crud/demo/default.js +0 -72
- package/ui/crud/Crud/index.js +0 -7
- package/ui/crud/index.d.ts +0 -31
- package/ui/crud/index.js +0 -29
- package/ui/form/AutoCompleteField/AutoCompleteField.d.ts +0 -44
- package/ui/form/AutoCompleteField/AutoCompleteField.js +0 -109
- package/ui/form/AutoCompleteField/demo/basic.d.ts +0 -12
- package/ui/form/AutoCompleteField/demo/basic.js +0 -48
- package/ui/form/AutoCompleteField/demo/disabled.d.ts +0 -8
- package/ui/form/AutoCompleteField/demo/disabled.js +0 -34
- package/ui/form/AutoCompleteField/demo/errors.d.ts +0 -3
- package/ui/form/AutoCompleteField/demo/errors.js +0 -29
- package/ui/form/AutoCompleteField/demo/placeholder.d.ts +0 -8
- package/ui/form/AutoCompleteField/demo/placeholder.js +0 -34
- package/ui/form/AutoCompleteField/demo/required.d.ts +0 -8
- package/ui/form/AutoCompleteField/demo/required.js +0 -34
- package/ui/form/AutoCompleteField/demo/sizes.d.ts +0 -8
- package/ui/form/AutoCompleteField/demo/sizes.js +0 -39
- package/ui/form/AutoCompleteField/index.js +0 -7
- package/ui/form/BlankField/BlankField.d.ts +0 -8
- package/ui/form/BlankField/BlankField.js +0 -30
- package/ui/form/BlankField/index.js +0 -7
- package/ui/form/Button/Button.d.ts +0 -190
- package/ui/form/Button/Button.js +0 -146
- package/ui/form/Button/demo/badge.d.ts +0 -8
- package/ui/form/Button/demo/badge.js +0 -33
- package/ui/form/Button/demo/block.d.ts +0 -8
- package/ui/form/Button/demo/block.js +0 -33
- package/ui/form/Button/demo/colors.d.ts +0 -8
- package/ui/form/Button/demo/colors.js +0 -45
- package/ui/form/Button/demo/disabled.d.ts +0 -8
- package/ui/form/Button/demo/disabled.js +0 -33
- package/ui/form/Button/demo/icon.d.ts +0 -8
- package/ui/form/Button/demo/icon.js +0 -33
- package/ui/form/Button/demo/link.d.ts +0 -8
- package/ui/form/Button/demo/link.js +0 -33
- package/ui/form/Button/demo/sizes.d.ts +0 -8
- package/ui/form/Button/demo/sizes.js +0 -37
- package/ui/form/Button/demo/tags.d.ts +0 -8
- package/ui/form/Button/demo/tags.js +0 -34
- package/ui/form/Button/index.d.ts +0 -1
- package/ui/form/Button/index.js +0 -12
- package/ui/form/CheckboxField/CheckboxField.d.ts +0 -39
- package/ui/form/CheckboxField/CheckboxField.js +0 -37
- package/ui/form/CheckboxField/demo/basic.d.ts +0 -8
- package/ui/form/CheckboxField/demo/basic.js +0 -33
- package/ui/form/CheckboxField/demo/disabled.d.ts +0 -8
- package/ui/form/CheckboxField/demo/disabled.js +0 -33
- package/ui/form/CheckboxField/demo/errors.d.ts +0 -8
- package/ui/form/CheckboxField/demo/errors.js +0 -33
- package/ui/form/CheckboxField/demo/required.d.ts +0 -8
- package/ui/form/CheckboxField/demo/required.js +0 -33
- package/ui/form/CheckboxField/index.js +0 -7
- package/ui/form/CheckboxListField/CheckboxListField.d.ts +0 -49
- package/ui/form/CheckboxListField/CheckboxListField.js +0 -57
- package/ui/form/CheckboxListField/demo/basic.d.ts +0 -9
- package/ui/form/CheckboxListField/demo/basic.js +0 -39
- package/ui/form/CheckboxListField/demo/disabled.d.ts +0 -8
- package/ui/form/CheckboxListField/demo/disabled.js +0 -34
- package/ui/form/CheckboxListField/demo/errors.d.ts +0 -3
- package/ui/form/CheckboxListField/demo/errors.js +0 -29
- package/ui/form/CheckboxListField/demo/required.d.ts +0 -3
- package/ui/form/CheckboxListField/demo/required.js +0 -29
- package/ui/form/CheckboxListField/index.js +0 -7
- package/ui/form/DateField/DateField.d.ts +0 -61
- package/ui/form/DateField/DateField.js +0 -84
- package/ui/form/DateField/demo/basic.d.ts +0 -3
- package/ui/form/DateField/demo/basic.js +0 -28
- package/ui/form/DateField/demo/disabled.d.ts +0 -3
- package/ui/form/DateField/demo/disabled.js +0 -28
- package/ui/form/DateField/demo/errors.d.ts +0 -3
- package/ui/form/DateField/demo/errors.js +0 -28
- package/ui/form/DateField/demo/icon.d.ts +0 -3
- package/ui/form/DateField/demo/icon.js +0 -30
- package/ui/form/DateField/demo/placeholder.d.ts +0 -3
- package/ui/form/DateField/demo/placeholder.js +0 -28
- package/ui/form/DateField/demo/required.d.ts +0 -3
- package/ui/form/DateField/demo/required.js +0 -28
- package/ui/form/DateField/demo/sizes.d.ts +0 -3
- package/ui/form/DateField/demo/sizes.js +0 -34
- package/ui/form/DateField/index.js +0 -7
- package/ui/form/DateTimeField/DateTimeField.d.ts +0 -59
- package/ui/form/DateTimeField/DateTimeField.js +0 -103
- package/ui/form/DateTimeField/demo/basic.d.ts +0 -3
- package/ui/form/DateTimeField/demo/basic.js +0 -28
- package/ui/form/DateTimeField/demo/disabled.d.ts +0 -3
- package/ui/form/DateTimeField/demo/disabled.js +0 -29
- package/ui/form/DateTimeField/demo/errors.d.ts +0 -3
- package/ui/form/DateTimeField/demo/errors.js +0 -28
- package/ui/form/DateTimeField/demo/icon.d.ts +0 -3
- package/ui/form/DateTimeField/demo/icon.js +0 -30
- package/ui/form/DateTimeField/demo/placeholder.d.ts +0 -3
- package/ui/form/DateTimeField/demo/placeholder.js +0 -32
- package/ui/form/DateTimeField/demo/required.d.ts +0 -3
- package/ui/form/DateTimeField/demo/required.js +0 -28
- package/ui/form/DateTimeField/demo/sizes.d.ts +0 -3
- package/ui/form/DateTimeField/demo/sizes.js +0 -34
- package/ui/form/DateTimeField/index.js +0 -7
- package/ui/form/DropDownField/DropDownField.d.ts +0 -73
- package/ui/form/DropDownField/DropDownField.js +0 -108
- package/ui/form/DropDownField/demo/auto-complete.d.ts +0 -3
- package/ui/form/DropDownField/demo/auto-complete.js +0 -29
- package/ui/form/DropDownField/demo/basic.d.ts +0 -7
- package/ui/form/DropDownField/demo/basic.js +0 -47
- package/ui/form/DropDownField/demo/disabled.d.ts +0 -3
- package/ui/form/DropDownField/demo/disabled.js +0 -29
- package/ui/form/DropDownField/demo/errors.d.ts +0 -3
- package/ui/form/DropDownField/demo/errors.js +0 -29
- package/ui/form/DropDownField/demo/multiple.d.ts +0 -3
- package/ui/form/DropDownField/demo/multiple.js +0 -29
- package/ui/form/DropDownField/demo/no-border.d.ts +0 -3
- package/ui/form/DropDownField/demo/no-border.js +0 -29
- package/ui/form/DropDownField/demo/placeholder.d.ts +0 -3
- package/ui/form/DropDownField/demo/placeholder.js +0 -29
- package/ui/form/DropDownField/demo/required.d.ts +0 -3
- package/ui/form/DropDownField/demo/required.js +0 -29
- package/ui/form/DropDownField/demo/show-reset.d.ts +0 -3
- package/ui/form/DropDownField/demo/show-reset.js +0 -29
- package/ui/form/DropDownField/demo/size.d.ts +0 -3
- package/ui/form/DropDownField/demo/size.js +0 -36
- package/ui/form/DropDownField/index.js +0 -7
- package/ui/form/Field/Field.d.ts +0 -27
- package/ui/form/Field/Field.js +0 -66
- package/ui/form/Field/fieldWrapper.d.ts +0 -81
- package/ui/form/Field/fieldWrapper.js +0 -106
- package/ui/form/Field/index.js +0 -7
- package/ui/form/FieldLayout/FieldLayout.d.ts +0 -56
- package/ui/form/FieldLayout/FieldLayout.js +0 -57
- package/ui/form/FieldLayout/demo/default.d.ts +0 -3
- package/ui/form/FieldLayout/demo/default.js +0 -28
- package/ui/form/FieldLayout/demo/errors.d.ts +0 -3
- package/ui/form/FieldLayout/demo/errors.js +0 -28
- package/ui/form/FieldLayout/demo/hint.d.ts +0 -3
- package/ui/form/FieldLayout/demo/hint.js +0 -28
- package/ui/form/FieldLayout/demo/horizontal.d.ts +0 -3
- package/ui/form/FieldLayout/demo/horizontal.js +0 -28
- package/ui/form/FieldLayout/demo/inline.d.ts +0 -3
- package/ui/form/FieldLayout/demo/inline.js +0 -29
- package/ui/form/FieldLayout/demo/required.d.ts +0 -3
- package/ui/form/FieldLayout/demo/required.js +0 -28
- package/ui/form/FieldLayout/index.js +0 -7
- package/ui/form/FieldList/FieldList.d.ts +0 -127
- package/ui/form/FieldList/FieldList.js +0 -112
- package/ui/form/FieldList/demo/basic.d.ts +0 -3
- package/ui/form/FieldList/demo/basic.js +0 -53
- package/ui/form/FieldList/index.js +0 -7
- package/ui/form/FieldList/tableNavigationHandler.d.ts +0 -3
- package/ui/form/FieldList/tableNavigationHandler.js +0 -48
- package/ui/form/FieldSet/FieldSet.d.ts +0 -37
- package/ui/form/FieldSet/FieldSet.js +0 -88
- package/ui/form/FieldSet/demo/basic.d.ts +0 -3
- package/ui/form/FieldSet/demo/basic.js +0 -44
- package/ui/form/FieldSet/index.js +0 -7
- package/ui/form/FileField/FileField.d.ts +0 -96
- package/ui/form/FileField/FileField.js +0 -108
- package/ui/form/FileField/index.js +0 -7
- package/ui/form/Form/AutoSaveHelper.d.ts +0 -6
- package/ui/form/Form/AutoSaveHelper.js +0 -37
- package/ui/form/Form/Form.d.ts +0 -173
- package/ui/form/Form/Form.js +0 -273
- package/ui/form/Form/SyncAddressBarHelper.d.ts +0 -13
- package/ui/form/Form/SyncAddressBarHelper.js +0 -119
- package/ui/form/Form/demo/basic.d.ts +0 -3
- package/ui/form/Form/demo/basic.js +0 -53
- package/ui/form/Form/index.js +0 -7
- package/ui/form/HtmlField/HtmlField.d.ts +0 -52
- package/ui/form/HtmlField/HtmlField.js +0 -57
- package/ui/form/HtmlField/demo/basic.d.ts +0 -3
- package/ui/form/HtmlField/demo/basic.js +0 -28
- package/ui/form/HtmlField/index.js +0 -7
- package/ui/form/InputField/InputField.d.ts +0 -95
- package/ui/form/InputField/InputField.js +0 -64
- package/ui/form/InputField/demo/addons.d.ts +0 -8
- package/ui/form/InputField/demo/addons.js +0 -33
- package/ui/form/InputField/demo/basic.d.ts +0 -8
- package/ui/form/InputField/demo/basic.js +0 -33
- package/ui/form/InputField/demo/disabled.d.ts +0 -8
- package/ui/form/InputField/demo/disabled.js +0 -33
- package/ui/form/InputField/demo/errors.d.ts +0 -8
- package/ui/form/InputField/demo/errors.js +0 -33
- package/ui/form/InputField/demo/mask.d.ts +0 -8
- package/ui/form/InputField/demo/mask.js +0 -35
- package/ui/form/InputField/demo/placeholder.d.ts +0 -8
- package/ui/form/InputField/demo/placeholder.js +0 -33
- package/ui/form/InputField/demo/required.d.ts +0 -8
- package/ui/form/InputField/demo/required.js +0 -33
- package/ui/form/InputField/demo/sizes.d.ts +0 -8
- package/ui/form/InputField/demo/sizes.js +0 -38
- package/ui/form/InputField/demo/textAddons.d.ts +0 -8
- package/ui/form/InputField/demo/textAddons.js +0 -33
- package/ui/form/InputField/demo/types.d.ts +0 -8
- package/ui/form/InputField/demo/types.js +0 -40
- package/ui/form/InputField/index.js +0 -7
- package/ui/form/NavField/NavField.d.ts +0 -21
- package/ui/form/NavField/NavField.js +0 -48
- package/ui/form/NavField/demo/basic.d.ts +0 -7
- package/ui/form/NavField/demo/basic.js +0 -47
- package/ui/form/NavField/demo/disabled.d.ts +0 -3
- package/ui/form/NavField/demo/disabled.js +0 -29
- package/ui/form/NavField/demo/errors.d.ts +0 -3
- package/ui/form/NavField/demo/errors.js +0 -29
- package/ui/form/NavField/demo/required.d.ts +0 -3
- package/ui/form/NavField/demo/required.js +0 -29
- package/ui/form/NavField/index.js +0 -7
- package/ui/form/NumberField/NumberField.d.ts +0 -45
- package/ui/form/NumberField/NumberField.js +0 -35
- package/ui/form/NumberField/demo/basic.d.ts +0 -8
- package/ui/form/NumberField/demo/basic.js +0 -33
- package/ui/form/NumberField/demo/disabled.d.ts +0 -8
- package/ui/form/NumberField/demo/disabled.js +0 -33
- package/ui/form/NumberField/demo/errors.d.ts +0 -8
- package/ui/form/NumberField/demo/errors.js +0 -33
- package/ui/form/NumberField/demo/placeholder.d.ts +0 -8
- package/ui/form/NumberField/demo/placeholder.js +0 -33
- package/ui/form/NumberField/demo/required.d.ts +0 -8
- package/ui/form/NumberField/demo/required.js +0 -33
- package/ui/form/NumberField/demo/sizes.d.ts +0 -8
- package/ui/form/NumberField/demo/sizes.js +0 -38
- package/ui/form/NumberField/index.js +0 -7
- package/ui/form/PasswordField/PasswordField.d.ts +0 -39
- package/ui/form/PasswordField/PasswordField.js +0 -66
- package/ui/form/PasswordField/demo/basic.d.ts +0 -8
- package/ui/form/PasswordField/demo/basic.js +0 -33
- package/ui/form/PasswordField/demo/disabled.d.ts +0 -8
- package/ui/form/PasswordField/demo/disabled.js +0 -33
- package/ui/form/PasswordField/demo/errors.d.ts +0 -8
- package/ui/form/PasswordField/demo/errors.js +0 -33
- package/ui/form/PasswordField/demo/placeholder.d.ts +0 -8
- package/ui/form/PasswordField/demo/placeholder.js +0 -33
- package/ui/form/PasswordField/demo/required.d.ts +0 -8
- package/ui/form/PasswordField/demo/required.js +0 -33
- package/ui/form/PasswordField/demo/security.d.ts +0 -8
- package/ui/form/PasswordField/demo/security.js +0 -33
- package/ui/form/PasswordField/demo/sizes.d.ts +0 -8
- package/ui/form/PasswordField/demo/sizes.js +0 -38
- package/ui/form/PasswordField/index.js +0 -7
- package/ui/form/RadioListField/RadioListField.d.ts +0 -47
- package/ui/form/RadioListField/RadioListField.js +0 -50
- package/ui/form/RadioListField/demo/basic.d.ts +0 -7
- package/ui/form/RadioListField/demo/basic.js +0 -47
- package/ui/form/RadioListField/demo/disabled.d.ts +0 -3
- package/ui/form/RadioListField/demo/disabled.js +0 -29
- package/ui/form/RadioListField/demo/errors.d.ts +0 -3
- package/ui/form/RadioListField/demo/errors.js +0 -29
- package/ui/form/RadioListField/demo/required.d.ts +0 -3
- package/ui/form/RadioListField/demo/required.js +0 -29
- package/ui/form/RadioListField/index.js +0 -7
- package/ui/form/RateField/RateField.d.ts +0 -32
- package/ui/form/RateField/RateField.js +0 -50
- package/ui/form/RateField/demo/base.d.ts +0 -3
- package/ui/form/RateField/demo/base.js +0 -28
- package/ui/form/RateField/index.d.ts +0 -2
- package/ui/form/RateField/index.js +0 -7
- package/ui/form/ReCaptchaField/ReCaptchaField.d.ts +0 -20
- package/ui/form/ReCaptchaField/ReCaptchaField.js +0 -31
- package/ui/form/ReCaptchaField/index.js +0 -7
- package/ui/form/SliderField/SliderField.d.ts +0 -48
- package/ui/form/SliderField/SliderField.js +0 -45
- package/ui/form/SliderField/demo/basic.d.ts +0 -3
- package/ui/form/SliderField/demo/basic.js +0 -28
- package/ui/form/SliderField/demo/disabled.d.ts +0 -3
- package/ui/form/SliderField/demo/disabled.js +0 -28
- package/ui/form/SliderField/demo/errors.d.ts +0 -3
- package/ui/form/SliderField/demo/errors.js +0 -28
- package/ui/form/SliderField/demo/required.d.ts +0 -3
- package/ui/form/SliderField/demo/required.js +0 -28
- package/ui/form/SliderField/demo/size.d.ts +0 -3
- package/ui/form/SliderField/demo/size.js +0 -33
- package/ui/form/SliderField/index.js +0 -7
- package/ui/form/SwitcherField/SwitcherField.d.ts +0 -38
- package/ui/form/SwitcherField/SwitcherField.js +0 -62
- package/ui/form/SwitcherField/demo/basic.d.ts +0 -7
- package/ui/form/SwitcherField/demo/basic.js +0 -47
- package/ui/form/SwitcherField/demo/disabled.d.ts +0 -3
- package/ui/form/SwitcherField/demo/disabled.js +0 -29
- package/ui/form/SwitcherField/demo/errors.d.ts +0 -3
- package/ui/form/SwitcherField/demo/errors.js +0 -29
- package/ui/form/SwitcherField/demo/required.d.ts +0 -3
- package/ui/form/SwitcherField/demo/required.js +0 -29
- package/ui/form/SwitcherField/demo/sizes.d.ts +0 -3
- package/ui/form/SwitcherField/demo/sizes.js +0 -35
- package/ui/form/SwitcherField/index.js +0 -7
- package/ui/form/TextField/TextField.d.ts +0 -50
- package/ui/form/TextField/TextField.js +0 -48
- package/ui/form/TextField/demo/basic.d.ts +0 -3
- package/ui/form/TextField/demo/basic.js +0 -28
- package/ui/form/TextField/demo/disabled.d.ts +0 -3
- package/ui/form/TextField/demo/disabled.js +0 -28
- package/ui/form/TextField/demo/errors.d.ts +0 -3
- package/ui/form/TextField/demo/errors.js +0 -28
- package/ui/form/TextField/demo/placeholder.d.ts +0 -3
- package/ui/form/TextField/demo/placeholder.js +0 -28
- package/ui/form/TextField/demo/required.d.ts +0 -3
- package/ui/form/TextField/demo/required.js +0 -28
- package/ui/form/TextField/demo/sizes.d.ts +0 -3
- package/ui/form/TextField/demo/sizes.js +0 -33
- package/ui/form/TextField/demo/submit.d.ts +0 -3
- package/ui/form/TextField/demo/submit.js +0 -28
- package/ui/form/TextField/index.js +0 -7
- package/ui/form/TimeField/TimeField.d.ts +0 -70
- package/ui/form/TimeField/TimeField.js +0 -123
- package/ui/form/TimeField/demo/basic.d.ts +0 -3
- package/ui/form/TimeField/demo/basic.js +0 -28
- package/ui/form/TimeField/demo/disabled.d.ts +0 -3
- package/ui/form/TimeField/demo/disabled.js +0 -28
- package/ui/form/TimeField/demo/errors.d.ts +0 -3
- package/ui/form/TimeField/demo/errors.js +0 -28
- package/ui/form/TimeField/demo/placeholder.d.ts +0 -3
- package/ui/form/TimeField/demo/placeholder.js +0 -28
- package/ui/form/TimeField/demo/required.d.ts +0 -3
- package/ui/form/TimeField/demo/required.js +0 -28
- package/ui/form/TimeField/demo/sizes.d.ts +0 -3
- package/ui/form/TimeField/demo/sizes.js +0 -33
- package/ui/form/TimeField/index.js +0 -7
- package/ui/form/index.d.ts +0 -84
- package/ui/form/index.js +0 -74
- package/ui/form/validate.d.ts +0 -5
- package/ui/form/validate.js +0 -97
- package/ui/format/BooleanFormatter/BooleanFormatter.d.ts +0 -11
- package/ui/format/BooleanFormatter/BooleanFormatter.js +0 -9
- package/ui/format/BooleanFormatter/index.js +0 -7
- package/ui/format/DateFormatter/DateFormatter.d.ts +0 -15
- package/ui/format/DateFormatter/DateFormatter.js +0 -16
- package/ui/format/DateFormatter/demo/basic.d.ts +0 -3
- package/ui/format/DateFormatter/demo/basic.js +0 -28
- package/ui/format/DateFormatter/index.js +0 -7
- package/ui/format/DateTimeFormatter/DateTimeFormatter.d.ts +0 -27
- package/ui/format/DateTimeFormatter/DateTimeFormatter.js +0 -23
- package/ui/format/DateTimeFormatter/demo/basic.d.ts +0 -3
- package/ui/format/DateTimeFormatter/demo/basic.js +0 -28
- package/ui/format/DateTimeFormatter/index.js +0 -7
- package/ui/format/EnumFormatter/EnumFormatter.d.ts +0 -23
- package/ui/format/EnumFormatter/EnumFormatter.js +0 -36
- package/ui/format/EnumFormatter/index.js +0 -7
- package/ui/format/FileSize/FileSize.d.ts +0 -17
- package/ui/format/FileSize/FileSize.js +0 -36
- package/ui/format/FileSize/index.js +0 -7
- package/ui/format/Format/Format.d.ts +0 -12
- package/ui/format/Format/Format.js +0 -49
- package/ui/format/Format/index.js +0 -7
- package/ui/format/MoneyFormatter/MoneyFormatter.d.ts +0 -29
- package/ui/format/MoneyFormatter/MoneyFormatter.js +0 -33
- package/ui/format/MoneyFormatter/index.js +0 -7
- package/ui/format/index.d.ts +0 -16
- package/ui/format/index.js +0 -26
- package/ui/icon/Icon/Icon.d.ts +0 -46
- package/ui/icon/Icon/Icon.js +0 -47
- package/ui/icon/Icon/index.d.ts +0 -2
- package/ui/icon/Icon/index.js +0 -7
- package/ui/layout/Header/Header.d.ts +0 -23
- package/ui/layout/Header/Header.js +0 -7
- package/ui/layout/Header/index.js +0 -7
- package/ui/layout/Loader/Loader.d.ts +0 -5
- package/ui/layout/Loader/Loader.js +0 -7
- package/ui/layout/Loader/index.js +0 -7
- package/ui/layout/Notifications/Notifications.d.ts +0 -45
- package/ui/layout/Notifications/Notifications.js +0 -86
- package/ui/layout/Notifications/index.js +0 -7
- package/ui/layout/Portal.d.ts +0 -1
- package/ui/layout/Portal.js +0 -26
- package/ui/layout/Tooltip/Tooltip.d.ts +0 -63
- package/ui/layout/Tooltip/Tooltip.js +0 -114
- package/ui/layout/Tooltip/TooltipPortalInner.d.ts +0 -6
- package/ui/layout/Tooltip/TooltipPortalInner.js +0 -64
- package/ui/layout/Tooltip/calculate.d.ts +0 -6
- package/ui/layout/Tooltip/calculate.js +0 -162
- package/ui/layout/Tooltip/demo/basic.d.ts +0 -3
- package/ui/layout/Tooltip/demo/basic.js +0 -41
- package/ui/layout/Tooltip/index.js +0 -7
- package/ui/layout/index.d.ts +0 -5
- package/ui/layout/index.js +0 -14
- package/ui/list/CheckboxColumn/CheckboxColumn.d.ts +0 -36
- package/ui/list/CheckboxColumn/CheckboxColumn.js +0 -34
- package/ui/list/CheckboxColumn/demo/basic.d.ts +0 -8
- package/ui/list/CheckboxColumn/demo/basic.js +0 -43
- package/ui/list/CheckboxColumn/index.js +0 -7
- package/ui/list/ControlsColumn/ControlsColumn.d.ts +0 -37
- package/ui/list/ControlsColumn/ControlsColumn.js +0 -30
- package/ui/list/ControlsColumn/demo/basic.d.ts +0 -8
- package/ui/list/ControlsColumn/demo/basic.js +0 -36
- package/ui/list/ControlsColumn/index.js +0 -7
- package/ui/list/Empty/Empty.d.ts +0 -38
- package/ui/list/Empty/Empty.js +0 -54
- package/ui/list/Empty/demo/basic.d.ts +0 -3
- package/ui/list/Empty/demo/basic.js +0 -28
- package/ui/list/Empty/demo/custom-text.d.ts +0 -3
- package/ui/list/Empty/demo/custom-text.js +0 -28
- package/ui/list/Empty/index.js +0 -7
- package/ui/list/Grid/Grid.d.ts +0 -108
- package/ui/list/Grid/Grid.js +0 -123
- package/ui/list/Grid/demo/basic.d.ts +0 -18
- package/ui/list/Grid/demo/basic.js +0 -68
- package/ui/list/Grid/demo/controls.d.ts +0 -8
- package/ui/list/Grid/demo/controls.js +0 -40
- package/ui/list/Grid/demo/empty.d.ts +0 -8
- package/ui/list/Grid/demo/empty.js +0 -34
- package/ui/list/Grid/demo/formatter.d.ts +0 -8
- package/ui/list/Grid/demo/formatter.js +0 -63
- package/ui/list/Grid/demo/indexing.d.ts +0 -8
- package/ui/list/Grid/demo/indexing.js +0 -48
- package/ui/list/Grid/demo/inner-search-form.d.ts +0 -21
- package/ui/list/Grid/demo/inner-search-form.js +0 -56
- package/ui/list/Grid/demo/load-more.d.ts +0 -8
- package/ui/list/Grid/demo/load-more.js +0 -39
- package/ui/list/Grid/demo/pagination.d.ts +0 -8
- package/ui/list/Grid/demo/pagination.js +0 -37
- package/ui/list/Grid/demo/search-form.d.ts +0 -8
- package/ui/list/Grid/demo/search-form.js +0 -46
- package/ui/list/Grid/demo/sort.d.ts +0 -8
- package/ui/list/Grid/demo/sort.js +0 -44
- package/ui/list/Grid/demo/visible.d.ts +0 -8
- package/ui/list/Grid/demo/visible.js +0 -48
- package/ui/list/Grid/index.js +0 -7
- package/ui/list/LayoutNames/LayoutNames.d.ts +0 -58
- package/ui/list/LayoutNames/LayoutNames.js +0 -68
- package/ui/list/LayoutNames/demo/basic.d.ts +0 -7
- package/ui/list/LayoutNames/demo/basic.js +0 -12
- package/ui/list/LayoutNames/index.d.ts +0 -2
- package/ui/list/LayoutNames/index.js +0 -7
- package/ui/list/List/List.d.ts +0 -47
- package/ui/list/List/List.js +0 -82
- package/ui/list/List/demo/basic.d.ts +0 -12
- package/ui/list/List/demo/basic.js +0 -57
- package/ui/list/List/demo/condition.d.ts +0 -8
- package/ui/list/List/demo/condition.js +0 -86
- package/ui/list/List/demo/empty.d.ts +0 -8
- package/ui/list/List/demo/empty.js +0 -32
- package/ui/list/List/demo/layout.d.ts +0 -8
- package/ui/list/List/demo/layout.js +0 -45
- package/ui/list/List/demo/load-more.d.ts +0 -8
- package/ui/list/List/demo/load-more.js +0 -41
- package/ui/list/List/demo/pagination.d.ts +0 -8
- package/ui/list/List/demo/pagination.js +0 -41
- package/ui/list/List/demo/search-form.d.ts +0 -30
- package/ui/list/List/demo/search-form.js +0 -103
- package/ui/list/List/demo/sort.d.ts +0 -17
- package/ui/list/List/demo/sort.js +0 -88
- package/ui/list/List/index.js +0 -7
- package/ui/list/Pagination/Pagination.d.ts +0 -86
- package/ui/list/Pagination/Pagination.js +0 -120
- package/ui/list/Pagination/demo/basic.d.ts +0 -3
- package/ui/list/Pagination/demo/basic.js +0 -36
- package/ui/list/Pagination/demo/load-more.d.ts +0 -3
- package/ui/list/Pagination/demo/load-more.js +0 -33
- package/ui/list/Pagination/demo/sizes.d.ts +0 -3
- package/ui/list/Pagination/demo/sizes.js +0 -38
- package/ui/list/Pagination/index.js +0 -7
- package/ui/list/PaginationSize/PaginationSize.d.ts +0 -69
- package/ui/list/PaginationSize/PaginationSize.js +0 -76
- package/ui/list/PaginationSize/demo/basic.d.ts +0 -3
- package/ui/list/PaginationSize/demo/basic.js +0 -32
- package/ui/list/PaginationSize/demo/size.d.ts +0 -3
- package/ui/list/PaginationSize/demo/size.js +0 -40
- package/ui/list/PaginationSize/index.js +0 -7
- package/ui/list/SearchForm/SearchForm.d.ts +0 -13
- package/ui/list/SearchForm/SearchForm.js +0 -55
- package/ui/list/SearchForm/demo/basic.d.ts +0 -8
- package/ui/list/SearchForm/demo/basic.js +0 -35
- package/ui/list/SearchForm/index.d.ts +0 -2
- package/ui/list/SearchForm/index.js +0 -7
- package/ui/modal/Modal/Modal.d.ts +0 -74
- package/ui/modal/Modal/Modal.js +0 -44
- package/ui/modal/Modal/demo/basic.d.ts +0 -8
- package/ui/modal/Modal/demo/basic.js +0 -60
- package/ui/modal/Modal/index.js +0 -7
- package/ui/modal/ModalPortal/ModalPortal.d.ts +0 -12
- package/ui/modal/ModalPortal/ModalPortal.js +0 -77
- package/ui/modal/ModalPortal/index.js +0 -7
- package/ui/modal/TwoFactorModal/TwoFactorModal.d.ts +0 -22
- package/ui/modal/TwoFactorModal/TwoFactorModal.js +0 -56
- package/ui/modal/TwoFactorModal/index.js +0 -7
- package/ui/nav/Breadcrumbs/Breadcrumbs.d.ts +0 -9
- package/ui/nav/Breadcrumbs/Breadcrumbs.js +0 -22
- package/ui/nav/Breadcrumbs/index.js +0 -7
- package/ui/nav/Controls/Controls.d.ts +0 -38
- package/ui/nav/Controls/Controls.js +0 -55
- package/ui/nav/Controls/index.js +0 -7
- package/ui/nav/Link/Link.d.ts +0 -7
- package/ui/nav/Link/Link.js +0 -41
- package/ui/nav/Link/index.js +0 -7
- package/ui/nav/Nav/Nav.d.ts +0 -106
- package/ui/nav/Nav/Nav.js +0 -104
- package/ui/nav/Nav/demo/basic.d.ts +0 -3
- package/ui/nav/Nav/demo/basic.js +0 -29
- package/ui/nav/Nav/demo/buttons.d.ts +0 -8
- package/ui/nav/Nav/demo/buttons.js +0 -50
- package/ui/nav/Nav/demo/links.d.ts +0 -3
- package/ui/nav/Nav/demo/links.js +0 -30
- package/ui/nav/Nav/demo/navbar.d.ts +0 -3
- package/ui/nav/Nav/demo/navbar.js +0 -46
- package/ui/nav/Nav/demo/tabs.d.ts +0 -3
- package/ui/nav/Nav/demo/tabs.js +0 -30
- package/ui/nav/Nav/index.js +0 -7
- package/ui/nav/Router/ConnectedRouter.d.ts +0 -14
- package/ui/nav/Router/ConnectedRouter.js +0 -103
- package/ui/nav/Router/Router.d.ts +0 -49
- package/ui/nav/Router/Router.js +0 -224
- package/ui/nav/Router/SsrProvider.d.ts +0 -15
- package/ui/nav/Router/SsrProvider.js +0 -55
- package/ui/nav/Router/index.js +0 -7
- package/ui/nav/Tree/Tree.d.ts +0 -43
- package/ui/nav/Tree/Tree.js +0 -168
- package/ui/nav/Tree/demo/level-tree-routes.d.ts +0 -3
- package/ui/nav/Tree/demo/level-tree-routes.js +0 -28
- package/ui/nav/Tree/demo/level-tree.d.ts +0 -3
- package/ui/nav/Tree/demo/level-tree.js +0 -61
- package/ui/nav/Tree/index.js +0 -7
- package/ui/nav/index.js +0 -14
- package/utils/collection.d.ts +0 -1
- package/utils/collection.js +0 -19
- package/utils/data.d.ts +0 -9
- package/utils/data.js +0 -159
- package/utils/form.d.ts +0 -39
- package/utils/form.js +0 -172
- package/utils/query.d.ts +0 -1
- package/utils/query.js +0 -46
- package/utils/text.d.ts +0 -1
- package/utils/text.js +0 -85
package/reducers/list.ts
ADDED
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import _get from 'lodash-es/get';
|
|
2
|
+
import _isMatch from 'lodash-es/isMatch';
|
|
3
|
+
import _every from 'lodash-es/every';
|
|
4
|
+
import _extend from 'lodash-es/extend';
|
|
5
|
+
import {
|
|
6
|
+
LIST_INIT,
|
|
7
|
+
LIST_BEFORE_FETCH,
|
|
8
|
+
LIST_AFTER_FETCH,
|
|
9
|
+
LIST_ITEM_ADD,
|
|
10
|
+
LIST_ITEM_UPDATE,
|
|
11
|
+
LIST_DESTROY,
|
|
12
|
+
LIST_TOGGLE_ITEM,
|
|
13
|
+
LIST_TOGGLE_ALL,
|
|
14
|
+
LIST_SET_LAYOUT
|
|
15
|
+
} from '../actions/list';
|
|
16
|
+
|
|
17
|
+
const initialState = {
|
|
18
|
+
lists: {},
|
|
19
|
+
selectedIds: {}
|
|
20
|
+
};
|
|
21
|
+
export default (state = initialState, action) => {
|
|
22
|
+
switch (action.type) {
|
|
23
|
+
case LIST_INIT:
|
|
24
|
+
return {
|
|
25
|
+
...state,
|
|
26
|
+
lists: {
|
|
27
|
+
...state.lists,
|
|
28
|
+
[action.payload.listId]: {
|
|
29
|
+
meta: {},
|
|
30
|
+
total: action.payload.total || (action.payload.items ? action.payload.items.length : 0),
|
|
31
|
+
isFetched: !!action.payload.items,
|
|
32
|
+
isLoading: false,
|
|
33
|
+
...action.payload,
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
case LIST_BEFORE_FETCH:
|
|
39
|
+
return {
|
|
40
|
+
...state,
|
|
41
|
+
lists: {
|
|
42
|
+
...state.lists,
|
|
43
|
+
[action.listId]: {
|
|
44
|
+
...state.lists[action.listId],
|
|
45
|
+
isLoading: true
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
case LIST_AFTER_FETCH:
|
|
51
|
+
let items;
|
|
52
|
+
const list = state.lists[action.listId];
|
|
53
|
+
if (list && list.items && list.loadMore && action.page > 1) {
|
|
54
|
+
items = [].concat(list.items);
|
|
55
|
+
action.items.forEach((entry, i) => {
|
|
56
|
+
const index = (action.page - 1) * action.pageSize + i;
|
|
57
|
+
items[index] = entry;
|
|
58
|
+
});
|
|
59
|
+
} else {
|
|
60
|
+
items = [].concat(action.items);
|
|
61
|
+
}
|
|
62
|
+
return {
|
|
63
|
+
...state,
|
|
64
|
+
lists: {
|
|
65
|
+
...state.lists,
|
|
66
|
+
[action.listId]: {
|
|
67
|
+
...list,
|
|
68
|
+
...action,
|
|
69
|
+
items,
|
|
70
|
+
isFetched: true,
|
|
71
|
+
isLoading: false
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
case LIST_ITEM_ADD:
|
|
77
|
+
if (state.lists[action.listId]) {
|
|
78
|
+
return {
|
|
79
|
+
...state,
|
|
80
|
+
lists: {
|
|
81
|
+
...state.lists,
|
|
82
|
+
[action.listId]: {
|
|
83
|
+
...state.lists[action.listId],
|
|
84
|
+
items: action.prepend
|
|
85
|
+
? []
|
|
86
|
+
.concat(action.item)
|
|
87
|
+
.concat(state.lists[action.listId].items)
|
|
88
|
+
: []
|
|
89
|
+
.concat(state.lists[action.listId].items)
|
|
90
|
+
.concat(action.item)
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
break;
|
|
96
|
+
|
|
97
|
+
case LIST_ITEM_UPDATE:
|
|
98
|
+
return {
|
|
99
|
+
...state,
|
|
100
|
+
lists: {
|
|
101
|
+
...state.lists,
|
|
102
|
+
[action.listId]: {
|
|
103
|
+
...state.lists[action.listId],
|
|
104
|
+
items: state.lists[action.listId].items.map(item => {
|
|
105
|
+
if (_isMatch(item, action.condition)) {
|
|
106
|
+
item = _extend({}, item, action.item);
|
|
107
|
+
}
|
|
108
|
+
return item;
|
|
109
|
+
})
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
case LIST_DESTROY:
|
|
115
|
+
delete state.lists[action.listId];
|
|
116
|
+
return {
|
|
117
|
+
...state,
|
|
118
|
+
lists: {
|
|
119
|
+
...state.lists
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
case LIST_TOGGLE_ITEM:
|
|
124
|
+
const selectedIds = _get(state, ['selectedIds', action.listId]) || [];
|
|
125
|
+
const index = selectedIds.indexOf(action.itemId);
|
|
126
|
+
if (index === -1) {
|
|
127
|
+
selectedIds.push(action.itemId);
|
|
128
|
+
} else {
|
|
129
|
+
selectedIds.splice(index, 1);
|
|
130
|
+
}
|
|
131
|
+
return {
|
|
132
|
+
...state,
|
|
133
|
+
selectedIds: {
|
|
134
|
+
...state.selectedIds,
|
|
135
|
+
[action.listId]: [].concat(selectedIds)
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
case LIST_TOGGLE_ALL:
|
|
140
|
+
const list4 = state.lists[action.listId];
|
|
141
|
+
if (list4) {
|
|
142
|
+
const ids = list4.items.map(item => item[list4.primaryKey]) || [];
|
|
143
|
+
const isAll =
|
|
144
|
+
state.selectedIds[action.listId] &&
|
|
145
|
+
_every(ids.map(id => state.selectedIds[action.listId].includes(id)));
|
|
146
|
+
return {
|
|
147
|
+
...state,
|
|
148
|
+
selectedIds: {
|
|
149
|
+
...state.selectedIds,
|
|
150
|
+
[action.listId]: isAll ? [] : ids
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
break;
|
|
155
|
+
|
|
156
|
+
case LIST_SET_LAYOUT:
|
|
157
|
+
return {
|
|
158
|
+
...state,
|
|
159
|
+
lists: {
|
|
160
|
+
...state.lists,
|
|
161
|
+
[action.listId]: {
|
|
162
|
+
...state.lists[action.listId],
|
|
163
|
+
layoutName: action.layoutName
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
return state;
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
export const isListInitialized = (state, listId) => !!_get(state, ['list', 'lists', listId]);
|
|
172
|
+
export const getList = (state, listId) => _get(state, ['list', 'lists', listId]) || null;
|
|
173
|
+
export const getIds = (state, listId) => {
|
|
174
|
+
const list = getList(state, listId);
|
|
175
|
+
return (
|
|
176
|
+
(list && list.items && list.items.map(item => item[list.primaryKey])) || []
|
|
177
|
+
);
|
|
178
|
+
};
|
|
179
|
+
export const getListItems = (state, listId) => _get(state, ['list', 'lists', listId, 'items']);
|
|
180
|
+
export const getCheckedIds = (state, listId) => {
|
|
181
|
+
return _get(state, ['list', 'selectedIds', listId]) || [];
|
|
182
|
+
};
|
|
183
|
+
export const isChecked = (state, listId, itemId) =>
|
|
184
|
+
getCheckedIds(state, listId).includes(itemId);
|
|
185
|
+
export const isCheckedAll = (state, listId) => {
|
|
186
|
+
const selectedIds = getCheckedIds(state, listId);
|
|
187
|
+
return (
|
|
188
|
+
selectedIds.length > 0 &&
|
|
189
|
+
_every(getIds(state, listId).map(id => selectedIds.includes(id)))
|
|
190
|
+
);
|
|
191
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import _get from 'lodash-es/get';
|
|
2
|
+
import {MODAL_OPEN, MODAL_CLOSE, MODAL_MARK_CLOSING} from '../actions/modal';
|
|
3
|
+
|
|
4
|
+
export const MODAL_DEFAULT_GROUP = 'modal';
|
|
5
|
+
|
|
6
|
+
const initialState = {
|
|
7
|
+
opened: {}
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export default (state = initialState, action) => {
|
|
11
|
+
switch (action.type) {
|
|
12
|
+
case MODAL_OPEN:
|
|
13
|
+
return (() => {
|
|
14
|
+
const group = action.group || MODAL_DEFAULT_GROUP;
|
|
15
|
+
const items = _get(state, ['opened', group]) || [];
|
|
16
|
+
const index = items.findIndex(item => item.id === action.id);
|
|
17
|
+
if (index !== -1) {
|
|
18
|
+
items[index].props = {
|
|
19
|
+
...items[index].props,
|
|
20
|
+
...action.props,
|
|
21
|
+
};
|
|
22
|
+
} else {
|
|
23
|
+
items.push({
|
|
24
|
+
id: action.id,
|
|
25
|
+
modal: action.modal,
|
|
26
|
+
props: action.props,
|
|
27
|
+
isClosing: false,
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return {
|
|
32
|
+
opened: {
|
|
33
|
+
...state.opened,
|
|
34
|
+
[group]: [].concat(items),
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
38
|
+
|
|
39
|
+
case MODAL_MARK_CLOSING:
|
|
40
|
+
return (() => {
|
|
41
|
+
const group = action.group || MODAL_DEFAULT_GROUP;
|
|
42
|
+
const items = _get(state, ['opened', group]) || [];
|
|
43
|
+
const index = items.findIndex(item => item.id === action.id);
|
|
44
|
+
if (index !== -1) {
|
|
45
|
+
items[index] = {
|
|
46
|
+
...items[index],
|
|
47
|
+
isClosing: true,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
return {
|
|
51
|
+
opened: {
|
|
52
|
+
...state.opened,
|
|
53
|
+
[group]: [].concat(items),
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
})();
|
|
57
|
+
|
|
58
|
+
case MODAL_CLOSE:
|
|
59
|
+
return (() => {
|
|
60
|
+
const group = action.group || MODAL_DEFAULT_GROUP;
|
|
61
|
+
const items = _get(state, ['opened', group]) || [];
|
|
62
|
+
const index = items.findIndex(item => item.id === action.id);
|
|
63
|
+
if (index !== -1) {
|
|
64
|
+
items.splice(index, 1);
|
|
65
|
+
}
|
|
66
|
+
return {
|
|
67
|
+
opened: {
|
|
68
|
+
...state.opened,
|
|
69
|
+
[group]: [].concat(items),
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
})();
|
|
73
|
+
|
|
74
|
+
default:
|
|
75
|
+
return state;
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
export const getOpened = (state, group = MODAL_DEFAULT_GROUP) => _get(state, ['modal', 'opened', group]) || null;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import {
|
|
2
|
+
NOTIFICATIONS_SHOW,
|
|
3
|
+
NOTIFICATIONS_CLOSING,
|
|
4
|
+
NOTIFICATIONS_CLOSE
|
|
5
|
+
} from '../actions/notifications';
|
|
6
|
+
|
|
7
|
+
const initialState = {
|
|
8
|
+
items: [],
|
|
9
|
+
position: ''
|
|
10
|
+
};
|
|
11
|
+
export default (state = initialState, action) => {
|
|
12
|
+
switch (action.type) {
|
|
13
|
+
case NOTIFICATIONS_SHOW:
|
|
14
|
+
return {
|
|
15
|
+
...state,
|
|
16
|
+
items: []
|
|
17
|
+
.concat(state.items)
|
|
18
|
+
.concat([
|
|
19
|
+
{
|
|
20
|
+
id: action.id,
|
|
21
|
+
level: action.level || 'info',
|
|
22
|
+
message: action.message,
|
|
23
|
+
isClosing: false,
|
|
24
|
+
position: action.position
|
|
25
|
+
}
|
|
26
|
+
]),
|
|
27
|
+
position: action.position
|
|
28
|
+
};
|
|
29
|
+
case NOTIFICATIONS_CLOSE:
|
|
30
|
+
return {
|
|
31
|
+
...state,
|
|
32
|
+
items: state.items.filter(item => item.id !== action.id)
|
|
33
|
+
};
|
|
34
|
+
default:
|
|
35
|
+
return state;
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
export const getNotifications = state => state.notifications.items;
|
|
39
|
+
export const getPosition = state => state.notifications.position;
|
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import {parse, compile} from 'path-to-regexp';
|
|
3
|
+
import {matchPath} from 'react-router';
|
|
4
|
+
import * as queryString from 'qs';
|
|
5
|
+
import _get from 'lodash-es/get';
|
|
6
|
+
import _isEmpty from 'lodash-es/isEmpty';
|
|
7
|
+
import _pick from 'lodash-es/pick';
|
|
8
|
+
import _isArray from 'lodash-es/isArray';
|
|
9
|
+
import _isObject from 'lodash-es/isObject';
|
|
10
|
+
import _isFunction from 'lodash-es/isFunction';
|
|
11
|
+
import {
|
|
12
|
+
ROUTER_INIT_ROUTES,
|
|
13
|
+
ROUTER_SET_PARAMS,
|
|
14
|
+
ROUTER_ADD_CONFIGS,
|
|
15
|
+
ROUTER_REMOVE_CONFIGS,
|
|
16
|
+
ROUTER_SET_DATA,
|
|
17
|
+
getConfigId,
|
|
18
|
+
} from '../actions/router';
|
|
19
|
+
|
|
20
|
+
export interface IRoute {
|
|
21
|
+
id?: string,
|
|
22
|
+
title?: string,
|
|
23
|
+
label?: string,
|
|
24
|
+
icon?: string,
|
|
25
|
+
exact?: boolean,
|
|
26
|
+
strict?: boolean,
|
|
27
|
+
path?: string,
|
|
28
|
+
redirectTo?: string,
|
|
29
|
+
isVisible?: boolean,
|
|
30
|
+
isNavVisible?: boolean,
|
|
31
|
+
component?: React.ReactNode,
|
|
32
|
+
componentProps?: object,
|
|
33
|
+
roles?: string[],
|
|
34
|
+
items?: IRoute[],
|
|
35
|
+
[key: string]: any,
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
interface IRouterInitialState {
|
|
39
|
+
location: {
|
|
40
|
+
pathname: string,
|
|
41
|
+
search: string,
|
|
42
|
+
hash: string,
|
|
43
|
+
query: object,
|
|
44
|
+
},
|
|
45
|
+
routesTree: IRoute,
|
|
46
|
+
routesMap: {[key: string]: IRoute},
|
|
47
|
+
activeIds: string[],
|
|
48
|
+
match: {
|
|
49
|
+
path: string,
|
|
50
|
+
url: string,
|
|
51
|
+
isExact: string,
|
|
52
|
+
params: object,
|
|
53
|
+
},
|
|
54
|
+
|
|
55
|
+
params: object,
|
|
56
|
+
configs: any,
|
|
57
|
+
data: object,
|
|
58
|
+
counters: object,
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const initialState = {
|
|
62
|
+
location: null,
|
|
63
|
+
routesTree: null,
|
|
64
|
+
routesMap: null,
|
|
65
|
+
activeIds: null,
|
|
66
|
+
currentId: null,
|
|
67
|
+
match: null,
|
|
68
|
+
|
|
69
|
+
params: {},
|
|
70
|
+
configs: [],
|
|
71
|
+
data: {},
|
|
72
|
+
counters: {}
|
|
73
|
+
} as IRouterInitialState;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Generate url for route by path and params
|
|
77
|
+
* @param path
|
|
78
|
+
* @param params
|
|
79
|
+
*/
|
|
80
|
+
export const buildUrl = (path, params = null) => {
|
|
81
|
+
// Get url
|
|
82
|
+
let url = path;
|
|
83
|
+
let pathKeys = [];
|
|
84
|
+
try {
|
|
85
|
+
pathKeys = parse(path)
|
|
86
|
+
.slice(1)
|
|
87
|
+
.map((p: any) => p.name);
|
|
88
|
+
url = compile(path)({
|
|
89
|
+
...params,
|
|
90
|
+
});
|
|
91
|
+
} catch (e) {
|
|
92
|
+
// eslint-disable-line no-empty
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// Append params, which keys is not included in path keys
|
|
96
|
+
const queryObj = {};
|
|
97
|
+
Object.keys(params || {})
|
|
98
|
+
.filter(key => !pathKeys.includes(key))
|
|
99
|
+
.forEach(key => {
|
|
100
|
+
queryObj[key] = params[key];
|
|
101
|
+
});
|
|
102
|
+
const query = queryString.stringify(queryObj);
|
|
103
|
+
if (!_isEmpty(query) && url) {
|
|
104
|
+
url = url + (url.indexOf('?') !== -1 ? '&' : '?') + query;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
return url;
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Normalize routes tree (convert object structure to items[])
|
|
112
|
+
*/
|
|
113
|
+
const normalizeRoutes = (state, item: IRoute, activeIds: string[], routesMap: object) => {
|
|
114
|
+
let items = null;
|
|
115
|
+
if (_isArray(item.items)) {
|
|
116
|
+
items = item.items.map(subItem => normalizeRoutes(state, subItem, activeIds, routesMap));
|
|
117
|
+
} else if (_isObject(item.items)) {
|
|
118
|
+
items = Object.keys(item.items).map(id => normalizeRoutes(state, {...item.items[id], id}, activeIds, routesMap));
|
|
119
|
+
}
|
|
120
|
+
const normalizedItem = {
|
|
121
|
+
...item,
|
|
122
|
+
id: item.id,
|
|
123
|
+
title: item.title || item.title === '' ? item.title : item.label,
|
|
124
|
+
label: item.label || item.label === '' ? item.label : item.title,
|
|
125
|
+
icon: item.icon || null,
|
|
126
|
+
exact: !!item.exact,
|
|
127
|
+
strict: !!item.strict,
|
|
128
|
+
path: item.path || '',
|
|
129
|
+
isVisible: item.isVisible !== false,
|
|
130
|
+
isNavVisible: item.isNavVisible !== false,
|
|
131
|
+
component: null, // Do not store component class in redux
|
|
132
|
+
componentProps: null,
|
|
133
|
+
roles: item.roles || [],
|
|
134
|
+
items,
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
routesMap[normalizedItem.id] = normalizedItem;
|
|
138
|
+
if (checkIsActive(state, normalizedItem)) {
|
|
139
|
+
activeIds.push(normalizedItem.id);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
return normalizedItem;
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Return true, if item is 'active' - opened current route or it children
|
|
147
|
+
*/
|
|
148
|
+
const checkIsActive = (state, item) => {
|
|
149
|
+
// Check is active
|
|
150
|
+
const pathname = location.protocol === 'file:'
|
|
151
|
+
? location.hash.replace(/^#/, '')
|
|
152
|
+
: _get(state, 'location.pathname');
|
|
153
|
+
const checkActive = (pathname, item) => {
|
|
154
|
+
const match = matchPath(pathname, _pick(item, ['exact', 'strict', 'path']));
|
|
155
|
+
return !!(match || (item.items || []).find(sub => checkActive(pathname, sub)));
|
|
156
|
+
};
|
|
157
|
+
return checkActive(pathname, item);
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Find route in routes tree
|
|
162
|
+
*/
|
|
163
|
+
const findRecursive = (item: IRoute, predicate: string | any, pathItems: IRoute[] | null = null): IRoute | null => {
|
|
164
|
+
if ((_isFunction(predicate) && predicate(item)) || predicate === item.id) {
|
|
165
|
+
if (pathItems) {
|
|
166
|
+
pathItems.push(item);
|
|
167
|
+
}
|
|
168
|
+
return item;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
const finedItem = (item.items || []).find(subItem => findRecursive(subItem, predicate, pathItems)) || null;
|
|
172
|
+
if (finedItem && pathItems) {
|
|
173
|
+
pathItems.push(item);
|
|
174
|
+
}
|
|
175
|
+
return finedItem;
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
const getMatch = (currentRoute, state) => {
|
|
179
|
+
const match = currentRoute
|
|
180
|
+
? matchPath(String(state.location.pathname), _pick(currentRoute, ['id', 'exact', 'strict', 'path']))
|
|
181
|
+
: null;
|
|
182
|
+
|
|
183
|
+
return match && {
|
|
184
|
+
...match,
|
|
185
|
+
params: {
|
|
186
|
+
...state.location.query,
|
|
187
|
+
...match.params,
|
|
188
|
+
},
|
|
189
|
+
};
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
export default (state = initialState, action) => {
|
|
193
|
+
switch (action.type) {
|
|
194
|
+
case ROUTER_INIT_ROUTES:
|
|
195
|
+
const routesMap = {};
|
|
196
|
+
const activeIds = [];
|
|
197
|
+
const routesTree = normalizeRoutes(state, action.routes, activeIds, routesMap);
|
|
198
|
+
const currentRoute = activeIds.length > 0 ? routesMap[activeIds[0]] : null;
|
|
199
|
+
return {
|
|
200
|
+
...state,
|
|
201
|
+
routesTree,
|
|
202
|
+
routesMap,
|
|
203
|
+
activeIds,
|
|
204
|
+
match: getMatch(currentRoute, state),
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
case '@@router/LOCATION_CHANGE':
|
|
208
|
+
return (() => {
|
|
209
|
+
const activeIds = Object.keys(state.routesMap).filter(id => checkIsActive(state, state.routesMap[id]));
|
|
210
|
+
const currentRoute = activeIds.length > 0 ? state.routesMap[activeIds[0]] : null;
|
|
211
|
+
return {
|
|
212
|
+
...state,
|
|
213
|
+
activeIds,
|
|
214
|
+
match: getMatch(currentRoute, state),
|
|
215
|
+
};
|
|
216
|
+
})();
|
|
217
|
+
|
|
218
|
+
case ROUTER_SET_PARAMS:
|
|
219
|
+
return {
|
|
220
|
+
...state,
|
|
221
|
+
params: {
|
|
222
|
+
...state.params,
|
|
223
|
+
...state.location.query,
|
|
224
|
+
...action.params
|
|
225
|
+
}
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
case ROUTER_ADD_CONFIGS:
|
|
229
|
+
const configs = [].concat(state.configs || []);
|
|
230
|
+
const counters = {...state.counters};
|
|
231
|
+
action.configs.forEach(config => {
|
|
232
|
+
const id = getConfigId(config);
|
|
233
|
+
if (counters[id]) {
|
|
234
|
+
counters[id]++;
|
|
235
|
+
} else {
|
|
236
|
+
counters[id] = 1;
|
|
237
|
+
configs.push(config);
|
|
238
|
+
}
|
|
239
|
+
});
|
|
240
|
+
return {
|
|
241
|
+
...state,
|
|
242
|
+
configs,
|
|
243
|
+
counters
|
|
244
|
+
};
|
|
245
|
+
|
|
246
|
+
case ROUTER_REMOVE_CONFIGS:
|
|
247
|
+
let configs2 = [].concat(state.configs);
|
|
248
|
+
const counters2 = {...state.counters};
|
|
249
|
+
let data = {...state.data};
|
|
250
|
+
action.configs.forEach(config => {
|
|
251
|
+
const id = getConfigId(config);
|
|
252
|
+
if (counters2[id]) {
|
|
253
|
+
counters2[id]--;
|
|
254
|
+
if (counters2[id] <= 0) {
|
|
255
|
+
configs2 = configs2.filter(item => getConfigId(item) !== id);
|
|
256
|
+
delete data[id];
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
});
|
|
260
|
+
return {
|
|
261
|
+
...state,
|
|
262
|
+
data,
|
|
263
|
+
configs: configs2,
|
|
264
|
+
counters: counters2
|
|
265
|
+
};
|
|
266
|
+
|
|
267
|
+
case ROUTER_SET_DATA:
|
|
268
|
+
return {
|
|
269
|
+
...state,
|
|
270
|
+
data: {
|
|
271
|
+
...state.data,
|
|
272
|
+
[getConfigId(action.config)]: action.data
|
|
273
|
+
}
|
|
274
|
+
};
|
|
275
|
+
}
|
|
276
|
+
return state;
|
|
277
|
+
};
|
|
278
|
+
|
|
279
|
+
/*
|
|
280
|
+
Changes from version v1 -> v2
|
|
281
|
+
|
|
282
|
+
isInitialized -> isRouterInitialized
|
|
283
|
+
getBreadcrumbs -> getRouteBreadcrumbs
|
|
284
|
+
getNavItem -> getRoute
|
|
285
|
+
getNavUrl -> getRoute + buildNavItem
|
|
286
|
+
getCurrentRoute -> getRoute
|
|
287
|
+
getCurrentItem -> getRoute
|
|
288
|
+
getCurrentItemParam -> getRouteProp
|
|
289
|
+
getNavItems -> getRouteChildren
|
|
290
|
+
getParentRoute -> getRouteParent
|
|
291
|
+
*/
|
|
292
|
+
|
|
293
|
+
export const isRouterInitialized = state => !!state.router.routesTree;
|
|
294
|
+
export const getRouterParams = state => _get(state.router, 'params');
|
|
295
|
+
export const getActiveRouteIds = state => _get(state.router, 'activeIds') || null;
|
|
296
|
+
export const getRoutesMap = state => _get(state.router, 'routesMap') || null;
|
|
297
|
+
export const getRouteId = state => _get(state.router, 'activeIds.0') || null;
|
|
298
|
+
export const getRoute = (state, routeId = null) => _get(state.router, ['routesMap', routeId || getRouteId(state)]) || null;
|
|
299
|
+
export const getRouteProp = (state, routeId = null, param) => _get(getRoute(state, routeId), param) || null;
|
|
300
|
+
export const getRouteParams = state => _get(state.router, 'match.params') || null;
|
|
301
|
+
export const getRouteParam = (state, param) => _get(getRouteParams(state), param) || null;
|
|
302
|
+
export const getRouteBreadcrumbs = (state, routeId = null): IRoute[] => {
|
|
303
|
+
const items = [];
|
|
304
|
+
findRecursive(state.router.routesTree, routeId, items);
|
|
305
|
+
return items.reverse().filter(item => item.isVisible !== false && item.isNavVisible !== false);
|
|
306
|
+
};
|
|
307
|
+
export const getRouteChildren = (state, routeId = null) => {
|
|
308
|
+
const route = getRoute(state, routeId);
|
|
309
|
+
return route && route.items || null;
|
|
310
|
+
|
|
311
|
+
};
|
|
312
|
+
export const getRouteParent = (state, routeId = null, level = 1) => {
|
|
313
|
+
const route = getRoute(state, routeId);
|
|
314
|
+
const breadcrumbs = route ? getRouteBreadcrumbs(state, route.id) : [];
|
|
315
|
+
return breadcrumbs.length > level + 1
|
|
316
|
+
? breadcrumbs[breadcrumbs.length - (level + 1)]
|
|
317
|
+
: null;
|
|
318
|
+
};
|
|
319
|
+
export const getNavItems = (state, routeId, level = 1) => {
|
|
320
|
+
// TODO levels...
|
|
321
|
+
return getRouteChildren(state, routeId);
|
|
322
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import {SCREEN_SET_WIDTH, SCREEN_SET_MEDIA} from '../actions/screen';
|
|
2
|
+
|
|
3
|
+
export const SCREE_PHONE = 'phone';
|
|
4
|
+
export const SCREEN_TABLET = 'tablet';
|
|
5
|
+
export const SCREEN_DESKTOP = 'desktop';
|
|
6
|
+
const initialState = {
|
|
7
|
+
width: 1280,
|
|
8
|
+
media: {
|
|
9
|
+
[SCREE_PHONE]: 320,
|
|
10
|
+
[SCREEN_TABLET]: 768,
|
|
11
|
+
[SCREEN_DESKTOP]: 1024
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
export default (state = initialState, action) => {
|
|
15
|
+
switch (action.type) {
|
|
16
|
+
case SCREEN_SET_WIDTH:
|
|
17
|
+
return {
|
|
18
|
+
...state,
|
|
19
|
+
width: action.width
|
|
20
|
+
};
|
|
21
|
+
case SCREEN_SET_MEDIA:
|
|
22
|
+
return {
|
|
23
|
+
...state,
|
|
24
|
+
media: {
|
|
25
|
+
...state.media,
|
|
26
|
+
...action.media
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
return state;
|
|
31
|
+
};
|
|
32
|
+
export const getDeviceType = state => {
|
|
33
|
+
if (state.screen.width < state.screen.media[SCREEN_TABLET]) {
|
|
34
|
+
return SCREE_PHONE;
|
|
35
|
+
}
|
|
36
|
+
if (state.screen.width < state.screen.media[SCREEN_DESKTOP]) {
|
|
37
|
+
return SCREEN_TABLET;
|
|
38
|
+
}
|
|
39
|
+
return SCREEN_DESKTOP;
|
|
40
|
+
};
|
|
41
|
+
export const isPhone = state => getDeviceType(state) === SCREE_PHONE;
|
|
42
|
+
export const isTablet = state => getDeviceType(state) === SCREEN_TABLET;
|
|
43
|
+
export const isDesktop = state => getDeviceType(state) === SCREEN_DESKTOP;
|