@ray-js/smart-ui 2.13.2-beta-0 → 2.13.2-beta-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/@types/config-provider/index.d.ts +7 -2
- package/es/@types/config-provider/theme-vars.d.ts +1 -1
- package/es/action-sheet/README.md +613 -0
- package/es/battery/README.md +149 -0
- package/es/bottom-sheet/README.md +495 -0
- package/es/button/README.md +335 -0
- package/es/calendar/README.md +513 -0
- package/es/cascader/README.md +326 -0
- package/es/cell/README.md +317 -0
- package/es/checkbox/README.md +481 -0
- package/es/circle/README.md +132 -0
- package/es/col/README.md +162 -0
- package/es/collapse/README.md +127 -0
- package/es/config-provider/README.md +150 -0
- package/es/count-down/README.md +201 -0
- package/es/custom-keyboard/README.md +122 -0
- package/es/datetime-picker/README.md +438 -0
- package/es/dialog/README.md +451 -0
- package/es/divider/README.md +132 -0
- package/es/dropdown-menu/README.md +331 -0
- package/es/empty/README.md +119 -0
- package/es/field/README.md +455 -0
- package/es/grid/README.md +273 -0
- package/es/icon/README.md +178 -0
- package/es/image/README.md +225 -0
- package/es/index-bar/README.md +186 -0
- package/es/loading/README.md +120 -0
- package/es/nav-bar/README.md +410 -0
- package/es/notice-bar/README.md +274 -0
- package/es/notify/README.md +121 -0
- package/es/overlay/README.md +128 -0
- package/es/picker/README.md +412 -0
- package/es/popover/README.md +338 -0
- package/es/popup/README.md +272 -0
- package/es/progress/README.md +88 -0
- package/es/radio/README.md +423 -0
- package/es/rate/README.md +248 -0
- package/es/search/README.md +290 -0
- package/es/sidebar/README.md +176 -0
- package/es/skeleton/README.md +141 -0
- package/es/slider/README.md +444 -0
- package/es/stepper/README.md +231 -0
- package/es/sticky/README.md +91 -0
- package/es/swipe-cell/README.md +217 -0
- package/es/switch/README.md +316 -0
- package/es/tab/README.md +501 -0
- package/es/tabbar/README.md +397 -0
- package/es/tag/README.md +215 -0
- package/es/toast/README.md +293 -0
- package/es/transition/README.md +140 -0
- package/es/tree-select/README.md +348 -0
- package/lib/@types/config-provider/index.d.ts +7 -2
- package/lib/@types/config-provider/theme-vars.d.ts +1 -1
- package/lib/action-sheet/README.md +613 -0
- package/lib/battery/README.md +149 -0
- package/lib/bottom-sheet/README.md +495 -0
- package/lib/button/README.md +335 -0
- package/lib/calendar/README.md +513 -0
- package/lib/cascader/README.md +326 -0
- package/lib/cell/README.md +317 -0
- package/lib/checkbox/README.md +481 -0
- package/lib/circle/README.md +132 -0
- package/lib/col/README.md +162 -0
- package/lib/collapse/README.md +127 -0
- package/lib/config-provider/README.md +150 -0
- package/lib/count-down/README.md +201 -0
- package/lib/custom-keyboard/README.md +122 -0
- package/lib/datetime-picker/README.md +438 -0
- package/lib/dialog/README.md +451 -0
- package/lib/divider/README.md +132 -0
- package/lib/dropdown-menu/README.md +331 -0
- package/lib/empty/README.md +119 -0
- package/lib/field/README.md +455 -0
- package/lib/grid/README.md +273 -0
- package/lib/icon/README.md +178 -0
- package/lib/image/README.md +225 -0
- package/lib/index-bar/README.md +186 -0
- package/lib/loading/README.md +120 -0
- package/lib/nav-bar/README.md +410 -0
- package/lib/notice-bar/README.md +274 -0
- package/lib/notify/README.md +121 -0
- package/lib/overlay/README.md +128 -0
- package/lib/picker/README.md +412 -0
- package/lib/popover/README.md +338 -0
- package/lib/popup/README.md +272 -0
- package/lib/progress/README.md +88 -0
- package/lib/radio/README.md +423 -0
- package/lib/rate/README.md +248 -0
- package/lib/search/README.md +290 -0
- package/lib/sidebar/README.md +176 -0
- package/lib/skeleton/README.md +141 -0
- package/lib/slider/README.md +444 -0
- package/lib/stepper/README.md +231 -0
- package/lib/sticky/README.md +91 -0
- package/lib/swipe-cell/README.md +217 -0
- package/lib/switch/README.md +316 -0
- package/lib/tab/README.md +501 -0
- package/lib/tabbar/README.md +397 -0
- package/lib/tag/README.md +215 -0
- package/lib/toast/README.md +293 -0
- package/lib/transition/README.md +140 -0
- package/lib/tree-select/README.md +348 -0
- package/package.json +3 -3
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
---
|
|
2
|
+
category: 导航
|
|
3
|
+
assets: BrandList
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# IndexBar 索引栏
|
|
7
|
+
|
|
8
|
+
### 介绍
|
|
9
|
+
|
|
10
|
+
用于列表的索引分类显示和快速定位。
|
|
11
|
+
|
|
12
|
+
### 引入
|
|
13
|
+
|
|
14
|
+
```jsx
|
|
15
|
+
import { IndexBar } from '@ray-js/smart-ui';
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
```warning:⚠️注意
|
|
19
|
+
组件是监听整个page 滚动事件来做动态的 fixed 标题元素,所以渲染此组件的页面必须配置 页面可滚动。
|
|
20
|
+
|
|
21
|
+
index.config.ts:
|
|
22
|
+
|
|
23
|
+
export default {
|
|
24
|
+
navigationBarTitleText: 'Home',
|
|
25
|
+
disableScroll: false,
|
|
26
|
+
};
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## 代码演示
|
|
30
|
+
|
|
31
|
+
### 基础用法
|
|
32
|
+
|
|
33
|
+
点击索引栏时,会自动跳转到对应的`IndexAnchor`锚点位置。设置 `scrollable` 后可滑动定位;设置 `showMoveTip`(`v2.12.0`)可在拖动侧边栏时显示跟随手指的提示气泡。
|
|
34
|
+
|
|
35
|
+
```jsx
|
|
36
|
+
import React from 'react';
|
|
37
|
+
import { View } from '@ray-js/ray';
|
|
38
|
+
import { Cell, IndexBar, IndexAnchor } from '@ray-js/smart-ui';
|
|
39
|
+
|
|
40
|
+
export default function Demo() {
|
|
41
|
+
const indexList = Array.from({ length: 26 }, (_, i) =>
|
|
42
|
+
String.fromCharCode('A'.charCodeAt(0) + i)
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<IndexBar scrollable showMoveTip>
|
|
47
|
+
{indexList.map((item, index) => (
|
|
48
|
+
<View key={`${index + 1}`}>
|
|
49
|
+
<IndexAnchor index={item} />
|
|
50
|
+
<Cell title="文本" />
|
|
51
|
+
<Cell title="文本" />
|
|
52
|
+
<Cell title="文本" />
|
|
53
|
+
</View>
|
|
54
|
+
))}
|
|
55
|
+
</IndexBar>
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### 自定义索引列表
|
|
61
|
+
|
|
62
|
+
可以通过`indexList`属性自定义展示的索引字符列表。
|
|
63
|
+
|
|
64
|
+
```jsx
|
|
65
|
+
import { Cell, IndexBar, IndexAnchor } from '@ray-js/smart-ui';
|
|
66
|
+
import { View } from '@ray-js/ray';
|
|
67
|
+
import React from 'react';
|
|
68
|
+
|
|
69
|
+
export default function Demo() {
|
|
70
|
+
const customIndexList = [1, 2, 3, 4, 5, 6, 8, 9, 10];
|
|
71
|
+
return (
|
|
72
|
+
<IndexBar indexList={customIndexList}>
|
|
73
|
+
{customIndexList.map((item, index) => (
|
|
74
|
+
<View key={`${index + 1}`}>
|
|
75
|
+
<IndexAnchor index={item} useSlot>
|
|
76
|
+
标题 {item}
|
|
77
|
+
</IndexAnchor>
|
|
78
|
+
<Cell title="文本" />
|
|
79
|
+
<Cell title="文本" />
|
|
80
|
+
<Cell title="文本" />
|
|
81
|
+
</View>
|
|
82
|
+
))}
|
|
83
|
+
</IndexBar>
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### 自定义侧边栏样式 `v2.11.0`
|
|
89
|
+
|
|
90
|
+
`sidebarFontSize` 和 `sidebarLineHeight` 属性可以设置侧边栏的字体样式
|
|
91
|
+
|
|
92
|
+
```jsx
|
|
93
|
+
import React from 'react';
|
|
94
|
+
import { View } from '@ray-js/ray';
|
|
95
|
+
import { Cell, IndexBar, IndexAnchor } from '@ray-js/smart-ui';
|
|
96
|
+
|
|
97
|
+
export default function Demo() {
|
|
98
|
+
const indexList = Array.from({ length: 26 }, (_, i) =>
|
|
99
|
+
String.fromCharCode('A'.charCodeAt(0) + i)
|
|
100
|
+
);
|
|
101
|
+
|
|
102
|
+
return (
|
|
103
|
+
<IndexBar sidebarFontSize="16px" sidebarLineHeight="20px">
|
|
104
|
+
{indexList.map((item, index) => (
|
|
105
|
+
<View key={`${index + 1}`}>
|
|
106
|
+
<IndexAnchor index={item} />
|
|
107
|
+
<Cell title="文本" />
|
|
108
|
+
<Cell title="文本" />
|
|
109
|
+
<Cell title="文本" />
|
|
110
|
+
</View>
|
|
111
|
+
))}
|
|
112
|
+
</IndexBar>
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## API
|
|
118
|
+
|
|
119
|
+
### IndexBar Props
|
|
120
|
+
|
|
121
|
+
| 参数 | 说明 | 类型 | 默认值 |
|
|
122
|
+
| ----------------------------- | -------------------------- | ---------------------- | --------- |
|
|
123
|
+
| highlightColor | 索引字符高亮颜色 | _string_ | `#07c160` |
|
|
124
|
+
| indexList | 索引字符列表 | _string[] \| number[]_ | `A-Z` |
|
|
125
|
+
| sticky | 是否开启锚点自动吸顶 | _boolean_ | `true` |
|
|
126
|
+
| stickyPush `v2.13.0` | 滚动时是否开启上一个吸顶锚点的上推动画效果 | _boolean_ | `true` |
|
|
127
|
+
| stickyOffsetTop | 锚点自动吸顶时与顶部的距离 | _number_ | `0` |
|
|
128
|
+
| zIndex | z-index 层级 | _number_ | `1` |
|
|
129
|
+
| scrollable `v2.1.7` | SideBar 是否可滚动定位 | _boolean_ | `false` |
|
|
130
|
+
| showMoveTip `v2.12.0` | 是否在拖动侧边栏时显示跟随手指的提示气泡 | _boolean_ | `false` |
|
|
131
|
+
| sidebarFontSize `v2.11.0` | SideBar 字体大小 | _string_ | - |
|
|
132
|
+
| sidebarLineHeight `v2.11.0` | SideBar 字体行高 | _string_ | - |
|
|
133
|
+
|
|
134
|
+
### IndexAnchor Props
|
|
135
|
+
|
|
136
|
+
| 参数 | 说明 | 类型 | 默认值 |
|
|
137
|
+
| -------- | ------------------------ | ------------------ | ------- |
|
|
138
|
+
| index | 索引字符 | _string \| number_ | - |
|
|
139
|
+
| useSlot | 是否使用自定义内容的插槽 | _boolean_ | `false` |
|
|
140
|
+
|
|
141
|
+
### IndexBar Events
|
|
142
|
+
|
|
143
|
+
| 事件名 | 说明 | 回调参数 |
|
|
144
|
+
| ------ | -------------- | --------------- |
|
|
145
|
+
| select | 选中字符时触发 | index: 索引字符 |
|
|
146
|
+
|
|
147
|
+
### IndexAnchor Slots
|
|
148
|
+
|
|
149
|
+
| 名称 | 说明 |
|
|
150
|
+
| ---- | -------------------------------- |
|
|
151
|
+
| - | 锚点位置显示内容,默认为索引字符 |
|
|
152
|
+
|
|
153
|
+
### 样式变量
|
|
154
|
+
|
|
155
|
+
组件提供了下列 CSS 变量,可用于自定义样式,使用方法请参考 [ConfigProvider 组件](/material/smartui?comId=config-provider)。
|
|
156
|
+
|
|
157
|
+
**IndexBar**
|
|
158
|
+
|
|
159
|
+
| 名称 | 默认值 | 描述 |
|
|
160
|
+
| ----------------------------------------- | ------------ | ---------------------- |
|
|
161
|
+
| --index-bar-index-font-size | _10px_ | 侧边栏索引字体大小 |
|
|
162
|
+
| --index-bar-index-line-height | _14px_ `v2.0.0` _16px_ `v2.12.0` | 侧边栏索引行高 |
|
|
163
|
+
| --index-bar-move-tip-text-padding `v2.12.0` | _0 10px 0 0_ | 拖动提示文字内边距 |
|
|
164
|
+
| --index-bar-move-tip-text-font-size `v2.12.0` | _24px_ | 拖动提示文字字体大小 |
|
|
165
|
+
| --index-bar-move-tip-text-line-height `v2.12.0` | _32px_ | 拖动提示文字行高 |
|
|
166
|
+
| --index-bar-move-tip-text-color `v2.12.0` | _#fff_ | 拖动提示文字颜色 |
|
|
167
|
+
|
|
168
|
+
**IndexAnchor**
|
|
169
|
+
|
|
170
|
+
| 名称 | 默认值 | 描述 |
|
|
171
|
+
| --------------------------------------- | ------------- | ------------------ |
|
|
172
|
+
| --index-anchor-padding | _0 16px_ | 锚点内边距 |
|
|
173
|
+
| --index-anchor-text-color | _rgba(0,0,0,1)_ | 锚点文字颜色 |
|
|
174
|
+
| --index-anchor-font-weight | _500_ | 锚点字重 |
|
|
175
|
+
| --index-anchor-font-size | _14px_ | 锚点字体大小 |
|
|
176
|
+
| --index-anchor-line-height | _32px_ | 锚点行高 |
|
|
177
|
+
| --index-anchor-background-color | _transparent_ | 锚点背景色 |
|
|
178
|
+
| --index-anchor-active-background-color | _#ffffff_ | 锚点吸顶时背景色 |
|
|
179
|
+
| --index-anchor-active-text-color | _#3678e3_ | 锚点吸顶时文字颜色 |
|
|
180
|
+
| --index-anchor-index-padding | _0 4px 0 20px_ | 锚点右侧索引内边距 |
|
|
181
|
+
|
|
182
|
+
## 常见问题
|
|
183
|
+
|
|
184
|
+
### 嵌套在滚动元素中 IndexAnchor 失效?
|
|
185
|
+
|
|
186
|
+
由于 `<IndexBar />` 内部使用 ty.pageScrollTo 滚动到指定位置,因此只支持页面级滚动,无法在滚动元素中嵌套使用,例如:`view` 使用 `overflow: scroll;` 或者 `scroll-view`,具体可查看[微信小程序文档](https://developers.weixin.qq.com/miniprogram/dev/api/ui/scroll/ty.pageScrollTo.html)。
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
---
|
|
2
|
+
category: 展示
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Loading 加载
|
|
6
|
+
|
|
7
|
+
### 介绍
|
|
8
|
+
|
|
9
|
+
加载图标,用于表示加载中的过渡状态。
|
|
10
|
+
|
|
11
|
+
### 引入
|
|
12
|
+
|
|
13
|
+
```js
|
|
14
|
+
import { Loading } from '@ray-js/smart-ui';
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## 代码演示
|
|
18
|
+
|
|
19
|
+
### 加载类型
|
|
20
|
+
|
|
21
|
+
```jsx
|
|
22
|
+
import { Loading } from '@ray-js/smart-ui';
|
|
23
|
+
import { View } from '@ray-js/ray';
|
|
24
|
+
import React from 'react';
|
|
25
|
+
|
|
26
|
+
export default function Demo() {
|
|
27
|
+
return (
|
|
28
|
+
<View>
|
|
29
|
+
<Loading />
|
|
30
|
+
<Loading type="spinner" />
|
|
31
|
+
</View>
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### 自定义颜色
|
|
37
|
+
|
|
38
|
+
```jsx
|
|
39
|
+
import { Loading } from '@ray-js/smart-ui';
|
|
40
|
+
import { View } from '@ray-js/ray';
|
|
41
|
+
import React from 'react';
|
|
42
|
+
|
|
43
|
+
export default function Demo() {
|
|
44
|
+
return (
|
|
45
|
+
<View>
|
|
46
|
+
<Loading color="red" />
|
|
47
|
+
<Loading type="spinner" color="green" />
|
|
48
|
+
</View>
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### 加载文案
|
|
54
|
+
|
|
55
|
+
```jsx
|
|
56
|
+
import { Loading } from '@ray-js/smart-ui';
|
|
57
|
+
import React from 'react';
|
|
58
|
+
|
|
59
|
+
export default function Demo() {
|
|
60
|
+
return (
|
|
61
|
+
<>
|
|
62
|
+
<Loading size="24px">加载中...</Loading>
|
|
63
|
+
<Loading color="var(--app-B1-N1)" iconColor="#1989FA" size="24px">加载中...</Loading>
|
|
64
|
+
</>
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### 垂直排列
|
|
70
|
+
|
|
71
|
+
```jsx
|
|
72
|
+
import { Loading } from '@ray-js/smart-ui';
|
|
73
|
+
import React from 'react';
|
|
74
|
+
|
|
75
|
+
export default function Demo() {
|
|
76
|
+
return (
|
|
77
|
+
<Loading size="24px" vertical>
|
|
78
|
+
加载中...
|
|
79
|
+
</Loading>
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## API
|
|
85
|
+
|
|
86
|
+
### Props
|
|
87
|
+
|
|
88
|
+
| 参数 | 说明 | 类型 | 默认值 |
|
|
89
|
+
| ------------------ | ----------------------------- | ------------------ | ---------- |
|
|
90
|
+
| color | 整体颜色 | _string_ | `var(--loading-text-color, #1989FA)` |
|
|
91
|
+
| size | 加载图标大小,默认单位为 `px` | _string \| number_ | `30px` |
|
|
92
|
+
| textSize `v1.0.0` | 文字大小,默认单位为为 `px` | _string \| number_ | `14px` |
|
|
93
|
+
| type | 类型,可选值为 `spinner` | _string_ | `circular` |
|
|
94
|
+
| vertical `v1.0.0` | 是否垂直排列图标和文字内容 | _boolean_ | `false` |
|
|
95
|
+
| iconColor `v2.8.0` | 单独控制icon的颜色 | _string_ | `var(--loading-spinner-color, #1989FA)` |
|
|
96
|
+
|
|
97
|
+
### Slots
|
|
98
|
+
|
|
99
|
+
| 名称 | 说明 |
|
|
100
|
+
| ---- | -------- |
|
|
101
|
+
| - | 加载文案 |
|
|
102
|
+
|
|
103
|
+
### 外部样式类
|
|
104
|
+
|
|
105
|
+
| 类名 | 说明 |
|
|
106
|
+
| ------------ | ------------ |
|
|
107
|
+
| customClass | 根节点样式类 |
|
|
108
|
+
|
|
109
|
+
### 样式变量
|
|
110
|
+
|
|
111
|
+
组件提供了下列 CSS 变量,可用于自定义样式,使用方法请参考 [ConfigProvider 组件](/material/smartui?comId=config-provider)。
|
|
112
|
+
|
|
113
|
+
| 名称 | 默认值 | 描述 |
|
|
114
|
+
| ----------------------------- | -------------------------------------- | ---- |
|
|
115
|
+
| --loading-text-color | _#969799_ | 文本颜色 |
|
|
116
|
+
| --loading-text-font-size | _14px_ | 文本字体大小 |
|
|
117
|
+
| --loading-text-line-height | _20px_ | 文本行高 |
|
|
118
|
+
| --loading-spinner-color | _#1989FA_ | 加载器颜色 |
|
|
119
|
+
| --loading-spinner-size | _30px_ | 加载器大小 |
|
|
120
|
+
| --loading-spinner-animation-duration | _0.8s_ | 加载动画持续时间 |
|