@siemens/ix-react 2.1.2 → 2.2.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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2023 Siemens AG
3
+ Copyright (c) 2024 Siemens AG
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
6
 
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Siemens iX React Components
1
+ # Siemens Industrial Experience - React Components
2
2
 
3
- This library is part of the Siemens iX mono repository.
3
+ This library is part of the Siemens Industrial Experience mono repository.
4
4
  You can find the root README [here](https://github.com/siemens/ix/blob/main/README.md)
package/dist/index.esm.js CHANGED
@@ -96,7 +96,7 @@ import { registerFrameworkDelegate, showModal as showModal$1, toast } from '@sie
96
96
  import ReactDOMClient from 'react-dom/client';
97
97
  import { defineCustomElement as defineCustomElement$1t } from '@siemens/ix/components/ix-application-sidebar.js';
98
98
  import { defineCustomElement as defineCustomElement$1s } from '@siemens/ix/components/ix-application-switch-modal.js';
99
- import { defineCustomElement as defineCustomElement$1v } from '@siemens/ix/components/ix-burger-menu.js';
99
+ import { defineCustomElement as defineCustomElement$1v } from '@siemens/ix/components/ix-menu-expand-icon.js';
100
100
  import { defineCustomElement as defineCustomElement$1u } from '@siemens/ix/components/ix-date-time-card.js';
101
101
  import { defineCustomElement as defineCustomElement$1w } from '@siemens/ix/components/ix-modal-loading.js';
102
102
  import { defineCustomElement as defineCustomElement$1x } from '@siemens/ix-icons/dist/components/ix-icon';
@@ -127,7 +127,12 @@ function __rest(s, e) {
127
127
  t[p[i]] = s[p[i]];
128
128
  }
129
129
  return t;
130
- }
130
+ }
131
+
132
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
133
+ var e = new Error(message);
134
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
135
+ };
131
136
 
132
137
  const dashToPascalCase = (str) => str
133
138
  .toLowerCase()
@@ -424,7 +429,7 @@ const IxWorkflowStep = /*@__PURE__*/ createReactComponent('ix-workflow-step', un
424
429
  const IxWorkflowSteps = /*@__PURE__*/ createReactComponent('ix-workflow-steps', undefined, undefined, defineCustomElement$1r);
425
430
 
426
431
  /*
427
- * SPDX-FileCopyrightText: 2023 Siemens AG
432
+ * SPDX-FileCopyrightText: 2024 Siemens AG
428
433
  *
429
434
  * SPDX-License-Identifier: MIT
430
435
  *
@@ -497,7 +502,7 @@ const reactFrameworkDelegate = new ReactFrameworkDelegate();
497
502
  registerFrameworkDelegate(reactFrameworkDelegate);
498
503
 
499
504
  /*
500
- * SPDX-FileCopyrightText: 2023 Siemens AG
505
+ * SPDX-FileCopyrightText: 2024 Siemens AG
501
506
  *
502
507
  * SPDX-License-Identifier: MIT
503
508
  *
@@ -562,7 +567,7 @@ const IxOverlay = (props) => {
562
567
  };
563
568
 
564
569
  /*
565
- * SPDX-FileCopyrightText: 2023 Siemens AG
570
+ * SPDX-FileCopyrightText: 2024 Siemens AG
566
571
  *
567
572
  * SPDX-License-Identifier: MIT
568
573
  *
@@ -572,7 +577,7 @@ const IxOverlay = (props) => {
572
577
  const IxContext = React.createContext(null);
573
578
 
574
579
  /*
575
- * SPDX-FileCopyrightText: 2023 Siemens AG
580
+ * SPDX-FileCopyrightText: 2024 Siemens AG
576
581
  *
577
582
  * SPDX-License-Identifier: MIT
578
583
  *
@@ -596,7 +601,7 @@ class IxApplicationContext extends React.Component {
596
601
  }
597
602
 
598
603
  /*
599
- * SPDX-FileCopyrightText: 2023 Siemens AG
604
+ * SPDX-FileCopyrightText: 2024 Siemens AG
600
605
  *
601
606
  * SPDX-License-Identifier: MIT
602
607
  *
@@ -610,10 +615,12 @@ defineCustomElement$1v();
610
615
  defineCustomElement$1w();
611
616
 
612
617
  // eslint-disable-next-line no-inline-comments
613
- const IxIcon = /*@__PURE__*/ createReactComponent('ix-icon', undefined, undefined, defineCustomElement$1x);
618
+ const IxIcon = /*@__PURE__*/ createReactComponent('ix-icon', undefined, undefined);
619
+ // Predefine `ix-icon` to be sure its loaded before its used inside the util functions
620
+ defineCustomElement$1x();
614
621
 
615
622
  /*
616
- * SPDX-FileCopyrightText: 2023 Siemens AG
623
+ * SPDX-FileCopyrightText: 2024 Siemens AG
617
624
  *
618
625
  * SPDX-License-Identifier: MIT
619
626
  *
@@ -637,7 +644,7 @@ const Modal = React.forwardRef((props, ref) => {
637
644
  });
638
645
 
639
646
  /*
640
- * SPDX-FileCopyrightText: 2023 Siemens AG
647
+ * SPDX-FileCopyrightText: 2024 Siemens AG
641
648
  *
642
649
  * SPDX-License-Identifier: MIT
643
650
  *
@@ -649,7 +656,7 @@ async function showModal(config) {
649
656
  }
650
657
 
651
658
  /*
652
- * SPDX-FileCopyrightText: 2023 Siemens AG
659
+ * SPDX-FileCopyrightText: 2024 Siemens AG
653
660
  *
654
661
  * SPDX-License-Identifier: MIT
655
662
  *
@@ -657,6 +664,9 @@ async function showModal(config) {
657
664
  * LICENSE file in the root directory of this source tree.
658
665
  */
659
666
  async function showToast(config) {
667
+ // Define custom element, otherwise dynamic creation of toast container will fail
668
+ defineCustomElement$1i();
669
+ defineCustomElement$1j();
660
670
  if (typeof config.message === 'string') {
661
671
  const toastInstance = await toast(config);
662
672
  return toastInstance;
package/dist/index.js CHANGED
@@ -100,7 +100,7 @@ const ix = require('@siemens/ix');
100
100
  const ReactDOMClient = require('react-dom/client');
101
101
  const ixApplicationSidebar_js = require('@siemens/ix/components/ix-application-sidebar.js');
102
102
  const ixApplicationSwitchModal_js = require('@siemens/ix/components/ix-application-switch-modal.js');
103
- const ixBurgerMenu_js = require('@siemens/ix/components/ix-burger-menu.js');
103
+ const ixMenuExpandIcon_js = require('@siemens/ix/components/ix-menu-expand-icon.js');
104
104
  const ixDateTimeCard_js = require('@siemens/ix/components/ix-date-time-card.js');
105
105
  const ixModalLoading_js = require('@siemens/ix/components/ix-modal-loading.js');
106
106
  const ixIcon = require('@siemens/ix-icons/dist/components/ix-icon');
@@ -137,7 +137,12 @@ function __rest(s, e) {
137
137
  t[p[i]] = s[p[i]];
138
138
  }
139
139
  return t;
140
- }
140
+ }
141
+
142
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
143
+ var e = new Error(message);
144
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
145
+ };
141
146
 
142
147
  const dashToPascalCase = (str) => str
143
148
  .toLowerCase()
@@ -434,7 +439,7 @@ const IxWorkflowStep = /*@__PURE__*/ createReactComponent('ix-workflow-step', un
434
439
  const IxWorkflowSteps = /*@__PURE__*/ createReactComponent('ix-workflow-steps', undefined, undefined, ixWorkflowSteps_js.defineCustomElement);
435
440
 
436
441
  /*
437
- * SPDX-FileCopyrightText: 2023 Siemens AG
442
+ * SPDX-FileCopyrightText: 2024 Siemens AG
438
443
  *
439
444
  * SPDX-License-Identifier: MIT
440
445
  *
@@ -507,7 +512,7 @@ const reactFrameworkDelegate = new ReactFrameworkDelegate();
507
512
  ix.registerFrameworkDelegate(reactFrameworkDelegate);
508
513
 
509
514
  /*
510
- * SPDX-FileCopyrightText: 2023 Siemens AG
515
+ * SPDX-FileCopyrightText: 2024 Siemens AG
511
516
  *
512
517
  * SPDX-License-Identifier: MIT
513
518
  *
@@ -572,7 +577,7 @@ const IxOverlay = (props) => {
572
577
  };
573
578
 
574
579
  /*
575
- * SPDX-FileCopyrightText: 2023 Siemens AG
580
+ * SPDX-FileCopyrightText: 2024 Siemens AG
576
581
  *
577
582
  * SPDX-License-Identifier: MIT
578
583
  *
@@ -582,7 +587,7 @@ const IxOverlay = (props) => {
582
587
  const IxContext = React__default["default"].createContext(null);
583
588
 
584
589
  /*
585
- * SPDX-FileCopyrightText: 2023 Siemens AG
590
+ * SPDX-FileCopyrightText: 2024 Siemens AG
586
591
  *
587
592
  * SPDX-License-Identifier: MIT
588
593
  *
@@ -606,7 +611,7 @@ class IxApplicationContext extends React__default["default"].Component {
606
611
  }
607
612
 
608
613
  /*
609
- * SPDX-FileCopyrightText: 2023 Siemens AG
614
+ * SPDX-FileCopyrightText: 2024 Siemens AG
610
615
  *
611
616
  * SPDX-License-Identifier: MIT
612
617
  *
@@ -616,14 +621,16 @@ class IxApplicationContext extends React__default["default"].Component {
616
621
  ixApplicationSwitchModal_js.defineCustomElement();
617
622
  ixApplicationSidebar_js.defineCustomElement();
618
623
  ixDateTimeCard_js.defineCustomElement();
619
- ixBurgerMenu_js.defineCustomElement();
624
+ ixMenuExpandIcon_js.defineCustomElement();
620
625
  ixModalLoading_js.defineCustomElement();
621
626
 
622
627
  // eslint-disable-next-line no-inline-comments
623
- const IxIcon = /*@__PURE__*/ createReactComponent('ix-icon', undefined, undefined, ixIcon.defineCustomElement);
628
+ const IxIcon = /*@__PURE__*/ createReactComponent('ix-icon', undefined, undefined);
629
+ // Predefine `ix-icon` to be sure its loaded before its used inside the util functions
630
+ ixIcon.defineCustomElement();
624
631
 
625
632
  /*
626
- * SPDX-FileCopyrightText: 2023 Siemens AG
633
+ * SPDX-FileCopyrightText: 2024 Siemens AG
627
634
  *
628
635
  * SPDX-License-Identifier: MIT
629
636
  *
@@ -647,7 +654,7 @@ const Modal = React__default["default"].forwardRef((props, ref) => {
647
654
  });
648
655
 
649
656
  /*
650
- * SPDX-FileCopyrightText: 2023 Siemens AG
657
+ * SPDX-FileCopyrightText: 2024 Siemens AG
651
658
  *
652
659
  * SPDX-License-Identifier: MIT
653
660
  *
@@ -659,7 +666,7 @@ async function showModal(config) {
659
666
  }
660
667
 
661
668
  /*
662
- * SPDX-FileCopyrightText: 2023 Siemens AG
669
+ * SPDX-FileCopyrightText: 2024 Siemens AG
663
670
  *
664
671
  * SPDX-License-Identifier: MIT
665
672
  *
@@ -667,6 +674,9 @@ async function showModal(config) {
667
674
  * LICENSE file in the root directory of this source tree.
668
675
  */
669
676
  async function showToast(config) {
677
+ // Define custom element, otherwise dynamic creation of toast container will fail
678
+ ixToast_js.defineCustomElement();
679
+ ixToastContainer_js.defineCustomElement();
670
680
  if (typeof config.message === 'string') {
671
681
  const toastInstance = await ix.toast(config);
672
682
  return toastInstance;
@@ -1,7 +1,7 @@
1
1
  import React, { PropsWithChildren } from 'react';
2
- export declare type IxApplicationContextProps = PropsWithChildren;
2
+ export type IxApplicationContextProps = PropsWithChildren;
3
3
  export declare class IxApplicationContext extends React.Component<IxApplicationContextProps> {
4
4
  private delegate;
5
5
  constructor(props: IxApplicationContextProps);
6
- render(): JSX.Element;
6
+ render(): React.JSX.Element;
7
7
  }
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { ModalConfig as IxModalConfig } from '@siemens/ix';
3
3
  export * from './modal';
4
- export declare type ModalConfig = {
4
+ export type ModalConfig = {
5
5
  content: React.ReactNode | string;
6
6
  };
7
7
  export declare function showModal(config: Omit<IxModalConfig, 'content'> & ModalConfig): Promise<import("@siemens/ix").ModalInstance<any>>;
@@ -1,5 +1,6 @@
1
+ import React from 'react';
1
2
  import { ReactFrameworkDelegate } from 'src/delegate';
2
3
  export declare const PORTAL_ID = "ix-portal";
3
4
  export declare const IxOverlay: (props: {
4
5
  delegate: ReactFrameworkDelegate;
5
- }) => JSX.Element | null;
6
+ }) => React.JSX.Element | null;
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import type { StyleReactProps } from '../interfaces';
3
- export declare type StencilReactExternalProps<PropType, ElementType> = PropType & Omit<React.HTMLAttributes<ElementType>, 'style'> & StyleReactProps;
4
- export declare type StencilReactForwardedRef<T> = ((instance: T | null) => void) | React.MutableRefObject<T | null> | null;
3
+ export type StencilReactExternalProps<PropType, ElementType> = PropType & Omit<React.HTMLAttributes<ElementType>, 'style'> & StyleReactProps;
4
+ export type StencilReactForwardedRef<T> = ((instance: T | null) => void) | React.MutableRefObject<T | null> | null;
5
5
  export declare const setRef: (ref: StencilReactForwardedRef<any> | React.Ref<any> | undefined, value: any) => void;
6
6
  export declare const mergeRefs: (...refs: (StencilReactForwardedRef<any> | React.Ref<any> | undefined)[]) => React.RefCallback<any>;
7
7
  export declare const createForwardRef: <PropType, ElementType>(ReactComponent: any, displayName: string) => React.ForwardRefExoticComponent<React.PropsWithoutRef<StencilReactExternalProps<PropType, ElementType>> & React.RefAttributes<ElementType>>;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const Index: () => React.JSX.Element;
3
+ export default Index;
@@ -1,2 +1,3 @@
1
- declare const Index: () => JSX.Element;
1
+ import React from 'react';
2
+ declare const Index: () => React.JSX.Element;
2
3
  export default Index;
@@ -1,2 +1,3 @@
1
- declare const Index: () => JSX.Element;
1
+ import React from 'react';
2
+ declare const Index: () => React.JSX.Element;
2
3
  export default Index;
@@ -1,9 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { ToastConfig as IxToastConfig } from '@siemens/ix';
3
- export declare type ToastConfig = {
3
+ export type ToastConfig = {
4
4
  message: string | React.ReactNode;
5
5
  };
6
- export declare function showToast(config: Omit<IxToastConfig, 'message'> & ToastConfig): Promise<{
7
- onClose: import("@siemens/ix").TypedEvent<any>;
8
- close: (result?: any) => void;
9
- }>;
6
+ export declare function showToast(config: Omit<IxToastConfig, 'message'> & ToastConfig): Promise<import("@siemens/ix").ShowToastResult>;
@@ -4,4 +4,4 @@ import { StyleReactProps } from '../react-component-lib/interfaces';
4
4
  export declare const InternalIxTree: React.ForwardRefExoticComponent<JSX.IxTree & Omit<React.HTMLAttributes<HTMLIxTreeElement>, "style"> & StyleReactProps & React.RefAttributes<HTMLIxTreeElement>>;
5
5
  export declare const IxTree: (props: Omit<JSX.IxTree, "renderItem"> & Omit<React.HTMLAttributes<HTMLIxTreeElement>, "style"> & StyleReactProps & React.RefAttributes<HTMLIxTreeElement> & {
6
6
  renderItem?: ((data: any) => React.ReactNode) | undefined;
7
- }) => globalThis.JSX.Element;
7
+ }) => React.JSX.Element;
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "url": "https://github.com/siemens/ix",
8
8
  "directory": "packages/react"
9
9
  },
10
- "version": "2.1.2",
10
+ "version": "2.2.1",
11
11
  "description": "Siemens iX for React",
12
12
  "main": "dist/index.js",
13
13
  "module": "dist/index.esm.js",
@@ -17,30 +17,22 @@
17
17
  "README.md",
18
18
  "dist"
19
19
  ],
20
- "scripts": {
21
- "build": "npm run clean && npm run compile",
22
- "clean": "rimraf dist && rimraf dist-transpiled",
23
- "compile": "rollup -c",
24
- "tsc": "tsc -p .",
25
- "lint": "eslint src",
26
- "test": "vitest run",
27
- "test:watch": "vitest"
28
- },
29
20
  "author": "",
30
21
  "license": "MIT",
31
22
  "devDependencies": {
32
23
  "@rollup/plugin-typescript": "^8.4.0",
33
- "@siemens/ix": "~2.1.2",
24
+ "@siemens/ix": "~2.2.1",
34
25
  "@testing-library/jest-dom": "^5.16.5",
35
26
  "@testing-library/react": "^13.4.0",
36
27
  "@types/estree": "~0.0.51",
37
- "@types/react": "~18.0.15",
38
- "@types/react-dom": "~18.0.6",
28
+ "@types/react": "18.2.33",
29
+ "@types/react-dom": "18.2.14",
39
30
  "@typescript-eslint/eslint-plugin": "^5.45.0",
40
31
  "@typescript-eslint/parser": "^5.45.0",
41
32
  "babel-jest": "^29.7.0",
42
33
  "eslint-config-ix": "*",
43
34
  "eslint-plugin-react": "^7.31.11",
35
+ "happy-dom": "^14.7.1",
44
36
  "identity-obj-proxy": "^3.0.0",
45
37
  "jest": "^29.1.2",
46
38
  "jest-environment-jsdom": "^29.1.2",
@@ -53,6 +45,7 @@
53
45
  "rollup-plugin-peer-deps-external": "^2.2.4",
54
46
  "rollup-plugin-sourcemaps": "^0.6.3",
55
47
  "rollup-plugin-terser": "^7.0.2",
48
+ "shadow-dom-testing-library": "^1.11.2",
56
49
  "typescript": "^4.5.5",
57
50
  "vitest": "^1.3.1"
58
51
  },
@@ -62,6 +55,15 @@
62
55
  "react-dom": ">=17.0.2"
63
56
  },
64
57
  "dependencies": {
65
- "@siemens/ix": "~2.1.2"
58
+ "@siemens/ix": "~2.2.1"
59
+ },
60
+ "scripts": {
61
+ "build": "npm run clean && npm run compile",
62
+ "clean": "rimraf dist && rimraf dist-transpiled",
63
+ "compile": "rollup -c",
64
+ "tsc": "tsc -p .",
65
+ "lint": "eslint src",
66
+ "test": "vitest run",
67
+ "test:watch": "vitest"
66
68
  }
67
- }
69
+ }
@@ -1,2 +0,0 @@
1
- declare const Index: () => JSX.Element;
2
- export default Index;