@dnb/eufemia 10.0.0-beta.5 → 10.0.0-beta.7

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.
Files changed (78) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/cjs/components/accordion/Accordion.d.ts +3 -2
  3. package/cjs/components/accordion/AccordionHeader.d.ts +1 -1
  4. package/cjs/components/autocomplete/Autocomplete.d.ts +2 -2
  5. package/cjs/components/button/Button.d.ts +2 -1
  6. package/cjs/components/dialog/parts/DialogHeader.d.ts +2 -1
  7. package/cjs/components/dropdown/Dropdown.d.ts +1 -1
  8. package/cjs/components/help-button/HelpButton.d.ts +1 -1
  9. package/cjs/components/input/Input.d.ts +1 -1
  10. package/cjs/components/input-masked/InputMasked.d.ts +1 -1
  11. package/cjs/components/modal/ModalContent.d.ts +1 -0
  12. package/cjs/components/modal/ModalContent.js +10 -2
  13. package/cjs/components/modal/parts/CloseButton.d.ts +1 -1
  14. package/cjs/components/modal/types.d.ts +3 -3
  15. package/cjs/components/pagination/Pagination.d.ts +33 -33
  16. package/cjs/components/toggle-button/ToggleButton.d.ts +1 -1
  17. package/cjs/components/tooltip/TooltipPortal.js +20 -6
  18. package/cjs/elements/div/Div.d.ts +2 -0
  19. package/cjs/fragments/drawer-list/DrawerList.js +5 -1
  20. package/cjs/shared/Eufemia.js +1 -1
  21. package/cjs/shared/Theme.d.ts +9 -1
  22. package/cjs/shared/Theme.js +55 -30
  23. package/cjs/shared/VisibilityByTheme.js +10 -1
  24. package/components/accordion/Accordion.d.ts +3 -2
  25. package/components/accordion/AccordionHeader.d.ts +1 -1
  26. package/components/autocomplete/Autocomplete.d.ts +2 -2
  27. package/components/button/Button.d.ts +2 -1
  28. package/components/dialog/parts/DialogHeader.d.ts +2 -1
  29. package/components/dropdown/Dropdown.d.ts +1 -1
  30. package/components/help-button/HelpButton.d.ts +1 -1
  31. package/components/input/Input.d.ts +1 -1
  32. package/components/input-masked/InputMasked.d.ts +1 -1
  33. package/components/modal/ModalContent.d.ts +1 -0
  34. package/components/modal/ModalContent.js +8 -2
  35. package/components/modal/parts/CloseButton.d.ts +1 -1
  36. package/components/modal/types.d.ts +3 -3
  37. package/components/pagination/Pagination.d.ts +33 -33
  38. package/components/toggle-button/ToggleButton.d.ts +1 -1
  39. package/components/tooltip/TooltipPortal.js +18 -6
  40. package/elements/div/Div.d.ts +2 -0
  41. package/es/components/accordion/Accordion.d.ts +3 -2
  42. package/es/components/accordion/AccordionHeader.d.ts +1 -1
  43. package/es/components/autocomplete/Autocomplete.d.ts +2 -2
  44. package/es/components/button/Button.d.ts +2 -1
  45. package/es/components/dialog/parts/DialogHeader.d.ts +2 -1
  46. package/es/components/dropdown/Dropdown.d.ts +1 -1
  47. package/es/components/help-button/HelpButton.d.ts +1 -1
  48. package/es/components/input/Input.d.ts +1 -1
  49. package/es/components/input-masked/InputMasked.d.ts +1 -1
  50. package/es/components/modal/ModalContent.d.ts +1 -0
  51. package/es/components/modal/ModalContent.js +8 -2
  52. package/es/components/modal/parts/CloseButton.d.ts +1 -1
  53. package/es/components/modal/types.d.ts +3 -3
  54. package/es/components/pagination/Pagination.d.ts +33 -33
  55. package/es/components/toggle-button/ToggleButton.d.ts +1 -1
  56. package/es/components/tooltip/TooltipPortal.js +17 -5
  57. package/es/elements/div/Div.d.ts +2 -0
  58. package/es/fragments/drawer-list/DrawerList.js +4 -1
  59. package/es/shared/Eufemia.js +1 -1
  60. package/es/shared/Theme.d.ts +9 -1
  61. package/es/shared/Theme.js +52 -31
  62. package/es/shared/VisibilityByTheme.js +6 -1
  63. package/esm/dnb-ui-basis.min.mjs +1 -1
  64. package/esm/dnb-ui-components.min.mjs +1 -1
  65. package/esm/dnb-ui-elements.min.mjs +1 -1
  66. package/esm/dnb-ui-extensions.min.mjs +1 -1
  67. package/esm/dnb-ui-lib.min.mjs +1 -1
  68. package/fragments/drawer-list/DrawerList.js +4 -1
  69. package/package.json +1 -1
  70. package/shared/Eufemia.js +1 -1
  71. package/shared/Theme.d.ts +9 -1
  72. package/shared/Theme.js +52 -31
  73. package/shared/VisibilityByTheme.js +6 -1
  74. package/umd/dnb-ui-basis.min.js +1 -1
  75. package/umd/dnb-ui-components.min.js +1 -1
  76. package/umd/dnb-ui-elements.min.js +1 -1
  77. package/umd/dnb-ui-extensions.min.js +1 -1
  78. package/umd/dnb-ui-lib.min.js +1 -1
@@ -15,6 +15,7 @@ import PropTypes from 'prop-types';
15
15
  import classnames from 'classnames';
16
16
  import keycode from 'keycode';
17
17
  import { isTrue, makeUniqueId, extendPropsWithContextInClassComponent, validateDOMAttributes, dispatchCustomElementEvent } from '../../shared/component-helper';
18
+ import { getThemeClasses } from '../../shared/Theme';
18
19
  import { createSpacingClasses } from '../../components/space/SpacingHelper';
19
20
  import DrawerListContext from './DrawerListContext';
20
21
  import DrawerListProvider from './DrawerListProvider';
@@ -116,6 +117,8 @@ class DrawerListInstance extends React.PureComponent {
116
117
  }
117
118
 
118
119
  render() {
120
+ var _this$context2;
121
+
119
122
  const props = extendPropsWithContextInClassComponent(this.props, DrawerList.defaultProps, this.context.getTranslation(this.props).DrawerList);
120
123
 
121
124
  const {
@@ -270,7 +273,7 @@ class DrawerListInstance extends React.PureComponent {
270
273
  include_owner_width: align_drawer === 'right',
271
274
  independent_width: isTrue(independent_width),
272
275
  fixed_position: isTrue(fixed_position),
273
- className: portal_class
276
+ className: getThemeClasses((_this$context2 = this.context) === null || _this$context2 === void 0 ? void 0 : _this$context2.theme, portal_class)
274
277
  }, mainList) : mainList);
275
278
  }
276
279
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dnb/eufemia",
3
- "version": "10.0.0-beta.5",
3
+ "version": "10.0.0-beta.7",
4
4
  "description": "DNB Eufemia Design System UI Library",
5
5
  "license": "SEE LICENSE IN LICENSE FILE",
6
6
  "author": "DNB Team & Tobias Høegh",
package/shared/Eufemia.js CHANGED
@@ -2,7 +2,7 @@ export function init() {
2
2
  if (typeof window !== 'undefined') {
3
3
  class Eufemia {
4
4
  get version() {
5
- return '10.0.0-beta.5';
5
+ return '10.0.0-beta.7';
6
6
  }
7
7
 
8
8
  }
package/shared/Theme.d.ts CHANGED
@@ -13,7 +13,15 @@ export declare type ThemeProps = {
13
13
  variant?: ThemeVariants;
14
14
  size?: ThemeSizes;
15
15
  colorMapping?: ColorMapping;
16
- element?: DynamicElement;
16
+ element?: DynamicElement | false;
17
17
  };
18
18
  export declare type ThemeAllProps = ThemeProps & React.HTMLAttributes<HTMLElement>;
19
19
  export default function Theme(themeProps: ThemeAllProps): JSX.Element;
20
+ export declare function ThemeWrapper({ children, theme, element, className, ...rest }: {
21
+ [x: string]: any;
22
+ children: any;
23
+ theme: any;
24
+ element?: any;
25
+ className?: any;
26
+ }): any;
27
+ export declare function getThemeClasses(theme: ThemeProps, className?: any): any;
package/shared/Theme.js CHANGED
@@ -1,59 +1,80 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
- import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
3
2
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
4
- const _excluded = ["children", "element"],
5
- _excluded2 = ["name", "variant", "size", "colorMapping"];
6
-
7
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
8
-
9
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
10
-
3
+ const _excluded = ["children", "element", "name", "variant", "size", "colorMapping"],
4
+ _excluded2 = ["children", "theme", "element", "className"];
11
5
  import React from 'react';
12
6
  import classnames from 'classnames';
13
7
  import Context from './Context';
14
8
  import Provider from './Provider';
9
+ import { extendPropsWithContext } from './component-helper';
15
10
  export default function Theme(themeProps) {
16
11
  const context = React.useContext(Context);
17
12
 
18
13
  const {
19
14
  children,
20
- element
15
+ element,
16
+ name,
17
+ variant,
18
+ size,
19
+ colorMapping
21
20
  } = themeProps,
22
- theme = _objectWithoutProperties(themeProps, _excluded);
23
-
24
- const currentTheme = _objectSpread(_objectSpread({}, context === null || context === void 0 ? void 0 : context.theme), theme);
21
+ restProps = _objectWithoutProperties(themeProps, _excluded);
25
22
 
23
+ const theme = extendPropsWithContext({
24
+ name,
25
+ variant,
26
+ size,
27
+ colorMapping
28
+ }, null, context === null || context === void 0 ? void 0 : context.theme);
26
29
  return React.createElement(Provider, {
27
- theme: currentTheme
28
- }, React.createElement(ThemeWrapper, {
30
+ theme: theme
31
+ }, React.createElement(ThemeWrapper, _extends({
29
32
  element: element,
30
- currentTheme: currentTheme
31
- }, children));
33
+ theme: theme
34
+ }, restProps), children));
32
35
  }
33
-
34
- function ThemeWrapper(_ref) {
36
+ export function ThemeWrapper(_ref) {
35
37
  let {
36
38
  children,
37
- element,
38
- currentTheme
39
- } = _ref;
39
+ theme,
40
+ element = null,
41
+ className = null
42
+ } = _ref,
43
+ rest = _objectWithoutProperties(_ref, _excluded2);
44
+
45
+ const Wrapper = element === false ? React.Fragment : element || 'div';
46
+ const ref = React.useRef(null);
47
+
48
+ if (Wrapper === React.Fragment) {
49
+ return children;
50
+ }
40
51
 
52
+ rest['ref'] = ref;
53
+ const classNames = getThemeClasses(theme, className);
41
54
  const {
42
55
  name,
43
56
  variant,
44
- size,
45
- colorMapping
46
- } = currentTheme,
47
- rest = _objectWithoutProperties(currentTheme, _excluded2);
48
-
49
- const Wrapper = element || 'div';
50
- const ref = React.useRef(null);
51
- rest['ref'] = ref;
52
- const className = classnames('eufemia-theme', name && `eufemia-theme__${name}` + (variant ? ` eufemia-theme__${name}--${variant}` : ""), colorMapping && `eufemia-theme__color-mapping--${colorMapping}`, size && `eufemia-theme__size--${size}`);
57
+ size
58
+ } = theme;
53
59
  return React.createElement(Wrapper, _extends({
54
60
  "data-name": name,
55
61
  "data-variant": variant,
56
62
  "data-size": size,
57
- className: className
63
+ className: classNames
58
64
  }, rest), children);
65
+ }
66
+ export function getThemeClasses(theme) {
67
+ let className = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
68
+
69
+ if (!theme) {
70
+ return className;
71
+ }
72
+
73
+ const {
74
+ name,
75
+ variant,
76
+ size,
77
+ colorMapping
78
+ } = theme;
79
+ return classnames(className, 'eufemia-theme', name && `eufemia-theme__${name}` + (variant ? ` eufemia-theme__${name}--${variant}` : ""), colorMapping && `eufemia-theme__color-mapping--${colorMapping}`, size && `eufemia-theme__size--${size}`);
59
80
  }
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  import useTheme from './useTheme';
2
3
  export default function VisibilityByTheme(_ref) {
3
4
  let {
@@ -5,7 +6,11 @@ export default function VisibilityByTheme(_ref) {
5
6
  visible,
6
7
  hidden
7
8
  } = _ref;
8
- const theme = useTheme();
9
+ const themeOrig = useTheme();
10
+ const [theme, refresh] = React.useState({});
11
+ React.useLayoutEffect(() => {
12
+ refresh(themeOrig);
13
+ }, [themeOrig]);
9
14
  const visibleList = Array.isArray(visible) ? visible : [visible];
10
15
  const hiddenList = Array.isArray(hidden) ? hidden : [hidden];
11
16
 
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).dnbBasis={})}(this,(function(e){"use strict";var t="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};"function"==typeof t.setTimeout&&setTimeout,"function"==typeof t.clearTimeout&&clearTimeout;function n(e,t){this.fun=e,this.array=t}n.prototype.run=function(){this.fun.apply(null,this.array)};var o=t.performance||{};o.now||o.mozNow||o.msNow||o.oNow||o.webkitNow;new Date;var i={};!function(e,t){function n(e){if(e&&"object"==typeof e){var t=e.which||e.keyCode||e.charCode;t&&(e=t)}if("number"==typeof e)return a[e];var n,r=String(e);return(n=o[r.toLowerCase()])?n:(n=i[r.toLowerCase()])||(1===r.length?r.charCodeAt(0):void 0)}n.isEventKey=function(e,t){if(e&&"object"==typeof e){var n=e.which||e.keyCode||e.charCode;if(null==n)return!1;if("string"==typeof t){var r;if(r=o[t.toLowerCase()])return r===n;if(r=i[t.toLowerCase()])return r===n}else if("number"==typeof t)return t===n;return!1}};var o=(t=e.exports=n).code=t.codes={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,"pause/break":19,"caps lock":20,esc:27,space:32,"page up":33,"page down":34,end:35,home:36,left:37,up:38,right:39,down:40,insert:45,delete:46,command:91,"left command":91,"right command":93,"numpad *":106,"numpad +":107,"numpad -":109,"numpad .":110,"numpad /":111,"num lock":144,"scroll lock":145,"my computer":182,"my calculator":183,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},i=t.aliases={windows:91,"⇧":16,"⌥":18,"⌃":17,"⌘":91,ctl:17,control:17,option:18,pause:19,break:19,caps:20,return:13,escape:27,spc:32,spacebar:32,pgup:33,pgdn:34,ins:45,del:46,cmd:91};for(r=97;r<123;r++)o[String.fromCharCode(r)]=r-32;for(var r=48;r<58;r++)o[r-48]=r;for(r=1;r<13;r++)o["f"+r]=r+111;for(r=0;r<10;r++)o["numpad "+r]=r+96;var a=t.names=t.title={};for(r in o)a[o[r]]=r;for(var d in i)o[d]=i[d]}({get exports(){return i},set exports(e){i=e}},i);var r={};!function(e,t){var n;n=function(){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var i=t[o]={exports:{},id:o,loaded:!1};return e[o].call(i.exports,i,i.exports,n),i.loaded=!0,i.exports}return n.m=e,n.c=t,n.p="",n(0)}([function(e,t){e.exports=function(){if("undefined"==typeof document||"undefined"==typeof window)return{ask:function(){return"initial"},element:function(){return null},ignoreKeys:function(){},specificKeys:function(){},registerOnChange:function(){},unRegisterOnChange:function(){}};var e=document.documentElement,t=null,n="initial",o=n,i=Date.now(),r="false",a=["button","input","select","textarea"],d=[],u=[16,17,18,91,93],s=[],c={keydown:"keyboard",keyup:"keyboard",mousedown:"mouse",mousemove:"mouse",MSPointerDown:"pointer",MSPointerMove:"pointer",pointerdown:"pointer",pointermove:"pointer",touchstart:"touch",touchend:"touch"},f=!1,p={x:null,y:null},l={2:"touch",3:"touch",4:"mouse"},w=!1;try{var m=Object.defineProperty({},"passive",{get:function(){w=!0}});window.addEventListener("test",null,m)}catch(e){}var v=function(){var e=!!w&&{passive:!0};document.addEventListener("DOMContentLoaded",g),window.PointerEvent?(window.addEventListener("pointerdown",h),window.addEventListener("pointermove",E)):window.MSPointerEvent?(window.addEventListener("MSPointerDown",h),window.addEventListener("MSPointerMove",E)):(window.addEventListener("mousedown",h),window.addEventListener("mousemove",E),"ontouchstart"in window&&(window.addEventListener("touchstart",h,e),window.addEventListener("touchend",h))),window.addEventListener(k(),E,e),window.addEventListener("keydown",h),window.addEventListener("keyup",h),window.addEventListener("focusin",b),window.addEventListener("focusout",x)},g=function(){if(r=!(e.getAttribute("data-whatpersist")||"false"===document.body.getAttribute("data-whatpersist")))try{window.sessionStorage.getItem("what-input")&&(n=window.sessionStorage.getItem("what-input")),window.sessionStorage.getItem("what-intent")&&(o=window.sessionStorage.getItem("what-intent"))}catch(e){}y("input"),y("intent")},h=function(e){var t=e.which,i=c[e.type];"pointer"===i&&(i=S(e));var r=!s.length&&-1===u.indexOf(t),d=s.length&&-1!==s.indexOf(t),f="keyboard"===i&&t&&(r||d)||"mouse"===i||"touch"===i;if(C(i)&&(f=!1),f&&n!==i&&(L("input",n=i),y("input")),f&&o!==i){var p=document.activeElement;p&&p.nodeName&&(-1===a.indexOf(p.nodeName.toLowerCase())||"button"===p.nodeName.toLowerCase()&&!O(p,"form"))&&(L("intent",o=i),y("intent"))}},y=function(t){e.setAttribute("data-what"+t,"input"===t?n:o),A(t)},E=function(e){var t=c[e.type];"pointer"===t&&(t=S(e)),M(e),(!f&&!C(t)||f&&"wheel"===e.type||"mousewheel"===e.type||"DOMMouseScroll"===e.type)&&o!==t&&(L("intent",o=t),y("intent"))},b=function(n){n.target.nodeName?(t=n.target.nodeName.toLowerCase(),e.setAttribute("data-whatelement",t),n.target.classList&&n.target.classList.length&&e.setAttribute("data-whatclasses",n.target.classList.toString().replace(" ",","))):x()},x=function(){t=null,e.removeAttribute("data-whatelement"),e.removeAttribute("data-whatclasses")},L=function(e,t){if(r)try{window.sessionStorage.setItem("what-"+e,t)}catch(e){}},S=function(e){return"number"==typeof e.pointerType?l[e.pointerType]:"pen"===e.pointerType?"touch":e.pointerType},C=function(e){var t=Date.now(),o="mouse"===e&&"touch"===n&&t-i<200;return i=t,o},k=function(){return"onwheel"in document.createElement("div")?"wheel":void 0!==document.onmousewheel?"mousewheel":"DOMMouseScroll"},A=function(e){for(var t=0,i=d.length;t<i;t++)d[t].type===e&&d[t].fn.call(void 0,"input"===e?n:o)},M=function(e){p.x!==e.screenX||p.y!==e.screenY?(f=!1,p.x=e.screenX,p.y=e.screenY):f=!0},O=function(e,t){var n=window.Element.prototype;if(n.matches||(n.matches=n.msMatchesSelector||n.webkitMatchesSelector),n.closest)return e.closest(t);do{if(e.matches(t))return e;e=e.parentElement||e.parentNode}while(null!==e&&1===e.nodeType);return null};return"addEventListener"in window&&Array.prototype.indexOf&&(c[k()]="mouse",v()),{ask:function(e){return"intent"===e?o:n},element:function(){return t},ignoreKeys:function(e){u=e},specificKeys:function(e){s=e},registerOnChange:function(e,t){d.push({fn:e,type:t||"input"})},unRegisterOnChange:function(e){var t=function(e){for(var t=0,n=d.length;t<n;t++)if(d[t].fn===e)return t}(e);(t||0===t)&&d.splice(t,1)},clearStorage:function(){window.sessionStorage.clear()}}}()}])},e.exports=n()}({get exports(){return r},set exports(e){r=e}});var a=r;const d="Mac|iPad|iPhone|iPod",u="Linux";let s=!1;var c,f,p,l,w,m,v,g;"undefined"!=typeof navigator&&/edge/i.test(null===(c=navigator)||void 0===c?void 0:c.userAgent),"undefined"!=typeof navigator&&new RegExp("iOS|iPhone|iPad|iPod","i").test(null===(f=navigator)||void 0===f?void 0:f.platform),s="undefined"!=typeof navigator&&/safari/i.test(null===(p=navigator)||void 0===p?void 0:p.userAgent)&&!/chrome/i.test(null===(l=navigator)||void 0===l?void 0:l.userAgent),"undefined"!=typeof navigator&&new RegExp("Win","i").test(null===(w=navigator)||void 0===w?void 0:w.platform),"undefined"!=typeof navigator&&new RegExp("Android","i").test(null===(m=navigator)||void 0===m?void 0:m.userAgent),"undefined"!=typeof navigator&&new RegExp(d,"i").test(null===(v=navigator)||void 0===v?void 0:v.platform),"undefined"!=typeof navigator&&new RegExp(u,"i").test(null===(g=navigator)||void 0===g?void 0:g.platform);function h(){const e=()=>{if("undefined"!=typeof document&&"undefined"!=typeof window&&"undefined"!=typeof navigator){try{"undefined"!=typeof window&&window.IS_TEST?document.documentElement.setAttribute("data-os","other"):null!==navigator.platform.match(new RegExp(d))?document.documentElement.setAttribute("data-os","mac"):null!==navigator.platform.match(new RegExp("Win"))?document.documentElement.setAttribute("data-os","win"):null!==navigator.platform.match(new RegExp(u))&&document.documentElement.setAttribute("data-os","linux")}catch(e){}document.removeEventListener("DOMContentLoaded",e)}};"undefined"!=typeof document&&"loading"===document.readyState?document.addEventListener("DOMContentLoaded",e):e()}!function(){if("undefined"!=typeof window){class e{get version(){return"10.0.0-beta.5"}}window.Eufemia=new e}}(),a.specificKeys([9]),h(),e.defineNavigator=h,e.isTouchDevice=function(){if("undefined"!=typeof document){let e=!1;try{e=document.documentElement.getAttribute("data-whatintent")}catch(e){}return"touch"===e}return!1}}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).dnbBasis={})}(this,(function(e){"use strict";var t="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};"function"==typeof t.setTimeout&&setTimeout,"function"==typeof t.clearTimeout&&clearTimeout;function n(e,t){this.fun=e,this.array=t}n.prototype.run=function(){this.fun.apply(null,this.array)};var o=t.performance||{};o.now||o.mozNow||o.msNow||o.oNow||o.webkitNow;new Date;var i={};!function(e,t){function n(e){if(e&&"object"==typeof e){var t=e.which||e.keyCode||e.charCode;t&&(e=t)}if("number"==typeof e)return a[e];var n,r=String(e);return(n=o[r.toLowerCase()])?n:(n=i[r.toLowerCase()])||(1===r.length?r.charCodeAt(0):void 0)}n.isEventKey=function(e,t){if(e&&"object"==typeof e){var n=e.which||e.keyCode||e.charCode;if(null==n)return!1;if("string"==typeof t){var r;if(r=o[t.toLowerCase()])return r===n;if(r=i[t.toLowerCase()])return r===n}else if("number"==typeof t)return t===n;return!1}};var o=(t=e.exports=n).code=t.codes={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,"pause/break":19,"caps lock":20,esc:27,space:32,"page up":33,"page down":34,end:35,home:36,left:37,up:38,right:39,down:40,insert:45,delete:46,command:91,"left command":91,"right command":93,"numpad *":106,"numpad +":107,"numpad -":109,"numpad .":110,"numpad /":111,"num lock":144,"scroll lock":145,"my computer":182,"my calculator":183,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},i=t.aliases={windows:91,"⇧":16,"⌥":18,"⌃":17,"⌘":91,ctl:17,control:17,option:18,pause:19,break:19,caps:20,return:13,escape:27,spc:32,spacebar:32,pgup:33,pgdn:34,ins:45,del:46,cmd:91};for(r=97;r<123;r++)o[String.fromCharCode(r)]=r-32;for(var r=48;r<58;r++)o[r-48]=r;for(r=1;r<13;r++)o["f"+r]=r+111;for(r=0;r<10;r++)o["numpad "+r]=r+96;var a=t.names=t.title={};for(r in o)a[o[r]]=r;for(var d in i)o[d]=i[d]}({get exports(){return i},set exports(e){i=e}},i);var r={};!function(e,t){var n;n=function(){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var i=t[o]={exports:{},id:o,loaded:!1};return e[o].call(i.exports,i,i.exports,n),i.loaded=!0,i.exports}return n.m=e,n.c=t,n.p="",n(0)}([function(e,t){e.exports=function(){if("undefined"==typeof document||"undefined"==typeof window)return{ask:function(){return"initial"},element:function(){return null},ignoreKeys:function(){},specificKeys:function(){},registerOnChange:function(){},unRegisterOnChange:function(){}};var e=document.documentElement,t=null,n="initial",o=n,i=Date.now(),r="false",a=["button","input","select","textarea"],d=[],u=[16,17,18,91,93],s=[],c={keydown:"keyboard",keyup:"keyboard",mousedown:"mouse",mousemove:"mouse",MSPointerDown:"pointer",MSPointerMove:"pointer",pointerdown:"pointer",pointermove:"pointer",touchstart:"touch",touchend:"touch"},f=!1,p={x:null,y:null},l={2:"touch",3:"touch",4:"mouse"},w=!1;try{var m=Object.defineProperty({},"passive",{get:function(){w=!0}});window.addEventListener("test",null,m)}catch(e){}var v=function(){var e=!!w&&{passive:!0};document.addEventListener("DOMContentLoaded",g),window.PointerEvent?(window.addEventListener("pointerdown",h),window.addEventListener("pointermove",E)):window.MSPointerEvent?(window.addEventListener("MSPointerDown",h),window.addEventListener("MSPointerMove",E)):(window.addEventListener("mousedown",h),window.addEventListener("mousemove",E),"ontouchstart"in window&&(window.addEventListener("touchstart",h,e),window.addEventListener("touchend",h))),window.addEventListener(k(),E,e),window.addEventListener("keydown",h),window.addEventListener("keyup",h),window.addEventListener("focusin",b),window.addEventListener("focusout",x)},g=function(){if(r=!(e.getAttribute("data-whatpersist")||"false"===document.body.getAttribute("data-whatpersist")))try{window.sessionStorage.getItem("what-input")&&(n=window.sessionStorage.getItem("what-input")),window.sessionStorage.getItem("what-intent")&&(o=window.sessionStorage.getItem("what-intent"))}catch(e){}y("input"),y("intent")},h=function(e){var t=e.which,i=c[e.type];"pointer"===i&&(i=S(e));var r=!s.length&&-1===u.indexOf(t),d=s.length&&-1!==s.indexOf(t),f="keyboard"===i&&t&&(r||d)||"mouse"===i||"touch"===i;if(C(i)&&(f=!1),f&&n!==i&&(L("input",n=i),y("input")),f&&o!==i){var p=document.activeElement;p&&p.nodeName&&(-1===a.indexOf(p.nodeName.toLowerCase())||"button"===p.nodeName.toLowerCase()&&!O(p,"form"))&&(L("intent",o=i),y("intent"))}},y=function(t){e.setAttribute("data-what"+t,"input"===t?n:o),A(t)},E=function(e){var t=c[e.type];"pointer"===t&&(t=S(e)),M(e),(!f&&!C(t)||f&&"wheel"===e.type||"mousewheel"===e.type||"DOMMouseScroll"===e.type)&&o!==t&&(L("intent",o=t),y("intent"))},b=function(n){n.target.nodeName?(t=n.target.nodeName.toLowerCase(),e.setAttribute("data-whatelement",t),n.target.classList&&n.target.classList.length&&e.setAttribute("data-whatclasses",n.target.classList.toString().replace(" ",","))):x()},x=function(){t=null,e.removeAttribute("data-whatelement"),e.removeAttribute("data-whatclasses")},L=function(e,t){if(r)try{window.sessionStorage.setItem("what-"+e,t)}catch(e){}},S=function(e){return"number"==typeof e.pointerType?l[e.pointerType]:"pen"===e.pointerType?"touch":e.pointerType},C=function(e){var t=Date.now(),o="mouse"===e&&"touch"===n&&t-i<200;return i=t,o},k=function(){return"onwheel"in document.createElement("div")?"wheel":void 0!==document.onmousewheel?"mousewheel":"DOMMouseScroll"},A=function(e){for(var t=0,i=d.length;t<i;t++)d[t].type===e&&d[t].fn.call(void 0,"input"===e?n:o)},M=function(e){p.x!==e.screenX||p.y!==e.screenY?(f=!1,p.x=e.screenX,p.y=e.screenY):f=!0},O=function(e,t){var n=window.Element.prototype;if(n.matches||(n.matches=n.msMatchesSelector||n.webkitMatchesSelector),n.closest)return e.closest(t);do{if(e.matches(t))return e;e=e.parentElement||e.parentNode}while(null!==e&&1===e.nodeType);return null};return"addEventListener"in window&&Array.prototype.indexOf&&(c[k()]="mouse",v()),{ask:function(e){return"intent"===e?o:n},element:function(){return t},ignoreKeys:function(e){u=e},specificKeys:function(e){s=e},registerOnChange:function(e,t){d.push({fn:e,type:t||"input"})},unRegisterOnChange:function(e){var t=function(e){for(var t=0,n=d.length;t<n;t++)if(d[t].fn===e)return t}(e);(t||0===t)&&d.splice(t,1)},clearStorage:function(){window.sessionStorage.clear()}}}()}])},e.exports=n()}({get exports(){return r},set exports(e){r=e}});var a=r;const d="Mac|iPad|iPhone|iPod",u="Linux";let s=!1;var c,f,p,l,w,m,v,g;"undefined"!=typeof navigator&&/edge/i.test(null===(c=navigator)||void 0===c?void 0:c.userAgent),"undefined"!=typeof navigator&&new RegExp("iOS|iPhone|iPad|iPod","i").test(null===(f=navigator)||void 0===f?void 0:f.platform),s="undefined"!=typeof navigator&&/safari/i.test(null===(p=navigator)||void 0===p?void 0:p.userAgent)&&!/chrome/i.test(null===(l=navigator)||void 0===l?void 0:l.userAgent),"undefined"!=typeof navigator&&new RegExp("Win","i").test(null===(w=navigator)||void 0===w?void 0:w.platform),"undefined"!=typeof navigator&&new RegExp("Android","i").test(null===(m=navigator)||void 0===m?void 0:m.userAgent),"undefined"!=typeof navigator&&new RegExp(d,"i").test(null===(v=navigator)||void 0===v?void 0:v.platform),"undefined"!=typeof navigator&&new RegExp(u,"i").test(null===(g=navigator)||void 0===g?void 0:g.platform);function h(){const e=()=>{if("undefined"!=typeof document&&"undefined"!=typeof window&&"undefined"!=typeof navigator){try{"undefined"!=typeof window&&window.IS_TEST?document.documentElement.setAttribute("data-os","other"):null!==navigator.platform.match(new RegExp(d))?document.documentElement.setAttribute("data-os","mac"):null!==navigator.platform.match(new RegExp("Win"))?document.documentElement.setAttribute("data-os","win"):null!==navigator.platform.match(new RegExp(u))&&document.documentElement.setAttribute("data-os","linux")}catch(e){}document.removeEventListener("DOMContentLoaded",e)}};"undefined"!=typeof document&&"loading"===document.readyState?document.addEventListener("DOMContentLoaded",e):e()}!function(){if("undefined"!=typeof window){class e{get version(){return"10.0.0-beta.7"}}window.Eufemia=new e}}(),a.specificKeys([9]),h(),e.defineNavigator=h,e.isTouchDevice=function(){if("undefined"!=typeof document){let e=!1;try{e=document.documentElement.getAttribute("data-whatintent")}catch(e){}return"touch"===e}return!1}}));