@salutejs/plasma-new-hope 0.151.1-canary.1448.11015403933.0 → 0.151.1-canary.1454.11027859601.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/components/Attach/Attach.js +13 -9
- package/cjs/components/Attach/Attach.js.map +1 -1
- package/cjs/components/Attach/utils/addSeparator.js +17 -0
- package/cjs/components/Attach/utils/addSeparator.js.map +1 -0
- package/cjs/components/Attach/utils/index.js +11 -0
- package/cjs/components/Attach/utils/index.js.map +1 -0
- package/cjs/components/Slider/ui/Handler/Handler.js +24 -26
- package/cjs/components/Slider/ui/Handler/Handler.js.map +1 -1
- package/emotion/cjs/components/Attach/Attach.js +9 -6
- package/emotion/cjs/components/Attach/utils/addSeparator.js +15 -0
- package/emotion/cjs/components/Attach/utils/index.js +9 -7
- package/emotion/cjs/components/Slider/ui/Handler/Handler.js +23 -26
- package/emotion/es/components/Attach/Attach.js +10 -7
- package/emotion/es/components/Attach/utils/addSeparator.js +9 -0
- package/emotion/es/components/Attach/utils/index.js +2 -1
- package/emotion/es/components/Slider/ui/Handler/Handler.js +24 -26
- package/es/components/Attach/Attach.js +13 -9
- package/es/components/Attach/Attach.js.map +1 -1
- package/es/components/Attach/utils/addSeparator.js +13 -0
- package/es/components/Attach/utils/addSeparator.js.map +1 -0
- package/es/components/Attach/utils/index.js +7 -0
- package/es/components/Attach/utils/index.js.map +1 -0
- package/es/components/Slider/ui/Handler/Handler.js +24 -26
- package/es/components/Slider/ui/Handler/Handler.js.map +1 -1
- package/package.json +4 -4
- package/styled-components/cjs/components/Attach/Attach.js +9 -6
- package/styled-components/cjs/components/Attach/utils/addSeparator.js +15 -0
- package/styled-components/cjs/components/Attach/utils/index.js +9 -7
- package/styled-components/cjs/components/Slider/ui/Handler/Handler.js +23 -26
- package/styled-components/es/components/Attach/Attach.js +10 -7
- package/styled-components/es/components/Attach/utils/addSeparator.js +9 -0
- package/styled-components/es/components/Attach/utils/index.js +2 -1
- package/styled-components/es/components/Slider/ui/Handler/Handler.js +24 -26
- package/types/components/Attach/Attach.d.ts.map +1 -1
- package/types/components/Attach/utils/addSeparator.d.ts +2 -0
- package/types/components/Attach/utils/addSeparator.d.ts.map +1 -0
- package/types/components/Attach/utils/index.d.ts +2 -1
- package/types/components/Attach/utils/index.d.ts.map +1 -1
- package/types/components/Slider/ui/Handler/Handler.d.ts +5 -0
- package/types/components/Slider/ui/Handler/Handler.d.ts.map +1 -1
- package/cjs/components/Attach/utils/truncateFilename.js +0 -24
- package/cjs/components/Attach/utils/truncateFilename.js.map +0 -1
- package/emotion/cjs/components/Attach/utils/truncateFilename.js +0 -23
- package/emotion/es/components/Attach/utils/truncateFilename.js +0 -17
- package/es/components/Attach/utils/truncateFilename.js +0 -20
- package/es/components/Attach/utils/truncateFilename.js.map +0 -1
- package/styled-components/cjs/components/Attach/utils/truncateFilename.js +0 -23
- package/styled-components/es/components/Attach/utils/truncateFilename.js +0 -17
- package/types/components/Attach/utils/truncateFilename.d.ts +0 -7
- package/types/components/Attach/utils/truncateFilename.d.ts.map +0 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Attach.js","sources":["../../../src/components/Attach/Attach.tsx"],"sourcesContent":["import React, { forwardRef, useEffect, useRef, useState } from 'react';\nimport { useForkRef, useIsomorphicLayoutEffect } from '@salutejs/plasma-core';\n\nimport { RootProps } from '../../engines';\nimport { cx } from '../../utils';\nimport { IconCloseCircleOutline } from '../_Icon';\n\nimport { AttachProps } from './Attach.types';\nimport { base as sizeCSS } from './variations/_size/base';\nimport { base as viewCSS } from './variations/_view/base';\nimport { base, StyledHiddenInput, StyledHiddenInputHelper } from './Attach.styles';\nimport { StyledCell } from './ui/Cell/Cell';\nimport { extractExtension, getFileicon, truncateFilename } from './utils';\nimport { classes } from './Attach.tokens';\nimport { AttachButton } from './components/AttachButton';\nimport { StyledIconButtonCancel } from './ui/IconButton/IconButton.styles';\n\nexport const attachRoot = (Root: RootProps<HTMLDivElement, AttachProps>) =>\n forwardRef<HTMLDivElement, AttachProps>((props, outerRef) => {\n const {\n flow = 'auto',\n buttonType = 'button',\n hasAttachment = true,\n acceptedFileFormats,\n size,\n view,\n className,\n style,\n isLoading,\n disabled,\n ...rest\n } = props;\n\n const innerRef = useRef<HTMLDivElement>(null);\n const ref = useForkRef(outerRef, innerRef);\n\n const inputRef = useRef<HTMLInputElement | null>(null);\n const inputHelperRef = useRef<HTMLDivElement | null>(null);\n const cellRef = useRef<HTMLDivElement | null>(null);\n const buttonRef = useRef<HTMLButtonElement | null>(null);\n\n const emptyTextCellWidth = useRef<number | null>(null);\n\n const [filename, setFilename] = useState<string>('');\n const [truncatedFilename, setTruncatedFilename] = useState<string>('');\n\n const horizontalClass = flow === 'horizontal' ? classes.horizontal : undefined;\n const verticalClass = flow === 'vertical' ? classes.vertical : undefined;\n const autoClass = flow === 'auto' ? classes.auto : undefined;\n const cellHiddenClass = truncatedFilename.length === 0 ? classes.cellHidden : undefined;\n\n const accept = acceptedFileFormats?.join(',');\n const extension = extractExtension(filename);\n const cellContentLeft = getFileicon(extension, size);\n\n useEffect(() => {\n emptyTextCellWidth.current = cellRef.current?.offsetWidth || 0;\n }, []);\n\n useIsomorphicLayoutEffect(() => {\n if (\n !cellRef.current ||\n !cellRef.current.parentElement ||\n !inputHelperRef.current ||\n !inputHelperRef.current.textContent ||\n !emptyTextCellWidth.current ||\n !buttonRef.current\n ) {\n return;\n }\n\n const { offsetWidth: textWidth } = inputHelperRef.current;\n const { offsetWidth: buttonWidth } = buttonRef.current;\n const { width: parentWidth, left: parentLeft } = cellRef.current.parentElement.getBoundingClientRect();\n const { left: cellLeft } = cellRef.current.getBoundingClientRect();\n const leftDiff = cellLeft - parentLeft;\n\n let currentTextWidth = textWidth;\n let currFilename = filename;\n\n for (let i = filename.length - 1; i > 0; i -= 1) {\n if (currentTextWidth + emptyTextCellWidth.current + leftDiff <= parentWidth) {\n break;\n }\n\n const newFilename = truncateFilename({\n filename: inputHelperRef.current.textContent,\n startNameTruncationIndex: i,\n });\n inputHelperRef.current.textContent = newFilename;\n currentTextWidth = inputHelperRef.current.offsetWidth;\n\n if (currentTextWidth + emptyTextCellWidth.current < buttonWidth) {\n break;\n }\n\n currFilename = newFilename;\n }\n\n inputHelperRef.current.textContent = filename;\n setTruncatedFilename(currFilename);\n });\n\n const handleClick = () => {\n if (!inputRef.current) {\n return;\n }\n\n inputRef.current.click();\n };\n\n const handleChange = () => {\n if (!inputRef.current || !inputRef.current.files) {\n return;\n }\n\n setFilename(inputRef.current.files[0].name);\n };\n\n const handleClear = () => {\n if (!inputRef.current) {\n return;\n }\n\n inputRef.current.value = '';\n setFilename('');\n setTruncatedFilename('');\n };\n\n return (\n <Root\n className={cx(horizontalClass, verticalClass, autoClass, className)}\n style={style}\n size={size}\n view={view}\n ref={ref}\n >\n <StyledHiddenInput\n ref={inputRef}\n accept={accept}\n type=\"file\"\n id=\"attachHiddenInput\"\n name=\"attachHiddenInput\"\n onChange={handleChange}\n />\n <StyledHiddenInputHelper ref={inputHelperRef} id=\"attachHiddenInputHelper\">\n {filename}\n </StyledHiddenInputHelper>\n\n <AttachButton\n buttonType={buttonType}\n view={view}\n size={size}\n onClick={handleClick}\n isLoading={isLoading}\n disabled={disabled}\n ref={buttonRef}\n {...rest}\n />\n {hasAttachment && (\n <StyledCell\n stretching=\"fixed\"\n className={cellHiddenClass}\n ref={cellRef}\n size={size}\n title={truncatedFilename}\n contentLeft={cellContentLeft}\n contentRight={\n <StyledIconButtonCancel view={view} size={size} onClick={handleClear}>\n <IconCloseCircleOutline size=\"xs\" color=\"inherit\" />\n </StyledIconButtonCancel>\n }\n />\n )}\n </Root>\n );\n });\n\nexport const attachConfig = {\n name: 'Attach',\n tag: 'div',\n layout: attachRoot,\n base,\n variations: {\n view: {\n css: viewCSS,\n },\n size: {\n css: sizeCSS,\n },\n },\n defaults: {\n view: 'default',\n size: 'm',\n },\n};\n"],"names":["attachRoot","Root","forwardRef","props","outerRef","_props$flow","flow","_props$buttonType","buttonType","_props$hasAttachment","hasAttachment","acceptedFileFormats","size","view","className","style","isLoading","disabled","rest","_objectWithoutProperties","_excluded","innerRef","useRef","ref","useForkRef","inputRef","inputHelperRef","cellRef","buttonRef","emptyTextCellWidth","_useState","useState","_useState2","_slicedToArray","filename","setFilename","_useState3","_useState4","truncatedFilename","setTruncatedFilename","horizontalClass","classes","horizontal","undefined","verticalClass","vertical","autoClass","auto","cellHiddenClass","length","cellHidden","accept","join","extension","extractExtension","cellContentLeft","getFileicon","useEffect","_cellRef$current","current","offsetWidth","useIsomorphicLayoutEffect","parentElement","textContent","textWidth","buttonWidth","_cellRef$current$pare","getBoundingClientRect","parentWidth","width","parentLeft","left","_cellRef$current$getB","cellLeft","leftDiff","currentTextWidth","currFilename","i","newFilename","truncateFilename","startNameTruncationIndex","handleClick","click","handleChange","files","name","handleClear","value","React","createElement","cx","StyledHiddenInput","type","id","onChange","StyledHiddenInputHelper","AttachButton","_extends","onClick","StyledCell","stretching","title","contentLeft","contentRight","StyledIconButtonCancel","_IconCloseCircleOutli","IconCloseCircleOutline","color","attachConfig","tag","layout","base","variations","css","viewCSS","sizeCSS","defaults"],"mappings":";;;;;;;;;;;;;;;;;;;IAiBaA,UAAU,GAAG,SAAbA,UAAUA,CAAIC,IAA4C,EAAA;AAAA,EAAA,oBACnEC,UAAU,CAA8B,UAACC,KAAK,EAAEC,QAAQ,EAAK;AACzD,IAAA,IAAAC,WAAA,GAYIF,KAAK,CAXLG,IAAI;AAAJA,MAAAA,IAAI,GAAAD,WAAA,KAAG,KAAA,CAAA,GAAA,MAAM,GAAAA,WAAA;MAAAE,iBAAA,GAWbJ,KAAK,CAVLK,UAAU;AAAVA,MAAAA,UAAU,GAAAD,iBAAA,KAAG,KAAA,CAAA,GAAA,QAAQ,GAAAA,iBAAA;MAAAE,oBAAA,GAUrBN,KAAK,CATLO,aAAa;AAAbA,MAAAA,aAAa,GAAAD,oBAAA,KAAG,KAAA,CAAA,GAAA,IAAI,GAAAA,oBAAA;MACpBE,mBAAmB,GAQnBR,KAAK,CARLQ,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A;AAAC3F,QAAAA,IAAI,EAAEA,IAAK;AAACD,QAAAA,IAAI,EAAEA,IAAK;AAACsF,QAAAA,OAAO,EAAEZ,WAAAA;OAAYmB,EAAAA,qBAAA,KAAAA,qBAAA,gBACjEjB,KAAA,CAAAC,aAAA,CAACiB,sBAAsB,EAAA;AAAC9F,QAAAA,IAAI,EAAC,IAAI;AAAC+F,QAAAA,KAAK,EAAC,SAAA;AAAS,OAAE,CAAC,CAChC,CAAA;AAC3B,KACJ,CAEH,CAAC,CAAA;AAEf,GAAC,CAAC,CAAA;AAAA,EAAA;AAEC,IAAMC,YAAY,GAAG;AACxBvB,EAAAA,IAAI,EAAE,QAAQ;AACdwB,EAAAA,GAAG,EAAE,KAAK;AACVC,EAAAA,MAAM,EAAE9G,UAAU;AAClB+G,EAAAA,IAAI,EAAJA,IAAI;AACJC,EAAAA,UAAU,EAAE;AACRnG,IAAAA,IAAI,EAAE;AACFoG,MAAAA,GAAG,EAAEC,MAAAA;KACR;AACDtG,IAAAA,IAAI,EAAE;AACFqG,MAAAA,GAAG,EAAEE,MAAAA;AACT,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACNvG,IAAAA,IAAI,EAAE,SAAS;AACfD,IAAAA,IAAI,EAAE,GAAA;AACV,GAAA;AACJ;;;;"}
|
1
|
+
{"version":3,"file":"Attach.js","sources":["../../../src/components/Attach/Attach.tsx"],"sourcesContent":["import React, { forwardRef, useEffect, useRef, useState } from 'react';\nimport { useForkRef, useIsomorphicLayoutEffect } from '@salutejs/plasma-core';\n\nimport { RootProps } from '../../engines';\nimport { cx } from '../../utils';\nimport { IconCloseCircleOutline } from '../_Icon';\n\nimport { AttachProps } from './Attach.types';\nimport { base as sizeCSS } from './variations/_size/base';\nimport { base as viewCSS } from './variations/_view/base';\nimport { base, StyledHiddenInput, StyledHiddenInputHelper } from './Attach.styles';\nimport { StyledCell } from './ui/Cell/Cell';\nimport { extractExtension, getFileicon, addSeparator, separator } from './utils';\nimport { classes } from './Attach.tokens';\nimport { AttachButton } from './components/AttachButton';\nimport { StyledIconButtonCancel } from './ui/IconButton/IconButton.styles';\n\nexport const attachRoot = (Root: RootProps<HTMLDivElement, AttachProps>) =>\n forwardRef<HTMLDivElement, AttachProps>((props, outerRef) => {\n const {\n flow = 'auto',\n buttonType = 'button',\n hasAttachment = true,\n acceptedFileFormats,\n size,\n view,\n className,\n style,\n isLoading,\n disabled,\n ...rest\n } = props;\n\n const innerRef = useRef<HTMLDivElement>(null);\n const ref = useForkRef(outerRef, innerRef);\n\n const inputRef = useRef<HTMLInputElement | null>(null);\n const inputHelperRef = useRef<HTMLDivElement | null>(null);\n const cellRef = useRef<HTMLDivElement | null>(null);\n const buttonRef = useRef<HTMLButtonElement | null>(null);\n\n const emptyTextCellWidth = useRef<number | null>(null);\n\n const [filename, setFilename] = useState<string>('');\n const [truncatedFilename, setTruncatedFilename] = useState<string>('');\n\n const horizontalClass = flow === 'horizontal' ? classes.horizontal : undefined;\n const verticalClass = flow === 'vertical' ? classes.vertical : undefined;\n const autoClass = flow === 'auto' ? classes.auto : undefined;\n const cellHiddenClass = truncatedFilename.length === 0 ? classes.cellHidden : undefined;\n\n const accept = acceptedFileFormats?.join(',');\n const extension = extractExtension(filename);\n const cellContentLeft = getFileicon(extension, size);\n\n useEffect(() => {\n emptyTextCellWidth.current = cellRef.current?.offsetWidth || 0;\n }, []);\n\n useIsomorphicLayoutEffect(() => {\n if (\n !cellRef.current ||\n !cellRef.current.parentElement ||\n !inputHelperRef.current ||\n !inputHelperRef.current.textContent ||\n !emptyTextCellWidth.current ||\n !buttonRef.current\n ) {\n return;\n }\n\n const { offsetWidth: textWidth } = inputHelperRef.current;\n const { offsetWidth: buttonWidth } = buttonRef.current;\n const { width: parentWidth, left: parentLeft } = cellRef.current.parentElement.getBoundingClientRect();\n const { left: cellLeft } = cellRef.current.getBoundingClientRect();\n const leftDiff = cellLeft - parentLeft;\n let currentTextWidth = textWidth;\n\n if (\n currentTextWidth + emptyTextCellWidth.current + leftDiff <= parentWidth ||\n currentTextWidth + emptyTextCellWidth.current < buttonWidth\n ) {\n setTruncatedFilename(filename);\n return;\n }\n\n let currFilename = addSeparator(filename, separator);\n for (let i = currFilename.indexOf(separator) - 1; i > 0; i -= 1) {\n if (currentTextWidth + emptyTextCellWidth.current + leftDiff <= parentWidth) {\n break;\n }\n\n const left = currFilename.slice(0, i);\n const right = currFilename.slice(i + 1);\n const newFilename = `${left}${right}`;\n inputHelperRef.current.textContent = newFilename;\n currentTextWidth = inputHelperRef.current.offsetWidth;\n\n if (currentTextWidth + emptyTextCellWidth.current < buttonWidth) {\n break;\n }\n\n currFilename = newFilename;\n }\n\n inputHelperRef.current.textContent = filename;\n setTruncatedFilename(currFilename);\n });\n\n const handleClick = () => {\n if (!inputRef.current) {\n return;\n }\n\n inputRef.current.click();\n };\n\n const handleChange = () => {\n if (!inputRef.current || !inputRef.current.files) {\n return;\n }\n\n setFilename(inputRef.current.files[0].name);\n };\n\n const handleClear = () => {\n if (!inputRef.current) {\n return;\n }\n\n inputRef.current.value = '';\n setFilename('');\n setTruncatedFilename('');\n };\n\n return (\n <Root\n className={cx(horizontalClass, verticalClass, autoClass, className)}\n style={style}\n size={size}\n view={view}\n ref={ref}\n >\n <StyledHiddenInput\n ref={inputRef}\n accept={accept}\n type=\"file\"\n id=\"attachHiddenInput\"\n name=\"attachHiddenInput\"\n onChange={handleChange}\n />\n <StyledHiddenInputHelper ref={inputHelperRef} id=\"attachHiddenInputHelper\">\n {filename}\n </StyledHiddenInputHelper>\n\n <AttachButton\n buttonType={buttonType}\n view={view}\n size={size}\n onClick={handleClick}\n isLoading={isLoading}\n disabled={disabled}\n ref={buttonRef}\n {...rest}\n />\n {hasAttachment && (\n <StyledCell\n stretching=\"fixed\"\n className={cellHiddenClass}\n ref={cellRef}\n size={size}\n title={truncatedFilename}\n contentLeft={cellContentLeft}\n contentRight={\n <StyledIconButtonCancel view={view} size={size} onClick={handleClear}>\n <IconCloseCircleOutline size=\"xs\" color=\"inherit\" />\n </StyledIconButtonCancel>\n }\n />\n )}\n </Root>\n );\n });\n\nexport const attachConfig = {\n name: 'Attach',\n tag: 'div',\n layout: attachRoot,\n base,\n variations: {\n view: {\n css: viewCSS,\n },\n size: {\n css: sizeCSS,\n },\n },\n defaults: {\n view: 'default',\n size: 'm',\n },\n};\n"],"names":["attachRoot","Root","forwardRef","props","outerRef","_props$flow","flow","_props$buttonType","buttonType","_props$hasAttachment","hasAttachment","acceptedFileFormats","size","view","className","style","isLoading","disabled","rest","_objectWithoutProperties","_excluded","innerRef","useRef","ref","useForkRef","inputRef","inputHelperRef","cellRef","buttonRef","emptyTextCellWidth","_useState","useState","_useState2","_slicedToArray","filename","setFilename","_useState3","_useState4","truncatedFilename","setTruncatedFilename","horizontalClass","classes","horizontal","undefined","verticalClass","vertical","autoClass","auto","cellHiddenClass","length","cellHidden","accept","join","extension","extractExtension","cellContentLeft","getFileicon","useEffect","_cellRef$current","current","offsetWidth","useIsomorphicLayoutEffect","parentElement","textContent","textWidth","buttonWidth","_cellRef$current$pare","getBoundingClientRect","parentWidth","width","parentLeft","left","_cellRef$current$getB","cellLeft","leftDiff","currentTextWidth","currFilename","addSeparator","separator","i","indexOf","slice","right","newFilename","concat","handleClick","click","handleChange","files","name","handleClear","value","React","createElement","cx","StyledHiddenInput","type","id","onChange","StyledHiddenInputHelper","AttachButton","_extends","onClick","StyledCell","stretching","title","contentLeft","contentRight","StyledIconButtonCancel","_IconCloseCircleOutli","IconCloseCircleOutline","color","attachConfig","tag","layout","base","variations","css","viewCSS","sizeCSS","defaults"],"mappings":";;;;;;;;;;;;;;;;;;;;IAiBaA,UAAU,GAAG,SAAbA,UAAUA,CAAIC,IAA4C,EAAA;AAAA,EAAA,oBACnEC,UAAU,CAA8B,UAACC,KAAK,EAAEC,QAAQ,EAAK;AACzD,IAAA,IAAAC,WAAA,GAYIF,KAAK,CAXLG,IAAI;AAAJA,MAAAA,IAAI,GAAAD,WAAA,KAAG,KAAA,CAAA,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AAA,IAAI,EAAE;AACFwG,MAAAA,GAAG,EAAEC,MAAAA;KACR;AACD1G,IAAAA,IAAI,EAAE;AACFyG,MAAAA,GAAG,EAAEE,MAAAA;AACT,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACN3G,IAAAA,IAAI,EAAE,SAAS;AACfD,IAAAA,IAAI,EAAE,GAAA;AACV,GAAA;AACJ;;;;"}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { extractExtension } from './extractExtension.js';
|
2
|
+
|
3
|
+
var addSeparator = function addSeparator(filename, separator) {
|
4
|
+
var extension = extractExtension(filename);
|
5
|
+
var strings = filename.split('.');
|
6
|
+
var name = strings.length > 1 ? strings.slice(0, -1).join('.') : strings[0];
|
7
|
+
var lastChar = name[name.length - 1];
|
8
|
+
var dotChar = '.';
|
9
|
+
return extension === name ? "".concat(name.slice(0, -1)).concat(separator).concat(lastChar) : "".concat(name.slice(0, -1)).concat(separator).concat(lastChar).concat(dotChar).concat(extension);
|
10
|
+
};
|
11
|
+
|
12
|
+
export { addSeparator };
|
13
|
+
//# sourceMappingURL=addSeparator.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"addSeparator.js","sources":["../../../../src/components/Attach/utils/addSeparator.ts"],"sourcesContent":["import { extractExtension } from './extractExtension';\n\nexport const addSeparator = (filename: string, separator: string) => {\n const extension = extractExtension(filename);\n\n const strings = filename.split('.');\n const name = strings.length > 1 ? strings.slice(0, -1).join('.') : strings[0];\n const lastChar = name[name.length - 1];\n const dotChar = '.';\n\n return extension === name\n ? `${name.slice(0, -1)}${separator}${lastChar}`\n : `${name.slice(0, -1)}${separator}${lastChar}${dotChar}${extension}`;\n};\n"],"names":["addSeparator","filename","separator","extension","extractExtension","strings","split","name","length","slice","join","lastChar","dotChar","concat"],"mappings":";;AAEO,IAAMA,YAAY,GAAG,SAAfA,YAAYA,CAAIC,QAAgB,EAAEC,SAAiB,EAAK;AACjE,EAAA,IAAMC,SAAS,GAAGC,gBAAgB,CAACH,QAAQ,CAAC,CAAA;AAE5C,EAAA,IAAMI,OAAO,GAAGJ,QAAQ,CAACK,KAAK,CAAC,GAAG,CAAC,CAAA;EACnC,IAAMC,IAAI,GAAGF,OAAO,CAACG,MAAM,GAAG,CAAC,GAAGH,OAAO,CAACI,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC,GAAGL,OAAO,CAAC,CAAC,CAAC,CAAA;EAC7E,IAAMM,QAAQ,GAAGJ,IAAI,CAACA,IAAI,CAACC,MAAM,GAAG,CAAC,CAAC,CAAA;EACtC,IAAMI,OAAO,GAAG,GAAG,CAAA;EAEnB,OAAOT,SAAS,KAAKI,IAAI,GAAA,EAAA,CAAAM,MAAA,CAChBN,IAAI,CAACE,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA,CAAAI,MAAA,CAAGX,SAAS,CAAAW,CAAAA,MAAA,CAAGF,QAAQ,CAAAE,GAAAA,EAAAA,CAAAA,MAAA,CACxCN,IAAI,CAACE,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAAI,CAAAA,MAAA,CAAGX,SAAS,EAAAW,MAAA,CAAGF,QAAQ,CAAA,CAAAE,MAAA,CAAGD,OAAO,CAAAC,CAAAA,MAAA,CAAGV,SAAS,CAAE,CAAA;AAC7E;;;;"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/Attach/utils/index.ts"],"sourcesContent":["export { extractExtension } from './extractExtension';\nexport { getFileicon } from './getFileicon';\nexport { addSeparator } from './addSeparator';\n\nexport const separator = '...';\n"],"names":["separator"],"mappings":";;;AAIO,IAAMA,SAAS,GAAG;;;;"}
|
@@ -6,6 +6,9 @@ import { Thumb } from '../Thumb/Thumb.js';
|
|
6
6
|
import { HandlerStyled, StyledValue } from './Handler.styles.js';
|
7
7
|
|
8
8
|
var _excluded = ["stepSize", "onChangeCommitted", "onChange", "xPosition", "min", "max", "bounds", "zIndex", "disabled", "side", "showCurrentValue", "startOffset", "endOffset", "value"];
|
9
|
+
|
10
|
+
// TODO: PLASMA-1707
|
11
|
+
|
9
12
|
var KeyboardSupport = {
|
10
13
|
PageUp: 33,
|
11
14
|
PageDown: 34,
|
@@ -133,32 +136,27 @@ var Handler = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
133
136
|
lastOnChangeValue.current = computedValue;
|
134
137
|
onChangeCommitted && onChangeCommitted(computedValue, data);
|
135
138
|
};
|
136
|
-
return (
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
},
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
max: max,
|
158
|
-
value: value,
|
159
|
-
disabled: disabled
|
160
|
-
}, rest)), showCurrentValueCondition && /*#__PURE__*/React.createElement(StyledValue, null, value)))
|
161
|
-
);
|
139
|
+
return /*#__PURE__*/React.createElement(Draggable, {
|
140
|
+
axis: "x",
|
141
|
+
bounds: computedBounds,
|
142
|
+
grid: [stepSize, 1],
|
143
|
+
onStop: onStop,
|
144
|
+
onDrag: onDrag,
|
145
|
+
position: position,
|
146
|
+
disabled: disabled
|
147
|
+
}, /*#__PURE__*/React.createElement(HandlerStyled, {
|
148
|
+
ref: ref,
|
149
|
+
style: {
|
150
|
+
zIndex: zIndex
|
151
|
+
},
|
152
|
+
onKeyDown: onKeyPress
|
153
|
+
}, /*#__PURE__*/React.createElement(Thumb, _extends({
|
154
|
+
tabIndex: tabIndex,
|
155
|
+
min: min,
|
156
|
+
max: max,
|
157
|
+
value: value,
|
158
|
+
disabled: disabled
|
159
|
+
}, rest)), showCurrentValueCondition && /*#__PURE__*/React.createElement(StyledValue, null, value)));
|
162
160
|
});
|
163
161
|
|
164
162
|
export { Handler };
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Handler.js","sources":["../../../../../src/components/Slider/ui/Handler/Handler.tsx"],"sourcesContent":["import React, { useRef, forwardRef, KeyboardEvent } from 'react';\nimport Draggable, { DraggableEventHandler } from 'react-draggable';\nimport type { DraggableData } from 'react-draggable';\n\nimport { getSliderThumbValue, getOffsets } from '../../utils';\nimport { Thumb } from '../Thumb/Thumb';\n\nimport type { HandlerProps } from './Handler.types';\nimport { HandlerStyled, StyledValue } from './Handler.styles';\n\nconst KeyboardSupport = {\n PageUp: 33,\n PageDown: 34,\n End: 35,\n Home: 36,\n ArrowLeft: 37,\n ArrowUp: 38,\n ArrowRight: 39,\n ArrowDown: 40,\n};\n\nexport const Handler = forwardRef<HTMLDivElement, HandlerProps>(\n (\n {\n stepSize,\n onChangeCommitted,\n onChange,\n xPosition = 0,\n min,\n max,\n bounds = [],\n zIndex,\n disabled,\n side,\n showCurrentValue = false,\n startOffset = 0,\n endOffset = 0,\n value,\n ...rest\n },\n ref,\n ) => {\n const lastOnChangeValue = useRef<number>();\n\n const [offsetLeft, offsetRight] = getOffsets(ref, side);\n\n const [leftValueBound, rightValueBound] = bounds;\n const leftPositionBound = leftValueBound ? (leftValueBound - min) * stepSize : null;\n const rightPositionBound = rightValueBound ? (rightValueBound - min) * stepSize : null;\n\n const position = typeof xPosition === 'number' ? { x: xPosition, y: 0 } : undefined;\n const tabIndex = disabled ? -1 : 0;\n\n const computedBounds = {\n left: (leftPositionBound ?? 0) - (offsetLeft ? stepSize : 0),\n right: (rightPositionBound ?? stepSize * (max - min)) - (offsetRight ? stepSize : 0),\n };\n\n const showCurrentValueCondition =\n showCurrentValue &&\n ((xPosition >= startOffset && xPosition <= max * stepSize - endOffset) || (xPosition === 0 && value !== 0));\n\n const onDrag: DraggableEventHandler = (_, data) => {\n const newValue = getSliderThumbValue(data.x, stepSize, min, max);\n if (lastOnChangeValue.current !== newValue) {\n onChange?.(newValue, data);\n lastOnChangeValue.current = newValue;\n }\n };\n\n const onStop: DraggableEventHandler = (_, data) => {\n const newValue = getSliderThumbValue(data.x, stepSize, min, max);\n onChangeCommitted && onChangeCommitted(newValue, data);\n };\n\n const onKeyPress = (event: KeyboardEvent<HTMLDivElement>) => {\n event.persist();\n\n const { keyCode, target } = event;\n\n if (!Object.values(KeyboardSupport).includes(keyCode)) {\n return;\n }\n\n const { ArrowUp, ArrowRight, ArrowDown, ArrowLeft, Home, End, PageDown, PageUp } = KeyboardSupport;\n\n const computedMultipleSteps = stepSize * ((rest.multipleStepSize / 100) * max);\n\n const data: DraggableData = {\n x: 0,\n deltaX: stepSize,\n lastX: xPosition,\n y: 0,\n deltaY: 0,\n lastY: 0,\n node: target as HTMLDivElement,\n };\n\n switch (keyCode) {\n case ArrowUp:\n case ArrowRight:\n data.x = xPosition + stepSize;\n break;\n case ArrowDown:\n case ArrowLeft:\n data.x = xPosition - stepSize;\n data.deltaX = -stepSize;\n break;\n case PageUp:\n data.x = xPosition + computedMultipleSteps;\n data.deltaX = computedMultipleSteps;\n break;\n case PageDown:\n data.x = xPosition - computedMultipleSteps;\n data.deltaX = -computedMultipleSteps;\n break;\n case End:\n data.x = max * stepSize;\n break;\n case Home:\n data.x = 0;\n break;\n default:\n data.x = 0;\n }\n\n const { left, right } = computedBounds;\n\n /*\n * INFO: Находим значение в диапазоне между указанными левой и правой границами.\n * Необходимо для правильного расчета положения SliderThumb.\n * см. функция clamp\n */\n const boundedValue = Math.max(Math.min(right, data.x), left);\n\n const computedValue = getSliderThumbValue(boundedValue, stepSize, min, max);\n lastOnChangeValue.current = computedValue;\n\n onChangeCommitted && onChangeCommitted(computedValue, data);\n };\n\n return (\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n <Draggable\n axis=\"x\"\n bounds={computedBounds}\n grid={[stepSize, 1]}\n onStop={onStop}\n onDrag={onDrag}\n position={position}\n disabled={disabled}\n >\n <HandlerStyled ref={ref} style={{ zIndex }} onKeyDown={onKeyPress}>\n <Thumb tabIndex={tabIndex} min={min} max={max} value={value} disabled={disabled} {...rest} />\n {showCurrentValueCondition && <StyledValue>{value}</StyledValue>}\n </HandlerStyled>\n </Draggable>\n );\n },\n);\n"],"names":["KeyboardSupport","PageUp","PageDown","End","Home","ArrowLeft","ArrowUp","ArrowRight","ArrowDown","Handler","forwardRef","_ref","ref","stepSize","onChangeCommitted","onChange","_ref$xPosition","xPosition","min","max","_ref$bounds","bounds","zIndex","disabled","side","_ref$showCurrentValue","showCurrentValue","_ref$startOffset","startOffset","_ref$endOffset","endOffset","value","rest","_objectWithoutProperties","_excluded","lastOnChangeValue","useRef","_getOffsets","getOffsets","_getOffsets2","_slicedToArray","offsetLeft","offsetRight","_bounds","leftValueBound","rightValueBound","leftPositionBound","rightPositionBound","position","x","y","undefined","tabIndex","computedBounds","left","right","showCurrentValueCondition","onDrag","_","data","newValue","getSliderThumbValue","current","onStop","onKeyPress","event","persist","keyCode","target","Object","values","includes","computedMultipleSteps","multipleStepSize","deltaX","lastX","deltaY","lastY","node","boundedValue","Math","computedValue","React","createElement","Draggable","axis","grid","HandlerStyled","style","onKeyDown","Thumb","_extends","StyledValue"],"mappings":";;;;;;;;AAUA,IAAMA,eAAe,GAAG;AACpBC,EAAAA,MAAM,EAAE,EAAE;AACVC,EAAAA,QAAQ,EAAE,EAAE;AACZC,EAAAA,GAAG,EAAE,EAAE;AACPC,EAAAA,IAAI,EAAE,EAAE;AACRC,EAAAA,SAAS,EAAE,EAAE;AACbC,EAAAA,OAAO,EAAE,EAAE;AACXC,EAAAA,UAAU,EAAE,EAAE;AACdC,EAAAA,SAAS,EAAE,EAAA;AACf,CAAC,CAAA;AAEM,IAAMC,OAAO,gBAAGC,UAAU,CAC7B,UAAAC,IAAA,EAkBIC,GAAG,EACF;AAAA,EAAA,IAjBGC,QAAQ,GAAAF,IAAA,CAARE,QAAQ;IACRC,iBAAiB,GAAAH,IAAA,CAAjBG,iBAAiB;IACjBC,QAAQ,GAAAJ,IAAA,CAARI,QAAQ;IAAAC,cAAA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;AAAC4E,MAAAA,KAAK,EAAE;AAAElE,QAAAA,MAAM,EAANA,MAAAA;OAAS;AAACmE,MAAAA,SAAS,EAAEzB,UAAAA;AAAW,KAAA,eAC9DkB,KAAA,CAAAC,aAAA,CAACO,KAAK,EAAAC,QAAA,CAAA;AAACvC,MAAAA,QAAQ,EAAEA,QAAS;AAAClC,MAAAA,GAAG,EAAEA,GAAI;AAACC,MAAAA,GAAG,EAAEA,GAAI;AAACY,MAAAA,KAAK,EAAEA,KAAM;AAACR,MAAAA,QAAQ,EAAEA,QAAAA;AAAS,KAAA,EAAKS,IAAI,CAAG,CAAC,EAC5FwB,yBAAyB,iBAAI0B,KAAA,CAAAC,aAAA,CAACS,WAAW,EAAE7D,IAAAA,EAAAA,KAAmB,CACpD,CACR,CAAA;AAAC,IAAA;AAEpB,CACJ;;;;"}
|
1
|
+
{"version":3,"file":"Handler.js","sources":["../../../../../src/components/Slider/ui/Handler/Handler.tsx"],"sourcesContent":["import React, { useRef, forwardRef, KeyboardEvent } from 'react';\nimport Draggable, { DraggableEventHandler } from 'react-draggable';\nimport type { DraggableData } from 'react-draggable';\n\nimport { getSliderThumbValue, getOffsets } from '../../utils';\nimport { Thumb } from '../Thumb/Thumb';\n\nimport type { HandlerProps } from './Handler.types';\nimport { HandlerStyled, StyledValue } from './Handler.styles';\n\n// TODO: PLASMA-1707\ndeclare module 'react-draggable' {\n export interface DraggableProps {\n children: React.ReactNode;\n }\n}\n\nconst KeyboardSupport = {\n PageUp: 33,\n PageDown: 34,\n End: 35,\n Home: 36,\n ArrowLeft: 37,\n ArrowUp: 38,\n ArrowRight: 39,\n ArrowDown: 40,\n};\n\nexport const Handler = forwardRef<HTMLDivElement, HandlerProps>(\n (\n {\n stepSize,\n onChangeCommitted,\n onChange,\n xPosition = 0,\n min,\n max,\n bounds = [],\n zIndex,\n disabled,\n side,\n showCurrentValue = false,\n startOffset = 0,\n endOffset = 0,\n value,\n ...rest\n },\n ref,\n ) => {\n const lastOnChangeValue = useRef<number>();\n\n const [offsetLeft, offsetRight] = getOffsets(ref, side);\n\n const [leftValueBound, rightValueBound] = bounds;\n const leftPositionBound = leftValueBound ? (leftValueBound - min) * stepSize : null;\n const rightPositionBound = rightValueBound ? (rightValueBound - min) * stepSize : null;\n\n const position = typeof xPosition === 'number' ? { x: xPosition, y: 0 } : undefined;\n const tabIndex = disabled ? -1 : 0;\n\n const computedBounds = {\n left: (leftPositionBound ?? 0) - (offsetLeft ? stepSize : 0),\n right: (rightPositionBound ?? stepSize * (max - min)) - (offsetRight ? stepSize : 0),\n };\n\n const showCurrentValueCondition =\n showCurrentValue &&\n ((xPosition >= startOffset && xPosition <= max * stepSize - endOffset) || (xPosition === 0 && value !== 0));\n\n const onDrag: DraggableEventHandler = (_, data) => {\n const newValue = getSliderThumbValue(data.x, stepSize, min, max);\n if (lastOnChangeValue.current !== newValue) {\n onChange?.(newValue, data);\n lastOnChangeValue.current = newValue;\n }\n };\n\n const onStop: DraggableEventHandler = (_, data) => {\n const newValue = getSliderThumbValue(data.x, stepSize, min, max);\n onChangeCommitted && onChangeCommitted(newValue, data);\n };\n\n const onKeyPress = (event: KeyboardEvent<HTMLDivElement>) => {\n event.persist();\n\n const { keyCode, target } = event;\n\n if (!Object.values(KeyboardSupport).includes(keyCode)) {\n return;\n }\n\n const { ArrowUp, ArrowRight, ArrowDown, ArrowLeft, Home, End, PageDown, PageUp } = KeyboardSupport;\n\n const computedMultipleSteps = stepSize * ((rest.multipleStepSize / 100) * max);\n\n const data: DraggableData = {\n x: 0,\n deltaX: stepSize,\n lastX: xPosition,\n y: 0,\n deltaY: 0,\n lastY: 0,\n node: target as HTMLDivElement,\n };\n\n switch (keyCode) {\n case ArrowUp:\n case ArrowRight:\n data.x = xPosition + stepSize;\n break;\n case ArrowDown:\n case ArrowLeft:\n data.x = xPosition - stepSize;\n data.deltaX = -stepSize;\n break;\n case PageUp:\n data.x = xPosition + computedMultipleSteps;\n data.deltaX = computedMultipleSteps;\n break;\n case PageDown:\n data.x = xPosition - computedMultipleSteps;\n data.deltaX = -computedMultipleSteps;\n break;\n case End:\n data.x = max * stepSize;\n break;\n case Home:\n data.x = 0;\n break;\n default:\n data.x = 0;\n }\n\n const { left, right } = computedBounds;\n\n /*\n * INFO: Находим значение в диапазоне между указанными левой и правой границами.\n * Необходимо для правильного расчета положения SliderThumb.\n * см. функция clamp\n */\n const boundedValue = Math.max(Math.min(right, data.x), left);\n\n const computedValue = getSliderThumbValue(boundedValue, stepSize, min, max);\n lastOnChangeValue.current = computedValue;\n\n onChangeCommitted && onChangeCommitted(computedValue, data);\n };\n\n return (\n <Draggable\n axis=\"x\"\n bounds={computedBounds}\n grid={[stepSize, 1]}\n onStop={onStop}\n onDrag={onDrag}\n position={position}\n disabled={disabled}\n >\n <HandlerStyled ref={ref} style={{ zIndex }} onKeyDown={onKeyPress}>\n <Thumb tabIndex={tabIndex} min={min} max={max} value={value} disabled={disabled} {...rest} />\n {showCurrentValueCondition && <StyledValue>{value}</StyledValue>}\n </HandlerStyled>\n </Draggable>\n );\n },\n);\n"],"names":["KeyboardSupport","PageUp","PageDown","End","Home","ArrowLeft","ArrowUp","ArrowRight","ArrowDown","Handler","forwardRef","_ref","ref","stepSize","onChangeCommitted","onChange","_ref$xPosition","xPosition","min","max","_ref$bounds","bounds","zIndex","disabled","side","_ref$showCurrentValue","showCurrentValue","_ref$startOffset","startOffset","_ref$endOffset","endOffset","value","rest","_objectWithoutProperties","_excluded","lastOnChangeValue","useRef","_getOffsets","getOffsets","_getOffsets2","_slicedToArray","offsetLeft","offsetRight","_bounds","leftValueBound","rightValueBound","leftPositionBound","rightPositionBound","position","x","y","undefined","tabIndex","computedBounds","left","right","showCurrentValueCondition","onDrag","_","data","newValue","getSliderThumbValue","current","onStop","onKeyPress","event","persist","keyCode","target","Object","values","includes","computedMultipleSteps","multipleStepSize","deltaX","lastX","deltaY","lastY","node","boundedValue","Math","computedValue","React","createElement","Draggable","axis","grid","HandlerStyled","style","onKeyDown","Thumb","_ext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AAC2B,OAAO,GAAGmB,aAAa,CAAA;AAEzCnE,IAAAA,iBAAiB,IAAIA,iBAAiB,CAACmE,aAAa,EAAEtB,IAAI,CAAC,CAAA;GAC9D,CAAA;AAED,EAAA,oBACIuB,KAAA,CAAAC,aAAA,CAACC,SAAS,EAAA;AACNC,IAAAA,IAAI,EAAC,GAAG;AACRhE,IAAAA,MAAM,EAAEgC,cAAe;AACvBiC,IAAAA,IAAI,EAAE,CAACzE,QAAQ,EAAE,CAAC,CAAE;AACpBkD,IAAAA,MAAM,EAAEA,MAAO;AACfN,IAAAA,MAAM,EAAEA,MAAO;AACfT,IAAAA,QAAQ,EAAEA,QAAS;AACnBzB,IAAAA,QAAQ,EAAEA,QAAAA;AAAS,GAAA,eAEnB2D,KAAA,CAAAC,aAAA,CAACI,aAAa,EAAA;AAAC3E,IAAAA,GAAG,EAAEA,GAAI;AAAC4E,IAAAA,KAAK,EAAE;AAAElE,MAAAA,MAAM,EAANA,MAAAA;KAAS;AAACmE,IAAAA,SAAS,EAAEzB,UAAAA;AAAW,GAAA,eAC9DkB,KAAA,CAAAC,aAAA,CAACO,KAAK,EAAAC,QAAA,CAAA;AAACvC,IAAAA,QAAQ,EAAEA,QAAS;AAAClC,IAAAA,GAAG,EAAEA,GAAI;AAACC,IAAAA,GAAG,EAAEA,GAAI;AAACY,IAAAA,KAAK,EAAEA,KAAM;AAACR,IAAAA,QAAQ,EAAEA,QAAAA;AAAS,GAAA,EAAKS,IAAI,CAAG,CAAC,EAC5FwB,yBAAyB,iBAAI0B,KAAA,CAAAC,aAAA,CAACS,WAAW,EAAA,IAAA,EAAE7D,KAAmB,CACpD,CACR,CAAC,CAAA;AAEpB,CACJ;;;;"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@salutejs/plasma-new-hope",
|
3
|
-
"version": "0.151.1-canary.
|
3
|
+
"version": "0.151.1-canary.1454.11027859601.0",
|
4
4
|
"description": "Salute Design System blueprint",
|
5
5
|
"main": "cjs/index.js",
|
6
6
|
"module": "es/index.js",
|
@@ -80,7 +80,7 @@
|
|
80
80
|
"@rollup/plugin-babel": "^6.0.4",
|
81
81
|
"@rollup/plugin-commonjs": "^25.0.4",
|
82
82
|
"@rollup/plugin-node-resolve": "^15.1.0",
|
83
|
-
"@salutejs/plasma-sb-utils": "0.178.
|
83
|
+
"@salutejs/plasma-sb-utils": "0.178.0",
|
84
84
|
"@storybook/addon-docs": "^7.6.17",
|
85
85
|
"@storybook/addon-essentials": "^7.6.17",
|
86
86
|
"@storybook/addons": "^7.6.17",
|
@@ -114,7 +114,7 @@
|
|
114
114
|
"@linaria/react": "5.0.3",
|
115
115
|
"@popperjs/core": "2.11.8",
|
116
116
|
"@salutejs/input-core": "2.1.2",
|
117
|
-
"@salutejs/plasma-core": "1.180.
|
117
|
+
"@salutejs/plasma-core": "1.180.0",
|
118
118
|
"@salutejs/react-maskinput": "3.2.6",
|
119
119
|
"dayjs": "1.11.11",
|
120
120
|
"focus-visible": "5.2.0",
|
@@ -123,5 +123,5 @@
|
|
123
123
|
"react-popper": "2.3.0",
|
124
124
|
"storeon": "3.1.5"
|
125
125
|
},
|
126
|
-
"gitHead": "
|
126
|
+
"gitHead": "c1d414729003983e1bde9e37febbae4052b3aebe"
|
127
127
|
}
|
@@ -85,15 +85,18 @@ var attachRoot = exports.attachRoot = function attachRoot(Root) {
|
|
85
85
|
cellLeft = _cellRef$current$getB.left;
|
86
86
|
var leftDiff = cellLeft - parentLeft;
|
87
87
|
var currentTextWidth = textWidth;
|
88
|
-
|
89
|
-
|
88
|
+
if (currentTextWidth + emptyTextCellWidth.current + leftDiff <= parentWidth || currentTextWidth + emptyTextCellWidth.current < buttonWidth) {
|
89
|
+
setTruncatedFilename(filename);
|
90
|
+
return;
|
91
|
+
}
|
92
|
+
var currFilename = (0, _utils2.addSeparator)(filename, _utils2.separator);
|
93
|
+
for (var i = currFilename.indexOf(_utils2.separator) - 1; i > 0; i -= 1) {
|
90
94
|
if (currentTextWidth + emptyTextCellWidth.current + leftDiff <= parentWidth) {
|
91
95
|
break;
|
92
96
|
}
|
93
|
-
var
|
94
|
-
|
95
|
-
|
96
|
-
});
|
97
|
+
var left = currFilename.slice(0, i);
|
98
|
+
var right = currFilename.slice(i + 1);
|
99
|
+
var newFilename = "".concat(left).concat(right);
|
97
100
|
inputHelperRef.current.textContent = newFilename;
|
98
101
|
currentTextWidth = inputHelperRef.current.offsetWidth;
|
99
102
|
if (currentTextWidth + emptyTextCellWidth.current < buttonWidth) {
|
@@ -0,0 +1,15 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.addSeparator = void 0;
|
7
|
+
var _extractExtension = /*#__PURE__*/require("./extractExtension");
|
8
|
+
var addSeparator = exports.addSeparator = function addSeparator(filename, separator) {
|
9
|
+
var extension = (0, _extractExtension.extractExtension)(filename);
|
10
|
+
var strings = filename.split('.');
|
11
|
+
var name = strings.length > 1 ? strings.slice(0, -1).join('.') : strings[0];
|
12
|
+
var lastChar = name[name.length - 1];
|
13
|
+
var dotChar = '.';
|
14
|
+
return extension === name ? "".concat(name.slice(0, -1)).concat(separator).concat(lastChar) : "".concat(name.slice(0, -1)).concat(separator).concat(lastChar).concat(dotChar).concat(extension);
|
15
|
+
};
|
@@ -3,24 +3,26 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
Object.defineProperty(exports, "
|
6
|
+
Object.defineProperty(exports, "addSeparator", {
|
7
7
|
enumerable: true,
|
8
8
|
get: function get() {
|
9
|
-
return
|
9
|
+
return _addSeparator.addSeparator;
|
10
10
|
}
|
11
11
|
});
|
12
|
-
Object.defineProperty(exports, "
|
12
|
+
Object.defineProperty(exports, "extractExtension", {
|
13
13
|
enumerable: true,
|
14
14
|
get: function get() {
|
15
|
-
return
|
15
|
+
return _extractExtension.extractExtension;
|
16
16
|
}
|
17
17
|
});
|
18
|
-
Object.defineProperty(exports, "
|
18
|
+
Object.defineProperty(exports, "getFileicon", {
|
19
19
|
enumerable: true,
|
20
20
|
get: function get() {
|
21
|
-
return
|
21
|
+
return _getFileicon.getFileicon;
|
22
22
|
}
|
23
23
|
});
|
24
|
+
exports.separator = void 0;
|
24
25
|
var _extractExtension = /*#__PURE__*/require("./extractExtension");
|
25
26
|
var _getFileicon = /*#__PURE__*/require("./getFileicon");
|
26
|
-
var
|
27
|
+
var _addSeparator = /*#__PURE__*/require("./addSeparator");
|
28
|
+
var separator = exports.separator = '...';
|
@@ -23,6 +23,8 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
23
23
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
24
24
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
25
25
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
26
|
+
// TODO: PLASMA-1707
|
27
|
+
|
26
28
|
var KeyboardSupport = {
|
27
29
|
PageUp: 33,
|
28
30
|
PageDown: 34,
|
@@ -150,30 +152,25 @@ var Handler = exports.Handler = /*#__PURE__*/(0, _react.forwardRef)(function (_r
|
|
150
152
|
lastOnChangeValue.current = computedValue;
|
151
153
|
onChangeCommitted && onChangeCommitted(computedValue, data);
|
152
154
|
};
|
153
|
-
return (
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
},
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
max: max,
|
175
|
-
value: value,
|
176
|
-
disabled: disabled
|
177
|
-
}, rest)), showCurrentValueCondition && /*#__PURE__*/_react["default"].createElement(_Handler.StyledValue, null, value)))
|
178
|
-
);
|
155
|
+
return /*#__PURE__*/_react["default"].createElement(_reactDraggable["default"], {
|
156
|
+
axis: "x",
|
157
|
+
bounds: computedBounds,
|
158
|
+
grid: [stepSize, 1],
|
159
|
+
onStop: onStop,
|
160
|
+
onDrag: onDrag,
|
161
|
+
position: position,
|
162
|
+
disabled: disabled
|
163
|
+
}, /*#__PURE__*/_react["default"].createElement(_Handler.HandlerStyled, {
|
164
|
+
ref: ref,
|
165
|
+
style: {
|
166
|
+
zIndex: zIndex
|
167
|
+
},
|
168
|
+
onKeyDown: onKeyPress
|
169
|
+
}, /*#__PURE__*/_react["default"].createElement(_Thumb.Thumb, _extends({
|
170
|
+
tabIndex: tabIndex,
|
171
|
+
min: min,
|
172
|
+
max: max,
|
173
|
+
value: value,
|
174
|
+
disabled: disabled
|
175
|
+
}, rest)), showCurrentValueCondition && /*#__PURE__*/_react["default"].createElement(_Handler.StyledValue, null, value)));
|
179
176
|
});
|
@@ -17,7 +17,7 @@ import { base as sizeCSS } from './variations/_size/base';
|
|
17
17
|
import { base as viewCSS } from './variations/_view/base';
|
18
18
|
import { base, StyledHiddenInput, StyledHiddenInputHelper } from './Attach.styles';
|
19
19
|
import { StyledCell } from './ui/Cell/Cell';
|
20
|
-
import { extractExtension, getFileicon,
|
20
|
+
import { extractExtension, getFileicon, addSeparator, separator } from './utils';
|
21
21
|
import { classes } from './Attach.tokens';
|
22
22
|
import { AttachButton } from './components/AttachButton';
|
23
23
|
import { StyledIconButtonCancel } from './ui/IconButton/IconButton.styles';
|
@@ -76,15 +76,18 @@ export var attachRoot = function attachRoot(Root) {
|
|
76
76
|
cellLeft = _cellRef$current$getB.left;
|
77
77
|
var leftDiff = cellLeft - parentLeft;
|
78
78
|
var currentTextWidth = textWidth;
|
79
|
-
|
80
|
-
|
79
|
+
if (currentTextWidth + emptyTextCellWidth.current + leftDiff <= parentWidth || currentTextWidth + emptyTextCellWidth.current < buttonWidth) {
|
80
|
+
setTruncatedFilename(filename);
|
81
|
+
return;
|
82
|
+
}
|
83
|
+
var currFilename = addSeparator(filename, separator);
|
84
|
+
for (var i = currFilename.indexOf(separator) - 1; i > 0; i -= 1) {
|
81
85
|
if (currentTextWidth + emptyTextCellWidth.current + leftDiff <= parentWidth) {
|
82
86
|
break;
|
83
87
|
}
|
84
|
-
var
|
85
|
-
|
86
|
-
|
87
|
-
});
|
88
|
+
var left = currFilename.slice(0, i);
|
89
|
+
var right = currFilename.slice(i + 1);
|
90
|
+
var newFilename = "".concat(left).concat(right);
|
88
91
|
inputHelperRef.current.textContent = newFilename;
|
89
92
|
currentTextWidth = inputHelperRef.current.offsetWidth;
|
90
93
|
if (currentTextWidth + emptyTextCellWidth.current < buttonWidth) {
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { extractExtension } from './extractExtension';
|
2
|
+
export var addSeparator = function addSeparator(filename, separator) {
|
3
|
+
var extension = extractExtension(filename);
|
4
|
+
var strings = filename.split('.');
|
5
|
+
var name = strings.length > 1 ? strings.slice(0, -1).join('.') : strings[0];
|
6
|
+
var lastChar = name[name.length - 1];
|
7
|
+
var dotChar = '.';
|
8
|
+
return extension === name ? "".concat(name.slice(0, -1)).concat(separator).concat(lastChar) : "".concat(name.slice(0, -1)).concat(separator).concat(lastChar).concat(dotChar).concat(extension);
|
9
|
+
};
|
@@ -13,6 +13,9 @@ import Draggable from 'react-draggable';
|
|
13
13
|
import { getSliderThumbValue, getOffsets } from '../../utils';
|
14
14
|
import { Thumb } from '../Thumb/Thumb';
|
15
15
|
import { HandlerStyled, StyledValue } from './Handler.styles';
|
16
|
+
|
17
|
+
// TODO: PLASMA-1707
|
18
|
+
|
16
19
|
var KeyboardSupport = {
|
17
20
|
PageUp: 33,
|
18
21
|
PageDown: 34,
|
@@ -140,30 +143,25 @@ export var Handler = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
140
143
|
lastOnChangeValue.current = computedValue;
|
141
144
|
onChangeCommitted && onChangeCommitted(computedValue, data);
|
142
145
|
};
|
143
|
-
return (
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
},
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
max: max,
|
165
|
-
value: value,
|
166
|
-
disabled: disabled
|
167
|
-
}, rest)), showCurrentValueCondition && /*#__PURE__*/React.createElement(StyledValue, null, value)))
|
168
|
-
);
|
146
|
+
return /*#__PURE__*/React.createElement(Draggable, {
|
147
|
+
axis: "x",
|
148
|
+
bounds: computedBounds,
|
149
|
+
grid: [stepSize, 1],
|
150
|
+
onStop: onStop,
|
151
|
+
onDrag: onDrag,
|
152
|
+
position: position,
|
153
|
+
disabled: disabled
|
154
|
+
}, /*#__PURE__*/React.createElement(HandlerStyled, {
|
155
|
+
ref: ref,
|
156
|
+
style: {
|
157
|
+
zIndex: zIndex
|
158
|
+
},
|
159
|
+
onKeyDown: onKeyPress
|
160
|
+
}, /*#__PURE__*/React.createElement(Thumb, _extends({
|
161
|
+
tabIndex: tabIndex,
|
162
|
+
min: min,
|
163
|
+
max: max,
|
164
|
+
value: value,
|
165
|
+
disabled: disabled
|
166
|
+
}, rest)), showCurrentValueCondition && /*#__PURE__*/React.createElement(StyledValue, null, value)));
|
169
167
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Attach.d.ts","sourceRoot":"","sources":["../../../src/components/Attach/Attach.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAGvE,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAI1C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAU7C,eAAO,MAAM,UAAU,SAAU,UAAU,cAAc,EAAE,WAAW,CAAC,
|
1
|
+
{"version":3,"file":"Attach.d.ts","sourceRoot":"","sources":["../../../src/components/Attach/Attach.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAGvE,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAI1C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAU7C,eAAO,MAAM,UAAU,SAAU,UAAU,cAAc,EAAE,WAAW,CAAC,uFAqKjE,CAAC;AAEP,eAAO,MAAM,YAAY;;;mBAvKQ,UAAU,cAAc,EAAE,WAAW,CAAC;;;;;;;;;;;;;;CAwLtE,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"addSeparator.d.ts","sourceRoot":"","sources":["../../../../src/components/Attach/utils/addSeparator.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY,aAAc,MAAM,aAAa,MAAM,WAW/D,CAAC"}
|
@@ -1,4 +1,5 @@
|
|
1
1
|
export { extractExtension } from './extractExtension';
|
2
2
|
export { getFileicon } from './getFileicon';
|
3
|
-
export {
|
3
|
+
export { addSeparator } from './addSeparator';
|
4
|
+
export declare const separator = "...";
|
4
5
|
//# sourceMappingURL=index.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Attach/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Attach/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,eAAO,MAAM,SAAS,QAAQ,CAAC"}
|
@@ -1,4 +1,9 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import type { HandlerProps } from './Handler.types';
|
3
|
+
declare module 'react-draggable' {
|
4
|
+
interface DraggableProps {
|
5
|
+
children: React.ReactNode;
|
6
|
+
}
|
7
|
+
}
|
3
8
|
export declare const Handler: React.ForwardRefExoticComponent<HandlerProps & React.RefAttributes<HTMLDivElement>>;
|
4
9
|
//# sourceMappingURL=Handler.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Handler.d.ts","sourceRoot":"","sources":["../../../../../src/components/Slider/ui/Handler/Handler.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4C,MAAM,OAAO,CAAC;AAOjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;
|
1
|
+
{"version":3,"file":"Handler.d.ts","sourceRoot":"","sources":["../../../../../src/components/Slider/ui/Handler/Handler.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4C,MAAM,OAAO,CAAC;AAOjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAIpD,OAAO,QAAQ,iBAAiB,CAAC;IAC7B,UAAiB,cAAc;QAC3B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;KAC7B;CACJ;AAaD,eAAO,MAAM,OAAO,qFAyInB,CAAC"}
|
@@ -1,24 +0,0 @@
|
|
1
|
-
'use strict';
|
2
|
-
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
4
|
-
|
5
|
-
var truncateFilename = function truncateFilename(_ref) {
|
6
|
-
var filename = _ref.filename,
|
7
|
-
startNameTruncationIndex = _ref.startNameTruncationIndex,
|
8
|
-
_ref$separator = _ref.separator,
|
9
|
-
separator = _ref$separator === void 0 ? '...' : _ref$separator,
|
10
|
-
_ref$minNameLength = _ref.minNameLength,
|
11
|
-
minNameLength = _ref$minNameLength === void 0 ? 5 : _ref$minNameLength;
|
12
|
-
var strings = filename.split('.');
|
13
|
-
var extension = strings.length > 1 ? strings[strings.length - 1] : null;
|
14
|
-
var name = strings.length > 1 ? strings.slice(0, -1).join('.') : strings[0];
|
15
|
-
if (name.length <= minNameLength || startNameTruncationIndex >= name.length - 1) {
|
16
|
-
return filename;
|
17
|
-
}
|
18
|
-
var lastNameLetter = name[name.length - 1];
|
19
|
-
var truncatedName = "".concat(name.substring(0, startNameTruncationIndex)).concat(separator).concat(lastNameLetter);
|
20
|
-
return extension ? "".concat(truncatedName, ".").concat(extension) : truncatedName;
|
21
|
-
};
|
22
|
-
|
23
|
-
exports.truncateFilename = truncateFilename;
|
24
|
-
//# sourceMappingURL=truncateFilename.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"truncateFilename.js","sources":["../../../../src/components/Attach/utils/truncateFilename.ts"],"sourcesContent":["export const truncateFilename = ({\n filename,\n startNameTruncationIndex,\n separator = '...',\n minNameLength = 5,\n}: {\n filename: string;\n startNameTruncationIndex: number;\n separator?: string;\n minNameLength?: number;\n}) => {\n const strings = filename.split('.');\n const extension = strings.length > 1 ? strings[strings.length - 1] : null;\n const name = strings.length > 1 ? strings.slice(0, -1).join('.') : strings[0];\n\n if (name.length <= minNameLength || startNameTruncationIndex >= name.length - 1) {\n return filename;\n }\n\n const lastNameLetter = name[name.length - 1];\n const truncatedName = `${name.substring(0, startNameTruncationIndex)}${separator}${lastNameLetter}`;\n\n return extension ? `${truncatedName}.${extension}` : truncatedName;\n};\n"],"names":["truncateFilename","_ref","filename","startNameTruncationIndex","_ref$separator","separator","_ref$minNameLength","minNameLength","strings","split","extension","length","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