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-container.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
var a = Object.defineProperty;
|
|
2
|
-
var d = (t, e, n) => e in t ? a(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
|
-
var r = (t, e, n) => (d(t, typeof e != "symbol" ? e + "" : e, n), n);
|
|
4
|
-
import s from "./wje-element.js";
|
|
5
|
-
const c = ":host{--wje-container-indent: 0;display:flex;flex-direction:row;flex:1;flex-basis:auto;box-sizing:border-box;min-width:0}:host([vertical]){flex-direction:column}@media (min-width: 768px){:host([indent]){margin-left:var(--wje-container-indent)}}";
|
|
6
|
-
class l extends s {
|
|
7
|
-
/**
|
|
8
|
-
* Container constructor.
|
|
9
|
-
*/
|
|
10
|
-
constructor() {
|
|
11
|
-
super();
|
|
12
|
-
/**
|
|
13
|
-
* Class name for the Container.
|
|
14
|
-
* @type {string}
|
|
15
|
-
*/
|
|
16
|
-
r(this, "className", "Container");
|
|
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 Container.
|
|
36
|
-
*/
|
|
37
|
-
setupAttributes() {
|
|
38
|
-
this.isShadowRoot = "open";
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Draws the Container.
|
|
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(n, m, u) {
|
|
48
|
-
let i = document.createDocumentFragment();
|
|
49
|
-
this.indent && this.style.setProperty("--wje-container-indent", this.indent);
|
|
50
|
-
let o = document.createElement("slot");
|
|
51
|
-
return i.appendChild(o), i;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
s.define("wje-container", l);
|
|
55
|
-
export {
|
|
56
|
-
l as default
|
|
57
|
-
};
|
package/dist/wje-copy-button.js
DELETED
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
var h = Object.defineProperty;
|
|
2
|
-
var m = (o, e, t) => e in o ? h(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
|
|
3
|
-
var r = (o, e, t) => (m(o, typeof e != "symbol" ? e + "" : e, t), t);
|
|
4
|
-
import f, { event as c } from "./wje-element.js";
|
|
5
|
-
import b from "./wje-input.js";
|
|
6
|
-
function y(o) {
|
|
7
|
-
const e = document.createElement("pre");
|
|
8
|
-
return e.style.width = "1px", e.style.height = "1px", e.style.position = "fixed", e.style.top = "5px", e.textContent = o, e;
|
|
9
|
-
}
|
|
10
|
-
function p(o) {
|
|
11
|
-
if ("clipboard" in navigator)
|
|
12
|
-
return navigator.clipboard.writeText(o.textContent || "");
|
|
13
|
-
const e = getSelection();
|
|
14
|
-
if (e == null)
|
|
15
|
-
return Promise.reject(new Error());
|
|
16
|
-
e.removeAllRanges();
|
|
17
|
-
const t = document.createRange();
|
|
18
|
-
return t.selectNodeContents(o), e.addRange(t), e.removeAllRanges(), Promise.resolve();
|
|
19
|
-
}
|
|
20
|
-
function l(o) {
|
|
21
|
-
if ("clipboard" in navigator)
|
|
22
|
-
return navigator.clipboard.writeText(o);
|
|
23
|
-
const e = document.body;
|
|
24
|
-
if (!e)
|
|
25
|
-
return Promise.reject(new Error());
|
|
26
|
-
const t = y(o);
|
|
27
|
-
return e.appendChild(t), p(t), e.removeChild(t), Promise.resolve();
|
|
28
|
-
}
|
|
29
|
-
const g = ":host{cursor:pointer;padding:.5rem}";
|
|
30
|
-
class d extends f {
|
|
31
|
-
/**
|
|
32
|
-
* Constructor for the CopyButton class.
|
|
33
|
-
* Initializes the timeout property.
|
|
34
|
-
*/
|
|
35
|
-
constructor() {
|
|
36
|
-
super();
|
|
37
|
-
r(this, "className", "CopyButton");
|
|
38
|
-
/**
|
|
39
|
-
* Handles the click event.
|
|
40
|
-
* @param {Event} e - The event object.
|
|
41
|
-
*/
|
|
42
|
-
r(this, "clicked", (t) => {
|
|
43
|
-
const i = t.currentTarget;
|
|
44
|
-
i instanceof HTMLElement && this.copy(i);
|
|
45
|
-
});
|
|
46
|
-
/**
|
|
47
|
-
* Handles the keydown event.
|
|
48
|
-
* @param {Event} e - The event object.
|
|
49
|
-
*/
|
|
50
|
-
r(this, "keydown", (t) => {
|
|
51
|
-
if (t.key === " " || t.key === "Enter") {
|
|
52
|
-
const i = t.currentTarget;
|
|
53
|
-
i instanceof HTMLElement && this.copy(i);
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
/**
|
|
57
|
-
* Handles the focus event.
|
|
58
|
-
* @param {Event} e - The event object.
|
|
59
|
-
*/
|
|
60
|
-
r(this, "focused", (t) => {
|
|
61
|
-
t.currentTarget.addEventListener("keydown", this.keydown);
|
|
62
|
-
});
|
|
63
|
-
/**
|
|
64
|
-
* Handles the blur event.
|
|
65
|
-
* @param {Event} e - The event object.
|
|
66
|
-
*/
|
|
67
|
-
r(this, "blurred", (t) => {
|
|
68
|
-
t.currentTarget.removeEventListener("keydown", this.keydown);
|
|
69
|
-
});
|
|
70
|
-
/**
|
|
71
|
-
* Handles the copied event.
|
|
72
|
-
* @param {Event} e - The event object.
|
|
73
|
-
*/
|
|
74
|
-
r(this, "copied", (t) => {
|
|
75
|
-
this.icon.setAttribute("color", "success"), this.icon.setAttribute("name", "check"), this.tooltip.setAttribute("content", this.labelSuccess || "Copied"), setTimeout(() => {
|
|
76
|
-
this.icon.removeAttribute("color"), this.icon.setAttribute("name", "clipboard"), this.tooltip.setAttribute("content", this.label || "Copy");
|
|
77
|
-
}, this.timeout);
|
|
78
|
-
});
|
|
79
|
-
this.timeout = 1e3;
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Setter for the value property.
|
|
83
|
-
* @param {string} value - The value to be set.
|
|
84
|
-
*/
|
|
85
|
-
set value(t) {
|
|
86
|
-
this.setAttribute("value", t);
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Getter for the value property.
|
|
90
|
-
* @returns {string} The value of the value property.
|
|
91
|
-
*/
|
|
92
|
-
get value() {
|
|
93
|
-
return this.getAttribute("value") || "";
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* Getter for the cssStyleSheet property.
|
|
97
|
-
* @returns {string} The CSS styles.
|
|
98
|
-
*/
|
|
99
|
-
static get cssStyleSheet() {
|
|
100
|
-
return g;
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* Getter for the observedAttributes property.
|
|
104
|
-
* @returns {Array} An empty array.
|
|
105
|
-
*/
|
|
106
|
-
static get observedAttributes() {
|
|
107
|
-
return [];
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
* Sets up the attributes for the CopyButton.
|
|
111
|
-
*/
|
|
112
|
-
setupAttributes() {
|
|
113
|
-
this.isShadowRoot = "open";
|
|
114
|
-
}
|
|
115
|
-
/**
|
|
116
|
-
* Draws the ColorPicker.
|
|
117
|
-
* @param {Object} context - The context to draw in.
|
|
118
|
-
* @param {Object} store - The store to use.
|
|
119
|
-
* @param {Object} params - The parameters to use.
|
|
120
|
-
* @returns {DocumentFragment} The created document fragment.
|
|
121
|
-
*/
|
|
122
|
-
draw(t, i, a) {
|
|
123
|
-
let s = document.createDocumentFragment(), n = document.createElement("wje-tooltip");
|
|
124
|
-
n.setAttribute("offset", "5"), n.setAttribute("content", this.label || "Copy");
|
|
125
|
-
let u = document.createElement("wje-icon");
|
|
126
|
-
return u.setAttribute("name", "clipboard"), n.appendChild(u), s.appendChild(n), this.tooltip = n, this.icon = u, s;
|
|
127
|
-
}
|
|
128
|
-
/**
|
|
129
|
-
* Sets up the event listeners after the CopyButton is drawn.
|
|
130
|
-
*/
|
|
131
|
-
afterDraw() {
|
|
132
|
-
c.addListener(this, "click", null, this.clicked), c.addListener(this, "focus", null, this.focused), c.addListener(this, "blur", null, this.blurred), c.addListener(this, "wje:copy-button", null, this.copied);
|
|
133
|
-
}
|
|
134
|
-
/**
|
|
135
|
-
* Copies the specified text or node.
|
|
136
|
-
* @param {HTMLElement} button - The button element.
|
|
137
|
-
*/
|
|
138
|
-
async copy(t) {
|
|
139
|
-
const i = this.getAttribute("for"), a = this.getAttribute("value");
|
|
140
|
-
if (t.getAttribute("aria-disabled") !== "true") {
|
|
141
|
-
if (a)
|
|
142
|
-
await l(a), c.dispatchCustomEvent(this, "wje:copy-button");
|
|
143
|
-
else if (i) {
|
|
144
|
-
const s = "getRootNode" in Element.prototype ? t.getRootNode() : t.ownerDocument;
|
|
145
|
-
if (!(s instanceof Document || "ShadowRoot" in window && s instanceof ShadowRoot))
|
|
146
|
-
return;
|
|
147
|
-
const n = s.getElementById(i);
|
|
148
|
-
n && (await this.copyTarget(n), c.dispatchCustomEvent(this, "wje:copy-button"));
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
/**
|
|
153
|
-
* Copies the target content.
|
|
154
|
-
* @param {HTMLElement} content - The content to be copied.
|
|
155
|
-
* @returns {Promise} A promise that resolves when the content is copied.
|
|
156
|
-
*/
|
|
157
|
-
copyTarget(t) {
|
|
158
|
-
return t instanceof HTMLInputElement || t instanceof HTMLTextAreaElement || t instanceof b ? l(t.value) : t instanceof HTMLAnchorElement && t.hasAttribute("href") ? l(t.href) : p(t);
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
d.define("wje-copy-button", d);
|
|
162
|
-
export {
|
|
163
|
-
d as default
|
|
164
|
-
};
|
package/dist/wje-dialog.js
DELETED
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
var u = Object.defineProperty;
|
|
2
|
-
var f = (o, t, e) => t in o ? u(o, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[t] = e;
|
|
3
|
-
var s = (o, t, e) => (f(o, typeof t != "symbol" ? t + "" : t, e), e);
|
|
4
|
-
import v, { event as p } from "./wje-element.js";
|
|
5
|
-
import "./wje-icon.js";
|
|
6
|
-
const x = ':host .close{margin-left:auto}:host .modal-content{border-radius:3px;box-shadow:none}:host .dialog-header{position:relative;border-bottom:0;padding-inline:var(--wje-dialog-padding);padding-top:var(--wje-dialog-padding);padding-bottom:var(--wje-dialog-padding);display:flex;align-items:center}:host .dialog-header span{font-family:var(--wje-font-family-secondary);font-size:10.5px;text-transform:uppercase;display:inline-block;letter-spacing:.06em;font-weight:500;margin:0;padding:0;line-height:normal;overflow:hidden;text-overflow:ellipsis;filter:alpha(opacity=40)}:host .dialog-content{box-shadow:none;padding-inline:var(--wje-dialog-padding);white-space:normal;z-index:1}:host .dialog-footer{display:flex;justify-content:end;border-top:none;box-shadow:none;margin-top:0;padding-inline:var(--wje-dialog-padding-inline);padding-top:var(--wje-dialog-padding-top);padding-bottom:var(--wje-dialog-padding-bottom)}dialog::backdrop{opacity:var(--wje-backdrop-opacity);background-color:var(--wje-backdrop)}dialog:focus-visible{outline:none}:host(.separator) .dialog-header:after{content:"";height:1px;background:#00000014;left:var(--wje-dialog-padding);right:var(--wje-dialog-padding);position:absolute;bottom:0}:host dialog{box-sizing:border-box;transition:all .2s!important;width:var(--wje-dialog-width);height:var(--wje-dialog-height);box-shadow:0 .5rem 1rem #00000026;border-radius:var(--wje-dialog-border-radius);border-width:var(--wje-dialog-border-width);border-style:var(--wje-dialog-border-style);border-color:var(--wje-dialog-border-color);margin-top:var(--wje-dialog-margin-top);margin-bottom:var(--wje-dialog-margin-bottom);margin-inline:var(--wje-dialog-margin-start) var(--wje-dialog-margin-end);padding:0}:host(.stick-up){--wje-dialog-width: 300px !important;--wje-dialog-height: fit-content;--wje-dialog-border-radius: 0 0 8px 8px;--wje-dialog-border-width: 0 1px 1px 1px;--wje-dialog-margin-top: 0;--wje-dialog-translate-from: translateY(-110%);--wje-dialog-template-to: translateX(0)}:host(.slide-up){--wje-dialog-width: 300px !important;--wje-dialog-height: fit-content;--wje-dialog-border-radius: 8px;--wje-dialog-border-width: 1px;--wje-dialog-opacity-from: 0;--wje-dialog-translate-from: scale(.9);--wje-dialog-translate-to: scale(1)}:host(.fill-in){--wje-dialog-width: 100%;--wje-dialog-height: 100%;--wje-dialog-border-radius: 0 0 0 0 !important;--wje-dialog-border-width: 0;--wje-dialog-margin-top: 0;--wje-dialog-margin-start: 0;--wje-dialog-margin-end: 0;--wje-dialog-margin-bottom: 0;--wje-dialog-translate-from: scale(.95);--wje-dialog-translate-to: scale(1)}:host(.fill-in) dialog{min-width:var(--wje-dialog-width);min-height:var(--wje-dialog-height)}:host(.slide-left){--wje-dialog-width: 300px !important;--wje-dialog-height: 100% !important;--wje-dialog-border-radius: 0;--wje-dialog-border-width: 0 1px 0 0;--wje-dialog-margin-top: 0;--wje-dialog-margin-start: 0;--wje-dialog-margin-end: auto;--wje-dialog-margin-bottom: 0}:host(.slide-left) dialog{min-height:var(--wje-dialog-height);--wje-dialog-translate-from: translateX(-110%);--wje-dialog-template-to: translateX(0)}:host(.slide-right){--wje-dialog-width: 300px !important;--wje-dialog-height: 100% !important;--wje-dialog-border-radius: 0;--wje-dialog-border-width: 0 0 0 1px;--wje-dialog-margin-top: 0;--wje-dialog-margin-start: auto;--wje-dialog-margin-end: 0;--wje-dialog-margin-bottom: 0}:host(.slide-right) dialog{min-height:var(--wje-dialog-height);--wje-dialog-translate-from: translateX(110%);--wje-dialog-template-to: translateX(0)}:host(.small){--wje-dialog-width: 300px !important}:host(.medium){--wje-dialog-width: 500px !important}:host(.large){--wje-dialog-width: 600px !important}:host(.ex-large){--wje-dialog-width: 900px !important}dialog[open]{animation:show .5s ease normal}@keyframes show{0%{opacity:var(--wje-dialog-opacity-from, 1);transform:var(--wje-dialog-translate-from)}to{opacity:1;transform:var(--wje-dialog-translate-to)}}';
|
|
7
|
-
class j extends v {
|
|
8
|
-
constructor() {
|
|
9
|
-
super();
|
|
10
|
-
s(this, "className", "Dialog");
|
|
11
|
-
s(this, "onOpen", (e) => {
|
|
12
|
-
Promise.resolve(this.beforeOpen(this)).then((g) => {
|
|
13
|
-
this.dialog.showModal(), this.dialog.open && Promise.resolve(this.afterOpen(this));
|
|
14
|
-
});
|
|
15
|
-
});
|
|
16
|
-
s(this, "onClose", (e) => {
|
|
17
|
-
Promise.resolve(this.beforeClose(this)).then((g) => {
|
|
18
|
-
this.dialog.close(), this.dialog.open && Promise.resolve(this.afterClose(this));
|
|
19
|
-
});
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
set placement(e) {
|
|
23
|
-
this.setAttribute("placement", e);
|
|
24
|
-
}
|
|
25
|
-
get placement() {
|
|
26
|
-
return this.getAttribute("placement") || "slide-up";
|
|
27
|
-
}
|
|
28
|
-
set async(e) {
|
|
29
|
-
this.setAttribute("async", "");
|
|
30
|
-
}
|
|
31
|
-
get async() {
|
|
32
|
-
return this.hasAttribute("async");
|
|
33
|
-
}
|
|
34
|
-
static get cssStyleSheet() {
|
|
35
|
-
return x;
|
|
36
|
-
}
|
|
37
|
-
static get observedAttributes() {
|
|
38
|
-
return [];
|
|
39
|
-
}
|
|
40
|
-
setupAttributes() {
|
|
41
|
-
this.isShadowRoot = "open";
|
|
42
|
-
}
|
|
43
|
-
draw(e, g, r) {
|
|
44
|
-
let m = document.createDocumentFragment();
|
|
45
|
-
this.classList.add("fade", this.placement, r.size);
|
|
46
|
-
let b = document.createElement("slot"), a = document.createElement("dialog");
|
|
47
|
-
a.classList.add("modal-dialog");
|
|
48
|
-
let h = document.createElement("wje-icon");
|
|
49
|
-
h.setAttribute("name", "x"), h.setAttribute("slot", "icon-only");
|
|
50
|
-
let i = document.createElement("wje-button");
|
|
51
|
-
i.setAttribute("fill", "link"), i.setAttribute("size", "small"), i.classList.add("close"), i.addEventListener("click", () => {
|
|
52
|
-
this.close();
|
|
53
|
-
}), i.appendChild(h);
|
|
54
|
-
let d = document.createElement("div");
|
|
55
|
-
d.setAttribute("part", "header"), d.classList.add("dialog-header"), this.hasAttribute("headline") && (d.innerHTML = `<span>${this.headline}</span>`), d.appendChild(i);
|
|
56
|
-
let w = document.createElement("slot");
|
|
57
|
-
w.setAttribute("name", "header"), d.appendChild(w);
|
|
58
|
-
let n = document.createElement("div");
|
|
59
|
-
n.setAttribute("part", "body"), n.classList.add("dialog-content"), n.appendChild(b);
|
|
60
|
-
let l = document.createElement("div");
|
|
61
|
-
l.setAttribute("part", "footer"), l.classList.add("dialog-footer"), l.innerHTML = "";
|
|
62
|
-
let c = document.createElement("slot");
|
|
63
|
-
return c.setAttribute("name", "footer"), l.appendChild(c), a.appendChild(d), a.appendChild(n), a.appendChild(l), m.appendChild(a), this.dialog = a, m;
|
|
64
|
-
}
|
|
65
|
-
close() {
|
|
66
|
-
this.onClose();
|
|
67
|
-
}
|
|
68
|
-
afterDraw(e, g, r) {
|
|
69
|
-
this.button = document.querySelector(`[dialog=${r.trigger}]`), r.trigger && p.addListener(this.button, r.trigger, null, this.onOpen);
|
|
70
|
-
}
|
|
71
|
-
beforeOpen() {
|
|
72
|
-
}
|
|
73
|
-
afterOpen() {
|
|
74
|
-
}
|
|
75
|
-
beforeClose() {
|
|
76
|
-
}
|
|
77
|
-
afterClose() {
|
|
78
|
-
}
|
|
79
|
-
disconnectedCallback() {
|
|
80
|
-
p.removeElement(this.button), p.removeElement(this.dialog);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
j.define("wje-dialog", j);
|
|
84
|
-
export {
|
|
85
|
-
j as default
|
|
86
|
-
};
|
package/dist/wje-divider.js
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
var n = Object.defineProperty;
|
|
2
|
-
var l = (r, e, t) => e in r ? n(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
3
|
-
var o = (r, e, t) => (l(r, typeof e != "symbol" ? e + "" : e, t), t);
|
|
4
|
-
import c from "./wje-element.js";
|
|
5
|
-
const v = ":host(:not([vertical])){display:block;border-top:var(--wje-divider-border-width) var(--wje-divider-border-style) var(--wje-divider-border-color);margin:var(--wje-divider-spacing) 0}:host([vertical]){display:inline-block;height:100%;border-left:var(--wje-divider-border-width) var(--wje-divider-border-style) var(--wje-divider-border-color);margin:0 var(--wje-divider-spacing)}";
|
|
6
|
-
class a extends c {
|
|
7
|
-
/**
|
|
8
|
-
* Constructor for the Divider class.
|
|
9
|
-
*/
|
|
10
|
-
constructor() {
|
|
11
|
-
super();
|
|
12
|
-
/**
|
|
13
|
-
* The class name for the Divider class.
|
|
14
|
-
* @type {string}
|
|
15
|
-
*/
|
|
16
|
-
o(this, "className", "Divider");
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Getter for the CSS stylesheet.
|
|
20
|
-
* @returns {string} The CSS stylesheet.
|
|
21
|
-
*/
|
|
22
|
-
static get cssStyleSheet() {
|
|
23
|
-
return v;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Getter for the observed attributes.
|
|
27
|
-
* @returns {Array} An empty array as there are no observed attributes.
|
|
28
|
-
*/
|
|
29
|
-
static get observedAttributes() {
|
|
30
|
-
return [];
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Sets up the attributes for the Divider.
|
|
34
|
-
*/
|
|
35
|
-
setupAttributes() {
|
|
36
|
-
this.isShadowRoot = "open";
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Draws the Divider.
|
|
40
|
-
* @param {Object} context - The context for drawing.
|
|
41
|
-
* @param {Object} store - The store for drawing.
|
|
42
|
-
* @param {Object} params - The parameters for drawing.
|
|
43
|
-
* @returns {DocumentFragment} The created document fragment.
|
|
44
|
-
*/
|
|
45
|
-
draw(t, m, p) {
|
|
46
|
-
let i = document.createDocumentFragment(), d = document.createElement("div"), s = document.createElement("slot");
|
|
47
|
-
return d.appendChild(s), i.appendChild(d), i;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
a.define("wje-divider", a);
|
|
51
|
-
export {
|
|
52
|
-
a as default
|
|
53
|
-
};
|
package/dist/wje-dropdown.js
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
var d = Object.defineProperty;
|
|
2
|
-
var u = (r, t, e) => t in r ? d(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
|
|
3
|
-
var i = (r, t, e) => (u(r, typeof t != "symbol" ? t + "" : t, e), e);
|
|
4
|
-
import m, { event as a } from "./wje-element.js";
|
|
5
|
-
import { P as w } from "./popup.element-CpEjis9f.js";
|
|
6
|
-
class h extends m {
|
|
7
|
-
constructor() {
|
|
8
|
-
super();
|
|
9
|
-
i(this, "depandencies", {
|
|
10
|
-
"wje-popup": w
|
|
11
|
-
});
|
|
12
|
-
i(this, "className", "Dropdown");
|
|
13
|
-
/**
|
|
14
|
-
* @summary Open the popup
|
|
15
|
-
* @param e
|
|
16
|
-
*/
|
|
17
|
-
i(this, "onOpen", async (e) => {
|
|
18
|
-
this.classList.add("active"), Promise.resolve(this.beforeShow(this)).then((l) => {
|
|
19
|
-
if (!this.classList.contains("active"))
|
|
20
|
-
throw new Error("beforeShow method returned false or not string");
|
|
21
|
-
this.popup.show(), Promise.resolve(this.afterShow(this));
|
|
22
|
-
}).catch((l) => {
|
|
23
|
-
this.classList.remove("active"), this.popup.hide();
|
|
24
|
-
});
|
|
25
|
-
});
|
|
26
|
-
/*
|
|
27
|
-
* @summary Close the popup
|
|
28
|
-
* @param e
|
|
29
|
-
*/
|
|
30
|
-
i(this, "onClose", async (e) => {
|
|
31
|
-
this.classList.remove("active"), this.popup.hide();
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
set trigger(e) {
|
|
35
|
-
this.setAttribute("trigger", e);
|
|
36
|
-
}
|
|
37
|
-
get trigger() {
|
|
38
|
-
return this.getAttribute("trigger") || "click";
|
|
39
|
-
}
|
|
40
|
-
static get observedAttributes() {
|
|
41
|
-
return ["active"];
|
|
42
|
-
}
|
|
43
|
-
setupAttributes() {
|
|
44
|
-
this.isShadowRoot = "open";
|
|
45
|
-
}
|
|
46
|
-
draw(e, l, f) {
|
|
47
|
-
let c = document.createDocumentFragment();
|
|
48
|
-
this.classList.add("wje-placement", "wje-" + this.placement || "wje-start");
|
|
49
|
-
let o = document.createElement("div");
|
|
50
|
-
o.setAttribute("part", "native"), o.classList.add("native-dropdown");
|
|
51
|
-
let n = document.createElement("slot");
|
|
52
|
-
n.setAttribute("name", "trigger"), n.setAttribute("slot", "anchor");
|
|
53
|
-
let p = document.createElement("slot"), s = document.createElement("wje-popup");
|
|
54
|
-
return s.setAttribute("placement", this.placement), s.setAttribute("offset", this.offset), s.appendChild(n), s.appendChild(p), s.setAttribute("manual", ""), o.appendChild(s), c.appendChild(o), this.popup = s, this.anchorSlot = n, c;
|
|
55
|
-
}
|
|
56
|
-
afterDraw() {
|
|
57
|
-
this.trigger != "click" ? (a.addListener(this, "mouseenter", null, this.onOpen), a.addListener(this, "mouseleave", null, this.onClose)) : a.addListener(this.anchorSlot, "click", null, this.onOpen), this.hasAttribute("collapsible") && a.addListener(Array.from(this.querySelectorAll("wje-menu-item")), "click", "wje-menu-item:click", this.onClose);
|
|
58
|
-
}
|
|
59
|
-
beforeShow() {
|
|
60
|
-
return this.content;
|
|
61
|
-
}
|
|
62
|
-
afterShow() {
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
h.define("wje-dropdown", h);
|
|
66
|
-
export {
|
|
67
|
-
h as default
|
|
68
|
-
};
|