@fecp/mobile 1.0.19 → 1.0.21

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 (28) 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/checkboxGroup/CheckboxGroup.vue.mjs +1 -1
  4. package/es/packages/mobile/src/components/form/field/Field.vue.mjs +21 -31
  5. package/es/packages/mobile/src/components/form/field/index.mjs +2 -2
  6. package/es/packages/mobile/src/components/form/fieldCalendarPicker/FieldCalendarPicker.vue.mjs +3 -1
  7. package/es/packages/mobile/src/components/form/fieldCascaderPicker/fieldCascaderPicker.vue.mjs +3 -1
  8. package/es/packages/mobile/src/components/form/fieldCheckbox/FieldCheckbox.vue.mjs +9 -5
  9. package/es/packages/mobile/src/components/form/fieldDatePicker/FieldDatePicker.vue.mjs +3 -1
  10. package/es/packages/mobile/src/components/form/fieldPicker/FieldPicker.vue.mjs +10 -8
  11. package/es/packages/mobile/src/components/form/fieldTimePicker/FieldTimePicker.vue.mjs +3 -1
  12. package/es/packages/mobile/src/components/form/form/Form.vue.mjs +18 -2
  13. package/es/packages/mobile/src/components/form/formItem/FormItem.vue.mjs +70 -0
  14. package/es/packages/mobile/src/components/form/formItem/index.mjs +7 -0
  15. package/lib/packages/mobile/index.js +40 -38
  16. package/lib/packages/mobile/src/components/all.js +40 -38
  17. package/lib/packages/mobile/src/components/form/checkboxGroup/CheckboxGroup.vue.js +1 -1
  18. package/lib/packages/mobile/src/components/form/field/Field.vue.js +20 -30
  19. package/lib/packages/mobile/src/components/form/fieldCalendarPicker/FieldCalendarPicker.vue.js +3 -1
  20. package/lib/packages/mobile/src/components/form/fieldCascaderPicker/fieldCascaderPicker.vue.js +3 -1
  21. package/lib/packages/mobile/src/components/form/fieldCheckbox/FieldCheckbox.vue.js +9 -5
  22. package/lib/packages/mobile/src/components/form/fieldDatePicker/FieldDatePicker.vue.js +3 -1
  23. package/lib/packages/mobile/src/components/form/fieldPicker/FieldPicker.vue.js +10 -8
  24. package/lib/packages/mobile/src/components/form/fieldTimePicker/FieldTimePicker.vue.js +3 -1
  25. package/lib/packages/mobile/src/components/form/form/Form.vue.js +17 -1
  26. package/lib/packages/mobile/src/components/form/formItem/FormItem.vue.js +70 -0
  27. package/lib/packages/mobile/src/components/form/formItem/index.js +7 -0
  28. package/package.json +1 -1
@@ -35,6 +35,7 @@ import { MobileFieldCascaderPicker } from "./src/components/form/fieldCascaderPi
35
35
  import { MobileFieldCheckbox } from "./src/components/form/fieldCheckbox/index.mjs";
36
36
  import { MobileFieldRadio } from "./src/components/form/fieldRadio/index.mjs";
37
37
  import { MobileForm } from "./src/components/form/form/index.mjs";
38
+ import { MobileFormItem } from "./src/components/form/formItem/index.mjs";
38
39
  import { MobileRadioGroup } from "./src/components/form/radioGroup/index.mjs";
39
40
  import { MobileSearch } from "./src/components/form/search/index.mjs";
40
41
  import { MobileUploader } from "./src/components/form/uploader/index.mjs";
@@ -91,6 +92,7 @@ export {
91
92
  MobileFloatingBubble,
92
93
  MobileFloatingPanel,
93
94
  MobileForm,
95
+ MobileFormItem,
94
96
  MobileGrid,
95
97
  MobileGridItem,
96
98
  MobileHighlight,
@@ -33,6 +33,7 @@ import { MobileFieldCascaderPicker } from "./form/fieldCascaderPicker/index.mjs"
33
33
  import { MobileFieldCheckbox } from "./form/fieldCheckbox/index.mjs";
34
34
  import { MobileFieldRadio } from "./form/fieldRadio/index.mjs";
35
35
  import { MobileForm } from "./form/form/index.mjs";
36
+ import { MobileFormItem } from "./form/formItem/index.mjs";
36
37
  import { MobileRadioGroup } from "./form/radioGroup/index.mjs";
37
38
  import { MobileSearch } from "./form/search/index.mjs";
38
39
  import { MobileUploader } from "./form/uploader/index.mjs";
@@ -78,6 +79,7 @@ export {
78
79
  MobileFloatingBubble,
79
80
  MobileFloatingPanel,
80
81
  MobileForm,
82
+ MobileFormItem,
81
83
  MobileGrid,
82
84
  MobileGridItem,
83
85
  MobileHighlight,
@@ -34,7 +34,7 @@ const _sfc_main = {
34
34
  disabled: item[__props.fieldNames.disabled]
35
35
  }, {
36
36
  default: withCtx(() => [
37
- createTextVNode(toDisplayString(item[__props.fieldNames.disabled]) + " " + toDisplayString(item[__props.fieldNames.text]), 1)
37
+ createTextVNode(toDisplayString(item[__props.fieldNames.text]), 1)
38
38
  ]),
39
39
  _: 2
40
40
  }, 1032, ["name", "disabled"]);
@@ -3,37 +3,27 @@
3
3
  /* empty css */
4
4
  /* empty css */
5
5
  /* empty css */
6
- import { useAttrs, computed, createElementBlock, openBlock, Fragment, createVNode, renderSlot, mergeProps, createSlots, renderList, withCtx } from "vue";
7
- import { parseRule } from "../../../utils/formRule.mjs";
6
+ import { createElementBlock, openBlock, Fragment, createVNode, renderSlot, normalizeProps, guardReactiveProps, createSlots, renderList, withCtx } from "vue";
7
+ import _export_sfc from "../../../../../../_virtual/_plugin-vue_export-helper.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
- __name: "Field",
11
- setup(__props) {
12
- const attrs = useAttrs();
13
- const rules = computed(() => {
14
- return parseRule(attrs);
15
- });
16
- return (_ctx, _cache) => {
17
- const _component_van_field = Field;
18
- return openBlock(), createElementBlock(Fragment, null, [
19
- createVNode(_component_van_field, mergeProps(_ctx.$attrs, {
20
- rules: rules.value,
21
- required: "auto"
22
- }), createSlots({ _: 2 }, [
23
- renderList(_ctx.$slots, (item, key) => {
24
- return {
25
- name: key,
26
- fn: withCtx(() => [
27
- renderSlot(_ctx.$slots, key)
28
- ])
29
- };
30
- })
31
- ]), 1040, ["rules"]),
32
- renderSlot(_ctx.$slots, "default")
33
- ], 64);
34
- };
35
- }
36
- };
9
+ const _sfc_main = {};
10
+ function _sfc_render(_ctx, _cache) {
11
+ const _component_van_field = Field;
12
+ return openBlock(), createElementBlock(Fragment, null, [
13
+ createVNode(_component_van_field, normalizeProps(guardReactiveProps(_ctx.$attrs)), createSlots({ _: 2 }, [
14
+ renderList(_ctx.$slots, (item, key) => {
15
+ return {
16
+ name: key,
17
+ fn: withCtx(() => [
18
+ renderSlot(_ctx.$slots, key)
19
+ ])
20
+ };
21
+ })
22
+ ]), 1040),
23
+ renderSlot(_ctx.$slots, "default")
24
+ ], 64);
25
+ }
26
+ const _Field = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
37
27
  export {
38
- _sfc_main as default
28
+ _Field as default
39
29
  };
@@ -1,6 +1,6 @@
1
- import _sfc_main from "./Field.vue.mjs";
1
+ import _Field from "./Field.vue.mjs";
2
2
  import install from "../../../utils/install.mjs";
3
- const MobileField = install.withInstall("MobileField", _sfc_main);
3
+ const MobileField = install.withInstall("MobileField", _Field);
4
4
  export {
5
5
  MobileField,
6
6
  MobileField as default
@@ -40,7 +40,9 @@ const _sfc_main = {
40
40
  modelValue: {
41
41
  type: String,
42
42
  default: ""
43
- }
43
+ },
44
+ readonly: false,
45
+ "is-link": false
44
46
  },
45
47
  emits: ["update:modelValue"],
46
48
  setup(__props, { emit: __emit }) {
@@ -31,7 +31,9 @@ const _sfc_main = {
31
31
  modelValue: {
32
32
  type: String,
33
33
  default: ""
34
- }
34
+ },
35
+ readonly: false,
36
+ "is-link": false
35
37
  },
36
38
  emits: ["update:modelValue"],
37
39
  setup(__props, { emit: __emit }) {
@@ -5,8 +5,8 @@ const _sfc_main = {
5
5
  __name: "FieldCheckbox",
6
6
  props: {
7
7
  modelValue: {
8
- type: Array,
9
- default: []
8
+ type: String,
9
+ default: ""
10
10
  }
11
11
  },
12
12
  emits: ["update:modelValue"],
@@ -15,14 +15,18 @@ const _sfc_main = {
15
15
  const emit = __emit;
16
16
  const compValue = computed({
17
17
  get: () => {
18
- if (Array.isArray(props.modelValue)) {
19
- return props.modelValue;
18
+ if (props.modelValue) {
19
+ if (Array.isArray(props.modelValue)) {
20
+ return props.modelValue;
21
+ } else {
22
+ return props.modelValue.split(",");
23
+ }
20
24
  } else {
21
25
  return [];
22
26
  }
23
27
  },
24
28
  set: (val) => {
25
- emit("update:modelValue", val);
29
+ emit("update:modelValue", val.join(","));
26
30
  }
27
31
  });
28
32
  return (_ctx, _cache) => {
@@ -30,7 +30,9 @@ const _sfc_main = {
30
30
  valueFormat: {
31
31
  type: String,
32
32
  default: "YYYYMMDD"
33
- }
33
+ },
34
+ readonly: false,
35
+ "is-link": false
34
36
  },
35
37
  emits: ["update:modelValue"],
36
38
  setup(__props, { emit: __emit }) {
@@ -18,11 +18,11 @@ import { Popup } from "../../../../../../node_modules/.pnpm/vant@4.9.17_vue@3.5.
18
18
  const _sfc_main = {
19
19
  __name: "FieldPicker",
20
20
  props: {
21
- columns: {
21
+ options: {
22
22
  type: Array,
23
23
  default: []
24
24
  },
25
- columnsFieldNames: {
25
+ fieldNames: {
26
26
  type: Object,
27
27
  default: {
28
28
  text: "text",
@@ -32,7 +32,9 @@ const _sfc_main = {
32
32
  modelValue: {
33
33
  type: String,
34
34
  default: ""
35
- }
35
+ },
36
+ readonly: false,
37
+ "is-link": false
36
38
  },
37
39
  emits: ["update:modelValue"],
38
40
  setup(__props, { emit: __emit }) {
@@ -55,10 +57,10 @@ const _sfc_main = {
55
57
  if (!value) {
56
58
  return;
57
59
  }
58
- const optionItem = props.columns.find(
59
- (item) => item[props.columnsFieldNames.value] == value
60
+ const optionItem = props.options.find(
61
+ (item) => item[props.fieldNames.value] == value
60
62
  );
61
- fieldTextValue.value = optionItem == null ? void 0 : optionItem[props.columnsFieldNames.text];
63
+ fieldTextValue.value = optionItem == null ? void 0 : optionItem[props.fieldNames.text];
62
64
  },
63
65
  { immediate: true }
64
66
  );
@@ -85,8 +87,8 @@ const _sfc_main = {
85
87
  }, {
86
88
  default: withCtx(() => [
87
89
  createVNode(_component_van_picker, mergeProps(_ctx.$attrs, {
88
- columns: __props.columns,
89
- "columns-field-names": __props.columnsFieldNames,
90
+ columns: __props.options,
91
+ "columns-field-names": __props.fieldNames,
90
92
  "model-value": unref(pickerValue),
91
93
  readonly: false,
92
94
  onConfirm,
@@ -30,7 +30,9 @@ const _sfc_main = {
30
30
  valueFormat: {
31
31
  type: String,
32
32
  default: "HH:mm:ss"
33
- }
33
+ },
34
+ readonly: false,
35
+ "is-link": false
34
36
  },
35
37
  emits: ["update:modelValue"],
36
38
  setup(__props, { emit: __emit }) {
@@ -1,18 +1,34 @@
1
1
  /* empty css */
2
2
  /* empty css */
3
- import { createBlock, openBlock, mergeProps, withCtx, createVNode, renderSlot } from "vue";
3
+ import { computed, provide, createBlock, openBlock, mergeProps, withCtx, createVNode, renderSlot } from "vue";
4
4
  import { Form } from "../../../../../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/form/index.mjs";
5
5
  import { CellGroup } from "../../../../../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/cell-group/index.mjs";
6
6
  const _sfc_main = {
7
7
  __name: "Form",
8
8
  props: {
9
+ modelValue: {
10
+ type: Object,
11
+ default: {}
12
+ },
9
13
  isCard: {
10
14
  //卡片风格
11
15
  type: Boolean,
12
16
  default: false
13
17
  }
14
18
  },
15
- setup(__props) {
19
+ emits: ["update:modelValue"],
20
+ setup(__props, { emit: __emit }) {
21
+ const props = __props;
22
+ const emit = __emit;
23
+ const formData = computed({
24
+ get: () => {
25
+ return props.modelValue;
26
+ },
27
+ set: (val) => {
28
+ emit("update:modelValue", val);
29
+ }
30
+ });
31
+ provide("formData", formData);
16
32
  return (_ctx, _cache) => {
17
33
  const _component_van_cell_group = CellGroup;
18
34
  const _component_van_form = Form;
@@ -0,0 +1,70 @@
1
+ import { computed, defineAsyncComponent, inject, useAttrs, createBlock, openBlock, resolveDynamicComponent, unref, mergeProps, isRef } from "vue";
2
+ import { parseRule } from "../../../utils/formRule.mjs";
3
+ const _sfc_main = {
4
+ __name: "FormItem",
5
+ props: {
6
+ fieldType: {
7
+ type: String,
8
+ default: "text"
9
+ }
10
+ },
11
+ emits: ["update:modelValue"],
12
+ setup(__props, { emit: __emit }) {
13
+ const props = __props;
14
+ const formItem = computed(() => {
15
+ return defineAsyncComponent(() => {
16
+ switch (props.fieldType) {
17
+ case "text":
18
+ return import("../field/index.mjs");
19
+ case "picker":
20
+ return import("../fieldPicker/index.mjs");
21
+ case "cascader":
22
+ return import("../fieldCascaderPicker/index.mjs");
23
+ case "calendar":
24
+ return import("../fieldCalendarPicker/index.mjs");
25
+ case "date":
26
+ return import("../fieldDatePicker/index.mjs");
27
+ case "time":
28
+ return import("../fieldTimePicker/index.mjs");
29
+ case "radio":
30
+ return import("../fieldRadio/index.mjs");
31
+ case "checkbox":
32
+ return import("../fieldCheckbox/index.mjs");
33
+ }
34
+ });
35
+ });
36
+ const formData = inject("formData");
37
+ const attrs = useAttrs();
38
+ const emit = __emit;
39
+ const compValue = computed({
40
+ get: () => {
41
+ var _a;
42
+ if (formData) {
43
+ return (_a = formData.value) == null ? void 0 : _a[attrs.name];
44
+ }
45
+ return props.modelValue;
46
+ },
47
+ set: (val) => {
48
+ if (formData) {
49
+ formData.value[attrs.name] = val;
50
+ } else {
51
+ emit("update:modelValue", val);
52
+ }
53
+ }
54
+ });
55
+ const rules = computed(() => {
56
+ return parseRule(attrs);
57
+ });
58
+ return (_ctx, _cache) => {
59
+ return openBlock(), createBlock(resolveDynamicComponent(unref(formItem)), mergeProps(_ctx.$attrs, {
60
+ modelValue: unref(compValue),
61
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(compValue) ? compValue.value = $event : null),
62
+ rules: unref(rules),
63
+ required: "auto"
64
+ }), null, 16, ["modelValue", "rules"]);
65
+ };
66
+ }
67
+ };
68
+ export {
69
+ _sfc_main as default
70
+ };
@@ -0,0 +1,7 @@
1
+ import _sfc_main from "./FormItem.vue.mjs";
2
+ import install from "../../../utils/install.mjs";
3
+ const MobileFormItem = install.withInstall("MobileFormItem", _sfc_main);
4
+ export {
5
+ MobileFormItem,
6
+ MobileFormItem as default
7
+ };
@@ -37,25 +37,26 @@ const index$w = require("./src/components/form/fieldCascaderPicker/index.js");
37
37
  const index$x = require("./src/components/form/fieldCheckbox/index.js");
38
38
  const index$y = require("./src/components/form/fieldRadio/index.js");
39
39
  const index$z = require("./src/components/form/form/index.js");
40
- const index$A = require("./src/components/form/radioGroup/index.js");
41
- const index$B = require("./src/components/form/search/index.js");
42
- const index$C = require("./src/components/form/uploader/index.js");
43
- const index$D = require("./src/components/form/submitButton/index.js");
44
- const index$E = require("./src/components/navigation/actionBar/index.js");
45
- const index$F = require("./src/components/navigation/backTop/index.js");
46
- const index$G = require("./src/components/navigation/grid/index.js");
47
- const index$H = require("./src/components/navigation/gridItem/index.js");
48
- const index$I = require("./src/components/navigation/indexBar/index.js");
49
- const index$J = require("./src/components/navigation/indexAnchor/index.js");
50
- const index$K = require("./src/components/navigation/navBar/index.js");
51
- const index$L = require("./src/components/navigation/pagination/index.js");
52
- const index$M = require("./src/components/navigation/sidebar/index.js");
53
- const index$N = require("./src/components/navigation/sidebarItem/index.js");
54
- const index$O = require("./src/components/navigation/tab/index.js");
55
- const index$P = require("./src/components/navigation/tabs/index.js");
56
- const index$Q = require("./src/components/navigation/tabbar/index.js");
57
- const index$R = require("./src/components/navigation/tabbarItem/index.js");
58
- const index$S = require("./src/components/navigation/treeSelect/index.js");
40
+ const index$A = require("./src/components/form/formItem/index.js");
41
+ const index$B = require("./src/components/form/radioGroup/index.js");
42
+ const index$C = require("./src/components/form/search/index.js");
43
+ const index$D = require("./src/components/form/uploader/index.js");
44
+ const index$E = require("./src/components/form/submitButton/index.js");
45
+ const index$F = require("./src/components/navigation/actionBar/index.js");
46
+ const index$G = require("./src/components/navigation/backTop/index.js");
47
+ const index$H = require("./src/components/navigation/grid/index.js");
48
+ const index$I = require("./src/components/navigation/gridItem/index.js");
49
+ const index$J = require("./src/components/navigation/indexBar/index.js");
50
+ const index$K = require("./src/components/navigation/indexAnchor/index.js");
51
+ const index$L = require("./src/components/navigation/navBar/index.js");
52
+ const index$M = require("./src/components/navigation/pagination/index.js");
53
+ const index$N = require("./src/components/navigation/sidebar/index.js");
54
+ const index$O = require("./src/components/navigation/sidebarItem/index.js");
55
+ const index$P = require("./src/components/navigation/tab/index.js");
56
+ const index$Q = require("./src/components/navigation/tabs/index.js");
57
+ const index$R = require("./src/components/navigation/tabbar/index.js");
58
+ const index$S = require("./src/components/navigation/tabbarItem/index.js");
59
+ const index$T = require("./src/components/navigation/treeSelect/index.js");
59
60
  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");
60
61
  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");
61
62
  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");
@@ -102,25 +103,26 @@ exports.MobileFieldCascaderPicker = index$w.MobileFieldCascaderPicker;
102
103
  exports.MobileFieldCheckbox = index$x.MobileFieldCheckbox;
103
104
  exports.MobileFieldRadio = index$y.MobileFieldRadio;
104
105
  exports.MobileForm = index$z.MobileForm;
105
- exports.MobileRadioGroup = index$A.MobileRadioGroup;
106
- exports.MobileSearch = index$B.MobileSearch;
107
- exports.MobileUploader = index$C.MobileUploader;
108
- exports.MobileSubmitButton = index$D.MobileSubmitButton;
109
- exports.MobileActionBar = index$E.MobileActionBar;
110
- exports.MobileBackTop = index$F.MobileBackTop;
111
- exports.MobileGrid = index$G.MobileGrid;
112
- exports.MobileGridItem = index$H.MobileGridItem;
113
- exports.MobileIndexBar = index$I.MobileIndexBar;
114
- exports.MobileIndexAnchor = index$J.MobileIndexAnchor;
115
- exports.MobileNavBar = index$K.MobileNavBar;
116
- exports.MobilePagination = index$L.MobilePagination;
117
- exports.MobileSidebar = index$M.MobileSidebar;
118
- exports.MobileSidebarItem = index$N.MobileSidebarItem;
119
- exports.MobileTab = index$O.MobileTab;
120
- exports.MobileTabs = index$P.MobileTabs;
121
- exports.MobileTabbar = index$Q.MobileTabbar;
122
- exports.MobileTabbarItem = index$R.MobileTabbarItem;
123
- exports.MobileTreeSelect = index$S.MobileTreeSelect;
106
+ exports.MobileFormItem = index$A.MobileFormItem;
107
+ exports.MobileRadioGroup = index$B.MobileRadioGroup;
108
+ exports.MobileSearch = index$C.MobileSearch;
109
+ exports.MobileUploader = index$D.MobileUploader;
110
+ exports.MobileSubmitButton = index$E.MobileSubmitButton;
111
+ exports.MobileActionBar = index$F.MobileActionBar;
112
+ exports.MobileBackTop = index$G.MobileBackTop;
113
+ exports.MobileGrid = index$H.MobileGrid;
114
+ exports.MobileGridItem = index$I.MobileGridItem;
115
+ exports.MobileIndexBar = index$J.MobileIndexBar;
116
+ exports.MobileIndexAnchor = index$K.MobileIndexAnchor;
117
+ exports.MobileNavBar = index$L.MobileNavBar;
118
+ exports.MobilePagination = index$M.MobilePagination;
119
+ exports.MobileSidebar = index$N.MobileSidebar;
120
+ exports.MobileSidebarItem = index$O.MobileSidebarItem;
121
+ exports.MobileTab = index$P.MobileTab;
122
+ exports.MobileTabs = index$Q.MobileTabs;
123
+ exports.MobileTabbar = index$R.MobileTabbar;
124
+ exports.MobileTabbarItem = index$S.MobileTabbarItem;
125
+ exports.MobileTreeSelect = index$T.MobileTreeSelect;
124
126
  exports.closeDialog = functionCall.closeDialog;
125
127
  exports.showConfirmDialog = functionCall.showConfirmDialog;
126
128
  exports.showDialog = functionCall.showDialog;
@@ -35,25 +35,26 @@ const index$v = require("./form/fieldCascaderPicker/index.js");
35
35
  const index$w = require("./form/fieldCheckbox/index.js");
36
36
  const index$x = require("./form/fieldRadio/index.js");
37
37
  const index$y = require("./form/form/index.js");
38
- const index$z = require("./form/radioGroup/index.js");
39
- const index$A = require("./form/search/index.js");
40
- const index$B = require("./form/uploader/index.js");
41
- const index$C = require("./form/submitButton/index.js");
42
- const index$D = require("./navigation/actionBar/index.js");
43
- const index$E = require("./navigation/backTop/index.js");
44
- const index$F = require("./navigation/grid/index.js");
45
- const index$G = require("./navigation/gridItem/index.js");
46
- const index$H = require("./navigation/indexBar/index.js");
47
- const index$I = require("./navigation/indexAnchor/index.js");
48
- const index$J = require("./navigation/navBar/index.js");
49
- const index$K = require("./navigation/pagination/index.js");
50
- const index$L = require("./navigation/sidebar/index.js");
51
- const index$M = require("./navigation/sidebarItem/index.js");
52
- const index$N = require("./navigation/tab/index.js");
53
- const index$O = require("./navigation/tabs/index.js");
54
- const index$P = require("./navigation/tabbar/index.js");
55
- const index$Q = require("./navigation/tabbarItem/index.js");
56
- const index$R = require("./navigation/treeSelect/index.js");
38
+ const index$z = require("./form/formItem/index.js");
39
+ const index$A = require("./form/radioGroup/index.js");
40
+ const index$B = require("./form/search/index.js");
41
+ const index$C = require("./form/uploader/index.js");
42
+ const index$D = require("./form/submitButton/index.js");
43
+ const index$E = require("./navigation/actionBar/index.js");
44
+ const index$F = require("./navigation/backTop/index.js");
45
+ const index$G = require("./navigation/grid/index.js");
46
+ const index$H = require("./navigation/gridItem/index.js");
47
+ const index$I = require("./navigation/indexBar/index.js");
48
+ const index$J = require("./navigation/indexAnchor/index.js");
49
+ const index$K = require("./navigation/navBar/index.js");
50
+ const index$L = require("./navigation/pagination/index.js");
51
+ const index$M = require("./navigation/sidebar/index.js");
52
+ const index$N = require("./navigation/sidebarItem/index.js");
53
+ const index$O = require("./navigation/tab/index.js");
54
+ const index$P = require("./navigation/tabs/index.js");
55
+ const index$Q = require("./navigation/tabbar/index.js");
56
+ const index$R = require("./navigation/tabbarItem/index.js");
57
+ const index$S = require("./navigation/treeSelect/index.js");
57
58
  exports.MobileButton = index.MobileButton;
58
59
  exports.MobileCell = index$1.MobileCell;
59
60
  exports.MobileCellGroup = index$2.MobileCellGroup;
@@ -89,22 +90,23 @@ exports.MobileFieldCascaderPicker = index$v.MobileFieldCascaderPicker;
89
90
  exports.MobileFieldCheckbox = index$w.MobileFieldCheckbox;
90
91
  exports.MobileFieldRadio = index$x.MobileFieldRadio;
91
92
  exports.MobileForm = index$y.MobileForm;
92
- exports.MobileRadioGroup = index$z.MobileRadioGroup;
93
- exports.MobileSearch = index$A.MobileSearch;
94
- exports.MobileUploader = index$B.MobileUploader;
95
- exports.MobileSubmitButton = index$C.MobileSubmitButton;
96
- exports.MobileActionBar = index$D.MobileActionBar;
97
- exports.MobileBackTop = index$E.MobileBackTop;
98
- exports.MobileGrid = index$F.MobileGrid;
99
- exports.MobileGridItem = index$G.MobileGridItem;
100
- exports.MobileIndexBar = index$H.MobileIndexBar;
101
- exports.MobileIndexAnchor = index$I.MobileIndexAnchor;
102
- exports.MobileNavBar = index$J.MobileNavBar;
103
- exports.MobilePagination = index$K.MobilePagination;
104
- exports.MobileSidebar = index$L.MobileSidebar;
105
- exports.MobileSidebarItem = index$M.MobileSidebarItem;
106
- exports.MobileTab = index$N.MobileTab;
107
- exports.MobileTabs = index$O.MobileTabs;
108
- exports.MobileTabbar = index$P.MobileTabbar;
109
- exports.MobileTabbarItem = index$Q.MobileTabbarItem;
110
- exports.MobileTreeSelect = index$R.MobileTreeSelect;
93
+ exports.MobileFormItem = index$z.MobileFormItem;
94
+ exports.MobileRadioGroup = index$A.MobileRadioGroup;
95
+ exports.MobileSearch = index$B.MobileSearch;
96
+ exports.MobileUploader = index$C.MobileUploader;
97
+ exports.MobileSubmitButton = index$D.MobileSubmitButton;
98
+ exports.MobileActionBar = index$E.MobileActionBar;
99
+ exports.MobileBackTop = index$F.MobileBackTop;
100
+ exports.MobileGrid = index$G.MobileGrid;
101
+ exports.MobileGridItem = index$H.MobileGridItem;
102
+ exports.MobileIndexBar = index$I.MobileIndexBar;
103
+ exports.MobileIndexAnchor = index$J.MobileIndexAnchor;
104
+ exports.MobileNavBar = index$K.MobileNavBar;
105
+ exports.MobilePagination = index$L.MobilePagination;
106
+ exports.MobileSidebar = index$M.MobileSidebar;
107
+ exports.MobileSidebarItem = index$N.MobileSidebarItem;
108
+ exports.MobileTab = index$O.MobileTab;
109
+ exports.MobileTabs = index$P.MobileTabs;
110
+ exports.MobileTabbar = index$Q.MobileTabbar;
111
+ exports.MobileTabbarItem = index$R.MobileTabbarItem;
112
+ exports.MobileTreeSelect = index$S.MobileTreeSelect;
@@ -36,7 +36,7 @@ const _sfc_main = {
36
36
  disabled: item[__props.fieldNames.disabled]
37
37
  }, {
38
38
  default: vue.withCtx(() => [
39
- vue.createTextVNode(vue.toDisplayString(item[__props.fieldNames.disabled]) + " " + vue.toDisplayString(item[__props.fieldNames.text]), 1)
39
+ vue.createTextVNode(vue.toDisplayString(item[__props.fieldNames.text]), 1)
40
40
  ]),
41
41
  _: 2
42
42
  }, 1032, ["name", "disabled"]);
@@ -6,34 +6,24 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
6
6
  ;/* empty css */
7
7
  ;/* empty css */
8
8
  const vue = require("vue");
9
- const formRule = require("../../../utils/formRule.js");
9
+ const _pluginVue_exportHelper = require("../../../../../../_virtual/_plugin-vue_export-helper.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
- __name: "Field",
13
- setup(__props) {
14
- const attrs = vue.useAttrs();
15
- const rules = vue.computed(() => {
16
- return formRule.parseRule(attrs);
17
- });
18
- return (_ctx, _cache) => {
19
- const _component_van_field = index.Field;
20
- return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
21
- vue.createVNode(_component_van_field, vue.mergeProps(_ctx.$attrs, {
22
- rules: rules.value,
23
- required: "auto"
24
- }), vue.createSlots({ _: 2 }, [
25
- vue.renderList(_ctx.$slots, (item, key) => {
26
- return {
27
- name: key,
28
- fn: vue.withCtx(() => [
29
- vue.renderSlot(_ctx.$slots, key)
30
- ])
31
- };
32
- })
33
- ]), 1040, ["rules"]),
34
- vue.renderSlot(_ctx.$slots, "default")
35
- ], 64);
36
- };
37
- }
38
- };
39
- exports.default = _sfc_main;
11
+ const _sfc_main = {};
12
+ function _sfc_render(_ctx, _cache) {
13
+ const _component_van_field = index.Field;
14
+ return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
15
+ vue.createVNode(_component_van_field, vue.normalizeProps(vue.guardReactiveProps(_ctx.$attrs)), vue.createSlots({ _: 2 }, [
16
+ vue.renderList(_ctx.$slots, (item, key) => {
17
+ return {
18
+ name: key,
19
+ fn: vue.withCtx(() => [
20
+ vue.renderSlot(_ctx.$slots, key)
21
+ ])
22
+ };
23
+ })
24
+ ]), 1040),
25
+ vue.renderSlot(_ctx.$slots, "default")
26
+ ], 64);
27
+ }
28
+ const _Field = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["render", _sfc_render]]);
29
+ exports.default = _Field;
@@ -42,7 +42,9 @@ const _sfc_main = {
42
42
  modelValue: {
43
43
  type: String,
44
44
  default: ""
45
- }
45
+ },
46
+ readonly: false,
47
+ "is-link": false
46
48
  },
47
49
  emits: ["update:modelValue"],
48
50
  setup(__props, { emit: __emit }) {
@@ -33,7 +33,9 @@ const _sfc_main = {
33
33
  modelValue: {
34
34
  type: String,
35
35
  default: ""
36
- }
36
+ },
37
+ readonly: false,
38
+ "is-link": false
37
39
  },
38
40
  emits: ["update:modelValue"],
39
41
  setup(__props, { emit: __emit }) {
@@ -7,8 +7,8 @@ const _sfc_main = {
7
7
  __name: "FieldCheckbox",
8
8
  props: {
9
9
  modelValue: {
10
- type: Array,
11
- default: []
10
+ type: String,
11
+ default: ""
12
12
  }
13
13
  },
14
14
  emits: ["update:modelValue"],
@@ -17,14 +17,18 @@ const _sfc_main = {
17
17
  const emit = __emit;
18
18
  const compValue = vue.computed({
19
19
  get: () => {
20
- if (Array.isArray(props.modelValue)) {
21
- return props.modelValue;
20
+ if (props.modelValue) {
21
+ if (Array.isArray(props.modelValue)) {
22
+ return props.modelValue;
23
+ } else {
24
+ return props.modelValue.split(",");
25
+ }
22
26
  } else {
23
27
  return [];
24
28
  }
25
29
  },
26
30
  set: (val) => {
27
- emit("update:modelValue", val);
31
+ emit("update:modelValue", val.join(","));
28
32
  }
29
33
  });
30
34
  return (_ctx, _cache) => {
@@ -32,7 +32,9 @@ const _sfc_main = {
32
32
  valueFormat: {
33
33
  type: String,
34
34
  default: "YYYYMMDD"
35
- }
35
+ },
36
+ readonly: false,
37
+ "is-link": false
36
38
  },
37
39
  emits: ["update:modelValue"],
38
40
  setup(__props, { emit: __emit }) {
@@ -20,11 +20,11 @@ const index$1 = require("../../../../../../node_modules/.pnpm/vant@4.9.17_vue@3.
20
20
  const _sfc_main = {
21
21
  __name: "FieldPicker",
22
22
  props: {
23
- columns: {
23
+ options: {
24
24
  type: Array,
25
25
  default: []
26
26
  },
27
- columnsFieldNames: {
27
+ fieldNames: {
28
28
  type: Object,
29
29
  default: {
30
30
  text: "text",
@@ -34,7 +34,9 @@ const _sfc_main = {
34
34
  modelValue: {
35
35
  type: String,
36
36
  default: ""
37
- }
37
+ },
38
+ readonly: false,
39
+ "is-link": false
38
40
  },
39
41
  emits: ["update:modelValue"],
40
42
  setup(__props, { emit: __emit }) {
@@ -57,10 +59,10 @@ const _sfc_main = {
57
59
  if (!value) {
58
60
  return;
59
61
  }
60
- const optionItem = props.columns.find(
61
- (item) => item[props.columnsFieldNames.value] == value
62
+ const optionItem = props.options.find(
63
+ (item) => item[props.fieldNames.value] == value
62
64
  );
63
- fieldTextValue.value = optionItem == null ? void 0 : optionItem[props.columnsFieldNames.text];
65
+ fieldTextValue.value = optionItem == null ? void 0 : optionItem[props.fieldNames.text];
64
66
  },
65
67
  { immediate: true }
66
68
  );
@@ -87,8 +89,8 @@ const _sfc_main = {
87
89
  }, {
88
90
  default: vue.withCtx(() => [
89
91
  vue.createVNode(_component_van_picker, vue.mergeProps(_ctx.$attrs, {
90
- columns: __props.columns,
91
- "columns-field-names": __props.columnsFieldNames,
92
+ columns: __props.options,
93
+ "columns-field-names": __props.fieldNames,
92
94
  "model-value": vue.unref(pickerValue),
93
95
  readonly: false,
94
96
  onConfirm,
@@ -32,7 +32,9 @@ const _sfc_main = {
32
32
  valueFormat: {
33
33
  type: String,
34
34
  default: "HH:mm:ss"
35
- }
35
+ },
36
+ readonly: false,
37
+ "is-link": false
36
38
  },
37
39
  emits: ["update:modelValue"],
38
40
  setup(__props, { emit: __emit }) {
@@ -8,13 +8,29 @@ const index$1 = require("../../../../../../node_modules/.pnpm/vant@4.9.17_vue@3.
8
8
  const _sfc_main = {
9
9
  __name: "Form",
10
10
  props: {
11
+ modelValue: {
12
+ type: Object,
13
+ default: {}
14
+ },
11
15
  isCard: {
12
16
  //卡片风格
13
17
  type: Boolean,
14
18
  default: false
15
19
  }
16
20
  },
17
- setup(__props) {
21
+ emits: ["update:modelValue"],
22
+ setup(__props, { emit: __emit }) {
23
+ const props = __props;
24
+ const emit = __emit;
25
+ const formData = vue.computed({
26
+ get: () => {
27
+ return props.modelValue;
28
+ },
29
+ set: (val) => {
30
+ emit("update:modelValue", val);
31
+ }
32
+ });
33
+ vue.provide("formData", formData);
18
34
  return (_ctx, _cache) => {
19
35
  const _component_van_cell_group = index$1.CellGroup;
20
36
  const _component_van_form = index.Form;
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
+ const vue = require("vue");
4
+ const formRule = require("../../../utils/formRule.js");
5
+ const _sfc_main = {
6
+ __name: "FormItem",
7
+ props: {
8
+ fieldType: {
9
+ type: String,
10
+ default: "text"
11
+ }
12
+ },
13
+ emits: ["update:modelValue"],
14
+ setup(__props, { emit: __emit }) {
15
+ const props = __props;
16
+ const formItem = vue.computed(() => {
17
+ return vue.defineAsyncComponent(() => {
18
+ switch (props.fieldType) {
19
+ case "text":
20
+ return Promise.resolve().then(() => require("../field/index.js"));
21
+ case "picker":
22
+ return Promise.resolve().then(() => require("../fieldPicker/index.js"));
23
+ case "cascader":
24
+ return Promise.resolve().then(() => require("../fieldCascaderPicker/index.js"));
25
+ case "calendar":
26
+ return Promise.resolve().then(() => require("../fieldCalendarPicker/index.js"));
27
+ case "date":
28
+ return Promise.resolve().then(() => require("../fieldDatePicker/index.js"));
29
+ case "time":
30
+ return Promise.resolve().then(() => require("../fieldTimePicker/index.js"));
31
+ case "radio":
32
+ return Promise.resolve().then(() => require("../fieldRadio/index.js"));
33
+ case "checkbox":
34
+ return Promise.resolve().then(() => require("../fieldCheckbox/index.js"));
35
+ }
36
+ });
37
+ });
38
+ const formData = vue.inject("formData");
39
+ const attrs = vue.useAttrs();
40
+ const emit = __emit;
41
+ const compValue = vue.computed({
42
+ get: () => {
43
+ var _a;
44
+ if (formData) {
45
+ return (_a = formData.value) == null ? void 0 : _a[attrs.name];
46
+ }
47
+ return props.modelValue;
48
+ },
49
+ set: (val) => {
50
+ if (formData) {
51
+ formData.value[attrs.name] = val;
52
+ } else {
53
+ emit("update:modelValue", val);
54
+ }
55
+ }
56
+ });
57
+ const rules = vue.computed(() => {
58
+ return formRule.parseRule(attrs);
59
+ });
60
+ return (_ctx, _cache) => {
61
+ return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(formItem)), vue.mergeProps(_ctx.$attrs, {
62
+ modelValue: vue.unref(compValue),
63
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => vue.isRef(compValue) ? compValue.value = $event : null),
64
+ rules: vue.unref(rules),
65
+ required: "auto"
66
+ }), null, 16, ["modelValue", "rules"]);
67
+ };
68
+ }
69
+ };
70
+ exports.default = _sfc_main;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
+ const FormItem = require("./FormItem.vue.js");
4
+ const install = require("../../../utils/install.js");
5
+ const MobileFormItem = install.default.withInstall("MobileFormItem", FormItem.default);
6
+ exports.MobileFormItem = MobileFormItem;
7
+ exports.default = MobileFormItem;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fecp/mobile",
3
- "version": "1.0.19",
3
+ "version": "1.0.21",
4
4
  "main": "lib/packages/mobile/index.js",
5
5
  "module": "es/packages/mobile/index.mjs",
6
6
  "files": [