@foxford/ui 2.0.0-beta-1c48b33-20220712 → 2.0.0-beta-f7fb8e6-20220713
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/components/Checkbox/Checkbox.js +1 -1
- package/components/Checkbox/Checkbox.js.map +1 -1
- package/components/Input/Input.js +1 -1
- package/components/Input/Input.js.map +1 -1
- package/components/Radio/Radio.js +1 -1
- package/components/Radio/Radio.js.map +1 -1
- package/components/Select/Select.js +1 -1
- package/components/Select/Select.js.map +1 -1
- package/components/Textarea/Textarea.js +1 -1
- package/components/Textarea/Textarea.js.map +1 -1
- package/dts/index.d.ts +10 -9
- package/index.cjs.js +1 -1
- package/index.cjs.js.map +1 -1
- package/package.json +1 -1
- package/theme/index.js +1 -1
- package/theme/index.js.map +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e from'@babel/runtime/helpers/objectSpread2';import
|
|
1
|
+
import e from'@babel/runtime/helpers/objectSpread2';import r from'@babel/runtime/helpers/objectWithoutProperties';import{useTheme as l}from'styled-components';import{CheckboxGroup as t}from'./Group.js';import{Root as i}from'./style.js';import{jsxs as s,jsx as a}from'react/jsx-runtime';var d=["children","disabled","error","id","name","size","value","label","fluid","display","width","className","style"];function o(t){var o=void 0===t.checked;var h=l();var{children:c,disabled:n,error:m,id:p,name:f,size:u,value:b,label:x,fluid:k,display:v,width:y=h.defaultInputControlsWidth,className:w,style:g}=t,j=r(t,d);var C=o?{defaultChecked:t.defaultChecked}:{checked:t.checked};return s(i,{className:w,style:g,disabled:n,error:m,htmlFor:p||f,size:u,fluid:k,width:y,display:v,children:[a("input",e(e({},j),{},{id:p||f,name:f,type:"checkbox",value:b,disabled:n},C)),s("svg",{viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:[a("rect",{x:".455",y:".455",width:"19.091",height:"19.091",rx:"5",transform:"translate(0 0)",fill:"#fff",stroke:"#B8B8B8",strokeWidth:"1"}),s("g",{fill:"none",children:[a("rect",{fill:"#48A1E6",width:"20",height:"20",rx:"5"}),a("path",{stroke:"#fff",strokeWidth:"2",d:"M6 9.99l3 3.01 6-6"})]})]}),(x||c)&&a("span",{className:"label",children:x||c})]})}o.defaultProps={disabled:!1,size:'medium',display:'inline-flex',onChange:e=>console.log(e,e.target.value)},o.Group=t,o.displayName='Checkbox';export{o as Checkbox};
|
|
2
2
|
//# sourceMappingURL=Checkbox.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.js","sources":["../../../../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"Checkbox.js","sources":["../../../../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["import { useTheme } from 'styled-components'\nimport { Display } from '../../mixins/display'\nimport { ResponsiveProperty } from '../../mixins/responsive-property'\nimport { SizeInput } from '../../shared/enums/sizeInput'\nimport { BaseProps } from '../../shared/interfaces'\nimport { CheckboxGroup } from './Group'\nimport * as Styled from './style'\n\ntype CheckboxInputHtmlAttributes = Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size' | 'width'>\n\nexport interface CheckboxProps extends BaseProps, Display, CheckboxInputHtmlAttributes {\n /**\n * Children react node\n */\n children?: React.ReactNode\n /**\n * A checkbox can appear disabled and be unable to change states\n */\n disabled?: boolean\n /**\n * Field can show the data contains errors\n */\n error?: boolean\n /**\n * Whether or not checkbox is checked\n */\n checked?: boolean\n /**\n * Value\n */\n value?: string | number\n /**\n * On change handler\n */\n onChange?(_e: React.ChangeEvent<HTMLInputElement>): void\n /**\n * Input element ID\n */\n id?: string\n /**\n * Input element name\n */\n name?: string\n /**\n * Input element label\n */\n label?: string\n /**\n * Checkbox size\n */\n size?: 'small' | 'medium' | 'large' | 'extraLarge' | 's' | 'm' | 'l' | 'xl'\n fluid?: boolean\n /**\n * Width of label. Default is `Theme.defaultInputControlsWidth`\n */\n width?: ResponsiveProperty<'auto' | number | keyof typeof SizeInput>\n}\n\nCheckbox.defaultProps = {\n disabled: false,\n size: 'medium',\n display: 'inline-flex',\n onChange: (e: React.ChangeEvent<HTMLInputElement>) => console.log(e, e.target.value), // eslint-disable-line no-console\n}\n\nCheckbox.Group = CheckboxGroup\n\nCheckbox.displayName = 'Checkbox'\n\n/**\n * Расширен:\n * - [`BaseProps`](#/Миксины)\n * - `React.InputHTMLAttributes<HTMLInputElement>`\n */\nexport function Checkbox(props: typeof Checkbox.defaultProps & CheckboxProps) {\n const uncontrolled = props.checked === undefined\n const theme = useTheme()\n\n const {\n children,\n disabled,\n error,\n id,\n name,\n size,\n value,\n label,\n fluid,\n display,\n width = theme.defaultInputControlsWidth,\n className,\n style,\n ...anotherProps\n } = props\n\n const inputProps = uncontrolled ? { defaultChecked: props.defaultChecked } : { checked: props.checked }\n\n return (\n <Styled.Root\n className={className}\n style={style}\n disabled={disabled}\n error={error}\n htmlFor={id || name}\n size={size}\n fluid={fluid}\n width={width}\n display={display}\n >\n <input\n {...anotherProps}\n id={id || name}\n name={name}\n type='checkbox'\n value={value}\n disabled={disabled}\n {...inputProps}\n />\n <svg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'>\n <rect\n x='.455'\n y='.455'\n width='19.091'\n height='19.091'\n rx='5'\n transform='translate(0 0)'\n fill='#fff'\n stroke='#B8B8B8'\n strokeWidth='1'\n />\n <g fill='none'>\n <rect fill='#48A1E6' width='20' height='20' rx='5' />\n <path stroke='#fff' strokeWidth='2' d='M6 9.99l3 3.01 6-6' />\n </g>\n </svg>\n {(label || children) && <span className='label'>{label || children}</span>}\n </Styled.Root>\n )\n}\n"],"names":["Checkbox","props","uncontrolled","checked","theme","useTheme","children","disabled","error","id","name","size","value","label","fluid","display","width","defaultInputControlsWidth","className","style","anotherProps","_excluded","inputProps","defaultChecked","_jsxs","Styled.Root","htmlFor","_jsx","type","viewBox","xmlns","x","y","height","rx","transform","fill","stroke","strokeWidth","d","defaultProps","onChange","e","console","log","target","Group","CheckboxGroup","displayName"],"mappings":"qZA0EO,SAASA,EAASC,GACvB,IAAMC,WAAeD,EAAME,QAC3B,IAAMC,EAAQC,IAEd,IAAMC,SACJA,EADIC,SAEJA,EAFIC,MAGJA,EAHIC,GAIJA,EAJIC,KAKJA,EALIC,KAMJA,EANIC,MAOJA,EAPIC,MAQJA,EARIC,MASJA,EATIC,QAUJA,EAVIC,MAWJA,EAAQZ,EAAMa,0BAXVC,UAYJA,EAZIC,MAaJA,GAEElB,EADCmB,IACDnB,EAfJoB,GAiBA,IAAMC,EAAapB,EAAe,CAAEqB,eAAgBtB,EAAMsB,gBAAmB,CAAEpB,QAASF,EAAME,SAE9F,OACEqB,EAACC,EAAD,CACEP,UAAWA,EACXC,MAAOA,EACPZ,SAAUA,EACVC,MAAOA,EACPkB,QAASjB,GAAMC,EACfC,KAAMA,EACNG,MAAOA,EACPE,MAAOA,EACPD,QAASA,EATXT,SAAA,CAWEqB,iBACMP,GADN,GAAA,CAEEX,GAAIA,GAAMC,EACVA,KAAMA,EACNkB,KAAK,WACLhB,MAAOA,EACPL,SAAUA,GACNe,IAENE,EAAA,MAAA,CAAKK,QAAQ,YAAYC,MAAM,6BAA/BxB,SACE,CAAAqB,EAAA,OAAA,CACEI,EAAE,OACFC,EAAE,OACFhB,MAAM,SACNiB,OAAO,SACPC,GAAG,IACHC,UAAU,iBACVC,KAAK,OACLC,OAAO,UACPC,YAAY,MAEdd,EAAA,IAAA,CAAGY,KAAK,OAAR9B,SACE,CAAAqB,EAAA,OAAA,CAAMS,KAAK,UAAUpB,MAAM,KAAKiB,OAAO,KAAKC,GAAG,MAC/CP,EAAA,OAAA,CAAMU,OAAO,OAAOC,YAAY,IAAIC,EAAE,8BAGxC1B,GAASP,IAAaqB,EAAA,OAAA,CAAMT,UAAU,QAAhBZ,SAAyBO,GAASP,OA7EhEN,EAASwC,aAAe,CACtBjC,YACAI,KAAM,SACNI,QAAS,cACT0B,SAAWC,GAA2CC,QAAQC,IAAIF,EAAGA,EAAEG,OAAOjC,QAGhFZ,EAAS8C,MAAQC,EAEjB/C,EAASgD,YAAc"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
1
|
+
import t from'@babel/runtime/helpers/objectSpread2';import{useTheme as e}from'styled-components';import{InputPhone as o}from'../Input.Phone/Input.Phone.js';import{Root as r}from'./style.js';import{jsx as s}from'react/jsx-runtime';function n(o){var n=e();var{width:a=n.defaultInputControlsWidth}=o;return s(r,t(t({},o),{},{width:a,mask:o.mask||''}))}n.defaultProps={rounded:!0,type:'text',color:'mineShaft',mask:'',placeholderColor:'silver'},n.Phone=o,n.displayName='Input';export{n as Input};
|
|
2
2
|
//# sourceMappingURL=Input.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.js","sources":["../../../../src/components/Input/Input.tsx"],"sourcesContent":["import { InputState, MaskOptions } from 'react-input-mask'\nimport {
|
|
1
|
+
{"version":3,"file":"Input.js","sources":["../../../../src/components/Input/Input.tsx"],"sourcesContent":["import { InputState, MaskOptions } from 'react-input-mask'\nimport { useTheme } from 'styled-components'\nimport { InputPhone } from '../../components/Input.Phone'\nimport { BaseProps, InputField } from '../../shared/interfaces'\nimport * as Styled from './style'\n\ntype InputHTMLAttributes = Omit<React.InputHTMLAttributes<HTMLInputElement>, 'color' | 'width'>\n\nexport interface InputProps extends BaseProps, InputField, InputHTMLAttributes {\n /**\n * Mask string. Format characters are:\n * * `9`: `0-9`\n * * `a`: `A-Z, a-z`\n * * `\\*`: `A-Z, a-z, 0-9`\n *\n * Any character can be escaped with backslash, which usually will appear as double backslash in JS strings.\n * For example, German phone mask with unremoveable prefix +49 will look like `mask=\"+4\\\\9 99 999 99\"` or `mask={\"+4\\\\\\\\9 99 999 99\"}`\n */\n mask?: string | Array<string | RegExp>\n /**\n * Character to cover unfilled editable parts of mask. Default character is \"_\". If set to null, unfilled parts will be empty, like in ordinary input.\n */\n maskChar?: string | null\n /**\n * Defines format characters with characters as keys and corresponding RegExp string as values. Default ones:\n * ```\n * {\n * \"9\": \"[0-9]\",\n * \"a\": \"[A-Za-z]\",\n * \"*\": \"[A-Za-z0-9]\"\n * }```\n */\n formatChars?: { [key: string]: string }\n /**\n * Show mask even in empty input without focus.\n */\n alwaysShowMask?: boolean\n /**\n * Use inputRef instead of ref if you need input node to manage focus, selection, etc.\n */\n inputRef?: React.Ref<HTMLInputElement>\n\n /**\n * In case you need to implement more complex masking behavior, you can provide\n * beforeMaskedValueChange function to change masked value and cursor position\n * before it will be applied to the input.\n */\n beforeMaskedValueChange?(\n _newState: InputState,\n _oldState: InputState,\n _userInput: string,\n _maskOptions: MaskOptions\n ): InputState\n /**\n * Input type\n */\n type?: string\n dataset?: Record<string, string>\n}\n\nInput.defaultProps = {\n rounded: true,\n type: 'text',\n color: 'mineShaft',\n mask: '',\n placeholderColor: 'silver',\n}\n\nInput.Phone = InputPhone\nInput.displayName = 'Input'\n/**\n * Расширен:\n * - [`BaseProps`](#/Миксины)\n * - [`InputField`](#/Миксины)\n * - `React.InputHTMLAttributes<HTMLInputElement>`\n */\nexport function Input(props: InputProps) {\n const theme = useTheme()\n\n const { width = theme.defaultInputControlsWidth } = props\n\n return <Styled.Root {...props} width={width} mask={props.mask || ''} />\n}\n"],"names":["Input","props","theme","useTheme","width","defaultInputControlsWidth","_jsx","Styled.Root","mask","defaultProps","rounded","type","color","placeholderColor","Phone","InputPhone","displayName"],"mappings":"sOA4EO,SAASA,EAAMC,GACpB,IAAMC,EAAQC,IAEd,IAAMC,MAAEA,EAAQF,EAAMG,2BAA8BJ,EAEpD,OAAOK,EAACC,SAAgBN,GAAjB,GAAA,CAAwBG,MAAOA,EAAOI,KAAMP,EAAMO,MAAQ,MArBnER,EAAMS,aAAe,CACnBC,SAAS,EACTC,KAAM,OACNC,MAAO,YACPJ,KAAM,GACNK,iBAAkB,UAGpBb,EAAMc,MAAQC,EACdf,EAAMgB,YAAc"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e from'@babel/runtime/helpers/objectSpread2';import a from'@babel/runtime/helpers/objectWithoutProperties';import{
|
|
1
|
+
import e from'@babel/runtime/helpers/objectSpread2';import a from'@babel/runtime/helpers/objectWithoutProperties';import{useTheme as s}from'styled-components';import{useClassname as l}from'../../hooks/useClassname.js';import{RadioGroup as r}from'./Group.js';import{Root as i}from'./style.js';import{jsxs as d,jsx as o}from'react/jsx-runtime';var t=["children","disabled","error","id","name","size","value","label","className","width","style","fluid","display"];function m(r){var c=void 0===r.checked;var n=s();var{children:p,disabled:u,error:h,id:f,name:b,size:v,value:y,label:x,className:j,width:k=n.defaultInputControlsWidth,style:w,fluid:g,display:C}=r,N=a(r,t);var z=l(m.displayName,j);var R=c?{defaultChecked:r.defaultChecked}:{checked:r.checked};return d(i,{className:z,style:w,disabled:u,error:h,htmlFor:f||b,size:v,width:k,display:C,fluid:g,children:[o("input",e(e({},N),{},{id:f||b,name:b,type:"radio",value:y,disabled:u},R)),d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",children:[o("circle",{cx:"10",cy:"10",r:"9",stroke:"#727D8A",strokeWidth:"2",fill:"#fff"}),o("circle",{cx:"10",cy:"10",r:"5",fill:"#727D8A"})]}),(x||p)&&o("span",{className:"label",children:x||p})]})}m.defaultProps={disabled:!1,size:'medium',display:'inline-flex',onChange:e=>console.log(e,e.target.value)},m.Group=r,m.displayName='Radio';export{m as Radio};
|
|
2
2
|
//# sourceMappingURL=Radio.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Radio.js","sources":["../../../../src/components/Radio/Radio.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"Radio.js","sources":["../../../../src/components/Radio/Radio.tsx"],"sourcesContent":["import { useTheme } from 'styled-components'\nimport { useClassname } from 'hooks/useClassname'\nimport { BaseProps } from '../../shared/interfaces'\nimport { ResponsiveProperty } from '../../mixins/responsive-property'\nimport { SizeInput } from '../../shared/enums/sizeInput'\nimport { Display } from '../../mixins/display'\nimport { RadioGroup } from './Group'\nimport * as Styled from './style'\n\ntype RadioInputHtmlAttributes = Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size' | 'width'>\n\nexport interface RadioProps extends BaseProps, Display, RadioInputHtmlAttributes {\n /**\n * Field id\n */\n id?: string\n /**\n * Field name\n */\n name?: string\n /**\n * Radio label\n */\n label?: string\n /**\n * On change handler\n */\n onChange?(_e: React.ChangeEvent<HTMLInputElement>): void\n /**\n * Children react node\n */\n children?: React.ReactNode\n /**\n * A Radio can appear disabled and be unable to change states\n */\n disabled?: boolean\n /**\n * Field can show the data contains errors\n */\n error?: boolean\n /**\n * Whether or not Radio is checked\n */\n checked?: boolean\n defaultChecked?: boolean\n /**\n * Checkbox size\n */\n size?: 'small' | 'medium' | 'large'\n /**\n * Value\n */\n value?: string | number\n fluid?: boolean\n /**\n * Width of label. Default is `Theme.defaultInputControlsWidth`\n */\n width?: ResponsiveProperty<'auto' | number | keyof typeof SizeInput>\n}\n\nRadio.defaultProps = {\n disabled: false,\n size: 'medium',\n display: 'inline-flex',\n onChange: (e: React.ChangeEvent<HTMLInputElement>) => console.log(e, e.target.value), // eslint-disable-line no-console\n}\n\nRadio.Group = RadioGroup\nRadio.displayName = 'Radio'\n\n/**\n * Расширен:\n * - [`BaseProps`](#/Миксины)\n * - `React.InputHTMLAttributes<HTMLInputElement>`\n */\nexport function Radio(props: typeof Radio.defaultProps & RadioProps) {\n const uncontrolled = props.checked === undefined\n const theme = useTheme()\n const {\n children,\n disabled,\n error,\n id,\n name,\n size,\n value,\n label,\n className,\n width = theme.defaultInputControlsWidth,\n style,\n fluid,\n display,\n ...anotherProps\n } = props\n const _className = useClassname(Radio.displayName, className)\n\n const inputProps = uncontrolled ? { defaultChecked: props.defaultChecked } : { checked: props.checked }\n\n return (\n <Styled.Root\n className={_className}\n style={style}\n disabled={disabled}\n error={error}\n htmlFor={id || name}\n size={size}\n width={width}\n display={display}\n fluid={fluid}\n >\n <input\n {...anotherProps}\n id={id || name}\n name={name}\n type='radio'\n value={value}\n disabled={disabled}\n {...inputProps}\n />\n <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'>\n <circle cx='10' cy='10' r='9' stroke='#727D8A' strokeWidth='2' fill='#fff' />\n <circle cx='10' cy='10' r='5' fill='#727D8A' />\n </svg>\n {(label || children) && <span className='label'>{label || children}</span>}\n </Styled.Root>\n )\n}\n"],"names":["Radio","props","uncontrolled","checked","theme","useTheme","children","disabled","error","id","name","size","value","label","className","width","defaultInputControlsWidth","style","fluid","display","anotherProps","_excluded","_className","useClassname","displayName","inputProps","defaultChecked","_jsxs","Styled.Root","htmlFor","_jsx","type","xmlns","viewBox","cx","cy","r","stroke","strokeWidth","fill","defaultProps","onChange","e","console","log","target","Group","RadioGroup"],"mappings":"6cA2EO,SAASA,EAAMC,GACpB,IAAMC,OAAAA,IAAeD,EAAME,QAC3B,IAAMC,EAAQC,IACd,IAAMC,SACJA,EADIC,SAEJA,EAFIC,MAGJA,EAHIC,GAIJA,EAJIC,KAKJA,EALIC,KAMJA,EANIC,MAOJA,EAPIC,MAQJA,EARIC,UASJA,EATIC,MAUJA,EAAQX,EAAMY,0BAVVC,MAWJA,EAXIC,MAYJA,EAZIC,QAaJA,GAEElB,EADCmB,IACDnB,EAfJoB,GAgBA,IAAMC,EAAaC,EAAavB,EAAMwB,YAAaV,GAEnD,IAAMW,EAAavB,EAAe,CAAEwB,eAAgBzB,EAAMyB,gBAAmB,CAAEvB,QAASF,EAAME,SAE9F,OACEwB,EAACC,EAAD,CACEd,UAAWQ,EACXL,MAAOA,EACPV,SAAUA,EACVC,MAAOA,EACPqB,QAASpB,GAAMC,EACfC,KAAMA,EACNI,MAAOA,EACPI,QAASA,EACTD,MAAOA,EATTZ,SAAA,CAWEwB,iBACMV,GADN,GAAA,CAEEX,GAAIA,GAAMC,EACVA,KAAMA,EACNqB,KAAK,QACLnB,MAAOA,EACPL,SAAUA,GACNkB,IAENE,EAAA,MAAA,CAAKK,MAAM,6BAA6BC,QAAQ,YAAhD3B,SACE,CAAAwB,EAAA,SAAA,CAAQI,GAAG,KAAKC,GAAG,KAAKC,EAAE,IAAIC,OAAO,UAAUC,YAAY,IAAIC,KAAK,SACpET,EAAA,SAAA,CAAQI,GAAG,KAAKC,GAAG,KAAKC,EAAE,IAAIG,KAAK,gBAEnC1B,GAASP,IAAawB,EAAA,OAAA,CAAMhB,UAAU,QAAhBR,SAAyBO,GAASP,OA/DhEN,EAAMwC,aAAe,CACnBjC,UAAAA,EACAI,KAAM,SACNQ,QAAS,cACTsB,SAAWC,GAA2CC,QAAQC,IAAIF,EAAGA,EAAEG,OAAOjC,QAGhFZ,EAAM8C,MAAQC,EACd/C,EAAMwB,YAAc"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e from'@babel/runtime/helpers/objectSpread2';import a from'@babel/runtime/helpers/objectWithoutProperties';import l,{AsyncCreatable as r,Async as
|
|
1
|
+
import e from'@babel/runtime/helpers/objectSpread2';import a from'@babel/runtime/helpers/objectWithoutProperties';import l,{AsyncCreatable as r,Async as t,Creatable as s}from'react-select';import{useTheme as o}from'styled-components';import{useClassname as i}from'../../hooks/useClassname.js';import{Root as c}from'./style.js';import{jsx as m}from'react/jsx-runtime';var p=["fluid","error","className","style","display","width"];function d(n){var u=o();var{fluid:b,error:h,className:f,style:y,display:x,width:C=u.defaultInputControlsWidth}=n,T=a(n,p);var j=i(d.displayName,f);return m(c,{className:j,style:y,error:h,fluid:b,width:C,display:x,children:m(n.loadOptions?n.allowCreate?r:t:n.allowCreate?s:l,e(e({},T),{},{promptTextCreator:e=>"Добавить \"".concat(e,"\"")}))})}d.defaultProps={allowCreate:!1,searchable:!0,clearable:!1,addLabelText:'Добавить "{label}"?',backspaceToRemoveMessage:'Нажмите клавишу Backspace, чтобы удалить {last label}',clearAllText:'Очистить все',clearValueText:'Очистить значение',noResultsText:'Результатов не найдено',placeholder:'Выбрать ...',searchPromptText:'Введите поисковый запрос',loadingPlaceholder:'Загрузка...',autoload:!0,loadOptions:!1,display:'inline-block'},d.displayName='Select';export{d as Select};
|
|
2
2
|
//# sourceMappingURL=Select.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.js","sources":["../../../../src/components/Select/Select.tsx"],"sourcesContent":["import ReactSelect, { Async, AsyncCreatable, Creatable, ReactSelectProps } from 'react-select'\nimport { useClassname } from 'hooks/useClassname'\nimport { SizeInput } from '../../shared/enums/sizeInput'\nimport { BaseProps } from '../../shared/interfaces'\nimport { Display } from '../../mixins/display'\nimport { ResponsiveProperty } from '../../mixins/responsive-property'\nimport * as Styled from './style'\n\nexport interface SelectProps extends BaseProps, ReactSelectProps, Display {\n fluid?: boolean\n error?: boolean\n width?: ResponsiveProperty<'auto' | number | keyof typeof SizeInput>\n}\n\nSelect.defaultProps = {\n allowCreate: false,\n searchable: true,\n clearable: false,\n addLabelText: 'Добавить \"{label}\"?',\n backspaceToRemoveMessage: 'Нажмите клавишу Backspace, чтобы удалить {last label}',\n clearAllText: 'Очистить все',\n clearValueText: 'Очистить значение',\n noResultsText: 'Результатов не найдено',\n placeholder: 'Выбрать ...',\n searchPromptText: 'Введите поисковый запрос',\n loadingPlaceholder: 'Загрузка...',\n autoload: true,\n loadOptions: false,\n display: 'inline-block',\n
|
|
1
|
+
{"version":3,"file":"Select.js","sources":["../../../../src/components/Select/Select.tsx"],"sourcesContent":["import ReactSelect, { Async, AsyncCreatable, Creatable, ReactSelectProps } from 'react-select'\nimport { useTheme } from 'styled-components'\nimport { useClassname } from 'hooks/useClassname'\nimport { SizeInput } from '../../shared/enums/sizeInput'\nimport { BaseProps } from '../../shared/interfaces'\nimport { Display } from '../../mixins/display'\nimport { ResponsiveProperty } from '../../mixins/responsive-property'\nimport * as Styled from './style'\n\nexport interface SelectProps extends BaseProps, ReactSelectProps, Display {\n fluid?: boolean\n error?: boolean\n /**\n * Width of select. Default is `Theme.defaultInputControlsWidth`\n */\n width?: ResponsiveProperty<'auto' | number | keyof typeof SizeInput>\n}\n\nSelect.defaultProps = {\n allowCreate: false,\n searchable: true,\n clearable: false,\n addLabelText: 'Добавить \"{label}\"?',\n backspaceToRemoveMessage: 'Нажмите клавишу Backspace, чтобы удалить {last label}',\n clearAllText: 'Очистить все',\n clearValueText: 'Очистить значение',\n noResultsText: 'Результатов не найдено',\n placeholder: 'Выбрать ...',\n searchPromptText: 'Введите поисковый запрос',\n loadingPlaceholder: 'Загрузка...',\n autoload: true,\n loadOptions: false,\n display: 'inline-block',\n}\n\nSelect.displayName = 'Select'\n\n/**\n * Расширен:\n * - [`BaseProps`](#/Миксины)\n * - `ReactSelectProps`\n */\nexport function Select(props: SelectProps) {\n const theme = useTheme()\n const {\n fluid,\n error,\n className,\n style,\n display,\n width = theme.defaultInputControlsWidth,\n ...reactSelectProps\n } = props\n const _className = useClassname(Select.displayName, className)\n\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n const SelectElement: typeof ReactSelect & typeof Creatable = props.loadOptions\n ? props.allowCreate\n ? AsyncCreatable\n : Async\n : props.allowCreate\n ? Creatable\n : ReactSelect\n\n return (\n <Styled.Root className={_className} style={style} error={error} fluid={fluid} width={width} display={display}>\n <SelectElement {...reactSelectProps} promptTextCreator={(label: string) => `Добавить \"${label}\"`} />\n </Styled.Root>\n )\n}\n"],"names":["Select","props","theme","useTheme","fluid","error","className","style","display","width","defaultInputControlsWidth","reactSelectProps","_excluded","_className","useClassname","displayName","_jsx","Styled.Root","children","loadOptions","allowCreate","AsyncCreatable","Async","Creatable","ReactSelect","_objectSpread","promptTextCreator","label","concat","defaultProps","searchable","clearable","addLabelText","backspaceToRemoveMessage","clearAllText","clearValueText","noResultsText","placeholder","searchPromptText","loadingPlaceholder","autoload"],"mappings":"6aA0CO,SAASA,EAAOC,GACrB,IAAMC,EAAQC,IACd,IAAMC,MACJA,EADIC,MAEJA,EAFIC,UAGJA,EAHIC,MAIJA,EAJIC,QAKJA,EALIC,MAMJA,EAAQP,EAAMQ,2BAEZT,EADCU,IACDV,EARJW,GASA,IAAMC,EAAaC,EAAad,EAAOe,YAAaT,GAYpD,OACEU,EAACC,EAAD,CAAaX,UAAWO,EAAYN,MAAOA,EAAOF,MAAOA,EAAOD,MAAOA,EAAOK,MAAOA,EAAOD,QAASA,EAArGU,SACEF,EAVyDf,EAAMkB,YAC/DlB,EAAMmB,YACJC,EACAC,EACFrB,EAAMmB,YACNG,EACAC,EAIAC,EAAAA,EAAA,GAAmBd,GAAnB,GAAA,CAAqCe,kBAAoBC,GAAD,cAAAC,OAAgCD,EAAhC,WAjD9D3B,EAAO6B,aAAe,CACpBT,aAAa,EACbU,YAAY,EACZC,WAAW,EACXC,aAAc,sBACdC,yBAA0B,wDAC1BC,aAAc,eACdC,eAAgB,oBAChBC,cAAe,yBACfC,YAAa,cACbC,iBAAkB,2BAClBC,mBAAoB,cACpBC,UAAAA,EACArB,aAAAA,EACAX,QAAS,gBAGXR,EAAOe,YAAc"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e from'@babel/runtime/helpers/objectSpread2';import r from'@babel/runtime/helpers/objectWithoutProperties';import{useState as o,useCallback as a}from'react';import{
|
|
1
|
+
import e from'@babel/runtime/helpers/objectSpread2';import r from'@babel/runtime/helpers/objectWithoutProperties';import{useState as o,useCallback as a}from'react';import{useTheme as l}from'styled-components';import{Root as t}from'./style.js';import{jsx as s}from'react/jsx-runtime';var n=["cols","disabled","error","fluid","name","onChange","maxLength","placeholder","required","rounded","rows","tabIndex","value","className","style","children","autosize","maxRows","color","placeholderColor"];function d(d){var{cols:i,disabled:c,error:u,fluid:m,name:h,onChange:p,maxLength:f,placeholder:v,required:x,rounded:g,rows:b,tabIndex:C,value:w,className:y,style:j,children:R,autosize:T,maxRows:I,color:L,placeholderColor:N}=d,q=r(d,n);var[z,S]=o(b);var H=l();var{width:P=H.defaultInputControlsWidth}=q;var W=a((e=>{var{target:r}=e;if(r instanceof HTMLTextAreaElement&&T){var o=r.getBoundingClientRect();r.scrollHeight>o.height&&z<I?S(z+1):r.value&&''!==r.value||S(b)}'function'==typeof p&&p(e)}),[p,z,I,T]);return s(t,e(e({className:y,style:j,onChange:W,cols:i,disabled:c,maxLength:f,name:h,placeholder:v,required:x,rows:z,tabIndex:C,value:w,color:L,rounded:g,placeholderColor:N,fluid:m,error:u,width:P},q),{},{children:R}))}d.defaultProps={onChange:e=>console.log(e,e.target.value),rounded:!0,color:'mineShaft',placeholderColor:'silver',cols:20,maxRows:30,rows:2,autosize:!0},d.displayName='Textarea';export{d as Textarea};
|
|
2
2
|
//# sourceMappingURL=Textarea.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Textarea.js","sources":["../../../../src/components/Textarea/Textarea.tsx"],"sourcesContent":["import { useCallback, useState } from 'react'\nimport { BaseProps, InputField } from '../../shared/interfaces'\nimport * as Styled from './style'\n\ntype TextAreaHTMLAttributes = Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, 'cols' | 'rows' | 'color'>\n\nexport interface TextareaProps extends BaseProps, InputField, TextAreaHTMLAttributes {\n /**\n * Specifies the visible width of a text area\n */\n cols?: number\n /**\n * Specifies the visible number of lines in a text area\n */\n rows?: number\n /**\n * Specifies the visible max number of lines in a text area\n */\n maxRows?: number\n /**\n * Specifies the maximum number of characters allowed in the text area\n */\n maxLength?: number\n /**\n * On change handler\n */\n onChange?(_event: React.ChangeEvent<HTMLTextAreaElement>): void\n /**\n * Value\n */\n value?: string\n /**\n * Autosize for textarea\n */\n autosize?: boolean\n}\n\nTextarea.defaultProps = {\n onChange: (e: React.ChangeEvent<HTMLTextAreaElement>) => console.log(e, e.target.value), // eslint-disable-line no-console\n rounded: true,\n
|
|
1
|
+
{"version":3,"file":"Textarea.js","sources":["../../../../src/components/Textarea/Textarea.tsx"],"sourcesContent":["import { useCallback, useState } from 'react'\nimport { useTheme } from 'styled-components'\nimport { BaseProps, InputField } from '../../shared/interfaces'\nimport * as Styled from './style'\n\ntype TextAreaHTMLAttributes = Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, 'cols' | 'rows' | 'color'>\n\nexport interface TextareaProps extends BaseProps, InputField, TextAreaHTMLAttributes {\n /**\n * Specifies the visible width of a text area\n */\n cols?: number\n /**\n * Specifies the visible number of lines in a text area\n */\n rows?: number\n /**\n * Specifies the visible max number of lines in a text area\n */\n maxRows?: number\n /**\n * Specifies the maximum number of characters allowed in the text area\n */\n maxLength?: number\n /**\n * On change handler\n */\n onChange?(_event: React.ChangeEvent<HTMLTextAreaElement>): void\n /**\n * Value\n */\n value?: string\n /**\n * Autosize for textarea\n */\n autosize?: boolean\n}\n\nTextarea.defaultProps = {\n onChange: (e: React.ChangeEvent<HTMLTextAreaElement>) => console.log(e, e.target.value), // eslint-disable-line no-console\n rounded: true,\n color: 'mineShaft',\n placeholderColor: 'silver',\n cols: 20,\n maxRows: 30,\n rows: 2,\n autosize: true,\n}\n\nTextarea.displayName = 'Textarea'\n\n/**\n * Расширен:\n * - [`BaseProps`](#/Миксины)\n * - [`InputField`](#/Миксины)\n * - `React.TextareaHTMLAttributes<HTMLTextAreaElement>`\n */\nexport function Textarea({\n cols,\n disabled,\n error,\n fluid,\n name,\n onChange,\n maxLength,\n placeholder,\n required,\n rounded,\n rows,\n tabIndex,\n value,\n className,\n style,\n children,\n autosize,\n maxRows,\n color,\n placeholderColor,\n ...props\n}: typeof Textarea.defaultProps & TextareaProps) {\n const [tRows, setRows] = useState(rows)\n const theme = useTheme()\n\n const { width = theme.defaultInputControlsWidth } = props\n\n const onChangeHandler: React.ChangeEventHandler<HTMLTextAreaElement> = useCallback(\n (event) => {\n const { target } = event\n\n if (target instanceof HTMLTextAreaElement && autosize) {\n const rect = target.getBoundingClientRect()\n\n if (target.scrollHeight > rect.height && tRows < maxRows) {\n setRows(tRows + 1)\n } else if (!target.value || target.value === '') {\n setRows(rows)\n }\n }\n\n if (typeof onChange === 'function') {\n onChange(event)\n }\n },\n [onChange, tRows, maxRows, autosize]\n )\n\n return (\n <Styled.Root\n className={className}\n style={style}\n onChange={onChangeHandler}\n cols={cols}\n disabled={disabled}\n maxLength={maxLength}\n name={name}\n placeholder={placeholder}\n required={required}\n rows={tRows}\n tabIndex={tabIndex}\n value={value}\n color={color}\n rounded={rounded}\n placeholderColor={placeholderColor}\n fluid={fluid}\n error={error}\n width={width}\n {...props}\n >\n {children}\n </Styled.Root>\n )\n}\n"],"names":["Textarea","_ref","cols","disabled","error","fluid","name","onChange","maxLength","placeholder","required","rounded","rows","tabIndex","value","className","style","children","autosize","maxRows","color","placeholderColor","props","_objectWithoutProperties","_excluded","tRows","setRows","useState","theme","useTheme","width","defaultInputControlsWidth","onChangeHandler","useCallback","event","target","HTMLTextAreaElement","rect","getBoundingClientRect","scrollHeight","height","_jsx","Styled.Root","_objectSpread","defaultProps","e","console","log","displayName"],"mappings":"+eAyDO,SAASA,EAsBiCC,GAAA,IAtBxBC,KACvBA,EADuBC,SAEvBA,EAFuBC,MAGvBA,EAHuBC,MAIvBA,EAJuBC,KAKvBA,EALuBC,SAMvBA,EANuBC,UAOvBA,EAPuBC,YAQvBA,EARuBC,SASvBA,EATuBC,QAUvBA,EAVuBC,KAWvBA,EAXuBC,SAYvBA,EAZuBC,MAavBA,EAbuBC,UAcvBA,EAduBC,MAevBA,EAfuBC,SAgBvBA,EAhBuBC,SAiBvBA,EAjBuBC,QAkBvBA,EAlBuBC,MAmBvBA,EAnBuBC,iBAoBvBA,GAE+CpB,EAD5CqB,EAC4CC,EAAAtB,EAAAuB,GAC/C,IAAOC,EAAOC,GAAWC,EAASf,GAClC,IAAMgB,EAAQC,IAEd,IAAMC,MAAEA,EAAQF,EAAMG,2BAA8BT,EAEpD,IAAMU,EAAiEC,GACpEC,IACC,IAAMC,OAAEA,GAAWD,EAEnB,GAAIC,aAAkBC,qBAAuBlB,EAAU,CACrD,IAAMmB,EAAOF,EAAOG,wBAEhBH,EAAOI,aAAeF,EAAKG,QAAUf,EAAQN,EAC/CO,EAAQD,EAAQ,GACNU,EAAOrB,OAA0B,KAAjBqB,EAAOrB,OACjCY,EAAQd,GAIY,mBAAbL,GACTA,EAAS2B,KAGb,CAAC3B,EAAUkB,EAAON,EAASD,IAG7B,OACEuB,EAACC,EAADC,EAAAA,EAAA,CACE5B,UAAWA,EACXC,MAAOA,EACPT,SAAUyB,EACV9B,KAAMA,EACNC,SAAUA,EACVK,UAAWA,EACXF,KAAMA,EACNG,YAAaA,EACbC,SAAUA,EACVE,KAAMa,EACNZ,SAAUA,EACVC,MAAOA,EACPM,MAAOA,EACPT,QAASA,EACTU,iBAAkBA,EAClBhB,MAAOA,EACPD,MAAOA,EACP0B,MAAOA,GACHR,GAnBN,GAAA,CAAAL,SAqBGA,KA1FPjB,EAAS4C,aAAe,CACtBrC,SAAWsC,GAA8CC,QAAQC,IAAIF,EAAGA,EAAEV,OAAOrB,OACjFH,SAAS,EACTS,MAAO,YACPC,iBAAkB,SAClBnB,KAAM,GACNiB,QAAS,GACTP,KAAM,EACNM,UAAU,GAGZlB,EAASgD,YAAc"}
|
package/dts/index.d.ts
CHANGED
|
@@ -12,7 +12,6 @@ import * as type_fest_source_partial_deep from 'type-fest/source/partial-deep';
|
|
|
12
12
|
import * as react_floater_lib_types from 'react-floater/lib/types';
|
|
13
13
|
import Floater from 'react-floater';
|
|
14
14
|
import { InputState, MaskOptions } from 'react-input-mask';
|
|
15
|
-
import { SizeInput as SizeInput$1 } from 'shared/enums/sizeInput';
|
|
16
15
|
import { ReactSelectProps } from 'react-select';
|
|
17
16
|
|
|
18
17
|
declare enum ColorNames {
|
|
@@ -357,6 +356,7 @@ interface Theme {
|
|
|
357
356
|
tooltip: number;
|
|
358
357
|
};
|
|
359
358
|
classNamePrefix: string;
|
|
359
|
+
defaultInputControlsWidth: number | keyof typeof SizeInput | 'auto';
|
|
360
360
|
}
|
|
361
361
|
|
|
362
362
|
declare type StyledComponentProps = {
|
|
@@ -2244,7 +2244,6 @@ declare namespace Textarea {
|
|
|
2244
2244
|
var defaultProps: {
|
|
2245
2245
|
onChange: (e: react.ChangeEvent<HTMLTextAreaElement>) => void;
|
|
2246
2246
|
rounded: boolean;
|
|
2247
|
-
width: string;
|
|
2248
2247
|
color: string;
|
|
2249
2248
|
placeholderColor: string;
|
|
2250
2249
|
cols: number;
|
|
@@ -2285,7 +2284,6 @@ declare class InputPhone extends PureComponent<typeof InputPhone.defaultProps &
|
|
|
2285
2284
|
static defaultProps: {
|
|
2286
2285
|
rounded: boolean;
|
|
2287
2286
|
type: string;
|
|
2288
|
-
width: SizeInput;
|
|
2289
2287
|
color: string;
|
|
2290
2288
|
mask: string;
|
|
2291
2289
|
placeholderColor: string;
|
|
@@ -2370,7 +2368,6 @@ declare namespace Input {
|
|
|
2370
2368
|
var defaultProps: {
|
|
2371
2369
|
rounded: boolean;
|
|
2372
2370
|
type: string;
|
|
2373
|
-
width: SizeInput$1;
|
|
2374
2371
|
color: string;
|
|
2375
2372
|
mask: string;
|
|
2376
2373
|
placeholderColor: string;
|
|
@@ -2437,6 +2434,9 @@ interface RadioProps extends BaseProps, Display, RadioInputHtmlAttributes {
|
|
|
2437
2434
|
*/
|
|
2438
2435
|
value?: string | number;
|
|
2439
2436
|
fluid?: boolean;
|
|
2437
|
+
/**
|
|
2438
|
+
* Width of label. Default is `Theme.defaultInputControlsWidth`
|
|
2439
|
+
*/
|
|
2440
2440
|
width?: ResponsiveProperty<'auto' | number | keyof typeof SizeInput>;
|
|
2441
2441
|
}
|
|
2442
2442
|
/**
|
|
@@ -2449,9 +2449,7 @@ declare namespace Radio {
|
|
|
2449
2449
|
var defaultProps: {
|
|
2450
2450
|
disabled: boolean;
|
|
2451
2451
|
size: string;
|
|
2452
|
-
defaultChecked: boolean;
|
|
2453
2452
|
display: string;
|
|
2454
|
-
width: SizeInput;
|
|
2455
2453
|
onChange: (e: react.ChangeEvent<HTMLInputElement>) => void;
|
|
2456
2454
|
};
|
|
2457
2455
|
var Group: typeof RadioGroup;
|
|
@@ -2507,6 +2505,9 @@ interface CheckboxProps extends BaseProps, Display, CheckboxInputHtmlAttributes
|
|
|
2507
2505
|
*/
|
|
2508
2506
|
size?: 'small' | 'medium' | 'large' | 'extraLarge' | 's' | 'm' | 'l' | 'xl';
|
|
2509
2507
|
fluid?: boolean;
|
|
2508
|
+
/**
|
|
2509
|
+
* Width of label. Default is `Theme.defaultInputControlsWidth`
|
|
2510
|
+
*/
|
|
2510
2511
|
width?: ResponsiveProperty<'auto' | number | keyof typeof SizeInput>;
|
|
2511
2512
|
}
|
|
2512
2513
|
/**
|
|
@@ -2519,9 +2520,7 @@ declare namespace Checkbox {
|
|
|
2519
2520
|
var defaultProps: {
|
|
2520
2521
|
disabled: boolean;
|
|
2521
2522
|
size: string;
|
|
2522
|
-
defaultChecked: boolean;
|
|
2523
2523
|
display: string;
|
|
2524
|
-
width: SizeInput;
|
|
2525
2524
|
onChange: (e: react.ChangeEvent<HTMLInputElement>) => void;
|
|
2526
2525
|
};
|
|
2527
2526
|
var Group: typeof CheckboxGroup;
|
|
@@ -2531,6 +2530,9 @@ declare namespace Checkbox {
|
|
|
2531
2530
|
interface SelectProps extends BaseProps, ReactSelectProps, Display {
|
|
2532
2531
|
fluid?: boolean;
|
|
2533
2532
|
error?: boolean;
|
|
2533
|
+
/**
|
|
2534
|
+
* Width of select. Default is `Theme.defaultInputControlsWidth`
|
|
2535
|
+
*/
|
|
2534
2536
|
width?: ResponsiveProperty<'auto' | number | keyof typeof SizeInput>;
|
|
2535
2537
|
}
|
|
2536
2538
|
/**
|
|
@@ -2555,7 +2557,6 @@ declare namespace Select {
|
|
|
2555
2557
|
autoload: boolean;
|
|
2556
2558
|
loadOptions: boolean;
|
|
2557
2559
|
display: string;
|
|
2558
|
-
width: SizeInput;
|
|
2559
2560
|
};
|
|
2560
2561
|
var displayName: string;
|
|
2561
2562
|
}
|