wj-elements 0.1.159 → 0.1.161
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/{infinite-scroll.element-DUjjOm1e.js → infinite-scroll.element-Cj53cbpC.js} +42 -5
- package/dist/infinite-scroll.element-Cj53cbpC.js.map +1 -0
- package/dist/packages/wje-accordion/accordion.test.d.ts +0 -0
- package/dist/packages/wje-color-picker/color-picker.test.d.ts +1 -0
- package/dist/packages/wje-element/element.d.ts +1 -1
- package/dist/packages/wje-infinite-scroll/infinite-scroll.element.d.ts +7 -0
- package/dist/packages/wje-options/options.element.d.ts +25 -1
- package/dist/packages/wje-stepper/stepper.element.d.ts +1 -0
- package/dist/packages/wje-store/pubsub.d.ts +5 -4
- package/dist/packages/wje-tab/tab.element.d.ts +23 -0
- package/dist/packages/wje-tab-group/tab-group.element.d.ts +5 -0
- package/dist/wje-dialog.js +3 -1
- package/dist/wje-dialog.js.map +1 -1
- package/dist/wje-element.js +3 -3
- package/dist/wje-element.js.map +1 -1
- package/dist/wje-icon-picker.js +1 -1
- package/dist/wje-infinite-scroll.js +1 -1
- package/dist/wje-master.js +1 -1
- package/dist/wje-options.js +30 -2
- package/dist/wje-options.js.map +1 -1
- package/dist/wje-sliding-container.js +3 -0
- package/dist/wje-sliding-container.js.map +1 -1
- package/dist/wje-stepper.js +52 -36
- package/dist/wje-stepper.js.map +1 -1
- package/dist/wje-store.js +7 -6
- package/dist/wje-store.js.map +1 -1
- package/dist/wje-tab-group.js +72 -12
- package/dist/wje-tab-group.js.map +1 -1
- package/dist/wje-tab-panel.js +1 -1
- package/dist/wje-tab.js +146 -1
- package/dist/wje-tab.js.map +1 -1
- package/package.json +2 -2
- package/dist/infinite-scroll.element-DUjjOm1e.js.map +0 -1
package/dist/wje-tab-group.js
CHANGED
|
@@ -2,7 +2,7 @@ var __defProp = Object.defineProperty;
|
|
|
2
2
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
3
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
4
|
import WJElement from "./wje-element.js";
|
|
5
|
-
const styles = "/*\n[ WJ Tab Group ]\n*/\n\n:host {\n --wje-tab-top: 0;\n --wje-tab-start: 0;\n --wje-tab-end: 0;\n --wje-tab-bottom: 0;\n}\n.native-tab-group {\n display: flex;\n flex-direction: column;\n\n overflow: hidden;\n position: relative;\n}\n\n.native-tab-group > header {\n display: flex;\n flex-direction: column;\n\n & > nav {\n display: flex;\n }\n}\n\n.native-tab-group > section {\n width: 100%;\n\n & > article {\n scroll-snap-align: start;\n overflow-y: auto;\n overscroll-behavior-y: contain;\n }\n}\n\n/*TOP*/\n:host([variant='top']) {\n --wje-tab-top: auto !important;\n --wje-tab-writing-mode: horizontal-tb;\n .native-tab-group {\n flex-direction: column;\n }\n nav {\n border-bottom: 1px solid var(--wje-border-color);\n }\n}\n\n/*START*/\n:host([variant='start']) {\n --wje-tab-start: auto !important;\n --wje-tab-writing-mode: vertical-rl;\n .native-tab-group {\n flex-direction: row;\n }\n nav {\n flex-direction: column;\n border-right: 1px solid var(--wje-border-color);\n }\n}\n\n/*END*/\n:host([variant='end']) {\n --wje-tab-writing-mode: vertical-rl;\n .native-tab-group {\n flex-direction: row-reverse;\n }\n nav {\n flex-direction: column;\n border-left: 1px solid var(--wje-border-color);\n }\n}\n\n/*BOTTOM*/\n:host([variant='bottom']) {\n --wje-tab-bottom: auto !important;\n --wje-tab-writing-mode: horizontal-tb;\n .native-tab-group {\n flex-direction: column-reverse;\n }\n nav {\n border-top: 1px solid var(--wje-border-color);\n }\n}\n";
|
|
5
|
+
const styles = "/*\n[ WJ Tab Group ]\n*/\n\n:host {\n --wje-tab-top: 0;\n --wje-tab-start: 0;\n --wje-tab-end: 0;\n --wje-tab-bottom: 0;\n width: 100%;\n}\n.native-tab-group {\n display: flex;\n flex-direction: column;\n\n overflow: hidden;\n position: relative;\n}\n\n.native-tab-group > header {\n display: flex;\n flex-direction: column;\n\n & > nav {\n display: flex;\n align-items: center;\n }\n}\n\n.native-tab-group > section {\n width: 100%;\n\n & > article {\n scroll-snap-align: start;\n overflow-y: auto;\n overscroll-behavior-y: contain;\n }\n}\n\n/*TOP*/\n:host([variant='top']) {\n --wje-tab-top: auto !important;\n --wje-tab-writing-mode: horizontal-tb;\n .native-tab-group {\n flex-direction: column;\n }\n nav {\n border-bottom: 1px solid var(--wje-border-color);\n }\n}\n\n/*START*/\n:host([variant='start']) {\n --wje-tab-start: auto !important;\n --wje-tab-writing-mode: vertical-rl;\n .native-tab-group {\n flex-direction: row;\n }\n nav {\n flex-direction: column;\n border-right: 1px solid var(--wje-border-color);\n }\n}\n\n/*END*/\n:host([variant='end']) {\n --wje-tab-writing-mode: vertical-rl;\n .native-tab-group {\n flex-direction: row-reverse;\n }\n nav {\n flex-direction: column;\n border-left: 1px solid var(--wje-border-color);\n }\n}\n\n/*BOTTOM*/\n:host([variant='bottom']) {\n --wje-tab-bottom: auto !important;\n --wje-tab-writing-mode: horizontal-tb;\n .native-tab-group {\n flex-direction: column-reverse;\n }\n nav {\n border-top: 1px solid var(--wje-border-color);\n }\n}\n\n.dropdown-active {\n wje-button{\n &::part(native) {\n color: var(--wje-color-primary-8);\n }\n }\n}";
|
|
6
6
|
class TabGroup extends WJElement {
|
|
7
7
|
/**
|
|
8
8
|
* Creates an instance of TabGroup.
|
|
@@ -60,12 +60,32 @@ class TabGroup extends WJElement {
|
|
|
60
60
|
let slot = document.createElement("slot");
|
|
61
61
|
let slotNav = document.createElement("slot");
|
|
62
62
|
slotNav.setAttribute("name", "nav");
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
63
|
+
let icon = document.createElement("wje-icon");
|
|
64
|
+
icon.setAttribute("name", "dots");
|
|
65
|
+
let button = document.createElement("wje-button");
|
|
66
|
+
button.setAttribute("slot", "trigger");
|
|
67
|
+
button.setAttribute("fill", "link");
|
|
68
|
+
let menu = document.createElement("wje-menu");
|
|
69
|
+
menu.setAttribute("variant", "context");
|
|
70
|
+
let slotMore = document.createElement("slot");
|
|
71
|
+
slotMore.setAttribute("name", "more");
|
|
72
|
+
let moreDropdown = document.createElement("wje-dropdown");
|
|
73
|
+
moreDropdown.setAttribute("placement", "bottom-end");
|
|
74
|
+
moreDropdown.setAttribute("collapsible", "");
|
|
75
|
+
moreDropdown.classList.add("more-tabs");
|
|
76
|
+
button.append(icon);
|
|
77
|
+
menu.append(slotMore);
|
|
78
|
+
moreDropdown.append(button);
|
|
79
|
+
moreDropdown.append(menu);
|
|
80
|
+
header.append(nav);
|
|
81
|
+
nav.append(slotNav);
|
|
82
|
+
nav.append(moreDropdown);
|
|
83
|
+
section.append(slot);
|
|
84
|
+
native.append(header);
|
|
85
|
+
native.append(section);
|
|
86
|
+
fragment.append(native);
|
|
87
|
+
this.nav = nav;
|
|
88
|
+
this.moreDropdown = moreDropdown;
|
|
69
89
|
return fragment;
|
|
70
90
|
}
|
|
71
91
|
/**
|
|
@@ -77,18 +97,22 @@ class TabGroup extends WJElement {
|
|
|
77
97
|
this.setActiveTab(activeTabName);
|
|
78
98
|
this.addEventListener("wje-tab:change", (e) => {
|
|
79
99
|
if (e.detail.context.hasAttribute("disabled")) return;
|
|
100
|
+
console.log("tab change");
|
|
80
101
|
this.setActiveTab(e.detail.context.panel);
|
|
81
102
|
});
|
|
103
|
+
this.checkOverflow = this.checkOverflow.bind(this);
|
|
104
|
+
window.addEventListener("resize", this.checkOverflow);
|
|
105
|
+
requestAnimationFrame(() => this.checkOverflow());
|
|
82
106
|
}
|
|
83
107
|
/**
|
|
84
108
|
* Removes the active attribute from all tabs and panels.
|
|
85
109
|
*/
|
|
86
110
|
removeActiveTab() {
|
|
87
111
|
this.getPanelAll().forEach((el) => {
|
|
88
|
-
el.
|
|
112
|
+
el.classList.remove("active");
|
|
89
113
|
});
|
|
90
114
|
this.getTabAll().forEach((el) => {
|
|
91
|
-
el.
|
|
115
|
+
el.classList.remove("active");
|
|
92
116
|
});
|
|
93
117
|
}
|
|
94
118
|
/**
|
|
@@ -96,16 +120,19 @@ class TabGroup extends WJElement {
|
|
|
96
120
|
* @param {string} tab The name of the tab to set as active.
|
|
97
121
|
*/
|
|
98
122
|
setActiveTab(tab) {
|
|
123
|
+
var _a;
|
|
99
124
|
this.removeActiveTab();
|
|
100
|
-
this.querySelector(`[panel="${tab}"]`)
|
|
101
|
-
|
|
125
|
+
const el = this.querySelector(`[panel="${tab}"]`);
|
|
126
|
+
el == null ? void 0 : el.classList.add("active");
|
|
127
|
+
(_a = this.querySelector(`[name="${tab}"]`)) == null ? void 0 : _a.classList.add("active");
|
|
128
|
+
this.dropdownActive(el);
|
|
102
129
|
}
|
|
103
130
|
/**
|
|
104
131
|
* Returns the currently active tab.
|
|
105
132
|
* @returns {Element|null} The active tab, or null if no tab is active.
|
|
106
133
|
*/
|
|
107
134
|
getActiveTab() {
|
|
108
|
-
let activeTabs = Array.from(this.querySelectorAll("wje-tab
|
|
135
|
+
let activeTabs = Array.from(this.querySelectorAll("wje-tab.active"));
|
|
109
136
|
return activeTabs.length > 0 ? activeTabs : null;
|
|
110
137
|
}
|
|
111
138
|
/**
|
|
@@ -129,6 +156,39 @@ class TabGroup extends WJElement {
|
|
|
129
156
|
getPanelAllName() {
|
|
130
157
|
return this.getPanelAll().map((el) => el.getAttribute("name"));
|
|
131
158
|
}
|
|
159
|
+
toggleMoreVisibility() {
|
|
160
|
+
const hasTabsInMore = this.querySelector('wje-tab[slot="more"]');
|
|
161
|
+
this.moreDropdown.hidden = !hasTabsInMore;
|
|
162
|
+
}
|
|
163
|
+
checkOverflow() {
|
|
164
|
+
const nav = this.nav;
|
|
165
|
+
const moreBtn = this.moreDropdown;
|
|
166
|
+
const moreWidth = moreBtn.offsetWidth || 48;
|
|
167
|
+
const tabs = Array.from(this.querySelectorAll("wje-tab"));
|
|
168
|
+
tabs.forEach((tab) => tab.setAttribute("slot", "nav"));
|
|
169
|
+
requestAnimationFrame(() => {
|
|
170
|
+
const navRight = nav.getBoundingClientRect().right;
|
|
171
|
+
let overflowStarted = false;
|
|
172
|
+
for (const tab of tabs) {
|
|
173
|
+
const tabRect = tab.getBoundingClientRect();
|
|
174
|
+
const fits = tabRect.right + moreWidth <= navRight;
|
|
175
|
+
if (!fits || overflowStarted) {
|
|
176
|
+
tab.setAttribute("slot", "more");
|
|
177
|
+
this.dropdownActive(tab);
|
|
178
|
+
overflowStarted = true;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
this.toggleMoreVisibility();
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
dropdownActive(el) {
|
|
185
|
+
if (el.classList.contains("active")) {
|
|
186
|
+
if (el.getAttribute("slot") === "more")
|
|
187
|
+
this.moreDropdown.classList.add("dropdown-active");
|
|
188
|
+
else
|
|
189
|
+
this.moreDropdown.classList.remove("dropdown-active");
|
|
190
|
+
}
|
|
191
|
+
}
|
|
132
192
|
}
|
|
133
193
|
TabGroup.define("wje-tab-group", TabGroup);
|
|
134
194
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wje-tab-group.js","sources":["../packages/wje-tab-group/tab-group.element.js","../packages/wje-tab-group/tab-group.js"],"sourcesContent":["import { default as WJElement } from '../wje-element/element.js';\nimport styles from './styles/styles.css?inline';\n\n/**\n * `TabGroup` is a custom web component that represents a group of tabs.\n * @summary This element represents a group of tabs.\n * @documentation https://elements.webjet.sk/components/tab-group\n * @status stable\n * @augments WJElement\n * @slot - The default slot for the tab group.\n * @slot nav - Slot for the navigation of the tab group.\n * @cssproperty [--wje-tab-group-padding=1rem] - Specifies the padding inside the tab group. This property defines the space between the content of the tab group and its outer boundary. Accepts any valid CSS length unit (e.g., `px`, `rem`, `em`, `%`).\n * @tag wje-tab-group\n */\n\nexport default class TabGroup extends WJElement {\n /**\n * Creates an instance of TabGroup.\n * @class\n */\n constructor() {\n super();\n }\n\n className = 'TabGroup';\n\n /**\n * Returns the CSS styles for the component.\n * @static\n * @returns {CSSStyleSheet}\n */\n static get cssStyleSheet() {\n return styles;\n }\n\n /**\n * Sets up the attributes for the component.\n */\n setupAttributes() {\n this.isShadowRoot = 'open';\n }\n\n /**\n * Sets up the event listeners before the component is drawn.\n * This method is called before the component is drawn.\n * It is used to set up event listeners.\n */\n beforeDraw() {\n let activeTabName = location.hash.replace('#', '');\n\n // skontrolujeme ci sa nachadza v paneloch\n if (this.getPanelAllName().includes(activeTabName)) {\n // window.addEventListener('hashchange', (e) => {\n // this.setActiveTab(activeTabName);\n // });\n\n window.addEventListener('load', (e) => {\n this.setActiveTab(activeTabName);\n });\n }\n }\n\n /**\n * Draws the component.\n * @param {object} context The context for drawing.\n * @param {object} store The store for drawing.\n * @param {object} params The parameters for drawing.\n * @returns {DocumentFragment}\n */\n draw(context, store, params) {\n let fragment = document.createDocumentFragment();\n\n let native = document.createElement('div');\n native.setAttribute('part', 'native');\n native.classList.add('native-tab-group');\n\n let header = document.createElement('header');\n header.setAttribute('part', 'tabs');\n header.classList.add('scroll-snap-x');\n\n let nav = document.createElement('nav');\n\n let section = document.createElement('section');\n section.setAttribute('part', 'panels');\n\n let slot = document.createElement('slot');\n\n let slotNav = document.createElement('slot');\n slotNav.setAttribute('name', 'nav');\n\n header.appendChild(nav);\n nav.appendChild(slotNav);\n section.appendChild(slot);\n\n native.appendChild(header);\n native.appendChild(section);\n\n fragment.appendChild(native);\n\n return fragment;\n }\n\n /**\n * Sets up the event listeners after the component is drawn.\n */\n afterDraw() {\n let activeTab = this.getActiveTab();\n let activeTabName = activeTab ? activeTab[0].panel : this.getTabAll()[0].panel;\n\n this.setActiveTab(activeTabName);\n\n this.addEventListener('wje-tab:change', (e) => {\n if (e.detail.context.hasAttribute('disabled')) return;\n\n this.setActiveTab(e.detail.context.panel);\n });\n }\n\n /**\n * Removes the active attribute from all tabs and panels.\n */\n removeActiveTab() {\n this.getPanelAll().forEach((el) => {\n el.removeAttribute('active');\n });\n\n this.getTabAll().forEach((el) => {\n el.removeAttribute('active');\n });\n }\n\n /**\n * Sets the active tab and panel.\n * @param {string} tab The name of the tab to set as active.\n */\n setActiveTab(tab) {\n this.removeActiveTab();\n this.querySelector(`[panel=\"${tab}\"]`).setAttribute('active', '');\n this.querySelector(`[name=\"${tab}\"]`).setAttribute('active', '');\n }\n\n /**\n * Returns the currently active tab.\n * @returns {Element|null} The active tab, or null if no tab is active.\n */\n getActiveTab() {\n let activeTabs = Array.from(this.querySelectorAll('wje-tab[active]'));\n return activeTabs.length > 0 ? activeTabs : null;\n }\n\n /**\n * Returns all tabs.\n * @returns {Array<Element>} An array of all tabs.\n */\n getTabAll() {\n return this.context.querySelector('[name=\"nav\"]').assignedElements();\n }\n\n /**\n * Returns all panels.\n * @returns {Array<Element>} An array of all panels.\n */\n getPanelAll() {\n return Array.from(this.querySelectorAll('wje-tab-panel'));\n }\n\n /**\n * Returns the names of all tabs.\n * @returns {Array<string>} An array of all tab names.\n */\n getPanelAllName() {\n return this.getPanelAll().map((el) => el.getAttribute('name'));\n }\n}\n","import TabGroup from './tab-group.element.js';\n\nexport default TabGroup;\n\nTabGroup.define('wje-tab-group', TabGroup);\n"],"names":[],"mappings":";;;;;AAee,MAAM,iBAAiB,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA,EAK5C,cAAc;AACV,UAAO;AAGX,qCAAY;AAAA,EAFhB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASI,WAAW,gBAAgB;AACvB,WAAO;AAAA,EACf;AAAA;AAAA;AAAA;AAAA,EAKI,kBAAkB;AACd,SAAK,eAAe;AAAA,EAC5B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOI,aAAa;AACT,QAAI,gBAAgB,SAAS,KAAK,QAAQ,KAAK,EAAE;AAGjD,QAAI,KAAK,gBAAe,EAAG,SAAS,aAAa,GAAG;AAKhD,aAAO,iBAAiB,QAAQ,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ACvC,CAAS;AAED,SAAK,UAAS,EAAG,QAAQ,CAAC,OAAO;AAC7B,SAAG,gBAAgB,QAAQ;AAAA,IACvC,CAAS;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA,EAMI,aAAa,KAAK;AACd,SAAK,gBAAiB;AACtB,SAAK,cAAc,WAAW,GAAG,IAAI,EAAE,aAAa,UAAU,EAAE;AAChE,SAAK,cAAc,UAAU,GAAG,IAAI,EAAE,aAAa,UAAU,EAAE;AAAA,EACvE;AAAA;AAAA;AAAA;AAAA;AAAA,EAMI,eAAe;AACX,QAAI,aAAa,MAAM,KAAK,KAAK,iBAAiB,iBAAiB,CAAC;AACpE,WAAO,WAAW,SAAS,IAAI,aAAa;AAAA,EACpD;AAAA;AAAA;AAAA;AAAA;AAAA,EAMI,YAAY;AACR,WAAO,KAAK,QAAQ,cAAc,cAAc,EAAE,iBAAkB;AAAA,EAC5E;AAAA;AAAA;AAAA;AAAA;AAAA,EAMI,cAAc;AACV,WAAO,MAAM,KAAK,KAAK,iBAAiB,eAAe,CAAC;AAAA,EAChE;AAAA;AAAA;AAAA;AAAA;AAAA,EAMI,kBAAkB;AACd,WAAO,KAAK,YAAW,EAAG,IAAI,CAAC,OAAO,GAAG,aAAa,MAAM,CAAC;AAAA,EACrE;AACA;ACzKA,SAAS,OAAO,iBAAiB,QAAQ;"}
|
|
1
|
+
{"version":3,"file":"wje-tab-group.js","sources":["../packages/wje-tab-group/tab-group.element.js","../packages/wje-tab-group/tab-group.js"],"sourcesContent":["import { default as WJElement } from '../wje-element/element.js';\nimport styles from './styles/styles.css?inline';\n\n/**\n * `TabGroup` is a custom web component that represents a group of tabs.\n * @summary This element represents a group of tabs.\n * @documentation https://elements.webjet.sk/components/tab-group\n * @status stable\n * @augments WJElement\n * @slot - The default slot for the tab group.\n * @slot nav - Slot for the navigation of the tab group.\n * @cssproperty [--wje-tab-group-padding=1rem] - Specifies the padding inside the tab group. This property defines the space between the content of the tab group and its outer boundary. Accepts any valid CSS length unit (e.g., `px`, `rem`, `em`, `%`).\n * @tag wje-tab-group\n */\n\nexport default class TabGroup extends WJElement {\n /**\n * Creates an instance of TabGroup.\n * @class\n */\n constructor() {\n super();\n }\n\n className = 'TabGroup';\n\n /**\n * Returns the CSS styles for the component.\n * @static\n * @returns {CSSStyleSheet}\n */\n static get cssStyleSheet() {\n return styles;\n }\n\n /**\n * Sets up the attributes for the component.\n */\n setupAttributes() {\n this.isShadowRoot = 'open';\n }\n\n /**\n * Sets up the event listeners before the component is drawn.\n * This method is called before the component is drawn.\n * It is used to set up event listeners.\n */\n beforeDraw() {\n let activeTabName = location.hash.replace('#', '');\n\n // skontrolujeme ci sa nachadza v paneloch\n if (this.getPanelAllName().includes(activeTabName)) {\n // window.addEventListener('hashchange', (e) => {\n // console.log('hashchange');\n // this.setActiveTab(activeTabName);\n // });\n\n window.addEventListener('load', (e) => {\n this.setActiveTab(activeTabName);\n });\n }\n }\n\n /**\n * Draws the component.\n * @param {object} context The context for drawing.\n * @param {object} store The store for drawing.\n * @param {object} params The parameters for drawing.\n * @returns {DocumentFragment}\n */\n draw(context, store, params) {\n let fragment = document.createDocumentFragment();\n\n let native = document.createElement('div');\n native.setAttribute('part', 'native');\n native.classList.add('native-tab-group');\n\n let header = document.createElement('header');\n header.setAttribute('part', 'tabs');\n header.classList.add('scroll-snap-x');\n\n let nav = document.createElement('nav');\n\n let section = document.createElement('section');\n section.setAttribute('part', 'panels');\n\n let slot = document.createElement('slot');\n\n let slotNav = document.createElement('slot');\n slotNav.setAttribute('name', 'nav');\n\n let icon = document.createElement('wje-icon');\n icon.setAttribute('name', 'dots');\n\n let button = document.createElement('wje-button');\n button.setAttribute('slot', 'trigger');\n button.setAttribute('fill', 'link');\n\n let menu = document.createElement('wje-menu');\n menu.setAttribute('variant', 'context');\n\n let slotMore = document.createElement('slot');\n slotMore.setAttribute('name', 'more');\n\n let moreDropdown = document.createElement('wje-dropdown');\n moreDropdown.setAttribute('placement', 'bottom-end');\n moreDropdown.setAttribute('collapsible', '');\n moreDropdown.classList.add('more-tabs');\n\n button.append(icon);\n\n menu.append(slotMore);\n\n moreDropdown.append(button);\n moreDropdown.append(menu);\n\n header.append(nav);\n\n nav.append(slotNav);\n nav.append(moreDropdown);\n\n section.append(slot);\n\n native.append(header);\n native.append(section);\n\n fragment.append(native);\n\n this.nav = nav;\n this.moreDropdown = moreDropdown;\n\n return fragment;\n }\n\n /**\n * Sets up the event listeners after the component is drawn.\n */\n afterDraw() {\n let activeTab = this.getActiveTab();\n let activeTabName = activeTab ? activeTab[0].panel : this.getTabAll()[0].panel;\n\n this.setActiveTab(activeTabName);\n\n this.addEventListener('wje-tab:change', (e) => {\n if (e.detail.context.hasAttribute('disabled')) return;\n console.log('tab change');\n this.setActiveTab(e.detail.context.panel);\n });\n\n // this.checkOverflow = this.checkOverflow.bind(this);\n // window.addEventListener('resize', this.checkOverflow);\n\n // this.setupTabObserver();\n // this.toggleMoreVisibility();\n\n this.checkOverflow = this.checkOverflow.bind(this);\n\n window.addEventListener('resize', this.checkOverflow);\n\n requestAnimationFrame(() => this.checkOverflow());\n }\n\n /**\n * Removes the active attribute from all tabs and panels.\n */\n removeActiveTab() {\n this.getPanelAll().forEach((el) => {\n el.classList.remove('active');\n });\n\n this.getTabAll().forEach((el) => {\n el.classList.remove('active');\n });\n }\n\n /**\n * Sets the active tab and panel.\n * @param {string} tab The name of the tab to set as active.\n */\n setActiveTab(tab) {\n this.removeActiveTab();\n const el = this.querySelector(`[panel=\"${tab}\"]`)\n el?.classList.add('active');\n this.querySelector(`[name=\"${tab}\"]`)?.classList.add('active');\n\n this.dropdownActive(el);\n }\n\n /**\n * Returns the currently active tab.\n * @returns {Element|null} The active tab, or null if no tab is active.\n */\n getActiveTab() {\n let activeTabs = Array.from(this.querySelectorAll('wje-tab.active'));\n return activeTabs.length > 0 ? activeTabs : null;\n }\n\n /**\n * Returns all tabs.\n * @returns {Array<Element>} An array of all tabs.\n */\n getTabAll() {\n return this.context.querySelector('[name=\"nav\"]').assignedElements();\n }\n\n /**\n * Returns all panels.\n * @returns {Array<Element>} An array of all panels.\n */\n getPanelAll() {\n return Array.from(this.querySelectorAll('wje-tab-panel'));\n }\n\n /**\n * Returns the names of all tabs.\n * @returns {Array<string>} An array of all tab names.\n */\n getPanelAllName() {\n return this.getPanelAll().map((el) => el.getAttribute('name'));\n }\n\n toggleMoreVisibility() {\n const hasTabsInMore = this.querySelector('wje-tab[slot=\"more\"]');\n this.moreDropdown.hidden = !hasTabsInMore;\n }\n\n checkOverflow() {\n const nav = this.nav;\n const moreBtn = this.moreDropdown;\n const moreWidth = moreBtn.offsetWidth || 48; // fallback ak ešte nie je vykreslený\n\n const tabs = Array.from(this.querySelectorAll('wje-tab'));\n\n // Reset: presunieme všetky taby naspäť do nav slotu\n tabs.forEach(tab => tab.setAttribute('slot', 'nav'));\n\n // Vykreslíme nanovo, aby sa more button správne umiestnil\n requestAnimationFrame(() => {\n const navRight = nav.getBoundingClientRect().right;\n let overflowStarted = false;\n\n for (const tab of tabs) {\n const tabRect = tab.getBoundingClientRect();\n\n // Ak by pretekal vrátane rezervy na more, presunieme ho\n const fits = tabRect.right + moreWidth <= navRight;\n\n if (!fits || overflowStarted) {\n tab.setAttribute('slot', 'more');\n this.dropdownActive(tab);\n overflowStarted = true;\n }\n }\n\n this.toggleMoreVisibility();\n });\n }\n\n dropdownActive(el) {\n if(el.classList.contains('active')) {\n if(el.getAttribute('slot') === 'more')\n this.moreDropdown.classList.add('dropdown-active');\n else\n this.moreDropdown.classList.remove('dropdown-active');\n }\n }\n}\n","import TabGroup from './tab-group.element.js';\n\nexport default TabGroup;\n\nTabGroup.define('wje-tab-group', TabGroup);\n"],"names":[],"mappings":";;;;;AAee,MAAM,iBAAiB,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA,EAK5C,cAAc;AACV,UAAO;AAGX,qCAAY;AAAA,EAFhB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASI,WAAW,gBAAgB;AACvB,WAA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A,QACtC;AAAA,MACA;AAEY,WAAK,qBAAsB;AAAA,IACvC,CAAS;AAAA,EACT;AAAA,EAEI,eAAe,IAAI;AACf,QAAG,GAAG,UAAU,SAAS,QAAQ,GAAG;AAChC,UAAG,GAAG,aAAa,MAAM,MAAM;AAC3B,aAAK,aAAa,UAAU,IAAI,iBAAiB;AAAA;AAEjD,aAAK,aAAa,UAAU,OAAO,iBAAiB;AAAA,IACpE;AAAA,EACA;AACA;ACtQA,SAAS,OAAO,iBAAiB,QAAQ;"}
|
package/dist/wje-tab-panel.js
CHANGED
|
@@ -2,7 +2,7 @@ var __defProp = Object.defineProperty;
|
|
|
2
2
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
3
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
4
|
import WJElement from "./wje-element.js";
|
|
5
|
-
const styles = "/*\n[ WJ Tab Panel ]\n*/\n\n:host {\n display: none;\n flex-wrap: wrap;\n align-items: center;\n padding: 1rem;\n}\n\n:host(
|
|
5
|
+
const styles = "/*\n[ WJ Tab Panel ]\n*/\n\n:host {\n display: none;\n flex-wrap: wrap;\n align-items: center;\n padding: 1rem;\n}\n\n:host(.active) {\n display: block;\n}\n";
|
|
6
6
|
class TabPanel extends WJElement {
|
|
7
7
|
/**
|
|
8
8
|
* Creates an instance of TabPanel.
|
package/dist/wje-tab.js
CHANGED
|
@@ -2,7 +2,113 @@ var __defProp = Object.defineProperty;
|
|
|
2
2
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
3
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
4
|
import WJElement, { event } from "./wje-element.js";
|
|
5
|
-
|
|
5
|
+
import { b as bindRouterLinks } from "./router-links-CJnOdbas.js";
|
|
6
|
+
const styles = `/*
|
|
7
|
+
[ WJ Tab ]
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
:host(:not([slot="more"])) {
|
|
11
|
+
display: block;
|
|
12
|
+
position: relative;
|
|
13
|
+
.native-tab {
|
|
14
|
+
display: flex;
|
|
15
|
+
align-items: center;
|
|
16
|
+
white-space: nowrap;
|
|
17
|
+
font-family: var(--wje-tab-font-family);
|
|
18
|
+
font-size: var(--wje-tab-font-size);
|
|
19
|
+
letter-spacing: var(--wje-tab-letter-spacing);
|
|
20
|
+
text-transform: var(--wje-tab-text-transfrom);
|
|
21
|
+
font-weight: var(--wje-tab-font-weight);
|
|
22
|
+
text-decoration: none;
|
|
23
|
+
padding-inline: var(--wje-tab-padding-inline);
|
|
24
|
+
padding-top: var(--wje-tab-padding-top);
|
|
25
|
+
padding-bottom: var(--wje-tab-padding-bottom);
|
|
26
|
+
border-radius: var(--wje-tab-border-radius);
|
|
27
|
+
color: var(--wje-color);
|
|
28
|
+
line-height: var(--wje-tab-line-height);
|
|
29
|
+
& > svg {
|
|
30
|
+
inline-size: 1.5em;
|
|
31
|
+
pointer-events: none;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&:hover {
|
|
35
|
+
background: var(--wje-tab-color-hover);
|
|
36
|
+
&:after {
|
|
37
|
+
display: block;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&:after {
|
|
42
|
+
content: ' ';
|
|
43
|
+
display: none;
|
|
44
|
+
block-size: 0.15rem;
|
|
45
|
+
writing-mode: var(--wje-tab-writing-mode);
|
|
46
|
+
background: var(--wje-tab-color-active);
|
|
47
|
+
position: absolute;
|
|
48
|
+
bottom: var(--wje-tab-bottom);
|
|
49
|
+
left: var(--wje-tab-start);
|
|
50
|
+
right: var(--wje-tab-end);
|
|
51
|
+
top: var(--wje-tab-top);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
:host([slot="more"]) {
|
|
57
|
+
--wje-menu-item-safe-triangle-cursor-x: 0;
|
|
58
|
+
--wje-menu-item-safe-triangle-cursor-y: 0;
|
|
59
|
+
--wje-menu-item-safe-triangle-submenu-start-x: 0;
|
|
60
|
+
--wje-menu-item-safe-triangle-submenu-start-y: 0;
|
|
61
|
+
--wje-menu-item-safe-triangle-submenu-end-x: 0;
|
|
62
|
+
--wje-menu-item-safe-triangle-submenu-end-y: 0;
|
|
63
|
+
|
|
64
|
+
display: block;
|
|
65
|
+
.native-tab {
|
|
66
|
+
background: var(--wje-menu-item-background);
|
|
67
|
+
position: relative;
|
|
68
|
+
display: block;
|
|
69
|
+
flex-wrap: nowrap;
|
|
70
|
+
align-items: center;
|
|
71
|
+
justify-content: center;
|
|
72
|
+
color: var(--wje-menu-item-color);
|
|
73
|
+
padding-top: var(--wje-menu-item-padding-top);
|
|
74
|
+
padding-bottom: var(--wje-menu-item-padding-bottom);
|
|
75
|
+
padding-inline: var(--wje-spacing-large);
|
|
76
|
+
transition: var(--wje-transition-fast) fill;
|
|
77
|
+
user-select: none;
|
|
78
|
+
white-space: nowrap;
|
|
79
|
+
cursor: pointer;
|
|
80
|
+
text-decoration: none;
|
|
81
|
+
|
|
82
|
+
&:hover {
|
|
83
|
+
color: var(--wje-menu-item-color-hover);
|
|
84
|
+
background: var(--wje-menu-item-background-hover);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
&:focus {
|
|
88
|
+
color: var(--wje-menu-item-color-focus);
|
|
89
|
+
background: var(--wje-menu-item-background-focus);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
&:active {
|
|
93
|
+
color: var(--wje-menu-item-color-active);
|
|
94
|
+
background: var(--wje-menu-item-background-active);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
:host([disabled]) a {
|
|
100
|
+
opacity: 0.5;
|
|
101
|
+
cursor: not-allowed;
|
|
102
|
+
background: inherit;
|
|
103
|
+
&:after {
|
|
104
|
+
display: none;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
:host(:not([slot="more"]).active) a:after {
|
|
109
|
+
display: block;
|
|
110
|
+
}
|
|
111
|
+
`;
|
|
6
112
|
class Tab extends WJElement {
|
|
7
113
|
/**
|
|
8
114
|
* Creates an instance of Tab.
|
|
@@ -14,6 +120,36 @@ class Tab extends WJElement {
|
|
|
14
120
|
*/
|
|
15
121
|
__publicField(this, "className", "Tab");
|
|
16
122
|
this.last = false;
|
|
123
|
+
this._hasPanel = false;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Sets the panel attribute to the specified value.
|
|
127
|
+
* @param {string} value The value to set for the panel attribute.
|
|
128
|
+
*/
|
|
129
|
+
set panel(value) {
|
|
130
|
+
this.setAttribute("panel", value);
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Retrieves the value of the 'panel' attribute of the element.
|
|
134
|
+
* @returns {string|null} Returns the 'panel' attribute value if it exists; otherwise, returns null.
|
|
135
|
+
*/
|
|
136
|
+
get panel() {
|
|
137
|
+
return this.getAttribute("panel") || null;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Sets the value of the 'route' attribute for the current object.
|
|
141
|
+
* @param {string} value The new value to set for the 'route' attribute.
|
|
142
|
+
*/
|
|
143
|
+
set route(value) {
|
|
144
|
+
this.setAttribute("route", value);
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Retrieves the value of the 'route' attribute.
|
|
148
|
+
* If the 'route' attribute is not set, it returns null.
|
|
149
|
+
* @returns {string|null} The value of the 'route' attribute or null if not set.
|
|
150
|
+
*/
|
|
151
|
+
get route() {
|
|
152
|
+
return this.getAttribute("route") || null;
|
|
17
153
|
}
|
|
18
154
|
/**
|
|
19
155
|
* Returns the CSS styles for the component.
|
|
@@ -28,6 +164,7 @@ class Tab extends WJElement {
|
|
|
28
164
|
*/
|
|
29
165
|
setupAttributes() {
|
|
30
166
|
this.isShadowRoot = "open";
|
|
167
|
+
this.setAttribute("active-class", "active");
|
|
31
168
|
}
|
|
32
169
|
/**
|
|
33
170
|
* Draws the component for the tab.
|
|
@@ -49,8 +186,16 @@ class Tab extends WJElement {
|
|
|
49
186
|
* // @fires wje-tab:change - Dispatched when the component is clicked, indicating a tab change.
|
|
50
187
|
*/
|
|
51
188
|
afterDraw() {
|
|
189
|
+
this.unbindRouterLinks = bindRouterLinks(this.parentElement, { selector: false });
|
|
52
190
|
event.addListener(this, "click", "wje-tab:change");
|
|
53
191
|
}
|
|
192
|
+
/**
|
|
193
|
+
* Cleans up before the component is disconnected.
|
|
194
|
+
*/
|
|
195
|
+
beforeDisconnect() {
|
|
196
|
+
var _a;
|
|
197
|
+
(_a = this.unbindRouterLinks) == null ? void 0 : _a.call(this);
|
|
198
|
+
}
|
|
54
199
|
}
|
|
55
200
|
Tab.define("wje-tab", Tab);
|
|
56
201
|
export {
|
package/dist/wje-tab.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wje-tab.js","sources":["../packages/wje-tab/tab.element.js","../packages/wje-tab/tab.js"],"sourcesContent":["import { default as WJElement, event } from '../wje-element/element.js';\nimport styles from './styles/styles.css?inline';\n\n/**\n * `Tab` is a custom web component that represents a tab.\n * @summary This element represents a tab.\n * @documentation https://elements.webjet.sk/components/tab\n * @status stable\n * @augments {WJElement}\n * @cssproperty [--wje-tab-text-transform=uppercase] - The text transformation for the tab (e.g., uppercase, lowercase).\n * @cssproperty [--wje-tab-font-weight=500] - The font weight of the tab text.\n * @cssproperty [--wje-tab-letter-spacing=0.06em] - The letter spacing of the tab text.\n * @cssproperty [--wje-tab-padding-inline=1rem] - The horizontal padding of the tab.\n * @cssproperty [--wje-tab-padding-top=.75rem] - The top padding of the tab text.\n * @cssproperty [--wje-tab-padding-bottom=.75rem] - The bottom padding of the tab text.\n * @cssproperty [--wje-tab-color-active=var(--wje-color-primary-11)] - The text color of the active tab.\n * @cssproperty [--wje-tab-color-hover=var(--wje-color-primary-1)] - The text color of the tab when hovered.\n * //@fires wje-tab:change - Dispatched when the tab is changed.\n * @tag wje-tab\n */\nexport default class Tab extends WJElement {\n /**\n * Creates an instance of Tab.\n */\n constructor() {\n super();\n\n /**\n * Indicates whether this is the last tab.\n * @type {boolean}\n */\n this.last = false;\n }\n\n /**\n * The class name for the component.\n */\n className = 'Tab';\n\n /**\n * Returns the CSS styles for the component.\n * @static\n * @returns {CSSStyleSheet}\n */\n static get cssStyleSheet() {\n return styles;\n }\n\n /**\n * Sets up the attributes for the component.\n */\n setupAttributes() {\n this.isShadowRoot = 'open';\n }\n\n /**\n * Draws the component for the tab.\n * @returns {DocumentFragment}\n */\n draw() {\n let fragment = document.createDocumentFragment();\n\n let slot = document.createElement('slot');\n\n let a = document.createElement('a');\n a.setAttribute('href', '#' + this.panel);\n a.setAttribute('part', 'native');\n a.classList.add('native-tab');\n a.appendChild(slot);\n\n fragment.appendChild(a);\n\n return fragment;\n }\n\n /**\n * Sets up event listeners after the component is rendered.\n * // @fires wje-tab:change - Dispatched when the component is clicked, indicating a tab change.\n */\n afterDraw() {\n event.addListener(this, 'click', 'wje-tab:change');\n }\n}\n","import Tab from './tab.element.js';\n\nexport default Tab;\n\nTab.define('wje-tab', Tab);\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"wje-tab.js","sources":["../packages/wje-tab/tab.element.js","../packages/wje-tab/tab.js"],"sourcesContent":["import { default as WJElement, event } from '../wje-element/element.js';\nimport { bindRouterLinks } from 'slick-router/middlewares/router-links.js';\nimport styles from './styles/styles.css?inline';\n\n/**\n * `Tab` is a custom web component that represents a tab.\n * @summary This element represents a tab.\n * @documentation https://elements.webjet.sk/components/tab\n * @status stable\n * @augments {WJElement}\n * @cssproperty [--wje-tab-text-transform=uppercase] - The text transformation for the tab (e.g., uppercase, lowercase).\n * @cssproperty [--wje-tab-font-weight=500] - The font weight of the tab text.\n * @cssproperty [--wje-tab-letter-spacing=0.06em] - The letter spacing of the tab text.\n * @cssproperty [--wje-tab-padding-inline=1rem] - The horizontal padding of the tab.\n * @cssproperty [--wje-tab-padding-top=.75rem] - The top padding of the tab text.\n * @cssproperty [--wje-tab-padding-bottom=.75rem] - The bottom padding of the tab text.\n * @cssproperty [--wje-tab-color-active=var(--wje-color-primary-11)] - The text color of the active tab.\n * @cssproperty [--wje-tab-color-hover=var(--wje-color-primary-1)] - The text color of the tab when hovered.\n * //@fires wje-tab:change - Dispatched when the tab is changed.\n * @tag wje-tab\n */\nexport default class Tab extends WJElement {\n /**\n * Creates an instance of Tab.\n */\n constructor() {\n super();\n\n /**\n * Indicates whether this is the last tab.\n * @type {boolean}\n */\n this.last = false;\n this._hasPanel = false;\n }\n\n /**\n * Sets the panel attribute to the specified value.\n * @param {string} value The value to set for the panel attribute.\n */\n set panel(value) {\n this.setAttribute('panel', value);\n }\n\n /**\n * Retrieves the value of the 'panel' attribute of the element.\n * @returns {string|null} Returns the 'panel' attribute value if it exists; otherwise, returns null.\n */\n get panel() {\n return this.getAttribute('panel') || null;\n }\n\n /**\n * Sets the value of the 'route' attribute for the current object.\n * @param {string} value The new value to set for the 'route' attribute.\n */\n set route(value) {\n this.setAttribute('route', value);\n }\n\n /**\n * Retrieves the value of the 'route' attribute.\n * If the 'route' attribute is not set, it returns null.\n * @returns {string|null} The value of the 'route' attribute or null if not set.\n */\n get route() {\n return this.getAttribute('route') || null;\n }\n\n /**\n * The class name for the component.\n */\n className = 'Tab';\n\n /**\n * Returns the CSS styles for the component.\n * @static\n * @returns {CSSStyleSheet}\n */\n static get cssStyleSheet() {\n return styles;\n }\n\n /**\n * Sets up the attributes for the component.\n */\n setupAttributes() {\n this.isShadowRoot = 'open';\n this.setAttribute('active-class', 'active');\n }\n\n /**\n * Draws the component for the tab.\n * @returns {DocumentFragment}\n */\n draw() {\n let fragment = document.createDocumentFragment();\n\n let slot = document.createElement('slot');\n\n let a = document.createElement('a');\n a.setAttribute('href', '#' + this.panel);\n a.setAttribute('part', 'native');\n a.classList.add('native-tab');\n a.appendChild(slot);\n\n fragment.appendChild(a);\n\n return fragment;\n }\n\n /**\n * Sets up event listeners after the component is rendered.\n * // @fires wje-tab:change - Dispatched when the component is clicked, indicating a tab change.\n */\n afterDraw() {\n this.unbindRouterLinks = bindRouterLinks(this.parentElement, { selector: false });\n event.addListener(this, 'click', 'wje-tab:change');\n }\n\n /**\n * Cleans up before the component is disconnected.\n */\n beforeDisconnect() {\n this.unbindRouterLinks?.();\n }\n}\n","import Tab from './tab.element.js';\n\nexport default Tab;\n\nTab.define('wje-tab', Tab);\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBe,MAAM,YAAY,UAAU;AAAA;AAAA;AAAA;AAAA,EAIvC,cAAc;AACV,UAAO;AA8CX;AAAA;AAAA;AAAA,qCAAY;AAxCR,SAAK,OAAO;AACZ,SAAK,YAAY;AAAA,EACzB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMI,IAAI,MAAM,OAAO;AACb,SAAK,aAAa,SAAS,KAAK;AAAA,EACxC;AAAA;AAAA;AAAA;AAAA;AAAA,EAMI,IAAI,QAAQ;AACR,WAAO,KAAK,aAAa,OAAO,KAAK;AAAA,EAC7C;AAAA;AAAA;AAAA;AAAA;AAAA,EAMI,IAAI,MAAM,OAAO;AACb,SAAK,aAAa,SAAS,KAAK;AAAA,EACxC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOI,IAAI,QAAQ;AACR,WAAO,KAAK,aAAa,OAAO,KAAK;AAAA,EAC7C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYI,WAAW,gBAAgB;AACvB,WAAO;AAAA,EACf;AAAA;AAAA;AAAA;AAAA,EAKI,kBAAkB;AACd,SAAK,eAAe;AACpB,SAAK,aAAa,gBAAgB,QAAQ;AAAA,EAClD;AAAA;AAAA;AAAA;AAAA;AAAA,EAMI,OAAO;AACH,QAAI,WAAW,SAAS,uBAAwB;AAEhD,QAAI,OAAO,SAAS,cAAc,MAAM;AAExC,QAAI,IAAI,SAAS,cAAc,GAAG;AAClC,MAAE,aAAa,QAAQ,MAAM,KAAK,KAAK;AACvC,MAAE,aAAa,QAAQ,QAAQ;AAC/B,MAAE,UAAU,IAAI,YAAY;AAC5B,MAAE,YAAY,IAAI;AAElB,aAAS,YAAY,CAAC;AAEtB,WAAO;AAAA,EACf;AAAA;AAAA;AAAA;AAAA;AAAA,EAMI,YAAY;AACR,SAAK,oBAAoB,gBAAgB,KAAK,eAAe,EAAE,UAAU,OAAO;AAChF,UAAM,YAAY,MAAM,SAAS,gBAAgB;AAAA,EACzD;AAAA;AAAA;AAAA;AAAA,EAKI,mBAAmB;;AACf,eAAK,sBAAL;AAAA,EACR;AACA;AC1HA,IAAI,OAAO,WAAW,GAAG;"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wj-elements",
|
|
3
3
|
"description": "WebJET Elements is a modern set of user interface tools harnessing the power of web components designed to simplify web application development.",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.161",
|
|
5
5
|
"homepage": "https://github.com/lencys/wj-elements",
|
|
6
6
|
"author": "Lukáš Ondrejček <lukas.ondrejcek@gmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"create-element": "node wje-cli-script/create-element.cjs",
|
|
39
39
|
"copy-dist": "node wje-cli-script/copy-dist.cjs",
|
|
40
40
|
"build:copy-dist": "npm run build && npm run copy-dist -- /Users/rastislavhrompa/Desktop/Interway-MFE/parcels/node_modules/wj-elements",
|
|
41
|
-
"target:copy-dist": "npm run copy-dist -- /Users/rastislavhrompa/Desktop/Interway-MFE/
|
|
41
|
+
"target:copy-dist": "npm run copy-dist -- /Users/rastislavhrompa/Desktop/Interway-MFE/parcels/node_modules/wj-elements",
|
|
42
42
|
"test": "web-test-runner --group default",
|
|
43
43
|
"test:watch": "web-test-runner --watch --group default",
|
|
44
44
|
"lint": "eslint packages experimental-packages --max-warnings 0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"infinite-scroll.element-DUjjOm1e.js","sources":["../packages/wje-infinite-scroll/infinite-scroll.element.js"],"sourcesContent":["import { default as WJElement, event, WjElementUtils } from '../wje-element/element.js';\nimport styles from './styles/styles.css?inline';\n\n/**\n * `InfiniteScroll` is a custom web component that represents an infinite scroll.\n * It extends from `WJElement`.\n * @summary This element allows users to scroll through a potentially infinite amount of content.\n * @documentation https://elements.webjet.sk/components/infinite-scroll\n * @status stable\n * @augments {WJElement}\n * @csspart loader - The loader part of the infinite scroll.\n * @slot - The default slot for the infinite scroll.\n * @cssproperty [--wje-infinite-scroll-width=100%] - Sets the width of the infinite scroll container. his property determines how wide the infinite scroll area will be relative to its parent element. Accepts any valid CSS width value, such as percentages (`%`), pixels (`px`), or viewport units (`vw`). The default value is `100%`, which makes it span the full width of its container.\n * @cssproperty [--wje-infinite-scroll-height=300px] - Defines the height of the infinite scroll container. This property specifies how tall the infinite scroll area should be. Accepts any valid CSS height value, such as pixels (`px`), percentages (`%`), or viewport units (`vh`). The default value is `300px`, providing a fixed height suitable for most use cases.\n * //@fires wje-infinite-scroll:click-item - Event fired when an item is clicked.\n * @tag wje-infinite-scroll\n */\n\nexport default class InfiniteScroll extends WJElement {\n /**\n * Creates an instance of InfiniteScroll.\n */\n constructor() {\n super();\n\n this.totalPages = 0;\n this.isLoading = [];\n this._response = {};\n this.iterate = null;\n this._infiniteScrollTemplate = null;\n this._abortController = new AbortController();\n this._signal = this._abortController.signal;\n }\n\n /**\n * Dependencies of the InfiniteScroll component.\n * @param value\n */\n set infiniteScrollTemplate(value) {\n this._infiniteScrollTemplate = value;\n }\n\n /**\n * Getter for the infiniteScrollTemplate property.\n * @returns {null}\n */\n get infiniteScrollTemplate() {\n return this._infiniteScrollTemplate;\n }\n\n /**\n * Dependencies of the InfiniteScroll component.\n * @param value\n */\n set response(value) {\n this._response = value;\n }\n\n /**\n * Getter for the response property.\n * @returns {*|{}}\n */\n get response() {\n return this._response;\n }\n\n /**\n * Dependencies of the InfiniteScroll component.\n * @param value\n */\n set objectName(value) {\n this.setAttribute('object-name', value);\n }\n\n get objectName() {\n return this.getAttribute('object-name') ?? 'data';\n }\n\n className = 'InfiniteScroll';\n\n /**\n * Returns the CSS styles for the component.\n * @static\n * @returns {CSSStyleSheet}\n */\n static get cssStyleSheet() {\n return styles;\n }\n\n /**\n * Returns the list of attributes to observe for changes.\n * @static\n * @returns {Array<string>}\n */\n static get observedAttributes() {\n return [];\n }\n\n /**\n * Sets up the attributes for the component.\n */\n setupAttributes() {\n this.isShadowRoot = 'open';\n }\n\n /**\n * Prepares the component for updates before it is drawn.\n * This method handles the removal of templates for iteration, adjusts the height styling of the component,\n * and manages abort signals for loading operations.\n * @returns {void} No return value.\n */\n beforeDraw() {\n this.iterate = this.querySelector('[iterate]');\n this.infiniteScrollTemplate = this.iterate?.outerHTML;\n this.iterate?.remove(); // remove template\n\n this.setAttribute('style', 'height: ' + this.height);\n\n // if this._loading is not fulfilled then cancel the promise\n if (this._signal) {\n this._abortController.abort();\n this._abortController = new AbortController();\n this._signal = this._abortController.signal;\n }\n }\n\n /**\n * Creates and returns a document fragment containing the structure for an infinite scroll component.\n * The structure includes native elements, slots for customization, and optional loading content.\n * @returns {DocumentFragment} The document fragment containing the component's DOM structure.\n */\n draw() {\n let fragment = document.createDocumentFragment();\n\n let native = document.createElement('div');\n native.classList.add('native');\n native.setAttribute('part', 'native-infinite-scroll');\n\n let slot = document.createElement('slot');\n\n let ending = document.createElement('slot');\n ending.setAttribute('name', 'ending');\n\n if (WjElementUtils.hasSlot(this, 'loader')) {\n let loading = document.createElement('div');\n loading.classList.add('loading');\n\n let loader = document.createElement('slot');\n loader.setAttribute('name', 'loader');\n\n loading.appendChild(loader);\n\n this.loadingEl = loading;\n\n fragment.appendChild(loading);\n }\n\n native.appendChild(slot);\n native.appendChild(ending);\n\n fragment.appendChild(native);\n\n this.endingEl = ending;\n\n return fragment;\n }\n\n /**\n * Called after the component has been drawn.\n */\n async afterDraw() {\n this.queryParams = this.queryParams || '';\n this.size = +this.size || 10;\n this.currentPage = 0;\n\n this.scrollEvent();\n this._loading = this.loadPages(this.currentPage);\n await this._loading;\n }\n\n /**\n * Attaches a scroll event listener to the current object.\n * The `scrollEvent` function binds the `onScroll` method to the 'scroll' event\n * of the current object. This enables handling of scroll events for\n * specific functionality such as updating UI elements, loading content dynamically,\n * or tracking user interaction with scrollable content.\n */\n scrollEvent = () => {\n this.addEventListener('scroll', this.onScroll);\n };\n\n /**\n * A function that removes the scroll event listener from the current context.\n * This function is used to unbind the `onScroll` event listener\n * from the `scroll` event of the current object. It ensures that\n * the scroll event no longer triggers the `onScroll` handler.\n * @function\n */\n unScrollEvent = () => {\n this.removeEventListener('scroll', this.onScroll);\n };\n\n /**\n * A scroll event handler function that checks the scroll position and triggers loading additional content\n * when the user scrolls near the bottom of the page.\n * Properties accessed:\n * - `scrollTop`: The number of pixels that the content of an element is scrolled vertically.\n * - `scrollHeight`: The total height of the element's content.\n * - `clientHeight`: The inner height of the element in pixels, including padding but excluding borders and scrollbars.\n * Conditions:\n * - Determines if the scroll position is within 300 pixels of the bottom of the element.\n * - Verifies that the current page number is less than or equal to the total number of pages.\n * - Checks if the current page is already in the loading state.\n * Actions:\n * - Increments the current page number when the conditions are met.\n * - Initiates loading for the next page by calling the `loadPages` function.\n * @param {Event} e The scroll event object.\n */\n onScroll = (e) => {\n const { scrollTop, scrollHeight, clientHeight } = e.target;\n\n if (\n scrollTop + clientHeight >= scrollHeight - 300 &&\n this.currentPage <= this.totalPages &&\n this.isLoading.includes(this.currentPage)\n ) {\n this.currentPage++;\n this._loading = this.loadPages(this.currentPage);\n }\n };\n\n /**\n * Fetches the pages from the server.\n * @param {number} page The page number.\n * @returns {Promise<object>} The response from the server.\n */\n async getPages(page) {\n let hasParams = this.url.includes('?');\n const response = await fetch(\n `${this.url}${hasParams ? '&' : '?'}page=${page}&size=${this.size}${this?.queryParams}`,\n {\n signal: this._signal,\n }\n );\n\n if (!response.ok) {\n throw new Error(`An error occurred: ${response.status}`);\n }\n return await response.json();\n }\n\n /**\n * Hides the loader.\n */\n hideLoader() {\n this?.loadingEl?.classList.remove('show');\n }\n\n /**\n * Displays the loader element by adding the 'show' class to its class list.\n * This method is useful for indicating a loading or processing state in the UI.\n * @returns {void} No return value.\n */\n showLoader() {\n this?.loadingEl?.classList.add('show');\n }\n\n /**\n * Checks if there are more pages to load.\n * @param {number} page The page number.\n * @returns {boolean} Whether there are more pages to load.\n */\n hasMorePages(page) {\n return this.totalPages === 0 || page < this.totalPages;\n }\n\n /**\n * Loads the pages.\n * @param {number} page The page number.\n */\n async loadPages(page) {\n this.showLoader();\n try {\n if (this.hasMorePages(page)) {\n let response;\n this.parser = new DOMParser();\n\n if (typeof this.setCustomData === 'function') {\n response = await this.setCustomData(page, this._signal);\n } else {\n response = await this.getPages(page);\n }\n\n this.totalPages = response?.totalPages;\n this.currentPage = page;\n\n this.placementObj = this;\n\n // if there is a \"container\" attribute, find the element\n if (this.hasAttribute('placement')) this.placementObj = this.querySelector(this.placement);\n\n event.dispatchCustomEvent(this, 'wje-infinite-scroll:load', response);\n\n this.response = response;\n\n this.customForeach(this.objectName ? response[this.objectName] : response);\n\n this.isLoading.push(page);\n } else {\n event.dispatchCustomEvent(this, 'wje-infinite-scroll:complete');\n this.endingEl.classList.add('show');\n }\n } catch (error) {\n console.log(error);\n } finally {\n this.hideLoader();\n }\n }\n\n /**\n * Converts a data item into an HTML element based on a template.\n * This function takes a data item, interpolates it into a predefined template,\n * parses the resulting HTML string, and returns the first child element of the parsed HTML content.\n * @param {object} item The data object to interpolate into the HTML template.\n * @returns {Element} The first child element generated from the interpolated HTML string.\n */\n dataToHtml = (item) => {\n let interpolateItem = this.interpolate(this.infiniteScrollTemplate, item);\n let doc = this.parser.parseFromString(interpolateItem, 'text/html');\n let element = doc.activeElement.firstElementChild;\n\n return element;\n };\n\n /**\n * A custom implementation of the forEach method designed to iterate over an array of data,\n * transform each item into an HTML element, and append the element to a specified placement object.\n * Additionally, it adds an event listener to each generated element for handling click events.\n * @param {Array} data An array of items to process. Each item is transformed into an HTML element\n * and appended to the placement object specified in the context of `this`.\n */\n customForeach = (data) => {\n data.forEach((item) => {\n let element = this.dataToHtml(item);\n event.addListener(element, 'click', 'wje-infinite-scroll:click-item', null);\n\n this.placementObj.insertAdjacentElement('beforeend', element);\n });\n };\n\n /**\n * Interpolates a string template with values from the provided parameters object.\n * The template contains placeholders in the format `{{key}}` or `{{key.subkey}}`,\n * which are replaced with the corresponding values from the `params` object.\n * Placeholders support dot notation for accessing nested properties within the `params` object.\n * @param {string} template The string template containing placeholders to be replaced.\n * @param {object} params The object containing key-value pairs used for substitution in the template.\n * @returns {string} A string with all placeholders replaced by their respective values from the `params` object.\n */\n interpolate = (template, params) => {\n let keys = template.match(/\\{{.*?\\}}/g);\n\n if (keys) {\n for (let key of keys) {\n let cleanKey = key.replace('{{', '').replace('}}', '');\n let val = '';\n cleanKey.split('.').forEach((k) => {\n val = val === '' ? params[k] : val[k];\n });\n\n template = template.replace(key, val);\n }\n }\n return template;\n };\n}\n"],"names":[],"mappings":";;;;;AAkBe,MAAM,uBAAuB,UAAU;AAAA;AAAA;AAAA;AAAA,EAIlD,cAAc;AACV,UAAO;AAuDX,qCAAY;AA6GZ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uCAAc,MAAM;AAChB,WAAK,iBAAiB,UAAU,KAAK,QAAQ;AAAA,IAChD;AASD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yCAAgB,MAAM;AAClB,WAAK,oBAAoB,UAAU,KAAK,QAAQ;AAAA,IACnD;AAkBD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA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