@tuya-miniapp/smart-ui 2.1.7-beta-1 → 2.1.7-beta-2
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/circle/index.js +3 -2
 - package/dist/circle/index.wxml +1 -1
 - package/dist/dialog/dialog.js +11 -1
 - package/dist/dialog/index.wxml +2 -2
 - package/dist/index-bar/index.js +8 -0
 - package/lib/circle/index.js +3 -2
 - package/lib/circle/index.wxml +1 -1
 - package/lib/dialog/dialog.js +11 -1
 - package/lib/dialog/index.wxml +2 -2
 - package/lib/index-bar/index.js +8 -0
 - package/package.json +1 -1
 
    
        package/dist/circle/index.js
    CHANGED
    
    
    
        package/dist/circle/index.wxml
    CHANGED
    
    | 
         @@ -1,4 +1,4 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            <view class="smart-progress-circle" style="width:{{size}} 
     | 
| 
      
 1 
     | 
    
         
            +
            <view class="smart-progress-circle" style="width:{{size}};height:{{size}};padding:{{trackWidth}}px;background:{{fillColor}};{{style}};{{customStyle}}">
         
     | 
| 
       2 
2 
     | 
    
         
             
              <view class="smart-progress-circle-box smart-progress-circle-box-left">
         
     | 
| 
       3 
3 
     | 
    
         
             
                <view class="smart-progress-circle-bar smart-progress-circle-bar-left" style="transform:{{transformLeft}};background:{{trackColor}};">
         
     | 
| 
       4 
4 
     | 
    
         
             
                </view>
         
     | 
    
        package/dist/dialog/dialog.js
    CHANGED
    
    | 
         @@ -35,8 +35,14 @@ function getContext() { 
     | 
|
| 
       35 
35 
     | 
    
         
             
            const Dialog = (options) => {
         
     | 
| 
       36 
36 
     | 
    
         
             
                options = Object.assign(Object.assign({}, currentOptions), options);
         
     | 
| 
       37 
37 
     | 
    
         
             
                return new Promise((resolve, reject) => {
         
     | 
| 
      
 38 
     | 
    
         
            +
                    var _a;
         
     | 
| 
       38 
39 
     | 
    
         
             
                    const context = (typeof options.context === 'function' ? options.context() : options.context) || getContext();
         
     | 
| 
      
 40 
     | 
    
         
            +
                    const selector = options.selector;
         
     | 
| 
       39 
41 
     | 
    
         
             
                    const dialog = context.selectComponent(options.selector);
         
     | 
| 
      
 42 
     | 
    
         
            +
                    if ((queue === null || queue === void 0 ? void 0 : queue.length) > 0 && ((_a = queue === null || queue === void 0 ? void 0 : queue[0]) === null || _a === void 0 ? void 0 : _a.id) === (dialog === null || dialog === void 0 ? void 0 : dialog.id)) {
         
     | 
| 
      
 43 
     | 
    
         
            +
                        console.warn(`相同选择器的 Dialog 调用过于频繁,${dialog.id} 已忽略重复调用`);
         
     | 
| 
      
 44 
     | 
    
         
            +
                        return;
         
     | 
| 
      
 45 
     | 
    
         
            +
                    }
         
     | 
| 
       40 
46 
     | 
    
         
             
                    delete options.context;
         
     | 
| 
       41 
47 
     | 
    
         
             
                    delete options.selector;
         
     | 
| 
       42 
48 
     | 
    
         
             
                    if (dialog) {
         
     | 
| 
         @@ -45,6 +51,10 @@ const Dialog = (options) => { 
     | 
|
| 
       45 
51 
     | 
    
         
             
                            optionsWithInputValue.inputValue = options.value;
         
     | 
| 
       46 
52 
     | 
    
         
             
                        }
         
     | 
| 
       47 
53 
     | 
    
         
             
                        dialog.setData(Object.assign({ callback: (action, instance) => {
         
     | 
| 
      
 54 
     | 
    
         
            +
                                /**
         
     | 
| 
      
 55 
     | 
    
         
            +
                                 * 在声明式调用的情况下,在 close 后需要手动清空队列
         
     | 
| 
      
 56 
     | 
    
         
            +
                                 */
         
     | 
| 
      
 57 
     | 
    
         
            +
                                queue = [];
         
     | 
| 
       48 
58 
     | 
    
         
             
                                action === 'confirm' ? resolve(instance) : reject(instance);
         
     | 
| 
       49 
59 
     | 
    
         
             
                            } }, optionsWithInputValue));
         
     | 
| 
       50 
60 
     | 
    
         
             
                        wx.nextTick(() => {
         
     | 
| 
         @@ -53,7 +63,7 @@ const Dialog = (options) => { 
     | 
|
| 
       53 
63 
     | 
    
         
             
                        queue.push(dialog);
         
     | 
| 
       54 
64 
     | 
    
         
             
                    }
         
     | 
| 
       55 
65 
     | 
    
         
             
                    else {
         
     | 
| 
       56 
     | 
    
         
            -
                        console.warn(' 
     | 
| 
      
 66 
     | 
    
         
            +
                        console.warn(`未找到 ${(selector !== null && selector !== void 0 ? selector : '#smart-dialog').replace('#', '')} 节点,请确认 selector 及 context 是否正确`);
         
     | 
| 
       57 
67 
     | 
    
         
             
                    }
         
     | 
| 
       58 
68 
     | 
    
         
             
                });
         
     | 
| 
       59 
69 
     | 
    
         
             
            };
         
     | 
    
        package/dist/dialog/index.wxml
    CHANGED
    
    | 
         @@ -91,7 +91,7 @@ 
     | 
|
| 
       91 
91 
     | 
    
         
             
                    loading="{{ loading.cancel }}"
         
     | 
| 
       92 
92 
     | 
    
         
             
                    class="smart-dialog__button smart-hairline--right"
         
     | 
| 
       93 
93 
     | 
    
         
             
                    custom-class="smart-dialog__cancel cancle-button-class"
         
     | 
| 
       94 
     | 
    
         
            -
                    custom-style="color: {{ cancelButtonColor || 'var(--app-B4-N3, rgba(0, 0, 0, 0.5))' }}"
         
     | 
| 
      
 94 
     | 
    
         
            +
                    custom-style="color: {{ cancelButtonColor || 'var(--dialog-cancel-color, var(--app-B4-N3, rgba(0, 0, 0, 0.5)))' }}"
         
     | 
| 
       95 
95 
     | 
    
         
             
                    bind:click="onCancel"
         
     | 
| 
       96 
96 
     | 
    
         
             
                  >
         
     | 
| 
       97 
97 
     | 
    
         
             
                    {{ cancelButtonText }}
         
     | 
| 
         @@ -107,7 +107,7 @@ 
     | 
|
| 
       107 
107 
     | 
    
         
             
                    class="smart-dialog__button"
         
     | 
| 
       108 
108 
     | 
    
         
             
                    loading="{{ loading.confirm }}"
         
     | 
| 
       109 
109 
     | 
    
         
             
                    custom-class="smart-dialog__confirm confirm-button-class"
         
     | 
| 
       110 
     | 
    
         
            -
                    custom-style="color: {{ confirmButtonColor || 'var(--app-B4-N1, rgba(0, 0, 0, 1))' }}"
         
     | 
| 
      
 110 
     | 
    
         
            +
                    custom-style="color: {{ confirmButtonColor || 'var(--dialog-confirm-color, var(--app-B4-N1, rgba(0, 0, 0, 1)))' }}"
         
     | 
| 
       111 
111 
     | 
    
         
             
                    button-id="{{ confirmButtonId }}"
         
     | 
| 
       112 
112 
     | 
    
         
             
                    open-type="{{ confirmButtonOpenType }}"
         
     | 
| 
       113 
113 
     | 
    
         
             
                    lang="{{ lang }}"
         
     | 
    
        package/dist/index-bar/index.js
    CHANGED
    
    | 
         @@ -16,6 +16,10 @@ SmartComponent({ 
     | 
|
| 
       16 
16 
     | 
    
         
             
                    this.updateData();
         
     | 
| 
       17 
17 
     | 
    
         
             
                }),
         
     | 
| 
       18 
18 
     | 
    
         
             
                props: {
         
     | 
| 
      
 19 
     | 
    
         
            +
                    scrollable: {
         
     | 
| 
      
 20 
     | 
    
         
            +
                        type: Boolean,
         
     | 
| 
      
 21 
     | 
    
         
            +
                        value: false,
         
     | 
| 
      
 22 
     | 
    
         
            +
                    },
         
     | 
| 
       19 
23 
     | 
    
         
             
                    sticky: {
         
     | 
| 
       20 
24 
     | 
    
         
             
                        type: Boolean,
         
     | 
| 
       21 
25 
     | 
    
         
             
                        value: true,
         
     | 
| 
         @@ -209,6 +213,8 @@ SmartComponent({ 
     | 
|
| 
       209 
213 
     | 
    
         
             
                        this.scrollToAnchor(event.target.dataset.index);
         
     | 
| 
       210 
214 
     | 
    
         
             
                    },
         
     | 
| 
       211 
215 
     | 
    
         
             
                    onTouchMove(event) {
         
     | 
| 
      
 216 
     | 
    
         
            +
                        if (!this.data.scrollable)
         
     | 
| 
      
 217 
     | 
    
         
            +
                            return;
         
     | 
| 
       212 
218 
     | 
    
         
             
                        const sidebarLength = this.children.length;
         
     | 
| 
       213 
219 
     | 
    
         
             
                        const touch = event.touches[0];
         
     | 
| 
       214 
220 
     | 
    
         
             
                        const itemHeight = this.sidebar.height / sidebarLength;
         
     | 
| 
         @@ -222,6 +228,8 @@ SmartComponent({ 
     | 
|
| 
       222 
228 
     | 
    
         
             
                        this.scrollToAnchor(index);
         
     | 
| 
       223 
229 
     | 
    
         
             
                    },
         
     | 
| 
       224 
230 
     | 
    
         
             
                    onTouchStop() {
         
     | 
| 
      
 231 
     | 
    
         
            +
                        if (!this.data.scrollable)
         
     | 
| 
      
 232 
     | 
    
         
            +
                            return;
         
     | 
| 
       225 
233 
     | 
    
         
             
                        this.scrollToAnchorIndex = null;
         
     | 
| 
       226 
234 
     | 
    
         
             
                    },
         
     | 
| 
       227 
235 
     | 
    
         
             
                    scrollToAnchor(index) {
         
     | 
    
        package/lib/circle/index.js
    CHANGED
    
    
    
        package/lib/circle/index.wxml
    CHANGED
    
    | 
         @@ -1,4 +1,4 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            <view class="smart-progress-circle" style="width:{{size}} 
     | 
| 
      
 1 
     | 
    
         
            +
            <view class="smart-progress-circle" style="width:{{size}};height:{{size}};padding:{{trackWidth}}px;background:{{fillColor}};{{style}};{{customStyle}}">
         
     | 
| 
       2 
2 
     | 
    
         
             
              <view class="smart-progress-circle-box smart-progress-circle-box-left">
         
     | 
| 
       3 
3 
     | 
    
         
             
                <view class="smart-progress-circle-bar smart-progress-circle-bar-left" style="transform:{{transformLeft}};background:{{trackColor}};">
         
     | 
| 
       4 
4 
     | 
    
         
             
                </view>
         
     | 
    
        package/lib/dialog/dialog.js
    CHANGED
    
    | 
         @@ -48,8 +48,14 @@ function getContext() { 
     | 
|
| 
       48 
48 
     | 
    
         
             
            var Dialog = function (options) {
         
     | 
| 
       49 
49 
     | 
    
         
             
                options = __assign(__assign({}, currentOptions), options);
         
     | 
| 
       50 
50 
     | 
    
         
             
                return new Promise(function (resolve, reject) {
         
     | 
| 
      
 51 
     | 
    
         
            +
                    var _a;
         
     | 
| 
       51 
52 
     | 
    
         
             
                    var context = (typeof options.context === 'function' ? options.context() : options.context) || getContext();
         
     | 
| 
      
 53 
     | 
    
         
            +
                    var selector = options.selector;
         
     | 
| 
       52 
54 
     | 
    
         
             
                    var dialog = context.selectComponent(options.selector);
         
     | 
| 
      
 55 
     | 
    
         
            +
                    if ((queue === null || queue === void 0 ? void 0 : queue.length) > 0 && ((_a = queue === null || queue === void 0 ? void 0 : queue[0]) === null || _a === void 0 ? void 0 : _a.id) === (dialog === null || dialog === void 0 ? void 0 : dialog.id)) {
         
     | 
| 
      
 56 
     | 
    
         
            +
                        console.warn("\u76F8\u540C\u9009\u62E9\u5668\u7684 Dialog \u8C03\u7528\u8FC7\u4E8E\u9891\u7E41\uFF0C".concat(dialog.id, " \u5DF2\u5FFD\u7565\u91CD\u590D\u8C03\u7528"));
         
     | 
| 
      
 57 
     | 
    
         
            +
                        return;
         
     | 
| 
      
 58 
     | 
    
         
            +
                    }
         
     | 
| 
       53 
59 
     | 
    
         
             
                    delete options.context;
         
     | 
| 
       54 
60 
     | 
    
         
             
                    delete options.selector;
         
     | 
| 
       55 
61 
     | 
    
         
             
                    if (dialog) {
         
     | 
| 
         @@ -58,6 +64,10 @@ var Dialog = function (options) { 
     | 
|
| 
       58 
64 
     | 
    
         
             
                            optionsWithInputValue.inputValue = options.value;
         
     | 
| 
       59 
65 
     | 
    
         
             
                        }
         
     | 
| 
       60 
66 
     | 
    
         
             
                        dialog.setData(__assign({ callback: function (action, instance) {
         
     | 
| 
      
 67 
     | 
    
         
            +
                                /**
         
     | 
| 
      
 68 
     | 
    
         
            +
                                 * 在声明式调用的情况下,在 close 后需要手动清空队列
         
     | 
| 
      
 69 
     | 
    
         
            +
                                 */
         
     | 
| 
      
 70 
     | 
    
         
            +
                                queue = [];
         
     | 
| 
       61 
71 
     | 
    
         
             
                                action === 'confirm' ? resolve(instance) : reject(instance);
         
     | 
| 
       62 
72 
     | 
    
         
             
                            } }, optionsWithInputValue));
         
     | 
| 
       63 
73 
     | 
    
         
             
                        wx.nextTick(function () {
         
     | 
| 
         @@ -66,7 +76,7 @@ var Dialog = function (options) { 
     | 
|
| 
       66 
76 
     | 
    
         
             
                        queue.push(dialog);
         
     | 
| 
       67 
77 
     | 
    
         
             
                    }
         
     | 
| 
       68 
78 
     | 
    
         
             
                    else {
         
     | 
| 
       69 
     | 
    
         
            -
                        console.warn(' 
     | 
| 
      
 79 
     | 
    
         
            +
                        console.warn("\u672A\u627E\u5230 ".concat((selector !== null && selector !== void 0 ? selector : '#smart-dialog').replace('#', ''), " \u8282\u70B9\uFF0C\u8BF7\u786E\u8BA4 selector \u53CA context \u662F\u5426\u6B63\u786E"));
         
     | 
| 
       70 
80 
     | 
    
         
             
                    }
         
     | 
| 
       71 
81 
     | 
    
         
             
                });
         
     | 
| 
       72 
82 
     | 
    
         
             
            };
         
     | 
    
        package/lib/dialog/index.wxml
    CHANGED
    
    | 
         @@ -91,7 +91,7 @@ 
     | 
|
| 
       91 
91 
     | 
    
         
             
                    loading="{{ loading.cancel }}"
         
     | 
| 
       92 
92 
     | 
    
         
             
                    class="smart-dialog__button smart-hairline--right"
         
     | 
| 
       93 
93 
     | 
    
         
             
                    custom-class="smart-dialog__cancel cancle-button-class"
         
     | 
| 
       94 
     | 
    
         
            -
                    custom-style="color: {{ cancelButtonColor || 'var(--app-B4-N3, rgba(0, 0, 0, 0.5))' }}"
         
     | 
| 
      
 94 
     | 
    
         
            +
                    custom-style="color: {{ cancelButtonColor || 'var(--dialog-cancel-color, var(--app-B4-N3, rgba(0, 0, 0, 0.5)))' }}"
         
     | 
| 
       95 
95 
     | 
    
         
             
                    bind:click="onCancel"
         
     | 
| 
       96 
96 
     | 
    
         
             
                  >
         
     | 
| 
       97 
97 
     | 
    
         
             
                    {{ cancelButtonText }}
         
     | 
| 
         @@ -107,7 +107,7 @@ 
     | 
|
| 
       107 
107 
     | 
    
         
             
                    class="smart-dialog__button"
         
     | 
| 
       108 
108 
     | 
    
         
             
                    loading="{{ loading.confirm }}"
         
     | 
| 
       109 
109 
     | 
    
         
             
                    custom-class="smart-dialog__confirm confirm-button-class"
         
     | 
| 
       110 
     | 
    
         
            -
                    custom-style="color: {{ confirmButtonColor || 'var(--app-B4-N1, rgba(0, 0, 0, 1))' }}"
         
     | 
| 
      
 110 
     | 
    
         
            +
                    custom-style="color: {{ confirmButtonColor || 'var(--dialog-confirm-color, var(--app-B4-N1, rgba(0, 0, 0, 1)))' }}"
         
     | 
| 
       111 
111 
     | 
    
         
             
                    button-id="{{ confirmButtonId }}"
         
     | 
| 
       112 
112 
     | 
    
         
             
                    open-type="{{ confirmButtonOpenType }}"
         
     | 
| 
       113 
113 
     | 
    
         
             
                    lang="{{ lang }}"
         
     | 
    
        package/lib/index-bar/index.js
    CHANGED
    
    | 
         @@ -18,6 +18,10 @@ var indexList = function () { 
     | 
|
| 
       18 
18 
     | 
    
         
             
                    this.updateData();
         
     | 
| 
       19 
19 
     | 
    
         
             
                }),
         
     | 
| 
       20 
20 
     | 
    
         
             
                props: {
         
     | 
| 
      
 21 
     | 
    
         
            +
                    scrollable: {
         
     | 
| 
      
 22 
     | 
    
         
            +
                        type: Boolean,
         
     | 
| 
      
 23 
     | 
    
         
            +
                        value: false,
         
     | 
| 
      
 24 
     | 
    
         
            +
                    },
         
     | 
| 
       21 
25 
     | 
    
         
             
                    sticky: {
         
     | 
| 
       22 
26 
     | 
    
         
             
                        type: Boolean,
         
     | 
| 
       23 
27 
     | 
    
         
             
                        value: true,
         
     | 
| 
         @@ -205,6 +209,8 @@ var indexList = function () { 
     | 
|
| 
       205 
209 
     | 
    
         
             
                        this.scrollToAnchor(event.target.dataset.index);
         
     | 
| 
       206 
210 
     | 
    
         
             
                    },
         
     | 
| 
       207 
211 
     | 
    
         
             
                    onTouchMove: function (event) {
         
     | 
| 
      
 212 
     | 
    
         
            +
                        if (!this.data.scrollable)
         
     | 
| 
      
 213 
     | 
    
         
            +
                            return;
         
     | 
| 
       208 
214 
     | 
    
         
             
                        var sidebarLength = this.children.length;
         
     | 
| 
       209 
215 
     | 
    
         
             
                        var touch = event.touches[0];
         
     | 
| 
       210 
216 
     | 
    
         
             
                        var itemHeight = this.sidebar.height / sidebarLength;
         
     | 
| 
         @@ -218,6 +224,8 @@ var indexList = function () { 
     | 
|
| 
       218 
224 
     | 
    
         
             
                        this.scrollToAnchor(index);
         
     | 
| 
       219 
225 
     | 
    
         
             
                    },
         
     | 
| 
       220 
226 
     | 
    
         
             
                    onTouchStop: function () {
         
     | 
| 
      
 227 
     | 
    
         
            +
                        if (!this.data.scrollable)
         
     | 
| 
      
 228 
     | 
    
         
            +
                            return;
         
     | 
| 
       221 
229 
     | 
    
         
             
                        this.scrollToAnchorIndex = null;
         
     | 
| 
       222 
230 
     | 
    
         
             
                    },
         
     | 
| 
       223 
231 
     | 
    
         
             
                    scrollToAnchor: function (index) {
         
     |