@salutejs/plasma-new-hope 0.88.0-canary.1233.9486423566.0 → 0.88.0-canary.1233.9500481670.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/components/Select/elements/Target/elements/Button/Button.js +2 -1
- package/cjs/components/Select/elements/Target/elements/Button/Button.js.map +1 -1
- package/cjs/components/Select/elements/Target/elements/Textfield/Textfield.js +2 -1
- package/cjs/components/Select/elements/Target/elements/Textfield/Textfield.js.map +1 -1
- package/es/components/Select/elements/Target/elements/Button/Button.js +2 -1
- package/es/components/Select/elements/Target/elements/Button/Button.js.map +1 -1
- package/es/components/Select/elements/Target/elements/Textfield/Textfield.js +2 -1
- package/es/components/Select/elements/Target/elements/Textfield/Textfield.js.map +1 -1
- package/package.json +4 -4
- package/styled-components/cjs/components/Select/elements/Target/elements/Button/Button.js +2 -1
- package/styled-components/cjs/components/Select/elements/Target/elements/Textfield/Textfield.js +2 -1
- package/styled-components/es/components/Select/elements/Target/elements/Button/Button.js +2 -1
- package/styled-components/es/components/Select/elements/Target/elements/Textfield/Textfield.js +2 -1
- package/types/components/Select/elements/Target/elements/Button/Button.d.ts.map +1 -1
- package/types/components/Select/elements/Target/elements/Textfield/Textfield.d.ts.map +1 -1
@@ -43,7 +43,8 @@ var Button = function Button(_ref) {
|
|
43
43
|
role: "combobox",
|
44
44
|
"aria-controls": "tree_level_1",
|
45
45
|
"aria-expanded": opened,
|
46
|
-
"aria-activedescendant": getActiveDescendant()
|
46
|
+
"aria-activedescendant": getActiveDescendant(),
|
47
|
+
"aria-label": label
|
47
48
|
}, /*#__PURE__*/React.createElement(Button_styles.Label, null, getButtonLabel.getButtonLabel({
|
48
49
|
value: value,
|
49
50
|
isTargetAmount: isTargetAmount,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Button.js","sources":["../../../../../../../src/components/Select/elements/Target/elements/Button/Button.tsx"],"sourcesContent":["import React from 'react';\n\nimport { cx } from '../../../../../../utils';\nimport { classes } from '../../../../Select.tokens';\nimport { getButtonLabel } from '../../../../utils';\n\nimport { ButtonProps } from './Button.types';\nimport { StyledButton, StyledArrow, Label, ButtonWrapper, IconArrowWrapper } from './Button.styles';\n\nexport const Button: React.FC<ButtonProps> = ({\n opened,\n value,\n isTargetAmount,\n multiselect,\n valueToItemMap,\n onKeyDown,\n label,\n size,\n disabled,\n renderValue,\n focusedPath,\n focusedToValueMap,\n}) => {\n const withArrowInverse = opened ? classes.arrowInverse : undefined;\n\n const iconSize = size === 'xs' ? 'xs' : 's';\n\n const getActiveDescendant = () => {\n const focusedPathAsString = focusedPath.reduce((acc, n) => `${acc}/${n}`, '').replace(/^(\\/)/, '');\n return focusedToValueMap?.get(focusedPathAsString)?.value.toString();\n };\n\n return (\n <ButtonWrapper>\n <StyledButton\n stretching=\"filled\"\n onKeyDown={onKeyDown}\n className={opened ? classes.selectWithoutBoxShadow : undefined}\n disabled={disabled}\n contentRight={\n <IconArrowWrapper>\n <StyledArrow\n size={iconSize}\n color=\"inherit\"\n className={cx(classes.selectTargetArrow, withArrowInverse)}\n />\n </IconArrowWrapper>\n }\n role=\"combobox\"\n aria-controls=\"tree_level_1\"\n aria-expanded={opened}\n aria-activedescendant={getActiveDescendant()}\n >\n <Label>\n {getButtonLabel({\n value,\n isTargetAmount,\n multiselect,\n valueToItemMap,\n label,\n renderValue,\n })}\n </Label>\n </StyledButton>\n </ButtonWrapper>\n );\n};\n"],"names":["Button","_ref","opened","value","isTargetAmount","multiselect","valueToItemMap","onKeyDown","label","size","disabled","renderValue","focusedPath","focusedToValueMap","withArrowInverse","classes","arrowInverse","undefined","iconSize","getActiveDescendant","_focusedToValueMap$ge","focusedPathAsString","reduce","acc","n","concat","replace","get","toString","React","createElement","ButtonWrapper","StyledButton","stretching","className","selectWithoutBoxShadow","contentRight","IconArrowWrapper","StyledArrow","color","cx","selectTargetArrow","role","Label","getButtonLabel"],"mappings":";;;;;;;;;;IASaA,MAA6B,GAAG,SAAhCA,MAA6BA,CAAAC,IAAA,EAapC;AAAA,EAAA,IAZFC,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E,CAAA;GACvE,CAAA;EAED,oBACIC,KAAA,CAAAC,aAAA,CAACC,2BAAa,qBACVF,KAAA,CAAAC,aAAA,CAACE,0BAAY,EAAA;AACTC,IAAAA,UAAU,EAAC,QAAQ;AACnB1B,IAAAA,SAAS,EAAEA,SAAU;AACrB2B,IAAAA,SAAS,EAAEhC,MAAM,GAAGa,qBAAO,CAACoB,sBAAsB,GAAGlB,SAAU;AAC/DP,IAAAA,QAAQ,EAAEA,QAAS;IACnB0B,YAAY,eACRP,KAAA,CAAAC,aAAA,CAACO,8BAAgB,EAAA,IAAA,eACbR,KAAA,CAAAC,aAAA,CAACQ,yBAAW,EAAA;AACR7B,MAAAA,IAAI,EAAES,QAAS;AACfqB,MAAAA,KAAK,EAAC,SAAS;AACfL,MAAAA,SAAS,EAAEM,QAAE,CAACzB,qBAAO,CAAC0B,iBAAiB,EAAE3B,gBAAgB,CAAA;AAAE,KAC9D,CACa,CACrB;AACD4B,IAAAA,IAAI,EAAC,UAAU;AACf,IAAA,eAAA,EAAc,cAAc;AAC5B,IAAA,eAAA,EAAexC,MAAO;
|
1
|
+
{"version":3,"file":"Button.js","sources":["../../../../../../../src/components/Select/elements/Target/elements/Button/Button.tsx"],"sourcesContent":["import React from 'react';\n\nimport { cx } from '../../../../../../utils';\nimport { classes } from '../../../../Select.tokens';\nimport { getButtonLabel } from '../../../../utils';\n\nimport { ButtonProps } from './Button.types';\nimport { StyledButton, StyledArrow, Label, ButtonWrapper, IconArrowWrapper } from './Button.styles';\n\nexport const Button: React.FC<ButtonProps> = ({\n opened,\n value,\n isTargetAmount,\n multiselect,\n valueToItemMap,\n onKeyDown,\n label,\n size,\n disabled,\n renderValue,\n focusedPath,\n focusedToValueMap,\n}) => {\n const withArrowInverse = opened ? classes.arrowInverse : undefined;\n\n const iconSize = size === 'xs' ? 'xs' : 's';\n\n const getActiveDescendant = () => {\n const focusedPathAsString = focusedPath.reduce((acc, n) => `${acc}/${n}`, '').replace(/^(\\/)/, '');\n return focusedToValueMap?.get(focusedPathAsString)?.value.toString();\n };\n\n return (\n <ButtonWrapper>\n <StyledButton\n stretching=\"filled\"\n onKeyDown={onKeyDown}\n className={opened ? classes.selectWithoutBoxShadow : undefined}\n disabled={disabled}\n contentRight={\n <IconArrowWrapper>\n <StyledArrow\n size={iconSize}\n color=\"inherit\"\n className={cx(classes.selectTargetArrow, withArrowInverse)}\n />\n </IconArrowWrapper>\n }\n role=\"combobox\"\n aria-controls=\"tree_level_1\"\n aria-expanded={opened}\n aria-activedescendant={getActiveDescendant()}\n aria-label={label}\n >\n <Label>\n {getButtonLabel({\n value,\n isTargetAmount,\n multiselect,\n valueToItemMap,\n label,\n renderValue,\n })}\n </Label>\n </StyledButton>\n </ButtonWrapper>\n );\n};\n"],"names":["Button","_ref","opened","value","isTargetAmount","multiselect","valueToItemMap","onKeyDown","label","size","disabled","renderValue","focusedPath","focusedToValueMap","withArrowInverse","classes","arrowInverse","undefined","iconSize","getActiveDescendant","_focusedToValueMap$ge","focusedPathAsString","reduce","acc","n","concat","replace","get","toString","React","createElement","ButtonWrapper","StyledButton","stretching","className","selectWithoutBoxShadow","contentRight","IconArrowWrapper","StyledArrow","color","cx","selectTargetArrow","role","Label","getButtonLabel"],"mappings":";;;;;;;;;;IASaA,MAA6B,GAAG,SAAhCA,MAA6BA,CAAAC,IAAA,EAapC;AAAA,EAAA,IAZFC,MAAM,GAAAD,IAAA,CAANC,MAAM;IACNC,KAAK,GAAAF,IAAA,CAALE,KAAK;IACLC,cAAc,GAAAH,IAAA,CAAdG,cAAc;IACdC,WAAW,GAAAJ,IAAA,CAAXI,WAAW;IACXC,cAAc,GAAAL,IAAA,CAAdK,cAAc;IACdC,SAAS,GAAAN,IAAA,CAATM,SAAS;IACTC,KAAK,GAAAP,IAAA,CAALO,KAAK;IACLC,IAAI,GAAAR,IAAA,CAAJQ,IAAI;IACJC,QAAQ,GAAAT,IAAA,CAARS,QAAQ;IACRC,WAAW,GAAAV,IAAA,CAAXU,WAAW;IACX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AAA,CAACQ,yBAAW,EAAA;AACR7B,MAAAA,IAAI,EAAES,QAAS;AACfqB,MAAAA,KAAK,EAAC,SAAS;AACfL,MAAAA,SAAS,EAAEM,QAAE,CAACzB,qBAAO,CAAC0B,iBAAiB,EAAE3B,gBAAgB,CAAA;AAAE,KAC9D,CACa,CACrB;AACD4B,IAAAA,IAAI,EAAC,UAAU;AACf,IAAA,eAAA,EAAc,cAAc;AAC5B,IAAA,eAAA,EAAexC,MAAO;IACtB,uBAAuBiB,EAAAA,mBAAmB,EAAG;IAC7C,YAAYX,EAAAA,KAAAA;AAAM,GAAA,eAElBqB,KAAA,CAAAC,aAAA,CAACa,mBAAK,EAAA,IAAA,EACDC,6BAAc,CAAC;AACZzC,IAAAA,KAAK,EAALA,KAAK;AACLC,IAAAA,cAAc,EAAdA,cAAc;AACdC,IAAAA,WAAW,EAAXA,WAAW;AACXC,IAAAA,cAAc,EAAdA,cAAc;AACdE,IAAAA,KAAK,EAALA,KAAK;AACLG,IAAAA,WAAW,EAAXA,WAAAA;GACH,CACE,CACG,CACH,CAAC,CAAA;AAExB;;;;"}
|
@@ -89,7 +89,8 @@ var Textfield = function Textfield(_ref2) {
|
|
89
89
|
role: "combobox",
|
90
90
|
"aria-controls": "tree_level_1",
|
91
91
|
"aria-expanded": opened,
|
92
|
-
"aria-activedescendant": getActiveDescendant()
|
92
|
+
"aria-activedescendant": getActiveDescendant(),
|
93
|
+
"aria-label": label
|
93
94
|
}, /*#__PURE__*/React.createElement(Textfield_styles.Wrapper, null, contentLeft && (!multiselect || isEmpty.isEmpty(value)) && /*#__PURE__*/React.createElement(Textfield_styles.ContentLeftWrapper, null, contentLeft), /*#__PURE__*/React.createElement(Textfield_styles.ChipWrapper, null, getLabel({
|
94
95
|
value: value,
|
95
96
|
isTargetAmount: isTargetAmount,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Textfield.js","sources":["../../../../../../../src/components/Select/elements/Target/elements/Textfield/Textfield.tsx"],"sourcesContent":["import React from 'react';\n\nimport { cx, isEmpty } from '../../../../../../utils';\nimport { classes } from '../../../../Select.tokens';\n\nimport { TextfieldProps, GetTextfieldLabelProps } from './Textfield.types';\nimport { Chip } from './elements/Chip/Chip';\nimport {\n StyledButton,\n StyledArrow,\n Wrapper,\n ChipWrapper,\n TextfieldWrapper,\n IconArrowWrapper,\n Label,\n Placeholder,\n InnerLabel,\n InnerLabelWrapper,\n ContentLeftWrapper,\n Value,\n} from './Textfield.styles';\n\nconst getLabel = ({\n value,\n isTargetAmount,\n valueToItemMap,\n onChipClick,\n label,\n placeholder,\n focusedChipIndex,\n labelPlacement,\n size,\n renderValue,\n}: GetTextfieldLabelProps) => {\n if (isEmpty(value)) {\n if (!label || labelPlacement === 'outer') {\n return <Placeholder>{placeholder}</Placeholder>;\n }\n\n return <Label>{label}</Label>;\n }\n\n if (Array.isArray(value) && isTargetAmount) {\n return <Chip text={`Выбрано: ${value.length}`} isTargetAmount={isTargetAmount} />;\n }\n\n if (Array.isArray(value)) {\n return value.map((currentValue, index) => {\n const itemLabel = valueToItemMap.get(currentValue)!.label;\n\n return (\n <Chip\n text={renderValue ? renderValue(currentValue, itemLabel) : itemLabel}\n onClick={(e: React.MouseEvent<HTMLElement>) => {\n e.stopPropagation();\n onChipClick(currentValue);\n }}\n focused={focusedChipIndex === index}\n />\n );\n });\n }\n\n const itemLabel = valueToItemMap.get(value)!.label;\n\n if (!label || labelPlacement === 'outer') {\n return <Value>{renderValue ? renderValue(value, itemLabel) : itemLabel}</Value>;\n }\n\n return (\n <InnerLabelWrapper>\n {size !== 'xs' && <InnerLabel>{label}</InnerLabel>}\n <Value>{renderValue ? renderValue(value, itemLabel) : itemLabel}</Value>\n </InnerLabelWrapper>\n );\n};\n\nexport const Textfield: React.FC<TextfieldProps> = ({\n opened,\n value,\n isTargetAmount,\n multiselect,\n valueToItemMap,\n onChipClick,\n label,\n placeholder,\n onKeyDown,\n focusedChipIndex,\n labelPlacement,\n size,\n contentLeft,\n disabled,\n renderValue,\n focusedPath,\n focusedToValueMap,\n}) => {\n const withArrowInverse = opened ? classes.arrowInverse : undefined;\n\n const iconSize = size === 'xs' ? 'xs' : 's';\n\n const getActiveDescendant = () => {\n const focusedPathAsString = focusedPath.reduce((acc, n) => `${acc}/${n}`, '').replace(/^(\\/)/, '');\n return focusedToValueMap?.get(focusedPathAsString)?.value.toString();\n };\n\n return (\n <TextfieldWrapper opened={opened} value={value}>\n <StyledButton\n stretching=\"filled\"\n className={cx(\n classes.textfieldTarget,\n opened || focusedChipIndex !== null ? classes.selectWithoutBoxShadow : undefined,\n )}\n onKeyDown={onKeyDown}\n disabled={disabled}\n role=\"combobox\"\n aria-controls=\"tree_level_1\"\n aria-expanded={opened}\n aria-activedescendant={getActiveDescendant()}\n >\n <Wrapper>\n {contentLeft && (!multiselect || isEmpty(value)) && (\n <ContentLeftWrapper>{contentLeft}</ContentLeftWrapper>\n )}\n\n <ChipWrapper>\n {getLabel({\n value,\n isTargetAmount,\n valueToItemMap,\n onChipClick,\n label,\n placeholder,\n focusedChipIndex,\n labelPlacement,\n size,\n renderValue,\n })}\n </ChipWrapper>\n\n <IconArrowWrapper>\n <StyledArrow\n size={iconSize}\n color=\"inherit\"\n className={cx(classes.selectTargetArrow, withArrowInverse)}\n />\n </IconArrowWrapper>\n </Wrapper>\n </StyledButton>\n </TextfieldWrapper>\n );\n};\n"],"names":["getLabel","_ref","value","isTargetAmount","valueToItemMap","onChipClick","label","placeholder","focusedChipIndex","labelPlacement","size","renderValue","isEmpty","React","createElement","Placeholder","Label","Array","isArray","Chip","text","concat","length","map","currentValue","index","itemLabel","get","onClick","e","stopPropagation","focused","Value","InnerLabelWrapper","InnerLabel","Textfield","_ref2","opened","multiselect","onKeyDown","contentLeft","disabled","focusedPath","focusedToValueMap","withArrowInverse","classes","arrowInverse","undefined","iconSize","getActiveDescendant","_focusedToValueMap$ge","focusedPathAsString","reduce","acc","n","replace","toString","TextfieldWrapper","StyledButton","stretching","className","cx","textfieldTarget","selectWithoutBoxShadow","role","Wrapper","ContentLeftWrapper","ChipWrapper","IconArrowWrapper","StyledArrow","color","selectTargetArrow"],"mappings":";;;;;;;;;;;AAsBA,IAAMA,QAAQ,GAAG,SAAXA,QAAQA,CAAAC,IAAA,EAWgB;AAAA,EAAA,IAV1BC,KAAK,GAAAD,IAAA,CAALC,KAAK;IACLC,cAAc,GAAAF,IAAA,CAAdE,cAAc;IACdC,cAAc,GAAAH,IAAA,CAAdG,cAAc;IACdC,WAAW,GAAAJ,IAAA,CAAXI,WAAW;IACXC,KAAK,GAAAL,IAAA,CAALK,KAAK;IACLC,WAAW,GAAAN,IAAA,CAAXM,WAAW;IACXC,gBAAgB,GAAAP,IAAA,CAAhBO,gBAAgB;IAChBC,cAAc,GAAAR,IAAA,CAAdQ,cAAc;IACdC,IAAI,GAAAT,IAAA,CAAJS,IAAI;IACJC,WAAW,GAAAV,IAAA,CAAXU,WAAW,CAAA;AAEX,EAAA,IAAIC,eAAO,CAACV,KAAK,CAAC,EAAE;AAChB,IAAA,IAAI,CAACI,KAAK,IAAIG,cAAc,KAAK,OAAO,EAAE;AACtC,MAAA,oBAAOI,KAAA,CAAAC,aAAA,CAACC,4BAAW,EAAA,IAAA,EAAER,WAAyB,CAAC,CAAA;AACnD,KAAA;AAEA,IAAA,oBAAOM,KAAA,CAAAC,aAAA,CAACE,sBAAK,EAAA,IAAA,EAAEV,KAAa,CAAC,CAAA;AACjC,GAAA;EAEA,IAAIW,KAAK,CAACC,OAAO,CAAChB,KAAK,CAAC,IAAIC,cAAc,EAAE;AACxC,IAAA,oBAAOU,KAAA,CAAAC,aAAA,CAACK,SAAI,EAAA;AAACC,MAAAA,IAAI,iDAAAC,MAAA,CAAcnB,KAAK,CAACoB,MAAM,CAAG;AAACnB,MAAAA,cAAc,EAAEA,cAAAA;AAAe,KAAE,CAAC,CAAA;AACrF,GAAA;AAEA,EAAA,IAAIc,KAAK,CAACC,OAAO,CAAChB,KAAK,CAAC,EAAE;IACtB,OAAO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EAAXA,WAAW;AACXC,IAAAA,KAAK,EAALA,KAAK;AACLC,IAAAA,WAAW,EAAXA,WAAW;AACXC,IAAAA,gBAAgB,EAAhBA,gBAAgB;AAChBC,IAAAA,cAAc,EAAdA,cAAc;AACdC,IAAAA,IAAI,EAAJA,IAAI;AACJC,IAAAA,WAAW,EAAXA,WAAAA;AACJ,GAAC,CACQ,CAAC,eAEdE,KAAA,CAAAC,aAAA,CAACsD,iCAAgB,EACbvD,IAAAA,eAAAA,KAAA,CAAAC,aAAA,CAACuD,4BAAW,EAAA;AACR3D,IAAAA,IAAI,EAAEsC,QAAS;AACfsB,IAAAA,KAAK,EAAC,SAAS;AACfV,IAAAA,SAAS,EAAEC,QAAE,CAAChB,qBAAO,CAAC0B,iBAAiB,EAAE3B,gBAAgB,CAAA;AAAE,GAC9D,CACa,CACb,CACC,CACA,CAAC,CAAA;AAE3B;;;;"}
|
1
|
+
{"version":3,"file":"Textfield.js","sources":["../../../../../../../src/components/Select/elements/Target/elements/Textfield/Textfield.tsx"],"sourcesContent":["import React from 'react';\n\nimport { cx, isEmpty } from '../../../../../../utils';\nimport { classes } from '../../../../Select.tokens';\n\nimport { TextfieldProps, GetTextfieldLabelProps } from './Textfield.types';\nimport { Chip } from './elements/Chip/Chip';\nimport {\n StyledButton,\n StyledArrow,\n Wrapper,\n ChipWrapper,\n TextfieldWrapper,\n IconArrowWrapper,\n Label,\n Placeholder,\n InnerLabel,\n InnerLabelWrapper,\n ContentLeftWrapper,\n Value,\n} from './Textfield.styles';\n\nconst getLabel = ({\n value,\n isTargetAmount,\n valueToItemMap,\n onChipClick,\n label,\n placeholder,\n focusedChipIndex,\n labelPlacement,\n size,\n renderValue,\n}: GetTextfieldLabelProps) => {\n if (isEmpty(value)) {\n if (!label || labelPlacement === 'outer') {\n return <Placeholder>{placeholder}</Placeholder>;\n }\n\n return <Label>{label}</Label>;\n }\n\n if (Array.isArray(value) && isTargetAmount) {\n return <Chip text={`Выбрано: ${value.length}`} isTargetAmount={isTargetAmount} />;\n }\n\n if (Array.isArray(value)) {\n return value.map((currentValue, index) => {\n const itemLabel = valueToItemMap.get(currentValue)!.label;\n\n return (\n <Chip\n text={renderValue ? renderValue(currentValue, itemLabel) : itemLabel}\n onClick={(e: React.MouseEvent<HTMLElement>) => {\n e.stopPropagation();\n onChipClick(currentValue);\n }}\n focused={focusedChipIndex === index}\n />\n );\n });\n }\n\n const itemLabel = valueToItemMap.get(value)!.label;\n\n if (!label || labelPlacement === 'outer') {\n return <Value>{renderValue ? renderValue(value, itemLabel) : itemLabel}</Value>;\n }\n\n return (\n <InnerLabelWrapper>\n {size !== 'xs' && <InnerLabel>{label}</InnerLabel>}\n <Value>{renderValue ? renderValue(value, itemLabel) : itemLabel}</Value>\n </InnerLabelWrapper>\n );\n};\n\nexport const Textfield: React.FC<TextfieldProps> = ({\n opened,\n value,\n isTargetAmount,\n multiselect,\n valueToItemMap,\n onChipClick,\n label,\n placeholder,\n onKeyDown,\n focusedChipIndex,\n labelPlacement,\n size,\n contentLeft,\n disabled,\n renderValue,\n focusedPath,\n focusedToValueMap,\n}) => {\n const withArrowInverse = opened ? classes.arrowInverse : undefined;\n\n const iconSize = size === 'xs' ? 'xs' : 's';\n\n const getActiveDescendant = () => {\n const focusedPathAsString = focusedPath.reduce((acc, n) => `${acc}/${n}`, '').replace(/^(\\/)/, '');\n return focusedToValueMap?.get(focusedPathAsString)?.value.toString();\n };\n\n return (\n <TextfieldWrapper opened={opened} value={value}>\n <StyledButton\n stretching=\"filled\"\n className={cx(\n classes.textfieldTarget,\n opened || focusedChipIndex !== null ? classes.selectWithoutBoxShadow : undefined,\n )}\n onKeyDown={onKeyDown}\n disabled={disabled}\n role=\"combobox\"\n aria-controls=\"tree_level_1\"\n aria-expanded={opened}\n aria-activedescendant={getActiveDescendant()}\n aria-label={label}\n >\n <Wrapper>\n {contentLeft && (!multiselect || isEmpty(value)) && (\n <ContentLeftWrapper>{contentLeft}</ContentLeftWrapper>\n )}\n\n <ChipWrapper>\n {getLabel({\n value,\n isTargetAmount,\n valueToItemMap,\n onChipClick,\n label,\n placeholder,\n focusedChipIndex,\n labelPlacement,\n size,\n renderValue,\n })}\n </ChipWrapper>\n\n <IconArrowWrapper>\n <StyledArrow\n size={iconSize}\n color=\"inherit\"\n className={cx(classes.selectTargetArrow, withArrowInverse)}\n />\n </IconArrowWrapper>\n </Wrapper>\n </StyledButton>\n </TextfieldWrapper>\n );\n};\n"],"names":["getLabel","_ref","value","isTargetAmount","valueToItemMap","onChipClick","label","placeholder","focusedChipIndex","labelPlacement","size","renderValue","isEmpty","React","createElement","Placeholder","Label","Array","isArray","Chip","text","concat","length","map","currentValue","index","itemLabel","get","onClick","e","stopPropagation","focused","Value","InnerLabelWrapper","InnerLabel","Textfield","_ref2","opened","multiselect","onKeyDown","contentLeft","disabled","focusedPath","focusedToValueMap","withArrowInverse","classes","arrowInverse","undefined","iconSize","getActiveDescendant","_focusedToValueMap$ge","focusedPathAsString","reduce","acc","n","replace","toString","TextfieldWrapper","StyledButton","stretching","className","cx","textfieldTarget","selectWithoutBoxShadow","role","Wrapper","ContentLeftWrapper","ChipWrapper","IconArrowWrapper","StyledArrow","color","selectTargetArrow"],"mappings":";;;;;;;;;;;AAsBA,IAAMA,QAAQ,GAAG,SAAXA,QAAQA,CAAAC,IAAA,EAWgB;AAAA,EAAA,IAV1BC,KAAK,GAAAD,IAAA,CAALC,KAAK;IACLC,cAAc,GAAAF,IAAA,CAAdE,cAAc;IACdC,cAAc,GAAAH,IAAA,CAAdG,cAAc;IACdC,WAAW,GAAAJ,IAAA,CAAXI,WAAW;IACXC,KAAK,GAAAL,IAAA,CAALK,KAAK;IACLC,WAAW,GAAAN,IAAA,CAAXM,WAAW;IACXC,gBAAgB,GAAAP,IAAA,CAAhBO,gBAAgB;IAChBC,cAAc,GAAAR,IAAA,CAAdQ,cAAc;IACdC,IAAI,GAAAT,IAAA,CAAJS,IAAI;IACJC,WAAW,GAAAV,IAAA,CAAXU,WAAW,CAAA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}
|
@@ -39,7 +39,8 @@ var Button = function Button(_ref) {
|
|
39
39
|
role: "combobox",
|
40
40
|
"aria-controls": "tree_level_1",
|
41
41
|
"aria-expanded": opened,
|
42
|
-
"aria-activedescendant": getActiveDescendant()
|
42
|
+
"aria-activedescendant": getActiveDescendant(),
|
43
|
+
"aria-label": label
|
43
44
|
}, /*#__PURE__*/React.createElement(Label, null, getButtonLabel({
|
44
45
|
value: value,
|
45
46
|
isTargetAmount: isTargetAmount,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Button.js","sources":["../../../../../../../src/components/Select/elements/Target/elements/Button/Button.tsx"],"sourcesContent":["import React from 'react';\n\nimport { cx } from '../../../../../../utils';\nimport { classes } from '../../../../Select.tokens';\nimport { getButtonLabel } from '../../../../utils';\n\nimport { ButtonProps } from './Button.types';\nimport { StyledButton, StyledArrow, Label, ButtonWrapper, IconArrowWrapper } from './Button.styles';\n\nexport const Button: React.FC<ButtonProps> = ({\n opened,\n value,\n isTargetAmount,\n multiselect,\n valueToItemMap,\n onKeyDown,\n label,\n size,\n disabled,\n renderValue,\n focusedPath,\n focusedToValueMap,\n}) => {\n const withArrowInverse = opened ? classes.arrowInverse : undefined;\n\n const iconSize = size === 'xs' ? 'xs' : 's';\n\n const getActiveDescendant = () => {\n const focusedPathAsString = focusedPath.reduce((acc, n) => `${acc}/${n}`, '').replace(/^(\\/)/, '');\n return focusedToValueMap?.get(focusedPathAsString)?.value.toString();\n };\n\n return (\n <ButtonWrapper>\n <StyledButton\n stretching=\"filled\"\n onKeyDown={onKeyDown}\n className={opened ? classes.selectWithoutBoxShadow : undefined}\n disabled={disabled}\n contentRight={\n <IconArrowWrapper>\n <StyledArrow\n size={iconSize}\n color=\"inherit\"\n className={cx(classes.selectTargetArrow, withArrowInverse)}\n />\n </IconArrowWrapper>\n }\n role=\"combobox\"\n aria-controls=\"tree_level_1\"\n aria-expanded={opened}\n aria-activedescendant={getActiveDescendant()}\n >\n <Label>\n {getButtonLabel({\n value,\n isTargetAmount,\n multiselect,\n valueToItemMap,\n label,\n renderValue,\n })}\n </Label>\n </StyledButton>\n </ButtonWrapper>\n );\n};\n"],"names":["Button","_ref","opened","value","isTargetAmount","multiselect","valueToItemMap","onKeyDown","label","size","disabled","renderValue","focusedPath","focusedToValueMap","withArrowInverse","classes","arrowInverse","undefined","iconSize","getActiveDescendant","_focusedToValueMap$ge","focusedPathAsString","reduce","acc","n","concat","replace","get","toString","React","createElement","ButtonWrapper","StyledButton","stretching","className","selectWithoutBoxShadow","contentRight","IconArrowWrapper","StyledArrow","color","cx","selectTargetArrow","role","Label","getButtonLabel"],"mappings":";;;;;;IASaA,MAA6B,GAAG,SAAhCA,MAA6BA,CAAAC,IAAA,EAapC;AAAA,EAAA,IAZFC,MAAM,GAAAD,IAAA,CAANC,MAAM;IACNC,KAAK,GAAAF,IAAA,CAALE,KAAK;IACLC,cAAc,GAAAH,IAAA,CAAdG,cAAc;IACdC,WAAW,GAAAJ,IAAA,CAAXI,WAAW;IACXC,cAAc,GAAAL,IAAA,CAAdK,cAAc;IACdC,SAAS,GAAAN,IAAA,CAATM,SAAS;IACTC,KAAK,GAAAP,IAAA,CAALO,KAAK;IACLC,IAAI,GAAAR,IAAA,CAAJQ,IAAI;IACJC,QAAQ,GAAAT,IAAA,CAARS,QAAQ;IACRC,WAAW,GAAAV,IAAA,CAAXU,WAAW;IACXC,WAAW,GAAAX,IAAA,CAAXW,WAAW;IACXC,iBAAiB,GAAAZ,IAAA,CAAjBY,iBAAiB,CAAA;EAEjB,IAAMC,gBAAgB,GAAGZ,MAAM,GAAGa,OAAO,CAACC,YAAY,GAAGC,SAAS,CAAA;EAElE,IAAMC,QAAQ,GAAGT,IAAI,KAAK,IAAI,GAAG,IAAI,GAAG,GAAG,CAAA;AAE3C,EAAA,IAAMU,mBAAmB,GAAG,SAAtBA,mBAAmBA,GAAS;AAAA,IAAA,IAAAC,qBAAA,CAAA;IAC9B,IAAMC,mBAAmB,GAAGT,WAAW,CAACU,MAAM,CAAC,UAACC,GAAG,EAAEC,CAAC,EAAA;AAAA,MAAA,OAAA,EAAA,CAAAC,MAAA,CAAQF,GAAG,EAAAE,GAAAA,CAAAA,CAAAA,MAAA,CAAID,CAAC,CAAA,CAAA;KAAE,EAAE,EAAE,CAAC,CAACE,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAA;IAClG,OAAOb,iBAAiB,aAAjBA,iBAAiB,KAAA,KAAA,CAAA,IAAA,CAAAO,qBAAA,GAAjBP,iBAAiB,CAAEc,GAAG,CAACN,mBAAmB,CAAC,MAAA,IAAA,IAAAD,qBAAA,KAA3CA,KAAAA,CAAAA,GAAAA,KAAAA,CAAAA,GAAAA,qBAAA,CAA6CjB,KAAK,CAACyB,QAAQ,EAAE,CAAA;GACvE,CAAA;EAED,oBACIC,KAAA,CAAAC,aAAA,CAACC,aAAa,qBACVF,KAAA,CAAAC,aAAA,CAACE,YAAY,EAAA;AACTC,IAAAA,UAAU,EAAC,QAAQ;AACnB1B,IAAAA,SAAS,EAAEA,SAAU;AACrB2B,IAAAA,SAAS,EAAEhC,MAAM,GAAGa,OAAO,CAACoB,sBAAsB,GAAGlB,SAAU;AAC/DP,IAAAA,QAAQ,EAAEA,QAAS;IACnB0B,YAAY,eACRP,KAAA,CAAAC,aAAA,CAACO,gBAAgB,EAAA,IAAA,eACbR,KAAA,CAAAC,aAAA,CAACQ,WAAW,EAAA;AACR7B,MAAAA,IAAI,EAAES,QAAS;AACfqB,MAAAA,KAAK,EAAC,SAAS;AACfL,MAAAA,SAAS,EAAEM,EAAE,CAACzB,OAAO,CAAC0B,iBAAiB,EAAE3B,gBAAgB,CAAA;AAAE,KAC9D,CACa,CACrB;AACD4B,IAAAA,IAAI,EAAC,UAAU;AACf,IAAA,eAAA,EAAc,cAAc;AAC5B,IAAA,eAAA,EAAexC,MAAO;
|
1
|
+
{"version":3,"file":"Button.js","sources":["../../../../../../../src/components/Select/elements/Target/elements/Button/Button.tsx"],"sourcesContent":["import React from 'react';\n\nimport { cx } from '../../../../../../utils';\nimport { classes } from '../../../../Select.tokens';\nimport { getButtonLabel } from '../../../../utils';\n\nimport { ButtonProps } from './Button.types';\nimport { StyledButton, StyledArrow, Label, ButtonWrapper, IconArrowWrapper } from './Button.styles';\n\nexport const Button: React.FC<ButtonProps> = ({\n opened,\n value,\n isTargetAmount,\n multiselect,\n valueToItemMap,\n onKeyDown,\n label,\n size,\n disabled,\n renderValue,\n focusedPath,\n focusedToValueMap,\n}) => {\n const withArrowInverse = opened ? classes.arrowInverse : undefined;\n\n const iconSize = size === 'xs' ? 'xs' : 's';\n\n const getActiveDescendant = () => {\n const focusedPathAsString = focusedPath.reduce((acc, n) => `${acc}/${n}`, '').replace(/^(\\/)/, '');\n return focusedToValueMap?.get(focusedPathAsString)?.value.toString();\n };\n\n return (\n <ButtonWrapper>\n <StyledButton\n stretching=\"filled\"\n onKeyDown={onKeyDown}\n className={opened ? classes.selectWithoutBoxShadow : undefined}\n disabled={disabled}\n contentRight={\n <IconArrowWrapper>\n <StyledArrow\n size={iconSize}\n color=\"inherit\"\n className={cx(classes.selectTargetArrow, withArrowInverse)}\n />\n </IconArrowWrapper>\n }\n role=\"combobox\"\n aria-controls=\"tree_level_1\"\n aria-expanded={opened}\n aria-activedescendant={getActiveDescendant()}\n aria-label={label}\n >\n <Label>\n {getButtonLabel({\n value,\n isTargetAmount,\n multiselect,\n valueToItemMap,\n label,\n renderValue,\n })}\n </Label>\n </StyledButton>\n </ButtonWrapper>\n );\n};\n"],"names":["Button","_ref","opened","value","isTargetAmount","multiselect","valueToItemMap","onKeyDown","label","size","disabled","renderValue","focusedPath","focusedToValueMap","withArrowInverse","classes","arrowInverse","undefined","iconSize","getActiveDescendant","_focusedToValueMap$ge","focusedPathAsString","reduce","acc","n","concat","replace","get","toString","React","createElement","ButtonWrapper","StyledButton","stretching","className","selectWithoutBoxShadow","contentRight","IconArrowWrapper","StyledArrow","color","cx","selectTargetArrow","role","Label","getButtonLabel"],"mappings":";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
|
87
87
|
"aria-expanded": opened,
|
88
|
-
"aria-activedescendant": getActiveDescendant()
|
88
|
+
"aria-activedescendant": getActiveDescendant(),
|
89
|
+
"aria-label": label
|
89
90
|
}, /*#__PURE__*/React.createElement(Wrapper, null, contentLeft && (!multiselect || isEmpty(value)) && /*#__PURE__*/React.createElement(ContentLeftWrapper, null, contentLeft), /*#__PURE__*/React.createElement(ChipWrapper, null, getLabel({
|
90
91
|
value: value,
|
91
92
|
isTargetAmount: isTargetAmount,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Textfield.js","sources":["../../../../../../../src/components/Select/elements/Target/elements/Textfield/Textfield.tsx"],"sourcesContent":["import React from 'react';\n\nimport { cx, isEmpty } from '../../../../../../utils';\nimport { classes } from '../../../../Select.tokens';\n\nimport { TextfieldProps, GetTextfieldLabelProps } from './Textfield.types';\nimport { Chip } from './elements/Chip/Chip';\nimport {\n StyledButton,\n StyledArrow,\n Wrapper,\n ChipWrapper,\n TextfieldWrapper,\n IconArrowWrapper,\n Label,\n Placeholder,\n InnerLabel,\n InnerLabelWrapper,\n ContentLeftWrapper,\n Value,\n} from './Textfield.styles';\n\nconst getLabel = ({\n value,\n isTargetAmount,\n valueToItemMap,\n onChipClick,\n label,\n placeholder,\n focusedChipIndex,\n labelPlacement,\n size,\n renderValue,\n}: GetTextfieldLabelProps) => {\n if (isEmpty(value)) {\n if (!label || labelPlacement === 'outer') {\n return <Placeholder>{placeholder}</Placeholder>;\n }\n\n return <Label>{label}</Label>;\n }\n\n if (Array.isArray(value) && isTargetAmount) {\n return <Chip text={`Выбрано: ${value.length}`} isTargetAmount={isTargetAmount} />;\n }\n\n if (Array.isArray(value)) {\n return value.map((currentValue, index) => {\n const itemLabel = valueToItemMap.get(currentValue)!.label;\n\n return (\n <Chip\n text={renderValue ? renderValue(currentValue, itemLabel) : itemLabel}\n onClick={(e: React.MouseEvent<HTMLElement>) => {\n e.stopPropagation();\n onChipClick(currentValue);\n }}\n focused={focusedChipIndex === index}\n />\n );\n });\n }\n\n const itemLabel = valueToItemMap.get(value)!.label;\n\n if (!label || labelPlacement === 'outer') {\n return <Value>{renderValue ? renderValue(value, itemLabel) : itemLabel}</Value>;\n }\n\n return (\n <InnerLabelWrapper>\n {size !== 'xs' && <InnerLabel>{label}</InnerLabel>}\n <Value>{renderValue ? renderValue(value, itemLabel) : itemLabel}</Value>\n </InnerLabelWrapper>\n );\n};\n\nexport const Textfield: React.FC<TextfieldProps> = ({\n opened,\n value,\n isTargetAmount,\n multiselect,\n valueToItemMap,\n onChipClick,\n label,\n placeholder,\n onKeyDown,\n focusedChipIndex,\n labelPlacement,\n size,\n contentLeft,\n disabled,\n renderValue,\n focusedPath,\n focusedToValueMap,\n}) => {\n const withArrowInverse = opened ? classes.arrowInverse : undefined;\n\n const iconSize = size === 'xs' ? 'xs' : 's';\n\n const getActiveDescendant = () => {\n const focusedPathAsString = focusedPath.reduce((acc, n) => `${acc}/${n}`, '').replace(/^(\\/)/, '');\n return focusedToValueMap?.get(focusedPathAsString)?.value.toString();\n };\n\n return (\n <TextfieldWrapper opened={opened} value={value}>\n <StyledButton\n stretching=\"filled\"\n className={cx(\n classes.textfieldTarget,\n opened || focusedChipIndex !== null ? classes.selectWithoutBoxShadow : undefined,\n )}\n onKeyDown={onKeyDown}\n disabled={disabled}\n role=\"combobox\"\n aria-controls=\"tree_level_1\"\n aria-expanded={opened}\n aria-activedescendant={getActiveDescendant()}\n >\n <Wrapper>\n {contentLeft && (!multiselect || isEmpty(value)) && (\n <ContentLeftWrapper>{contentLeft}</ContentLeftWrapper>\n )}\n\n <ChipWrapper>\n {getLabel({\n value,\n isTargetAmount,\n valueToItemMap,\n onChipClick,\n label,\n placeholder,\n focusedChipIndex,\n labelPlacement,\n size,\n renderValue,\n })}\n </ChipWrapper>\n\n <IconArrowWrapper>\n <StyledArrow\n size={iconSize}\n color=\"inherit\"\n className={cx(classes.selectTargetArrow, withArrowInverse)}\n />\n </IconArrowWrapper>\n </Wrapper>\n </StyledButton>\n </TextfieldWrapper>\n );\n};\n"],"names":["getLabel","_ref","value","isTargetAmount","valueToItemMap","onChipClick","label","placeholder","focusedChipIndex","labelPlacement","size","renderValue","isEmpty","React","createElement","Placeholder","Label","Array","isArray","Chip","text","concat","length","map","currentValue","index","itemLabel","get","onClick","e","stopPropagation","focused","Value","InnerLabelWrapper","InnerLabel","Textfield","_ref2","opened","multiselect","onKeyDown","contentLeft","disabled","focusedPath","focusedToValueMap","withArrowInverse","classes","arrowInverse","undefined","iconSize","getActiveDescendant","_focusedToValueMap$ge","focusedPathAsString","reduce","acc","n","replace","toString","TextfieldWrapper","StyledButton","stretching","className","cx","textfieldTarget","selectWithoutBoxShadow","role","Wrapper","ContentLeftWrapper","ChipWrapper","IconArrowWrapper","StyledArrow","color","selectTargetArrow"],"mappings":";;;;;;;AAsBA,IAAMA,QAAQ,GAAG,SAAXA,QAAQA,CAAAC,IAAA,EAWgB;AAAA,EAAA,IAV1BC,KAAK,GAAAD,IAAA,CAALC,KAAK;IACLC,cAAc,GAAAF,IAAA,CAAdE,cAAc;IACdC,cAAc,GAAAH,IAAA,CAAdG,cAAc;IACdC,WAAW,GAAAJ,IAAA,CAAXI,WAAW;IACXC,KAAK,GAAAL,IAAA,CAALK,KAAK;IACLC,WAAW,GAAAN,IAAA,CAAXM,WAAW;IACXC,gBAAgB,GAAAP,IAAA,CAAhBO,gBAAgB;IAChBC,cAAc,GAAAR,IAAA,CAAdQ,cAAc;IACdC,IAAI,GAAAT,IAAA,CAAJS,IAAI;IACJC,WAAW,GAAAV,IAAA,CAAXU,WAAW,CAAA;AAEX,EAAA,IAAIC,OAAO,CAACV,KAAK,CAAC,EAAE;AAChB,IAAA,IAAI,CAACI,KAAK,IAAIG,cAAc,KAAK,OAAO,EAAE;AACtC,MAAA,oBAAOI,KAAA,CAAAC,aAAA,CAACC,WAAW,EAAA,IAAA,EAAER,WAAyB,CAAC,CAAA;AACnD,KAAA;AAEA,IAAA,oBAAOM,KAAA,CAAA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EAAC;AAAE,GAAA,eAE7CpC,KAAA,CAAAC,aAAA,CAACmD,OAAO,EACHzB,IAAAA,EAAAA,WAAW,KAAK,CAACF,WAAW,IAAI1B,OAAO,CAACV,KAAK,CAAC,CAAC,iBAC5CW,KAAA,CAAAC,aAAA,CAACoD,kBAAkB,QAAE1B,WAAgC,CACxD,eAED3B,KAAA,CAAAC,aAAA,CAACqD,WAAW,EAAA,IAAA,EACPnE,QAAQ,CAAC;AACNE,IAAAA,KAAK,EAALA,KAAK;AACLC,IAAAA,cAAc,EAAdA,cAAc;AACdC,IAAAA,cAAc,EAAdA,cAAc;AACdC,IAAAA,WAAW,EAAXA,WAAW;AACXC,IAAAA,KAAK,EAALA,KAAK;AACLC,IAAAA,WAAW,EAAXA,WAAW;AACXC,IAAAA,gBAAgB,EAAhBA,gBAAgB;AAChBC,IAAAA,cAAc,EAAdA,cAAc;AACdC,IAAAA,IAAI,EAAJA,IAAI;AACJC,IAAAA,WAAW,EAAXA,WAAAA;AACJ,GAAC,CACQ,CAAC,eAEdE,KAAA,CAAAC,aAAA,CAACsD,gBAAgB,EACbvD,IAAAA,eAAAA,KAAA,CAAAC,aAAA,CAACuD,WAAW,EAAA;AACR3D,IAAAA,IAAI,EAAEsC,QAAS;AACfsB,IAAAA,KAAK,EAAC,SAAS;AACfV,IAAAA,SAAS,EAAEC,EAAE,CAAChB,OAAO,CAAC0B,iBAAiB,EAAE3B,gBAAgB,CAAA;AAAE,GAC9D,CACa,CACb,CACC,CACA,CAAC,CAAA;AAE3B;;;;"}
|
1
|
+
{"version":3,"file":"Textfield.js","sources":["../../../../../../../src/components/Select/elements/Target/elements/Textfield/Textfield.tsx"],"sourcesContent":["import React from 'react';\n\nimport { cx, isEmpty } from '../../../../../../utils';\nimport { classes } from '../../../../Select.tokens';\n\nimport { TextfieldProps, GetTextfieldLabelProps } from './Textfield.types';\nimport { Chip } from './elements/Chip/Chip';\nimport {\n StyledButton,\n StyledArrow,\n Wrapper,\n ChipWrapper,\n TextfieldWrapper,\n IconArrowWrapper,\n Label,\n Placeholder,\n InnerLabel,\n InnerLabelWrapper,\n ContentLeftWrapper,\n Value,\n} from './Textfield.styles';\n\nconst getLabel = ({\n value,\n isTargetAmount,\n valueToItemMap,\n onChipClick,\n label,\n placeholder,\n focusedChipIndex,\n labelPlacement,\n size,\n renderValue,\n}: GetTextfieldLabelProps) => {\n if (isEmpty(value)) {\n if (!label || labelPlacement === 'outer') {\n return <Placeholder>{placeholder}</Placeholder>;\n }\n\n return <Label>{label}</Label>;\n }\n\n if (Array.isArray(value) && isTargetAmount) {\n return <Chip text={`Выбрано: ${value.length}`} isTargetAmount={isTargetAmount} />;\n }\n\n if (Array.isArray(value)) {\n return value.map((currentValue, index) => {\n const itemLabel = valueToItemMap.get(currentValue)!.label;\n\n return (\n <Chip\n text={renderValue ? renderValue(currentValue, itemLabel) : itemLabel}\n onClick={(e: React.MouseEvent<HTMLElement>) => {\n e.stopPropagation();\n onChipClick(currentValue);\n }}\n focused={focusedChipIndex === index}\n />\n );\n });\n }\n\n const itemLabel = valueToItemMap.get(value)!.label;\n\n if (!label || labelPlacement === 'outer') {\n return <Value>{renderValue ? renderValue(value, itemLabel) : itemLabel}</Value>;\n }\n\n return (\n <InnerLabelWrapper>\n {size !== 'xs' && <InnerLabel>{label}</InnerLabel>}\n <Value>{renderValue ? renderValue(value, itemLabel) : itemLabel}</Value>\n </InnerLabelWrapper>\n );\n};\n\nexport const Textfield: React.FC<TextfieldProps> = ({\n opened,\n value,\n isTargetAmount,\n multiselect,\n valueToItemMap,\n onChipClick,\n label,\n placeholder,\n onKeyDown,\n focusedChipIndex,\n labelPlacement,\n size,\n contentLeft,\n disabled,\n renderValue,\n focusedPath,\n focusedToValueMap,\n}) => {\n const withArrowInverse = opened ? classes.arrowInverse : undefined;\n\n const iconSize = size === 'xs' ? 'xs' : 's';\n\n const getActiveDescendant = () => {\n const focusedPathAsString = focusedPath.reduce((acc, n) => `${acc}/${n}`, '').replace(/^(\\/)/, '');\n return focusedToValueMap?.get(focusedPathAsString)?.value.toString();\n };\n\n return (\n <TextfieldWrapper opened={opened} value={value}>\n <StyledButton\n stretching=\"filled\"\n className={cx(\n classes.textfieldTarget,\n opened || focusedChipIndex !== null ? classes.selectWithoutBoxShadow : undefined,\n )}\n onKeyDown={onKeyDown}\n disabled={disabled}\n role=\"combobox\"\n aria-controls=\"tree_level_1\"\n aria-expanded={opened}\n aria-activedescendant={getActiveDescendant()}\n aria-label={label}\n >\n <Wrapper>\n {contentLeft && (!multiselect || isEmpty(value)) && (\n <ContentLeftWrapper>{contentLeft}</ContentLeftWrapper>\n )}\n\n <ChipWrapper>\n {getLabel({\n value,\n isTargetAmount,\n valueToItemMap,\n onChipClick,\n label,\n placeholder,\n focusedChipIndex,\n labelPlacement,\n size,\n renderValue,\n })}\n </ChipWrapper>\n\n <IconArrowWrapper>\n <StyledArrow\n size={iconSize}\n color=\"inherit\"\n className={cx(classes.selectTargetArrow, withArrowInverse)}\n />\n </IconArrowWrapper>\n </Wrapper>\n </StyledButton>\n </TextfieldWrapper>\n );\n};\n"],"names":["getLabel","_ref","value","isTargetAmount","valueToItemMap","onChipClick","label","placeholder","focusedChipIndex","labelPlacement","size","renderValue","isEmpty","React","createElement","Placeholder","Label","Array","isArray","Chip","text","concat","length","map","currentValue","index","itemLabel","get","onClick","e","stopPropagation","focused","Value","InnerLabelWrapper","InnerLabel","Textfield","_ref2","opened","multiselect","onKeyDown","contentLeft","disabled","focusedPath","focusedToValueMap","withArrowInverse","classes","arrowInverse","undefined","iconSize","getActiveDescendant","_focusedToValueMap$ge","focusedPathAsString","reduce","acc","n","replace","toString","TextfieldWrapper","StyledButton","stretching","className","cx","textfieldTarget","selectWithoutBoxShadow","role","Wrapper","ContentLeftWrapper","ChipWrapper","IconArrowWrapper","StyledArrow","color","selectTargetArrow"],"mappings":";;;;;;;AAsBA,IAAMA,QAAQ,GAAG,SAAXA,QAAQA,CAAAC,IAAA,EAWgB;AAAA,EAAA,IAV1BC,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IAAI;AACJC,IAAAA,WAAW,EAAXA,WAAAA;AACJ,GAAC,CACQ,CAAC,eAEdE,KAAA,CAAAC,aAAA,CAACsD,gBAAgB,EACbvD,IAAAA,eAAAA,KAAA,CAAAC,aAAA,CAACuD,WAAW,EAAA;AACR3D,IAAAA,IAAI,EAAEsC,QAAS;AACfsB,IAAAA,KAAK,EAAC,SAAS;AACfV,IAAAA,SAAS,EAAEC,EAAE,CAAChB,OAAO,CAAC0B,iBAAiB,EAAE3B,gBAAgB,CAAA;AAAE,GAC9D,CACa,CACb,CACC,CACA,CAAC,CAAA;AAE3B;;;;"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@salutejs/plasma-new-hope",
|
3
|
-
"version": "0.88.0-canary.1233.
|
3
|
+
"version": "0.88.0-canary.1233.9500481670.0",
|
4
4
|
"description": "Salute Design System blueprint",
|
5
5
|
"main": "cjs/index.js",
|
6
6
|
"module": "es/index.js",
|
@@ -68,7 +68,7 @@
|
|
68
68
|
"@rollup/plugin-babel": "^6.0.4",
|
69
69
|
"@rollup/plugin-commonjs": "^25.0.4",
|
70
70
|
"@rollup/plugin-node-resolve": "^15.1.0",
|
71
|
-
"@salutejs/plasma-sb-utils": "0.
|
71
|
+
"@salutejs/plasma-sb-utils": "0.159.0-canary.1233.9500481670.0",
|
72
72
|
"@storybook/addon-docs": "^7.6.17",
|
73
73
|
"@storybook/addon-essentials": "^7.6.17",
|
74
74
|
"@storybook/addons": "^7.6.17",
|
@@ -97,11 +97,11 @@
|
|
97
97
|
"@linaria/core": "5.0.2",
|
98
98
|
"@linaria/react": "5.0.3",
|
99
99
|
"@popperjs/core": "2.11.8",
|
100
|
-
"@salutejs/plasma-core": "1.
|
100
|
+
"@salutejs/plasma-core": "1.161.0-canary.1233.9500481670.0",
|
101
101
|
"focus-visible": "5.2.0",
|
102
102
|
"react-draggable": "4.4.3",
|
103
103
|
"react-popper": "2.3.0",
|
104
104
|
"storeon": "3.1.5"
|
105
105
|
},
|
106
|
-
"gitHead": "
|
106
|
+
"gitHead": "4ad2cf4aebd498b7aff9cbe5deeb838043e4aa26"
|
107
107
|
}
|
@@ -45,7 +45,8 @@ var Button = exports.Button = function Button(_ref) {
|
|
45
45
|
role: "combobox",
|
46
46
|
"aria-controls": "tree_level_1",
|
47
47
|
"aria-expanded": opened,
|
48
|
-
"aria-activedescendant": getActiveDescendant()
|
48
|
+
"aria-activedescendant": getActiveDescendant(),
|
49
|
+
"aria-label": label
|
49
50
|
}, /*#__PURE__*/_react["default"].createElement(_Button.Label, null, (0, _utils2.getButtonLabel)({
|
50
51
|
value: value,
|
51
52
|
isTargetAmount: isTargetAmount,
|
package/styled-components/cjs/components/Select/elements/Target/elements/Textfield/Textfield.js
CHANGED
@@ -90,7 +90,8 @@ var Textfield = exports.Textfield = function Textfield(_ref2) {
|
|
90
90
|
role: "combobox",
|
91
91
|
"aria-controls": "tree_level_1",
|
92
92
|
"aria-expanded": opened,
|
93
|
-
"aria-activedescendant": getActiveDescendant()
|
93
|
+
"aria-activedescendant": getActiveDescendant(),
|
94
|
+
"aria-label": label
|
94
95
|
}, /*#__PURE__*/_react["default"].createElement(_Textfield.Wrapper, null, contentLeft && (!multiselect || (0, _utils.isEmpty)(value)) && /*#__PURE__*/_react["default"].createElement(_Textfield.ContentLeftWrapper, null, contentLeft), /*#__PURE__*/_react["default"].createElement(_Textfield.ChipWrapper, null, getLabel({
|
95
96
|
value: value,
|
96
97
|
isTargetAmount: isTargetAmount,
|
@@ -38,7 +38,8 @@ export var Button = function Button(_ref) {
|
|
38
38
|
role: "combobox",
|
39
39
|
"aria-controls": "tree_level_1",
|
40
40
|
"aria-expanded": opened,
|
41
|
-
"aria-activedescendant": getActiveDescendant()
|
41
|
+
"aria-activedescendant": getActiveDescendant(),
|
42
|
+
"aria-label": label
|
42
43
|
}, /*#__PURE__*/React.createElement(Label, null, getButtonLabel({
|
43
44
|
value: value,
|
44
45
|
isTargetAmount: isTargetAmount,
|
package/styled-components/es/components/Select/elements/Target/elements/Textfield/Textfield.js
CHANGED
@@ -83,7 +83,8 @@ export var Textfield = function Textfield(_ref2) {
|
|
83
83
|
role: "combobox",
|
84
84
|
"aria-controls": "tree_level_1",
|
85
85
|
"aria-expanded": opened,
|
86
|
-
"aria-activedescendant": getActiveDescendant()
|
86
|
+
"aria-activedescendant": getActiveDescendant(),
|
87
|
+
"aria-label": label
|
87
88
|
}, /*#__PURE__*/React.createElement(Wrapper, null, contentLeft && (!multiselect || isEmpty(value)) && /*#__PURE__*/React.createElement(ContentLeftWrapper, null, contentLeft), /*#__PURE__*/React.createElement(ChipWrapper, null, getLabel({
|
88
89
|
value: value,
|
89
90
|
isTargetAmount: isTargetAmount,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/Select/elements/Target/elements/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG7C,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/Select/elements/Target/elements/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG7C,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CA0DxC,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Textfield.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/Select/elements/Target/elements/Textfield/Textfield.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,EAAE,cAAc,EAA0B,MAAM,mBAAmB,CAAC;AAwE3E,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,
|
1
|
+
{"version":3,"file":"Textfield.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/Select/elements/Target/elements/Textfield/Textfield.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,EAAE,cAAc,EAA0B,MAAM,mBAAmB,CAAC;AAwE3E,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CA2E9C,CAAC"}
|