Merge pull request #133 from TuSimple/freestyle

Freestyle
This commit is contained in:
07akioni 2020-05-20 23:13:58 +08:00 committed by GitHub Enterprise
commit c8d065791b
8 changed files with 107 additions and 39 deletions

View File

@ -1,4 +1,10 @@
# CHANGELOG
## 1.1.3 (2020-05-20)
### Chores
- Update css-render dependencies.
### Fixes
- Fix the problem that `n-transfer`'s animation disorder when value changes.
## 1.1.2 (2020-05-19)
### Features
- Add content slot for `n-step`.

View File

@ -1,4 +1,10 @@
# CHANGELOG
## 1.1.3 (2020-05-20)
### Chores
- 更新 css-render 的依赖
### Fixes
- 修正了 `n-transfer` 在值改变时动画出错的问题。
## 1.1.2 (2020-05-19)
### Features
- 为 `n-step` 增加内容的 slot

View File

@ -1,6 +1,6 @@
{
"name": "naive-ui",
"version": "1.1.2",
"version": "1.1.3",
"description": "A Vue UI Framework. Caring About Styles, Themed, Batteries Included, Not Rather Slow.",
"main": "lib/index.js",
"module": "es/index.js",
@ -120,9 +120,9 @@
"webpack-dev-server": "^3.10.3"
},
"dependencies": {
"@css-render/plugin-bem": "^0.8.0",
"@css-render/plugin-bem": "^0.8.3",
"async-validator": "^1.11.5",
"css-render": "^0.8.0",
"css-render": "^0.8.3",
"date-fns": "^2.9.0",
"highlight.js": "^9.18.1",
"lodash-es": "^4.17.15",

View File

@ -18,8 +18,26 @@
<div
class="n-checkbox-box"
>
<check-mark class="n-checkbox-box__check-mark" />
<line-mark class="n-checkbox-box__line-mark" />
<n-icon-switch-transition>
<div
v-if="indeterminate"
key="indeterminate"
class="n-checkbox-icon"
>
<line-mark
class="n-checkbox-icon__line"
/>
</div>
<div
v-else
key="check"
class="n-checkbox-icon"
>
<check-mark
class="n-checkbox-icon__check"
/>
</div>
</n-icon-switch-transition>
</div>
<span
v-if="label !== null || $scopedSlots.default"
@ -41,6 +59,7 @@ import simulatedComputed from '../../_mixins/simulatedComputed'
import render from '../../_utils/vue/render'
import CheckMark from './CheckMark'
import LineMark from './LineMark'
import NIconSwitchTransition from '../../_transition/IconSwitchTransition'
export default {
name: 'NCheckbox',
@ -50,6 +69,7 @@ export default {
}
},
components: {
NIconSwitchTransition,
CheckMark,
LineMark,
render

View File

@ -17,8 +17,26 @@
class="n-checkbox-box"
@click="handleClick"
>
<check-mark class="n-checkbox-box__check-mark" />
<line-mark class="n-checkbox-box__line-mark" />
<n-icon-switch-transition>
<div
v-if="indeterminate"
key="indeterminate"
class="n-checkbox-icon"
>
<line-mark
class="n-checkbox-icon__line"
/>
</div>
<div
v-else
key="check"
class="n-checkbox-icon"
>
<check-mark
class="n-checkbox-icon__check"
/>
</div>
</n-icon-switch-transition>
</div>
</div>
</template>
@ -26,13 +44,15 @@
<script>
import CheckMark from './CheckMark'
import LineMark from './LineMark'
import NIconSwitchTransition from '../../_transition/IconSwitchTransition'
import createValidator from '../../_utils/vue/validateProp'
export default {
name: 'NSimpleCheckbox',
components: {
CheckMark,
LineMark
LineMark,
NIconSwitchTransition
},
model: {
prop: 'checked',

View File

@ -433,9 +433,6 @@ export default {
this.$nextTick().then(() => {
this.initialized = true
})
},
value () {
this.initMemorizedSourceOptions()
}
},
mounted () {

View File

@ -1,5 +1,6 @@
<script>
export default {
name: 'NNimbusServiceLayoutSiderMenu',
inject: {
NNimbusServiceLayout: {
default: false
@ -26,6 +27,9 @@ export default {
return subMenuNames
}
},
mounted () {
console.log(this)
},
methods: {
createMenu (h, items) {
return items.map(item => {

View File

@ -37,21 +37,28 @@
transition:
box-shadow 0.3s $--n-ease-in-out-cubic-bezier,
background-color 0.3s $--n-ease-in-out-cubic-bezier;
@include e(line-mark, check-mark) {
@include b(checkbox-icon) {
@include icon-switch-transition();
display: flex;
align-items: center;
justify-content: center;
position: absolute;
top: 1px;
left: 1px;
right: 1px;
bottom: 1px;
width: calc(100% - 2px);
opacity: 0;
transform: scale(0.5);
transform-origin: center;
transition:
fill 0.3s $--n-ease-in-out-cubic-bezier,
transform 0.3s $--n-ease-in-out-cubic-bezier,
opacity 0.3s $--n-ease-in-out-cubic-bezier,
border-color 0.3s $--n-ease-in-out-cubic-bezier;
left: 0;
right: 0;
top: 0;
bottom: 0;
transform: $--n-transform-debounce-scale;
@include e(line, check) {
width: calc(100% - 2px);
opacity: 0;
transform: scale(0.5);
transform-origin: center;
transition:
fill 0.3s $--n-ease-in-out-cubic-bezier,
transform 0.3s $--n-ease-in-out-cubic-bezier,
opacity 0.3s $--n-ease-in-out-cubic-bezier,
border-color 0.3s $--n-ease-in-out-cubic-bezier;
}
}
}
@include e(label) {
@ -61,21 +68,25 @@
}
@include m(checked) {
@include b(checkbox-box) {
@include e(check-mark) {
opacity: 1;
transform: scale(1);
@include b(checkbox-icon) {
@include e(check) {
opacity: 1;
transform: scale(1);
}
}
}
}
@include m(indeterminate) {
@include b(checkbox-box) {
@include e(check-mark) {
opacity: 0;
transform: scale(.5);
}
@include e(line-mark) {
opacity: 1;
transform: scale(1);
@include b(checkbox-icon) {
@include e(check) {
opacity: 0;
transform: scale(.5);
}
@include e(line) {
opacity: 1;
transform: scale(1);
}
}
}
}
@ -113,8 +124,10 @@
@include b(checkbox-box) {
background-color: map-get($--checkbox-background-color, 'default');
box-shadow: inset 0 0 0 1px map-get($--checkbox-border-color, 'default');
@include e(line-mark, check-mark) {
fill: map-get($--checkbox-icon-color, 'default');
@include b(checkbox-icon) {
@include e(check, line) {
fill: map-get($--checkbox-icon-color, 'default');
}
}
}
@include e(label) {
@ -144,8 +157,10 @@
@include b(checkbox-box) {
background-color: map-get($--checkbox-background-color, 'disabled');
box-shadow: inset 0 0 0 1px map-get($--checkbox-border-color, 'disabled');
@include e(check-mark, line-mark) {
fill: map-get($--checkbox-icon-color, 'disabled');
@include b(checkbox-icon) {
@include e(check, line) {
fill: map-get($--checkbox-icon-color, 'disabled');
}
}
}
@include e(label) {