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,48 +0,0 @@
1
- var d = Object.defineProperty;
2
- var i = (e, t, o) => t in e ? d(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o;
3
- var a = (e, t, o) => (i(e, typeof t != "symbol" ? t + "" : t, o), o);
4
- import s from "./wje-element.js";
5
- const p = ":host{display:block;padding:var(--wje-card-content-padding)}:host.no-padding .row{margin-left:0;margin-right:0}:host.no-bottom-padding{padding-bottom:0}:host.no-top-padding{padding-top:0}:host .title{margin-top:0}:host.scrollable{margin-bottom:20px}:host h3{line-height:34px;font-size:26px}";
6
- class l extends s {
7
- /**
8
- * CardContent constructor
9
- * @constructor
10
- */
11
- constructor() {
12
- super();
13
- /**
14
- * Class name
15
- * @type {string}
16
- */
17
- a(this, "className", "CardContent");
18
- }
19
- /**
20
- * Get CSS stylesheet
21
- * @static
22
- * @returns {Object} styles - The CSS styles
23
- */
24
- static get cssStyleSheet() {
25
- return p;
26
- }
27
- /**
28
- * Setup attributes
29
- */
30
- setupAttributes() {
31
- this.isShadowRoot = "open";
32
- }
33
- /**
34
- * Draw method
35
- * @param {Object} context - The context
36
- * @param {Object} store - The store
37
- * @param {Object} params - The parameters
38
- * @returns {Object} fragment - The document fragment
39
- */
40
- draw(o, c, m) {
41
- let n = document.createDocumentFragment(), r = document.createElement("slot");
42
- return n.appendChild(r), n;
43
- }
44
- }
45
- s.define("wje-card-content", l);
46
- export {
47
- l as default
48
- };
@@ -1,48 +0,0 @@
1
- var l = Object.defineProperty;
2
- var i = (e, t, o) => t in e ? l(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o;
3
- var s = (e, t, o) => (i(e, typeof t != "symbol" ? t + "" : t, o), o);
4
- import n from "./wje-element.js";
5
- const c = ":host{font-family:var(--wje-card-controls-font-family);text-transform:uppercase;display:inline-block;letter-spacing:.06em;font-size:var(--wje-card-controls-font-size);font-weight:500;margin:0;padding:0;line-height:normal;overflow:hidden;text-overflow:ellipsis;filter:alpha(opacity=40);transition:opacity .3s ease;position:absolute;right:1rem;top:.5rem}";
6
- class m extends n {
7
- /**
8
- * CardControls constructor
9
- * @constructor
10
- */
11
- constructor() {
12
- super();
13
- /**
14
- * Class name
15
- * @type {string}
16
- */
17
- s(this, "className", "CardControls");
18
- }
19
- /**
20
- * Get CSS stylesheet
21
- * @static
22
- * @returns {Object} styles - The CSS styles
23
- */
24
- static get cssStyleSheet() {
25
- return c;
26
- }
27
- /**
28
- * Setup attributes
29
- */
30
- setupAttributes() {
31
- this.isShadowRoot = "open";
32
- }
33
- /**
34
- * Draw method
35
- * @param {Object} context - The context
36
- * @param {Object} store - The store
37
- * @param {Object} params - The parameters
38
- * @returns {Object} fragment - The document fragment
39
- */
40
- draw(o, d, p) {
41
- let r = document.createDocumentFragment(), a = document.createElement("slot");
42
- return r.appendChild(a), r;
43
- }
44
- }
45
- n.define("wje-card-controls", m);
46
- export {
47
- m as default
48
- };
@@ -1,47 +0,0 @@
1
- var n = Object.defineProperty;
2
- var i = (t, e, r) => e in t ? n(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
3
- var s = (t, e, r) => (i(t, typeof e != "symbol" ? e + "" : e, r), r);
4
- import o from "./wje-element.js";
5
- const c = ':host{background:transparent;border-radius:0;border-bottom:0;padding:var(--wje-card-header-padding);position:relative;display:flex;flex-direction:column}:host(.wje-separator):after{content:"";height:1px;background:#00000014;margin-top:.5rem}';
6
- class l extends o {
7
- /**
8
- * CardHeader constructor.
9
- */
10
- constructor() {
11
- super();
12
- /**
13
- * Class name for the CardHeader.
14
- * @type {string}
15
- */
16
- s(this, "className", "CardHeader");
17
- }
18
- /**
19
- * Getter for the CSS stylesheet.
20
- * @returns {Object} The styles object.
21
- * @static
22
- */
23
- static get cssStyleSheet() {
24
- return c;
25
- }
26
- /**
27
- * Sets up the attributes for the CardHeader.
28
- */
29
- setupAttributes() {
30
- this.isShadowRoot = "open";
31
- }
32
- /**
33
- * Draws the CardHeader.
34
- * @param {Object} context - The context to draw in.
35
- * @param {Object} store - The store to use.
36
- * @param {Object} params - The parameters to use.
37
- * @returns {DocumentFragment} The created document fragment.
38
- */
39
- draw(r, p, m) {
40
- let a = document.createDocumentFragment(), d = document.createElement("slot");
41
- return this.hasAttribute("separator") && this.classList.add("wje-separator"), a.appendChild(d), a;
42
- }
43
- }
44
- o.define("wje-card-header", l);
45
- export {
46
- l as default
47
- };
@@ -1,55 +0,0 @@
1
- var o = Object.defineProperty;
2
- var l = (e, t, a) => t in e ? o(e, t, { enumerable: !0, configurable: !0, writable: !0, value: a }) : e[t] = a;
3
- var s = (e, t, a) => (l(e, typeof t != "symbol" ? t + "" : t, a), a);
4
- import i from "./wje-element.js";
5
- const c = ":host{transition:opacity .3s ease;font-family:var(--wje-card-subtitle-font-family);font-size:var(--wje-card-subtitle-font-size);text-transform:uppercase;display:inline-block;letter-spacing:.06em;font-weight:500;margin:0;padding:var(--wje-card-subtitle-padding);line-height:normal;overflow:hidden;text-overflow:ellipsis;filter:alpha(opacity=40)}";
6
- class d extends i {
7
- /**
8
- * CardSubtitle constructor.
9
- */
10
- constructor() {
11
- super();
12
- /**
13
- * Class name for the CardSubtitle.
14
- * @type {string}
15
- */
16
- s(this, "className", "CardTitle");
17
- }
18
- /**
19
- * Getter for the CSS stylesheet.
20
- * @returns {Object} The styles object.
21
- * @static
22
- */
23
- static get cssStyleSheet() {
24
- return c;
25
- }
26
- /**
27
- * Getter for the observed attributes.
28
- * @returns {Array} An empty array.
29
- * @static
30
- */
31
- static get observedAttributes() {
32
- return [];
33
- }
34
- /**
35
- * Sets up the attributes for the CardSubtitle.
36
- */
37
- setupAttributes() {
38
- this.isShadowRoot = "open";
39
- }
40
- /**
41
- * Draws the CardSubtitle.
42
- * @param {Object} context - The context to draw in.
43
- * @param {Object} store - The store to use.
44
- * @param {Object} params - The parameters to use.
45
- * @returns {DocumentFragment} The created document fragment.
46
- */
47
- draw(a, m, p) {
48
- let r = document.createDocumentFragment(), n = document.createElement("slot");
49
- return r.appendChild(n), r;
50
- }
51
- }
52
- i.define("wje-card-subtitle", d);
53
- export {
54
- d as default
55
- };
@@ -1,55 +0,0 @@
1
- var l = Object.defineProperty;
2
- var o = (e, t, r) => t in e ? l(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
- var i = (e, t, r) => (o(e, typeof t != "symbol" ? t + "" : t, r), r);
4
- import n from "./wje-element.js";
5
- const d = ":host{font-size:var(--wje-card-title-font-size);font-weight:var(--wje-card-title-font-weight);margin:var(--wje-card-title-margin);padding:var(--wje-card-title-padding);line-height:var(--wje-card-title-line-height);display:block;position:relative}";
6
- class c extends n {
7
- /**
8
- * CardTitle constructor.
9
- */
10
- constructor() {
11
- super();
12
- /**
13
- * Class name for the CardTitle.
14
- * @type {string}
15
- */
16
- i(this, "className", "CardTitle");
17
- }
18
- /**
19
- * Getter for the CSS stylesheet.
20
- * @returns {Object} The styles object.
21
- * @static
22
- */
23
- static get cssStyleSheet() {
24
- return d;
25
- }
26
- /**
27
- * Getter for the observed attributes.
28
- * @returns {Array} An empty array.
29
- * @static
30
- */
31
- static get observedAttributes() {
32
- return [];
33
- }
34
- /**
35
- * Sets up the attributes for the CardTitle.
36
- */
37
- setupAttributes() {
38
- this.isShadowRoot = "open";
39
- }
40
- /**
41
- * Draws the CardTitle.
42
- * @param {Object} context - The context to draw in.
43
- * @param {Object} store - The store to use.
44
- * @param {Object} params - The parameters to use.
45
- * @returns {DocumentFragment} The created document fragment.
46
- */
47
- draw(r, m, g) {
48
- let a = document.createDocumentFragment(), s = document.createElement("slot");
49
- return a.appendChild(s), a;
50
- }
51
- }
52
- n.define("wje-card-title", c);
53
- export {
54
- c as default
55
- };
package/dist/wje-card.js DELETED
@@ -1,50 +0,0 @@
1
- var i = Object.defineProperty;
2
- var s = (o, r, e) => r in o ? i(o, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[r] = e;
3
- var n = (o, r, e) => (s(o, typeof r != "symbol" ? r + "" : r, e), e);
4
- import l from "./wje-element.js";
5
- const w = ":host{width:100%}.native-card{background-color:transparent;margin:0;box-shadow:var(--wje-box-shadow-large);border-color:var(--wje-border-color);border-style:var(--wje-border-style);border-width:var(--wje-border-width);border-radius:var(--wje-border-radius-medium);font-family:var(--wje-font-family);font-size:var(--wje-font-size);line-height:var(--wje-line-height);position:relative;width:100%;word-wrap:normal;display:flex;flex-direction:column;overflow:hidden;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.native-card.wje-color-primary{background:var(--wje-color-primary-11);color:var(--wje-color-contrast-0)}.native-card.wje-color-complete{background:var(--wje-color-complete-11);color:var(--wje-color-contrast-0)}.native-card.wje-color-success{background:var(--wje-color-success-11);color:var(--wje-color-contrast-0)}.native-card.wje-color-warning{background:var(--wje-color-warning-11);color:var(--wje-color)}.native-card.wje-color-danger{background:var(--wje-color-danger-11);color:var(--wje-color-contrast-0)}.native-card.wje-color-info{background:var(--wje-color-info-11);color:var(--wje-color-contrast-0)}.native-card.wje-color-menu{background:var(--wje-color-contrast-11);color:var(--wje-color-contrast-0)}";
6
- class v extends l {
7
- /**
8
- * Card constructor
9
- * @constructor
10
- */
11
- constructor() {
12
- super();
13
- /**
14
- * Class name
15
- * @type {string}
16
- */
17
- n(this, "className", "Card");
18
- }
19
- /**
20
- * Get CSS stylesheet
21
- * @static
22
- * @returns {Object} styles - The CSS styles
23
- */
24
- static get cssStyleSheet() {
25
- return w;
26
- }
27
- /**
28
- * Setup attributes
29
- */
30
- setupAttributes() {
31
- this.isShadowRoot = "open";
32
- }
33
- /**
34
- * Draw method
35
- * @param {Object} context - The context
36
- * @param {Object} store - The store
37
- * @param {Object} params - The parameters
38
- * @returns {Object} fragment - The document fragment
39
- */
40
- draw(e, j, t) {
41
- let c = document.createDocumentFragment(), a = document.createElement("div");
42
- a.setAttribute("part", "native"), a.classList.add("native-card");
43
- let d = document.createElement("slot");
44
- return t.color && a.classList.add("wje-color-" + t.color), a.appendChild(d), c.appendChild(a), c;
45
- }
46
- }
47
- l.define("wje-card", v);
48
- export {
49
- v as default
50
- };
@@ -1,33 +0,0 @@
1
- var o = Object.defineProperty;
2
- var c = (t, e, a) => e in t ? o(t, e, { enumerable: !0, configurable: !0, writable: !0, value: a }) : t[e] = a;
3
- var r = (t, e, a) => (c(t, typeof e != "symbol" ? e + "" : e, a), a);
4
- import l, { event as d } from "./wje-element.js";
5
- const m = ":host{display:flex;align-items:center;justify-content:center;flex-direction:column;width:var(--wje-carousel-size, 100%);max-height:100%;aspect-ratio:var(--wje-carousel-item-aspect-ratio);scroll-snap-align:center;scroll-snap-stop:always}.native-carousel-item{width:100%;height:100%;display:flex}::slotted(wje-img){width:100%!important;height:100%!important;object-fit:contain;display:flex}";
6
- class u extends l {
7
- constructor() {
8
- super();
9
- r(this, "className", "CarouselItem");
10
- }
11
- static get cssStyleSheet() {
12
- return m;
13
- }
14
- static get observedAttributes() {
15
- return [];
16
- }
17
- setupAttributes() {
18
- this.isShadowRoot = "open";
19
- }
20
- draw(a, p, h) {
21
- let i = document.createDocumentFragment(), s = document.createElement("div");
22
- s.classList.add("native-carousel-item"), s.setAttribute("part", "native");
23
- let n = document.createElement("slot");
24
- return s.appendChild(n), i.appendChild(s), i;
25
- }
26
- afterDraw() {
27
- d.addListener(this, "click", "wje-carousel-item:click");
28
- }
29
- }
30
- l.define("wje-carousel-item", u);
31
- export {
32
- u as default
33
- };
@@ -1,177 +0,0 @@
1
- var v = Object.defineProperty;
2
- var p = (o, a, e) => a in o ? v(o, a, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[a] = e;
3
- var u = (o, a, e) => (p(o, typeof a != "symbol" ? a + "" : a, e), e);
4
- import m from "./wje-element.js";
5
- const b = ".native-carousel{position:relative;width:var(--wje-carousel-width, 100%);height:var(--wje-carousel-height, 300px);scroll-behavior:smooth}.carousel-slides{display:flex;transition:transform .5s ease;align-items:center;justify-items:center;overflow:auto;overscroll-behavior-x:contain;scrollbar-width:none;-ms-overflow-style:none;aspect-ratio:var(--wje-aspect-ratio, 4 / 3);scroll-snap-type:x mandatory;scroll-padding-inline:0;overflow-y:hidden;padding-inline:var(--wje-spacing-inline, 0);gap:.5rem}.carousel-slides::-webkit-scrollbar{display:none}::slotted(wje-carousel-item){flex:0 0 var(--wje-carousel-size);height:100%}wje-button{position:absolute;top:50%;border:none;cursor:pointer;z-index:2}.prev{left:-1rem;transform:translate(-100%,-50%)}.next{right:-1rem;transform:translate(100%,-50%)}.pagination{position:relative;bottom:-.5rem;left:50%;transform:translate(-50%,100%);display:flex;z-index:2;justify-content:center}.pagination-item{cursor:pointer;height:15px;width:15px;margin:0 2px;background-color:var(--wje-color-contrast-4);display:inline-block;border-radius:50%}.pagination-item.active{background-color:var(--wje-color)}.thumbnails{display:flex;justify-content:center;align-items:center;overflow-x:auto;gap:.5rem;padding:0 .5rem;margin-top:.5rem;margin-bottom:.5rem;box-sizing:border-box;overflow-y:hidden}.thumbnails wje-thumbnail{--wje-thumbnail-width: 48px;--wje-thumbnail-height: 48px;--wje-thumbnail-border-radius: 0;cursor:pointer;border:1px solid transparent}.thumbnails .active{border:1px solid var(--wje-color-primary-11)}";
6
- class f extends m {
7
- constructor() {
8
- super();
9
- u(this, "className", "Carousel");
10
- this.slidePerPage = 1;
11
- }
12
- set activeSlide(e) {
13
- this.setAttribute("active-slide", e);
14
- }
15
- get activeSlide() {
16
- return +this.getAttribute("active-slide") || 0;
17
- }
18
- get pagination() {
19
- return this.hasAttribute("pagination");
20
- }
21
- get navigation() {
22
- return this.hasAttribute("navigation");
23
- }
24
- get thumbnails() {
25
- return this.hasAttribute("thumbnails");
26
- }
27
- get loop() {
28
- return this.hasAttribute("loop");
29
- }
30
- static get cssStyleSheet() {
31
- return b;
32
- }
33
- static get observedAttributes() {
34
- return ["active-slide"];
35
- }
36
- attributeChangedCallback(e, i, n) {
37
- e === "active-slide" && (this.pagination && this.changePagination(), this.thumbnails && this.changeThumbnails());
38
- }
39
- setupAttributes() {
40
- this.isShadowRoot = "open";
41
- }
42
- beforeDraw(e, i, n) {
43
- this.cloneFirstAndLastItems();
44
- }
45
- draw(e, i, n) {
46
- let r = document.createDocumentFragment(), t = document.createElement("div");
47
- t.classList.add("native-carousel");
48
- let s = document.createElement("div");
49
- s.classList.add("carousel-slides");
50
- let l = document.createElement("slot");
51
- return s.appendChild(l), t.appendChild(s), this.navigation && (this.prevButton = this.createPreviousButton(), this.nextButton = this.createNextButton(), t.appendChild(this.prevButton), t.appendChild(this.nextButton)), this.pagination && t.appendChild(this.createPagination()), this.thumbnails && t.appendChild(this.createThumbnails()), r.appendChild(t), this.slides = s, r;
52
- }
53
- afterDraw() {
54
- this.setIntersectionObserver(), this.getSlidesWithClones().forEach((i, n) => {
55
- this.intersectionObserver.observe(i);
56
- }), this.slidePerPage = this.getAttribute("slide-per-page") || 1;
57
- let e = 100 / +this.slidePerPage;
58
- this.style.setProperty("--wje-carousel-size", e + "%"), this.goToSlide(this.activeSlide, "auto"), this.slides.addEventListener("scrollend", (i) => {
59
- const n = this.getSlides(), t = [...this.entriesMap.values()].find((s) => s.isIntersecting);
60
- if (t != null && t.target.classList.contains("clone")) {
61
- const s = +t.target.getAttribute("clone-index");
62
- this.goToSlide(s, "auto"), this.activeSlide = s;
63
- } else if (t) {
64
- let s = n.indexOf(t.target);
65
- this.activeSlide = s;
66
- }
67
- });
68
- }
69
- setIntersectionObserver() {
70
- this.intersectionObserver = new IntersectionObserver((e) => {
71
- e.forEach((i) => {
72
- this.entriesMap.set(i.target, i);
73
- });
74
- }, {
75
- root: this.context.querySelector(".carousel-slides"),
76
- threshold: 0.5
77
- }), this.entriesMap = /* @__PURE__ */ new Map(), this.records = this.intersectionObserver.takeRecords(), this.records.forEach((e) => {
78
- this.entriesMap.set(e.target, e);
79
- });
80
- }
81
- goToSlide(e, i = "smooth", n = !0) {
82
- const r = this.getSlides(), t = this.getSlidesWithClones();
83
- t.forEach((g, S) => {
84
- g.classList.remove("active");
85
- });
86
- let s = this.loop ? (e + r.length) % r.length : Math.min(Math.max(e, 0), r.length - 1);
87
- this.activeSlide = s;
88
- const l = Math.min(Math.max(e + (this.loop ? this.slidePerPage : 0), 0), t.length - 1), c = this.getSlidesWithClones()[l];
89
- c.classList.add("active");
90
- let d = c.getBoundingClientRect(), h = this.slides.getBoundingClientRect();
91
- this.slides.scrollTo({
92
- left: d.left - h.left + this.slides.scrollLeft,
93
- top: d.top - h.top + this.slides.scrollTop,
94
- behavior: i === "smooth" ? "smooth" : "auto"
95
- }), this.navigation && !this.loop && (this.nextButton.removeAttribute("disabled"), this.prevButton.removeAttribute("disabled"), this.activeSlide === r.length - 1 && this.nextButton.setAttribute("disabled", ""), this.activeSlide === 0 && this.prevButton.setAttribute("disabled", ""));
96
- }
97
- cloneFirstAndLastItems() {
98
- const e = this.getSlides();
99
- if (e.length && this.loop) {
100
- const i = e[0].cloneNode(!0);
101
- i.classList.add("clone"), i.setAttribute("clone-index", 0), this.appendChild(i);
102
- const n = e[e.length - 1].cloneNode(!0);
103
- n.classList.add("clone"), n.setAttribute("clone-index", e.length - 1), this.insertBefore(n, this.firstChild);
104
- }
105
- }
106
- removeActiveSlide() {
107
- this.getSlidesWithClones().forEach((e, i) => {
108
- e.classList.remove("active");
109
- }), this.pagination && this.context.querySelectorAll(".pagination-item").forEach((e) => {
110
- e.classList.remove("active");
111
- }), this.thumbnails && this.context.querySelectorAll("wje-thumbnail").forEach((e) => {
112
- e.classList.remove("active");
113
- });
114
- }
115
- changePagination() {
116
- this.pagination && (this.removeActiveSlide(), this.context.querySelectorAll(".pagination-item").forEach((e, i) => {
117
- i === this.activeSlide && e.classList.add("active");
118
- }));
119
- }
120
- changeThumbnails() {
121
- this.thumbnails && (this.removeActiveSlide(), this.context.querySelectorAll("wje-thumbnail").forEach((e, i) => {
122
- i === this.activeSlide && e.classList.add("active");
123
- }));
124
- }
125
- createNextButton() {
126
- const e = document.createElement("wje-button");
127
- return e.classList.add("next"), e.innerHTML = '<wje-icon name="chevron-right" size="large"></wje-icon>', e.setAttribute("circle", ""), e.setAttribute("fill", "link"), e.addEventListener("click", (i) => {
128
- this.nextSlide();
129
- }), e;
130
- }
131
- createPreviousButton() {
132
- const e = document.createElement("wje-button");
133
- return e.classList.add("prev"), e.innerHTML = '<wje-icon name="chevron-left" size="large"></wje-icon>', e.setAttribute("circle", ""), e.setAttribute("fill", "link"), e.addEventListener("click", (i) => {
134
- this.previousSlide();
135
- }), e;
136
- }
137
- createPagination() {
138
- const e = document.createElement("div");
139
- return e.classList.add("pagination"), this.getSlides().forEach((n, r) => {
140
- const t = document.createElement("div");
141
- t.classList.add("pagination-item"), t.addEventListener("click", (s) => {
142
- this.removeActiveSlide(), s.target.classList.add("active"), this.goToSlide(r);
143
- }), e.appendChild(t);
144
- }), e;
145
- }
146
- createThumbnails() {
147
- const e = document.createElement("div");
148
- return e.classList.add("thumbnails"), this.getSlides().forEach((n, r) => {
149
- const t = document.createElement("wje-thumbnail");
150
- t.innerHTML = `<img src="${n.querySelector("wje-img").getAttribute("src")}"></img>`, t.addEventListener("click", (s) => {
151
- this.removeActiveSlide(), s.target.closest("wje-thumbnail").classList.add("active"), this.goToSlide(r);
152
- }), e.appendChild(t);
153
- }), e;
154
- }
155
- nextSlide() {
156
- this.goToSlide(this.activeSlide + this.slidePerPage);
157
- }
158
- previousSlide() {
159
- this.goToSlide(this.activeSlide - this.slidePerPage);
160
- }
161
- getSlides() {
162
- return Array.from(this.querySelectorAll("wje-carousel-item:not(.clone)"));
163
- }
164
- getSlidesWithClones() {
165
- return Array.from(this.querySelectorAll("wje-carousel-item"));
166
- }
167
- canGoNext() {
168
- return this.querySelector(".native-carousel").scrollLeft < this.querySelector(".native-carousel").scrollWidth;
169
- }
170
- canGoPrevious() {
171
- return this.querySelector(".native-carousel").scrollLeft > 0;
172
- }
173
- }
174
- m.define("wje-carousel", f);
175
- export {
176
- f as default
177
- };
@@ -1,104 +0,0 @@
1
- var s = Object.defineProperty;
2
- var h = (c, t, e) => t in c ? s(c, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : c[t] = e;
3
- var l = (c, t, e) => (h(c, typeof t != "symbol" ? t + "" : t, e), e);
4
- import b, { event as a } from "./wje-element.js";
5
- const d = ':host{display:block;margin-top:var(--wje-checkbox-margin-top);margin-bottom:var(--wje-checkbox-margin-bottom);margin-inline:var(--wje-checkbox-margin-inline);line-height:100%;padding-left:0}:host label{display:inline-block;cursor:pointer;position:relative;padding-left:25px;min-width:var(--wje-checkbox-width);min-height:var(--wje-checkbox-height);margin-bottom:0;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}:host label:before{content:"";position:absolute;width:16px;height:16px;left:0;-webkit-box-sizing:inherit;box-sizing:border-box;background-color:var(--wje-color-contrast-lowest);border:1px solid var(--wje-border-color)}.native-checkbox label{transition:border .14s linear 0s,color .14s linear 0s,background-color .14s linear 0s}.native-checkbox label:hover{color:var(--wje-color-contrast-11)}.native-checkbox label:before{border-radius:3px;transition:border .14s linear 0s,color .14s linear 0s,background-color .14s linear 0s}.native-checkbox input[type=checkbox]{position:absolute;margin:0;z-index:-1;width:16px;height:16px;opacity:0;display:none}.native-checkbox input[type=checkbox]+label:after{content:"";position:absolute;left:0;border-right:0 solid transparent;border-bottom:0 solid transparent;width:16px;height:16px;overflow:hidden}.native-checkbox.checkbox-circle label:after{border-radius:99px}.native-checkbox.checkbox-circle label:before{border-radius:99px}.native-checkbox input[type=checkbox]:checked+label:after{content:"";background:var(--wje-grey-check-icon);background-size:160px 16px;background-repeat:no-repeat;animation-name:checkbox-check;animation-duration:.32s;animation-timing-function:steps(9);animation-fill-mode:forwards;animation-iteration-count:1}.native-checkbox input[type=checkbox]:hover:active:not(:checked)+label:before{background-color:#00000014}.native-checkbox input[type=checkbox]:focus+label{color:var(--wje-color-contrast-11)}.native-checkbox input[type=checkbox]:focus+label:before{outline:none!important;box-shadow:#78c8fe 0 0}.native-checkbox input[type=checkbox][disabled]+label{cursor:not-allowed!important;color:var(--wje-color-contrast-8);opacity:.58}.native-checkbox input[type=checkbox][disabled]+label:before{cursor:not-allowed!important;background:#ececec}.native-checkbox input[type=checkbox]:indeterminate+label:after{background:none;background-color:var(--wje-color-contrast-8);width:10px;height:2px;top:6px;margin:3px;border-radius:2px}.native-checkbox.right label{padding-left:0;padding-right:26px}.native-checkbox.right label:before{right:0;left:auto}.native-checkbox.right input[type=checkbox]:checked+label{position:relative}.native-checkbox.right input[type=checkbox]:checked+label:after{position:absolute;right:0;left:auto}.success :is(input[type=checkbox]:checked+label):before,.success :is(input[type=checkbox]:indeterminate+label):before{border-color:var(--wje-color-success);background-color:var(--wje-color-success)}.primary :is(input[type=checkbox]:checked+label):before,.primary :is(input[type=checkbox]:indeterminate+label):before{border-color:var(--wje-color-primary);background-color:var(--wje-color-primary)}.complete :is(input[type=checkbox]:checked+label):before,.complete :is(input[type=checkbox]:indeterminate+label):before{border-color:var(--wje-color-complete);background-color:var(--wje-color-complete)}.warning :is(input[type=checkbox]:checked+label):before,.warning :is(input[type=checkbox]:indeterminate+label):before{border-color:var(--wje-color-warning);background-color:var(--wje-color-warning)}.danger :is(input[type=checkbox]:checked+label):before,.danger :is(input[type=checkbox]:indeterminate+label):before{border-color:var(--wje-color-danger);background-color:var(--wje-color-danger)}.info :is(input[type=checkbox]:checked+label):before,.info :is(input[type=checkbox]:indeterminate+label):before{border-color:var(--wje-color-info);background-color:var(--wje-color-info)}.info :is(input[type=checkbox]:checked+label):after,.danger :is(input[type=checkbox]:checked+label):after,.complete :is(input[type=checkbox]:checked+label):after,.primary :is(input[type=checkbox]:checked+label):after,.success :is(input[type=checkbox]:checked+label):after{background:var(--wje-white-check-icon)}.info :is(input[type=checkbox]:indeterminate+label):after,.danger :is(input[type=checkbox]:indeterminate+label):after,.complete :is(input[type=checkbox]:indeterminate+label):after,.primary :is(input[type=checkbox]:indeterminate+label):after,.success :is(input[type=checkbox]:indeterminate+label):after{background-color:var(--wje-color-contrast-lowest)}@keyframes shrink-bounce{0%{transform:scale(1)}33%{transform:scale(.85)}to{transform:scale(1)}}@keyframes checkbox-check{0%{background-position:0}to{background-position:-144px}}.js-focus-visible .native-checkbox input[type=checkbox]:focus:not(.focus-visible)+label:before{box-shadow:none}input[type=checkbox]{accent-color:var(--wje-color-primary)!important;font-size:50px}';
6
- class p extends b {
7
- /**
8
- * Checkbox constructor.
9
- */
10
- constructor() {
11
- super();
12
- /**
13
- * The class name.
14
- */
15
- l(this, "className", "Checkbox");
16
- }
17
- /**
18
- * @summary Set checked attribute
19
- * @returns {boolean} true if the toggle is checked, false otherwise
20
- */
21
- set disabled(e) {
22
- e ? this.setAttribute("disabled", "") : this.removeAttribute("disabled");
23
- }
24
- /**
25
- * @summary Get disabled attribute
26
- * @returns {boolean} true if the toggle is disabled, false otherwise
27
- */
28
- get disabled() {
29
- return this.hasAttribute("disabled");
30
- }
31
- /**
32
- * @summary Set checked attribute
33
- * @returns {boolean} true if the toggle is checked, false otherwise
34
- */
35
- set checked(e) {
36
- e ? this.setAttribute("checked", "") : this.removeAttribute("checked");
37
- }
38
- /**
39
- * @summary Get checked attribute
40
- * @returns {boolean} true if the toggle is checked, false otherwise
41
- */
42
- get checked() {
43
- return this.hasAttribute("checked");
44
- }
45
- /**
46
- * Getter for the CSS stylesheet.
47
- * @returns {string} The CSS stylesheet.
48
- */
49
- static get cssStyleSheet() {
50
- return d;
51
- }
52
- static get observedAttributes() {
53
- return ["checked", "disabled"];
54
- }
55
- /**
56
- * Sets up the attributes for the checkbox.
57
- */
58
- setupAttributes() {
59
- this.isShadowRoot = "open";
60
- }
61
- /**
62
- * Draws the checkbox.
63
- * @param {object} context - The context.
64
- * @param {object} store - The store.
65
- * @param {object} params - The parameters.
66
- * @returns {DocumentFragment} The created fragment.
67
- */
68
- draw(e, k, u) {
69
- let n = document.createDocumentFragment(), i = document.createElement("div");
70
- i.classList.add("native-checkbox"), this.variant === "circle" && i.classList.add("checkbox-circle"), this.color && i.classList.add(this.color);
71
- let o = document.createElement("input");
72
- o.type = "checkbox", o.id = "checkbox", o.name = this.name = "checkbox", o.checked = this.hasAttribute("checked"), o.disabled = this.hasAttribute("disabled"), o.indeterminate = this.hasAttribute("indeterminate");
73
- let r = document.createElement("label");
74
- return r.htmlFor = "checkbox", r.innerHTML = "<slot></slot>", i.appendChild(o), i.appendChild(r), this.input = o, n.appendChild(i), n;
75
- }
76
- /**
77
- * Adds an event listener after drawing the checkbox.
78
- */
79
- afterDraw() {
80
- this.disabled || (this.input.addEventListener("input", (e) => {
81
- this.checked = e.target.checked, a.dispatchCustomEvent(this, "wje-toggle:input");
82
- }), this.input.addEventListener("change", (e) => {
83
- this.checked = e.target.checked, a.dispatchCustomEvent(this, "wje-toggle:change");
84
- }));
85
- }
86
- /**
87
- * Handles the input event.
88
- * @param {Event} e - The event.
89
- */
90
- // inputEvent = (e) => {
91
- // this.checked = this.input.checked;
92
- // event.dispatchCustomEvent(this, "wje-checkbox:change");
93
- // }
94
- /**
95
- * Removes the event listener when the checkbox is disconnected.
96
- */
97
- disconnectedCallback() {
98
- a.removeElement(this.input);
99
- }
100
- }
101
- b.define("wje-checkbox", p);
102
- export {
103
- p as default
104
- };
package/dist/wje-chip.js DELETED
@@ -1,32 +0,0 @@
1
- var d = Object.defineProperty;
2
- var p = (o, e, t) => e in o ? d(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
3
- var n = (o, e, t) => (p(o, typeof e != "symbol" ? e + "" : e, t), t);
4
- import l, { event as w } from "./wje-element.js";
5
- const h = ".native-chip{display:inline-flex;justify-content:center;align-items:center;font-size:14px;letter-spacing:-.006em;margin:0;padding:.5rem .75rem;text-align:center;cursor:pointer;white-space:nowrap;background-color:var(--wje-color-contrast-2, #fff);color:var(--wje-color-contrast-6);text-shadow:none;box-shadow:none;border:0 none;line-height:14px;min-height:28px;height:28px;width:100%;max-width:fit-content;min-width:28px;position:relative;transition:width .15s cubic-bezier(.4,0,.2,1);border-radius:var(--wje-border-radius-pill);overflow:hidden;vertical-align:middle;box-sizing:border-box}.native-chip.wje-color-primary{background-color:var(--wje-color-primary-11);color:var(--wje-color-contrast-0)}.native-chip.wje-color-complete{background-color:var(--wje-color-complete-11);color:var(--wje-color-contrast-0)}.native-chip.wje-color-success{background-color:var(--wje-color-success-11);color:var(--wje-color-contrast-0)}.native-chip.wje-color-warning{background-color:var(--wje-color-warning-11);color:var(--wje-color)}.native-chip.wje-color-danger{background-color:var(--wje-color-danger-11);color:var(--wje-color-contrast-0)}.native-chip.wje-color-info{background-color:var(--wje-color-info-11);color:var(--wje-color-contrast-0)}.native-chip.wje-color-menu{background-color:var(--wje-color-contrast-11);color:var(--wje-color-contrast-0)}:host(.focus){box-shadow:none}:host(.wje-active) .native-chip{border:1px solid var(--wje-color-primary-11);background-color:var(--wje-color-contrast-3);color:var(--wje-color)}:host(:focus,:active:focus,.wje-active:focus){outline:none!important}.check{display:none}:host([active]) .check{display:block;margin-inline:4px 0}:host([disabled]){opacity:.5;border:0;pointer-events:none;cursor:not-allowed}::slotted(wje-avatar){width:22px;height:22px}::slotted(wje-avatar:first-child){margin-inline:-8px 8px;margin-top:-4px;margin-bottom:-4px}::slotted(wje-icon:first-child){margin:-4px 8px -4px -4px}::slotted(wje-icon:last-child){margin:-4px -4px -4px 8px}wje-button{--wje-button-border-radius: 50%;--wje-button-margin-inline: .25rem -.5rem;--wje-padding-top: .15rem;--wje-padding-start: .15rem;--wje-padding-end: .15rem;--wje-padding-bottom: .15rem}";
6
- class m extends l {
7
- constructor() {
8
- super();
9
- n(this, "className", "Chip");
10
- }
11
- static get cssStyleSheet() {
12
- return h;
13
- }
14
- setupAttributes() {
15
- this.isShadowRoot = "open";
16
- }
17
- draw(t, j, v) {
18
- let a = document.createDocumentFragment(), r = document.createElement("div");
19
- r.classList.add("native-chip");
20
- let s = document.createElement("slot"), i = document.createElement("wje-button");
21
- i.setAttribute("part", "remove"), i.setAttribute("fill", "link"), i.innerHTML = '<wje-icon name="x"></wje-icon>';
22
- let c = document.createElement("wje-icon");
23
- return c.setAttribute("name", "check"), c.classList.add("check"), this.color && r.classList.add("wje-color-" + this.color, "wje-color"), this.disabled && this.classList.add("wje-disabled"), this.outline && this.classList.add("wje-outline"), r.appendChild(s), r.appendChild(c), this.hasAttribute("removable") && r.appendChild(i), a.appendChild(r), this.remove = i, a;
24
- }
25
- afterDraw() {
26
- w.addListener(this.remove, "click", "wje:chip-remove", null, { stopPropagation: !0 });
27
- }
28
- }
29
- l.define("wje-chip", m);
30
- export {
31
- m as default
32
- };