@tuya/miniapp-smart-ui 2.13.5 → 2.13.6-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.
- package/dist/action-sheet/index.wxml +3 -3
- package/dist/datetime-picker/index.js +0 -3
- package/dist/datetime-picker/index.wxml +1 -0
- package/dist/picker/README.md +2 -1
- package/dist/picker/index.js +12 -1
- package/dist/picker/index.wxml +1 -1
- package/dist/picker-column/index.js +3 -1
- package/dist/picker-column/index.wxs +1 -1
- package/dist/switch/index.css +1 -1
- package/dist/switch/index.wxss +1 -1
- package/lib/action-sheet/index.wxml +3 -3
- package/lib/datetime-picker/index.js +0 -9
- package/lib/datetime-picker/index.wxml +1 -0
- package/lib/picker/README.md +2 -1
- package/lib/picker/index.js +12 -1
- package/lib/picker/index.wxml +1 -1
- package/lib/picker-column/index.js +3 -1
- package/lib/picker-column/index.wxs +1 -1
- package/lib/switch/index.css +1 -1
- package/lib/switch/index.wxss +1 -1
- package/package.json +1 -1
|
@@ -21,9 +21,9 @@
|
|
|
21
21
|
bind:leave="onLeave"
|
|
22
22
|
bind:after-leave="onAfterLeave"
|
|
23
23
|
>
|
|
24
|
-
<view wx:if="{{ title
|
|
25
|
-
|
|
26
|
-
<slot
|
|
24
|
+
<view wx:if="{{ title }}" class="smart-action-sheet__header">{{ title }}</view>
|
|
25
|
+
<view wx:elif="{{ useTitleSlot }}" class="smart-action-sheet__header">
|
|
26
|
+
<slot name="title" />
|
|
27
27
|
</view>
|
|
28
28
|
<view wx:if="{{ description }}" class="smart-action-sheet__description smart-hairline--bottom">
|
|
29
29
|
{{ description }}
|
|
@@ -151,9 +151,6 @@ SmartComponent({
|
|
|
151
151
|
getPicker() {
|
|
152
152
|
if (this.picker == null) {
|
|
153
153
|
this.picker = this.selectComponent('.smart-datetime-picker');
|
|
154
|
-
const { picker } = this;
|
|
155
|
-
const { setColumnValues } = picker;
|
|
156
|
-
picker.setColumnValues = (...args) => setColumnValues.apply(picker, [...args, false]);
|
|
157
154
|
}
|
|
158
155
|
return this.picker;
|
|
159
156
|
},
|
package/dist/picker/README.md
CHANGED
|
@@ -284,6 +284,7 @@ Page({
|
|
|
284
284
|
| active-index | 单列选择器的当前选中项索引,<br>多列选择器请参考下方的 Columns 配置 | _number_ | `-1` |
|
|
285
285
|
| cancel-button-text | 取消按钮文字 | _string_ | `取消` |
|
|
286
286
|
| columns | 对象数组,配置每一列显示的数据 | _Array_ | `[]` |
|
|
287
|
+
| auto-reset `v2.13.6` | columns 变化时是否把发生变化的列重置回第 0 项。安卓容器上库内重置会异步覆盖 activeIndex 定位(跨数据源复用滚轮时初始档位丢失),此场景建议传 `false` | _boolean_ | `true` |
|
|
287
288
|
| confirm-button-text | 确认按钮文字 | _string_ | `确认` |
|
|
288
289
|
| default-index | 单列选择器的默认选中项索引,<br>多列选择器请参考下方的 Columns 配置 | _number_ | `0` |
|
|
289
290
|
| item-height | 选项高度 | _number_ | `44` |
|
|
@@ -325,7 +326,7 @@ Picker 组件的事件会根据 columns 是单列或多列返回不同的参数
|
|
|
325
326
|
| style `v2.0.0` | 列的样式 |
|
|
326
327
|
| fontStyle `v2.3.5` | 列的文字样式 |
|
|
327
328
|
| unit | 列对应的单位,默认为空 |
|
|
328
|
-
| unitGap `v2.10.0` | 单位和值的间隔,默认为
|
|
329
|
+
| unitGap `v2.10.0` | 单位和值的间隔,默认为 ''(使用 CSS 默认样式),支持传入数字(自动添加 px 单位)或字符串(如 "8rpx") | _string \| number_ | `''` |
|
|
329
330
|
| values | 列中对应的备选值 |
|
|
330
331
|
| order `v2.2.0` | 设置列的顺序,同`flex order`属性,只是从样式角度修改列的顺序,逻辑还是不变 | _number_ | - |
|
|
331
332
|
| disabled `v2.3.5` | 禁用此列 | _boolean_ | `false` |
|
package/dist/picker/index.js
CHANGED
|
@@ -40,6 +40,15 @@ SmartComponent({
|
|
|
40
40
|
this.setColumns().catch(() => { });
|
|
41
41
|
}
|
|
42
42
|
},
|
|
43
|
+
},
|
|
44
|
+
/**
|
|
45
|
+
* 列数据(columns)变化时,是否把发生变化的列重置回第 0 项。默认 true 保持历史行为。
|
|
46
|
+
* 传 false 后定位由各列 activeIndex 驱动——安卓容器上库内重置(setIndex(0))会
|
|
47
|
+
* 异步覆盖 activeIndex 定位,跨数据源复用滚轮时初始档位丢失,此场景建议传 false。
|
|
48
|
+
*/
|
|
49
|
+
autoReset: {
|
|
50
|
+
type: Boolean,
|
|
51
|
+
value: true,
|
|
43
52
|
} }),
|
|
44
53
|
data: {
|
|
45
54
|
animating: false,
|
|
@@ -157,7 +166,9 @@ SmartComponent({
|
|
|
157
166
|
if (this._windows[index] && this._windows[index].windowed) {
|
|
158
167
|
return Promise.resolve();
|
|
159
168
|
}
|
|
160
|
-
|
|
169
|
+
// autoReset=false 时定位由各列 activeIndex 驱动:安卓容器上库内重置
|
|
170
|
+
// (setIndex(0))会异步覆盖 activeIndex 定位,跨数据源复用滚轮时档位丢失
|
|
171
|
+
return this.setColumnValues(index, column.values, this.data.autoReset);
|
|
161
172
|
});
|
|
162
173
|
return Promise.all(stack);
|
|
163
174
|
},
|
package/dist/picker/index.wxml
CHANGED
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
windowed="{{ item._windowed || false }}"
|
|
28
28
|
disabled="{{ item.disabled || false }}"
|
|
29
29
|
unit="{{ item.unit || unit }}"
|
|
30
|
-
unit-gap="{{ item.unitGap }}"
|
|
30
|
+
unit-gap="{{ item.unitGap === undefined || item.unitGap === null ? '' : item.unitGap }}"
|
|
31
31
|
changeAnimation="{{ changeAnimation }}"
|
|
32
32
|
default-index="{{ item.defaultIndex || defaultIndex }}"
|
|
33
33
|
active-index="{{ (item.activeIndex === null || item.activeIndex === undefined) ? activeIndex : item.activeIndex }}"
|
|
@@ -4,7 +4,7 @@ var addUnit = require('../wxs/add-unit.wxs');
|
|
|
4
4
|
var wxUtils = require('../wxs/utils.wxs');
|
|
5
5
|
|
|
6
6
|
function unitGapStyle(unitGap) {
|
|
7
|
-
if (unitGap === undefined || unitGap === null) {
|
|
7
|
+
if (unitGap === undefined || unitGap === null || unitGap === '') {
|
|
8
8
|
return '';
|
|
9
9
|
}
|
|
10
10
|
return style({
|
package/dist/switch/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
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:var(--app-B4,#fff);--smart-ui-border-image:linear-gradient(90deg,transparent,rgba(0,0,0,.3),transparent);--smart-ui-battery-body-base-background:rgba(0,0,0,.25);--smart-ui-battery-text-color:rgba(0,0,0,.6);--smart-ui-battery-slash-border-color:#fff;--smart-ui-toast-background:#5c5c5c;--smart-ui-toast-border:1px solid hsla(0,0%,100%,.05);--smart-ui-toast-box-shadow:0 4px 12px rgba(0,0,0,.1),0 16px 32px rgba(0,0,0,.12);--smart-ui-overlay-blur-background:rgba(40,44,53,.22)}:root[theme=dark]{--smart-ui-overlay:rgba(0,0,0,.7);--smart-ui-bottom-sheet-dragger-node-background:hsla(0,0%,100%,.3);--smart-ui-dialog-background:linear-gradient(0deg,var(--app-B4-N6),var(--app-B4-N6)),var(--app-B1);--smart-ui-border-image:linear-gradient(90deg,hsla(0,0%,100%,0),hsla(0,0%,100%,.3),hsla(0,0%,100%,0));--smart-ui-battery-body-base-background:hsla(0,0%,100%,.4);--smart-ui-battery-text-color:#fff;--smart-ui-battery-slash-border-color:#000;--smart-ui-toast-background:#3c3c3c;--smart-ui-toast-border:1px solid hsla(0,0%,100%,.05);--smart-ui-toast-box-shadow:0 8px 24px 0 rgba(0,0,0,.15);--smart-ui-overlay-blur-background:rgba(0,0,0,.6)}.smart-manrope{font-family:Manrope,sans-serif}:host{display:inline-flex}.smart-switch{background-color:var(--switch-background-color,var(--app-B4-N6,rgba(0,0,0,.2)));border-radius:var(--switch-node-size,.867em);box-sizing:initial;display:inline-block;height:var(--switch-height,.867em);padding:var(--switch-border,var(--switch-padding,.067em));position:relative;transition:background-color var(--switch-transition-duration,.3s);vertical-align:middle;width:var(--switch-width,1.5338em)}.smart-switch--label{width:var(--switch-label-width,2em)}.smart-switch__center{box-sizing:initial;height:100%;position:relative;width:100%}.smart-switch__label_active{align-items:center;color:var(--switch-label-active-color,#fff);display:flex;height:100%;justify-content:center;left:0;padding-left:var(--switch-border,var(--switch-padding,.067em));position:absolute;text-align:center;top:0;width:calc(100% - var(--switch-node-size, .867em))}.smart-switch__label_active .smart-switch__label_text{font-size:var(--switch-label-font-size,13px)}.smart-switch__label_inactive{align-items:center;color:var(--switch-label-inactive-color,#fff);display:flex;height:100%;justify-content:center;padding-right:var(--switch-border,var(--switch-padding,.067em));position:absolute;right:0;text-align:center;top:0;width:calc(100% - var(--switch-node-size, .867em))}.smart-switch__label_inactive .smart-switch__label_text{font-size:var(--switch-label-font-size,13px)}.smart-switch__node{background-color:var(--switch-node-background-color,#fff);border-radius:100%;box-shadow:var(--switch-node-box-shadow,0 3px 1px 0 rgba(0,0,0,.05),0 2px 2px 0 rgba(0,0,0,.1),0 3px 3px 0 rgba(0,0,0,.05));height:var(--switch-node-size,.867em);left:
|
|
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:var(--app-B4,#fff);--smart-ui-border-image:linear-gradient(90deg,transparent,rgba(0,0,0,.3),transparent);--smart-ui-battery-body-base-background:rgba(0,0,0,.25);--smart-ui-battery-text-color:rgba(0,0,0,.6);--smart-ui-battery-slash-border-color:#fff;--smart-ui-toast-background:#5c5c5c;--smart-ui-toast-border:1px solid hsla(0,0%,100%,.05);--smart-ui-toast-box-shadow:0 4px 12px rgba(0,0,0,.1),0 16px 32px rgba(0,0,0,.12);--smart-ui-overlay-blur-background:rgba(40,44,53,.22)}:root[theme=dark]{--smart-ui-overlay:rgba(0,0,0,.7);--smart-ui-bottom-sheet-dragger-node-background:hsla(0,0%,100%,.3);--smart-ui-dialog-background:linear-gradient(0deg,var(--app-B4-N6),var(--app-B4-N6)),var(--app-B1);--smart-ui-border-image:linear-gradient(90deg,hsla(0,0%,100%,0),hsla(0,0%,100%,.3),hsla(0,0%,100%,0));--smart-ui-battery-body-base-background:hsla(0,0%,100%,.4);--smart-ui-battery-text-color:#fff;--smart-ui-battery-slash-border-color:#000;--smart-ui-toast-background:#3c3c3c;--smart-ui-toast-border:1px solid hsla(0,0%,100%,.05);--smart-ui-toast-box-shadow:0 8px 24px 0 rgba(0,0,0,.15);--smart-ui-overlay-blur-background:rgba(0,0,0,.6)}.smart-manrope{font-family:Manrope,sans-serif}:host{display:inline-flex}.smart-switch{background-color:var(--switch-background-color,var(--app-B4-N6,rgba(0,0,0,.2)));border-radius:var(--switch-node-size,.867em);box-sizing:initial;display:inline-block;height:var(--switch-height,.867em);padding:var(--switch-border,var(--switch-padding,.067em));position:relative;transition:background-color var(--switch-transition-duration,.3s);vertical-align:middle;width:var(--switch-width,1.5338em)}.smart-switch--label{width:var(--switch-label-width,2em)}.smart-switch__center{box-sizing:initial;height:100%;position:relative;width:100%}.smart-switch__label_active{align-items:center;color:var(--switch-label-active-color,#fff);display:flex;height:100%;justify-content:center;left:0;padding-left:var(--switch-border,var(--switch-padding,.067em));position:absolute;text-align:center;top:0;width:calc(100% - var(--switch-node-size, .867em))}.smart-switch__label_active .smart-switch__label_text{font-size:var(--switch-label-font-size,13px)}.smart-switch__label_inactive{align-items:center;color:var(--switch-label-inactive-color,#fff);display:flex;height:100%;justify-content:center;padding-right:var(--switch-border,var(--switch-padding,.067em));position:absolute;right:0;text-align:center;top:0;width:calc(100% - var(--switch-node-size, .867em))}.smart-switch__label_inactive .smart-switch__label_text{font-size:var(--switch-label-font-size,13px)}.smart-switch__node{background-color:var(--switch-node-background-color,#fff);border-radius:100%;box-shadow:var(--switch-node-box-shadow,0 3px 1px 0 rgba(0,0,0,.05),0 2px 2px 0 rgba(0,0,0,.1),0 3px 3px 0 rgba(0,0,0,.05));height:var(--switch-node-size,.867em);left:var(--switch-node-size,.867em);position:absolute;top:0;transform:translate3d(-100%,0,0);transition:left var(--switch-transition-duration,.3s) cubic-bezier(.3,1.05,.4,1.05),background-color var(--switch-transition-duration,.3s);width:var(--switch-node-size,.867em);will-change:left;z-index:var(--switch-node-z-index,0)}.smart-switch__loading{left:50%;position:absolute!important;top:50%;transform:translate(-50%,-50%)}.smart-switch--on{background-color:var(--switch-on-background-color,#1989fa)}.smart-switch--on .smart-switch__node{background-color:var(--switch-node-on-background-color,var(--switch-node-background-color,#fff));left:100%}.smart-switch--disabled{opacity:var(--switch-disabled-opacity,.4)}
|
package/dist/switch/index.wxss
CHANGED
|
@@ -1 +1 @@
|
|
|
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:var(--app-B4,#fff);--smart-ui-border-image:linear-gradient(90deg,transparent,rgba(0,0,0,.3),transparent);--smart-ui-battery-body-base-background:rgba(0,0,0,.25);--smart-ui-battery-text-color:rgba(0,0,0,.6);--smart-ui-battery-slash-border-color:#fff;--smart-ui-toast-background:#5c5c5c;--smart-ui-toast-border:1px solid hsla(0,0%,100%,.05);--smart-ui-toast-box-shadow:0 4px 12px rgba(0,0,0,.1),0 16px 32px rgba(0,0,0,.12);--smart-ui-overlay-blur-background:rgba(40,44,53,.22)}:root[theme=dark]{--smart-ui-overlay:rgba(0,0,0,.7);--smart-ui-bottom-sheet-dragger-node-background:hsla(0,0%,100%,.3);--smart-ui-dialog-background:linear-gradient(0deg,var(--app-B4-N6),var(--app-B4-N6)),var(--app-B1);--smart-ui-border-image:linear-gradient(90deg,hsla(0,0%,100%,0),hsla(0,0%,100%,.3),hsla(0,0%,100%,0));--smart-ui-battery-body-base-background:hsla(0,0%,100%,.4);--smart-ui-battery-text-color:#fff;--smart-ui-battery-slash-border-color:#000;--smart-ui-toast-background:#3c3c3c;--smart-ui-toast-border:1px solid hsla(0,0%,100%,.05);--smart-ui-toast-box-shadow:0 8px 24px 0 rgba(0,0,0,.15);--smart-ui-overlay-blur-background:rgba(0,0,0,.6)}.smart-manrope{font-family:Manrope,sans-serif}:host{display:inline-flex}.smart-switch{background-color:var(--switch-background-color,var(--app-B4-N6,rgba(0,0,0,.2)));border-radius:var(--switch-node-size,.867em);box-sizing:initial;display:inline-block;height:var(--switch-height,.867em);padding:var(--switch-border,var(--switch-padding,.067em));position:relative;transition:background-color var(--switch-transition-duration,.3s);vertical-align:middle;width:var(--switch-width,1.5338em)}.smart-switch--label{width:var(--switch-label-width,2em)}.smart-switch__center{box-sizing:initial;height:100%;position:relative;width:100%}.smart-switch__label_active{align-items:center;color:var(--switch-label-active-color,#fff);display:flex;height:100%;justify-content:center;left:0;padding-left:var(--switch-border,var(--switch-padding,.067em));position:absolute;text-align:center;top:0;width:calc(100% - var(--switch-node-size, .867em))}.smart-switch__label_active .smart-switch__label_text{font-size:var(--switch-label-font-size,13px)}.smart-switch__label_inactive{align-items:center;color:var(--switch-label-inactive-color,#fff);display:flex;height:100%;justify-content:center;padding-right:var(--switch-border,var(--switch-padding,.067em));position:absolute;right:0;text-align:center;top:0;width:calc(100% - var(--switch-node-size, .867em))}.smart-switch__label_inactive .smart-switch__label_text{font-size:var(--switch-label-font-size,13px)}.smart-switch__node{background-color:var(--switch-node-background-color,#fff);border-radius:100%;box-shadow:var(--switch-node-box-shadow,0 3px 1px 0 rgba(0,0,0,.05),0 2px 2px 0 rgba(0,0,0,.1),0 3px 3px 0 rgba(0,0,0,.05));height:var(--switch-node-size,.867em);left:
|
|
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:var(--app-B4,#fff);--smart-ui-border-image:linear-gradient(90deg,transparent,rgba(0,0,0,.3),transparent);--smart-ui-battery-body-base-background:rgba(0,0,0,.25);--smart-ui-battery-text-color:rgba(0,0,0,.6);--smart-ui-battery-slash-border-color:#fff;--smart-ui-toast-background:#5c5c5c;--smart-ui-toast-border:1px solid hsla(0,0%,100%,.05);--smart-ui-toast-box-shadow:0 4px 12px rgba(0,0,0,.1),0 16px 32px rgba(0,0,0,.12);--smart-ui-overlay-blur-background:rgba(40,44,53,.22)}:root[theme=dark]{--smart-ui-overlay:rgba(0,0,0,.7);--smart-ui-bottom-sheet-dragger-node-background:hsla(0,0%,100%,.3);--smart-ui-dialog-background:linear-gradient(0deg,var(--app-B4-N6),var(--app-B4-N6)),var(--app-B1);--smart-ui-border-image:linear-gradient(90deg,hsla(0,0%,100%,0),hsla(0,0%,100%,.3),hsla(0,0%,100%,0));--smart-ui-battery-body-base-background:hsla(0,0%,100%,.4);--smart-ui-battery-text-color:#fff;--smart-ui-battery-slash-border-color:#000;--smart-ui-toast-background:#3c3c3c;--smart-ui-toast-border:1px solid hsla(0,0%,100%,.05);--smart-ui-toast-box-shadow:0 8px 24px 0 rgba(0,0,0,.15);--smart-ui-overlay-blur-background:rgba(0,0,0,.6)}.smart-manrope{font-family:Manrope,sans-serif}:host{display:inline-flex}.smart-switch{background-color:var(--switch-background-color,var(--app-B4-N6,rgba(0,0,0,.2)));border-radius:var(--switch-node-size,.867em);box-sizing:initial;display:inline-block;height:var(--switch-height,.867em);padding:var(--switch-border,var(--switch-padding,.067em));position:relative;transition:background-color var(--switch-transition-duration,.3s);vertical-align:middle;width:var(--switch-width,1.5338em)}.smart-switch--label{width:var(--switch-label-width,2em)}.smart-switch__center{box-sizing:initial;height:100%;position:relative;width:100%}.smart-switch__label_active{align-items:center;color:var(--switch-label-active-color,#fff);display:flex;height:100%;justify-content:center;left:0;padding-left:var(--switch-border,var(--switch-padding,.067em));position:absolute;text-align:center;top:0;width:calc(100% - var(--switch-node-size, .867em))}.smart-switch__label_active .smart-switch__label_text{font-size:var(--switch-label-font-size,13px)}.smart-switch__label_inactive{align-items:center;color:var(--switch-label-inactive-color,#fff);display:flex;height:100%;justify-content:center;padding-right:var(--switch-border,var(--switch-padding,.067em));position:absolute;right:0;text-align:center;top:0;width:calc(100% - var(--switch-node-size, .867em))}.smart-switch__label_inactive .smart-switch__label_text{font-size:var(--switch-label-font-size,13px)}.smart-switch__node{background-color:var(--switch-node-background-color,#fff);border-radius:100%;box-shadow:var(--switch-node-box-shadow,0 3px 1px 0 rgba(0,0,0,.05),0 2px 2px 0 rgba(0,0,0,.1),0 3px 3px 0 rgba(0,0,0,.05));height:var(--switch-node-size,.867em);left:var(--switch-node-size,.867em);position:absolute;top:0;transform:translate3d(-100%,0,0);transition:left var(--switch-transition-duration,.3s) cubic-bezier(.3,1.05,.4,1.05),background-color var(--switch-transition-duration,.3s);width:var(--switch-node-size,.867em);will-change:left;z-index:var(--switch-node-z-index,0)}.smart-switch__loading{left:50%;position:absolute!important;top:50%;transform:translate(-50%,-50%)}.smart-switch--on{background-color:var(--switch-on-background-color,#1989fa)}.smart-switch--on .smart-switch__node{background-color:var(--switch-node-on-background-color,var(--switch-node-background-color,#fff));left:100%}.smart-switch--disabled{opacity:var(--switch-disabled-opacity,.4)}
|
|
@@ -21,9 +21,9 @@
|
|
|
21
21
|
bind:leave="onLeave"
|
|
22
22
|
bind:after-leave="onAfterLeave"
|
|
23
23
|
>
|
|
24
|
-
<view wx:if="{{ title
|
|
25
|
-
|
|
26
|
-
<slot
|
|
24
|
+
<view wx:if="{{ title }}" class="smart-action-sheet__header">{{ title }}</view>
|
|
25
|
+
<view wx:elif="{{ useTitleSlot }}" class="smart-action-sheet__header">
|
|
26
|
+
<slot name="title" />
|
|
27
27
|
</view>
|
|
28
28
|
<view wx:if="{{ description }}" class="smart-action-sheet__description smart-hairline--bottom">
|
|
29
29
|
{{ description }}
|
|
@@ -175,15 +175,6 @@ var defaultFormatter = function (type, value) {
|
|
|
175
175
|
getPicker: function () {
|
|
176
176
|
if (this.picker == null) {
|
|
177
177
|
this.picker = this.selectComponent('.smart-datetime-picker');
|
|
178
|
-
var picker_1 = this.picker;
|
|
179
|
-
var setColumnValues_1 = picker_1.setColumnValues;
|
|
180
|
-
picker_1.setColumnValues = function () {
|
|
181
|
-
var args = [];
|
|
182
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
183
|
-
args[_i] = arguments[_i];
|
|
184
|
-
}
|
|
185
|
-
return setColumnValues_1.apply(picker_1, __spreadArray(__spreadArray([], args, true), [false], false));
|
|
186
|
-
};
|
|
187
178
|
}
|
|
188
179
|
return this.picker;
|
|
189
180
|
},
|
package/lib/picker/README.md
CHANGED
|
@@ -284,6 +284,7 @@ Page({
|
|
|
284
284
|
| active-index | 单列选择器的当前选中项索引,<br>多列选择器请参考下方的 Columns 配置 | _number_ | `-1` |
|
|
285
285
|
| cancel-button-text | 取消按钮文字 | _string_ | `取消` |
|
|
286
286
|
| columns | 对象数组,配置每一列显示的数据 | _Array_ | `[]` |
|
|
287
|
+
| auto-reset `v2.13.6` | columns 变化时是否把发生变化的列重置回第 0 项。安卓容器上库内重置会异步覆盖 activeIndex 定位(跨数据源复用滚轮时初始档位丢失),此场景建议传 `false` | _boolean_ | `true` |
|
|
287
288
|
| confirm-button-text | 确认按钮文字 | _string_ | `确认` |
|
|
288
289
|
| default-index | 单列选择器的默认选中项索引,<br>多列选择器请参考下方的 Columns 配置 | _number_ | `0` |
|
|
289
290
|
| item-height | 选项高度 | _number_ | `44` |
|
|
@@ -325,7 +326,7 @@ Picker 组件的事件会根据 columns 是单列或多列返回不同的参数
|
|
|
325
326
|
| style `v2.0.0` | 列的样式 |
|
|
326
327
|
| fontStyle `v2.3.5` | 列的文字样式 |
|
|
327
328
|
| unit | 列对应的单位,默认为空 |
|
|
328
|
-
| unitGap `v2.10.0` | 单位和值的间隔,默认为
|
|
329
|
+
| unitGap `v2.10.0` | 单位和值的间隔,默认为 ''(使用 CSS 默认样式),支持传入数字(自动添加 px 单位)或字符串(如 "8rpx") | _string \| number_ | `''` |
|
|
329
330
|
| values | 列中对应的备选值 |
|
|
330
331
|
| order `v2.2.0` | 设置列的顺序,同`flex order`属性,只是从样式角度修改列的顺序,逻辑还是不变 | _number_ | - |
|
|
331
332
|
| disabled `v2.3.5` | 禁用此列 | _boolean_ | `false` |
|
package/lib/picker/index.js
CHANGED
|
@@ -54,6 +54,15 @@ var clamp = function (value, min, max) { return Math.min(Math.max(value, min), m
|
|
|
54
54
|
this.setColumns().catch(function () { });
|
|
55
55
|
}
|
|
56
56
|
},
|
|
57
|
+
},
|
|
58
|
+
/**
|
|
59
|
+
* 列数据(columns)变化时,是否把发生变化的列重置回第 0 项。默认 true 保持历史行为。
|
|
60
|
+
* 传 false 后定位由各列 activeIndex 驱动——安卓容器上库内重置(setIndex(0))会
|
|
61
|
+
* 异步覆盖 activeIndex 定位,跨数据源复用滚轮时初始档位丢失,此场景建议传 false。
|
|
62
|
+
*/
|
|
63
|
+
autoReset: {
|
|
64
|
+
type: Boolean,
|
|
65
|
+
value: true,
|
|
57
66
|
} }),
|
|
58
67
|
data: {
|
|
59
68
|
animating: false,
|
|
@@ -176,7 +185,9 @@ var clamp = function (value, min, max) { return Math.min(Math.max(value, min), m
|
|
|
176
185
|
if (_this._windows[index] && _this._windows[index].windowed) {
|
|
177
186
|
return Promise.resolve();
|
|
178
187
|
}
|
|
179
|
-
|
|
188
|
+
// autoReset=false 时定位由各列 activeIndex 驱动:安卓容器上库内重置
|
|
189
|
+
// (setIndex(0))会异步覆盖 activeIndex 定位,跨数据源复用滚轮时档位丢失
|
|
190
|
+
return _this.setColumnValues(index, column.values, _this.data.autoReset);
|
|
180
191
|
});
|
|
181
192
|
return Promise.all(stack);
|
|
182
193
|
},
|
package/lib/picker/index.wxml
CHANGED
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
windowed="{{ item._windowed || false }}"
|
|
28
28
|
disabled="{{ item.disabled || false }}"
|
|
29
29
|
unit="{{ item.unit || unit }}"
|
|
30
|
-
unit-gap="{{ item.unitGap }}"
|
|
30
|
+
unit-gap="{{ item.unitGap === undefined || item.unitGap === null ? '' : item.unitGap }}"
|
|
31
31
|
changeAnimation="{{ changeAnimation }}"
|
|
32
32
|
default-index="{{ item.defaultIndex || defaultIndex }}"
|
|
33
33
|
active-index="{{ (item.activeIndex === null || item.activeIndex === undefined) ? activeIndex : item.activeIndex }}"
|
|
@@ -4,7 +4,7 @@ var addUnit = require('../wxs/add-unit.wxs');
|
|
|
4
4
|
var wxUtils = require('../wxs/utils.wxs');
|
|
5
5
|
|
|
6
6
|
function unitGapStyle(unitGap) {
|
|
7
|
-
if (unitGap === undefined || unitGap === null) {
|
|
7
|
+
if (unitGap === undefined || unitGap === null || unitGap === '') {
|
|
8
8
|
return '';
|
|
9
9
|
}
|
|
10
10
|
return style({
|
package/lib/switch/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
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:var(--app-B4,#fff);--smart-ui-border-image:linear-gradient(90deg,transparent,rgba(0,0,0,.3),transparent);--smart-ui-battery-body-base-background:rgba(0,0,0,.25);--smart-ui-battery-text-color:rgba(0,0,0,.6);--smart-ui-battery-slash-border-color:#fff;--smart-ui-toast-background:#5c5c5c;--smart-ui-toast-border:1px solid hsla(0,0%,100%,.05);--smart-ui-toast-box-shadow:0 4px 12px rgba(0,0,0,.1),0 16px 32px rgba(0,0,0,.12);--smart-ui-overlay-blur-background:rgba(40,44,53,.22)}:root[theme=dark]{--smart-ui-overlay:rgba(0,0,0,.7);--smart-ui-bottom-sheet-dragger-node-background:hsla(0,0%,100%,.3);--smart-ui-dialog-background:linear-gradient(0deg,var(--app-B4-N6),var(--app-B4-N6)),var(--app-B1);--smart-ui-border-image:linear-gradient(90deg,hsla(0,0%,100%,0),hsla(0,0%,100%,.3),hsla(0,0%,100%,0));--smart-ui-battery-body-base-background:hsla(0,0%,100%,.4);--smart-ui-battery-text-color:#fff;--smart-ui-battery-slash-border-color:#000;--smart-ui-toast-background:#3c3c3c;--smart-ui-toast-border:1px solid hsla(0,0%,100%,.05);--smart-ui-toast-box-shadow:0 8px 24px 0 rgba(0,0,0,.15);--smart-ui-overlay-blur-background:rgba(0,0,0,.6)}.smart-manrope{font-family:Manrope,sans-serif}:host{display:inline-flex}.smart-switch{background-color:var(--switch-background-color,var(--app-B4-N6,rgba(0,0,0,.2)));border-radius:var(--switch-node-size,.867em);box-sizing:initial;display:inline-block;height:var(--switch-height,.867em);padding:var(--switch-border,var(--switch-padding,.067em));position:relative;transition:background-color var(--switch-transition-duration,.3s);vertical-align:middle;width:var(--switch-width,1.5338em)}.smart-switch--label{width:var(--switch-label-width,2em)}.smart-switch__center{box-sizing:initial;height:100%;position:relative;width:100%}.smart-switch__label_active{align-items:center;color:var(--switch-label-active-color,#fff);display:flex;height:100%;justify-content:center;left:0;padding-left:var(--switch-border,var(--switch-padding,.067em));position:absolute;text-align:center;top:0;width:calc(100% - var(--switch-node-size, .867em))}.smart-switch__label_active .smart-switch__label_text{font-size:var(--switch-label-font-size,13px)}.smart-switch__label_inactive{align-items:center;color:var(--switch-label-inactive-color,#fff);display:flex;height:100%;justify-content:center;padding-right:var(--switch-border,var(--switch-padding,.067em));position:absolute;right:0;text-align:center;top:0;width:calc(100% - var(--switch-node-size, .867em))}.smart-switch__label_inactive .smart-switch__label_text{font-size:var(--switch-label-font-size,13px)}.smart-switch__node{background-color:var(--switch-node-background-color,#fff);border-radius:100%;box-shadow:var(--switch-node-box-shadow,0 3px 1px 0 rgba(0,0,0,.05),0 2px 2px 0 rgba(0,0,0,.1),0 3px 3px 0 rgba(0,0,0,.05));height:var(--switch-node-size,.867em);left:
|
|
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:var(--app-B4,#fff);--smart-ui-border-image:linear-gradient(90deg,transparent,rgba(0,0,0,.3),transparent);--smart-ui-battery-body-base-background:rgba(0,0,0,.25);--smart-ui-battery-text-color:rgba(0,0,0,.6);--smart-ui-battery-slash-border-color:#fff;--smart-ui-toast-background:#5c5c5c;--smart-ui-toast-border:1px solid hsla(0,0%,100%,.05);--smart-ui-toast-box-shadow:0 4px 12px rgba(0,0,0,.1),0 16px 32px rgba(0,0,0,.12);--smart-ui-overlay-blur-background:rgba(40,44,53,.22)}:root[theme=dark]{--smart-ui-overlay:rgba(0,0,0,.7);--smart-ui-bottom-sheet-dragger-node-background:hsla(0,0%,100%,.3);--smart-ui-dialog-background:linear-gradient(0deg,var(--app-B4-N6),var(--app-B4-N6)),var(--app-B1);--smart-ui-border-image:linear-gradient(90deg,hsla(0,0%,100%,0),hsla(0,0%,100%,.3),hsla(0,0%,100%,0));--smart-ui-battery-body-base-background:hsla(0,0%,100%,.4);--smart-ui-battery-text-color:#fff;--smart-ui-battery-slash-border-color:#000;--smart-ui-toast-background:#3c3c3c;--smart-ui-toast-border:1px solid hsla(0,0%,100%,.05);--smart-ui-toast-box-shadow:0 8px 24px 0 rgba(0,0,0,.15);--smart-ui-overlay-blur-background:rgba(0,0,0,.6)}.smart-manrope{font-family:Manrope,sans-serif}:host{display:inline-flex}.smart-switch{background-color:var(--switch-background-color,var(--app-B4-N6,rgba(0,0,0,.2)));border-radius:var(--switch-node-size,.867em);box-sizing:initial;display:inline-block;height:var(--switch-height,.867em);padding:var(--switch-border,var(--switch-padding,.067em));position:relative;transition:background-color var(--switch-transition-duration,.3s);vertical-align:middle;width:var(--switch-width,1.5338em)}.smart-switch--label{width:var(--switch-label-width,2em)}.smart-switch__center{box-sizing:initial;height:100%;position:relative;width:100%}.smart-switch__label_active{align-items:center;color:var(--switch-label-active-color,#fff);display:flex;height:100%;justify-content:center;left:0;padding-left:var(--switch-border,var(--switch-padding,.067em));position:absolute;text-align:center;top:0;width:calc(100% - var(--switch-node-size, .867em))}.smart-switch__label_active .smart-switch__label_text{font-size:var(--switch-label-font-size,13px)}.smart-switch__label_inactive{align-items:center;color:var(--switch-label-inactive-color,#fff);display:flex;height:100%;justify-content:center;padding-right:var(--switch-border,var(--switch-padding,.067em));position:absolute;right:0;text-align:center;top:0;width:calc(100% - var(--switch-node-size, .867em))}.smart-switch__label_inactive .smart-switch__label_text{font-size:var(--switch-label-font-size,13px)}.smart-switch__node{background-color:var(--switch-node-background-color,#fff);border-radius:100%;box-shadow:var(--switch-node-box-shadow,0 3px 1px 0 rgba(0,0,0,.05),0 2px 2px 0 rgba(0,0,0,.1),0 3px 3px 0 rgba(0,0,0,.05));height:var(--switch-node-size,.867em);left:var(--switch-node-size,.867em);position:absolute;top:0;transform:translate3d(-100%,0,0);transition:left var(--switch-transition-duration,.3s) cubic-bezier(.3,1.05,.4,1.05),background-color var(--switch-transition-duration,.3s);width:var(--switch-node-size,.867em);will-change:left;z-index:var(--switch-node-z-index,0)}.smart-switch__loading{left:50%;position:absolute!important;top:50%;transform:translate(-50%,-50%)}.smart-switch--on{background-color:var(--switch-on-background-color,#1989fa)}.smart-switch--on .smart-switch__node{background-color:var(--switch-node-on-background-color,var(--switch-node-background-color,#fff));left:100%}.smart-switch--disabled{opacity:var(--switch-disabled-opacity,.4)}
|
package/lib/switch/index.wxss
CHANGED
|
@@ -1 +1 @@
|
|
|
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:var(--app-B4,#fff);--smart-ui-border-image:linear-gradient(90deg,transparent,rgba(0,0,0,.3),transparent);--smart-ui-battery-body-base-background:rgba(0,0,0,.25);--smart-ui-battery-text-color:rgba(0,0,0,.6);--smart-ui-battery-slash-border-color:#fff;--smart-ui-toast-background:#5c5c5c;--smart-ui-toast-border:1px solid hsla(0,0%,100%,.05);--smart-ui-toast-box-shadow:0 4px 12px rgba(0,0,0,.1),0 16px 32px rgba(0,0,0,.12);--smart-ui-overlay-blur-background:rgba(40,44,53,.22)}:root[theme=dark]{--smart-ui-overlay:rgba(0,0,0,.7);--smart-ui-bottom-sheet-dragger-node-background:hsla(0,0%,100%,.3);--smart-ui-dialog-background:linear-gradient(0deg,var(--app-B4-N6),var(--app-B4-N6)),var(--app-B1);--smart-ui-border-image:linear-gradient(90deg,hsla(0,0%,100%,0),hsla(0,0%,100%,.3),hsla(0,0%,100%,0));--smart-ui-battery-body-base-background:hsla(0,0%,100%,.4);--smart-ui-battery-text-color:#fff;--smart-ui-battery-slash-border-color:#000;--smart-ui-toast-background:#3c3c3c;--smart-ui-toast-border:1px solid hsla(0,0%,100%,.05);--smart-ui-toast-box-shadow:0 8px 24px 0 rgba(0,0,0,.15);--smart-ui-overlay-blur-background:rgba(0,0,0,.6)}.smart-manrope{font-family:Manrope,sans-serif}:host{display:inline-flex}.smart-switch{background-color:var(--switch-background-color,var(--app-B4-N6,rgba(0,0,0,.2)));border-radius:var(--switch-node-size,.867em);box-sizing:initial;display:inline-block;height:var(--switch-height,.867em);padding:var(--switch-border,var(--switch-padding,.067em));position:relative;transition:background-color var(--switch-transition-duration,.3s);vertical-align:middle;width:var(--switch-width,1.5338em)}.smart-switch--label{width:var(--switch-label-width,2em)}.smart-switch__center{box-sizing:initial;height:100%;position:relative;width:100%}.smart-switch__label_active{align-items:center;color:var(--switch-label-active-color,#fff);display:flex;height:100%;justify-content:center;left:0;padding-left:var(--switch-border,var(--switch-padding,.067em));position:absolute;text-align:center;top:0;width:calc(100% - var(--switch-node-size, .867em))}.smart-switch__label_active .smart-switch__label_text{font-size:var(--switch-label-font-size,13px)}.smart-switch__label_inactive{align-items:center;color:var(--switch-label-inactive-color,#fff);display:flex;height:100%;justify-content:center;padding-right:var(--switch-border,var(--switch-padding,.067em));position:absolute;right:0;text-align:center;top:0;width:calc(100% - var(--switch-node-size, .867em))}.smart-switch__label_inactive .smart-switch__label_text{font-size:var(--switch-label-font-size,13px)}.smart-switch__node{background-color:var(--switch-node-background-color,#fff);border-radius:100%;box-shadow:var(--switch-node-box-shadow,0 3px 1px 0 rgba(0,0,0,.05),0 2px 2px 0 rgba(0,0,0,.1),0 3px 3px 0 rgba(0,0,0,.05));height:var(--switch-node-size,.867em);left:
|
|
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:var(--app-B4,#fff);--smart-ui-border-image:linear-gradient(90deg,transparent,rgba(0,0,0,.3),transparent);--smart-ui-battery-body-base-background:rgba(0,0,0,.25);--smart-ui-battery-text-color:rgba(0,0,0,.6);--smart-ui-battery-slash-border-color:#fff;--smart-ui-toast-background:#5c5c5c;--smart-ui-toast-border:1px solid hsla(0,0%,100%,.05);--smart-ui-toast-box-shadow:0 4px 12px rgba(0,0,0,.1),0 16px 32px rgba(0,0,0,.12);--smart-ui-overlay-blur-background:rgba(40,44,53,.22)}:root[theme=dark]{--smart-ui-overlay:rgba(0,0,0,.7);--smart-ui-bottom-sheet-dragger-node-background:hsla(0,0%,100%,.3);--smart-ui-dialog-background:linear-gradient(0deg,var(--app-B4-N6),var(--app-B4-N6)),var(--app-B1);--smart-ui-border-image:linear-gradient(90deg,hsla(0,0%,100%,0),hsla(0,0%,100%,.3),hsla(0,0%,100%,0));--smart-ui-battery-body-base-background:hsla(0,0%,100%,.4);--smart-ui-battery-text-color:#fff;--smart-ui-battery-slash-border-color:#000;--smart-ui-toast-background:#3c3c3c;--smart-ui-toast-border:1px solid hsla(0,0%,100%,.05);--smart-ui-toast-box-shadow:0 8px 24px 0 rgba(0,0,0,.15);--smart-ui-overlay-blur-background:rgba(0,0,0,.6)}.smart-manrope{font-family:Manrope,sans-serif}:host{display:inline-flex}.smart-switch{background-color:var(--switch-background-color,var(--app-B4-N6,rgba(0,0,0,.2)));border-radius:var(--switch-node-size,.867em);box-sizing:initial;display:inline-block;height:var(--switch-height,.867em);padding:var(--switch-border,var(--switch-padding,.067em));position:relative;transition:background-color var(--switch-transition-duration,.3s);vertical-align:middle;width:var(--switch-width,1.5338em)}.smart-switch--label{width:var(--switch-label-width,2em)}.smart-switch__center{box-sizing:initial;height:100%;position:relative;width:100%}.smart-switch__label_active{align-items:center;color:var(--switch-label-active-color,#fff);display:flex;height:100%;justify-content:center;left:0;padding-left:var(--switch-border,var(--switch-padding,.067em));position:absolute;text-align:center;top:0;width:calc(100% - var(--switch-node-size, .867em))}.smart-switch__label_active .smart-switch__label_text{font-size:var(--switch-label-font-size,13px)}.smart-switch__label_inactive{align-items:center;color:var(--switch-label-inactive-color,#fff);display:flex;height:100%;justify-content:center;padding-right:var(--switch-border,var(--switch-padding,.067em));position:absolute;right:0;text-align:center;top:0;width:calc(100% - var(--switch-node-size, .867em))}.smart-switch__label_inactive .smart-switch__label_text{font-size:var(--switch-label-font-size,13px)}.smart-switch__node{background-color:var(--switch-node-background-color,#fff);border-radius:100%;box-shadow:var(--switch-node-box-shadow,0 3px 1px 0 rgba(0,0,0,.05),0 2px 2px 0 rgba(0,0,0,.1),0 3px 3px 0 rgba(0,0,0,.05));height:var(--switch-node-size,.867em);left:var(--switch-node-size,.867em);position:absolute;top:0;transform:translate3d(-100%,0,0);transition:left var(--switch-transition-duration,.3s) cubic-bezier(.3,1.05,.4,1.05),background-color var(--switch-transition-duration,.3s);width:var(--switch-node-size,.867em);will-change:left;z-index:var(--switch-node-z-index,0)}.smart-switch__loading{left:50%;position:absolute!important;top:50%;transform:translate(-50%,-50%)}.smart-switch--on{background-color:var(--switch-on-background-color,#1989fa)}.smart-switch--on .smart-switch__node{background-color:var(--switch-node-on-background-color,var(--switch-node-background-color,#fff));left:100%}.smart-switch--disabled{opacity:var(--switch-disabled-opacity,.4)}
|