@homecode/ui 4.18.16 → 4.18.18
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/dist/esm/index.js +83 -2
- package/dist/esm/node_modules/style-inject/dist/style-inject.es.js +28 -2
- package/dist/esm/src/components/AssistiveText/AssistiveText.js +10 -2
- package/dist/esm/src/components/AssistiveText/AssistiveText.styl.js +7 -2
- package/dist/esm/src/components/Button/Button.helpers.js +12 -2
- package/dist/esm/src/components/Button/Button.js +38 -2
- package/dist/esm/src/components/Button/Button.styl.js +7 -2
- package/dist/esm/src/components/ButtonGroup/ButtonGroup.js +10 -2
- package/dist/esm/src/components/ButtonGroup/ButtonGroup.styl.js +7 -2
- package/dist/esm/src/components/Calendar/Calendar.helpers.js +65 -2
- package/dist/esm/src/components/Calendar/Calendar.js +66 -2
- package/dist/esm/src/components/Calendar/Calendar.styl.js +7 -2
- package/dist/esm/src/components/Checkbox/Checkbox.js +48 -2
- package/dist/esm/src/components/Checkbox/Checkbox.styl.js +7 -2
- package/dist/esm/src/components/Container/Container.js +12 -2
- package/dist/esm/src/components/Container/Container.styl.js +7 -2
- package/dist/esm/src/components/DatePicker/DatePicker.helpers.js +31 -2
- package/dist/esm/src/components/DatePicker/DatePicker.js +47 -2
- package/dist/esm/src/components/DatePicker/DatePicker.styl.js +7 -2
- package/dist/esm/src/components/DatePickerInput/DatePickerInput.js +20 -2
- package/dist/esm/src/components/DatePickerInput/DatePickerInput.styl.js +7 -2
- package/dist/esm/src/components/DateTime/DateTime.js +17 -2
- package/dist/esm/src/components/Draggable/Draggable.js +136 -2
- package/dist/esm/src/components/Draggable/Draggable.styl.js +7 -2
- package/dist/esm/src/components/Expand/Expand.js +24 -2
- package/dist/esm/src/components/Expand/Expand.styl.js +7 -2
- package/dist/esm/src/components/Form/Form.helpers.js +42 -2
- package/dist/esm/src/components/Form/Form.js +286 -2
- package/dist/esm/src/components/Form/Form.styl.js +7 -2
- package/dist/esm/src/components/Form/Form.types.js +0 -1
- package/dist/esm/src/components/Form/SubmitButtons/SubmitButtons.js +8 -2
- package/dist/esm/src/components/Form/SubmitButtons/SubmitButtons.styl.js +7 -2
- package/dist/esm/src/components/Form/Validator.js +24 -6
- package/dist/esm/src/components/Gallery/Dots/Dots.js +9 -2
- package/dist/esm/src/components/Gallery/Dots/Dots.styl.js +7 -2
- package/dist/esm/src/components/Gallery/Gallery.js +180 -2
- package/dist/esm/src/components/Gallery/Gallery.styl.js +7 -2
- package/dist/esm/src/components/Heading/Heading.js +37 -2
- package/dist/esm/src/components/Heading/Heading.styl.js +7 -2
- package/dist/esm/src/components/Icon/Icon.js +27 -2
- package/dist/esm/src/components/Icon/Icon.styl.js +7 -2
- package/dist/esm/src/components/Icon/icons/avatar.svg.js +15 -2
- package/dist/esm/src/components/Icon/icons/brokenImage.svg.js +15 -2
- package/dist/esm/src/components/Icon/icons/check.svg.js +19 -2
- package/dist/esm/src/components/Icon/icons/chevronDown.svg.js +20 -2
- package/dist/esm/src/components/Icon/icons/chevronLeft.svg.js +20 -2
- package/dist/esm/src/components/Icon/icons/chevronRight.svg.js +20 -2
- package/dist/esm/src/components/Icon/icons/chevronUp.svg.js +20 -2
- package/dist/esm/src/components/Icon/icons/close.svg.js +15 -2
- package/dist/esm/src/components/Icon/icons/colors.svg.js +60 -2
- package/dist/esm/src/components/Icon/icons/copy.svg.js +15 -2
- package/dist/esm/src/components/Icon/icons/delete.svg.js +15 -2
- package/dist/esm/src/components/Icon/icons/draft.svg.js +15 -2
- package/dist/esm/src/components/Icon/icons/edit.svg.js +15 -2
- package/dist/esm/src/components/Icon/icons/email.svg.js +15 -2
- package/dist/esm/src/components/Icon/icons/externalLink.svg.js +15 -2
- package/dist/esm/src/components/Icon/icons/eye.svg.js +15 -2
- package/dist/esm/src/components/Icon/icons/fullscreen.svg.js +15 -2
- package/dist/esm/src/components/Icon/icons/fullscreenExit.svg.js +15 -2
- package/dist/esm/src/components/Icon/icons/function.svg.js +15 -2
- package/dist/esm/src/components/Icon/icons/gear.svg.js +21 -2
- package/dist/esm/src/components/Icon/icons/group.svg.js +15 -2
- package/dist/esm/src/components/Icon/icons/history.svg.js +17 -2
- package/dist/esm/src/components/Icon/icons/home.svg.js +19 -2
- package/dist/esm/src/components/Icon/icons/index.js +46 -2
- package/dist/esm/src/components/Icon/icons/instagram.svg.js +15 -2
- package/dist/esm/src/components/Icon/icons/link.svg.js +15 -2
- package/dist/esm/src/components/Icon/icons/loader.svg.js +45 -2
- package/dist/esm/src/components/Icon/icons/menu.svg.js +18 -2
- package/dist/esm/src/components/Icon/icons/mic.svg.js +15 -2
- package/dist/esm/src/components/Icon/icons/minus.svg.js +15 -2
- package/dist/esm/src/components/Icon/icons/moreHorizontal.svg.js +15 -2
- package/dist/esm/src/components/Icon/icons/moreVertical.svg.js +15 -2
- package/dist/esm/src/components/Icon/icons/output.svg.js +15 -2
- package/dist/esm/src/components/Icon/icons/plus.svg.js +15 -2
- package/dist/esm/src/components/Icon/icons/redo.svg.js +15 -2
- package/dist/esm/src/components/Icon/icons/requiredStar.svg.js +15 -2
- package/dist/esm/src/components/Icon/icons/save.svg.js +17 -2
- package/dist/esm/src/components/Icon/icons/send.svg.js +16 -2
- package/dist/esm/src/components/Icon/icons/settings.svg.js +52 -2
- package/dist/esm/src/components/Icon/icons/shoppingBag.svg.js +17 -2
- package/dist/esm/src/components/Icon/icons/table.svg.js +15 -2
- package/dist/esm/src/components/Icon/icons/telegram.svg.js +19 -2
- package/dist/esm/src/components/Icon/icons/undo.svg.js +15 -2
- package/dist/esm/src/components/Input/Input.js +345 -2
- package/dist/esm/src/components/Input/Input.styl.js +7 -2
- package/dist/esm/src/components/InputFile/InputFile.js +295 -2
- package/dist/esm/src/components/InputFile/InputFile.styl.js +7 -2
- package/dist/esm/src/components/InputFile/InputFile.types.js +0 -1
- package/dist/esm/src/components/InputFile/Item/Item.js +18 -2
- package/dist/esm/src/components/InputFile/Item/Item.styl.js +7 -2
- package/dist/esm/src/components/Label/Label.constants.json.js +8 -2
- package/dist/esm/src/components/Label/Label.helpers.js +35 -2
- package/dist/esm/src/components/Label/Label.js +58 -2
- package/dist/esm/src/components/Label/Label.styl.js +7 -2
- package/dist/esm/src/components/Lazy/Lazy.js +65 -2
- package/dist/esm/src/components/LightBox/LightBox.js +28 -2
- package/dist/esm/src/components/LightBox/LightBox.styl.js +7 -2
- package/dist/esm/src/components/Notifications/Notifications.constants.json.js +6 -2
- package/dist/esm/src/components/Notifications/Notifications.js +67 -2
- package/dist/esm/src/components/Notifications/Notifications.styl.js +7 -2
- package/dist/esm/src/components/Notifications/store.js +62 -2
- package/dist/esm/src/components/Paranja/Paranja.js +14 -2
- package/dist/esm/src/components/Paranja/Paranja.styl.js +7 -2
- package/dist/esm/src/components/Popup/Popup.helpers.js +31 -2
- package/dist/esm/src/components/Popup/Popup.js +397 -2
- package/dist/esm/src/components/Popup/Popup.styl.js +7 -2
- package/dist/esm/src/components/PopupMenu/PopupMenu.js +15 -2
- package/dist/esm/src/components/PopupMenu/PopupMenu.styl.js +7 -2
- package/dist/esm/src/components/Portal/Portal.js +19 -2
- package/dist/esm/src/components/RequiredStar/RequiredStar.js +12 -2
- package/dist/esm/src/components/RequiredStar/RequiredStar.styl.js +7 -2
- package/dist/esm/src/components/Router/Link/Link.js +61 -2
- package/dist/esm/src/components/Router/Link/Link.styl.js +7 -2
- package/dist/esm/src/components/Router/Redirect.js +12 -2
- package/dist/esm/src/components/Router/Route.js +4 -2
- package/dist/esm/src/components/Router/Router.helpers.js +33 -2
- package/dist/esm/src/components/Router/Router.js +68 -2
- package/dist/esm/src/components/Router/context.js +5 -2
- package/dist/esm/src/components/Router/store.js +55 -2
- package/dist/esm/src/components/Scroll/Scroll.js +274 -2
- package/dist/esm/src/components/Scroll/Scroll.styl.js +7 -2
- package/dist/esm/src/components/Select/Select.helpers.js +37 -2
- package/dist/esm/src/components/Select/Select.js +585 -2
- package/dist/esm/src/components/Select/Select.styl.js +7 -2
- package/dist/esm/src/components/Spinner/Spinner.js +11 -2
- package/dist/esm/src/components/Spinner/Spinner.styl.js +7 -2
- package/dist/esm/src/components/Spinner/spinner.svg.js +24 -2
- package/dist/esm/src/components/Table/Table.js +24 -2
- package/dist/esm/src/components/Table/Table.styl.js +7 -2
- package/dist/esm/src/components/Tabs/Tabs.js +43 -2
- package/dist/esm/src/components/Tabs/Tabs.styl.js +7 -2
- package/dist/esm/src/components/Text/Text.js +44 -2
- package/dist/esm/src/components/Text/Text.styl.js +7 -2
- package/dist/esm/src/components/Theme/Theme.defaults.js +50 -2
- package/dist/esm/src/components/Theme/Theme.helpers.js +67 -2
- package/dist/esm/src/components/Theme/Theme.js +13 -2
- package/dist/esm/src/components/VH/VH.js +33 -2
- package/dist/esm/src/components/Virtualized/List/List.js +124 -2
- package/dist/esm/src/components/Virtualized/List/List.styl.js +7 -2
- package/dist/esm/src/components/Virtualized/List/ListScroll.js +21 -2
- package/dist/esm/src/components/Virtualized/List/ListScroll.styl.js +7 -2
- package/dist/esm/src/components/Virtualized/Virtualized.helpers.js +14 -2
- package/dist/esm/src/components/Virtualized/Virtualized.js +200 -2
- package/dist/esm/src/components/Virtualized/Virtualized.styl.js +7 -2
- package/dist/esm/src/components/Virtualized/Virtualized.types.js +0 -1
- package/dist/esm/src/services/i18n.js +68 -2
- package/dist/esm/src/tools/array.js +60 -2
- package/dist/esm/src/tools/config.js +9 -2
- package/dist/esm/src/tools/date.js +11 -2
- package/dist/esm/src/tools/debounce.js +11 -2
- package/dist/esm/src/tools/dom.js +46 -2
- package/dist/esm/src/tools/env.js +3 -2
- package/dist/esm/src/tools/file.js +11 -2
- package/dist/esm/src/tools/localStorage.js +31 -2
- package/dist/esm/src/tools/number.js +27 -2
- package/dist/esm/src/tools/object.js +5 -2
- package/dist/esm/src/tools/queryParams.js +20 -2
- package/dist/esm/src/tools/rangeMap.js +3 -2
- package/dist/esm/src/tools/resizeObserver.js +68 -2
- package/dist/esm/src/tools/scroll.js +41 -2
- package/dist/esm/src/tools/string.js +7 -2
- package/dist/esm/src/tools/throttle.js +30 -2
- package/dist/esm/src/tools/uid.js +7 -2
- package/dist/esm/types/src/components/Icon/Icon.d.ts +3 -9
- package/dist/esm/types/src/components/Icon/Icon.example.d.ts +1 -0
- package/package.json +1 -1
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/node_modules/style-inject/dist/style-inject.es.js.map +0 -1
- package/dist/esm/src/components/AssistiveText/AssistiveText.js.map +0 -1
- package/dist/esm/src/components/AssistiveText/AssistiveText.styl.js.map +0 -1
- package/dist/esm/src/components/Button/Button.helpers.js.map +0 -1
- package/dist/esm/src/components/Button/Button.js.map +0 -1
- package/dist/esm/src/components/Button/Button.styl.js.map +0 -1
- package/dist/esm/src/components/ButtonGroup/ButtonGroup.js.map +0 -1
- package/dist/esm/src/components/ButtonGroup/ButtonGroup.styl.js.map +0 -1
- package/dist/esm/src/components/Calendar/Calendar.helpers.js.map +0 -1
- package/dist/esm/src/components/Calendar/Calendar.js.map +0 -1
- package/dist/esm/src/components/Calendar/Calendar.styl.js.map +0 -1
- package/dist/esm/src/components/Checkbox/Checkbox.js.map +0 -1
- package/dist/esm/src/components/Checkbox/Checkbox.styl.js.map +0 -1
- package/dist/esm/src/components/Container/Container.js.map +0 -1
- package/dist/esm/src/components/Container/Container.styl.js.map +0 -1
- package/dist/esm/src/components/DatePicker/DatePicker.helpers.js.map +0 -1
- package/dist/esm/src/components/DatePicker/DatePicker.js.map +0 -1
- package/dist/esm/src/components/DatePicker/DatePicker.styl.js.map +0 -1
- package/dist/esm/src/components/DatePickerInput/DatePickerInput.js.map +0 -1
- package/dist/esm/src/components/DatePickerInput/DatePickerInput.styl.js.map +0 -1
- package/dist/esm/src/components/DateTime/DateTime.js.map +0 -1
- package/dist/esm/src/components/Draggable/Draggable.js.map +0 -1
- package/dist/esm/src/components/Draggable/Draggable.styl.js.map +0 -1
- package/dist/esm/src/components/Expand/Expand.js.map +0 -1
- package/dist/esm/src/components/Expand/Expand.styl.js.map +0 -1
- package/dist/esm/src/components/Form/Form.helpers.js.map +0 -1
- package/dist/esm/src/components/Form/Form.js.map +0 -1
- package/dist/esm/src/components/Form/Form.styl.js.map +0 -1
- package/dist/esm/src/components/Form/Form.types.js.map +0 -1
- package/dist/esm/src/components/Form/SubmitButtons/SubmitButtons.js.map +0 -1
- package/dist/esm/src/components/Form/SubmitButtons/SubmitButtons.styl.js.map +0 -1
- package/dist/esm/src/components/Form/Validator.js.map +0 -1
- package/dist/esm/src/components/Gallery/Dots/Dots.js.map +0 -1
- package/dist/esm/src/components/Gallery/Dots/Dots.styl.js.map +0 -1
- package/dist/esm/src/components/Gallery/Gallery.js.map +0 -1
- package/dist/esm/src/components/Gallery/Gallery.styl.js.map +0 -1
- package/dist/esm/src/components/Heading/Heading.js.map +0 -1
- package/dist/esm/src/components/Heading/Heading.styl.js.map +0 -1
- package/dist/esm/src/components/Icon/Icon.js.map +0 -1
- package/dist/esm/src/components/Icon/Icon.styl.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/avatar.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/brokenImage.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/check.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/chevronDown.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/chevronLeft.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/chevronRight.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/chevronUp.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/close.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/colors.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/copy.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/delete.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/draft.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/edit.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/email.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/externalLink.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/eye.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/fullscreen.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/fullscreenExit.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/function.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/gear.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/group.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/history.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/home.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/index.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/instagram.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/link.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/loader.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/menu.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/mic.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/minus.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/moreHorizontal.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/moreVertical.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/output.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/plus.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/redo.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/requiredStar.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/save.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/send.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/settings.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/shoppingBag.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/table.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/telegram.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/undo.svg.js.map +0 -1
- package/dist/esm/src/components/Input/Input.js.map +0 -1
- package/dist/esm/src/components/Input/Input.styl.js.map +0 -1
- package/dist/esm/src/components/InputFile/InputFile.js.map +0 -1
- package/dist/esm/src/components/InputFile/InputFile.styl.js.map +0 -1
- package/dist/esm/src/components/InputFile/InputFile.types.js.map +0 -1
- package/dist/esm/src/components/InputFile/Item/Item.js.map +0 -1
- package/dist/esm/src/components/InputFile/Item/Item.styl.js.map +0 -1
- package/dist/esm/src/components/Label/Label.constants.json.js.map +0 -1
- package/dist/esm/src/components/Label/Label.helpers.js.map +0 -1
- package/dist/esm/src/components/Label/Label.js.map +0 -1
- package/dist/esm/src/components/Label/Label.styl.js.map +0 -1
- package/dist/esm/src/components/Lazy/Lazy.js.map +0 -1
- package/dist/esm/src/components/LightBox/LightBox.js.map +0 -1
- package/dist/esm/src/components/LightBox/LightBox.styl.js.map +0 -1
- package/dist/esm/src/components/Notifications/Notifications.constants.json.js.map +0 -1
- package/dist/esm/src/components/Notifications/Notifications.js.map +0 -1
- package/dist/esm/src/components/Notifications/Notifications.styl.js.map +0 -1
- package/dist/esm/src/components/Notifications/store.js.map +0 -1
- package/dist/esm/src/components/Paranja/Paranja.js.map +0 -1
- package/dist/esm/src/components/Paranja/Paranja.styl.js.map +0 -1
- package/dist/esm/src/components/Popup/Popup.helpers.js.map +0 -1
- package/dist/esm/src/components/Popup/Popup.js.map +0 -1
- package/dist/esm/src/components/Popup/Popup.styl.js.map +0 -1
- package/dist/esm/src/components/PopupMenu/PopupMenu.js.map +0 -1
- package/dist/esm/src/components/PopupMenu/PopupMenu.styl.js.map +0 -1
- package/dist/esm/src/components/Portal/Portal.js.map +0 -1
- package/dist/esm/src/components/RequiredStar/RequiredStar.js.map +0 -1
- package/dist/esm/src/components/RequiredStar/RequiredStar.styl.js.map +0 -1
- package/dist/esm/src/components/Router/Link/Link.js.map +0 -1
- package/dist/esm/src/components/Router/Link/Link.styl.js.map +0 -1
- package/dist/esm/src/components/Router/Redirect.js.map +0 -1
- package/dist/esm/src/components/Router/Route.js.map +0 -1
- package/dist/esm/src/components/Router/Router.helpers.js.map +0 -1
- package/dist/esm/src/components/Router/Router.js.map +0 -1
- package/dist/esm/src/components/Router/context.js.map +0 -1
- package/dist/esm/src/components/Router/store.js.map +0 -1
- package/dist/esm/src/components/Scroll/Scroll.js.map +0 -1
- package/dist/esm/src/components/Scroll/Scroll.styl.js.map +0 -1
- package/dist/esm/src/components/Select/Select.helpers.js.map +0 -1
- package/dist/esm/src/components/Select/Select.js.map +0 -1
- package/dist/esm/src/components/Select/Select.styl.js.map +0 -1
- package/dist/esm/src/components/Spinner/Spinner.js.map +0 -1
- package/dist/esm/src/components/Spinner/Spinner.styl.js.map +0 -1
- package/dist/esm/src/components/Spinner/spinner.svg.js.map +0 -1
- package/dist/esm/src/components/Table/Table.js.map +0 -1
- package/dist/esm/src/components/Table/Table.styl.js.map +0 -1
- package/dist/esm/src/components/Tabs/Tabs.js.map +0 -1
- package/dist/esm/src/components/Tabs/Tabs.styl.js.map +0 -1
- package/dist/esm/src/components/Text/Text.js.map +0 -1
- package/dist/esm/src/components/Text/Text.styl.js.map +0 -1
- package/dist/esm/src/components/Theme/Theme.defaults.js.map +0 -1
- package/dist/esm/src/components/Theme/Theme.helpers.js.map +0 -1
- package/dist/esm/src/components/Theme/Theme.js.map +0 -1
- package/dist/esm/src/components/VH/VH.js.map +0 -1
- package/dist/esm/src/components/Virtualized/List/List.js.map +0 -1
- package/dist/esm/src/components/Virtualized/List/List.styl.js.map +0 -1
- package/dist/esm/src/components/Virtualized/List/ListScroll.js.map +0 -1
- package/dist/esm/src/components/Virtualized/List/ListScroll.styl.js.map +0 -1
- package/dist/esm/src/components/Virtualized/Virtualized.helpers.js.map +0 -1
- package/dist/esm/src/components/Virtualized/Virtualized.js.map +0 -1
- package/dist/esm/src/components/Virtualized/Virtualized.styl.js.map +0 -1
- package/dist/esm/src/components/Virtualized/Virtualized.types.js.map +0 -1
- package/dist/esm/src/services/i18n.js.map +0 -1
- package/dist/esm/src/tools/array.js.map +0 -1
- package/dist/esm/src/tools/config.js.map +0 -1
- package/dist/esm/src/tools/date.js.map +0 -1
- package/dist/esm/src/tools/debounce.js.map +0 -1
- package/dist/esm/src/tools/dom.js.map +0 -1
- package/dist/esm/src/tools/env.js.map +0 -1
- package/dist/esm/src/tools/file.js.map +0 -1
- package/dist/esm/src/tools/localStorage.js.map +0 -1
- package/dist/esm/src/tools/number.js.map +0 -1
- package/dist/esm/src/tools/object.js.map +0 -1
- package/dist/esm/src/tools/queryParams.js.map +0 -1
- package/dist/esm/src/tools/rangeMap.js.map +0 -1
- package/dist/esm/src/tools/resizeObserver.js.map +0 -1
- package/dist/esm/src/tools/scroll.js.map +0 -1
- package/dist/esm/src/tools/string.js.map +0 -1
- package/dist/esm/src/tools/throttle.js.map +0 -1
- package/dist/esm/src/tools/uid.js.map +0 -1
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
import styleInject from
|
|
2
|
-
|
|
1
|
+
import styleInject from '../../../node_modules/style-inject/dist/style-inject.es.js';
|
|
2
|
+
|
|
3
|
+
var css_248z = ".Popup_root__uQ-fP{display:inline-block;position:relative}.Popup_contentWrapper__2yi-2{pointer-events:none;position:absolute}.Popup_contentWrapper__2yi-2.Popup_inline__1-l1S.Popup_isOpen__BRIdP{position:relative}.Popup_contentWrapper__2yi-2:not(.Popup_inline__1-l1S),.Popup_contentWrapper__2yi-2:not(.Popup_inline__1-l1S)>.Popup_content__e8Qyu{position:absolute}.Popup_trigger__jQNaQ{cursor:pointer}.Popup_trigger__jQNaQ.Popup_isOpen__BRIdP{position:relative;z-index:11}.Popup_trigger__jQNaQ.Popup_disabled__DlE9y{opacity:.4;pointer-events:none}.Popup_content__e8Qyu{-webkit-backface-visibility:hidden;backface-visibility:hidden;background-color:var(--decent-color);box-shadow:inset 0 0 0 1px var(--accent-color-alpha-50);max-width:70vw;min-width:100%;opacity:0;overflow:hidden;pointer-events:none;position:relative;transform-origin:top center;z-index:11}.Popup_blur__1hfU8 .Popup_content__e8Qyu{-webkit-backdrop-filter:blur(50px);backdrop-filter:blur(50px);background-color:var(--decent-color-alpha-500)}.Popup_content__e8Qyu.Popup_size-s__UmixP{border-radius:4px}.Popup_content__e8Qyu.Popup_size-m__FYpTL{border-radius:6px}.Popup_content__e8Qyu.Popup_size-l__BTS57{border-radius:8px}.Popup_content__e8Qyu.Popup_elevation-1__vmP3e{box-shadow:inset 0 0 0 1px var(--accent-color-alpha-50),0 0 var(--indent-s) 2px var(--decent-color-alpha-500)}.Popup_content__e8Qyu.Popup_elevation-2__Ci4sI{box-shadow:inset 0 0 0 1px var(--accent-color-alpha-50),0 0 var(--indent-m) 2px var(--decent-color-alpha-500)}.Popup_content__e8Qyu.Popup_outlined__g3cJV:after{border-radius:inherit;bottom:0;content:\"\";left:0;pointer-events:none;position:absolute;right:0;top:0}.Popup_isOpen__BRIdP .Popup_content__e8Qyu{opacity:1;pointer-events:all;transform:scaleX(1)}.Popup_animating__kR0qF{transition:70ms ease-out;transition-property:transform,opacity,margin}.Popup_axis-top__BaLgG{bottom:100%}.Popup_axis-bottom__hZwwr{top:100%}.Popup_axis-right__LMYVy{left:100%}.Popup_axis-left__SFKm-{right:100%}.Popup_float-top__8SQAu{bottom:0}.Popup_float-right__mdm-3{left:0}.Popup_float-bottom__7flve{top:0}.Popup_float-left__tz7fX{right:0}.Popup_axis-bottom__hZwwr,.Popup_axis-top__BaLgG{transform:scaleY(.5)}.Popup_axis-bottom__hZwwr.Popup_float-middle__Dmnn1,.Popup_axis-top__BaLgG.Popup_float-middle__Dmnn1{left:50%;transform:translateX(-50%) scaleY(.5)}.Popup_isOpen__BRIdP .Popup_axis-bottom__hZwwr.Popup_float-middle__Dmnn1,.Popup_isOpen__BRIdP .Popup_axis-top__BaLgG.Popup_float-middle__Dmnn1{transform:translateX(-50%) scaleX(1)}.Popup_axis-left__SFKm-,.Popup_axis-right__LMYVy{transform:scaleX(.5)}.Popup_axis-left__SFKm-.Popup_float-middle__Dmnn1,.Popup_axis-right__LMYVy.Popup_float-middle__Dmnn1{top:50%;transform:translateY(-50%) scaleX(.5)}.Popup_isOpen__BRIdP .Popup_axis-left__SFKm-.Popup_float-middle__Dmnn1,.Popup_isOpen__BRIdP .Popup_axis-right__LMYVy.Popup_float-middle__Dmnn1{transform:translateY(-50%) scaleX(1)}.Popup_axis-top__BaLgG.Popup_float-middle__Dmnn1{transform-origin:bottom center}.Popup_axis-top__BaLgG.Popup_float-right__mdm-3{transform-origin:bottom left}.Popup_axis-top__BaLgG.Popup_float-left__tz7fX{transform-origin:bottom right}.Popup_axis-bottom__hZwwr.Popup_float-middle__Dmnn1{transform-origin:top center}.Popup_axis-bottom__hZwwr.Popup_float-right__mdm-3{transform-origin:top left}.Popup_axis-bottom__hZwwr.Popup_float-left__tz7fX{transform-origin:top right}.Popup_axis-right__LMYVy.Popup_float-middle__Dmnn1{transform-origin:center left}.Popup_axis-right__LMYVy.Popup_float-top__8SQAu{transform-origin:bottom left}.Popup_axis-right__LMYVy.Popup_float-bottom__7flve{transform-origin:top left}.Popup_axis-left__SFKm-.Popup_float-middle__Dmnn1{transform-origin:center right}.Popup_axis-left__SFKm-.Popup_float-top__8SQAu{transform-origin:bottom right}.Popup_axis-left__SFKm-.Popup_float-bottom__7flve{transform-origin:top right}";
|
|
4
|
+
var S = {"root":"Popup_root__uQ-fP","contentWrapper":"Popup_contentWrapper__2yi-2","inline":"Popup_inline__1-l1S","isOpen":"Popup_isOpen__BRIdP","content":"Popup_content__e8Qyu","trigger":"Popup_trigger__jQNaQ","disabled":"Popup_disabled__DlE9y","blur":"Popup_blur__1hfU8","size-s":"Popup_size-s__UmixP","size-m":"Popup_size-m__FYpTL","size-l":"Popup_size-l__BTS57","elevation-1":"Popup_elevation-1__vmP3e","elevation-2":"Popup_elevation-2__Ci4sI","outlined":"Popup_outlined__g3cJV","animating":"Popup_animating__kR0qF","axis-top":"Popup_axis-top__BaLgG","axis-bottom":"Popup_axis-bottom__hZwwr","axis-right":"Popup_axis-right__LMYVy","axis-left":"Popup_axis-left__SFKm-","float-top":"Popup_float-top__8SQAu","float-right":"Popup_float-right__mdm-3","float-bottom":"Popup_float-bottom__7flve","float-left":"Popup_float-left__tz7fX","float-middle":"Popup_float-middle__Dmnn1"};
|
|
5
|
+
styleInject(css_248z);
|
|
6
|
+
|
|
7
|
+
export { S as default };
|
|
@@ -1,2 +1,15 @@
|
|
|
1
|
-
import{jsx}from
|
|
2
|
-
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { createElement } from 'react';
|
|
3
|
+
import cn from 'classnames';
|
|
4
|
+
import { Button } from '../Button/Button.js';
|
|
5
|
+
import { Popup } from '../Popup/Popup.js';
|
|
6
|
+
import S from './PopupMenu.styl.js';
|
|
7
|
+
|
|
8
|
+
function PopupMenu({ items, onClose, ...props }) {
|
|
9
|
+
if (items.length === 0)
|
|
10
|
+
return null;
|
|
11
|
+
const { size } = props;
|
|
12
|
+
return (jsx(Popup, { ...props, content: jsx("div", { className: S.list, children: items.map(({ id, title, className, ...rest }) => (createElement(Button, { variant: "clear", size: size, ...rest, className: cn(S.item, className), key: id }, title))) }) }));
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export { PopupMenu };
|
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
import styleInject from
|
|
2
|
-
|
|
1
|
+
import styleInject from '../../../node_modules/style-inject/dist/style-inject.es.js';
|
|
2
|
+
|
|
3
|
+
var css_248z = ".PopupMenu_list__G7xP3{align-items:stretch;border-radius:inherit;display:flex;flex-direction:column;padding:2px}.PopupMenu_item__wxay-+.PopupMenu_item__wxay-{margin-top:2px}.PopupMenu_item__wxay-:first-child{border-top-left-radius:inherit;border-top-right-radius:inherit}.PopupMenu_item__wxay-:last-child{border-bottom-left-radius:inherit;border-bottom-right-radius:inherit}";
|
|
4
|
+
var S = {"list":"PopupMenu_list__G7xP3","item":"PopupMenu_item__wxay-"};
|
|
5
|
+
styleInject(css_248z);
|
|
6
|
+
|
|
7
|
+
export { S as default };
|
|
@@ -1,2 +1,19 @@
|
|
|
1
|
-
import{jsx,Fragment}from
|
|
2
|
-
|
|
1
|
+
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import { useState, useEffect } from 'react';
|
|
3
|
+
import { createPortal } from 'react-dom';
|
|
4
|
+
import { config } from '../../tools/config.js';
|
|
5
|
+
|
|
6
|
+
const DEFAULT_SELECTOR = `#${config.appOverlayId}`;
|
|
7
|
+
function Portal(props) {
|
|
8
|
+
const { selector = DEFAULT_SELECTOR, children } = props;
|
|
9
|
+
const [isMounted, setMounted] = useState(false);
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
// prevent HTML mismatch between server and client
|
|
12
|
+
setMounted(true);
|
|
13
|
+
}, []);
|
|
14
|
+
if (!isMounted)
|
|
15
|
+
return null;
|
|
16
|
+
return createPortal(jsx(Fragment, { children: children }), document.querySelector(selector));
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export { Portal };
|
|
@@ -1,2 +1,12 @@
|
|
|
1
|
-
import{jsx}from
|
|
2
|
-
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import cn from 'classnames';
|
|
3
|
+
import { Icon } from '../Icon/Icon.js';
|
|
4
|
+
import S from './RequiredStar.styl.js';
|
|
5
|
+
|
|
6
|
+
function RequiredStar(props) {
|
|
7
|
+
const { className, inline, ...rest } = props;
|
|
8
|
+
const classes = cn(S.root, className, inline && S.inline);
|
|
9
|
+
return jsx(Icon, { ...rest, type: "requiredStar", className: classes });
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export { RequiredStar };
|
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
import styleInject from
|
|
2
|
-
|
|
1
|
+
import styleInject from '../../../node_modules/style-inject/dist/style-inject.es.js';
|
|
2
|
+
|
|
3
|
+
var css_248z = ".RequiredStar_root__qZpQW{color:var(--danger-color)!important;pointer-events:none;position:absolute;right:2px;top:2px;transform:scale(.6)}.RequiredStar_inline__328Ou{position:relative;transform:translateY(-.5em)}";
|
|
4
|
+
var S = {"root":"RequiredStar_root__qZpQW","inline":"RequiredStar_inline__328Ou"};
|
|
5
|
+
styleInject(css_248z);
|
|
6
|
+
|
|
7
|
+
export { S as default };
|
|
@@ -1,2 +1,61 @@
|
|
|
1
|
-
import{jsxs,jsx}from
|
|
2
|
-
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useRef, useContext, useMemo, useCallback } from 'react';
|
|
3
|
+
import { withStore } from 'justorm/react';
|
|
4
|
+
import cn from 'classnames';
|
|
5
|
+
import { Icon } from '../../Icon/Icon.js';
|
|
6
|
+
import Context from '../context.js';
|
|
7
|
+
import S from './Link.styl.js';
|
|
8
|
+
|
|
9
|
+
const isStartFromDoubleSlash = href => /^\/\//.test(href);
|
|
10
|
+
const Link = withStore({ router: ['path'] })(({ className, exactClassName, children, href: hrefProp, isClear = false, isDisabled = false, disableExternalIcon = false, inline = false, store: { router }, isPartialExact = false, onClick, ...rest }) => {
|
|
11
|
+
const { path } = router;
|
|
12
|
+
const isFromRoot = isStartFromDoubleSlash(hrefProp);
|
|
13
|
+
const domElem = useRef(null);
|
|
14
|
+
const { basePath } = useContext(Context);
|
|
15
|
+
const isExternal = useMemo(() => /\./.test(hrefProp), [hrefProp]);
|
|
16
|
+
const rootPath = useMemo(() => {
|
|
17
|
+
if (isExternal || isFromRoot)
|
|
18
|
+
return '';
|
|
19
|
+
return basePath ?? '';
|
|
20
|
+
}, [isExternal, isFromRoot, basePath]);
|
|
21
|
+
const href = useMemo(() => {
|
|
22
|
+
let str = hrefProp;
|
|
23
|
+
if (isFromRoot)
|
|
24
|
+
str = str.replace(/^\//, '');
|
|
25
|
+
if (str === '/')
|
|
26
|
+
str = '';
|
|
27
|
+
return `${rootPath}${str}`;
|
|
28
|
+
}, [hrefProp, rootPath]);
|
|
29
|
+
const handleClick = useCallback(e => {
|
|
30
|
+
onClick?.(e, href);
|
|
31
|
+
if (!isExternal && router.path !== href) {
|
|
32
|
+
e.preventDefault();
|
|
33
|
+
if (e.ctrlKey || e.metaKey) {
|
|
34
|
+
window.open(href, '_blank');
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
router.go(href);
|
|
38
|
+
}
|
|
39
|
+
domElem.current?.blur();
|
|
40
|
+
}
|
|
41
|
+
}, [href, isExternal, onClick]);
|
|
42
|
+
const isExact = useMemo(() => {
|
|
43
|
+
if (isPartialExact)
|
|
44
|
+
return path.startsWith(href);
|
|
45
|
+
return path === href;
|
|
46
|
+
}, [path, href, isPartialExact]);
|
|
47
|
+
const props = { ...rest, href };
|
|
48
|
+
const isNested = !/^\//.test(href) && !isExternal;
|
|
49
|
+
const classes = cn(S.root, isDisabled && S.disabled, isExternal && S.external, isExact && cn(S.exact, exactClassName), isClear && S.clear, inline && S.inline, className);
|
|
50
|
+
if (isNested) {
|
|
51
|
+
props.href = `${path.replace(/\/$/, '')}/${href}`;
|
|
52
|
+
}
|
|
53
|
+
if (isExternal) {
|
|
54
|
+
props.target = '_blank';
|
|
55
|
+
if (!/^http/.test(href))
|
|
56
|
+
props.href = `http://${href}`;
|
|
57
|
+
}
|
|
58
|
+
return (jsxs("a", { className: classes, ...props, onClick: handleClick, ref: domElem, children: [children, isExternal && !disableExternalIcon && (jsx(Icon, { type: "externalLink", className: S.externalIcon }))] }));
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
export { Link };
|
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
import styleInject from
|
|
2
|
-
|
|
1
|
+
import styleInject from '../../../../node_modules/style-inject/dist/style-inject.es.js';
|
|
2
|
+
|
|
3
|
+
var css_248z = ".Link_root__KhBI1{align-items:center;box-shadow:inset 0 0 0 2px none;color:var(--link-color);cursor:pointer;display:inline-flex;padding:5px;position:relative;text-decoration:none;transition:color .1s ease-out;white-space:nowrap}.Link_root__KhBI1:before{background-color:var(--accent-color);bottom:0;content:\"\";height:2px;left:5px;pointer-events:none;position:absolute;right:5px;transform:scale(0);transition:transform .1s ease-out}.Link_root__KhBI1.Link_clear__abVgJ:before{content:none}.Link_root__KhBI1.Link_inline__iuNov{padding:0}.Link_root__KhBI1.Link_inline__iuNov:before{bottom:-2px;left:0;right:0}.Link_root__KhBI1.Link_exact__3MNoz{color:var(--accent-color);pointer-events:none}.Link_root__KhBI1.Link_external__drijI:before{background-color:var(--active-color)}.Link_root__KhBI1:active,.Link_root__KhBI1:focus,.Link_root__KhBI1:hover{color:var(--accent-color)}.Link_root__KhBI1:active.Link_external__drijI,.Link_root__KhBI1:focus.Link_external__drijI,.Link_root__KhBI1:hover.Link_external__drijI{color:var(--active-color)}.Link_root__KhBI1:active::-moz-selection,.Link_root__KhBI1:focus::-moz-selection,.Link_root__KhBI1:hover::-moz-selection{color:var(--accent-color)}.Link_root__KhBI1:active::selection,.Link_root__KhBI1:focus::selection,.Link_root__KhBI1:hover::selection{color:var(--accent-color)}.Link_root__KhBI1:active:before,.Link_root__KhBI1:focus:before,.Link_root__KhBI1:hover:before{transform:scale(1)}.Link_root__KhBI1.Link_disabled__wkAeH{color:var(--accent-color);opacity:.4;pointer-events:none}.Link_externalIcon__YDRJG{display:inline-block;height:1em;margin-bottom:-2px;margin-left:3px;width:1em}";
|
|
4
|
+
var S = {"root":"Link_root__KhBI1","clear":"Link_clear__abVgJ","inline":"Link_inline__iuNov","exact":"Link_exact__3MNoz","external":"Link_external__drijI","disabled":"Link_disabled__wkAeH","externalIcon":"Link_externalIcon__YDRJG"};
|
|
5
|
+
styleInject(css_248z);
|
|
6
|
+
|
|
7
|
+
export { S as default };
|
|
@@ -1,2 +1,12 @@
|
|
|
1
|
-
import{useEffect}
|
|
2
|
-
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
import STORE from './store.js';
|
|
3
|
+
|
|
4
|
+
const Redirect = (props) => {
|
|
5
|
+
useEffect(() => {
|
|
6
|
+
STORE.replaceState(props.to, { replace: true });
|
|
7
|
+
}, []);
|
|
8
|
+
return null;
|
|
9
|
+
};
|
|
10
|
+
Redirect.displayName = 'Redirect';
|
|
11
|
+
|
|
12
|
+
export { Redirect };
|
|
@@ -1,2 +1,33 @@
|
|
|
1
|
-
const replaceParamsInPath=
|
|
2
|
-
|
|
1
|
+
const replaceParamsInPath = (path, params) => {
|
|
2
|
+
if (path === '/')
|
|
3
|
+
return '';
|
|
4
|
+
return Object.keys(params).reduce((updatedPath, paramKey) => {
|
|
5
|
+
return updatedPath.replace(`:${paramKey}`, params[paramKey]);
|
|
6
|
+
}, path);
|
|
7
|
+
};
|
|
8
|
+
function parsePath(currPath, routePath, exact = false) {
|
|
9
|
+
const pathParts = currPath.split('/');
|
|
10
|
+
const routePathParts = routePath.split('/');
|
|
11
|
+
let matched = true;
|
|
12
|
+
if (exact && routePathParts.length !== pathParts.length) {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
const params = {};
|
|
16
|
+
for (let i = 0; i < routePathParts.length; i++) {
|
|
17
|
+
const routeToken = routePathParts[i];
|
|
18
|
+
const currentPathToken = pathParts[i];
|
|
19
|
+
if (currentPathToken && routeToken.startsWith(':')) {
|
|
20
|
+
const paramName = routeToken.slice(1);
|
|
21
|
+
params[paramName] = currentPathToken;
|
|
22
|
+
}
|
|
23
|
+
else if (routeToken !== currentPathToken) {
|
|
24
|
+
matched = false;
|
|
25
|
+
break;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
if (!matched)
|
|
29
|
+
return null;
|
|
30
|
+
return params;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export { parsePath, replaceParamsInPath };
|
|
@@ -1,2 +1,68 @@
|
|
|
1
|
-
import{jsx,Fragment}from
|
|
2
|
-
|
|
1
|
+
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import { useContext, useEffect, useMemo } from 'react';
|
|
3
|
+
import { withStore } from 'justorm/react';
|
|
4
|
+
import STORE from './store.js';
|
|
5
|
+
import Context from './context.js';
|
|
6
|
+
import { parsePath, replaceParamsInPath } from './Router.helpers.js';
|
|
7
|
+
export { Route } from './Route.js';
|
|
8
|
+
export { Redirect } from './Redirect.js';
|
|
9
|
+
export { Link } from './Link/Link.js';
|
|
10
|
+
|
|
11
|
+
const Router = withStore({
|
|
12
|
+
router: ['path'],
|
|
13
|
+
})((props) => {
|
|
14
|
+
const { children, single, basePath = '', store: { router }, } = props;
|
|
15
|
+
const ctx = useContext(Context);
|
|
16
|
+
const fullPath = ctx.basePath + basePath;
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
const onPopState = () => {
|
|
19
|
+
STORE.go(window.location.pathname, { replace: true });
|
|
20
|
+
};
|
|
21
|
+
window.addEventListener('popstate', onPopState);
|
|
22
|
+
return () => window.removeEventListener('popstate', onPopState);
|
|
23
|
+
}, []);
|
|
24
|
+
const matchedRoutes = useMemo(() => {
|
|
25
|
+
const childs = [];
|
|
26
|
+
let noMatchRoute;
|
|
27
|
+
let isRouteMatched = false;
|
|
28
|
+
for (const child of React.Children.toArray(children)) {
|
|
29
|
+
if (!React.isValidElement(child)) {
|
|
30
|
+
childs.push(child);
|
|
31
|
+
continue;
|
|
32
|
+
}
|
|
33
|
+
// @ts-ignore
|
|
34
|
+
const isRouteComponent = child.type.displayName === 'Route';
|
|
35
|
+
const { path, exact, component: Component, ...rest } = child.props;
|
|
36
|
+
if (!path) {
|
|
37
|
+
if (isRouteComponent && Component) {
|
|
38
|
+
noMatchRoute = jsx(Component, { ...rest });
|
|
39
|
+
continue;
|
|
40
|
+
}
|
|
41
|
+
childs.push(child);
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
if (single && isRouteMatched) {
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
const tailPath = fullPath && path === '/' ? '' : path;
|
|
48
|
+
const routePath = fullPath + tailPath;
|
|
49
|
+
const params = parsePath(router.path, routePath, exact);
|
|
50
|
+
if (params) {
|
|
51
|
+
const routeBasePath = fullPath + replaceParamsInPath(path, params);
|
|
52
|
+
const matchedRoute = (jsx(Context.Provider, { value: { basePath: routeBasePath }, children: jsx(Component, { ...rest, pathParams: params }) }, path));
|
|
53
|
+
isRouteMatched = true;
|
|
54
|
+
childs.push(matchedRoute);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
if (childs.length === 0 && noMatchRoute) {
|
|
58
|
+
return noMatchRoute;
|
|
59
|
+
}
|
|
60
|
+
return childs;
|
|
61
|
+
}, [children, router.path, fullPath, single]);
|
|
62
|
+
return jsx(Fragment, { children: matchedRoutes });
|
|
63
|
+
});
|
|
64
|
+
Router.displayName = 'Router';
|
|
65
|
+
const RouterStore = STORE;
|
|
66
|
+
const RouterContext = Context;
|
|
67
|
+
|
|
68
|
+
export { Router, RouterContext, RouterStore };
|
|
@@ -1,2 +1,55 @@
|
|
|
1
|
-
import{createStore}from
|
|
2
|
-
|
|
1
|
+
import { createStore } from 'justorm/react';
|
|
2
|
+
import { addUniq, spliceWhere } from '../../tools/array.js';
|
|
3
|
+
import { parseQueryParams } from '../../tools/queryParams.js';
|
|
4
|
+
import { isBrowser } from '../../tools/env.js';
|
|
5
|
+
import 'nanoid';
|
|
6
|
+
import '../../tools/dom.js';
|
|
7
|
+
import 'timen';
|
|
8
|
+
import 'compareq';
|
|
9
|
+
import 'lodash.pick';
|
|
10
|
+
|
|
11
|
+
const LISTENERS = [];
|
|
12
|
+
const STORE = createStore('router', {
|
|
13
|
+
path: isBrowser && location.pathname,
|
|
14
|
+
params: {},
|
|
15
|
+
query: parseQueryParams(),
|
|
16
|
+
queryString: isBrowser && location.search,
|
|
17
|
+
on(cb) {
|
|
18
|
+
addUniq(LISTENERS, cb);
|
|
19
|
+
},
|
|
20
|
+
un(cb) {
|
|
21
|
+
spliceWhere(LISTENERS, cb);
|
|
22
|
+
},
|
|
23
|
+
go(href, { replace } = {}) {
|
|
24
|
+
if (href === this.path)
|
|
25
|
+
return;
|
|
26
|
+
history[replace ? 'replaceState' : 'pushState']({}, '', href);
|
|
27
|
+
onRouteChange(href);
|
|
28
|
+
},
|
|
29
|
+
back() {
|
|
30
|
+
history.back();
|
|
31
|
+
onRouteChange();
|
|
32
|
+
},
|
|
33
|
+
replaceState(href, { quiet } = {}) {
|
|
34
|
+
history.replaceState({}, '', href);
|
|
35
|
+
if (!quiet)
|
|
36
|
+
onRouteChange(href);
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
function onRouteChange(href = window.location.pathname) {
|
|
40
|
+
STORE.queryString = location.search;
|
|
41
|
+
STORE.query = parseQueryParams();
|
|
42
|
+
STORE.path = href.replace(/\?.+/, '') || '/';
|
|
43
|
+
LISTENERS.forEach(cb => cb(STORE.path));
|
|
44
|
+
}
|
|
45
|
+
function updateRouteState() {
|
|
46
|
+
if (STORE.path !== window.location.pathname ||
|
|
47
|
+
STORE.queryString !== location.search)
|
|
48
|
+
onRouteChange();
|
|
49
|
+
}
|
|
50
|
+
if (isBrowser) {
|
|
51
|
+
window.addEventListener('popstate', updateRouteState);
|
|
52
|
+
window.addEventListener('pushstate', updateRouteState);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export { STORE as default };
|