@dnb/eufemia 10.0.0-beta.6 → 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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,19 @@
3
3
  All notable changes to @dnb/eufemia will be documented in this file. See
4
4
  [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [10.0.0-beta.7](https://github.com/dnbexperience/eufemia/compare/v10.0.0-beta.6...v10.0.0-beta.7) (2023-05-10)
7
+
8
+
9
+ ### :sparkles: Features
10
+
11
+ * **Accordion:** export type AccordionIconPosition ([23056cd](https://github.com/dnbexperience/eufemia/commit/23056cdd4f27b8f6ba74a43ad11c346f9ee50369))
12
+ * **Button:** export type ButtonIcon ([ad315bf](https://github.com/dnbexperience/eufemia/commit/ad315bf62ce89dfb02af1a62484c1f5ff593672a))
13
+
14
+
15
+ ### :memo: Documentation
16
+
17
+ * **v10:** adds examples for updating import of boolean props ([b598078](https://github.com/dnbexperience/eufemia/commit/b59807882164ca6136a57237c53d231d8ac11684))
18
+
6
19
  ## [10.0.0-beta.6](https://github.com/dnbexperience/eufemia/compare/v10.0.0-beta.5...v10.0.0-beta.6) (2023-05-10)
7
20
 
8
21
 
@@ -21,6 +21,7 @@ export type AccordionIcon =
21
21
  expanded?: React.ReactNode | ((...args: any[]) => any);
22
22
  };
23
23
  export type AccordionAttributes = string | Record<string, unknown>;
24
+ export type AccordionIconPosition = ButtonIconPosition;
24
25
  export interface AccordionProps
25
26
  extends Omit<React.HTMLProps<HTMLElement>, 'ref'>,
26
27
  SpacingProps {
@@ -129,7 +130,7 @@ export interface AccordionProps
129
130
  /**
130
131
  * Will set the placement of the icon. Defaults to `left`.
131
132
  */
132
- icon_position?: ButtonIconPosition;
133
+ icon_position?: AccordionIconPosition;
133
134
 
134
135
  /**
135
136
  * Define a different icon size. Defaults to `medium` (1.5rem).
@@ -15,6 +15,7 @@ export type ButtonVariant =
15
15
  | 'signal'
16
16
  | 'unstyled';
17
17
  export type ButtonSize = 'default' | 'small' | 'medium' | 'large';
18
+ export type ButtonIcon = IconIcon;
18
19
  export type ButtonIconPositionTertiary = 'top';
19
20
  export type ButtonIconPosition = 'left' | 'right';
20
21
  export type ButtonIconPositionAll =
@@ -65,7 +66,7 @@ export type ButtonProps = {
65
66
  /**
66
67
  * To be included in the button. <a href="/icons/primary">Primary Icons</a> can be set as a string (e.g. `icon="chevron_right"`), other icons should be set as React elements.
67
68
  */
68
- icon?: IconIcon;
69
+ icon?: ButtonIcon;
69
70
 
70
71
  /**
71
72
  * Position of icon inside the button. Set to `left` or `right`. Tertiary button variant also supports `top`. Defaults to `right` if not set.
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import type { ButtonIconPosition } from '../button';
2
+ import type { ButtonIconPosition } from '../Button';
3
3
  import type { FormLabelLabelDirection, FormLabelText } from '../FormLabel';
4
4
  import type {
5
5
  FormStatusProps,
@@ -9,7 +9,7 @@ function init() {
9
9
  if (typeof window !== 'undefined') {
10
10
  class Eufemia {
11
11
  get version() {
12
- return '10.0.0-beta.6';
12
+ return '10.0.0-beta.7';
13
13
  }
14
14
 
15
15
  }
@@ -5,6 +5,8 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = VisibilityByTheme;
7
7
 
8
+ var _react = _interopRequireDefault(require("react"));
9
+
8
10
  var _useTheme = _interopRequireDefault(require("./useTheme"));
9
11
 
10
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -15,7 +17,14 @@ function VisibilityByTheme(_ref) {
15
17
  visible,
16
18
  hidden
17
19
  } = _ref;
18
- const theme = (0, _useTheme.default)();
20
+ const themeOrig = (0, _useTheme.default)();
21
+
22
+ const [theme, refresh] = _react.default.useState({});
23
+
24
+ _react.default.useLayoutEffect(() => {
25
+ refresh(themeOrig);
26
+ }, [themeOrig]);
27
+
19
28
  const visibleList = Array.isArray(visible) ? visible : [visible];
20
29
  const hiddenList = Array.isArray(hidden) ? hidden : [hidden];
21
30
 
@@ -21,6 +21,7 @@ export type AccordionIcon =
21
21
  expanded?: React.ReactNode | ((...args: any[]) => any);
22
22
  };
23
23
  export type AccordionAttributes = string | Record<string, unknown>;
24
+ export type AccordionIconPosition = ButtonIconPosition;
24
25
  export interface AccordionProps
25
26
  extends Omit<React.HTMLProps<HTMLElement>, 'ref'>,
26
27
  SpacingProps {
@@ -129,7 +130,7 @@ export interface AccordionProps
129
130
  /**
130
131
  * Will set the placement of the icon. Defaults to `left`.
131
132
  */
132
- icon_position?: ButtonIconPosition;
133
+ icon_position?: AccordionIconPosition;
133
134
 
134
135
  /**
135
136
  * Define a different icon size. Defaults to `medium` (1.5rem).
@@ -15,6 +15,7 @@ export type ButtonVariant =
15
15
  | 'signal'
16
16
  | 'unstyled';
17
17
  export type ButtonSize = 'default' | 'small' | 'medium' | 'large';
18
+ export type ButtonIcon = IconIcon;
18
19
  export type ButtonIconPositionTertiary = 'top';
19
20
  export type ButtonIconPosition = 'left' | 'right';
20
21
  export type ButtonIconPositionAll =
@@ -65,7 +66,7 @@ export type ButtonProps = {
65
66
  /**
66
67
  * To be included in the button. <a href="/icons/primary">Primary Icons</a> can be set as a string (e.g. `icon="chevron_right"`), other icons should be set as React elements.
67
68
  */
68
- icon?: IconIcon;
69
+ icon?: ButtonIcon;
69
70
 
70
71
  /**
71
72
  * Position of icon inside the button. Set to `left` or `right`. Tertiary button variant also supports `top`. Defaults to `right` if not set.
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import type { ButtonIconPosition } from '../button';
2
+ import type { ButtonIconPosition } from '../Button';
3
3
  import type { FormLabelLabelDirection, FormLabelText } from '../FormLabel';
4
4
  import type {
5
5
  FormStatusProps,
@@ -21,6 +21,7 @@ export type AccordionIcon =
21
21
  expanded?: React.ReactNode | ((...args: any[]) => any);
22
22
  };
23
23
  export type AccordionAttributes = string | Record<string, unknown>;
24
+ export type AccordionIconPosition = ButtonIconPosition;
24
25
  export interface AccordionProps
25
26
  extends Omit<React.HTMLProps<HTMLElement>, 'ref'>,
26
27
  SpacingProps {
@@ -129,7 +130,7 @@ export interface AccordionProps
129
130
  /**
130
131
  * Will set the placement of the icon. Defaults to `left`.
131
132
  */
132
- icon_position?: ButtonIconPosition;
133
+ icon_position?: AccordionIconPosition;
133
134
 
134
135
  /**
135
136
  * Define a different icon size. Defaults to `medium` (1.5rem).
@@ -15,6 +15,7 @@ export type ButtonVariant =
15
15
  | 'signal'
16
16
  | 'unstyled';
17
17
  export type ButtonSize = 'default' | 'small' | 'medium' | 'large';
18
+ export type ButtonIcon = IconIcon;
18
19
  export type ButtonIconPositionTertiary = 'top';
19
20
  export type ButtonIconPosition = 'left' | 'right';
20
21
  export type ButtonIconPositionAll =
@@ -65,7 +66,7 @@ export type ButtonProps = {
65
66
  /**
66
67
  * To be included in the button. <a href="/icons/primary">Primary Icons</a> can be set as a string (e.g. `icon="chevron_right"`), other icons should be set as React elements.
67
68
  */
68
- icon?: IconIcon;
69
+ icon?: ButtonIcon;
69
70
 
70
71
  /**
71
72
  * Position of icon inside the button. Set to `left` or `right`. Tertiary button variant also supports `top`. Defaults to `right` if not set.
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import type { ButtonIconPosition } from '../button';
2
+ import type { ButtonIconPosition } from '../Button';
3
3
  import type { FormLabelLabelDirection, FormLabelText } from '../FormLabel';
4
4
  import type {
5
5
  FormStatusProps,
@@ -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.6';
5
+ return '10.0.0-beta.7';
6
6
  }
7
7
 
8
8
  }
@@ -1,10 +1,15 @@
1
+ import React from 'react';
1
2
  import useTheme from './useTheme';
2
3
  export default function VisibilityByTheme({
3
4
  children,
4
5
  visible,
5
6
  hidden
6
7
  }) {
7
- const theme = useTheme();
8
+ const themeOrig = useTheme();
9
+ const [theme, refresh] = React.useState({});
10
+ React.useLayoutEffect(() => {
11
+ refresh(themeOrig);
12
+ }, [themeOrig]);
8
13
  const visibleList = Array.isArray(visible) ? visible : [visible];
9
14
  const hiddenList = Array.isArray(hidden) ? hidden : [hidden];
10
15
 
@@ -1 +1 @@
1
- import"react";var e="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};"function"==typeof e.setTimeout&&setTimeout,"function"==typeof e.clearTimeout&&clearTimeout;function t(e,t){this.fun=e,this.array=t}t.prototype.run=function(){this.fun.apply(null,this.array)};var n=e.performance||{};n.now||n.mozNow||n.msNow||n.oNow||n.webkitNow;new Date;var o={};!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 o},set exports(e){o=e}},o);var i,r={};i=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",L)},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&&(x("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()&&!P(p,"form"))&&(x("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&&(x("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(" ",","))):L()},L=function(){t=null,e.removeAttribute("data-whatelement"),e.removeAttribute("data-whatclasses")},x=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},P=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()}}}()}])},{get exports(){return r},set exports(e){r=e}}.exports=i();var a=r;let d=!1;var u,s,c,f,p,l,w,m;"undefined"!=typeof navigator&&/edge/i.test(null===(u=navigator)||void 0===u?void 0:u.userAgent),"undefined"!=typeof navigator&&new RegExp("iOS|iPhone|iPad|iPod","i").test(null===(s=navigator)||void 0===s?void 0:s.platform),d="undefined"!=typeof navigator&&/safari/i.test(null===(c=navigator)||void 0===c?void 0:c.userAgent)&&!/chrome/i.test(null===(f=navigator)||void 0===f?void 0:f.userAgent),"undefined"!=typeof navigator&&new RegExp("Win","i").test(null===(p=navigator)||void 0===p?void 0:p.platform),"undefined"!=typeof navigator&&new RegExp("Android","i").test(null===(l=navigator)||void 0===l?void 0:l.userAgent),"undefined"!=typeof navigator&&new RegExp("Mac|iPad|iPhone|iPod","i").test(null===(w=navigator)||void 0===w?void 0:w.platform),"undefined"!=typeof navigator&&new RegExp("Linux","i").test(null===(m=navigator)||void 0===m?void 0:m.platform);function v(){if("undefined"!=typeof document){let e=!1;try{e=document.documentElement.getAttribute("data-whatintent")}catch(e){}return"touch"===e}return!1}function g(){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("Mac|iPad|iPhone|iPod"))?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("Linux"))&&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.6"}}window.Eufemia=new e}}(),a.specificKeys([9]),g();export{g as defineNavigator,v as isTouchDevice};
1
+ import"react";var e="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};"function"==typeof e.setTimeout&&setTimeout,"function"==typeof e.clearTimeout&&clearTimeout;function t(e,t){this.fun=e,this.array=t}t.prototype.run=function(){this.fun.apply(null,this.array)};var n=e.performance||{};n.now||n.mozNow||n.msNow||n.oNow||n.webkitNow;new Date;var o={};!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 o},set exports(e){o=e}},o);var i,r={};i=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",L)},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&&(x("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()&&!P(p,"form"))&&(x("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&&(x("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(" ",","))):L()},L=function(){t=null,e.removeAttribute("data-whatelement"),e.removeAttribute("data-whatclasses")},x=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},P=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()}}}()}])},{get exports(){return r},set exports(e){r=e}}.exports=i();var a=r;let d=!1;var u,s,c,f,p,l,w,m;"undefined"!=typeof navigator&&/edge/i.test(null===(u=navigator)||void 0===u?void 0:u.userAgent),"undefined"!=typeof navigator&&new RegExp("iOS|iPhone|iPad|iPod","i").test(null===(s=navigator)||void 0===s?void 0:s.platform),d="undefined"!=typeof navigator&&/safari/i.test(null===(c=navigator)||void 0===c?void 0:c.userAgent)&&!/chrome/i.test(null===(f=navigator)||void 0===f?void 0:f.userAgent),"undefined"!=typeof navigator&&new RegExp("Win","i").test(null===(p=navigator)||void 0===p?void 0:p.platform),"undefined"!=typeof navigator&&new RegExp("Android","i").test(null===(l=navigator)||void 0===l?void 0:l.userAgent),"undefined"!=typeof navigator&&new RegExp("Mac|iPad|iPhone|iPod","i").test(null===(w=navigator)||void 0===w?void 0:w.platform),"undefined"!=typeof navigator&&new RegExp("Linux","i").test(null===(m=navigator)||void 0===m?void 0:m.platform);function v(){if("undefined"!=typeof document){let e=!1;try{e=document.documentElement.getAttribute("data-whatintent")}catch(e){}return"touch"===e}return!1}function g(){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("Mac|iPad|iPhone|iPod"))?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("Linux"))&&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]),g();export{g as defineNavigator,v as isTouchDevice};