Skip to content

Commit

Permalink
publish v1.3.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Fasttian committed Jul 9, 2021
2 parents 169f3b4 + faef33d commit 8baa738
Show file tree
Hide file tree
Showing 69 changed files with 2,272 additions and 680 deletions.
28 changes: 14 additions & 14 deletions build/build-uniui.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ function buildChangeLog(callback) {
id,
version
} = item

if (version !== syncVersionsData[id]) {
let changelog = path.join(modulesPath, id, 'changelog.md')
// let = readChangelogFile(changelog)
let changeMd = fs.readFileSync(changelog).toString()
const mds = versionAll(changeMd, syncVersionsData[id])
let changeMd = fs.readFileSync(changelog).toString()
const mds = versionAll(changeMd, syncVersionsData[id])

let content = ''
mds.forEach(md => {
md = md.replace(/- /g, `- ${id} `).trim()
Expand All @@ -33,7 +33,7 @@ function buildChangeLog(callback) {
uniuimd += (content.trim() + '\n')
}
syncVersion[id] = version
})
})
// console.log(uniuimd);
uniuimd = uniuimd.trim()
if (uniuimd) {
Expand Down Expand Up @@ -219,13 +219,13 @@ function readChangelogFile(dir) {
}

function versionAll(md, oldVersion, mds = []) {
let data = readChangelog(md)
let data = readChangelog(md)
let {
loc,
log,
version
} = data
if (compareVersion(version, oldVersion)) {
} = data
if (compareVersion(version, oldVersion)) {
const newMd = md.substring(loc.end, md.length).trim()
mds.push(log)
versionAll(newMd, oldVersion, mds)
Expand Down Expand Up @@ -296,15 +296,15 @@ function compareVersion(a, b) {
b = b.split('.')
if (a.length !== b.length) {
return false
}
if (a[0] !== b[0]) {
return Number(a[0]) >= Number(b[0])
}
if (a[0] !== b[0]) {
return a[0] >= b[0]
}
if (a[1] !== b[1]) {
return a[1] >= b[1]
if (a[1] !== b[1]) {
return Number(a[1]) >= Number(b[1])
}
if (a[2] !== b[2]) {
return a[2] >= b[2]
if (a[2] !== b[2]) {
return Number(a[2]) >= Number(b[2])
}
return false
}
Expand Down
96 changes: 96 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,102 @@
- 主版本号:含有破坏性更新和新特性,不在发布周期内。

<!-- 更新占位 -->
<log title="1.3.6" date="2021-07-09">
<log-item title="uni-data-checkbox 组件更新">
<log-item-text tag-type="perf">
删除无用日志
</log-item-text>
<log-item-text tag-type="fix">
由 0.1.9 引起的非 nvue 端图标不显示的问题
</log-item-text>
<log-item-text tag-type="fix">
nvue 黑框样式问题
</log-item-text>
</log-item>
<log-item title="uni-datetime-picker 组件更新">
<log-item-text tag-type="fix">
范围选择不能动态赋值的 bug
</log-item-text>
<log-item-text tag-type="fix">
范围选择的初始时间在一个月内时,造成无法选择的bug
</log-item-text>
<log-item-text tag-type="perf">
弹出层在超出视窗边缘定位不准确的问题
</log-item-text>
<log-item-text tag-type="fix">
范围起始点样式的背景色与今日样式的字体前景色融合,导致日期字体看不清的 bug
</log-item-text>
<log-item-text tag-type="perf">
弹出层在超出视窗边缘被遮盖的问题
</log-item-text>
<log-item-text tag-type="feat">
maskClick 事件
</log-item-text>
<log-item-text tag-type="fix">
特殊情况日历 rpx 布局错误的 bug,rpx -> px
</log-item-text>
<log-item-text tag-type="fix">
范围选择时清空返回值不合理的bug,['', ''] -> []
</log-item-text>
<log-item-text tag-type="feat">
日期时间显示框支持插槽
</log-item-text>
</log-item>
<log-item title="uni-file-picker 组件更新">
<log-item-text tag-type="fix">
sourceType 缺少默认值导致 ios 无法选择文件
</log-item-text>
<log-item-text tag-type="perf">
解耦与uniCloud的强绑定关系 ,如不绑定服务空间,默认autoUpload为false且不可更改
</log-item-text>
</log-item>
<log-item title="uni-table 组件更新">
<log-item-text tag-type="feat">
uni-th 支持 date 日期筛选范围
</log-item-text>
<log-item-text tag-type="feat">
uni-th 支持 range 筛选范围
</log-item-text>
<log-item-text tag-type="feat">
uni-th 筛选功能
</log-item-text>
</log-item>
</log>

<log title="1.3.5" date="2021-07-02">
<log-item title="uni-card 组件更新">
<log-item-text tag-type="perf">
图文卡片无图片加载时,提供占位图标
</log-item-text>
<log-item-text tag-type="feat">
header 插槽,自定义卡片头部( 图文卡片 mode="style" 时,不支持)
</log-item-text>
<log-item-text tag-type="fix">
thumbnail 不存在仍然占位的 bug
</log-item-text>
</log-item>
<log-item title="uni-data-checkbox 组件更新">
<log-item-text tag-type="fix">
selectedTextColor 属性不生效的Bug
</log-item-text>
</log-item>
<log-item title="uni-datetime-picker 组件更新">
<log-item-text tag-type="perf">
添加 uni-icons 依赖
</log-item-text>
</log-item>
<log-item title="uni-easyinput 组件更新">
<log-item-text tag-type="fix">
confirmType 属性(仅 type="text" 生效)导致多行文本框无法换行的 bug
</log-item-text>
</log-item>
<log-item title="uni-forms 组件更新">
<log-item-text tag-type="fix">
pattern 属性在微信小程序平台无效的问题
</log-item-text>
</log-item>
</log>

<log title="1.3.4" date="2021-06-25">
<log-item title="uni-badge 组件更新">
<log-item-text tag-type="perf">
Expand Down
2 changes: 1 addition & 1 deletion docs/components/badge.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ url : pages/vue/badge/badge
|max-num |String/Numbuer|99 |展示封顶的数字值,超过 99 显示99+ |
|custom-style |Object | {} |自定义 Badge 样式, 样式对象语法 |
|inverted |Boolean|false |是否无需背景颜色,为 true 时,背景颜色将变为文字的字体颜色 |
|absolute |String| rightTop|开启绝对定位, 角标将定位到其包裹的标签的四个角上,可选值: rightTop(右上角)、rightBottom(右下角)、leftBottom(左下角) 、leftTop(左上角) |
|absolute (不支持 nvue) |String| rightTop|开启绝对定位, 角标将定位到其包裹的标签的四个角上,可选值: rightTop(右上角)、rightBottom(右下角)、leftBottom(左下角) 、leftTop(左上角) |
|offset |Array[number]| [0, 0]|距定位角中心点的偏移量,[-10, -10] 表示向 absolute 指定的方向偏移 10px,[10, 10] 表示向 absolute 指定的反方向偏移 10px,只有存在 absolute 属性时有效,与absolute 的值一一对应(例如:值为rightTop, 对应 offset 为 [right, Top]|

### Badge Events
Expand Down
1 change: 1 addition & 0 deletions docs/components/card.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,5 @@ url : pages/vue/card/card

|插槽称名 |说明 |
|:-: |:-: |
|header |卡片头部插槽( 图文卡片 mode="style" 时,不支持)|
|footer |卡片底部插槽 |
1 change: 1 addition & 0 deletions docs/components/data-checkbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ export default {
|selectedColor|String |- |#007aff|选中颜色|
|selectedTextColor|String |- |#333 |选中文本颜色,如不填写则自动显示|
|emptyText |String |- |暂无数据 |没有数据时显示的文字 ,本地数据无效|
|map |Object |- |{text:'text',value:'value'} |字段映射,将text/value映射到数据中的其他字段|

#### Localdata Options

Expand Down
106 changes: 99 additions & 7 deletions docs/components/datetime-picker.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,94 @@ ___点击 picker 默认值规则:___
``template`` 中使用组件

```html
<uni-datetime-picker></uni-datetime-picker>
<uni-datetime-picker v-model="vModelDatetime" start="2010-6-10 08:30:30" end="2021-6-10 08:30:30"></uni-datetime-picker>
<uni-datetime-picker :value="timestamp" return-type="timestamp" start="1276129830000" end="1623285030000" @change="timestampChange"></uni-datetime-picker>
<uni-datetime-picker type="date" :value="2020-6-25" start="2020-6-15" end="2025-6-15" @change="dateChange"></uni-datetime-picker>
<template>
<view class="page">
<text class="example-info">可以同时选择日期和时间的选择器</text>
<uni-section :title="'日期用法:' + single" type="line"></uni-section>
<view class="example-body">
<uni-datetime-picker type="date" :value="single" start="2021-3-20" end="2021-6-20" @change="change" />
</view>
<uni-section :title="'时间戳用法:' + single" type="line"></uni-section>
<view class="example-body">
<uni-datetime-picker returnType="timestamp" @change="changeLog($event)" start="2021-3-20" end="2021-5-20" />
</view>
<uni-section :title="'日期时间用法:' + datetimesingle" type="line"></uni-section>
<view class="example-body">
<uni-datetime-picker type="datetime" v-model="datetimesingle" @change="changeLog" />
</view>
<uni-section :title="'v-model用法:' + single" type="line"></uni-section>
<view class="example-body">
<uni-datetime-picker v-model="single" />
</view>
<uni-section :title="'插槽用法:' + single" type="line"></uni-section>
<view class="example-body">
<uni-datetime-picker v-model="single">我是一个插槽,点击我</uni-datetime-picker>
</view>
<uni-section :title="'无边框用法:' + single" type="line"></uni-section>
<view class="example-body">
<uni-datetime-picker v-model="single" :border="false" />
</view>
<uni-section :title="'disabled用法:' + single" type="line"></uni-section>
<view class="example-body">
<uni-datetime-picker v-model="single" disabled />
</view>
<uni-section :title="'日期范围用法:' + '[' + range + ']'" type="line"></uni-section>
<view class="example-body">
<uni-datetime-picker v-model="range" type="daterange" start="2021-3-20" end="2021-5-20"
rangeSeparator="" />
</view>
<uni-section :title="'日期时间范围用法:' + '[' + datetimerange + ']' " type="line"></uni-section>
<view class="example-body">
<uni-datetime-picker v-model="datetimerange" type="datetimerange"
start="2021-3-20 12:00:00" end="2021-6-20 20:00:00" rangeSeparator="" />
</view>
</view>
</template>

<script>
export default {
data() {
return {
single: '2021-04-3',
datetimesingle: '2021-04-3',
range: ['2021-03-8', '2021-4-20'],
datetimerange: ['2021-03-20 20:10:10', '2021-05-10 10:10:10'],
}
},
watch: {
datetimesingle(newval) {
console.log('单选:', this.datetimesingle);
},
range(newval) {
console.log('范围选:', this.range);
},
datetimerange(newval) {
console.log('范围选:', this.datetimerange);
}
},
mounted() {
setTimeout(() => {
this.datetimesingle = '2021-5-1'
this.single = '2021-5-1'
},1000)
},
methods:{
change(e) {
this.single = e
console.log('----change事件:', this.single = e);
},
changeLog(e) {
console.log('----change事件:', e);
}
}
}
</script>

<style lang="scss">
@import '@/common/uni-nvue.scss';
</style>
```

## API
Expand All @@ -42,10 +126,10 @@ ___点击 picker 默认值规则:___
|属性名 |类型 |默认值 |值域 |说明 |
|:-: |:-: |:-: | |:-: |
|type |String |datetime |date/daterange/datetime/datetimerange|选择器类型 |
|value |String、Number |- |- |输入框当前值 |
|value |String、Number、Array(范围选择)|- |- |输入框当前值 |
|start |String、Number |- |- |最小值,可以使用日期的字符串(String)、时间戳(Number) |
|end |String、Number |- |- |最大值,可以使用日期的字符串(String)、时间戳(Number) |
|return-type |String |timestamp|timestamp 、string |返回值格式 |
|return-type |String |string|timestamp 、string |返回值格式 |
|border |Boolean、String|true | |是否有边框 |
|rangeSeparator |String |'-' |- |选择范围时的分隔符 |
|placeholder |String |- |- |非范围选择时的占位内容 |
Expand All @@ -60,4 +144,12 @@ ___点击 picker 默认值规则:___

|事件名称 |说明 |返回值 |
|:-: |:-: |:-: |
|change |确定日期时间时触发的事件,参数为当前选择的日期对象 | 单选返回日期字符串,如:'2010-02-3';范围选返回日期字符串数组,如:['2020-10-1', '2021-4-1'] |
|change |确定日期时间时触发的事件,参数为当前选择的日期对象 | 单选返回日期字符串,如:'2010-02-3';范围选返回日期字符串数组,如:['2020-10-1', '2021-4-1'] |
|maskClick|点击遮罩层触发|-|

### Popup Methods

|方法称名 |说明|参数|
|:-:|:-:|:-:|
|show|打开弹出层|-|
|close|关闭弹出层 |-|
2 changes: 1 addition & 1 deletion docs/components/easyinput.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ easyinput 组件是对原生input组件的增强 ,是专门为配合表单组
|:-:|:-:|:-:|:-:|:-:|
|value|String/ Number|-|-|输入内容|
|type|String|见 type Options|text|输入框的类型(默认text)|
|clearable|Boolean|-|true| 是否显示右侧清空内容的图标控件(输入框有内容,且获得焦点时才显示),点击可清空输入框内容|
|clearable|Boolean|-|true| 是否显示右侧清空内容的图标控件(输入框有内容且不禁用时显示),点击可清空输入框内容|
|autoHeight|Boolean|-|false| 是否自动增高输入区域,type为textarea时有效|
|placeholder|String |-| - | 输入框的提示文字|
|placeholderStyle|String| - | - | placeholder的样式(内联样式,字符串),如"color: #ddd"|
Expand Down
2 changes: 1 addition & 1 deletion docs/components/file-picker.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
为了避免错误使用,给大家带来不好的开发体验,请在使用组件前仔细阅读下面的注意事项,可以帮你避免一些错误。

- 组件需要依赖 `sass` 插件 ,请自行手动安装
- 使用组件需要绑定服务空间
- 如不绑定服务空间,`autoUpload`默认为`false`且不可更改
- 选择文件目前只支持 `H5``微信小程序平台` ,且 `微信小程序平台` 使用 `wx.chooseMessageFile()`
- 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839
:::
Expand Down
10 changes: 9 additions & 1 deletion docs/components/forms.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ rules: {
|required | Boolean | - | | 是否必填,配置此参数不会显示输入框左边的必填星号,如需要,请配置`uni-forms-item`组件的的required为true|
|range | Array | - | - | 数组至少要有一个元素,且数组内的每一个元素都是唯一的。 |
|format | String | - | - | 内置校验规则,如这些规则无法满足需求,可以使用正则匹配或者自定义规则 |
|pattern | RegExp | - | - | 正则表达式,如验证邮箱:/^\S+?@\S+?\.\S+?$/ (注意不带引号),或使用 "^\\S+?@\\S+?\\.\\S+?$"(注意带引号需要使用 `\` 转义) |
|pattern | RegExp | - | - | 正则表达式,注意事项见下方说明|
|maximum | Number | - | - | 校验最大值(大于)|
|minimum | Number | - | - | 校验最小值(小于) |
|maxLength | Number | - | - | 校验数据最大长度 |
Expand All @@ -266,6 +266,14 @@ rules: {
|url | 必须是 url 类型|
|email | 必须是 email 类型|

**pattern属性说明**

在小程序中,json 中不能使用正则对象,如:`/^\S+?@\S+?\.\S+?$/`,使用正则对象会被微信序列化,导致正则失效。

所以建议统一使用字符串的方式来使用正则 ,如`'^\\S+?@\\S+?\\.\\S+?$'` ,需要注意 `\` 需要使用 `\\` 来转译。


如验证邮箱:/^\S+?@\S+?\.\S+?$/ (注意不带引号),或使用 "^\\S+?@\\S+?\\.\\S+?$"(注意带引号需要使用 `\` 转义)

### validateFunction 自定义校验规则使用说明
`uni-forms``rules` 基础规则有时候不能满足项目的所有使用场景,这时候可以使用 `validateFunction` 来自定义校验规则
Expand Down
2 changes: 1 addition & 1 deletion docs/components/group.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ url : pages/vue/group/group
``template`` 中使用组件

```html
<uni-group title="分组1" margin-top="20">
<uni-group title="分组1" top="20">
<view>分组1 的内容</view>
<view>分组1 的内容</view>
</uni-group>
Expand Down
Loading

0 comments on commit 8baa738

Please sign in to comment.