wj-elements 0.0.4 → 0.0.6
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/animation-2266bd6e.js +103 -0
- package/dist/localize-762a9f0f.js +43 -0
- package/dist/wj-animation.js +6 -0
- package/dist/wj-aside.js +8 -10
- package/dist/wj-avatar.js +19 -21
- package/dist/wj-badge.js +16 -16
- package/dist/wj-breadcrumb.js +7 -11
- package/dist/wj-breadcrumbs.js +5 -7
- package/dist/wj-button-group.js +11 -13
- package/dist/wj-button.js +36 -39
- package/dist/wj-card-content.js +11 -13
- package/dist/wj-card-controls.js +6 -8
- package/dist/wj-card-header.js +11 -13
- package/dist/wj-card-subtitle.js +9 -11
- package/dist/wj-card-title.js +7 -9
- package/dist/wj-card.js +13 -15
- package/dist/wj-carousel-item.js +32 -0
- package/dist/wj-carousel.js +178 -0
- package/dist/wj-checkbox.js +11 -11
- package/dist/wj-chip.js +17 -17
- package/dist/wj-col.js +11 -12
- package/dist/wj-color-picker.js +192 -179
- package/dist/wj-container.js +7 -9
- package/dist/wj-copy-button.js +1 -3
- package/dist/wj-dialog.js +20 -22
- package/dist/wj-divider.js +7 -9
- package/dist/wj-dropdown.js +10 -14
- package/dist/wj-element.js +9 -9
- package/dist/wj-file-upload-item.js +63 -0
- package/dist/wj-file-upload.js +221 -0
- package/dist/wj-footer.js +9 -11
- package/dist/wj-form.js +6 -8
- package/dist/wj-format-digital.js +51 -0
- package/dist/wj-grid.js +9 -10
- package/dist/wj-header.js +9 -11
- package/dist/wj-icon-picker.js +78 -58
- package/dist/wj-icon.js +45 -48
- package/dist/wj-img-comparer.js +12 -14
- package/dist/wj-img.js +14 -16
- package/dist/wj-infinite-scroll.js +27 -22
- package/dist/wj-input-file.js +47 -0
- package/dist/wj-input.js +30 -23
- package/dist/wj-item.js +1 -3
- package/dist/wj-label.js +10 -10
- package/dist/wj-list.js +1 -3
- package/dist/wj-main.js +1 -3
- package/dist/wj-masonry.js +71518 -0
- package/dist/wj-master.js +287 -253
- package/dist/wj-menu-button.js +10 -12
- package/dist/wj-menu-item.js +49 -46
- package/dist/wj-menu-label.js +2 -2
- package/dist/wj-menu.js +8 -10
- package/dist/wj-popup.js +89 -88
- package/dist/wj-progress-bar.js +14 -16
- package/dist/wj-radio-group.js +5 -7
- package/dist/wj-radio.js +13 -15
- package/dist/wj-rate.js +127 -0
- package/dist/wj-relative-time.js +50 -0
- package/dist/wj-router-link.js +11 -13
- package/dist/wj-row.js +11 -12
- package/dist/wj-slider.js +6 -6
- package/dist/wj-split-view.js +1 -3
- package/dist/wj-textarea.js +17 -19
- package/dist/wj-thumbnail.js +12 -14
- package/dist/wj-toast.js +1 -1
- package/dist/wj-toggle.js +9 -9
- package/dist/wj-toolbar.js +13 -15
- package/dist/wj-tooltip.js +16 -18
- package/dist/wj-visually-hidden.js +6 -8
- package/package.json +1 -1
- package/dist/style.css +0 -3
package/dist/wj-container.js
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
var
|
|
2
|
-
var a = (e, t, n) => t in e ?
|
|
3
|
-
var
|
|
1
|
+
var s = Object.defineProperty;
|
|
2
|
+
var a = (e, t, n) => t in e ? s(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var o = (e, t, n) => (a(e, typeof t != "symbol" ? t + "" : t, n), n);
|
|
4
4
|
import c from "./wj-element.js";
|
|
5
5
|
import "./wj-store.js";
|
|
6
|
-
const d =
|
|
7
|
-
* direction.scss
|
|
8
|
-
*/:host{--wj-container-indent: 0;display:flex;flex-direction:row;flex:1;flex-basis:auto;box-sizing:border-box;min-width:0}:host([vertical]){flex-direction:column}@media (min-width: 768px){:host([indent]){margin-left:var(--wj-container-indent)}}
|
|
6
|
+
const d = `:host{--wj-container-indent: 0;display:flex;flex-direction:row;flex:1;flex-basis:auto;box-sizing:border-box;min-width:0}:host([vertical]){flex-direction:column}@media (min-width: 768px){:host([indent]){margin-left:var(--wj-container-indent)}}
|
|
9
7
|
`;
|
|
10
8
|
class l extends c {
|
|
11
9
|
constructor() {
|
|
12
10
|
super();
|
|
13
|
-
|
|
11
|
+
o(this, "className", "Container");
|
|
14
12
|
}
|
|
15
13
|
static get cssStyleSheet() {
|
|
16
14
|
return d;
|
|
@@ -24,8 +22,8 @@ class l extends c {
|
|
|
24
22
|
draw(n, m, u) {
|
|
25
23
|
let i = document.createDocumentFragment();
|
|
26
24
|
this.indent && this.style.setProperty("--wj-container-indent", this.indent);
|
|
27
|
-
let
|
|
28
|
-
return i.appendChild(
|
|
25
|
+
let r = document.createElement("slot");
|
|
26
|
+
return i.appendChild(r), i;
|
|
29
27
|
}
|
|
30
28
|
}
|
|
31
29
|
customElements.get("wj-container") || window.customElements.define("wj-container", l);
|
package/dist/wj-copy-button.js
CHANGED
|
@@ -27,9 +27,7 @@ function u(o) {
|
|
|
27
27
|
const t = f(o);
|
|
28
28
|
return e.appendChild(t), l(t), e.removeChild(t), Promise.resolve();
|
|
29
29
|
}
|
|
30
|
-
const b =
|
|
31
|
-
* direction.scss
|
|
32
|
-
*/:host{cursor:pointer;padding:.5rem}
|
|
30
|
+
const b = `:host{cursor:pointer;padding:.5rem}
|
|
33
31
|
`;
|
|
34
32
|
class y extends h {
|
|
35
33
|
constructor() {
|
package/dist/wj-dialog.js
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
var
|
|
2
|
-
var b = (e,
|
|
3
|
-
var
|
|
4
|
-
import u, { WjElementUtils as
|
|
1
|
+
var c = Object.defineProperty;
|
|
2
|
+
var b = (e, a, t) => a in e ? c(e, a, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[a] = t;
|
|
3
|
+
var h = (e, a, t) => (b(e, typeof a != "symbol" ? a + "" : a, t), t);
|
|
4
|
+
import u, { WjElementUtils as f } from "./wj-element.js";
|
|
5
5
|
import "./wj-store.js";
|
|
6
|
-
const
|
|
7
|
-
* direction.scss
|
|
8
|
-
*/:host{--wj-dialog-width: 600px;--wj-dialog-height: 600px;--wj-dialog-padding: 1rem;--wj-dialog-border-radius: 8px;--wj-dialog-border-width: 1px;--wj-dialog-border-style: solid;--wj-dialog-border-color: rgba(33, 33, 33, .17);--wj-dialog-margin-top: auto;--wj-dialog-margin-start: auto;--wj-dialog-margin-end: auto;--wj-dialog-margin-bottom: auto}:host .close{margin-left:auto}:host .modal-content{border-radius:3px;box-shadow:none}:host .dialog-header{position:relative;border-bottom:0;padding-inline:var(--wj-dialog-padding);padding-top:var(--wj-dialog-padding);display:flex;align-items:center}:host .dialog-header span{-webkit-transition:opacity .3s ease;transition:opacity .3s ease;font-family:Montserrat,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;font-size:10.5px;text-transform:uppercase;display:inline-block;letter-spacing:.06em;font-weight:500;margin:0;padding:0;line-height:normal;overflow:hidden;text-overflow:ellipsis;filter:alpha(opacity=40)}:host .dialog-content{box-shadow:none;padding-inline:var(--wj-dialog-padding);white-space:normal;z-index:1}:host .dialog-footer{display:flex;justify-content:end;border-top:none;box-shadow:none;margin-top:0;padding-inline:var(--wj-dialog-padding);padding-top:0;padding-bottom:var(--wj-dialog-padding)}dialog::backdrop{--wj-backdrop: rgb(0, 0, 0);--wj-backdrop-opacity: .3;opacity:var(--wj-backdrop-opacity);background-color:var(--wj-backdrop)}:host(.separator) .dialog-header:after{content:"";height:1px;background:rgba(0,0,0,.08);left:var(--wj-dialog-padding);right:var(--wj-dialog-padding);position:absolute;bottom:0}:host dialog{box-sizing:border-box;transition:all .2s!important;width:var(--wj-dialog-width);height:var(--wj-dialog-height);box-shadow:0 .5rem 1rem #00000026;border-radius:var(--wj-dialog-border-radius);border-width:var(--wj-dialog-border-width);border-style:var(--wj-dialog-border-style);border-color:var(--wj-dialog-border-color);margin-top:var(--wj-dialog-margin-top);margin-bottom:var(--wj-dialog-margin-bottom);margin-inline:var(--wj-dialog-margin-start) var(--wj-dialog-margin-end);padding:0}:host(.stick-up){--wj-dialog-width: 300px !important;--wj-dialog-height: fit-content;--wj-dialog-border-radius: 0 0 8px 8px;--wj-dialog-border-width: 0 1px 1px 1px;--wj-dialog-margin-top: 0}:host(.slide-up){--wj-dialog-width: 300px !important;--wj-dialog-height: fit-content;--wj-dialog-border-radius: 8px;--wj-dialog-border-width: 1px}:host(.fill-in){--wj-dialog-width: 100%;--wj-dialog-height: 100%;--wj-dialog-border-radius: 0 0 0 0 !important;--wj-dialog-border-width: 0;--wj-dialog-margin-top: 0;--wj-dialog-margin-start: 0;--wj-dialog-margin-end: 0;--wj-dialog-margin-bottom: 0}:host(.fill-in) dialog{min-width:var(--wj-dialog-width);min-height:var(--wj-dialog-height)}:host(.slide-left){--wj-dialog-width: 300px !important;--wj-dialog-height: 100% !important;--wj-dialog-border-radius: 0;--wj-dialog-border-width: 0 1px 0 0;--wj-dialog-margin-top: 0;--wj-dialog-margin-start: 0;--wj-dialog-margin-end: auto;--wj-dialog-margin-bottom: 0}:host(.slide-left) dialog{min-height:var(--wj-dialog-height)}:host(.slide-right){--wj-dialog-width: 300px !important;--wj-dialog-height: 100% !important;--wj-dialog-border-radius: 0;--wj-dialog-border-width: 0 0 0 1px;--wj-dialog-margin-top: 0;--wj-dialog-margin-start: auto;--wj-dialog-margin-end: 0;--wj-dialog-margin-bottom: 0}:host(.slide-right) dialog{min-height:var(--wj-dialog-height)}:host(.small){--wj-dialog-width: 300px !important}:host(.medium){--wj-dialog-width: 500px !important}:host(.large){--wj-dialog-width: 600px !important}:host(.ex-large){--wj-dialog-width: 900px !important}
|
|
6
|
+
const v = `:host{--wj-dialog-width: 600px;--wj-dialog-height: 600px;--wj-dialog-border-radius: var(--wj-border-radius-large);--wj-dialog-border-width: var(--wj-border-width);--wj-dialog-border-style: var(--wj-border-style);--wj-dialog-border-color: var(--wj-border-color);--wj-dialog-margin-top: auto;--wj-dialog-margin-start: auto;--wj-dialog-margin-end: auto;--wj-dialog-margin-bottom: auto}:host .close{margin-left:auto}:host .modal-content{border-radius:3px;box-shadow:none}:host .dialog-header{position:relative;border-bottom:0;padding-inline:var(--wj-dialog-padding, 1rem);padding-top:var(--wj-dialog-padding, 1rem);padding-bottom:var(--wj-dialog-padding, 0);display:flex;align-items:center}:host .dialog-header span{font-family:var(--wj-font-family-secondary);font-size:10.5px;text-transform:uppercase;display:inline-block;letter-spacing:.06em;font-weight:500;margin:0;padding:0;line-height:normal;overflow:hidden;text-overflow:ellipsis;filter:alpha(opacity=40)}:host .dialog-content{box-shadow:none;padding-inline:var(--wj-dialog-padding, 1rem);white-space:normal;z-index:1}:host .dialog-footer{display:flex;justify-content:end;border-top:none;box-shadow:none;margin-top:0;padding-inline:var(--wj-dialog-padding-inline, 1rem);padding-top:var(--wj-dialog-padding-top, 1rem);padding-bottom:var(--wj-dialog-padding-bottom, 1rem)}dialog::backdrop{opacity:var(--wj-backdrop-opacity);background-color:var(--wj-backdrop)}:host(.separator) .dialog-header:after{content:"";height:1px;background:rgba(0,0,0,.08);left:var(--wj-dialog-padding, 1rem);right:var(--wj-dialog-padding, 1rem);position:absolute;bottom:0}:host dialog{box-sizing:border-box;transition:all .2s!important;width:var(--wj-dialog-width);height:var(--wj-dialog-height);box-shadow:0 .5rem 1rem #00000026;border-radius:var(--wj-dialog-border-radius);border-width:var(--wj-dialog-border-width);border-style:var(--wj-dialog-border-style);border-color:var(--wj-dialog-border-color);margin-top:var(--wj-dialog-margin-top);margin-bottom:var(--wj-dialog-margin-bottom);margin-inline:var(--wj-dialog-margin-start) var(--wj-dialog-margin-end);padding:0}:host(.stick-up){--wj-dialog-width: 300px !important;--wj-dialog-height: fit-content;--wj-dialog-border-radius: 0 0 8px 8px;--wj-dialog-border-width: 0 1px 1px 1px;--wj-dialog-margin-top: 0;--wj-dialog-translate-from: translateY(-110%);--wj-dialog-template-to: translateX(0)}:host(.slide-up){--wj-dialog-width: 300px !important;--wj-dialog-height: fit-content;--wj-dialog-border-radius: 8px;--wj-dialog-border-width: 1px;--wj-dialog-opacity-from: 0;--wj-dialog-translate-from: scale(.9);--wj-dialog-translate-to: scale(1)}:host(.fill-in){--wj-dialog-width: 100%;--wj-dialog-height: 100%;--wj-dialog-border-radius: 0 0 0 0 !important;--wj-dialog-border-width: 0;--wj-dialog-margin-top: 0;--wj-dialog-margin-start: 0;--wj-dialog-margin-end: 0;--wj-dialog-margin-bottom: 0;--wj-dialog-translate-from: scale(.95);--wj-dialog-translate-to: scale(1)}:host(.fill-in) dialog{min-width:var(--wj-dialog-width);min-height:var(--wj-dialog-height)}:host(.slide-left){--wj-dialog-width: 300px !important;--wj-dialog-height: 100% !important;--wj-dialog-border-radius: 0;--wj-dialog-border-width: 0 1px 0 0;--wj-dialog-margin-top: 0;--wj-dialog-margin-start: 0;--wj-dialog-margin-end: auto;--wj-dialog-margin-bottom: 0}:host(.slide-left) dialog{min-height:var(--wj-dialog-height);--wj-dialog-translate-from: translateX(-110%);--wj-dialog-template-to: translateX(0)}:host(.slide-right){--wj-dialog-width: 300px !important;--wj-dialog-height: 100% !important;--wj-dialog-border-radius: 0;--wj-dialog-border-width: 0 0 0 1px;--wj-dialog-margin-top: 0;--wj-dialog-margin-start: auto;--wj-dialog-margin-end: 0;--wj-dialog-margin-bottom: 0}:host(.slide-right) dialog{min-height:var(--wj-dialog-height);--wj-dialog-translate-from: translateX(110%);--wj-dialog-template-to: translateX(0)}:host(.small){--wj-dialog-width: 300px !important}:host(.medium){--wj-dialog-width: 500px !important}:host(.large){--wj-dialog-width: 600px !important}:host(.ex-large){--wj-dialog-width: 900px !important}dialog[open]{animation:show .5s ease normal}@keyframes show{0%{opacity:var(--wj-dialog-opacity-from, 1);transform:var(--wj-dialog-translate-from)}to{opacity:1;transform:var(--wj-dialog-translate-to)}}
|
|
9
7
|
`;
|
|
10
|
-
class
|
|
8
|
+
class x extends u {
|
|
11
9
|
constructor() {
|
|
12
10
|
super();
|
|
13
|
-
|
|
11
|
+
h(this, "className", "Dialog");
|
|
14
12
|
}
|
|
15
13
|
set placement(t) {
|
|
16
14
|
this.setAttribute("placement", t);
|
|
@@ -19,39 +17,39 @@ class v extends u {
|
|
|
19
17
|
return this.getAttribute("placement") || "slide-up";
|
|
20
18
|
}
|
|
21
19
|
static get cssStyleSheet() {
|
|
22
|
-
return
|
|
20
|
+
return v;
|
|
23
21
|
}
|
|
24
22
|
static get observedAttributes() {
|
|
25
23
|
return [];
|
|
26
24
|
}
|
|
27
25
|
setupAttributes() {
|
|
28
|
-
this.isShadowRoot = "open",
|
|
26
|
+
this.isShadowRoot = "open", f.setAttributesToElement(this, {
|
|
29
27
|
test: "test"
|
|
30
28
|
});
|
|
31
29
|
}
|
|
32
30
|
beforeDraw(t, s, r) {
|
|
33
31
|
}
|
|
34
32
|
draw(t, s, r) {
|
|
35
|
-
let
|
|
33
|
+
let m = document.createDocumentFragment();
|
|
36
34
|
this.classList.add("modal", "fade", this.placement, r.size);
|
|
37
|
-
let
|
|
35
|
+
let j = document.createElement("slot"), o = document.createElement("dialog");
|
|
38
36
|
o.classList.add("modal-dialog");
|
|
39
37
|
let g = document.createElement("wj-icon");
|
|
40
38
|
g.setAttribute("name", "x"), g.setAttribute("slot", "icon-only");
|
|
41
|
-
let
|
|
42
|
-
|
|
39
|
+
let i = document.createElement("wj-button");
|
|
40
|
+
i.setAttribute("fill", "link"), i.setAttribute("size", "small"), i.classList.add("close"), i.addEventListener("click", () => {
|
|
43
41
|
o.close();
|
|
44
|
-
}),
|
|
42
|
+
}), i.appendChild(g);
|
|
45
43
|
let d = document.createElement("div");
|
|
46
|
-
d.setAttribute("part", "header"), d.classList.add("dialog-header"), d.innerHTML = `<span>${this.title}</span>`, d.appendChild(
|
|
44
|
+
d.setAttribute("part", "header"), d.classList.add("dialog-header"), d.innerHTML = `<span>${this.title}</span>`, d.appendChild(i);
|
|
47
45
|
let w = document.createElement("slot");
|
|
48
46
|
w.setAttribute("name", "header"), d.appendChild(w);
|
|
49
47
|
let n = document.createElement("div");
|
|
50
|
-
n.setAttribute("part", "body"), n.classList.add("dialog-content"), n.appendChild(
|
|
48
|
+
n.setAttribute("part", "body"), n.classList.add("dialog-content"), n.appendChild(j);
|
|
51
49
|
let l = document.createElement("div");
|
|
52
50
|
l.setAttribute("part", "footer"), l.classList.add("dialog-footer"), l.innerHTML = "";
|
|
53
|
-
let
|
|
54
|
-
return
|
|
51
|
+
let p = document.createElement("slot");
|
|
52
|
+
return p.setAttribute("name", "footer"), l.appendChild(p), o.appendChild(d), o.appendChild(n), o.appendChild(l), m.appendChild(o), this.dialog = o, m;
|
|
55
53
|
}
|
|
56
54
|
afterDraw(t, s, r) {
|
|
57
55
|
r.trigger && document.addEventListener(r.trigger, () => {
|
|
@@ -59,7 +57,7 @@ class v extends u {
|
|
|
59
57
|
});
|
|
60
58
|
}
|
|
61
59
|
}
|
|
62
|
-
customElements.get("wj-dialog") || window.customElements.define("wj-dialog",
|
|
60
|
+
customElements.get("wj-dialog") || window.customElements.define("wj-dialog", x);
|
|
63
61
|
export {
|
|
64
|
-
|
|
62
|
+
x as Dialog
|
|
65
63
|
};
|
package/dist/wj-divider.js
CHANGED
|
@@ -1,19 +1,17 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var o = (r, e, t) => (
|
|
4
|
-
import
|
|
1
|
+
var a = Object.defineProperty;
|
|
2
|
+
var n = (r, e, t) => e in r ? a(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
3
|
+
var o = (r, e, t) => (n(r, typeof e != "symbol" ? e + "" : e, t), t);
|
|
4
|
+
import l from "./wj-element.js";
|
|
5
5
|
import "./wj-store.js";
|
|
6
|
-
const
|
|
7
|
-
* direction.scss
|
|
8
|
-
*/:host{--wj-border-size: 1px;--wj-divider-border-color: var(--wj-border-color);--wj-divider-border-width: var(--wj-border-size, 1px);--wj-divider-spacing: 0}:host(:not([vertical])){display:block;border-top:solid var(--wj-divider-border-width) var(--wj-divider-border-color);margin:var(--wj-divider-spacing) 0}:host([vertical]){display:inline-block;height:100%;border-left:solid var(--wj-divider-border-width) var(--wj-divider-border-color);margin:0 var(--wj-divider-spacing)}
|
|
6
|
+
const c = `:host{--wj-border-size: 1px;--wj-divider-border-color: var(--wj-border-color);--wj-divider-border-width: var(--wj-border-size, 1px);--wj-divider-spacing: 0}:host(:not([vertical])){display:block;border-top:solid var(--wj-divider-border-width) var(--wj-divider-border-color);margin:var(--wj-divider-spacing) 0}:host([vertical]){display:inline-block;height:100%;border-left:solid var(--wj-divider-border-width) var(--wj-divider-border-color);margin:0 var(--wj-divider-spacing)}
|
|
9
7
|
`;
|
|
10
|
-
class v extends
|
|
8
|
+
class v extends l {
|
|
11
9
|
constructor() {
|
|
12
10
|
super();
|
|
13
11
|
o(this, "className", "Divider");
|
|
14
12
|
}
|
|
15
13
|
static get cssStyleSheet() {
|
|
16
|
-
return
|
|
14
|
+
return c;
|
|
17
15
|
}
|
|
18
16
|
static get observedAttributes() {
|
|
19
17
|
return [];
|
package/dist/wj-dropdown.js
CHANGED
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
var a = Object.defineProperty;
|
|
2
|
-
var c = (
|
|
3
|
-
var o = (
|
|
2
|
+
var c = (r, t, e) => t in r ? a(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
|
|
3
|
+
var o = (r, t, e) => (c(r, typeof t != "symbol" ? t + "" : t, e), e);
|
|
4
4
|
import l from "./wj-element.js";
|
|
5
5
|
import "./wj-store.js";
|
|
6
|
-
const d = `/*!
|
|
7
|
-
* direction.scss
|
|
8
|
-
*/
|
|
9
|
-
`;
|
|
10
6
|
class p extends l {
|
|
11
7
|
constructor() {
|
|
12
8
|
super();
|
|
@@ -19,7 +15,7 @@ class p extends l {
|
|
|
19
15
|
return this.getAttribute("trigger") || "click";
|
|
20
16
|
}
|
|
21
17
|
static get cssStyleSheet() {
|
|
22
|
-
return
|
|
18
|
+
return styles;
|
|
23
19
|
}
|
|
24
20
|
static get observedAttributes() {
|
|
25
21
|
return ["active"];
|
|
@@ -27,14 +23,14 @@ class p extends l {
|
|
|
27
23
|
setupAttributes() {
|
|
28
24
|
this.isShadowRoot = "open";
|
|
29
25
|
}
|
|
30
|
-
draw(e,
|
|
31
|
-
let
|
|
26
|
+
draw(e, d, u) {
|
|
27
|
+
let n = document.createDocumentFragment();
|
|
32
28
|
this.classList.add("wj-placement", "wj-" + this.placement || "wj-start");
|
|
33
|
-
let
|
|
34
|
-
|
|
35
|
-
let
|
|
36
|
-
return
|
|
37
|
-
<slot></slot>`, this.trigger === "click" &&
|
|
29
|
+
let i = document.createElement("div");
|
|
30
|
+
i.setAttribute("part", "native"), i.classList.add("native-dropdown");
|
|
31
|
+
let s = document.createElement("wj-popup");
|
|
32
|
+
return s.setAttribute("placement", this.placement), s.setAttribute("offset", this.offset), s.setAttribute("manual", ""), s.innerHTML = `<slot name="trigger" slot="anchor"></slot>
|
|
33
|
+
<slot></slot>`, this.trigger === "click" && s.setAttribute("manual", ""), i.appendChild(s), n.appendChild(i), n;
|
|
38
34
|
}
|
|
39
35
|
}
|
|
40
36
|
customElements.get("wj-dropdown") || window.customElements.define("wj-dropdown", p);
|
package/dist/wj-element.js
CHANGED
|
@@ -4,13 +4,13 @@ var a = (o, e, t) => (E(o, typeof e != "symbol" ? e + "" : e, t), t), v = (o, e,
|
|
|
4
4
|
if (!e.has(o))
|
|
5
5
|
throw TypeError("Cannot " + t);
|
|
6
6
|
};
|
|
7
|
-
var
|
|
7
|
+
var b = (o, e, t) => {
|
|
8
8
|
if (e.has(o))
|
|
9
9
|
throw TypeError("Cannot add the same private member more than once");
|
|
10
10
|
e instanceof WeakSet ? e.add(o) : e.set(o, t);
|
|
11
11
|
};
|
|
12
12
|
var f = (o, e, t) => (v(o, e, "access private method"), t);
|
|
13
|
-
import { store as
|
|
13
|
+
import { store as w, defaultStoreActions as P } from "./wj-store.js";
|
|
14
14
|
class j {
|
|
15
15
|
constructor(e = {}) {
|
|
16
16
|
a(this, "findByKey", (e, t, s) => {
|
|
@@ -171,7 +171,7 @@ class u {
|
|
|
171
171
|
var d, l, m;
|
|
172
172
|
class T {
|
|
173
173
|
constructor() {
|
|
174
|
-
|
|
174
|
+
b(this, l);
|
|
175
175
|
this.customEventStorage = [], d = this;
|
|
176
176
|
}
|
|
177
177
|
dispatchCustomEvent(e, t, s) {
|
|
@@ -235,8 +235,8 @@ l = new WeakSet(), m = function(e) {
|
|
|
235
235
|
});
|
|
236
236
|
};
|
|
237
237
|
let k = new T();
|
|
238
|
-
const
|
|
239
|
-
|
|
238
|
+
const y = document.createElement("template");
|
|
239
|
+
y.innerHTML = "";
|
|
240
240
|
class S extends HTMLElement {
|
|
241
241
|
constructor(t) {
|
|
242
242
|
super();
|
|
@@ -248,8 +248,8 @@ class S extends HTMLElement {
|
|
|
248
248
|
const i = new CSSStyleSheet();
|
|
249
249
|
i.replaceSync(this.constructor.cssStyleSheet), this.context.adoptedStyleSheets = [i];
|
|
250
250
|
});
|
|
251
|
-
this.template = t ||
|
|
252
|
-
store:
|
|
251
|
+
this.template = t || y, this._attributes = {}, this.isAttached = !1, this.service = new j({
|
|
252
|
+
store: w
|
|
253
253
|
}), this.rendering = !1, this.runtimeTimeout = null, this.count = 0, this.functionStack = [], this.scheludedRefresh = !1;
|
|
254
254
|
}
|
|
255
255
|
get permission() {
|
|
@@ -277,7 +277,7 @@ class S extends HTMLElement {
|
|
|
277
277
|
return this.isShadowRoot ? this.shadowRoot : this;
|
|
278
278
|
}
|
|
279
279
|
get store() {
|
|
280
|
-
return
|
|
280
|
+
return w;
|
|
281
281
|
}
|
|
282
282
|
// addAction,
|
|
283
283
|
// deleteAction,
|
|
@@ -364,7 +364,7 @@ class S extends HTMLElement {
|
|
|
364
364
|
return null;
|
|
365
365
|
}
|
|
366
366
|
display(t = !1, s) {
|
|
367
|
-
this.isProcessingFlow(s) || (t && this.isShadowRoot && ([...this.context.children].forEach(this.context.removeChild.bind(this.context)), this.isAttached = !1), this.isAttached
|
|
367
|
+
this.isProcessingFlow(s) || (t && this.isShadowRoot && ([...this.context.children].forEach(this.context.removeChild.bind(this.context)), this.isAttached = !1), this.isAttached, this.context.append(this.template.content.cloneNode(!0)), this.isPermissionCheck || this.isShow ? c.isPermissionFulfilled.bind(this)(this.permission) ? this._resolveRender(s) : this.remove() : this._resolveRender(s));
|
|
368
368
|
}
|
|
369
369
|
render(t) {
|
|
370
370
|
if (this.drawingStatus = "DRAWING", this.isProcessingFlow(t))
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
var h = Object.defineProperty;
|
|
2
|
+
var g = (a, t, e) => t in a ? h(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e;
|
|
3
|
+
var c = (a, t, e) => (g(a, typeof t != "symbol" ? t + "" : t, e), e);
|
|
4
|
+
import w from "./wj-element.js";
|
|
5
|
+
import { L as b } from "./localize-762a9f0f.js";
|
|
6
|
+
import "./wj-store.js";
|
|
7
|
+
const f = `:host{width:100%}.native-file-upload-item{display:grid;grid-template-columns:auto 1fr 1fr;grid-template-rows:auto auto auto;gap:0 .5rem;grid-template-areas:"image name actions" "image size actions" "progress progress progress";padding:.5rem;border:1px solid var(--wj-border-color);border-radius:var(--wj-border-radius-medium)}.image{grid-area:image;align-items:center;display:flex}::slotted([slot=img]){--wj-img-border-radius: var(--wj-border-radius-medium) !important}.name{grid-area:name;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-weight:700}.size{grid-area:size;display:flex}.actions{grid-area:actions;display:flex;align-items:center;justify-content:flex-end}.file-progress{grid-area:progress}wj-icon{margin-right:.25rem}wj-img{margin-right:.25rem}.file-info>span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}wj-slider{flex-basis:100%;margin-top:.5rem}::part(slider)::-webkit-slider-thumb{visibility:hidden}::part(slider)::-moz-range-thumb{visibility:hidden}::part(slider)::-ms-thumb{visibility:hidden}wj-img{width:50px;height:50px;display:flex;align-items:center;padding:.25rem;border:1px solid var(--wj-border-color);border-radius:var(--wj-border-radius-medium)}
|
|
8
|
+
`;
|
|
9
|
+
class v extends w {
|
|
10
|
+
constructor() {
|
|
11
|
+
super();
|
|
12
|
+
c(this, "className", "FileUploadItem");
|
|
13
|
+
c(this, "onDelete", () => {
|
|
14
|
+
this.remove();
|
|
15
|
+
});
|
|
16
|
+
this.localizer = new b(this);
|
|
17
|
+
}
|
|
18
|
+
static get cssStyleSheet() {
|
|
19
|
+
return f;
|
|
20
|
+
}
|
|
21
|
+
static get observedAttributes() {
|
|
22
|
+
return ["uploaded"];
|
|
23
|
+
}
|
|
24
|
+
attributeChangedCallback(e, i, m) {
|
|
25
|
+
if (e === "uploaded" && this.drawingStatus === "AFTER") {
|
|
26
|
+
this.uploadedEl.setAttribute("value", this.uploaded);
|
|
27
|
+
let r = +this.uploaded / +this.size * 100 || 0;
|
|
28
|
+
this.sliderEl.setAttribute("value", Math.round(r, 0));
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
setupAttributes() {
|
|
32
|
+
this.isShadowRoot = "open";
|
|
33
|
+
}
|
|
34
|
+
draw() {
|
|
35
|
+
let e = document.createDocumentFragment(), i = document.createElement("div");
|
|
36
|
+
i.classList.add("native-file-upload-item");
|
|
37
|
+
let m = document.createElement("slot");
|
|
38
|
+
m.setAttribute("name", "img");
|
|
39
|
+
let r = document.createElement("div");
|
|
40
|
+
r.classList.add("image");
|
|
41
|
+
let p = document.createElement("span");
|
|
42
|
+
p.classList.add("name"), p.innerText = this.name;
|
|
43
|
+
let d = document.createElement("slot");
|
|
44
|
+
d.classList.add("actions"), d.setAttribute("name", "action");
|
|
45
|
+
let l = document.createElement("wj-button");
|
|
46
|
+
l.setAttribute("fill", "link"), l.setAttribute("size", "small"), l.innerHTML = '<wj-icon name="x" size="small"></wj-icon>';
|
|
47
|
+
let o = document.createElement("span");
|
|
48
|
+
o.classList.add("size");
|
|
49
|
+
let n = document.createElement("wj-format-digital");
|
|
50
|
+
n.setAttribute("value", this.uploaded || 0), n.innerHTML = `<span slot="start">${this.localizer.translate("wj.file.upload.uploaded")}</span>`;
|
|
51
|
+
let u = document.createElement("wj-format-digital");
|
|
52
|
+
u.setAttribute("value", this.size || 0), u.innerHTML = `<span slot="start"> ${this.localizer.translate("wj.file.upload.from")} </span>`;
|
|
53
|
+
let s = document.createElement("wj-slider");
|
|
54
|
+
return s.classList.add("file-progress"), s.setAttribute("id", "id-" + this.lastModified), s.setAttribute("value", this.progress || 0), s.setAttribute("color", "success"), r.appendChild(m), d.appendChild(l), o.appendChild(n), o.appendChild(u), i.appendChild(r), i.appendChild(p), i.appendChild(o), i.appendChild(d), i.appendChild(s), e.appendChild(i), this.button = l, this.uploadedEl = n, this.sliderEl = s, e;
|
|
55
|
+
}
|
|
56
|
+
afterDraw() {
|
|
57
|
+
this.button.addEventListener("wj:button-click", this.onDelete);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
customElements.get("wj-file-upload-item") || window.customElements.define("wj-file-upload-item", v);
|
|
61
|
+
export {
|
|
62
|
+
v as FileUploadItem
|
|
63
|
+
};
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
var y = Object.defineProperty;
|
|
2
|
+
var w = (r, s, e) => s in r ? y(r, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[s] = e;
|
|
3
|
+
var h = (r, s, e) => (w(r, typeof s != "symbol" ? s + "" : s, e), e);
|
|
4
|
+
import v from "./wj-element.js";
|
|
5
|
+
import { L as x } from "./localize-762a9f0f.js";
|
|
6
|
+
import "./wj-store.js";
|
|
7
|
+
function A() {
|
|
8
|
+
return [
|
|
9
|
+
{
|
|
10
|
+
type: ["jpg", "jpeg", "png", "gif", "bpm", "tiff", "svg"],
|
|
11
|
+
name: "photo"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
type: ["zip", "rar", "cab", "jar", "tar", "gzip", "uue", "bz2", "scorm", "war"],
|
|
15
|
+
name: "file-type-zip"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
type: ["mov", "mp4", "avi", "flv"],
|
|
19
|
+
name: "video"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
type: ["m4a", "mp3", "wav"],
|
|
23
|
+
name: "audio"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
type: ["html", "html"],
|
|
27
|
+
name: "file-type-html"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
type: ["css"],
|
|
31
|
+
name: "code"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
type: ["txt"],
|
|
35
|
+
name: "file-type-txt"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
type: ["doc", "docx"],
|
|
39
|
+
name: "file-type-doc"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
type: ["xls", "xlsx"],
|
|
43
|
+
name: "file-type-xls"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
type: ["pdf"],
|
|
47
|
+
name: "file-type-pdf"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
type: ["ppt", "pptx", "odp"],
|
|
51
|
+
name: "file-type-ppt"
|
|
52
|
+
}
|
|
53
|
+
];
|
|
54
|
+
}
|
|
55
|
+
function E(r) {
|
|
56
|
+
let s;
|
|
57
|
+
return r.toLowerCase() !== "folder" ? A().forEach((e) => {
|
|
58
|
+
e.type.includes(r.toLowerCase()) && (s = e.name);
|
|
59
|
+
}) : s = "folder", s;
|
|
60
|
+
}
|
|
61
|
+
function z(r, s) {
|
|
62
|
+
console.log("FILE", r, s);
|
|
63
|
+
const e = r.type.split("/")[0];
|
|
64
|
+
console.log("BASE MIME TYPE", e);
|
|
65
|
+
let t = Array.isArray(s) ? s : s.split(",");
|
|
66
|
+
if (console.log("ACCEPTED TYPES", t), t.length === 0)
|
|
67
|
+
throw new Error("acceptedFileTypes is empty");
|
|
68
|
+
for (let i of t)
|
|
69
|
+
if (i.includes(e + "/*") || i.includes(r.type) || i.includes(r.type.split("/")[1]))
|
|
70
|
+
return !0;
|
|
71
|
+
return !1;
|
|
72
|
+
}
|
|
73
|
+
function L(r, s, e) {
|
|
74
|
+
console.log("UPLOAD FILE:", r, s, e);
|
|
75
|
+
let t = 0;
|
|
76
|
+
const i = new Array(Math.ceil(r.size / s)).fill(0), l = (a, p) => {
|
|
77
|
+
const n = new FileReader(), u = a / s, o = r.slice(a, p);
|
|
78
|
+
n.onload = (c) => {
|
|
79
|
+
const d = new XMLHttpRequest();
|
|
80
|
+
d.open("POST", "/upload", !0), d.setRequestHeader("Content-Range", `${a}-${p}/${r.size}`), d.upload.onprogress = (m) => {
|
|
81
|
+
if (m.lengthComputable) {
|
|
82
|
+
const g = m.loaded / m.total * 100;
|
|
83
|
+
i[u] = g, i.reduce((f, b) => f + b, 0) / i.length;
|
|
84
|
+
}
|
|
85
|
+
}, d.onload = () => {
|
|
86
|
+
d.status == 200 || d.status == 201 ? (i[u] = 100, a += s, a < r.size ? (e.setAttribute("uploaded", a), l(a, Math.min(a + s, r.size))) : (e.setAttribute("uploaded", a), console.log("Upload complete"))) : console.error("Error during upload: ", d.statusText);
|
|
87
|
+
}, d.send(c.target.result);
|
|
88
|
+
}, n.readAsArrayBuffer(o);
|
|
89
|
+
};
|
|
90
|
+
l(t, Math.min(t + s, r.size));
|
|
91
|
+
}
|
|
92
|
+
const j = `:host{width:100%}.native-file-upload{width:100%}.file-label{background:var(--wj-color-contrast-0);border:1px dashed var(--wj-border-color);border-radius:var(--wj-border-radius-medium);align-items:center;justify-content:center;display:flex;padding:1rem;margin-bottom:.5rem;flex-direction:column}.file-preview{display:grid;grid-template-columns:auto 1fr 1fr;grid-template-rows:auto auto auto;gap:0 0;grid-template-areas:"image name name" "image size size" "progress progress progress"}.file-image{grid-area:image;align-items:center;display:flex}.file-name{grid-area:name;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.file-size{grid-area:size;display:flex}.file-progress{grid-area:progress}wj-icon{margin-right:.25rem}wj-img{margin-right:.25rem}.file-info>span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}wj-slider{flex-basis:100%;margin-top:.5rem}::part(slider)::-webkit-slider-thumb{visibility:hidden}::part(slider)::-moz-range-thumb{visibility:hidden}::part(slider)::-ms-thumb{visibility:hidden}wj-img{width:50px;height:50px;display:flex;align-items:center;padding:.25rem;border:1px solid var(--wj-border-color);border-radius:var(--wj-border-radius-medium)}
|
|
93
|
+
`;
|
|
94
|
+
class F extends v {
|
|
95
|
+
constructor() {
|
|
96
|
+
super();
|
|
97
|
+
h(this, "className", "FileUpload");
|
|
98
|
+
h(this, "handleDrop", (e) => {
|
|
99
|
+
const t = e.dataTransfer.files;
|
|
100
|
+
this.resetFormState(), this.uploadFiles(t);
|
|
101
|
+
});
|
|
102
|
+
h(this, "handleInputChange", (e) => {
|
|
103
|
+
this.resetFormState();
|
|
104
|
+
try {
|
|
105
|
+
this.handleSubmit(e);
|
|
106
|
+
} catch (t) {
|
|
107
|
+
console.log("NOT VALID 1", t);
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
this.localizer = new x(this);
|
|
112
|
+
}
|
|
113
|
+
set acceptedTypes(e) {
|
|
114
|
+
this.setAttribute("accepted-types", e);
|
|
115
|
+
}
|
|
116
|
+
get acceptedTypes() {
|
|
117
|
+
const e = this.getAttribute("accepted-types");
|
|
118
|
+
return this.hasAttribute("accepted-types") ? e : "";
|
|
119
|
+
}
|
|
120
|
+
set chunkSize(e) {
|
|
121
|
+
this.setAttribute("chunk-size", e);
|
|
122
|
+
}
|
|
123
|
+
get chunkSize() {
|
|
124
|
+
const e = this.getAttribute("chunk-size");
|
|
125
|
+
return this.hasAttribute("chunk-size") ? e : 1024 * 1024;
|
|
126
|
+
}
|
|
127
|
+
set maxFileSize(e) {
|
|
128
|
+
this.setAttribute("max-file-size", e);
|
|
129
|
+
}
|
|
130
|
+
get maxFileSize() {
|
|
131
|
+
const e = this.getAttribute("max-file-size");
|
|
132
|
+
return this.hasAttribute("max-file-size") ? e * 1024 * 1024 : 1024 * 1024;
|
|
133
|
+
}
|
|
134
|
+
static get cssStyleSheet() {
|
|
135
|
+
return j;
|
|
136
|
+
}
|
|
137
|
+
static get observedAttributes() {
|
|
138
|
+
return [];
|
|
139
|
+
}
|
|
140
|
+
setupAttributes() {
|
|
141
|
+
this.isShadowRoot = "open";
|
|
142
|
+
}
|
|
143
|
+
draw(e, t, i) {
|
|
144
|
+
let l = document.createDocumentFragment(), a = document.createElement("div");
|
|
145
|
+
a.classList.add("native-file-upload"), a.setAttribute("part", "native");
|
|
146
|
+
let p = document.createElement("div");
|
|
147
|
+
p.classList.add("file-label");
|
|
148
|
+
let n = document.createElement("wj-button");
|
|
149
|
+
n.innerText = this.label || this.localizer.translate("wj.file.upload.button");
|
|
150
|
+
let u = document.createElement("slot"), o = document.createElement("input");
|
|
151
|
+
o.setAttribute("type", "file"), o.setAttribute("multiple", ""), o.setAttribute("style", "display:none;"), n.appendChild(u), n.appendChild(o), this.fileInput = o;
|
|
152
|
+
let c = document.createElement("div");
|
|
153
|
+
return c.classList.add("file-list"), p.appendChild(u), p.appendChild(n), a.appendChild(o), a.appendChild(p), a.appendChild(c), l.appendChild(a), this.native = a, this.fileList = c, this.button = n, l;
|
|
154
|
+
}
|
|
155
|
+
afterDraw() {
|
|
156
|
+
this.button.addEventListener("click", () => {
|
|
157
|
+
this.fileInput.click();
|
|
158
|
+
}), this.fileInput.addEventListener("change", this.handleInputChange), this.native.addEventListener("drop", this.handleDrop);
|
|
159
|
+
let e = 0;
|
|
160
|
+
this.native.addEventListener("dragenter", (t) => {
|
|
161
|
+
t.preventDefault(), e === 0 && this.native.classList.add("highlight"), e += 1;
|
|
162
|
+
}), this.native.addEventListener("dragover", (t) => {
|
|
163
|
+
t.preventDefault(), e === 0 && (e = 1);
|
|
164
|
+
}), this.native.addEventListener("dragleave", (t) => {
|
|
165
|
+
t.preventDefault(), e -= 1, e <= 0 && (e = 0, this.native.classList.remove("highlight"));
|
|
166
|
+
}), this.native.addEventListener("drop", (t) => {
|
|
167
|
+
t.preventDefault(), e = 0, this.native.classList.remove("highlight");
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
createButton() {
|
|
171
|
+
let e = document.createElement("wj-button");
|
|
172
|
+
e.innerText = this.label || this.localizer.translate("wj.file.upload.button");
|
|
173
|
+
let t = document.createElement("slot"), i = document.createElement("input");
|
|
174
|
+
return i.setAttribute("type", "file"), i.setAttribute("multiple", ""), i.setAttribute("style", "display:none;"), e.appendChild(t), e.appendChild(i), this.fileInput = i, e;
|
|
175
|
+
}
|
|
176
|
+
handleSubmit(e) {
|
|
177
|
+
e.preventDefault(), this.uploadFiles(this.fileInput.files);
|
|
178
|
+
}
|
|
179
|
+
// tu treba pridat kontrolu chunku
|
|
180
|
+
uploadFiles(e) {
|
|
181
|
+
e.length !== 0 && Array.from(e).forEach((t) => {
|
|
182
|
+
this.assertFilesValid(t);
|
|
183
|
+
let i, l = new FileReader();
|
|
184
|
+
l.onload = (a) => {
|
|
185
|
+
i = this.createPreview(t, l), this.fileList.appendChild(i), L(t, this.chunkSize, i);
|
|
186
|
+
}, l.readAsDataURL(t);
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
createPreview(e, t) {
|
|
190
|
+
let i = document.createElement("wj-file-upload-item");
|
|
191
|
+
return i.setAttribute("name", e.name), i.setAttribute("size", e.size), i.setAttribute("uploaded", "0"), i.setAttribute("progress", "0"), i.innerHTML = `<wj-icon slot="img" name="${E(e.type.split("/")[1])}" size="large"></wj-icon>`, i;
|
|
192
|
+
}
|
|
193
|
+
createThumbnail(e, t) {
|
|
194
|
+
let i = document.createElement("img");
|
|
195
|
+
return i.setAttribute("src", t.result), i;
|
|
196
|
+
}
|
|
197
|
+
// TODO: alowed types a size limit by malo byt cez attributy
|
|
198
|
+
assertFilesValid(e) {
|
|
199
|
+
const { name: t, size: i } = e;
|
|
200
|
+
if (console.log("FILE", e, this.acceptedTypes), !z(e, this.acceptedTypes))
|
|
201
|
+
throw new Error(`❌ FILE: "${t}" Valid file types are: "${this.acceptedTypes}"`);
|
|
202
|
+
if (i > this.maxFileSize)
|
|
203
|
+
throw new Error(`❌ File "${t}" could not be uploaded. Only images up to ${this.maxFileSize} MB are allowed. Nie je to ${i}`);
|
|
204
|
+
}
|
|
205
|
+
updateStatusMessage(e) {
|
|
206
|
+
}
|
|
207
|
+
updateProgressBar(e, t) {
|
|
208
|
+
const i = Math.round(e);
|
|
209
|
+
this.context.querySelector("#id-" + t).value = i;
|
|
210
|
+
}
|
|
211
|
+
showPendingState() {
|
|
212
|
+
this.updateStatusMessage("⏳ Pending...");
|
|
213
|
+
}
|
|
214
|
+
resetFormState() {
|
|
215
|
+
this.fileList.textContent = "", this.updateStatusMessage("🤷♂ Nothing's uploaded");
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
customElements.get("wj-file-upload") || window.customElements.define("wj-file-upload", F);
|
|
219
|
+
export {
|
|
220
|
+
F as FileUpload
|
|
221
|
+
};
|
package/dist/wj-footer.js
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import
|
|
1
|
+
var a = Object.defineProperty;
|
|
2
|
+
var c = (e, t, o) => t in e ? a(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o;
|
|
3
|
+
var s = (e, t, o) => (c(e, typeof t != "symbol" ? t + "" : t, o), o);
|
|
4
|
+
import i from "./wj-element.js";
|
|
5
5
|
import "./wj-store.js";
|
|
6
|
-
const m =
|
|
7
|
-
* direction.scss
|
|
8
|
-
*/:host{--wj-footer-height: 60px;padding:0 20px;flex-shrink:0;height:var(--wj-footer-height);display:block}
|
|
6
|
+
const m = `:host{--wj-footer-height: 60px;padding:0 20px;flex-shrink:0;height:var(--wj-footer-height);display:block}
|
|
9
7
|
`;
|
|
10
|
-
class l extends
|
|
8
|
+
class l extends i {
|
|
11
9
|
constructor() {
|
|
12
10
|
super();
|
|
13
|
-
|
|
11
|
+
s(this, "className", "Footer");
|
|
14
12
|
}
|
|
15
13
|
static get cssStyleSheet() {
|
|
16
14
|
return m;
|
|
@@ -22,8 +20,8 @@ class l extends a {
|
|
|
22
20
|
this.isShadowRoot = "open";
|
|
23
21
|
}
|
|
24
22
|
draw(o, d, p) {
|
|
25
|
-
let
|
|
26
|
-
return
|
|
23
|
+
let r = document.createDocumentFragment(), n = document.createElement("slot");
|
|
24
|
+
return r.appendChild(n), r;
|
|
27
25
|
}
|
|
28
26
|
}
|
|
29
27
|
customElements.get("wj-footer") || window.customElements.define("wj-footer", l);
|
package/dist/wj-form.js
CHANGED
|
@@ -3,17 +3,15 @@ var c = (e, t, s) => t in e ? m(e, t, { enumerable: !0, configurable: !0, writab
|
|
|
3
3
|
var o = (e, t, s) => (c(e, typeof t != "symbol" ? t + "" : t, s), s);
|
|
4
4
|
import a from "./wj-element.js";
|
|
5
5
|
import "./wj-store.js";
|
|
6
|
-
const
|
|
7
|
-
* direction.scss
|
|
8
|
-
*/:host{width:100%}
|
|
6
|
+
const l = `:host{width:100%}
|
|
9
7
|
`;
|
|
10
|
-
class
|
|
8
|
+
class u extends a {
|
|
11
9
|
constructor() {
|
|
12
10
|
super();
|
|
13
11
|
o(this, "className", "Form");
|
|
14
12
|
}
|
|
15
13
|
static get cssStyleSheet() {
|
|
16
|
-
return
|
|
14
|
+
return l;
|
|
17
15
|
}
|
|
18
16
|
static get observedAttributes() {
|
|
19
17
|
return [];
|
|
@@ -21,12 +19,12 @@ class l extends a {
|
|
|
21
19
|
setupAttributes() {
|
|
22
20
|
this.isShadowRoot = "open";
|
|
23
21
|
}
|
|
24
|
-
draw(s,
|
|
22
|
+
draw(s, i, d) {
|
|
25
23
|
let r = document.createDocumentFragment(), n = document.createElement("slot");
|
|
26
24
|
return r.appendChild(n), r;
|
|
27
25
|
}
|
|
28
26
|
}
|
|
29
|
-
customElements.get("wj-form") || window.customElements.define("wj-form",
|
|
27
|
+
customElements.get("wj-form") || window.customElements.define("wj-form", u);
|
|
30
28
|
export {
|
|
31
|
-
|
|
29
|
+
u as Form
|
|
32
30
|
};
|