@tuya-miniapp/smart-ui 2.7.3-beta-1 → 2.7.4-beta-0

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.
@@ -0,0 +1,170 @@
1
+ /* eslint-disable */
2
+ var lightVars = {};
3
+
4
+ var v0 = "rgba(246, 247, 251, 1)";
5
+ var v1 = "rgba(0, 0, 0, 0.9)";
6
+ var v2 = "rgba(0, 0, 0, 0.7)";
7
+ var v3 = "rgba(0, 0, 0, 0.5)";
8
+ var v4 = "rgba(0, 0, 0, 0.3)";
9
+ var v5 = "rgba(0, 0, 0, 0.2)";
10
+ var v6 = "rgba(0, 0, 0, 0.1)";
11
+ var v7 = "rgba(0, 0, 0, 0.4)";
12
+ var v8 = "rgba(0, 0, 0, 0.03)";
13
+ var v9 = "rgba(221.4, 222.3, 225.9, 1)";
14
+ var v10 = "rgba(255, 255, 255, 1)";
15
+ var v11 = "rgba(229.5, 229.5, 229.5, 1)";
16
+ var v12 = "rgba(255, 255, 255, 0.03)";
17
+ var v13 = "rgba(255, 255, 255, 0.9)";
18
+
19
+ lightVars["--app-B1"] = v0;
20
+ lightVars["--app-B1-N1"] = v1;
21
+ lightVars["--app-B1-N2"] = v2;
22
+ lightVars["--app-B1-N3"] = v3;
23
+ lightVars["--app-B1-N4"] = v4;
24
+ lightVars["--app-B1-N5"] = v2;
25
+ lightVars["--app-B1-N6"] = v5;
26
+ lightVars["--app-B1-N7"] = v6;
27
+ lightVars["--app-B1-N8"] = v7;
28
+ lightVars["--app-B1-N9"] = v8;
29
+ lightVars["--app-B1_2"] = v9;
30
+ lightVars["--app-B1_2-N1"] = v1;
31
+ lightVars["--app-B1_2-N2"] = v2;
32
+ lightVars["--app-B1_2-N3"] = v3;
33
+ lightVars["--app-B1_2-N4"] = v4;
34
+ lightVars["--app-B1_2-N5"] = v2;
35
+ lightVars["--app-B1_2-N6"] = v5;
36
+ lightVars["--app-B1_2-N7"] = v6;
37
+ lightVars["--app-B1_2-N8"] = v7;
38
+ lightVars["--app-B1_2-N9"] = v8;
39
+ lightVars["--app-B2"] = v10;
40
+ lightVars["--app-B2-N1"] = v1;
41
+ lightVars["--app-B2-N2"] = v2;
42
+ lightVars["--app-B2-N3"] = v3;
43
+ lightVars["--app-B2-N4"] = v4;
44
+ lightVars["--app-B2-N5"] = v2;
45
+ lightVars["--app-B2-N6"] = v5;
46
+ lightVars["--app-B2-N7"] = v6;
47
+ lightVars["--app-B2-N8"] = v7;
48
+ lightVars["--app-B2-N9"] = v8;
49
+ lightVars["--app-B2_2"] = v11;
50
+ lightVars["--app-B2_2-N1"] = v1;
51
+ lightVars["--app-B2_2-N2"] = v2;
52
+ lightVars["--app-B2_2-N3"] = v3;
53
+ lightVars["--app-B2_2-N4"] = v4;
54
+ lightVars["--app-B2_2-N5"] = v2;
55
+ lightVars["--app-B2_2-N6"] = v5;
56
+ lightVars["--app-B2_2-N7"] = v6;
57
+ lightVars["--app-B2_2-N8"] = v7;
58
+ lightVars["--app-B2_2-N9"] = v8;
59
+ lightVars["--app-B3"] = v10;
60
+ lightVars["--app-B3-N1"] = v1;
61
+ lightVars["--app-B3-N2"] = v2;
62
+ lightVars["--app-B3-N3"] = v3;
63
+ lightVars["--app-B3-N4"] = v4;
64
+ lightVars["--app-B3-N5"] = v2;
65
+ lightVars["--app-B3-N6"] = v5;
66
+ lightVars["--app-B3-N7"] = v6;
67
+ lightVars["--app-B3-N8"] = v7;
68
+ lightVars["--app-B3-N9"] = v8;
69
+ lightVars["--app-B3_2"] = v11;
70
+ lightVars["--app-B3_2-N1"] = v1;
71
+ lightVars["--app-B3_2-N2"] = v2;
72
+ lightVars["--app-B3_2-N3"] = v3;
73
+ lightVars["--app-B3_2-N4"] = v4;
74
+ lightVars["--app-B3_2-N5"] = v2;
75
+ lightVars["--app-B3_2-N6"] = v5;
76
+ lightVars["--app-B3_2-N7"] = v6;
77
+ lightVars["--app-B3_2-N8"] = v7;
78
+ lightVars["--app-B3_2-N9"] = v8;
79
+ lightVars["--app-B4"] = v10;
80
+ lightVars["--app-B4-N1"] = v1;
81
+ lightVars["--app-B4-N2"] = v2;
82
+ lightVars["--app-B4-N3"] = v3;
83
+ lightVars["--app-B4-N4"] = v4;
84
+ lightVars["--app-B4-N5"] = v2;
85
+ lightVars["--app-B4-N6"] = v5;
86
+ lightVars["--app-B4-N7"] = v6;
87
+ lightVars["--app-B4-N8"] = v7;
88
+ lightVars["--app-B4-N9"] = v8;
89
+ lightVars["--app-B4_2"] = v11;
90
+ lightVars["--app-B4_2-N1"] = v1;
91
+ lightVars["--app-B4_2-N2"] = v2;
92
+ lightVars["--app-B4_2-N3"] = v3;
93
+ lightVars["--app-B4_2-N4"] = v4;
94
+ lightVars["--app-B4_2-N5"] = v2;
95
+ lightVars["--app-B4_2-N6"] = v5;
96
+ lightVars["--app-B4_2-N7"] = v6;
97
+ lightVars["--app-B4_2-N8"] = v7;
98
+ lightVars["--app-B4_2-N9"] = v8;
99
+ lightVars["--app-B5"] = v10;
100
+ lightVars["--app-B5-N1"] = v1;
101
+ lightVars["--app-B5-N2"] = v2;
102
+ lightVars["--app-B5-N3"] = v3;
103
+ lightVars["--app-B5-N4"] = v4;
104
+ lightVars["--app-B5-N5"] = v2;
105
+ lightVars["--app-B5-N6"] = v5;
106
+ lightVars["--app-B5-N7"] = v6;
107
+ lightVars["--app-B5-N8"] = v7;
108
+ lightVars["--app-B5-N9"] = v8;
109
+ lightVars["--app-B5_2"] = v11;
110
+ lightVars["--app-B5_2-N1"] = v1;
111
+ lightVars["--app-B5_2-N2"] = v2;
112
+ lightVars["--app-B5_2-N3"] = v3;
113
+ lightVars["--app-B5_2-N4"] = v4;
114
+ lightVars["--app-B5_2-N5"] = v2;
115
+ lightVars["--app-B5_2-N6"] = v5;
116
+ lightVars["--app-B5_2-N7"] = v6;
117
+ lightVars["--app-B5_2-N8"] = v7;
118
+ lightVars["--app-B5_2-N9"] = v8;
119
+ lightVars["--app-B6"] = v10;
120
+ lightVars["--app-B6-N1"] = v1;
121
+ lightVars["--app-B6-N2"] = v2;
122
+ lightVars["--app-B6-N3"] = v3;
123
+ lightVars["--app-B6-N4"] = v4;
124
+ lightVars["--app-B6-N5"] = v2;
125
+ lightVars["--app-B6-N6"] = v5;
126
+ lightVars["--app-B6-N7"] = v6;
127
+ lightVars["--app-B6-N8"] = v7;
128
+ lightVars["--app-B6-N9"] = v8;
129
+ lightVars["--app-B6_2"] = v11;
130
+ lightVars["--app-B6_2-N1"] = v1;
131
+ lightVars["--app-B6_2-N2"] = v2;
132
+ lightVars["--app-B6_2-N3"] = v3;
133
+ lightVars["--app-B6_2-N4"] = v4;
134
+ lightVars["--app-B6_2-N5"] = v2;
135
+ lightVars["--app-B6_2-N6"] = v5;
136
+ lightVars["--app-B6_2-N7"] = v6;
137
+ lightVars["--app-B6_2-N8"] = v7;
138
+ lightVars["--app-B6_2-N9"] = v8;
139
+ lightVars["--app-M1-N8"] = v7;
140
+ lightVars["--app-M1-N9"] = v12;
141
+ lightVars["--app-M1_1-N8"] = v7;
142
+ lightVars["--app-M1_1-N9"] = v12;
143
+ lightVars["--app-M1_2-N1"] = v13;
144
+ lightVars["--app-M1_2-N8"] = v7;
145
+ lightVars["--app-M1_2-N9"] = v12;
146
+ lightVars["--app-M2-N8"] = v7;
147
+ lightVars["--app-M2-N9"] = v12;
148
+ lightVars["--app-M2_1-N8"] = v7;
149
+ lightVars["--app-M2_1-N9"] = v12;
150
+ lightVars["--app-M2_2-N1"] = v13;
151
+ lightVars["--app-M2_2-N8"] = v7;
152
+ lightVars["--app-M2_2-N9"] = v12;
153
+ lightVars["--app-M3-N8"] = v7;
154
+ lightVars["--app-M3-N9"] = v12;
155
+ lightVars["--app-M3_1-N8"] = v7;
156
+ lightVars["--app-M3_1-N9"] = v12;
157
+ lightVars["--app-M3_2-N1"] = v1;
158
+ lightVars["--app-M3_2-N8"] = v7;
159
+ lightVars["--app-M3_2-N9"] = v8;
160
+ lightVars["--app-M4-N8"] = v7;
161
+ lightVars["--app-M4-N9"] = v12;
162
+ lightVars["--app-M4_1-N8"] = v7;
163
+ lightVars["--app-M4_1-N9"] = v12;
164
+ lightVars["--app-M4_2-N1"] = v13;
165
+ lightVars["--app-M4_2-N8"] = v7;
166
+ lightVars["--app-M4_2-N9"] = v12;
167
+ lightVars["--app-M5-N8"] = v7;
168
+ lightVars["--app-M5-N9"] = v12;
169
+
170
+ module.exports = lightVars;
package/lib/wxs/style.wxs CHANGED
@@ -35,7 +35,7 @@ function style(styles) {
35
35
  return styles[key] != null && styles[key] !== '';
36
36
  })
37
37
  .map(function (key) {
38
- return [kebabCase(key), [styles[key]]].join(':');
38
+ return [key.indexOf('--') === 0 ? key : kebabCase(key), [styles[key]]].join(':');
39
39
  })
40
40
  .join(';') || '';
41
41
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tuya-miniapp/smart-ui",
3
- "version": "2.7.3-beta-1",
3
+ "version": "2.7.4-beta-0",
4
4
  "author": "MiniApp Team",
5
5
  "license": "MIT",
6
6
  "miniprogram": "lib",
@@ -17,6 +17,7 @@
17
17
  "build:wx": "node build/wx.mjs",
18
18
  "test": "TZ=Asia/Shanghai jest",
19
19
  "test:watch": "jest --watch",
20
+ "test:cover": "jest --coverage",
20
21
  "preMinipackBuild": "yarn && MODE=build NODE_OPTIONS=--no-experimental-fetch npx gulp -f build/compiler.js --series buildEs buildLib buildExample",
21
22
  "changelog": "conventional-changelog -p -i CHANGELOG.md -s"
22
23
  },
@@ -1 +0,0 @@
1
- @import '../common/index.css';
@@ -1 +0,0 @@
1
- export {};
@@ -1,219 +0,0 @@
1
- import { SmartComponent } from '../common/component';
2
- import { pickerProps } from '../picker/shared';
3
- import { requestAnimationFrame } from '../common/utils';
4
- const EMPTY_CODE = '000000';
5
- SmartComponent({
6
- classes: ['active-class', 'toolbar-class', 'column-class'],
7
- props: Object.assign(Object.assign({}, pickerProps), { showToolbar: {
8
- type: Boolean,
9
- value: true,
10
- }, value: {
11
- type: String,
12
- observer(value) {
13
- this.code = value;
14
- this.setValues();
15
- },
16
- }, areaList: {
17
- type: Object,
18
- value: {},
19
- observer: 'setValues',
20
- }, columnsNum: {
21
- type: null,
22
- value: 3,
23
- }, columnsPlaceholder: {
24
- type: Array,
25
- observer(val) {
26
- this.setData({
27
- typeToColumnsPlaceholder: {
28
- province: val[0] || '',
29
- city: val[1] || '',
30
- county: val[2] || '',
31
- },
32
- });
33
- },
34
- } }),
35
- data: {
36
- columns: [{ values: [] }, { values: [] }, { values: [] }],
37
- typeToColumnsPlaceholder: {},
38
- },
39
- mounted() {
40
- requestAnimationFrame(() => {
41
- this.setValues();
42
- });
43
- },
44
- methods: {
45
- getPicker() {
46
- if (this.picker == null) {
47
- this.picker = this.selectComponent('.smart-area__picker');
48
- }
49
- return this.picker;
50
- },
51
- onCancel(event) {
52
- this.emit('cancel', event.detail);
53
- },
54
- onConfirm(event) {
55
- const { index } = event.detail;
56
- let { value } = event.detail;
57
- value = this.parseValues(value);
58
- this.emit('confirm', { value, index });
59
- },
60
- emit(type, detail) {
61
- detail.values = detail.value;
62
- delete detail.value;
63
- this.$emit(type, detail);
64
- },
65
- parseValues(values) {
66
- const { columnsPlaceholder } = this.data;
67
- return values.map((value, index) => {
68
- if (value && (!value.code || value.name === columnsPlaceholder[index])) {
69
- return Object.assign(Object.assign({}, value), { code: '', name: '' });
70
- }
71
- return value;
72
- });
73
- },
74
- onChange(event) {
75
- var _a;
76
- const { index, picker, value } = event.detail;
77
- this.code = value[index].code;
78
- (_a = this.setValues()) === null || _a === void 0 ? void 0 : _a.then(() => {
79
- this.$emit('change', {
80
- picker,
81
- values: this.parseValues(picker.getValues()),
82
- index,
83
- });
84
- });
85
- },
86
- getConfig(type) {
87
- const { areaList } = this.data;
88
- return (areaList && areaList[`${type}_list`]) || {};
89
- },
90
- getList(type, code) {
91
- if (type !== 'province' && !code) {
92
- return [];
93
- }
94
- const { typeToColumnsPlaceholder } = this.data;
95
- const list = this.getConfig(type);
96
- let result = Object.keys(list).map(code => ({
97
- code,
98
- name: list[code],
99
- }));
100
- if (code != null) {
101
- // oversea code
102
- if (code[0] === '9' && type === 'city') {
103
- code = '9';
104
- }
105
- result = result.filter(item => item.code.indexOf(code) === 0);
106
- }
107
- if (typeToColumnsPlaceholder[type] && result.length) {
108
- // set columns placeholder
109
- const codeFill = type === 'province'
110
- ? ''
111
- : type === 'city'
112
- ? EMPTY_CODE.slice(2, 4)
113
- : EMPTY_CODE.slice(4, 6);
114
- result.unshift({
115
- code: `${code}${codeFill}`,
116
- name: typeToColumnsPlaceholder[type],
117
- });
118
- }
119
- return result;
120
- },
121
- getIndex(type, code) {
122
- let compareNum = type === 'province' ? 2 : type === 'city' ? 4 : 6;
123
- const list = this.getList(type, code.slice(0, compareNum - 2));
124
- // oversea code
125
- if (code[0] === '9' && type === 'province') {
126
- compareNum = 1;
127
- }
128
- code = code.slice(0, compareNum);
129
- for (let i = 0; i < list.length; i++) {
130
- if (list[i].code.slice(0, compareNum) === code) {
131
- return i;
132
- }
133
- }
134
- return 0;
135
- },
136
- setValues() {
137
- const picker = this.getPicker();
138
- if (!picker) {
139
- return;
140
- }
141
- let code = this.code || this.getDefaultCode();
142
- const provinceList = this.getList('province');
143
- const cityList = this.getList('city', code.slice(0, 2));
144
- const stack = [];
145
- const indexes = [];
146
- const { columnsNum } = this.data;
147
- if (columnsNum >= 1) {
148
- stack.push(picker.setColumnValues(0, provinceList, false));
149
- indexes.push(this.getIndex('province', code));
150
- }
151
- if (columnsNum >= 2) {
152
- stack.push(picker.setColumnValues(1, cityList, false));
153
- indexes.push(this.getIndex('city', code));
154
- if (cityList.length && code.slice(2, 4) === '00') {
155
- [{ code }] = cityList;
156
- }
157
- }
158
- if (columnsNum === 3) {
159
- stack.push(picker.setColumnValues(2, this.getList('county', code.slice(0, 4)), false));
160
- indexes.push(this.getIndex('county', code));
161
- }
162
- return Promise.all(stack)
163
- .catch(() => { })
164
- .then(() => picker.setIndexes(indexes))
165
- .catch(() => { });
166
- },
167
- getDefaultCode() {
168
- const { columnsPlaceholder } = this.data;
169
- if (columnsPlaceholder.length) {
170
- return EMPTY_CODE;
171
- }
172
- const countyCodes = Object.keys(this.getConfig('county'));
173
- if (countyCodes[0]) {
174
- return countyCodes[0];
175
- }
176
- const cityCodes = Object.keys(this.getConfig('city'));
177
- if (cityCodes[0]) {
178
- return cityCodes[0];
179
- }
180
- return '';
181
- },
182
- getValues() {
183
- const picker = this.getPicker();
184
- if (!picker) {
185
- return [];
186
- }
187
- return this.parseValues(picker.getValues().filter(value => !!value));
188
- },
189
- getDetail() {
190
- const values = this.getValues();
191
- const area = {
192
- code: '',
193
- country: '',
194
- province: '',
195
- city: '',
196
- county: '',
197
- };
198
- if (!values.length) {
199
- return area;
200
- }
201
- const names = values.map((item) => item.name);
202
- area.code = values[values.length - 1].code;
203
- if (area.code[0] === '9') {
204
- area.country = names[1] || '';
205
- area.province = names[2] || '';
206
- }
207
- else {
208
- area.province = names[0] || '';
209
- area.city = names[1] || '';
210
- area.county = names[2] || '';
211
- }
212
- return area;
213
- },
214
- reset(code) {
215
- this.code = code || '';
216
- return this.setValues();
217
- },
218
- },
219
- });
@@ -1,6 +0,0 @@
1
- {
2
- "component": true,
3
- "usingComponents": {
4
- "smart-picker": "../picker/index"
5
- }
6
- }
@@ -1,20 +0,0 @@
1
- <wxs src="./index.wxs" module="computed" />
2
-
3
- <smart-picker
4
- class="smart-area__picker"
5
- active-class="active-class"
6
- toolbar-class="toolbar-class"
7
- column-class="column-class"
8
- show-toolbar="{{ showToolbar }}"
9
- value-key="name"
10
- title="{{ title }}"
11
- loading="{{ loading }}"
12
- columns="{{ computed.displayColumns(columns, columnsNum) }}"
13
- item-height="{{ itemHeight }}"
14
- visible-item-count="{{ visibleItemCount }}"
15
- cancel-button-text="{{ cancelButtonText }}"
16
- confirm-button-text="{{ confirmButtonText }}"
17
- bind:change="onChange"
18
- bind:confirm="onConfirm"
19
- bind:cancel="onCancel"
20
- />
@@ -1,8 +0,0 @@
1
- /* eslint-disable */
2
- function displayColumns(columns, columnsNum) {
3
- return columns.slice(0, +columnsNum);
4
- }
5
-
6
- module.exports = {
7
- displayColumns: displayColumns,
8
- };
@@ -1 +0,0 @@
1
- @import '../common/index.wxss';
@@ -1 +0,0 @@
1
- @import '../common/index.css';:root{--smart-ui-overlay:rgba(0,0,0,.4);--smart-ui-bottom-sheet-dragger-node-background:rgba(0,0,0,.3);--smart-ui-dialog-background:#fff;--smart-ui-border-image:linear-gradient(90deg,transparent,rgba(0,0,0,.3),transparent)}:root[theme=dark]{--smart-ui-bottom-sheet-dragger-node-background:hsla(0,0%,100%,.3);--smart-ui-overlay:rgba(0,0,0,.7);--smart-ui-dialog-background:#333;--smart-ui-border-image:linear-gradient(90deg,hsla(0,0%,100%,0),hsla(0,0%,100%,.3),hsla(0,0%,100%,0))}.smart-manrope{font-family:Manrope,sans-serif}.smart-steps{background-color:var(--steps-background-color,var(--app-B3,#fff));overflow:hidden}.smart-steps--horizontal{padding:10px}.smart-steps--horizontal .smart-step__wrapper{display:flex;overflow:hidden;position:relative}.smart-steps--vertical{padding-left:10px}.smart-steps--vertical .smart-step__wrapper{padding:0 0 0 20px}.smart-step{color:var(--step-text-color,#969799);flex:1;font-size:var(--step-font-size,14px);position:relative}.smart-step--finish{color:var(--step-finish-text-color,#323233)}.smart-step__circle{background-color:var(--step-circle-color,#969799);border-radius:50%;height:var(--step-circle-size,5px);width:var(--step-circle-size,5px)}.smart-step--horizontal{padding-bottom:14px}.smart-step--horizontal:first-child .smart-step__title{transform:none}.smart-step--horizontal:first-child .smart-step__circle-container{padding:0 8px 0 0;transform:translate3d(0,50%,0)}.smart-step--horizontal:last-child{position:absolute;right:0;width:auto}.smart-step--horizontal:last-child .smart-step__title{text-align:right;transform:none}.smart-step--horizontal:last-child .smart-step__circle-container{padding:0 0 0 8px;right:0;transform:translate3d(0,50%,0)}.smart-step--horizontal .smart-step__circle-container{background-color:var(--app-B3);bottom:6px;padding:0 var(--padding-xs,8px);position:absolute;transform:translate3d(-50%,50%,0);z-index:1}.smart-step--horizontal .smart-step__title{display:inline-block;font-size:var(--step-horizontal-title-font-size,12px);transform:translate3d(-50%,0,0)}.smart-step--horizontal .smart-step__line{background-color:var(--step-line-color,var(--app-B6-N7,rgba(0,0,0,.1)));bottom:6px;height:1px;left:0;position:absolute;right:0;transform:translate3d(0,50%,0)}.smart-step--horizontal.smart-step--process{color:var(--step-process-text-color,#323233)}.smart-step--horizontal.smart-step--process .smart-step__icon{display:block;font-size:var(--step-icon-size,12px);line-height:1}.smart-step--vertical{line-height:18px;padding:10px 10px 10px 0}.smart-step--vertical:after{border-bottom-width:1px}.smart-step--vertical:last-child:after{border-bottom-width:none}.smart-step--vertical:first-child:before{content:"";height:20px;left:-15px;position:absolute;top:0;width:1px;z-index:1}.smart-step--vertical .smart-step__circle,.smart-step--vertical .smart-step__icon,.smart-step--vertical .smart-step__line{left:-14px;position:absolute;top:19px;transform:translate3d(-50%,-50%,0);z-index:2}.smart-step--vertical .smart-step__icon{background-color:var(--steps-background-color,var(--app-B3,#fff));font-size:var(--step-icon-size,12px);line-height:1}.smart-step--vertical .smart-step__line{background-color:var(--step-line-color,var(--app-B6-N7,rgba(0,0,0,.1)));height:100%;transform:translate3d(-50%,0,0);width:1px;z-index:1}
@@ -1 +0,0 @@
1
- export {};
@@ -1,34 +0,0 @@
1
- import Checkmark from '@tuya-miniapp/icons/dist/svg/Checkmark';
2
- import { SmartComponent } from '../common/component';
3
- import { GREEN, GRAY_DARK } from '../common/color';
4
- SmartComponent({
5
- classes: ['desc-class'],
6
- props: {
7
- icon: String,
8
- steps: Array,
9
- active: Number,
10
- direction: {
11
- type: String,
12
- value: 'horizontal',
13
- },
14
- activeColor: {
15
- type: String,
16
- value: GREEN,
17
- },
18
- inactiveColor: {
19
- type: String,
20
- value: GRAY_DARK,
21
- },
22
- activeIcon: {
23
- type: String,
24
- value: Checkmark,
25
- },
26
- inactiveIcon: String,
27
- },
28
- methods: {
29
- onClick(event) {
30
- const { index } = event.currentTarget.dataset;
31
- this.$emit('click-step', index);
32
- },
33
- },
34
- });
@@ -1,6 +0,0 @@
1
- {
2
- "component": true,
3
- "usingComponents": {
4
- "smart-icon": "../icon/index"
5
- }
6
- }
@@ -1,54 +0,0 @@
1
- <wxs src="../wxs/utils.wxs" module="utils" />
2
-
3
- <view class="custom-class {{ utils.bem('steps', [direction]) }}">
4
- <view class="smart-step__wrapper">
5
- <view
6
- wx:for="{{ steps }}"
7
- wx:key="index"
8
- bindtap="onClick"
9
- data-index="{{ index }}"
10
- class="{{ utils.bem('step', [direction, status(index, active)]) }} smart-hairline"
11
- style="{{ status(index, active) === 'inactive' ? 'color: ' + inactiveColor: '' }}"
12
- >
13
- <view class="smart-step__title" style="{{ index === active ? 'color: ' + activeColor : '' }}">
14
- <view>{{ item.text }}</view>
15
- <view class="desc-class">{{ item.desc }}</view>
16
- </view>
17
- <view class="smart-step__circle-container">
18
- <block wx:if="{{ index !== active }}">
19
- <smart-icon
20
- wx:if="{{ item.inactiveIcon || inactiveIcon }}"
21
- color="{{ status(index, active) === 'inactive' ? inactiveColor: activeColor }}"
22
- name="{{ item.inactiveIcon || inactiveIcon }}"
23
- class="smart-step__icon"
24
- />
25
- <view
26
- wx:else
27
- class="smart-step__circle"
28
- style="{{ 'background-color: ' + (index < active ? activeColor : inactiveColor) }}"
29
- />
30
- </block>
31
-
32
- <smart-icon wx:else name="{{ item.activeIcon || activeIcon }}" color="{{ activeColor }}" class="smart-step__icon" />
33
- </view>
34
- <view
35
- wx:if="{{ index !== steps.length - 1 }}"
36
- class="smart-step__line" style="{{ 'background-color: ' + (index < active ? activeColor : inactiveColor) }}"
37
- />
38
- </view>
39
- </view>
40
- </view>
41
-
42
- <wxs module="status">
43
- function get(index, active) {
44
- if (index < active) {
45
- return 'finish';
46
- } else if (index === active) {
47
- return 'process';
48
- }
49
-
50
- return 'inactive';
51
- }
52
-
53
- module.exports = get;
54
- </wxs>
@@ -1 +0,0 @@
1
- @import '../common/index.wxss';:root{--smart-ui-overlay:rgba(0,0,0,.4);--smart-ui-bottom-sheet-dragger-node-background:rgba(0,0,0,.3);--smart-ui-dialog-background:#fff;--smart-ui-border-image:linear-gradient(90deg,transparent,rgba(0,0,0,.3),transparent)}:root[theme=dark]{--smart-ui-bottom-sheet-dragger-node-background:hsla(0,0%,100%,.3);--smart-ui-overlay:rgba(0,0,0,.7);--smart-ui-dialog-background:#333;--smart-ui-border-image:linear-gradient(90deg,hsla(0,0%,100%,0),hsla(0,0%,100%,.3),hsla(0,0%,100%,0))}.smart-manrope{font-family:Manrope,sans-serif}.smart-steps{background-color:var(--steps-background-color,var(--app-B3,#fff));overflow:hidden}.smart-steps--horizontal{padding:10px}.smart-steps--horizontal .smart-step__wrapper{display:flex;overflow:hidden;position:relative}.smart-steps--vertical{padding-left:10px}.smart-steps--vertical .smart-step__wrapper{padding:0 0 0 20px}.smart-step{color:var(--step-text-color,#969799);flex:1;font-size:var(--step-font-size,14px);position:relative}.smart-step--finish{color:var(--step-finish-text-color,#323233)}.smart-step__circle{background-color:var(--step-circle-color,#969799);border-radius:50%;height:var(--step-circle-size,5px);width:var(--step-circle-size,5px)}.smart-step--horizontal{padding-bottom:14px}.smart-step--horizontal:first-child .smart-step__title{transform:none}.smart-step--horizontal:first-child .smart-step__circle-container{padding:0 8px 0 0;transform:translate3d(0,50%,0)}.smart-step--horizontal:last-child{position:absolute;right:0;width:auto}.smart-step--horizontal:last-child .smart-step__title{text-align:right;transform:none}.smart-step--horizontal:last-child .smart-step__circle-container{padding:0 0 0 8px;right:0;transform:translate3d(0,50%,0)}.smart-step--horizontal .smart-step__circle-container{background-color:var(--app-B3);bottom:6px;padding:0 var(--padding-xs,8px);position:absolute;transform:translate3d(-50%,50%,0);z-index:1}.smart-step--horizontal .smart-step__title{display:inline-block;font-size:var(--step-horizontal-title-font-size,12px);transform:translate3d(-50%,0,0)}.smart-step--horizontal .smart-step__line{background-color:var(--step-line-color,var(--app-B6-N7,rgba(0,0,0,.1)));bottom:6px;height:1px;left:0;position:absolute;right:0;transform:translate3d(0,50%,0)}.smart-step--horizontal.smart-step--process{color:var(--step-process-text-color,#323233)}.smart-step--horizontal.smart-step--process .smart-step__icon{display:block;font-size:var(--step-icon-size,12px);line-height:1}.smart-step--vertical{line-height:18px;padding:10px 10px 10px 0}.smart-step--vertical:after{border-bottom-width:1px}.smart-step--vertical:last-child:after{border-bottom-width:none}.smart-step--vertical:first-child:before{content:"";height:20px;left:-15px;position:absolute;top:0;width:1px;z-index:1}.smart-step--vertical .smart-step__circle,.smart-step--vertical .smart-step__icon,.smart-step--vertical .smart-step__line{left:-14px;position:absolute;top:19px;transform:translate3d(-50%,-50%,0);z-index:2}.smart-step--vertical .smart-step__icon{background-color:var(--steps-background-color,var(--app-B3,#fff));font-size:var(--step-icon-size,12px);line-height:1}.smart-step--vertical .smart-step__line{background-color:var(--step-line-color,var(--app-B6-N7,rgba(0,0,0,.1)));height:100%;transform:translate3d(-50%,0,0);width:1px;z-index:1}
@@ -1 +0,0 @@
1
- @import '../common/index.css';
@@ -1 +0,0 @@
1
- export {};