@vtj/materials 0.10.5 → 0.10.7
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/dist/assets/antdv/index.umd.js +2 -2
- package/dist/assets/charts/index.umd.js +2 -2
- package/dist/assets/element/index.umd.js +2 -2
- package/dist/assets/ui/index.umd.js +2 -2
- package/dist/assets/uni-h5/index.umd.js +3 -3
- package/dist/assets/uni-ui/index.umd.js +3 -3
- package/dist/assets/vant/index.umd.js +2 -2
- package/dist/deps/@vtj/charts/index.umd.js +2 -2
- package/dist/deps/@vtj/icons/index.umd.js +2 -2
- package/dist/deps/@vtj/ui/index.umd.js +3 -3
- package/dist/deps/@vtj/utils/index.umd.js +20 -20
- package/dist/deps/@vueuse/core/index.iife.min.js +1 -1
- package/dist/deps/uni-ui/index.umd.js +1 -1
- package/dist/deps/uni-ui/style.css +1 -1
- package/package.json +7 -7
- package/src/uni-h5/components/input.ts +2 -2
- package/src/uni-h5/components/scrollView.ts +3 -3
- package/src/uni-h5/components/video.ts +1 -1
- package/src/uni-ui/components/badge.ts +1 -5
- package/src/uni-ui/components/breadcrumb.ts +1 -20
- package/src/uni-ui/components/collapse.ts +22 -23
- package/src/uni-ui/components/grid.ts +0 -9
- package/src/uni-ui/components/group.ts +1 -10
- package/src/uni-ui/components/index.ts +4 -4
- package/src/uni-ui/components/popup.ts +10 -2
- package/src/uni-ui/components/swiperDot.ts +21 -7
- package/src/uni-ui/components/table.ts +9 -3
- package/src/uni-ui/components/transition.ts +10 -1
- package/src/uni-ui/index.ts +19 -44
- package/src/uni-ui/lib/uni-collapse/uni-collapse.vue +153 -0
- package/src/uni-ui/lib/uni-collapse-item/uni-collapse-item.vue +425 -0
- package/src/uni-ui/lib/uni-data-picker/keypress.js +45 -0
- package/src/uni-ui/lib/uni-data-picker/uni-data-picker.vue +604 -0
- package/src/uni-ui/lib/uni-data-pickerview/uni-data-picker.js +622 -0
- package/src/uni-ui/lib/uni-data-pickerview/uni-data-pickerview.css +76 -0
- package/src/uni-ui/lib/uni-data-pickerview/uni-data-pickerview.vue +335 -0
- package/src/uni-ui/lib/uni-datetime-picker/calendar-item.vue +181 -170
- package/src/uni-ui/lib/uni-datetime-picker/calendar.vue +977 -939
- package/src/uni-ui/lib/uni-datetime-picker/time-picker.vue +1024 -932
- package/src/uni-ui/lib/uni-datetime-picker/uni-datetime-picker.vue +15 -17
- package/src/uni-ui/lib/uni-datetime-picker/util.js +419 -392
- package/src/uni-ui/lib/uni-fav/i18n/en.json +4 -0
- package/src/uni-ui/lib/uni-fav/i18n/index.js +8 -0
- package/src/uni-ui/lib/uni-fav/i18n/zh-Hans.json +4 -0
- package/src/uni-ui/lib/uni-fav/i18n/zh-Hant.json +4 -0
- package/src/uni-ui/lib/uni-fav/uni-fav.vue +170 -0
- package/src/uni-ui/lib/uni-file-picker/choose-and-upload-file.js +280 -0
- package/src/uni-ui/lib/uni-file-picker/uni-file-picker.vue +668 -0
- package/src/uni-ui/lib/uni-file-picker/upload-file.vue +325 -0
- package/src/uni-ui/lib/uni-file-picker/upload-image.vue +292 -0
- package/src/uni-ui/lib/uni-file-picker/utils.js +110 -0
- package/src/uni-ui/lib/uni-grid/uni-grid.vue +148 -0
- package/src/uni-ui/lib/uni-indexed-list/uni-indexed-list-item.vue +152 -128
- package/src/uni-ui/lib/uni-indexed-list/uni-indexed-list.vue +50 -50
- package/src/uni-ui/lib/uni-load-more/i18n/en.json +5 -0
- package/src/uni-ui/lib/uni-load-more/i18n/index.js +8 -0
- package/src/uni-ui/lib/uni-load-more/i18n/zh-Hans.json +5 -0
- package/src/uni-ui/lib/uni-load-more/i18n/zh-Hant.json +5 -0
- package/src/uni-ui/lib/uni-load-more/uni-load-more.vue +456 -0
- package/src/uni-ui/lib/uni-notice-bar/uni-notice-bar.vue +484 -0
- package/src/uni-ui/lib/uni-popup/uni-popup.vue +4 -4
- package/src/uni-ui/lib/uni-popup-message/uni-popup-message.vue +149 -0
- package/src/uni-ui/lib/uni-rate/uni-rate.vue +362 -343
- package/src/uni-ui/lib/uni-row/uni-row.vue +193 -0
- package/src/uni-ui/lib/uni-search-bar/i18n/en.json +4 -0
- package/src/uni-ui/lib/uni-search-bar/i18n/index.js +8 -0
- package/src/uni-ui/lib/uni-search-bar/i18n/zh-Hans.json +4 -0
- package/src/uni-ui/lib/uni-search-bar/i18n/zh-Hant.json +4 -0
- package/src/uni-ui/lib/uni-search-bar/uni-search-bar.vue +339 -0
- package/src/uni-ui/lib/uni-swipe-action-item/bindingx.js +294 -285
- package/src/uni-ui/lib/uni-swipe-action-item/uni-swipe-action-item.vue +8 -9
- package/src/uni-ui/lib/uni-th/filter-dropdown.vue +551 -503
- package/src/uni-ui/lib/uni-tr/table-checkbox.vue +165 -163
- package/src/uni-ui/lib/uni-tr/uni-tr.vue +6 -6
- package/src/uni-ui/lib/uni-transition/createAnimation.js +131 -0
- package/src/uni-ui/lib/uni-transition/uni-transition.vue +310 -0
- package/src/version.ts +2 -2
package/package.json
CHANGED
@@ -1,25 +1,25 @@
|
|
1
1
|
{
|
2
2
|
"name": "@vtj/materials",
|
3
3
|
"private": false,
|
4
|
-
"version": "0.10.
|
4
|
+
"version": "0.10.7",
|
5
5
|
"type": "module",
|
6
6
|
"devDependencies": {
|
7
7
|
"@dcloudio/uni-app": "3.0.0-4040520250104002",
|
8
8
|
"@dcloudio/uni-h5": "3.0.0-4040520250104002",
|
9
9
|
"@dcloudio/uni-h5-vue": "3.0.0-4040520250104002",
|
10
10
|
"@dcloudio/uni-ui": "~1.5.3",
|
11
|
-
"@vueuse/core": "~12.
|
11
|
+
"@vueuse/core": "~12.7.0",
|
12
12
|
"ant-design-vue": "~4.2.0",
|
13
13
|
"echarts": "~5.6.0",
|
14
14
|
"element-plus": "~2.9.1",
|
15
15
|
"vant": "~4.9.10",
|
16
16
|
"vue": "~3.5.5",
|
17
17
|
"vue-router": "~4.5.0",
|
18
|
-
"@vtj/
|
19
|
-
"@vtj/
|
20
|
-
"@vtj/core": "~0.10.
|
21
|
-
"@vtj/ui": "~0.10.
|
22
|
-
"@vtj/utils": "~0.10.
|
18
|
+
"@vtj/charts": "~0.10.7",
|
19
|
+
"@vtj/cli": "~0.10.2",
|
20
|
+
"@vtj/core": "~0.10.7",
|
21
|
+
"@vtj/ui": "~0.10.7",
|
22
|
+
"@vtj/utils": "~0.10.7"
|
23
23
|
},
|
24
24
|
"files": [
|
25
25
|
"dist",
|
@@ -6,7 +6,7 @@ const desc: MaterialDescription = {
|
|
6
6
|
categoryId: 'form',
|
7
7
|
props: [
|
8
8
|
{
|
9
|
-
name: '
|
9
|
+
name: 'modelValue',
|
10
10
|
title: '输入框的初始内容',
|
11
11
|
setters: 'StringSetter'
|
12
12
|
},
|
@@ -209,7 +209,7 @@ const desc: MaterialDescription = {
|
|
209
209
|
]
|
210
210
|
}
|
211
211
|
],
|
212
|
-
events: ['input', 'focus', 'blur', 'confirm'],
|
212
|
+
events: ['input', 'focus', 'blur', 'confirm', 'update:modelValue'],
|
213
213
|
snippet: {
|
214
214
|
props: {
|
215
215
|
placeholder: '这个是一个输入框'
|
@@ -124,7 +124,7 @@ const desc: MaterialDescription = {
|
|
124
124
|
},
|
125
125
|
children: [
|
126
126
|
{
|
127
|
-
name: '
|
127
|
+
name: 'View',
|
128
128
|
props: {
|
129
129
|
id: 'demo1',
|
130
130
|
class: 'scroll-view-item uni-bg-red',
|
@@ -133,7 +133,7 @@ const desc: MaterialDescription = {
|
|
133
133
|
children: 'A'
|
134
134
|
},
|
135
135
|
{
|
136
|
-
name: '
|
136
|
+
name: 'View',
|
137
137
|
props: {
|
138
138
|
id: 'demo2',
|
139
139
|
class: 'scroll-view-item uni-bg-green',
|
@@ -142,7 +142,7 @@ const desc: MaterialDescription = {
|
|
142
142
|
children: 'B'
|
143
143
|
},
|
144
144
|
{
|
145
|
-
name: '
|
145
|
+
name: 'View',
|
146
146
|
props: {
|
147
147
|
id: 'demo3',
|
148
148
|
class: 'scroll-view-item uni-bg-blue',
|
@@ -25,26 +25,7 @@ const desc: MaterialDescription[] = [
|
|
25
25
|
children: [
|
26
26
|
{
|
27
27
|
name: 'UniBreadcrumbItem',
|
28
|
-
|
29
|
-
to: {
|
30
|
-
type: 'JSExpression',
|
31
|
-
value: 'this.context.item.to'
|
32
|
-
}
|
33
|
-
},
|
34
|
-
children: {
|
35
|
-
type: 'JSExpression',
|
36
|
-
value: 'this.context.item.name'
|
37
|
-
},
|
38
|
-
directives: [
|
39
|
-
{
|
40
|
-
name: 'vFor',
|
41
|
-
value: {
|
42
|
-
type: 'JSExpression',
|
43
|
-
value:
|
44
|
-
'[{to: "/pages/index/index",name: "首页"},{ to: "",name: "菜单 A",},{to: "",name: "菜单 B"}]'
|
45
|
-
}
|
46
|
-
}
|
47
|
-
]
|
28
|
+
children: '首页'
|
48
29
|
}
|
49
30
|
]
|
50
31
|
}
|
@@ -22,22 +22,30 @@ const desc: MaterialDescription[] = [
|
|
22
22
|
events: ['change', 'update:modelValue'],
|
23
23
|
snippet: {
|
24
24
|
props: {
|
25
|
-
|
25
|
+
modelValue: ['0']
|
26
26
|
},
|
27
27
|
children: [
|
28
28
|
{
|
29
29
|
name: 'UniCollapseItem',
|
30
|
-
props: { title: '
|
31
|
-
children: [
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
30
|
+
props: { title: '默认开启"' },
|
31
|
+
children: [
|
32
|
+
{
|
33
|
+
name: 'Text',
|
34
|
+
children:
|
35
|
+
'折叠内容主体,这是一段比较长内容。默认折叠主要内容,只显示当前项标题。点击标题展开,才能看到这段文字。再次点击标题,折叠内容。'
|
36
|
+
}
|
37
|
+
]
|
38
|
+
},
|
39
|
+
{
|
40
|
+
name: 'UniCollapseItem',
|
41
|
+
props: { title: '折叠内容' },
|
42
|
+
children: [
|
43
|
+
{
|
44
|
+
name: 'Text',
|
45
|
+
children:
|
46
|
+
'折叠内容主体,这是一段比较长内容。默认折叠主要内容,只显示当前项标题。点击标题展开,才能看到这段文字。再次点击标题,折叠内容。'
|
47
|
+
}
|
48
|
+
]
|
41
49
|
}
|
42
50
|
]
|
43
51
|
}
|
@@ -100,17 +108,8 @@ const desc: MaterialDescription[] = [
|
|
100
108
|
],
|
101
109
|
slots: ['default', 'title'],
|
102
110
|
snippet: {
|
103
|
-
props: { title: '
|
104
|
-
children: [{ name: 'Text', children: '折叠内容' }]
|
105
|
-
directives: [
|
106
|
-
{
|
107
|
-
name: 'vFor',
|
108
|
-
value: {
|
109
|
-
type: 'JSExpression',
|
110
|
-
value: '2'
|
111
|
-
}
|
112
|
-
}
|
113
|
-
]
|
111
|
+
props: { title: '基本使用' },
|
112
|
+
children: [{ name: 'Text', children: '折叠内容' }]
|
114
113
|
}
|
115
114
|
}
|
116
115
|
];
|
@@ -42,8 +42,8 @@ import searchBar from './searchBar';
|
|
42
42
|
import section from './section';
|
43
43
|
import segmentedControl from './segmentedControl';
|
44
44
|
import steps from './steps';
|
45
|
-
import swipeAction from './swipeAction';
|
46
|
-
import swiperDot from './swiperDot';
|
45
|
+
// import swipeAction from './swipeAction';
|
46
|
+
// import swiperDot from './swiperDot';
|
47
47
|
import table from './table';
|
48
48
|
import tag from './tag';
|
49
49
|
import title from './title';
|
@@ -89,8 +89,8 @@ const components: MaterialDescription[] = [
|
|
89
89
|
section,
|
90
90
|
segmentedControl,
|
91
91
|
steps,
|
92
|
-
swipeAction,
|
93
|
-
swiperDot,
|
92
|
+
// swipeAction,
|
93
|
+
// swiperDot,
|
94
94
|
table,
|
95
95
|
tag,
|
96
96
|
title,
|
@@ -66,7 +66,9 @@ const desc: MaterialDescription[] = [
|
|
66
66
|
}
|
67
67
|
],
|
68
68
|
events: ['change', 'maskClick'],
|
69
|
-
snippet: {
|
69
|
+
snippet: {
|
70
|
+
children: [{ name: 'View', children: 'popup 内容' }]
|
71
|
+
}
|
70
72
|
},
|
71
73
|
{
|
72
74
|
name: 'UniPopupMessage',
|
@@ -95,7 +97,13 @@ const desc: MaterialDescription[] = [
|
|
95
97
|
}
|
96
98
|
],
|
97
99
|
slots: ['default'],
|
98
|
-
snippet: {
|
100
|
+
snippet: {
|
101
|
+
props: {
|
102
|
+
type: 'success',
|
103
|
+
message: '这是一条成功提示',
|
104
|
+
duration: '2000'
|
105
|
+
}
|
106
|
+
}
|
99
107
|
},
|
100
108
|
{
|
101
109
|
name: 'UniPopupDialog',
|
@@ -94,14 +94,28 @@ const desc: MaterialDescription = {
|
|
94
94
|
}
|
95
95
|
]
|
96
96
|
}
|
97
|
-
]
|
98
|
-
|
97
|
+
]
|
98
|
+
},
|
99
|
+
{
|
100
|
+
name: 'SwiperItem',
|
101
|
+
children: [
|
99
102
|
{
|
100
|
-
name: '
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
103
|
+
name: 'View',
|
104
|
+
children: [
|
105
|
+
{
|
106
|
+
name: 'Text',
|
107
|
+
props: {
|
108
|
+
style: {
|
109
|
+
color: '#fff',
|
110
|
+
fontSize: '32px'
|
111
|
+
}
|
112
|
+
},
|
113
|
+
children: {
|
114
|
+
type: 'JSExpression',
|
115
|
+
value: 'this.context.item.name'
|
116
|
+
}
|
117
|
+
}
|
118
|
+
]
|
105
119
|
}
|
106
120
|
]
|
107
121
|
}
|
@@ -71,7 +71,9 @@ const desc: MaterialDescription[] = [
|
|
71
71
|
childIncludes: ['UniTh', 'UniTd'],
|
72
72
|
categoryId: 'ext',
|
73
73
|
props: [],
|
74
|
-
snippet: {
|
74
|
+
snippet: {
|
75
|
+
children: 'tr'
|
76
|
+
}
|
75
77
|
},
|
76
78
|
{
|
77
79
|
name: 'UniTh',
|
@@ -110,7 +112,9 @@ const desc: MaterialDescription[] = [
|
|
110
112
|
}
|
111
113
|
],
|
112
114
|
events: ['sort-change', 'filter-change'],
|
113
|
-
snippet: {
|
115
|
+
snippet: {
|
116
|
+
children: 'th'
|
117
|
+
}
|
114
118
|
},
|
115
119
|
{
|
116
120
|
name: 'UniTd',
|
@@ -125,7 +129,9 @@ const desc: MaterialDescription[] = [
|
|
125
129
|
options: ['left', 'center', 'right']
|
126
130
|
}
|
127
131
|
],
|
128
|
-
snippet: {
|
132
|
+
snippet: {
|
133
|
+
children: 'td'
|
134
|
+
}
|
129
135
|
}
|
130
136
|
];
|
131
137
|
|
@@ -15,7 +15,16 @@ const desc: MaterialDescription = {
|
|
15
15
|
name: 'mode-class',
|
16
16
|
title: '内置过渡动画类型',
|
17
17
|
defaultValue: '',
|
18
|
-
setters: ['ArraySetter', 'StringSetter']
|
18
|
+
setters: ['SelectSetter', 'ArraySetter', 'StringSetter'],
|
19
|
+
options: [
|
20
|
+
'fade',
|
21
|
+
'slide-top',
|
22
|
+
'slide-right',
|
23
|
+
'slide-bottom',
|
24
|
+
'slide-left',
|
25
|
+
'zoom-in',
|
26
|
+
'zoom-out'
|
27
|
+
]
|
19
28
|
},
|
20
29
|
{
|
21
30
|
name: 'custom-class',
|
package/src/uni-ui/index.ts
CHANGED
@@ -7,89 +7,64 @@ import UniBreadcrumb from '@dcloudio/uni-ui/lib/uni-breadcrumb/uni-breadcrumb.vu
|
|
7
7
|
import UniBreadcrumbItem from '@dcloudio/uni-ui/lib/uni-breadcrumb-item/uni-breadcrumb-item.vue';
|
8
8
|
import UniCalendar from '@dcloudio/uni-ui/lib/uni-calendar/uni-calendar.vue';
|
9
9
|
import UniCard from '@dcloudio/uni-ui/lib/uni-card/uni-card.vue';
|
10
|
-
import UniCollapse from '
|
11
|
-
import UniCollapseItem from '
|
10
|
+
import UniCollapse from './lib/uni-collapse/uni-collapse.vue';
|
11
|
+
import UniCollapseItem from './lib/uni-collapse-item/uni-collapse-item.vue';
|
12
12
|
import UniCombox from '@dcloudio/uni-ui/lib/uni-combox/uni-combox.vue';
|
13
13
|
import UniCountdown from '@dcloudio/uni-ui/lib/uni-countdown/uni-countdown.vue';
|
14
14
|
import UniDataCheckbox from '@dcloudio/uni-ui/lib/uni-data-checkbox/uni-data-checkbox.vue';
|
15
|
-
import UniDataPicker from '
|
16
|
-
import UniDataPickerview from '
|
17
|
-
// import UniDataSelect from '@dcloudio/uni-ui/lib/uni-data-select/uni-data-select.vue';
|
15
|
+
import UniDataPicker from './lib/uni-data-picker/uni-data-picker.vue';
|
16
|
+
import UniDataPickerview from './lib/uni-data-pickerview/uni-data-pickerview.vue';
|
18
17
|
import UniDataSelect from './lib/uni-data-select/uni-data-select.vue';
|
19
18
|
import UniDateformat from '@dcloudio/uni-ui/lib/uni-dateformat/uni-dateformat.vue';
|
20
|
-
//? 编译器 原因: 声明了变量多次。第618-620行。
|
21
|
-
// import UniDatetimePicker from '@dcloudio/uni-ui/lib/uni-datetime-picker/uni-datetime-picker.vue';
|
22
19
|
import UniDatetimePicker from './lib/uni-datetime-picker/uni-datetime-picker.vue';
|
23
|
-
//? css 参数。 $uni-bg-color异常。 scss 问题 处理不了 $ 变量
|
24
20
|
import UniDrawer from '@dcloudio/uni-ui/lib/uni-drawer/uni-drawer.vue';
|
25
|
-
//? 条件编译 出现两个组件
|
26
|
-
// import UniEasyinput from '@dcloudio/uni-ui/lib/uni-easyinput/uni-easyinput.vue';
|
27
21
|
import UniEasyinput from './lib/uni-easyinput/uni-easyinput.vue';
|
28
|
-
import
|
29
|
-
import
|
30
|
-
import UniFilePicker from '
|
22
|
+
import UniFab from '@dcloudio/uni-ui/lib/uni-fab/uni-fab.vue';
|
23
|
+
import UniFav from './lib/uni-fav/uni-fav.vue';
|
24
|
+
import UniFilePicker from './lib/uni-file-picker/uni-file-picker.vue';
|
31
25
|
import UniForms from './lib/uni-forms/uni-forms.vue';
|
32
|
-
//? 条件编译 出现两个组件
|
33
|
-
// import UniFormsItem from '@dcloudio/uni-ui/lib/uni-forms-item/uni-forms-item.vue';
|
34
26
|
import UniFormsItem from './lib/uni-forms-item/uni-forms-item.vue';
|
35
27
|
import UniGoodsNav from '@dcloudio/uni-ui/lib/uni-goods-nav/uni-goods-nav.vue';
|
36
|
-
import UniGrid from '
|
28
|
+
import UniGrid from './lib/uni-grid/uni-grid.vue';
|
37
29
|
import UniGridItem from '@dcloudio/uni-ui/lib/uni-grid-item/uni-grid-item.vue';
|
38
30
|
import UniGroup from '@dcloudio/uni-ui/lib/uni-group/uni-group.vue';
|
39
|
-
// import UniIcons from '@dcloudio/uni-ui/lib/uni-icons/uni-icons.vue';
|
40
31
|
import UniIcons from './lib/uni-icons/uni-icons.vue';
|
41
|
-
//? css 参数。 scss 问题 处理不了 $ 变量
|
42
|
-
// import UniIndexedList from '@dcloudio/uni-ui/lib/uni-indexed-list/uni-indexed-list.vue';
|
43
32
|
import UniIndexedList from './lib/uni-indexed-list/uni-indexed-list.vue';
|
44
33
|
import UniLink from '@dcloudio/uni-ui/lib/uni-link/uni-link.vue';
|
45
|
-
// import UniList from '@dcloudio/uni-ui/lib/uni-list/uni-list.vue';
|
46
34
|
import UniList from './lib/uni-list/uni-list.vue';
|
47
35
|
import UniListItem from '@dcloudio/uni-ui/lib/uni-list-item/uni-list-item.vue';
|
48
36
|
import UniListChat from '@dcloudio/uni-ui/lib/uni-list-chat/uni-list-chat.vue';
|
49
|
-
//? css 参数。。 scss 问题 处理不了 $ 变量
|
50
37
|
import UniListAd from '@dcloudio/uni-ui/lib/uni-list-ad/uni-list-ad.vue';
|
51
|
-
import UniLoadMore from '
|
38
|
+
import UniLoadMore from './lib/uni-load-more/uni-load-more.vue';
|
52
39
|
import UniNavBar from '@dcloudio/uni-ui/lib/uni-nav-bar/uni-nav-bar.vue';
|
53
|
-
import UniNoticeBar from '
|
40
|
+
import UniNoticeBar from './lib/uni-notice-bar/uni-notice-bar.vue';
|
54
41
|
import UniNumberBox from '@dcloudio/uni-ui/lib/uni-number-box/uni-number-box.vue';
|
55
42
|
import UniPagination from '@dcloudio/uni-ui/lib/uni-pagination/uni-pagination.vue';
|
56
|
-
//? 编译器 原因: 声明了变量多次。 第228-235行
|
57
|
-
// import UniPopup from '@dcloudio/uni-ui/lib/uni-popup/uni-popup.vue';
|
58
43
|
import UniPopup from './lib/uni-popup/uni-popup.vue';
|
59
|
-
import UniPopupMessage from '
|
44
|
+
import UniPopupMessage from './lib/uni-popup-message/uni-popup-message.vue';
|
45
|
+
import UniPopupDialog from './lib/uni-popup-dialog/uni-popup-dialog.vue';
|
60
46
|
import UniPopupShare from '@dcloudio/uni-ui/lib/uni-popup-share/uni-popup-share.vue';
|
61
|
-
// import UniRate from '@dcloudio/uni-ui/lib/uni-rate/uni-rate.vue';
|
62
47
|
import UniRate from './lib/uni-rate/uni-rate.vue';
|
63
|
-
import UniRow from '
|
64
|
-
// import UniCol from '@dcloudio/uni-ui/lib/uni-col/uni-col.vue';
|
48
|
+
import UniRow from './lib/uni-row/uni-row.vue';
|
65
49
|
import UniCol from './lib/uni-col/uni-col.vue';
|
66
|
-
import UniSearchBar from '
|
50
|
+
import UniSearchBar from './lib/uni-search-bar/uni-search-bar.vue';
|
67
51
|
import UniSection from '@dcloudio/uni-ui/lib/uni-section/uni-section.vue';
|
68
52
|
import UniSegmentedControl from '@dcloudio/uni-ui/lib/uni-segmented-control/uni-segmented-control.vue';
|
69
53
|
import UniSteps from '@dcloudio/uni-ui/lib/uni-steps/uni-steps.vue';
|
70
54
|
import UniSwipeAction from '@dcloudio/uni-ui/lib/uni-swipe-action/uni-swipe-action.vue';
|
71
|
-
//? 多个 script 异常。 保留最后一个。
|
72
|
-
// import UniSwipeActionItem from '@dcloudio/uni-ui/lib/uni-swipe-action-item/uni-swipe-action-item.vue';
|
73
55
|
import UniSwipeActionItem from './lib/uni-swipe-action-item/uni-swipe-action-item.vue';
|
74
56
|
import UniSwiperDot from '@dcloudio/uni-ui/lib/uni-swiper-dot/uni-swiper-dot.vue';
|
75
|
-
// import UniTable from '@dcloudio/uni-ui/lib/uni-table/uni-table.vue';
|
76
57
|
import UniTable from './lib/uni-table/uni-table.vue';
|
77
58
|
import UniThead from '@dcloudio/uni-ui/lib/uni-thead/uni-thead.vue';
|
78
59
|
import UniTBody from '@dcloudio/uni-ui/lib/uni-tbody/uni-tbody.vue';
|
79
|
-
// import UniTr from '@dcloudio/uni-ui/lib/uni-tr/uni-tr.vue';
|
80
60
|
import UniTr from './lib/uni-tr/uni-tr.vue';
|
81
|
-
//? 编译器 原因: 声明了变量多次。 第119行
|
82
|
-
// import UniTh from '@dcloudio/uni-ui/lib/uni-th/uni-th.vue';
|
83
61
|
import UniTh from './lib/uni-th/uni-th.vue';
|
84
62
|
import UniTd from './lib/uni-td/uni-td.vue';
|
85
63
|
import UniTag from '@dcloudio/uni-ui/lib/uni-tag/uni-tag.vue';
|
86
64
|
import UniTitle from '@dcloudio/uni-ui/lib/uni-title/uni-title.vue';
|
87
65
|
import UniTooltip from '@dcloudio/uni-ui/lib/uni-tooltip/uni-tooltip.vue';
|
88
|
-
import UniTransition from '
|
89
|
-
|
90
|
-
import UniPopupDialog from './lib/uni-popup-dialog/uni-popup-dialog.vue';
|
66
|
+
import UniTransition from './lib/uni-transition/uni-transition.vue';
|
91
67
|
|
92
|
-
// 62
|
93
68
|
const components = {
|
94
69
|
UniBadge,
|
95
70
|
UniBreadcrumb,
|
@@ -108,8 +83,8 @@ const components = {
|
|
108
83
|
UniDatetimePicker,
|
109
84
|
UniDrawer,
|
110
85
|
UniEasyinput,
|
111
|
-
|
112
|
-
|
86
|
+
UniFab,
|
87
|
+
UniFav,
|
113
88
|
UniFilePicker,
|
114
89
|
UniForms,
|
115
90
|
UniFormsItem,
|
@@ -173,8 +148,8 @@ export {
|
|
173
148
|
UniDatetimePicker,
|
174
149
|
UniDrawer,
|
175
150
|
UniEasyinput,
|
176
|
-
|
177
|
-
|
151
|
+
UniFab,
|
152
|
+
UniFav,
|
178
153
|
UniFilePicker,
|
179
154
|
UniForms,
|
180
155
|
UniFormsItem,
|
@@ -0,0 +1,153 @@
|
|
1
|
+
<template>
|
2
|
+
<view class="uni-collapse">
|
3
|
+
<slot />
|
4
|
+
</view>
|
5
|
+
</template>
|
6
|
+
<script>
|
7
|
+
/**
|
8
|
+
* Collapse 折叠面板
|
9
|
+
* @description 展示可以折叠 / 展开的内容区域
|
10
|
+
* @tutorial https://ext.dcloud.net.cn/plugin?id=23
|
11
|
+
* @property {String|Array} value 当前激活面板改变时触发(如果是手风琴模式,参数类型为string,否则为array)
|
12
|
+
* @property {Boolean} accordion = [true|false] 是否开启手风琴效果是否开启手风琴效果
|
13
|
+
* @event {Function} change 切换面板时触发,如果是手风琴模式,返回类型为string,否则为array
|
14
|
+
*/
|
15
|
+
export default {
|
16
|
+
name: 'uniCollapse',
|
17
|
+
emits: ['change', 'activeItem', 'input', 'update:modelValue'],
|
18
|
+
props: {
|
19
|
+
// value: {
|
20
|
+
// type: [String, Array],
|
21
|
+
// default: ''
|
22
|
+
// },
|
23
|
+
modelValue: {
|
24
|
+
type: [String, Array],
|
25
|
+
default: ''
|
26
|
+
},
|
27
|
+
accordion: {
|
28
|
+
// 是否开启手风琴效果
|
29
|
+
type: [Boolean, String],
|
30
|
+
default: false
|
31
|
+
}
|
32
|
+
},
|
33
|
+
data() {
|
34
|
+
return {};
|
35
|
+
},
|
36
|
+
computed: {
|
37
|
+
// TODO 兼容 vue2 和 vue3
|
38
|
+
dataValue() {
|
39
|
+
let value =
|
40
|
+
(typeof this.value === 'string' && this.value === '') ||
|
41
|
+
(Array.isArray(this.value) && this.value.length === 0);
|
42
|
+
let modelValue =
|
43
|
+
(typeof this.modelValue === 'string' && this.modelValue === '') ||
|
44
|
+
(Array.isArray(this.modelValue) && this.modelValue.length === 0);
|
45
|
+
if (value) {
|
46
|
+
return this.modelValue;
|
47
|
+
}
|
48
|
+
if (modelValue) {
|
49
|
+
return this.value;
|
50
|
+
}
|
51
|
+
|
52
|
+
return this.value;
|
53
|
+
}
|
54
|
+
},
|
55
|
+
watch: {
|
56
|
+
dataValue(val) {
|
57
|
+
this.setOpen(val);
|
58
|
+
}
|
59
|
+
},
|
60
|
+
created() {
|
61
|
+
this.childrens = [];
|
62
|
+
this.names = [];
|
63
|
+
},
|
64
|
+
mounted() {
|
65
|
+
this.$nextTick(() => {
|
66
|
+
this.setOpen(this.dataValue);
|
67
|
+
});
|
68
|
+
},
|
69
|
+
methods: {
|
70
|
+
setOpen(val) {
|
71
|
+
let str = typeof val === 'string';
|
72
|
+
let arr = Array.isArray(val);
|
73
|
+
this.childrens.forEach((vm, index) => {
|
74
|
+
if (str) {
|
75
|
+
if (val === vm.nameSync) {
|
76
|
+
if (!this.accordion) {
|
77
|
+
console.warn(
|
78
|
+
'accordion 属性为 false ,v-model 类型应该为 array'
|
79
|
+
);
|
80
|
+
return;
|
81
|
+
}
|
82
|
+
vm.isOpen = true;
|
83
|
+
}
|
84
|
+
}
|
85
|
+
if (arr) {
|
86
|
+
val.forEach((v) => {
|
87
|
+
if (v === vm.nameSync) {
|
88
|
+
if (this.accordion) {
|
89
|
+
console.warn(
|
90
|
+
'accordion 属性为 true ,v-model 类型应该为 string'
|
91
|
+
);
|
92
|
+
return;
|
93
|
+
}
|
94
|
+
vm.isOpen = true;
|
95
|
+
}
|
96
|
+
});
|
97
|
+
}
|
98
|
+
});
|
99
|
+
this.emit(val);
|
100
|
+
},
|
101
|
+
setAccordion(self) {
|
102
|
+
if (!this.accordion) return;
|
103
|
+
this.childrens.forEach((vm, index) => {
|
104
|
+
if (self !== vm) {
|
105
|
+
vm.isOpen = false;
|
106
|
+
}
|
107
|
+
});
|
108
|
+
},
|
109
|
+
resize() {
|
110
|
+
this.childrens.forEach((vm, index) => {
|
111
|
+
// #ifndef APP-NVUE
|
112
|
+
vm.getCollapseHeight();
|
113
|
+
// #endif
|
114
|
+
// #ifdef APP-NVUE
|
115
|
+
// vm.getNvueHwight()
|
116
|
+
// #endif
|
117
|
+
});
|
118
|
+
},
|
119
|
+
onChange(isOpen, self) {
|
120
|
+
let activeItem = [];
|
121
|
+
|
122
|
+
if (this.accordion) {
|
123
|
+
activeItem = isOpen ? self.nameSync : '';
|
124
|
+
} else {
|
125
|
+
this.childrens.forEach((vm, index) => {
|
126
|
+
if (vm.isOpen) {
|
127
|
+
activeItem.push(vm.nameSync);
|
128
|
+
}
|
129
|
+
});
|
130
|
+
}
|
131
|
+
this.$emit('change', activeItem);
|
132
|
+
this.emit(activeItem);
|
133
|
+
},
|
134
|
+
emit(val) {
|
135
|
+
this.$emit('input', val);
|
136
|
+
this.$emit('update:modelValue', val);
|
137
|
+
}
|
138
|
+
}
|
139
|
+
};
|
140
|
+
</script>
|
141
|
+
<style lang="scss">
|
142
|
+
.uni-collapse {
|
143
|
+
/* #ifndef APP-NVUE */
|
144
|
+
width: 100%;
|
145
|
+
display: flex;
|
146
|
+
/* #endif */
|
147
|
+
/* #ifdef APP-NVUE */
|
148
|
+
flex: 1;
|
149
|
+
/* #endif */
|
150
|
+
flex-direction: column;
|
151
|
+
background-color: #fff;
|
152
|
+
}
|
153
|
+
</style>
|