Skip to content

Commit

Permalink
Merge pull request #537 from DaoCloud/release/1.0.6
Browse files Browse the repository at this point in the history
Release/1.0.6
  • Loading branch information
CIN authored Aug 9, 2018
2 parents 2fc4f6a + e1b8a08 commit be3c6c2
Show file tree
Hide file tree
Showing 16 changed files with 742 additions and 667 deletions.
35 changes: 21 additions & 14 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,35 @@
## 步骤一

请您按照规范确认这个PR的类型:<!--在相对应类型的 [] 输入 x,此PR能且仅能属于以下种类中的一种。输入x时,请确保[]内只有x字母,没有任何空格字节-->
请您按照规范确认这个PR的类型:

<!-- 确保源分支基于 develop 分支创建,并向develop 分支提起PR请求(本项目 90% 的PR属于此类型)-->
- [ ] feature/fix/docs PR
<!-- 确保源分支基于 master 分支创建,并向 master 分支提PR,以及向develop分支提PR(只有绝少数PR属于此类型)-->
- [ ] hotfix PR
<!-- 确保源分支基于 develop 分支创建,并向 master 分支提PR,以及向develop分支提PR(只有绝少数PR属于此类型)-->
- [ ] release PR
- [ ] feature

## 步骤二
- [ ] fix

完成以下内容的填写,您就可以顺利提交 Pull Request:
- [ ] test

- [ ] hotfix

- [ ] optimize/refactor

- [ ] document/example

**1. 填写Pull Reqeust主要针对的类型于下一行,选项有:bug/feature(特性)/enhancement(增强)/docs(文档)**
- [ ] build

- [ ] release

**2. Pull Request的简要介绍(请填于下一行)**
- [ ] other


## 步骤二

完成以下内容的填写,您就可以顺利提交 Pull Request:

**1. Pull Request 内容和 Issue 链接**

**3. Pull Request针对问题的重现方式(没有请在下一行填“无”)**

**2. Pull Request 针对问题的重现方式**

**4. Pull Request可能涉及到的组件范围(没有请在下一行填“无”)**

**3. Pull Request 可能涉及到的组件范围**

<!-- 如果您是本项目Maintainer的话,请务必在该PR右边的Label栏目中,添加相应的label标签-->
22 changes: 22 additions & 0 deletions changelogs/v1.0.6.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<a name="1.0.6"></a>
# 1.0.6 (2018-08-09)


## Bug Fixes

- ***:** 组件支持自定义文案
([942e5763](https://github.com/DaoCloud/dao-style-vue/commit/942e5763d94f67cd65c8a5a6decb3f7309ae32c0))
- **input:**
- 调整 numeric-input 判断逻辑
([7491d02f](https://github.com/DaoCloud/dao-style-vue/commit/7491d02fded7cd16c8a540c81a4eea88031b2026))
- numeric input v-model 为 null 时会报错
([d714d021](https://github.com/DaoCloud/dao-style-vue/commit/d714d0210992f6694cd6d22d82695a4fecd7b8d4))
- numeric input 重置没有生效
([e93cab1b](https://github.com/DaoCloud/dao-style-vue/commit/e93cab1bcc50e6d4a2e2d07a88a647ab26f57fd0))


## Features

- ***:** 简化 pr 格式
([60a793bf](https://github.com/DaoCloud/dao-style-vue/commit/60a793bfbd13b2d6789600f2258bc6f8f5286f0f))

4 changes: 2 additions & 2 deletions dist/dao-style.min.js

Large diffs are not rendered by default.

1,258 changes: 629 additions & 629 deletions dist/styles/dao-style.css

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions docs/dao-clipboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,6 @@ Clipboard 组件用于实现复制到粘贴板的功能。代码请参照目录
|参数名|类型|说明|默认值|是否必填|
|-----|---|----|----|---|
| with-btn | Boolean | 是否需要复制按钮,如果传入的是 false,则没有复制按钮,且点击文字可以全选并复制文本 |-||
| copy-text | String | 复制提示文本 | 点击复制 ||
| copied-text | String | 复制成功提示文本 | 复制成功 ||
| copy-failed-text | String | 复制失败提示文本 | 复制失败 ||
2 changes: 2 additions & 0 deletions docs/dao-editable-table.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ export default {
| ------- | ------ | ---------------------------------- | ---- | ---- |
| config | Object | 配置对象。具体内容见 [config 对象](#config-对象) | - ||
| v-model | Object | 数据绑定的对象 | - ||
| operation-text | String | 操作的头部文字 | 编辑 ||
| add-text | String | 添加文字 | 添加 ||

### 组件的事件
| 事件名称 | 说明 | 回调参数 |
Expand Down
9 changes: 6 additions & 3 deletions docs/dao-input.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@ Editable Input 是一个可以编辑的 Disabled Input。当我们不希望用
| required | Boolean | 必填 | false ||
| no-border | Boolean | input 是否没有边框 | false ||
| show-tooltip-only-hover | Boolean | 只有在鼠标 hover 到 icon 上时才会出现 tooltip | true ||
| helperText | String | input 中辅助提示 | 按回车键搜索 ||
| showHelperText | Boolean | input 是否辅助提示 | false ||
| helper-text | String | input 中辅助提示 | 按回车键搜索 ||
| show-helper-text | Boolean | input 是否辅助提示 | false ||
| placeholder | String | 输入框占位文本 | - ||
| readonly | Boolean | 原生属性,是否只读 | false ||
| autofocus | Boolean | 原生属性,自动获得焦点 | false ||
Expand Down Expand Up @@ -192,7 +192,10 @@ Editable Input 是一个可以编辑的 Disabled Input。当我们不希望用

| 参数名 | 类型 | 说明 | 默认值 | 是否必填 |
| :--------------: | :------: | :----------------------------: | :---: | :--: |
| save-btn-content | String | 保存按钮中显示的内容 | 保存 ||
| save-btn-text | String | 保存按钮中显示的文字 | 保存 ||
| edit-btn-text | String | 更改按钮中显示的内容 | 更改 ||
| cancel-btn-text | String | 取消按钮中显示的内容 | 取消 ||
| edit-state | Boolean | 初始编辑状态 | false ||
| on-check | Function | 检查输入的函数,符合要求返回 true,否则返回 false | - ||
| on-success | Function | 如果检查符合输入,进行的处理 | - ||

1 change: 1 addition & 0 deletions docs/dao-radio.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ Radio 是一个单选框组件。代码请参照目录:[src/components/dao-rad
|-----|------|-----|-------|---------|
| headline | string | 指定 radio-plus 中的标题 | - ||
| select-title | string | radio-plus 中 select 的默认显示 | - ||
| no-data-text | string | radio-plus 中 select 的 no-data-text 的默认显示 | 暂无结果 ||
| options | object | radio-plus 中 select 的选项数据 | - ||
| async | function | radio-plus 中获取 select 中数据的函数,当你传入了此参数时,该 function 会在 radio 被 check 或点击 radio 中的 select 时触发。另外值得注意的是,这个 async 方法必须返回一个 Promise,当这个 Promise 成功 resolve 之后就不在调用这个 function | - ||

Expand Down
18 changes: 15 additions & 3 deletions src/components/dao-clipboard/dao-copy-block.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@
:on-error="copyError"
:content="content"
v-if="withBtn">
<tooltip content="复制成功" v-if="success">
<tooltip :content="copiedText" v-if="success">
<svg>
<use xlink:href="#icon_clipboard-success"></use>
</svg>
</tooltip>
<tooltip content="复制失败" v-if="fail">
<tooltip :content="copyFailedText" v-if="fail">
<svg>
<use xlink:href="#icon_clipboard"></use>
</svg>
</tooltip>
<tooltip content="点击复制" v-if="!success && !fail">
<tooltip :content="copyText" v-if="!success && !fail">
<svg>
<use xlink:href="#icon_clipboard"></use>
</svg>
Expand All @@ -41,6 +41,18 @@
type: Boolean,
default: true,
},
copyText: {
type: String,
default: '点击复制',
},
copiedText: {
type: String,
default: '复制成功',
},
copyFailedText: {
type: String,
default: '复制失败',
},
},
// 原本简单的用 computed 无法及时的获取到已修改的内容
// 改成当组件挂载和更新之后赋值,可以及时获取
Expand Down
4 changes: 2 additions & 2 deletions src/components/dao-editable-table/dao-editable-table.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<thead>
<tr>
<th v-for="th in header">{{ th.text }}</th>
<th class="det-edit-col">编辑</th>
<th class="det-edit-col">{{ operationText }}</th>
</tr>
</thead>
<tbody>
Expand Down Expand Up @@ -50,6 +50,6 @@
</table>
<div class="det-add" @click="addRow">
<svg class="det-add-btn"><use xlink:href="#icon_plus-circled"></use></svg>
<span class="det-add-span">添加</span>
<span class="det-add-span">{{ addText }}</span>
</div>
</div>
13 changes: 12 additions & 1 deletion src/components/dao-editable-table/dao-editable-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,18 @@ export default {
components: {
daoDrop,
},
props: ['config', 'value'],
props: {
config: {},
value: {},
operationText: {
type: String,
default: '编辑',
},
addText: {
type: String,
default: '添加',
},
},
data() {
return {
activatedRow: null,
Expand Down
22 changes: 15 additions & 7 deletions src/components/dao-input/dao-editable-input.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,22 @@
<template v-if="!$slots.prepend && !$slots.append" slot="button">
<div class="edit-op">
<div class="edit-op-toggle" v-show="!isEdit" @click="edit">
<svg><use xlink:href="#icon_pencil"></use></svg><span class="text">更改</span>
<svg><use xlink:href="#icon_pencil"></use></svg><span class="text">{{ editBtnText }}</span>
</div>
<div class="edit-op-btn" v-show="isEdit">
<button class="dao-btn blue" @click="save">{{ saveBtnContent }}</button>
<button class="dao-btn ghost" @click="cancel">取消</button>
<button class="dao-btn blue" @click="save">{{ saveBtnText }}</button>
<button class="dao-btn ghost" @click="cancel">{{ cancelBtnText }}</button>
</div>
</div>
</template>
</dao-input>
<div v-if="$slots.prepend || $slots.append" class="edit-op">
<div class="edit-op-toggle" v-show="!isEdit" @click="edit">
<svg><use xlink:href="#icon_pencil"></use></svg><span class="text">更改</span>
<svg><use xlink:href="#icon_pencil"></use></svg><span class="text">{{ editBtnText }}</span>
</div>
<div class="edit-op-btn" v-show="isEdit">
<button class="dao-btn blue" @click="save">{{ saveBtnContent }}</button>
<button class="dao-btn ghost" @click="cancel">取消</button>
<button class="dao-btn blue" @click="save">{{ saveBtnText }}</button>
<button class="dao-btn ghost" @click="cancel">{{ cancelBtnText }}</button>
</div>
</div>
</div>
Expand All @@ -52,10 +52,18 @@
},
props: {
value: [String, Number],
saveBtnContent: {
saveBtnText: {
type: String,
default: '保存',
},
editBtnText: {
type: String,
default: '更改',
},
cancelBtnText: {
type: String,
default: '取消',
},
editState: Boolean,
onCheck: {
type: Function,
Expand Down
9 changes: 5 additions & 4 deletions src/components/dao-input/dao-numeric-input.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,19 @@
<script>
import DaoTriangle from './dao-triangle/dao-triangle.vue';
import { _toString } from '../../utils/assist';
function isInt(num) {
if (num === undefined) return false;
return /^(0|[1-9][0-9]*)$/.test(num >= 0 ? num : num.toString().slice(1));
return /^(0|[1-9][0-9]*)$/.test(num >= 0 ? num : _toString(num).slice(1));
}
function isFloat(num) {
return /^(-?\d+)(\.\d+)?$/.test(num);
}
function isEndWithDot(num) {
const arr = num.toString().split('.');
const arr = _toString(num).split('.');
if (arr.length === 2 && isInt(arr[0]) && arr[1] === '') {
return true;
}
Expand Down Expand Up @@ -117,13 +118,13 @@
onBlur() {
this.dirty = true;
if (this.type === 'float' && isEndWithDot(this.num)) {
this.preCheck(this.num.toString().split('.').shift());
this.preCheck(_toString(this.num).split('.').shift());
}
},
preCheck(num) {
this.num = num;
// not required
if (num === '' && !this.required) {
if ((!num && num !== 0) && !this.required) {
this.updateModel();
return;
}
Expand Down
6 changes: 5 additions & 1 deletion src/components/dao-radio/dao-radio-plus.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</div>
<div class="radio-select">
<dao-select ref="select" :async="async" :disabled="disabled" v-model="select" :placeholder="selectTitle" :loading="loading" @change="handleSelectChange">
<dao-option-group no-data-text="暂无结果">
<dao-option-group :no-data-text="noDataText">
<dao-option v-for="option in options" :key="option.value" :value="option.value" :label="option.label"></dao-option>
</dao-option-group>
</dao-select>
Expand Down Expand Up @@ -51,6 +51,10 @@
default: false,
},
radioValue: {},
noDataText: {
type: String,
default: '暂无结果',
},
},
mounted() {
// 挂载时,如果被选中,则执行
Expand Down
1 change: 1 addition & 0 deletions src/utils/assist.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export { default as _chunk } from 'lodash/chunk';
export { default as _get } from 'lodash/get';
export { default as _flatten } from 'lodash/flatten';
export { default as _toNumber } from 'lodash/toNumber';
export { default as _toString } from 'lodash/toString';
export { default as _findIndex } from 'lodash/findIndex';
export { default as _merge } from 'lodash/merge';
export { default as _uniqBy } from 'lodash/uniqBy';
2 changes: 1 addition & 1 deletion version.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable */
// this version shows current version of project
var VERSION = '1.0.5';
var VERSION = '1.0.6';
module.exports = { VERSION: VERSION };
// ’make release‘ 依赖 console.log 把打印到标准输出, 不可删除
console.log(VERSION);

0 comments on commit be3c6c2

Please sign in to comment.