@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) */
|
|
@@ -64,6 +64,8 @@ require("core-js/modules/es.string.ends-with.js");
|
|
|
64
64
|
|
|
65
65
|
require("core-js/modules/es.array.find.js");
|
|
66
66
|
|
|
67
|
+
require("core-js/modules/es.parse-int.js");
|
|
68
|
+
|
|
67
69
|
var _react = _interopRequireDefault(require("react"));
|
|
68
70
|
|
|
69
71
|
var _Context = _interopRequireDefault(require("../../shared/Context"));
|
|
@@ -100,6 +102,8 @@ var format = function format(value) {
|
|
|
100
102
|
locale = _ref$locale === void 0 ? null : _ref$locale,
|
|
101
103
|
_ref$clean = _ref.clean,
|
|
102
104
|
clean = _ref$clean === void 0 ? false : _ref$clean,
|
|
105
|
+
_ref$compact = _ref.compact,
|
|
106
|
+
compact = _ref$compact === void 0 ? null : _ref$compact,
|
|
103
107
|
_ref$phone = _ref.phone,
|
|
104
108
|
phone = _ref$phone === void 0 ? null : _ref$phone,
|
|
105
109
|
_ref$org = _ref.org,
|
|
@@ -151,7 +155,7 @@ var format = function format(value) {
|
|
|
151
155
|
|
|
152
156
|
if (parseFloat(decimals) >= 0) {
|
|
153
157
|
value = formatDecimals(value, decimals, omit_rounding, opts);
|
|
154
|
-
} else {
|
|
158
|
+
} else if (typeof opts.maximumFractionDigits === 'undefined') {
|
|
155
159
|
opts.maximumFractionDigits = 20;
|
|
156
160
|
}
|
|
157
161
|
|
|
@@ -209,6 +213,13 @@ var format = function format(value) {
|
|
|
209
213
|
} else if ((0, _componentHelper.isTrue)(currency) || typeof currency === 'string') {
|
|
210
214
|
type = 'currency';
|
|
211
215
|
opts.currency = opts.currency || ((0, _componentHelper.isTrue)(currency) ? _defaults.CURRENCY : currency);
|
|
216
|
+
handleCompactBeforeDisplay({
|
|
217
|
+
value: value,
|
|
218
|
+
locale: locale,
|
|
219
|
+
compact: compact,
|
|
220
|
+
decimals: decimals,
|
|
221
|
+
opts: opts
|
|
222
|
+
});
|
|
212
223
|
|
|
213
224
|
if (decimals === null) {
|
|
214
225
|
decimals = 2;
|
|
@@ -222,7 +233,7 @@ var format = function format(value) {
|
|
|
222
233
|
}
|
|
223
234
|
|
|
224
235
|
opts.style = 'currency';
|
|
225
|
-
opts.currencyDisplay = getFallbackCurrencyDisplay(locale, opts.
|
|
236
|
+
opts.currencyDisplay = getFallbackCurrencyDisplay(locale, opts.currencyDisplay || currency_display);
|
|
226
237
|
|
|
227
238
|
if (typeof opts.minimumFractionDigits === 'undefined' && String(value).indexOf('.') === -1 && cleanedNumber % 1 === 0) {
|
|
228
239
|
opts.minimumFractionDigits = 0;
|
|
@@ -271,6 +282,11 @@ var format = function format(value) {
|
|
|
271
282
|
}
|
|
272
283
|
}
|
|
273
284
|
|
|
285
|
+
handleCompactBeforeAria({
|
|
286
|
+
value: value,
|
|
287
|
+
compact: compact,
|
|
288
|
+
opts: opts
|
|
289
|
+
});
|
|
274
290
|
aria = formatNumber(cleanedNumber, locale, _objectSpread(_objectSpread({
|
|
275
291
|
minimumFractionDigits: 0,
|
|
276
292
|
maximumFractionDigits: 2
|
|
@@ -286,12 +302,21 @@ var format = function format(value) {
|
|
|
286
302
|
aria = prepareMinus(aria, locale);
|
|
287
303
|
}
|
|
288
304
|
} else {
|
|
305
|
+
handleCompactBeforeDisplay({
|
|
306
|
+
value: value,
|
|
307
|
+
locale: locale,
|
|
308
|
+
compact: compact,
|
|
309
|
+
decimals: decimals,
|
|
310
|
+
opts: opts
|
|
311
|
+
});
|
|
289
312
|
display = formatNumber(value, locale, opts);
|
|
290
313
|
display = prepareMinus(display, locale);
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
314
|
+
handleCompactBeforeAria({
|
|
315
|
+
value: value,
|
|
316
|
+
compact: compact,
|
|
317
|
+
opts: opts
|
|
318
|
+
});
|
|
319
|
+
aria = formatNumber(value, locale, opts);
|
|
295
320
|
aria = enhanceSR(value, aria, locale);
|
|
296
321
|
}
|
|
297
322
|
|
|
@@ -318,7 +343,7 @@ var format = function format(value) {
|
|
|
318
343
|
});
|
|
319
344
|
} else {
|
|
320
345
|
var thousandsSeparator = getThousandsSeparator(locale);
|
|
321
|
-
cleanedValue = display.replace(new RegExp("".concat(thousandsSeparator, "(?=\\d{3})"), 'g'), '');
|
|
346
|
+
cleanedValue = String(display).replace(new RegExp("".concat(thousandsSeparator, "(?=\\d{3})"), 'g'), '');
|
|
322
347
|
}
|
|
323
348
|
|
|
324
349
|
return {
|
|
@@ -965,4 +990,78 @@ function formatToParts(_ref9) {
|
|
|
965
990
|
return [{
|
|
966
991
|
value: number
|
|
967
992
|
}];
|
|
993
|
+
}
|
|
994
|
+
|
|
995
|
+
function handleCompactBeforeDisplay() {
|
|
996
|
+
var _ref10 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
997
|
+
value = _ref10.value,
|
|
998
|
+
locale = _ref10.locale,
|
|
999
|
+
compact = _ref10.compact,
|
|
1000
|
+
_ref10$decimals = _ref10.decimals,
|
|
1001
|
+
decimals = _ref10$decimals === void 0 ? 0 : _ref10$decimals,
|
|
1002
|
+
opts = _ref10.opts;
|
|
1003
|
+
|
|
1004
|
+
if (!canHandleCompact({
|
|
1005
|
+
value: value,
|
|
1006
|
+
compact: compact
|
|
1007
|
+
})) {
|
|
1008
|
+
return;
|
|
1009
|
+
}
|
|
1010
|
+
|
|
1011
|
+
value = parseInt(Math.abs(value));
|
|
1012
|
+
opts.notation = 'compact';
|
|
1013
|
+
|
|
1014
|
+
if ((0, _componentHelper.isTrue)(compact) && locale && /(no|nb|nn)$/i.test(locale)) {
|
|
1015
|
+
opts.compactDisplay = Math.abs(value) < 1000000 ? 'long' : 'short';
|
|
1016
|
+
} else {
|
|
1017
|
+
opts.compactDisplay = !(0, _componentHelper.isTrue)(compact) ? compact : 'short';
|
|
1018
|
+
}
|
|
1019
|
+
|
|
1020
|
+
if (typeof opts.maximumSignificantDigits === 'undefined') {
|
|
1021
|
+
if (isNaN(parseFloat(decimals))) {
|
|
1022
|
+
decimals = 0;
|
|
1023
|
+
} else {
|
|
1024
|
+
decimals = parseFloat(decimals);
|
|
1025
|
+
}
|
|
1026
|
+
|
|
1027
|
+
var ref = String(value).length % 3;
|
|
1028
|
+
|
|
1029
|
+
if (ref === 2) {
|
|
1030
|
+
decimals += 1;
|
|
1031
|
+
} else if (ref === 0) {
|
|
1032
|
+
decimals += 2;
|
|
1033
|
+
}
|
|
1034
|
+
|
|
1035
|
+
opts.maximumSignificantDigits = decimals + 1;
|
|
1036
|
+
}
|
|
1037
|
+
}
|
|
1038
|
+
|
|
1039
|
+
function handleCompactBeforeAria(_ref11) {
|
|
1040
|
+
var value = _ref11.value,
|
|
1041
|
+
compact = _ref11.compact,
|
|
1042
|
+
opts = _ref11.opts;
|
|
1043
|
+
|
|
1044
|
+
if (!canHandleCompact({
|
|
1045
|
+
value: value,
|
|
1046
|
+
compact: compact
|
|
1047
|
+
})) {
|
|
1048
|
+
return;
|
|
1049
|
+
}
|
|
1050
|
+
|
|
1051
|
+
opts.compactDisplay = 'long';
|
|
1052
|
+
}
|
|
1053
|
+
|
|
1054
|
+
function canHandleCompact(_ref12) {
|
|
1055
|
+
var value = _ref12.value,
|
|
1056
|
+
compact = _ref12.compact;
|
|
1057
|
+
|
|
1058
|
+
if (_helpers.IS_IE11) {
|
|
1059
|
+
return false;
|
|
1060
|
+
}
|
|
1061
|
+
|
|
1062
|
+
if (compact && Math.abs(value) >= 1000) {
|
|
1063
|
+
return true;
|
|
1064
|
+
}
|
|
1065
|
+
|
|
1066
|
+
return false;
|
|
968
1067
|
}
|
|
@@ -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: {
|
|
@@ -33,7 +33,7 @@ var _TagContext = require("./TagContext");
|
|
|
33
33
|
|
|
34
34
|
var _IconPrimary;
|
|
35
35
|
|
|
36
|
-
var _excluded = ["className", "skeleton", "children", "text", "onClick", "onDelete", "omitOnKeyUpDeleteEvent"];
|
|
36
|
+
var _excluded = ["className", "skeleton", "children", "text", "hasLabel", "onClick", "onDelete", "omitOnKeyUpDeleteEvent"];
|
|
37
37
|
|
|
38
38
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
39
39
|
|
|
@@ -44,13 +44,7 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
44
44
|
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; }
|
|
45
45
|
|
|
46
46
|
var defaultProps = {
|
|
47
|
-
className: null,
|
|
48
47
|
skeleton: false,
|
|
49
|
-
text: null,
|
|
50
|
-
children: null,
|
|
51
|
-
icon: null,
|
|
52
|
-
onClick: null,
|
|
53
|
-
onDelete: null,
|
|
54
48
|
omitOnKeyUpDeleteEvent: false
|
|
55
49
|
};
|
|
56
50
|
exports.defaultProps = defaultProps;
|
|
@@ -67,6 +61,7 @@ var Tag = function Tag(localProps) {
|
|
|
67
61
|
skeleton = _usePropsWithContext.skeleton,
|
|
68
62
|
children = _usePropsWithContext.children,
|
|
69
63
|
text = _usePropsWithContext.text,
|
|
64
|
+
hasLabel = _usePropsWithContext.hasLabel,
|
|
70
65
|
onClick = _usePropsWithContext.onClick,
|
|
71
66
|
onDelete = _usePropsWithContext.onDelete,
|
|
72
67
|
omitOnKeyUpDeleteEvent = _usePropsWithContext.omitOnKeyUpDeleteEvent,
|
|
@@ -99,7 +94,7 @@ var Tag = function Tag(localProps) {
|
|
|
99
94
|
buttonAttr.icon = getDeleteIcon();
|
|
100
95
|
}
|
|
101
96
|
|
|
102
|
-
if (!tagGroupContext) {
|
|
97
|
+
if (!tagGroupContext && !hasLabel) {
|
|
103
98
|
(0, _componentHelper.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.");
|
|
104
99
|
}
|
|
105
100
|
|
|
@@ -554,7 +554,7 @@ var ItemContent = function ItemContent(_ref3) {
|
|
|
554
554
|
className: "dnb-drawer-list__option__item"
|
|
555
555
|
}, children.render ? children.render(item, hash + n) : item);
|
|
556
556
|
});
|
|
557
|
-
} else if (children
|
|
557
|
+
} else if (Object.prototype.hasOwnProperty.call(children, 'content')) {
|
|
558
558
|
return children.render ? children.render(children.content, hash, children) : children.content;
|
|
559
559
|
}
|
|
560
560
|
|
|
@@ -274,6 +274,8 @@ var normalizeData = function normalizeData(props) {
|
|
|
274
274
|
}
|
|
275
275
|
|
|
276
276
|
return (data || []).map(function (item, __id) {
|
|
277
|
+
var _item;
|
|
278
|
+
|
|
277
279
|
if (typeof item === 'number' || typeof item === 'string' || Array.isArray(item) || _react.default.isValidElement(item)) {
|
|
278
280
|
item = {
|
|
279
281
|
content: item,
|
|
@@ -281,7 +283,7 @@ var normalizeData = function normalizeData(props) {
|
|
|
281
283
|
};
|
|
282
284
|
}
|
|
283
285
|
|
|
284
|
-
return typeof item.__id !== 'undefined' ? item : _objectSpread(_objectSpread({}, item), {}, {
|
|
286
|
+
return typeof ((_item = item) === null || _item === void 0 ? void 0 : _item.__id) !== 'undefined' ? item : _objectSpread(_objectSpread({}, item), {}, {
|
|
285
287
|
__id: __id
|
|
286
288
|
});
|
|
287
289
|
});
|
package/cjs/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/cjs/shared/Context.js
CHANGED
package/cjs/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
|
};
|