@siemens/ix-react 1.1.0-beta.2 → 1.1.0-beta.4
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 +399 -0
- package/dist/index.js +473 -0
- package/dist/types/components.d.ts +64 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/modal/index.d.ts +10 -0
- package/dist/types/modal/modal.d.ts +11 -0
- package/dist/types/react-component-lib/createComponent.d.ts +10 -0
- package/dist/types/react-component-lib/createOverlayComponent.d.ts +21 -0
- package/dist/types/react-component-lib/index.d.ts +2 -0
- package/dist/types/react-component-lib/interfaces.d.ts +29 -0
- package/dist/types/react-component-lib/utils/attachProps.d.ts +12 -0
- package/dist/types/react-component-lib/utils/case.d.ts +2 -0
- package/dist/types/react-component-lib/utils/dev.d.ts +2 -0
- package/dist/types/react-component-lib/utils/index.d.ts +10 -0
- package/dist/types/toast/index.d.ts +1 -0
- package/dist/types/toast/toast.d.ts +9 -0
- package/dist/types/tree/index.d.ts +1 -0
- package/dist/types/tree/tree.d.ts +6 -0
- package/package.json +3 -3
|
@@ -0,0 +1,399 @@
|
|
|
1
|
+
import React, { createElement, useRef, useImperativeHandle, useCallback } from 'react';
|
|
2
|
+
import 'react-dom';
|
|
3
|
+
import { defineCustomElements } from '@siemens/ix/loader';
|
|
4
|
+
import { closeModal, dismissModal, modal, toast } from '@siemens/ix';
|
|
5
|
+
import ReactDOMClient from 'react-dom/client';
|
|
6
|
+
|
|
7
|
+
/******************************************************************************
|
|
8
|
+
Copyright (c) Microsoft Corporation.
|
|
9
|
+
|
|
10
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
11
|
+
purpose with or without fee is hereby granted.
|
|
12
|
+
|
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
14
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
15
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
16
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
17
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
18
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
19
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
20
|
+
***************************************************************************** */
|
|
21
|
+
|
|
22
|
+
function __rest(s, e) {
|
|
23
|
+
var t = {};
|
|
24
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
25
|
+
t[p] = s[p];
|
|
26
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
27
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
28
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
29
|
+
t[p[i]] = s[p[i]];
|
|
30
|
+
}
|
|
31
|
+
return t;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const dashToPascalCase = (str) => str
|
|
35
|
+
.toLowerCase()
|
|
36
|
+
.split('-')
|
|
37
|
+
.map((segment) => segment.charAt(0).toUpperCase() + segment.slice(1))
|
|
38
|
+
.join('');
|
|
39
|
+
const camelToDashCase = (str) => str.replace(/([A-Z])/g, (m) => `-${m[0].toLowerCase()}`);
|
|
40
|
+
|
|
41
|
+
const attachProps = (node, newProps, oldProps = {}) => {
|
|
42
|
+
// some test frameworks don't render DOM elements, so we test here to make sure we are dealing with DOM first
|
|
43
|
+
if (node instanceof Element) {
|
|
44
|
+
// add any classes in className to the class list
|
|
45
|
+
const className = getClassName(node.classList, newProps, oldProps);
|
|
46
|
+
if (className !== '') {
|
|
47
|
+
node.className = className;
|
|
48
|
+
}
|
|
49
|
+
Object.keys(newProps).forEach((name) => {
|
|
50
|
+
if (name === 'children' ||
|
|
51
|
+
name === 'style' ||
|
|
52
|
+
name === 'ref' ||
|
|
53
|
+
name === 'class' ||
|
|
54
|
+
name === 'className' ||
|
|
55
|
+
name === 'forwardedRef') {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
if (name.indexOf('on') === 0 && name[2] === name[2].toUpperCase()) {
|
|
59
|
+
const eventName = name.substring(2);
|
|
60
|
+
const eventNameLc = eventName[0].toLowerCase() + eventName.substring(1);
|
|
61
|
+
if (!isCoveredByReact(eventNameLc)) {
|
|
62
|
+
syncEvent(node, eventNameLc, newProps[name]);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
node[name] = newProps[name];
|
|
67
|
+
const propType = typeof newProps[name];
|
|
68
|
+
if (propType === 'string') {
|
|
69
|
+
node.setAttribute(camelToDashCase(name), newProps[name]);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
const getClassName = (classList, newProps, oldProps) => {
|
|
76
|
+
const newClassProp = newProps.className || newProps.class;
|
|
77
|
+
const oldClassProp = oldProps.className || oldProps.class;
|
|
78
|
+
// map the classes to Maps for performance
|
|
79
|
+
const currentClasses = arrayToMap(classList);
|
|
80
|
+
const incomingPropClasses = arrayToMap(newClassProp ? newClassProp.split(' ') : []);
|
|
81
|
+
const oldPropClasses = arrayToMap(oldClassProp ? oldClassProp.split(' ') : []);
|
|
82
|
+
const finalClassNames = [];
|
|
83
|
+
// loop through each of the current classes on the component
|
|
84
|
+
// to see if it should be a part of the classNames added
|
|
85
|
+
currentClasses.forEach((currentClass) => {
|
|
86
|
+
if (incomingPropClasses.has(currentClass)) {
|
|
87
|
+
// add it as its already included in classnames coming in from newProps
|
|
88
|
+
finalClassNames.push(currentClass);
|
|
89
|
+
incomingPropClasses.delete(currentClass);
|
|
90
|
+
}
|
|
91
|
+
else if (!oldPropClasses.has(currentClass)) {
|
|
92
|
+
// add it as it has NOT been removed by user
|
|
93
|
+
finalClassNames.push(currentClass);
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
incomingPropClasses.forEach((s) => finalClassNames.push(s));
|
|
97
|
+
return finalClassNames.join(' ');
|
|
98
|
+
};
|
|
99
|
+
/**
|
|
100
|
+
* Checks if an event is supported in the current execution environment.
|
|
101
|
+
* @license Modernizr 3.0.0pre (Custom Build) | MIT
|
|
102
|
+
*/
|
|
103
|
+
const isCoveredByReact = (eventNameSuffix) => {
|
|
104
|
+
if (typeof document === 'undefined') {
|
|
105
|
+
return true;
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
const eventName = 'on' + eventNameSuffix;
|
|
109
|
+
let isSupported = eventName in document;
|
|
110
|
+
if (!isSupported) {
|
|
111
|
+
const element = document.createElement('div');
|
|
112
|
+
element.setAttribute(eventName, 'return;');
|
|
113
|
+
isSupported = typeof element[eventName] === 'function';
|
|
114
|
+
}
|
|
115
|
+
return isSupported;
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
const syncEvent = (node, eventName, newEventHandler) => {
|
|
119
|
+
const eventStore = node.__events || (node.__events = {});
|
|
120
|
+
const oldEventHandler = eventStore[eventName];
|
|
121
|
+
// Remove old listener so they don't double up.
|
|
122
|
+
if (oldEventHandler) {
|
|
123
|
+
node.removeEventListener(eventName, oldEventHandler);
|
|
124
|
+
}
|
|
125
|
+
// Bind new listener.
|
|
126
|
+
node.addEventListener(eventName, (eventStore[eventName] = function handler(e) {
|
|
127
|
+
if (newEventHandler) {
|
|
128
|
+
newEventHandler.call(this, e);
|
|
129
|
+
}
|
|
130
|
+
}));
|
|
131
|
+
};
|
|
132
|
+
const arrayToMap = (arr) => {
|
|
133
|
+
const map = new Map();
|
|
134
|
+
arr.forEach((s) => map.set(s, s));
|
|
135
|
+
return map;
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
const setRef = (ref, value) => {
|
|
139
|
+
if (typeof ref === 'function') {
|
|
140
|
+
ref(value);
|
|
141
|
+
}
|
|
142
|
+
else if (ref != null) {
|
|
143
|
+
// Cast as a MutableRef so we can assign current
|
|
144
|
+
ref.current = value;
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
const mergeRefs = (...refs) => {
|
|
148
|
+
return (value) => {
|
|
149
|
+
refs.forEach(ref => {
|
|
150
|
+
setRef(ref, value);
|
|
151
|
+
});
|
|
152
|
+
};
|
|
153
|
+
};
|
|
154
|
+
const createForwardRef = (ReactComponent, displayName) => {
|
|
155
|
+
const forwardRef = (props, ref) => {
|
|
156
|
+
return React.createElement(ReactComponent, Object.assign({}, props, { forwardedRef: ref }));
|
|
157
|
+
};
|
|
158
|
+
forwardRef.displayName = displayName;
|
|
159
|
+
return React.forwardRef(forwardRef);
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
const createReactComponent = (tagName, ReactComponentContext, manipulatePropsFunction, defineCustomElement) => {
|
|
163
|
+
if (defineCustomElement !== undefined) {
|
|
164
|
+
defineCustomElement();
|
|
165
|
+
}
|
|
166
|
+
const displayName = dashToPascalCase(tagName);
|
|
167
|
+
const ReactComponent = class extends React.Component {
|
|
168
|
+
constructor(props) {
|
|
169
|
+
super(props);
|
|
170
|
+
this.setComponentElRef = (element) => {
|
|
171
|
+
this.componentEl = element;
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
componentDidMount() {
|
|
175
|
+
this.componentDidUpdate(this.props);
|
|
176
|
+
}
|
|
177
|
+
componentDidUpdate(prevProps) {
|
|
178
|
+
attachProps(this.componentEl, this.props, prevProps);
|
|
179
|
+
}
|
|
180
|
+
render() {
|
|
181
|
+
const _a = this.props, { children, forwardedRef, style, className, ref } = _a, cProps = __rest(_a, ["children", "forwardedRef", "style", "className", "ref"]);
|
|
182
|
+
let propsToPass = Object.keys(cProps).reduce((acc, name) => {
|
|
183
|
+
const value = cProps[name];
|
|
184
|
+
if (name.indexOf('on') === 0 && name[2] === name[2].toUpperCase()) {
|
|
185
|
+
const eventName = name.substring(2).toLowerCase();
|
|
186
|
+
if (typeof document !== 'undefined' && isCoveredByReact(eventName)) {
|
|
187
|
+
acc[name] = value;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
else {
|
|
191
|
+
// we should only render strings, booleans, and numbers as attrs in html.
|
|
192
|
+
// objects, functions, arrays etc get synced via properties on mount.
|
|
193
|
+
const type = typeof value;
|
|
194
|
+
if (type === 'string' || type === 'boolean' || type === 'number') {
|
|
195
|
+
acc[camelToDashCase(name)] = value;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
return acc;
|
|
199
|
+
}, {});
|
|
200
|
+
if (manipulatePropsFunction) {
|
|
201
|
+
propsToPass = manipulatePropsFunction(this.props, propsToPass);
|
|
202
|
+
}
|
|
203
|
+
const newProps = Object.assign(Object.assign({}, propsToPass), { ref: mergeRefs(forwardedRef, this.setComponentElRef), style });
|
|
204
|
+
/**
|
|
205
|
+
* We use createElement here instead of
|
|
206
|
+
* React.createElement to work around a
|
|
207
|
+
* bug in Vite (https://github.com/vitejs/vite/issues/6104).
|
|
208
|
+
* React.createElement causes all elements to be rendered
|
|
209
|
+
* as <tagname> instead of the actual Web Component.
|
|
210
|
+
*/
|
|
211
|
+
return createElement(tagName, newProps, children);
|
|
212
|
+
}
|
|
213
|
+
static get displayName() {
|
|
214
|
+
return displayName;
|
|
215
|
+
}
|
|
216
|
+
};
|
|
217
|
+
// If context was passed to createReactComponent then conditionally add it to the Component Class
|
|
218
|
+
if (ReactComponentContext) {
|
|
219
|
+
ReactComponent.contextType = ReactComponentContext;
|
|
220
|
+
}
|
|
221
|
+
return createForwardRef(ReactComponent, displayName);
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
/* eslint-disable */
|
|
225
|
+
defineCustomElements();
|
|
226
|
+
const IxAnimatedTab = /*@__PURE__*/ createReactComponent('ix-animated-tab');
|
|
227
|
+
const IxAnimatedTabs = /*@__PURE__*/ createReactComponent('ix-animated-tabs');
|
|
228
|
+
const IxApplicationHeader = /*@__PURE__*/ createReactComponent('ix-application-header');
|
|
229
|
+
const IxBasicNavigation = /*@__PURE__*/ createReactComponent('ix-basic-navigation');
|
|
230
|
+
const IxBlind = /*@__PURE__*/ createReactComponent('ix-blind');
|
|
231
|
+
const IxBreadcrumb = /*@__PURE__*/ createReactComponent('ix-breadcrumb');
|
|
232
|
+
const IxBreadcrumbItem = /*@__PURE__*/ createReactComponent('ix-breadcrumb-item');
|
|
233
|
+
const IxButton = /*@__PURE__*/ createReactComponent('ix-button');
|
|
234
|
+
const IxCategoryFilter = /*@__PURE__*/ createReactComponent('ix-category-filter');
|
|
235
|
+
const IxChip = /*@__PURE__*/ createReactComponent('ix-chip');
|
|
236
|
+
const IxCounterPill = /*@__PURE__*/ createReactComponent('ix-counter-pill');
|
|
237
|
+
const IxDatePicker = /*@__PURE__*/ createReactComponent('ix-date-picker');
|
|
238
|
+
const IxDateTimeCard = /*@__PURE__*/ createReactComponent('ix-date-time-card');
|
|
239
|
+
const IxDatetimePicker = /*@__PURE__*/ createReactComponent('ix-datetime-picker');
|
|
240
|
+
const IxDrawer = /*@__PURE__*/ createReactComponent('ix-drawer');
|
|
241
|
+
const IxDropdown = /*@__PURE__*/ createReactComponent('ix-dropdown');
|
|
242
|
+
const IxDropdownItem = /*@__PURE__*/ createReactComponent('ix-dropdown-item');
|
|
243
|
+
const IxEventList = /*@__PURE__*/ createReactComponent('ix-event-list');
|
|
244
|
+
const IxEventListItem = /*@__PURE__*/ createReactComponent('ix-event-list-item');
|
|
245
|
+
const IxExpandingSearch = /*@__PURE__*/ createReactComponent('ix-expanding-search');
|
|
246
|
+
const IxFilterChip = /*@__PURE__*/ createReactComponent('ix-filter-chip');
|
|
247
|
+
const IxFlipTile = /*@__PURE__*/ createReactComponent('ix-flip-tile');
|
|
248
|
+
const IxFlipTileContent = /*@__PURE__*/ createReactComponent('ix-flip-tile-content');
|
|
249
|
+
const IxGroup = /*@__PURE__*/ createReactComponent('ix-group');
|
|
250
|
+
const IxGroupDropdownItem = /*@__PURE__*/ createReactComponent('ix-group-dropdown-item');
|
|
251
|
+
const IxGroupItem = /*@__PURE__*/ createReactComponent('ix-group-item');
|
|
252
|
+
const IxIcon = /*@__PURE__*/ createReactComponent('ix-icon');
|
|
253
|
+
const IxIconButton = /*@__PURE__*/ createReactComponent('ix-icon-button');
|
|
254
|
+
const IxInputGroup = /*@__PURE__*/ createReactComponent('ix-input-group');
|
|
255
|
+
const IxKpi = /*@__PURE__*/ createReactComponent('ix-kpi');
|
|
256
|
+
const IxMapNavigation = /*@__PURE__*/ createReactComponent('ix-map-navigation');
|
|
257
|
+
const IxMapNavigationOverlay = /*@__PURE__*/ createReactComponent('ix-map-navigation-overlay');
|
|
258
|
+
const IxMenu = /*@__PURE__*/ createReactComponent('ix-menu');
|
|
259
|
+
const IxMenuAbout = /*@__PURE__*/ createReactComponent('ix-menu-about');
|
|
260
|
+
const IxMenuAboutItem = /*@__PURE__*/ createReactComponent('ix-menu-about-item');
|
|
261
|
+
const IxMenuAboutNews = /*@__PURE__*/ createReactComponent('ix-menu-about-news');
|
|
262
|
+
const IxMenuAvatar = /*@__PURE__*/ createReactComponent('ix-menu-avatar');
|
|
263
|
+
const IxMenuAvatarItem = /*@__PURE__*/ createReactComponent('ix-menu-avatar-item');
|
|
264
|
+
const IxMenuItem = /*@__PURE__*/ createReactComponent('ix-menu-item');
|
|
265
|
+
const IxMenuSettings = /*@__PURE__*/ createReactComponent('ix-menu-settings');
|
|
266
|
+
const IxMenuSettingsItem = /*@__PURE__*/ createReactComponent('ix-menu-settings-item');
|
|
267
|
+
const IxMessageBar = /*@__PURE__*/ createReactComponent('ix-message-bar');
|
|
268
|
+
const IxModal = /*@__PURE__*/ createReactComponent('ix-modal');
|
|
269
|
+
const IxModalContainer = /*@__PURE__*/ createReactComponent('ix-modal-container');
|
|
270
|
+
const IxModalExample = /*@__PURE__*/ createReactComponent('ix-modal-example');
|
|
271
|
+
const IxPill = /*@__PURE__*/ createReactComponent('ix-pill');
|
|
272
|
+
const IxSelect = /*@__PURE__*/ createReactComponent('ix-select');
|
|
273
|
+
const IxSelectItem = /*@__PURE__*/ createReactComponent('ix-select-item');
|
|
274
|
+
const IxSpinner = /*@__PURE__*/ createReactComponent('ix-spinner');
|
|
275
|
+
const IxSplitButton = /*@__PURE__*/ createReactComponent('ix-split-button');
|
|
276
|
+
const IxSplitButtonItem = /*@__PURE__*/ createReactComponent('ix-split-button-item');
|
|
277
|
+
const IxTabItem = /*@__PURE__*/ createReactComponent('ix-tab-item');
|
|
278
|
+
const IxTabs = /*@__PURE__*/ createReactComponent('ix-tabs');
|
|
279
|
+
const IxTile = /*@__PURE__*/ createReactComponent('ix-tile');
|
|
280
|
+
const IxTimePicker = /*@__PURE__*/ createReactComponent('ix-time-picker');
|
|
281
|
+
const IxToast = /*@__PURE__*/ createReactComponent('ix-toast');
|
|
282
|
+
const IxToastContainer = /*@__PURE__*/ createReactComponent('ix-toast-container');
|
|
283
|
+
const IxToggle = /*@__PURE__*/ createReactComponent('ix-toggle');
|
|
284
|
+
const IxUpload = /*@__PURE__*/ createReactComponent('ix-upload');
|
|
285
|
+
const IxValidationTooltip = /*@__PURE__*/ createReactComponent('ix-validation-tooltip');
|
|
286
|
+
const IxWorkflowStep = /*@__PURE__*/ createReactComponent('ix-workflow-step');
|
|
287
|
+
const IxWorkflowSteps = /*@__PURE__*/ createReactComponent('ix-workflow-steps');
|
|
288
|
+
|
|
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
|
+
*/
|
|
297
|
+
const Modal = React.forwardRef((props, ref) => {
|
|
298
|
+
const modalRef = useRef(null);
|
|
299
|
+
useImperativeHandle(ref, () => ({
|
|
300
|
+
close: (result) => {
|
|
301
|
+
closeModal(modalRef.current, result);
|
|
302
|
+
},
|
|
303
|
+
dismiss: (result) => {
|
|
304
|
+
dismissModal(modalRef.current, result);
|
|
305
|
+
},
|
|
306
|
+
}));
|
|
307
|
+
return React.createElement("div", { ref: modalRef }, props.children);
|
|
308
|
+
});
|
|
309
|
+
|
|
310
|
+
/*
|
|
311
|
+
* SPDX-FileCopyrightText: 2022 Siemens AG
|
|
312
|
+
*
|
|
313
|
+
* SPDX-License-Identifier: MIT
|
|
314
|
+
*
|
|
315
|
+
* This source code is licensed under the MIT license found in the
|
|
316
|
+
* LICENSE file in the root directory of this source tree.
|
|
317
|
+
*/
|
|
318
|
+
async function showModal(config) {
|
|
319
|
+
if (typeof config.content === 'string') {
|
|
320
|
+
return modal(config);
|
|
321
|
+
}
|
|
322
|
+
const container = document.createElement('DIV');
|
|
323
|
+
const root = ReactDOMClient.createRoot(container);
|
|
324
|
+
root.render(config.content);
|
|
325
|
+
const modalInstance = await modal(Object.assign(Object.assign({}, config), { content: container }));
|
|
326
|
+
modalInstance.onClose.once(() => {
|
|
327
|
+
root.unmount();
|
|
328
|
+
});
|
|
329
|
+
modalInstance.onDismiss.once(() => {
|
|
330
|
+
root.unmount();
|
|
331
|
+
});
|
|
332
|
+
return modalInstance;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
/*
|
|
336
|
+
* SPDX-FileCopyrightText: 2022 Siemens AG
|
|
337
|
+
*
|
|
338
|
+
* SPDX-License-Identifier: MIT
|
|
339
|
+
*
|
|
340
|
+
* This source code is licensed under the MIT license found in the
|
|
341
|
+
* LICENSE file in the root directory of this source tree.
|
|
342
|
+
*/
|
|
343
|
+
async function showToast(config) {
|
|
344
|
+
if (typeof config.message === 'string') {
|
|
345
|
+
const toastInstance = await toast(config);
|
|
346
|
+
return toastInstance;
|
|
347
|
+
}
|
|
348
|
+
const node = config.message;
|
|
349
|
+
const toastContainer = document.createElement('DIV');
|
|
350
|
+
const root = ReactDOMClient.createRoot(toastContainer);
|
|
351
|
+
root.render(node);
|
|
352
|
+
const toastInstance = await toast(Object.assign(Object.assign({}, config), { message: toastContainer }));
|
|
353
|
+
toastInstance.onClose.once(() => {
|
|
354
|
+
root.unmount();
|
|
355
|
+
});
|
|
356
|
+
return toastInstance;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
/*
|
|
360
|
+
* SPDX-FileCopyrightText: 2022 Siemens AG
|
|
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
|
+
*/
|
|
367
|
+
const InternalIxTree = /*@__PURE__*/ createReactComponent('ix-tree');
|
|
368
|
+
const IxTree = (props) => {
|
|
369
|
+
const cachedRootNodes = useRef(new Map());
|
|
370
|
+
const renderItem = useCallback((_, data, __, context, update) => {
|
|
371
|
+
const treeItem = document.createElement('ix-tree-item');
|
|
372
|
+
treeItem.hasChildren = data.hasChildren;
|
|
373
|
+
treeItem.context = context[data.id];
|
|
374
|
+
update((itemData, context) => {
|
|
375
|
+
treeItem.context = context[itemData.id];
|
|
376
|
+
treeItem.hasChildren = itemData.hasChildren;
|
|
377
|
+
});
|
|
378
|
+
const container = document.createElement('DIV');
|
|
379
|
+
const rootNode = ReactDOMClient.createRoot(container);
|
|
380
|
+
if (props.renderItem) {
|
|
381
|
+
rootNode.render(props.renderItem(data.data));
|
|
382
|
+
}
|
|
383
|
+
treeItem.appendChild(container);
|
|
384
|
+
cachedRootNodes.current.set(treeItem, rootNode);
|
|
385
|
+
return treeItem;
|
|
386
|
+
}, []);
|
|
387
|
+
return (React.createElement(InternalIxTree, Object.assign({}, props, { renderItem: props.renderItem ? renderItem : undefined, onNodeRemoved: (removed) => {
|
|
388
|
+
const { detail } = removed;
|
|
389
|
+
detail.forEach((removedItemElement) => {
|
|
390
|
+
var _a;
|
|
391
|
+
if (cachedRootNodes.current.has(removedItemElement)) {
|
|
392
|
+
(_a = cachedRootNodes.current.get(removedItemElement)) === null || _a === void 0 ? void 0 : _a.unmount();
|
|
393
|
+
cachedRootNodes.current.delete(removedItemElement);
|
|
394
|
+
}
|
|
395
|
+
});
|
|
396
|
+
} })));
|
|
397
|
+
};
|
|
398
|
+
|
|
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 };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,473 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const React = require('react');
|
|
6
|
+
require('react-dom');
|
|
7
|
+
const loader = require('@siemens/ix/loader');
|
|
8
|
+
const ix = require('@siemens/ix');
|
|
9
|
+
const ReactDOMClient = require('react-dom/client');
|
|
10
|
+
|
|
11
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
12
|
+
|
|
13
|
+
const React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
14
|
+
const ReactDOMClient__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOMClient);
|
|
15
|
+
|
|
16
|
+
/******************************************************************************
|
|
17
|
+
Copyright (c) Microsoft Corporation.
|
|
18
|
+
|
|
19
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
20
|
+
purpose with or without fee is hereby granted.
|
|
21
|
+
|
|
22
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
23
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
24
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
25
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
26
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
27
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
28
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
29
|
+
***************************************************************************** */
|
|
30
|
+
|
|
31
|
+
function __rest(s, e) {
|
|
32
|
+
var t = {};
|
|
33
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
34
|
+
t[p] = s[p];
|
|
35
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
36
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
37
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
38
|
+
t[p[i]] = s[p[i]];
|
|
39
|
+
}
|
|
40
|
+
return t;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const dashToPascalCase = (str) => str
|
|
44
|
+
.toLowerCase()
|
|
45
|
+
.split('-')
|
|
46
|
+
.map((segment) => segment.charAt(0).toUpperCase() + segment.slice(1))
|
|
47
|
+
.join('');
|
|
48
|
+
const camelToDashCase = (str) => str.replace(/([A-Z])/g, (m) => `-${m[0].toLowerCase()}`);
|
|
49
|
+
|
|
50
|
+
const attachProps = (node, newProps, oldProps = {}) => {
|
|
51
|
+
// some test frameworks don't render DOM elements, so we test here to make sure we are dealing with DOM first
|
|
52
|
+
if (node instanceof Element) {
|
|
53
|
+
// add any classes in className to the class list
|
|
54
|
+
const className = getClassName(node.classList, newProps, oldProps);
|
|
55
|
+
if (className !== '') {
|
|
56
|
+
node.className = className;
|
|
57
|
+
}
|
|
58
|
+
Object.keys(newProps).forEach((name) => {
|
|
59
|
+
if (name === 'children' ||
|
|
60
|
+
name === 'style' ||
|
|
61
|
+
name === 'ref' ||
|
|
62
|
+
name === 'class' ||
|
|
63
|
+
name === 'className' ||
|
|
64
|
+
name === 'forwardedRef') {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
if (name.indexOf('on') === 0 && name[2] === name[2].toUpperCase()) {
|
|
68
|
+
const eventName = name.substring(2);
|
|
69
|
+
const eventNameLc = eventName[0].toLowerCase() + eventName.substring(1);
|
|
70
|
+
if (!isCoveredByReact(eventNameLc)) {
|
|
71
|
+
syncEvent(node, eventNameLc, newProps[name]);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
node[name] = newProps[name];
|
|
76
|
+
const propType = typeof newProps[name];
|
|
77
|
+
if (propType === 'string') {
|
|
78
|
+
node.setAttribute(camelToDashCase(name), newProps[name]);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
const getClassName = (classList, newProps, oldProps) => {
|
|
85
|
+
const newClassProp = newProps.className || newProps.class;
|
|
86
|
+
const oldClassProp = oldProps.className || oldProps.class;
|
|
87
|
+
// map the classes to Maps for performance
|
|
88
|
+
const currentClasses = arrayToMap(classList);
|
|
89
|
+
const incomingPropClasses = arrayToMap(newClassProp ? newClassProp.split(' ') : []);
|
|
90
|
+
const oldPropClasses = arrayToMap(oldClassProp ? oldClassProp.split(' ') : []);
|
|
91
|
+
const finalClassNames = [];
|
|
92
|
+
// loop through each of the current classes on the component
|
|
93
|
+
// to see if it should be a part of the classNames added
|
|
94
|
+
currentClasses.forEach((currentClass) => {
|
|
95
|
+
if (incomingPropClasses.has(currentClass)) {
|
|
96
|
+
// add it as its already included in classnames coming in from newProps
|
|
97
|
+
finalClassNames.push(currentClass);
|
|
98
|
+
incomingPropClasses.delete(currentClass);
|
|
99
|
+
}
|
|
100
|
+
else if (!oldPropClasses.has(currentClass)) {
|
|
101
|
+
// add it as it has NOT been removed by user
|
|
102
|
+
finalClassNames.push(currentClass);
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
incomingPropClasses.forEach((s) => finalClassNames.push(s));
|
|
106
|
+
return finalClassNames.join(' ');
|
|
107
|
+
};
|
|
108
|
+
/**
|
|
109
|
+
* Checks if an event is supported in the current execution environment.
|
|
110
|
+
* @license Modernizr 3.0.0pre (Custom Build) | MIT
|
|
111
|
+
*/
|
|
112
|
+
const isCoveredByReact = (eventNameSuffix) => {
|
|
113
|
+
if (typeof document === 'undefined') {
|
|
114
|
+
return true;
|
|
115
|
+
}
|
|
116
|
+
else {
|
|
117
|
+
const eventName = 'on' + eventNameSuffix;
|
|
118
|
+
let isSupported = eventName in document;
|
|
119
|
+
if (!isSupported) {
|
|
120
|
+
const element = document.createElement('div');
|
|
121
|
+
element.setAttribute(eventName, 'return;');
|
|
122
|
+
isSupported = typeof element[eventName] === 'function';
|
|
123
|
+
}
|
|
124
|
+
return isSupported;
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
const syncEvent = (node, eventName, newEventHandler) => {
|
|
128
|
+
const eventStore = node.__events || (node.__events = {});
|
|
129
|
+
const oldEventHandler = eventStore[eventName];
|
|
130
|
+
// Remove old listener so they don't double up.
|
|
131
|
+
if (oldEventHandler) {
|
|
132
|
+
node.removeEventListener(eventName, oldEventHandler);
|
|
133
|
+
}
|
|
134
|
+
// Bind new listener.
|
|
135
|
+
node.addEventListener(eventName, (eventStore[eventName] = function handler(e) {
|
|
136
|
+
if (newEventHandler) {
|
|
137
|
+
newEventHandler.call(this, e);
|
|
138
|
+
}
|
|
139
|
+
}));
|
|
140
|
+
};
|
|
141
|
+
const arrayToMap = (arr) => {
|
|
142
|
+
const map = new Map();
|
|
143
|
+
arr.forEach((s) => map.set(s, s));
|
|
144
|
+
return map;
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
const setRef = (ref, value) => {
|
|
148
|
+
if (typeof ref === 'function') {
|
|
149
|
+
ref(value);
|
|
150
|
+
}
|
|
151
|
+
else if (ref != null) {
|
|
152
|
+
// Cast as a MutableRef so we can assign current
|
|
153
|
+
ref.current = value;
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
const mergeRefs = (...refs) => {
|
|
157
|
+
return (value) => {
|
|
158
|
+
refs.forEach(ref => {
|
|
159
|
+
setRef(ref, value);
|
|
160
|
+
});
|
|
161
|
+
};
|
|
162
|
+
};
|
|
163
|
+
const createForwardRef = (ReactComponent, displayName) => {
|
|
164
|
+
const forwardRef = (props, ref) => {
|
|
165
|
+
return React__default["default"].createElement(ReactComponent, Object.assign({}, props, { forwardedRef: ref }));
|
|
166
|
+
};
|
|
167
|
+
forwardRef.displayName = displayName;
|
|
168
|
+
return React__default["default"].forwardRef(forwardRef);
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
const createReactComponent = (tagName, ReactComponentContext, manipulatePropsFunction, defineCustomElement) => {
|
|
172
|
+
if (defineCustomElement !== undefined) {
|
|
173
|
+
defineCustomElement();
|
|
174
|
+
}
|
|
175
|
+
const displayName = dashToPascalCase(tagName);
|
|
176
|
+
const ReactComponent = class extends React__default["default"].Component {
|
|
177
|
+
constructor(props) {
|
|
178
|
+
super(props);
|
|
179
|
+
this.setComponentElRef = (element) => {
|
|
180
|
+
this.componentEl = element;
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
componentDidMount() {
|
|
184
|
+
this.componentDidUpdate(this.props);
|
|
185
|
+
}
|
|
186
|
+
componentDidUpdate(prevProps) {
|
|
187
|
+
attachProps(this.componentEl, this.props, prevProps);
|
|
188
|
+
}
|
|
189
|
+
render() {
|
|
190
|
+
const _a = this.props, { children, forwardedRef, style, className, ref } = _a, cProps = __rest(_a, ["children", "forwardedRef", "style", "className", "ref"]);
|
|
191
|
+
let propsToPass = Object.keys(cProps).reduce((acc, name) => {
|
|
192
|
+
const value = cProps[name];
|
|
193
|
+
if (name.indexOf('on') === 0 && name[2] === name[2].toUpperCase()) {
|
|
194
|
+
const eventName = name.substring(2).toLowerCase();
|
|
195
|
+
if (typeof document !== 'undefined' && isCoveredByReact(eventName)) {
|
|
196
|
+
acc[name] = value;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
else {
|
|
200
|
+
// we should only render strings, booleans, and numbers as attrs in html.
|
|
201
|
+
// objects, functions, arrays etc get synced via properties on mount.
|
|
202
|
+
const type = typeof value;
|
|
203
|
+
if (type === 'string' || type === 'boolean' || type === 'number') {
|
|
204
|
+
acc[camelToDashCase(name)] = value;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
return acc;
|
|
208
|
+
}, {});
|
|
209
|
+
if (manipulatePropsFunction) {
|
|
210
|
+
propsToPass = manipulatePropsFunction(this.props, propsToPass);
|
|
211
|
+
}
|
|
212
|
+
const newProps = Object.assign(Object.assign({}, propsToPass), { ref: mergeRefs(forwardedRef, this.setComponentElRef), style });
|
|
213
|
+
/**
|
|
214
|
+
* We use createElement here instead of
|
|
215
|
+
* React.createElement to work around a
|
|
216
|
+
* bug in Vite (https://github.com/vitejs/vite/issues/6104).
|
|
217
|
+
* React.createElement causes all elements to be rendered
|
|
218
|
+
* as <tagname> instead of the actual Web Component.
|
|
219
|
+
*/
|
|
220
|
+
return React.createElement(tagName, newProps, children);
|
|
221
|
+
}
|
|
222
|
+
static get displayName() {
|
|
223
|
+
return displayName;
|
|
224
|
+
}
|
|
225
|
+
};
|
|
226
|
+
// If context was passed to createReactComponent then conditionally add it to the Component Class
|
|
227
|
+
if (ReactComponentContext) {
|
|
228
|
+
ReactComponent.contextType = ReactComponentContext;
|
|
229
|
+
}
|
|
230
|
+
return createForwardRef(ReactComponent, displayName);
|
|
231
|
+
};
|
|
232
|
+
|
|
233
|
+
/* eslint-disable */
|
|
234
|
+
loader.defineCustomElements();
|
|
235
|
+
const IxAnimatedTab = /*@__PURE__*/ createReactComponent('ix-animated-tab');
|
|
236
|
+
const IxAnimatedTabs = /*@__PURE__*/ createReactComponent('ix-animated-tabs');
|
|
237
|
+
const IxApplicationHeader = /*@__PURE__*/ createReactComponent('ix-application-header');
|
|
238
|
+
const IxBasicNavigation = /*@__PURE__*/ createReactComponent('ix-basic-navigation');
|
|
239
|
+
const IxBlind = /*@__PURE__*/ createReactComponent('ix-blind');
|
|
240
|
+
const IxBreadcrumb = /*@__PURE__*/ createReactComponent('ix-breadcrumb');
|
|
241
|
+
const IxBreadcrumbItem = /*@__PURE__*/ createReactComponent('ix-breadcrumb-item');
|
|
242
|
+
const IxButton = /*@__PURE__*/ createReactComponent('ix-button');
|
|
243
|
+
const IxCategoryFilter = /*@__PURE__*/ createReactComponent('ix-category-filter');
|
|
244
|
+
const IxChip = /*@__PURE__*/ createReactComponent('ix-chip');
|
|
245
|
+
const IxCounterPill = /*@__PURE__*/ createReactComponent('ix-counter-pill');
|
|
246
|
+
const IxDatePicker = /*@__PURE__*/ createReactComponent('ix-date-picker');
|
|
247
|
+
const IxDateTimeCard = /*@__PURE__*/ createReactComponent('ix-date-time-card');
|
|
248
|
+
const IxDatetimePicker = /*@__PURE__*/ createReactComponent('ix-datetime-picker');
|
|
249
|
+
const IxDrawer = /*@__PURE__*/ createReactComponent('ix-drawer');
|
|
250
|
+
const IxDropdown = /*@__PURE__*/ createReactComponent('ix-dropdown');
|
|
251
|
+
const IxDropdownItem = /*@__PURE__*/ createReactComponent('ix-dropdown-item');
|
|
252
|
+
const IxEventList = /*@__PURE__*/ createReactComponent('ix-event-list');
|
|
253
|
+
const IxEventListItem = /*@__PURE__*/ createReactComponent('ix-event-list-item');
|
|
254
|
+
const IxExpandingSearch = /*@__PURE__*/ createReactComponent('ix-expanding-search');
|
|
255
|
+
const IxFilterChip = /*@__PURE__*/ createReactComponent('ix-filter-chip');
|
|
256
|
+
const IxFlipTile = /*@__PURE__*/ createReactComponent('ix-flip-tile');
|
|
257
|
+
const IxFlipTileContent = /*@__PURE__*/ createReactComponent('ix-flip-tile-content');
|
|
258
|
+
const IxGroup = /*@__PURE__*/ createReactComponent('ix-group');
|
|
259
|
+
const IxGroupDropdownItem = /*@__PURE__*/ createReactComponent('ix-group-dropdown-item');
|
|
260
|
+
const IxGroupItem = /*@__PURE__*/ createReactComponent('ix-group-item');
|
|
261
|
+
const IxIcon = /*@__PURE__*/ createReactComponent('ix-icon');
|
|
262
|
+
const IxIconButton = /*@__PURE__*/ createReactComponent('ix-icon-button');
|
|
263
|
+
const IxInputGroup = /*@__PURE__*/ createReactComponent('ix-input-group');
|
|
264
|
+
const IxKpi = /*@__PURE__*/ createReactComponent('ix-kpi');
|
|
265
|
+
const IxMapNavigation = /*@__PURE__*/ createReactComponent('ix-map-navigation');
|
|
266
|
+
const IxMapNavigationOverlay = /*@__PURE__*/ createReactComponent('ix-map-navigation-overlay');
|
|
267
|
+
const IxMenu = /*@__PURE__*/ createReactComponent('ix-menu');
|
|
268
|
+
const IxMenuAbout = /*@__PURE__*/ createReactComponent('ix-menu-about');
|
|
269
|
+
const IxMenuAboutItem = /*@__PURE__*/ createReactComponent('ix-menu-about-item');
|
|
270
|
+
const IxMenuAboutNews = /*@__PURE__*/ createReactComponent('ix-menu-about-news');
|
|
271
|
+
const IxMenuAvatar = /*@__PURE__*/ createReactComponent('ix-menu-avatar');
|
|
272
|
+
const IxMenuAvatarItem = /*@__PURE__*/ createReactComponent('ix-menu-avatar-item');
|
|
273
|
+
const IxMenuItem = /*@__PURE__*/ createReactComponent('ix-menu-item');
|
|
274
|
+
const IxMenuSettings = /*@__PURE__*/ createReactComponent('ix-menu-settings');
|
|
275
|
+
const IxMenuSettingsItem = /*@__PURE__*/ createReactComponent('ix-menu-settings-item');
|
|
276
|
+
const IxMessageBar = /*@__PURE__*/ createReactComponent('ix-message-bar');
|
|
277
|
+
const IxModal = /*@__PURE__*/ createReactComponent('ix-modal');
|
|
278
|
+
const IxModalContainer = /*@__PURE__*/ createReactComponent('ix-modal-container');
|
|
279
|
+
const IxModalExample = /*@__PURE__*/ createReactComponent('ix-modal-example');
|
|
280
|
+
const IxPill = /*@__PURE__*/ createReactComponent('ix-pill');
|
|
281
|
+
const IxSelect = /*@__PURE__*/ createReactComponent('ix-select');
|
|
282
|
+
const IxSelectItem = /*@__PURE__*/ createReactComponent('ix-select-item');
|
|
283
|
+
const IxSpinner = /*@__PURE__*/ createReactComponent('ix-spinner');
|
|
284
|
+
const IxSplitButton = /*@__PURE__*/ createReactComponent('ix-split-button');
|
|
285
|
+
const IxSplitButtonItem = /*@__PURE__*/ createReactComponent('ix-split-button-item');
|
|
286
|
+
const IxTabItem = /*@__PURE__*/ createReactComponent('ix-tab-item');
|
|
287
|
+
const IxTabs = /*@__PURE__*/ createReactComponent('ix-tabs');
|
|
288
|
+
const IxTile = /*@__PURE__*/ createReactComponent('ix-tile');
|
|
289
|
+
const IxTimePicker = /*@__PURE__*/ createReactComponent('ix-time-picker');
|
|
290
|
+
const IxToast = /*@__PURE__*/ createReactComponent('ix-toast');
|
|
291
|
+
const IxToastContainer = /*@__PURE__*/ createReactComponent('ix-toast-container');
|
|
292
|
+
const IxToggle = /*@__PURE__*/ createReactComponent('ix-toggle');
|
|
293
|
+
const IxUpload = /*@__PURE__*/ createReactComponent('ix-upload');
|
|
294
|
+
const IxValidationTooltip = /*@__PURE__*/ createReactComponent('ix-validation-tooltip');
|
|
295
|
+
const IxWorkflowStep = /*@__PURE__*/ createReactComponent('ix-workflow-step');
|
|
296
|
+
const IxWorkflowSteps = /*@__PURE__*/ createReactComponent('ix-workflow-steps');
|
|
297
|
+
|
|
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
|
+
*/
|
|
306
|
+
const Modal = React__default["default"].forwardRef((props, ref) => {
|
|
307
|
+
const modalRef = React.useRef(null);
|
|
308
|
+
React.useImperativeHandle(ref, () => ({
|
|
309
|
+
close: (result) => {
|
|
310
|
+
ix.closeModal(modalRef.current, result);
|
|
311
|
+
},
|
|
312
|
+
dismiss: (result) => {
|
|
313
|
+
ix.dismissModal(modalRef.current, result);
|
|
314
|
+
},
|
|
315
|
+
}));
|
|
316
|
+
return React__default["default"].createElement("div", { ref: modalRef }, props.children);
|
|
317
|
+
});
|
|
318
|
+
|
|
319
|
+
/*
|
|
320
|
+
* SPDX-FileCopyrightText: 2022 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
|
+
async function showModal(config) {
|
|
328
|
+
if (typeof config.content === 'string') {
|
|
329
|
+
return ix.modal(config);
|
|
330
|
+
}
|
|
331
|
+
const container = document.createElement('DIV');
|
|
332
|
+
const root = ReactDOMClient__default["default"].createRoot(container);
|
|
333
|
+
root.render(config.content);
|
|
334
|
+
const modalInstance = await ix.modal(Object.assign(Object.assign({}, config), { content: container }));
|
|
335
|
+
modalInstance.onClose.once(() => {
|
|
336
|
+
root.unmount();
|
|
337
|
+
});
|
|
338
|
+
modalInstance.onDismiss.once(() => {
|
|
339
|
+
root.unmount();
|
|
340
|
+
});
|
|
341
|
+
return modalInstance;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
/*
|
|
345
|
+
* SPDX-FileCopyrightText: 2022 Siemens AG
|
|
346
|
+
*
|
|
347
|
+
* SPDX-License-Identifier: MIT
|
|
348
|
+
*
|
|
349
|
+
* This source code is licensed under the MIT license found in the
|
|
350
|
+
* LICENSE file in the root directory of this source tree.
|
|
351
|
+
*/
|
|
352
|
+
async function showToast(config) {
|
|
353
|
+
if (typeof config.message === 'string') {
|
|
354
|
+
const toastInstance = await ix.toast(config);
|
|
355
|
+
return toastInstance;
|
|
356
|
+
}
|
|
357
|
+
const node = config.message;
|
|
358
|
+
const toastContainer = document.createElement('DIV');
|
|
359
|
+
const root = ReactDOMClient__default["default"].createRoot(toastContainer);
|
|
360
|
+
root.render(node);
|
|
361
|
+
const toastInstance = await ix.toast(Object.assign(Object.assign({}, config), { message: toastContainer }));
|
|
362
|
+
toastInstance.onClose.once(() => {
|
|
363
|
+
root.unmount();
|
|
364
|
+
});
|
|
365
|
+
return toastInstance;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
/*
|
|
369
|
+
* SPDX-FileCopyrightText: 2022 Siemens AG
|
|
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
|
+
*/
|
|
376
|
+
const InternalIxTree = /*@__PURE__*/ createReactComponent('ix-tree');
|
|
377
|
+
const IxTree = (props) => {
|
|
378
|
+
const cachedRootNodes = React.useRef(new Map());
|
|
379
|
+
const renderItem = React.useCallback((_, data, __, context, update) => {
|
|
380
|
+
const treeItem = document.createElement('ix-tree-item');
|
|
381
|
+
treeItem.hasChildren = data.hasChildren;
|
|
382
|
+
treeItem.context = context[data.id];
|
|
383
|
+
update((itemData, context) => {
|
|
384
|
+
treeItem.context = context[itemData.id];
|
|
385
|
+
treeItem.hasChildren = itemData.hasChildren;
|
|
386
|
+
});
|
|
387
|
+
const container = document.createElement('DIV');
|
|
388
|
+
const rootNode = ReactDOMClient__default["default"].createRoot(container);
|
|
389
|
+
if (props.renderItem) {
|
|
390
|
+
rootNode.render(props.renderItem(data.data));
|
|
391
|
+
}
|
|
392
|
+
treeItem.appendChild(container);
|
|
393
|
+
cachedRootNodes.current.set(treeItem, rootNode);
|
|
394
|
+
return treeItem;
|
|
395
|
+
}, []);
|
|
396
|
+
return (React__default["default"].createElement(InternalIxTree, Object.assign({}, props, { renderItem: props.renderItem ? renderItem : undefined, onNodeRemoved: (removed) => {
|
|
397
|
+
const { detail } = removed;
|
|
398
|
+
detail.forEach((removedItemElement) => {
|
|
399
|
+
var _a;
|
|
400
|
+
if (cachedRootNodes.current.has(removedItemElement)) {
|
|
401
|
+
(_a = cachedRootNodes.current.get(removedItemElement)) === null || _a === void 0 ? void 0 : _a.unmount();
|
|
402
|
+
cachedRootNodes.current.delete(removedItemElement);
|
|
403
|
+
}
|
|
404
|
+
});
|
|
405
|
+
} })));
|
|
406
|
+
};
|
|
407
|
+
|
|
408
|
+
exports.IxAnimatedTab = IxAnimatedTab;
|
|
409
|
+
exports.IxAnimatedTabs = IxAnimatedTabs;
|
|
410
|
+
exports.IxApplicationHeader = IxApplicationHeader;
|
|
411
|
+
exports.IxBasicNavigation = IxBasicNavigation;
|
|
412
|
+
exports.IxBlind = IxBlind;
|
|
413
|
+
exports.IxBreadcrumb = IxBreadcrumb;
|
|
414
|
+
exports.IxBreadcrumbItem = IxBreadcrumbItem;
|
|
415
|
+
exports.IxButton = IxButton;
|
|
416
|
+
exports.IxCategoryFilter = IxCategoryFilter;
|
|
417
|
+
exports.IxChip = IxChip;
|
|
418
|
+
exports.IxCounterPill = IxCounterPill;
|
|
419
|
+
exports.IxDatePicker = IxDatePicker;
|
|
420
|
+
exports.IxDateTimeCard = IxDateTimeCard;
|
|
421
|
+
exports.IxDatetimePicker = IxDatetimePicker;
|
|
422
|
+
exports.IxDrawer = IxDrawer;
|
|
423
|
+
exports.IxDropdown = IxDropdown;
|
|
424
|
+
exports.IxDropdownItem = IxDropdownItem;
|
|
425
|
+
exports.IxEventList = IxEventList;
|
|
426
|
+
exports.IxEventListItem = IxEventListItem;
|
|
427
|
+
exports.IxExpandingSearch = IxExpandingSearch;
|
|
428
|
+
exports.IxFilterChip = IxFilterChip;
|
|
429
|
+
exports.IxFlipTile = IxFlipTile;
|
|
430
|
+
exports.IxFlipTileContent = IxFlipTileContent;
|
|
431
|
+
exports.IxGroup = IxGroup;
|
|
432
|
+
exports.IxGroupDropdownItem = IxGroupDropdownItem;
|
|
433
|
+
exports.IxGroupItem = IxGroupItem;
|
|
434
|
+
exports.IxIcon = IxIcon;
|
|
435
|
+
exports.IxIconButton = IxIconButton;
|
|
436
|
+
exports.IxInputGroup = IxInputGroup;
|
|
437
|
+
exports.IxKpi = IxKpi;
|
|
438
|
+
exports.IxMapNavigation = IxMapNavigation;
|
|
439
|
+
exports.IxMapNavigationOverlay = IxMapNavigationOverlay;
|
|
440
|
+
exports.IxMenu = IxMenu;
|
|
441
|
+
exports.IxMenuAbout = IxMenuAbout;
|
|
442
|
+
exports.IxMenuAboutItem = IxMenuAboutItem;
|
|
443
|
+
exports.IxMenuAboutNews = IxMenuAboutNews;
|
|
444
|
+
exports.IxMenuAvatar = IxMenuAvatar;
|
|
445
|
+
exports.IxMenuAvatarItem = IxMenuAvatarItem;
|
|
446
|
+
exports.IxMenuItem = IxMenuItem;
|
|
447
|
+
exports.IxMenuSettings = IxMenuSettings;
|
|
448
|
+
exports.IxMenuSettingsItem = IxMenuSettingsItem;
|
|
449
|
+
exports.IxMessageBar = IxMessageBar;
|
|
450
|
+
exports.IxModal = IxModal;
|
|
451
|
+
exports.IxModalContainer = IxModalContainer;
|
|
452
|
+
exports.IxModalExample = IxModalExample;
|
|
453
|
+
exports.IxPill = IxPill;
|
|
454
|
+
exports.IxSelect = IxSelect;
|
|
455
|
+
exports.IxSelectItem = IxSelectItem;
|
|
456
|
+
exports.IxSpinner = IxSpinner;
|
|
457
|
+
exports.IxSplitButton = IxSplitButton;
|
|
458
|
+
exports.IxSplitButtonItem = IxSplitButtonItem;
|
|
459
|
+
exports.IxTabItem = IxTabItem;
|
|
460
|
+
exports.IxTabs = IxTabs;
|
|
461
|
+
exports.IxTile = IxTile;
|
|
462
|
+
exports.IxTimePicker = IxTimePicker;
|
|
463
|
+
exports.IxToast = IxToast;
|
|
464
|
+
exports.IxToastContainer = IxToastContainer;
|
|
465
|
+
exports.IxToggle = IxToggle;
|
|
466
|
+
exports.IxTree = IxTree;
|
|
467
|
+
exports.IxUpload = IxUpload;
|
|
468
|
+
exports.IxValidationTooltip = IxValidationTooltip;
|
|
469
|
+
exports.IxWorkflowStep = IxWorkflowStep;
|
|
470
|
+
exports.IxWorkflowSteps = IxWorkflowSteps;
|
|
471
|
+
exports.Modal = Modal;
|
|
472
|
+
exports.showModal = showModal;
|
|
473
|
+
exports.showToast = showToast;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { JSX } from '@siemens/ix';
|
|
3
|
+
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>>;
|
|
4
|
+
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>>;
|
|
5
|
+
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>>;
|
|
6
|
+
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>>;
|
|
7
|
+
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>>;
|
|
8
|
+
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>>;
|
|
9
|
+
export declare const IxBreadcrumbItem: import("react").ForwardRefExoticComponent<JSX.IxBreadcrumbItem & Omit<import("react").HTMLAttributes<HTMLIxBreadcrumbItemElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxBreadcrumbItemElement>>;
|
|
10
|
+
export declare const IxButton: import("react").ForwardRefExoticComponent<JSX.IxButton & Omit<import("react").HTMLAttributes<HTMLIxButtonElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxButtonElement>>;
|
|
11
|
+
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>>;
|
|
12
|
+
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>>;
|
|
13
|
+
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>>;
|
|
14
|
+
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>>;
|
|
15
|
+
export declare const IxDateTimeCard: import("react").ForwardRefExoticComponent<JSX.IxDateTimeCard & Omit<import("react").HTMLAttributes<HTMLIxDateTimeCardElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxDateTimeCardElement>>;
|
|
16
|
+
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>>;
|
|
17
|
+
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>>;
|
|
18
|
+
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>>;
|
|
19
|
+
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>>;
|
|
20
|
+
export declare const IxEventList: import("react").ForwardRefExoticComponent<JSX.IxEventList & Omit<import("react").HTMLAttributes<HTMLIxEventListElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxEventListElement>>;
|
|
21
|
+
export declare const IxEventListItem: import("react").ForwardRefExoticComponent<JSX.IxEventListItem & Omit<import("react").HTMLAttributes<HTMLIxEventListItemElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxEventListItemElement>>;
|
|
22
|
+
export declare const IxExpandingSearch: import("react").ForwardRefExoticComponent<JSX.IxExpandingSearch & Omit<import("react").HTMLAttributes<HTMLIxExpandingSearchElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxExpandingSearchElement>>;
|
|
23
|
+
export declare const IxFilterChip: import("react").ForwardRefExoticComponent<JSX.IxFilterChip & Omit<import("react").HTMLAttributes<HTMLIxFilterChipElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxFilterChipElement>>;
|
|
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
|
+
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
|
+
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 IxGroupDropdownItem: import("react").ForwardRefExoticComponent<JSX.IxGroupDropdownItem & Omit<import("react").HTMLAttributes<HTMLIxGroupDropdownItemElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxGroupDropdownItemElement>>;
|
|
28
|
+
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
|
+
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>>;
|
|
30
|
+
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>>;
|
|
31
|
+
export declare const IxInputGroup: import("react").ForwardRefExoticComponent<JSX.IxInputGroup & Omit<import("react").HTMLAttributes<HTMLIxInputGroupElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxInputGroupElement>>;
|
|
32
|
+
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>>;
|
|
33
|
+
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>>;
|
|
34
|
+
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>>;
|
|
35
|
+
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>>;
|
|
36
|
+
export declare const IxMenuAbout: import("react").ForwardRefExoticComponent<JSX.IxMenuAbout & Omit<import("react").HTMLAttributes<HTMLIxMenuAboutElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxMenuAboutElement>>;
|
|
37
|
+
export declare const IxMenuAboutItem: import("react").ForwardRefExoticComponent<JSX.IxMenuAboutItem & Omit<import("react").HTMLAttributes<HTMLIxMenuAboutItemElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxMenuAboutItemElement>>;
|
|
38
|
+
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>>;
|
|
39
|
+
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>>;
|
|
40
|
+
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>>;
|
|
41
|
+
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>>;
|
|
42
|
+
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>>;
|
|
43
|
+
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>>;
|
|
44
|
+
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>>;
|
|
45
|
+
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>>;
|
|
46
|
+
export declare const IxModalContainer: import("react").ForwardRefExoticComponent<JSX.IxModalContainer & Omit<import("react").HTMLAttributes<HTMLIxModalContainerElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxModalContainerElement>>;
|
|
47
|
+
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>>;
|
|
48
|
+
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>>;
|
|
49
|
+
export declare const IxSelect: import("react").ForwardRefExoticComponent<JSX.IxSelect & Omit<import("react").HTMLAttributes<HTMLIxSelectElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxSelectElement>>;
|
|
50
|
+
export declare const IxSelectItem: import("react").ForwardRefExoticComponent<JSX.IxSelectItem & Omit<import("react").HTMLAttributes<HTMLIxSelectItemElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxSelectItemElement>>;
|
|
51
|
+
export declare const IxSpinner: import("react").ForwardRefExoticComponent<JSX.IxSpinner & Omit<import("react").HTMLAttributes<HTMLIxSpinnerElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxSpinnerElement>>;
|
|
52
|
+
export declare const IxSplitButton: import("react").ForwardRefExoticComponent<JSX.IxSplitButton & Omit<import("react").HTMLAttributes<HTMLIxSplitButtonElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxSplitButtonElement>>;
|
|
53
|
+
export declare const IxSplitButtonItem: import("react").ForwardRefExoticComponent<JSX.IxSplitButtonItem & Omit<import("react").HTMLAttributes<HTMLIxSplitButtonItemElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxSplitButtonItemElement>>;
|
|
54
|
+
export declare const IxTabItem: import("react").ForwardRefExoticComponent<JSX.IxTabItem & Omit<import("react").HTMLAttributes<HTMLIxTabItemElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxTabItemElement>>;
|
|
55
|
+
export declare const IxTabs: import("react").ForwardRefExoticComponent<JSX.IxTabs & Omit<import("react").HTMLAttributes<HTMLIxTabsElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxTabsElement>>;
|
|
56
|
+
export declare const IxTile: import("react").ForwardRefExoticComponent<JSX.IxTile & Omit<import("react").HTMLAttributes<HTMLIxTileElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxTileElement>>;
|
|
57
|
+
export declare const IxTimePicker: import("react").ForwardRefExoticComponent<JSX.IxTimePicker & Omit<import("react").HTMLAttributes<HTMLIxTimePickerElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxTimePickerElement>>;
|
|
58
|
+
export declare const IxToast: import("react").ForwardRefExoticComponent<JSX.IxToast & Omit<import("react").HTMLAttributes<HTMLIxToastElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxToastElement>>;
|
|
59
|
+
export declare const IxToastContainer: import("react").ForwardRefExoticComponent<JSX.IxToastContainer & Omit<import("react").HTMLAttributes<HTMLIxToastContainerElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxToastContainerElement>>;
|
|
60
|
+
export declare const IxToggle: import("react").ForwardRefExoticComponent<JSX.IxToggle & Omit<import("react").HTMLAttributes<HTMLIxToggleElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxToggleElement>>;
|
|
61
|
+
export declare const IxUpload: import("react").ForwardRefExoticComponent<JSX.IxUpload & Omit<import("react").HTMLAttributes<HTMLIxUploadElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxUploadElement>>;
|
|
62
|
+
export declare const IxValidationTooltip: import("react").ForwardRefExoticComponent<JSX.IxValidationTooltip & Omit<import("react").HTMLAttributes<HTMLIxValidationTooltipElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxValidationTooltipElement>>;
|
|
63
|
+
export declare const IxWorkflowStep: import("react").ForwardRefExoticComponent<JSX.IxWorkflowStep & Omit<import("react").HTMLAttributes<HTMLIxWorkflowStepElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxWorkflowStepElement>>;
|
|
64
|
+
export declare const IxWorkflowSteps: import("react").ForwardRefExoticComponent<JSX.IxWorkflowSteps & Omit<import("react").HTMLAttributes<HTMLIxWorkflowStepsElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLIxWorkflowStepsElement>>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ModalConfig as IxModalConfig } from '@siemens/ix';
|
|
3
|
+
export * from './modal';
|
|
4
|
+
export declare type ModalConfig = {
|
|
5
|
+
content: React.ReactNode;
|
|
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
|
+
}>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface ModalRef {
|
|
3
|
+
close: (result: any) => void;
|
|
4
|
+
dismiss: (result?: any) => void;
|
|
5
|
+
}
|
|
6
|
+
export declare const Modal: React.ForwardRefExoticComponent<{
|
|
7
|
+
onClose?: ((result: any) => void) | undefined;
|
|
8
|
+
onDismiss?: ((result?: any) => void) | undefined;
|
|
9
|
+
} & {
|
|
10
|
+
children?: React.ReactNode;
|
|
11
|
+
} & React.RefAttributes<ModalRef>>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface HTMLStencilElement extends HTMLElement {
|
|
3
|
+
componentOnReady(): Promise<this>;
|
|
4
|
+
}
|
|
5
|
+
interface StencilReactInternalProps<ElementType> extends React.HTMLAttributes<ElementType> {
|
|
6
|
+
forwardedRef: React.RefObject<ElementType>;
|
|
7
|
+
ref?: React.Ref<any>;
|
|
8
|
+
}
|
|
9
|
+
export declare const createReactComponent: <PropType, ElementType extends HTMLStencilElement, ContextStateType = {}, ExpandedPropsTypes = {}>(tagName: string, ReactComponentContext?: React.Context<ContextStateType> | undefined, manipulatePropsFunction?: ((originalProps: StencilReactInternalProps<ElementType>, propsToPass: any) => ExpandedPropsTypes) | undefined, defineCustomElement?: () => void) => React.ForwardRefExoticComponent<React.PropsWithoutRef<import("./utils").StencilReactExternalProps<PropType, ElementType>> & React.RefAttributes<ElementType>>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { OverlayEventDetail } from './interfaces';
|
|
3
|
+
import { StencilReactForwardedRef } from './utils';
|
|
4
|
+
interface OverlayElement extends HTMLElement {
|
|
5
|
+
present: () => Promise<void>;
|
|
6
|
+
dismiss: (data?: any, role?: string | undefined) => Promise<boolean>;
|
|
7
|
+
}
|
|
8
|
+
export interface ReactOverlayProps {
|
|
9
|
+
children?: React.ReactNode;
|
|
10
|
+
isOpen: boolean;
|
|
11
|
+
onDidDismiss?: (event: CustomEvent<OverlayEventDetail>) => void;
|
|
12
|
+
onDidPresent?: (event: CustomEvent<OverlayEventDetail>) => void;
|
|
13
|
+
onWillDismiss?: (event: CustomEvent<OverlayEventDetail>) => void;
|
|
14
|
+
onWillPresent?: (event: CustomEvent<OverlayEventDetail>) => void;
|
|
15
|
+
}
|
|
16
|
+
export declare const createOverlayComponent: <OverlayComponent extends object, OverlayType extends OverlayElement>(tagName: string, controller: {
|
|
17
|
+
create: (options: any) => Promise<OverlayType>;
|
|
18
|
+
}, customElement?: any) => React.ForwardRefExoticComponent<React.PropsWithoutRef<OverlayComponent & ReactOverlayProps & {
|
|
19
|
+
forwardedRef?: StencilReactForwardedRef<OverlayType> | undefined;
|
|
20
|
+
}> & React.RefAttributes<OverlayType>>;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export interface EventEmitter<T = any> {
|
|
2
|
+
emit: (data?: T) => CustomEvent<T>;
|
|
3
|
+
}
|
|
4
|
+
export interface StyleReactProps {
|
|
5
|
+
class?: string;
|
|
6
|
+
className?: string;
|
|
7
|
+
style?: {
|
|
8
|
+
[key: string]: any;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export interface OverlayEventDetail<T = any> {
|
|
12
|
+
data?: T;
|
|
13
|
+
role?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface OverlayInterface {
|
|
16
|
+
el: HTMLElement;
|
|
17
|
+
animated: boolean;
|
|
18
|
+
keyboardClose: boolean;
|
|
19
|
+
overlayIndex: number;
|
|
20
|
+
presented: boolean;
|
|
21
|
+
enterAnimation?: any;
|
|
22
|
+
leaveAnimation?: any;
|
|
23
|
+
didPresent: EventEmitter<void>;
|
|
24
|
+
willPresent: EventEmitter<void>;
|
|
25
|
+
willDismiss: EventEmitter<OverlayEventDetail>;
|
|
26
|
+
didDismiss: EventEmitter<OverlayEventDetail>;
|
|
27
|
+
present(): Promise<void>;
|
|
28
|
+
dismiss(data?: any, role?: string): Promise<boolean>;
|
|
29
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const attachProps: (node: HTMLElement, newProps: any, oldProps?: any) => void;
|
|
2
|
+
export declare const getClassName: (classList: DOMTokenList, newProps: any, oldProps: any) => string;
|
|
3
|
+
/**
|
|
4
|
+
* Checks if an event is supported in the current execution environment.
|
|
5
|
+
* @license Modernizr 3.0.0pre (Custom Build) | MIT
|
|
6
|
+
*/
|
|
7
|
+
export declare const isCoveredByReact: (eventNameSuffix: string) => boolean;
|
|
8
|
+
export declare const syncEvent: (node: Element & {
|
|
9
|
+
__events?: {
|
|
10
|
+
[key: string]: ((e: Event) => any) | undefined;
|
|
11
|
+
} | undefined;
|
|
12
|
+
}, eventName: string, newEventHandler?: ((e: Event) => any) | undefined) => void;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
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;
|
|
5
|
+
export declare const setRef: (ref: StencilReactForwardedRef<any> | React.Ref<any> | undefined, value: any) => void;
|
|
6
|
+
export declare const mergeRefs: (...refs: (StencilReactForwardedRef<any> | React.Ref<any> | undefined)[]) => React.RefCallback<any>;
|
|
7
|
+
export declare const createForwardRef: <PropType, ElementType>(ReactComponent: any, displayName: string) => React.ForwardRefExoticComponent<React.PropsWithoutRef<StencilReactExternalProps<PropType, ElementType>> & React.RefAttributes<ElementType>>;
|
|
8
|
+
export declare const defineCustomElement: (tagName: string, customElement: any) => void;
|
|
9
|
+
export * from './attachProps';
|
|
10
|
+
export * from './case';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './toast';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ToastConfig as IxToastConfig } from '@siemens/ix';
|
|
3
|
+
export declare type ToastConfig = {
|
|
4
|
+
message: string | React.ReactNode;
|
|
5
|
+
};
|
|
6
|
+
export declare function showToast(config: Omit<IxToastConfig, 'message'> & ToastConfig): Promise<{
|
|
7
|
+
onClose: import("@siemens/ix/dist/types/components/utils/typed-event").TypedEvent<any>;
|
|
8
|
+
close: (result?: any) => void;
|
|
9
|
+
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './tree';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { JSX } from '@siemens/ix';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { StyleReactProps } from '../react-component-lib/interfaces';
|
|
4
|
+
export declare const IxTree: (props: Omit<JSX.IxTree, "renderItem"> & Omit<React.HTMLAttributes<HTMLIxTreeElement>, "style"> & StyleReactProps & React.RefAttributes<HTMLIxTreeElement> & {
|
|
5
|
+
renderItem?: ((data: any) => React.ReactNode) | undefined;
|
|
6
|
+
}) => globalThis.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": "1.1.0-beta.
|
|
10
|
+
"version": "1.1.0-beta.4",
|
|
11
11
|
"description": "Siemens iX for React",
|
|
12
12
|
"main": "dist/index.js",
|
|
13
13
|
"module": "dist/index.esm.js",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"license": "MIT",
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@rollup/plugin-typescript": "^8.4.0",
|
|
30
|
-
"@siemens/ix": "~1.1.0-beta.
|
|
30
|
+
"@siemens/ix": "~1.1.0-beta.4",
|
|
31
31
|
"@types/estree": "~0.0.51",
|
|
32
32
|
"@types/react": "~18.0.15",
|
|
33
33
|
"@types/react-dom": "~18.0.6",
|
|
@@ -47,6 +47,6 @@
|
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"@siemens/ix-icons": "~1.0.0",
|
|
50
|
-
"@siemens/ix": "~1.1.0-beta.
|
|
50
|
+
"@siemens/ix": "~1.1.0-beta.4"
|
|
51
51
|
}
|
|
52
52
|
}
|