@homecode/ui 4.18.16 → 4.18.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/index.js +83 -2
- package/dist/esm/node_modules/style-inject/dist/style-inject.es.js +28 -2
- package/dist/esm/src/components/AssistiveText/AssistiveText.js +10 -2
- package/dist/esm/src/components/AssistiveText/AssistiveText.styl.js +7 -2
- package/dist/esm/src/components/Button/Button.helpers.js +12 -2
- package/dist/esm/src/components/Button/Button.js +38 -2
- package/dist/esm/src/components/Button/Button.styl.js +7 -2
- package/dist/esm/src/components/ButtonGroup/ButtonGroup.js +10 -2
- package/dist/esm/src/components/ButtonGroup/ButtonGroup.styl.js +7 -2
- package/dist/esm/src/components/Calendar/Calendar.helpers.js +65 -2
- package/dist/esm/src/components/Calendar/Calendar.js +66 -2
- package/dist/esm/src/components/Calendar/Calendar.styl.js +7 -2
- package/dist/esm/src/components/Checkbox/Checkbox.js +48 -2
- package/dist/esm/src/components/Checkbox/Checkbox.styl.js +7 -2
- package/dist/esm/src/components/Container/Container.js +12 -2
- package/dist/esm/src/components/Container/Container.styl.js +7 -2
- package/dist/esm/src/components/DatePicker/DatePicker.helpers.js +31 -2
- package/dist/esm/src/components/DatePicker/DatePicker.js +47 -2
- package/dist/esm/src/components/DatePicker/DatePicker.styl.js +7 -2
- package/dist/esm/src/components/DatePickerInput/DatePickerInput.js +20 -2
- package/dist/esm/src/components/DatePickerInput/DatePickerInput.styl.js +7 -2
- package/dist/esm/src/components/DateTime/DateTime.js +17 -2
- package/dist/esm/src/components/Draggable/Draggable.js +136 -2
- package/dist/esm/src/components/Draggable/Draggable.styl.js +7 -2
- package/dist/esm/src/components/Expand/Expand.js +24 -2
- package/dist/esm/src/components/Expand/Expand.styl.js +7 -2
- package/dist/esm/src/components/Form/Form.helpers.js +42 -2
- package/dist/esm/src/components/Form/Form.js +286 -2
- package/dist/esm/src/components/Form/Form.styl.js +7 -2
- package/dist/esm/src/components/Form/Form.types.js +0 -1
- package/dist/esm/src/components/Form/SubmitButtons/SubmitButtons.js +8 -2
- package/dist/esm/src/components/Form/SubmitButtons/SubmitButtons.styl.js +7 -2
- package/dist/esm/src/components/Form/Validator.js +24 -6
- package/dist/esm/src/components/Gallery/Dots/Dots.js +9 -2
- package/dist/esm/src/components/Gallery/Dots/Dots.styl.js +7 -2
- package/dist/esm/src/components/Gallery/Gallery.js +180 -2
- package/dist/esm/src/components/Gallery/Gallery.styl.js +7 -2
- package/dist/esm/src/components/Heading/Heading.js +37 -2
- package/dist/esm/src/components/Heading/Heading.styl.js +7 -2
- package/dist/esm/src/components/Icon/Icon.js +27 -2
- package/dist/esm/src/components/Icon/Icon.styl.js +7 -2
- package/dist/esm/src/components/Icon/icons/avatar.svg.js +15 -2
- package/dist/esm/src/components/Icon/icons/brokenImage.svg.js +15 -2
- package/dist/esm/src/components/Icon/icons/check.svg.js +19 -2
- package/dist/esm/src/components/Icon/icons/chevronDown.svg.js +20 -2
- package/dist/esm/src/components/Icon/icons/chevronLeft.svg.js +20 -2
- package/dist/esm/src/components/Icon/icons/chevronRight.svg.js +20 -2
- package/dist/esm/src/components/Icon/icons/chevronUp.svg.js +20 -2
- package/dist/esm/src/components/Icon/icons/close.svg.js +15 -2
- package/dist/esm/src/components/Icon/icons/colors.svg.js +60 -2
- package/dist/esm/src/components/Icon/icons/copy.svg.js +15 -2
- package/dist/esm/src/components/Icon/icons/delete.svg.js +15 -2
- package/dist/esm/src/components/Icon/icons/draft.svg.js +15 -2
- package/dist/esm/src/components/Icon/icons/edit.svg.js +15 -2
- package/dist/esm/src/components/Icon/icons/email.svg.js +15 -2
- package/dist/esm/src/components/Icon/icons/externalLink.svg.js +15 -2
- package/dist/esm/src/components/Icon/icons/eye.svg.js +15 -2
- package/dist/esm/src/components/Icon/icons/fullscreen.svg.js +15 -2
- package/dist/esm/src/components/Icon/icons/fullscreenExit.svg.js +15 -2
- package/dist/esm/src/components/Icon/icons/function.svg.js +15 -2
- package/dist/esm/src/components/Icon/icons/gear.svg.js +21 -2
- package/dist/esm/src/components/Icon/icons/group.svg.js +15 -2
- package/dist/esm/src/components/Icon/icons/history.svg.js +17 -2
- package/dist/esm/src/components/Icon/icons/home.svg.js +19 -2
- package/dist/esm/src/components/Icon/icons/index.js +46 -2
- package/dist/esm/src/components/Icon/icons/instagram.svg.js +15 -2
- package/dist/esm/src/components/Icon/icons/link.svg.js +15 -2
- package/dist/esm/src/components/Icon/icons/loader.svg.js +45 -2
- package/dist/esm/src/components/Icon/icons/menu.svg.js +18 -2
- package/dist/esm/src/components/Icon/icons/mic.svg.js +15 -2
- package/dist/esm/src/components/Icon/icons/minus.svg.js +15 -2
- package/dist/esm/src/components/Icon/icons/moreHorizontal.svg.js +15 -2
- package/dist/esm/src/components/Icon/icons/moreVertical.svg.js +15 -2
- package/dist/esm/src/components/Icon/icons/output.svg.js +15 -2
- package/dist/esm/src/components/Icon/icons/plus.svg.js +15 -2
- package/dist/esm/src/components/Icon/icons/redo.svg.js +15 -2
- package/dist/esm/src/components/Icon/icons/requiredStar.svg.js +15 -2
- package/dist/esm/src/components/Icon/icons/save.svg.js +17 -2
- package/dist/esm/src/components/Icon/icons/send.svg.js +16 -2
- package/dist/esm/src/components/Icon/icons/settings.svg.js +52 -2
- package/dist/esm/src/components/Icon/icons/shoppingBag.svg.js +17 -2
- package/dist/esm/src/components/Icon/icons/table.svg.js +15 -2
- package/dist/esm/src/components/Icon/icons/telegram.svg.js +19 -2
- package/dist/esm/src/components/Icon/icons/undo.svg.js +15 -2
- package/dist/esm/src/components/Input/Input.js +345 -2
- package/dist/esm/src/components/Input/Input.styl.js +7 -2
- package/dist/esm/src/components/InputFile/InputFile.js +295 -2
- package/dist/esm/src/components/InputFile/InputFile.styl.js +7 -2
- package/dist/esm/src/components/InputFile/InputFile.types.js +0 -1
- package/dist/esm/src/components/InputFile/Item/Item.js +18 -2
- package/dist/esm/src/components/InputFile/Item/Item.styl.js +7 -2
- package/dist/esm/src/components/Label/Label.constants.json.js +8 -2
- package/dist/esm/src/components/Label/Label.helpers.js +35 -2
- package/dist/esm/src/components/Label/Label.js +58 -2
- package/dist/esm/src/components/Label/Label.styl.js +7 -2
- package/dist/esm/src/components/Lazy/Lazy.js +65 -2
- package/dist/esm/src/components/LightBox/LightBox.js +28 -2
- package/dist/esm/src/components/LightBox/LightBox.styl.js +7 -2
- package/dist/esm/src/components/Notifications/Notifications.constants.json.js +6 -2
- package/dist/esm/src/components/Notifications/Notifications.js +67 -2
- package/dist/esm/src/components/Notifications/Notifications.styl.js +7 -2
- package/dist/esm/src/components/Notifications/store.js +62 -2
- package/dist/esm/src/components/Paranja/Paranja.js +14 -2
- package/dist/esm/src/components/Paranja/Paranja.styl.js +7 -2
- package/dist/esm/src/components/Popup/Popup.helpers.js +31 -2
- package/dist/esm/src/components/Popup/Popup.js +397 -2
- package/dist/esm/src/components/Popup/Popup.styl.js +7 -2
- package/dist/esm/src/components/PopupMenu/PopupMenu.js +15 -2
- package/dist/esm/src/components/PopupMenu/PopupMenu.styl.js +7 -2
- package/dist/esm/src/components/Portal/Portal.js +19 -2
- package/dist/esm/src/components/RequiredStar/RequiredStar.js +12 -2
- package/dist/esm/src/components/RequiredStar/RequiredStar.styl.js +7 -2
- package/dist/esm/src/components/Router/Link/Link.js +61 -2
- package/dist/esm/src/components/Router/Link/Link.styl.js +7 -2
- package/dist/esm/src/components/Router/Redirect.js +12 -2
- package/dist/esm/src/components/Router/Route.js +4 -2
- package/dist/esm/src/components/Router/Router.helpers.js +33 -2
- package/dist/esm/src/components/Router/Router.js +68 -2
- package/dist/esm/src/components/Router/context.js +5 -2
- package/dist/esm/src/components/Router/store.js +55 -2
- package/dist/esm/src/components/Scroll/Scroll.js +274 -2
- package/dist/esm/src/components/Scroll/Scroll.styl.js +7 -2
- package/dist/esm/src/components/Select/Select.helpers.js +37 -2
- package/dist/esm/src/components/Select/Select.js +585 -2
- package/dist/esm/src/components/Select/Select.styl.js +7 -2
- package/dist/esm/src/components/Spinner/Spinner.js +11 -2
- package/dist/esm/src/components/Spinner/Spinner.styl.js +7 -2
- package/dist/esm/src/components/Spinner/spinner.svg.js +24 -2
- package/dist/esm/src/components/Table/Table.js +24 -2
- package/dist/esm/src/components/Table/Table.styl.js +7 -2
- package/dist/esm/src/components/Tabs/Tabs.js +43 -2
- package/dist/esm/src/components/Tabs/Tabs.styl.js +7 -2
- package/dist/esm/src/components/Text/Text.js +44 -2
- package/dist/esm/src/components/Text/Text.styl.js +7 -2
- package/dist/esm/src/components/Theme/Theme.defaults.js +50 -2
- package/dist/esm/src/components/Theme/Theme.helpers.js +67 -2
- package/dist/esm/src/components/Theme/Theme.js +13 -2
- package/dist/esm/src/components/VH/VH.js +33 -2
- package/dist/esm/src/components/Virtualized/List/List.js +124 -2
- package/dist/esm/src/components/Virtualized/List/List.styl.js +7 -2
- package/dist/esm/src/components/Virtualized/List/ListScroll.js +21 -2
- package/dist/esm/src/components/Virtualized/List/ListScroll.styl.js +7 -2
- package/dist/esm/src/components/Virtualized/Virtualized.helpers.js +14 -2
- package/dist/esm/src/components/Virtualized/Virtualized.js +200 -2
- package/dist/esm/src/components/Virtualized/Virtualized.styl.js +7 -2
- package/dist/esm/src/components/Virtualized/Virtualized.types.js +0 -1
- package/dist/esm/src/services/i18n.js +68 -2
- package/dist/esm/src/tools/array.js +60 -2
- package/dist/esm/src/tools/config.js +9 -2
- package/dist/esm/src/tools/date.js +11 -2
- package/dist/esm/src/tools/debounce.js +11 -2
- package/dist/esm/src/tools/dom.js +46 -2
- package/dist/esm/src/tools/env.js +3 -2
- package/dist/esm/src/tools/file.js +11 -2
- package/dist/esm/src/tools/localStorage.js +31 -2
- package/dist/esm/src/tools/number.js +27 -2
- package/dist/esm/src/tools/object.js +5 -2
- package/dist/esm/src/tools/queryParams.js +20 -2
- package/dist/esm/src/tools/rangeMap.js +3 -2
- package/dist/esm/src/tools/resizeObserver.js +68 -2
- package/dist/esm/src/tools/scroll.js +41 -2
- package/dist/esm/src/tools/string.js +7 -2
- package/dist/esm/src/tools/throttle.js +30 -2
- package/dist/esm/src/tools/uid.js +7 -2
- package/dist/esm/types/src/components/Icon/Icon.d.ts +3 -9
- package/dist/esm/types/src/components/Icon/Icon.example.d.ts +1 -0
- package/package.json +1 -1
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/node_modules/style-inject/dist/style-inject.es.js.map +0 -1
- package/dist/esm/src/components/AssistiveText/AssistiveText.js.map +0 -1
- package/dist/esm/src/components/AssistiveText/AssistiveText.styl.js.map +0 -1
- package/dist/esm/src/components/Button/Button.helpers.js.map +0 -1
- package/dist/esm/src/components/Button/Button.js.map +0 -1
- package/dist/esm/src/components/Button/Button.styl.js.map +0 -1
- package/dist/esm/src/components/ButtonGroup/ButtonGroup.js.map +0 -1
- package/dist/esm/src/components/ButtonGroup/ButtonGroup.styl.js.map +0 -1
- package/dist/esm/src/components/Calendar/Calendar.helpers.js.map +0 -1
- package/dist/esm/src/components/Calendar/Calendar.js.map +0 -1
- package/dist/esm/src/components/Calendar/Calendar.styl.js.map +0 -1
- package/dist/esm/src/components/Checkbox/Checkbox.js.map +0 -1
- package/dist/esm/src/components/Checkbox/Checkbox.styl.js.map +0 -1
- package/dist/esm/src/components/Container/Container.js.map +0 -1
- package/dist/esm/src/components/Container/Container.styl.js.map +0 -1
- package/dist/esm/src/components/DatePicker/DatePicker.helpers.js.map +0 -1
- package/dist/esm/src/components/DatePicker/DatePicker.js.map +0 -1
- package/dist/esm/src/components/DatePicker/DatePicker.styl.js.map +0 -1
- package/dist/esm/src/components/DatePickerInput/DatePickerInput.js.map +0 -1
- package/dist/esm/src/components/DatePickerInput/DatePickerInput.styl.js.map +0 -1
- package/dist/esm/src/components/DateTime/DateTime.js.map +0 -1
- package/dist/esm/src/components/Draggable/Draggable.js.map +0 -1
- package/dist/esm/src/components/Draggable/Draggable.styl.js.map +0 -1
- package/dist/esm/src/components/Expand/Expand.js.map +0 -1
- package/dist/esm/src/components/Expand/Expand.styl.js.map +0 -1
- package/dist/esm/src/components/Form/Form.helpers.js.map +0 -1
- package/dist/esm/src/components/Form/Form.js.map +0 -1
- package/dist/esm/src/components/Form/Form.styl.js.map +0 -1
- package/dist/esm/src/components/Form/Form.types.js.map +0 -1
- package/dist/esm/src/components/Form/SubmitButtons/SubmitButtons.js.map +0 -1
- package/dist/esm/src/components/Form/SubmitButtons/SubmitButtons.styl.js.map +0 -1
- package/dist/esm/src/components/Form/Validator.js.map +0 -1
- package/dist/esm/src/components/Gallery/Dots/Dots.js.map +0 -1
- package/dist/esm/src/components/Gallery/Dots/Dots.styl.js.map +0 -1
- package/dist/esm/src/components/Gallery/Gallery.js.map +0 -1
- package/dist/esm/src/components/Gallery/Gallery.styl.js.map +0 -1
- package/dist/esm/src/components/Heading/Heading.js.map +0 -1
- package/dist/esm/src/components/Heading/Heading.styl.js.map +0 -1
- package/dist/esm/src/components/Icon/Icon.js.map +0 -1
- package/dist/esm/src/components/Icon/Icon.styl.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/avatar.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/brokenImage.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/check.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/chevronDown.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/chevronLeft.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/chevronRight.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/chevronUp.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/close.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/colors.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/copy.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/delete.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/draft.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/edit.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/email.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/externalLink.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/eye.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/fullscreen.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/fullscreenExit.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/function.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/gear.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/group.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/history.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/home.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/index.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/instagram.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/link.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/loader.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/menu.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/mic.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/minus.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/moreHorizontal.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/moreVertical.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/output.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/plus.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/redo.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/requiredStar.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/save.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/send.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/settings.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/shoppingBag.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/table.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/telegram.svg.js.map +0 -1
- package/dist/esm/src/components/Icon/icons/undo.svg.js.map +0 -1
- package/dist/esm/src/components/Input/Input.js.map +0 -1
- package/dist/esm/src/components/Input/Input.styl.js.map +0 -1
- package/dist/esm/src/components/InputFile/InputFile.js.map +0 -1
- package/dist/esm/src/components/InputFile/InputFile.styl.js.map +0 -1
- package/dist/esm/src/components/InputFile/InputFile.types.js.map +0 -1
- package/dist/esm/src/components/InputFile/Item/Item.js.map +0 -1
- package/dist/esm/src/components/InputFile/Item/Item.styl.js.map +0 -1
- package/dist/esm/src/components/Label/Label.constants.json.js.map +0 -1
- package/dist/esm/src/components/Label/Label.helpers.js.map +0 -1
- package/dist/esm/src/components/Label/Label.js.map +0 -1
- package/dist/esm/src/components/Label/Label.styl.js.map +0 -1
- package/dist/esm/src/components/Lazy/Lazy.js.map +0 -1
- package/dist/esm/src/components/LightBox/LightBox.js.map +0 -1
- package/dist/esm/src/components/LightBox/LightBox.styl.js.map +0 -1
- package/dist/esm/src/components/Notifications/Notifications.constants.json.js.map +0 -1
- package/dist/esm/src/components/Notifications/Notifications.js.map +0 -1
- package/dist/esm/src/components/Notifications/Notifications.styl.js.map +0 -1
- package/dist/esm/src/components/Notifications/store.js.map +0 -1
- package/dist/esm/src/components/Paranja/Paranja.js.map +0 -1
- package/dist/esm/src/components/Paranja/Paranja.styl.js.map +0 -1
- package/dist/esm/src/components/Popup/Popup.helpers.js.map +0 -1
- package/dist/esm/src/components/Popup/Popup.js.map +0 -1
- package/dist/esm/src/components/Popup/Popup.styl.js.map +0 -1
- package/dist/esm/src/components/PopupMenu/PopupMenu.js.map +0 -1
- package/dist/esm/src/components/PopupMenu/PopupMenu.styl.js.map +0 -1
- package/dist/esm/src/components/Portal/Portal.js.map +0 -1
- package/dist/esm/src/components/RequiredStar/RequiredStar.js.map +0 -1
- package/dist/esm/src/components/RequiredStar/RequiredStar.styl.js.map +0 -1
- package/dist/esm/src/components/Router/Link/Link.js.map +0 -1
- package/dist/esm/src/components/Router/Link/Link.styl.js.map +0 -1
- package/dist/esm/src/components/Router/Redirect.js.map +0 -1
- package/dist/esm/src/components/Router/Route.js.map +0 -1
- package/dist/esm/src/components/Router/Router.helpers.js.map +0 -1
- package/dist/esm/src/components/Router/Router.js.map +0 -1
- package/dist/esm/src/components/Router/context.js.map +0 -1
- package/dist/esm/src/components/Router/store.js.map +0 -1
- package/dist/esm/src/components/Scroll/Scroll.js.map +0 -1
- package/dist/esm/src/components/Scroll/Scroll.styl.js.map +0 -1
- package/dist/esm/src/components/Select/Select.helpers.js.map +0 -1
- package/dist/esm/src/components/Select/Select.js.map +0 -1
- package/dist/esm/src/components/Select/Select.styl.js.map +0 -1
- package/dist/esm/src/components/Spinner/Spinner.js.map +0 -1
- package/dist/esm/src/components/Spinner/Spinner.styl.js.map +0 -1
- package/dist/esm/src/components/Spinner/spinner.svg.js.map +0 -1
- package/dist/esm/src/components/Table/Table.js.map +0 -1
- package/dist/esm/src/components/Table/Table.styl.js.map +0 -1
- package/dist/esm/src/components/Tabs/Tabs.js.map +0 -1
- package/dist/esm/src/components/Tabs/Tabs.styl.js.map +0 -1
- package/dist/esm/src/components/Text/Text.js.map +0 -1
- package/dist/esm/src/components/Text/Text.styl.js.map +0 -1
- package/dist/esm/src/components/Theme/Theme.defaults.js.map +0 -1
- package/dist/esm/src/components/Theme/Theme.helpers.js.map +0 -1
- package/dist/esm/src/components/Theme/Theme.js.map +0 -1
- package/dist/esm/src/components/VH/VH.js.map +0 -1
- package/dist/esm/src/components/Virtualized/List/List.js.map +0 -1
- package/dist/esm/src/components/Virtualized/List/List.styl.js.map +0 -1
- package/dist/esm/src/components/Virtualized/List/ListScroll.js.map +0 -1
- package/dist/esm/src/components/Virtualized/List/ListScroll.styl.js.map +0 -1
- package/dist/esm/src/components/Virtualized/Virtualized.helpers.js.map +0 -1
- package/dist/esm/src/components/Virtualized/Virtualized.js.map +0 -1
- package/dist/esm/src/components/Virtualized/Virtualized.styl.js.map +0 -1
- package/dist/esm/src/components/Virtualized/Virtualized.types.js.map +0 -1
- package/dist/esm/src/services/i18n.js.map +0 -1
- package/dist/esm/src/tools/array.js.map +0 -1
- package/dist/esm/src/tools/config.js.map +0 -1
- package/dist/esm/src/tools/date.js.map +0 -1
- package/dist/esm/src/tools/debounce.js.map +0 -1
- package/dist/esm/src/tools/dom.js.map +0 -1
- package/dist/esm/src/tools/env.js.map +0 -1
- package/dist/esm/src/tools/file.js.map +0 -1
- package/dist/esm/src/tools/localStorage.js.map +0 -1
- package/dist/esm/src/tools/number.js.map +0 -1
- package/dist/esm/src/tools/object.js.map +0 -1
- package/dist/esm/src/tools/queryParams.js.map +0 -1
- package/dist/esm/src/tools/rangeMap.js.map +0 -1
- package/dist/esm/src/tools/resizeObserver.js.map +0 -1
- package/dist/esm/src/tools/scroll.js.map +0 -1
- package/dist/esm/src/tools/string.js.map +0 -1
- package/dist/esm/src/tools/throttle.js.map +0 -1
- package/dist/esm/src/tools/uid.js.map +0 -1
|
@@ -1,2 +1,295 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { Component, createRef, createElement } from 'react';
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
import { createStore } from 'justorm/react';
|
|
4
|
+
import cn from 'classnames';
|
|
5
|
+
import pick from 'lodash.pick';
|
|
6
|
+
import compare from 'compareq';
|
|
7
|
+
import Time from 'timen';
|
|
8
|
+
import { Label } from '../Label/Label.js';
|
|
9
|
+
import { Icon } from '../Icon/Icon.js';
|
|
10
|
+
import { Scroll } from '../Scroll/Scroll.js';
|
|
11
|
+
import { toBase64 } from '../../tools/file.js';
|
|
12
|
+
import { spliceWhere } from '../../tools/array.js';
|
|
13
|
+
import S from './InputFile.styl.js';
|
|
14
|
+
import Item from './Item/Item.js';
|
|
15
|
+
import '../AssistiveText/AssistiveText.styl.js';
|
|
16
|
+
import '../Spinner/Spinner.styl.js';
|
|
17
|
+
import '../Button/Button.styl.js';
|
|
18
|
+
import '../ButtonGroup/ButtonGroup.styl.js';
|
|
19
|
+
import '../Calendar/Calendar.styl.js';
|
|
20
|
+
import 'lodash.omit';
|
|
21
|
+
import '../RequiredStar/RequiredStar.styl.js';
|
|
22
|
+
import 'nanoid';
|
|
23
|
+
import '../Input/Input.styl.js';
|
|
24
|
+
import '../Portal/Portal.js';
|
|
25
|
+
import '../Paranja/Paranja.styl.js';
|
|
26
|
+
import '../../tools/dom.js';
|
|
27
|
+
import '../Popup/Popup.styl.js';
|
|
28
|
+
import '../../tools/queryParams.js';
|
|
29
|
+
import '../Select/Select.styl.js';
|
|
30
|
+
import '../Checkbox/Checkbox.styl.js';
|
|
31
|
+
import '../Container/Container.styl.js';
|
|
32
|
+
import '../DatePicker/DatePicker.styl.js';
|
|
33
|
+
import 'moment';
|
|
34
|
+
import '../DatePickerInput/DatePickerInput.styl.js';
|
|
35
|
+
import { Draggable } from '../Draggable/Draggable.js';
|
|
36
|
+
import '../Expand/Expand.styl.js';
|
|
37
|
+
import '../Form/Form.styl.js';
|
|
38
|
+
import '../Form/Validator.js';
|
|
39
|
+
import '../Form/SubmitButtons/SubmitButtons.styl.js';
|
|
40
|
+
import '../Gallery/Gallery.styl.js';
|
|
41
|
+
import '../Heading/Heading.js';
|
|
42
|
+
import '../LightBox/LightBox.styl.js';
|
|
43
|
+
import '../Notifications/Notifications.js';
|
|
44
|
+
import '../PopupMenu/PopupMenu.styl.js';
|
|
45
|
+
import '../Router/Router.js';
|
|
46
|
+
import '../Table/Table.styl.js';
|
|
47
|
+
import '../Tabs/Tabs.styl.js';
|
|
48
|
+
import '../Text/Text.js';
|
|
49
|
+
import '../Virtualized/Virtualized.styl.js';
|
|
50
|
+
import '../Virtualized/List/List.styl.js';
|
|
51
|
+
import '../Virtualized/List/ListScroll.styl.js';
|
|
52
|
+
import '../../services/i18n.js';
|
|
53
|
+
|
|
54
|
+
const SCROLL_OFFSET = {
|
|
55
|
+
s: 10,
|
|
56
|
+
m: 12,
|
|
57
|
+
l: 16,
|
|
58
|
+
};
|
|
59
|
+
const defaultFileState = {
|
|
60
|
+
total: 1,
|
|
61
|
+
loaded: 0,
|
|
62
|
+
error: null,
|
|
63
|
+
base64: '',
|
|
64
|
+
};
|
|
65
|
+
const buildDefaultState = (src, index, loaded) => ({
|
|
66
|
+
...defaultFileState,
|
|
67
|
+
loaded,
|
|
68
|
+
index,
|
|
69
|
+
src,
|
|
70
|
+
});
|
|
71
|
+
class InputFile extends Component {
|
|
72
|
+
store;
|
|
73
|
+
filesToUpload = []; // [File,...]
|
|
74
|
+
previewRequests = {}; // [index]: Promise
|
|
75
|
+
inputRef = createRef();
|
|
76
|
+
_mounted = false;
|
|
77
|
+
constructor(props) {
|
|
78
|
+
super(props);
|
|
79
|
+
this.store = createStore(this, {
|
|
80
|
+
items: this.getStateFromProps(),
|
|
81
|
+
labelClipPath: '',
|
|
82
|
+
pickingIndex: null,
|
|
83
|
+
isDragging: false,
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
static defaultProps = {
|
|
87
|
+
size: 'm',
|
|
88
|
+
variant: 'default',
|
|
89
|
+
maxCount: 1,
|
|
90
|
+
};
|
|
91
|
+
componentDidMount() {
|
|
92
|
+
this._mounted = true;
|
|
93
|
+
this.props.uploadOnDemand?.(this.demandedUploader);
|
|
94
|
+
}
|
|
95
|
+
componentWillUnmount() {
|
|
96
|
+
this._mounted = false;
|
|
97
|
+
this.store.items.forEach(({ xhr }) => xhr?.abort());
|
|
98
|
+
}
|
|
99
|
+
componentDidUpdate(prevProps) {
|
|
100
|
+
const { value, maxCount } = this.props;
|
|
101
|
+
if (!compare(prevProps.value, value) || prevProps.maxCount !== maxCount) {
|
|
102
|
+
this.store.items = this.getStateFromProps();
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
isMultiple = () => this.props.maxCount > 1;
|
|
106
|
+
getStateFromProps() {
|
|
107
|
+
const { value, maxCount, upload } = this.props;
|
|
108
|
+
const loaded = upload ? 1 : 0;
|
|
109
|
+
if (this.isMultiple()) {
|
|
110
|
+
if (maxCount === 1)
|
|
111
|
+
return [buildDefaultState(value, 0, loaded)];
|
|
112
|
+
return value
|
|
113
|
+
.slice(0, maxCount)
|
|
114
|
+
.map((src, index) => buildDefaultState(src, index, loaded));
|
|
115
|
+
}
|
|
116
|
+
const val = Array.isArray(value) ? value[0] : value;
|
|
117
|
+
return val ? [buildDefaultState(val, 0, loaded)] : [];
|
|
118
|
+
}
|
|
119
|
+
getValFromState = () => {
|
|
120
|
+
const { items } = this.store;
|
|
121
|
+
if (this.isMultiple())
|
|
122
|
+
return items.map(({ src, base64 }) => src || base64);
|
|
123
|
+
if (!items[0])
|
|
124
|
+
return null;
|
|
125
|
+
return items[0].src || items[0].base64;
|
|
126
|
+
};
|
|
127
|
+
getLastIndex = () => {
|
|
128
|
+
const { value } = this.props;
|
|
129
|
+
return Array.isArray(value) ? value.length : 0;
|
|
130
|
+
};
|
|
131
|
+
filterAllowedFiles(files, index) {
|
|
132
|
+
const { maxCount, limit } = this.props;
|
|
133
|
+
const allowedFiles = [];
|
|
134
|
+
[...files].every(file => {
|
|
135
|
+
if (index >= maxCount)
|
|
136
|
+
return false;
|
|
137
|
+
if (limit) {
|
|
138
|
+
const sizeMb = file.size / 1024 / 1024;
|
|
139
|
+
if (sizeMb > limit) {
|
|
140
|
+
console.error(`Max file size - ${limit}Mb`, file);
|
|
141
|
+
return false;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
allowedFiles.push(file);
|
|
145
|
+
index++;
|
|
146
|
+
return true;
|
|
147
|
+
}, []);
|
|
148
|
+
return allowedFiles;
|
|
149
|
+
}
|
|
150
|
+
onPlusButtonClick = () => this.inputRef.current.click();
|
|
151
|
+
onItemClick(index) {
|
|
152
|
+
this.store.pickingIndex = index;
|
|
153
|
+
Time.after(50, () => this.inputRef.current.click());
|
|
154
|
+
}
|
|
155
|
+
onDragStart = () => (this.store.isDragging = true);
|
|
156
|
+
onDragEnd = () => (this.store.isDragging = false);
|
|
157
|
+
onChange = async (e) => {
|
|
158
|
+
const { files } = e.target;
|
|
159
|
+
const { items, pickingIndex } = this.store;
|
|
160
|
+
const { onSelect, uploadOnDemand, upload } = this.props;
|
|
161
|
+
let index = pickingIndex ?? this.getLastIndex();
|
|
162
|
+
const allowedFiles = this.filterAllowedFiles(files, index);
|
|
163
|
+
allowedFiles.forEach(file => {
|
|
164
|
+
items[index] = { ...defaultFileState, index };
|
|
165
|
+
this.filesToUpload[index] = file;
|
|
166
|
+
this.previewRequests[index] = this.generatePreview(file, index);
|
|
167
|
+
index++;
|
|
168
|
+
});
|
|
169
|
+
onSelect?.(allowedFiles);
|
|
170
|
+
if (upload)
|
|
171
|
+
this.processUploadOnChange(allowedFiles);
|
|
172
|
+
if (uploadOnDemand)
|
|
173
|
+
this.processUploadOnDemand();
|
|
174
|
+
if (typeof pickingIndex === 'number')
|
|
175
|
+
this.store.pickingIndex = null;
|
|
176
|
+
};
|
|
177
|
+
onReorder = ids => {
|
|
178
|
+
const { items } = this.store;
|
|
179
|
+
const { onChange } = this.props;
|
|
180
|
+
this.store.items = ids.map(id => items[id]);
|
|
181
|
+
onChange(null, this.getValFromState());
|
|
182
|
+
};
|
|
183
|
+
onProgress = state => e => {
|
|
184
|
+
Object.assign(state, pick(e, ['total', 'loaded']));
|
|
185
|
+
};
|
|
186
|
+
async generatePreview(file, index) {
|
|
187
|
+
const state = this.store.items[index];
|
|
188
|
+
Object.assign(state, defaultFileState);
|
|
189
|
+
state.base64 = await toBase64(file);
|
|
190
|
+
delete this.previewRequests[index];
|
|
191
|
+
}
|
|
192
|
+
async processUploadOnDemand() {
|
|
193
|
+
await Promise.all(Object.values(this.previewRequests));
|
|
194
|
+
if (!this._mounted)
|
|
195
|
+
return;
|
|
196
|
+
const { onChange } = this.props;
|
|
197
|
+
onChange(null, this.getValFromState());
|
|
198
|
+
}
|
|
199
|
+
async processUploadOnChange(files) {
|
|
200
|
+
const { onChange } = this.props;
|
|
201
|
+
const { pickingIndex } = this.store;
|
|
202
|
+
const lastIndex = pickingIndex ?? this.getLastIndex();
|
|
203
|
+
const reqs = files.map((file, i) => this.upload(file, lastIndex + i));
|
|
204
|
+
await Promise.all(reqs);
|
|
205
|
+
onChange(null, this.getValFromState());
|
|
206
|
+
}
|
|
207
|
+
async upload(file, index) {
|
|
208
|
+
const { upload } = this.props;
|
|
209
|
+
const { items } = this.store;
|
|
210
|
+
const state = items[index];
|
|
211
|
+
const src = await upload({
|
|
212
|
+
file,
|
|
213
|
+
onProgress: this.onProgress(state),
|
|
214
|
+
getXHR: xhr => (state.xhr = xhr),
|
|
215
|
+
});
|
|
216
|
+
delete this.filesToUpload[index];
|
|
217
|
+
if (!this._mounted)
|
|
218
|
+
return;
|
|
219
|
+
Object.assign(state, {
|
|
220
|
+
src,
|
|
221
|
+
loaded: state.total,
|
|
222
|
+
xhr: null,
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
demandedUploader = async (upload) => {
|
|
226
|
+
const { value } = this.props;
|
|
227
|
+
const { items } = this.store;
|
|
228
|
+
let newVal;
|
|
229
|
+
if (this.isMultiple()) {
|
|
230
|
+
const requests = [];
|
|
231
|
+
newVal = [...value];
|
|
232
|
+
value.forEach((val, i) => {
|
|
233
|
+
const file = this.filesToUpload[i];
|
|
234
|
+
if (file) {
|
|
235
|
+
const params = { file, onProgress: this.onProgress(items[i]) };
|
|
236
|
+
requests.push(upload(params).then(url => (newVal[i] = url)));
|
|
237
|
+
}
|
|
238
|
+
});
|
|
239
|
+
await Promise.all(requests);
|
|
240
|
+
}
|
|
241
|
+
else {
|
|
242
|
+
newVal = await upload(this.filesToUpload[0], this.onProgress(items[0]));
|
|
243
|
+
}
|
|
244
|
+
this.filesToUpload = [];
|
|
245
|
+
return newVal;
|
|
246
|
+
};
|
|
247
|
+
remove = async (e, value) => {
|
|
248
|
+
e.stopPropagation();
|
|
249
|
+
const { remove, onChange } = this.props;
|
|
250
|
+
if (remove) {
|
|
251
|
+
const res = await remove(value);
|
|
252
|
+
if (!res)
|
|
253
|
+
return;
|
|
254
|
+
}
|
|
255
|
+
const { items } = this.store;
|
|
256
|
+
spliceWhere(items, value, 'src');
|
|
257
|
+
onChange(null, this.getValFromState());
|
|
258
|
+
};
|
|
259
|
+
renderPlusButton() {
|
|
260
|
+
const { size } = this.props;
|
|
261
|
+
return (jsx("label", { className: cn(S.item, S.addButton), onClick: this.onPlusButtonClick, children: jsx(Icon, { type: "plus", size: size }) }, "add-button"));
|
|
262
|
+
}
|
|
263
|
+
renderItem = (i, props = {}) => {
|
|
264
|
+
const { size } = this.props;
|
|
265
|
+
const { base64, src, loaded, total } = this.store.items[i];
|
|
266
|
+
const url = base64 || src;
|
|
267
|
+
return (createElement(Item, { ...props, size: size, key: String(url) + i, img: url, total: total, loaded: loaded, waitingForUpload: !!this.filesToUpload[i], onRemove: e => this.remove(e, url), onClick: () => this.onItemClick(i) }));
|
|
268
|
+
};
|
|
269
|
+
renderItems() {
|
|
270
|
+
const { draggable, maxCount } = this.props;
|
|
271
|
+
const { items, isDragging } = this.store;
|
|
272
|
+
if (items.length === 0)
|
|
273
|
+
return this.renderPlusButton();
|
|
274
|
+
const needAddButton = this.isMultiple() && items.length < maxCount;
|
|
275
|
+
if (draggable) {
|
|
276
|
+
const ids = Array.from({ length: items.length }, (_, i) => String(i));
|
|
277
|
+
return (jsx(Draggable, { className: S.draggable, itemClassName: S.item, items: ids, onDragStart: this.onDragStart, onDragEnd: this.onDragEnd, onChange: this.onReorder, renderItem: id => this.renderItem(parseInt(id, 10), { isDragging }), children: needAddButton && this.renderPlusButton() }));
|
|
278
|
+
}
|
|
279
|
+
const elems = items.map((_, i) => this.renderItem(i, { className: S.item }));
|
|
280
|
+
if (needAddButton)
|
|
281
|
+
elems.push(this.renderPlusButton());
|
|
282
|
+
return elems;
|
|
283
|
+
}
|
|
284
|
+
render() {
|
|
285
|
+
// @ts-ignore
|
|
286
|
+
const { className, size, variant, draggable, label, maxCount, accept, value, } = this.props;
|
|
287
|
+
const { labelClipPath, pickingIndex } = this.store;
|
|
288
|
+
const isEmpty = !value?.length;
|
|
289
|
+
const classes = cn(S.root, className, isEmpty && S.empty, S[`size-${size}`], S[`variant-${variant}`], draggable && S.draggable);
|
|
290
|
+
const scrollOffset = SCROLL_OFFSET[size];
|
|
291
|
+
return (jsxs("div", { className: classes, children: [jsx("div", { className: S.border, suppressHydrationWarning: true, style: { clipPath: labelClipPath } }), jsx("input", { ref: this.inputRef, className: S.input, type: "file", multiple: maxCount > 1 && typeof pickingIndex !== 'number', accept: accept, onChange: this.onChange }), jsx(Label, { isOnTop: true, size: size, className: S.label, onClipPathChange: clipPath => (this.store.labelClipPath = clipPath), children: label }), jsx(Scroll, { y: true, size: "s", className: S.inner, innerClassName: S.items, fadeSize: size, offset: { y: { before: scrollOffset, after: scrollOffset } }, style: { clipPath: labelClipPath }, children: this.renderItems() })] }));
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
export { InputFile };
|
|
@@ -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 = ".InputFile_root__pY3JG{position:relative}.InputFile_border__whRyD{border-radius:inherit;height:100%;left:0;pointer-events:none;position:absolute;top:0;transition:background-color .2s ease-out;width:100%}.InputFile_variant-outlined__f5hnA .InputFile_border__whRyD{background-color:transparent;box-shadow:inset 0 0 0 2px var(--accent-color)}.InputFile_variant-default__Jqzal .InputFile_border__whRyD{background-color:var(--accent-color-alpha-100)}.InputFile_variant-default__Jqzal .InputFile_border__whRyD:hover{background-color:var(--active-color-alpha-300)}.InputFile_empty__7j1BK:hover .InputFile_border__whRyD{background-color:var(--active-color-alpha-500)}.InputFile_label__bAEz-{align-items:center;display:flex;height:100%;position:absolute}.InputFile_inner__BQFX7{max-height:inherit}.InputFile_items__ND1YG{align-items:center;display:flex;flex-wrap:wrap;font-size:0;margin:-4px;width:calc(100% + 8px)}.InputFile_item__qg5I6{display:inline-flex;margin:4px;position:relative}.InputFile_item__qg5I6:first-child:last-child{width:100%}.InputFile_addButton__rW719{align-items:center;cursor:pointer;justify-content:center;position:relative;transition:background-color .2s ease-out}.InputFile_root__pY3JG:not(.InputFile_empty__7j1BK) .InputFile_addButton__rW719:hover{background-color:var(--active-color-alpha-500)}.InputFile_input__7FR5r{bottom:0;left:0;opacity:0;pointer-events:none;position:absolute;right:0;top:0}.InputFile_size-s__hsWTE{font-size:16px}.InputFile_size-s__hsWTE .InputFile_border__whRyD,.InputFile_size-s__hsWTE .InputFile_item__qg5I6{border-radius:4px}.InputFile_size-s__hsWTE .InputFile_items__ND1YG{padding:8px}.InputFile_size-s__hsWTE .InputFile_item__qg5I6{height:50px;width:50px}.InputFile_size-m__unA0n{font-size:20px}.InputFile_size-m__unA0n .InputFile_border__whRyD,.InputFile_size-m__unA0n .InputFile_item__qg5I6{border-radius:6px}.InputFile_size-m__unA0n .InputFile_items__ND1YG{padding:12px}.InputFile_size-m__unA0n .InputFile_item__qg5I6{height:70px;width:70px}.InputFile_size-l__wpOVo{font-size:24px}.InputFile_size-l__wpOVo .InputFile_border__whRyD,.InputFile_size-l__wpOVo .InputFile_item__qg5I6{border-radius:8px}.InputFile_size-l__wpOVo .InputFile_items__ND1YG{padding:14px}.InputFile_size-l__wpOVo .InputFile_item__qg5I6{height:100px;width:100px}.InputFile_draggable__M7-3v{position:relative;width:100%}.InputFile_draggable__M7-3v .InputFile_item__qg5I6:not(.InputFile_addButton__rW719){cursor:move}";
|
|
4
|
+
var S = {"root":"InputFile_root__pY3JG","border":"InputFile_border__whRyD","variant-outlined":"InputFile_variant-outlined__f5hnA","variant-default":"InputFile_variant-default__Jqzal","empty":"InputFile_empty__7j1BK","label":"InputFile_label__bAEz-","inner":"InputFile_inner__BQFX7","items":"InputFile_items__ND1YG","item":"InputFile_item__qg5I6","addButton":"InputFile_addButton__rW719","input":"InputFile_input__7FR5r","size-s":"InputFile_size-s__hsWTE","size-m":"InputFile_size-m__unA0n","size-l":"InputFile_size-l__wpOVo","draggable":"InputFile_draggable__M7-3v"};
|
|
5
|
+
styleInject(css_248z);
|
|
6
|
+
|
|
7
|
+
export { S as default };
|
|
@@ -1,2 +1,18 @@
|
|
|
1
|
-
import{jsxs,jsx}from
|
|
2
|
-
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import cn from 'classnames';
|
|
3
|
+
import { Button } from '../../Button/Button.js';
|
|
4
|
+
import { Icon } from '../../Icon/Icon.js';
|
|
5
|
+
import S from './Item.styl.js';
|
|
6
|
+
|
|
7
|
+
function Item(props) {
|
|
8
|
+
const { className, size, img, total, loaded, waitingForUpload, children, onRemove, isDragging, ...rest } = props;
|
|
9
|
+
const style = {};
|
|
10
|
+
const isComplete = loaded === total;
|
|
11
|
+
const isLoading = !isComplete && loaded > 0;
|
|
12
|
+
const classes = cn(S.root, S[`size-${size}`], waitingForUpload && S.waitingForUpload, isLoading && S.loading, isDragging && S.dragging, className);
|
|
13
|
+
if (img)
|
|
14
|
+
style.backgroundImage = `url(${img})`;
|
|
15
|
+
return (jsxs("div", { ...rest, className: classes, style: style, children: [children, jsx(Button, { className: S.removeButton, size: "s", variant: "clear", square: true, onClick: onRemove, children: jsx(Icon, { type: "delete" }) }), jsx("div", { className: cn(S.progress, isComplete && S.complete), style: { left: `${(loaded / total) * 100 - 100}%` } }), jsx("div", { className: S.overlay })] }));
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export { Item as default };
|
|
@@ -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 = ".Item_root__uFQw8{background-position:50%;background-size:cover;height:100%;overflow:hidden;position:relative}.Item_root__uFQw8.Item_loading__hN0tA{pointer-events:none}.Item_root__uFQw8>.Item_overlay__lE8hl,.Item_root__uFQw8>img{border-radius:inherit}.Item_size-s__6FWi7{border-radius:4px}.Item_size-m__ICwh8{border-radius:6px}.Item_size-l__zv6Xj{border-radius:8px}.Item_overlay__lE8hl{bottom:0;left:0;pointer-events:none;position:absolute;right:0;top:0;transition:background-color .1s ease-out;z-index:1}.Item_waitingForUpload__JFsoN .Item_overlay__lE8hl{background-color:var(--accent-color-alpha-200);border:2px dashed var(--accent-color-alpha-500)}.Item_root__uFQw8:hover .Item_overlay__lE8hl{background-color:var(--active-color-alpha-500)}.Item_root__uFQw8:hover .Item_removeButton__EgOub{transform:translateX(0)}.Item_removeButton__EgOub{border-radius:0;border-top-left-radius:inherit;bottom:0;position:absolute;right:0;transform:translateX(100%);transition:transform .2s ease-out;z-index:2}.Item_removeButton__EgOub,.Item_removeButton__EgOub:hover{background-color:var(--decent-color-alpha-900)}.Item_removeButton__EgOub:hover{color:var(--danger-color)}.Item_progress__bpcNP{background-color:var(--active-color-alpha-800);height:100%;left:-100%;pointer-events:none;position:absolute;top:0;transition:all .2s ease-out;width:100%;z-index:1}.Item_progress__bpcNP.Item_complete__lEfmV{opacity:0}.Item_dragging__HPzfu{overflow:visible}.Item_dragging__HPzfu .Item_overlay__lE8hl,.Item_dragging__HPzfu .Item_progress__bpcNP,.Item_dragging__HPzfu .Item_removeButton__EgOub{display:none}";
|
|
4
|
+
var S = {"root":"Item_root__uFQw8","loading":"Item_loading__hN0tA","overlay":"Item_overlay__lE8hl","size-s":"Item_size-s__6FWi7","size-m":"Item_size-m__ICwh8","size-l":"Item_size-l__zv6Xj","waitingForUpload":"Item_waitingForUpload__JFsoN","removeButton":"Item_removeButton__EgOub","progress":"Item_progress__bpcNP","complete":"Item_complete__lEfmV","dragging":"Item_dragging__HPzfu"};
|
|
5
|
+
styleInject(css_248z);
|
|
6
|
+
|
|
7
|
+
export { S as default };
|
|
@@ -1,2 +1,8 @@
|
|
|
1
|
-
var LABEL_MULTIPLIER
|
|
2
|
-
|
|
1
|
+
var LABEL_MULTIPLIER = 0.7;
|
|
2
|
+
var LABEL_PADDING = 5;
|
|
3
|
+
var C = {
|
|
4
|
+
LABEL_MULTIPLIER: LABEL_MULTIPLIER,
|
|
5
|
+
LABEL_PADDING: LABEL_PADDING
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export { LABEL_MULTIPLIER, LABEL_PADDING, C as default };
|
|
@@ -1,2 +1,35 @@
|
|
|
1
|
-
import C from
|
|
2
|
-
|
|
1
|
+
import C from './Label.constants.json.js';
|
|
2
|
+
|
|
3
|
+
function getBottomOffset(size = 's') {
|
|
4
|
+
if (size === 'l')
|
|
5
|
+
return 4;
|
|
6
|
+
if (size === 'm')
|
|
7
|
+
return 2;
|
|
8
|
+
return 0;
|
|
9
|
+
}
|
|
10
|
+
function getLabelClipPath(left, width, size = 's') {
|
|
11
|
+
const offset = 10;
|
|
12
|
+
const A = left - C.LABEL_PADDING;
|
|
13
|
+
// @ts-ignore
|
|
14
|
+
const B = width === 0 ? 0 : left + width * C.LABEL_MULTIPLIER + C.LABEL_PADDING;
|
|
15
|
+
const cutWidth = 5 + getBottomOffset(size);
|
|
16
|
+
const min = `-${offset}px`;
|
|
17
|
+
const max = `calc(100% + ${offset}px)`;
|
|
18
|
+
const points = [
|
|
19
|
+
[min, min],
|
|
20
|
+
[min, max],
|
|
21
|
+
[max, max],
|
|
22
|
+
[max, min],
|
|
23
|
+
[`${B}px`, min],
|
|
24
|
+
[`${B}px`, `${cutWidth - 1}px`],
|
|
25
|
+
[`${B - 1}px`, `${cutWidth}px`],
|
|
26
|
+
[`${A + 1}px`, `${cutWidth}px`],
|
|
27
|
+
[`${A}px`, `${cutWidth - 1}px`],
|
|
28
|
+
[`${A}px`, min],
|
|
29
|
+
]
|
|
30
|
+
.map(coords => coords.join(' '))
|
|
31
|
+
.join(', \n');
|
|
32
|
+
return `polygon(${points})`;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export { getLabelClipPath };
|
|
@@ -1,2 +1,58 @@
|
|
|
1
|
-
import{jsxs,jsx}from
|
|
2
|
-
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { Component, createRef } from 'react';
|
|
3
|
+
import cn from 'classnames';
|
|
4
|
+
import Time from 'timen';
|
|
5
|
+
import S from './Label.styl.js';
|
|
6
|
+
import { getLabelClipPath } from './Label.helpers.js';
|
|
7
|
+
|
|
8
|
+
class Label extends Component {
|
|
9
|
+
gapWrapRef = createRef();
|
|
10
|
+
gapRef = createRef();
|
|
11
|
+
timers;
|
|
12
|
+
state = { clipPath: '' };
|
|
13
|
+
labelWidth = 0;
|
|
14
|
+
static defaultProps = {
|
|
15
|
+
size: 'm',
|
|
16
|
+
};
|
|
17
|
+
constructor(props) {
|
|
18
|
+
super(props);
|
|
19
|
+
this.timers = Time.create();
|
|
20
|
+
}
|
|
21
|
+
componentDidMount() {
|
|
22
|
+
this.updateClipPath();
|
|
23
|
+
}
|
|
24
|
+
componentDidUpdate(prevProps) {
|
|
25
|
+
const { children, isOnTop, size, onClipPathChange } = this.props;
|
|
26
|
+
const needUpadte = onClipPathChange &&
|
|
27
|
+
(children !== prevProps.children ||
|
|
28
|
+
isOnTop !== prevProps.isOnTop ||
|
|
29
|
+
size !== prevProps.size);
|
|
30
|
+
if (needUpadte)
|
|
31
|
+
this.updateClipPath();
|
|
32
|
+
}
|
|
33
|
+
updateClipPath = () => {
|
|
34
|
+
const { isOnTop, onClipPathChange, size } = this.props;
|
|
35
|
+
const gapWrapElem = this.gapWrapRef?.current;
|
|
36
|
+
const gapElem = this.gapRef?.current;
|
|
37
|
+
if (!onClipPathChange || !gapWrapElem || !gapElem)
|
|
38
|
+
return;
|
|
39
|
+
// @ts-ignore
|
|
40
|
+
const { offsetLeft } = gapWrapElem;
|
|
41
|
+
const { offsetWidth } = gapElem;
|
|
42
|
+
const labelWidth = isOnTop ? offsetWidth : 0;
|
|
43
|
+
if (this.labelWidth === labelWidth)
|
|
44
|
+
return;
|
|
45
|
+
this.labelWidth = labelWidth;
|
|
46
|
+
const clipPath = getLabelClipPath(offsetLeft, labelWidth, size);
|
|
47
|
+
onClipPathChange(clipPath);
|
|
48
|
+
};
|
|
49
|
+
render() {
|
|
50
|
+
const { className, size, isOnTop, isError, children } = this.props;
|
|
51
|
+
const classes = cn(S.root, S[`size-${size}`], isOnTop && S.onTop, isError && S.isError, className);
|
|
52
|
+
if (!children)
|
|
53
|
+
return null;
|
|
54
|
+
return (jsxs("div", { className: classes, children: [jsx("div", { className: S.view, children: jsx("div", { children: children }) }), jsx("div", { className: S.gapWrap, ref: this.gapWrapRef, children: jsx("div", { className: S.gap, ref: this.gapRef, children: children }) })] }));
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export { Label };
|
|
@@ -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 = ".Label_size-s__CL8do{font-size:16px;padding:0 8px}.Label_size-m__X81DA{font-size:20px;padding:0 12px}.Label_size-l__-2YIE{font-size:24px;padding:0 14px}.Label_size-xl__aeykV{padding-right:10px}.Label_root__TewVm{align-items:center;color:var(--accent-color-alpha-500);display:flex;left:0;padding-bottom:0;padding-top:0;pointer-events:none;position:absolute;top:0;-webkit-user-select:none;-moz-user-select:none;user-select:none;z-index:1}.Label_root__TewVm,.Label_root__TewVm>div{height:100%;max-width:100%}.Label_gap__zlRrx,.Label_view__Lz9Eu>div{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.Label_view__Lz9Eu{align-items:center;-webkit-backface-visibility:hidden;backface-visibility:hidden;display:flex;height:100%;max-width:100%;transform:translateZ(0);transform-origin:top left;transition:transform .15s ease-out}.Label_onTop__7Ntzk .Label_view__Lz9Eu{color:var(--accent-color);transform:scale(.7) translate3d(0,-50%,0)}.Label_isError__YqI0d .Label_view__Lz9Eu{color:var(--danger-color)}.Label_gapWrap__lDGBB{max-width:100%;opacity:0;padding:inherit;pointer-events:none;position:absolute}.Label_gapWrap__lDGBB:before{border-radius:4px;content:\"\";height:1.4em;left:-6px;position:absolute;right:-6px;z-index:-1}";
|
|
4
|
+
var S = {"size-s":"Label_size-s__CL8do","size-m":"Label_size-m__X81DA","size-l":"Label_size-l__-2YIE","size-xl":"Label_size-xl__aeykV","root":"Label_root__TewVm","view":"Label_view__Lz9Eu","gap":"Label_gap__zlRrx","onTop":"Label_onTop__7Ntzk","isError":"Label_isError__YqI0d","gapWrap":"Label_gapWrap__lDGBB"};
|
|
5
|
+
styleInject(css_248z);
|
|
6
|
+
|
|
7
|
+
export { S as default };
|
|
@@ -1,2 +1,65 @@
|
|
|
1
|
-
import{jsx}from
|
|
2
|
-
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { Component } from 'react';
|
|
3
|
+
import Time from 'timen';
|
|
4
|
+
import { createStore } from 'justorm/react';
|
|
5
|
+
import { Container } from '../Container/Container.js';
|
|
6
|
+
import { Spinner } from '../Spinner/Spinner.js';
|
|
7
|
+
|
|
8
|
+
function compare(cb1, cb2) {
|
|
9
|
+
return cb1?.toString() === cb2?.toString();
|
|
10
|
+
}
|
|
11
|
+
const loaded = new Map();
|
|
12
|
+
class Lazy extends Component {
|
|
13
|
+
store;
|
|
14
|
+
Node;
|
|
15
|
+
hasNode = false;
|
|
16
|
+
clearSpinnerTimeout;
|
|
17
|
+
static defaultProps = {
|
|
18
|
+
size: 'm',
|
|
19
|
+
};
|
|
20
|
+
constructor(props) {
|
|
21
|
+
super(props);
|
|
22
|
+
this.Node = loaded.get(this.props.loader);
|
|
23
|
+
this.hasNode = Boolean(this.Node);
|
|
24
|
+
this.store = createStore(this, {
|
|
25
|
+
loading: !this.hasNode,
|
|
26
|
+
spinnerTimeout: this.hasNode,
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
componentDidMount() {
|
|
30
|
+
if (!this.hasNode)
|
|
31
|
+
this.update();
|
|
32
|
+
}
|
|
33
|
+
componentDidUpdate({ loader }) {
|
|
34
|
+
if (!compare(this.props.loader, loader)) {
|
|
35
|
+
// @ts-ignore
|
|
36
|
+
this.clearSpinnerTimeout?.();
|
|
37
|
+
this.update();
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
update() {
|
|
41
|
+
const { loader } = this.props;
|
|
42
|
+
this.clearSpinnerTimeout = Time.after(500, () => this.setState({ spinnerTimeout: false }));
|
|
43
|
+
this.store.loading = true;
|
|
44
|
+
loader().then(({ default: Node }) => {
|
|
45
|
+
if (!compare(this.props.loader, loader))
|
|
46
|
+
return;
|
|
47
|
+
this.Node = Node;
|
|
48
|
+
loaded.set(loader, Node);
|
|
49
|
+
this.store.loading = false;
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
render() {
|
|
53
|
+
const { Node } = this;
|
|
54
|
+
const { progressElem, loader, hideSpinner, ...props } = this.props;
|
|
55
|
+
const { loading, spinnerTimeout } = this.store;
|
|
56
|
+
if (Node)
|
|
57
|
+
return jsx(Node, { ...props });
|
|
58
|
+
if (!spinnerTimeout && loading && !hideSpinner) {
|
|
59
|
+
return (progressElem ?? (jsx(Container, { fullHeight: true, fullWidth: true, children: jsx(Spinner, { size: props.size }) })));
|
|
60
|
+
}
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export { Lazy };
|
|
@@ -1,2 +1,28 @@
|
|
|
1
|
-
import{jsxs,jsx}from
|
|
2
|
-
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useState, useCallback, useEffect } from 'react';
|
|
3
|
+
import cn from 'classnames';
|
|
4
|
+
import { Paranja } from '../Paranja/Paranja.js';
|
|
5
|
+
import { Button } from '../Button/Button.js';
|
|
6
|
+
import { Icon } from '../Icon/Icon.js';
|
|
7
|
+
import S from './LightBox.styl.js';
|
|
8
|
+
|
|
9
|
+
function LightBox({ children, className, onClose, blur, ...props }) {
|
|
10
|
+
const [isOpen, setOpen] = useState(false);
|
|
11
|
+
const onKeyDown = useCallback(e => {
|
|
12
|
+
if (isOpen && e.key === 'Escape') {
|
|
13
|
+
e.stopPropagation();
|
|
14
|
+
setOpen(false);
|
|
15
|
+
onClose?.();
|
|
16
|
+
}
|
|
17
|
+
}, [isOpen, onClose]);
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
setOpen(props.isOpen);
|
|
20
|
+
}, [props.isOpen]);
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
document.addEventListener('keydown', onKeyDown, true);
|
|
23
|
+
return () => document.removeEventListener('keydown', onKeyDown, true);
|
|
24
|
+
}, [isOpen]);
|
|
25
|
+
return (jsxs(Paranja, { className: cn(S.root, isOpen && S.open, className), blur: blur, children: [children, jsx(Button, { className: S.close, onClick: onClose, variant: "clear", children: jsx(Icon, { type: "close", size: "l" }) })] }));
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export { LightBox };
|
|
@@ -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 = ".LightBox_root__R-JhJ{align-items:center;display:flex;justify-content:center;opacity:0;pointer-events:none;transition:opacity .2s ease-out}.LightBox_open__a-qrU{opacity:1;pointer-events:all}.LightBox_close__ts4k1{border-radius:0;color:var(--accent-color);height:60px;min-height:60px;position:absolute;right:0;top:0;width:60px;z-index:1}.LightBox_close__ts4k1:hover{background-color:var(--decent-color-alpha-200);color:var(--active-color)}@media (min-width:700px){.LightBox_close__ts4k1{height:100px;min-height:100px;width:100px}}";
|
|
4
|
+
var S = {"root":"LightBox_root__R-JhJ","open":"LightBox_open__a-qrU","close":"LightBox_close__ts4k1"};
|
|
5
|
+
styleInject(css_248z);
|
|
6
|
+
|
|
7
|
+
export { S as default };
|
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
var ANIMATION_DURATION=300
|
|
2
|
-
|
|
1
|
+
var ANIMATION_DURATION = 300;
|
|
2
|
+
var C = {
|
|
3
|
+
ANIMATION_DURATION: ANIMATION_DURATION
|
|
4
|
+
};
|
|
5
|
+
|
|
6
|
+
export { ANIMATION_DURATION, C as default };
|