@dnb/eufemia 9.23.1 → 9.24.0
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/CHANGELOG.md +17 -0
- package/cjs/components/avatar/Avatar.d.ts +6 -5
- package/cjs/components/avatar/Avatar.js +4 -8
- package/cjs/components/breadcrumb/Breadcrumb.d.ts +0 -6
- package/cjs/components/breadcrumb/Breadcrumb.js +1 -7
- package/cjs/components/dialog/Dialog.d.ts +2 -1
- package/cjs/components/dialog/Dialog.js +79 -51
- package/cjs/components/dialog/DialogContent.d.ts +1 -1
- package/cjs/components/dialog/DialogContent.js +50 -12
- package/cjs/components/dialog/parts/DialogAction.d.ts +34 -0
- package/cjs/components/dialog/parts/DialogAction.js +136 -0
- package/cjs/components/dialog/style/_dialog.scss +152 -72
- package/cjs/components/dialog/style/dnb-dialog.css +352 -199
- package/cjs/components/dialog/style/dnb-dialog.min.css +1 -1
- package/cjs/components/dialog/types.d.ts +20 -2
- package/cjs/components/drawer/style/dnb-drawer.css +177 -100
- package/cjs/components/drawer/style/dnb-drawer.min.css +1 -1
- package/cjs/components/form-status/FormStatus.d.ts +19 -2
- package/cjs/components/form-status/FormStatus.js +27 -3
- package/cjs/components/form-status/style/themes/dnb-form-status-theme-ui.css +16 -0
- package/cjs/components/form-status/style/themes/dnb-form-status-theme-ui.min.css +1 -1
- package/cjs/components/form-status/style/themes/dnb-form-status-theme-ui.scss +7 -0
- package/cjs/components/info-card/InfoCard.d.ts +0 -9
- package/cjs/components/info-card/InfoCard.js +0 -9
- package/cjs/components/modal/Modal.d.ts +1 -0
- package/cjs/components/modal/Modal.js +1 -1
- package/cjs/components/modal/ModalContent.js +13 -5
- package/cjs/components/modal/parts/CloseButton.d.ts +1 -0
- package/cjs/components/modal/style/_modal.scss +1 -0
- package/cjs/components/modal/style/dnb-modal.css +177 -100
- package/cjs/components/modal/style/dnb-modal.min.css +1 -1
- package/cjs/components/modal/types.d.ts +9 -1
- package/cjs/components/number-format/NumberFormat.d.ts +7 -1
- package/cjs/components/number-format/NumberFormat.js +5 -1
- package/cjs/components/number-format/NumberUtils.d.ts +12 -3
- package/cjs/components/number-format/NumberUtils.js +106 -7
- package/cjs/components/tag/Tag.d.ts +5 -6
- package/cjs/components/tag/Tag.js +3 -8
- package/cjs/fragments/drawer-list/DrawerList.js +1 -1
- package/cjs/fragments/drawer-list/DrawerListHelpers.js +3 -1
- package/cjs/shared/Context.d.ts +2 -0
- package/cjs/shared/Context.js +1 -0
- package/cjs/shared/Eufemia.js +1 -1
- package/cjs/shared/locales/en-GB.d.ts +4 -0
- package/cjs/shared/locales/en-GB.js +4 -0
- package/cjs/shared/locales/en-US.d.ts +4 -0
- package/cjs/shared/locales/index.d.ts +8 -0
- package/cjs/shared/locales/nb-NO.d.ts +4 -0
- package/cjs/shared/locales/nb-NO.js +4 -0
- package/cjs/shared/useTranslation.d.ts +1 -0
- package/cjs/style/dnb-ui-components.css +177 -100
- package/cjs/style/dnb-ui-components.min.css +2 -2
- package/cjs/style/themes/theme-open-banking/dnb-theme-open-banking.css +16 -0
- package/cjs/style/themes/theme-open-banking/dnb-theme-open-banking.min.css +1 -1
- package/cjs/style/themes/theme-ui/dnb-theme-ui.css +16 -0
- package/cjs/style/themes/theme-ui/dnb-theme-ui.min.css +1 -1
- package/components/avatar/Avatar.d.ts +6 -5
- package/components/avatar/Avatar.js +4 -8
- package/components/breadcrumb/Breadcrumb.d.ts +0 -6
- package/components/breadcrumb/Breadcrumb.js +1 -7
- package/components/dialog/Dialog.d.ts +2 -1
- package/components/dialog/Dialog.js +78 -52
- package/components/dialog/DialogContent.d.ts +1 -1
- package/components/dialog/DialogContent.js +46 -9
- package/components/dialog/parts/DialogAction.d.ts +34 -0
- package/components/dialog/parts/DialogAction.js +96 -0
- package/components/dialog/style/_dialog.scss +152 -72
- package/components/dialog/style/dnb-dialog.css +352 -199
- package/components/dialog/style/dnb-dialog.min.css +1 -1
- package/components/dialog/types.d.ts +20 -2
- package/components/drawer/style/dnb-drawer.css +177 -100
- package/components/drawer/style/dnb-drawer.min.css +1 -1
- package/components/form-status/FormStatus.d.ts +19 -2
- package/components/form-status/FormStatus.js +23 -2
- package/components/form-status/style/themes/dnb-form-status-theme-ui.css +16 -0
- package/components/form-status/style/themes/dnb-form-status-theme-ui.min.css +1 -1
- package/components/form-status/style/themes/dnb-form-status-theme-ui.scss +7 -0
- package/components/info-card/InfoCard.d.ts +0 -9
- package/components/info-card/InfoCard.js +0 -9
- package/components/modal/Modal.d.ts +1 -0
- package/components/modal/Modal.js +1 -1
- package/components/modal/ModalContent.js +13 -5
- package/components/modal/parts/CloseButton.d.ts +1 -0
- package/components/modal/style/_modal.scss +1 -0
- package/components/modal/style/dnb-modal.css +177 -100
- package/components/modal/style/dnb-modal.min.css +1 -1
- package/components/modal/types.d.ts +9 -1
- package/components/number-format/NumberFormat.d.ts +7 -1
- package/components/number-format/NumberFormat.js +5 -1
- package/components/number-format/NumberUtils.d.ts +12 -3
- package/components/number-format/NumberUtils.js +105 -7
- package/components/tag/Tag.d.ts +5 -6
- package/components/tag/Tag.js +3 -8
- package/es/components/avatar/Avatar.d.ts +6 -5
- package/es/components/avatar/Avatar.js +5 -9
- package/es/components/breadcrumb/Breadcrumb.d.ts +0 -6
- package/es/components/breadcrumb/Breadcrumb.js +1 -7
- package/es/components/dialog/Dialog.d.ts +2 -1
- package/es/components/dialog/Dialog.js +50 -22
- package/es/components/dialog/DialogContent.d.ts +1 -1
- package/es/components/dialog/DialogContent.js +40 -8
- package/es/components/dialog/parts/DialogAction.d.ts +34 -0
- package/es/components/dialog/parts/DialogAction.js +82 -0
- package/es/components/dialog/style/_dialog.scss +152 -72
- package/es/components/dialog/style/dnb-dialog.css +352 -199
- package/es/components/dialog/style/dnb-dialog.min.css +1 -1
- package/es/components/dialog/types.d.ts +20 -2
- package/es/components/drawer/style/dnb-drawer.css +177 -100
- package/es/components/drawer/style/dnb-drawer.min.css +1 -1
- package/es/components/form-status/FormStatus.d.ts +19 -2
- package/es/components/form-status/FormStatus.js +21 -2
- package/es/components/form-status/style/themes/dnb-form-status-theme-ui.css +16 -0
- package/es/components/form-status/style/themes/dnb-form-status-theme-ui.min.css +1 -1
- package/es/components/form-status/style/themes/dnb-form-status-theme-ui.scss +7 -0
- package/es/components/info-card/InfoCard.d.ts +0 -9
- package/es/components/info-card/InfoCard.js +0 -9
- package/es/components/modal/Modal.d.ts +1 -0
- package/es/components/modal/Modal.js +1 -1
- package/es/components/modal/ModalContent.js +13 -6
- package/es/components/modal/parts/CloseButton.d.ts +1 -0
- package/es/components/modal/style/_modal.scss +1 -0
- package/es/components/modal/style/dnb-modal.css +177 -100
- package/es/components/modal/style/dnb-modal.min.css +1 -1
- package/es/components/modal/types.d.ts +9 -1
- package/es/components/number-format/NumberFormat.d.ts +7 -1
- package/es/components/number-format/NumberFormat.js +5 -1
- package/es/components/number-format/NumberUtils.d.ts +12 -3
- package/es/components/number-format/NumberUtils.js +101 -7
- package/es/components/tag/Tag.d.ts +5 -6
- package/es/components/tag/Tag.js +3 -8
- package/es/fragments/drawer-list/DrawerList.js +1 -1
- package/es/fragments/drawer-list/DrawerListHelpers.js +3 -1
- package/es/shared/Context.d.ts +2 -0
- package/es/shared/Context.js +1 -0
- package/es/shared/Eufemia.js +1 -1
- package/es/shared/locales/en-GB.d.ts +4 -0
- package/es/shared/locales/en-GB.js +4 -0
- package/es/shared/locales/en-US.d.ts +4 -0
- package/es/shared/locales/index.d.ts +8 -0
- package/es/shared/locales/nb-NO.d.ts +4 -0
- package/es/shared/locales/nb-NO.js +4 -0
- package/es/shared/useTranslation.d.ts +1 -0
- package/es/style/dnb-ui-components.css +177 -100
- package/es/style/dnb-ui-components.min.css +2 -2
- package/es/style/themes/theme-open-banking/dnb-theme-open-banking.css +16 -0
- package/es/style/themes/theme-open-banking/dnb-theme-open-banking.min.css +1 -1
- package/es/style/themes/theme-ui/dnb-theme-ui.css +16 -0
- package/es/style/themes/theme-ui/dnb-theme-ui.min.css +1 -1
- package/esm/dnb-ui-basis.min.mjs +1 -1
- package/esm/dnb-ui-components.min.mjs +1 -1
- package/esm/dnb-ui-elements.min.mjs +1 -1
- package/esm/dnb-ui-extensions.min.mjs +3 -3
- package/esm/dnb-ui-lib.min.mjs +3 -3
- package/esm/dnb-ui-web-components.min.mjs +2 -2
- package/fragments/drawer-list/DrawerList.js +1 -1
- package/fragments/drawer-list/DrawerListHelpers.js +3 -1
- package/package.json +1 -1
- package/shared/Context.d.ts +2 -0
- package/shared/Context.js +1 -0
- package/shared/Eufemia.js +1 -1
- package/shared/locales/en-GB.d.ts +4 -0
- package/shared/locales/en-GB.js +4 -0
- package/shared/locales/en-US.d.ts +4 -0
- package/shared/locales/index.d.ts +8 -0
- package/shared/locales/nb-NO.d.ts +4 -0
- package/shared/locales/nb-NO.js +4 -0
- package/shared/useTranslation.d.ts +1 -0
- package/style/dnb-ui-components.css +177 -100
- package/style/dnb-ui-components.min.css +2 -2
- package/style/themes/theme-open-banking/dnb-theme-open-banking.css +16 -0
- package/style/themes/theme-open-banking/dnb-theme-open-banking.min.css +1 -1
- package/style/themes/theme-ui/dnb-theme-ui.css +16 -0
- package/style/themes/theme-ui/dnb-theme-ui.min.css +1 -1
- package/umd/dnb-ui-basis.min.js +1 -1
- package/umd/dnb-ui-components.min.js +1 -1
- package/umd/dnb-ui-elements.min.js +1 -1
- package/umd/dnb-ui-extensions.min.js +2 -2
- package/umd/dnb-ui-lib.min.js +4 -4
- package/umd/dnb-ui-web-components.min.js +2 -2
|
@@ -34,6 +34,9 @@ export interface formatOptionParams {
|
|
|
34
34
|
/** Should the number be cleaned */
|
|
35
35
|
clean?: boolean;
|
|
36
36
|
|
|
37
|
+
/** shortens any number or currency including an abbreviation. You can combine `compact` with `currency`. It gives you zero decimal by default `decimals={0}`. Use either a boolean, or a string with "short" or "long" */
|
|
38
|
+
compact?: boolean | 'short' | 'long';
|
|
39
|
+
|
|
37
40
|
/** How many decimals */
|
|
38
41
|
decimals?: number;
|
|
39
42
|
|
|
@@ -53,13 +56,19 @@ export interface formatOptionParams {
|
|
|
53
56
|
/** Currency code (ISO 4217) or `true` to use the default, `NOK`. */
|
|
54
57
|
currency?: string | boolean;
|
|
55
58
|
|
|
56
|
-
/** Intl.NumberFormat currency option – you can use false or empty string to hide the sign/name */
|
|
57
|
-
currency_display?:
|
|
59
|
+
/** Intl.NumberFormat currency option – you can use false or empty string to hide the sign/name. Defaults to narrowSymbol when the locale is no else we default to code. */
|
|
60
|
+
currency_display?:
|
|
61
|
+
| boolean
|
|
62
|
+
| ''
|
|
63
|
+
| 'code'
|
|
64
|
+
| 'name'
|
|
65
|
+
| 'symbol'
|
|
66
|
+
| 'narrowSymbol';
|
|
58
67
|
/** currency option */
|
|
59
68
|
currency_position?: formatCurrencyPosition;
|
|
60
69
|
/** hides the currency sign */
|
|
61
70
|
omit_currency_sign?: boolean;
|
|
62
|
-
/** will remove all extra signs,like a currency sign or percent sign for the cleanedValue return when returnAria is true */
|
|
71
|
+
/** will remove all extra signs, like a currency sign or percent sign for the cleanedValue return when returnAria is true */
|
|
63
72
|
clean_copy_value?: boolean;
|
|
64
73
|
|
|
65
74
|
/** Intl.NumberFormat options (NumberFormatOptions) */
|
|
@@ -13,6 +13,7 @@ const NUMBER_CHARS = '\\-0-9,.';
|
|
|
13
13
|
export const format = (value, {
|
|
14
14
|
locale = null,
|
|
15
15
|
clean = false,
|
|
16
|
+
compact = null,
|
|
16
17
|
phone = null,
|
|
17
18
|
org = null,
|
|
18
19
|
ban = null,
|
|
@@ -50,7 +51,7 @@ export const format = (value, {
|
|
|
50
51
|
|
|
51
52
|
if (parseFloat(decimals) >= 0) {
|
|
52
53
|
value = formatDecimals(value, decimals, omit_rounding, opts);
|
|
53
|
-
} else {
|
|
54
|
+
} else if (typeof opts.maximumFractionDigits === 'undefined') {
|
|
54
55
|
opts.maximumFractionDigits = 20;
|
|
55
56
|
}
|
|
56
57
|
|
|
@@ -105,6 +106,13 @@ export const format = (value, {
|
|
|
105
106
|
} else if (isTrue(currency) || typeof currency === 'string') {
|
|
106
107
|
type = 'currency';
|
|
107
108
|
opts.currency = opts.currency || (isTrue(currency) ? CURRENCY : currency);
|
|
109
|
+
handleCompactBeforeDisplay({
|
|
110
|
+
value,
|
|
111
|
+
locale,
|
|
112
|
+
compact,
|
|
113
|
+
decimals,
|
|
114
|
+
opts
|
|
115
|
+
});
|
|
108
116
|
|
|
109
117
|
if (decimals === null) {
|
|
110
118
|
decimals = 2;
|
|
@@ -118,7 +126,7 @@ export const format = (value, {
|
|
|
118
126
|
}
|
|
119
127
|
|
|
120
128
|
opts.style = 'currency';
|
|
121
|
-
opts.currencyDisplay = getFallbackCurrencyDisplay(locale, opts.
|
|
129
|
+
opts.currencyDisplay = getFallbackCurrencyDisplay(locale, opts.currencyDisplay || currency_display);
|
|
122
130
|
|
|
123
131
|
if (typeof opts.minimumFractionDigits === 'undefined' && String(value).indexOf('.') === -1 && cleanedNumber % 1 === 0) {
|
|
124
132
|
opts.minimumFractionDigits = 0;
|
|
@@ -166,6 +174,11 @@ export const format = (value, {
|
|
|
166
174
|
}
|
|
167
175
|
}
|
|
168
176
|
|
|
177
|
+
handleCompactBeforeAria({
|
|
178
|
+
value,
|
|
179
|
+
compact,
|
|
180
|
+
opts
|
|
181
|
+
});
|
|
169
182
|
aria = formatNumber(cleanedNumber, locale, _objectSpread(_objectSpread({
|
|
170
183
|
minimumFractionDigits: 0,
|
|
171
184
|
maximumFractionDigits: 2
|
|
@@ -181,12 +194,21 @@ export const format = (value, {
|
|
|
181
194
|
aria = prepareMinus(aria, locale);
|
|
182
195
|
}
|
|
183
196
|
} else {
|
|
197
|
+
handleCompactBeforeDisplay({
|
|
198
|
+
value,
|
|
199
|
+
locale,
|
|
200
|
+
compact,
|
|
201
|
+
decimals,
|
|
202
|
+
opts
|
|
203
|
+
});
|
|
184
204
|
display = formatNumber(value, locale, opts);
|
|
185
205
|
display = prepareMinus(display, locale);
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
206
|
+
handleCompactBeforeAria({
|
|
207
|
+
value,
|
|
208
|
+
compact,
|
|
209
|
+
opts
|
|
210
|
+
});
|
|
211
|
+
aria = formatNumber(value, locale, opts);
|
|
190
212
|
aria = enhanceSR(value, aria, locale);
|
|
191
213
|
}
|
|
192
214
|
|
|
@@ -213,7 +235,7 @@ export const format = (value, {
|
|
|
213
235
|
});
|
|
214
236
|
} else {
|
|
215
237
|
const thousandsSeparator = getThousandsSeparator(locale);
|
|
216
|
-
cleanedValue = display.replace(new RegExp(`${thousandsSeparator}(?=\\d{3})`, 'g'), '');
|
|
238
|
+
cleanedValue = String(display).replace(new RegExp(`${thousandsSeparator}(?=\\d{3})`, 'g'), '');
|
|
217
239
|
}
|
|
218
240
|
|
|
219
241
|
return {
|
|
@@ -732,4 +754,76 @@ function formatToParts({
|
|
|
732
754
|
return [{
|
|
733
755
|
value: number
|
|
734
756
|
}];
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
function handleCompactBeforeDisplay({
|
|
760
|
+
value,
|
|
761
|
+
locale,
|
|
762
|
+
compact,
|
|
763
|
+
decimals = 0,
|
|
764
|
+
opts
|
|
765
|
+
} = {}) {
|
|
766
|
+
if (!canHandleCompact({
|
|
767
|
+
value,
|
|
768
|
+
compact
|
|
769
|
+
})) {
|
|
770
|
+
return;
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
value = parseInt(Math.abs(value));
|
|
774
|
+
opts.notation = 'compact';
|
|
775
|
+
|
|
776
|
+
if (isTrue(compact) && locale && /(no|nb|nn)$/i.test(locale)) {
|
|
777
|
+
opts.compactDisplay = Math.abs(value) < 1000000 ? 'long' : 'short';
|
|
778
|
+
} else {
|
|
779
|
+
opts.compactDisplay = !isTrue(compact) ? compact : 'short';
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
if (typeof opts.maximumSignificantDigits === 'undefined') {
|
|
783
|
+
if (isNaN(parseFloat(decimals))) {
|
|
784
|
+
decimals = 0;
|
|
785
|
+
} else {
|
|
786
|
+
decimals = parseFloat(decimals);
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
const ref = String(value).length % 3;
|
|
790
|
+
|
|
791
|
+
if (ref === 2) {
|
|
792
|
+
decimals += 1;
|
|
793
|
+
} else if (ref === 0) {
|
|
794
|
+
decimals += 2;
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
opts.maximumSignificantDigits = decimals + 1;
|
|
798
|
+
}
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
function handleCompactBeforeAria({
|
|
802
|
+
value,
|
|
803
|
+
compact,
|
|
804
|
+
opts
|
|
805
|
+
}) {
|
|
806
|
+
if (!canHandleCompact({
|
|
807
|
+
value,
|
|
808
|
+
compact
|
|
809
|
+
})) {
|
|
810
|
+
return;
|
|
811
|
+
}
|
|
812
|
+
|
|
813
|
+
opts.compactDisplay = 'long';
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
function canHandleCompact({
|
|
817
|
+
value,
|
|
818
|
+
compact
|
|
819
|
+
}) {
|
|
820
|
+
if (IS_IE11) {
|
|
821
|
+
return false;
|
|
822
|
+
}
|
|
823
|
+
|
|
824
|
+
if (compact && Math.abs(value) >= 1000) {
|
|
825
|
+
return true;
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
return false;
|
|
735
829
|
}
|
|
@@ -13,6 +13,11 @@ export interface TagProps {
|
|
|
13
13
|
* Default: null
|
|
14
14
|
*/
|
|
15
15
|
icon?: IconPrimaryIcon;
|
|
16
|
+
/**
|
|
17
|
+
* If a label is given, typical inside a table or dl (definition list), then you can disable Tag.Group as a dependent of Tag. Use `true` to omit the `Tag group required:` warning.
|
|
18
|
+
* Default: null
|
|
19
|
+
*/
|
|
20
|
+
hasLabel?: boolean;
|
|
16
21
|
/**
|
|
17
22
|
* Custom className on the component root
|
|
18
23
|
* Default: null
|
|
@@ -45,13 +50,7 @@ export interface TagProps {
|
|
|
45
50
|
omitOnKeyUpDeleteEvent?: boolean;
|
|
46
51
|
}
|
|
47
52
|
export declare const defaultProps: {
|
|
48
|
-
className: any;
|
|
49
53
|
skeleton: boolean;
|
|
50
|
-
text: any;
|
|
51
|
-
children: any;
|
|
52
|
-
icon: any;
|
|
53
|
-
onClick: any;
|
|
54
|
-
onDelete: any;
|
|
55
54
|
omitOnKeyUpDeleteEvent: boolean;
|
|
56
55
|
};
|
|
57
56
|
declare const Tag: {
|
package/es/components/tag/Tag.js
CHANGED
|
@@ -3,7 +3,7 @@ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutPr
|
|
|
3
3
|
|
|
4
4
|
var _IconPrimary;
|
|
5
5
|
|
|
6
|
-
const _excluded = ["className", "skeleton", "children", "text", "onClick", "onDelete", "omitOnKeyUpDeleteEvent"];
|
|
6
|
+
const _excluded = ["className", "skeleton", "children", "text", "hasLabel", "onClick", "onDelete", "omitOnKeyUpDeleteEvent"];
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import classnames from 'classnames';
|
|
9
9
|
import IconPrimary from '../icon-primary/IconPrimary';
|
|
@@ -14,13 +14,7 @@ import { usePropsWithContext } from '../../shared/hooks';
|
|
|
14
14
|
import TagGroup from './TagGroup';
|
|
15
15
|
import { TagGroupContext } from './TagContext';
|
|
16
16
|
export const defaultProps = {
|
|
17
|
-
className: null,
|
|
18
17
|
skeleton: false,
|
|
19
|
-
text: null,
|
|
20
|
-
children: null,
|
|
21
|
-
icon: null,
|
|
22
|
-
onClick: null,
|
|
23
|
-
onDelete: null,
|
|
24
18
|
omitOnKeyUpDeleteEvent: false
|
|
25
19
|
};
|
|
26
20
|
|
|
@@ -36,6 +30,7 @@ const Tag = localProps => {
|
|
|
36
30
|
skeleton,
|
|
37
31
|
children,
|
|
38
32
|
text,
|
|
33
|
+
hasLabel,
|
|
39
34
|
onClick,
|
|
40
35
|
onDelete,
|
|
41
36
|
omitOnKeyUpDeleteEvent
|
|
@@ -69,7 +64,7 @@ const Tag = localProps => {
|
|
|
69
64
|
buttonAttr.icon = getDeleteIcon();
|
|
70
65
|
}
|
|
71
66
|
|
|
72
|
-
if (!tagGroupContext) {
|
|
67
|
+
if (!tagGroupContext && !hasLabel) {
|
|
73
68
|
warn(`Tag group required: A Tag requires a Tag.Group with label description as a parent component. This is to ensure correct semantic and accessibility.`);
|
|
74
69
|
}
|
|
75
70
|
|
|
@@ -409,7 +409,7 @@ const ItemContent = ({
|
|
|
409
409
|
key: hash + n,
|
|
410
410
|
className: "dnb-drawer-list__option__item"
|
|
411
411
|
}, children.render ? children.render(item, hash + n) : item));
|
|
412
|
-
} else if (children
|
|
412
|
+
} else if (Object.prototype.hasOwnProperty.call(children, 'content')) {
|
|
413
413
|
return children.render ? children.render(children.content, hash, children) : children.content;
|
|
414
414
|
}
|
|
415
415
|
|
|
@@ -202,6 +202,8 @@ export const normalizeData = props => {
|
|
|
202
202
|
}
|
|
203
203
|
|
|
204
204
|
return (data || []).map((item, __id) => {
|
|
205
|
+
var _item;
|
|
206
|
+
|
|
205
207
|
if (typeof item === 'number' || typeof item === 'string' || Array.isArray(item) || React.isValidElement(item)) {
|
|
206
208
|
item = {
|
|
207
209
|
content: item,
|
|
@@ -209,7 +211,7 @@ export const normalizeData = props => {
|
|
|
209
211
|
};
|
|
210
212
|
}
|
|
211
213
|
|
|
212
|
-
return typeof item.__id !== 'undefined' ? item : _objectSpread(_objectSpread({}, item), {}, {
|
|
214
|
+
return typeof ((_item = item) === null || _item === void 0 ? void 0 : _item.__id) !== 'undefined' ? item : _objectSpread(_objectSpread({}, item), {}, {
|
|
213
215
|
__id
|
|
214
216
|
});
|
|
215
217
|
});
|
package/es/shared/Context.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export function prepareContext(props?: {}): {
|
|
|
3
3
|
updateTranslation: (locale: any, translation: any) => void;
|
|
4
4
|
getTranslation: (props: any) => any;
|
|
5
5
|
locales: any;
|
|
6
|
+
Button: {};
|
|
6
7
|
Avatar: {};
|
|
7
8
|
AvatarGroup: {};
|
|
8
9
|
Breadcrumb: {};
|
|
@@ -22,6 +23,7 @@ declare const Context: React.Context<{
|
|
|
22
23
|
updateTranslation: (locale: any, translation: any) => void;
|
|
23
24
|
getTranslation: (props: any) => any;
|
|
24
25
|
locales: any;
|
|
26
|
+
Button: {};
|
|
25
27
|
Avatar: {};
|
|
26
28
|
AvatarGroup: {};
|
|
27
29
|
Breadcrumb: {};
|
package/es/shared/Context.js
CHANGED
package/es/shared/Eufemia.js
CHANGED
|
@@ -72,6 +72,10 @@ declare var _default: {
|
|
|
72
72
|
dialog_title: string;
|
|
73
73
|
close_title: string;
|
|
74
74
|
};
|
|
75
|
+
Dialog: {
|
|
76
|
+
declineText: string;
|
|
77
|
+
confirmText: string;
|
|
78
|
+
};
|
|
75
79
|
NumberFormat: {
|
|
76
80
|
clipboard_copy: string;
|
|
77
81
|
};
|
|
@@ -188,6 +192,10 @@ declare var _default: {
|
|
|
188
192
|
dialog_title: string;
|
|
189
193
|
close_title: string;
|
|
190
194
|
};
|
|
195
|
+
Dialog: {
|
|
196
|
+
declineText: string;
|
|
197
|
+
confirmText: string;
|
|
198
|
+
};
|
|
191
199
|
NumberFormat: {
|
|
192
200
|
clipboard_copy: string;
|
|
193
201
|
};
|