Skip to content

Commit be3c6c2

Browse files
author
CIN
authored
Merge pull request #537 from DaoCloud/release/1.0.6
Release/1.0.6
2 parents 2fc4f6a + e1b8a08 commit be3c6c2

16 files changed

+742
-667
lines changed

.github/PULL_REQUEST_TEMPLATE.md

+21-14
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,35 @@
11
## 步骤一
22

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

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

12-
## 步骤二
7+
- [ ] fix
138

14-
完成以下内容的填写,您就可以顺利提交 Pull Request:
9+
- [ ] test
10+
11+
- [ ] hotfix
12+
13+
- [ ] optimize/refactor
14+
15+
- [ ] document/example
1516

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

19+
- [ ] release
1820

19-
**2. Pull Request的简要介绍(请填于下一行)**
21+
- [ ] other
22+
23+
24+
## 步骤二
25+
26+
完成以下内容的填写,您就可以顺利提交 Pull Request:
2027

28+
**1. Pull Request 内容和 Issue 链接**
2129

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

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

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

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

28-
<!-- 如果您是本项目Maintainer的话,请务必在该PR右边的Label栏目中,添加相应的label标签-->

changelogs/v1.0.6.md

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<a name="1.0.6"></a>
2+
# 1.0.6 (2018-08-09)
3+
4+
5+
## Bug Fixes
6+
7+
- ***:** 组件支持自定义文案
8+
([942e5763](https://github.com/DaoCloud/dao-style-vue/commit/942e5763d94f67cd65c8a5a6decb3f7309ae32c0))
9+
- **input:**
10+
- 调整 numeric-input 判断逻辑
11+
([7491d02f](https://github.com/DaoCloud/dao-style-vue/commit/7491d02fded7cd16c8a540c81a4eea88031b2026))
12+
- numeric input v-model 为 null 时会报错
13+
([d714d021](https://github.com/DaoCloud/dao-style-vue/commit/d714d0210992f6694cd6d22d82695a4fecd7b8d4))
14+
- numeric input 重置没有生效
15+
([e93cab1b](https://github.com/DaoCloud/dao-style-vue/commit/e93cab1bcc50e6d4a2e2d07a88a647ab26f57fd0))
16+
17+
18+
## Features
19+
20+
- ***:** 简化 pr 格式
21+
([60a793bf](https://github.com/DaoCloud/dao-style-vue/commit/60a793bfbd13b2d6789600f2258bc6f8f5286f0f))
22+

dist/dao-style.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/styles/dao-style.css

+629-629
Large diffs are not rendered by default.

docs/dao-clipboard.md

+3
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,6 @@ Clipboard 组件用于实现复制到粘贴板的功能。代码请参照目录
6464
|参数名|类型|说明|默认值|是否必填|
6565
|-----|---|----|----|---|
6666
| with-btn | Boolean | 是否需要复制按钮,如果传入的是 false,则没有复制按钮,且点击文字可以全选并复制文本 |-||
67+
| copy-text | String | 复制提示文本 | 点击复制 ||
68+
| copied-text | String | 复制成功提示文本 | 复制成功 ||
69+
| copy-failed-text | String | 复制失败提示文本 | 复制失败 ||

docs/dao-editable-table.md

+2
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ export default {
9191
| ------- | ------ | ---------------------------------- | ---- | ---- |
9292
| config | Object | 配置对象。具体内容见 [config 对象](#config-对象) | - ||
9393
| v-model | Object | 数据绑定的对象 | - ||
94+
| operation-text | String | 操作的头部文字 | 编辑 ||
95+
| add-text | String | 添加文字 | 添加 ||
9496

9597
### 组件的事件
9698
| 事件名称 | 说明 | 回调参数 |

docs/dao-input.md

+6-3
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,8 @@ Editable Input 是一个可以编辑的 Disabled Input。当我们不希望用
155155
| required | Boolean | 必填 | false ||
156156
| no-border | Boolean | input 是否没有边框 | false ||
157157
| show-tooltip-only-hover | Boolean | 只有在鼠标 hover 到 icon 上时才会出现 tooltip | true ||
158-
| helperText | String | input 中辅助提示 | 按回车键搜索 ||
159-
| showHelperText | Boolean | input 是否辅助提示 | false ||
158+
| helper-text | String | input 中辅助提示 | 按回车键搜索 ||
159+
| show-helper-text | Boolean | input 是否辅助提示 | false ||
160160
| placeholder | String | 输入框占位文本 | - ||
161161
| readonly | Boolean | 原生属性,是否只读 | false ||
162162
| autofocus | Boolean | 原生属性,自动获得焦点 | false ||
@@ -192,7 +192,10 @@ Editable Input 是一个可以编辑的 Disabled Input。当我们不希望用
192192

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

docs/dao-radio.md

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

src/components/dao-clipboard/dao-copy-block.vue

+15-3
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@
99
:on-error="copyError"
1010
:content="content"
1111
v-if="withBtn">
12-
<tooltip content="复制成功" v-if="success">
12+
<tooltip :content="copiedText" v-if="success">
1313
<svg>
1414
<use xlink:href="#icon_clipboard-success"></use>
1515
</svg>
1616
</tooltip>
17-
<tooltip content="复制失败" v-if="fail">
17+
<tooltip :content="copyFailedText" v-if="fail">
1818
<svg>
1919
<use xlink:href="#icon_clipboard"></use>
2020
</svg>
2121
</tooltip>
22-
<tooltip content="点击复制" v-if="!success && !fail">
22+
<tooltip :content="copyText" v-if="!success && !fail">
2323
<svg>
2424
<use xlink:href="#icon_clipboard"></use>
2525
</svg>
@@ -41,6 +41,18 @@
4141
type: Boolean,
4242
default: true,
4343
},
44+
copyText: {
45+
type: String,
46+
default: '点击复制',
47+
},
48+
copiedText: {
49+
type: String,
50+
default: '复制成功',
51+
},
52+
copyFailedText: {
53+
type: String,
54+
default: '复制失败',
55+
},
4456
},
4557
// 原本简单的用 computed 无法及时的获取到已修改的内容
4658
// 改成当组件挂载和更新之后赋值,可以及时获取

src/components/dao-editable-table/dao-editable-table.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<thead>
44
<tr>
55
<th v-for="th in header">{{ th.text }}</th>
6-
<th class="det-edit-col">编辑</th>
6+
<th class="det-edit-col">{{ operationText }}</th>
77
</tr>
88
</thead>
99
<tbody>
@@ -50,6 +50,6 @@
5050
</table>
5151
<div class="det-add" @click="addRow">
5252
<svg class="det-add-btn"><use xlink:href="#icon_plus-circled"></use></svg>
53-
<span class="det-add-span">添加</span>
53+
<span class="det-add-span">{{ addText }}</span>
5454
</div>
5555
</div>

src/components/dao-editable-table/dao-editable-table.js

+12-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,18 @@ export default {
1515
components: {
1616
daoDrop,
1717
},
18-
props: ['config', 'value'],
18+
props: {
19+
config: {},
20+
value: {},
21+
operationText: {
22+
type: String,
23+
default: '编辑',
24+
},
25+
addText: {
26+
type: String,
27+
default: '添加',
28+
},
29+
},
1930
data() {
2031
return {
2132
activatedRow: null,

src/components/dao-input/dao-editable-input.vue

+15-7
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,22 @@
1515
<template v-if="!$slots.prepend && !$slots.append" slot="button">
1616
<div class="edit-op">
1717
<div class="edit-op-toggle" v-show="!isEdit" @click="edit">
18-
<svg><use xlink:href="#icon_pencil"></use></svg><span class="text">更改</span>
18+
<svg><use xlink:href="#icon_pencil"></use></svg><span class="text">{{ editBtnText }}</span>
1919
</div>
2020
<div class="edit-op-btn" v-show="isEdit">
21-
<button class="dao-btn blue" @click="save">{{ saveBtnContent }}</button>
22-
<button class="dao-btn ghost" @click="cancel">取消</button>
21+
<button class="dao-btn blue" @click="save">{{ saveBtnText }}</button>
22+
<button class="dao-btn ghost" @click="cancel">{{ cancelBtnText }}</button>
2323
</div>
2424
</div>
2525
</template>
2626
</dao-input>
2727
<div v-if="$slots.prepend || $slots.append" class="edit-op">
2828
<div class="edit-op-toggle" v-show="!isEdit" @click="edit">
29-
<svg><use xlink:href="#icon_pencil"></use></svg><span class="text">更改</span>
29+
<svg><use xlink:href="#icon_pencil"></use></svg><span class="text">{{ editBtnText }}</span>
3030
</div>
3131
<div class="edit-op-btn" v-show="isEdit">
32-
<button class="dao-btn blue" @click="save">{{ saveBtnContent }}</button>
33-
<button class="dao-btn ghost" @click="cancel">取消</button>
32+
<button class="dao-btn blue" @click="save">{{ saveBtnText }}</button>
33+
<button class="dao-btn ghost" @click="cancel">{{ cancelBtnText }}</button>
3434
</div>
3535
</div>
3636
</div>
@@ -52,10 +52,18 @@
5252
},
5353
props: {
5454
value: [String, Number],
55-
saveBtnContent: {
55+
saveBtnText: {
5656
type: String,
5757
default: '保存',
5858
},
59+
editBtnText: {
60+
type: String,
61+
default: '更改',
62+
},
63+
cancelBtnText: {
64+
type: String,
65+
default: '取消',
66+
},
5967
editState: Boolean,
6068
onCheck: {
6169
type: Function,

src/components/dao-input/dao-numeric-input.vue

+5-4
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,19 @@
1919
<script>
2020
2121
import DaoTriangle from './dao-triangle/dao-triangle.vue';
22+
import { _toString } from '../../utils/assist';
2223
2324
function isInt(num) {
2425
if (num === undefined) return false;
25-
return /^(0|[1-9][0-9]*)$/.test(num >= 0 ? num : num.toString().slice(1));
26+
return /^(0|[1-9][0-9]*)$/.test(num >= 0 ? num : _toString(num).slice(1));
2627
}
2728
2829
function isFloat(num) {
2930
return /^(-?\d+)(\.\d+)?$/.test(num);
3031
}
3132
3233
function isEndWithDot(num) {
33-
const arr = num.toString().split('.');
34+
const arr = _toString(num).split('.');
3435
if (arr.length === 2 && isInt(arr[0]) && arr[1] === '') {
3536
return true;
3637
}
@@ -117,13 +118,13 @@
117118
onBlur() {
118119
this.dirty = true;
119120
if (this.type === 'float' && isEndWithDot(this.num)) {
120-
this.preCheck(this.num.toString().split('.').shift());
121+
this.preCheck(_toString(this.num).split('.').shift());
121122
}
122123
},
123124
preCheck(num) {
124125
this.num = num;
125126
// not required
126-
if (num === '' && !this.required) {
127+
if ((!num && num !== 0) && !this.required) {
127128
this.updateModel();
128129
return;
129130
}

src/components/dao-radio/dao-radio-plus.vue

+5-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
</div>
1010
<div class="radio-select">
1111
<dao-select ref="select" :async="async" :disabled="disabled" v-model="select" :placeholder="selectTitle" :loading="loading" @change="handleSelectChange">
12-
<dao-option-group no-data-text="暂无结果">
12+
<dao-option-group :no-data-text="noDataText">
1313
<dao-option v-for="option in options" :key="option.value" :value="option.value" :label="option.label"></dao-option>
1414
</dao-option-group>
1515
</dao-select>
@@ -51,6 +51,10 @@
5151
default: false,
5252
},
5353
radioValue: {},
54+
noDataText: {
55+
type: String,
56+
default: '暂无结果',
57+
},
5458
},
5559
mounted() {
5660
// 挂载时,如果被选中,则执行

src/utils/assist.js

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export { default as _chunk } from 'lodash/chunk';
1717
export { default as _get } from 'lodash/get';
1818
export { default as _flatten } from 'lodash/flatten';
1919
export { default as _toNumber } from 'lodash/toNumber';
20+
export { default as _toString } from 'lodash/toString';
2021
export { default as _findIndex } from 'lodash/findIndex';
2122
export { default as _merge } from 'lodash/merge';
2223
export { default as _uniqBy } from 'lodash/uniqBy';

version.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* eslint-disable */
22
// this version shows current version of project
3-
var VERSION = '1.0.5';
3+
var VERSION = '1.0.6';
44
module.exports = { VERSION: VERSION };
55
// ’make release‘ 依赖 console.log 把打印到标准输出, 不可删除
66
console.log(VERSION);

0 commit comments

Comments
 (0)