@fecp/mobile 1.0.12 → 1.0.14

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 (24) hide show
  1. package/es/packages/mobile/index.mjs +2 -0
  2. package/es/packages/mobile/src/components/all.mjs +2 -0
  3. package/es/packages/mobile/src/components/form/field/Field.vue.mjs +23 -18
  4. package/es/packages/mobile/src/components/form/field/index.mjs +2 -2
  5. package/es/packages/mobile/src/components/form/fieldCalendarPicker/FieldCalendarPicker.vue.mjs +2 -3
  6. package/es/packages/mobile/src/components/form/fieldCascaderPicker/fieldCascaderPicker.vue.mjs +2 -3
  7. package/es/packages/mobile/src/components/form/fieldDatePicker/FieldDatePicker.vue.mjs +2 -3
  8. package/es/packages/mobile/src/components/form/fieldPicker/FieldPicker.vue.mjs +2 -3
  9. package/es/packages/mobile/src/components/form/fieldTimePicker/FieldTimePicker.vue.mjs +2 -3
  10. package/es/packages/mobile/src/components/form/submitButton/SubmitButton.vue.mjs +26 -0
  11. package/es/packages/mobile/src/components/form/submitButton/index.mjs +10 -0
  12. package/es/packages/mobile/src/utils/formRule.mjs +54 -0
  13. package/lib/packages/mobile/index.js +32 -30
  14. package/lib/packages/mobile/src/components/all.js +32 -30
  15. package/lib/packages/mobile/src/components/form/field/Field.vue.js +22 -17
  16. package/lib/packages/mobile/src/components/form/fieldCalendarPicker/FieldCalendarPicker.vue.js +2 -3
  17. package/lib/packages/mobile/src/components/form/fieldCascaderPicker/fieldCascaderPicker.vue.js +2 -3
  18. package/lib/packages/mobile/src/components/form/fieldDatePicker/FieldDatePicker.vue.js +2 -3
  19. package/lib/packages/mobile/src/components/form/fieldPicker/FieldPicker.vue.js +2 -3
  20. package/lib/packages/mobile/src/components/form/fieldTimePicker/FieldTimePicker.vue.js +2 -3
  21. package/lib/packages/mobile/src/components/form/submitButton/SubmitButton.vue.js +26 -0
  22. package/lib/packages/mobile/src/components/form/submitButton/index.js +10 -0
  23. package/lib/packages/mobile/src/utils/formRule.js +54 -0
  24. package/package.json +1 -1
@@ -43,6 +43,7 @@ import { MobileRadioGroup } from "./src/components/form/radioGroup/index.mjs";
43
43
  import { MobileSearch } from "./src/components/form/search/index.mjs";
44
44
  import { MobileTimePicker } from "./src/components/form/timePicker/index.mjs";
45
45
  import { MobileUploader } from "./src/components/form/uploader/index.mjs";
46
+ import { MobileSubmitButton } from "./src/components/form/submitButton/index.mjs";
46
47
  import { MobileActionBar } from "./src/components/navigation/actionBar/index.mjs";
47
48
  import { MobileBackTop } from "./src/components/navigation/backTop/index.mjs";
48
49
  import { MobileGrid } from "./src/components/navigation/grid/index.mjs";
@@ -117,6 +118,7 @@ export {
117
118
  MobileSidebarItem,
118
119
  MobileStep,
119
120
  MobileSteps,
121
+ MobileSubmitButton,
120
122
  MobileSwipe,
121
123
  MobileSwipeCell,
122
124
  MobileSwipeItem,
@@ -41,6 +41,7 @@ import { MobileRadioGroup } from "./form/radioGroup/index.mjs";
41
41
  import { MobileSearch } from "./form/search/index.mjs";
42
42
  import { MobileTimePicker } from "./form/timePicker/index.mjs";
43
43
  import { MobileUploader } from "./form/uploader/index.mjs";
44
+ import { MobileSubmitButton } from "./form/submitButton/index.mjs";
44
45
  import { MobileActionBar } from "./navigation/actionBar/index.mjs";
45
46
  import { MobileBackTop } from "./navigation/backTop/index.mjs";
46
47
  import { MobileGrid } from "./navigation/grid/index.mjs";
@@ -104,6 +105,7 @@ export {
104
105
  MobileSidebarItem,
105
106
  MobileStep,
106
107
  MobileSteps,
108
+ MobileSubmitButton,
107
109
  MobileSwipe,
108
110
  MobileSwipeCell,
109
111
  MobileSwipeItem,
@@ -3,24 +3,29 @@
3
3
  /* empty css */
4
4
  /* empty css */
5
5
  /* empty css */
6
- import { createBlock, openBlock, normalizeProps, guardReactiveProps, createSlots, renderList, withCtx, renderSlot } from "vue";
7
- import _export_sfc from "../../../../../../_virtual/_plugin-vue_export-helper.mjs";
6
+ import { useAttrs, createBlock, openBlock, mergeProps, unref, createSlots, renderList, withCtx, renderSlot } from "vue";
7
+ import { parseRule } from "../../../utils/formRule.mjs";
8
8
  import { Field } from "../../../../../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/field/index.mjs";
9
- const _sfc_main = {};
10
- function _sfc_render(_ctx, _cache) {
11
- const _component_van_field = Field;
12
- return openBlock(), createBlock(_component_van_field, normalizeProps(guardReactiveProps(_ctx.$attrs)), createSlots({ _: 2 }, [
13
- renderList(_ctx.$slots, (item, key) => {
14
- return {
15
- name: key,
16
- fn: withCtx(() => [
17
- renderSlot(_ctx.$slots, key)
18
- ])
19
- };
20
- })
21
- ]), 1040);
22
- }
23
- const _Field = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
9
+ const _sfc_main = {
10
+ __name: "Field",
11
+ setup(__props) {
12
+ const attrs = useAttrs();
13
+ const rules = parseRule(attrs);
14
+ return (_ctx, _cache) => {
15
+ const _component_van_field = Field;
16
+ return openBlock(), createBlock(_component_van_field, mergeProps(_ctx.$attrs, { rules: unref(rules) }), createSlots({ _: 2 }, [
17
+ renderList(_ctx.$slots, (item, key) => {
18
+ return {
19
+ name: key,
20
+ fn: withCtx(() => [
21
+ renderSlot(_ctx.$slots, key)
22
+ ])
23
+ };
24
+ })
25
+ ]), 1040, ["rules"]);
26
+ };
27
+ }
28
+ };
24
29
  export {
25
- _Field as default
30
+ _sfc_main as default
26
31
  };
@@ -1,6 +1,6 @@
1
- import _Field from "./Field.vue.mjs";
1
+ import _sfc_main from "./Field.vue.mjs";
2
2
  import install from "../../../utils/install.mjs";
3
- const MobileField = install.withInstall("MobileField", _Field);
3
+ const MobileField = install.withInstall("MobileField", _sfc_main);
4
4
  export {
5
5
  MobileField,
6
6
  MobileField as default
@@ -126,13 +126,12 @@ const _sfc_main = {
126
126
  const _component_van_field = Field;
127
127
  const _component_van_calendar = Calendar;
128
128
  return openBlock(), createElementBlock(Fragment, null, [
129
- createVNode(_component_van_field, mergeProps({
129
+ createVNode(_component_van_field, mergeProps(_ctx.$attrs, {
130
130
  modelValue: unref(fieldTextValue),
131
131
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(fieldTextValue) ? fieldTextValue.value = $event : null),
132
132
  "is-link": "",
133
133
  readonly: "",
134
- name: "picker"
135
- }, _ctx.$attrs, {
134
+ name: "picker",
136
135
  onClick: _cache[1] || (_cache[1] = ($event) => showCalendar.value = true)
137
136
  }), createSlots({ _: 2 }, [
138
137
  renderList(_ctx.$slots, (item, key) => {
@@ -96,13 +96,12 @@ const _sfc_main = {
96
96
  const _component_van_cascader = Cascader;
97
97
  const _component_van_popup = Popup;
98
98
  return openBlock(), createElementBlock(Fragment, null, [
99
- createVNode(_component_van_field, mergeProps({
99
+ createVNode(_component_van_field, mergeProps(_ctx.$attrs, {
100
100
  modelValue: unref(fieldTextValue),
101
101
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(fieldTextValue) ? fieldTextValue.value = $event : null),
102
102
  "is-link": "",
103
103
  readonly: "",
104
- name: "picker"
105
- }, _ctx.$attrs, {
104
+ name: "picker",
106
105
  onClick: _cache[1] || (_cache[1] = ($event) => showPicker.value = true)
107
106
  }), createSlots({ _: 2 }, [
108
107
  renderList(_ctx.$slots, (item, key) => {
@@ -74,13 +74,12 @@ const _sfc_main = {
74
74
  const _component_van_date_picker = DatePicker;
75
75
  const _component_van_popup = Popup;
76
76
  return openBlock(), createElementBlock(Fragment, null, [
77
- createVNode(_component_van_field, mergeProps({
77
+ createVNode(_component_van_field, mergeProps(_ctx.$attrs, {
78
78
  modelValue: unref(fieldTextValue),
79
79
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(fieldTextValue) ? fieldTextValue.value = $event : null),
80
80
  "is-link": "",
81
81
  readonly: "",
82
- name: "picker"
83
- }, _ctx.$attrs, {
82
+ name: "picker",
84
83
  onClick: _cache[1] || (_cache[1] = ($event) => showPicker.value = true)
85
84
  }), createSlots({ _: 2 }, [
86
85
  renderList(_ctx.$slots, (item, key) => {
@@ -73,13 +73,12 @@ const _sfc_main = {
73
73
  const _component_van_picker = Picker;
74
74
  const _component_van_popup = Popup;
75
75
  return openBlock(), createElementBlock(Fragment, null, [
76
- createVNode(_component_van_field, mergeProps({
76
+ createVNode(_component_van_field, mergeProps(_ctx.$attrs, {
77
77
  modelValue: unref(fieldTextValue),
78
78
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(fieldTextValue) ? fieldTextValue.value = $event : null),
79
79
  "is-link": "",
80
80
  readonly: "",
81
- name: "picker"
82
- }, _ctx.$attrs, {
81
+ name: "picker",
83
82
  onClick: _cache[1] || (_cache[1] = ($event) => showPicker.value = true)
84
83
  }), createSlots({ _: 2 }, [
85
84
  renderList(_ctx.$slots, (item, key) => {
@@ -74,13 +74,12 @@ const _sfc_main = {
74
74
  const _component_van_time_picker = TimePicker;
75
75
  const _component_van_popup = Popup;
76
76
  return openBlock(), createElementBlock(Fragment, null, [
77
- createVNode(_component_van_field, mergeProps({
77
+ createVNode(_component_van_field, mergeProps(_ctx.$attrs, {
78
78
  modelValue: unref(fieldTextValue),
79
79
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(fieldTextValue) ? fieldTextValue.value = $event : null),
80
80
  "is-link": "",
81
81
  readonly: "",
82
- name: "picker"
83
- }, _ctx.$attrs, {
82
+ name: "picker",
84
83
  onClick: _cache[1] || (_cache[1] = ($event) => showPicker.value = true)
85
84
  }), createSlots({ _: 2 }, [
86
85
  renderList(_ctx.$slots, (item, key) => {
@@ -0,0 +1,26 @@
1
+ /* empty css */
2
+ /* empty css */
3
+ /* empty css */
4
+ /* empty css */
5
+ /* empty css */
6
+ import { createBlock, openBlock, mergeProps, createSlots, renderList, withCtx, renderSlot } from "vue";
7
+ import _export_sfc from "../../../../../../_virtual/_plugin-vue_export-helper.mjs";
8
+ import { Button } from "../../../../../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/button/index.mjs";
9
+ const _sfc_main = {};
10
+ function _sfc_render(_ctx, _cache) {
11
+ const _component_van_button = Button;
12
+ return openBlock(), createBlock(_component_van_button, mergeProps(_ctx.$attrs, { "native-type": "submit" }), createSlots({ _: 2 }, [
13
+ renderList(_ctx.$slots, (item, key) => {
14
+ return {
15
+ name: key,
16
+ fn: withCtx(() => [
17
+ renderSlot(_ctx.$slots, key)
18
+ ])
19
+ };
20
+ })
21
+ ]), 1040);
22
+ }
23
+ const _SubmitButton = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
24
+ export {
25
+ _SubmitButton as default
26
+ };
@@ -0,0 +1,10 @@
1
+ import _SubmitButton from "./SubmitButton.vue.mjs";
2
+ import install from "../../../utils/install.mjs";
3
+ const MobileSubmitButton = install.withInstall(
4
+ "MobileSubmitButton",
5
+ _SubmitButton
6
+ );
7
+ export {
8
+ MobileSubmitButton,
9
+ MobileSubmitButton as default
10
+ };
@@ -0,0 +1,54 @@
1
+ const parseRule = ({ label, isRequired, ruleType }) => {
2
+ const ruleList = [];
3
+ if (isRequired) {
4
+ ruleList.push({ required: true, message: `请填写${label}` });
5
+ }
6
+ switch (ruleType) {
7
+ case "email":
8
+ break;
9
+ case "phone":
10
+ var pattern = /^((\+?86)|(\(\+86\)))?(1[3-9]\d{9})$/;
11
+ ruleList.push({ pattern, message: `请填写正确的${label}` });
12
+ break;
13
+ case "mobile":
14
+ var pattern = /^([0-9]{3,4}-)?[0-9]{7,8}$/;
15
+ ruleList.push({ pattern, message: `请填写正确的${label}` });
16
+ break;
17
+ case "mobilephone":
18
+ let validator = function(value) {
19
+ var isPhone = /^([0-9]{3,4}-)?[0-9]{7,8}$/;
20
+ var isMob = /^((\+?86)|(\(\+86\)))?(1[3-9]\d{9})$/;
21
+ if (isMob.test(value) || isPhone.test(value)) {
22
+ return true;
23
+ } else {
24
+ return `请填写正确的${label}`;
25
+ }
26
+ };
27
+ ruleList.push({ validator });
28
+ break;
29
+ case "idNo":
30
+ var pattern = /^(1[1-5]|2[1-3]|3[1-7]|4[1-6]|5[0-4]|6[1-5]|7[1-8]|8[1-3])\d{4}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/;
31
+ ruleList.push({ pattern, message: `请填写正确的${label}` });
32
+ break;
33
+ case "usci":
34
+ var pattern = /^([0-9A-HJ-NPQRTUWXY]{2}\d{6}[0-9A-HJ-NPQRTUWXY]{10}|[1-9]\d{14})$/;
35
+ ruleList.push({ pattern, message: `请填写正确的${label}` });
36
+ break;
37
+ case "postcode":
38
+ var pattern = /^[0-9]{6}$/;
39
+ ruleList.push({ pattern, message: `请填写正确的${label}` });
40
+ break;
41
+ case "fax":
42
+ var pattern = /^([0-9]{3,4}-)?[0-9]{7,8}$/;
43
+ ruleList.push({ pattern, message: `请填写正确的${label}` });
44
+ break;
45
+ case "bankcard":
46
+ var pattern = /^[1-9]\d{7,29}$/;
47
+ ruleList.push({ pattern, message: `请填写正确的${label}` });
48
+ break;
49
+ }
50
+ return ruleList;
51
+ };
52
+ export {
53
+ parseRule
54
+ };
@@ -45,21 +45,22 @@ const index$E = require("./src/components/form/radioGroup/index.js");
45
45
  const index$F = require("./src/components/form/search/index.js");
46
46
  const index$G = require("./src/components/form/timePicker/index.js");
47
47
  const index$H = require("./src/components/form/uploader/index.js");
48
- const index$I = require("./src/components/navigation/actionBar/index.js");
49
- const index$J = require("./src/components/navigation/backTop/index.js");
50
- const index$K = require("./src/components/navigation/grid/index.js");
51
- const index$L = require("./src/components/navigation/gridItem/index.js");
52
- const index$M = require("./src/components/navigation/indexBar/index.js");
53
- const index$N = require("./src/components/navigation/indexAnchor/index.js");
54
- const index$O = require("./src/components/navigation/navBar/index.js");
55
- const index$P = require("./src/components/navigation/pagination/index.js");
56
- const index$Q = require("./src/components/navigation/sidebar/index.js");
57
- const index$R = require("./src/components/navigation/sidebarItem/index.js");
58
- const index$S = require("./src/components/navigation/tab/index.js");
59
- const index$T = require("./src/components/navigation/tabs/index.js");
60
- const index$U = require("./src/components/navigation/tabbar/index.js");
61
- const index$V = require("./src/components/navigation/tabbarItem/index.js");
62
- const index$W = require("./src/components/navigation/treeSelect/index.js");
48
+ const index$I = require("./src/components/form/submitButton/index.js");
49
+ const index$J = require("./src/components/navigation/actionBar/index.js");
50
+ const index$K = require("./src/components/navigation/backTop/index.js");
51
+ const index$L = require("./src/components/navigation/grid/index.js");
52
+ const index$M = require("./src/components/navigation/gridItem/index.js");
53
+ const index$N = require("./src/components/navigation/indexBar/index.js");
54
+ const index$O = require("./src/components/navigation/indexAnchor/index.js");
55
+ const index$P = require("./src/components/navigation/navBar/index.js");
56
+ const index$Q = require("./src/components/navigation/pagination/index.js");
57
+ const index$R = require("./src/components/navigation/sidebar/index.js");
58
+ const index$S = require("./src/components/navigation/sidebarItem/index.js");
59
+ const index$T = require("./src/components/navigation/tab/index.js");
60
+ const index$U = require("./src/components/navigation/tabs/index.js");
61
+ const index$V = require("./src/components/navigation/tabbar/index.js");
62
+ const index$W = require("./src/components/navigation/tabbarItem/index.js");
63
+ const index$X = require("./src/components/navigation/treeSelect/index.js");
63
64
  const functionCall = require("../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/dialog/function-call.js");
64
65
  const functionCall$1 = require("../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/image-preview/function-call.js");
65
66
  const functionCall$2 = require("../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/notify/function-call.js");
@@ -114,21 +115,22 @@ exports.MobileRadioGroup = index$E.MobileRadioGroup;
114
115
  exports.MobileSearch = index$F.MobileSearch;
115
116
  exports.MobileTimePicker = index$G.MobileTimePicker;
116
117
  exports.MobileUploader = index$H.MobileUploader;
117
- exports.MobileActionBar = index$I.MobileActionBar;
118
- exports.MobileBackTop = index$J.MobileBackTop;
119
- exports.MobileGrid = index$K.MobileGrid;
120
- exports.MobileGridItem = index$L.MobileGridItem;
121
- exports.MobileIndexBar = index$M.MobileIndexBar;
122
- exports.MobileIndexAnchor = index$N.MobileIndexAnchor;
123
- exports.MobileNavBar = index$O.MobileNavBar;
124
- exports.MobilePagination = index$P.MobilePagination;
125
- exports.MobileSidebar = index$Q.MobileSidebar;
126
- exports.MobileSidebarItem = index$R.MobileSidebarItem;
127
- exports.MobileTab = index$S.MobileTab;
128
- exports.MobileTabs = index$T.MobileTabs;
129
- exports.MobileTabbar = index$U.MobileTabbar;
130
- exports.MobileTabbarItem = index$V.MobileTabbarItem;
131
- exports.MobileTreeSelect = index$W.MobileTreeSelect;
118
+ exports.MobileSubmitButton = index$I.MobileSubmitButton;
119
+ exports.MobileActionBar = index$J.MobileActionBar;
120
+ exports.MobileBackTop = index$K.MobileBackTop;
121
+ exports.MobileGrid = index$L.MobileGrid;
122
+ exports.MobileGridItem = index$M.MobileGridItem;
123
+ exports.MobileIndexBar = index$N.MobileIndexBar;
124
+ exports.MobileIndexAnchor = index$O.MobileIndexAnchor;
125
+ exports.MobileNavBar = index$P.MobileNavBar;
126
+ exports.MobilePagination = index$Q.MobilePagination;
127
+ exports.MobileSidebar = index$R.MobileSidebar;
128
+ exports.MobileSidebarItem = index$S.MobileSidebarItem;
129
+ exports.MobileTab = index$T.MobileTab;
130
+ exports.MobileTabs = index$U.MobileTabs;
131
+ exports.MobileTabbar = index$V.MobileTabbar;
132
+ exports.MobileTabbarItem = index$W.MobileTabbarItem;
133
+ exports.MobileTreeSelect = index$X.MobileTreeSelect;
132
134
  exports.closeDialog = functionCall.closeDialog;
133
135
  exports.showConfirmDialog = functionCall.showConfirmDialog;
134
136
  exports.showDialog = functionCall.showDialog;
@@ -43,21 +43,22 @@ const index$D = require("./form/radioGroup/index.js");
43
43
  const index$E = require("./form/search/index.js");
44
44
  const index$F = require("./form/timePicker/index.js");
45
45
  const index$G = require("./form/uploader/index.js");
46
- const index$H = require("./navigation/actionBar/index.js");
47
- const index$I = require("./navigation/backTop/index.js");
48
- const index$J = require("./navigation/grid/index.js");
49
- const index$K = require("./navigation/gridItem/index.js");
50
- const index$L = require("./navigation/indexBar/index.js");
51
- const index$M = require("./navigation/indexAnchor/index.js");
52
- const index$N = require("./navigation/navBar/index.js");
53
- const index$O = require("./navigation/pagination/index.js");
54
- const index$P = require("./navigation/sidebar/index.js");
55
- const index$Q = require("./navigation/sidebarItem/index.js");
56
- const index$R = require("./navigation/tab/index.js");
57
- const index$S = require("./navigation/tabs/index.js");
58
- const index$T = require("./navigation/tabbar/index.js");
59
- const index$U = require("./navigation/tabbarItem/index.js");
60
- const index$V = require("./navigation/treeSelect/index.js");
46
+ const index$H = require("./form/submitButton/index.js");
47
+ const index$I = require("./navigation/actionBar/index.js");
48
+ const index$J = require("./navigation/backTop/index.js");
49
+ const index$K = require("./navigation/grid/index.js");
50
+ const index$L = require("./navigation/gridItem/index.js");
51
+ const index$M = require("./navigation/indexBar/index.js");
52
+ const index$N = require("./navigation/indexAnchor/index.js");
53
+ const index$O = require("./navigation/navBar/index.js");
54
+ const index$P = require("./navigation/pagination/index.js");
55
+ const index$Q = require("./navigation/sidebar/index.js");
56
+ const index$R = require("./navigation/sidebarItem/index.js");
57
+ const index$S = require("./navigation/tab/index.js");
58
+ const index$T = require("./navigation/tabs/index.js");
59
+ const index$U = require("./navigation/tabbar/index.js");
60
+ const index$V = require("./navigation/tabbarItem/index.js");
61
+ const index$W = require("./navigation/treeSelect/index.js");
61
62
  exports.MobileButton = index.MobileButton;
62
63
  exports.MobileCell = index$1.MobileCell;
63
64
  exports.MobileCellGroup = index$2.MobileCellGroup;
@@ -101,18 +102,19 @@ exports.MobileRadioGroup = index$D.MobileRadioGroup;
101
102
  exports.MobileSearch = index$E.MobileSearch;
102
103
  exports.MobileTimePicker = index$F.MobileTimePicker;
103
104
  exports.MobileUploader = index$G.MobileUploader;
104
- exports.MobileActionBar = index$H.MobileActionBar;
105
- exports.MobileBackTop = index$I.MobileBackTop;
106
- exports.MobileGrid = index$J.MobileGrid;
107
- exports.MobileGridItem = index$K.MobileGridItem;
108
- exports.MobileIndexBar = index$L.MobileIndexBar;
109
- exports.MobileIndexAnchor = index$M.MobileIndexAnchor;
110
- exports.MobileNavBar = index$N.MobileNavBar;
111
- exports.MobilePagination = index$O.MobilePagination;
112
- exports.MobileSidebar = index$P.MobileSidebar;
113
- exports.MobileSidebarItem = index$Q.MobileSidebarItem;
114
- exports.MobileTab = index$R.MobileTab;
115
- exports.MobileTabs = index$S.MobileTabs;
116
- exports.MobileTabbar = index$T.MobileTabbar;
117
- exports.MobileTabbarItem = index$U.MobileTabbarItem;
118
- exports.MobileTreeSelect = index$V.MobileTreeSelect;
105
+ exports.MobileSubmitButton = index$H.MobileSubmitButton;
106
+ exports.MobileActionBar = index$I.MobileActionBar;
107
+ exports.MobileBackTop = index$J.MobileBackTop;
108
+ exports.MobileGrid = index$K.MobileGrid;
109
+ exports.MobileGridItem = index$L.MobileGridItem;
110
+ exports.MobileIndexBar = index$M.MobileIndexBar;
111
+ exports.MobileIndexAnchor = index$N.MobileIndexAnchor;
112
+ exports.MobileNavBar = index$O.MobileNavBar;
113
+ exports.MobilePagination = index$P.MobilePagination;
114
+ exports.MobileSidebar = index$Q.MobileSidebar;
115
+ exports.MobileSidebarItem = index$R.MobileSidebarItem;
116
+ exports.MobileTab = index$S.MobileTab;
117
+ exports.MobileTabs = index$T.MobileTabs;
118
+ exports.MobileTabbar = index$U.MobileTabbar;
119
+ exports.MobileTabbarItem = index$V.MobileTabbarItem;
120
+ exports.MobileTreeSelect = index$W.MobileTreeSelect;
@@ -6,21 +6,26 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
6
6
  ;/* empty css */
7
7
  ;/* empty css */
8
8
  const vue = require("vue");
9
- const _pluginVue_exportHelper = require("../../../../../../_virtual/_plugin-vue_export-helper.js");
9
+ const formRule = require("../../../utils/formRule.js");
10
10
  const index = require("../../../../../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/field/index.js");
11
- const _sfc_main = {};
12
- function _sfc_render(_ctx, _cache) {
13
- const _component_van_field = index.Field;
14
- return vue.openBlock(), vue.createBlock(_component_van_field, vue.normalizeProps(vue.guardReactiveProps(_ctx.$attrs)), vue.createSlots({ _: 2 }, [
15
- vue.renderList(_ctx.$slots, (item, key) => {
16
- return {
17
- name: key,
18
- fn: vue.withCtx(() => [
19
- vue.renderSlot(_ctx.$slots, key)
20
- ])
21
- };
22
- })
23
- ]), 1040);
24
- }
25
- const _Field = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["render", _sfc_render]]);
26
- exports.default = _Field;
11
+ const _sfc_main = {
12
+ __name: "Field",
13
+ setup(__props) {
14
+ const attrs = vue.useAttrs();
15
+ const rules = formRule.parseRule(attrs);
16
+ return (_ctx, _cache) => {
17
+ const _component_van_field = index.Field;
18
+ return vue.openBlock(), vue.createBlock(_component_van_field, vue.mergeProps(_ctx.$attrs, { rules: vue.unref(rules) }), vue.createSlots({ _: 2 }, [
19
+ vue.renderList(_ctx.$slots, (item, key) => {
20
+ return {
21
+ name: key,
22
+ fn: vue.withCtx(() => [
23
+ vue.renderSlot(_ctx.$slots, key)
24
+ ])
25
+ };
26
+ })
27
+ ]), 1040, ["rules"]);
28
+ };
29
+ }
30
+ };
31
+ exports.default = _sfc_main;
@@ -128,13 +128,12 @@ const _sfc_main = {
128
128
  const _component_van_field = index.Field;
129
129
  const _component_van_calendar = index$1.Calendar;
130
130
  return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
131
- vue.createVNode(_component_van_field, vue.mergeProps({
131
+ vue.createVNode(_component_van_field, vue.mergeProps(_ctx.$attrs, {
132
132
  modelValue: vue.unref(fieldTextValue),
133
133
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => vue.isRef(fieldTextValue) ? fieldTextValue.value = $event : null),
134
134
  "is-link": "",
135
135
  readonly: "",
136
- name: "picker"
137
- }, _ctx.$attrs, {
136
+ name: "picker",
138
137
  onClick: _cache[1] || (_cache[1] = ($event) => showCalendar.value = true)
139
138
  }), vue.createSlots({ _: 2 }, [
140
139
  vue.renderList(_ctx.$slots, (item, key) => {
@@ -98,13 +98,12 @@ const _sfc_main = {
98
98
  const _component_van_cascader = index$2.Cascader;
99
99
  const _component_van_popup = index$1.Popup;
100
100
  return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
101
- vue.createVNode(_component_van_field, vue.mergeProps({
101
+ vue.createVNode(_component_van_field, vue.mergeProps(_ctx.$attrs, {
102
102
  modelValue: vue.unref(fieldTextValue),
103
103
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => vue.isRef(fieldTextValue) ? fieldTextValue.value = $event : null),
104
104
  "is-link": "",
105
105
  readonly: "",
106
- name: "picker"
107
- }, _ctx.$attrs, {
106
+ name: "picker",
108
107
  onClick: _cache[1] || (_cache[1] = ($event) => showPicker.value = true)
109
108
  }), vue.createSlots({ _: 2 }, [
110
109
  vue.renderList(_ctx.$slots, (item, key) => {
@@ -76,13 +76,12 @@ const _sfc_main = {
76
76
  const _component_van_date_picker = index$2.DatePicker;
77
77
  const _component_van_popup = index$1.Popup;
78
78
  return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
79
- vue.createVNode(_component_van_field, vue.mergeProps({
79
+ vue.createVNode(_component_van_field, vue.mergeProps(_ctx.$attrs, {
80
80
  modelValue: vue.unref(fieldTextValue),
81
81
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => vue.isRef(fieldTextValue) ? fieldTextValue.value = $event : null),
82
82
  "is-link": "",
83
83
  readonly: "",
84
- name: "picker"
85
- }, _ctx.$attrs, {
84
+ name: "picker",
86
85
  onClick: _cache[1] || (_cache[1] = ($event) => showPicker.value = true)
87
86
  }), vue.createSlots({ _: 2 }, [
88
87
  vue.renderList(_ctx.$slots, (item, key) => {
@@ -75,13 +75,12 @@ const _sfc_main = {
75
75
  const _component_van_picker = index$2.Picker;
76
76
  const _component_van_popup = index$1.Popup;
77
77
  return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
78
- vue.createVNode(_component_van_field, vue.mergeProps({
78
+ vue.createVNode(_component_van_field, vue.mergeProps(_ctx.$attrs, {
79
79
  modelValue: vue.unref(fieldTextValue),
80
80
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => vue.isRef(fieldTextValue) ? fieldTextValue.value = $event : null),
81
81
  "is-link": "",
82
82
  readonly: "",
83
- name: "picker"
84
- }, _ctx.$attrs, {
83
+ name: "picker",
85
84
  onClick: _cache[1] || (_cache[1] = ($event) => showPicker.value = true)
86
85
  }), vue.createSlots({ _: 2 }, [
87
86
  vue.renderList(_ctx.$slots, (item, key) => {
@@ -76,13 +76,12 @@ const _sfc_main = {
76
76
  const _component_van_time_picker = index$2.TimePicker;
77
77
  const _component_van_popup = index$1.Popup;
78
78
  return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
79
- vue.createVNode(_component_van_field, vue.mergeProps({
79
+ vue.createVNode(_component_van_field, vue.mergeProps(_ctx.$attrs, {
80
80
  modelValue: vue.unref(fieldTextValue),
81
81
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => vue.isRef(fieldTextValue) ? fieldTextValue.value = $event : null),
82
82
  "is-link": "",
83
83
  readonly: "",
84
- name: "picker"
85
- }, _ctx.$attrs, {
84
+ name: "picker",
86
85
  onClick: _cache[1] || (_cache[1] = ($event) => showPicker.value = true)
87
86
  }), vue.createSlots({ _: 2 }, [
88
87
  vue.renderList(_ctx.$slots, (item, key) => {
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
+ ;/* empty css */
4
+ ;/* empty css */
5
+ ;/* empty css */
6
+ ;/* empty css */
7
+ ;/* empty css */
8
+ const vue = require("vue");
9
+ const _pluginVue_exportHelper = require("../../../../../../_virtual/_plugin-vue_export-helper.js");
10
+ const index = require("../../../../../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/button/index.js");
11
+ const _sfc_main = {};
12
+ function _sfc_render(_ctx, _cache) {
13
+ const _component_van_button = index.Button;
14
+ return vue.openBlock(), vue.createBlock(_component_van_button, vue.mergeProps(_ctx.$attrs, { "native-type": "submit" }), vue.createSlots({ _: 2 }, [
15
+ vue.renderList(_ctx.$slots, (item, key) => {
16
+ return {
17
+ name: key,
18
+ fn: vue.withCtx(() => [
19
+ vue.renderSlot(_ctx.$slots, key)
20
+ ])
21
+ };
22
+ })
23
+ ]), 1040);
24
+ }
25
+ const _SubmitButton = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["render", _sfc_render]]);
26
+ exports.default = _SubmitButton;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
+ const SubmitButton = require("./SubmitButton.vue.js");
4
+ const install = require("../../../utils/install.js");
5
+ const MobileSubmitButton = install.default.withInstall(
6
+ "MobileSubmitButton",
7
+ SubmitButton.default
8
+ );
9
+ exports.MobileSubmitButton = MobileSubmitButton;
10
+ exports.default = MobileSubmitButton;
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const parseRule = ({ label, isRequired, ruleType }) => {
4
+ const ruleList = [];
5
+ if (isRequired) {
6
+ ruleList.push({ required: true, message: `请填写${label}` });
7
+ }
8
+ switch (ruleType) {
9
+ case "email":
10
+ break;
11
+ case "phone":
12
+ var pattern = /^((\+?86)|(\(\+86\)))?(1[3-9]\d{9})$/;
13
+ ruleList.push({ pattern, message: `请填写正确的${label}` });
14
+ break;
15
+ case "mobile":
16
+ var pattern = /^([0-9]{3,4}-)?[0-9]{7,8}$/;
17
+ ruleList.push({ pattern, message: `请填写正确的${label}` });
18
+ break;
19
+ case "mobilephone":
20
+ let validator = function(value) {
21
+ var isPhone = /^([0-9]{3,4}-)?[0-9]{7,8}$/;
22
+ var isMob = /^((\+?86)|(\(\+86\)))?(1[3-9]\d{9})$/;
23
+ if (isMob.test(value) || isPhone.test(value)) {
24
+ return true;
25
+ } else {
26
+ return `请填写正确的${label}`;
27
+ }
28
+ };
29
+ ruleList.push({ validator });
30
+ break;
31
+ case "idNo":
32
+ var pattern = /^(1[1-5]|2[1-3]|3[1-7]|4[1-6]|5[0-4]|6[1-5]|7[1-8]|8[1-3])\d{4}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/;
33
+ ruleList.push({ pattern, message: `请填写正确的${label}` });
34
+ break;
35
+ case "usci":
36
+ var pattern = /^([0-9A-HJ-NPQRTUWXY]{2}\d{6}[0-9A-HJ-NPQRTUWXY]{10}|[1-9]\d{14})$/;
37
+ ruleList.push({ pattern, message: `请填写正确的${label}` });
38
+ break;
39
+ case "postcode":
40
+ var pattern = /^[0-9]{6}$/;
41
+ ruleList.push({ pattern, message: `请填写正确的${label}` });
42
+ break;
43
+ case "fax":
44
+ var pattern = /^([0-9]{3,4}-)?[0-9]{7,8}$/;
45
+ ruleList.push({ pattern, message: `请填写正确的${label}` });
46
+ break;
47
+ case "bankcard":
48
+ var pattern = /^[1-9]\d{7,29}$/;
49
+ ruleList.push({ pattern, message: `请填写正确的${label}` });
50
+ break;
51
+ }
52
+ return ruleList;
53
+ };
54
+ exports.parseRule = parseRule;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fecp/mobile",
3
- "version": "1.0.12",
3
+ "version": "1.0.14",
4
4
  "main": "lib/packages/mobile/index.js",
5
5
  "module": "es/packages/mobile/index.mjs",
6
6
  "files": [