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