@homecode/ui 5.1.9 → 5.1.10
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 +109 -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/Autocomplete/Autocomplete.js +429 -2
- package/dist/esm/src/components/Autocomplete/Autocomplete.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 +136 -2
- package/dist/esm/src/components/Calendar/Calendar.styl.js +7 -2
- package/dist/esm/src/components/Card/Card.js +55 -2
- package/dist/esm/src/components/Card/Card.styl.js +7 -2
- package/dist/esm/src/components/Checkbox/Checkbox.js +19 -2
- package/dist/esm/src/components/Checkbox/Checkbox.styl.js +7 -2
- package/dist/esm/src/components/Chip/Chip.js +16 -2
- package/dist/esm/src/components/Chip/Chip.styl.js +7 -2
- package/dist/esm/src/components/Container/Container.js +13 -2
- package/dist/esm/src/components/Container/Container.styl.js +7 -2
- package/dist/esm/src/components/DatePicker/DatePicker.helpers.js +33 -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 +44 -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/Dialogue/Dialogue.js +107 -2
- package/dist/esm/src/components/Dialogue/Dialogue.styl.js +7 -2
- package/dist/esm/src/components/Draggable/Draggable.js +147 -2
- package/dist/esm/src/components/Draggable/Draggable.styl.js +7 -2
- package/dist/esm/src/components/DropZone/DropZone.js +112 -2
- package/dist/esm/src/components/DropZone/DropZone.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/Flex/Flex.js +24 -2
- package/dist/esm/src/components/Flex/Flex.styl.js +7 -2
- package/dist/esm/src/components/Form/Form.helpers.js +42 -2
- package/dist/esm/src/components/Form/Form.js +272 -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 +222 -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 +21 -2
- package/dist/esm/src/components/Icon/Icon.styl.js +7 -2
- package/dist/esm/src/components/Icon/icons/apple.svg.js +16 -2
- package/dist/esm/src/components/Icon/icons/arrowDown.svg.js +17 -2
- package/dist/esm/src/components/Icon/icons/arrowLeft.svg.js +17 -2
- package/dist/esm/src/components/Icon/icons/arrowRight.svg.js +17 -2
- package/dist/esm/src/components/Icon/icons/arrowUp.svg.js +17 -2
- package/dist/esm/src/components/Icon/icons/attach.svg.js +19 -2
- package/dist/esm/src/components/Icon/icons/avatar.svg.js +15 -2
- package/dist/esm/src/components/Icon/icons/bookmark.svg.js +17 -2
- package/dist/esm/src/components/Icon/icons/bookmarkAdd.svg.js +17 -2
- package/dist/esm/src/components/Icon/icons/brain.svg.js +22 -2
- package/dist/esm/src/components/Icon/icons/brokenImage.svg.js +15 -2
- package/dist/esm/src/components/Icon/icons/call.svg.js +17 -2
- package/dist/esm/src/components/Icon/icons/camera.svg.js +17 -2
- package/dist/esm/src/components/Icon/icons/chat.svg.js +17 -2
- package/dist/esm/src/components/Icon/icons/check.svg.js +19 -2
- package/dist/esm/src/components/Icon/icons/checkers.svg.js +18 -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/clearAll.svg.js +17 -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/compass.svg.js +56 -2
- package/dist/esm/src/components/Icon/icons/copy.svg.js +15 -2
- package/dist/esm/src/components/Icon/icons/cubes.svg.js +17 -2
- package/dist/esm/src/components/Icon/icons/delete.svg.js +15 -2
- package/dist/esm/src/components/Icon/icons/discord.svg.js +17 -2
- package/dist/esm/src/components/Icon/icons/draft.svg.js +15 -2
- package/dist/esm/src/components/Icon/icons/dragHandlerHorizontal.svg.js +15 -2
- package/dist/esm/src/components/Icon/icons/dragHandlerVertical.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/flyover.svg.js +17 -2
- package/dist/esm/src/components/Icon/icons/folder.svg.js +17 -2
- package/dist/esm/src/components/Icon/icons/folderOpen.svg.js +17 -2
- package/dist/esm/src/components/Icon/icons/forward.svg.js +17 -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/geolocation.svg.js +17 -2
- package/dist/esm/src/components/Icon/icons/github.svg.js +18 -2
- package/dist/esm/src/components/Icon/icons/globe.svg.js +17 -2
- package/dist/esm/src/components/Icon/icons/google.svg.js +42 -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/image.svg.js +17 -2
- package/dist/esm/src/components/Icon/icons/index.js +95 -2
- package/dist/esm/src/components/Icon/icons/instagram.svg.js +15 -2
- package/dist/esm/src/components/Icon/icons/layers.svg.js +17 -2
- package/dist/esm/src/components/Icon/icons/link.svg.js +15 -2
- package/dist/esm/src/components/Icon/icons/linkedin.svg.js +20 -2
- package/dist/esm/src/components/Icon/icons/loader.svg.js +45 -2
- package/dist/esm/src/components/Icon/icons/lock.svg.js +19 -2
- package/dist/esm/src/components/Icon/icons/lockOpen.svg.js +19 -2
- package/dist/esm/src/components/Icon/icons/map.svg.js +17 -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/micMuted.svg.js +27 -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/pause.svg.js +15 -2
- package/dist/esm/src/components/Icon/icons/play.svg.js +20 -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/rewind.svg.js +17 -2
- package/dist/esm/src/components/Icon/icons/rocket.svg.js +22 -2
- package/dist/esm/src/components/Icon/icons/route.svg.js +17 -2
- package/dist/esm/src/components/Icon/icons/routeFrom.svg.js +31 -2
- package/dist/esm/src/components/Icon/icons/routeTo.svg.js +31 -2
- package/dist/esm/src/components/Icon/icons/save.svg.js +17 -2
- package/dist/esm/src/components/Icon/icons/search.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/smile.svg.js +30 -2
- package/dist/esm/src/components/Icon/icons/soundWave.svg.js +66 -2
- package/dist/esm/src/components/Icon/icons/sparks.svg.js +21 -2
- package/dist/esm/src/components/Icon/icons/star.svg.js +18 -2
- package/dist/esm/src/components/Icon/icons/stop.svg.js +22 -2
- package/dist/esm/src/components/Icon/icons/stopInCircle.svg.js +17 -2
- package/dist/esm/src/components/Icon/icons/syncArrows.svg.js +22 -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/tool.svg.js +17 -2
- package/dist/esm/src/components/Icon/icons/trafficLight.svg.js +49 -2
- package/dist/esm/src/components/Icon/icons/undo.svg.js +15 -2
- package/dist/esm/src/components/Icon/icons/usage.svg.js +25 -2
- package/dist/esm/src/components/Icon/icons/youtube.svg.js +20 -2
- package/dist/esm/src/components/Input/Input.js +281 -2
- package/dist/esm/src/components/Input/Input.styl.js +7 -2
- package/dist/esm/src/components/InputFile/InputFile.js +314 -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/LangSelector/LangSelector.js +10 -2
- package/dist/esm/src/components/Lazy/Lazy.js +74 -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/Menu/Menu.js +27 -2
- package/dist/esm/src/components/Menu/Menu.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 +72 -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 +130 -2
- package/dist/esm/src/components/Popup/Popup.js +484 -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 +33 -2
- package/dist/esm/src/components/Progress/Progress.helpers.js +5 -2
- package/dist/esm/src/components/Progress/Progress.js +12 -2
- package/dist/esm/src/components/Progress/Progress.styl.js +7 -2
- package/dist/esm/src/components/ProgressCircular/ProgressCircular.js +23 -2
- package/dist/esm/src/components/ProgressCircular/ProgressCircular.styl.js +7 -2
- package/dist/esm/src/components/RadioButton/RadioButton.js +33 -2
- package/dist/esm/src/components/RadioButton/RadioButton.styl.js +7 -2
- package/dist/esm/src/components/RadioGroup/RadioGroup.js +31 -2
- package/dist/esm/src/components/RadioGroup/RadioGroup.styl.js +7 -2
- package/dist/esm/src/components/RadioGroup/RadioGroupContext.js +8 -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 +62 -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 +6 -2
- package/dist/esm/src/components/Router/Router.helpers.js +33 -2
- package/dist/esm/src/components/Router/Router.js +72 -2
- package/dist/esm/src/components/Router/context.js +5 -2
- package/dist/esm/src/components/Router/store.js +75 -2
- package/dist/esm/src/components/Scroll/Scroll.js +308 -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 +601 -2
- package/dist/esm/src/components/Select/Select.styl.js +7 -2
- package/dist/esm/src/components/Select/Select2.js +334 -2
- package/dist/esm/src/components/Shimmer/Shimmer.js +7 -2
- package/dist/esm/src/components/Shimmer/Shimmer.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 +48 -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/TextShimmer/TextShimmer.js +29 -0
- package/dist/esm/src/components/TextShimmer/TextShimmer.styl.js +7 -0
- package/dist/esm/src/components/Theme/Theme.defaults.js +53 -2
- package/dist/esm/src/components/Theme/Theme.helpers.js +67 -2
- package/dist/esm/src/components/Theme/Theme.js +15 -2
- package/dist/esm/src/components/Theme/ThemeProvider.js +50 -2
- package/dist/esm/src/components/Toggle/Toggle.js +18 -2
- package/dist/esm/src/components/Toggle/Toggle.styl.js +7 -2
- package/dist/esm/src/components/Tooltip/Tooltip.js +86 -2
- package/dist/esm/src/components/Tooltip/Tooltip.styl.js +7 -2
- package/dist/esm/src/components/VH/VH.js +33 -2
- package/dist/esm/src/components/Virtualized/List/List.js +136 -2
- package/dist/esm/src/components/Virtualized/List/List.styl.js +7 -2
- package/dist/esm/src/components/Virtualized/List/ListScroll.js +22 -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 +218 -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/hooks/useDebounce.js +11 -2
- package/dist/esm/src/hooks/useEvent.js +27 -2
- package/dist/esm/src/hooks/useIsMounted.js +11 -2
- package/dist/esm/src/hooks/useListKeyboardControl.js +50 -2
- package/dist/esm/src/hooks/useResizeObserver.js +15 -2
- package/dist/esm/src/hooks/useThrottle.js +31 -2
- package/dist/esm/src/hooks/useToggleState.js +35 -2
- package/dist/esm/src/services/i18n.js +112 -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 +57 -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 +40 -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/Notifications/Notifications.types.d.ts +4 -2
- package/dist/esm/types/src/components/TextShimmer/TextShimmer.d.ts +5 -0
- package/dist/esm/types/src/components/TextShimmer/TextShimmer.types.d.ts +9 -0
- package/dist/esm/types/src/components/TextShimmer/index.d.ts +2 -0
- package/dist/esm/types/src/components/index.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/Autocomplete/Autocomplete.js.map +0 -1
- package/dist/esm/src/components/Autocomplete/Autocomplete.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/Card/Card.js.map +0 -1
- package/dist/esm/src/components/Card/Card.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/Chip/Chip.js.map +0 -1
- package/dist/esm/src/components/Chip/Chip.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/Dialogue/Dialogue.js.map +0 -1
- package/dist/esm/src/components/Dialogue/Dialogue.styl.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/DropZone/DropZone.js.map +0 -1
- package/dist/esm/src/components/DropZone/DropZone.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/Flex/Flex.js.map +0 -1
- package/dist/esm/src/components/Flex/Flex.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/apple.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/arrowDown.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/arrowLeft.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/arrowRight.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/arrowUp.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/attach.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/avatar.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/bookmark.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/bookmarkAdd.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/brain.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/call.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/camera.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/chat.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/checkers.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/clearAll.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/compass.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/cubes.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/discord.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/dragHandlerHorizontal.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/dragHandlerVertical.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/flyover.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/folder.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/folderOpen.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/forward.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/geolocation.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/github.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/globe.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/google.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/image.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/layers.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/linkedin.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/lock.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/lockOpen.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/map.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/micMuted.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/pause.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/play.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/rewind.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/rocket.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/route.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/routeFrom.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/routeTo.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/search.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/smile.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/soundWave.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/sparks.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/star.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/stop.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/stopInCircle.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/syncArrows.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/tool.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/trafficLight.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/undo.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/usage.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/youtube.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/LangSelector/LangSelector.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/Menu/Menu.js.map +0 -1
- package/dist/esm/src/components/Menu/Menu.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/Progress/Progress.helpers.js.map +0 -1
- package/dist/esm/src/components/Progress/Progress.js.map +0 -1
- package/dist/esm/src/components/Progress/Progress.styl.js.map +0 -1
- package/dist/esm/src/components/ProgressCircular/ProgressCircular.js.map +0 -1
- package/dist/esm/src/components/ProgressCircular/ProgressCircular.styl.js.map +0 -1
- package/dist/esm/src/components/RadioButton/RadioButton.js.map +0 -1
- package/dist/esm/src/components/RadioButton/RadioButton.styl.js.map +0 -1
- package/dist/esm/src/components/RadioGroup/RadioGroup.js.map +0 -1
- package/dist/esm/src/components/RadioGroup/RadioGroup.styl.js.map +0 -1
- package/dist/esm/src/components/RadioGroup/RadioGroupContext.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/Select/Select2.js.map +0 -1
- package/dist/esm/src/components/Shimmer/Shimmer.js.map +0 -1
- package/dist/esm/src/components/Shimmer/Shimmer.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/Theme/ThemeProvider.js.map +0 -1
- package/dist/esm/src/components/Toggle/Toggle.js.map +0 -1
- package/dist/esm/src/components/Toggle/Toggle.styl.js.map +0 -1
- package/dist/esm/src/components/Tooltip/Tooltip.js.map +0 -1
- package/dist/esm/src/components/Tooltip/Tooltip.styl.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/hooks/useDebounce.js.map +0 -1
- package/dist/esm/src/hooks/useEvent.js.map +0 -1
- package/dist/esm/src/hooks/useIsMounted.js.map +0 -1
- package/dist/esm/src/hooks/useListKeyboardControl.js.map +0 -1
- package/dist/esm/src/hooks/useResizeObserver.js.map +0 -1
- package/dist/esm/src/hooks/useThrottle.js.map +0 -1
- package/dist/esm/src/hooks/useToggleState.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,23 @@
|
|
|
1
|
-
import{jsxs,jsx
|
|
2
|
-
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import cn from 'classnames';
|
|
3
|
+
import { calculateProgress } from '../Progress/Progress.helpers.js';
|
|
4
|
+
import S from './ProgressCircular.styl.js';
|
|
5
|
+
|
|
6
|
+
const SIZE_MAP = {
|
|
7
|
+
xs: 14,
|
|
8
|
+
s: 20,
|
|
9
|
+
m: 30,
|
|
10
|
+
l: 60,
|
|
11
|
+
xl: 120,
|
|
12
|
+
};
|
|
13
|
+
function ProgressCircular({ value, showPercentage, size = 'm', strokeWidth, className, }) {
|
|
14
|
+
const progress = calculateProgress(value);
|
|
15
|
+
const pixelSize = SIZE_MAP[size];
|
|
16
|
+
const calculatedStrokeWidth = strokeWidth ?? pixelSize / 10;
|
|
17
|
+
const radius = (pixelSize - calculatedStrokeWidth) / 2;
|
|
18
|
+
const circumference = 2 * Math.PI * radius;
|
|
19
|
+
const strokeDashoffset = circumference - (progress / 100) * circumference;
|
|
20
|
+
return (jsxs("svg", { width: pixelSize, height: pixelSize, viewBox: `0 0 ${pixelSize} ${pixelSize}`, className: cn(S.root, value > 0 && S.animated, className), children: [jsx("circle", { className: S.background, cx: pixelSize / 2, cy: pixelSize / 2, r: radius, fill: "none", strokeWidth: calculatedStrokeWidth }), jsx("circle", { cx: pixelSize / 2, cy: pixelSize / 2, r: radius, fill: "none", stroke: "var(--active-color)", strokeWidth: calculatedStrokeWidth, strokeLinecap: "round", strokeDasharray: circumference, strokeDashoffset: strokeDashoffset, transform: `rotate(-90 ${pixelSize / 2} ${pixelSize / 2})`, className: S.progress }), showPercentage && (jsxs("text", { x: "50%", y: "50%", textAnchor: "middle", dominantBaseline: "middle", fontSize: "16", fontWeight: "bold", children: [Math.round(progress), "%"] }))] }));
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export { ProgressCircular };
|
|
@@ -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 = ".ProgressCircular_root__z7xBm .ProgressCircular_background__Rlqcq{stroke:var(--accent-color-alpha-100)}.ProgressCircular_root__z7xBm.ProgressCircular_animated__w3Bpf .ProgressCircular_progress__QVG7n{transition:stroke-dashoffset .3s ease-in-out}.ProgressCircular_root__z7xBm text{fill:var(--accent-color)}";
|
|
4
|
+
var S = {"root":"ProgressCircular_root__z7xBm","background":"ProgressCircular_background__Rlqcq","animated":"ProgressCircular_animated__w3Bpf","progress":"ProgressCircular_progress__QVG7n"};
|
|
5
|
+
styleInject(css_248z);
|
|
6
|
+
|
|
7
|
+
export { S as default };
|
|
@@ -1,2 +1,33 @@
|
|
|
1
|
-
import{jsxs,jsx}from
|
|
2
|
-
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import cn from 'classnames';
|
|
3
|
+
import 'react';
|
|
4
|
+
import 'timen';
|
|
5
|
+
import { useToggleState } from '../../hooks/useToggleState.js';
|
|
6
|
+
import { useRadioGroup } from '../RadioGroup/RadioGroupContext.js';
|
|
7
|
+
import S from './RadioButton.styl.js';
|
|
8
|
+
|
|
9
|
+
const RadioButton = ({ className, label = '', size: sizeProp, variant: variantProp, error: errorProp, value, checked: checkedProp, disabled: disabledProp, name: nameProp, onChange, id, onFocus, onBlur, ...props }) => {
|
|
10
|
+
const group = useRadioGroup();
|
|
11
|
+
const size = sizeProp ?? group?.size ?? 'm';
|
|
12
|
+
const variant = variantProp ?? group?.variant ?? 'default';
|
|
13
|
+
const error = errorProp ?? group?.error;
|
|
14
|
+
const disabled = Boolean(disabledProp || group?.disabled);
|
|
15
|
+
const name = group ? group.name : nameProp;
|
|
16
|
+
const checked = group
|
|
17
|
+
? group.value !== undefined && group.value === value
|
|
18
|
+
: Boolean(checkedProp);
|
|
19
|
+
const { id: componentId, isActive, isFocused, handlers, } = useToggleState({
|
|
20
|
+
id,
|
|
21
|
+
onFocus,
|
|
22
|
+
onBlur,
|
|
23
|
+
});
|
|
24
|
+
const handleChange = (e) => {
|
|
25
|
+
if (group)
|
|
26
|
+
group.onChange(value);
|
|
27
|
+
onChange?.(e);
|
|
28
|
+
};
|
|
29
|
+
const classes = cn(S.root, S[`size-${size}`], S[`variant-${variant}`], checked && S.checked, disabled && S.disabled, error && S.hasError, isActive && S.isActive, isFocused && S.isFocused, className);
|
|
30
|
+
return (jsxs("label", { className: classes, onPointerDown: handlers.onPointerDown, onPointerUp: handlers.onPointerUp, children: [jsxs("div", { className: S.controlWrapper, children: [jsx("input", { className: S.control, ...props, onChange: handleChange, onFocus: handlers.onFocus, onBlur: handlers.onBlur, id: componentId, type: "radio", name: name, value: String(value), checked: checked, disabled: disabled, tabIndex: 0 }), jsx("span", { className: S.dot, "aria-hidden": true })] }), label] }));
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export { RadioButton };
|
|
@@ -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 = ".RadioButton_root__-zReK{align-items:center;box-sizing:border-box;color:inherit;cursor:pointer;display:inline-flex;text-decoration:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.RadioButton_disabled__OuVm5{opacity:.4;pointer-events:none}.RadioButton_controlWrapper__xtZkJ{display:block;margin-right:1em;position:relative;transition:.2s ease-out;transition-property:opacity,box-shadow}.RadioButton_variant-default__r2D0X .RadioButton_controlWrapper__xtZkJ{background-color:var(--accent-color-alpha-100)}.RadioButton_variant-outlined__ZE2em .RadioButton_controlWrapper__xtZkJ{background-color:transparent;box-shadow:inset 0 0 0 2px var(--accent-color)}.RadioButton_root__-zReK:hover .RadioButton_controlWrapper__xtZkJ{background-color:var(--active-color-alpha-100)}.RadioButton_isActive__hAdvm .RadioButton_controlWrapper__xtZkJ,.RadioButton_isFocused__pQaTx .RadioButton_controlWrapper__xtZkJ{box-shadow:inset 0 0 0 2px var(--active-color)!important}.RadioButton_hasError__SFhRz .RadioButton_controlWrapper__xtZkJ{box-shadow:inset 0 0 0 2px var(--danger-color)!important}.RadioButton_isActive__hAdvm .RadioButton_controlWrapper__xtZkJ{background-color:var(--active-color-alpha-100);opacity:.7}.RadioButton_control__RLcpz{-webkit-appearance:none;-moz-appearance:none;appearance:none;box-shadow:inset 0 0 0 2px none;box-sizing:border-box;cursor:pointer;transition:.2s ease-out;transition-property:background-color,box-shadow,opacity;transition:.1s ease-out;transition-property:background-color,color}.RadioButton_control__RLcpz:focus,.RadioButton_control__RLcpz:hover{background-color:var(--active-color-alpha-100)}.RadioButton_control__RLcpz[disabled]{background-color:var(--accent-color-alpha-100);opacity:.4;pointer-events:none}.RadioButton_dot__m6MWL{background-color:var(--active-color);border-radius:50%;height:42%;left:50%;opacity:0;pointer-events:none;position:absolute;top:50%;transform:translate(-50%,-50%) scale(.4);transition:.1s ease-in;transition-property:transform,opacity;width:42%}.RadioButton_checked__X45GC .RadioButton_dot__m6MWL{opacity:1;transform:translate(-50%,-50%) scale(1.8)}.RadioButton_size-xs__gBuwV{font-size:14px}.RadioButton_size-xs__gBuwV .RadioButton_controlWrapper__xtZkJ{border-radius:4px;border-radius:12px;min-height:24px;min-width:24px}.RadioButton_size-s__2fKr7{font-size:16px}.RadioButton_size-s__2fKr7 .RadioButton_controlWrapper__xtZkJ{border-radius:4px;border-radius:16px;min-height:32px;min-width:32px}.RadioButton_size-m__cQ-gf{font-size:18px}.RadioButton_size-m__cQ-gf .RadioButton_controlWrapper__xtZkJ{border-radius:6px;border-radius:20px;min-height:40px;min-width:40px}.RadioButton_size-l__h3Alz{font-size:22px}.RadioButton_size-l__h3Alz .RadioButton_controlWrapper__xtZkJ{border-radius:8px;border-radius:24px;min-height:48px;min-width:48px}.RadioButton_size-xl__evU9a{font-size:26px}.RadioButton_size-xl__evU9a .RadioButton_controlWrapper__xtZkJ{border-radius:10px;border-radius:28px;min-height:56px;min-width:56px}";
|
|
4
|
+
var S = {"root":"RadioButton_root__-zReK","disabled":"RadioButton_disabled__OuVm5","controlWrapper":"RadioButton_controlWrapper__xtZkJ","variant-default":"RadioButton_variant-default__r2D0X","variant-outlined":"RadioButton_variant-outlined__ZE2em","isActive":"RadioButton_isActive__hAdvm","isFocused":"RadioButton_isFocused__pQaTx","hasError":"RadioButton_hasError__SFhRz","control":"RadioButton_control__RLcpz","dot":"RadioButton_dot__m6MWL","checked":"RadioButton_checked__X45GC","size-xs":"RadioButton_size-xs__gBuwV","size-s":"RadioButton_size-s__2fKr7","size-m":"RadioButton_size-m__cQ-gf","size-l":"RadioButton_size-l__h3Alz","size-xl":"RadioButton_size-xl__evU9a"};
|
|
5
|
+
styleInject(css_248z);
|
|
6
|
+
|
|
7
|
+
export { S as default };
|
|
@@ -1,2 +1,31 @@
|
|
|
1
|
-
import{jsx,jsxs}from
|
|
2
|
-
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { useId, useState, useCallback, useMemo } from 'react';
|
|
3
|
+
import cn from 'classnames';
|
|
4
|
+
import { RadioGroupContext } from './RadioGroupContext.js';
|
|
5
|
+
import S from './RadioGroup.styl.js';
|
|
6
|
+
|
|
7
|
+
const RadioGroup = ({ className, children, label, value, defaultValue, onChange, name: nameProp, size = 'm', variant = 'default', error, disabled, orientation = 'vertical', ...rest }) => {
|
|
8
|
+
const reactId = useId();
|
|
9
|
+
const name = nameProp ?? `radio${reactId.replace(/:/g, '')}`;
|
|
10
|
+
const [uncontrolled, setUncontrolled] = useState(defaultValue);
|
|
11
|
+
const isControlled = value !== undefined;
|
|
12
|
+
const selectedValue = isControlled ? value : uncontrolled;
|
|
13
|
+
const setValue = useCallback((next) => {
|
|
14
|
+
if (!isControlled)
|
|
15
|
+
setUncontrolled(next);
|
|
16
|
+
onChange?.(next);
|
|
17
|
+
}, [isControlled, onChange]);
|
|
18
|
+
const contextValue = useMemo(() => ({
|
|
19
|
+
name,
|
|
20
|
+
value: selectedValue,
|
|
21
|
+
onChange: setValue,
|
|
22
|
+
size,
|
|
23
|
+
variant,
|
|
24
|
+
error,
|
|
25
|
+
disabled,
|
|
26
|
+
}), [name, selectedValue, setValue, size, variant, error, disabled]);
|
|
27
|
+
const inner = (jsx("div", { className: cn(S.inner, orientation === 'horizontal' && S.horizontal), children: jsx(RadioGroupContext.Provider, { value: contextValue, children: children }) }));
|
|
28
|
+
return (jsxs("fieldset", { className: cn(S.root, className), disabled: disabled, ...rest, children: [label != null && label !== '' && (jsx("legend", { className: S.legend, children: label })), inner] }));
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export { RadioGroup };
|
|
@@ -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 = ".RadioGroup_root__f0yTC{border:none;margin:0;min-width:0;padding:0}.RadioGroup_legend__Fq1Yg{margin:0 0 .5em;padding:0}.RadioGroup_inner__GZ2--{align-items:flex-start;display:flex;flex-direction:column;gap:.5em}.RadioGroup_inner__GZ2--.RadioGroup_horizontal__72oyb{align-items:center;flex-direction:row;flex-wrap:wrap}";
|
|
4
|
+
var S = {"root":"RadioGroup_root__f0yTC","legend":"RadioGroup_legend__Fq1Yg","inner":"RadioGroup_inner__GZ2--","horizontal":"RadioGroup_horizontal__72oyb"};
|
|
5
|
+
styleInject(css_248z);
|
|
6
|
+
|
|
7
|
+
export { S as default };
|
|
@@ -1,2 +1,8 @@
|
|
|
1
|
-
import{createContext,useContext}from
|
|
2
|
-
|
|
1
|
+
import { createContext, useContext } from 'react';
|
|
2
|
+
|
|
3
|
+
const RadioGroupContext = createContext(null);
|
|
4
|
+
function useRadioGroup() {
|
|
5
|
+
return useContext(RadioGroupContext);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export { RadioGroupContext, useRadioGroup };
|
|
@@ -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,62 @@
|
|
|
1
|
-
import{jsxs,jsx}from
|
|
2
|
-
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useRef, useContext, useMemo, useCallback } from 'react';
|
|
3
|
+
import { useStore } 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 = ({ className, exactClassName, children, href: hrefProp, isClear = false, isDisabled = false, disableExternalIcon = false, inline = false, isPartialExact = false, onClick, ...rest }) => {
|
|
11
|
+
const { router } = useStore({ router: ['path'] });
|
|
12
|
+
const { path } = router;
|
|
13
|
+
const isFromRoot = isStartFromDoubleSlash(hrefProp);
|
|
14
|
+
const domElem = useRef(null);
|
|
15
|
+
const { basePath } = useContext(Context);
|
|
16
|
+
const isExternal = useMemo(() => /\./.test(hrefProp), [hrefProp]);
|
|
17
|
+
const rootPath = useMemo(() => {
|
|
18
|
+
if (isExternal || isFromRoot)
|
|
19
|
+
return '';
|
|
20
|
+
return basePath ?? '';
|
|
21
|
+
}, [isExternal, isFromRoot, basePath]);
|
|
22
|
+
const href = useMemo(() => {
|
|
23
|
+
let str = hrefProp;
|
|
24
|
+
if (isFromRoot)
|
|
25
|
+
str = str.replace(/^\//, '');
|
|
26
|
+
if (str === '/')
|
|
27
|
+
str = '';
|
|
28
|
+
return `${rootPath}${str}`;
|
|
29
|
+
}, [hrefProp, rootPath]);
|
|
30
|
+
const handleClick = useCallback(e => {
|
|
31
|
+
onClick?.(e, href);
|
|
32
|
+
if (!isExternal && router.path !== href) {
|
|
33
|
+
e.preventDefault();
|
|
34
|
+
if (e.ctrlKey || e.metaKey) {
|
|
35
|
+
window.open(href, '_blank');
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
router.go(href);
|
|
39
|
+
}
|
|
40
|
+
domElem.current?.blur();
|
|
41
|
+
}
|
|
42
|
+
}, [href, isExternal, onClick]);
|
|
43
|
+
const isExact = useMemo(() => {
|
|
44
|
+
if (isPartialExact)
|
|
45
|
+
return path.startsWith(href);
|
|
46
|
+
return path === href;
|
|
47
|
+
}, [path, href, isPartialExact]);
|
|
48
|
+
const props = { ...rest, href };
|
|
49
|
+
const isNested = !/^\//.test(href) && !isExternal;
|
|
50
|
+
const classes = cn(S.root, isDisabled && S.disabled, isExternal && S.external, isExact && cn(S.exact, exactClassName), isClear && S.clear, inline && S.inline, className);
|
|
51
|
+
if (isNested) {
|
|
52
|
+
props.href = `${path.replace(/\/$/, '')}/${href}`;
|
|
53
|
+
}
|
|
54
|
+
if (isExternal) {
|
|
55
|
+
props.target = '_blank';
|
|
56
|
+
if (!/^http/.test(href))
|
|
57
|
+
props.href = `http://${href}`;
|
|
58
|
+
}
|
|
59
|
+
return (jsxs("a", { className: classes, ...props, onClick: handleClick, ref: domElem, children: [children, isExternal && !disableExternalIcon && (jsx(Icon, { type: "externalLink", className: S.externalIcon }))] }));
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
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);
|
|
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,72 @@
|
|
|
1
|
-
import{jsx,Fragment}from
|
|
2
|
-
|
|
1
|
+
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import { useContext, useEffect, useMemo } from 'react';
|
|
3
|
+
import { useStore } 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
|
+
import 'classnames';
|
|
10
|
+
import '../Icon/Icon.styl.js';
|
|
11
|
+
import './Link/Link.styl.js';
|
|
12
|
+
|
|
13
|
+
const Router = (props) => {
|
|
14
|
+
const { router } = useStore({ router: ['path'] });
|
|
15
|
+
const { children, single, basePath = '' } = props;
|
|
16
|
+
const ctx = useContext(Context);
|
|
17
|
+
const fullPath = ctx.basePath + basePath;
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
const onPopState = () => {
|
|
20
|
+
STORE.go(window.location.pathname, STORE.query, { replace: true });
|
|
21
|
+
};
|
|
22
|
+
window.addEventListener('popstate', onPopState);
|
|
23
|
+
return () => window.removeEventListener('popstate', onPopState);
|
|
24
|
+
}, []);
|
|
25
|
+
const matchedRoutes = useMemo(() => {
|
|
26
|
+
const childs = [];
|
|
27
|
+
let noMatchRoute;
|
|
28
|
+
let isRouteMatched = false;
|
|
29
|
+
for (const child of React.Children.toArray(children)) {
|
|
30
|
+
if (!React.isValidElement(child)) {
|
|
31
|
+
childs.push(child);
|
|
32
|
+
continue;
|
|
33
|
+
}
|
|
34
|
+
// @ts-ignore
|
|
35
|
+
const isRouteComponent = child.type.displayName === 'Route';
|
|
36
|
+
const { path, queryParam, exact, component: Component, ...rest } = child.props;
|
|
37
|
+
if (!path) {
|
|
38
|
+
const isMatched = queryParam
|
|
39
|
+
? router.query[queryParam]
|
|
40
|
+
: isRouteComponent && Component;
|
|
41
|
+
if (isMatched) {
|
|
42
|
+
noMatchRoute = jsx(Component, { ...rest });
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
childs.push(child);
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
if (single && isRouteMatched) {
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
const tailPath = fullPath && path === '/' ? '' : path;
|
|
52
|
+
const routePath = fullPath + tailPath;
|
|
53
|
+
const params = parsePath(router.path, routePath, exact);
|
|
54
|
+
if (params) {
|
|
55
|
+
const routeBasePath = fullPath + replaceParamsInPath(path, params);
|
|
56
|
+
const matchedRoute = (jsx(Context.Provider, { value: { basePath: routeBasePath }, children: jsx(Component, { ...rest, pathParams: params }) }, path));
|
|
57
|
+
isRouteMatched = true;
|
|
58
|
+
childs.push(matchedRoute);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
if (childs.length === 0 && noMatchRoute) {
|
|
62
|
+
return noMatchRoute;
|
|
63
|
+
}
|
|
64
|
+
return childs;
|
|
65
|
+
}, [children, router.path, fullPath, single]);
|
|
66
|
+
return jsx(Fragment, { children: matchedRoutes });
|
|
67
|
+
};
|
|
68
|
+
Router.displayName = 'Router';
|
|
69
|
+
const RouterStore = STORE;
|
|
70
|
+
const RouterContext = Context;
|
|
71
|
+
|
|
72
|
+
export { Router, RouterContext, RouterStore };
|
|
@@ -1,2 +1,75 @@
|
|
|
1
|
-
import{
|
|
2
|
-
|
|
1
|
+
import { createStore } from 'justorm/react';
|
|
2
|
+
import { addUniq, spliceWhere } from '../../tools/array.js';
|
|
3
|
+
import { parseQueryParams, applyQueryParams } 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(path = this.path, query = {}, params = {}) {
|
|
24
|
+
if (path === this.path && !query)
|
|
25
|
+
return;
|
|
26
|
+
const { replace } = params;
|
|
27
|
+
const pathStr = applyQueryParams(path ?? this.path, query);
|
|
28
|
+
const action = replace ? 'replaceState' : 'pushState';
|
|
29
|
+
console.log('Router.go', query, pathStr);
|
|
30
|
+
history[action]({}, '', pathStr);
|
|
31
|
+
onRouteChange(pathStr);
|
|
32
|
+
},
|
|
33
|
+
setQuery(queryParams) {
|
|
34
|
+
this.go(this.path, queryParams);
|
|
35
|
+
onRouteChange();
|
|
36
|
+
},
|
|
37
|
+
addQuery(query) {
|
|
38
|
+
this.go(this.path, { ...this.query, ...query });
|
|
39
|
+
onRouteChange();
|
|
40
|
+
},
|
|
41
|
+
removeQuery(fields) {
|
|
42
|
+
const newQuery = { ...this.query };
|
|
43
|
+
for (const field of fields)
|
|
44
|
+
delete newQuery[field];
|
|
45
|
+
this.go(this.path, newQuery);
|
|
46
|
+
onRouteChange();
|
|
47
|
+
},
|
|
48
|
+
back() {
|
|
49
|
+
history.back();
|
|
50
|
+
onRouteChange();
|
|
51
|
+
},
|
|
52
|
+
replaceState(href, params = {}) {
|
|
53
|
+
history.replaceState({}, '', href);
|
|
54
|
+
if (!params.quiet)
|
|
55
|
+
onRouteChange(href);
|
|
56
|
+
},
|
|
57
|
+
});
|
|
58
|
+
function onRouteChange(path = window.location.pathname) {
|
|
59
|
+
STORE.queryString = location.search;
|
|
60
|
+
STORE.query = parseQueryParams();
|
|
61
|
+
STORE.path = path.replace(/\?.+/, '') || '/';
|
|
62
|
+
LISTENERS.forEach(cb => cb(STORE.path, STORE.query));
|
|
63
|
+
}
|
|
64
|
+
function updateRouteState() {
|
|
65
|
+
if (STORE.path !== window.location.pathname ||
|
|
66
|
+
STORE.queryString !== location.search)
|
|
67
|
+
onRouteChange();
|
|
68
|
+
}
|
|
69
|
+
if (isBrowser) {
|
|
70
|
+
window.addEventListener('popstate', updateRouteState);
|
|
71
|
+
window.addEventListener('pushstate', updateRouteState);
|
|
72
|
+
}
|
|
73
|
+
// window.routerStore = STORE;
|
|
74
|
+
|
|
75
|
+
export { STORE as default };
|