@vchasno/ui-kit 0.4.25 → 0.4.28
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/CHANGELOG.md +18 -0
- package/dist/components/Button/Button.js +1 -1
- package/dist/components/Button/Button.js.map +1 -1
- package/dist/components/Checkbox/Checkbox.js +1 -1
- package/dist/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/components/Datepicker/DatePicker.js +1 -1
- package/dist/components/Datepicker/DatePicker.js.map +1 -1
- package/dist/components/FullScreenModal/FullScreenModal.d.ts +1 -1
- package/dist/components/FullScreenModal/FullScreenModal.js.map +1 -1
- package/dist/components/Input/Input.js +1 -1
- package/dist/components/Input/Input.js.map +1 -1
- package/dist/components/Select/AsyncSelect.js +1 -1
- package/dist/components/Select/AsyncSelect.js.map +1 -1
- package/dist/components/Select/Select.js +1 -1
- package/dist/components/Select/Select.js.map +1 -1
- package/dist/components/Select/SelectCreatable.js +1 -1
- package/dist/components/Select/SelectCreatable.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.4.28] - 2024-11-22
|
|
11
|
+
|
|
12
|
+
## Fixed
|
|
13
|
+
|
|
14
|
+
- Select/SelectCreatable/AsyncSelect - remove pulse animation if it's disabled
|
|
15
|
+
|
|
16
|
+
## [0.4.27] - 2024-11-22
|
|
17
|
+
|
|
18
|
+
## Fixed
|
|
19
|
+
|
|
20
|
+
- remove pulse animation for disabled components
|
|
21
|
+
|
|
22
|
+
## [0.4.26] - 2024-11-22
|
|
23
|
+
|
|
24
|
+
## Fixed
|
|
25
|
+
|
|
26
|
+
- wrap FullScreenModal into React.PropsWithChildren for 18+ versions of React
|
|
27
|
+
|
|
10
28
|
## [0.4.25] - 2024-11-22
|
|
11
29
|
|
|
12
30
|
## Added
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e from"react";import t from"classnames";import r from"../Spinner/Spinner.js";var n=/*#__PURE__*/e.forwardRef(function(n,o){var a=n.theme,i=n.type,l=n.size,u=n.outline,c=n.loading,s=void 0!==c&&c,
|
|
1
|
+
import e from"react";import t from"classnames";import r from"../Spinner/Spinner.js";var n=/*#__PURE__*/e.forwardRef(function(n,o){var a=n.theme,i=n.type,l=n.size,u=n.outline,c=n.loading,s=void 0!==c&&c,d=n.wide,p=n.suppressPadding,f=n.className,m=n.dataQa,b=n.children,y=n.pulse,v=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(n,["theme","type","size","outline","loading","wide","suppressPadding","className","dataQa","children","pulse"]);return /*#__PURE__*/e.createElement("button",function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({"data-qa":m,ref:o,type:void 0===i?"button":i,className:t("vchasno-ui-button","--".concat(void 0===a?"primary":a),"--".concat(void 0===l?"md":l),{"vchasno-ui-pulse-animation":y&&!v.disabled,"--outline":void 0!==u&&u,"--wide":void 0!==d&&d,"--loading":s,"--suppress-padding":void 0!==p&&p},f)},v),b,s&&/*#__PURE__*/e.createElement(r,{height:"1rem"}))});n.displayName="Button";export{n as default};
|
|
2
2
|
//# sourceMappingURL=Button.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sources":["../../../src/components/Button/Button.tsx"],"sourcesContent":["import React, { ButtonHTMLAttributes } from 'react';\n\nimport cn from 'classnames';\n\nimport Spinner from '../Spinner';\nimport { DataQa, LoadingFeedback, Sizable, WithPulseAnimation } from '../types';\n\nimport './Button.global.css';\n\n/**\n * @deprecated - it will be removed in the next major version\n */\ntype ButtonThemeLight = 'light';\n/**\n * @deprecated - it will be removed in the next major version\n */\ntype ButtonThemeTransparent = 'transparent';\n\ntype ButtonTheme = 'primary' | 'secondary' | 'danger' | 'pink'; // KEP specific;\nexport interface ButtonProps\n extends ButtonHTMLAttributes<HTMLButtonElement>,\n Partial<Sizable & LoadingFeedback & DataQa & WithPulseAnimation> {\n className?: string;\n theme?: ButtonTheme | ButtonThemeLight | ButtonThemeTransparent;\n /**\n * @deprecated - it will be removed in the next major version\n */\n outline?: boolean;\n wide?: boolean;\n suppressPadding?: boolean;\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n theme = 'primary',\n type = 'button',\n size = 'md',\n outline = false,\n loading = false,\n wide = false,\n suppressPadding = false,\n className,\n dataQa,\n children,\n pulse,\n ...rest\n },\n ref,\n ) => {\n return (\n <button\n data-qa={dataQa}\n ref={ref}\n type={type}\n className={cn(\n 'vchasno-ui-button',\n `--${theme}`,\n `--${size}`,\n {\n 'vchasno-ui-pulse-animation': pulse,\n '--outline': outline,\n '--wide': wide,\n '--loading': loading,\n '--suppress-padding': suppressPadding,\n },\n className,\n )}\n {...rest}\n >\n {children}\n {loading && <Spinner height=\"1rem\" />}\n </button>\n );\n },\n);\n\nButton.displayName = 'Button';\n\nexport default Button;\n"],"names":["Button","React","forwardRef","ref","theme","type","_param_size","_param","size","outline","_param_loading","loading","wide","_param_suppressPadding","suppressPadding","className","dataQa","children","pulse","rest","button","data-qa","_param_type","cn","concat","_param_outline","_param_wide","Spinner","height","displayName"],"mappings":"oFAgCA,IAAMA,EAASC,WAAAA,EAAAA,EAAMC,UAAU,CAC3B,SAeIC,CAAAA,CAAAA,CAAAA,UAbIC,KAAAA,CACAC,EAAAA,EAAAA,IAAAA,CAAOC,EAAAC,EACPC,IAAAA,CACAC,EAAAA,EAAAA,OAAAA,CAAUC,EAAAH,EACVI,OAAAA,CAAAA,EAAAA,AAAAA,KAAAA,IAAAA,GACAC,EAAAA,EAAAA,EAAAA,IAAAA,CAAOC,EAAAN,EACPO,eAAAA,CACAC,EAAAA,EAAAA,SACAC,CAAAA,EAAAA,EAAAA,MACAC,CAAAA,EAAAA,EAAAA,QACAC,CAAAA,EAAAA,EAAAA,KACGC,CAAAA,EAAAA,sXAAAA,EAAAA,CAXHf,QACAC,OACAG,OACAC,UACAE,UACAC,OACAE,kBACAC,YACAC,SACAC,WACAC,UAKJ,OAAA,WAAA,EACIjB,EAACmB,aAAAA,CAAAA,SAAAA,iaAAAA,CACGC,UAASL,EACTb,IAAKA,EACLE,KAlBGiB,AAAA,KAAA,IAAAA,EAAA,SAAAA,EAmBHP,UAAWQ,EACP,oBACA,KAAWC,OAtBnBpB,AAAAA,KAAAA,IAAAA,EAAQ,UACRC,GAsBS,KAASmB,MAAA,CArBlBhB,AAAAA,KAAAA,IAAAA,EAAO,KACPC,GAqBQ,CACI,6BAA8BS,
|
|
1
|
+
{"version":3,"file":"Button.js","sources":["../../../src/components/Button/Button.tsx"],"sourcesContent":["import React, { ButtonHTMLAttributes } from 'react';\n\nimport cn from 'classnames';\n\nimport Spinner from '../Spinner';\nimport { DataQa, LoadingFeedback, Sizable, WithPulseAnimation } from '../types';\n\nimport './Button.global.css';\n\n/**\n * @deprecated - it will be removed in the next major version\n */\ntype ButtonThemeLight = 'light';\n/**\n * @deprecated - it will be removed in the next major version\n */\ntype ButtonThemeTransparent = 'transparent';\n\ntype ButtonTheme = 'primary' | 'secondary' | 'danger' | 'pink'; // KEP specific;\nexport interface ButtonProps\n extends ButtonHTMLAttributes<HTMLButtonElement>,\n Partial<Sizable & LoadingFeedback & DataQa & WithPulseAnimation> {\n className?: string;\n theme?: ButtonTheme | ButtonThemeLight | ButtonThemeTransparent;\n /**\n * @deprecated - it will be removed in the next major version\n */\n outline?: boolean;\n wide?: boolean;\n suppressPadding?: boolean;\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n theme = 'primary',\n type = 'button',\n size = 'md',\n outline = false,\n loading = false,\n wide = false,\n suppressPadding = false,\n className,\n dataQa,\n children,\n pulse,\n ...rest\n },\n ref,\n ) => {\n return (\n <button\n data-qa={dataQa}\n ref={ref}\n type={type}\n className={cn(\n 'vchasno-ui-button',\n `--${theme}`,\n `--${size}`,\n {\n 'vchasno-ui-pulse-animation': pulse && !rest.disabled,\n '--outline': outline,\n '--wide': wide,\n '--loading': loading,\n '--suppress-padding': suppressPadding,\n },\n className,\n )}\n {...rest}\n >\n {children}\n {loading && <Spinner height=\"1rem\" />}\n </button>\n );\n },\n);\n\nButton.displayName = 'Button';\n\nexport default Button;\n"],"names":["Button","React","forwardRef","ref","theme","type","_param_size","_param","size","outline","_param_loading","loading","wide","_param_suppressPadding","suppressPadding","className","dataQa","children","pulse","rest","button","data-qa","_param_type","cn","concat","disabled","_param_outline","_param_wide","Spinner","height","displayName"],"mappings":"oFAgCA,IAAMA,EAASC,WAAAA,EAAAA,EAAMC,UAAU,CAC3B,SAeIC,CAAAA,CAAAA,CAAAA,UAbIC,KAAAA,CACAC,EAAAA,EAAAA,IAAAA,CAAOC,EAAAC,EACPC,IAAAA,CACAC,EAAAA,EAAAA,OAAAA,CAAUC,EAAAH,EACVI,OAAAA,CAAAA,EAAAA,AAAAA,KAAAA,IAAAA,GACAC,EAAAA,EAAAA,EAAAA,IAAAA,CAAOC,EAAAN,EACPO,eAAAA,CACAC,EAAAA,EAAAA,SACAC,CAAAA,EAAAA,EAAAA,MACAC,CAAAA,EAAAA,EAAAA,QACAC,CAAAA,EAAAA,EAAAA,KACGC,CAAAA,EAAAA,sXAAAA,EAAAA,CAXHf,QACAC,OACAG,OACAC,UACAE,UACAC,OACAE,kBACAC,YACAC,SACAC,WACAC,UAKJ,OAAA,WAAA,EACIjB,EAACmB,aAAAA,CAAAA,SAAAA,iaAAAA,CACGC,UAASL,EACTb,IAAKA,EACLE,KAlBGiB,AAAA,KAAA,IAAAA,EAAA,SAAAA,EAmBHP,UAAWQ,EACP,oBACA,KAAWC,OAtBnBpB,AAAAA,KAAAA,IAAAA,EAAQ,UACRC,GAsBS,KAASmB,MAAA,CArBlBhB,AAAAA,KAAAA,IAAAA,EAAO,KACPC,GAqBQ,CACI,6BAA8BS,GAAS,CAACC,EAAKM,QAAQ,CACrD,YAvBFC,AAAA,KAAA,IAAAA,GAAAA,EAwBE,SAtBLC,AAAA,KAAA,IAAAA,GAAAA,EAuBK,YAAahB,EACb,qBAvBZG,AAAAA,KAAAA,IAAAA,GACAC,CAwBQA,EAAAA,IAEAI,GAEHF,EACAN,gBAAWV,EAAC2B,aAAAA,CAAAA,EAAAA,CAAQC,OAAO,SAGxC,EAGJ7B,CAAAA,EAAO8B,WAAW,CAAG"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e from"react";import t from"classnames";import a from"../Spinner/Spinner.js";var r=/*#__PURE__*/e.forwardRef(function(r,n){var l=r.className,o=r.label,c=r.partial,i=r.disabled,s=r.loading,b=r.dataQa,u=r.pulse,m=function(e,t){if(null==e)return{};var a,r,n=function(e,t){if(null==e)return{};var a,r,n={},l=Object.keys(e);for(r=0;r<l.length;r++)a=l[r],t.indexOf(a)>=0||(n[a]=e[a]);return n}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r<l.length;r++)a=l[r],!(t.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(e,a)&&(n[a]=e[a])}return n}(r,["className","label","partial","disabled","loading","dataQa","pulse"]);return /*#__PURE__*/e.createElement("label",{"data-qa":b,className:t("vchasno-ui-checkbox",l,{"--loading":s,"--disabled":i})},/*#__PURE__*/e.createElement("input",function(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{},r=Object.keys(a);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(a).filter(function(e){return Object.getOwnPropertyDescriptor(a,e).enumerable}))),r.forEach(function(t){var r;r=a[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({ref:n,type:"checkbox",hidden:!0,disabled:i},m)),/*#__PURE__*/e.createElement("span",{className:t("vchasno-ui-checkbox__box",{"vchasno-ui-pulse-animation":u})},s&&/*#__PURE__*/e.createElement(a,{height:"90%"}),c?/*#__PURE__*/e.createElement("svg",{className:"vchasno-ui-checkbox__svg",width:"8",height:"2",viewBox:"0 0 8 2",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/e.createElement("rect",{width:"8",height:"2",rx:"1",fill:"currentColor"})):/*#__PURE__*/e.createElement("svg",{className:"vchasno-ui-checkbox__svg",width:"10",height:"7",viewBox:"0 0 10 7",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/e.createElement("path",{d:"M4 7C3.8 7 3.5 6.9 3.3 6.7L0.3 3.7C-0.1 3.3 -0.1 2.7 0.3 2.3C0.7 1.9 1.3 1.9 1.7 2.3L4 4.6L8.3 0.3C8.7 -0.1 9.3 -0.1 9.7 0.3C10.1 0.7 10.1 1.3 9.7 1.7L4.7 6.7C4.5 6.9 4.3 7 4 7Z",fill:"currentColor"}))),o&&/*#__PURE__*/e.createElement("span",{className:"vchasno-ui-checkbox__label"},o))});r.displayName="Checkbox";export{r as default};
|
|
1
|
+
import e from"react";import t from"classnames";import a from"../Spinner/Spinner.js";var r=/*#__PURE__*/e.forwardRef(function(r,n){var l=r.className,o=r.label,c=r.partial,i=r.disabled,s=r.loading,b=r.dataQa,u=r.pulse,m=function(e,t){if(null==e)return{};var a,r,n=function(e,t){if(null==e)return{};var a,r,n={},l=Object.keys(e);for(r=0;r<l.length;r++)a=l[r],t.indexOf(a)>=0||(n[a]=e[a]);return n}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r<l.length;r++)a=l[r],!(t.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(e,a)&&(n[a]=e[a])}return n}(r,["className","label","partial","disabled","loading","dataQa","pulse"]);return /*#__PURE__*/e.createElement("label",{"data-qa":b,className:t("vchasno-ui-checkbox",l,{"--loading":s,"--disabled":i})},/*#__PURE__*/e.createElement("input",function(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{},r=Object.keys(a);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(a).filter(function(e){return Object.getOwnPropertyDescriptor(a,e).enumerable}))),r.forEach(function(t){var r;r=a[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({ref:n,type:"checkbox",hidden:!0,disabled:i},m)),/*#__PURE__*/e.createElement("span",{className:t("vchasno-ui-checkbox__box",{"vchasno-ui-pulse-animation":u&&!i})},s&&/*#__PURE__*/e.createElement(a,{height:"90%"}),c?/*#__PURE__*/e.createElement("svg",{className:"vchasno-ui-checkbox__svg",width:"8",height:"2",viewBox:"0 0 8 2",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/e.createElement("rect",{width:"8",height:"2",rx:"1",fill:"currentColor"})):/*#__PURE__*/e.createElement("svg",{className:"vchasno-ui-checkbox__svg",width:"10",height:"7",viewBox:"0 0 10 7",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/e.createElement("path",{d:"M4 7C3.8 7 3.5 6.9 3.3 6.7L0.3 3.7C-0.1 3.3 -0.1 2.7 0.3 2.3C0.7 1.9 1.3 1.9 1.7 2.3L4 4.6L8.3 0.3C8.7 -0.1 9.3 -0.1 9.7 0.3C10.1 0.7 10.1 1.3 9.7 1.7L4.7 6.7C4.5 6.9 4.3 7 4 7Z",fill:"currentColor"}))),o&&/*#__PURE__*/e.createElement("span",{className:"vchasno-ui-checkbox__label"},o))});r.displayName="Checkbox";export{r as default};
|
|
2
2
|
//# sourceMappingURL=Checkbox.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.js","sources":["../../../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["import React, { InputHTMLAttributes } from 'react';\n\nimport cn from 'classnames';\n\nimport Spinner from '../Spinner';\nimport type { DataQa, LoadingFeedback, WithPulseAnimation } from '../types';\n\nimport './Checkbox.global.css';\n\nexport interface CheckboxProps\n extends InputHTMLAttributes<HTMLInputElement>,\n Partial<LoadingFeedback & DataQa & WithPulseAnimation> {\n className?: string;\n label?: string;\n disabled?: boolean;\n partial?: boolean;\n}\n\nconst Checkbox = React.forwardRef<HTMLInputElement, CheckboxProps>(\n ({ className, label, partial, disabled, loading, dataQa, pulse, ...rest }, ref) => {\n return (\n <label\n data-qa={dataQa}\n className={cn('vchasno-ui-checkbox', className, {\n '--loading': loading,\n '--disabled': disabled,\n })}\n >\n <input ref={ref} type=\"checkbox\" hidden disabled={disabled} {...rest} />\n <span\n className={cn('vchasno-ui-checkbox__box', {\n 'vchasno-ui-pulse-animation': pulse,\n })}\n >\n {loading && <Spinner height=\"90%\" />}\n {partial ? (\n <svg\n className=\"vchasno-ui-checkbox__svg\"\n width=\"8\"\n height=\"2\"\n viewBox=\"0 0 8 2\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <rect width=\"8\" height=\"2\" rx=\"1\" fill=\"currentColor\" />\n </svg>\n ) : (\n <svg\n className=\"vchasno-ui-checkbox__svg\"\n width=\"10\"\n height=\"7\"\n viewBox=\"0 0 10 7\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M4 7C3.8 7 3.5 6.9 3.3 6.7L0.3 3.7C-0.1 3.3 -0.1 2.7 0.3 2.3C0.7 1.9 1.3 1.9 1.7 2.3L4 4.6L8.3 0.3C8.7 -0.1 9.3 -0.1 9.7 0.3C10.1 0.7 10.1 1.3 9.7 1.7L4.7 6.7C4.5 6.9 4.3 7 4 7Z\"\n fill=\"currentColor\"\n />\n </svg>\n )}\n </span>\n {label && <span className=\"vchasno-ui-checkbox__label\">{label}</span>}\n </label>\n );\n },\n);\n\nCheckbox.displayName = 'Checkbox';\n\nexport default Checkbox;\n"],"names":["Checkbox","React","forwardRef","ref","className","label","partial","disabled","loading","dataQa","pulse","rest","data-qa","cn","input","type","hidden","span","Spinner","height","svg","width","viewBox","fill","xmlns","rect","rx","path","d","displayName"],"mappings":"oFAkBA,IAAMA,EAAWC,WAAAA,EAAAA,EAAMC,UAAU,CAC7B,SAA2EC,CAAAA,CAAAA,CAAAA,EAAxEC,IAAAA,EAAAA,EAAAA,SAAWC,CAAAA,EAAAA,EAAAA,KAAOC,CAAAA,EAAAA,EAAAA,OAASC,CAAAA,EAAAA,EAAAA,QAAUC,CAAAA,EAAAA,EAAAA,OAASC,CAAAA,EAAAA,EAAAA,MAAQC,CAAAA,EAAAA,EAAAA,KAAUC,CAAAA,EAAAA,sXAAAA,EAAAA,CAAhEP,YAAWC,QAAOC,UAASC,WAAUC,UAASC,SAAQC,UACrD,oBACIT,EAACI,aAAAA,CAAAA,QAAAA,CACGO,UAASH,EACTL,UAAWS,EAAG,sBAAuBT,EAAW,CAC5C,YAAaI,EACb,aAAcD,CAClB,iBAEAN,EAACa,aAAAA,CAAAA,QAAAA,iaAAAA,CAAMX,IAAKA,EAAKY,KAAK,WAAWC,OAAAA,CAAAA,EAAOT,SAAUA,CAAcI,EAAAA,IAAAA,WAAAA,EAChEV,EAACgB,aAAAA,CAAAA,OAAAA,CACGb,UAAWS,EAAG,2BAA4B,CACtC,6BAA8BH,
|
|
1
|
+
{"version":3,"file":"Checkbox.js","sources":["../../../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["import React, { InputHTMLAttributes } from 'react';\n\nimport cn from 'classnames';\n\nimport Spinner from '../Spinner';\nimport type { DataQa, LoadingFeedback, WithPulseAnimation } from '../types';\n\nimport './Checkbox.global.css';\n\nexport interface CheckboxProps\n extends InputHTMLAttributes<HTMLInputElement>,\n Partial<LoadingFeedback & DataQa & WithPulseAnimation> {\n className?: string;\n label?: string;\n disabled?: boolean;\n partial?: boolean;\n}\n\nconst Checkbox = React.forwardRef<HTMLInputElement, CheckboxProps>(\n ({ className, label, partial, disabled, loading, dataQa, pulse, ...rest }, ref) => {\n return (\n <label\n data-qa={dataQa}\n className={cn('vchasno-ui-checkbox', className, {\n '--loading': loading,\n '--disabled': disabled,\n })}\n >\n <input ref={ref} type=\"checkbox\" hidden disabled={disabled} {...rest} />\n <span\n className={cn('vchasno-ui-checkbox__box', {\n 'vchasno-ui-pulse-animation': pulse && !disabled,\n })}\n >\n {loading && <Spinner height=\"90%\" />}\n {partial ? (\n <svg\n className=\"vchasno-ui-checkbox__svg\"\n width=\"8\"\n height=\"2\"\n viewBox=\"0 0 8 2\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <rect width=\"8\" height=\"2\" rx=\"1\" fill=\"currentColor\" />\n </svg>\n ) : (\n <svg\n className=\"vchasno-ui-checkbox__svg\"\n width=\"10\"\n height=\"7\"\n viewBox=\"0 0 10 7\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M4 7C3.8 7 3.5 6.9 3.3 6.7L0.3 3.7C-0.1 3.3 -0.1 2.7 0.3 2.3C0.7 1.9 1.3 1.9 1.7 2.3L4 4.6L8.3 0.3C8.7 -0.1 9.3 -0.1 9.7 0.3C10.1 0.7 10.1 1.3 9.7 1.7L4.7 6.7C4.5 6.9 4.3 7 4 7Z\"\n fill=\"currentColor\"\n />\n </svg>\n )}\n </span>\n {label && <span className=\"vchasno-ui-checkbox__label\">{label}</span>}\n </label>\n );\n },\n);\n\nCheckbox.displayName = 'Checkbox';\n\nexport default Checkbox;\n"],"names":["Checkbox","React","forwardRef","ref","className","label","partial","disabled","loading","dataQa","pulse","rest","data-qa","cn","input","type","hidden","span","Spinner","height","svg","width","viewBox","fill","xmlns","rect","rx","path","d","displayName"],"mappings":"oFAkBA,IAAMA,EAAWC,WAAAA,EAAAA,EAAMC,UAAU,CAC7B,SAA2EC,CAAAA,CAAAA,CAAAA,EAAxEC,IAAAA,EAAAA,EAAAA,SAAWC,CAAAA,EAAAA,EAAAA,KAAOC,CAAAA,EAAAA,EAAAA,OAASC,CAAAA,EAAAA,EAAAA,QAAUC,CAAAA,EAAAA,EAAAA,OAASC,CAAAA,EAAAA,EAAAA,MAAQC,CAAAA,EAAAA,EAAAA,KAAUC,CAAAA,EAAAA,sXAAAA,EAAAA,CAAhEP,YAAWC,QAAOC,UAASC,WAAUC,UAASC,SAAQC,UACrD,oBACIT,EAACI,aAAAA,CAAAA,QAAAA,CACGO,UAASH,EACTL,UAAWS,EAAG,sBAAuBT,EAAW,CAC5C,YAAaI,EACb,aAAcD,CAClB,iBAEAN,EAACa,aAAAA,CAAAA,QAAAA,iaAAAA,CAAMX,IAAKA,EAAKY,KAAK,WAAWC,OAAAA,CAAAA,EAAOT,SAAUA,CAAcI,EAAAA,IAAAA,WAAAA,EAChEV,EAACgB,aAAAA,CAAAA,OAAAA,CACGb,UAAWS,EAAG,2BAA4B,CACtC,6BAA8BH,GAAS,CAACH,CAC5C,EAECC,EAAAA,GAAW,WAAA,EAAAP,EAACiB,aAAAA,CAAAA,EAAAA,CAAQC,OAAO,KAC3Bb,GAAAA,EAAAA,WAAAA,EACGL,EAACmB,aAAAA,CAAAA,MAAAA,CACGhB,UAAU,2BACViB,MAAM,IACNF,OAAO,IACPG,QAAQ,UACRC,KAAK,OACLC,MAAM,2CAENvB,EAACwB,aAAAA,CAAAA,OAAAA,CAAKJ,MAAM,IAAIF,OAAO,IAAIO,GAAG,IAAIH,KAAK,kBAG3C,WAAA,EAAAtB,EAACmB,aAAAA,CAAAA,MAAAA,CACGhB,UAAU,2BACViB,MAAM,KACNF,OAAO,IACPG,QAAQ,WACRC,KAAK,OACLC,MAAM,2CAENvB,EAAC0B,aAAAA,CAAAA,OAAAA,CACGC,EAAE,oLACFL,KAAK,cAKpBlB,KAAAA,GAAS,WAAA,EAAAJ,EAACgB,aAAAA,CAAAA,OAAAA,CAAKb,UAAU,4BAA8BC,EAAAA,GAGpE,EAGJL,CAAAA,EAAS6B,WAAW,CAAG"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e from"react";import t from"react-datepicker";import r from"react-text-mask";import a from"classnames";import{uk as o}from"date-fns/locale/uk";import n from"../../icons/clear.js";import l from"../InputMeta/InputMeta.js";import i from"../LabelText/LabelText.js";import c from"../Spinner/Spinner.js";var d=function(){return /*#__PURE__*/e.createElement("svg",{className:"vchasno-ui-date-picker__custom-calendar-icon",width:"20",height:"20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16 4h1c.6 0 1 .4 1 1v10c0 1.7-1.3 3-3 3H5c-1.7 0-3-1.3-3-3V5c0-.6.4-1 1-1h1V3c0-.6.4-1 1-1s1 .4 1 1v1h8V3c0-.6.4-1 1-1s1 .4 1 1v1zm-1 12c.6 0 1-.4 1-1V6H4v9c0 .6.4 1 1 1h10zM8 9a1 1 0 11-2 0 1 1 0 012 0zm2 1a1 1 0 100-2 1 1 0 000 2zm4-1a1 1 0 11-2 0 1 1 0 012 0zm-7 5a1 1 0 100-2 1 1 0 000 2zm4-1a1 1 0 11-2 0 1 1 0 012 0z",fill:"currentColor"}))},s=function(){return /*#__PURE__*/e.createElement("span",{className:"vchasno-ui-date-picker__custom-close-icon"},n)},m=["dd.MM.yyyy","dd-MM-yyyy","dd/MM/yyyy","dd.MM.yy","dd-MM-yy","dd/MM/yy"],p=[/\d/,/\d/,".",/\d/,/\d/,".",/\d/,/\d/,/\d/,/\d/],u=function(n){var u=n.label,f=n.disabled,y=n.required,h=n.loading,v=n.hint,b=n.error,w=n.dateFormat,M=n.className,k=n.timeCaption,g=n.enableTabLoop,E=n.locale,O=n.showMask,j=void 0!==O&&O,x=n.showPopperArrow,P=n.mask,_=n.dataQa,z=n.hideEmptyMeta,N=n.wide,S=n.pulse,T=function(e,t){if(null==e)return{};var r,a,o=function(e,t){if(null==e)return{};var r,a,o={},n=Object.keys(e);for(a=0;a<n.length;a++)r=n[a],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(a=0;a<n.length;a++)r=n[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(n,["label","disabled","required","loading","hint","error","dateFormat","className","timeCaption","enableTabLoop","locale","showMask","showPopperArrow","mask","dataQa","hideEmptyMeta","wide","pulse"]),L=!!T.selected||!!T.value;return /*#__PURE__*/e.createElement("label",{"data-qa":_,className:a("vchasno-ui-date-picker",{"--loading":h,"--required":y,"--disabled":f,"--error":b,"--with-mask":j,"--wide":void 0!==N&&N,"--not-empty":L},M)},/*#__PURE__*/e.createElement("span",{className:a("vchasno-ui-date-picker__wrapper",{"vchasno-ui-pulse-animation":S})},u&&/*#__PURE__*/e.createElement(i,null,u),/*#__PURE__*/e.createElement(t,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},a=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(a=a.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),a.forEach(function(t){var a;a=r[t],t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a})}return e}({enableTabLoop:void 0!==g&&g,locale:void 0===E?o:E,timeCaption:void 0===k?"Час":k,disabled:f,placeholderText:" ",showPopperArrow:void 0!==x&&x,className:"vchasno-ui-date-picker__picker",dateFormat:void 0===w?m:w,customInput:j?/*#__PURE__*/e.createElement(r,{inputMode:"text",mask:void 0===P?p:P,showMask:!0}):void 0},T)),h?/*#__PURE__*/e.createElement(c,{height:"18px"}):/*#__PURE__*/e.createElement(d,null),/*#__PURE__*/e.createElement(s,null)),!(void 0!==z&&z)||b||v?/*#__PURE__*/e.createElement(l,{hint:v,error:b}):null)};export{u as default};
|
|
1
|
+
import e from"react";import t from"react-datepicker";import r from"react-text-mask";import a from"classnames";import{uk as o}from"date-fns/locale/uk";import n from"../../icons/clear.js";import l from"../InputMeta/InputMeta.js";import i from"../LabelText/LabelText.js";import c from"../Spinner/Spinner.js";var d=function(){return /*#__PURE__*/e.createElement("svg",{className:"vchasno-ui-date-picker__custom-calendar-icon",width:"20",height:"20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16 4h1c.6 0 1 .4 1 1v10c0 1.7-1.3 3-3 3H5c-1.7 0-3-1.3-3-3V5c0-.6.4-1 1-1h1V3c0-.6.4-1 1-1s1 .4 1 1v1h8V3c0-.6.4-1 1-1s1 .4 1 1v1zm-1 12c.6 0 1-.4 1-1V6H4v9c0 .6.4 1 1 1h10zM8 9a1 1 0 11-2 0 1 1 0 012 0zm2 1a1 1 0 100-2 1 1 0 000 2zm4-1a1 1 0 11-2 0 1 1 0 012 0zm-7 5a1 1 0 100-2 1 1 0 000 2zm4-1a1 1 0 11-2 0 1 1 0 012 0z",fill:"currentColor"}))},s=function(){return /*#__PURE__*/e.createElement("span",{className:"vchasno-ui-date-picker__custom-close-icon"},n)},m=["dd.MM.yyyy","dd-MM-yyyy","dd/MM/yyyy","dd.MM.yy","dd-MM-yy","dd/MM/yy"],p=[/\d/,/\d/,".",/\d/,/\d/,".",/\d/,/\d/,/\d/,/\d/],u=function(n){var u=n.label,f=n.disabled,y=n.required,h=n.loading,v=n.hint,b=n.error,w=n.dateFormat,M=n.className,k=n.timeCaption,g=n.enableTabLoop,E=n.locale,O=n.showMask,j=void 0!==O&&O,x=n.showPopperArrow,P=n.mask,_=n.dataQa,z=n.hideEmptyMeta,N=n.wide,S=n.pulse,T=function(e,t){if(null==e)return{};var r,a,o=function(e,t){if(null==e)return{};var r,a,o={},n=Object.keys(e);for(a=0;a<n.length;a++)r=n[a],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(a=0;a<n.length;a++)r=n[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(n,["label","disabled","required","loading","hint","error","dateFormat","className","timeCaption","enableTabLoop","locale","showMask","showPopperArrow","mask","dataQa","hideEmptyMeta","wide","pulse"]),L=!!T.selected||!!T.value;return /*#__PURE__*/e.createElement("label",{"data-qa":_,className:a("vchasno-ui-date-picker",{"--loading":h,"--required":y,"--disabled":f,"--error":b,"--with-mask":j,"--wide":void 0!==N&&N,"--not-empty":L},M)},/*#__PURE__*/e.createElement("span",{className:a("vchasno-ui-date-picker__wrapper",{"vchasno-ui-pulse-animation":S&&!f})},u&&/*#__PURE__*/e.createElement(i,null,u),/*#__PURE__*/e.createElement(t,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},a=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(a=a.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),a.forEach(function(t){var a;a=r[t],t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a})}return e}({enableTabLoop:void 0!==g&&g,locale:void 0===E?o:E,timeCaption:void 0===k?"Час":k,disabled:f,placeholderText:" ",showPopperArrow:void 0!==x&&x,className:"vchasno-ui-date-picker__picker",dateFormat:void 0===w?m:w,customInput:j?/*#__PURE__*/e.createElement(r,{inputMode:"text",mask:void 0===P?p:P,showMask:!0}):void 0},T)),h?/*#__PURE__*/e.createElement(c,{height:"18px"}):/*#__PURE__*/e.createElement(d,null),/*#__PURE__*/e.createElement(s,null)),!(void 0!==z&&z)||b||v?/*#__PURE__*/e.createElement(l,{hint:v,error:b}):null)};export{u as default};
|
|
2
2
|
//# sourceMappingURL=DatePicker.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatePicker.js","sources":["../../../src/components/Datepicker/DatePicker.tsx"],"sourcesContent":["import React from 'react';\nimport type { ReactDatePickerProps } from 'react-datepicker';\nimport ReactDatePicker from 'react-datepicker';\nimport MaskedInput, { MaskedInputProps } from 'react-text-mask';\n\nimport cn from 'classnames';\nimport { uk } from 'date-fns/locale/uk';\n\nimport clearRawSvg from '../../icons/clear';\nimport InputMeta from '../InputMeta';\nimport LabelText from '../LabelText';\nimport Spinner from '../Spinner';\nimport {\n DataQa,\n ErrorFeedback,\n HideEmptyMeta,\n LoadingFeedback,\n WithHint,\n WithPulseAnimation,\n} from '../types';\n\nimport './DatePicker.global.css';\n\nconst SvgCalendar = () => (\n <svg\n className=\"vchasno-ui-date-picker__custom-calendar-icon\"\n width=\"20\"\n height=\"20\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M16 4h1c.6 0 1 .4 1 1v10c0 1.7-1.3 3-3 3H5c-1.7 0-3-1.3-3-3V5c0-.6.4-1 1-1h1V3c0-.6.4-1 1-1s1 .4 1 1v1h8V3c0-.6.4-1 1-1s1 .4 1 1v1zm-1 12c.6 0 1-.4 1-1V6H4v9c0 .6.4 1 1 1h10zM8 9a1 1 0 11-2 0 1 1 0 012 0zm2 1a1 1 0 100-2 1 1 0 000 2zm4-1a1 1 0 11-2 0 1 1 0 012 0zm-7 5a1 1 0 100-2 1 1 0 000 2zm4-1a1 1 0 11-2 0 1 1 0 012 0z\"\n fill=\"currentColor\"\n />\n </svg>\n);\n\n// Вставляємо на місце де має відображатися іконка закриття бібілотеки так як немає API для підміни іконки та її контролю\n// за допомогою :has(.react-datepicker__close-icon) та :has(.react-datepicker__close-icon:hover) контролюємо появу та зміну кольору іконки\nconst CloseSvg = () => (\n <span className=\"vchasno-ui-date-picker__custom-close-icon\">{clearRawSvg}</span>\n);\n\nconst DATE_FORMATS = ['dd.MM.yyyy', 'dd-MM-yyyy', 'dd/MM/yyyy', 'dd.MM.yy', 'dd-MM-yy', 'dd/MM/yy'];\n\nconst defaultMask: MaskedInputProps['mask'] = [\n /\\d/,\n /\\d/,\n '.',\n /\\d/,\n /\\d/,\n '.',\n /\\d/,\n /\\d/,\n /\\d/,\n /\\d/,\n];\n\nexport interface DatePickerProps\n extends ReactDatePickerProps,\n Partial<\n LoadingFeedback & WithHint & ErrorFeedback & DataQa & HideEmptyMeta & WithPulseAnimation\n > {\n label?: string;\n className?: string;\n showMask?: boolean;\n mask?: MaskedInputProps['mask'];\n onChange: ReactDatePickerProps['onChange'];\n isClearable?: ReactDatePickerProps['isClearable'];\n dateFormat?: ReactDatePickerProps['dateFormat'];\n wide?: boolean;\n}\n\n/**\n * @see <https://reactdatepicker.com/>\n */\nconst DatePicker: React.FC<DatePickerProps> = ({\n label,\n disabled,\n required,\n loading,\n hint,\n error,\n dateFormat = DATE_FORMATS,\n className,\n timeCaption = 'Час',\n enableTabLoop = false,\n locale = uk,\n showMask = false,\n showPopperArrow = false,\n mask = defaultMask,\n dataQa,\n hideEmptyMeta = false,\n wide = false,\n pulse,\n ...rest\n}) => {\n const valueExists = !!rest.selected || !!rest.value;\n\n return (\n <label\n data-qa={dataQa}\n className={cn(\n 'vchasno-ui-date-picker',\n {\n '--loading': loading,\n '--required': required,\n '--disabled': disabled,\n '--error': error,\n '--with-mask': showMask,\n '--wide': wide,\n '--not-empty': valueExists,\n },\n className,\n )}\n >\n <span\n className={cn('vchasno-ui-date-picker__wrapper', {\n 'vchasno-ui-pulse-animation': pulse,\n })}\n >\n {label && <LabelText>{label}</LabelText>}\n <ReactDatePicker\n enableTabLoop={enableTabLoop}\n locale={locale}\n timeCaption={timeCaption}\n disabled={disabled}\n placeholderText=\" \"\n showPopperArrow={showPopperArrow}\n className=\"vchasno-ui-date-picker__picker\"\n dateFormat={dateFormat}\n customInput={\n showMask ? <MaskedInput inputMode=\"text\" mask={mask} showMask /> : undefined\n }\n {...rest}\n />\n {loading ? <Spinner height=\"18px\" /> : <SvgCalendar />}\n <CloseSvg />\n </span>\n {hideEmptyMeta && !error && !hint ? null : <InputMeta hint={hint} error={error} />}\n </label>\n );\n};\n\nexport default DatePicker;\n"],"names":["SvgCalendar","React","svg","className","width","height","fill","xmlns","path","fillRule","clipRule","d","CloseSvg","span","clearRawSvg","DATE_FORMATS","defaultMask","DatePicker","_param","label","disabled","required","loading","hint","error","dateFormat","timeCaption","enableTabLoop","locale","showMask","showPopperArrow","mask","dataQa","hideEmptyMeta","_param_wide","wide","pulse","rest","valueExists","selected","value","data-qa","cn","createElement","LabelText","ReactDatePicker","uk","placeholderText","customInput","MaskedInput","inputMode","undefined","Spinner","_param_hideEmptyMeta","InputMeta"],"mappings":"iTAuBA,IAAMA,EAAc,+BAChBC,EAACC,aAAAA,CAAAA,MAAAA,CACGC,UAAU,+CACVC,MAAM,KACNC,OAAO,KACPC,KAAK,OACLC,MAAM,2CAENN,EAACO,aAAAA,CAAAA,OAAAA,CACGC,SAAS,UACTC,SAAS,UACTC,EAAE,sUACFL,KAAK,mBAOXM,EAAW,+BACbX,EAACY,aAAAA,CAAAA,OAAAA,CAAKV,UAAU,2CAA6CW,EAAAA,IAG3DC,EAAe,CAAC,aAAc,aAAc,aAAc,WAAY,WAAY,WAAW,CAE7FC,EAAwC,CAC1C,KACA,KACA,IACA,KACA,KACA,IACA,KACA,KACA,KACA,KACH,CAoBKC,EAAwC,SAAAC,CAAA,EAC1CC,IAAAA,EAAAA,EAAAA,MACAC,EAAAA,EAAAA,QAAAA,CACAC,IAAAA,QACAC,CAAAA,EAAAA,EAAAA,QACAC,EAAAA,EAAAA,IAAAA,CACAC,IAAAA,KACAC,CAAAA,EAAAA,EAAAA,UAAAA,CACAtB,EAAAA,EAAAA,cACAuB,WAAAA,KACAC,aAAAA,KACAC,MAAAA,KACAC,QAAAA,CAAAA,EAAAA,AAAAA,KAAAA,IAAAA,SACAC,eAAAA,KACAC,IAAAA,CACAC,EAAAA,EAAAA,MAAAA,CAAAA,EAAAA,EACAC,cAAgBC,EAAAhB,EAChBiB,KACAC,IAAAA,KACGC,CAAAA,EAAAA,sXAAAA,EAAAA,CAlBHlB,QACAC,WACAC,WACAC,UACAC,OACAC,QACAC,aACAtB,YACAuB,cACAC,gBACAC,SACAC,WACAC,kBACAC,OACAC,SACAC,gBACAE,OACAC,UAGME,EAAc,CAAC,CAACD,EAAKE,QAAQ,EAAI,CAAC,CAACF,EAAKG,KAAK,CAEnD,oBACIvC,EAACkB,aAAAA,CAAAA,QAAAA,CACGsB,UAAST,EACT7B,UAAWuC,EACP,yBACA,CACI,YAAapB,EACb,aAAcD,EACd,aAAcD,EACd,UAAWI,EACX,cAAeK,EACf,SAjBTK,AAAA,KAAA,IAAAA,GAAAA,EAkBS,cAAeI,CAEnBnC,EAAAA,iBAGJF,EAACY,aAAAA,CAAAA,OAAAA,CACGV,UAAWuC,EAAG,kCAAmC,CAC7C,6BAA8BN,
|
|
1
|
+
{"version":3,"file":"DatePicker.js","sources":["../../../src/components/Datepicker/DatePicker.tsx"],"sourcesContent":["import React from 'react';\nimport type { ReactDatePickerProps } from 'react-datepicker';\nimport ReactDatePicker from 'react-datepicker';\nimport MaskedInput, { MaskedInputProps } from 'react-text-mask';\n\nimport cn from 'classnames';\nimport { uk } from 'date-fns/locale/uk';\n\nimport clearRawSvg from '../../icons/clear';\nimport InputMeta from '../InputMeta';\nimport LabelText from '../LabelText';\nimport Spinner from '../Spinner';\nimport {\n DataQa,\n ErrorFeedback,\n HideEmptyMeta,\n LoadingFeedback,\n WithHint,\n WithPulseAnimation,\n} from '../types';\n\nimport './DatePicker.global.css';\n\nconst SvgCalendar = () => (\n <svg\n className=\"vchasno-ui-date-picker__custom-calendar-icon\"\n width=\"20\"\n height=\"20\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M16 4h1c.6 0 1 .4 1 1v10c0 1.7-1.3 3-3 3H5c-1.7 0-3-1.3-3-3V5c0-.6.4-1 1-1h1V3c0-.6.4-1 1-1s1 .4 1 1v1h8V3c0-.6.4-1 1-1s1 .4 1 1v1zm-1 12c.6 0 1-.4 1-1V6H4v9c0 .6.4 1 1 1h10zM8 9a1 1 0 11-2 0 1 1 0 012 0zm2 1a1 1 0 100-2 1 1 0 000 2zm4-1a1 1 0 11-2 0 1 1 0 012 0zm-7 5a1 1 0 100-2 1 1 0 000 2zm4-1a1 1 0 11-2 0 1 1 0 012 0z\"\n fill=\"currentColor\"\n />\n </svg>\n);\n\n// Вставляємо на місце де має відображатися іконка закриття бібілотеки так як немає API для підміни іконки та її контролю\n// за допомогою :has(.react-datepicker__close-icon) та :has(.react-datepicker__close-icon:hover) контролюємо появу та зміну кольору іконки\nconst CloseSvg = () => (\n <span className=\"vchasno-ui-date-picker__custom-close-icon\">{clearRawSvg}</span>\n);\n\nconst DATE_FORMATS = ['dd.MM.yyyy', 'dd-MM-yyyy', 'dd/MM/yyyy', 'dd.MM.yy', 'dd-MM-yy', 'dd/MM/yy'];\n\nconst defaultMask: MaskedInputProps['mask'] = [\n /\\d/,\n /\\d/,\n '.',\n /\\d/,\n /\\d/,\n '.',\n /\\d/,\n /\\d/,\n /\\d/,\n /\\d/,\n];\n\nexport interface DatePickerProps\n extends ReactDatePickerProps,\n Partial<\n LoadingFeedback & WithHint & ErrorFeedback & DataQa & HideEmptyMeta & WithPulseAnimation\n > {\n label?: string;\n className?: string;\n showMask?: boolean;\n mask?: MaskedInputProps['mask'];\n onChange: ReactDatePickerProps['onChange'];\n isClearable?: ReactDatePickerProps['isClearable'];\n dateFormat?: ReactDatePickerProps['dateFormat'];\n wide?: boolean;\n}\n\n/**\n * @see <https://reactdatepicker.com/>\n */\nconst DatePicker: React.FC<DatePickerProps> = ({\n label,\n disabled,\n required,\n loading,\n hint,\n error,\n dateFormat = DATE_FORMATS,\n className,\n timeCaption = 'Час',\n enableTabLoop = false,\n locale = uk,\n showMask = false,\n showPopperArrow = false,\n mask = defaultMask,\n dataQa,\n hideEmptyMeta = false,\n wide = false,\n pulse,\n ...rest\n}) => {\n const valueExists = !!rest.selected || !!rest.value;\n\n return (\n <label\n data-qa={dataQa}\n className={cn(\n 'vchasno-ui-date-picker',\n {\n '--loading': loading,\n '--required': required,\n '--disabled': disabled,\n '--error': error,\n '--with-mask': showMask,\n '--wide': wide,\n '--not-empty': valueExists,\n },\n className,\n )}\n >\n <span\n className={cn('vchasno-ui-date-picker__wrapper', {\n 'vchasno-ui-pulse-animation': pulse && !disabled,\n })}\n >\n {label && <LabelText>{label}</LabelText>}\n <ReactDatePicker\n enableTabLoop={enableTabLoop}\n locale={locale}\n timeCaption={timeCaption}\n disabled={disabled}\n placeholderText=\" \"\n showPopperArrow={showPopperArrow}\n className=\"vchasno-ui-date-picker__picker\"\n dateFormat={dateFormat}\n customInput={\n showMask ? <MaskedInput inputMode=\"text\" mask={mask} showMask /> : undefined\n }\n {...rest}\n />\n {loading ? <Spinner height=\"18px\" /> : <SvgCalendar />}\n <CloseSvg />\n </span>\n {hideEmptyMeta && !error && !hint ? null : <InputMeta hint={hint} error={error} />}\n </label>\n );\n};\n\nexport default DatePicker;\n"],"names":["SvgCalendar","React","svg","className","width","height","fill","xmlns","path","fillRule","clipRule","d","CloseSvg","span","clearRawSvg","DATE_FORMATS","defaultMask","DatePicker","_param","label","disabled","required","loading","hint","error","dateFormat","timeCaption","enableTabLoop","locale","showMask","showPopperArrow","mask","dataQa","hideEmptyMeta","_param_wide","wide","pulse","rest","valueExists","selected","value","data-qa","cn","createElement","LabelText","ReactDatePicker","uk","placeholderText","customInput","MaskedInput","inputMode","undefined","Spinner","_param_hideEmptyMeta","InputMeta"],"mappings":"iTAuBA,IAAMA,EAAc,+BAChBC,EAACC,aAAAA,CAAAA,MAAAA,CACGC,UAAU,+CACVC,MAAM,KACNC,OAAO,KACPC,KAAK,OACLC,MAAM,2CAENN,EAACO,aAAAA,CAAAA,OAAAA,CACGC,SAAS,UACTC,SAAS,UACTC,EAAE,sUACFL,KAAK,mBAOXM,EAAW,+BACbX,EAACY,aAAAA,CAAAA,OAAAA,CAAKV,UAAU,2CAA6CW,EAAAA,IAG3DC,EAAe,CAAC,aAAc,aAAc,aAAc,WAAY,WAAY,WAAW,CAE7FC,EAAwC,CAC1C,KACA,KACA,IACA,KACA,KACA,IACA,KACA,KACA,KACA,KACH,CAoBKC,EAAwC,SAAAC,CAAA,EAC1CC,IAAAA,EAAAA,EAAAA,MACAC,EAAAA,EAAAA,QAAAA,CACAC,IAAAA,QACAC,CAAAA,EAAAA,EAAAA,QACAC,EAAAA,EAAAA,IAAAA,CACAC,IAAAA,KACAC,CAAAA,EAAAA,EAAAA,UAAAA,CACAtB,EAAAA,EAAAA,cACAuB,WAAAA,KACAC,aAAAA,KACAC,MAAAA,KACAC,QAAAA,CAAAA,EAAAA,AAAAA,KAAAA,IAAAA,SACAC,eAAAA,KACAC,IAAAA,CACAC,EAAAA,EAAAA,MAAAA,CAAAA,EAAAA,EACAC,cAAgBC,EAAAhB,EAChBiB,KACAC,IAAAA,KACGC,CAAAA,EAAAA,sXAAAA,EAAAA,CAlBHlB,QACAC,WACAC,WACAC,UACAC,OACAC,QACAC,aACAtB,YACAuB,cACAC,gBACAC,SACAC,WACAC,kBACAC,OACAC,SACAC,gBACAE,OACAC,UAGME,EAAc,CAAC,CAACD,EAAKE,QAAQ,EAAI,CAAC,CAACF,EAAKG,KAAK,CAEnD,oBACIvC,EAACkB,aAAAA,CAAAA,QAAAA,CACGsB,UAAST,EACT7B,UAAWuC,EACP,yBACA,CACI,YAAapB,EACb,aAAcD,EACd,aAAcD,EACd,UAAWI,EACX,cAAeK,EACf,SAjBTK,AAAA,KAAA,IAAAA,GAAAA,EAkBS,cAAeI,CAEnBnC,EAAAA,iBAGJF,EAACY,aAAAA,CAAAA,OAAAA,CACGV,UAAWuC,EAAG,kCAAmC,CAC7C,6BAA8BN,GAAS,CAAChB,CAC5C,IAECD,GAAS,WAAA,EAAAlB,EAAA0C,aAAA,CAACC,EAAWzB,KAAAA,gBACtBlB,EAAC4C,aAAAA,CAAAA,EAAAA,iaAAAA,CACGlB,cArChBA,AAAAA,KAAAA,IAAAA,KAsCgBC,OArChBA,AAAAA,KAAAA,IAAAA,EAASkB,IAsCOpB,YAxChBA,AAAAA,KAAAA,IAAAA,EAAc,QAyCEN,SAAUA,EACV2B,gBAAgB,IAChBjB,gBAvChBA,AAAAA,KAAAA,IAAAA,KAwCgB3B,UAAU,iCACVsB,sBA/CHV,EACbZ,EA+CgB6C,YACInB,eAAW5B,EAACgD,aAAAA,CAAAA,EAAAA,CAAYC,UAAU,OAAOnB,KA1C7DA,AAAAA,KAAAA,IAAAA,EAAOf,IA0CkEa,SAAAA,CAAAA,CAAcsB,GAAAA,KAAAA,CAEnEd,EAAAA,IAEPf,EAAU,WAAA,EAAArB,EAACmD,aAAAA,CAAAA,EAAAA,CAAQ/C,OAAO,SAAY,WAAA,EAAAJ,EAACD,aAAAA,CAAAA,EAAAA,mBACxCC,gBAACW,EAEJqB,OAAAA,CA/COoB,CAAAA,AAAA,KAAA,IAAAA,GAAAA,CAAA,GA+CW7B,GAAUD,eAActB,EAACqD,aAAAA,CAAAA,EAAAA,CAAU/B,KAAMA,EAAMC,MAAOA,IAArC,KAGhD"}
|
|
@@ -7,6 +7,6 @@ interface FullScreenModalProps {
|
|
|
7
7
|
headerChildren?: React.ReactNode;
|
|
8
8
|
showAnimation?: boolean;
|
|
9
9
|
}
|
|
10
|
-
declare const FullScreenModal: React.FC<FullScreenModalProps
|
|
10
|
+
declare const FullScreenModal: React.FC<React.PropsWithChildren<FullScreenModalProps>>;
|
|
11
11
|
|
|
12
12
|
export { type FullScreenModalProps, FullScreenModal as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FullScreenModal.js","sources":["../../../src/components/FullScreenModal/FullScreenModal.tsx"],"sourcesContent":["import React from 'react';\n\nimport cn from 'classnames';\n\nimport BodyPortal from '../BodyPortal';\nimport ScrollableBox from '../ScrollableBox';\nimport { useLockBodyScroll } from './useLockBodyScroll';\n\nimport './FullScreenModal.global.css';\n\nexport interface FullScreenModalProps {\n className?: string;\n headerClassName?: string;\n contentClassName?: string;\n headerChildren?: React.ReactNode;\n showAnimation?: boolean;\n}\nconst FullScreenModal: React.FC<FullScreenModalProps
|
|
1
|
+
{"version":3,"file":"FullScreenModal.js","sources":["../../../src/components/FullScreenModal/FullScreenModal.tsx"],"sourcesContent":["import React from 'react';\n\nimport cn from 'classnames';\n\nimport BodyPortal from '../BodyPortal';\nimport ScrollableBox from '../ScrollableBox';\nimport { useLockBodyScroll } from './useLockBodyScroll';\n\nimport './FullScreenModal.global.css';\n\nexport interface FullScreenModalProps {\n className?: string;\n headerClassName?: string;\n contentClassName?: string;\n headerChildren?: React.ReactNode;\n showAnimation?: boolean;\n}\nconst FullScreenModal: React.FC<React.PropsWithChildren<FullScreenModalProps>> = ({\n children,\n headerChildren,\n className,\n headerClassName,\n contentClassName,\n showAnimation,\n}) => {\n useLockBodyScroll();\n\n return (\n <BodyPortal>\n <div\n className={cn('vchasno-ui-full-screen-modal', className, {\n 'vchasno-ui-full-screen-modal--animation': showAnimation,\n })}\n >\n <header className={cn('vchasno-ui-full-screen-modal__header', headerClassName)}>\n {headerChildren}\n </header>\n <ScrollableBox\n scrollHeight=\"calc(100vh - var(--header-height))\"\n className={cn('vchasno-ui-full-screen-modal__content', contentClassName)}\n >\n {children}\n </ScrollableBox>\n </div>\n </BodyPortal>\n );\n};\n\nexport default FullScreenModal;\n"],"names":["FullScreenModal","param","children","headerChildren","className","headerClassName","contentClassName","showAnimation","useLockBodyScroll","React","createElement","BodyPortal","div","cn","header","ScrollableBox","scrollHeight"],"mappings":"sMAiBA,IAAMA,EAA2E,SAAAC,CAAA,MAC7EC,EAAAA,EAAAA,QAAAA,CACAC,IAAAA,cACAC,CAAAA,EAAAA,EAAAA,UACAC,EAAAA,EAAAA,eAAAA,CACAC,EAAAA,EAAAA,gBAAAA,CACAC,EAAAA,EAAAA,aAAAA,CAIA,OAFAC,IAGI,WAAA,EAAAC,EAAAC,aAAA,CAACC,oBACGF,EAACG,aAAAA,CAAAA,MAAAA,CACGR,UAAWS,EAAG,+BAAgCT,EAAW,CACrD,0CAA2CG,CAC/C,iBAEAE,EAACK,aAAAA,CAAAA,SAAAA,CAAOV,UAAWS,EAAG,uCAAwCR,EACzDF,EAAAA,GAAAA,WAAAA,EAELM,EAACM,aAAAA,CAAAA,EAAAA,CACGC,aAAa,qCACbZ,UAAWS,EAAG,wCAAyCP,EAEtDJ,EAAAA,IAKrB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e from"react";import t from"classnames";import a from"../../icons/clear.js";import r from"../InputMeta/InputMeta.js";import n from"../LabelText/LabelText.js";import l from"../Spinner/Spinner.js";var i=function(i){var o=i.className,s=i.disabled,c=i.startElement,m=i.endElement,p=i.error,u=i.label,b=i.hint,d=i.wide,f=i.required,h=i.loading,v=i.labelProps,E=i.hideEmptyMeta,y=i.dataQa,_=i.isClearable,j=i.onClear,w=i.pulse,O=i.children;return /*#__PURE__*/e.createElement("label",function(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{},r=Object.keys(a);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(a).filter(function(e){return Object.getOwnPropertyDescriptor(a,e).enumerable}))),r.forEach(function(t){var r;r=a[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({"data-qa":y,className:t("vchasno-ui-input",{"--required":f,"--disabled":s,"--wide":d,"--error":p},o)},v),/*#__PURE__*/e.createElement("span",{className:t("vchasno-ui-input__wrapper",{"vchasno-ui-pulse-animation":w})},c&&/*#__PURE__*/e.createElement("span",{className:"vchasno-ui-input__wrapper__start-element"},c),O,u&&/*#__PURE__*/e.createElement(n,null,u),/*#__PURE__*/e.createElement("span",{className:"vchasno-ui-input__feedback"},h&&/*#__PURE__*/e.createElement(l,{height:"100%"}),!h&&_&&/*#__PURE__*/e.createElement("span",{role:"button",onClick:j,className:"vchasno-ui-input__clear-btn"},a)),m),!(void 0!==E&&E)||p||b?/*#__PURE__*/e.createElement(r,{error:p,hint:b}):null)};i.displayName="Input";export{i as default};
|
|
1
|
+
import e from"react";import t from"classnames";import a from"../../icons/clear.js";import r from"../InputMeta/InputMeta.js";import n from"../LabelText/LabelText.js";import l from"../Spinner/Spinner.js";var i=function(i){var o=i.className,s=i.disabled,c=i.startElement,m=i.endElement,p=i.error,u=i.label,b=i.hint,d=i.wide,f=i.required,h=i.loading,v=i.labelProps,E=i.hideEmptyMeta,y=i.dataQa,_=i.isClearable,j=i.onClear,w=i.pulse,O=i.children;return /*#__PURE__*/e.createElement("label",function(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{},r=Object.keys(a);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(a).filter(function(e){return Object.getOwnPropertyDescriptor(a,e).enumerable}))),r.forEach(function(t){var r;r=a[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({"data-qa":y,className:t("vchasno-ui-input",{"--required":f,"--disabled":s,"--wide":d,"--error":p},o)},v),/*#__PURE__*/e.createElement("span",{className:t("vchasno-ui-input__wrapper",{"vchasno-ui-pulse-animation":w&&!s})},c&&/*#__PURE__*/e.createElement("span",{className:"vchasno-ui-input__wrapper__start-element"},c),O,u&&/*#__PURE__*/e.createElement(n,null,u),/*#__PURE__*/e.createElement("span",{className:"vchasno-ui-input__feedback"},h&&/*#__PURE__*/e.createElement(l,{height:"100%"}),!h&&_&&/*#__PURE__*/e.createElement("span",{role:"button",onClick:j,className:"vchasno-ui-input__clear-btn"},a)),m),!(void 0!==E&&E)||p||b?/*#__PURE__*/e.createElement(r,{error:p,hint:b}):null)};i.displayName="Input";export{i as default};
|
|
2
2
|
//# sourceMappingURL=Input.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.js","sources":["../../../src/components/Input/Input.tsx"],"sourcesContent":["import React, { InputHTMLAttributes } from 'react';\n\nimport cn from 'classnames';\n\nimport clearRawSvg from '../../icons/clear';\nimport InputMeta from '../InputMeta';\nimport LabelText from '../LabelText';\nimport Spinner from '../Spinner';\nimport {\n ClearControl,\n DataQa,\n ErrorFeedback,\n HideEmptyMeta,\n LoadingFeedback,\n WithHint,\n WithLabel,\n WithPulseAnimation,\n} from '../types';\n\nimport './Input.global.css';\n\nexport interface InputProps\n extends Partial<\n WithLabel &\n WithHint &\n LoadingFeedback &\n ErrorFeedback &\n DataQa &\n HideEmptyMeta &\n ClearControl &\n WithPulseAnimation\n > {\n className?: string;\n disabled?: boolean;\n required?: boolean;\n wide?: boolean;\n startElement?: string | React.ReactElement;\n endElement?: string | React.ReactElement;\n labelProps?: InputHTMLAttributes<HTMLLabelElement>;\n children: React.ReactHTMLElement<HTMLInputElement> | React.ReactElement | JSX.Element[];\n onClear?: VoidFunction;\n}\n\nconst Input: React.FC<InputProps> = ({\n className,\n disabled,\n startElement,\n endElement,\n error,\n label,\n hint,\n wide,\n required,\n loading,\n labelProps,\n hideEmptyMeta = false,\n dataQa,\n isClearable,\n onClear,\n pulse,\n children,\n}) => {\n return (\n <label\n data-qa={dataQa}\n className={cn(\n 'vchasno-ui-input',\n {\n '--required': required,\n '--disabled': disabled,\n '--wide': wide,\n '--error': error,\n },\n className,\n )}\n {...labelProps}\n >\n <span\n className={cn('vchasno-ui-input__wrapper', {\n 'vchasno-ui-pulse-animation': pulse,\n })}\n >\n {startElement && (\n <span className=\"vchasno-ui-input__wrapper__start-element\">{startElement}</span>\n )}\n {children}\n {label && <LabelText>{label}</LabelText>}\n <span className=\"vchasno-ui-input__feedback\">\n {loading && <Spinner height=\"100%\" />}\n {!loading && isClearable && (\n <span\n role=\"button\"\n onClick={onClear}\n className=\"vchasno-ui-input__clear-btn\"\n >\n {clearRawSvg}\n </span>\n )}\n </span>\n {endElement}\n </span>\n {hideEmptyMeta && !error && !hint ? null : <InputMeta error={error} hint={hint} />}\n </label>\n );\n};\n\nInput.displayName = 'Input';\n\nexport default Input;\n"],"names":["Input","param","className","disabled","startElement","endElement","error","label","hint","wide","required","loading","labelProps","hideEmptyMeta","dataQa","isClearable","onClear","pulse","children","React","data-qa","cn","span","LabelText","Spinner","height","role","onClick","clearRawSvg","InputMeta","displayName"],"mappings":"0MA2CA,IAAMA,EAA8B,SAAAC,CAAA,EAChCC,IAAAA,EAAAA,EAAAA,SACAC,CAAAA,EAAAA,EAAAA,QACAC,CAAAA,EAAAA,EAAAA,aACAC,EAAAA,EAAAA,UAAAA,CACAC,EAAAA,EAAAA,KAAAA,CACAC,EAAAA,EAAAA,KAAAA,CACAC,EAAAA,EAAAA,IAAAA,CACAC,IAAAA,IACAC,CAAAA,EAAAA,EAAAA,QACAC,CAAAA,EAAAA,EAAAA,OACAC,CAAAA,EAAAA,EAAAA,UACAC,CAAAA,EAAAA,EAAAA,aAAAA,CACAC,EAAAA,EAAAA,MACAC,CAAAA,EAAAA,EAAAA,WACAC,CAAAA,EAAAA,EAAAA,OACAC,CAAAA,EAAAA,EAAAA,MACAC,EAAAA,EAAAA,QAAAA,CAEA,OAAA,WAAA,EACIC,EAACZ,aAAAA,CAAAA,QAAAA,iaAAAA,CACGa,UAASN,EACTZ,UAAWmB,EACP,mBACA,CACI,aAAcX,EACd,aAAcP,EACd,SAAUM,EACV,UAAWH,CAEfJ,EAAAA,EAEAU,EAAAA,GAAAA,WAAAA,EAEJO,EAACG,aAAAA,CAAAA,OAAAA,CACGpB,UAAWmB,EAAG,4BAA6B,CACvC,6BAA8BJ,
|
|
1
|
+
{"version":3,"file":"Input.js","sources":["../../../src/components/Input/Input.tsx"],"sourcesContent":["import React, { InputHTMLAttributes } from 'react';\n\nimport cn from 'classnames';\n\nimport clearRawSvg from '../../icons/clear';\nimport InputMeta from '../InputMeta';\nimport LabelText from '../LabelText';\nimport Spinner from '../Spinner';\nimport {\n ClearControl,\n DataQa,\n ErrorFeedback,\n HideEmptyMeta,\n LoadingFeedback,\n WithHint,\n WithLabel,\n WithPulseAnimation,\n} from '../types';\n\nimport './Input.global.css';\n\nexport interface InputProps\n extends Partial<\n WithLabel &\n WithHint &\n LoadingFeedback &\n ErrorFeedback &\n DataQa &\n HideEmptyMeta &\n ClearControl &\n WithPulseAnimation\n > {\n className?: string;\n disabled?: boolean;\n required?: boolean;\n wide?: boolean;\n startElement?: string | React.ReactElement;\n endElement?: string | React.ReactElement;\n labelProps?: InputHTMLAttributes<HTMLLabelElement>;\n children: React.ReactHTMLElement<HTMLInputElement> | React.ReactElement | JSX.Element[];\n onClear?: VoidFunction;\n}\n\nconst Input: React.FC<InputProps> = ({\n className,\n disabled,\n startElement,\n endElement,\n error,\n label,\n hint,\n wide,\n required,\n loading,\n labelProps,\n hideEmptyMeta = false,\n dataQa,\n isClearable,\n onClear,\n pulse,\n children,\n}) => {\n return (\n <label\n data-qa={dataQa}\n className={cn(\n 'vchasno-ui-input',\n {\n '--required': required,\n '--disabled': disabled,\n '--wide': wide,\n '--error': error,\n },\n className,\n )}\n {...labelProps}\n >\n <span\n className={cn('vchasno-ui-input__wrapper', {\n 'vchasno-ui-pulse-animation': pulse && !disabled,\n })}\n >\n {startElement && (\n <span className=\"vchasno-ui-input__wrapper__start-element\">{startElement}</span>\n )}\n {children}\n {label && <LabelText>{label}</LabelText>}\n <span className=\"vchasno-ui-input__feedback\">\n {loading && <Spinner height=\"100%\" />}\n {!loading && isClearable && (\n <span\n role=\"button\"\n onClick={onClear}\n className=\"vchasno-ui-input__clear-btn\"\n >\n {clearRawSvg}\n </span>\n )}\n </span>\n {endElement}\n </span>\n {hideEmptyMeta && !error && !hint ? null : <InputMeta error={error} hint={hint} />}\n </label>\n );\n};\n\nInput.displayName = 'Input';\n\nexport default Input;\n"],"names":["Input","param","className","disabled","startElement","endElement","error","label","hint","wide","required","loading","labelProps","hideEmptyMeta","dataQa","isClearable","onClear","pulse","children","React","data-qa","cn","span","LabelText","Spinner","height","role","onClick","clearRawSvg","InputMeta","displayName"],"mappings":"0MA2CA,IAAMA,EAA8B,SAAAC,CAAA,EAChCC,IAAAA,EAAAA,EAAAA,SACAC,CAAAA,EAAAA,EAAAA,QACAC,CAAAA,EAAAA,EAAAA,aACAC,EAAAA,EAAAA,UAAAA,CACAC,EAAAA,EAAAA,KAAAA,CACAC,EAAAA,EAAAA,KAAAA,CACAC,EAAAA,EAAAA,IAAAA,CACAC,IAAAA,IACAC,CAAAA,EAAAA,EAAAA,QACAC,CAAAA,EAAAA,EAAAA,OACAC,CAAAA,EAAAA,EAAAA,UACAC,CAAAA,EAAAA,EAAAA,aAAAA,CACAC,EAAAA,EAAAA,MACAC,CAAAA,EAAAA,EAAAA,WACAC,CAAAA,EAAAA,EAAAA,OACAC,CAAAA,EAAAA,EAAAA,MACAC,EAAAA,EAAAA,QAAAA,CAEA,OAAA,WAAA,EACIC,EAACZ,aAAAA,CAAAA,QAAAA,iaAAAA,CACGa,UAASN,EACTZ,UAAWmB,EACP,mBACA,CACI,aAAcX,EACd,aAAcP,EACd,SAAUM,EACV,UAAWH,CAEfJ,EAAAA,EAEAU,EAAAA,GAAAA,WAAAA,EAEJO,EAACG,aAAAA,CAAAA,OAAAA,CACGpB,UAAWmB,EAAG,4BAA6B,CACvC,6BAA8BJ,GAAS,CAACd,CAC5C,EAECC,EAAAA,GACG,WAAA,EAAAe,EAACG,aAAAA,CAAAA,OAAAA,CAAKpB,UAAU,0CAA4CE,EAAAA,GAE/Dc,EACAX,GAAAA,WAAAA,EAASY,EAACI,aAAAA,CAAAA,EAAAA,KAAWhB,gBACtBY,EAACG,aAAAA,CAAAA,OAAAA,CAAKpB,UAAU,4BACXS,EAAAA,GAAW,WAAA,EAAAQ,EAACK,aAAAA,CAAAA,EAAAA,CAAQC,OAAO,SAC3B,CAACd,GAAWI,GACT,WAAA,EAAAI,EAACG,aAAAA,CAAAA,OAAAA,CACGI,KAAK,SACLC,QAASX,EACTd,UAAU,6BAET0B,EAAAA,IAIZvB,GAEJQ,cA7CTC,CAAAA,GA6C2BR,GAAUE,eAAcW,EAACU,aAAAA,CAAAA,EAAAA,CAAUvB,MAAOA,EAAOE,KAAMA,IAAtC,KAGhD,CAEAR,CAAAA,EAAM8B,WAAW,CAAG"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e from"react";import t from"react-select/async";import r from"classnames";import o from"../InputMeta/InputMeta.js";import n from"./Label.js";import a from"./customComponents.js";import s from"./defaultProps.js";import{composeStyles as l}from"./utils.js";function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},o=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),o.forEach(function(t){var o;o=r[t],t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o})}return e}var c=function(c){var p,u,m=c.className,d=c.label,f=c.hint,b=c.wide,O=c.required,y=c.isDisabled,g=c.menuPlacement,j=c.noOptionsMessage,v=void 0===j?s.noOptionsMessageDefault:j,P=c.loadingMessage,h=void 0===P?s.loadingMessageDefault:P,M=c.placeholder,w=c.components,S=c.error,D=void 0===S?"":S,E=c.dataQa,q=c.closeMenuOnSelect,x=c.hideEmptyMeta,N=c.pulse,k=function(e,t){if(null==e)return{};var r,o,n=function(e,t){if(null==e)return{};var r,o,n={},a=Object.keys(e);for(o=0;o<a.length;o++)r=a[o],t.indexOf(r)>=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)r=a[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}(c,["className","label","hint","wide","required","isDisabled","menuPlacement","noOptionsMessage","loadingMessage","placeholder","components","error","dataQa","closeMenuOnSelect","hideEmptyMeta","pulse"]);return /*#__PURE__*/e.createElement("label",{"data-qa":E,className:r("vchasno-ui-select",{"--pulse":N,"--required":O,"--disabled":y,"--wide":b,"--error":D},m)},d&&/*#__PURE__*/e.createElement(n,{label:d}),/*#__PURE__*/e.createElement(t,(p=i({required:O,components:i({},a,void 0===w?{}:w),closeMenuOnSelect:void 0===q||q,classNamePrefix:"vchasno-ui-select",menuPlacement:void 0===g?"auto":g,isDisabled:y,noOptionsMessage:v,loadingMessage:h,placeholder:void 0===M?" ":M},k),u=u={styles:i({},l,k.styles)},Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(u)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r.push.apply(r,o)}return r})(Object(u)).forEach(function(e){Object.defineProperty(p,e,Object.getOwnPropertyDescriptor(u,e))}),p)),!(void 0!==x&&x)||D||f?/*#__PURE__*/e.createElement(o,{hint:f,error:D}):null)};export{c as default};
|
|
1
|
+
import e from"react";import t from"react-select/async";import r from"classnames";import o from"../InputMeta/InputMeta.js";import n from"./Label.js";import a from"./customComponents.js";import s from"./defaultProps.js";import{composeStyles as l}from"./utils.js";function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},o=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),o.forEach(function(t){var o;o=r[t],t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o})}return e}var c=function(c){var p,u,m=c.className,d=c.label,f=c.hint,b=c.wide,O=c.required,y=c.isDisabled,g=c.menuPlacement,j=c.noOptionsMessage,v=void 0===j?s.noOptionsMessageDefault:j,P=c.loadingMessage,h=void 0===P?s.loadingMessageDefault:P,M=c.placeholder,w=c.components,S=c.error,D=void 0===S?"":S,E=c.dataQa,q=c.closeMenuOnSelect,x=c.hideEmptyMeta,N=c.pulse,k=function(e,t){if(null==e)return{};var r,o,n=function(e,t){if(null==e)return{};var r,o,n={},a=Object.keys(e);for(o=0;o<a.length;o++)r=a[o],t.indexOf(r)>=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)r=a[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}(c,["className","label","hint","wide","required","isDisabled","menuPlacement","noOptionsMessage","loadingMessage","placeholder","components","error","dataQa","closeMenuOnSelect","hideEmptyMeta","pulse"]);return /*#__PURE__*/e.createElement("label",{"data-qa":E,className:r("vchasno-ui-select",{"--pulse":N&&!y,"--required":O,"--disabled":y,"--wide":b,"--error":D},m)},d&&/*#__PURE__*/e.createElement(n,{label:d}),/*#__PURE__*/e.createElement(t,(p=i({required:O,components:i({},a,void 0===w?{}:w),closeMenuOnSelect:void 0===q||q,classNamePrefix:"vchasno-ui-select",menuPlacement:void 0===g?"auto":g,isDisabled:y,noOptionsMessage:v,loadingMessage:h,placeholder:void 0===M?" ":M},k),u=u={styles:i({},l,k.styles)},Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(u)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r.push.apply(r,o)}return r})(Object(u)).forEach(function(e){Object.defineProperty(p,e,Object.getOwnPropertyDescriptor(u,e))}),p)),!(void 0!==x&&x)||D||f?/*#__PURE__*/e.createElement(o,{hint:f,error:D}):null)};export{c as default};
|
|
2
2
|
//# sourceMappingURL=AsyncSelect.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AsyncSelect.js","sources":["../../../src/components/Select/AsyncSelect.tsx"],"sourcesContent":["import React from 'react';\nimport { GroupBase } from 'react-select';\nimport ReactAsyncSelect, { AsyncProps as ReactAsyncSelectProps } from 'react-select/async';\n\nimport cn from 'classnames';\n\nimport InputMeta from '../InputMeta';\nimport {\n DataQa,\n ErrorFeedback,\n HideEmptyMeta,\n WithHint,\n WithLabel,\n WithPulseAnimation,\n} from '../types';\nimport Label from './Label';\nimport { SelectCreatableProps } from './SelectCreatable';\nimport CustomComponents from './customComponents';\nimport defaultProps from './defaultProps';\nimport { Option } from './types';\nimport { composeStyles } from './utils';\n\nimport './Select.global.css';\n\nexport interface AsyncSelectProps\n extends ReactAsyncSelectProps<Option, false | true, GroupBase<Option>>,\n Partial<\n WithLabel & WithHint & ErrorFeedback & DataQa & HideEmptyMeta & WithPulseAnimation\n > {\n wide?: boolean;\n}\n\nconst AsyncSelect: React.FC<AsyncSelectProps> = ({\n className,\n label,\n hint,\n wide,\n required,\n isDisabled,\n menuPlacement = 'auto',\n noOptionsMessage = defaultProps.noOptionsMessageDefault,\n loadingMessage = defaultProps.loadingMessageDefault,\n placeholder = ' ', //need \"space\" for correct label working\n components = {},\n error = '',\n dataQa,\n closeMenuOnSelect = true,\n hideEmptyMeta = false,\n pulse,\n ...rest\n}) => {\n return (\n <label\n data-qa={dataQa}\n className={cn(\n 'vchasno-ui-select',\n {\n '--pulse': pulse,\n '--required': required,\n '--disabled': isDisabled,\n '--wide': wide,\n '--error': error,\n },\n className,\n )}\n >\n {label && <Label label={label} />}\n <ReactAsyncSelect\n required={required}\n components={{\n ...(CustomComponents as SelectCreatableProps['components']),\n ...components,\n }}\n closeMenuOnSelect={closeMenuOnSelect}\n classNamePrefix=\"vchasno-ui-select\"\n menuPlacement={menuPlacement}\n isDisabled={isDisabled}\n noOptionsMessage={noOptionsMessage}\n loadingMessage={loadingMessage}\n placeholder={placeholder}\n {...rest}\n styles={\n {\n ...composeStyles,\n ...rest.styles,\n } as never\n }\n />\n {hideEmptyMeta && !error && !hint ? null : <InputMeta hint={hint} error={error} />}\n </label>\n );\n};\n\nexport default AsyncSelect;\n"],"names":["AsyncSelect","_param","className","label","hint","wide","required","isDisabled","menuPlacement","noOptionsMessage","defaultProps","noOptionsMessageDefault","loadingMessage","loadingMessageDefault","_param_loadingMessage","_param_placeholder","placeholder","_param_components","components","error","dataQa","closeMenuOnSelect","_param_hideEmptyMeta","hideEmptyMeta","pulse","rest","React","data-qa","cn","Label","ReactAsyncSelect","_object_spread","CustomComponents","_param_closeMenuOnSelect","classNamePrefix","styles","composeStyles","InputMeta"],"mappings":"uqBAgCA,IAAMA,EAA0C,SAAAC,CAAA,EAC5CC,QAAAA,EAAAA,EAAAA,UACAC,EAAAA,EAAAA,KAAAA,CACAC,IAAAA,IACAC,CAAAA,EAAAA,EAAAA,KACAC,EAAAA,EAAAA,QAAAA,CACAC,IAAAA,UACAC,CAAAA,EAAAA,EAAAA,aAAAA,CACAC,EAAAA,EAAAA,gBAAAA,CAAAA,aAAmBC,EAAaC,uBAAuB,OACvDC,cAAAA,CAAAA,EAAAA,AAAAA,KAAAA,IAAAA,EAAiBF,EAAaG,qBAAqB,CAAAC,EAAAC,EAAAd,EACnDe,YAAcC,EAAAhB,EACdiB,eACAC,KAAAA,CAAAA,EAAAA,AAAAA,KAAAA,IAAAA,EAAQ,KACRC,EAAAA,EAAAA,MAAAA,CAAAA,EAAAA,EACAC,kBAAoBC,EAAArB,EACpBsB,cACAC,IAAAA,KACGC,CAAAA,EAAAA,sXAAAA,EAAAA,CAhBHvB,YACAC,QACAC,OACAC,OACAC,WACAC,aACAC,gBACAC,mBACAG,iBACAI,cACAE,aACAC,QACAC,SACAC,oBACAE,gBACAC,UAGA,oBACIE,EAACvB,aAAAA,CAAAA,QAAAA,CACGwB,UAASP,EACTlB,UAAW0B,EACP,oBACA,CACI,UAAWJ,
|
|
1
|
+
{"version":3,"file":"AsyncSelect.js","sources":["../../../src/components/Select/AsyncSelect.tsx"],"sourcesContent":["import React from 'react';\nimport { GroupBase } from 'react-select';\nimport ReactAsyncSelect, { AsyncProps as ReactAsyncSelectProps } from 'react-select/async';\n\nimport cn from 'classnames';\n\nimport InputMeta from '../InputMeta';\nimport {\n DataQa,\n ErrorFeedback,\n HideEmptyMeta,\n WithHint,\n WithLabel,\n WithPulseAnimation,\n} from '../types';\nimport Label from './Label';\nimport { SelectCreatableProps } from './SelectCreatable';\nimport CustomComponents from './customComponents';\nimport defaultProps from './defaultProps';\nimport { Option } from './types';\nimport { composeStyles } from './utils';\n\nimport './Select.global.css';\n\nexport interface AsyncSelectProps\n extends ReactAsyncSelectProps<Option, false | true, GroupBase<Option>>,\n Partial<\n WithLabel & WithHint & ErrorFeedback & DataQa & HideEmptyMeta & WithPulseAnimation\n > {\n wide?: boolean;\n}\n\nconst AsyncSelect: React.FC<AsyncSelectProps> = ({\n className,\n label,\n hint,\n wide,\n required,\n isDisabled,\n menuPlacement = 'auto',\n noOptionsMessage = defaultProps.noOptionsMessageDefault,\n loadingMessage = defaultProps.loadingMessageDefault,\n placeholder = ' ', //need \"space\" for correct label working\n components = {},\n error = '',\n dataQa,\n closeMenuOnSelect = true,\n hideEmptyMeta = false,\n pulse,\n ...rest\n}) => {\n return (\n <label\n data-qa={dataQa}\n className={cn(\n 'vchasno-ui-select',\n {\n '--pulse': pulse && !isDisabled,\n '--required': required,\n '--disabled': isDisabled,\n '--wide': wide,\n '--error': error,\n },\n className,\n )}\n >\n {label && <Label label={label} />}\n <ReactAsyncSelect\n required={required}\n components={{\n ...(CustomComponents as SelectCreatableProps['components']),\n ...components,\n }}\n closeMenuOnSelect={closeMenuOnSelect}\n classNamePrefix=\"vchasno-ui-select\"\n menuPlacement={menuPlacement}\n isDisabled={isDisabled}\n noOptionsMessage={noOptionsMessage}\n loadingMessage={loadingMessage}\n placeholder={placeholder}\n {...rest}\n styles={\n {\n ...composeStyles,\n ...rest.styles,\n } as never\n }\n />\n {hideEmptyMeta && !error && !hint ? null : <InputMeta hint={hint} error={error} />}\n </label>\n );\n};\n\nexport default AsyncSelect;\n"],"names":["AsyncSelect","_param","className","label","hint","wide","required","isDisabled","menuPlacement","noOptionsMessage","defaultProps","noOptionsMessageDefault","loadingMessage","loadingMessageDefault","_param_loadingMessage","_param_placeholder","placeholder","_param_components","components","error","dataQa","closeMenuOnSelect","_param_hideEmptyMeta","hideEmptyMeta","pulse","rest","React","data-qa","cn","Label","ReactAsyncSelect","_object_spread","CustomComponents","_param_closeMenuOnSelect","classNamePrefix","styles","composeStyles","InputMeta"],"mappings":"uqBAgCA,IAAMA,EAA0C,SAAAC,CAAA,EAC5CC,QAAAA,EAAAA,EAAAA,UACAC,EAAAA,EAAAA,KAAAA,CACAC,IAAAA,IACAC,CAAAA,EAAAA,EAAAA,KACAC,EAAAA,EAAAA,QAAAA,CACAC,IAAAA,UACAC,CAAAA,EAAAA,EAAAA,aAAAA,CACAC,EAAAA,EAAAA,gBAAAA,CAAAA,aAAmBC,EAAaC,uBAAuB,OACvDC,cAAAA,CAAAA,EAAAA,AAAAA,KAAAA,IAAAA,EAAiBF,EAAaG,qBAAqB,CAAAC,EAAAC,EAAAd,EACnDe,YAAcC,EAAAhB,EACdiB,eACAC,KAAAA,CAAAA,EAAAA,AAAAA,KAAAA,IAAAA,EAAQ,KACRC,EAAAA,EAAAA,MAAAA,CAAAA,EAAAA,EACAC,kBAAoBC,EAAArB,EACpBsB,cACAC,IAAAA,KACGC,CAAAA,EAAAA,sXAAAA,EAAAA,CAhBHvB,YACAC,QACAC,OACAC,OACAC,WACAC,aACAC,gBACAC,mBACAG,iBACAI,cACAE,aACAC,QACAC,SACAC,oBACAE,gBACAC,UAGA,oBACIE,EAACvB,aAAAA,CAAAA,QAAAA,CACGwB,UAASP,EACTlB,UAAW0B,EACP,oBACA,CACI,UAAWJ,GAAS,CAACjB,EACrB,aAAcD,EACd,aAAcC,EACd,SAAUF,EACV,UAAWc,CAEfjB,EAAAA,EAGHC,EAAAA,GAAS,WAAA,EAAAuB,EAACG,aAAAA,CAAAA,EAAAA,CAAM1B,MAAOA,IACxB,WAAA,EAAAuB,EAACI,aAAAA,CAAAA,KAAAA,EAAAA,CACGxB,SAAUA,EACVY,WAAYa,KACJC,EA3BPf,AAAA,KAAA,IAAAA,EAAA,MA8BDI,kBA3BQY,AAAA,KAAA,IAAAA,GAAAA,EA4BRC,gBAAgB,oBAChB1B,yBApCI,OAChBC,EAoCYF,WAAYA,EACZE,iBAAkBA,EAClBG,eAAgBA,EAChBI,YArCED,AAAA,KAAA,IAAAA,EAAA,IAAAA,CAsCEU,EAAAA,OAAAA,CACJU,OACIJ,EAAA,CAAA,EACOK,EACAX,EAAKU,MAAM,CAIzBZ,+UAAAA,CAzCOD,CAAAA,AAAA,KAAA,IAAAA,GAAAA,CAAA,GAyCWH,GAAUf,EAAc,WAAA,EAAAsB,EAACW,aAAAA,CAAAA,EAAAA,CAAUjC,KAAMA,EAAMe,MAAOA,IAArC,KAGhD"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e from"react";import t,{components as r}from"react-select";import o from"classnames";import n from"../InputMeta/InputMeta.js";import a from"./Label.js";import s from"./customComponents.js";import l from"./defaultProps.js";import{composeStyles as i}from"./utils.js";function c(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},o=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),o.forEach(function(t){var o;o=r[t],t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o})}return e}var p=function(r){var p,u,m=r.className,d=r.label,f=r.hint,b=r.wide,O=r.required,g=r.loading,y=r.isDisabled,j=r.menuPlacement,v=r.noOptionsMessage,P=void 0===v?l.noOptionsMessageDefault:v,h=r.loadingMessage,M=void 0===h?l.loadingMessageDefault:h,w=r.placeholder,S=r.components,D=r.error,E=void 0===D?"":D,q=r.dataQa,x=r.closeMenuOnSelect,N=r.hideEmptyMeta,k=r.pulse,I=function(e,t){if(null==e)return{};var r,o,n=function(e,t){if(null==e)return{};var r,o,n={},a=Object.keys(e);for(o=0;o<a.length;o++)r=a[o],t.indexOf(r)>=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)r=a[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}(r,["className","label","hint","wide","required","loading","isDisabled","menuPlacement","noOptionsMessage","loadingMessage","placeholder","components","error","dataQa","closeMenuOnSelect","hideEmptyMeta","pulse"]);return /*#__PURE__*/e.createElement("label",{"data-qa":q,className:o("vchasno-ui-select",{"--pulse":k,"--required":O,"--disabled":y,"--wide":b,"--error":E},m)},d&&/*#__PURE__*/e.createElement(a,{label:d}),/*#__PURE__*/e.createElement(t,(p=c({required:O,isLoading:g,components:c({},s,void 0===S?{}:S),closeMenuOnSelect:void 0===x||x,classNamePrefix:"vchasno-ui-select",menuPlacement:void 0===j?"auto":j,isDisabled:y,noOptionsMessage:P,loadingMessage:M,placeholder:void 0===w?" ":w},I),u=u={styles:c({},i,I.styles)},Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(u)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r.push.apply(r,o)}return r})(Object(u)).forEach(function(e){Object.defineProperty(p,e,Object.getOwnPropertyDescriptor(u,e))}),p)),!(void 0!==N&&N)||E||f?/*#__PURE__*/e.createElement(n,{hint:f,error:E}):null)},u=r;export{u as SelectComponents,p as default};
|
|
1
|
+
import e from"react";import t,{components as r}from"react-select";import o from"classnames";import n from"../InputMeta/InputMeta.js";import a from"./Label.js";import s from"./customComponents.js";import l from"./defaultProps.js";import{composeStyles as i}from"./utils.js";function c(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},o=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),o.forEach(function(t){var o;o=r[t],t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o})}return e}var p=function(r){var p,u,m=r.className,d=r.label,f=r.hint,b=r.wide,O=r.required,g=r.loading,y=r.isDisabled,j=r.menuPlacement,v=r.noOptionsMessage,P=void 0===v?l.noOptionsMessageDefault:v,h=r.loadingMessage,M=void 0===h?l.loadingMessageDefault:h,w=r.placeholder,S=r.components,D=r.error,E=void 0===D?"":D,q=r.dataQa,x=r.closeMenuOnSelect,N=r.hideEmptyMeta,k=r.pulse,I=function(e,t){if(null==e)return{};var r,o,n=function(e,t){if(null==e)return{};var r,o,n={},a=Object.keys(e);for(o=0;o<a.length;o++)r=a[o],t.indexOf(r)>=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)r=a[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}(r,["className","label","hint","wide","required","loading","isDisabled","menuPlacement","noOptionsMessage","loadingMessage","placeholder","components","error","dataQa","closeMenuOnSelect","hideEmptyMeta","pulse"]);return /*#__PURE__*/e.createElement("label",{"data-qa":q,className:o("vchasno-ui-select",{"--pulse":k&&!y,"--required":O,"--disabled":y,"--wide":b,"--error":E},m)},d&&/*#__PURE__*/e.createElement(a,{label:d}),/*#__PURE__*/e.createElement(t,(p=c({required:O,isLoading:g,components:c({},s,void 0===S?{}:S),closeMenuOnSelect:void 0===x||x,classNamePrefix:"vchasno-ui-select",menuPlacement:void 0===j?"auto":j,isDisabled:y,noOptionsMessage:P,loadingMessage:M,placeholder:void 0===w?" ":w},I),u=u={styles:c({},i,I.styles)},Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(u)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r.push.apply(r,o)}return r})(Object(u)).forEach(function(e){Object.defineProperty(p,e,Object.getOwnPropertyDescriptor(u,e))}),p)),!(void 0!==N&&N)||E||f?/*#__PURE__*/e.createElement(n,{hint:f,error:E}):null)},u=r;export{u as SelectComponents,p as default};
|
|
2
2
|
//# sourceMappingURL=Select.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.js","sources":["../../../src/components/Select/Select.tsx"],"sourcesContent":["import React from 'react';\nimport ReactSelect, { GroupBase, Props as ReactSelectProps, components } from 'react-select';\n\nimport cn from 'classnames';\n\nimport InputMeta from '../InputMeta';\nimport {\n DataQa,\n ErrorFeedback,\n HideEmptyMeta,\n LoadingFeedback,\n WithHint,\n WithLabel,\n WithPulseAnimation,\n} from '../types';\nimport Label from './Label';\nimport { SelectCreatableProps } from './SelectCreatable';\nimport CustomComponents from './customComponents';\nimport defaultProps from './defaultProps';\nimport { Option } from './types';\nimport { composeStyles } from './utils';\n\nimport './Select.global.css';\n\nexport interface SelectProps\n extends ReactSelectProps<Option, false | true, GroupBase<Option>>,\n Partial<\n WithLabel &\n WithHint &\n LoadingFeedback &\n ErrorFeedback &\n DataQa &\n HideEmptyMeta &\n WithPulseAnimation\n > {\n wide?: boolean;\n}\n\nconst Select: React.FC<SelectProps> = ({\n className,\n label,\n hint,\n wide,\n required,\n loading,\n isDisabled,\n menuPlacement = 'auto',\n noOptionsMessage = defaultProps.noOptionsMessageDefault,\n loadingMessage = defaultProps.loadingMessageDefault,\n placeholder = ' ', //need \"space\" for correct label working\n components = {},\n error = '',\n dataQa,\n closeMenuOnSelect = true,\n hideEmptyMeta = false,\n pulse,\n ...rest\n}) => {\n return (\n <label\n data-qa={dataQa}\n className={cn(\n 'vchasno-ui-select',\n {\n '--pulse': pulse,\n '--required': required,\n '--disabled': isDisabled,\n '--wide': wide,\n '--error': error,\n },\n className,\n )}\n >\n {label && <Label label={label} />}\n <ReactSelect\n required={required}\n isLoading={loading}\n components={{\n ...(CustomComponents as SelectCreatableProps['components']),\n ...components,\n }}\n closeMenuOnSelect={closeMenuOnSelect}\n classNamePrefix=\"vchasno-ui-select\"\n menuPlacement={menuPlacement}\n isDisabled={isDisabled}\n noOptionsMessage={noOptionsMessage}\n loadingMessage={loadingMessage}\n placeholder={placeholder}\n {...rest}\n styles={\n {\n ...composeStyles,\n ...rest.styles,\n } as never\n }\n />\n {hideEmptyMeta && !error && !hint ? null : <InputMeta hint={hint} error={error} />}\n </label>\n );\n};\n\nexport const SelectComponents = components;\n\nexport default Select;\n"],"names":["Select","_param","className","label","hint","wide","required","loading","isDisabled","menuPlacement","_param_noOptionsMessage","noOptionsMessage","defaultProps","noOptionsMessageDefault","loadingMessage","loadingMessageDefault","placeholder","components","error","dataQa","closeMenuOnSelect","hideEmptyMeta","pulse","rest","React","data-qa","cn","Label","ReactSelect","isLoading","_object_spread","CustomComponents","classNamePrefix","_param_menuPlacement","styles","composeStyles","InputMeta","SelectComponents"],"mappings":"krBAsCA,IAAMA,EAAgC,SAAAC,CAAA,UAClCC,EAAAA,EAAAA,SAAAA,CACAC,IAAAA,KACAC,CAAAA,EAAAA,EAAAA,KACAC,EAAAA,EAAAA,IAAAA,CACAC,IAAAA,QACAC,CAAAA,EAAAA,EAAAA,QACAC,EAAAA,EAAAA,UAAAA,CAAAA,EAAAA,EACAC,cAAgBC,EAAAT,EAChBU,iBAAAA,EAAmBC,AAAAA,KAAAA,IAAAA,EAAAA,EAAaC,uBAAuB,CACvDC,EAAAA,EAAAA,EAAAA,cAAAA,CAAAA,aAAiBF,EAAaG,qBAAqB,OACnDC,WAAAA,KACAC,UAAAA,CACAC,EAAAA,EAAAA,KAAAA,CAAAA,aAAQ,GACRC,EAAAA,EAAAA,EAAAA,WACAC,iBAAAA,KACAC,aAAAA,CACAC,EAAAA,EAAAA,KACGC,CAAAA,EAAAA,sXAAAA,EAAAA,CAjBHrB,YACAC,QACAC,OACAC,OACAC,WACAC,UACAC,aACAC,gBACAE,mBACAG,iBACAE,cACAC,aACAC,QACAC,SACAC,oBACAC,gBACAC,UAGA,oBACIE,EAACrB,aAAAA,CAAAA,QAAAA,CACGsB,UAASN,EACTjB,UAAWwB,EACP,oBACA,CACI,UAAWJ,
|
|
1
|
+
{"version":3,"file":"Select.js","sources":["../../../src/components/Select/Select.tsx"],"sourcesContent":["import React from 'react';\nimport ReactSelect, { GroupBase, Props as ReactSelectProps, components } from 'react-select';\n\nimport cn from 'classnames';\n\nimport InputMeta from '../InputMeta';\nimport {\n DataQa,\n ErrorFeedback,\n HideEmptyMeta,\n LoadingFeedback,\n WithHint,\n WithLabel,\n WithPulseAnimation,\n} from '../types';\nimport Label from './Label';\nimport { SelectCreatableProps } from './SelectCreatable';\nimport CustomComponents from './customComponents';\nimport defaultProps from './defaultProps';\nimport { Option } from './types';\nimport { composeStyles } from './utils';\n\nimport './Select.global.css';\n\nexport interface SelectProps\n extends ReactSelectProps<Option, false | true, GroupBase<Option>>,\n Partial<\n WithLabel &\n WithHint &\n LoadingFeedback &\n ErrorFeedback &\n DataQa &\n HideEmptyMeta &\n WithPulseAnimation\n > {\n wide?: boolean;\n}\n\nconst Select: React.FC<SelectProps> = ({\n className,\n label,\n hint,\n wide,\n required,\n loading,\n isDisabled,\n menuPlacement = 'auto',\n noOptionsMessage = defaultProps.noOptionsMessageDefault,\n loadingMessage = defaultProps.loadingMessageDefault,\n placeholder = ' ', //need \"space\" for correct label working\n components = {},\n error = '',\n dataQa,\n closeMenuOnSelect = true,\n hideEmptyMeta = false,\n pulse,\n ...rest\n}) => {\n return (\n <label\n data-qa={dataQa}\n className={cn(\n 'vchasno-ui-select',\n {\n '--pulse': pulse && !isDisabled,\n '--required': required,\n '--disabled': isDisabled,\n '--wide': wide,\n '--error': error,\n },\n className,\n )}\n >\n {label && <Label label={label} />}\n <ReactSelect\n required={required}\n isLoading={loading}\n components={{\n ...(CustomComponents as SelectCreatableProps['components']),\n ...components,\n }}\n closeMenuOnSelect={closeMenuOnSelect}\n classNamePrefix=\"vchasno-ui-select\"\n menuPlacement={menuPlacement}\n isDisabled={isDisabled}\n noOptionsMessage={noOptionsMessage}\n loadingMessage={loadingMessage}\n placeholder={placeholder}\n {...rest}\n styles={\n {\n ...composeStyles,\n ...rest.styles,\n } as never\n }\n />\n {hideEmptyMeta && !error && !hint ? null : <InputMeta hint={hint} error={error} />}\n </label>\n );\n};\n\nexport const SelectComponents = components;\n\nexport default Select;\n"],"names":["Select","_param","className","label","hint","wide","required","loading","isDisabled","menuPlacement","_param_noOptionsMessage","noOptionsMessage","defaultProps","noOptionsMessageDefault","loadingMessage","loadingMessageDefault","placeholder","components","error","dataQa","closeMenuOnSelect","hideEmptyMeta","pulse","rest","React","data-qa","cn","Label","ReactSelect","isLoading","_object_spread","CustomComponents","classNamePrefix","_param_menuPlacement","styles","composeStyles","InputMeta","SelectComponents"],"mappings":"krBAsCA,IAAMA,EAAgC,SAAAC,CAAA,UAClCC,EAAAA,EAAAA,SAAAA,CACAC,IAAAA,KACAC,CAAAA,EAAAA,EAAAA,KACAC,EAAAA,EAAAA,IAAAA,CACAC,IAAAA,QACAC,CAAAA,EAAAA,EAAAA,QACAC,EAAAA,EAAAA,UAAAA,CAAAA,EAAAA,EACAC,cAAgBC,EAAAT,EAChBU,iBAAAA,EAAmBC,AAAAA,KAAAA,IAAAA,EAAAA,EAAaC,uBAAuB,CACvDC,EAAAA,EAAAA,EAAAA,cAAAA,CAAAA,aAAiBF,EAAaG,qBAAqB,OACnDC,WAAAA,KACAC,UAAAA,CACAC,EAAAA,EAAAA,KAAAA,CAAAA,aAAQ,GACRC,EAAAA,EAAAA,EAAAA,WACAC,iBAAAA,KACAC,aAAAA,CACAC,EAAAA,EAAAA,KACGC,CAAAA,EAAAA,sXAAAA,EAAAA,CAjBHrB,YACAC,QACAC,OACAC,OACAC,WACAC,UACAC,aACAC,gBACAE,mBACAG,iBACAE,cACAC,aACAC,QACAC,SACAC,oBACAC,gBACAC,UAGA,oBACIE,EAACrB,aAAAA,CAAAA,QAAAA,CACGsB,UAASN,EACTjB,UAAWwB,EACP,oBACA,CACI,UAAWJ,GAAS,CAACd,EACrB,aAAcF,EACd,aAAcE,EACd,SAAUH,EACV,UAAWa,CAEfhB,EAAAA,EAGHC,EAAAA,GAAS,WAAA,EAAAqB,EAACG,aAAAA,CAAAA,EAAAA,CAAMxB,MAAOA,IACxB,WAAA,EAAAqB,EAACI,aAAAA,CAAAA,KAAAA,EAAAA,CACGtB,SAAUA,EACVuB,UAAWtB,EACXU,WAAYa,KACJC,EA5BpBd,AAAAA,KAAAA,IAAAA,EAAa,GACbC,GA8BYE,kBA5BZA,AAAAA,KAAAA,IAAAA,KA6BYY,gBAAgB,oBAChBvB,cArCIwB,AAAA,KAAA,IAAAA,EAAA,OAAAA,EAsCJzB,WAAYA,EACZG,iBAAkBA,EAClBG,eAAgBA,EAChBE,YAtCZA,AAAAA,KAAAA,IAAAA,EAAc,KAuCEO,EAAAA,OAAAA,CACJW,OACIJ,EAAA,CAAA,EACOK,EACAZ,EAAKW,MAAM,CAIzBb,+UAAAA,CA1CTA,CAAAA,AAAAA,KAAAA,IAAAA,GACAC,CAAAA,GAyC2BJ,GAAUd,EAAc,WAAA,EAAAoB,EAACY,aAAAA,CAAAA,EAAAA,CAAUhC,KAAMA,EAAMc,MAAOA,IAArC,KAGhD,EAEamB,EAAmBpB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e from"react";import t from"react-select/creatable";import r from"classnames";import o from"../InputMeta/InputMeta.js";import a from"./Label.js";import n from"./customComponents.js";import l from"./defaultProps.js";import{composeStyles as s}from"./utils.js";function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},o=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),o.forEach(function(t){var o;o=r[t],t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o})}return e}function c(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r.push.apply(r,o)}return r})(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}var p=function(p){var u=p.className,m=p.label,b=p.hint,d=p.wide,f=p.required,O=p.loading,g=p.isDisabled,y=p.menuPlacement,j=p.noOptionsMessage,P=void 0===j?l.noOptionsMessageDefault:j,v=p.loadingMessage,h=void 0===v?l.loadingMessageDefault:v,w=p.placeholder,M=p.components,D=p.isClearable,E=p.dataQa,S=p.labelProps,q=p.hideEmptyMeta,C=p.pulse,x=p.error,N=function(e,t){if(null==e)return{};var r,o,a=function(e,t){if(null==e)return{};var r,o,a={},n=Object.keys(e);for(o=0;o<n.length;o++)r=n[o],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(o=0;o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(p,["className","label","hint","wide","required","loading","isDisabled","menuPlacement","noOptionsMessage","loadingMessage","placeholder","components","isClearable","dataQa","labelProps","hideEmptyMeta","pulse","error"]);return /*#__PURE__*/e.createElement("label",c(i({},S),{"data-qa":E,className:r("vchasno-ui-select",{"--pulse":C,"--required":f,"--disabled":g,"--wide":d,"--error":x},u)}),m&&/*#__PURE__*/e.createElement(a,{label:m}),/*#__PURE__*/e.createElement(t,c(i({isClearable:D,required:f,isLoading:O,components:i({},n,void 0===M?{}:M),classNamePrefix:"vchasno-ui-select",menuPlacement:void 0===y?"auto":y,isDisabled:g,noOptionsMessage:P,loadingMessage:h,placeholder:void 0===w?" ":w},N),{styles:i({},s,N.styles)})),!(void 0!==q&&q)||x||b?/*#__PURE__*/e.createElement(o,{hint:b,error:x}):null)};export{p as default};
|
|
1
|
+
import e from"react";import t from"react-select/creatable";import r from"classnames";import o from"../InputMeta/InputMeta.js";import a from"./Label.js";import n from"./customComponents.js";import l from"./defaultProps.js";import{composeStyles as s}from"./utils.js";function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},o=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),o.forEach(function(t){var o;o=r[t],t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o})}return e}function c(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r.push.apply(r,o)}return r})(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}var p=function(p){var u=p.className,m=p.label,b=p.hint,d=p.wide,f=p.required,O=p.loading,g=p.isDisabled,y=p.menuPlacement,j=p.noOptionsMessage,P=void 0===j?l.noOptionsMessageDefault:j,v=p.loadingMessage,h=void 0===v?l.loadingMessageDefault:v,w=p.placeholder,M=p.components,D=p.isClearable,E=p.dataQa,S=p.labelProps,q=p.hideEmptyMeta,C=p.pulse,x=p.error,N=function(e,t){if(null==e)return{};var r,o,a=function(e,t){if(null==e)return{};var r,o,a={},n=Object.keys(e);for(o=0;o<n.length;o++)r=n[o],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(o=0;o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(p,["className","label","hint","wide","required","loading","isDisabled","menuPlacement","noOptionsMessage","loadingMessage","placeholder","components","isClearable","dataQa","labelProps","hideEmptyMeta","pulse","error"]);return /*#__PURE__*/e.createElement("label",c(i({},S),{"data-qa":E,className:r("vchasno-ui-select",{"--pulse":C&&!g,"--required":f,"--disabled":g,"--wide":d,"--error":x},u)}),m&&/*#__PURE__*/e.createElement(a,{label:m}),/*#__PURE__*/e.createElement(t,c(i({isClearable:D,required:f,isLoading:O,components:i({},n,void 0===M?{}:M),classNamePrefix:"vchasno-ui-select",menuPlacement:void 0===y?"auto":y,isDisabled:g,noOptionsMessage:P,loadingMessage:h,placeholder:void 0===w?" ":w},N),{styles:i({},s,N.styles)})),!(void 0!==q&&q)||x||b?/*#__PURE__*/e.createElement(o,{hint:b,error:x}):null)};export{p as default};
|
|
2
2
|
//# sourceMappingURL=SelectCreatable.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectCreatable.js","sources":["../../../src/components/Select/SelectCreatable.tsx"],"sourcesContent":["import React, { InputHTMLAttributes } from 'react';\nimport ReactSelectCreatable, { CreatableProps } from 'react-select/creatable';\nimport type { GroupBase } from 'react-select/dist/declarations/src/types';\n\nimport cn from 'classnames';\n\nimport InputMeta from '../InputMeta';\nimport {\n DataQa,\n ErrorFeedback,\n HideEmptyMeta,\n LoadingFeedback,\n WithHint,\n WithLabel,\n WithPulseAnimation,\n} from '../types';\nimport Label from './Label';\nimport CustomComponents from './customComponents';\nimport defaultProps from './defaultProps';\nimport { Option } from './types';\nimport { composeStyles } from './utils';\n\nimport './Select.global.css';\n\nexport type SelectOption = Option;\n\nexport interface SelectCreatableProps\n extends CreatableProps<Option, false | true, GroupBase<Option>>,\n Partial<\n WithLabel &\n WithHint &\n LoadingFeedback &\n ErrorFeedback &\n DataQa &\n HideEmptyMeta &\n WithPulseAnimation\n > {\n wide?: boolean;\n labelProps?: InputHTMLAttributes<HTMLLabelElement>;\n}\n\nconst SelectCreatable: React.FC<SelectCreatableProps> = ({\n className,\n label,\n hint,\n wide,\n required,\n loading,\n isDisabled,\n menuPlacement = 'auto',\n noOptionsMessage = defaultProps.noOptionsMessageDefault,\n loadingMessage = defaultProps.loadingMessageDefault,\n placeholder = ' ', //need \"space\" for correct label working\n components = {},\n isClearable,\n dataQa,\n labelProps,\n hideEmptyMeta = false,\n pulse,\n error,\n ...rest\n}) => {\n return (\n <label\n {...labelProps}\n data-qa={dataQa}\n className={cn(\n 'vchasno-ui-select',\n {\n '--pulse': pulse,\n '--required': required,\n '--disabled': isDisabled,\n '--wide': wide,\n '--error': error,\n },\n className,\n )}\n >\n {label && <Label label={label} />}\n <ReactSelectCreatable\n isClearable={isClearable}\n required={required}\n isLoading={loading}\n components={{\n ...(CustomComponents as SelectCreatableProps['components']),\n ...components,\n }}\n classNamePrefix=\"vchasno-ui-select\"\n menuPlacement={menuPlacement}\n isDisabled={isDisabled}\n noOptionsMessage={noOptionsMessage}\n loadingMessage={loadingMessage}\n placeholder={placeholder}\n {...rest}\n styles={\n {\n ...composeStyles,\n ...rest.styles,\n } as never\n }\n />\n {hideEmptyMeta && !error && !hint ? null : <InputMeta hint={hint} error={error} />}\n </label>\n );\n};\n\nexport default SelectCreatable;\n"],"names":["SelectCreatable","_param","className","label","hint","wide","required","loading","isDisabled","menuPlacement","_param_noOptionsMessage","noOptionsMessage","defaultProps","noOptionsMessageDefault","loadingMessage","loadingMessageDefault","placeholder","components","isClearable","dataQa","labelProps","hideEmptyMeta","pulse","error","rest","React","data-qa","cn","Label","ReactSelectCreatable","isLoading","_object_spread","CustomComponents","classNamePrefix","_param_menuPlacement","styles","composeStyles","InputMeta"],"mappings":"4hCAyCA,IAAMA,EAAkD,SAAAC,CAAA,MACpDC,EAAAA,EAAAA,SAAAA,CACAC,IAAAA,KACAC,CAAAA,EAAAA,EAAAA,KACAC,EAAAA,EAAAA,IAAAA,CACAC,IAAAA,QACAC,CAAAA,EAAAA,EAAAA,QACAC,EAAAA,EAAAA,UAAAA,CAAAA,EAAAA,EACAC,cAAgBC,EAAAT,EAChBU,iBAAAA,EAAmBC,AAAAA,KAAAA,IAAAA,EAAAA,EAAaC,uBAAuB,CACvDC,EAAAA,EAAAA,EAAAA,cAAAA,CAAAA,aAAiBF,EAAaG,qBAAqB,OACnDC,WAAAA,KACAC,UAAAA,CACAC,EAAAA,EAAAA,YACAC,EAAAA,EAAAA,MAAAA,CACAC,IAAAA,UACAC,CAAAA,EAAAA,EAAAA,aAAAA,CACAC,EAAAA,EAAAA,KACAC,CAAAA,EAAAA,EAAAA,KACGC,CAAAA,EAAAA,sXAAAA,EAAAA,CAlBHtB,YACAC,QACAC,OACAC,OACAC,WACAC,UACAC,aACAC,gBACAE,mBACAG,iBACAE,cACAC,aACAC,cACAC,SACAC,aACAC,gBACAC,QACAC,UAGA,OACI,WAAA,EAAAE,gBAACtB,QACOiB,EAAAA,EAAAA,CAAAA,EAAAA,GAAAA,CACJM,UAASP,EACTjB,UAAWyB,EACP,oBACA,CACI,UAAWL,
|
|
1
|
+
{"version":3,"file":"SelectCreatable.js","sources":["../../../src/components/Select/SelectCreatable.tsx"],"sourcesContent":["import React, { InputHTMLAttributes } from 'react';\nimport ReactSelectCreatable, { CreatableProps } from 'react-select/creatable';\nimport type { GroupBase } from 'react-select/dist/declarations/src/types';\n\nimport cn from 'classnames';\n\nimport InputMeta from '../InputMeta';\nimport {\n DataQa,\n ErrorFeedback,\n HideEmptyMeta,\n LoadingFeedback,\n WithHint,\n WithLabel,\n WithPulseAnimation,\n} from '../types';\nimport Label from './Label';\nimport CustomComponents from './customComponents';\nimport defaultProps from './defaultProps';\nimport { Option } from './types';\nimport { composeStyles } from './utils';\n\nimport './Select.global.css';\n\nexport type SelectOption = Option;\n\nexport interface SelectCreatableProps\n extends CreatableProps<Option, false | true, GroupBase<Option>>,\n Partial<\n WithLabel &\n WithHint &\n LoadingFeedback &\n ErrorFeedback &\n DataQa &\n HideEmptyMeta &\n WithPulseAnimation\n > {\n wide?: boolean;\n labelProps?: InputHTMLAttributes<HTMLLabelElement>;\n}\n\nconst SelectCreatable: React.FC<SelectCreatableProps> = ({\n className,\n label,\n hint,\n wide,\n required,\n loading,\n isDisabled,\n menuPlacement = 'auto',\n noOptionsMessage = defaultProps.noOptionsMessageDefault,\n loadingMessage = defaultProps.loadingMessageDefault,\n placeholder = ' ', //need \"space\" for correct label working\n components = {},\n isClearable,\n dataQa,\n labelProps,\n hideEmptyMeta = false,\n pulse,\n error,\n ...rest\n}) => {\n return (\n <label\n {...labelProps}\n data-qa={dataQa}\n className={cn(\n 'vchasno-ui-select',\n {\n '--pulse': pulse && !isDisabled,\n '--required': required,\n '--disabled': isDisabled,\n '--wide': wide,\n '--error': error,\n },\n className,\n )}\n >\n {label && <Label label={label} />}\n <ReactSelectCreatable\n isClearable={isClearable}\n required={required}\n isLoading={loading}\n components={{\n ...(CustomComponents as SelectCreatableProps['components']),\n ...components,\n }}\n classNamePrefix=\"vchasno-ui-select\"\n menuPlacement={menuPlacement}\n isDisabled={isDisabled}\n noOptionsMessage={noOptionsMessage}\n loadingMessage={loadingMessage}\n placeholder={placeholder}\n {...rest}\n styles={\n {\n ...composeStyles,\n ...rest.styles,\n } as never\n }\n />\n {hideEmptyMeta && !error && !hint ? null : <InputMeta hint={hint} error={error} />}\n </label>\n );\n};\n\nexport default SelectCreatable;\n"],"names":["SelectCreatable","_param","className","label","hint","wide","required","loading","isDisabled","menuPlacement","_param_noOptionsMessage","noOptionsMessage","defaultProps","noOptionsMessageDefault","loadingMessage","loadingMessageDefault","placeholder","components","isClearable","dataQa","labelProps","hideEmptyMeta","pulse","error","rest","React","data-qa","cn","Label","ReactSelectCreatable","isLoading","_object_spread","CustomComponents","classNamePrefix","_param_menuPlacement","styles","composeStyles","InputMeta"],"mappings":"4hCAyCA,IAAMA,EAAkD,SAAAC,CAAA,MACpDC,EAAAA,EAAAA,SAAAA,CACAC,IAAAA,KACAC,CAAAA,EAAAA,EAAAA,KACAC,EAAAA,EAAAA,IAAAA,CACAC,IAAAA,QACAC,CAAAA,EAAAA,EAAAA,QACAC,EAAAA,EAAAA,UAAAA,CAAAA,EAAAA,EACAC,cAAgBC,EAAAT,EAChBU,iBAAAA,EAAmBC,AAAAA,KAAAA,IAAAA,EAAAA,EAAaC,uBAAuB,CACvDC,EAAAA,EAAAA,EAAAA,cAAAA,CAAAA,aAAiBF,EAAaG,qBAAqB,OACnDC,WAAAA,KACAC,UAAAA,CACAC,EAAAA,EAAAA,YACAC,EAAAA,EAAAA,MAAAA,CACAC,IAAAA,UACAC,CAAAA,EAAAA,EAAAA,aAAAA,CACAC,EAAAA,EAAAA,KACAC,CAAAA,EAAAA,EAAAA,KACGC,CAAAA,EAAAA,sXAAAA,EAAAA,CAlBHtB,YACAC,QACAC,OACAC,OACAC,WACAC,UACAC,aACAC,gBACAE,mBACAG,iBACAE,cACAC,aACAC,cACAC,SACAC,aACAC,gBACAC,QACAC,UAGA,OACI,WAAA,EAAAE,gBAACtB,QACOiB,EAAAA,EAAAA,CAAAA,EAAAA,GAAAA,CACJM,UAASP,EACTjB,UAAWyB,EACP,oBACA,CACI,UAAWL,GAAS,CAACd,EACrB,aAAcF,EACd,aAAcE,EACd,SAAUH,EACV,UAAWkB,CAEfrB,EAAAA,EAGHC,GAAAA,GAAAA,WAAAA,EAASsB,EAACG,aAAAA,CAAAA,EAAAA,CAAMzB,MAAOA,IACxB,WAAA,EAAAsB,EAACI,aAAAA,CAAAA,EAAAA,EAAAA,EAAAA,CACGX,YAAaA,EACbZ,SAAUA,EACVwB,UAAWvB,EACXU,WAAYc,KACJC,EA/BpBf,AAAAA,KAAAA,IAAAA,EAAa,CACbC,EAAAA,GAiCYe,gBAAgB,oBAChBxB,cAvCIyB,AAAA,KAAA,IAAAA,EAAA,OAAAA,EAwCJ1B,WAAYA,EACZG,iBAAkBA,EAClBG,eAAgBA,EAChBE,YAxCZA,AAAAA,KAAAA,IAAAA,EAAc,KAyCEQ,EAAAA,GAAAA,CACJW,OACIJ,EAAA,CAAA,EACOK,EACAZ,EAAKW,MAAM,CAIzBd,IAAAA,cA3CTC,IA2C2BC,GAAUnB,EAAc,WAAA,EAAAqB,EAACY,aAAAA,CAAAA,EAAAA,CAAUjC,KAAMA,EAAMmB,MAAOA,IAArC,KAGhD"}
|