@easy-editor/materials-dashboard-carousel 0.0.3 → 0.0.4
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/CHANGELOG.md +8 -0
- package/dist/component.min.js +1 -2
- package/dist/index.min.js +1 -2
- package/dist/meta.min.js +1 -2
- package/easypack.config.ts +10 -0
- package/package.json +4 -8
- package/src/component.tsx +217 -174
- package/src/configure.ts +97 -194
- package/src/index.tsx +7 -7
- package/src/meta.ts +26 -28
- package/src/snippets.ts +70 -60
- package/tsconfig.json +20 -9
- package/.vite/plugins/vite-plugin-external-deps.ts +0 -224
- package/.vite/plugins/vite-plugin-material-dev.ts +0 -218
- package/dist/component.esm.js +0 -178
- package/dist/component.esm.js.map +0 -1
- package/dist/component.js +0 -186
- package/dist/component.js.map +0 -1
- package/dist/component.min.js.map +0 -1
- package/dist/index.cjs +0 -418
- package/dist/index.cjs.map +0 -1
- package/dist/index.esm.js +0 -415
- package/dist/index.esm.js.map +0 -1
- package/dist/index.js +0 -422
- package/dist/index.js.map +0 -1
- package/dist/index.min.js.map +0 -1
- package/dist/meta.esm.js +0 -241
- package/dist/meta.esm.js.map +0 -1
- package/dist/meta.js +0 -252
- package/dist/meta.js.map +0 -1
- package/dist/meta.min.js.map +0 -1
- package/dist/src/component.d.ts +0 -32
- package/dist/src/configure.d.ts +0 -7
- package/dist/src/constants.d.ts +0 -16
- package/dist/src/index.d.ts +0 -6
- package/dist/src/meta.d.ts +0 -7
- package/dist/src/snippets.d.ts +0 -7
- package/rollup.config.js +0 -222
- package/tsconfig.build.json +0 -12
- package/tsconfig.test.json +0 -7
- package/vite.config.ts +0 -54
package/src/configure.ts
CHANGED
|
@@ -1,194 +1,97 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Carousel Configure
|
|
3
|
-
* 轮播组件配置
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import type {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
icon: false,
|
|
99
|
-
},
|
|
100
|
-
},
|
|
101
|
-
items: [
|
|
102
|
-
{
|
|
103
|
-
name: 'autoPlay',
|
|
104
|
-
title: '自动播放',
|
|
105
|
-
setter: 'SwitchSetter',
|
|
106
|
-
extraProps: {
|
|
107
|
-
defaultValue: true,
|
|
108
|
-
},
|
|
109
|
-
},
|
|
110
|
-
{
|
|
111
|
-
name: 'interval',
|
|
112
|
-
title: '播放间隔(ms)',
|
|
113
|
-
setter: 'NumberSetter',
|
|
114
|
-
extraProps: {
|
|
115
|
-
defaultValue: 3000,
|
|
116
|
-
},
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
name: 'loop',
|
|
120
|
-
title: '循环播放',
|
|
121
|
-
setter: 'SwitchSetter',
|
|
122
|
-
extraProps: {
|
|
123
|
-
defaultValue: true,
|
|
124
|
-
},
|
|
125
|
-
},
|
|
126
|
-
],
|
|
127
|
-
},
|
|
128
|
-
{
|
|
129
|
-
type: 'group',
|
|
130
|
-
title: '显示',
|
|
131
|
-
setter: {
|
|
132
|
-
componentName: 'CollapseSetter',
|
|
133
|
-
props: {
|
|
134
|
-
icon: false,
|
|
135
|
-
},
|
|
136
|
-
},
|
|
137
|
-
items: [
|
|
138
|
-
{
|
|
139
|
-
name: 'showNav',
|
|
140
|
-
title: '显示导航按钮',
|
|
141
|
-
setter: 'SwitchSetter',
|
|
142
|
-
extraProps: {
|
|
143
|
-
defaultValue: true,
|
|
144
|
-
},
|
|
145
|
-
},
|
|
146
|
-
{
|
|
147
|
-
name: 'showIndicators',
|
|
148
|
-
title: '显示指示器',
|
|
149
|
-
setter: 'SwitchSetter',
|
|
150
|
-
extraProps: {
|
|
151
|
-
defaultValue: true,
|
|
152
|
-
},
|
|
153
|
-
},
|
|
154
|
-
],
|
|
155
|
-
},
|
|
156
|
-
],
|
|
157
|
-
},
|
|
158
|
-
{
|
|
159
|
-
type: 'group',
|
|
160
|
-
key: 'data',
|
|
161
|
-
title: '数据',
|
|
162
|
-
items: [
|
|
163
|
-
{
|
|
164
|
-
name: 'dataBinding',
|
|
165
|
-
title: '数据绑定',
|
|
166
|
-
setter: 'DataBindingSetter',
|
|
167
|
-
},
|
|
168
|
-
],
|
|
169
|
-
},
|
|
170
|
-
{
|
|
171
|
-
type: 'group',
|
|
172
|
-
key: 'advanced',
|
|
173
|
-
title: '高级',
|
|
174
|
-
items: [
|
|
175
|
-
{
|
|
176
|
-
name: 'condition',
|
|
177
|
-
title: '显隐控制',
|
|
178
|
-
setter: 'SwitchSetter',
|
|
179
|
-
extraProps: {
|
|
180
|
-
defaultValue: true,
|
|
181
|
-
supportVariable: true,
|
|
182
|
-
},
|
|
183
|
-
},
|
|
184
|
-
],
|
|
185
|
-
},
|
|
186
|
-
],
|
|
187
|
-
},
|
|
188
|
-
],
|
|
189
|
-
component: {},
|
|
190
|
-
supports: {},
|
|
191
|
-
advanced: {},
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
export default configure
|
|
1
|
+
/**
|
|
2
|
+
* Carousel Configure
|
|
3
|
+
* 轮播组件配置
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { FieldConfig } from '@easy-editor/core'
|
|
7
|
+
import { createCollapseGroup, createDataConfigGroup, createStandardConfigure } from '@easy-editor/materials-shared'
|
|
8
|
+
|
|
9
|
+
/** 组件配置 - 轮播独有 */
|
|
10
|
+
const componentConfigGroup: FieldConfig = createCollapseGroup(
|
|
11
|
+
'组件配置',
|
|
12
|
+
[
|
|
13
|
+
{
|
|
14
|
+
type: 'group',
|
|
15
|
+
title: '组件配置',
|
|
16
|
+
setter: 'SubTabSetter',
|
|
17
|
+
items: [
|
|
18
|
+
// 行为 Tab
|
|
19
|
+
{
|
|
20
|
+
type: 'group',
|
|
21
|
+
key: 'behavior',
|
|
22
|
+
title: '行为',
|
|
23
|
+
items: [
|
|
24
|
+
{
|
|
25
|
+
name: 'autoPlay',
|
|
26
|
+
title: '自动播放',
|
|
27
|
+
setter: 'SwitchSetter',
|
|
28
|
+
extraProps: {
|
|
29
|
+
defaultValue: true,
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: 'interval',
|
|
34
|
+
title: '播放间隔',
|
|
35
|
+
setter: {
|
|
36
|
+
componentName: 'SliderSetter',
|
|
37
|
+
props: {
|
|
38
|
+
min: 1000,
|
|
39
|
+
max: 10000,
|
|
40
|
+
step: 500,
|
|
41
|
+
suffix: 'ms',
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
extraProps: {
|
|
45
|
+
defaultValue: 3000,
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
name: 'loop',
|
|
50
|
+
title: '循环播放',
|
|
51
|
+
setter: 'SwitchSetter',
|
|
52
|
+
extraProps: {
|
|
53
|
+
defaultValue: true,
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
},
|
|
58
|
+
// 显示 Tab
|
|
59
|
+
{
|
|
60
|
+
type: 'group',
|
|
61
|
+
key: 'display',
|
|
62
|
+
title: '显示',
|
|
63
|
+
items: [
|
|
64
|
+
{
|
|
65
|
+
name: 'showNav',
|
|
66
|
+
title: '显示导航按钮',
|
|
67
|
+
setter: 'SwitchSetter',
|
|
68
|
+
extraProps: {
|
|
69
|
+
defaultValue: true,
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
name: 'showIndicators',
|
|
74
|
+
title: '显示指示器',
|
|
75
|
+
setter: 'SwitchSetter',
|
|
76
|
+
extraProps: {
|
|
77
|
+
defaultValue: true,
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
],
|
|
81
|
+
},
|
|
82
|
+
],
|
|
83
|
+
},
|
|
84
|
+
],
|
|
85
|
+
{
|
|
86
|
+
padding: '6px 16px 12px',
|
|
87
|
+
},
|
|
88
|
+
)
|
|
89
|
+
|
|
90
|
+
/** 数据配置 */
|
|
91
|
+
const dataConfigGroup: FieldConfig = createDataConfigGroup([
|
|
92
|
+
{ name: 'src', label: 'src', type: 'string', required: true, description: '图片地址' },
|
|
93
|
+
{ name: 'alt', label: 'alt', type: 'string', required: false, description: '图片描述' },
|
|
94
|
+
{ name: 'link', label: 'link', type: 'string', required: false, description: '点击链接' },
|
|
95
|
+
])
|
|
96
|
+
|
|
97
|
+
export const configure = createStandardConfigure(componentConfigGroup, dataConfigGroup)
|
package/src/index.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Carousel Entry
|
|
3
|
-
* 轮播组件入口
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
export { Carousel as component } from './component'
|
|
7
|
-
export {
|
|
1
|
+
/**
|
|
2
|
+
* Carousel Entry
|
|
3
|
+
* 轮播组件入口
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export { Carousel as component } from './component'
|
|
7
|
+
export { meta } from './meta'
|
package/src/meta.ts
CHANGED
|
@@ -1,28 +1,26 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Carousel Meta
|
|
3
|
-
* 轮播组件元数据
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import type { ComponentMetadata } from '@easy-editor/core'
|
|
7
|
-
import { MaterialGroup } from '@easy-editor/materials-shared'
|
|
8
|
-
import { COMPONENT_NAME, PACKAGE_NAME } from './constants'
|
|
9
|
-
import configure from './configure'
|
|
10
|
-
import snippets from './snippets'
|
|
11
|
-
import pkg from '../package.json'
|
|
12
|
-
|
|
13
|
-
export const meta: ComponentMetadata = {
|
|
14
|
-
componentName: COMPONENT_NAME,
|
|
15
|
-
title: '轮播',
|
|
16
|
-
group: MaterialGroup.DISPLAY,
|
|
17
|
-
devMode: 'proCode',
|
|
18
|
-
npm: {
|
|
19
|
-
package: PACKAGE_NAME,
|
|
20
|
-
version: pkg.version,
|
|
21
|
-
globalName: COMPONENT_NAME,
|
|
22
|
-
componentName: COMPONENT_NAME,
|
|
23
|
-
},
|
|
24
|
-
snippets,
|
|
25
|
-
configure,
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export default meta
|
|
1
|
+
/**
|
|
2
|
+
* Carousel Meta
|
|
3
|
+
* 轮播组件元数据
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { ComponentMetadata } from '@easy-editor/core'
|
|
7
|
+
import { MaterialGroup } from '@easy-editor/materials-shared'
|
|
8
|
+
import { COMPONENT_NAME, PACKAGE_NAME } from './constants'
|
|
9
|
+
import { configure } from './configure'
|
|
10
|
+
import { snippets } from './snippets'
|
|
11
|
+
import pkg from '../package.json'
|
|
12
|
+
|
|
13
|
+
export const meta: ComponentMetadata = {
|
|
14
|
+
componentName: COMPONENT_NAME,
|
|
15
|
+
title: '轮播',
|
|
16
|
+
group: MaterialGroup.DISPLAY,
|
|
17
|
+
devMode: 'proCode',
|
|
18
|
+
npm: {
|
|
19
|
+
package: PACKAGE_NAME,
|
|
20
|
+
version: pkg.version,
|
|
21
|
+
globalName: COMPONENT_NAME,
|
|
22
|
+
componentName: COMPONENT_NAME,
|
|
23
|
+
},
|
|
24
|
+
snippets,
|
|
25
|
+
configure,
|
|
26
|
+
}
|
package/src/snippets.ts
CHANGED
|
@@ -1,60 +1,70 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Carousel Snippets
|
|
3
|
-
* 轮播组件代码片段
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import type { Snippet } from '@easy-editor/core'
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Carousel Snippets
|
|
3
|
+
* 轮播组件代码片段 - 使用共享数据源生成函数
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { Snippet } from '@easy-editor/core'
|
|
7
|
+
import { generateStaticDataSource } from '@easy-editor/materials-shared'
|
|
8
|
+
import { COMPONENT_NAME } from './constants'
|
|
9
|
+
|
|
10
|
+
/** 默认轮播数据 */
|
|
11
|
+
const DEFAULT_CAROUSEL_DATA = [
|
|
12
|
+
{ src: 'https://picsum.photos/800/400?random=1', alt: 'Slide 1' },
|
|
13
|
+
{ src: 'https://picsum.photos/800/400?random=2', alt: 'Slide 2' },
|
|
14
|
+
{ src: 'https://picsum.photos/800/400?random=3', alt: 'Slide 3' },
|
|
15
|
+
]
|
|
16
|
+
|
|
17
|
+
export const snippets: Snippet[] = [
|
|
18
|
+
{
|
|
19
|
+
title: '图片轮播',
|
|
20
|
+
screenshot: '',
|
|
21
|
+
schema: {
|
|
22
|
+
componentName: COMPONENT_NAME,
|
|
23
|
+
title: '图片轮播',
|
|
24
|
+
props: {
|
|
25
|
+
$data: generateStaticDataSource(DEFAULT_CAROUSEL_DATA),
|
|
26
|
+
autoPlay: true,
|
|
27
|
+
interval: 3000,
|
|
28
|
+
showNav: true,
|
|
29
|
+
showIndicators: true,
|
|
30
|
+
loop: true,
|
|
31
|
+
rotation: 0,
|
|
32
|
+
opacity: 100,
|
|
33
|
+
background: 'transparent',
|
|
34
|
+
},
|
|
35
|
+
$dashboard: {
|
|
36
|
+
rect: {
|
|
37
|
+
width: 600,
|
|
38
|
+
height: 300,
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
title: '手动轮播',
|
|
45
|
+
screenshot: '',
|
|
46
|
+
schema: {
|
|
47
|
+
componentName: COMPONENT_NAME,
|
|
48
|
+
title: '手动轮播',
|
|
49
|
+
props: {
|
|
50
|
+
$data: generateStaticDataSource([
|
|
51
|
+
{ src: 'https://picsum.photos/800/400?random=4', alt: 'Slide 1' },
|
|
52
|
+
{ src: 'https://picsum.photos/800/400?random=5', alt: 'Slide 2' },
|
|
53
|
+
]),
|
|
54
|
+
autoPlay: false,
|
|
55
|
+
showNav: true,
|
|
56
|
+
showIndicators: true,
|
|
57
|
+
loop: true,
|
|
58
|
+
rotation: 0,
|
|
59
|
+
opacity: 100,
|
|
60
|
+
background: 'transparent',
|
|
61
|
+
},
|
|
62
|
+
$dashboard: {
|
|
63
|
+
rect: {
|
|
64
|
+
width: 600,
|
|
65
|
+
height: 300,
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
]
|
package/tsconfig.json
CHANGED
|
@@ -1,9 +1,20 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"emitDeclarationOnly": true,
|
|
4
|
+
"declaration": true,
|
|
5
|
+
"target": "ESNext",
|
|
6
|
+
"newLine": "LF",
|
|
7
|
+
"module": "ESNext",
|
|
8
|
+
"moduleResolution": "Bundler",
|
|
9
|
+
"strict": true,
|
|
10
|
+
"strictNullChecks": true,
|
|
11
|
+
"jsx": "react-jsx",
|
|
12
|
+
"esModuleInterop": true,
|
|
13
|
+
"allowSyntheticDefaultImports": true,
|
|
14
|
+
"strictPropertyInitialization": false,
|
|
15
|
+
"outDir": "./dist",
|
|
16
|
+
"skipLibCheck": true,
|
|
17
|
+
},
|
|
18
|
+
"exclude": ["node_modules", "dist"],
|
|
19
|
+
"include": ["./src"]
|
|
20
|
+
}
|