@nutui/nutui 4.0.10-beta.1 → 4.0.11

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 (160) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/dist/nutui.es.js +1 -1
  3. package/dist/nutui.js +6316 -7237
  4. package/dist/nutui.umd.js +1 -1
  5. package/dist/packages/_es/ActionSheet.js +78 -111
  6. package/dist/packages/_es/Address.js +250 -375
  7. package/dist/packages/_es/AddressList.js +269 -354
  8. package/dist/packages/_es/Animate.js +41 -58
  9. package/dist/packages/_es/Audio.js +128 -197
  10. package/dist/packages/_es/AudioOperate.js +60 -71
  11. package/dist/packages/_es/Avatar.js +66 -89
  12. package/dist/packages/_es/AvatarGroup.js +23 -31
  13. package/dist/packages/_es/Backtop.js +59 -99
  14. package/dist/packages/_es/Badge.js +36 -47
  15. package/dist/packages/_es/Barrage.js +68 -147
  16. package/dist/packages/_es/Button.js +47 -66
  17. package/dist/packages/_es/Calendar.js +135 -157
  18. package/dist/packages/_es/CalendarItem.js +6 -6
  19. package/dist/packages/_es/Card.js +42 -56
  20. package/dist/packages/_es/Cascader.js +315 -474
  21. package/dist/packages/_es/Category.js +29 -39
  22. package/dist/packages/_es/CategoryPane.js +57 -83
  23. package/dist/packages/_es/Cell.js +56 -71
  24. package/dist/packages/_es/CellGroup.js +19 -27
  25. package/dist/packages/_es/Checkbox.js +109 -156
  26. package/dist/packages/_es/CheckboxGroup.js +38 -59
  27. package/dist/packages/_es/CircleProgress.js +67 -96
  28. package/dist/packages/_es/Col.js +23 -31
  29. package/dist/packages/_es/Collapse.js +33 -58
  30. package/dist/packages/_es/CollapseItem.js +78 -108
  31. package/dist/packages/_es/Comment.js +207 -279
  32. package/dist/packages/_es/ConfigProvider.js +37 -55
  33. package/dist/packages/_es/Countdown.js +100 -212
  34. package/dist/packages/_es/Countup.js +232 -445
  35. package/dist/packages/_es/DatePicker.js +162 -265
  36. package/dist/packages/_es/Dialog.js +161 -213
  37. package/dist/packages/_es/Divider.js +42 -57
  38. package/dist/packages/_es/Drag.js +70 -153
  39. package/dist/packages/_es/Ecard.js +64 -104
  40. package/dist/packages/_es/Elevator.js +143 -219
  41. package/dist/packages/_es/Ellipsis.js +95 -178
  42. package/dist/packages/_es/Empty.js +23 -39
  43. package/dist/packages/_es/FixedNav.js +93 -116
  44. package/dist/packages/_es/Form.js +107 -178
  45. package/dist/packages/_es/FormItem.js +48 -61
  46. package/dist/packages/_es/Grid.js +5 -6
  47. package/dist/packages/_es/GridItem.js +58 -84
  48. package/dist/packages/_es/Image.js +90 -129
  49. package/dist/packages/_es/ImagePreview.js +256 -412
  50. package/dist/packages/_es/Indicator.js +30 -34
  51. package/dist/packages/_es/InfiniteLoading.js +83 -136
  52. package/dist/packages/_es/Input.js +160 -264
  53. package/dist/packages/_es/InputNumber.js +81 -117
  54. package/dist/packages/_es/Interceptor-6e26b757.js +18 -0
  55. package/dist/packages/_es/Invoice.js +104 -130
  56. package/dist/packages/_es/Layout.js +3 -4
  57. package/dist/packages/_es/List.js +117 -215
  58. package/dist/packages/_es/Menu.js +95 -150
  59. package/dist/packages/_es/MenuItem.js +109 -154
  60. package/dist/packages/_es/Navbar.js +103 -119
  61. package/dist/packages/_es/Noticebar.js +197 -312
  62. package/dist/packages/_es/Notify.js +110 -166
  63. package/dist/packages/_es/NumberKeyboard.js +127 -202
  64. package/dist/packages/_es/Overlay.js +52 -80
  65. package/dist/packages/_es/Pagination.js +70 -100
  66. package/dist/packages/_es/Picker.js +275 -437
  67. package/dist/packages/_es/Popover.js +122 -225
  68. package/dist/packages/_es/Popup.js +4 -4
  69. package/dist/packages/_es/Price.js +44 -82
  70. package/dist/packages/_es/Progress.js +63 -79
  71. package/dist/packages/_es/PullRefresh.js +95 -173
  72. package/dist/packages/_es/Radio.js +4 -4
  73. package/dist/packages/_es/RadioGroup.js +3 -3
  74. package/dist/packages/_es/Range.js +204 -347
  75. package/dist/packages/_es/Rate.js +92 -141
  76. package/dist/packages/_es/Row.js +21 -27
  77. package/dist/packages/_es/Searchbar.js +123 -174
  78. package/dist/packages/_es/ShortPassword.js +69 -93
  79. package/dist/packages/_es/SideNavbar.js +49 -80
  80. package/dist/packages/_es/SideNavbarItem.js +22 -32
  81. package/dist/packages/_es/Signature.js +83 -146
  82. package/dist/packages/_es/Skeleton.js +110 -130
  83. package/dist/packages/_es/Sku.js +250 -343
  84. package/dist/packages/_es/Step.js +59 -86
  85. package/dist/packages/_es/Steps.js +26 -31
  86. package/dist/packages/_es/Sticky.js +4 -4
  87. package/dist/packages/_es/SubSideNavbar.js +52 -74
  88. package/dist/packages/_es/Swipe.js +83 -155
  89. package/dist/packages/_es/Swiper.js +174 -311
  90. package/dist/packages/_es/SwiperItem.js +28 -44
  91. package/dist/packages/_es/Switch.js +55 -68
  92. package/dist/packages/_es/TabPane.js +30 -41
  93. package/dist/packages/_es/Tabbar.js +41 -52
  94. package/dist/packages/_es/TabbarItem.js +61 -82
  95. package/dist/packages/_es/Table.js +109 -165
  96. package/dist/packages/_es/Tabs.js +240 -388
  97. package/dist/packages/_es/Tag.js +44 -61
  98. package/dist/packages/_es/Textarea.js +80 -124
  99. package/dist/packages/_es/TimeDetail.js +49 -76
  100. package/dist/packages/_es/TimePannel.js +34 -48
  101. package/dist/packages/_es/TimeSelect.js +47 -68
  102. package/dist/packages/_es/Toast.js +144 -218
  103. package/dist/packages/_es/Tour.js +138 -192
  104. package/dist/packages/_es/TrendArrow.js +57 -77
  105. package/dist/packages/_es/Uploader.js +234 -359
  106. package/dist/packages/_es/Video.js +191 -316
  107. package/dist/packages/_es/Watermark.js +84 -117
  108. package/dist/packages/_es/_plugin-vue_export-helper-dad06003.js +9 -0
  109. package/dist/packages/_es/common-d218746f.js +116 -0
  110. package/dist/packages/_es/component-234624bc.js +89 -0
  111. package/dist/packages/_es/index-14dfadc4.js +561 -0
  112. package/dist/packages/_es/index-192a3ef6.js +29 -0
  113. package/dist/packages/_es/index-360c5092.js +210 -0
  114. package/dist/packages/_es/index-496e6e05.js +24 -0
  115. package/dist/packages/_es/index-50eed3d9.js +7 -0
  116. package/dist/packages/_es/index-53ec2d4d.js +34 -0
  117. package/dist/packages/_es/index-fadb0974.js +8 -0
  118. package/dist/packages/_es/index.vue_vue_type_script_lang-1139b29a.js +43 -0
  119. package/dist/packages/_es/index.vue_vue_type_script_lang-43b774dd.js +77 -0
  120. package/dist/packages/_es/index.vue_vue_type_script_lang-f44c159d.js +110 -0
  121. package/dist/packages/_es/mountComponent-6d4ff200.js +23 -0
  122. package/dist/packages/_es/pxCheck-38173291.js +4 -0
  123. package/dist/packages/_es/raf-a74f1a06.js +16 -0
  124. package/dist/packages/_es/renderIcon-47498b32.js +5 -0
  125. package/dist/smartips/web-types.json +1 -1
  126. package/dist/style.css +1 -1
  127. package/dist/styles/themes/default.scss +148 -45
  128. package/dist/styles/themes/jdb.scss +148 -45
  129. package/dist/styles/themes/jddkh.scss +148 -45
  130. package/dist/styles/themes/jdt.scss +148 -45
  131. package/dist/types/__VUE/address/index.vue.d.ts +1 -1
  132. package/dist/types/__VUE/collapseitem/index.vue.d.ts +110 -3
  133. package/dist/types/__VUE/image/index.vue.d.ts +2 -2
  134. package/dist/types/__VUE/rate/index.vue.d.ts +110 -3
  135. package/dist/types/__VUE/searchbar/index.vue.d.ts +110 -3
  136. package/dist/types/__VUE/skeleton/index.vue.d.ts +2 -2
  137. package/dist/types/__VUE/swiper/index.vue.d.ts +1 -1
  138. package/dist/types/__VUE/table/common.d.ts +55 -2
  139. package/dist/types/__VUE/timeselect/index.vue.d.ts +1 -1
  140. package/dist/types/__VUE/watermark/index.vue.d.ts +1 -1
  141. package/dist/types/index.d.ts +1 -1
  142. package/package.json +2 -2
  143. package/dist/packages/_es/Interceptor-956b24fc.js +0 -29
  144. package/dist/packages/_es/_plugin-vue_export-helper-cc2b3d55.js +0 -10
  145. package/dist/packages/_es/common-b9a5e726.js +0 -145
  146. package/dist/packages/_es/component-81a4c1d0.js +0 -145
  147. package/dist/packages/_es/index-29892cda.js +0 -33
  148. package/dist/packages/_es/index-43c34ac6.js +0 -30
  149. package/dist/packages/_es/index-54d03fc1.js +0 -8
  150. package/dist/packages/_es/index-79c5dc33.js +0 -10
  151. package/dist/packages/_es/index-7a7385e4.js +0 -67
  152. package/dist/packages/_es/index-87422be8.js +0 -942
  153. package/dist/packages/_es/index-da0a7662.js +0 -259
  154. package/dist/packages/_es/index.vue_vue_type_script_lang-22dfc112.js +0 -46
  155. package/dist/packages/_es/index.vue_vue_type_script_lang-442e4704.js +0 -98
  156. package/dist/packages/_es/index.vue_vue_type_script_lang-cc5c4086.js +0 -151
  157. package/dist/packages/_es/mountComponent-8b24c346.js +0 -39
  158. package/dist/packages/_es/pxCheck-c6b9f6b7.js +0 -6
  159. package/dist/packages/_es/raf-729dad54.js +0 -25
  160. package/dist/packages/_es/renderIcon-3d0fd47c.js +0 -9
@@ -1,196 +1,125 @@
1
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
2
- var __hasOwnProp = Object.prototype.hasOwnProperty;
3
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
4
- var __objRest = (source, exclude) => {
5
- var target = {};
6
- for (var prop in source)
7
- if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
8
- target[prop] = source[prop];
9
- if (source != null && __getOwnPropSymbols)
10
- for (var prop of __getOwnPropSymbols(source)) {
11
- if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
12
- target[prop] = source[prop];
13
- }
14
- return target;
1
+ var $ = Object.getOwnPropertySymbols;
2
+ var F = Object.prototype.hasOwnProperty, I = Object.prototype.propertyIsEnumerable;
3
+ var x = (l, i) => {
4
+ var m = {};
5
+ for (var o in l)
6
+ F.call(l, o) && i.indexOf(o) < 0 && (m[o] = l[o]);
7
+ if (l != null && $)
8
+ for (var o of $(l))
9
+ i.indexOf(o) < 0 && I.call(l, o) && (m[o] = l[o]);
10
+ return m;
15
11
  };
16
- import { g as isObject, h as getPropByPath, f as isPromise, c as createComponent } from "./component-81a4c1d0.js";
17
- import { computed, reactive, provide, watch, resolveComponent, openBlock, createElementBlock, withModifiers, createVNode, withCtx, renderSlot } from "vue";
18
- import CellGroup from "./CellGroup.js";
19
- import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
12
+ import { g as T, h as A, f as N, c as W } from "./component-234624bc.js";
13
+ import { computed as q, reactive as G, provide as U, watch as z, resolveComponent as D, openBlock as H, createElementBlock as J, withModifiers as K, createVNode as L, withCtx as Q, renderSlot as X } from "vue";
14
+ import C from "./CellGroup.js";
15
+ import { _ as Y } from "./_plugin-vue_export-helper-dad06003.js";
20
16
  import "../locale/lang";
21
- const component = (components) => {
22
- return {
23
- props: {
24
- modelValue: {
25
- type: Object,
26
- default: {}
27
- },
28
- rules: {
29
- type: Object,
30
- default: {}
31
- }
17
+ const Z = (l) => ({
18
+ props: {
19
+ modelValue: {
20
+ type: Object,
21
+ default: {}
32
22
  },
33
- components,
34
- emits: ["validate"],
35
- setup(props, { emit, slots }) {
36
- const formErrorTip = computed(() => reactive({}));
37
- provide("formErrorTip", formErrorTip);
38
- const clearErrorTips = () => {
39
- Object.keys(formErrorTip.value).forEach((item) => {
40
- formErrorTip.value[item] = "";
41
- });
42
- };
43
- const reset = () => {
44
- clearErrorTips();
45
- };
46
- watch(
47
- () => props.modelValue,
48
- () => {
49
- clearErrorTips();
50
- },
51
- { immediate: true }
52
- );
53
- const findFormItem = (vnodes) => {
54
- let task = [];
55
- vnodes.forEach((vnode) => {
56
- var _a, _b, _c, _d;
57
- let type = vnode.type;
58
- type = type.name || type;
59
- if (type == "nut-form-item" || (type == null ? void 0 : type.toString().endsWith("form-item"))) {
60
- task.push({
61
- prop: (_a = vnode.props) == null ? void 0 : _a["prop"],
62
- rules: ((_b = vnode.props) == null ? void 0 : _b["rules"]) || []
63
- });
64
- } else if (Array.isArray(vnode.children) && ((_c = vnode.children) == null ? void 0 : _c.length)) {
65
- task = task.concat(findFormItem(vnode.children));
66
- } else if (isObject(vnode.children) && Object.keys(vnode.children)) {
67
- if ((_d = vnode.children) == null ? void 0 : _d.default) {
68
- vnode.children = vnode.children.default();
69
- task = task.concat(findFormItem(vnode.children));
70
- }
71
- }
72
- });
73
- return task;
74
- };
75
- const tipMessage = (errorMsg) => {
76
- if (errorMsg.message) {
77
- emit("validate", errorMsg);
78
- }
79
- formErrorTip.value[errorMsg.prop] = errorMsg.message;
80
- };
81
- const checkRule = (item) => {
82
- const { rules, prop } = item;
83
- const _Promise = (errorMsg) => {
84
- return new Promise((resolve, reject) => {
85
- try {
86
- tipMessage(errorMsg);
87
- resolve(errorMsg);
88
- } catch (error) {
89
- reject(error);
90
- }
91
- });
92
- };
93
- if (!prop) {
94
- console.warn("[NutUI] <FormItem> 使用 rules 校验规则时 , 必须设置 prop 参数");
95
- }
96
- const value = getPropByPath(props.modelValue, prop || "");
97
- tipMessage({ prop, message: "" });
98
- const formRules = props.rules || {};
99
- const _rules = [...(formRules == null ? void 0 : formRules[prop]) || [], ...rules];
100
- while (_rules.length) {
101
- const rule = _rules.shift();
102
- const _a = rule, { validator } = _a, ruleWithoutValidator = __objRest(_a, ["validator"]);
103
- const { required, regex, message } = ruleWithoutValidator;
104
- const errorMsg = { prop, message };
105
- if (required) {
106
- if (!value && value !== 0) {
107
- return _Promise(errorMsg);
108
- }
109
- }
110
- if (regex && !regex.test(String(value))) {
111
- return _Promise(errorMsg);
112
- }
113
- if (validator) {
114
- const result = validator(value, ruleWithoutValidator);
115
- if (isPromise(result)) {
116
- return new Promise((r, j) => {
117
- result.then((res) => {
118
- if (!res) {
119
- tipMessage(errorMsg);
120
- r(errorMsg);
121
- } else {
122
- r(true);
123
- }
124
- }).catch((e) => j(e));
125
- });
126
- } else {
127
- if (!result) {
128
- return _Promise(errorMsg);
129
- }
130
- }
131
- }
23
+ rules: {
24
+ type: Object,
25
+ default: {}
26
+ }
27
+ },
28
+ components: l,
29
+ emits: ["validate"],
30
+ setup(i, { emit: m, slots: o }) {
31
+ const f = q(() => G({}));
32
+ U("formErrorTip", f);
33
+ const _ = () => {
34
+ Object.keys(f.value).forEach((s) => {
35
+ f.value[s] = "";
36
+ });
37
+ }, g = () => {
38
+ _();
39
+ };
40
+ z(
41
+ () => i.modelValue,
42
+ () => {
43
+ _();
44
+ },
45
+ { immediate: !0 }
46
+ );
47
+ const y = (s) => {
48
+ let n = [];
49
+ return s.forEach((e) => {
50
+ var c, t, a, u;
51
+ let r = e.type;
52
+ r = r.name || r, r == "nut-form-item" || r != null && r.toString().endsWith("form-item") ? n.push({
53
+ prop: (c = e.props) == null ? void 0 : c.prop,
54
+ rules: ((t = e.props) == null ? void 0 : t.rules) || []
55
+ }) : Array.isArray(e.children) && ((a = e.children) != null && a.length) ? n = n.concat(y(e.children)) : T(e.children) && Object.keys(e.children) && (u = e.children) != null && u.default && (e.children = e.children.default(), n = n.concat(y(e.children)));
56
+ }), n;
57
+ }, P = (s) => {
58
+ s.message && m("validate", s), f.value[s.prop] = s.message;
59
+ }, j = (s) => {
60
+ const { rules: n, prop: e } = s, r = (b) => new Promise((h, d) => {
61
+ try {
62
+ P(b), h(b);
63
+ } catch (k) {
64
+ d(k);
132
65
  }
133
- return Promise.resolve(true);
134
- };
135
- const validate = (customProp = "") => {
136
- return new Promise((resolve, reject) => {
137
- try {
138
- const task = findFormItem(slots.default());
139
- const errors = task.map((item) => {
140
- if (customProp) {
141
- if (customProp == item.prop) {
142
- return checkRule(item);
143
- } else {
144
- return Promise.resolve(true);
145
- }
146
- } else {
147
- return checkRule(item);
148
- }
66
+ });
67
+ e || console.warn("[NutUI] <FormItem> 使用 rules 校验规则时 , 必须设置 prop 参数");
68
+ const c = A(i.modelValue, e || "");
69
+ P({ prop: e, message: "" });
70
+ const t = i.rules || {}, a = [...(t == null ? void 0 : t[e]) || [], ...n];
71
+ for (; a.length; ) {
72
+ const u = a.shift(), { validator: h } = u, d = x(u, ["validator"]), { required: k, regex: O, message: S } = d, p = { prop: e, message: S };
73
+ if (k && !c && c !== 0 || O && !O.test(String(c)))
74
+ return r(p);
75
+ if (h) {
76
+ const w = h(c, d);
77
+ if (N(w))
78
+ return new Promise((V, B) => {
79
+ w.then((E) => {
80
+ E ? V(!0) : (P(p), V(p));
81
+ }).catch((E) => B(E));
149
82
  });
150
- Promise.all(errors).then((errorRes) => {
151
- errorRes = errorRes.filter((item) => item != true);
152
- const res = { valid: true, errors: [] };
153
- if (errorRes.length) {
154
- res.valid = false;
155
- res.errors = errorRes;
156
- }
157
- resolve(res);
158
- });
159
- } catch (error) {
160
- reject(error);
161
- }
83
+ if (!w)
84
+ return r(p);
85
+ }
86
+ }
87
+ return Promise.resolve(!0);
88
+ }, v = (s = "") => new Promise((n, e) => {
89
+ try {
90
+ const c = y(o.default()).map((t) => s ? s == t.prop ? j(t) : Promise.resolve(!0) : j(t));
91
+ Promise.all(c).then((t) => {
92
+ t = t.filter((u) => u != !0);
93
+ const a = { valid: !0, errors: [] };
94
+ t.length && (a.valid = !1, a.errors = t), n(a);
162
95
  });
163
- };
164
- const submit = () => {
165
- validate();
166
- return false;
167
- };
168
- return { validate, reset, submit, formErrorTip };
169
- }
170
- };
171
- };
172
- const { create } = createComponent("form");
173
- const _sfc_main = create(
174
- component({
175
- [CellGroup.name]: CellGroup
96
+ } catch (r) {
97
+ e(r);
98
+ }
99
+ });
100
+ return { validate: v, reset: g, submit: () => (v(), !1), formErrorTip: f };
101
+ }
102
+ }), { create: M } = W("form"), R = M(
103
+ Z({
104
+ [C.name]: C
176
105
  })
177
106
  );
178
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
179
- const _component_nut_cell_group = resolveComponent("nut-cell-group");
180
- return openBlock(), createElementBlock("form", {
107
+ function ee(l, i, m, o, f, _) {
108
+ const g = D("nut-cell-group");
109
+ return H(), J("form", {
181
110
  class: "nut-form",
182
111
  action: "#",
183
- onSubmit: _cache[0] || (_cache[0] = withModifiers(() => false, ["prevent"]))
112
+ onSubmit: i[0] || (i[0] = K(() => !1, ["prevent"]))
184
113
  }, [
185
- createVNode(_component_nut_cell_group, null, {
186
- default: withCtx(() => [
187
- renderSlot(_ctx.$slots, "default")
114
+ L(g, null, {
115
+ default: Q(() => [
116
+ X(l.$slots, "default")
188
117
  ]),
189
118
  _: 3
190
119
  })
191
120
  ], 32);
192
121
  }
193
- const Form = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
122
+ const ce = /* @__PURE__ */ Y(R, [["render", ee]]);
194
123
  export {
195
- Form as default
124
+ ce as default
196
125
  };
@@ -1,14 +1,13 @@
1
- import { p as pxCheck } from "./pxCheck-c6b9f6b7.js";
2
- import { inject, provide, computed, resolveComponent, openBlock, createBlock, normalizeClass, normalizeStyle, withCtx, createElementBlock, renderSlot, createTextVNode, toDisplayString, createCommentVNode, createElementVNode } from "vue";
3
- import { c as createComponent } from "./component-81a4c1d0.js";
4
- import Cell from "./Cell.js";
5
- import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
1
+ import { p as S } from "./pxCheck-38173291.js";
2
+ import { inject as h, provide as _, computed as l, resolveComponent as A, openBlock as o, createBlock as w, normalizeClass as m, normalizeStyle as t, withCtx as $, createElementBlock as p, renderSlot as u, createTextVNode as v, toDisplayString as d, createCommentVNode as y, createElementVNode as f } from "vue";
3
+ import { c as C } from "./component-234624bc.js";
4
+ import c from "./Cell.js";
5
+ import { _ as E } from "./_plugin-vue_export-helper-dad06003.js";
6
6
  import "../locale/lang";
7
- import "./index-54d03fc1.js";
7
+ import "./index-50eed3d9.js";
8
8
  import "@nutui/icons-vue";
9
- const { componentName, create } = createComponent("form-item");
10
- const _sfc_main = create({
11
- inheritAttrs: false,
9
+ const { componentName: I, create: k } = C("form-item"), B = k({
10
+ inheritAttrs: !1,
12
11
  props: {
13
12
  prop: {
14
13
  type: String,
@@ -20,21 +19,19 @@ const _sfc_main = create({
20
19
  },
21
20
  rules: {
22
21
  type: Array,
23
- default: () => {
24
- return [];
25
- }
22
+ default: () => []
26
23
  },
27
24
  required: {
28
25
  type: Boolean,
29
- default: false
26
+ default: !1
30
27
  },
31
28
  showErrorMessage: {
32
29
  type: Boolean,
33
- default: true
30
+ default: !0
34
31
  },
35
32
  showErrorLine: {
36
33
  type: Boolean,
37
- default: true
34
+ default: !0
38
35
  },
39
36
  labelWidth: {
40
37
  type: [String, Number],
@@ -54,69 +51,59 @@ const _sfc_main = create({
54
51
  }
55
52
  },
56
53
  components: {
57
- [Cell.name]: Cell
54
+ [c.name]: c
58
55
  },
59
56
  emits: [""],
60
- setup(props, { emit, slots }) {
61
- const parent = inject("formErrorTip");
62
- provide("form", {
63
- props
57
+ setup(e, { emit: g, slots: n }) {
58
+ const s = h("formErrorTip");
59
+ _("form", {
60
+ props: e
64
61
  });
65
- const labelStyle = computed(() => {
66
- return {
67
- width: pxCheck(props.labelWidth),
68
- textAlign: props.labelAlign
69
- };
70
- });
71
- const bodyStyle = computed(() => {
72
- return {
73
- textAlign: props.bodyAlign
74
- };
75
- });
76
- const errorMessageStyle = computed(() => {
77
- return {
78
- textAlign: props.errorMessageAlign
79
- };
80
- });
81
- const getSlots = (name) => slots[name];
82
- return { parent, labelStyle, bodyStyle, errorMessageStyle, getSlots };
62
+ const a = l(() => ({
63
+ width: S(e.labelWidth),
64
+ textAlign: e.labelAlign
65
+ })), i = l(() => ({
66
+ textAlign: e.bodyAlign
67
+ })), r = l(() => ({
68
+ textAlign: e.errorMessageAlign
69
+ }));
70
+ return { parent: s, labelStyle: a, bodyStyle: i, errorMessageStyle: r, getSlots: (b) => n[b] };
83
71
  }
84
- });
85
- const _hoisted_1 = { class: "nut-cell__value nut-form-item__body" };
86
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
87
- const _component_nut_cell = resolveComponent("nut-cell");
88
- return openBlock(), createBlock(_component_nut_cell, {
89
- class: normalizeClass(["nut-form-item", [{ error: _ctx.parent[_ctx.prop], line: _ctx.showErrorLine }, _ctx.$attrs.class]]),
90
- style: normalizeStyle(_ctx.$attrs.style)
72
+ }), M = { class: "nut-cell__value nut-form-item__body" };
73
+ function N(e, g, n, s, a, i) {
74
+ const r = A("nut-cell");
75
+ return o(), w(r, {
76
+ class: m(["nut-form-item", [{ error: e.parent[e.prop], line: e.showErrorLine }, e.$attrs.class]]),
77
+ style: t(e.$attrs.style)
91
78
  }, {
92
- default: withCtx(() => [
93
- _ctx.label || _ctx.getSlots("label") ? (openBlock(), createElementBlock("view", {
79
+ default: $(() => [
80
+ e.label || e.getSlots("label") ? (o(), p("view", {
94
81
  key: 0,
95
- class: normalizeClass(["nut-cell__title nut-form-item__label", { required: _ctx.required }]),
96
- style: normalizeStyle(_ctx.labelStyle)
82
+ class: m(["nut-cell__title nut-form-item__label", { required: e.required }]),
83
+ style: t(e.labelStyle)
97
84
  }, [
98
- renderSlot(_ctx.$slots, "label", {}, () => [
99
- createTextVNode(toDisplayString(_ctx.label), 1)
85
+ u(e.$slots, "label", {}, () => [
86
+ v(d(e.label), 1)
100
87
  ])
101
- ], 6)) : createCommentVNode("", true),
102
- createElementVNode("view", _hoisted_1, [
103
- createElementVNode("view", {
88
+ ], 6)) : y("", !0),
89
+ f("view", M, [
90
+ f("view", {
104
91
  class: "nut-form-item__body__slots",
105
- style: normalizeStyle(_ctx.bodyStyle)
92
+ style: t(e.bodyStyle)
106
93
  }, [
107
- renderSlot(_ctx.$slots, "default")
94
+ u(e.$slots, "default")
108
95
  ], 4),
109
- _ctx.parent[_ctx.prop] && _ctx.showErrorMessage ? (openBlock(), createElementBlock("view", {
96
+ e.parent[e.prop] && e.showErrorMessage ? (o(), p("view", {
110
97
  key: 0,
111
98
  class: "nut-form-item__body__tips",
112
- style: normalizeStyle(_ctx.errorMessageStyle)
113
- }, toDisplayString(_ctx.parent[_ctx.prop]), 5)) : createCommentVNode("", true)
99
+ style: t(e.errorMessageStyle)
100
+ }, d(e.parent[e.prop]), 5)) : y("", !0)
114
101
  ])
115
102
  ]),
116
103
  _: 3
117
104
  }, 8, ["class", "style"]);
118
105
  }
119
- const FormItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
106
+ const G = /* @__PURE__ */ E(B, [["render", N]]);
120
107
  export {
121
- FormItem as default
108
+ G as default
122
109
  };
@@ -1,10 +1,9 @@
1
- import { c as createComponent } from "./component-81a4c1d0.js";
1
+ import { c as o } from "./component-234624bc.js";
2
2
  import "vue";
3
- import { c as component } from "./common-b9a5e726.js";
3
+ import { c as t } from "./common-d218746f.js";
4
4
  import "../locale/lang";
5
- import "./pxCheck-c6b9f6b7.js";
6
- const { create } = createComponent("grid");
7
- const _sfc_main = create(component);
5
+ import "./pxCheck-38173291.js";
6
+ const { create: r } = o("grid"), i = r(t);
8
7
  export {
9
- _sfc_main as default
8
+ i as default
10
9
  };