@homecode/ui 4.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +29 -0
- package/dist/esm/index.js +78 -0
- package/dist/esm/node_modules/style-inject/dist/style-inject.es.js +28 -0
- package/dist/esm/src/components/AssistiveText/AssistiveText.js +10 -0
- package/dist/esm/src/components/AssistiveText/AssistiveText.styl.js +7 -0
- package/dist/esm/src/components/Button/Button.helpers.js +12 -0
- package/dist/esm/src/components/Button/Button.js +38 -0
- package/dist/esm/src/components/Button/Button.styl.js +7 -0
- package/dist/esm/src/components/ButtonGroup/ButtonGroup.js +10 -0
- package/dist/esm/src/components/ButtonGroup/ButtonGroup.styl.js +7 -0
- package/dist/esm/src/components/Checkbox/Checkbox.js +48 -0
- package/dist/esm/src/components/Checkbox/Checkbox.styl.js +7 -0
- package/dist/esm/src/components/Container/Container.js +12 -0
- package/dist/esm/src/components/Container/Container.styl.js +7 -0
- package/dist/esm/src/components/DateTime/DateTime.js +17 -0
- package/dist/esm/src/components/Draggable/Draggable.js +136 -0
- package/dist/esm/src/components/Draggable/Draggable.styl.js +7 -0
- package/dist/esm/src/components/Expand/Expand.js +24 -0
- package/dist/esm/src/components/Expand/Expand.styl.js +7 -0
- package/dist/esm/src/components/Form/Form.helpers.js +42 -0
- package/dist/esm/src/components/Form/Form.js +286 -0
- package/dist/esm/src/components/Form/Form.styl.js +7 -0
- package/dist/esm/src/components/Form/Form.types.js +1 -0
- package/dist/esm/src/components/Form/SubmitButtons/SubmitButtons.js +8 -0
- package/dist/esm/src/components/Form/SubmitButtons/SubmitButtons.styl.js +7 -0
- package/dist/esm/src/components/Form/Validator.js +36 -0
- package/dist/esm/src/components/Gallery/Dots/Dots.js +9 -0
- package/dist/esm/src/components/Gallery/Dots/Dots.styl.js +7 -0
- package/dist/esm/src/components/Gallery/Gallery.js +180 -0
- package/dist/esm/src/components/Gallery/Gallery.styl.js +7 -0
- package/dist/esm/src/components/Heading/Heading.js +37 -0
- package/dist/esm/src/components/Heading/Heading.styl.js +7 -0
- package/dist/esm/src/components/Icon/Icon.js +27 -0
- package/dist/esm/src/components/Icon/Icon.styl.js +7 -0
- package/dist/esm/src/components/Icon/icons/avatar.svg.js +15 -0
- package/dist/esm/src/components/Icon/icons/brokenImage.svg.js +15 -0
- package/dist/esm/src/components/Icon/icons/check.svg.js +19 -0
- package/dist/esm/src/components/Icon/icons/chevronDown.svg.js +20 -0
- package/dist/esm/src/components/Icon/icons/chevronLeft.svg.js +20 -0
- package/dist/esm/src/components/Icon/icons/chevronRight.svg.js +20 -0
- package/dist/esm/src/components/Icon/icons/chevronUp.svg.js +20 -0
- package/dist/esm/src/components/Icon/icons/close.svg.js +15 -0
- package/dist/esm/src/components/Icon/icons/colors.svg.js +60 -0
- package/dist/esm/src/components/Icon/icons/copy.svg.js +15 -0
- package/dist/esm/src/components/Icon/icons/delete.svg.js +15 -0
- package/dist/esm/src/components/Icon/icons/draft.svg.js +15 -0
- package/dist/esm/src/components/Icon/icons/edit.svg.js +15 -0
- package/dist/esm/src/components/Icon/icons/externalLink.svg.js +15 -0
- package/dist/esm/src/components/Icon/icons/fullscreen.svg.js +15 -0
- package/dist/esm/src/components/Icon/icons/fullscreenExit.svg.js +15 -0
- package/dist/esm/src/components/Icon/icons/gear.svg.js +20 -0
- package/dist/esm/src/components/Icon/icons/history.svg.js +17 -0
- package/dist/esm/src/components/Icon/icons/home.svg.js +19 -0
- package/dist/esm/src/components/Icon/icons/index.js +41 -0
- package/dist/esm/src/components/Icon/icons/loader.svg.js +45 -0
- package/dist/esm/src/components/Icon/icons/menu.svg.js +18 -0
- package/dist/esm/src/components/Icon/icons/mic.svg.js +15 -0
- package/dist/esm/src/components/Icon/icons/minus.svg.js +15 -0
- package/dist/esm/src/components/Icon/icons/moreHorizontal.svg.js +15 -0
- package/dist/esm/src/components/Icon/icons/moreVertical.svg.js +15 -0
- package/dist/esm/src/components/Icon/icons/plus.svg.js +15 -0
- package/dist/esm/src/components/Icon/icons/redo.svg.js +15 -0
- package/dist/esm/src/components/Icon/icons/requiredStar.svg.js +15 -0
- package/dist/esm/src/components/Icon/icons/save.svg.js +17 -0
- package/dist/esm/src/components/Icon/icons/send.svg.js +16 -0
- package/dist/esm/src/components/Icon/icons/settings.svg.js +52 -0
- package/dist/esm/src/components/Icon/icons/shoppingBag.svg.js +17 -0
- package/dist/esm/src/components/Icon/icons/social_email.svg.js +15 -0
- package/dist/esm/src/components/Icon/icons/social_instagram.svg.js +15 -0
- package/dist/esm/src/components/Icon/icons/social_telegram.svg.js +19 -0
- package/dist/esm/src/components/Icon/icons/undo.svg.js +15 -0
- package/dist/esm/src/components/Input/Input.js +331 -0
- package/dist/esm/src/components/Input/Input.styl.js +7 -0
- package/dist/esm/src/components/InputFile/InputFile.js +292 -0
- package/dist/esm/src/components/InputFile/InputFile.styl.js +7 -0
- package/dist/esm/src/components/InputFile/InputFile.types.js +1 -0
- package/dist/esm/src/components/InputFile/Item/Item.js +18 -0
- package/dist/esm/src/components/InputFile/Item/Item.styl.js +7 -0
- package/dist/esm/src/components/Label/Label.constants.json.js +8 -0
- package/dist/esm/src/components/Label/Label.helpers.js +35 -0
- package/dist/esm/src/components/Label/Label.js +58 -0
- package/dist/esm/src/components/Label/Label.styl.js +7 -0
- package/dist/esm/src/components/Lazy/Lazy.js +65 -0
- package/dist/esm/src/components/LightBox/LightBox.js +28 -0
- package/dist/esm/src/components/LightBox/LightBox.styl.js +7 -0
- package/dist/esm/src/components/Notifications/Notifications.constants.json.js +6 -0
- package/dist/esm/src/components/Notifications/Notifications.js +67 -0
- package/dist/esm/src/components/Notifications/Notifications.styl.js +7 -0
- package/dist/esm/src/components/Notifications/store.js +62 -0
- package/dist/esm/src/components/Paranja/Paranja.js +14 -0
- package/dist/esm/src/components/Paranja/Paranja.styl.js +7 -0
- package/dist/esm/src/components/Popup/Popup.helpers.js +31 -0
- package/dist/esm/src/components/Popup/Popup.js +396 -0
- package/dist/esm/src/components/Popup/Popup.styl.js +7 -0
- package/dist/esm/src/components/PopupMenu/PopupMenu.js +15 -0
- package/dist/esm/src/components/PopupMenu/PopupMenu.styl.js +7 -0
- package/dist/esm/src/components/Portal/Portal.js +19 -0
- package/dist/esm/src/components/RequiredStar/RequiredStar.js +12 -0
- package/dist/esm/src/components/RequiredStar/RequiredStar.styl.js +7 -0
- package/dist/esm/src/components/Router/Link/Link.js +61 -0
- package/dist/esm/src/components/Router/Link/Link.styl.js +7 -0
- package/dist/esm/src/components/Router/Redirect.js +12 -0
- package/dist/esm/src/components/Router/Route.js +4 -0
- package/dist/esm/src/components/Router/Router.helpers.js +33 -0
- package/dist/esm/src/components/Router/Router.js +68 -0
- package/dist/esm/src/components/Router/context.js +5 -0
- package/dist/esm/src/components/Router/store.js +55 -0
- package/dist/esm/src/components/Scroll/Scroll.js +274 -0
- package/dist/esm/src/components/Scroll/Scroll.styl.js +7 -0
- package/dist/esm/src/components/Select/Select.helpers.js +37 -0
- package/dist/esm/src/components/Select/Select.js +583 -0
- package/dist/esm/src/components/Select/Select.styl.js +7 -0
- package/dist/esm/src/components/Spinner/Spinner.js +11 -0
- package/dist/esm/src/components/Spinner/Spinner.styl.js +7 -0
- package/dist/esm/src/components/Spinner/spinner.svg.js +24 -0
- package/dist/esm/src/components/Table/Table.js +24 -0
- package/dist/esm/src/components/Table/Table.styl.js +7 -0
- package/dist/esm/src/components/Tabs/Tabs.js +43 -0
- package/dist/esm/src/components/Tabs/Tabs.styl.js +7 -0
- package/dist/esm/src/components/Text/Text.js +44 -0
- package/dist/esm/src/components/Text/Text.styl.js +7 -0
- package/dist/esm/src/components/Theme/Theme.defaults.js +50 -0
- package/dist/esm/src/components/Theme/Theme.helpers.js +67 -0
- package/dist/esm/src/components/Theme/Theme.js +13 -0
- package/dist/esm/src/components/VH/VH.js +33 -0
- package/dist/esm/src/components/Virtualized/List/List.js +124 -0
- package/dist/esm/src/components/Virtualized/List/List.styl.js +7 -0
- package/dist/esm/src/components/Virtualized/List/ListScroll.js +21 -0
- package/dist/esm/src/components/Virtualized/List/ListScroll.styl.js +7 -0
- package/dist/esm/src/components/Virtualized/Virtualized.helpers.js +14 -0
- package/dist/esm/src/components/Virtualized/Virtualized.js +200 -0
- package/dist/esm/src/components/Virtualized/Virtualized.styl.js +7 -0
- package/dist/esm/src/components/Virtualized/Virtualized.types.js +1 -0
- package/dist/esm/src/services/i18n.js +68 -0
- package/dist/esm/src/tools/array.js +60 -0
- package/dist/esm/src/tools/config.js +9 -0
- package/dist/esm/src/tools/debounce.js +11 -0
- package/dist/esm/src/tools/dom.js +46 -0
- package/dist/esm/src/tools/env.js +3 -0
- package/dist/esm/src/tools/file.js +11 -0
- package/dist/esm/src/tools/localStorage.js +31 -0
- package/dist/esm/src/tools/number.js +27 -0
- package/dist/esm/src/tools/object.js +5 -0
- package/dist/esm/src/tools/queryParams.js +20 -0
- package/dist/esm/src/tools/rangeMap.js +3 -0
- package/dist/esm/src/tools/resizeObserver.js +64 -0
- package/dist/esm/src/tools/scroll.js +41 -0
- package/dist/esm/src/tools/string.js +7 -0
- package/dist/esm/src/tools/throttle.js +30 -0
- package/dist/esm/src/tools/uid.js +7 -0
- package/dist/esm/types/index.d.ts +1 -0
- package/dist/esm/types/src/components/AssistiveText/AssistiveText.d.ts +3 -0
- package/dist/esm/types/src/components/AssistiveText/AssistiveText.types.d.ts +7 -0
- package/dist/esm/types/src/components/Button/Button.d.ts +4 -0
- package/dist/esm/types/src/components/Button/Button.helpers.d.ts +1 -0
- package/dist/esm/types/src/components/Button/Button.types.d.ts +14 -0
- package/dist/esm/types/src/components/ButtonGroup/ButtonGroup.d.ts +3 -0
- package/dist/esm/types/src/components/ButtonGroup/ButtonGroup.types.d.ts +5 -0
- package/dist/esm/types/src/components/Checkbox/Checkbox.d.ts +18 -0
- package/dist/esm/types/src/components/Checkbox/Checkbox.types.d.ts +10 -0
- package/dist/esm/types/src/components/Container/Container.d.ts +3 -0
- package/dist/esm/types/src/components/Container/Container.types.d.ts +13 -0
- package/dist/esm/types/src/components/DateTime/DateTime.d.ts +8 -0
- package/dist/esm/types/src/components/DateTime/DateTime.types.d.ts +6 -0
- package/dist/esm/types/src/components/Draggable/Draggable.d.ts +24 -0
- package/dist/esm/types/src/components/Draggable/Draggable.types.d.ts +11 -0
- package/dist/esm/types/src/components/Expand/Expand.d.ts +3 -0
- package/dist/esm/types/src/components/Expand/Expand.types.d.ts +16 -0
- package/dist/esm/types/src/components/Form/Form.d.ts +32 -0
- package/dist/esm/types/src/components/Form/Form.helpers.d.ts +6 -0
- package/dist/esm/types/src/components/Form/Form.types.d.ts +71 -0
- package/dist/esm/types/src/components/Form/SubmitButtons/SubmitButtons.d.ts +13 -0
- package/dist/esm/types/src/components/Form/Validator.d.ts +2 -0
- package/dist/esm/types/src/components/Form/index.d.ts +2 -0
- package/dist/esm/types/src/components/Gallery/Dots/Dots.d.ts +5 -0
- package/dist/esm/types/src/components/Gallery/Gallery.d.ts +36 -0
- package/dist/esm/types/src/components/Gallery/Gallery.types.d.ts +12 -0
- package/dist/esm/types/src/components/Heading/Heading.d.ts +3 -0
- package/dist/esm/types/src/components/Heading/Heading.types.d.ts +5 -0
- package/dist/esm/types/src/components/Icon/Icon.d.ts +45 -0
- package/dist/esm/types/src/components/Icon/Icon.example.d.ts +3 -0
- package/dist/esm/types/src/components/Icon/Icon.helpers.d.ts +1 -0
- package/dist/esm/types/src/components/Icon/Icon.types.d.ts +8 -0
- package/dist/esm/types/src/components/Icon/icons/index.d.ts +39 -0
- package/dist/esm/types/src/components/Input/Input.d.ts +42 -0
- package/dist/esm/types/src/components/Input/Input.types.d.ts +21 -0
- package/dist/esm/types/src/components/InputFile/InputFile.d.ts +48 -0
- package/dist/esm/types/src/components/InputFile/InputFile.types.d.ts +22 -0
- package/dist/esm/types/src/components/InputFile/Item/Item.d.ts +16 -0
- package/dist/esm/types/src/components/Label/Label.d.ts +19 -0
- package/dist/esm/types/src/components/Label/Label.helpers.d.ts +1 -0
- package/dist/esm/types/src/components/Label/Label.types.d.ts +8 -0
- package/dist/esm/types/src/components/Lazy/Lazy.d.ts +18 -0
- package/dist/esm/types/src/components/Lazy/Lazy.types.d.ts +15 -0
- package/dist/esm/types/src/components/LightBox/LightBox.d.ts +3 -0
- package/dist/esm/types/src/components/LightBox/LightBox.types.d.ts +7 -0
- package/dist/esm/types/src/components/Notifications/Notifications.d.ts +2 -0
- package/dist/esm/types/src/components/Notifications/Notifications.types.d.ts +19 -0
- package/dist/esm/types/src/components/Notifications/store.d.ts +2 -0
- package/dist/esm/types/src/components/Paranja/Paranja.d.ts +3 -0
- package/dist/esm/types/src/components/Paranja/Paranja.types.d.ts +8 -0
- package/dist/esm/types/src/components/Popup/Popup.d.ts +73 -0
- package/dist/esm/types/src/components/Popup/Popup.helpers.d.ts +8 -0
- package/dist/esm/types/src/components/Popup/Popup.types.d.ts +34 -0
- package/dist/esm/types/src/components/PopupMenu/PopupMenu.d.ts +3 -0
- package/dist/esm/types/src/components/PopupMenu/PopupMenu.types.d.ts +13 -0
- package/dist/esm/types/src/components/Portal/Portal.d.ts +7 -0
- package/dist/esm/types/src/components/RequiredStar/RequiredStar.d.ts +3 -0
- package/dist/esm/types/src/components/RequiredStar/RequiredStar.types.d.ts +6 -0
- package/dist/esm/types/src/components/Router/Link/Link.d.ts +1 -0
- package/dist/esm/types/src/components/Router/Link/Link.types.d.ts +12 -0
- package/dist/esm/types/src/components/Router/Redirect.d.ts +5 -0
- package/dist/esm/types/src/components/Router/Route.d.ts +5 -0
- package/dist/esm/types/src/components/Router/Router.d.ts +7 -0
- package/dist/esm/types/src/components/Router/Router.helpers.d.ts +2 -0
- package/dist/esm/types/src/components/Router/Router.types.d.ts +18 -0
- package/dist/esm/types/src/components/Router/context.d.ts +6 -0
- package/dist/esm/types/src/components/Router/store.d.ts +2 -0
- package/dist/esm/types/src/components/Scroll/Scroll.d.ts +67 -0
- package/dist/esm/types/src/components/Scroll/Scroll.types.d.ts +27 -0
- package/dist/esm/types/src/components/Select/Select.d.ts +94 -0
- package/dist/esm/types/src/components/Select/Select.helpers.d.ts +14 -0
- package/dist/esm/types/src/components/Select/Select.types.d.ts +74 -0
- package/dist/esm/types/src/components/Spinner/Spinner.d.ts +3 -0
- package/dist/esm/types/src/components/Spinner/Spinner.types.d.ts +4 -0
- package/dist/esm/types/src/components/Table/Table.d.ts +8 -0
- package/dist/esm/types/src/components/Table/Table.types.d.ts +19 -0
- package/dist/esm/types/src/components/Tabs/Tabs.d.ts +3 -0
- package/dist/esm/types/src/components/Tabs/Tabs.types.d.ts +27 -0
- package/dist/esm/types/src/components/Text/Text.d.ts +7 -0
- package/dist/esm/types/src/components/Theme/Theme.d.ts +5 -0
- package/dist/esm/types/src/components/Theme/Theme.defaults.d.ts +32 -0
- package/dist/esm/types/src/components/Theme/Theme.helpers.d.ts +15 -0
- package/dist/esm/types/src/components/Theme/Theme.types.d.ts +6 -0
- package/dist/esm/types/src/components/VH/VH.d.ts +12 -0
- package/dist/esm/types/src/components/Virtualized/Cards/Cards.d.ts +26 -0
- package/dist/esm/types/src/components/Virtualized/List/List.d.ts +44 -0
- package/dist/esm/types/src/components/Virtualized/List/ListScroll.d.ts +8 -0
- package/dist/esm/types/src/components/Virtualized/Table/Table.d.ts +26 -0
- package/dist/esm/types/src/components/Virtualized/Virtualized.d.ts +34 -0
- package/dist/esm/types/src/components/Virtualized/Virtualized.helpers.d.ts +18 -0
- package/dist/esm/types/src/components/Virtualized/Virtualized.types.d.ts +53 -0
- package/dist/esm/types/src/components/Virtualized/index.d.ts +4 -0
- package/dist/esm/types/src/components/index.d.ts +33 -0
- package/dist/esm/types/src/index.d.ts +3 -0
- package/dist/esm/types/src/services/i18n.d.ts +16 -0
- package/dist/esm/types/src/services/index.d.ts +1 -0
- package/dist/esm/types/src/tools/array.d.ts +8 -0
- package/dist/esm/types/src/tools/config.d.ts +10 -0
- package/dist/esm/types/src/tools/debounce.d.ts +1 -0
- package/dist/esm/types/src/tools/dom.d.ts +12 -0
- package/dist/esm/types/src/tools/env.d.ts +1 -0
- package/dist/esm/types/src/tools/file.d.ts +1 -0
- package/dist/esm/types/src/tools/index.d.ts +16 -0
- package/dist/esm/types/src/tools/localStorage.d.ts +12 -0
- package/dist/esm/types/src/tools/number.d.ts +5 -0
- package/dist/esm/types/src/tools/object.d.ts +1 -0
- package/dist/esm/types/src/tools/queryParams.d.ts +3 -0
- package/dist/esm/types/src/tools/rangeMap.d.ts +2 -0
- package/dist/esm/types/src/tools/resizeObserver.d.ts +2 -0
- package/dist/esm/types/src/tools/scroll.d.ts +5 -0
- package/dist/esm/types/src/tools/string.d.ts +1 -0
- package/dist/esm/types/src/tools/throttle.d.ts +6 -0
- package/dist/esm/types/src/tools/uid.d.ts +1 -0
- package/dist/esm/types/src/types.d.ts +15 -0
- package/package.json +117 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
var _path;
|
|
4
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
5
|
+
var SvgSend = function SvgSend(props) {
|
|
6
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
7
|
+
viewBox: "0 0 48 48",
|
|
8
|
+
fill: "currentColor",
|
|
9
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
10
|
+
}, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
|
|
11
|
+
"data-name": "Path 8370",
|
|
12
|
+
d: "M44.697 20.016 6.703 4.25A4.547 4.547 0 0 0 .555 9.575l3.382 13.261h16.557a1.38 1.38 0 0 1 0 2.76H3.937L.555 38.855a4.547 4.547 0 0 0 6.148 5.325l37.994-15.765a4.547 4.547 0 0 0 0-8.4z"
|
|
13
|
+
})));
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export { SvgSend as default };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
var _path, _path2, _path3, _path4, _path5, _path6;
|
|
4
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
5
|
+
var SvgSettings = function SvgSettings(props) {
|
|
6
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
7
|
+
viewBox: "0 0 20 20",
|
|
8
|
+
fill: "none",
|
|
9
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
10
|
+
}, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
|
|
11
|
+
d: "M18.38 3.255h-1.92m-14.83 0h11.08",
|
|
12
|
+
stroke: "currentColor",
|
|
13
|
+
strokeWidth: 1.25,
|
|
14
|
+
strokeLinecap: "round",
|
|
15
|
+
strokeLinejoin: "round"
|
|
16
|
+
})), _path2 || (_path2 = /*#__PURE__*/React.createElement("path", {
|
|
17
|
+
clipRule: "evenodd",
|
|
18
|
+
d: "M13.96 16.755a1.875 1.875 0 1 1-3.75 0 1.875 1.875 0 0 1 3.75 0z",
|
|
19
|
+
stroke: "currentColor",
|
|
20
|
+
strokeWidth: 1.25,
|
|
21
|
+
strokeLinecap: "round",
|
|
22
|
+
strokeLinejoin: "round"
|
|
23
|
+
})), _path3 || (_path3 = /*#__PURE__*/React.createElement("path", {
|
|
24
|
+
d: "M1.63 10.002h3.58m13.17 0H8.96",
|
|
25
|
+
stroke: "currentColor",
|
|
26
|
+
strokeWidth: 1.25,
|
|
27
|
+
strokeLinecap: "round",
|
|
28
|
+
strokeLinejoin: "round"
|
|
29
|
+
})), _path4 || (_path4 = /*#__PURE__*/React.createElement("path", {
|
|
30
|
+
clipRule: "evenodd",
|
|
31
|
+
d: "M8.96 10a1.875 1.875 0 1 1-3.75 0 1.875 1.875 0 0 1 3.75 0z",
|
|
32
|
+
stroke: "currentColor",
|
|
33
|
+
strokeWidth: 1.25,
|
|
34
|
+
strokeLinecap: "round",
|
|
35
|
+
strokeLinejoin: "round"
|
|
36
|
+
})), _path5 || (_path5 = /*#__PURE__*/React.createElement("path", {
|
|
37
|
+
d: "M1.63 16.75h8.58m8.17 0h-4.42",
|
|
38
|
+
stroke: "currentColor",
|
|
39
|
+
strokeWidth: 1.25,
|
|
40
|
+
strokeLinecap: "round",
|
|
41
|
+
strokeLinejoin: "round"
|
|
42
|
+
})), _path6 || (_path6 = /*#__PURE__*/React.createElement("path", {
|
|
43
|
+
clipRule: "evenodd",
|
|
44
|
+
d: "M16.46 3.255a1.875 1.875 0 1 0-3.75 0 1.875 1.875 0 0 0 3.75 0z",
|
|
45
|
+
stroke: "currentColor",
|
|
46
|
+
strokeWidth: 1.25,
|
|
47
|
+
strokeLinecap: "round",
|
|
48
|
+
strokeLinejoin: "round"
|
|
49
|
+
})));
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export { SvgSettings as default };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
var _path, _path2;
|
|
4
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
5
|
+
var SvgShoppingBag = function SvgShoppingBag(props) {
|
|
6
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
7
|
+
viewBox: "0 0 512 512",
|
|
8
|
+
fill: "currentColor",
|
|
9
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
10
|
+
}, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
|
|
11
|
+
d: "M109.378 8.35c-45.305 8.237-80.035 43.301-87.16 87.938-.556 3.673-3.561 73.801-6.678 155.84-6.122 162.074-6.122 159.736-.445 177.88 5.454 17.143 13.691 30.723 26.493 43.636 13.357 13.469 30.5 23.376 49.646 28.608l9.462 2.56h156.396c149.495 0 156.73-.112 164.078-2.115 19.48-5.232 35.843-14.916 49.757-29.276 18.144-18.7 28.274-39.85 30.5-63.338.89-9.128-10.13-304.11-11.688-314.018-6.122-38.292-33.617-70.796-70.684-83.485-17.588-6.011-15.362-5.9-164.078-5.789-107.752.112-139.365.446-145.599 1.559zm298.545 37.179c10.241 3.45 14.248 5.454 22.486 11.799 13.914 10.352 23.487 27.495 25.936 46.307 1.224 9.35 11.131 269.715 11.131 290.976 0 13.135-2.003 22.262-7.124 33.171-7.346 15.807-19.034 28.051-33.728 35.287-13.914 6.901-8.015 6.679-169.31 6.679-158.733 0-154.392.111-167.973-5.677-21.928-9.35-38.737-30.834-42.522-54.433-1.67-10.352 9.128-301.996 11.577-312.57 5.01-21.484 21.15-40.52 41.632-49.09 13.469-5.677 9.795-5.566 159.847-5.343l140.256.222z"
|
|
12
|
+
})), _path2 || (_path2 = /*#__PURE__*/React.createElement("path", {
|
|
13
|
+
d: "M140.435 80.147c-8.905 4.008-10.909 13.915-7.458 35.621 8.682 53.431 49.535 94.283 102.966 102.966 25.045 4.007 54.098-.334 75.916-11.243 35.843-17.922 61.112-52.874 67.122-92.502 3.34-21.818 1.336-30.834-7.458-34.842-6.01-2.782-11.354-2.782-17.365 0-6.233 2.783-8.682 8.238-9.573 21.707-2.56 38.18-27.717 69.237-64.896 79.812-11.465 3.34-34.841 3.562-45.973.445-38.07-10.463-63.783-41.631-66.343-80.257-.89-13.47-3.34-18.924-9.573-21.707-6.011-2.782-11.354-2.782-17.365 0z"
|
|
14
|
+
})));
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export { SvgShoppingBag as default };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
var _path;
|
|
4
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
5
|
+
var SvgSocialEmail = function SvgSocialEmail(props) {
|
|
6
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
7
|
+
fill: "currentColor",
|
|
8
|
+
viewBox: "0 0 24 24",
|
|
9
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
10
|
+
}, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
|
|
11
|
+
d: "M1.94 21.48c-.474 0-.89-.178-1.248-.535-.355-.357-.535-.773-.535-1.249V4.24c0-.475.179-.891.535-1.249.357-.355.774-.534 1.249-.534h20.213c.475 0 .891.178 1.249.535.355.357.535.773.535 1.249v15.457c0 .475-.18.891-.535 1.249-.358.355-.774.534-1.25.534zm10.107-8.383L2.535 7.063V19.1H21.56V7.064zm0-2.378 9.393-5.886H2.684zM2.535 7.063V4.834v14.267z"
|
|
12
|
+
})));
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export { SvgSocialEmail as default };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
var _path;
|
|
4
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
5
|
+
var SvgSocialInstagram = function SvgSocialInstagram(props) {
|
|
6
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
7
|
+
fill: "currentColor",
|
|
8
|
+
viewBox: "0 0 24 24",
|
|
9
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
10
|
+
}, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
|
|
11
|
+
d: "M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zM12 0C8.741 0 8.333.014 7.053.072 2.695.272.273 2.69.073 7.052.014 8.333 0 8.741 0 12c0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98C8.333 23.986 8.741 24 12 24c3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98C15.668.014 15.259 0 12 0zm0 5.838a6.162 6.162 0 1 0 0 12.324 6.162 6.162 0 0 0 0-12.324zM12 16a4 4 0 1 1 0-8 4 4 0 0 1 0 8zm6.406-11.845a1.44 1.44 0 1 0 0 2.881 1.44 1.44 0 0 0 0-2.881z"
|
|
12
|
+
})));
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export { SvgSocialInstagram as default };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
var _path;
|
|
4
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
5
|
+
var SvgSocialTelegram = function SvgSocialTelegram(props) {
|
|
6
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
7
|
+
fill: "currentColor",
|
|
8
|
+
fillRule: "evenodd",
|
|
9
|
+
clipRule: "evenodd",
|
|
10
|
+
strokeLinejoin: "round",
|
|
11
|
+
strokeMiterlimit: 1.414,
|
|
12
|
+
viewBox: "0 0 24 24",
|
|
13
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
14
|
+
}, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
|
|
15
|
+
d: "M18.384 21.78a1.19 1.19 0 0 0 1.107.144 1.16 1.16 0 0 0 .724-.84c.87-4.084 2.977-14.42 3.768-18.136a.78.78 0 0 0-.26-.758.8.8 0 0 0-.797-.14C18.733 3.602 5.82 8.447.542 10.4a.827.827 0 0 0-.542.8c.012.353.25.66.593.763 2.367.708 5.474 1.693 5.474 1.693s1.452 4.385 2.21 6.615c.094.28.313.5.602.576a.866.866 0 0 0 .811-.207l3.096-2.923s3.572 2.62 5.598 4.062zm-11.01-8.678 1.68 5.538.372-3.507 10.185-9.186a.277.277 0 0 0 .033-.377.284.284 0 0 0-.376-.064z"
|
|
16
|
+
})));
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export { SvgSocialTelegram as default };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
var _path;
|
|
4
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
5
|
+
var SvgUndo = function SvgUndo(props) {
|
|
6
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
7
|
+
viewBox: "0 96 48 48",
|
|
8
|
+
fill: "currentColor",
|
|
9
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
10
|
+
}, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
|
|
11
|
+
d: "M10.79 139.824v-4.025h19.385q4.695 0 8.083-3.119 3.387-3.119 3.387-7.747t-3.387-7.747q-3.388-3.12-8.083-3.12H10.388l7.647 7.647-2.818 2.818-12.476-12.476 12.476-12.476 2.818 2.817-7.647 7.646h19.72q6.372 0 10.967 4.293 4.594 4.293 4.594 10.598 0 6.305-4.594 10.598-4.595 4.293-10.967 4.293z"
|
|
12
|
+
})));
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export { SvgUndo as default };
|
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
import { Component, createRef, createElement } from 'react';
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
import cn from 'classnames';
|
|
4
|
+
import { createStore } from 'justorm/react';
|
|
5
|
+
import omit from 'lodash.omit';
|
|
6
|
+
import { Label } from '../Label/Label.js';
|
|
7
|
+
import { RequiredStar } from '../RequiredStar/RequiredStar.js';
|
|
8
|
+
import { AssistiveText } from '../AssistiveText/AssistiveText.js';
|
|
9
|
+
import { Button } from '../Button/Button.js';
|
|
10
|
+
import { Icon } from '../Icon/Icon.js';
|
|
11
|
+
import { Scroll } from '../Scroll/Scroll.js';
|
|
12
|
+
import { capitalize } from '../../tools/string.js';
|
|
13
|
+
import { generateUID } from '../../tools/uid.js';
|
|
14
|
+
import S from './Input.styl.js';
|
|
15
|
+
import '../ButtonGroup/ButtonGroup.styl.js';
|
|
16
|
+
import '../Checkbox/Checkbox.styl.js';
|
|
17
|
+
import '../Container/Container.styl.js';
|
|
18
|
+
import 'moment';
|
|
19
|
+
import 'timen';
|
|
20
|
+
import '../../tools/dom.js';
|
|
21
|
+
import debounce from '../../tools/debounce.js';
|
|
22
|
+
import 'compareq';
|
|
23
|
+
import 'lodash.pick';
|
|
24
|
+
import '../../tools/queryParams.js';
|
|
25
|
+
import '../Draggable/Draggable.styl.js';
|
|
26
|
+
import '../Expand/Expand.styl.js';
|
|
27
|
+
import '../Form/Form.styl.js';
|
|
28
|
+
import '../Form/Validator.js';
|
|
29
|
+
import '../Form/SubmitButtons/SubmitButtons.styl.js';
|
|
30
|
+
import '../Spinner/Spinner.styl.js';
|
|
31
|
+
import '../Gallery/Gallery.styl.js';
|
|
32
|
+
import '../Heading/Heading.js';
|
|
33
|
+
import '../InputFile/InputFile.styl.js';
|
|
34
|
+
import '../InputFile/Item/Item.styl.js';
|
|
35
|
+
import '../Portal/Portal.js';
|
|
36
|
+
import '../Paranja/Paranja.styl.js';
|
|
37
|
+
import '../LightBox/LightBox.styl.js';
|
|
38
|
+
import '../Notifications/Notifications.js';
|
|
39
|
+
import '../Popup/Popup.styl.js';
|
|
40
|
+
import '../PopupMenu/PopupMenu.styl.js';
|
|
41
|
+
import '../Router/Router.js';
|
|
42
|
+
import '../Select/Select.styl.js';
|
|
43
|
+
import '../Table/Table.styl.js';
|
|
44
|
+
import '../Tabs/Tabs.styl.js';
|
|
45
|
+
import '../Text/Text.js';
|
|
46
|
+
import '../Virtualized/Virtualized.styl.js';
|
|
47
|
+
import '../Virtualized/List/List.styl.js';
|
|
48
|
+
import '../Virtualized/List/ListScroll.styl.js';
|
|
49
|
+
import '../../services/i18n.js';
|
|
50
|
+
|
|
51
|
+
const TEXTAREA_SCROLL_TOP_OFFSET = {
|
|
52
|
+
s: 30,
|
|
53
|
+
m: 40,
|
|
54
|
+
l: 50,
|
|
55
|
+
};
|
|
56
|
+
class Input extends Component {
|
|
57
|
+
inputRef = createRef();
|
|
58
|
+
isClearPressed = false;
|
|
59
|
+
cursorPos = 0;
|
|
60
|
+
prevLabelText = '';
|
|
61
|
+
store;
|
|
62
|
+
uid = generateUID();
|
|
63
|
+
static defaultProps = {
|
|
64
|
+
type: 'text',
|
|
65
|
+
size: 'm',
|
|
66
|
+
variant: 'default',
|
|
67
|
+
};
|
|
68
|
+
constructor(props) {
|
|
69
|
+
super(props);
|
|
70
|
+
const inputValue = props.value ?? props.defaultValue ?? '';
|
|
71
|
+
const hasValue = this.hasValue(inputValue);
|
|
72
|
+
this.store = createStore(this, {
|
|
73
|
+
isFocused: false,
|
|
74
|
+
isLabelOnTop: this.isLabelOnTop(hasValue),
|
|
75
|
+
inputValue,
|
|
76
|
+
hasValue,
|
|
77
|
+
labelClipPath: '',
|
|
78
|
+
autoComplete: null,
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
componentDidMount() {
|
|
82
|
+
document.addEventListener('keyup', this.onDocKeyUp, true);
|
|
83
|
+
if (this.isTextArea()) {
|
|
84
|
+
this.inputRef.current.innerText = this.store.inputValue;
|
|
85
|
+
document.addEventListener('paste', this.onTextareaPaste, true);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
componentDidUpdate(prevProps) {
|
|
89
|
+
const { value } = this.props;
|
|
90
|
+
this.updateSelection();
|
|
91
|
+
this.updateAutoComplete();
|
|
92
|
+
if (value !== prevProps.value && value !== this.store.inputValue) {
|
|
93
|
+
this.store.inputValue = value;
|
|
94
|
+
// @ts-ignore
|
|
95
|
+
if (this.isTextArea())
|
|
96
|
+
this.inputRef.current.innerText = value;
|
|
97
|
+
this.updateHasValue();
|
|
98
|
+
this.updateLabelPosition();
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
updateAutoComplete() {
|
|
102
|
+
const form = this.inputRef.current?.closest('form');
|
|
103
|
+
const val = form?.getAttribute('autocomplete');
|
|
104
|
+
if (this.store.autoComplete !== val)
|
|
105
|
+
this.store.autoComplete = val;
|
|
106
|
+
}
|
|
107
|
+
updateSelection() {
|
|
108
|
+
const { type } = this.props;
|
|
109
|
+
const { isFocused } = this.store;
|
|
110
|
+
const elem = this.inputRef.current;
|
|
111
|
+
if (!isFocused || !elem || type !== 'text')
|
|
112
|
+
return;
|
|
113
|
+
elem.selectionStart = this.cursorPos;
|
|
114
|
+
elem.selectionEnd = this.cursorPos;
|
|
115
|
+
}
|
|
116
|
+
updateLabelPosition() {
|
|
117
|
+
this.store.isLabelOnTop = this.isLabelOnTop();
|
|
118
|
+
}
|
|
119
|
+
updateHasValue() {
|
|
120
|
+
this.store.hasValue = this.hasValue();
|
|
121
|
+
}
|
|
122
|
+
hasValue(value = this.store.inputValue) {
|
|
123
|
+
const { type, defaultValue } = this.props;
|
|
124
|
+
return type === 'number' || Boolean(value || defaultValue);
|
|
125
|
+
}
|
|
126
|
+
isTextArea = () => this.props.type === 'textarea';
|
|
127
|
+
isLabelOnTop(hasValue = this.store?.hasValue) {
|
|
128
|
+
const { forceLabelOnTop, addonLeft } = this.props;
|
|
129
|
+
return (forceLabelOnTop || Boolean(addonLeft) || hasValue || this.store?.isFocused);
|
|
130
|
+
}
|
|
131
|
+
getValue(val = this.store.inputValue) {
|
|
132
|
+
const { type } = this.props;
|
|
133
|
+
if (type === 'number') {
|
|
134
|
+
if (val)
|
|
135
|
+
return parseFloat(val);
|
|
136
|
+
return 0;
|
|
137
|
+
}
|
|
138
|
+
if (this.isTextArea())
|
|
139
|
+
return this.inputRef.current.innerText.replace('/n', '');
|
|
140
|
+
return val;
|
|
141
|
+
}
|
|
142
|
+
onTextareaPaste = e => {
|
|
143
|
+
if (!this.store.isFocused)
|
|
144
|
+
return;
|
|
145
|
+
e.preventDefault();
|
|
146
|
+
e.stopPropagation();
|
|
147
|
+
this.pasteToTextarea(e.clipboardData.getData('text/plain'));
|
|
148
|
+
};
|
|
149
|
+
pasteToTextarea = debounce((text) => {
|
|
150
|
+
console.log('onTextareaPaste');
|
|
151
|
+
const sel = window.getSelection();
|
|
152
|
+
const textarea = this.inputRef.current;
|
|
153
|
+
const prevText = textarea.innerText;
|
|
154
|
+
// @ts-ignore
|
|
155
|
+
const startPos = sel.extentOffset;
|
|
156
|
+
const nextText = prevText.substring(0, startPos) + text + prevText.substring(startPos);
|
|
157
|
+
textarea.innerText = nextText;
|
|
158
|
+
sel.setPosition(textarea.firstChild, startPos + text.length);
|
|
159
|
+
}, 100);
|
|
160
|
+
onClearPress = e => {
|
|
161
|
+
const { onChange, onClear } = this.props;
|
|
162
|
+
this.isTextArea();
|
|
163
|
+
e.preventDefault();
|
|
164
|
+
e.stopPropagation();
|
|
165
|
+
onClear?.();
|
|
166
|
+
if (this.isTextArea()) {
|
|
167
|
+
this.inputRef.current.innerText = '';
|
|
168
|
+
}
|
|
169
|
+
if (onChange) {
|
|
170
|
+
this.onChange('');
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
if (!this.isTextArea) {
|
|
174
|
+
this.inputRef.current.value = '';
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
this.inputRef.current?.focus();
|
|
178
|
+
};
|
|
179
|
+
onDocKeyUp = (e) => {
|
|
180
|
+
const { changeOnEnd } = this.props;
|
|
181
|
+
const { isFocused } = this.store;
|
|
182
|
+
if (changeOnEnd && e.key === 'Enter') {
|
|
183
|
+
e.preventDefault();
|
|
184
|
+
e.stopPropagation();
|
|
185
|
+
this.onTypingEnd();
|
|
186
|
+
}
|
|
187
|
+
if (isFocused && e.key === 'Escape') {
|
|
188
|
+
e.preventDefault();
|
|
189
|
+
e.stopPropagation();
|
|
190
|
+
this.inputRef.current?.blur();
|
|
191
|
+
}
|
|
192
|
+
};
|
|
193
|
+
handleChange = (e) => {
|
|
194
|
+
const value = this.getValue(e.target.value);
|
|
195
|
+
this.onChange(value);
|
|
196
|
+
};
|
|
197
|
+
onChange = (value, e) => {
|
|
198
|
+
const { onChange, changeOnEnd, type } = this.props;
|
|
199
|
+
const isNumber = type === 'number';
|
|
200
|
+
if (!isNumber)
|
|
201
|
+
this.cursorPos = this.inputRef.current.selectionStart;
|
|
202
|
+
if (changeOnEnd) {
|
|
203
|
+
this.store.inputValue = value;
|
|
204
|
+
this.updateHasValue();
|
|
205
|
+
}
|
|
206
|
+
else if (onChange) {
|
|
207
|
+
onChange(e, value);
|
|
208
|
+
}
|
|
209
|
+
else {
|
|
210
|
+
this.store.inputValue = value;
|
|
211
|
+
}
|
|
212
|
+
};
|
|
213
|
+
onTextAreaInput = e => {
|
|
214
|
+
const { onInput } = this.props;
|
|
215
|
+
this.store.inputValue = e.target.innerText;
|
|
216
|
+
this.updateHasValue();
|
|
217
|
+
this.handleChange(e);
|
|
218
|
+
onInput?.(e);
|
|
219
|
+
};
|
|
220
|
+
onLabelClipPathChange = (clipPath) => (this.store.labelClipPath = clipPath);
|
|
221
|
+
onTypingEnd = () => {
|
|
222
|
+
const { onChange } = this.props;
|
|
223
|
+
onChange?.(null, this.getValue());
|
|
224
|
+
};
|
|
225
|
+
onFocus = e => {
|
|
226
|
+
const { onFocus } = this.props;
|
|
227
|
+
this.store.isFocused = true;
|
|
228
|
+
this.updateLabelPosition();
|
|
229
|
+
onFocus?.(e);
|
|
230
|
+
};
|
|
231
|
+
onBlur = e => {
|
|
232
|
+
if (this.props.changeOnEnd)
|
|
233
|
+
this.onTypingEnd();
|
|
234
|
+
if (this.isClearPressed) {
|
|
235
|
+
e.preventDefault();
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
238
|
+
// @ts-ignore
|
|
239
|
+
const val = this.getValue(e?.target?.value);
|
|
240
|
+
const { onBlur, onChange, value, checkAutofill } = this.props;
|
|
241
|
+
this.store.isFocused = false;
|
|
242
|
+
this.updateLabelPosition();
|
|
243
|
+
// some browsers not fire `onchange` after autofill
|
|
244
|
+
if (checkAutofill && onChange && !value && val)
|
|
245
|
+
onChange(null, val);
|
|
246
|
+
if (onBlur)
|
|
247
|
+
onBlur(e);
|
|
248
|
+
};
|
|
249
|
+
getControlProps() {
|
|
250
|
+
const { value, label, controlProps, placeholder, ...rest } = this.props;
|
|
251
|
+
const { autoComplete, isLabelOnTop, inputValue } = this.store;
|
|
252
|
+
const props = {
|
|
253
|
+
...omit(rest, [
|
|
254
|
+
'className',
|
|
255
|
+
'clear',
|
|
256
|
+
'onClear',
|
|
257
|
+
'hasClear',
|
|
258
|
+
'size',
|
|
259
|
+
'error',
|
|
260
|
+
'checkAutofill',
|
|
261
|
+
'addonLeft',
|
|
262
|
+
'addonRight',
|
|
263
|
+
'forceLabelOnTop',
|
|
264
|
+
'changeOnEnd',
|
|
265
|
+
]),
|
|
266
|
+
value: inputValue,
|
|
267
|
+
...controlProps,
|
|
268
|
+
onChange: this.handleChange,
|
|
269
|
+
onFocus: this.onFocus,
|
|
270
|
+
onBlur: this.onBlur,
|
|
271
|
+
};
|
|
272
|
+
if (this.isTextArea()) {
|
|
273
|
+
props.contentEditable = true;
|
|
274
|
+
props.onInput = this.onTextAreaInput;
|
|
275
|
+
}
|
|
276
|
+
if (placeholder && !value && (!label || isLabelOnTop)) {
|
|
277
|
+
props.placeholder = placeholder;
|
|
278
|
+
}
|
|
279
|
+
if (!autoComplete) {
|
|
280
|
+
props.suppressHydrationWarning = true;
|
|
281
|
+
props.autoComplete = this.uid;
|
|
282
|
+
delete props.name;
|
|
283
|
+
}
|
|
284
|
+
if (props.value === undefined)
|
|
285
|
+
props.value = '';
|
|
286
|
+
return props;
|
|
287
|
+
}
|
|
288
|
+
wrapControll(control) {
|
|
289
|
+
if (this.isTextArea()) {
|
|
290
|
+
const { size } = this.props;
|
|
291
|
+
const { labelClipPath } = this.store;
|
|
292
|
+
return (jsx(Scroll, { y: true, size: size, fadeSize: "s", className: S.scroller, innerProps: {
|
|
293
|
+
suppressHydrationWarning: true,
|
|
294
|
+
style: { clipPath: labelClipPath },
|
|
295
|
+
}, offset: {
|
|
296
|
+
y: { before: TEXTAREA_SCROLL_TOP_OFFSET[size], after: 20 },
|
|
297
|
+
}, children: control }, "scroller"));
|
|
298
|
+
}
|
|
299
|
+
return control;
|
|
300
|
+
}
|
|
301
|
+
renderAddon(type) {
|
|
302
|
+
const name = `addon${capitalize(type)}`;
|
|
303
|
+
const content = this.props[name];
|
|
304
|
+
if (!content)
|
|
305
|
+
return null;
|
|
306
|
+
const props = {
|
|
307
|
+
// @ts-ignore
|
|
308
|
+
className: cn(S[name], this.props[`${name}ClassName`]),
|
|
309
|
+
key: name,
|
|
310
|
+
};
|
|
311
|
+
const isString = typeof content === 'string';
|
|
312
|
+
const elem = isString ? jsx("span", { children: content }) : content;
|
|
313
|
+
// @ts-ignore
|
|
314
|
+
if (isString)
|
|
315
|
+
props.title = content;
|
|
316
|
+
return jsx("div", { ...props, children: elem });
|
|
317
|
+
}
|
|
318
|
+
render() {
|
|
319
|
+
const { className, size, label, value, variant, error, hasClear, required, disabled, } = this.props;
|
|
320
|
+
const { isFocused, hasValue, labelClipPath, isLabelOnTop } = this.store;
|
|
321
|
+
const isTextArea = this.isTextArea();
|
|
322
|
+
const Control = isTextArea ? 'span' : 'input';
|
|
323
|
+
const controlProps = this.getControlProps();
|
|
324
|
+
const classes = cn(S.root, isTextArea && S.isTextArea, S[`size-${size}`], S[`variant-${variant}`], isFocused && S.isFocused, error && S.hasError, hasClear && S.hasClear, disabled && S.isDisabled, className);
|
|
325
|
+
return (
|
|
326
|
+
// @ts-ignore
|
|
327
|
+
jsxs("div", { className: classes, title: value, children: [jsxs("label", { className: S.main, children: [jsx("div", { className: S.border, suppressHydrationWarning: true, style: { clipPath: labelClipPath } }, "border"), this.renderAddon('left'), this.wrapControll(createElement(Control, { ...controlProps, className: cn(S.control, controlProps?.className), ref: this.inputRef, key: "control" })), isTextArea && controlProps.placeholder && (jsx("span", { className: S.placeholder, spellCheck: false, children: controlProps.placeholder })), jsx(Label, { className: S.label, size: size, isOnTop: isLabelOnTop, isError: Boolean(error), onClipPathChange: this.onLabelClipPathChange, children: label }, "label"), this.renderAddon('right'), required && jsx(RequiredStar, { size: size }, "required-star")] }, "main"), hasClear && !disabled && hasValue && (jsx(Button, { className: S.clearButton, variant: "clear", size: size, square: true, onClick: this.onClearPress, title: "", children: jsx(Icon, { className: S.clearIcon, size: size, type: "close" }) }, "clear")), !disabled && typeof error === 'string' && (jsx(AssistiveText, { variant: "danger", size: size, children: error }, "assistive-text"))] }));
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
export { Input };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import styleInject from '../../../node_modules/style-inject/dist/style-inject.es.js';
|
|
2
|
+
|
|
3
|
+
var css_248z = ".Input_root__kj4vQ{color:var(--accent-color);position:relative}.Input_root__kj4vQ.Input_isTextArea__1a6n1{max-height:10em}.Input_control__wZcMD,.Input_main__M6Qxb,.Input_root__kj4vQ{width:-moz-fit-content;width:fit-content}.Input_controlWrapper__WgrZL,.Input_root__kj4vQ{max-width:100%}.Input_main__M6Qxb{border-radius:inherit;display:flex;max-width:100%;position:relative}.Input_isTextArea__1a6n1 .Input_main__M6Qxb{height:auto!important;max-height:inherit!important}.Input_size-s__-U0r-.Input_isTextArea__1a6n1 .Input_main__M6Qxb{padding-right:2px!important}.Input_size-m__jTEMl.Input_isTextArea__1a6n1 .Input_main__M6Qxb{padding-right:8px!important}.Input_size-l__BR-zg.Input_isTextArea__1a6n1 .Input_main__M6Qxb{padding-right:13px!important}.Input_border__01i-B{background-color:var(--accent-color-alpha-100);border-radius:inherit;bottom:0;left:0;pointer-events:none;position:absolute;right:0;top:0;transition:.15s ease-out;transition-property:box-shadow,border-color,background-color;z-index:0}.Input_root__kj4vQ:hover .Input_border__01i-B{background-color:var(--active-color-alpha-100)}.Input_variant-default__frNbg .Input_border__01i-B{background-color:var(--accent-color-alpha-100)}.Input_isFocused__9jtFN.Input_variant-default__frNbg .Input_border__01i-B{background-color:var(--active-color-alpha-300)}.Input_variant-outlined__qKjnJ .Input_border__01i-B{background-color:transparent;box-shadow:inset 0 0 0 2px var(--accent-color)}.Input_isFocused__9jtFN.Input_variant-outlined__qKjnJ .Input_border__01i-B{background-color:var(--active-color-alpha-300);box-shadow:inset 0 0 0 2px var(--active-color)}.Input_hasError__5iS2M .Input_variant-outlined__qKjnJ .Input_border__01i-B,.Input_hasError__5iS2M:hover .Input_variant-outlined__qKjnJ .Input_border__01i-B{box-shadow:inset 0 0 0 2px var(--danger-color)}.Input_isDisabled__e7J10.Input_variant-outlined__qKjnJ .Input_border__01i-B{box-shadow:none}.Input_size-s__-U0r-{font-size:12px}.Input_size-s__-U0r- .Input_main__M6Qxb{border-radius:4px;font-size:12px;min-height:30px;min-width:30px;padding:0 10px}.Input_size-m__jTEMl{font-size:16px}.Input_size-m__jTEMl .Input_main__M6Qxb{border-radius:6px;font-size:16px;min-height:40px;min-width:40px;padding:0 12px}.Input_size-l__BR-zg{font-size:20px}.Input_size-l__BR-zg .Input_main__M6Qxb{border-radius:8px;font-size:20px;min-height:50px;min-width:50px;padding:0 14px}.Input_isTextArea__1a6n1 .Input_main__M6Qxb{padding-left:0}.Input_isDisabled__e7J10{color:var(--accent-color-alpha-500);opacity:.4}.Input_addonLeft__i1c70,.Input_addonRight__A9Iht,.Input_control__wZcMD{font-size:inherit;font-weight:400}.Input_labelGap__T6fAj{opacity:0;pointer-events:none;position:absolute}.Input_isTextArea__1a6n1 .Input_label__FT90l{max-height:40px}.Input_scroller__OBm8M{max-height:100%;width:100%}.Input_control__wZcMD{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;box-shadow:none;box-shadow:inset 0 0 0 2px none;color:inherit;display:inline-flex;filter:none;flex-grow:1;min-width:200px;position:relative;text-overflow:ellipsis;transition:border-color .15s ease-in-out 0s;width:100%}.Input_isTextArea__1a6n1 .Input_control__wZcMD{display:block;height:100%;width:100%}.Input_isTextArea__1a6n1 .Input_control__wZcMD:hover{cursor:text}.Input_isTextArea__1a6n1 .Input_control__wZcMD:after{content:\"\";display:block}.Input_size-s__-U0r-.Input_isTextArea__1a6n1 .Input_control__wZcMD,.Input_size-s__-U0r-.Input_isTextArea__1a6n1 .Input_placeholder__DRYLA{padding:8px 10px 0}.Input_size-s__-U0r-.Input_isTextArea__1a6n1 .Input_control__wZcMD:after,.Input_size-s__-U0r-.Input_isTextArea__1a6n1 .Input_placeholder__DRYLA:after{height:8px}.Input_size-m__jTEMl.Input_isTextArea__1a6n1 .Input_control__wZcMD,.Input_size-m__jTEMl.Input_isTextArea__1a6n1 .Input_placeholder__DRYLA{padding:10px 12px 0}.Input_size-m__jTEMl.Input_isTextArea__1a6n1 .Input_control__wZcMD:after,.Input_size-m__jTEMl.Input_isTextArea__1a6n1 .Input_placeholder__DRYLA:after{height:10px}.Input_size-l__BR-zg.Input_isTextArea__1a6n1 .Input_control__wZcMD,.Input_size-l__BR-zg.Input_isTextArea__1a6n1 .Input_placeholder__DRYLA{padding:12px 14px 0}.Input_size-l__BR-zg.Input_isTextArea__1a6n1 .Input_control__wZcMD:after,.Input_size-l__BR-zg.Input_isTextArea__1a6n1 .Input_placeholder__DRYLA:after{height:12px}.Input_control__wZcMD:-internal-autofill-selected,.Input_control__wZcMD:-webkit-autofill{animation-fill-mode:both;animation-name:Input_clearBg__jqI1h}.Input_size-s__-U0r-.Input_hasClear__5Y3nU .Input_control__wZcMD{padding-right:20px}.Input_size-m__jTEMl.Input_hasClear__5Y3nU .Input_control__wZcMD{padding-right:24px}.Input_size-l__BR-zg.Input_hasClear__5Y3nU .Input_control__wZcMD{padding-right:28px}.Input_control__wZcMD::-moz-placeholder{color:var(--accent-color-alpha-500)}.Input_control__wZcMD::placeholder{color:var(--accent-color-alpha-500)}.Input_control__wZcMD::-moz-selection{background-color:var(--active-color-alpha-300)}.Input_control__wZcMD::selection{background-color:var(--active-color-alpha-300)}.Input_placeholder__DRYLA{display:inline-block;left:0;max-width:100%;opacity:.4;overflow:hidden;padding:inherit;pointer-events:none;position:absolute;text-overflow:ellipsis;top:0;white-space:nowrap}.Input_addonLeft__i1c70,.Input_addonRight__A9Iht{align-items:center;display:inline-flex;min-width:0;-webkit-user-select:none;-moz-user-select:none;user-select:none;z-index:1}.Input_size-s__-U0r- .Input_addonLeft__i1c70,.Input_size-s__-U0r- .Input_addonRight__A9Iht{min-width:calc(var(--indent-s)*1.5)}.Input_size-m__jTEMl .Input_addonLeft__i1c70,.Input_size-m__jTEMl .Input_addonRight__A9Iht{min-width:var(--indent-m)}.Input_size-l__BR-zg .Input_addonLeft__i1c70,.Input_size-l__BR-zg .Input_addonRight__A9Iht{min-width:var(--indent-l)}.Input_addonLeft__i1c70>span,.Input_addonRight__A9Iht>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.Input_addonLeft__i1c70{margin-right:12px}.Input_addonRight__A9Iht{margin-left:12px}.Input_requiredStar__6MeQ4{background-color:var(--warning-color);border-radius:50%;height:8px;opacity:.8;pointer-events:none;position:absolute;width:8px}.Input_isDisabled__e7J10 .Input_requiredStar__6MeQ4{display:none}.Input_size-s__-U0r- .Input_requiredStar__6MeQ4{right:4px;top:4px}.Input_size-m__jTEMl .Input_requiredStar__6MeQ4{right:6px;top:6px}.Input_size-l__BR-zg .Input_requiredStar__6MeQ4{right:8px;top:8px}.Input_isDisabled__e7J10{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.Input_clearButton__0E-9L{border-bottom-left-radius:0;border-top-left-radius:0;bottom:1px;height:auto;position:absolute;right:0;top:0;z-index:1}.Input_clearButton__0E-9L:hover{background-color:var(--accent-color-alpha-0)!important}.Input_clearIcon__Gi1Nc{flex-shrink:0;opacity:.3;transition:opacity .2s ease-out}.Input_clearButton__0E-9L:hover .Input_clearIcon__Gi1Nc{opacity:.8}.Input_size-s__-U0r- .Input_clearIcon__Gi1Nc{height:10px;width:10px}.Input_size-m__jTEMl .Input_clearIcon__Gi1Nc{height:12px;width:12px}.Input_size-l__BR-zg .Input_clearIcon__Gi1Nc{height:14px;width:14px}.Input_size-xl__o-R-1 .Input_clearIcon__Gi1Nc{height:16px;width:16px}";
|
|
4
|
+
var S = {"root":"Input_root__kj4vQ","isTextArea":"Input_isTextArea__1a6n1","main":"Input_main__M6Qxb","control":"Input_control__wZcMD","controlWrapper":"Input_controlWrapper__WgrZL","size-s":"Input_size-s__-U0r-","size-m":"Input_size-m__jTEMl","size-l":"Input_size-l__BR-zg","border":"Input_border__01i-B","variant-default":"Input_variant-default__frNbg","isFocused":"Input_isFocused__9jtFN","variant-outlined":"Input_variant-outlined__qKjnJ","hasError":"Input_hasError__5iS2M","isDisabled":"Input_isDisabled__e7J10","addonLeft":"Input_addonLeft__i1c70","addonRight":"Input_addonRight__A9Iht","labelGap":"Input_labelGap__T6fAj","label":"Input_label__FT90l","scroller":"Input_scroller__OBm8M","placeholder":"Input_placeholder__DRYLA","clearBg":"Input_clearBg__jqI1h","hasClear":"Input_hasClear__5Y3nU","requiredStar":"Input_requiredStar__6MeQ4","clearButton":"Input_clearButton__0E-9L","clearIcon":"Input_clearIcon__Gi1Nc","size-xl":"Input_size-xl__o-R-1"};
|
|
5
|
+
styleInject(css_248z);
|
|
6
|
+
|
|
7
|
+
export { S as default };
|