wj-elements 0.1.9 → 0.1.11
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-reorder.js +45 -17
- package/package.json +1 -1
package/dist/wje-reorder.js
CHANGED
|
@@ -1,12 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
var p = Object.defineProperty;
|
|
2
|
+
var u = (d, o, e) => o in d ? p(d, o, { enumerable: !0, configurable: !0, writable: !0, value: e }) : d[o] = e;
|
|
3
|
+
var h = (d, o, e) => (u(d, typeof o != "symbol" ? o + "" : o, e), e);
|
|
4
|
+
import f from "./wje-element.js";
|
|
5
|
+
const E = ".container{position:relative;display:flex;align-items:center;justify-content:center;flex-direction:column}.container-w-dropzones{position:relative;display:flex;align-items:center;justify-content:center;flex-direction:row}";
|
|
6
|
+
class g extends f {
|
|
7
|
+
/**
|
|
8
|
+
* Creates an instance of Select.
|
|
9
|
+
*
|
|
10
|
+
* @constructor
|
|
11
|
+
*/
|
|
4
12
|
constructor() {
|
|
5
|
-
super()
|
|
6
|
-
|
|
13
|
+
super();
|
|
14
|
+
h(this, "className", "Select");
|
|
15
|
+
this.dragEl = null, this.items = [], this.originalIndex = null;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Returns the CSS styles for the component.
|
|
19
|
+
*
|
|
20
|
+
* @static
|
|
21
|
+
* @returns {CSSStyleSheet}
|
|
22
|
+
*/
|
|
7
23
|
static get cssStyleSheet() {
|
|
8
|
-
return
|
|
9
|
-
}
|
|
24
|
+
return E;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Returns the list of attributes to observe for changes.
|
|
28
|
+
*
|
|
29
|
+
* @static
|
|
30
|
+
* @returns {Array<string>}
|
|
31
|
+
*/
|
|
32
|
+
static get observedAttributes() {
|
|
33
|
+
return [];
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Sets up the attributes for the component.
|
|
37
|
+
*/
|
|
10
38
|
setupAttributes() {
|
|
11
39
|
this.isShadowRoot = "open";
|
|
12
40
|
}
|
|
@@ -21,9 +49,9 @@ class l extends c {
|
|
|
21
49
|
n && n.forEach((s) => {
|
|
22
50
|
this.container.classList.remove("container"), this.container.classList.add("container-w-dropzones");
|
|
23
51
|
}), a && a.forEach((s) => {
|
|
24
|
-
const
|
|
25
|
-
(
|
|
26
|
-
|
|
52
|
+
const i = s.querySelectorAll("[slot=handle]");
|
|
53
|
+
(i.length > 0 ? i : [s]).forEach((c) => {
|
|
54
|
+
c.setAttribute("draggable", "true"), this.attachEventListeners(c);
|
|
27
55
|
});
|
|
28
56
|
});
|
|
29
57
|
}
|
|
@@ -58,16 +86,16 @@ class l extends c {
|
|
|
58
86
|
[t, this.originalParent].forEach((n) => {
|
|
59
87
|
n.childNodes.forEach((s) => {
|
|
60
88
|
if (s.nodeType === 1) {
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
(
|
|
89
|
+
const i = s.shadowRoot.querySelector("div");
|
|
90
|
+
i && ["drag--up", "drag--down", "moving"].forEach(
|
|
91
|
+
(l) => i.classList.remove(l)
|
|
64
92
|
);
|
|
65
93
|
}
|
|
66
94
|
});
|
|
67
95
|
});
|
|
68
96
|
const a = Array.from(t.children).map((n) => {
|
|
69
|
-
const s = n.cloneNode(!0),
|
|
70
|
-
return
|
|
97
|
+
const s = n.cloneNode(!0), i = s.querySelector(".handle");
|
|
98
|
+
return i && i.remove(), s.innerText.trim();
|
|
71
99
|
});
|
|
72
100
|
this.dispatchChange(this.originalIndex, r, a);
|
|
73
101
|
}
|
|
@@ -98,7 +126,7 @@ class l extends c {
|
|
|
98
126
|
);
|
|
99
127
|
}
|
|
100
128
|
}
|
|
101
|
-
|
|
129
|
+
g.define("wje-reorder", g);
|
|
102
130
|
export {
|
|
103
|
-
|
|
131
|
+
g as default
|
|
104
132
|
};
|
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.11",
|
|
5
5
|
"homepage": "https://github.com/lencys/wj-elements",
|
|
6
6
|
"author": "Lukáš Ondrejček <lukas.ondrejcek@gmail.com>",
|
|
7
7
|
"license": "MIT",
|