@fastkit/vui 0.6.37 → 0.6.41
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/dist/tool/index.js +3 -0
- package/dist/tool/vite-plugin.d.ts.map +1 -1
- package/dist/vui.cjs.js +181 -5
- package/dist/vui.cjs.prod.js +181 -5
- package/dist/vui.css +24 -14
- package/dist/vui.d.ts +3596 -16
- package/dist/vui.esm-bundler.js +181 -7
- package/dist/vui.min.css +1 -1
- package/dist/vui.min.css.map +1 -1
- package/package.json +8 -7
- package/src/.DS_Store +0 -0
- package/src/assets/.DS_Store +0 -0
- package/src/assets/builtins/color-scheme.ts +9 -0
- package/src/assets/builtins/media-match.ts +3 -0
- package/src/components/.DS_Store +0 -0
- package/src/components/VAccordion/VAccordion.scss +2 -0
- package/src/components/VAccordion/VAccordion.tsx +5 -0
- package/src/components/VAccordion/index.ts +1 -0
- package/src/components/VApp/VApp.tsx +17 -0
- package/src/components/VApp/index.ts +1 -0
- package/src/components/VBreadcrumbs/VBreadcrumbs.scss +61 -0
- package/src/components/VBreadcrumbs/VBreadcrumbs.tsx +137 -0
- package/src/components/VBreadcrumbs/index.ts +1 -0
- package/src/components/VButton/.DS_Store +0 -0
- package/src/components/VButton/VButton.scss +137 -0
- package/src/components/VButton/VButton.tsx +148 -0
- package/src/components/VButton/VButtonGroup.scss +23 -0
- package/src/components/VButton/VButtonGroup.tsx +81 -0
- package/src/components/VButton/index.ts +2 -0
- package/src/components/VCard/VCard.scss +3 -0
- package/src/components/VCard/VCard.tsx +20 -0
- package/src/components/VCard/VCardActions.scss +10 -0
- package/src/components/VCard/VCardActions.tsx +16 -0
- package/src/components/VCard/VCardContent.scss +3 -0
- package/src/components/VCard/VCardContent.tsx +16 -0
- package/src/components/VCard/index.ts +3 -0
- package/src/components/VCheckable/VCheckable.scss +103 -0
- package/src/components/VCheckable/VCheckable.tsx +60 -0
- package/src/components/VCheckable/index.ts +1 -0
- package/src/components/VCheckbox/VCheckbox.scss +56 -0
- package/src/components/VCheckbox/VCheckbox.tsx +63 -0
- package/src/components/VCheckbox/index.ts +1 -0
- package/src/components/VCheckboxGroup/.DS_Store +0 -0
- package/src/components/VCheckboxGroup/VCheckboxGroup.tsx +11 -0
- package/src/components/VCheckboxGroup/index.ts +1 -0
- package/src/components/VContentSwitcher/VContentSwitcher.scss +73 -0
- package/src/components/VContentSwitcher/VContentSwitcher.tsx +156 -0
- package/src/components/VContentSwitcher/index.ts +1 -0
- package/src/components/VControlField/VControlField.scss +183 -0
- package/src/components/VControlField/VControlField.tsx +152 -0
- package/src/components/VControlField/index.ts +1 -0
- package/src/components/VDataTable/VDataTable.scss +230 -0
- package/src/components/VDataTable/VDataTable.tsx +761 -0
- package/src/components/VDataTable/index.ts +1 -0
- package/src/components/VDrawerLayout/VDrawerLayout.scss +26 -0
- package/src/components/VDrawerLayout/VDrawerLayout.tsx +35 -0
- package/src/components/VDrawerLayout/index.ts +1 -0
- package/src/components/VForm/VForm.tsx +77 -0
- package/src/components/VForm/index.ts +1 -0
- package/src/components/VFormControl/VFormControl.scss +59 -0
- package/src/components/VFormControl/VFormControl.tsx +85 -0
- package/src/components/VFormControl/index.ts +1 -0
- package/src/components/VGrid/VGridContainer.scss +4 -0
- package/src/components/VGrid/VGridContainer.tsx +191 -0
- package/src/components/VGrid/VGridItem.scss +3 -0
- package/src/components/VGrid/VGridItem.tsx +114 -0
- package/src/components/VGrid/index.ts +2 -0
- package/src/components/VGrid/schemes.ts +28 -0
- package/src/components/VHero/.DS_Store +0 -0
- package/src/components/VHero/VHero.scss +26 -0
- package/src/components/VHero/VHero.tsx +52 -0
- package/src/components/VHero/index.ts +1 -0
- package/src/components/VIcon/VIcon.scss +22 -0
- package/src/components/VIcon/VIcon.tsx +110 -0
- package/src/components/VIcon/index.ts +1 -0
- package/src/components/VListTile/VListTile.scss +71 -0
- package/src/components/VListTile/VListTile.tsx +121 -0
- package/src/components/VListTile/index.ts +1 -0
- package/src/components/VNavigation/VNavigation.scss +12 -0
- package/src/components/VNavigation/VNavigation.tsx +79 -0
- package/src/components/VNavigation/VNavigationItem.scss +14 -0
- package/src/components/VNavigation/VNavigationItem.tsx +252 -0
- package/src/components/VNavigation/index.ts +2 -0
- package/src/components/VOption/VOption.scss +61 -0
- package/src/components/VOption/VOption.tsx +52 -0
- package/src/components/VOption/index.ts +1 -0
- package/src/components/VOptionGroup/VOptionGroup.scss +3 -0
- package/src/components/VOptionGroup/VOptionGroup.tsx +55 -0
- package/src/components/VOptionGroup/index.ts +1 -0
- package/src/components/VPagination/VPagination.scss +100 -0
- package/src/components/VPagination/VPagination.tsx +346 -0
- package/src/components/VPagination/index.ts +1 -0
- package/src/components/VPaper/VPaper.scss +37 -0
- package/src/components/VPaper/VPaper.tsx +78 -0
- package/src/components/VPaper/index.ts +1 -0
- package/src/components/VRadio/.DS_Store +0 -0
- package/src/components/VRadio/VRadio.scss +66 -0
- package/src/components/VRadio/VRadio.tsx +56 -0
- package/src/components/VRadio/index.ts +1 -0
- package/src/components/VRadioGroup/.DS_Store +0 -0
- package/src/components/VRadioGroup/VRadioGroup.tsx +10 -0
- package/src/components/VRadioGroup/index.ts +1 -0
- package/src/components/VSelect/VSelect.scss +78 -0
- package/src/components/VSelect/VSelect.tsx +204 -0
- package/src/components/VSelect/index.ts +1 -0
- package/src/components/VSwitch/VSwitch.scss +125 -0
- package/src/components/VSwitch/VSwitch.tsx +66 -0
- package/src/components/VSwitch/index.ts +1 -0
- package/src/components/VSwitchGroup/.DS_Store +0 -0
- package/src/components/VSwitchGroup/VSwitchGroup.tsx +11 -0
- package/src/components/VSwitchGroup/index.ts +1 -0
- package/src/components/VTabs/.DS_Store +0 -0
- package/src/components/VTabs/VTab.scss +73 -0
- package/src/components/VTabs/VTab.tsx +88 -0
- package/src/components/VTabs/VTabs.scss +49 -0
- package/src/components/VTabs/VTabs.tsx +315 -0
- package/src/components/VTabs/index.ts +1 -0
- package/src/components/VTextCounter/VTextCounter.scss +3 -0
- package/src/components/VTextCounter/VTextCounter.tsx +21 -0
- package/src/components/VTextCounter/index.ts +1 -0
- package/src/components/VTextField/VTextField.scss +45 -0
- package/src/components/VTextField/VTextField.tsx +96 -0
- package/src/components/VTextField/index.ts +1 -0
- package/src/components/VTextarea/VTextarea.scss +41 -0
- package/src/components/VTextarea/VTextarea.tsx +93 -0
- package/src/components/VTextarea/index.ts +1 -0
- package/src/components/VToolbar/.DS_Store +0 -0
- package/src/components/VToolbar/VToolbar.scss +26 -0
- package/src/components/VToolbar/VToolbar.tsx +44 -0
- package/src/components/VToolbar/VToolbarEdge.scss +27 -0
- package/src/components/VToolbar/VToolbarEdge.tsx +35 -0
- package/src/components/VToolbar/VToolbarMenu.scss +7 -0
- package/src/components/VToolbar/VToolbarMenu.tsx +26 -0
- package/src/components/VToolbar/VToolbarTitle.scss +22 -0
- package/src/components/VToolbar/VToolbarTitle.tsx +25 -0
- package/src/components/VToolbar/index.ts +4 -0
- package/src/components/VWysiwygEditor/.DS_Store +0 -0
- package/src/components/VWysiwygEditor/VWysiwygEditor.scss +60 -0
- package/src/components/VWysiwygEditor/VWysiwygEditor.tsx +293 -0
- package/src/components/VWysiwygEditor/index.ts +2 -0
- package/src/components/VWysiwygEditor/schemes.ts +65 -0
- package/src/components/VWysiwygEditor/tools/bullet-list.ts +18 -0
- package/src/components/VWysiwygEditor/tools/format-bold.ts +19 -0
- package/src/components/VWysiwygEditor/tools/format-italic.ts +18 -0
- package/src/components/VWysiwygEditor/tools/format-underline.ts +18 -0
- package/src/components/VWysiwygEditor/tools/history.ts +26 -0
- package/src/components/VWysiwygEditor/tools/index.ts +8 -0
- package/src/components/VWysiwygEditor/tools/link.ts +57 -0
- package/src/components/VWysiwygEditor/tools/ordered-list.ts +21 -0
- package/src/components/VWysiwygEditor/tools/text-color.ts +14 -0
- package/src/components/index.ts +32 -0
- package/src/components/kits.ts +1 -0
- package/src/components/loading.ts +1 -0
- package/src/composables/.DS_Store +0 -0
- package/src/composables/control.ts +118 -0
- package/src/composables/elevation.ts +34 -0
- package/src/composables/form-selector.scss +11 -0
- package/src/composables/form-selector.tsx +101 -0
- package/src/composables/index.ts +4 -0
- package/src/composables/vui.ts +9 -0
- package/src/index.ts +10 -0
- package/src/injections.ts +61 -0
- package/src/logger.ts +7 -0
- package/src/plugin.tsx +76 -0
- package/src/schemes/control.ts +7 -0
- package/src/schemes/elevation.ts +26 -0
- package/src/schemes/index.ts +2 -0
- package/src/service.tsx +242 -0
- package/src/styles/.DS_Store +0 -0
- package/src/styles/after-effects/display-flow.scss +346 -0
- package/src/styles/after-effects/spacing.scss +155 -0
- package/src/styles/after-effects/text.scss +90 -0
- package/src/styles/after-effects.scss +3 -0
- package/src/styles/base.scss +14 -0
- package/src/styles/control.scss +11 -0
- package/src/styles/core/functions.scss +62 -0
- package/src/styles/core/typo.scss +56 -0
- package/src/styles/core.scss +2 -0
- package/src/styles/elevation.scss +9 -0
- package/src/styles/group.scss +57 -0
- package/src/styles/index.scss +9 -0
- package/src/styles/transition.scss +11 -0
- package/src/styles/typo.scss +11 -0
- package/src/styles/variables.scss +320 -0
- package/src/styles/wysiwyg.scss +24 -0
- package/src/tool/.DS_Store +0 -0
- package/src/tool/index.ts +2 -0
- package/src/tool/vite-plugin.ts +281 -0
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
.v-control-field {
|
|
2
|
+
position: relative;
|
|
3
|
+
display: inline-flex;
|
|
4
|
+
align-items: center;
|
|
5
|
+
width: 100%;
|
|
6
|
+
min-width: 0;
|
|
7
|
+
height: var(--control-field-height);
|
|
8
|
+
padding: 0 8px;
|
|
9
|
+
font-size: var(--control-field-font-size);
|
|
10
|
+
line-height: var(--control-field-line-height);
|
|
11
|
+
letter-spacing: var(--control-field-letter-spacing);
|
|
12
|
+
|
|
13
|
+
--my-bottom-color: var(--control-field-bottom-color);
|
|
14
|
+
--my-bottom-hover-color: var(--control-field-bottom-hover-color);
|
|
15
|
+
--my-focused-color: var(--main-color);
|
|
16
|
+
--my-fill-color: var(--control-field-fill-color);
|
|
17
|
+
--my-fill-hover-color: var(--control-field-fill-hover-color);
|
|
18
|
+
--my-outline-color: var(--control-field-outline-color);
|
|
19
|
+
--my-outline-hover-color: var(--control-field-outline-hover-color);
|
|
20
|
+
|
|
21
|
+
&--invalid:not(#{&}--disabled):not(#{&}--readonly) {
|
|
22
|
+
--my-bottom-color: var(--main-color);
|
|
23
|
+
--my-bottom-hover-color: var(--main-color);
|
|
24
|
+
--my-outline-color: var(--main-color);
|
|
25
|
+
--my-outline-hover-color: var(--main-color);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
&--readonly {
|
|
29
|
+
// pointer-events: none !important;
|
|
30
|
+
cursor: default;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
&--disabled {
|
|
34
|
+
color: var(--control-disabled-color);
|
|
35
|
+
pointer-events: none;
|
|
36
|
+
// cursor: not-allowed !important;
|
|
37
|
+
user-select: none;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
&::before,
|
|
41
|
+
&::after {
|
|
42
|
+
position: absolute;
|
|
43
|
+
right: 0;
|
|
44
|
+
bottom: 0;
|
|
45
|
+
left: 0;
|
|
46
|
+
pointer-events: none;
|
|
47
|
+
content: '';
|
|
48
|
+
// transition: all 0.2s;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
&::before {
|
|
52
|
+
height: 1px;
|
|
53
|
+
border-bottom: solid 1px var(--my-bottom-color);
|
|
54
|
+
transition: border-color 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
&::after {
|
|
58
|
+
height: 2px;
|
|
59
|
+
background: var(--my-focused-color);
|
|
60
|
+
transition: transform 200ms cubic-bezier(0, 0, 0.2, 1) 0ms;
|
|
61
|
+
transform: scaleX(0);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
&--focused,
|
|
65
|
+
&:focus-within {
|
|
66
|
+
--my-outline-color: var(--my-focused-color);
|
|
67
|
+
--my-outline-hover-color: var(--my-focused-color);
|
|
68
|
+
|
|
69
|
+
outline: none;
|
|
70
|
+
|
|
71
|
+
&::after {
|
|
72
|
+
transform: scaleX(1);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// &:focus-within {
|
|
77
|
+
// &::after {
|
|
78
|
+
// transform: scaleX(1);
|
|
79
|
+
// }
|
|
80
|
+
// }
|
|
81
|
+
|
|
82
|
+
&--auto-height {
|
|
83
|
+
height: auto;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
&__body {
|
|
87
|
+
display: flex;
|
|
88
|
+
flex: 1 1 auto;
|
|
89
|
+
align-items: stretch;
|
|
90
|
+
align-self: stretch;
|
|
91
|
+
// margin: 0 8px;
|
|
92
|
+
margin: 0;
|
|
93
|
+
// pointer-events: none;
|
|
94
|
+
|
|
95
|
+
// color: #f00;
|
|
96
|
+
|
|
97
|
+
// background-color: var(--control-fill-color);
|
|
98
|
+
// border: solid 1px;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
&--flat {
|
|
102
|
+
padding-right: 0;
|
|
103
|
+
padding-left: 0;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
&--filled {
|
|
107
|
+
background-color: var(--my-fill-color);
|
|
108
|
+
border-top-left-radius: var(--control-field-radius);
|
|
109
|
+
border-top-right-radius: var(--control-field-radius);
|
|
110
|
+
transition: background-color 200ms cubic-bezier(0, 0, 0.2, 1) 0ms;
|
|
111
|
+
|
|
112
|
+
&:hover:not(:focus-within) {
|
|
113
|
+
background-color: var(--my-fill-hover-color);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
&--flat:hover,
|
|
118
|
+
&--filled:hover {
|
|
119
|
+
&::before {
|
|
120
|
+
border-color: var(--my-bottom-hover-color);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
&--flat:hover {
|
|
125
|
+
&::before {
|
|
126
|
+
height: 2px;
|
|
127
|
+
border-bottom-width: 2px;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
&--flat#{&}--disabled,
|
|
132
|
+
&--filled#{&}--disabled {
|
|
133
|
+
&::before {
|
|
134
|
+
border-bottom-style: dotted;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
&--outlined {
|
|
139
|
+
// border: solid 1px var(--my-outline-color);
|
|
140
|
+
border-radius: var(--control-field-radius);
|
|
141
|
+
transition: box-shadow 200ms cubic-bezier(0, 0, 0.2, 1) 0ms;
|
|
142
|
+
|
|
143
|
+
&::before {
|
|
144
|
+
top: 0;
|
|
145
|
+
height: auto;
|
|
146
|
+
background: transparent;
|
|
147
|
+
border: solid 1px var(--my-outline-color);
|
|
148
|
+
border-radius: inherit;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
&:hover::before {
|
|
152
|
+
border-color: var(--my-outline-hover-color);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
&::after {
|
|
156
|
+
content: none;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
&:focus-within {
|
|
160
|
+
box-shadow: 0 0 1px var(--shadow-color),
|
|
161
|
+
0 0 2px 2px var(--focusShadow-color);
|
|
162
|
+
// border-color: var(--my-focused-color);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
&__adornment {
|
|
167
|
+
// pointer-events: none;
|
|
168
|
+
|
|
169
|
+
$my-offset: 0.25em;
|
|
170
|
+
|
|
171
|
+
&--start {
|
|
172
|
+
padding-right: $my-offset;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
&--end {
|
|
176
|
+
padding-left: $my-offset;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.v-icon {
|
|
180
|
+
font-size: 1.2em;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import './VControlField.scss';
|
|
2
|
+
import { computed, PropType, ref, defineComponent } from 'vue';
|
|
3
|
+
import {
|
|
4
|
+
useParentFormNode,
|
|
5
|
+
VNodeChildOrSlot,
|
|
6
|
+
resolveVNodeChildOrSlots,
|
|
7
|
+
TypedSlot,
|
|
8
|
+
createPropsOptions,
|
|
9
|
+
defineSlotsProps,
|
|
10
|
+
renderSlotOrEmpty,
|
|
11
|
+
} from '@fastkit/vue-kit';
|
|
12
|
+
import {
|
|
13
|
+
createControlProps,
|
|
14
|
+
useControl,
|
|
15
|
+
createControlFieldProviderProps,
|
|
16
|
+
useControlField,
|
|
17
|
+
} from '../../composables';
|
|
18
|
+
import { useVuiColorProvider } from '../../injections';
|
|
19
|
+
|
|
20
|
+
const ADORNMENT_POSITIONS = ['start', 'end'] as const;
|
|
21
|
+
|
|
22
|
+
export type AdornmentPosition = typeof ADORNMENT_POSITIONS[number];
|
|
23
|
+
|
|
24
|
+
export function createControlFieldProps() {
|
|
25
|
+
return {
|
|
26
|
+
...createPropsOptions({
|
|
27
|
+
startAdornment: {} as PropType<VNodeChildOrSlot>,
|
|
28
|
+
endAdornment: {} as PropType<VNodeChildOrSlot>,
|
|
29
|
+
tabindex: {
|
|
30
|
+
type: [String, Number],
|
|
31
|
+
default: 0,
|
|
32
|
+
},
|
|
33
|
+
}),
|
|
34
|
+
...createControlFieldProviderProps(),
|
|
35
|
+
...createControlProps(),
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// export const inputBoxSlots = {
|
|
40
|
+
// default: () => true,
|
|
41
|
+
// startAdornment: () => true,
|
|
42
|
+
// endAdornment: () => true,
|
|
43
|
+
// };
|
|
44
|
+
export interface InputBoxSlots {
|
|
45
|
+
default: void;
|
|
46
|
+
startAdornment: void;
|
|
47
|
+
endAdornment: void;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
type ResolvedSlots = Partial<Record<AdornmentPosition, TypedSlot<void>>>;
|
|
51
|
+
|
|
52
|
+
export const VControlField = defineComponent({
|
|
53
|
+
name: 'VControlField',
|
|
54
|
+
props: {
|
|
55
|
+
...createControlFieldProps(),
|
|
56
|
+
focused: Boolean,
|
|
57
|
+
autoHeight: Boolean,
|
|
58
|
+
...defineSlotsProps<InputBoxSlots>(),
|
|
59
|
+
},
|
|
60
|
+
// _slots: inputBoxSlots,
|
|
61
|
+
emits: {
|
|
62
|
+
click: (ev: MouseEvent) => true,
|
|
63
|
+
},
|
|
64
|
+
setup(props, ctx) {
|
|
65
|
+
const parentNode = useParentFormNode();
|
|
66
|
+
const control = useControl(props);
|
|
67
|
+
const inputBox = useControlField(props);
|
|
68
|
+
const hostElRef = ref<HTMLElement | null>(null);
|
|
69
|
+
|
|
70
|
+
const disabled = computed(() => !!parentNode && parentNode.isDisabled);
|
|
71
|
+
const invalid = computed(() => !!parentNode && parentNode.invalid);
|
|
72
|
+
const autoHeight = computed(() => props.autoHeight);
|
|
73
|
+
const readonly = computed(() => !!parentNode && parentNode.isReadonly);
|
|
74
|
+
// const computedTabindex = computed(() =>
|
|
75
|
+
// disabled.value ? -1 : props.tabindex,
|
|
76
|
+
// );
|
|
77
|
+
// const isOutlined = computed(() => inputBox.variant.value === 'outlined');
|
|
78
|
+
const colorProvider = useVuiColorProvider();
|
|
79
|
+
|
|
80
|
+
const classes = computed(() => {
|
|
81
|
+
const classes = [
|
|
82
|
+
'v-control-field',
|
|
83
|
+
`v-control-field--${inputBox.variant.value}`,
|
|
84
|
+
{
|
|
85
|
+
'v-control-field--disabled': disabled.value,
|
|
86
|
+
'v-control-field--invalid': invalid.value,
|
|
87
|
+
'v-control-field--readonly': readonly.value,
|
|
88
|
+
'v-control-field--focused': props.focused,
|
|
89
|
+
'v-control-field--auto-height': autoHeight.value,
|
|
90
|
+
},
|
|
91
|
+
control.classes.value,
|
|
92
|
+
colorProvider.className(
|
|
93
|
+
invalid.value && !readonly.value ? 'error' : 'primary',
|
|
94
|
+
),
|
|
95
|
+
];
|
|
96
|
+
return classes;
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
const resolvedSlots = computed(() => {
|
|
100
|
+
const slots: ResolvedSlots = {};
|
|
101
|
+
ADORNMENT_POSITIONS.forEach((position) => {
|
|
102
|
+
const key = `${position}Adornment` as const;
|
|
103
|
+
slots[position] = resolveVNodeChildOrSlots(props[key], ctx.slots[key]);
|
|
104
|
+
});
|
|
105
|
+
return slots;
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
const renderAdornment = (position: AdornmentPosition) => {
|
|
109
|
+
const result = renderSlotOrEmpty(resolvedSlots.value, position);
|
|
110
|
+
if (!result) return;
|
|
111
|
+
return (
|
|
112
|
+
<div
|
|
113
|
+
class={[
|
|
114
|
+
'v-control-field__adornment',
|
|
115
|
+
`v-control-field__adornment--${position}`,
|
|
116
|
+
]}>
|
|
117
|
+
{result}
|
|
118
|
+
</div>
|
|
119
|
+
);
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
const handleClick = (ev: MouseEvent) => {
|
|
123
|
+
ctx.emit('click', ev);
|
|
124
|
+
// if (ev.target === hostElRef.value) {
|
|
125
|
+
// ctx.emit('clickHost', ev);
|
|
126
|
+
// }
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
return {
|
|
130
|
+
classes,
|
|
131
|
+
renderAdornment,
|
|
132
|
+
hostElRef: () => hostElRef,
|
|
133
|
+
handleClick,
|
|
134
|
+
// computedTabindex,
|
|
135
|
+
};
|
|
136
|
+
},
|
|
137
|
+
render() {
|
|
138
|
+
return (
|
|
139
|
+
<div
|
|
140
|
+
class={this.classes}
|
|
141
|
+
onClick={this.handleClick}
|
|
142
|
+
// tabindex={this.computedTabindex}
|
|
143
|
+
ref={this.hostElRef()}>
|
|
144
|
+
{this.renderAdornment('start')}
|
|
145
|
+
<div class="v-control-field__body">
|
|
146
|
+
{renderSlotOrEmpty(this.$slots, 'default')}
|
|
147
|
+
</div>
|
|
148
|
+
{this.renderAdornment('end')}
|
|
149
|
+
</div>
|
|
150
|
+
);
|
|
151
|
+
},
|
|
152
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './VControlField';
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
.v-data-table {
|
|
2
|
+
--controls-vertial-margin: 0.625em;
|
|
3
|
+
|
|
4
|
+
.v-card-content & {
|
|
5
|
+
margin-right: calc(var(--card-content-padding) * -1);
|
|
6
|
+
margin-left: calc(var(--card-content-padding) * -1);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
&__empty--message {
|
|
10
|
+
// @include container;
|
|
11
|
+
|
|
12
|
+
// color: get-color(text-muted);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
&__controls {
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-wrap: wrap;
|
|
18
|
+
align-items: center;
|
|
19
|
+
justify-content: flex-end;
|
|
20
|
+
|
|
21
|
+
&__info {
|
|
22
|
+
display: flex;
|
|
23
|
+
align-items: center;
|
|
24
|
+
|
|
25
|
+
&__length {
|
|
26
|
+
margin-right: 20px;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&__select-limit {
|
|
31
|
+
display: flex;
|
|
32
|
+
align-items: center;
|
|
33
|
+
|
|
34
|
+
&__prefix {
|
|
35
|
+
margin-right: 0.5em;
|
|
36
|
+
font-size: 0.75em;
|
|
37
|
+
color: var(--palette-muted);
|
|
38
|
+
white-space: nowrap;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.v-select {
|
|
42
|
+
width: 5em;
|
|
43
|
+
margin-left: 0.5em;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
&__pagination {
|
|
48
|
+
flex: 1 1 100%;
|
|
49
|
+
margin-left: auto;
|
|
50
|
+
|
|
51
|
+
@media screen and (min-width: 320px) {
|
|
52
|
+
flex: 0 0 50%;
|
|
53
|
+
width: 50%;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
&__header {
|
|
59
|
+
margin-bottom: var(--controls-vertial-margin);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
&__footer {
|
|
63
|
+
margin-top: var(--controls-vertial-margin);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
&__body {
|
|
67
|
+
position: relative;
|
|
68
|
+
|
|
69
|
+
&__inner {
|
|
70
|
+
overflow-x: auto;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
&__table-wrapper {
|
|
75
|
+
display: flex;
|
|
76
|
+
|
|
77
|
+
&::before,
|
|
78
|
+
&::after {
|
|
79
|
+
display: block;
|
|
80
|
+
// flex: 0 0 $view-padding-narrow;
|
|
81
|
+
// width: $view-padding-narrow;
|
|
82
|
+
height: 1px;
|
|
83
|
+
content: '';
|
|
84
|
+
|
|
85
|
+
// @include mq(wide) {
|
|
86
|
+
// flex-basis: $view-padding-wide;
|
|
87
|
+
// width: $view-padding-wide;
|
|
88
|
+
// }
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
&__loading {
|
|
93
|
+
position: absolute;
|
|
94
|
+
top: 0;
|
|
95
|
+
right: 0;
|
|
96
|
+
bottom: 0;
|
|
97
|
+
left: 0;
|
|
98
|
+
z-index: 1;
|
|
99
|
+
display: flex;
|
|
100
|
+
align-items: center;
|
|
101
|
+
justify-content: center;
|
|
102
|
+
background: var(--palette-background);
|
|
103
|
+
opacity: 0.5;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
&__table {
|
|
107
|
+
width: 100%;
|
|
108
|
+
// min-width: calc(100% - #{$view-padding-narrow * 2});
|
|
109
|
+
margin: 0;
|
|
110
|
+
// border-collapse: separate;
|
|
111
|
+
background: var(--palette-background);
|
|
112
|
+
border-radius: var(--control-field-radius);
|
|
113
|
+
|
|
114
|
+
// @include mq(wide) {
|
|
115
|
+
// min-width: calc(100% - #{$view-padding-wide * 2});
|
|
116
|
+
// }
|
|
117
|
+
|
|
118
|
+
&__cell {
|
|
119
|
+
position: relative;
|
|
120
|
+
text-align: left;
|
|
121
|
+
white-space: nowrap;
|
|
122
|
+
vertical-align: middle;
|
|
123
|
+
border-bottom: thin solid rgba(0, 0, 0, 0.12);
|
|
124
|
+
transition: background 0.2s;
|
|
125
|
+
|
|
126
|
+
&:first-child {
|
|
127
|
+
padding-left: calc(var(--table-cell-horizontal-padding) * 2);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
&:last-child {
|
|
131
|
+
padding-right: calc(var(--table-cell-horizontal-padding) * 2);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
&--left {
|
|
135
|
+
text-align: left;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
&--center {
|
|
139
|
+
text-align: center;
|
|
140
|
+
|
|
141
|
+
.v-data-table__table__sort-icon--empty {
|
|
142
|
+
display: flex;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
&--right {
|
|
147
|
+
text-align: right;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
&[tabindex='0'] {
|
|
151
|
+
cursor: pointer;
|
|
152
|
+
|
|
153
|
+
&:hover,
|
|
154
|
+
&:focus {
|
|
155
|
+
// background: var(--shadow-color);
|
|
156
|
+
// background: get-color(light);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
&__tile {
|
|
161
|
+
display: flex;
|
|
162
|
+
align-items: center;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
&__sort-icon {
|
|
167
|
+
width: 25px;
|
|
168
|
+
font-size: 1.25em;
|
|
169
|
+
opacity: 0;
|
|
170
|
+
transition: transform 0.2s, opacity 0.2s;
|
|
171
|
+
|
|
172
|
+
// stylelint-disable-next-line no-descending-specificity
|
|
173
|
+
&--empty {
|
|
174
|
+
display: none;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
&__header &__cell {
|
|
179
|
+
user-select: none;
|
|
180
|
+
background: rgba(255, 255, 255, 0.85);
|
|
181
|
+
backdrop-filter: blur(3px);
|
|
182
|
+
|
|
183
|
+
&--active[tabindex='0'] {
|
|
184
|
+
// color: get-color(invert-text);
|
|
185
|
+
// background: get-color(primary);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
&__header &__cell--active &__sort-icon {
|
|
190
|
+
opacity: 1;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
&__cell[tabindex='0']:hover &__sort-icon,
|
|
194
|
+
&__cell[tabindex='0']:focus &__sort-icon {
|
|
195
|
+
opacity: 1;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
&__body tr:last-child &__cell {
|
|
199
|
+
border-bottom: none;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
&__item {
|
|
203
|
+
&:hover {
|
|
204
|
+
td {
|
|
205
|
+
// background: get-color(tocuh-0);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
&--selected {
|
|
210
|
+
// stylelint-disable-next-line no-descending-specificity
|
|
211
|
+
td {
|
|
212
|
+
// background: get-color(light);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
&:hover {
|
|
216
|
+
td {
|
|
217
|
+
// background: get-color(light);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
// stylelint-disable-next-line no-descending-specificity
|
|
225
|
+
&--fixed-header &__table__header &__table__cell {
|
|
226
|
+
position: sticky;
|
|
227
|
+
top: 0;
|
|
228
|
+
z-index: 1;
|
|
229
|
+
}
|
|
230
|
+
}
|