@pisell/materials 6.8.9 → 6.8.10

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 (73) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/index.js +1 -1
  5. package/build/lowcode/meta.js +1 -1
  6. package/build/lowcode/preview.js +8 -8
  7. package/build/lowcode/render/default/view.js +16 -16
  8. package/build/lowcode/view.js +16 -16
  9. package/es/components/PisellProcedure/PisellProcedure.stories.d.ts +163 -0
  10. package/es/components/PisellProcedure/PisellProcedure.stories.js +1611 -0
  11. package/es/components/PisellScrollView/PisellScrollView.stories.d.ts +87 -0
  12. package/es/components/PisellScrollView/PisellScrollView.stories.js +772 -0
  13. package/es/components/PisellScrollView/hooks/useScrollEvents.js +18 -3
  14. package/es/components/PisellScrollView/index.d.ts +2 -1
  15. package/es/components/PisellScrollView/index.js +2 -1
  16. package/es/components/PisellSteps/PisellSteps.stories.d.ts +155 -0
  17. package/es/components/PisellSteps/PisellSteps.stories.js +851 -0
  18. package/es/components/PisellSuperTabs/PisellSuperTabs.d.ts +6 -10
  19. package/es/components/PisellSuperTabs/PisellSuperTabs.js +28 -8
  20. package/es/components/PisellSuperTabs/types.d.ts +1 -0
  21. package/es/components/PisellTabbar/PisellTabbar.d.ts +2 -19
  22. package/es/components/PisellTabbar/PisellTabbar.js +2 -1
  23. package/es/components/PisellTabbar/constants.d.ts +4 -4
  24. package/es/components/PisellTabbar/constants.js +5 -5
  25. package/es/components/PisellTabbar/index.d.ts +2 -0
  26. package/es/components/PisellTabbar/index.js +2 -0
  27. package/es/components/PisellTabbar/template/Template1/PisellTabbar.d.ts +20 -0
  28. package/es/components/PisellTabbar/template/Template1/PisellTabbar.js +426 -0
  29. package/es/components/PisellTabbar/template/Template1/constants.d.ts +10 -0
  30. package/es/components/PisellTabbar/template/Template1/constants.js +33 -0
  31. package/es/components/PisellTabbar/template/Template1/index.d.ts +6 -0
  32. package/es/components/PisellTabbar/template/Template1/index.js +7 -0
  33. package/es/components/PisellTabbar/template/Template1/utils/index.d.ts +35 -0
  34. package/es/components/PisellTabbar/template/Template1/utils/index.js +96 -0
  35. package/es/components/PisellTabbar/utils/index.d.ts +33 -0
  36. package/es/components/PisellTabbar/utils/index.js +3 -2
  37. package/es/components/productCard/cartSkuCard/components/packages/utils.d.ts +1 -1
  38. package/es/components/productCard/components/Packages/utils.d.ts +1 -1
  39. package/es/index.d.ts +2 -1
  40. package/es/index.js +2 -1
  41. package/lib/components/PisellProcedure/PisellProcedure.stories.d.ts +163 -0
  42. package/lib/components/PisellProcedure/PisellProcedure.stories.js +925 -0
  43. package/lib/components/PisellScrollView/PisellScrollView.stories.d.ts +87 -0
  44. package/lib/components/PisellScrollView/PisellScrollView.stories.js +535 -0
  45. package/lib/components/PisellScrollView/hooks/useScrollEvents.js +13 -3
  46. package/lib/components/PisellScrollView/index.d.ts +2 -1
  47. package/lib/components/PisellScrollView/index.js +2 -5
  48. package/lib/components/PisellSteps/PisellSteps.stories.d.ts +155 -0
  49. package/lib/components/PisellSteps/PisellSteps.stories.js +570 -0
  50. package/lib/components/PisellSuperTabs/PisellSuperTabs.d.ts +6 -10
  51. package/lib/components/PisellSuperTabs/PisellSuperTabs.js +25 -6
  52. package/lib/components/PisellSuperTabs/types.d.ts +1 -0
  53. package/lib/components/PisellTabbar/PisellTabbar.d.ts +2 -19
  54. package/lib/components/PisellTabbar/PisellTabbar.js +2 -1
  55. package/lib/components/PisellTabbar/constants.d.ts +4 -4
  56. package/lib/components/PisellTabbar/constants.js +5 -5
  57. package/lib/components/PisellTabbar/index.d.ts +2 -0
  58. package/lib/components/PisellTabbar/index.js +6 -0
  59. package/lib/components/PisellTabbar/template/Template1/PisellTabbar.d.ts +20 -0
  60. package/lib/components/PisellTabbar/template/Template1/PisellTabbar.js +437 -0
  61. package/lib/components/PisellTabbar/template/Template1/constants.d.ts +10 -0
  62. package/lib/components/PisellTabbar/template/Template1/constants.js +60 -0
  63. package/lib/components/PisellTabbar/template/Template1/index.d.ts +6 -0
  64. package/lib/components/PisellTabbar/template/Template1/index.js +36 -0
  65. package/lib/components/PisellTabbar/template/Template1/utils/index.d.ts +35 -0
  66. package/lib/components/PisellTabbar/template/Template1/utils/index.js +68 -0
  67. package/lib/components/PisellTabbar/utils/index.d.ts +33 -0
  68. package/lib/components/PisellTabbar/utils/index.js +4 -1
  69. package/lib/components/productCard/cartSkuCard/components/packages/utils.d.ts +1 -1
  70. package/lib/components/productCard/components/Packages/utils.d.ts +1 -1
  71. package/lib/index.d.ts +2 -1
  72. package/lib/index.js +5 -2
  73. package/package.json +21 -2
@@ -0,0 +1,851 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
3
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
4
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
5
+ import { expect, userEvent, within } from '@storybook/test';
6
+ import React from 'react';
7
+ import { CheckCircleOutlined, LoadingOutlined, SmileOutlined, UserOutlined, SolutionOutlined } from '@ant-design/icons';
8
+ import PisellSteps from "./PisellSteps";
9
+ /**
10
+ * PisellSteps 步骤条组件
11
+ *
12
+ * 基于 Ant Design Steps 组件进行二次封装和增强
13
+ * 支持多种展示样式、布局方式和丰富的交互功能
14
+ */
15
+ var meta = {
16
+ title: 'Components/PisellSteps',
17
+ component: PisellSteps,
18
+ parameters: {
19
+ layout: 'padded',
20
+ docs: {
21
+ description: {
22
+ component: '步骤条组件,用于展示流程进度和引导用户完成操作步骤。'
23
+ }
24
+ }
25
+ },
26
+ tags: ['autodocs'],
27
+ argTypes: {
28
+ type: {
29
+ control: 'select',
30
+ options: ['default', 'navigation'],
31
+ description: '步骤条类型'
32
+ },
33
+ direction: {
34
+ control: 'select',
35
+ options: ['horizontal', 'vertical'],
36
+ description: '步骤条方向'
37
+ },
38
+ size: {
39
+ control: 'select',
40
+ options: ['small', 'default', 'large'],
41
+ description: '步骤条尺寸'
42
+ },
43
+ status: {
44
+ control: 'select',
45
+ options: ['wait', 'process', 'finish', 'error'],
46
+ description: '当前步骤状态'
47
+ },
48
+ labelPlacement: {
49
+ control: 'select',
50
+ options: ['horizontal', 'vertical'],
51
+ description: '标签放置位置'
52
+ },
53
+ mobileMode: {
54
+ control: 'select',
55
+ options: ['full', 'current', 'auto'],
56
+ description: '移动端显示模式'
57
+ },
58
+ clickable: {
59
+ control: 'boolean',
60
+ description: '是否可点击'
61
+ },
62
+ responsive: {
63
+ control: 'boolean',
64
+ description: '是否响应式'
65
+ },
66
+ progressDot: {
67
+ control: 'boolean',
68
+ description: '是否使用点状步骤条'
69
+ },
70
+ gridLayout: {
71
+ control: 'boolean',
72
+ description: '是否启用栅格布局'
73
+ },
74
+ enableAnchor: {
75
+ control: 'boolean',
76
+ description: '是否启用锚链接'
77
+ }
78
+ }
79
+ };
80
+ export default meta;
81
+ // ========== 基础用法 ==========
82
+
83
+ /**
84
+ * 基础用法 - 默认步骤条
85
+ */
86
+ export var Default = {
87
+ args: {
88
+ items: [{
89
+ title: '步骤一',
90
+ description: '这是第一步的描述'
91
+ }, {
92
+ title: '步骤二',
93
+ description: '这是第二步的描述'
94
+ }, {
95
+ title: '步骤三',
96
+ description: '这是第三步的描述'
97
+ }],
98
+ current: 1
99
+ }
100
+ };
101
+
102
+ /**
103
+ * 非受控模式
104
+ * @description 使用 defaultCurrent 设置初始步骤
105
+ */
106
+ export var Uncontrolled = {
107
+ args: {
108
+ items: [{
109
+ title: '步骤一'
110
+ }, {
111
+ title: '步骤二'
112
+ }, {
113
+ title: '步骤三'
114
+ }],
115
+ defaultCurrent: 1,
116
+ clickable: true
117
+ }
118
+ };
119
+
120
+ // ========== 方向 ==========
121
+
122
+ /**
123
+ * 垂直方向
124
+ */
125
+ export var Vertical = {
126
+ args: {
127
+ direction: 'vertical',
128
+ items: [{
129
+ title: '步骤一',
130
+ description: '这是第一步的描述'
131
+ }, {
132
+ title: '步骤二',
133
+ description: '这是第二步的描述'
134
+ }, {
135
+ title: '步骤三',
136
+ description: '这是第三步的描述'
137
+ }],
138
+ current: 1
139
+ }
140
+ };
141
+
142
+ // ========== 类型 ==========
143
+
144
+ /**
145
+ * 点状步骤条
146
+ * @description 通过 progressDot 属性启用点状样式
147
+ */
148
+ export var Dot = {
149
+ args: {
150
+ progressDot: true,
151
+ items: [{
152
+ title: '已完成',
153
+ description: '这是第一步'
154
+ }, {
155
+ title: '进行中',
156
+ description: '这是第二步'
157
+ }, {
158
+ title: '等待中',
159
+ description: '这是第三步'
160
+ }],
161
+ current: 1
162
+ }
163
+ };
164
+
165
+ /**
166
+ * 自定义点状渲染
167
+ * @description 使用函数自定义点状图标的渲染
168
+ */
169
+ export var CustomProgressDot = {
170
+ args: {
171
+ progressDot: function progressDot(dot, _ref) {
172
+ var index = _ref.index,
173
+ status = _ref.status;
174
+ return /*#__PURE__*/React.createElement("span", {
175
+ style: {
176
+ display: 'inline-flex',
177
+ alignItems: 'center',
178
+ justifyContent: 'center',
179
+ width: 24,
180
+ height: 24,
181
+ borderRadius: '50%',
182
+ background: status === 'finish' ? '#52c41a' : status === 'process' ? '#1890ff' : '#d9d9d9',
183
+ color: '#fff',
184
+ fontSize: 12
185
+ }
186
+ }, status === 'finish' ? '✓' : index + 1);
187
+ },
188
+ items: [{
189
+ title: '步骤一'
190
+ }, {
191
+ title: '步骤二'
192
+ }, {
193
+ title: '步骤三'
194
+ }],
195
+ current: 1
196
+ }
197
+ };
198
+
199
+ /**
200
+ * 导航步骤条
201
+ */
202
+ export var Navigation = {
203
+ args: {
204
+ type: 'navigation',
205
+ items: [{
206
+ title: '步骤一'
207
+ }, {
208
+ title: '步骤二'
209
+ }, {
210
+ title: '步骤三'
211
+ }],
212
+ current: 1
213
+ }
214
+ };
215
+
216
+ // ========== 尺寸 ==========
217
+
218
+ /**
219
+ * 小尺寸
220
+ */
221
+ export var Small = {
222
+ args: {
223
+ size: 'small',
224
+ items: [{
225
+ title: '步骤一'
226
+ }, {
227
+ title: '步骤二'
228
+ }, {
229
+ title: '步骤三'
230
+ }],
231
+ current: 1
232
+ }
233
+ };
234
+
235
+ /**
236
+ * 大尺寸
237
+ */
238
+ export var Large = {
239
+ args: {
240
+ size: 'large',
241
+ items: [{
242
+ title: '步骤一',
243
+ description: '这是第一步的描述'
244
+ }, {
245
+ title: '步骤二',
246
+ description: '这是第二步的描述'
247
+ }, {
248
+ title: '步骤三',
249
+ description: '这是第三步的描述'
250
+ }],
251
+ current: 1
252
+ }
253
+ };
254
+
255
+ // ========== 标签位置 ==========
256
+
257
+ /**
258
+ * 标签垂直布局
259
+ * @description 标签在图标下方显示
260
+ */
261
+ export var LabelVertical = {
262
+ args: {
263
+ labelPlacement: 'vertical',
264
+ items: [{
265
+ title: '步骤一',
266
+ description: '这是第一步的描述'
267
+ }, {
268
+ title: '步骤二',
269
+ description: '这是第二步的描述'
270
+ }, {
271
+ title: '步骤三',
272
+ description: '这是第三步的描述'
273
+ }],
274
+ current: 1
275
+ }
276
+ };
277
+
278
+ // ========== 状态 ==========
279
+
280
+ /**
281
+ * 错误状态
282
+ */
283
+ export var ErrorStatus = {
284
+ args: {
285
+ items: [{
286
+ title: '步骤一',
287
+ status: 'finish'
288
+ }, {
289
+ title: '步骤二',
290
+ status: 'error'
291
+ }, {
292
+ title: '步骤三'
293
+ }],
294
+ current: 1,
295
+ status: 'error'
296
+ }
297
+ };
298
+
299
+ /**
300
+ * 自定义步骤状态
301
+ * @description 每个步骤可以单独设置状态
302
+ */
303
+ export var CustomStatus = {
304
+ args: {
305
+ items: [{
306
+ title: '步骤一',
307
+ status: 'finish',
308
+ description: '已完成'
309
+ }, {
310
+ title: '步骤二',
311
+ status: 'process',
312
+ description: '进行中'
313
+ }, {
314
+ title: '步骤三',
315
+ status: 'wait',
316
+ description: '等待中'
317
+ }, {
318
+ title: '步骤四',
319
+ status: 'error',
320
+ description: '出错了'
321
+ }],
322
+ current: 1
323
+ }
324
+ };
325
+
326
+ // ========== 可点击 ==========
327
+
328
+ /**
329
+ * 可点击步骤
330
+ */
331
+ export var Clickable = {
332
+ args: {
333
+ clickable: true,
334
+ items: [{
335
+ title: '步骤一'
336
+ }, {
337
+ title: '步骤二'
338
+ }, {
339
+ title: '步骤三'
340
+ }],
341
+ current: 1,
342
+ onChange: function onChange(current) {
343
+ return console.log('点击了步骤:', current);
344
+ }
345
+ }
346
+ };
347
+
348
+ /**
349
+ * 禁止点击已完成步骤
350
+ * @description 设置 allowClickFinished 为 false
351
+ */
352
+ export var DisallowClickFinished = {
353
+ args: {
354
+ clickable: true,
355
+ allowClickFinished: false,
356
+ items: [{
357
+ title: '步骤一',
358
+ description: '不可点击回去'
359
+ }, {
360
+ title: '步骤二',
361
+ description: '当前步骤'
362
+ }, {
363
+ title: '步骤三',
364
+ description: '点击前进'
365
+ }],
366
+ current: 1,
367
+ onChange: function onChange(current) {
368
+ return console.log('点击了步骤:', current);
369
+ }
370
+ }
371
+ };
372
+
373
+ /**
374
+ * 禁用特定步骤
375
+ * @description 通过 disabled 属性禁用某个步骤
376
+ */
377
+ export var DisabledStep = {
378
+ args: {
379
+ clickable: true,
380
+ items: [{
381
+ title: '步骤一'
382
+ }, {
383
+ title: '步骤二',
384
+ disabled: true
385
+ }, {
386
+ title: '步骤三'
387
+ }],
388
+ current: 0,
389
+ onChange: function onChange(current) {
390
+ return console.log('点击了步骤:', current);
391
+ }
392
+ }
393
+ };
394
+
395
+ // ========== 自定义图标 ==========
396
+
397
+ /**
398
+ * 自定义图标
399
+ */
400
+ export var CustomIcon = {
401
+ args: {
402
+ items: [{
403
+ title: '登录',
404
+ icon: /*#__PURE__*/React.createElement(UserOutlined)
405
+ }, {
406
+ title: '验证',
407
+ icon: /*#__PURE__*/React.createElement(SolutionOutlined)
408
+ }, {
409
+ title: '付款',
410
+ icon: /*#__PURE__*/React.createElement(LoadingOutlined)
411
+ }, {
412
+ title: '完成',
413
+ icon: /*#__PURE__*/React.createElement(SmileOutlined)
414
+ }],
415
+ current: 2
416
+ }
417
+ };
418
+
419
+ /**
420
+ * 完成图标
421
+ */
422
+ export var FinishIcon = {
423
+ args: {
424
+ items: [{
425
+ title: '步骤一',
426
+ icon: /*#__PURE__*/React.createElement(CheckCircleOutlined, {
427
+ style: {
428
+ color: '#52c41a'
429
+ }
430
+ })
431
+ }, {
432
+ title: '步骤二',
433
+ icon: '2'
434
+ }, {
435
+ title: '步骤三',
436
+ icon: '3'
437
+ }],
438
+ current: 1
439
+ }
440
+ };
441
+
442
+ // ========== 栅格布局 ==========
443
+
444
+ /**
445
+ * 栅格布局
446
+ * @description 启用栅格布局,自定义列数
447
+ */
448
+ export var GridLayout = {
449
+ args: {
450
+ gridLayout: true,
451
+ gridColumns: 4,
452
+ items: [{
453
+ title: '步骤一',
454
+ description: '描述'
455
+ }, {
456
+ title: '步骤二',
457
+ description: '描述'
458
+ }, {
459
+ title: '步骤三',
460
+ description: '描述'
461
+ }, {
462
+ title: '步骤四',
463
+ description: '描述'
464
+ }],
465
+ current: 1
466
+ }
467
+ };
468
+
469
+ // ========== 图标与文本间距 ==========
470
+
471
+ /**
472
+ * 自定义图标与文本间距
473
+ * @description 通过 itemGap 属性自定义间距
474
+ */
475
+ export var CustomItemGap = {
476
+ args: {
477
+ itemGap: 16,
478
+ items: [{
479
+ title: '步骤一',
480
+ description: '描述文本'
481
+ }, {
482
+ title: '步骤二',
483
+ description: '描述文本'
484
+ }, {
485
+ title: '步骤三',
486
+ description: '描述文本'
487
+ }],
488
+ current: 1
489
+ }
490
+ };
491
+
492
+ // ========== 移动端模式 ==========
493
+
494
+ /**
495
+ * 移动端 - 完整模式
496
+ * @description 移动端显示完整步骤条
497
+ */
498
+ export var MobileModeFull = {
499
+ args: {
500
+ mobileMode: 'full',
501
+ items: [{
502
+ title: '步骤一',
503
+ description: '第一步描述'
504
+ }, {
505
+ title: '步骤二',
506
+ description: '第二步描述'
507
+ }, {
508
+ title: '步骤三',
509
+ description: '第三步描述'
510
+ }],
511
+ current: 1
512
+ },
513
+ parameters: {
514
+ viewport: {
515
+ defaultViewport: 'mobile1'
516
+ }
517
+ }
518
+ };
519
+
520
+ /**
521
+ * 移动端 - 当前步骤模式
522
+ * @description 只显示当前步骤信息
523
+ */
524
+ export var MobileModeCurrent = {
525
+ args: {
526
+ mobileMode: 'current',
527
+ items: [{
528
+ title: '步骤一',
529
+ description: '第一步描述'
530
+ }, {
531
+ title: '步骤二',
532
+ description: '第二步描述'
533
+ }, {
534
+ title: '步骤三',
535
+ description: '第三步描述'
536
+ }],
537
+ current: 1
538
+ }
539
+ };
540
+
541
+ /**
542
+ * 移动端 - 自动模式
543
+ * @description 根据屏幕宽度自动切换显示模式
544
+ */
545
+ export var MobileModeAuto = {
546
+ args: {
547
+ mobileMode: 'auto',
548
+ mobileBreakpoint: 744,
549
+ items: [{
550
+ title: '步骤一',
551
+ description: '第一步描述'
552
+ }, {
553
+ title: '步骤二',
554
+ description: '第二步描述'
555
+ }, {
556
+ title: '步骤三',
557
+ description: '第三步描述'
558
+ }],
559
+ current: 1
560
+ }
561
+ };
562
+
563
+ /**
564
+ * 自定义移动端断点
565
+ * @description 通过 mobileBreakpoint 自定义断点宽度
566
+ */
567
+ export var CustomMobileBreakpoint = {
568
+ args: {
569
+ mobileMode: 'auto',
570
+ mobileBreakpoint: 500,
571
+ items: [{
572
+ title: '步骤一',
573
+ description: '第一步描述'
574
+ }, {
575
+ title: '步骤二',
576
+ description: '第二步描述'
577
+ }, {
578
+ title: '步骤三',
579
+ description: '第三步描述'
580
+ }],
581
+ current: 1
582
+ }
583
+ };
584
+
585
+ // ========== 起始索引 ==========
586
+
587
+ /**
588
+ * 自定义起始索引
589
+ * @description 通过 initial 设置起始步骤索引
590
+ */
591
+ export var InitialIndex = {
592
+ args: {
593
+ initial: 1,
594
+ current: 2,
595
+ items: [{
596
+ title: '步骤 1'
597
+ }, {
598
+ title: '步骤 2'
599
+ }, {
600
+ title: '步骤 3'
601
+ }]
602
+ }
603
+ };
604
+
605
+ // ========== 隐藏步骤 ==========
606
+
607
+ /**
608
+ * 隐藏特定步骤
609
+ * @description 通过 hidden 属性动态隐藏步骤
610
+ */
611
+ export var HiddenStep = {
612
+ args: {
613
+ items: [{
614
+ title: '步骤一'
615
+ }, {
616
+ title: '步骤二(隐藏)',
617
+ hidden: true
618
+ }, {
619
+ title: '步骤三'
620
+ }],
621
+ current: 1
622
+ }
623
+ };
624
+
625
+ // ========== 子标题 ==========
626
+
627
+ /**
628
+ * 带子标题
629
+ * @description 步骤可以包含子标题
630
+ */
631
+ export var WithSubTitle = {
632
+ args: {
633
+ items: [{
634
+ title: '已完成',
635
+ subTitle: '00:00:05',
636
+ description: '这是第一步'
637
+ }, {
638
+ title: '进行中',
639
+ subTitle: '剩余 00:00:08',
640
+ description: '这是第二步'
641
+ }, {
642
+ title: '等待中',
643
+ subTitle: '',
644
+ description: '这是第三步'
645
+ }],
646
+ current: 1
647
+ }
648
+ };
649
+
650
+ // ========== 响应式 ==========
651
+
652
+ /**
653
+ * 响应式步骤条
654
+ * @description 开启响应式后会自动调整布局
655
+ */
656
+ export var Responsive = {
657
+ args: {
658
+ responsive: true,
659
+ items: [{
660
+ title: '步骤一',
661
+ description: '这是第一步的描述'
662
+ }, {
663
+ title: '步骤二',
664
+ description: '这是第二步的描述'
665
+ }, {
666
+ title: '步骤三',
667
+ description: '这是第三步的描述'
668
+ }],
669
+ current: 1
670
+ }
671
+ };
672
+
673
+ // ========== 复杂示例 ==========
674
+
675
+ /**
676
+ * 完整功能演示
677
+ * @description 展示多种功能的组合使用
678
+ */
679
+ export var FullFeature = {
680
+ args: {
681
+ clickable: true,
682
+ responsive: true,
683
+ labelPlacement: 'vertical',
684
+ items: [{
685
+ title: '创建账户',
686
+ description: '填写基本信息',
687
+ icon: /*#__PURE__*/React.createElement(UserOutlined)
688
+ }, {
689
+ title: '身份验证',
690
+ description: '验证您的身份',
691
+ icon: /*#__PURE__*/React.createElement(SolutionOutlined)
692
+ }, {
693
+ title: '完成注册',
694
+ description: '设置完成',
695
+ icon: /*#__PURE__*/React.createElement(SmileOutlined)
696
+ }],
697
+ current: 1,
698
+ onChange: function onChange(current) {
699
+ return console.log('当前步骤:', current);
700
+ }
701
+ }
702
+ };
703
+
704
+ /**
705
+ * 多步骤流程
706
+ * @description 更多步骤的场景
707
+ */
708
+ export var ManySteps = {
709
+ args: {
710
+ size: 'small',
711
+ items: [{
712
+ title: '步骤 1'
713
+ }, {
714
+ title: '步骤 2'
715
+ }, {
716
+ title: '步骤 3'
717
+ }, {
718
+ title: '步骤 4'
719
+ }, {
720
+ title: '步骤 5'
721
+ }, {
722
+ title: '步骤 6'
723
+ }],
724
+ current: 3
725
+ }
726
+ };
727
+
728
+ /**
729
+ * 购物流程示例
730
+ * @description 模拟真实的购物流程
731
+ */
732
+ export var ShoppingFlow = {
733
+ args: {
734
+ type: 'navigation',
735
+ items: [{
736
+ title: '购物车',
737
+ description: '已选 3 件商品'
738
+ }, {
739
+ title: '填写订单',
740
+ description: '收货信息'
741
+ }, {
742
+ title: '支付',
743
+ description: '选择支付方式'
744
+ }, {
745
+ title: '完成',
746
+ description: '订单完成'
747
+ }],
748
+ current: 1,
749
+ clickable: true,
750
+ allowClickFinished: true
751
+ }
752
+ };
753
+
754
+ // ========== 交互测试 ==========
755
+
756
+ /**
757
+ * 交互测试 - 点击步骤
758
+ */
759
+ export var InteractionTest = {
760
+ args: {
761
+ clickable: true,
762
+ items: [{
763
+ title: '步骤一'
764
+ }, {
765
+ title: '步骤二'
766
+ }, {
767
+ title: '步骤三'
768
+ }],
769
+ current: 1
770
+ },
771
+ play: function () {
772
+ var _play = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref2) {
773
+ var canvasElement, canvas, step1;
774
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
775
+ while (1) switch (_context.prev = _context.next) {
776
+ case 0:
777
+ canvasElement = _ref2.canvasElement;
778
+ canvas = within(canvasElement);
779
+ step1 = canvas.getByText('步骤一'); // 验证步骤一存在
780
+ _context.next = 5;
781
+ return expect(step1).toBeInTheDocument();
782
+ case 5:
783
+ _context.next = 7;
784
+ return userEvent.click(step1);
785
+ case 7:
786
+ case "end":
787
+ return _context.stop();
788
+ }
789
+ }, _callee);
790
+ }));
791
+ function play(_x) {
792
+ return _play.apply(this, arguments);
793
+ }
794
+ return play;
795
+ }()
796
+ };
797
+
798
+ /**
799
+ * 交互测试 - 验证组件渲染
800
+ */
801
+ export var RenderTest = {
802
+ args: {
803
+ items: [{
804
+ title: '步骤一',
805
+ description: '描述一'
806
+ }, {
807
+ title: '步骤二',
808
+ description: '描述二'
809
+ }, {
810
+ title: '步骤三',
811
+ description: '描述三'
812
+ }],
813
+ current: 0
814
+ },
815
+ play: function () {
816
+ var _play2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(_ref3) {
817
+ var canvasElement, canvas;
818
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
819
+ while (1) switch (_context2.prev = _context2.next) {
820
+ case 0:
821
+ canvasElement = _ref3.canvasElement;
822
+ canvas = within(canvasElement); // 验证所有步骤标题存在
823
+ _context2.next = 4;
824
+ return expect(canvas.getByText('步骤一')).toBeInTheDocument();
825
+ case 4:
826
+ _context2.next = 6;
827
+ return expect(canvas.getByText('步骤二')).toBeInTheDocument();
828
+ case 6:
829
+ _context2.next = 8;
830
+ return expect(canvas.getByText('步骤三')).toBeInTheDocument();
831
+ case 8:
832
+ _context2.next = 10;
833
+ return expect(canvas.getByText('描述一')).toBeInTheDocument();
834
+ case 10:
835
+ _context2.next = 12;
836
+ return expect(canvas.getByText('描述二')).toBeInTheDocument();
837
+ case 12:
838
+ _context2.next = 14;
839
+ return expect(canvas.getByText('描述三')).toBeInTheDocument();
840
+ case 14:
841
+ case "end":
842
+ return _context2.stop();
843
+ }
844
+ }, _callee2);
845
+ }));
846
+ function play(_x2) {
847
+ return _play2.apply(this, arguments);
848
+ }
849
+ return play;
850
+ }()
851
+ };