@homecode/ui 5.1.8 → 5.1.9
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 +2 -108
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/node_modules/style-inject/dist/style-inject.es.js +2 -28
- package/dist/esm/node_modules/style-inject/dist/style-inject.es.js.map +1 -0
- package/dist/esm/src/components/AssistiveText/AssistiveText.js +2 -10
- package/dist/esm/src/components/AssistiveText/AssistiveText.js.map +1 -0
- package/dist/esm/src/components/AssistiveText/AssistiveText.styl.js +2 -7
- package/dist/esm/src/components/AssistiveText/AssistiveText.styl.js.map +1 -0
- package/dist/esm/src/components/Autocomplete/Autocomplete.js +2 -428
- package/dist/esm/src/components/Autocomplete/Autocomplete.js.map +1 -0
- package/dist/esm/src/components/Autocomplete/Autocomplete.styl.js +2 -7
- package/dist/esm/src/components/Autocomplete/Autocomplete.styl.js.map +1 -0
- package/dist/esm/src/components/Button/Button.helpers.js +2 -12
- package/dist/esm/src/components/Button/Button.helpers.js.map +1 -0
- package/dist/esm/src/components/Button/Button.js +2 -38
- package/dist/esm/src/components/Button/Button.js.map +1 -0
- package/dist/esm/src/components/Button/Button.styl.js +2 -7
- package/dist/esm/src/components/Button/Button.styl.js.map +1 -0
- package/dist/esm/src/components/ButtonGroup/ButtonGroup.js +2 -10
- package/dist/esm/src/components/ButtonGroup/ButtonGroup.js.map +1 -0
- package/dist/esm/src/components/ButtonGroup/ButtonGroup.styl.js +2 -7
- package/dist/esm/src/components/ButtonGroup/ButtonGroup.styl.js.map +1 -0
- package/dist/esm/src/components/Calendar/Calendar.helpers.js +2 -65
- package/dist/esm/src/components/Calendar/Calendar.helpers.js.map +1 -0
- package/dist/esm/src/components/Calendar/Calendar.js +2 -136
- package/dist/esm/src/components/Calendar/Calendar.js.map +1 -0
- package/dist/esm/src/components/Calendar/Calendar.styl.js +2 -7
- package/dist/esm/src/components/Calendar/Calendar.styl.js.map +1 -0
- package/dist/esm/src/components/Card/Card.js +2 -55
- package/dist/esm/src/components/Card/Card.js.map +1 -0
- package/dist/esm/src/components/Card/Card.styl.js +2 -7
- package/dist/esm/src/components/Card/Card.styl.js.map +1 -0
- package/dist/esm/src/components/Checkbox/Checkbox.js +2 -19
- package/dist/esm/src/components/Checkbox/Checkbox.js.map +1 -0
- package/dist/esm/src/components/Checkbox/Checkbox.styl.js +2 -7
- package/dist/esm/src/components/Checkbox/Checkbox.styl.js.map +1 -0
- package/dist/esm/src/components/Chip/Chip.js +2 -16
- package/dist/esm/src/components/Chip/Chip.js.map +1 -0
- package/dist/esm/src/components/Chip/Chip.styl.js +2 -7
- package/dist/esm/src/components/Chip/Chip.styl.js.map +1 -0
- package/dist/esm/src/components/Container/Container.js +2 -13
- package/dist/esm/src/components/Container/Container.js.map +1 -0
- package/dist/esm/src/components/Container/Container.styl.js +2 -7
- package/dist/esm/src/components/Container/Container.styl.js.map +1 -0
- package/dist/esm/src/components/DatePicker/DatePicker.helpers.js +2 -33
- package/dist/esm/src/components/DatePicker/DatePicker.helpers.js.map +1 -0
- package/dist/esm/src/components/DatePicker/DatePicker.js +2 -47
- package/dist/esm/src/components/DatePicker/DatePicker.js.map +1 -0
- package/dist/esm/src/components/DatePicker/DatePicker.styl.js +2 -7
- package/dist/esm/src/components/DatePicker/DatePicker.styl.js.map +1 -0
- package/dist/esm/src/components/DatePickerInput/DatePickerInput.js +2 -44
- package/dist/esm/src/components/DatePickerInput/DatePickerInput.js.map +1 -0
- package/dist/esm/src/components/DatePickerInput/DatePickerInput.styl.js +2 -7
- package/dist/esm/src/components/DatePickerInput/DatePickerInput.styl.js.map +1 -0
- package/dist/esm/src/components/DateTime/DateTime.js +2 -17
- package/dist/esm/src/components/DateTime/DateTime.js.map +1 -0
- package/dist/esm/src/components/Dialogue/Dialogue.js +2 -107
- package/dist/esm/src/components/Dialogue/Dialogue.js.map +1 -0
- package/dist/esm/src/components/Dialogue/Dialogue.styl.js +2 -7
- package/dist/esm/src/components/Dialogue/Dialogue.styl.js.map +1 -0
- package/dist/esm/src/components/Draggable/Draggable.js +2 -147
- package/dist/esm/src/components/Draggable/Draggable.js.map +1 -0
- package/dist/esm/src/components/Draggable/Draggable.styl.js +2 -7
- package/dist/esm/src/components/Draggable/Draggable.styl.js.map +1 -0
- package/dist/esm/src/components/DropZone/DropZone.js +2 -112
- package/dist/esm/src/components/DropZone/DropZone.js.map +1 -0
- package/dist/esm/src/components/DropZone/DropZone.styl.js +2 -7
- package/dist/esm/src/components/DropZone/DropZone.styl.js.map +1 -0
- package/dist/esm/src/components/Expand/Expand.js +2 -24
- package/dist/esm/src/components/Expand/Expand.js.map +1 -0
- package/dist/esm/src/components/Expand/Expand.styl.js +2 -7
- package/dist/esm/src/components/Expand/Expand.styl.js.map +1 -0
- package/dist/esm/src/components/Flex/Flex.js +2 -24
- package/dist/esm/src/components/Flex/Flex.js.map +1 -0
- package/dist/esm/src/components/Flex/Flex.styl.js +2 -7
- package/dist/esm/src/components/Flex/Flex.styl.js.map +1 -0
- package/dist/esm/src/components/Form/Form.helpers.js +2 -42
- package/dist/esm/src/components/Form/Form.helpers.js.map +1 -0
- package/dist/esm/src/components/Form/Form.js +2 -272
- package/dist/esm/src/components/Form/Form.js.map +1 -0
- package/dist/esm/src/components/Form/Form.styl.js +2 -7
- package/dist/esm/src/components/Form/Form.styl.js.map +1 -0
- package/dist/esm/src/components/Form/Form.types.js +1 -0
- package/dist/esm/src/components/Form/Form.types.js.map +1 -0
- package/dist/esm/src/components/Form/SubmitButtons/SubmitButtons.js +2 -8
- package/dist/esm/src/components/Form/SubmitButtons/SubmitButtons.js.map +1 -0
- package/dist/esm/src/components/Form/SubmitButtons/SubmitButtons.styl.js +2 -7
- package/dist/esm/src/components/Form/SubmitButtons/SubmitButtons.styl.js.map +1 -0
- package/dist/esm/src/components/Form/Validator.js +6 -24
- package/dist/esm/src/components/Form/Validator.js.map +1 -0
- package/dist/esm/src/components/Gallery/Dots/Dots.js +2 -9
- package/dist/esm/src/components/Gallery/Dots/Dots.js.map +1 -0
- package/dist/esm/src/components/Gallery/Dots/Dots.styl.js +2 -7
- package/dist/esm/src/components/Gallery/Dots/Dots.styl.js.map +1 -0
- package/dist/esm/src/components/Gallery/Gallery.js +2 -222
- package/dist/esm/src/components/Gallery/Gallery.js.map +1 -0
- package/dist/esm/src/components/Gallery/Gallery.styl.js +2 -7
- package/dist/esm/src/components/Gallery/Gallery.styl.js.map +1 -0
- package/dist/esm/src/components/Heading/Heading.js +2 -37
- package/dist/esm/src/components/Heading/Heading.js.map +1 -0
- package/dist/esm/src/components/Heading/Heading.styl.js +2 -7
- package/dist/esm/src/components/Heading/Heading.styl.js.map +1 -0
- package/dist/esm/src/components/Icon/Icon.js +2 -21
- package/dist/esm/src/components/Icon/Icon.js.map +1 -0
- package/dist/esm/src/components/Icon/Icon.styl.js +2 -7
- package/dist/esm/src/components/Icon/Icon.styl.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/apple.svg.js +2 -16
- package/dist/esm/src/components/Icon/icons/apple.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/arrowDown.svg.js +2 -17
- package/dist/esm/src/components/Icon/icons/arrowDown.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/arrowLeft.svg.js +2 -17
- package/dist/esm/src/components/Icon/icons/arrowLeft.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/arrowRight.svg.js +2 -17
- package/dist/esm/src/components/Icon/icons/arrowRight.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/arrowUp.svg.js +2 -17
- package/dist/esm/src/components/Icon/icons/arrowUp.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/attach.svg.js +2 -19
- package/dist/esm/src/components/Icon/icons/attach.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/avatar.svg.js +2 -15
- package/dist/esm/src/components/Icon/icons/avatar.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/bookmark.svg.js +2 -17
- package/dist/esm/src/components/Icon/icons/bookmark.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/bookmarkAdd.svg.js +2 -17
- package/dist/esm/src/components/Icon/icons/bookmarkAdd.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/brain.svg.js +2 -22
- package/dist/esm/src/components/Icon/icons/brain.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/brokenImage.svg.js +2 -15
- package/dist/esm/src/components/Icon/icons/brokenImage.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/call.svg.js +2 -17
- package/dist/esm/src/components/Icon/icons/call.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/camera.svg.js +2 -17
- package/dist/esm/src/components/Icon/icons/camera.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/chat.svg.js +2 -17
- package/dist/esm/src/components/Icon/icons/chat.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/check.svg.js +2 -19
- package/dist/esm/src/components/Icon/icons/check.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/checkers.svg.js +2 -18
- package/dist/esm/src/components/Icon/icons/checkers.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/chevronDown.svg.js +2 -20
- package/dist/esm/src/components/Icon/icons/chevronDown.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/chevronLeft.svg.js +2 -20
- package/dist/esm/src/components/Icon/icons/chevronLeft.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/chevronRight.svg.js +2 -20
- package/dist/esm/src/components/Icon/icons/chevronRight.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/chevronUp.svg.js +2 -20
- package/dist/esm/src/components/Icon/icons/chevronUp.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/clearAll.svg.js +2 -17
- package/dist/esm/src/components/Icon/icons/clearAll.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/close.svg.js +2 -15
- package/dist/esm/src/components/Icon/icons/close.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/colors.svg.js +2 -60
- package/dist/esm/src/components/Icon/icons/colors.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/compass.svg.js +2 -56
- package/dist/esm/src/components/Icon/icons/compass.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/copy.svg.js +2 -15
- package/dist/esm/src/components/Icon/icons/copy.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/cubes.svg.js +2 -17
- package/dist/esm/src/components/Icon/icons/cubes.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/delete.svg.js +2 -15
- package/dist/esm/src/components/Icon/icons/delete.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/discord.svg.js +2 -17
- package/dist/esm/src/components/Icon/icons/discord.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/draft.svg.js +2 -15
- package/dist/esm/src/components/Icon/icons/draft.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/dragHandlerHorizontal.svg.js +2 -15
- package/dist/esm/src/components/Icon/icons/dragHandlerHorizontal.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/dragHandlerVertical.svg.js +2 -15
- package/dist/esm/src/components/Icon/icons/dragHandlerVertical.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/edit.svg.js +2 -15
- package/dist/esm/src/components/Icon/icons/edit.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/email.svg.js +2 -15
- package/dist/esm/src/components/Icon/icons/email.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/externalLink.svg.js +2 -15
- package/dist/esm/src/components/Icon/icons/externalLink.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/eye.svg.js +2 -15
- package/dist/esm/src/components/Icon/icons/eye.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/flyover.svg.js +2 -17
- package/dist/esm/src/components/Icon/icons/flyover.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/folder.svg.js +2 -17
- package/dist/esm/src/components/Icon/icons/folder.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/folderOpen.svg.js +2 -17
- package/dist/esm/src/components/Icon/icons/folderOpen.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/forward.svg.js +2 -17
- package/dist/esm/src/components/Icon/icons/forward.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/fullscreen.svg.js +2 -15
- package/dist/esm/src/components/Icon/icons/fullscreen.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/fullscreenExit.svg.js +2 -15
- package/dist/esm/src/components/Icon/icons/fullscreenExit.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/function.svg.js +2 -15
- package/dist/esm/src/components/Icon/icons/function.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/gear.svg.js +2 -21
- package/dist/esm/src/components/Icon/icons/gear.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/geolocation.svg.js +2 -17
- package/dist/esm/src/components/Icon/icons/geolocation.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/github.svg.js +2 -18
- package/dist/esm/src/components/Icon/icons/github.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/globe.svg.js +2 -17
- package/dist/esm/src/components/Icon/icons/globe.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/google.svg.js +2 -42
- package/dist/esm/src/components/Icon/icons/google.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/group.svg.js +2 -15
- package/dist/esm/src/components/Icon/icons/group.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/history.svg.js +2 -17
- package/dist/esm/src/components/Icon/icons/history.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/home.svg.js +2 -19
- package/dist/esm/src/components/Icon/icons/home.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/image.svg.js +2 -17
- package/dist/esm/src/components/Icon/icons/image.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/index.js +2 -95
- package/dist/esm/src/components/Icon/icons/index.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/instagram.svg.js +2 -15
- package/dist/esm/src/components/Icon/icons/instagram.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/layers.svg.js +2 -17
- package/dist/esm/src/components/Icon/icons/layers.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/link.svg.js +2 -15
- package/dist/esm/src/components/Icon/icons/link.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/linkedin.svg.js +2 -20
- package/dist/esm/src/components/Icon/icons/linkedin.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/loader.svg.js +2 -45
- package/dist/esm/src/components/Icon/icons/loader.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/lock.svg.js +2 -19
- package/dist/esm/src/components/Icon/icons/lock.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/lockOpen.svg.js +2 -19
- package/dist/esm/src/components/Icon/icons/lockOpen.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/map.svg.js +2 -17
- package/dist/esm/src/components/Icon/icons/map.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/menu.svg.js +2 -18
- package/dist/esm/src/components/Icon/icons/menu.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/mic.svg.js +2 -15
- package/dist/esm/src/components/Icon/icons/mic.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/micMuted.svg.js +2 -27
- package/dist/esm/src/components/Icon/icons/micMuted.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/minus.svg.js +2 -15
- package/dist/esm/src/components/Icon/icons/minus.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/moreHorizontal.svg.js +2 -15
- package/dist/esm/src/components/Icon/icons/moreHorizontal.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/moreVertical.svg.js +2 -15
- package/dist/esm/src/components/Icon/icons/moreVertical.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/output.svg.js +2 -15
- package/dist/esm/src/components/Icon/icons/output.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/pause.svg.js +2 -15
- package/dist/esm/src/components/Icon/icons/pause.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/play.svg.js +2 -20
- package/dist/esm/src/components/Icon/icons/play.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/plus.svg.js +2 -15
- package/dist/esm/src/components/Icon/icons/plus.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/redo.svg.js +2 -15
- package/dist/esm/src/components/Icon/icons/redo.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/requiredStar.svg.js +2 -15
- package/dist/esm/src/components/Icon/icons/requiredStar.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/rewind.svg.js +2 -17
- package/dist/esm/src/components/Icon/icons/rewind.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/rocket.svg.js +2 -22
- package/dist/esm/src/components/Icon/icons/rocket.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/route.svg.js +2 -17
- package/dist/esm/src/components/Icon/icons/route.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/routeFrom.svg.js +2 -31
- package/dist/esm/src/components/Icon/icons/routeFrom.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/routeTo.svg.js +2 -31
- package/dist/esm/src/components/Icon/icons/routeTo.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/save.svg.js +2 -17
- package/dist/esm/src/components/Icon/icons/save.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/search.svg.js +2 -17
- package/dist/esm/src/components/Icon/icons/search.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/send.svg.js +2 -16
- package/dist/esm/src/components/Icon/icons/send.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/settings.svg.js +2 -52
- package/dist/esm/src/components/Icon/icons/settings.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/shoppingBag.svg.js +2 -17
- package/dist/esm/src/components/Icon/icons/shoppingBag.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/smile.svg.js +2 -30
- package/dist/esm/src/components/Icon/icons/smile.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/soundWave.svg.js +2 -66
- package/dist/esm/src/components/Icon/icons/soundWave.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/sparks.svg.js +2 -21
- package/dist/esm/src/components/Icon/icons/sparks.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/star.svg.js +2 -18
- package/dist/esm/src/components/Icon/icons/star.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/stop.svg.js +2 -22
- package/dist/esm/src/components/Icon/icons/stop.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/stopInCircle.svg.js +2 -17
- package/dist/esm/src/components/Icon/icons/stopInCircle.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/syncArrows.svg.js +2 -22
- package/dist/esm/src/components/Icon/icons/syncArrows.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/table.svg.js +2 -15
- package/dist/esm/src/components/Icon/icons/table.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/telegram.svg.js +2 -19
- package/dist/esm/src/components/Icon/icons/telegram.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/tool.svg.js +2 -17
- package/dist/esm/src/components/Icon/icons/tool.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/trafficLight.svg.js +2 -49
- package/dist/esm/src/components/Icon/icons/trafficLight.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/undo.svg.js +2 -15
- package/dist/esm/src/components/Icon/icons/undo.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/usage.svg.js +2 -25
- package/dist/esm/src/components/Icon/icons/usage.svg.js.map +1 -0
- package/dist/esm/src/components/Icon/icons/youtube.svg.js +2 -20
- package/dist/esm/src/components/Icon/icons/youtube.svg.js.map +1 -0
- package/dist/esm/src/components/Input/Input.js +2 -281
- package/dist/esm/src/components/Input/Input.js.map +1 -0
- package/dist/esm/src/components/Input/Input.styl.js +2 -7
- package/dist/esm/src/components/Input/Input.styl.js.map +1 -0
- package/dist/esm/src/components/InputFile/InputFile.js +2 -313
- package/dist/esm/src/components/InputFile/InputFile.js.map +1 -0
- package/dist/esm/src/components/InputFile/InputFile.styl.js +2 -7
- package/dist/esm/src/components/InputFile/InputFile.styl.js.map +1 -0
- package/dist/esm/src/components/InputFile/InputFile.types.js +1 -0
- package/dist/esm/src/components/InputFile/InputFile.types.js.map +1 -0
- package/dist/esm/src/components/InputFile/Item/Item.js +2 -18
- package/dist/esm/src/components/InputFile/Item/Item.js.map +1 -0
- package/dist/esm/src/components/InputFile/Item/Item.styl.js +2 -7
- package/dist/esm/src/components/InputFile/Item/Item.styl.js.map +1 -0
- package/dist/esm/src/components/Label/Label.constants.json.js +2 -8
- package/dist/esm/src/components/Label/Label.constants.json.js.map +1 -0
- package/dist/esm/src/components/Label/Label.helpers.js +2 -35
- package/dist/esm/src/components/Label/Label.helpers.js.map +1 -0
- package/dist/esm/src/components/Label/Label.js +2 -58
- package/dist/esm/src/components/Label/Label.js.map +1 -0
- package/dist/esm/src/components/Label/Label.styl.js +2 -7
- package/dist/esm/src/components/Label/Label.styl.js.map +1 -0
- package/dist/esm/src/components/LangSelector/LangSelector.js +2 -10
- package/dist/esm/src/components/LangSelector/LangSelector.js.map +1 -0
- package/dist/esm/src/components/Lazy/Lazy.js +2 -74
- package/dist/esm/src/components/Lazy/Lazy.js.map +1 -0
- package/dist/esm/src/components/LightBox/LightBox.js +2 -28
- package/dist/esm/src/components/LightBox/LightBox.js.map +1 -0
- package/dist/esm/src/components/LightBox/LightBox.styl.js +2 -7
- package/dist/esm/src/components/LightBox/LightBox.styl.js.map +1 -0
- package/dist/esm/src/components/Menu/Menu.js +2 -27
- package/dist/esm/src/components/Menu/Menu.js.map +1 -0
- package/dist/esm/src/components/Menu/Menu.styl.js +2 -7
- package/dist/esm/src/components/Menu/Menu.styl.js.map +1 -0
- package/dist/esm/src/components/Notifications/Notifications.constants.json.js +2 -6
- package/dist/esm/src/components/Notifications/Notifications.constants.json.js.map +1 -0
- package/dist/esm/src/components/Notifications/Notifications.js +2 -67
- package/dist/esm/src/components/Notifications/Notifications.js.map +1 -0
- package/dist/esm/src/components/Notifications/Notifications.styl.js +2 -7
- package/dist/esm/src/components/Notifications/Notifications.styl.js.map +1 -0
- package/dist/esm/src/components/Notifications/store.js +2 -61
- package/dist/esm/src/components/Notifications/store.js.map +1 -0
- package/dist/esm/src/components/Paranja/Paranja.js +2 -14
- package/dist/esm/src/components/Paranja/Paranja.js.map +1 -0
- package/dist/esm/src/components/Paranja/Paranja.styl.js +2 -7
- package/dist/esm/src/components/Paranja/Paranja.styl.js.map +1 -0
- package/dist/esm/src/components/Popup/Popup.helpers.js +2 -130
- package/dist/esm/src/components/Popup/Popup.helpers.js.map +1 -0
- package/dist/esm/src/components/Popup/Popup.js +2 -484
- package/dist/esm/src/components/Popup/Popup.js.map +1 -0
- package/dist/esm/src/components/Popup/Popup.styl.js +2 -7
- package/dist/esm/src/components/Popup/Popup.styl.js.map +1 -0
- package/dist/esm/src/components/PopupMenu/PopupMenu.js +2 -15
- package/dist/esm/src/components/PopupMenu/PopupMenu.js.map +1 -0
- package/dist/esm/src/components/PopupMenu/PopupMenu.styl.js +2 -7
- package/dist/esm/src/components/PopupMenu/PopupMenu.styl.js.map +1 -0
- package/dist/esm/src/components/Portal/Portal.js +2 -33
- package/dist/esm/src/components/Portal/Portal.js.map +1 -0
- package/dist/esm/src/components/Progress/Progress.helpers.js +2 -5
- package/dist/esm/src/components/Progress/Progress.helpers.js.map +1 -0
- package/dist/esm/src/components/Progress/Progress.js +2 -12
- package/dist/esm/src/components/Progress/Progress.js.map +1 -0
- package/dist/esm/src/components/Progress/Progress.styl.js +2 -7
- package/dist/esm/src/components/Progress/Progress.styl.js.map +1 -0
- package/dist/esm/src/components/ProgressCircular/ProgressCircular.js +2 -23
- package/dist/esm/src/components/ProgressCircular/ProgressCircular.js.map +1 -0
- package/dist/esm/src/components/ProgressCircular/ProgressCircular.styl.js +2 -7
- package/dist/esm/src/components/ProgressCircular/ProgressCircular.styl.js.map +1 -0
- package/dist/esm/src/components/RadioButton/RadioButton.js +2 -33
- package/dist/esm/src/components/RadioButton/RadioButton.js.map +1 -0
- package/dist/esm/src/components/RadioButton/RadioButton.styl.js +2 -7
- package/dist/esm/src/components/RadioButton/RadioButton.styl.js.map +1 -0
- package/dist/esm/src/components/RadioGroup/RadioGroup.js +2 -31
- package/dist/esm/src/components/RadioGroup/RadioGroup.js.map +1 -0
- package/dist/esm/src/components/RadioGroup/RadioGroup.styl.js +2 -7
- package/dist/esm/src/components/RadioGroup/RadioGroup.styl.js.map +1 -0
- package/dist/esm/src/components/RadioGroup/RadioGroupContext.js +2 -8
- package/dist/esm/src/components/RadioGroup/RadioGroupContext.js.map +1 -0
- package/dist/esm/src/components/RequiredStar/RequiredStar.js +2 -12
- package/dist/esm/src/components/RequiredStar/RequiredStar.js.map +1 -0
- package/dist/esm/src/components/RequiredStar/RequiredStar.styl.js +2 -7
- package/dist/esm/src/components/RequiredStar/RequiredStar.styl.js.map +1 -0
- package/dist/esm/src/components/Router/Link/Link.js +2 -62
- package/dist/esm/src/components/Router/Link/Link.js.map +1 -0
- package/dist/esm/src/components/Router/Link/Link.styl.js +2 -7
- package/dist/esm/src/components/Router/Link/Link.styl.js.map +1 -0
- package/dist/esm/src/components/Router/Redirect.js +2 -12
- package/dist/esm/src/components/Router/Redirect.js.map +1 -0
- package/dist/esm/src/components/Router/Route.js +2 -6
- package/dist/esm/src/components/Router/Route.js.map +1 -0
- package/dist/esm/src/components/Router/Router.helpers.js +2 -33
- package/dist/esm/src/components/Router/Router.helpers.js.map +1 -0
- package/dist/esm/src/components/Router/Router.js +2 -72
- package/dist/esm/src/components/Router/Router.js.map +1 -0
- package/dist/esm/src/components/Router/context.js +2 -5
- package/dist/esm/src/components/Router/context.js.map +1 -0
- package/dist/esm/src/components/Router/store.js +2 -75
- package/dist/esm/src/components/Router/store.js.map +1 -0
- package/dist/esm/src/components/Scroll/Scroll.js +2 -308
- package/dist/esm/src/components/Scroll/Scroll.js.map +1 -0
- package/dist/esm/src/components/Scroll/Scroll.styl.js +2 -7
- package/dist/esm/src/components/Scroll/Scroll.styl.js.map +1 -0
- package/dist/esm/src/components/Select/Select.helpers.js +2 -37
- package/dist/esm/src/components/Select/Select.helpers.js.map +1 -0
- package/dist/esm/src/components/Select/Select.js +2 -601
- package/dist/esm/src/components/Select/Select.js.map +1 -0
- package/dist/esm/src/components/Select/Select.styl.js +2 -7
- package/dist/esm/src/components/Select/Select.styl.js.map +1 -0
- package/dist/esm/src/components/Select/Select2.js +2 -334
- package/dist/esm/src/components/Select/Select2.js.map +1 -0
- package/dist/esm/src/components/Shimmer/Shimmer.js +2 -7
- package/dist/esm/src/components/Shimmer/Shimmer.js.map +1 -0
- package/dist/esm/src/components/Shimmer/Shimmer.styl.js +2 -7
- package/dist/esm/src/components/Shimmer/Shimmer.styl.js.map +1 -0
- package/dist/esm/src/components/Spinner/Spinner.js +2 -11
- package/dist/esm/src/components/Spinner/Spinner.js.map +1 -0
- package/dist/esm/src/components/Spinner/Spinner.styl.js +2 -7
- package/dist/esm/src/components/Spinner/Spinner.styl.js.map +1 -0
- package/dist/esm/src/components/Spinner/spinner.svg.js +2 -24
- package/dist/esm/src/components/Spinner/spinner.svg.js.map +1 -0
- package/dist/esm/src/components/Table/Table.js +2 -24
- package/dist/esm/src/components/Table/Table.js.map +1 -0
- package/dist/esm/src/components/Table/Table.styl.js +2 -7
- package/dist/esm/src/components/Table/Table.styl.js.map +1 -0
- package/dist/esm/src/components/Tabs/Tabs.js +2 -48
- package/dist/esm/src/components/Tabs/Tabs.js.map +1 -0
- package/dist/esm/src/components/Tabs/Tabs.styl.js +2 -7
- package/dist/esm/src/components/Tabs/Tabs.styl.js.map +1 -0
- package/dist/esm/src/components/Text/Text.js +2 -44
- package/dist/esm/src/components/Text/Text.js.map +1 -0
- package/dist/esm/src/components/Text/Text.styl.js +2 -7
- package/dist/esm/src/components/Text/Text.styl.js.map +1 -0
- package/dist/esm/src/components/Theme/Theme.defaults.js +2 -53
- package/dist/esm/src/components/Theme/Theme.defaults.js.map +1 -0
- package/dist/esm/src/components/Theme/Theme.helpers.js +2 -67
- package/dist/esm/src/components/Theme/Theme.helpers.js.map +1 -0
- package/dist/esm/src/components/Theme/Theme.js +2 -15
- package/dist/esm/src/components/Theme/Theme.js.map +1 -0
- package/dist/esm/src/components/Theme/ThemeProvider.js +2 -50
- package/dist/esm/src/components/Theme/ThemeProvider.js.map +1 -0
- package/dist/esm/src/components/Toggle/Toggle.js +2 -18
- package/dist/esm/src/components/Toggle/Toggle.js.map +1 -0
- package/dist/esm/src/components/Toggle/Toggle.styl.js +2 -7
- package/dist/esm/src/components/Toggle/Toggle.styl.js.map +1 -0
- package/dist/esm/src/components/Tooltip/Tooltip.js +2 -86
- package/dist/esm/src/components/Tooltip/Tooltip.js.map +1 -0
- package/dist/esm/src/components/Tooltip/Tooltip.styl.js +2 -7
- package/dist/esm/src/components/Tooltip/Tooltip.styl.js.map +1 -0
- package/dist/esm/src/components/VH/VH.js +2 -33
- package/dist/esm/src/components/VH/VH.js.map +1 -0
- package/dist/esm/src/components/Virtualized/List/List.js +2 -136
- package/dist/esm/src/components/Virtualized/List/List.js.map +1 -0
- package/dist/esm/src/components/Virtualized/List/List.styl.js +2 -7
- package/dist/esm/src/components/Virtualized/List/List.styl.js.map +1 -0
- package/dist/esm/src/components/Virtualized/List/ListScroll.js +2 -22
- package/dist/esm/src/components/Virtualized/List/ListScroll.js.map +1 -0
- package/dist/esm/src/components/Virtualized/List/ListScroll.styl.js +2 -7
- package/dist/esm/src/components/Virtualized/List/ListScroll.styl.js.map +1 -0
- package/dist/esm/src/components/Virtualized/Virtualized.helpers.js +2 -14
- package/dist/esm/src/components/Virtualized/Virtualized.helpers.js.map +1 -0
- package/dist/esm/src/components/Virtualized/Virtualized.js +2 -218
- package/dist/esm/src/components/Virtualized/Virtualized.js.map +1 -0
- package/dist/esm/src/components/Virtualized/Virtualized.styl.js +2 -7
- package/dist/esm/src/components/Virtualized/Virtualized.styl.js.map +1 -0
- package/dist/esm/src/components/Virtualized/Virtualized.types.js +1 -0
- package/dist/esm/src/components/Virtualized/Virtualized.types.js.map +1 -0
- package/dist/esm/src/hooks/useDebounce.js +2 -11
- package/dist/esm/src/hooks/useDebounce.js.map +1 -0
- package/dist/esm/src/hooks/useEvent.js +2 -27
- package/dist/esm/src/hooks/useEvent.js.map +1 -0
- package/dist/esm/src/hooks/useIsMounted.js +2 -11
- package/dist/esm/src/hooks/useIsMounted.js.map +1 -0
- package/dist/esm/src/hooks/useListKeyboardControl.js +2 -50
- package/dist/esm/src/hooks/useListKeyboardControl.js.map +1 -0
- package/dist/esm/src/hooks/useResizeObserver.js +2 -15
- package/dist/esm/src/hooks/useResizeObserver.js.map +1 -0
- package/dist/esm/src/hooks/useThrottle.js +2 -31
- package/dist/esm/src/hooks/useThrottle.js.map +1 -0
- package/dist/esm/src/hooks/useToggleState.js +2 -35
- package/dist/esm/src/hooks/useToggleState.js.map +1 -0
- package/dist/esm/src/services/i18n.js +2 -112
- package/dist/esm/src/services/i18n.js.map +1 -0
- package/dist/esm/src/tools/array.js +2 -60
- package/dist/esm/src/tools/array.js.map +1 -0
- package/dist/esm/src/tools/config.js +2 -9
- package/dist/esm/src/tools/config.js.map +1 -0
- package/dist/esm/src/tools/date.js +2 -11
- package/dist/esm/src/tools/date.js.map +1 -0
- package/dist/esm/src/tools/debounce.js +2 -11
- package/dist/esm/src/tools/debounce.js.map +1 -0
- package/dist/esm/src/tools/dom.js +2 -57
- package/dist/esm/src/tools/dom.js.map +1 -0
- package/dist/esm/src/tools/env.js +2 -3
- package/dist/esm/src/tools/env.js.map +1 -0
- package/dist/esm/src/tools/file.js +2 -11
- package/dist/esm/src/tools/file.js.map +1 -0
- package/dist/esm/src/tools/localStorage.js +2 -31
- package/dist/esm/src/tools/localStorage.js.map +1 -0
- package/dist/esm/src/tools/number.js +2 -27
- package/dist/esm/src/tools/number.js.map +1 -0
- package/dist/esm/src/tools/object.js +2 -5
- package/dist/esm/src/tools/object.js.map +1 -0
- package/dist/esm/src/tools/queryParams.js +2 -40
- package/dist/esm/src/tools/queryParams.js.map +1 -0
- package/dist/esm/src/tools/rangeMap.js +2 -3
- package/dist/esm/src/tools/rangeMap.js.map +1 -0
- package/dist/esm/src/tools/resizeObserver.js +2 -68
- package/dist/esm/src/tools/resizeObserver.js.map +1 -0
- package/dist/esm/src/tools/scroll.js +2 -41
- package/dist/esm/src/tools/scroll.js.map +1 -0
- package/dist/esm/src/tools/string.js +2 -7
- package/dist/esm/src/tools/string.js.map +1 -0
- package/dist/esm/src/tools/throttle.js +2 -30
- package/dist/esm/src/tools/throttle.js.map +1 -0
- package/dist/esm/src/tools/uid.js +2 -7
- package/dist/esm/src/tools/uid.js.map +1 -0
- package/dist/esm/types/src/components/Select/Select.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,7 +1,2 @@
|
|
|
1
|
-
import styleInject from
|
|
2
|
-
|
|
3
|
-
var css_248z = ".ListScroll_x__tSPeG{width:100%}.ListScroll_y__mvFCU{height:100%}";
|
|
4
|
-
var S = {"x":"ListScroll_x__tSPeG","y":"ListScroll_y__mvFCU"};
|
|
5
|
-
styleInject(css_248z);
|
|
6
|
-
|
|
7
|
-
export { S as default };
|
|
1
|
+
import styleInject from"../../../../node_modules/style-inject/dist/style-inject.es.js";var css_248z=".ListScroll_x__tSPeG{width:100%}.ListScroll_y__mvFCU{height:100%}",S={x:"ListScroll_x__tSPeG",y:"ListScroll_y__mvFCU"};styleInject(css_248z);export{S as default};
|
|
2
|
+
//# sourceMappingURL=ListScroll.styl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListScroll.styl.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,14 +1,2 @@
|
|
|
1
|
-
function getLastIndex(scrollTop,
|
|
2
|
-
|
|
3
|
-
}
|
|
4
|
-
// Returns indexes of first and last items to be rendered
|
|
5
|
-
function getIndexes({ scrollTop, clientHeight, itemHeight, itemsCount, totalCount, overlapCount, }) {
|
|
6
|
-
const first = Math.max(0, Math.floor(scrollTop / itemHeight - overlapCount));
|
|
7
|
-
const last = Math.min(Math.max(first, itemsCount + overlapCount - 1), getLastIndex(scrollTop, clientHeight, itemHeight, overlapCount, totalCount));
|
|
8
|
-
return { first, last };
|
|
9
|
-
}
|
|
10
|
-
function getHeight({ itemsCount, itemHeight, offsetBefore = 0, offsetAfter = 0, }) {
|
|
11
|
-
return itemsCount * itemHeight + offsetBefore + offsetAfter;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export { getHeight, getIndexes, getLastIndex };
|
|
1
|
+
function getLastIndex(t,e,n,o,i){return Math.min(i-1,Math.floor((t+e)/n+o))}function getIndexes({scrollTop:t,clientHeight:e,itemHeight:n,itemsCount:o,totalCount:i,overlapCount:a}){var r=Math.max(0,Math.floor(t/n-a));return{first:r,last:Math.min(Math.max(r,o+a-1),getLastIndex(t,e,n,a,i))}}function getHeight({itemsCount:t,itemHeight:e,offsetBefore:n=0,offsetAfter:o=0}){return t*e+n+o}export{getHeight,getIndexes,getLastIndex};
|
|
2
|
+
//# sourceMappingURL=Virtualized.helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Virtualized.helpers.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,218 +1,2 @@
|
|
|
1
|
-
import { Component }
|
|
2
|
-
|
|
3
|
-
import pick from 'lodash.pick';
|
|
4
|
-
import compare from 'compareq';
|
|
5
|
-
import Time from 'timen';
|
|
6
|
-
import debounce from '../../tools/debounce.js';
|
|
7
|
-
import throttle from '../../tools/throttle.js';
|
|
8
|
-
import { getHeight, getIndexes } from './Virtualized.helpers.js';
|
|
9
|
-
import S from './Virtualized.styl.js';
|
|
10
|
-
|
|
11
|
-
class Virtualized extends Component {
|
|
12
|
-
clearUnfreezeTimer;
|
|
13
|
-
scrollTopInited = false;
|
|
14
|
-
scrollElem;
|
|
15
|
-
lastScrollEndIndex = 0;
|
|
16
|
-
onScrollThrottled;
|
|
17
|
-
onScrollDebounced;
|
|
18
|
-
static defaultProps = {
|
|
19
|
-
overlapCount: 10,
|
|
20
|
-
pageSize: 20,
|
|
21
|
-
};
|
|
22
|
-
constructor(props) {
|
|
23
|
-
super(props);
|
|
24
|
-
this.state = {
|
|
25
|
-
id: null,
|
|
26
|
-
height: getHeight(props),
|
|
27
|
-
first: 0,
|
|
28
|
-
last: 0,
|
|
29
|
-
isFreezed: false,
|
|
30
|
-
};
|
|
31
|
-
this.onScrollThrottled = throttle(this._onScroll, 150);
|
|
32
|
-
this.onScrollDebounced = debounce(this._onScroll, 150);
|
|
33
|
-
this.checkIfEnd = debounce(this.checkIfEnd, 200);
|
|
34
|
-
}
|
|
35
|
-
static getDerivedStateFromProps(props, { height }) {
|
|
36
|
-
const newHeight = getHeight(props);
|
|
37
|
-
if (newHeight !== height)
|
|
38
|
-
return { height: newHeight };
|
|
39
|
-
return null;
|
|
40
|
-
}
|
|
41
|
-
componentDidMount() {
|
|
42
|
-
const indexes = this.getIndexes();
|
|
43
|
-
this.setState(indexes); // eslint-disable-line
|
|
44
|
-
// });
|
|
45
|
-
// document.addEventListener('scroll', this.onScroll, true);
|
|
46
|
-
}
|
|
47
|
-
getSnapshotBeforeUpdate(prevProps) {
|
|
48
|
-
const { itemHeight, itemsCount } = this.props;
|
|
49
|
-
if (itemsCount === 0 && itemsCount !== prevProps.itemsCount)
|
|
50
|
-
return 0;
|
|
51
|
-
if (this.scrollElem) {
|
|
52
|
-
if (itemHeight !== prevProps.itemHeight)
|
|
53
|
-
return (itemHeight / prevProps.itemHeight) * this.scrollElem.scrollTop;
|
|
54
|
-
}
|
|
55
|
-
return null;
|
|
56
|
-
}
|
|
57
|
-
shouldComponentUpdate(nextProps, nextState) {
|
|
58
|
-
if (nextProps.id !== this.props.id)
|
|
59
|
-
return true;
|
|
60
|
-
if (nextProps.itemsCount !== this.props.itemsCount)
|
|
61
|
-
return true;
|
|
62
|
-
if (nextProps.wrapElem !== this.props.wrapElem)
|
|
63
|
-
return true;
|
|
64
|
-
if (nextProps.renderItem !== this.props.renderItem)
|
|
65
|
-
return true;
|
|
66
|
-
if (nextProps.totalCount !== this.props.totalCount)
|
|
67
|
-
return true;
|
|
68
|
-
if (nextProps.itemHeight !== this.props.itemHeight)
|
|
69
|
-
return true;
|
|
70
|
-
if (nextProps.overlapCount !== this.props.overlapCount)
|
|
71
|
-
return true;
|
|
72
|
-
if (nextProps.getItemProps !== this.props.getItemProps)
|
|
73
|
-
return true;
|
|
74
|
-
if (!compare(nextState, this.state))
|
|
75
|
-
return true;
|
|
76
|
-
return false;
|
|
77
|
-
}
|
|
78
|
-
componentDidUpdate(prevProps, prevState, snapshot) {
|
|
79
|
-
const state = {};
|
|
80
|
-
const scrollElemUpdated = this.scrollElem !== this.props.wrapElem;
|
|
81
|
-
if (scrollElemUpdated)
|
|
82
|
-
this.scrollElem = this.props.wrapElem;
|
|
83
|
-
if (this.scrollElem) {
|
|
84
|
-
const newScrollTop = this.getNewScrollTop(prevProps, snapshot);
|
|
85
|
-
if (typeof newScrollTop === 'number')
|
|
86
|
-
this.scrollElem.scrollTop = newScrollTop;
|
|
87
|
-
}
|
|
88
|
-
if (prevProps.id !== this.props.id)
|
|
89
|
-
state.id = this.props.id;
|
|
90
|
-
if (scrollElemUpdated || this.needUpdateIndexes(prevProps))
|
|
91
|
-
Object.assign(state, this.getIndexes());
|
|
92
|
-
if (this.needUpdateHeight(prevProps))
|
|
93
|
-
state.height = getHeight(this.props);
|
|
94
|
-
if (Object.keys(state).length)
|
|
95
|
-
this.setState(state);
|
|
96
|
-
}
|
|
97
|
-
componentWillUnmount() {
|
|
98
|
-
this.clearUnfreezeTimer?.();
|
|
99
|
-
}
|
|
100
|
-
needUpdateIndexes(prevProps) {
|
|
101
|
-
// const { wrapElem } = this.props;
|
|
102
|
-
// if (!prevProps.wrapElem && wrapElem) return true;
|
|
103
|
-
return ['id', 'itemsCount', 'totalCount', 'overlapCount'].some(key => prevProps[key] !== this.props[key]);
|
|
104
|
-
}
|
|
105
|
-
needUpdateHeight(prevProps) {
|
|
106
|
-
return ['totalCount', 'offsetAfter'].some(key => prevProps[key] !== this.props[key]);
|
|
107
|
-
}
|
|
108
|
-
getNewScrollTop(prevProps, snapshot) {
|
|
109
|
-
const { initialScrollTop, scrollTop, itemsCount } = this.props;
|
|
110
|
-
if (!this.scrollTopInited) {
|
|
111
|
-
const scrollValue = initialScrollTop ?? scrollTop;
|
|
112
|
-
if (scrollValue && prevProps.itemsCount && itemsCount) {
|
|
113
|
-
this.scrollTopInited = true;
|
|
114
|
-
return scrollValue;
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
if (prevProps.initialScrollTop > 0 && initialScrollTop === 0)
|
|
118
|
-
return 0;
|
|
119
|
-
if (typeof scrollTop === 'number' && scrollTop !== prevProps.scrollTop)
|
|
120
|
-
return scrollTop;
|
|
121
|
-
if (typeof snapshot === 'number')
|
|
122
|
-
return snapshot;
|
|
123
|
-
return null;
|
|
124
|
-
}
|
|
125
|
-
getIndexes() {
|
|
126
|
-
// const { wrapElem } = this.props;
|
|
127
|
-
if (!this.scrollElem)
|
|
128
|
-
return null;
|
|
129
|
-
const { scrollTop, clientHeight } = this.scrollElem;
|
|
130
|
-
return getIndexes({
|
|
131
|
-
scrollTop,
|
|
132
|
-
clientHeight,
|
|
133
|
-
...pick(this.props, [
|
|
134
|
-
'itemsCount',
|
|
135
|
-
'totalCount',
|
|
136
|
-
'itemHeight',
|
|
137
|
-
'overlapCount',
|
|
138
|
-
]),
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
_onScroll = e => {
|
|
142
|
-
this.scrollElem = e.target;
|
|
143
|
-
const { onScroll } = this.props;
|
|
144
|
-
const indexes = this.getIndexes();
|
|
145
|
-
const { scrollTop } = this.scrollElem;
|
|
146
|
-
if (onScroll)
|
|
147
|
-
onScroll({ scrollTop, ...indexes });
|
|
148
|
-
this.checkIfEnd();
|
|
149
|
-
if (!compare(indexes, pick(this.state, ['first', 'last'])))
|
|
150
|
-
this.setState({ ...indexes });
|
|
151
|
-
this.unfreeze();
|
|
152
|
-
};
|
|
153
|
-
onScroll = (e) => {
|
|
154
|
-
this.onScrollThrottled(e);
|
|
155
|
-
this.onScrollDebounced(e);
|
|
156
|
-
};
|
|
157
|
-
checkIfEnd = () => {
|
|
158
|
-
const { itemsCount, totalCount, pageSize, onScrollEnd } = this.props;
|
|
159
|
-
if (itemsCount === totalCount)
|
|
160
|
-
return;
|
|
161
|
-
if (itemsCount < this.lastScrollEndIndex) {
|
|
162
|
-
this.lastScrollEndIndex = 0; // Reset when list shrinks (e.g. filter cleared)
|
|
163
|
-
}
|
|
164
|
-
this.lastScrollEndIndex = Math.min(itemsCount + pageSize, totalCount);
|
|
165
|
-
onScrollEnd?.();
|
|
166
|
-
};
|
|
167
|
-
unfreeze = () => {
|
|
168
|
-
this.clearUnfreezeTimer?.();
|
|
169
|
-
this.clearUnfreezeTimer = Time.after(200, () => {
|
|
170
|
-
this.setState({ isFreezed: false });
|
|
171
|
-
});
|
|
172
|
-
};
|
|
173
|
-
getItemProps = (index) => {
|
|
174
|
-
const { getItemProps, offsetBefore, offsetAfter } = this.props;
|
|
175
|
-
const props = {
|
|
176
|
-
className: S.item,
|
|
177
|
-
key: index,
|
|
178
|
-
};
|
|
179
|
-
if (getItemProps) {
|
|
180
|
-
const { className, ...rest } = getItemProps({
|
|
181
|
-
index,
|
|
182
|
-
offsetBefore,
|
|
183
|
-
offsetAfter,
|
|
184
|
-
});
|
|
185
|
-
props.className = cn(props.className, className);
|
|
186
|
-
Object.assign(props, rest);
|
|
187
|
-
}
|
|
188
|
-
return props;
|
|
189
|
-
};
|
|
190
|
-
renderItems() {
|
|
191
|
-
const { itemsCount, renderItem } = this.props;
|
|
192
|
-
const { first, last } = this.state;
|
|
193
|
-
const items = [];
|
|
194
|
-
if (itemsCount > 0) {
|
|
195
|
-
for (let i = first; i <= last; i++) {
|
|
196
|
-
items.push(renderItem(this.getItemProps(i)));
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
return items;
|
|
200
|
-
}
|
|
201
|
-
render() {
|
|
202
|
-
const { children, className, pageSize, ...rest } = this.props;
|
|
203
|
-
const { isFreezed } = this.state;
|
|
204
|
-
const state = {
|
|
205
|
-
...pick(this.state, ['first', 'last', 'height']),
|
|
206
|
-
...pick(this.props, ['offsetBefore', 'offsetAfter']),
|
|
207
|
-
};
|
|
208
|
-
return children({
|
|
209
|
-
...rest,
|
|
210
|
-
state,
|
|
211
|
-
className: cn(S.root, isFreezed && S.freezeClicks, className),
|
|
212
|
-
onScroll: this.onScroll,
|
|
213
|
-
items: this.renderItems(),
|
|
214
|
-
});
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
export { Virtualized as default };
|
|
1
|
+
import{Component}from"react";import cn from"classnames";import pick from"lodash.pick";import compare from"compareq";import Time from"timen";import debounce from"../../tools/debounce.js";import throttle from"../../tools/throttle.js";import{getHeight,getIndexes}from"./Virtualized.helpers.js";import S from"./Virtualized.styl.js";class Virtualized extends Component{clearUnfreezeTimer;scrollTopInited=!1;scrollElem;lastScrollEndIndex=0;onScrollThrottled;onScrollDebounced;static defaultProps={overlapCount:10,pageSize:20};constructor(t){super(t),this.state={id:null,height:getHeight(t),first:0,last:0,isFreezed:!1},this.onScrollThrottled=throttle(this._onScroll,150),this.onScrollDebounced=debounce(this._onScroll,150),this.checkIfEnd=debounce(this.checkIfEnd,200)}static getDerivedStateFromProps(t,{height:e}){t=getHeight(t);return t!==e?{height:t}:null}componentDidMount(){var t=this.getIndexes();this.setState(t)}getSnapshotBeforeUpdate(t){var{itemHeight:e,itemsCount:s}=this.props;return 0===s&&s!==t.itemsCount?0:this.scrollElem&&e!==t.itemHeight?e/t.itemHeight*this.scrollElem.scrollTop:null}shouldComponentUpdate(t,e){return t.id!==this.props.id||t.itemsCount!==this.props.itemsCount||t.wrapElem!==this.props.wrapElem||t.renderItem!==this.props.renderItem||t.totalCount!==this.props.totalCount||t.itemHeight!==this.props.itemHeight||t.overlapCount!==this.props.overlapCount||t.getItemProps!==this.props.getItemProps||!compare(e,this.state)}componentDidUpdate(t,e,s){var o={},r=this.scrollElem!==this.props.wrapElem;r&&(this.scrollElem=this.props.wrapElem),this.scrollElem&&"number"==typeof(s=this.getNewScrollTop(t,s))&&(this.scrollElem.scrollTop=s),t.id!==this.props.id&&(o.id=this.props.id),(r||this.needUpdateIndexes(t))&&Object.assign(o,this.getIndexes()),this.needUpdateHeight(t)&&(o.height=getHeight(this.props)),Object.keys(o).length&&this.setState(o)}componentWillUnmount(){this.clearUnfreezeTimer?.()}needUpdateIndexes(e){return["id","itemsCount","totalCount","overlapCount"].some(t=>e[t]!==this.props[t])}needUpdateHeight(e){return["totalCount","offsetAfter"].some(t=>e[t]!==this.props[t])}getNewScrollTop(t,e){var{initialScrollTop:s,scrollTop:o,itemsCount:r}=this.props;if(!this.scrollTopInited){var i=s??o;if(i&&t.itemsCount&&r)return this.scrollTopInited=!0,i}return 0<t.initialScrollTop&&0===s?0:"number"==typeof o&&o!==t.scrollTop?o:"number"==typeof e?e:null}getIndexes(){var t,e;return this.scrollElem?({scrollTop:t,clientHeight:e}=this.scrollElem,getIndexes({scrollTop:t,clientHeight:e,...pick(this.props,["itemsCount","totalCount","itemHeight","overlapCount"])})):null}_onScroll=t=>{this.scrollElem=t.target;var t=this.props["onScroll"],e=this.getIndexes(),s=this.scrollElem["scrollTop"];t&&t({scrollTop:s,...e}),this.checkIfEnd(),compare(e,pick(this.state,["first","last"]))||this.setState({...e}),this.unfreeze()};onScroll=t=>{this.onScrollThrottled(t),this.onScrollDebounced(t)};checkIfEnd=()=>{var{itemsCount:t,totalCount:e,pageSize:s,onScrollEnd:o}=this.props;t!==e&&(t<this.lastScrollEndIndex&&(this.lastScrollEndIndex=0),this.lastScrollEndIndex=Math.min(t+s,e),o?.())};unfreeze=()=>{this.clearUnfreezeTimer?.(),this.clearUnfreezeTimer=Time.after(200,()=>{this.setState({isFreezed:!1})})};getItemProps=t=>{var{getItemProps:e,offsetBefore:s,offsetAfter:o}=this.props,r={className:S.item,key:t};if(e){const{className:i,...l}=e({index:t,offsetBefore:s,offsetAfter:o});r.className=cn(r.className,i),Object.assign(r,l)}return r};renderItems(){var{itemsCount:t,renderItem:e}=this.props,{first:s,last:o}=this.state,r=[];if(0<t)for(let t=s;t<=o;t++)r.push(e(this.getItemProps(t)));return r}render(){const{children:t,className:e,pageSize:s,...o}=this.props;var r=this.state["isFreezed"],i={...pick(this.state,["first","last","height"]),...pick(this.props,["offsetBefore","offsetAfter"])};return t({...o,state:i,className:cn(S.root,r&&S.freezeClicks,e),onScroll:this.onScroll,items:this.renderItems()})}}export{Virtualized as default};
|
|
2
|
+
//# sourceMappingURL=Virtualized.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Virtualized.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,7 +1,2 @@
|
|
|
1
|
-
import styleInject from
|
|
2
|
-
|
|
3
|
-
var css_248z = ".Virtualized_root__SX71a{display:block;height:100%;max-height:100%;overflow-y:auto;position:relative}.Virtualized_item__1vSN0{animation:Virtualized_show__2WhkK .1s ease-out;-webkit-backface-visibility:hidden;backface-visibility:hidden;transform:translateZ(0)}.Virtualized_freezeClicks__SCBdy .Virtualized_item__1vSN0{pointer-events:none}@keyframes Virtualized_show__2WhkK{0%{opacity:0}to{opacity:1}}";
|
|
4
|
-
var S = {"root":"Virtualized_root__SX71a","item":"Virtualized_item__1vSN0","show":"Virtualized_show__2WhkK","freezeClicks":"Virtualized_freezeClicks__SCBdy"};
|
|
5
|
-
styleInject(css_248z);
|
|
6
|
-
|
|
7
|
-
export { S as default };
|
|
1
|
+
import styleInject from"../../../node_modules/style-inject/dist/style-inject.es.js";var css_248z=".Virtualized_root__SX71a{display:block;height:100%;max-height:100%;overflow-y:auto;position:relative}.Virtualized_item__1vSN0{animation:Virtualized_show__2WhkK .1s ease-out;-webkit-backface-visibility:hidden;backface-visibility:hidden;transform:translateZ(0)}.Virtualized_freezeClicks__SCBdy .Virtualized_item__1vSN0{pointer-events:none}@keyframes Virtualized_show__2WhkK{0%{opacity:0}to{opacity:1}}",S={root:"Virtualized_root__SX71a",item:"Virtualized_item__1vSN0",show:"Virtualized_show__2WhkK",freezeClicks:"Virtualized_freezeClicks__SCBdy"};styleInject(css_248z);export{S as default};
|
|
2
|
+
//# sourceMappingURL=Virtualized.styl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Virtualized.styl.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Virtualized.types.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,11 +1,2 @@
|
|
|
1
|
-
import { useCallback
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
function useDebounce(fn, delay) {
|
|
5
|
-
return useCallback(debounce(fn, delay), [fn, delay]);
|
|
6
|
-
}
|
|
7
|
-
function useDebounceCallback(fn, delay, deps) {
|
|
8
|
-
return useCallback(debounce(fn, delay), deps);
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export { useDebounce, useDebounceCallback };
|
|
1
|
+
import{useCallback}from"react";import debounce from"../tools/debounce.js";function useDebounce(e,u){return useCallback(debounce(e,u),[e,u])}function useDebounceCallback(e,u,o){return useCallback(debounce(e,u),o)}export{useDebounce,useDebounceCallback};
|
|
2
|
+
//# sourceMappingURL=useDebounce.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDebounce.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,27 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
function useEvent({ elem, event, callback, isActive = true, isCapture = false, }) {
|
|
4
|
-
useEffect(() => {
|
|
5
|
-
const events = Array.isArray(event) ? event : [event];
|
|
6
|
-
const elems = elem ? (Array.isArray(elem) ? elem : [elem]) : [document];
|
|
7
|
-
const getElem = (el) => el && ('current' in el ? el.current : el);
|
|
8
|
-
const each = (cb) => {
|
|
9
|
-
events.forEach(ev => {
|
|
10
|
-
elems.forEach(el => cb(getElem(el), ev));
|
|
11
|
-
});
|
|
12
|
-
};
|
|
13
|
-
const enable = () => {
|
|
14
|
-
each((el, ev) => el?.addEventListener(ev, callback, isCapture));
|
|
15
|
-
};
|
|
16
|
-
const disable = () => {
|
|
17
|
-
each((el, ev) => el?.removeEventListener(ev, callback));
|
|
18
|
-
};
|
|
19
|
-
if (isActive)
|
|
20
|
-
enable();
|
|
21
|
-
return () => {
|
|
22
|
-
disable();
|
|
23
|
-
};
|
|
24
|
-
}, [isActive, elem, callback]);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export { useEvent as default };
|
|
1
|
+
import{useEffect}from"react";function useEvent({elem:t,event:a,callback:c,isActive:s=!0,isCapture:u=!1}){useEffect(()=>{const e=Array.isArray(a)?a:[a],n=t?Array.isArray(t)?t:[t]:[document],r=t=>{e.forEach(r=>{n.forEach(e=>{return t((e=e)&&("current"in e?e.current:e),r)})})};return s&&r((e,r)=>e?.addEventListener(r,c,u)),()=>{r((e,r)=>e?.removeEventListener(r,c))}},[s,t,c])}export{useEvent as default};
|
|
2
|
+
//# sourceMappingURL=useEvent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useEvent.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,11 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
const useIsMounted = () => {
|
|
4
|
-
const isMounted = useRef(false);
|
|
5
|
-
useEffect(() => {
|
|
6
|
-
isMounted.current = true;
|
|
7
|
-
}, []);
|
|
8
|
-
return isMounted;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export { useIsMounted };
|
|
1
|
+
import{useRef,useEffect}from"react";const useIsMounted=()=>{const e=useRef(!1);return useEffect(()=>{e.current=!0},[]),e};export{useIsMounted};
|
|
2
|
+
//# sourceMappingURL=useIsMounted.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useIsMounted.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,50 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const useListKeyboardControl = ({ isActive, itemsCount, onSelect, }) => {
|
|
5
|
-
const [focusedIndex, setFocusedIndex] = useState(-1);
|
|
6
|
-
const handleKeyDown = useCallback((e) => {
|
|
7
|
-
let newIndex = focusedIndex;
|
|
8
|
-
const set = (index) => {
|
|
9
|
-
e.preventDefault();
|
|
10
|
-
e.stopPropagation();
|
|
11
|
-
setFocusedIndex(index);
|
|
12
|
-
return;
|
|
13
|
-
};
|
|
14
|
-
if (e.key === 'ArrowDown') {
|
|
15
|
-
newIndex++;
|
|
16
|
-
if (newIndex >= itemsCount)
|
|
17
|
-
newIndex = 0;
|
|
18
|
-
set(newIndex);
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
if (e.key === 'ArrowUp') {
|
|
22
|
-
newIndex--;
|
|
23
|
-
if (newIndex < 0)
|
|
24
|
-
newIndex = itemsCount - 1;
|
|
25
|
-
set(newIndex);
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
if (e.key === 'Enter') {
|
|
29
|
-
onSelect(newIndex);
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
}, [focusedIndex, itemsCount, onSelect]);
|
|
33
|
-
useEvent({
|
|
34
|
-
elem: document,
|
|
35
|
-
event: 'keydown',
|
|
36
|
-
callback: handleKeyDown,
|
|
37
|
-
isActive,
|
|
38
|
-
});
|
|
39
|
-
useEffect(() => {
|
|
40
|
-
if (itemsCount < focusedIndex) {
|
|
41
|
-
setFocusedIndex(itemsCount - 1);
|
|
42
|
-
}
|
|
43
|
-
}, [itemsCount]);
|
|
44
|
-
return {
|
|
45
|
-
focusedIndex,
|
|
46
|
-
setFocusedIndex,
|
|
47
|
-
};
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
export { useListKeyboardControl };
|
|
1
|
+
import{useState,useCallback,useEffect}from"react";import useEvent from"./useEvent.js";const useListKeyboardControl=({isActive:e,itemsCount:s,onSelect:r})=>{const[n,u]=useState(-1);var t=useCallback(t=>{let e=n;var o=e=>{t.preventDefault(),t.stopPropagation(),u(e)};"ArrowDown"===t.key?o(e=++e>=s?0:e):"ArrowUp"===t.key?o(e=--e<0?s-1:e):"Enter"===t.key&&r(e)},[n,s,r]);return useEvent({elem:document,event:"keydown",callback:t,isActive:e}),useEffect(()=>{s<n&&u(s-1)},[s]),{focusedIndex:n,setFocusedIndex:u}};export{useListKeyboardControl};
|
|
2
|
+
//# sourceMappingURL=useListKeyboardControl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useListKeyboardControl.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,15 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
const useResizeObserver = (ref, callback) => {
|
|
4
|
-
useEffect(() => {
|
|
5
|
-
if (!ref.current)
|
|
6
|
-
return;
|
|
7
|
-
const observer = new ResizeObserver(entries => {
|
|
8
|
-
callback(entries[0]);
|
|
9
|
-
});
|
|
10
|
-
observer.observe(ref.current);
|
|
11
|
-
return () => observer.disconnect();
|
|
12
|
-
}, [ref, callback]);
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export { useResizeObserver };
|
|
1
|
+
import{useEffect}from"react";const useResizeObserver=(r,s)=>{useEffect(()=>{if(r.current){const e=new ResizeObserver(e=>{s(e[0])});return e.observe(r.current),()=>e.disconnect()}},[r,s])};export{useResizeObserver};
|
|
2
|
+
//# sourceMappingURL=useResizeObserver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useResizeObserver.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,31 +1,2 @@
|
|
|
1
|
-
import { useRef, useEffect,
|
|
2
|
-
|
|
3
|
-
function useThrottle(cb, limit, options = { trailing: false }, deps = []) {
|
|
4
|
-
const lastRun = useRef(0);
|
|
5
|
-
const timeoutId = useRef(null);
|
|
6
|
-
useEffect(() => {
|
|
7
|
-
return () => {
|
|
8
|
-
clearTimeout(timeoutId.current);
|
|
9
|
-
};
|
|
10
|
-
}, deps);
|
|
11
|
-
return useCallback((...args) => {
|
|
12
|
-
const now = Date.now();
|
|
13
|
-
const execute = () => {
|
|
14
|
-
cb(...args);
|
|
15
|
-
lastRun.current = now;
|
|
16
|
-
};
|
|
17
|
-
const remaining = limit - (now - lastRun.current);
|
|
18
|
-
if (remaining <= 0) {
|
|
19
|
-
clearTimeout(timeoutId.current);
|
|
20
|
-
execute();
|
|
21
|
-
}
|
|
22
|
-
else if (options.trailing && !timeoutId.current) {
|
|
23
|
-
timeoutId.current = setTimeout(execute, remaining);
|
|
24
|
-
}
|
|
25
|
-
}, [limit, options.trailing, ...deps]);
|
|
26
|
-
}
|
|
27
|
-
function useThrottleCallback(cb, limit, deps = []) {
|
|
28
|
-
return useCallback(useThrottle(cb, limit, { trailing: true }, deps), deps);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export { useThrottle, useThrottleCallback };
|
|
1
|
+
import{useRef,useEffect,useCallback}from"react";function useThrottle(l,c,n={trailing:!1},e=[]){const a=useRef(0),o=useRef(null);return useEffect(()=>()=>{clearTimeout(o.current)},e),useCallback((...e)=>{const t=Date.now();var r=()=>{l(...e),a.current=t},u=c-(t-a.current);u<=0?(clearTimeout(o.current),r()):n.trailing&&!o.current&&(o.current=setTimeout(r,u))},[c,n.trailing,...e])}function useThrottleCallback(e,t,r=[]){return useCallback(useThrottle(e,t,{trailing:!0},r),r)}export{useThrottle,useThrottleCallback};
|
|
2
|
+
//# sourceMappingURL=useThrottle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useThrottle.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,35 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
function useToggleState(props = {}) {
|
|
5
|
-
const id = props.id || generateUID();
|
|
6
|
-
const [isActive, setIsActive] = useState(false);
|
|
7
|
-
const [isFocused, setIsFocused] = useState(false);
|
|
8
|
-
const onPointerDown = useCallback(() => {
|
|
9
|
-
setIsActive(true);
|
|
10
|
-
}, []);
|
|
11
|
-
const onPointerUp = useCallback(() => {
|
|
12
|
-
setIsActive(false);
|
|
13
|
-
}, []);
|
|
14
|
-
const onFocus = useCallback((e) => {
|
|
15
|
-
setIsFocused(true);
|
|
16
|
-
props.onFocus?.(e);
|
|
17
|
-
}, [props.onFocus]);
|
|
18
|
-
const onBlur = useCallback((e) => {
|
|
19
|
-
setIsFocused(false);
|
|
20
|
-
props.onBlur?.(e);
|
|
21
|
-
}, [props.onBlur]);
|
|
22
|
-
return {
|
|
23
|
-
id,
|
|
24
|
-
isActive,
|
|
25
|
-
isFocused,
|
|
26
|
-
handlers: {
|
|
27
|
-
onPointerDown,
|
|
28
|
-
onPointerUp,
|
|
29
|
-
onFocus,
|
|
30
|
-
onBlur,
|
|
31
|
-
},
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export { useToggleState };
|
|
1
|
+
import{useState,useCallback}from"react";import{generateUID}from"../tools/uid.js";function useToggleState(o={}){var e=o.id||generateUID();const[t,a]=useState(!1),[s,u]=useState(!1);return{id:e,isActive:t,isFocused:s,handlers:{onPointerDown:useCallback(()=>{a(!0)},[]),onPointerUp:useCallback(()=>{a(!1)},[]),onFocus:useCallback(e=>{u(!0),o.onFocus?.(e)},[o.onFocus]),onBlur:useCallback(e=>{u(!1),o.onBlur?.(e)},[o.onBlur])}}}export{useToggleState};
|
|
2
|
+
//# sourceMappingURL=useToggleState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useToggleState.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,112 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import { nanoid } from 'nanoid';
|
|
4
|
-
import { createStore, useStore } from 'justorm/react';
|
|
5
|
-
import _i18n from 'roddeh-i18n';
|
|
6
|
-
import LS from '../tools/localStorage.js';
|
|
7
|
-
import { queryParams } from '../tools/queryParams.js';
|
|
8
|
-
|
|
9
|
-
const DEFAULT_LANG = 'en';
|
|
10
|
-
const modules = {};
|
|
11
|
-
const queryLang = queryParams.lang;
|
|
12
|
-
if (queryLang)
|
|
13
|
-
LS.set('lang', queryLang);
|
|
14
|
-
const store = createStore('i18n', {
|
|
15
|
-
lang: LS.get('lang') ?? DEFAULT_LANG,
|
|
16
|
-
async changeLang(lang) {
|
|
17
|
-
// TODO: use WebWorker for requests?
|
|
18
|
-
const requests = modules[lang].map(loader => loader());
|
|
19
|
-
await Promise.all(requests);
|
|
20
|
-
modules[lang] = [];
|
|
21
|
-
this.lang = lang;
|
|
22
|
-
LS.set('lang', lang);
|
|
23
|
-
},
|
|
24
|
-
});
|
|
25
|
-
function init(config) {
|
|
26
|
-
const langs = Object.keys(config);
|
|
27
|
-
const texts = langs.reduce((acc, lang) => ({ ...acc, [lang]: _i18n.create({ values: {} }) }), {});
|
|
28
|
-
const _getText = (lang, key, props) => {
|
|
29
|
-
if (texts[lang]?.translator.data.values[key]) {
|
|
30
|
-
return texts[lang](key, ...props);
|
|
31
|
-
}
|
|
32
|
-
return null;
|
|
33
|
-
};
|
|
34
|
-
function getTrans(key, props) {
|
|
35
|
-
// Handle different prop formats according to roddeh-i18n
|
|
36
|
-
if (!props) {
|
|
37
|
-
return _getText(store.lang, key, []) || key;
|
|
38
|
-
}
|
|
39
|
-
// If props is a number, it's for pluralization
|
|
40
|
-
if (typeof props === 'number') {
|
|
41
|
-
return _getText(store.lang, key, [props]) || key;
|
|
42
|
-
}
|
|
43
|
-
// If props is an object, handle different cases
|
|
44
|
-
if (typeof props === 'object') {
|
|
45
|
-
const args = [];
|
|
46
|
-
// For plural forms with parameters
|
|
47
|
-
if ('plural' in props) {
|
|
48
|
-
args.push(props.plural);
|
|
49
|
-
}
|
|
50
|
-
// For parameters/formatting
|
|
51
|
-
if ('params' in props) {
|
|
52
|
-
args.push(props.params);
|
|
53
|
-
}
|
|
54
|
-
else if ('plural' in props && 'params' in props) ;
|
|
55
|
-
else if (!('plural' in props) && !('context' in props)) {
|
|
56
|
-
// If it's just a plain object without our special keys, treat it as params
|
|
57
|
-
args.push(props);
|
|
58
|
-
}
|
|
59
|
-
// Context comes last
|
|
60
|
-
if ('context' in props) {
|
|
61
|
-
// If we don't have params but have context, add empty params
|
|
62
|
-
if (!('params' in props) && !('plural' in props)) {
|
|
63
|
-
args.push({});
|
|
64
|
-
}
|
|
65
|
-
args.push(props.context);
|
|
66
|
-
}
|
|
67
|
-
return _getText(store.lang, key, args) || key;
|
|
68
|
-
}
|
|
69
|
-
// For backward compatibility with array format
|
|
70
|
-
if (Array.isArray(props)) {
|
|
71
|
-
return _getText(store.lang, key, props) || key;
|
|
72
|
-
}
|
|
73
|
-
return key;
|
|
74
|
-
}
|
|
75
|
-
const storeName = `i18n-${nanoid()}`;
|
|
76
|
-
const componentStore = createStore(storeName, { _updated: '' });
|
|
77
|
-
const callLoader = async (loader, lang) => {
|
|
78
|
-
const values = typeof loader === 'function' ? (await loader()).default : loader;
|
|
79
|
-
texts[lang].translator.add({ values });
|
|
80
|
-
componentStore._updated = nanoid();
|
|
81
|
-
};
|
|
82
|
-
Object.entries(config).forEach(([lang, loader]) => {
|
|
83
|
-
if (!modules[lang])
|
|
84
|
-
modules[lang] = [];
|
|
85
|
-
if (lang === store.lang)
|
|
86
|
-
return callLoader(loader, lang);
|
|
87
|
-
modules[lang].push(() => callLoader(loader, lang));
|
|
88
|
-
});
|
|
89
|
-
// TODO: bring back the ability to register modules
|
|
90
|
-
return {
|
|
91
|
-
storeName,
|
|
92
|
-
componentStore,
|
|
93
|
-
// hook (update when componentStore._updated changed)
|
|
94
|
-
withI18N: Component => props => {
|
|
95
|
-
useStore({ [storeName]: ['_updated'] });
|
|
96
|
-
return jsx(Component, { ...props });
|
|
97
|
-
},
|
|
98
|
-
i18n: (key, props) => getTrans(key, props),
|
|
99
|
-
I18N: memo(function I18N({ id, children, props }) {
|
|
100
|
-
useStore({
|
|
101
|
-
i18n: ['lang'],
|
|
102
|
-
[storeName]: ['_updated'], // explicitly subscribe to _updated
|
|
103
|
-
});
|
|
104
|
-
const key = id ?? children;
|
|
105
|
-
// @ts-ignore
|
|
106
|
-
return jsx(Fragment, { children: getTrans(key, props) });
|
|
107
|
-
}),
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
const useI18N = (fields = 'lang') => useStore({ i18n: [fields] }).i18n;
|
|
111
|
-
|
|
112
|
-
export { init, store, useI18N };
|
|
1
|
+
import{jsx,Fragment}from"react/jsx-runtime";import{memo}from"react";import{nanoid}from"nanoid";import{createStore,useStore}from"justorm/react";import _i18n from"roddeh-i18n";import LS from"../tools/localStorage.js";import{queryParams}from"../tools/queryParams.js";const DEFAULT_LANG="en",modules={},queryLang=queryParams.lang,store=(queryLang&&LS.set("lang",queryLang),createStore("i18n",{lang:LS.get("lang")??DEFAULT_LANG,async changeLang(e){var r=modules[e].map(e=>e());await Promise.all(r),modules[e]=[],this.lang=e,LS.set("lang",e)}}));function init(e){const a=Object.keys(e).reduce((e,r)=>({...e,[r]:_i18n.create({values:{}})}),{}),n=(e,r,t)=>a[e]?.translator.data.values[r]?a[e](r,...t):null;function o(e,r){var t;return r?"number"==typeof r?n(store.lang,e,[r])||e:"object"==typeof r?(t=[],"plural"in r&&t.push(r.plural),"params"in r?t.push(r.params):"plural"in r&&"params"in r||"plural"in r||"context"in r||t.push(r),"context"in r&&("params"in r||"plural"in r||t.push({}),t.push(r.context)),n(store.lang,e,t)||e):Array.isArray(r)&&n(store.lang,e,r)||e:n(store.lang,e,[])||e}const s="i18n-"+nanoid(),t=createStore(s,{_updated:""}),u=async(e,r)=>{e="function"==typeof e?(await e()).default:e;a[r].translator.add({values:e}),t._updated=nanoid()};return Object.entries(e).forEach(([e,r])=>{if(modules[e]||(modules[e]=[]),e===store.lang)return u(r,e);modules[e].push(()=>u(r,e))}),{storeName:s,componentStore:t,withI18N:r=>e=>(useStore({[s]:["_updated"]}),jsx(r,{...e})),i18n:(e,r)=>o(e,r),I18N:memo(function({id:e,children:r,props:t}){return useStore({i18n:["lang"],[s]:["_updated"]}),jsx(Fragment,{children:o(e??r,t)})})}}const useI18N=(e="lang")=>useStore({i18n:[e]}).i18n;export{init,store,useI18N};
|
|
2
|
+
//# sourceMappingURL=i18n.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i18n.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|