├── .eslintignore
├── .eslintrc
├── .github
├── CONTRIBUTING.md
├── ISSUE_TEMPLATE
│ ├── bug_report_cn.md
│ └── feature_request_cn.md
└── PULL_REQUEST_TEMPLATE.md
├── .gitignore
├── .npmrc
├── .stylelintrc
├── CHANGELOG.md
├── LICENSE
├── README.md
├── babel.config.js
├── demo
├── app.acss
├── app.js
├── app.json
├── mini.project.json
└── pages
│ ├── alphabet
│ ├── index.acss
│ ├── index.axml
│ ├── index.js
│ └── index.json
│ ├── am-checkbox
│ ├── index.acss
│ ├── index.axml
│ ├── index.js
│ └── index.json
│ ├── am-icon
│ ├── index.acss
│ ├── index.axml
│ ├── index.js
│ └── index.json
│ ├── am-radio
│ ├── index.acss
│ ├── index.axml
│ ├── index.js
│ └── index.json
│ ├── am-switch
│ ├── index.acss
│ ├── index.axml
│ ├── index.js
│ └── index.json
│ ├── amount-input
│ ├── index.acss
│ ├── index.axml
│ ├── index.js
│ └── index.json
│ ├── avatar
│ ├── index.acss
│ ├── index.axml
│ ├── index.js
│ └── index.json
│ ├── badge
│ ├── index.acss
│ ├── index.axml
│ ├── index.js
│ └── index.json
│ ├── button
│ ├── index.acss
│ ├── index.axml
│ ├── index.js
│ └── index.json
│ ├── calendar
│ ├── index.acss
│ ├── index.axml
│ ├── index.js
│ └── index.json
│ ├── card
│ ├── index.acss
│ ├── index.axml
│ ├── index.js
│ └── index.json
│ ├── collapse
│ ├── index.acss
│ ├── index.axml
│ ├── index.js
│ └── index.json
│ ├── container
│ ├── index.acss
│ ├── index.axml
│ ├── index.js
│ └── index.json
│ ├── coupon
│ ├── index.acss
│ ├── index.axml
│ ├── index.js
│ └── index.json
│ ├── filter
│ ├── alternative
│ │ ├── index.acss
│ │ ├── index.axml
│ │ ├── index.js
│ │ └── index.json
│ ├── index.acss
│ ├── index.axml
│ ├── index.js
│ ├── index.json
│ ├── single
│ │ ├── index.acss
│ │ ├── index.axml
│ │ ├── index.js
│ │ └── index.json
│ ├── single_1
│ │ ├── index.acss
│ │ ├── index.axml
│ │ ├── index.js
│ │ └── index.json
│ └── single_2
│ │ ├── index.acss
│ │ ├── index.axml
│ │ ├── index.js
│ │ └── index.json
│ ├── flex
│ ├── index.acss
│ ├── index.axml
│ ├── index.js
│ └── index.json
│ ├── footer
│ ├── index.acss
│ ├── index.axml
│ ├── index.js
│ └── index.json
│ ├── form
│ ├── index.acss
│ ├── index.axml
│ ├── index.js
│ └── index.json
│ ├── grid
│ ├── 2
│ │ ├── index.acss
│ │ ├── index.axml
│ │ ├── index.js
│ │ └── index.json
│ ├── 3
│ │ ├── index.acss
│ │ ├── index.axml
│ │ ├── index.js
│ │ └── index.json
│ ├── 4
│ │ ├── index.acss
│ │ ├── index.axml
│ │ ├── index.js
│ │ └── index.json
│ ├── 5
│ │ ├── index.acss
│ │ ├── index.axml
│ │ ├── index.js
│ │ └── index.json
│ ├── index.acss
│ ├── index.axml
│ ├── index.js
│ └── index.json
│ ├── guide
│ ├── guide.acss
│ ├── guide.axml
│ ├── guide.js
│ └── guide.json
│ ├── input-item
│ ├── index.acss
│ ├── index.axml
│ ├── index.js
│ └── index.json
│ ├── list
│ ├── app.acss
│ ├── app.axml
│ ├── app.js
│ ├── app.json
│ ├── index.acss
│ ├── index.axml
│ ├── index.js
│ └── index.json
│ ├── loading
│ ├── loading.acss
│ ├── loading.axml
│ ├── loading.js
│ └── loading.json
│ ├── long-password
│ ├── index.acss
│ ├── index.axml
│ ├── index.js
│ └── index.json
│ ├── mask
│ ├── mask.acss
│ ├── mask.axml
│ ├── mask.js
│ └── mask.json
│ ├── message
│ ├── index.acss
│ ├── index.axml
│ ├── index.js
│ └── index.json
│ ├── modal
│ ├── index.acss
│ ├── index.axml
│ ├── index.js
│ └── index.json
│ ├── multi-liner
│ ├── index.acss
│ ├── index.axml
│ ├── index.js
│ └── index.json
│ ├── new-list
│ ├── index.acss
│ ├── index.axml
│ ├── index.js
│ └── index.json
│ ├── notice
│ ├── index.acss
│ ├── index.axml
│ ├── index.js
│ └── index.json
│ ├── page-result
│ ├── busy
│ │ ├── index.acss
│ │ ├── index.axml
│ │ ├── index.js
│ │ └── index.json
│ ├── empty
│ │ ├── index.acss
│ │ ├── index.axml
│ │ ├── index.js
│ │ └── index.json
│ ├── error
│ │ ├── index.acss
│ │ ├── index.axml
│ │ ├── index.js
│ │ └── index.json
│ ├── index.acss
│ ├── index.axml
│ ├── index.js
│ ├── index.json
│ ├── local-busy
│ │ ├── index.acss
│ │ ├── index.axml
│ │ ├── index.js
│ │ └── index.json
│ ├── local-empty
│ │ ├── index.acss
│ │ ├── index.axml
│ │ ├── index.js
│ │ └── index.json
│ ├── local-error
│ │ ├── index.acss
│ │ ├── index.axml
│ │ ├── index.js
│ │ └── index.json
│ ├── local-logoff
│ │ ├── index.acss
│ │ ├── index.axml
│ │ ├── index.js
│ │ └── index.json
│ ├── local-network
│ │ ├── index.acss
│ │ ├── index.axml
│ │ ├── index.js
│ │ └── index.json
│ ├── local-payment
│ │ ├── index.acss
│ │ ├── index.axml
│ │ ├── index.js
│ │ └── index.json
│ ├── local-redpacket
│ │ ├── index.acss
│ │ ├── index.axml
│ │ ├── index.js
│ │ └── index.json
│ ├── log-off
│ │ ├── index.acss
│ │ ├── index.axml
│ │ ├── index.js
│ │ └── index.json
│ ├── network
│ │ ├── index.acss
│ │ ├── index.axml
│ │ ├── index.js
│ │ └── index.json
│ ├── payment
│ │ ├── index.acss
│ │ ├── index.axml
│ │ ├── index.js
│ │ └── index.json
│ └── redpacket
│ │ ├── index.acss
│ │ ├── index.axml
│ │ ├── index.js
│ │ └── index.json
│ ├── pagination
│ ├── index.acss
│ ├── index.axml
│ ├── index.js
│ └── index.json
│ ├── picker-item
│ ├── index.acss
│ ├── index.axml
│ ├── index.js
│ └── index.json
│ ├── popover
│ ├── index.acss
│ ├── index.axml
│ ├── index.js
│ └── index.json
│ ├── popup
│ ├── index.acss
│ ├── index.axml
│ ├── index.js
│ └── index.json
│ ├── search-bar
│ ├── index.acss
│ ├── index.axml
│ ├── index.js
│ └── index.json
│ ├── stepper
│ ├── index.acss
│ ├── index.axml
│ ├── index.js
│ └── index.json
│ ├── steps
│ ├── index.acss
│ ├── index.axml
│ ├── index.js
│ └── index.json
│ ├── swipe-action
│ ├── index.acss
│ ├── index.axml
│ ├── index.js
│ └── index.json
│ ├── tabs
│ ├── elevator
│ │ ├── elevator.acss
│ │ ├── elevator.axml
│ │ ├── elevator.js
│ │ └── elevator.json
│ ├── index.acss
│ ├── index.axml
│ ├── index.js
│ └── index.json
│ ├── tag
│ ├── index.acss
│ ├── index.axml
│ ├── index.js
│ └── index.json
│ ├── terms
│ ├── index.acss
│ ├── index.axml
│ ├── index.js
│ └── index.json
│ ├── tips
│ ├── 1
│ │ ├── index.acss
│ │ ├── index.axml
│ │ ├── index.js
│ │ └── index.json
│ ├── 2
│ │ ├── index.acss
│ │ ├── index.axml
│ │ ├── index.js
│ │ └── index.json
│ ├── index.acss
│ ├── index.axml
│ ├── index.js
│ └── index.json
│ ├── title
│ ├── index.acss
│ ├── index.axml
│ ├── index.js
│ └── index.json
│ ├── verify-code
│ ├── index.acss
│ ├── index.axml
│ ├── index.js
│ └── index.json
│ └── vtabs
│ ├── index.acss
│ ├── index.axml
│ ├── index.js
│ └── index.json
├── package.json
├── scripts
├── compiler.js
└── pub.js
├── src
├── _lang
│ ├── en-US.ts
│ └── zh-CN.ts
├── _mixin
│ └── idnex.ts
├── _util
│ ├── fmtClass.ts
│ ├── fmtEvent.ts
│ ├── fmtUnit.ts
│ └── getI18n.ts
├── am-checkbox
│ ├── index.axml
│ ├── index.json
│ ├── index.less
│ ├── index.md
│ └── index.ts
├── am-icon
│ ├── index.axml
│ ├── index.json
│ ├── index.less
│ ├── index.md
│ └── index.ts
├── am-radio
│ ├── index.axml
│ ├── index.json
│ ├── index.less
│ ├── index.md
│ └── index.ts
├── am-switch
│ ├── index.axml
│ ├── index.json
│ ├── index.less
│ ├── index.md
│ └── index.ts
├── amount-input
│ ├── index.axml
│ ├── index.json
│ ├── index.less
│ ├── index.md
│ └── index.ts
├── avatar
│ ├── index.axml
│ ├── index.json
│ ├── index.less
│ ├── index.md
│ └── index.ts
├── badge
│ ├── index.axml
│ ├── index.json
│ ├── index.less
│ ├── index.md
│ └── index.ts
├── button
│ ├── index.axml
│ ├── index.json
│ ├── index.less
│ ├── index.md
│ └── index.ts
├── calendar
│ ├── index.axml
│ ├── index.json
│ ├── index.less
│ ├── index.md
│ └── index.ts
├── card
│ ├── index.axml
│ ├── index.json
│ ├── index.less
│ ├── index.md
│ └── index.ts
├── collapse
│ ├── collapse-item
│ │ ├── index.axml
│ │ ├── index.json
│ │ ├── index.less
│ │ └── index.ts
│ ├── index.axml
│ ├── index.json
│ ├── index.md
│ └── index.ts
├── container
│ ├── index.axml
│ ├── index.json
│ ├── index.less
│ ├── index.md
│ └── index.ts
├── coupon
│ ├── index.axml
│ ├── index.json
│ ├── index.less
│ ├── index.md
│ └── index.ts
├── filter
│ ├── filter-item
│ │ ├── index.axml
│ │ ├── index.json
│ │ ├── index.less
│ │ └── index.ts
│ ├── index.axml
│ ├── index.json
│ ├── index.less
│ ├── index.md
│ ├── index.ts
│ └── mixins
│ │ └── lifecycle.ts
├── flex
│ ├── flex-item
│ │ ├── index.axml
│ │ ├── index.json
│ │ ├── index.less
│ │ └── index.ts
│ ├── index.axml
│ ├── index.json
│ ├── index.less
│ ├── index.md
│ ├── index.sjs
│ └── index.ts
├── footer
│ ├── index.axml
│ ├── index.json
│ ├── index.less
│ ├── index.md
│ └── index.ts
├── grid
│ ├── index.axml
│ ├── index.json
│ ├── index.less
│ ├── index.md
│ └── index.ts
├── guide
│ ├── index.axml
│ ├── index.json
│ ├── index.less
│ ├── index.md
│ └── index.ts
├── input-item
│ ├── index.axml
│ ├── index.json
│ ├── index.less
│ ├── index.md
│ └── index.ts
├── list
│ ├── alphabet
│ │ ├── index.axml
│ │ ├── index.json
│ │ ├── index.less
│ │ ├── index.md
│ │ └── index.ts
│ ├── auto-size-img
│ │ ├── index.axml
│ │ ├── index.json
│ │ ├── index.less
│ │ └── index.ts
│ ├── index.axml
│ ├── index.json
│ ├── index.less
│ ├── index.md
│ ├── index.ts
│ ├── list-item
│ │ ├── index.axml
│ │ ├── index.json
│ │ ├── index.less
│ │ ├── index.md
│ │ └── index.ts
│ └── list-secondary
│ │ ├── index.axml
│ │ ├── index.json
│ │ ├── index.less
│ │ ├── index.md
│ │ └── index.ts
├── loading
│ ├── index.axml
│ ├── index.json
│ ├── index.less
│ ├── index.md
│ └── index.ts
├── long-password
│ ├── index.axml
│ ├── index.json
│ ├── index.less
│ ├── index.md
│ └── index.ts
├── mask
│ ├── index.axml
│ ├── index.json
│ ├── index.less
│ ├── index.md
│ └── index.ts
├── message
│ ├── index.axml
│ ├── index.json
│ ├── index.less
│ ├── index.md
│ └── index.ts
├── modal
│ ├── index.axml
│ ├── index.json
│ ├── index.less
│ ├── index.md
│ └── index.ts
├── multi-liner
│ ├── index.axml
│ ├── index.json
│ ├── index.less
│ ├── index.md
│ └── index.ts
├── notice
│ ├── index.axml
│ ├── index.json
│ ├── index.less
│ ├── index.md
│ └── index.ts
├── page-result
│ ├── index.axml
│ ├── index.json
│ ├── index.less
│ ├── index.md
│ └── index.ts
├── pagination
│ ├── index.axml
│ ├── index.json
│ ├── index.less
│ ├── index.md
│ ├── index.sjs
│ └── index.ts
├── picker-item
│ ├── index.axml
│ ├── index.json
│ ├── index.less
│ ├── index.md
│ └── index.ts
├── popover
│ ├── index.axml
│ ├── index.json
│ ├── index.less
│ ├── index.md
│ ├── index.ts
│ └── popover-item
│ │ ├── index.axml
│ │ ├── index.json
│ │ ├── index.less
│ │ └── index.ts
├── popup
│ ├── index.axml
│ ├── index.json
│ ├── index.less
│ ├── index.md
│ └── index.ts
├── search-bar
│ ├── index.axml
│ ├── index.json
│ ├── index.less
│ ├── index.md
│ └── index.ts
├── stepper
│ ├── index.axml
│ ├── index.json
│ ├── index.less
│ ├── index.md
│ └── index.ts
├── steps
│ ├── index.axml
│ ├── index.json
│ ├── index.less
│ ├── index.md
│ └── index.ts
├── style
│ ├── mixins
│ │ └── hairline.less
│ └── themes
│ │ └── default.less
├── swipe-action
│ ├── index.axml
│ ├── index.json
│ ├── index.less
│ ├── index.md
│ └── index.ts
├── tabs
│ ├── index.axml
│ ├── index.json
│ ├── index.less
│ ├── index.md
│ ├── index.ts
│ ├── tab-content
│ │ ├── index.axml
│ │ ├── index.json
│ │ ├── index.less
│ │ └── index.ts
│ └── util.sjs
├── tag
│ ├── index.axml
│ ├── index.json
│ ├── index.less
│ ├── index.md
│ └── index.ts
├── terms
│ ├── index.axml
│ ├── index.json
│ ├── index.less
│ ├── index.md
│ └── index.ts
├── tips
│ ├── index.md
│ ├── tips-dialog
│ │ ├── index.axml
│ │ ├── index.json
│ │ ├── index.less
│ │ └── index.ts
│ └── tips-plain
│ │ ├── index.axml
│ │ ├── index.json
│ │ ├── index.less
│ │ └── index.ts
├── title
│ ├── index.axml
│ ├── index.json
│ ├── index.less
│ ├── index.md
│ └── index.ts
├── verify-code
│ ├── index.axml
│ ├── index.json
│ ├── index.less
│ ├── index.md
│ └── index.ts
└── vtabs
│ ├── index.axml
│ ├── index.json
│ ├── index.less
│ ├── index.md
│ ├── index.ts
│ └── vtab-content
│ ├── index.axml
│ ├── index.json
│ └── index.ts
├── tsconfig.json
└── yarn.lock
/.eslintignore:
--------------------------------------------------------------------------------
1 | types/**/*.ts
2 | es/**/*.js
3 | demo/es/**/*.js
--------------------------------------------------------------------------------
/.eslintrc:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "eslint-config-ali",
3 | "globals": {
4 | "my": true,
5 | "App": true,
6 | "Component": true,
7 | "Page": true
8 | },
9 | "parser": "@typescript-eslint/parser",
10 | "plugins": [
11 | "typescript"
12 | ],
13 | "rules": {
14 | "typescript/class-name-casing": "error",
15 | "typescript/type-annotation-spacing": "error"
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report_cn.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: 缺陷问题反馈
3 | about: 请尽可能清晰描述问题
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 |
17 | ## 问题描述
18 |
19 |
20 |
21 | ## 复现步骤
22 |
23 | 1.
24 | 2.
25 |
26 | ### demo 示例
27 |
36 | 🔗 demo 的示例地址:
37 |
38 |
39 | ### 截图
40 |
41 |
42 |
43 | ## 预期行为
44 | 1.
45 | 2.
46 |
47 |
48 | ## 环境信息
49 |
50 | * [x] mini-ali-ui (px 版本扩展组件)
51 | * [ ] mini-ali-ui-rpx (rpx 版本扩展组件)
52 |
53 |
54 | * **组件库版本:**
55 | * **设备机型:**
56 | * **设备版本:**
57 | * **APP:** 支付宝小程序
58 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request_cn.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: 功能优化需求
3 | about: 期望组件增强的功能需求
4 | title: ''
5 | labels: enhancement
6 | assignees: ''
7 |
8 | ---
9 |
10 | ## 背景
11 | > 请描述你所遇到的问题现状
12 |
13 |
14 | ## 期望
15 | > 请描述你所希望添加的功能
16 |
17 |
18 | ## 思路
19 | > 对于你所描述的问题,是否已有解决方案或者思路,如有可提供作为参考,或者提交你的 PR 、截图
20 |
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | First of all, thank you for your contribution! :-)
2 |
3 | Please makes sure that these checkboxes are checked before submitting your PR, thank you!
4 |
5 | * [ ] Rebase before creating a PR to keep commit history clear.
6 | * [ ] Add some descriptions and refer relative issues for you PR.
7 |
8 | Extra checklist:
9 |
10 | **if** *isNewFeature* **:**
11 |
12 | * [ ] Update API docs for the component.
13 | * [ ] Update/Add demo to demonstrate new feature.
14 | * [ ] Update TypeScript definition for the component.
15 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | *.log
3 | .idea
4 | .entry
5 | .ipr
6 | .iws
7 | *~
8 | ~*
9 | *.diff
10 | *.patch
11 | *.bak
12 | .DS_Store
13 | package-lock.json
14 | Thumbs.db
15 | .project
16 | .*proj
17 | .svn
18 | *.swp
19 | *.swo
20 | *.pyc
21 | *.pyo
22 | node_modules
23 | .cache
24 | .vscode
25 | *.xcworkspace
26 | .tea
27 | .entry
28 | /build/
29 | /lib/
30 | demo/es/
31 | dist/
32 | es/
33 | .kaitian
34 | .mini-ide
--------------------------------------------------------------------------------
/.npmrc:
--------------------------------------------------------------------------------
1 | package-lock=false
--------------------------------------------------------------------------------
/.stylelintrc:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "stylelint-config-standard",
3 | "rules": {
4 | at-rule-empty-line-before: null,
5 | at-rule-name-space-after: null,
6 | at-rule-no-unknown: null,
7 | comment-empty-line-before: null,
8 | declaration-bang-space-before: null,
9 | declaration-empty-line-before: null,
10 | function-comma-newline-after: null,
11 | function-name-case: null,
12 | function-parentheses-newline-inside: null,
13 | function-max-empty-lines: null,
14 | function-whitespace-after: null,
15 | indentation: null,
16 | number-leading-zero: null,
17 | number-no-trailing-zeros: null,
18 | rule-empty-line-before: null,
19 | selector-combinator-space-after: null,
20 | selector-list-comma-newline-after: null,
21 | selector-pseudo-element-colon-notation: null,
22 | unit-no-unknown: null,
23 | value-list-max-empty-lines: null,
24 | unit-case: null,
25 | color-hex-case: null,
26 | "selector-type-no-unknown": [
27 | true,
28 | {
29 | "ignoreTypes": [
30 | "page"
31 | ]
32 | }
33 | ],
34 | }
35 | }
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT LICENSE
2 |
3 | Copyright (c) 2018-present Alipay.com, https://www.alipay.com/
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining
6 | a copy of this software and associated documentation files (the
7 | "Software"), to deal in the Software without restriction, including
8 | without limitation the rights to use, copy, modify, merge, publish,
9 | distribute, sublicense, and/or sell copies of the Software, and to
10 | permit persons to whom the Software is furnished to do so, subject to
11 | the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be
14 | included in all copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
--------------------------------------------------------------------------------
/babel.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | presets: [
3 | [
4 | '@babel/preset-env',
5 | {
6 | loose: true,
7 | modules: false,
8 | },
9 | ],
10 | '@babel/preset-typescript',
11 | ],
12 | plugins: [
13 | '@babel/plugin-syntax-dynamic-import',
14 | '@babel/plugin-transform-runtime',
15 | ],
16 | };
17 |
--------------------------------------------------------------------------------
/demo/app.acss:
--------------------------------------------------------------------------------
1 | page {
2 | background-color: #f5f5f5;
3 | }
--------------------------------------------------------------------------------
/demo/app.js:
--------------------------------------------------------------------------------
1 | App({
2 | globalData: {
3 | // miniAliUiLang: 'en-US',
4 | },
5 | onLaunch() { },
6 | onShow() { },
7 | onHide() { },
8 | });
9 |
--------------------------------------------------------------------------------
/demo/mini.project.json:
--------------------------------------------------------------------------------
1 | {
2 | "component2": true,
3 | "axmlStrictCheck": true,
4 | "enableAppxNg": false
5 | }
--------------------------------------------------------------------------------
/demo/pages/alphabet/index.acss:
--------------------------------------------------------------------------------
1 | .dyt-list {
2 | margin-top: 0;
3 | }
4 | .dyt-list .am-list-item-thumb {
5 | border-radius: 5px;
6 | }
7 | .dyt-list .am-list-brief {
8 | color: #909090;
9 | font-size: 14px;
10 | }
11 |
12 | .am-list-sticky {
13 | position: sticky;
14 | top: 0;
15 | z-index: 2;
16 | }
17 |
--------------------------------------------------------------------------------
/demo/pages/alphabet/index.axml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/demo/pages/alphabet/index.js:
--------------------------------------------------------------------------------
1 | Page({
2 | data: {
3 | alphabet: ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'],
4 | },
5 | onAlphabetClick(ev) {
6 | my.alert({
7 | content: JSON.stringify(ev.data),
8 | });
9 | },
10 | });
11 |
--------------------------------------------------------------------------------
/demo/pages/alphabet/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultTitle": "Alphabet",
3 | "usingComponents":{
4 | "alphabet": "../../es/list/alphabet/index",
5 | "am-icon": "../../es/am-icon/index"
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/demo/pages/am-checkbox/index.acss:
--------------------------------------------------------------------------------
1 | /* required by usingComponents */
--------------------------------------------------------------------------------
/demo/pages/am-checkbox/index.js:
--------------------------------------------------------------------------------
1 | Page({
2 | data: {
3 | items: [
4 | { value: 'a', title: '复选框-默认未选中', id: 'checkbox1' },
5 | { checked: true, value: 'b', title: '复选框-默认选中', id: 'checkbox2' },
6 | { checked: true, disabled: true, value: 'c', title: '复选框-默认选中disabled', id: 'checkbox3' },
7 | ],
8 | items1: [
9 | { ctrlChecked: false, disabled: false, value: 'd', title: '复选框-默认未选中', id: 'checkbox4' },
10 | { ctrlChecked: true, disabled: true, value: 'e', title: '复选框-默认未选中disabled', id: 'checkbox5' },
11 | { ctrlChecked: true, value: 'f', title: '复选框-默认选中', id: 'checkbox6' },
12 | ],
13 | },
14 | onChange(e) {
15 | const { id } = e.currentTarget.dataset;
16 | const { value } = e.detail;
17 | const { items1 } = this.data;
18 | const { length } = items1;
19 | for (let index = 0; index < length; index += 1) {
20 | if (items1[index].id === id) {
21 | this.setData({
22 | [`items1[${index}].ctrlChecked`]: value,
23 | });
24 | break;
25 | }
26 | }
27 | },
28 | // 全选
29 | checkedON() {
30 | this.checkedAll(true);
31 | },
32 | // 全不选
33 | checkedOFF() {
34 | this.checkedAll(false);
35 | },
36 | checkedAll(status) {
37 | const items1 = this.data.items1.map((element) => ({
38 | ...element,
39 | ctrlChecked: status,
40 | }));
41 | this.setData({
42 | items1,
43 | });
44 | },
45 | });
46 |
--------------------------------------------------------------------------------
/demo/pages/am-checkbox/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultTitle": "Am-checkbox",
3 | "usingComponents": {
4 | "am-checkbox": "../../es/am-checkbox/index",
5 | "list": "../../es/list/index",
6 | "list-item": "../../es/list/list-item/index",
7 | "button": "../../es/button/index"
8 | }
9 | }
--------------------------------------------------------------------------------
/demo/pages/am-icon/index.acss:
--------------------------------------------------------------------------------
1 | .icon-list {
2 | padding-bottom: 10px;
3 | background: #fff;
4 | }
5 |
6 | .icon-item {
7 | display: inline-flex;
8 | width: 33.33333%;
9 | height: 80px;
10 | align-items: center;
11 | flex-direction: column;
12 | justify-content: center;
13 | }
14 |
15 | .icon-desc {
16 | margin-top: 10px;
17 | }
18 |
19 | .searchInput {
20 | width: 100%;
21 | color: #f32600;
22 | background-color: #f5f5f5;
23 | border-bottom: 2rpx solid #eee;
24 | }
25 |
--------------------------------------------------------------------------------
/demo/pages/am-icon/index.axml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | {{item}}
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | {{item}}
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/demo/pages/am-icon/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultTitle": "Am-icon",
3 | "usingComponents": {
4 | "am-icon": "../../es/am-icon/index"
5 | }
6 | }
--------------------------------------------------------------------------------
/demo/pages/am-radio/index.acss:
--------------------------------------------------------------------------------
1 | .radio {
2 | display: flex; align-items: center;
3 | }
4 | .page-section-demo {
5 | padding: 24rpx;
6 | }
--------------------------------------------------------------------------------
/demo/pages/am-radio/index.axml:
--------------------------------------------------------------------------------
1 |
2 | 单选框
3 |
4 |
5 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/demo/pages/am-radio/index.js:
--------------------------------------------------------------------------------
1 | Page({
2 | data: {
3 | items: [
4 | { checked: true, disabled: false, value: 'a', desc: '单选框-默认选中', id: 'checkbox1' },
5 | { checked: false, disabled: false, value: 'b', desc: '单选框-默认未选中', id: 'checkbox2' },
6 | ],
7 | items1: [
8 | { checked: true, disabled: true, value: 'c', desc: '单选框-默认选中disabled', id: 'checkbox3' },
9 | ],
10 | },
11 | onSubmit(e) {
12 | my.alert({
13 | content: e.detail.value.lib,
14 | });
15 | },
16 | onReset() {
17 | },
18 | radioChange() {
19 | },
20 | });
21 |
--------------------------------------------------------------------------------
/demo/pages/am-radio/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultTitle": "Am-radio",
3 | "usingComponents": {
4 | "am-radio": "../../es/am-radio/index",
5 | "list": "../../es/list/index",
6 | "list-item": "../../es/list/list-item/index"
7 | }
8 | }
--------------------------------------------------------------------------------
/demo/pages/am-switch/index.acss:
--------------------------------------------------------------------------------
1 | page {
2 | padding: 24rpx;
3 | }
4 | .page-description,
5 | .switch-item {
6 | margin-bottom: 24rpx;
7 | }
--------------------------------------------------------------------------------
/demo/pages/am-switch/index.axml:
--------------------------------------------------------------------------------
1 |
2 | 开关
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/demo/pages/am-switch/index.js:
--------------------------------------------------------------------------------
1 | Page({
2 | switch1Change(e) {
3 | console.log('switch1 发生 change 事件,携带值为', e.detail.value);
4 | },
5 | });
6 |
--------------------------------------------------------------------------------
/demo/pages/am-switch/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultTitle": "Am-switch",
3 | "usingComponents": {
4 | "am-switch": "../../es/am-switch/index"
5 | }
6 | }
--------------------------------------------------------------------------------
/demo/pages/amount-input/index.acss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Alibaba-mp/mini-ali-ui/19d221e991d53fc89bdede86a36cfd5da9ef9791/demo/pages/amount-input/index.acss
--------------------------------------------------------------------------------
/demo/pages/amount-input/index.axml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
--------------------------------------------------------------------------------
/demo/pages/amount-input/index.js:
--------------------------------------------------------------------------------
1 | Page({
2 | data: {
3 | value: 200,
4 | },
5 | onInputClear() {
6 | this.setData({
7 | value: '',
8 | });
9 | },
10 | onInputConfirm(e) {
11 | console.log(e);
12 | my.alert({
13 | content: 'confirmed',
14 | });
15 | },
16 | onInput(e) {
17 | console.log(e);
18 | const { value } = e.detail;
19 | this.setData({
20 | value,
21 | });
22 | },
23 | onButtonClick() {
24 | my.alert({
25 | content: 'button clicked',
26 | });
27 | },
28 | onInputFocus(e) {
29 | console.log(e);
30 | },
31 | onInputBlur(e) {
32 | console.log(e);
33 | },
34 | });
35 |
--------------------------------------------------------------------------------
/demo/pages/amount-input/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultTitle": "Amount-input",
3 | "usingComponents":{
4 | "amount-input": "../../es/amount-input/index"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/demo/pages/avatar/index.acss:
--------------------------------------------------------------------------------
1 | .demo-avatar {
2 | padding: 30rpx;
3 | background-color: #fff;
4 | }
5 | .demo-avatar-size {
6 | display: flex;
7 | }
8 | .demo-avatar-size-container {
9 | margin-right: 30rpx;
10 | display: flex;
11 | flex-direction: column;
12 | align-items: center;
13 | justify-content: flex-end;
14 | }
15 | .demo-avatar-size-container text {
16 | padding-top: 16rpx;
17 | font-size: 26rpx;
18 | }
19 | .demo-avatar-size-intro {
20 | margin-bottom: 20rpx;
21 | font-weight: bold;
22 | }
23 |
--------------------------------------------------------------------------------
/demo/pages/avatar/index.axml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 四种尺寸
4 |
5 |
6 |
7 | lg
8 |
9 |
10 |
11 | 默认值:md
12 |
13 |
14 |
15 | sm
16 |
17 |
18 |
19 | xs
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/demo/pages/avatar/index.js:
--------------------------------------------------------------------------------
1 | Page({
2 | data: {},
3 | handleError(e) {
4 | console.log(e);
5 | },
6 | });
7 |
--------------------------------------------------------------------------------
/demo/pages/avatar/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultTitle": "Avatar",
3 | "usingComponents":{
4 | "avatar": "../../es/avatar/index"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/demo/pages/badge/index.acss:
--------------------------------------------------------------------------------
1 | .list-like {
2 | display: flex;
3 | background: #fff;
4 | padding: 12px;
5 | justify-content: space-between;
6 | border-bottom: 1px solid #eee;
7 | }
--------------------------------------------------------------------------------
/demo/pages/badge/index.axml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
10 |
12 |
13 | {{item.intro}}
14 |
15 |
16 |
22 |
23 |
24 |
25 |
26 |
32 | 深色底时,stroke 可设为 true
33 |
38 |
39 |
--------------------------------------------------------------------------------
/demo/pages/badge/index.js:
--------------------------------------------------------------------------------
1 | Page({
2 | data: {
3 | items: [
4 | {
5 | dot: true,
6 | text: '',
7 | isWrap: true,
8 | intro: 'Dot Badge',
9 | },
10 | {
11 | dot: false,
12 | text: 1,
13 | isWrap: true,
14 | intro: 'Text Badge',
15 | },
16 | {
17 | dot: false,
18 | text: 99,
19 | isWrap: false,
20 | intro: '数字',
21 | },
22 | {
23 | dot: false,
24 | text: 100,
25 | overflowCount: 99,
26 | isWrap: false,
27 | intro: '数字超过overflowCount',
28 | },
29 | {
30 | dot: false,
31 | text: 'new',
32 | isWrap: false,
33 | intro: '文字',
34 | },
35 | {
36 | dot: false,
37 | text: '22222222222222',
38 | isWrap: false,
39 | intro: '箭头中',
40 | withArrow: true,
41 | direction: 'middle',
42 | },
43 | {
44 | dot: false,
45 | text: 'left arrow',
46 | isWrap: false,
47 | intro: '箭头左',
48 | withArrow: true,
49 | direction: 'left',
50 | },
51 | {
52 | dot: false,
53 | text: 'right arrow',
54 | isWrap: false,
55 | intro: '箭头右',
56 | withArrow: true,
57 | direction: 'right',
58 | },
59 | ],
60 | },
61 | });
62 |
--------------------------------------------------------------------------------
/demo/pages/badge/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultTitle": "Badge",
3 | "usingComponents": {
4 | "list-item": "../../es/list/list-item/index",
5 | "badge": "../../es/badge/index"
6 | }
7 | }
--------------------------------------------------------------------------------
/demo/pages/button/index.acss:
--------------------------------------------------------------------------------
1 | .container {
2 | padding: 20rpx;
3 | }
4 |
5 | .container button {
6 | margin-bottom: 24rpx;
7 | }
8 |
9 | .title {
10 | padding-top: 24rpx;
11 | font-weight: bold;
12 | }
13 | .inputItem {
14 | margin: 16rpx 0 24rpx;
15 | padding: 8rpx 16rpx;
16 | font-size: 30rpx;
17 | border: 1px solid #eee;
18 | }
19 | .radio-group {
20 | display: flex;
21 | flex-wrap: wrap;
22 | margin-bottom: 24rpx;
23 | }
24 | .radio {
25 | display: flex;
26 | align-items: center;
27 | margin-right: 16rpx;
28 | }
29 | .changeItem {
30 | display: flex;
31 | align-items: center;
32 | margin-bottom: 24rpx;
33 | }
--------------------------------------------------------------------------------
/demo/pages/button/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultTitle": "Button",
3 | "usingComponents": {
4 | "button": "../../es/button/index",
5 | "container": "../../es/container/index",
6 | "radio": "../../es/am-radio/index",
7 | "checkbox": "../../es/am-checkbox/index"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/demo/pages/calendar/index.acss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Alibaba-mp/mini-ali-ui/19d221e991d53fc89bdede86a36cfd5da9ef9791/demo/pages/calendar/index.acss
--------------------------------------------------------------------------------
/demo/pages/calendar/index.axml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
--------------------------------------------------------------------------------
/demo/pages/calendar/index.js:
--------------------------------------------------------------------------------
1 | Page({
2 | data: {
3 | tagData: [
4 | { date: '2020-02-14', tag: '颜色 1', tagColor: 1 },
5 | { date: '2020-02-28', tag: '公积金', tagColor: 2 },
6 | { date: '2020-02-24', tag: '颜色 3', tagColor: 3 },
7 | { date: '2020-02-18', tag: '颜色 4', tagColor: 4 },
8 | { date: '2020-02-4', tag: '还房贷', tagColor: 5 },
9 | { date: '2020-02-10', tag: '公积金', disable: true },
10 | ],
11 | },
12 | onLoad() {
13 | const getDate = new Date();
14 | const getYear = getDate.getFullYear();
15 | const getMonth = getDate.getMonth();
16 | let m = getMonth + 1;
17 | if (m.toString().length === 1) {
18 | m = '0' + m;
19 | }
20 | this.setData({
21 | tagData: [
22 | { date: getYear + '-' + m + '-14', tag: '颜色 1', tagColor: 1 },
23 | { date: getYear + '-' + m + '-28', tag: '公积金', tagColor: 2 },
24 | { date: getYear + '-' + m + '-24', tag: '颜色 3', tagColor: 3 },
25 | { date: getYear + '-' + m + '-18', tag: '颜色 4', tagColor: 4 },
26 | { date: getYear + '-' + m + '-4', tag: '还房贷', tagColor: 5 },
27 | { date: getYear + '-' + m + '-10', tag: '公积金', disable: true },
28 | ],
29 | });
30 | },
31 | handleSelect() {},
32 | onMonthChange() {},
33 | onYearChange() {},
34 | onChange() {},
35 | onSelectHasDisableDate() {
36 | my.alert({
37 | content: 'SelectHasDisableDate',
38 | });
39 | },
40 | });
41 |
--------------------------------------------------------------------------------
/demo/pages/calendar/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultTitle": "Calendar",
3 | "usingComponents":{
4 | "calendar":"../../es/calendar/index"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/demo/pages/card/index.acss:
--------------------------------------------------------------------------------
1 | .container {
2 | padding-bottom: 50px;
3 | }
--------------------------------------------------------------------------------
/demo/pages/card/index.axml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
11 |
12 |
13 |
24 |
25 |
26 |
27 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/demo/pages/card/index.js:
--------------------------------------------------------------------------------
1 | Page({
2 | data: {
3 | thumb: 'https://gw.alipayobjects.com/mdn/rms_ce4c6f/afts/img/A*b-kqQ4RZgsYAAAAAAAAAAABkARQnAQ',
4 | expand3rd: false,
5 | },
6 | onCardClick(ev) {
7 | my.alert({
8 | content: ev.info,
9 | });
10 | },
11 | onActionClick() {
12 | my.alert({
13 | content: 'action clicked',
14 | });
15 | },
16 | onExtraActionClick() {
17 | my.alert({
18 | content: 'extra action clicked',
19 | });
20 | },
21 | toggle() {
22 | this.setData({
23 | expand3rd: !this.data.expand3rd,
24 | });
25 | },
26 | });
27 |
--------------------------------------------------------------------------------
/demo/pages/card/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultTitle": "Card",
3 | "usingComponents":{
4 | "card":"../../es/card/index"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/demo/pages/collapse/index.acss:
--------------------------------------------------------------------------------
1 | .item-content {
2 | padding: 12px;
3 | font-size: 17px;
4 | color: #333;
5 | line-height: 24px;
6 | }
7 |
8 | .content1 {
9 | height: 300rpx;
10 | }
11 |
12 | .content2 {
13 | height: 50px;
14 | }
15 |
16 | .content3 {
17 | height: 100px;
18 | }
19 |
20 | .demo-title {
21 | padding: 14px 16px;
22 | color: #999;
23 | }
24 |
25 | .demo-collapse {
26 | border-bottom: 1px solid #eee;
27 | }
28 |
--------------------------------------------------------------------------------
/demo/pages/collapse/index.js:
--------------------------------------------------------------------------------
1 | Page({
2 | data: {
3 | randomLine: 0,
4 | },
5 | onShow() {
6 | this.setData({
7 | randomLine: parseInt(Math.random() * 20 + 1, 0),
8 | });
9 | },
10 | onChange(e) {
11 | console.log('collapse change', e);
12 | },
13 | });
14 |
--------------------------------------------------------------------------------
/demo/pages/collapse/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultTitle": "Collapse",
3 | "usingComponents": {
4 | "collapse": "../../es/collapse/index",
5 | "collapse-item": "../../es/collapse/collapse-item/index"
6 | }
7 | }
--------------------------------------------------------------------------------
/demo/pages/container/index.acss:
--------------------------------------------------------------------------------
1 | .container {
2 | background: #F5F5F5;
3 | padding: 24rpx;
4 | height: 100%;
5 | }
6 |
7 | .container-item {
8 | margin-bottom: 24rpx;
9 | }
10 |
11 | .footer {
12 | color: #333;
13 | margin-top: 24rpx;
14 | }
15 |
16 | .item {
17 | background: #eeeeee;
18 | text-align: center;
19 | height: 200rpx;
20 | padding-top: 20rpx;
21 | }
22 |
23 | .grid-item {
24 | background: #eeeeee;
25 | text-align: center;
26 | }
27 |
--------------------------------------------------------------------------------
/demo/pages/container/index.js:
--------------------------------------------------------------------------------
1 | Page({
2 | data: {},
3 | onLoad() {},
4 | titleClick() {
5 | my.alert({
6 | title: 'onActionTap 回调',
7 | content: '标题后面操作区域点击',
8 | });
9 | },
10 | });
11 |
--------------------------------------------------------------------------------
/demo/pages/container/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultTitle": "Container",
3 | "usingComponents": {
4 | "container": "../../es/container/index",
5 | "title": "../../es/title/index"
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/demo/pages/coupon/index.acss:
--------------------------------------------------------------------------------
1 | .container {
2 | padding-bottom: 50px;
3 | }
4 | .coupon_rule text {
5 | display: block;
6 | margin-bottom: 8rpx;
7 | }
8 |
9 | /* 左侧权益内容的样式 slot="category" */
10 | .categoryDemo {
11 | display: flex;
12 | flex-wrap: wrap;
13 | justify-content: center;
14 | align-content: center;
15 | align-items: baseline;
16 | align-self: flex-start;
17 | }
18 | .categoryDemo .price {
19 | font-size: 60rpx;
20 | color: #FF6010;
21 | }
22 | .categoryDemo .unit {
23 | padding-left: 4rpx;
24 | font-weight: bold;
25 | font-size: 26rpx;
26 | color: #FF6010;
27 | }
28 | .categoryDemo .type {
29 | flex: 1 1 100%;
30 | text-align: center;
31 | font-size: 22rpx;
32 | color: #999;
33 | }
--------------------------------------------------------------------------------
/demo/pages/coupon/index.js:
--------------------------------------------------------------------------------
1 | Page({
2 | data: {
3 | thumb: 'https://gw.alipayobjects.com/mdn/rms_ce4c6f/afts/img/A*b-kqQ4RZgsYAAAAAAAAAAABkARQnAQ',
4 | },
5 | onCouponClick(e) {
6 | if (e.currentTarget.dataset.used) {
7 | return false;
8 | } else {
9 | my.alert({
10 | content: '可用票券,票券点击事件',
11 | });
12 | }
13 | },
14 | onButtonTap() {
15 | my.alert({
16 | content: '胶囊按钮点击事件',
17 | });
18 | },
19 | });
20 |
--------------------------------------------------------------------------------
/demo/pages/coupon/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultTitle": "Coupon",
3 | "usingComponents":{
4 | "coupon":"../../es/coupon/index",
5 | "button": "../../es/button/index",
6 | "am-checkbox": "../../es/am-checkbox/index",
7 | "stepper": "../../es/stepper/index"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/demo/pages/filter/alternative/index.acss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Alibaba-mp/mini-ali-ui/19d221e991d53fc89bdede86a36cfd5da9ef9791/demo/pages/filter/alternative/index.acss
--------------------------------------------------------------------------------
/demo/pages/filter/alternative/index.axml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/demo/pages/filter/alternative/index.js:
--------------------------------------------------------------------------------
1 | Page({
2 | data: {
3 | show: true,
4 | items: [
5 | { id: 1, value: '衣服', selected: true },
6 | { id: 1, value: '橱柜' },
7 | { id: 1, value: '衣架' },
8 | { id: 3, value: '数码产品' },
9 | { id: 4, value: '防盗门' },
10 | { id: 5, value: '椅子' },
11 | { id: 7, value: '显示器' },
12 | { id: 6, value: '某最新款电子产品' },
13 | { id: 8, value: '某某某某某牌电视游戏底座' },
14 | ],
15 | },
16 | handleCallBack(data) {
17 | my.alert({
18 | content: data,
19 | });
20 | },
21 | toggleFilter() {
22 | this.setData({
23 | show: !this.data.show,
24 | });
25 | },
26 | });
27 |
--------------------------------------------------------------------------------
/demo/pages/filter/alternative/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultTitle": "Filter",
3 | "usingComponents": {
4 | "filter": "../../../es/filter/index",
5 | "filter-item": "../../../es/filter/filter-item/index"
6 | }
7 | }
--------------------------------------------------------------------------------
/demo/pages/filter/index.acss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Alibaba-mp/mini-ali-ui/19d221e991d53fc89bdede86a36cfd5da9ef9791/demo/pages/filter/index.acss
--------------------------------------------------------------------------------
/demo/pages/filter/index.axml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 单行2列
5 |
6 |
7 | 单行3列
8 |
9 |
10 | 双行2列
11 |
12 |
13 | 多选
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/demo/pages/filter/index.js:
--------------------------------------------------------------------------------
1 | Page({
2 | openPage(e) {
3 | my.navigateTo({
4 | url: e.target.dataset.url,
5 | });
6 | },
7 | });
8 |
--------------------------------------------------------------------------------
/demo/pages/filter/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultTitle": "Filter",
3 | "usingComponents": {
4 | "list": "../../es/list/index",
5 | "list-item": "../../es/list/list-item/index"
6 | }
7 | }
--------------------------------------------------------------------------------
/demo/pages/filter/single/index.acss:
--------------------------------------------------------------------------------
1 | /* required by usingComponents */
--------------------------------------------------------------------------------
/demo/pages/filter/single/index.axml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/demo/pages/filter/single/index.js:
--------------------------------------------------------------------------------
1 | Page({
2 | data: {
3 | show: true,
4 | items: [
5 | { id: 1, value: '衣服', selected: true },
6 | { id: 1, value: '橱柜' },
7 | ],
8 | },
9 | handleCallBack(data) {
10 | my.alert({
11 | content: data,
12 | });
13 | },
14 | toggleFilter() {
15 | this.setData({
16 | show: !this.data.show,
17 | });
18 | },
19 | });
20 |
--------------------------------------------------------------------------------
/demo/pages/filter/single/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultTitle": "Filter",
3 | "usingComponents": {
4 | "filter": "../../../es/filter/index",
5 | "filter-item": "../../../es/filter/filter-item/index"
6 | }
7 | }
--------------------------------------------------------------------------------
/demo/pages/filter/single_1/index.acss:
--------------------------------------------------------------------------------
1 | /* required by usingComponents */
--------------------------------------------------------------------------------
/demo/pages/filter/single_1/index.axml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/demo/pages/filter/single_1/index.js:
--------------------------------------------------------------------------------
1 | Page({
2 | data: {
3 | show: true,
4 | items: [
5 | { id: 1, value: '衣服啊', selected: true },
6 | { id: 1, value: '橱柜' },
7 | { id: 1, value: '衣服' },
8 | { id: 1, value: '橱柜' },
9 | { id: 1, value: '衣服' },
10 | { id: 1, value: '橱柜' },
11 | { id: 1, value: '衣服' },
12 | { id: 1, value: '橱柜' },
13 | { id: 1, value: '橱柜' },
14 | ],
15 | },
16 | handleCallBack(data) {
17 | my.alert({
18 | content: data,
19 | });
20 | },
21 | toggleFilter() {
22 | this.setData({
23 | show: !this.data.show,
24 | });
25 | },
26 | });
27 |
--------------------------------------------------------------------------------
/demo/pages/filter/single_1/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultTitle": "Filter",
3 | "usingComponents": {
4 | "filter": "../../../es/filter/index",
5 | "filter-item": "../../../es/filter/filter-item/index"
6 | }
7 | }
--------------------------------------------------------------------------------
/demo/pages/filter/single_2/index.acss:
--------------------------------------------------------------------------------
1 | /* required by usingComponents */
--------------------------------------------------------------------------------
/demo/pages/filter/single_2/index.axml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/demo/pages/filter/single_2/index.js:
--------------------------------------------------------------------------------
1 | Page({
2 | data: {
3 | show: true,
4 | items: [
5 | { id: 1, value: '衣服', subtitle: '子标题', selected: true },
6 | { id: 1, value: '橱柜', subtitle: '子标题' },
7 | ],
8 | },
9 | handleCallBack(data) {
10 | my.alert({
11 | content: data,
12 | });
13 | },
14 | toggleFilter() {
15 | this.setData({
16 | show: !this.data.show,
17 | });
18 | },
19 | });
20 |
--------------------------------------------------------------------------------
/demo/pages/filter/single_2/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultTitle": "Filter",
3 | "usingComponents": {
4 | "filter": "../../../es/filter/index",
5 | "filter-item": "../../../es/filter/filter-item/index"
6 | }
7 | }
--------------------------------------------------------------------------------
/demo/pages/flex/index.acss:
--------------------------------------------------------------------------------
1 | .flex-container {
2 | padding: 10px;
3 | }
4 |
5 | .sub-title {
6 | color: #888;
7 | font-size: 14px;
8 | padding: 30px 0 18px 0;
9 | }
10 |
11 | .placeholder {
12 | background-color: #ebebef;
13 | color: #bbb;
14 | text-align: center;
15 | height: 30px;
16 | line-height: 30px;
17 | width: 100%;
18 | }
19 |
20 | .placeholder.inline {
21 | width: 80px;
22 | margin: 9px 9px 9px 0;
23 | }
24 |
25 | .placeholder.small {
26 | height: 20px;
27 | line-height: 20px
28 | }
--------------------------------------------------------------------------------
/demo/pages/flex/index.js:
--------------------------------------------------------------------------------
1 | Page({});
2 |
--------------------------------------------------------------------------------
/demo/pages/flex/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultTitle": "Flex",
3 | "usingComponents": {
4 | "flex": "../../es/flex/index",
5 | "flex-item": "../../es/flex/flex-item/index"
6 | }
7 | }
--------------------------------------------------------------------------------
/demo/pages/footer/index.acss:
--------------------------------------------------------------------------------
1 | page {
2 | padding-top: 20px;
3 | background-color: #fff;
4 | }
5 | .am-footer {
6 | margin-bottom: 40px;
7 | }
--------------------------------------------------------------------------------
/demo/pages/footer/index.axml:
--------------------------------------------------------------------------------
1 |
5 |
10 |
14 |
20 |
25 |
31 |
36 |
39 |
--------------------------------------------------------------------------------
/demo/pages/footer/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultTitle": "Footer",
3 | "usingComponents": {
4 | "footer": "../../es/footer/index"
5 | }
6 | }
--------------------------------------------------------------------------------
/demo/pages/form/index.acss:
--------------------------------------------------------------------------------
1 | .extra {
2 | background-image: url('https://gw.alipayobjects.com/zos/rmsportal/dOfSJfWQvYdvsZiJStvg.svg');
3 | background-size: contain;
4 | background-repeat: no-repeat;
5 | background-position: right center;
6 | opacity: 0.2;
7 | height: 20px;
8 | width: 20px;
9 | padding-left: 10px;
10 | }
11 | .title {
12 | font-size: 16px;
13 | font-weight: 400;
14 | margin: 15px 0 10px;
15 | padding: 0 7px;
16 | }
--------------------------------------------------------------------------------
/demo/pages/form/index.axml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 表单
5 |
14 | 标题
15 |
16 |
20 | 标题
21 |
22 |
28 |
35 | 多行输入
36 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/demo/pages/form/index.js:
--------------------------------------------------------------------------------
1 | const banks = ['网商银行', '建设银行', '工商银行', '浦发银行'];
2 |
3 | Page({
4 | data: {
5 | inputValue: '内容',
6 | inputFocus: true,
7 | bank: '',
8 | name: '',
9 | },
10 | onAutoFocus() {
11 | this.setData({
12 | inputFocus: true,
13 | });
14 | },
15 | onExtraTap() {
16 | my.alert({
17 | content: 'extra tapped',
18 | });
19 | },
20 | onItemInput(e) {
21 | this.setData({
22 | [e.target.dataset.field]: e.detail.value,
23 | });
24 | },
25 | onItemFocus() {
26 | this.setData({
27 | inputFocus: false,
28 | });
29 | },
30 | onItemBlur() {},
31 | onItemConfirm() {},
32 | onClear(e) {
33 | this.setData({
34 | [e.target.dataset.field]: '',
35 | });
36 | },
37 | onPickerTap() {
38 | my.showActionSheet({
39 | title: '选择发卡银行',
40 | items: banks,
41 | success: (res) => {
42 | this.setData({
43 | bank: banks[res.index],
44 | });
45 | },
46 | });
47 | },
48 | onSend() {
49 | my.alert({
50 | title: 'verify code sent',
51 | });
52 | },
53 | });
54 |
--------------------------------------------------------------------------------
/demo/pages/form/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultTitle": "Form",
3 | "usingComponents": {
4 | "list": "../../es/list/index",
5 | "input-item": "../../es/input-item/index",
6 | "picker-item": "../../es/picker-item/index",
7 | "verify-code": "../../es/verify-code/index",
8 | "multi-liner": "../../es/multi-liner/index",
9 | "long-password": "../../es/long-password/index"
10 | }
11 | }
--------------------------------------------------------------------------------
/demo/pages/grid/2/index.acss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Alibaba-mp/mini-ali-ui/19d221e991d53fc89bdede86a36cfd5da9ef9791/demo/pages/grid/2/index.acss
--------------------------------------------------------------------------------
/demo/pages/grid/2/index.axml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/demo/pages/grid/2/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultTitle": "Grid",
3 | "usingComponents":{
4 | "grid":"../../../es/grid/index"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/demo/pages/grid/3/index.acss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Alibaba-mp/mini-ali-ui/19d221e991d53fc89bdede86a36cfd5da9ef9791/demo/pages/grid/3/index.acss
--------------------------------------------------------------------------------
/demo/pages/grid/3/index.axml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/demo/pages/grid/3/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultTitle": "Grid",
3 | "usingComponents":{
4 | "grid":"../../../es/grid/index"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/demo/pages/grid/4/index.acss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Alibaba-mp/mini-ali-ui/19d221e991d53fc89bdede86a36cfd5da9ef9791/demo/pages/grid/4/index.acss
--------------------------------------------------------------------------------
/demo/pages/grid/4/index.axml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/demo/pages/grid/4/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultTitle": "Grid",
3 | "usingComponents":{
4 | "grid":"../../../es/grid/index"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/demo/pages/grid/5/index.acss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Alibaba-mp/mini-ali-ui/19d221e991d53fc89bdede86a36cfd5da9ef9791/demo/pages/grid/5/index.acss
--------------------------------------------------------------------------------
/demo/pages/grid/5/index.axml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 下面这个分页的高度是重置过的……
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/demo/pages/grid/5/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultTitle": "Grid",
3 | "usingComponents":{
4 | "grid":"../../../es/grid/index",
5 | "pagination": "../../../es/pagination/index"
6 | }
7 | }
--------------------------------------------------------------------------------
/demo/pages/grid/index.acss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Alibaba-mp/mini-ali-ui/19d221e991d53fc89bdede86a36cfd5da9ef9791/demo/pages/grid/index.acss
--------------------------------------------------------------------------------
/demo/pages/grid/index.axml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 2列宫格
5 |
6 |
7 | 3列宫格
8 |
9 |
10 | 4列宫格
11 |
12 |
13 | 5列宫格
14 |
15 |
16 |
--------------------------------------------------------------------------------
/demo/pages/grid/index.js:
--------------------------------------------------------------------------------
1 | Page({
2 | openPage(e) {
3 | my.navigateTo({
4 | url: e.target.dataset.url,
5 | });
6 | },
7 | });
8 |
--------------------------------------------------------------------------------
/demo/pages/grid/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultTitle": "Grid",
3 | "usingComponents":{
4 | "list": "../../es/list/index",
5 | "list-item": "../../es/list/list-item/index",
6 | "grid":"../../es/grid/index"
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/demo/pages/guide/guide.acss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Alibaba-mp/mini-ali-ui/19d221e991d53fc89bdede86a36cfd5da9ef9791/demo/pages/guide/guide.acss
--------------------------------------------------------------------------------
/demo/pages/guide/guide.axml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/demo/pages/guide/guide.js:
--------------------------------------------------------------------------------
1 | Page({
2 | data: {
3 | list: [
4 | {
5 | url: 'https://gw.alipayobjects.com/mdn/rms_ce4c6f/afts/img/A*XMCgSYx3f50AAAAAAAAAAABkARQnAQ',
6 | x: '150rpx',
7 | y: '200rpx',
8 | width: '200px',
9 | height: '200px',
10 | },
11 | {
12 | url: 'https://gw.alipayobjects.com/mdn/rms_ce4c6f/afts/img/A*gWo-TLFGp38AAAAAAAAAAABkARQnAQ',
13 | x: '250rpx',
14 | y: '150rpx',
15 | width: '200px',
16 | height: '100px',
17 | },
18 | {
19 | url: 'https://gw.alipayobjects.com/mdn/rms_ce4c6f/afts/img/A*XMCgSYx3f50AAAAAAAAAAABkARQnAQ',
20 | x: '350rpx',
21 | y: '300rpx',
22 | width: '100px',
23 | height: '100px',
24 | },
25 | {
26 | url: 'https://gw.alipayobjects.com/mdn/rms_ce4c6f/afts/img/A*gWo-TLFGp38AAAAAAAAAAABkARQnAQ',
27 | x: '400rpx',
28 | y: '400rpx',
29 | width: '200rpx',
30 | height: '300rpx',
31 | },
32 | ],
33 | guideShow: false,
34 | guideJump: true,
35 | },
36 | onLoad() {},
37 | closeGuide() {
38 | this.setData({
39 | guideShow: false,
40 | });
41 | },
42 | onShowJumpGuide() {
43 | this.setData({
44 | guideShow: true,
45 | guideJump: true,
46 | });
47 | },
48 | onShowGuide() {
49 | this.setData({
50 | guideShow: true,
51 | guideJump: false,
52 | });
53 | },
54 | });
55 |
--------------------------------------------------------------------------------
/demo/pages/guide/guide.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultTitle": "Guide",
3 | "usingComponents":{
4 | "guide": "../../es/guide/index"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/demo/pages/input-item/index.acss:
--------------------------------------------------------------------------------
1 | .extra {
2 | background-image: url('https://gw.alipayobjects.com/zos/rmsportal/dOfSJfWQvYdvsZiJStvg.svg');
3 | background-size: contain;
4 | background-repeat: no-repeat;
5 | background-position: right center;
6 | opacity: 0.2;
7 | height: 22px;
8 | width: 22px;
9 | }
--------------------------------------------------------------------------------
/demo/pages/input-item/index.js:
--------------------------------------------------------------------------------
1 | Page({
2 | data: {
3 | cardNo: '1234****',
4 | name: '',
5 | layerShow1: '',
6 | layerShow2: '垂直输入框的布局',
7 | layerShow3: 'disabled 状态的 input',
8 | },
9 | onExtraTap() {
10 | my.alert({
11 | content: 'extra tapped',
12 | });
13 | },
14 | onItemInput(e) {
15 | this.setData({
16 | [e.target.dataset.field]: e.detail.value,
17 | });
18 | },
19 | onItemFocus() {},
20 | onItemBlur() {},
21 | onItemConfirm() {},
22 | onClear(e) {
23 | this.setData({
24 | [e.target.dataset.field]: '',
25 | });
26 | },
27 | onSend() {
28 | my.alert({
29 | title: 'verify code sent',
30 | });
31 | },
32 | });
33 |
--------------------------------------------------------------------------------
/demo/pages/input-item/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultTitle": "Input-item",
3 | "usingComponents":{
4 | "list": "../../es/list/index",
5 | "input-item": "../../es/input-item/index",
6 | "am-icon": "../../es/am-icon/index"
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/demo/pages/list/app.acss:
--------------------------------------------------------------------------------
1 | .am-list-brief {
2 | color: #909090;
3 | font-size: 14px;
4 | }
--------------------------------------------------------------------------------
/demo/pages/list/app.axml:
--------------------------------------------------------------------------------
1 |
2 | {{item.components[0].type}}
3 |
4 |
5 |
10 | {{itemList.name}}
11 | {{itemList.tag}}
12 |
13 | Update
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/demo/pages/list/app.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultTitle": "小程序 mini-ali-ui 库",
3 | "usingComponents":{
4 | "list": "../../es/list/index",
5 | "list-item": "../../es/list/list-item/index",
6 | "tag": "../../es/tag/index"
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/demo/pages/list/index.acss:
--------------------------------------------------------------------------------
1 | .dyt-list {
2 | margin-top: 0;
3 | }
4 | .dyt-list .am-list-item-thumb {
5 | border-radius: 5px;
6 | }
7 | .dyt-list .am-list-briefX {
8 | color: #909090;
9 | font-size: 14px;
10 | }
11 |
12 | .am-list-sticky {
13 | position: sticky;
14 | top: 0;
15 | z-index: 2;
16 | }
17 | .am-list-item .a-icon-success_no_circle {
18 | fill: #1677ff;
19 | }
20 | .am-list-item .a-shared-checkbox {
21 | border: 0;
22 | }
23 |
--------------------------------------------------------------------------------
/demo/pages/list/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultTitle": "List",
3 | "usingComponents":{
4 | "list": "../../es/list/index",
5 | "list-item": "../../es/list/list-item/index",
6 | "alphabet": "../../es/list/alphabet/index",
7 | "list-secondary": "../../es/list/list-secondary/index",
8 | "tag": "../../es/tag/index",
9 | "am-icon": "../../es/am-icon/index",
10 | "am-switch": "../../es/am-switch/index",
11 | "am-radio": "../../es/am-radio/index",
12 | "button": "../../es/button/index"
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/demo/pages/loading/loading.acss:
--------------------------------------------------------------------------------
1 | .inlineBlock {
2 | display: inline-block;
3 | vertical-align: middle;
4 | }
--------------------------------------------------------------------------------
/demo/pages/loading/loading.axml:
--------------------------------------------------------------------------------
1 | 加载中
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/demo/pages/loading/loading.js:
--------------------------------------------------------------------------------
1 | Page({ });
2 |
--------------------------------------------------------------------------------
/demo/pages/loading/loading.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultTitle": "Loading",
3 | "usingComponents":{
4 | "loading":"../../es/loading/index",
5 | "container": "../../es/container/index"
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/demo/pages/long-password/index.acss:
--------------------------------------------------------------------------------
1 | .extra {
2 | background-image: url('https://gw.alipayobjects.com/zos/rmsportal/dOfSJfWQvYdvsZiJStvg.svg');
3 | background-size: contain;
4 | background-repeat: no-repeat;
5 | background-position: right center;
6 | opacity: 0.2;
7 | height: 20px;
8 | width: 20px;
9 | padding-left: 10px;
10 | }
--------------------------------------------------------------------------------
/demo/pages/long-password/index.axml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 长密码框
4 |
5 |
11 |
--------------------------------------------------------------------------------
/demo/pages/long-password/index.js:
--------------------------------------------------------------------------------
1 | Page({
2 | data: {
3 | longPassword: '',
4 | },
5 | onInput(e) {
6 | this.setData({
7 | longPassword: e.detail.value,
8 | });
9 | },
10 | onClear() {
11 | this.setData({
12 | longPassword: '',
13 | });
14 | },
15 | });
16 |
--------------------------------------------------------------------------------
/demo/pages/long-password/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultTitle": "Long-password",
3 | "usingComponents":{
4 | "long-password": "../../es/long-password/index"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/demo/pages/mask/mask.acss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Alibaba-mp/mini-ali-ui/19d221e991d53fc89bdede86a36cfd5da9ef9791/demo/pages/mask/mask.acss
--------------------------------------------------------------------------------
/demo/pages/mask/mask.axml:
--------------------------------------------------------------------------------
1 |
2 | 营销弹窗蒙层,type="{{type}}"
3 | 产品弹窗蒙层,type="{{type}}"
--------------------------------------------------------------------------------
/demo/pages/mask/mask.js:
--------------------------------------------------------------------------------
1 | Page({
2 | data: {
3 | type: 'market',
4 | maskZindex: 10,
5 | },
6 | maskClick() {
7 | if (this.data.type === 'market') {
8 | this.setData({
9 | type: 'product',
10 | });
11 | } else {
12 | this.setData({
13 | type: '',
14 | show: false,
15 | });
16 | }
17 | },
18 | });
19 |
--------------------------------------------------------------------------------
/demo/pages/mask/mask.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultTitle": "Mask",
3 | "usingComponents":{
4 | "mask":"../../es/mask/index"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/demo/pages/message/index.acss:
--------------------------------------------------------------------------------
1 | .radio-text,
2 | .btnLabel {
3 | margin: 0 20rpx 0 4rpx;
4 | }
5 | .radio-group {
6 | display: flex;
7 | flex-wrap: wrap;
8 | }
9 | .radio,
10 | .showBtn {
11 | display: flex;
12 | align-items: center;
13 | }
--------------------------------------------------------------------------------
/demo/pages/message/index.axml:
--------------------------------------------------------------------------------
1 |
2 |
9 | 这里是通过 slot 插槽加入的内容,加入更多自定义内容。
10 |
11 |
12 |
13 |
17 |
18 | 主标题
19 |
20 | 副标题
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/demo/pages/message/index.js:
--------------------------------------------------------------------------------
1 | Page({
2 | data: {
3 | title: '操作成功',
4 | subTitle: '内容详情可折行,建议不超过两内容。也可以通过 slot="tips" 插入更具有功能性的提示。',
5 | type: 'success',
6 | items: [
7 | { name: 'success', value: 'success', checked: true },
8 | { name: 'fail', value: 'fail' },
9 | { name: 'info', value: 'info' },
10 | { name: 'warn', value: 'warn' },
11 | { name: 'waiting', value: 'waiting' },
12 | ],
13 | },
14 | onLoad() {
15 | },
16 | goBack() {
17 | my.navigateBack();
18 | },
19 | radioChange(e) {
20 | this.setData({
21 | type: e.detail.value,
22 | });
23 | },
24 | titleChange(e) {
25 | this.setData({
26 | title: e.detail.value,
27 | });
28 | },
29 | subtitleChange(e) {
30 | this.setData({
31 | subTitle: e.detail.value,
32 | });
33 | },
34 | onChange(e) {
35 | if (e.detail.value) {
36 | this.setData({
37 | mainButton: {
38 | buttonText: '主要操作',
39 | },
40 | subButton: {
41 | buttonText: '辅助操作',
42 | },
43 | });
44 | } else {
45 | this.setData({
46 | mainButton: null,
47 | subButton: null,
48 | });
49 | }
50 | },
51 | });
52 |
--------------------------------------------------------------------------------
/demo/pages/message/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultTitle": "Message",
3 | "usingComponents": {
4 | "message": "../../es/message/index"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/demo/pages/modal/index.acss:
--------------------------------------------------------------------------------
1 | .deleteBtn {
2 | color: #f93a4a;
3 | font-weight: bolder;
4 | }
5 | .cancelBtn {
6 | color: #ccc;
7 | }
8 | .buttonBold, .modalButtonBold .am-modal-footer {
9 | font-weight: bold;
10 | }
11 |
--------------------------------------------------------------------------------
/demo/pages/modal/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultTitle": "Modal",
3 | "usingComponents":{
4 | "modal": "../../es/modal/index",
5 | "button": "../../es/button/index",
6 | "am-icon": "../../es/am-icon/index"
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/demo/pages/multi-liner/index.acss:
--------------------------------------------------------------------------------
1 | .extra {
2 | background-image: url('https://gw.alipayobjects.com/zos/rmsportal/dOfSJfWQvYdvsZiJStvg.svg');
3 | background-size: contain;
4 | background-repeat: no-repeat;
5 | background-position: right center;
6 | opacity: 0.2;
7 | height: 20px;
8 | width: 20px;
9 | padding-left: 10px;
10 | }
11 | .title {
12 | font-size: 16px;
13 | font-weight: 400;
14 | margin: 15px 0 10px;
15 | padding: 0 7px;
16 | }
--------------------------------------------------------------------------------
/demo/pages/multi-liner/index.axml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 多行输入
4 |
12 |
13 |
--------------------------------------------------------------------------------
/demo/pages/multi-liner/index.js:
--------------------------------------------------------------------------------
1 | Page({
2 | data: {
3 | value: '内容',
4 | controlled: true,
5 | },
6 | onInput(e) {
7 | this.setData({
8 | value: e.detail.value,
9 | });
10 | },
11 | });
12 |
--------------------------------------------------------------------------------
/demo/pages/multi-liner/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultTitle": "Multi-liner",
3 | "usingComponents": {
4 | "multi-liner": "../../es/multi-liner/index"
5 | }
6 | }
--------------------------------------------------------------------------------
/demo/pages/new-list/index.acss:
--------------------------------------------------------------------------------
1 | .setting {
2 | padding: 20px;
3 | overflow: scroll;
4 | box-shadow: inset 0px 1px 4px 0px rgba(204,204,204,1);
5 | }
6 | .gap {
7 | height: 10px;
8 | }
9 | .row {
10 | display: flex;
11 | align-items: center;
12 | padding: 0 30rpx;
13 | background-color: white;
14 | }
15 |
16 | .row-title {
17 | flex: 1;
18 | padding-top: 28rpx;
19 | padding-bottom: 28rpx;
20 | font-size: 34rpx;
21 | color: #000;
22 | }
23 |
24 | .row-extra {
25 | flex-basis: initial;
26 | font-size: 32rpx;
27 | color: #888;
28 | margin-right: 12px;
29 | }
30 |
31 | .row-arrow {
32 | width: 32rpx;
33 | height: 32rpx;
34 | margin-left: 16rpx;
35 | }
36 |
37 | .new-list-container {
38 | height: 100vh;
39 | display: flex;
40 | flex-direction: column;
41 | }
--------------------------------------------------------------------------------
/demo/pages/new-list/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultTitle": "List item",
3 | "usingComponents":{
4 | "list": "../../es/list/index",
5 | "list-item": "../../es/list/list-item/index",
6 | "list-secondary": "../../es/list/list-secondary/index",
7 | "tag": "../../es/tag/index",
8 | "am-icon": "../../es/am-icon/index",
9 | "title": "../../es/title/index",
10 | "input-item": "../../es/input-item/index",
11 | "am-button": "../../es/button/index",
12 | "am-radio": "../../es/am-radio/index",
13 | "am-switch": "../../es/am-switch/index"
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/demo/pages/notice/index.acss:
--------------------------------------------------------------------------------
1 | .demo-title {
2 | font-size: 15px;
3 | font-weight: 500;
4 | margin: 24rpx 16rpx;
5 | padding-bottom: 24rpx;
6 | border-bottom: 1px solid #ccc;
7 | }
8 | .radio-group {
9 | display: flex;
10 | flex-wrap: wrap;
11 | padding: 0 24rpx 24rpx;
12 | }
13 | .radio-text {
14 | margin-right: 24rpx;
15 | }
16 | input {
17 | margin: 0 0 16rpx 24rpx;
18 | padding: 8rpx 16rpx;
19 | font-size: 30rpx;
20 | border: 1px solid #eee;
21 | }
22 | .demo-item {
23 | margin-bottom: 24rpx;
24 | }
25 |
26 | .nomore-notice {
27 | color: #999;
28 | }
29 | .itemSize {
30 | width: 30px;
31 | height: 30px;
32 | margin-right: 24rpx;
33 | vertical-align: middle;
34 | }
--------------------------------------------------------------------------------
/demo/pages/notice/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultTitle": "Notice",
3 | "usingComponents":{
4 | "notice": "../../es/notice/index"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/demo/pages/page-result/busy/index.acss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Alibaba-mp/mini-ali-ui/19d221e991d53fc89bdede86a36cfd5da9ef9791/demo/pages/page-result/busy/index.acss
--------------------------------------------------------------------------------
/demo/pages/page-result/busy/index.axml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
--------------------------------------------------------------------------------
/demo/pages/page-result/busy/index.js:
--------------------------------------------------------------------------------
1 | Page({
2 | data: {
3 | footer: [{
4 | text: '刷新',
5 | }],
6 | },
7 | });
8 |
--------------------------------------------------------------------------------
/demo/pages/page-result/busy/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultTitle": "Page Result",
3 | "usingComponents":{
4 | "page-result": "../../../es/page-result/index"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/demo/pages/page-result/empty/index.acss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Alibaba-mp/mini-ali-ui/19d221e991d53fc89bdede86a36cfd5da9ef9791/demo/pages/page-result/empty/index.acss
--------------------------------------------------------------------------------
/demo/pages/page-result/empty/index.axml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
--------------------------------------------------------------------------------
/demo/pages/page-result/empty/index.js:
--------------------------------------------------------------------------------
1 | Page({});
2 |
--------------------------------------------------------------------------------
/demo/pages/page-result/empty/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultTitle": "Page Result",
3 | "usingComponents":{
4 | "page-result": "../../../es/page-result/index"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/demo/pages/page-result/error/index.acss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Alibaba-mp/mini-ali-ui/19d221e991d53fc89bdede86a36cfd5da9ef9791/demo/pages/page-result/error/index.acss
--------------------------------------------------------------------------------
/demo/pages/page-result/error/index.axml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
--------------------------------------------------------------------------------
/demo/pages/page-result/error/index.js:
--------------------------------------------------------------------------------
1 | Page({
2 | data: {
3 | footer: [{ text: '刷新' }],
4 | },
5 | });
6 |
--------------------------------------------------------------------------------
/demo/pages/page-result/error/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultTitle": "Page Result",
3 | "usingComponents":{
4 | "page-result": "../../../es/page-result/index"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/demo/pages/page-result/index.acss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Alibaba-mp/mini-ali-ui/19d221e991d53fc89bdede86a36cfd5da9ef9791/demo/pages/page-result/index.acss
--------------------------------------------------------------------------------
/demo/pages/page-result/index.axml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | {{item.nameZN}}
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/demo/pages/page-result/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultTitle": "Page Result",
3 | "usingComponents":{
4 | "list": "../../es/list/index",
5 | "list-item": "../../es/list/list-item/index"
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/demo/pages/page-result/local-busy/index.acss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Alibaba-mp/mini-ali-ui/19d221e991d53fc89bdede86a36cfd5da9ef9791/demo/pages/page-result/local-busy/index.acss
--------------------------------------------------------------------------------
/demo/pages/page-result/local-busy/index.axml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/demo/pages/page-result/local-busy/index.js:
--------------------------------------------------------------------------------
1 | Page({});
2 |
--------------------------------------------------------------------------------
/demo/pages/page-result/local-busy/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultTitle": "Page Result",
3 | "usingComponents":{
4 | "page-result": "../../../es/page-result/index"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/demo/pages/page-result/local-empty/index.acss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Alibaba-mp/mini-ali-ui/19d221e991d53fc89bdede86a36cfd5da9ef9791/demo/pages/page-result/local-empty/index.acss
--------------------------------------------------------------------------------
/demo/pages/page-result/local-empty/index.axml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/demo/pages/page-result/local-empty/index.js:
--------------------------------------------------------------------------------
1 | Page({});
2 |
--------------------------------------------------------------------------------
/demo/pages/page-result/local-empty/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultTitle": "Page Result",
3 | "usingComponents":{
4 | "page-result": "../../../es/page-result/index"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/demo/pages/page-result/local-error/index.acss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Alibaba-mp/mini-ali-ui/19d221e991d53fc89bdede86a36cfd5da9ef9791/demo/pages/page-result/local-error/index.acss
--------------------------------------------------------------------------------
/demo/pages/page-result/local-error/index.axml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/demo/pages/page-result/local-error/index.js:
--------------------------------------------------------------------------------
1 | Page({});
2 |
--------------------------------------------------------------------------------
/demo/pages/page-result/local-error/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultTitle": "Page Result",
3 | "usingComponents":{
4 | "page-result": "../../../es/page-result/index"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/demo/pages/page-result/local-logoff/index.acss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Alibaba-mp/mini-ali-ui/19d221e991d53fc89bdede86a36cfd5da9ef9791/demo/pages/page-result/local-logoff/index.acss
--------------------------------------------------------------------------------
/demo/pages/page-result/local-logoff/index.axml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/demo/pages/page-result/local-logoff/index.js:
--------------------------------------------------------------------------------
1 | Page({});
2 |
--------------------------------------------------------------------------------
/demo/pages/page-result/local-logoff/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultTitle": "Page Result",
3 | "usingComponents":{
4 | "page-result": "../../../es/page-result/index"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/demo/pages/page-result/local-network/index.acss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Alibaba-mp/mini-ali-ui/19d221e991d53fc89bdede86a36cfd5da9ef9791/demo/pages/page-result/local-network/index.acss
--------------------------------------------------------------------------------
/demo/pages/page-result/local-network/index.axml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/demo/pages/page-result/local-network/index.js:
--------------------------------------------------------------------------------
1 | Page({});
2 |
--------------------------------------------------------------------------------
/demo/pages/page-result/local-network/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultTitle": "Page Result",
3 | "usingComponents":{
4 | "page-result": "../../../es/page-result/index"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/demo/pages/page-result/local-payment/index.acss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Alibaba-mp/mini-ali-ui/19d221e991d53fc89bdede86a36cfd5da9ef9791/demo/pages/page-result/local-payment/index.acss
--------------------------------------------------------------------------------
/demo/pages/page-result/local-payment/index.axml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/demo/pages/page-result/local-payment/index.js:
--------------------------------------------------------------------------------
1 | Page({
2 | data: {
3 | footer: [{
4 | text: '返回',
5 | }],
6 | },
7 | });
8 |
--------------------------------------------------------------------------------
/demo/pages/page-result/local-payment/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultTitle": "Page Result",
3 | "usingComponents":{
4 | "page-result": "../../../es/page-result/index"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/demo/pages/page-result/local-redpacket/index.acss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Alibaba-mp/mini-ali-ui/19d221e991d53fc89bdede86a36cfd5da9ef9791/demo/pages/page-result/local-redpacket/index.acss
--------------------------------------------------------------------------------
/demo/pages/page-result/local-redpacket/index.axml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/demo/pages/page-result/local-redpacket/index.js:
--------------------------------------------------------------------------------
1 | Page({
2 | });
3 |
--------------------------------------------------------------------------------
/demo/pages/page-result/local-redpacket/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultTitle": "Page Result",
3 | "usingComponents":{
4 | "page-result": "../../../es/page-result/index"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/demo/pages/page-result/log-off/index.acss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Alibaba-mp/mini-ali-ui/19d221e991d53fc89bdede86a36cfd5da9ef9791/demo/pages/page-result/log-off/index.acss
--------------------------------------------------------------------------------
/demo/pages/page-result/log-off/index.axml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
--------------------------------------------------------------------------------
/demo/pages/page-result/log-off/index.js:
--------------------------------------------------------------------------------
1 | Page({});
2 |
--------------------------------------------------------------------------------
/demo/pages/page-result/log-off/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultTitle": "Page Result",
3 | "usingComponents":{
4 | "page-result": "../../../es/page-result/index"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/demo/pages/page-result/network/index.acss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Alibaba-mp/mini-ali-ui/19d221e991d53fc89bdede86a36cfd5da9ef9791/demo/pages/page-result/network/index.acss
--------------------------------------------------------------------------------
/demo/pages/page-result/network/index.axml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/demo/pages/page-result/network/index.js:
--------------------------------------------------------------------------------
1 | Page({
2 | data: {
3 | footer: [{
4 | text: '修复',
5 | }, {
6 | text: '刷新',
7 | }],
8 | },
9 |
10 | onTapLeft(e) {
11 | console.log(e, 'onTapLeft');
12 | },
13 | onTapRight(e) {
14 | console.log(e, 'onTapRight');
15 | },
16 | });
17 |
--------------------------------------------------------------------------------
/demo/pages/page-result/network/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultTitle": "Page Result",
3 | "usingComponents":{
4 | "page-result": "../../../es/page-result/index"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/demo/pages/page-result/payment/index.acss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Alibaba-mp/mini-ali-ui/19d221e991d53fc89bdede86a36cfd5da9ef9791/demo/pages/page-result/payment/index.acss
--------------------------------------------------------------------------------
/demo/pages/page-result/payment/index.axml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/demo/pages/page-result/payment/index.js:
--------------------------------------------------------------------------------
1 | Page({
2 | data: {
3 | footer: [{
4 | text: '返回',
5 | }],
6 | },
7 | onTapLeft() {
8 | my.reLaunch({
9 | url: '/pages/page-result/index',
10 | });
11 | },
12 | });
13 |
--------------------------------------------------------------------------------
/demo/pages/page-result/payment/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultTitle": "Page Result",
3 | "usingComponents":{
4 | "page-result": "../../../es/page-result/index"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/demo/pages/page-result/redpacket/index.acss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Alibaba-mp/mini-ali-ui/19d221e991d53fc89bdede86a36cfd5da9ef9791/demo/pages/page-result/redpacket/index.acss
--------------------------------------------------------------------------------
/demo/pages/page-result/redpacket/index.axml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/demo/pages/page-result/redpacket/index.js:
--------------------------------------------------------------------------------
1 | Page({
2 | data: {
3 | footer: [{
4 | text: '操作1',
5 | }, {
6 | text: '操作2',
7 | }],
8 | },
9 | });
10 |
--------------------------------------------------------------------------------
/demo/pages/page-result/redpacket/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultTitle": "Page Result",
3 | "usingComponents":{
4 | "page-result": "../../../es/page-result/index"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/demo/pages/pagination/index.acss:
--------------------------------------------------------------------------------
1 | .demo-title {
2 | color: #333;
3 | padding: 15px;
4 | font-size: 14px;
5 | }
6 | .pageCircle {
7 | margin-bottom: 20px;
8 | }
--------------------------------------------------------------------------------
/demo/pages/pagination/index.js:
--------------------------------------------------------------------------------
1 | Page({});
2 |
--------------------------------------------------------------------------------
/demo/pages/pagination/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultTitle": "Pagination",
3 | "usingComponents": {
4 | "pagination": "../../es/pagination/index"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/demo/pages/picker-item/index.acss:
--------------------------------------------------------------------------------
1 | /* required by usingComponents */
--------------------------------------------------------------------------------
/demo/pages/picker-item/index.axml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
9 | 发卡银行
10 |
11 |
18 | 发卡银行
19 |
20 |
21 |
--------------------------------------------------------------------------------
/demo/pages/picker-item/index.js:
--------------------------------------------------------------------------------
1 | const banks = ['网商银行', '建设银行', '工商银行', '浦发银行'];
2 |
3 | Page({
4 | data: {
5 | bank: '',
6 | },
7 | onPickerTap() {
8 | my.showActionSheet({
9 | title: '选择发卡银行',
10 | items: banks,
11 | success: (res) => {
12 | this.setData({
13 | bank: banks[res.index],
14 | });
15 | },
16 | });
17 | },
18 | });
19 |
--------------------------------------------------------------------------------
/demo/pages/picker-item/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultTitle": "Picker-item",
3 | "usingComponents": {
4 | "list": "../../es/list/index",
5 | "input-item": "../../es/input-item/index",
6 | "picker-item": "../../es/picker-item/index"
7 | }
8 | }
--------------------------------------------------------------------------------
/demo/pages/popover/index.acss:
--------------------------------------------------------------------------------
1 | .demo-popover {
2 | display: flex;
3 | align-items: center;
4 | justify-content: center;
5 | width: 100%;
6 | height: 400px;
7 | }
8 | .demo-popover-btn {
9 | width: 100px;
10 | height: 100px;
11 | line-height: 100px;
12 | text-align: center;
13 | background-color: #fff;
14 | border: 1px solid #dddddd;
15 | border-radius: 2px;
16 | }
17 | .demo-popover-test-btns {
18 | display: flex;
19 | justify-content: space-around;
20 | }
21 | .demo-popover-test-btn {
22 | width: 45%;
23 | }
--------------------------------------------------------------------------------
/demo/pages/popover/index.axml:
--------------------------------------------------------------------------------
1 |
2 |
8 | 点击{{show ? '隐藏' : '显示'}}
9 |
10 |
11 | {{position}}
12 |
13 |
14 | line2
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/demo/pages/popover/index.js:
--------------------------------------------------------------------------------
1 | const position = ['top', 'topRight', 'rightTop', 'right', 'rightBottom', 'bottomRight', 'bottom', 'bottomLeft', 'leftBottom', 'left', 'leftTop', 'topLeft'];
2 | Page({
3 | data: {
4 | position: position[0],
5 | show: false,
6 | showMask: true,
7 | showIcon: true,
8 | },
9 | onShowPopoverTap() {
10 | this.setData({
11 | show: !this.data.show,
12 | });
13 | },
14 | onNextPositionTap() {
15 | let index = position.indexOf(this.data.position);
16 | index = index >= position.length - 1 ? 0 : index + 1;
17 | this.setData({
18 | show: true,
19 | position: position[index],
20 | });
21 | },
22 | onMaskChangeTap() {
23 | this.setData({
24 | showMask: !this.data.showMask,
25 | });
26 | },
27 | onIconChangeTap() {
28 | this.setData({
29 | showIcon: !this.data.showIcon,
30 | });
31 | },
32 | onMaskClick() {
33 | this.setData({
34 | show: false,
35 | });
36 | },
37 | itemTap1(e) {
38 | my.alert({
39 | content: `点击_${e.currentTarget.dataset.direction}`,
40 | });
41 | },
42 | itemTap2(e) {
43 | my.alert({
44 | content: `点击_${e.currentTarget.dataset.index}`,
45 | });
46 | },
47 | });
48 |
--------------------------------------------------------------------------------
/demo/pages/popover/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultTitle": "Popover",
3 | "usingComponents": {
4 | "popover": "../../es/popover/index",
5 | "popover-item": "../../es/popover/popover-item/index"
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/demo/pages/popup/index.acss:
--------------------------------------------------------------------------------
1 | .btn-container {
2 | width: 100%;
3 | height: 100vh;
4 | display: flex;
5 | flex-direction: column;
6 | justify-content: center;
7 | align-items: center;
8 | }
9 |
10 | .btn-container button {
11 | width: 250px;
12 | }
13 |
14 | .box.top, .box.bottom {
15 | height: 200px;
16 | }
17 |
18 | .box.left, .box.right {
19 | width: 200px;
20 | height: 100%;
21 | }
22 |
23 | .box {
24 | background-color: #fff;
25 | display: flex;
26 | justify-content: center;
27 | align-items: center;
28 | }
--------------------------------------------------------------------------------
/demo/pages/popup/index.axml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | hello world
10 |
11 |
12 |
13 | hello world
14 |
15 |
16 |
17 |
18 |
19 |
20 | hello world
21 |
22 |
23 | hello world
24 |
25 |
--------------------------------------------------------------------------------
/demo/pages/popup/index.js:
--------------------------------------------------------------------------------
1 | Page({
2 | data: {
3 | showLeft: false,
4 | showRight: false,
5 | showTop: false,
6 | showBottom: false,
7 | },
8 | onTopBtnTap() {
9 | this.setData({
10 | showTop: true,
11 | });
12 | },
13 | onRightBtnTap() {
14 | this.setData({
15 | showRight: true,
16 | });
17 | },
18 | onLeftBtnTap() {
19 | this.setData({
20 | showLeft: true,
21 | });
22 | },
23 | onButtomBtnTap() {
24 | this.setData({
25 | showBottom: true,
26 | });
27 | },
28 | onPopupClose() {
29 | this.setData({
30 | showLeft: false,
31 | showRight: false,
32 | showTop: false,
33 | showBottom: false,
34 | });
35 | },
36 | });
37 |
--------------------------------------------------------------------------------
/demo/pages/popup/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultTitle": "Popup",
3 | "usingComponents": {
4 | "popup": "../../es/popup/index"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/demo/pages/search-bar/index.acss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Alibaba-mp/mini-ali-ui/19d221e991d53fc89bdede86a36cfd5da9ef9791/demo/pages/search-bar/index.acss
--------------------------------------------------------------------------------
/demo/pages/search-bar/index.axml:
--------------------------------------------------------------------------------
1 |
2 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/demo/pages/search-bar/index.js:
--------------------------------------------------------------------------------
1 | Page({
2 | data: {
3 | value: '',
4 | showVoice: false,
5 | },
6 | handleInput(value) {
7 | this.setData({
8 | value,
9 | });
10 | },
11 | handleClear() {
12 | this.setData({
13 | value: '',
14 | });
15 | },
16 | handleCancel() {
17 | this.setData({
18 | value: '',
19 | });
20 | },
21 | handleSubmit(value) {
22 | my.alert({
23 | content: value,
24 | });
25 | },
26 | onChange(e) {
27 | this.setData({
28 | showVoice: e.detail.value,
29 | });
30 | },
31 | });
32 |
--------------------------------------------------------------------------------
/demo/pages/search-bar/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultTitle": "Search-bar",
3 | "usingComponents":{
4 | "search-bar":"../../es/search-bar/index"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/demo/pages/stepper/index.acss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Alibaba-mp/mini-ali-ui/19d221e991d53fc89bdede86a36cfd5da9ef9791/demo/pages/stepper/index.acss
--------------------------------------------------------------------------------
/demo/pages/stepper/index.js:
--------------------------------------------------------------------------------
1 | Page({
2 | data: {
3 | value: 8,
4 | },
5 | callBackFn(value, mode) {
6 | console.log(value, mode);
7 | },
8 | modifyValue() {
9 | this.setData({
10 | value: 9,
11 | });
12 | },
13 | });
14 |
--------------------------------------------------------------------------------
/demo/pages/stepper/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultTitle": "Stepper",
3 | "usingComponents":{
4 | "stepper":"../../es/stepper/index",
5 | "list":"../../es/list/index",
6 | "list-item":"../../es/list/list-item/index"
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/demo/pages/steps/index.acss:
--------------------------------------------------------------------------------
1 | .demo-steps-class {
2 | margin: 20px 0;
3 | border-bottom: 1px solid #e5e5e5;
4 | }
5 | .demo-btn-container {
6 | display: flex;
7 | justify-content: space-between;
8 | margin: 20px;
9 | }
10 | .demo-btn {
11 | width: 47%;
12 | }
13 |
--------------------------------------------------------------------------------
/demo/pages/steps/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultTitle": "Steps",
3 | "usingComponents": {
4 | "steps": "../../es/steps/index",
5 | "button": "../../es/button/index"
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/demo/pages/swipe-action/index.acss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Alibaba-mp/mini-ali-ui/19d221e991d53fc89bdede86a36cfd5da9ef9791/demo/pages/swipe-action/index.acss
--------------------------------------------------------------------------------
/demo/pages/swipe-action/index.axml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
13 |
23 | {{item.content}}
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/demo/pages/swipe-action/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultTitle": "Swipe-Action",
3 | "usingComponents":{
4 | "list": "../../es/list/index",
5 | "list-item": "../../es/list/list-item/index",
6 | "swipe-action": "../../es/swipe-action/index"
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/demo/pages/tabs/elevator/elevator.acss:
--------------------------------------------------------------------------------
1 | .tab-content {
2 | display: flex;
3 | justify-content: center;
4 | align-items: center;
5 | padding: 40rpx;
6 | box-sizing: border-box;
7 | background-color: #fff;
8 | border-bottom: 1px solid #eee;
9 | height: 550px;
10 | }
--------------------------------------------------------------------------------
/demo/pages/tabs/elevator/elevator.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultTitle": "tabs elevator 模式",
3 | "usingComponents":{
4 | "tabs":"../../../es/tabs/index",
5 | "tab-content": "../../../es/tabs/tab-content/index"
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/demo/pages/tabs/index.acss:
--------------------------------------------------------------------------------
1 | .tab-content {
2 | display: flex;
3 | justify-content: center;
4 | align-items: center;
5 | padding: 40rpx;
6 | box-sizing: border-box;
7 | /* 如果 swipeable="{{true}}",需要增加 height */
8 | /* height: 350px; */
9 | /* 为了体现 stickyBar 的作用而增加的 tab-content 的高度 */
10 | height: 50vh;
11 | }
12 |
13 | .radio-group {
14 | padding: 30rpx 40rpx 0;
15 | }
16 |
17 | .radio {
18 | margin-right: 10px;
19 | }
20 |
21 | .demo-title {
22 | margin: 30rpx 40rpx 0;
23 | padding-bottom: 10px;
24 | font-weight: bold;
25 | border-bottom: 1px solid #ccc;
26 | }
--------------------------------------------------------------------------------
/demo/pages/tabs/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultTitle": "Tabs",
3 | "usingComponents":{
4 | "tabs":"../../es/tabs/index",
5 | "tab-content": "../../es/tabs/tab-content/index",
6 | "filter": "../../es/filter/index",
7 | "filter-item": "../../es/filter/filter-item/index"
8 |
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/demo/pages/tag/index.acss:
--------------------------------------------------------------------------------
1 | .am-title {
2 | padding-top: 24rpx;
3 | }
4 | .container {
5 | padding: 24rpx;
6 | }
7 | .changeColor {
8 | font-size: 30px;
9 | color: #f32600;
10 | }
11 | .row {
12 | display: flex;
13 | align-items: center;
14 | padding: 0 30rpx;
15 | background-color: white;
16 | }
17 |
18 | .row-title {
19 | flex: 1;
20 | padding-top: 28rpx;
21 | padding-bottom: 28rpx;
22 | font-size: 34rpx;
23 | color: #000;
24 | }
25 |
26 | .row-extra {
27 | flex-basis: initial;
28 | font-size: 32rpx;
29 | color: #888;
30 | margin-right: 12px;
31 | }
--------------------------------------------------------------------------------
/demo/pages/tag/index.axml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 标签
4 | 标签
5 | 标签
6 | 标签
7 |
8 |
9 | 标签
10 | 标签
11 | 标签
12 | 标签
13 |
14 |
15 |
16 | 图标
17 |
18 |
19 |
20 | 线框样式
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/demo/pages/tag/index.js:
--------------------------------------------------------------------------------
1 | Page({
2 | data: {},
3 | onLoad() {},
4 | setInfo(e) {
5 | const { dataset } = e.target;
6 | const { name } = dataset;
7 | this.setData({
8 | [name]: e.detail.value,
9 | });
10 | },
11 | });
12 |
--------------------------------------------------------------------------------
/demo/pages/tag/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultTitle": "Tag",
3 | "usingComponents": {
4 | "tag": "../../es/tag/index",
5 | "list-item": "../../es/list/list-item/index",
6 | "am-switch": "../../es/am-switch/index"
7 | }
8 | }
--------------------------------------------------------------------------------
/demo/pages/terms/index.acss:
--------------------------------------------------------------------------------
1 | .title{
2 | text-align: center;
3 | display: block;
4 | width: 100%;
5 | margin: 20px 0;
6 | }
7 | page {
8 | padding: 24px 12px;
9 | }
--------------------------------------------------------------------------------
/demo/pages/terms/index.js:
--------------------------------------------------------------------------------
1 | const cfg = {
2 | c1: {
3 | related: false,
4 | agreeBtn: {
5 | title: '同意协议并开通',
6 | data: 'custom data 1',
7 | },
8 | cancelBtn: {
9 | title: '暂不开通,仅手动缴费',
10 | data: 'custom data 2',
11 | },
12 | hasDesc: false,
13 | },
14 | c2: {
15 | related: false,
16 | agreeBtn: {
17 | title: '同意协议并开通',
18 | },
19 | hasDesc: true,
20 | },
21 | c3: {
22 | related: true,
23 | agreeBtn: {
24 | checked: true,
25 | title: '提交',
26 | },
27 | },
28 | c4: {
29 | related: true,
30 | agreeBtn: {
31 | title: '提交',
32 | },
33 | },
34 | c5: {
35 | related: false,
36 | agreeBtn: {
37 | title: '同意协议并提交',
38 | },
39 | },
40 | c6: {
41 | related: true,
42 | fixed: true,
43 | agreeBtn: {
44 | checked: true,
45 | title: '提交',
46 | data: 'custom data 1',
47 | },
48 | },
49 | };
50 |
51 |
52 | Page({
53 | data: cfg,
54 | onLoad() {
55 | },
56 | onSelect(e) {
57 | const selectedData = e.currentTarget.dataset.name || '';
58 | selectedData && my.alert({
59 | title: 'Terms Btns',
60 | content: selectedData,
61 | });
62 | },
63 |
64 | });
65 |
--------------------------------------------------------------------------------
/demo/pages/terms/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultTitle": "Terms",
3 | "usingComponents": {
4 | "terms": "../../es/terms/index"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/demo/pages/tips/1/index.acss:
--------------------------------------------------------------------------------
1 | .rectangle {
2 | //position: fixed;
3 | //top: 100px;
4 | padding: 0 14px;
5 | margin-top: 20px;
6 | }
7 |
8 | .dialog {
9 | position: fixed;
10 | bottom: 18px;
11 | }
12 |
13 | .content {
14 | color: #fff;
15 | }
16 |
17 | .opt-button {
18 | width: 51px;
19 | height: 27px;
20 | display: flex;
21 | justify-content: center;
22 | align-items: center;
23 | color: #fff;
24 | font-size: 12px;
25 | border: #68BAF7 solid 1rpx;
26 | }
27 |
28 | .add-home {
29 | width: 72px;
30 | height: 27px;
31 | display: flex;
32 | justify-content: center;
33 | align-items: center;
34 | background-color: #56ADEB;
35 | color: #fff;
36 | font-size: 14px;
37 | }
38 |
39 | .am-tips-dialog .am-button {
40 | border: none;
41 | }
42 |
43 | .row {
44 | display: flex;
45 | align-items: center;
46 | padding: 0 30rpx;
47 | background-color: white;
48 | }
49 |
50 | .row-title {
51 | flex: 1;
52 | padding-top: 28rpx;
53 | padding-bottom: 28rpx;
54 | font-size: 34rpx;
55 | color: #000;
56 | }
57 |
58 | .row-extra {
59 | flex-basis: initial;
60 | font-size: 32rpx;
61 | color: #888;
62 | margin-right: 12px;
63 | }
--------------------------------------------------------------------------------
/demo/pages/tips/1/index.js:
--------------------------------------------------------------------------------
1 | Page({
2 | data: {
3 | showRectangle: true,
4 | showDialog: true,
5 | arrowPositions: [
6 | 'bottom-left',
7 | 'bottom-center',
8 | 'bottom-right',
9 | 'top-left',
10 | 'top-center',
11 | 'top-right',
12 | 'left',
13 | 'right',
14 | ],
15 | arrowPosIndex: 3,
16 | useButton: true,
17 | },
18 | onCloseTap() {
19 | this.setData({
20 | showRectangle: false,
21 | });
22 | },
23 | onRectangleTap() {
24 | my.alert({
25 | content: 'do something',
26 | });
27 | },
28 | onDialogTap() {
29 | this.setData({
30 | showDialog: false,
31 | });
32 | },
33 | setInfo(e) {
34 | const { dataset } = e.target;
35 | const { name } = dataset;
36 | this.setData({
37 | [name]: e.detail.value,
38 | });
39 | },
40 | });
41 |
--------------------------------------------------------------------------------
/demo/pages/tips/1/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultTitle": "Tips",
3 | "usingComponents": {
4 | "tips-dialog": "../../../es/tips/tips-dialog/index",
5 | "am-button": "../../../es/button/index",
6 | "am-icon": "../../../es/am-icon/index",
7 | "list-item": "../../../es/list/list-item/index",
8 | "input-item": "../../../es/input-item/index"
9 | }
10 | }
--------------------------------------------------------------------------------
/demo/pages/tips/2/index.acss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Alibaba-mp/mini-ali-ui/19d221e991d53fc89bdede86a36cfd5da9ef9791/demo/pages/tips/2/index.acss
--------------------------------------------------------------------------------
/demo/pages/tips/2/index.axml:
--------------------------------------------------------------------------------
1 | {{content}}
--------------------------------------------------------------------------------
/demo/pages/tips/2/index.js:
--------------------------------------------------------------------------------
1 | Page({
2 | data: {
3 | content: '我知道了(2秒后消失)',
4 | time: 2000,
5 | },
6 | onClose() {
7 | my.alert({
8 | title: '主动关闭 tips',
9 | });
10 | },
11 | onTimeOut() {
12 | my.alert({
13 | title: '时间到了,关闭 tips',
14 | });
15 | },
16 | });
17 |
--------------------------------------------------------------------------------
/demo/pages/tips/2/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultTitle": "Tips",
3 | "usingComponents": {
4 | "tips-plain": "../../../es/tips/tips-plain/index"
5 | }
6 | }
--------------------------------------------------------------------------------
/demo/pages/tips/index.acss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Alibaba-mp/mini-ali-ui/19d221e991d53fc89bdede86a36cfd5da9ef9791/demo/pages/tips/index.acss
--------------------------------------------------------------------------------
/demo/pages/tips/index.axml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 提示1
5 |
6 |
7 | 提示2
8 |
9 |
10 |
--------------------------------------------------------------------------------
/demo/pages/tips/index.js:
--------------------------------------------------------------------------------
1 | Page({
2 | openPage(e) {
3 | my.navigateTo({
4 | url: e.target.dataset.url,
5 | });
6 | },
7 | });
8 |
--------------------------------------------------------------------------------
/demo/pages/tips/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultTitle": "Tips",
3 | "usingComponents": {
4 | "list": "../../es/list/index",
5 | "list-item": "../../es/list/list-item/index"
6 | }
7 | }
--------------------------------------------------------------------------------
/demo/pages/title/index.acss:
--------------------------------------------------------------------------------
1 | .container {
2 | background-color: #fff;
3 | }
4 | .am-title {
5 | padding-top: 24rpx;
6 | }
7 | /* .container {
8 | padding: 24rpx;
9 | } */
10 | .changeColor {
11 | font-size: 30px;
12 | color: #f32600;
13 | }
--------------------------------------------------------------------------------
/demo/pages/title/index.axml:
--------------------------------------------------------------------------------
1 |
2 | 外部标题
3 |
4 | 内部标题无 icon
5 |
6 | 无下划线
9 |
10 | 内部标题无操作
14 |
15 | 内部标题可跳转
21 |
22 |
28 | 内部标题可跳转
29 | 自定义跳转>
30 |
31 |
32 | 内部标题无 icon 展开气泡菜单
37 |
38 | 内部标题可关闭
44 |
45 | 标题过长后的处理,标题单行展示。标题过长后的处理,标题单行展示。
48 |
49 | 使用class修改样式
56 |
--------------------------------------------------------------------------------
/demo/pages/title/index.js:
--------------------------------------------------------------------------------
1 | Page({
2 | data: {},
3 | onLoad() {},
4 | titleGo() {
5 | my.showToast({
6 | content: '点击箭头,可设置跳转',
7 | });
8 | },
9 | titleMore() {
10 | my.showToast({
11 | content: '点击更多,展开气泡菜单',
12 | });
13 | },
14 | titleClose() {
15 | my.showToast({
16 | content: '点击关闭,可设置关闭',
17 | });
18 | },
19 | });
20 |
--------------------------------------------------------------------------------
/demo/pages/title/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultTitle": "Title",
3 | "usingComponents": {
4 | "title": "../../es/title/index"
5 | }
6 | }
--------------------------------------------------------------------------------
/demo/pages/verify-code/index.acss:
--------------------------------------------------------------------------------
1 | .extra {
2 | background-image: url('https://gw.alipayobjects.com/zos/rmsportal/dOfSJfWQvYdvsZiJStvg.svg');
3 | background-size: contain;
4 | background-repeat: no-repeat;
5 | background-position: right center;
6 | opacity: 0.2;
7 | height: 20px;
8 | width: 20px;
9 | padding-left: 10px;
10 | }
--------------------------------------------------------------------------------
/demo/pages/verify-code/index.axml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 验证码框
4 |
5 |
13 |
--------------------------------------------------------------------------------
/demo/pages/verify-code/index.js:
--------------------------------------------------------------------------------
1 | Page({
2 | data: {
3 | verifyCode: '',
4 | },
5 | onSend() {
6 | my.alert({
7 | title: 'verify code sent',
8 | });
9 | },
10 | onInput(e) {
11 | this.setData({
12 | verifyCode: e.detail.value,
13 | });
14 | },
15 | onClear() {
16 | this.setData({
17 | verifyCode: '',
18 | });
19 | },
20 | });
21 |
--------------------------------------------------------------------------------
/demo/pages/verify-code/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultTitle": "Verify-code",
3 | "usingComponents":{
4 | "list": "../../es/list/index",
5 | "verify-code": "../../es/verify-code/index"
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/demo/pages/vtabs/index.acss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Alibaba-mp/mini-ali-ui/19d221e991d53fc89bdede86a36cfd5da9ef9791/demo/pages/vtabs/index.acss
--------------------------------------------------------------------------------
/demo/pages/vtabs/index.axml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
11 |
13 | content of {{item.title}}
14 |
15 |
16 |
17 |
18 |
19 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 | content of {{item.title}}
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/demo/pages/vtabs/index.js:
--------------------------------------------------------------------------------
1 | Page({
2 | data: {
3 | activeTab: 2,
4 | swipeable: true,
5 | tabs: [
6 | { title: '选项二', anchor: 'a', number: '6' },
7 | { title: '选项', anchor: 'b', number: '66' },
8 | { title: '不超过五字', anchor: 'c', number: '99+' },
9 | { title: '选项四选项四选项四选项四', anchor: 'd' },
10 | { title: '选项五', anchor: 'e' },
11 | { title: '选项六', anchor: 'f' },
12 | ],
13 | tabItemHeight: 50,
14 | },
15 | handleChange(index) {
16 | this.setData({
17 | activeTab: index,
18 | });
19 | },
20 | onChange(index) {
21 | this.setData({
22 | activeTab: index,
23 | });
24 | },
25 | changeHeight() {
26 | this.setData({
27 | tabItemHeight: this.data.tabItemHeight + 5,
28 | });
29 | },
30 | changeSwipeable() {
31 | this.setData({
32 | swipeable: !this.data.swipeable,
33 | });
34 | },
35 | });
36 |
--------------------------------------------------------------------------------
/demo/pages/vtabs/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultTitle": "Vtabs",
3 | "usingComponents": {
4 | "vtabs": "../../es/vtabs/index",
5 | "vtab-content": "../../es/vtabs/vtab-content/index",
6 | "button":"../../es/button/index"
7 | },
8 | "allowsBounceVertical": false
9 | }
--------------------------------------------------------------------------------
/scripts/pub.js:
--------------------------------------------------------------------------------
1 | const { execSync, spawn } = require('child_process');
2 | const fs = require('fs');
3 |
4 | const packageJson = require(`${process.cwd()}/package.json`);
5 | const { version } = packageJson;
6 | const isRpx = process.argv.splice(2)[0] === '--rpx';
7 |
8 | if (isRpx) {
9 | packageJson.name = 'mini-ali-ui-rpx';
10 | packageJson.description = '小程序版AntUI rpx 版本';
11 |
12 | const runner = spawn('npm', ['publish']);
13 |
14 | runner.on('close', () => { });
15 | } else {
16 | packageJson.name = 'mini-ali-ui';
17 | packageJson.description = '小程序版AntUI';
18 |
19 | const runner = spawn('npm', ['publish']);
20 |
21 | runner.on('close', () => {
22 | execSync(`git tag ${version}`);
23 | execSync(`git push origin ${version}:${version}`);
24 | execSync('git push origin master:master');
25 | });
26 | }
27 |
28 | fs.writeFile(`${process.cwd()}/package.json`, JSON.stringify(packageJson), (err) => {
29 | if (err) console.error(err);
30 | });
31 |
--------------------------------------------------------------------------------
/src/_mixin/idnex.ts:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Alibaba-mp/mini-ali-ui/19d221e991d53fc89bdede86a36cfd5da9ef9791/src/_mixin/idnex.ts
--------------------------------------------------------------------------------
/src/_util/fmtClass.ts:
--------------------------------------------------------------------------------
1 | const hasOwn = {}.hasOwnProperty;
2 |
3 | /* eslint-disable no-continue, prefer-spread */
4 | export default function fmtClass(...args) {
5 | const classes = [];
6 |
7 | for (let i = 0; i < args.length; i++) {
8 | const arg = args[i];
9 |
10 | if (!arg) continue;
11 |
12 | const argType = typeof arg;
13 |
14 | if (argType === 'string' || argType === 'number') {
15 | classes.push(arg);
16 | } else if (Array.isArray(arg) && arg.length) {
17 | const inner = fmtClass.apply(null, arg);
18 | if (inner) {
19 | classes.push(inner);
20 | }
21 | } else if (argType === 'object') {
22 | for (const key in arg) {
23 | if (hasOwn.call(arg, key) && arg[key]) {
24 | classes.push(key);
25 | }
26 | }
27 | }
28 | }
29 |
30 | return classes.join(' ');
31 | }
32 |
--------------------------------------------------------------------------------
/src/_util/fmtEvent.ts:
--------------------------------------------------------------------------------
1 | export default function fmtEvent(props, e) {
2 | const dataset = {};
3 | for (const key in props) {
4 | if ((/data-/gi).test(key)) {
5 | dataset[key.replace(/data-/gi, '')] = props[key];
6 | }
7 | }
8 | return Object.assign({}, e, {
9 | currentTarget: { dataset },
10 | target: { dataset, targetDataset: dataset },
11 | });
12 | }
13 |
--------------------------------------------------------------------------------
/src/_util/fmtUnit.ts:
--------------------------------------------------------------------------------
1 | const jsUnitRpx = '';
2 |
3 | /* eslint-disable no-continue, prefer-spread */
4 | export default function fmtUnit(oldUnit) {
5 | let getUnit = oldUnit;
6 |
7 | if (jsUnitRpx === 'true') {
8 | if (typeof getUnit === 'string' && getUnit === 'px') {
9 | getUnit = 'rpx';
10 | } else if (typeof getUnit === 'number') {
11 | getUnit *= 2;
12 | } else if (typeof getUnit === 'string') {
13 | getUnit = oldUnit.match(/(\d+|\d+\.\d+)(px)/)[1] * 2 + 'rpx';
14 | }
15 | }
16 |
17 | return getUnit;
18 | }
19 |
--------------------------------------------------------------------------------
/src/_util/getI18n.ts:
--------------------------------------------------------------------------------
1 | import I18n_zhCN from '../_lang/zh-CN';
2 | import I18n_enUS from '../_lang/en-US';
3 |
4 | export default function getI18n() {
5 | try {
6 | /* global getApp */
7 | /* eslint no-undef: "error" */
8 | const appMiniAliUI = getApp() || null;
9 | if (appMiniAliUI) {
10 | if (appMiniAliUI.globalData?.miniAliUiLang === 'en-US') {
11 | return I18n_enUS;
12 | } else {
13 | return I18n_zhCN;
14 | }
15 | } else {
16 | return I18n_zhCN;
17 | }
18 | } catch (error) {
19 | return I18n_zhCN;
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/am-checkbox/index.axml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
--------------------------------------------------------------------------------
/src/am-checkbox/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true
3 | }
--------------------------------------------------------------------------------
/src/am-checkbox/index.ts:
--------------------------------------------------------------------------------
1 | import fmtEvent from '../_util/fmtEvent';
2 |
3 | /**
4 | * 对齐 ant design checkbox 的设计,增加 ctrlChecked 属性
5 | * 当 props 中有 checked 传入时,am-checkbox 是非受控组件
6 | * 当 props 中不传入 checked 而使用 ctrlChecked 时,am-checkbox 是受控组件
7 | */
8 | Component({
9 | props: {
10 | value: '',
11 | checked: false,
12 | ctrlChecked: undefined,
13 | disabled: false,
14 | onChange: () => {},
15 | id: '',
16 | },
17 | data: {
18 | // 组件内维护的 chackbox 勾选状态
19 | _checked: false,
20 | },
21 | onInit() {
22 | const { checked } = this.props;
23 | this.setData({
24 | _checked: checked,
25 | });
26 | },
27 | didMount() {
28 | const { checked } = this.props;
29 | this.setData({
30 | _checked: checked,
31 | });
32 | },
33 | // props 改变时
34 | deriveDataFromProps(nextProps) {
35 | const { _checked } = this.data;
36 | const { ctrlChecked: oldChecked } = this.props;
37 | const { ctrlChecked } = nextProps;
38 | // oldChecked===undefined 说明未传入 checked 属性,am-checkbox 将成为不受控组件
39 | // oldChecked 有传入值 _checked 受外部 checked 属性控制
40 | if (_checked !== ctrlChecked && oldChecked !== undefined) {
41 | this.setData({
42 | _checked: ctrlChecked,
43 | });
44 | }
45 | },
46 | methods: {
47 | onChange(e) {
48 | const { detail = {} } = e;
49 | const { value } = detail;
50 | this.setData({
51 | _checked: value,
52 | });
53 | const event = fmtEvent(this.props, e);
54 | this.props.onChange(event);
55 | },
56 | },
57 | });
58 |
--------------------------------------------------------------------------------
/src/am-icon/index.axml:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/src/am-icon/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true
3 | }
--------------------------------------------------------------------------------
/src/am-icon/index.ts:
--------------------------------------------------------------------------------
1 | import fmtUnit from '../_util/fmtUnit';
2 |
3 | Component({
4 | props: {
5 | type: '',
6 | size: fmtUnit(17),
7 | color: '',
8 | className: '',
9 | },
10 | data: {
11 | valueUnit: fmtUnit('px'),
12 | },
13 | });
14 |
--------------------------------------------------------------------------------
/src/am-radio/index.axml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
--------------------------------------------------------------------------------
/src/am-radio/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "am-icon": "../am-icon/index"
5 | }
6 | }
--------------------------------------------------------------------------------
/src/am-radio/index.less:
--------------------------------------------------------------------------------
1 | @import (reference) '../style/themes/default.less';
2 |
3 | .amFormat(@name, @val, @default) {
4 | @{name}: @default;
5 | @{name}: ~'var(--@{val}, @{default})';
6 | }
7 |
8 | .am-radio {
9 | position: relative;
10 | .amFormat(height, am-radio-size, @icon-size-xs);
11 | .amFormat(width, am-radio-size, @icon-size-xs);
12 | display: inline-block;
13 | line-height: @line-height-base;
14 | &-value {
15 | position: absolute;
16 | z-index: 1;
17 | opacity: 0;
18 | }
19 | }
20 |
21 | .am-radio .am-radio-synthetic {
22 | position: absolute;
23 | opacity: 0;
24 | z-index: 2;
25 | line-height: @line-height-base;
26 | pointer-events: none;
27 | top: 0;
28 | left: 0;
29 | height: 100%;
30 | width: 100%;
31 | .amFormat(font-size, am-radio-size, @icon-size-xs);
32 | text-align: center;
33 | .amFormat(color, am-radio-color, @color-text-primary);
34 | }
35 |
36 | .am-radio-value.a-radio-checked + .am-radio-synthetic {
37 | opacity: 1;
38 | }
39 |
40 | .am-radio-value.a-radio-checked.a-radio-disabled + .am-radio-synthetic {
41 | opacity: @opacity-disabled;
42 | }
43 |
--------------------------------------------------------------------------------
/src/am-radio/index.ts:
--------------------------------------------------------------------------------
1 | import fmtEvent from '../_util/fmtEvent';
2 |
3 | Component({
4 | props: {
5 | value: '',
6 | checked: false,
7 | disabled: false,
8 | onChange: () => {},
9 | id: '',
10 | },
11 | methods: {
12 | onChange(e) {
13 | const event = fmtEvent(this.props, e);
14 | this.props.onChange(event);
15 | },
16 | },
17 | });
18 |
--------------------------------------------------------------------------------
/src/am-switch/index.axml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/am-switch/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true
3 | }
--------------------------------------------------------------------------------
/src/am-switch/index.ts:
--------------------------------------------------------------------------------
1 | import fmtEvent from '../_util/fmtEvent';
2 |
3 | Component({
4 | props: {
5 | checked: false,
6 | disabled: false,
7 | onChange: () => {},
8 | id: '',
9 | name: '',
10 | controlled: false,
11 | },
12 | data: {
13 | checkedCls: '',
14 | },
15 | methods: {
16 | onChange(e) {
17 | const event = fmtEvent(this.props, e);
18 | this.props.onChange(event);
19 | },
20 | },
21 | });
22 |
--------------------------------------------------------------------------------
/src/amount-input/index.axml:
--------------------------------------------------------------------------------
1 |
2 | {{title}}
3 | {{_unit}}
4 |
5 | ¥
6 |
19 |
21 |
25 |
26 |
27 |
32 |
--------------------------------------------------------------------------------
/src/amount-input/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "am-icon": "../am-icon/index"
5 | }
6 | }
--------------------------------------------------------------------------------
/src/avatar/index.axml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {{name}}
6 |
7 |
8 | {{desc}}
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/src/avatar/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true
3 | }
4 |
--------------------------------------------------------------------------------
/src/avatar/index.md:
--------------------------------------------------------------------------------
1 | ## Avatar 头像
2 |
3 | 头像。
4 |
5 | ## 截图
6 |
7 |
8 | ## 扫码体验
9 |
10 | 
11 |
12 |
13 |
14 | ## 属性介绍
15 | | 属性 | 类型 | 默认值 | 可选值 | 描述 | 最低版本 | 必填 |
16 | | :--- | :--- | :--- | :--- | :--- | :--- | :--- |
17 | | className | String | - | - | 自定义class | - | - |
18 | | src | String | 默认蓝底头像 | - | 头像图片资源地址 | - | - |
19 | | size | String | md | lg, md, sm, xs | 头像尺寸大小 | [1.2.0](https://www.npmjs.com/package/mini-ali-ui?activeTab=versions) | - |
20 | | shape | String | circle | standard, circle, square | 头像形状 | [1.2.0](https://www.npmjs.com/package/mini-ali-ui?activeTab=versions) | - |
21 | | name | String | - | - | 设置用户名 | - | - |
22 | | desc | String | - | - | 设置摘要信息 | - | - |
23 | | name | String | - | - | 设置用户名 | - | - |
24 | | onError | EventHandle | (e: Object) => void | - | 图片资源加载失败回调 | - | - |
25 |
26 | ## 示例
27 |
28 | ```json
29 | {
30 | "defaultTitle": "Avatar",
31 | "usingComponents": {
32 | "avatar": "mini-ali-ui/es/avatar/index"
33 | }
34 | }
35 | ```
36 |
37 | ```xml
38 |
39 |
40 |
41 |
42 |
43 |
44 | ```
45 |
--------------------------------------------------------------------------------
/src/avatar/index.ts:
--------------------------------------------------------------------------------
1 | import getI18n from '../_util/getI18n';
2 |
3 | const i18n = getI18n().avatar;
4 |
5 | Component({
6 | props: {
7 | className: '',
8 | shape: 'circle',
9 | size: 'md',
10 | src: 'https://gw.alipayobjects.com/mdn/rms_ce4c6f/afts/img/A*2iXlQLntttsAAAAAAAAAAAAAARQnAQ',
11 | name: '',
12 | desc: '',
13 | lazyLoad: false,
14 | },
15 | didMount() {
16 | const { name, desc } = this.props;
17 | if (!name && desc) {
18 | console.error(i18n.error);
19 | }
20 | },
21 | methods: {
22 | // 图片加载失败
23 | _onError(e) {
24 | const { onError } = this.props;
25 | if (onError) {
26 | onError(e);
27 | }
28 | },
29 | },
30 | });
31 |
--------------------------------------------------------------------------------
/src/badge/index.axml:
--------------------------------------------------------------------------------
1 |
2 |
11 | {{typeof text === 'number' && text > overflowCount ? '···' : text }}
12 | {{typeof text === 'number' && text > overflowCount ? '···' : text }}
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/src/badge/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true
3 | }
--------------------------------------------------------------------------------
/src/badge/index.ts:
--------------------------------------------------------------------------------
1 | Component({
2 | props: {
3 | className: '',
4 | overflowCount: 99,
5 | text: '',
6 | dot: false,
7 | withArrow: false,
8 | direction: 'middle',
9 | stroke: false,
10 | },
11 | });
12 |
--------------------------------------------------------------------------------
/src/button/index.axml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/button/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "loading": "../loading/index"
5 | }
6 | }
--------------------------------------------------------------------------------
/src/calendar/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "am-icon": "../am-icon/index"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/src/card/index.axml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 |
9 |
10 |
11 |
14 |
15 | {{title}}
16 |
18 | {{subTitle}}
19 |
20 |
21 |
22 |
23 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/src/card/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "icon": "../am-icon/index"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/src/card/index.ts:
--------------------------------------------------------------------------------
1 | Component({
2 | props: {
3 | title: '',
4 | onCardClick: () => {},
5 | info: '',
6 | },
7 | methods: {
8 | onCardClick() {
9 | const { info, onCardClick } = this.props;
10 | onCardClick({ info });
11 | },
12 | onActionClick() {
13 | const { info, onActionClick } = this.props;
14 | if (onActionClick) {
15 | onActionClick({ info });
16 | }
17 | },
18 | onExtraActionClick() {
19 | const { info, onExtraActionClick } = this.props;
20 | if (onExtraActionClick) {
21 | onExtraActionClick({ info });
22 | }
23 | },
24 | },
25 | });
26 |
--------------------------------------------------------------------------------
/src/collapse/collapse-item/index.axml:
--------------------------------------------------------------------------------
1 |
5 |
12 |
13 |
14 |
15 | {{header}}
16 |
17 |
18 |
23 |
24 |
25 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/src/collapse/collapse-item/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "am-icon": "../../am-icon/index"
5 | }
6 | }
--------------------------------------------------------------------------------
/src/collapse/index.axml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/src/collapse/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true
3 | }
4 |
--------------------------------------------------------------------------------
/src/container/index.axml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
10 | {{title}}
11 |
12 | {{custom}}
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/src/container/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "title": "../title/index"
5 | }
6 | }
--------------------------------------------------------------------------------
/src/container/index.ts:
--------------------------------------------------------------------------------
1 | import fmtEvent from '../_util/fmtEvent';
2 |
3 | Component({
4 | mixins: [],
5 | data: {},
6 | props: {
7 | className: '',
8 | type: 'line',
9 | title: '',
10 | thumb: '',
11 | icon: '',
12 | custom: '',
13 | onActionTap: () => {},
14 | },
15 | didMount() {},
16 | didUpdate() {},
17 | didUnmount() {},
18 | methods: {
19 | onTitleClick(e) {
20 | const { onActionTap } = this.props;
21 | const event = fmtEvent(this.props, e);
22 | if (typeof onActionTap === 'function') {
23 | onActionTap(event);
24 | }
25 | },
26 | },
27 | });
28 |
--------------------------------------------------------------------------------
/src/coupon/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "icon": "../am-icon/index"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/src/coupon/index.ts:
--------------------------------------------------------------------------------
1 | import getI18n from '../_util/getI18n';
2 |
3 | const i18n = getI18n().coupon;
4 |
5 | Component({
6 | props: {
7 | title: '',
8 | used: false,
9 | onCouponClick: () => {},
10 | // 票券的扩展类型
11 | extra: true,
12 | moreBtn: i18n.ruleBtn,
13 | moreHide: true,
14 | },
15 | methods: {
16 | onCouponClick(e) {
17 | const { onCouponClick } = this.props;
18 | onCouponClick(e);
19 | },
20 | catchActionTap() { },
21 | changeMoreState() {
22 | const { moreHide } = this.props;
23 | this.props.moreHide = !moreHide;
24 | this.setData({
25 | moreHide: !moreHide,
26 | });
27 | },
28 | },
29 | });
30 |
--------------------------------------------------------------------------------
/src/filter/filter-item/index.axml:
--------------------------------------------------------------------------------
1 |
2 |
3 | {{value}}
4 | {{subtitle}}
5 |
6 |
7 |
--------------------------------------------------------------------------------
/src/filter/filter-item/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true
3 | }
--------------------------------------------------------------------------------
/src/filter/index.axml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/src/filter/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true
3 | }
4 |
--------------------------------------------------------------------------------
/src/filter/index.ts:
--------------------------------------------------------------------------------
1 | import lifecycle from './mixins/lifecycle';
2 | import getI18n from '../_util/getI18n';
3 |
4 | const i18n = getI18n().filter;
5 |
6 | Component({
7 | mixins: [lifecycle],
8 | data: {
9 | maxHeight: 0,
10 | _i18nReset: i18n.reset,
11 | _i18nConfirm: i18n.confirm,
12 | },
13 | props: {
14 | className: '',
15 | onChange: () => {},
16 | max: 10000,
17 | equalRows: 0,
18 | },
19 | didMount() {
20 | const { commonProps } = this.data;
21 | const { max } = this.props;
22 | commonProps.max = max;
23 | },
24 | methods: {
25 | resetFn() {
26 | const { items, results } = this.data;
27 | items.forEach((element) => {
28 | element.setData({
29 | confirmStyle: '',
30 | });
31 | });
32 | results.splice(0, results.length);
33 | },
34 | confirmFn() {
35 | const { onChange } = this.props;
36 | const { results } = this.data;
37 | onChange(results);
38 | },
39 | maskTap() {
40 | if (this.props.onMaskTap) {
41 | this.props.onMaskTap();
42 | }
43 | },
44 | },
45 | });
46 |
--------------------------------------------------------------------------------
/src/filter/mixins/lifecycle.ts:
--------------------------------------------------------------------------------
1 | export default {
2 | data: {
3 | results: [],
4 | items: [],
5 | commonProps: {
6 | max: 10000,
7 | },
8 | },
9 |
10 | didUnmount() {
11 | const { items, results } = this.data;
12 | results.splice(0, results.length);
13 | items.splice(0, items.length);
14 | },
15 | };
16 |
--------------------------------------------------------------------------------
/src/flex/flex-item/index.axml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/src/flex/flex-item/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true
3 | }
--------------------------------------------------------------------------------
/src/flex/flex-item/index.less:
--------------------------------------------------------------------------------
1 | @import (reference) "../../style/themes/default.less";
2 |
3 | .am-flexbox-item {
4 | box-sizing: border-box;
5 | flex: 1;
6 | min-width: @size-3;
7 | margin-left: @h-spacing-standard;
8 | margin-left: var(--am-flexbox-item-marginL, @h-spacing-standard);
9 |
10 | &:first-child {
11 | margin-left: 0;
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/flex/flex-item/index.ts:
--------------------------------------------------------------------------------
1 | Component({
2 |
3 | });
4 |
--------------------------------------------------------------------------------
/src/flex/index.axml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
--------------------------------------------------------------------------------
/src/flex/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true
3 | }
--------------------------------------------------------------------------------
/src/flex/index.ts:
--------------------------------------------------------------------------------
1 | Component({
2 | props: {
3 | className: '',
4 | direction: 'row',
5 | wrap: 'nowrap',
6 | justify: 'start',
7 | align: 'center',
8 | alignContent: 'stretch',
9 | },
10 | });
11 |
--------------------------------------------------------------------------------
/src/footer/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "am-icon": "../am-icon/index"
5 | }
6 | }
--------------------------------------------------------------------------------
/src/grid/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "pagination": "../pagination/index",
5 | "am-icon": "../am-icon/index"
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/src/grid/index.ts:
--------------------------------------------------------------------------------
1 | import fmtUnit from '../_util/fmtUnit';
2 |
3 | Component({
4 | data: {
5 | getColumnBorderIndex: 0,
6 | iconSize: fmtUnit(28),
7 | },
8 | props: {
9 | columnNum: 3,
10 | circular: false,
11 | list: [],
12 | onGridItemClick: () => {},
13 | hasLine: true,
14 | infinite: false,
15 | multiLine: false,
16 | infiniteHeight: fmtUnit('90px'),
17 | gridName: '',
18 | },
19 | didMount() {
20 | this.clearBorder();
21 | this.createGridName();
22 | },
23 | didUpdate() {
24 | this.clearBorder();
25 | this.createGridName();
26 | },
27 | methods: {
28 | onGridItemClick(e) {
29 | this.props.onGridItemClick({
30 | detail: {
31 | index: e.target.dataset.index,
32 | },
33 | });
34 | },
35 | clearBorder() {
36 | const { list, columnNum } = this.props;
37 | if (columnNum === 3) {
38 | const rows = list.length % columnNum;
39 | this.setData({
40 | getColumnBorderIndex: rows === 0 ? 3 : rows,
41 | });
42 | }
43 | },
44 | createGridName() {
45 | const { infinite, gridName } = this.props;
46 | if (infinite) {
47 | if (gridName === '' && !gridName) {
48 | this.props.gridName = `grid${Math.floor(Math.random() * 100000)}`;
49 | this.setData({
50 | gridName: this.props.gridName,
51 | });
52 | }
53 | }
54 | },
55 | },
56 | });
57 |
--------------------------------------------------------------------------------
/src/guide/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "pagination": "../pagination/index",
5 | "mask": "../mask/index",
6 | "button": "../button/index"
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/src/guide/index.less:
--------------------------------------------------------------------------------
1 | @import (reference) "../style/themes/default.less";
2 |
3 | .am-guide .am-button-ghost {
4 | --am-button-ghost-border-color: @color-text-base;
5 | --am-button-ghost-color: @color-text-base;
6 | }
7 | .am-guide {
8 | position: fixed;
9 | top: 0;
10 | left: 0;
11 | right: 0;
12 | bottom: 0;
13 | &-content {
14 | position: relative;
15 | z-index: 2;
16 | width: 100vw;
17 | height: 100vh;
18 | overflow: hidden;
19 | padding-bottom: 208 * @pixelSize;
20 | box-sizing: border-box;
21 | &-pager {
22 | padding-bottom: 260 * @pixelSize;
23 | }
24 | }
25 | &-img {
26 | position: absolute;
27 | z-index: 2;
28 | }
29 | &-btn {
30 | position: absolute;
31 | bottom: 120 * @pixelSize;
32 | left: 0;
33 | right: 0;
34 | display: flex;
35 | justify-content: center;
36 | z-index: 5;
37 | &-item {
38 | margin-right: @h-spacing-large;
39 | &:last-child {
40 | margin-right: 0;
41 | }
42 | }
43 | }
44 | &-pager {
45 | position: absolute;
46 | bottom: 196 * @pixelSize;
47 | left: 0;
48 | right: 0;
49 | z-index: 5;
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/src/input-item/index.axml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
6 |
7 |
8 |
26 |
27 |
29 |
33 |
34 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/src/input-item/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "am-icon": "../am-icon/index"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/src/list/alphabet/index.axml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
8 |
9 |
10 |
21 | {{ item }}
22 |
24 | {{item}}
25 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/src/list/alphabet/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true
3 | }
4 |
--------------------------------------------------------------------------------
/src/list/alphabet/index.md:
--------------------------------------------------------------------------------
1 | ## Alphabet 字母检索表
2 |
3 | 字母检索表
4 |
5 | ## 预览
6 |
7 |
8 | ## 扫码体验
9 |
10 | 
11 |
12 |
13 |
14 | ## 属性介绍
15 |
16 | | 属性名 | 类型 | 默认值 | 可选值 | 描述 | 最低版本 | 必填 |
17 | | ------------- | ------- | ------ | -------------------------- | -------------------------------------------------- | -------- | -------------- |
18 | | alphabet | Array | - | - | 字母表内容 | - | - |
19 |
20 |
21 | ## 代码示例
22 | ```json
23 | {
24 | "defaultTitle": "Alphabet",
25 | "usingComponents":{
26 | "alphabet": "mini-ali-ui/es/list/alphabet/index",
27 | "am-icon": "mini-ali-ui/es/am-icon/index"
28 | }
29 | }
30 | ```
31 |
32 | ```xml
33 |
34 |
35 |
36 |
37 |
38 | ```
39 |
40 | ```javascript
41 | Page({
42 | data: {
43 | alphabet: ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'],
44 | },
45 | onAlphabetClick(ev) {
46 | my.alert({
47 | content: JSON.stringify(ev.data),
48 | });
49 | },
50 | });
51 | ```
--------------------------------------------------------------------------------
/src/list/alphabet/index.ts:
--------------------------------------------------------------------------------
1 | Component({
2 | props: {
3 | alphabet: [],
4 | },
5 | data: {
6 | current: -1,
7 | },
8 | didMount() {
9 | this._updateDataSet();
10 | },
11 | didUpdate() {
12 | this._updateDataSet();
13 | },
14 | methods: {
15 | _updateDataSet() {
16 | this.dataset = {};
17 | for (const key in this.props) {
18 | if (/data-/gi.test(key)) {
19 | this.dataset[key.replace(/data-/gi, '')] = this.props[key];
20 | }
21 | }
22 | },
23 | onItemTap(ev) {
24 | const { onClick, disabled } = this.props;
25 |
26 | if (onClick && !disabled) {
27 | onClick({
28 | data: ev.target.dataset,
29 | target: { dataset: this.dataset },
30 | });
31 | }
32 | },
33 | onTouchStart(ev) {
34 | const { disabled } = this.props;
35 | if (!disabled) {
36 | this.setData({
37 | current: ev.target.dataset.index,
38 | });
39 | }
40 | },
41 | onTouchEnd() {
42 | this.setData({
43 | current: -1,
44 | });
45 | },
46 | },
47 | });
48 |
--------------------------------------------------------------------------------
/src/list/auto-size-img/index.axml:
--------------------------------------------------------------------------------
1 |
3 |
5 |
--------------------------------------------------------------------------------
/src/list/auto-size-img/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true
3 | }
4 |
--------------------------------------------------------------------------------
/src/list/auto-size-img/index.less:
--------------------------------------------------------------------------------
1 | @import (reference) '../../style/themes/default.less';
2 |
3 | .am-auto-sizer {
4 | &-container {
5 | position: relative;
6 | font-size: @font-size-list;
7 | font-size: var(--am-list-item-content-title-size, @font-size-list);
8 | margin-right: @h-spacing-large;
9 | margin-right: var(--am-list-item-padding, @h-spacing-large);
10 | color: transparent;
11 | overflow: visible;
12 | white-space: nowrap;
13 | // padding-bottom: 100%;
14 | }
15 | &-container::before {
16 | float: left;
17 | content: '';
18 | padding-bottom: 100%;
19 | }
20 | &-content {
21 | position: absolute;
22 | top: 0;
23 | left: 0;
24 | background: grey;
25 | width: 100%;
26 | height: 100%;
27 | background-size: cover;
28 | background-repeat: no-repeat;
29 | background-position: center;
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/list/auto-size-img/index.ts:
--------------------------------------------------------------------------------
1 | import fmtUnit from '../../_util/fmtUnit';
2 |
3 | Component({
4 | props: {
5 | size: fmtUnit('40px'),
6 | },
7 | });
8 |
--------------------------------------------------------------------------------
/src/list/index.axml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 | {{loadContent[0]?loadContent[0]:''}}
9 | {{loadContent[1]?loadContent[1]:''}}
10 |
13 |
14 |
--------------------------------------------------------------------------------
/src/list/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "loading": "../loading/index"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/src/list/index.ts:
--------------------------------------------------------------------------------
1 | import fmtUnit from '../_util/fmtUnit';
2 | import getI18n from '../_util/getI18n';
3 |
4 | const i18n = getI18n().list;
5 |
6 | Component({
7 | props: {
8 | className: '',
9 | loadMore: false,
10 | loadContent: [
11 | '',
12 | '',
13 | ],
14 | loadingSize: fmtUnit('16px'),
15 | loadingColor: '',
16 | loadingHeight: 'auto',
17 | },
18 | data: {
19 | loadContent: [
20 | i18n.loadMore,
21 | i18n.loadOver,
22 | ],
23 | },
24 | didMount() {
25 | const loadTxt = this.props.loadContent[0] ? this.props.loadContent[0] : this.data.loadContent[0];
26 | const overTxt = this.props.loadContent[1] ? this.props.loadContent[1] : this.data.loadContent[1];
27 | setTimeout(() => {
28 | this.setData({
29 | loadContent: [loadTxt, overTxt],
30 | });
31 | }, 0);
32 | },
33 | didUpdate() {
34 | const loadTxt = this.props.loadContent[0] ? this.props.loadContent[0] : this.data.loadContent[0];
35 | const overTxt = this.props.loadContent[1] ? this.props.loadContent[1] : this.data.loadContent[1];
36 | if (loadTxt !== this.data.loadContent[0] || overTxt !== this.data.loadContent[1]) {
37 | setTimeout(() => {
38 | this.setData({
39 | loadContent: [loadTxt, overTxt],
40 | });
41 | }, 0);
42 | }
43 | },
44 | });
45 |
--------------------------------------------------------------------------------
/src/list/list-item/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "auto-sizer": "../auto-size-img/index",
5 | "am-icon": "../../am-icon/index"
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/src/list/list-item/index.ts:
--------------------------------------------------------------------------------
1 | import fmtUnit from '../../_util/fmtUnit';
2 |
3 | Component({
4 | props: {
5 | className: '',
6 | align: false,
7 | disabled: false,
8 | multipleLine: false,
9 | wrap: false,
10 | enforceExtra: false,
11 | titlePosition: 'top',
12 | last: false,
13 | },
14 | data: {
15 | iconSize: fmtUnit(18),
16 | },
17 | didMount() {
18 | this._updateDataSet();
19 | },
20 | didUpdate() {
21 | this._updateDataSet();
22 | },
23 | methods: {
24 | _updateDataSet() {
25 | this.dataset = {};
26 | for (const key in this.props) {
27 | if (/data-/gi.test(key)) {
28 | this.dataset[key.replace(/data-/gi, '')] = this.props[key];
29 | }
30 | }
31 | },
32 | onItemTap(ev) {
33 | const { onClick, disabled } = this.props;
34 | if (onClick && !disabled) {
35 | onClick({
36 | index: ev.target.dataset.index,
37 | target: { dataset: this.dataset },
38 | });
39 | }
40 | },
41 | },
42 | });
43 |
--------------------------------------------------------------------------------
/src/list/list-secondary/index.axml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 | {{title}}
8 | {{subtitle}}
9 |
10 |
--------------------------------------------------------------------------------
/src/list/list-secondary/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "auto-sizer": "../auto-size-img/index"
5 | }
6 | }
--------------------------------------------------------------------------------
/src/list/list-secondary/index.less:
--------------------------------------------------------------------------------
1 | @import (reference) '../../style/themes/default.less';
2 |
3 | .am-list-secondary {
4 | display: flex;
5 | align-items: center;
6 | justify-content: flex-end;
7 | position: relative;
8 | height: 100%;
9 | max-width: 100%;
10 | &-text {
11 | display: flex;
12 | flex-direction: column;
13 | justify-content: space-evenly;
14 | align-items: flex-end;
15 | height: 100%;
16 | max-width: 100%;
17 | overflow: hidden;
18 | }
19 | &-title {
20 | font-size: @font-size-list;
21 | font-size: var(--am-list-secondary-title-size, @font-size-list);
22 | color: @color-text-title;
23 | color: var(--am-list-secondary-title-color, @color-text-title);
24 | white-space: nowrap;
25 | text-overflow: ellipsis;
26 | overflow: hidden;
27 | max-width: 100%;
28 | }
29 | &-subtitle {
30 | font-size: @font-size-subtitle;
31 | font-size: var(--am-list-secondary-subtitle-size, @font-size-subtitle);
32 | color: @color-text-subtitle;
33 | color: var(--am-list-secondary-subtitle-color, @color-text-subtitle);
34 | white-space: nowrap;
35 | text-overflow: ellipsis;
36 | overflow: hidden;
37 | max-width: 100%;
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/list/list-secondary/index.ts:
--------------------------------------------------------------------------------
1 | Component({
2 | props: {
3 | title: '',
4 | subtitle: '',
5 | thumb: '',
6 | },
7 | didMount() {
8 | const { title = '', subtitle = '' } = this.props;
9 | const thumbPlaceholder = title.slice(0, 1) + subtitle.slice(0, 1);
10 | this.setData({
11 | // thumbPlaceholder: thumbPlaceholder.slice(1),
12 | thumbPlaceholder,
13 | });
14 | },
15 | });
16 |
--------------------------------------------------------------------------------
/src/loading/index.axml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
13 |
19 |
25 |
26 |
--------------------------------------------------------------------------------
/src/loading/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true
3 | }
4 |
--------------------------------------------------------------------------------
/src/loading/index.ts:
--------------------------------------------------------------------------------
1 | import fmtUnit from '../_util/fmtUnit';
2 |
3 | Component({
4 | props: {
5 | size: fmtUnit('100px'),
6 | className: '',
7 | color: '#999',
8 | height: '',
9 | },
10 | });
11 |
--------------------------------------------------------------------------------
/src/long-password/index.axml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
21 |
23 |
27 |
28 |
30 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/src/long-password/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "am-icon": "../am-icon/index"
5 | }
6 | }
--------------------------------------------------------------------------------
/src/mask/index.axml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/mask/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true
3 | }
4 |
--------------------------------------------------------------------------------
/src/mask/index.less:
--------------------------------------------------------------------------------
1 | @import (reference) "../style/themes/default.less";
2 |
3 | .am-mask {
4 | position: fixed;
5 | top: 0;
6 | left: 0;
7 | right: 0;
8 | bottom: 0;
9 | z-index: 0;
10 | background-color: @color-product-mask;
11 | background-color: var(--am-mask-backgroundColor, @color-product-mask);
12 | &__m {
13 | background-color: @color-marketing-mask;
14 | background-color: var(--am-mask-market-backgroundColor, @color-marketing-mask);
15 | }
16 | &__fix {
17 | width: 300vw;
18 | height: 300vh;
19 | transform: translate3d(-100vw, -100vh, 0);
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/mask/index.md:
--------------------------------------------------------------------------------
1 | # Mask 遮罩蒙层
2 |
3 | 可用于需要遮罩蒙层的弹层元素。
4 |
5 | ## 截图
6 | 
7 |
8 | ## 扫码体验
9 |
10 | 
11 |
12 |
13 |
14 | ## 属性介绍
15 |
16 | | 属性名 | 类型 | 默认值 | 可选项 | 描述 | 最低版本 | 必填 |
17 | | ---- | ---- | ---- | ---- | ---- | ---- | ---- |
18 | | type | String | product | product、market | 显示不同透明度的蒙层 | - | true |
19 | | maskZindex| Number | - | - | 自定义蒙层的 `z-index` 层级 | - | - |
20 | | show | Boolean | true | - | 是否显示蒙层 | - | - |
21 | | onMaskTap | EventHandle | () => { } | - | 蒙层点击事件 | - | - |
22 | | fixMaskFull | Boolean | false | - | 用以解决遮罩层受到 `transform` 影响而显示不全的问题 | [1.0.11](https://www.npmjs.com/package/mini-ali-ui?activeTab=versions) | - |
23 |
24 | ## 代码示例
25 | ```json
26 | {
27 | "defaultTitle": "Mask",
28 | "usingComponents":{
29 | "mask": "mini-ali-ui/es/mask/index"
30 | }
31 | }
32 | ```
33 |
34 | ```xml
35 |
36 | ```
37 |
38 | ```javascript
39 | Page({
40 | data: {
41 | type: 'market',
42 | maskZindex: 10,
43 | },
44 | maskClick() {
45 | if (this.data.type === 'market') {
46 | this.setData({
47 | type: 'product',
48 | });
49 | } else {
50 | this.setData({
51 | type: 'market',
52 | show: false,
53 | });
54 | }
55 | },
56 | });
57 | ```
--------------------------------------------------------------------------------
/src/mask/index.ts:
--------------------------------------------------------------------------------
1 | import fmtEvent from '../_util/fmtEvent';
2 |
3 | Component({
4 | props: {
5 | maskZindex: '',
6 | // product: 产品弹窗蒙层;market:营销弹窗蒙层;
7 | type: 'product',
8 | onMaskTap: () => { },
9 | show: true,
10 | fixMaskFull: false,
11 | },
12 | methods: {
13 | onMaskClick(e) {
14 | const { onMaskTap } = this.props;
15 | if (onMaskTap !== '' && typeof onMaskTap === 'function') {
16 | const event = fmtEvent(this.props, e);
17 | onMaskTap(event);
18 | }
19 | },
20 | },
21 | });
22 |
--------------------------------------------------------------------------------
/src/message/index.axml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | {{title}}
5 |
6 |
7 | {{subTitle}}
8 |
9 |
10 |
11 |
12 |
13 |
14 |
22 |
30 |
31 |
--------------------------------------------------------------------------------
/src/message/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "button": "../button/index",
5 | "am-icon": "../am-icon/index"
6 | }
7 | }
--------------------------------------------------------------------------------
/src/modal/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "button": "../button/index",
5 | "am-icon": "../am-icon/index"
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/src/modal/index.ts:
--------------------------------------------------------------------------------
1 | import fmtUnit from '../_util/fmtUnit';
2 |
3 | Component({
4 | data: {
5 | _buttonsLayout: '',
6 | adviceClose: fmtUnit(26),
7 | normalClose: fmtUnit(18),
8 | },
9 | props: {
10 | className: '',
11 | topImageSize: 'md',
12 | showClose: false,
13 | closeType: '0',
14 | mask: true,
15 | buttonsLayout: 'horizontal',
16 | disableScroll: true,
17 | maskClick: false,
18 | },
19 | didMount() {
20 | const { buttons, buttonsLayout } = this.props;
21 | // button数目大于 2 个,则强制使用竖排结构
22 | if (buttons && buttons.length > 2) {
23 | this.setData({
24 | _buttonsLayout: 'vertical',
25 | });
26 | } else {
27 | this.setData({
28 | _buttonsLayout: buttonsLayout,
29 | });
30 | }
31 | },
32 | methods: {
33 | // footer点击
34 | _onModalClick() {
35 | const { onModalClick } = this.props;
36 | if (onModalClick) {
37 | onModalClick();
38 | }
39 | },
40 | // buttons点击
41 | _onButtonClick(e) {
42 | const { onButtonClick } = this.props;
43 | if (onButtonClick) {
44 | onButtonClick(e);
45 | }
46 | },
47 | // 关闭按钮点击
48 | _onModalClose() {
49 | const { onModalClose } = this.props;
50 | if (onModalClose) {
51 | onModalClose();
52 | }
53 | },
54 | // mask 遮罩层点击
55 | _onMaskTap() {
56 | const { onMaskClick } = this.props;
57 | if (typeof onMaskClick === 'function') {
58 | onMaskClick();
59 | } else {
60 | return false;
61 | }
62 | },
63 | },
64 | });
65 |
--------------------------------------------------------------------------------
/src/multi-liner/index.axml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/src/multi-liner/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true
3 | }
4 |
--------------------------------------------------------------------------------
/src/notice/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "am-icon": "../am-icon/index"
5 | }
6 | }
--------------------------------------------------------------------------------
/src/page-result/index.axml:
--------------------------------------------------------------------------------
1 |
2 |
3 | {{title === undefined ? defaultTitle[type] : title }}
4 | {{brief === undefined ? defaultBrief[type] : brief}}
5 |
6 |
7 |
8 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/src/page-result/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "button": "../button/index"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/src/pagination/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true
3 | }
4 |
--------------------------------------------------------------------------------
/src/pagination/index.sjs:
--------------------------------------------------------------------------------
1 | const calcCurrent = (propsCurrent, current) => (typeof current === 'number' ? current : propsCurrent);
2 |
3 | export default {
4 | calcCurrent,
5 | };
6 |
--------------------------------------------------------------------------------
/src/picker-item/index.axml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
6 |
7 |
8 |
9 |
10 | {{value.length > 0 ? value : placeholder}}
11 |
12 |
13 |
14 |
15 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src/picker-item/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "am-icon": "../am-icon/index"
5 | }
6 | }
--------------------------------------------------------------------------------
/src/picker-item/index.ts:
--------------------------------------------------------------------------------
1 | import fmtEvent from '../_util/fmtEvent';
2 | import fmtUnit from '../_util/fmtUnit';
3 |
4 | Component({
5 | props: {
6 | className: '',
7 | value: '',
8 | placeholder: '',
9 | onSelect: () => {},
10 | labelCls: '',
11 | pickerCls: '',
12 | layer: '', // 表单排列位置,当为空时默认横向排列, vertical 为竖向排列
13 | iconType: 'right',
14 | },
15 | data: {
16 | iconSize: fmtUnit(18),
17 | },
18 | methods: {
19 | onPickerTap(e) {
20 | const event = fmtEvent(this.props, e);
21 | this.props.onPickerTap(event);
22 | },
23 | },
24 | });
25 |
--------------------------------------------------------------------------------
/src/popover/index.axml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/src/popover/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "mask": "../mask/index"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/src/popover/index.ts:
--------------------------------------------------------------------------------
1 | Component({
2 | props: {
3 | show: false,
4 | className: '',
5 | showMask: true,
6 | position: 'bottomRight',
7 | fixMaskFull: false,
8 | },
9 | methods: {
10 | onMaskClick() {
11 | if (this.props.onMaskClick && typeof this.props.onMaskClick === 'function') {
12 | this.props.onMaskClick();
13 | }
14 | },
15 | },
16 | });
17 |
18 |
--------------------------------------------------------------------------------
/src/popover/popover-item/index.axml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
9 |
12 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/src/popover/popover-item/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "am-icon": "../../am-icon/index"
5 | }
6 | }
--------------------------------------------------------------------------------
/src/popover/popover-item/index.ts:
--------------------------------------------------------------------------------
1 | import fmtEvent from '../../_util/fmtEvent';
2 | import fmtUnit from '../../_util/fmtUnit';
3 |
4 | Component({
5 | props: {
6 | className: '',
7 | iconURL: '',
8 | iconType: '',
9 | },
10 | data: {
11 | iconSize: fmtUnit(22),
12 | },
13 | methods: {
14 | onItemClick(e) {
15 | if (this.props.onItemClick && typeof this.props.onItemClick === 'function') {
16 | const event = fmtEvent(this.props, e);
17 | this.props.onItemClick(event);
18 | }
19 | },
20 | },
21 | });
22 |
--------------------------------------------------------------------------------
/src/popup/index.axml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/popup/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true
3 | }
--------------------------------------------------------------------------------
/src/popup/index.less:
--------------------------------------------------------------------------------
1 | .am-popup {
2 | position: relative;
3 | &-content {
4 | position: fixed;
5 | }
6 |
7 | &-mask {
8 | visibility: hidden;
9 | position: fixed;
10 | top: 0;
11 | bottom: 0;
12 | left: 0;
13 | right: 0;
14 | background-color: rgba(0, 0, 0, 0.75);
15 | opacity: 0;
16 | }
17 |
18 | &-left {
19 | transform: translateX(-100%);
20 | left: 0;
21 | top: 0;
22 | bottom: 0;
23 | }
24 |
25 | &-right {
26 | transform: translateX(100%);
27 | right: 0;
28 | top: 0;
29 | bottom: 0;
30 | }
31 |
32 | &-top {
33 | top: 0;
34 | left: 0;
35 | width: 100vw;
36 | transform: translateY(-100%);
37 | }
38 |
39 | &-bottom {
40 | left: 0;
41 | bottom: 0;
42 | width: 100vw;
43 | transform: translateY(100%);
44 | }
45 |
46 | &-show &-content {
47 | transform: none;
48 | }
49 |
50 | &-show &-mask {
51 | visibility: visible;
52 | opacity: 1;
53 | }
54 |
55 | &.animation &-content {
56 | transition: all 200ms linear;
57 | }
58 |
59 | &.animation &-mask {
60 | transition: all 200ms linear;
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/src/popup/index.ts:
--------------------------------------------------------------------------------
1 | Component({
2 | props: {
3 | className: '',
4 | show: false,
5 | position: 'bottom',
6 | mask: true,
7 | animation: true,
8 | disableScroll: true,
9 | },
10 | methods: {
11 | onMaskTap() {
12 | const { onClose, animation } = this.props;
13 |
14 | if (onClose) {
15 | if (animation) {
16 | onClose();
17 | } else {
18 | setTimeout(() => {
19 | onClose();
20 | }, 200);
21 | }
22 | }
23 | },
24 | },
25 | });
26 |
--------------------------------------------------------------------------------
/src/search-bar/index.axml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
7 |
8 |
22 |
24 |
26 |
27 |
30 |
32 |
33 |
34 | {{_i18nCancel}}
36 |
--------------------------------------------------------------------------------
/src/search-bar/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "am-icon": "../am-icon/index"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/src/stepper/index.axml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/src/stepper/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "am-icon": "../am-icon/index"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/src/steps/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "am-icon": "../am-icon/index"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/src/steps/index.ts:
--------------------------------------------------------------------------------
1 | import fmtUnit from '../_util/fmtUnit';
2 |
3 | Component({
4 | props: {
5 | className: '',
6 | activeIndex: 1,
7 | failIndex: 0,
8 | size: 0,
9 | direction: 'horizontal',
10 | items: [],
11 | showStepNumber: false,
12 | horizHighlight: false, // 用于控制水平方向是否启用高亮展示 title
13 | iconFail: 'close', // 提示失败的 icon 图标
14 | iconSuccess: 'check', // 提示成功的 icon 图标
15 | iconSuccessBg: '', // 成功 icon 图标的背景颜色,且同时修改步骤线条颜色
16 | iconSuccessColor: '', // 成功 icon 的文本颜色
17 | },
18 | data: {
19 | __size12: fmtUnit(12),
20 | __size8: fmtUnit(8),
21 | valueUnit: fmtUnit('px'),
22 | },
23 | });
24 |
--------------------------------------------------------------------------------
/src/style/mixins/hairline.less:
--------------------------------------------------------------------------------
1 | @import (reference) '../themes/default.less';
2 |
3 | .scale-hairline-common(@color, @top, @right, @bottom, @left) {
4 | content: '';
5 | position: absolute;
6 | background-color: @color;
7 | display: block;
8 | top: @top;
9 | right: @right;
10 | bottom: @bottom;
11 | left: @left;
12 | }
13 |
14 | .hairline(@direction, @color: @color-divider-line) when (@direction = 'top') {
15 | &::before {
16 | .scale-hairline-common(@color, 0, 0, auto, 0);
17 | height: 1px;
18 | transform: scaleY(0.5);
19 | }
20 | }
21 |
22 | .hairline(@direction, @color: @color-divider-line) when (@direction = 'right') {
23 | &::after {
24 | .scale-hairline-common(@color, 0, 0, 0, auto);
25 | width: 1px;
26 | transform: scaleX(0.5);
27 | }
28 | }
29 |
30 | .hairline(@direction, @color: @color-divider-line) when (@direction = 'bottom') {
31 | &::after {
32 | .scale-hairline-common(@color, auto, 0, 0, 0);
33 | height: 1px;
34 | transform: scaleY(0.5);
35 | }
36 | }
37 |
38 | .hairline(@direction, @color: @color-divider-line) when (@direction = 'left') {
39 | &::before {
40 | .scale-hairline-common(@color, 0, auto, 0, 0);
41 | width: 1px;
42 | transform: scaleX(0.5);
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/src/swipe-action/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true
3 | }
4 |
--------------------------------------------------------------------------------
/src/tabs/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "badge": "../badge/index",
5 | "am-icon": "../am-icon/index"
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/src/tabs/tab-content/index.axml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
12 |
13 |
14 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/src/tabs/tab-content/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true
3 | }
4 |
--------------------------------------------------------------------------------
/src/tabs/tab-content/index.less:
--------------------------------------------------------------------------------
1 | .am-tabs-pane-swiper-item {
2 | position: absolute;
3 | width: 100%;
4 | height: 100%;
5 | will-change: auto;
6 | box-sizing: border-box;
7 | overflow: hidden;
8 | }
9 | .am-tabs-pane-swiper-item-position {
10 | top: 0;
11 | }
12 |
13 | .am-tabs-pane-wrap {
14 | width: 100%;
15 | height: auto;
16 | flex-shrink: 0;
17 | }
18 |
19 | .fix .am-tabs-pane-wrap {
20 | position: static;
21 | }
22 |
--------------------------------------------------------------------------------
/src/tabs/tab-content/index.ts:
--------------------------------------------------------------------------------
1 | Component({
2 | props: {
3 | tabId: '',
4 | activeTab: '',
5 | },
6 | });
7 |
--------------------------------------------------------------------------------
/src/tabs/util.sjs:
--------------------------------------------------------------------------------
1 | function toIntArray(v) {
2 | const ret = [];
3 | const version = v.split('.');
4 |
5 | for (let i = 0; i < version.length; i++) {
6 | ret.push(parseInt(version[i], 10));
7 | }
8 |
9 | return ret;
10 | }
11 |
12 | const calcScrollLeft = (windowWidth, tabWidth, current) => {
13 | let scrollInit = current * windowWidth * tabWidth;
14 |
15 | if (current <= 2) {
16 | scrollInit = 0;
17 | } else {
18 | scrollInit = (current - 2) * windowWidth * tabWidth;
19 | }
20 |
21 | return scrollInit;
22 | };
23 |
24 | const compareVersion = (v) => {
25 | const targetVersion = toIntArray('1.10.0');
26 | const version = toIntArray(v);
27 | let ret = 0;
28 |
29 | for (let i = 0, n1, n2; i < version.length; i++) {
30 | n1 = targetVersion[i];
31 | n2 = version[i];
32 |
33 | if (n1 > n2) {
34 | ret = -1;
35 | break
36 | }
37 |
38 | if (n1 < n2) {
39 | ret = 1;
40 | break;
41 | }
42 | }
43 |
44 | return ret;
45 | }
46 |
47 | export default {
48 | calcScrollLeft,
49 | compareVersion,
50 | };
51 |
--------------------------------------------------------------------------------
/src/tag/index.axml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/src/tag/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "am-icon": "../am-icon/index"
5 | }
6 | }
--------------------------------------------------------------------------------
/src/tag/index.ts:
--------------------------------------------------------------------------------
1 | import fmtUnit from '../_util/fmtUnit';
2 |
3 | Component({
4 | props: {
5 | type: 'primary',
6 | iconType: '',
7 | className: '',
8 | size: 'lg',
9 | },
10 | data: {
11 | bgClass: {
12 | primary: 'am-tag-bg-primary',
13 | warning: 'am-tag-bg-warning',
14 | success: 'am-tag-bg-success',
15 | danger: 'am-tag-bg-danger',
16 | },
17 | iconClass: {
18 | primary: 'am-tag-icon-primary',
19 | warning: 'am-tag-icon-warning',
20 | success: 'am-tag-icon-success',
21 | danger: 'am-tag-icon-danger',
22 | },
23 | ghostClass: {
24 | primary: 'am-tag-ghost-primary',
25 | warning: 'am-tag-ghost-warning',
26 | success: 'am-tag-ghost-success',
27 | danger: 'am-tag-ghost-danger',
28 | },
29 | iconSizeSm: fmtUnit(10),
30 | iconSize: fmtUnit(12),
31 | },
32 | didMount() {},
33 | didUpdate() {},
34 | didUnmount() {},
35 | });
36 |
--------------------------------------------------------------------------------
/src/terms/index.axml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
13 |
14 |
17 |
18 |
19 |
22 |
--------------------------------------------------------------------------------
/src/terms/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "button": "../button/index",
5 | "am-checkbox": "../am-checkbox/index",
6 | "am-icon": "../am-icon/index"
7 | }
8 | }
--------------------------------------------------------------------------------
/src/tips/tips-dialog/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "am-icon": "../../am-icon/index"
5 | }
6 | }
--------------------------------------------------------------------------------
/src/tips/tips-dialog/index.ts:
--------------------------------------------------------------------------------
1 | import fmtEvent from '../../_util/fmtEvent';
2 | import fmtUnit from '../../_util/fmtUnit';
3 |
4 | Component({
5 | props: {
6 | show: true,
7 | className: '',
8 | type: 'dialog',
9 | iconSize: 20,
10 | arrowPosition: 'bottom-left',
11 | },
12 | data: {
13 | arrowColor: '000',
14 | iconSizeClose: fmtUnit(18),
15 | },
16 | methods: {
17 | onCloseTap(e) {
18 | const { onCloseTap } = this.props;
19 | const event = fmtEvent(this.props, e);
20 |
21 | if (onCloseTap) {
22 | onCloseTap(event);
23 | }
24 | },
25 | },
26 | });
27 |
--------------------------------------------------------------------------------
/src/tips/tips-plain/index.axml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/src/tips/tips-plain/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true
3 | }
--------------------------------------------------------------------------------
/src/tips/tips-plain/index.ts:
--------------------------------------------------------------------------------
1 | import fmtEvent from '../../_util/fmtEvent';
2 |
3 | Component({
4 | data: {
5 | show: true,
6 | },
7 | props: {
8 | className: '',
9 | time: 5000,
10 | onClose: () => {},
11 | onTimeOut: () => {},
12 | },
13 | didMount() {
14 | const { time } = this.props;
15 | this._timer = setTimeout(() => {
16 | this.setData({
17 | show: false,
18 | });
19 | this.onTimeOut();
20 | }, time);
21 | },
22 | didUnmount() {
23 | clearTimeout(this._timer);
24 | },
25 | methods: {
26 | onClose(e) {
27 | const event = fmtEvent(this.props, e);
28 | this.setData({
29 | show: false,
30 | });
31 | clearTimeout(this._timer);
32 | this.props.onClose(event);
33 | },
34 | onTimeOut(e) {
35 | const event = fmtEvent(this.props, e);
36 | if (this.props.onTimeOut && typeof this.props.onTimeOut === 'function') {
37 | this.props.onTimeOut(event);
38 | }
39 | },
40 | },
41 | });
42 |
--------------------------------------------------------------------------------
/src/title/index.axml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/src/title/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "am-icon": "../am-icon/index"
5 | }
6 | }
--------------------------------------------------------------------------------
/src/title/index.ts:
--------------------------------------------------------------------------------
1 | import fmtEvent from '../_util/fmtEvent';
2 |
3 | Component({
4 | props: {
5 | // title component have boder-bottom line
6 | hasLine: false,
7 | // type: arrow、close、more、'';
8 | type: '',
9 | // if type="arrow", need to write path
10 | iconURL: '',
11 | onActionTap: () => {},
12 | // developer can use class for style
13 | className: '',
14 | },
15 | data: {},
16 | didMount() {},
17 | didUpdate() {},
18 | didUnmount() {},
19 | methods: {
20 | onClick(e) {
21 | const { onActionTap } = this.props;
22 | const event = fmtEvent(this.props, e);
23 | if (typeof onActionTap === 'function') {
24 | onActionTap(event);
25 | }
26 | },
27 | },
28 | });
29 |
--------------------------------------------------------------------------------
/src/verify-code/index.axml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | {{label}}
5 |
6 |
11 |
13 |
14 |
15 | {{
17 | _actionActive ? (actedBefore ? txtSendAgain : txtSend) : `${_countDown} ${txtCountDown}`
18 | }}
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src/verify-code/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "am-icon": "../am-icon/index"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/src/vtabs/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "badge": "../badge/index"
5 | }
6 | }
--------------------------------------------------------------------------------
/src/vtabs/vtab-content/index.axml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/src/vtabs/vtab-content/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true
3 | }
--------------------------------------------------------------------------------
/src/vtabs/vtab-content/index.ts:
--------------------------------------------------------------------------------
1 | Component({});
2 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "baseUrl": ".",
4 | "target": "es6",
5 | "noImplicitThis": true,
6 | "noImplicitUseStrict": true,
7 | "types": ["mini-types"]
8 | },
9 | "include": [
10 | "types/**/*",
11 | "src/**/*"
12 | ]
13 | }
14 |
--------------------------------------------------------------------------------