@fewangsit/wangsvue-gsts 1.0.0-alpha.35 → 1.0.0-alpha.37

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.
@@ -1,3 +1,5 @@
1
+ import type { Config } from '@lottiefiles/dotlottie-web';
2
+
1
3
  import { ClassComponent } from '../ts-helpers.d';
2
4
 
3
5
  export interface AnimationDefaultConfig {
@@ -5,7 +7,12 @@ export interface AnimationDefaultConfig {
5
7
  }
6
8
 
7
9
  export interface AnimationProps {
8
- animation: 'no-data' | 'loading-plane' | 'loading-page' | 'loading-table';
10
+ animation:
11
+ | 'no-data'
12
+ | 'loading-plane'
13
+ | 'loading-page'
14
+ | 'loading-table'
15
+ | 'scan-qr';
9
16
  /**
10
17
  * @default true
11
18
  */
@@ -14,6 +21,11 @@ export interface AnimationProps {
14
21
  * @default true
15
22
  */
16
23
  loop?: boolean;
24
+ /**
25
+ * Custom configurations for the animation
26
+ * Reference: https://developers.lottiefiles.com/docs/dotlottie-player/dotlottie-web/api/config/
27
+ */
28
+ customConfig?: Partial<Config>;
17
29
  }
18
30
 
19
31
  /**
@@ -1,7 +1,7 @@
1
- import { defineComponent as p, computed as m, ref as u, onMounted as c, createElementBlock as d, openBlock as f, mergeProps as g, createElementVNode as y } from "vue";
2
- import { u as h } from "../plugins/WangsVue.es.js";
3
- import { m as v } from "../utils/mergePropsWithDefaults.util.es.js";
4
- const w = (n, e, i) => {
1
+ import { defineComponent as p, computed as m, ref as u, onMounted as c, createElementBlock as d, openBlock as f, mergeProps as g, createElementVNode as w } from "vue";
2
+ import { u as y } from "../plugins/WangsVue.es.js";
3
+ import { m as h } from "../utils/mergePropsWithDefaults.util.es.js";
4
+ const v = (n, e, i) => {
5
5
  const o = n[e];
6
6
  return o ? typeof o == "function" ? o() : Promise.resolve(o) : new Promise((a, s) => {
7
7
  (typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(
@@ -18,17 +18,19 @@ const w = (n, e, i) => {
18
18
  props: {
19
19
  animation: {},
20
20
  autoplay: { type: Boolean, default: !0 },
21
- loop: { type: Boolean, default: !0 }
21
+ loop: { type: Boolean, default: !0 },
22
+ customConfig: {}
22
23
  },
23
24
  setup(n) {
24
- const e = n, { defaultProps: i } = h("Animation"), o = m(() => v(e, i)), a = u(null);
25
+ const e = n, { defaultProps: i } = y("Animation"), o = m(() => h(e, i)), a = u(null);
25
26
  c(async () => {
26
- const l = await w(/* @__PURE__ */ Object.assign({ "../../assets/lottie/admin/loading-page.lottie": () => import("../assets/lottiejs/loading-page.es.js").then((t) => t.l), "../../assets/lottie/admin/loading-table.lottie": () => import("../assets/lottiejs/loading-table.es.js").then((t) => t.l), "../../assets/lottie/admin/no-data.lottie": () => import("../assets/lottiejs/no-data.es.js").then((t) => t.n), "../../assets/lottie/supplyasset/loading-page.lottie": () => import("../assets/lottiejs/loading-page.es.js").then((t) => t.a), "../../assets/lottie/supplyasset/loading-table.lottie": () => import("../assets/lottiejs/loading-table.es.js").then((t) => t.a), "../../assets/lottie/supplyasset/no-data.lottie": () => import("../assets/lottiejs/no-data.es.js").then((t) => t.a), "../../assets/lottie/workspace/loading-page.lottie": () => import("../assets/lottiejs/loading-page.es.js").then((t) => t.b), "../../assets/lottie/workspace/loading-plane.lottie": () => import("../assets/lottiejs/loading-plane.es.js"), "../../assets/lottie/workspace/loading-table.lottie": () => import("../assets/lottiejs/loading-table.es.js").then((t) => t.b), "../../assets/lottie/workspace/no-data.lottie": () => import("../assets/lottiejs/no-data.es.js").then((t) => t.b) }), `../../assets/lottie/${o.value.libPath}/${e.animation}.lottie`, 6), { DotLottie: r } = await s();
27
+ const l = await v(/* @__PURE__ */ Object.assign({ "../../assets/lottie/admin/loading-page.lottie": () => import("../assets/lottiejs/loading-page.es.js").then((t) => t.l), "../../assets/lottie/admin/loading-table.lottie": () => import("../assets/lottiejs/loading-table.es.js").then((t) => t.l), "../../assets/lottie/admin/no-data.lottie": () => import("../assets/lottiejs/no-data.es.js").then((t) => t.n), "../../assets/lottie/supplyasset/loading-page.lottie": () => import("../assets/lottiejs/loading-page.es.js").then((t) => t.a), "../../assets/lottie/supplyasset/loading-table.lottie": () => import("../assets/lottiejs/loading-table.es.js").then((t) => t.a), "../../assets/lottie/supplyasset/no-data.lottie": () => import("../assets/lottiejs/no-data.es.js").then((t) => t.a), "../../assets/lottie/workspace/loading-page.lottie": () => import("../assets/lottiejs/loading-page.es.js").then((t) => t.b), "../../assets/lottie/workspace/loading-plane.lottie": () => import("../assets/lottiejs/loading-plane.es.js"), "../../assets/lottie/workspace/loading-table.lottie": () => import("../assets/lottiejs/loading-table.es.js").then((t) => t.b), "../../assets/lottie/workspace/no-data.lottie": () => import("../assets/lottiejs/no-data.es.js").then((t) => t.b), "../../assets/lottie/workspace/scan-qr.lottie": () => import("../assets/lottiejs/scan-qr.es.js") }), `../../assets/lottie/${o.value.libPath}/${e.animation}.lottie`, 6), { DotLottie: r } = await s();
27
28
  a.value && new r({
28
29
  canvas: a.value,
29
30
  src: l.default,
30
31
  autoplay: e.autoplay,
31
- loop: e.loop
32
+ loop: e.loop,
33
+ ...e.customConfig
32
34
  });
33
35
  });
34
36
  const s = () => "System" in window ? new Function(
@@ -39,7 +41,7 @@ const w = (n, e, i) => {
39
41
  "https://cdn.jsdelivr.net/npm/@lottiefiles/dotlottie-web@0.38.2/+esm"
40
42
  );
41
43
  return (l, r) => (f(), d("div", g({ "data-wv-name": "animation" }, l.$attrs), [
42
- y("canvas", {
44
+ w("canvas", {
43
45
  ref_key: "canvasRef",
44
46
  ref: a,
45
47
  style: { width: "100%", height: "100%" }
@@ -0,0 +1,4 @@
1
+ const A = "data:application/octet-stream;base64,UEsDBBQAAAAIAJwM9lqsVU7QgAAAALUAAAANAAAAbWFuaWZlc3QuanNvbo2NQQ7CIBBF7zJrqaWhLXTVC3gC42IKRDGUMTCamKZ3Fzeu3f2fvJe3wcvnEijBBBIOcPXJZ2TK9c+OOBJz8MffEvcyy6Zr2srik2//gSmsyDVSYD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IIQBBrNAEBlG5izHUV4to4BLkjXFLZKHbH27ZQr6eEYj+366bpd4j15/8xY6I6lPQqJSuM3tjDh/ovsgIbwueXTxFmpHQg+mbhIKA5WF2KSzBm4fe6fzBnoSZSVf6o2hLhzL8OWZ+e+c7DKk71juc6y4flWmsEPDqPn6Wu6UdchqoteH9VTDLIfVPDsHGBbu7fW2GQ7DP1tx31zD+xBrZgioA611Q/E60Xso2ruxhU0krym9goRBmGmSPE/8afA8iet9aQMD977t26ChRj9qQXTvfifJz9ePg+WjGOuGed9c0KlXM4gar1KfU7vfVmcVb7RTHWfcYKpDu0ze5tBNdaR1OMX9xSzUk5rpYBR8npkOIi+m67tuefnh4f9QSwECFAAUAAAACACcDPZarFVO0IAAAAC1AAAADQAAAAAAAAAAAAAAAAAAAAAAbWFuaWZlc3QuanNvblBLAQIUABQAAAAIAJwM9lqrVGMVGAoAAEicAAA0AAAAAAAAAAAAAAAAAKsAAABhbmltYXRpb25zLzY2YTg4YTA4LTkyNGItNGM5Yy05ZDc0LWIxNTljNWU4N2MxMC5qc29uUEsFBgAAAAACAAIAnQAAABULAAAAAA==";
2
+ export {
3
+ A as default
4
+ };
@@ -50,8 +50,8 @@ const I = (i, s) => {
50
50
  _: 3
51
51
  }, 8, ["mouse-move", "touch-move", "touch-resize", "wheel-resize"]));
52
52
  }
53
- }), b = /* @__PURE__ */ I(R, [["__scopeId", "data-v-5cd98b2d"]]);
53
+ }), S = /* @__PURE__ */ I(R, [["__scopeId", "data-v-9031c32d"]]);
54
54
  export {
55
- b as B,
55
+ S as B,
56
56
  I as _
57
57
  };
package/badge/index.es.js CHANGED
@@ -1,83 +1,85 @@
1
- import { defineComponent as T, computed as r, resolveDirective as w, withDirectives as C, createElementBlock as c, openBlock as i, mergeProps as d, createElementVNode as S, createBlock as D, createCommentVNode as W, toDisplayString as V } from "vue";
2
- import { u as P } from "../plugins/WangsVue.es.js";
3
- import { m as _ } from "../utils/mergePropsWithDefaults.util.es.js";
4
- import { f as N } from "../utils/textFormatter.util.es.js";
5
- import { _ as E } from "../button/index.es.js";
6
- const F = ["contenteditable"], H = {
1
+ import { defineComponent as T, computed as r, resolveDirective as w, withDirectives as C, createElementBlock as v, openBlock as d, mergeProps as b, createElementVNode as S, createBlock as D, createCommentVNode as W, toDisplayString as E } from "vue";
2
+ import { u as R } from "../plugins/WangsVue.es.js";
3
+ import { m as V } from "../utils/mergePropsWithDefaults.util.es.js";
4
+ import { f as O } from "../utils/textFormatter.util.es.js";
5
+ import { _ as P } from "../button/index.es.js";
6
+ const _ = ["contenteditable"], N = {
7
7
  key: 1,
8
8
  "aria-label": "invalid-label"
9
- }, G = /* @__PURE__ */ T({
9
+ }, z = /* @__PURE__ */ T({
10
10
  __name: "Badge",
11
11
  props: {
12
12
  label: {},
13
13
  editable: { type: Boolean },
14
+ restoreOnEmpty: { type: Boolean },
14
15
  severity: {},
15
16
  format: {},
16
17
  removable: { type: Boolean },
18
+ disableRemoveButton: { type: Boolean },
17
19
  disabled: { type: Boolean },
18
20
  tooltip: {},
19
21
  getSeverity: { type: Function }
20
22
  },
21
23
  emits: ["remove", "update:label"],
22
- setup(v, { emit: f }) {
23
- const t = v, n = f, { defaultProps: g } = P("Badge"), y = r(() => _(t, g)), b = r(() => {
24
- const e = typeof t.label;
25
- return e === "number" || e === "string" && t.label && t.label !== "-";
26
- }), s = r(() => {
27
- var e, o;
28
- return t.severity || ((o = (e = y.value).getSeverity) == null ? void 0 : o.call(e, t.label));
29
- }), $ = r(() => {
30
- if (!b.value) return "-";
31
- switch (t.format) {
24
+ setup(c, { emit: f }) {
25
+ const e = c, s = f, { defaultProps: y } = R("Badge"), g = r(() => V(e, y)), u = r(() => {
26
+ const t = typeof e.label;
27
+ return t === "number" || t === "string" && e.label && e.label !== "-";
28
+ }), i = r(() => {
29
+ var t, o;
30
+ return e.severity || ((o = (t = g.value).getSeverity) == null ? void 0 : o.call(t, e.label));
31
+ }), B = r(() => {
32
+ if (!u.value) return "-";
33
+ switch (e.format) {
32
34
  case "nowrap":
33
- return t.label;
35
+ return e.label;
34
36
  case "username":
35
- return N(t.label);
37
+ return O(e.label);
36
38
  default:
37
- if (t.label.length > 12) {
38
- const e = t.label.slice(0, 5), o = t.label.slice(-5);
39
- return `${e}..${o}`;
39
+ if (e.label.length > 12) {
40
+ const t = e.label.slice(0, 5), o = e.label.slice(-5);
41
+ return `${t}..${o}`;
40
42
  }
41
- return t.label;
43
+ return e.label;
42
44
  }
43
- }), u = r(() => t.tooltip || (t.format !== "nowrap" && t.label.length > 12 || t.format === "username" && t.label.length > 8 ? t.label : void 0)), B = (e) => {
44
- const o = e.target;
45
- (e.code === "Enter" || e.code === "Tab") && (e.preventDefault(), o.blur());
46
- }, k = (e, o) => {
47
- const l = e.textContent;
48
- if (l !== t.label) {
49
- const a = (l == null ? void 0 : l.trim()) ?? null;
50
- e.textContent = a, n("update:label", a), o && !l && (o.remove(), n("remove"));
45
+ }), p = r(() => e.tooltip || (e.format !== "nowrap" && e.label.length > 12 || e.format === "username" && e.label.length > 8 ? e.label : void 0)), $ = (t) => {
46
+ const o = t.target;
47
+ (t.code === "Enter" || t.code === "Tab") && (t.preventDefault(), o.blur());
48
+ }, k = (t, o) => {
49
+ const l = t.textContent;
50
+ if (l !== e.label) {
51
+ const a = (l == null ? void 0 : l.trim()) ?? null, n = e.restoreOnEmpty && !a ? e.label : a;
52
+ t.textContent = n, s("update:label", n, e.label), o && !n && e.removable != !1 && (o.remove(), s("remove"));
51
53
  }
52
54
  };
53
- return (e, o) => {
54
- var a, p, m;
55
+ return (t, o) => {
56
+ var a, n, m;
55
57
  const l = w("tooltip");
56
- return b.value ? C((i(), c("span", d(
58
+ return u.value ? C((d(), v("span", b(
57
59
  {
58
60
  key: 0,
59
61
  ref: "badge"
60
62
  },
61
- (a = e.$preset.badge) == null ? void 0 : a.root({
62
- props: { severity: s.value, disabled: e.disabled }
63
+ (a = t.$preset.badge) == null ? void 0 : a.root({
64
+ props: { severity: i.value, disabled: t.disabled }
63
65
  })
64
66
  ), [
65
- S("span", d({ ref: "input" }, (p = e.$preset.badge) == null ? void 0 : p.input({ props: t, context: { badgeTooltip: u.value } }), {
66
- contenteditable: e.editable,
67
+ S("span", b({ ref: "input" }, (n = t.$preset.badge) == null ? void 0 : n.input({ props: e, context: { badgeTooltip: p.value } }), {
68
+ contenteditable: t.editable,
67
69
  onBlur: o[0] || (o[0] = (h) => k(
68
- e.$refs.input,
69
- e.$refs.badge
70
+ t.$refs.input,
71
+ t.$refs.badge
70
72
  )),
71
- onKeydown: B,
73
+ onKeydown: $,
72
74
  spellcheck: "false"
73
- }), V($.value), 17, F),
74
- t.removable ? (i(), D(E, d(
75
+ }), E(B.value), 17, _),
76
+ e.removable || e.disableRemoveButton ? (d(), D(P, b(
75
77
  { key: 0 },
76
- (m = e.$preset.badge) == null ? void 0 : m.removebutton({ props: { badgeSeverity: s.value, disabled: e.disabled } }),
78
+ (m = t.$preset.badge) == null ? void 0 : m.removebutton({ props: { badgeSeverity: i.value, disabled: t.disabled } }),
77
79
  {
78
- disabled: t.disabled,
79
- severity: s.value,
80
- onClick: o[1] || (o[1] = (h) => n("remove")),
80
+ disabled: e.disabled || !e.removable && e.disableRemoveButton,
81
+ severity: i.value,
82
+ onClick: o[1] || (o[1] = (h) => s("remove")),
81
83
  icon: "close",
82
84
  rounded: "",
83
85
  text: ""
@@ -86,88 +88,90 @@ const F = ["contenteditable"], H = {
86
88
  ], 16)), [
87
89
  [
88
90
  l,
89
- { value: u.value, autoHide: !1 },
91
+ { value: p.value, autoHide: !1 },
90
92
  void 0,
91
93
  { top: !0 }
92
94
  ]
93
- ]) : (i(), c("span", H, "-"));
95
+ ]) : (d(), v("span", N, "-"));
94
96
  };
95
97
  }
96
- }), K = ["contenteditable"], L = {
98
+ }), F = ["contenteditable"], H = {
97
99
  key: 1,
98
100
  "aria-label": "invalid-label"
99
- }, I = /* @__PURE__ */ T({
101
+ }, A = /* @__PURE__ */ T({
100
102
  __name: "Badge",
101
103
  props: {
102
104
  label: {},
103
105
  editable: { type: Boolean },
106
+ restoreOnEmpty: { type: Boolean },
104
107
  severity: {},
105
108
  format: {},
106
109
  removable: { type: Boolean },
110
+ disableRemoveButton: { type: Boolean },
107
111
  disabled: { type: Boolean },
108
112
  tooltip: {},
109
113
  getSeverity: { type: Function }
110
114
  },
111
115
  emits: ["remove", "update:label"],
112
- setup(v, { emit: f }) {
113
- const t = v, n = f, { defaultProps: g } = P("Badge"), y = r(() => _(t, g)), b = r(() => {
114
- const e = typeof t.label;
115
- return e === "number" || e === "string" && t.label && t.label !== "-";
116
- }), s = r(() => {
117
- var e, o;
118
- return t.severity || ((o = (e = y.value).getSeverity) == null ? void 0 : o.call(e, t.label));
119
- }), $ = r(() => {
120
- if (!b.value) return "-";
121
- switch (t.format) {
116
+ setup(c, { emit: f }) {
117
+ const e = c, s = f, { defaultProps: y } = R("Badge"), g = r(() => V(e, y)), u = r(() => {
118
+ const t = typeof e.label;
119
+ return t === "number" || t === "string" && e.label && e.label !== "-";
120
+ }), i = r(() => {
121
+ var t, o;
122
+ return e.severity || ((o = (t = g.value).getSeverity) == null ? void 0 : o.call(t, e.label));
123
+ }), B = r(() => {
124
+ if (!u.value) return "-";
125
+ switch (e.format) {
122
126
  case "nowrap":
123
- return t.label;
127
+ return e.label;
124
128
  case "username":
125
- return N(t.label);
129
+ return O(e.label);
126
130
  default:
127
- if (t.label.length > 12) {
128
- const e = t.label.slice(0, 5), o = t.label.slice(-5);
129
- return `${e}..${o}`;
131
+ if (e.label.length > 12) {
132
+ const t = e.label.slice(0, 5), o = e.label.slice(-5);
133
+ return `${t}..${o}`;
130
134
  }
131
- return t.label;
135
+ return e.label;
132
136
  }
133
- }), u = r(() => t.format !== "nowrap" && t.label.length > 12 || t.format === "username" && t.label.length > 8 ? t.label : void 0), B = (e) => {
134
- const o = e.target;
135
- (e.code === "Enter" || e.code === "Tab") && (e.preventDefault(), o.blur());
136
- }, k = (e, o) => {
137
- const l = e.textContent;
138
- if (l !== t.label) {
137
+ }), p = r(() => e.format !== "nowrap" && e.label.length > 12 || e.format === "username" && e.label.length > 8 ? e.label : void 0), $ = (t) => {
138
+ const o = t.target;
139
+ (t.code === "Enter" || t.code === "Tab") && (t.preventDefault(), o.blur());
140
+ }, k = (t, o) => {
141
+ const l = t.textContent;
142
+ if (l !== e.label) {
139
143
  const a = (l == null ? void 0 : l.trim()) ?? null;
140
- e.textContent = a, n("update:label", a), o && !l && (o.remove(), n("remove"));
144
+ t.textContent = a, s("update:label", a), o && !l && (o.remove(), s("remove"));
141
145
  }
142
146
  };
143
- return (e, o) => {
144
- var a, p, m;
147
+ return (t, o) => {
148
+ var a, n, m;
145
149
  const l = w("tooltip");
146
- return b.value ? C((i(), c("span", d(
150
+ return u.value ? C((d(), v("span", b(
147
151
  {
148
152
  key: 0,
149
153
  ref: "badge"
150
154
  },
151
- (a = e.$preset.badge) == null ? void 0 : a.root({
152
- props: { severity: s.value, disabled: e.disabled }
155
+ (a = t.$preset.badge) == null ? void 0 : a.root({
156
+ props: { severity: i.value, disabled: t.disabled }
153
157
  })
154
158
  ), [
155
- S("span", d({ ref: "input" }, (p = e.$preset.badge) == null ? void 0 : p.input({ props: t, context: { badgeTooltip: u.value } }), {
156
- contenteditable: e.editable,
159
+ S("span", b({ ref: "input" }, (n = t.$preset.badge) == null ? void 0 : n.input({ props: e, context: { badgeTooltip: p.value } }), {
160
+ contenteditable: t.editable,
157
161
  onBlur: o[0] || (o[0] = (h) => k(
158
- e.$refs.input,
159
- e.$refs.badge
162
+ t.$refs.input,
163
+ t.$refs.badge
160
164
  )),
161
- onKeydown: B,
165
+ onKeydown: $,
162
166
  spellcheck: "false"
163
- }), V($.value), 17, K),
164
- t.removable ? (i(), D(E, d(
167
+ }), E(B.value), 17, F),
168
+ e.removable ? (d(), D(P, b(
165
169
  { key: 0 },
166
- (m = e.$preset.badge) == null ? void 0 : m.removebutton({ props: { badgeSeverity: s.value, disabled: e.disabled } }),
170
+ (m = t.$preset.badge) == null ? void 0 : m.removebutton({ props: { badgeSeverity: i.value, disabled: t.disabled } }),
167
171
  {
168
- disabled: t.disabled,
169
- severity: s.value,
170
- onClick: o[1] || (o[1] = (h) => n("remove")),
172
+ disabled: e.disabled,
173
+ severity: i.value,
174
+ onClick: o[1] || (o[1] = (h) => s("remove")),
171
175
  icon: "close",
172
176
  rounded: "",
173
177
  text: ""
@@ -176,15 +180,15 @@ const F = ["contenteditable"], H = {
176
180
  ], 16)), [
177
181
  [
178
182
  l,
179
- { value: u.value, autoHide: !1 },
183
+ { value: p.value, autoHide: !1 },
180
184
  void 0,
181
185
  { top: !0 }
182
186
  ]
183
- ]) : (i(), c("span", L, "-"));
187
+ ]) : (d(), v("span", H, "-"));
184
188
  };
185
189
  }
186
190
  });
187
191
  export {
188
- G as _,
189
- I as a
192
+ z as _,
193
+ A as a
190
194
  };
@@ -1,8 +1,8 @@
1
- import { defineComponent as b, shallowRef as k, computed as p, createElementBlock as i, openBlock as r, normalizeProps as h, mergeProps as v, createBlock as a, createCommentVNode as y, Fragment as d, renderList as m, unref as $, withCtx as L, renderSlot as c } from "vue";
2
- import { s as w } from "../vendor/primevue/dialog/dialog.esm.es.js";
1
+ import { defineComponent as b, shallowRef as k, computed as u, createElementBlock as i, openBlock as o, normalizeProps as h, mergeProps as y, createBlock as a, createCommentVNode as v, Fragment as d, renderList as m, unref as $, withCtx as B, renderSlot as L } from "vue";
2
+ import { s as c } from "../vendor/primevue/dialog/dialog.esm.es.js";
3
3
  import { _ as f } from "../badge/index.es.js";
4
- import { _ as x } from "../button/index.es.js";
5
- const M = { key: 0 }, j = /* @__PURE__ */ b({
4
+ import { _ as w } from "../button/index.es.js";
5
+ const x = { key: 0 }, _ = /* @__PURE__ */ b({
6
6
  __name: "BadgeGroup",
7
7
  props: {
8
8
  labels: {},
@@ -11,44 +11,46 @@ const M = { key: 0 }, j = /* @__PURE__ */ b({
11
11
  limit: {},
12
12
  headerLabel: { default: "Header" },
13
13
  editable: { type: Boolean },
14
+ restoreOnEmpty: { type: Boolean },
14
15
  severity: {},
15
16
  format: {},
17
+ disableRemoveButton: { type: Boolean },
16
18
  tooltip: {},
17
19
  getSeverity: {}
18
20
  },
19
21
  setup(g) {
20
- const t = g, l = k(!1), n = p(() => t.labels.slice(0, t.limit)), u = p(
22
+ const t = g, l = k(!1), n = u(() => t.labels.slice(0, t.limit)), p = u(
21
23
  () => t.labels.length - n.value.length
22
24
  );
23
- return (o, s) => n.value.length ? (r(), i("div", h(v({ key: 1 }, o.$preset.badgegroup.root)), [
24
- (r(!0), i(d, null, m(n.value, (e) => (r(), a(f, {
25
+ return (r, s) => n.value.length ? (o(), i("div", h(y({ key: 1 }, r.$preset.badgegroup.root)), [
26
+ (o(!0), i(d, null, m(n.value, (e) => (o(), a(f, {
25
27
  key: typeof e == "string" ? e : e.text,
26
28
  format: t.format,
27
29
  label: typeof e == "string" ? e : e.text,
28
30
  severity: typeof e == "string" ? t.severity : e.severity
29
31
  }, null, 8, ["format", "label", "severity"]))), 128)),
30
- u.value ? (r(), a(x, v({
32
+ p.value ? (o(), a(w, y({
31
33
  key: 0,
32
- label: `+${u.value} ${o.textMore}`
33
- }, o.$preset.badgegroup.showmorebutton, {
34
+ label: `+${p.value} ${r.textMore}`
35
+ }, r.$preset.badgegroup.showmorebutton, {
34
36
  severity: t.textMoreSeverity ?? "dark",
35
37
  onClick: s[0] || (s[0] = (e) => l.value = !0),
36
38
  text: ""
37
- }), null, 16, ["label", "severity"])) : y("", !0),
38
- o.limit ? (r(), a($(w), {
39
+ }), null, 16, ["label", "severity"])) : v("", !0),
40
+ r.limit ? (o(), a($(c), {
39
41
  key: 1,
40
42
  visible: l.value,
41
43
  "onUpdate:visible": s[1] || (s[1] = (e) => l.value = e),
42
44
  draggable: !1,
43
- header: o.headerLabel,
44
- pt: o.$preset.badgegroup.showmoredialog,
45
+ header: r.headerLabel,
46
+ pt: r.$preset.badgegroup.showmoredialog,
45
47
  modal: ""
46
48
  }, {
47
- default: L(() => [
48
- c(o.$slots, "dialogcontent", {
49
+ default: B(() => [
50
+ L(r.$slots, "dialogcontent", {
49
51
  labels: t.labels
50
52
  }, () => [
51
- (r(!0), i(d, null, m(t.labels, (e) => (r(), a(f, {
53
+ (o(!0), i(d, null, m(t.labels, (e) => (o(), a(f, {
52
54
  key: typeof e == "string" ? e : e.text,
53
55
  format: t.format,
54
56
  label: typeof e == "string" ? e : e.text,
@@ -57,10 +59,10 @@ const M = { key: 0 }, j = /* @__PURE__ */ b({
57
59
  ])
58
60
  ]),
59
61
  _: 3
60
- }, 8, ["visible", "header", "pt"])) : y("", !0)
61
- ], 16)) : (r(), i("span", M, " - "));
62
+ }, 8, ["visible", "header", "pt"])) : v("", !0)
63
+ ], 16)) : (o(), i("span", x, " - "));
62
64
  }
63
- }), B = { key: 0 }, D = /* @__PURE__ */ b({
65
+ }), M = { key: 0 }, j = /* @__PURE__ */ b({
64
66
  __name: "BadgeGroup",
65
67
  props: {
66
68
  labels: {},
@@ -69,45 +71,47 @@ const M = { key: 0 }, j = /* @__PURE__ */ b({
69
71
  limit: {},
70
72
  headerLabel: { default: "Header" },
71
73
  editable: { type: Boolean },
74
+ restoreOnEmpty: { type: Boolean },
72
75
  severity: {},
73
76
  format: {},
77
+ disableRemoveButton: { type: Boolean },
74
78
  tooltip: {},
75
79
  getSeverity: {}
76
80
  },
77
81
  setup(g) {
78
- const t = g, l = k(!1), n = p(() => t.labels.slice(0, t.limit)), u = p(
82
+ const t = g, l = k(!1), n = u(() => t.labels.slice(0, t.limit)), p = u(
79
83
  () => t.labels.length - n.value.length
80
84
  );
81
- return (o, s) => n.value.length ? (r(), i("div", h(v({ key: 1 }, o.$preset.badgegroup.root)), [
82
- (r(!0), i(d, null, m(n.value, (e) => (r(), a(f, {
85
+ return (r, s) => n.value.length ? (o(), i("div", h(y({ key: 1 }, r.$preset.badgegroup.root)), [
86
+ (o(!0), i(d, null, m(n.value, (e) => (o(), a(f, {
83
87
  key: typeof e == "string" ? e : e.text,
84
88
  format: t.format,
85
89
  label: typeof e == "string" ? e : e.text,
86
90
  severity: typeof e == "string" ? t.severity : e.severity,
87
91
  tooltip: typeof e == "object" && e.tooltip
88
92
  }, null, 8, ["format", "label", "severity", "tooltip"]))), 128)),
89
- u.value ? (r(), a(x, v({
93
+ p.value ? (o(), a(w, y({
90
94
  key: 0,
91
- label: `+${u.value} ${o.textMore}`
92
- }, o.$preset.badgegroup.showmorebutton, {
95
+ label: `+${p.value} ${r.textMore}`
96
+ }, r.$preset.badgegroup.showmorebutton, {
93
97
  severity: t.textMoreSeverity ?? "dark",
94
98
  onClick: s[0] || (s[0] = (e) => l.value = !0),
95
99
  text: ""
96
- }), null, 16, ["label", "severity"])) : y("", !0),
97
- o.limit ? (r(), a($(w), {
100
+ }), null, 16, ["label", "severity"])) : v("", !0),
101
+ r.limit ? (o(), a($(c), {
98
102
  key: 1,
99
103
  visible: l.value,
100
104
  "onUpdate:visible": s[1] || (s[1] = (e) => l.value = e),
101
105
  draggable: !1,
102
- header: o.headerLabel,
103
- pt: o.$preset.badgegroup.showmoredialog,
106
+ header: r.headerLabel,
107
+ pt: r.$preset.badgegroup.showmoredialog,
104
108
  modal: ""
105
109
  }, {
106
- default: L(() => [
107
- c(o.$slots, "dialogcontent", {
110
+ default: B(() => [
111
+ L(r.$slots, "dialogcontent", {
108
112
  labels: t.labels
109
113
  }, () => [
110
- (r(!0), i(d, null, m(t.labels, (e) => (r(), a(f, {
114
+ (o(!0), i(d, null, m(t.labels, (e) => (o(), a(f, {
111
115
  key: typeof e == "string" ? e : e.text,
112
116
  format: t.format,
113
117
  label: typeof e == "string" ? e : e.text,
@@ -117,11 +121,11 @@ const M = { key: 0 }, j = /* @__PURE__ */ b({
117
121
  ])
118
122
  ]),
119
123
  _: 3
120
- }, 8, ["visible", "header", "pt"])) : y("", !0)
121
- ], 16)) : (r(), i("span", B, " - "));
124
+ }, 8, ["visible", "header", "pt"])) : v("", !0)
125
+ ], 16)) : (o(), i("span", M, " - "));
122
126
  }
123
127
  });
124
128
  export {
125
- D as _,
126
- j as a
129
+ j as _,
130
+ _ as a
127
131
  };