@symbo.ls/preview 2.7.21 → 2.7.24
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/.eslintrc.js +2 -8
- package/.vscode/settings.json +4 -1
- package/README.md +1 -0
- package/config.js +6 -0
- package/define.js +10 -0
- package/index.html +5 -5
- package/index.js +6 -9
- package/package.json +9 -28
- package/src/app.js +33 -38
- package/state.js +14 -0
- package/svgSprite.config.js +2 -2
- package/.babelrc.js +0 -5
- package/.coveralls.yml +0 -1
- package/.eslintignore +0 -1
- package/.legacy/_tools_old.js +0 -49
- package/.legacy/boxModel.js +0 -3
- package/.legacy/index copy.js +0 -45
- package/.legacy/preview.js +0 -133
- package/.legacy/sequence.js +0 -3
- package/.legacy/style.js +0 -30
- package/.prettierrc +0 -4
- package/.vscode/extensions.json +0 -5
- package/src/assets/dark.png +0 -0
- package/src/assets/fonts/FiraGO/FiraGO-Bold.woff2 +0 -0
- package/src/assets/fonts/FiraGO/FiraGO-Light.woff2 +0 -0
- package/src/assets/fonts/FiraGO/FiraGO-Medium.woff2 +0 -0
- package/src/assets/fonts/FiraGO/FiraGO-Regular.woff2 +0 -0
- package/src/assets/fonts/europa-bold-webfont.woff2 +0 -0
- package/src/assets/fonts/europa-bolditalic-webfont.woff2 +0 -0
- package/src/assets/fonts/europa-light-webfont.woff2 +0 -0
- package/src/assets/fonts/europa-lightitalic-webfont.woff2 +0 -0
- package/src/assets/fonts/europa-regular-webfont.woff2 +0 -0
- package/src/assets/fonts/europa-regularitalic-webfont.woff2 +0 -0
- package/src/assets/mask1.png +0 -0
- package/src/assets/mask2.png +0 -0
- package/src/assets/ovalCircle.svg +0 -9
- package/src/assets/shapes.png +0 -0
- package/src/assets/space.png +0 -0
- package/src/assets/type.png +0 -0
- package/src/components/Aside.js +0 -101
- package/src/components/Banner.js +0 -58
- package/src/components/ColorText.js +0 -29
- package/src/components/ColorsPalette.js +0 -69
- package/src/components/ColumnParagrphs.js +0 -22
- package/src/components/ContinueButton.js +0 -14
- package/src/components/DesignComponent.js +0 -81
- package/src/components/FontText.js +0 -193
- package/src/components/Header.js +0 -53
- package/src/components/HeaderHeading.js +0 -23
- package/src/components/IconsGroup.js +0 -64
- package/src/components/Page.js +0 -135
- package/src/components/ResponsivePreview.js +0 -44
- package/src/components/Route.js +0 -1
- package/src/components/ShapePreview.js +0 -63
- package/src/components/ShapeSet.js +0 -85
- package/src/components/SlidersWithResponsive.js +0 -23
- package/src/components/SpacingButton/actionButtons.js +0 -41
- package/src/components/SpacingButton/dropdown.js +0 -114
- package/src/components/SpacingButton/index.js +0 -250
- package/src/components/SpacingButton/props.js +0 -45
- package/src/components/SpacingPreview.js +0 -156
- package/src/components/SpacingTable.js +0 -213
- package/src/components/ThemeButtons.js +0 -41
- package/src/components/UploadImage.js +0 -31
- package/src/components/Widget.js +0 -1
- package/src/components/index.js +0 -25
- package/src/pages/Account/Personal.js +0 -59
- package/src/pages/Account/Project.js +0 -40
- package/src/pages/Account/fields.js +0 -74
- package/src/pages/Account/fieldsGridProps.js +0 -15
- package/src/pages/Account/index.js +0 -117
- package/src/pages/Color/globalThemes.js +0 -32
- package/src/pages/Color/index.js +0 -18
- package/src/pages/Color/palette.js +0 -36
- package/src/pages/Color/themes.js +0 -37
- package/src/pages/Components/grid.js +0 -99
- package/src/pages/Components/index.js +0 -37
- package/src/pages/Components/sidebar.js +0 -28
- package/src/pages/Components/style.js +0 -16
- package/src/pages/DesignSystem/Dashboard/banners.js +0 -38
- package/src/pages/DesignSystem/Dashboard/designElements.js +0 -124
- package/src/pages/DesignSystem/Dashboard/index.js +0 -22
- package/src/pages/DesignSystem/Dashboard/quickstart.js +0 -84
- package/src/pages/DesignSystem/Dashboard/state.js +0 -142
- package/src/pages/DesignSystem/Dashboard/summary.js +0 -52
- package/src/pages/DesignSystem/index.js +0 -187
- package/src/pages/Editor/index.js +0 -46
- package/src/pages/Editor/layers.js +0 -126
- package/src/pages/Editor/scene.js +0 -95
- package/src/pages/Editor/style.js +0 -13
- package/src/pages/Editor/tools.js +0 -360
- package/src/pages/Export/const.js +0 -19
- package/src/pages/Export/description.js +0 -88
- package/src/pages/Export/gist.js +0 -23
- package/src/pages/Export/index.js +0 -82
- package/src/pages/Export/scene.js +0 -59
- package/src/pages/Export/state.js +0 -23
- package/src/pages/Export/tools.js +0 -101
- package/src/pages/Fonts/fontFaces.js +0 -50
- package/src/pages/Fonts/fontFamilies.js +0 -48
- package/src/pages/Fonts/index.js +0 -16
- package/src/pages/Fonts/state.js +0 -5
- package/src/pages/Icons/index.js +0 -92
- package/src/pages/Icons/style.js +0 -1
- package/src/pages/Init/ChooseEnvironment.js +0 -149
- package/src/pages/Init/ChooseProject.js +0 -61
- package/src/pages/Init/CreateDocumentTheme.js +0 -176
- package/src/pages/Init/CreatePalette.js +0 -94
- package/src/pages/Init/FontText.js +0 -33
- package/src/pages/Init/Personalize/fields.js +0 -120
- package/src/pages/Init/Personalize/icon.js +0 -76
- package/src/pages/Init/Personalize/index.js +0 -120
- package/src/pages/Init/index.js +0 -39
- package/src/pages/Library/disabled.js +0 -38
- package/src/pages/Library/index.js +0 -33
- package/src/pages/MediaQuery/index.js +0 -46
- package/src/pages/MediaQuery/lists.js +0 -299
- package/src/pages/MediaQuery/state.js +0 -149
- package/src/pages/MediaQuery/typeScale.js +0 -69
- package/src/pages/Shapes/index.js +0 -75
- package/src/pages/Shapes/shapeSet.js +0 -133
- package/src/pages/Shapes/style.js +0 -11
- package/src/pages/Spaces/index.js +0 -65
- package/src/pages/Spaces/sequence.js +0 -34
- package/src/pages/Spaces/templates.js +0 -37
- package/src/pages/State/index.js +0 -87
- package/src/pages/Theme/buttonTitlesGrid.js +0 -47
- package/src/pages/Theme/buttonsHeader.js +0 -33
- package/src/pages/Theme/friendTheme.js +0 -30
- package/src/pages/Theme/index.js +0 -226
- package/src/pages/Theme/interactivity.js +0 -115
- package/src/pages/Theme/ntc.js +0 -1689
- package/src/pages/Theme/preview.js +0 -152
- package/src/pages/Theme/selectsGrid.js +0 -74
- package/src/pages/Theme/style.js +0 -38
- package/src/pages/Theme/themingTools.js +0 -106
- package/src/pages/Typography/collection.js +0 -115
- package/src/pages/Typography/documentStyles.js +0 -113
- package/src/pages/Typography/index.js +0 -71
- package/src/pages/Typography/rangeButtons.js +0 -58
- package/src/pages/Typography/shared.js +0 -9
- package/src/pages/Typography/stylesHelpers.js +0 -30
- package/src/pages/Typography/typeScale.js +0 -83
- package/src/pages/__Account/__/index.js +0 -241
- package/src/pages/__Account/__/setUpProject.js +0 -142
- package/src/pages/__Account/index.js +0 -111
- package/src/pages/index.js +0 -17
- package/src/state.js +0 -20
- package/src/style.js +0 -20
package/src/components/Page.js
DELETED
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
import { PageTemplate, Overlay, Flex, IconButton } from '@symbo.ls/components'
|
|
4
|
-
import { Link } from '@symbo.ls/components/src/Link'
|
|
5
|
-
|
|
6
|
-
import MASK1 from '../assets/mask1.png'
|
|
7
|
-
import MASK2 from '../assets/mask2.png' // eslint-disable-line
|
|
8
|
-
|
|
9
|
-
export const Page = {
|
|
10
|
-
tag: 'main',
|
|
11
|
-
extend: PageTemplate,
|
|
12
|
-
|
|
13
|
-
props: {
|
|
14
|
-
maxWidth: 'K-default'
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export const InitPage = {
|
|
19
|
-
tag: 'main',
|
|
20
|
-
extend: Flex,
|
|
21
|
-
|
|
22
|
-
props: {
|
|
23
|
-
width: '100%',
|
|
24
|
-
maxWidth: 'J',
|
|
25
|
-
flow: 'column',
|
|
26
|
-
position: 'relative',
|
|
27
|
-
align: 'flex-start',
|
|
28
|
-
|
|
29
|
-
content: { width: '100%' }
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
back: {
|
|
33
|
-
extend: [Link, IconButton],
|
|
34
|
-
props: {
|
|
35
|
-
position: 'absolute',
|
|
36
|
-
fontSize: 'A1',
|
|
37
|
-
top: '0',
|
|
38
|
-
right: '102.5%',
|
|
39
|
-
icon: 'arrow angle left'
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
const ifWeHaveComponents = (state) => {
|
|
45
|
-
const keys = Object.keys(state.__projectLibrary)
|
|
46
|
-
return !!keys.length
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export const DisabledPage = {
|
|
50
|
-
props: ({ state }) => ({
|
|
51
|
-
active: ifWeHaveComponents(state),
|
|
52
|
-
maxHeight: 'none',
|
|
53
|
-
overflow: 'visible',
|
|
54
|
-
|
|
55
|
-
'!active': {
|
|
56
|
-
maxHeight: 'calc(100vh - 7em)',
|
|
57
|
-
overflow: 'hidden'
|
|
58
|
-
},
|
|
59
|
-
|
|
60
|
-
'.active': {
|
|
61
|
-
maxHeight: 'none',
|
|
62
|
-
overflow: 'visible'
|
|
63
|
-
}
|
|
64
|
-
}),
|
|
65
|
-
|
|
66
|
-
on: {
|
|
67
|
-
initUpdate: (element, state) => {
|
|
68
|
-
element.setProps({ active: ifWeHaveComponents(state) }, { preventUpdate: true, ignoreInitUpdate: true })
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
|
|
72
|
-
disablingOverlay: {
|
|
73
|
-
extend: [Overlay, Flex],
|
|
74
|
-
|
|
75
|
-
props: ({ state }) => ({
|
|
76
|
-
active: ifWeHaveComponents(state),
|
|
77
|
-
overflow: 'hidden',
|
|
78
|
-
background: 'shadow-overlay',
|
|
79
|
-
'.active': {
|
|
80
|
-
animation: 'fadeOutDown',
|
|
81
|
-
animationDuration: 'G',
|
|
82
|
-
transition: 'G defaultBezier',
|
|
83
|
-
transitionProperty: 'opacity, transform, visibility',
|
|
84
|
-
opacity: '0',
|
|
85
|
-
visibility: 'hidden',
|
|
86
|
-
transform: 'translate3d(0, 12.5%, 1px)',
|
|
87
|
-
pointerEvents: 'none'
|
|
88
|
-
},
|
|
89
|
-
'!active': {
|
|
90
|
-
animation: 'fadeInUp',
|
|
91
|
-
animationDuration: 'G'
|
|
92
|
-
}
|
|
93
|
-
}),
|
|
94
|
-
|
|
95
|
-
Overlay: {
|
|
96
|
-
background: 'gradient-colorful',
|
|
97
|
-
inset: '0 0 0 0',
|
|
98
|
-
opacity: '.9',
|
|
99
|
-
style: {
|
|
100
|
-
WebkitMaskImage: 'url(' + MASK1 + ')',
|
|
101
|
-
WebkitMaskSize: '100% 100%'
|
|
102
|
-
}
|
|
103
|
-
},
|
|
104
|
-
|
|
105
|
-
message: {
|
|
106
|
-
props: ({ state }) => ({
|
|
107
|
-
animation: 'fadeInUpShort',
|
|
108
|
-
animationDuration: 'G',
|
|
109
|
-
animationDelay: 'G',
|
|
110
|
-
margin: 'auto auto 0',
|
|
111
|
-
padding: 'C1 E C',
|
|
112
|
-
width: '100%',
|
|
113
|
-
maxWidth: 'K-default',
|
|
114
|
-
ArticleBig: {
|
|
115
|
-
p: {
|
|
116
|
-
text: 'Open up ' + state.appKey + ' in a new window to start working with components'
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
}),
|
|
120
|
-
|
|
121
|
-
ArticleBig: {
|
|
122
|
-
title: {
|
|
123
|
-
text: 'Connect to your website'
|
|
124
|
-
},
|
|
125
|
-
p: {
|
|
126
|
-
color: 'white .8',
|
|
127
|
-
margin: 'X 0 0',
|
|
128
|
-
animation: 'fadeInUpShort',
|
|
129
|
-
animationDuration: 'G',
|
|
130
|
-
animationDelay: 'G1'
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
import { Flex, ResponsiveSreensPreview } from '@symbo.ls/components'
|
|
4
|
-
|
|
5
|
-
const footer = {
|
|
6
|
-
extend: Flex,
|
|
7
|
-
props: {
|
|
8
|
-
gap: 'A1',
|
|
9
|
-
align: 'center space-between'
|
|
10
|
-
},
|
|
11
|
-
|
|
12
|
-
Paragraph: {
|
|
13
|
-
text: 'For the best experience, check it out from screens larger than 1980px',
|
|
14
|
-
color: 'gray6',
|
|
15
|
-
margin: '0'
|
|
16
|
-
},
|
|
17
|
-
|
|
18
|
-
ResponsiveToolBar: {
|
|
19
|
-
extend: true,
|
|
20
|
-
devices: {
|
|
21
|
-
childExtend: {
|
|
22
|
-
on: {
|
|
23
|
-
click: (ev, el, s) => {
|
|
24
|
-
const previewSize = s.parent.previewSize !== s.key ? s.key : 'mobileS'
|
|
25
|
-
s.parent.update({ previewSize })
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export const ResponsivePreview = {
|
|
34
|
-
extend: ResponsiveSreensPreview,
|
|
35
|
-
|
|
36
|
-
props: {
|
|
37
|
-
position: 'absolute',
|
|
38
|
-
left: 'B',
|
|
39
|
-
right: 'B',
|
|
40
|
-
padding: '0 0 Z2'
|
|
41
|
-
},
|
|
42
|
-
|
|
43
|
-
footer
|
|
44
|
-
}
|
package/src/components/Route.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
import { Scene, Flex, Code } from '@symbo.ls/components'
|
|
4
|
-
|
|
5
|
-
const scene = {
|
|
6
|
-
extend: Scene,
|
|
7
|
-
|
|
8
|
-
scene: {
|
|
9
|
-
props: {
|
|
10
|
-
content: {
|
|
11
|
-
background: 'shape 1',
|
|
12
|
-
color: 'gray11',
|
|
13
|
-
padding: 'Z A1',
|
|
14
|
-
text: 'Shape Preview'
|
|
15
|
-
}
|
|
16
|
-
},
|
|
17
|
-
|
|
18
|
-
on: {
|
|
19
|
-
update: (el, s) => {
|
|
20
|
-
el.set({
|
|
21
|
-
props: s.props
|
|
22
|
-
})
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export const ShapePreview = {
|
|
29
|
-
extend: Flex,
|
|
30
|
-
props: {
|
|
31
|
-
height: 'E3',
|
|
32
|
-
zIndex: '9999',
|
|
33
|
-
gap: 'A',
|
|
34
|
-
alignItems: 'stretch ',
|
|
35
|
-
|
|
36
|
-
scene: { flex: 1 },
|
|
37
|
-
|
|
38
|
-
style: {
|
|
39
|
-
backdropFilter: 'blur(15px)'
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
|
|
43
|
-
scene,
|
|
44
|
-
code: {
|
|
45
|
-
extend: Code,
|
|
46
|
-
props: ({ state }) => ({
|
|
47
|
-
hide: Object.keys(state.props).length === 0,
|
|
48
|
-
flex: '0 0 360px',
|
|
49
|
-
margin: '0',
|
|
50
|
-
code: {
|
|
51
|
-
height: '100%',
|
|
52
|
-
margin: '0'
|
|
53
|
-
},
|
|
54
|
-
buttons: { marginInline: 'X2' }
|
|
55
|
-
}),
|
|
56
|
-
title: null,
|
|
57
|
-
code: {
|
|
58
|
-
props: {
|
|
59
|
-
text: ({ state }) => 'const props = ' + JSON.stringify(state.props, null, 2)
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
import { ClickableItem, Flex } from '@symbo.ls/components'
|
|
4
|
-
|
|
5
|
-
const isActive = (el, s) => s.parent.active === `${el.parent.parent.parent.key}-${el.key}`
|
|
6
|
-
|
|
7
|
-
const ShapeItem = {
|
|
8
|
-
extend: [ClickableItem, Flex],
|
|
9
|
-
|
|
10
|
-
props: (el, s) => ({
|
|
11
|
-
padding: 'B',
|
|
12
|
-
round: 'Z',
|
|
13
|
-
alignItems: 'center',
|
|
14
|
-
justifyContent: 'center',
|
|
15
|
-
outline: '0, shape, solid',
|
|
16
|
-
background: 'gray1',
|
|
17
|
-
theme: null,
|
|
18
|
-
cursor: 'pointer',
|
|
19
|
-
|
|
20
|
-
active: isActive(el, s),
|
|
21
|
-
|
|
22
|
-
'.active': {
|
|
23
|
-
outline: 'X, shape, solid',
|
|
24
|
-
opacity: '1',
|
|
25
|
-
background: 'gray2'
|
|
26
|
-
},
|
|
27
|
-
|
|
28
|
-
_shape: {
|
|
29
|
-
transition: 'A defaultBezier',
|
|
30
|
-
transitionProperty: 'background',
|
|
31
|
-
width: 'C1',
|
|
32
|
-
height: 'C1',
|
|
33
|
-
background: 'gray3'
|
|
34
|
-
}
|
|
35
|
-
}),
|
|
36
|
-
|
|
37
|
-
_shape: {},
|
|
38
|
-
|
|
39
|
-
on: {
|
|
40
|
-
click: (ev, el, s) => {
|
|
41
|
-
const active = `${el.parent.parent.parent.key}-${el.key}`
|
|
42
|
-
s.parent.props = s.parse()
|
|
43
|
-
s.parent.update({ active })
|
|
44
|
-
},
|
|
45
|
-
mouseover: (ev, el, s) => {
|
|
46
|
-
el._shape.setProps({ background: 'gray5' })
|
|
47
|
-
},
|
|
48
|
-
mouseleave: (ev, el, s) => {
|
|
49
|
-
const active = isActive(el, s)
|
|
50
|
-
if (!active) el._shape.setProps({ background: 'gray3' })
|
|
51
|
-
},
|
|
52
|
-
update: (el, s) => {
|
|
53
|
-
const active = isActive(el, s)
|
|
54
|
-
el._shape.setProps({ background: active ? 'gray5' : 'gray3' })
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export const ShapeSet = {
|
|
60
|
-
props: {
|
|
61
|
-
label: {
|
|
62
|
-
display: 'block',
|
|
63
|
-
opacity: '.65',
|
|
64
|
-
padding: '0 0 Z 0',
|
|
65
|
-
span: {
|
|
66
|
-
opacity: '.65'
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
|
|
71
|
-
label: {},
|
|
72
|
-
list: {
|
|
73
|
-
extend: Flex,
|
|
74
|
-
props: {
|
|
75
|
-
gap: 'A2',
|
|
76
|
-
wrap: 'wrap'
|
|
77
|
-
},
|
|
78
|
-
childExtend: {
|
|
79
|
-
extend: ShapeItem,
|
|
80
|
-
_shape: {
|
|
81
|
-
props: ({ state }) => state
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
import { Flex } from '@symbo.ls/components'
|
|
4
|
-
|
|
5
|
-
export const SlidersWithResponsive = {
|
|
6
|
-
extend: Flex,
|
|
7
|
-
|
|
8
|
-
props: {
|
|
9
|
-
align: 'flex-end space-between',
|
|
10
|
-
position: 'sticky',
|
|
11
|
-
top: 'C2',
|
|
12
|
-
theme: 'header',
|
|
13
|
-
zIndex: '1000',
|
|
14
|
-
margin: '-B2 -B -B',
|
|
15
|
-
padding: 'B2 B B',
|
|
16
|
-
style: {
|
|
17
|
-
backdropFilter: 'blur(15px)'
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
|
|
21
|
-
SequenceSliders: {},
|
|
22
|
-
ResponsiveToolBar: {}
|
|
23
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
import { Flex } from '@symbo.ls/components'
|
|
4
|
-
import { SpacingButton } from '..' // eslint-disable-line
|
|
5
|
-
import { SPACING_BUTTONS } from './props'
|
|
6
|
-
|
|
7
|
-
export const setTableButtons = ({ state }) =>
|
|
8
|
-
Object.keys(SPACING_BUTTONS).filter(v => {
|
|
9
|
-
const rowState = state[state.selectedIndex]
|
|
10
|
-
const { maxValue } = SPACING_BUTTONS[v]
|
|
11
|
-
return maxValue ? maxValue > (rowState && rowState.val) : true
|
|
12
|
-
})
|
|
13
|
-
|
|
14
|
-
export const setRowButtons = ({ state }) =>
|
|
15
|
-
Object.keys(SPACING_BUTTONS).filter(v => {
|
|
16
|
-
const { maxValue } = SPACING_BUTTONS[v]
|
|
17
|
-
return maxValue ? maxValue > state.val : true
|
|
18
|
-
})
|
|
19
|
-
|
|
20
|
-
export default {
|
|
21
|
-
extend: Flex,
|
|
22
|
-
|
|
23
|
-
props: {
|
|
24
|
-
position: 'absolute',
|
|
25
|
-
left: 'G3',
|
|
26
|
-
gap: 'X',
|
|
27
|
-
top: 'Y',
|
|
28
|
-
height: 'B2',
|
|
29
|
-
zIndex: 99,
|
|
30
|
-
boxSizing: 'content-box',
|
|
31
|
-
padding: '- - E',
|
|
32
|
-
transition: 'C ease-out',
|
|
33
|
-
transitionProperty: 'transform, opacity',
|
|
34
|
-
opacity: '0',
|
|
35
|
-
|
|
36
|
-
':hover': { opacity: '1' }
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
// childExtend: SpacingButton,
|
|
40
|
-
// $setStateCollection: setTableButtons
|
|
41
|
-
}
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
Dropdown,
|
|
5
|
-
GridInDropdown
|
|
6
|
-
} from '@symbo.ls/components'
|
|
7
|
-
|
|
8
|
-
import {
|
|
9
|
-
ChoosableButton,
|
|
10
|
-
diffIconTypes,
|
|
11
|
-
diffPropPosition,
|
|
12
|
-
diffPropValue,
|
|
13
|
-
getStateTree,
|
|
14
|
-
keysOf
|
|
15
|
-
} from '.'
|
|
16
|
-
import { SPACING_BUTTONS } from './props'
|
|
17
|
-
|
|
18
|
-
const ButtonInDropdown = {
|
|
19
|
-
extend: [ChoosableButton],
|
|
20
|
-
props: (element) => {
|
|
21
|
-
const { table, row, property: direction } = getStateTree(element)
|
|
22
|
-
const property = direction.parent
|
|
23
|
-
|
|
24
|
-
const propValue = property.value
|
|
25
|
-
const directionValue = direction.value
|
|
26
|
-
|
|
27
|
-
const activeProperty = SPACING_BUTTONS[property.value]
|
|
28
|
-
const keyLength = Object.keys(activeProperty).length
|
|
29
|
-
const iconKey = diffIconTypes(propValue, directionValue)
|
|
30
|
-
|
|
31
|
-
const active = table.props[propValue] === (row && row.key)
|
|
32
|
-
|
|
33
|
-
const gridArea = keyLength > 3 && diffPropPosition(propValue, directionValue)
|
|
34
|
-
|
|
35
|
-
return {
|
|
36
|
-
active,
|
|
37
|
-
gridArea,
|
|
38
|
-
lazyLoad: true,
|
|
39
|
-
icon: { name: iconKey },
|
|
40
|
-
theme: null,
|
|
41
|
-
'@dark': {
|
|
42
|
-
background: 'transparent 0',
|
|
43
|
-
color: 'gray7',
|
|
44
|
-
':hover': {
|
|
45
|
-
theme: 'quinary',
|
|
46
|
-
color: 'gray8'
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
':hover': null,
|
|
50
|
-
'.active': {
|
|
51
|
-
theme: null,
|
|
52
|
-
color: 'blue'
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
attr: { title: ({ state }) => state.value },
|
|
57
|
-
on: {
|
|
58
|
-
click: (ev, element) => {
|
|
59
|
-
const { table, row, property: direction } = getStateTree(element)
|
|
60
|
-
const property = direction.parent
|
|
61
|
-
|
|
62
|
-
const propKey = diffPropValue(property.value, direction.value)
|
|
63
|
-
const active = table.props[propKey] === row.key
|
|
64
|
-
|
|
65
|
-
if (active) {
|
|
66
|
-
delete table.props[propKey] && table.update()
|
|
67
|
-
} else {
|
|
68
|
-
table.update({ props: { [propKey]: row.key } })
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export default {
|
|
75
|
-
extend: Dropdown,
|
|
76
|
-
|
|
77
|
-
props: {
|
|
78
|
-
lazyLoad: true,
|
|
79
|
-
minWidth: 'none',
|
|
80
|
-
left: 'auto',
|
|
81
|
-
grid: { gap: '0' }
|
|
82
|
-
},
|
|
83
|
-
|
|
84
|
-
header: { text: ({ state }) => state.value },
|
|
85
|
-
|
|
86
|
-
grid: {
|
|
87
|
-
extend: GridInDropdown,
|
|
88
|
-
|
|
89
|
-
props: ({ state }) => {
|
|
90
|
-
const keys = keysOf(state)
|
|
91
|
-
if (keys.length < 4) {
|
|
92
|
-
return {
|
|
93
|
-
lazyLoad: true,
|
|
94
|
-
columns: 'repeat(4, 1fr)'
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
return {
|
|
98
|
-
lazyLoad: true,
|
|
99
|
-
columns: 'auto 32px auto',
|
|
100
|
-
rows: 'auto 32px auto',
|
|
101
|
-
templateAreas: `"endStart blockStart startEnd"
|
|
102
|
-
"inlineStart content inlineEnd"
|
|
103
|
-
"startStart blockEnd endEnd"`
|
|
104
|
-
}
|
|
105
|
-
},
|
|
106
|
-
|
|
107
|
-
childExtend: ButtonInDropdown,
|
|
108
|
-
|
|
109
|
-
$setStateCollection: (element) => {
|
|
110
|
-
const { property } = getStateTree(element)
|
|
111
|
-
return keysOf(property)
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
}
|