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.
- package/package.json +1 -1
- package/dist/dark.css +0 -1
- package/dist/light.css +0 -1
- package/dist/localize-DVuO3S17.js +0 -43
- package/dist/popup.element-CpEjis9f.js +0 -1068
- package/dist/router-links-FtZbFUto.js +0 -146
- package/dist/styles.css +0 -1
- package/dist/wje-accordion-item.js +0 -88
- package/dist/wje-accordion.js +0 -79
- package/dist/wje-animation.js +0 -121
- package/dist/wje-aside.js +0 -55
- package/dist/wje-avatar.js +0 -74
- package/dist/wje-badge.js +0 -50
- package/dist/wje-breadcrumb.js +0 -148
- package/dist/wje-breadcrumbs.js +0 -67
- package/dist/wje-button-group.js +0 -78
- package/dist/wje-button.js +0 -175
- package/dist/wje-card-content.js +0 -48
- package/dist/wje-card-controls.js +0 -48
- package/dist/wje-card-header.js +0 -47
- package/dist/wje-card-subtitle.js +0 -55
- package/dist/wje-card-title.js +0 -55
- package/dist/wje-card.js +0 -50
- package/dist/wje-carousel-item.js +0 -33
- package/dist/wje-carousel.js +0 -177
- package/dist/wje-checkbox.js +0 -104
- package/dist/wje-chip.js +0 -32
- package/dist/wje-col.js +0 -27
- package/dist/wje-color-picker.js +0 -953
- package/dist/wje-container.js +0 -57
- package/dist/wje-copy-button.js +0 -164
- package/dist/wje-dialog.js +0 -86
- package/dist/wje-divider.js +0 -53
- package/dist/wje-dropdown.js +0 -68
- package/dist/wje-element.js +0 -453
- package/dist/wje-fetchAndParseCSS.js +0 -40
- package/dist/wje-file-upload-item.js +0 -115
- package/dist/wje-file-upload.js +0 -297
- package/dist/wje-footer.js +0 -56
- package/dist/wje-form.js +0 -28
- package/dist/wje-format-digital.js +0 -85
- package/dist/wje-grid.js +0 -28
- package/dist/wje-header.js +0 -58
- package/dist/wje-icon-picker.js +0 -221
- package/dist/wje-icon.js +0 -119
- package/dist/wje-img-comparer.js +0 -111
- package/dist/wje-img.js +0 -58
- package/dist/wje-infinite-scroll.js +0 -193
- package/dist/wje-inline-edit.js +0 -120
- package/dist/wje-input-file.js +0 -85
- package/dist/wje-input.js +0 -240
- package/dist/wje-item.js +0 -45
- package/dist/wje-label.js +0 -67
- package/dist/wje-list.js +0 -53
- package/dist/wje-main.js +0 -56
- package/dist/wje-masonry.js +0 -218
- package/dist/wje-master.js +0 -196
- package/dist/wje-menu-button.js +0 -65
- package/dist/wje-menu-item.js +0 -192
- package/dist/wje-menu-label.js +0 -57
- package/dist/wje-menu.js +0 -74
- package/dist/wje-option.js +0 -99
- package/dist/wje-options.js +0 -63
- package/dist/wje-popup.js +0 -5
- package/dist/wje-progress-bar.js +0 -145
- package/dist/wje-radio-group.js +0 -101
- package/dist/wje-radio.js +0 -46
- package/dist/wje-rate.js +0 -260
- package/dist/wje-relative-time.js +0 -85
- package/dist/wje-reorder-dropzone.js +0 -27
- package/dist/wje-reorder-item.js +0 -32
- package/dist/wje-reorder.js +0 -132
- package/dist/wje-route.js +0 -28
- package/dist/wje-router-link.js +0 -64
- package/dist/wje-router-outlet.js +0 -127
- package/dist/wje-routerx.js +0 -1088
- package/dist/wje-row.js +0 -58
- package/dist/wje-select.js +0 -240
- package/dist/wje-slider.js +0 -177
- package/dist/wje-split-view.js +0 -112
- package/dist/wje-store.js +0 -192
- package/dist/wje-tab-group.js +0 -105
- package/dist/wje-tab-panel.js +0 -52
- package/dist/wje-tab.js +0 -59
- package/dist/wje-textarea.js +0 -116
- package/dist/wje-thumbnail.js +0 -64
- package/dist/wje-toast.js +0 -76
- package/dist/wje-toggle.js +0 -94
- package/dist/wje-toolbar-action.js +0 -63
- package/dist/wje-toolbar.js +0 -61
- package/dist/wje-tooltip.js +0 -105
- package/dist/wje-visually-hidden.js +0 -56
package/dist/wje-aside.js
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
var a = Object.defineProperty;
|
|
2
|
-
var h = (t, e, i) => e in t ? a(t, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : t[e] = i;
|
|
3
|
-
var s = (t, e, i) => (h(t, typeof e != "symbol" ? e + "" : e, i), i);
|
|
4
|
-
import l from "./wje-element.js";
|
|
5
|
-
const n = ':host{--wje-aside-width: "100px";--wje-aside-top: 0;--wje-aside-border-color: var(--wje-border-color);--wje-aside-border-width: 0 1px 0 0;--wje-aside-border-style: solid;box-sizing:border-box;flex-shrink:0;overflow:auto;border-color:var(--wje-aside-border-color);border-width:var(--wje-aside-border-width);border-style:var(--wje-aside-border-style)}:host(.open){display:block!important}@media (min-width: 768px){:host([fixed]){position:fixed;width:var(--wje-aside-width);top:var(--wje-aside-top);height:calc(100% - var(--wje-aside-top))}}@media (max-width: 768px){:host{display:none}:host([variant=top-start]){position:fixed;top:0;left:0;width:80%;height:100%;z-index:9999;background-color:#fff}}';
|
|
6
|
-
class r extends l {
|
|
7
|
-
/**
|
|
8
|
-
* Constructor for the Aside class.
|
|
9
|
-
*/
|
|
10
|
-
constructor() {
|
|
11
|
-
super();
|
|
12
|
-
/**
|
|
13
|
-
* The class name for the Aside element ddddd.
|
|
14
|
-
* @type {string}
|
|
15
|
-
*/
|
|
16
|
-
s(this, "className", "Aside");
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Getter for the CSS stylesheet.
|
|
20
|
-
* @return {Object} The styles for the Aside element.
|
|
21
|
-
*/
|
|
22
|
-
static get cssStyleSheet() {
|
|
23
|
-
return n;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Getter for the observed attributes.
|
|
27
|
-
* @return {Array} An empty array as there are no observed attributes.
|
|
28
|
-
*/
|
|
29
|
-
static get observedAttributes() {
|
|
30
|
-
return [];
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Method to setup attributes for the Aside element.
|
|
34
|
-
*/
|
|
35
|
-
setupAttributes() {
|
|
36
|
-
this.isShadowRoot = "open";
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Method to draw the Aside element.
|
|
40
|
-
* @param {Object} context - The context in which the element is drawn.
|
|
41
|
-
* @param {Object} store - The store containing the state of the element.
|
|
42
|
-
* @param {Object} params - The parameters for drawing the element.
|
|
43
|
-
* @return {Object} The document fragment containing the drawn element.
|
|
44
|
-
*/
|
|
45
|
-
draw(i, w, p) {
|
|
46
|
-
let o = document.createDocumentFragment();
|
|
47
|
-
this.width && this.style.setProperty("--wje-aside-width", this.width), this.top && this.hasAttribute("fixed") && this.style.setProperty("--wje-aside-top", this.top);
|
|
48
|
-
let d = document.createElement("slot");
|
|
49
|
-
return o.appendChild(d), o;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
r.define("wje-aside", r);
|
|
53
|
-
export {
|
|
54
|
-
r as default
|
|
55
|
-
};
|
package/dist/wje-avatar.js
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
var u = Object.defineProperty;
|
|
2
|
-
var w = (a, e, t) => e in a ? u(a, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[e] = t;
|
|
3
|
-
var c = (a, e, t) => (w(a, typeof e != "symbol" ? e + "" : e, t), t);
|
|
4
|
-
import p from "./wje-element.js";
|
|
5
|
-
function m(a, e = 30, t = 80) {
|
|
6
|
-
let s = a, i = 0;
|
|
7
|
-
for (let o = 0; o < (s == null ? void 0 : s.length); o++)
|
|
8
|
-
i = s.charCodeAt(o) + ((i << 5) - i);
|
|
9
|
-
return "hsl(" + i % 360 + ", " + e + "%, " + t + "%)";
|
|
10
|
-
}
|
|
11
|
-
function g(a, e = 2) {
|
|
12
|
-
let t = a.split(" "), s = t[0].substring(0, 1).toUpperCase();
|
|
13
|
-
return t.length > 1 && e > 1 && (s += t[t.length - 1].substring(0, 1).toUpperCase()), s;
|
|
14
|
-
}
|
|
15
|
-
const b = ":host{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{position:relative;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([slot=status]){display:flex;position:absolute;bottom:-4px;right:-4px}::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}";
|
|
16
|
-
class v extends p {
|
|
17
|
-
/**
|
|
18
|
-
* Avatar class constructor
|
|
19
|
-
*/
|
|
20
|
-
constructor() {
|
|
21
|
-
super();
|
|
22
|
-
/**
|
|
23
|
-
* Class name
|
|
24
|
-
*/
|
|
25
|
-
c(this, "className", "Avatar");
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Getter for cssStyleSheet
|
|
29
|
-
* @returns {string} styles
|
|
30
|
-
*/
|
|
31
|
-
static get cssStyleSheet() {
|
|
32
|
-
return b;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Method to setup attributes
|
|
36
|
-
*/
|
|
37
|
-
setupAttributes() {
|
|
38
|
-
this.isShadowRoot = "open";
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Method to draw the avatar
|
|
42
|
-
* @param {object} context - The context
|
|
43
|
-
* @param {object} store - The store
|
|
44
|
-
* @param {object} params - The parameters
|
|
45
|
-
* @returns {object} fragment - The document fragment
|
|
46
|
-
*/
|
|
47
|
-
draw(t, s, i) {
|
|
48
|
-
let n = document.createDocumentFragment(), r = document.createElement("div");
|
|
49
|
-
r.setAttribute("part", "native"), r.classList.add("native-avatar"), this.size && this.classList.add("wje-avatar-" + this.size);
|
|
50
|
-
let o = document.createElement("slot");
|
|
51
|
-
if (r.appendChild(o), this.hasAttribute("initials")) {
|
|
52
|
-
let l = g(this.label);
|
|
53
|
-
this.setAttribute("style", `--wje-avatar-background-color: ${m(l)}`), r.innerText = l;
|
|
54
|
-
} else {
|
|
55
|
-
let l = document.createElement("slot");
|
|
56
|
-
l.setAttribute("name", "icon"), r.appendChild(l);
|
|
57
|
-
}
|
|
58
|
-
let d = document.createElement("slot");
|
|
59
|
-
d.setAttribute("name", "status"), d.setAttribute("part", "status");
|
|
60
|
-
let h = document.createElement("slot");
|
|
61
|
-
return h.setAttribute("name", "secondary"), h.setAttribute("part", "secondary"), r.appendChild(d), r.appendChild(h), n.appendChild(r), n;
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Method to check if the avatar is an image
|
|
65
|
-
* @returns {boolean} - True if the avatar is an image, false otherwise
|
|
66
|
-
*/
|
|
67
|
-
isImage() {
|
|
68
|
-
return this.getElementsByTagName("wje-img").length > 0;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
v.define("wje-avatar", v);
|
|
72
|
-
export {
|
|
73
|
-
v as default
|
|
74
|
-
};
|
package/dist/wje-badge.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
var s = Object.defineProperty;
|
|
2
|
-
var d = (r, o, e) => o in r ? s(r, o, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[o] = e;
|
|
3
|
-
var c = (r, o, e) => (d(r, typeof o != "symbol" ? o + "" : o, e), e);
|
|
4
|
-
import i from "./wje-element.js";
|
|
5
|
-
const w = ".native-badge{display:inline-block;text-shadow:none;font-family:var(--wje-font-family);font-weight:600;background-color:var(--wje-color-contrast-low);font-size:11px;line-height:1;padding-block:var(--wje-badge-padding-block-start) var(--wje-badge-padding-block-end);padding-inline:var(--wje-badge-padding-inline-start) var(--wje-badge-padding-inline-end);color:var(--wje-color-contrast-8);border-radius:var(--wje-badge-border-radius)}.wje-color-primary{background-color:var(--wje-color-primary-11);color:var(--wje-color-contrast-lowest)}.wje-color-complete{background-color:var(--wje-color-complete-11);color:var(--wje-color-contrast-lowest)}.wje-color-success{background-color:var(--wje-color-success-11);color:var(--wje-color-contrast-0)}.wje-color-warning{background-color:var(--wje-color-warning-11);color:var(--wje-color-contrast-8)}.wje-color-danger{background-color:var(--wje-color-danger-11);color:var(--wje-color-contrast-lowest)}.wje-color-info{background-color:var(--wje-color-info-11);color:var(--wje-color-contrast-lowest)}.wje-color-contrast{background-color:var(--wje-color-contrast-11);color:var(--wje-color-contrast-8)}";
|
|
6
|
-
class l extends i {
|
|
7
|
-
/**
|
|
8
|
-
* Badge constructor
|
|
9
|
-
* @constructor
|
|
10
|
-
*/
|
|
11
|
-
constructor() {
|
|
12
|
-
super();
|
|
13
|
-
/**
|
|
14
|
-
* Class name
|
|
15
|
-
* @type {string}
|
|
16
|
-
*/
|
|
17
|
-
c(this, "className", "Badge");
|
|
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, g, j) {
|
|
41
|
-
let t = document.createDocumentFragment(), a = document.createElement("div");
|
|
42
|
-
a.setAttribute("part", "native"), a.classList.add("native-badge"), this.color && a.classList.add("wje-color-" + this.color, "wje-color");
|
|
43
|
-
let n = document.createElement("slot");
|
|
44
|
-
return a.appendChild(n), t.appendChild(a), t;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
l.define("wje-badge", l);
|
|
48
|
-
export {
|
|
49
|
-
l as default
|
|
50
|
-
};
|
package/dist/wje-breadcrumb.js
DELETED
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
var b = Object.defineProperty;
|
|
2
|
-
var w = (s, r, e) => r in s ? b(s, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[r] = e;
|
|
3
|
-
var m = (s, r, e) => (w(s, typeof r != "symbol" ? r + "" : r, e), e);
|
|
4
|
-
import f, { WjElementUtils as l, event as g } from "./wje-element.js";
|
|
5
|
-
const j = ':host{display:flex;flex:0 0 auto;align-items:center;line-height:1.5}:host(.collapsed){display:none}.native-breadcrumb{display:flex;align-items:center;width:100%;outline:none;background:inherit;padding:.25rem .75rem;color:var(--wje-breadcrumb-a);text-decoration:none}.native-breadcrumb.hidden{display:none}.native-breadcrumb.active{font-weight:700}.native-breadcrumb:hover{color:var(--wje-breadcrumb-a-hover)}button{margin-inline:.75rem;border:0 solid transparent;border-radius:3px;background-color:transparent;display:flex;align-items:center;justify-content:center;cursor:pointer}.separator{display:inline-flex;align-items:center}::slotted([slot="start"]){margin-inline:0 .5rem}::slotted([slot="end"]){margin-inline:.5rem 0}';
|
|
6
|
-
class u extends f {
|
|
7
|
-
/**
|
|
8
|
-
* Breadcrumb constructor
|
|
9
|
-
*/
|
|
10
|
-
constructor() {
|
|
11
|
-
var e;
|
|
12
|
-
super();
|
|
13
|
-
/**
|
|
14
|
-
* Class name
|
|
15
|
-
* @type {string}
|
|
16
|
-
*/
|
|
17
|
-
m(this, "className", "Breadcrumb");
|
|
18
|
-
this._showSeparator = !0, this._collapsedVariant = ((e = this.parentElement) == null ? void 0 : e.collapsedVariant) || "BUTTON";
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Get show separator flag
|
|
22
|
-
* @returns {boolean} showSeparator - The show separator flag
|
|
23
|
-
*/
|
|
24
|
-
get showSeparator() {
|
|
25
|
-
return this._showSeparator;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Set show separator flag
|
|
29
|
-
* @param {boolean} value - The value to set
|
|
30
|
-
*/
|
|
31
|
-
set showSeparator(e) {
|
|
32
|
-
this._showSeparator = e;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Get collapsed variant
|
|
36
|
-
* @returns {string} collapsedVariant - The collapsed variant
|
|
37
|
-
*/
|
|
38
|
-
get collapsedVariant() {
|
|
39
|
-
return this._collapsedVariant.toUpperCase();
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Set collapsed variant
|
|
43
|
-
* @param {string} value - The value to set
|
|
44
|
-
*/
|
|
45
|
-
set collapsedVariant(e) {
|
|
46
|
-
this._collapsedVariant = e || this.parentElement.collapsedVariant;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Get CSS stylesheet
|
|
50
|
-
* @static
|
|
51
|
-
* @returns {Object} styles - The CSS styles
|
|
52
|
-
*/
|
|
53
|
-
static get cssStyleSheet() {
|
|
54
|
-
return j;
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Get observed attributes
|
|
58
|
-
* @static
|
|
59
|
-
* @returns {Array<string>} observedAttributes - The observed attributes
|
|
60
|
-
*/
|
|
61
|
-
static get observedAttributes() {
|
|
62
|
-
return ["show-collapsed-indicator", "collapsed", "last"];
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Attribute changed callback
|
|
66
|
-
* @param {string} name - The attribute name
|
|
67
|
-
* @param {string} oldValue - The old value
|
|
68
|
-
* @param {string} newValue - The new value
|
|
69
|
-
* @returns {boolean} false - Always returns false
|
|
70
|
-
*/
|
|
71
|
-
attributeChangedCallback(e, n, t) {
|
|
72
|
-
return e === "collapsed" ? l.stringToBoolean(t) && this.classList.add("collapsed") : e === "show-collapsed-indicator" ? l.stringToBoolean(t) && (this.showCollapsedIndicator = !0, this.refresh()) : e === "last" && (this.active = l.stringToBoolean(t), this.showSeparator = !l.stringToBoolean(t), this.refresh()), !1;
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Setup attributes
|
|
76
|
-
*/
|
|
77
|
-
setupAttributes() {
|
|
78
|
-
this.isShadowRoot = "open";
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* Draw method
|
|
82
|
-
* @param {Object} context - The context
|
|
83
|
-
* @param {Object} store - The store
|
|
84
|
-
* @param {Object} params - The parameters
|
|
85
|
-
* @returns {Object} fragment - The document fragment
|
|
86
|
-
*/
|
|
87
|
-
draw(e, n, t) {
|
|
88
|
-
let o = document.createDocumentFragment(), a = document.createElement("a");
|
|
89
|
-
a.classList.add("native-breadcrumb"), a.setAttribute("part", "native"), this.active && a.classList.add("active");
|
|
90
|
-
let h = document.createElement("slot"), d = document.createElement("slot");
|
|
91
|
-
d.setAttribute("name", "start");
|
|
92
|
-
let c = document.createElement("slot");
|
|
93
|
-
if (c.setAttribute("name", "end"), a.appendChild(d), a.appendChild(h), a.appendChild(c), o.appendChild(a), this.showCollapsedIndicator && (o.appendChild(this.drawCollapsedIndicator()), this.classList.remove("collapsed"), a.classList.add("hidden")), this.showSeparator) {
|
|
94
|
-
let i = document.createElement("span");
|
|
95
|
-
if (i.classList.add("separator"), i.setAttribute("part", "separator"), l.hasSlot(this, "separator")) {
|
|
96
|
-
let p = document.createElement("slot");
|
|
97
|
-
p.setAttribute("name", "separator"), i.appendChild(p);
|
|
98
|
-
} else
|
|
99
|
-
i.innerHTML = `<wje-icon name=${this.separator || "chevron-right"}></wje-icon>`;
|
|
100
|
-
o.appendChild(i);
|
|
101
|
-
}
|
|
102
|
-
return this.native = a, o;
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* Draw collapsed indicator
|
|
106
|
-
* @returns {Object} collapsedIndicator - The collapsed indicator
|
|
107
|
-
*/
|
|
108
|
-
drawCollapsedIndicator() {
|
|
109
|
-
let e = null;
|
|
110
|
-
return this.collapsedVariant === "DROPDOWN" ? e = this.collapseDropdown() : e = this.collapseButton(), e;
|
|
111
|
-
}
|
|
112
|
-
/**
|
|
113
|
-
* Collapse dropdown
|
|
114
|
-
* @returns {Object} dropdown - The dropdown
|
|
115
|
-
*/
|
|
116
|
-
collapseDropdown() {
|
|
117
|
-
let e = document.createElement("wje-dropdown");
|
|
118
|
-
e.setAttribute("placement", "bottom"), e.setAttribute("offset", "10");
|
|
119
|
-
let n = document.createElement("wje-button");
|
|
120
|
-
n.setAttribute("slot", "trigger"), n.setAttribute("fill", "link"), n.innerHTML = '<wje-icon name="dots"></wje-icon>';
|
|
121
|
-
let t = document.createElement("wje-menu");
|
|
122
|
-
return t.setAttribute("variant", "context"), e.appendChild(n), e.appendChild(t), e.innerHTML = `<wje-button slot="trigger" fill="link">
|
|
123
|
-
<wje-icon name="dots"></wje-icon>
|
|
124
|
-
</wje-button>
|
|
125
|
-
<wje-menu variant="context">
|
|
126
|
-
<wje-menu-item>Test 0</wje-menu-item>
|
|
127
|
-
<wje-menu-item>Test 1</wje-menu-item>
|
|
128
|
-
<wje-menu-item>Test 2</wje-menu-item>
|
|
129
|
-
</wje-menu>`, this.parentElement.querySelectorAll("wje-breadcrumb").forEach((o) => {
|
|
130
|
-
}), e;
|
|
131
|
-
}
|
|
132
|
-
/**
|
|
133
|
-
* Collapse button
|
|
134
|
-
* @returns {Object} button - The button
|
|
135
|
-
*/
|
|
136
|
-
collapseButton() {
|
|
137
|
-
let e = document.createElement("button");
|
|
138
|
-
return e.setAttribute("aria-label", "Show more breadcrumbs"), e.setAttribute("part", "collapsed-indicator"), e.innerHTML = '<wje-icon name="dots"></wje-icon>', g.addListener(e, "click", null, (n) => {
|
|
139
|
-
this.native.classList.remove("hidden"), e.remove(), this.parentElement.querySelectorAll("wje-breadcrumb").forEach((t) => {
|
|
140
|
-
t.classList.remove("collapsed");
|
|
141
|
-
}), n.stopPropagation();
|
|
142
|
-
}), e;
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
u.define("wje-breadcrumb", u);
|
|
146
|
-
export {
|
|
147
|
-
u as default
|
|
148
|
-
};
|
package/dist/wje-breadcrumbs.js
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
var n = Object.defineProperty;
|
|
2
|
-
var d = (r, t, e) => t in r ? n(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
|
|
3
|
-
var i = (r, t, e) => (d(r, typeof t != "symbol" ? t + "" : t, e), e);
|
|
4
|
-
import f from "./wje-element.js";
|
|
5
|
-
const p = ":host{display:flex;flex-wrap:wrap;align-items:center}";
|
|
6
|
-
class c extends f {
|
|
7
|
-
/**
|
|
8
|
-
* Breadcrumbs constructor
|
|
9
|
-
* @constructor
|
|
10
|
-
*/
|
|
11
|
-
constructor() {
|
|
12
|
-
super();
|
|
13
|
-
/**
|
|
14
|
-
* Class name
|
|
15
|
-
* @type {string}
|
|
16
|
-
*/
|
|
17
|
-
i(this, "className", "Breadcrumbs");
|
|
18
|
-
this.last = !1;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Get CSS stylesheet
|
|
22
|
-
* @static
|
|
23
|
-
* @returns {Object} styles - The CSS styles
|
|
24
|
-
*/
|
|
25
|
-
static get cssStyleSheet() {
|
|
26
|
-
return p;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Setup attributes
|
|
30
|
-
*/
|
|
31
|
-
setupAttributes() {
|
|
32
|
-
this.isShadowRoot = "open";
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Draw method
|
|
36
|
-
* @param {Object} context - The context
|
|
37
|
-
* @param {Object} store - The store
|
|
38
|
-
* @param {Object} params - The parameters
|
|
39
|
-
* @returns {Object} fragment - The document fragment
|
|
40
|
-
*/
|
|
41
|
-
draw(e, l, o) {
|
|
42
|
-
let s = document.createDocumentFragment(), u = document.createElement("slot");
|
|
43
|
-
return s.appendChild(u), s;
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* After draw method
|
|
47
|
-
*/
|
|
48
|
-
afterDraw() {
|
|
49
|
-
let e = +this.maxItems || 0, l = +this.itemsBeforeCollapse || 1, o = +this.itemsAfterCollapse || 1, s = this.getBreadcrumbs();
|
|
50
|
-
if (s.length === 0)
|
|
51
|
-
return;
|
|
52
|
-
s.findLast((a) => a).setAttribute("last", !0), e !== void 0 && s.length > e && l + o <= e && s.forEach((a, m) => {
|
|
53
|
-
m === l && a.setAttribute("show-collapsed-indicator", !0), m >= l && m < s.length - o && a.setAttribute("collapsed", !0);
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Get breadcrumbs
|
|
58
|
-
* @returns {Array} breadcrumbs - The breadcrumbs
|
|
59
|
-
*/
|
|
60
|
-
getBreadcrumbs() {
|
|
61
|
-
return Array.from(this.querySelectorAll("wje-breadcrumb")) || [];
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
c.define("wje-breadcrumbs", c);
|
|
65
|
-
export {
|
|
66
|
-
c as default
|
|
67
|
-
};
|
package/dist/wje-button-group.js
DELETED
|
@@ -1,78 +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 i = (o, e, t) => (p(o, typeof e != "symbol" ? e + "" : e, t), t);
|
|
4
|
-
import u from "./wje-element.js";
|
|
5
|
-
const g = ":host{display:inline-block}:host .native-button-group{display:flex;flex-wrap:nowrap;line-height:1}:host slot{display:contents}::slotted(wje-button){margin:0!important}";
|
|
6
|
-
class m extends u {
|
|
7
|
-
/**
|
|
8
|
-
* ButtonGroup constructor
|
|
9
|
-
* @constructor
|
|
10
|
-
*/
|
|
11
|
-
constructor() {
|
|
12
|
-
super();
|
|
13
|
-
/**
|
|
14
|
-
* Class name
|
|
15
|
-
* @type {string}
|
|
16
|
-
*/
|
|
17
|
-
i(this, "className", "ButtonGroup");
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Get CSS stylesheet
|
|
21
|
-
* @static
|
|
22
|
-
* @returns {Object} styles - The CSS styles
|
|
23
|
-
*/
|
|
24
|
-
static get cssStyleSheet() {
|
|
25
|
-
return g;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Get observed attributes
|
|
29
|
-
* @static
|
|
30
|
-
* @returns {Array<string>} observedAttributes - The observed attributes
|
|
31
|
-
*/
|
|
32
|
-
static get observedAttributes() {
|
|
33
|
-
return [];
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Setup attributes
|
|
37
|
-
*/
|
|
38
|
-
setupAttributes() {
|
|
39
|
-
this.isShadowRoot = "open";
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Draw method
|
|
43
|
-
* @param {Object} context - The context
|
|
44
|
-
* @param {Object} store - The store
|
|
45
|
-
* @param {Object} params - The parameters
|
|
46
|
-
* @returns {Object} fragment - The document fragment
|
|
47
|
-
*/
|
|
48
|
-
draw(t, l, c) {
|
|
49
|
-
let s = document.createDocumentFragment(), n = document.createElement("div");
|
|
50
|
-
return n.classList.add("native-button-group"), n.setAttribute("part", "native"), this.slotElement = document.createElement("slot"), n.appendChild(this.slotElement), s.appendChild(n), s;
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* After draw method
|
|
54
|
-
* @param {Object} context - The context
|
|
55
|
-
* @param {Object} store - The store
|
|
56
|
-
* @param {Object} params - The parameters
|
|
57
|
-
*/
|
|
58
|
-
afterDraw(t, l, c) {
|
|
59
|
-
const s = [...this.slotElement.assignedElements({ flatten: !0 })];
|
|
60
|
-
s.forEach((n) => {
|
|
61
|
-
let a = s.indexOf(n), r = this.findButton(n);
|
|
62
|
-
r && (r.classList.add("wje-button-group-button"), r.classList.toggle("wje-button-group-first", a === 0), r.classList.toggle("wje-button-group-inner", a > 0 && a < s.length - 1), r.classList.toggle("wje-button-group-last", a === s.length - 1));
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Find button method
|
|
67
|
-
* @param {Object} el - The element
|
|
68
|
-
* @returns {Object} button - The button
|
|
69
|
-
*/
|
|
70
|
-
findButton(t) {
|
|
71
|
-
const l = "wje-button";
|
|
72
|
-
return t.closest(l) ?? t.querySelector(l);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
u.define("wje-button-group", m);
|
|
76
|
-
export {
|
|
77
|
-
m as default
|
|
78
|
-
};
|
package/dist/wje-button.js
DELETED
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
var b = Object.defineProperty;
|
|
2
|
-
var j = (e, a, o) => a in e ? b(e, a, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[a] = o;
|
|
3
|
-
var s = (e, a, o) => (j(e, typeof a != "symbol" ? a + "" : a, o), o);
|
|
4
|
-
import g, { WjElementUtils as p, event as i } from "./wje-element.js";
|
|
5
|
-
import h from "./wje-icon.js";
|
|
6
|
-
const u = (e) => e === "false" || e === "null" || e === "NaN" || e === "undefined" || e === "0" ? !1 : !!e, v = '.wje-button-solid.wje-color-primary{background-color:var(--wje-color-primary-10);border-color:var(--wje-color-primary-11);color:var(--wje-color-contrast-0)}.wje-button-outline.wje-color-primary{background-color:var(--wje-button-background-color);border-color:var(--wje-color-primary-6);color:var(--wje-color-primary-6)}.wje-button-solid.wje-color-complete{background-color:var(--wje-color-complete-10);border-color:var(--wje-color-complete-11);color:var(--wje-color-contrast-0)}.wje-button-outline.wje-color-complete{border-color:var(--wje-color-complete-6);color:var(--wje-color-complete-6)}.wje-button-solid.wje-color-success{background-color:var(--wje-color-success-10);border-color:var(--wje-color-success-11);color:var(--wje-color-contrast-0)}.wje-button-outline.wje-color-success{border-color:var(--wje-color-success-6);color:var(--wje-color-success-6)}.wje-button-solid.wje-color-warning{background-color:var(--wje-color-warning-10);border-color:var(--wje-color-warning-11);color:var(--wje-color-black)}.wje-button-outline.wje-color-warning{border-color:var(--wje-color-warning-6);color:var(--wje-color-warning-6)}.wje-button-solid.wje-color-danger{background-color:var(--wje-color-danger-10);border-color:var(--wje-color-danger-11);color:var(--wje-color-contrast-0)}.wje-button-outline.wje-color-danger{border-color:var(--wje-color-danger-6);color:var(--wje-color-danger-6)}.wje-button-solid.wje-color-neutral{background-color:var(--wje-color-contrast-10);border-color:var(--wje-color-contrast-11);color:var(--wje-color-contrast-0)}.wje-button-outline.wje-color-neutral{border-color:var(--wje-color-contrast-6);color:var(--wje-color-contrast-6)}.wje-button-solid.wje-color-default{background-color:transparent;border-color:var(--wje-color-contrast-4);color:var(--wje-color-contrast-11)}.wje-button-outline.wje-color-default{border-color:var(--wje-color-contrast-4);color:var(--wje-color-contrast-11)}:host{--wje-padding-top: .4rem;--wje-padding-start: .5rem;--wje-padding-end: .5rem;--wje-padding-bottom: .4rem;display:inline-flex;position:relative;width:auto;cursor:pointer;margin-inline:var(--wje-button-margin-inline)}:host(.wje-button-group-button){display:block}.native-button{font-family:var(--wje-font-family);font-size:var(--wje-font-size);display:flex;position:relative;align-items:center;width:100%;height:100%;min-height:inherit;overflow:hidden;border-width:var(--wje-button-border-width);border-style:var(--wje-button-border-style);border-color:var(--wje-button-border-color);outline:var(--wje-button-outline);background-color:transparent;line-height:1;contain:layout style;cursor:pointer;z-index:0;box-sizing:border-box;-webkit-appearance:none;-moz-appearance:none;appearance:none;margin:0;border-radius:var(--wje-button-border-radius);padding-top:var(--wje-padding-top);padding-bottom:var(--wje-padding-bottom);padding-inline:var(--wje-padding-start) var(--wje-padding-end)}@media (any-hover: hover){.wje-button-solid.wje-color-primary:hover{background-color:var(--wje-color-primary-9);border-color:var(--wje-color-primary-10);color:var(--wje-color-contrast-0)}.wje-button-outline.wje-color-primary:hover{background-color:var(--wje-color-primary-1);border-color:var(--wje-color-primary-11);color:var(--wje-color-primary-11)}.wje-button-solid.wje-color-complete:hover{background-color:var(--wje-color-complete-9);border-color:var(--wje-color-complete-10);color:var(--wje-color-contrast-0)}.wje-button-outline.wje-color-complete:hover{background-color:var(--wje-color-complete-1);border-color:var(--wje-color-complete-11);color:var(--wje-color-complete-11)}.wje-button-solid.wje-color-success:hover{background-color:var(--wje-color-success-9);border-color:var(--wje-color-success-10);color:var(--wje-color-contrast-0)}.wje-button-outline.wje-color-success:hover{background-color:var(--wje-color-success-1);border-color:var(--wje-color-success-11);color:var(--wje-color-success-11)}.wje-button-solid.wje-color-warning:hover{background-color:var(--wje-color-warning-9);border-color:var(--wje-color-warning-10);color:var(--wje-color-black)}.wje-button-outline.wje-color-warning:hover{background-color:var(--wje-color-warning-1);border-color:var(--wje-color-warning-11);color:var(--wje-color-warning-11)}.wje-button-solid.wje-color-danger:hover{background-color:var(--wje-color-danger-9);border-color:var(--wje-color-danger-10);color:var(--wje-color-contrast-0)}.wje-button-outline.wje-color-danger:hover{background-color:var(--wje-color-danger-1);border-color:var(--wje-color-danger-11);color:var(--wje-color-danger-11)}.wje-button-solid.wje-color-neutral:hover{background-color:var(--wje-color-contrast-9);border-color:var(--wje-color-contrast-10);color:var(--wje-color-contrast-0)}.wje-button-outline.wje-color-neutral:hover{background-color:var(--wje-color-contrast-1);border-color:var(--wje-color-contrast-11);color:var(--wje-color-contrast-11)}.wje-button-solid.wje-color-default:hover,.wje-button-outline.wje-color-default:hover{background-color:var(--wje-color-contrast-1);border-color:var(--wje-color-contrast-2);color:var(--wje-color-contrast-9)}.wje-button-link:hover{background-color:var(--wje-color-contrast-1);border-color:transparent;color:var(--wje-color-contrast-9)}}.button-inner{display:flex;position:relative;flex-flow:row nowrap;flex-shrink:0;align-items:center;justify-content:center;width:100%;height:100%;z-index:1}.wje-button-link{border-width:1px;border-color:transparent;background-color:transparent}.wje-button-disabled{cursor:default;opacity:.5;pointer-events:none}.wje-button-round{border-radius:var(--wje-border-radius-pill)}.wje-button-circle{border-radius:var(--wje-border-radius-circle);aspect-ratio:1/1}.wje-button-large{--wje-padding-top: .6rem;--wje-padding-start: .7rem;--wje-padding-end: .7rem;--wje-padding-bottom: .6rem}.wje-button-small{--wje-padding-top: .25rem;--wje-padding-start: .25rem;--wje-padding-end: .25rem;--wje-padding-bottom: .25rem}::slotted(wje-icon[slot="start"]){margin:0 .3rem 0 -.3rem}::slotted(wje-icon[slot="end"]){margin:0 -.2rem 0 .3rem}:host(:not([only-caret])) slot[name=caret]{padding:0 0 0 .3rem}:host([only-caret]) slot[name=caret]{padding:0;display:block}:host(.wje-button-group-first:not(.wje-button-group-last)) .native-button{border-start-end-radius:0;border-end-end-radius:0}:host(.wje-button-group-inner) .native-button{border-radius:0}:host(.wje-button-group-last:not(.wje-button-group-first)) .native-button{border-start-start-radius:0;border-end-start-radius:0}:host(.wje-button-group-button:not(.wje-button-group-first)){margin-inline-start:calc(-1 * var(--wje-button-border-width))!important}::slotted([slot="toggle"]){display:none}::slotted([slot="toggle"].show){display:block}';
|
|
7
|
-
class w extends g {
|
|
8
|
-
/**
|
|
9
|
-
* Button constructor
|
|
10
|
-
* @constructor
|
|
11
|
-
*/
|
|
12
|
-
constructor() {
|
|
13
|
-
super();
|
|
14
|
-
/**
|
|
15
|
-
* Dependencies
|
|
16
|
-
* @type {Object}
|
|
17
|
-
*/
|
|
18
|
-
s(this, "depandencies", {
|
|
19
|
-
"wje-icon": h
|
|
20
|
-
});
|
|
21
|
-
/**
|
|
22
|
-
* Class name
|
|
23
|
-
* @type {string}
|
|
24
|
-
*/
|
|
25
|
-
s(this, "className", "Button");
|
|
26
|
-
/**
|
|
27
|
-
* Event dialog open method
|
|
28
|
-
* @param {Event} e - The event
|
|
29
|
-
*/
|
|
30
|
-
s(this, "eventDialogOpen", (o) => {
|
|
31
|
-
i.dispatchCustomEvent(this, this.dialog, {
|
|
32
|
-
bubbles: !0
|
|
33
|
-
});
|
|
34
|
-
});
|
|
35
|
-
/**
|
|
36
|
-
* Toggle states method
|
|
37
|
-
*/
|
|
38
|
-
s(this, "toggleStates", () => {
|
|
39
|
-
this.slotToggle.assignedNodes().filter((c) => c.nodeType === Node.ELEMENT_NODE).forEach((c) => {
|
|
40
|
-
c.classList.contains("show") ? c.classList.remove("show") : c.classList.add("show");
|
|
41
|
-
});
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Set active state
|
|
46
|
-
* @param {boolean} value - The value to set
|
|
47
|
-
*/
|
|
48
|
-
set active(o) {
|
|
49
|
-
this.setAttribute("active", "");
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Get active state
|
|
53
|
-
* @returns {boolean} active - The active state
|
|
54
|
-
*/
|
|
55
|
-
get active() {
|
|
56
|
-
return this.hasAttribute("active");
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Set disabled state
|
|
60
|
-
* @param {boolean} value - The value to set
|
|
61
|
-
*/
|
|
62
|
-
set disabled(o) {
|
|
63
|
-
o ? this.setAttribute("disabled", "") : this.removeAttribute("disabled");
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Get disabled state
|
|
67
|
-
* @returns {boolean} disabled - The disabled state
|
|
68
|
-
*/
|
|
69
|
-
get disabled() {
|
|
70
|
-
return this.hasAttribute("disabled");
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Set fill
|
|
74
|
-
* @param {string} value - The value to set
|
|
75
|
-
*/
|
|
76
|
-
set fill(o) {
|
|
77
|
-
this.setAttribute("fill", o);
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* Get fill
|
|
81
|
-
* @returns {string} fill - The fill
|
|
82
|
-
*/
|
|
83
|
-
get fill() {
|
|
84
|
-
return this.getAttribute("fill") || "solid";
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Set outline
|
|
88
|
-
* @param {boolean} value - The value to set
|
|
89
|
-
*/
|
|
90
|
-
set outline(o) {
|
|
91
|
-
this.setAttribute("outline", "");
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* Get outline
|
|
95
|
-
* @returns {boolean} outline - The outline
|
|
96
|
-
*/
|
|
97
|
-
get outline() {
|
|
98
|
-
return this.hasAttribute("outline");
|
|
99
|
-
}
|
|
100
|
-
/**
|
|
101
|
-
* Set stop propagation
|
|
102
|
-
* @param {boolean} value - The value to set
|
|
103
|
-
*/
|
|
104
|
-
set stopPropagation(o) {
|
|
105
|
-
this.setAttribute("stop-propagation", u(o));
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
* Get stop propagation
|
|
109
|
-
* @returns {boolean} stopPropagation - The stop propagation
|
|
110
|
-
*/
|
|
111
|
-
get stopPropagation() {
|
|
112
|
-
return u(this.getAttribute("stop-propagation"));
|
|
113
|
-
}
|
|
114
|
-
/**
|
|
115
|
-
* Get CSS stylesheet
|
|
116
|
-
* @static
|
|
117
|
-
* @returns {Object} styles - The CSS styles
|
|
118
|
-
*/
|
|
119
|
-
static get cssStyleSheet() {
|
|
120
|
-
return v;
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* Get observed attributes
|
|
124
|
-
* @static
|
|
125
|
-
* @returns {Array<string>} observedAttributes - The observed attributes
|
|
126
|
-
*/
|
|
127
|
-
static get observedAttributes() {
|
|
128
|
-
return ["disabled"];
|
|
129
|
-
}
|
|
130
|
-
/**
|
|
131
|
-
* Setup attributes
|
|
132
|
-
*/
|
|
133
|
-
setupAttributes() {
|
|
134
|
-
this.isShadowRoot = "open";
|
|
135
|
-
}
|
|
136
|
-
/**
|
|
137
|
-
* Draw method
|
|
138
|
-
* @param {Object} context - The context
|
|
139
|
-
* @param {Object} store - The store
|
|
140
|
-
* @param {Object} params - The parameters
|
|
141
|
-
* @returns {Object} fragment - The document fragment
|
|
142
|
-
*/
|
|
143
|
-
draw(o, c, m) {
|
|
144
|
-
let d = document.createDocumentFragment(), t = document.createElement(this.hasAttribute("href") ? "a" : "button");
|
|
145
|
-
if (t.classList.add("native-button"), t.setAttribute("part", "native"), this.classList.remove("wje-button-disabled"), this.disabled && t.classList.add("wje-button-disabled"), this.variant && t.classList.add("wje-button-" + this.variant), this.hasAttribute("round") && t.classList.add("wje-button-round"), this.hasAttribute("circle") && t.classList.add("wje-button-circle"), this.outline && t.classList.add("wje-outline"), this.fill && t.classList.add("wje-button-" + this.fill), this.size && t.classList.add("wje-button-" + this.size), this.hasAttribute("color") ? t.classList.add("wje-color-" + this.color, "wje-color") : t.classList.add("wje-color-default", "wje-color"), this.querySelectorAll("[slot=caret]").length < 1 && this.hasAttribute("caret") || this.hasAttribute("only-caret")) {
|
|
146
|
-
let n = document.createElement("wje-icon");
|
|
147
|
-
n.style.setProperty("--wje-icon-size", "14px"), n.setAttribute("slot", "caret"), n.setAttribute("name", "chevron-down"), this.appendChild(n);
|
|
148
|
-
}
|
|
149
|
-
if (this.active) {
|
|
150
|
-
this.classList.add("wje-active");
|
|
151
|
-
let n = document.createElement("wje-icon");
|
|
152
|
-
n.setAttribute("name", "check"), this.appendChild(n);
|
|
153
|
-
}
|
|
154
|
-
let l = document.createElement("span");
|
|
155
|
-
l.classList.add("button-inner");
|
|
156
|
-
let r = document.createElement("slot");
|
|
157
|
-
return r.setAttribute("name", "icon-only"), l.appendChild(r), r = document.createElement("slot"), r.setAttribute("name", "start"), l.appendChild(r), r = document.createElement("slot"), l.appendChild(r), r = document.createElement("slot"), r.setAttribute("name", "end"), l.appendChild(r), r = document.createElement("slot"), r.setAttribute("name", "caret"), l.appendChild(r), this.hasToggle = p.hasSlot(this, "toggle"), this.hasToggle && (this.slotToggle = document.createElement("slot"), this.slotToggle.setAttribute("name", "toggle"), l.appendChild(this.slotToggle)), t.appendChild(l), d.appendChild(t), d;
|
|
158
|
-
}
|
|
159
|
-
/**
|
|
160
|
-
* After draw method
|
|
161
|
-
*/
|
|
162
|
-
afterDraw() {
|
|
163
|
-
this.hasToggle && (this.toggle === "off" ? this.slotToggle.assignedNodes()[1].classList.add("show") : this.slotToggle.assignedNodes()[0].classList.add("show")), this.hasAttribute("dialog") ? i.addListener(this, "click", null, this.eventDialogOpen) : i.addListener(this, "click", "wje-button:click", null), this.hasToggle && i.addListener(this, "click", "wje-button:toggle", this.toggleStates, { stopPropagation: this.stopPropagation });
|
|
164
|
-
}
|
|
165
|
-
/**
|
|
166
|
-
* Before disconnect method
|
|
167
|
-
*/
|
|
168
|
-
beforeDisconnect() {
|
|
169
|
-
this.removeEventListener("click", this.eventDialogOpen);
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
w.define("wje-button", w);
|
|
173
|
-
export {
|
|
174
|
-
w as default
|
|
175
|
-
};
|