wj-elements 0.1.24 → 0.1.26
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/wje-button.js +1 -1
- package/dist/wje-master.js +183 -247
- package/dist/wje-reorder-handle.js +92 -0
- package/package.json +3 -3
package/dist/wje-button.js
CHANGED
|
@@ -3,7 +3,7 @@ var j = (e, a, o) => a in e ? b(e, a, { enumerable: !0, configurable: !0, writab
|
|
|
3
3
|
var s = (e, a, o) => (j(e, typeof a != "symbol" ? a + "" : a, o), o);
|
|
4
4
|
import g, { WjElementUtils as p, event as i } from "./wje-element.js";
|
|
5
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-
|
|
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-9);border-color:var(--wje-color-primary-9);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-9);border-color:var(--wje-color-complete-9);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-9);border-color:var(--wje-color-success-9);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-9);border-color:var(--wje-color-warning-9);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-9);border-color:var(--wje-color-danger-9);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-9);border-color:var(--wje-color-contrast-9);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;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-10);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-10);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-10);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-10);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-10);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-10);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
7
|
class w extends g {
|
|
8
8
|
/**
|
|
9
9
|
* Button constructor
|
package/dist/wje-master.js
CHANGED
|
@@ -1,96 +1,93 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { default as
|
|
11
|
-
import { default as
|
|
12
|
-
import { default as
|
|
13
|
-
import { default as
|
|
14
|
-
import { default as
|
|
15
|
-
import { default as
|
|
16
|
-
import { default as
|
|
17
|
-
import { default as
|
|
18
|
-
import { default as
|
|
19
|
-
import { default as
|
|
20
|
-
import { default as
|
|
21
|
-
import { default as
|
|
22
|
-
import { default as
|
|
23
|
-
import { default as
|
|
24
|
-
import { default as
|
|
25
|
-
import { default as
|
|
26
|
-
import { default as
|
|
27
|
-
import { default as
|
|
28
|
-
import { default as
|
|
29
|
-
import { default as
|
|
30
|
-
import { default as
|
|
31
|
-
import { default as
|
|
32
|
-
import { default as
|
|
33
|
-
import { default as
|
|
34
|
-
import { default as
|
|
35
|
-
import { default as
|
|
36
|
-
import { default as
|
|
37
|
-
import { default as
|
|
38
|
-
import { default as
|
|
39
|
-
import { default as
|
|
40
|
-
import { default as
|
|
41
|
-
import { default as
|
|
42
|
-
import { default as
|
|
43
|
-
import { default as
|
|
44
|
-
import { default as
|
|
45
|
-
import { default as
|
|
46
|
-
import { default as
|
|
47
|
-
import { default as
|
|
48
|
-
import { default as
|
|
49
|
-
import { default as
|
|
50
|
-
import { default as
|
|
51
|
-
import { default as
|
|
52
|
-
import { default as
|
|
53
|
-
import { default as
|
|
54
|
-
import { default as
|
|
55
|
-
import { default as
|
|
56
|
-
import { default as
|
|
57
|
-
import { default as
|
|
58
|
-
import { default as Tt } from "./wje-menu-item.js";
|
|
59
|
-
import { default as Dt } from "./wje-menu-label.js";
|
|
60
|
-
import { default as zt } from "./wje-option.js";
|
|
61
|
-
import { default as jt } from "./wje-options.js";
|
|
1
|
+
import { default as d, event as u } from "./wje-element.js";
|
|
2
|
+
import { defaultStoreActions as s, store as m } from "./wje-store.js";
|
|
3
|
+
import { b as i, w as n } from "./router-links-FtZbFUto.js";
|
|
4
|
+
import { fetchAndParseCSS as C } from "./wje-fetchAndParseCSS.js";
|
|
5
|
+
import { L as e } from "./localize-DVuO3S17.js";
|
|
6
|
+
import { default as R } from "./wje-accordion.js";
|
|
7
|
+
import { default as I } from "./wje-accordion-item.js";
|
|
8
|
+
import { default as g } from "./wje-animation.js";
|
|
9
|
+
import { default as k } from "./wje-aside.js";
|
|
10
|
+
import { default as h } from "./wje-avatar.js";
|
|
11
|
+
import { default as L } from "./wje-badge.js";
|
|
12
|
+
import { default as P } from "./wje-breadcrumb.js";
|
|
13
|
+
import { default as v } from "./wje-breadcrumbs.js";
|
|
14
|
+
import { default as F } from "./wje-button.js";
|
|
15
|
+
import { default as G } from "./wje-button-group.js";
|
|
16
|
+
import { default as V } from "./wje-card.js";
|
|
17
|
+
import { default as E } from "./wje-card-content.js";
|
|
18
|
+
import { default as U } from "./wje-card-controls.js";
|
|
19
|
+
import { default as J } from "./wje-card-header.js";
|
|
20
|
+
import { default as Q } from "./wje-card-subtitle.js";
|
|
21
|
+
import { default as K } from "./wje-card-title.js";
|
|
22
|
+
import { default as Y } from "./wje-carousel.js";
|
|
23
|
+
import { default as _ } from "./wje-carousel-item.js";
|
|
24
|
+
import { default as ee } from "./wje-checkbox.js";
|
|
25
|
+
import { default as re } from "./wje-chip.js";
|
|
26
|
+
import { default as ae } from "./wje-col.js";
|
|
27
|
+
import { default as le } from "./wje-color-picker.js";
|
|
28
|
+
import { default as ue } from "./wje-container.js";
|
|
29
|
+
import { default as se } from "./wje-copy-button.js";
|
|
30
|
+
import { default as xe } from "./wje-dialog.js";
|
|
31
|
+
import { default as ne } from "./wje-divider.js";
|
|
32
|
+
import { default as Ce } from "./wje-dropdown.js";
|
|
33
|
+
import { default as Re } from "./wje-file-upload.js";
|
|
34
|
+
import { default as Ie } from "./wje-file-upload-item.js";
|
|
35
|
+
import { default as ge } from "./wje-footer.js";
|
|
36
|
+
import { default as ke } from "./wje-format-digital.js";
|
|
37
|
+
import { default as he } from "./wje-grid.js";
|
|
38
|
+
import { default as Le } from "./wje-header.js";
|
|
39
|
+
import { default as Pe } from "./wje-icon.js";
|
|
40
|
+
import { default as ve } from "./wje-icon-picker.js";
|
|
41
|
+
import { default as Fe } from "./wje-img.js";
|
|
42
|
+
import { default as Ge } from "./wje-img-comparer.js";
|
|
43
|
+
import { default as Ve } from "./wje-infinite-scroll.js";
|
|
44
|
+
import { default as Ee } from "./wje-inline-edit.js";
|
|
45
|
+
import { default as Ue } from "./wje-input.js";
|
|
46
|
+
import { default as Je } from "./wje-input-file.js";
|
|
47
|
+
import { default as Qe } from "./wje-item.js";
|
|
48
|
+
import { default as Ke } from "./wje-label.js";
|
|
49
|
+
import { default as Ye } from "./wje-list.js";
|
|
50
|
+
import { default as _e } from "./wje-main.js";
|
|
51
|
+
import { default as eo } from "./wje-masonry.js";
|
|
52
|
+
import { default as ro } from "./wje-menu.js";
|
|
53
|
+
import { default as ao } from "./wje-menu-button.js";
|
|
54
|
+
import { default as lo } from "./wje-menu-item.js";
|
|
55
|
+
import { default as po } from "./wje-menu-label.js";
|
|
56
|
+
import { default as mo } from "./wje-option.js";
|
|
57
|
+
import { default as io } from "./wje-options.js";
|
|
62
58
|
import "./wje-popup.js";
|
|
63
|
-
import { default as
|
|
64
|
-
import { default as
|
|
65
|
-
import { default as
|
|
66
|
-
import { default as
|
|
67
|
-
import { default as
|
|
68
|
-
import { default as
|
|
69
|
-
import { default as
|
|
70
|
-
import { default as
|
|
71
|
-
import { default as
|
|
72
|
-
import { default as
|
|
73
|
-
import { default as
|
|
74
|
-
import { default as
|
|
75
|
-
import { default as
|
|
76
|
-
import { default as
|
|
77
|
-
import { default as
|
|
78
|
-
import { default as
|
|
79
|
-
import { default as
|
|
80
|
-
import { default as
|
|
81
|
-
import { default as
|
|
82
|
-
import { default as
|
|
83
|
-
import { default as
|
|
84
|
-
import { default as
|
|
85
|
-
import { default as
|
|
86
|
-
import { default as
|
|
87
|
-
import { default as
|
|
88
|
-
import { default as
|
|
89
|
-
import { default as
|
|
90
|
-
import { default as
|
|
91
|
-
import { default as
|
|
92
|
-
import {
|
|
93
|
-
|
|
59
|
+
import { default as co } from "./wje-progress-bar.js";
|
|
60
|
+
import { default as bo } from "./wje-qr-code.js";
|
|
61
|
+
import { default as wo } from "./wje-radio.js";
|
|
62
|
+
import { default as To } from "./wje-radio-group.js";
|
|
63
|
+
import { default as So } from "./wje-rate.js";
|
|
64
|
+
import { default as Bo } from "./wje-relative-time.js";
|
|
65
|
+
import { default as Ao } from "./wje-reorder.js";
|
|
66
|
+
import { default as jo } from "./wje-reorder-dropzone.js";
|
|
67
|
+
import { default as Mo } from "./wje-reorder-handle.js";
|
|
68
|
+
import { default as Do } from "./wje-reorder-item.js";
|
|
69
|
+
import { default as yo } from "./wje-route.js";
|
|
70
|
+
import { default as Ho } from "./wje-routerx.js";
|
|
71
|
+
import { default as zo } from "./wje-router-link.js";
|
|
72
|
+
import { default as Oo } from "./wje-router-outlet.js";
|
|
73
|
+
import { default as Wo } from "./wje-row.js";
|
|
74
|
+
import { default as No } from "./wje-select.js";
|
|
75
|
+
import { default as qo } from "./wje-slider.js";
|
|
76
|
+
import { default as Xo } from "./wje-split-view.js";
|
|
77
|
+
import { default as Zo } from "./wje-status.js";
|
|
78
|
+
import { default as $o } from "./wje-tab.js";
|
|
79
|
+
import { default as or } from "./wje-tab-group.js";
|
|
80
|
+
import { default as tr } from "./wje-tab-panel.js";
|
|
81
|
+
import { default as fr } from "./wje-textarea.js";
|
|
82
|
+
import { default as dr } from "./wje-thumbnail.js";
|
|
83
|
+
import { default as pr } from "./wje-toast.js";
|
|
84
|
+
import { default as mr } from "./wje-toggle.js";
|
|
85
|
+
import { default as ir } from "./wje-toolbar.js";
|
|
86
|
+
import { default as cr } from "./wje-toolbar-action.js";
|
|
87
|
+
import { default as br } from "./wje-tooltip.js";
|
|
88
|
+
import { default as wr } from "./wje-visually-hidden.js";
|
|
89
|
+
import { P as Tr } from "./popup.element-DE8fye8C.js";
|
|
90
|
+
const o = {
|
|
94
91
|
code: "sk",
|
|
95
92
|
name: "Slovak",
|
|
96
93
|
dir: "ltr",
|
|
@@ -99,8 +96,8 @@ const R = {
|
|
|
99
96
|
"wj.file.upload.uploaded": "Nahraných: ",
|
|
100
97
|
"wj.file.upload.from": "z"
|
|
101
98
|
};
|
|
102
|
-
|
|
103
|
-
const
|
|
99
|
+
e.registerTranslation(o);
|
|
100
|
+
const r = {
|
|
104
101
|
code: "en",
|
|
105
102
|
name: "English",
|
|
106
103
|
dir: "ltr",
|
|
@@ -109,158 +106,97 @@ const L = {
|
|
|
109
106
|
"wj.file.upload.uploaded": "Uploaded: ",
|
|
110
107
|
"wj.file.upload.from": "from"
|
|
111
108
|
};
|
|
112
|
-
|
|
113
|
-
const A = ".disabled{opacity:.3}";
|
|
114
|
-
class c extends w {
|
|
115
|
-
constructor() {
|
|
116
|
-
super();
|
|
117
|
-
x(this, "className", "ReorderHandle");
|
|
118
|
-
this.addEventListener("mousedown", this.startDrag.bind(this));
|
|
119
|
-
}
|
|
120
|
-
static get cssStyleSheet() {
|
|
121
|
-
return A;
|
|
122
|
-
}
|
|
123
|
-
static get observedAttributes() {
|
|
124
|
-
return [];
|
|
125
|
-
}
|
|
126
|
-
setupAttributes() {
|
|
127
|
-
this.isShadowRoot = "open";
|
|
128
|
-
}
|
|
129
|
-
draw() {
|
|
130
|
-
const t = document.createDocumentFragment(), e = document.createElement("div");
|
|
131
|
-
e.classList.add("container"), e.setAttribute("part", "native");
|
|
132
|
-
const o = document.createElement("slot");
|
|
133
|
-
return e.appendChild(o), t.appendChild(e), t;
|
|
134
|
-
}
|
|
135
|
-
afterDraw() {
|
|
136
|
-
this.hasAttribute("disabled") && (this.style.opacity = ".3");
|
|
137
|
-
}
|
|
138
|
-
startDrag(t) {
|
|
139
|
-
if (this.hasAttribute("disabled"))
|
|
140
|
-
return;
|
|
141
|
-
const e = this.parentElement, o = this.getDropzone(e), d = e.getBoundingClientRect(), b = t.clientX - d.left, h = t.clientY - d.top;
|
|
142
|
-
let r = document.createElement("div");
|
|
143
|
-
r.classList.add("sortable-item"), r.style.visibility = "hidden", r.style.height = `${d.height}px`, e.classList.add("dragging"), e.style.position = "fixed", e.style.zIndex = "1000", e.style.width = `${d.width}px`;
|
|
144
|
-
const i = (s, n) => {
|
|
145
|
-
e.style.left = `${s - b - document.documentElement.scrollLeft}px`, e.style.top = `${n - h - document.documentElement.scrollTop}px`;
|
|
146
|
-
};
|
|
147
|
-
i(t.pageX, t.pageY);
|
|
148
|
-
const p = (s) => {
|
|
149
|
-
i(s.pageX, s.pageY);
|
|
150
|
-
const n = Array.from(o.children).filter((l) => l !== e && l !== r);
|
|
151
|
-
for (const l of n) {
|
|
152
|
-
const u = l.getBoundingClientRect();
|
|
153
|
-
if (s.clientY > u.top && s.clientY < u.bottom) {
|
|
154
|
-
s.clientY < u.top + u.height / 2 ? o.insertBefore(r, l) : o.insertBefore(r, l.nextSibling);
|
|
155
|
-
break;
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
}, m = () => {
|
|
159
|
-
document.removeEventListener("mousemove", p), document.removeEventListener("mouseup", m), e.classList.remove("dragging"), e.style.position = "", e.style.zIndex = "", e.style.left = "", e.style.top = "", e.style.width = "", o.insertBefore(e, r), o.removeChild(r);
|
|
160
|
-
};
|
|
161
|
-
document.addEventListener("mousemove", p), document.addEventListener("mouseup", m), o.insertBefore(r, e);
|
|
162
|
-
}
|
|
163
|
-
getDropzone(t) {
|
|
164
|
-
const e = this.getAttribute("dropzone");
|
|
165
|
-
if (e) {
|
|
166
|
-
let o = t.closest(e);
|
|
167
|
-
if (o)
|
|
168
|
-
return o;
|
|
169
|
-
}
|
|
170
|
-
return t.parentElement;
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
c.define("wje-reorder-handle", c);
|
|
109
|
+
e.registerTranslation(r);
|
|
174
110
|
export {
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
111
|
+
R as Accordion,
|
|
112
|
+
I as AccordionItem,
|
|
113
|
+
g as Animation,
|
|
114
|
+
k as Aside,
|
|
115
|
+
h as Avatar,
|
|
116
|
+
L as Badge,
|
|
117
|
+
P as Breadcrumb,
|
|
118
|
+
v as Breadcrumbs,
|
|
119
|
+
F as Button,
|
|
120
|
+
G as ButtonGroup,
|
|
121
|
+
V as Card,
|
|
122
|
+
E as CardContent,
|
|
123
|
+
U as CardControls,
|
|
124
|
+
J as CardHeader,
|
|
125
|
+
Q as CardSubtitle,
|
|
126
|
+
K as CardTitle,
|
|
127
|
+
Y as Carousel,
|
|
128
|
+
_ as CarouselItem,
|
|
129
|
+
ee as Checkbox,
|
|
130
|
+
re as Chip,
|
|
131
|
+
ae as Col,
|
|
132
|
+
le as ColorPicker,
|
|
133
|
+
ue as Container,
|
|
134
|
+
se as CopyButton,
|
|
135
|
+
xe as Dialog,
|
|
136
|
+
ne as Divider,
|
|
137
|
+
Ce as Dropdown,
|
|
138
|
+
Re as FileUpload,
|
|
139
|
+
Ie as FileUploadItem,
|
|
140
|
+
ge as Footer,
|
|
141
|
+
ke as FormatDigital,
|
|
142
|
+
he as Grid,
|
|
143
|
+
Le as Header,
|
|
144
|
+
Pe as Icon,
|
|
145
|
+
ve as IconPicker,
|
|
146
|
+
Fe as Img,
|
|
147
|
+
Ge as ImgComparer,
|
|
148
|
+
Ve as InfiniteScroll,
|
|
149
|
+
Ee as InlineEdit,
|
|
150
|
+
Ue as Input,
|
|
151
|
+
Je as InputFile,
|
|
152
|
+
Qe as Item,
|
|
153
|
+
Ke as Label,
|
|
154
|
+
Ye as List,
|
|
155
|
+
e as Localizer,
|
|
156
|
+
_e as Main,
|
|
157
|
+
eo as Masonry,
|
|
158
|
+
ro as Menu,
|
|
159
|
+
ao as MenuButton,
|
|
160
|
+
lo as MenuItem,
|
|
161
|
+
po as MenuLabel,
|
|
162
|
+
mo as Option,
|
|
163
|
+
io as Options,
|
|
164
|
+
Tr as Popup,
|
|
165
|
+
co as ProgressBar,
|
|
166
|
+
bo as QrCode,
|
|
167
|
+
wo as Radio,
|
|
168
|
+
To as RadioGroup,
|
|
169
|
+
So as Rate,
|
|
170
|
+
Bo as RelativeTime,
|
|
171
|
+
Ao as Reorder,
|
|
172
|
+
jo as ReorderDropzone,
|
|
173
|
+
Mo as ReorderHandle,
|
|
174
|
+
Do as ReorderItem,
|
|
175
|
+
yo as Route,
|
|
176
|
+
zo as RouterLink,
|
|
177
|
+
Oo as RouterOutlet,
|
|
178
|
+
Ho as Routerx,
|
|
179
|
+
Wo as Row,
|
|
180
|
+
No as Select,
|
|
181
|
+
qo as Slider,
|
|
182
|
+
Xo as SplitView,
|
|
183
|
+
Zo as Status,
|
|
184
|
+
$o as Tab,
|
|
185
|
+
or as TabGroup,
|
|
186
|
+
tr as TabPanel,
|
|
187
|
+
fr as Textarea,
|
|
188
|
+
dr as Thumbnail,
|
|
189
|
+
pr as Toast,
|
|
190
|
+
mr as Toggle,
|
|
191
|
+
ir as Toolbar,
|
|
192
|
+
cr as ToolbarAction,
|
|
193
|
+
br as Tooltip,
|
|
194
|
+
wr as VisuallyHidden,
|
|
195
|
+
d as WJElement,
|
|
196
|
+
i as bindRouterLinks,
|
|
197
|
+
s as defaultStoreActions,
|
|
198
|
+
u as event,
|
|
199
|
+
C as fetchAndParseCSS,
|
|
200
|
+
m as store,
|
|
201
|
+
n as withRouterLinks
|
|
266
202
|
};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
var z = Object.defineProperty;
|
|
2
|
+
var D = (l, i, e) => i in l ? z(l, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : l[i] = e;
|
|
3
|
+
var f = (l, i, e) => (D(l, typeof i != "symbol" ? i + "" : i, e), e);
|
|
4
|
+
import v from "./wje-element.js";
|
|
5
|
+
const L = ".disabled{opacity:.3}";
|
|
6
|
+
class b extends v {
|
|
7
|
+
constructor() {
|
|
8
|
+
super();
|
|
9
|
+
f(this, "className", "ReorderHandle");
|
|
10
|
+
this.addEventListener("mousedown", this.startDrag.bind(this)), this.addEventListener("touchstart", this.startTouchDrag.bind(this));
|
|
11
|
+
}
|
|
12
|
+
static get cssStyleSheet() {
|
|
13
|
+
return L;
|
|
14
|
+
}
|
|
15
|
+
static get observedAttributes() {
|
|
16
|
+
return ["dropzone"];
|
|
17
|
+
}
|
|
18
|
+
setupAttributes() {
|
|
19
|
+
this.isShadowRoot = "open";
|
|
20
|
+
}
|
|
21
|
+
draw() {
|
|
22
|
+
const e = document.createDocumentFragment(), s = document.createElement("div");
|
|
23
|
+
s.classList.add("container"), s.setAttribute("part", "native");
|
|
24
|
+
const t = document.createElement("slot");
|
|
25
|
+
return s.appendChild(t), e.appendChild(s), e;
|
|
26
|
+
}
|
|
27
|
+
afterDraw() {
|
|
28
|
+
this.hasAttribute("disabled") && (this.style.opacity = ".3");
|
|
29
|
+
}
|
|
30
|
+
startDrag(e) {
|
|
31
|
+
this.hasAttribute("disabled") || this.hasAttribute("locked") || this.startDragAction(e.clientX, e.clientY);
|
|
32
|
+
}
|
|
33
|
+
startTouchDrag(e) {
|
|
34
|
+
if (this.hasAttribute("disabled") || this.hasAttribute("locked"))
|
|
35
|
+
return;
|
|
36
|
+
const s = e.touches[0];
|
|
37
|
+
this.startDragAction(s.clientX, s.clientY);
|
|
38
|
+
}
|
|
39
|
+
startDragAction(e, s) {
|
|
40
|
+
const t = this.parentElement, c = this.getDropzone(t);
|
|
41
|
+
this.getAttribute("dropzone") || this.setAttribute("dropzone", c.localName);
|
|
42
|
+
const d = t.getBoundingClientRect(), y = e - d.left, A = s - d.top;
|
|
43
|
+
let n = document.createElement("div");
|
|
44
|
+
n.classList.add("sortable-item"), n.style.visibility = "hidden", n.style.height = `${d.height}px`, t.classList.add("dragging"), t.style.position = "fixed", t.style.zIndex = "1000", t.style.width = `${d.width}px`;
|
|
45
|
+
const h = (o, a) => {
|
|
46
|
+
t.style.left = `${o - y - document.documentElement.scrollLeft}px`, t.style.top = `${a - A - document.documentElement.scrollTop}px`;
|
|
47
|
+
};
|
|
48
|
+
h(e, s);
|
|
49
|
+
const m = (o) => {
|
|
50
|
+
var g;
|
|
51
|
+
h(o.pageX, o.pageY);
|
|
52
|
+
const a = this.getClosestDropzone(o.clientX, o.clientY);
|
|
53
|
+
if (!a)
|
|
54
|
+
return;
|
|
55
|
+
const E = Array.from(a.children).filter((r) => r !== t && r !== n);
|
|
56
|
+
for (const r of E) {
|
|
57
|
+
if ((g = r.children[0]) != null && g.hasAttribute("locked"))
|
|
58
|
+
continue;
|
|
59
|
+
const u = r.getBoundingClientRect();
|
|
60
|
+
if (o.clientY > u.top && o.clientY < u.bottom) {
|
|
61
|
+
o.clientY < u.top + u.height / 2 ? a.insertBefore(n, r) : a.insertBefore(n, r.nextSibling);
|
|
62
|
+
break;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}, p = () => {
|
|
66
|
+
document.removeEventListener("mousemove", m), document.removeEventListener("mouseup", p), t.classList.remove("dragging"), t.style.position = "", t.style.zIndex = "", t.style.left = "", t.style.top = "", t.style.width = "";
|
|
67
|
+
const o = n.parentElement;
|
|
68
|
+
o.insertBefore(t, n), o.removeChild(n);
|
|
69
|
+
};
|
|
70
|
+
document.addEventListener("mousemove", m), document.addEventListener("mouseup", p), c.insertBefore(n, t);
|
|
71
|
+
}
|
|
72
|
+
getDropzone(e) {
|
|
73
|
+
const s = this.getAttribute("dropzone");
|
|
74
|
+
if (s) {
|
|
75
|
+
let t = e.closest(s);
|
|
76
|
+
if (t)
|
|
77
|
+
return t;
|
|
78
|
+
}
|
|
79
|
+
return e.parentElement;
|
|
80
|
+
}
|
|
81
|
+
getClosestDropzone(e, s) {
|
|
82
|
+
const t = document.elementsFromPoint(e, s);
|
|
83
|
+
for (const c of t)
|
|
84
|
+
if (c.matches(this.getAttribute("dropzone")))
|
|
85
|
+
return c;
|
|
86
|
+
return null;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
b.define("wje-reorder-handle", b);
|
|
90
|
+
export {
|
|
91
|
+
b as default
|
|
92
|
+
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wj-elements",
|
|
3
3
|
"description": "WebJET Elements is a modern set of user interface tools harnessing the power of web components designed to simplify web application development.",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.26",
|
|
5
5
|
"homepage": "https://github.com/lencys/wj-elements",
|
|
6
6
|
"author": "Lukáš Ondrejček <lukas.ondrejcek@gmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"files": [
|
|
24
24
|
"./dist"
|
|
25
25
|
],
|
|
26
|
-
"module": "./dist/wje-
|
|
26
|
+
"module": "./dist/wje-element.js",
|
|
27
27
|
"scripts": {
|
|
28
28
|
"dev": "vite --force",
|
|
29
29
|
"build": "vite build",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
},
|
|
34
34
|
"exports": {
|
|
35
35
|
".": {
|
|
36
|
-
"import": "./dist/wje-
|
|
36
|
+
"import": "./dist/wje-element.js"
|
|
37
37
|
}
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|