@nutui/nutui 4.3.5 → 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 (72) hide show
  1. package/CHANGELOG.md +20 -1
  2. package/dist/nutui.es.js +1 -1
  3. package/dist/nutui.js +5014 -5222
  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/checkbox/Checkbox.js +1 -1
  8. package/dist/packages/{common-DRG0ue26.js → common-BH7uB7Cn.js} +4 -2
  9. package/dist/packages/countdown/Countdown.js +130 -173
  10. package/dist/packages/form/Form.js +2 -2
  11. package/dist/packages/formitem/FormItem.js +2 -2
  12. package/dist/packages/grid/Grid.js +68 -5
  13. package/dist/packages/griditem/GridItem.js +61 -81
  14. package/dist/packages/input/Input.js +1 -1
  15. package/dist/packages/inputnumber/InputNumber.js +1 -1
  16. package/dist/packages/invoice/Invoice.js +4 -4
  17. package/dist/packages/picker/Picker.js +1 -1
  18. package/dist/packages/radio/Radio.js +112 -1
  19. package/dist/packages/radiogroup/RadioGroup.js +60 -1
  20. package/dist/packages/range/Range.js +1 -1
  21. package/dist/packages/rate/Rate.js +1 -1
  22. package/dist/packages/searchbar/Searchbar.js +1 -1
  23. package/dist/packages/step/Step.js +64 -83
  24. package/dist/packages/steps/Steps.js +44 -40
  25. package/dist/packages/switch/Switch.js +1 -1
  26. package/dist/packages/tabpane/TabPane.js +2 -1
  27. package/dist/packages/tabs/Tabs.js +2 -1
  28. package/dist/packages/textarea/Textarea.js +1 -1
  29. package/dist/packages/types-BMA1Y94E.js +4 -0
  30. package/dist/packages/types-BXlnzugj.js +4 -0
  31. package/dist/packages/types-CJeZIBld.js +4 -0
  32. package/dist/packages/uploader/Uploader.js +1 -1
  33. package/dist/smartips/web-types.json +446 -26
  34. package/dist/types/__VUE/audio/index.vue.d.ts +2 -2
  35. package/dist/types/__VUE/audio/types.d.ts +2 -0
  36. package/dist/types/__VUE/audiooperate/index.vue.d.ts +1 -1
  37. package/dist/types/__VUE/countdown/countdown.vue.d.ts +108 -0
  38. package/dist/types/__VUE/countdown/index.d.ts +5 -0
  39. package/dist/types/__VUE/countdown/util.d.ts +14 -0
  40. package/dist/types/__VUE/form/common.d.ts +1 -0
  41. package/dist/types/__VUE/grid/grid.vue.d.ts +87 -0
  42. package/dist/types/__VUE/grid/index.d.ts +6 -0
  43. package/dist/types/__VUE/grid/types.d.ts +2 -0
  44. package/dist/types/__VUE/griditem/grid-item.vue.d.ts +64 -0
  45. package/dist/types/__VUE/griditem/index.d.ts +5 -0
  46. package/dist/types/__VUE/picker/Column.vue.d.ts +2 -2
  47. package/dist/types/__VUE/radio/index.d.ts +6 -0
  48. package/dist/types/__VUE/radio/radio.vue.d.ts +74 -0
  49. package/dist/types/__VUE/radiogroup/index.d.ts +5 -0
  50. package/dist/types/__VUE/radiogroup/radio-group.vue.d.ts +66 -0
  51. package/dist/types/__VUE/step/index.d.ts +5 -0
  52. package/dist/types/__VUE/step/step.vue.d.ts +55 -0
  53. package/dist/types/__VUE/steps/index.d.ts +6 -0
  54. package/dist/types/__VUE/steps/steps.vue.d.ts +64 -0
  55. package/dist/types/__VUE/tabs/index.vue.d.ts +1 -1
  56. package/dist/types/__VUE/tabs/types.d.ts +1 -0
  57. package/dist/types/index.d.ts +15 -8
  58. package/dist/types/utils/index.d.ts +2 -0
  59. package/dist/types/utils/useRelation/useParent.d.ts +1 -1
  60. package/package.json +1 -1
  61. package/dist/packages/common-Chr7cC9o.js +0 -145
  62. package/dist/packages/index.vue_vue_type_script_lang-CTQUvlgN.js +0 -99
  63. package/dist/packages/index.vue_vue_type_script_lang-CaSiRl9x.js +0 -46
  64. package/dist/types/__VUE/audiooperate/types.d.ts +0 -1
  65. package/dist/types/__VUE/countdown/index.vue.d.ts +0 -125
  66. package/dist/types/__VUE/grid/common.d.ts +0 -73
  67. package/dist/types/__VUE/grid/index.vue.d.ts +0 -84
  68. package/dist/types/__VUE/griditem/index.vue.d.ts +0 -47
  69. package/dist/types/__VUE/radio/index.vue.d.ts +0 -64
  70. package/dist/types/__VUE/radiogroup/index.vue.d.ts +0 -49
  71. package/dist/types/__VUE/step/index.vue.d.ts +0 -42
  72. package/dist/types/__VUE/steps/index.vue.d.ts +0 -48
@@ -1,59 +1,45 @@
1
- import { inject, getCurrentInstance, onUnmounted, computed, ref, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, renderSlot, Fragment, createTextVNode, toDisplayString } from "vue";
2
- import { u as useRouter } from "../index-aiGQ-EiA.js";
3
- import { c as createComponent } from "../component-DQf3CENX.js";
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, normalizeStyle, createElementVNode, normalizeClass, renderSlot, Fragment, createTextVNode, toDisplayString } from "vue";
21
+ import { u as useParent } from "../useParent-D6DiuxZZ.js";
4
22
  import { p as pxCheck } from "../pxCheck-DN6FYV6q.js";
5
- import { G as GRID_KEY } from "../common-Chr7cC9o.js";
6
- import { _ as _export_sfc } from "../_plugin-vue_export-helper-1tPrXgE0.js";
7
- function useInject(key) {
8
- const parent = inject(key, null);
9
- if (parent) {
10
- const instance = getCurrentInstance();
11
- const { add, remove, internalChildren } = parent;
12
- add(instance);
13
- onUnmounted(() => remove(instance));
14
- const index2 = computed(() => internalChildren.indexOf(instance));
15
- return {
16
- parent,
17
- index: index2
18
- };
19
- }
20
- return {
21
- parent: null,
22
- index: ref(-1)
23
- };
24
- }
25
- const { create, componentName } = createComponent("grid-item");
26
- const _sfc_main = create({
23
+ import { u as useRouter } from "../index-aiGQ-EiA.js";
24
+ import { G as GRID_KEY } from "../types-CJeZIBld.js";
25
+ import { w as withInstall } from "../with-install-Ch3FF0uS.js";
26
+ const _hoisted_1 = { class: "nut-grid-item__text" };
27
+ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, {
28
+ name: "NutGridItem"
29
+ }), {
30
+ __name: "grid-item",
27
31
  props: {
28
- text: {
29
- type: String
30
- },
31
- // router
32
- to: {
33
- type: [String, Object]
34
- },
35
- url: {
36
- type: String,
37
- default: ""
38
- },
39
- replace: {
40
- type: Boolean,
41
- default: false
42
- }
32
+ text: {},
33
+ to: {},
34
+ url: { default: "" },
35
+ replace: { type: Boolean, default: false }
43
36
  },
44
37
  emits: ["click"],
45
- setup(props, { emit }) {
46
- const Parent = useInject(GRID_KEY);
47
- if (!Parent.parent)
48
- return {};
49
- const index2 = Parent.index;
50
- const parent = Parent.parent.props;
51
- const rootClass = computed(() => {
52
- const prefixCls = componentName;
53
- return {
54
- [prefixCls]: true
55
- };
56
- });
38
+ setup(__props, { emit: __emit }) {
39
+ const props = __props;
40
+ const emit = __emit;
41
+ const { parent: parentObj, index } = useParent(GRID_KEY);
42
+ const parent = (parentObj == null ? void 0 : parentObj.props) || {};
57
43
  const rootStyle = computed(() => {
58
44
  const style = {
59
45
  flexBasis: `${100 / +parent.columnNum}%`
@@ -62,14 +48,14 @@ const _sfc_main = create({
62
48
  style.paddingTop = `${100 / +parent.columnNum}%`;
63
49
  } else if (parent.gutter) {
64
50
  style.paddingRight = pxCheck(parent.gutter);
65
- if (index2.value >= +parent.columnNum) {
51
+ if (index.value >= +parent.columnNum) {
66
52
  style.marginTop = pxCheck(parent.gutter);
67
53
  }
68
54
  }
69
55
  return style;
70
56
  });
71
57
  const contentClass = computed(() => {
72
- const prefixCls = `${componentName}__content`;
58
+ const prefixCls = `nut-grid-item__content`;
73
59
  return {
74
60
  [`${prefixCls}`]: true,
75
61
  [`${prefixCls}--border`]: parent.border,
@@ -90,34 +76,28 @@ const _sfc_main = create({
90
76
  props.replace ? location.replace(props.url) : location.href = props.url;
91
77
  }
92
78
  };
93
- return {
94
- rootClass,
95
- rootStyle,
96
- contentClass,
97
- handleClick
79
+ return (_ctx, _cache) => {
80
+ return openBlock(), createElementBlock("view", {
81
+ class: "nut-grid-item",
82
+ style: normalizeStyle(rootStyle.value),
83
+ onClick: handleClick
84
+ }, [
85
+ createElementVNode("view", {
86
+ class: normalizeClass(contentClass.value)
87
+ }, [
88
+ renderSlot(_ctx.$slots, "default"),
89
+ createElementVNode("view", _hoisted_1, [
90
+ _ctx.text ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
91
+ createTextVNode(toDisplayString(_ctx.text), 1)
92
+ ], 64)) : renderSlot(_ctx.$slots, "text", { key: 1 })
93
+ ])
94
+ ], 2)
95
+ ], 4);
98
96
  };
99
97
  }
100
- });
101
- const _hoisted_1 = { class: "nut-grid-item__text" };
102
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
103
- return openBlock(), createElementBlock("view", {
104
- class: normalizeClass(_ctx.rootClass),
105
- style: normalizeStyle(_ctx.rootStyle),
106
- onClick: _cache[0] || (_cache[0] = (...args) => _ctx.handleClick && _ctx.handleClick(...args))
107
- }, [
108
- createElementVNode("view", {
109
- class: normalizeClass(_ctx.contentClass)
110
- }, [
111
- renderSlot(_ctx.$slots, "default"),
112
- createElementVNode("view", _hoisted_1, [
113
- _ctx.text ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
114
- createTextVNode(toDisplayString(_ctx.text), 1)
115
- ], 64)) : renderSlot(_ctx.$slots, "text", { key: 1 })
116
- ])
117
- ], 2)
118
- ], 6);
119
- }
120
- const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
98
+ }));
99
+ withInstall(_sfc_main);
121
100
  export {
122
- index as default
101
+ _sfc_main as GridItem,
102
+ _sfc_main as default
123
103
  };
@@ -17,7 +17,7 @@ var __spreadValues = (a, b) => {
17
17
  import { toRef, ref, reactive, computed, watch, onMounted, h, resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, renderSlot, createCommentVNode, createBlock, resolveDynamicComponent, normalizeStyle, toDisplayString, createTextVNode, withDirectives, createVNode, mergeProps, vShow } from "vue";
18
18
  import { MaskClose } from "@nutui/icons-vue";
19
19
  import { c as createComponent } from "../component-DQf3CENX.js";
20
- import { u as useFormDisabled } from "../common-DRG0ue26.js";
20
+ import { u as useFormDisabled } from "../common-BH7uB7Cn.js";
21
21
  import { _ as _export_sfc } from "../_plugin-vue_export-helper-1tPrXgE0.js";
22
22
  function trimExtraChar(value, char, regExp) {
23
23
  const index = value.indexOf(char);
@@ -20,7 +20,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  import { defineComponent, toRef, computed, watch, openBlock, createElementBlock, normalizeClass, createElementVNode, renderSlot, createVNode, unref, mergeProps } from "vue";
21
21
  import { p as pxCheck } from "../pxCheck-DN6FYV6q.js";
22
22
  import { Minus, Plus } from "@nutui/icons-vue";
23
- import { u as useFormDisabled } from "../common-DRG0ue26.js";
23
+ import { u as useFormDisabled } from "../common-BH7uB7Cn.js";
24
24
  import { w as withInstall } from "../with-install-Ch3FF0uS.js";
25
25
  const _hoisted_1 = ["min", "max", "disabled", "readonly", "value"];
26
26
  const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, {
@@ -20,8 +20,8 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  import { defineComponent, ref, openBlock, createElementBlock, createVNode, unref, withCtx, Fragment, renderList, createBlock, createTextVNode, toDisplayString, createCommentVNode } from "vue";
21
21
  import { Form as _sfc_main$1 } from "../form/Form.js";
22
22
  import { FormItem as _sfc_main$2 } from "../formitem/FormItem.js";
23
- import { _ as _sfc_main$4 } from "../index.vue_vue_type_script_lang-CTQUvlgN.js";
24
- import { _ as _sfc_main$3 } from "../index.vue_vue_type_script_lang-CaSiRl9x.js";
23
+ import { Radio as _sfc_main$4 } from "../radio/Radio.js";
24
+ import { RadioGroup as _sfc_main$3 } from "../radiogroup/RadioGroup.js";
25
25
  import { Button as _sfc_main$5 } from "../button/Button.js";
26
26
  import NutInput from "../input/Input.js";
27
27
  import { w as withInstall } from "../with-install-Ch3FF0uS.js";
@@ -66,14 +66,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
66
66
  prop: item.formItemProp
67
67
  }, {
68
68
  default: withCtx(() => [
69
- item.type === "radio" ? (openBlock(), createBlock(_sfc_main$3, {
69
+ item.type === "radio" ? (openBlock(), createBlock(unref(_sfc_main$3), {
70
70
  key: 0,
71
71
  modelValue: _ctx.formValue[item.formItemProp],
72
72
  "onUpdate:modelValue": ($event) => _ctx.formValue[item.formItemProp] = $event
73
73
  }, {
74
74
  default: withCtx(() => [
75
75
  (openBlock(true), createElementBlock(Fragment, null, renderList(item.radioLabel, (radioItem, radioIndex) => {
76
- return openBlock(), createBlock(_sfc_main$4, {
76
+ return openBlock(), createBlock(unref(_sfc_main$4), {
77
77
  key: radioIndex,
78
78
  shape: "button",
79
79
  label: radioItem.label
@@ -225,7 +225,7 @@ const _sfc_main$1 = create$1({
225
225
  // 特殊环境判断
226
226
  taro: {
227
227
  type: Boolean,
228
- defualt: false
228
+ default: false
229
229
  }
230
230
  },
231
231
  emits: ["click", "change"],
@@ -1,4 +1,115 @@
1
- import { _ as _sfc_main } from "../index.vue_vue_type_script_lang-CTQUvlgN.js";
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, toRef, inject, computed, openBlock, createElementBlock, normalizeClass, renderSlot, Fragment, createVNode, unref, createElementVNode } from "vue";
21
+ import { CheckChecked, CheckNormal } from "@nutui/icons-vue";
22
+ import { p as pxCheck } from "../pxCheck-DN6FYV6q.js";
23
+ import { R as RADIO_KEY } from "../types-BODurTjN.js";
24
+ import { u as useFormDisabled } from "../common-BH7uB7Cn.js";
25
+ import { w as withInstall } from "../with-install-Ch3FF0uS.js";
26
+ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, {
27
+ name: "NutRadio"
28
+ }), {
29
+ __name: "radio",
30
+ props: {
31
+ disabled: { type: Boolean, default: false },
32
+ shape: { default: "round" },
33
+ label: { type: [String, Number, Boolean], default: "" },
34
+ iconSize: { default: "" },
35
+ size: { default: "normal" }
36
+ },
37
+ setup(__props) {
38
+ const props = __props;
39
+ const disabled = useFormDisabled(toRef(props, "disabled"));
40
+ const parent = inject(RADIO_KEY, null);
41
+ const checked = computed(() => {
42
+ return parent.label.value === props.label;
43
+ });
44
+ const iconClasses = computed(() => {
45
+ return !disabled.value ? checked.value ? "nut-radio__icon" : "nut-radio__icon--unchecked" : "nut-radio__icon--disable";
46
+ });
47
+ const realIconSize = computed(() => {
48
+ return pxCheck(props.iconSize);
49
+ });
50
+ const labelClasses = computed(() => {
51
+ return {
52
+ "nut-radio__label": true,
53
+ "nut-radio__label--disabled": disabled.value
54
+ };
55
+ });
56
+ const buttonClasses = computed(() => {
57
+ return {
58
+ "nut-radio__button": true,
59
+ "nut-radio__button--active": checked.value,
60
+ [`nut-radio__button--${props.size}`]: true,
61
+ "nut-radio__button--disabled": props.disabled
62
+ };
63
+ });
64
+ const handleClick = () => {
65
+ if (checked.value || disabled.value)
66
+ return;
67
+ parent.updateValue(props.label);
68
+ };
69
+ const reverseState = computed(() => parent.position.value === "left");
70
+ const radioClasses = computed(() => {
71
+ return {
72
+ "nut-radio": true,
73
+ [`nut-radio--${props.shape}`]: true,
74
+ "nut-radio--reverse": reverseState.value
75
+ };
76
+ });
77
+ return (_ctx, _cache) => {
78
+ return openBlock(), createElementBlock("div", {
79
+ class: normalizeClass(radioClasses.value),
80
+ onClick: handleClick
81
+ }, [
82
+ _ctx.shape === "button" ? (openBlock(), createElementBlock("div", {
83
+ key: 0,
84
+ class: normalizeClass(buttonClasses.value)
85
+ }, [
86
+ renderSlot(_ctx.$slots, "default")
87
+ ], 2)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
88
+ checked.value ? renderSlot(_ctx.$slots, "checkedIcon", { key: 0 }, () => [
89
+ createVNode(unref(CheckChecked), {
90
+ width: realIconSize.value,
91
+ height: realIconSize.value,
92
+ class: normalizeClass(iconClasses.value)
93
+ }, null, 8, ["width", "height", "class"])
94
+ ]) : renderSlot(_ctx.$slots, "icon", { key: 1 }, () => [
95
+ createVNode(unref(CheckNormal), {
96
+ width: realIconSize.value,
97
+ height: realIconSize.value,
98
+ class: normalizeClass(iconClasses.value)
99
+ }, null, 8, ["width", "height", "class"])
100
+ ]),
101
+ createElementVNode("div", {
102
+ class: normalizeClass(labelClasses.value)
103
+ }, [
104
+ renderSlot(_ctx.$slots, "default")
105
+ ], 2)
106
+ ], 64))
107
+ ], 2);
108
+ };
109
+ }
110
+ }));
111
+ withInstall(_sfc_main);
2
112
  export {
113
+ _sfc_main as Radio,
3
114
  _sfc_main as default
4
115
  };
@@ -1,4 +1,63 @@
1
- import { _ as _sfc_main } from "../index.vue_vue_type_script_lang-CaSiRl9x.js";
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, provide, readonly, computed, watch, openBlock, createElementBlock, normalizeClass, renderSlot } from "vue";
21
+ import { R as RADIO_KEY } from "../types-BODurTjN.js";
22
+ import { w as withInstall } from "../with-install-Ch3FF0uS.js";
23
+ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, {
24
+ name: "NutRadioGroup"
25
+ }), {
26
+ __name: "radio-group",
27
+ props: {
28
+ modelValue: { type: [String, Number, Boolean], default: "" },
29
+ direction: { default: "vertical" },
30
+ textPosition: { default: "right" }
31
+ },
32
+ emits: ["change", "update:modelValue"],
33
+ setup(__props, { emit: __emit }) {
34
+ const props = __props;
35
+ const emit = __emit;
36
+ const updateValue = (value) => {
37
+ emit("update:modelValue", value);
38
+ };
39
+ provide(RADIO_KEY, {
40
+ label: readonly(computed(() => props.modelValue)),
41
+ position: readonly(computed(() => props.textPosition)),
42
+ updateValue
43
+ });
44
+ watch(
45
+ () => props.modelValue,
46
+ (value) => {
47
+ emit("change", value);
48
+ }
49
+ );
50
+ return (_ctx, _cache) => {
51
+ return openBlock(), createElementBlock("div", {
52
+ class: normalizeClass(["nut-radio-group", `nut-radio-group--${_ctx.direction}`])
53
+ }, [
54
+ renderSlot(_ctx.$slots, "default")
55
+ ], 2);
56
+ };
57
+ }
58
+ }));
59
+ withInstall(_sfc_main);
2
60
  export {
61
+ _sfc_main as RadioGroup,
3
62
  _sfc_main as default
4
63
  };
@@ -22,7 +22,7 @@ import { c as createComponent } from "../component-DQf3CENX.js";
22
22
  import { a as isArray } from "../util-DnfK0Qan.js";
23
23
  import { u as useTouch } from "../index-I8tfW3Kf.js";
24
24
  import { u as useRect } from "../index-B1qsj2XR.js";
25
- import { u as useFormDisabled } from "../common-DRG0ue26.js";
25
+ import { u as useFormDisabled } from "../common-BH7uB7Cn.js";
26
26
  import { _ as _export_sfc } from "../_plugin-vue_export-helper-1tPrXgE0.js";
27
27
  const { componentName, create } = createComponent("range");
28
28
  const _sfc_main = create({
@@ -22,7 +22,7 @@ import { StarFillN } from "@nutui/icons-vue";
22
22
  import { r as renderIcon } from "../renderIcon-BfOvhG7i.js";
23
23
  import { p as pxCheck } from "../pxCheck-DN6FYV6q.js";
24
24
  import { u as useTouch } from "../index-I8tfW3Kf.js";
25
- import { u as useFormDisabled } from "../common-DRG0ue26.js";
25
+ import { u as useFormDisabled } from "../common-BH7uB7Cn.js";
26
26
  import { w as withInstall } from "../with-install-Ch3FF0uS.js";
27
27
  const _hoisted_1 = ["id"];
28
28
  const _hoisted_2 = { class: "nut-rate-item__icon--full" };
@@ -22,7 +22,7 @@ import { c as createComponent } from "../component-DQf3CENX.js";
22
22
  import { r as renderIcon } from "../renderIcon-BfOvhG7i.js";
23
23
  import { CircleClose } from "@nutui/icons-vue";
24
24
  import { u as useLocale } from "../index-CFigyH92.js";
25
- import { u as useFormDisabled } from "../common-DRG0ue26.js";
25
+ import { u as useFormDisabled } from "../common-BH7uB7Cn.js";
26
26
  import { _ as _export_sfc } from "../_plugin-vue_export-helper-1tPrXgE0.js";
27
27
  const { create } = createComponent("searchbar");
28
28
  const cN = "NutSearchbar";
@@ -17,105 +17,86 @@ var __spreadValues = (a, b) => {
17
17
  return a;
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
- import { getCurrentInstance, inject, reactive, computed, toRefs, openBlock, createElementBlock, normalizeClass, createElementVNode, renderSlot, Fragment, toDisplayString, createCommentVNode } from "vue";
21
- import { c as createComponent } from "../component-DQf3CENX.js";
20
+ import { defineComponent, computed, openBlock, createElementBlock, normalizeClass, createElementVNode, renderSlot, toDisplayString, unref, createCommentVNode } from "vue";
21
+ import { u as useParent } from "../useParent-D6DiuxZZ.js";
22
22
  import { S as STEPS_KEY } from "../types-1HzUV14W.js";
23
- import { _ as _export_sfc } from "../_plugin-vue_export-helper-1tPrXgE0.js";
24
- const { create, componentName } = createComponent("step");
25
- const _sfc_main = create({
23
+ import { w as withInstall } from "../with-install-Ch3FF0uS.js";
24
+ const _hoisted_1 = { class: "nut-step-head" };
25
+ const _hoisted_2 = /* @__PURE__ */ createElementVNode("view", { class: "nut-step-line" }, null, -1);
26
+ const _hoisted_3 = { class: "nut-step-icon-inner" };
27
+ const _hoisted_4 = {
28
+ key: 0,
29
+ class: "nut-step-inner"
30
+ };
31
+ const _hoisted_5 = { class: "nut-step-main" };
32
+ const _hoisted_6 = { class: "nut-step-title" };
33
+ const _hoisted_7 = {
34
+ key: 0,
35
+ class: "nut-step-content"
36
+ };
37
+ const _hoisted_8 = ["innerHTML"];
38
+ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, {
39
+ name: "NutStep"
40
+ }), {
41
+ __name: "step",
26
42
  props: {
27
- title: {
28
- type: String,
29
- default: ""
30
- },
31
- content: {
32
- type: String,
33
- default: ""
34
- }
43
+ title: { default: "" },
44
+ content: { default: "" }
35
45
  },
36
- emits: ["clickStep"],
37
- setup() {
38
- const { proxy } = getCurrentInstance();
39
- const parent = inject(STEPS_KEY);
40
- parent["relation"](proxy);
41
- const state = reactive({
42
- dot: parent.props.progressDot
43
- });
44
- const index2 = computed(() => parent.state.children.indexOf(proxy) + 1);
45
- const getCurrentStatus = () => {
46
- const activeIndex = index2.value;
46
+ setup(__props) {
47
+ const { index, parent } = useParent(STEPS_KEY);
48
+ const status = computed(() => {
49
+ const activeIndex = index.value + 1;
47
50
  if (activeIndex < +parent.props.current)
48
51
  return "finish";
49
52
  return activeIndex === +parent.props.current ? "process" : "wait";
50
- };
51
- const status = computed(() => {
52
- return getCurrentStatus();
53
53
  });
54
+ const dot = computed(() => parent.props.progressDot);
54
55
  const classes = computed(() => {
55
- const prefixCls = componentName;
56
+ const prefixCls = "nut-step";
56
57
  return {
57
58
  [prefixCls]: true,
58
59
  [`${prefixCls}-${status.value}`]: true
59
60
  };
60
61
  });
61
62
  const handleClickStep = () => {
62
- parent["onEmit"](index2.value);
63
+ parent.onEmit(index.value + 1);
63
64
  };
64
- return __spreadProps(__spreadValues({}, toRefs(state)), {
65
- index: index2,
66
- classes,
67
- handleClickStep
68
- });
69
- }
70
- });
71
- const _hoisted_1 = { class: "nut-step-head" };
72
- const _hoisted_2 = /* @__PURE__ */ createElementVNode("view", { class: "nut-step-line" }, null, -1);
73
- const _hoisted_3 = { class: "nut-step-icon-inner" };
74
- const _hoisted_4 = {
75
- key: 1,
76
- class: "nut-step-inner"
77
- };
78
- const _hoisted_5 = { class: "nut-step-main" };
79
- const _hoisted_6 = { class: "nut-step-title" };
80
- const _hoisted_7 = { key: 0 };
81
- const _hoisted_8 = {
82
- key: 0,
83
- class: "nut-step-content"
84
- };
85
- const _hoisted_9 = ["innerHTML"];
86
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
87
- return openBlock(), createElementBlock("view", {
88
- class: normalizeClass(_ctx.classes),
89
- onClick: _cache[0] || (_cache[0] = (...args) => _ctx.handleClickStep && _ctx.handleClickStep(...args))
90
- }, [
91
- createElementVNode("view", _hoisted_1, [
92
- _hoisted_2,
93
- createElementVNode("view", {
94
- class: normalizeClass(["nut-step-icon", [!_ctx.dot ? "is-icon" : ""]])
65
+ return (_ctx, _cache) => {
66
+ return openBlock(), createElementBlock("view", {
67
+ class: normalizeClass(classes.value),
68
+ onClick: handleClickStep
95
69
  }, [
96
- createElementVNode("view", _hoisted_3, [
97
- renderSlot(_ctx.$slots, "icon", {}, () => [
98
- _ctx.dot ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [], 64)) : (openBlock(), createElementBlock("view", _hoisted_4, toDisplayString(_ctx.index), 1))
99
- ])
70
+ createElementVNode("view", _hoisted_1, [
71
+ _hoisted_2,
72
+ createElementVNode("view", {
73
+ class: normalizeClass(["nut-step-icon", [!dot.value ? "is-icon" : ""]])
74
+ }, [
75
+ createElementVNode("view", _hoisted_3, [
76
+ renderSlot(_ctx.$slots, "icon", {}, () => [
77
+ !dot.value ? (openBlock(), createElementBlock("view", _hoisted_4, toDisplayString(unref(index) + 1), 1)) : createCommentVNode("", true)
78
+ ])
79
+ ])
80
+ ], 2)
81
+ ]),
82
+ createElementVNode("view", _hoisted_5, [
83
+ createElementVNode("view", _hoisted_6, [
84
+ renderSlot(_ctx.$slots, "title", {}, () => [
85
+ createElementVNode("span", null, toDisplayString(_ctx.title), 1)
86
+ ])
87
+ ]),
88
+ _ctx.content || _ctx.$slots.content ? (openBlock(), createElementBlock("view", _hoisted_7, [
89
+ renderSlot(_ctx.$slots, "content", {}, () => [
90
+ createElementVNode("span", { innerHTML: _ctx.content }, null, 8, _hoisted_8)
91
+ ])
92
+ ])) : createCommentVNode("", true)
100
93
  ])
101
- ], 2)
102
- ]),
103
- createElementVNode("view", _hoisted_5, [
104
- createElementVNode("view", _hoisted_6, [
105
- !_ctx.$slots.title ? (openBlock(), createElementBlock("span", _hoisted_7, toDisplayString(_ctx.title), 1)) : createCommentVNode("", true),
106
- renderSlot(_ctx.$slots, "title")
107
- ]),
108
- _ctx.content || _ctx.$slots.content ? (openBlock(), createElementBlock("view", _hoisted_8, [
109
- !_ctx.$slots.content ? (openBlock(), createElementBlock("span", {
110
- key: 0,
111
- innerHTML: _ctx.content
112
- }, null, 8, _hoisted_9)) : createCommentVNode("", true),
113
- renderSlot(_ctx.$slots, "content")
114
- ])) : createCommentVNode("", true)
115
- ])
116
- ], 2);
117
- }
118
- const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
94
+ ], 2);
95
+ };
96
+ }
97
+ }));
98
+ withInstall(_sfc_main);
119
99
  export {
120
- index as default
100
+ _sfc_main as Step,
101
+ _sfc_main as default
121
102
  };