@web-utils/form-ui 1.0.0-beta76 → 1.0.0-beta77

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,8 +1,8 @@
1
1
  import { i as e } from "./ClVh1Lek.mjs";
2
2
  import { commonAutoBindProps as t, commonManualBindProps as n } from "../props/common.mjs";
3
3
  import { n as r, o as i } from "./Dgwcljur.mjs";
4
- import { n as a } from "./C7rEqtOR.mjs";
5
- import { n as o, t as s } from "./DvkUImww2.mjs";
4
+ import { n as a } from "./Dpzw7Rtp.mjs";
5
+ import { n as o, t as s } from "./JjnlFlI02.mjs";
6
6
  import { computed as c, createVNode as l, getCurrentInstance as u, mergeProps as d, useModel as f, useTemplateRef as p } from "vue";
7
7
  import { isArray as m, isString as h, trace as g, warning as _ } from "@web-utils/core";
8
8
  import { useEventBus as v } from "@web-utils/vue/hooks/useEventBus";
@@ -1,6 +1,6 @@
1
1
  import { commonAutoBindProps as e, commonManualBindProps as t } from "../props/common.mjs";
2
2
  import { n, o as r } from "./Dgwcljur.mjs";
3
- import { n as i, t as a } from "./BP_0cJ172.mjs";
3
+ import { n as i, t as a } from "./DS4Iw8Y42.mjs";
4
4
  import { createVNode as o, mergeProps as s, ref as c, useModel as l } from "vue";
5
5
  //#region src/components/table/form-table.ts
6
6
  var u = {
@@ -1,7 +1,7 @@
1
1
  import { allProps as e, predicate as t } from "../props/checkbox-group.mjs";
2
2
  import { n, o as r } from "./Dgwcljur.mjs";
3
3
  import { useDictionary as i } from "../hook/useDictionary.mjs";
4
- import { t as a } from "./C7rEqtOR.mjs";
4
+ import { t as a } from "./Dpzw7Rtp.mjs";
5
5
  import { ElCheckbox as o, ElCheckboxButton as s, ElCheckboxGroup as c } from "element-plus/es";
6
6
  import "element-plus/es/components/base/style/css";
7
7
  import { computed as l, createVNode as u, defineComponent as d, isVNode as f, mergeProps as p, useModel as m } from "vue";
@@ -1,5 +1,5 @@
1
1
  import { n as e } from "./Dgwcljur.mjs";
2
- import { t } from "./C7rEqtOR.mjs";
2
+ import { t } from "./Dpzw7Rtp.mjs";
3
3
  import { allProps as n } from "../props/input.mjs";
4
4
  import { createVNode as r, isVNode as i, mergeProps as a, useModel as o } from "vue";
5
5
  //#region src/components/form/FormInputEmail.vue?vue&type=script&lang.jsx
@@ -1,5 +1,5 @@
1
1
  import { n as e } from "./Dgwcljur.mjs";
2
- import { t } from "./C7rEqtOR.mjs";
2
+ import { t } from "./Dpzw7Rtp.mjs";
3
3
  import { allProps as n } from "../props/input.mjs";
4
4
  import { createVNode as r, isVNode as i, mergeProps as a, useModel as o } from "vue";
5
5
  //#region src/components/form/FormInputPhoneNumber.vue?vue&type=script&lang.jsx
@@ -4,14 +4,14 @@ import { t as n } from "./mnqSaATq.mjs";
4
4
  import { t as r } from "./tzjUpVIj.mjs";
5
5
  import { n as i } from "./Dgwcljur.mjs";
6
6
  import { t as a } from "./ohCkWdwS.mjs";
7
- import { t as o } from "./C7rEqtOR.mjs";
8
- import { t as s } from "./DLdsvozr.mjs";
7
+ import { t as o } from "./Dpzw7Rtp.mjs";
8
+ import { t as s } from "./CeEYChF4.mjs";
9
9
  import { t as c } from "./DMDsZeqv.mjs";
10
10
  import { t as l } from "./BTNnujZA2.mjs";
11
- import { t as u } from "./Dje2xUVd2.mjs";
11
+ import { t as u } from "./D5_ezGUV2.mjs";
12
12
  import { t as d } from "./BaB0bq4I2.mjs";
13
13
  import f from "../table-column-def/index.mjs";
14
- import { t as p } from "./D_gR5ibl2.mjs";
14
+ import { t as p } from "./uDwSrV7X2.mjs";
15
15
  import { formContextKey as m, formItemContextKey as h } from "element-plus/es";
16
16
  import { Fragment as g, createBlock as _, createCommentVNode as v, createElementBlock as y, createElementVNode as b, createSlots as x, createTextVNode as S, createVNode as C, mergeProps as w, openBlock as T, renderList as E, renderSlot as D, resolveComponent as O, toDisplayString as k, withCtx as A, withModifiers as j } from "vue";
17
17
  import { findTreeChildren as M, isFunction as N } from "@web-utils/core";
@@ -3,14 +3,14 @@ import { allProps as r, predicate as i } from "../props/input.mjs";
3
3
  import { ElInput as a } from "element-plus/es";
4
4
  import "element-plus/es/components/base/style/css";
5
5
  import "element-plus/es/components/input/style/css";
6
- import { computed as o, createVNode as s, mergeProps as c, onMounted as l, useModel as u } from "vue";
7
- import { validatePhoneNum as d } from "@web-utils/core";
6
+ import { computed as o, createVNode as s, mergeProps as c, useModel as l } from "vue";
7
+ import { validatePhoneNum as u } from "@web-utils/core";
8
8
  //#region src/utils/form-validate.ts
9
- 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();
10
- function p(e, t, n) {
9
+ var d = (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();
10
+ function f(e, t, n) {
11
11
  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();
12
12
  }
13
- function m(e, t, n) {
13
+ function p(e, t, n) {
14
14
  if (this.$refs.table.$refs.table.records.length === 0) {
15
15
  n(Error(e.message || `请添加${e.label}`));
16
16
  return;
@@ -19,52 +19,50 @@ function m(e, t, n) {
19
19
  }
20
20
  //#endregion
21
21
  //#region src/components/form/FormInput.vue
22
- var h = {
22
+ var m = {
23
23
  name: "FormInput",
24
24
  inheritAttrs: !1,
25
25
  props: { ...r },
26
26
  emits: { ...e },
27
- setup(e, { emit: r, slots: m, attrs: h }) {
28
- let g = u(e, "modelValue"), _ = `请输入正确的${e.label}!`, { render: v, placeholder: y, disabled: b, listeners: x, inputProps: S, printing: C, formItem: w } = t(e, {
27
+ setup(e, { emit: r, slots: p, attrs: m }) {
28
+ let h = l(e, "modelValue"), g = `请输入正确的${e.label}!`, { render: _, placeholder: v, disabled: y, listeners: b, inputProps: x, printing: S } = t(e, {
29
29
  emit: r,
30
- slots: m,
31
- attrs: h,
30
+ slots: p,
31
+ attrs: m,
32
32
  rules: o(() => {
33
33
  if (!e.type || e.type === "textarea") return null;
34
34
  let t = {
35
- message: _,
35
+ message: g,
36
36
  trigger: "blur"
37
37
  };
38
- if (e.type === "email") t.validator = f;
39
- else if (e.type === "idcard") t.validator = p;
40
- else if (e.type === "phone") t.validator = d;
38
+ if (e.type === "email") t.validator = d;
39
+ else if (e.type === "idcard") t.validator = f;
40
+ else if (e.type === "phone") t.validator = u;
41
41
  else return null;
42
42
  return [t];
43
43
  }),
44
44
  predicate: i
45
45
  });
46
- return l(() => {
47
- console.log(w.value);
48
- }), () => v({ vNodes: C.value ? e.modelValue : s(a, c(x.value, S.value, {
46
+ return () => _({ vNodes: S.value ? e.modelValue : s(a, c(b.value, x.value, {
49
47
  class: ["form-input", {
50
48
  "is-readonly": e.readonlyGrey && e.readonly && !e.picker,
51
- "el-input-cursor-pointer": e.picker && !b.value
49
+ "el-input-cursor-pointer": e.picker && !y.value
52
50
  }],
53
- modelValue: g.value,
54
- "onUpdate:modelValue": (e) => g.value = e,
55
- disabled: b.value,
56
- placeholder: y.value,
51
+ modelValue: h.value,
52
+ "onUpdate:modelValue": (e) => h.value = e,
53
+ disabled: y.value,
54
+ placeholder: v.value,
57
55
  readonly: e.readonly || e.picker,
58
56
  "prefix-icon": n({ icon: e.picker ? "el-icon-search" : e.prefixIcon }),
59
57
  "suffix-icon": n({ icon: e.suffixIcon })
60
58
  }), {
61
- prefix: m.prefix || e.prefix ? () => e.prefix : null,
62
- suffix: m.suffix || e.suffix ? () => e.suffix : null,
63
- "password-icon": m["password-icon"],
64
- prepend: m.prepend || e.prepend ? () => e.prepend : null,
65
- append: m.append || e.append ? () => e.append : null
59
+ prefix: p.prefix || e.prefix ? () => e.prefix : null,
60
+ suffix: p.suffix || e.suffix ? () => e.suffix : null,
61
+ "password-icon": p["password-icon"],
62
+ prepend: p.prepend || e.prepend ? () => e.prepend : null,
63
+ append: p.append || e.append ? () => e.append : null
66
64
  }) });
67
65
  }
68
66
  };
69
67
  //#endregion
70
- export { m as n, h as t };
68
+ export { p as n, m as t };
@@ -7,11 +7,11 @@ import { t as a } from "./tzjUpVIj.mjs";
7
7
  import { n as o } from "./Dgwcljur.mjs";
8
8
  import { t as ee } from "./ohCkWdwS.mjs";
9
9
  import { t as s } from "./Dhdoa4M6.mjs";
10
- import { t as c } from "./C7rEqtOR.mjs";
11
- import { t as l } from "./DLdsvozr.mjs";
10
+ import { t as c } from "./Dpzw7Rtp.mjs";
11
+ import { t as l } from "./CeEYChF4.mjs";
12
12
  import { t as u } from "./DMDsZeqv.mjs";
13
13
  import { t as d } from "./BTNnujZA2.mjs";
14
- import { t as f } from "./Dje2xUVd2.mjs";
14
+ import { t as f } from "./D5_ezGUV2.mjs";
15
15
  import { t as p } from "./BaB0bq4I2.mjs";
16
16
  import m from "../table-column-def/index.mjs";
17
17
  import { formContextKey as h, formItemContextKey as g } from "element-plus/es";
@@ -1,5 +1,5 @@
1
1
  import { n as e } from "./Dgwcljur.mjs";
2
- import { t } from "./C7rEqtOR.mjs";
2
+ import { t } from "./Dpzw7Rtp.mjs";
3
3
  import { allProps as n } from "../props/input.mjs";
4
4
  import { createVNode as r, isVNode as i, mergeProps as a, useModel as o } from "vue";
5
5
  //#region src/components/form/FormInputIdCard.vue?vue&type=script&lang.jsx
@@ -1,5 +1,5 @@
1
1
  import { n as e } from "./Dgwcljur.mjs";
2
- import { t } from "./C7rEqtOR.mjs";
2
+ import { t } from "./Dpzw7Rtp.mjs";
3
3
  import { allProps as n } from "../props/textarea.mjs";
4
4
  import { createVNode as r, isVNode as i, mergeProps as a, useModel as o } from "vue";
5
5
  //#region src/components/form/FormTextarea.vue?vue&type=script&lang.jsx
@@ -1,2 +1,2 @@
1
- import { t as e } from "../chunks/DLdsvozr.mjs";
1
+ import { t as e } from "../chunks/CeEYChF4.mjs";
2
2
  export { e as default };
@@ -1,2 +1,2 @@
1
- import { t as e } from "../chunks/C7rEqtOR.mjs";
1
+ import { t as e } from "../chunks/Dpzw7Rtp.mjs";
2
2
  export { e as default };
@@ -1,2 +1,2 @@
1
- import { t as e } from "../chunks/CF23xugU2.mjs";
1
+ import { t as e } from "../chunks/CoPlnbwi2.mjs";
2
2
  export { e as default };
@@ -1,2 +1,2 @@
1
- import { t as e } from "../chunks/CpIXTVFU2.mjs";
1
+ import { t as e } from "../chunks/lPQBM7xc2.mjs";
2
2
  export { e as default };
@@ -1,2 +1,2 @@
1
- import { t as e } from "../chunks/Dje2xUVd2.mjs";
1
+ import { t as e } from "../chunks/D5_ezGUV2.mjs";
2
2
  export { e as default };
@@ -1 +1 @@
1
- .form-item{--el-disabled-text-color:#606266;--el-text-color-placeholder:var(--el-disabled-text-color)}.form-item .el-checkbox,.form-item .el-radio__input.is-disabled .el-radio__inner:after{--el-checkbox-disabled-checked-icon-color:#606266;--el-text-color-placeholder:#606266}.form-item.with-tips .el-form-item__content{flex-wrap:nowrap}.form-item.required.el-form-item.is-required>.el-form-item__label:before,.form-item.required.el-form-item.is-required>.el-form-item__label-wrap>.el-form-item__label:before{display:block!important}.form-item-input-info{color:gray;cursor:help;margin-left:4px;font-size:16px}.form-item.el-form-item.is-required:not(.is-no-asterisk) .el-form-item__label:before{color:#f56c6c;content:"*";margin-right:4px;display:inline}.form-item.el-form-item .el-form-item__content{min-height:29px}.form-item.el-form-item.el-form-item--mini .el-form-item__content{line-height:27px}.form-item.el-form-item.form-item-hide-label{margin-left:6px}.form-item.el-form-item.form-item-hide-label .el-form-item__label{display:none}.form-item-input-wrapper{flex-direction:row;align-items:center;width:100%;display:flex}.form-item-input-wrapper>form{width:100%}.form-item-input-wrapper .el-input{flex:auto}.form-item-input-wrapper .form-item-input-info{color:gray;cursor:help;margin-left:4px;font-size:16px}@media print{.form-item-input-info{display:none}}
1
+ .form-item{--el-disabled-text-color:#606266}.form-item .el-checkbox,.form-item .el-radio__input.is-disabled .el-radio__inner:after{--el-checkbox-disabled-checked-icon-color:#606266;--el-text-color-placeholder:#606266}.form-item.with-tips .el-form-item__content{flex-wrap:nowrap}.form-item.required.el-form-item.is-required>.el-form-item__label:before,.form-item.required.el-form-item.is-required>.el-form-item__label-wrap>.el-form-item__label:before{display:block!important}.form-item-input-info{color:gray;cursor:help;margin-left:4px;font-size:16px}.form-item.el-form-item.is-required:not(.is-no-asterisk) .el-form-item__label:before{color:#f56c6c;content:"*";margin-right:4px;display:inline}.form-item.el-form-item .el-form-item__content{min-height:29px}.form-item.el-form-item.el-form-item--mini .el-form-item__content{line-height:27px}.form-item.el-form-item.form-item-hide-label{margin-left:6px}.form-item.el-form-item.form-item-hide-label .el-form-item__label{display:none}.form-item-input-wrapper{flex-direction:row;align-items:center;width:100%;display:flex}.form-item-input-wrapper>form{width:100%}.form-item-input-wrapper .el-input{flex:auto}.form-item-input-wrapper .form-item-input-info{color:gray;cursor:help;margin-left:4px;font-size:16px}@media print{.form-item-input-info{display:none}}
@@ -1,2 +1,2 @@
1
- import { t as e } from "../chunks/CFKKwzh72.mjs";
1
+ import { t as e } from "../chunks/BVsvRLea2.mjs";
2
2
  export { e as default };
@@ -1,2 +1,2 @@
1
- import { t as e } from "../chunks/DNiq6hHj2.mjs";
1
+ import { t as e } from "../chunks/BK6DiJfX2.mjs";
2
2
  export { e as default };
@@ -1,2 +1,2 @@
1
- import { t as e } from "../chunks/D_gR5ibl2.mjs";
1
+ import { t as e } from "../chunks/uDwSrV7X2.mjs";
2
2
  export { e as default };