wj-elements 0.1.13 → 0.1.15

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.
Files changed (92) hide show
  1. package/dist/dark.css +1 -0
  2. package/dist/light.css +1 -0
  3. package/dist/localize-DVuO3S17.js +43 -0
  4. package/dist/popup.element-CpEjis9f.js +1068 -0
  5. package/dist/router-links-FtZbFUto.js +146 -0
  6. package/dist/styles.css +1 -0
  7. package/dist/wje-accordion-item.js +88 -0
  8. package/dist/wje-accordion.js +79 -0
  9. package/dist/wje-animation.js +121 -0
  10. package/dist/wje-aside.js +55 -0
  11. package/dist/wje-avatar.js +74 -0
  12. package/dist/wje-badge.js +50 -0
  13. package/dist/wje-breadcrumb.js +148 -0
  14. package/dist/wje-breadcrumbs.js +67 -0
  15. package/dist/wje-button-group.js +78 -0
  16. package/dist/wje-button.js +175 -0
  17. package/dist/wje-card-content.js +48 -0
  18. package/dist/wje-card-controls.js +48 -0
  19. package/dist/wje-card-header.js +47 -0
  20. package/dist/wje-card-subtitle.js +55 -0
  21. package/dist/wje-card-title.js +55 -0
  22. package/dist/wje-card.js +50 -0
  23. package/dist/wje-carousel-item.js +33 -0
  24. package/dist/wje-carousel.js +177 -0
  25. package/dist/wje-checkbox.js +104 -0
  26. package/dist/wje-chip.js +32 -0
  27. package/dist/wje-col.js +27 -0
  28. package/dist/wje-color-picker.js +953 -0
  29. package/dist/wje-container.js +57 -0
  30. package/dist/wje-copy-button.js +164 -0
  31. package/dist/wje-dialog.js +86 -0
  32. package/dist/wje-divider.js +53 -0
  33. package/dist/wje-dropdown.js +68 -0
  34. package/dist/wje-element.js +453 -0
  35. package/dist/wje-fetchAndParseCSS.js +40 -0
  36. package/dist/wje-file-upload-item.js +115 -0
  37. package/dist/wje-file-upload.js +297 -0
  38. package/dist/wje-footer.js +56 -0
  39. package/dist/wje-form.js +28 -0
  40. package/dist/wje-format-digital.js +85 -0
  41. package/dist/wje-grid.js +28 -0
  42. package/dist/wje-header.js +58 -0
  43. package/dist/wje-icon-picker.js +221 -0
  44. package/dist/wje-icon.js +119 -0
  45. package/dist/wje-img-comparer.js +111 -0
  46. package/dist/wje-img.js +58 -0
  47. package/dist/wje-infinite-scroll.js +193 -0
  48. package/dist/wje-inline-edit.js +120 -0
  49. package/dist/wje-input-file.js +85 -0
  50. package/dist/wje-input.js +240 -0
  51. package/dist/wje-item.js +45 -0
  52. package/dist/wje-label.js +67 -0
  53. package/dist/wje-list.js +53 -0
  54. package/dist/wje-main.js +56 -0
  55. package/dist/wje-masonry.js +218 -0
  56. package/dist/wje-master.js +196 -0
  57. package/dist/wje-menu-button.js +65 -0
  58. package/dist/wje-menu-item.js +192 -0
  59. package/dist/wje-menu-label.js +57 -0
  60. package/dist/wje-menu.js +74 -0
  61. package/dist/wje-option.js +99 -0
  62. package/dist/wje-options.js +63 -0
  63. package/dist/wje-popup.js +5 -0
  64. package/dist/wje-progress-bar.js +145 -0
  65. package/dist/wje-radio-group.js +101 -0
  66. package/dist/wje-radio.js +46 -0
  67. package/dist/wje-rate.js +260 -0
  68. package/dist/wje-relative-time.js +85 -0
  69. package/dist/wje-reorder-dropzone.js +27 -0
  70. package/dist/wje-reorder-item.js +32 -0
  71. package/dist/wje-reorder.js +132 -0
  72. package/dist/wje-route.js +28 -0
  73. package/dist/wje-router-link.js +64 -0
  74. package/dist/wje-router-outlet.js +127 -0
  75. package/dist/wje-routerx.js +1088 -0
  76. package/dist/wje-row.js +58 -0
  77. package/dist/wje-select.js +240 -0
  78. package/dist/wje-slider.js +177 -0
  79. package/dist/wje-split-view.js +112 -0
  80. package/dist/wje-store.js +192 -0
  81. package/dist/wje-tab-group.js +105 -0
  82. package/dist/wje-tab-panel.js +52 -0
  83. package/dist/wje-tab.js +59 -0
  84. package/dist/wje-textarea.js +116 -0
  85. package/dist/wje-thumbnail.js +64 -0
  86. package/dist/wje-toast.js +76 -0
  87. package/dist/wje-toggle.js +94 -0
  88. package/dist/wje-toolbar-action.js +63 -0
  89. package/dist/wje-toolbar.js +61 -0
  90. package/dist/wje-tooltip.js +105 -0
  91. package/dist/wje-visually-hidden.js +56 -0
  92. package/package.json +1 -1
@@ -0,0 +1,32 @@
1
+ var l = Object.defineProperty;
2
+ var m = (t, e, r) => e in t ? l(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
3
+ var d = (t, e, r) => (m(t, typeof e != "symbol" ? e + "" : e, r), r);
4
+ import c, { WjElementUtils as p } from "./wje-element.js";
5
+ const g = ":host{--reorder-item-spacing: .5rem}.item{width:134px;height:19px;display:flex;align-items:center;justify-content:center;position:relative;gap:var(--reorder-item-spacing);padding:var(--reorder-item-spacing);border-radius:var(--wje-border-radius-small);cursor:grab;transition:transform .3s linear}.item-w-handle{cursor:default}.item:hover:not(.item-w-handle){background-color:#f4f4f5}.item:active:not(.item-w-handle):not(.moving){cursor:grabbing}.moving{background-color:#d3d3d3}.handle{cursor:grab;gap:10px}.handle:active{cursor:grabbing}.name{width:108px;height:19px;text-align:center;font-size:var(--wje-font-size-medium);font-weight:400;line-height:19.36px;gap:10px}.drag--down{--item-transform: translateY(-10px)}.drag--up{--item-transform: translateY(10px)}.item{transform:var(--item-transform)}";
6
+ class o extends c {
7
+ constructor() {
8
+ super();
9
+ d(this, "className", "ReorderItem");
10
+ }
11
+ static get cssStyleSheet() {
12
+ return g;
13
+ }
14
+ setupAttributes() {
15
+ this.isShadowRoot = "open";
16
+ }
17
+ draw(r, h, u) {
18
+ let s = document.createDocumentFragment(), a = document.createElement("div");
19
+ a.classList.add("item"), a.setAttribute("part", "native-reorder-item");
20
+ let i = document.createElement("slot");
21
+ if (i.classList.add("name"), p.hasSlot(this, "handle")) {
22
+ const n = document.createElement("slot");
23
+ n.classList.add("handle"), n.setAttribute("name", "handle"), n.setAttribute("part", "handle-part"), a.classList.add("item-w-handle"), a.appendChild(n);
24
+ } else
25
+ i.setAttribute("draggable", "true");
26
+ return a.appendChild(i), s.appendChild(a), s;
27
+ }
28
+ }
29
+ o.define("wje-reorder-item", o);
30
+ export {
31
+ o as default
32
+ };
@@ -0,0 +1,132 @@
1
+ var p = Object.defineProperty;
2
+ var u = (d, o, e) => o in d ? p(d, o, { enumerable: !0, configurable: !0, writable: !0, value: e }) : d[o] = e;
3
+ var h = (d, o, e) => (u(d, typeof o != "symbol" ? o + "" : o, e), e);
4
+ import f from "./wje-element.js";
5
+ const E = ".container{position:relative;display:flex;align-items:center;justify-content:center;flex-direction:column}.container-w-dropzones{position:relative;display:flex;align-items:center;justify-content:center;flex-direction:row}";
6
+ class g extends f {
7
+ /**
8
+ * Creates an instance of Select.
9
+ *
10
+ * @constructor
11
+ */
12
+ constructor() {
13
+ super();
14
+ h(this, "className", "Select");
15
+ this.dragEl = null, this.items = [], this.originalIndex = null;
16
+ }
17
+ /**
18
+ * Returns the CSS styles for the component.
19
+ *
20
+ * @static
21
+ * @returns {CSSStyleSheet}
22
+ */
23
+ static get cssStyleSheet() {
24
+ return E;
25
+ }
26
+ /**
27
+ * Returns the list of attributes to observe for changes.
28
+ *
29
+ * @static
30
+ * @returns {Array<string>}
31
+ */
32
+ static get observedAttributes() {
33
+ return [];
34
+ }
35
+ /**
36
+ * Sets up the attributes for the component.
37
+ */
38
+ setupAttributes() {
39
+ this.isShadowRoot = "open";
40
+ }
41
+ draw(e, t, r) {
42
+ const a = document.createDocumentFragment(), n = document.createElement("div");
43
+ n.classList.add("container"), n.setAttribute("part", "native");
44
+ const s = document.createElement("slot");
45
+ return s.classList.add("reorder-items"), n.appendChild(s), a.appendChild(n), this.container = n, a;
46
+ }
47
+ afterDraw(e, t, r) {
48
+ const a = this.querySelectorAll("wje-reorder-item"), n = this.querySelectorAll("wje-reorder-dropzone");
49
+ n && n.forEach((s) => {
50
+ this.container.classList.remove("container"), this.container.classList.add("container-w-dropzones");
51
+ }), a && a.forEach((s) => {
52
+ const i = s.querySelectorAll("[slot=handle]");
53
+ (i.length > 0 ? i : [s]).forEach((c) => {
54
+ c.setAttribute("draggable", "true"), this.attachEventListeners(c);
55
+ });
56
+ });
57
+ }
58
+ onDragStart(e) {
59
+ if (this.hasAttribute("disabled")) {
60
+ e.preventDefault();
61
+ return;
62
+ }
63
+ const t = new Image();
64
+ t.src = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAEElEQVR42mNkAAIAAAoAAv/lxKUAAAAASUVORK5CYII=", e.dataTransfer.setDragImage(t, 0, 0), this.dragEl = e.currentTarget.closest("wje-reorder-item"), e.dataTransfer.effectAllowed = "move", e.dataTransfer.setData("text/html", `${this.dragEl.innerHTML}`), this.originalIndex = [...this.dragEl.parentNode.children].indexOf(
65
+ this.dragEl
66
+ ), this.originalParent = this.dragEl.parentNode;
67
+ }
68
+ onDragOver(e) {
69
+ e.preventDefault();
70
+ const t = e.currentTarget.closest("wje-reorder-item"), r = t.parentNode;
71
+ this.dragEl !== t ? (this.updateDropStyles(t, this.isMovingDown(e)), this.updateItemsPosition(r, t, this.isMovingDown(e))) : t.shadowRoot.querySelector("div").classList.add("moving");
72
+ }
73
+ onDragEnter(e) {
74
+ }
75
+ onDragLeave(e) {
76
+ }
77
+ onDrop(e) {
78
+ e.preventDefault();
79
+ const t = e.currentTarget.closest("wje-reorder-item");
80
+ if (t.shadowRoot.querySelector("div").classList.remove("moving"), !t.parentNode)
81
+ return;
82
+ t.parentNode.insertBefore(this.dragEl, t);
83
+ }
84
+ onDragEnd(e) {
85
+ const t = this.dragEl.parentNode, r = Array.from(t.children).indexOf(this.dragEl);
86
+ [t, this.originalParent].forEach((n) => {
87
+ n.childNodes.forEach((s) => {
88
+ if (s.nodeType === 1) {
89
+ const i = s.shadowRoot.querySelector("div");
90
+ i && ["drag--up", "drag--down", "moving"].forEach(
91
+ (l) => i.classList.remove(l)
92
+ );
93
+ }
94
+ });
95
+ });
96
+ const a = Array.from(t.children).map((n) => {
97
+ const s = n.cloneNode(!0), i = s.querySelector(".handle");
98
+ return i && i.remove(), s.innerText.trim();
99
+ });
100
+ this.dispatchChange(this.originalIndex, r, a);
101
+ }
102
+ attachEventListeners(e) {
103
+ e.addEventListener("dragstart", this.onDragStart.bind(this), !1), e.addEventListener("touchstart", this.onDragStart.bind(this), !1), e.addEventListener("dragenter", this.onDragEnter.bind(this), !1), e.addEventListener("dragover", this.onDragOver.bind(this), !1), e.addEventListener("dragleave", this.onDragLeave.bind(this), !1), e.addEventListener("drop", this.onDrop.bind(this), !1), e.addEventListener("dragend", this.onDragEnd.bind(this), !1), e.addEventListener("touchend", this.onDragEnd.bind(this), !1);
104
+ }
105
+ updateDropStyles(e, t) {
106
+ const r = e.shadowRoot.querySelector("div").classList;
107
+ r.toggle("drag--down", t), r.toggle("drag--up", !t);
108
+ }
109
+ updateItemsPosition(e, t, r) {
110
+ e.insertBefore(
111
+ this.dragEl,
112
+ r ? t.nextSibling : t
113
+ );
114
+ }
115
+ isMovingDown(e) {
116
+ const t = e.currentTarget.closest("wje-reorder-item").parentNode, r = Array.from(t.children).indexOf(this.dragEl), a = Array.from(t.children).indexOf(
117
+ e.currentTarget.closest("wje-reorder-item")
118
+ );
119
+ return r < a;
120
+ }
121
+ dispatchChange(e, t, r) {
122
+ console.log("FROM:", e), console.log("TO:", t), console.log("ORDER:", r), this.dispatchEvent(
123
+ new CustomEvent("wje-reorder:change", {
124
+ detail: { from: e, to: t, order: r }
125
+ })
126
+ );
127
+ }
128
+ }
129
+ g.define("wje-reorder", g);
130
+ export {
131
+ g as default
132
+ };
@@ -0,0 +1,28 @@
1
+ var u = Object.defineProperty;
2
+ var a = (t, e, r) => e in t ? u(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
3
+ var s = (t, e, r) => (a(t, typeof e != "symbol" ? e + "" : e, r), r);
4
+ import c from "./wje-element.js";
5
+ class o extends c {
6
+ /**
7
+ * Creates an instance of Route.
8
+ *
9
+ * @constructor
10
+ */
11
+ constructor() {
12
+ super();
13
+ s(this, "className", "Route");
14
+ }
15
+ /**
16
+ * Returns the list of attributes to observe for changes.
17
+ *
18
+ * @static
19
+ * @returns {Array<string>}
20
+ */
21
+ static get observedAttributes() {
22
+ return [];
23
+ }
24
+ }
25
+ o.define("wje-route", o);
26
+ export {
27
+ o as default
28
+ };
@@ -0,0 +1,64 @@
1
+ var a = Object.defineProperty;
2
+ var c = (e, t, s) => t in e ? a(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
3
+ var n = (e, t, s) => (c(e, typeof t != "symbol" ? t + "" : t, s), s);
4
+ import u from "./wje-element.js";
5
+ import { b as l } from "./router-links-FtZbFUto.js";
6
+ const d = ":host{display:block;background:transparent!important}:host(.active){cursor:pointer;font-weight:700}";
7
+ class o extends u {
8
+ /**
9
+ * Creates an instance of RouterLink.
10
+ *
11
+ * @constructor
12
+ */
13
+ constructor() {
14
+ super();
15
+ n(this, "className", "RouterLink");
16
+ this.unbindRouterLinks = l(this, { selector: !1 });
17
+ }
18
+ /**
19
+ * Returns the CSS styles for the component.
20
+ *
21
+ * @static
22
+ * @returns {CSSStyleSheet}
23
+ */
24
+ static get cssStyleSheet() {
25
+ return d;
26
+ }
27
+ /**
28
+ * Returns the list of attributes to observe for changes.
29
+ *
30
+ * @static
31
+ * @returns {Array<string>}
32
+ */
33
+ static get observedAttributes() {
34
+ return [];
35
+ }
36
+ /**
37
+ * Sets up the attributes for the component.
38
+ */
39
+ setupAttributes() {
40
+ this.isShadowRoot = "open", this.setAttribute("active-class", "active");
41
+ }
42
+ /**
43
+ * Draws the component.
44
+ *
45
+ * @param {Object} context - The context for drawing.
46
+ * @param {Object} store - The store for drawing.
47
+ * @param {Object} params - The parameters for drawing.
48
+ * @returns {DocumentFragment}
49
+ */
50
+ draw(s, m, p) {
51
+ let r = document.createDocumentFragment(), i = document.createElement("slot");
52
+ return r.appendChild(i), r;
53
+ }
54
+ /**
55
+ * Cleans up before the component is disconnected.
56
+ */
57
+ beforeDisconnect() {
58
+ this.unbindRouterLinks();
59
+ }
60
+ }
61
+ o.define("wje-router-link", o);
62
+ export {
63
+ o as default
64
+ };
@@ -0,0 +1,127 @@
1
+ var C = Object.defineProperty;
2
+ var E = (i, t, n) => t in i ? C(i, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[t] = n;
3
+ var m = (i, t, n) => (E(i, typeof t != "symbol" ? t + "" : t, n), n);
4
+ import b from "./wje-element.js";
5
+ class $ {
6
+ constructor(t = {}) {
7
+ this.options = t;
8
+ }
9
+ getOption(t, n) {
10
+ return t.hasAttribute(n) ? t.getAttribute(n) : this.options[n];
11
+ }
12
+ hasOption(t, n) {
13
+ return t.hasAttribute(n) || this.options[n];
14
+ }
15
+ runParallel(t) {
16
+ return this.hasOption(t, "parallel");
17
+ }
18
+ beforeEnter(t, n) {
19
+ }
20
+ enter(t, n) {
21
+ }
22
+ leave(t, n, e) {
23
+ e();
24
+ }
25
+ }
26
+ var p = window.requestAnimationFrame, v = "transition", L = "animation", d = "transition", N = "transitionend", c = "animation", D = "animationend";
27
+ function O(i) {
28
+ window.scrollTo(0, 0), p(function() {
29
+ window.scrollTo(0, 0), p(i);
30
+ });
31
+ }
32
+ function x(i, t) {
33
+ var n = k(i), e = n.type, r = n.timeout, l = n.propCount;
34
+ if (!e)
35
+ return t();
36
+ var s = e === v ? N : D, u = 0, o = function() {
37
+ i.removeEventListener(s, a), t();
38
+ }, a = function(h) {
39
+ h.target === i && ++u >= l && o();
40
+ };
41
+ setTimeout(function() {
42
+ u < l && o();
43
+ }, r + 1), i.addEventListener(s, a);
44
+ }
45
+ function k(i) {
46
+ var t = window.getComputedStyle(i), n = (t[d + "Delay"] || "").split(", "), e = (t[d + "Duration"] || "").split(", "), r = f(n, e), l = (t[c + "Delay"] || "").split(", "), s = (t[c + "Duration"] || "").split(", "), u = f(l, s), o, a = 0, h = 0;
47
+ return a = Math.max(r, u), o = a > 0 ? r > u ? v : L : null, h = o ? o === v ? e.length : s.length : 0, {
48
+ type: o,
49
+ timeout: a,
50
+ propCount: h
51
+ };
52
+ }
53
+ function f(i, t) {
54
+ for (; i.length < t.length; )
55
+ i = i.concat(i);
56
+ return Math.max.apply(null, t.map(function(n, e) {
57
+ return g(n) + g(i[e]);
58
+ }));
59
+ }
60
+ function g(i) {
61
+ return Number(i.slice(0, -1).replace(",", ".")) * 1e3;
62
+ }
63
+ function A(i, t, n, e) {
64
+ i.classList.add(`${t}-${n}-active`), O(function() {
65
+ window.scrollTo(0, 0), i.classList.remove(`${t}-${n}`), i.classList.add(`${t}-${n}-to`), x(i, function() {
66
+ i.classList.remove(`${t}-${n}-active`, `${t}-${n}-to`), e && e();
67
+ });
68
+ });
69
+ }
70
+ class y extends $ {
71
+ beforeEnter(t, n) {
72
+ const e = t.getAttribute("animation") || "outlet";
73
+ n.classList.add(`${e}-enter`);
74
+ }
75
+ enter(t, n) {
76
+ const e = t.getAttribute("animation") || "outlet";
77
+ A(n, e, "enter");
78
+ }
79
+ leave(t, n, e) {
80
+ const r = t.getAttribute("animation") || "outlet";
81
+ n.classList.add(`${r}-leave`), n.style.display = "none", A(n, r, "leave", e);
82
+ }
83
+ }
84
+ const I = {};
85
+ let w;
86
+ function T(i) {
87
+ return I[i] || w || (w = new y());
88
+ }
89
+ class M extends HTMLElement {
90
+ appendChild(t) {
91
+ if (!this.hasAttribute("animation")) {
92
+ super.appendChild(t);
93
+ return;
94
+ }
95
+ const n = T(this.getAttribute("animation")), e = n.runParallel(this);
96
+ n.beforeEnter(this, t), super.appendChild(t), !e && this.removing ? this.appending = t : n.enter(this, t);
97
+ }
98
+ removeChild(t) {
99
+ if (!this.hasAttribute("animation")) {
100
+ super.removeChild(t);
101
+ return;
102
+ }
103
+ const n = T(this.getAttribute("animation"));
104
+ if (this.removing && this.removing.parentNode === this && super.removeChild(this.removing), t === this.appending) {
105
+ t.parentNode === this && super.removeChild(t), this.removing = null;
106
+ return;
107
+ }
108
+ this.removing = t, n.leave(this, t, () => {
109
+ this.removing && this.removing.parentNode === this && super.removeChild(this.removing), this.appending && n.enter(this, this.appending), this.appending = null, this.removing = null;
110
+ });
111
+ }
112
+ }
113
+ class P extends M {
114
+ /**
115
+ * Creates an instance of Route.
116
+ *
117
+ * @constructor
118
+ */
119
+ constructor() {
120
+ super();
121
+ m(this, "className", "RouterOutlet");
122
+ }
123
+ }
124
+ b.define("wje-router-outlet", P);
125
+ export {
126
+ P as default
127
+ };