Repository: wechat-miniprogram/weui-miniprogram
Branch: master
Commit: 90e2cbcbb4a5
Files: 354
Total size: 640.9 KB
Directory structure:
gitextract_c6xlk5rv/
├── .eslintignore
├── .eslintrc.js
├── .gitattributes
├── .github/
│ └── ISSUE_TEMPLATE/
│ ├── ----.md
│ └── --bug.md
├── .gitignore
├── .gitmodules
├── .npmignore
├── .npmrc
├── .prettierrc.js
├── .travis.yml
├── CHANGELOG.md
├── LICENSE
├── README.md
├── babel.config.js
├── docs/
│ ├── README.md
│ ├── actionsheet.md
│ ├── badge.md
│ ├── cell.md
│ ├── cells.md
│ ├── checkbox-group.md
│ ├── dialog.md
│ ├── form-page.md
│ ├── form.md
│ ├── gallery.md
│ ├── half-screen-dialog.md
│ ├── icon.md
│ ├── loading.md
│ ├── msg.md
│ ├── navigation.md
│ ├── other.md
│ ├── quickstart.md
│ ├── search.md
│ ├── slideview.md
│ ├── tabbar.md
│ ├── toptips.md
│ └── uploader.md
├── gulpfile.js
├── jest.config.js
├── mpflow.config.js
├── package.json
├── src/
│ ├── app.js
│ ├── app.json
│ ├── app.less
│ ├── base/
│ │ ├── CustomPage.js
│ │ └── behaviors/
│ │ └── theme.js
│ ├── components/
│ │ ├── actionsheet/
│ │ │ ├── __test__/
│ │ │ │ ├── __snapshots__/
│ │ │ │ │ └── actionsheet.test.ts.snap
│ │ │ │ ├── actionsheet.test.ts
│ │ │ │ ├── index.json
│ │ │ │ ├── index.ts
│ │ │ │ └── index.wxml
│ │ │ ├── actionsheet.json
│ │ │ ├── actionsheet.less
│ │ │ ├── actionsheet.ts
│ │ │ └── actionsheet.wxml
│ │ ├── badge/
│ │ │ ├── __test__/
│ │ │ │ ├── __snapshots__/
│ │ │ │ │ └── badage.test.js.snap
│ │ │ │ └── badage.test.js
│ │ │ ├── badge.json
│ │ │ ├── badge.less
│ │ │ ├── badge.ts
│ │ │ └── badge.wxml
│ │ ├── cell/
│ │ │ ├── cell.json
│ │ │ ├── cell.less
│ │ │ ├── cell.ts
│ │ │ └── cell.wxml
│ │ ├── cells/
│ │ │ ├── __test__/
│ │ │ │ ├── __snapshots__/
│ │ │ │ │ └── cells.test.js.snap
│ │ │ │ ├── cells.test.js
│ │ │ │ ├── index.js
│ │ │ │ ├── index.json
│ │ │ │ └── index.wxml
│ │ │ ├── cells.json
│ │ │ ├── cells.less
│ │ │ ├── cells.ts
│ │ │ └── cells.wxml
│ │ ├── checkbox/
│ │ │ ├── __test__/
│ │ │ │ ├── __snapshots__/
│ │ │ │ │ └── checkbox.test.js.snap
│ │ │ │ ├── checkbox.test.js
│ │ │ │ ├── index.js
│ │ │ │ ├── index.json
│ │ │ │ └── index.wxml
│ │ │ ├── checkbox.json
│ │ │ ├── checkbox.less
│ │ │ ├── checkbox.ts
│ │ │ └── checkbox.wxml
│ │ ├── checkbox-group/
│ │ │ ├── checkbox-group.json
│ │ │ ├── checkbox-group.less
│ │ │ ├── checkbox-group.ts
│ │ │ └── checkbox-group.wxml
│ │ ├── dialog/
│ │ │ ├── __test__/
│ │ │ │ ├── __snapshots__/
│ │ │ │ │ └── dialog.test.js.snap
│ │ │ │ ├── dialog.test.js
│ │ │ │ ├── index.js
│ │ │ │ ├── index.json
│ │ │ │ └── index.wxml
│ │ │ ├── dialog.json
│ │ │ ├── dialog.less
│ │ │ ├── dialog.ts
│ │ │ └── dialog.wxml
│ │ ├── form/
│ │ │ ├── __test__/
│ │ │ │ ├── __snapshots__/
│ │ │ │ │ └── form.test.ts.snap
│ │ │ │ ├── comp/
│ │ │ │ │ ├── index.json
│ │ │ │ │ ├── index.ts
│ │ │ │ │ └── index.wxml
│ │ │ │ ├── form-validator.test.ts
│ │ │ │ ├── form.test.ts
│ │ │ │ └── validator.test.ts
│ │ │ ├── form-validator.ts
│ │ │ ├── form.json
│ │ │ ├── form.ts
│ │ │ ├── form.wxml
│ │ │ └── validator.ts
│ │ ├── form-page/
│ │ │ ├── __test__/
│ │ │ │ ├── __snapshots__/
│ │ │ │ │ └── form-page.test.ts.snap
│ │ │ │ ├── form-page.test.ts
│ │ │ │ ├── index.js
│ │ │ │ ├── index.json
│ │ │ │ └── index.wxml
│ │ │ ├── form-page.json
│ │ │ ├── form-page.less
│ │ │ ├── form-page.ts
│ │ │ └── form-page.wxml
│ │ ├── gallery/
│ │ │ ├── __test__/
│ │ │ │ ├── __snapshots__/
│ │ │ │ │ └── gallery.test.ts.snap
│ │ │ │ └── gallery.test.ts
│ │ │ ├── gallery.json
│ │ │ ├── gallery.less
│ │ │ ├── gallery.ts
│ │ │ └── gallery.wxml
│ │ ├── grids/
│ │ │ ├── __test__/
│ │ │ │ ├── __snapshots__/
│ │ │ │ │ └── grid.test.ts.snap
│ │ │ │ └── grid.test.ts
│ │ │ ├── grids.json
│ │ │ ├── grids.less
│ │ │ ├── grids.ts
│ │ │ └── grids.wxml
│ │ ├── half-screen-dialog/
│ │ │ ├── __test__/
│ │ │ │ ├── __snapshots__/
│ │ │ │ │ └── half-screen-dialog.test.ts.snap
│ │ │ │ └── half-screen-dialog.test.ts
│ │ │ ├── half-screen-dialog.json
│ │ │ ├── half-screen-dialog.less
│ │ │ ├── half-screen-dialog.ts
│ │ │ └── half-screen-dialog.wxml
│ │ ├── icon/
│ │ │ ├── __test__/
│ │ │ │ ├── __snapshots__/
│ │ │ │ │ └── icon.test.ts.snap
│ │ │ │ └── icon.test.ts
│ │ │ ├── base64.ts
│ │ │ ├── icon.json
│ │ │ ├── icon.less
│ │ │ ├── icon.ts
│ │ │ ├── icon.wxml
│ │ │ └── icondata.ts
│ │ ├── index.json
│ │ ├── index.less
│ │ ├── index.ts
│ │ ├── index.wxml
│ │ ├── loading/
│ │ │ ├── __test__/
│ │ │ │ ├── __snapshots__/
│ │ │ │ │ └── loading.test.ts.snap
│ │ │ │ └── loading.test.ts
│ │ │ ├── loading.json
│ │ │ ├── loading.less
│ │ │ ├── loading.ts
│ │ │ └── loading.wxml
│ │ ├── msg/
│ │ │ ├── __test__/
│ │ │ │ ├── __snapshots__/
│ │ │ │ │ └── msg.test.ts.snap
│ │ │ │ └── msg.test.ts
│ │ │ ├── msg.json
│ │ │ ├── msg.less
│ │ │ ├── msg.ts
│ │ │ └── msg.wxml
│ │ ├── navigation-bar/
│ │ │ ├── __test__/
│ │ │ │ ├── __snapshots__/
│ │ │ │ │ └── navigation-bar.test.ts.snap
│ │ │ │ └── navigation-bar.test.ts
│ │ │ ├── navigation-bar.json
│ │ │ ├── navigation-bar.less
│ │ │ ├── navigation-bar.ts
│ │ │ └── navigation-bar.wxml
│ │ ├── patch.less
│ │ ├── searchbar/
│ │ │ ├── __test__/
│ │ │ │ ├── __snapshots__/
│ │ │ │ │ └── searchbar.test.ts.snap
│ │ │ │ └── searchbar.test.ts
│ │ │ ├── searchbar.json
│ │ │ ├── searchbar.less
│ │ │ ├── searchbar.ts
│ │ │ └── searchbar.wxml
│ │ ├── slideview/
│ │ │ ├── __test__/
│ │ │ │ ├── __snapshots__/
│ │ │ │ │ └── slideview.test.ts.snap
│ │ │ │ └── slideview.test.ts
│ │ │ ├── slideview-skyline.json
│ │ │ ├── slideview-skyline.less
│ │ │ ├── slideview-skyline.ts
│ │ │ ├── slideview-skyline.wxml
│ │ │ ├── slideview.json
│ │ │ ├── slideview.less
│ │ │ ├── slideview.ts
│ │ │ ├── slideview.wxml
│ │ │ └── slideview.wxs
│ │ ├── tabbar/
│ │ │ ├── __test__/
│ │ │ │ ├── __snapshots__/
│ │ │ │ │ └── tabbar.test.ts.snap
│ │ │ │ └── tabbar.test.ts
│ │ │ ├── tabbar.json
│ │ │ ├── tabbar.less
│ │ │ ├── tabbar.ts
│ │ │ └── tabbar.wxml
│ │ ├── toptips/
│ │ │ ├── __test__/
│ │ │ │ ├── __snapshots__/
│ │ │ │ │ └── toptips.test.ts.snap
│ │ │ │ └── toptips.test.ts
│ │ │ ├── toptips.json
│ │ │ ├── toptips.less
│ │ │ ├── toptips.ts
│ │ │ └── toptips.wxml
│ │ ├── uploader/
│ │ │ ├── __test__/
│ │ │ │ ├── __snapshots__/
│ │ │ │ │ └── uploader.test.ts.snap
│ │ │ │ └── uploader.test.ts
│ │ │ ├── uploader.json
│ │ │ ├── uploader.less
│ │ │ ├── uploader.ts
│ │ │ └── uploader.wxml
│ │ └── utils/
│ │ ├── object.ts
│ │ ├── string.ts
│ │ └── utils.less
│ ├── example/
│ │ ├── actionsheet/
│ │ │ ├── actionsheet.js
│ │ │ ├── actionsheet.json
│ │ │ ├── actionsheet.wxml
│ │ │ └── actionsheet.wxss
│ │ ├── article/
│ │ │ ├── article.js
│ │ │ ├── article.json
│ │ │ ├── article.wxml
│ │ │ └── article.wxss
│ │ ├── badge/
│ │ │ ├── badge.js
│ │ │ ├── badge.json
│ │ │ ├── badge.wxml
│ │ │ └── badge.wxss
│ │ ├── button/
│ │ │ ├── button.js
│ │ │ ├── button.json
│ │ │ ├── button.wxml
│ │ │ └── button.wxss
│ │ ├── cell/
│ │ │ ├── cell.js
│ │ │ ├── cell.json
│ │ │ ├── cell.wxml
│ │ │ └── cell.wxss
│ │ ├── common.less
│ │ ├── dialog/
│ │ │ ├── dialog.js
│ │ │ ├── dialog.json
│ │ │ ├── dialog.wxml
│ │ │ └── dialog.wxss
│ │ ├── flex/
│ │ │ ├── flex.js
│ │ │ ├── flex.json
│ │ │ ├── flex.wxml
│ │ │ └── flex.wxss
│ │ ├── footer/
│ │ │ ├── footer.js
│ │ │ ├── footer.json
│ │ │ ├── footer.wxml
│ │ │ └── footer.wxss
│ │ ├── form/
│ │ │ ├── form.js
│ │ │ ├── form.json
│ │ │ ├── form.wxml
│ │ │ └── form.wxss
│ │ ├── form-page/
│ │ │ ├── form-page.js
│ │ │ ├── form-page.json
│ │ │ ├── form-page.wxml
│ │ │ └── form-page.wxss
│ │ ├── gallery/
│ │ │ ├── gallery.js
│ │ │ ├── gallery.json
│ │ │ ├── gallery.wxml
│ │ │ └── gallery.wxss
│ │ ├── grid/
│ │ │ ├── grid.js
│ │ │ ├── grid.json
│ │ │ ├── grid.wxml
│ │ │ └── grid.wxss
│ │ ├── half-screen-dialog/
│ │ │ ├── half-screen-dialog.js
│ │ │ ├── half-screen-dialog.json
│ │ │ ├── half-screen-dialog.wxml
│ │ │ └── half-screen-dialog.wxss
│ │ ├── icons/
│ │ │ ├── icons.js
│ │ │ ├── icons.json
│ │ │ ├── icons.wxml
│ │ │ └── icons.wxss
│ │ ├── images/
│ │ │ └── base64.js
│ │ ├── index.js
│ │ ├── index.json
│ │ ├── index.less
│ │ ├── index.wxml
│ │ ├── loading/
│ │ │ ├── loading.js
│ │ │ ├── loading.json
│ │ │ ├── loading.wxml
│ │ │ └── loading.wxss
│ │ ├── loadmore/
│ │ │ ├── loadmore.js
│ │ │ ├── loadmore.json
│ │ │ ├── loadmore.wxml
│ │ │ └── loadmore.wxss
│ │ ├── msg/
│ │ │ ├── msg.js
│ │ │ ├── msg.json
│ │ │ ├── msg.wxml
│ │ │ ├── msg.wxss
│ │ │ ├── msg_fail.js
│ │ │ ├── msg_fail.json
│ │ │ ├── msg_fail.wxml
│ │ │ ├── msg_fail.wxss
│ │ │ ├── msg_success.js
│ │ │ ├── msg_success.json
│ │ │ ├── msg_success.wxml
│ │ │ ├── msg_success.wxss
│ │ │ ├── msg_text.js
│ │ │ ├── msg_text.json
│ │ │ ├── msg_text.wxml
│ │ │ ├── msg_text.wxss
│ │ │ ├── msg_text_primary.js
│ │ │ ├── msg_text_primary.json
│ │ │ ├── msg_text_primary.wxml
│ │ │ └── msg_text_primary.wxss
│ │ ├── navbar/
│ │ │ ├── navbar.js
│ │ │ ├── navbar.json
│ │ │ ├── navbar.wxml
│ │ │ └── navbar.wxss
│ │ ├── navigation/
│ │ │ ├── navigation.js
│ │ │ ├── navigation.json
│ │ │ ├── navigation.wxml
│ │ │ └── navigation.wxss
│ │ ├── panel/
│ │ │ ├── panel.js
│ │ │ ├── panel.json
│ │ │ ├── panel.wxml
│ │ │ └── panel.wxss
│ │ ├── picker/
│ │ │ ├── picker.js
│ │ │ ├── picker.json
│ │ │ ├── picker.wxml
│ │ │ └── picker.wxss
│ │ ├── preview/
│ │ │ ├── preview.js
│ │ │ ├── preview.json
│ │ │ ├── preview.wxml
│ │ │ └── preview.wxss
│ │ ├── progress/
│ │ │ ├── progress.js
│ │ │ ├── progress.json
│ │ │ ├── progress.wxml
│ │ │ └── progress.wxss
│ │ ├── searchbar/
│ │ │ ├── searchbar.js
│ │ │ ├── searchbar.json
│ │ │ ├── searchbar.wxml
│ │ │ └── searchbar.wxss
│ │ ├── slider/
│ │ │ ├── slider.js
│ │ │ ├── slider.json
│ │ │ ├── slider.wxml
│ │ │ └── slider.wxss
│ │ ├── slideview/
│ │ │ ├── slideview.js
│ │ │ ├── slideview.json
│ │ │ ├── slideview.wxml
│ │ │ └── slideview.wxss
│ │ ├── tabbar/
│ │ │ ├── tabbar.js
│ │ │ ├── tabbar.json
│ │ │ ├── tabbar.wxml
│ │ │ └── tabbar.wxss
│ │ ├── toast/
│ │ │ ├── toast.js
│ │ │ ├── toast.json
│ │ │ ├── toast.wxml
│ │ │ └── toast.wxss
│ │ ├── toptips/
│ │ │ ├── toptips.js
│ │ │ ├── toptips.json
│ │ │ ├── toptips.wxml
│ │ │ └── toptips.wxss
│ │ └── uploader/
│ │ ├── uploader.js
│ │ ├── uploader.json
│ │ ├── uploader.wxml
│ │ └── uploader.wxss
│ └── project.config.json
├── tools/
│ ├── build.js
│ ├── checkcomponents.js
│ ├── checkwxss.js
│ ├── config.js
│ ├── package.json
│ └── utils.js
└── tsconfig.json
================================================
FILE CONTENTS
================================================
================================================
FILE: .eslintignore
================================================
node_modules
src/weui-wxss
miniprogram_dist
miniprogram_dev
tools
================================================
FILE: .eslintrc.js
================================================
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 6,
sourceType: 'module'
},
env: {
es6: true,
browser: true,
jest: true,
commonjs: true,
node: true
},
plugins: [
'@typescript-eslint',
'prettier'
],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'prettier/@typescript-eslint'
],
globals: {
wx: true,
App: true,
Page: true,
Component: true
},
rules: {
'prettier/prettier': 'error',
'no-console': ["error", { allow: ["warn", "error"] } ],
'@typescript-eslint/ban-ts-ignore': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-explicit-any': 'off'
}
}
================================================
FILE: .gitattributes
================================================
* text=auto
================================================
FILE: .github/ISSUE_TEMPLATE/----.md
================================================
---
name: 特性请求
about: 提出一个好的特性
title: "[FEATURE]"
labels: ''
assignees: ''
---
## 遇到的问题
描述你想要达到的效果,以及你的使用场景
## 特性方案
描述你希望的实现方案
================================================
FILE: .github/ISSUE_TEMPLATE/--bug.md
================================================
---
name: 报告Bug
about: 创建一个Bug报告
title: "[BUG]"
labels: ''
assignees: ''
---
## Bug描述
描述你遇到的Bug,所产生的非预期行为
## 复现方式
复现该Bug的方式,建议直接提供 [代码片段](https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)
## 版本信息
- weui 版本 [useExtendedLib 引入则直接填写 useExtendedLib] :
================================================
FILE: .gitignore
================================================
.idea
.DS_Store
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
miniprogram_dist
miniprogram_dev
node_modules
coverage
dist
================================================
FILE: .gitmodules
================================================
================================================
FILE: .npmignore
================================================
.idea
.DS_Store
package-lock.json
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
test
tools
docs
miniprogram_dev
node_modules
coverage
tsconfig.json
tslint.json
================================================
FILE: .npmrc
================================================
registry=https://registry.npmjs.org
================================================
FILE: .prettierrc.js
================================================
module.exports = {
// 一行最多 100 字符
printWidth: 100,
// 使用 4 个空格缩进
tabWidth: 4,
// 不使用缩进符,而使用空格
useTabs: false,
// 行尾需要有分号
semi: false,
// 使用单引号
singleQuote: true,
// 对象的 key 仅在必要时用引号
quoteProps: 'as-needed',
// 末尾不需要逗号
trailingComma: 'none',
// 大括号内的首尾需要空格
bracketSpacing: true,
// 箭头函数,只有一个参数的时候,也需要括号
arrowParens: 'always',
// 每个文件格式化的范围是文件的全部内容
rangeStart: 0,
rangeEnd: Infinity,
// 不需要写文件开头的 @prettier
requirePragma: false,
// 不需要自动在文件开头插入 @prettier
insertPragma: false,
// 使用默认的折行标准
proseWrap: 'preserve',
// 根据显示样式决定 html 要不要折行
htmlWhitespaceSensitivity: 'css',
// 换行符使用 lf
endOfLine: 'lf'
};
================================================
FILE: .travis.yml
================================================
language: node_js
node_js:
- "v12.16.3"
script: npm run test
after_script:
- npm run codecov
================================================
FILE: CHANGELOG.md
================================================
# 更新日志
## 1.5.6
- fix: 修改 ext-class 实现
- fix: 修复 checkbox 样式错误
## 1.5.5
- fix: 修复 cell 丢失边缘线样式
- fix: 修复 checkbox 样式错误
- fix: 修复 navigation-bar background 没生效
## 1.5.4
- feat: half-screen-dialog, dialog, actionsheet, gallery, toptips 添加 rootPortal 参数
- fix: 修复 half-screen-dialog, dialog, actionsheet, gallery, toptips 默认不使用 root-portal
## 1.5.3
- fix: 修复 slideview 拆分 skyline 实现
## 1.5.2
- feat: 升级 `weui-wxss` 至 2.6.17
- feat: slideview 拆分 skyline 实现
## 1.5.1
- feat: 修复 dark-mode 实现
## 1.5.0
- feat: 重构 skyline-patch
- feat: 修改 ext-class 实现
## 1.4.2
- fix: 修复 half-screen-dialog skyline 动画
- fix: 修复 navigation-bar 样式
## 1.4.1
- fix: 修复 half-screen-dialog skyline 动画
## 1.4.0
- feat: 正式支持 skyline
## 1.3.1
- fix: 移除 babel 依赖
## 1.3.0
- feat: skyline 兼容
- feat: 升级 `weui-wxss` 至 2.6.6
## 1.2.10
- fix: half-screen-dialog 恢复滚动
## 1.2.9
- fix: dialog 修复 z-index 层级
## 1.2.8
- fix: searchbar 修复聚焦状态
## 1.2.7
- fix: dialog 修复自动聚焦 outline #216
- fix: half-screen-dialog 修复自动聚焦 outline #216
- fix: actionsheet 修复自动聚焦 outline #216
- fix: gallery 修复自动聚焦 outline #216
## 1.2.6
- feat: dialog 使用 virtualHost
- feat: 升级 `weui-wxss` 至 2.5.15
## 1.2.5
- feat: checkbox 添加 disabled 属性
- fix: tabbar 修复 aria-label 告警 #206
- fix: slideview 修复 disabled 属性 #203
- fix: actionsheet 移除多余 wrap
- fix: dialog 移除多余 wrap
## 1.2.4
- feat: 升级 `weui-wxss` 至 2.5.14
- fix: 修复 fade 动画
## 1.2.3
- fix: 修复 half-screen-dialog button 样式向前兼容
## 1.2.2
- feat: tabbar 添加 reactive 选项
- fix: 修复 actionsheet 底部 safearea 高度不正确
- fix: 修复 gallery 底部 safearea 高度不正确
## 1.2.1
- fix: 修复 checkbox 无法操作
## 1.2.0
- feat: 升级 `weui-wxss` 至 2.5.0
- feat: 无障碍适配
- fix: 修复 slideview 隐藏按钮后无动画
- fix: 修复 checkbox-group wx:if 判断不正确
## 1.1.1
- fix: 修复找不到 wxs
- fix: 修复找不到 weui-wxss
## 1.1.0
- feat: 升级 `weui-wxss` 至 2.4.4
- fix: 防止 `mp-half-screen-dialog` 滚动穿透
- chore: 构建系统迁移至 mpflow
## 1.0.8
- fix: 修复 #153
- fix: 修复 `mp-searchbar` 点击取消时错误 focus
- fix: 修复 `mp-half-screen-dialog` 按钮在部分机型按钮排列出错
## 1.0.7
- fix: 修复 `mp-icon` 在 type 改变时报错
## 1.0.6
- feat: `mp-grids` 支持动态修改 grids
- feat: `mp-searchbar` 点击取消按钮时触发 `cancel` 事件
- fix: 修复 `mp-half-screen-dialog` 中的 desc 属性判断
- fix: 修复 `mp-searchbar` 节流搜索没有获取最新数据
- fix: 修复 `form-validator` 中 bytelength 报错
## 1.0.5
- updata: 升级 weui-wxss
- update:使用 `hover-class` 代替 `:active`
## 1.0.4
- fix: 修复 rangelength 校验
- feat: 支持自适应 tabbar
## 1.0.3
- fix: `required` 判断 (#93)
- fix: dialog 未居中 (#94)
## 1.0.2
- fix: Toptips 不展示的bug
- fix: Form 校验失效的bug
## 1.0.1
- 补充 package.json repository
## 1.0.0
- 更新`weui-wxss`到`2.3.0`版本,支持 DarkMode
- Demo 支持 DarkMode
================================================
FILE: LICENSE
================================================
MIT License
Copyright (c) 2019 cunjinli,rockhou,xushengni,tomylin
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: README.md
================================================
## WeUI组件库简介
[](https://www.npmjs.com/package/weui-miniprogram)
[](https://www.npmjs.com/package/weui-miniprogram)
[](https://github.com/wechat-miniprogram/weui-miniprogram)
[](https://github.com/wechat-miniprogram/weui-miniprogram)
[](https://github.com/wechat-miniprogram/weui-miniprogram)
这是一套基于样式库[weui-wxss](https://github.com/Tencent/weui-wxss/)开发的小程序扩展组件库,同微信原生视觉体验一致的扩展组件库,由微信官方设计团队和小程序团队为微信小程序量身设计,令用户的使用感知更加统一。
## 如何使用
详细使用参考[文档](https://wechat-miniprogram.github.io/weui/docs/)
## 开发
1. 初始化
```
npm run init
```
2. 执行命令:
```
npm run dev
```
3. 构建组件库:
```
npm run build
```
## 适配 DarkMode
在根结点(或组件的外层结点)增加属性 `data-weui-theme="dark"`,即把 WeUI 组件切换到 DarkMode 的表现,如:
```html
...
```
================================================
FILE: babel.config.js
================================================
module.exports = {
presets: ['@mpflow/plugin-babel/preset', '@mpflow/plugin-typescript/preset']
}
================================================
FILE: docs/README.md
================================================
## WeUI组件库简介
这是一套基于样式库[weui-wxss](https://github.com/Tencent/weui-wxss/)开发的小程序扩展组件库,同微信原生视觉体验一致的UI组件库,由微信官方设计团队和小程序团队为微信小程序量身设计,令用户的使用感知更加统一。
> 支持[扩展库](https://developers.weixin.qq.com/miniprogram/dev/reference/configuration/app.html#useExtendedLib)引入,不占用小程序包体积。
## 项目背景
随着小程序的普及,微信也有很多内部小程序在开发,每个小程序都需要从零到1进行开发设计,而这个过程中,有大量的UI交互是重复的,另外,微信内部已经有一套H5版本的WeUI样式库。综合考虑,我们基于WeUI样式库开发了小程序版本的UI组件库,在内部多个小程序项目已经使用OK的情况下,我们把这套组件库开源让外部开发者也可以使用,欢迎大家Star以及提Issue。
## 快速上手
请参考[快速上手](./quickstart.md)
## 在线预览
扫描下方小程序码可以预览该组件库

## 参与贡献
欢迎给我们提出宝贵见的意见,[项目地址](https://github.com/wechat-miniprogram/weui-miniprogram)
================================================
FILE: docs/actionsheet.md
================================================
# ActionSheet
底部弹起的操作按钮组件
## 代码引入
在 page.json 中引入组件
```json
{
"usingComponents": {
"mp-actionSheet": "weui-miniprogram/actionsheet/actionsheet"
}
}
```
## 示例代码
```html
```
```js
Page({
data: {
showActionsheet: false,
groups: [
{ text: '示例菜单', value: 1 },
{ text: '示例菜单', value: 2 },
{ text: '负向菜单', type: 'warn', value: 3 }
]
},
close: function () {
this.setData({
showActionsheet: false
})
},
btnClick(e) {
console.log(e)
this.close()
}
})
```
## 效果展示

## 属性列表
| 属性 | 类型 | 默认值 | 必填 | 说明 |
| ---- | ---- | ------ | -------- | ---- |
| title | string | | 否 | 标题 |
| show-cancel | boolean | true | 否 | 是否显示取消按钮 |
| cancel-text | string | | 否 | 取消按钮的文本 |
| mask-class | string | | 否 | 背景蒙层的class |
| ext-class | string | | 否 | ActionSheet额外的class |
| mask-closable | boolean | true | 否 | 点击背景蒙层是否可以关闭ActionSheet |
| mask | boolean | true | 否 | 是否显示背景蒙层 |
| show | boolean | false | 否 | 是否显示ActionSheet |
| actions | Array | false | 是 | ActionSheet的按钮项的配置,每一项是包含text、value、type的Object,type的取值为warn和default,表示两种样式 |
| bindclose | eventhandler | | 否 | 点击背后的mask关闭掉ActionSheet触发的事件 |
| bindactiontap | eventhandler | | 否 | 点击ActionSheet的按钮项触发的事件,detail为{ value, index } |
## Slot
| 名称 | 描述 |
| ---- | ---- |
| title | 标题区域slot |
================================================
FILE: docs/badge.md
================================================
# Badge徽章
出现在按钮、图标附近的数字或者状态标记。
## 代码引入
在 page.json 中引入组件
```json
{
"usingComponents": {
"mp-badge": "weui-miniprogram/badge/badge"
}
}
```
## 属性列表
| 属性 | 类型 | 默认值 | 必填 | 说明 |
| ---- | ---- | ------ | -------- | ---- |
| extClass | string | | 否 | 组件类名 |
| content | string | | 否 | 内容区域 |
## 提示
不设置 content 属性时,默认展示小圆点
================================================
FILE: docs/cell.md
================================================
# Cell
Cell是列表或者是表单的一项,常用于设置页的展示,或者用在表单中,作为表单的每一个要填写的项,Cell必须要放在[Cells](./cells.md)组件的下面。
## 代码引入
在 page.json 中引入组件
```json
{
"usingComponents": {
"mp-cells": "weui-miniprogram/cells/cells",
"mp-cell": "weui-miniprogram/cell/cell"
}
}
```
## 属性列表
| 属性 | 类型 | 默认值 | 必填 | 说明 |
| ---- | ---- | ------ | -------- | ---- |
| ext-class | string | | 否 | 添加在组件内部结构的class,可用于修改组件内部的样式 |
| icon | string | | 否 | Cell的最左侧的icon,是本地图片的路径,icon和名为icon的slot互斥 |
| title | string | | 否 | Cell最左侧的标题,一般用在[Form](./form.md)表单组件里面,icon和title二选一,title和名为title的slot互斥 |
| hover | boolean | false | 否 | 是否有hover效果 |
| link | boolean | false | 否 | 右侧是有跳转的箭头,`v1.0`后的版本,`link: true` 会自带 hover 效果 |
| value | string | | 是 | Cell的值,和默认的slot互斥 |
| show-error | boolean | false | 否 | 用在[Form](./form.md)表单组件里面,在表单校验出错的时候是否把Cell标为warn状态 |
| prop | string | | 否 | 用在[Form](./form.md)表单组件里面,需要校验的表单的字段名 |
| footer | string | | 否 | Cell右侧区域的内容,和名为footer的slot互斥 |
| inline | boolean | | 否 | 用在[Form](./form.md)表单组件里面,表示表单项是左右显示还是上下显示 |
## Slot
| 名称 | 描述 |
| ---- | ---- |
| icon | 左侧图标slot |
| title | 标题slot |
| 默认 | 内容slot |
| footer | 右侧区域slot |
================================================
FILE: docs/cells.md
================================================
# Cells
Cells是列表分组,常用于嵌套一组Cell或者[Checkbox](./checkbox.md),注意,Checkbox-group和Cell组件都必须放在Cells组件下面,Cells效果如下图所示。

## 代码引入
在 page.json 中引入组件
```json
{
"usingComponents": {
"mp-cells": "weui-miniprogram/cells/cells",
"mp-cell": "weui-miniprogram/cell/cell"
}
}
```
## 示例代码
```html
标题文字(使用slot)
说明文字
```
```js
// page.js示例代码
Page({
});
```
## 属性列表
| 属性 | 类型 | 默认值 | 必填 | 说明 |
| ---- | ---- | ------ | -------- | ---- |
| ext-class | string | | 否 | 添加在组件内部结构的class,可用于修改组件内部的样式 |
| title | string | | 否 | Cells的标题 |
| footer | string | | 否 | Cells底部的文字 |
## Slot
| 名称 | 描述 |
| ---- | ---- |
| 默认 | 内容slot |
================================================
FILE: docs/checkbox-group.md
================================================
# Checkbox-group和Checkbox
Checkbox-group是由一组单选或者多选Checkbox组件组成,效果如下图所示。

## 引入组件
在 page.json 中引入组件
```json
{
"usingComponents": {
"mp-checkbox-group": "weui-miniprogram/checkbox-group/checkbox-group",
"mp-checkbox": "weui-miniprogram/checkbox/checkbox",
"mp-cells": "weui-miniprogram/cells/cells"
}
}
```
## 示例代码
```html
```
```js
// page.js示例代码
Page({
data: {
radioItems: [
{name: 'cell standard', value: '0', checked: true},
{name: 'cell standard', value: '1'}
],
checkboxItems: [
{name: 'standard is dealt for u.', value: '0', checked: true},
{name: 'standard is dealicient for u.', value: '1'}
],
},
radioChange: function (e) {
console.log('radio发生change事件,携带value值为:', e.detail.value);
var radioItems = this.data.radioItems;
for (var i = 0, len = radioItems.length; i < len; ++i) {
radioItems[i].checked = radioItems[i].value == e.detail.value;
}
this.setData({
radioItems: radioItems,
[`formData.radio`]: e.detail.value
});
},
checkboxChange: function (e) {
console.log('checkbox发生change事件,携带value值为:', e.detail.value);
var checkboxItems = this.data.checkboxItems, values = e.detail.value;
for (var i = 0, lenI = checkboxItems.length; i < lenI; ++i) {
checkboxItems[i].checked = false;
for (var j = 0, lenJ = values.length; j < lenJ; ++j) {
if(checkboxItems[i].value == values[j]){
checkboxItems[i].checked = true;
break;
}
}
}
this.setData({
checkboxItems: checkboxItems,
[`formData.checkbox`]: e.detail.value
});
},
});
```
## checkbox-group组件属性列表
| 属性 | 类型 | 默认值 | 必填 | 说明 |
| ---- | ---- | ------ | -------- | ---- |
| ext-class | string | | 否 | 添加在组件内部结构的class,可用于修改组件内部的样式 |
| multi | boolean | true | 否 | 单选还是多选 |
| prop | string | | 否 | [Form](./form.md)表单组件校验的字段名 |
| bindchange | eventhandler | | 否 | Checkbox-group发生改变时候触发的事件,detail为{value},单选的value为checkbox的值,多选的value为选中的checkbox的值组成的数组 |
## checkbox-group的Slot
| 名称 | 描述 |
| ---- | ---- |
| 默认 | 内容slot |
## checkbox组件属性列表
| 属性 | 类型 | 默认值 | 必填 | 说明 |
| ---- | ---- | ------ | -------- | ---- |
| ext-class | string | | 否 | 添加在组件内部结构的class,可用于修改组件内部的样式 |
| multi | boolean | true | 否 | 单选还是多选 |
| checked | boolean | | 否 | 是否选中 |
| value | string | | 否 | checkbox的值 |
| bindchange | eventhandler | | 否 | Checkbox发生改变时候触发的事件,detail为{value},value为checkbox的值 |
================================================
FILE: docs/dialog.md
================================================
# Dialog
Dialog弹窗组件。
## 代码引入
在 page.json 中引入组件
```json
{
"usingComponents": {
"mp-dialog": "weui-miniprogram/dialog/dialog"
}
}
```
## 属性列表
| 属性 | 类型 | 默认值 | 必填 | 说明 |
| ---- | ---- | ------ | -------- | ---- |
| ext-class | string | | 否 | 添加在组件内部结构的class,可用于修改组件内部的样式 |
| title | string | | 否 | 弹窗的标题 |
| buttons | array\