-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5542d86
commit ffa08ce
Showing
12 changed files
with
258 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
## Cube-Segment-Picker | ||
|
||
<card> | ||
|
||
### 介绍 | ||
|
||
段选择器,用于实现多段的选择,比如选择时间段:2010年9月1日 - 2014年6月30日。 | ||
|
||
</card> | ||
|
||
## 示例 | ||
|
||
<card> | ||
|
||
### 城市选择器 | ||
|
||
可以配置多段城市选择。 | ||
|
||
<!-- @example: segment-city-picker --> | ||
|
||
</card> | ||
|
||
<card> | ||
|
||
### 日期选择器 | ||
|
||
<!-- @example: segment-date-picker --> | ||
|
||
</card> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
|
||
<template> | ||
<view class="switch-page"> | ||
<base-container> | ||
<view class="switch-example"> | ||
<view class="switch-show"> | ||
<cube-switch wx:model="{{valueOne}}"></cube-switch> | ||
<text class="switch-text">Switch</text> | ||
</view> | ||
<view class="switch-value">switch value: {{valueOne}}</view> | ||
</view> | ||
<view class="switch-example"> | ||
<view class="switch-show"> | ||
<cube-switch wx:model="{{valueTwo}}"></cube-switch> | ||
<text class="switch-text">Switch</text> | ||
</view> | ||
<view class="switch-value">switch value: {{valueTwo}}</view> | ||
</view> | ||
<view class="switch-example"> | ||
<view class="switch-show"> | ||
<cube-switch disabled="{{true}}" value="{{true}}"></cube-switch> | ||
<text class="switch-text">Disabled Switch</text> | ||
</view> | ||
<view class="switch-value">switch value: true</view> | ||
</view> | ||
<view class="switch-example"> | ||
<view class="switch-show"> | ||
<cube-switch disabled="{{true}}" value="{{false}}"></cube-switch> | ||
<text class="switch-text">Disabled Switch</text> | ||
</view> | ||
<view class="switch-value">switch value: false</view> | ||
</view> | ||
</base-container> | ||
</view> | ||
</template> | ||
|
||
<script> | ||
import { createPage } from '@mpxjs/core' | ||
|
||
createPage({ | ||
data: { | ||
valueOne: true, | ||
valueTwo: false | ||
} | ||
}) | ||
</script> | ||
|
||
<style lang="stylus"> | ||
.switch-page | ||
padding-top: 10px | ||
height 100% | ||
background-color rgba(239, 239, 244, .7) | ||
.switch-example | ||
.switch-show | ||
display: flex | ||
padding: 15px | ||
background-color: white | ||
.switch-text | ||
margin-left: 10px | ||
.switch-value | ||
margin: 10px 0 | ||
</style> | ||
|
||
<script type="application/json"> | ||
{ | ||
"usingComponents": { | ||
"base-container": "../../components/base-container/index.mpx", | ||
"cube-switch": "@mpxjs/mpx-cube-ui/src/components/switch/index.mpx" | ||
} | ||
} | ||
</script> |
19 changes: 19 additions & 0 deletions
19
packages/mpx-cube-ui/src/common/stylus/theme/components/rate.styl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// @type rate | ||
$rate-max-width := 100% | ||
$rate-justify-width := 100% | ||
|
||
|
||
// @type rate-item | ||
$rate-item-width := 32px | ||
$rate-item-def-width := 100% | ||
$rate-item-def-height := 100% | ||
$rate-item-def-background-size := 100% | ||
$rate-item-flex := 0 1 auto | ||
$rate-item-margin-right := 6px | ||
$rate-item-after-padding := 50% 0 | ||
$rate-item-last-child-margin-right := 0 | ||
|
||
|
||
|
||
|
||
|
17 changes: 17 additions & 0 deletions
17
packages/mpx-cube-ui/src/common/stylus/theme/components/switch.styl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// @type popup | ||
$switch-width := 40px | ||
$switch-height := 24px | ||
$switch-bgc := #EAEAEA | ||
$switch-border-radius := 15px | ||
$switch-transition := background-color 0.3s | ||
|
||
$switch-handle-top := 2px | ||
$switch-handle-left := 2px | ||
$switch-handle-width := 20px | ||
$switch-handle-height := 20px | ||
$switch-handle-bgc := #fff | ||
$switch-handle-border-radius := 50% | ||
$switch-handle-transition := left 0.3s | ||
|
||
$switch-bgc-on := #FF6435 | ||
$switch-handle-left-on := 18px |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<template> | ||
<view | ||
class="cube-switch" | ||
wx:class="{{ switchClass }}" | ||
bindtap="toggleSwitch" | ||
> | ||
<view class="cube-switch-handle" /> | ||
</view> | ||
</template> | ||
|
||
<script lang="ts" src="./index.ts"></script> | ||
|
||
<style lang="stylus"> | ||
@require "../../common/stylus/helper.styl" | ||
@require "../../common/stylus/theme/components/switch.styl" | ||
|
||
.cube-switch | ||
position: relative | ||
width: $var(switch-width) | ||
height: $var(switch-height) | ||
background-color: $var(switch-bgc) | ||
border-radius: $var(switch-border-radius) | ||
transition: $var(switch-transition) | ||
|
||
.cube-switch-handle | ||
position: absolute | ||
top: $var(switch-handle-top) | ||
left: $var(switch-handle-left) | ||
width: $var(switch-handle-width) | ||
height: $var(switch-handle-height) | ||
background-color: $var(switch-handle-bgc) | ||
border-radius: $var(switch-handle-border-radius) | ||
transition: $var(switch-handle-transition) | ||
|
||
.cube-switch-on | ||
background-color: $var(switch-bgc-on) | ||
.cube-switch-handle | ||
left: $var(switch-handle-left-on) | ||
</style> | ||
|
||
<script type="application/json"> | ||
{ | ||
"styleIsolation": "shared", | ||
"component": true | ||
} | ||
</script> |
Oops, something went wrong.