@chayns-components/core 5.5.34 → 5.5.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +6 -0
- package/lib/cjs/components/accordion/accordion-group/AccordionGroup.js +4 -3
- package/lib/cjs/components/accordion/accordion-group/AccordionGroup.js.map +1 -1
- package/lib/cjs/components/copyable-content/CopyableContent.js +12 -11
- package/lib/cjs/components/copyable-content/CopyableContent.js.map +1 -1
- package/lib/cjs/components/copyable-content/CopyableContent.test.js +4 -11
- package/lib/cjs/components/copyable-content/CopyableContent.test.js.map +1 -1
- package/lib/cjs/components/file-list/FileList.js +4 -3
- package/lib/cjs/components/file-list/FileList.js.map +1 -1
- package/lib/cjs/components/file-list/file-item/FileItem.js +6 -7
- package/lib/cjs/components/file-list/file-item/FileItem.js.map +1 -1
- package/lib/cjs/components/filter/filter-content/FilterContent.js +8 -7
- package/lib/cjs/components/filter/filter-content/FilterContent.js.map +1 -1
- package/lib/cjs/components/filter-buttons/FilterButtons.js +5 -3
- package/lib/cjs/components/filter-buttons/FilterButtons.js.map +1 -1
- package/lib/cjs/components/filter-buttons/all-button/AllButton.js +5 -4
- package/lib/cjs/components/filter-buttons/all-button/AllButton.js.map +1 -1
- package/lib/cjs/components/truncation/Truncation.js +8 -7
- package/lib/cjs/components/truncation/Truncation.js.map +1 -1
- package/lib/cjs/components/truncation/Truncation.test.js +4 -5
- package/lib/cjs/components/truncation/Truncation.test.js.map +1 -1
- package/lib/cjs/constants/textStrings.js +29 -29
- package/lib/cjs/constants/textStrings.js.map +1 -1
- package/lib/esm/components/accordion/accordion-group/AccordionGroup.js +4 -3
- package/lib/esm/components/accordion/accordion-group/AccordionGroup.js.map +1 -1
- package/lib/esm/components/copyable-content/CopyableContent.js +12 -11
- package/lib/esm/components/copyable-content/CopyableContent.js.map +1 -1
- package/lib/esm/components/copyable-content/CopyableContent.test.js +4 -11
- package/lib/esm/components/copyable-content/CopyableContent.test.js.map +1 -1
- package/lib/esm/components/file-list/FileList.js +4 -3
- package/lib/esm/components/file-list/FileList.js.map +1 -1
- package/lib/esm/components/file-list/file-item/FileItem.js +6 -7
- package/lib/esm/components/file-list/file-item/FileItem.js.map +1 -1
- package/lib/esm/components/filter/filter-content/FilterContent.js +8 -7
- package/lib/esm/components/filter/filter-content/FilterContent.js.map +1 -1
- package/lib/esm/components/filter-buttons/FilterButtons.js +5 -3
- package/lib/esm/components/filter-buttons/FilterButtons.js.map +1 -1
- package/lib/esm/components/filter-buttons/all-button/AllButton.js +5 -4
- package/lib/esm/components/filter-buttons/all-button/AllButton.js.map +1 -1
- package/lib/esm/components/truncation/Truncation.js +8 -7
- package/lib/esm/components/truncation/Truncation.js.map +1 -1
- package/lib/esm/components/truncation/Truncation.test.js +4 -5
- package/lib/esm/components/truncation/Truncation.test.js.map +1 -1
- package/lib/esm/constants/textStrings.js +29 -29
- package/lib/esm/constants/textStrings.js.map +1 -1
- package/lib/types/components/accordion/accordion-group/AccordionGroup.d.ts +5 -0
- package/lib/types/constants/textStrings.d.ts +29 -29
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Truncation.js","names":["Textstring","TextstringProvider","ttsToITextString","React","useCallback","useEffect","useLayoutEffect","useRef","useState","textStrings","useFocusRingPortal","useKeyboardFocusHighlighting","ClampPosition","StyledMotionTruncationContent","StyledTruncation","StyledTruncationClamp","StyledTruncationClampFocusWrapper","StyledTruncationClampWrapper","StyledTruncationContent","useIsomorphicLayoutEffect","window","Truncation","collapsedHeight","clampPosition","Right","isOpen","lessLabel","moreLabel","onChange","children","shouldEnableKeyboardHighlighting","shouldShowKeyboardHighlighting","contentRef","clampRef","pendingObservedHeight","internalIsOpen","setInternalIsOpen","Boolean","contentHeight","setContentHeight","hasOverflow","isEnabled","current","frame","updateContentHeight","entries","Math","max","contentRect","height","undefined","requestAnimationFrame","scrollHeight","getBoundingClientRect","resizeObserver","ResizeObserver","mutationObserver","MutationObserver","observe","characterData","childList","subtree","disconnect","cancelAnimationFrame","handleClampClick","event","handleClampKeyDown","key","preventDefault","currentTarget","click","internalMoreLabel","createElement","textstring","components","truncation","more","internalLessLabel","less","collapsedContentHeight","min","targetHeight","className","animate","initial","transition","type","duration","ref","$position","libraryName","onClick","onKeyDown","role","tabIndex"],"sources":["../../../../src/components/truncation/Truncation.tsx"],"sourcesContent":["import { Textstring, TextstringProvider, ttsToITextString } from '@chayns-components/textstring';\nimport React, {\n FC,\n KeyboardEventHandler,\n MouseEvent,\n MouseEventHandler,\n ReactElement,\n useCallback,\n useEffect,\n useLayoutEffect,\n useRef,\n useState,\n} from 'react';\nimport textStrings from '../../constants/textStrings';\nimport { useFocusRingPortal } from '../../hooks/useFocusRingPortal';\nimport { useKeyboardFocusHighlighting } from '../../hooks/useKeyboardFocusHighlighting';\nimport { ClampPosition } from '../../types/truncation';\nimport {\n StyledMotionTruncationContent,\n StyledTruncation,\n StyledTruncationClamp,\n StyledTruncationClampFocusWrapper,\n StyledTruncationClampWrapper,\n StyledTruncationContent,\n} from './Truncation.styles';\n\nexport type TruncationProps = {\n /**\n * The elements that should be expanding or collapsing.\n */\n children: ReactElement;\n /**\n * The position of the clamp.\n */\n clampPosition?: ClampPosition;\n /**\n * The height of the children element in its collapsed state.\n */\n collapsedHeight?: number;\n /**\n * If set to true, the content is exposed.\n */\n isOpen?: boolean;\n /**\n * A text that should be displayed if the content is expanded.\n */\n lessLabel?: string;\n /**\n * A text that should be displayed if the content is collapsed.\n */\n moreLabel?: string;\n /**\n * Function to be executed when the component is expanding or collapsing.\n */\n onChange?: (event: MouseEvent<HTMLAnchorElement>, isOpen: boolean) => void;\n /**\n * Enables keyboard-only focus highlighting.\n */\n shouldEnableKeyboardHighlighting?: boolean;\n};\n\nconst useIsomorphicLayoutEffect = typeof window !== 'undefined' ? useLayoutEffect : useEffect;\n\nconst Truncation: FC<TruncationProps> = ({\n collapsedHeight = 150,\n clampPosition = ClampPosition.Right,\n isOpen,\n lessLabel,\n moreLabel,\n onChange,\n children,\n shouldEnableKeyboardHighlighting,\n}) => {\n const shouldShowKeyboardHighlighting = useKeyboardFocusHighlighting(\n shouldEnableKeyboardHighlighting,\n );\n const contentRef = useRef<HTMLDivElement>(null);\n const clampRef = useRef<HTMLAnchorElement>(null);\n const pendingObservedHeight = useRef(0);\n const [internalIsOpen, setInternalIsOpen] = useState(Boolean(isOpen));\n const [contentHeight, setContentHeight] = useState(0);\n\n useEffect(() => {\n if (typeof isOpen === 'boolean') {\n setInternalIsOpen(isOpen);\n }\n }, [isOpen]);\n\n const hasOverflow = contentHeight > collapsedHeight;\n\n useFocusRingPortal(clampRef, {\n isEnabled: shouldShowKeyboardHighlighting && hasOverflow,\n });\n\n useIsomorphicLayoutEffect(() => {\n if (!contentRef.current) {\n return () => {};\n }\n\n let frame: number | undefined;\n const updateContentHeight = (entries?: ResizeObserverEntry[]) => {\n pendingObservedHeight.current = Math.max(\n pendingObservedHeight.current,\n entries?.[0]?.contentRect.height ?? 0,\n );\n\n if (frame !== undefined) {\n return;\n }\n\n frame = window.requestAnimationFrame(() => {\n frame = undefined;\n\n if (!contentRef.current) {\n return;\n }\n\n setContentHeight(\n Math.max(\n pendingObservedHeight.current,\n contentRef.current.scrollHeight,\n contentRef.current.getBoundingClientRect().height,\n ),\n );\n pendingObservedHeight.current = 0;\n });\n };\n\n const resizeObserver = new ResizeObserver((entries) => updateContentHeight(entries));\n const mutationObserver = new MutationObserver(() => updateContentHeight());\n\n resizeObserver.observe(contentRef.current);\n mutationObserver.observe(contentRef.current, {\n characterData: true,\n childList: true,\n subtree: true,\n });\n updateContentHeight();\n\n return () => {\n resizeObserver.disconnect();\n mutationObserver.disconnect();\n\n if (frame !== undefined) {\n window.cancelAnimationFrame(frame);\n }\n };\n }, [children]);\n\n const handleClampClick = useCallback<MouseEventHandler<HTMLAnchorElement>>(\n (event) => {\n setInternalIsOpen((current) => {\n onChange?.(event, !current);\n return !current;\n });\n },\n [onChange],\n );\n\n const handleClampKeyDown = useCallback<KeyboardEventHandler<HTMLAnchorElement>>((event) => {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n event.currentTarget.click();\n }\n }, []);\n\n const internalMoreLabel = moreLabel ?? (\n <Textstring textstring={ttsToITextString(textStrings.components.truncation.more)} />\n );\n const internalLessLabel = lessLabel ?? (\n <Textstring textstring={ttsToITextString(textStrings.components.truncation.less)} />\n );\n const collapsedContentHeight = Math.min(contentHeight || collapsedHeight, collapsedHeight);\n const targetHeight = internalIsOpen ? contentHeight || collapsedHeight : collapsedContentHeight;\n\n return (\n <StyledTruncation className=\"beta-chayns-truncation\">\n <StyledMotionTruncationContent\n animate={{ height: targetHeight }}\n initial={false}\n transition={{ type: 'tween', duration: 0.2 }}\n >\n <StyledTruncationContent ref={contentRef}>{children}</StyledTruncationContent>\n </StyledMotionTruncationContent>\n {hasOverflow && (\n <StyledTruncationClampWrapper $position={clampPosition}>\n <TextstringProvider libraryName=\"@chayns-components-core\">\n <StyledTruncationClampFocusWrapper>\n <StyledTruncationClamp\n ref={clampRef}\n onClick={handleClampClick}\n onKeyDown={handleClampKeyDown}\n role=\"button\"\n tabIndex={0}\n >\n {internalIsOpen ? internalLessLabel : internalMoreLabel}\n </StyledTruncationClamp>\n </StyledTruncationClampFocusWrapper>\n </TextstringProvider>\n </StyledTruncationClampWrapper>\n )}\n </StyledTruncation>\n );\n};\n\nexport default Truncation;\n"],"mappings":"AAAA,SAASA,UAAU,EAAEC,kBAAkB,EAAEC,gBAAgB,QAAQ,+BAA+B;AAChG,OAAOC,KAAK,IAMRC,WAAW,EACXC,SAAS,EACTC,eAAe,EACfC,MAAM,EACNC,QAAQ,QACL,OAAO;AACd,OAAOC,WAAW,MAAM,6BAA6B;AACrD,SAASC,kBAAkB,QAAQ,gCAAgC;AACnE,SAASC,4BAA4B,QAAQ,0CAA0C;AACvF,SAASC,aAAa,QAAQ,wBAAwB;AACtD,SACIC,6BAA6B,EAC7BC,gBAAgB,EAChBC,qBAAq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,EAAE,KAAM;IACfC,UAAU,EAAE;MAAEC,IAAI,EAAE,OAAO;MAAEC,QAAQ,EAAE;IAAI;EAAE,gBAE7CpF,KAAA,CAAAqE,aAAA,CAACtD,uBAAuB;IAACsE,GAAG,EAAExD;EAAW,GAAEH,QAAkC,CAClD,CAAC,EAC/BW,WAAW,iBACRrC,KAAA,CAAAqE,aAAA,CAACvD,4BAA4B;IAACwE,SAAS,EAAElE;EAAc,gBACnDpB,KAAA,CAAAqE,aAAA,CAACvE,kBAAkB;IAACyF,WAAW,EAAC;EAAyB,gBACrDvF,KAAA,CAAAqE,aAAA,CAACxD,iCAAiC,qBAC9Bb,KAAA,CAAAqE,aAAA,CAACzD,qBAAqB;IAClByE,GAAG,EAAEvD,QAAS;IACd0D,OAAO,EAAE3B,gBAAiB;IAC1B4B,SAAS,EAAE1B,kBAAmB;IAC9B2B,IAAI,EAAC,QAAQ;IACbC,QAAQ,EAAE;EAAE,GAEX3D,cAAc,GAAG0C,iBAAiB,GAAGN,iBACnB,CACQ,CACnB,CACM,CAEpB,CAAC;AAE3B,CAAC;AAED,eAAelD,UAAU","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"Truncation.js","names":["TextStringProviderSSR","Translation","React","useCallback","useEffect","useLayoutEffect","useRef","useState","textStrings","useFocusRingPortal","useKeyboardFocusHighlighting","ClampPosition","StyledMotionTruncationContent","StyledTruncation","StyledTruncationClamp","StyledTruncationClampFocusWrapper","StyledTruncationClampWrapper","StyledTruncationContent","useIsomorphicLayoutEffect","window","Truncation","collapsedHeight","clampPosition","Right","isOpen","lessLabel","moreLabel","onChange","children","shouldEnableKeyboardHighlighting","shouldShowKeyboardHighlighting","contentRef","clampRef","pendingObservedHeight","internalIsOpen","setInternalIsOpen","Boolean","contentHeight","setContentHeight","hasOverflow","isEnabled","current","frame","updateContentHeight","entries","Math","max","contentRect","height","undefined","requestAnimationFrame","scrollHeight","getBoundingClientRect","resizeObserver","ResizeObserver","mutationObserver","MutationObserver","observe","characterData","childList","subtree","disconnect","cancelAnimationFrame","handleClampClick","event","handleClampKeyDown","key","preventDefault","currentTarget","click","internalMoreLabel","createElement","textString","components","truncation","more","internalLessLabel","less","collapsedContentHeight","min","targetHeight","className","animate","initial","transition","type","duration","ref","$position","libraries","id","onClick","onKeyDown","role","tabIndex"],"sources":["../../../../src/components/truncation/Truncation.tsx"],"sourcesContent":["import { TextStringProviderSSR, Translation } from '@chayns/textstrings';\nimport React, {\n FC,\n KeyboardEventHandler,\n MouseEvent,\n MouseEventHandler,\n ReactElement,\n useCallback,\n useEffect,\n useLayoutEffect,\n useRef,\n useState,\n} from 'react';\nimport textStrings from '../../constants/textStrings';\nimport { useFocusRingPortal } from '../../hooks/useFocusRingPortal';\nimport { useKeyboardFocusHighlighting } from '../../hooks/useKeyboardFocusHighlighting';\nimport { ClampPosition } from '../../types/truncation';\nimport {\n StyledMotionTruncationContent,\n StyledTruncation,\n StyledTruncationClamp,\n StyledTruncationClampFocusWrapper,\n StyledTruncationClampWrapper,\n StyledTruncationContent,\n} from './Truncation.styles';\n\nexport type TruncationProps = {\n /**\n * The elements that should be expanding or collapsing.\n */\n children: ReactElement;\n /**\n * The position of the clamp.\n */\n clampPosition?: ClampPosition;\n /**\n * The height of the children element in its collapsed state.\n */\n collapsedHeight?: number;\n /**\n * If set to true, the content is exposed.\n */\n isOpen?: boolean;\n /**\n * A text that should be displayed if the content is expanded.\n */\n lessLabel?: string;\n /**\n * A text that should be displayed if the content is collapsed.\n */\n moreLabel?: string;\n /**\n * Function to be executed when the component is expanding or collapsing.\n */\n onChange?: (event: MouseEvent<HTMLAnchorElement>, isOpen: boolean) => void;\n /**\n * Enables keyboard-only focus highlighting.\n */\n shouldEnableKeyboardHighlighting?: boolean;\n};\n\nconst useIsomorphicLayoutEffect = typeof window !== 'undefined' ? useLayoutEffect : useEffect;\n\nconst Truncation: FC<TruncationProps> = ({\n collapsedHeight = 150,\n clampPosition = ClampPosition.Right,\n isOpen,\n lessLabel,\n moreLabel,\n onChange,\n children,\n shouldEnableKeyboardHighlighting,\n}) => {\n const shouldShowKeyboardHighlighting = useKeyboardFocusHighlighting(\n shouldEnableKeyboardHighlighting,\n );\n const contentRef = useRef<HTMLDivElement>(null);\n const clampRef = useRef<HTMLAnchorElement>(null);\n const pendingObservedHeight = useRef(0);\n const [internalIsOpen, setInternalIsOpen] = useState(Boolean(isOpen));\n const [contentHeight, setContentHeight] = useState(0);\n\n useEffect(() => {\n if (typeof isOpen === 'boolean') {\n setInternalIsOpen(isOpen);\n }\n }, [isOpen]);\n\n const hasOverflow = contentHeight > collapsedHeight;\n\n useFocusRingPortal(clampRef, {\n isEnabled: shouldShowKeyboardHighlighting && hasOverflow,\n });\n\n useIsomorphicLayoutEffect(() => {\n if (!contentRef.current) {\n return () => {};\n }\n\n let frame: number | undefined;\n const updateContentHeight = (entries?: ResizeObserverEntry[]) => {\n pendingObservedHeight.current = Math.max(\n pendingObservedHeight.current,\n entries?.[0]?.contentRect.height ?? 0,\n );\n\n if (frame !== undefined) {\n return;\n }\n\n frame = window.requestAnimationFrame(() => {\n frame = undefined;\n\n if (!contentRef.current) {\n return;\n }\n\n setContentHeight(\n Math.max(\n pendingObservedHeight.current,\n contentRef.current.scrollHeight,\n contentRef.current.getBoundingClientRect().height,\n ),\n );\n pendingObservedHeight.current = 0;\n });\n };\n\n const resizeObserver = new ResizeObserver((entries) => updateContentHeight(entries));\n const mutationObserver = new MutationObserver(() => updateContentHeight());\n\n resizeObserver.observe(contentRef.current);\n mutationObserver.observe(contentRef.current, {\n characterData: true,\n childList: true,\n subtree: true,\n });\n updateContentHeight();\n\n return () => {\n resizeObserver.disconnect();\n mutationObserver.disconnect();\n\n if (frame !== undefined) {\n window.cancelAnimationFrame(frame);\n }\n };\n }, [children]);\n\n const handleClampClick = useCallback<MouseEventHandler<HTMLAnchorElement>>(\n (event) => {\n setInternalIsOpen((current) => {\n onChange?.(event, !current);\n return !current;\n });\n },\n [onChange],\n );\n\n const handleClampKeyDown = useCallback<KeyboardEventHandler<HTMLAnchorElement>>((event) => {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n event.currentTarget.click();\n }\n }, []);\n\n const internalMoreLabel = moreLabel ?? (\n <Translation textString={textStrings.components.truncation.more} />\n );\n const internalLessLabel = lessLabel ?? (\n <Translation textString={textStrings.components.truncation.less} />\n );\n const collapsedContentHeight = Math.min(contentHeight || collapsedHeight, collapsedHeight);\n const targetHeight = internalIsOpen ? contentHeight || collapsedHeight : collapsedContentHeight;\n\n return (\n <StyledTruncation className=\"beta-chayns-truncation\">\n <StyledMotionTruncationContent\n animate={{ height: targetHeight }}\n initial={false}\n transition={{ type: 'tween', duration: 0.2 }}\n >\n <StyledTruncationContent ref={contentRef}>{children}</StyledTruncationContent>\n </StyledMotionTruncationContent>\n {hasOverflow && (\n <StyledTruncationClampWrapper $position={clampPosition}>\n <TextStringProviderSSR libraries=\"chayns-components-v5-core\" id=\"truncation\">\n <StyledTruncationClampFocusWrapper>\n <StyledTruncationClamp\n ref={clampRef}\n onClick={handleClampClick}\n onKeyDown={handleClampKeyDown}\n role=\"button\"\n tabIndex={0}\n >\n {internalIsOpen ? internalLessLabel : internalMoreLabel}\n </StyledTruncationClamp>\n </StyledTruncationClampFocusWrapper>\n </TextStringProviderSSR>\n </StyledTruncationClampWrapper>\n )}\n </StyledTruncation>\n );\n};\n\nexport default Truncation;\n"],"mappings":"AAAA,SAASA,qBAAqB,EAAEC,WAAW,QAAQ,qBAAqB;AACxE,OAAOC,KAAK,IAMRC,WAAW,EACXC,SAAS,EACTC,eAAe,EACfC,MAAM,EACNC,QAAQ,QACL,OAAO;AACd,OAAOC,WAAW,MAAM,6BAA6B;AACrD,SAASC,kBAAkB,QAAQ,gCAAgC;AACnE,SAASC,4BAA4B,QAAQ,0CAA0C;AACvF,SAASC,aAAa,QAAQ,wBAAwB;AACtD,SACIC,6BAA6B,EAC7BC,gBAAgB,EAChBC,qBAAqB,EACrBC,iCAAiC,EACjCC,4BAA4B,EA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IAAI;EAAE,gBAE7CpF,KAAA,CAAAqE,aAAA,CAACtD,uBAAuB;IAACsE,GAAG,EAAExD;EAAW,GAAEH,QAAkC,CAClD,CAAC,EAC/BW,WAAW,iBACRrC,KAAA,CAAAqE,aAAA,CAACvD,4BAA4B;IAACwE,SAAS,EAAElE;EAAc,gBACnDpB,KAAA,CAAAqE,aAAA,CAACvE,qBAAqB;IAACyF,SAAS,EAAC,2BAA2B;IAACC,EAAE,EAAC;EAAY,gBACxExF,KAAA,CAAAqE,aAAA,CAACxD,iCAAiC,qBAC9Bb,KAAA,CAAAqE,aAAA,CAACzD,qBAAqB;IAClByE,GAAG,EAAEvD,QAAS;IACd2D,OAAO,EAAE5B,gBAAiB;IAC1B6B,SAAS,EAAE3B,kBAAmB;IAC9B4B,IAAI,EAAC,QAAQ;IACbC,QAAQ,EAAE;EAAE,GAEX5D,cAAc,GAAG0C,iBAAiB,GAAGN,iBACnB,CACQ,CAChB,CACG,CAEpB,CAAC;AAE3B,CAAC;AAED,eAAelD,UAAU","ignoreList":[]}
|
|
@@ -2,12 +2,11 @@ import { render, screen, waitFor } from '@testing-library/react';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { afterEach, describe, expect, it, vi } from 'vitest';
|
|
4
4
|
import Truncation from './Truncation';
|
|
5
|
-
vi.mock('@chayns
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
vi.mock('@chayns/textstrings', () => ({
|
|
6
|
+
Translation: () => 'Mehr anzeigen',
|
|
7
|
+
TextStringProvider: ({
|
|
8
8
|
children
|
|
9
|
-
}) => children
|
|
10
|
-
ttsToITextString: vi.fn()
|
|
9
|
+
}) => children
|
|
11
10
|
}));
|
|
12
11
|
const resizeObserverCallbacks = [];
|
|
13
12
|
class ResizeObserverMock {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Truncation.test.js","names":["render","screen","waitFor","React","afterEach","describe","expect","it","vi","Truncation","mock","
|
|
1
|
+
{"version":3,"file":"Truncation.test.js","names":["render","screen","waitFor","React","afterEach","describe","expect","it","vi","Truncation","mock","Translation","TextStringProvider","children","resizeObserverCallbacks","ResizeObserverMock","constructor","callback","push","disconnect","observe","unobserve","stubGlobal","triggerResize","height","forEach","contentRect","length","createElement","collapsedHeight","getByRole","name","toBeInTheDocument","queryByRole","not"],"sources":["../../../../src/components/truncation/Truncation.test.tsx"],"sourcesContent":["import { render, screen, waitFor } from '@testing-library/react';\nimport React from 'react';\nimport { afterEach, describe, expect, it, vi } from 'vitest';\nimport Truncation from './Truncation';\n\nvi.mock('@chayns/textstrings', () => ({\n Translation: () => 'Mehr anzeigen',\n TextStringProvider: ({ children }: { children: React.ReactNode }) => children,\n}));\n\ntype ResizeObserverCallback = (entries: ResizeObserverEntry[]) => void;\n\nconst resizeObserverCallbacks: ResizeObserverCallback[] = [];\n\nclass ResizeObserverMock {\n constructor(callback: ResizeObserverCallback) {\n resizeObserverCallbacks.push(callback);\n }\n\n disconnect() {}\n\n observe() {}\n\n unobserve() {}\n}\n\nvi.stubGlobal('ResizeObserver', ResizeObserverMock);\n\nconst triggerResize = (height: number) => {\n resizeObserverCallbacks.forEach((callback) => {\n callback([\n {\n contentRect: { height } as DOMRectReadOnly,\n } as ResizeObserverEntry,\n ]);\n });\n};\n\nafterEach(() => {\n resizeObserverCallbacks.length = 0;\n});\n\ndescribe('Truncation', () => {\n it('shows the more action when content exceeds the collapsed height', async () => {\n render(\n <Truncation collapsedHeight={100}>\n <div>Long content</div>\n </Truncation>,\n );\n\n triggerResize(240);\n\n await waitFor(() => {\n expect(screen.getByRole('button', { name: 'Mehr anzeigen' })).toBeInTheDocument();\n });\n });\n\n it('keeps short content expanded without a more action', async () => {\n render(\n <Truncation collapsedHeight={100}>\n <div>Short content</div>\n </Truncation>,\n );\n\n triggerResize(64);\n\n await waitFor(() => {\n expect(screen.queryByRole('button', { name: 'Mehr anzeigen' })).not.toBeInTheDocument();\n });\n });\n});\n"],"mappings":"AAAA,SAASA,MAAM,EAAEC,M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AM;MAChBI,MAAM,CAACL,MAAM,CAAC6B,SAAS,CAAC,QAAQ,EAAE;QAAEC,IAAI,EAAE;MAAgB,CAAC,CAAC,CAAC,CAACC,iBAAiB,CAAC,CAAC;IACrF,CAAC,CAAC;EACN,CAAC,CAAC;EAEFzB,EAAE,CAAC,oDAAoD,EAAE,YAAY;IACjEP,MAAM,cACFG,KAAA,CAAAyB,aAAA,CAACnB,UAAU;MAACoB,eAAe,EAAE;IAAI,gBAC7B1B,KAAA,CAAAyB,aAAA,cAAK,eAAkB,CACf,CAChB,CAAC;IAEDL,aAAa,CAAC,EAAE,CAAC;IAEjB,MAAMrB,OAAO,CAAC,MAAM;MAChBI,MAAM,CAACL,MAAM,CAACgC,WAAW,CAAC,QAAQ,EAAE;QAAEF,IAAI,EAAE;MAAgB,CAAC,CAAC,CAAC,CAACG,GAAG,CAACF,iBAAiB,CAAC,CAAC;IAC3F,CAAC,CAAC;EACN,CAAC,CAAC;AACN,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,58 +1,58 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
components: {
|
|
3
|
+
copyableContent: {
|
|
4
|
+
copy: {
|
|
5
|
+
stringName: 'txt_chayns_components_v5_core_components_copyableContent_copy',
|
|
6
|
+
fallback: 'Kopieren'
|
|
7
|
+
},
|
|
8
|
+
copyFailed: {
|
|
9
|
+
stringName: 'txt_chayns_components_v5_core_components_copyableContent_copyFailed',
|
|
10
|
+
fallback: 'Kopieren fehlgeschlagen'
|
|
11
|
+
},
|
|
12
|
+
share: {
|
|
13
|
+
stringName: 'txt_chayns_components_v5_core_components_copyableContent_share',
|
|
14
|
+
fallback: 'Teilen'
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
fileItem: {
|
|
18
|
+
download: {
|
|
19
|
+
stringName: 'txt_chayns_components_v5_core_components_fileItem_download',
|
|
20
|
+
fallback: 'Download'
|
|
21
|
+
},
|
|
22
|
+
remove: {
|
|
23
|
+
stringName: 'txt_chayns_components_v5_core_components_fileItem_remove',
|
|
24
|
+
fallback: 'Entfernen'
|
|
25
|
+
}
|
|
26
|
+
},
|
|
3
27
|
filter: {
|
|
4
28
|
filterContent: {
|
|
5
29
|
input: {
|
|
6
30
|
placeholder: {
|
|
7
|
-
stringName: '
|
|
31
|
+
stringName: 'txt_chayns_components_v5_core_components_filter_filterContent_input_placeholder',
|
|
8
32
|
fallback: 'Suche'
|
|
9
33
|
}
|
|
10
34
|
},
|
|
11
35
|
sort: {
|
|
12
|
-
stringName: '
|
|
36
|
+
stringName: 'txt_chayns_components_v5_core_components_filter_filterContent_sort',
|
|
13
37
|
fallback: 'Sortierung'
|
|
14
38
|
}
|
|
15
39
|
}
|
|
16
40
|
},
|
|
17
41
|
filterButtons: {
|
|
18
42
|
all: {
|
|
19
|
-
stringName: '
|
|
43
|
+
stringName: 'txt_chayns_components_v5_core_components_filterButtons_all',
|
|
20
44
|
fallback: 'Alle'
|
|
21
45
|
}
|
|
22
46
|
},
|
|
23
47
|
truncation: {
|
|
24
48
|
less: {
|
|
25
|
-
stringName: '
|
|
49
|
+
stringName: 'txt_chayns_components_v5_core_components_truncation_less',
|
|
26
50
|
fallback: 'Weniger'
|
|
27
51
|
},
|
|
28
52
|
more: {
|
|
29
|
-
stringName: '
|
|
53
|
+
stringName: 'txt_chayns_components_v5_core_components_truncation_more',
|
|
30
54
|
fallback: 'Mehr'
|
|
31
55
|
}
|
|
32
|
-
},
|
|
33
|
-
fileItem: {
|
|
34
|
-
download: {
|
|
35
|
-
stringName: 'txt_chayns_components_core_components_fileItem_download',
|
|
36
|
-
fallback: 'Download'
|
|
37
|
-
},
|
|
38
|
-
remove: {
|
|
39
|
-
stringName: 'txt_chayns_components_core_components_fileItem_remove',
|
|
40
|
-
fallback: 'Entfernen'
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
copyableContent: {
|
|
44
|
-
copy: {
|
|
45
|
-
stringName: 'txt_chayns_components_core_components_copyableContent_copy',
|
|
46
|
-
fallback: 'Kopieren'
|
|
47
|
-
},
|
|
48
|
-
share: {
|
|
49
|
-
stringName: 'txt_chayns_components_core_components_copyableContent_share',
|
|
50
|
-
fallback: 'Teilen'
|
|
51
|
-
},
|
|
52
|
-
copyFailed: {
|
|
53
|
-
stringName: 'txt_chayns_components_core_components_copyableContent_copyFailed',
|
|
54
|
-
fallback: 'Kopieren fehlgeschlagen'
|
|
55
|
-
}
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textStrings.js","names":["components","
|
|
1
|
+
{"version":3,"file":"textStrings.js","names":["components","copyableContent","copy","stringName","fallback","copyFailed","share","fileItem","download","remove","filter","filterContent","input","placeholder","sort","filterButtons","all","truncation","less","more"],"sources":["../../../src/constants/textStrings.ts"],"sourcesContent":["export default {\n components: {\n copyableContent: {\n copy: {\n stringName: 'txt_chayns_components_v5_core_components_copyableContent_copy',\n fallback: 'Kopieren',\n },\n copyFailed: {\n stringName: 'txt_chayns_components_v5_core_components_copyableContent_copyFailed',\n fallback: 'Kopieren fehlgeschlagen',\n },\n share: {\n stringName: 'txt_chayns_components_v5_core_components_copyableContent_share',\n fallback: 'Teilen',\n },\n },\n fileItem: {\n download: {\n stringName: 'txt_chayns_components_v5_core_components_fileItem_download',\n fallback: 'Download',\n },\n remove: {\n stringName: 'txt_chayns_components_v5_core_components_fileItem_remove',\n fallback: 'Entfernen',\n },\n },\n filter: {\n filterContent: {\n input: {\n placeholder: {\n stringName:\n 'txt_chayns_components_v5_core_components_filter_filterContent_input_placeholder',\n fallback: 'Suche',\n },\n },\n sort: {\n stringName:\n 'txt_chayns_components_v5_core_components_filter_filterContent_sort',\n fallback: 'Sortierung',\n },\n },\n },\n filterButtons: {\n all: {\n stringName: 'txt_chayns_components_v5_core_components_filterButtons_all',\n fallback: 'Alle',\n },\n },\n truncation: {\n less: {\n stringName: 'txt_chayns_components_v5_core_components_truncation_less',\n fallback: 'Weniger',\n },\n more: {\n stringName: 'txt_chayns_components_v5_core_components_truncation_more',\n fallback: 'Mehr',\n },\n },\n },\n} as const;\n"],"mappings":"AAAA,eAAe;EACXA,UAAU,EAAE;IACRC,eAAe,EAAE;MACbC,IAAI,EAAE;QACFC,UAAU,EAAE,+DAA+D;QAC3EC,QAAQ,EAAE;MACd,CAAC;MACDC,UAAU,EAAE;QACRF,UAAU,EAAE,qEAAqE;QACjFC,QAAQ,EAAE;MACd,CAAC;MACDE,KAAK,EAAE;QACHH,UAAU,EAAE,gEAAgE;QAC5EC,QAAQ,EAAE;MACd;IACJ,CAAC;IACDG,QAAQ,EAAE;MACNC,QAAQ,EAAE;QACNL,UAAU,EAAE,4DAA4D;QACxEC,QAAQ,EAAE;MACd,CAAC;MACDK,MAAM,EAAE;QACJN,UAAU,EAAE,0DAA0D;QACtEC,QAAQ,EAAE;MACd;IACJ,CAAC;IACDM,MAAM,EAAE;MACJC,aAAa,EAAE;QACXC,KAAK,EAAE;UACHC,WAAW,EAAE;YACTV,UAAU,EACN,iFAAiF;YACrFC,QAAQ,EAAE;UACd;QACJ,CAAC;QACDU,IAAI,EAAE;UACFX,UAAU,EACN,oEAAoE;UACxEC,QAAQ,EAAE;QACd;MACJ;IACJ,CAAC;IACDW,aAAa,EAAE;MACXC,GAAG,EAAE;QACDb,UAAU,EAAE,4DAA4D;QACxEC,QAAQ,EAAE;MACd;IACJ,CAAC;IACDa,UAAU,EAAE;MACRC,IAAI,EAAE;QACFf,UAAU,EAAE,0DAA0D;QACtEC,QAAQ,EAAE;MACd,CAAC;MACDe,IAAI,EAAE;QACFhB,UAAU,EAAE,0DAA0D;QACtEC,QAAQ,EAAE;MACd;IACJ;EACJ;AACJ,CAAC","ignoreList":[]}
|
|
@@ -29,6 +29,11 @@ type AccordionGroupProps = {
|
|
|
29
29
|
* the head and the padding of the content accordions.
|
|
30
30
|
*/
|
|
31
31
|
isWrapped?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Disables the group's internal open-state handling while keeping the group context available
|
|
34
|
+
* for styling and keyboard navigation.
|
|
35
|
+
*/
|
|
36
|
+
shouldDisableInternalHandling?: boolean;
|
|
32
37
|
/**
|
|
33
38
|
* Function that is executed when all accordions in group are closed.
|
|
34
39
|
*/
|
|
@@ -1,59 +1,59 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
2
|
readonly components: {
|
|
3
|
+
readonly copyableContent: {
|
|
4
|
+
readonly copy: {
|
|
5
|
+
readonly stringName: "txt_chayns_components_v5_core_components_copyableContent_copy";
|
|
6
|
+
readonly fallback: "Kopieren";
|
|
7
|
+
};
|
|
8
|
+
readonly copyFailed: {
|
|
9
|
+
readonly stringName: "txt_chayns_components_v5_core_components_copyableContent_copyFailed";
|
|
10
|
+
readonly fallback: "Kopieren fehlgeschlagen";
|
|
11
|
+
};
|
|
12
|
+
readonly share: {
|
|
13
|
+
readonly stringName: "txt_chayns_components_v5_core_components_copyableContent_share";
|
|
14
|
+
readonly fallback: "Teilen";
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
readonly fileItem: {
|
|
18
|
+
readonly download: {
|
|
19
|
+
readonly stringName: "txt_chayns_components_v5_core_components_fileItem_download";
|
|
20
|
+
readonly fallback: "Download";
|
|
21
|
+
};
|
|
22
|
+
readonly remove: {
|
|
23
|
+
readonly stringName: "txt_chayns_components_v5_core_components_fileItem_remove";
|
|
24
|
+
readonly fallback: "Entfernen";
|
|
25
|
+
};
|
|
26
|
+
};
|
|
3
27
|
readonly filter: {
|
|
4
28
|
readonly filterContent: {
|
|
5
29
|
readonly input: {
|
|
6
30
|
readonly placeholder: {
|
|
7
|
-
readonly stringName: "
|
|
31
|
+
readonly stringName: "txt_chayns_components_v5_core_components_filter_filterContent_input_placeholder";
|
|
8
32
|
readonly fallback: "Suche";
|
|
9
33
|
};
|
|
10
34
|
};
|
|
11
35
|
readonly sort: {
|
|
12
|
-
readonly stringName: "
|
|
36
|
+
readonly stringName: "txt_chayns_components_v5_core_components_filter_filterContent_sort";
|
|
13
37
|
readonly fallback: "Sortierung";
|
|
14
38
|
};
|
|
15
39
|
};
|
|
16
40
|
};
|
|
17
41
|
readonly filterButtons: {
|
|
18
42
|
readonly all: {
|
|
19
|
-
readonly stringName: "
|
|
43
|
+
readonly stringName: "txt_chayns_components_v5_core_components_filterButtons_all";
|
|
20
44
|
readonly fallback: "Alle";
|
|
21
45
|
};
|
|
22
46
|
};
|
|
23
47
|
readonly truncation: {
|
|
24
48
|
readonly less: {
|
|
25
|
-
readonly stringName: "
|
|
49
|
+
readonly stringName: "txt_chayns_components_v5_core_components_truncation_less";
|
|
26
50
|
readonly fallback: "Weniger";
|
|
27
51
|
};
|
|
28
52
|
readonly more: {
|
|
29
|
-
readonly stringName: "
|
|
53
|
+
readonly stringName: "txt_chayns_components_v5_core_components_truncation_more";
|
|
30
54
|
readonly fallback: "Mehr";
|
|
31
55
|
};
|
|
32
56
|
};
|
|
33
|
-
readonly fileItem: {
|
|
34
|
-
readonly download: {
|
|
35
|
-
readonly stringName: "txt_chayns_components_core_components_fileItem_download";
|
|
36
|
-
readonly fallback: "Download";
|
|
37
|
-
};
|
|
38
|
-
readonly remove: {
|
|
39
|
-
readonly stringName: "txt_chayns_components_core_components_fileItem_remove";
|
|
40
|
-
readonly fallback: "Entfernen";
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
readonly copyableContent: {
|
|
44
|
-
readonly copy: {
|
|
45
|
-
readonly stringName: "txt_chayns_components_core_components_copyableContent_copy";
|
|
46
|
-
readonly fallback: "Kopieren";
|
|
47
|
-
};
|
|
48
|
-
readonly share: {
|
|
49
|
-
readonly stringName: "txt_chayns_components_core_components_copyableContent_share";
|
|
50
|
-
readonly fallback: "Teilen";
|
|
51
|
-
};
|
|
52
|
-
readonly copyFailed: {
|
|
53
|
-
readonly stringName: "txt_chayns_components_core_components_copyableContent_copyFailed";
|
|
54
|
-
readonly fallback: "Kopieren fehlgeschlagen";
|
|
55
|
-
};
|
|
56
|
-
};
|
|
57
57
|
};
|
|
58
58
|
};
|
|
59
59
|
export default _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chayns-components/core",
|
|
3
|
-
"version": "5.5.
|
|
3
|
+
"version": "5.5.37",
|
|
4
4
|
"description": "A set of beautiful React components for developing your own applications with chayns.",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"browserslist": [
|
|
@@ -76,8 +76,8 @@
|
|
|
76
76
|
},
|
|
77
77
|
"dependencies": {
|
|
78
78
|
"@chayns-components/format": "^5.5.34",
|
|
79
|
-
"@chayns-components/textstring": "^5.5.34",
|
|
80
79
|
"@chayns/colors": "^2.0.2",
|
|
80
|
+
"@chayns/textstrings": "^1.0.1",
|
|
81
81
|
"@chayns/uac-service": "~0.0.62",
|
|
82
82
|
"clsx": "^2.1.1",
|
|
83
83
|
"react-compiler-runtime": "^1.0.0",
|
|
@@ -93,5 +93,5 @@
|
|
|
93
93
|
"publishConfig": {
|
|
94
94
|
"access": "public"
|
|
95
95
|
},
|
|
96
|
-
"gitHead": "
|
|
96
|
+
"gitHead": "d54ff7f9ff20ebb76f33a5539cbb610b107a0cc7"
|
|
97
97
|
}
|