wj-elements 0.1.12 → 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-toggle.js
DELETED
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
var h = Object.defineProperty;
|
|
2
|
-
var g = (r, t, e) => t in r ? h(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
|
|
3
|
-
var c = (r, t, e) => (g(r, typeof t != "symbol" ? t + "" : t, e), e);
|
|
4
|
-
import b, { event as d } from "./wje-element.js";
|
|
5
|
-
const w = ':host{--wje-toggle-color-base: var(--wje-color-contrast-3);--wje-toggle-width: 30px;--wje-toggle-height: 18px;--wje-toggle-border-radius: 50px;--wje-toggle-handle-width: 13px;--wje-toggle-handle-height: 13px;--wje-toggle-handle-border-radius: 9px;--wje-toggle-handle-color: #fff;--wje-toggle-handle-shadow: 1px 0 1px .5px rgba(0,0,0,.12), 2px 4px 6px rgba(0,0,0,.2);--wje-toggle-handle-shadow-checked: 1px 1px 0 rgba(0,0,0,.08), -3px 3px 6px rgba(0,0,0,.3);--wje-toggle-duration: .25s;--wje-toggle-curve: cubic-bezier(.4,0,.2,1)}:host(.wje-color-primary) input:checked+label>.label-wrapper{--wje-toggle-color-base: var(--wje-color-primary) !important}:host(.wje-color-complete) input:checked+label>.label-wrapper{--wje-toggle-color-base: var(--wje-color-complete)}:host(.wje-color-success) input:checked+label>.label-wrapper{--wje-toggle-color-base: var(--wje-color-success) !important}:host(.wje-color-warning) input:checked+label>.label-wrapper{--wje-toggle-color-base: var(--wje-color-warning)}:host(.wje-color-danger) input:checked+label>.label-wrapper{--wje-toggle-color-base: var(--wje-color-danger)}:host(.wje-color-info) input:checked+label>.label-wrapper{--wje-toggle-color-base: var(--wje-color-info)}.native-toggle{display:flex}label{display:flex;cursor:pointer;align-items:center;-webkit-user-select:none;user-select:none}label .label-wrapper{width:var(--wje-toggle-width)!important;min-width:var(--wje-toggle-width);height:var(--wje-toggle-height);position:relative;display:flex;align-items:center}label .label-wrapper:before{content:"";position:absolute;cursor:pointer;width:100%;height:100%;top:auto;left:0;background:var(--wje-toggle-color-base);background-size:300%;background-position:right;border-radius:var(--wje-toggle-border-radius);border:none;box-shadow:inset 0 0 0 1px #0000001f;transition:background calc(var(--wje-toggle-duration) + (var(--wje-toggle-duration) * .24)),box-shadow var(--wje-toggle-duration);transition-timing-function:var(--wje-toggle-curve)}label .label-wrapper:after{content:"";position:absolute;transform:translate(0);background:var(--wje-toggle-handle-color);width:var(--wje-toggle-handle-width);height:var(--wje-toggle-handle-height);border-radius:var(--wje-toggle-handle-border-radius);top:auto;left:2px;box-shadow:var(--wje-toggle-handle-shadow);transition:transform,box-shadow;transition-duration:var(--wje-toggle-duration);transition-timing-function:var(--wje-toggle-curve)}input[type=checkbox][disabled]+label{cursor:not-allowed!important;color:var(--wje-color-contrast-9);opacity:.58}input[type=checkbox][disabled]+label:before{cursor:not-allowed!important}input[type=checkbox]{position:absolute;z-index:-1;opacity:0}input[type=checkbox]:checked+label .label-wrapper:before{background-position:left;box-shadow:inset 0 0 0 1px #0000001f}input[type=checkbox]:checked+label .label-wrapper:after{transform:translate(calc(var(--wje-toggle-width) - var(--wje-toggle-handle-width) - 4px));box-shadow:var(--wje-toggle-handle-shadow-checked)}input[type=checkbox]:focus+label .label-wrapper:before{outline:none!important;box-shadow:inset 0 0 0 1px #0000001f,0 0 #78c8fe}input[type=checkbox][disabled]:active+label .label-wrapper:after{transform:scaleX(1.1);transform-origin:center left;transition:transform step-start}input[type=checkbox]:checked[disabled]:active+label .label-wrapper:after{transform:translate(calc(100% - 6px)) scaleX(1.1);transform-origin:center right}input[type=checkbox]:hover:active+label .label-wrapper:before{background-color:transparent}:host .text{margin-inline:.5rem 0}:host .end label{width:100%}:host .end .text{margin-inline:0 .5rem;width:100%}slot{display:flex;align-items:center;width:100%}';
|
|
6
|
-
class p extends b {
|
|
7
|
-
/**
|
|
8
|
-
* @constructor
|
|
9
|
-
* @summary Toggle constructor
|
|
10
|
-
*/
|
|
11
|
-
constructor() {
|
|
12
|
-
super();
|
|
13
|
-
/**
|
|
14
|
-
* @summary Class name
|
|
15
|
-
* @type {string}
|
|
16
|
-
*/
|
|
17
|
-
c(this, "className", "Toggle");
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* @summary Set checked attribute
|
|
21
|
-
* @returns {boolean} true if the toggle is checked, false otherwise
|
|
22
|
-
*/
|
|
23
|
-
set disabled(e) {
|
|
24
|
-
e ? this.setAttribute("disabled", "") : this.removeAttribute("disabled");
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* @summary Get disabled attribute
|
|
28
|
-
* @returns {boolean} true if the toggle is disabled, false otherwise
|
|
29
|
-
*/
|
|
30
|
-
get disabled() {
|
|
31
|
-
return this.hasAttribute("disabled");
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* @summary Set checked attribute
|
|
35
|
-
* @returns {boolean} true if the toggle is checked, false otherwise
|
|
36
|
-
*/
|
|
37
|
-
set checked(e) {
|
|
38
|
-
e ? this.setAttribute("checked", "") : this.removeAttribute("checked");
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* @summary Get checked attribute
|
|
42
|
-
* @returns {boolean} true if the toggle is checked, false otherwise
|
|
43
|
-
*/
|
|
44
|
-
get checked() {
|
|
45
|
-
return this.hasAttribute("checked");
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* @summary Get CSS stylesheet
|
|
49
|
-
* @static
|
|
50
|
-
* @returns {Object} styles
|
|
51
|
-
*/
|
|
52
|
-
static get cssStyleSheet() {
|
|
53
|
-
return w;
|
|
54
|
-
}
|
|
55
|
-
static get observedAttributes() {
|
|
56
|
-
return ["checked", "disabled"];
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* @summary Setup attributes
|
|
60
|
-
*/
|
|
61
|
-
setupAttributes() {
|
|
62
|
-
this.isShadowRoot = "open";
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* @summary Draw method
|
|
66
|
-
* @param {Object} context - The context
|
|
67
|
-
* @param {Object} store - The store
|
|
68
|
-
* @param {Object} params - The parameters
|
|
69
|
-
* @returns {Object} Document fragment
|
|
70
|
-
*/
|
|
71
|
-
draw(e, u, j) {
|
|
72
|
-
let s = document.createDocumentFragment(), o = document.createElement("div");
|
|
73
|
-
o.setAttribute("part", "native"), o.classList.add("native-toggle");
|
|
74
|
-
let a = document.createElement("input");
|
|
75
|
-
a.setAttribute("part", "input"), a.setAttribute("type", "checkbox"), a.setAttribute("name", this.name), a.setAttribute("id", "input"), a.checked = this.hasAttribute("checked"), a.disabled = this.hasAttribute("disabled");
|
|
76
|
-
let l = document.createElement("label");
|
|
77
|
-
l.setAttribute("for", "input");
|
|
78
|
-
let i = document.createElement("div");
|
|
79
|
-
i.setAttribute("part", "toggle"), i.classList.add("label-wrapper");
|
|
80
|
-
let n = document.createElement("div");
|
|
81
|
-
return n.classList.add("text"), n.innerHTML = "<slot></slot>", this.color && this.classList.add("wje-color-" + this.color, "wje-color"), o.appendChild(a), o.appendChild(l), this.placement === "end" ? (o.classList.add("end"), l.appendChild(n), l.appendChild(i)) : (l.appendChild(i), l.appendChild(n)), s.appendChild(o), this.input = a, s;
|
|
82
|
-
}
|
|
83
|
-
afterDraw() {
|
|
84
|
-
this.disabled || (this.input.addEventListener("input", (e) => {
|
|
85
|
-
this.checked = e.target.checked, d.dispatchCustomEvent(this, "wje-toggle:input");
|
|
86
|
-
}), this.input.addEventListener("change", (e) => {
|
|
87
|
-
this.checked = e.target.checked, d.dispatchCustomEvent(this, "wje-toggle:change");
|
|
88
|
-
}));
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
p.define("wje-toggle", p);
|
|
92
|
-
export {
|
|
93
|
-
p as default
|
|
94
|
-
};
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
var d = Object.defineProperty;
|
|
2
|
-
var m = (e, t, o) => t in e ? d(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o;
|
|
3
|
-
var r = (e, t, o) => (m(e, typeof t != "symbol" ? t + "" : t, o), o);
|
|
4
|
-
import u from "./wje-element.js";
|
|
5
|
-
const p = ":host .native-toolbar-action{display:flex}";
|
|
6
|
-
class l extends u {
|
|
7
|
-
/**
|
|
8
|
-
* @constructor
|
|
9
|
-
* @summary ToolbarAction constructor
|
|
10
|
-
*/
|
|
11
|
-
constructor() {
|
|
12
|
-
super();
|
|
13
|
-
/**
|
|
14
|
-
* @summary Class name
|
|
15
|
-
* @type {string}
|
|
16
|
-
*/
|
|
17
|
-
r(this, "className", "ToolbarAction");
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* @summary Get CSS stylesheet
|
|
21
|
-
* @static
|
|
22
|
-
* @returns {Object} styles
|
|
23
|
-
*/
|
|
24
|
-
static get cssStyleSheet() {
|
|
25
|
-
return p;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* @summary Get observed attributes
|
|
29
|
-
* @static
|
|
30
|
-
* @returns {Array} An empty array
|
|
31
|
-
*/
|
|
32
|
-
static get observedAttributes() {
|
|
33
|
-
return [];
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* @summary Setup attributes
|
|
37
|
-
*/
|
|
38
|
-
setupAttributes() {
|
|
39
|
-
this.isShadowRoot = "open";
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* @summary Draw method
|
|
43
|
-
* @param {Object} context - The context
|
|
44
|
-
* @param {Object} store - The store
|
|
45
|
-
* @param {Object} params - The parameters
|
|
46
|
-
* @returns {Object} Document fragment
|
|
47
|
-
*/
|
|
48
|
-
draw(o, h, b) {
|
|
49
|
-
let a = document.createDocumentFragment(), n = +this.maxItems || 0, c = this.getActions(), i = document.createElement("slot"), s = document.createElement("div");
|
|
50
|
-
return s.setAttribute("part", "native"), s.classList.add("native-toolbar-action"), n !== 0 && c.length > n && (s = document.createElement("wje-dropdown")), s.appendChild(i), a.appendChild(s), a;
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* @summary Get actions
|
|
54
|
-
* @returns {Array} An array of wje-button elements
|
|
55
|
-
*/
|
|
56
|
-
getActions() {
|
|
57
|
-
return Array.from(this.querySelectorAll("wje-button"));
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
l.define("wje-toolbar-action", l);
|
|
61
|
-
export {
|
|
62
|
-
l as default
|
|
63
|
-
};
|
package/dist/wje-toolbar.js
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
var s = Object.defineProperty;
|
|
2
|
-
var b = (e, t, o) => t in e ? s(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o;
|
|
3
|
-
var d = (e, t, o) => (b(e, typeof t != "symbol" ? t + "" : t, o), o);
|
|
4
|
-
import p from "./wje-element.js";
|
|
5
|
-
import { w as c } from "./router-links-FtZbFUto.js";
|
|
6
|
-
const m = ':host{--wje-toolbar-background: var(--wje-background);--wje-toolbar-height: auto;--wje-toolbar-min-height: 70px;--wje-toolbar-padding-top: 1rem;--wje-toolbar-padding-bottom: 1rem;--wje-toolbar-padding-inline: 1.5rem;--wje-toolbar-border-color: var(--wje-border-color);--wje-toolbar-top: 0;width:100%;height:var(--wje-toolbar-height)}.native-toolbar{background-color:var(--wje-toolbar-background);display:flex;align-items:center;flex-wrap:wrap;justify-content:flex-start;border-bottom:1px solid var(--wje-toolbar-border-color);padding-inline:var(--wje-toolbar-padding-inline);padding-top:var(--wje-toolbar-padding-top);padding-bottom:var(--wje-toolbar-padding-bottom);box-shadow:0 10px 30px #523f690d}::slotted{grid-column:span 4}::slotted([slot="start"]){margin-right:auto}:host([sticky]){position:sticky;top:var(--wje-toolbar-top);z-index:99}';
|
|
7
|
-
class l extends c(p) {
|
|
8
|
-
/**
|
|
9
|
-
* @constructor
|
|
10
|
-
* @summary Toolbar constructor
|
|
11
|
-
*/
|
|
12
|
-
constructor() {
|
|
13
|
-
super();
|
|
14
|
-
/**
|
|
15
|
-
* @summary Class name
|
|
16
|
-
* @type {string}
|
|
17
|
-
*/
|
|
18
|
-
d(this, "className", "Toolbar");
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* @summary Get CSS stylesheet
|
|
22
|
-
* @static
|
|
23
|
-
* @returns {Object} styles
|
|
24
|
-
*/
|
|
25
|
-
static get cssStyleSheet() {
|
|
26
|
-
return m;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* @summary Get observed attributes
|
|
30
|
-
* @static
|
|
31
|
-
* @returns {Array} An empty array
|
|
32
|
-
*/
|
|
33
|
-
static get observedAttributes() {
|
|
34
|
-
return [];
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* @summary Setup attributes
|
|
38
|
-
*/
|
|
39
|
-
setupAttributes() {
|
|
40
|
-
this.isShadowRoot = "open";
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* @summary Draw method
|
|
44
|
-
* @param {Object} context - The context
|
|
45
|
-
* @param {Object} store - The store
|
|
46
|
-
* @param {Object} params - The parameters
|
|
47
|
-
* @returns {Object} Document fragment
|
|
48
|
-
*/
|
|
49
|
-
draw(o, u, w) {
|
|
50
|
-
let a = document.createDocumentFragment(), r = document.createElement("div");
|
|
51
|
-
r.setAttribute("part", "native"), r.classList.add("native-toolbar");
|
|
52
|
-
let n = document.createElement("slot");
|
|
53
|
-
n.setAttribute("name", "start");
|
|
54
|
-
let i = document.createElement("slot");
|
|
55
|
-
return i.setAttribute("name", "end"), r.appendChild(n), r.appendChild(i), a.appendChild(r), a;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
l.define("wje-toolbar", l);
|
|
59
|
-
export {
|
|
60
|
-
l as default
|
|
61
|
-
};
|
package/dist/wje-tooltip.js
DELETED
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
var p = Object.defineProperty;
|
|
2
|
-
var u = (r, e, t) => e in r ? p(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
3
|
-
var i = (r, e, t) => (u(r, typeof e != "symbol" ? e + "" : e, t), t);
|
|
4
|
-
import m, { event as l } from "./wje-element.js";
|
|
5
|
-
const w = ".native-tooltip{display:block;padding:.5rem;color:var(--wje-tooltip-color);background-color:var(--wje-tooltip-background);font-weight:400;font-size:.75rem!important;border-radius:var(--wje-border-radius-small);line-height:1;box-sizing:border-box;box-shadow:var(--wje-box-shadow-medium)}.arrow{position:absolute;width:10px;height:10px;background:var(--wje-tooltip-arrow-color);transform:rotate(45deg)}";
|
|
6
|
-
class c extends m {
|
|
7
|
-
/**
|
|
8
|
-
* @constructor
|
|
9
|
-
* @summary Tooltip constructor
|
|
10
|
-
*/
|
|
11
|
-
constructor() {
|
|
12
|
-
super();
|
|
13
|
-
/**
|
|
14
|
-
* @summary Class name
|
|
15
|
-
* @type {string}
|
|
16
|
-
*/
|
|
17
|
-
i(this, "className", "Tooltip");
|
|
18
|
-
/**
|
|
19
|
-
* @summary Show tooltip
|
|
20
|
-
*/
|
|
21
|
-
i(this, "onShow", () => {
|
|
22
|
-
this.classList.add("active"), Promise.resolve(this.beforeShow(this)).then((t) => {
|
|
23
|
-
if (!this.classList.contains("active") || !t || typeof t != "string")
|
|
24
|
-
throw new Error("beforeShow method returned false or not string");
|
|
25
|
-
this.native.innerHTML = t, this.popup.show(), Promise.resolve(this.afterShow(this));
|
|
26
|
-
}).catch((t) => {
|
|
27
|
-
this.classList.remove("active"), this.popup.hide();
|
|
28
|
-
});
|
|
29
|
-
});
|
|
30
|
-
/**
|
|
31
|
-
* @summary Hide tooltip
|
|
32
|
-
*/
|
|
33
|
-
i(this, "onHide", () => {
|
|
34
|
-
this.classList.remove("active"), this.popup.hide();
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
set content(t) {
|
|
38
|
-
this.setAttribute("content", t);
|
|
39
|
-
}
|
|
40
|
-
get content() {
|
|
41
|
-
return this.hasAttribute("content") ? this.getAttribute("content") : "";
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* @summary Get CSS stylesheet
|
|
45
|
-
* @static
|
|
46
|
-
* @returns {Object} styles
|
|
47
|
-
*/
|
|
48
|
-
static get cssStyleSheet() {
|
|
49
|
-
return w;
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* @summary Get observed attributes
|
|
53
|
-
* @static
|
|
54
|
-
* @returns {Array} An array of observed attributes
|
|
55
|
-
*/
|
|
56
|
-
static get observedAttributes() {
|
|
57
|
-
return ["active"];
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* @summary Setup attributes
|
|
61
|
-
*/
|
|
62
|
-
setupAttributes() {
|
|
63
|
-
this.isShadowRoot = "open";
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* @summary Draw method
|
|
67
|
-
* @param {Object} context - The context
|
|
68
|
-
* @param {Object} store - The store
|
|
69
|
-
* @param {Object} params - The parameters
|
|
70
|
-
* @returns {Object} Document fragment
|
|
71
|
-
*/
|
|
72
|
-
draw(t, h, v) {
|
|
73
|
-
let d = document.createDocumentFragment(), o = document.createElement("wje-popup");
|
|
74
|
-
o.setAttribute("placement", this.placement || "top"), o.setAttribute("offset", this.offset || "0");
|
|
75
|
-
let n = document.createElement("slot");
|
|
76
|
-
n.setAttribute("slot", "anchor");
|
|
77
|
-
let a = document.createElement("div");
|
|
78
|
-
a.classList.add("arrow"), a.setAttribute("slot", "arrow");
|
|
79
|
-
let s = document.createElement("div");
|
|
80
|
-
return s.setAttribute("part", "native"), s.classList.add("native-tooltip"), s.innerHTML = this.content, o.appendChild(n), o.appendChild(a), o.appendChild(s), this.mySlot = n, this.popup = o, this.native = s, d.appendChild(o), d;
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* @summary After draw method
|
|
84
|
-
*/
|
|
85
|
-
afterDraw() {
|
|
86
|
-
let t = this.mySlot.assignedElements()[0];
|
|
87
|
-
t && (l.addListener(t, "mouseenter", null, this.onShow), l.addListener(t, "mouseleave", null, this.onHide));
|
|
88
|
-
}
|
|
89
|
-
dispatch(t) {
|
|
90
|
-
return new Promise((h) => {
|
|
91
|
-
l.dispatchCustomEvent(this, t, {
|
|
92
|
-
resolve: h
|
|
93
|
-
});
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
beforeShow() {
|
|
97
|
-
return this.content;
|
|
98
|
-
}
|
|
99
|
-
afterShow() {
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
c.define("wje-tooltip", c);
|
|
103
|
-
export {
|
|
104
|
-
c as default
|
|
105
|
-
};
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
var a = Object.defineProperty;
|
|
2
|
-
var p = (e, t, n) => t in e ? a(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
-
var i = (e, t, n) => (p(e, typeof t != "symbol" ? t + "" : t, n), n);
|
|
4
|
-
import d from "./wje-element.js";
|
|
5
|
-
const l = ":host(:not(:focus-within)){position:absolute!important;width:1px!important;height:1px!important;clip:rect(0 0 0 0)!important;clip-path:inset(50%)!important;border:none!important;overflow:hidden!important;white-space:nowrap!important;padding:0!important}";
|
|
6
|
-
class r extends d {
|
|
7
|
-
/**
|
|
8
|
-
* @constructor
|
|
9
|
-
* @summary VisuallyHidden constructor
|
|
10
|
-
*/
|
|
11
|
-
constructor() {
|
|
12
|
-
super();
|
|
13
|
-
/**
|
|
14
|
-
* @summary Class name
|
|
15
|
-
* @type {string}
|
|
16
|
-
*/
|
|
17
|
-
i(this, "className", "VisuallyHidden");
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* @summary Get CSS stylesheet
|
|
21
|
-
* @static
|
|
22
|
-
* @returns {Object} styles
|
|
23
|
-
*/
|
|
24
|
-
static get cssStyleSheet() {
|
|
25
|
-
return l;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* @summary Get observed attributes
|
|
29
|
-
* @static
|
|
30
|
-
* @returns {Array} An empty array
|
|
31
|
-
*/
|
|
32
|
-
static get observedAttributes() {
|
|
33
|
-
return [];
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* @summary Setup attributes
|
|
37
|
-
*/
|
|
38
|
-
setupAttributes() {
|
|
39
|
-
this.isShadowRoot = "open";
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* @summary Draw method
|
|
43
|
-
* @param {Object} context - The context
|
|
44
|
-
* @param {Object} store - The store
|
|
45
|
-
* @param {Object} params - The parameters
|
|
46
|
-
* @returns {Object} Document fragment
|
|
47
|
-
*/
|
|
48
|
-
draw(n, m, c) {
|
|
49
|
-
let o = document.createDocumentFragment(), s = document.createElement("slot");
|
|
50
|
-
return o.appendChild(s), o;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
r.define("wje-visually-hidden", r);
|
|
54
|
-
export {
|
|
55
|
-
r as default
|
|
56
|
-
};
|