@frontify/fondue 12.0.0-beta.378 → 12.0.0-beta.379
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/dist/components/Breadcrumbs/FormattedBreadcrumbs.es.js +2 -3
- package/dist/components/Breadcrumbs/FormattedBreadcrumbs.es.js.map +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -12,7 +12,8 @@ const R = ({
|
|
|
12
12
|
}) => {
|
|
13
13
|
const m = K(!0);
|
|
14
14
|
return [...t.map(({ label: u, badges: B, bold: C, decorator: a, link: i, onClick: f }, e) => {
|
|
15
|
-
const s = `breadcrumb-${e}`, d = o && e === 0, F = e === t.length - 1, g = o ? 2 : 3, b = t.length - g, p = e >= b, v = l && !d && !p, h = e < t.length - 1;
|
|
15
|
+
const s = `breadcrumb-${e}`, d = o && e === 0, F = e === t.length - 1, g = o ? 2 : 3, b = t.length - g, p = e >= b, v = l && !d && !p, h = e < t.length - 1, I = [];
|
|
16
|
+
let c = -1;
|
|
16
17
|
switch (!0) {
|
|
17
18
|
case F:
|
|
18
19
|
return /* @__PURE__ */ r(
|
|
@@ -46,8 +47,6 @@ const R = ({
|
|
|
46
47
|
);
|
|
47
48
|
case (v && m.current):
|
|
48
49
|
m.current = !1;
|
|
49
|
-
const I = [];
|
|
50
|
-
let c = -1;
|
|
51
50
|
for (const $ of t) {
|
|
52
51
|
if (c++, c >= b)
|
|
53
52
|
break;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormattedBreadcrumbs.es.js","sources":["../../../src/components/Breadcrumbs/FormattedBreadcrumbs.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { ReactElement, useRef } from 'react';\nimport { BreadcrumbsProps } from './Breadcrumbs';\nimport { CurrentBreadcrumbItem } from './CurrentBreadcrumbItem';\nimport { BreadcrumbItem } from './BreadcrumbItem';\nimport { OverflowMenu, OverflowMenuItemProps } from '..';\n\nexport const FormattedBreadcrumbs = ({\n items,\n keepRoot,\n activeInline = false,\n truncate = false,\n 'data-test-id': dataTestId,\n}: BreadcrumbsProps): ReactElement[] => {\n const renderTruncationRef = useRef<boolean>(true);\n\n const elements = items.map(({ label, badges, bold, decorator, link, onClick }, index) => {\n const key = `breadcrumb-${index}`;\n const isRootKept = keepRoot && index === 0;\n const isCurrent = index === items.length - 1;\n const startLastItemIndex = keepRoot ? 2 : 3;\n const lastItemsIndex = items.length - startLastItemIndex;\n const isLastItems = index >= lastItemsIndex;\n const isTruncatedItem = truncate && !isRootKept && !isLastItems;\n const showSeparator = index < items.length - 1;\n\n switch (true) {\n case isCurrent:\n return (\n <CurrentBreadcrumbItem\n key={key}\n label={label}\n badges={badges}\n bold={bold}\n decorator={decorator}\n link={link}\n onClick={onClick}\n activeInline={activeInline}\n data-test-id={dataTestId}\n />\n );\n\n case !truncate:\n case isRootKept:\n case isLastItems:\n return (\n <BreadcrumbItem\n key={key}\n label={label}\n decorator={decorator}\n link={link}\n onClick={onClick}\n showSeparator={showSeparator}\n data-test-id={dataTestId}\n />\n );\n\n case isTruncatedItem && renderTruncationRef.current:\n renderTruncationRef.current = false;\n
|
|
1
|
+
{"version":3,"file":"FormattedBreadcrumbs.es.js","sources":["../../../src/components/Breadcrumbs/FormattedBreadcrumbs.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { ReactElement, useRef } from 'react';\nimport { BreadcrumbsProps } from './Breadcrumbs';\nimport { CurrentBreadcrumbItem } from './CurrentBreadcrumbItem';\nimport { BreadcrumbItem } from './BreadcrumbItem';\nimport { OverflowMenu, OverflowMenuItemProps } from '..';\n\nexport const FormattedBreadcrumbs = ({\n items,\n keepRoot,\n activeInline = false,\n truncate = false,\n 'data-test-id': dataTestId,\n}: BreadcrumbsProps): ReactElement[] => {\n const renderTruncationRef = useRef<boolean>(true);\n\n const elements = items.map(({ label, badges, bold, decorator, link, onClick }, index) => {\n const key = `breadcrumb-${index}`;\n const isRootKept = keepRoot && index === 0;\n const isCurrent = index === items.length - 1;\n const startLastItemIndex = keepRoot ? 2 : 3;\n const lastItemsIndex = items.length - startLastItemIndex;\n const isLastItems = index >= lastItemsIndex;\n const isTruncatedItem = truncate && !isRootKept && !isLastItems;\n const showSeparator = index < items.length - 1;\n const overFlowItems: OverflowMenuItemProps[] = [];\n let count = -1;\n\n switch (true) {\n case isCurrent:\n return (\n <CurrentBreadcrumbItem\n key={key}\n label={label}\n badges={badges}\n bold={bold}\n decorator={decorator}\n link={link}\n onClick={onClick}\n activeInline={activeInline}\n data-test-id={dataTestId}\n />\n );\n\n case !truncate:\n case isRootKept:\n case isLastItems:\n return (\n <BreadcrumbItem\n key={key}\n label={label}\n decorator={decorator}\n link={link}\n onClick={onClick}\n showSeparator={showSeparator}\n data-test-id={dataTestId}\n />\n );\n\n case isTruncatedItem && renderTruncationRef.current:\n renderTruncationRef.current = false;\n for (const element of items) {\n count++;\n if (count >= lastItemsIndex) {\n break;\n } else if (keepRoot && count === 0) {\n continue;\n } else {\n const { label, link, onClick } = element;\n overFlowItems.push({ label, link, onClick });\n }\n }\n return (\n <BreadcrumbItem\n key={key}\n label={''}\n decorator={decorator}\n showSeparator={showSeparator}\n data-test-id={`${dataTestId}-truncation`}\n >\n <OverflowMenu items={overFlowItems} data-test-id={`${dataTestId}-overflow-menu`} />\n </BreadcrumbItem>\n );\n\n default:\n return <span key={key} />;\n }\n });\n return [...elements];\n};\nFormattedBreadcrumbs.displayname = 'FondueFormattedBreadcrumbs';\n"],"names":["FormattedBreadcrumbs","items","keepRoot","activeInline","truncate","dataTestId","renderTruncationRef","useRef","label","badges","bold","decorator","link","onClick","index","key","isRootKept","isCurrent","startLastItemIndex","lastItemsIndex","isLastItems","isTruncatedItem","showSeparator","overFlowItems","count","jsx","CurrentBreadcrumbItem","BreadcrumbItem","element","O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