wj-elements 0.1.0 → 0.1.2

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 (49) hide show
  1. package/dist/dark.css +1 -1
  2. package/dist/light.css +1 -1
  3. package/dist/{localize-7fxVJArK.js → localize-DVuO3S17.js} +1 -1
  4. package/dist/{popup.element-BXak-Fgc.js → popup.element-Dj9j__Dh.js} +329 -350
  5. package/dist/styles.css +1 -1
  6. package/dist/wje-accordion-item.js +88 -0
  7. package/dist/wje-accordion.js +79 -0
  8. package/dist/wje-animation.js +10 -11
  9. package/dist/wje-avatar.js +31 -29
  10. package/dist/wje-badge.js +7 -7
  11. package/dist/wje-breadcrumb.js +11 -11
  12. package/dist/wje-button.js +22 -29
  13. package/dist/wje-carousel.js +8 -9
  14. package/dist/wje-checkbox.js +81 -23
  15. package/dist/wje-dialog.js +53 -25
  16. package/dist/wje-dropdown.js +36 -23
  17. package/dist/wje-element.js +100 -89
  18. package/dist/wje-file-upload-item.js +3 -4
  19. package/dist/wje-file-upload.js +40 -43
  20. package/dist/wje-format-digital.js +1 -1
  21. package/dist/wje-icon-picker.js +1 -1
  22. package/dist/wje-icon.js +115 -3
  23. package/dist/wje-img-comparer.js +1 -2
  24. package/dist/wje-infinite-scroll.js +71 -41
  25. package/dist/wje-inline-edit.js +1 -2
  26. package/dist/wje-input-file.js +26 -18
  27. package/dist/wje-input.js +1 -1
  28. package/dist/wje-master.js +323 -168
  29. package/dist/wje-menu-item.js +33 -31
  30. package/dist/wje-menu.js +7 -7
  31. package/dist/wje-option.js +97 -3
  32. package/dist/wje-options.js +1 -1
  33. package/dist/wje-popup.js +1 -1
  34. package/dist/wje-progress-bar.js +5 -5
  35. package/dist/wje-radio-group.js +1 -1
  36. package/dist/wje-radio.js +1 -1
  37. package/dist/wje-relative-time.js +4 -13
  38. package/dist/wje-select.js +9 -10
  39. package/dist/wje-slider.js +40 -79
  40. package/dist/wje-tab.js +9 -9
  41. package/dist/wje-toast.js +16 -16
  42. package/dist/wje-toggle.js +39 -15
  43. package/dist/wje-tooltip.js +47 -23
  44. package/package.json +2 -1
  45. package/dist/custom-elements.json +0 -12216
  46. package/dist/icon.element-DOiXP3pi.js +0 -115
  47. package/dist/option.element-CpeafIM-.js +0 -98
  48. package/dist/styles-4vJ2wdTZ.js +0 -4
  49. package/dist/web-types.json +0 -2756
@@ -1,115 +0,0 @@
1
- var w = Object.defineProperty;
2
- var f = (e, t, r) => t in e ? w(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
- var l = (e, t, r) => (f(e, typeof t != "symbol" ? t + "" : t, r), r);
4
- import u from "./wje-element.js";
5
- const n = /* @__PURE__ */ new Map(), h = /* @__PURE__ */ new Map();
6
- let a;
7
- const g = (e) => c(e) && (e = e.trim(), m(e)) ? e : null, m = (e) => e.length > 0 && /(\/|\.)/.test(e), j = (e) => e.startsWith("data:image/svg+xml"), v = (e) => e.indexOf(";utf8,") !== -1, c = (e) => typeof e == "string", p = (e) => {
8
- const t = document.createElement("div");
9
- t.innerHTML = e;
10
- const r = t.firstElementChild;
11
- return r && r.nodeName.toLowerCase() === "svg" && (r.getAttribute("class"), d(r)) ? t.innerHTML : "";
12
- }, d = (e) => {
13
- if (e.nodeType === 1) {
14
- if (e.nodeName.toLowerCase() === "script")
15
- return !1;
16
- for (let t = 0; t < e.attributes.length; t++) {
17
- const r = e.attributes[t].name;
18
- if (c(r) && r.toLowerCase().indexOf("on") === 0)
19
- return !1;
20
- }
21
- for (let t = 0; t < e.childNodes.length; t++)
22
- if (!d(e.childNodes[t]))
23
- return !1;
24
- }
25
- return !0;
26
- }, z = (e, t) => {
27
- let r = h.get(e);
28
- if (!r)
29
- if (typeof fetch < "u" && typeof document < "u")
30
- if (j(e) && v(e)) {
31
- a || (a = new DOMParser());
32
- const s = a.parseFromString(e, "text/html").querySelector("svg");
33
- return s && n.set(e, s.outerHTML), Promise.resolve();
34
- } else
35
- r = fetch(e).then((o) => {
36
- if (o.ok)
37
- return o.text().then((s) => {
38
- s && t !== !1 && (s = p(s)), n.set(e, s || "");
39
- });
40
- n.set(e, "");
41
- }), h.set(e, r);
42
- else
43
- return n.set(e, ""), Promise.resolve();
44
- return r;
45
- }, b = (e) => {
46
- let t = g(e.src);
47
- return t || (t = y(e.name), t ? L(t, e.hasAttribute("filled")) : null);
48
- }, y = (e) => !c(e) || e.trim() === "" || e.replace(/[a-z]|-|\d/gi, "") !== "" ? null : e, L = (e, t = !1) => {
49
- const r = `/assets/img/icons/${t ? "filled" : "outline"}/${e}.svg`;
50
- let o = new URL(import.meta.url), s = o.pathname, i = s.substring(0, s.lastIndexOf("/"));
51
- return new URL(o.origin + i + r).href;
52
- }, x = ":host(.wje-color-primary){--wje-icon-color: var(--wje-color-primary)}:host(.wje-color-complete){--wje-icon-color: var(--wje-color-complete)}:host(.wje-color-success){--wje-icon-color: var(--wje-color-success)}:host(.wje-color-warning){--wje-icon-color: var(--wje-color-warning)}:host(.wje-color-danger){--wje-icon-color: var(--wje-color-danger)}:host(.wje-color-info){--wje-icon-color: var(--wje-color-info)}:host{--wje-icon-size: 1rem;--wje-icon-width: var(--wje-icon-size, 100%);--wje-icon-height: var(--wje-icon-size, 100%);//background: transparent !important;display:inline-block;width:var(--wje-icon-width);height:var(--wje-icon-height);contain:strict;fill:currentColor;box-sizing:content-box!important}.icon-inner,svg{display:block;width:var(--wje-icon-width);height:var(--wje-icon-height)}:host(.wje-size-small){--wje-icon-size: 18px}:host(.wje-size-large){--wje-icon-size: 32px}:host(.wje-size){font-size:var(--wje-icon-size)}:host(.wje-color){color:var(--wje-icon-color)!important}";
53
- class I extends u {
54
- /**
55
- * Creates an instance of IconElement.
56
- *
57
- * @constructor
58
- */
59
- constructor() {
60
- super();
61
- l(this, "className", "Icon");
62
- }
63
- /**
64
- * Returns the CSS styles for the component.
65
- *
66
- * @static
67
- * @returns {CSSStyleSheet}
68
- */
69
- static get cssStyleSheet() {
70
- return x;
71
- }
72
- /**
73
- * Returns the list of attributes to observe for changes.
74
- *
75
- * @static
76
- * @returns {Array<string>}
77
- */
78
- static get observedAttributes() {
79
- return ["name"];
80
- }
81
- /**
82
- * Sets up the attributes for the component.
83
- */
84
- setupAttributes() {
85
- this.isShadowRoot = "open";
86
- }
87
- /**
88
- * Draws the component.
89
- *
90
- * @param {Object} context - The context for drawing.
91
- * @param {Object} store - The store for drawing.
92
- * @param {Object} params - The parameters for drawing.
93
- * @returns {DocumentFragment}
94
- */
95
- draw(r, o, s) {
96
- let i = document.createDocumentFragment();
97
- return this.classList.add("lazy-loaded-image", "lazy"), this.element = document.createElement("div"), this.element.classList.add("icon-inner"), this.url = b(this), this.classList.add("wje-size"), this.color && this.classList.add("wje-color-" + this.color, "wje-color"), this.size && this.classList.add("wje-size-" + this.size), i.appendChild(this.element), i;
98
- }
99
- /**
100
- * Called after the component has been drawn.
101
- */
102
- afterDraw() {
103
- let r = new IntersectionObserver((o, s) => {
104
- o.forEach((i) => {
105
- i.isIntersecting && (z(this.url).then((S) => {
106
- this.element.innerHTML = n.get(this.url), this.element.querySelector("svg").setAttribute("part", "svg");
107
- }), this.classList.remove("lazy"), r.unobserve(i.target));
108
- });
109
- });
110
- r.observe(this.element);
111
- }
112
- }
113
- export {
114
- I
115
- };
@@ -1,98 +0,0 @@
1
- var c = Object.defineProperty;
2
- var p = (n, t, e) => t in n ? c(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
3
- var o = (n, t, e) => (p(n, typeof t != "symbol" ? t + "" : t, e), e);
4
- import m, { event as u } from "./wje-element.js";
5
- import { I as h } from "./icon.element-DOiXP3pi.js";
6
- const g = ':host{--wje-option-padding-top: .5rem;--wje-option-padding-bottom: .5rem;--wje-option-highlighted: var(--wje-color-contrast-3);display:block}:host wje-icon{visibility:hidden;margin-inline:.5rem}:host([selected]) wje-icon{visibility:visible}.native-option{display:flex;align-items:center;padding-top:var(--wje-option-padding-top);padding-bottom:var(--wje-option-padding-bottom)}.native-option:hover{background-color:var(--wje-option-highlighted)}::slotted([slot="start"]){flex:0 0 auto;display:flex;align-items:center;margin-inline-end:.5rem}::slotted([slot="end"]){flex:0 0 auto;display:flex;align-items:center;margin-inline:auto .5rem}';
7
- class f extends m {
8
- /**
9
- * Creates an instance of Option.
10
- *
11
- * @constructor
12
- */
13
- constructor() {
14
- super();
15
- /**
16
- * Dependencies of the Option component.
17
- */
18
- o(this, "depandencies", {
19
- "wje-icon": h
20
- });
21
- o(this, "className", "Option");
22
- }
23
- /**
24
- * Sets the selected attribute of the option.
25
- *
26
- * @param {boolean} value - The value to set.
27
- */
28
- set selected(e) {
29
- return e ? this.setAttribute("selected", "") : this.removeAttribute("selected");
30
- }
31
- /**
32
- * Sets the value attribute of the option.
33
- *
34
- * @param {string} value - The value to set.
35
- */
36
- set value(e) {
37
- this.setAttribute("value", e);
38
- }
39
- /**
40
- * Sets the text content of the option.
41
- *
42
- * @param {string} value - The text to set.
43
- */
44
- set text(e) {
45
- this.innerText = e;
46
- }
47
- /**
48
- * Returns the CSS styles for the component.
49
- *
50
- * @static
51
- * @returns {CSSStyleSheet}
52
- */
53
- static get cssStyleSheet() {
54
- return g;
55
- }
56
- /**
57
- * Returns the list of attributes to observe for changes.
58
- *
59
- * @static
60
- * @returns {Array<string>}
61
- */
62
- static get observedAttributes() {
63
- return [];
64
- }
65
- /**
66
- * Sets up the attributes for the component.
67
- */
68
- setupAttributes() {
69
- this.isShadowRoot = "open";
70
- }
71
- /**
72
- * Draws the component.
73
- *
74
- * @param {Object} context - The context for drawing.
75
- * @param {Object} store - The store for drawing.
76
- * @param {Object} params - The parameters for drawing.
77
- * @returns {DocumentFragment}
78
- */
79
- draw(e, b, v) {
80
- let s = document.createDocumentFragment(), i = document.createElement("div");
81
- i.classList.add("native-option"), i.setAttribute("part", "native");
82
- let a = document.createElement("wje-icon");
83
- a.setAttribute("name", "check");
84
- let r = document.createElement("slot");
85
- r.setAttribute("name", "start");
86
- let d = document.createElement("slot"), l = document.createElement("slot");
87
- return l.setAttribute("name", "end"), i.appendChild(a), i.appendChild(r), i.appendChild(d), i.appendChild(l), s.appendChild(i), s;
88
- }
89
- /**
90
- * Adds event listeners after the component is drawn.
91
- */
92
- afterDraw() {
93
- u.addListener(this, "click", "wje:option-change");
94
- }
95
- }
96
- export {
97
- f as O
98
- };
@@ -1,4 +0,0 @@
1
- const a = ":host{--wje-avatar-width: 32px;--wje-avatar-height: 32px;--wje-avatar-font-size: .75rem;--wje-avatar-font-weight: 400;--wje-avatar-color: inherit;--wje-avatar-background-color: var(--wje-color-contrast-low);--wje-avatar-border-radius: 50%;--wje-avatar-border-color: transparent;--wje-avatar-border-width: 1px;--wje-avatar-border-style: solid;display:inline-block;width:var(--wje-avatar-width);height:var(--wje-avatar-height);font-size:var(--wje-avatar-font-size);font-weight:var(--wje-avatar-font-weight);color:var(--wje-avatar-color)}:host .native-avatar{display:flex;align-items:center;justify-content:center;width:100%;height:100%;border-radius:var(--wje-avatar-border-radius);background-color:var(--wje-avatar-background-color)}::slotted(wje-img),::slotted(img){border-radius:var(--wje-avatar-border-radius);width:100%;height:100%;object-fit:cover;overflow:hidden}:host(.wje-avatar-border){border-color:var(--wje-avatar-border-color);border-width:var(--wje-avatar-border-width);border-style:var(--wje-avatar-border-style)}:host(.wje-avatar-small){--wje-avatar-width: 24px;--wje-avatar-height: 24px}:host(.wje-avatar-large){--wje-avatar-width: 48px;--wje-avatar-height: 48px}";
2
- export {
3
- a as s
4
- };