@tuya-miniapp/smart-ui 2.6.4-beta-8 → 2.6.4-beta-9
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/common/utils.d.ts +0 -1
- package/dist/common/utils.js +0 -7
- package/dist/datetime-picker/index.js +2 -2
- package/dist/image/index.js +1 -1
- package/dist/picker/index.css +1 -1
- package/dist/picker/index.js +11 -4
- package/dist/picker/index.wxml +4 -3
- package/dist/picker/index.wxs +1 -1
- package/dist/picker/index.wxss +1 -1
- package/dist/picker/shared.d.ts +11 -0
- package/dist/picker/shared.js +11 -0
- package/dist/picker-column/index.css +1 -1
- package/dist/picker-column/index.js +192 -77
- package/dist/picker-column/index.wxml +15 -36
- package/dist/picker-column/index.wxs +510 -399
- package/dist/picker-column/index.wxss +1 -1
- package/dist/wxs/utils.wxs +42 -1
- package/lib/common/utils.d.ts +0 -1
- package/lib/common/utils.js +1 -9
- package/lib/datetime-picker/index.js +3 -3
- package/lib/image/index.js +1 -1
- package/lib/picker/index.css +1 -1
- package/lib/picker/index.js +13 -4
- package/lib/picker/index.wxml +4 -3
- package/lib/picker/index.wxs +1 -1
- package/lib/picker/index.wxss +1 -1
- package/lib/picker/shared.d.ts +11 -0
- package/lib/picker/shared.js +11 -0
- package/lib/picker-column/index.css +1 -1
- package/lib/picker-column/index.js +192 -83
- package/lib/picker-column/index.wxml +15 -36
- package/lib/picker-column/index.wxs +510 -399
- package/lib/picker-column/index.wxss +1 -1
- package/lib/wxs/utils.wxs +42 -1
- package/package.json +1 -1
- package/dist/wxs/strToStyleObject.wxs +0 -10
- package/lib/wxs/strToStyleObject.wxs +0 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
@import '../common/index.wxss';:root{--smart-ui-overlay:rgba(0,0,0,.4);--smart-ui-dialog-background:#fff;--smart-ui-border-image:linear-gradient(90deg,transparent,rgba(0,0,0,.3),transparent)}:root[theme=dark]{--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-picker-column{color:var(--picker-option-selected-text-color,var(--app-B6-N1,#000));font-size:var(--picker-option-font-size,16px);font-weight:var(--font-weight-bold,500);text-align:center}.smart-picker-
|
|
1
|
+
@import '../common/index.wxss';:root{--smart-ui-overlay:rgba(0,0,0,.4);--smart-ui-dialog-background:#fff;--smart-ui-border-image:linear-gradient(90deg,transparent,rgba(0,0,0,.3),transparent)}:root[theme=dark]{--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-picker-column{backface-visibility:hidden;-webkit-backface-visibility:hidden;color:var(--picker-option-selected-text-color,var(--app-B6-N1,#000));font-size:var(--picker-option-font-size,16px);font-weight:var(--font-weight-bold,500);perspective:900px;position:relative;text-align:center;transform:translateZ(0);width:100%;will-change:transform}.smart-picker-column__offset{cursor:-webkit-grab;cursor:grab;height:100%;overflow:visible;position:relative;touch-action:none;transform:rotateX(-108deg);transform-origin:center center;transform-style:preserve-3d;width:100%}.smart-picker-column__visual{position:absolute;top:0;width:100%}.smart-picker-column__item{align-items:center;backface-visibility:hidden;-webkit-backface-visibility:hidden;display:flex;justify-content:center;left:50%;position:absolute;top:50%;transform-origin:center center;width:100%}.smart-picker-column__item--selected{color:var(--picker-option-selected-text-color,var(--app-B6-N1,#000));font-weight:var(--picker-option-selected-font-weight-bold,var(--font-weight-bold,700))}.smart-picker-column__item--disabled{opacity:var(--picker-option-disabled-opacity,.3);pointer-events:none}.smart-picker-column__mask{background:transparent;display:flex;flex-direction:column;height:100%;position:absolute;top:0;width:100%;z-index:10}.smart-picker-column__mask__item{flex:1}.smart-picker-column__unit{align-items:center;display:flex;justify-content:center;position:absolute;top:50%;transform:translateY(-50%);width:100%}.smart-picker-column__unit_text{color:var(--picker-option-unit-text-color,var(--app-B6-N4,rgba(0,0,0,.4)));font-size:var(--picker-option-unit-font-size,12px);left:100%;margin-left:var(--picker-option-unit-mid-size,4px);position:absolute;text-align:left;top:50%;transform:translateY(-50%);white-space:nowrap}.smart-picker-column__max-text{color:transparent;font-size:var(--picker-option-font-size,16px);font-weight:var(--font-weight-bold,500);position:relative}.smart-picker-column--disabled{opacity:var(--picker-option-disabled-opacity,.3);pointer-events:none}.smart-picker-column__item_0:after{content:var(--picker-item-content_0,"")}.smart-picker-column__item_1:after{content:var(--picker-item-content_1,"")}.smart-picker-column__item_2:after{content:var(--picker-item-content_2,"")}.smart-picker-column__item_3:after{content:var(--picker-item-content_3,"")}.smart-picker-column__item_4:after{content:var(--picker-item-content_4,"")}.smart-picker-column__item_5:after{content:var(--picker-item-content_5,"")}.smart-picker-column__item_6:after{content:var(--picker-item-content_6,"")}.smart-picker-column__item_7:after{content:var(--picker-item-content_7,"")}.smart-picker-column__item_8:after{content:var(--picker-item-content_8,"")}.smart-picker-column__item_9:after{content:var(--picker-item-content_9,"")}.smart-picker-column__item_10:after{content:var(--picker-item-content_10,"")}.smart-picker-column__item_11:after{content:var(--picker-item-content_11,"")}.smart-picker-column__item_12:after{content:var(--picker-item-content_12,"")}.smart-picker-column__item_13:after{content:var(--picker-item-content_13,"")}.smart-picker-column__item_14:after{content:var(--picker-item-content_14,"")}.smart-picker-column__item_15:after{content:var(--picker-item-content_15,"")}.smart-picker-column__item_16:after{content:var(--picker-item-content_16,"")}.smart-picker-column__item_17:after{content:var(--picker-item-content_17,"")}.smart-picker-column__item_18:after{content:var(--picker-item-content_18,"")}.smart-picker-column__item_19:after{content:var(--picker-item-content_19,"")}.smart-picker-column__item_20:after{content:var(--picker-item-content_20,"")}.smart-picker-column__item_21:after{content:var(--picker-item-content_21,"")}.smart-picker-column__item_22:after{content:var(--picker-item-content_22,"")}.smart-picker-column__item_23:after{content:var(--picker-item-content_23,"")}.smart-picker-column__item_24:after{content:var(--picker-item-content_24,"")}.smart-picker-column__item_25:after{content:var(--picker-item-content_25,"")}.smart-picker-column__item_26:after{content:var(--picker-item-content_26,"")}.smart-picker-column__item_27:after{content:var(--picker-item-content_27,"")}.smart-picker-column__item_28:after{content:var(--picker-item-content_28,"")}.smart-picker-column__item_29:after{content:var(--picker-item-content_29,"")}.smart-picker-column__item_30:after{content:var(--picker-item-content_30,"")}.smart-picker-column__item_31:after{content:var(--picker-item-content_31,"")}.smart-picker-column__item_32:after{content:var(--picker-item-content_32,"")}.smart-picker-column__item_33:after{content:var(--picker-item-content_33,"")}.smart-picker-column__item_34:after{content:var(--picker-item-content_34,"")}
|
package/dist/wxs/utils.wxs
CHANGED
|
@@ -3,8 +3,49 @@ var bem = require('./bem.wxs');
|
|
|
3
3
|
var memoize = require('./memoize.wxs');
|
|
4
4
|
var addUnit = require('./add-unit.wxs');
|
|
5
5
|
|
|
6
|
+
function queryComponent (ownerInstance, selector) {
|
|
7
|
+
var instance = ownerInstance && ownerInstance.selectComponent(selector);
|
|
8
|
+
return instance;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
function isObj(x) {
|
|
12
|
+
var type = typeof x;
|
|
13
|
+
return x !== null && (type === 'object' || type === 'function');
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function range(num, min, max) {
|
|
17
|
+
return Math.min(Math.max(num, min), max);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// 创建指定长度并填充默认值的数组
|
|
21
|
+
function createArray(length, defaultValue) {
|
|
22
|
+
var arr = [];
|
|
23
|
+
for (var i = 0; i < length; i++) {
|
|
24
|
+
arr[i] = defaultValue;
|
|
25
|
+
}
|
|
26
|
+
return arr;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// 填充数组的所有元素为指定值
|
|
30
|
+
function fillArray(arr, value) {
|
|
31
|
+
for (var i = 0; i < arr.length; i++) {
|
|
32
|
+
arr[i] = value;
|
|
33
|
+
}
|
|
34
|
+
return arr;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function isArray(array) {
|
|
38
|
+
return array && typeof array === 'object' && typeof array.length === 'number';
|
|
39
|
+
}
|
|
40
|
+
|
|
6
41
|
module.exports = {
|
|
7
42
|
bem: memoize(bem),
|
|
8
43
|
memoize: memoize,
|
|
9
|
-
addUnit: addUnit
|
|
44
|
+
addUnit: addUnit,
|
|
45
|
+
queryComponent: queryComponent,
|
|
46
|
+
isObj: isObj,
|
|
47
|
+
range: range,
|
|
48
|
+
createArray: createArray,
|
|
49
|
+
fillArray: fillArray,
|
|
50
|
+
isArray: isArray
|
|
10
51
|
};
|
package/lib/common/utils.d.ts
CHANGED
|
@@ -22,4 +22,3 @@ export declare function replacePlaceholders(template: any, values: any): any;
|
|
|
22
22
|
export declare const getSafeAreaInsetMin: () => number;
|
|
23
23
|
export declare function getSafeBottomOffset(): number;
|
|
24
24
|
export declare const getDateString: (date: Date) => string | undefined;
|
|
25
|
-
export declare function generateRangeArray(start: number, end: number): number[];
|
package/lib/common/utils.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getDateString = exports.getSafeBottomOffset = exports.getSafeAreaInsetMin = exports.replacePlaceholders = exports.isWxWork = exports.isPC = exports.getCurrentPage = exports.clamp = exports.addNumber = exports.toPromise = exports.groupSetData = exports.getAllRect = exports.getRect = exports.pickExclude = exports.requestAnimationFrame = exports.addUnit = exports.nextTick = exports.range = exports.getSystemInfoSync = exports.isDef = void 0;
|
|
4
4
|
var validator_1 = require("./validator");
|
|
5
5
|
var version_1 = require("./version");
|
|
6
6
|
var validator_2 = require("./validator");
|
|
@@ -138,11 +138,3 @@ var getDateString = function (date) {
|
|
|
138
138
|
return formattedDate;
|
|
139
139
|
};
|
|
140
140
|
exports.getDateString = getDateString;
|
|
141
|
-
function generateRangeArray(start, end) {
|
|
142
|
-
var resultArray = [];
|
|
143
|
-
for (var i = start; i < end; i++) {
|
|
144
|
-
resultArray.push(i);
|
|
145
|
-
}
|
|
146
|
-
return resultArray;
|
|
147
|
-
}
|
|
148
|
-
exports.generateRangeArray = generateRangeArray;
|
|
@@ -231,7 +231,8 @@ var defaultFormatter = function (type, value) {
|
|
|
231
231
|
unit: locale === null || locale === void 0 ? void 0 : locale[column.type],
|
|
232
232
|
style: columnStyles === null || columnStyles === void 0 ? void 0 : columnStyles[column.type],
|
|
233
233
|
fontStyle: fontStyles === null || fontStyles === void 0 ? void 0 : fontStyles[column.type],
|
|
234
|
-
activeIndex: activeIndex,
|
|
234
|
+
activeIndex: activeIndex === -1 ? 0 : activeIndex,
|
|
235
|
+
loop: !['12HourClock', 'year'].includes(column.type),
|
|
235
236
|
};
|
|
236
237
|
});
|
|
237
238
|
return this.setData({ columns: results });
|
|
@@ -426,8 +427,7 @@ var defaultFormatter = function (type, value) {
|
|
|
426
427
|
}
|
|
427
428
|
else {
|
|
428
429
|
var originColumns_2 = this.getOriginColumns();
|
|
429
|
-
var
|
|
430
|
-
var values = indexes_1.map(function (value, index) { return originColumns_2[index].values[value]; });
|
|
430
|
+
var values = indexes.map(function (value, index) { return originColumns_2[index].values[value]; });
|
|
431
431
|
var year = getTrueValue(values[0]);
|
|
432
432
|
var month = getTrueValue(values[1]);
|
|
433
433
|
var maxDate = getMonthEndDay(year, month);
|
package/lib/image/index.js
CHANGED
package/lib/picker/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@import '../common/index.css';:root{--smart-ui-overlay:rgba(0,0,0,.4);--smart-ui-dialog-background:#fff;--smart-ui-border-image:linear-gradient(90deg,transparent,rgba(0,0,0,.3),transparent)}:root[theme=dark]{--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-picker{-webkit-text-size-adjust:100%;background-color:var(--picker-background-color,var(--app-B4,#fff));overflow:hidden;position:relative;-webkit-user-select:none;user-select:none}.smart-picker__toolbar{display:flex;height:var(--picker-toolbar-height,44px);justify-content:space-between;line-height:var(--picker-toolbar-height,44px)}.smart-picker__cancel,.smart-picker__confirm{font-size:var(--picker-action-font-size,14px);padding:var(--picker-action-padding,0 16px)}.smart-picker__cancel--hover,.smart-picker__confirm--hover{opacity:.7}.smart-picker__confirm{color:var(--picker-confirm-action-color,#576b95)}.smart-picker__cancel{color:var(--picker-cancel-action-color,#969799)}.smart-picker__title{font-size:var(--picker-option-font-size,16px);font-weight:var(--font-weight-bolder,700);max-width:50%;text-align:center}.smart-picker__columns{display:flex;justify-content:center;-webkit-mask-image:linear-gradient(0deg,transparent,#000 50%,transparent);mask-image:linear-gradient(0deg,transparent,#000 50%,transparent);-webkit-mask-position:top,bottom;mask-position:top,bottom;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;overflow:hidden;padding:0 var(--picker-padding,16px);position:relative}.smart-picker__column{flex:1 1;width:0}.smart-picker__loading{align-items:center;background-color:var(--picker-loading-mask-color,var(--app-B4,#fff));bottom:0;display:flex;justify-content:center;left:0;opacity:.9;position:absolute;right:0;top:0;z-index:4}.smart-picker__frame{left:var(--picker-padding,16px);pointer-events:none;position:absolute;right:var(--picker-padding,16px);top:50%;transform:translateY(-50%);z-index:1}
|
|
1
|
+
@import '../common/index.css';:root{--smart-ui-overlay:rgba(0,0,0,.4);--smart-ui-dialog-background:#fff;--smart-ui-border-image:linear-gradient(90deg,transparent,rgba(0,0,0,.3),transparent)}:root[theme=dark]{--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-picker{-webkit-text-size-adjust:100%;background-color:var(--picker-background-color,var(--app-B4,#fff));overflow:hidden;position:relative;-webkit-user-select:none;user-select:none}.smart-picker__toolbar{display:flex;height:var(--picker-toolbar-height,44px);justify-content:space-between;line-height:var(--picker-toolbar-height,44px)}.smart-picker__cancel,.smart-picker__confirm{font-size:var(--picker-action-font-size,14px);padding:var(--picker-action-padding,0 16px)}.smart-picker__cancel--hover,.smart-picker__confirm--hover{opacity:.7}.smart-picker__confirm{color:var(--picker-confirm-action-color,#576b95)}.smart-picker__cancel{color:var(--picker-cancel-action-color,#969799)}.smart-picker__title{font-size:var(--picker-option-font-size,16px);font-weight:var(--font-weight-bolder,700);max-width:50%;text-align:center}.smart-picker__columns{align-items:center;display:flex;justify-content:center;-webkit-mask-image:linear-gradient(0deg,transparent,#000 50%,transparent);mask-image:linear-gradient(0deg,transparent,#000 50%,transparent);-webkit-mask-position:top,bottom;mask-position:top,bottom;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;overflow:hidden;padding:0 var(--picker-padding,16px);position:relative}.smart-picker__column{flex:1 1;width:0}.smart-picker__loading{align-items:center;background-color:var(--picker-loading-mask-color,var(--app-B4,#fff));bottom:0;display:flex;justify-content:center;left:0;opacity:.9;position:absolute;right:0;top:0;z-index:4}.smart-picker__frame{left:var(--picker-padding,16px);pointer-events:none;position:absolute;right:var(--picker-padding,16px);top:50%;transform:translateY(-50%);z-index:1}
|
package/lib/picker/index.js
CHANGED
|
@@ -21,12 +21,14 @@ var shared_1 = require("./shared");
|
|
|
21
21
|
}, toolbarPosition: {
|
|
22
22
|
type: String,
|
|
23
23
|
value: 'top',
|
|
24
|
+
}, fullHeight: {
|
|
25
|
+
type: Boolean,
|
|
26
|
+
value: false,
|
|
24
27
|
}, defaultIndex: {
|
|
25
28
|
type: Number,
|
|
26
29
|
value: 0,
|
|
27
30
|
}, activeIndex: {
|
|
28
|
-
type:
|
|
29
|
-
value: -1,
|
|
31
|
+
type: null,
|
|
30
32
|
}, unit: {
|
|
31
33
|
type: String,
|
|
32
34
|
value: '',
|
|
@@ -50,6 +52,11 @@ var shared_1 = require("./shared");
|
|
|
50
52
|
get: function () { return _this.selectAllComponents('.smart-picker__column') || []; },
|
|
51
53
|
});
|
|
52
54
|
},
|
|
55
|
+
mounted: function () {
|
|
56
|
+
if (![3, 5, 7, 9].includes(this.data.visibleItemCount)) {
|
|
57
|
+
console.error('visibleItemCount 的值必须为 3, 5, 7, 9');
|
|
58
|
+
}
|
|
59
|
+
},
|
|
53
60
|
methods: {
|
|
54
61
|
noop: function () { },
|
|
55
62
|
setColumns: function () {
|
|
@@ -111,7 +118,7 @@ var shared_1 = require("./shared");
|
|
|
111
118
|
},
|
|
112
119
|
// get column option index by column index
|
|
113
120
|
getColumnIndex: function (columnIndex) {
|
|
114
|
-
return (this.getColumn(columnIndex) || {}).data.
|
|
121
|
+
return (this.getColumn(columnIndex) || {}).data.activeIndex;
|
|
115
122
|
},
|
|
116
123
|
// set column option index by column index
|
|
117
124
|
setColumnIndex: function (columnIndex, optionIndex) {
|
|
@@ -154,7 +161,9 @@ var shared_1 = require("./shared");
|
|
|
154
161
|
},
|
|
155
162
|
// get indexes of all columns
|
|
156
163
|
getIndexes: function () {
|
|
157
|
-
return this.children.map(function (child) {
|
|
164
|
+
return this.children.map(function (child) {
|
|
165
|
+
return child.data.activeIndex === null ? child.data.defaultIndex : child.data.activeIndex;
|
|
166
|
+
});
|
|
158
167
|
},
|
|
159
168
|
// set indexes of all columns
|
|
160
169
|
setIndexes: function (indexes) {
|
package/lib/picker/index.wxml
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
<view
|
|
11
11
|
class="smart-picker__columns"
|
|
12
|
-
style="{{ computed.columnsStyle({ itemHeight, visibleItemCount }) }}"
|
|
12
|
+
style="{{ computed.columnsStyle({ itemHeight, visibleItemCount, fullHeight }) }}"
|
|
13
13
|
catch:touchmove="noop"
|
|
14
14
|
>
|
|
15
15
|
<picker-column
|
|
@@ -22,14 +22,15 @@
|
|
|
22
22
|
value-key="{{ valueKey }}"
|
|
23
23
|
style="order: {{ item.order }}; {{ computed.style(item.style) }}"
|
|
24
24
|
active-style="{{ activeStyle }}"
|
|
25
|
-
font-style="{{computed.style(item.fontStyle)}}"
|
|
25
|
+
font-style="{{fontStyle ? fontStyle + ';' + computed.style(item.fontStyle): computed.style(item.fontStyle)}}"
|
|
26
26
|
options="{{ item.values }}"
|
|
27
27
|
disabled="{{ item.disabled || false }}"
|
|
28
28
|
unit="{{ item.unit || unit }}"
|
|
29
29
|
changeAnimation="{{ changeAnimation }}"
|
|
30
30
|
default-index="{{ item.defaultIndex || defaultIndex }}"
|
|
31
|
-
active-index="{{ item.activeIndex
|
|
31
|
+
active-index="{{ item.activeIndex === null ? activeIndex : item.activeIndex }}"
|
|
32
32
|
item-height="{{ itemHeight }}"
|
|
33
|
+
loop="{{ loop || item.loop || false }}"
|
|
33
34
|
visible-item-count="{{ visibleItemCount }}"
|
|
34
35
|
active-class="active-class"
|
|
35
36
|
bind:change="onChange"
|
package/lib/picker/index.wxs
CHANGED
package/lib/picker/index.wxss
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@import '../common/index.wxss';:root{--smart-ui-overlay:rgba(0,0,0,.4);--smart-ui-dialog-background:#fff;--smart-ui-border-image:linear-gradient(90deg,transparent,rgba(0,0,0,.3),transparent)}:root[theme=dark]{--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-picker{-webkit-text-size-adjust:100%;background-color:var(--picker-background-color,var(--app-B4,#fff));overflow:hidden;position:relative;-webkit-user-select:none;user-select:none}.smart-picker__toolbar{display:flex;height:var(--picker-toolbar-height,44px);justify-content:space-between;line-height:var(--picker-toolbar-height,44px)}.smart-picker__cancel,.smart-picker__confirm{font-size:var(--picker-action-font-size,14px);padding:var(--picker-action-padding,0 16px)}.smart-picker__cancel--hover,.smart-picker__confirm--hover{opacity:.7}.smart-picker__confirm{color:var(--picker-confirm-action-color,#576b95)}.smart-picker__cancel{color:var(--picker-cancel-action-color,#969799)}.smart-picker__title{font-size:var(--picker-option-font-size,16px);font-weight:var(--font-weight-bolder,700);max-width:50%;text-align:center}.smart-picker__columns{display:flex;justify-content:center;-webkit-mask-image:linear-gradient(0deg,transparent,#000 50%,transparent);mask-image:linear-gradient(0deg,transparent,#000 50%,transparent);-webkit-mask-position:top,bottom;mask-position:top,bottom;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;overflow:hidden;padding:0 var(--picker-padding,16px);position:relative}.smart-picker__column{flex:1 1;width:0}.smart-picker__loading{align-items:center;background-color:var(--picker-loading-mask-color,var(--app-B4,#fff));bottom:0;display:flex;justify-content:center;left:0;opacity:.9;position:absolute;right:0;top:0;z-index:4}.smart-picker__frame{left:var(--picker-padding,16px);pointer-events:none;position:absolute;right:var(--picker-padding,16px);top:50%;transform:translateY(-50%);z-index:1}
|
|
1
|
+
@import '../common/index.wxss';:root{--smart-ui-overlay:rgba(0,0,0,.4);--smart-ui-dialog-background:#fff;--smart-ui-border-image:linear-gradient(90deg,transparent,rgba(0,0,0,.3),transparent)}:root[theme=dark]{--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-picker{-webkit-text-size-adjust:100%;background-color:var(--picker-background-color,var(--app-B4,#fff));overflow:hidden;position:relative;-webkit-user-select:none;user-select:none}.smart-picker__toolbar{display:flex;height:var(--picker-toolbar-height,44px);justify-content:space-between;line-height:var(--picker-toolbar-height,44px)}.smart-picker__cancel,.smart-picker__confirm{font-size:var(--picker-action-font-size,14px);padding:var(--picker-action-padding,0 16px)}.smart-picker__cancel--hover,.smart-picker__confirm--hover{opacity:.7}.smart-picker__confirm{color:var(--picker-confirm-action-color,#576b95)}.smart-picker__cancel{color:var(--picker-cancel-action-color,#969799)}.smart-picker__title{font-size:var(--picker-option-font-size,16px);font-weight:var(--font-weight-bolder,700);max-width:50%;text-align:center}.smart-picker__columns{align-items:center;display:flex;justify-content:center;-webkit-mask-image:linear-gradient(0deg,transparent,#000 50%,transparent);mask-image:linear-gradient(0deg,transparent,#000 50%,transparent);-webkit-mask-position:top,bottom;mask-position:top,bottom;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;overflow:hidden;padding:0 var(--picker-padding,16px);position:relative}.smart-picker__column{flex:1 1;width:0}.smart-picker__loading{align-items:center;background-color:var(--picker-loading-mask-color,var(--app-B4,#fff));bottom:0;display:flex;justify-content:center;left:0;opacity:.9;position:absolute;right:0;top:0;z-index:4}.smart-picker__frame{left:var(--picker-padding,16px);pointer-events:none;position:absolute;right:var(--picker-padding,16px);top:50%;transform:translateY(-50%);z-index:1}
|
package/lib/picker/shared.d.ts
CHANGED
|
@@ -10,6 +10,9 @@ export declare const pickerProps: {
|
|
|
10
10
|
type: StringConstructor;
|
|
11
11
|
value: string;
|
|
12
12
|
};
|
|
13
|
+
/**
|
|
14
|
+
* 可见的选项个数 3 5 7 9
|
|
15
|
+
*/
|
|
13
16
|
visibleItemCount: {
|
|
14
17
|
type: NumberConstructor;
|
|
15
18
|
value: number;
|
|
@@ -30,4 +33,12 @@ export declare const pickerProps: {
|
|
|
30
33
|
type: StringConstructor;
|
|
31
34
|
value: string;
|
|
32
35
|
};
|
|
36
|
+
fontStyle: {
|
|
37
|
+
type: StringConstructor;
|
|
38
|
+
value: string;
|
|
39
|
+
};
|
|
40
|
+
loop: {
|
|
41
|
+
type: BooleanConstructor;
|
|
42
|
+
value: boolean;
|
|
43
|
+
};
|
|
33
44
|
};
|
package/lib/picker/shared.js
CHANGED
|
@@ -13,6 +13,9 @@ exports.pickerProps = {
|
|
|
13
13
|
type: String,
|
|
14
14
|
value: 'Confirm',
|
|
15
15
|
},
|
|
16
|
+
/**
|
|
17
|
+
* 可见的选项个数 3 5 7 9
|
|
18
|
+
*/
|
|
16
19
|
visibleItemCount: {
|
|
17
20
|
type: Number,
|
|
18
21
|
value: 5,
|
|
@@ -33,4 +36,12 @@ exports.pickerProps = {
|
|
|
33
36
|
type: String,
|
|
34
37
|
value: '',
|
|
35
38
|
},
|
|
39
|
+
fontStyle: {
|
|
40
|
+
type: String,
|
|
41
|
+
value: '',
|
|
42
|
+
},
|
|
43
|
+
loop: {
|
|
44
|
+
type: Boolean,
|
|
45
|
+
value: false,
|
|
46
|
+
},
|
|
36
47
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@import '../common/index.css';:root{--smart-ui-overlay:rgba(0,0,0,.4);--smart-ui-dialog-background:#fff;--smart-ui-border-image:linear-gradient(90deg,transparent,rgba(0,0,0,.3),transparent)}:root[theme=dark]{--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-picker-column{color:var(--picker-option-selected-text-color,var(--app-B6-N1,#000));font-size:var(--picker-option-font-size,16px);font-weight:var(--font-weight-bold,500);text-align:center}.smart-picker-
|
|
1
|
+
@import '../common/index.css';:root{--smart-ui-overlay:rgba(0,0,0,.4);--smart-ui-dialog-background:#fff;--smart-ui-border-image:linear-gradient(90deg,transparent,rgba(0,0,0,.3),transparent)}:root[theme=dark]{--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-picker-column{backface-visibility:hidden;-webkit-backface-visibility:hidden;color:var(--picker-option-selected-text-color,var(--app-B6-N1,#000));font-size:var(--picker-option-font-size,16px);font-weight:var(--font-weight-bold,500);perspective:900px;position:relative;text-align:center;transform:translateZ(0);width:100%;will-change:transform}.smart-picker-column__offset{cursor:-webkit-grab;cursor:grab;height:100%;overflow:visible;position:relative;touch-action:none;transform:rotateX(-108deg);transform-origin:center center;transform-style:preserve-3d;width:100%}.smart-picker-column__visual{position:absolute;top:0;width:100%}.smart-picker-column__item{align-items:center;backface-visibility:hidden;-webkit-backface-visibility:hidden;display:flex;justify-content:center;left:50%;position:absolute;top:50%;transform-origin:center center;width:100%}.smart-picker-column__item--selected{color:var(--picker-option-selected-text-color,var(--app-B6-N1,#000));font-weight:var(--picker-option-selected-font-weight-bold,var(--font-weight-bold,700))}.smart-picker-column__item--disabled{opacity:var(--picker-option-disabled-opacity,.3);pointer-events:none}.smart-picker-column__mask{background:transparent;display:flex;flex-direction:column;height:100%;position:absolute;top:0;width:100%;z-index:10}.smart-picker-column__mask__item{flex:1}.smart-picker-column__unit{align-items:center;display:flex;justify-content:center;position:absolute;top:50%;transform:translateY(-50%);width:100%}.smart-picker-column__unit_text{color:var(--picker-option-unit-text-color,var(--app-B6-N4,rgba(0,0,0,.4)));font-size:var(--picker-option-unit-font-size,12px);left:100%;margin-left:var(--picker-option-unit-mid-size,4px);position:absolute;text-align:left;top:50%;transform:translateY(-50%);white-space:nowrap}.smart-picker-column__max-text{color:transparent;font-size:var(--picker-option-font-size,16px);font-weight:var(--font-weight-bold,500);position:relative}.smart-picker-column--disabled{opacity:var(--picker-option-disabled-opacity,.3);pointer-events:none}.smart-picker-column__item_0:after{content:var(--picker-item-content_0,"")}.smart-picker-column__item_1:after{content:var(--picker-item-content_1,"")}.smart-picker-column__item_2:after{content:var(--picker-item-content_2,"")}.smart-picker-column__item_3:after{content:var(--picker-item-content_3,"")}.smart-picker-column__item_4:after{content:var(--picker-item-content_4,"")}.smart-picker-column__item_5:after{content:var(--picker-item-content_5,"")}.smart-picker-column__item_6:after{content:var(--picker-item-content_6,"")}.smart-picker-column__item_7:after{content:var(--picker-item-content_7,"")}.smart-picker-column__item_8:after{content:var(--picker-item-content_8,"")}.smart-picker-column__item_9:after{content:var(--picker-item-content_9,"")}.smart-picker-column__item_10:after{content:var(--picker-item-content_10,"")}.smart-picker-column__item_11:after{content:var(--picker-item-content_11,"")}.smart-picker-column__item_12:after{content:var(--picker-item-content_12,"")}.smart-picker-column__item_13:after{content:var(--picker-item-content_13,"")}.smart-picker-column__item_14:after{content:var(--picker-item-content_14,"")}.smart-picker-column__item_15:after{content:var(--picker-item-content_15,"")}.smart-picker-column__item_16:after{content:var(--picker-item-content_16,"")}.smart-picker-column__item_17:after{content:var(--picker-item-content_17,"")}.smart-picker-column__item_18:after{content:var(--picker-item-content_18,"")}.smart-picker-column__item_19:after{content:var(--picker-item-content_19,"")}.smart-picker-column__item_20:after{content:var(--picker-item-content_20,"")}.smart-picker-column__item_21:after{content:var(--picker-item-content_21,"")}.smart-picker-column__item_22:after{content:var(--picker-item-content_22,"")}.smart-picker-column__item_23:after{content:var(--picker-item-content_23,"")}.smart-picker-column__item_24:after{content:var(--picker-item-content_24,"")}.smart-picker-column__item_25:after{content:var(--picker-item-content_25,"")}.smart-picker-column__item_26:after{content:var(--picker-item-content_26,"")}.smart-picker-column__item_27:after{content:var(--picker-item-content_27,"")}.smart-picker-column__item_28:after{content:var(--picker-item-content_28,"")}.smart-picker-column__item_29:after{content:var(--picker-item-content_29,"")}.smart-picker-column__item_30:after{content:var(--picker-item-content_30,"")}.smart-picker-column__item_31:after{content:var(--picker-item-content_31,"")}.smart-picker-column__item_32:after{content:var(--picker-item-content_32,"")}.smart-picker-column__item_33:after{content:var(--picker-item-content_33,"")}.smart-picker-column__item_34:after{content:var(--picker-item-content_34,"")}
|