@infineon/infineon-design-system-stencil 35.3.0--canary.1921.fedfabbd84b997ca6a665946264f8e5a0caa1ac7.0 → 35.3.0--canary.1921.6cb0ad58d7bcdabf5ce7bd69b53b66521fe50a8d.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/cjs/ifx-accordion_2.cjs.entry.js +123 -0
- package/dist/cjs/ifx-accordion_2.cjs.entry.js.map +1 -0
- package/dist/cjs/ifx-button.cjs.entry.js +139 -0
- package/dist/cjs/ifx-button.cjs.entry.js.map +1 -0
- package/dist/cjs/ifx-icon.cjs.entry.js +94 -0
- package/dist/cjs/ifx-icon.cjs.entry.js.map +1 -0
- package/dist/cjs/{ifx-accordion_5.cjs.entry.js → ifx-select.cjs.entry.js} +1 -337
- package/dist/cjs/ifx-select.cjs.entry.js.map +1 -0
- package/dist/cjs/index-7f4df11a.js +16 -4
- package/dist/cjs/infineon-design-system-stencil.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/accordion/accordionItem.js +24 -28
- package/dist/collection/components/accordion/accordionItem.js.map +1 -1
- package/dist/components/ifx-accordion-item.js +1 -1
- package/dist/components/ifx-faq.js +1 -1
- package/dist/components/{p-33b13938.js → p-4231b505.js} +25 -29
- package/dist/components/p-4231b505.js.map +1 -0
- package/dist/esm/ifx-accordion_2.entry.js +118 -0
- package/dist/esm/ifx-accordion_2.entry.js.map +1 -0
- package/dist/esm/ifx-button.entry.js +135 -0
- package/dist/esm/ifx-button.entry.js.map +1 -0
- package/dist/esm/ifx-icon.entry.js +90 -0
- package/dist/esm/ifx-icon.entry.js.map +1 -0
- package/dist/esm/{ifx-accordion_5.entry.js → ifx-select.entry.js} +3 -335
- package/dist/esm/ifx-select.entry.js.map +1 -0
- package/dist/esm/index-6c9eba32.js +16 -4
- package/dist/esm/infineon-design-system-stencil.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/infineon-design-system-stencil/infineon-design-system-stencil.esm.js +1 -1
- package/dist/infineon-design-system-stencil/infineon-design-system-stencil.esm.js.map +1 -1
- package/dist/infineon-design-system-stencil/p-0d3e5a0d.entry.js +2 -0
- package/dist/infineon-design-system-stencil/p-0d3e5a0d.entry.js.map +1 -0
- package/dist/infineon-design-system-stencil/p-3d23deba.entry.js +2 -0
- package/dist/infineon-design-system-stencil/p-3d23deba.entry.js.map +1 -0
- package/dist/infineon-design-system-stencil/{p-d253f99f.entry.js → p-e44ff006.entry.js} +3 -3
- package/dist/infineon-design-system-stencil/p-e44ff006.entry.js.map +1 -0
- package/dist/infineon-design-system-stencil/p-edd379d7.entry.js +2 -0
- package/dist/infineon-design-system-stencil/p-edd379d7.entry.js.map +1 -0
- package/dist/types/components/accordion/accordionItem.d.ts +2 -1
- package/package.json +1 -1
- package/dist/cjs/ifx-accordion_5.cjs.entry.js.map +0 -1
- package/dist/components/p-33b13938.js.map +0 -1
- package/dist/esm/ifx-accordion_5.entry.js.map +0 -1
- package/dist/infineon-design-system-stencil/p-d253f99f.entry.js.map +0 -1
@@ -1,341 +1,9 @@
|
|
1
|
-
import { r as registerInstance,
|
2
|
-
import { c as classNames } from './index-72ac5051.js';
|
3
|
-
import { g as getIcon } from './icons-845f859e.js';
|
4
|
-
|
5
|
-
const accordionCss = ":root{--ifx-font-family:\"Source Sans 3\", \"Arial, sans-serif\"}:host{display:block}.accordion-wrapper{display:flex;flex-direction:column;gap:8px;font-family:var(--ifx-font-family)}";
|
6
|
-
const IfxAccordionStyle0 = accordionCss;
|
7
|
-
|
8
|
-
const Accordion = class {
|
9
|
-
constructor(hostRef) {
|
10
|
-
registerInstance(this, hostRef);
|
11
|
-
this.autoCollapse = false;
|
12
|
-
}
|
13
|
-
async onItemOpen(event) {
|
14
|
-
if (this.autoCollapse) {
|
15
|
-
const items = Array.from(this.el.querySelectorAll('ifx-accordion-item'));
|
16
|
-
for (const item of items) {
|
17
|
-
const itemElement = item;
|
18
|
-
if (itemElement !== event.target && (await itemElement.open)) {
|
19
|
-
itemElement.open = false;
|
20
|
-
}
|
21
|
-
}
|
22
|
-
}
|
23
|
-
}
|
24
|
-
render() {
|
25
|
-
return (h("div", { key: '663e6aac2f3002d3898856b854dbfd96d9519a68', class: "accordion-wrapper" }, h("slot", { key: '0f54044bc1e0d2860ccd3096ee2711eb0a1cb927' })));
|
26
|
-
}
|
27
|
-
static get delegatesFocus() { return true; }
|
28
|
-
get el() { return getElement(this); }
|
29
|
-
};
|
30
|
-
Accordion.style = IfxAccordionStyle0;
|
31
|
-
|
32
|
-
const accordionItemCss = ":root{--ifx-font-family:\"Source Sans 3\", \"Arial, sans-serif\"}.accordion-item{border-radius:3px;transition:all 0.3s;font-family:var(--ifx-font-family)}.accordion-title:focus{outline:none}.accordion-title:focus::after{content:\"\";display:block;position:absolute;top:-4px;bottom:-4px;left:-4px;right:-4px;border-radius:5px;border:2px solid #0A8276;box-sizing:border-box}.accordion-title:hover{border:1px solid #EEEDED;color:#08665C}.accordion-title{display:flex;align-items:center;position:relative;padding:12px 16px;gap:12px;color:#0A8276;background-color:#FFFFFF;border:1px solid #EEEDED;cursor:pointer;margin:4px}.accordion-caption{font-weight:600;font-size:1.125rem}.accordion-content{gap:8px;line-height:24px;font-size:1rem;font-weight:400}.inner-content{background-color:#FFFFFF;padding:24px;word-wrap:break-word;overflow-wrap:anywhere;align-self:stretch;}.accordion-icon{font-weight:bold;display:flex;transition:transform 0.3s}.accordion-icon:hover{color:#08665C}.accordion-item.open .accordion-icon{transform:rotate(-180deg)}";
|
33
|
-
const IfxAccordionItemStyle0 = accordionItemCss;
|
34
|
-
|
35
|
-
const IfxAccordionItem = class {
|
36
|
-
constructor(hostRef) {
|
37
|
-
registerInstance(this, hostRef);
|
38
|
-
this.ifxOpen = createEvent(this, "ifxOpen", 7);
|
39
|
-
this.ifxClose = createEvent(this, "ifxClose", 7);
|
40
|
-
this.open = false;
|
41
|
-
this.AriaLevel = 3;
|
42
|
-
this.internalOpen = false;
|
43
|
-
}
|
44
|
-
componentWillLoad() {
|
45
|
-
this.internalOpen = this.open;
|
46
|
-
}
|
47
|
-
componentDidLoad() {
|
48
|
-
this.openAccordionItem();
|
49
|
-
}
|
50
|
-
componentDidUpdate() {
|
51
|
-
this.openAccordionItem();
|
52
|
-
}
|
53
|
-
openChanged(newValue) {
|
54
|
-
this.internalOpen = newValue;
|
55
|
-
}
|
56
|
-
toggleOpen() {
|
57
|
-
this.internalOpen = !this.internalOpen;
|
58
|
-
this.open = this.internalOpen;
|
59
|
-
if (this.internalOpen) {
|
60
|
-
this.ifxOpen.emit({ isOpen: this.internalOpen });
|
61
|
-
}
|
62
|
-
else {
|
63
|
-
this.ifxClose.emit({ isClosed: !this.internalOpen });
|
64
|
-
}
|
65
|
-
}
|
66
|
-
openAccordionItem() {
|
67
|
-
if (this.internalOpen) {
|
68
|
-
this.contentEl.style.height = `${this.contentEl.scrollHeight}px`;
|
69
|
-
console.log('contentEl height', this.contentEl.style.height);
|
70
|
-
this.contentEl.style.overflow = 'visible';
|
71
|
-
}
|
72
|
-
else {
|
73
|
-
this.contentEl.style.height = '0';
|
74
|
-
this.contentEl.style.overflow = 'hidden';
|
75
|
-
}
|
76
|
-
}
|
77
|
-
handleSlotChange(e) {
|
78
|
-
const slotElement = e.target;
|
79
|
-
const nodes = slotElement.assignedNodes();
|
80
|
-
if (nodes.length > 0) {
|
81
|
-
nodes.forEach(node => {
|
82
|
-
const observer = new MutationObserver((mutationsList, _) => {
|
83
|
-
for (let mutation of mutationsList) {
|
84
|
-
if (mutation.type === 'childList') {
|
85
|
-
if (this.internalOpen) {
|
86
|
-
console.log('here');
|
87
|
-
//this.openAccordionItem();
|
88
|
-
}
|
89
|
-
}
|
90
|
-
}
|
91
|
-
});
|
92
|
-
observer.observe(node, { attributes: true, childList: true, subtree: true });
|
93
|
-
});
|
94
|
-
}
|
95
|
-
if (this.internalOpen) {
|
96
|
-
this.openAccordionItem();
|
97
|
-
}
|
98
|
-
}
|
99
|
-
handleKeydown(ev) {
|
100
|
-
const path = ev.composedPath();
|
101
|
-
if (!path.includes(this.titleEl)) {
|
102
|
-
return;
|
103
|
-
}
|
104
|
-
switch (ev.key) {
|
105
|
-
case 'Enter': // fallthrough
|
106
|
-
case ' ': // space
|
107
|
-
ev.preventDefault();
|
108
|
-
this.toggleOpen();
|
109
|
-
break;
|
110
|
-
}
|
111
|
-
}
|
112
|
-
render() {
|
113
|
-
return (h("div", { key: '8d01c53188465de3163b9cc2ef26b83feeb56bfb', class: `accordion-item ${this.internalOpen ? 'open' : ''}` }, h("div", { key: '86bf618be8511bb77efa04448ace90a106372111', role: "button", "aria-expanded": this.internalOpen, "aria-controls": "accordion-content", class: "accordion-title", onClick: () => this.toggleOpen(), tabindex: '0', ref: (el) => (this.titleEl = el) }, h("span", { key: 'eb166d036afe5ebecc621fc5657524e46e8e46ee', "aria-hidden": "true", role: "heading", "aria-level": String(this.AriaLevel), class: "accordion-icon" }, h("ifx-icon", { key: '6fdf2b1a2372724cd60609ed38cbc94c0a5f241c', icon: "chevron-down-16" })), h("span", { key: '1acb7856cb5442005bcd255e866077720a1d899b', id: "accordion-caption", class: "accordion-caption" }, this.caption)), h("div", { key: '553316204100c08231df1bc6fd9db805cae412f9', id: "accordion-content", class: "accordion-content", ref: (el) => (this.contentEl = el), role: "region", "aria-labelledby": "accordion-caption" }, h("div", { key: '255b2fd85ecbc5250c0b205c0a693ff0a270b5b2', class: "inner-content" }, h("slot", { key: '518ea316fb240a3ebeb84f49a5613b8389b4fa58', onSlotchange: (e) => this.handleSlotChange(e) })))));
|
114
|
-
}
|
115
|
-
get el() { return getElement(this); }
|
116
|
-
static get watchers() { return {
|
117
|
-
"open": ["openChanged"]
|
118
|
-
}; }
|
119
|
-
};
|
120
|
-
IfxAccordionItem.style = IfxAccordionItemStyle0;
|
1
|
+
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-6c9eba32.js';
|
121
2
|
|
122
3
|
function getDefaultExportFromCjs (x) {
|
123
4
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
124
5
|
}
|
125
6
|
|
126
|
-
const buttonCss = ":root{--ifx-font-family:\"Source Sans 3\", \"Arial, sans-serif\"}:host{vertical-align:bottom;display:inline-flex;width:var(--bw, fit-content)}.btn{box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;height:40px;padding:0px 16px;gap:8px;color:#FFFFFF;font-weight:600;border-radius:1px;line-height:1.5rem;font-family:var(--ifx-font-family);font-style:normal;text-decoration:none;user-select:none;font-size:1rem;transition:color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;width:var(--bw, fit-content)}.btn:not(.disabled){cursor:pointer}.btn.disabled{pointer-events:none}.btn-default{color:#FFFFFF;background-color:#0A8276}.btn-default:disabled,.btn-default.disabled{background-color:#BFBBBB;color:#FFFFFF;pointer-events:none}.btn-secondary-default{background-color:#FFFFFF;color:#0A8276;border:1px solid #0A8276}.btn-secondary-default:disabled,.btn-secondary-default.disabled{background-color:#FFFFFF;border:1px solid #BFBBBB;color:#BFBBBB;pointer-events:none}.btn-tertiary-default{background-color:transparent;color:#0A8276}.btn-tertiary-default:disabled,.btn-tertiary-default.disabled{color:#BFBBBB;pointer-events:none}.btn-danger{color:#FFFFFF;background-color:#CD002F;border-color:#CD002F}.btn-danger:disabled,.btn-danger.disabled{background-color:#BFBBBB;color:#FFFFFF;pointer-events:none}.btn-secondary-danger{background-color:#FFFFFF;color:#CD002F;border:1px solid #CD002F}.btn-secondary-danger:disabled,.btn-secondary-danger.disabled{background-color:#FFFFFF;border:1px solid #BFBBBB;color:#BFBBBB;pointer-events:none}.btn-tertiary-danger{background-color:transparent;color:#CD002F}.btn-tertiary-danger:disabled,.btn-tertiary-danger.disabled{background-color:#FFFFFF;color:#BFBBBB;pointer-events:none}.btn-inverse{color:#0A8276;background-color:#FFFFFF}.btn-inverse:disabled,.btn-inverse.disabled{opacity:1;background-color:#FFFFFF;color:#0A8276;pointer-events:none}.btn-secondary-inverse{color:#FFFFFF;border:1px solid #FFFFFF}.btn-secondary-inverse:disabled,.btn-secondary-inverse.disabled{border:1px solid #FFFFFF;color:#FFFFFF;pointer-events:none}.btn-tertiary-inverse{color:#FFFFFF}.btn-tertiary-inverse:disabled,.btn-tertiary-inverse.disabled{color:#FFFFFF;opacity:1;pointer-events:none}.btn ifx-icon:empty{display:none}.btn.btn-xs{font-size:0.875rem;height:32px;line-height:1rem}.btn.btn-s{font-size:0.875rem;height:36px;line-height:1.25rem}.btn.btn-l{font-size:1.25rem;height:48px;line-height:1.75rem}.btn.btn-default:not(:disabled,.disabled):focus:not(:active,.active){outline:none;box-shadow:0 0 0 2px #FFFFFF, 0 0 0 4px #0A8276}.btn.btn-default:not(:disabled,.disabled):hover{background-color:#08665C}.btn.btn-default:not(:disabled,.disabled):active,.btn.btn-default:not(:disabled,.disabled).active{background-color:#06534B}.btn.btn-secondary-default:not(:disabled,.disabled):focus:not(:active,.active){outline:none;box-shadow:0 0 0 2px #FFFFFF, 0 0 0 4px #0A8276}.btn.btn-secondary-default:not(:disabled,.disabled):hover{color:#FFFFFF;background-color:#08665C}.btn.btn-secondary-default:not(:disabled,.disabled):active,.btn.btn-secondary-default:not(:disabled,.disabled).active{background-color:#06534B}.btn.btn-secondary:not(:disabled,.disabled):hover{background-color:#9C216E}.btn.btn-secondary:not(:disabled,.disabled):active,.btn.btn-secondary:not(:disabled,.disabled).active{background-color:#9C216E}.btn.btn-danger:not(:disabled,.disabled):focus:not(:active,.active){outline:none;box-shadow:0 0 0 2px #FFFFFF, 0 0 0 4px #0A8276}.btn.btn-danger:not(:disabled,.disabled):hover{background-color:#A2001E}.btn.btn-danger:not(:disabled,.disabled):active,.btn.btn-danger:not(:disabled,.disabled).active{background-color:#900021}.btn.btn-secondary-danger:not(:disabled,.disabled):focus:not(:active,.active){outline:none;box-shadow:0 0 0 2px #FFFFFF, 0 0 0 4px #0A8276}.btn.btn-secondary-danger:not(:disabled,.disabled):hover{color:#FFFFFF;background-color:#A2001E}.btn.btn-secondary-danger:not(:disabled,.disabled):active,.btn.btn-secondary-danger:not(:disabled,.disabled).active{background-color:#900021}.btn.btn-inverse:not(:disabled,.disabled):focus:not(:active,.active){outline:none;box-shadow:0 0 0 2px #0A8276, 0 0 0 4px #FFFFFF}.btn.btn-inverse:not(:disabled,.disabled):hover{background-color:#EEEDED}.btn.btn-inverse:not(:disabled,.disabled):active,.btn.btn-inverse:not(:disabled,.disabled).active{background-color:#BFBBBB}.btn.btn-secondary-inverse:not(:disabled,.disabled):focus:not(:active,.active){outline:none;box-shadow:0 0 0 2px #0A8276, 0 0 0 4px #FFFFFF}.btn.btn-secondary-inverse:not(:disabled,.disabled):hover{color:#0A8276;background-color:#EEEDED}.btn.btn-secondary-inverse:not(:disabled,.disabled):active,.btn.btn-secondary-inverse:not(:disabled,.disabled).active{color:#0A8276;background-color:#BFBBBB}.btn.btn-tertiary-default:not(:disabled,.disabled):focus:not(:active,.active){outline:none;box-shadow:0 0 0 2px #FFFFFF, 0 0 0 4px #08665C}.btn.btn-tertiary-default:not(:disabled,.disabled):hover{color:#08665C}.btn.btn-tertiary-default:not(:disabled,.disabled):active,.btn.btn-tertiary-default:not(:disabled,.disabled).active{color:#06534B}.btn.btn-tertiary-danger:not(:disabled,.disabled):focus:not(:active,.active){outline:none;box-shadow:0 0 0 2px #FFFFFF, 0 0 0 4px #A2001E}.btn.btn-tertiary-danger:not(:disabled,.disabled):hover{color:#A2001E}.btn.btn-tertiary-danger:not(:disabled,.disabled):active,.btn.btn-tertiary-danger:not(:disabled,.disabled).active{color:#900021}.btn.btn-tertiary-inverse:not(:disabled,.disabled):focus:not(:active,.active){outline:none;box-shadow:0 0 0 2px #0A8276, 0 0 0 4px #FFFFFF}.btn.btn-tertiary-inverse:not(:disabled,.disabled):hover{color:#EEEDED}.btn.btn-tertiary-inverse:not(:disabled,.disabled):active,.btn.btn-tertiary-inverse:not(:disabled,.disabled).active{color:#BFBBBB}";
|
127
|
-
const IfxButtonStyle0 = buttonCss;
|
128
|
-
|
129
|
-
const Button = class {
|
130
|
-
constructor(hostRef) {
|
131
|
-
registerInstance(this, hostRef);
|
132
|
-
this.variant = 'primary';
|
133
|
-
this.theme = 'default';
|
134
|
-
this.size = 'm';
|
135
|
-
this.disabled = false;
|
136
|
-
this.target = '_self';
|
137
|
-
this.type = "button";
|
138
|
-
this.fullWidth = false;
|
139
|
-
this.handleClick = (ev) => {
|
140
|
-
if (this.el.shadowRoot) {
|
141
|
-
const parentForm = this.el.closest('form');
|
142
|
-
if (parentForm) {
|
143
|
-
ev.preventDefault();
|
144
|
-
if (this.type === 'reset') {
|
145
|
-
// If the button type is 'reset', manually reset all custom form fields
|
146
|
-
this.resetClickHandler(); //this will reset all ifx-text-fields within a form
|
147
|
-
}
|
148
|
-
else {
|
149
|
-
const fakeButton = document.createElement('button');
|
150
|
-
if (this.type) {
|
151
|
-
fakeButton.type = this.type;
|
152
|
-
}
|
153
|
-
fakeButton.style.display = 'none';
|
154
|
-
parentForm.appendChild(fakeButton);
|
155
|
-
fakeButton.click();
|
156
|
-
fakeButton.remove();
|
157
|
-
}
|
158
|
-
}
|
159
|
-
}
|
160
|
-
};
|
161
|
-
}
|
162
|
-
setInternalHref(newValue) {
|
163
|
-
this.internalHref = newValue;
|
164
|
-
}
|
165
|
-
async setFocus() {
|
166
|
-
this.focusableElement.focus();
|
167
|
-
}
|
168
|
-
insertNativeButton() {
|
169
|
-
this.nativeButton = document.createElement('button');
|
170
|
-
this.nativeButton.type = this.type;
|
171
|
-
this.nativeButton.style.display = 'none';
|
172
|
-
this.el.closest('form').appendChild(this.nativeButton);
|
173
|
-
}
|
174
|
-
handleFormAndInternalHref() {
|
175
|
-
if (this.el.closest('form')) {
|
176
|
-
if (this.el.href) {
|
177
|
-
this.el.internalHref = undefined;
|
178
|
-
}
|
179
|
-
this.insertNativeButton();
|
180
|
-
}
|
181
|
-
else {
|
182
|
-
this.internalHref = this.href;
|
183
|
-
}
|
184
|
-
}
|
185
|
-
handleButtonWidth() {
|
186
|
-
if (this.fullWidth) {
|
187
|
-
this.el.style.setProperty('--bw', '100%');
|
188
|
-
}
|
189
|
-
else {
|
190
|
-
this.el.style.setProperty('--bw', 'fit-content');
|
191
|
-
}
|
192
|
-
}
|
193
|
-
componentWillLoad() {
|
194
|
-
this.handleFormAndInternalHref();
|
195
|
-
}
|
196
|
-
componentWillRender() {
|
197
|
-
this.handleButtonWidth();
|
198
|
-
}
|
199
|
-
resetClickHandler() {
|
200
|
-
const formElement = this.el.closest('form');
|
201
|
-
const customElements = formElement.querySelectorAll('ifx-text-field, ifx-textarea');
|
202
|
-
customElements.forEach(element => {
|
203
|
-
element.reset();
|
204
|
-
});
|
205
|
-
}
|
206
|
-
handleKeyDown(ev) {
|
207
|
-
if (ev.key === " " || ev.key === 'Enter' && !this.disabled) {
|
208
|
-
this.focusableElement.click();
|
209
|
-
}
|
210
|
-
}
|
211
|
-
handleHostClick(event) {
|
212
|
-
if (this.disabled === true) {
|
213
|
-
event.stopImmediatePropagation();
|
214
|
-
}
|
215
|
-
}
|
216
|
-
handleFocus(event) {
|
217
|
-
if (this.disabled) {
|
218
|
-
event.preventDefault();
|
219
|
-
this.focusableElement.blur();
|
220
|
-
}
|
221
|
-
}
|
222
|
-
render() {
|
223
|
-
return (h(Host, { key: 'a220864c79a3eee88b277dd2277487581c7de8b0' }, h("a", { key: '4fd4cbd07205a0f538cf4d977a1b88d23d64be36', role: this.href ? 'link' : 'button', tabIndex: this.disabled ? -1 : 0, ref: (el) => (this.focusableElement = el), class: this.getClassNames(), href: !this.disabled ? this.internalHref : undefined, target: this.target, onClick: this.handleClick, rel: this.target === '_blank' ? 'noopener noreferrer' : undefined, onFocus: (event) => this.handleFocus(event), "aria-disabled": this.disabled ? 'true' : null, "aria-describedby": this.theme === 'danger' ? 'Dangerous action' : undefined, "aria-label": this.ariaLabel || undefined }, h("slot", { key: 'f64f20c4b3d1af19c6276713aef4e230d7aaf0e3' }))));
|
224
|
-
}
|
225
|
-
getVariantClass() {
|
226
|
-
return `${this.variant}` === "secondary"
|
227
|
-
? `secondary-${this.theme}`
|
228
|
-
: `${this.variant}` === 'tertiary'
|
229
|
-
? `tertiary-${this.theme}`
|
230
|
-
: `${this.theme}`;
|
231
|
-
}
|
232
|
-
getSizeClass() {
|
233
|
-
if (`${this.size}` === "xs") {
|
234
|
-
return "xs";
|
235
|
-
}
|
236
|
-
else if (`${this.size}` === "s") {
|
237
|
-
return "s";
|
238
|
-
}
|
239
|
-
else if (`${this.size}` === "l") {
|
240
|
-
return "l";
|
241
|
-
}
|
242
|
-
else
|
243
|
-
return "";
|
244
|
-
}
|
245
|
-
getClassNames() {
|
246
|
-
return classNames('btn', this.size && `btn-${this.getSizeClass()}`, `btn-${this.getVariantClass()}`, this.disabled ? 'disabled' : '');
|
247
|
-
}
|
248
|
-
get el() { return getElement(this); }
|
249
|
-
static get watchers() { return {
|
250
|
-
"href": ["setInternalHref"]
|
251
|
-
}; }
|
252
|
-
};
|
253
|
-
Button.style = IfxButtonStyle0;
|
254
|
-
|
255
|
-
const infineonIconStencilCss = "ifx-icon{display:inline-flex;justify-content:center}ifx-icon:empty{display:none}";
|
256
|
-
const IfxIconStyle0 = infineonIconStencilCss;
|
257
|
-
|
258
|
-
const InfineonIconStencil = class {
|
259
|
-
constructor(hostRef) {
|
260
|
-
registerInstance(this, hostRef);
|
261
|
-
this.consoleError = createEvent(this, "consoleError", 7);
|
262
|
-
this.icon = "";
|
263
|
-
}
|
264
|
-
updateIcon(newIcon) {
|
265
|
-
this.internalIcon = newIcon;
|
266
|
-
this.setIcon();
|
267
|
-
}
|
268
|
-
convertStringToHtml(htmlString) {
|
269
|
-
const div = document.createElement('div');
|
270
|
-
div.innerHTML = htmlString;
|
271
|
-
return div.firstChild;
|
272
|
-
}
|
273
|
-
convertHtmlToObject(htmlElement) {
|
274
|
-
let pathToObject = Array
|
275
|
-
.from(htmlElement.attributes, ({ name, value }) => ({ name, value }))
|
276
|
-
.reduce((acc, current) => {
|
277
|
-
acc[current.name] = current.value;
|
278
|
-
return acc;
|
279
|
-
}, {});
|
280
|
-
return pathToObject;
|
281
|
-
}
|
282
|
-
convertPathsToVnode(htmlPath) {
|
283
|
-
let svgPaths = [];
|
284
|
-
const parentPath = this.convertHtmlToObject(htmlPath);
|
285
|
-
const parentPathToVnode = h("path", parentPath);
|
286
|
-
svgPaths.push(parentPathToVnode);
|
287
|
-
if (htmlPath.firstChild) {
|
288
|
-
const paths = htmlPath.querySelectorAll('path');
|
289
|
-
const pathLength = htmlPath.querySelectorAll('path').length;
|
290
|
-
for (let i = 0; i < pathLength; i++) {
|
291
|
-
let pathToObject = this.convertHtmlToObject(paths[i]);
|
292
|
-
let objToVnode = h("path", pathToObject);
|
293
|
-
svgPaths.push(objToVnode);
|
294
|
-
}
|
295
|
-
}
|
296
|
-
return svgPaths;
|
297
|
-
}
|
298
|
-
getSVG(svgPath) {
|
299
|
-
const htmlPath = this.convertStringToHtml(this.ifxIcon);
|
300
|
-
const width = htmlPath.getAttribute('width');
|
301
|
-
const height = htmlPath.getAttribute('height');
|
302
|
-
const fill = htmlPath.getAttribute('fill');
|
303
|
-
const viewBox = htmlPath.getAttribute('viewBox');
|
304
|
-
return h("svg", { class: "inline-svg", width: width, height: height, xmlns: "http://www.w3.org/2000/svg", fill: fill, viewBox: viewBox }, ...svgPath);
|
305
|
-
}
|
306
|
-
constructIcon() {
|
307
|
-
if (this.ifxIcon) {
|
308
|
-
const htmlPath = this.convertStringToHtml(this.ifxIcon);
|
309
|
-
const svgPath = this.convertPathsToVnode(htmlPath);
|
310
|
-
const SVG = this.getSVG(svgPath);
|
311
|
-
return SVG;
|
312
|
-
}
|
313
|
-
else if (this.icon !== "") {
|
314
|
-
console.error('Icon not found!');
|
315
|
-
this.consoleError.emit(true);
|
316
|
-
return;
|
317
|
-
}
|
318
|
-
else {
|
319
|
-
return;
|
320
|
-
}
|
321
|
-
}
|
322
|
-
setIcon() {
|
323
|
-
const removeHyphen = (str) => str.toLowerCase().replace(/[^a-zA-Z0-9]+(.)/g, (_m, chr) => chr);
|
324
|
-
this.ifxIcon = getIcon(removeHyphen(this.internalIcon));
|
325
|
-
}
|
326
|
-
componentWillLoad() {
|
327
|
-
this.internalIcon = this.icon;
|
328
|
-
this.setIcon();
|
329
|
-
}
|
330
|
-
render() {
|
331
|
-
return (h(Host, { key: '7f6ff1ecf4d36c72ce33b220b21e9f140e87f430' }, this.constructIcon()));
|
332
|
-
}
|
333
|
-
static get watchers() { return {
|
334
|
-
"icon": ["updateIcon"]
|
335
|
-
}; }
|
336
|
-
};
|
337
|
-
InfineonIconStencil.style = IfxIconStyle0;
|
338
|
-
|
339
7
|
var choices = {exports: {}};
|
340
8
|
|
341
9
|
/*! choices.js v10.2.0 | © 2022 Josh Johnson | https://github.com/jshjohnson/Choices#readme */
|
@@ -7620,6 +7288,6 @@ const Choices = class {
|
|
7620
7288
|
};
|
7621
7289
|
Choices.style = IfxSelectStyle0;
|
7622
7290
|
|
7623
|
-
export {
|
7291
|
+
export { Choices as ifx_select };
|
7624
7292
|
|
7625
|
-
//# sourceMappingURL=ifx-
|
7293
|
+
//# sourceMappingURL=ifx-select.entry.js.map
|