@bbl-digital/snorre 2.2.88 → 2.2.89
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/bundle.js +10 -3
- package/esm/core/TabNav/index.js +10 -3
- package/lib/core/TabNav/index.d.ts.map +1 -1
- package/lib/core/TabNav/index.js +10 -3
- package/package.json +1 -1
package/dist/bundle.js
CHANGED
@@ -30595,13 +30595,20 @@
|
|
30595
30595
|
width: actionsWidth
|
30596
30596
|
} = useContainerDimensions(buttonRef);
|
30597
30597
|
const values = React__default['default'].Children.map(children, child => child.props) || [];
|
30598
|
+
|
30599
|
+
const displayNameFromValue = value => {
|
30600
|
+
const item = values.find(item => item.value === value);
|
30601
|
+
return item?.displayText || String(value);
|
30602
|
+
};
|
30603
|
+
|
30598
30604
|
return jsxRuntime$1.jsx(TabContextProvider, {
|
30599
30605
|
onChange: onChange,
|
30600
30606
|
value: value || values[0].value,
|
30601
30607
|
children: jsxRuntime$1.jsx(TabContext.Consumer, {
|
30602
30608
|
children: ({
|
30603
30609
|
width: childrenTotalWidth,
|
30604
|
-
setActive
|
30610
|
+
setActive,
|
30611
|
+
active
|
30605
30612
|
}) => {
|
30606
30613
|
if (actionsWidth + childrenTotalWidth > containerWidth) {
|
30607
30614
|
// Render dropdown instead of tabs
|
@@ -30610,7 +30617,7 @@
|
|
30610
30617
|
input: true,
|
30611
30618
|
width: "auto",
|
30612
30619
|
text: "Velg",
|
30613
|
-
selectedValue: String(
|
30620
|
+
selectedValue: displayNameFromValue(String(active)) || '0',
|
30614
30621
|
onChange: ({
|
30615
30622
|
value
|
30616
30623
|
}) => setActive(value),
|
@@ -30620,7 +30627,7 @@
|
|
30620
30627
|
}) => jsxRuntime$1.jsx(Option, {
|
30621
30628
|
value: value,
|
30622
30629
|
children: displayText || value
|
30623
|
-
}))
|
30630
|
+
}, value))
|
30624
30631
|
}), actions]
|
30625
30632
|
});
|
30626
30633
|
}
|
package/esm/core/TabNav/index.js
CHANGED
@@ -31,13 +31,20 @@ const TabNav = ({
|
|
31
31
|
width: actionsWidth
|
32
32
|
} = useContainerDimensions(buttonRef);
|
33
33
|
const values = React.Children.map(children, child => child.props) || [];
|
34
|
+
|
35
|
+
const displayNameFromValue = value => {
|
36
|
+
const item = values.find(item => item.value === value);
|
37
|
+
return item?.displayText || String(value);
|
38
|
+
};
|
39
|
+
|
34
40
|
return _jsx(TabContextProvider, {
|
35
41
|
onChange: onChange,
|
36
42
|
value: value || values[0].value,
|
37
43
|
children: _jsx(TabContext.Consumer, {
|
38
44
|
children: ({
|
39
45
|
width: childrenTotalWidth,
|
40
|
-
setActive
|
46
|
+
setActive,
|
47
|
+
active
|
41
48
|
}) => {
|
42
49
|
if (actionsWidth + childrenTotalWidth > containerWidth) {
|
43
50
|
// Render dropdown instead of tabs
|
@@ -46,7 +53,7 @@ const TabNav = ({
|
|
46
53
|
input: true,
|
47
54
|
width: "auto",
|
48
55
|
text: "Velg",
|
49
|
-
selectedValue: String(
|
56
|
+
selectedValue: displayNameFromValue(String(active)) || '0',
|
50
57
|
onChange: ({
|
51
58
|
value
|
52
59
|
}) => setActive(value),
|
@@ -56,7 +63,7 @@ const TabNav = ({
|
|
56
63
|
}) => _jsx(Option, {
|
57
64
|
value: value,
|
58
65
|
children: displayText || value
|
59
|
-
}))
|
66
|
+
}, value))
|
60
67
|
}), actions]
|
61
68
|
});
|
62
69
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/packages/core/TabNav/index.tsx"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACxC,OAAO,EAAE,gBAAgB,EAAY,MAAM,gBAAgB,CAAA;AAO3D,UAAU,KAAK;IACb,iDAAiD;IACjD,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACvB,qEAAqE;IACrE,QAAQ,EAAE,CAAC,KAA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eAAe,MAAM,CAAA"}
|
package/lib/core/TabNav/index.js
CHANGED
@@ -31,13 +31,20 @@ const TabNav = ({
|
|
31
31
|
width: actionsWidth
|
32
32
|
} = useContainerDimensions(buttonRef);
|
33
33
|
const values = React.Children.map(children, child => child.props) || [];
|
34
|
+
|
35
|
+
const displayNameFromValue = value => {
|
36
|
+
const item = values.find(item => item.value === value);
|
37
|
+
return item?.displayText || String(value);
|
38
|
+
};
|
39
|
+
|
34
40
|
return _jsx(TabContextProvider, {
|
35
41
|
onChange: onChange,
|
36
42
|
value: value || values[0].value,
|
37
43
|
children: _jsx(TabContext.Consumer, {
|
38
44
|
children: ({
|
39
45
|
width: childrenTotalWidth,
|
40
|
-
setActive
|
46
|
+
setActive,
|
47
|
+
active
|
41
48
|
}) => {
|
42
49
|
if (actionsWidth + childrenTotalWidth > containerWidth) {
|
43
50
|
// Render dropdown instead of tabs
|
@@ -46,7 +53,7 @@ const TabNav = ({
|
|
46
53
|
input: true,
|
47
54
|
width: "auto",
|
48
55
|
text: "Velg",
|
49
|
-
selectedValue: String(
|
56
|
+
selectedValue: displayNameFromValue(String(active)) || '0',
|
50
57
|
onChange: ({
|
51
58
|
value
|
52
59
|
}) => setActive(value),
|
@@ -56,7 +63,7 @@ const TabNav = ({
|
|
56
63
|
}) => _jsx(Option, {
|
57
64
|
value: value,
|
58
65
|
children: displayText || value
|
59
|
-
}))
|
66
|
+
}, value))
|
60
67
|
}), actions]
|
61
68
|
});
|
62
69
|
}
|