@chase-shao/vue-component-lib 1.2.0 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -1,35 +1,36 @@
1
- import { ref as g, defineComponent as b, resolveComponent as V, createBlock as h, openBlock as p, onMounted as I, withCtx as x, createElementBlock as v, Fragment as R, renderList as S, createVNode as O, computed as k, nextTick as ie, useTemplateRef as ee, watch as le, createElementVNode as w, toDisplayString as T, createCommentVNode as G, resolveDynamicComponent as te, renderSlot as y, createTextVNode as re, inject as ce, getCurrentInstance as ue, reactive as W, resolveDirective as B, withDirectives as M } from "vue";
2
- import de from "axios";
3
- import { defineStore as pe } from "pinia";
4
- const me = pe("main", () => ({
1
+ import { ref as g, defineComponent as y, resolveComponent as h, createBlock as b, openBlock as p, onMounted as x, withCtx as $, createElementBlock as v, Fragment as S, renderList as L, createVNode as I, computed as V, nextTick as ne, useTemplateRef as Q, watch as oe, createElementVNode as w, toDisplayString as A, createCommentVNode as F, resolveDynamicComponent as X, renderSlot as k, createTextVNode as se, inject as le, reactive as W } from "vue";
2
+ import ie from "axios";
3
+ import { defineStore as re } from "pinia";
4
+ import { useRouter as ce } from "vue-router";
5
+ const ue = re("main", () => ({
5
6
  token: g(void 0)
6
- })), fe = async (e) => new Promise((o) => setTimeout(o, e)), ge = async (e, o, t, a = void 0) => {
7
- if (e[o] === void 0)
7
+ })), de = async (e) => new Promise((n) => setTimeout(n, e)), pe = async (e, n, t, a = void 0) => {
8
+ if (e[n] === void 0)
8
9
  try {
9
- e[o] = null, e[o] = await t() || a;
10
- } catch (n) {
11
- console.error(n), e[o] = void 0;
10
+ e[n] = null, e[n] = await t() || a;
11
+ } catch (o) {
12
+ console.error(o), e[n] = void 0;
12
13
  }
13
- for (; e[o] === null; )
14
- await fe(100);
15
- return e[o];
16
- }, ae = "", ve = "", q = de.create({
17
- baseURL: ae,
14
+ for (; e[n] === null; )
15
+ await de(100);
16
+ return e[n];
17
+ }, Y = "", me = "", M = ie.create({
18
+ baseURL: Y,
18
19
  timeout: 1e4,
19
20
  // 10s
20
21
  headers: { "Content-Type": "application/json" }
21
- }), _e = async () => {
22
- const e = me();
23
- return await ge(e, "token", async () => (await q.get(`${ae}/GenerateToken`, {
22
+ }), fe = async () => {
23
+ const e = ue();
24
+ return await pe(e, "token", async () => (await M.get(`${Y}/GenerateToken`, {
24
25
  params: {
25
26
  appid: "bpm",
26
- appsecret: ve
27
+ appsecret: me
27
28
  }
28
29
  }))?.data?.token);
29
- }, A = async () => {
30
- const e = await _e();
31
- return q.defaults.headers.common.Authorization = `Bearer ${e}`, q;
32
- }, J = {
30
+ }, N = async () => {
31
+ const e = await fe();
32
+ return M.defaults.headers.common.Authorization = `Bearer ${e}`, M;
33
+ }, G = {
33
34
  CurrentUserEmail: () => "test.email@dataGetter.ts",
34
35
  CurrentUserPositionCode: () => 888,
35
36
  CurrentDatetime: () => (/* @__PURE__ */ new Date()).toISOString(),
@@ -38,18 +39,18 @@ const me = pe("main", () => ({
38
39
  RejectReason: () => "Test Reject Reason"
39
40
  };
40
41
  var j = /* @__PURE__ */ ((e) => (e[e.Create = 0] = "Create", e[e.Update = 1] = "Update", e[e.Details = 2] = "Details", e[e.list = 3] = "list", e))(j || {});
41
- function we(e) {
42
- const o = {
42
+ function ge(e) {
43
+ const n = {
43
44
  pageType: "",
44
45
  fields: {},
45
46
  globalValidations: []
46
47
  };
47
48
  return e.__ClassAttributes?.forEach((t) => {
48
- t.AttributeType === "UIPageType" ? o.pageType = t.Type : t.AttributeType === "UIValidationControl" ? o.globalValidations.push({
49
+ t.AttributeType === "UIPageType" ? n.pageType = t.Type : t.AttributeType === "UIValidationControl" ? n.globalValidations.push({
49
50
  rule: t.RuleName,
50
51
  param: t.RuleParameter,
51
52
  appliesTo: t.PropertyNames || ["*"]
52
- }) : t.AttributeType === "UIControl" && (o.actions || (o.actions = []), o.actions.push({
53
+ }) : t.AttributeType === "UIControl" && (n.actions || (n.actions = []), n.actions.push({
53
54
  isSubmit: t.IsSubmit,
54
55
  requestUrl: t.RequestUrl,
55
56
  redirectUrl: t.RedirectUrl,
@@ -59,103 +60,103 @@ function we(e) {
59
60
  }));
60
61
  }), Object.entries(e).forEach(([t, a]) => {
61
62
  if (t === "__ClassAttributes" || t === "ClassName") return;
62
- const n = {
63
+ const o = {
63
64
  validations: []
64
- }, { attributes: u, propertyValue: l } = a;
65
- switch (l) {
65
+ }, { attributes: u, propertyValue: i } = a;
66
+ switch (i) {
66
67
  case null:
67
- n.value = "";
68
+ o.value = "";
68
69
  break;
69
70
  case void 0:
70
- n.value = "";
71
+ o.value = "";
71
72
  break;
72
73
  default:
73
- n.value = l;
74
+ o.value = i;
74
75
  break;
75
76
  }
76
77
  u?.forEach((s) => {
77
- s.order || s.Order ? n.order = s.order ?? s.Order : s.AttributeType === "UIControl" ? n.widget = {
78
+ s.order || s.Order ? o.order = s.order ?? s.Order : s.AttributeType === "UIControl" ? o.widget = {
78
79
  ...s,
79
80
  column: !0
80
- } : s.AttributeType === "UIValidationControl" ? n.validations.push(s) : s.AttributeType === "UIListed" ? n.widget = {
81
+ } : s.AttributeType === "UIValidationControl" ? o.validations.push(s) : s.AttributeType === "UIListed" ? o.widget = {
81
82
  ...s,
82
83
  column: !0
83
- } : s.DependentType && (n.value = J[s.DependentType] ? J[s.DependentType]() : "");
84
- }), o.fields[t] = n;
85
- }), o;
84
+ } : s.DependentType && (o.value = G[s.DependentType] ? G[s.DependentType]() : "");
85
+ }), n.fields[t] = o;
86
+ }), n;
86
87
  }
87
- const K = async (e, o) => {
88
- const a = await (await A()).get(`/General/${e}/page`, { params: o });
89
- return we(a?.data);
88
+ const B = async (e, n) => {
89
+ const a = await (await N()).get(`/General/${e}/page`, { params: n });
90
+ return ge(a?.data);
90
91
  };
91
- async function he(e, o) {
92
- const a = await (await A()).get(`/General/${e}/list`, { params: o });
92
+ async function _e(e, n) {
93
+ const a = await (await N()).get(`/General/${e}/list`, { params: n });
93
94
  return {
94
95
  data: a.data.Data.propertyValue.data,
95
96
  totalCount: a.data.Data.propertyValue.totalCount,
96
- actions: a.data.__ClassAttributes.filter((n) => n.AttributeType === "UIControl").map(
97
- (n) => ({
98
- redirectUrl: n.RedirectUrl,
99
- location: n.Location,
100
- attributeType: n.AttributeType,
101
- redirectType: n.RedirectType,
102
- readonly: n.Readonly,
103
- widget: n.Widget,
104
- title: n.Title,
105
- isSubmit: n.IsSubmit
97
+ actions: a.data.__ClassAttributes.filter((o) => o.AttributeType === "UIControl").map(
98
+ (o) => ({
99
+ redirectUrl: o.RedirectUrl,
100
+ location: o.Location,
101
+ attributeType: o.AttributeType,
102
+ redirectType: o.RedirectType,
103
+ readonly: o.Readonly,
104
+ widget: o.Widget,
105
+ title: o.Title,
106
+ isSubmit: o.IsSubmit
106
107
  })
107
108
  )
108
109
  };
109
110
  }
110
- async function be(e, o, t) {
111
- const n = await (await A()).post(t, o, {
111
+ async function ve(e, n, t) {
112
+ const o = await (await N()).post(t, n, {
112
113
  params: {
113
114
  className: e
114
115
  }
115
116
  });
116
- return n.data.length > 0 ? n.data[0] : 0;
117
+ return o.data.length > 0 ? o.data[0] : 0;
117
118
  }
118
- function ye(e, o) {
119
- return e.replace(/{workflowId}/g, o);
119
+ function we(e, n) {
120
+ return e.replace(/{workflowId}/g, n);
120
121
  }
121
- async function ke(e, o, t, a) {
122
- const n = await A(), u = ye(a, o);
123
- return (await n.put(u, t, {
122
+ async function he(e, n, t, a) {
123
+ const o = await N(), u = we(a, n);
124
+ return (await o.put(u, t, {
124
125
  params: {
125
126
  className: e
126
127
  }
127
128
  }))?.data;
128
129
  }
129
- function Ve(e, o) {
130
- return e.replace(/{WorkflowId}/g, o);
130
+ function be(e, n) {
131
+ return e.replace(/{WorkflowId}/g, n);
131
132
  }
132
- function Ce(e, o) {
133
- return e.replace(/{ApproverEmail}/g, o);
133
+ function ye(e, n) {
134
+ return e.replace(/{ApproverEmail}/g, n);
134
135
  }
135
- function $e(e, o) {
136
- return e.replace(/{WorkFlowReason}/g, o);
136
+ function ke(e, n) {
137
+ return e.replace(/{WorkFlowReason}/g, n);
137
138
  }
138
- async function Ue(e, o, t, a, n, u) {
139
- const l = await A();
140
- let s = Ve(u, o);
141
- return s = Ce(s, t), s = $e(s, a), (await l.put(s, n, {
139
+ async function Ve(e, n, t, a, o, u) {
140
+ const i = await N();
141
+ let s = be(u, n);
142
+ return s = ye(s, t), s = ke(s, a), (await i.put(s, o, {
142
143
  params: {
143
144
  className: e
144
145
  }
145
146
  }))?.data;
146
147
  }
147
- async function Le(e, o) {
148
- return ((await (await A()).get(e, { params: { value: o } }))?.data).map((u) => ({
148
+ async function Ce(e, n) {
149
+ return ((await (await N()).get(e, { params: { value: n } }))?.data).map((u) => ({
149
150
  value: u.key,
150
151
  label: u.value
151
152
  }));
152
153
  }
153
- const Re = (e, o) => e.reduce((t, a) => t && Se(a, o), !0), Se = (e, o) => {
154
+ const Ue = (e, n) => e.reduce((t, a) => t && $e(a, n), !0), $e = (e, n) => {
154
155
  const { RuleName: t, RuleParameter: a } = e;
155
- return Te[t](a, o);
156
- }, Te = {
157
- Regex: (e, o) => new RegExp(e).test(o)
158
- }, X = /* @__PURE__ */ b({
156
+ return Re[t](a, n);
157
+ }, Re = {
158
+ Regex: (e, n) => new RegExp(e).test(n)
159
+ }, q = /* @__PURE__ */ y({
159
160
  __name: "InputText",
160
161
  props: {
161
162
  modelValue: {},
@@ -164,25 +165,25 @@ const Re = (e, o) => e.reduce((t, a) => t && Se(a, o), !0), Se = (e, o) => {
164
165
  validations: {}
165
166
  },
166
167
  emits: ["update:modelValue", "change", "error", "input"],
167
- setup(e, { emit: o }) {
168
- const t = e, a = o, n = (s) => Re(t.validations, s), u = (s) => {
168
+ setup(e, { emit: n }) {
169
+ const t = e, a = n, o = (s) => Ue(t.validations, s), u = (s) => {
169
170
  a("update:modelValue", s), a("input", s);
170
- }, l = (s) => {
171
- const i = n(s);
172
- a("update:modelValue", s), a("change", s), a("error", i ? "" : "Validation Error");
171
+ }, i = (s) => {
172
+ const l = o(s);
173
+ a("update:modelValue", s), a("change", s), a("error", l ? "" : "Validation Error");
173
174
  };
174
- return (s, i) => {
175
- const c = V("AInput");
176
- return p(), h(c, {
175
+ return (s, l) => {
176
+ const c = h("AInput");
177
+ return p(), b(c, {
177
178
  "model-value": t.modelValue,
178
179
  clearable: "",
179
180
  disabled: t.readonly || t.config.Readonly,
180
181
  onInput: u,
181
- onChange: l
182
+ onChange: i
182
183
  }, null, 8, ["model-value", "disabled"]);
183
184
  };
184
185
  }
185
- }), Ie = /* @__PURE__ */ b({
186
+ }), Te = /* @__PURE__ */ y({
186
187
  __name: "InputNumber",
187
188
  props: {
188
189
  modelValue: {},
@@ -191,57 +192,57 @@ const Re = (e, o) => e.reduce((t, a) => t && Se(a, o), !0), Se = (e, o) => {
191
192
  validations: {}
192
193
  },
193
194
  emits: ["update:modelValue", "change", "error", "input"],
194
- setup(e, { emit: o }) {
195
- const t = e, a = o, n = g(100), u = g(0);
196
- I(() => {
197
- t.validations && t.validations.forEach((i) => {
198
- i.RuleName === "Max" && (n.value = i.RuleParameter), i.RuleName === "Min" && (u.value = i.RuleParameter);
195
+ setup(e, { emit: n }) {
196
+ const t = e, a = n, o = g(100), u = g(0);
197
+ x(() => {
198
+ t.validations && t.validations.forEach((l) => {
199
+ l.RuleName === "Max" && (o.value = l.RuleParameter), l.RuleName === "Min" && (u.value = l.RuleParameter);
199
200
  });
200
201
  });
201
- const l = (i) => {
202
- a("update:modelValue", i), a("input", i);
203
- }, s = (i) => {
204
- a("update:modelValue", i), a("change", i);
202
+ const i = (l) => {
203
+ a("update:modelValue", l), a("input", l);
204
+ }, s = (l) => {
205
+ a("update:modelValue", l), a("change", l);
205
206
  };
206
- return (i, c) => {
207
- const r = V("AInputNumber");
208
- return p(), h(r, {
207
+ return (l, c) => {
208
+ const r = h("AInputNumber");
209
+ return p(), b(r, {
209
210
  "model-value": t.modelValue,
210
211
  clearable: "",
211
212
  disabled: t.readonly,
212
213
  min: u.value,
213
- max: n.value,
214
- onInput: l,
214
+ max: o.value,
215
+ onInput: i,
215
216
  onChange: s
216
217
  }, null, 8, ["model-value", "disabled", "min", "max"]);
217
218
  };
218
219
  }
219
- }), Y = /* @__PURE__ */ b({
220
+ }), J = /* @__PURE__ */ y({
220
221
  __name: "SelectList",
221
222
  props: {
222
223
  modelValue: {},
223
224
  config: {}
224
225
  },
225
226
  emits: ["update:modelValue", "change"],
226
- setup(e, { emit: o }) {
227
- const t = e, a = o, n = g(!1), u = g(t.config.options ?? []);
228
- I(async () => {
229
- u.value = await Le(t.config.DataSourceProvider);
227
+ setup(e, { emit: n }) {
228
+ const t = e, a = n, o = g(!1), u = g(t.config.options ?? []);
229
+ x(async () => {
230
+ u.value = await Ce(t.config.DataSourceProvider);
230
231
  });
231
- const s = (i) => {
232
- a("update:modelValue", i), a("change", i);
232
+ const s = (l) => {
233
+ a("update:modelValue", l), a("change", l);
233
234
  };
234
- return (i, c) => {
235
- const r = V("AOption"), f = V("ASelect");
236
- return p(), h(f, {
237
- "model-value": i.modelValue,
238
- loading: n.value,
235
+ return (l, c) => {
236
+ const r = h("AOption"), f = h("ASelect");
237
+ return p(), b(f, {
238
+ "model-value": l.modelValue,
239
+ loading: o.value,
239
240
  "filter-option": !0,
240
241
  "allow-search": !0,
241
242
  onChange: s
242
243
  }, {
243
- default: x(() => [
244
- (p(!0), v(R, null, S(u.value, (d) => (p(), h(r, {
244
+ default: $(() => [
245
+ (p(!0), v(S, null, L(u.value, (d) => (p(), b(r, {
245
246
  key: d.value,
246
247
  value: d.value,
247
248
  label: d.label
@@ -251,38 +252,38 @@ const Re = (e, o) => e.reduce((t, a) => t && Se(a, o), !0), Se = (e, o) => {
251
252
  }, 8, ["model-value", "loading"]);
252
253
  };
253
254
  }
254
- }), xe = /* @__PURE__ */ b({
255
+ }), Se = /* @__PURE__ */ y({
255
256
  __name: "Cascader",
256
257
  props: {
257
258
  modelValue: {},
258
259
  config: {}
259
260
  },
260
261
  emits: ["update:modelValue", "change"],
261
- setup(e, { emit: o }) {
262
- const t = e, a = o, n = g(t.config.options ?? []), u = (s) => {
262
+ setup(e, { emit: n }) {
263
+ const t = e, a = n, o = g(t.config.options ?? []), u = (s) => {
263
264
  a("update:modelValue", s), a("change", s);
264
265
  };
265
- I(async () => {
266
+ x(async () => {
266
267
  if (t.config) {
267
268
  const s = t.config.DataSourceProvider;
268
269
  if (s) {
269
- const c = await (await A()).get(s);
270
- n.value = c.data;
270
+ const c = await (await N()).get(s);
271
+ o.value = c.data;
271
272
  }
272
273
  }
273
274
  });
274
- const l = { value: "key", label: "value" };
275
- return (s, i) => {
276
- const c = V("ACascader"), r = V("ASpace");
277
- return p(), h(r, {
275
+ const i = { value: "key", label: "value" };
276
+ return (s, l) => {
277
+ const c = h("ACascader"), r = h("ASpace");
278
+ return p(), b(r, {
278
279
  direction: "vertical",
279
280
  size: "large"
280
281
  }, {
281
- default: x(() => [
282
- O(c, {
283
- "field-names": l,
282
+ default: $(() => [
283
+ I(c, {
284
+ "field-names": i,
284
285
  "model-value": s.modelValue,
285
- options: n.value,
286
+ options: o.value,
286
287
  style: { width: "320px" },
287
288
  placeholder: "Please select ...",
288
289
  onChange: u
@@ -292,49 +293,49 @@ const Re = (e, o) => e.reduce((t, a) => t && Se(a, o), !0), Se = (e, o) => {
292
293
  });
293
294
  };
294
295
  }
295
- }), Ae = /* @__PURE__ */ b({
296
+ }), Ie = /* @__PURE__ */ y({
296
297
  __name: "FileUpload",
297
298
  props: {
298
299
  config: {}
299
300
  },
300
301
  emits: ["update:modelValue", "change"],
301
- setup(e, { expose: o, emit: t }) {
302
- const a = e, n = t, u = "", l = g(null), s = g(0), i = g([]);
302
+ setup(e, { expose: n, emit: t }) {
303
+ const a = e, o = t, u = "", i = g(null), s = g(0), l = g([]);
303
304
  function c(d, m) {
304
305
  return d.replace(/{WorkflowId}/g, m);
305
306
  }
306
- const r = k(() => {
307
+ const r = V(() => {
307
308
  if (a.config.UploadURL) {
308
309
  const d = u + a.config.UploadURL;
309
310
  return c(d, s.value.toString());
310
311
  }
311
312
  return "";
312
313
  }), f = (d) => {
313
- n("change", d);
314
+ o("change", d);
314
315
  };
315
- return o({
316
+ return n({
316
317
  submit(d) {
317
- console.log("🚀 ~ submit ~ workflowId:", d), l.value && (a.config.UploadURL && (s.value = d), ie(() => {
318
- l.value.submit();
318
+ console.log("🚀 ~ submit ~ workflowId:", d), i.value && (a.config.UploadURL && (s.value = d), ne(() => {
319
+ i.value.submit();
319
320
  }));
320
321
  }
321
322
  }), (d, m) => {
322
- const C = V("a-upload");
323
- return p(), h(C, {
323
+ const C = h("a-upload");
324
+ return p(), b(C, {
324
325
  ref_key: "uploadRef",
325
- ref: l,
326
- modelValue: i.value,
327
- "onUpdate:modelValue": m[0] || (m[0] = (D) => i.value = D),
326
+ ref: i,
327
+ modelValue: l.value,
328
+ "onUpdate:modelValue": m[0] || (m[0] = (D) => l.value = D),
328
329
  "auto-upload": !1,
329
330
  action: r.value,
330
331
  onChange: f
331
332
  }, {
332
- "start-icon": x(() => m[1] || (m[1] = [])),
333
+ "start-icon": $(() => m[1] || (m[1] = [])),
333
334
  _: 1
334
335
  }, 8, ["modelValue", "action"]);
335
336
  };
336
337
  }
337
- }), De = /* @__PURE__ */ b({
338
+ }), Le = /* @__PURE__ */ y({
338
339
  __name: "TextArea",
339
340
  props: {
340
341
  modelValue: {},
@@ -343,28 +344,28 @@ const Re = (e, o) => e.reduce((t, a) => t && Se(a, o), !0), Se = (e, o) => {
343
344
  validations: {}
344
345
  },
345
346
  emits: ["update:modelValue", "change", "error", "input"],
346
- setup(e, { emit: o }) {
347
- const t = e, a = o, n = (l) => {
348
- a("update:modelValue", l), a("input", l);
349
- }, u = (l) => {
350
- a("update:modelValue", l), a("change", l);
347
+ setup(e, { emit: n }) {
348
+ const t = e, a = n, o = (i) => {
349
+ a("update:modelValue", i), a("input", i);
350
+ }, u = (i) => {
351
+ a("update:modelValue", i), a("change", i);
351
352
  };
352
- return (l, s) => {
353
- const i = V("ATextarea");
354
- return p(), h(i, {
353
+ return (i, s) => {
354
+ const l = h("ATextarea");
355
+ return p(), b(l, {
355
356
  "model-value": t.modelValue,
356
357
  placeholder: "Please enter something",
357
358
  "allow-clear": "",
358
359
  disabled: t.readonly,
359
- onInput: n,
360
+ onInput: o,
360
361
  onChange: u
361
362
  }, null, 8, ["model-value", "disabled"]);
362
363
  };
363
364
  }
364
- }), Ne = { class: "widget-wrapper" }, Pe = { class: "title mb-1.5" }, He = { class: "form-widget" }, Oe = { class: "widget" }, We = {
365
+ }), Ae = { class: "widget-wrapper" }, xe = { class: "title mb-1.5" }, Ne = { class: "form-widget" }, De = { class: "widget" }, He = {
365
366
  key: 0,
366
367
  class: "err-msg"
367
- }, Be = /* @__PURE__ */ b({
368
+ }, Pe = /* @__PURE__ */ y({
368
369
  __name: "index",
369
370
  props: {
370
371
  config: {},
@@ -373,48 +374,48 @@ const Re = (e, o) => e.reduce((t, a) => t && Se(a, o), !0), Se = (e, o) => {
373
374
  validations: {}
374
375
  },
375
376
  emits: ["update:modelValue", "change", "error"],
376
- setup(e, { expose: o, emit: t }) {
377
- const a = e, n = t, u = ee("widgetRef"), l = g(a.modelValue || a.config?.value);
378
- le(l, (m) => {
379
- n("update:modelValue", m);
377
+ setup(e, { expose: n, emit: t }) {
378
+ const a = e, o = t, u = Q("widgetRef"), i = g(a.modelValue || a.config?.value);
379
+ oe(i, (m) => {
380
+ o("update:modelValue", m);
380
381
  });
381
- const s = k(() => {
382
+ const s = V(() => {
382
383
  switch (a.config?.widget?.Widget) {
383
384
  case "TextBox":
384
- return X;
385
+ return q;
385
386
  case "Number":
386
- return Ie;
387
+ return Te;
387
388
  case "SelectList":
388
- return Y;
389
+ return J;
389
390
  case "Cascade":
390
- return xe;
391
+ return Se;
391
392
  case "File":
392
- return Ae;
393
+ return Ie;
393
394
  case "TextArea":
394
- return De;
395
+ return Le;
395
396
  case "DropDown":
396
- return Y;
397
+ return J;
397
398
  default:
398
- return X;
399
+ return q;
399
400
  }
400
- }), i = g(""), c = (m) => {
401
- i.value = m;
402
- }, r = (m) => n("change", m), f = (m) => n("update:modelValue", m);
401
+ }), l = g(""), c = (m) => {
402
+ l.value = m;
403
+ }, r = (m) => o("change", m), f = (m) => o("update:modelValue", m);
403
404
  function d() {
404
405
  return a.config?.widget?.Widget === "File";
405
406
  }
406
- return o({
407
+ return n({
407
408
  isFileUpload() {
408
409
  return a.config?.widget?.Widget === "File";
409
410
  },
410
411
  submit(m) {
411
412
  d() && u.value.submit(m);
412
413
  }
413
- }), (m, C) => (p(), v("div", Ne, [
414
- w("div", Pe, T(a?.config?.widget?.Title), 1),
415
- w("div", He, [
416
- w("div", Oe, [
417
- (p(), h(te(s.value), {
414
+ }), (m, C) => (p(), v("div", Ae, [
415
+ w("div", xe, A(a?.config?.widget?.Title), 1),
416
+ w("div", Ne, [
417
+ w("div", De, [
418
+ (p(), b(X(s.value), {
418
419
  ref_key: "widgetRef",
419
420
  ref: u,
420
421
  "model-value": a.modelValue,
@@ -425,177 +426,166 @@ const Re = (e, o) => e.reduce((t, a) => t && Se(a, o), !0), Se = (e, o) => {
425
426
  "onUpdate:modelValue": f
426
427
  }, null, 40, ["model-value", "config", "validations"]))
427
428
  ]),
428
- i.value.length > 0 ? (p(), v("div", We, T(i.value), 1)) : G("", !0)
429
+ l.value.length > 0 ? (p(), v("div", He, A(l.value), 1)) : F("", !0)
429
430
  ])
430
431
  ]));
431
432
  }
432
- }), E = (e, o) => {
433
+ }), E = (e, n) => {
433
434
  const t = e.__vccOpts || e;
434
- for (const [a, n] of o)
435
- t[a] = n;
435
+ for (const [a, o] of n)
436
+ t[a] = o;
436
437
  return t;
437
- }, oe = /* @__PURE__ */ E(Be, [["__scopeId", "data-v-bc0a480b"]]);
438
- var U = /* @__PURE__ */ ((e) => (e[e.Submit = 0] = "Submit", e[e.Link = 1] = "Link", e))(U || {});
439
- const Me = /* @__PURE__ */ b({
438
+ }, Z = /* @__PURE__ */ E(Pe, [["__scopeId", "data-v-bc0a480b"]]);
439
+ var R = /* @__PURE__ */ ((e) => (e[e.Submit = 0] = "Submit", e[e.Link = 1] = "Link", e))(R || {});
440
+ const Oe = /* @__PURE__ */ y({
440
441
  __name: "SubmitButton",
441
442
  props: {
442
443
  url: {},
443
444
  redirectType: {}
444
445
  },
445
446
  emits: ["click"],
446
- setup(e, { emit: o }) {
447
- const t = e, a = o;
448
- function n() {
449
- a("click", U.Submit, t.url, t.redirectType);
447
+ setup(e, { emit: n }) {
448
+ const t = e, a = n;
449
+ function o() {
450
+ a("click", R.Submit, t.url, t.redirectType);
450
451
  }
451
- return (u, l) => {
452
- const s = V("AButton");
453
- return p(), h(s, { onClick: n }, {
454
- default: x(() => [
455
- y(u.$slots, "default")
452
+ return (u, i) => {
453
+ const s = h("AButton");
454
+ return p(), b(s, { onClick: o }, {
455
+ default: $(() => [
456
+ k(u.$slots, "default")
456
457
  ]),
457
458
  _: 3
458
459
  });
459
460
  };
460
461
  }
461
- }), je = /* @__PURE__ */ b({
462
+ }), We = /* @__PURE__ */ y({
462
463
  __name: "DetailLink",
463
464
  props: {
464
465
  url: {},
465
466
  redirectType: {}
466
467
  },
467
468
  emits: ["click"],
468
- setup(e, { emit: o }) {
469
- const t = e, a = o;
470
- function n() {
471
- a("click", U.Link, t.url, t.redirectType);
469
+ setup(e, { emit: n }) {
470
+ const t = e, a = n;
471
+ function o() {
472
+ a("click", R.Link, t.url, t.redirectType);
472
473
  }
473
- return (u, l) => {
474
- const s = V("ALink");
475
- return p(), h(s, { onClick: n }, {
476
- default: x(() => [
477
- y(u.$slots, "default")
474
+ return (u, i) => {
475
+ const s = h("ALink");
476
+ return p(), b(s, { onClick: o }, {
477
+ default: $(() => [
478
+ k(u.$slots, "default")
478
479
  ]),
479
480
  _: 3
480
481
  });
481
482
  };
482
483
  }
483
- }), H = /* @__PURE__ */ b({
484
+ }), O = /* @__PURE__ */ y({
484
485
  __name: "index",
485
486
  props: {
486
487
  config: {}
487
488
  },
488
489
  emits: ["click"],
489
- setup(e, { emit: o }) {
490
- const t = e, a = o;
491
- function n(i, c, r) {
492
- a("click", i, c, r);
490
+ setup(e, { emit: n }) {
491
+ const t = e, a = n;
492
+ function o(l, c, r) {
493
+ a("click", l, c, r);
493
494
  }
494
- const u = k(() => {
495
+ const u = V(() => {
495
496
  switch (t.config.widget) {
496
497
  case "Submit":
497
- return Me;
498
+ return Oe;
498
499
  case "Link":
499
500
  default:
500
- return je;
501
+ return We;
501
502
  }
502
- }), l = k(() => t.config.widget === "Submit" ? t.config.requestUrl ?? "" : t.config.widget === "Link" ? t.config.redirectUrl ?? "" : ""), s = k(() => t.config.redirectType ?? "Details");
503
- return (i, c) => (p(), h(te(u.value), {
504
- url: l.value,
503
+ }), i = V(() => t.config.widget === "Submit" ? t.config.requestUrl ?? "" : t.config.widget === "Link" ? t.config.redirectUrl ?? "" : ""), s = V(() => t.config.redirectType ?? "Details");
504
+ return (l, c) => (p(), b(X(u.value), {
505
+ url: i.value,
505
506
  "redirect-type": s.value,
506
- onClick: n
507
+ onClick: o
507
508
  }, {
508
- default: x(() => [
509
- re(T(t.config.title), 1)
509
+ default: $(() => [
510
+ se(A(t.config.title), 1)
510
511
  ]),
511
512
  _: 1
512
513
  }, 8, ["url", "redirect-type"]));
513
514
  }
514
- }), Q = Symbol("router");
515
- function z() {
516
- const e = ce(Q);
517
- if (e)
518
- return e;
519
- const o = ue();
520
- return o?.appContext.app.config.globalProperties.$router ? o.appContext.app.config.globalProperties.$router : (console.warn("[Vue Component Library] Router not found. Using mock router. Please provide router using app.use(MyPlugin, { router }) or app.provide(RouterKey, router)"), {
521
- push: (t) => (console.warn("[Vue Component Library] Mock router.push called with:", t), Promise.resolve()),
522
- replace: (t) => (console.warn("[Vue Component Library] Mock router.replace called with:", t), Promise.resolve()),
523
- go: (t) => {
524
- console.warn("[Vue Component Library] Mock router.go called with:", t);
525
- },
526
- back: () => {
527
- console.warn("[Vue Component Library] Mock router.back called");
528
- },
529
- forward: () => {
530
- console.warn("[Vue Component Library] Mock router.forward called");
531
- }
532
- });
515
+ }), ee = Symbol("library-router");
516
+ function K() {
517
+ const e = le(ee, null);
518
+ return e || ce();
533
519
  }
534
- const Ke = { class: "page-container relative h-full" }, Ee = { class: "page-title p-4 bg-white" }, ze = { class: "title" }, Fe = { class: "page-content p-2" }, Ge = { class: "fields grid grid-cols-3 gap-8 bg-white p-4" }, qe = { class: "action-row absolute bottom-0 left-0 w-full bg-white p-4 flex justify-end" }, Je = /* @__PURE__ */ b({
520
+ const je = { class: "page-container relative h-full" }, Be = { class: "page-title p-4 bg-white" }, Ee = { class: "title" }, Ke = { class: "fields grid grid-cols-3 gap-8 bg-white p-4" }, ze = { class: "action-row absolute bottom-0 left-0 w-full bg-white p-4 flex justify-end" }, Fe = /* @__PURE__ */ y({
535
521
  __name: "CreateView",
536
522
  props: {
537
523
  className: {}
538
524
  },
539
525
  setup(e) {
540
- const o = z(), t = e, a = g(), n = k(() => a.value?.fields ? Object.entries(a.value.fields).map(([f, d]) => ({
526
+ const n = K(), t = e, a = g(), o = V(() => a.value?.fields ? Object.entries(a.value.fields).map(([f, d]) => ({
541
527
  fieldKey: f,
542
528
  ...d
543
- })).filter((f) => f.widget && f.widget.Widget !== "Hidden").sort((f, d) => (f.order ?? 0) - (d.order ?? 0)) : []), u = k(() => a.value?.actions ? [...a.value.actions].reverse() : []), l = W({}), s = g(!0), i = ee("dataWidgetsRef");
544
- I(async () => {
545
- s.value = !0, a.value = await K(j.Create, {
529
+ })).filter((f) => f.widget && f.widget.Widget !== "Hidden").sort((f, d) => (f.order ?? 0) - (d.order ?? 0)) : []), u = V(() => a.value?.actions ? [...a.value.actions].reverse() : []), i = W({}), s = g(!0), l = Q("dataWidgetsRef");
530
+ x(async () => {
531
+ s.value = !0, a.value = await B(j.Create, {
546
532
  className: t.className
547
533
  });
548
534
  for (const r in a.value.fields)
549
- l[r] = a.value.fields[r].value;
535
+ i[r] = a.value.fields[r].value;
550
536
  s.value = !1;
551
537
  });
552
538
  async function c(r, f, d) {
553
539
  switch (r) {
554
- case U.Submit:
555
- const m = await be(t.className, l, f);
556
- i.value?.filter((C) => {
540
+ case R.Submit:
541
+ const m = await ve(t.className, i, f);
542
+ l.value?.filter((C) => {
557
543
  C?.submit && C.submit(m);
558
- }), o.push({ name: "List" });
544
+ }), n.push({ name: "List" });
559
545
  break;
560
- case U.Link:
561
- d === "List" && o.push({ name: "List" });
546
+ case R.Link:
547
+ d === "List" && n.push({ name: "List" });
562
548
  break;
563
549
  default:
564
550
  console.warn("Unknown action type:", r);
565
551
  }
566
552
  }
567
553
  return (r, f) => {
568
- const d = B("loading");
569
- return p(), v("div", Ke, [
570
- w("div", Ee, [
571
- y(r.$slots, "title", {}, () => [
572
- w("div", ze, T(r.className) + " : Create", 1)
554
+ const d = h("a-spin");
555
+ return p(), v("div", je, [
556
+ w("div", Be, [
557
+ k(r.$slots, "title", {}, () => [
558
+ w("div", Ee, A(r.className) + " : Create", 1)
573
559
  ], !0)
574
560
  ]),
575
- M((p(), v("div", Fe, [
576
- w("div", Ge, [
577
- (p(!0), v(R, null, S(n.value, (m, C) => (p(), v("div", {
578
- key: m.fieldKey,
579
- class: "field"
580
- }, [
581
- O(oe, {
582
- ref_for: !0,
583
- ref_key: "dataWidgetsRef",
584
- ref: i,
585
- name: C,
586
- config: m,
587
- modelValue: l[m.fieldKey],
588
- "onUpdate:modelValue": (D) => l[m.fieldKey] = D
589
- }, null, 8, ["name", "config", "modelValue", "onUpdate:modelValue"])
590
- ]))), 128))
561
+ I(d, {
562
+ loading: s.value,
563
+ class: "page-content p-2"
564
+ }, {
565
+ default: $(() => [
566
+ w("div", Ke, [
567
+ (p(!0), v(S, null, L(o.value, (m, C) => (p(), v("div", {
568
+ key: m.fieldKey,
569
+ class: "field"
570
+ }, [
571
+ I(Z, {
572
+ ref_for: !0,
573
+ ref_key: "dataWidgetsRef",
574
+ ref: l,
575
+ name: C,
576
+ config: m,
577
+ modelValue: i[m.fieldKey],
578
+ "onUpdate:modelValue": (D) => i[m.fieldKey] = D
579
+ }, null, 8, ["name", "config", "modelValue", "onUpdate:modelValue"])
580
+ ]))), 128))
581
+ ]),
582
+ k(r.$slots, "content", {}, void 0, !0)
591
583
  ]),
592
- y(r.$slots, "content", {}, void 0, !0)
593
- ])), [
594
- [d, s.value]
595
- ]),
596
- w("div", qe, [
597
- y(r.$slots, "action", {}, void 0, !0),
598
- (p(!0), v(R, null, S(u.value, (m) => (p(), h(H, {
584
+ _: 3
585
+ }, 8, ["loading"]),
586
+ w("div", ze, [
587
+ k(r.$slots, "action", {}, void 0, !0),
588
+ (p(!0), v(S, null, L(u.value, (m) => (p(), b(O, {
599
589
  key: m.Title,
600
590
  config: m,
601
591
  class: "action",
@@ -605,136 +595,144 @@ const Ke = { class: "page-container relative h-full" }, Ee = { class: "page-titl
605
595
  ]);
606
596
  };
607
597
  }
608
- }), Qe = /* @__PURE__ */ E(Je, [["__scopeId", "data-v-cfe5b53b"]]), Xe = { class: "page-container relative h-full" }, Ye = { class: "page-title p-4 bg-white" }, Ze = { class: "title" }, et = { class: "page-content p-2" }, tt = { class: "fields grid grid-cols-3 gap-8 bg-white p-4" }, at = { class: "action-row absolute bottom-0 left-0 w-full bg-white p-4 flex justify-end" }, ot = /* @__PURE__ */ b({
598
+ }), Me = /* @__PURE__ */ E(Fe, [["__scopeId", "data-v-48017fe8"]]), Ge = { class: "page-container relative h-full" }, qe = { class: "page-title p-4 bg-white" }, Je = { class: "title" }, Qe = { class: "fields grid grid-cols-3 gap-8 bg-white p-4" }, Xe = { class: "action-row absolute bottom-0 left-0 w-full bg-white p-4 flex justify-end" }, Ye = /* @__PURE__ */ y({
609
599
  __name: "UpdateView",
610
600
  props: {
611
601
  className: {},
612
602
  workflowId: {}
613
603
  },
614
604
  setup(e) {
615
- const o = z(), t = e, a = g(), n = k(() => a.value?.fields ? Object.entries(a.value.fields).map(([r, f]) => ({
605
+ const n = K(), t = e, a = g(), o = V(() => a.value?.fields ? Object.entries(a.value.fields).map(([r, f]) => ({
616
606
  fieldKey: r,
617
607
  ...f
618
- })).filter((r) => r.widget && r.widget.Widget !== "Hidden").sort((r, f) => (r.order ?? 0) - (f.order ?? 0)) : []), u = k(() => a.value?.actions ? [...a.value.actions].reverse() : []), l = W({}), s = g(!0);
619
- I(async () => {
620
- s.value = !0, a.value = await K(j.Update, {
608
+ })).filter((r) => r.widget && r.widget.Widget !== "Hidden").sort((r, f) => (r.order ?? 0) - (f.order ?? 0)) : []), u = V(() => a.value?.actions ? [...a.value.actions].reverse() : []), i = W({}), s = g(!0);
609
+ x(async () => {
610
+ s.value = !0, a.value = await B(j.Update, {
621
611
  workflowId: t.workflowId,
622
612
  className: t.className
623
613
  });
624
614
  for (const c in a.value.fields)
625
- l[c] = a.value.fields[c].value;
615
+ i[c] = a.value.fields[c].value;
626
616
  s.value = !1;
627
617
  });
628
- async function i(c, r, f) {
618
+ async function l(c, r, f) {
629
619
  switch (c) {
630
- case U.Submit:
631
- await ke(t.className, t.workflowId, l, r), o.push({ name: "List" });
620
+ case R.Submit:
621
+ await he(t.className, t.workflowId, i, r), n.push({ name: "List" });
632
622
  break;
633
- case U.Link:
634
- f === "List" && o.push({ name: "List" });
623
+ case R.Link:
624
+ f === "List" && n.push({ name: "List" });
635
625
  break;
636
626
  default:
637
627
  console.warn("Unknown action type:", c);
638
628
  }
639
629
  }
640
630
  return (c, r) => {
641
- const f = B("loading");
642
- return p(), v("div", Xe, [
643
- w("div", Ye, [
644
- y(c.$slots, "title", {}, () => [
645
- w("div", Ze, T(c.className) + " : Update", 1)
631
+ const f = h("a-spin");
632
+ return p(), v("div", Ge, [
633
+ w("div", qe, [
634
+ k(c.$slots, "title", {}, () => [
635
+ w("div", Je, A(c.className) + " : Update", 1)
646
636
  ], !0)
647
637
  ]),
648
- M((p(), v("div", et, [
649
- w("div", tt, [
650
- (p(!0), v(R, null, S(n.value, (d, m) => (p(), v("div", {
651
- key: d.fieldKey,
652
- class: "field"
653
- }, [
654
- O(oe, {
655
- name: m,
656
- config: d,
657
- modelValue: l[d.fieldKey],
658
- "onUpdate:modelValue": (C) => l[d.fieldKey] = C
659
- }, null, 8, ["name", "config", "modelValue", "onUpdate:modelValue"])
660
- ]))), 128))
638
+ I(f, {
639
+ loading: s.value,
640
+ class: "page-content p-2"
641
+ }, {
642
+ default: $(() => [
643
+ w("div", Qe, [
644
+ (p(!0), v(S, null, L(o.value, (d, m) => (p(), v("div", {
645
+ key: d.fieldKey,
646
+ class: "field"
647
+ }, [
648
+ I(Z, {
649
+ name: m,
650
+ config: d,
651
+ modelValue: i[d.fieldKey],
652
+ "onUpdate:modelValue": (C) => i[d.fieldKey] = C
653
+ }, null, 8, ["name", "config", "modelValue", "onUpdate:modelValue"])
654
+ ]))), 128))
655
+ ]),
656
+ k(c.$slots, "content", {}, void 0, !0)
661
657
  ]),
662
- y(c.$slots, "content", {}, void 0, !0)
663
- ])), [
664
- [f, s.value]
665
- ]),
666
- w("div", at, [
667
- y(c.$slots, "action", {}, void 0, !0),
668
- (p(!0), v(R, null, S(u.value, (d) => (p(), h(H, {
658
+ _: 3
659
+ }, 8, ["loading"]),
660
+ w("div", Xe, [
661
+ k(c.$slots, "action", {}, void 0, !0),
662
+ (p(!0), v(S, null, L(u.value, (d) => (p(), b(O, {
669
663
  key: d.Title,
670
664
  config: d,
671
- data: l,
665
+ data: i,
672
666
  class: "action",
673
- onClick: i
667
+ onClick: l
674
668
  }, null, 8, ["config", "data"]))), 128))
675
669
  ])
676
670
  ]);
677
671
  };
678
672
  }
679
- }), nt = /* @__PURE__ */ E(ot, [["__scopeId", "data-v-38b39a5f"]]), st = { class: "page-container relative h-full" }, it = { class: "page-title p-4 bg-white" }, lt = { class: "title" }, rt = { class: "page-content p-2" }, ct = { class: "bg-white" }, ut = { class: "action-row absolute bottom-0 left-0 w-full bg-white p-4 flex justify-end" }, dt = /* @__PURE__ */ b({
673
+ }), Ze = /* @__PURE__ */ E(Ye, [["__scopeId", "data-v-73c3a6e5"]]), et = { class: "page-container relative h-full" }, tt = { class: "page-title p-4 bg-white" }, at = { class: "title" }, nt = { class: "bg-white" }, ot = { class: "action-row absolute bottom-0 left-0 w-full bg-white p-4 flex justify-end" }, st = /* @__PURE__ */ y({
680
674
  __name: "DetailView",
681
675
  props: {
682
676
  className: {},
683
677
  workflowId: {}
684
678
  },
685
679
  setup(e) {
686
- const o = z(), t = e, a = g();
687
- k(() => a.value?.fields ? Object.entries(a.value.fields).map(([c, r]) => ({
680
+ const n = K(), t = e, a = g();
681
+ V(() => a.value?.fields ? Object.entries(a.value.fields).map(([c, r]) => ({
688
682
  fieldKey: c,
689
683
  ...r
690
684
  })).filter((c) => c.widget && c.widget.Widget !== "Hidden").sort((c, r) => (c.order ?? 0) - (r.order ?? 0)) : []);
691
- const n = k(() => a.value?.actions ? [...a.value.actions].reverse() : []), u = W([]), l = g(!0);
692
- I(async () => {
693
- l.value = !0, a.value = await K(j.Details, {
685
+ const o = V(() => a.value?.actions ? [...a.value.actions].reverse() : []), u = W([]), i = g(!0);
686
+ x(async () => {
687
+ i.value = !0, a.value = await B(j.Details, {
694
688
  workflowId: t.workflowId,
695
689
  className: t.className
696
690
  });
697
- for (const [i, c] of Object.entries(a.value.fields))
691
+ for (const [l, c] of Object.entries(a.value.fields))
698
692
  u.push({
699
- label: i,
693
+ label: l,
700
694
  value: c.value
701
695
  });
702
- l.value = !1;
696
+ i.value = !1;
703
697
  });
704
- function s(i, c, r) {
705
- switch (i) {
706
- case U.Submit:
707
- Ue(t.className, t.workflowId, J.ApproverEmail(), "", u, c), o.push({ name: "List" });
698
+ function s(l, c, r) {
699
+ switch (l) {
700
+ case R.Submit:
701
+ Ve(t.className, t.workflowId, G.ApproverEmail(), "", u, c), n.push({ name: "List" });
708
702
  break;
709
- case U.Link:
710
- r === "List" && o.push({ name: "List" });
703
+ case R.Link:
704
+ r === "List" && n.push({ name: "List" });
711
705
  break;
712
706
  default:
713
- console.warn("Unknown action type:", i);
707
+ console.warn("Unknown action type:", l);
714
708
  }
715
709
  }
716
- return (i, c) => {
717
- const r = V("a-descriptions"), f = B("loading");
718
- return p(), v("div", st, [
719
- w("div", it, [
720
- y(i.$slots, "title", {}, () => [
721
- w("div", lt, T(i.className) + " : Approve", 1)
710
+ return (l, c) => {
711
+ const r = h("a-descriptions"), f = h("a-spin");
712
+ return p(), v("div", et, [
713
+ w("div", tt, [
714
+ k(l.$slots, "title", {}, () => [
715
+ w("div", at, A(l.className) + " : Approve", 1)
722
716
  ], !0)
723
717
  ]),
724
- M((p(), v("div", rt, [
725
- w("div", ct, [
726
- O(r, {
727
- data: u,
728
- layout: "inline-vertical"
729
- }, null, 8, ["data"])
718
+ I(f, {
719
+ loading: i.value,
720
+ class: "page-content p-2"
721
+ }, {
722
+ default: $(() => [
723
+ w("div", nt, [
724
+ I(r, {
725
+ data: u,
726
+ layout: "inline-vertical"
727
+ }, null, 8, ["data"])
728
+ ]),
729
+ k(l.$slots, "content", {}, void 0, !0)
730
730
  ]),
731
- y(i.$slots, "content", {}, void 0, !0)
732
- ])), [
733
- [f, l.value]
734
- ]),
735
- w("div", ut, [
736
- y(i.$slots, "action", {}, void 0, !0),
737
- (p(!0), v(R, null, S(n.value, (d) => (p(), h(H, {
731
+ _: 3
732
+ }, 8, ["loading"]),
733
+ w("div", ot, [
734
+ k(l.$slots, "action", {}, void 0, !0),
735
+ (p(!0), v(S, null, L(o.value, (d) => (p(), b(O, {
738
736
  key: d.Title,
739
737
  config: d,
740
738
  data: u,
@@ -745,142 +743,134 @@ const Ke = { class: "page-container relative h-full" }, Ee = { class: "page-titl
745
743
  ]);
746
744
  };
747
745
  }
748
- }), pt = /* @__PURE__ */ E(dt, [["__scopeId", "data-v-ebd4094c"]]), mt = { class: "page-container relative h-full" }, ft = { class: "page-title p-4 bg-white" }, gt = { class: "title" }, vt = { class: "page-conteont p-2" }, _t = /* @__PURE__ */ b({
746
+ }), lt = /* @__PURE__ */ E(st, [["__scopeId", "data-v-e77c8eef"]]), it = { class: "page-container relative h-full" }, rt = { class: "page-title p-4 bg-white" }, ct = { class: "title" }, ut = /* @__PURE__ */ y({
749
747
  __name: "ListView",
750
748
  props: {
751
749
  className: {}
752
750
  },
753
751
  setup(e) {
754
- const o = z(), t = e, a = g(), n = W({
752
+ const n = K(), t = e, a = g(), o = W({
755
753
  current: 1,
756
754
  total: 0,
757
755
  pageSize: 20,
758
756
  defaultPageSize: 20,
759
757
  showTotal: !0,
760
758
  showPageSize: !0
761
- }), u = k(() => ({
762
- PageNumber: n.current - 1,
763
- PageSize: n.pageSize,
759
+ }), u = V(() => ({
760
+ PageNumber: o.current - 1,
761
+ PageSize: o.pageSize,
764
762
  Filters: [],
765
763
  Sorts: []
766
- })), l = g([]), s = g([]), i = g(!0), c = g(!0), r = g(), f = (_) => {
767
- console.log(_), l.value = Object.entries(_).filter(([, $]) => $.widget?.column).map(([$, L]) => ({
768
- title: L.widget.Title,
769
- dataIndex: $.charAt(0).toLowerCase() + $.slice(1),
770
- order: L.order
771
- })).sort(($, L) => $.order - L.order), l.value.push({
764
+ })), i = g([]), s = g([]), l = g(!0), c = g(!0), r = g(), f = (_) => {
765
+ console.log(_), i.value = Object.entries(_).filter(([, U]) => U.widget?.column).map(([U, T]) => ({
766
+ title: T.widget.Title,
767
+ dataIndex: U.charAt(0).toLowerCase() + U.slice(1),
768
+ order: T.order
769
+ })).sort((U, T) => U.order - T.order), i.value.push({
772
770
  title: "Actions",
773
771
  slotName: "optional"
774
772
  });
775
773
  }, d = async () => {
776
774
  c.value = !0;
777
- const _ = await he(t.className, u.value);
778
- s.value = _.data, n.total = _.totalCount, r.value = _.actions, c.value = !1;
775
+ const _ = await _e(t.className, u.value);
776
+ s.value = _.data, o.total = _.totalCount, r.value = _.actions, c.value = !1;
779
777
  };
780
- I(async () => {
781
- i.value = !0, a.value = await K(3, {
778
+ x(async () => {
779
+ l.value = !0, a.value = await B(3, {
782
780
  className: t.className
783
- }), f(a.value.fields), i.value = !1, d();
781
+ }), f(a.value.fields), l.value = !1, d();
784
782
  });
785
783
  const m = (_) => {
786
- n.current = _, d();
784
+ o.current = _, d();
787
785
  }, C = (_) => {
788
- n.pageSize = _, d();
786
+ o.pageSize = _, d();
789
787
  };
790
- function D(_, $, L, F) {
788
+ function D(_, U, T, z) {
791
789
  switch (_) {
792
- case U.Link:
793
- o.push({ name: L, params: { workflowId: F } });
790
+ case R.Link:
791
+ n.push({ name: T, params: { workflowId: z } });
794
792
  break;
795
793
  default:
796
794
  console.warn("Unknown action type:", _);
797
795
  }
798
796
  }
799
- function ne(_, $, L) {
797
+ function te(_, U, T) {
800
798
  switch (_) {
801
- case U.Link:
802
- o.push({ name: L });
799
+ case R.Link:
800
+ n.push({ name: T });
803
801
  break;
804
802
  default:
805
803
  console.warn("Unknown action type:", _);
806
804
  }
807
805
  }
808
- return (_, $) => {
809
- const L = V("ATable"), F = B("loading");
810
- return p(), v("div", mt, [
811
- w("div", ft, [
812
- y(_.$slots, "title", {}, () => [
813
- w("div", gt, T(_.className) + " : List", 1),
814
- (p(!0), v(R, null, S(r.value, (N) => (p(), v(R, {
815
- key: N.title
806
+ return (_, U) => {
807
+ const T = h("ATable"), z = h("a-spin");
808
+ return p(), v("div", it, [
809
+ w("div", rt, [
810
+ k(_.$slots, "title", {}, () => [
811
+ w("div", ct, A(_.className) + " : List", 1),
812
+ (p(!0), v(S, null, L(r.value, (H) => (p(), v(S, {
813
+ key: H.title
816
814
  }, [
817
- N.location === "InOperation" ? (p(), h(H, {
815
+ H.location === "InOperation" ? (p(), b(O, {
818
816
  key: 0,
819
- config: N,
817
+ config: H,
820
818
  class: "action",
821
- onClick: $[0] || ($[0] = (...P) => ne(...P))
822
- }, null, 8, ["config"])) : G("", !0)
819
+ onClick: U[0] || (U[0] = (...P) => te(...P))
820
+ }, null, 8, ["config"])) : F("", !0)
823
821
  ], 64))), 128))
824
822
  ])
825
823
  ]),
826
- M((p(), v("div", vt, [
827
- y(_.$slots, "content", {}, () => [
828
- O(L, {
829
- columns: l.value,
830
- data: s.value,
831
- stripe: "",
832
- border: "",
833
- "page-position": "bl",
834
- pagination: n,
835
- loading: c.value,
836
- onPageChange: m,
837
- onPageSizeChange: C
838
- }, {
839
- optional: x(({ record: N }) => [
840
- (p(!0), v(R, null, S(r.value, (P) => (p(), v(R, {
841
- key: P.title
842
- }, [
843
- P.location === "InTable" ? (p(), h(H, {
844
- key: 0,
845
- config: P,
846
- class: "action",
847
- onClick: (...se) => D(...se, N.workflowId)
848
- }, null, 8, ["config", "onClick"])) : G("", !0)
849
- ], 64))), 128))
850
- ]),
851
- _: 1
852
- }, 8, ["columns", "data", "pagination", "loading"])
853
- ])
854
- ])), [
855
- [F, i.value]
856
- ])
824
+ I(z, {
825
+ loading: l.value,
826
+ class: "page-conteont p-2"
827
+ }, {
828
+ default: $(() => [
829
+ k(_.$slots, "content", {}, () => [
830
+ I(T, {
831
+ columns: i.value,
832
+ data: s.value,
833
+ stripe: "",
834
+ border: "",
835
+ "page-position": "bl",
836
+ pagination: o,
837
+ loading: c.value,
838
+ onPageChange: m,
839
+ onPageSizeChange: C
840
+ }, {
841
+ optional: $(({ record: H }) => [
842
+ (p(!0), v(S, null, L(r.value, (P) => (p(), v(S, {
843
+ key: P.title
844
+ }, [
845
+ P.location === "InTable" ? (p(), b(O, {
846
+ key: 0,
847
+ config: P,
848
+ class: "action",
849
+ onClick: (...ae) => D(...ae, H.workflowId)
850
+ }, null, 8, ["config", "onClick"])) : F("", !0)
851
+ ], 64))), 128))
852
+ ]),
853
+ _: 1
854
+ }, 8, ["columns", "data", "pagination", "loading"])
855
+ ])
856
+ ]),
857
+ _: 3
858
+ }, 8, ["loading"])
857
859
  ]);
858
860
  };
859
861
  }
860
- }), Z = Symbol("pinia"), yt = {
861
- install(e, o = {}) {
862
- if (o.router)
863
- e.provide(Q, o.router);
864
- else {
865
- const t = e.config.globalProperties.$router;
866
- t ? e.provide(Q, t) : console.warn("[Vue Component Library] Router not provided. Some features may not work. Please provide router using app.use(MyPlugin, { router })");
867
- }
868
- if (o.pinia)
869
- e.provide(Z, o.pinia);
870
- else {
871
- const t = e.config.globalProperties.$pinia;
872
- t ? e.provide(Z, t) : console.warn("[Vue Component Library] Pinia not provided. Some features may not work. Please provide pinia using app.use(MyPlugin, { pinia })");
873
- }
874
- e.component("CreateView", Qe), e.component("UpdateView", nt), e.component("DetailView", pt), e.component("ListView", _t);
862
+ }), dt = Symbol("library-pinia"), _t = {
863
+ install(e, n = {}) {
864
+ n.router && e.provide(ee, n.router), n.pinia && e.provide(dt, n.pinia), e.component("CreateView", Me), e.component("UpdateView", Ze), e.component("DetailView", lt), e.component("ListView", ut);
875
865
  }
876
866
  };
877
867
  export {
878
- Qe as CreateView,
879
- pt as DetailView,
880
- _t as ListView,
881
- Z as PiniaKey,
882
- Q as RouterKey,
883
- nt as UpdateView,
884
- yt as default
868
+ Me as CreateView,
869
+ lt as DetailView,
870
+ ut as ListView,
871
+ dt as PiniaKey,
872
+ ee as RouterKey,
873
+ Ze as UpdateView,
874
+ _t as default
885
875
  };
886
876
  //# sourceMappingURL=index.es.js.map