@tuya-miniapp/smart-ui 2.1.11-beta-2 → 2.1.11-beta-4

Sign up to get free protection for your applications and to get access to all the features.
@@ -112,22 +112,22 @@ SmartComponent({
112
112
  }
113
113
  return this.picker;
114
114
  },
115
- formatterFunc(type, value) {
116
- var _a;
117
- const { formatterMap, formatter = defaultFormatter } = this.data;
115
+ formatterFunc(type, value, data) {
116
+ var _a, _b;
117
+ const { formatterMap, formatter = defaultFormatter } = (_a = this === null || this === void 0 ? void 0 : this.data) !== null && _a !== void 0 ? _a : data;
118
118
  const mapDetail = formatterMap === null || formatterMap === void 0 ? void 0 : formatterMap[type];
119
119
  if (typeof mapDetail === 'string') {
120
120
  return replacePlaceholders(mapDetail, { [type]: value });
121
121
  }
122
122
  if (typeof mapDetail === 'object') {
123
- return (_a = mapDetail[value]) !== null && _a !== void 0 ? _a : formatter(type, value);
123
+ return (_b = mapDetail[value]) !== null && _b !== void 0 ? _b : formatter(type, value);
124
124
  }
125
125
  return formatter(type, value);
126
126
  },
127
127
  updateColumns() {
128
128
  const { locale } = this.data;
129
129
  const results = this.getOriginColumns().map(column => ({
130
- values: column.values.map(value => this.formatterFunc(column.type, value)),
130
+ values: column.values.map(value => this.formatterFunc(column.type, value, this.data)),
131
131
  order: column.order,
132
132
  unit: locale === null || locale === void 0 ? void 0 : locale[column.type],
133
133
  }));
@@ -340,25 +340,25 @@ SmartComponent({
340
340
  });
341
341
  values = [
342
342
  part,
343
- formatter('hour', part ? (!hour ? 12 : hour - 12) : hour),
344
- formatter('minute', minute),
343
+ formatter('hour', part ? (!hour ? 12 : hour - 12) : hour, this.data),
344
+ formatter('minute', minute, this.data),
345
345
  ];
346
346
  }
347
347
  else if (type === 'time') {
348
348
  const pair = value.split(':');
349
- values = [formatter('hour', pair[0]), formatter('minute', pair[1])];
349
+ values = [formatter('hour', pair[0], this.data), formatter('minute', pair[1], this.data)];
350
350
  }
351
351
  else {
352
352
  const date = new Date(value);
353
353
  values = [
354
- formatter('year', `${date.getFullYear()}`),
355
- formatter('month', padZero(date.getMonth() + 1)),
354
+ formatter('year', `${date.getFullYear()}`, this.data),
355
+ formatter('month', padZero(date.getMonth() + 1), this.data),
356
356
  ];
357
357
  if (type === 'date') {
358
- values.push(formatter('day', padZero(date.getDate())));
358
+ values.push(formatter('day', padZero(date.getDate()), this.data));
359
359
  }
360
360
  if (type === 'datetime') {
361
- values.push(formatter('day', padZero(date.getDate())), formatter('hour', padZero(date.getHours())), formatter('minute', padZero(date.getMinutes())));
361
+ values.push(formatter('day', padZero(date.getDate()), this.data), formatter('hour', padZero(date.getHours()), this.data), formatter('minute', padZero(date.getMinutes()), this.data));
362
362
  }
363
363
  }
364
364
  return this.set({ innerValue: value })
@@ -1 +1 @@
1
- @import '../common/index.css';.smart-nav-bar{background-color:var(--nav-bar-background-color,var(--app-B2,#fff));box-sizing:initial;height:var(--nav-bar-height,46px);line-height:var(--nav-bar-height,46px);position:relative;text-align:center;-webkit-user-select:none;user-select:none}.smart-nav-bar__content{align-items:center;display:flex;height:100%;position:relative}.smart-nav-bar__text{color:var(--nav-bar-text-color,var(--app-B2-N1,#000));display:inline-block;font-size:var(--nav-bar-text-font-size,16px);margin:0 calc(var(--padding-md, 16px)*-1);padding:0 var(--padding-md,16px);vertical-align:middle}.smart-nav-bar__text--hover{opacity:.3}.smart-nav-bar__text--home{color:var(--nav-bar-home-text-color,var(--app-B2-N1,#000));font-size:var(--nav-bar-home-font-size,22px);font-weight:var(--nav-bar-home-font-weight,600)}.smart-nav-bar__text--title{color:var(--nav-bar-title-text-color,var(--app-B2-N1,#000));font-size:var(--nav-bar-title-font-size,16px);font-weight:var(--nav-bar-title-font-weight,600)}.smart-nav-bar__arrow{vertical-align:middle}.smart-nav-bar__arrow>view{background:var(--nav-bar-arrow-color,var(--app-B2-N1,#000))}.smart-nav-bar__icon-wrap{align-items:center;display:flex;height:var(--nav-bar-icon-size,32px);justify-content:center;margin:var(--nav-bar-icon-margin,0);width:var(--nav-bar-icon-size,32px)}.smart-nav-bar__icon>view{background:var(--nav-bar-icon-color,var(--app-B2-N1,#000))}.smart-nav-bar--fixed{left:0;position:fixed;top:0;width:100%}.smart-nav-bar--round{border-radius:var(--nav-bar-round-border-radius,16px 16px 0 0);min-height:var(--nav-bar-round-min-height,56px)}.smart-nav-bar__title{color:var(--nav-bar-title-text-color,var(--app-B2-N1,#000));font-size:var(--nav-bar-title-font-size,16px);font-weight:var(--nav-bar-title-font-weight,600);margin:0 auto;max-width:60%}.smart-nav-bar__left,.smart-nav-bar__right{align-items:center;bottom:0;display:flex;position:absolute;top:0}.smart-nav-bar__left{left:var(--padding-md,16px)}.smart-nav-bar__right{right:var(--padding-md,16px)}
1
+ @import '../common/index.css';.smart-nav-bar{background-color:var(--nav-bar-background-color,var(--app-B2,#fff));box-sizing:initial;height:var(--nav-bar-height,46px);line-height:var(--nav-bar-height,46px);position:relative;text-align:center;-webkit-user-select:none;user-select:none}.smart-nav-bar__content{align-items:center;display:flex;height:100%;position:relative}.smart-nav-bar__text{color:var(--nav-bar-text-color,var(--app-B2-N1,#000));display:inline-block;font-size:var(--nav-bar-text-font-size,16px);margin:0 calc(var(--padding-md, 16px)*-1);padding:0 var(--padding-md,16px);vertical-align:middle}.smart-nav-bar__text--hover{opacity:.3}.smart-nav-bar__text--home{color:var(--nav-bar-home-text-color,var(--app-B2-N1,#000));font-size:var(--nav-bar-home-font-size,22px);font-weight:var(--nav-bar-home-font-weight,600)}.smart-nav-bar__text--title{color:var(--nav-bar-title-text-color,var(--app-B2-N1,#000));font-size:var(--nav-bar-title-font-size,16px);font-weight:var(--nav-bar-title-font-weight,600)}.smart-nav-bar__arrow{vertical-align:middle}.smart-nav-bar__arrow>view{background:var(--nav-bar-arrow-color,var(--app-B2-N1,#000))}.smart-nav-bar__icon-wrap{align-items:center;display:flex;height:var(--nav-bar-icon-size,32px);justify-content:center;margin:var(--nav-bar-icon-margin,0);width:var(--nav-bar-icon-size,32px)}.smart-nav-bar__icon>view{background:var(--nav-bar-icon-color,var(--app-B2-N1,#000))}.smart-nav-bar--safe-top{padding-top:var(--app-device-status-height,20px)}.smart-nav-bar--fixed{left:0;position:fixed;top:0;width:100%}.smart-nav-bar--round{border-radius:var(--nav-bar-round-border-radius,16px 16px 0 0);min-height:var(--nav-bar-round-min-height,56px)}.smart-nav-bar__title{color:var(--nav-bar-title-text-color,var(--app-B2-N1,#000));font-size:var(--nav-bar-title-font-size,16px);font-weight:var(--nav-bar-title-font-weight,600);margin:0 auto;max-width:60%}.smart-nav-bar__left,.smart-nav-bar__right{align-items:center;bottom:0;display:flex;position:absolute;top:0}.smart-nav-bar__left{left:var(--padding-md,16px)}.smart-nav-bar__right{right:var(--padding-md,16px)}
@@ -4,7 +4,7 @@
4
4
  <view wx:if="{{ fixed && placeholder }}" style="height: {{ height }}px;" />
5
5
 
6
6
  <view
7
- class="{{ utils.bem('nav-bar', { fixed, round }) }} custom-class {{ border ? 'smart-hairline--bottom' : '' }}"
7
+ class="{{ utils.bem('nav-bar', { fixed, round, 'safe-top': safeAreaInsetTop }) }} custom-class {{ border ? 'smart-hairline--bottom' : '' }}"
8
8
  style="{{ computed.barStyle({ zIndex, statusBarHeight, safeAreaInsetTop }) }}; {{ customStyle }}"
9
9
  >
10
10
  <view class="smart-nav-bar__content">
@@ -1 +1 @@
1
- @import '../common/index.wxss';.smart-nav-bar{background-color:var(--nav-bar-background-color,var(--app-B2,#fff));box-sizing:initial;height:var(--nav-bar-height,46px);line-height:var(--nav-bar-height,46px);position:relative;text-align:center;-webkit-user-select:none;user-select:none}.smart-nav-bar__content{align-items:center;display:flex;height:100%;position:relative}.smart-nav-bar__text{color:var(--nav-bar-text-color,var(--app-B2-N1,#000));display:inline-block;font-size:var(--nav-bar-text-font-size,16px);margin:0 calc(var(--padding-md, 16px)*-1);padding:0 var(--padding-md,16px);vertical-align:middle}.smart-nav-bar__text--hover{opacity:.3}.smart-nav-bar__text--home{color:var(--nav-bar-home-text-color,var(--app-B2-N1,#000));font-size:var(--nav-bar-home-font-size,22px);font-weight:var(--nav-bar-home-font-weight,600)}.smart-nav-bar__text--title{color:var(--nav-bar-title-text-color,var(--app-B2-N1,#000));font-size:var(--nav-bar-title-font-size,16px);font-weight:var(--nav-bar-title-font-weight,600)}.smart-nav-bar__arrow{vertical-align:middle}.smart-nav-bar__arrow>view{background:var(--nav-bar-arrow-color,var(--app-B2-N1,#000))}.smart-nav-bar__icon-wrap{align-items:center;display:flex;height:var(--nav-bar-icon-size,32px);justify-content:center;margin:var(--nav-bar-icon-margin,0);width:var(--nav-bar-icon-size,32px)}.smart-nav-bar__icon>view{background:var(--nav-bar-icon-color,var(--app-B2-N1,#000))}.smart-nav-bar--fixed{left:0;position:fixed;top:0;width:100%}.smart-nav-bar--round{border-radius:var(--nav-bar-round-border-radius,16px 16px 0 0);min-height:var(--nav-bar-round-min-height,56px)}.smart-nav-bar__title{color:var(--nav-bar-title-text-color,var(--app-B2-N1,#000));font-size:var(--nav-bar-title-font-size,16px);font-weight:var(--nav-bar-title-font-weight,600);margin:0 auto;max-width:60%}.smart-nav-bar__left,.smart-nav-bar__right{align-items:center;bottom:0;display:flex;position:absolute;top:0}.smart-nav-bar__left{left:var(--padding-md,16px)}.smart-nav-bar__right{right:var(--padding-md,16px)}
1
+ @import '../common/index.wxss';.smart-nav-bar{background-color:var(--nav-bar-background-color,var(--app-B2,#fff));box-sizing:initial;height:var(--nav-bar-height,46px);line-height:var(--nav-bar-height,46px);position:relative;text-align:center;-webkit-user-select:none;user-select:none}.smart-nav-bar__content{align-items:center;display:flex;height:100%;position:relative}.smart-nav-bar__text{color:var(--nav-bar-text-color,var(--app-B2-N1,#000));display:inline-block;font-size:var(--nav-bar-text-font-size,16px);margin:0 calc(var(--padding-md, 16px)*-1);padding:0 var(--padding-md,16px);vertical-align:middle}.smart-nav-bar__text--hover{opacity:.3}.smart-nav-bar__text--home{color:var(--nav-bar-home-text-color,var(--app-B2-N1,#000));font-size:var(--nav-bar-home-font-size,22px);font-weight:var(--nav-bar-home-font-weight,600)}.smart-nav-bar__text--title{color:var(--nav-bar-title-text-color,var(--app-B2-N1,#000));font-size:var(--nav-bar-title-font-size,16px);font-weight:var(--nav-bar-title-font-weight,600)}.smart-nav-bar__arrow{vertical-align:middle}.smart-nav-bar__arrow>view{background:var(--nav-bar-arrow-color,var(--app-B2-N1,#000))}.smart-nav-bar__icon-wrap{align-items:center;display:flex;height:var(--nav-bar-icon-size,32px);justify-content:center;margin:var(--nav-bar-icon-margin,0);width:var(--nav-bar-icon-size,32px)}.smart-nav-bar__icon>view{background:var(--nav-bar-icon-color,var(--app-B2-N1,#000))}.smart-nav-bar--safe-top{padding-top:var(--app-device-status-height,20px)}.smart-nav-bar--fixed{left:0;position:fixed;top:0;width:100%}.smart-nav-bar--round{border-radius:var(--nav-bar-round-border-radius,16px 16px 0 0);min-height:var(--nav-bar-round-min-height,56px)}.smart-nav-bar__title{color:var(--nav-bar-title-text-color,var(--app-B2-N1,#000));font-size:var(--nav-bar-title-font-size,16px);font-weight:var(--nav-bar-title-font-weight,600);margin:0 auto;max-width:60%}.smart-nav-bar__left,.smart-nav-bar__right{align-items:center;bottom:0;display:flex;position:absolute;top:0}.smart-nav-bar__left{left:var(--padding-md,16px)}.smart-nav-bar__right{right:var(--padding-md,16px)}
@@ -19,7 +19,7 @@
19
19
  data-index="{{ index }}"
20
20
  custom-class="column-class"
21
21
  value-key="{{ valueKey }}"
22
- style="order: {{ item.order }}; {{ item.style }}"
22
+ style="order: {{ item.order }}; {{ computed.style(item.style) }}"
23
23
  active-style="{{ activeStyle }}"
24
24
  options="{{ item.values }}"
25
25
  unit="{{ item.unit || unit }}"
@@ -39,4 +39,5 @@ module.exports = {
39
39
  frameStyle: frameStyle,
40
40
  maskStyle: maskStyle,
41
41
  columns: columns,
42
+ style: style
42
43
  };
@@ -13,6 +13,10 @@ function kebabCase(word) {
13
13
  }
14
14
 
15
15
  function style(styles) {
16
+ if (typeof styles === 'string') {
17
+ return styles
18
+ }
19
+
16
20
  if (array.isArray(styles)) {
17
21
  return styles
18
22
  .filter(function (item) {
@@ -24,7 +28,7 @@ function style(styles) {
24
28
  .join(';');
25
29
  }
26
30
 
27
- if ('Object' === styles.constructor) {
31
+ if (typeof styles === 'object' && 'Object' === styles.constructor) {
28
32
  return object
29
33
  .keys(styles)
30
34
  .filter(function (key) {
@@ -35,9 +39,6 @@ function style(styles) {
35
39
  })
36
40
  .join(';');
37
41
  }
38
- if (typeof styles === 'string') {
39
- return styles
40
- }
41
42
 
42
43
  return styles || '';
43
44
  }
@@ -143,16 +143,16 @@ var defaultFormatter = function (type, value) {
143
143
  }
144
144
  return this.picker;
145
145
  },
146
- formatterFunc: function (type, value) {
146
+ formatterFunc: function (type, value, data) {
147
147
  var _a;
148
- var _b;
149
- var _c = this.data, formatterMap = _c.formatterMap, _d = _c.formatter, formatter = _d === void 0 ? defaultFormatter : _d;
148
+ var _b, _c;
149
+ var _d = (_b = this === null || this === void 0 ? void 0 : this.data) !== null && _b !== void 0 ? _b : data, formatterMap = _d.formatterMap, _e = _d.formatter, formatter = _e === void 0 ? defaultFormatter : _e;
150
150
  var mapDetail = formatterMap === null || formatterMap === void 0 ? void 0 : formatterMap[type];
151
151
  if (typeof mapDetail === 'string') {
152
152
  return (0, utils_1.replacePlaceholders)(mapDetail, (_a = {}, _a[type] = value, _a));
153
153
  }
154
154
  if (typeof mapDetail === 'object') {
155
- return (_b = mapDetail[value]) !== null && _b !== void 0 ? _b : formatter(type, value);
155
+ return (_c = mapDetail[value]) !== null && _c !== void 0 ? _c : formatter(type, value);
156
156
  }
157
157
  return formatter(type, value);
158
158
  },
@@ -160,7 +160,7 @@ var defaultFormatter = function (type, value) {
160
160
  var _this = this;
161
161
  var locale = this.data.locale;
162
162
  var results = this.getOriginColumns().map(function (column) { return ({
163
- values: column.values.map(function (value) { return _this.formatterFunc(column.type, value); }),
163
+ values: column.values.map(function (value) { return _this.formatterFunc(column.type, value, _this.data); }),
164
164
  order: column.order,
165
165
  unit: locale === null || locale === void 0 ? void 0 : locale[column.type],
166
166
  }); });
@@ -376,25 +376,25 @@ var defaultFormatter = function (type, value) {
376
376
  });
377
377
  values = [
378
378
  part,
379
- formatter('hour', part ? (!hour ? 12 : hour - 12) : hour),
380
- formatter('minute', minute),
379
+ formatter('hour', part ? (!hour ? 12 : hour - 12) : hour, this.data),
380
+ formatter('minute', minute, this.data),
381
381
  ];
382
382
  }
383
383
  else if (type === 'time') {
384
384
  var pair = value.split(':');
385
- values = [formatter('hour', pair[0]), formatter('minute', pair[1])];
385
+ values = [formatter('hour', pair[0], this.data), formatter('minute', pair[1], this.data)];
386
386
  }
387
387
  else {
388
388
  var date = new Date(value);
389
389
  values = [
390
- formatter('year', "".concat(date.getFullYear())),
391
- formatter('month', padZero(date.getMonth() + 1)),
390
+ formatter('year', "".concat(date.getFullYear()), this.data),
391
+ formatter('month', padZero(date.getMonth() + 1), this.data),
392
392
  ];
393
393
  if (type === 'date') {
394
- values.push(formatter('day', padZero(date.getDate())));
394
+ values.push(formatter('day', padZero(date.getDate()), this.data));
395
395
  }
396
396
  if (type === 'datetime') {
397
- values.push(formatter('day', padZero(date.getDate())), formatter('hour', padZero(date.getHours())), formatter('minute', padZero(date.getMinutes())));
397
+ values.push(formatter('day', padZero(date.getDate()), this.data), formatter('hour', padZero(date.getHours()), this.data), formatter('minute', padZero(date.getMinutes()), this.data));
398
398
  }
399
399
  }
400
400
  return this.set({ innerValue: value })
@@ -1 +1 @@
1
- @import '../common/index.css';.smart-nav-bar{background-color:var(--nav-bar-background-color,var(--app-B2,#fff));box-sizing:initial;height:var(--nav-bar-height,46px);line-height:var(--nav-bar-height,46px);position:relative;text-align:center;-webkit-user-select:none;user-select:none}.smart-nav-bar__content{align-items:center;display:flex;height:100%;position:relative}.smart-nav-bar__text{color:var(--nav-bar-text-color,var(--app-B2-N1,#000));display:inline-block;font-size:var(--nav-bar-text-font-size,16px);margin:0 calc(var(--padding-md, 16px)*-1);padding:0 var(--padding-md,16px);vertical-align:middle}.smart-nav-bar__text--hover{opacity:.3}.smart-nav-bar__text--home{color:var(--nav-bar-home-text-color,var(--app-B2-N1,#000));font-size:var(--nav-bar-home-font-size,22px);font-weight:var(--nav-bar-home-font-weight,600)}.smart-nav-bar__text--title{color:var(--nav-bar-title-text-color,var(--app-B2-N1,#000));font-size:var(--nav-bar-title-font-size,16px);font-weight:var(--nav-bar-title-font-weight,600)}.smart-nav-bar__arrow{vertical-align:middle}.smart-nav-bar__arrow>view{background:var(--nav-bar-arrow-color,var(--app-B2-N1,#000))}.smart-nav-bar__icon-wrap{align-items:center;display:flex;height:var(--nav-bar-icon-size,32px);justify-content:center;margin:var(--nav-bar-icon-margin,0);width:var(--nav-bar-icon-size,32px)}.smart-nav-bar__icon>view{background:var(--nav-bar-icon-color,var(--app-B2-N1,#000))}.smart-nav-bar--fixed{left:0;position:fixed;top:0;width:100%}.smart-nav-bar--round{border-radius:var(--nav-bar-round-border-radius,16px 16px 0 0);min-height:var(--nav-bar-round-min-height,56px)}.smart-nav-bar__title{color:var(--nav-bar-title-text-color,var(--app-B2-N1,#000));font-size:var(--nav-bar-title-font-size,16px);font-weight:var(--nav-bar-title-font-weight,600);margin:0 auto;max-width:60%}.smart-nav-bar__left,.smart-nav-bar__right{align-items:center;bottom:0;display:flex;position:absolute;top:0}.smart-nav-bar__left{left:var(--padding-md,16px)}.smart-nav-bar__right{right:var(--padding-md,16px)}
1
+ @import '../common/index.css';.smart-nav-bar{background-color:var(--nav-bar-background-color,var(--app-B2,#fff));box-sizing:initial;height:var(--nav-bar-height,46px);line-height:var(--nav-bar-height,46px);position:relative;text-align:center;-webkit-user-select:none;user-select:none}.smart-nav-bar__content{align-items:center;display:flex;height:100%;position:relative}.smart-nav-bar__text{color:var(--nav-bar-text-color,var(--app-B2-N1,#000));display:inline-block;font-size:var(--nav-bar-text-font-size,16px);margin:0 calc(var(--padding-md, 16px)*-1);padding:0 var(--padding-md,16px);vertical-align:middle}.smart-nav-bar__text--hover{opacity:.3}.smart-nav-bar__text--home{color:var(--nav-bar-home-text-color,var(--app-B2-N1,#000));font-size:var(--nav-bar-home-font-size,22px);font-weight:var(--nav-bar-home-font-weight,600)}.smart-nav-bar__text--title{color:var(--nav-bar-title-text-color,var(--app-B2-N1,#000));font-size:var(--nav-bar-title-font-size,16px);font-weight:var(--nav-bar-title-font-weight,600)}.smart-nav-bar__arrow{vertical-align:middle}.smart-nav-bar__arrow>view{background:var(--nav-bar-arrow-color,var(--app-B2-N1,#000))}.smart-nav-bar__icon-wrap{align-items:center;display:flex;height:var(--nav-bar-icon-size,32px);justify-content:center;margin:var(--nav-bar-icon-margin,0);width:var(--nav-bar-icon-size,32px)}.smart-nav-bar__icon>view{background:var(--nav-bar-icon-color,var(--app-B2-N1,#000))}.smart-nav-bar--safe-top{padding-top:var(--app-device-status-height,20px)}.smart-nav-bar--fixed{left:0;position:fixed;top:0;width:100%}.smart-nav-bar--round{border-radius:var(--nav-bar-round-border-radius,16px 16px 0 0);min-height:var(--nav-bar-round-min-height,56px)}.smart-nav-bar__title{color:var(--nav-bar-title-text-color,var(--app-B2-N1,#000));font-size:var(--nav-bar-title-font-size,16px);font-weight:var(--nav-bar-title-font-weight,600);margin:0 auto;max-width:60%}.smart-nav-bar__left,.smart-nav-bar__right{align-items:center;bottom:0;display:flex;position:absolute;top:0}.smart-nav-bar__left{left:var(--padding-md,16px)}.smart-nav-bar__right{right:var(--padding-md,16px)}
@@ -4,7 +4,7 @@
4
4
  <view wx:if="{{ fixed && placeholder }}" style="height: {{ height }}px;" />
5
5
 
6
6
  <view
7
- class="{{ utils.bem('nav-bar', { fixed, round }) }} custom-class {{ border ? 'smart-hairline--bottom' : '' }}"
7
+ class="{{ utils.bem('nav-bar', { fixed, round, 'safe-top': safeAreaInsetTop }) }} custom-class {{ border ? 'smart-hairline--bottom' : '' }}"
8
8
  style="{{ computed.barStyle({ zIndex, statusBarHeight, safeAreaInsetTop }) }}; {{ customStyle }}"
9
9
  >
10
10
  <view class="smart-nav-bar__content">
@@ -1 +1 @@
1
- @import '../common/index.wxss';.smart-nav-bar{background-color:var(--nav-bar-background-color,var(--app-B2,#fff));box-sizing:initial;height:var(--nav-bar-height,46px);line-height:var(--nav-bar-height,46px);position:relative;text-align:center;-webkit-user-select:none;user-select:none}.smart-nav-bar__content{align-items:center;display:flex;height:100%;position:relative}.smart-nav-bar__text{color:var(--nav-bar-text-color,var(--app-B2-N1,#000));display:inline-block;font-size:var(--nav-bar-text-font-size,16px);margin:0 calc(var(--padding-md, 16px)*-1);padding:0 var(--padding-md,16px);vertical-align:middle}.smart-nav-bar__text--hover{opacity:.3}.smart-nav-bar__text--home{color:var(--nav-bar-home-text-color,var(--app-B2-N1,#000));font-size:var(--nav-bar-home-font-size,22px);font-weight:var(--nav-bar-home-font-weight,600)}.smart-nav-bar__text--title{color:var(--nav-bar-title-text-color,var(--app-B2-N1,#000));font-size:var(--nav-bar-title-font-size,16px);font-weight:var(--nav-bar-title-font-weight,600)}.smart-nav-bar__arrow{vertical-align:middle}.smart-nav-bar__arrow>view{background:var(--nav-bar-arrow-color,var(--app-B2-N1,#000))}.smart-nav-bar__icon-wrap{align-items:center;display:flex;height:var(--nav-bar-icon-size,32px);justify-content:center;margin:var(--nav-bar-icon-margin,0);width:var(--nav-bar-icon-size,32px)}.smart-nav-bar__icon>view{background:var(--nav-bar-icon-color,var(--app-B2-N1,#000))}.smart-nav-bar--fixed{left:0;position:fixed;top:0;width:100%}.smart-nav-bar--round{border-radius:var(--nav-bar-round-border-radius,16px 16px 0 0);min-height:var(--nav-bar-round-min-height,56px)}.smart-nav-bar__title{color:var(--nav-bar-title-text-color,var(--app-B2-N1,#000));font-size:var(--nav-bar-title-font-size,16px);font-weight:var(--nav-bar-title-font-weight,600);margin:0 auto;max-width:60%}.smart-nav-bar__left,.smart-nav-bar__right{align-items:center;bottom:0;display:flex;position:absolute;top:0}.smart-nav-bar__left{left:var(--padding-md,16px)}.smart-nav-bar__right{right:var(--padding-md,16px)}
1
+ @import '../common/index.wxss';.smart-nav-bar{background-color:var(--nav-bar-background-color,var(--app-B2,#fff));box-sizing:initial;height:var(--nav-bar-height,46px);line-height:var(--nav-bar-height,46px);position:relative;text-align:center;-webkit-user-select:none;user-select:none}.smart-nav-bar__content{align-items:center;display:flex;height:100%;position:relative}.smart-nav-bar__text{color:var(--nav-bar-text-color,var(--app-B2-N1,#000));display:inline-block;font-size:var(--nav-bar-text-font-size,16px);margin:0 calc(var(--padding-md, 16px)*-1);padding:0 var(--padding-md,16px);vertical-align:middle}.smart-nav-bar__text--hover{opacity:.3}.smart-nav-bar__text--home{color:var(--nav-bar-home-text-color,var(--app-B2-N1,#000));font-size:var(--nav-bar-home-font-size,22px);font-weight:var(--nav-bar-home-font-weight,600)}.smart-nav-bar__text--title{color:var(--nav-bar-title-text-color,var(--app-B2-N1,#000));font-size:var(--nav-bar-title-font-size,16px);font-weight:var(--nav-bar-title-font-weight,600)}.smart-nav-bar__arrow{vertical-align:middle}.smart-nav-bar__arrow>view{background:var(--nav-bar-arrow-color,var(--app-B2-N1,#000))}.smart-nav-bar__icon-wrap{align-items:center;display:flex;height:var(--nav-bar-icon-size,32px);justify-content:center;margin:var(--nav-bar-icon-margin,0);width:var(--nav-bar-icon-size,32px)}.smart-nav-bar__icon>view{background:var(--nav-bar-icon-color,var(--app-B2-N1,#000))}.smart-nav-bar--safe-top{padding-top:var(--app-device-status-height,20px)}.smart-nav-bar--fixed{left:0;position:fixed;top:0;width:100%}.smart-nav-bar--round{border-radius:var(--nav-bar-round-border-radius,16px 16px 0 0);min-height:var(--nav-bar-round-min-height,56px)}.smart-nav-bar__title{color:var(--nav-bar-title-text-color,var(--app-B2-N1,#000));font-size:var(--nav-bar-title-font-size,16px);font-weight:var(--nav-bar-title-font-weight,600);margin:0 auto;max-width:60%}.smart-nav-bar__left,.smart-nav-bar__right{align-items:center;bottom:0;display:flex;position:absolute;top:0}.smart-nav-bar__left{left:var(--padding-md,16px)}.smart-nav-bar__right{right:var(--padding-md,16px)}
@@ -19,7 +19,7 @@
19
19
  data-index="{{ index }}"
20
20
  custom-class="column-class"
21
21
  value-key="{{ valueKey }}"
22
- style="order: {{ item.order }}; {{ item.style }}"
22
+ style="order: {{ item.order }}; {{ computed.style(item.style) }}"
23
23
  active-style="{{ activeStyle }}"
24
24
  options="{{ item.values }}"
25
25
  unit="{{ item.unit || unit }}"
@@ -39,4 +39,5 @@ module.exports = {
39
39
  frameStyle: frameStyle,
40
40
  maskStyle: maskStyle,
41
41
  columns: columns,
42
+ style: style
42
43
  };
package/lib/wxs/style.wxs CHANGED
@@ -13,6 +13,10 @@ function kebabCase(word) {
13
13
  }
14
14
 
15
15
  function style(styles) {
16
+ if (typeof styles === 'string') {
17
+ return styles
18
+ }
19
+
16
20
  if (array.isArray(styles)) {
17
21
  return styles
18
22
  .filter(function (item) {
@@ -24,7 +28,7 @@ function style(styles) {
24
28
  .join(';');
25
29
  }
26
30
 
27
- if ('Object' === styles.constructor) {
31
+ if (typeof styles === 'object' && 'Object' === styles.constructor) {
28
32
  return object
29
33
  .keys(styles)
30
34
  .filter(function (key) {
@@ -35,9 +39,6 @@ function style(styles) {
35
39
  })
36
40
  .join(';');
37
41
  }
38
- if (typeof styles === 'string') {
39
- return styles
40
- }
41
42
 
42
43
  return styles || '';
43
44
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tuya-miniapp/smart-ui",
3
- "version": "2.1.11-beta-2",
3
+ "version": "2.1.11-beta-4",
4
4
  "author": "MiniApp Team",
5
5
  "license": "MIT",
6
6
  "miniprogram": "lib",