@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.
Files changed (159) hide show
  1. package/lib/components/avatargroup/symbol.d.ts +2 -2
  2. package/lib/components/breadcrumb/style/index.d.ts +1 -1
  3. package/lib/components/breadcrumb/symbol.d.ts +1 -1
  4. package/lib/components/buttongroup/symbol.d.ts +2 -2
  5. package/lib/components/colorpicker/ColorPicker.vue.d.ts +1 -1
  6. package/lib/components/dropdown/Dropdown.vue.d.ts +1 -1
  7. package/lib/components/dropdown/symbol.d.ts +1 -1
  8. package/lib/components/form/symbol.d.ts +1 -1
  9. package/lib/components/messageprovider/style/index.d.ts +1 -1
  10. package/lib/components/modal/Modal.vue.d.ts +6 -3
  11. package/lib/components/modal/style/Modal.css.d.ts +3 -0
  12. package/lib/components/radiobuttongroup/symbol.d.ts +2 -2
  13. package/lib/components/tooltip/Tooltip.vue.d.ts +1 -1
  14. package/lib/components/tree/props.d.ts +4 -4
  15. package/lib/components/tree/types.d.ts +10 -10
  16. package/lib/composables/element.d.ts +1 -1
  17. package/lib/composables/useInteractive.d.ts +1 -1
  18. package/lib/composables/useMount.d.ts +1 -1
  19. package/lib/composables/usePopper.d.ts +2 -2
  20. package/lib/composables/useZIndex.d.ts +1 -1
  21. package/lib/index.cjs.js +9 -9
  22. package/lib/index.es.js +2256 -2213
  23. package/lib/install.d.ts +1 -1
  24. package/lib/nuxt.js +17 -15
  25. package/lib/nuxt.plugin.js +6 -6
  26. package/lib/style.css +1 -1
  27. package/package.json +89 -79
  28. package/src/__storybook__/argTypes.ts +5 -13
  29. package/src/__storybook__/createStory.ts +10 -10
  30. package/src/call.ts +14 -14
  31. package/src/components/avatar/Avatar.vue +1 -1
  32. package/src/components/avatar/examples/index.stories.ts +4 -7
  33. package/src/components/avatar/style/Avatar.css.ts +17 -17
  34. package/src/components/avatargroup/examples/index.stories.ts +5 -10
  35. package/src/components/avatargroup/style/AvatarGroup.css.ts +9 -4
  36. package/src/components/avatargroup/symbol.ts +5 -5
  37. package/src/components/badge/examples/index.stories.ts +4 -6
  38. package/src/components/badge/style/Badge.css.ts +36 -36
  39. package/src/components/breadcrumb/examples/index.stories.ts +6 -10
  40. package/src/components/breadcrumb/style/Breadcrumb.css.ts +17 -17
  41. package/src/components/breadcrumb/style/index.ts +1 -1
  42. package/src/components/breadcrumb/symbol.ts +4 -3
  43. package/src/components/button/examples/index.stories.ts +4 -4
  44. package/src/components/button/style/Button.css.ts +143 -133
  45. package/src/components/buttongroup/examples/index.stories.ts +6 -12
  46. package/src/components/buttongroup/style/ButtonGroup.css.ts +13 -11
  47. package/src/components/buttongroup/symbol.ts +5 -4
  48. package/src/components/checkbox/Checkbox.vue +8 -8
  49. package/src/components/checkbox/examples/index.stories.ts +4 -9
  50. package/src/components/checkbox/examples/index.ts +0 -1
  51. package/src/components/checkbox/style/Checkbox.css.ts +31 -27
  52. package/src/components/checkbox/style/index.ts +1 -1
  53. package/src/components/colorpicker/examples/index.stories.ts +5 -10
  54. package/src/components/colorpicker/examples/index.ts +1 -1
  55. package/src/components/colorpicker/style/ColorPicker.css.ts +22 -14
  56. package/src/components/colorpicker/utils.ts +46 -28
  57. package/src/components/confirm/examples/index.stories.ts +5 -8
  58. package/src/components/confirm/props.ts +2 -2
  59. package/src/components/confirm/providerProps.ts +1 -2
  60. package/src/components/confirm/types.ts +15 -16
  61. package/src/components/confirm/useConfirm.ts +3 -1
  62. package/src/components/dialog/examples/index.stories.ts +5 -9
  63. package/src/components/dialog/style/Dialog.css.ts +38 -37
  64. package/src/components/dropdown/examples/index.stories.ts +3 -7
  65. package/src/components/dropdown/hooks.ts +20 -20
  66. package/src/components/dropdown/style/Dropdown.css.ts +24 -24
  67. package/src/components/dropdown/symbol.ts +3 -2
  68. package/src/components/form/Form.vue +1 -1
  69. package/src/components/form/examples/index.stories.ts +2 -4
  70. package/src/components/form/style/Form.css.ts +13 -8
  71. package/src/components/form/style/index.ts +2 -2
  72. package/src/components/form/symbol.ts +10 -5
  73. package/src/components/image/examples/index.stories.ts +5 -7
  74. package/src/components/input/Input.vue +8 -9
  75. package/src/components/input/examples/index.stories.ts +5 -7
  76. package/src/components/input/style/Input.css.ts +40 -43
  77. package/src/components/link/examples/index.stories.ts +4 -9
  78. package/src/components/messageprovider/examples/index.stories.ts +5 -8
  79. package/src/components/messageprovider/style/Message.css.ts +31 -31
  80. package/src/components/messageprovider/style/index.ts +1 -1
  81. package/src/components/messageprovider/types.ts +31 -22
  82. package/src/components/messageprovider/useMessage.ts +6 -4
  83. package/src/components/modal/Modal.vue +72 -54
  84. package/src/components/modal/examples/index.stories.ts +6 -10
  85. package/src/components/modal/examples/index.ts +1 -0
  86. package/src/components/modal/examples/sidebar.vue +75 -0
  87. package/src/components/modal/style/Modal.css.ts +91 -72
  88. package/src/components/pagination/examples/index.stories.ts +5 -9
  89. package/src/components/pagination/examples/index.ts +1 -1
  90. package/src/components/pagination/style/Pagination.css.ts +41 -37
  91. package/src/components/radio/Radio.vue +7 -7
  92. package/src/components/radio/examples/index.stories.ts +4 -9
  93. package/src/components/radio/examples/index.ts +0 -1
  94. package/src/components/radio/style/Checkbox.css.ts +30 -31
  95. package/src/components/radio/style/index.ts +1 -1
  96. package/src/components/radiobutton/RadioButton.vue +3 -3
  97. package/src/components/radiobutton/style/RadioButton.css.ts +41 -36
  98. package/src/components/radiobuttongroup/examples/index.stories.ts +6 -10
  99. package/src/components/radiobuttongroup/examples/index.ts +0 -1
  100. package/src/components/radiobuttongroup/style/RadioButtonGroup.css.ts +14 -14
  101. package/src/components/radiobuttongroup/style/index.ts +1 -1
  102. package/src/components/radiobuttongroup/symbol.ts +8 -7
  103. package/src/components/renderer/examlpes/index.stories.ts +4 -8
  104. package/src/components/renderer/props.ts +2 -3
  105. package/src/components/renderer/renderer.ts +3 -3
  106. package/src/components/select/Select.vue +3 -4
  107. package/src/components/select/examples/index.stories.ts +4 -10
  108. package/src/components/select/style/Select.css.ts +62 -61
  109. package/src/components/skeleton/examples/index.stories.ts +5 -9
  110. package/src/components/skeleton/style/Skeleton.css.ts +16 -16
  111. package/src/components/skeleton/style/index.ts +2 -2
  112. package/src/components/slider/style/Slider.css.ts +12 -5
  113. package/src/components/switch/Switch.vue +4 -4
  114. package/src/components/switch/examples/index.stories.ts +4 -9
  115. package/src/components/switch/examples/index.ts +0 -1
  116. package/src/components/switch/style/Switch.css.ts +56 -57
  117. package/src/components/switch/style/index.ts +1 -1
  118. package/src/components/tab/examples/index.stories.ts +5 -11
  119. package/src/components/table/examples/index.stories.ts +6 -12
  120. package/src/components/table/style/Table.css.ts +22 -17
  121. package/src/components/table/style/index.ts +1 -1
  122. package/src/components/table/types/index.ts +1 -1
  123. package/src/components/tag/examples/index.stories.ts +4 -10
  124. package/src/components/tag/style/Tag.css.ts +14 -9
  125. package/src/components/textarea/Textarea.vue +7 -8
  126. package/src/components/textarea/examples/index.stories.ts +4 -8
  127. package/src/components/textarea/style/Textarea.css.ts +33 -33
  128. package/src/components/tooltip/examples/index.stories.ts +5 -10
  129. package/src/components/tooltip/examples/index.ts +2 -2
  130. package/src/components/tooltip/style/Tooltip.css.ts +24 -25
  131. package/src/components/transfer/examples/index.stories.ts +5 -9
  132. package/src/components/transfer/style/Transfer.css.ts +41 -40
  133. package/src/components/tree/examples/index.stories.ts +6 -10
  134. package/src/components/tree/props.ts +20 -18
  135. package/src/components/tree/style/Tree.css.ts +36 -31
  136. package/src/components/tree/types.ts +60 -62
  137. package/src/components/virtualscroll/examples/index.stories.ts +4 -8
  138. package/src/components/virtualscroll/style/VirtualScroll.css.ts +1 -2
  139. package/src/composables/element.ts +4 -4
  140. package/src/composables/useCachedUid.ts +7 -6
  141. package/src/composables/useEventListener.ts +11 -6
  142. package/src/composables/useInput.ts +63 -41
  143. package/src/composables/useInteractive.ts +10 -11
  144. package/src/composables/useMergedState.ts +7 -7
  145. package/src/composables/useMount.ts +11 -11
  146. package/src/composables/usePopper.ts +57 -36
  147. package/src/composables/useZIndex.ts +5 -5
  148. package/src/create.ts +10 -6
  149. package/src/examples/cards/cards.stories.ts +3 -3
  150. package/src/examples/modal/modal.stories.ts +3 -3
  151. package/src/exports/nuxt.js +17 -15
  152. package/src/exports/nuxt.plugin.js +6 -6
  153. package/src/index.ts +0 -2
  154. package/src/install.ts +5 -5
  155. package/src/shims-vue.d.ts +3 -3
  156. package/src/styles/theme.css.ts +51 -43
  157. package/src/styles/transitions.css.ts +26 -28
  158. package/src/types/props.ts +16 -2
  159. package/src/utils/injection.ts +3 -3
@@ -1,12 +1,12 @@
1
- import {createVar, style, styleVariants} from "@vanilla-extract/css";
2
- import {themeVars} from "../../../styles/theme.css";
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: "500",
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 "../Tooltip.vue";
2
- import MButton from "@/components/button/Button.vue";
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 "./basic.vue";
2
- export { default as MTooltipPlacement } from "./placement.vue";
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 "../../../styles/theme.css";
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: "13px",
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 = "fade-out-animation";
59
+ const fadeOutAnimation = 'fade-out-animation';
61
60
  globalKeyframes(fadeOutAnimation, {
62
- 'from': {
63
- opacity: 1,
61
+ from: {
62
+ opacity: 1
64
63
  },
65
- 'to': {
66
- opacity: 0,
64
+ to: {
65
+ opacity: 0
67
66
  }
68
67
  });
69
68
 
70
- const fadeInAnimation = "fade-in-animation";
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 "../Transfer.vue";
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: "Components/Transfer",
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 { createVar, globalStyle, style, styleVariants } from "@vanilla-extract/css";
2
- import { themeVars } from "../../../styles/theme.css";
3
-
4
- export const vars = {
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: "flex",
11
- flexWrap: "nowrap",
12
- wordBreak: "break-word",
12
+ display: 'flex',
13
+ flexWrap: 'nowrap',
14
+ wordBreak: 'break-word',
13
15
  fontSize: themeVars.fontSize.base,
14
- width: "100%",
15
- height: "300px",
16
+ width: '100%',
17
+ height: '300px',
16
18
  border: `1px solid ${themeVars.color.gray[300]}`,
17
19
  borderRadius: themeVars.rounded.default,
18
- overflow: "hidden"
20
+ overflow: 'hidden'
19
21
  });
20
22
 
21
23
  export const list = style({
22
24
  flex: 1,
23
25
  minWidth: 0,
24
- height: "inherit",
25
- display: "flex",
26
- flexDirection: "column",
27
- overflow: "auto",
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: "none"
35
- })
35
+ borderRight: 'none'
36
+ });
36
37
 
37
38
  export const listHeader = style({
38
- minHeight: "40px",
39
- boxSizing: "border-box",
40
- display: "flex",
39
+ minHeight: '40px',
40
+ boxSizing: 'border-box',
41
+ display: 'flex',
41
42
  flexShrink: 0,
42
- padding: `${themeVars.space["4"]}`,
43
- alignItems: "center",
44
- position: "sticky",
43
+ padding: `${themeVars.space['4']}`,
44
+ alignItems: 'center',
45
+ position: 'sticky',
45
46
  top: 0,
46
- backgroundColor: "#FFF",
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: "border-box",
57
- position: "relative",
58
- display: "flex",
59
- flexDirection: "column",
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: "relative",
65
- overflow: "auto",
65
+ position: 'relative',
66
+ overflow: 'auto'
66
67
  });
67
68
 
68
69
  export const transferItem = style({
69
- padding: `0 ${themeVars.space["4"]}`,
70
- minHeight: "35px",
71
- display: "flex",
72
- alignItems: "center",
70
+ padding: `0 ${themeVars.space['4']}`,
71
+ minHeight: '35px',
72
+ display: 'flex',
73
+ alignItems: 'center',
73
74
  color: themeVars.color.gray[800],
74
- cursor: "pointer",
75
+ cursor: 'pointer',
75
76
  fontSize: themeVars.fontSize.base,
76
- userSelect: "none",
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 "../Tree.vue";
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: "Components/Tree"
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 "vue";
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 "./types";
10
- import type {TreeMateOptions} from "treemate";
11
- import type {MaybeArray} from "../../call";
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 = getChildren || ((node: T) => {
80
- return (node as any)[childrenField]
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 !!((node as any)[disabledField]);
94
+ return !!(node as any)[disabledField];
93
95
  }
94
- }
96
+ };
95
97
  }