@tuya-miniapp/smart-ui 2.9.1-beta-1 → 2.9.1-beta-3
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.css +1 -1
- package/dist/action-sheet/index.wxss +1 -1
- package/dist/area/index.css +1 -0
- package/dist/area/index.d.ts +1 -0
- package/dist/area/index.js +219 -0
- package/dist/area/index.json +6 -0
- package/dist/area/index.wxml +20 -0
- package/dist/area/index.wxs +8 -0
- package/dist/area/index.wxss +1 -0
- package/dist/battery/index.js +45 -100
- package/dist/battery/index.wxml +1 -21
- package/dist/bottom-sheet/index.css +1 -1
- package/dist/bottom-sheet/index.wxss +1 -1
- package/dist/button/index.css +1 -1
- package/dist/button/index.wxss +1 -1
- package/dist/calendar/index.css +1 -1
- package/dist/calendar/index.js +5 -1
- package/dist/calendar/index.wxss +1 -1
- package/dist/calendar-header/index.css +1 -1
- package/dist/calendar-header/index.wxss +1 -1
- package/dist/calendar-month/index.css +1 -1
- package/dist/calendar-month/index.wxss +1 -1
- package/dist/calendar-month-list/index.css +1 -1
- package/dist/calendar-month-list/index.wxss +1 -1
- package/dist/calendar-utils/utils.d.ts +1 -1
- package/dist/calendar-utils/utils.js +7 -3
- package/dist/calendar-year-list/index.css +1 -1
- package/dist/calendar-year-list/index.wxss +1 -1
- package/dist/cascader/index.css +1 -1
- package/dist/cascader/index.wxss +1 -1
- package/dist/cell/index.css +1 -1
- package/dist/cell/index.wxss +1 -1
- package/dist/cell-group/index.css +1 -1
- package/dist/cell-group/index.wxss +1 -1
- package/dist/checkbox/index.css +1 -1
- package/dist/checkbox/index.wxss +1 -1
- package/dist/circle/index.css +1 -1
- package/dist/circle/index.wxss +1 -1
- package/dist/collapse/index.css +1 -1
- package/dist/collapse/index.wxss +1 -1
- package/dist/collapse-item/index.css +1 -1
- package/dist/collapse-item/index.wxss +1 -1
- package/dist/common/index.css +1 -1
- package/dist/common/index.wxss +1 -1
- package/dist/common/style/hairline.css +1 -1
- package/dist/common/style/hairline.wxss +1 -1
- package/dist/common/style/mixins/hairline.css +1 -1
- package/dist/common/style/mixins/hairline.wxss +1 -1
- package/dist/common/style/var.css +1 -1
- package/dist/common/style/var.wxss +1 -1
- package/dist/config-provider/dark.wxs +1 -4
- package/dist/config-provider/light.wxs +1 -4
- package/dist/count-down/index.css +1 -1
- package/dist/count-down/index.wxss +1 -1
- package/dist/custom-keyboard/index.css +1 -1
- package/dist/custom-keyboard/index.wxss +1 -1
- package/dist/datetime-picker/index.css +1 -1
- package/dist/datetime-picker/index.wxss +1 -1
- package/dist/dialog/index.css +1 -1
- package/dist/dialog/index.wxss +1 -1
- package/dist/divider/index.css +1 -1
- package/dist/divider/index.wxss +1 -1
- package/dist/dropdown-item/index.css +1 -1
- package/dist/dropdown-item/index.wxss +1 -1
- package/dist/dropdown-menu/index.css +1 -1
- package/dist/dropdown-menu/index.wxss +1 -1
- package/dist/empty/index.css +1 -1
- package/dist/empty/index.wxss +1 -1
- package/dist/field/index.css +1 -1
- package/dist/field/index.wxss +1 -1
- package/dist/goods-action/index.css +1 -1
- package/dist/goods-action/index.wxss +1 -1
- package/dist/goods-action-button/index.css +1 -1
- package/dist/goods-action-button/index.wxss +1 -1
- package/dist/goods-action-icon/index.css +1 -1
- package/dist/goods-action-icon/index.wxss +1 -1
- package/dist/grid-item/index.css +1 -1
- package/dist/grid-item/index.wxss +1 -1
- package/dist/icon/index.css +1 -1
- package/dist/icon/index.wxss +1 -1
- package/dist/image/index.css +1 -1
- package/dist/image/index.wxss +1 -1
- package/dist/index-anchor/index.css +1 -1
- package/dist/index-anchor/index.wxss +1 -1
- package/dist/index-bar/index.css +1 -1
- package/dist/index-bar/index.wxss +1 -1
- package/dist/info/index.css +1 -1
- package/dist/info/index.wxss +1 -1
- package/dist/loading/index.css +1 -1
- package/dist/loading/index.wxss +1 -1
- package/dist/nav-bar/index.css +1 -1
- package/dist/nav-bar/index.wxss +1 -1
- package/dist/normal-slider/index.css +1 -1
- package/dist/normal-slider/index.wxss +1 -1
- package/dist/notice-bar/index.css +1 -1
- package/dist/notice-bar/index.wxss +1 -1
- package/dist/notify/index.css +1 -1
- package/dist/notify/index.wxss +1 -1
- package/dist/overlay/index.css +1 -1
- package/dist/overlay/index.wxss +1 -1
- package/dist/picker/index.css +1 -1
- package/dist/picker/index.wxss +1 -1
- package/dist/picker-column/index.css +1 -1
- package/dist/picker-column/index.wxss +1 -1
- package/dist/popover/index.css +1 -1
- package/dist/popover/index.wxss +1 -1
- package/dist/popup/index.css +1 -1
- package/dist/popup/index.wxss +1 -1
- package/dist/progress/index.css +1 -1
- package/dist/progress/index.wxss +1 -1
- package/dist/radio/index.css +1 -1
- package/dist/radio/index.wxss +1 -1
- package/dist/rate/index.css +1 -1
- package/dist/rate/index.wxss +1 -1
- package/dist/search/index.css +1 -1
- package/dist/search/index.wxss +1 -1
- package/dist/sidebar/index.css +1 -1
- package/dist/sidebar/index.wxss +1 -1
- package/dist/sidebar-item/index.css +1 -1
- package/dist/sidebar-item/index.wxss +1 -1
- package/dist/skeleton/index.css +1 -1
- package/dist/skeleton/index.wxss +1 -1
- package/dist/slider/index.css +1 -1
- package/dist/slider/index.wxss +1 -1
- package/dist/stepper/index.css +1 -1
- package/dist/stepper/index.wxss +1 -1
- package/dist/steps/index.css +1 -0
- package/dist/steps/index.d.ts +1 -0
- package/dist/steps/index.js +34 -0
- package/dist/steps/index.json +6 -0
- package/dist/steps/index.wxml +54 -0
- package/dist/steps/index.wxss +1 -0
- package/dist/swipe-cell/index.css +1 -1
- package/dist/swipe-cell/index.wxss +1 -1
- package/dist/switch/index.css +1 -1
- package/dist/switch/index.wxss +1 -1
- package/dist/tab/index.css +1 -1
- package/dist/tab/index.wxss +1 -1
- package/dist/tabbar/index.css +1 -1
- package/dist/tabbar/index.wxss +1 -1
- package/dist/tabbar-item/index.css +1 -1
- package/dist/tabbar-item/index.wxss +1 -1
- package/dist/tabs/index.css +1 -1
- package/dist/tabs/index.wxss +1 -1
- package/dist/tag/index.css +1 -1
- package/dist/tag/index.wxss +1 -1
- package/dist/toast/index.css +1 -1
- package/dist/toast/index.wxss +1 -1
- package/dist/tree-select/index.css +1 -1
- package/dist/tree-select/index.wxss +1 -1
- package/lib/action-sheet/index.css +1 -1
- package/lib/action-sheet/index.wxss +1 -1
- package/lib/area/index.css +1 -0
- package/lib/area/index.d.ts +1 -0
- package/lib/area/index.js +234 -0
- package/lib/area/index.json +6 -0
- package/lib/area/index.wxml +20 -0
- package/lib/area/index.wxs +8 -0
- package/lib/area/index.wxss +1 -0
- package/lib/battery/index.js +38 -100
- package/lib/battery/index.wxml +1 -21
- package/lib/bottom-sheet/index.css +1 -1
- package/lib/bottom-sheet/index.wxss +1 -1
- package/lib/button/index.css +1 -1
- package/lib/button/index.wxss +1 -1
- package/lib/calendar/index.css +1 -1
- package/lib/calendar/index.js +5 -1
- package/lib/calendar/index.wxss +1 -1
- package/lib/calendar-header/index.css +1 -1
- package/lib/calendar-header/index.wxss +1 -1
- package/lib/calendar-month/index.css +1 -1
- package/lib/calendar-month/index.wxss +1 -1
- package/lib/calendar-month-list/index.css +1 -1
- package/lib/calendar-month-list/index.wxss +1 -1
- package/lib/calendar-utils/utils.d.ts +1 -1
- package/lib/calendar-utils/utils.js +8 -3
- package/lib/calendar-year-list/index.css +1 -1
- package/lib/calendar-year-list/index.wxss +1 -1
- package/lib/cascader/index.css +1 -1
- package/lib/cascader/index.wxss +1 -1
- package/lib/cell/index.css +1 -1
- package/lib/cell/index.wxss +1 -1
- package/lib/cell-group/index.css +1 -1
- package/lib/cell-group/index.wxss +1 -1
- package/lib/checkbox/index.css +1 -1
- package/lib/checkbox/index.wxss +1 -1
- package/lib/circle/index.css +1 -1
- package/lib/circle/index.wxss +1 -1
- package/lib/collapse/index.css +1 -1
- package/lib/collapse/index.wxss +1 -1
- package/lib/collapse-item/index.css +1 -1
- package/lib/collapse-item/index.wxss +1 -1
- package/lib/common/index.css +1 -1
- package/lib/common/index.wxss +1 -1
- package/lib/common/style/hairline.css +1 -1
- package/lib/common/style/hairline.wxss +1 -1
- package/lib/common/style/mixins/hairline.css +1 -1
- package/lib/common/style/mixins/hairline.wxss +1 -1
- package/lib/common/style/var.css +1 -1
- package/lib/common/style/var.wxss +1 -1
- package/lib/config-provider/dark.wxs +1 -4
- package/lib/config-provider/light.wxs +1 -4
- package/lib/count-down/index.css +1 -1
- package/lib/count-down/index.wxss +1 -1
- package/lib/custom-keyboard/index.css +1 -1
- package/lib/custom-keyboard/index.wxss +1 -1
- package/lib/datetime-picker/index.css +1 -1
- package/lib/datetime-picker/index.wxss +1 -1
- package/lib/dialog/index.css +1 -1
- package/lib/dialog/index.wxss +1 -1
- package/lib/divider/index.css +1 -1
- package/lib/divider/index.wxss +1 -1
- package/lib/dropdown-item/index.css +1 -1
- package/lib/dropdown-item/index.wxss +1 -1
- package/lib/dropdown-menu/index.css +1 -1
- package/lib/dropdown-menu/index.wxss +1 -1
- package/lib/empty/index.css +1 -1
- package/lib/empty/index.wxss +1 -1
- package/lib/field/index.css +1 -1
- package/lib/field/index.wxss +1 -1
- package/lib/goods-action/index.css +1 -1
- package/lib/goods-action/index.wxss +1 -1
- package/lib/goods-action-button/index.css +1 -1
- package/lib/goods-action-button/index.wxss +1 -1
- package/lib/goods-action-icon/index.css +1 -1
- package/lib/goods-action-icon/index.wxss +1 -1
- package/lib/grid-item/index.css +1 -1
- package/lib/grid-item/index.wxss +1 -1
- package/lib/icon/index.css +1 -1
- package/lib/icon/index.wxss +1 -1
- package/lib/image/index.css +1 -1
- package/lib/image/index.wxss +1 -1
- package/lib/index-anchor/index.css +1 -1
- package/lib/index-anchor/index.wxss +1 -1
- package/lib/index-bar/index.css +1 -1
- package/lib/index-bar/index.wxss +1 -1
- package/lib/info/index.css +1 -1
- package/lib/info/index.wxss +1 -1
- package/lib/loading/index.css +1 -1
- package/lib/loading/index.wxss +1 -1
- package/lib/nav-bar/index.css +1 -1
- package/lib/nav-bar/index.wxss +1 -1
- package/lib/normal-slider/index.css +1 -1
- package/lib/normal-slider/index.wxss +1 -1
- package/lib/notice-bar/index.css +1 -1
- package/lib/notice-bar/index.wxss +1 -1
- package/lib/notify/index.css +1 -1
- package/lib/notify/index.wxss +1 -1
- package/lib/overlay/index.css +1 -1
- package/lib/overlay/index.wxss +1 -1
- package/lib/picker/index.css +1 -1
- package/lib/picker/index.wxss +1 -1
- package/lib/picker-column/index.css +1 -1
- package/lib/picker-column/index.wxss +1 -1
- package/lib/popover/index.css +1 -1
- package/lib/popover/index.wxss +1 -1
- package/lib/popup/index.css +1 -1
- package/lib/popup/index.wxss +1 -1
- package/lib/progress/index.css +1 -1
- package/lib/progress/index.wxss +1 -1
- package/lib/radio/index.css +1 -1
- package/lib/radio/index.wxss +1 -1
- package/lib/rate/index.css +1 -1
- package/lib/rate/index.wxss +1 -1
- package/lib/search/index.css +1 -1
- package/lib/search/index.wxss +1 -1
- package/lib/sidebar/index.css +1 -1
- package/lib/sidebar/index.wxss +1 -1
- package/lib/sidebar-item/index.css +1 -1
- package/lib/sidebar-item/index.wxss +1 -1
- package/lib/skeleton/index.css +1 -1
- package/lib/skeleton/index.wxss +1 -1
- package/lib/slider/index.css +1 -1
- package/lib/slider/index.wxss +1 -1
- package/lib/stepper/index.css +1 -1
- package/lib/stepper/index.wxss +1 -1
- package/lib/steps/index.css +1 -0
- package/lib/steps/index.d.ts +1 -0
- package/lib/steps/index.js +39 -0
- package/lib/steps/index.json +6 -0
- package/lib/steps/index.wxml +54 -0
- package/lib/steps/index.wxss +1 -0
- package/lib/swipe-cell/index.css +1 -1
- package/lib/swipe-cell/index.wxss +1 -1
- package/lib/switch/index.css +1 -1
- package/lib/switch/index.wxss +1 -1
- package/lib/tab/index.css +1 -1
- package/lib/tab/index.wxss +1 -1
- package/lib/tabbar/index.css +1 -1
- package/lib/tabbar/index.wxss +1 -1
- package/lib/tabbar-item/index.css +1 -1
- package/lib/tabbar-item/index.wxss +1 -1
- package/lib/tabs/index.css +1 -1
- package/lib/tabs/index.wxss +1 -1
- package/lib/tag/index.css +1 -1
- package/lib/tag/index.wxss +1 -1
- package/lib/toast/index.css +1 -1
- package/lib/toast/index.wxss +1 -1
- package/lib/tree-select/index.css +1 -1
- package/lib/tree-select/index.wxss +1 -1
- package/package.json +2 -2
- package/dist/battery/index.css +0 -1
- package/dist/battery/index.wxss +0 -1
- package/lib/battery/index.css +0 -1
- package/lib/battery/index.wxss +0 -1
package/dist/toast/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:#fff;--smart-ui-border-image:linear-gradient(90deg,transparent,rgba(0,0,0,.3),transparent)
|
|
1
|
+
@import '../common/index.css';:root{--smart-ui-overlay:rgba(0,0,0,.4);--smart-ui-bottom-sheet-dragger-node-background:rgba(0,0,0,.3);--smart-ui-dialog-background:#fff;--smart-ui-border-image:linear-gradient(90deg,transparent,rgba(0,0,0,.3),transparent)}:root[theme=dark]{--smart-ui-overlay:rgba(0,0,0,.7);--smart-ui-bottom-sheet-dragger-node-background:hsla(0,0%,100%,.3);--smart-ui-dialog-background:#333;--smart-ui-border-image:linear-gradient(90deg,hsla(0,0%,100%,0),hsla(0,0%,100%,.3),hsla(0,0%,100%,0))}.smart-manrope{font-family:Manrope,sans-serif}.smart-toast{word-wrap:break-word;align-items:center;background-color:var(--toast-background-color,rgba(0,0,0,.7));border-radius:var(--toast-border-radius,12px);box-sizing:initial;color:var(--toast-text-color,#fff);display:flex;flex-direction:column;font-size:var(--toast-font-size,14px);justify-content:center;line-height:var(--toast-line-height,20px);white-space:pre-wrap}.smart-toast__container{left:50%;max-width:var(--toast-max-width,calc(100vw - 48px));min-width:var(--toast-min-width,56px);position:fixed;right:-1000px;top:50%;transform:translate(-50%,-50%);width:-webkit-fit-content;width:fit-content}.smart-toast--text{padding:var(--toast-text-padding,14px 16px)}.smart-toast--icon{min-height:var(--toast-default-min-height,56px);padding:var(--toast-default-padding,22px 14px 14px);width:var(--toast-default-width,56px)}.smart-toast--icon .smart-toast__icon{font-size:var(--toast-icon-size,36px)}.smart-toast--icon .smart-toast__text{font-size:var(--toast-font-size,14px);padding-top:8px;text-align:center}.smart-toast__loading{margin:10px 0}.smart-toast--top{transform:translateY(-30vh) translate(-50%,-50%)}.smart-toast--bottom{transform:translateY(30vh) translate(-50%,-50%)}
|
package/dist/toast/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:#fff;--smart-ui-border-image:linear-gradient(90deg,transparent,rgba(0,0,0,.3),transparent)
|
|
1
|
+
@import '../common/index.wxss';:root{--smart-ui-overlay:rgba(0,0,0,.4);--smart-ui-bottom-sheet-dragger-node-background:rgba(0,0,0,.3);--smart-ui-dialog-background:#fff;--smart-ui-border-image:linear-gradient(90deg,transparent,rgba(0,0,0,.3),transparent)}:root[theme=dark]{--smart-ui-overlay:rgba(0,0,0,.7);--smart-ui-bottom-sheet-dragger-node-background:hsla(0,0%,100%,.3);--smart-ui-dialog-background:#333;--smart-ui-border-image:linear-gradient(90deg,hsla(0,0%,100%,0),hsla(0,0%,100%,.3),hsla(0,0%,100%,0))}.smart-manrope{font-family:Manrope,sans-serif}.smart-toast{word-wrap:break-word;align-items:center;background-color:var(--toast-background-color,rgba(0,0,0,.7));border-radius:var(--toast-border-radius,12px);box-sizing:initial;color:var(--toast-text-color,#fff);display:flex;flex-direction:column;font-size:var(--toast-font-size,14px);justify-content:center;line-height:var(--toast-line-height,20px);white-space:pre-wrap}.smart-toast__container{left:50%;max-width:var(--toast-max-width,calc(100vw - 48px));min-width:var(--toast-min-width,56px);position:fixed;right:-1000px;top:50%;transform:translate(-50%,-50%);width:-webkit-fit-content;width:fit-content}.smart-toast--text{padding:var(--toast-text-padding,14px 16px)}.smart-toast--icon{min-height:var(--toast-default-min-height,56px);padding:var(--toast-default-padding,22px 14px 14px);width:var(--toast-default-width,56px)}.smart-toast--icon .smart-toast__icon{font-size:var(--toast-icon-size,36px)}.smart-toast--icon .smart-toast__text{font-size:var(--toast-font-size,14px);padding-top:8px;text-align:center}.smart-toast__loading{margin:10px 0}.smart-toast--top{transform:translateY(-30vh) translate(-50%,-50%)}.smart-toast--bottom{transform:translateY(30vh) translate(-50%,-50%)}
|
|
@@ -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:#fff;--smart-ui-border-image:linear-gradient(90deg,transparent,rgba(0,0,0,.3),transparent)
|
|
1
|
+
@import '../common/index.css';:root{--smart-ui-overlay:rgba(0,0,0,.4);--smart-ui-bottom-sheet-dragger-node-background:rgba(0,0,0,.3);--smart-ui-dialog-background:#fff;--smart-ui-border-image:linear-gradient(90deg,transparent,rgba(0,0,0,.3),transparent)}:root[theme=dark]{--smart-ui-overlay:rgba(0,0,0,.7);--smart-ui-bottom-sheet-dragger-node-background:hsla(0,0%,100%,.3);--smart-ui-dialog-background:#333;--smart-ui-border-image:linear-gradient(90deg,hsla(0,0%,100%,0),hsla(0,0%,100%,.3),hsla(0,0%,100%,0))}.smart-manrope{font-family:Manrope,sans-serif}.smart-tree-select{color:var(--tree-select-font-color,var(--app-B6-N1,#000));display:flex;font-size:var(--tree-select-font-size,14px);position:relative;-webkit-user-select:none;user-select:none}.smart-tree-select__nav{--sidebar-padding:var(--tree-select-nav-item-padding,12px 8px 12px 12px);background-color:var(--tree-select-nav-background-color,var(--app-B3,#fff));flex:1}.smart-tree-select__nav__inner{height:100%;width:100%!important}.smart-tree-select__content{background-color:var(--tree-select-content-background-color,var(--app-B3,#fff));flex:2}.smart-tree-select__item{font-weight:700;line-height:var(--tree-select-item-height,44px);padding:0 32px 0 var(--padding-md,16px);position:relative}.smart-tree-select__item--active{color:var(--tree-select-item-active-color,#ee0a24)}.smart-tree-select__item--disabled{color:var(--tree-select-item-disabled-color,var(--app-B6-N4,rgba(0,0,0,.4)))}.smart-tree-select__selected{position:absolute;right:var(--padding-md,16px);top:50%;transform:translateY(-50%)}
|
|
@@ -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:#fff;--smart-ui-border-image:linear-gradient(90deg,transparent,rgba(0,0,0,.3),transparent)
|
|
1
|
+
@import '../common/index.wxss';:root{--smart-ui-overlay:rgba(0,0,0,.4);--smart-ui-bottom-sheet-dragger-node-background:rgba(0,0,0,.3);--smart-ui-dialog-background:#fff;--smart-ui-border-image:linear-gradient(90deg,transparent,rgba(0,0,0,.3),transparent)}:root[theme=dark]{--smart-ui-overlay:rgba(0,0,0,.7);--smart-ui-bottom-sheet-dragger-node-background:hsla(0,0%,100%,.3);--smart-ui-dialog-background:#333;--smart-ui-border-image:linear-gradient(90deg,hsla(0,0%,100%,0),hsla(0,0%,100%,.3),hsla(0,0%,100%,0))}.smart-manrope{font-family:Manrope,sans-serif}.smart-tree-select{color:var(--tree-select-font-color,var(--app-B6-N1,#000));display:flex;font-size:var(--tree-select-font-size,14px);position:relative;-webkit-user-select:none;user-select:none}.smart-tree-select__nav{--sidebar-padding:var(--tree-select-nav-item-padding,12px 8px 12px 12px);background-color:var(--tree-select-nav-background-color,var(--app-B3,#fff));flex:1}.smart-tree-select__nav__inner{height:100%;width:100%!important}.smart-tree-select__content{background-color:var(--tree-select-content-background-color,var(--app-B3,#fff));flex:2}.smart-tree-select__item{font-weight:700;line-height:var(--tree-select-item-height,44px);padding:0 32px 0 var(--padding-md,16px);position:relative}.smart-tree-select__item--active{color:var(--tree-select-item-active-color,#ee0a24)}.smart-tree-select__item--disabled{color:var(--tree-select-item-disabled-color,var(--app-B6-N4,rgba(0,0,0,.4)))}.smart-tree-select__selected{position:absolute;right:var(--padding-md,16px);top:50%;transform:translateY(-50%)}
|
|
@@ -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:#fff;--smart-ui-border-image:linear-gradient(90deg,transparent,rgba(0,0,0,.3),transparent)
|
|
1
|
+
@import '../common/index.css';:root{--smart-ui-overlay:rgba(0,0,0,.4);--smart-ui-bottom-sheet-dragger-node-background:rgba(0,0,0,.3);--smart-ui-dialog-background:#fff;--smart-ui-border-image:linear-gradient(90deg,transparent,rgba(0,0,0,.3),transparent)}:root[theme=dark]{--smart-ui-overlay:rgba(0,0,0,.7);--smart-ui-bottom-sheet-dragger-node-background:hsla(0,0%,100%,.3);--smart-ui-dialog-background:#333;--smart-ui-border-image:linear-gradient(90deg,hsla(0,0%,100%,0),hsla(0,0%,100%,.3),hsla(0,0%,100%,0))}.smart-manrope{font-family:Manrope,sans-serif}.smart-action-sheet{border-radius:var(--popup-round-border-radius,var(--popup-round-border-radius,16px))!important;color:var(--action-sheet-item-text-color,var(--app-B4-N1,#000));left:var(--action-sheet-left,16px)!important;margin:var(--action-sheet-margin,0 0 16px);max-height:var(--action-sheet-max-height,90%)!important;width:var(--action-sheet-width,calc(100% - 32px))!important}.smart-action-sheet__list{max-height:336px;overflow-y:scroll}.smart-action-sheet__icon{--icon-color:var(--action-sheet-active-icon-color,var(--app-M1,#3678e3));font-size:var(--action-sheet-item-icon-size,28px);margin:var(--action-sheet-item-icon-margin,0 16px 0 0);position:absolute;right:0;top:0;transform:translateY(50%)}.smart-action-sheet__item{border-radius:var(--action-sheet-item-border-radius,0);color:var(--action-sheet-item-text-color,var(--app-B4-N1,#000));min-height:56px}.smart-action-sheet__item:not(:last-child){border-bottom:.5px solid var(--action-sheet-header-border-color,var(--app-B4-N7,rgba(0,0,0,.08)))}.smart-action-sheet__cancel,.smart-action-sheet__confirm,.smart-action-sheet__item{background-color:var(--action-sheet-item-background,var(--app-B4,#fff));font-size:var(--action-sheet-item-font-size,16px);font-weight:var(--action-sheet-item-font-weight,normal);line-height:var(--action-sheet-item-line-height,24px);padding:16px;text-align:center;width:100%}.smart-action-sheet__cancel--hover,.smart-action-sheet__confirm--hover,.smart-action-sheet__item--hover{background-color:var(--action-sheet-active-color,var(--app-B1,#f6f7fb))}.smart-action-sheet__cancel:after,.smart-action-sheet__confirm:after,.smart-action-sheet__item:after{border-width:0}.smart-action-sheet__cancel{color:var(--action-sheet-cancel-text-color,var(--app-B4-N3,rgba(0,0,0,.5)))}.smart-action-sheet__confirm{color:var(--action-sheet-confirm-text-color,var(--app-B4-N1,#000));font-weight:var(--action-sheet-confirm-font-weight,500)}.smart-action-sheet__gap{background-color:var(--action-sheet-footer-padding-color,var(--app-B4-N9,rgba(0,0,0,.05)));display:block;height:var(--action-sheet-footer-padding-top,8px)}.smart-action-sheet__item--disabled{opacity:var(--action-sheet-item-disabled-opacity,.3)}.smart-action-sheet__item--disabled.smart-action-sheet__item--hover{background-color:var(--action-sheet-item-background,var(--app-B4,#fff))}.smart-action-sheet__subname{color:var(--action-sheet-subname-color,var(--app-B4-N3,rgba(0,0,0,.5)));font-size:var(--action-sheet-subname-font-size,12px);line-height:var(--action-sheet-subname-line-height,20px);margin-top:var(--padding-xs,8px)}.smart-action-sheet__header{border-bottom:.5px solid var(--action-sheet-header-border-color,var(--app-B4-N7,rgba(0,0,0,.08)));color:var(--action-sheet-header-color,var(--app-B4-N3,rgba(0,0,0,.5)));font-size:var(--action-sheet-header-font-size,16px);font-weight:var(--action-sheet-header-font-weight,normal);line-height:var(--action-sheet-header-height,56px);text-align:center}.smart-action-sheet__description{color:var(--action-sheet-description-color,var(--app-B4-N3,rgba(0,0,0,.5)));font-size:var(--action-sheet-description-font-size,14px);line-height:var(--action-sheet-description-line-height,20px);padding:20px var(--padding-md,16px);text-align:center}.smart-action-sheet__loading{color:inherit!important;display:flex!important}.smart-action-sheet__footer{align-items:center;background-color:var(--action-sheet-item-background,var(--app-B4,#fff));display:flex;font-size:var(--action-sheet-item-font-size,16px);justify-content:space-around;line-height:var(--action-sheet-item-line-height,22px);text-align:center}
|
|
@@ -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:#fff;--smart-ui-border-image:linear-gradient(90deg,transparent,rgba(0,0,0,.3),transparent)
|
|
1
|
+
@import '../common/index.wxss';:root{--smart-ui-overlay:rgba(0,0,0,.4);--smart-ui-bottom-sheet-dragger-node-background:rgba(0,0,0,.3);--smart-ui-dialog-background:#fff;--smart-ui-border-image:linear-gradient(90deg,transparent,rgba(0,0,0,.3),transparent)}:root[theme=dark]{--smart-ui-overlay:rgba(0,0,0,.7);--smart-ui-bottom-sheet-dragger-node-background:hsla(0,0%,100%,.3);--smart-ui-dialog-background:#333;--smart-ui-border-image:linear-gradient(90deg,hsla(0,0%,100%,0),hsla(0,0%,100%,.3),hsla(0,0%,100%,0))}.smart-manrope{font-family:Manrope,sans-serif}.smart-action-sheet{border-radius:var(--popup-round-border-radius,var(--popup-round-border-radius,16px))!important;color:var(--action-sheet-item-text-color,var(--app-B4-N1,#000));left:var(--action-sheet-left,16px)!important;margin:var(--action-sheet-margin,0 0 16px);max-height:var(--action-sheet-max-height,90%)!important;width:var(--action-sheet-width,calc(100% - 32px))!important}.smart-action-sheet__list{max-height:336px;overflow-y:scroll}.smart-action-sheet__icon{--icon-color:var(--action-sheet-active-icon-color,var(--app-M1,#3678e3));font-size:var(--action-sheet-item-icon-size,28px);margin:var(--action-sheet-item-icon-margin,0 16px 0 0);position:absolute;right:0;top:0;transform:translateY(50%)}.smart-action-sheet__item{border-radius:var(--action-sheet-item-border-radius,0);color:var(--action-sheet-item-text-color,var(--app-B4-N1,#000));min-height:56px}.smart-action-sheet__item:not(:last-child){border-bottom:.5px solid var(--action-sheet-header-border-color,var(--app-B4-N7,rgba(0,0,0,.08)))}.smart-action-sheet__cancel,.smart-action-sheet__confirm,.smart-action-sheet__item{background-color:var(--action-sheet-item-background,var(--app-B4,#fff));font-size:var(--action-sheet-item-font-size,16px);font-weight:var(--action-sheet-item-font-weight,normal);line-height:var(--action-sheet-item-line-height,24px);padding:16px;text-align:center;width:100%}.smart-action-sheet__cancel--hover,.smart-action-sheet__confirm--hover,.smart-action-sheet__item--hover{background-color:var(--action-sheet-active-color,var(--app-B1,#f6f7fb))}.smart-action-sheet__cancel:after,.smart-action-sheet__confirm:after,.smart-action-sheet__item:after{border-width:0}.smart-action-sheet__cancel{color:var(--action-sheet-cancel-text-color,var(--app-B4-N3,rgba(0,0,0,.5)))}.smart-action-sheet__confirm{color:var(--action-sheet-confirm-text-color,var(--app-B4-N1,#000));font-weight:var(--action-sheet-confirm-font-weight,500)}.smart-action-sheet__gap{background-color:var(--action-sheet-footer-padding-color,var(--app-B4-N9,rgba(0,0,0,.05)));display:block;height:var(--action-sheet-footer-padding-top,8px)}.smart-action-sheet__item--disabled{opacity:var(--action-sheet-item-disabled-opacity,.3)}.smart-action-sheet__item--disabled.smart-action-sheet__item--hover{background-color:var(--action-sheet-item-background,var(--app-B4,#fff))}.smart-action-sheet__subname{color:var(--action-sheet-subname-color,var(--app-B4-N3,rgba(0,0,0,.5)));font-size:var(--action-sheet-subname-font-size,12px);line-height:var(--action-sheet-subname-line-height,20px);margin-top:var(--padding-xs,8px)}.smart-action-sheet__header{border-bottom:.5px solid var(--action-sheet-header-border-color,var(--app-B4-N7,rgba(0,0,0,.08)));color:var(--action-sheet-header-color,var(--app-B4-N3,rgba(0,0,0,.5)));font-size:var(--action-sheet-header-font-size,16px);font-weight:var(--action-sheet-header-font-weight,normal);line-height:var(--action-sheet-header-height,56px);text-align:center}.smart-action-sheet__description{color:var(--action-sheet-description-color,var(--app-B4-N3,rgba(0,0,0,.5)));font-size:var(--action-sheet-description-font-size,14px);line-height:var(--action-sheet-description-line-height,20px);padding:20px var(--padding-md,16px);text-align:center}.smart-action-sheet__loading{color:inherit!important;display:flex!important}.smart-action-sheet__footer{align-items:center;background-color:var(--action-sheet-item-background,var(--app-B4,#fff));display:flex;font-size:var(--action-sheet-item-font-size,16px);justify-content:space-around;line-height:var(--action-sheet-item-line-height,22px);text-align:center}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import '../common/index.css';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
var component_1 = require("../common/component");
|
|
15
|
+
var shared_1 = require("../picker/shared");
|
|
16
|
+
var utils_1 = require("../common/utils");
|
|
17
|
+
var EMPTY_CODE = '000000';
|
|
18
|
+
(0, component_1.SmartComponent)({
|
|
19
|
+
classes: ['active-class', 'toolbar-class', 'column-class'],
|
|
20
|
+
props: __assign(__assign({}, shared_1.pickerProps), { showToolbar: {
|
|
21
|
+
type: Boolean,
|
|
22
|
+
value: true,
|
|
23
|
+
}, value: {
|
|
24
|
+
type: String,
|
|
25
|
+
observer: function (value) {
|
|
26
|
+
this.code = value;
|
|
27
|
+
this.setValues();
|
|
28
|
+
},
|
|
29
|
+
}, areaList: {
|
|
30
|
+
type: Object,
|
|
31
|
+
value: {},
|
|
32
|
+
observer: 'setValues',
|
|
33
|
+
}, columnsNum: {
|
|
34
|
+
type: null,
|
|
35
|
+
value: 3,
|
|
36
|
+
}, columnsPlaceholder: {
|
|
37
|
+
type: Array,
|
|
38
|
+
observer: function (val) {
|
|
39
|
+
this.setData({
|
|
40
|
+
typeToColumnsPlaceholder: {
|
|
41
|
+
province: val[0] || '',
|
|
42
|
+
city: val[1] || '',
|
|
43
|
+
county: val[2] || '',
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
},
|
|
47
|
+
} }),
|
|
48
|
+
data: {
|
|
49
|
+
columns: [{ values: [] }, { values: [] }, { values: [] }],
|
|
50
|
+
typeToColumnsPlaceholder: {},
|
|
51
|
+
},
|
|
52
|
+
mounted: function () {
|
|
53
|
+
var _this = this;
|
|
54
|
+
(0, utils_1.requestAnimationFrame)(function () {
|
|
55
|
+
_this.setValues();
|
|
56
|
+
});
|
|
57
|
+
},
|
|
58
|
+
methods: {
|
|
59
|
+
getPicker: function () {
|
|
60
|
+
if (this.picker == null) {
|
|
61
|
+
this.picker = this.selectComponent('.smart-area__picker');
|
|
62
|
+
}
|
|
63
|
+
return this.picker;
|
|
64
|
+
},
|
|
65
|
+
onCancel: function (event) {
|
|
66
|
+
this.emit('cancel', event.detail);
|
|
67
|
+
},
|
|
68
|
+
onConfirm: function (event) {
|
|
69
|
+
var index = event.detail.index;
|
|
70
|
+
var value = event.detail.value;
|
|
71
|
+
value = this.parseValues(value);
|
|
72
|
+
this.emit('confirm', { value: value, index: index });
|
|
73
|
+
},
|
|
74
|
+
emit: function (type, detail) {
|
|
75
|
+
detail.values = detail.value;
|
|
76
|
+
delete detail.value;
|
|
77
|
+
this.$emit(type, detail);
|
|
78
|
+
},
|
|
79
|
+
parseValues: function (values) {
|
|
80
|
+
var columnsPlaceholder = this.data.columnsPlaceholder;
|
|
81
|
+
return values.map(function (value, index) {
|
|
82
|
+
if (value && (!value.code || value.name === columnsPlaceholder[index])) {
|
|
83
|
+
return __assign(__assign({}, value), { code: '', name: '' });
|
|
84
|
+
}
|
|
85
|
+
return value;
|
|
86
|
+
});
|
|
87
|
+
},
|
|
88
|
+
onChange: function (event) {
|
|
89
|
+
var _this = this;
|
|
90
|
+
var _a;
|
|
91
|
+
var _b = event.detail, index = _b.index, picker = _b.picker, value = _b.value;
|
|
92
|
+
this.code = value[index].code;
|
|
93
|
+
(_a = this.setValues()) === null || _a === void 0 ? void 0 : _a.then(function () {
|
|
94
|
+
_this.$emit('change', {
|
|
95
|
+
picker: picker,
|
|
96
|
+
values: _this.parseValues(picker.getValues()),
|
|
97
|
+
index: index,
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
},
|
|
101
|
+
getConfig: function (type) {
|
|
102
|
+
var areaList = this.data.areaList;
|
|
103
|
+
return (areaList && areaList["".concat(type, "_list")]) || {};
|
|
104
|
+
},
|
|
105
|
+
getList: function (type, code) {
|
|
106
|
+
if (type !== 'province' && !code) {
|
|
107
|
+
return [];
|
|
108
|
+
}
|
|
109
|
+
var typeToColumnsPlaceholder = this.data.typeToColumnsPlaceholder;
|
|
110
|
+
var list = this.getConfig(type);
|
|
111
|
+
var result = Object.keys(list).map(function (code) { return ({
|
|
112
|
+
code: code,
|
|
113
|
+
name: list[code],
|
|
114
|
+
}); });
|
|
115
|
+
if (code != null) {
|
|
116
|
+
// oversea code
|
|
117
|
+
if (code[0] === '9' && type === 'city') {
|
|
118
|
+
code = '9';
|
|
119
|
+
}
|
|
120
|
+
result = result.filter(function (item) { return item.code.indexOf(code) === 0; });
|
|
121
|
+
}
|
|
122
|
+
if (typeToColumnsPlaceholder[type] && result.length) {
|
|
123
|
+
// set columns placeholder
|
|
124
|
+
var codeFill = type === 'province'
|
|
125
|
+
? ''
|
|
126
|
+
: type === 'city'
|
|
127
|
+
? EMPTY_CODE.slice(2, 4)
|
|
128
|
+
: EMPTY_CODE.slice(4, 6);
|
|
129
|
+
result.unshift({
|
|
130
|
+
code: "".concat(code).concat(codeFill),
|
|
131
|
+
name: typeToColumnsPlaceholder[type],
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
return result;
|
|
135
|
+
},
|
|
136
|
+
getIndex: function (type, code) {
|
|
137
|
+
var compareNum = type === 'province' ? 2 : type === 'city' ? 4 : 6;
|
|
138
|
+
var list = this.getList(type, code.slice(0, compareNum - 2));
|
|
139
|
+
// oversea code
|
|
140
|
+
if (code[0] === '9' && type === 'province') {
|
|
141
|
+
compareNum = 1;
|
|
142
|
+
}
|
|
143
|
+
code = code.slice(0, compareNum);
|
|
144
|
+
for (var i = 0; i < list.length; i++) {
|
|
145
|
+
if (list[i].code.slice(0, compareNum) === code) {
|
|
146
|
+
return i;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
return 0;
|
|
150
|
+
},
|
|
151
|
+
setValues: function () {
|
|
152
|
+
var picker = this.getPicker();
|
|
153
|
+
if (!picker) {
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
var code = this.code || this.getDefaultCode();
|
|
157
|
+
var provinceList = this.getList('province');
|
|
158
|
+
var cityList = this.getList('city', code.slice(0, 2));
|
|
159
|
+
var stack = [];
|
|
160
|
+
var indexes = [];
|
|
161
|
+
var columnsNum = this.data.columnsNum;
|
|
162
|
+
if (columnsNum >= 1) {
|
|
163
|
+
stack.push(picker.setColumnValues(0, provinceList, false));
|
|
164
|
+
indexes.push(this.getIndex('province', code));
|
|
165
|
+
}
|
|
166
|
+
if (columnsNum >= 2) {
|
|
167
|
+
stack.push(picker.setColumnValues(1, cityList, false));
|
|
168
|
+
indexes.push(this.getIndex('city', code));
|
|
169
|
+
if (cityList.length && code.slice(2, 4) === '00') {
|
|
170
|
+
code = cityList[0].code;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
if (columnsNum === 3) {
|
|
174
|
+
stack.push(picker.setColumnValues(2, this.getList('county', code.slice(0, 4)), false));
|
|
175
|
+
indexes.push(this.getIndex('county', code));
|
|
176
|
+
}
|
|
177
|
+
return Promise.all(stack)
|
|
178
|
+
.catch(function () { })
|
|
179
|
+
.then(function () { return picker.setIndexes(indexes); })
|
|
180
|
+
.catch(function () { });
|
|
181
|
+
},
|
|
182
|
+
getDefaultCode: function () {
|
|
183
|
+
var columnsPlaceholder = this.data.columnsPlaceholder;
|
|
184
|
+
if (columnsPlaceholder.length) {
|
|
185
|
+
return EMPTY_CODE;
|
|
186
|
+
}
|
|
187
|
+
var countyCodes = Object.keys(this.getConfig('county'));
|
|
188
|
+
if (countyCodes[0]) {
|
|
189
|
+
return countyCodes[0];
|
|
190
|
+
}
|
|
191
|
+
var cityCodes = Object.keys(this.getConfig('city'));
|
|
192
|
+
if (cityCodes[0]) {
|
|
193
|
+
return cityCodes[0];
|
|
194
|
+
}
|
|
195
|
+
return '';
|
|
196
|
+
},
|
|
197
|
+
getValues: function () {
|
|
198
|
+
var picker = this.getPicker();
|
|
199
|
+
if (!picker) {
|
|
200
|
+
return [];
|
|
201
|
+
}
|
|
202
|
+
return this.parseValues(picker.getValues().filter(function (value) { return !!value; }));
|
|
203
|
+
},
|
|
204
|
+
getDetail: function () {
|
|
205
|
+
var values = this.getValues();
|
|
206
|
+
var area = {
|
|
207
|
+
code: '',
|
|
208
|
+
country: '',
|
|
209
|
+
province: '',
|
|
210
|
+
city: '',
|
|
211
|
+
county: '',
|
|
212
|
+
};
|
|
213
|
+
if (!values.length) {
|
|
214
|
+
return area;
|
|
215
|
+
}
|
|
216
|
+
var names = values.map(function (item) { return item.name; });
|
|
217
|
+
area.code = values[values.length - 1].code;
|
|
218
|
+
if (area.code[0] === '9') {
|
|
219
|
+
area.country = names[1] || '';
|
|
220
|
+
area.province = names[2] || '';
|
|
221
|
+
}
|
|
222
|
+
else {
|
|
223
|
+
area.province = names[0] || '';
|
|
224
|
+
area.city = names[1] || '';
|
|
225
|
+
area.county = names[2] || '';
|
|
226
|
+
}
|
|
227
|
+
return area;
|
|
228
|
+
},
|
|
229
|
+
reset: function (code) {
|
|
230
|
+
this.code = code || '';
|
|
231
|
+
return this.setValues();
|
|
232
|
+
},
|
|
233
|
+
},
|
|
234
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<wxs src="./index.wxs" module="computed" />
|
|
2
|
+
|
|
3
|
+
<smart-picker
|
|
4
|
+
class="smart-area__picker"
|
|
5
|
+
active-class="active-class"
|
|
6
|
+
toolbar-class="toolbar-class"
|
|
7
|
+
column-class="column-class"
|
|
8
|
+
show-toolbar="{{ showToolbar }}"
|
|
9
|
+
value-key="name"
|
|
10
|
+
title="{{ title }}"
|
|
11
|
+
loading="{{ loading }}"
|
|
12
|
+
columns="{{ computed.displayColumns(columns, columnsNum) }}"
|
|
13
|
+
item-height="{{ itemHeight }}"
|
|
14
|
+
visible-item-count="{{ visibleItemCount }}"
|
|
15
|
+
cancel-button-text="{{ cancelButtonText }}"
|
|
16
|
+
confirm-button-text="{{ confirmButtonText }}"
|
|
17
|
+
bind:change="onChange"
|
|
18
|
+
bind:confirm="onConfirm"
|
|
19
|
+
bind:cancel="onCancel"
|
|
20
|
+
/>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import '../common/index.wxss';
|
package/lib/battery/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
var component_1 = require("../common/component");
|
|
4
|
-
var
|
|
4
|
+
var wrapBatteryD = 'M6.5,0 C6.77614237,-5.07265313e-17 7,0.223857625 7,0.5 L7,1 L9.5,1 C10.3284271,1 11,1.67157288 11,2.5 L11,17.5 C11,18.3284271 10.3284271,19 9.5,19 L1.5,19 C0.671572875,19 0,18.3284271 0,17.5 L0,2.5 C0,1.67157288 0.671572875,1 1.5,1 L4,1 L4,0.5 C4,0.223857625 4.22385763,5.07265313e-17 4.5,0 L6.5,0 Z M9.5,2 L1.5,2 C1.22385763,2 1,2.22385763 1,2.5 L1,17.5 C1,17.7761424 1.22385763,18 1.5,18 L9.5,18 C9.77614237,18 10,17.7761424 10,17.5 L10,2.5 C10,2.22385763 9.77614237,2 9.5,2 Z';
|
|
5
5
|
(0, component_1.SmartComponent)({
|
|
6
6
|
props: {
|
|
7
7
|
type: {
|
|
@@ -11,7 +11,6 @@ var chargingSvg = '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://w
|
|
|
11
11
|
size: {
|
|
12
12
|
type: Number,
|
|
13
13
|
value: 10,
|
|
14
|
-
observer: 'init',
|
|
15
14
|
},
|
|
16
15
|
value: {
|
|
17
16
|
type: Number,
|
|
@@ -20,134 +19,73 @@ var chargingSvg = '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://w
|
|
|
20
19
|
},
|
|
21
20
|
highColor: {
|
|
22
21
|
type: String,
|
|
23
|
-
value: '
|
|
22
|
+
value: '#70CF98',
|
|
24
23
|
},
|
|
25
24
|
middleColor: {
|
|
26
25
|
type: String,
|
|
27
|
-
value: '
|
|
26
|
+
value: '#F5A623',
|
|
28
27
|
},
|
|
29
28
|
lowColor: {
|
|
30
29
|
type: String,
|
|
31
|
-
value: '
|
|
32
|
-
},
|
|
33
|
-
chargingColor: {
|
|
34
|
-
type: String,
|
|
35
|
-
value: 'var(--battery-body-charging-background, #2fc755)',
|
|
36
|
-
},
|
|
37
|
-
inCharging: {
|
|
38
|
-
type: Boolean,
|
|
39
|
-
value: false,
|
|
30
|
+
value: '#FF4444',
|
|
40
31
|
},
|
|
41
32
|
backgroundColor: String,
|
|
42
|
-
color: String,
|
|
43
|
-
showText: {
|
|
44
|
-
type: Boolean,
|
|
45
|
-
value: false,
|
|
46
|
-
},
|
|
47
33
|
onCalcColor: null,
|
|
34
|
+
color: String,
|
|
48
35
|
},
|
|
49
36
|
data: {
|
|
50
|
-
|
|
51
|
-
chargingSvg: '',
|
|
52
|
-
insidePercent: 0,
|
|
53
|
-
bodyStyle: '',
|
|
54
|
-
dotStyle: '',
|
|
55
|
-
zeroStyle: '',
|
|
56
|
-
zeroInnerStyle: '',
|
|
37
|
+
svgUrl: '',
|
|
57
38
|
},
|
|
58
39
|
created: function () {
|
|
59
40
|
this.init();
|
|
60
41
|
},
|
|
61
42
|
methods: {
|
|
62
43
|
init: function () {
|
|
63
|
-
var
|
|
64
|
-
var
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
if (sizeData) {
|
|
71
|
-
var width = sizeData.width, height = sizeData.height, dotWidth = sizeData.dotWidth, dotHeight = sizeData.dotHeight, dotPadding = sizeData.dotPadding, zeroWidth = sizeData.zeroWidth, zeroHeight = sizeData.zeroHeight, zeroInnerWidth = sizeData.zeroInnerWidth, zeroInnerHeight = sizeData.zeroInnerHeight, borderRadius = sizeData.borderRadius, dotBorderRadius = sizeData.dotBorderRadius, zeroBorderRadius = sizeData.zeroBorderRadius;
|
|
72
|
-
var backgroundColorStyle = this.data.backgroundColor
|
|
73
|
-
? "background-color: ".concat(this.data.backgroundColor, ";")
|
|
74
|
-
: '';
|
|
75
|
-
var isFull = String(insidePercent) === '100';
|
|
76
|
-
if (this.data.type === 'horizontal') {
|
|
77
|
-
bodyStyle = "width: ".concat(height, "px; height: ").concat(width, "px; border-radius: ").concat(borderRadius, "px; ").concat(backgroundColorStyle);
|
|
78
|
-
dotStyle = "width: ".concat(dotHeight, "px; height: ").concat(dotWidth, "px; margin-left: ").concat(dotPadding, "px; border-radius: ").concat(dotBorderRadius, "px; ").concat(isFull ? '' : backgroundColorStyle);
|
|
79
|
-
zeroStyle = "width: ".concat(zeroHeight, "px; height: ").concat(zeroWidth, "px; border-radius: ").concat(zeroBorderRadius, "px;");
|
|
80
|
-
zeroInnerStyle = "width: ".concat(zeroInnerHeight, "px; height: ").concat(zeroInnerWidth, "px;");
|
|
81
|
-
}
|
|
82
|
-
else {
|
|
83
|
-
bodyStyle = "width: ".concat(width, "px; height: ").concat(height, "px; border-radius: ").concat(borderRadius, "px; ").concat(backgroundColorStyle);
|
|
84
|
-
dotStyle = "width: ".concat(dotWidth, "px; height: ").concat(dotHeight, "px; margin-bottom: ").concat(dotPadding, "px; border-radius: ").concat(dotBorderRadius, "px; ").concat(isFull ? '' : backgroundColorStyle);
|
|
85
|
-
zeroStyle = "width: ".concat(zeroWidth, "px; height: ").concat(zeroHeight, "px; border-radius: ").concat(zeroBorderRadius, "px;");
|
|
86
|
-
zeroInnerStyle = "width: ".concat(zeroInnerWidth, "px; height: ").concat(zeroInnerHeight, "px;");
|
|
87
|
-
}
|
|
44
|
+
var bgColor = this.getBgColor();
|
|
45
|
+
var IValue = this.data.value;
|
|
46
|
+
if (IValue > 100) {
|
|
47
|
+
IValue = 100;
|
|
48
|
+
}
|
|
49
|
+
else if (IValue < 0) {
|
|
50
|
+
IValue = 0;
|
|
88
51
|
}
|
|
52
|
+
var top = 17 - ((17 - 3) * IValue) / 100;
|
|
53
|
+
// 左上、右上、右下、左下
|
|
54
|
+
var points = "2 ".concat(top, " 9 ").concat(top, " 9 17 2 17");
|
|
55
|
+
var insideColor = this.calcColor(top);
|
|
56
|
+
var svgNode = "<svg\n width=\"".concat(1.1 * this.data.size, "px\"\n height=\"").concat(1.9 * this.data.size, "px\"\n viewBox=\"0 0 11 19\"\n >\n <path d='").concat(wrapBatteryD, "' fill='").concat(this.data.backgroundColor || bgColor, "' />\n <polygon points='").concat(points, "' fill='").concat(insideColor, "' />\n </svg>");
|
|
89
57
|
this.setData({
|
|
90
|
-
|
|
91
|
-
insidePercentStr: this.data.type === 'vertical' ? "height: ".concat(insidePercent, "%") : "width: ".concat(insidePercent, "%"),
|
|
92
|
-
insideBotBgClass: String(insidePercent) === '100' ? 'high-bg' : 'base-bg',
|
|
93
|
-
chargingSvg: this.toSvgCssBackground(chargingSvg),
|
|
94
|
-
bodyStyle: bodyStyle,
|
|
95
|
-
dotStyle: dotStyle,
|
|
96
|
-
zeroStyle: zeroStyle,
|
|
97
|
-
zeroInnerStyle: zeroInnerStyle,
|
|
58
|
+
svgUrl: this.toSvgCssBackground(svgNode),
|
|
98
59
|
});
|
|
99
60
|
},
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
61
|
+
getBgColor: function () {
|
|
62
|
+
var WX = wx;
|
|
63
|
+
var bgColor = WX.getThemeInfo();
|
|
64
|
+
if (bgColor && bgColor['--app-B1-N3']) {
|
|
65
|
+
return bgColor['--app-B1-N3'];
|
|
104
66
|
}
|
|
105
|
-
var
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
var dotWidth = this.data.size * 0.4; // 4 !
|
|
109
|
-
var dotHeight = this.data.size * 0.15; // 1.5 !
|
|
110
|
-
var dotBorderRadius = this.data.size * 0.05; // 0.5
|
|
111
|
-
var dotPadding = this.data.size * 0.05; // 0.5
|
|
112
|
-
var zeroWidth = this.data.size * 0.4; // 4 !
|
|
113
|
-
var zeroHeight = this.data.size * 1.6; // 16
|
|
114
|
-
var zeroInnerWidth = this.data.size * 0.15; // 1.5 !
|
|
115
|
-
var zeroInnerHeight = this.data.size * 1.6; // 16
|
|
116
|
-
var zeroBorderRadius = this.data.size * 0.2; // 2
|
|
117
|
-
return {
|
|
118
|
-
width: width,
|
|
119
|
-
height: height,
|
|
120
|
-
dotWidth: dotWidth,
|
|
121
|
-
dotHeight: dotHeight,
|
|
122
|
-
dotPadding: dotPadding,
|
|
123
|
-
zeroWidth: zeroWidth,
|
|
124
|
-
zeroHeight: zeroHeight,
|
|
125
|
-
zeroInnerWidth: zeroInnerWidth,
|
|
126
|
-
zeroInnerHeight: zeroInnerHeight,
|
|
127
|
-
borderRadius: borderRadius,
|
|
128
|
-
dotBorderRadius: dotBorderRadius,
|
|
129
|
-
zeroBorderRadius: zeroBorderRadius,
|
|
130
|
-
};
|
|
131
|
-
},
|
|
132
|
-
calcColor: function (value) {
|
|
133
|
-
if (typeof this.data.onCalcColor === 'function') {
|
|
134
|
-
return this.data.onCalcColor();
|
|
67
|
+
var d = wx.getSystemInfoSync();
|
|
68
|
+
if (d && d.theme === 'light') {
|
|
69
|
+
return '#fff';
|
|
135
70
|
}
|
|
71
|
+
return 'rgba(0, 0, 0, 0.5)';
|
|
72
|
+
},
|
|
73
|
+
calcColor: function (top) {
|
|
136
74
|
if (this.data.color) {
|
|
137
75
|
return this.data.color;
|
|
138
76
|
}
|
|
139
|
-
|
|
140
|
-
|
|
77
|
+
// 自定义电量的颜色分配规则
|
|
78
|
+
var color = typeof this.data.onCalcColor === 'function' && this.data.onCalcColor();
|
|
79
|
+
if (color) {
|
|
80
|
+
return color;
|
|
141
81
|
}
|
|
142
|
-
if (
|
|
82
|
+
if (top <= 14.2 && top >= 3) {
|
|
143
83
|
return this.data.highColor;
|
|
144
84
|
}
|
|
145
|
-
if (
|
|
85
|
+
if (top <= 15.6 && top > 14.2) {
|
|
146
86
|
return this.data.middleColor;
|
|
147
87
|
}
|
|
148
|
-
|
|
149
|
-
return this.data.lowColor;
|
|
150
|
-
}
|
|
88
|
+
return this.data.lowColor;
|
|
151
89
|
},
|
|
152
90
|
toSvgCssBackground: function (svgString) {
|
|
153
91
|
var res = svgString;
|
|
@@ -161,7 +99,7 @@ var chargingSvg = '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://w
|
|
|
161
99
|
.replace(/</g, '%3C')
|
|
162
100
|
.replace(/>/g, '%3E')
|
|
163
101
|
.replace(/\s+/g, ' ');
|
|
164
|
-
return "background-image: url(\"data:image/svg+xml,".concat(res, "\"); width:
|
|
102
|
+
return "background-image: url(\"data:image/svg+xml,".concat(res, "\"); width: ").concat(1.1 * this.data.size, "px; height: ").concat(1.9 * this.data.size, "px; background-repeat: no-repeat; transform: ").concat(this.data.type === 'horizontal' ? 'rotate(90deg)' : '0');
|
|
165
103
|
},
|
|
166
104
|
},
|
|
167
105
|
});
|
package/lib/battery/index.wxml
CHANGED
|
@@ -1,21 +1 @@
|
|
|
1
|
-
<view
|
|
2
|
-
<view class="contain {{ type === 'vertical' ? 'contain-vertical' : 'contain-horizontal' }}">
|
|
3
|
-
<view
|
|
4
|
-
class="body {{ value === 0 ? '' : 'overflow-hidden' }} {{ type === 'vertical' ? 'body-vertical' : 'body-horizontal' }}"
|
|
5
|
-
style="{{ bodyStyle }}">
|
|
6
|
-
<view class="bar {{ type === 'vertical' ? 'bar-vertical' : 'bar-horizontal' }}"
|
|
7
|
-
style="background-color: {{ insideColor }}; {{insidePercentStr}}">
|
|
8
|
-
</view>
|
|
9
|
-
<view class="icon" wx:if="{{ inCharging }}" style="{{chargingSvg}}"></view>
|
|
10
|
-
<view wx:if="{{ value === 0 && !inCharging }}"
|
|
11
|
-
class="zero {{ type === 'vertical' ? 'zero-vertical' : 'zero-horizontal' }}" style="{{ zeroStyle }}">
|
|
12
|
-
<view class="zero zero-inner {{ type === 'vertical' ? 'zero-inner-vertical' : 'zero-inner-horizontal' }}"
|
|
13
|
-
style="{{ zeroInnerStyle }}">
|
|
14
|
-
</view>
|
|
15
|
-
</view>
|
|
16
|
-
</view>
|
|
17
|
-
<view class="dot {{ type === 'vertical' ? 'dot-vertical' : 'dot-horizontal' }} {{ insideBotBgClass }}"
|
|
18
|
-
style="{{ dotStyle }}"></view>
|
|
19
|
-
</view>
|
|
20
|
-
<view class="text" wx:if="{{ showText }}">{{ value }}%</view>
|
|
21
|
-
</view>
|
|
1
|
+
<view style="{{svgUrl}}"></view>
|
|
@@ -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:#fff;--smart-ui-border-image:linear-gradient(90deg,transparent,rgba(0,0,0,.3),transparent)
|
|
1
|
+
@import '../common/index.css';:root{--smart-ui-overlay:rgba(0,0,0,.4);--smart-ui-bottom-sheet-dragger-node-background:rgba(0,0,0,.3);--smart-ui-dialog-background:#fff;--smart-ui-border-image:linear-gradient(90deg,transparent,rgba(0,0,0,.3),transparent)}:root[theme=dark]{--smart-ui-overlay:rgba(0,0,0,.7);--smart-ui-bottom-sheet-dragger-node-background:hsla(0,0%,100%,.3);--smart-ui-dialog-background:#333;--smart-ui-border-image:linear-gradient(90deg,hsla(0,0%,100%,0),hsla(0,0%,100%,.3),hsla(0,0%,100%,0))}.smart-manrope{font-family:Manrope,sans-serif}.smart-bottom-sheet{color:var(--bottom-sheet-font-color,var(--app-B4-N1,#000));display:flex;flex-direction:column;max-height:var(--bottom-sheet-max-height,50%);min-height:var(--bottom-sheet-min-height,auto);padding-bottom:env(safe-area-inset-bottom);width:var(--bottom-sheet-width,100%)}.smart-bottom-sheet__header{color:var(--bottom-sheet-header-color,var(--app-B4-N1,#000));font-size:var(--bottom-sheet-header-font-size,17px);font-weight:var(--bottom-sheet-header-font-weight,600);line-height:var(--bottom-sheet-header-height,56px);padding:var(--bottom-sheet-header-padding,0 16px);text-align:center}.smart-bottom-sheet__header:empty{display:none}.smart-bottom-sheet__dragger{align-items:center;display:flex;justify-content:center;padding:var(--bottom-sheet-dragger-padding,8px 0)}.smart-bottom-sheet__dragger_node{background:var(--bottom-sheet-dragger-node-background,var(--smart-ui-bottom-sheet-dragger-node-background,rgba(0,0,0,.3)));border-radius:var(--bottom-sheet-dragger-node-border-radius,2px);height:var(--bottom-sheet-dragger-node-height,4px);width:var(--bottom-sheet-dragger-node-width,30px)}.smart-bottom-sheet__content{box-sizing:border-box;overflow-y:auto;padding:var(--bottom-sheet-padding,0 16px);position:relative}.smart-bottom-sheet__content_height{overflow-y:visible}.smart-bottom-sheet__icon{margin:var(--bottom-sheet-icon-margin,16px 16px 0 0);position:absolute;right:0;top:0}
|
|
@@ -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:#fff;--smart-ui-border-image:linear-gradient(90deg,transparent,rgba(0,0,0,.3),transparent)
|
|
1
|
+
@import '../common/index.wxss';:root{--smart-ui-overlay:rgba(0,0,0,.4);--smart-ui-bottom-sheet-dragger-node-background:rgba(0,0,0,.3);--smart-ui-dialog-background:#fff;--smart-ui-border-image:linear-gradient(90deg,transparent,rgba(0,0,0,.3),transparent)}:root[theme=dark]{--smart-ui-overlay:rgba(0,0,0,.7);--smart-ui-bottom-sheet-dragger-node-background:hsla(0,0%,100%,.3);--smart-ui-dialog-background:#333;--smart-ui-border-image:linear-gradient(90deg,hsla(0,0%,100%,0),hsla(0,0%,100%,.3),hsla(0,0%,100%,0))}.smart-manrope{font-family:Manrope,sans-serif}.smart-bottom-sheet{color:var(--bottom-sheet-font-color,var(--app-B4-N1,#000));display:flex;flex-direction:column;max-height:var(--bottom-sheet-max-height,50%);min-height:var(--bottom-sheet-min-height,auto);padding-bottom:env(safe-area-inset-bottom);width:var(--bottom-sheet-width,100%)}.smart-bottom-sheet__header{color:var(--bottom-sheet-header-color,var(--app-B4-N1,#000));font-size:var(--bottom-sheet-header-font-size,17px);font-weight:var(--bottom-sheet-header-font-weight,600);line-height:var(--bottom-sheet-header-height,56px);padding:var(--bottom-sheet-header-padding,0 16px);text-align:center}.smart-bottom-sheet__header:empty{display:none}.smart-bottom-sheet__dragger{align-items:center;display:flex;justify-content:center;padding:var(--bottom-sheet-dragger-padding,8px 0)}.smart-bottom-sheet__dragger_node{background:var(--bottom-sheet-dragger-node-background,var(--smart-ui-bottom-sheet-dragger-node-background,rgba(0,0,0,.3)));border-radius:var(--bottom-sheet-dragger-node-border-radius,2px);height:var(--bottom-sheet-dragger-node-height,4px);width:var(--bottom-sheet-dragger-node-width,30px)}.smart-bottom-sheet__content{box-sizing:border-box;overflow-y:auto;padding:var(--bottom-sheet-padding,0 16px);position:relative}.smart-bottom-sheet__content_height{overflow-y:visible}.smart-bottom-sheet__icon{margin:var(--bottom-sheet-icon-margin,16px 16px 0 0);position:absolute;right:0;top:0}
|