@nutui/nutui 3.1.6 → 3.1.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 (92) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/dist/nutui.d.ts +7 -1
  3. package/dist/nutui.es.js +1097 -517
  4. package/dist/nutui.umd.js +1158 -571
  5. package/dist/packages/_es/ActionSheet.js +158 -0
  6. package/dist/packages/_es/Address.js +525 -0
  7. package/dist/packages/_es/Avatar.js +87 -0
  8. package/dist/packages/_es/BackTop.js +159 -0
  9. package/dist/packages/_es/Badge.js +90 -0
  10. package/dist/packages/_es/Barrage.js +118 -0
  11. package/dist/packages/_es/Button.js +124 -0
  12. package/dist/packages/_es/Calendar.js +700 -0
  13. package/dist/packages/_es/Cell.js +95 -0
  14. package/dist/packages/_es/CellGroup.js +42 -0
  15. package/dist/packages/_es/Checkbox.js +109 -0
  16. package/dist/packages/_es/CheckboxGroup.js +62 -0
  17. package/dist/packages/_es/CircleProgress.js +109 -0
  18. package/dist/packages/_es/Col.js +53 -0
  19. package/dist/packages/_es/Collapse.js +89 -0
  20. package/dist/packages/_es/CollapseItem.js +257 -0
  21. package/dist/packages/_es/CountDown.js +224 -0
  22. package/dist/packages/_es/CountUp.js +547 -0
  23. package/dist/packages/_es/DatePicker.js +282 -0
  24. package/dist/packages/_es/Dialog.js +313 -0
  25. package/dist/packages/_es/Divider.js +49 -0
  26. package/dist/packages/_es/Drag.js +198 -0
  27. package/dist/packages/_es/Elevator.js +207 -0
  28. package/dist/packages/_es/FixedNav.js +127 -0
  29. package/dist/packages/_es/Icon.js +44 -0
  30. package/dist/packages/_es/ImagePreview.js +109 -0
  31. package/dist/packages/_es/InfiniteLoading.js +265 -0
  32. package/dist/packages/_es/Input.js +183 -0
  33. package/dist/packages/_es/InputNumber.js +172 -0
  34. package/dist/packages/_es/Layout.js +10 -0
  35. package/dist/packages/_es/MenuItem.js +180 -0
  36. package/dist/packages/_es/Navbar.js +160 -0
  37. package/dist/packages/_es/NoticeBar.js +389 -0
  38. package/dist/packages/_es/Notify.js +233 -0
  39. package/dist/packages/_es/NumberKeyboard.js +248 -0
  40. package/dist/packages/_es/OverLay.js +118 -0
  41. package/dist/packages/_es/Pagination.js +163 -0
  42. package/dist/packages/_es/Picker.js +485 -0
  43. package/dist/packages/_es/Popover.js +157 -0
  44. package/dist/packages/_es/Popup.js +268 -0
  45. package/dist/packages/_es/Price.js +104 -0
  46. package/dist/packages/_es/Progress.js +131 -0
  47. package/dist/packages/_es/Radio.js +72 -0
  48. package/dist/packages/_es/RadioGroup.js +37 -0
  49. package/dist/packages/_es/Range.js +350 -0
  50. package/dist/packages/_es/Rate.js +129 -0
  51. package/dist/packages/_es/Row.js +61 -0
  52. package/dist/packages/_es/ShortPassword.js +221 -0
  53. package/dist/packages/_es/Signature.js +167 -0
  54. package/dist/packages/_es/Step.js +116 -0
  55. package/dist/packages/_es/Steps.js +52 -0
  56. package/dist/packages/_es/Swipe.js +193 -0
  57. package/dist/packages/_es/Swiper.js +429 -0
  58. package/dist/packages/_es/SwiperItem.js +60 -0
  59. package/dist/packages/_es/Switch.js +90 -0
  60. package/dist/packages/_es/Tab.js +179 -0
  61. package/dist/packages/_es/TabPane.js +42 -0
  62. package/dist/packages/_es/TabPanel.js +30 -0
  63. package/dist/packages/_es/Tabbar.js +73 -0
  64. package/dist/packages/_es/TabbarItem.js +142 -0
  65. package/dist/packages/_es/Tag.js +98 -0
  66. package/dist/packages/_es/TextArea.js +127 -0
  67. package/dist/packages/_es/Toast.js +317 -0
  68. package/dist/packages/_es/Uploader.js +400 -0
  69. package/dist/packages/_es/Video.js +405 -0
  70. package/dist/packages/_es/component.js +26 -0
  71. package/dist/packages/_es/index.js +64 -0
  72. package/dist/packages/_es/index2.js +13 -0
  73. package/dist/packages/_es/plugin-vue_export-helper.js +12 -0
  74. package/dist/packages/_es/pxCheck.js +9 -0
  75. package/dist/packages/_es/raf.js +19 -0
  76. package/dist/packages/avatar/index.scss +0 -1
  77. package/dist/packages/badge/index.scss +35 -0
  78. package/dist/packages/calendar/index.scss +13 -0
  79. package/dist/packages/imagepreview/index.scss +48 -0
  80. package/dist/packages/input/index.scss +14 -7
  81. package/dist/packages/pagination/index.scss +51 -0
  82. package/dist/packages/popover/index.scss +159 -0
  83. package/dist/packages/shortpassword/index.scss +19 -7
  84. package/dist/packages/tabpane/index.scss +1 -0
  85. package/dist/packages/tabs/index.scss +1 -0
  86. package/dist/packages/tag/index.scss +47 -0
  87. package/dist/packages/uploader/index.scss +0 -1
  88. package/dist/style.css +1 -1
  89. package/dist/style.es.js +2 -1
  90. package/dist/styles/themes/default.scss +35 -28
  91. package/dist/styles/variables.scss +55 -32
  92. package/package.json +7 -7
@@ -0,0 +1,221 @@
1
+ /*!
2
+ * @nutui/nutui v3.1.7 Thu Sep 30 2021 20:17:02 GMT+0800 (中国标准时间)
3
+ * (c) 2021 @jdf2e.
4
+ * Released under the MIT License.
5
+ */
6
+ import { ref, computed, watch, resolveComponent, openBlock, createElementBlock, createVNode, withCtx, createElementVNode, toDisplayString, withDirectives, normalizeStyle, vModelText, Fragment, renderList, createCommentVNode } from "vue";
7
+ import { c as createComponent } from "./component.js";
8
+ import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
9
+ const { create } = createComponent("shortpassword");
10
+ const _sfc_main = create({
11
+ props: {
12
+ title: {
13
+ type: String,
14
+ default: "\u8BF7\u8F93\u5165\u5BC6\u7801"
15
+ },
16
+ desc: {
17
+ type: String,
18
+ default: "\u60A8\u4F7F\u7528\u4E86\u865A\u62DF\u8D44\u4EA7\uFF0C\u8BF7\u8FDB\u884C\u9A8C\u8BC1"
19
+ },
20
+ tips: {
21
+ type: String,
22
+ default: "\u5FD8\u8BB0\u5BC6\u7801"
23
+ },
24
+ visible: {
25
+ type: Boolean,
26
+ default: false
27
+ },
28
+ modelValue: {
29
+ type: String,
30
+ default: ""
31
+ },
32
+ errorMsg: {
33
+ type: String,
34
+ default: ""
35
+ },
36
+ noButton: {
37
+ type: Boolean,
38
+ default: true
39
+ },
40
+ closeOnClickOverlay: {
41
+ type: Boolean,
42
+ default: true
43
+ },
44
+ length: {
45
+ type: [String, Number],
46
+ default: 6
47
+ }
48
+ },
49
+ emits: ["update:modelValue", "update:visible", "complete", "change", "ok", "tips", "close", "cancel"],
50
+ setup(props, { emit }) {
51
+ const realInput = ref(props.modelValue);
52
+ const realpwd = ref();
53
+ const comLen = computed(() => range(Number(props.length)));
54
+ const show = ref(props.visible);
55
+ function sureClick() {
56
+ emit("ok", realInput.value);
57
+ }
58
+ function focus() {
59
+ realpwd.value.focus();
60
+ }
61
+ watch(() => props.visible, (value) => {
62
+ show.value = value;
63
+ });
64
+ watch(() => props.modelValue, (value) => {
65
+ realInput.value = value;
66
+ console.log("watch", value);
67
+ });
68
+ function changeValue(e) {
69
+ const input = e.target;
70
+ let val = input.value;
71
+ if (val.length > comLen.value) {
72
+ val = val.slice(0, comLen.value);
73
+ realInput.value = val;
74
+ }
75
+ if (String(realInput.value).length === comLen.value) {
76
+ emit("complete", val);
77
+ }
78
+ emit("change", val);
79
+ emit("update:modelValue", val);
80
+ }
81
+ function close() {
82
+ emit("update:visible", false);
83
+ emit("cancel");
84
+ }
85
+ function closeIcon() {
86
+ emit("update:visible", false);
87
+ emit("close");
88
+ }
89
+ function range(val) {
90
+ return Math.min(Math.max(4, val), 6);
91
+ }
92
+ function onTips() {
93
+ emit("tips");
94
+ }
95
+ function systemStyle() {
96
+ let u = navigator.userAgent;
97
+ let isAndroid = u.indexOf("Android") > -1 || u.indexOf("Linux") > -1;
98
+ let isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
99
+ if (isIOS) {
100
+ return {
101
+ paddingRight: "1200px"
102
+ };
103
+ }
104
+ if (isAndroid) {
105
+ return {
106
+ opacity: 0,
107
+ zindex: 10
108
+ };
109
+ }
110
+ }
111
+ return {
112
+ comLen,
113
+ sureClick,
114
+ realInput,
115
+ realpwd,
116
+ focus,
117
+ range,
118
+ changeValue,
119
+ close,
120
+ onTips,
121
+ show,
122
+ systemStyle,
123
+ closeIcon
124
+ };
125
+ }
126
+ });
127
+ const _hoisted_1 = { class: "nut-shortpsd-title" };
128
+ const _hoisted_2 = { class: "nut-shortpsd-subtitle" };
129
+ const _hoisted_3 = { class: "nut-input-normalw" };
130
+ const _hoisted_4 = /* @__PURE__ */ createElementVNode("div", { class: "nut-input-site" }, null, -1);
131
+ const _hoisted_5 = {
132
+ key: 0,
133
+ class: "nut-shortpsd-icon"
134
+ };
135
+ const _hoisted_6 = { class: "nut-shortpsd-message" };
136
+ const _hoisted_7 = { class: "nut-shortpsd-error" };
137
+ const _hoisted_8 = {
138
+ key: 0,
139
+ class: "nut-shortpsd-forget"
140
+ };
141
+ const _hoisted_9 = {
142
+ key: 0,
143
+ class: "nut-shortpsd-footer"
144
+ };
145
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
146
+ const _component_nut_icon = resolveComponent("nut-icon");
147
+ const _component_nut_popup = resolveComponent("nut-popup");
148
+ return openBlock(), createElementBlock("view", null, [
149
+ createVNode(_component_nut_popup, {
150
+ style: {
151
+ padding: "32px 24px 28px 24px",
152
+ borderRadius: "12px",
153
+ textAlign: "center"
154
+ },
155
+ visible: _ctx.show,
156
+ "onUpdate:visible": _cache[6] || (_cache[6] = ($event) => _ctx.show = $event),
157
+ closeable: true,
158
+ onClickCloseIcon: _ctx.closeIcon,
159
+ "close-on-click-overlay": _ctx.closeOnClickOverlay,
160
+ onClickOverlay: _ctx.close
161
+ }, {
162
+ default: withCtx(() => [
163
+ createElementVNode("view", _hoisted_1, toDisplayString(_ctx.title), 1),
164
+ createElementVNode("view", _hoisted_2, toDisplayString(_ctx.desc), 1),
165
+ createElementVNode("div", _hoisted_3, [
166
+ withDirectives(createElementVNode("input", {
167
+ ref: "realpwd",
168
+ class: "nut-input-real",
169
+ type: "number",
170
+ maxlength: "6",
171
+ style: normalizeStyle(_ctx.systemStyle()),
172
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.realInput = $event),
173
+ onInput: _cache[1] || (_cache[1] = (...args) => _ctx.changeValue && _ctx.changeValue(...args))
174
+ }, null, 36), [
175
+ [vModelText, _ctx.realInput]
176
+ ]),
177
+ _hoisted_4,
178
+ createElementVNode("view", {
179
+ class: "nut-shortpsd-fake",
180
+ onClick: _cache[2] || (_cache[2] = (...args) => _ctx.focus && _ctx.focus(...args))
181
+ }, [
182
+ (openBlock(true), createElementBlock(Fragment, null, renderList(new Array(_ctx.comLen), (sublen, index2) => {
183
+ return openBlock(), createElementBlock("view", {
184
+ class: "nut-shortpsd-li",
185
+ key: index2
186
+ }, [
187
+ String(_ctx.realInput).length > index2 ? (openBlock(), createElementBlock("view", _hoisted_5)) : createCommentVNode("", true)
188
+ ]);
189
+ }), 128))
190
+ ])
191
+ ]),
192
+ createElementVNode("view", _hoisted_6, [
193
+ createElementVNode("view", _hoisted_7, toDisplayString(_ctx.errorMsg), 1),
194
+ _ctx.tips ? (openBlock(), createElementBlock("view", _hoisted_8, [
195
+ createVNode(_component_nut_icon, {
196
+ class: "icon",
197
+ size: "11px",
198
+ name: "tips"
199
+ }),
200
+ createElementVNode("view", {
201
+ onClick: _cache[3] || (_cache[3] = (...args) => _ctx.onTips && _ctx.onTips(...args))
202
+ }, toDisplayString(_ctx.tips), 1)
203
+ ])) : createCommentVNode("", true)
204
+ ]),
205
+ !_ctx.noButton ? (openBlock(), createElementBlock("view", _hoisted_9, [
206
+ createElementVNode("view", {
207
+ class: "nut-shortpsd-cancle",
208
+ onClick: _cache[4] || (_cache[4] = (...args) => _ctx.close && _ctx.close(...args))
209
+ }, "\u53D6\u6D88"),
210
+ createElementVNode("view", {
211
+ class: "nut-shortpsd-sure",
212
+ onClick: _cache[5] || (_cache[5] = (...args) => _ctx.sureClick && _ctx.sureClick(...args))
213
+ }, "\u786E\u8BA4")
214
+ ])) : createCommentVNode("", true)
215
+ ]),
216
+ _: 1
217
+ }, 8, ["visible", "onClickCloseIcon", "close-on-click-overlay", "onClickOverlay"])
218
+ ]);
219
+ }
220
+ var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
221
+ export { index as default };
@@ -0,0 +1,167 @@
1
+ /*!
2
+ * @nutui/nutui v3.1.7 Thu Sep 30 2021 20:17:02 GMT+0800 (中国标准时间)
3
+ * (c) 2021 @jdf2e.
4
+ * Released under the MIT License.
5
+ */
6
+ import { ref, computed, reactive, onMounted, resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, toDisplayString, createVNode, withCtx, createTextVNode } from "vue";
7
+ import { c as createComponent } from "./component.js";
8
+ import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
9
+ const { componentName, create } = createComponent("signature");
10
+ const _sfc_main = create({
11
+ props: {
12
+ customClass: {
13
+ type: String,
14
+ default: ""
15
+ },
16
+ lineWidth: {
17
+ type: Number,
18
+ default: 2
19
+ },
20
+ strokeStyle: {
21
+ type: String,
22
+ default: "#000"
23
+ },
24
+ type: {
25
+ type: String,
26
+ default: "png"
27
+ },
28
+ unSupportTpl: {
29
+ type: String,
30
+ default: "\u5BF9\u4E0D\u8D77\uFF0C\u5F53\u524D\u6D4F\u89C8\u5668\u4E0D\u652F\u6301Canvas\uFF0C\u65E0\u6CD5\u4F7F\u7528\u672C\u63A7\u4EF6\uFF01"
31
+ }
32
+ },
33
+ components: {},
34
+ emits: ["confirm", "clear"],
35
+ setup(props, { emit }) {
36
+ const canvas = ref(null);
37
+ const wrap = ref(null);
38
+ const classes = computed(() => {
39
+ const prefixCls = componentName;
40
+ return {
41
+ [prefixCls]: true,
42
+ [`${props.customClass}`]: props.customClass
43
+ };
44
+ });
45
+ const state = reactive({
46
+ canvasHeight: 0,
47
+ canvasWidth: 0,
48
+ ctx: null,
49
+ isSupportTouch: "ontouchstart" in window,
50
+ events: "ontouchstart" in window ? ["touchstart", "touchmove", "touchend", "touchleave"] : ["mousedown", "mousemove", "mouseup", "mouseleave"]
51
+ });
52
+ const isCanvasSupported = () => {
53
+ let elem = document.createElement("canvas");
54
+ return !!(elem.getContext && elem.getContext("2d"));
55
+ };
56
+ const addEvent = () => {
57
+ canvas.value.addEventListener(state.events[0], startEventHandler, false);
58
+ };
59
+ const startEventHandler = (event) => {
60
+ event.preventDefault();
61
+ state.ctx.beginPath();
62
+ state.ctx.lineWidth = props.lineWidth;
63
+ state.ctx.strokeStyle = props.strokeStyle;
64
+ canvas.value.addEventListener(state.events[1], moveEventHandler, false);
65
+ canvas.value.addEventListener(state.events[2], endEventHandler, false);
66
+ canvas.value.addEventListener(state.events[3], leaveEventHandler, false);
67
+ };
68
+ const moveEventHandler = (event) => {
69
+ event.preventDefault();
70
+ let evt = state.isSupportTouch ? event.touches[0] : event;
71
+ let coverPos = canvas.value.getBoundingClientRect();
72
+ let mouseX = evt.clientX - coverPos.left;
73
+ let mouseY = evt.clientY - coverPos.top;
74
+ state.ctx.lineTo(mouseX, mouseY);
75
+ state.ctx.stroke();
76
+ };
77
+ const endEventHandler = (event) => {
78
+ event.preventDefault();
79
+ canvas.value.removeEventListener(state.events[1], moveEventHandler, false);
80
+ canvas.value.removeEventListener(state.events[2], endEventHandler, false);
81
+ };
82
+ const leaveEventHandler = (event) => {
83
+ event.preventDefault();
84
+ canvas.value.removeEventListener(state.events[1], moveEventHandler, false);
85
+ canvas.value.removeEventListener(state.events[2], endEventHandler, false);
86
+ };
87
+ const clear = () => {
88
+ canvas.value.addEventListener(state.events[2], endEventHandler, false);
89
+ state.ctx.clearRect(0, 0, state.canvasWidth, state.canvasHeight);
90
+ state.ctx.closePath();
91
+ emit("clear");
92
+ };
93
+ const confirm = () => {
94
+ onSave(canvas.value);
95
+ };
96
+ const onSave = (canvas2) => {
97
+ let dataurl;
98
+ switch (props.type) {
99
+ case "png":
100
+ dataurl = canvas2.toDataURL("image/png");
101
+ break;
102
+ case "jpg":
103
+ dataurl = canvas2.toDataURL("image/jpeg", 0.8);
104
+ break;
105
+ }
106
+ clear();
107
+ emit("confirm", canvas2, dataurl);
108
+ };
109
+ onMounted(() => {
110
+ if (isCanvasSupported()) {
111
+ state.ctx = canvas.value.getContext("2d");
112
+ state.canvasWidth = wrap.value.offsetWidth;
113
+ state.canvasHeight = wrap.value.offsetHeight;
114
+ addEvent();
115
+ }
116
+ });
117
+ return { canvas, wrap, isCanvasSupported, confirm, clear, classes };
118
+ }
119
+ });
120
+ const _hoisted_1 = {
121
+ class: "nut-signature-inner",
122
+ ref: "wrap"
123
+ };
124
+ const _hoisted_2 = ["height", "width"];
125
+ const _hoisted_3 = {
126
+ key: 1,
127
+ class: "nut-signature-unsopport"
128
+ };
129
+ const _hoisted_4 = /* @__PURE__ */ createTextVNode("\u91CD\u7B7E");
130
+ const _hoisted_5 = /* @__PURE__ */ createTextVNode("\u786E\u8BA4");
131
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
132
+ const _component_nut_button = resolveComponent("nut-button");
133
+ return openBlock(), createElementBlock("div", {
134
+ class: normalizeClass(_ctx.classes)
135
+ }, [
136
+ createElementVNode("div", _hoisted_1, [
137
+ _ctx.isCanvasSupported ? (openBlock(), createElementBlock("canvas", {
138
+ key: 0,
139
+ ref: "canvas",
140
+ height: _ctx.canvasHeight,
141
+ width: _ctx.canvasWidth
142
+ }, null, 8, _hoisted_2)) : (openBlock(), createElementBlock("p", _hoisted_3, toDisplayString(_ctx.unSupportTpl), 1))
143
+ ], 512),
144
+ createVNode(_component_nut_button, {
145
+ class: "nut-signature-btn",
146
+ type: "default",
147
+ onClick: _cache[0] || (_cache[0] = ($event) => _ctx.clear())
148
+ }, {
149
+ default: withCtx(() => [
150
+ _hoisted_4
151
+ ]),
152
+ _: 1
153
+ }),
154
+ createVNode(_component_nut_button, {
155
+ class: "nut-signature-btn",
156
+ type: "primary",
157
+ onClick: _cache[1] || (_cache[1] = ($event) => _ctx.confirm())
158
+ }, {
159
+ default: withCtx(() => [
160
+ _hoisted_5
161
+ ]),
162
+ _: 1
163
+ })
164
+ ], 2);
165
+ }
166
+ var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
167
+ export { index as default };
@@ -0,0 +1,116 @@
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
+ /*!
21
+ * @nutui/nutui v3.1.7 Thu Sep 30 2021 20:17:02 GMT+0800 (中国标准时间)
22
+ * (c) 2021 @jdf2e.
23
+ * Released under the MIT License.
24
+ */
25
+ import { getCurrentInstance, inject, reactive, computed, toRefs, resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, createBlock, Fragment, toDisplayString, createCommentVNode } from "vue";
26
+ import { c as createComponent } from "./component.js";
27
+ import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
28
+ const { create, componentName } = createComponent("step");
29
+ const _sfc_main = create({
30
+ props: {
31
+ title: {
32
+ type: String,
33
+ default: ""
34
+ },
35
+ content: {
36
+ type: String,
37
+ default: ""
38
+ },
39
+ icon: {
40
+ type: String,
41
+ default: null
42
+ },
43
+ size: {
44
+ type: [String, Number],
45
+ default: "12px"
46
+ }
47
+ },
48
+ setup(props, { emit, slots }) {
49
+ const { proxy } = getCurrentInstance();
50
+ const parent = inject("parent");
51
+ parent["relation"](proxy);
52
+ const state = reactive({
53
+ dot: parent.props.progressDot
54
+ });
55
+ const index2 = computed(() => parent.state.children.indexOf(proxy) + 1);
56
+ const getCurrentStatus = () => {
57
+ const activeIndex = index2.value;
58
+ if (activeIndex < +parent.props.current)
59
+ return "finish";
60
+ return activeIndex === +parent.props.current ? "process" : "wait";
61
+ };
62
+ const status = computed(() => {
63
+ return getCurrentStatus();
64
+ });
65
+ const classes = computed(() => {
66
+ const prefixCls = componentName;
67
+ return {
68
+ [prefixCls]: true,
69
+ [`${prefixCls}-${status.value}`]: true
70
+ };
71
+ });
72
+ return __spreadProps(__spreadValues({}, toRefs(state)), {
73
+ index: index2,
74
+ classes
75
+ });
76
+ }
77
+ });
78
+ const _hoisted_1 = { class: "nut-step-head" };
79
+ const _hoisted_2 = /* @__PURE__ */ createElementVNode("view", { class: "nut-step-line" }, null, -1);
80
+ const _hoisted_3 = {
81
+ key: 2,
82
+ class: "nut-step-inner"
83
+ };
84
+ const _hoisted_4 = { class: "nut-step-main" };
85
+ const _hoisted_5 = { class: "nut-step-title" };
86
+ const _hoisted_6 = ["innerHTML"];
87
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
88
+ const _component_nut_icon = resolveComponent("nut-icon");
89
+ return openBlock(), createElementBlock("view", {
90
+ class: normalizeClass(_ctx.classes)
91
+ }, [
92
+ createElementVNode("view", _hoisted_1, [
93
+ _hoisted_2,
94
+ createElementVNode("view", {
95
+ class: normalizeClass(["nut-step-icon", [!_ctx.dot ? _ctx.icon ? "is-icon" : "is-text" : ""]])
96
+ }, [
97
+ _ctx.icon ? (openBlock(), createBlock(_component_nut_icon, {
98
+ key: 0,
99
+ class: "nut-step-icon-inner",
100
+ name: _ctx.icon,
101
+ size: _ctx.size
102
+ }, null, 8, ["name", "size"])) : _ctx.dot ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [], 64)) : (openBlock(), createElementBlock("view", _hoisted_3, toDisplayString(_ctx.index), 1))
103
+ ], 2)
104
+ ]),
105
+ createElementVNode("view", _hoisted_4, [
106
+ createElementVNode("view", _hoisted_5, toDisplayString(_ctx.title), 1),
107
+ _ctx.content ? (openBlock(), createElementBlock("view", {
108
+ key: 0,
109
+ class: "nut-step-content",
110
+ innerHTML: _ctx.content
111
+ }, null, 8, _hoisted_6)) : createCommentVNode("", true)
112
+ ])
113
+ ], 2);
114
+ }
115
+ var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
116
+ export { index as default };
@@ -0,0 +1,52 @@
1
+ /*!
2
+ * @nutui/nutui v3.1.7 Thu Sep 30 2021 20:17:02 GMT+0800 (中国标准时间)
3
+ * (c) 2021 @jdf2e.
4
+ * Released under the MIT License.
5
+ */
6
+ import { reactive, computed, provide, h } from "vue";
7
+ import { c as createComponent } from "./component.js";
8
+ const { create, componentName } = createComponent("steps");
9
+ const _sfc_main = create({
10
+ props: {
11
+ direction: {
12
+ type: String,
13
+ default: "horizontal"
14
+ },
15
+ current: {
16
+ type: [String, Number],
17
+ default: "0"
18
+ },
19
+ progressDot: {
20
+ type: Boolean,
21
+ default: false
22
+ }
23
+ },
24
+ setup(props, { emit, slots }) {
25
+ const state = reactive({
26
+ children: []
27
+ });
28
+ const classes = computed(() => {
29
+ const prefixCls = componentName;
30
+ return {
31
+ [prefixCls]: true,
32
+ [`${prefixCls}-${props.direction}`]: true,
33
+ [`${prefixCls}-dot`]: !!props.progressDot
34
+ };
35
+ });
36
+ const relation = (child) => {
37
+ child && state.children.push(child);
38
+ };
39
+ provide("parent", {
40
+ relation,
41
+ state,
42
+ props
43
+ });
44
+ return () => {
45
+ var _a;
46
+ return h("view", {
47
+ class: classes.value
48
+ }, (_a = slots.default) == null ? void 0 : _a.call(slots));
49
+ };
50
+ }
51
+ });
52
+ export { _sfc_main as default };