wj-elements 0.1.11 → 0.1.13

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/package.json +1 -1
  2. package/dist/dark.css +0 -1
  3. package/dist/light.css +0 -1
  4. package/dist/localize-DVuO3S17.js +0 -43
  5. package/dist/popup.element-CpEjis9f.js +0 -1068
  6. package/dist/router-links-FtZbFUto.js +0 -146
  7. package/dist/styles.css +0 -1
  8. package/dist/wje-accordion-item.js +0 -88
  9. package/dist/wje-accordion.js +0 -79
  10. package/dist/wje-animation.js +0 -121
  11. package/dist/wje-aside.js +0 -55
  12. package/dist/wje-avatar.js +0 -74
  13. package/dist/wje-badge.js +0 -50
  14. package/dist/wje-breadcrumb.js +0 -148
  15. package/dist/wje-breadcrumbs.js +0 -67
  16. package/dist/wje-button-group.js +0 -78
  17. package/dist/wje-button.js +0 -175
  18. package/dist/wje-card-content.js +0 -48
  19. package/dist/wje-card-controls.js +0 -48
  20. package/dist/wje-card-header.js +0 -47
  21. package/dist/wje-card-subtitle.js +0 -55
  22. package/dist/wje-card-title.js +0 -55
  23. package/dist/wje-card.js +0 -50
  24. package/dist/wje-carousel-item.js +0 -33
  25. package/dist/wje-carousel.js +0 -177
  26. package/dist/wje-checkbox.js +0 -104
  27. package/dist/wje-chip.js +0 -32
  28. package/dist/wje-col.js +0 -27
  29. package/dist/wje-color-picker.js +0 -953
  30. package/dist/wje-container.js +0 -57
  31. package/dist/wje-copy-button.js +0 -164
  32. package/dist/wje-dialog.js +0 -86
  33. package/dist/wje-divider.js +0 -53
  34. package/dist/wje-dropdown.js +0 -68
  35. package/dist/wje-element.js +0 -453
  36. package/dist/wje-fetchAndParseCSS.js +0 -40
  37. package/dist/wje-file-upload-item.js +0 -115
  38. package/dist/wje-file-upload.js +0 -297
  39. package/dist/wje-footer.js +0 -56
  40. package/dist/wje-form.js +0 -28
  41. package/dist/wje-format-digital.js +0 -85
  42. package/dist/wje-grid.js +0 -28
  43. package/dist/wje-header.js +0 -58
  44. package/dist/wje-icon-picker.js +0 -221
  45. package/dist/wje-icon.js +0 -119
  46. package/dist/wje-img-comparer.js +0 -111
  47. package/dist/wje-img.js +0 -58
  48. package/dist/wje-infinite-scroll.js +0 -193
  49. package/dist/wje-inline-edit.js +0 -120
  50. package/dist/wje-input-file.js +0 -85
  51. package/dist/wje-input.js +0 -240
  52. package/dist/wje-item.js +0 -45
  53. package/dist/wje-label.js +0 -67
  54. package/dist/wje-list.js +0 -53
  55. package/dist/wje-main.js +0 -56
  56. package/dist/wje-masonry.js +0 -218
  57. package/dist/wje-master.js +0 -196
  58. package/dist/wje-menu-button.js +0 -65
  59. package/dist/wje-menu-item.js +0 -192
  60. package/dist/wje-menu-label.js +0 -57
  61. package/dist/wje-menu.js +0 -74
  62. package/dist/wje-option.js +0 -99
  63. package/dist/wje-options.js +0 -63
  64. package/dist/wje-popup.js +0 -5
  65. package/dist/wje-progress-bar.js +0 -145
  66. package/dist/wje-radio-group.js +0 -101
  67. package/dist/wje-radio.js +0 -46
  68. package/dist/wje-rate.js +0 -260
  69. package/dist/wje-relative-time.js +0 -85
  70. package/dist/wje-reorder-dropzone.js +0 -27
  71. package/dist/wje-reorder-item.js +0 -32
  72. package/dist/wje-reorder.js +0 -132
  73. package/dist/wje-route.js +0 -28
  74. package/dist/wje-router-link.js +0 -64
  75. package/dist/wje-router-outlet.js +0 -127
  76. package/dist/wje-routerx.js +0 -1088
  77. package/dist/wje-row.js +0 -58
  78. package/dist/wje-select.js +0 -240
  79. package/dist/wje-slider.js +0 -177
  80. package/dist/wje-split-view.js +0 -112
  81. package/dist/wje-store.js +0 -192
  82. package/dist/wje-tab-group.js +0 -105
  83. package/dist/wje-tab-panel.js +0 -52
  84. package/dist/wje-tab.js +0 -59
  85. package/dist/wje-textarea.js +0 -116
  86. package/dist/wje-thumbnail.js +0 -64
  87. package/dist/wje-toast.js +0 -76
  88. package/dist/wje-toggle.js +0 -94
  89. package/dist/wje-toolbar-action.js +0 -63
  90. package/dist/wje-toolbar.js +0 -61
  91. package/dist/wje-tooltip.js +0 -105
  92. package/dist/wje-visually-hidden.js +0 -56
@@ -1,32 +0,0 @@
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
- };
@@ -1,132 +0,0 @@
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
- };
package/dist/wje-route.js DELETED
@@ -1,28 +0,0 @@
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
- };
@@ -1,64 +0,0 @@
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
- };
@@ -1,127 +0,0 @@
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
- };