@infineon/infineon-design-system-stencil 35.3.0 → 35.3.1--canary.1904.89fbd2e9743557b79eb5aa75e6ace692b295799c.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-alert_2.cjs.entry.js +106 -133
- package/dist/cjs/ifx-alert_2.cjs.entry.js.map +1 -1
- package/dist/cjs/ifx-template.cjs.entry.js +156 -0
- package/dist/cjs/ifx-template.cjs.entry.js.map +1 -0
- package/dist/cjs/index-7f4df11a.js +8 -8
- package/dist/cjs/infineon-design-system-stencil.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/alert/alert.js +32 -0
- package/dist/collection/components/alert/alert.js.map +1 -1
- package/dist/components/ifx-alert.js +1 -1
- package/dist/components/ifx-templates-ui.js +1 -1
- package/dist/components/{p-6c0ec65a.js → p-a1ce7b6d.js} +33 -1
- package/dist/components/p-a1ce7b6d.js.map +1 -0
- package/dist/esm/ifx-alert_2.entry.js +107 -134
- package/dist/esm/ifx-alert_2.entry.js.map +1 -1
- package/dist/esm/ifx-template.entry.js +152 -0
- package/dist/esm/ifx-template.entry.js.map +1 -0
- package/dist/esm/index-6c9eba32.js +8 -8
- 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/p-01b40a11.entry.js +2 -0
- package/dist/infineon-design-system-stencil/p-01b40a11.entry.js.map +1 -0
- package/dist/infineon-design-system-stencil/p-baea374a.entry.js +2 -0
- package/dist/infineon-design-system-stencil/p-baea374a.entry.js.map +1 -0
- package/dist/types/components/alert/alert.d.ts +8 -0
- package/package.json +1 -1
- package/dist/cjs/ifx-icon.cjs.entry.js +0 -97
- package/dist/cjs/ifx-icon.cjs.entry.js.map +0 -1
- package/dist/components/p-6c0ec65a.js.map +0 -1
- package/dist/esm/ifx-icon.entry.js +0 -93
- package/dist/esm/ifx-icon.entry.js.map +0 -1
- package/dist/infineon-design-system-stencil/p-74bee1c8.entry.js +0 -2
- package/dist/infineon-design-system-stencil/p-74bee1c8.entry.js.map +0 -1
- package/dist/infineon-design-system-stencil/p-959285a7.entry.js +0 -2
- package/dist/infineon-design-system-stencil/p-959285a7.entry.js.map +0 -1
@@ -3,6 +3,7 @@
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
5
|
const index = require('./index-7f4df11a.js');
|
6
|
+
const icons = require('./icons-2cd72a7d.js');
|
6
7
|
|
7
8
|
const alertCss = ":root{--ifx-font-family:\"Source Sans 3\", \"Arial, sans-serif\"}:host{display:block}.alert__info-wrapper{display:flex;padding:16px 24px;font-family:var(--ifx-font-family);box-shadow:0px 6px 9px 0px rgba(29, 29, 29, 0.1019607843)}.alert__info-wrapper .info__text-wrapper{display:flex;flex-direction:column;gap:8px;width:100%}.alert__info-wrapper .info__text-wrapper .info__headline-wrapper{display:-webkit-box;-webkit-line-clamp:1;line-clamp:1;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis}.alert__info-wrapper .info__text-wrapper .info__headline-wrapper,.alert__info-wrapper .info__text-wrapper .info__description-wrapper{color:#1D1D1D;font-size:16px;font-style:normal;font-weight:600;line-height:24px}.alert__info-wrapper .info__text-wrapper .info__headline-wrapper ::slotted(p),.alert__info-wrapper .info__text-wrapper .info__description-wrapper ::slotted(p){padding:0;margin:0}.alert__info-wrapper .info__text-wrapper .info__description-wrapper{font-weight:400}.alert__info-wrapper .close-icon-wrapper{display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-start}.alert__info-wrapper .close-icon-wrapper button{all:unset;display:flex;align-items:center;justify-content:center;line-height:0;color:#1D1D1D;height:24px;width:24px}.alert__info-wrapper .close-icon-wrapper button:focus{outline:2px solid #0A8276;outline-offset:2px}.alert{display:flex;border:1px solid #0A8276;border-radius:1px;color:#1D1D1D;background-color:#FFFFFF;font-family:var(--ifx-font-family);box-shadow:0px 6px 9px 0px rgba(29, 29, 29, 0.1019607843)}.alert .close-icon-wrapper{display:flex;align-items:center;justify-content:center;min-width:40px}.alert .close-icon-wrapper button{all:unset;display:flex;align-items:center;justify-content:center;line-height:0;color:#1D1D1D;height:24px;width:24px}.alert .close-icon-wrapper button:focus{outline:2px solid #0A8276;outline-offset:2px}.alert .icon-wrapper{position:relative;min-width:48px;display:flex;justify-content:center;align-items:center;background-color:#0A8276}.alert .alert-text{font-size:16px;width:100%;padding:12px 0px 12px 12px;color:#1D1D1D;white-space:pre-wrap;word-wrap:break-word;overflow-wrap:anywhere;}.alert.primary{border:1px solid #0A8276}.alert.primary .icon-wrapper{background-color:#0A8276;color:#FFFFFF}.alert.success{border:1px solid #4CA460}.alert.success .icon-wrapper{background-color:#4CA460;color:#FFFFFF}.alert.danger{border:1px solid #CD002F}.alert.danger .icon-wrapper{background-color:#CD002F;color:#FFFFFF}.alert.warning{border:1px solid #E16B25}.alert.warning .icon-wrapper{background-color:#E16B25;color:#FFFFFF}.close-icon-wrapper ifx-icon:hover{cursor:pointer}";
|
8
9
|
const IfxAlertStyle0 = alertCss;
|
@@ -35,6 +36,38 @@ const Alert = class {
|
|
35
36
|
if (!this.uniqueId) {
|
36
37
|
this.uniqueId = this.generateUniqueId('alert');
|
37
38
|
}
|
39
|
+
this.initalizeTracking();
|
40
|
+
}
|
41
|
+
initalizeTracking() {
|
42
|
+
(function (t, r, kk, n, pp) {
|
43
|
+
if (typeof window.btntConfig !== "object") {
|
44
|
+
window.btntConfig = {
|
45
|
+
domain: "https://ssgtm.infineon.com",
|
46
|
+
withCookies: true,
|
47
|
+
maxBatchSize: 10
|
48
|
+
};
|
49
|
+
}
|
50
|
+
if (window["btnt"])
|
51
|
+
return;
|
52
|
+
window["btnt"] = function (z) {
|
53
|
+
if (typeof z !== "object") {
|
54
|
+
z = {};
|
55
|
+
}
|
56
|
+
if (typeof window.btntQueue !== "object") {
|
57
|
+
window.btntQueue = [];
|
58
|
+
}
|
59
|
+
window.btntQueue.push(z);
|
60
|
+
};
|
61
|
+
n = t.createElement(r);
|
62
|
+
pp = t.getElementsByTagName(r)[0];
|
63
|
+
n.async = 1;
|
64
|
+
n.src = window.btntConfig.domain + "/btnt.js";
|
65
|
+
pp.parentNode.insertBefore(n, pp);
|
66
|
+
})(document, "script");
|
67
|
+
window.btnt({
|
68
|
+
event_name: "component_initialized",
|
69
|
+
component_name: 'ifx-alert',
|
70
|
+
});
|
38
71
|
}
|
39
72
|
render() {
|
40
73
|
return this.variant === 'info' ? (index.h("div", { class: "alert__info-wrapper", role: "alert", "aria-live": this.AriaLive, "aria-describedby": this.alertTypeDescription[this.variant], "aria-labelledby": "alert-text alert-description" }, index.h("div", { class: "info__text-wrapper" }, index.h("div", { class: "info__headline-wrapper" }, index.h("slot", { name: "headline" })), index.h("div", { id: `alert-description-${this.uniqueId}`, class: "info__description-wrapper" }, index.h("slot", { name: "desc" }))), this.closable ? this.renderCloseButton() : null)) : (index.h("div", { class: `alert ${this.variant}`, role: "alert" }, this.icon && (index.h("div", { class: "icon-wrapper" }, index.h("ifx-icon", { icon: this.icon }))), index.h("div", { class: "alert-text", id: `alert-text-${this.uniqueId}` }, index.h("slot", null)), this.closable ? this.renderCloseButton() : null));
|
@@ -42,154 +75,94 @@ const Alert = class {
|
|
42
75
|
};
|
43
76
|
Alert.style = IfxAlertStyle0;
|
44
77
|
|
45
|
-
const
|
46
|
-
const
|
78
|
+
const infineonIconStencilCss = "ifx-icon{display:inline-flex;justify-content:center}ifx-icon:empty{display:none}";
|
79
|
+
const IfxIconStyle0 = infineonIconStencilCss;
|
47
80
|
|
48
|
-
const
|
81
|
+
const InfineonIconStencil = class {
|
49
82
|
constructor(hostRef) {
|
50
83
|
index.registerInstance(this, hostRef);
|
51
|
-
this.
|
52
|
-
this.
|
53
|
-
|
54
|
-
|
55
|
-
this.
|
56
|
-
this.
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
const templateName = localStorage.getItem('selectedTemplate');
|
85
|
-
return { repoName, repoDesc, repoFramework, templateName };
|
86
|
-
}
|
87
|
-
async getUserToken(authCode) {
|
88
|
-
const { repoName, repoDesc, repoFramework, templateName } = this.getLocalStorageValues();
|
89
|
-
fetch(`https://ddstemplate-srv.cfapps.eu10-004.hana.ondemand.com/token/${authCode}/${repoName}/${repoDesc}/${repoFramework}/${templateName}`)
|
90
|
-
.then(response => {
|
91
|
-
if (response.ok) {
|
92
|
-
return response.text();
|
93
|
-
}
|
94
|
-
else {
|
95
|
-
return response.text().then(errorMessage => {
|
96
|
-
throw new Error(errorMessage);
|
97
|
-
});
|
84
|
+
this.consoleError = index.createEvent(this, "consoleError", 7);
|
85
|
+
this.icon = "";
|
86
|
+
}
|
87
|
+
updateIcon(newIcon) {
|
88
|
+
this.internalIcon = newIcon;
|
89
|
+
this.setIcon();
|
90
|
+
}
|
91
|
+
convertStringToHtml(htmlString) {
|
92
|
+
const div = document.createElement('div');
|
93
|
+
div.innerHTML = htmlString;
|
94
|
+
return div.firstChild;
|
95
|
+
}
|
96
|
+
convertHtmlToObject(htmlElement) {
|
97
|
+
let pathToObject = Array
|
98
|
+
.from(htmlElement.attributes, ({ name, value }) => ({ name, value }))
|
99
|
+
.reduce((acc, current) => {
|
100
|
+
acc[current.name] = current.value;
|
101
|
+
return acc;
|
102
|
+
}, {});
|
103
|
+
return pathToObject;
|
104
|
+
}
|
105
|
+
convertPathsToVnode(htmlPath) {
|
106
|
+
let svgPaths = [];
|
107
|
+
const parentPath = this.convertHtmlToObject(htmlPath);
|
108
|
+
const parentPathToVnode = index.h("path", parentPath);
|
109
|
+
svgPaths.push(parentPathToVnode);
|
110
|
+
if (htmlPath.firstChild) {
|
111
|
+
const paths = htmlPath.querySelectorAll('path');
|
112
|
+
const pathLength = htmlPath.querySelectorAll('path').length;
|
113
|
+
for (let i = 0; i < pathLength; i++) {
|
114
|
+
let pathToObject = this.convertHtmlToObject(paths[i]);
|
115
|
+
let objToVnode = index.h("path", pathToObject);
|
116
|
+
svgPaths.push(objToVnode);
|
98
117
|
}
|
99
|
-
})
|
100
|
-
.then(data => {
|
101
|
-
if (data) {
|
102
|
-
this.isLoading = false;
|
103
|
-
this.repoUrl = data;
|
104
|
-
localStorage.clear();
|
105
|
-
}
|
106
|
-
})
|
107
|
-
.catch(error => {
|
108
|
-
this.repoError = error.message;
|
109
|
-
console.error('Error:', error.message);
|
110
|
-
});
|
111
|
-
}
|
112
|
-
handleUserInput(e, type) {
|
113
|
-
if (type === 'name') {
|
114
|
-
this.repoDetails = Object.assign(Object.assign({}, this.repoDetails), { name: e.target.value });
|
115
118
|
}
|
116
|
-
|
117
|
-
|
119
|
+
return svgPaths;
|
120
|
+
}
|
121
|
+
getSVG(svgPath) {
|
122
|
+
const htmlPath = this.convertStringToHtml(this.ifxIcon);
|
123
|
+
const width = htmlPath.getAttribute('width');
|
124
|
+
const height = htmlPath.getAttribute('height');
|
125
|
+
const fill = htmlPath.getAttribute('fill');
|
126
|
+
const viewBox = htmlPath.getAttribute('viewBox');
|
127
|
+
return index.h("svg", { class: "inline-svg", width: width, height: height, xmlns: "http://www.w3.org/2000/svg", fill: fill, viewBox: viewBox }, ...svgPath);
|
128
|
+
}
|
129
|
+
constructIcon() {
|
130
|
+
if (this.ifxIcon) {
|
131
|
+
const htmlPath = this.convertStringToHtml(this.ifxIcon);
|
132
|
+
const svgPath = this.convertPathsToVnode(htmlPath);
|
133
|
+
const SVG = this.getSVG(svgPath);
|
134
|
+
return SVG;
|
118
135
|
}
|
119
|
-
else if (
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
submitUserData() {
|
124
|
-
if (this.repoDetails.name && this.repoDetails.desc && this.repoDetails.framework) {
|
125
|
-
localStorage.setItem('repo_name', this.repoDetails.name);
|
126
|
-
localStorage.setItem('repo_desc', this.repoDetails.desc);
|
127
|
-
localStorage.setItem('repo_framework', this.repoDetails.framework);
|
128
|
-
localStorage.setItem('selectedTemplate', this.name);
|
129
|
-
this.fieldError.emit(false);
|
130
|
-
this.authUser();
|
136
|
+
else if (this.icon !== "") {
|
137
|
+
console.error('Icon not found!');
|
138
|
+
this.consoleError.emit(true);
|
139
|
+
return;
|
131
140
|
}
|
132
141
|
else {
|
133
|
-
|
134
|
-
}
|
135
|
-
}
|
136
|
-
togglePadding(action) {
|
137
|
-
let parent = this.el.parentElement;
|
138
|
-
if (parent) {
|
139
|
-
const rootNode = parent.getRootNode();
|
140
|
-
if (rootNode instanceof ShadowRoot) {
|
141
|
-
parent = rootNode.host.parentElement;
|
142
|
-
}
|
143
|
-
else {
|
144
|
-
parent = parent.parentElement;
|
145
|
-
}
|
146
|
-
if (action === 'remove') {
|
147
|
-
parent.parentElement.style.padding = '0px';
|
148
|
-
}
|
149
|
-
else if (action === 'add') {
|
150
|
-
parent.parentElement.style.padding = '4rem 20px';
|
151
|
-
}
|
142
|
+
return;
|
152
143
|
}
|
153
144
|
}
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
}
|
145
|
+
setIcon() {
|
146
|
+
const toCamelCase = str => str
|
147
|
+
.replace(/[-_]+(.)/g, (_, chr) => chr.toUpperCase()) // handle - and _ to uppercase
|
148
|
+
.replace(/^(.)/, (m) => m.toLowerCase()); // ensure first letter is lowercase
|
149
|
+
const iconName = toCamelCase(this.internalIcon);
|
150
|
+
this.ifxIcon = icons.getIcon(iconName);
|
161
151
|
}
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
if (!templateWrapper.classList.contains('hide') && currTemp) {
|
166
|
-
if (templateWrapper !== currTemp) {
|
167
|
-
templateWrapper.classList.add('hide');
|
168
|
-
}
|
169
|
-
}
|
170
|
-
else {
|
171
|
-
if (this.showDetails) {
|
172
|
-
this.showDetails = false;
|
173
|
-
}
|
174
|
-
this.togglePadding('add');
|
175
|
-
templateWrapper.classList.remove('hide');
|
176
|
-
}
|
177
|
-
}
|
152
|
+
componentWillLoad() {
|
153
|
+
this.internalIcon = this.icon;
|
154
|
+
this.setIcon();
|
178
155
|
}
|
179
156
|
render() {
|
180
|
-
return (index.h(
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
index.h("div", { class: "react__template-container" }, index.h("div", { class: "react__template-wrapper", onClick: (e) => this.handleCurrentTemplate(e) }, index.h("div", { class: "image__wrapper" }, index.h("img", { src: this.thumbnail }))), this.showDetails &&
|
186
|
-
index.h("div", { class: "details__wrapper" }, index.h("div", { class: "selection__buttons-wrapper" }, index.h("div", { class: "selection__input" }, index.h("input", { type: "radio", id: "react", name: "chosen_framework", value: "react", onInput: (e) => this.handleUserInput(e, 'framework') }), index.h("label", { htmlFor: "react" }, "React")), index.h("div", { class: "selection__input vue" }, index.h("input", { class: "vue__input", disabled: true, type: "radio", id: "vue", name: "chosen_framework", value: "vue", onInput: (e) => this.handleUserInput(e, 'framework') }), index.h("label", { class: "vue__label", htmlFor: "vue" }, "Vue"), " (Soon)")), index.h("div", { class: "input__fields-wrapper" }, index.h("ifx-text-field", { required: true, onInput: (e) => this.handleUserInput(e, 'name'), size: "m", icon: "c-info-16", placeholder: "Your repository name" }, "Repository Name"), index.h("ifx-text-field", { required: true, size: "m", icon: "c-info-16", onInput: (e) => this.handleUserInput(e, 'desc'), placeholder: "Your repository description" }, "Repository Description"), index.h("ifx-button", { fullWidth: true, onClick: () => this.submitUserData(), variant: 'primary' }, "Generate template"))))));
|
187
|
-
}
|
188
|
-
get el() { return index.getElement(this); }
|
157
|
+
return (index.h(index.Host, { key: '28a16b1fa9ecc7e956d9012e18e0d7ca71d839b2' }, this.constructIcon()));
|
158
|
+
}
|
159
|
+
static get watchers() { return {
|
160
|
+
"icon": ["updateIcon"]
|
161
|
+
}; }
|
189
162
|
};
|
190
|
-
|
163
|
+
InfineonIconStencil.style = IfxIconStyle0;
|
191
164
|
|
192
165
|
exports.ifx_alert = Alert;
|
193
|
-
exports.
|
166
|
+
exports.ifx_icon = InfineonIconStencil;
|
194
167
|
|
195
168
|
//# sourceMappingURL=ifx-alert_2.cjs.entry.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"file":"ifx-alert.ifx-template.entry.cjs.js","mappings":";;;;;;AAAA,MAAM,QAAQ,GAAG,8mFAA8mF,CAAC;AAChoF,uBAAe,QAAQ;;MCMV,KAAK;IALlB;;;QAMU,YAAO,GAA0D,SAAS,CAAC;QAG3E,aAAQ,GAAY,IAAI,CAAC;QACzB,aAAQ,GAAG,WAAW,CAAC;QAG/B,yBAAoB,GAAG;YACrB,SAAS,EAAE,eAAe;YAC1B,SAAS,EAAE,eAAe;YAC1B,QAAQ,EAAE,aAAa;YACvB,SAAS,EAAE,eAAe;YAC1B,MAAM,EAAE,eAAe;SACxB,CAAC;KAqDH;IAnDC,WAAW;QACT,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;KACtB;IAED,iBAAiB;QACf,QACEA,iBAAK,KAAK,EAAC,oBAAoB,IAC7BA,oBAAQ,OAAO,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAa,eAAe,IACtEA,sBAAU,IAAI,EAAC,UAAU,GAAG,CACrB,CACL,EACN;KACH;IAED,gBAAgB,CAAC,MAAM,GAAG,IAAI;QAC5B,OAAO,GAAG,MAAM,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;KAClE;IAED,iBAAiB;QACf,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;YAClB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAA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C,YAAY,EAAC,OAAO,EAAC,KAAK,UAAY,YAC/C,CACF,EAGNA,iBAAK,KAAK,EAAC,uBAAuB,IAChCA,4BAAgB,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC,KAAK,IAAI,CAAC,eAAe,CAAC,CAAC,EAAE,MAAM,CAAC,EAAE,IAAI,EAAC,GAAG,EAAC,IAAI,EAAC,WAAW,EAAC,WAAW,EAAC,sBAAsB,sBAAiC,EAE9KA,4BAAgB,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAC,GAAG,EAAC,IAAI,EAAC,WAAW,EAAC,OAAO,EAAE,CAAC,CAAC,KAAK,IAAI,CAAC,eAAe,CAAC,CAAC,EAAE,MAAM,CAAC,EAAE,WAAW,EAAC,6BAA6B,6BAAwC,EAE5LA,wBAAY,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC,cAAc,EAAE,EAAE,OAAO,EAAC,SAAS,wBAA+B,CAC/G,CAEF,CACF,CACF,EACN;KACL;;;;;;;;","names":["h"],"sources":["src/components/alert/alert.scss?tag=ifx-alert&encapsulation=shadow","src/components/alert/alert.tsx","src/components/templates/template/template.scss?tag=ifx-template&encapsulation=shadow","src/components/templates/template/template.tsx"],"sourcesContent":["@use \"~@infineon/design-system-tokens/dist/tokens\";\n@use \"../../global/font.scss\";\n\n:host {\n display: block;\n}\n\n.alert__info-wrapper {\n display: flex;\n padding: 16px 24px;\n font-family: var(--ifx-font-family); // tokens.$ifxFontFamilyBody;\n\n\n box-shadow: 0px 6px 9px 0px #1D1D1D1A;\n\n & .info__text-wrapper {\n display: flex;\n flex-direction: column;\n gap: tokens.$ifxSpace100;\n width: 100%;\n\n & .info__headline-wrapper {\n display: -webkit-box;\n -webkit-line-clamp: 1;\n line-clamp: 1;\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n & .info__headline-wrapper,\n .info__description-wrapper {\n color: #1D1D1D;\n font-size: 16px;\n font-style: normal;\n font-weight: 600;\n line-height: 24px;\n\n ::slotted(p) {\n padding: 0;\n margin: 0;\n }\n }\n\n & .info__description-wrapper {\n font-weight: 400;\n }\n }\n\n & .close-icon-wrapper {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n justify-content: flex-start;\n //min-width: tokens.$ifxSize500;\n\n & button {\n all: unset;\n display: flex;\n align-items: center;\n justify-content: center;\n line-height: 0;\n color: tokens.$ifxColorBaseBlack;\n height: tokens.$ifxSize300;\n width: tokens.$ifxSize300;\n\n\n &:focus {\n outline: 2px solid tokens.$ifxColorOcean500;\n outline-offset: 2px;\n }\n }\n }\n}\n\n.alert {\n display: flex;\n border: 1px solid tokens.$ifxColorOcean500;\n border-radius: tokens.$ifxBorderRadius12;\n color: tokens.$ifxColorBaseBlack;\n background-color: tokens.$ifxColorBaseWhite;\n font-family: var(--ifx-font-family); // tokens.$ifxFontFamilyBody;\n\n\n box-shadow: 0px 6px 9px 0px #1D1D1D1A;\n\n\n & .close-icon-wrapper {\n display: flex;\n align-items: center;\n justify-content: center;\n min-width: tokens.$ifxSize500;\n\n & button {\n all: unset;\n display: flex;\n align-items: center;\n justify-content: center;\n line-height: 0;\n color: tokens.$ifxColorBaseBlack;\n height: tokens.$ifxSize300;\n width: tokens.$ifxSize300;\n\n &:focus {\n outline: 2px solid tokens.$ifxColorOcean500;\n outline-offset: 2px;\n }\n }\n }\n\n & .icon-wrapper {\n position: relative;\n min-width: tokens.$ifxSize600;\n display: flex;\n justify-content: center;\n align-items: center;\n background-color: tokens.$ifxColorOcean500;\n }\n\n & .alert-text {\n font-size: 16px;\n width: 100%;\n padding: 12px 0px 12px 12px;\n color: tokens.$ifxColorBaseBlack;\n\n white-space: pre-wrap;\n /* wraps text at spaces and within words */\n word-wrap: break-word;\n /* breaks text within a word if necessary */\n overflow-wrap: anywhere;\n /* breaks text at arbitrary points when needed */\n }\n\n &.primary {\n border: 1px solid tokens.$ifxColorOcean500;\n\n & .icon-wrapper {\n background-color: tokens.$ifxColorOcean500;\n color: tokens.$ifxColorBaseWhite;\n }\n }\n\n &.success {\n border: 1px solid tokens.$ifxColorGreen500;\n\n & .icon-wrapper {\n background-color: tokens.$ifxColorGreen500;\n color: tokens.$ifxColorBaseWhite;\n }\n }\n\n &.danger {\n border: 1px solid tokens.$ifxColorRed500;\n\n & .icon-wrapper {\n background-color: tokens.$ifxColorRed500;\n color: tokens.$ifxColorBaseWhite;\n }\n }\n\n &.warning {\n border: 1px solid tokens.$ifxColorOrange500;\n\n & .icon-wrapper {\n background-color: tokens.$ifxColorOrange500;\n color: tokens.$ifxColorBaseWhite;\n }\n }\n}\n\n.close-icon-wrapper {\n & ifx-icon {\n &:hover {\n cursor: pointer;\n }\n }\n}","import { Component, Prop, h, Event, EventEmitter, State } from '@stencil/core';\n\n@Component({\n tag: 'ifx-alert',\n styleUrl: 'alert.scss',\n shadow: true,\n})\nexport class Alert {\n @Prop() variant: 'primary' | 'success' | 'danger' | 'warning' | 'info' = 'primary';\n @Prop() icon: string;\n @Event() ifxClose: EventEmitter;\n @Prop() closable: boolean = true;\n @Prop() AriaLive = 'assertive';\n @State() uniqueId: string;\n\n alertTypeDescription = {\n \"primary\": 'Neutral alert',\n \"success\": 'Success Alert',\n \"danger\": 'Error Alert',\n \"warning\": 'Warning Alert',\n \"info\": 'Neutral alert',\n };\n\n handleClose() {\n this.ifxClose.emit();\n }\n\n renderCloseButton() {\n return (\n <div class=\"close-icon-wrapper\">\n <button onClick={this.handleClose.bind(this)} aria-label=\"Dismiss alert\">\n <ifx-icon icon=\"cross-16\" />\n </button>\n </div>\n );\n }\n\n generateUniqueId(prefix = 'id') {\n return `${prefix}-${Math.random().toString(36).substring(2, 9)}`;\n }\n\n componentWillLoad() { \n if (!this.uniqueId) {\n this.uniqueId = this.generateUniqueId('alert');\n }\n }\n\n render() {\n return this.variant === 'info' ? (\n <div class=\"alert__info-wrapper\" role=\"alert\" aria-live={this.AriaLive} aria-describedby={this.alertTypeDescription[this.variant]} aria-labelledby=\"alert-text alert-description\">\n <div class=\"info__text-wrapper\">\n <div class=\"info__headline-wrapper\">\n <slot name=\"headline\" />\n </div>\n <div id={`alert-description-${this.uniqueId}`} class=\"info__description-wrapper\">\n <slot name=\"desc\" />\n </div>\n </div>\n {this.closable ? this.renderCloseButton() : null}\n </div>\n ) : (\n <div class={`alert ${this.variant}`} role=\"alert\">\n {this.icon && (\n <div class=\"icon-wrapper\">\n <ifx-icon icon={this.icon} />\n </div>\n )}\n <div class=\"alert-text\" id={`alert-text-${this.uniqueId}`}>\n <slot />\n </div>\n {this.closable ? this.renderCloseButton() : null}\n </div>\n );\n }\n}\n","\n.react__template-wrapper { \n display: flex;\n width: 300px;\n height: 200px;\n border-radius: 3px;\n border: 1px solid #ccc;\n\n &.hide { \n display: none;\n }\n \n &:hover { \n cursor: pointer;\n }\n}\n\n.template__page-wrapper {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n text-align: center;\n\n & .repository__url { \n text-decoration: none;\n }\n}\n\n.input__fields-wrapper { \n display: flex;\n flex-direction: column;\n gap: 10px;\n\n}\n\n.details__wrapper { \n display: flex;\n flex-direction: column;\n gap: 10px;\n}\n\n.selection__buttons-wrapper { \n display: flex;\n gap: 10px;\n padding-top: 10px;\n align-items: center;\n & .vue__label { \n color: #ccc;\n }\n\n & label:not(.vue__label) { \n &:hover { \n cursor: pointer;\n }\n }\n\n & .selection__input { \n display: flex;\n align-items: center;\n gap: 5px;\n & input { \n margin: 0;\n height: 20px;\n width: 20px;\n &:hover:not(.vue__input) { \n cursor: pointer;\n }\n }\n }\n}\n\n.image__wrapper { \n img { \n position: relative;\n width: 300px;\n height: 100%;\n border-radius: 3px;\n object-fit: contain;\n transition: transform .2s;\n &:hover { \n transform: scale(2);\n top: 50px;\n z-index: 100;\n }\n }\n}","import { Component, h, Element, State, Prop, Event, EventEmitter, Method } from '@stencil/core';\n\n@Component({\n tag: 'ifx-template',\n styleUrl: 'template.scss',\n shadow: true,\n})\nexport class Template {\n @Element() el: HTMLElement;\n @State() repoDetails: { name: string, desc: string, framework: string } = { name: \"\", desc: \"\", framework: \"\" };\n @State() repoUrl: string;\n @State() showDetails: boolean = false;\n @State() isTemplatePage: boolean = false;\n @State() isLoading: boolean = true;\n @State() repoError: string;\n @Prop() name: string;\n @Event() toggleTemplates: EventEmitter;\n @Event() fieldError: EventEmitter;\n @Prop() thumbnail: string;\n \n private clientId = 'Ov23lixmXiNTTNb6V5W6'\n private redirectUri = 'https://infineon.github.io/infineon-design-system-stencil/?path=/docs/dds-templates--development';\n private scope = 'repo workflow'\n private state = 'template123'\n\n authUser() { \n const authorizationUrl = `https://github.com/login/oauth/authorize?` +\n `client_id=${this.clientId}&` +\n `redirect_uri=${this.redirectUri}&` +\n `scope=${this.scope}&` +\n `state=${this.state}`;\n \n window.open(authorizationUrl, '_blank'); \n }\n\n componentDidLoad() { \n const url = new URL(window.location.href);\n const code = url.searchParams.get('code');\n const { templateName } = this.getLocalStorageValues()\n if(code && this.name === templateName) { \n this.isTemplatePage = true;\n this.toggleTemplates.emit('details')\n this.getUserToken(code)\n } \n }\n\n getLocalStorageValues() { \n const repoName = localStorage.getItem('repo_name');\n const repoDesc = localStorage.getItem('repo_desc');\n const repoFramework = localStorage.getItem('repo_framework');\n const templateName = localStorage.getItem('selectedTemplate');\n return { repoName, repoDesc, repoFramework, templateName }\n }\n\n async getUserToken(authCode) {\n const { repoName, repoDesc, repoFramework, templateName } = this.getLocalStorageValues();\n\n fetch(`https://ddstemplate-srv.cfapps.eu10-004.hana.ondemand.com/token/${authCode}/${repoName}/${repoDesc}/${repoFramework}/${templateName}`)\n .then(response => {\n if (response.ok) {\n return response.text();\n } else {\n return response.text().then(errorMessage => {\n throw new Error(errorMessage);\n });\n }\n })\n .then(data => { \n if(data) { \n this.isLoading = false;\n this.repoUrl = data;\n localStorage.clear();\n } \n })\n .catch(error => {\n this.repoError = error.message;\n console.error('Error:', error.message)\n });\n }\n\n handleUserInput(e, type) { \n if (type === 'name') {\n this.repoDetails = { ...this.repoDetails, name: e.target.value };\n } else if (type === 'desc') {\n this.repoDetails = { ...this.repoDetails, desc: e.target.value };\n } else if(type === 'framework') { \n this.repoDetails = { ...this.repoDetails, framework: e.target.value };\n }\n }\n\n submitUserData() { \n if(this.repoDetails.name && this.repoDetails.desc && this.repoDetails.framework) { \n localStorage.setItem('repo_name', this.repoDetails.name);\n localStorage.setItem('repo_desc', this.repoDetails.desc);\n localStorage.setItem('repo_framework', this.repoDetails.framework);\n localStorage.setItem('selectedTemplate', this.name);\n this.fieldError.emit(false)\n this.authUser()\n } else { \n this.fieldError.emit('All fields are mandatory')\n }\n }\n\n togglePadding(action) { \n let parent = this.el.parentElement;\n if (parent) {\n const rootNode = parent.getRootNode();\n if (rootNode instanceof ShadowRoot) {\n parent = rootNode.host.parentElement;\n } else {\n parent = parent.parentElement;\n }\n if(action === 'remove') { \n parent.parentElement.style.padding = '0px';\n } else if(action === 'add') { \n parent.parentElement.style.padding = '4rem 20px';\n }\n }\n }\n\n handleCurrentTemplate(e) { \n if(e && !this.showDetails) { \n this.togglePadding('remove')\n const targetTemplate = e.currentTarget;\n this.toggleTemplates.emit(targetTemplate)\n this.showDetails = true;\n } \n }\n\n @Method()\n async toggleTemplate(currTemp) { \n const templateWrapper = this.el.shadowRoot.querySelector('.react__template-wrapper');\n if(templateWrapper) { \n if(!templateWrapper.classList.contains('hide') && currTemp ) { \n if(templateWrapper !== currTemp) {\n templateWrapper.classList.add('hide')\n }\n } else { \n if(this.showDetails) { \n this.showDetails = false;\n }\n this.togglePadding('add')\n templateWrapper.classList.remove('hide')\n }\n }\n }\n\n \n render() {\n return (\n <div>\n {this.isTemplatePage \n ? \n <div class=\"template__page-wrapper\">\n {!this.repoUrl && !this.repoError && \n <div>\n <h3>Your repository is getting ready..</h3>\n <p>This will only take a minute.</p>\n </div>}\n {this.isLoading && !this.repoError && <div><ifx-spinner variant='default' size='s' /></div>}\n {this.repoUrl && <ifx-link href={this.repoUrl} target=\"_parent\" size=\"m\" variant=\"underlined\">Your repository</ifx-link>}\n {this.repoError && <div>{this.repoError}</div>}\n </div> \n : \n <div class=\"react__template-container\">\n <div class=\"react__template-wrapper\" onClick={(e) => this.handleCurrentTemplate(e)}>\n <div class=\"image__wrapper\">\n <img src={this.thumbnail} />\n </div>\n </div>\n {this.showDetails && \n <div class=\"details__wrapper\">\n <div class=\"selection__buttons-wrapper\">\n <div class=\"selection__input\">\n <input type=\"radio\" id=\"react\" name=\"chosen_framework\" value=\"react\" onInput={(e) => this.handleUserInput(e, 'framework')} />\n <label htmlFor=\"react\">React</label>\n </div>\n <div class=\"selection__input vue\">\n <input class=\"vue__input\" disabled type=\"radio\" id=\"vue\" name=\"chosen_framework\" value=\"vue\" onInput={(e) => this.handleUserInput(e, 'framework')}/>\n <label class=\"vue__label\" htmlFor=\"vue\">Vue</label> (Soon)\n </div>\n </div>\n \n\n <div class=\"input__fields-wrapper\">\n <ifx-text-field required={true} onInput={(e) => this.handleUserInput(e, 'name')} size=\"m\" icon=\"c-info-16\" placeholder=\"Your repository name\">Repository Name</ifx-text-field>\n\n <ifx-text-field required={true} size=\"m\" icon=\"c-info-16\" onInput={(e) => this.handleUserInput(e, 'desc')} placeholder=\"Your repository description\">Repository Description</ifx-text-field>\n\n <ifx-button fullWidth={true} onClick={() => this.submitUserData()} variant='primary'>Generate template</ifx-button>\n </div>\n \n </div>}\n </div>}\n </div>\n );\n }\n}"],"version":3}
|
1
|
+
{"file":"ifx-alert.ifx-icon.entry.cjs.js","mappings":";;;;;;;AAAA,MAAM,QAAQ,GAAG,8mFAA8mF,CAAC;AAChoF,uBAAe,QAAQ;;MCcV,KAAK;IALlB;;;QAMU,YAAO,GAA0D,SAAS,CAAC;QAG3E,aAAQ,GAAY,IAAI,CAAC;QACzB,aAAQ,GAAG,WAAW,CAAC;QAG/B,yBAAoB,GAAG;YACrB,SAAS,EAAE,eAAe;YAC1B,SAAS,EAAE,eAAe;YAC1B,QAAQ,EAAE,aAAa;YACvB,S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OAAO,EAAE;YACf,MAAM,QAAQ,GAAG,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;YACvD,MAAM,OAAO,GAAG,IAAI,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAA;YAClD,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;YAChC,OAAO,GAAG,CAAC;SACZ;aAAM,IAAG,IAAI,CAAC,IAAI,KAAK,EAAE,EAAE;YAC1B,OAAO,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAA;YAChC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;YAC5B,OAAO;SACR;aAAO;YACN,OAAO;SACR;KACF;IAEH,OAAO;QACL,MAAM,WAAW,GAAG,GAAG,IACrB,GAAG;aACA,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,GAAG,CAAC,WAAW,EAAE,CAAC;aACnD,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;QAE7C,MAAM,QAAQ,GAAG,WAAW,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAChD,IAAI,CAAC,OAAO,GAAGC,aAAO,CAAC,QAAQ,CAAC,CAAC;KAClC;IAEC,iBAAiB;QACf,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC;QAC9B,IAAI,CAAC,OAAO,EAAE,CAAA;KACf;IAED,MAAM;QACJ,QACED,QAACE,UAAI,uDACJ,IAAI,CAAC,aAAa,EAAE,CACd,EACP;KACH;;;;;;;;;;","names":["h","getIcon","Host"],"sources":["src/components/alert/alert.scss?tag=ifx-alert&encapsulation=shadow","src/components/alert/alert.tsx","src/components/icon/infineonIconStencil.scss?tag=ifx-icon","src/components/icon/infineonIconStencil.tsx"],"sourcesContent":["@use \"~@infineon/design-system-tokens/dist/tokens\";\n@use \"../../global/font.scss\";\n\n:host {\n display: block;\n}\n\n.alert__info-wrapper {\n display: flex;\n padding: 16px 24px;\n font-family: var(--ifx-font-family); // tokens.$ifxFontFamilyBody;\n\n\n box-shadow: 0px 6px 9px 0px #1D1D1D1A;\n\n & .info__text-wrapper {\n display: flex;\n flex-direction: column;\n gap: tokens.$ifxSpace100;\n width: 100%;\n\n & .info__headline-wrapper {\n display: -webkit-box;\n -webkit-line-clamp: 1;\n line-clamp: 1;\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n & .info__headline-wrapper,\n .info__description-wrapper {\n color: #1D1D1D;\n font-size: 16px;\n font-style: normal;\n font-weight: 600;\n line-height: 24px;\n\n ::slotted(p) {\n padding: 0;\n margin: 0;\n }\n }\n\n & .info__description-wrapper {\n font-weight: 400;\n }\n }\n\n & .close-icon-wrapper {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n justify-content: flex-start;\n //min-width: tokens.$ifxSize500;\n\n & button {\n all: unset;\n display: flex;\n align-items: center;\n justify-content: center;\n line-height: 0;\n color: tokens.$ifxColorBaseBlack;\n height: tokens.$ifxSize300;\n width: tokens.$ifxSize300;\n\n\n &:focus {\n outline: 2px solid tokens.$ifxColorOcean500;\n outline-offset: 2px;\n }\n }\n }\n}\n\n.alert {\n display: flex;\n border: 1px solid tokens.$ifxColorOcean500;\n border-radius: tokens.$ifxBorderRadius12;\n color: tokens.$ifxColorBaseBlack;\n background-color: tokens.$ifxColorBaseWhite;\n font-family: var(--ifx-font-family); // tokens.$ifxFontFamilyBody;\n\n\n box-shadow: 0px 6px 9px 0px #1D1D1D1A;\n\n\n & .close-icon-wrapper {\n display: flex;\n align-items: center;\n justify-content: center;\n min-width: tokens.$ifxSize500;\n\n & button {\n all: unset;\n display: flex;\n align-items: center;\n justify-content: center;\n line-height: 0;\n color: tokens.$ifxColorBaseBlack;\n height: tokens.$ifxSize300;\n width: tokens.$ifxSize300;\n\n &:focus {\n outline: 2px solid tokens.$ifxColorOcean500;\n outline-offset: 2px;\n }\n }\n }\n\n & .icon-wrapper {\n position: relative;\n min-width: tokens.$ifxSize600;\n display: flex;\n justify-content: center;\n align-items: center;\n background-color: tokens.$ifxColorOcean500;\n }\n\n & .alert-text {\n font-size: 16px;\n width: 100%;\n padding: 12px 0px 12px 12px;\n color: tokens.$ifxColorBaseBlack;\n\n white-space: pre-wrap;\n /* wraps text at spaces and within words */\n word-wrap: break-word;\n /* breaks text within a word if necessary */\n overflow-wrap: anywhere;\n /* breaks text at arbitrary points when needed */\n }\n\n &.primary {\n border: 1px solid tokens.$ifxColorOcean500;\n\n & .icon-wrapper {\n background-color: tokens.$ifxColorOcean500;\n color: tokens.$ifxColorBaseWhite;\n }\n }\n\n &.success {\n border: 1px solid tokens.$ifxColorGreen500;\n\n & .icon-wrapper {\n background-color: tokens.$ifxColorGreen500;\n color: tokens.$ifxColorBaseWhite;\n }\n }\n\n &.danger {\n border: 1px solid tokens.$ifxColorRed500;\n\n & .icon-wrapper {\n background-color: tokens.$ifxColorRed500;\n color: tokens.$ifxColorBaseWhite;\n }\n }\n\n &.warning {\n border: 1px solid tokens.$ifxColorOrange500;\n\n & .icon-wrapper {\n background-color: tokens.$ifxColorOrange500;\n color: tokens.$ifxColorBaseWhite;\n }\n }\n}\n\n.close-icon-wrapper {\n & ifx-icon {\n &:hover {\n cursor: pointer;\n }\n }\n}","import { Component, Prop, h, Event, EventEmitter, State } from '@stencil/core';\n\ndeclare global {\n interface Window {\n btntConfig?: any;\n btntQueue?: any;\n btnt?: any;\n }\n}\n\n@Component({\n tag: 'ifx-alert',\n styleUrl: 'alert.scss',\n shadow: true,\n})\nexport class Alert {\n @Prop() variant: 'primary' | 'success' | 'danger' | 'warning' | 'info' = 'primary';\n @Prop() icon: string;\n @Event() ifxClose: EventEmitter;\n @Prop() closable: boolean = true;\n @Prop() AriaLive = 'assertive';\n @State() uniqueId: string;\n\n alertTypeDescription = {\n \"primary\": 'Neutral alert',\n \"success\": 'Success Alert',\n \"danger\": 'Error Alert',\n \"warning\": 'Warning Alert',\n \"info\": 'Neutral alert',\n };\n\n handleClose() {\n this.ifxClose.emit();\n }\n\n renderCloseButton() {\n return (\n <div class=\"close-icon-wrapper\">\n <button onClick={this.handleClose.bind(this)} aria-label=\"Dismiss alert\">\n <ifx-icon icon=\"cross-16\" />\n </button>\n </div>\n );\n }\n\n generateUniqueId(prefix = 'id') {\n return `${prefix}-${Math.random().toString(36).substring(2, 9)}`;\n }\n\n componentWillLoad() { \n if (!this.uniqueId) {\n this.uniqueId = this.generateUniqueId('alert');\n }\n\n this.initalizeTracking()\n \n\n }\n\n initalizeTracking() { \n (function (t, r, kk, n, pp) {\n if (typeof window.btntConfig !== \"object\") {\n window.btntConfig = {\n domain: \"https://ssgtm.infineon.com\",\n withCookies: true,\n maxBatchSize: 10\n };\n }\n\n if (window[\"btnt\"]) return;\n\n window[\"btnt\"] = function (z) {\n if (typeof z !== \"object\") {\n z = {};\n }\n if (typeof window.btntQueue !== \"object\") {\n window.btntQueue = [];\n }\n window.btntQueue.push(z);\n };\n\n n = t.createElement(r);\n pp = t.getElementsByTagName(r)[0];\n n.async = 1;\n n.src = window.btntConfig.domain + \"/btnt.js\";\n pp.parentNode.insertBefore(n, pp);\n \n })(document, \"script\", );\n\n window.btnt({\n event_name: \"component_initialized\",\n component_name: 'ifx-alert',\n })\n }\n\n render() {\n return this.variant === 'info' ? (\n <div class=\"alert__info-wrapper\" role=\"alert\" aria-live={this.AriaLive} aria-describedby={this.alertTypeDescription[this.variant]} aria-labelledby=\"alert-text alert-description\">\n <div class=\"info__text-wrapper\">\n <div class=\"info__headline-wrapper\">\n <slot name=\"headline\" />\n </div>\n <div id={`alert-description-${this.uniqueId}`} class=\"info__description-wrapper\">\n <slot name=\"desc\" />\n </div>\n </div>\n {this.closable ? this.renderCloseButton() : null}\n </div>\n ) : (\n <div class={`alert ${this.variant}`} role=\"alert\">\n {this.icon && (\n <div class=\"icon-wrapper\">\n <ifx-icon icon={this.icon} />\n </div>\n )}\n <div class=\"alert-text\" id={`alert-text-${this.uniqueId}`}>\n <slot />\n </div>\n {this.closable ? this.renderCloseButton() : null}\n </div>\n );\n }\n}\n","ifx-icon {\n display: inline-flex;\n justify-content: center;\n\n &:empty {\n display: none;\n }\n}","import { Component, Prop, h, Host, Event, EventEmitter, Watch, State } from '@stencil/core';\nimport { getIcon } from '@infineon/infineon-icons'\n \n\n\n@Component({\n tag: 'ifx-icon',\n styleUrl: './infineonIconStencil.scss'\n})\n\nexport class InfineonIconStencil {\n @Prop({ mutable: true }) icon: string = \"\"\n @Prop({ mutable: true }) ifxIcon: any;\n @State() internalIcon: string;\n @Event() consoleError: EventEmitter<boolean>;\n\n @Watch('icon')\n updateIcon(newIcon: string) { \n this.internalIcon = newIcon;\n this.setIcon()\n }\n\n convertStringToHtml(htmlString) { \n const div = document.createElement('div')\n div.innerHTML = htmlString\n return div.firstChild\n }\n\n convertHtmlToObject(htmlElement) { \n let pathToObject = Array\n .from(htmlElement.attributes, ({ name, value }) => ({ name, value }))\n .reduce((acc, current) => {\n acc[current.name] = current.value\n return acc\n }, {})\n\n return pathToObject\n }\n\n convertPathsToVnode(htmlPath) { \n let svgPaths = []\n const parentPath = this.convertHtmlToObject(htmlPath);\n const parentPathToVnode = h(\"path\", parentPath);\n svgPaths.push(parentPathToVnode)\n if(htmlPath.firstChild) { \n const paths = htmlPath.querySelectorAll('path');\n const pathLength = htmlPath.querySelectorAll('path').length;\n for(let i = 0; i < pathLength; i++) { \n let pathToObject = this.convertHtmlToObject(paths[i])\n let objToVnode = h(\"path\", pathToObject)\n svgPaths.push(objToVnode)\n } \n }\n return svgPaths\n }\n\n getSVG(svgPath) {\n const htmlPath = this.convertStringToHtml(this.ifxIcon) as SVGElement;\n const width = htmlPath.getAttribute('width');\n const height = htmlPath.getAttribute('height');\n const fill = htmlPath.getAttribute('fill');\n const viewBox = htmlPath.getAttribute('viewBox');\n \n return <svg class=\"inline-svg\" width={width} height={height} xmlns=\"http://www.w3.org/2000/svg\" fill={fill} viewBox={viewBox}>{...svgPath}</svg>\n }\n\n constructIcon() {\n if(this.ifxIcon) {\n const htmlPath = this.convertStringToHtml(this.ifxIcon)\n const svgPath = this.convertPathsToVnode(htmlPath)\n const SVG = this.getSVG(svgPath)\n return SVG;\n } else if(this.icon !== \"\") {\n console.error('Icon not found!')\n this.consoleError.emit(true)\n return;\n } else { \n return;\n }\n }\n\nsetIcon() { \n const toCamelCase = str =>\n str\n .replace(/[-_]+(.)/g, (_, chr) => chr.toUpperCase()) // handle - and _ to uppercase\n .replace(/^(.)/, (m) => m.toLowerCase()); // ensure first letter is lowercase\n\n const iconName = toCamelCase(this.internalIcon);\n this.ifxIcon = getIcon(iconName);\n}\n\n componentWillLoad() {\n this.internalIcon = this.icon;\n this.setIcon()\n }\n\n render() {\n return (\n <Host>\n {this.constructIcon()}\n </Host>\n );\n }\n}"],"version":3}
|
@@ -0,0 +1,156 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
4
|
+
|
5
|
+
const index = require('./index-7f4df11a.js');
|
6
|
+
|
7
|
+
const templateCss = ".react__template-wrapper{display:flex;width:300px;height:200px;border-radius:3px;border:1px solid #ccc}.react__template-wrapper.hide{display:none}.react__template-wrapper:hover{cursor:pointer}.template__page-wrapper{display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center}.template__page-wrapper .repository__url{text-decoration:none}.input__fields-wrapper{display:flex;flex-direction:column;gap:10px}.details__wrapper{display:flex;flex-direction:column;gap:10px}.selection__buttons-wrapper{display:flex;gap:10px;padding-top:10px;align-items:center}.selection__buttons-wrapper .vue__label{color:#ccc}.selection__buttons-wrapper label:not(.vue__label):hover{cursor:pointer}.selection__buttons-wrapper .selection__input{display:flex;align-items:center;gap:5px}.selection__buttons-wrapper .selection__input input{margin:0;height:20px;width:20px}.selection__buttons-wrapper .selection__input input:hover:not(.vue__input){cursor:pointer}.image__wrapper img{position:relative;width:300px;height:100%;border-radius:3px;object-fit:contain;transition:transform 0.2s}.image__wrapper img:hover{transform:scale(2);top:50px;z-index:100}";
|
8
|
+
const IfxTemplateStyle0 = templateCss;
|
9
|
+
|
10
|
+
const Template = class {
|
11
|
+
constructor(hostRef) {
|
12
|
+
index.registerInstance(this, hostRef);
|
13
|
+
this.toggleTemplates = index.createEvent(this, "toggleTemplates", 7);
|
14
|
+
this.fieldError = index.createEvent(this, "fieldError", 7);
|
15
|
+
this.repoDetails = { name: "", desc: "", framework: "" };
|
16
|
+
this.showDetails = false;
|
17
|
+
this.isTemplatePage = false;
|
18
|
+
this.isLoading = true;
|
19
|
+
this.clientId = 'Ov23lixmXiNTTNb6V5W6';
|
20
|
+
this.redirectUri = 'https://infineon.github.io/infineon-design-system-stencil/?path=/docs/dds-templates--development';
|
21
|
+
this.scope = 'repo workflow';
|
22
|
+
this.state = 'template123';
|
23
|
+
}
|
24
|
+
authUser() {
|
25
|
+
const authorizationUrl = `https://github.com/login/oauth/authorize?` +
|
26
|
+
`client_id=${this.clientId}&` +
|
27
|
+
`redirect_uri=${this.redirectUri}&` +
|
28
|
+
`scope=${this.scope}&` +
|
29
|
+
`state=${this.state}`;
|
30
|
+
window.open(authorizationUrl, '_blank');
|
31
|
+
}
|
32
|
+
componentDidLoad() {
|
33
|
+
const url = new URL(window.location.href);
|
34
|
+
const code = url.searchParams.get('code');
|
35
|
+
const { templateName } = this.getLocalStorageValues();
|
36
|
+
if (code && this.name === templateName) {
|
37
|
+
this.isTemplatePage = true;
|
38
|
+
this.toggleTemplates.emit('details');
|
39
|
+
this.getUserToken(code);
|
40
|
+
}
|
41
|
+
}
|
42
|
+
getLocalStorageValues() {
|
43
|
+
const repoName = localStorage.getItem('repo_name');
|
44
|
+
const repoDesc = localStorage.getItem('repo_desc');
|
45
|
+
const repoFramework = localStorage.getItem('repo_framework');
|
46
|
+
const templateName = localStorage.getItem('selectedTemplate');
|
47
|
+
return { repoName, repoDesc, repoFramework, templateName };
|
48
|
+
}
|
49
|
+
async getUserToken(authCode) {
|
50
|
+
const { repoName, repoDesc, repoFramework, templateName } = this.getLocalStorageValues();
|
51
|
+
fetch(`https://ddstemplate-srv.cfapps.eu10-004.hana.ondemand.com/token/${authCode}/${repoName}/${repoDesc}/${repoFramework}/${templateName}`)
|
52
|
+
.then(response => {
|
53
|
+
if (response.ok) {
|
54
|
+
return response.text();
|
55
|
+
}
|
56
|
+
else {
|
57
|
+
return response.text().then(errorMessage => {
|
58
|
+
throw new Error(errorMessage);
|
59
|
+
});
|
60
|
+
}
|
61
|
+
})
|
62
|
+
.then(data => {
|
63
|
+
if (data) {
|
64
|
+
this.isLoading = false;
|
65
|
+
this.repoUrl = data;
|
66
|
+
localStorage.clear();
|
67
|
+
}
|
68
|
+
})
|
69
|
+
.catch(error => {
|
70
|
+
this.repoError = error.message;
|
71
|
+
console.error('Error:', error.message);
|
72
|
+
});
|
73
|
+
}
|
74
|
+
handleUserInput(e, type) {
|
75
|
+
if (type === 'name') {
|
76
|
+
this.repoDetails = Object.assign(Object.assign({}, this.repoDetails), { name: e.target.value });
|
77
|
+
}
|
78
|
+
else if (type === 'desc') {
|
79
|
+
this.repoDetails = Object.assign(Object.assign({}, this.repoDetails), { desc: e.target.value });
|
80
|
+
}
|
81
|
+
else if (type === 'framework') {
|
82
|
+
this.repoDetails = Object.assign(Object.assign({}, this.repoDetails), { framework: e.target.value });
|
83
|
+
}
|
84
|
+
}
|
85
|
+
submitUserData() {
|
86
|
+
if (this.repoDetails.name && this.repoDetails.desc && this.repoDetails.framework) {
|
87
|
+
localStorage.setItem('repo_name', this.repoDetails.name);
|
88
|
+
localStorage.setItem('repo_desc', this.repoDetails.desc);
|
89
|
+
localStorage.setItem('repo_framework', this.repoDetails.framework);
|
90
|
+
localStorage.setItem('selectedTemplate', this.name);
|
91
|
+
this.fieldError.emit(false);
|
92
|
+
this.authUser();
|
93
|
+
}
|
94
|
+
else {
|
95
|
+
this.fieldError.emit('All fields are mandatory');
|
96
|
+
}
|
97
|
+
}
|
98
|
+
togglePadding(action) {
|
99
|
+
let parent = this.el.parentElement;
|
100
|
+
if (parent) {
|
101
|
+
const rootNode = parent.getRootNode();
|
102
|
+
if (rootNode instanceof ShadowRoot) {
|
103
|
+
parent = rootNode.host.parentElement;
|
104
|
+
}
|
105
|
+
else {
|
106
|
+
parent = parent.parentElement;
|
107
|
+
}
|
108
|
+
if (action === 'remove') {
|
109
|
+
parent.parentElement.style.padding = '0px';
|
110
|
+
}
|
111
|
+
else if (action === 'add') {
|
112
|
+
parent.parentElement.style.padding = '4rem 20px';
|
113
|
+
}
|
114
|
+
}
|
115
|
+
}
|
116
|
+
handleCurrentTemplate(e) {
|
117
|
+
if (e && !this.showDetails) {
|
118
|
+
this.togglePadding('remove');
|
119
|
+
const targetTemplate = e.currentTarget;
|
120
|
+
this.toggleTemplates.emit(targetTemplate);
|
121
|
+
this.showDetails = true;
|
122
|
+
}
|
123
|
+
}
|
124
|
+
async toggleTemplate(currTemp) {
|
125
|
+
const templateWrapper = this.el.shadowRoot.querySelector('.react__template-wrapper');
|
126
|
+
if (templateWrapper) {
|
127
|
+
if (!templateWrapper.classList.contains('hide') && currTemp) {
|
128
|
+
if (templateWrapper !== currTemp) {
|
129
|
+
templateWrapper.classList.add('hide');
|
130
|
+
}
|
131
|
+
}
|
132
|
+
else {
|
133
|
+
if (this.showDetails) {
|
134
|
+
this.showDetails = false;
|
135
|
+
}
|
136
|
+
this.togglePadding('add');
|
137
|
+
templateWrapper.classList.remove('hide');
|
138
|
+
}
|
139
|
+
}
|
140
|
+
}
|
141
|
+
render() {
|
142
|
+
return (index.h("div", { key: '993f20bb1a7970d938d09ea001ee77b777d2a817' }, this.isTemplatePage
|
143
|
+
?
|
144
|
+
index.h("div", { class: "template__page-wrapper" }, !this.repoUrl && !this.repoError &&
|
145
|
+
index.h("div", null, index.h("h3", null, "Your repository is getting ready.."), index.h("p", null, "This will only take a minute.")), this.isLoading && !this.repoError && index.h("div", null, index.h("ifx-spinner", { variant: 'default', size: 's' })), this.repoUrl && index.h("ifx-link", { href: this.repoUrl, target: "_parent", size: "m", variant: "underlined" }, "Your repository"), this.repoError && index.h("div", null, this.repoError))
|
146
|
+
:
|
147
|
+
index.h("div", { class: "react__template-container" }, index.h("div", { class: "react__template-wrapper", onClick: (e) => this.handleCurrentTemplate(e) }, index.h("div", { class: "image__wrapper" }, index.h("img", { src: this.thumbnail }))), this.showDetails &&
|
148
|
+
index.h("div", { class: "details__wrapper" }, index.h("div", { class: "selection__buttons-wrapper" }, index.h("div", { class: "selection__input" }, index.h("input", { type: "radio", id: "react", name: "chosen_framework", value: "react", onInput: (e) => this.handleUserInput(e, 'framework') }), index.h("label", { htmlFor: "react" }, "React")), index.h("div", { class: "selection__input vue" }, index.h("input", { class: "vue__input", disabled: true, type: "radio", id: "vue", name: "chosen_framework", value: "vue", onInput: (e) => this.handleUserInput(e, 'framework') }), index.h("label", { class: "vue__label", htmlFor: "vue" }, "Vue"), " (Soon)")), index.h("div", { class: "input__fields-wrapper" }, index.h("ifx-text-field", { required: true, onInput: (e) => this.handleUserInput(e, 'name'), size: "m", icon: "c-info-16", placeholder: "Your repository name" }, "Repository Name"), index.h("ifx-text-field", { required: true, size: "m", icon: "c-info-16", onInput: (e) => this.handleUserInput(e, 'desc'), placeholder: "Your repository description" }, "Repository Description"), index.h("ifx-button", { fullWidth: true, onClick: () => this.submitUserData(), variant: 'primary' }, "Generate template"))))));
|
149
|
+
}
|
150
|
+
get el() { return index.getElement(this); }
|
151
|
+
};
|
152
|
+
Template.style = IfxTemplateStyle0;
|
153
|
+
|
154
|
+
exports.ifx_template = Template;
|
155
|
+
|
156
|
+
//# sourceMappingURL=ifx-template.cjs.entry.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"file":"ifx-template.entry.cjs.js","mappings":";;;;;;AAAA,MAAM,WAAW,GAAG,4oCAA4oC,CAAC;AACjqC,0BAAe,WAAW;;MCMb,QAAQ;IALrB;;;;QAOW,gBAAW,GAAsD,EAAE,IAAI,EAAE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AAC,KAAK,EAAC,OAAO,EAAE,CAAC,CAAC,KAAK,IAAI,CAAC,eAAe,CAAC,CAAC,EAAE,WAAW,CAAC,GAAG,EACpJA,mBAAO,KAAK,EAAC,YAAY,EAAC,OAAO,EAAC,KAAK,UAAY,YAC/C,CACF,EAGNA,iBAAK,KAAK,EAAC,uBAAuB,IAChCA,4BAAgB,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC,KAAK,IAAI,CAAC,eAAe,CAAC,CAAC,EAAE,MAAM,CAAC,EAAE,IAAI,EAAC,GAAG,EAAC,IAAI,EAAC,WAAW,EAAC,WAAW,EAAC,sBAAsB,sBAAiC,EAE9KA,4BAAgB,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAC,GAAG,EAAC,IAAI,EAAC,WAAW,EAAC,OAAO,EAAE,CAAC,CAAC,KAAK,IAAI,CAAC,eAAe,CAAC,CAAC,EAAE,MAAM,CAAC,EAAE,WAAW,EAAC,6BAA6B,6BAAwC,EAE5LA,wBAAY,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC,cAAc,EAAE,EAAE,OAAO,EAAC,SAAS,wBAA+B,CAC/G,CAEF,CACF,CACF,EACN;KACL;;;;;;;","names":["h"],"sources":["src/components/templates/template/template.scss?tag=ifx-template&encapsulation=shadow","src/components/templates/template/template.tsx"],"sourcesContent":["\n.react__template-wrapper { \n display: flex;\n width: 300px;\n height: 200px;\n border-radius: 3px;\n border: 1px solid #ccc;\n\n &.hide { \n display: none;\n }\n \n &:hover { \n cursor: pointer;\n }\n}\n\n.template__page-wrapper {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n text-align: center;\n\n & .repository__url { \n text-decoration: none;\n }\n}\n\n.input__fields-wrapper { \n display: flex;\n flex-direction: column;\n gap: 10px;\n\n}\n\n.details__wrapper { \n display: flex;\n flex-direction: column;\n gap: 10px;\n}\n\n.selection__buttons-wrapper { \n display: flex;\n gap: 10px;\n padding-top: 10px;\n align-items: center;\n & .vue__label { \n color: #ccc;\n }\n\n & label:not(.vue__label) { \n &:hover { \n cursor: pointer;\n }\n }\n\n & .selection__input { \n display: flex;\n align-items: center;\n gap: 5px;\n & input { \n margin: 0;\n height: 20px;\n width: 20px;\n &:hover:not(.vue__input) { \n cursor: pointer;\n }\n }\n }\n}\n\n.image__wrapper { \n img { \n position: relative;\n width: 300px;\n height: 100%;\n border-radius: 3px;\n object-fit: contain;\n transition: transform .2s;\n &:hover { \n transform: scale(2);\n top: 50px;\n z-index: 100;\n }\n }\n}","import { Component, h, Element, State, Prop, Event, EventEmitter, Method } from '@stencil/core';\n\n@Component({\n tag: 'ifx-template',\n styleUrl: 'template.scss',\n shadow: true,\n})\nexport class Template {\n @Element() el: HTMLElement;\n @State() repoDetails: { name: string, desc: string, framework: string } = { name: \"\", desc: \"\", framework: \"\" };\n @State() repoUrl: string;\n @State() showDetails: boolean = false;\n @State() isTemplatePage: boolean = false;\n @State() isLoading: boolean = true;\n @State() repoError: string;\n @Prop() name: string;\n @Event() toggleTemplates: EventEmitter;\n @Event() fieldError: EventEmitter;\n @Prop() thumbnail: string;\n \n private clientId = 'Ov23lixmXiNTTNb6V5W6'\n private redirectUri = 'https://infineon.github.io/infineon-design-system-stencil/?path=/docs/dds-templates--development';\n private scope = 'repo workflow'\n private state = 'template123'\n\n authUser() { \n const authorizationUrl = `https://github.com/login/oauth/authorize?` +\n `client_id=${this.clientId}&` +\n `redirect_uri=${this.redirectUri}&` +\n `scope=${this.scope}&` +\n `state=${this.state}`;\n \n window.open(authorizationUrl, '_blank'); \n }\n\n componentDidLoad() { \n const url = new URL(window.location.href);\n const code = url.searchParams.get('code');\n const { templateName } = this.getLocalStorageValues()\n if(code && this.name === templateName) { \n this.isTemplatePage = true;\n this.toggleTemplates.emit('details')\n this.getUserToken(code)\n } \n }\n\n getLocalStorageValues() { \n const repoName = localStorage.getItem('repo_name');\n const repoDesc = localStorage.getItem('repo_desc');\n const repoFramework = localStorage.getItem('repo_framework');\n const templateName = localStorage.getItem('selectedTemplate');\n return { repoName, repoDesc, repoFramework, templateName }\n }\n\n async getUserToken(authCode) {\n const { repoName, repoDesc, repoFramework, templateName } = this.getLocalStorageValues();\n\n fetch(`https://ddstemplate-srv.cfapps.eu10-004.hana.ondemand.com/token/${authCode}/${repoName}/${repoDesc}/${repoFramework}/${templateName}`)\n .then(response => {\n if (response.ok) {\n return response.text();\n } else {\n return response.text().then(errorMessage => {\n throw new Error(errorMessage);\n });\n }\n })\n .then(data => { \n if(data) { \n this.isLoading = false;\n this.repoUrl = data;\n localStorage.clear();\n } \n })\n .catch(error => {\n this.repoError = error.message;\n console.error('Error:', error.message)\n });\n }\n\n handleUserInput(e, type) { \n if (type === 'name') {\n this.repoDetails = { ...this.repoDetails, name: e.target.value };\n } else if (type === 'desc') {\n this.repoDetails = { ...this.repoDetails, desc: e.target.value };\n } else if(type === 'framework') { \n this.repoDetails = { ...this.repoDetails, framework: e.target.value };\n }\n }\n\n submitUserData() { \n if(this.repoDetails.name && this.repoDetails.desc && this.repoDetails.framework) { \n localStorage.setItem('repo_name', this.repoDetails.name);\n localStorage.setItem('repo_desc', this.repoDetails.desc);\n localStorage.setItem('repo_framework', this.repoDetails.framework);\n localStorage.setItem('selectedTemplate', this.name);\n this.fieldError.emit(false)\n this.authUser()\n } else { \n this.fieldError.emit('All fields are mandatory')\n }\n }\n\n togglePadding(action) { \n let parent = this.el.parentElement;\n if (parent) {\n const rootNode = parent.getRootNode();\n if (rootNode instanceof ShadowRoot) {\n parent = rootNode.host.parentElement;\n } else {\n parent = parent.parentElement;\n }\n if(action === 'remove') { \n parent.parentElement.style.padding = '0px';\n } else if(action === 'add') { \n parent.parentElement.style.padding = '4rem 20px';\n }\n }\n }\n\n handleCurrentTemplate(e) { \n if(e && !this.showDetails) { \n this.togglePadding('remove')\n const targetTemplate = e.currentTarget;\n this.toggleTemplates.emit(targetTemplate)\n this.showDetails = true;\n } \n }\n\n @Method()\n async toggleTemplate(currTemp) { \n const templateWrapper = this.el.shadowRoot.querySelector('.react__template-wrapper');\n if(templateWrapper) { \n if(!templateWrapper.classList.contains('hide') && currTemp ) { \n if(templateWrapper !== currTemp) {\n templateWrapper.classList.add('hide')\n }\n } else { \n if(this.showDetails) { \n this.showDetails = false;\n }\n this.togglePadding('add')\n templateWrapper.classList.remove('hide')\n }\n }\n }\n\n \n render() {\n return (\n <div>\n {this.isTemplatePage \n ? \n <div class=\"template__page-wrapper\">\n {!this.repoUrl && !this.repoError && \n <div>\n <h3>Your repository is getting ready..</h3>\n <p>This will only take a minute.</p>\n </div>}\n {this.isLoading && !this.repoError && <div><ifx-spinner variant='default' size='s' /></div>}\n {this.repoUrl && <ifx-link href={this.repoUrl} target=\"_parent\" size=\"m\" variant=\"underlined\">Your repository</ifx-link>}\n {this.repoError && <div>{this.repoError}</div>}\n </div> \n : \n <div class=\"react__template-container\">\n <div class=\"react__template-wrapper\" onClick={(e) => this.handleCurrentTemplate(e)}>\n <div class=\"image__wrapper\">\n <img src={this.thumbnail} />\n </div>\n </div>\n {this.showDetails && \n <div class=\"details__wrapper\">\n <div class=\"selection__buttons-wrapper\">\n <div class=\"selection__input\">\n <input type=\"radio\" id=\"react\" name=\"chosen_framework\" value=\"react\" onInput={(e) => this.handleUserInput(e, 'framework')} />\n <label htmlFor=\"react\">React</label>\n </div>\n <div class=\"selection__input vue\">\n <input class=\"vue__input\" disabled type=\"radio\" id=\"vue\" name=\"chosen_framework\" value=\"vue\" onInput={(e) => this.handleUserInput(e, 'framework')}/>\n <label class=\"vue__label\" htmlFor=\"vue\">Vue</label> (Soon)\n </div>\n </div>\n \n\n <div class=\"input__fields-wrapper\">\n <ifx-text-field required={true} onInput={(e) => this.handleUserInput(e, 'name')} size=\"m\" icon=\"c-info-16\" placeholder=\"Your repository name\">Repository Name</ifx-text-field>\n\n <ifx-text-field required={true} size=\"m\" icon=\"c-info-16\" onInput={(e) => this.handleUserInput(e, 'desc')} placeholder=\"Your repository description\">Repository Description</ifx-text-field>\n\n <ifx-button fullWidth={true} onClick={() => this.submitUserData()} variant='primary'>Generate template</ifx-button>\n </div>\n \n </div>}\n </div>}\n </div>\n );\n }\n}"],"version":3}
|
@@ -89,6 +89,10 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
89
89
|
}
|
90
90
|
switch(bundleId) {
|
91
91
|
|
92
|
+
case 'ifx-alert_2.cjs':
|
93
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
94
|
+
/* webpackMode: "lazy" */
|
95
|
+
'./ifx-alert_2.cjs.entry.js')); }).then(processMod, consoleError);
|
92
96
|
case 'ifx-badge.cjs':
|
93
97
|
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
94
98
|
/* webpackMode: "lazy" */
|
@@ -333,10 +337,6 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
333
337
|
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
334
338
|
/* webpackMode: "lazy" */
|
335
339
|
'./ifx-accordion_2.cjs.entry.js')); }).then(processMod, consoleError);
|
336
|
-
case 'ifx-alert_2.cjs':
|
337
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
338
|
-
/* webpackMode: "lazy" */
|
339
|
-
'./ifx-alert_2.cjs.entry.js')); }).then(processMod, consoleError);
|
340
340
|
case 'ifx-chip_3.cjs':
|
341
341
|
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
342
342
|
/* webpackMode: "lazy" */
|
@@ -357,6 +357,10 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
357
357
|
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
358
358
|
/* webpackMode: "lazy" */
|
359
359
|
'./ifx-radio-button.cjs.entry.js')); }).then(processMod, consoleError);
|
360
|
+
case 'ifx-template.cjs':
|
361
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
362
|
+
/* webpackMode: "lazy" */
|
363
|
+
'./ifx-template.cjs.entry.js')); }).then(processMod, consoleError);
|
360
364
|
case 'ifx-dropdown-separator.cjs':
|
361
365
|
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
362
366
|
/* webpackMode: "lazy" */
|
@@ -393,10 +397,6 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
393
397
|
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
394
398
|
/* webpackMode: "lazy" */
|
395
399
|
'./ifx-link.cjs.entry.js')); }).then(processMod, consoleError);
|
396
|
-
case 'ifx-icon.cjs':
|
397
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
398
|
-
/* webpackMode: "lazy" */
|
399
|
-
'./ifx-icon.cjs.entry.js')); }).then(processMod, consoleError);
|
400
400
|
}
|
401
401
|
}
|
402
402
|
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|