@web-utils/form-ui 1.0.0-beta52 → 1.0.0-beta54

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 (76) hide show
  1. package/chunks/{C2zgFLYO.mjs → 4rnKCvCw.mjs} +35 -31
  2. package/chunks/{Dt3lfDnL.mjs → 7GmKqdbC.mjs} +48 -33
  3. package/chunks/{DitpKWMd.mjs → 9MExJqL-.mjs} +2 -2
  4. package/chunks/{DZJ-ShZA2.mjs → B3yVc-P62.mjs} +4 -4
  5. package/chunks/{DkXlFWjs.mjs → B6yWUT6z.mjs} +2 -2
  6. package/chunks/{CkjtCuMs.mjs → BEvOkSfB.mjs} +119 -118
  7. package/chunks/{D3mFJzGr.mjs → BHbMJZPp.mjs} +63 -62
  8. package/chunks/{BSU2FqMP2.mjs → BJYlobMz2.mjs} +2 -2
  9. package/chunks/{KuAMIZnG.mjs → BNXbI4OG.mjs} +1 -1
  10. package/chunks/{CzHaJsnD.mjs → BV-XUugQ.mjs} +3 -3
  11. package/chunks/{DcFllKOf2.mjs → BgTCTXs72.mjs} +4 -3
  12. package/chunks/{BshE3RnA.mjs → BjGlxyi6.mjs} +2 -2
  13. package/chunks/{BAw6wxW1.mjs → BqC_VU52.mjs} +2 -2
  14. package/chunks/{B1k8ydde.mjs → BqzJ6vY6.mjs} +2 -2
  15. package/chunks/{DhVmHzB7.mjs → ByTyNsWf.mjs} +1 -1
  16. package/chunks/{DVbw6xIr.mjs → CB9QUXUX.mjs} +2 -2
  17. package/chunks/{GMFHxPJq.mjs → CGuDBVCB.mjs} +4 -3
  18. package/chunks/{C7G-cAoI.mjs → CPvdsnRN.mjs} +1 -1
  19. package/chunks/{D2MB3CnR.mjs → CgN7m-1v.mjs} +4 -3
  20. package/chunks/{CtHmTtVP.mjs → D5EQJdPL.mjs} +3 -3
  21. package/chunks/{CGHcOyNC2.mjs → D7R9Or2m2.mjs} +3 -3
  22. package/chunks/D9IFsT272.mjs +513 -0
  23. package/chunks/{C6hLXCPk.mjs → DFFNxlqD.mjs} +3 -3
  24. package/chunks/{BWh6u1O0.mjs → DWMePN6q.mjs} +1 -1
  25. package/chunks/{CBFbSsTJ.mjs → DawYTjoT.mjs} +2 -2
  26. package/chunks/{JKFepPeL.mjs → DjnHvHXo.mjs} +2 -2
  27. package/chunks/{v-O82KSn.mjs → DwkOWXIR.mjs} +4 -4
  28. package/chunks/{BQyL45PF2.mjs → DyCO22Ia2.mjs} +1 -1
  29. package/chunks/{B75qfA0z.mjs → Dytof5EW.mjs} +2 -2
  30. package/chunks/{eBESsR-G.mjs → H70Z56YY.mjs} +9 -3
  31. package/chunks/{CVKPpQdS.mjs → XwerN1TU.mjs} +2 -2
  32. package/chunks/{BXVB-H8_.mjs → c0Niqotr.mjs} +2 -2
  33. package/chunks/{DLgFBI_X.mjs → z5FJgzdc.mjs} +4 -3
  34. package/constants/index.d.ts +1 -0
  35. package/editable-tree/index.mjs +1 -1
  36. package/form-cascader/index.mjs +1 -1
  37. package/form-checkbox/index.d.ts +2 -2
  38. package/form-checkbox/index.mjs +1 -1
  39. package/form-checkbox-group/index.mjs +1 -1
  40. package/form-date-picker/index.mjs +1 -1
  41. package/form-holder/index.mjs +1 -1
  42. package/form-image/index.mjs +1 -1
  43. package/form-input/index.mjs +1 -1
  44. package/form-input-cron-expression/index.mjs +1 -1
  45. package/form-input-email/index.mjs +1 -1
  46. package/form-input-id-card/index.mjs +1 -1
  47. package/form-input-number/index.mjs +1 -1
  48. package/form-input-phone-number/index.mjs +1 -1
  49. package/form-input-tag/index.mjs +1 -1
  50. package/form-input-time/index.mjs +1 -1
  51. package/form-item-x/index.mjs +1 -1
  52. package/form-item-x/style.css +1 -1
  53. package/form-radio-group/index.mjs +1 -1
  54. package/form-rate/index.mjs +1 -1
  55. package/form-select/index.mjs +1 -1
  56. package/form-slider/index.mjs +1 -1
  57. package/form-switch/index.mjs +1 -1
  58. package/form-table/index.mjs +1 -1
  59. package/form-table-plus/index.mjs +1 -1
  60. package/form-text/index.mjs +1 -1
  61. package/form-textarea/index.mjs +1 -1
  62. package/form-time-select/index.mjs +1 -1
  63. package/index.css +1 -1
  64. package/index.mjs +33 -33
  65. package/package.json +1 -1
  66. package/pageable-table/index.mjs +1 -1
  67. package/sub-table/index.mjs +1 -1
  68. package/sub-table-plus/index.mjs +1 -1
  69. package/table-view/index.mjs +5 -5
  70. package/toolbar/index.mjs +1 -1
  71. package/toolbar-button/index.mjs +1 -1
  72. package/toolbar-button/style.css +1 -0
  73. package/vue-cron/index.mjs +1 -1
  74. package/web-types.json +1 -1
  75. package/x-input-tag/index.mjs +1 -1
  76. package/chunks/CjRZ71IY2.mjs +0 -512
@@ -96,69 +96,73 @@ var _ = {
96
96
  inheritAttrs: !1,
97
97
  props: { ..._ },
98
98
  emits: {},
99
- setup(_, { slots: v, expose: b }) {
100
- let { autoBindProps: x, listeners: S } = e(_, { predicate: y }), C = c(n, null), w = m("form"), T = o(() => _.notTableForm === void 0 ? (C == null ? void 0 : C.tableForm) === void 0 ? !1 : C == null ? void 0 : C.tableForm : !_.notTableForm), E = o(() => T.value ? !1 : _.showMessage), D = o(() => {
99
+ setup(_, { slots: v, expose: b, attrs: x }) {
100
+ let { autoBindProps: S, listeners: C } = e(_, { predicate: y }), w = c(n, null), T = m("form"), E = o(() => _.notTableForm === void 0 ? (w == null ? void 0 : w.tableForm) === void 0 ? !1 : w == null ? void 0 : w.tableForm : !_.notTableForm), D = o(() => E.value ? !1 : _.showMessage), O = o(() => {
101
101
  let e = {};
102
102
  return _.disabledFields && _.disabledFields.forEach((t) => {
103
103
  e[t] = !0;
104
104
  }), e;
105
- }), O = o(() => {
105
+ }), k = o(() => {
106
106
  let e = {};
107
107
  return _.enabledFields && _.enabledFields.length && _.enabledFields.forEach((t) => {
108
108
  e[t] = !0;
109
109
  }), e;
110
- }), k = o(() => {
110
+ }), A = o(() => {
111
111
  let e = {};
112
112
  return _.requiredFields && _.requiredFields.length && _.requiredFields.forEach((t) => {
113
113
  e[t] = !0;
114
114
  }), e;
115
- }), A = o(() => _.disabled === !0 ? !0 : _.disabled), j = p(() => _.enabledFields), M = p(() => _.requiredFields), N = p(() => _.disabledFields), P = async () => {
115
+ }), j = o(() => _.disabled === !0 ? !0 : _.disabled), M = p(() => _.enabledFields), N = p(() => _.requiredFields), P = p(() => _.disabledFields), F = async () => {
116
116
  await u();
117
- let e = w.value.$el.querySelector(".el-form-item.is-error");
117
+ let e = T.value.$el.querySelector(".el-form-item.is-error");
118
118
  e && e.scrollIntoView({
119
119
  block: "center",
120
120
  inline: "center",
121
121
  behavior: "smooth"
122
122
  });
123
- }, F = f({
124
- tableForm: T,
125
- disabled: A,
126
- enabledFields: j,
127
- requiredFields: M,
128
- enabledFieldsMap: O,
129
- disabledFieldsMap: D,
130
- requiredFieldsMap: k,
131
- disabledFields: N,
132
- scrollIntoRequiredField: P,
133
- formRef: w,
123
+ }, I = f({
124
+ tableForm: E,
125
+ disabled: j,
126
+ enabledFields: M,
127
+ requiredFields: N,
128
+ enabledFieldsMap: k,
129
+ disabledFieldsMap: O,
130
+ requiredFieldsMap: A,
131
+ disabledFields: P,
132
+ scrollIntoRequiredField: F,
133
+ formRef: T,
134
134
  validate: async () => {
135
135
  try {
136
- return await w.value.validate();
136
+ return await T.value.validate();
137
137
  } catch {
138
- throw await P(), w.value.$el.querySelectorAll(".el-form-item.is-error .el-form-item__content > :first-child").forEach((e) => {
138
+ throw await F(), T.value.$el.querySelectorAll(".el-form-item.is-error .el-form-item__content > :first-child").forEach((e) => {
139
139
  a(e, "breathe-animation");
140
140
  }), Error("表单验证不通过!");
141
141
  }
142
142
  },
143
- validateField: (e) => w.value.validateField(e),
144
- resetFields: (e) => w.value.resetFields(e),
145
- scrollToField: (e) => w.value.scrollToField(e),
146
- clearValidate: (e) => w.value.clearValidate(e),
147
- getField: () => w.value.getField(),
148
- setInitialValues: (e) => w.value.setInitialValues(e),
149
- getFields: () => w.value.fields
143
+ validateField: (e) => T.value.validateField(e),
144
+ resetFields: (e) => T.value.resetFields(e),
145
+ scrollToField: (e) => T.value.scrollToField(e),
146
+ clearValidate: (e) => T.value.clearValidate(e),
147
+ getField: () => T.value.getField(),
148
+ setInitialValues: (e) => T.value.setInitialValues(e),
149
+ getFields: () => T.value.fields
150
150
  });
151
- return d(t, F), b(F), () => s(h, l(S.value, x.value, {
151
+ return d(t, I), b(I), () => s(h, l(C.value, S.value, x, {
152
152
  ref: "form",
153
- class: "form-holder",
154
- "show-message": E.value
153
+ class: [
154
+ "form-holder",
155
+ "clear-fix",
156
+ { "red-form": E }
157
+ ],
158
+ "show-message": D.value
155
159
  }), { default: () => {
156
- if (T.value) {
160
+ if (E.value) {
157
161
  var e, t, n;
158
162
  return [
159
163
  (e = v.top) == null ? void 0 : e.call(v),
160
164
  s(i, {
161
- class: { "hide-error-message": T.value },
165
+ class: { "hide-error-message": E.value },
162
166
  columns: _.columns,
163
167
  "col-count": _.colCount
164
168
  }, { default: () => {
@@ -2,11 +2,11 @@ import { f as e } from "./DcTVYqeJ.mjs";
2
2
  import { hasAuthority as t } from "../api/index.mjs";
3
3
  import { toolbarContextKey as n } from "../constants/index.mjs";
4
4
  import { isArray as r, isFunction as i } from "@web-utils/core";
5
- import { computed as a, createVNode as o, defineComponent as s, getCurrentInstance as c, inject as l, mergeProps as u, ref as d } from "vue";
6
- import { ElMessage as f, ElMessageBox as p } from "element-plus";
7
- import { ElButton as m } from "element-plus/es";
5
+ import { computed as a, createVNode as o, getCurrentInstance as s, inject as c, mergeProps as l, ref as u } from "vue";
6
+ import { ElMessage as d, ElMessageBox as f } from "element-plus";
7
+ import { ElButton as p } from "element-plus/es";
8
8
  //#region src/components/toolbar/button.ts
9
- var h = {
9
+ var m = {
10
10
  size: {
11
11
  type: String,
12
12
  default: "default"
@@ -91,34 +91,49 @@ var h = {
91
91
  title: String,
92
92
  cancelButtonText: String,
93
93
  confirmButtonText: String
94
- }, g = {
94
+ }, h = {
95
95
  icon: !0,
96
96
  type: !0,
97
97
  text: !0,
98
98
  title: !0,
99
99
  disabled: !0,
100
- loading: !0
101
- }, _ = (e) => g[e] !== !0, v = /* @__PURE__ */ s({
100
+ loading: !0,
101
+ label: !0,
102
+ loadable: !0,
103
+ footer: !0,
104
+ primary: !0,
105
+ warning: !0,
106
+ privilege: !0,
107
+ condition: !0,
108
+ conditionTips: !0,
109
+ confirm: !0,
110
+ confirmTips: !0,
111
+ beforeExecute: !0,
112
+ afterExecute: !0,
113
+ route: !0,
114
+ cancelButtonText: !0,
115
+ confirmButtonText: !0
116
+ }, g = (e) => h[e] !== !0, _ = {
102
117
  name: "ToolbarButton",
103
118
  inheritAttrs: !1,
104
- props: { ...h },
105
- setup(s, { attrs: h, slots: g }) {
106
- let v = c(), y = l(n, null), b = d(!1), x = a(() => s.privilege ? t(s.privilege) : !0), S = async (e) => {
119
+ props: { ...m },
120
+ setup(m, { attrs: h, slots: _ }) {
121
+ let v = s(), y = c(n, null), b = u(!1), x = a(() => m.privilege ? t(m.privilege) : !0), S = async (e) => {
107
122
  try {
108
- if (i(s.beforeExecute) && await s.beforeExecute() === !1) return;
109
- if (s.conditionTips) {
123
+ if (i(m.beforeExecute) && await m.beforeExecute() === !1) return;
124
+ if (m.conditionTips) {
110
125
  let e;
111
- if (e = r(s.condition) ? s.condition.length <= 0 : i(s.condition) ? !s.condition() : !s.condition, e) {
112
- f.warning(s.conditionTips);
126
+ if (e = r(m.condition) ? m.condition.length <= 0 : i(m.condition) ? !m.condition() : !m.condition, e) {
127
+ d.warning(m.conditionTips);
113
128
  return;
114
129
  }
115
130
  }
116
- if (s.confirm || s.confirmTips) try {
117
- await p.confirm(s.confirmTips || "你确定要删除该记录吗?", "系统提示", {
131
+ if (m.confirm || m.confirmTips) try {
132
+ await f.confirm(m.confirmTips || "你确定要删除该记录吗?", "系统提示", {
118
133
  type: "warning",
119
134
  distinguishCancelAndClose: !0,
120
- cancelButtonText: s.cancelButtonText,
121
- confirmButtonText: s.confirmButtonText
135
+ cancelButtonText: m.cancelButtonText,
136
+ confirmButtonText: m.confirmButtonText
122
137
  });
123
138
  } catch (e) {
124
139
  if (e === "cancel") {
@@ -132,35 +147,35 @@ var h = {
132
147
  }
133
148
  b.value = !0;
134
149
  let n;
135
- if (s.route) {
150
+ if (m.route) {
136
151
  var t;
137
- await ((t = v.proxy.$router) == null ? void 0 : t.push(s.route));
152
+ await ((t = v.proxy.$router) == null ? void 0 : t.push(m.route));
138
153
  } else {
139
154
  let { onClick: t } = h;
140
155
  if (i(t)) try {
141
156
  n = await t(e);
142
157
  } catch {}
143
158
  }
144
- b.value = !1, i(s.afterExecute) && await s.afterExecute(n);
159
+ b.value = !1, i(m.afterExecute) && await m.afterExecute(n);
145
160
  } catch {}
146
- }, C = a(() => s.text ? !0 : s.type === "text"), w = a(() => {
147
- if (!C.value) return s.primary ? "primary" : s.warning ? "warning" : s.type;
148
- }), T = e(s, _);
149
- return () => x.value ? o(m, u(T.value, {
150
- title: s.footer || y != null && y.footer ? null : s.title,
151
- disabled: s.disabled || b.value,
152
- loading: s.loadable ? b.value : !1,
161
+ }, C = a(() => m.text ? !0 : m.type === "text"), w = a(() => {
162
+ if (!C.value) return m.primary ? "primary" : m.warning ? "warning" : m.type;
163
+ }), T = e(m, g);
164
+ return () => x.value ? o(p, l(T.value, {
165
+ title: m.footer || y != null && y.footer ? null : m.title,
166
+ disabled: m.disabled || b.value,
167
+ loading: m.loadable ? b.value : !1,
153
168
  type: w.value,
154
169
  text: C.value,
155
170
  class: h.class,
156
171
  style: h.style,
157
172
  onClick: S
158
173
  }), {
159
- default: !s.circle && (s.label || g.default) ? () => g.default ? g.default() : s.label : null,
160
- loading: g.loading,
161
- icon: g.icon ? g.icon : s.icon ? () => o("i", { class: s.icon }, null) : null
174
+ default: !m.circle && (m.label || _.default) ? () => _.default ? _.default() : m.label : null,
175
+ loading: _.loading,
176
+ icon: _.icon ? _.icon : m.icon ? () => o("i", { class: m.icon }, null) : null
162
177
  }) : null;
163
178
  }
164
- });
179
+ };
165
180
  //#endregion
166
- export { v as t };
181
+ export { _ as t };
@@ -1,5 +1,5 @@
1
- import { i as e, n as t } from "./D3mFJzGr.mjs";
2
- import { n, t as r } from "./KuAMIZnG.mjs";
1
+ import { i as e, n as t } from "./BHbMJZPp.mjs";
2
+ import { n, t as r } from "./BNXbI4OG.mjs";
3
3
  import i from "../x-input-tag/index.mjs";
4
4
  import { createVNode as a, mergeProps as o } from "vue";
5
5
  //#region src/components/form/props/input-tag.ts
@@ -1,8 +1,8 @@
1
1
  import { i as e } from "./DcTVYqeJ.mjs";
2
- import { i as t, n } from "./D3mFJzGr.mjs";
3
- import { n as r, t as i } from "./KuAMIZnG.mjs";
4
- import { r as a } from "./v-O82KSn.mjs";
5
- import { n as o, t as s } from "./CjRZ71IY2.mjs";
2
+ import { i as t, n } from "./BHbMJZPp.mjs";
3
+ import { n as r, t as i } from "./BNXbI4OG.mjs";
4
+ import { r as a } from "./DwkOWXIR.mjs";
5
+ import { n as o, t as s } from "./D9IFsT272.mjs";
6
6
  import { isArray as c, isString as l, trace as u, warning as d } from "@web-utils/core";
7
7
  import { computed as f, createVNode as p, getCurrentInstance as m, mergeProps as h, useModel as g, useTemplateRef as _ } from "vue";
8
8
  import { useEventBus as v } from "@web-utils/vue/hooks/useEventBus";
@@ -1,5 +1,5 @@
1
- import { n as e } from "./D3mFJzGr.mjs";
2
- import { n as t, t as n } from "./v-O82KSn.mjs";
1
+ import { n as e } from "./BHbMJZPp.mjs";
2
+ import { n as t, t as n } from "./DwkOWXIR.mjs";
3
3
  import { createVNode as r, isVNode as i, mergeProps as a, useModel as o } from "vue";
4
4
  //#region src/components/form/FormInputPhoneNumber.vue?vue&type=script&lang.jsx
5
5
  function s(e) {