wj-elements 0.1.13 → 0.1.15
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/dist/dark.css +1 -0
- package/dist/light.css +1 -0
- package/dist/localize-DVuO3S17.js +43 -0
- package/dist/popup.element-CpEjis9f.js +1068 -0
- package/dist/router-links-FtZbFUto.js +146 -0
- package/dist/styles.css +1 -0
- package/dist/wje-accordion-item.js +88 -0
- package/dist/wje-accordion.js +79 -0
- package/dist/wje-animation.js +121 -0
- package/dist/wje-aside.js +55 -0
- package/dist/wje-avatar.js +74 -0
- package/dist/wje-badge.js +50 -0
- package/dist/wje-breadcrumb.js +148 -0
- package/dist/wje-breadcrumbs.js +67 -0
- package/dist/wje-button-group.js +78 -0
- package/dist/wje-button.js +175 -0
- package/dist/wje-card-content.js +48 -0
- package/dist/wje-card-controls.js +48 -0
- package/dist/wje-card-header.js +47 -0
- package/dist/wje-card-subtitle.js +55 -0
- package/dist/wje-card-title.js +55 -0
- package/dist/wje-card.js +50 -0
- package/dist/wje-carousel-item.js +33 -0
- package/dist/wje-carousel.js +177 -0
- package/dist/wje-checkbox.js +104 -0
- package/dist/wje-chip.js +32 -0
- package/dist/wje-col.js +27 -0
- package/dist/wje-color-picker.js +953 -0
- package/dist/wje-container.js +57 -0
- package/dist/wje-copy-button.js +164 -0
- package/dist/wje-dialog.js +86 -0
- package/dist/wje-divider.js +53 -0
- package/dist/wje-dropdown.js +68 -0
- package/dist/wje-element.js +453 -0
- package/dist/wje-fetchAndParseCSS.js +40 -0
- package/dist/wje-file-upload-item.js +115 -0
- package/dist/wje-file-upload.js +297 -0
- package/dist/wje-footer.js +56 -0
- package/dist/wje-form.js +28 -0
- package/dist/wje-format-digital.js +85 -0
- package/dist/wje-grid.js +28 -0
- package/dist/wje-header.js +58 -0
- package/dist/wje-icon-picker.js +221 -0
- package/dist/wje-icon.js +119 -0
- package/dist/wje-img-comparer.js +111 -0
- package/dist/wje-img.js +58 -0
- package/dist/wje-infinite-scroll.js +193 -0
- package/dist/wje-inline-edit.js +120 -0
- package/dist/wje-input-file.js +85 -0
- package/dist/wje-input.js +240 -0
- package/dist/wje-item.js +45 -0
- package/dist/wje-label.js +67 -0
- package/dist/wje-list.js +53 -0
- package/dist/wje-main.js +56 -0
- package/dist/wje-masonry.js +218 -0
- package/dist/wje-master.js +196 -0
- package/dist/wje-menu-button.js +65 -0
- package/dist/wje-menu-item.js +192 -0
- package/dist/wje-menu-label.js +57 -0
- package/dist/wje-menu.js +74 -0
- package/dist/wje-option.js +99 -0
- package/dist/wje-options.js +63 -0
- package/dist/wje-popup.js +5 -0
- package/dist/wje-progress-bar.js +145 -0
- package/dist/wje-radio-group.js +101 -0
- package/dist/wje-radio.js +46 -0
- package/dist/wje-rate.js +260 -0
- package/dist/wje-relative-time.js +85 -0
- package/dist/wje-reorder-dropzone.js +27 -0
- package/dist/wje-reorder-item.js +32 -0
- package/dist/wje-reorder.js +132 -0
- package/dist/wje-route.js +28 -0
- package/dist/wje-router-link.js +64 -0
- package/dist/wje-router-outlet.js +127 -0
- package/dist/wje-routerx.js +1088 -0
- package/dist/wje-row.js +58 -0
- package/dist/wje-select.js +240 -0
- package/dist/wje-slider.js +177 -0
- package/dist/wje-split-view.js +112 -0
- package/dist/wje-store.js +192 -0
- package/dist/wje-tab-group.js +105 -0
- package/dist/wje-tab-panel.js +52 -0
- package/dist/wje-tab.js +59 -0
- package/dist/wje-textarea.js +116 -0
- package/dist/wje-thumbnail.js +64 -0
- package/dist/wje-toast.js +76 -0
- package/dist/wje-toggle.js +94 -0
- package/dist/wje-toolbar-action.js +63 -0
- package/dist/wje-toolbar.js +61 -0
- package/dist/wje-tooltip.js +105 -0
- package/dist/wje-visually-hidden.js +56 -0
- package/package.json +1 -1
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
var h = Object.defineProperty;
|
|
2
|
+
var o = (u, r, e) => r in u ? h(u, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : u[r] = e;
|
|
3
|
+
var n = (u, r, e) => (o(u, typeof r != "symbol" ? r + "" : r, e), e);
|
|
4
|
+
class d {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.events = {};
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Either create a new event instance for passed `event` name
|
|
10
|
+
* or push a new callback into the existing collection
|
|
11
|
+
*
|
|
12
|
+
* @param {string} event
|
|
13
|
+
* @param {function} callback
|
|
14
|
+
* @returns {number} A count of callbacks for this event
|
|
15
|
+
* @memberof PubSub
|
|
16
|
+
*/
|
|
17
|
+
subscribe(r, e) {
|
|
18
|
+
let t = this;
|
|
19
|
+
return t.events.hasOwnProperty(r) || (t.events[r] = []), t.events[r].push(e) - 1, {
|
|
20
|
+
unsubscribe() {
|
|
21
|
+
t.events[r].splice(t.events[r].indexOf(e), 1);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* If the passed event has callbacks attached to it, loop through each one
|
|
27
|
+
* and call it
|
|
28
|
+
*
|
|
29
|
+
* @param {string} event
|
|
30
|
+
* @param {object} [data={}]
|
|
31
|
+
* @returns {array} The callbacks for this event, or an empty array if no event exits
|
|
32
|
+
* @memberof PubSub
|
|
33
|
+
*/
|
|
34
|
+
publish(r, e = {}, t) {
|
|
35
|
+
let s = this;
|
|
36
|
+
return s.events.hasOwnProperty(r) ? s.events[r].map((i) => i(e, t)) : [];
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
const c = (u) => (r) => ({
|
|
40
|
+
type: `${u}/ADD`,
|
|
41
|
+
payload: r
|
|
42
|
+
}), p = (u) => (r) => ({
|
|
43
|
+
type: `${u}/ADD_MANY`,
|
|
44
|
+
payload: r
|
|
45
|
+
}), l = (u) => (r) => ({
|
|
46
|
+
type: `${u}/UPDATE`,
|
|
47
|
+
payload: r
|
|
48
|
+
}), a = (u) => (r) => ({
|
|
49
|
+
type: `${u}/DELETE`,
|
|
50
|
+
payload: r
|
|
51
|
+
}), f = (u) => (r) => ({
|
|
52
|
+
type: `${u}/LOAD`,
|
|
53
|
+
payload: r
|
|
54
|
+
}), y = {
|
|
55
|
+
addAction: c,
|
|
56
|
+
deleteAction: a,
|
|
57
|
+
loadAction: f,
|
|
58
|
+
updateAction: l,
|
|
59
|
+
addManyAction: p
|
|
60
|
+
};
|
|
61
|
+
class A {
|
|
62
|
+
constructor(r = {}) {
|
|
63
|
+
n(this, "_state");
|
|
64
|
+
n(this, "_reducer");
|
|
65
|
+
n(this, "events");
|
|
66
|
+
n(this, "status");
|
|
67
|
+
this._isPause = !1, this._state = {}, this._reducer = function(t = {}, s) {
|
|
68
|
+
return {};
|
|
69
|
+
}, this.status = "resting", this.events = new d(), r != null && r.hasOwnProperty("reducer") && (this._reducer = r.reducer), this.refreshProxy(r == null ? void 0 : r.state);
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* A dispatcher for actions that looks in the actions
|
|
73
|
+
* collection and runs the action if it can find it
|
|
74
|
+
*
|
|
75
|
+
* @param {string} actionKey
|
|
76
|
+
* @param {mixed} payload
|
|
77
|
+
* @returns {boolean}
|
|
78
|
+
* @memberof Store
|
|
79
|
+
*/
|
|
80
|
+
dispatch(r) {
|
|
81
|
+
this.status = "action";
|
|
82
|
+
let e = this._reducer(this._state, r);
|
|
83
|
+
return this.status = "mutation", this._state = Object.assign(this._state, e), !0;
|
|
84
|
+
}
|
|
85
|
+
getState() {
|
|
86
|
+
return JSON.parse(JSON.stringify(this._state));
|
|
87
|
+
}
|
|
88
|
+
subscribe(r, e) {
|
|
89
|
+
return this.events.subscribe(r, e);
|
|
90
|
+
}
|
|
91
|
+
unsubscribe(r) {
|
|
92
|
+
delete this.events[r];
|
|
93
|
+
}
|
|
94
|
+
pause() {
|
|
95
|
+
return this._isPause = !0, this;
|
|
96
|
+
}
|
|
97
|
+
play(r) {
|
|
98
|
+
return this._isPause = !1, this;
|
|
99
|
+
}
|
|
100
|
+
mergeReducers(r, e) {
|
|
101
|
+
let t = this._reducer;
|
|
102
|
+
this._reducer = (s, i) => ({
|
|
103
|
+
...t(s, i),
|
|
104
|
+
[r]: e(s[r], i)
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
makeEveryArrayEntryAsStoreState(r, e = [], t = "id") {
|
|
108
|
+
e.forEach((s) => {
|
|
109
|
+
this.getState().hasOwnProperty(`${r}-${s[t]}`) ? this.dispatch(y.updateAction(`${r}-${s[t]}`)(s)) : this.define(`${r}-${s.id || s.source || s[t]}`, s, null, t);
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
define(r, e, t, s = "id") {
|
|
113
|
+
if (this._state.hasOwnProperty(r)) {
|
|
114
|
+
console.warn(`STATE už obsahuje premennú ${r},ktorú sa pokúšate pridať`);
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
t instanceof Function ? this.mergeReducers(r, t) : e instanceof Array ? this.mergeReducers(r, this.createArrayReducer(r, s)) : this.mergeReducers(r, this.createObjectReducer(r, s)), this.refreshProxy({
|
|
118
|
+
...this._state,
|
|
119
|
+
[r]: e
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
refreshProxy(r) {
|
|
123
|
+
this._state = new Proxy(r || {}, {
|
|
124
|
+
set: (e, t, s) => {
|
|
125
|
+
if (JSON.stringify(e[t]) === JSON.stringify(s))
|
|
126
|
+
return !0;
|
|
127
|
+
let i = e[t];
|
|
128
|
+
return e[t] = s, this._isPause || this.events.publish(t, this._state, i), this.status !== "mutation" && console.warn(`You should use a mutation to set ${t}`), this.status = "resting", !0;
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
createObjectReducer(r) {
|
|
133
|
+
return (e = {}, t) => {
|
|
134
|
+
switch (t.type) {
|
|
135
|
+
case `${r}/ADD`:
|
|
136
|
+
return {
|
|
137
|
+
...t.payload
|
|
138
|
+
};
|
|
139
|
+
case `${r}/UPDATE`:
|
|
140
|
+
return {
|
|
141
|
+
...e,
|
|
142
|
+
...t.payload
|
|
143
|
+
};
|
|
144
|
+
case `${r}/DELETE`:
|
|
145
|
+
return {};
|
|
146
|
+
default:
|
|
147
|
+
return e;
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
createArrayReducer(r, e) {
|
|
152
|
+
return (t = [], s) => {
|
|
153
|
+
switch (s.type) {
|
|
154
|
+
case `${r}/ADD`:
|
|
155
|
+
return Array.isArray(s.payload) ? [
|
|
156
|
+
...t,
|
|
157
|
+
...s.payload
|
|
158
|
+
] : [
|
|
159
|
+
...t,
|
|
160
|
+
s.payload
|
|
161
|
+
];
|
|
162
|
+
case `${r}/ADD_MANY`:
|
|
163
|
+
return [
|
|
164
|
+
...t,
|
|
165
|
+
...s.payload
|
|
166
|
+
];
|
|
167
|
+
case `${r}/UPDATE`:
|
|
168
|
+
return t.some((i) => i[e] == s.payload[e]) ? [
|
|
169
|
+
...t.map((i) => i[e] == s.payload[e] ? s.payload : i)
|
|
170
|
+
] : [
|
|
171
|
+
...t,
|
|
172
|
+
s.payload
|
|
173
|
+
];
|
|
174
|
+
case `${r}/DELETE`:
|
|
175
|
+
return [
|
|
176
|
+
...t.filter((i) => i.hasOwnProperty(e) && i[e] != s.payload[e] || !i.hasOwnProperty(e) && i != s.payload)
|
|
177
|
+
];
|
|
178
|
+
case `${r}/LOAD`:
|
|
179
|
+
return [
|
|
180
|
+
...s.payload
|
|
181
|
+
];
|
|
182
|
+
default:
|
|
183
|
+
return t;
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
let D = new A();
|
|
189
|
+
export {
|
|
190
|
+
y as defaultStoreActions,
|
|
191
|
+
D as store
|
|
192
|
+
};
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
var u = Object.defineProperty;
|
|
2
|
+
var m = (a, e, t) => e in a ? u(a, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[e] = t;
|
|
3
|
+
var v = (a, e, t) => (m(a, typeof e != "symbol" ? e + "" : e, t), t);
|
|
4
|
+
import h from "./wje-element.js";
|
|
5
|
+
const g = ":host{--wje-tab-top: 0;--wje-tab-start: 0;--wje-tab-end: 0;--wje-tab-bottom: 0}.native-tab-group{display:flex;flex-direction:column;overflow:hidden;position:relative}.native-tab-group>header{display:flex;flex-direction:column}.native-tab-group>header>nav{display:flex}.native-tab-group>section{width:100%}.native-tab-group>section>article{scroll-snap-align:start;overflow-y:auto;overscroll-behavior-y:contain}:host([variant=top]){--wje-tab-top: auto !important;--wje-tab-writing-mode: horizontal-tb}:host([variant=top]) .native-tab-group{flex-direction:column}:host([variant=top]) nav{border-bottom:1px solid var(--wje-border-color)}:host([variant=start]){--wje-tab-start: auto !important;--wje-tab-writing-mode: vertical-rl}:host([variant=start]) .native-tab-group{flex-direction:row}:host([variant=start]) nav{flex-direction:column;border-right:1px solid var(--wje-border-color)}:host([variant=end]){--wje-tab-writing-mode: vertical-rl}:host([variant=end]) .native-tab-group{flex-direction:row-reverse}:host([variant=end]) nav{flex-direction:column;border-left:1px solid var(--wje-border-color)}:host([variant=bottom]){--wje-tab-bottom: auto !important;--wje-tab-writing-mode: horizontal-tb}:host([variant=bottom]) .native-tab-group{flex-direction:column-reverse}:host([variant=bottom]) nav{border-top:1px solid var(--wje-border-color)}";
|
|
6
|
+
class b extends h {
|
|
7
|
+
/**
|
|
8
|
+
* Creates an instance of TabGroup.
|
|
9
|
+
*
|
|
10
|
+
* @constructor
|
|
11
|
+
*/
|
|
12
|
+
constructor() {
|
|
13
|
+
super();
|
|
14
|
+
v(this, "className", "TabGroup");
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Returns the CSS styles for the component.
|
|
18
|
+
*
|
|
19
|
+
* @static
|
|
20
|
+
* @returns {CSSStyleSheet}
|
|
21
|
+
*/
|
|
22
|
+
static get cssStyleSheet() {
|
|
23
|
+
return g;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Sets up the attributes for the component.
|
|
27
|
+
*/
|
|
28
|
+
setupAttributes() {
|
|
29
|
+
this.isShadowRoot = "open";
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Draws the component.
|
|
33
|
+
*
|
|
34
|
+
* @param {Object} context - The context for drawing.
|
|
35
|
+
* @param {Object} store - The store for drawing.
|
|
36
|
+
* @param {Object} params - The parameters for drawing.
|
|
37
|
+
* @returns {DocumentFragment}
|
|
38
|
+
*/
|
|
39
|
+
draw(t, n, o) {
|
|
40
|
+
let l = document.createDocumentFragment(), r = document.createElement("div");
|
|
41
|
+
r.classList.add("native-tab-group");
|
|
42
|
+
let i = document.createElement("header");
|
|
43
|
+
i.classList.add("scroll-snap-x");
|
|
44
|
+
let s = document.createElement("nav"), c = document.createElement("section"), p = document.createElement("slot"), d = document.createElement("slot");
|
|
45
|
+
return d.setAttribute("name", "nav"), i.appendChild(s), s.appendChild(d), c.appendChild(p), r.appendChild(i), r.appendChild(c), l.appendChild(r), l;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Sets up the event listeners after the component is drawn.
|
|
49
|
+
*/
|
|
50
|
+
afterDraw() {
|
|
51
|
+
let t = this.getActiveTab(), n = t ? t[0].name : this.getTabAll()[0].panel;
|
|
52
|
+
this.setActiveTab(n), this.addEventListener("wje:tab-change", (o) => {
|
|
53
|
+
if (o.detail.context.hasAttribute("disabled"))
|
|
54
|
+
return !1;
|
|
55
|
+
this.setActiveTab(o.detail.context.panel);
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Removes the active attribute from all tabs and panels.
|
|
60
|
+
*/
|
|
61
|
+
removeActiveTab() {
|
|
62
|
+
this.getPanelAll().forEach((t) => {
|
|
63
|
+
t.removeAttribute("active");
|
|
64
|
+
}), this.getTabAll().forEach((t) => {
|
|
65
|
+
t.removeAttribute("active");
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Sets the active tab and panel.
|
|
70
|
+
*
|
|
71
|
+
* @param {string} tab - The name of the tab to set as active.
|
|
72
|
+
*/
|
|
73
|
+
setActiveTab(t) {
|
|
74
|
+
this.removeActiveTab(), this.querySelector(`[panel="${t}"]`).setAttribute("active", ""), this.querySelector(`[name="${t}"]`).setAttribute("active", "");
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Returns the currently active tab.
|
|
78
|
+
*
|
|
79
|
+
* @returns {Element|null} The active tab, or null if no tab is active.
|
|
80
|
+
*/
|
|
81
|
+
getActiveTab() {
|
|
82
|
+
let t = Array.from(this.context.querySelectorAll("[active]"));
|
|
83
|
+
return t.length > 0 ? t[0] : null;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Returns all tabs.
|
|
87
|
+
*
|
|
88
|
+
* @returns {Array<Element>} An array of all tabs.
|
|
89
|
+
*/
|
|
90
|
+
getTabAll() {
|
|
91
|
+
return this.context.querySelector('[name="nav"]').assignedElements();
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Returns all panels.
|
|
95
|
+
*
|
|
96
|
+
* @returns {Array<Element>} An array of all panels.
|
|
97
|
+
*/
|
|
98
|
+
getPanelAll() {
|
|
99
|
+
return Array.from(this.querySelectorAll("wje-tab-panel"));
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
b.define("wje-tab-group", b);
|
|
103
|
+
export {
|
|
104
|
+
b as default
|
|
105
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
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 n = (t, e, a) => (c(t, typeof e != "symbol" ? e + "" : e, a), a);
|
|
4
|
+
import m from "./wje-element.js";
|
|
5
|
+
const p = ":host{display:none;flex-wrap:wrap;align-items:center;padding:1rem}:host([active]){display:block}";
|
|
6
|
+
class r extends m {
|
|
7
|
+
/**
|
|
8
|
+
* Creates an instance of TabPanel.
|
|
9
|
+
*
|
|
10
|
+
* @constructor
|
|
11
|
+
*/
|
|
12
|
+
constructor() {
|
|
13
|
+
super();
|
|
14
|
+
/**
|
|
15
|
+
* Returns the class name of the tab panel.
|
|
16
|
+
*
|
|
17
|
+
* @returns {string} The class name of the tab panel.
|
|
18
|
+
*/
|
|
19
|
+
n(this, "className", "TabPanel");
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Returns the CSS styles for the component.
|
|
23
|
+
*
|
|
24
|
+
* @static
|
|
25
|
+
* @returns {CSSStyleSheet}
|
|
26
|
+
*/
|
|
27
|
+
static get cssStyleSheet() {
|
|
28
|
+
return p;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Sets up the attributes for the component.
|
|
32
|
+
*/
|
|
33
|
+
setupAttributes() {
|
|
34
|
+
this.isShadowRoot = "open";
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Draws the component.
|
|
38
|
+
*
|
|
39
|
+
* @param {Object} context - The context for drawing.
|
|
40
|
+
* @param {Object} store - The store for drawing.
|
|
41
|
+
* @param {Object} params - The parameters for drawing.
|
|
42
|
+
* @returns {DocumentFragment}
|
|
43
|
+
*/
|
|
44
|
+
draw(a, d, i) {
|
|
45
|
+
let s = document.createDocumentFragment(), l = document.createElement("slot");
|
|
46
|
+
return s.appendChild(l), s;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
r.define("wje-tab-panel", r);
|
|
50
|
+
export {
|
|
51
|
+
r as default
|
|
52
|
+
};
|
package/dist/wje-tab.js
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
var l = Object.defineProperty;
|
|
2
|
+
var d = (e, t, a) => t in e ? l(e, t, { enumerable: !0, configurable: !0, writable: !0, value: a }) : e[t] = a;
|
|
3
|
+
var n = (e, t, a) => (d(e, typeof t != "symbol" ? t + "" : t, a), a);
|
|
4
|
+
import c, { event as p } from "./wje-element.js";
|
|
5
|
+
const b = ':host{display:block;position:relative}:host a{display:block;align-items:center;white-space:nowrap;font-family:var(--wje-font-family-secondary);font-size:var(--wje-font-size-small);letter-spacing:var(--wje-tab-letter-spacing);text-transform:var(--wje-tab-text-transfrom);font-weight:var(--wje-tab-font-weight);text-decoration:none;padding-inline:var(--wje-tab-padding-inline);padding-top:var(--wje-tab-padding-top);padding-bottom:var(--wje-tab-padding-bottom);color:var(--wje-color)}:host a>svg{inline-size:1.5em;pointer-events:none}:host a:hover{background:var(--wje-tab-color-hover)}:host a:hover:after{display:block}:host a:after{content:" ";display:none;block-size:.15rem;writing-mode:var(--wje-tab-writing-mode);background:var(--wje-tab-color-active);position:absolute;bottom:var(--wje-tab-bottom);left:var(--wje-tab-start);right:var(--wje-tab-end);top:var(--wje-tab-top)}:host([disabled]) a{opacity:.5;cursor:not-allowed;background:inherit}:host([disabled]) a:after{display:none}:host([active]) a:after{display:block}';
|
|
6
|
+
class s extends c {
|
|
7
|
+
/**
|
|
8
|
+
* Creates an instance of Tab.
|
|
9
|
+
*
|
|
10
|
+
* @constructor
|
|
11
|
+
*/
|
|
12
|
+
constructor() {
|
|
13
|
+
super();
|
|
14
|
+
/**
|
|
15
|
+
* Returns the class name of the tab.
|
|
16
|
+
*
|
|
17
|
+
* @returns {string} The class name of the tab.
|
|
18
|
+
*/
|
|
19
|
+
n(this, "className", "Tab");
|
|
20
|
+
this.last = !1;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Returns the CSS styles for the component.
|
|
24
|
+
*
|
|
25
|
+
* @static
|
|
26
|
+
* @returns {CSSStyleSheet}
|
|
27
|
+
*/
|
|
28
|
+
static get cssStyleSheet() {
|
|
29
|
+
return b;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Sets up the attributes for the component.
|
|
33
|
+
*/
|
|
34
|
+
setupAttributes() {
|
|
35
|
+
this.isShadowRoot = "open";
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Draws the component.
|
|
39
|
+
*
|
|
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}
|
|
44
|
+
*/
|
|
45
|
+
draw(a, w, h) {
|
|
46
|
+
let r = document.createDocumentFragment(), i = document.createElement("slot"), o = document.createElement("a");
|
|
47
|
+
return o.setAttribute("href", "#" + this.panel), o.appendChild(i), r.appendChild(o), r;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Sets up the event listeners after the component is drawn.
|
|
51
|
+
*/
|
|
52
|
+
afterDraw() {
|
|
53
|
+
p.addListener(this, "click", "wje:tab-change");
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
s.define("wje-tab", s);
|
|
57
|
+
export {
|
|
58
|
+
s as default
|
|
59
|
+
};
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
var p = Object.defineProperty;
|
|
2
|
+
var b = (i, a, t) => a in i ? p(i, a, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[a] = t;
|
|
3
|
+
var d = (i, a, t) => (b(i, typeof a != "symbol" ? a + "" : a, t), t);
|
|
4
|
+
import x, { event as h } from "./wje-element.js";
|
|
5
|
+
const v = ':host{width:100%;margin-bottom:var(--wje-textarea-margin-bottom);display:block}:host .wrapper{display:flex;width:100%;border-width:var(--wje-textarea-border-width);border-style:var(--wje-textarea-border-style);border-color:var(--wje-textarea-border-color);border-radius:var(--wje-textarea-border-radius)}:host textarea{font-family:var(--wje-textarea-font-family);color:var(--wje-textarea-color);font-size:14px;border:0 none;padding:0 var(--wje-textarea-padding)}:host textarea:focus{outline:none}:host([resize="auto"]) textarea,:host([resize="none"]) textarea{resize:none}.native-textarea .input-wrapper{width:100%;line-height:normal}.native-textarea.default{background-color:var(--wje-textarea-background-color);font-family:var(--wje-textarea-font-family);position:relative;padding-inline:0;padding-top:0;transition:background-color .2s ease;cursor:text}.native-textarea.default.focused .wrapper{border-color:var(--wje-textarea-border-color-focus)!important}.native-textarea.default.focused label{opacity:.67;font-size:12px;letter-spacing:normal}.native-textarea.default textarea{border:none;padding-top:0;background:none;box-shadow:none;width:calc(100% - var(--wje-textarea-padding) * 2);max-width:calc(100% - var(--wje-textarea-padding) * 2);min-width:calc(100% - var(--wje-textarea-padding) * 2)}.native-textarea.default label{padding:0 var(--wje-textarea-padding);display:block;opacity:1;cursor:text;transition:opacity .2s ease;line-height:var(--wje-textarea-line-height);padding-top:.25rem}.native-textarea.default label.fade{opacity:.5;font-size:12px;letter-spacing:normal}.native-textarea.default ::slotted([slot="start"]){border-left:none;border-top:none;border-bottom:none}.native-textarea.default ::slotted([slot="end"]){border-right:none;border-top:none;border-bottom:none}.native-textarea.standard{background-color:var(--wje-textarea-background-color);font-family:var(--wje-textarea-font-family);position:relative;border-radius:var(--wje-textarea-border-radius);padding:0;transition:background-color .2s ease;cursor:text}.native-textarea.standard.focused .wrapper{border-color:var(--wje-textarea-border-color-focus)!important}.native-textarea.standard textarea{display:block;min-height:32px;background:none;box-shadow:none;width:100%;box-sizing:border-box;border-radius:var(--wje-textarea-border-radius)}.native-textarea.standard label{margin:0;display:inline-block;opacity:1;cursor:text;transition:opacity .2s ease;line-height:var(--wje-textarea-line-height)}.native-textarea.standard ::slotted([slot="start"]){border-right:none;border-radius:var(--wje-textarea-border-radius) 0 0 var(--wje-textarea-border-radius)}.native-textarea.standard ::slotted([slot="end"]){border-left:none;border-radius:0 var(--wje-textarea-border-radius) var(--wje-textarea-border-radius) 0}.native-textarea.standard.has-start textarea{border-top-left-radius:0;border-bottom-left-radius:0}.native-textarea.standard.has-end textarea{border-top-right-radius:0;border-bottom-right-radius:0}.native-textarea.standard .error-message{position:static;background:transparent;padding:.25rem 0;left:auto;transform:none;color:var(--wje-textarea-color-invalid);font-size:12px;line-height:normal}.counter{float:right}';
|
|
6
|
+
class u extends x {
|
|
7
|
+
/**
|
|
8
|
+
* Creates an instance of Textarea.
|
|
9
|
+
*
|
|
10
|
+
* @constructor
|
|
11
|
+
*/
|
|
12
|
+
constructor() {
|
|
13
|
+
super();
|
|
14
|
+
d(this, "className", "Textarea");
|
|
15
|
+
/**
|
|
16
|
+
* Sets the height of the textarea.
|
|
17
|
+
*/
|
|
18
|
+
d(this, "setTextareaHeight", () => {
|
|
19
|
+
this.getAttribute("resize") === "auto" && (this.input.style.height = "auto", this.input.style.height = this.input.scrollHeight + "px");
|
|
20
|
+
});
|
|
21
|
+
/**
|
|
22
|
+
* Updates the counter for the textarea.
|
|
23
|
+
*
|
|
24
|
+
* @param {Event} e - The event object.
|
|
25
|
+
*/
|
|
26
|
+
d(this, "counter", (t) => {
|
|
27
|
+
this.counterElement.innerText = t.target.value.length + "/" + this.input.maxLength;
|
|
28
|
+
});
|
|
29
|
+
this._checked = !1;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Sets the checked state of the textarea.
|
|
33
|
+
*
|
|
34
|
+
* @param {boolean} value - The checked state.
|
|
35
|
+
*/
|
|
36
|
+
set checked(t) {
|
|
37
|
+
this._checked = t, t ? this.setAttribute("checked", "") : this.removeAttribute("checked");
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Returns the checked state of the textarea.
|
|
41
|
+
*
|
|
42
|
+
* @returns {boolean} The checked state.
|
|
43
|
+
*/
|
|
44
|
+
get checked() {
|
|
45
|
+
return this._checked;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Returns the CSS styles for the component.
|
|
49
|
+
*
|
|
50
|
+
* @static
|
|
51
|
+
* @returns {CSSStyleSheet}
|
|
52
|
+
*/
|
|
53
|
+
static get cssStyleSheet() {
|
|
54
|
+
return v;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Returns the list of attributes to observe for changes.
|
|
58
|
+
*
|
|
59
|
+
* @static
|
|
60
|
+
* @returns {Array<string>}
|
|
61
|
+
*/
|
|
62
|
+
static get observedAttributes() {
|
|
63
|
+
return ["checked"];
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Sets up the attributes for the component.
|
|
67
|
+
*/
|
|
68
|
+
setupAttributes() {
|
|
69
|
+
this.isShadowRoot = "open";
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Draws the component.
|
|
73
|
+
*
|
|
74
|
+
* @param {Object} context - The context for drawing.
|
|
75
|
+
* @param {Object} store - The store for drawing.
|
|
76
|
+
* @param {Object} params - The parameters for drawing.
|
|
77
|
+
* @returns {DocumentFragment}
|
|
78
|
+
*/
|
|
79
|
+
draw(t, m, f) {
|
|
80
|
+
let l = document.createDocumentFragment(), r = document.createElement("div");
|
|
81
|
+
r.classList.add("native-textarea", this.variant || "default"), r.setAttribute("part", "native"), this.hasAttribute("invalid") && r.classList.add("has-error");
|
|
82
|
+
let c = document.createElement("div");
|
|
83
|
+
c.classList.add("wrapper");
|
|
84
|
+
let o = document.createElement("div");
|
|
85
|
+
o.classList.add("input-wrapper");
|
|
86
|
+
let n = document.createElement("label");
|
|
87
|
+
n.htmlFor = "textarea", n.innerHTML = this.label || "";
|
|
88
|
+
let e = document.createElement("textarea");
|
|
89
|
+
if (e.id = "textarea", e.name = this.name, e.disabled = this.hasAttribute("disabled"), e.innerText = this.innerText, e.classList.add("form-control"), e.setAttribute("part", "input"), e.setAttribute("rows", this.rows || 3), e.setAttribute("spellcheck", !1), this.resize === "auto" && e.addEventListener("input", this.setTextareaHeight), this.variant === "standard" ? this.label && r.appendChild(n) : o.appendChild(n), o.appendChild(e), c.appendChild(o), r.appendChild(c), l.appendChild(r), this.hasAttribute("counter")) {
|
|
90
|
+
e.maxLength = this.maxLength || 1e3, e.addEventListener("input", this.counter);
|
|
91
|
+
let s = document.createElement("div");
|
|
92
|
+
s.classList.add("counter"), s.innerText = `${e.value.length}/${e.maxLength}`, this.counterElement = s, l.appendChild(s);
|
|
93
|
+
}
|
|
94
|
+
return this.native = r, this.labelElement = n, this.input = e, l;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Sets up the event listeners after the component is drawn.
|
|
98
|
+
*/
|
|
99
|
+
afterDraw() {
|
|
100
|
+
this.resizeObserver = new ResizeObserver(() => this.setTextareaHeight), this.hasAttribute("disabled") || (h.addListener(this, "click", "wje:textarea:change"), h.addListener(this, "click", "wje:textarea:input")), this.input.addEventListener("focus", (t) => {
|
|
101
|
+
this.labelElement.classList.add("fade"), this.native.classList.add("focused");
|
|
102
|
+
}), this.input.addEventListener("blur", (t) => {
|
|
103
|
+
this.native.classList.remove("focused"), t.target.value || this.labelElement.classList.remove("fade");
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Disconnects the component.
|
|
108
|
+
*/
|
|
109
|
+
disconnectedCallback() {
|
|
110
|
+
this.resizeObserver.unobserve(this.input);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
u.define("wje-textarea", u);
|
|
114
|
+
export {
|
|
115
|
+
u as default
|
|
116
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
var l = Object.defineProperty;
|
|
2
|
+
var u = (r, e, t) => e in r ? l(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
3
|
+
var a = (r, e, t) => (u(r, typeof e != "symbol" ? e + "" : e, t), t);
|
|
4
|
+
import h from "./wje-element.js";
|
|
5
|
+
const m = ":host{width:var(--wje-thumbnail-width);height:var(--wje-thumbnail-height);display:block;border-radius:var(--wje-border-radius)}:host([circle]) ::slotted(img){border-radius:50%}::slotted(wje-img),::slotted(img){border-radius:var(--wje-thumbnail-border-radius);width:100%;height:100%;object-fit:cover;overflow:hidden}";
|
|
6
|
+
class o extends h {
|
|
7
|
+
/**
|
|
8
|
+
* Thumbnail constructor
|
|
9
|
+
* @constructor
|
|
10
|
+
*/
|
|
11
|
+
constructor() {
|
|
12
|
+
super();
|
|
13
|
+
/**
|
|
14
|
+
* Class name
|
|
15
|
+
* @type {string}
|
|
16
|
+
*/
|
|
17
|
+
a(this, "className", "Thumbnail");
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Get CSS stylesheet
|
|
21
|
+
* @static
|
|
22
|
+
* @returns {Object} styles
|
|
23
|
+
*/
|
|
24
|
+
static get cssStyleSheet() {
|
|
25
|
+
return m;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Get observed attributes
|
|
29
|
+
* @static
|
|
30
|
+
* @returns {Array} An empty array
|
|
31
|
+
*/
|
|
32
|
+
static get observedAttributes() {
|
|
33
|
+
return [];
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Setup attributes
|
|
37
|
+
*/
|
|
38
|
+
setupAttributes() {
|
|
39
|
+
this.isShadowRoot = "open";
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Before draw method
|
|
43
|
+
* @param {Object} context - The context
|
|
44
|
+
* @param {Object} store - The store
|
|
45
|
+
* @param {Object} params - The parameters
|
|
46
|
+
*/
|
|
47
|
+
beforeDraw(t, i, d) {
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Draw method
|
|
51
|
+
* @param {Object} context - The context
|
|
52
|
+
* @param {Object} store - The store
|
|
53
|
+
* @param {Object} params - The parameters
|
|
54
|
+
* @returns {Object} Document fragment
|
|
55
|
+
*/
|
|
56
|
+
draw(t, i, d) {
|
|
57
|
+
let s = document.createDocumentFragment(), n = document.createElement("slot");
|
|
58
|
+
return s.appendChild(n), s;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
o.define("wje-thumbnail", o);
|
|
62
|
+
export {
|
|
63
|
+
o as default
|
|
64
|
+
};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
var c = Object.defineProperty;
|
|
2
|
+
var m = (e, t, i) => t in e ? c(e, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[t] = i;
|
|
3
|
+
var p = (e, t, i) => (m(e, typeof t != "symbol" ? t + "" : t, i), i);
|
|
4
|
+
import f from "./wje-element.js";
|
|
5
|
+
const l = (e, t, i) => {
|
|
6
|
+
e.classList.add("pgn-simple"), t.innerHTML = "<div>" + i.message + "</div>", t.appendChild(a());
|
|
7
|
+
}, b = (e, t, i) => {
|
|
8
|
+
e.classList.add("pgn-flip"), t.innerHTML = "<span>" + i.message + "</span>", t.appendChild(a());
|
|
9
|
+
}, g = (e, t, i) => {
|
|
10
|
+
e.classList.add("pgn-circle");
|
|
11
|
+
let r = "", n = "";
|
|
12
|
+
i.title && (r = `<p><b>${i.title}</b></p>`), i.message && (n = `<p>${i.message}</p>`), t.innerHTML = `<wje-avatar>
|
|
13
|
+
<img alt="Silhouette of a person's head" src="/assets/img/avatar.svg" />
|
|
14
|
+
</wje-avatar>
|
|
15
|
+
<div>
|
|
16
|
+
${r + n}
|
|
17
|
+
</div>`, t.appendChild(a());
|
|
18
|
+
}, w = (e, t, i) => {
|
|
19
|
+
e.classList.add("pgn-bar"), t.classList.add("alert-" + i.type), t.innerHTML = "<div>" + i.message + "</div>", t.appendChild(a());
|
|
20
|
+
}, a = () => {
|
|
21
|
+
let e = document.createElement("wje-icon");
|
|
22
|
+
e.setAttribute("name", "x"), e.setAttribute("slot", "icon-only");
|
|
23
|
+
let t = document.createElement("wje-button");
|
|
24
|
+
return t.setAttribute("fill", "link"), t.setAttribute("size", "small"), t.classList.add("close"), t.appendChild(e), t;
|
|
25
|
+
}, h = ':host{position:fixed;z-index:999}:host([data-position$="-left"]){left:0}:host([data-position$="-right"]){right:0}:host([data-position^="top-"]){top:0}:host([data-position^="bottom-"]){bottom:0}:host([data-position="top"]){top:0;left:0;right:0}:host([data-position="bottom"]){bottom:0;left:0;right:0}.pgn{position:relative;margin:10px}.pgn .alert{margin:0 0 4px}.pgn-simple .alert{padding-top:13px;padding-bottom:13px;max-width:500px;animation:fadeIn .3s cubic-bezier(.05,.74,.27,.99) forwards;-webkit-animation:fadeIn .3s cubic-bezier(.05,.74,.27,.99) forwards;max-height:250px;overflow:hidden}.pgn-bar{overflow:hidden;margin:0}.pgn-bar .alert{border-radius:0;padding-top:13px;padding-bottom:13px;max-height:91px}:host([data-position="top"]) .pgn-bar .alert{animation:slideInFromTop .5s cubic-bezier(.05,.74,.27,.99) forwards;-webkit-animation:slideInFromTop .5s cubic-bezier(.05,.74,.27,.99) forwards;transform-origin:top left;-webkit-transform-origin:top left}:host([data-position="bottom"]) .pgn-bar .alert{animation:slideInFromBottom .5s cubic-bezier(.05,.74,.27,.99) forwards;-webkit-animation:slideInFromBottom .5s cubic-bezier(.05,.74,.27,.99) forwards;transform-origin:bottom left;-webkit-transform-origin:bottom left}.pgn-bar .alert span{opacity:0;animation:fadeIn .3s cubic-bezier(.05,.74,.27,.99) forwards;-webkit-animation:fadeIn .3s cubic-bezier(.05,.74,.27,.99) forwards}@keyframes slideInFromTop{0%{transform:translateY(-100%)}to{transform:translateY(0)}}@-webkit-keyframes slideInFromTop{0%{-webkit-transform:translateY(-100%)}to{-webkit-transform:translateY(0)}}@keyframes slideInFromBottom{0%{transform:translateY(100%)}to{transform:translateY(0)}}@-webkit-keyframes slideInFromBottom{0%{-webkit-transform:translateY(100%)}to{-webkit-transform:translateY(0)}}.pgn-circle .alert{margin-bottom:10px;border-radius:300px;animation:fadeInCircle .3s ease forwards,resizeCircle .3s .4s cubic-bezier(.25,.25,.4,1.6) forwards;-webkit-animation:fadeInCircle .3s ease forwards,resizeCircle .3s .4s cubic-bezier(.25,.25,.4,1.6) forwards;height:48px;overflow:hidden;padding:6px 55px 6px 6px;-webkit-transform:translateZ(0);position:relative;display:flex}:host[data-position$=-right] .pgn-circle .alert{float:right}:host[data-position$=-left] .pgn-circle .alert{float:left}:host[data-position^=bottom-] .pgn-circle .alert{margin-bottom:20px}wje-avatar:first-child{margin-right:8px}.pgn-circle .alert .close{margin-top:-12px;position:absolute;right:18px;top:50%;opacity:0;animation:fadeIn .3s .5s ease forwards;-webkit-animation:fadeIn .3s .5s ease forwards}.pgn-circle .alert p{margin:0}.pgn-circle .alert>div{display:flex;flex-direction:column;justify-content:center}.pgn-circle .alert>div>div{display:table-cell;vertical-align:middle}@keyframes fadeInCircle{0%{opacity:0;width:60px}to{opacity:1;width:60px}}@-webkit-keyframes fadeInCircle{0%{opacity:0;width:60px}to{opacity:1;width:60px}}@keyframes resizeCircle{0%{width:60px}to{width:300px}}@-webkit-keyframes resizeCircle{0%{width:60px}to{width:300px}}:host[data-position^=bottom-] .pgn-flip .alert{-webkit-transform-origin:50% 100%;transform-origin:50% 100%}.pgn-flip .alert{-webkit-transform-origin:50% 0%;transform-origin:50% 0%;-webkit-animation-name:flipInX;animation-name:flipInX;-webkit-animation-duration:.8s;animation-duration:.8s;border-radius:0;padding:25px 35px;max-width:500px;max-height:250px;overflow:hidden}@-webkit-keyframes flipInX{0%{-webkit-transform:perspective(400px) rotate3d(1,0,0,-90deg);-webkit-transition-timing-function:ease-in}40%{-webkit-transform:perspective(400px) rotate3d(1,0,0,20deg);-webkit-transition-timing-function:ease-out}60%{-webkit-transform:perspective(400px) rotate3d(1,0,0,-10deg);-webkit-transition-timing-function:ease-in;opacity:1}80%{-webkit-transform:perspective(400px) rotate3d(1,0,0,5deg);-webkit-transition-timing-function:ease-out}to{-webkit-transform:perspective(400px)}}@keyframes flipInX{0%{-webkit-transform:perspective(400px) rotate3d(1,0,0,-90deg);transform:perspective(400px) rotateX(-90deg);-webkit-transition-timing-function:ease-in;transition-timing-function:ease-in}40%{-webkit-transform:perspective(400px) rotate3d(1,0,0,20deg);transform:perspective(400px) rotateX(20deg);-webkit-transition-timing-function:ease-out;transition-timing-function:ease-out}60%{-webkit-transform:perspective(400px) rotate3d(1,0,0,-10deg);transform:perspective(400px) rotateX(-10deg);-webkit-transition-timing-function:ease-in;transition-timing-function:ease-in;opacity:1}80%{-webkit-transform:perspective(400px) rotate3d(1,0,0,5deg);transform:perspective(400px) rotateX(5deg);-webkit-transition-timing-function:ease-out;transition-timing-function:ease-out}to{-webkit-transform:perspective(400px);transform:perspective(400px)}}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@-webkit-keyframes fadeIn{0%{opacity:0}to{opacity:1}}:host([data-position="top"]){top:60px;left:0}:host([data-position="bottom"]){left:0}:host([data-position$="-left"]){left:0;right:auto}:host([data-position^="top-"]){bottom:auto}:host{z-index:999}@media (max-width: 979px){body .pgn-wrapper[data-position=top],body .pgn-wrapper[data-position=bottom]{left:0!important}}@media (max-width: 767px){body .pgn-wrapper[data-position$=-left],body .pgn-wrapper[data-position$=-right]{left:10px!important;right:10px!important}body .pgn-wrapper[data-position$=-right] .alert,body .pgn-wrapper[data-position$=-left] .alert{max-width:100%;width:100%}}.alert{background-image:none;box-shadow:none;text-shadow:none;padding:9px 19px 9px 15px;border-radius:3px;font-size:13px;border-width:0;transition:all .2s linear 0s;display:flex;align-items:center}.alert.bordered{border-width:1px}.alert .link{color:#ce8f22;font-weight:700}.alert .alert-heading{color:#ce8f22!important;margin-bottom:5px;font-weight:600}.alert .btn-small{position:relative;top:-3.5px}.alert .button-set .btn{position:relative;top:8px}.alert-danger,.alert-error,.alert-danger.btn,.alert-error.btn{background-color:var(--wje-color-primary-2)!important;color:var(--wje-color-primary-11)!important;border-color:var(--wje-color-primary-9)!important}.alert-danger .close,.alert-error .close,.alert-danger.btn .close,.alert-error.btn .close{background-position:-95px -10px!important}.alert-warning{background-color:var(--wje-color-warning-2)!important;color:var(--wje-color-warning-11)!important;border-color:var(--wje-color-warning-9)!important}.alert-info{background-color:var(--wje-color-complete-2)!important;color:var(--wje-color-complete-11)!important;border-color:var(--wje-color-complete-9)!important}.alert-info .close{background-position:-67px -10px!important}.alert-success,.alert-success.btn{background-color:var(--wje-color-success-2)!important;color:var(--wje-color-success-11)!important;border-color:var(--wje-color-success-9)!important}.alert-success .close,.alert-success.btn .close{background-position:-38px -10px!important}.alert-default{background-color:var(--wje-color-contrast-2)!important;color:var(--wje-color-contrast-11)!important;border-color:var(--wje-color-contrast-9)!important}.alert-default .close{background-position:-67px -10px!important}';
|
|
26
|
+
class d extends f {
|
|
27
|
+
/**
|
|
28
|
+
* Toast constructor
|
|
29
|
+
* @constructor
|
|
30
|
+
*/
|
|
31
|
+
constructor() {
|
|
32
|
+
super();
|
|
33
|
+
/**
|
|
34
|
+
* Class name
|
|
35
|
+
* @type {string}
|
|
36
|
+
*/
|
|
37
|
+
p(this, "className", "Toast");
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Get CSS stylesheet
|
|
41
|
+
* @static
|
|
42
|
+
* @returns {Object} styles
|
|
43
|
+
*/
|
|
44
|
+
static get cssStyleSheet() {
|
|
45
|
+
return h;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Setup attributes
|
|
49
|
+
*/
|
|
50
|
+
setupAttributes() {
|
|
51
|
+
this.isShadowRoot = "open";
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Draw method
|
|
55
|
+
* @param {Object} context - The context
|
|
56
|
+
* @param {Object} store - The store
|
|
57
|
+
* @param {Object} params - The parameters
|
|
58
|
+
* @returns {Object} Document fragment
|
|
59
|
+
*/
|
|
60
|
+
draw(i, r, n) {
|
|
61
|
+
let s = document.createDocumentFragment(), o = {
|
|
62
|
+
message: "Záznam bol úspešne uložený.",
|
|
63
|
+
position: this.position,
|
|
64
|
+
showClose: !0,
|
|
65
|
+
style: this.design || "simple",
|
|
66
|
+
timeout: this.duration || 4e3,
|
|
67
|
+
type: this.type || "success",
|
|
68
|
+
title: this.title || "John Doe"
|
|
69
|
+
};
|
|
70
|
+
return this.container = document.querySelector("body"), this.notification = document.createElement("div"), this.notification.classList.add("pgn", "push-on-sidebar-open"), this.classList.add("pgn-wrapper"), this.setAttribute("data-position", o.position), this.alert = document.createElement("div"), this.alert.classList.add("alert"), this.alert.classList.add("alert-" + o.type), o.style == "bar" ? w(this.notification, this.alert, o) : o.style == "flip" ? b(this.notification, this.alert, o) : o.style == "circle" ? g(this.notification, this.alert, o) : o.style == "simple" ? l(this.notification, this.alert, o) : l(this.notification, this.alert, o), this.notification.appendChild(this.alert), s.appendChild(this.notification), s;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
d.define("wje-toast", d);
|
|
74
|
+
export {
|
|
75
|
+
d as default
|
|
76
|
+
};
|