@siemens/ix-react 1.2.0-beta.0 → 1.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/dist/index.esm.js +30 -21
- package/dist/index.js +30 -20
- package/dist/types/components.d.ts +1 -0
- package/dist/types/modal/index.d.ts +1 -4
- package/dist/types/modal/modal.d.ts +3 -2
- package/package.json +3 -3
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');
|
|
@@ -288,26 +289,33 @@ const IxWorkflowSteps = /*@__PURE__*/ createReactComponent('ix-workflow-steps');
|
|
|
288
289
|
|
|
289
290
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
290
291
|
const Modal = React.forwardRef((props, ref) => {
|
|
291
|
-
const
|
|
292
|
-
useImperativeHandle(ref, () =>
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
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);
|
|
311
319
|
});
|
|
312
320
|
|
|
313
321
|
/*
|
|
@@ -318,6 +326,7 @@ const Modal = React.forwardRef((props, ref) => {
|
|
|
318
326
|
* This source code is licensed under the MIT license found in the
|
|
319
327
|
* LICENSE file in the root directory of this source tree.
|
|
320
328
|
*/
|
|
329
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
321
330
|
async function showModal(config) {
|
|
322
331
|
if (typeof config.content === 'string') {
|
|
323
332
|
return modal(config);
|
|
@@ -393,4 +402,4 @@ const IxTree = (props) => {
|
|
|
393
402
|
} })));
|
|
394
403
|
};
|
|
395
404
|
|
|
396
|
-
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');
|
|
@@ -297,26 +298,33 @@ const IxWorkflowSteps = /*@__PURE__*/ createReactComponent('ix-workflow-steps');
|
|
|
297
298
|
|
|
298
299
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
299
300
|
const Modal = React__default["default"].forwardRef((props, ref) => {
|
|
300
|
-
const
|
|
301
|
-
React.useImperativeHandle(ref, () =>
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
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);
|
|
320
328
|
});
|
|
321
329
|
|
|
322
330
|
/*
|
|
@@ -327,6 +335,7 @@ const Modal = React__default["default"].forwardRef((props, ref) => {
|
|
|
327
335
|
* This source code is licensed under the MIT license found in the
|
|
328
336
|
* LICENSE file in the root directory of this source tree.
|
|
329
337
|
*/
|
|
338
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
330
339
|
async function showModal(config) {
|
|
331
340
|
if (typeof config.content === 'string') {
|
|
332
341
|
return ix.modal(config);
|
|
@@ -426,6 +435,7 @@ exports.IxFilterChip = IxFilterChip;
|
|
|
426
435
|
exports.IxFlipTile = IxFlipTile;
|
|
427
436
|
exports.IxFlipTileContent = IxFlipTileContent;
|
|
428
437
|
exports.IxGroup = IxGroup;
|
|
438
|
+
exports.IxGroupContextMenu = IxGroupContextMenu;
|
|
429
439
|
exports.IxGroupDropdownItem = IxGroupDropdownItem;
|
|
430
440
|
exports.IxGroupItem = IxGroupItem;
|
|
431
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>>;
|
|
@@ -2,10 +2,11 @@ import React from 'react';
|
|
|
2
2
|
export interface ModalRef {
|
|
3
3
|
close: <T = any>(result: T) => void;
|
|
4
4
|
dismiss: <T = any>(result?: T) => void;
|
|
5
|
+
modalElement: HTMLIxModalElement | null;
|
|
5
6
|
}
|
|
6
7
|
export declare const Modal: React.ForwardRefExoticComponent<{
|
|
7
8
|
onClose?: (<T = any>(result: T) => void) | undefined;
|
|
8
9
|
onDismiss?: (<T_1 = any>(result?: T_1 | undefined) => void) | undefined;
|
|
9
|
-
|
|
10
|
-
children
|
|
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.2.
|
|
10
|
+
"version": "1.2.1",
|
|
11
11
|
"description": "Siemens iX for React",
|
|
12
12
|
"main": "dist/index.js",
|
|
13
13
|
"module": "dist/index.esm.js",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"license": "MIT",
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@rollup/plugin-typescript": "^8.4.0",
|
|
31
|
-
"@siemens/ix": "~1.2.
|
|
31
|
+
"@siemens/ix": "~1.2.1",
|
|
32
32
|
"@types/estree": "~0.0.51",
|
|
33
33
|
"@types/react": "~18.0.15",
|
|
34
34
|
"@types/react-dom": "~18.0.6",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"react-dom": ">=17.0.2"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@siemens/ix": "~1.2.
|
|
54
|
+
"@siemens/ix": "~1.2.1",
|
|
55
55
|
"@siemens/ix-icons": "~1.0.0"
|
|
56
56
|
}
|
|
57
57
|
}
|