@nutui/nutui 4.3.4 → 4.3.6

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 (88) hide show
  1. package/CHANGELOG.md +40 -1
  2. package/dist/nutui.es.js +1 -1
  3. package/dist/nutui.js +5358 -5629
  4. package/dist/nutui.umd.js +1 -1
  5. package/dist/packages/audio/Audio.js +2 -1
  6. package/dist/packages/audiooperate/AudioOperate.js +2 -1
  7. package/dist/packages/cell/Cell.js +89 -80
  8. package/dist/packages/cellgroup/CellGroup.js +44 -21
  9. package/dist/packages/checkbox/Checkbox.js +1 -1
  10. package/dist/packages/{common-DRG0ue26.js → common-BH7uB7Cn.js} +4 -2
  11. package/dist/packages/countdown/Countdown.js +130 -173
  12. package/dist/packages/form/Form.js +5 -5
  13. package/dist/packages/formitem/FormItem.js +5 -5
  14. package/dist/packages/grid/Grid.js +68 -5
  15. package/dist/packages/griditem/GridItem.js +61 -81
  16. package/dist/packages/input/Input.js +1 -1
  17. package/dist/packages/inputnumber/InputNumber.js +7 -7
  18. package/dist/packages/invoice/Invoice.js +4 -4
  19. package/dist/packages/picker/Picker.js +1 -1
  20. package/dist/packages/radio/Radio.js +112 -1
  21. package/dist/packages/radiogroup/RadioGroup.js +60 -1
  22. package/dist/packages/range/Range.js +1 -1
  23. package/dist/packages/rate/Rate.js +1 -1
  24. package/dist/packages/searchbar/Searchbar.js +1 -1
  25. package/dist/packages/skeleton/Skeleton.js +88 -123
  26. package/dist/packages/step/Step.js +64 -83
  27. package/dist/packages/steps/Steps.js +44 -40
  28. package/dist/packages/switch/Switch.js +1 -1
  29. package/dist/packages/tabpane/TabPane.js +2 -1
  30. package/dist/packages/tabs/Tabs.js +2 -1
  31. package/dist/packages/textarea/Textarea.js +1 -1
  32. package/dist/packages/types-BMA1Y94E.js +4 -0
  33. package/dist/packages/types-BXlnzugj.js +4 -0
  34. package/dist/packages/types-CJeZIBld.js +4 -0
  35. package/dist/packages/uploader/Uploader.js +1 -1
  36. package/dist/smartips/web-types.json +446 -26
  37. package/dist/types/__VUE/audio/index.vue.d.ts +2 -2
  38. package/dist/types/__VUE/audio/types.d.ts +2 -0
  39. package/dist/types/__VUE/audiooperate/index.vue.d.ts +1 -1
  40. package/dist/types/__VUE/cell/cell.vue.d.ts +113 -0
  41. package/dist/types/__VUE/cell/index.d.ts +6 -0
  42. package/dist/types/__VUE/cellgroup/cell-group.vue.d.ts +55 -0
  43. package/dist/types/__VUE/cellgroup/index.d.ts +5 -0
  44. package/dist/types/__VUE/countdown/countdown.vue.d.ts +108 -0
  45. package/dist/types/__VUE/countdown/index.d.ts +5 -0
  46. package/dist/types/__VUE/countdown/util.d.ts +14 -0
  47. package/dist/types/__VUE/form/common.d.ts +1 -0
  48. package/dist/types/__VUE/grid/grid.vue.d.ts +87 -0
  49. package/dist/types/__VUE/grid/index.d.ts +6 -0
  50. package/dist/types/__VUE/grid/types.d.ts +2 -0
  51. package/dist/types/__VUE/griditem/grid-item.vue.d.ts +64 -0
  52. package/dist/types/__VUE/griditem/index.d.ts +5 -0
  53. package/dist/types/__VUE/navbar/navbar.vue.d.ts +1 -1
  54. package/dist/types/__VUE/picker/Column.vue.d.ts +2 -2
  55. package/dist/types/__VUE/radio/index.d.ts +6 -0
  56. package/dist/types/__VUE/radio/radio.vue.d.ts +74 -0
  57. package/dist/types/__VUE/radiogroup/index.d.ts +5 -0
  58. package/dist/types/__VUE/radiogroup/radio-group.vue.d.ts +66 -0
  59. package/dist/types/__VUE/skeleton/index.d.ts +5 -0
  60. package/dist/types/__VUE/skeleton/skeleton.vue.d.ts +102 -0
  61. package/dist/types/__VUE/step/index.d.ts +5 -0
  62. package/dist/types/__VUE/step/step.vue.d.ts +55 -0
  63. package/dist/types/__VUE/steps/index.d.ts +6 -0
  64. package/dist/types/__VUE/steps/steps.vue.d.ts +64 -0
  65. package/dist/types/__VUE/swiper/index.vue.d.ts +2 -2
  66. package/dist/types/__VUE/tabs/index.vue.d.ts +1 -1
  67. package/dist/types/__VUE/tabs/types.d.ts +1 -0
  68. package/dist/types/__VUE/uploader/index.vue.d.ts +1 -1
  69. package/dist/types/index.d.ts +21 -11
  70. package/dist/types/utils/Interceptor.d.ts +2 -2
  71. package/dist/types/utils/index.d.ts +2 -0
  72. package/dist/types/utils/useRelation/useParent.d.ts +1 -1
  73. package/package.json +1 -1
  74. package/dist/packages/common-Chr7cC9o.js +0 -145
  75. package/dist/packages/index.vue_vue_type_script_lang-CTQUvlgN.js +0 -99
  76. package/dist/packages/index.vue_vue_type_script_lang-CaSiRl9x.js +0 -46
  77. package/dist/types/__VUE/audiooperate/types.d.ts +0 -1
  78. package/dist/types/__VUE/cell/index.vue.d.ts +0 -120
  79. package/dist/types/__VUE/cellgroup/index.vue.d.ts +0 -33
  80. package/dist/types/__VUE/countdown/index.vue.d.ts +0 -125
  81. package/dist/types/__VUE/grid/common.d.ts +0 -73
  82. package/dist/types/__VUE/grid/index.vue.d.ts +0 -84
  83. package/dist/types/__VUE/griditem/index.vue.d.ts +0 -47
  84. package/dist/types/__VUE/radio/index.vue.d.ts +0 -64
  85. package/dist/types/__VUE/radiogroup/index.vue.d.ts +0 -49
  86. package/dist/types/__VUE/skeleton/index.vue.d.ts +0 -117
  87. package/dist/types/__VUE/step/index.vue.d.ts +0 -42
  88. package/dist/types/__VUE/steps/index.vue.d.ts +0 -48
@@ -17,11 +17,9 @@ var __spreadValues = (a, b) => {
17
17
  return a;
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
- import { reactive, computed, onBeforeMount, watch, toRefs, openBlock, createElementBlock, renderSlot } from "vue";
21
- import { c as createComponent } from "../component-DQf3CENX.js";
20
+ import { defineComponent, ref, computed, onBeforeMount, watch, openBlock, createElementBlock, renderSlot, createElementVNode } from "vue";
22
21
  import { p as padZero } from "../util-DnfK0Qan.js";
23
- import { u as useLocale } from "../index-CFigyH92.js";
24
- import { _ as _export_sfc } from "../_plugin-vue_export-helper-1tPrXgE0.js";
22
+ import { w as withInstall } from "../with-install-Ch3FF0uS.js";
25
23
  const getTimeStamp = (timeStr) => {
26
24
  if (!timeStr)
27
25
  return Date.now();
@@ -29,54 +27,78 @@ const getTimeStamp = (timeStr) => {
29
27
  t = +t > 0 ? +t : t.toString().replace(/-/g, "/");
30
28
  return new Date(t).getTime();
31
29
  };
32
- const { create } = createComponent("countdown");
33
- const cN = "NutCountdown";
34
- const _sfc_main = create({
35
- props: {
36
- modelValue: {
37
- type: Object,
38
- default: () => {
39
- return {};
40
- }
41
- },
42
- paused: {
43
- default: false,
44
- type: Boolean
45
- },
46
- startTime: {
47
- // 可以是服务器当前时间
48
- type: [Number, String],
49
- validator(v) {
50
- const dateStr = new Date(v).toString().toLowerCase();
51
- return dateStr !== "invalid date";
52
- }
53
- },
54
- endTime: {
55
- type: [Number, String],
56
- validator(v) {
57
- const dateStr = new Date(v).toString().toLowerCase();
58
- return dateStr !== "invalid date";
59
- }
60
- },
61
- // 是否开启毫秒
62
- millisecond: {
63
- default: false,
64
- type: Boolean
65
- },
66
- // 时间格式化
67
- format: {
68
- type: String,
69
- default: "HH:mm:ss"
70
- },
71
- autoStart: {
72
- type: Boolean,
73
- default: true
74
- },
75
- // 倒计时时长,单位毫秒
76
- time: {
77
- type: [Number, String],
78
- default: 0
30
+ const parseFormat = (time, format) => {
31
+ let { h, m, s, ms } = time;
32
+ const { d } = time;
33
+ if (format.includes("DD")) {
34
+ format = format.replace("DD", padZero(d));
35
+ } else {
36
+ h += Number(d) * 24;
37
+ }
38
+ if (format.includes("HH")) {
39
+ format = format.replace("HH", padZero(h));
40
+ } else {
41
+ m += Number(h) * 60;
42
+ }
43
+ if (format.includes("mm")) {
44
+ format = format.replace("mm", padZero(m));
45
+ } else {
46
+ s += Number(m) * 60;
47
+ }
48
+ if (format.includes("ss")) {
49
+ format = format.replace("ss", padZero(s));
50
+ } else {
51
+ ms += Number(s) * 1e3;
52
+ }
53
+ if (format.includes("S")) {
54
+ const msC = padZero(ms, 3).toString();
55
+ if (format.includes("SSS")) {
56
+ format = format.replace("SSS", msC);
57
+ } else if (format.includes("SS")) {
58
+ format = format.replace("SS", msC.slice(0, 2));
59
+ } else if (format.includes("S")) {
60
+ format = format.replace("S", msC.slice(0, 1));
79
61
  }
62
+ }
63
+ return format;
64
+ };
65
+ const formatRemainTime = (t, format, type) => {
66
+ const ts = t;
67
+ const rest = {
68
+ d: 0,
69
+ h: 0,
70
+ m: 0,
71
+ s: 0,
72
+ ms: 0
73
+ };
74
+ const SECOND = 1e3;
75
+ const MINUTE = 60 * SECOND;
76
+ const HOUR = 60 * MINUTE;
77
+ const DAY = 24 * HOUR;
78
+ if (ts > 0) {
79
+ rest.d = ts >= SECOND ? Math.floor(ts / DAY) : 0;
80
+ rest.h = Math.floor(ts % DAY / HOUR);
81
+ rest.m = Math.floor(ts % HOUR / MINUTE);
82
+ rest.s = Math.floor(ts % MINUTE / SECOND);
83
+ rest.ms = Math.floor(ts % SECOND);
84
+ }
85
+ return type == "custom" ? rest : parseFormat(__spreadValues({}, rest), format);
86
+ };
87
+ const _hoisted_1 = { class: "nut-countdown" };
88
+ const _hoisted_2 = ["innerHTML"];
89
+ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, {
90
+ name: "NutCountdown"
91
+ }), {
92
+ __name: "countdown",
93
+ props: {
94
+ modelValue: {},
95
+ paused: { type: Boolean, default: false },
96
+ startTime: { default: "" },
97
+ endTime: { default: "" },
98
+ millisecond: { type: Boolean, default: false },
99
+ format: { default: "HH:mm:ss" },
100
+ autoStart: { type: Boolean, default: true },
101
+ time: { default: 0 }
80
102
  },
81
103
  emits: [
82
104
  "input",
@@ -89,38 +111,33 @@ const _sfc_main = create({
89
111
  "onRestart",
90
112
  "onPaused"
91
113
  ],
92
- setup(props, { emit, slots }) {
93
- const translate = useLocale(cN);
94
- const state = reactive({
95
- restTime: 0,
96
- // 倒计时剩余时间时间
97
- timer: null,
98
- counting: !props.paused && props.autoStart,
99
- // 是否处于倒计时中
100
- handleEndTime: Date.now(),
101
- // 最终截止时间
102
- diffTime: 0
103
- // 设置了 startTime 时,与 date.now() 的差异
104
- });
114
+ setup(__props, { expose: __expose, emit: __emit }) {
115
+ const props = __props;
116
+ const emit = __emit;
117
+ const restTime = ref(0);
118
+ const timer = ref(null);
119
+ const counting = ref(!props.paused && props.autoStart);
120
+ const handleEndTime = ref(Date.now());
121
+ const diffTime = ref(0);
105
122
  const renderTime = computed(() => {
106
- return formatRemainTime(state.restTime);
123
+ return formatRemainTime(restTime.value, props.format);
107
124
  });
108
125
  const initTime = () => {
109
- state.handleEndTime = Number(props.endTime);
110
- state.diffTime = Date.now() - getTimeStamp(props.startTime);
111
- if (!state.counting)
112
- state.counting = true;
126
+ handleEndTime.value = Number(props.endTime);
127
+ diffTime.value = Date.now() - getTimeStamp(props.startTime);
128
+ if (!counting.value)
129
+ counting.value = true;
113
130
  tick();
114
131
  };
115
132
  const tick = () => {
116
133
  if (window !== void 0) {
117
- state.timer = requestAnimationFrame(() => {
118
- if (state.counting) {
119
- const currentTime = Date.now() - state.diffTime;
120
- const remainTime = Math.max(state.handleEndTime - currentTime, 0);
121
- state.restTime = remainTime;
134
+ timer.value = requestAnimationFrame(() => {
135
+ if (counting.value) {
136
+ const currentTime = Date.now() - diffTime.value;
137
+ const remainTime = Math.max(handleEndTime.value - currentTime, 0);
138
+ restTime.value = remainTime;
122
139
  if (!remainTime) {
123
- state.counting = false;
140
+ counting.value = false;
124
141
  pause();
125
142
  emit("end");
126
143
  emit("onEnd");
@@ -132,95 +149,43 @@ const _sfc_main = create({
132
149
  });
133
150
  }
134
151
  };
135
- const formatRemainTime = (t, type) => {
136
- const ts = t;
137
- let rest = {
138
- d: 0,
139
- h: 0,
140
- m: 0,
141
- s: 0,
142
- ms: 0
143
- };
144
- const SECOND = 1e3;
145
- const MINUTE = 60 * SECOND;
146
- const HOUR = 60 * MINUTE;
147
- const DAY = 24 * HOUR;
148
- if (ts > 0) {
149
- rest.d = ts >= SECOND ? Math.floor(ts / DAY) : 0;
150
- rest.h = Math.floor(ts % DAY / HOUR);
151
- rest.m = Math.floor(ts % HOUR / MINUTE);
152
- rest.s = Math.floor(ts % MINUTE / SECOND);
153
- rest.ms = Math.floor(ts % SECOND);
154
- }
155
- return type == "custom" ? rest : parseFormat(__spreadValues({}, rest));
156
- };
157
- const parseFormat = (time) => {
158
- let { d, h, m, s, ms } = time;
159
- let format = props.format;
160
- if (format.includes("DD")) {
161
- format = format.replace("DD", padZero(d));
162
- } else {
163
- h += Number(d) * 24;
164
- }
165
- if (format.includes("HH")) {
166
- format = format.replace("HH", padZero(h));
167
- } else {
168
- m += Number(h) * 60;
169
- }
170
- if (format.includes("mm")) {
171
- format = format.replace("mm", padZero(m));
172
- } else {
173
- s += Number(m) * 60;
174
- }
175
- if (format.includes("ss")) {
176
- format = format.replace("ss", padZero(s));
177
- } else {
178
- ms += Number(s) * 1e3;
179
- }
180
- if (format.includes("S")) {
181
- const msC = padZero(ms, 3).toString();
182
- if (format.includes("SSS")) {
183
- format = format.replace("SSS", msC);
184
- } else if (format.includes("SS")) {
185
- format = format.replace("SS", msC.slice(0, 2));
186
- } else if (format.includes("S")) {
187
- format = format.replace("S", msC.slice(0, 1));
188
- }
189
- }
190
- return format;
191
- };
192
152
  const start = () => {
193
- if (!state.counting && !props.autoStart) {
194
- state.counting = true;
195
- state.handleEndTime = Date.now() + Number(state.restTime);
153
+ if (!counting.value && !props.autoStart) {
154
+ counting.value = true;
155
+ handleEndTime.value = Date.now() + Number(restTime.value);
196
156
  tick();
197
- emit("restart", state.restTime);
198
- emit("onRestart", state.restTime);
157
+ emit("restart", restTime.value);
158
+ emit("onRestart", restTime.value);
199
159
  }
200
160
  };
201
161
  const pause = () => {
202
- cancelAnimationFrame(state.timer);
203
- state.counting = false;
204
- emit("paused", state.restTime);
205
- emit("onPaused", state.restTime);
162
+ cancelAnimationFrame(timer.value);
163
+ counting.value = false;
164
+ emit("restart", restTime.value);
165
+ emit("onRestart", restTime.value);
206
166
  };
207
167
  const reset = () => {
208
168
  if (!props.autoStart) {
209
169
  pause();
210
- state.restTime = Number(props.time);
170
+ restTime.value = Number(props.time);
211
171
  }
212
172
  };
173
+ __expose({
174
+ start,
175
+ pause,
176
+ reset
177
+ });
213
178
  onBeforeMount(() => {
214
179
  if (props.autoStart) {
215
180
  initTime();
216
181
  } else {
217
- state.restTime = Number(props.time);
182
+ restTime.value = Number(props.time);
218
183
  }
219
184
  });
220
185
  watch(
221
- () => state.restTime,
186
+ () => restTime.value,
222
187
  (value) => {
223
- let tranTime = formatRemainTime(value, "custom");
188
+ const tranTime = formatRemainTime(value, props.format, "custom");
224
189
  emit("update:modelValue", tranTime);
225
190
  emit("input", tranTime);
226
191
  }
@@ -229,17 +194,17 @@ const _sfc_main = create({
229
194
  () => props.paused,
230
195
  (v, ov) => {
231
196
  if (!ov) {
232
- if (state.counting) {
197
+ if (counting.value) {
233
198
  pause();
234
199
  }
235
200
  } else {
236
- if (!state.counting) {
237
- state.counting = true;
238
- state.handleEndTime = Date.now() + Number(state.restTime);
201
+ if (!counting.value) {
202
+ counting.value = true;
203
+ handleEndTime.value = Date.now() + Number(restTime.value);
239
204
  tick();
240
205
  }
241
- emit("restart", state.restTime);
242
- emit("onRestart", state.restTime);
206
+ emit("restart", restTime.value);
207
+ emit("onRestart", restTime.value);
243
208
  }
244
209
  }
245
210
  );
@@ -255,28 +220,20 @@ const _sfc_main = create({
255
220
  initTime();
256
221
  }
257
222
  );
258
- return __spreadProps(__spreadValues({}, toRefs(props)), {
259
- slots,
260
- start,
261
- pause,
262
- renderTime,
263
- translate,
264
- reset
265
- });
223
+ return (_ctx, _cache) => {
224
+ return openBlock(), createElementBlock("view", _hoisted_1, [
225
+ renderSlot(_ctx.$slots, "default", {}, () => [
226
+ createElementVNode("view", {
227
+ class: "nut-countdown__content",
228
+ innerHTML: renderTime.value
229
+ }, null, 8, _hoisted_2)
230
+ ])
231
+ ]);
232
+ };
266
233
  }
267
- });
268
- const _hoisted_1 = { class: "nut-countdown" };
269
- const _hoisted_2 = ["innerHTML"];
270
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
271
- return openBlock(), createElementBlock("view", _hoisted_1, [
272
- _ctx.slots.default ? renderSlot(_ctx.$slots, "default", { key: 0 }) : (openBlock(), createElementBlock("view", {
273
- key: 1,
274
- class: "nut-countdown__content",
275
- innerHTML: _ctx.renderTime
276
- }, null, 8, _hoisted_2))
277
- ]);
278
- }
279
- const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
234
+ }));
235
+ withInstall(_sfc_main);
280
236
  export {
281
- index as default
237
+ _sfc_main as Countdown,
238
+ _sfc_main as default
282
239
  };
@@ -49,11 +49,11 @@ var __async = (__this, __arguments, generator) => {
49
49
  step((generator = generator.apply(__this, __arguments)).next());
50
50
  });
51
51
  };
52
- import { defineComponent, computed, reactive, provide, watch, openBlock, createElementBlock, withModifiers, createVNode, withCtx, renderSlot } from "vue";
52
+ import { defineComponent, computed, reactive, provide, watch, openBlock, createElementBlock, withModifiers, createVNode, unref, withCtx, renderSlot } from "vue";
53
53
  import { u as useChildren } from "../useChildren-BZ4-J79J.js";
54
54
  import { g as getPropByPath, f as isPromise } from "../util-DnfK0Qan.js";
55
- import NutCellGroup from "../cellgroup/CellGroup.js";
56
- import { F as FORM_KEY, a as FORM_DISABLED_KEY } from "../common-DRG0ue26.js";
55
+ import { CellGroup as _sfc_main$1 } from "../cellgroup/CellGroup.js";
56
+ import { F as FORM_TIP_KEY, a as FORM_KEY, b as FORM_DISABLED_KEY } from "../common-BH7uB7Cn.js";
57
57
  import { w as withInstall } from "../with-install-Ch3FF0uS.js";
58
58
  const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, {
59
59
  name: "NutForm"
@@ -75,7 +75,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
75
75
  const { linkChildren: linkChildren2 } = useChildren(FORM_DISABLED_KEY);
76
76
  linkChildren2({ props });
77
77
  const formErrorTip = computed(() => reactive({}));
78
- provide("formErrorTip", formErrorTip);
78
+ provide(FORM_TIP_KEY, formErrorTip);
79
79
  const clearErrorTips = () => {
80
80
  Object.keys(formErrorTip.value).forEach((item) => {
81
81
  formErrorTip.value[item] = "";
@@ -199,7 +199,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
199
199
  action: "#",
200
200
  onSubmit: withModifiers(() => false, ["prevent"])
201
201
  }, [
202
- createVNode(NutCellGroup, null, {
202
+ createVNode(unref(_sfc_main$1), null, {
203
203
  default: withCtx(() => [
204
204
  renderSlot(_ctx.$slots, "default")
205
205
  ]),
@@ -17,10 +17,10 @@ var __spreadValues = (a, b) => {
17
17
  return a;
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
- import { defineComponent, computed, inject, openBlock, createBlock, normalizeClass, unref, normalizeStyle, withCtx, createElementBlock, renderSlot, createTextVNode, toDisplayString, createCommentVNode, createElementVNode } from "vue";
20
+ import { defineComponent, computed, inject, openBlock, createBlock, unref, normalizeClass, normalizeStyle, withCtx, createElementBlock, renderSlot, createTextVNode, toDisplayString, createCommentVNode, createElementVNode } from "vue";
21
21
  import { p as pxCheck } from "../pxCheck-DN6FYV6q.js";
22
- import NutCell from "../cell/Cell.js";
23
- import { F as FORM_KEY } from "../common-DRG0ue26.js";
22
+ import { Cell as _sfc_main$1 } from "../cell/Cell.js";
23
+ import { F as FORM_TIP_KEY, a as FORM_KEY } from "../common-BH7uB7Cn.js";
24
24
  import { u as useParent } from "../useParent-D6DiuxZZ.js";
25
25
  import { w as withInstall } from "../with-install-Ch3FF0uS.js";
26
26
  const _hoisted_1 = { class: "nut-cell__value nut-form-item__body" };
@@ -67,7 +67,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
67
67
  const position = props.starPosition ? props.starPosition : starPosition;
68
68
  return position !== "left" ? `nut-form-item__star-${position}` : "";
69
69
  });
70
- const parent = inject("formErrorTip");
70
+ const parent = inject(FORM_TIP_KEY);
71
71
  const labelStyle = computed(() => {
72
72
  return {
73
73
  width: pxCheck(props.labelWidth),
@@ -85,7 +85,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
85
85
  };
86
86
  });
87
87
  return (_ctx, _cache) => {
88
- return openBlock(), createBlock(NutCell, {
88
+ return openBlock(), createBlock(unref(_sfc_main$1), {
89
89
  class: normalizeClass(["nut-form-item", [{ error: unref(parent)[_ctx.prop], line: _ctx.showErrorLine }, _ctx.$attrs.class, labelPositionClass.value]]),
90
90
  style: normalizeStyle(_ctx.$attrs.style)
91
91
  }, {
@@ -1,8 +1,71 @@
1
- import { c as createComponent } from "../component-DQf3CENX.js";
2
- import "vue";
3
- import { c as component } from "../common-Chr7cC9o.js";
4
- const { create } = createComponent("grid");
5
- const _sfc_main = create(component);
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ import { defineComponent, computed, openBlock, createElementBlock, normalizeClass, normalizeStyle, renderSlot } from "vue";
21
+ import { u as useChildren } from "../useChildren-BZ4-J79J.js";
22
+ import { p as pxCheck } from "../pxCheck-DN6FYV6q.js";
23
+ import { G as GRID_KEY } from "../types-CJeZIBld.js";
24
+ import { w as withInstall } from "../with-install-Ch3FF0uS.js";
25
+ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, {
26
+ name: "NutGrid"
27
+ }), {
28
+ __name: "grid",
29
+ props: {
30
+ columnNum: { default: 4 },
31
+ border: { type: Boolean, default: true },
32
+ gutter: { default: 0 },
33
+ center: { type: Boolean, default: true },
34
+ square: { type: Boolean, default: false },
35
+ reverse: { type: Boolean, default: false },
36
+ direction: {},
37
+ clickable: { type: Boolean, default: false }
38
+ },
39
+ setup(__props) {
40
+ const props = __props;
41
+ const { linkChildren } = useChildren(GRID_KEY);
42
+ linkChildren({ props });
43
+ const rootClass = computed(() => {
44
+ const prefixCls = "nut-grid";
45
+ return {
46
+ [prefixCls]: true,
47
+ [`${prefixCls}--border`]: props.border && !props.gutter
48
+ };
49
+ });
50
+ const rootStyle = computed(() => {
51
+ const style = {};
52
+ if (props.gutter) {
53
+ style.paddingLeft = pxCheck(props.gutter);
54
+ }
55
+ return style;
56
+ });
57
+ return (_ctx, _cache) => {
58
+ return openBlock(), createElementBlock("view", {
59
+ class: normalizeClass(rootClass.value),
60
+ style: normalizeStyle(rootStyle.value)
61
+ }, [
62
+ renderSlot(_ctx.$slots, "default")
63
+ ], 6);
64
+ };
65
+ }
66
+ }));
67
+ withInstall(_sfc_main);
6
68
  export {
69
+ _sfc_main as Grid,
7
70
  _sfc_main as default
8
71
  };