@infineon/infineon-design-system-stencil 32.0.0--canary.1697.6a4eea2e56a9a161c9b08b6d271f0588e00e26e3.0 → 32.0.0--canary.1697.560e749c46f3ae602f35f4243c9e884b72e90709.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-chip_2.cjs.entry.js → ifx-chip_3.cjs.entry.js} +162 -1
- package/dist/cjs/ifx-chip_3.cjs.entry.js.map +1 -0
- package/dist/cjs/ifx-icon-button.cjs.entry.js +62 -0
- package/dist/cjs/ifx-icon-button.cjs.entry.js.map +1 -0
- package/dist/cjs/ifx-icon.cjs.entry.js +78 -0
- package/dist/cjs/ifx-icon.cjs.entry.js.map +1 -0
- package/dist/cjs/{ifx-icon_4.cjs.entry.js → ifx-select.cjs.entry.js} +1 -286
- package/dist/cjs/ifx-select.cjs.entry.js.map +1 -0
- package/dist/cjs/index-1ce5aae1.js +14 -6
- package/dist/cjs/infineon-design-system-stencil.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/esm/{ifx-chip_2.entry.js → ifx-chip_3.entry.js} +162 -2
- package/dist/esm/ifx-chip_3.entry.js.map +1 -0
- package/dist/esm/ifx-icon-button.entry.js +58 -0
- package/dist/esm/ifx-icon-button.entry.js.map +1 -0
- package/dist/esm/ifx-icon.entry.js +74 -0
- package/dist/esm/ifx-icon.entry.js.map +1 -0
- package/dist/esm/{ifx-icon_4.entry.js → ifx-select.entry.js} +3 -285
- package/dist/esm/ifx-select.entry.js.map +1 -0
- package/dist/esm/index-b4eaf00e.js +14 -6
- 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-285c1ac0.entry.js +2 -0
- package/dist/infineon-design-system-stencil/p-285c1ac0.entry.js.map +1 -0
- package/dist/infineon-design-system-stencil/{p-424850ed.entry.js → p-34182e4c.entry.js} +3 -3
- package/dist/infineon-design-system-stencil/p-34182e4c.entry.js.map +1 -0
- package/dist/infineon-design-system-stencil/p-be38376b.entry.js +2 -0
- package/dist/infineon-design-system-stencil/p-be38376b.entry.js.map +1 -0
- package/dist/infineon-design-system-stencil/p-be8764ca.entry.js +2 -0
- package/dist/infineon-design-system-stencil/p-be8764ca.entry.js.map +1 -0
- package/package.json +1 -1
- package/dist/cjs/ifx-chip_2.cjs.entry.js.map +0 -1
- package/dist/cjs/ifx-icon_4.cjs.entry.js.map +0 -1
- package/dist/esm/ifx-chip_2.entry.js.map +0 -1
- package/dist/esm/ifx-icon_4.entry.js.map +0 -1
- package/dist/infineon-design-system-stencil/p-004df32f.entry.js +0 -2
- package/dist/infineon-design-system-stencil/p-004df32f.entry.js.map +0 -1
- package/dist/infineon-design-system-stencil/p-424850ed.entry.js.map +0 -1
@@ -3,293 +3,11 @@
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
5
|
const index = require('./index-1ce5aae1.js');
|
6
|
-
const icons = require('./icons-497a0772.js');
|
7
|
-
const index$1 = require('./index-5b0b9d4c.js');
|
8
|
-
|
9
|
-
const infineonIconStencilCss = "ifx-icon{display:inline-flex;justify-content:center}ifx-icon:empty{display:none}";
|
10
|
-
const IfxIconStyle0 = infineonIconStencilCss;
|
11
|
-
|
12
|
-
const InfineonIconStencil = class {
|
13
|
-
constructor(hostRef) {
|
14
|
-
index.registerInstance(this, hostRef);
|
15
|
-
this.consoleError = index.createEvent(this, "consoleError", 7);
|
16
|
-
this.icon = "";
|
17
|
-
}
|
18
|
-
convertStringToHtml(htmlString) {
|
19
|
-
const div = document.createElement('div');
|
20
|
-
div.innerHTML = htmlString;
|
21
|
-
return div.firstChild;
|
22
|
-
}
|
23
|
-
convertHtmlToObject(htmlElement) {
|
24
|
-
let pathToObject = Array
|
25
|
-
.from(htmlElement.attributes, ({ name, value }) => ({ name, value }))
|
26
|
-
.reduce((acc, current) => {
|
27
|
-
acc[current.name] = current.value;
|
28
|
-
return acc;
|
29
|
-
}, {});
|
30
|
-
return pathToObject;
|
31
|
-
}
|
32
|
-
convertPathsToVnode(htmlPath) {
|
33
|
-
let svgPaths = [];
|
34
|
-
const parentPath = this.convertHtmlToObject(htmlPath);
|
35
|
-
const parentPathToVnode = index.h("path", parentPath);
|
36
|
-
svgPaths.push(parentPathToVnode);
|
37
|
-
if (htmlPath.firstChild) {
|
38
|
-
const paths = htmlPath.querySelectorAll('path');
|
39
|
-
const pathLength = htmlPath.querySelectorAll('path').length;
|
40
|
-
for (let i = 0; i < pathLength; i++) {
|
41
|
-
let pathToObject = this.convertHtmlToObject(paths[i]);
|
42
|
-
let objToVnode = index.h("path", pathToObject);
|
43
|
-
svgPaths.push(objToVnode);
|
44
|
-
}
|
45
|
-
}
|
46
|
-
return svgPaths;
|
47
|
-
}
|
48
|
-
getSVG(svgPath) {
|
49
|
-
return index.h("svg", { class: "inline-svg", width: this.ifxIcon.width, height: this.ifxIcon.height, xmlns: "http://www.w3.org/2000/svg", fill: this.ifxIcon.fill, viewBox: this.ifxIcon.viewBox }, ...svgPath);
|
50
|
-
}
|
51
|
-
constructIcon() {
|
52
|
-
if (this.ifxIcon) {
|
53
|
-
const htmlPath = this.convertStringToHtml(this.ifxIcon.svgContent);
|
54
|
-
const svgPath = this.convertPathsToVnode(htmlPath);
|
55
|
-
const SVG = this.getSVG(svgPath);
|
56
|
-
return SVG;
|
57
|
-
}
|
58
|
-
else if (this.icon !== "") {
|
59
|
-
console.error('Icon not found!');
|
60
|
-
this.consoleError.emit(true);
|
61
|
-
return;
|
62
|
-
}
|
63
|
-
else {
|
64
|
-
return;
|
65
|
-
}
|
66
|
-
}
|
67
|
-
componentWillLoad() {
|
68
|
-
const removeHyphen = (str) => str.toLowerCase().replace(/[^a-zA-Z0-9]+(.)/g, (_m, chr) => chr);
|
69
|
-
this.ifxIcon = icons.getIcon(removeHyphen(this.icon));
|
70
|
-
}
|
71
|
-
render() {
|
72
|
-
return (index.h(index.Host, { key: '91ccb22f1cc67f3d4b91fb69c37cda13c941e109' }, this.constructIcon()));
|
73
|
-
}
|
74
|
-
};
|
75
|
-
InfineonIconStencil.style = IfxIconStyle0;
|
76
6
|
|
77
7
|
function getDefaultExportFromCjs (x) {
|
78
8
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
79
9
|
}
|
80
10
|
|
81
|
-
const iconButtonCss = ":host{display:inline-flex}.btn{box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;min-height:40px;padding:8px;gap:8px;color:#FFFFFF;flex-direction:row;font-weight:600;border-radius:1px;line-height:1.5rem;outline:none;font-family:var(--ifx-font-family);text-decoration:none;user-select:none;border:1px solid rgba(0, 0, 0, 0);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}.btn:not(.disabled){cursor:pointer}.btn-primary{color:#FFFFFF;background-color:#0A8276}.btn-primary:disabled,.btn-primary.disabled{background-color:#BFBBBB;color:#FFFFFF;pointer-events:none}.btn-secondary{color:#0A8276;background-color:#FFFFFF;border-color:#0A8276}.btn-secondary:disabled,.btn-secondary.disabled{background-color:#FFFFFF;border:1px solid #BFBBBB;color:#BFBBBB;pointer-events:none}.btn-tertiary{background-color:transparent;color:#1D1D1D}.btn-tertiary:disabled,.btn-tertiary.disabled{color:#BFBBBB;pointer-events:none}.btn.icon-button{min-width:initial;min-height:initial;width:40px;height:40px;padding:0;justify-content:center}.btn.icon-button.btn-round{border-radius:100px}.btn.icon-button.btn-square{border-radius:1px}.btn.icon-button.btn-s{width:32px;height:32px;padding:8px}.btn.icon-button.btn-l{width:48px;height:48px;padding:8px}.btn.btn-primary:not(:disabled,.disabled):focus:not(:active,.active){outline:none;box-shadow:0 0 0 2px #FFFFFF, 0 0 0 4px #0A8276}.btn.btn-primary:not(:disabled,.disabled):hover{background-color:#08665C;border-color:#08665C}.btn.btn-primary:not(:disabled,.disabled):active,.btn.btn-primary:not(:disabled,.disabled).active{background-color:#06534B;border-color:#06534B}.btn.btn-secondary:not(:disabled,.disabled):focus:not(:active,.active){outline:none;box-shadow:0 0 0 2px #FFFFFF, 0 0 0 4px #0A8276}.btn.btn-secondary:not(:disabled,.disabled):hover{background-color:#08665C;border-color:#08665C;color:#FFFFFF}.btn.btn-secondary:not(:disabled,.disabled):active,.btn.btn-secondary:not(:disabled,.disabled).active{background-color:#06534B;border-color:#06534B}.btn.btn-tertiary:not(:disabled,.disabled):focus:not(:active,.active){outline:none;color:#1D1D1D;box-shadow:0 0 0 0px #FFFFFF, 0 0 0 2px #0A8276}.btn.btn-tertiary:not(:disabled,.disabled):hover{color:#0A8276}.btn.btn-tertiary:not(:disabled,.disabled):active,.btn.btn-tertiary:not(:disabled,.disabled).active{color:#08665C}";
|
82
|
-
const IfxIconButtonStyle0 = iconButtonCss;
|
83
|
-
|
84
|
-
const IconButton = class {
|
85
|
-
constructor(hostRef) {
|
86
|
-
index.registerInstance(this, hostRef);
|
87
|
-
this.target = '_self';
|
88
|
-
this.shape = 'round';
|
89
|
-
}
|
90
|
-
handleClick(event) {
|
91
|
-
if (this.disabled) {
|
92
|
-
event.stopImmediatePropagation();
|
93
|
-
}
|
94
|
-
}
|
95
|
-
async setFocus() {
|
96
|
-
this.focusableElement.focus();
|
97
|
-
}
|
98
|
-
componentWillLoad() {
|
99
|
-
if (this.shape === '') {
|
100
|
-
this.shape = 'round';
|
101
|
-
}
|
102
|
-
}
|
103
|
-
render() {
|
104
|
-
return (index.h(index.Host, { key: 'a13463972d971f052edc7c7483283b9beb150955' }, this.href ? (index.h("a", { "aria-disabled": this.disabled, "aria-label": 'a clickable icon button', ref: (el) => (this.focusableElement = el), class: this.getClassNames(), href: !this.disabled ? this.href : undefined, target: this.target, rel: this.target === '_blank' ? 'noopener noreferrer' : undefined }, index.h("ifx-icon", { icon: this.icon }))) : (index.h("button", { class: this.getClassNames(), type: "button" }, index.h("ifx-icon", { icon: this.icon })))));
|
105
|
-
}
|
106
|
-
getVariantClass() {
|
107
|
-
return `${this.variant}` === "secondary"
|
108
|
-
? `secondary`
|
109
|
-
: `${this.variant}` === 'tertiary'
|
110
|
-
? `tertiary`
|
111
|
-
: `primary`;
|
112
|
-
}
|
113
|
-
getSizeClass() {
|
114
|
-
if (`${this.size}` === "xs") {
|
115
|
-
return "xs";
|
116
|
-
}
|
117
|
-
else if (`${this.size}` === "s") {
|
118
|
-
return "s";
|
119
|
-
}
|
120
|
-
else if (`${this.size}` === "l") {
|
121
|
-
return "l";
|
122
|
-
}
|
123
|
-
else
|
124
|
-
return "";
|
125
|
-
}
|
126
|
-
getClassNames() {
|
127
|
-
return index$1.classNames('btn icon-button', `btn-${this.shape}`, this.size && `btn-${this.getSizeClass()}`, `btn-${this.getVariantClass()}`, this.disabled ? 'disabled' : '');
|
128
|
-
}
|
129
|
-
get el() { return index.getElement(this); }
|
130
|
-
};
|
131
|
-
IconButton.style = IfxIconButtonStyle0;
|
132
|
-
|
133
|
-
const paginationCss = "@charset \"UTF-8\";:root{--ifx-font-family:\"Source Sans 3\";font-family:var(--ifx-font-family, sans-serif)}:host{display:inline-flex}.container{display:inline-flex;justify-content:center;align-items:center;gap:32px;font-family:var(--ifx-font-family)}.container .items__per-page-wrapper{display:flex;align-items:center;gap:16px}.container .items__per-page-wrapper .items__per-page-label{color:#1D1D1D;font-size:14px;font-style:normal;font-weight:600;line-height:20px}.container .items__per-page-wrapper .items__per-page-field{display:flex;flex-direction:column;align-items:flex-start}.container .items__per-page-wrapper .items__per-page-field ifx-select{width:92px}.container .items__total-wrapper{display:flex;justify-content:center;align-items:center;gap:12px}.container .items__total-wrapper .items__total-button{display:flex;width:40px;height:40px;justify-content:center;align-items:center;border-radius:100px;border:1px solid #BFBBBB;background:#FFF}.container .items__total-wrapper .page__numbers-wrapper{display:flex;justify-content:center;align-items:center;gap:12px}.container .items__total-wrapper .page__numbers-wrapper .page__number-item{display:flex;padding:6px;flex-direction:column;justify-content:center;align-items:center;gap:10px;border-radius:100px}.container .items__total-wrapper .page__numbers-wrapper .page__number-item.active{background-color:#0A8276}.container .items__total-wrapper .page__numbers-wrapper .page__number-item.active span{color:#fff}.container .items__total-wrapper .page__numbers-wrapper .page__number-item:hover{cursor:pointer}.container .items__total-wrapper .page__numbers-wrapper .page__number-item:hover:not(.active){background-color:#ddd}.container .items__total-wrapper .page__numbers-wrapper .page__number-item:active:not(.active){background-color:#575352}.container .items__total-wrapper .page__numbers-wrapper .page__number-item span{display:flex;width:16px;height:16px;flex-direction:column;justify-content:center;color:#1D1D1D;text-align:center;font-size:13px;font-style:normal;font-weight:400;line-height:20px}.pagination{display:flex}.pagination ifx-icon-button:first-of-type{margin-right:12px}.pagination ifx-icon-button:last-of-type{margin-left:12px}a{padding:8px;border-radius:100px}ol{list-style-type:none;padding:0;margin:0;display:inline-flex;align-items:center;gap:12px}li{display:flex;flex-direction:column;justify-content:center;align-items:center;border-radius:100px}li:hover:not(.active) a{background-color:#EEEDED}li:active:not(.active) a{background-color:#575352;color:#fff}li.active{background-color:#0A8276}li.active a{color:#fff}li:hover{cursor:pointer}li a{text-decoration:none;display:flex;width:16px;height:16px;flex-direction:column;justify-content:center;color:#1D1D1D;text-align:center;font-size:13px;font-style:normal;font-weight:400;line-height:20px;align-items:center}.prev.disabled,.next.disabled{cursor:default}.prev.disabled:hover,.next.disabled:hover{cursor:default;text-decoration:none}.prev{margin-right:2.5px}.next{margin-left:2.5px}@media (min-width: 400px){li:first-child,li.active-sibling,li.active,li.active+li,li:last-child{display:inline-flex !important;flex-direction:row}li:first-child:nth-last-child(n+8)~li{display:none}li:first-child:nth-last-child(n+8)~li.active-sibling:before{content:\"…\";font-size:13px;display:inline-block;margin-right:6px}li:first-child:nth-last-child(n+8)~li.active+li:after{content:\"…\";font-size:13px;display:inline-block;margin-left:6px}li:first-child:nth-last-child(n+8)~li:nth-last-child(-n+5){display:inline-flex;flex-direction:row}li:first-child:nth-last-child(n+8)~li:nth-last-child(5):before{content:\"…\";font-size:13px;display:inline-block;margin-right:6px}li:first-child:nth-last-child(n+8)~li:nth-child(-n+2):before,li:first-child:nth-last-child(n+8)~li:nth-child(-n+2):after,li:first-child:nth-last-child(n+8)~li:nth-last-child(-n+2):before,li:first-child:nth-last-child(n+8)~li:nth-last-child(-n+2):after,li:first-child:nth-last-child(n+8)~li.active-sibling:nth-last-child(-n+4):before,li:first-child:nth-last-child(n+8)~li.active-sibling:nth-last-child(-n+4):after{display:none !important}li:first-child:nth-last-child(n+8).active~li:nth-last-child(-n+5),li:first-child:nth-last-child(n+8)~li.active~li:nth-last-child(-n+5){display:none}li:first-child:nth-last-child(n+8).active~li:nth-last-child(-n+5):before,li:first-child:nth-last-child(n+8)~li.active~li:nth-last-child(-n+5):before{display:none}li:first-child:nth-last-child(n+8).active~li:nth-child(-n+5),li:first-child:nth-last-child(n+8)~li.active~li:nth-child(-n+5){display:inline-flex !important;flex-direction:row}li:first-child:nth-last-child(n+8).active~li:nth-child(-n+4):after,li:first-child:nth-last-child(n+8)~li.active~li:nth-child(-n+4):after{display:none}li:first-child:nth-last-child(n+8).active~li:nth-child(5):after,li:first-child:nth-last-child(n+8)~li.active~li:nth-child(5):after{content:\"…\";font-size:13px;display:inline-block;margin-left:6px}li:first-child:nth-last-child(n+8).active:before,li:first-child:nth-last-child(n+8).active:after,li:first-child:nth-last-child(n+8)~li.active:before,li:first-child:nth-last-child(n+8)~li.active:after{display:none}}";
|
134
|
-
const IfxPaginationStyle0 = paginationCss;
|
135
|
-
|
136
|
-
const Pagination = class {
|
137
|
-
constructor(hostRef) {
|
138
|
-
index.registerInstance(this, hostRef);
|
139
|
-
this.ifxPageChange = index.createEvent(this, "ifxPageChange", 7);
|
140
|
-
this.currentPage = 0;
|
141
|
-
this.internalPage = 1;
|
142
|
-
this.internalItemsPerPage = 10;
|
143
|
-
this.numberOfPages = [];
|
144
|
-
this.total = 1;
|
145
|
-
this.CLASS_DISABLED = "disabled";
|
146
|
-
this.CLASS_ACTIVE = "active";
|
147
|
-
this.CLASS_SIBLING_ACTIVE = "active-sibling";
|
148
|
-
this.DATA_KEY = "pagination";
|
149
|
-
}
|
150
|
-
setItemsPerPage(e) {
|
151
|
-
if (e.detail) {
|
152
|
-
this.internalItemsPerPage = parseInt(e.detail.label);
|
153
|
-
}
|
154
|
-
else {
|
155
|
-
this.internalItemsPerPage = 10;
|
156
|
-
}
|
157
|
-
}
|
158
|
-
componentDidLoad() {
|
159
|
-
this.calculateVisiblePageIndices();
|
160
|
-
var paginationElement = this.el.shadowRoot.querySelector(".pagination");
|
161
|
-
let leftArrow = paginationElement.querySelector('.prev');
|
162
|
-
this.navigateSinglePage(leftArrow, true);
|
163
|
-
}
|
164
|
-
calculateNumberOfPages() {
|
165
|
-
if (isNaN(this.currentPage)) {
|
166
|
-
this.currentPage = 1;
|
167
|
-
}
|
168
|
-
const total = this.total <= this.internalItemsPerPage ? this.internalItemsPerPage : this.total;
|
169
|
-
const itemsPerPage = this.internalItemsPerPage;
|
170
|
-
const totalPageNumber = Math.ceil(total / itemsPerPage);
|
171
|
-
if (this.currentPage <= 0) {
|
172
|
-
this.internalPage = 1;
|
173
|
-
}
|
174
|
-
else if (this.currentPage > totalPageNumber) {
|
175
|
-
this.internalPage = totalPageNumber;
|
176
|
-
}
|
177
|
-
else
|
178
|
-
this.internalPage = this.currentPage;
|
179
|
-
this.numberOfPages = Array.from({ length: totalPageNumber }, (_, index) => index + 1);
|
180
|
-
}
|
181
|
-
filterOptionsArray() {
|
182
|
-
let obj = Array.isArray(this.itemsPerPage) ? this.itemsPerPage : JSON.parse(this.itemsPerPage);
|
183
|
-
for (let i = 0; i < obj.length; i++) {
|
184
|
-
let item = obj[i];
|
185
|
-
if (!item.label) {
|
186
|
-
item.label = item.value;
|
187
|
-
}
|
188
|
-
}
|
189
|
-
this.filteredItemsPerPage = obj;
|
190
|
-
}
|
191
|
-
componentWillLoad() {
|
192
|
-
this.calculateNumberOfPages();
|
193
|
-
this.filterOptionsArray();
|
194
|
-
}
|
195
|
-
componentDidUpdate() {
|
196
|
-
var paginationElement = this.el.shadowRoot.querySelector(".pagination");
|
197
|
-
var listItems = paginationElement.querySelectorAll("li");
|
198
|
-
this.addEventListenersToPageItems(listItems, paginationElement);
|
199
|
-
if (paginationElement.dataset[this.DATA_KEY] < this.numberOfPages) {
|
200
|
-
paginationElement.dataset[this.DATA_KEY] = paginationElement.dataset[this.DATA_KEY];
|
201
|
-
}
|
202
|
-
else
|
203
|
-
paginationElement.dataset[this.DATA_KEY] = 0;
|
204
|
-
this.changePage(paginationElement, false);
|
205
|
-
}
|
206
|
-
componentWillUpdate() {
|
207
|
-
this.calculateNumberOfPages();
|
208
|
-
}
|
209
|
-
handleEventEmission(currActive) {
|
210
|
-
let currentPage = currActive + 1;
|
211
|
-
let totalPages = this.numberOfPages.length;
|
212
|
-
let prevPage = currActive === 0 ? null : currActive;
|
213
|
-
let nextPage = currActive + 2 > totalPages ? null : currActive + 2;
|
214
|
-
let itemsPerPage = this.internalItemsPerPage;
|
215
|
-
this.ifxPageChange.emit({ currentPage, totalPages, prevPage, nextPage, itemsPerPage });
|
216
|
-
}
|
217
|
-
addEventListenersToPageItems(listItems, paginationContainer) {
|
218
|
-
listItems.forEach((item) => {
|
219
|
-
item.addEventListener("click", (e) => {
|
220
|
-
var parent = paginationContainer;
|
221
|
-
let listItems = parent.querySelectorAll("li");
|
222
|
-
parent.dataset[this.DATA_KEY] = Array.from(listItems).indexOf(e.currentTarget);
|
223
|
-
this.changePage(parent, false);
|
224
|
-
});
|
225
|
-
});
|
226
|
-
}
|
227
|
-
initPagination(paginationContainer) {
|
228
|
-
var listItems = paginationContainer.querySelectorAll("li");
|
229
|
-
paginationContainer.dataset[this.DATA_KEY] = Array.from(listItems).indexOf(paginationContainer.querySelector(".active"));
|
230
|
-
paginationContainer.querySelector(".prev").addEventListener("click", (e) => this.navigateSinglePage(e, false));
|
231
|
-
paginationContainer.querySelector(".next").addEventListener("click", (e) => this.navigateSinglePage(e, false));
|
232
|
-
this.addEventListenersToPageItems(listItems, paginationContainer);
|
233
|
-
}
|
234
|
-
navigateSinglePage(e, initialValue) {
|
235
|
-
let el = e;
|
236
|
-
if (typeof e.target === 'object') {
|
237
|
-
el = e.target;
|
238
|
-
}
|
239
|
-
if (!el.classList.contains(this.CLASS_DISABLED)) {
|
240
|
-
var parent = el.closest(".pagination");
|
241
|
-
var currActive = parseInt(parent.dataset[this.DATA_KEY], 10);
|
242
|
-
currActive += 1 * (el.classList.contains("prev") ? -1 : 1);
|
243
|
-
if (currActive === -1) {
|
244
|
-
currActive = 0;
|
245
|
-
}
|
246
|
-
parent.dataset[this.DATA_KEY] = currActive;
|
247
|
-
this.changePage(parent, initialValue);
|
248
|
-
}
|
249
|
-
}
|
250
|
-
changePage(pagination, initialValue) {
|
251
|
-
const paginationContainer = pagination;
|
252
|
-
var listItems = paginationContainer.querySelectorAll("li");
|
253
|
-
var currActive = parseInt(paginationContainer.dataset[this.DATA_KEY], 10);
|
254
|
-
listItems.forEach((item) => {
|
255
|
-
item.classList.remove(this.CLASS_ACTIVE);
|
256
|
-
item.classList.remove(this.CLASS_SIBLING_ACTIVE);
|
257
|
-
});
|
258
|
-
if (initialValue && this.internalPage > 1) {
|
259
|
-
currActive = Math.floor(this.internalPage - 1);
|
260
|
-
paginationContainer.dataset[this.DATA_KEY] = currActive;
|
261
|
-
}
|
262
|
-
this.handleEventEmission(currActive);
|
263
|
-
listItems[currActive].classList.add(this.CLASS_ACTIVE);
|
264
|
-
if (currActive === 0) {
|
265
|
-
paginationContainer.querySelector(".prev").classList.add(this.CLASS_DISABLED);
|
266
|
-
paginationContainer.querySelector(".prev").disabled = true;
|
267
|
-
}
|
268
|
-
else {
|
269
|
-
listItems[currActive - 1].classList.add(this.CLASS_SIBLING_ACTIVE);
|
270
|
-
paginationContainer.querySelector(".prev").classList.remove(this.CLASS_DISABLED);
|
271
|
-
paginationContainer.querySelector(".prev").disabled = false;
|
272
|
-
}
|
273
|
-
if (currActive === (listItems.length - 1)) {
|
274
|
-
paginationContainer.querySelector(".next").classList.add(this.CLASS_DISABLED);
|
275
|
-
paginationContainer.querySelector(".next").disabled = true;
|
276
|
-
}
|
277
|
-
else {
|
278
|
-
paginationContainer.querySelector(".next").classList.remove(this.CLASS_DISABLED);
|
279
|
-
paginationContainer.querySelector(".next").disabled = false;
|
280
|
-
}
|
281
|
-
}
|
282
|
-
calculateVisiblePageIndices() {
|
283
|
-
var paginationElement = this.el.shadowRoot.querySelector(".pagination");
|
284
|
-
this.initPagination(paginationElement);
|
285
|
-
}
|
286
|
-
render() {
|
287
|
-
return (index.h("div", { key: '1bd59dde0b13dac78e980ac0a9193c0d5af3ff89', "aria-label": 'a pagination', "aria-value": this.currentPage, class: "container" }, index.h("div", { key: '7247216dab77b5cf3169ffc8e04d383a0ae4af67', class: 'items__per-page-wrapper' }, index.h("div", { key: '86933ae8c8c59cd77b10aba607f21972c52da5e6', class: 'items__per-page-label' }, "Results per Page"), index.h("div", { key: '7a0a99aec75d33e415302ff49289f00b4a257f84', class: 'items__per-page-field' }, index.h("ifx-select", { key: '81459335e55aa7f3921aea828181a139f64bd274', value: 'undefined', size: 's', placeholder: 'false', "show-search": 'false', "search-placeholder-value": 'Search...', disabled: false, error: false, "error-message": 'Error', label: '', "placeholder-value": 'Placeholder', options: this.filteredItemsPerPage }))), index.h("div", { key: 'a56b25a0fa5b0642174b41741c703ca94ebbd739', class: 'items__total-wrapper' }, index.h("div", { key: '12860a45aef15bd96120750358ba7609f0ba4f2b', class: 'page__numbers-wrapper' }, index.h("div", { key: '37ca1d128259779bcaf9e04d7e7350ea15148108', class: "pagination" }, index.h("ifx-icon-button", { key: '6f5a2cf42665322f5cb2bf41d83a433207e1e278', variant: 'secondary', class: "prev", color: 'primary', icon: 'arrow-left-24' }), index.h("ol", { key: '0868301196cf85da110fa30641ca92ecbb3c9628' }, this.numberOfPages.map((item) => index.h("li", { class: `${this.internalPage === item ? 'active' : ""}` }, index.h("a", { href: undefined }, item)))), index.h("ifx-icon-button", { key: 'd6ba13113a8427c6a37bf3715f744cded4603f36', class: "next", variant: 'secondary', color: 'primary', icon: 'arrow-right-24' }))))));
|
288
|
-
}
|
289
|
-
get el() { return index.getElement(this); }
|
290
|
-
};
|
291
|
-
Pagination.style = IfxPaginationStyle0;
|
292
|
-
|
293
11
|
var choices = {exports: {}};
|
294
12
|
|
295
13
|
/*! choices.js v10.2.0 | © 2022 Josh Johnson | https://github.com/jshjohnson/Choices#readme */
|
@@ -7564,9 +7282,6 @@ const Choices = class {
|
|
7564
7282
|
};
|
7565
7283
|
Choices.style = IfxSelectStyle0;
|
7566
7284
|
|
7567
|
-
exports.ifx_icon = InfineonIconStencil;
|
7568
|
-
exports.ifx_icon_button = IconButton;
|
7569
|
-
exports.ifx_pagination = Pagination;
|
7570
7285
|
exports.ifx_select = Choices;
|
7571
7286
|
|
7572
|
-
//# sourceMappingURL=ifx-
|
7287
|
+
//# sourceMappingURL=ifx-select.cjs.entry.js.map
|