@web-utils/form-ui 1.0.0-beta21 → 1.0.0-beta23

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.
Files changed (122) hide show
  1. package/api/index.d.ts +60 -0
  2. package/api/index.mjs +42 -0
  3. package/awesome-button/index.d.ts +60 -0
  4. package/awesome-button/index.mjs +49 -0
  5. package/chunks/{Bv-Gn_Jd.mjs → 3VI058Yv.mjs} +6 -6
  6. package/chunks/{D4v0MyB_.mjs → B-Y8YSMp.mjs} +6 -6
  7. package/chunks/BIm5rmJm.mjs +222 -0
  8. package/chunks/{CI4RZnNc.mjs → BcMgzZyZ.mjs} +3 -3
  9. package/chunks/{iWlTrkaC.mjs → Bw1QPGNc.mjs} +6 -6
  10. package/chunks/{C4MTLHn4.mjs → BwuQhCIf.mjs} +3 -3
  11. package/chunks/BzMaCcUd.mjs +53 -0
  12. package/chunks/{wfL1FAwc.mjs → C2RhdxHB.mjs} +354 -354
  13. package/chunks/{BI2XOQW3.mjs → CH7m94ce.mjs} +7 -7
  14. package/chunks/{BNpqILFO.mjs → CJv6Sn_v.mjs} +6 -6
  15. package/chunks/{Dq3yxEPg.mjs → Cnmu4eY-.mjs} +1 -1
  16. package/chunks/{BbrVRWUo.mjs → CozfnlhM.mjs} +7 -7
  17. package/chunks/{CnsFNU2A.mjs → Cp9FIjnh.mjs} +1 -1
  18. package/chunks/{1chbbDUh.mjs → CwjQbaXJ.mjs} +15 -15
  19. package/chunks/Cxvr9Z1r.mjs +208 -0
  20. package/chunks/{Bd1I-R29.mjs → D4Pknq4r.mjs} +10 -10
  21. package/chunks/{DGhMkri0.mjs → DBL23JPA.mjs} +6 -6
  22. package/chunks/DETsVUo_.mjs +93 -0
  23. package/chunks/DOl--Hf9.mjs +107 -0
  24. package/chunks/{B5B9au3z.mjs → DP1YukLf.mjs} +25 -25
  25. package/chunks/{DRDj0e_k.mjs → DbBdLuvW.mjs} +8 -8
  26. package/chunks/DpH8CVbN.mjs +79 -0
  27. package/chunks/{5HLN3g1u.mjs → ENc67_lM.mjs} +9 -9
  28. package/chunks/{Dy5-h_Tx.mjs → INlqdzng.mjs} +15 -15
  29. package/chunks/{DOI7ju3i.mjs → dDAvzX4k.mjs} +6 -6
  30. package/chunks/eR-FlUht.mjs +110 -0
  31. package/chunks/{BLpnMrum.mjs → rkRnszQn.mjs} +18 -18
  32. package/chunks/{RcygoTkQ.mjs → tIzKZ11j.mjs} +3 -3
  33. package/chunks/y8u4cMEF.mjs +216 -0
  34. package/confirm-button/index.d.ts +71 -0
  35. package/confirm-button/index.mjs +35 -0
  36. package/confirmable/index.d.ts +42 -0
  37. package/confirmable/index.mjs +8 -0
  38. package/{constants.mjs → constants/index.mjs} +1 -1
  39. package/element-dialog/index.d.ts +5 -5
  40. package/element-dialog/index.mjs +1 -1
  41. package/empty-view/index.d.ts +2 -2
  42. package/empty-view/index.mjs +1 -1
  43. package/flex-scroll-area/index.d.ts +1 -1
  44. package/flex-scroll-area/index.mjs +1 -1
  45. package/form-advice/index.mjs +1 -1
  46. package/form-button/index.d.ts +72 -0
  47. package/form-button/index.mjs +36 -0
  48. package/form-cascader/index.d.ts +483 -1
  49. package/form-cascader/index.mjs +2 -10
  50. package/form-check-box-group/index.d.ts +17 -17
  51. package/form-check-box-group/index.mjs +1 -1
  52. package/form-checkbox/index.d.ts +22 -22
  53. package/form-checkbox/index.mjs +1 -1
  54. package/form-date-picker/index.d.ts +26 -26
  55. package/form-date-picker/index.mjs +1 -1
  56. package/form-holder/index.d.ts +3 -3
  57. package/form-holder/index.mjs +1 -1
  58. package/form-image/index.d.ts +14 -14
  59. package/form-image/index.mjs +1 -1
  60. package/form-input/index.d.ts +19 -19
  61. package/form-input/index.mjs +1 -1
  62. package/form-input-cron-expression/index.d.ts +14 -14
  63. package/form-input-cron-expression/index.mjs +1 -1
  64. package/form-input-email/index.d.ts +18 -18
  65. package/form-input-email/index.mjs +1 -1
  66. package/form-input-id-card/index.d.ts +18 -18
  67. package/form-input-id-card/index.mjs +1 -1
  68. package/form-input-number/index.d.ts +17 -17
  69. package/form-input-number/index.mjs +1 -1
  70. package/form-input-phone-number/index.d.ts +18 -18
  71. package/form-input-phone-number/index.mjs +1 -1
  72. package/form-item-config-provider/index.d.ts +3 -3
  73. package/form-item-config-provider/index.mjs +1 -1
  74. package/form-item-group/index.d.ts +5 -3
  75. package/form-item-group/index.mjs +1 -1
  76. package/form-item-x/index.d.ts +12 -12
  77. package/form-item-x/index.mjs +1 -1
  78. package/form-radio-group/index.d.ts +19 -19
  79. package/form-radio-group/index.mjs +1 -1
  80. package/form-rate/index.d.ts +15 -15
  81. package/form-rate/index.mjs +1 -1
  82. package/form-red-table/index.mjs +13 -13
  83. package/form-row/index.d.ts +2 -2
  84. package/form-row/index.mjs +1 -1
  85. package/form-select/index.d.ts +33 -33
  86. package/form-select/index.mjs +1 -1
  87. package/form-slider/index.d.ts +17 -17
  88. package/form-slider/index.mjs +1 -1
  89. package/form-switch/index.d.ts +23 -23
  90. package/form-switch/index.mjs +1 -1
  91. package/form-text/index.d.ts +15 -15
  92. package/form-text/index.mjs +1 -1
  93. package/helper/dictionary.d.ts +15 -0
  94. package/helper/dictionary.mjs +97 -0
  95. package/hook/useDictionary.d.ts +60 -0
  96. package/hook/useDictionary.mjs +15 -0
  97. package/iframe-window/index.d.ts +9 -0
  98. package/iframe-window/index.mjs +37 -0
  99. package/iframe-window/style.css +1 -0
  100. package/index.d.ts +6 -1
  101. package/index.mjs +45 -40
  102. package/month-calendar/index.d.ts +2 -2
  103. package/month-calendar/index.mjs +1 -1
  104. package/package.json +1 -1
  105. package/{resolver.mjs → resolver/index.mjs} +2 -2
  106. package/toolbar/index.d.ts +128 -1
  107. package/toolbar/index.mjs +1 -8
  108. package/toolbar/style.css +1 -0
  109. package/toolbar-button/index.d.ts +76 -1
  110. package/toolbar-button/index.mjs +1 -8
  111. package/vue-cron/index.d.ts +2 -2
  112. package/vue-cron/index.mjs +1 -1
  113. package/web-types.json +1 -1
  114. package/year-calendar/index.d.ts +2 -2
  115. package/year-calendar/index.mjs +1 -1
  116. package/chunks/Bb43eI1f.mjs +0 -93
  117. package/chunks/Bh_CMUlo.mjs +0 -12
  118. package/chunks/Cw8pz9hK.mjs +0 -222
  119. package/chunks/lTFu0zgR.mjs +0 -106
  120. /package/chunks/{D9GcEl6r.mjs → DJNXk_Cv.mjs} +0 -0
  121. /package/{constants.d.ts → constants/index.d.ts} +0 -0
  122. /package/{resolver.d.ts → resolver/index.d.ts} +0 -0
@@ -1,7 +1,7 @@
1
- import { i as e, n as t } from "./Cw8pz9hK.mjs";
2
- import { n } from "./CnsFNU2A.mjs";
3
- import { ElOption as r, ElSelect as i } from "element-plus/es";
4
- import { createVNode as a, mergeProps as o, useModel as s } from "vue";
1
+ import { i as e, n as t } from "./BIm5rmJm.mjs";
2
+ import { n } from "./Cp9FIjnh.mjs";
3
+ import { createVNode as r, mergeProps as i, useModel as a } from "vue";
4
+ import { ElOption as o, ElSelect as s } from "element-plus/es";
5
5
  //#region src/components/form/props/select.js
6
6
  var c = {
7
7
  ...n,
@@ -196,7 +196,7 @@ var c = {
196
196
  "popup-scroll": null
197
197
  },
198
198
  setup(t, { emit: n, slots: c, attrs: l }) {
199
- let f = s(t, "modelValue"), { render: p, placeholder: m, disabled: h, autoBind: g } = e(t, {
199
+ let f = a(t, "modelValue"), { render: p, placeholder: m, disabled: h, autoBind: g } = e(t, {
200
200
  emit: n,
201
201
  slots: c,
202
202
  attrs: l,
@@ -204,7 +204,7 @@ var c = {
204
204
  predicate: d,
205
205
  messagePrefix: "请选择"
206
206
  });
207
- return () => p({ vNodes: a(i, o(g.value, {
207
+ return () => p({ vNodes: r(s, i(g.value, {
208
208
  modelValue: f.value,
209
209
  "onUpdate:modelValue": (e) => f.value = e,
210
210
  disabled: h.value,
@@ -213,7 +213,7 @@ var c = {
213
213
  ...c,
214
214
  default: c.default || (() => {
215
215
  var e;
216
- return (e = t.options) == null ? void 0 : e.map(({ value: e, label: t }) => a(r, {
216
+ return (e = t.options) == null ? void 0 : e.map(({ value: e, label: t }) => r(o, {
217
217
  key: e,
218
218
  label: t,
219
219
  value: e
@@ -1,7 +1,7 @@
1
- import { i as e, n as t } from "./Cw8pz9hK.mjs";
2
- import { n } from "./CnsFNU2A.mjs";
3
- import { ElSlider as r } from "element-plus/es";
4
- import { createVNode as i, mergeProps as a, useModel as o } from "vue";
1
+ import { i as e, n as t } from "./BIm5rmJm.mjs";
2
+ import { n } from "./Cp9FIjnh.mjs";
3
+ import { createVNode as r, mergeProps as i, useModel as a } from "vue";
4
+ import { ElSlider as o } from "element-plus/es";
5
5
  //#region src/components/form/props/slide.js
6
6
  var s = {
7
7
  ...n,
@@ -77,14 +77,14 @@ var s = {
77
77
  input: null
78
78
  },
79
79
  setup(t, { emit: n, slots: s, attrs: c }) {
80
- let d = o(t, "modelValue"), { render: f, disabled: p, autoBind: m } = e(t, {
80
+ let d = a(t, "modelValue"), { render: f, disabled: p, autoBind: m } = e(t, {
81
81
  emit: n,
82
82
  slots: s,
83
83
  events: l,
84
84
  predicate: u,
85
85
  attrs: c
86
86
  });
87
- return () => f({ vNodes: i(r, a(m.value, {
87
+ return () => f({ vNodes: r(o, i(m.value, {
88
88
  modelValue: d.value,
89
89
  "onUpdate:modelValue": (e) => d.value = e,
90
90
  disabled: p.value
@@ -1,4 +1,4 @@
1
- import { n as e, t } from "./CnsFNU2A.mjs";
1
+ import { n as e, t } from "./Cp9FIjnh.mjs";
2
2
  //#region src/components/form/props/input.js
3
3
  var n = {
4
4
  ...e,
@@ -1,9 +1,9 @@
1
- import { i as e, n as t, t as n } from "./Cw8pz9hK.mjs";
2
- import { n as r, r as i, t as a } from "./Dq3yxEPg.mjs";
3
- import { ElInput as o } from "element-plus/es";
1
+ import { i as e, n as t, t as n } from "./BIm5rmJm.mjs";
2
+ import { n as r, r as i, t as a } from "./Cnmu4eY-.mjs";
3
+ import { validatePhoneNum as o } from "@web-utils/core";
4
4
  import { computed as s, createVNode as c, mergeProps as l, useModel as u } from "vue";
5
- import { validatePhoneNum as d } from "@web-utils/core";
6
- //#region src/util/form-validate.js
5
+ import { ElInput as d } from "element-plus/es";
6
+ //#region src/utils/form-validate.js
7
7
  var f = (e, t, n) => t && !/^[A-Za-z0-9\u4e00-\u9fa5_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/.test(t) ? n(/* @__PURE__ */ Error("invalid")) : n();
8
8
  function p(e, t, n) {
9
9
  t && !/^[1-9][0-9]{5}(18|19|(2[0-9]))[0-9]{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)[0-9]{3}[0-9Xx]$/.test(t) ? n(/* @__PURE__ */ Error("invalid")) : n();
@@ -42,14 +42,14 @@ var m = {
42
42
  };
43
43
  if (t.type === "email") e.validator = f;
44
44
  else if (t.type === "idcard") e.validator = p;
45
- else if (t.type === "phone") e.validator = d;
45
+ else if (t.type === "phone") e.validator = o;
46
46
  else return null;
47
47
  return [e];
48
48
  }),
49
49
  events: r,
50
50
  predicate: i
51
51
  });
52
- return () => v({ vNodes: c(o, l({ class: ["form-input", {
52
+ return () => v({ vNodes: c(d, l({ class: ["form-input", {
53
53
  "is-readonly": t.readonlyGrey && t.readonly && !t.picker,
54
54
  "el-input-cursor-pointer": t.picker && !b.value
55
55
  }] }, x.value, {
@@ -1,4 +1,4 @@
1
- import { c as e, s as t } from "./Cw8pz9hK.mjs";
1
+ import { c as e, s as t } from "./BIm5rmJm.mjs";
2
2
  //#region src/components/form/props/common.js
3
3
  var n = {
4
4
  ...e,
@@ -1,7 +1,7 @@
1
- import { i as e, n as t } from "./Cw8pz9hK.mjs";
2
- import { n } from "./CnsFNU2A.mjs";
3
- import { ElRadio as r, ElRadioButton as i, ElRadioGroup as a } from "element-plus/es";
4
- import { createVNode as o, isVNode as s, mergeProps as c, useModel as l } from "vue";
1
+ import { i as e, n as t } from "./BIm5rmJm.mjs";
2
+ import { n } from "./Cp9FIjnh.mjs";
3
+ import { createVNode as r, isVNode as i, mergeProps as a, useModel as o } from "vue";
4
+ import { ElRadio as s, ElRadioButton as c, ElRadioGroup as l } from "element-plus/es";
5
5
  //#region src/components/form/props/radio-group.js
6
6
  var u = {
7
7
  ...n,
@@ -52,7 +52,7 @@ var u = {
52
52
  //#endregion
53
53
  //#region src/components/form/FormRadioGroup.vue?vue&type=script&lang.jsx
54
54
  function m(e) {
55
- return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !s(e);
55
+ return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !i(e);
56
56
  }
57
57
  //#endregion
58
58
  //#region src/components/form/FormRadioGroup.vue
@@ -64,31 +64,31 @@ var h = {
64
64
  ...t,
65
65
  change: null
66
66
  },
67
- setup(t, { emit: n, slots: s, attrs: u }) {
68
- let d = l(t, "modelValue"), { render: h, disabled: g, autoBind: _ } = e(t, {
67
+ setup(t, { emit: n, slots: i, attrs: u }) {
68
+ let d = o(t, "modelValue"), { render: h, disabled: g, autoBind: _ } = e(t, {
69
69
  emit: n,
70
- slots: s,
70
+ slots: i,
71
71
  attrs: u,
72
72
  events: f,
73
73
  predicate: p,
74
74
  messagePrefix: "请选择"
75
75
  });
76
- return () => h({ vNodes: o(a, c(_.value, {
76
+ return () => h({ vNodes: r(l, a(_.value, {
77
77
  modelValue: d.value,
78
78
  "onUpdate:modelValue": (e) => d.value = e,
79
79
  disabled: g.value
80
80
  }), {
81
- ...s,
82
- default: s.default || (() => {
81
+ ...i,
82
+ default: i.default || (() => {
83
83
  var e;
84
- return (e = t.options) == null ? void 0 : e.map(({ value: e, label: n, disabled: a }) => t.type === "button" ? o(i, {
84
+ return (e = t.options) == null ? void 0 : e.map(({ value: e, label: n, disabled: i }) => t.type === "button" ? r(c, {
85
85
  key: e,
86
86
  value: e,
87
- disabled: a
88
- }, m(n) ? n : { default: () => [n] }) : o(r, {
87
+ disabled: i
88
+ }, m(n) ? n : { default: () => [n] }) : r(s, {
89
89
  key: e,
90
90
  value: e,
91
- disabled: a
91
+ disabled: i
92
92
  }, m(n) ? n : { default: () => [n] }));
93
93
  })
94
94
  }) });
@@ -0,0 +1,208 @@
1
+ import { n as e } from "./BzMaCcUd.mjs";
2
+ import { hasAuthority as t } from "../api/index.mjs";
3
+ import { toolbarContextKey as n } from "../constants/index.mjs";
4
+ import { t as r } from "./DOl--Hf9.mjs";
5
+ import { NOOP as i, capitalize as a } from "@web-utils/core";
6
+ import { Comment as o, createVNode as s } from "vue";
7
+ //#region src/components/toolbar/Toolbar.vue?vue&type=script&lang.jsx
8
+ var c = {
9
+ back: {
10
+ label: "返回",
11
+ type: "primary",
12
+ icon: "el-icon-arrow-left"
13
+ },
14
+ cancel: {
15
+ label: "取消",
16
+ icon: "el-icon-close"
17
+ },
18
+ create: {
19
+ label: "新增",
20
+ type: "primary",
21
+ icon: "el-icon-plus"
22
+ },
23
+ save: {
24
+ label: "保存",
25
+ type: "primary",
26
+ icon: "el-icon-takeaway-box",
27
+ loadable: !0
28
+ },
29
+ withdraw: {
30
+ label: "提取",
31
+ type: "primary",
32
+ icon: "el-icon-refresh-left"
33
+ },
34
+ edit: {
35
+ label: "编辑",
36
+ type: "primary",
37
+ icon: "el-icon-edit-outline"
38
+ },
39
+ submit: {
40
+ label: "审批办理",
41
+ type: "primary",
42
+ icon: "el-icon-s-promotion"
43
+ },
44
+ publish: {
45
+ label: "发布",
46
+ type: "primary",
47
+ icon: "el-icon-s-promotion"
48
+ },
49
+ agree: {
50
+ label: "同意",
51
+ type: "primary",
52
+ icon: "el-icon-check"
53
+ },
54
+ disagree: {
55
+ label: "不同意",
56
+ type: "primary",
57
+ icon: "el-icon-close"
58
+ },
59
+ reject: {
60
+ label: "退回",
61
+ type: "primary",
62
+ icon: "el-icon-s-release"
63
+ },
64
+ finish: {
65
+ label: "完成",
66
+ type: "primary",
67
+ icon: "el-icon-circle-check"
68
+ },
69
+ enable: {
70
+ label: "启用",
71
+ type: "primary",
72
+ icon: "el-icon-circle-check"
73
+ },
74
+ exp: {
75
+ label: "导出",
76
+ type: "primary",
77
+ icon: "el-icon-download"
78
+ },
79
+ imp: {
80
+ label: "导入",
81
+ type: "primary",
82
+ icon: "el-icon-upload"
83
+ },
84
+ del: {
85
+ label: "删除",
86
+ type: "primary",
87
+ icon: "el-icon-delete"
88
+ },
89
+ print: {
90
+ label: "打印",
91
+ type: "primary",
92
+ icon: "el-icon-printer"
93
+ },
94
+ disabled: {
95
+ label: "禁用",
96
+ type: "primary",
97
+ icon: "el-icon-remove-outline"
98
+ },
99
+ reload: {
100
+ label: "刷新",
101
+ icon: "el-icon-refresh",
102
+ separateLine: !1,
103
+ circle: !0
104
+ },
105
+ settings: {
106
+ label: "设置",
107
+ icon: "el-icon-s-operation",
108
+ separateLine: !1,
109
+ circle: !0
110
+ },
111
+ search: {
112
+ label: "搜索",
113
+ icon: "el-icon-search",
114
+ separateLine: !1,
115
+ circle: !0
116
+ }
117
+ }, l = {
118
+ name: "Toolbar",
119
+ provide() {
120
+ return { [n]: this };
121
+ },
122
+ props: {
123
+ searchable: Boolean,
124
+ refreshable: Boolean,
125
+ buttons: {
126
+ type: Array,
127
+ default: () => ["back"]
128
+ },
129
+ back: Function,
130
+ cancel: Function,
131
+ emitter: {
132
+ type: String,
133
+ default: "self"
134
+ },
135
+ footer: Boolean,
136
+ label: Object
137
+ },
138
+ computed: {},
139
+ methods: {
140
+ goBack() {
141
+ let e = this.$route.path;
142
+ this.tabs.length === 1 ? window.close() : this.$bus("closeTab", e, this);
143
+ },
144
+ createButton(t, { label: n, icon: o, type: c, separateLine: l = !0, loadable: u, circle: d, onClick: f, title: p }) {
145
+ var m;
146
+ let h, g = ((m = this.label) == null ? void 0 : m[t]) || n;
147
+ return h = f || (["back", "cancel"].includes(t) ? this.goBack : (n) => {
148
+ (e(this.$attrs, { withOn: !0 })[`on${a(t)}`] || i)(n);
149
+ }), s(r, {
150
+ "separate-line": l,
151
+ icon: o,
152
+ title: p,
153
+ label: g,
154
+ loadable: u,
155
+ circle: d,
156
+ footer: this.footer,
157
+ type: c,
158
+ onClick: h
159
+ }, null);
160
+ },
161
+ getLeftButtons() {
162
+ var e, n, r;
163
+ let { createButton: i } = this;
164
+ return (r = (((e = (n = this.$slots)["toolbar-left"]) == null ? void 0 : e.call(n)) || this.buttons.flatMap((e) => {
165
+ let t = c[e];
166
+ if (t) {
167
+ var n, r;
168
+ return ((n = (r = this.$slots)[e]) == null ? void 0 : n.call(r)) || i(e, t);
169
+ } else if (e === "slot") {
170
+ var a, s;
171
+ let e = ((a = (s = this.$slots).default) == null ? void 0 : a.call(s, {
172
+ buttons: this.buttons,
173
+ footer: this.footer
174
+ })) ?? null;
175
+ if (e && e.length === 1) {
176
+ var l;
177
+ return e == null || (l = e[0]) == null || (l = l.children) == null ? void 0 : l.filter((e) => e.type !== o);
178
+ }
179
+ return e || [];
180
+ } else return null;
181
+ })).filter((e) => e)) == null ? void 0 : r.filter((e) => e.props.privilege ? t(e.props.privilege) : !0);
182
+ },
183
+ getRightButtons() {
184
+ var e, t, n, r;
185
+ let i = (e = (t = this.$slots)["toolbar-right"]) == null ? void 0 : e.call(t), a = [
186
+ ...((n = (r = this.$slots)["toolbar-right-button"]) == null ? void 0 : n.call(r)) || [],
187
+ this.getRefreshButton(),
188
+ this.getSettingsButton(),
189
+ this.getSearchButton()
190
+ ];
191
+ return i || a;
192
+ },
193
+ getSearchButton() {
194
+ return this.searchable ? this.createButton("search", c.search) : null;
195
+ },
196
+ getRefreshButton() {
197
+ return this.refreshable ? this.createButton("reload", c.reload) : null;
198
+ },
199
+ getSettingsButton() {
200
+ return this.refreshable ? this.createButton("settings", c.settings) : null;
201
+ }
202
+ },
203
+ render() {
204
+ return this.footer ? s("div", { class: "footer-bar" }, [this.getLeftButtons()]) : s("div", { class: "toolbar" }, [s("div", { class: "toolbar-left" }, [this.getLeftButtons()]), s("div", { class: "toolbar-right" }, [this.getRightButtons()])]);
205
+ }
206
+ };
207
+ //#endregion
208
+ export { l as t };
@@ -1,9 +1,9 @@
1
- import { i as e, n as t } from "./Cw8pz9hK.mjs";
2
- import { n, t as r } from "./CnsFNU2A.mjs";
3
- import { n as i, r as a } from "./Dq3yxEPg.mjs";
4
- import { t as o } from "./wfL1FAwc.mjs";
5
- import { ElInput as s, ElPopover as c } from "element-plus/es";
6
- import { createVNode as l, mergeProps as u, ref as d } from "vue";
1
+ import { i as e, n as t } from "./BIm5rmJm.mjs";
2
+ import { n, t as r } from "./Cp9FIjnh.mjs";
3
+ import { n as i, r as a } from "./Cnmu4eY-.mjs";
4
+ import { t as o } from "./C2RhdxHB.mjs";
5
+ import { createVNode as s, mergeProps as c, ref as l } from "vue";
6
+ import { ElInput as u, ElPopover as d } from "element-plus/es";
7
7
  //#endregion
8
8
  //#region src/components/form/FormInputCronExpression.vue
9
9
  var f = {
@@ -15,7 +15,7 @@ var f = {
15
15
  },
16
16
  emits: { ...t },
17
17
  setup(t, { emit: n, slots: r, attrs: f }) {
18
- let p = d(!1), { emitInput: m, render: h, placeholder: g, disabled: _, autoBind: v } = e(t, {
18
+ let p = l(!1), { emitInput: m, render: h, placeholder: g, disabled: _, autoBind: v } = e(t, {
19
19
  emit: n,
20
20
  slots: r,
21
21
  attrs: f,
@@ -26,20 +26,20 @@ var f = {
26
26
  }, b = () => {
27
27
  p.value = !1;
28
28
  };
29
- return () => h({ vNodes: l("div", { class: "cron" }, [l(c, {
29
+ return () => h({ vNodes: s("div", { class: "cron" }, [s(d, {
30
30
  placement: "bottom-start",
31
31
  disabled: _.value,
32
32
  modelValue: p.value,
33
33
  "onUpdate:modelValue": (e) => p.value = e,
34
34
  "popper-class": "cron-popover"
35
35
  }, {
36
- default: () => l(o, u(v.value, {
36
+ default: () => s(o, c(v.value, {
37
37
  i18n: "cn",
38
38
  expression: t.modelValue,
39
39
  onChange: m,
40
40
  onClose: b
41
41
  }), null),
42
- reference: () => l(s, {
42
+ reference: () => s(u, {
43
43
  modelValue: t.modelValue,
44
44
  readonly: !0,
45
45
  disabled: _.value,
@@ -1,7 +1,7 @@
1
- import { i as e, n as t } from "./Cw8pz9hK.mjs";
2
- import { n } from "./CnsFNU2A.mjs";
3
- import { ElRate as r } from "element-plus/es";
4
- import { createVNode as i, mergeProps as a, useModel as o } from "vue";
1
+ import { i as e, n as t } from "./BIm5rmJm.mjs";
2
+ import { n } from "./Cp9FIjnh.mjs";
3
+ import { createVNode as r, mergeProps as i, useModel as a } from "vue";
4
+ import { ElRate as o } from "element-plus/es";
5
5
  //#region src/components/form/props/rate.js
6
6
  var s = {
7
7
  ...n,
@@ -70,14 +70,14 @@ var s = {
70
70
  change: null
71
71
  },
72
72
  setup(t, { emit: n, slots: s, attrs: c }) {
73
- let d = o(t, "modelValue"), { render: f, disabled: p, autoBind: m } = e(t, {
73
+ let d = a(t, "modelValue"), { render: f, disabled: p, autoBind: m } = e(t, {
74
74
  emit: n,
75
75
  slots: s,
76
76
  attrs: c,
77
77
  events: l,
78
78
  predicate: u
79
79
  });
80
- return () => f({ vNodes: i(r, a(m.value, {
80
+ return () => f({ vNodes: r(o, i(m.value, {
81
81
  modelValue: d.value,
82
82
  "onUpdate:modelValue": (e) => d.value = e,
83
83
  disabled: p.value
@@ -0,0 +1,93 @@
1
+ import { columnSizeContextKey as e, setColumnSizeContextKey as t } from "../constants/index.mjs";
2
+ import n from "../form-cell/index.mjs";
3
+ import { camelize as r, isDef as i, isString as a } from "@web-utils/core";
4
+ import { Comment as o, Fragment as s, Text as c, createVNode as l, inject as u, isVNode as d } from "vue";
5
+ import { ElTooltip as f } from "element-plus/es";
6
+ //#region src/components/red-form/FormRow.vue?vue&type=script&lang.jsx
7
+ function p(e) {
8
+ return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !d(e);
9
+ }
10
+ var m = (e) => {
11
+ let t = Object.keys({});
12
+ for (let n in e) t[r(n)] = e[n];
13
+ return t;
14
+ }, h = (e, { columnSize: t }) => {
15
+ if (!e || !e.length) return null;
16
+ e = e.filter((e) => e.type !== o);
17
+ let n = [], r = e.length === 1;
18
+ for (let o = 0; o < e.length; o++) {
19
+ let v = e[o], { name: y } = v.type;
20
+ if (v.type === c) n.push({
21
+ tag: y,
22
+ type: "text",
23
+ content: v,
24
+ colspan: r ? t : 0
25
+ });
26
+ else if (v.type === s) n.push(...h(v.children, { columnSize: t }));
27
+ else if (a(v.type) && v.type === "td") n.push({
28
+ tag: v.type,
29
+ type: "td",
30
+ content: v
31
+ });
32
+ else if (y === "FormCell") n.push({
33
+ tag: y,
34
+ type: "FormCell",
35
+ content: v
36
+ });
37
+ else if (typeof v.type == "object") {
38
+ var u, d;
39
+ let { label: e, hideLabel: a, labelColspan: o, inputColspan: s, labelRowspan: c, inputRowspan: h, tipsAfterLabel: b, tips: x } = m(v.props);
40
+ if (!i(a)) {
41
+ var p, g, _;
42
+ let t = (p = v.children) == null ? void 0 : p.tips, r = t || x ? l(f, {
43
+ effect: "light",
44
+ content: x,
45
+ offset: 4
46
+ }, {
47
+ default: () => l("i", { class: "el-icon-info form-item-input-info" }, null),
48
+ content: t || null
49
+ }) : null;
50
+ n.push({
51
+ tag: y,
52
+ type: "label",
53
+ colspan: o,
54
+ rowspan: c,
55
+ content: [((g = v.children) == null || (_ = g.label) == null ? void 0 : _.call(g)) || e, b === "" ? r : null]
56
+ });
57
+ }
58
+ let S;
59
+ S = r && i(a) ? t : i(s) ? s : r ? t - 1 : 0, n.push({
60
+ tag: y,
61
+ type: "input",
62
+ colspan: S,
63
+ rowspan: h,
64
+ content: [v, (u = v.children) == null || (d = u.below) == null ? void 0 : d.call(u)]
65
+ });
66
+ } else console.error("未知节点");
67
+ }
68
+ return n;
69
+ }, g = {
70
+ name: "FormRow",
71
+ props: {
72
+ isLabel: Boolean,
73
+ alignCenter: Boolean
74
+ },
75
+ setup(r, { slots: i }) {
76
+ let a = u(t, null), o = u(e, null);
77
+ return () => {
78
+ var e;
79
+ let t = (e = i.default) == null ? void 0 : e.call(i), s = [];
80
+ return s.push(...h(t, { columnSize: (o == null ? void 0 : o.value) ?? 0 })), ((o == null ? void 0 : o.value) ?? 0) < s.length && (a == null || a(s.length)), l("tr", null, [s.map(({ tag: e, type: t, colspan: i, rowspan: a, content: o }) => e === "td" || t === "FormCell" ? o : t === "text" ? l(n, {
81
+ isLabel: r.isLabel,
82
+ alignCenter: r.alignCenter,
83
+ colspan: i
84
+ }, p(o) ? o : { default: () => [o] }) : l("td", {
85
+ class: t,
86
+ colspan: i,
87
+ rowspan: a
88
+ }, [o]))]);
89
+ };
90
+ }
91
+ };
92
+ //#endregion
93
+ export { g as t };
@@ -0,0 +1,107 @@
1
+ import { hasAuthority as e } from "../api/index.mjs";
2
+ import { toolbarContextKey as t } from "../constants/index.mjs";
3
+ import { isArray as n, isFunction as r } from "@web-utils/core";
4
+ import { computed as i, createVNode as a, defineComponent as o, getCurrentInstance as s, inject as c, ref as l } from "vue";
5
+ import { ElMessage as u, ElMessageBox as d } from "element-plus";
6
+ import { ElButton as f } from "element-plus/es";
7
+ //#endregion
8
+ //#region src/components/toolbar/ToolbarButton.vue
9
+ var p = /* @__PURE__ */ o({
10
+ name: "ToolbarButton",
11
+ inheritAttrs: !1,
12
+ props: {
13
+ label: String,
14
+ icon: String,
15
+ type: String,
16
+ size: { type: String },
17
+ loadable: Boolean,
18
+ disabled: Boolean,
19
+ footer: Boolean,
20
+ circle: Boolean,
21
+ plain: Boolean,
22
+ round: Boolean,
23
+ primary: Boolean,
24
+ warning: Boolean,
25
+ nativeType: {
26
+ type: String,
27
+ default: "button"
28
+ },
29
+ privilege: String,
30
+ condition: { type: [
31
+ Array,
32
+ Function,
33
+ Boolean
34
+ ] },
35
+ conditionTips: String,
36
+ confirm: Boolean,
37
+ confirmTips: String,
38
+ beforeExecute: Function,
39
+ afterExecute: Function,
40
+ route: [String, Object],
41
+ title: String,
42
+ cancelButtonText: String,
43
+ confirmButtonText: String
44
+ },
45
+ setup(o, { attrs: p, slots: m }) {
46
+ let h = s(), g = c(t, null), _ = l(!1), v = i(() => o.privilege ? e(o.privilege) : !0), y = async (e) => {
47
+ try {
48
+ if (r(o.beforeExecute) && await o.beforeExecute() === !1) return;
49
+ if (o.conditionTips) {
50
+ let e;
51
+ if (e = n(o.condition) ? o.condition.length <= 0 : r(o.condition) ? !o.condition() : !o.condition, e) {
52
+ u.warning(o.conditionTips);
53
+ return;
54
+ }
55
+ }
56
+ if (o.confirm || o.confirmTips) try {
57
+ await d.confirm(o.confirmTips || "你确定要删除该记录吗?", "系统提示", {
58
+ type: "warning",
59
+ distinguishCancelAndClose: !0,
60
+ cancelButtonText: o.cancelButtonText,
61
+ confirmButtonText: o.confirmButtonText
62
+ });
63
+ } catch (e) {
64
+ if (e === "cancel") {
65
+ let { onCancel: t } = p;
66
+ r(t) && await t(e);
67
+ } else if (e === "close") {
68
+ let { onClose: t } = p;
69
+ r(t) && await t(e);
70
+ }
71
+ return;
72
+ }
73
+ _.value = !0;
74
+ let i;
75
+ if (o.route) {
76
+ var t;
77
+ await ((t = h.proxy.$router) == null ? void 0 : t.push(o.route));
78
+ } else {
79
+ let { onClick: t } = p;
80
+ if (r(t)) try {
81
+ i = await t(e);
82
+ } catch {}
83
+ }
84
+ _.value = !1, r(o.afterExecute) && await o.afterExecute(i);
85
+ } catch {}
86
+ };
87
+ return () => v.value ? a(f, {
88
+ title: o.footer || g != null && g.footer ? null : o.title,
89
+ disabled: o.disabled || _.value,
90
+ plain: o.plain,
91
+ size: o.size,
92
+ nativeType: o.nativeType,
93
+ circle: o.circle,
94
+ loading: o.loadable ? _.value : !1,
95
+ type: o.primary ? "primary" : o.warning ? "warning" : o.type,
96
+ round: o.round,
97
+ class: p.class,
98
+ style: p.style,
99
+ onClick: y
100
+ }, {
101
+ default: !o.circle && (o.label || m.default) ? () => m.default ? m.default() : o.label : null,
102
+ icon: o.icon ? () => a("i", { class: o.icon }, null) : null
103
+ }) : null;
104
+ }
105
+ });
106
+ //#endregion
107
+ export { p as t };