@siemens/ix-react 1.1.1 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.js +33 -27
- package/dist/index.js +33 -26
- package/dist/types/components.d.ts +1 -0
- package/dist/types/modal/index.d.ts +1 -4
- package/dist/types/modal/modal.d.ts +7 -6
- package/package.json +10 -5
package/dist/index.esm.js
CHANGED
|
@@ -247,6 +247,7 @@ const IxFilterChip = /*@__PURE__*/ createReactComponent('ix-filter-chip');
|
|
|
247
247
|
const IxFlipTile = /*@__PURE__*/ createReactComponent('ix-flip-tile');
|
|
248
248
|
const IxFlipTileContent = /*@__PURE__*/ createReactComponent('ix-flip-tile-content');
|
|
249
249
|
const IxGroup = /*@__PURE__*/ createReactComponent('ix-group');
|
|
250
|
+
const IxGroupContextMenu = /*@__PURE__*/ createReactComponent('ix-group-context-menu');
|
|
250
251
|
const IxGroupDropdownItem = /*@__PURE__*/ createReactComponent('ix-group-dropdown-item');
|
|
251
252
|
const IxGroupItem = /*@__PURE__*/ createReactComponent('ix-group-item');
|
|
252
253
|
const IxIcon = /*@__PURE__*/ createReactComponent('ix-icon');
|
|
@@ -286,25 +287,35 @@ const IxValidationTooltip = /*@__PURE__*/ createReactComponent('ix-validation-to
|
|
|
286
287
|
const IxWorkflowStep = /*@__PURE__*/ createReactComponent('ix-workflow-step');
|
|
287
288
|
const IxWorkflowSteps = /*@__PURE__*/ createReactComponent('ix-workflow-steps');
|
|
288
289
|
|
|
289
|
-
/*
|
|
290
|
-
* SPDX-FileCopyrightText: 2022 Siemens AG
|
|
291
|
-
*
|
|
292
|
-
* SPDX-License-Identifier: MIT
|
|
293
|
-
*
|
|
294
|
-
* This source code is licensed under the MIT license found in the
|
|
295
|
-
* LICENSE file in the root directory of this source tree.
|
|
296
|
-
*/
|
|
290
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
297
291
|
const Modal = React.forwardRef((props, ref) => {
|
|
298
|
-
const
|
|
299
|
-
useImperativeHandle(ref, () =>
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
292
|
+
const wrapperRef = useRef(null);
|
|
293
|
+
useImperativeHandle(ref, () => {
|
|
294
|
+
let htmlElement = null;
|
|
295
|
+
if (wrapperRef.current) {
|
|
296
|
+
htmlElement = wrapperRef.current.closest('ix-modal');
|
|
297
|
+
}
|
|
298
|
+
return {
|
|
299
|
+
close: (result) => {
|
|
300
|
+
const modalElement = wrapperRef.current;
|
|
301
|
+
if (!modalElement) {
|
|
302
|
+
console.error('Modal cannot find modal reference');
|
|
303
|
+
return;
|
|
304
|
+
}
|
|
305
|
+
closeModal(modalElement, result);
|
|
306
|
+
},
|
|
307
|
+
dismiss: (result) => {
|
|
308
|
+
const modalElement = wrapperRef.current;
|
|
309
|
+
if (!modalElement) {
|
|
310
|
+
console.error('Modal cannot find modal reference');
|
|
311
|
+
return;
|
|
312
|
+
}
|
|
313
|
+
dismissModal(modalElement, result);
|
|
314
|
+
},
|
|
315
|
+
modalElement: htmlElement,
|
|
316
|
+
};
|
|
317
|
+
});
|
|
318
|
+
return React.createElement("div", { ref: wrapperRef }, props.children);
|
|
308
319
|
});
|
|
309
320
|
|
|
310
321
|
/*
|
|
@@ -315,6 +326,7 @@ const Modal = React.forwardRef((props, ref) => {
|
|
|
315
326
|
* This source code is licensed under the MIT license found in the
|
|
316
327
|
* LICENSE file in the root directory of this source tree.
|
|
317
328
|
*/
|
|
329
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
318
330
|
async function showModal(config) {
|
|
319
331
|
if (typeof config.content === 'string') {
|
|
320
332
|
return modal(config);
|
|
@@ -356,14 +368,8 @@ async function showToast(config) {
|
|
|
356
368
|
return toastInstance;
|
|
357
369
|
}
|
|
358
370
|
|
|
359
|
-
/*
|
|
360
|
-
|
|
361
|
-
*
|
|
362
|
-
* SPDX-License-Identifier: MIT
|
|
363
|
-
*
|
|
364
|
-
* This source code is licensed under the MIT license found in the
|
|
365
|
-
* LICENSE file in the root directory of this source tree.
|
|
366
|
-
*/
|
|
371
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
372
|
+
// eslint-disable-next-line no-inline-comments
|
|
367
373
|
const InternalIxTree = /*@__PURE__*/ createReactComponent('ix-tree');
|
|
368
374
|
const IxTree = (props) => {
|
|
369
375
|
const cachedRootNodes = useRef(new Map());
|
|
@@ -396,4 +402,4 @@ const IxTree = (props) => {
|
|
|
396
402
|
} })));
|
|
397
403
|
};
|
|
398
404
|
|
|
399
|
-
export { IxAnimatedTab, IxAnimatedTabs, IxApplicationHeader, IxBasicNavigation, IxBlind, IxBreadcrumb, IxBreadcrumbItem, IxButton, IxCategoryFilter, IxChip, IxCounterPill, IxDatePicker, IxDateTimeCard, IxDatetimePicker, IxDrawer, IxDropdown, IxDropdownItem, IxEventList, IxEventListItem, IxExpandingSearch, IxFilterChip, IxFlipTile, IxFlipTileContent, IxGroup, IxGroupDropdownItem, IxGroupItem, IxIcon, IxIconButton, IxInputGroup, IxKpi, IxMapNavigation, IxMapNavigationOverlay, IxMenu, IxMenuAbout, IxMenuAboutItem, IxMenuAboutNews, IxMenuAvatar, IxMenuAvatarItem, IxMenuItem, IxMenuSettings, IxMenuSettingsItem, IxMessageBar, IxModal, IxModalContainer, IxModalExample, IxPill, IxSelect, IxSelectItem, IxSpinner, IxSplitButton, IxSplitButtonItem, IxTabItem, IxTabs, IxTile, IxTimePicker, IxToast, IxToastContainer, IxToggle, IxTree, IxUpload, IxValidationTooltip, IxWorkflowStep, IxWorkflowSteps, Modal, showModal, showToast };
|
|
405
|
+
export { IxAnimatedTab, IxAnimatedTabs, IxApplicationHeader, IxBasicNavigation, IxBlind, IxBreadcrumb, IxBreadcrumbItem, IxButton, IxCategoryFilter, IxChip, IxCounterPill, IxDatePicker, IxDateTimeCard, IxDatetimePicker, IxDrawer, IxDropdown, IxDropdownItem, IxEventList, IxEventListItem, IxExpandingSearch, IxFilterChip, IxFlipTile, IxFlipTileContent, IxGroup, IxGroupContextMenu, IxGroupDropdownItem, IxGroupItem, IxIcon, IxIconButton, IxInputGroup, IxKpi, IxMapNavigation, IxMapNavigationOverlay, IxMenu, IxMenuAbout, IxMenuAboutItem, IxMenuAboutNews, IxMenuAvatar, IxMenuAvatarItem, IxMenuItem, IxMenuSettings, IxMenuSettingsItem, IxMessageBar, IxModal, IxModalContainer, IxModalExample, IxPill, IxSelect, IxSelectItem, IxSpinner, IxSplitButton, IxSplitButtonItem, IxTabItem, IxTabs, IxTile, IxTimePicker, IxToast, IxToastContainer, IxToggle, IxTree, IxUpload, IxValidationTooltip, IxWorkflowStep, IxWorkflowSteps, Modal, showModal, showToast };
|
package/dist/index.js
CHANGED
|
@@ -256,6 +256,7 @@ const IxFilterChip = /*@__PURE__*/ createReactComponent('ix-filter-chip');
|
|
|
256
256
|
const IxFlipTile = /*@__PURE__*/ createReactComponent('ix-flip-tile');
|
|
257
257
|
const IxFlipTileContent = /*@__PURE__*/ createReactComponent('ix-flip-tile-content');
|
|
258
258
|
const IxGroup = /*@__PURE__*/ createReactComponent('ix-group');
|
|
259
|
+
const IxGroupContextMenu = /*@__PURE__*/ createReactComponent('ix-group-context-menu');
|
|
259
260
|
const IxGroupDropdownItem = /*@__PURE__*/ createReactComponent('ix-group-dropdown-item');
|
|
260
261
|
const IxGroupItem = /*@__PURE__*/ createReactComponent('ix-group-item');
|
|
261
262
|
const IxIcon = /*@__PURE__*/ createReactComponent('ix-icon');
|
|
@@ -295,25 +296,35 @@ const IxValidationTooltip = /*@__PURE__*/ createReactComponent('ix-validation-to
|
|
|
295
296
|
const IxWorkflowStep = /*@__PURE__*/ createReactComponent('ix-workflow-step');
|
|
296
297
|
const IxWorkflowSteps = /*@__PURE__*/ createReactComponent('ix-workflow-steps');
|
|
297
298
|
|
|
298
|
-
/*
|
|
299
|
-
* SPDX-FileCopyrightText: 2022 Siemens AG
|
|
300
|
-
*
|
|
301
|
-
* SPDX-License-Identifier: MIT
|
|
302
|
-
*
|
|
303
|
-
* This source code is licensed under the MIT license found in the
|
|
304
|
-
* LICENSE file in the root directory of this source tree.
|
|
305
|
-
*/
|
|
299
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
306
300
|
const Modal = React__default["default"].forwardRef((props, ref) => {
|
|
307
|
-
const
|
|
308
|
-
React.useImperativeHandle(ref, () =>
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
301
|
+
const wrapperRef = React.useRef(null);
|
|
302
|
+
React.useImperativeHandle(ref, () => {
|
|
303
|
+
let htmlElement = null;
|
|
304
|
+
if (wrapperRef.current) {
|
|
305
|
+
htmlElement = wrapperRef.current.closest('ix-modal');
|
|
306
|
+
}
|
|
307
|
+
return {
|
|
308
|
+
close: (result) => {
|
|
309
|
+
const modalElement = wrapperRef.current;
|
|
310
|
+
if (!modalElement) {
|
|
311
|
+
console.error('Modal cannot find modal reference');
|
|
312
|
+
return;
|
|
313
|
+
}
|
|
314
|
+
ix.closeModal(modalElement, result);
|
|
315
|
+
},
|
|
316
|
+
dismiss: (result) => {
|
|
317
|
+
const modalElement = wrapperRef.current;
|
|
318
|
+
if (!modalElement) {
|
|
319
|
+
console.error('Modal cannot find modal reference');
|
|
320
|
+
return;
|
|
321
|
+
}
|
|
322
|
+
ix.dismissModal(modalElement, result);
|
|
323
|
+
},
|
|
324
|
+
modalElement: htmlElement,
|
|
325
|
+
};
|
|
326
|
+
});
|
|
327
|
+
return React__default["default"].createElement("div", { ref: wrapperRef }, props.children);
|
|
317
328
|
});
|
|
318
329
|
|
|
319
330
|
/*
|
|
@@ -324,6 +335,7 @@ const Modal = React__default["default"].forwardRef((props, ref) => {
|
|
|
324
335
|
* This source code is licensed under the MIT license found in the
|
|
325
336
|
* LICENSE file in the root directory of this source tree.
|
|
326
337
|
*/
|
|
338
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
327
339
|
async function showModal(config) {
|
|
328
340
|
if (typeof config.content === 'string') {
|
|
329
341
|
return ix.modal(config);
|
|
@@ -365,14 +377,8 @@ async function showToast(config) {
|
|
|
365
377
|
return toastInstance;
|
|
366
378
|
}
|
|
367
379
|
|
|
368
|
-
/*
|
|
369
|
-
|
|
370
|
-
*
|
|
371
|
-
* SPDX-License-Identifier: MIT
|
|
372
|
-
*
|
|
373
|
-
* This source code is licensed under the MIT license found in the
|
|
374
|
-
* LICENSE file in the root directory of this source tree.
|
|
375
|
-
*/
|
|
380
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
381
|
+
// eslint-disable-next-line no-inline-comments
|
|
376
382
|
const InternalIxTree = /*@__PURE__*/ createReactComponent('ix-tree');
|
|
377
383
|
const IxTree = (props) => {
|
|
378
384
|
const cachedRootNodes = React.useRef(new Map());
|
|
@@ -429,6 +435,7 @@ exports.IxFilterChip = IxFilterChip;
|
|
|
429
435
|
exports.IxFlipTile = IxFlipTile;
|
|
430
436
|
exports.IxFlipTileContent = IxFlipTileContent;
|
|
431
437
|
exports.IxGroup = IxGroup;
|
|
438
|
+
exports.IxGroupContextMenu = IxGroupContextMenu;
|
|
432
439
|
exports.IxGroupDropdownItem = IxGroupDropdownItem;
|
|
433
440
|
exports.IxGroupItem = IxGroupItem;
|
|
434
441
|
exports.IxIcon = IxIcon;
|
|
@@ -24,6 +24,7 @@ export declare const IxFilterChip: import("react").ForwardRefExoticComponent<JSX
|
|
|
24
24
|
export declare const IxFlipTile: import("react").ForwardRefExoticComponent<JSX.IxFlipTile & Omit<import("react").HTMLAttributes<HTMLIxFlipTileElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxFlipTileElement>>;
|
|
25
25
|
export declare const IxFlipTileContent: import("react").ForwardRefExoticComponent<JSX.IxFlipTileContent & Omit<import("react").HTMLAttributes<HTMLIxFlipTileContentElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxFlipTileContentElement>>;
|
|
26
26
|
export declare const IxGroup: import("react").ForwardRefExoticComponent<JSX.IxGroup & Omit<import("react").HTMLAttributes<HTMLIxGroupElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxGroupElement>>;
|
|
27
|
+
export declare const IxGroupContextMenu: import("react").ForwardRefExoticComponent<JSX.IxGroupContextMenu & Omit<import("react").HTMLAttributes<HTMLIxGroupContextMenuElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxGroupContextMenuElement>>;
|
|
27
28
|
export declare const IxGroupDropdownItem: import("react").ForwardRefExoticComponent<JSX.IxGroupDropdownItem & Omit<import("react").HTMLAttributes<HTMLIxGroupDropdownItemElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxGroupDropdownItemElement>>;
|
|
28
29
|
export declare const IxGroupItem: import("react").ForwardRefExoticComponent<JSX.IxGroupItem & Omit<import("react").HTMLAttributes<HTMLIxGroupItemElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxGroupItemElement>>;
|
|
29
30
|
export declare const IxIcon: import("react").ForwardRefExoticComponent<JSX.IxIcon & Omit<import("react").HTMLAttributes<HTMLIxIconElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxIconElement>>;
|
|
@@ -4,7 +4,4 @@ export * from './modal';
|
|
|
4
4
|
export declare type ModalConfig = {
|
|
5
5
|
content: React.ReactNode;
|
|
6
6
|
};
|
|
7
|
-
export declare function showModal(config: Omit<IxModalConfig, 'content'> & ModalConfig): Promise<
|
|
8
|
-
onClose: import("@siemens/ix/dist/types/components/utils/typed-event").TypedEvent<any>;
|
|
9
|
-
onDismiss: import("@siemens/ix/dist/types/components/utils/typed-event").TypedEvent<any>;
|
|
10
|
-
}>;
|
|
7
|
+
export declare function showModal<TReason = any>(config: Omit<IxModalConfig, 'content'> & ModalConfig): Promise<import("@siemens/ix").ModalInstance<TReason>>;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export interface ModalRef {
|
|
3
|
-
close: (result:
|
|
4
|
-
dismiss: (result?:
|
|
3
|
+
close: <T = any>(result: T) => void;
|
|
4
|
+
dismiss: <T = any>(result?: T) => void;
|
|
5
|
+
modalElement: HTMLIxModalElement | null;
|
|
5
6
|
}
|
|
6
7
|
export declare const Modal: React.ForwardRefExoticComponent<{
|
|
7
|
-
onClose?: ((result:
|
|
8
|
-
onDismiss?: ((result?:
|
|
9
|
-
|
|
10
|
-
children
|
|
8
|
+
onClose?: (<T = any>(result: T) => void) | undefined;
|
|
9
|
+
onDismiss?: (<T_1 = any>(result?: T_1 | undefined) => void) | undefined;
|
|
10
|
+
htmlElement?: HTMLElement | undefined;
|
|
11
|
+
children: React.ReactNode;
|
|
11
12
|
} & React.RefAttributes<ModalRef>>;
|
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": "1.
|
|
10
|
+
"version": "1.2.0",
|
|
11
11
|
"description": "Siemens iX for React",
|
|
12
12
|
"main": "dist/index.js",
|
|
13
13
|
"module": "dist/index.esm.js",
|
|
@@ -21,16 +21,21 @@
|
|
|
21
21
|
"build": "npm run clean && npm run compile",
|
|
22
22
|
"clean": "rimraf dist && rimraf dist-transpiled",
|
|
23
23
|
"compile": "rollup -c",
|
|
24
|
-
"tsc": "tsc -p ."
|
|
24
|
+
"tsc": "tsc -p .",
|
|
25
|
+
"lint": "eslint src"
|
|
25
26
|
},
|
|
26
27
|
"author": "",
|
|
27
28
|
"license": "MIT",
|
|
28
29
|
"devDependencies": {
|
|
29
30
|
"@rollup/plugin-typescript": "^8.4.0",
|
|
30
|
-
"@siemens/ix": "~1.
|
|
31
|
+
"@siemens/ix": "~1.2.0",
|
|
31
32
|
"@types/estree": "~0.0.51",
|
|
32
33
|
"@types/react": "~18.0.15",
|
|
33
34
|
"@types/react-dom": "~18.0.6",
|
|
35
|
+
"@typescript-eslint/eslint-plugin": "^5.45.0",
|
|
36
|
+
"@typescript-eslint/parser": "^5.45.0",
|
|
37
|
+
"eslint-config-ix": "*",
|
|
38
|
+
"eslint-plugin-react": "^7.31.11",
|
|
34
39
|
"react": "^18.2.0",
|
|
35
40
|
"react-dom": "^18.2.0",
|
|
36
41
|
"rimraf": "^3.0.2",
|
|
@@ -46,7 +51,7 @@
|
|
|
46
51
|
"react-dom": ">=17.0.2"
|
|
47
52
|
},
|
|
48
53
|
"dependencies": {
|
|
49
|
-
"@siemens/ix
|
|
50
|
-
"@siemens/ix": "~1.
|
|
54
|
+
"@siemens/ix": "~1.2.0",
|
|
55
|
+
"@siemens/ix-icons": "~1.0.0"
|
|
51
56
|
}
|
|
52
57
|
}
|