@nutui/nutui 4.3.5 → 4.3.7

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 (85) hide show
  1. package/CHANGELOG.md +40 -1
  2. package/dist/nutui.es.js +1 -1
  3. package/dist/nutui.js +5822 -6138
  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/image/Image.js +79 -111
  15. package/dist/packages/input/Input.js +112 -182
  16. package/dist/packages/inputnumber/InputNumber.js +1 -1
  17. package/dist/packages/invoice/Invoice.js +8 -8
  18. package/dist/packages/menuitem/MenuItem.js +1 -1
  19. package/dist/packages/numberkeyboard/NumberKeyboard.js +6 -2
  20. package/dist/packages/picker/Picker.js +1 -1
  21. package/dist/packages/radio/Radio.js +112 -1
  22. package/dist/packages/radiogroup/RadioGroup.js +60 -1
  23. package/dist/packages/range/Range.js +1 -1
  24. package/dist/packages/rate/Rate.js +1 -1
  25. package/dist/packages/searchbar/Searchbar.js +1 -1
  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 +3 -2
  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/countdown/countdown.vue.d.ts +108 -0
  41. package/dist/types/__VUE/countdown/index.d.ts +5 -0
  42. package/dist/types/__VUE/countdown/util.d.ts +14 -0
  43. package/dist/types/__VUE/form/common.d.ts +1 -0
  44. package/dist/types/__VUE/grid/grid.vue.d.ts +87 -0
  45. package/dist/types/__VUE/grid/index.d.ts +6 -0
  46. package/dist/types/__VUE/grid/types.d.ts +2 -0
  47. package/dist/types/__VUE/griditem/grid-item.vue.d.ts +64 -0
  48. package/dist/types/__VUE/griditem/index.d.ts +5 -0
  49. package/dist/types/__VUE/image/image.vue.d.ts +111 -0
  50. package/dist/types/__VUE/image/index.d.ts +6 -0
  51. package/dist/types/__VUE/input/index.d.ts +6 -0
  52. package/dist/types/__VUE/input/input.vue.d.ts +171 -0
  53. package/dist/types/__VUE/input/{type.d.ts → types.d.ts} +2 -2
  54. package/dist/types/__VUE/input/util.d.ts +1 -1
  55. package/dist/types/__VUE/numberkeyboard/index.vue.d.ts +3 -1
  56. package/dist/types/__VUE/picker/Column.vue.d.ts +2 -2
  57. package/dist/types/__VUE/radio/index.d.ts +6 -0
  58. package/dist/types/__VUE/radio/radio.vue.d.ts +74 -0
  59. package/dist/types/__VUE/radiogroup/index.d.ts +5 -0
  60. package/dist/types/__VUE/radiogroup/radio-group.vue.d.ts +66 -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/tabs/index.vue.d.ts +1 -1
  66. package/dist/types/__VUE/tabs/types.d.ts +1 -0
  67. package/dist/types/index.d.ts +19 -10
  68. package/dist/types/utils/index.d.ts +2 -0
  69. package/dist/types/utils/useRelation/useParent.d.ts +1 -1
  70. package/package.json +1 -1
  71. package/dist/packages/common-Chr7cC9o.js +0 -145
  72. package/dist/packages/index.vue_vue_type_script_lang-CTQUvlgN.js +0 -99
  73. package/dist/packages/index.vue_vue_type_script_lang-CaSiRl9x.js +0 -46
  74. package/dist/types/__VUE/audiooperate/types.d.ts +0 -1
  75. package/dist/types/__VUE/countdown/index.vue.d.ts +0 -125
  76. package/dist/types/__VUE/grid/common.d.ts +0 -73
  77. package/dist/types/__VUE/grid/index.vue.d.ts +0 -84
  78. package/dist/types/__VUE/griditem/index.vue.d.ts +0 -47
  79. package/dist/types/__VUE/image/index.vue.d.ts +0 -126
  80. package/dist/types/__VUE/input/index.vue.d.ts +0 -221
  81. package/dist/types/__VUE/radio/index.vue.d.ts +0 -64
  82. package/dist/types/__VUE/radiogroup/index.vue.d.ts +0 -49
  83. package/dist/types/__VUE/step/index.vue.d.ts +0 -42
  84. package/dist/types/__VUE/steps/index.vue.d.ts +0 -48
  85. /package/dist/types/__VUE/image/{type.d.ts → types.d.ts} +0 -0
@@ -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
  };
@@ -1,59 +1,63 @@
1
- import { reactive, computed, provide, h } from "vue";
2
- 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, normalizeClass, renderSlot } from "vue";
21
+ import { u as useChildren } from "../useChildren-BZ4-J79J.js";
3
22
  import { S as STEPS_KEY } from "../types-1HzUV14W.js";
4
- const { create, componentName } = createComponent("steps");
5
- const _sfc_main = create({
23
+ import { w as withInstall } from "../with-install-Ch3FF0uS.js";
24
+ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, {
25
+ name: "NutSteps"
26
+ }), {
27
+ __name: "steps",
6
28
  props: {
7
- direction: {
8
- type: String,
9
- default: "horizontal"
10
- },
11
- current: {
12
- type: [String, Number],
13
- default: "0"
14
- },
15
- progressDot: {
16
- type: Boolean,
17
- default: false
18
- }
29
+ direction: { default: "horizontal" },
30
+ current: { default: "0" },
31
+ progressDot: { type: Boolean, default: false }
19
32
  },
20
33
  emits: ["clickStep"],
21
- setup(props, { emit, slots }) {
22
- const state = reactive({
23
- children: []
24
- });
34
+ setup(__props, { emit: __emit }) {
35
+ const props = __props;
36
+ const emit = __emit;
25
37
  const classes = computed(() => {
26
- const prefixCls = componentName;
38
+ const prefixCls = "nut-steps";
27
39
  return {
28
40
  [prefixCls]: true,
29
41
  [`${prefixCls}-${props.direction}`]: true,
30
42
  [`${prefixCls}-dot`]: !!props.progressDot
31
43
  };
32
44
  });
33
- const relation = (child) => {
34
- child && state.children.push(child);
35
- };
45
+ const { linkChildren } = useChildren(STEPS_KEY);
36
46
  const onEmit = (index) => {
37
47
  emit("clickStep", index);
38
48
  };
39
- provide(STEPS_KEY, {
40
- relation,
41
- state,
42
- props,
43
- onEmit
44
- });
45
- return () => {
46
- var _a;
47
- return h(
48
- "view",
49
- {
50
- class: classes.value
51
- },
52
- (_a = slots.default) == null ? void 0 : _a.call(slots)
53
- );
49
+ linkChildren({ props, onEmit });
50
+ return (_ctx, _cache) => {
51
+ return openBlock(), createElementBlock("view", {
52
+ class: normalizeClass(classes.value)
53
+ }, [
54
+ renderSlot(_ctx.$slots, "default")
55
+ ], 2);
54
56
  };
55
57
  }
56
- });
58
+ }));
59
+ withInstall(_sfc_main);
57
60
  export {
61
+ _sfc_main as Steps,
58
62
  _sfc_main as default
59
63
  };
@@ -19,7 +19,7 @@ var __spreadValues = (a, b) => {
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  import { defineComponent, computed, watch, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, renderSlot, createVNode, unref, createCommentVNode, Fragment, withDirectives, toDisplayString, vShow } from "vue";
21
21
  import { Loading1 } from "@nutui/icons-vue";
22
- import { u as useFormDisabled } from "../common-DRG0ue26.js";
22
+ import { u as useFormDisabled } from "../common-BH7uB7Cn.js";
23
23
  import { w as withInstall } from "../with-install-Ch3FF0uS.js";
24
24
  const _hoisted_1 = { class: "nut-switch-button" };
25
25
  const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, {
@@ -19,6 +19,7 @@ var __spreadValues = (a, b) => {
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  import { inject, computed, openBlock, createElementBlock, normalizeClass, normalizeStyle, renderSlot } from "vue";
21
21
  import { c as createComponent } from "../component-DQf3CENX.js";
22
+ import { T as TABS_KEY } from "../types-BXlnzugj.js";
22
23
  import { _ as _export_sfc } from "../_plugin-vue_export-helper-1tPrXgE0.js";
23
24
  const { create } = createComponent("tab-pane");
24
25
  const _sfc_main = create({
@@ -38,10 +39,10 @@ const _sfc_main = create({
38
39
  },
39
40
  emits: ["click"],
40
41
  setup(props) {
41
- const parentOption = inject("tabsOpiton");
42
+ const parentOption = inject(TABS_KEY);
42
43
  const paneStyle = computed(() => {
43
44
  return {
44
- display: parentOption.animatedTime.value == 0 && props.paneKey != parentOption.activeKey.value ? "none" : void 0
45
+ display: (parentOption == null ? void 0 : parentOption.animatedTime.value) == 0 && props.paneKey != (parentOption == null ? void 0 : parentOption.activeKey.value) ? "none" : void 0
45
46
  };
46
47
  });
47
48
  return __spreadProps(__spreadValues({}, parentOption), {
@@ -47,6 +47,7 @@ import { p as pxCheck } from "../pxCheck-DN6FYV6q.js";
47
47
  import { u as useRect } from "../index-B1qsj2XR.js";
48
48
  import { r as requestAniFrame } from "../raf-c01wDYCo.js";
49
49
  import { u as useTouch } from "../index-I8tfW3Kf.js";
50
+ import { T as TABS_KEY } from "../types-BXlnzugj.js";
50
51
  import { _ as _export_sfc } from "../_plugin-vue_export-helper-1tPrXgE0.js";
51
52
  const useTabContentTouch = (props, tabMethods, taro, useTaroRect) => {
52
53
  const tabsContentRef = ref();
@@ -231,7 +232,7 @@ const _sfc_main = create({
231
232
  setup(props, { emit, slots }) {
232
233
  const container = ref(null);
233
234
  let stickyFixed;
234
- provide("tabsOpiton", {
235
+ provide(TABS_KEY, {
235
236
  activeKey: computed(() => props.modelValue || "0"),
236
237
  autoHeight: computed(() => props.autoHeight),
237
238
  animatedTime: computed(() => props.animatedTime)
@@ -19,7 +19,7 @@ var __spreadValues = (a, b) => {
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  import { defineComponent, toRef, ref, computed, onMounted, nextTick, watch, openBlock, createElementBlock, normalizeClass, createElementVNode, normalizeStyle, unref, toDisplayString, createCommentVNode } from "vue";
21
21
  import { u as useLocale } from "../index-CFigyH92.js";
22
- import { u as useFormDisabled } from "../common-DRG0ue26.js";
22
+ import { u as useFormDisabled } from "../common-BH7uB7Cn.js";
23
23
  import { w as withInstall } from "../with-install-Ch3FF0uS.js";
24
24
  const _hoisted_1 = ["rows", "disabled", "readonly", "value", "maxlength", "placeholder", "autofocus"];
25
25
  const _hoisted_2 = {
@@ -0,0 +1,4 @@
1
+ const AUDIO_KEY = Symbol("nut-audio");
2
+ export {
3
+ AUDIO_KEY as A
4
+ };
@@ -0,0 +1,4 @@
1
+ const TABS_KEY = Symbol("nut-tab");
2
+ export {
3
+ TABS_KEY as T
4
+ };
@@ -0,0 +1,4 @@
1
+ const GRID_KEY = Symbol("grid");
2
+ export {
3
+ GRID_KEY as G
4
+ };
@@ -10,7 +10,7 @@ import { f as funInterceptor } from "../Interceptor-DlY2h6Y7.js";
10
10
  import { Progress as _sfc_main$1 } from "../progress/Progress.js";
11
11
  import { Photograph, Failure, Loading, Del, Link } from "@nutui/icons-vue";
12
12
  import { u as useLocale } from "../index-CFigyH92.js";
13
- import { u as useFormDisabled } from "../common-DRG0ue26.js";
13
+ import { u as useFormDisabled } from "../common-BH7uB7Cn.js";
14
14
  import { _ as _export_sfc } from "../_plugin-vue_export-helper-1tPrXgE0.js";
15
15
  class UploadOptions {
16
16
  constructor() {