wj-elements 0.1.191 → 0.1.193
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/dark.css +4 -0
- package/dist/light.css +9 -0
- package/dist/packages/index.d.ts +1 -1
- package/dist/packages/wje-sliding-container/sliding-container.d.ts +2 -0
- package/dist/packages/wje-sliding-container/sliding-container.element.d.ts +265 -0
- package/dist/wje-chip.js +1 -1
- package/dist/wje-master.js +36 -36
- package/dist/wje-select.js +10 -0
- package/dist/wje-select.js.map +1 -1
- package/dist/wje-sliding-container.js +201 -117
- package/dist/wje-sliding-container.js.map +1 -1
- package/package.json +1 -1
|
@@ -2,7 +2,8 @@ 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
|
-
|
|
5
|
+
import { event } from "./event.js";
|
|
6
|
+
const styles = ":host {\n display: block;\n z-index: 9999;\n position: relative;\n height: 100%;\n right: unset;\n left: unset;\n .close-button {\n position: absolute;\n top: 0;\n right: 0;\n z-index: 1000;\n }\n}\n\n:host([hide-button]) {\n .close-button {\n display: none;\n }\n}\n\n.sliding-container-wrapper {\n height: 100%;\n position: relative;\n overflow: hidden;\n}\n\n.native-sliding-container {\n\n position: absolute;\n width: 0;\n height: 100%;\n}\n\n.native-sliding-container-inner {\n height: 100%;\n position: absolute;\n}\n";
|
|
6
7
|
class SlidingContainer extends WJElement {
|
|
7
8
|
/**
|
|
8
9
|
* Creates an instance of SlidingContainer.
|
|
@@ -49,69 +50,168 @@ class SlidingContainer extends WJElement {
|
|
|
49
50
|
});
|
|
50
51
|
this._resizeObserver.observe(document.documentElement);
|
|
51
52
|
}
|
|
53
|
+
/**
|
|
54
|
+
* Sets the maximum width of an element by updating the 'max-width' attribute.
|
|
55
|
+
* @param {string} value The maximum width value to be set (e.g., '100px', '50%', etc.).
|
|
56
|
+
*/
|
|
52
57
|
set maxWidth(value) {
|
|
53
58
|
this.setAttribute("max-width", value);
|
|
54
59
|
}
|
|
60
|
+
/**
|
|
61
|
+
* Gets the maximum width value of the element.
|
|
62
|
+
* Retrieves the value of the 'max-width' attribute. If the attribute is not set, it defaults to 'auto'.
|
|
63
|
+
* @returns {string} The maximum width value of the element or 'auto' if the attribute is not defined.
|
|
64
|
+
*/
|
|
55
65
|
get maxWidth() {
|
|
56
66
|
return this.getAttribute("max-width") ?? "auto";
|
|
57
67
|
}
|
|
68
|
+
/**
|
|
69
|
+
* Sets the maximum height for the element.
|
|
70
|
+
* @param {string} value The maximum height value to be applied to the element. This can include units such as "px", "em", "%", etc.
|
|
71
|
+
*/
|
|
58
72
|
set maxHeight(value) {
|
|
59
73
|
this.setAttribute("max-height", value);
|
|
60
74
|
}
|
|
75
|
+
/**
|
|
76
|
+
* Retrieves the maximum height value of the element, or returns 'auto' if not set.
|
|
77
|
+
* @returns {string} The maximum height value or 'auto' if the attribute is not specified.
|
|
78
|
+
*/
|
|
61
79
|
get maxHeight() {
|
|
62
80
|
return this.getAttribute("max-height") ?? "auto";
|
|
63
81
|
}
|
|
82
|
+
/**
|
|
83
|
+
* Sets the 'trigger' attribute for the element.
|
|
84
|
+
* @param {string} value The value to set for the 'trigger' attribute.
|
|
85
|
+
*/
|
|
64
86
|
set trigger(value) {
|
|
65
87
|
this.setAttribute("trigger", value);
|
|
66
88
|
}
|
|
89
|
+
/**
|
|
90
|
+
* Retrieves the value of the 'trigger' attribute. If the attribute is not set, it defaults to 'sliding-container'.
|
|
91
|
+
* @returns {string} The value of the 'trigger' attribute or the default value 'sliding-container' if not defined.
|
|
92
|
+
*/
|
|
67
93
|
get trigger() {
|
|
68
94
|
return this.getAttribute("trigger") ?? "sliding-container";
|
|
69
95
|
}
|
|
96
|
+
/**
|
|
97
|
+
* Sets the direction attribute for the element.
|
|
98
|
+
* @param {string} value The direction value to be assigned. Possible values are typically 'ltr' (left-to-right), 'rtl' (right-to-left), or 'auto'.
|
|
99
|
+
*/
|
|
70
100
|
set direction(value) {
|
|
71
101
|
this.setAttribute("direction", value);
|
|
72
102
|
}
|
|
103
|
+
/**
|
|
104
|
+
* Retrieves the direction attribute of the instance.
|
|
105
|
+
* If the direction attribute is not set, it defaults to 'right'.
|
|
106
|
+
* @returns {string} The value of the direction attribute or 'right' if not set.
|
|
107
|
+
*/
|
|
73
108
|
get direction() {
|
|
74
109
|
return this.getAttribute("direction") ?? "right";
|
|
75
110
|
}
|
|
111
|
+
/**
|
|
112
|
+
* Sets the value of the `remove-child-after-close` attribute.
|
|
113
|
+
* This attribute determines if a child element should be removed after a close operation.
|
|
114
|
+
* @param {boolean|string} value The value to set for the `remove-child-after-close` attribute. The value can be a boolean or a string representation of a boolean.
|
|
115
|
+
*/
|
|
76
116
|
set removeChildAfterClose(value) {
|
|
77
117
|
this.setAttribute("remove-child-after-close", value);
|
|
78
118
|
}
|
|
119
|
+
/**
|
|
120
|
+
* Gets the value indicating whether the child element should be removed after closing.
|
|
121
|
+
*
|
|
122
|
+
* This property checks the presence of the 'remove-child-after-close' attribute on the element.
|
|
123
|
+
* Returns `false` if the attribute does not exist.
|
|
124
|
+
* @returns {boolean} True if the 'remove-child-after-close' attribute is present, otherwise false.
|
|
125
|
+
*/
|
|
79
126
|
get removeChildAfterClose() {
|
|
80
127
|
return this.hasAttribute("remove-child-after-close") ?? false;
|
|
81
128
|
}
|
|
129
|
+
/**
|
|
130
|
+
* Sets the 'variant' attribute to the specified value.
|
|
131
|
+
* @param {string} value The value to set for the 'variant' attribute.
|
|
132
|
+
*/
|
|
82
133
|
set variant(value) {
|
|
83
134
|
this.setAttribute("variant", value);
|
|
84
135
|
}
|
|
136
|
+
/**
|
|
137
|
+
* Retrieves the value of the "variant" attribute. If the attribute is not set,
|
|
138
|
+
* it returns the default value 'in-place'.
|
|
139
|
+
* @returns {string} The variant value or the default value 'in-place'.
|
|
140
|
+
*/
|
|
85
141
|
get variant() {
|
|
86
142
|
return this.getAttribute("variant") ?? "in-place";
|
|
87
143
|
}
|
|
144
|
+
/**
|
|
145
|
+
* Retrieves the value of the 'screen-break-point' attribute.
|
|
146
|
+
* @returns {string} The value of the 'screen-break-point' attribute.
|
|
147
|
+
*/
|
|
88
148
|
get screenBreakPoint() {
|
|
89
149
|
return this.getAttribute("screen-break-point");
|
|
90
150
|
}
|
|
151
|
+
/**
|
|
152
|
+
* Sets the screen break point value to determine responsive behavior.
|
|
153
|
+
* @param {string} value The value to set as the screen break point.
|
|
154
|
+
*/
|
|
91
155
|
set screenBreakPoint(value) {
|
|
92
156
|
this.setAttribute("screen-break-point", value);
|
|
93
157
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
158
|
+
/**
|
|
159
|
+
* Sets the duration of the animation by updating the `animation-duration` attribute.
|
|
160
|
+
* @param {string} value The duration value for the animation, specified in a format
|
|
161
|
+
* such as seconds (e.g., "2s") or milliseconds (e.g., "200ms").
|
|
162
|
+
*/
|
|
97
163
|
set animationDuration(value) {
|
|
98
164
|
this.setAttribute("animation-duration", value);
|
|
99
165
|
}
|
|
100
|
-
|
|
101
|
-
|
|
166
|
+
/**
|
|
167
|
+
* Gets the animation duration for an element.
|
|
168
|
+
* It retrieves the value of the 'animation-duration' attribute if present; otherwise, it defaults to '500'.
|
|
169
|
+
* @returns {string} The value of the animation duration, either from the attribute or the default '500'.
|
|
170
|
+
*/
|
|
171
|
+
get animationDuration() {
|
|
172
|
+
return this.getAttribute("animation-duration") ?? "500";
|
|
102
173
|
}
|
|
174
|
+
/**
|
|
175
|
+
* Sets the easing function for the animation.
|
|
176
|
+
* @param {string} value The easing function to use for the animation. This can be any valid CSS timing function such as "ease", "linear", "ease-in", "ease-out", etc.
|
|
177
|
+
*/
|
|
103
178
|
set animationEasing(value) {
|
|
104
179
|
this.setAttribute("animation-easing", value);
|
|
105
180
|
}
|
|
181
|
+
/**
|
|
182
|
+
* Retrieves the easing function for the animation.
|
|
183
|
+
* @returns {string} The value of the 'animation-easing' attribute if set, otherwise defaults to 'linear'.
|
|
184
|
+
*/
|
|
185
|
+
get animationEasing() {
|
|
186
|
+
return this.getAttribute("animation-easing") ?? "linear";
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Determines if the element has an 'has-opacity' attribute.
|
|
190
|
+
* @returns {boolean} True if the element has the 'has-opacity' attribute, otherwise false.
|
|
191
|
+
*/
|
|
106
192
|
get hasOpacity() {
|
|
107
193
|
return this.hasAttribute("has-opacity") ?? false;
|
|
108
194
|
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
195
|
+
/**
|
|
196
|
+
* Sets the value of the 'add-to-height' attribute.
|
|
197
|
+
* This attribute is used to modify or adjust the height dynamically.
|
|
198
|
+
* @param {string} value The value to be assigned to the 'add-to-height' attribute.
|
|
199
|
+
*/
|
|
112
200
|
set addToHeight(value) {
|
|
113
201
|
this.setAttribute("add-to-height", value);
|
|
114
202
|
}
|
|
203
|
+
/**
|
|
204
|
+
* Retrieves the value of the 'add-to-height' attribute from the element.
|
|
205
|
+
* If the attribute is not set, it defaults to '0'.
|
|
206
|
+
* @returns {string} The value of the 'add-to-height' attribute or '0' if the attribute is not present.
|
|
207
|
+
*/
|
|
208
|
+
get addToHeight() {
|
|
209
|
+
return this.getAttribute("add-to-height") ?? "0";
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Determines whether the current state is open.
|
|
213
|
+
* @returns {boolean} True if the state is open, otherwise false.
|
|
214
|
+
*/
|
|
115
215
|
get isOpen() {
|
|
116
216
|
return this._isOpen;
|
|
117
217
|
}
|
|
@@ -120,18 +220,7 @@ class SlidingContainer extends WJElement {
|
|
|
120
220
|
* @returns {string[]}
|
|
121
221
|
*/
|
|
122
222
|
static get observedAttributes() {
|
|
123
|
-
return [
|
|
124
|
-
"max-width",
|
|
125
|
-
"max-height",
|
|
126
|
-
"trigger",
|
|
127
|
-
"direction",
|
|
128
|
-
"variant",
|
|
129
|
-
"screen-break-point",
|
|
130
|
-
"remove-child-after-close",
|
|
131
|
-
"animation-duration",
|
|
132
|
-
"animation-easing",
|
|
133
|
-
"has-opacity"
|
|
134
|
-
];
|
|
223
|
+
return ["max-width", "max-height", "trigger", "direction", "variant", "screen-break-point", "remove-child-after-close", "animation-duration", "animation-easing", "has-opacity"];
|
|
135
224
|
}
|
|
136
225
|
/**
|
|
137
226
|
* Returns the CSS styles for the component.
|
|
@@ -147,6 +236,15 @@ class SlidingContainer extends WJElement {
|
|
|
147
236
|
setupAttributes() {
|
|
148
237
|
this.isShadowRoot = "open";
|
|
149
238
|
}
|
|
239
|
+
/**
|
|
240
|
+
* Executes before drawing the element.
|
|
241
|
+
*/
|
|
242
|
+
beforeDraw() {
|
|
243
|
+
var _a, _b;
|
|
244
|
+
(_a = this.animation) == null ? void 0 : _a.cancel();
|
|
245
|
+
(_b = this.nativeAnimation) == null ? void 0 : _b.cancel();
|
|
246
|
+
document.removeEventListener(this.trigger, this.triggerEvent);
|
|
247
|
+
}
|
|
150
248
|
/**
|
|
151
249
|
* Draws the component.
|
|
152
250
|
* @param {object} context The context for drawing.
|
|
@@ -156,19 +254,16 @@ class SlidingContainer extends WJElement {
|
|
|
156
254
|
*/
|
|
157
255
|
draw(context, store, params) {
|
|
158
256
|
let fragment = document.createDocumentFragment();
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
this.wrapperDiv = document.createElement("div");
|
|
164
|
-
this.wrapperDiv.classList.add("sliding-container-wrapper");
|
|
165
|
-
this.transparentDiv = document.createElement("div");
|
|
166
|
-
this.transparentDiv.classList.add("sliding-container-transparent");
|
|
257
|
+
let wrapperDiv = document.createElement("div");
|
|
258
|
+
wrapperDiv.classList.add("sliding-container-wrapper");
|
|
259
|
+
let transparentDiv = document.createElement("div");
|
|
260
|
+
transparentDiv.classList.add("sliding-container-transparent");
|
|
167
261
|
if (this._isOpen) {
|
|
168
|
-
|
|
262
|
+
transparentDiv.style.width = this.maxWidth;
|
|
169
263
|
}
|
|
170
264
|
let native = document.createElement("div");
|
|
171
|
-
native.
|
|
265
|
+
native.setAttribute("part", "sliding-container");
|
|
266
|
+
native.classList.add("native-sliding-container");
|
|
172
267
|
native.style.width = 0;
|
|
173
268
|
if (this.hasOpacity) {
|
|
174
269
|
native.style.opacity = 0;
|
|
@@ -179,9 +274,6 @@ class SlidingContainer extends WJElement {
|
|
|
179
274
|
native.style.opacity = 1;
|
|
180
275
|
}
|
|
181
276
|
}
|
|
182
|
-
native.style.height = "100%";
|
|
183
|
-
native.classList.add("native-sliding-container");
|
|
184
|
-
native.setAttribute("part", "sliding-container");
|
|
185
277
|
if (this.direction === "right") {
|
|
186
278
|
native.style.right = 0;
|
|
187
279
|
} else {
|
|
@@ -190,47 +282,18 @@ class SlidingContainer extends WJElement {
|
|
|
190
282
|
let slot = document.createElement("slot");
|
|
191
283
|
const nativeInner = document.createElement("div");
|
|
192
284
|
nativeInner.classList.add("native-sliding-container-inner");
|
|
193
|
-
nativeInner.style.height = "100%";
|
|
194
|
-
nativeInner.style.position = "absolute";
|
|
195
285
|
nativeInner.style.width = this.maxWidth;
|
|
196
|
-
nativeInner.
|
|
197
|
-
nativeInner.
|
|
198
|
-
native.
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
fragment.
|
|
286
|
+
nativeInner.append(slot);
|
|
287
|
+
nativeInner.append(this.htmlCloseButton());
|
|
288
|
+
native.append(nativeInner);
|
|
289
|
+
wrapperDiv.append(transparentDiv);
|
|
290
|
+
wrapperDiv.append(native);
|
|
291
|
+
fragment.append(wrapperDiv);
|
|
292
|
+
this.transparentDiv = transparentDiv;
|
|
293
|
+
this.wrapperDiv = wrapperDiv;
|
|
202
294
|
this.nativeElement = native;
|
|
203
295
|
return fragment;
|
|
204
296
|
}
|
|
205
|
-
/**
|
|
206
|
-
* Creates and returns a close button element.
|
|
207
|
-
* @returns {HTMLElement} The close button element.
|
|
208
|
-
*/
|
|
209
|
-
getCloseButton() {
|
|
210
|
-
let closeButton = document.createElement("wje-button");
|
|
211
|
-
closeButton.setAttribute("part", "close-button");
|
|
212
|
-
closeButton.style.position = "absolute";
|
|
213
|
-
closeButton.style.top = "0";
|
|
214
|
-
closeButton.style.right = "0";
|
|
215
|
-
closeButton.style.zIndex = "1000";
|
|
216
|
-
let icon = document.createElement("wje-icon");
|
|
217
|
-
icon.setAttribute("slot", "icon-only");
|
|
218
|
-
icon.setAttribute("name", "x");
|
|
219
|
-
closeButton.appendChild(icon);
|
|
220
|
-
closeButton.addEventListener("click", () => {
|
|
221
|
-
this.close();
|
|
222
|
-
});
|
|
223
|
-
return closeButton;
|
|
224
|
-
}
|
|
225
|
-
/**
|
|
226
|
-
* Executes before drawing the element.
|
|
227
|
-
*/
|
|
228
|
-
beforeDraw() {
|
|
229
|
-
var _a, _b;
|
|
230
|
-
(_a = this.animation) == null ? void 0 : _a.cancel();
|
|
231
|
-
(_b = this.nativeAnimation) == null ? void 0 : _b.cancel();
|
|
232
|
-
document.removeEventListener(this.trigger, this.triggerEvent);
|
|
233
|
-
}
|
|
234
297
|
/**
|
|
235
298
|
* Performs actions after the element is drawn on the screen.
|
|
236
299
|
* Attaches an event listener to the document based on the specified trigger.
|
|
@@ -244,6 +307,29 @@ class SlidingContainer extends WJElement {
|
|
|
244
307
|
}
|
|
245
308
|
this.checkForVariant(this.variant);
|
|
246
309
|
}
|
|
310
|
+
/**
|
|
311
|
+
* Creates and returns a styled close button element with an icon,
|
|
312
|
+
* including an event listener to trigger the close method.
|
|
313
|
+
* @returns {HTMLElement} The close button element configured with styles, an icon, and event listener.
|
|
314
|
+
*/
|
|
315
|
+
htmlCloseButton() {
|
|
316
|
+
let closeButton = document.createElement("wje-button");
|
|
317
|
+
closeButton.setAttribute("part", "close-button");
|
|
318
|
+
closeButton.classList.add("close-button");
|
|
319
|
+
let icon = document.createElement("wje-icon");
|
|
320
|
+
icon.setAttribute("slot", "icon-only");
|
|
321
|
+
icon.setAttribute("name", "x");
|
|
322
|
+
closeButton.append(icon);
|
|
323
|
+
event.addListener(closeButton, "wje-button:click", null, (e) => {
|
|
324
|
+
this.close();
|
|
325
|
+
});
|
|
326
|
+
return closeButton;
|
|
327
|
+
}
|
|
328
|
+
/**
|
|
329
|
+
* Retrieves the parent element of the current element.
|
|
330
|
+
* If the parent element is not found, it attempts to find the root host element.
|
|
331
|
+
* @returns {Element|null} The parent element or the root host element if no parent exists. Returns null if neither is found.
|
|
332
|
+
*/
|
|
247
333
|
getParentElement() {
|
|
248
334
|
let parentElement = this.parentElement;
|
|
249
335
|
if (!parentElement) {
|
|
@@ -252,8 +338,12 @@ class SlidingContainer extends WJElement {
|
|
|
252
338
|
return parentElement;
|
|
253
339
|
}
|
|
254
340
|
/**
|
|
255
|
-
*
|
|
256
|
-
*
|
|
341
|
+
* Adjusts the position and dimensions of the current element based on the specified variant.
|
|
342
|
+
*
|
|
343
|
+
* The method handles modifications to the element's positioning style, aligns it relative to its parent,
|
|
344
|
+
* and manages alignment to its siblings based on the specified direction.
|
|
345
|
+
* @param {string} variant The variant to determine how the element should be updated. For example, when set to 'over', specific adjustments to the position and size are performed.
|
|
346
|
+
* @returns {void} No value is returned, the method modifies the element's style properties directly.
|
|
257
347
|
*/
|
|
258
348
|
checkForVariant(variant) {
|
|
259
349
|
if (variant === "over") {
|
|
@@ -287,26 +377,31 @@ class SlidingContainer extends WJElement {
|
|
|
287
377
|
/**
|
|
288
378
|
* Executes before the element is opened.
|
|
289
379
|
*/
|
|
290
|
-
beforeOpen(
|
|
380
|
+
beforeOpen(e) {
|
|
291
381
|
}
|
|
292
382
|
/**
|
|
293
383
|
* Callback function called after the element is opened.
|
|
294
384
|
*/
|
|
295
|
-
afterOpen(
|
|
385
|
+
afterOpen(e) {
|
|
296
386
|
}
|
|
297
387
|
/**
|
|
298
388
|
* Executes before closing the element.
|
|
299
389
|
*/
|
|
300
|
-
beforeClose(
|
|
390
|
+
beforeClose(e) {
|
|
301
391
|
}
|
|
302
392
|
/**
|
|
303
393
|
* Callback function that is called after the container is closed.
|
|
304
394
|
*/
|
|
305
|
-
afterClose(
|
|
395
|
+
afterClose(e) {
|
|
306
396
|
}
|
|
307
397
|
/**
|
|
308
|
-
* Animates the transition of
|
|
309
|
-
*
|
|
398
|
+
* Animates the transition of elements with specified options, toggling the visibility and/or dimensions
|
|
399
|
+
* of the associated elements based on their current state.
|
|
400
|
+
*
|
|
401
|
+
* This method handles both forward and reverse animations for two elements (`transparentDiv` and `nativeElement`)
|
|
402
|
+
* with optional opacity changes. It ensures smooth transitioning by canceling any previous animations on the provided
|
|
403
|
+
* elements before initiating a new animation sequence.
|
|
404
|
+
* @returns {Promise<void>} A promise that resolves when the transition animation is completed.
|
|
310
405
|
*/
|
|
311
406
|
doAnimateTransition() {
|
|
312
407
|
var _a, _b, _c, _d;
|
|
@@ -397,73 +492,62 @@ class SlidingContainer extends WJElement {
|
|
|
397
492
|
});
|
|
398
493
|
}
|
|
399
494
|
/**
|
|
400
|
-
* Opens the container
|
|
401
|
-
* @
|
|
495
|
+
* Opens the sliding container by performing necessary preparatory and transitional operations.
|
|
496
|
+
* @param {Event} e The event that triggered the open operation.
|
|
497
|
+
* @returns {Promise<void>} A promise that resolves when the open operation, including animations and subsequent handlers, is complete.
|
|
402
498
|
*/
|
|
403
|
-
async open(
|
|
404
|
-
await Promise.resolve(this.beforeOpen(
|
|
499
|
+
async open(e) {
|
|
500
|
+
await Promise.resolve(this.beforeOpen(e)).then(async () => {
|
|
405
501
|
if (!this._isOpen) {
|
|
406
|
-
this.
|
|
407
|
-
|
|
408
|
-
bubbles: true,
|
|
409
|
-
composed: true
|
|
410
|
-
})
|
|
411
|
-
);
|
|
502
|
+
this.classList.add("open");
|
|
503
|
+
event.dispatchCustomEvent(this, "wje-sliding-container:beforeOpen");
|
|
412
504
|
this.checkForVariant(this.variant);
|
|
413
505
|
await this.doAnimateTransition();
|
|
414
|
-
await Promise.resolve(this.afterOpen(
|
|
415
|
-
|
|
416
|
-
new CustomEvent("wje-sliding-container:open", {
|
|
417
|
-
bubbles: true,
|
|
418
|
-
composed: true
|
|
419
|
-
})
|
|
420
|
-
);
|
|
506
|
+
await Promise.resolve(this.afterOpen(e)).then(() => {
|
|
507
|
+
event.dispatchCustomEvent(this, "wje-sliding-container:open");
|
|
421
508
|
});
|
|
422
509
|
}
|
|
423
510
|
});
|
|
424
511
|
}
|
|
425
512
|
/**
|
|
426
|
-
* Closes the
|
|
427
|
-
* @
|
|
513
|
+
* Closes the sliding container and performs associated operations such as animations and event dispatches.
|
|
514
|
+
* @param {Event} e The event object associated with the close action.
|
|
515
|
+
* @returns {Promise<void>} A promise that resolves when the closing operation, including animations and child element removal, is completed.
|
|
428
516
|
*/
|
|
429
|
-
async close(
|
|
430
|
-
await Promise.resolve(this.beforeClose(
|
|
517
|
+
async close(e) {
|
|
518
|
+
await Promise.resolve(this.beforeClose(e)).then(async () => {
|
|
431
519
|
if (this._isOpen) {
|
|
432
|
-
this.
|
|
433
|
-
|
|
434
|
-
bubbles: true,
|
|
435
|
-
composed: true
|
|
436
|
-
})
|
|
437
|
-
);
|
|
520
|
+
this.classList.remove("open");
|
|
521
|
+
event.dispatchCustomEvent(this, "wje-sliding-container:beforeClose");
|
|
438
522
|
await this.doAnimateTransition();
|
|
439
|
-
await Promise.resolve(this.afterClose(
|
|
523
|
+
await Promise.resolve(this.afterClose(e)).then(() => {
|
|
440
524
|
if (this.removeChildAfterClose) {
|
|
441
525
|
this.childNodes.forEach((child) => {
|
|
442
526
|
child.remove();
|
|
443
527
|
});
|
|
444
528
|
}
|
|
445
|
-
|
|
446
|
-
new CustomEvent("wje-sliding-container:close", {
|
|
447
|
-
bubbles: true,
|
|
448
|
-
composed: true
|
|
449
|
-
})
|
|
450
|
-
);
|
|
529
|
+
event.dispatchCustomEvent(this, "wje-sliding-container:afterClose");
|
|
451
530
|
});
|
|
452
531
|
}
|
|
453
532
|
});
|
|
454
533
|
}
|
|
455
534
|
/**
|
|
456
|
-
* Toggles the state
|
|
457
|
-
*
|
|
458
|
-
* @returns {Promise<void>} A promise that resolves
|
|
535
|
+
* Toggles the state between open and closed.
|
|
536
|
+
* @param {Event} e The event object triggering the toggle.
|
|
537
|
+
* @returns {Promise<void>} A promise that resolves once the toggle operation (open or close) is complete.
|
|
459
538
|
*/
|
|
460
|
-
async toggle(
|
|
539
|
+
async toggle(e) {
|
|
461
540
|
if (this._isOpen) {
|
|
462
541
|
await this.close(event);
|
|
463
542
|
} else {
|
|
464
543
|
await this.open(event);
|
|
465
544
|
}
|
|
466
545
|
}
|
|
546
|
+
/**
|
|
547
|
+
* Cleans up resources associated with the component by disconnecting
|
|
548
|
+
* the resize observer and setting it to null.
|
|
549
|
+
* @returns {void} Does not return a value.
|
|
550
|
+
*/
|
|
467
551
|
componentCleanup() {
|
|
468
552
|
var _a;
|
|
469
553
|
(_a = this._resizeObserver) == null ? void 0 : _a.disconnect();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wje-sliding-container.js","sources":["../experimental-packages/wje-sliding-container/sliding-container.element.js","../experimental-packages/wje-sliding-container/sliding-container.js"],"sourcesContent":["import { default as WJElement } from '../../packages/wje-element/element.js';\nimport styles from './styles/styles.css?inline';\n\n/**\n * @summary SlidingContainer is a custom web component that extends WJElement.\n * @documentation https://elements.webjet.sk/components/SlidingContainer\n * @status stable\n * @augments WJElement\n * @csspart - Styles the element.\n * @slot - The default slot for the SlidingContainer.\n * @property {string} maxWidth - The maximum width of the SlidingContainer.\n * @property {string} maxHeight - The maximum height of the SlidingContainer.\n * @property {string} trigger - The trigger for the SlidingContainer.\n * @property {string} direction - Specifies the sliding direction of the container (e.g., 'left' or 'right').\n * @property {string} variant - Determines how the SlidingContainer behaves, such as 'over' or 'in-place'.\n * @property {string} screenBreakPoint - The width (in pixels) at which the SlidingContainer switches to the \"over\" variant for smaller screens.\n * @property {boolean} removeChildAfterClose - Removes the child after the SlidingContainer is closed.\n * @property {string} animationDuration - Specifies the duration (in milliseconds) of the sliding animation.\n * @property {string} animationEasing - Specifies the easing function used for the sliding animation (e.g., 'linear', 'ease-in', 'ease-out').\n * @property {boolean} hasOpacity - Sets the opacity of the SlidingContainer.\n * @tag wje-sliding-container\n * @example\n * <wje-sliding-container trigger=\"test-resize-container-event-right\" id=\"left-in-place\" direction=\"left\" max-width=\"100px\" max-height=\"100%\">\n * <wje-card>\n * <wje-card-header>\n * <wje-card-subtitle>CONTENT Subtitle</wje-card-subtitle>\n * <wje-card-title>CONTENT Title</wje-card-title>\n * </wje-card-header>\n * <wje-card-content>\n * CONTENT Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n * </wje-card-content>\n * </wje-card>\n * </wje-sliding-container>\n */\nexport default class SlidingContainer extends WJElement {\n /**\n * Creates an instance of SlidingContainer.\n * @class\n */\n constructor() {\n super();\n\n this._isOpen = false;\n this._lastCaller = null;\n\n this._resizeObserver = new ResizeObserver((entries) => {\n for (let entry of entries) {\n if (entry.contentBoxSize) {\n if (this.drawingStatus < 3) return;\n\n if (this.screenBreakPoint && window.innerWidth <= this.screenBreakPoint) {\n if (this.variant !== 'over') {\n this.variant = 'over';\n } else {\n this.checkForVariant(this.variant);\n }\n } else {\n if (this.variant !== 'in-place') {\n this.variant = 'in-place';\n } else {\n this.checkForVariant(this.variant);\n }\n }\n }\n }\n });\n\n this._resizeObserver.observe(document.documentElement);\n }\n\n set maxWidth(value) {\n this.setAttribute('max-width', value);\n }\n\n get maxWidth() {\n return this.getAttribute('max-width') ?? 'auto';\n }\n\n set maxHeight(value) {\n this.setAttribute('max-height', value);\n }\n\n get maxHeight() {\n return this.getAttribute('max-height') ?? 'auto';\n }\n\n set trigger(value) {\n this.setAttribute('trigger', value);\n }\n\n get trigger() {\n return this.getAttribute('trigger') ?? 'sliding-container';\n }\n\n set direction(value) {\n this.setAttribute('direction', value);\n }\n\n get direction() {\n return this.getAttribute('direction') ?? 'right';\n }\n\n set removeChildAfterClose(value) {\n this.setAttribute('remove-child-after-close', value);\n }\n\n get removeChildAfterClose() {\n return this.hasAttribute('remove-child-after-close') ?? false;\n }\n\n set variant(value) {\n this.setAttribute('variant', value);\n }\n\n get variant() {\n return this.getAttribute('variant') ?? 'in-place';\n }\n\n get screenBreakPoint() {\n return this.getAttribute('screen-break-point');\n }\n\n set screenBreakPoint(value) {\n this.setAttribute('screen-break-point', value);\n }\n\n get animationDuration() {\n return this.getAttribute('animation-duration') ?? '500';\n }\n\n set animationDuration(value) {\n this.setAttribute('animation-duration', value);\n }\n\n get animationEasing() {\n return this.getAttribute('animation-easing') ?? 'linear';\n }\n\n set animationEasing(value) {\n this.setAttribute('animation-easing', value);\n }\n\n get hasOpacity() {\n return this.hasAttribute('has-opacity') ?? false;\n }\n\n get addToHeight() {\n return this.getAttribute('add-to-height') ?? '0';\n }\n\n set addToHeight(value) {\n this.setAttribute('add-to-height', value);\n }\n\n get isOpen() {\n return this._isOpen;\n }\n\n className = 'SlidingContainer';\n\n /**\n * Returns the observed attributes for the component.\n * @returns {string[]}\n */\n static get observedAttributes() {\n return [\n 'max-width',\n 'max-height',\n 'trigger',\n 'direction',\n 'variant',\n 'screen-break-point',\n 'remove-child-after-close',\n 'animation-duration',\n 'animation-easing',\n 'has-opacity',\n ];\n }\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.\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 this.style.position = 'relative';\n this.style.height = '100%';\n this.style.right = 'unset';\n this.style.left = 'unset';\n\n this.wrapperDiv = document.createElement('div');\n this.wrapperDiv.classList.add('sliding-container-wrapper');\n\n this.transparentDiv = document.createElement('div');\n this.transparentDiv.classList.add('sliding-container-transparent');\n if (this._isOpen) {\n this.transparentDiv.style.width = this.maxWidth;\n }\n\n let native = document.createElement('div');\n native.style.position = 'absolute';\n native.style.width = 0;\n if (this.hasOpacity) {\n native.style.opacity = 0;\n }\n\n if (this._isOpen) {\n native.style.width = this.maxWidth;\n if (this.hasOpacity) {\n native.style.opacity = 1;\n }\n }\n\n native.style.height = '100%';\n\n native.classList.add('native-sliding-container');\n native.setAttribute('part', 'sliding-container');\n\n if (this.direction === 'right') {\n native.style.right = 0;\n } else {\n native.style.left = 0;\n }\n\n let slot = document.createElement('slot');\n\n const nativeInner = document.createElement('div');\n nativeInner.classList.add('native-sliding-container-inner');\n nativeInner.style.height = '100%';\n nativeInner.style.position = 'absolute';\n nativeInner.style.width = this.maxWidth;\n\n nativeInner.appendChild(slot);\n nativeInner.appendChild(this.getCloseButton());\n\n native.appendChild(nativeInner);\n this.wrapperDiv.appendChild(this.transparentDiv);\n this.wrapperDiv.appendChild(native);\n fragment.appendChild(this.wrapperDiv);\n\n this.nativeElement = native;\n\n return fragment;\n }\n\n /**\n * Creates and returns a close button element.\n * @returns {HTMLElement} The close button element.\n */\n getCloseButton() {\n let closeButton = document.createElement('wje-button');\n closeButton.setAttribute('part', 'close-button');\n closeButton.style.position = 'absolute';\n closeButton.style.top = '0';\n closeButton.style.right = '0';\n closeButton.style.zIndex = '1000';\n\n let icon = document.createElement('wje-icon');\n icon.setAttribute('slot', 'icon-only');\n icon.setAttribute('name', 'x');\n closeButton.appendChild(icon);\n\n closeButton.addEventListener('click', () => {\n this.close();\n });\n\n return closeButton;\n }\n\n /**\n * Executes before drawing the element.\n */\n beforeDraw() {\n this.animation?.cancel();\n this.nativeAnimation?.cancel();\n document.removeEventListener(this.trigger, this.triggerEvent);\n }\n\n /**\n * Performs actions after the element is drawn on the screen.\n * Attaches an event listener to the document based on the specified trigger.\n * Sets the variant to \"over\" if the document width is smaller than the screen break point.\n * Calls the checkForVariant method with the current variant.\n */\n afterDraw() {\n document.addEventListener(this.trigger, this.triggerEvent);\n\n // if document width is on small screen set variant to over\n if (this.screenBreakPoint && window.innerWidth <= this.screenBreakPoint) {\n this.variant = 'over';\n }\n\n this.checkForVariant(this.variant);\n }\n\n getParentElement() {\n let parentElement = this.parentElement;\n\n if (!parentElement) {\n parentElement = this.getRootNode().host;\n }\n\n return parentElement;\n }\n\n /**\n * Checks for a specific variant and applies corresponding styles.\n * @param {string} variant The variant to check for.\n */\n checkForVariant(variant) {\n if (variant === 'over') {\n this.style.position = 'fixed';\n let computentStyleOfParent = window.getComputedStyle(this.getParentElement());\n let parentElementBoundingbox = this.getParentElement().getBoundingClientRect();\n let heightOfParrentElement = parseFloat(computentStyleOfParent.height);\n\n let topOfParrentElement = parseFloat(computentStyleOfParent.top);\n\n this.style.height = heightOfParrentElement + +this.addToHeight + 'px';\n this.wrapperDiv.style.height = heightOfParrentElement + +this.addToHeight + 'px';\n this.style.top = topOfParrentElement + 'px';\n\n const leftSibling = this.previousElementSibling;\n const rightSibling = this.nextElementSibling;\n const leftSiblingBoundingbox = leftSibling?.getBoundingClientRect();\n const rightSiblingBoundingbox = rightSibling?.getBoundingClientRect();\n\n if (this.direction === 'right') {\n // attach to left sibling\n if (leftSiblingBoundingbox) {\n this.style.left = leftSiblingBoundingbox.left + leftSiblingBoundingbox.width + 'px';\n } else {\n this.style.left = parentElementBoundingbox.left + 'px';\n }\n } else {\n // attach to right sibling\n if (rightSiblingBoundingbox) {\n this.style.right = window.innerWidth - rightSiblingBoundingbox.left + 'px';\n } else {\n this.style.right =\n window.innerWidth - (parentElementBoundingbox.left + parentElementBoundingbox.width) + 'px';\n }\n }\n }\n }\n\n /**\n * Triggers the event based on the target element.\n * If the target element is different from the last caller, it refreshes the children by calling the `open` method.\n * If the target element is the same as the last caller, it toggles the state by calling the `toggle` method.\n * @param {Event} e The event object.\n */\n triggerEvent = async (e) => {\n if (this._lastCaller && this._lastCaller !== e.composedPath()[0]) {\n // same oppener event but different caller so just refresh inner content\n await this.open(e);\n } else {\n // came caller so toggle\n await this.toggle(e);\n }\n\n this._lastCaller = e.composedPath()[0];\n };\n\n /**\n * Executes before the element is opened.\n */\n beforeOpen(event) {\n // Hook for extending behavior before the dialog opens\n }\n\n /**\n * Callback function called after the element is opened.\n */\n afterOpen(event) {\n // Hook for extending behavior before the dialog opens\n }\n\n /**\n * Executes before closing the element.\n */\n beforeClose(event) {\n // Hook for extending behavior before the dialog opens\n }\n\n /**\n * Callback function that is called after the container is closed.\n */\n afterClose(event) {\n // Hook for extending behavior before the dialog opens\n }\n\n /**\n * Animates the transition of the element's width from 0 to the maximum width or vice versa.\n * @returns {Promise<void>} A promise that resolves when the animation is complete.\n */\n doAnimateTransition() {\n const options = {\n delay: 0,\n endDelay: 0,\n fill: 'forwards',\n duration: +this.animationDuration,\n iterationStart: 0,\n iterations: 1,\n direction: 'normal',\n easing: this.animationEasing,\n };\n\n if (this.animation && this.animation?.effect?.target !== this.transparentDiv) {\n this.animation.cancel();\n this.animation = null;\n }\n\n if (this.nativeAnimation && this.nativeAnimation?.effect?.target !== this.nativeElement) {\n this.nativeAnimation.cancel();\n this.nativeAnimation = null;\n }\n\n if (!this._isOpen) {\n if (this.animation && this.nativeAnimation) {\n this.animation.reverse();\n this.nativeAnimation.reverse();\n } else {\n this.animation = this.transparentDiv.animate(\n [\n {\n width: 0,\n },\n {\n width: this.maxWidth,\n },\n ],\n options\n );\n\n this.nativeAnimation = this.nativeElement.animate(\n [\n {\n ...(this.hasOpacity ? { opacity: 0 } : {}),\n width: 0,\n },\n {\n ...(this.hasOpacity ? { opacity: 1 } : {}),\n width: this.maxWidth,\n },\n ],\n options\n );\n }\n } else {\n if (this.animation && this.nativeAnimation) {\n this.animation.reverse();\n this.nativeAnimation.reverse();\n } else {\n this.animation = this.transparentDiv.animate(\n [\n {\n width: this.maxWidth,\n },\n {\n width: 0,\n },\n ],\n options\n );\n\n this.nativeAnimation = this.nativeElement.animate(\n [\n {\n ...(this.hasOpacity ? { opacity: 1 } : {}),\n width: this.maxWidth,\n },\n {\n ...(this.hasOpacity ? { opacity: 0 } : {}),\n width: 0,\n },\n ],\n options\n );\n }\n }\n\n return new Promise((resolve, reject) => {\n this.animation.onfinish = () => {\n this._isOpen = !this._isOpen;\n resolve();\n };\n });\n }\n\n /**\n * Opens the container with an animation.\n * @returns {Promise<void>} A promise that resolves when the container is opened.\n */\n async open(event) {\n await Promise.resolve(this.beforeOpen(event)).then(async () => {\n if (!this._isOpen) {\n this.dispatchEvent(\n new CustomEvent('wje-sliding-container:beforeOpen', {\n bubbles: true,\n composed: true,\n })\n );\n\n this.checkForVariant(this.variant);\n\n await this.doAnimateTransition();\n\n await Promise.resolve(this.afterOpen(event)).then(() => {\n this.dispatchEvent(\n new CustomEvent('wje-sliding-container:open', {\n bubbles: true,\n composed: true,\n })\n );\n });\n }\n });\n }\n\n /**\n * Closes the animation container.\n * @returns {Promise<void>} A promise that resolves when the container is closed.\n */\n async close(event) {\n await Promise.resolve(this.beforeClose(event)).then(async () => {\n if (this._isOpen) {\n this.dispatchEvent(\n new CustomEvent('wje-sliding-container:beforeClose', {\n bubbles: true,\n composed: true,\n })\n );\n\n await this.doAnimateTransition();\n\n await Promise.resolve(this.afterClose(event)).then(() => {\n if (this.removeChildAfterClose) {\n this.childNodes.forEach((child) => {\n child.remove();\n });\n }\n\n this.dispatchEvent(\n new CustomEvent('wje-sliding-container:close', {\n bubbles: true,\n composed: true,\n })\n );\n });\n }\n });\n }\n\n /**\n * Toggles the state of the element.\n * If the element is open, it will be closed. If it is closed, it will be opened.\n * @returns {Promise<void>} A promise that resolves when the toggle operation is complete.\n */\n async toggle(event) {\n if (this._isOpen) {\n await this.close(event);\n } else {\n await this.open(event);\n }\n }\n\n componentCleanup() {\n this._resizeObserver?.disconnect();\n this._resizeObserver = null;\n }\n}\n","import SlidingContainer from './sliding-container.element.js';\n\nexport default SlidingContainer;\n\nSlidingContainer.define('wje-sliding-container', SlidingCont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AK;AAAA,YACD,IAAI,YAAY,8BAA8B;AAAA,cAC1C,SAAS;AAAA,cACT,UAAU;AAAA,YACb,CAAA;AAAA,UACJ;AAAA,QACrB,CAAiB;AAAA,MACjB;AAAA,IACA,CAAS;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA,EAMI,MAAM,MAAM,OAAO;AACf,UAAM,QAAQ,QAAQ,KAAK,YAAY,KAAK,CAAC,EAAE,KAAK,YAAY;AAC5D,UAAI,KAAK,SAAS;AACd,aAAK;AAAA,UACD,IAAI,YAAY,qCAAqC;AAAA,YACjD,SAAS;AAAA,YACT,UAAU;AAAA,UACb,CAAA;AAAA,QACJ;AAED,cAAM,KAAK,oBAAqB;AAEhC,cAAM,QAAQ,QAAQ,KAAK,WAAW,KAAK,CAAC,EAAE,KAAK,MAAM;AACrD,cAAI,KAAK,uBAAuB;AAC5B,iBAAK,WAAW,QAAQ,CAAC,UAAU;AAC/B,oBAAM,OAAQ;AAAA,YAC1C,CAAyB;AAAA,UACzB;AAEoB,eAAK;AAAA,YACD,IAAI,YAAY,+BAA+B;AAAA,cAC3C,SAAS;AAAA,cACT,UAAU;AAAA,YACb,CAAA;AAAA,UACJ;AAAA,QACrB,CAAiB;AAAA,MACjB;AAAA,IACA,CAAS;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOI,MAAM,OAAO,OAAO;AAChB,QAAI,KAAK,SAAS;AACd,YAAM,KAAK,MAAM,KAAK;AAAA,IAClC,OAAe;AACH,YAAM,KAAK,KAAK,KAAK;AAAA,IACjC;AAAA,EACA;AAAA,EAEI,mBAAmB;;AACf,eAAK,oBAAL,mBAAsB;AACtB,SAAK,kBAAkB;AAAA,EAC/B;AACA;AC3kBA,iBAAiB,OAAO,yBAAyB,gBAAgB;"}
|
|
1
|
+
{"version":3,"file":"wje-sliding-container.js","sources":["../packages/wje-sliding-container/sliding-container.element.js","../packages/wje-sliding-container/sliding-container.js"],"sourcesContent":["import { default as WJElement, event } from '../wje-element/element.js';\nimport styles from './styles/styles.css?inline';\n\n/**\n * @summary SlidingContainer is a custom web component that extends WJElement.\n * @documentation https://elements.webjet.sk/components/SlidingContainer\n * @status stable\n * @augments WJElement\n * @csspart - Styles the element.\n * @slot - The default slot for the SlidingContainer.\n * @property {string} maxWidth - The maximum width of the SlidingContainer.\n * @property {string} maxHeight - The maximum height of the SlidingContainer.\n * @property {string} trigger - The trigger for the SlidingContainer.\n * @property {string} direction - Specifies the sliding direction of the container (e.g., 'left' or 'right').\n * @property {string} variant - Determines how the SlidingContainer behaves, such as 'over' or 'in-place'.\n * @property {string} screenBreakPoint - The width (in pixels) at which the SlidingContainer switches to the \"over\" variant for smaller screens.\n * @property {boolean} removeChildAfterClose - Removes the child after the SlidingContainer is closed.\n * @property {string} animationDuration - Specifies the duration (in milliseconds) of the sliding animation.\n * @property {string} animationEasing - Specifies the easing function used for the sliding animation (e.g., 'linear', 'ease-in', 'ease-out').\n * @property {boolean} hasOpacity - Sets the opacity of the SlidingContainer.\n * @tag wje-sliding-container\n * @example\n * <wje-sliding-container trigger=\"test-resize-container-event-right\" id=\"left-in-place\" direction=\"left\" max-width=\"100px\" max-height=\"100%\">\n * <wje-card>\n * <wje-card-header>\n * <wje-card-subtitle>CONTENT Subtitle</wje-card-subtitle>\n * <wje-card-title>CONTENT Title</wje-card-title>\n * </wje-card-header>\n * <wje-card-content>\n * CONTENT Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n * </wje-card-content>\n * </wje-card>\n * </wje-sliding-container>\n */\nexport default class SlidingContainer extends WJElement {\n /**\n * Creates an instance of SlidingContainer.\n * @class\n */\n constructor() {\n super();\n\n this._isOpen = false;\n this._lastCaller = null;\n\n this._resizeObserver = new ResizeObserver((entries) => {\n for (let entry of entries) {\n if (entry.contentBoxSize) {\n if (this.drawingStatus < 3) return;\n\n if (this.screenBreakPoint && window.innerWidth <= this.screenBreakPoint) {\n if (this.variant !== 'over') {\n this.variant = 'over';\n } else {\n this.checkForVariant(this.variant);\n }\n } else {\n if (this.variant !== 'in-place') {\n this.variant = 'in-place';\n } else {\n this.checkForVariant(this.variant);\n }\n }\n }\n }\n });\n\n this._resizeObserver.observe(document.documentElement);\n }\n\n /**\n * Sets the maximum width of an element by updating the 'max-width' attribute.\n * @param {string} value The maximum width value to be set (e.g., '100px', '50%', etc.).\n */\n set maxWidth(value) {\n this.setAttribute('max-width', value);\n }\n\n /**\n * Gets the maximum width value of the element.\n * Retrieves the value of the 'max-width' attribute. If the attribute is not set, it defaults to 'auto'.\n * @returns {string} The maximum width value of the element or 'auto' if the attribute is not defined.\n */\n get maxWidth() {\n return this.getAttribute('max-width') ?? 'auto';\n }\n\n /**\n * Sets the maximum height for the element.\n * @param {string} value The maximum height value to be applied to the element. This can include units such as \"px\", \"em\", \"%\", etc.\n */\n set maxHeight(value) {\n this.setAttribute('max-height', value);\n }\n\n /**\n * Retrieves the maximum height value of the element, or returns 'auto' if not set.\n * @returns {string} The maximum height value or 'auto' if the attribute is not specified.\n */\n get maxHeight() {\n return this.getAttribute('max-height') ?? 'auto';\n }\n\n /**\n * Sets the 'trigger' attribute for the element.\n * @param {string} value The value to set for the 'trigger' attribute.\n */\n set trigger(value) {\n this.setAttribute('trigger', value);\n }\n\n /**\n * Retrieves the value of the 'trigger' attribute. If the attribute is not set, it defaults to 'sliding-container'.\n * @returns {string} The value of the 'trigger' attribute or the default value 'sliding-container' if not defined.\n */\n get trigger() {\n return this.getAttribute('trigger') ?? 'sliding-container';\n }\n\n /**\n * Sets the direction attribute for the element.\n * @param {string} value The direction value to be assigned. Possible values are typically 'ltr' (left-to-right), 'rtl' (right-to-left), or 'auto'.\n */\n set direction(value) {\n this.setAttribute('direction', value);\n }\n\n /**\n * Retrieves the direction attribute of the instance.\n * If the direction attribute is not set, it defaults to 'right'.\n * @returns {string} The value of the direction attribute or 'right' if not set.\n */\n get direction() {\n return this.getAttribute('direction') ?? 'right';\n }\n\n /**\n * Sets the value of the `remove-child-after-close` attribute.\n * This attribute determines if a child element should be removed after a close operation.\n * @param {boolean|string} value The value to set for the `remove-child-after-close` attribute. The value can be a boolean or a string representation of a boolean.\n */\n set removeChildAfterClose(value) {\n this.setAttribute('remove-child-after-close', value);\n }\n\n /**\n * Gets the value indicating whether the child element should be removed after closing.\n *\n * This property checks the presence of the 'remove-child-after-close' attribute on the element.\n * Returns `false` if the attribute does not exist.\n * @returns {boolean} True if the 'remove-child-after-close' attribute is present, otherwise false.\n */\n get removeChildAfterClose() {\n return this.hasAttribute('remove-child-after-close') ?? false;\n }\n\n /**\n * Sets the 'variant' attribute to the specified value.\n * @param {string} value The value to set for the 'variant' attribute.\n */\n set variant(value) {\n this.setAttribute('variant', value);\n }\n\n /**\n * Retrieves the value of the \"variant\" attribute. If the attribute is not set,\n * it returns the default value 'in-place'.\n * @returns {string} The variant value or the default value 'in-place'.\n */\n get variant() {\n return this.getAttribute('variant') ?? 'in-place';\n }\n\n /**\n * Retrieves the value of the 'screen-break-point' attribute.\n * @returns {string} The value of the 'screen-break-point' attribute.\n */\n get screenBreakPoint() {\n return this.getAttribute('screen-break-point');\n }\n\n /**\n * Sets the screen break point value to determine responsive behavior.\n * @param {string} value The value to set as the screen break point.\n */\n set screenBreakPoint(value) {\n this.setAttribute('screen-break-point', value);\n }\n\n /**\n * Sets the duration of the animation by updating the `animation-duration` attribute.\n * @param {string} value The duration value for the animation, specified in a format\n * such as seconds (e.g., \"2s\") or milliseconds (e.g., \"200ms\").\n */\n set animationDuration(value) {\n this.setAttribute('animation-duration', value);\n }\n\n /**\n * Gets the animation duration for an element.\n * It retrieves the value of the 'animation-duration' attribute if present; otherwise, it defaults to '500'.\n * @returns {string} The value of the animation duration, either from the attribute or the default '500'.\n */\n get animationDuration() {\n return this.getAttribute('animation-duration') ?? '500';\n }\n\n /**\n * Sets the easing function for the animation.\n * @param {string} value The easing function to use for the animation. This can be any valid CSS timing function such as \"ease\", \"linear\", \"ease-in\", \"ease-out\", etc.\n */\n set animationEasing(value) {\n this.setAttribute('animation-easing', value);\n }\n\n /**\n * Retrieves the easing function for the animation.\n * @returns {string} The value of the 'animation-easing' attribute if set, otherwise defaults to 'linear'.\n */\n get animationEasing() {\n return this.getAttribute('animation-easing') ?? 'linear';\n }\n\n /**\n * Determines if the element has an 'has-opacity' attribute.\n * @returns {boolean} True if the element has the 'has-opacity' attribute, otherwise false.\n */\n get hasOpacity() {\n return this.hasAttribute('has-opacity') ?? false;\n }\n\n /**\n * Sets the value of the 'add-to-height' attribute.\n * This attribute is used to modify or adjust the height dynamically.\n * @param {string} value The value to be assigned to the 'add-to-height' attribute.\n */\n set addToHeight(value) {\n this.setAttribute('add-to-height', value);\n }\n\n /**\n * Retrieves the value of the 'add-to-height' attribute from the element.\n * If the attribute is not set, it defaults to '0'.\n * @returns {string} The value of the 'add-to-height' attribute or '0' if the attribute is not present.\n */\n get addToHeight() {\n return this.getAttribute('add-to-height') ?? '0';\n }\n\n /**\n * Determines whether the current state is open.\n * @returns {boolean} True if the state is open, otherwise false.\n */\n get isOpen() {\n return this._isOpen;\n }\n\n className = 'SlidingContainer';\n\n /**\n * Returns the observed attributes for the component.\n * @returns {string[]}\n */\n static get observedAttributes() {\n return ['max-width', 'max-height', 'trigger', 'direction', 'variant', 'screen-break-point', 'remove-child-after-close', 'animation-duration', 'animation-easing', 'has-opacity'];\n }\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 * Executes before drawing the element.\n */\n beforeDraw() {\n this.animation?.cancel();\n this.nativeAnimation?.cancel();\n\n document.removeEventListener(this.trigger, this.triggerEvent);\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 wrapperDiv = document.createElement('div');\n wrapperDiv.classList.add('sliding-container-wrapper');\n\n let transparentDiv = document.createElement('div');\n transparentDiv.classList.add('sliding-container-transparent');\n\n if (this._isOpen) {\n transparentDiv.style.width = this.maxWidth;\n }\n\n let native = document.createElement('div');\n native.setAttribute('part', 'sliding-container');\n native.classList.add('native-sliding-container');\n native.style.width = 0;\n if (this.hasOpacity) {\n native.style.opacity = 0;\n }\n\n if (this._isOpen) {\n native.style.width = this.maxWidth;\n if (this.hasOpacity) {\n native.style.opacity = 1;\n }\n }\n\n if (this.direction === 'right') {\n native.style.right = 0;\n } else {\n native.style.left = 0;\n }\n\n let slot = document.createElement('slot');\n\n const nativeInner = document.createElement('div');\n nativeInner.classList.add('native-sliding-container-inner');\n nativeInner.style.width = this.maxWidth;\n\n // APPEND\n nativeInner.append(slot);\n nativeInner.append(this.htmlCloseButton());\n\n native.append(nativeInner);\n\n wrapperDiv.append(transparentDiv);\n wrapperDiv.append(native);\n\n fragment.append(wrapperDiv);\n\n this.transparentDiv = transparentDiv;\n this.wrapperDiv = wrapperDiv\n this.nativeElement = native;\n\n return fragment;\n }\n\n /**\n * Performs actions after the element is drawn on the screen.\n * Attaches an event listener to the document based on the specified trigger.\n * Sets the variant to \"over\" if the document width is smaller than the screen break point.\n * Calls the checkForVariant method with the current variant.\n */\n afterDraw() {\n document.addEventListener(this.trigger, this.triggerEvent);\n\n // if document width is on small screen set variant to over\n if (this.screenBreakPoint && window.innerWidth <= this.screenBreakPoint) {\n this.variant = 'over';\n }\n\n this.checkForVariant(this.variant);\n }\n\n /**\n * Creates and returns a styled close button element with an icon,\n * including an event listener to trigger the close method.\n * @returns {HTMLElement} The close button element configured with styles, an icon, and event listener.\n */\n htmlCloseButton() {\n let closeButton = document.createElement('wje-button');\n closeButton.setAttribute('part', 'close-button');\n closeButton.classList.add('close-button');\n\n let icon = document.createElement('wje-icon');\n icon.setAttribute('slot', 'icon-only');\n icon.setAttribute('name', 'x');\n\n closeButton.append(icon);\n\n event.addListener(closeButton, 'wje-button:click', null,(e) => {\n this.close();\n });\n\n return closeButton;\n }\n\n /**\n * Retrieves the parent element of the current element.\n * If the parent element is not found, it attempts to find the root host element.\n * @returns {Element|null} The parent element or the root host element if no parent exists. Returns null if neither is found.\n */\n getParentElement() {\n let parentElement = this.parentElement;\n\n if (!parentElement) {\n parentElement = this.getRootNode().host;\n }\n\n return parentElement;\n }\n\n /**\n * Adjusts the position and dimensions of the current element based on the specified variant.\n *\n * The method handles modifications to the element's positioning style, aligns it relative to its parent,\n * and manages alignment to its siblings based on the specified direction.\n * @param {string} variant The variant to determine how the element should be updated. For example, when set to 'over', specific adjustments to the position and size are performed.\n * @returns {void} No value is returned, the method modifies the element's style properties directly.\n */\n checkForVariant(variant) {\n if (variant === 'over') {\n this.style.position = 'fixed';\n let computentStyleOfParent = window.getComputedStyle(this.getParentElement());\n let parentElementBoundingbox = this.getParentElement().getBoundingClientRect();\n let heightOfParrentElement = parseFloat(computentStyleOfParent.height);\n\n let topOfParrentElement = parseFloat(computentStyleOfParent.top);\n\n this.style.height = heightOfParrentElement + +this.addToHeight + 'px';\n this.wrapperDiv.style.height = heightOfParrentElement + +this.addToHeight + 'px';\n this.style.top = topOfParrentElement + 'px';\n\n const leftSibling = this.previousElementSibling;\n const rightSibling = this.nextElementSibling;\n const leftSiblingBoundingbox = leftSibling?.getBoundingClientRect();\n const rightSiblingBoundingbox = rightSibling?.getBoundingClientRect();\n\n if (this.direction === 'right') {\n // attach to left sibling\n if (leftSiblingBoundingbox) {\n this.style.left = leftSiblingBoundingbox.left + leftSiblingBoundingbox.width + 'px';\n } else {\n this.style.left = parentElementBoundingbox.left + 'px';\n }\n } else {\n // attach to right sibling\n if (rightSiblingBoundingbox) {\n this.style.right = window.innerWidth - rightSiblingBoundingbox.left + 'px';\n } else {\n this.style.right =\n window.innerWidth - (parentElementBoundingbox.left + parentElementBoundingbox.width) + 'px';\n }\n }\n }\n }\n\n /**\n * Triggers the event based on the target element.\n * If the target element is different from the last caller, it refreshes the children by calling the `open` method.\n * If the target element is the same as the last caller, it toggles the state by calling the `toggle` method.\n * @param {Event} e The event object.\n */\n triggerEvent = async (e) => {\n if (this._lastCaller && this._lastCaller !== e.composedPath()[0]) {\n // same oppener event but different caller so just refresh inner content\n await this.open(e);\n } else {\n // came caller so toggle\n await this.toggle(e);\n }\n\n this._lastCaller = e.composedPath()[0];\n };\n\n /**\n * Executes before the element is opened.\n */\n beforeOpen(e) {\n // Hook for extending behavior before the dialog opens\n }\n\n /**\n * Callback function called after the element is opened.\n */\n afterOpen(e) {\n // Hook for extending behavior before the dialog opens\n }\n\n /**\n * Executes before closing the element.\n */\n beforeClose(e) {\n // Hook for extending behavior before the dialog opens\n }\n\n /**\n * Callback function that is called after the container is closed.\n */\n afterClose(e) {\n // Hook for extending behavior before the dialog opens\n }\n\n /**\n * Animates the transition of elements with specified options, toggling the visibility and/or dimensions\n * of the associated elements based on their current state.\n *\n * This method handles both forward and reverse animations for two elements (`transparentDiv` and `nativeElement`)\n * with optional opacity changes. It ensures smooth transitioning by canceling any previous animations on the provided\n * elements before initiating a new animation sequence.\n * @returns {Promise<void>} A promise that resolves when the transition animation is completed.\n */\n doAnimateTransition() {\n const options = {\n delay: 0,\n endDelay: 0,\n fill: 'forwards',\n duration: +this.animationDuration,\n iterationStart: 0,\n iterations: 1,\n direction: 'normal',\n easing: this.animationEasing,\n };\n\n if (this.animation && this.animation?.effect?.target !== this.transparentDiv) {\n this.animation.cancel();\n this.animation = null;\n }\n\n if (this.nativeAnimation && this.nativeAnimation?.effect?.target !== this.nativeElement) {\n this.nativeAnimation.cancel();\n this.nativeAnimation = null;\n }\n\n if (!this._isOpen) {\n if (this.animation && this.nativeAnimation) {\n this.animation.reverse();\n this.nativeAnimation.reverse();\n } else {\n this.animation = this.transparentDiv.animate(\n [\n {\n width: 0,\n },\n {\n width: this.maxWidth,\n },\n ],\n options\n );\n\n this.nativeAnimation = this.nativeElement.animate(\n [\n {\n ...(this.hasOpacity ? { opacity: 0 } : {}),\n width: 0,\n },\n {\n ...(this.hasOpacity ? { opacity: 1 } : {}),\n width: this.maxWidth,\n },\n ],\n options\n );\n }\n } else {\n if (this.animation && this.nativeAnimation) {\n this.animation.reverse();\n this.nativeAnimation.reverse();\n } else {\n this.animation = this.transparentDiv.animate(\n [\n {\n width: this.maxWidth,\n },\n {\n width: 0,\n },\n ],\n options\n );\n\n this.nativeAnimation = this.nativeElement.animate(\n [\n {\n ...(this.hasOpacity ? { opacity: 1 } : {}),\n width: this.maxWidth,\n },\n {\n ...(this.hasOpacity ? { opacity: 0 } : {}),\n width: 0,\n },\n ],\n options\n );\n }\n }\n\n return new Promise((resolve, reject) => {\n this.animation.onfinish = () => {\n this._isOpen = !this._isOpen;\n resolve();\n };\n });\n }\n\n /**\n * Opens the sliding container by performing necessary preparatory and transitional operations.\n * @param {Event} e The event that triggered the open operation.\n * @returns {Promise<void>} A promise that resolves when the open operation, including animations and subsequent handlers, is complete.\n */\n async open(e) {\n await Promise.resolve(this.beforeOpen(e)).then(async () => {\n if (!this._isOpen) {\n this.classList.add('open');\n\n event.dispatchCustomEvent(this, 'wje-sliding-container:beforeOpen')\n\n this.checkForVariant(this.variant);\n\n await this.doAnimateTransition();\n\n await Promise.resolve(this.afterOpen(e)).then(() => {\n event.dispatchCustomEvent(this, 'wje-sliding-container:open')\n });\n }\n });\n }\n\n /**\n * Closes the sliding container and performs associated operations such as animations and event dispatches.\n * @param {Event} e The event object associated with the close action.\n * @returns {Promise<void>} A promise that resolves when the closing operation, including animations and child element removal, is completed.\n */\n async close(e) {\n await Promise.resolve(this.beforeClose(e)).then(async () => {\n if (this._isOpen) {\n this.classList.remove('open');\n\n event.dispatchCustomEvent(this, 'wje-sliding-container:beforeClose');\n\n await this.doAnimateTransition();\n\n await Promise.resolve(this.afterClose(e)).then(() => {\n if (this.removeChildAfterClose) {\n this.childNodes.forEach((child) => {\n child.remove();\n });\n }\n\n event.dispatchCustomEvent(this, 'wje-sliding-container:afterClose');\n });\n }\n });\n }\n\n /**\n * Toggles the state between open and closed.\n * @param {Event} e The event object triggering the toggle.\n * @returns {Promise<void>} A promise that resolves once the toggle operation (open or close) is complete.\n */\n async toggle(e) {\n if (this._isOpen) {\n await this.close(event);\n } else {\n await this.open(event);\n }\n }\n\n /**\n * Cleans up resources associated with the component by disconnecting\n * the resize observer and setting it to null.\n * @returns {void} Does not return a value.\n */\n componentCleanup() {\n this._resizeObserver?.disconnect();\n this._resizeObserver = null;\n }\n}\n","import SlidingContainer from './sliding-container.element.js';\n\nexport default SlidingContainer;\n\nSlidingContainer.define('wje-sliding-container', SlidingContainer);\n"],"names":[],"mappings":";;;;;;AAkCe,MAAM,yBAAyB,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA,EAKpD,cAAc;AACV,UAAO;AAyNX,qCAAY;AA+MZ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wCAAe,OAAO,MAAM;AACxB,UAAI,KAAK,eAAe,KAAK,gBAAgB,EAAE,aAAY,EAAG,CAAC,GAAG;AAE9D,cAAM,KAAK,KAAK,CAAC;AAAA,MAC7B,OAAe;AAEH,cAAM,KAAK,OAAO,CAAC;AAAA,MAC/B;AAEQ,WAAK,cAAc,EAAE,aAAY,EAAG,CAAC;AAAA,IACxC;AAhbG,SAAK,UAAU;AACf,SAAK,cAAc;AAEnB,SAAK,kBAAkB,IAAI,eAAe,CAAC,YAAY;AACnD,eAAS,SAAS,SAAS;AACvB,YAAI,MAAM,gBAAgB;AACtB,cAAI,KAAK,gBAAgB,EAAG;AAE5B,cAAI,KAAK,oBAAoB,OAAO,cAAc,KAAK,kBAAkB;AACrE,gBAAI,KAAK,YAAY,QAAQ;AACzB,mBAAK,UAAU;AAAA,YAC3C,OAA+B;AACH,mBAAK,gBAAgB,KAAK,OAAO;AAAA,YAC7D;AAAA,UACA,OAA2B;AACH,gBAAI,KAAK,YAAY,YAAY;AAC7B,mBAAK,UAAU;AAAA,YAC3C,OAA+B;AACH,mBAAK,gBAAgB,KAAK,OAAO;A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