doph-js 0.0.30 → 0.0.31

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/README.md CHANGED
@@ -1,4 +1,60 @@
1
- # Doph JS
1
+ # DophJS
2
2
 
3
- Simple UI for Vue3
3
+ Простая библиотека компонентов интерфейса для Vue3
4
4
 
5
+ [![Npm package total downloads](https://badgen.net/npm/dt/doph-js)](https://www.npmjs.com/package/doph-js)
6
+ [![made-with-javascript](https://img.shields.io/badge/Made%20with-JavaScript-1f425f.svg)](https://www.javascript.com)
7
+ [![Npm package version](https://badgen.net/npm/v/doph-js)](https://www.npmjs.com/package/doph-js)
8
+ [![Npm package dependents](https://badgen.net/npm/dependents/doph-js)](https://npmjs.com/package/doph-js)
9
+ [![Npm package license](https://badgen.net/npm/license/doph-js)](https://npmjs.com/package/doph-js)
10
+
11
+ ## В состав входит
12
+
13
+ ---
14
+
15
+ ### DButton
16
+ кнопки
17
+
18
+ #### props
19
+ - class : button-blue (-green, -red, -orange, -violet), button-outline-blue (-green, -red, -orange, -violet)
20
+ - icon : компонент xicon
21
+
22
+ ---
23
+
24
+ ### DIcon
25
+ обёртка xicons иконок
26
+
27
+ #### props
28
+ - component : компонент xicon
29
+ - size : число > 40
30
+ - color : строка HEX > #ffffff
31
+
32
+ ---
33
+
34
+ ### DBadge
35
+ бейджи
36
+
37
+ #### props
38
+ - class : длп.классы badge-sm, badge-blue, badge-stress-blue
39
+
40
+ ---
41
+
42
+ ### DCollapse
43
+ https://height-transition-vue3-web-animation-api.netlify.app/
44
+ https://github.com/kostyfisik/transition-height-vue3-ts/blob/main/TransitionHeight.vue
45
+
46
+ ---
47
+
48
+ ### DDrag & DDrop
49
+ https://github.com/cameronhimself/vue-drag-drop
50
+
51
+ ---
52
+
53
+ ### DTree
54
+ дерево
55
+
56
+ #### props
57
+ - items : массив нод
58
+ - noSelect : boolean - не выделять ноды
59
+ - multiSelect: boolean - множественное выделение нод
60
+ - expanded: boolean - все ветви по умолчанию развёрнуты
package/dist/dophJs.js CHANGED
@@ -1,33 +1,33 @@
1
- import { useSlots as y, computed as d, h as m, openBlock as r, createBlock as S, unref as u, createElementBlock as c, Fragment as h, normalizeClass as p, renderSlot as g, createCommentVNode as _, createVNode as D, createElementVNode as f, resolveComponent as k, toDisplayString as B, renderList as v, getCurrentInstance as $, reactive as x } from "vue";
2
- const z = {
3
- __name: "BIcon",
1
+ import { useSlots as U, computed as p, h as Y, openBlock as f, createBlock as h, unref as g, createElementBlock as $, Fragment as Z, normalizeClass as W, renderSlot as y, createCommentVNode as T, createVNode as X, createElementVNode as A, Transition as ne, withCtx as S, ref as k, resolveDynamicComponent as E, withModifiers as C, normalizeStyle as F, resolveComponent as oe, toDisplayString as K, createTextVNode as ie, renderList as q, reactive as G, getCurrentInstance as ae, watch as se, onUnmounted as re, mergeProps as V } from "vue";
2
+ const P = {
3
+ __name: "DIcon",
4
4
  props: {
5
- component: Object,
5
+ component: [Object, String],
6
6
  size: [Number, String],
7
7
  color: String
8
8
  },
9
9
  setup(t) {
10
- const e = t, n = y(), l = d(() => {
11
- const { color: o } = e;
12
- return o === void 0 ? null : o;
13
- }), a = d(() => {
14
- const o = e.size ?? null;
15
- if (o !== void 0)
16
- return typeof o == "number" || /^\d+$/.test(o) ? `${o}px` : o;
17
- }), i = m(
10
+ const e = t, n = U(), o = p(() => {
11
+ const { color: d } = e;
12
+ return d === void 0 ? null : d;
13
+ }), i = p(() => {
14
+ const d = e.size ?? null;
15
+ if (d !== void 0)
16
+ return typeof d == "number" || /^\d+$/.test(d) ? `${d}px` : d;
17
+ }), s = Y(
18
18
  "i",
19
19
  {
20
20
  class: "icon",
21
21
  style: {
22
- color: l.value,
23
- fontSize: a.value
22
+ color: o.value,
23
+ fontSize: i.value
24
24
  }
25
25
  },
26
- e.component ? m(e.component) : n
26
+ e.component ? Y(e.component) : n
27
27
  );
28
- return (o, b) => (r(), S(u(i)));
28
+ return (d, c) => (f(), h(g(s)));
29
29
  }
30
- }, w = {
30
+ }, ke = {
31
31
  __name: "DButton",
32
32
  props: {
33
33
  class: String,
@@ -36,103 +36,1011 @@ const z = {
36
36
  setup(t) {
37
37
  const e = t;
38
38
  let n = null;
39
- return e.icon && (n = m(z, {
39
+ return e.icon && (n = Y(P, {
40
40
  component: e.icon,
41
41
  color: "inherit"
42
- })), (l, a) => (r(), c(h, null, [
43
- u(n) ? _("", !0) : (r(), c("div", {
42
+ })), (o, i) => (f(), $(Z, null, [
43
+ g(n) ? T("", !0) : (f(), $("div", {
44
44
  key: 0,
45
- class: p(["button", e.class])
45
+ class: W(["button", e.class])
46
46
  }, [
47
- g(l.$slots, "default")
47
+ y(o.$slots, "default")
48
48
  ], 2)),
49
- u(n) ? (r(), c("div", {
49
+ g(n) ? (f(), $("div", {
50
50
  key: 1,
51
- class: p(["button button-ext", e.class])
51
+ class: W(["button button-ext", e.class])
52
52
  }, [
53
- D(u(n)),
54
- f("div", null, [
55
- g(l.$slots, "default")
53
+ X(g(n)),
54
+ A("div", null, [
55
+ y(o.$slots, "default")
56
56
  ])
57
- ], 2)) : _("", !0)
57
+ ], 2)) : T("", !0)
58
58
  ], 64));
59
59
  }
60
- }, C = { class: "tree-item" }, N = { key: 0 }, j = {
60
+ }, z = {
61
+ state: {},
62
+ getters: {
63
+ getIcon(t) {
64
+ return z.state[t];
65
+ },
66
+ getIcons() {
67
+ return z.state;
68
+ }
69
+ },
70
+ mutations: {
71
+ addIcon(t, e) {
72
+ z.state.name = e;
73
+ },
74
+ addIcons(t) {
75
+ for (const e in t)
76
+ t.hasOwnProperty(e) && (z.state[e] = t[e]);
77
+ }
78
+ }
79
+ }, de = {
80
+ __name: "DBadge",
81
+ props: {
82
+ class: String
83
+ },
84
+ setup(t) {
85
+ const e = t;
86
+ return (n, o) => (f(), $("div", {
87
+ class: W(["badge", e.class])
88
+ }, [
89
+ y(n.$slots, "default")
90
+ ], 2));
91
+ }
92
+ }, I = "0px", le = {
93
+ __name: "DCollapse",
94
+ props: {
95
+ duration: {
96
+ type: Number,
97
+ default: 200
98
+ },
99
+ easingEnter: {
100
+ type: String,
101
+ default: "ease-in-out"
102
+ },
103
+ easingLeave: {
104
+ type: String,
105
+ default: "ease-in-out"
106
+ },
107
+ opacityClosed: {
108
+ type: Number,
109
+ default: 0
110
+ },
111
+ opacityOpened: {
112
+ type: Number,
113
+ default: 1
114
+ }
115
+ },
116
+ setup(t) {
117
+ const e = t, n = (a) => ({
118
+ height: a.style.height,
119
+ width: a.style.width,
120
+ position: a.style.position,
121
+ visibility: a.style.visibility,
122
+ overflow: a.style.overflow,
123
+ paddingTop: a.style.paddingTop,
124
+ paddingBottom: a.style.paddingBottom,
125
+ borderTopWidth: a.style.borderTopWidth,
126
+ borderBottomWidth: a.style.borderBottomWidth,
127
+ marginTop: a.style.marginTop,
128
+ marginBottom: a.style.marginBottom
129
+ }), o = (a, r) => {
130
+ const { width: u } = getComputedStyle(a);
131
+ a.style.width = u, a.style.position = "absolute", a.style.visibility = "hidden", a.style.height = "";
132
+ let { height: m } = getComputedStyle(a);
133
+ return a.style.width = r.width, a.style.position = r.position, a.style.visibility = r.visibility, a.style.height = I, a.style.overflow = "hidden", r.height && r.height !== I ? r.height : m;
134
+ }, i = (a, r, u, m, _) => {
135
+ const B = a.animate(m, _);
136
+ a.style.height = r.height, B.onfinish = () => {
137
+ a.style.overflow = r.overflow, u();
138
+ };
139
+ }, s = (a, r) => [
140
+ {
141
+ height: I,
142
+ opacity: e.opacityClosed,
143
+ paddingTop: I,
144
+ paddingBottom: I,
145
+ borderTopWidth: I,
146
+ borderBottomWidth: I,
147
+ marginTop: I,
148
+ marginBottom: I
149
+ },
150
+ {
151
+ height: a,
152
+ opacity: e.opacityOpened,
153
+ paddingTop: r.paddingTop,
154
+ paddingBottom: r.paddingBottom,
155
+ borderTopWidth: r.borderTopWidth,
156
+ borderBottomWidth: r.borderBottomWidth,
157
+ marginTop: r.marginTop,
158
+ marginBottom: r.marginBottom
159
+ }
160
+ ], d = (a, r) => {
161
+ const u = a, m = n(u), _ = o(u, m), B = s(_, m), N = { duration: e.duration, easing: e.easingEnter };
162
+ i(u, m, r, B, N);
163
+ }, c = (a, r) => {
164
+ const u = a, m = n(u), { height: _ } = getComputedStyle(u);
165
+ u.style.height = _, u.style.overflow = "hidden";
166
+ const B = s(_, m).reverse(), N = { duration: e.duration, easing: e.easingLeave };
167
+ i(u, m, r, B, N);
168
+ };
169
+ return (a, r) => (f(), h(ne, {
170
+ css: !1,
171
+ onEnter: d,
172
+ onLeave: c
173
+ }, {
174
+ default: S(() => [
175
+ y(a.$slots, "default")
176
+ ]),
177
+ _: 3
178
+ }));
179
+ }
180
+ }, R = {
181
+ data: void 0
182
+ }, j = (t) => t.reduce((e, n) => (e[n] = n) && e, {}), D = j([
183
+ "drag",
184
+ "dragend",
185
+ "dragenter",
186
+ "dragleave",
187
+ "dragstart",
188
+ "dragover",
189
+ "drop"
190
+ ]), ue = j(["copy", "move", "link", "none"]), ce = j([
191
+ "none",
192
+ "copy",
193
+ "copyLink",
194
+ "copyMove",
195
+ "link",
196
+ "linkMove",
197
+ "move",
198
+ "all",
199
+ "uninitialized"
200
+ ]), fe = {
201
+ __name: "DDrag",
202
+ props: {
203
+ draggable: { type: Boolean, default: !0 },
204
+ transferData: {},
205
+ dropEffect: { validator: (t) => t in ue },
206
+ effectAllowed: { validator: (t) => t in ce },
207
+ image: String,
208
+ imageXOffset: { type: Number, default: 0 },
209
+ imageYOffset: { type: Number, default: 0 },
210
+ hideImageHtml: { type: Boolean, default: !1 },
211
+ tag: { type: String, default: "div" }
212
+ },
213
+ setup(t) {
214
+ const e = t, n = U(), o = k(!1), i = p(() => o && e.transferData), s = p(() => ({ position: "fixed", top: "-1000px" })), d = (c, a) => {
215
+ const r = a.dataTransfer;
216
+ if ([D.dragenter, D.dragover].includes(c) && e.dropEffect && (r.dropEffect = e.dropEffect), c === D.dragstart) {
217
+ if (e.effectAllowed && (r.effectAllowed = e.effectAllowed), e.image || n.image) {
218
+ let u;
219
+ e.image ? (u = new Image(), u.src = e.image) : n.image && (u = n.image[0].elm), r.setDragImage && r.setDragImage(u, e.imageXOffset, e.imageYOffset);
220
+ }
221
+ e.transferData !== void 0 && (R.data = e.transferData, a.dataTransfer.setData("text", "")), o.value = !0;
222
+ }
223
+ };
224
+ return (c, a) => (f(), h(E(t.tag), {
225
+ draggable: e.draggable,
226
+ onDrag: a[0] || (a[0] = (r) => d(g(D).drag, r)),
227
+ onDragstart: a[1] || (a[1] = C((r) => d(g(D).dragstart, r), ["stop"])),
228
+ onDragenter: a[2] || (a[2] = (r) => d(g(D).dragenter, r)),
229
+ onDragleave: a[3] || (a[3] = (r) => d(g(D).dragleave, r)),
230
+ onDragend: a[4] || (a[4] = (r) => d(g(D).dragend, r))
231
+ }, {
232
+ default: S(() => [
233
+ y(c.$slots, "default", { transferData: i.value }),
234
+ t.hideImageHtml ? (f(), $("div", {
235
+ key: 0,
236
+ style: F(s.value)
237
+ }, [
238
+ y(c.$slots, "image", { transferData: i.value })
239
+ ], 4)) : y(c.$slots, "image", {
240
+ key: 1,
241
+ transferData: i.value
242
+ })
243
+ ]),
244
+ _: 3
245
+ }, 40, ["draggable"]));
246
+ }
247
+ };
248
+ const J = (t, e) => {
249
+ const n = t.__vccOpts || t;
250
+ for (const [o, i] of e)
251
+ n[o] = i;
252
+ return n;
253
+ }, pe = { class: "item-title" }, me = { style: { display: "flex", "flex-direction": "row", "justify-content": "flex-end" } }, ge = {
254
+ key: 0,
255
+ class: "sub-menu"
256
+ }, he = {
61
257
  __name: "DTreeItem",
62
258
  props: {
63
259
  model: Object,
64
260
  treeId: [String, Number]
65
261
  },
66
262
  setup(t) {
67
- const e = t, n = d(() => e.model.children && e.model.children.length), l = (i) => {
68
- s.mutations.setTreeSelect(e.treeId, e.model.id);
69
- }, a = d(() => s.actions.isTreeSelected(e.treeId, e.model.id) ? "selected" : "");
70
- return (i, o) => {
71
- const b = k("d-tree-item", !0);
72
- return r(), c("li", C, [
73
- f("div", {
74
- class: p(a.value),
75
- onClick: l,
76
- style: { display: "flex", "flex-direction": "row", "justify-content": "space-between", "align-items": "center" }
77
- }, [
78
- f("div", null, B(e.model.title), 1)
79
- ], 2),
80
- n.value ? (r(), c("ul", N, [
81
- (r(!0), c(h, null, v(t.model.children, (T) => (r(), S(b, {
82
- class: "tree-item",
83
- model: T,
84
- treeId: e.treeId
85
- }, null, 8, ["model", "treeId"]))), 256))
86
- ])) : _("", !0)
87
- ]);
263
+ const e = t, n = k(null), o = k(!1), i = k(!1), s = k(!1), d = p(() => e.model.children && e.model.children.length), c = p(() => l.actions.isItemExpanded(e.treeId, e.model.id)), a = () => {
264
+ l.mutations.setItemSelect(e.treeId, e.model), l.actions.toggleItem(e.treeId, e.model.id);
265
+ }, r = p(() => (l.actions.isItemSelected(e.treeId, e.model.id) ? "selected" : "") + (o.value ? "node-over " : "") + (i.value ? "node-top " : "") + (s.value ? "node-bottom " : "")), u = p(() => e.model.draggable === !0);
266
+ p(() => Object.hasOwn(e.model, "droppable") ? e.model.droppable : !0);
267
+ const m = (N) => {
268
+ let b = R.data;
269
+ if (b.model.id === e.model.id || l.actions.isChildOfParent(e.treeId, e.model.id, b.model.id) || l.actions.isParentOfChild(e.treeId, b.model.id, e.model.id))
270
+ return o.value = !1, i.value = !1, s.value = !1, !1;
271
+ if (!l.state.trees[e.treeId].transfer && b.id !== e.treeId)
272
+ return !1;
273
+ let x = "";
274
+ i.value ? x = "before" : s.value ? x = "after" : x = "inside", l.actions.moveTreeNode(b.id, e.treeId, l.getters.getItems(e.treeId), b.model.id, e.model.id, x), o.value = !1, i.value = !1, s.value = !1;
275
+ }, _ = (N) => {
276
+ let b = R.data;
277
+ if (b.model.id === e.model.id || l.actions.isChildOfParent(e.treeId, e.model.id, b.model.id) || l.actions.isParentOfChild(e.treeId, b.model.id, e.model.id))
278
+ return !1;
279
+ const x = N.y, w = n.value.getBoundingClientRect().top, L = n.value.getBoundingClientRect().height, M = L / 3;
280
+ x > w && x <= w + M ? (o.value = !1, i.value = !0, s.value = !1) : x < w + L && x >= w + L - M ? (o.value = !1, i.value = !1, s.value = !0) : (o.value = !0, i.value = !1, s.value = !1);
281
+ }, B = () => {
282
+ o.value = !1, i.value = !1, s.value = !1;
283
+ };
284
+ return (N, b) => {
285
+ const x = oe("d-tree-item", !0);
286
+ return f(), h(fe, {
287
+ tag: "li",
288
+ class: "tree-item",
289
+ "transfer-data": { id: e.treeId, model: e.model },
290
+ draggable: u.value,
291
+ onDrop: C(m, ["stop"]),
292
+ onDragenter: b[0] || (b[0] = C(() => {
293
+ }, ["prevent"])),
294
+ onDragover: C(_, ["prevent", "stop"]),
295
+ onDragleave: C(B, ["prevent"])
296
+ }, {
297
+ default: S(() => {
298
+ var w, L;
299
+ return [
300
+ A("div", {
301
+ ref_key: "node",
302
+ ref: n,
303
+ class: W(r.value),
304
+ onClick: a
305
+ }, [
306
+ A("div", null, [
307
+ e.model.icons && e.model.icons.pre && d.value ? (f(), h(E(P), {
308
+ key: 0,
309
+ component: g(z).getters.getIcon(e.model.icons.pre.component),
310
+ size: 18,
311
+ color: e.model.icons.pre.color ? e.model.icons.pre.color : "inherit",
312
+ class: W(c.value ? "tree-open-pre" : "")
313
+ }, null, 8, ["component", "color", "class"])) : T("", !0),
314
+ e.model.icons && e.model.icons.pre && !d.value ? (f(), h(E(P), {
315
+ key: 1,
316
+ component: g(z).getters.getIcon(e.model.icons.pre.component),
317
+ size: 18,
318
+ color: "rgba(0,0,0,0)",
319
+ class: W(c.value ? "tree-open-pre" : "")
320
+ }, null, 8, ["component", "class"])) : T("", !0),
321
+ e.model.icons && e.model.icons.icon ? (f(), h(E(P), {
322
+ key: 2,
323
+ component: g(z).getters.getIcon(e.model.icons.icon.component),
324
+ color: e.model.icons.icon.color ? e.model.icons.icon.color : "inherit"
325
+ }, null, 8, ["component", "color"])) : T("", !0),
326
+ A("div", pe, [
327
+ A("div", null, K(e.model.title), 1)
328
+ ])
329
+ ]),
330
+ A("div", me, [
331
+ ((w = e.model.badge) == null ? void 0 : w.value) !== void 0 ? (f(), h(E(de), {
332
+ key: 0,
333
+ class: W([(L = e.model.badge) == null ? void 0 : L.class, "badge-sm"])
334
+ }, {
335
+ default: S(() => [
336
+ ie(K(e.model.badge.value), 1)
337
+ ]),
338
+ _: 1
339
+ }, 8, ["class"])) : T("", !0),
340
+ e.model.icons && e.model.icons.post && d.value ? (f(), h(E(P), {
341
+ key: 1,
342
+ component: g(z).getters.getIcon(e.model.icons.post.component),
343
+ size: 20,
344
+ color: e.model.icons.post.color ? e.model.icons.post.color : "inherit",
345
+ class: W(c.value ? "tree-open-post" : "")
346
+ }, null, 8, ["component", "color", "class"])) : T("", !0)
347
+ ])
348
+ ], 2),
349
+ X(le, null, {
350
+ default: S(() => [
351
+ d.value && c.value ? (f(), $("ul", ge, [
352
+ (f(!0), $(Z, null, q(t.model.children, (M) => (f(), h(x, {
353
+ class: "tree-item",
354
+ key: M.id,
355
+ model: M,
356
+ treeId: e.treeId
357
+ }, null, 8, ["model", "treeId"]))), 128))
358
+ ])) : T("", !0)
359
+ ]),
360
+ _: 1
361
+ })
362
+ ];
363
+ }),
364
+ _: 1
365
+ }, 8, ["transfer-data", "draggable", "onDrop", "onDragover", "onDragleave"]);
366
+ };
367
+ }
368
+ }, ye = /* @__PURE__ */ J(he, [["__scopeId", "data-v-f03192c5"]]);
369
+ function ve(t) {
370
+ return t = t || /* @__PURE__ */ new Map(), {
371
+ /**
372
+ * A Map of event names to registered handler functions.
373
+ */
374
+ all: t,
375
+ /**
376
+ * Register an event handler for the given type.
377
+ * @param {string|symbol} type Type of event to listen for, or `'*'` for all events
378
+ * @param {Function} handler Function to call in response to given event
379
+ * @memberOf eventsBus
380
+ */
381
+ on(e, n) {
382
+ const o = t.get(e);
383
+ o ? o.push(n) : t.set(e, [n]);
384
+ },
385
+ /**
386
+ * Remove an event handler for the given type.
387
+ * If `handler` is omitted, all handlers of the given type are removed.
388
+ * @param {string|symbol} type Type of event to unregister `handler` from (`'*'` to remove a wildcard handler)
389
+ * @param {Function} [handler] Handler function to remove
390
+ * @memberOf eventsBus
391
+ */
392
+ off(e, n) {
393
+ const o = t.get(e);
394
+ o && (n ? o.splice(o.indexOf(n) >>> 0, 1) : t.set(e, []));
395
+ },
396
+ /**
397
+ * Invoke all handlers for the given type.
398
+ * If present, `'*'` handlers are invoked after type-matched handlers.
399
+ *
400
+ * Note: Manually firing '*' handlers is not supported.
401
+ *
402
+ * @param {string|symbol} type The event type to invoke
403
+ * @param {Any} [evt] Any value (object is recommended and powerful), passed to each handler
404
+ * @memberOf eventsBus
405
+ */
406
+ emit(e, n) {
407
+ let o = t.get(e);
408
+ o && o.slice().map((i) => {
409
+ i(n);
410
+ }), o = t.get("*"), o && o.slice().map((i) => {
411
+ i(e, n);
412
+ });
413
+ }
414
+ };
415
+ }
416
+ const H = ve(), l = {
417
+ state: G({
418
+ trees: {}
419
+ }),
420
+ getters: {
421
+ getItems(t) {
422
+ return l.state.trees[t].items;
423
+ },
424
+ getItemsSelect(t) {
425
+ return l.state.trees[t].selected;
426
+ },
427
+ // data - ноды, dataId - ID ноды родителя data
428
+ getParentId(t, e, n, o = "id", i = "children", s = {}) {
429
+ return n && t && (t.find((d) => d[o] === n ? (s.found = e, d) : l.getters.getParentId(d[i], d.id, n, o, i, s)), s.found) ? s.found : !1;
430
+ }
431
+ },
432
+ mutations: {
433
+ setTreeItems(t, e) {
434
+ l.state.trees[t].items = e;
435
+ },
436
+ setItemSelect(t, e) {
437
+ H.emit(`select-${t}`, { id: t, model: e }), !l.state.trees[t].noSelect && (l.state.trees[t].multiSelect ? l.state.trees[t].selected.includes(e.id) ? l.state.trees[t].selected = l.state.trees[t].selected.filter(function(n) {
438
+ return n !== e.id;
439
+ }) : l.state.trees[t].selected = [...l.state.trees[t].selected, e.id] : l.state.trees[t].selected = [e.id]);
440
+ }
441
+ },
442
+ actions: {
443
+ initTreeStore(t, e, n, o, i, s) {
444
+ l.state.trees[t] = [], l.state.trees[t].selected = [], l.state.trees[t].items = structuredClone(e), l.state.trees[t].noSelect = n, l.state.trees[t].multiSelect = o, l.state.trees[t].expanded = i, l.state.trees[t].transfer = s;
445
+ },
446
+ isItemSelected(t, e) {
447
+ return l.state.trees[t].selected.includes(e);
448
+ },
449
+ toggleItem(t, e) {
450
+ const n = l.actions.deepSearch(l.state.trees[t].items, e);
451
+ n.expanded = n.expanded === void 0 || !n.expanded, n.children && n.children.length && (n.expanded ? H.emit(`expand-${t}`, { id: t, model: n }) : H.emit(`collapse-${t}`, { id: t, model: n }));
452
+ },
453
+ isItemExpanded(t, e) {
454
+ const n = l.actions.deepSearch(l.state.trees[t].items, e);
455
+ return l.state.trees[t].expanded && (n.expanded = n.expanded === void 0 ? !0 : n.expanded), n.expanded;
456
+ },
457
+ // Является ли нода потомком указанного родителя
458
+ isChildOfParent(t, e, n) {
459
+ const o = l.actions.deepSearch(l.state.trees[t].items, e);
460
+ if (o && o.children) {
461
+ for (let i = 0; i < o.children.length; i++)
462
+ if (o.children[i].id === n)
463
+ return !0;
464
+ }
465
+ return !1;
466
+ },
467
+ // Является ли нода родителем указанного потомка
468
+ isParentOfChild(t, e, n) {
469
+ const o = l.actions.deepSearch(l.state.trees[t].items, e);
470
+ return !!(o && o.children && l.actions.deepSearch(o.children, n));
471
+ },
472
+ deepSearch(t, e, n = "id", o = "children", i = {}) {
473
+ return e && t && (t.find((s) => s[n] === e ? (i.found = s, s) : l.actions.deepSearch(s[o], e, n, o, i)), i.found) ? i.found : !1;
474
+ },
475
+ moveTreeNode(t, e, n, o, i, s) {
476
+ const d = l.actions.deleteTreeNode(n, o);
477
+ l.actions.insertTreeNode(n, i, d, s), H.emit(`move-${e}`, { fromTreeId: t, toTreeId: e, moved: d.id, target: i, position: s });
478
+ },
479
+ insertTreeNode(t, e, n, o) {
480
+ if (t)
481
+ for (let i = 0; i < t.length; i++) {
482
+ if (t[i].id === e) {
483
+ let d = i;
484
+ return o === "after" ? (d++, t.splice(d, 0, n)) : o === "before" ? t.splice(d, 0, n) : o === "inside" && (Object.hasOwn(t[i], "children") || (t[i].children = [], t[i].opened = !0), t[i].children.splice(0, 0, n)), t[i];
485
+ }
486
+ const s = this.insertTreeNode(t[i].children, e, n, o);
487
+ if (s)
488
+ return s;
489
+ }
490
+ },
491
+ deleteTreeNode(t, e) {
492
+ if (t)
493
+ for (let n = 0; n < t.length; n++) {
494
+ if (t[n].id === e) {
495
+ const i = t[n];
496
+ return t.splice(n, 1), i;
497
+ }
498
+ const o = l.actions.deleteTreeNode(t[n].children, e);
499
+ if (o)
500
+ return o;
501
+ }
502
+ }
503
+ }
504
+ }, be = {
505
+ __name: "DDrop",
506
+ props: {
507
+ tag: { type: String, default: "div" }
508
+ },
509
+ emits: Object.keys(D),
510
+ setup(t, { emit: e }) {
511
+ let n = G({});
512
+ const o = k("false"), i = k(null), s = /* @__PURE__ */ new Set(), d = p(() => o.value && n), c = (a, r) => {
513
+ n = R.data, e(a, r, n), a === D.dragenter && (s.size || r.target === i.value) && s.add(r.target), a === D.dragleave && s.delete(r.target), a === D.drop && s.clear(), o.value = !!s.size;
88
514
  };
515
+ return (a, r) => (f(), h(E(t.tag), {
516
+ ref_key: "el",
517
+ ref: i,
518
+ onDragenter: r[0] || (r[0] = (u) => c(g(D).dragenter, u)),
519
+ onDragleave: r[1] || (r[1] = (u) => c(g(D).dragleave, u)),
520
+ onDragover: r[2] || (r[2] = C((u) => c(g(D).dragover, u), ["prevent"])),
521
+ onDrop: r[3] || (r[3] = C((u) => c(g(D).drop, u), ["prevent"]))
522
+ }, {
523
+ default: S(() => [
524
+ y(a.$slots, "default", { transferData: d.value })
525
+ ]),
526
+ _: 3
527
+ }, 544));
89
528
  }
90
- }, O = { class: "tree" }, E = {
529
+ }, xe = {
91
530
  __name: "DTree",
92
531
  props: {
93
532
  items: Array,
533
+ // ноды
94
534
  noSelect: Boolean,
95
- multiSelect: Boolean
535
+ // не выбирать ноды
536
+ multiSelect: Boolean,
537
+ // множественный выбор нод
538
+ expanded: Boolean,
539
+ // все ноды раскрыты
540
+ transfer: Boolean
541
+ // перенос нод между деревьями
542
+ },
543
+ emits: ["select", "collapse", "expand", "move"],
544
+ setup(t, { emit: e }) {
545
+ const n = t, o = ae().uid;
546
+ l.actions.initTreeStore(o, n.items, n.noSelect, n.multiSelect, n.expanded, n.transfer);
547
+ const i = (s, d) => {
548
+ console.log(s, d);
549
+ };
550
+ return H.on(`select-${o}`, (s) => {
551
+ e("select", s);
552
+ }), H.on(`expand-${o}`, (s) => {
553
+ e("expand", s);
554
+ }), H.on(`collapse-${o}`, (s) => {
555
+ e("collapse", s);
556
+ }), H.on(`move-${o}`, (s) => {
557
+ e("move", s);
558
+ }), (s, d) => (f(), h(be, {
559
+ class: "tree",
560
+ tag: "ul",
561
+ onDrop: C(i, ["stop"])
562
+ }, {
563
+ default: S(() => [
564
+ (f(!0), $(Z, null, q(g(l).getters.getItems(g(o)), (c) => (f(), h(ye, {
565
+ key: c.id,
566
+ model: c,
567
+ treeId: g(o)
568
+ }, null, 8, ["model", "treeId"]))), 128))
569
+ ]),
570
+ _: 1
571
+ }, 8, ["onDrop"]));
572
+ }
573
+ };
574
+ const De = {
575
+ __name: "DAccordion",
576
+ props: {
577
+ items: Array
96
578
  },
97
579
  setup(t) {
98
- const e = t, n = $().uid;
99
- return s.actions.initTreeStore(n, e.noSelect, e.multiSelect), (l, a) => (r(), c("ul", O, [
100
- (r(!0), c(h, null, v(t.items, (i) => (r(), S(j, {
101
- key: i.id,
102
- model: i,
103
- treeId: u(n)
104
- }, null, 8, ["model", "treeId"]))), 128))
105
- ]));
106
- }
107
- }, s = {
108
- state: x({
109
- trees: {}
110
- }),
111
- getters: {
112
- getTreeSelect(t) {
113
- return s.state.trees[t].selected;
580
+ const e = t;
581
+ return (n, o) => (f(), h(xe, {
582
+ class: "accordion",
583
+ items: e.items,
584
+ "no-select": !0
585
+ }, null, 8, ["items"]));
586
+ }
587
+ }, Ce = /* @__PURE__ */ J(De, [["__scopeId", "data-v-4c920528"]]), $e = {
588
+ __name: "DLayoutHeader",
589
+ props: {
590
+ fixed: {
591
+ type: Boolean,
592
+ default: !0
593
+ },
594
+ zIndex: {
595
+ type: Number,
596
+ default: 1001
597
+ },
598
+ minWidth: {
599
+ type: Number,
600
+ default: 1280
601
+ },
602
+ height: {
603
+ type: Number,
604
+ default: 56
605
+ },
606
+ paddingLeft: {
607
+ type: Number,
608
+ default: 0
609
+ },
610
+ transitionDuration: {
611
+ type: Number,
612
+ default: 300
613
+ },
614
+ transitionTimingFunction: {
615
+ type: String,
616
+ default: "ease-in-out"
617
+ },
618
+ useMinWidthLayout: Boolean
619
+ },
620
+ setup(t) {
621
+ const e = t, n = p(() => {
622
+ const { fixed: o, zIndex: i, minWidth: s, height: d, paddingLeft: c, transitionDuration: a, transitionTimingFunction: r } = e, u = o ? "fixed" : "static", m = e.useMinWidthLayout ? `min-width:${s}px;` : "";
623
+ return `position:${u};z-index:${i};${m}height:${d}px;padding-left:${c}px;transition-duration:${a}ms;transition-timing-function:${r};`;
624
+ });
625
+ return (o, i) => (f(), $("header", {
626
+ class: "d-layout-header",
627
+ style: F(n.value)
628
+ }, [
629
+ y(o.$slots, "default")
630
+ ], 4));
631
+ }
632
+ }, Te = {
633
+ __name: "DLayoutTab",
634
+ props: {
635
+ fixed: {
636
+ type: Boolean,
637
+ default: !0
638
+ },
639
+ top: {
640
+ type: Number,
641
+ default: 56
642
+ },
643
+ zIndex: {
644
+ type: Number,
645
+ default: 999
646
+ },
647
+ minWidth: {
648
+ type: Number,
649
+ default: 1280
650
+ },
651
+ height: {
652
+ type: Number,
653
+ default: 56
654
+ },
655
+ paddingLeft: {
656
+ type: Number,
657
+ default: 0
658
+ },
659
+ transitionDuration: {
660
+ type: Number,
661
+ default: 300
662
+ },
663
+ transitionTimingFunction: {
664
+ type: String,
665
+ default: "ease-in-out"
666
+ },
667
+ useMinWidthLayout: Boolean
668
+ },
669
+ setup(t) {
670
+ const e = t, n = p(() => {
671
+ const { fixed: o, top: i, zIndex: s, minWidth: d, height: c, paddingLeft: a, transitionDuration: r, transitionTimingFunction: u } = e, m = o ? "fixed" : "static", _ = e.useMinWidthLayout ? `min-width: ${d}px;` : "";
672
+ return `position:${m};top:${i}px;z-index:${s};${_}height:${c}px;padding-left:${a}px;transition-duration:${r}ms;transition-timing-function:${u};`;
673
+ });
674
+ return (o, i) => (f(), $("div", {
675
+ class: "d-layout-tab",
676
+ style: F(n.value)
677
+ }, [
678
+ y(o.$slots, "default")
679
+ ], 4));
680
+ }
681
+ }, _e = {
682
+ __name: "DLayoutFooter",
683
+ props: {
684
+ fixed: {
685
+ type: Boolean,
686
+ default: !0
687
+ },
688
+ zIndex: {
689
+ type: Number,
690
+ default: 999
691
+ },
692
+ minWidth: {
693
+ type: Number,
694
+ default: 1280
695
+ },
696
+ height: {
697
+ type: Number,
698
+ default: 56
699
+ },
700
+ paddingLeft: {
701
+ type: Number,
702
+ default: 0
703
+ },
704
+ transitionDuration: {
705
+ type: Number,
706
+ default: 300
707
+ },
708
+ transitionTimingFunction: {
709
+ type: String,
710
+ default: "ease-in-out"
711
+ },
712
+ useMinWidthLayout: Boolean
713
+ },
714
+ setup(t) {
715
+ const e = t, n = p(() => {
716
+ const { fixed: o, zIndex: i, minWidth: s, height: d, paddingLeft: c, transitionDuration: a, transitionTimingFunction: r } = e, u = o ? "fixed" : "static", m = e.useMinWidthLayout ? `min-width:${s}px;` : "";
717
+ return `position:${u};z-index:${i};${m}height:${d}px;padding-left:${c}px;transition-duration:${a}ms;transition-timing-function:${r};`;
718
+ });
719
+ return (o, i) => (f(), $("footer", {
720
+ class: "d-layout-footer",
721
+ style: F(n.value)
722
+ }, [
723
+ y(o.$slots, "default")
724
+ ], 4));
725
+ }
726
+ }, Se = {
727
+ __name: "DLayoutSidebar",
728
+ props: {
729
+ zIndex: {
730
+ type: Number,
731
+ default: 1002
732
+ },
733
+ width: {
734
+ type: Number,
735
+ default: 200
736
+ },
737
+ paddingTop: {
738
+ type: Number,
739
+ default: 0
740
+ },
741
+ transitionDuration: {
742
+ type: Number,
743
+ default: 300
744
+ },
745
+ transitionTimingFunction: {
746
+ type: String,
747
+ default: "ease-in-out"
748
+ },
749
+ collapse: {
750
+ type: Boolean,
751
+ default: !1
114
752
  }
115
753
  },
116
- mutations: {
117
- setTreeSelect(t, e) {
118
- s.state.trees[t].noSelect || (s.state.trees[t].multiSelect ? s.state.trees[t].selected.includes(e) ? s.state.trees[t].selected = s.state.trees[t].selected.filter(function(n) {
119
- return n !== e;
120
- }) : s.state.trees[t].selected = [...s.state.trees[t].selected, e] : s.state.trees[t].selected = [e]);
754
+ setup(t) {
755
+ const e = t, n = p(() => {
756
+ const { zIndex: o, width: i, paddingTop: s, transitionDuration: d, transitionTimingFunction: c } = e;
757
+ return `z-index:${o};width:${i}px;padding-top:${s}px;transition-duration:${d}ms;transition-timing-function:${c};`;
758
+ });
759
+ return (o, i) => (f(), $("aside", {
760
+ class: "d-layout-sidebar",
761
+ style: F(n.value)
762
+ }, [
763
+ y(o.$slots, "default")
764
+ ], 4));
765
+ }
766
+ }, Be = {
767
+ __name: "DLayoutContent",
768
+ props: {
769
+ paddingTop: {
770
+ type: Number,
771
+ default: 0
772
+ },
773
+ paddingBottom: {
774
+ type: Number,
775
+ default: 0
776
+ },
777
+ paddingLeft: {
778
+ type: Number,
779
+ default: 0
780
+ },
781
+ overflowHidden: Boolean,
782
+ transitionDuration: {
783
+ type: Number,
784
+ default: 300
785
+ },
786
+ transitionTimingFunction: {
787
+ type: String,
788
+ default: "ease-in-out"
121
789
  }
122
790
  },
123
- actions: {
124
- initTreeStore(t, e, n) {
125
- s.state.trees[t] = [], s.state.trees[t].selected = [], s.state.trees[t].noSelect = e, s.state.trees[t].multiSelect = n;
791
+ setup(t) {
792
+ const e = t, n = p(() => {
793
+ const { paddingTop: o, paddingBottom: i, paddingLeft: s, transitionDuration: d, transitionTimingFunction: c } = e, a = `overflow:${e.overflowHidden ? "hidden" : "visible"};`;
794
+ return `padding-top:${o}px;padding-bottom:${i}px;padding-left:${s}px;${a}transition-duration:${d}ms;transition-timing-function:${c};`;
795
+ });
796
+ return (o, i) => (f(), $("main", {
797
+ style: F(n.value),
798
+ class: "d-layout-content"
799
+ }, [
800
+ y(o.$slots, "default")
801
+ ], 4));
802
+ }
803
+ };
804
+ function Ne(t) {
805
+ const e = k(0), n = p(() => `transform: translateX(${-e.value}px);`);
806
+ let o = !1;
807
+ function i(u) {
808
+ e.value = u;
809
+ }
810
+ function s() {
811
+ var u;
812
+ const m = ((u = document.scrollingElement) === null || u === void 0 ? void 0 : u.scrollLeft) || 0;
813
+ i(m);
814
+ }
815
+ function d() {
816
+ s();
817
+ }
818
+ function c() {
819
+ document.addEventListener("scroll", s);
820
+ }
821
+ function a() {
822
+ o && document.removeEventListener("scroll", s);
823
+ }
824
+ function r() {
825
+ d(), c(), o = !0;
826
+ }
827
+ return se(t, (u) => {
828
+ u ? r() : a();
829
+ }, { immediate: !0 }), re(() => {
830
+ a();
831
+ }), n;
832
+ }
833
+ const we = 1001, Ie = 999, Le = 998, ze = {
834
+ __name: "DLayoutAdmin",
835
+ props: {
836
+ mode: {
837
+ type: String,
838
+ default: "vertical"
839
+ // vertical, horizontal
840
+ },
841
+ isMobile: {
842
+ type: Boolean,
843
+ default: !1
844
+ },
845
+ useMinWidthLayout: {
846
+ type: Boolean,
847
+ default: !1
848
+ },
849
+ minWidth: {
850
+ type: Number,
851
+ default: 1200
126
852
  },
127
- isTreeSelected(t, e) {
128
- return s.state.trees[t].selected.includes(e);
853
+ headerVisible: {
854
+ type: Boolean,
855
+ default: !0
856
+ },
857
+ headerHeight: {
858
+ type: Number,
859
+ default: 56
860
+ },
861
+ tabVisible: {
862
+ type: Boolean,
863
+ default: !0
864
+ },
865
+ tabHeight: {
866
+ type: Number,
867
+ default: 44
868
+ },
869
+ fixedHeaderAndTab: {
870
+ type: Boolean,
871
+ default: !0
872
+ },
873
+ addMainOverflowHidden: {
874
+ type: Boolean,
875
+ default: !1
876
+ },
877
+ footerVisible: {
878
+ type: Boolean,
879
+ default: !0
880
+ },
881
+ footerHeight: {
882
+ type: Number,
883
+ default: 48
884
+ },
885
+ fixedFooter: {
886
+ type: Boolean,
887
+ default: !0
888
+ },
889
+ sidebarVisible: {
890
+ type: Boolean,
891
+ default: !0
892
+ },
893
+ sidebarWidth: {
894
+ type: Number,
895
+ default: 200
896
+ },
897
+ sidebarCollapsedWidth: {
898
+ type: Number,
899
+ default: 0
900
+ },
901
+ sidebarCollapse: {
902
+ type: Boolean,
903
+ default: !1
904
+ },
905
+ transitionDuration: {
906
+ type: Number,
907
+ default: 300
908
+ },
909
+ transitionTimingFunction: {
910
+ type: String,
911
+ default: "ease-in-out"
912
+ },
913
+ collapse: {
914
+ type: Boolean,
915
+ default: !1
916
+ },
917
+ maskBg: {
918
+ type: String,
919
+ default: "rgba(0,0,0,0.3)"
920
+ }
921
+ },
922
+ emits: ["update:sidebar-collapse"],
923
+ setup(t, { emit: e }) {
924
+ const n = t, o = p(() => n.useMinWidthLayout ? `min-width:${n.minWidth}px;` : ""), i = p(() => n.useMinWidthLayout && (n.fixedHeaderAndTab || n.fixedFooter)), s = Ne(i), d = p(() => n.fixedHeaderAndTab ? s.value : ""), c = p(() => n.fixedFooter ? s.value : ""), a = p(() => {
925
+ const { transitionDuration: v, transitionTimingFunction: O } = n;
926
+ return {
927
+ transitionDuration: v,
928
+ transitionTimingFunction: O
929
+ };
930
+ }), r = p(() => n.mode === "vertical"), u = p(() => n.isMobile || r.value ? 1003 : 1e3), m = p({
931
+ get() {
932
+ return n.sidebarCollapse;
933
+ },
934
+ set(v) {
935
+ e("update:sidebar-collapse", v);
936
+ }
937
+ });
938
+ function _() {
939
+ m.value = !0;
129
940
  }
941
+ const B = p(() => n.isMobile && !m.value), N = p(() => {
942
+ const { transitionDuration: v, transitionTimingFunction: O } = n;
943
+ return `background-color:${n.maskBg};transition-duration:${v}ms;transition-timing-function:${O};`;
944
+ }), b = p(() => {
945
+ const { sidebarWidth: v, sidebarCollapsedWidth: O } = n, ee = n.isMobile ? 0 : O, te = m.value ? ee : v;
946
+ return n.sidebarVisible ? te : 0;
947
+ }), x = p(() => n.isMobile ? 0 : b.value), w = p(() => r.value ? x.value : 0), L = p(
948
+ () => !n.isMobile && !r.value && n.headerVisible ? n.headerHeight : 0
949
+ ), M = p(() => {
950
+ let v = 0;
951
+ return n.fixedHeaderAndTab && (n.headerVisible && (v += n.headerHeight), n.tabVisible && (v += n.tabHeight)), v;
952
+ }), Q = p(() => n.fixedFooter && n.footerVisible ? n.footerHeight : 0);
953
+ return (v, O) => (f(), $("div", {
954
+ class: "d-layout",
955
+ style: F(o.value)
956
+ }, [
957
+ t.headerVisible ? (f(), h($e, V({ key: 0 }, a.value, {
958
+ fixed: t.fixedHeaderAndTab,
959
+ "z-index": we,
960
+ "min-width": t.minWidth,
961
+ height: t.headerHeight,
962
+ "padding-left": w.value,
963
+ style: d.value
964
+ }), {
965
+ default: S(() => [
966
+ y(v.$slots, "header")
967
+ ]),
968
+ _: 3
969
+ }, 16, ["fixed", "min-width", "height", "padding-left", "style"])) : T("", !0),
970
+ t.tabVisible ? (f(), h(Te, V({ key: 1 }, a.value, {
971
+ fixed: t.fixedHeaderAndTab,
972
+ "z-index": Ie,
973
+ "min-width": t.minWidth,
974
+ top: t.headerHeight,
975
+ height: t.tabHeight,
976
+ "padding-left": x.value,
977
+ style: d.value
978
+ }), {
979
+ default: S(() => [
980
+ y(v.$slots, "tab")
981
+ ]),
982
+ _: 3
983
+ }, 16, ["fixed", "min-width", "top", "height", "padding-left", "style"])) : T("", !0),
984
+ t.sidebarVisible ? (f(), h(Se, V({ key: 2 }, a.value, {
985
+ "z-index": u.value,
986
+ width: b.value,
987
+ "padding-top": L.value
988
+ }), {
989
+ default: S(() => [
990
+ y(v.$slots, "sidebar")
991
+ ]),
992
+ _: 3
993
+ }, 16, ["z-index", "width", "padding-top"])) : T("", !0),
994
+ B.value ? (f(), $("div", {
995
+ key: 3,
996
+ class: "d-layout-sidebar-mask",
997
+ style: F(N.value),
998
+ onClick: _
999
+ }, null, 4)) : T("", !0),
1000
+ X(Be, V(a.value, {
1001
+ "padding-top": M.value,
1002
+ "padding-bottom": Q.value,
1003
+ "padding-left": x.value,
1004
+ "overflow-hidden": t.addMainOverflowHidden
1005
+ }), {
1006
+ default: S(() => [
1007
+ y(v.$slots, "default")
1008
+ ]),
1009
+ _: 3
1010
+ }, 16, ["padding-top", "padding-bottom", "padding-left", "overflow-hidden"]),
1011
+ t.footerVisible ? (f(), h(_e, V({ key: 4 }, a.value, {
1012
+ fixed: t.fixedFooter,
1013
+ "z-index": Le,
1014
+ "min-width": t.minWidth,
1015
+ height: t.footerHeight,
1016
+ "padding-left": x.value,
1017
+ style: c.value
1018
+ }), {
1019
+ default: S(() => [
1020
+ y(v.$slots, "footer")
1021
+ ]),
1022
+ _: 3
1023
+ }, 16, ["fixed", "min-width", "height", "padding-left", "style"])) : T("", !0)
1024
+ ], 4));
130
1025
  }
131
1026
  };
132
1027
  export {
133
- w as DButton,
134
- z as DIcon,
135
- E as DTree,
136
- j as DTreeItem,
137
- s as DTreeStore
1028
+ Ce as DAccordion,
1029
+ de as DBadge,
1030
+ ke as DButton,
1031
+ le as DCollapse,
1032
+ P as DIcon,
1033
+ z as DIconStore,
1034
+ ze as DLayoutAdmin,
1035
+ Be as DLayoutContent,
1036
+ _e as DLayoutFooter,
1037
+ $e as DLayoutHeader,
1038
+ Se as DLayoutSidebar,
1039
+ Te as DLayoutTab,
1040
+ R as DTransferStore,
1041
+ xe as DTree,
1042
+ ye as DTreeItem,
1043
+ l as DTreeStore,
1044
+ H as emitter,
1045
+ ve as eventsBus
138
1046
  };
@@ -1 +1 @@
1
- (function(s,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(s=typeof globalThis<"u"?globalThis:s||self,e(s.DophJs={},s.Vue))})(this,function(s,e){"use strict";const h="",T="",g="",y="",m={__name:"BIcon",props:{component:Object,size:[Number,String],color:String},setup(n){const t=n,c=e.useSlots(),r=e.computed(()=>{const{color:l}=t;return l===void 0?null:l}),a=e.computed(()=>{const l=t.size??null;if(l!==void 0)return typeof l=="number"||/^\d+$/.test(l)?`${l}px`:l}),i=e.h("i",{class:"icon",style:{color:r.value,fontSize:a.value}},t.component?e.h(t.component):c);return(l,p)=>(e.openBlock(),e.createBlock(e.unref(i)))}},f={__name:"DButton",props:{class:String,icon:Object},setup(n){const t=n;let c=null;return t.icon&&(c=e.h(m,{component:t.icon,color:"inherit"})),(r,a)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.unref(c)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["button",t.class])},[e.renderSlot(r.$slots,"default")],2)),e.unref(c)?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["button button-ext",t.class])},[e.createVNode(e.unref(c)),e.createElementVNode("div",null,[e.renderSlot(r.$slots,"default")])],2)):e.createCommentVNode("",!0)],64))}},u={class:"tree-item"},S={key:0},d={__name:"DTreeItem",props:{model:Object,treeId:[String,Number]},setup(n){const t=n,c=e.computed(()=>t.model.children&&t.model.children.length),r=i=>{o.mutations.setTreeSelect(t.treeId,t.model.id)},a=e.computed(()=>o.actions.isTreeSelected(t.treeId,t.model.id)?"selected":"");return(i,l)=>{const p=e.resolveComponent("d-tree-item",!0);return e.openBlock(),e.createElementBlock("li",u,[e.createElementVNode("div",{class:e.normalizeClass(a.value),onClick:r,style:{display:"flex","flex-direction":"row","justify-content":"space-between","align-items":"center"}},[e.createElementVNode("div",null,e.toDisplayString(t.model.title),1)],2),c.value?(e.openBlock(),e.createElementBlock("ul",S,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.model.children,B=>(e.openBlock(),e.createBlock(p,{class:"tree-item",model:B,treeId:t.treeId},null,8,["model","treeId"]))),256))])):e.createCommentVNode("",!0)])}}},_={class:"tree"},k={__name:"DTree",props:{items:Array,noSelect:Boolean,multiSelect:Boolean},setup(n){const t=n,c=e.getCurrentInstance().uid;return o.actions.initTreeStore(c,t.noSelect,t.multiSelect),(r,a)=>(e.openBlock(),e.createElementBlock("ul",_,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.items,i=>(e.openBlock(),e.createBlock(d,{key:i.id,model:i,treeId:e.unref(c)},null,8,["model","treeId"]))),128))]))}},o={state:e.reactive({trees:{}}),getters:{getTreeSelect(n){return o.state.trees[n].selected}},mutations:{setTreeSelect(n,t){o.state.trees[n].noSelect||(o.state.trees[n].multiSelect?o.state.trees[n].selected.includes(t)?o.state.trees[n].selected=o.state.trees[n].selected.filter(function(c){return c!==t}):o.state.trees[n].selected=[...o.state.trees[n].selected,t]:o.state.trees[n].selected=[t])}},actions:{initTreeStore(n,t,c){o.state.trees[n]=[],o.state.trees[n].selected=[],o.state.trees[n].noSelect=t,o.state.trees[n].multiSelect=c},isTreeSelected(n,t){return o.state.trees[n].selected.includes(t)}}};s.DButton=f,s.DIcon=m,s.DTree=k,s.DTreeItem=d,s.DTreeStore=o,Object.defineProperty(s,Symbol.toStringTag,{value:"Module"})});
1
+ (function(p,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(p=typeof globalThis<"u"?globalThis:p||self,e(p.DophJs={},p.Vue))})(this,function(p,e){"use strict";const ae="",se="",le="",de="",w={__name:"DIcon",props:{component:[Object,String],size:[Number,String],color:String},setup(o){const t=o,n=e.useSlots(),i=e.computed(()=>{const{color:d}=t;return d===void 0?null:d}),r=e.computed(()=>{const d=t.size??null;if(d!==void 0)return typeof d=="number"||/^\d+$/.test(d)?`${d}px`:d}),s=e.h("i",{class:"icon",style:{color:i.value,fontSize:r.value}},t.component?e.h(t.component):n);return(d,m)=>(e.openBlock(),e.createBlock(e.unref(s)))}},Y={__name:"DButton",props:{class:String,icon:Object},setup(o){const t=o;let n=null;return t.icon&&(n=e.h(w,{component:t.icon,color:"inherit"})),(i,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.unref(n)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["button",t.class])},[e.renderSlot(i.$slots,"default")],2)),e.unref(n)?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["button button-ext",t.class])},[e.createVNode(e.unref(n)),e.createElementVNode("div",null,[e.renderSlot(i.$slots,"default")])],2)):e.createCommentVNode("",!0)],64))}},k={state:{},getters:{getIcon(o){return k.state[o]},getIcons(){return k.state}},mutations:{addIcon(o,t){k.state.name=t},addIcons(o){for(const t in o)o.hasOwnProperty(t)&&(k.state[t]=o[t])}}},z={__name:"DBadge",props:{class:String},setup(o){const t=o;return(n,i)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["badge",t.class])},[e.renderSlot(n.$slots,"default")],2))}},D="0px",E={__name:"DCollapse",props:{duration:{type:Number,default:200},easingEnter:{type:String,default:"ease-in-out"},easingLeave:{type:String,default:"ease-in-out"},opacityClosed:{type:Number,default:0},opacityOpened:{type:Number,default:1}},setup(o){const t=o,n=a=>({height:a.style.height,width:a.style.width,position:a.style.position,visibility:a.style.visibility,overflow:a.style.overflow,paddingTop:a.style.paddingTop,paddingBottom:a.style.paddingBottom,borderTopWidth:a.style.borderTopWidth,borderBottomWidth:a.style.borderBottomWidth,marginTop:a.style.marginTop,marginBottom:a.style.marginBottom}),i=(a,l)=>{const{width:f}=getComputedStyle(a);a.style.width=f,a.style.position="absolute",a.style.visibility="hidden",a.style.height="";let{height:u}=getComputedStyle(a);return a.style.width=l.width,a.style.position=l.position,a.style.visibility=l.visibility,a.style.height=D,a.style.overflow="hidden",l.height&&l.height!==D?l.height:u},r=(a,l,f,u,B)=>{const x=a.animate(u,B);a.style.height=l.height,x.onfinish=()=>{a.style.overflow=l.overflow,f()}},s=(a,l)=>[{height:D,opacity:t.opacityClosed,paddingTop:D,paddingBottom:D,borderTopWidth:D,borderBottomWidth:D,marginTop:D,marginBottom:D},{height:a,opacity:t.opacityOpened,paddingTop:l.paddingTop,paddingBottom:l.paddingBottom,borderTopWidth:l.borderTopWidth,borderBottomWidth:l.borderBottomWidth,marginTop:l.marginTop,marginBottom:l.marginBottom}],d=(a,l)=>{const f=a,u=n(f),B=i(f,u),x=s(B,u),$={duration:t.duration,easing:t.easingEnter};r(f,u,l,x,$)},m=(a,l)=>{const f=a,u=n(f),{height:B}=getComputedStyle(f);f.style.height=B,f.style.overflow="hidden";const x=s(B,u).reverse(),$={duration:t.duration,easing:t.easingLeave};r(f,u,l,x,$)};return(a,l)=>(e.openBlock(),e.createBlock(e.Transition,{css:!1,onEnter:d,onLeave:m},{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default")]),_:3}))}},I={data:void 0},L=o=>o.reduce((t,n)=>(t[n]=n)&&t,{}),h=L(["drag","dragend","dragenter","dragleave","dragstart","dragover","drop"]),Z=L(["copy","move","link","none"]),j=L(["none","copy","copyLink","copyMove","link","linkMove","move","all","uninitialized"]),X={__name:"DDrag",props:{draggable:{type:Boolean,default:!0},transferData:{},dropEffect:{validator:o=>o in Z},effectAllowed:{validator:o=>o in j},image:String,imageXOffset:{type:Number,default:0},imageYOffset:{type:Number,default:0},hideImageHtml:{type:Boolean,default:!1},tag:{type:String,default:"div"}},setup(o){const t=o,n=e.useSlots(),i=e.ref(!1),r=e.computed(()=>i&&t.transferData),s=e.computed(()=>({position:"fixed",top:"-1000px"})),d=(m,a)=>{const l=a.dataTransfer;if([h.dragenter,h.dragover].includes(m)&&t.dropEffect&&(l.dropEffect=t.dropEffect),m===h.dragstart){if(t.effectAllowed&&(l.effectAllowed=t.effectAllowed),t.image||n.image){let f;t.image?(f=new Image,f.src=t.image):n.image&&(f=n.image[0].elm),l.setDragImage&&l.setDragImage(f,t.imageXOffset,t.imageYOffset)}t.transferData!==void 0&&(I.data=t.transferData,a.dataTransfer.setData("text","")),i.value=!0}};return(m,a)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.tag),{draggable:t.draggable,onDrag:a[0]||(a[0]=l=>d(e.unref(h).drag,l)),onDragstart:a[1]||(a[1]=e.withModifiers(l=>d(e.unref(h).dragstart,l),["stop"])),onDragenter:a[2]||(a[2]=l=>d(e.unref(h).dragenter,l)),onDragleave:a[3]||(a[3]=l=>d(e.unref(h).dragleave,l)),onDragend:a[4]||(a[4]=l=>d(e.unref(h).dragend,l))},{default:e.withCtx(()=>[e.renderSlot(m.$slots,"default",{transferData:r.value}),o.hideImageHtml?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(s.value)},[e.renderSlot(m.$slots,"image",{transferData:r.value})],4)):e.renderSlot(m.$slots,"image",{key:1,transferData:r.value})]),_:3},40,["draggable"]))}},ce="",W=(o,t)=>{const n=o.__vccOpts||o;for(const[i,r]of t)n[i]=r;return n},q={class:"item-title"},J={style:{display:"flex","flex-direction":"row","justify-content":"flex-end"}},K={key:0,class:"sub-menu"},V=W({__name:"DTreeItem",props:{model:Object,treeId:[String,Number]},setup(o){const t=o,n=e.ref(null),i=e.ref(!1),r=e.ref(!1),s=e.ref(!1),d=e.computed(()=>t.model.children&&t.model.children.length),m=e.computed(()=>c.actions.isItemExpanded(t.treeId,t.model.id)),a=()=>{c.mutations.setItemSelect(t.treeId,t.model),c.actions.toggleItem(t.treeId,t.model.id)},l=e.computed(()=>(c.actions.isItemSelected(t.treeId,t.model.id)?"selected":"")+(i.value?"node-over ":"")+(r.value?"node-top ":"")+(s.value?"node-bottom ":"")),f=e.computed(()=>t.model.draggable===!0);e.computed(()=>Object.hasOwn(t.model,"droppable")?t.model.droppable:!0);const u=$=>{let y=I.data;if(y.model.id===t.model.id||c.actions.isChildOfParent(t.treeId,t.model.id,y.model.id)||c.actions.isParentOfChild(t.treeId,y.model.id,t.model.id))return i.value=!1,r.value=!1,s.value=!1,!1;if(!c.state.trees[t.treeId].transfer&&y.id!==t.treeId)return!1;let b="";r.value?b="before":s.value?b="after":b="inside",c.actions.moveTreeNode(y.id,t.treeId,c.getters.getItems(t.treeId),y.model.id,t.model.id,b),i.value=!1,r.value=!1,s.value=!1},B=$=>{let y=I.data;if(y.model.id===t.model.id||c.actions.isChildOfParent(t.treeId,t.model.id,y.model.id)||c.actions.isParentOfChild(t.treeId,y.model.id,t.model.id))return!1;const b=$.y,T=n.value.getBoundingClientRect().top,N=n.value.getBoundingClientRect().height,_=N/3;b>T&&b<=T+_?(i.value=!1,r.value=!0,s.value=!1):b<T+N&&b>=T+N-_?(i.value=!1,r.value=!1,s.value=!0):(i.value=!0,r.value=!1,s.value=!1)},x=()=>{i.value=!1,r.value=!1,s.value=!1};return($,y)=>{const b=e.resolveComponent("d-tree-item",!0);return e.openBlock(),e.createBlock(X,{tag:"li",class:"tree-item","transfer-data":{id:t.treeId,model:t.model},draggable:f.value,onDrop:e.withModifiers(u,["stop"]),onDragenter:y[0]||(y[0]=e.withModifiers(()=>{},["prevent"])),onDragover:e.withModifiers(B,["prevent","stop"]),onDragleave:e.withModifiers(x,["prevent"])},{default:e.withCtx(()=>{var T,N;return[e.createElementVNode("div",{ref_key:"node",ref:n,class:e.normalizeClass(l.value),onClick:a},[e.createElementVNode("div",null,[t.model.icons&&t.model.icons.pre&&d.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(w),{key:0,component:e.unref(k).getters.getIcon(t.model.icons.pre.component),size:18,color:t.model.icons.pre.color?t.model.icons.pre.color:"inherit",class:e.normalizeClass(m.value?"tree-open-pre":"")},null,8,["component","color","class"])):e.createCommentVNode("",!0),t.model.icons&&t.model.icons.pre&&!d.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(w),{key:1,component:e.unref(k).getters.getIcon(t.model.icons.pre.component),size:18,color:"rgba(0,0,0,0)",class:e.normalizeClass(m.value?"tree-open-pre":"")},null,8,["component","class"])):e.createCommentVNode("",!0),t.model.icons&&t.model.icons.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(w),{key:2,component:e.unref(k).getters.getIcon(t.model.icons.icon.component),color:t.model.icons.icon.color?t.model.icons.icon.color:"inherit"},null,8,["component","color"])):e.createCommentVNode("",!0),e.createElementVNode("div",q,[e.createElementVNode("div",null,e.toDisplayString(t.model.title),1)])]),e.createElementVNode("div",J,[((T=t.model.badge)==null?void 0:T.value)!==void 0?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(z),{key:0,class:e.normalizeClass([(N=t.model.badge)==null?void 0:N.class,"badge-sm"])},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.model.badge.value),1)]),_:1},8,["class"])):e.createCommentVNode("",!0),t.model.icons&&t.model.icons.post&&d.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(w),{key:1,component:e.unref(k).getters.getIcon(t.model.icons.post.component),size:20,color:t.model.icons.post.color?t.model.icons.post.color:"inherit",class:e.normalizeClass(m.value?"tree-open-post":"")},null,8,["component","color","class"])):e.createCommentVNode("",!0)])],2),e.createVNode(E,null,{default:e.withCtx(()=>[d.value&&m.value?(e.openBlock(),e.createElementBlock("ul",K,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.model.children,_=>(e.openBlock(),e.createBlock(b,{class:"tree-item",key:_.id,model:_,treeId:t.treeId},null,8,["model","treeId"]))),128))])):e.createCommentVNode("",!0)]),_:1})]}),_:1},8,["transfer-data","draggable","onDrop","onDragover","onDragleave"])}}},[["__scopeId","data-v-f03192c5"]]);function M(o){return o=o||new Map,{all:o,on(t,n){const i=o.get(t);i?i.push(n):o.set(t,[n])},off(t,n){const i=o.get(t);i&&(n?i.splice(i.indexOf(n)>>>0,1):o.set(t,[]))},emit(t,n){let i=o.get(t);i&&i.slice().map(r=>{r(n)}),i=o.get("*"),i&&i.slice().map(r=>{r(t,n)})}}}const S=M(),c={state:e.reactive({trees:{}}),getters:{getItems(o){return c.state.trees[o].items},getItemsSelect(o){return c.state.trees[o].selected},getParentId(o,t,n,i="id",r="children",s={}){return n&&o&&(o.find(d=>d[i]===n?(s.found=t,d):c.getters.getParentId(d[r],d.id,n,i,r,s)),s.found)?s.found:!1}},mutations:{setTreeItems(o,t){c.state.trees[o].items=t},setItemSelect(o,t){S.emit(`select-${o}`,{id:o,model:t}),!c.state.trees[o].noSelect&&(c.state.trees[o].multiSelect?c.state.trees[o].selected.includes(t.id)?c.state.trees[o].selected=c.state.trees[o].selected.filter(function(n){return n!==t.id}):c.state.trees[o].selected=[...c.state.trees[o].selected,t.id]:c.state.trees[o].selected=[t.id])}},actions:{initTreeStore(o,t,n,i,r,s){c.state.trees[o]=[],c.state.trees[o].selected=[],c.state.trees[o].items=structuredClone(t),c.state.trees[o].noSelect=n,c.state.trees[o].multiSelect=i,c.state.trees[o].expanded=r,c.state.trees[o].transfer=s},isItemSelected(o,t){return c.state.trees[o].selected.includes(t)},toggleItem(o,t){const n=c.actions.deepSearch(c.state.trees[o].items,t);n.expanded=n.expanded===void 0||!n.expanded,n.children&&n.children.length&&(n.expanded?S.emit(`expand-${o}`,{id:o,model:n}):S.emit(`collapse-${o}`,{id:o,model:n}))},isItemExpanded(o,t){const n=c.actions.deepSearch(c.state.trees[o].items,t);return c.state.trees[o].expanded&&(n.expanded=n.expanded===void 0?!0:n.expanded),n.expanded},isChildOfParent(o,t,n){const i=c.actions.deepSearch(c.state.trees[o].items,t);if(i&&i.children){for(let r=0;r<i.children.length;r++)if(i.children[r].id===n)return!0}return!1},isParentOfChild(o,t,n){const i=c.actions.deepSearch(c.state.trees[o].items,t);return!!(i&&i.children&&c.actions.deepSearch(i.children,n))},deepSearch(o,t,n="id",i="children",r={}){return t&&o&&(o.find(s=>s[n]===t?(r.found=s,s):c.actions.deepSearch(s[i],t,n,i,r)),r.found)?r.found:!1},moveTreeNode(o,t,n,i,r,s){const d=c.actions.deleteTreeNode(n,i);c.actions.insertTreeNode(n,r,d,s),S.emit(`move-${t}`,{fromTreeId:o,toTreeId:t,moved:d.id,target:r,position:s})},insertTreeNode(o,t,n,i){if(o)for(let r=0;r<o.length;r++){if(o[r].id===t){let d=r;return i==="after"?(d++,o.splice(d,0,n)):i==="before"?o.splice(d,0,n):i==="inside"&&(Object.hasOwn(o[r],"children")||(o[r].children=[],o[r].opened=!0),o[r].children.splice(0,0,n)),o[r]}const s=this.insertTreeNode(o[r].children,t,n,i);if(s)return s}},deleteTreeNode(o,t){if(o)for(let n=0;n<o.length;n++){if(o[n].id===t){const r=o[n];return o.splice(n,1),r}const i=c.actions.deleteTreeNode(o[n].children,t);if(i)return i}}}},U={__name:"DDrop",props:{tag:{type:String,default:"div"}},emits:Object.keys(h),setup(o,{emit:t}){let n=e.reactive({});const i=e.ref("false"),r=e.ref(null),s=new Set,d=e.computed(()=>i.value&&n),m=(a,l)=>{n=I.data,t(a,l,n),a===h.dragenter&&(s.size||l.target===r.value)&&s.add(l.target),a===h.dragleave&&s.delete(l.target),a===h.drop&&s.clear(),i.value=!!s.size};return(a,l)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.tag),{ref_key:"el",ref:r,onDragenter:l[0]||(l[0]=f=>m(e.unref(h).dragenter,f)),onDragleave:l[1]||(l[1]=f=>m(e.unref(h).dragleave,f)),onDragover:l[2]||(l[2]=e.withModifiers(f=>m(e.unref(h).dragover,f),["prevent"])),onDrop:l[3]||(l[3]=e.withModifiers(f=>m(e.unref(h).drop,f),["prevent"]))},{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default",{transferData:d.value})]),_:3},544))}},H={__name:"DTree",props:{items:Array,noSelect:Boolean,multiSelect:Boolean,expanded:Boolean,transfer:Boolean},emits:["select","collapse","expand","move"],setup(o,{emit:t}){const n=o,i=e.getCurrentInstance().uid;c.actions.initTreeStore(i,n.items,n.noSelect,n.multiSelect,n.expanded,n.transfer);const r=(s,d)=>{console.log(s,d)};return S.on(`select-${i}`,s=>{t("select",s)}),S.on(`expand-${i}`,s=>{t("expand",s)}),S.on(`collapse-${i}`,s=>{t("collapse",s)}),S.on(`move-${i}`,s=>{t("move",s)}),(s,d)=>(e.openBlock(),e.createBlock(U,{class:"tree",tag:"ul",onDrop:e.withModifiers(r,["stop"])},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(c).getters.getItems(e.unref(i)),m=>(e.openBlock(),e.createBlock(V,{key:m.id,model:m,treeId:e.unref(i)},null,8,["model","treeId"]))),128))]),_:1},8,["onDrop"]))}},me="",G=W({__name:"DAccordion",props:{items:Array},setup(o){const t=o;return(n,i)=>(e.openBlock(),e.createBlock(H,{class:"accordion",items:t.items,"no-select":!0},null,8,["items"]))}},[["__scopeId","data-v-4c920528"]]),F={__name:"DLayoutHeader",props:{fixed:{type:Boolean,default:!0},zIndex:{type:Number,default:1001},minWidth:{type:Number,default:1280},height:{type:Number,default:56},paddingLeft:{type:Number,default:0},transitionDuration:{type:Number,default:300},transitionTimingFunction:{type:String,default:"ease-in-out"},useMinWidthLayout:Boolean},setup(o){const t=o,n=e.computed(()=>{const{fixed:i,zIndex:r,minWidth:s,height:d,paddingLeft:m,transitionDuration:a,transitionTimingFunction:l}=t,f=i?"fixed":"static",u=t.useMinWidthLayout?`min-width:${s}px;`:"";return`position:${f};z-index:${r};${u}height:${d}px;padding-left:${m}px;transition-duration:${a}ms;transition-timing-function:${l};`});return(i,r)=>(e.openBlock(),e.createElementBlock("header",{class:"d-layout-header",style:e.normalizeStyle(n.value)},[e.renderSlot(i.$slots,"default")],4))}},O={__name:"DLayoutTab",props:{fixed:{type:Boolean,default:!0},top:{type:Number,default:56},zIndex:{type:Number,default:999},minWidth:{type:Number,default:1280},height:{type:Number,default:56},paddingLeft:{type:Number,default:0},transitionDuration:{type:Number,default:300},transitionTimingFunction:{type:String,default:"ease-in-out"},useMinWidthLayout:Boolean},setup(o){const t=o,n=e.computed(()=>{const{fixed:i,top:r,zIndex:s,minWidth:d,height:m,paddingLeft:a,transitionDuration:l,transitionTimingFunction:f}=t,u=i?"fixed":"static",B=t.useMinWidthLayout?`min-width: ${d}px;`:"";return`position:${u};top:${r}px;z-index:${s};${B}height:${m}px;padding-left:${a}px;transition-duration:${l}ms;transition-timing-function:${f};`});return(i,r)=>(e.openBlock(),e.createElementBlock("div",{class:"d-layout-tab",style:e.normalizeStyle(n.value)},[e.renderSlot(i.$slots,"default")],4))}},P={__name:"DLayoutFooter",props:{fixed:{type:Boolean,default:!0},zIndex:{type:Number,default:999},minWidth:{type:Number,default:1280},height:{type:Number,default:56},paddingLeft:{type:Number,default:0},transitionDuration:{type:Number,default:300},transitionTimingFunction:{type:String,default:"ease-in-out"},useMinWidthLayout:Boolean},setup(o){const t=o,n=e.computed(()=>{const{fixed:i,zIndex:r,minWidth:s,height:d,paddingLeft:m,transitionDuration:a,transitionTimingFunction:l}=t,f=i?"fixed":"static",u=t.useMinWidthLayout?`min-width:${s}px;`:"";return`position:${f};z-index:${r};${u}height:${d}px;padding-left:${m}px;transition-duration:${a}ms;transition-timing-function:${l};`});return(i,r)=>(e.openBlock(),e.createElementBlock("footer",{class:"d-layout-footer",style:e.normalizeStyle(n.value)},[e.renderSlot(i.$slots,"default")],4))}},A={__name:"DLayoutSidebar",props:{zIndex:{type:Number,default:1002},width:{type:Number,default:200},paddingTop:{type:Number,default:0},transitionDuration:{type:Number,default:300},transitionTimingFunction:{type:String,default:"ease-in-out"},collapse:{type:Boolean,default:!1}},setup(o){const t=o,n=e.computed(()=>{const{zIndex:i,width:r,paddingTop:s,transitionDuration:d,transitionTimingFunction:m}=t;return`z-index:${i};width:${r}px;padding-top:${s}px;transition-duration:${d}ms;transition-timing-function:${m};`});return(i,r)=>(e.openBlock(),e.createElementBlock("aside",{class:"d-layout-sidebar",style:e.normalizeStyle(n.value)},[e.renderSlot(i.$slots,"default")],4))}},R={__name:"DLayoutContent",props:{paddingTop:{type:Number,default:0},paddingBottom:{type:Number,default:0},paddingLeft:{type:Number,default:0},overflowHidden:Boolean,transitionDuration:{type:Number,default:300},transitionTimingFunction:{type:String,default:"ease-in-out"}},setup(o){const t=o,n=e.computed(()=>{const{paddingTop:i,paddingBottom:r,paddingLeft:s,transitionDuration:d,transitionTimingFunction:m}=t,a=`overflow:${t.overflowHidden?"hidden":"visible"};`;return`padding-top:${i}px;padding-bottom:${r}px;padding-left:${s}px;${a}transition-duration:${d}ms;transition-timing-function:${m};`});return(i,r)=>(e.openBlock(),e.createElementBlock("main",{style:e.normalizeStyle(n.value),class:"d-layout-content"},[e.renderSlot(i.$slots,"default")],4))}};function Q(o){const t=e.ref(0),n=e.computed(()=>`transform: translateX(${-t.value}px);`);let i=!1;function r(f){t.value=f}function s(){var f;const u=((f=document.scrollingElement)===null||f===void 0?void 0:f.scrollLeft)||0;r(u)}function d(){s()}function m(){document.addEventListener("scroll",s)}function a(){i&&document.removeEventListener("scroll",s)}function l(){d(),m(),i=!0}return e.watch(o,f=>{f?l():a()},{immediate:!0}),e.onUnmounted(()=>{a()}),n}const v=1001,ee=999,te=998,oe={__name:"DLayoutAdmin",props:{mode:{type:String,default:"vertical"},isMobile:{type:Boolean,default:!1},useMinWidthLayout:{type:Boolean,default:!1},minWidth:{type:Number,default:1200},headerVisible:{type:Boolean,default:!0},headerHeight:{type:Number,default:56},tabVisible:{type:Boolean,default:!0},tabHeight:{type:Number,default:44},fixedHeaderAndTab:{type:Boolean,default:!0},addMainOverflowHidden:{type:Boolean,default:!1},footerVisible:{type:Boolean,default:!0},footerHeight:{type:Number,default:48},fixedFooter:{type:Boolean,default:!0},sidebarVisible:{type:Boolean,default:!0},sidebarWidth:{type:Number,default:200},sidebarCollapsedWidth:{type:Number,default:0},sidebarCollapse:{type:Boolean,default:!1},transitionDuration:{type:Number,default:300},transitionTimingFunction:{type:String,default:"ease-in-out"},collapse:{type:Boolean,default:!1},maskBg:{type:String,default:"rgba(0,0,0,0.3)"}},emits:["update:sidebar-collapse"],setup(o,{emit:t}){const n=o,i=e.computed(()=>n.useMinWidthLayout?`min-width:${n.minWidth}px;`:""),r=e.computed(()=>n.useMinWidthLayout&&(n.fixedHeaderAndTab||n.fixedFooter)),s=Q(r),d=e.computed(()=>n.fixedHeaderAndTab?s.value:""),m=e.computed(()=>n.fixedFooter?s.value:""),a=e.computed(()=>{const{transitionDuration:g,transitionTimingFunction:C}=n;return{transitionDuration:g,transitionTimingFunction:C}}),l=e.computed(()=>n.mode==="vertical"),f=e.computed(()=>n.isMobile||l.value?1003:1e3),u=e.computed({get(){return n.sidebarCollapse},set(g){t("update:sidebar-collapse",g)}});function B(){u.value=!0}const x=e.computed(()=>n.isMobile&&!u.value),$=e.computed(()=>{const{transitionDuration:g,transitionTimingFunction:C}=n;return`background-color:${n.maskBg};transition-duration:${g}ms;transition-timing-function:${C};`}),y=e.computed(()=>{const{sidebarWidth:g,sidebarCollapsedWidth:C}=n,ie=n.isMobile?0:C,re=u.value?ie:g;return n.sidebarVisible?re:0}),b=e.computed(()=>n.isMobile?0:y.value),T=e.computed(()=>l.value?b.value:0),N=e.computed(()=>!n.isMobile&&!l.value&&n.headerVisible?n.headerHeight:0),_=e.computed(()=>{let g=0;return n.fixedHeaderAndTab&&(n.headerVisible&&(g+=n.headerHeight),n.tabVisible&&(g+=n.tabHeight)),g}),ne=e.computed(()=>n.fixedFooter&&n.footerVisible?n.footerHeight:0);return(g,C)=>(e.openBlock(),e.createElementBlock("div",{class:"d-layout",style:e.normalizeStyle(i.value)},[o.headerVisible?(e.openBlock(),e.createBlock(F,e.mergeProps({key:0},a.value,{fixed:o.fixedHeaderAndTab,"z-index":v,"min-width":o.minWidth,height:o.headerHeight,"padding-left":T.value,style:d.value}),{default:e.withCtx(()=>[e.renderSlot(g.$slots,"header")]),_:3},16,["fixed","min-width","height","padding-left","style"])):e.createCommentVNode("",!0),o.tabVisible?(e.openBlock(),e.createBlock(O,e.mergeProps({key:1},a.value,{fixed:o.fixedHeaderAndTab,"z-index":ee,"min-width":o.minWidth,top:o.headerHeight,height:o.tabHeight,"padding-left":b.value,style:d.value}),{default:e.withCtx(()=>[e.renderSlot(g.$slots,"tab")]),_:3},16,["fixed","min-width","top","height","padding-left","style"])):e.createCommentVNode("",!0),o.sidebarVisible?(e.openBlock(),e.createBlock(A,e.mergeProps({key:2},a.value,{"z-index":f.value,width:y.value,"padding-top":N.value}),{default:e.withCtx(()=>[e.renderSlot(g.$slots,"sidebar")]),_:3},16,["z-index","width","padding-top"])):e.createCommentVNode("",!0),x.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"d-layout-sidebar-mask",style:e.normalizeStyle($.value),onClick:B},null,4)):e.createCommentVNode("",!0),e.createVNode(R,e.mergeProps(a.value,{"padding-top":_.value,"padding-bottom":ne.value,"padding-left":b.value,"overflow-hidden":o.addMainOverflowHidden}),{default:e.withCtx(()=>[e.renderSlot(g.$slots,"default")]),_:3},16,["padding-top","padding-bottom","padding-left","overflow-hidden"]),o.footerVisible?(e.openBlock(),e.createBlock(P,e.mergeProps({key:4},a.value,{fixed:o.fixedFooter,"z-index":te,"min-width":o.minWidth,height:o.footerHeight,"padding-left":b.value,style:m.value}),{default:e.withCtx(()=>[e.renderSlot(g.$slots,"footer")]),_:3},16,["fixed","min-width","height","padding-left","style"])):e.createCommentVNode("",!0)],4))}};p.DAccordion=G,p.DBadge=z,p.DButton=Y,p.DCollapse=E,p.DIcon=w,p.DIconStore=k,p.DLayoutAdmin=oe,p.DLayoutContent=R,p.DLayoutFooter=P,p.DLayoutHeader=F,p.DLayoutSidebar=A,p.DLayoutTab=O,p.DTransferStore=I,p.DTree=H,p.DTreeItem=V,p.DTreeStore=c,p.emitter=S,p.eventsBus=M,Object.defineProperty(p,Symbol.toStringTag,{value:"Module"})});
package/dist/style.css CHANGED
@@ -1 +1 @@
1
- @charset "UTF-8";.button{-webkit-user-select:none;user-select:none;cursor:pointer;display:inline-block;padding:.4rem .8rem;border-radius:5px;transition:all .2s;font-weight:400;margin:.25rem .125rem}.button.button-sm{font-size:.8em}.button.button-lg{font-size:1.3em}.button.button-ext{display:inline-flex;flex-direction:row;justify-content:center;align-items:center;height:100%;gap:5px}.button.button-ext .icon{display:inline-flex!important;flex-direction:row;justify-content:center;align-items:center}.label{margin-bottom:5px;font-size:.9em;opacity:.7}.d-input,.d-select,.d-checkbox{margin-bottom:15px}.d-input input,select{font-size:1.1em;border-style:solid;border-width:1px;border-radius:5px;padding:5px 10px}.d-checkbox input[type=checkbox]{position:absolute;z-index:-1;opacity:0}.d-checkbox input[type=checkbox]+label{display:inline-flex;align-items:center;-webkit-user-select:none;user-select:none}.d-checkbox input[type=checkbox]+label:before{content:"";display:inline-block;width:1em;height:1em;flex-shrink:0;flex-grow:0;border-radius:.25em;margin-right:.5em;background-repeat:no-repeat;background-position:center center;background-size:50% 50%;transition:all .2s}.d-checkbox input[type=checkbox]:checked+label:before{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23fff' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26 2.974 7.25 8 2.193z'/%3e%3c/svg%3e");background-size:10px}.icon{line-height:1em;text-align:center;display:inline-block;position:relative;fill:currentColor;transform:translateZ(0)}.icon svg{width:1em;height:1em}.accordion{-webkit-user-select:none;user-select:none}.accordion .accordion-item,.accordion .accordion-sub{cursor:pointer;padding:.25rem .125rem}.tree{padding-left:0;-webkit-user-select:none;user-select:none;list-style:none}.tree .tree-item{cursor:pointer;line-height:1.5}.tree .tree-item>div{padding:3px 5px}.tree .tree-item>div.selected{transition:all 50ms;border-radius:5px}.tree .tree-item ul{padding-left:20px;list-style:none}.button{background-color:#ccc9;color:gray}.button:hover{color:#666;background-color:#cccc}.button.button-blue{background-color:#51c0e799;color:#43565c}.button.button-blue:hover{color:#2d3a3f;background-color:#51c0e7cc}.button.button-green{background-color:#90d76099;color:#4f4f4f}.button.button-green:hover{color:#363636;background-color:#90d760cc}.button.button-red{background-color:#ff929299;color:#ae4a4a}.button.button-red:hover{background-color:#ff9292cc;color:#8a3b3b}.button.button-orange{background-color:#ffc45899;color:#856a39}.button.button-orange:hover{background-color:#ffc458cc;color:#614e2a}.button.button-violet{background-color:#c2a7ff99;color:#7456b7}.button.button-violet:hover{background-color:#c2a7ffcc;color:#5c4199}.button.button-outline{outline:solid 1px rgba(204,204,204,.6);color:gray;background-color:transparent}.button.button-outline:hover{color:gray;background-color:#cccc}.button.button-outline-blue{outline:solid 1px rgba(81,192,231,.6);background-color:transparent;color:#136c8c99}.button.button-outline-blue:hover{color:#43565c;background-color:#51c0e7cc}.button.button-outline-green{outline:solid 1px rgba(144,215,96,.6);background-color:transparent;color:#467e2099}.button.button-outline-green:hover{color:#4f4f4f;background-color:#90d760cc}.button.button-outline-red{outline:solid 1px rgba(255,146,146,.6);background-color:transparent;color:#f8000099}.button.button-outline-red:hover{color:#ae4a4a;background-color:#ff9292cc}.button.button-outline-orange{outline:solid 1px rgba(255,196,88,.6);background-color:transparent;color:#be7b0099}.button.button-outline-orange:hover{color:#856a39;background-color:#ffc458cc}.button.button-outline-violet{outline:solid 1px rgba(194,167,255,.6);background-color:transparent;color:#580eff99}.button.button-outline-violet:hover{color:#7456b7;background-color:#c2a7ffcc}.dark .button{background-color:#ffffff1a;color:#e5e5e5}.dark .button:hover{color:#fff;background-color:#fff3}.dark .button.button-blue{background-color:#1685ac}.dark .button.button-blue:hover{background-color:#1685accc}.dark .button.button-green{background-color:#5d9d31}.dark .button.button-green:hover{background-color:#5d9d31cc}.dark .button.button-red{background-color:#c33737}.dark .button.button-red:hover{background-color:#c33737cc}.dark .button.button-orange{background-color:#d59622}.dark .button.button-orange:hover{background-color:#d59622cc}.dark .button.button-violet{background-color:#7750d2}.dark .button.button-violet:hover{background-color:#7750d2cc}.dark .button.button-outline{outline:solid 1px #555555;color:#a2a2a2;background-color:transparent}.dark .button.button-outline:hover{color:#fff;background-color:#555}.dark .button.button-outline-blue{outline:solid 1px #1685ac;background-color:transparent;color:#1ca8d9}.dark .button.button-outline-blue:hover{color:#fff;background-color:#1685ac}.dark .button.button-outline-green{outline:solid 1px #5d9d31;background-color:transparent;color:#74c33e}.dark .button.button-outline-green:hover{color:#fff;background-color:#5d9d31}.dark .button.button-outline-red{outline:solid 1px #c33737;background-color:transparent;color:#d15c5c}.dark .button.button-outline-red:hover{color:#fff;background-color:#c33737}.dark .button.button-outline-orange{outline:solid 1px #d59622;background-color:transparent;color:#e2ac48}.dark .button.button-outline-orange:hover{color:#fff;background-color:#d59622}.dark .button.button-outline-violet{outline:solid 1px #7750d2;background-color:transparent;color:#9779dc}.dark .button.button-outline-violet:hover{color:#fff;background-color:#7750d2}.tree .tree-item>div.selected{background-color:#0000001a}.tree .tree-item>div:hover{background-color:#0000001a}.dark .tree .tree-item>div.selected{background-color:#ffffff1a}.dark .tree .tree-item>div:hover{background-color:#ffffff1a}body{background-color:#fff;color:#333}.dark{background-color:#34383e;color:#ccc}.d-input input,.d-select select{color:#ccc;background-color:#262626;border-color:#fff3}.d-input input:focus,.d-select select:focus{outline:none!important;border-color:#fff6}.d-checkbox input[type=checkbox]+label:before{border:1px solid rgba(255,255,255,.2)}.d-checkbox input[type=checkbox]:checked+label:before{border-color:#666;background-color:#666}.d-checkbox input[type=checkbox]:not(:disabled):not(:checked)+label:hover:before{border-color:#fff6}.d-checkbox input[type=checkbox]:not(:disabled):active+label:before{background-color:#b3d7ff;border-color:#fff6}.d-checkbox input[type=checkbox]:focus:not(:checked)+label:before{border-color:#fff6}.d-checkbox input[type=checkbox]:disabled+label:before{background-color:#e9ecef}.icon{color:#333}.dark .icon{color:#ccc}body{font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Noto Sans,Liberation Sans,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-weight:400;font-style:normal;font-size:.95rem}
1
+ @charset "UTF-8";.button{-webkit-user-select:none;user-select:none;cursor:pointer;display:inline-block;padding:.4rem .8rem;border-radius:5px;transition:all .2s;font-weight:400;margin:.25rem .125rem}.button.button-sm{font-size:.8em}.button.button-lg{font-size:1.3em}.button.button-ext{display:inline-flex;flex-direction:row;justify-content:center;align-items:center;height:100%;gap:5px}.button.button-ext .icon{display:inline-flex!important;flex-direction:row;justify-content:center;align-items:center}.label{margin-bottom:5px;font-size:.9em;opacity:.7}.d-input,.d-select,.d-checkbox{margin-bottom:15px}.d-input input,select{font-size:1.1em;border-style:solid;border-width:1px;border-radius:5px;padding:5px 10px}.d-checkbox input[type=checkbox]{position:absolute;z-index:-1;opacity:0}.d-checkbox input[type=checkbox]+label{display:inline-flex;align-items:center;-webkit-user-select:none;user-select:none}.d-checkbox input[type=checkbox]+label:before{content:"";display:inline-block;width:1em;height:1em;flex-shrink:0;flex-grow:0;border-radius:.25em;margin-right:.5em;background-repeat:no-repeat;background-position:center center;background-size:50% 50%;transition:all .2s}.d-checkbox input[type=checkbox]:checked+label:before{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23fff' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26 2.974 7.25 8 2.193z'/%3e%3c/svg%3e");background-size:10px}.icon{line-height:1em;text-align:center;display:inline-block;position:relative;fill:currentColor;transform:translateZ(0)}.icon svg{width:1em;height:1em}.accordion{-webkit-user-select:none;user-select:none}.accordion .accordion-item,.accordion .accordion-sub{cursor:pointer;padding:.25rem .125rem}.badge{display:inline-block;padding:3px 4px;margin:.25rem .125rem;border-radius:5px;line-height:1}.badge.badge-sm{font-size:.8em;padding:2px 3px}.tree{padding-left:0;-webkit-user-select:none;user-select:none;list-style:none}.tree.accordion .tree-item ul{padding-left:0}.tree .tree-item{cursor:pointer;line-height:1.5;overflow:hidden;position:relative}.tree .tree-item>div{padding:3px 5px;display:flex;flex-direction:row;justify-content:space-between;align-items:center;border-radius:5px}.tree .tree-item>div.selected{transition:all 50ms}.tree .tree-item>div>div{display:flex;flex-direction:row;justify-content:start;align-items:center;gap:2px}.tree .tree-item>div .icon{display:inline-flex!important;flex-direction:row;justify-content:center;align-items:center;transition:all .2s}.tree .tree-item>div .tree-open-post{transform:rotate(-90deg)}.tree .tree-item>div .tree-open-pre{transform:rotate(90deg)}.tree .tree-item ul{padding-left:20px;list-style:none}.tree .item-title{display:table;table-layout:fixed;width:100%}.tree .item-title>div{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.tree.tree-compact{font-size:.9em}.tree.tree-compact .tree-item{line-height:1}.tree.tree-compact .tree-item>div{padding:1px 3px}.d-layout{display:flex;flex-direction:column;width:100%;height:100%}.d-layout .d-layout-header{left:0;top:0;flex-shrink:0;box-sizing:border-box;width:100%;transition-property:padding-left}.d-layout .d-layout-content{flex-grow:1;box-sizing:border-box;width:100%;transition-property:padding-left}.d-layout .d-layout-footer{left:0;bottom:0;flex-shrink:0;box-sizing:border-box;width:100%;transition-property:padding-left}.d-layout .d-layout-sidebar{position:fixed;left:0;top:0;box-sizing:border-box;width:100%;height:100%;transition-property:all;overflow-y:hidden}.d-layout .d-layout-sidebar-mask{position:fixed;left:0;top:0;z-index:1002;width:100%;height:100%;transition-property:background-color}.d-layout .d-layout-tab{left:0;flex-shrink:0;box-sizing:border-box;width:100%;transition-property:padding-left}.button{background-color:#ccc9;color:gray}.button:hover{color:#666;background-color:#cccc}.button.button-blue{background-color:#51c0e799;color:#43565c}.button.button-blue:hover{color:#2d3a3f;background-color:#51c0e7cc}.button.button-green{background-color:#90d76099;color:#4f4f4f}.button.button-green:hover{color:#363636;background-color:#90d760cc}.button.button-red{background-color:#ff929299;color:#ae4a4a}.button.button-red:hover{background-color:#ff9292cc;color:#8a3b3b}.button.button-orange{background-color:#ffc45899;color:#856a39}.button.button-orange:hover{background-color:#ffc458cc;color:#614e2a}.button.button-violet{background-color:#c2a7ff99;color:#7456b7}.button.button-violet:hover{background-color:#c2a7ffcc;color:#5c4199}.button.button-outline{outline:solid 1px rgba(204,204,204,.6);color:gray;background-color:transparent}.button.button-outline:hover{color:gray;background-color:#cccc}.button.button-outline-blue{outline:solid 1px rgba(81,192,231,.6);background-color:transparent;color:#136c8c99}.button.button-outline-blue:hover{color:#43565c;background-color:#51c0e7cc}.button.button-outline-green{outline:solid 1px rgba(144,215,96,.6);background-color:transparent;color:#467e2099}.button.button-outline-green:hover{color:#4f4f4f;background-color:#90d760cc}.button.button-outline-red{outline:solid 1px rgba(255,146,146,.6);background-color:transparent;color:#f8000099}.button.button-outline-red:hover{color:#ae4a4a;background-color:#ff9292cc}.button.button-outline-orange{outline:solid 1px rgba(255,196,88,.6);background-color:transparent;color:#be7b0099}.button.button-outline-orange:hover{color:#856a39;background-color:#ffc458cc}.button.button-outline-violet{outline:solid 1px rgba(194,167,255,.6);background-color:transparent;color:#580eff99}.button.button-outline-violet:hover{color:#7456b7;background-color:#c2a7ffcc}.dark .button{background-color:#ffffff1a;color:#e5e5e5}.dark .button:hover{color:#fff;background-color:#fff3}.dark .button.button-blue{background-color:#1685ac}.dark .button.button-blue:hover{background-color:#1685accc}.dark .button.button-green{background-color:#5d9d31}.dark .button.button-green:hover{background-color:#5d9d31cc}.dark .button.button-red{background-color:#c33737}.dark .button.button-red:hover{background-color:#c33737cc}.dark .button.button-orange{background-color:#d59622}.dark .button.button-orange:hover{background-color:#d59622cc}.dark .button.button-violet{background-color:#7750d2}.dark .button.button-violet:hover{background-color:#7750d2cc}.dark .button.button-outline{outline:solid 1px #555555;color:#a2a2a2;background-color:transparent}.dark .button.button-outline:hover{color:#fff;background-color:#555}.dark .button.button-outline-blue{outline:solid 1px #1685ac;background-color:transparent;color:#1ca8d9}.dark .button.button-outline-blue:hover{color:#fff;background-color:#1685ac}.dark .button.button-outline-green{outline:solid 1px #5d9d31;background-color:transparent;color:#74c33e}.dark .button.button-outline-green:hover{color:#fff;background-color:#5d9d31}.dark .button.button-outline-red{outline:solid 1px #c33737;background-color:transparent;color:#d15c5c}.dark .button.button-outline-red:hover{color:#fff;background-color:#c33737}.dark .button.button-outline-orange{outline:solid 1px #d59622;background-color:transparent;color:#e2ac48}.dark .button.button-outline-orange:hover{color:#fff;background-color:#d59622}.dark .button.button-outline-violet{outline:solid 1px #7750d2;background-color:transparent;color:#9779dc}.dark .button.button-outline-violet:hover{color:#fff;background-color:#7750d2}.badge{background-color:#ccc9;color:gray}.badge.badge-blue{background-color:#51c0e799;color:#43565c}.badge.badge-green{background-color:#90d76099;color:#4f4f4f}.badge.badge-red{background-color:#ff929299;color:#ae4a4a}.badge.badge-orange{background-color:#ffc45899;color:#856a39}.badge.badge-violet{background-color:#c2a7ff99;color:#7456b7}.badge.badge-stress-gray{color:#fff;background-color:#80808099}.badge.badge-stress-blue{color:#fff;background-color:#136c8c99}.badge.badge-stress-green{color:#fff;background-color:#467e2099}.badge.badge-stress-red{color:#fff;background-color:#f8000099}.badge.badge-stress-orange{color:#fff;background-color:#be7b0099}.badge.badge-stress-violet{color:#fff;background-color:#580eff99}.dark .badge{background-color:#555;color:#e5e5e5}.dark .badge.badge-blue{background-color:#1685ac}.dark .badge.badge-green{background-color:#5d9d31}.dark .badge.badge-red{background-color:#c33737}.dark .badge.badge-orange{background-color:#d59622}.dark .badge.badge-violet{background-color:#7750d2}.dark .badge.badge-stress-gray{color:#888;background-color:#090909}.dark .badge.badge-stress-blue{color:#41bce7;background-color:#051c24}.dark .badge.badge-stress-green{color:#90cf65;background-color:#18280d}.dark .badge.badge-stress-red{color:#dc8484;background-color:#4c1515}.dark .badge.badge-stress-orange{color:#e9c074;background-color:#51390d}.dark .badge.badge-stress-violet{color:#b6a1e7;background-color:#341c6d}.tree .tree-item>div.selected{background-color:#0000001a}.tree .tree-item>div:hover{background-color:#0000001a}.dark .tree .tree-item>div.selected{background-color:#ffffff1a}.dark .tree .tree-item>div:hover{background-color:#ffffff1a}body{background-color:#fff;color:#333}.dark{background-color:#34383e;color:#ccc}.d-input input,.d-select select{color:#ccc;background-color:#262626;border-color:#fff3}.d-input input:focus,.d-select select:focus{outline:none!important;border-color:#fff6}.d-checkbox input[type=checkbox]+label:before{border:1px solid rgba(255,255,255,.2)}.d-checkbox input[type=checkbox]:checked+label:before{border-color:#666;background-color:#666}.d-checkbox input[type=checkbox]:not(:disabled):not(:checked)+label:hover:before{border-color:#fff6}.d-checkbox input[type=checkbox]:not(:disabled):active+label:before{background-color:#b3d7ff;border-color:#fff6}.d-checkbox input[type=checkbox]:focus:not(:checked)+label:before{border-color:#fff6}.d-checkbox input[type=checkbox]:disabled+label:before{background-color:#e9ecef}.icon{color:#333}.dark .icon{color:#ccc}body{font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Noto Sans,Liberation Sans,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-weight:400;font-style:normal;font-size:.95rem}.node-top[data-v-f03192c5]{background:linear-gradient(0deg,rgba(0,185,255,0) 0%,rgba(0,185,255,0) 95%,rgb(0,185,255) 96%,rgb(0,185,255) 100%)!important}.node-bottom[data-v-f03192c5]{background:linear-gradient(0deg,rgb(0,185,255) 0%,rgb(0,185,255) 4%,rgba(0,185,255,0) 5%,rgba(0,185,255,0) 100%)!important}.node-over[data-v-f03192c5]{background:linear-gradient(0deg,rgb(0,185,255) 0%,rgb(0,185,255) 4%,rgba(0,185,255,0) 5%,rgba(0,185,255,0) 95%,rgb(0,185,255) 96%,rgb(0,185,255) 100%)}.tree-item>ul[data-v-4c920528]{padding-left:0!important}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "doph-js",
3
- "version": "0.0.30",
3
+ "version": "0.0.31",
4
4
  "description": "Simple Vue3 component library",
5
5
  "author": "Error202",
6
6
  "license": "MIT",
@@ -15,6 +15,7 @@
15
15
  "scripts": {
16
16
  "dev": "vite",
17
17
  "build": "vite build",
18
+ "publish": "npm publish",
18
19
  "preview": "vite preview"
19
20
  },
20
21
  "peerDependencies": {
@@ -30,6 +31,7 @@
30
31
  "vue": "^3.3.4"
31
32
  },
32
33
  "dependencies": {
33
- "vite-plugin-fonts": "^0.7.0"
34
+ "vite-plugin-fonts": "^0.7.0",
35
+ "vue-router": "^4.2.4"
34
36
  }
35
37
  }