@dckj-npm/dc-material 0.1.35 → 0.1.36
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/README.md +17 -17
- package/build/index.js +8 -8
- package/build/lowcode/assets-daily.json +71 -0
- package/build/lowcode/assets-dev.json +71 -0
- package/build/lowcode/assets-prod.json +71 -0
- package/build/lowcode/designer.html +302 -0
- package/build/lowcode/index.html +304 -0
- package/build/lowcode/index.js +1 -0
- package/build/lowcode/meta.design.js +1 -0
- package/build/lowcode/meta.js +1 -0
- package/build/lowcode/preview.css +1 -0
- package/build/lowcode/preview.html +33 -0
- package/build/lowcode/preview.js +308 -0
- package/build/lowcode/render/default/view.css +1 -0
- package/build/lowcode/render/default/view.js +295 -0
- package/build/lowcode/view.css +1 -0
- package/build/lowcode/view.js +295 -0
- package/dist/BizComps.js +5 -5
- package/dist/BizComps.js.map +1 -1
- package/es/components/bottom-navigation/bottom-navigation.d.ts +15 -15
- package/es/components/bottom-navigation/index.d.ts +3 -3
- package/es/components/bottom-navigation/index.scss +24 -24
- package/es/components/button/button.d.ts +14 -14
- package/es/components/button/index.d.ts +6 -6
- package/es/components/button/index.js +2 -2
- package/es/components/button/index.scss +16 -16
- package/es/components/carousel/carousel.d.ts +14 -14
- package/es/components/carousel/carousel.scss +32 -32
- package/es/components/colorful-button/colorful-button.d.ts +12 -12
- package/es/components/colorful-button/index.d.ts +3 -3
- package/es/components/colorful-button/index.scss +5 -5
- package/es/components/colorful-input/colorful-input.d.ts +8 -8
- package/es/components/colorful-input/index.d.ts +3 -3
- package/es/components/colorful-input/index.scss +5 -5
- package/es/components/goods-card-list/goods-card-list.d.ts +5 -5
- package/es/components/goods-card-list/goods-card-list.scss +112 -112
- package/es/components/goods-card-list/index.d.ts +3 -3
- package/es/components/goods-card-list/types.d.ts +45 -45
- package/es/components/grid-nav/grid-nav.d.ts +13 -13
- package/es/components/grid-nav/index.d.ts +3 -3
- package/es/components/grid-nav/index.scss +37 -37
- package/es/components/integral-task/index.d.ts +6 -6
- package/es/components/integral-task/index.js +2 -2
- package/es/components/integral-task/index.scss +35 -35
- package/es/components/integral-task/integral-task.d.ts +40 -40
- package/es/components/menu-list/index.d.ts +6 -6
- package/es/components/menu-list/index.js +2 -2
- package/es/components/menu-list/index.scss +16 -16
- package/es/components/menu-list/menu-list-item.d.ts +5 -5
- package/es/components/menu-list/menu-list-item.scss +49 -49
- package/es/components/menu-list/menu-list.d.ts +5 -5
- package/es/components/menu-list/types.d.ts +23 -23
- package/es/components/message-list/index.d.ts +6 -6
- package/es/components/message-list/index.js +2 -2
- package/es/components/message-list/index.scss +22 -22
- package/es/components/message-list/message-list-item.d.ts +29 -29
- package/es/components/message-list/message-list-item.js +2 -2
- package/es/components/message-list/message-list-item.scss +50 -50
- package/es/components/message-list/message-list.d.ts +32 -32
- package/es/components/notice-bar/index.d.ts +3 -3
- package/es/components/notice-bar/index.scss +29 -29
- package/es/components/notice-bar/notice-bar-item.d.ts +18 -18
- package/es/components/notice-bar/notice-bar-item.scss +26 -26
- package/es/components/notice-bar/notice-bar.d.ts +37 -37
- package/es/components/position/entity.d.ts +5 -5
- package/es/components/position/index.d.ts +3 -3
- package/es/components/position/index.scss +27 -27
- package/es/components/position/position-left.d.ts +9 -9
- package/es/components/position/position-list.d.ts +12 -12
- package/es/components/position/position.d.ts +8 -8
- package/es/components/radio-group/index.d.ts +8 -8
- package/es/components/radio-group/index.js +2 -2
- package/es/components/radio-group/index.scss +40 -40
- package/es/components/radio-group/radio-group-item.d.ts +48 -48
- package/es/components/radio-group/radio-group.d.ts +52 -52
- package/es/components/search-bar/index.d.ts +3 -3
- package/es/components/search-bar/index.scss +13 -13
- package/es/components/search-bar/search-bar.d.ts +7 -7
- package/es/components/swiper/index.d.ts +3 -3
- package/es/components/swiper/index.scss +12 -12
- package/es/components/swiper/swiper.d.ts +47 -47
- package/es/components/tab/index.d.ts +6 -6
- package/es/components/tab/index.js +2 -2
- package/es/components/tab/index.scss +23 -23
- package/es/components/tab/tab.d.ts +23 -23
- package/es/components/tab-container/index.d.ts +3 -3
- package/es/components/tab-container/index.scss +47 -47
- package/es/components/tab-container/tab-container.d.ts +10 -10
- package/es/components/tab-container-item/index.d.ts +3 -3
- package/es/components/tab-container-item/tab-container-item.d.ts +9 -9
- package/es/components/tag/index.d.ts +6 -6
- package/es/components/tag/index.js +2 -2
- package/es/components/tag/index.scss +24 -24
- package/es/components/tag/tag.d.ts +14 -14
- package/es/components/teletext-list/index.d.ts +6 -6
- package/es/components/teletext-list/index.js +2 -2
- package/es/components/teletext-list/index.scss +19 -19
- package/es/components/teletext-list/teletext-list-item.d.ts +42 -42
- package/es/components/teletext-list/teletext-list-item.js +2 -2
- package/es/components/teletext-list/teletext-list-item.scss +55 -55
- package/es/components/teletext-list/teletext-list.d.ts +61 -61
- package/es/components/teletext-list/teletext-list.js +2 -2
- package/es/components/title/index.d.ts +8 -8
- package/es/components/title/index.js +2 -2
- package/es/components/title/title-1.d.ts +10 -10
- package/es/components/title/title-1.scss +25 -25
- package/es/components/title/title-2.d.ts +18 -18
- package/es/components/title/title-2.scss +22 -22
- package/es/index.d.ts +40 -40
- package/es/index.scss +5 -5
- package/es/utils/children-node-handle.d.ts +9 -9
- package/es/utils/children-node-handle.js +7 -7
- package/es/utils/component-wrapper.d.ts +9 -9
- package/es/utils/debounce.d.ts +1 -1
- package/es/variables.d.ts +2 -2
- package/es/variables.scss +3 -3
- package/lib/components/bottom-navigation/bottom-navigation.d.ts +15 -15
- package/lib/components/bottom-navigation/index.d.ts +3 -3
- package/lib/components/bottom-navigation/index.scss +24 -24
- package/lib/components/button/button.d.ts +14 -14
- package/lib/components/button/index.d.ts +6 -6
- package/lib/components/button/index.js +2 -2
- package/lib/components/button/index.scss +16 -16
- package/lib/components/carousel/carousel.d.ts +14 -14
- package/lib/components/carousel/carousel.scss +32 -32
- package/lib/components/colorful-button/colorful-button.d.ts +12 -12
- package/lib/components/colorful-button/index.d.ts +3 -3
- package/lib/components/colorful-button/index.scss +5 -5
- package/lib/components/colorful-input/colorful-input.d.ts +8 -8
- package/lib/components/colorful-input/index.d.ts +3 -3
- package/lib/components/colorful-input/index.scss +5 -5
- package/lib/components/goods-card-list/goods-card-list.d.ts +5 -5
- package/lib/components/goods-card-list/goods-card-list.scss +112 -112
- package/lib/components/goods-card-list/index.d.ts +3 -3
- package/lib/components/goods-card-list/types.d.ts +45 -45
- package/lib/components/grid-nav/grid-nav.d.ts +13 -13
- package/lib/components/grid-nav/index.d.ts +3 -3
- package/lib/components/grid-nav/index.scss +37 -37
- package/lib/components/integral-task/index.d.ts +6 -6
- package/lib/components/integral-task/index.js +2 -2
- package/lib/components/integral-task/index.scss +35 -35
- package/lib/components/integral-task/integral-task.d.ts +40 -40
- package/lib/components/menu-list/index.d.ts +6 -6
- package/lib/components/menu-list/index.js +2 -2
- package/lib/components/menu-list/index.scss +16 -16
- package/lib/components/menu-list/menu-list-item.d.ts +5 -5
- package/lib/components/menu-list/menu-list-item.scss +49 -49
- package/lib/components/menu-list/menu-list.d.ts +5 -5
- package/lib/components/menu-list/types.d.ts +23 -23
- package/lib/components/message-list/index.d.ts +6 -6
- package/lib/components/message-list/index.js +2 -2
- package/lib/components/message-list/index.scss +22 -22
- package/lib/components/message-list/message-list-item.d.ts +29 -29
- package/lib/components/message-list/message-list-item.js +2 -2
- package/lib/components/message-list/message-list-item.scss +50 -50
- package/lib/components/message-list/message-list.d.ts +32 -32
- package/lib/components/notice-bar/index.d.ts +3 -3
- package/lib/components/notice-bar/index.scss +29 -29
- package/lib/components/notice-bar/notice-bar-item.d.ts +18 -18
- package/lib/components/notice-bar/notice-bar-item.scss +26 -26
- package/lib/components/notice-bar/notice-bar.d.ts +37 -37
- package/lib/components/position/entity.d.ts +5 -5
- package/lib/components/position/index.d.ts +3 -3
- package/lib/components/position/index.scss +27 -27
- package/lib/components/position/position-left.d.ts +9 -9
- package/lib/components/position/position-list.d.ts +12 -12
- package/lib/components/position/position.d.ts +8 -8
- package/lib/components/radio-group/index.d.ts +8 -8
- package/lib/components/radio-group/index.scss +40 -40
- package/lib/components/radio-group/radio-group-item.d.ts +48 -48
- package/lib/components/radio-group/radio-group.d.ts +52 -52
- package/lib/components/search-bar/index.d.ts +3 -3
- package/lib/components/search-bar/index.scss +13 -13
- package/lib/components/search-bar/search-bar.d.ts +7 -7
- package/lib/components/swiper/index.d.ts +3 -3
- package/lib/components/swiper/index.scss +12 -12
- package/lib/components/swiper/swiper.d.ts +47 -47
- package/lib/components/tab/index.d.ts +6 -6
- package/lib/components/tab/index.js +2 -2
- package/lib/components/tab/index.scss +23 -23
- package/lib/components/tab/tab.d.ts +23 -23
- package/lib/components/tab-container/index.d.ts +3 -3
- package/lib/components/tab-container/index.scss +47 -47
- package/lib/components/tab-container/tab-container.d.ts +10 -10
- package/lib/components/tab-container-item/index.d.ts +3 -3
- package/lib/components/tab-container-item/tab-container-item.d.ts +9 -9
- package/lib/components/tag/index.d.ts +6 -6
- package/lib/components/tag/index.js +2 -2
- package/lib/components/tag/index.scss +24 -24
- package/lib/components/tag/tag.d.ts +14 -14
- package/lib/components/teletext-list/index.d.ts +6 -6
- package/lib/components/teletext-list/index.scss +19 -19
- package/lib/components/teletext-list/teletext-list-item.d.ts +42 -42
- package/lib/components/teletext-list/teletext-list-item.js +2 -2
- package/lib/components/teletext-list/teletext-list-item.scss +55 -55
- package/lib/components/teletext-list/teletext-list.d.ts +61 -61
- package/lib/components/teletext-list/teletext-list.js +2 -2
- package/lib/components/title/index.d.ts +8 -8
- package/lib/components/title/title-1.d.ts +10 -10
- package/lib/components/title/title-1.scss +25 -25
- package/lib/components/title/title-2.d.ts +18 -18
- package/lib/components/title/title-2.scss +22 -22
- package/lib/index.d.ts +40 -40
- package/lib/index.scss +5 -5
- package/lib/utils/children-node-handle.d.ts +9 -9
- package/lib/utils/children-node-handle.js +7 -7
- package/lib/utils/component-wrapper.d.ts +9 -9
- package/lib/utils/debounce.d.ts +1 -1
- package/lib/variables.d.ts +2 -2
- package/lib/variables.scss +3 -3
- package/lowcode/button2/meta.ts +75 -75
- package/lowcode/custom-radio-group/meta.ts +310 -310
- package/lowcode/custom-radio-group-item/meta.ts +229 -229
- package/lowcode/d-c-slider/meta.design.ts +173 -173
- package/lowcode/d-c-slider/meta.ts +342 -342
- package/lowcode/d-c-slider/snippets.ts +68 -68
- package/lowcode/goods-card-list/meta.ts +268 -268
- package/lowcode/grid-nav/meta.ts +212 -212
- package/lowcode/integral-task/meta.ts +211 -211
- package/lowcode/menu-list/meta.ts +147 -147
- package/lowcode/message-list/meta.ts +202 -202
- package/lowcode/navigation/meta.ts +173 -173
- package/lowcode/notice-bar/meta.ts +229 -229
- package/lowcode/position/meta.ts +161 -161
- package/lowcode/search-bar/meta.ts +54 -54
- package/lowcode/swiper/meta.ts +237 -237
- package/lowcode/tab-container/meta.ts +69 -69
- package/lowcode/tab-container/props.ts +194 -194
- package/lowcode/tab-container-item/meta.ts +195 -195
- package/lowcode/tab-message/meta.ts +101 -101
- package/lowcode/tag-c/meta.ts +75 -75
- package/lowcode/teletext-list/meta.ts +329 -329
- package/lowcode/title1/meta.ts +59 -59
- package/lowcode/title2/meta.ts +93 -93
- package/lowcode_es/button2/meta.d.ts +22 -22
- package/lowcode_es/custom-radio-group/meta.d.ts +22 -0
- package/lowcode_es/custom-radio-group/meta.js +294 -0
- package/lowcode_es/custom-radio-group-item/meta.d.ts +23 -0
- package/lowcode_es/custom-radio-group-item/meta.js +205 -0
- package/lowcode_es/d-c-slider/meta.d.ts +148 -148
- package/lowcode_es/d-c-slider/meta.design.d.ts +100 -100
- package/lowcode_es/d-c-slider/snippets.d.ts +36 -36
- package/lowcode_es/goods-card-list/meta.d.ts +22 -0
- package/lowcode_es/goods-card-list/meta.js +250 -0
- package/lowcode_es/grid-nav/meta.d.ts +22 -22
- package/lowcode_es/integral-task/meta.d.ts +22 -22
- package/lowcode_es/menu-list/meta.d.ts +22 -22
- package/lowcode_es/message-list/meta.d.ts +22 -22
- package/lowcode_es/message-list/meta.js +4 -9
- package/lowcode_es/meta.js +23 -20
- package/lowcode_es/navigation/meta.d.ts +22 -22
- package/lowcode_es/notice-bar/meta.d.ts +22 -22
- package/lowcode_es/notice-bar/meta.js +16 -13
- package/lowcode_es/position/meta.d.ts +22 -22
- package/lowcode_es/search-bar/meta.d.ts +22 -22
- package/lowcode_es/swiper/meta.d.ts +22 -22
- package/lowcode_es/tab-container/meta.d.ts +22 -22
- package/lowcode_es/tab-container/props.d.ts +90 -90
- package/lowcode_es/tab-container-item/meta.d.ts +22 -22
- package/lowcode_es/tab-message/meta.d.ts +22 -22
- package/lowcode_es/tag-c/meta.d.ts +22 -22
- package/lowcode_es/teletext-list/meta.d.ts +22 -22
- package/lowcode_es/title1/meta.d.ts +22 -22
- package/lowcode_es/title2/meta.d.ts +22 -22
- package/lowcode_es/view.js +3 -3
- package/lowcode_lib/button2/meta.d.ts +22 -22
- package/lowcode_lib/custom-radio-group/meta.d.ts +22 -0
- package/lowcode_lib/custom-radio-group/meta.js +299 -0
- package/lowcode_lib/custom-radio-group-item/meta.d.ts +23 -0
- package/lowcode_lib/custom-radio-group-item/meta.js +210 -0
- package/lowcode_lib/d-c-slider/meta.d.ts +148 -148
- package/lowcode_lib/d-c-slider/meta.design.d.ts +100 -100
- package/lowcode_lib/d-c-slider/snippets.d.ts +36 -36
- package/lowcode_lib/goods-card-list/meta.d.ts +22 -0
- package/lowcode_lib/goods-card-list/meta.js +255 -0
- package/lowcode_lib/grid-nav/meta.d.ts +22 -22
- package/lowcode_lib/integral-task/meta.d.ts +22 -22
- package/lowcode_lib/menu-list/meta.d.ts +22 -22
- package/lowcode_lib/message-list/meta.d.ts +22 -22
- package/lowcode_lib/message-list/meta.js +4 -9
- package/lowcode_lib/meta.js +23 -20
- package/lowcode_lib/navigation/meta.d.ts +22 -22
- package/lowcode_lib/notice-bar/meta.d.ts +22 -22
- package/lowcode_lib/notice-bar/meta.js +16 -13
- package/lowcode_lib/position/meta.d.ts +22 -22
- package/lowcode_lib/search-bar/meta.d.ts +22 -22
- package/lowcode_lib/swiper/meta.d.ts +22 -22
- package/lowcode_lib/tab-container/meta.d.ts +22 -22
- package/lowcode_lib/tab-container/props.d.ts +90 -90
- package/lowcode_lib/tab-container-item/meta.d.ts +22 -22
- package/lowcode_lib/tab-message/meta.d.ts +22 -22
- package/lowcode_lib/tag-c/meta.d.ts +22 -22
- package/lowcode_lib/teletext-list/meta.d.ts +22 -22
- package/lowcode_lib/title1/meta.d.ts +22 -22
- package/lowcode_lib/title2/meta.d.ts +22 -22
- package/lowcode_lib/view.js +2 -2
- package/package.json +4 -4
|
@@ -1,194 +1,194 @@
|
|
|
1
|
-
export default [
|
|
2
|
-
{
|
|
3
|
-
name: 'items',
|
|
4
|
-
title: '标签项',
|
|
5
|
-
setter: {
|
|
6
|
-
componentName: 'ArraySetter',
|
|
7
|
-
props: {
|
|
8
|
-
itemSetter: {
|
|
9
|
-
componentName: 'ObjectSetter',
|
|
10
|
-
props: {
|
|
11
|
-
config: {
|
|
12
|
-
items: [
|
|
13
|
-
{
|
|
14
|
-
name: 'title',
|
|
15
|
-
title: '名称',
|
|
16
|
-
defaultValue: '标签项',
|
|
17
|
-
important: true,
|
|
18
|
-
setter: 'StringSetter',
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
name: 'primaryKey',
|
|
22
|
-
title: '项目编号',
|
|
23
|
-
condition: () => false,
|
|
24
|
-
setter: 'StringSetter',
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
name: 'closeable',
|
|
28
|
-
title: '可关闭',
|
|
29
|
-
initialValue: false,
|
|
30
|
-
setter: 'BoolSetter',
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
name: 'disabled',
|
|
34
|
-
title: '是否禁用',
|
|
35
|
-
initialValue: false,
|
|
36
|
-
setter: 'BoolSetter',
|
|
37
|
-
},
|
|
38
|
-
],
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
initialValue: () => {
|
|
42
|
-
return {
|
|
43
|
-
primaryKey: String(Math.floor(Math.random() * 10000)),
|
|
44
|
-
title: '标签项',
|
|
45
|
-
closeable: false,
|
|
46
|
-
disabled: false,
|
|
47
|
-
};
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
extraProps: {
|
|
53
|
-
getValue(target) {
|
|
54
|
-
const map = target.node.children.map((child) => {
|
|
55
|
-
const primaryKey = child.getPropValue('primaryKey')
|
|
56
|
-
? String(child.getPropValue('primaryKey'))
|
|
57
|
-
: child.id;
|
|
58
|
-
return {
|
|
59
|
-
primaryKey,
|
|
60
|
-
title: child.getPropValue('title') || '标签项',
|
|
61
|
-
closeable: child.getPropValue('closeable'),
|
|
62
|
-
disabled: child.getPropValue('disabled'),
|
|
63
|
-
};
|
|
64
|
-
});
|
|
65
|
-
return map;
|
|
66
|
-
},
|
|
67
|
-
setValue(target, value) {
|
|
68
|
-
const { node } = target;
|
|
69
|
-
const map = {};
|
|
70
|
-
if (!Array.isArray(value)) {
|
|
71
|
-
value = [];
|
|
72
|
-
}
|
|
73
|
-
value.forEach((item) => {
|
|
74
|
-
const tabitem = Object.assign({}, item);
|
|
75
|
-
map[item.primaryKey] = tabitem;
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
node.children.mergeChildren(
|
|
79
|
-
(child) => {
|
|
80
|
-
const primaryKey = String(child.getPropValue('primaryKey'));
|
|
81
|
-
if (Object.hasOwnProperty.call(map, primaryKey)) {
|
|
82
|
-
child.setPropValue('title', map[primaryKey].title);
|
|
83
|
-
child.setPropValue('closeable', map[primaryKey].closeable);
|
|
84
|
-
child.setPropValue('disabled', map[primaryKey].disabled);
|
|
85
|
-
delete map[primaryKey];
|
|
86
|
-
return false;
|
|
87
|
-
}
|
|
88
|
-
return true;
|
|
89
|
-
},
|
|
90
|
-
() => {
|
|
91
|
-
const items: any = [];
|
|
92
|
-
for (const primaryKey in map) {
|
|
93
|
-
if (Object.hasOwnProperty.call(map, primaryKey)) {
|
|
94
|
-
items.push({
|
|
95
|
-
componentName: 'TabContainerItem',
|
|
96
|
-
props: map[primaryKey],
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
return items;
|
|
101
|
-
},
|
|
102
|
-
(child1, child2) => {
|
|
103
|
-
const a = value.findIndex(
|
|
104
|
-
(item) => String(item.primaryKey) === String(child1.getPropValue('primaryKey')),
|
|
105
|
-
);
|
|
106
|
-
const b = value.findIndex(
|
|
107
|
-
(item) => String(item.primaryKey) === String(child2.getPropValue('primaryKey')),
|
|
108
|
-
);
|
|
109
|
-
return a - b;
|
|
110
|
-
},
|
|
111
|
-
);
|
|
112
|
-
},
|
|
113
|
-
},
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
name: 'shape',
|
|
117
|
-
title: '形态',
|
|
118
|
-
defaultValue: 'pure',
|
|
119
|
-
setter: {
|
|
120
|
-
componentName: 'RadioGroupSetter',
|
|
121
|
-
props: {
|
|
122
|
-
options: [
|
|
123
|
-
{ title: '普通型', value: 'pure' },
|
|
124
|
-
{ title: '包裹型', value: 'wrapped' },
|
|
125
|
-
{ title: '文本型', value: 'text' },
|
|
126
|
-
{ title: '胶囊型', value: 'capsule' },
|
|
127
|
-
],
|
|
128
|
-
},
|
|
129
|
-
},
|
|
130
|
-
},
|
|
131
|
-
{
|
|
132
|
-
name: 'size',
|
|
133
|
-
title: '尺寸',
|
|
134
|
-
defaultValue: 'medium',
|
|
135
|
-
setter: {
|
|
136
|
-
componentName: 'RadioGroupSetter',
|
|
137
|
-
props: {
|
|
138
|
-
options: [
|
|
139
|
-
{ title: '小', value: 'small' },
|
|
140
|
-
{ title: '中', value: 'medium' },
|
|
141
|
-
],
|
|
142
|
-
},
|
|
143
|
-
},
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
name: 'excessMode',
|
|
147
|
-
title: '选项卡过多时的滑动模式',
|
|
148
|
-
defaultValue: 'slide',
|
|
149
|
-
setter: {
|
|
150
|
-
componentName: 'RadioGroupSetter',
|
|
151
|
-
props: {
|
|
152
|
-
options: [
|
|
153
|
-
{ title: '滑动', value: 'slide' },
|
|
154
|
-
{ title: '下拉', value: 'dropdown' },
|
|
155
|
-
],
|
|
156
|
-
},
|
|
157
|
-
},
|
|
158
|
-
},
|
|
159
|
-
{
|
|
160
|
-
name: 'tabPosition',
|
|
161
|
-
title: {
|
|
162
|
-
label: '导航选项卡的位置',
|
|
163
|
-
tip: '只适用于包裹型(wrapped)选项卡',
|
|
164
|
-
},
|
|
165
|
-
condition: (target) => {
|
|
166
|
-
const shape = target.getProps().getPropValue('shape');
|
|
167
|
-
return shape === 'wrapped';
|
|
168
|
-
},
|
|
169
|
-
defaultValue: 'top',
|
|
170
|
-
setter: {
|
|
171
|
-
componentName: 'RadioGroupSetter',
|
|
172
|
-
props: {
|
|
173
|
-
options: [
|
|
174
|
-
{
|
|
175
|
-
title: '顶部',
|
|
176
|
-
value: 'top',
|
|
177
|
-
},
|
|
178
|
-
{
|
|
179
|
-
title: '底部',
|
|
180
|
-
value: 'bottom',
|
|
181
|
-
},
|
|
182
|
-
{
|
|
183
|
-
title: '左边',
|
|
184
|
-
value: 'left',
|
|
185
|
-
},
|
|
186
|
-
{
|
|
187
|
-
title: '右边',
|
|
188
|
-
value: 'right',
|
|
189
|
-
},
|
|
190
|
-
],
|
|
191
|
-
},
|
|
192
|
-
},
|
|
193
|
-
},
|
|
194
|
-
];
|
|
1
|
+
export default [
|
|
2
|
+
{
|
|
3
|
+
name: 'items',
|
|
4
|
+
title: '标签项',
|
|
5
|
+
setter: {
|
|
6
|
+
componentName: 'ArraySetter',
|
|
7
|
+
props: {
|
|
8
|
+
itemSetter: {
|
|
9
|
+
componentName: 'ObjectSetter',
|
|
10
|
+
props: {
|
|
11
|
+
config: {
|
|
12
|
+
items: [
|
|
13
|
+
{
|
|
14
|
+
name: 'title',
|
|
15
|
+
title: '名称',
|
|
16
|
+
defaultValue: '标签项',
|
|
17
|
+
important: true,
|
|
18
|
+
setter: 'StringSetter',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: 'primaryKey',
|
|
22
|
+
title: '项目编号',
|
|
23
|
+
condition: () => false,
|
|
24
|
+
setter: 'StringSetter',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: 'closeable',
|
|
28
|
+
title: '可关闭',
|
|
29
|
+
initialValue: false,
|
|
30
|
+
setter: 'BoolSetter',
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: 'disabled',
|
|
34
|
+
title: '是否禁用',
|
|
35
|
+
initialValue: false,
|
|
36
|
+
setter: 'BoolSetter',
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
initialValue: () => {
|
|
42
|
+
return {
|
|
43
|
+
primaryKey: String(Math.floor(Math.random() * 10000)),
|
|
44
|
+
title: '标签项',
|
|
45
|
+
closeable: false,
|
|
46
|
+
disabled: false,
|
|
47
|
+
};
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
extraProps: {
|
|
53
|
+
getValue(target) {
|
|
54
|
+
const map = target.node.children.map((child) => {
|
|
55
|
+
const primaryKey = child.getPropValue('primaryKey')
|
|
56
|
+
? String(child.getPropValue('primaryKey'))
|
|
57
|
+
: child.id;
|
|
58
|
+
return {
|
|
59
|
+
primaryKey,
|
|
60
|
+
title: child.getPropValue('title') || '标签项',
|
|
61
|
+
closeable: child.getPropValue('closeable'),
|
|
62
|
+
disabled: child.getPropValue('disabled'),
|
|
63
|
+
};
|
|
64
|
+
});
|
|
65
|
+
return map;
|
|
66
|
+
},
|
|
67
|
+
setValue(target, value) {
|
|
68
|
+
const { node } = target;
|
|
69
|
+
const map = {};
|
|
70
|
+
if (!Array.isArray(value)) {
|
|
71
|
+
value = [];
|
|
72
|
+
}
|
|
73
|
+
value.forEach((item) => {
|
|
74
|
+
const tabitem = Object.assign({}, item);
|
|
75
|
+
map[item.primaryKey] = tabitem;
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
node.children.mergeChildren(
|
|
79
|
+
(child) => {
|
|
80
|
+
const primaryKey = String(child.getPropValue('primaryKey'));
|
|
81
|
+
if (Object.hasOwnProperty.call(map, primaryKey)) {
|
|
82
|
+
child.setPropValue('title', map[primaryKey].title);
|
|
83
|
+
child.setPropValue('closeable', map[primaryKey].closeable);
|
|
84
|
+
child.setPropValue('disabled', map[primaryKey].disabled);
|
|
85
|
+
delete map[primaryKey];
|
|
86
|
+
return false;
|
|
87
|
+
}
|
|
88
|
+
return true;
|
|
89
|
+
},
|
|
90
|
+
() => {
|
|
91
|
+
const items: any = [];
|
|
92
|
+
for (const primaryKey in map) {
|
|
93
|
+
if (Object.hasOwnProperty.call(map, primaryKey)) {
|
|
94
|
+
items.push({
|
|
95
|
+
componentName: 'TabContainerItem',
|
|
96
|
+
props: map[primaryKey],
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return items;
|
|
101
|
+
},
|
|
102
|
+
(child1, child2) => {
|
|
103
|
+
const a = value.findIndex(
|
|
104
|
+
(item) => String(item.primaryKey) === String(child1.getPropValue('primaryKey')),
|
|
105
|
+
);
|
|
106
|
+
const b = value.findIndex(
|
|
107
|
+
(item) => String(item.primaryKey) === String(child2.getPropValue('primaryKey')),
|
|
108
|
+
);
|
|
109
|
+
return a - b;
|
|
110
|
+
},
|
|
111
|
+
);
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
name: 'shape',
|
|
117
|
+
title: '形态',
|
|
118
|
+
defaultValue: 'pure',
|
|
119
|
+
setter: {
|
|
120
|
+
componentName: 'RadioGroupSetter',
|
|
121
|
+
props: {
|
|
122
|
+
options: [
|
|
123
|
+
{ title: '普通型', value: 'pure' },
|
|
124
|
+
{ title: '包裹型', value: 'wrapped' },
|
|
125
|
+
{ title: '文本型', value: 'text' },
|
|
126
|
+
{ title: '胶囊型', value: 'capsule' },
|
|
127
|
+
],
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
name: 'size',
|
|
133
|
+
title: '尺寸',
|
|
134
|
+
defaultValue: 'medium',
|
|
135
|
+
setter: {
|
|
136
|
+
componentName: 'RadioGroupSetter',
|
|
137
|
+
props: {
|
|
138
|
+
options: [
|
|
139
|
+
{ title: '小', value: 'small' },
|
|
140
|
+
{ title: '中', value: 'medium' },
|
|
141
|
+
],
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
name: 'excessMode',
|
|
147
|
+
title: '选项卡过多时的滑动模式',
|
|
148
|
+
defaultValue: 'slide',
|
|
149
|
+
setter: {
|
|
150
|
+
componentName: 'RadioGroupSetter',
|
|
151
|
+
props: {
|
|
152
|
+
options: [
|
|
153
|
+
{ title: '滑动', value: 'slide' },
|
|
154
|
+
{ title: '下拉', value: 'dropdown' },
|
|
155
|
+
],
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
name: 'tabPosition',
|
|
161
|
+
title: {
|
|
162
|
+
label: '导航选项卡的位置',
|
|
163
|
+
tip: '只适用于包裹型(wrapped)选项卡',
|
|
164
|
+
},
|
|
165
|
+
condition: (target) => {
|
|
166
|
+
const shape = target.getProps().getPropValue('shape');
|
|
167
|
+
return shape === 'wrapped';
|
|
168
|
+
},
|
|
169
|
+
defaultValue: 'top',
|
|
170
|
+
setter: {
|
|
171
|
+
componentName: 'RadioGroupSetter',
|
|
172
|
+
props: {
|
|
173
|
+
options: [
|
|
174
|
+
{
|
|
175
|
+
title: '顶部',
|
|
176
|
+
value: 'top',
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
title: '底部',
|
|
180
|
+
value: 'bottom',
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
title: '左边',
|
|
184
|
+
value: 'left',
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
title: '右边',
|
|
188
|
+
value: 'right',
|
|
189
|
+
},
|
|
190
|
+
],
|
|
191
|
+
},
|
|
192
|
+
},
|
|
193
|
+
},
|
|
194
|
+
];
|