@teammodlr/ui-kit 2.1.8 → 2.1.10
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/lib/components/avatargroup/symbol.d.ts +2 -2
- package/lib/components/breadcrumb/style/index.d.ts +1 -1
- package/lib/components/breadcrumb/symbol.d.ts +1 -1
- package/lib/components/buttongroup/symbol.d.ts +2 -2
- package/lib/components/colorpicker/ColorPicker.vue.d.ts +1 -1
- package/lib/components/dropdown/Dropdown.vue.d.ts +1 -1
- package/lib/components/dropdown/symbol.d.ts +1 -1
- package/lib/components/form/symbol.d.ts +1 -1
- package/lib/components/messageprovider/style/index.d.ts +1 -1
- package/lib/components/modal/Modal.vue.d.ts +6 -3
- package/lib/components/modal/style/Modal.css.d.ts +3 -0
- package/lib/components/radiobuttongroup/symbol.d.ts +2 -2
- package/lib/components/tooltip/Tooltip.vue.d.ts +1 -1
- package/lib/components/tree/props.d.ts +4 -4
- package/lib/components/tree/types.d.ts +10 -10
- package/lib/composables/element.d.ts +1 -1
- package/lib/composables/useInteractive.d.ts +1 -1
- package/lib/composables/useMount.d.ts +1 -1
- package/lib/composables/usePopper.d.ts +2 -2
- package/lib/composables/useZIndex.d.ts +1 -1
- package/lib/index.cjs.js +9 -9
- package/lib/index.es.js +2256 -2213
- package/lib/install.d.ts +1 -1
- package/lib/nuxt.js +17 -15
- package/lib/nuxt.plugin.js +6 -6
- package/lib/style.css +1 -1
- package/package.json +89 -79
- package/src/__storybook__/argTypes.ts +5 -13
- package/src/__storybook__/createStory.ts +10 -10
- package/src/call.ts +14 -14
- package/src/components/avatar/Avatar.vue +1 -1
- package/src/components/avatar/examples/index.stories.ts +4 -7
- package/src/components/avatar/style/Avatar.css.ts +17 -17
- package/src/components/avatargroup/examples/index.stories.ts +5 -10
- package/src/components/avatargroup/style/AvatarGroup.css.ts +9 -4
- package/src/components/avatargroup/symbol.ts +5 -5
- package/src/components/badge/examples/index.stories.ts +4 -6
- package/src/components/badge/style/Badge.css.ts +36 -36
- package/src/components/breadcrumb/examples/index.stories.ts +6 -10
- package/src/components/breadcrumb/style/Breadcrumb.css.ts +17 -17
- package/src/components/breadcrumb/style/index.ts +1 -1
- package/src/components/breadcrumb/symbol.ts +4 -3
- package/src/components/button/examples/index.stories.ts +4 -4
- package/src/components/button/style/Button.css.ts +143 -133
- package/src/components/buttongroup/examples/index.stories.ts +6 -12
- package/src/components/buttongroup/style/ButtonGroup.css.ts +13 -11
- package/src/components/buttongroup/symbol.ts +5 -4
- package/src/components/checkbox/Checkbox.vue +8 -8
- package/src/components/checkbox/examples/index.stories.ts +4 -9
- package/src/components/checkbox/examples/index.ts +0 -1
- package/src/components/checkbox/style/Checkbox.css.ts +31 -27
- package/src/components/checkbox/style/index.ts +1 -1
- package/src/components/colorpicker/examples/index.stories.ts +5 -10
- package/src/components/colorpicker/examples/index.ts +1 -1
- package/src/components/colorpicker/style/ColorPicker.css.ts +22 -14
- package/src/components/colorpicker/utils.ts +46 -28
- package/src/components/confirm/examples/index.stories.ts +5 -8
- package/src/components/confirm/props.ts +2 -2
- package/src/components/confirm/providerProps.ts +1 -2
- package/src/components/confirm/types.ts +15 -16
- package/src/components/confirm/useConfirm.ts +3 -1
- package/src/components/dialog/examples/index.stories.ts +5 -9
- package/src/components/dialog/style/Dialog.css.ts +38 -37
- package/src/components/dropdown/examples/index.stories.ts +3 -7
- package/src/components/dropdown/hooks.ts +20 -20
- package/src/components/dropdown/style/Dropdown.css.ts +24 -24
- package/src/components/dropdown/symbol.ts +3 -2
- package/src/components/form/Form.vue +1 -1
- package/src/components/form/examples/index.stories.ts +2 -4
- package/src/components/form/style/Form.css.ts +13 -8
- package/src/components/form/style/index.ts +2 -2
- package/src/components/form/symbol.ts +10 -5
- package/src/components/image/examples/index.stories.ts +5 -7
- package/src/components/input/Input.vue +8 -9
- package/src/components/input/examples/index.stories.ts +5 -7
- package/src/components/input/style/Input.css.ts +40 -43
- package/src/components/link/examples/index.stories.ts +4 -9
- package/src/components/messageprovider/examples/index.stories.ts +5 -8
- package/src/components/messageprovider/style/Message.css.ts +31 -31
- package/src/components/messageprovider/style/index.ts +1 -1
- package/src/components/messageprovider/types.ts +31 -22
- package/src/components/messageprovider/useMessage.ts +6 -4
- package/src/components/modal/Modal.vue +72 -54
- package/src/components/modal/examples/index.stories.ts +6 -10
- package/src/components/modal/examples/index.ts +1 -0
- package/src/components/modal/examples/sidebar.vue +75 -0
- package/src/components/modal/style/Modal.css.ts +91 -72
- package/src/components/pagination/examples/index.stories.ts +5 -9
- package/src/components/pagination/examples/index.ts +1 -1
- package/src/components/pagination/style/Pagination.css.ts +41 -37
- package/src/components/radio/Radio.vue +7 -7
- package/src/components/radio/examples/index.stories.ts +4 -9
- package/src/components/radio/examples/index.ts +0 -1
- package/src/components/radio/style/Checkbox.css.ts +30 -31
- package/src/components/radio/style/index.ts +1 -1
- package/src/components/radiobutton/RadioButton.vue +3 -3
- package/src/components/radiobutton/style/RadioButton.css.ts +41 -36
- package/src/components/radiobuttongroup/examples/index.stories.ts +6 -10
- package/src/components/radiobuttongroup/examples/index.ts +0 -1
- package/src/components/radiobuttongroup/style/RadioButtonGroup.css.ts +14 -14
- package/src/components/radiobuttongroup/style/index.ts +1 -1
- package/src/components/radiobuttongroup/symbol.ts +8 -7
- package/src/components/renderer/examlpes/index.stories.ts +4 -8
- package/src/components/renderer/props.ts +2 -3
- package/src/components/renderer/renderer.ts +3 -3
- package/src/components/select/Select.vue +3 -4
- package/src/components/select/examples/index.stories.ts +4 -10
- package/src/components/select/style/Select.css.ts +62 -61
- package/src/components/skeleton/examples/index.stories.ts +5 -9
- package/src/components/skeleton/style/Skeleton.css.ts +16 -16
- package/src/components/skeleton/style/index.ts +2 -2
- package/src/components/slider/style/Slider.css.ts +12 -5
- package/src/components/switch/Switch.vue +4 -4
- package/src/components/switch/examples/index.stories.ts +4 -9
- package/src/components/switch/examples/index.ts +0 -1
- package/src/components/switch/style/Switch.css.ts +56 -57
- package/src/components/switch/style/index.ts +1 -1
- package/src/components/tab/examples/index.stories.ts +5 -11
- package/src/components/table/examples/index.stories.ts +6 -12
- package/src/components/table/style/Table.css.ts +22 -17
- package/src/components/table/style/index.ts +1 -1
- package/src/components/table/types/index.ts +1 -1
- package/src/components/tag/examples/index.stories.ts +4 -10
- package/src/components/tag/style/Tag.css.ts +14 -9
- package/src/components/textarea/Textarea.vue +7 -8
- package/src/components/textarea/examples/index.stories.ts +4 -8
- package/src/components/textarea/style/Textarea.css.ts +33 -33
- package/src/components/tooltip/examples/index.stories.ts +5 -10
- package/src/components/tooltip/examples/index.ts +2 -2
- package/src/components/tooltip/style/Tooltip.css.ts +24 -25
- package/src/components/transfer/examples/index.stories.ts +5 -9
- package/src/components/transfer/style/Transfer.css.ts +41 -40
- package/src/components/tree/examples/index.stories.ts +6 -10
- package/src/components/tree/props.ts +20 -18
- package/src/components/tree/style/Tree.css.ts +36 -31
- package/src/components/tree/types.ts +60 -62
- package/src/components/virtualscroll/examples/index.stories.ts +4 -8
- package/src/components/virtualscroll/style/VirtualScroll.css.ts +1 -2
- package/src/composables/element.ts +4 -4
- package/src/composables/useCachedUid.ts +7 -6
- package/src/composables/useEventListener.ts +11 -6
- package/src/composables/useInput.ts +63 -41
- package/src/composables/useInteractive.ts +10 -11
- package/src/composables/useMergedState.ts +7 -7
- package/src/composables/useMount.ts +11 -11
- package/src/composables/usePopper.ts +57 -36
- package/src/composables/useZIndex.ts +5 -5
- package/src/create.ts +10 -6
- package/src/examples/cards/cards.stories.ts +3 -3
- package/src/examples/modal/modal.stories.ts +3 -3
- package/src/exports/nuxt.js +17 -15
- package/src/exports/nuxt.plugin.js +6 -6
- package/src/index.ts +0 -2
- package/src/install.ts +5 -5
- package/src/shims-vue.d.ts +3 -3
- package/src/styles/theme.css.ts +51 -43
- package/src/styles/transitions.css.ts +26 -28
- package/src/types/props.ts +16 -2
- package/src/utils/injection.ts +3 -3
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {createVar, style, styleVariants} from
|
|
2
|
-
import {themeVars} from
|
|
1
|
+
import { createVar, style, styleVariants } from '@vanilla-extract/css';
|
|
2
|
+
import { themeVars } from '../../../styles/theme.css';
|
|
3
3
|
|
|
4
4
|
const sizes = {
|
|
5
5
|
xs: '26px',
|
|
6
6
|
sm: '30px',
|
|
7
7
|
md: '38px',
|
|
8
8
|
lg: '42px',
|
|
9
|
-
xl: '48px'
|
|
9
|
+
xl: '48px'
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
const borderRadiuses = {
|
|
@@ -14,7 +14,7 @@ const borderRadiuses = {
|
|
|
14
14
|
sm: '3px',
|
|
15
15
|
md: '4px',
|
|
16
16
|
lg: '6px',
|
|
17
|
-
xl: '8px'
|
|
17
|
+
xl: '8px'
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
export const vars = {
|
|
@@ -25,8 +25,8 @@ export const vars = {
|
|
|
25
25
|
borderColor: createVar(),
|
|
26
26
|
backgroundColor: createVar(),
|
|
27
27
|
color: createVar(),
|
|
28
|
-
cursor: createVar()
|
|
29
|
-
}
|
|
28
|
+
cursor: createVar()
|
|
29
|
+
};
|
|
30
30
|
|
|
31
31
|
export const wrapper = style({
|
|
32
32
|
position: 'relative'
|
|
@@ -41,9 +41,9 @@ export const base = style({
|
|
|
41
41
|
[vars.borderColor]: themeVars.color.gray[300],
|
|
42
42
|
[vars.color]: themeVars.color.font.text,
|
|
43
43
|
[vars.backgroundColor]: '#FFFFFF',
|
|
44
|
-
[vars.cursor]: 'text'
|
|
44
|
+
[vars.cursor]: 'text'
|
|
45
45
|
},
|
|
46
|
-
|
|
46
|
+
|
|
47
47
|
minHeight: vars.height,
|
|
48
48
|
width: '100%',
|
|
49
49
|
borderRadius: vars.radius,
|
|
@@ -66,15 +66,15 @@ export const base = style({
|
|
|
66
66
|
border-color .3s ${themeVars.transition.default}`,
|
|
67
67
|
':hover': {
|
|
68
68
|
vars: {
|
|
69
|
-
[vars.borderColor]: themeVars.color.blue[400]
|
|
69
|
+
[vars.borderColor]: themeVars.color.blue[400]
|
|
70
70
|
}
|
|
71
71
|
},
|
|
72
72
|
':focus': {
|
|
73
73
|
vars: {
|
|
74
|
-
[vars.borderColor]: themeVars.color.blue[500]
|
|
74
|
+
[vars.borderColor]: themeVars.color.blue[500]
|
|
75
75
|
},
|
|
76
76
|
outline: 'none',
|
|
77
|
-
boxShadow: `0 0 0 2px ${themeVars.color.blue[200]}
|
|
77
|
+
boxShadow: `0 0 0 2px ${themeVars.color.blue[200]}`
|
|
78
78
|
}
|
|
79
79
|
});
|
|
80
80
|
|
|
@@ -83,50 +83,50 @@ export const size = styleVariants({
|
|
|
83
83
|
vars: {
|
|
84
84
|
[vars.radius]: borderRadiuses.xs,
|
|
85
85
|
[vars.paddingX]: themeVars.space[1],
|
|
86
|
-
[vars.paddingY]: themeVars.space[0.5]
|
|
86
|
+
[vars.paddingY]: themeVars.space[0.5]
|
|
87
87
|
},
|
|
88
88
|
fontSize: themeVars.fontSize.small,
|
|
89
|
-
minHeight: '20px'
|
|
89
|
+
minHeight: '20px'
|
|
90
90
|
},
|
|
91
91
|
sm: {
|
|
92
92
|
vars: {
|
|
93
93
|
[vars.radius]: borderRadiuses.sm,
|
|
94
94
|
[vars.paddingX]: themeVars.space[1.5],
|
|
95
|
-
[vars.paddingY]: themeVars.space[1]
|
|
95
|
+
[vars.paddingY]: themeVars.space[1]
|
|
96
96
|
},
|
|
97
97
|
fontSize: themeVars.fontSize.small,
|
|
98
|
-
minHeight: '24px'
|
|
98
|
+
minHeight: '24px'
|
|
99
99
|
},
|
|
100
100
|
md: {
|
|
101
101
|
vars: {
|
|
102
102
|
[vars.radius]: borderRadiuses.md,
|
|
103
103
|
[vars.paddingX]: themeVars.space[1.5],
|
|
104
|
-
[vars.paddingY]: themeVars.space[1]
|
|
104
|
+
[vars.paddingY]: themeVars.space[1]
|
|
105
105
|
},
|
|
106
|
-
minHeight: '28px'
|
|
106
|
+
minHeight: '28px'
|
|
107
107
|
},
|
|
108
108
|
lg: {
|
|
109
109
|
vars: {
|
|
110
110
|
[vars.radius]: borderRadiuses.lg,
|
|
111
111
|
[vars.paddingX]: themeVars.space[2.5],
|
|
112
|
-
[vars.paddingY]: themeVars.space[1.5]
|
|
112
|
+
[vars.paddingY]: themeVars.space[1.5]
|
|
113
113
|
},
|
|
114
114
|
fontSize: themeVars.fontSize.large,
|
|
115
|
-
minHeight: '34px'
|
|
115
|
+
minHeight: '34px'
|
|
116
116
|
},
|
|
117
117
|
xl: {
|
|
118
118
|
vars: {
|
|
119
119
|
[vars.radius]: borderRadiuses.xl,
|
|
120
120
|
[vars.paddingX]: themeVars.space[3],
|
|
121
|
-
[vars.paddingY]: themeVars.space[1.5]
|
|
121
|
+
[vars.paddingY]: themeVars.space[1.5]
|
|
122
122
|
},
|
|
123
123
|
fontSize: themeVars.fontSize.large,
|
|
124
|
-
minHeight: '36px'
|
|
125
|
-
}
|
|
124
|
+
minHeight: '36px'
|
|
125
|
+
}
|
|
126
126
|
});
|
|
127
127
|
|
|
128
128
|
export const block = style({
|
|
129
|
-
width: '100%'
|
|
129
|
+
width: '100%'
|
|
130
130
|
});
|
|
131
131
|
|
|
132
132
|
export const disabled = style({
|
|
@@ -134,18 +134,18 @@ export const disabled = style({
|
|
|
134
134
|
[vars.borderColor]: themeVars.color.gray[200],
|
|
135
135
|
[vars.color]: themeVars.color.gray[500],
|
|
136
136
|
[vars.backgroundColor]: themeVars.color.gray[50],
|
|
137
|
-
[vars.cursor]: 'not-allowed'
|
|
137
|
+
[vars.cursor]: 'not-allowed'
|
|
138
138
|
},
|
|
139
139
|
':focus': {
|
|
140
|
-
boxShadow: 'none'
|
|
140
|
+
boxShadow: 'none'
|
|
141
141
|
},
|
|
142
142
|
':hover': {
|
|
143
|
-
cursor: 'not-allowed'
|
|
143
|
+
cursor: 'not-allowed'
|
|
144
144
|
}
|
|
145
145
|
});
|
|
146
146
|
|
|
147
147
|
export const label = style({
|
|
148
|
-
fontWeight:
|
|
148
|
+
fontWeight: '500',
|
|
149
149
|
display: 'inline-block',
|
|
150
150
|
fontSize: themeVars.fontSize.base,
|
|
151
151
|
wordBreak: 'break-word',
|
|
@@ -161,7 +161,7 @@ export const description = style({
|
|
|
161
161
|
color: themeVars.color.gray[600],
|
|
162
162
|
lineHeight: themeVars.fontSize.large,
|
|
163
163
|
wordBreak: 'break-word',
|
|
164
|
-
marginBottom: themeVars.space[1.5]
|
|
164
|
+
marginBottom: themeVars.space[1.5]
|
|
165
165
|
});
|
|
166
166
|
|
|
167
167
|
export const errorMessage = style({
|
|
@@ -170,22 +170,22 @@ export const errorMessage = style({
|
|
|
170
170
|
fontSize: themeVars.fontSize.base,
|
|
171
171
|
color: themeVars.color.red[600],
|
|
172
172
|
wordBreak: 'break-word',
|
|
173
|
-
marginTop: themeVars.space[1.5]
|
|
173
|
+
marginTop: themeVars.space[1.5]
|
|
174
174
|
});
|
|
175
175
|
|
|
176
176
|
export const error = style({
|
|
177
177
|
vars: {
|
|
178
|
-
[vars.borderColor]: themeVars.color.red[500]
|
|
178
|
+
[vars.borderColor]: themeVars.color.red[500]
|
|
179
179
|
},
|
|
180
180
|
':hover': {
|
|
181
181
|
vars: {
|
|
182
|
-
[vars.borderColor]: themeVars.color.red[500]
|
|
182
|
+
[vars.borderColor]: themeVars.color.red[500]
|
|
183
183
|
}
|
|
184
184
|
},
|
|
185
185
|
':focus': {
|
|
186
186
|
boxShadow: `0 0 0 2px ${themeVars.color.red[200]}`,
|
|
187
187
|
vars: {
|
|
188
|
-
[vars.borderColor]: themeVars.color.red[500]
|
|
188
|
+
[vars.borderColor]: themeVars.color.red[500]
|
|
189
189
|
}
|
|
190
|
-
}
|
|
190
|
+
}
|
|
191
191
|
});
|
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
import MTooltip from
|
|
2
|
-
import MButton from
|
|
3
|
-
import {
|
|
4
|
-
MTooltipBasic, MTooltipPlacement
|
|
5
|
-
} from "./index";
|
|
1
|
+
import MTooltip from '../Tooltip.vue';
|
|
2
|
+
import MButton from '@/components/button/Button.vue';
|
|
3
|
+
import { MTooltipBasic, MTooltipPlacement } from './index';
|
|
6
4
|
|
|
7
|
-
import {
|
|
8
|
-
createStory,
|
|
9
|
-
popperPositionArgType
|
|
10
|
-
} from "../../../__storybook__";
|
|
5
|
+
import { createStory, popperPositionArgType } from '../../../__storybook__';
|
|
11
6
|
|
|
12
7
|
export default {
|
|
13
8
|
component: MTooltip,
|
|
@@ -16,7 +11,7 @@ export default {
|
|
|
16
11
|
argTypes: {
|
|
17
12
|
...popperPositionArgType()
|
|
18
13
|
}
|
|
19
|
-
}
|
|
14
|
+
};
|
|
20
15
|
|
|
21
16
|
export const Basic = createStory(MTooltipBasic);
|
|
22
17
|
export const Placement = createStory(MTooltipPlacement);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default as MTooltipBasic } from
|
|
2
|
-
export { default as MTooltipPlacement } from
|
|
1
|
+
export { default as MTooltipBasic } from './basic.vue';
|
|
2
|
+
export { default as MTooltipPlacement } from './placement.vue';
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import {createVar, globalKeyframes, style} from '@vanilla-extract/css';
|
|
2
|
-
import { themeVars } from
|
|
3
|
-
|
|
1
|
+
import { createVar, globalKeyframes, style } from '@vanilla-extract/css';
|
|
2
|
+
import { themeVars } from '../../../styles/theme.css';
|
|
4
3
|
|
|
5
4
|
export const vars = {
|
|
6
5
|
backgroundColor: createVar(),
|
|
7
|
-
color: createVar()
|
|
8
|
-
}
|
|
6
|
+
color: createVar()
|
|
7
|
+
};
|
|
9
8
|
|
|
10
9
|
export const wrapper = style({
|
|
11
10
|
position: 'relative',
|
|
@@ -13,18 +12,18 @@ export const wrapper = style({
|
|
|
13
12
|
});
|
|
14
13
|
|
|
15
14
|
export const container = style({
|
|
16
|
-
zIndex: 50
|
|
15
|
+
zIndex: 50
|
|
17
16
|
});
|
|
18
17
|
|
|
19
18
|
export const tooltip = style({
|
|
20
19
|
vars: {
|
|
21
20
|
[vars.backgroundColor]: themeVars.color.gray[900],
|
|
22
|
-
[vars.color]: themeVars.color.gray[100]
|
|
21
|
+
[vars.color]: themeVars.color.gray[100]
|
|
23
22
|
},
|
|
24
23
|
zIndex: 50,
|
|
25
24
|
transition: 'opacity 0.3s, ease',
|
|
26
25
|
position: 'fixed',
|
|
27
|
-
fontSize:
|
|
26
|
+
fontSize: '13px',
|
|
28
27
|
fontWeight: 'normal',
|
|
29
28
|
color: vars.color,
|
|
30
29
|
backgroundColor: vars.backgroundColor,
|
|
@@ -36,16 +35,16 @@ export const tooltip = style({
|
|
|
36
35
|
boxSizing: 'border-box',
|
|
37
36
|
selectors: {
|
|
38
37
|
'&[data-popper-placement^="top"]': {
|
|
39
|
-
margin: `${themeVars.space[1]} 0 ${themeVars.space[3]} 0
|
|
38
|
+
margin: `${themeVars.space[1]} 0 ${themeVars.space[3]} 0`
|
|
40
39
|
},
|
|
41
40
|
'&[data-popper-placement^="bottom"]': {
|
|
42
|
-
margin: `${themeVars.space[3]} 0 ${themeVars.space[1]} 0
|
|
41
|
+
margin: `${themeVars.space[3]} 0 ${themeVars.space[1]} 0`
|
|
43
42
|
},
|
|
44
43
|
'&[data-popper-placement^="left"]': {
|
|
45
|
-
margin: `0 ${themeVars.space[3]} 0 ${themeVars.space[1]}
|
|
44
|
+
margin: `0 ${themeVars.space[3]} 0 ${themeVars.space[1]}`
|
|
46
45
|
},
|
|
47
46
|
'&[data-popper-placement^="right"]': {
|
|
48
|
-
margin: `0 ${themeVars.space[1]} 0 ${themeVars.space[3]}
|
|
47
|
+
margin: `0 ${themeVars.space[1]} 0 ${themeVars.space[3]}`
|
|
49
48
|
}
|
|
50
49
|
}
|
|
51
50
|
});
|
|
@@ -53,27 +52,27 @@ export const tooltip = style({
|
|
|
53
52
|
export const reverse = style({
|
|
54
53
|
vars: {
|
|
55
54
|
[vars.backgroundColor]: themeVars.color.gray[100],
|
|
56
|
-
[vars.color]: themeVars.color.gray[900]
|
|
55
|
+
[vars.color]: themeVars.color.gray[900]
|
|
57
56
|
}
|
|
58
57
|
});
|
|
59
58
|
|
|
60
|
-
const fadeOutAnimation =
|
|
59
|
+
const fadeOutAnimation = 'fade-out-animation';
|
|
61
60
|
globalKeyframes(fadeOutAnimation, {
|
|
62
|
-
|
|
63
|
-
opacity: 1
|
|
61
|
+
from: {
|
|
62
|
+
opacity: 1
|
|
64
63
|
},
|
|
65
|
-
|
|
66
|
-
opacity: 0
|
|
64
|
+
to: {
|
|
65
|
+
opacity: 0
|
|
67
66
|
}
|
|
68
67
|
});
|
|
69
68
|
|
|
70
|
-
const fadeInAnimation =
|
|
69
|
+
const fadeInAnimation = 'fade-in-animation';
|
|
71
70
|
globalKeyframes(fadeInAnimation, {
|
|
72
71
|
'0%': {
|
|
73
|
-
opacity: 0
|
|
72
|
+
opacity: 0
|
|
74
73
|
},
|
|
75
74
|
'100%': {
|
|
76
|
-
opacity: 1
|
|
75
|
+
opacity: 1
|
|
77
76
|
}
|
|
78
77
|
});
|
|
79
78
|
|
|
@@ -81,11 +80,11 @@ export const fadeEnter = style({
|
|
|
81
80
|
animationName: fadeInAnimation,
|
|
82
81
|
animationDuration: '0.125s',
|
|
83
82
|
animationTimingFunction: 'ease-in-out',
|
|
84
|
-
transition: themeVars.transition.default
|
|
85
|
-
})
|
|
83
|
+
transition: themeVars.transition.default
|
|
84
|
+
});
|
|
86
85
|
|
|
87
86
|
export const fadeLeave = style({
|
|
88
87
|
animationName: fadeOutAnimation,
|
|
89
88
|
animationDuration: '0.2s',
|
|
90
|
-
animationTimingFunction: 'ease-in-out'
|
|
91
|
-
})
|
|
89
|
+
animationTimingFunction: 'ease-in-out'
|
|
90
|
+
});
|
|
@@ -1,16 +1,12 @@
|
|
|
1
|
-
import MTransfer from
|
|
1
|
+
import MTransfer from '../Transfer.vue';
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
MTransferBasic
|
|
5
|
-
} from "./index";
|
|
3
|
+
import { MTransferBasic } from './index';
|
|
6
4
|
|
|
7
|
-
import {
|
|
8
|
-
createStory,
|
|
9
|
-
} from "../../../__storybook__";
|
|
5
|
+
import { createStory } from '../../../__storybook__';
|
|
10
6
|
|
|
11
7
|
export default {
|
|
12
8
|
component: MTransfer,
|
|
13
|
-
title:
|
|
9
|
+
title: 'Components/Transfer'
|
|
14
10
|
};
|
|
15
11
|
|
|
16
|
-
export const Basic = createStory(MTransferBasic);
|
|
12
|
+
export const Basic = createStory(MTransferBasic);
|
|
@@ -1,49 +1,50 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
1
|
+
import {
|
|
2
|
+
createVar,
|
|
3
|
+
globalStyle,
|
|
4
|
+
style,
|
|
5
|
+
styleVariants
|
|
6
|
+
} from '@vanilla-extract/css';
|
|
7
|
+
import { themeVars } from '../../../styles/theme.css';
|
|
7
8
|
|
|
9
|
+
export const vars = {};
|
|
8
10
|
|
|
9
11
|
export const wrapper = style({
|
|
10
|
-
display:
|
|
11
|
-
flexWrap:
|
|
12
|
-
wordBreak:
|
|
12
|
+
display: 'flex',
|
|
13
|
+
flexWrap: 'nowrap',
|
|
14
|
+
wordBreak: 'break-word',
|
|
13
15
|
fontSize: themeVars.fontSize.base,
|
|
14
|
-
width:
|
|
15
|
-
height:
|
|
16
|
+
width: '100%',
|
|
17
|
+
height: '300px',
|
|
16
18
|
border: `1px solid ${themeVars.color.gray[300]}`,
|
|
17
19
|
borderRadius: themeVars.rounded.default,
|
|
18
|
-
overflow:
|
|
20
|
+
overflow: 'hidden'
|
|
19
21
|
});
|
|
20
22
|
|
|
21
23
|
export const list = style({
|
|
22
24
|
flex: 1,
|
|
23
25
|
minWidth: 0,
|
|
24
|
-
height:
|
|
25
|
-
display:
|
|
26
|
-
flexDirection:
|
|
27
|
-
overflow:
|
|
28
|
-
borderRight: `1px solid ${themeVars.color.gray[200]}
|
|
26
|
+
height: 'inherit',
|
|
27
|
+
display: 'flex',
|
|
28
|
+
flexDirection: 'column',
|
|
29
|
+
overflow: 'auto',
|
|
30
|
+
borderRight: `1px solid ${themeVars.color.gray[200]}`
|
|
29
31
|
});
|
|
30
32
|
|
|
31
|
-
|
|
32
33
|
// lastchild of list in wrapper
|
|
33
34
|
globalStyle(`${wrapper} > ${list}:last-child`, {
|
|
34
|
-
borderRight:
|
|
35
|
-
})
|
|
35
|
+
borderRight: 'none'
|
|
36
|
+
});
|
|
36
37
|
|
|
37
38
|
export const listHeader = style({
|
|
38
|
-
minHeight:
|
|
39
|
-
boxSizing:
|
|
40
|
-
display:
|
|
39
|
+
minHeight: '40px',
|
|
40
|
+
boxSizing: 'border-box',
|
|
41
|
+
display: 'flex',
|
|
41
42
|
flexShrink: 0,
|
|
42
|
-
padding: `${themeVars.space[
|
|
43
|
-
alignItems:
|
|
44
|
-
position:
|
|
43
|
+
padding: `${themeVars.space['4']}`,
|
|
44
|
+
alignItems: 'center',
|
|
45
|
+
position: 'sticky',
|
|
45
46
|
top: 0,
|
|
46
|
-
backgroundColor:
|
|
47
|
+
backgroundColor: '#FFF',
|
|
47
48
|
color: themeVars.color.gray[900],
|
|
48
49
|
zIndex: 1,
|
|
49
50
|
fontWeight: 500,
|
|
@@ -53,28 +54,28 @@ export const listHeader = style({
|
|
|
53
54
|
export const listBody = style({
|
|
54
55
|
flexBasis: 0,
|
|
55
56
|
flexGrow: 1,
|
|
56
|
-
boxSizing:
|
|
57
|
-
position:
|
|
58
|
-
display:
|
|
59
|
-
flexDirection:
|
|
57
|
+
boxSizing: 'border-box',
|
|
58
|
+
position: 'relative',
|
|
59
|
+
display: 'flex',
|
|
60
|
+
flexDirection: 'column'
|
|
60
61
|
});
|
|
61
62
|
|
|
62
63
|
export const listContainer = style({
|
|
63
64
|
flex: 1,
|
|
64
|
-
position:
|
|
65
|
-
overflow:
|
|
65
|
+
position: 'relative',
|
|
66
|
+
overflow: 'auto'
|
|
66
67
|
});
|
|
67
68
|
|
|
68
69
|
export const transferItem = style({
|
|
69
|
-
padding: `0 ${themeVars.space[
|
|
70
|
-
minHeight:
|
|
71
|
-
display:
|
|
72
|
-
alignItems:
|
|
70
|
+
padding: `0 ${themeVars.space['4']}`,
|
|
71
|
+
minHeight: '35px',
|
|
72
|
+
display: 'flex',
|
|
73
|
+
alignItems: 'center',
|
|
73
74
|
color: themeVars.color.gray[800],
|
|
74
|
-
cursor:
|
|
75
|
+
cursor: 'pointer',
|
|
75
76
|
fontSize: themeVars.fontSize.base,
|
|
76
|
-
userSelect:
|
|
77
|
+
userSelect: 'none',
|
|
77
78
|
':hover': {
|
|
78
79
|
backgroundColor: themeVars.color.gray[150]
|
|
79
80
|
}
|
|
80
|
-
})
|
|
81
|
+
});
|
|
@@ -1,16 +1,12 @@
|
|
|
1
|
-
import MTree from
|
|
1
|
+
import MTree from '../Tree.vue';
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
MTreeBasic
|
|
5
|
-
} from "./index";
|
|
3
|
+
import { MTreeBasic } from './index';
|
|
6
4
|
|
|
7
|
-
import {
|
|
8
|
-
createStory,
|
|
9
|
-
} from "../../../__storybook__";
|
|
5
|
+
import { createStory } from '../../../__storybook__';
|
|
10
6
|
|
|
11
7
|
export default {
|
|
12
8
|
component: MTree,
|
|
13
|
-
title:
|
|
14
|
-
}
|
|
9
|
+
title: 'Components/Tree'
|
|
10
|
+
};
|
|
15
11
|
|
|
16
|
-
export const Basic = createStory(MTreeBasic)
|
|
12
|
+
export const Basic = createStory(MTreeBasic);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {ExtractPublicPropTypes, PropType} from
|
|
1
|
+
import type { ExtractPublicPropTypes, PropType } from 'vue';
|
|
2
2
|
import type {
|
|
3
3
|
TreeOptions,
|
|
4
4
|
Key,
|
|
@@ -6,24 +6,24 @@ import type {
|
|
|
6
6
|
OnUpdateIndeterminateKeys,
|
|
7
7
|
onUpdateExpandedKeys,
|
|
8
8
|
TreeNodeDoubleClick
|
|
9
|
-
} from
|
|
10
|
-
import type {TreeMateOptions} from
|
|
11
|
-
import type {MaybeArray} from
|
|
9
|
+
} from './types';
|
|
10
|
+
import type { TreeMateOptions } from 'treemate';
|
|
11
|
+
import type { MaybeArray } from '../../call';
|
|
12
12
|
|
|
13
13
|
export const treeSharedProps = {
|
|
14
14
|
expandedKeys: Array as PropType<Key[]>,
|
|
15
15
|
defaultExpandAll: Boolean,
|
|
16
16
|
keyField: {
|
|
17
17
|
type: String,
|
|
18
|
-
default: 'key'
|
|
18
|
+
default: 'key'
|
|
19
19
|
},
|
|
20
20
|
labelField: {
|
|
21
21
|
type: String,
|
|
22
|
-
default: 'label'
|
|
22
|
+
default: 'label'
|
|
23
23
|
},
|
|
24
24
|
childrenField: {
|
|
25
25
|
type: String,
|
|
26
|
-
default: 'children'
|
|
26
|
+
default: 'children'
|
|
27
27
|
},
|
|
28
28
|
onDblClick: Function as PropType<TreeNodeDoubleClick>,
|
|
29
29
|
onUpdateIndeterminateKeys: [Function, Array] as PropType<
|
|
@@ -40,7 +40,7 @@ export const treeSharedProps = {
|
|
|
40
40
|
>
|
|
41
41
|
} as const;
|
|
42
42
|
|
|
43
|
-
export const treeProps= {
|
|
43
|
+
export const treeProps = {
|
|
44
44
|
data: {
|
|
45
45
|
type: Array as PropType<TreeOptions>,
|
|
46
46
|
default: () => []
|
|
@@ -64,32 +64,34 @@ export const treeProps= {
|
|
|
64
64
|
virtualScroll: Boolean,
|
|
65
65
|
nodeProps: Function as PropType<TreeNodeProps>,
|
|
66
66
|
getChildren: Function as PropType<GetChildren>,
|
|
67
|
-
...treeSharedProps
|
|
67
|
+
...treeSharedProps
|
|
68
68
|
} as const;
|
|
69
69
|
|
|
70
70
|
export type TreeProps = ExtractPublicPropTypes<typeof treeProps>;
|
|
71
|
-
export type GetChildren = (option: any) => unknown
|
|
71
|
+
export type GetChildren = (option: any) => unknown;
|
|
72
72
|
|
|
73
|
-
export function createTreeMateOptions<T>
|
|
73
|
+
export function createTreeMateOptions<T>(
|
|
74
74
|
keyField: string,
|
|
75
75
|
childrenField: string,
|
|
76
76
|
disabledField: string,
|
|
77
|
-
getChildren: GetChildren | undefined
|
|
77
|
+
getChildren: GetChildren | undefined
|
|
78
78
|
): TreeMateOptions<T, T, T> {
|
|
79
|
-
const settledGetChildren: GetChildren =
|
|
80
|
-
|
|
81
|
-
|
|
79
|
+
const settledGetChildren: GetChildren =
|
|
80
|
+
getChildren ||
|
|
81
|
+
((node: T) => {
|
|
82
|
+
return (node as any)[childrenField];
|
|
83
|
+
});
|
|
82
84
|
|
|
83
85
|
return {
|
|
84
86
|
getIsGroup() {
|
|
85
87
|
return false;
|
|
86
88
|
},
|
|
87
89
|
getKey(node: T) {
|
|
88
|
-
return (node as any)[keyField]
|
|
90
|
+
return (node as any)[keyField];
|
|
89
91
|
},
|
|
90
92
|
getChildren: settledGetChildren,
|
|
91
93
|
getDisabled(node: T) {
|
|
92
|
-
return !!(
|
|
94
|
+
return !!(node as any)[disabledField];
|
|
93
95
|
}
|
|
94
|
-
}
|
|
96
|
+
};
|
|
95
97
|
}
|