@dnb/eufemia 10.4.0 → 10.4.1
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 +7 -0
- package/cjs/components/tabs/TabsContentWrapper.js +1 -1
- package/cjs/components/tabs/TabsContentWrapper.js.map +1 -1
- package/cjs/shared/Eufemia.d.ts +1 -1
- package/cjs/shared/Eufemia.js +2 -2
- package/cjs/shared/Eufemia.js.map +1 -1
- package/components/tabs/TabsContentWrapper.js +1 -1
- package/components/tabs/TabsContentWrapper.js.map +1 -1
- package/es/components/tabs/TabsContentWrapper.js +1 -1
- package/es/components/tabs/TabsContentWrapper.js.map +1 -1
- package/es/shared/Eufemia.d.ts +1 -1
- package/es/shared/Eufemia.js +2 -2
- package/es/shared/Eufemia.js.map +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 +1 -1
- package/esm/dnb-ui-lib.min.mjs +1 -1
- package/package.json +1 -1
- package/shared/Eufemia.d.ts +1 -1
- package/shared/Eufemia.js +2 -2
- package/shared/Eufemia.js.map +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 +1 -1
- package/umd/dnb-ui-lib.min.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,13 @@
|
|
|
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.4.1](https://github.com/dnbexperience/eufemia/compare/v10.4.0...v10.4.1) (2023-07-25)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### :bug: Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **Tabs:** fix error when using StrictMode ([7f1e807](https://github.com/dnbexperience/eufemia/commit/7f1e807fe1df00caf51f1bc59914d121f956d3c9))
|
|
12
|
+
|
|
6
13
|
## [10.4.0](https://github.com/dnbexperience/eufemia/compare/v10.3.0...v10.4.0) (2023-07-06)
|
|
7
14
|
|
|
8
15
|
|
|
@@ -32,7 +32,7 @@ class ContentWrapper extends _react.default.PureComponent {
|
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
componentDidMount() {
|
|
35
|
-
if (this.props.id) {
|
|
35
|
+
if (this.props.id && this._eventEmitter) {
|
|
36
36
|
this._eventEmitter.listen(params => {
|
|
37
37
|
if (this._eventEmitter && params.key !== this.state.key) {
|
|
38
38
|
this.setState(params);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabsContentWrapper.js","names":["_react","_interopRequireDefault","require","_propTypes","_classnames","_componentHelper","_SpacingHelper","_Section","_EventEmitter","_HeightAnimation","_excluded","obj","__esModule","default","_extends","Object","assign","bind","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","apply","_objectWithoutProperties","excluded","_objectWithoutPropertiesLoose","getOwnPropertySymbols","sourceSymbolKeys","indexOf","propertyIsEnumerable","sourceKeys","keys","_defineProperty","value","_toPropertyKey","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","TypeError","Number","ContentWrapper","React","PureComponent","constructor","props","id","_eventEmitter","EventEmitter","createInstance","state","get","componentDidMount","listen","params","setState","componentWillUnmount","remove","render","_this$props","children","selected_key","content_style","content_spacing","rest","createElement","Fragment","combineLabelledBy","validateDOMAttributes","content","showOverflow","role","tabIndex","spacing","style_type","element","Section","className","classnames","createSpacingClasses","isTrue","exports","process","env","NODE_ENV","propTypes","PropTypes","string","isRequired","oneOfType","number","bool","node","func"],"sources":["../../../../src/components/tabs/TabsContentWrapper.js"],"sourcesContent":["import React from 'react'\nimport PropTypes from 'prop-types'\nimport classnames from 'classnames'\nimport {\n validateDOMAttributes,\n isTrue,\n combineLabelledBy,\n} from '../../shared/component-helper'\nimport { createSpacingClasses } from '../space/SpacingHelper'\nimport Section from '../section/Section'\nimport EventEmitter from '../../shared/helpers/EventEmitter'\nimport HeightAnimation from '../height-animation/HeightAnimation'\n\nexport default class ContentWrapper extends React.PureComponent {\n static propTypes = {\n id: PropTypes.string.isRequired,\n selected_key: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.number,\n ]),\n content_style: PropTypes.string,\n content_spacing: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.bool,\n ]),\n children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),\n }\n static defaultProps = {\n selected_key: null,\n content_style: null,\n content_spacing: true,\n children: null,\n }\n\n state = { key: null }\n\n constructor(props) {\n super(props)\n\n if (props.id) {\n this._eventEmitter = EventEmitter.createInstance(props.id)\n this.state = this._eventEmitter.get()\n }\n }\n\n componentDidMount() {\n if (this.props.id) {\n this._eventEmitter.listen((params) => {\n if (this._eventEmitter && params.key !== this.state.key) {\n this.setState(params)\n }\n })\n }\n }\n\n componentWillUnmount() {\n if (this._eventEmitter) {\n this._eventEmitter.remove()\n this._eventEmitter = null\n }\n }\n\n render() {\n const {\n id,\n children,\n selected_key: key,\n content_style,\n content_spacing,\n ...rest\n } = this.props\n\n if (!children) {\n return <></>\n }\n\n const params = rest\n\n if (key) {\n params['aria-labelledby'] = combineLabelledBy(\n params,\n `${id}-tab-${key}`\n )\n }\n\n validateDOMAttributes(this.props, params)\n\n let content = children\n if (typeof children === 'function') {\n content = children(this.state)\n }\n\n return (\n <HeightAnimation\n showOverflow // in case there is a section used inside\n role=\"tabpanel\"\n tabIndex=\"-1\"\n id={`${id}-content`}\n spacing={content_style ? false : undefined}\n style_type={content_style ? content_style : undefined}\n element={content_style ? Section : 'div'}\n className={classnames(\n 'dnb-tabs__content',\n 'dnb-no-focus',\n content_spacing\n ? `dnb-section--spacing-${\n isTrue(content_spacing) ? 'large' : content_spacing\n }`\n : null,\n createSpacing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AAAC,GAAA,GAAAJ,IAAA,CAAAvB,IAAA,CAAAqB,KAAA,EAAAC,IAAA,2BAAAK,GAAA,sBAAAA,GAAA,YAAAC,SAAA,4DAAAN,IAAA,gBAAAF,MAAA,GAAAS,MAAA,EAAAR,KAAA;AAElD,MAAMS,cAAc,SAASC,cAAK,CAACC,aAAa,CAAC;EAuB9DC,WAAWA,CAACC,KAAK,EAAE;IACjB,KAAK,CAACA,KAAK,CAAC;IAAAvB,eAAA,gBAHN;MAAEd,GAAG,EAAE;IAAK,CAAC;IAKnB,IAAIqC,KAAK,CAACC,EAAE,EAAE;MACZ,IAAI,CAACC,aAAa,GAAGC,qBAAY,CAACC,cAAc,CAACJ,KAAK,CAACC,EAAE,CAAC;MAC1D,IAAI,CAACI,KAAK,GAAG,IAAI,CAACH,aAAa,CAACI,GAAG,CAAC,CAAC;IACvC;EACF;EAEAC,iBAAiBA,CAAA,EAAG;IAClB,IAAI,IAAI,CAACP,KAAK,CAACC,EAAE,EAAE;
|
|
1
|
+
{"version":3,"file":"TabsContentWrapper.js","names":["_react","_interopRequireDefault","require","_propTypes","_classnames","_componentHelper","_SpacingHelper","_Section","_EventEmitter","_HeightAnimation","_excluded","obj","__esModule","default","_extends","Object","assign","bind","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","apply","_objectWithoutProperties","excluded","_objectWithoutPropertiesLoose","getOwnPropertySymbols","sourceSymbolKeys","indexOf","propertyIsEnumerable","sourceKeys","keys","_defineProperty","value","_toPropertyKey","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","TypeError","Number","ContentWrapper","React","PureComponent","constructor","props","id","_eventEmitter","EventEmitter","createInstance","state","get","componentDidMount","listen","params","setState","componentWillUnmount","remove","render","_this$props","children","selected_key","content_style","content_spacing","rest","createElement","Fragment","combineLabelledBy","validateDOMAttributes","content","showOverflow","role","tabIndex","spacing","style_type","element","Section","className","classnames","createSpacingClasses","isTrue","exports","process","env","NODE_ENV","propTypes","PropTypes","string","isRequired","oneOfType","number","bool","node","func"],"sources":["../../../../src/components/tabs/TabsContentWrapper.js"],"sourcesContent":["import React from 'react'\nimport PropTypes from 'prop-types'\nimport classnames from 'classnames'\nimport {\n validateDOMAttributes,\n isTrue,\n combineLabelledBy,\n} from '../../shared/component-helper'\nimport { createSpacingClasses } from '../space/SpacingHelper'\nimport Section from '../section/Section'\nimport EventEmitter from '../../shared/helpers/EventEmitter'\nimport HeightAnimation from '../height-animation/HeightAnimation'\n\nexport default class ContentWrapper extends React.PureComponent {\n static propTypes = {\n id: PropTypes.string.isRequired,\n selected_key: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.number,\n ]),\n content_style: PropTypes.string,\n content_spacing: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.bool,\n ]),\n children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),\n }\n static defaultProps = {\n selected_key: null,\n content_style: null,\n content_spacing: true,\n children: null,\n }\n\n state = { key: null }\n\n constructor(props) {\n super(props)\n\n if (props.id) {\n this._eventEmitter = EventEmitter.createInstance(props.id)\n this.state = this._eventEmitter.get()\n }\n }\n\n componentDidMount() {\n if (this.props.id && this._eventEmitter) {\n this._eventEmitter.listen((params) => {\n if (this._eventEmitter && params.key !== this.state.key) {\n this.setState(params)\n }\n })\n }\n }\n\n componentWillUnmount() {\n if (this._eventEmitter) {\n this._eventEmitter.remove()\n this._eventEmitter = null\n }\n }\n\n render() {\n const {\n id,\n children,\n selected_key: key,\n content_style,\n content_spacing,\n ...rest\n } = this.props\n\n if (!children) {\n return <></>\n }\n\n const params = rest\n\n if (key) {\n params['aria-labelledby'] = combineLabelledBy(\n params,\n `${id}-tab-${key}`\n )\n }\n\n validateDOMAttributes(this.props, params)\n\n let content = children\n if (typeof children === 'function') {\n content = children(this.state)\n }\n\n return (\n <HeightAnimation\n showOverflow // in case there is a section used inside\n role=\"tabpanel\"\n tabIndex=\"-1\"\n id={`${id}-content`}\n spacing={content_style ? false : undefined}\n style_type={content_style ? content_style : undefined}\n element={content_style ? Section : 'div'}\n className={classnames(\n 'dnb-tabs__content',\n 'dnb-no-focus',\n content_spacing\n ? `dnb-section--spacing-${\n isTrue(content_spacing) ? 'large' : content_spacing\n }`\n : null,\n createSpacingClasses(rest)\n )}\n {...params}\n >\n {content}\n </HeightAnimation>\n )\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,WAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,gBAAA,GAAAH,OAAA;AAKA,IAAAI,cAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,aAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,gBAAA,GAAAR,sBAAA,CAAAC,OAAA;AAAiE,MAAAQ,SAAA;AAAA,SAAAT,uBAAAU,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,SAAA,IAAAA,QAAA,GAAAC,MAAA,CAAAC,MAAA,GAAAD,MAAA,CAAAC,MAAA,CAAAC,IAAA,eAAAC,MAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAC,SAAA,CAAAC,MAAA,EAAAF,CAAA,UAAAG,MAAA,GAAAF,SAAA,CAAAD,CAAA,YAAAI,GAAA,IAAAD,MAAA,QAAAP,MAAA,CAAAS,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAJ,MAAA,EAAAC,GAAA,KAAAL,MAAA,CAAAK,GAAA,IAAAD,MAAA,CAAAC,GAAA,gBAAAL,MAAA,YAAAJ,QAAA,CAAAa,KAAA,OAAAP,SAAA;AAAA,SAAAQ,yBAAAN,MAAA,EAAAO,QAAA,QAAAP,MAAA,yBAAAJ,MAAA,GAAAY,6BAAA,CAAA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,GAAGA,eACrC,EAGP;IAAE,GACET,MAAM,GAETe,OACc,CAAC;EAEtB;AACF;AAACY,OAAA,CAAAnF,OAAA,GAAA2C,cAAA;AAAAnB,eAAA,CAxGoBmB,cAAc,kBAcX;EACpBoB,YAAY,EAAE,IAAI;EAClBC,aAAa,EAAE,IAAI;EACnBC,eAAe,EAAE,IAAI;EACrBH,QAAQ,EAAE;AACZ,CAAC;AAAAsB,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAnBkB3C,cAAc,CAC1B4C,SAAS,GAAG;EACjBvC,EAAE,EAAEwC,kBAAS,CAACC,MAAM,CAACC,UAAU;EAC/B3B,YAAY,EAAEyB,kBAAS,CAACG,SAAS,CAAC,CAChCH,kBAAS,CAACC,MAAM,EAChBD,kBAAS,CAACI,MAAM,CACjB,CAAC;EACF5B,aAAa,EAAEwB,kBAAS,CAACC,MAAM;EAC/BxB,eAAe,EAAEuB,kBAAS,CAACG,SAAS,CAAC,CACnCH,kBAAS,CAACC,MAAM,EAChBD,kBAAS,CAACK,IAAI,CACf,CAAC;EACF/B,QAAQ,EAAE0B,kBAAS,CAACG,SAAS,CAAC,CAACH,kBAAS,CAACM,IAAI,EAAEN,kBAAS,CAACO,IAAI,CAAC;AAChE,CAAC"}
|
package/cjs/shared/Eufemia.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export function init(): void;
|
|
2
|
-
export const version: "10.4.
|
|
2
|
+
export const version: "10.4.1";
|
package/cjs/shared/Eufemia.js
CHANGED
|
@@ -5,13 +5,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.init = init;
|
|
7
7
|
exports.version = void 0;
|
|
8
|
-
const version = '10.4.
|
|
8
|
+
const version = '10.4.1';
|
|
9
9
|
exports.version = version;
|
|
10
10
|
function init() {
|
|
11
11
|
if (typeof window !== 'undefined') {
|
|
12
12
|
class Eufemia {
|
|
13
13
|
get version() {
|
|
14
|
-
return '10.4.
|
|
14
|
+
return '10.4.1';
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
window.Eufemia = new Eufemia();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Eufemia.js","names":["version","exports","init","window","Eufemia"],"sources":["../../../src/shared/Eufemia.js"],"sourcesContent":["export const version = '10.4.
|
|
1
|
+
{"version":3,"file":"Eufemia.js","names":["version","exports","init","window","Eufemia"],"sources":["../../../src/shared/Eufemia.js"],"sourcesContent":["export const version = '10.4.1'\n\nexport function init() {\n if (typeof window !== 'undefined') {\n class Eufemia {\n get version() {\n return '10.4.1'\n }\n }\n\n window.Eufemia = new Eufemia()\n }\n}\n"],"mappings":";;;;;;;AAAO,MAAMA,OAAO,GAAG,QAAQ;AAAAC,OAAA,CAAAD,OAAA,GAAAA,OAAA;AAExB,SAASE,IAAIA,CAAA,EAAG;EACrB,IAAI,OAAOC,MAAM,KAAK,WAAW,EAAE;IACjC,MAAMC,OAAO,CAAC;MACZ,IAAIJ,OAAOA,CAAA,EAAG;QACZ,OAAO,QAAQ;MACjB;IACF;IAEAG,MAAM,CAACC,OAAO,GAAG,IAAIA,OAAO,CAAC,CAAC;EAChC;AACF"}
|
|
@@ -22,7 +22,7 @@ export default class ContentWrapper extends React.PureComponent {
|
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
componentDidMount() {
|
|
25
|
-
if (this.props.id) {
|
|
25
|
+
if (this.props.id && this._eventEmitter) {
|
|
26
26
|
this._eventEmitter.listen(params => {
|
|
27
27
|
if (this._eventEmitter && params.key !== this.state.key) {
|
|
28
28
|
this.setState(params);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabsContentWrapper.js","names":["React","PropTypes","classnames","validateDOMAttributes","isTrue","combineLabelledBy","createSpacingClasses","Section","EventEmitter","HeightAnimation","ContentWrapper","PureComponent","constructor","props","_defineProperty","key","id","_eventEmitter","createInstance","state","get","componentDidMount","listen","params","setState","componentWillUnmount","remove","render","_this$props","children","selected_key","content_style","content_spacing","rest","_objectWithoutProperties","_excluded","createElement","Fragment","content","_extends","showOverflow","role","tabIndex","spacing","undefined","style_type","element","className","process","env","NODE_ENV","propTypes","string","isRequired","oneOfType","number","bool","node","func"],"sources":["../../../../src/components/tabs/TabsContentWrapper.js"],"sourcesContent":["import React from 'react'\nimport PropTypes from 'prop-types'\nimport classnames from 'classnames'\nimport {\n validateDOMAttributes,\n isTrue,\n combineLabelledBy,\n} from '../../shared/component-helper'\nimport { createSpacingClasses } from '../space/SpacingHelper'\nimport Section from '../section/Section'\nimport EventEmitter from '../../shared/helpers/EventEmitter'\nimport HeightAnimation from '../height-animation/HeightAnimation'\n\nexport default class ContentWrapper extends React.PureComponent {\n static propTypes = {\n id: PropTypes.string.isRequired,\n selected_key: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.number,\n ]),\n content_style: PropTypes.string,\n content_spacing: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.bool,\n ]),\n children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),\n }\n static defaultProps = {\n selected_key: null,\n content_style: null,\n content_spacing: true,\n children: null,\n }\n\n state = { key: null }\n\n constructor(props) {\n super(props)\n\n if (props.id) {\n this._eventEmitter = EventEmitter.createInstance(props.id)\n this.state = this._eventEmitter.get()\n }\n }\n\n componentDidMount() {\n if (this.props.id) {\n this._eventEmitter.listen((params) => {\n if (this._eventEmitter && params.key !== this.state.key) {\n this.setState(params)\n }\n })\n }\n }\n\n componentWillUnmount() {\n if (this._eventEmitter) {\n this._eventEmitter.remove()\n this._eventEmitter = null\n }\n }\n\n render() {\n const {\n id,\n children,\n selected_key: key,\n content_style,\n content_spacing,\n ...rest\n } = this.props\n\n if (!children) {\n return <></>\n }\n\n const params = rest\n\n if (key) {\n params['aria-labelledby'] = combineLabelledBy(\n params,\n `${id}-tab-${key}`\n )\n }\n\n validateDOMAttributes(this.props, params)\n\n let content = children\n if (typeof children === 'function') {\n content = children(this.state)\n }\n\n return (\n <HeightAnimation\n showOverflow // in case there is a section used inside\n role=\"tabpanel\"\n tabIndex=\"-1\"\n id={`${id}-content`}\n spacing={content_style ? false : undefined}\n style_type={content_style ? content_style : undefined}\n element={content_style ? Section : 'div'}\n className={classnames(\n 'dnb-tabs__content',\n 'dnb-no-focus',\n content_spacing\n ? `dnb-section--spacing-${\n isTrue(content_spacing) ? 'large' : content_spacing\n }`\n : null,\n createSpacingClasses(rest)\n )}\n {...params}\n >\n {content}\n </HeightAnimation>\n )\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AACnC,SACEC,qBAAqB,EACrBC,MAAM,EACNC,iBAAiB,QACZ,+BAA+B;AACtC,SAASC,oBAAoB,QAAQ,wBAAwB;AAC7D,OAAOC,OAAO,MAAM,oBAAoB;AACxC,OAAOC,YAAY,MAAM,mCAAmC;AAC5D,OAAOC,eAAe,MAAM,qCAAqC;AAEjE,eAAe,MAAMC,cAAc,SAASV,KAAK,CAACW,aAAa,CAAC;EAuB9DC,WAAWA,CAACC,KAAK,EAAE;IACjB,KAAK,CAACA,KAAK,CAAC;IAAAC,eAAA,gBAHN;MAAEC,GAAG,EAAE;IAAK,CAAC;IAKnB,IAAIF,KAAK,CAACG,EAAE,EAAE;MACZ,IAAI,CAACC,aAAa,GAAGT,YAAY,CAACU,cAAc,CAACL,KAAK,CAACG,EAAE,CAAC;MAC1D,IAAI,CAACG,KAAK,GAAG,IAAI,CAACF,aAAa,CAACG,GAAG,CAAC,CAAC;IACvC;EACF;EAEAC,iBAAiBA,CAAA,EAAG;IAClB,IAAI,IAAI,CAACR,KAAK,CAACG,EAAE,EAAE;
|
|
1
|
+
{"version":3,"file":"TabsContentWrapper.js","names":["React","PropTypes","classnames","validateDOMAttributes","isTrue","combineLabelledBy","createSpacingClasses","Section","EventEmitter","HeightAnimation","ContentWrapper","PureComponent","constructor","props","_defineProperty","key","id","_eventEmitter","createInstance","state","get","componentDidMount","listen","params","setState","componentWillUnmount","remove","render","_this$props","children","selected_key","content_style","content_spacing","rest","_objectWithoutProperties","_excluded","createElement","Fragment","content","_extends","showOverflow","role","tabIndex","spacing","undefined","style_type","element","className","process","env","NODE_ENV","propTypes","string","isRequired","oneOfType","number","bool","node","func"],"sources":["../../../../src/components/tabs/TabsContentWrapper.js"],"sourcesContent":["import React from 'react'\nimport PropTypes from 'prop-types'\nimport classnames from 'classnames'\nimport {\n validateDOMAttributes,\n isTrue,\n combineLabelledBy,\n} from '../../shared/component-helper'\nimport { createSpacingClasses } from '../space/SpacingHelper'\nimport Section from '../section/Section'\nimport EventEmitter from '../../shared/helpers/EventEmitter'\nimport HeightAnimation from '../height-animation/HeightAnimation'\n\nexport default class ContentWrapper extends React.PureComponent {\n static propTypes = {\n id: PropTypes.string.isRequired,\n selected_key: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.number,\n ]),\n content_style: PropTypes.string,\n content_spacing: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.bool,\n ]),\n children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),\n }\n static defaultProps = {\n selected_key: null,\n content_style: null,\n content_spacing: true,\n children: null,\n }\n\n state = { key: null }\n\n constructor(props) {\n super(props)\n\n if (props.id) {\n this._eventEmitter = EventEmitter.createInstance(props.id)\n this.state = this._eventEmitter.get()\n }\n }\n\n componentDidMount() {\n if (this.props.id && this._eventEmitter) {\n this._eventEmitter.listen((params) => {\n if (this._eventEmitter && params.key !== this.state.key) {\n this.setState(params)\n }\n })\n }\n }\n\n componentWillUnmount() {\n if (this._eventEmitter) {\n this._eventEmitter.remove()\n this._eventEmitter = null\n }\n }\n\n render() {\n const {\n id,\n children,\n selected_key: key,\n content_style,\n content_spacing,\n ...rest\n } = this.props\n\n if (!children) {\n return <></>\n }\n\n const params = rest\n\n if (key) {\n params['aria-labelledby'] = combineLabelledBy(\n params,\n `${id}-tab-${key}`\n )\n }\n\n validateDOMAttributes(this.props, params)\n\n let content = children\n if (typeof children === 'function') {\n content = children(this.state)\n }\n\n return (\n <HeightAnimation\n showOverflow // in case there is a section used inside\n role=\"tabpanel\"\n tabIndex=\"-1\"\n id={`${id}-content`}\n spacing={content_style ? false : undefined}\n style_type={content_style ? content_style : undefined}\n element={content_style ? Section : 'div'}\n className={classnames(\n 'dnb-tabs__content',\n 'dnb-no-focus',\n content_spacing\n ? `dnb-section--spacing-${\n isTrue(content_spacing) ? 'large' : content_spacing\n }`\n : null,\n createSpacingClasses(rest)\n )}\n {...params}\n >\n {content}\n </HeightAnimation>\n )\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AACnC,SACEC,qBAAqB,EACrBC,MAAM,EACNC,iBAAiB,QACZ,+BAA+B;AACtC,SAASC,oBAAoB,QAAQ,wBAAwB;AAC7D,OAAOC,OAAO,MAAM,oBAAoB;AACxC,OAAOC,YAAY,MAAM,mCAAmC;AAC5D,OAAOC,eAAe,MAAM,qCAAqC;AAEjE,eAAe,MAAMC,cAAc,SAASV,KAAK,CAACW,aAAa,CAAC;EAuB9DC,WAAWA,CAACC,KAAK,EAAE;IACjB,KAAK,CAACA,KAAK,CAAC;IAAAC,eAAA,gBAHN;MAAEC,GAAG,EAAE;IAAK,CAAC;IAKnB,IAAIF,KAAK,CAACG,EAAE,EAAE;MACZ,IAAI,CAACC,aAAa,GAAGT,YAAY,CAACU,cAAc,CAACL,KAAK,CAACG,EAAE,CAAC;MAC1D,IAAI,CAACG,KAAK,GAAG,IAAI,CAACF,aAAa,CAACG,GAAG,CAAC,CAAC;IACvC;EACF;EAEAC,iBAAiBA,CAAA,EAAG;IAClB,IAAI,IAAI,CAACR,KAAK,CAACG,EAAE,IAAI,IAAI,CAACC,aAAa,EAAE;MACvC,IAAI,CAACA,aAAa,CAACK,MAAM,CAAEC,MAAM,IAAK;QACpC,IAAI,I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G,KAAK,GAAGa,SAAU;MAC3CC,UAAU,EAAEd,aAAa,GAAGA,aAAa,GAAGa,SAAU;MACtDE,OAAO,EAAEf,aAAa,GAAGxB,OAAO,GAAG,KAAM;MACzCwC,SAAS,EAAE7C,UAAU,mCAQnBI,oBAAoB,CAAC2B,IAAI,CAAC,EAL1BD,eAAe,IACV,wBACC5B,MAAM,CAAC4B,eAAe,CAAC,GAAG,OAAO,GAAGA,eACrC,EAGP;IAAE,GACET,MAAM,GAETe,OACc,CAAC;EAEtB;AACF;AAACxB,eAAA,CAxGoBJ,cAAc,kBAcX;EACpBoB,YAAY,EAAE,IAAI;EAClBC,aAAa,EAAE,IAAI;EACnBC,eAAe,EAAE,IAAI;EACrBH,QAAQ,EAAE;AACZ,CAAC;AAAAmB,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAnBkBxC,cAAc,CAC1ByC,SAAS,GAAG;EACjBnC,EAAE,EAAEf,SAAS,CAACmD,MAAM,CAACC,UAAU;EAC/BvB,YAAY,EAAE7B,SAAS,CAACqD,SAAS,CAAC,CAChCrD,SAAS,CAACmD,MAAM,EAChBnD,SAAS,CAACsD,MAAM,CACjB,CAAC;EACFxB,aAAa,EAAE9B,SAAS,CAACmD,MAAM;EAC/BpB,eAAe,EAAE/B,SAAS,CAACqD,SAAS,CAAC,CACnCrD,SAAS,CAACmD,MAAM,EAChBnD,SAAS,CAACuD,IAAI,CACf,CAAC;EACF3B,QAAQ,EAAE5B,SAAS,CAACqD,SAAS,CAAC,CAACrD,SAAS,CAACwD,IAAI,EAAExD,SAAS,CAACyD,IAAI,CAAC;AAChE,CAAC"}
|
|
@@ -22,7 +22,7 @@ export default class ContentWrapper extends React.PureComponent {
|
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
componentDidMount() {
|
|
25
|
-
if (this.props.id) {
|
|
25
|
+
if (this.props.id && this._eventEmitter) {
|
|
26
26
|
this._eventEmitter.listen(params => {
|
|
27
27
|
if (this._eventEmitter && params.key !== this.state.key) {
|
|
28
28
|
this.setState(params);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabsContentWrapper.js","names":["React","PropTypes","classnames","validateDOMAttributes","isTrue","combineLabelledBy","createSpacingClasses","Section","EventEmitter","HeightAnimation","ContentWrapper","PureComponent","constructor","props","_defineProperty","key","id","_eventEmitter","createInstance","state","get","componentDidMount","listen","params","setState","componentWillUnmount","remove","render","_this$props","children","selected_key","content_style","content_spacing","rest","_objectWithoutProperties","_excluded","createElement","Fragment","content","_extends","showOverflow","role","tabIndex","spacing","undefined","style_type","element","className","process","env","NODE_ENV","propTypes","string","isRequired","oneOfType","number","bool","node","func"],"sources":["../../../../src/components/tabs/TabsContentWrapper.js"],"sourcesContent":["import React from 'react'\nimport PropTypes from 'prop-types'\nimport classnames from 'classnames'\nimport {\n validateDOMAttributes,\n isTrue,\n combineLabelledBy,\n} from '../../shared/component-helper'\nimport { createSpacingClasses } from '../space/SpacingHelper'\nimport Section from '../section/Section'\nimport EventEmitter from '../../shared/helpers/EventEmitter'\nimport HeightAnimation from '../height-animation/HeightAnimation'\n\nexport default class ContentWrapper extends React.PureComponent {\n static propTypes = {\n id: PropTypes.string.isRequired,\n selected_key: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.number,\n ]),\n content_style: PropTypes.string,\n content_spacing: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.bool,\n ]),\n children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),\n }\n static defaultProps = {\n selected_key: null,\n content_style: null,\n content_spacing: true,\n children: null,\n }\n\n state = { key: null }\n\n constructor(props) {\n super(props)\n\n if (props.id) {\n this._eventEmitter = EventEmitter.createInstance(props.id)\n this.state = this._eventEmitter.get()\n }\n }\n\n componentDidMount() {\n if (this.props.id) {\n this._eventEmitter.listen((params) => {\n if (this._eventEmitter && params.key !== this.state.key) {\n this.setState(params)\n }\n })\n }\n }\n\n componentWillUnmount() {\n if (this._eventEmitter) {\n this._eventEmitter.remove()\n this._eventEmitter = null\n }\n }\n\n render() {\n const {\n id,\n children,\n selected_key: key,\n content_style,\n content_spacing,\n ...rest\n } = this.props\n\n if (!children) {\n return <></>\n }\n\n const params = rest\n\n if (key) {\n params['aria-labelledby'] = combineLabelledBy(\n params,\n `${id}-tab-${key}`\n )\n }\n\n validateDOMAttributes(this.props, params)\n\n let content = children\n if (typeof children === 'function') {\n content = children(this.state)\n }\n\n return (\n <HeightAnimation\n showOverflow // in case there is a section used inside\n role=\"tabpanel\"\n tabIndex=\"-1\"\n id={`${id}-content`}\n spacing={content_style ? false : undefined}\n style_type={content_style ? content_style : undefined}\n element={content_style ? Section : 'div'}\n className={classnames(\n 'dnb-tabs__content',\n 'dnb-no-focus',\n content_spacing\n ? `dnb-section--spacing-${\n isTrue(content_spacing) ? 'large' : content_spacing\n }`\n : null,\n createSpacingClasses(rest)\n )}\n {...params}\n >\n {content}\n </HeightAnimation>\n )\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AACnC,SACEC,qBAAqB,EACrBC,MAAM,EACNC,iBAAiB,QACZ,+BAA+B;AACtC,SAASC,oBAAoB,QAAQ,wBAAwB;AAC7D,OAAOC,OAAO,MAAM,oBAAoB;AACxC,OAAOC,YAAY,MAAM,mCAAmC;AAC5D,OAAOC,eAAe,MAAM,qCAAqC;AAEjE,eAAe,MAAMC,cAAc,SAASV,KAAK,CAACW,aAAa,CAAC;EAuB9DC,WAAWA,CAACC,KAAK,EAAE;IACjB,KAAK,CAACA,KAAK,CAAC;IAAAC,eAAA,gBAHN;MAAEC,GAAG,EAAE;IAAK,CAAC;IAKnB,IAAIF,KAAK,CAACG,EAAE,EAAE;MACZ,IAAI,CAACC,aAAa,GAAGT,YAAY,CAACU,cAAc,CAACL,KAAK,CAACG,EAAE,CAAC;MAC1D,IAAI,CAACG,KAAK,GAAG,IAAI,CAACF,aAAa,CAACG,GAAG,CAAC,CAAC;IACvC;EACF;EAEAC,iBAAiBA,CAAA,EAAG;IAClB,IAAI,IAAI,CAACR,KAAK,CAACG,EAAE,EAAE;
|
|
1
|
+
{"version":3,"file":"TabsContentWrapper.js","names":["React","PropTypes","classnames","validateDOMAttributes","isTrue","combineLabelledBy","createSpacingClasses","Section","EventEmitter","HeightAnimation","ContentWrapper","PureComponent","constructor","props","_defineProperty","key","id","_eventEmitter","createInstance","state","get","componentDidMount","listen","params","setState","componentWillUnmount","remove","render","_this$props","children","selected_key","content_style","content_spacing","rest","_objectWithoutProperties","_excluded","createElement","Fragment","content","_extends","showOverflow","role","tabIndex","spacing","undefined","style_type","element","className","process","env","NODE_ENV","propTypes","string","isRequired","oneOfType","number","bool","node","func"],"sources":["../../../../src/components/tabs/TabsContentWrapper.js"],"sourcesContent":["import React from 'react'\nimport PropTypes from 'prop-types'\nimport classnames from 'classnames'\nimport {\n validateDOMAttributes,\n isTrue,\n combineLabelledBy,\n} from '../../shared/component-helper'\nimport { createSpacingClasses } from '../space/SpacingHelper'\nimport Section from '../section/Section'\nimport EventEmitter from '../../shared/helpers/EventEmitter'\nimport HeightAnimation from '../height-animation/HeightAnimation'\n\nexport default class ContentWrapper extends React.PureComponent {\n static propTypes = {\n id: PropTypes.string.isRequired,\n selected_key: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.number,\n ]),\n content_style: PropTypes.string,\n content_spacing: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.bool,\n ]),\n children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),\n }\n static defaultProps = {\n selected_key: null,\n content_style: null,\n content_spacing: true,\n children: null,\n }\n\n state = { key: null }\n\n constructor(props) {\n super(props)\n\n if (props.id) {\n this._eventEmitter = EventEmitter.createInstance(props.id)\n this.state = this._eventEmitter.get()\n }\n }\n\n componentDidMount() {\n if (this.props.id && this._eventEmitter) {\n this._eventEmitter.listen((params) => {\n if (this._eventEmitter && params.key !== this.state.key) {\n this.setState(params)\n }\n })\n }\n }\n\n componentWillUnmount() {\n if (this._eventEmitter) {\n this._eventEmitter.remove()\n this._eventEmitter = null\n }\n }\n\n render() {\n const {\n id,\n children,\n selected_key: key,\n content_style,\n content_spacing,\n ...rest\n } = this.props\n\n if (!children) {\n return <></>\n }\n\n const params = rest\n\n if (key) {\n params['aria-labelledby'] = combineLabelledBy(\n params,\n `${id}-tab-${key}`\n )\n }\n\n validateDOMAttributes(this.props, params)\n\n let content = children\n if (typeof children === 'function') {\n content = children(this.state)\n }\n\n return (\n <HeightAnimation\n showOverflow // in case there is a section used inside\n role=\"tabpanel\"\n tabIndex=\"-1\"\n id={`${id}-content`}\n spacing={content_style ? false : undefined}\n style_type={content_style ? content_style : undefined}\n element={content_style ? Section : 'div'}\n className={classnames(\n 'dnb-tabs__content',\n 'dnb-no-focus',\n content_spacing\n ? `dnb-section--spacing-${\n isTrue(content_spacing) ? 'large' : content_spacing\n }`\n : null,\n createSpacingClasses(rest)\n )}\n {...params}\n >\n {content}\n </HeightAnimation>\n )\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,UAAU,MAAM,YAAY;AACnC,SACEC,qBAAqB,EACrBC,MAAM,EACNC,iBAAiB,QACZ,+BAA+B;AACtC,SAASC,oBAAoB,QAAQ,wBAAwB;AAC7D,OAAOC,OAAO,MAAM,oBAAoB;AACxC,OAAOC,YAAY,MAAM,mCAAmC;AAC5D,OAAOC,eAAe,MAAM,qCAAqC;AAEjE,eAAe,MAAMC,cAAc,SAASV,KAAK,CAACW,aAAa,CAAC;EAuB9DC,WAAWA,CAACC,KAAK,EAAE;IACjB,KAAK,CAACA,KAAK,CAAC;IAAAC,eAAA,gBAHN;MAAEC,GAAG,EAAE;IAAK,CAAC;IAKnB,IAAIF,KAAK,CAACG,EAAE,EAAE;MACZ,IAAI,CAACC,aAAa,GAAGT,YAAY,CAACU,cAAc,CAACL,KAAK,CAACG,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S,CAACyD,IAAI,CAAC;AAChE,CAAC"}
|
package/es/shared/Eufemia.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export function init(): void;
|
|
2
|
-
export const version: "10.4.
|
|
2
|
+
export const version: "10.4.1";
|
package/es/shared/Eufemia.js
CHANGED
package/es/shared/Eufemia.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Eufemia.js","names":["version","init","window","Eufemia"],"sources":["../../../src/shared/Eufemia.js"],"sourcesContent":["export const version = '10.4.
|
|
1
|
+
{"version":3,"file":"Eufemia.js","names":["version","init","window","Eufemia"],"sources":["../../../src/shared/Eufemia.js"],"sourcesContent":["export const version = '10.4.1'\n\nexport function init() {\n if (typeof window !== 'undefined') {\n class Eufemia {\n get version() {\n return '10.4.1'\n }\n }\n\n window.Eufemia = new Eufemia()\n }\n}\n"],"mappings":"AAAA,OAAO,MAAMA,OAAO,GAAG,QAAQ;AAE/B,OAAO,SAASC,IAAIA,CAAA,EAAG;EACrB,IAAI,OAAOC,MAAM,KAAK,WAAW,EAAE;IACjC,MAAMC,OAAO,CAAC;MACZ,IAAIH,OAAOA,CAAA,EAAG;QACZ,OAAO,QAAQ;MACjB;IACF;IAEAE,MAAM,CAACC,OAAO,GAAG,IAAIA,OAAO,CAAC,CAAC;EAChC;AACF"}
|
package/esm/dnb-ui-basis.min.mjs
CHANGED
|
@@ -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()&&!O(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},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()}}}()}])},{get exports(){return r},set exports(e){r=e}}.exports=i();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(){if("undefined"!=typeof document){let e=!1;try{e=document.documentElement.getAttribute("data-whatintent")}catch(e){}return"touch"===e}return!1}function y(){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.4.
|
|
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()&&!O(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},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()}}}()}])},{get exports(){return r},set exports(e){r=e}}.exports=i();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(){if("undefined"!=typeof document){let e=!1;try{e=document.documentElement.getAttribute("data-whatintent")}catch(e){}return"touch"===e}return!1}function y(){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.4.1"}}window.Eufemia=new e}}(),a.specificKeys([9]),y();export{y as defineNavigator,h as isTouchDevice};
|