@siemens/ix-react 1.6.3 → 2.0.0-beta.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 +188 -52
- package/dist/index.js +194 -52
- package/dist/types/components.d.ts +7 -3
- package/dist/types/context/application-context.d.ts +7 -0
- package/dist/types/context/context.d.ts +5 -0
- package/dist/types/context.d.ts +1 -0
- package/dist/types/delegate.d.ts +8 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/modal/index.d.ts +2 -2
- package/dist/types/modal/modal.d.ts +1 -4
- package/dist/types/modal/portal.d.ts +6 -0
- package/package.json +3 -3
package/dist/index.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React, { createElement, useRef, useImperativeHandle, useCallback } from 'react';
|
|
2
|
-
import 'react-dom';
|
|
1
|
+
import React, { createElement, useState, useRef, useEffect, useLayoutEffect, useImperativeHandle, useCallback } from 'react';
|
|
2
|
+
import ReactDOM from 'react-dom';
|
|
3
3
|
import { defineCustomElements } from '@siemens/ix/loader';
|
|
4
|
-
import {
|
|
4
|
+
import { registerFrameworkDelegate, showModal as showModal$1, toast } from '@siemens/ix';
|
|
5
5
|
import ReactDOMClient from 'react-dom/client';
|
|
6
6
|
|
|
7
7
|
/******************************************************************************
|
|
@@ -227,6 +227,7 @@ const IxActionCard = /*@__PURE__*/ createReactComponent('ix-action-card');
|
|
|
227
227
|
const IxAnimatedTab = /*@__PURE__*/ createReactComponent('ix-animated-tab');
|
|
228
228
|
const IxAnimatedTabs = /*@__PURE__*/ createReactComponent('ix-animated-tabs');
|
|
229
229
|
const IxApplicationHeader = /*@__PURE__*/ createReactComponent('ix-application-header');
|
|
230
|
+
const IxAvatar = /*@__PURE__*/ createReactComponent('ix-avatar');
|
|
230
231
|
const IxBasicNavigation = /*@__PURE__*/ createReactComponent('ix-basic-navigation');
|
|
231
232
|
const IxBlind = /*@__PURE__*/ createReactComponent('ix-blind');
|
|
232
233
|
const IxBreadcrumb = /*@__PURE__*/ createReactComponent('ix-breadcrumb');
|
|
@@ -240,13 +241,13 @@ const IxCardTitle = /*@__PURE__*/ createReactComponent('ix-card-title');
|
|
|
240
241
|
const IxCategoryFilter = /*@__PURE__*/ createReactComponent('ix-category-filter');
|
|
241
242
|
const IxChip = /*@__PURE__*/ createReactComponent('ix-chip');
|
|
242
243
|
const IxContentHeader = /*@__PURE__*/ createReactComponent('ix-content-header');
|
|
243
|
-
const IxCounterPill = /*@__PURE__*/ createReactComponent('ix-counter-pill');
|
|
244
244
|
const IxDatePicker = /*@__PURE__*/ createReactComponent('ix-date-picker');
|
|
245
245
|
const IxDatetimePicker = /*@__PURE__*/ createReactComponent('ix-datetime-picker');
|
|
246
246
|
const IxDivider = /*@__PURE__*/ createReactComponent('ix-divider');
|
|
247
247
|
const IxDrawer = /*@__PURE__*/ createReactComponent('ix-drawer');
|
|
248
248
|
const IxDropdown = /*@__PURE__*/ createReactComponent('ix-dropdown');
|
|
249
249
|
const IxDropdownButton = /*@__PURE__*/ createReactComponent('ix-dropdown-button');
|
|
250
|
+
const IxDropdownHeader = /*@__PURE__*/ createReactComponent('ix-dropdown-header');
|
|
250
251
|
const IxDropdownItem = /*@__PURE__*/ createReactComponent('ix-dropdown-item');
|
|
251
252
|
const IxDropdownQuickActions = /*@__PURE__*/ createReactComponent('ix-dropdown-quick-actions');
|
|
252
253
|
const IxEmptyState = /*@__PURE__*/ createReactComponent('ix-empty-state');
|
|
@@ -258,7 +259,6 @@ const IxFlipTile = /*@__PURE__*/ createReactComponent('ix-flip-tile');
|
|
|
258
259
|
const IxFlipTileContent = /*@__PURE__*/ createReactComponent('ix-flip-tile-content');
|
|
259
260
|
const IxGroup = /*@__PURE__*/ createReactComponent('ix-group');
|
|
260
261
|
const IxGroupContextMenu = /*@__PURE__*/ createReactComponent('ix-group-context-menu');
|
|
261
|
-
const IxGroupDropdownItem = /*@__PURE__*/ createReactComponent('ix-group-dropdown-item');
|
|
262
262
|
const IxGroupItem = /*@__PURE__*/ createReactComponent('ix-group-item');
|
|
263
263
|
const IxIcon = /*@__PURE__*/ createReactComponent('ix-icon');
|
|
264
264
|
const IxIconButton = /*@__PURE__*/ createReactComponent('ix-icon-button');
|
|
@@ -266,6 +266,7 @@ const IxInputGroup = /*@__PURE__*/ createReactComponent('ix-input-group');
|
|
|
266
266
|
const IxKeyValue = /*@__PURE__*/ createReactComponent('ix-key-value');
|
|
267
267
|
const IxKeyValueList = /*@__PURE__*/ createReactComponent('ix-key-value-list');
|
|
268
268
|
const IxKpi = /*@__PURE__*/ createReactComponent('ix-kpi');
|
|
269
|
+
const IxLinkButton = /*@__PURE__*/ createReactComponent('ix-link-button');
|
|
269
270
|
const IxMapNavigation = /*@__PURE__*/ createReactComponent('ix-map-navigation');
|
|
270
271
|
const IxMapNavigationOverlay = /*@__PURE__*/ createReactComponent('ix-map-navigation-overlay');
|
|
271
272
|
const IxMenu = /*@__PURE__*/ createReactComponent('ix-menu');
|
|
@@ -274,13 +275,16 @@ const IxMenuAboutItem = /*@__PURE__*/ createReactComponent('ix-menu-about-item')
|
|
|
274
275
|
const IxMenuAboutNews = /*@__PURE__*/ createReactComponent('ix-menu-about-news');
|
|
275
276
|
const IxMenuAvatar = /*@__PURE__*/ createReactComponent('ix-menu-avatar');
|
|
276
277
|
const IxMenuAvatarItem = /*@__PURE__*/ createReactComponent('ix-menu-avatar-item');
|
|
278
|
+
const IxMenuCategory = /*@__PURE__*/ createReactComponent('ix-menu-category');
|
|
277
279
|
const IxMenuItem = /*@__PURE__*/ createReactComponent('ix-menu-item');
|
|
278
280
|
const IxMenuSettings = /*@__PURE__*/ createReactComponent('ix-menu-settings');
|
|
279
281
|
const IxMenuSettingsItem = /*@__PURE__*/ createReactComponent('ix-menu-settings-item');
|
|
280
282
|
const IxMessageBar = /*@__PURE__*/ createReactComponent('ix-message-bar');
|
|
281
283
|
const IxModal = /*@__PURE__*/ createReactComponent('ix-modal');
|
|
282
|
-
const
|
|
284
|
+
const IxModalContent = /*@__PURE__*/ createReactComponent('ix-modal-content');
|
|
283
285
|
const IxModalExample = /*@__PURE__*/ createReactComponent('ix-modal-example');
|
|
286
|
+
const IxModalFooter = /*@__PURE__*/ createReactComponent('ix-modal-footer');
|
|
287
|
+
const IxModalHeader = /*@__PURE__*/ createReactComponent('ix-modal-header');
|
|
284
288
|
const IxPagination = /*@__PURE__*/ createReactComponent('ix-pagination');
|
|
285
289
|
const IxPill = /*@__PURE__*/ createReactComponent('ix-pill');
|
|
286
290
|
const IxPushCard = /*@__PURE__*/ createReactComponent('ix-push-card');
|
|
@@ -302,37 +306,184 @@ const IxValidationTooltip = /*@__PURE__*/ createReactComponent('ix-validation-to
|
|
|
302
306
|
const IxWorkflowStep = /*@__PURE__*/ createReactComponent('ix-workflow-step');
|
|
303
307
|
const IxWorkflowSteps = /*@__PURE__*/ createReactComponent('ix-workflow-steps');
|
|
304
308
|
|
|
305
|
-
/*
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
309
|
+
/*
|
|
310
|
+
* SPDX-FileCopyrightText: 2023 Siemens AG
|
|
311
|
+
*
|
|
312
|
+
* SPDX-License-Identifier: MIT
|
|
313
|
+
*
|
|
314
|
+
* This source code is licensed under the MIT license found in the
|
|
315
|
+
* LICENSE file in the root directory of this source tree.
|
|
316
|
+
*/
|
|
317
|
+
let viewInstance = 0;
|
|
318
|
+
function createViewInstance() {
|
|
319
|
+
return `ix-react-view-${viewInstance++}`;
|
|
320
|
+
}
|
|
321
|
+
const mountedRootNodes = {};
|
|
322
|
+
async function fallbackRootDom(id, view) {
|
|
323
|
+
return new Promise((resolve) => {
|
|
324
|
+
const rootElement = document.createElement('DIV');
|
|
325
|
+
rootElement.id = id;
|
|
326
|
+
rootElement.style.display = 'contents';
|
|
327
|
+
document.body.appendChild(rootElement);
|
|
328
|
+
const root = ReactDOMClient.createRoot(rootElement);
|
|
329
|
+
root.render(view);
|
|
330
|
+
mountedRootNodes[id] = root;
|
|
331
|
+
setTimeout(() => {
|
|
332
|
+
const viewElement = rootElement.children[0];
|
|
333
|
+
resolve(viewElement);
|
|
334
|
+
});
|
|
335
|
+
});
|
|
336
|
+
}
|
|
337
|
+
async function fallbackRemoveViewFromRootDom(view) {
|
|
338
|
+
const parent = view.parentElement;
|
|
339
|
+
const id = parent.id;
|
|
340
|
+
if (id in mountedRootNodes) {
|
|
341
|
+
mountedRootNodes[id].unmount();
|
|
342
|
+
delete mountedRootNodes[id];
|
|
343
|
+
parent.remove();
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
class ReactFrameworkDelegate {
|
|
347
|
+
async attachView(view) {
|
|
348
|
+
const id = createViewInstance();
|
|
349
|
+
if (!this.attachViewToPortal) {
|
|
350
|
+
return fallbackRootDom(id, view);
|
|
312
351
|
}
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
352
|
+
const refElement = await this.attachViewToPortal(id, view);
|
|
353
|
+
return refElement;
|
|
354
|
+
}
|
|
355
|
+
async removeView(view) {
|
|
356
|
+
if (!this.removeViewFromPortal) {
|
|
357
|
+
return fallbackRemoveViewFromRootDom(view);
|
|
358
|
+
}
|
|
359
|
+
const parent = view.parentElement;
|
|
360
|
+
const id = parent.getAttribute('data-portal-id');
|
|
361
|
+
this.removeViewFromPortal(id);
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
const reactFrameworkDelegate = new ReactFrameworkDelegate();
|
|
365
|
+
registerFrameworkDelegate(reactFrameworkDelegate);
|
|
366
|
+
|
|
367
|
+
/*
|
|
368
|
+
* SPDX-FileCopyrightText: 2023 Siemens AG
|
|
369
|
+
*
|
|
370
|
+
* SPDX-License-Identifier: MIT
|
|
371
|
+
*
|
|
372
|
+
* This source code is licensed under the MIT license found in the
|
|
373
|
+
* LICENSE file in the root directory of this source tree.
|
|
374
|
+
*/
|
|
375
|
+
const PORTAL_ID = 'ix-portal';
|
|
376
|
+
const IxOverlay = (props) => {
|
|
377
|
+
const [portalRef, setPortalRef] = useState(null);
|
|
378
|
+
const resolveElementRef = useRef({});
|
|
379
|
+
const viewRefs = useRef({});
|
|
380
|
+
const [views, setViews] = useState({});
|
|
381
|
+
useEffect(() => {
|
|
382
|
+
const addOverlay = (id, view) => {
|
|
383
|
+
const _views = Object.assign({}, viewRefs.current);
|
|
384
|
+
_views[id] = view;
|
|
385
|
+
setViews(_views);
|
|
386
|
+
viewRefs.current = _views;
|
|
331
387
|
};
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
388
|
+
const removeOverlay = (id) => {
|
|
389
|
+
const _views = Object.assign({}, viewRefs.current);
|
|
390
|
+
delete _views[id];
|
|
391
|
+
setViews(_views);
|
|
392
|
+
viewRefs.current = _views;
|
|
393
|
+
};
|
|
394
|
+
props.delegate.attachViewToPortal = async (id, view) => {
|
|
395
|
+
addOverlay(id, view);
|
|
396
|
+
return new Promise((resolve) => {
|
|
397
|
+
const r = Object.assign({}, resolveElementRef.current);
|
|
398
|
+
r[id] = resolve;
|
|
399
|
+
resolveElementRef.current = r;
|
|
400
|
+
});
|
|
401
|
+
};
|
|
402
|
+
props.delegate.removeViewFromPortal = async (id) => {
|
|
403
|
+
console.log(id);
|
|
404
|
+
removeOverlay(id);
|
|
405
|
+
};
|
|
406
|
+
}, []);
|
|
407
|
+
useLayoutEffect(() => {
|
|
408
|
+
const portalRef = document.querySelector(`#${PORTAL_ID}`);
|
|
409
|
+
if (portalRef) {
|
|
410
|
+
setPortalRef(portalRef);
|
|
411
|
+
}
|
|
412
|
+
}, []);
|
|
413
|
+
useLayoutEffect(() => {
|
|
414
|
+
Object.keys(views).forEach((key) => {
|
|
415
|
+
const resolveQueue = Object.assign({}, resolveElementRef.current);
|
|
416
|
+
const element = document.querySelector(`[data-portal-id="${key}"]`);
|
|
417
|
+
if (element && element.children.length === 1 && resolveQueue[key]) {
|
|
418
|
+
const view = element.children[0];
|
|
419
|
+
resolveQueue[key](view);
|
|
420
|
+
}
|
|
421
|
+
});
|
|
422
|
+
}, [views]);
|
|
423
|
+
if (!portalRef) {
|
|
424
|
+
return null;
|
|
425
|
+
}
|
|
426
|
+
return (React.createElement(React.Fragment, null, Object.keys(views).map((key) => {
|
|
427
|
+
const RenderView = views[key];
|
|
428
|
+
return ReactDOM.createPortal(React.createElement("div", { "data-portal-id": key, style: { display: 'contents ' } }, RenderView), portalRef, key);
|
|
429
|
+
})));
|
|
430
|
+
};
|
|
431
|
+
|
|
432
|
+
/*
|
|
433
|
+
* SPDX-FileCopyrightText: 2023 Siemens AG
|
|
434
|
+
*
|
|
435
|
+
* SPDX-License-Identifier: MIT
|
|
436
|
+
*
|
|
437
|
+
* This source code is licensed under the MIT license found in the
|
|
438
|
+
* LICENSE file in the root directory of this source tree.
|
|
439
|
+
*/
|
|
440
|
+
const IxContext = React.createContext(null);
|
|
441
|
+
|
|
442
|
+
/*
|
|
443
|
+
* SPDX-FileCopyrightText: 2023 Siemens AG
|
|
444
|
+
*
|
|
445
|
+
* SPDX-License-Identifier: MIT
|
|
446
|
+
*
|
|
447
|
+
* This source code is licensed under the MIT license found in the
|
|
448
|
+
* LICENSE file in the root directory of this source tree.
|
|
449
|
+
*/
|
|
450
|
+
class IxApplicationContext extends React.Component {
|
|
451
|
+
constructor(props) {
|
|
452
|
+
super(props);
|
|
453
|
+
this.delegate = reactFrameworkDelegate;
|
|
454
|
+
}
|
|
455
|
+
render() {
|
|
456
|
+
return (React.createElement(IxContext.Provider, { value: {
|
|
457
|
+
delegate: this.delegate,
|
|
458
|
+
} },
|
|
459
|
+
this.props.children,
|
|
460
|
+
React.createElement(IxOverlay, { delegate: this.delegate }),
|
|
461
|
+
React.createElement("div", { id: PORTAL_ID })));
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
/*
|
|
466
|
+
* SPDX-FileCopyrightText: 2023 Siemens AG
|
|
467
|
+
*
|
|
468
|
+
* SPDX-License-Identifier: MIT
|
|
469
|
+
*
|
|
470
|
+
* This source code is licensed under the MIT license found in the
|
|
471
|
+
* LICENSE file in the root directory of this source tree.
|
|
472
|
+
*/
|
|
473
|
+
const Modal = React.forwardRef((props, ref) => {
|
|
474
|
+
const wrapperRef = useRef(null);
|
|
475
|
+
useImperativeHandle(ref, () => ({
|
|
476
|
+
close(result) {
|
|
477
|
+
var _a;
|
|
478
|
+
(_a = wrapperRef.current) === null || _a === void 0 ? void 0 : _a.closeModal(result);
|
|
479
|
+
},
|
|
480
|
+
dismiss(result) {
|
|
481
|
+
var _a;
|
|
482
|
+
(_a = wrapperRef.current) === null || _a === void 0 ? void 0 : _a.dismissModal(result);
|
|
483
|
+
},
|
|
484
|
+
modalElement: null,
|
|
485
|
+
}));
|
|
486
|
+
return React.createElement(IxModal, { ref: wrapperRef }, props.children);
|
|
336
487
|
});
|
|
337
488
|
|
|
338
489
|
/*
|
|
@@ -343,23 +494,8 @@ const Modal = React.forwardRef((props, ref) => {
|
|
|
343
494
|
* This source code is licensed under the MIT license found in the
|
|
344
495
|
* LICENSE file in the root directory of this source tree.
|
|
345
496
|
*/
|
|
346
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
347
497
|
async function showModal(config) {
|
|
348
|
-
|
|
349
|
-
return modal(config);
|
|
350
|
-
}
|
|
351
|
-
const container = document.createElement('DIV');
|
|
352
|
-
container.style.display = 'contents';
|
|
353
|
-
const root = ReactDOMClient.createRoot(container);
|
|
354
|
-
root.render(config.content);
|
|
355
|
-
const modalInstance = await modal(Object.assign(Object.assign({}, config), { content: container }));
|
|
356
|
-
modalInstance.onClose.once(() => {
|
|
357
|
-
root.unmount();
|
|
358
|
-
});
|
|
359
|
-
modalInstance.onDismiss.once(() => {
|
|
360
|
-
root.unmount();
|
|
361
|
-
});
|
|
362
|
-
return modalInstance;
|
|
498
|
+
return showModal$1(config);
|
|
363
499
|
}
|
|
364
500
|
|
|
365
501
|
/*
|
|
@@ -420,4 +556,4 @@ const IxTree = (props) => {
|
|
|
420
556
|
} })));
|
|
421
557
|
};
|
|
422
558
|
|
|
423
|
-
export { IxActionCard, IxAnimatedTab, IxAnimatedTabs, IxApplicationHeader, IxBasicNavigation, IxBlind, IxBreadcrumb, IxBreadcrumbItem, IxButton, IxCard, IxCardAccordion, IxCardContent, IxCardList, IxCardTitle, IxCategoryFilter, IxChip, IxContentHeader,
|
|
559
|
+
export { IxActionCard, IxAnimatedTab, IxAnimatedTabs, IxApplicationContext, IxApplicationHeader, IxAvatar, IxBasicNavigation, IxBlind, IxBreadcrumb, IxBreadcrumbItem, IxButton, IxCard, IxCardAccordion, IxCardContent, IxCardList, IxCardTitle, IxCategoryFilter, IxChip, IxContentHeader, IxDatePicker, IxDatetimePicker, IxDivider, IxDrawer, IxDropdown, IxDropdownButton, IxDropdownHeader, IxDropdownItem, IxDropdownQuickActions, IxEmptyState, IxEventList, IxEventListItem, IxExpandingSearch, IxFilterChip, IxFlipTile, IxFlipTileContent, IxGroup, IxGroupContextMenu, IxGroupItem, IxIcon, IxIconButton, IxInputGroup, IxKeyValue, IxKeyValueList, IxKpi, IxLinkButton, IxMapNavigation, IxMapNavigationOverlay, IxMenu, IxMenuAbout, IxMenuAboutItem, IxMenuAboutNews, IxMenuAvatar, IxMenuAvatarItem, IxMenuCategory, IxMenuItem, IxMenuSettings, IxMenuSettingsItem, IxMessageBar, IxModal, IxModalContent, IxModalExample, IxModalFooter, IxModalHeader, IxPagination, IxPill, IxPushCard, IxSelect, IxSelectItem, IxSpinner, IxSplitButton, IxSplitButtonItem, IxTabItem, IxTabs, IxTile, IxTimePicker, IxToast, IxToastContainer, IxToggle, IxTooltip, IxTree, IxUpload, IxValidationTooltip, IxWorkflowStep, IxWorkflowSteps, Modal, showModal, showToast };
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const React = require('react');
|
|
6
|
-
require('react-dom');
|
|
6
|
+
const ReactDOM = require('react-dom');
|
|
7
7
|
const loader = require('@siemens/ix/loader');
|
|
8
8
|
const ix = require('@siemens/ix');
|
|
9
9
|
const ReactDOMClient = require('react-dom/client');
|
|
@@ -11,6 +11,7 @@ const ReactDOMClient = require('react-dom/client');
|
|
|
11
11
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
12
12
|
|
|
13
13
|
const React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
14
|
+
const ReactDOM__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOM);
|
|
14
15
|
const ReactDOMClient__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOMClient);
|
|
15
16
|
|
|
16
17
|
/******************************************************************************
|
|
@@ -236,6 +237,7 @@ const IxActionCard = /*@__PURE__*/ createReactComponent('ix-action-card');
|
|
|
236
237
|
const IxAnimatedTab = /*@__PURE__*/ createReactComponent('ix-animated-tab');
|
|
237
238
|
const IxAnimatedTabs = /*@__PURE__*/ createReactComponent('ix-animated-tabs');
|
|
238
239
|
const IxApplicationHeader = /*@__PURE__*/ createReactComponent('ix-application-header');
|
|
240
|
+
const IxAvatar = /*@__PURE__*/ createReactComponent('ix-avatar');
|
|
239
241
|
const IxBasicNavigation = /*@__PURE__*/ createReactComponent('ix-basic-navigation');
|
|
240
242
|
const IxBlind = /*@__PURE__*/ createReactComponent('ix-blind');
|
|
241
243
|
const IxBreadcrumb = /*@__PURE__*/ createReactComponent('ix-breadcrumb');
|
|
@@ -249,13 +251,13 @@ const IxCardTitle = /*@__PURE__*/ createReactComponent('ix-card-title');
|
|
|
249
251
|
const IxCategoryFilter = /*@__PURE__*/ createReactComponent('ix-category-filter');
|
|
250
252
|
const IxChip = /*@__PURE__*/ createReactComponent('ix-chip');
|
|
251
253
|
const IxContentHeader = /*@__PURE__*/ createReactComponent('ix-content-header');
|
|
252
|
-
const IxCounterPill = /*@__PURE__*/ createReactComponent('ix-counter-pill');
|
|
253
254
|
const IxDatePicker = /*@__PURE__*/ createReactComponent('ix-date-picker');
|
|
254
255
|
const IxDatetimePicker = /*@__PURE__*/ createReactComponent('ix-datetime-picker');
|
|
255
256
|
const IxDivider = /*@__PURE__*/ createReactComponent('ix-divider');
|
|
256
257
|
const IxDrawer = /*@__PURE__*/ createReactComponent('ix-drawer');
|
|
257
258
|
const IxDropdown = /*@__PURE__*/ createReactComponent('ix-dropdown');
|
|
258
259
|
const IxDropdownButton = /*@__PURE__*/ createReactComponent('ix-dropdown-button');
|
|
260
|
+
const IxDropdownHeader = /*@__PURE__*/ createReactComponent('ix-dropdown-header');
|
|
259
261
|
const IxDropdownItem = /*@__PURE__*/ createReactComponent('ix-dropdown-item');
|
|
260
262
|
const IxDropdownQuickActions = /*@__PURE__*/ createReactComponent('ix-dropdown-quick-actions');
|
|
261
263
|
const IxEmptyState = /*@__PURE__*/ createReactComponent('ix-empty-state');
|
|
@@ -267,7 +269,6 @@ const IxFlipTile = /*@__PURE__*/ createReactComponent('ix-flip-tile');
|
|
|
267
269
|
const IxFlipTileContent = /*@__PURE__*/ createReactComponent('ix-flip-tile-content');
|
|
268
270
|
const IxGroup = /*@__PURE__*/ createReactComponent('ix-group');
|
|
269
271
|
const IxGroupContextMenu = /*@__PURE__*/ createReactComponent('ix-group-context-menu');
|
|
270
|
-
const IxGroupDropdownItem = /*@__PURE__*/ createReactComponent('ix-group-dropdown-item');
|
|
271
272
|
const IxGroupItem = /*@__PURE__*/ createReactComponent('ix-group-item');
|
|
272
273
|
const IxIcon = /*@__PURE__*/ createReactComponent('ix-icon');
|
|
273
274
|
const IxIconButton = /*@__PURE__*/ createReactComponent('ix-icon-button');
|
|
@@ -275,6 +276,7 @@ const IxInputGroup = /*@__PURE__*/ createReactComponent('ix-input-group');
|
|
|
275
276
|
const IxKeyValue = /*@__PURE__*/ createReactComponent('ix-key-value');
|
|
276
277
|
const IxKeyValueList = /*@__PURE__*/ createReactComponent('ix-key-value-list');
|
|
277
278
|
const IxKpi = /*@__PURE__*/ createReactComponent('ix-kpi');
|
|
279
|
+
const IxLinkButton = /*@__PURE__*/ createReactComponent('ix-link-button');
|
|
278
280
|
const IxMapNavigation = /*@__PURE__*/ createReactComponent('ix-map-navigation');
|
|
279
281
|
const IxMapNavigationOverlay = /*@__PURE__*/ createReactComponent('ix-map-navigation-overlay');
|
|
280
282
|
const IxMenu = /*@__PURE__*/ createReactComponent('ix-menu');
|
|
@@ -283,13 +285,16 @@ const IxMenuAboutItem = /*@__PURE__*/ createReactComponent('ix-menu-about-item')
|
|
|
283
285
|
const IxMenuAboutNews = /*@__PURE__*/ createReactComponent('ix-menu-about-news');
|
|
284
286
|
const IxMenuAvatar = /*@__PURE__*/ createReactComponent('ix-menu-avatar');
|
|
285
287
|
const IxMenuAvatarItem = /*@__PURE__*/ createReactComponent('ix-menu-avatar-item');
|
|
288
|
+
const IxMenuCategory = /*@__PURE__*/ createReactComponent('ix-menu-category');
|
|
286
289
|
const IxMenuItem = /*@__PURE__*/ createReactComponent('ix-menu-item');
|
|
287
290
|
const IxMenuSettings = /*@__PURE__*/ createReactComponent('ix-menu-settings');
|
|
288
291
|
const IxMenuSettingsItem = /*@__PURE__*/ createReactComponent('ix-menu-settings-item');
|
|
289
292
|
const IxMessageBar = /*@__PURE__*/ createReactComponent('ix-message-bar');
|
|
290
293
|
const IxModal = /*@__PURE__*/ createReactComponent('ix-modal');
|
|
291
|
-
const
|
|
294
|
+
const IxModalContent = /*@__PURE__*/ createReactComponent('ix-modal-content');
|
|
292
295
|
const IxModalExample = /*@__PURE__*/ createReactComponent('ix-modal-example');
|
|
296
|
+
const IxModalFooter = /*@__PURE__*/ createReactComponent('ix-modal-footer');
|
|
297
|
+
const IxModalHeader = /*@__PURE__*/ createReactComponent('ix-modal-header');
|
|
293
298
|
const IxPagination = /*@__PURE__*/ createReactComponent('ix-pagination');
|
|
294
299
|
const IxPill = /*@__PURE__*/ createReactComponent('ix-pill');
|
|
295
300
|
const IxPushCard = /*@__PURE__*/ createReactComponent('ix-push-card');
|
|
@@ -311,37 +316,184 @@ const IxValidationTooltip = /*@__PURE__*/ createReactComponent('ix-validation-to
|
|
|
311
316
|
const IxWorkflowStep = /*@__PURE__*/ createReactComponent('ix-workflow-step');
|
|
312
317
|
const IxWorkflowSteps = /*@__PURE__*/ createReactComponent('ix-workflow-steps');
|
|
313
318
|
|
|
314
|
-
/*
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
319
|
+
/*
|
|
320
|
+
* SPDX-FileCopyrightText: 2023 Siemens AG
|
|
321
|
+
*
|
|
322
|
+
* SPDX-License-Identifier: MIT
|
|
323
|
+
*
|
|
324
|
+
* This source code is licensed under the MIT license found in the
|
|
325
|
+
* LICENSE file in the root directory of this source tree.
|
|
326
|
+
*/
|
|
327
|
+
let viewInstance = 0;
|
|
328
|
+
function createViewInstance() {
|
|
329
|
+
return `ix-react-view-${viewInstance++}`;
|
|
330
|
+
}
|
|
331
|
+
const mountedRootNodes = {};
|
|
332
|
+
async function fallbackRootDom(id, view) {
|
|
333
|
+
return new Promise((resolve) => {
|
|
334
|
+
const rootElement = document.createElement('DIV');
|
|
335
|
+
rootElement.id = id;
|
|
336
|
+
rootElement.style.display = 'contents';
|
|
337
|
+
document.body.appendChild(rootElement);
|
|
338
|
+
const root = ReactDOMClient__default["default"].createRoot(rootElement);
|
|
339
|
+
root.render(view);
|
|
340
|
+
mountedRootNodes[id] = root;
|
|
341
|
+
setTimeout(() => {
|
|
342
|
+
const viewElement = rootElement.children[0];
|
|
343
|
+
resolve(viewElement);
|
|
344
|
+
});
|
|
345
|
+
});
|
|
346
|
+
}
|
|
347
|
+
async function fallbackRemoveViewFromRootDom(view) {
|
|
348
|
+
const parent = view.parentElement;
|
|
349
|
+
const id = parent.id;
|
|
350
|
+
if (id in mountedRootNodes) {
|
|
351
|
+
mountedRootNodes[id].unmount();
|
|
352
|
+
delete mountedRootNodes[id];
|
|
353
|
+
parent.remove();
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
class ReactFrameworkDelegate {
|
|
357
|
+
async attachView(view) {
|
|
358
|
+
const id = createViewInstance();
|
|
359
|
+
if (!this.attachViewToPortal) {
|
|
360
|
+
return fallbackRootDom(id, view);
|
|
321
361
|
}
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
362
|
+
const refElement = await this.attachViewToPortal(id, view);
|
|
363
|
+
return refElement;
|
|
364
|
+
}
|
|
365
|
+
async removeView(view) {
|
|
366
|
+
if (!this.removeViewFromPortal) {
|
|
367
|
+
return fallbackRemoveViewFromRootDom(view);
|
|
368
|
+
}
|
|
369
|
+
const parent = view.parentElement;
|
|
370
|
+
const id = parent.getAttribute('data-portal-id');
|
|
371
|
+
this.removeViewFromPortal(id);
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
const reactFrameworkDelegate = new ReactFrameworkDelegate();
|
|
375
|
+
ix.registerFrameworkDelegate(reactFrameworkDelegate);
|
|
376
|
+
|
|
377
|
+
/*
|
|
378
|
+
* SPDX-FileCopyrightText: 2023 Siemens AG
|
|
379
|
+
*
|
|
380
|
+
* SPDX-License-Identifier: MIT
|
|
381
|
+
*
|
|
382
|
+
* This source code is licensed under the MIT license found in the
|
|
383
|
+
* LICENSE file in the root directory of this source tree.
|
|
384
|
+
*/
|
|
385
|
+
const PORTAL_ID = 'ix-portal';
|
|
386
|
+
const IxOverlay = (props) => {
|
|
387
|
+
const [portalRef, setPortalRef] = React.useState(null);
|
|
388
|
+
const resolveElementRef = React.useRef({});
|
|
389
|
+
const viewRefs = React.useRef({});
|
|
390
|
+
const [views, setViews] = React.useState({});
|
|
391
|
+
React.useEffect(() => {
|
|
392
|
+
const addOverlay = (id, view) => {
|
|
393
|
+
const _views = Object.assign({}, viewRefs.current);
|
|
394
|
+
_views[id] = view;
|
|
395
|
+
setViews(_views);
|
|
396
|
+
viewRefs.current = _views;
|
|
340
397
|
};
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
398
|
+
const removeOverlay = (id) => {
|
|
399
|
+
const _views = Object.assign({}, viewRefs.current);
|
|
400
|
+
delete _views[id];
|
|
401
|
+
setViews(_views);
|
|
402
|
+
viewRefs.current = _views;
|
|
403
|
+
};
|
|
404
|
+
props.delegate.attachViewToPortal = async (id, view) => {
|
|
405
|
+
addOverlay(id, view);
|
|
406
|
+
return new Promise((resolve) => {
|
|
407
|
+
const r = Object.assign({}, resolveElementRef.current);
|
|
408
|
+
r[id] = resolve;
|
|
409
|
+
resolveElementRef.current = r;
|
|
410
|
+
});
|
|
411
|
+
};
|
|
412
|
+
props.delegate.removeViewFromPortal = async (id) => {
|
|
413
|
+
console.log(id);
|
|
414
|
+
removeOverlay(id);
|
|
415
|
+
};
|
|
416
|
+
}, []);
|
|
417
|
+
React.useLayoutEffect(() => {
|
|
418
|
+
const portalRef = document.querySelector(`#${PORTAL_ID}`);
|
|
419
|
+
if (portalRef) {
|
|
420
|
+
setPortalRef(portalRef);
|
|
421
|
+
}
|
|
422
|
+
}, []);
|
|
423
|
+
React.useLayoutEffect(() => {
|
|
424
|
+
Object.keys(views).forEach((key) => {
|
|
425
|
+
const resolveQueue = Object.assign({}, resolveElementRef.current);
|
|
426
|
+
const element = document.querySelector(`[data-portal-id="${key}"]`);
|
|
427
|
+
if (element && element.children.length === 1 && resolveQueue[key]) {
|
|
428
|
+
const view = element.children[0];
|
|
429
|
+
resolveQueue[key](view);
|
|
430
|
+
}
|
|
431
|
+
});
|
|
432
|
+
}, [views]);
|
|
433
|
+
if (!portalRef) {
|
|
434
|
+
return null;
|
|
435
|
+
}
|
|
436
|
+
return (React__default["default"].createElement(React__default["default"].Fragment, null, Object.keys(views).map((key) => {
|
|
437
|
+
const RenderView = views[key];
|
|
438
|
+
return ReactDOM__default["default"].createPortal(React__default["default"].createElement("div", { "data-portal-id": key, style: { display: 'contents ' } }, RenderView), portalRef, key);
|
|
439
|
+
})));
|
|
440
|
+
};
|
|
441
|
+
|
|
442
|
+
/*
|
|
443
|
+
* SPDX-FileCopyrightText: 2023 Siemens AG
|
|
444
|
+
*
|
|
445
|
+
* SPDX-License-Identifier: MIT
|
|
446
|
+
*
|
|
447
|
+
* This source code is licensed under the MIT license found in the
|
|
448
|
+
* LICENSE file in the root directory of this source tree.
|
|
449
|
+
*/
|
|
450
|
+
const IxContext = React__default["default"].createContext(null);
|
|
451
|
+
|
|
452
|
+
/*
|
|
453
|
+
* SPDX-FileCopyrightText: 2023 Siemens AG
|
|
454
|
+
*
|
|
455
|
+
* SPDX-License-Identifier: MIT
|
|
456
|
+
*
|
|
457
|
+
* This source code is licensed under the MIT license found in the
|
|
458
|
+
* LICENSE file in the root directory of this source tree.
|
|
459
|
+
*/
|
|
460
|
+
class IxApplicationContext extends React__default["default"].Component {
|
|
461
|
+
constructor(props) {
|
|
462
|
+
super(props);
|
|
463
|
+
this.delegate = reactFrameworkDelegate;
|
|
464
|
+
}
|
|
465
|
+
render() {
|
|
466
|
+
return (React__default["default"].createElement(IxContext.Provider, { value: {
|
|
467
|
+
delegate: this.delegate,
|
|
468
|
+
} },
|
|
469
|
+
this.props.children,
|
|
470
|
+
React__default["default"].createElement(IxOverlay, { delegate: this.delegate }),
|
|
471
|
+
React__default["default"].createElement("div", { id: PORTAL_ID })));
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
/*
|
|
476
|
+
* SPDX-FileCopyrightText: 2023 Siemens AG
|
|
477
|
+
*
|
|
478
|
+
* SPDX-License-Identifier: MIT
|
|
479
|
+
*
|
|
480
|
+
* This source code is licensed under the MIT license found in the
|
|
481
|
+
* LICENSE file in the root directory of this source tree.
|
|
482
|
+
*/
|
|
483
|
+
const Modal = React__default["default"].forwardRef((props, ref) => {
|
|
484
|
+
const wrapperRef = React.useRef(null);
|
|
485
|
+
React.useImperativeHandle(ref, () => ({
|
|
486
|
+
close(result) {
|
|
487
|
+
var _a;
|
|
488
|
+
(_a = wrapperRef.current) === null || _a === void 0 ? void 0 : _a.closeModal(result);
|
|
489
|
+
},
|
|
490
|
+
dismiss(result) {
|
|
491
|
+
var _a;
|
|
492
|
+
(_a = wrapperRef.current) === null || _a === void 0 ? void 0 : _a.dismissModal(result);
|
|
493
|
+
},
|
|
494
|
+
modalElement: null,
|
|
495
|
+
}));
|
|
496
|
+
return React__default["default"].createElement(IxModal, { ref: wrapperRef }, props.children);
|
|
345
497
|
});
|
|
346
498
|
|
|
347
499
|
/*
|
|
@@ -352,23 +504,8 @@ const Modal = React__default["default"].forwardRef((props, ref) => {
|
|
|
352
504
|
* This source code is licensed under the MIT license found in the
|
|
353
505
|
* LICENSE file in the root directory of this source tree.
|
|
354
506
|
*/
|
|
355
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
356
507
|
async function showModal(config) {
|
|
357
|
-
|
|
358
|
-
return ix.modal(config);
|
|
359
|
-
}
|
|
360
|
-
const container = document.createElement('DIV');
|
|
361
|
-
container.style.display = 'contents';
|
|
362
|
-
const root = ReactDOMClient__default["default"].createRoot(container);
|
|
363
|
-
root.render(config.content);
|
|
364
|
-
const modalInstance = await ix.modal(Object.assign(Object.assign({}, config), { content: container }));
|
|
365
|
-
modalInstance.onClose.once(() => {
|
|
366
|
-
root.unmount();
|
|
367
|
-
});
|
|
368
|
-
modalInstance.onDismiss.once(() => {
|
|
369
|
-
root.unmount();
|
|
370
|
-
});
|
|
371
|
-
return modalInstance;
|
|
508
|
+
return ix.showModal(config);
|
|
372
509
|
}
|
|
373
510
|
|
|
374
511
|
/*
|
|
@@ -432,7 +569,9 @@ const IxTree = (props) => {
|
|
|
432
569
|
exports.IxActionCard = IxActionCard;
|
|
433
570
|
exports.IxAnimatedTab = IxAnimatedTab;
|
|
434
571
|
exports.IxAnimatedTabs = IxAnimatedTabs;
|
|
572
|
+
exports.IxApplicationContext = IxApplicationContext;
|
|
435
573
|
exports.IxApplicationHeader = IxApplicationHeader;
|
|
574
|
+
exports.IxAvatar = IxAvatar;
|
|
436
575
|
exports.IxBasicNavigation = IxBasicNavigation;
|
|
437
576
|
exports.IxBlind = IxBlind;
|
|
438
577
|
exports.IxBreadcrumb = IxBreadcrumb;
|
|
@@ -446,13 +585,13 @@ exports.IxCardTitle = IxCardTitle;
|
|
|
446
585
|
exports.IxCategoryFilter = IxCategoryFilter;
|
|
447
586
|
exports.IxChip = IxChip;
|
|
448
587
|
exports.IxContentHeader = IxContentHeader;
|
|
449
|
-
exports.IxCounterPill = IxCounterPill;
|
|
450
588
|
exports.IxDatePicker = IxDatePicker;
|
|
451
589
|
exports.IxDatetimePicker = IxDatetimePicker;
|
|
452
590
|
exports.IxDivider = IxDivider;
|
|
453
591
|
exports.IxDrawer = IxDrawer;
|
|
454
592
|
exports.IxDropdown = IxDropdown;
|
|
455
593
|
exports.IxDropdownButton = IxDropdownButton;
|
|
594
|
+
exports.IxDropdownHeader = IxDropdownHeader;
|
|
456
595
|
exports.IxDropdownItem = IxDropdownItem;
|
|
457
596
|
exports.IxDropdownQuickActions = IxDropdownQuickActions;
|
|
458
597
|
exports.IxEmptyState = IxEmptyState;
|
|
@@ -464,7 +603,6 @@ exports.IxFlipTile = IxFlipTile;
|
|
|
464
603
|
exports.IxFlipTileContent = IxFlipTileContent;
|
|
465
604
|
exports.IxGroup = IxGroup;
|
|
466
605
|
exports.IxGroupContextMenu = IxGroupContextMenu;
|
|
467
|
-
exports.IxGroupDropdownItem = IxGroupDropdownItem;
|
|
468
606
|
exports.IxGroupItem = IxGroupItem;
|
|
469
607
|
exports.IxIcon = IxIcon;
|
|
470
608
|
exports.IxIconButton = IxIconButton;
|
|
@@ -472,6 +610,7 @@ exports.IxInputGroup = IxInputGroup;
|
|
|
472
610
|
exports.IxKeyValue = IxKeyValue;
|
|
473
611
|
exports.IxKeyValueList = IxKeyValueList;
|
|
474
612
|
exports.IxKpi = IxKpi;
|
|
613
|
+
exports.IxLinkButton = IxLinkButton;
|
|
475
614
|
exports.IxMapNavigation = IxMapNavigation;
|
|
476
615
|
exports.IxMapNavigationOverlay = IxMapNavigationOverlay;
|
|
477
616
|
exports.IxMenu = IxMenu;
|
|
@@ -480,13 +619,16 @@ exports.IxMenuAboutItem = IxMenuAboutItem;
|
|
|
480
619
|
exports.IxMenuAboutNews = IxMenuAboutNews;
|
|
481
620
|
exports.IxMenuAvatar = IxMenuAvatar;
|
|
482
621
|
exports.IxMenuAvatarItem = IxMenuAvatarItem;
|
|
622
|
+
exports.IxMenuCategory = IxMenuCategory;
|
|
483
623
|
exports.IxMenuItem = IxMenuItem;
|
|
484
624
|
exports.IxMenuSettings = IxMenuSettings;
|
|
485
625
|
exports.IxMenuSettingsItem = IxMenuSettingsItem;
|
|
486
626
|
exports.IxMessageBar = IxMessageBar;
|
|
487
627
|
exports.IxModal = IxModal;
|
|
488
|
-
exports.
|
|
628
|
+
exports.IxModalContent = IxModalContent;
|
|
489
629
|
exports.IxModalExample = IxModalExample;
|
|
630
|
+
exports.IxModalFooter = IxModalFooter;
|
|
631
|
+
exports.IxModalHeader = IxModalHeader;
|
|
490
632
|
exports.IxPagination = IxPagination;
|
|
491
633
|
exports.IxPill = IxPill;
|
|
492
634
|
exports.IxPushCard = IxPushCard;
|
|
@@ -4,6 +4,7 @@ export declare const IxActionCard: import("react").ForwardRefExoticComponent<JSX
|
|
|
4
4
|
export declare const IxAnimatedTab: import("react").ForwardRefExoticComponent<JSX.IxAnimatedTab & Omit<import("react").HTMLAttributes<HTMLIxAnimatedTabElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxAnimatedTabElement>>;
|
|
5
5
|
export declare const IxAnimatedTabs: import("react").ForwardRefExoticComponent<JSX.IxAnimatedTabs & Omit<import("react").HTMLAttributes<HTMLIxAnimatedTabsElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxAnimatedTabsElement>>;
|
|
6
6
|
export declare const IxApplicationHeader: import("react").ForwardRefExoticComponent<JSX.IxApplicationHeader & Omit<import("react").HTMLAttributes<HTMLIxApplicationHeaderElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxApplicationHeaderElement>>;
|
|
7
|
+
export declare const IxAvatar: import("react").ForwardRefExoticComponent<JSX.IxAvatar & Omit<import("react").HTMLAttributes<HTMLIxAvatarElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxAvatarElement>>;
|
|
7
8
|
export declare const IxBasicNavigation: import("react").ForwardRefExoticComponent<JSX.IxBasicNavigation & Omit<import("react").HTMLAttributes<HTMLIxBasicNavigationElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxBasicNavigationElement>>;
|
|
8
9
|
export declare const IxBlind: import("react").ForwardRefExoticComponent<JSX.IxBlind & Omit<import("react").HTMLAttributes<HTMLIxBlindElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxBlindElement>>;
|
|
9
10
|
export declare const IxBreadcrumb: import("react").ForwardRefExoticComponent<JSX.IxBreadcrumb & Omit<import("react").HTMLAttributes<HTMLIxBreadcrumbElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxBreadcrumbElement>>;
|
|
@@ -17,13 +18,13 @@ export declare const IxCardTitle: import("react").ForwardRefExoticComponent<JSX.
|
|
|
17
18
|
export declare const IxCategoryFilter: import("react").ForwardRefExoticComponent<JSX.IxCategoryFilter & Omit<import("react").HTMLAttributes<HTMLIxCategoryFilterElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxCategoryFilterElement>>;
|
|
18
19
|
export declare const IxChip: import("react").ForwardRefExoticComponent<JSX.IxChip & Omit<import("react").HTMLAttributes<HTMLIxChipElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxChipElement>>;
|
|
19
20
|
export declare const IxContentHeader: import("react").ForwardRefExoticComponent<JSX.IxContentHeader & Omit<import("react").HTMLAttributes<HTMLIxContentHeaderElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxContentHeaderElement>>;
|
|
20
|
-
export declare const IxCounterPill: import("react").ForwardRefExoticComponent<JSX.IxCounterPill & Omit<import("react").HTMLAttributes<HTMLIxCounterPillElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxCounterPillElement>>;
|
|
21
21
|
export declare const IxDatePicker: import("react").ForwardRefExoticComponent<JSX.IxDatePicker & Omit<import("react").HTMLAttributes<HTMLIxDatePickerElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxDatePickerElement>>;
|
|
22
22
|
export declare const IxDatetimePicker: import("react").ForwardRefExoticComponent<JSX.IxDatetimePicker & Omit<import("react").HTMLAttributes<HTMLIxDatetimePickerElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxDatetimePickerElement>>;
|
|
23
23
|
export declare const IxDivider: import("react").ForwardRefExoticComponent<JSX.IxDivider & Omit<import("react").HTMLAttributes<HTMLIxDividerElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxDividerElement>>;
|
|
24
24
|
export declare const IxDrawer: import("react").ForwardRefExoticComponent<JSX.IxDrawer & Omit<import("react").HTMLAttributes<HTMLIxDrawerElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxDrawerElement>>;
|
|
25
25
|
export declare const IxDropdown: import("react").ForwardRefExoticComponent<JSX.IxDropdown & Omit<import("react").HTMLAttributes<HTMLIxDropdownElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxDropdownElement>>;
|
|
26
26
|
export declare const IxDropdownButton: import("react").ForwardRefExoticComponent<JSX.IxDropdownButton & Omit<import("react").HTMLAttributes<HTMLIxDropdownButtonElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxDropdownButtonElement>>;
|
|
27
|
+
export declare const IxDropdownHeader: import("react").ForwardRefExoticComponent<JSX.IxDropdownHeader & Omit<import("react").HTMLAttributes<HTMLIxDropdownHeaderElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxDropdownHeaderElement>>;
|
|
27
28
|
export declare const IxDropdownItem: import("react").ForwardRefExoticComponent<JSX.IxDropdownItem & Omit<import("react").HTMLAttributes<HTMLIxDropdownItemElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxDropdownItemElement>>;
|
|
28
29
|
export declare const IxDropdownQuickActions: import("react").ForwardRefExoticComponent<JSX.IxDropdownQuickActions & Omit<import("react").HTMLAttributes<HTMLIxDropdownQuickActionsElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxDropdownQuickActionsElement>>;
|
|
29
30
|
export declare const IxEmptyState: import("react").ForwardRefExoticComponent<JSX.IxEmptyState & Omit<import("react").HTMLAttributes<HTMLIxEmptyStateElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxEmptyStateElement>>;
|
|
@@ -35,7 +36,6 @@ export declare const IxFlipTile: import("react").ForwardRefExoticComponent<JSX.I
|
|
|
35
36
|
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>>;
|
|
36
37
|
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>>;
|
|
37
38
|
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>>;
|
|
38
|
-
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>>;
|
|
39
39
|
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>>;
|
|
40
40
|
export declare const IxIcon: import("react").ForwardRefExoticComponent<import("@siemens/ix-icons/dist/types/components").JSX.IxIcon & Omit<import("react").HTMLAttributes<HTMLIxIconElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxIconElement>>;
|
|
41
41
|
export declare const IxIconButton: import("react").ForwardRefExoticComponent<JSX.IxIconButton & Omit<import("react").HTMLAttributes<HTMLIxIconButtonElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxIconButtonElement>>;
|
|
@@ -43,6 +43,7 @@ export declare const IxInputGroup: import("react").ForwardRefExoticComponent<JSX
|
|
|
43
43
|
export declare const IxKeyValue: import("react").ForwardRefExoticComponent<JSX.IxKeyValue & Omit<import("react").HTMLAttributes<HTMLIxKeyValueElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxKeyValueElement>>;
|
|
44
44
|
export declare const IxKeyValueList: import("react").ForwardRefExoticComponent<JSX.IxKeyValueList & Omit<import("react").HTMLAttributes<HTMLIxKeyValueListElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxKeyValueListElement>>;
|
|
45
45
|
export declare const IxKpi: import("react").ForwardRefExoticComponent<JSX.IxKpi & Omit<import("react").HTMLAttributes<HTMLIxKpiElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxKpiElement>>;
|
|
46
|
+
export declare const IxLinkButton: import("react").ForwardRefExoticComponent<JSX.IxLinkButton & Omit<import("react").HTMLAttributes<HTMLIxLinkButtonElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxLinkButtonElement>>;
|
|
46
47
|
export declare const IxMapNavigation: import("react").ForwardRefExoticComponent<JSX.IxMapNavigation & Omit<import("react").HTMLAttributes<HTMLIxMapNavigationElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxMapNavigationElement>>;
|
|
47
48
|
export declare const IxMapNavigationOverlay: import("react").ForwardRefExoticComponent<JSX.IxMapNavigationOverlay & Omit<import("react").HTMLAttributes<HTMLIxMapNavigationOverlayElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxMapNavigationOverlayElement>>;
|
|
48
49
|
export declare const IxMenu: import("react").ForwardRefExoticComponent<JSX.IxMenu & Omit<import("react").HTMLAttributes<HTMLIxMenuElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxMenuElement>>;
|
|
@@ -51,13 +52,16 @@ export declare const IxMenuAboutItem: import("react").ForwardRefExoticComponent<
|
|
|
51
52
|
export declare const IxMenuAboutNews: import("react").ForwardRefExoticComponent<JSX.IxMenuAboutNews & Omit<import("react").HTMLAttributes<HTMLIxMenuAboutNewsElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxMenuAboutNewsElement>>;
|
|
52
53
|
export declare const IxMenuAvatar: import("react").ForwardRefExoticComponent<JSX.IxMenuAvatar & Omit<import("react").HTMLAttributes<HTMLIxMenuAvatarElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxMenuAvatarElement>>;
|
|
53
54
|
export declare const IxMenuAvatarItem: import("react").ForwardRefExoticComponent<JSX.IxMenuAvatarItem & Omit<import("react").HTMLAttributes<HTMLIxMenuAvatarItemElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxMenuAvatarItemElement>>;
|
|
55
|
+
export declare const IxMenuCategory: import("react").ForwardRefExoticComponent<JSX.IxMenuCategory & Omit<import("react").HTMLAttributes<HTMLIxMenuCategoryElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxMenuCategoryElement>>;
|
|
54
56
|
export declare const IxMenuItem: import("react").ForwardRefExoticComponent<JSX.IxMenuItem & Omit<import("react").HTMLAttributes<HTMLIxMenuItemElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxMenuItemElement>>;
|
|
55
57
|
export declare const IxMenuSettings: import("react").ForwardRefExoticComponent<JSX.IxMenuSettings & Omit<import("react").HTMLAttributes<HTMLIxMenuSettingsElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxMenuSettingsElement>>;
|
|
56
58
|
export declare const IxMenuSettingsItem: import("react").ForwardRefExoticComponent<JSX.IxMenuSettingsItem & Omit<import("react").HTMLAttributes<HTMLIxMenuSettingsItemElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxMenuSettingsItemElement>>;
|
|
57
59
|
export declare const IxMessageBar: import("react").ForwardRefExoticComponent<JSX.IxMessageBar & Omit<import("react").HTMLAttributes<HTMLIxMessageBarElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxMessageBarElement>>;
|
|
58
60
|
export declare const IxModal: import("react").ForwardRefExoticComponent<JSX.IxModal & Omit<import("react").HTMLAttributes<HTMLIxModalElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxModalElement>>;
|
|
59
|
-
export declare const
|
|
61
|
+
export declare const IxModalContent: import("react").ForwardRefExoticComponent<JSX.IxModalContent & Omit<import("react").HTMLAttributes<HTMLIxModalContentElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxModalContentElement>>;
|
|
60
62
|
export declare const IxModalExample: import("react").ForwardRefExoticComponent<JSX.IxModalExample & Omit<import("react").HTMLAttributes<HTMLIxModalExampleElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxModalExampleElement>>;
|
|
63
|
+
export declare const IxModalFooter: import("react").ForwardRefExoticComponent<JSX.IxModalFooter & Omit<import("react").HTMLAttributes<HTMLIxModalFooterElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxModalFooterElement>>;
|
|
64
|
+
export declare const IxModalHeader: import("react").ForwardRefExoticComponent<JSX.IxModalHeader & Omit<import("react").HTMLAttributes<HTMLIxModalHeaderElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxModalHeaderElement>>;
|
|
61
65
|
export declare const IxPagination: import("react").ForwardRefExoticComponent<JSX.IxPagination & Omit<import("react").HTMLAttributes<HTMLIxPaginationElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxPaginationElement>>;
|
|
62
66
|
export declare const IxPill: import("react").ForwardRefExoticComponent<JSX.IxPill & Omit<import("react").HTMLAttributes<HTMLIxPillElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxPillElement>>;
|
|
63
67
|
export declare const IxPushCard: import("react").ForwardRefExoticComponent<JSX.IxPushCard & Omit<import("react").HTMLAttributes<HTMLIxPushCardElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxPushCardElement>>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React, { PropsWithChildren } from 'react';
|
|
2
|
+
export declare type IxApplicationContextProps = PropsWithChildren;
|
|
3
|
+
export declare class IxApplicationContext extends React.Component<IxApplicationContextProps> {
|
|
4
|
+
private delegate;
|
|
5
|
+
constructor(props: IxApplicationContextProps);
|
|
6
|
+
render(): JSX.Element;
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './context/application-context';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FrameworkDelegate } from '@siemens/ix';
|
|
2
|
+
export declare class ReactFrameworkDelegate implements FrameworkDelegate {
|
|
3
|
+
attachViewToPortal?: (id: string, view: any) => Promise<Element>;
|
|
4
|
+
removeViewFromPortal?: (id: string) => void;
|
|
5
|
+
attachView(view: any): Promise<any>;
|
|
6
|
+
removeView(view: any): Promise<void>;
|
|
7
|
+
}
|
|
8
|
+
export declare const reactFrameworkDelegate: ReactFrameworkDelegate;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
import { ModalConfig as IxModalConfig } from '@siemens/ix';
|
|
3
3
|
export * from './modal';
|
|
4
4
|
export declare type ModalConfig = {
|
|
5
|
-
content: React.ReactNode;
|
|
5
|
+
content: React.ReactNode | string;
|
|
6
6
|
};
|
|
7
|
-
export declare function showModal
|
|
7
|
+
export declare function showModal(config: Omit<IxModalConfig, 'content'> & ModalConfig): Promise<import("@siemens/ix").ModalInstance<any>>;
|
|
@@ -5,8 +5,5 @@ export interface ModalRef {
|
|
|
5
5
|
modalElement: HTMLIxModalElement | null;
|
|
6
6
|
}
|
|
7
7
|
export declare const Modal: React.ForwardRefExoticComponent<{
|
|
8
|
-
|
|
9
|
-
onDismiss?: (<T_1 = any>(result?: T_1 | undefined) => void) | undefined;
|
|
10
|
-
htmlElement?: HTMLElement | undefined;
|
|
11
|
-
children: React.ReactNode;
|
|
8
|
+
children?: React.ReactNode;
|
|
12
9
|
} & 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": "
|
|
10
|
+
"version": "2.0.0-beta.0",
|
|
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": "~
|
|
31
|
+
"@siemens/ix": "~2.0.0-beta.0",
|
|
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": "~
|
|
54
|
+
"@siemens/ix": "~2.0.0-beta.0",
|
|
55
55
|
"@siemens/ix-icons": "^1.1.0"
|
|
56
56
|
}
|
|
57
57
|
}
|