wj-elements 0.1.45 → 0.1.47
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/wje-copy-button.js +29 -23
- package/dist/wje-master.js +17 -17
- package/dist/wje-sliding-container.js +58 -29
- package/package.json +1 -1
package/dist/wje-copy-button.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
var
|
|
2
|
-
var m = (o, e, t) => e in o ?
|
|
1
|
+
var p = Object.defineProperty;
|
|
2
|
+
var m = (o, e, t) => e in o ? p(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
|
|
3
3
|
var r = (o, e, t) => (m(o, typeof e != "symbol" ? e + "" : e, t), t);
|
|
4
|
-
import f, { event as c } from "./wje-element.js";
|
|
5
|
-
import
|
|
6
|
-
function
|
|
4
|
+
import f, { WjElementUtils as b, event as c } from "./wje-element.js";
|
|
5
|
+
import y from "./wje-input.js";
|
|
6
|
+
function g(o) {
|
|
7
7
|
const e = document.createElement("pre");
|
|
8
8
|
return e.style.width = "1px", e.style.height = "1px", e.style.position = "fixed", e.style.top = "5px", e.textContent = o, e;
|
|
9
9
|
}
|
|
10
|
-
function
|
|
10
|
+
function h(o) {
|
|
11
11
|
if ("clipboard" in navigator)
|
|
12
12
|
return navigator.clipboard.writeText(o.textContent || "");
|
|
13
13
|
const e = getSelection();
|
|
@@ -17,16 +17,16 @@ function p(o) {
|
|
|
17
17
|
const t = document.createRange();
|
|
18
18
|
return t.selectNodeContents(o), e.addRange(t), e.removeAllRanges(), Promise.resolve();
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function u(o) {
|
|
21
21
|
if ("clipboard" in navigator)
|
|
22
22
|
return navigator.clipboard.writeText(o);
|
|
23
23
|
const e = document.body;
|
|
24
24
|
if (!e)
|
|
25
25
|
return Promise.reject(new Error());
|
|
26
|
-
const t =
|
|
27
|
-
return e.appendChild(t),
|
|
26
|
+
const t = g(o);
|
|
27
|
+
return e.appendChild(t), h(t), e.removeChild(t), Promise.resolve();
|
|
28
28
|
}
|
|
29
|
-
const
|
|
29
|
+
const w = ":host{cursor:pointer;padding:.5rem}";
|
|
30
30
|
class d extends f {
|
|
31
31
|
/**
|
|
32
32
|
* Constructor for the CopyButton class.
|
|
@@ -69,11 +69,12 @@ class d extends f {
|
|
|
69
69
|
});
|
|
70
70
|
/**
|
|
71
71
|
* Handles the copied event.
|
|
72
|
+
* You can override this method to customize the behavior when the text is copied.
|
|
72
73
|
* @param {Event} e - The event object.
|
|
73
74
|
*/
|
|
74
75
|
r(this, "copied", (t) => {
|
|
75
|
-
this.icon.setAttribute("color", "success"), this.icon.setAttribute("name", "check"), this.tooltip.setAttribute("content", this.labelSuccess || "Copied"), setTimeout(() => {
|
|
76
|
-
this.icon.removeAttribute("color"), this.icon.setAttribute("name", "clipboard"), this.tooltip.setAttribute("content", this.label || "Copy");
|
|
76
|
+
this.hasOwnProperty("icon") && (this.icon.setAttribute("color", "success"), this.icon.setAttribute("name", "check")), this.tooltip.setAttribute("content", this.labelSuccess || "Copied"), setTimeout(() => {
|
|
77
|
+
console.log("TIMEOUT", this.hasOwnProperty("icon")), this.hasOwnProperty("icon") && (this.icon.removeAttribute("color"), this.icon.setAttribute("name", "clipboard")), this.tooltip.setAttribute("content", this.label || "Copy");
|
|
77
78
|
}, this.timeout);
|
|
78
79
|
});
|
|
79
80
|
this.timeout = 1e3;
|
|
@@ -97,7 +98,7 @@ class d extends f {
|
|
|
97
98
|
* @returns {string} The CSS styles.
|
|
98
99
|
*/
|
|
99
100
|
static get cssStyleSheet() {
|
|
100
|
-
return
|
|
101
|
+
return w;
|
|
101
102
|
}
|
|
102
103
|
/**
|
|
103
104
|
* Getter for the observedAttributes property.
|
|
@@ -119,33 +120,38 @@ class d extends f {
|
|
|
119
120
|
* @param {Object} params - The parameters to use.
|
|
120
121
|
* @returns {DocumentFragment} The created document fragment.
|
|
121
122
|
*/
|
|
122
|
-
draw(t, i,
|
|
123
|
+
draw(t, i, l) {
|
|
123
124
|
let s = document.createDocumentFragment(), n = document.createElement("wje-tooltip");
|
|
124
|
-
n.setAttribute("offset", "5"), n.setAttribute("content", this.label || "Copy")
|
|
125
|
-
|
|
126
|
-
|
|
125
|
+
if (n.setAttribute("offset", "5"), n.setAttribute("content", this.label || "Copy"), b.hasSlot(this)) {
|
|
126
|
+
let a = document.createElement("slot");
|
|
127
|
+
n.appendChild(a);
|
|
128
|
+
} else {
|
|
129
|
+
let a = document.createElement("wje-icon");
|
|
130
|
+
a.setAttribute("name", "clipboard"), n.appendChild(a), this.icon = a;
|
|
131
|
+
}
|
|
132
|
+
return s.appendChild(n), this.tooltip = n, s;
|
|
127
133
|
}
|
|
128
134
|
/**
|
|
129
135
|
* Sets up the event listeners after the CopyButton is drawn.
|
|
130
136
|
*/
|
|
131
137
|
afterDraw() {
|
|
132
|
-
c.addListener(this, "click", null, this.clicked), c.addListener(this, "focus", null, this.focused), c.addListener(this, "blur", null, this.blurred), c.addListener(this, "wje
|
|
138
|
+
c.addListener(this, "click", null, this.clicked), c.addListener(this, "focus", null, this.focused), c.addListener(this, "blur", null, this.blurred), c.addListener(this, "wje-copy-button:click", null, this.copied);
|
|
133
139
|
}
|
|
134
140
|
/**
|
|
135
141
|
* Copies the specified text or node.
|
|
136
142
|
* @param {HTMLElement} button - The button element.
|
|
137
143
|
*/
|
|
138
144
|
async copy(t) {
|
|
139
|
-
const i = this.getAttribute("for"),
|
|
145
|
+
const i = this.getAttribute("for"), l = this.getAttribute("value");
|
|
140
146
|
if (t.getAttribute("aria-disabled") !== "true") {
|
|
141
|
-
if (
|
|
142
|
-
await l
|
|
147
|
+
if (l)
|
|
148
|
+
await u(l), c.dispatchCustomEvent(this, "wje-copy-button:click");
|
|
143
149
|
else if (i) {
|
|
144
150
|
const s = "getRootNode" in Element.prototype ? t.getRootNode() : t.ownerDocument;
|
|
145
151
|
if (!(s instanceof Document || "ShadowRoot" in window && s instanceof ShadowRoot))
|
|
146
152
|
return;
|
|
147
153
|
const n = s.getElementById(i);
|
|
148
|
-
n && (await this.copyTarget(n), c.dispatchCustomEvent(this, "wje
|
|
154
|
+
n && (await this.copyTarget(n), c.dispatchCustomEvent(this, "wje-copy-button:click"));
|
|
149
155
|
}
|
|
150
156
|
}
|
|
151
157
|
}
|
|
@@ -155,7 +161,7 @@ class d extends f {
|
|
|
155
161
|
* @returns {Promise} A promise that resolves when the content is copied.
|
|
156
162
|
*/
|
|
157
163
|
copyTarget(t) {
|
|
158
|
-
return t instanceof HTMLInputElement || t instanceof HTMLTextAreaElement || t instanceof
|
|
164
|
+
return t instanceof HTMLInputElement || t instanceof HTMLTextAreaElement || t instanceof y ? u(t.value) : t instanceof HTMLAnchorElement && t.hasAttribute("href") ? u(t.href) : h(t);
|
|
159
165
|
}
|
|
160
166
|
}
|
|
161
167
|
d.define("wje-copy-button", d);
|
package/dist/wje-master.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var y = Object.defineProperty;
|
|
2
|
-
var C = (o,
|
|
3
|
-
var f = (o,
|
|
2
|
+
var C = (o, l, e) => l in o ? y(o, l, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[l] = e;
|
|
3
|
+
var f = (o, l, e) => (C(o, typeof l != "symbol" ? l + "" : l, e), e);
|
|
4
4
|
import g from "./wje-element.js";
|
|
5
5
|
import { event as q } from "./wje-element.js";
|
|
6
6
|
import { defaultStoreActions as P, store as U } from "./wje-store.js";
|
|
@@ -155,24 +155,24 @@ class w extends g {
|
|
|
155
155
|
const t = Array.from(this.children);
|
|
156
156
|
this.steps = t.map((c, m) => {
|
|
157
157
|
if (c.nodeName === "WJE-STEP") {
|
|
158
|
-
const
|
|
159
|
-
|
|
158
|
+
const n = document.createElement("div");
|
|
159
|
+
n.className = "step-header";
|
|
160
160
|
const u = document.createElement("wje-badge");
|
|
161
161
|
u.className = "step-badge", u.setAttribute("label", (m + 1).toString()), u.innerHTML = "12";
|
|
162
162
|
const x = document.createElement("span");
|
|
163
|
-
if (x.innerText = c.getAttribute("label") || `Step ${m + 1}`, m === this.currentStep && (
|
|
163
|
+
if (x.innerText = c.getAttribute("label") || `Step ${m + 1}`, m === this.currentStep && (n.classList.add("active"), u.setAttribute("color", "primary")), c.hasAttribute("disabled") || (n.addEventListener("click", () => this.gotoStep(m)), n.classList.add("pointer")), n.appendChild(u), n.appendChild(x), s.appendChild(n), m < t.length - 1) {
|
|
164
164
|
const h = document.createElement("wje-icon");
|
|
165
165
|
h.setAttribute("name", "chevron-right"), h.classList.add("arrow-icon"), h.setAttribute("size", "small"), s.appendChild(h);
|
|
166
166
|
}
|
|
167
167
|
return c.classList.add("step"), m !== this.currentStep && (c.style.display = "none"), c;
|
|
168
168
|
}
|
|
169
169
|
}), this.steps.forEach((c) => a.appendChild(c));
|
|
170
|
-
const
|
|
171
|
-
|
|
170
|
+
const i = document.createElement("div");
|
|
171
|
+
i.className = "nav-buttons";
|
|
172
172
|
const d = document.createElement("wje-button");
|
|
173
173
|
d.setAttribute("label", "Previous"), d.disabled = this.currentStep === 0, d.addEventListener("click", () => this.navigate(-1)), d.innerHTML = "Prev";
|
|
174
174
|
const p = document.createElement("wje-button");
|
|
175
|
-
return p.setAttribute("label", "Next"), p.disabled = this.currentStep === this.steps.length - 1, p.addEventListener("click", () => this.navigate(1)), p.innerHTML = "Next",
|
|
175
|
+
return p.setAttribute("label", "Next"), p.disabled = this.currentStep === this.steps.length - 1, p.addEventListener("click", () => this.navigate(1)), p.innerHTML = "Next", i.appendChild(d), i.appendChild(p), r.appendChild(s), r.appendChild(a), r.appendChild(i), e.appendChild(r), e;
|
|
176
176
|
}
|
|
177
177
|
navigate(e) {
|
|
178
178
|
this.gotoStep(this.currentStep + e);
|
|
@@ -241,14 +241,14 @@ class b extends g {
|
|
|
241
241
|
let a = document.createDocumentFragment();
|
|
242
242
|
const t = document.createElement("div");
|
|
243
243
|
t.setAttribute("part", "native"), t.classList.add("native-timeline");
|
|
244
|
-
const
|
|
245
|
-
|
|
244
|
+
const i = document.createElement("div");
|
|
245
|
+
i.setAttribute("part", "vertical-line"), i.classList.add("vertical-line");
|
|
246
246
|
const d = document.createElement("slot");
|
|
247
|
-
return t.appendChild(
|
|
247
|
+
return t.appendChild(i), t.appendChild(d), a.appendChild(t), a;
|
|
248
248
|
}
|
|
249
249
|
}
|
|
250
250
|
b.define("wje-timeline", b);
|
|
251
|
-
function T(o,
|
|
251
|
+
function T(o, l) {
|
|
252
252
|
let e;
|
|
253
253
|
if (typeof o == "string")
|
|
254
254
|
e = new Date(o);
|
|
@@ -271,7 +271,7 @@ function T(o, n) {
|
|
|
271
271
|
MMM: e.toLocaleString("en-US", { month: "short" })
|
|
272
272
|
// Short month name
|
|
273
273
|
};
|
|
274
|
-
return
|
|
274
|
+
return l.replace(/yyyy|MM|dd|HH|mm|ss|MMMM|MMM/g, (s) => r[s]);
|
|
275
275
|
}
|
|
276
276
|
const k = ":host{--wje-card-content-padding: var(--wje-spacing-medium);margin-bottom:.5rem;display:block}.native-timeline-item>wje-icon{color:var(--wje-color-contrast-5)!important}.timeline-items{display:flex;flex-direction:column}.native-timeline-item{display:flex;position:relative;padding:var(--wje-spacing-medium) var(--wje-spacing-medium) var(--wje-spacing-medium) var(--wje-spacing-large);gap:var(--wje-spacing-medium);border-width:1px;border-style:solid;border-color:transparent;border-radius:var(--wje-border-radius-large)}:host .native-timeline-item:hover{background-color:var(--wje-color-contrast-1);border-color:var(--wje-color-contrast-3)}:host([active]) .native-timeline-item{background-color:var(--wje-color-primary-1);border-color:var(--wje-color-primary-3)}:host([active]) .native-timeline-item:hover{background-color:var(--wje-color-primary-2)}.icon-container{position:absolute;display:flex;width:var(--wje-size-small);height:var(--wje-size-small);padding:var(--wje-spacing-2x-small);border-radius:var(--wje-border-radius-circle);opacity:0}.content-container{height:fit-content;gap:var(--wje-spacing-small)}.event{margin:0;font-size:var(--wje-font-size-large);font-weight:var(--wje-font-weight-bold);line-height:var(--wje-line-height-dense);letter-spacing:var(--wje-spacing-4x-small)}.additional-content{font-size:var(--wje-font-size-medium);margin-top:1rem}wje-status{position:relative;z-index:1}wje-relative-time{display:block;margin-bottom:var(--wje-spacing-2x-small)}";
|
|
277
277
|
class S extends g {
|
|
@@ -310,16 +310,16 @@ class S extends g {
|
|
|
310
310
|
draw(e, r, s) {
|
|
311
311
|
let a = document.createDocumentFragment(), t = document.createElement("div");
|
|
312
312
|
t.setAttribute("part", "native"), t.classList.add("native-timeline-item");
|
|
313
|
-
let
|
|
314
|
-
|
|
313
|
+
let i = document.createElement("div");
|
|
314
|
+
i.classList.add("content-container");
|
|
315
315
|
let d = document.createElement("wje-tooltip");
|
|
316
316
|
d.setAttribute("text", this.getAttribute("tooltip") || ""), d.setAttribute("position", "top"), d.setAttribute("content", T(this.datetime, "dd.MM.yyyy HH:mm"));
|
|
317
317
|
let p = document.createElement("wje-relative-time");
|
|
318
318
|
p.setAttribute("date", this.datetime || ""), p.setAttribute("format", this.getAttribute("format") || ""), d.appendChild(p);
|
|
319
319
|
let c = document.createElement("h3");
|
|
320
320
|
c.classList.add("event"), c.textContent = this.getAttribute("event") || "";
|
|
321
|
-
let m = document.createElement("slot"),
|
|
322
|
-
return
|
|
321
|
+
let m = document.createElement("slot"), n = document.createElement("wje-icon");
|
|
322
|
+
return n.setAttribute("name", "circle-dot"), n.setAttribute("filled", ""), n.setAttribute("part", "default-icon"), this.querySelector('[slot="status"]') && (n = document.createElement("slot"), n.setAttribute("name", "status")), i.appendChild(d), i.appendChild(c), i.appendChild(m), t.appendChild(n), t.appendChild(i), a.appendChild(t), a;
|
|
323
323
|
}
|
|
324
324
|
}
|
|
325
325
|
S.define("wje-timeline-item", S);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import
|
|
5
|
-
const
|
|
6
|
-
class
|
|
1
|
+
var p = Object.defineProperty;
|
|
2
|
+
var u = (r, n, t) => n in r ? p(r, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[n] = t;
|
|
3
|
+
var h = (r, n, t) => (u(r, typeof n != "symbol" ? n + "" : n, t), t);
|
|
4
|
+
import f from "./wje-element.js";
|
|
5
|
+
const v = ":host{display:block;overflow:hidden;display:table}";
|
|
6
|
+
class l extends f {
|
|
7
7
|
/**
|
|
8
8
|
* Creates an instance of SlidingContainer.
|
|
9
9
|
*
|
|
@@ -11,14 +11,14 @@ class h extends p {
|
|
|
11
11
|
*/
|
|
12
12
|
constructor() {
|
|
13
13
|
super();
|
|
14
|
-
|
|
14
|
+
h(this, "className", "SlidingContainer");
|
|
15
15
|
/**
|
|
16
16
|
* Triggers the event based on the target element.
|
|
17
17
|
* If the target element is different from the last caller, it refreshes the children by calling the `open` method.
|
|
18
18
|
* If the target element is the same as the last caller, it toggles the state by calling the `toggle` method.
|
|
19
19
|
* @param {Event} e - The event object.
|
|
20
20
|
*/
|
|
21
|
-
|
|
21
|
+
h(this, "triggerEvent", (t) => {
|
|
22
22
|
this._lastCaller && this._lastCaller !== t.target ? this.open() : this.toggle(), this._lastCaller = t.target;
|
|
23
23
|
});
|
|
24
24
|
this._isOpen = !1, this._lastCaller = null;
|
|
@@ -65,8 +65,23 @@ class h extends p {
|
|
|
65
65
|
set screenBreakPoint(t) {
|
|
66
66
|
this.setAttribute("screen-break-point", t);
|
|
67
67
|
}
|
|
68
|
+
get animationDuration() {
|
|
69
|
+
return this.getAttribute("animation-duration") ?? "500";
|
|
70
|
+
}
|
|
71
|
+
set animationDuration(t) {
|
|
72
|
+
this.setAttribute("animation-duration", t);
|
|
73
|
+
}
|
|
74
|
+
get animationEasing() {
|
|
75
|
+
return this.getAttribute("animation-easing") ?? "linear";
|
|
76
|
+
}
|
|
77
|
+
set animationEasing(t) {
|
|
78
|
+
this.setAttribute("animation-easing", t);
|
|
79
|
+
}
|
|
80
|
+
get hasOpacity() {
|
|
81
|
+
return this.hasAttribute("has-opacity") ?? !1;
|
|
82
|
+
}
|
|
68
83
|
static get observedAttributes() {
|
|
69
|
-
return ["max-width", "max-height", "trigger", "direction", "variant", "screen-break-point", "remove-child-after-close"];
|
|
84
|
+
return ["max-width", "max-height", "trigger", "direction", "variant", "screen-break-point", "remove-child-after-close", "animation-duration", "animation-easing", "has-opacity"];
|
|
70
85
|
}
|
|
71
86
|
/**
|
|
72
87
|
* Returns the CSS styles for the component.
|
|
@@ -75,7 +90,7 @@ class h extends p {
|
|
|
75
90
|
* @returns {CSSStyleSheet}
|
|
76
91
|
*/
|
|
77
92
|
static get cssStyleSheet() {
|
|
78
|
-
return
|
|
93
|
+
return v;
|
|
79
94
|
}
|
|
80
95
|
/**
|
|
81
96
|
* Sets up the attributes for the component.
|
|
@@ -91,13 +106,13 @@ class h extends p {
|
|
|
91
106
|
* @param {Object} params - The parameters for drawing.
|
|
92
107
|
* @returns {DocumentFragment}
|
|
93
108
|
*/
|
|
94
|
-
draw(t, i,
|
|
95
|
-
let
|
|
109
|
+
draw(t, i, a) {
|
|
110
|
+
let s = document.createDocumentFragment();
|
|
96
111
|
this.style.position = "relative", this.style.height = "100%", this.transparentDiv = document.createElement("div"), this.transparentDiv.classList.add("sliding-container-transparent");
|
|
97
112
|
let e = document.createElement("div");
|
|
98
|
-
e.style.position = "absolute", e.style.width = this.maxWidth, e.style.height = "100%", e.classList.add("native-sliding-container"), e.setAttribute("part", "sliding-container"), this.direction === "right" ? e.style.right = 0 : e.style.left = 0;
|
|
113
|
+
e.style.position = "absolute", e.style.width = this.maxWidth, this.hasOpacity && (e.style.opacity = 0), e.style.height = "100%", e.classList.add("native-sliding-container"), e.setAttribute("part", "sliding-container"), this.direction === "right" ? e.style.right = 0 : e.style.left = 0;
|
|
99
114
|
let o = document.createElement("slot");
|
|
100
|
-
return e.appendChild(this.getCloseButton()), e.appendChild(o),
|
|
115
|
+
return e.appendChild(this.getCloseButton()), e.appendChild(o), s.appendChild(this.transparentDiv), s.appendChild(e), this.nativeElement = e, s;
|
|
101
116
|
}
|
|
102
117
|
/**
|
|
103
118
|
* Creates and returns a close button element.
|
|
@@ -127,18 +142,23 @@ class h extends p {
|
|
|
127
142
|
async afterDraw() {
|
|
128
143
|
document.addEventListener(this.trigger, this.triggerEvent), this.screenBreakPoint && window.innerWidth < this.screenBreakPoint && (this.variant = "over"), this.checkForVariant(this.variant);
|
|
129
144
|
}
|
|
145
|
+
getParentElement() {
|
|
146
|
+
let t = this.parentElement;
|
|
147
|
+
return t || (t = this.getRootNode().host), t;
|
|
148
|
+
}
|
|
130
149
|
/**
|
|
131
150
|
* Checks for a specific variant and applies corresponding styles.
|
|
132
151
|
*
|
|
133
152
|
* @param {string} variant - The variant to check for.
|
|
134
153
|
*/
|
|
135
154
|
checkForVariant(t) {
|
|
155
|
+
var i, a;
|
|
136
156
|
if (t === "over") {
|
|
137
157
|
this.style.position = "fixed";
|
|
138
|
-
let
|
|
139
|
-
this.style.height =
|
|
140
|
-
let
|
|
141
|
-
|
|
158
|
+
let s = window.getComputedStyle(this.getParentElement()), e = this.getParentElement().getBoundingClientRect(), o = parseFloat(s.height), d = parseFloat(s.width), m = parseFloat(s.top);
|
|
159
|
+
this.style.height = o + "px", this.style.top = m + "px";
|
|
160
|
+
let c = this.getParentElement().firstElementChild === this || ((i = this.getParentElement().shadowRoot) == null ? void 0 : i.firstElementChild) === this, g = this.getParentElement().lastElementChild === this || ((a = this.getParentElement().shadowRoot) == null ? void 0 : a.lastElementChild) === this;
|
|
161
|
+
c && (this.direction === "right" ? this.style.left = e.left + "px" : this.style.right = window.innerWidth - (e.left + e.width) + d + "px"), g && (this.style.right = window.innerWidth - (e.left + e.width) + "px");
|
|
142
162
|
}
|
|
143
163
|
}
|
|
144
164
|
/**
|
|
@@ -170,29 +190,38 @@ class h extends p {
|
|
|
170
190
|
delay: 0,
|
|
171
191
|
endDelay: 0,
|
|
172
192
|
fill: "both",
|
|
173
|
-
duration:
|
|
193
|
+
duration: +this.animationDuration,
|
|
174
194
|
iterationStart: 0,
|
|
175
195
|
iterations: 1,
|
|
176
196
|
direction: "normal",
|
|
177
|
-
easing:
|
|
197
|
+
easing: this.animationEasing
|
|
178
198
|
};
|
|
179
199
|
if (this._isOpen)
|
|
180
|
-
this.animation.reverse();
|
|
200
|
+
this.animation.reverse(), this.hasOpacity && this.nativeAnimation.reverse();
|
|
181
201
|
else {
|
|
182
202
|
if (this.animation) {
|
|
183
|
-
this.animation.reverse();
|
|
203
|
+
this.animation.reverse(), this.hasOpacity && this.nativeAnimation.reverse();
|
|
184
204
|
return;
|
|
185
205
|
}
|
|
186
206
|
this.animation = this.transparentDiv.animate([
|
|
187
207
|
{
|
|
188
|
-
width: 0
|
|
208
|
+
width: 0,
|
|
209
|
+
opacity: 0
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
width: this.maxWidth,
|
|
213
|
+
opacity: +this.containerOpacity
|
|
214
|
+
}
|
|
215
|
+
], t), this.hasOpacity && (this.nativeAnimation = this.nativeElement.animate([
|
|
216
|
+
{
|
|
217
|
+
opacity: 0
|
|
189
218
|
},
|
|
190
219
|
{
|
|
191
|
-
|
|
220
|
+
opacity: 1
|
|
192
221
|
}
|
|
193
|
-
], t);
|
|
222
|
+
], t));
|
|
194
223
|
}
|
|
195
|
-
return new Promise((i,
|
|
224
|
+
return new Promise((i, a) => {
|
|
196
225
|
this.animation.onfinish = () => {
|
|
197
226
|
i();
|
|
198
227
|
};
|
|
@@ -238,8 +267,8 @@ class h extends p {
|
|
|
238
267
|
this._isOpen ? await this.close() : await this.open();
|
|
239
268
|
}
|
|
240
269
|
}
|
|
241
|
-
customElements.define("wje-sliding-container",
|
|
242
|
-
|
|
270
|
+
customElements.define("wje-sliding-container", l);
|
|
271
|
+
l.define("wje-sliding-container", l);
|
|
243
272
|
export {
|
|
244
|
-
|
|
273
|
+
l as default
|
|
245
274
|
};
|
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.47",
|
|
5
5
|
"homepage": "https://github.com/lencys/wj-elements",
|
|
6
6
|
"author": "Lukáš Ondrejček <lukas.ondrejcek@gmail.com>",
|
|
7
7
|
"license": "MIT",
|