@fastkit/vui 0.6.39 → 0.6.43
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 +2 -2
- package/dist/tool/vite-plugin.d.ts.map +1 -1
- package/dist/vui.cjs.js +180 -5
- package/dist/vui.cjs.prod.js +180 -5
- package/dist/vui.css +24 -14
- package/dist/vui.d.ts +2430 -12
- package/dist/vui.esm-bundler.js +180 -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,252 @@
|
|
|
1
|
+
import './VNavigationItem.scss';
|
|
2
|
+
import {
|
|
3
|
+
defineComponent,
|
|
4
|
+
computed,
|
|
5
|
+
VNodeChild,
|
|
6
|
+
PropType,
|
|
7
|
+
VNodeProps,
|
|
8
|
+
Fragment,
|
|
9
|
+
ref,
|
|
10
|
+
watch,
|
|
11
|
+
} from 'vue';
|
|
12
|
+
import { createListTileProps, listTileEmits, VListTile } from '../VListTile';
|
|
13
|
+
import {
|
|
14
|
+
ExtractPropInput,
|
|
15
|
+
renderSlotOrEmpty,
|
|
16
|
+
VExpandTransition,
|
|
17
|
+
} from '@fastkit/vue-utils';
|
|
18
|
+
import { useVui } from '../../injections';
|
|
19
|
+
import { useRoute } from 'vue-router';
|
|
20
|
+
|
|
21
|
+
export function createNavigationItemProps() {
|
|
22
|
+
return {
|
|
23
|
+
...createListTileProps(),
|
|
24
|
+
match: String,
|
|
25
|
+
// key: {
|
|
26
|
+
// type: [String, Number],
|
|
27
|
+
// required: true,
|
|
28
|
+
// },
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
33
|
+
export interface NavigationItemInput
|
|
34
|
+
extends ExtractPropInput<ReturnType<typeof createNavigationItemProps>> {
|
|
35
|
+
key: string | number;
|
|
36
|
+
label: VNodeChild | (() => VNodeChild);
|
|
37
|
+
children?: NavigationItemInput[];
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export function resolveNavigationItemInput(input: NavigationItemInput) {
|
|
41
|
+
let label = input.label;
|
|
42
|
+
const props: NavigationItemInput = {
|
|
43
|
+
...input,
|
|
44
|
+
};
|
|
45
|
+
if (typeof label === 'function') {
|
|
46
|
+
label = label();
|
|
47
|
+
}
|
|
48
|
+
delete (props as NavigationItemInput).label;
|
|
49
|
+
|
|
50
|
+
return {
|
|
51
|
+
label,
|
|
52
|
+
props,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function renderNavigationItemInput(
|
|
57
|
+
input: NavigationItemInput,
|
|
58
|
+
extraProps?: Record<string, unknown> & VNodeProps,
|
|
59
|
+
) {
|
|
60
|
+
const { label, props } = resolveNavigationItemInput(input);
|
|
61
|
+
return (
|
|
62
|
+
<VNavigationItem {...{ ...props, ...(extraProps as any) }}>
|
|
63
|
+
{label}
|
|
64
|
+
</VNavigationItem>
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export const VNavigationItem = defineComponent({
|
|
69
|
+
name: 'VNavigationItem',
|
|
70
|
+
inheritAttrs: false,
|
|
71
|
+
props: {
|
|
72
|
+
...createNavigationItemProps(),
|
|
73
|
+
children: Array as PropType<NavigationItemInput[]>,
|
|
74
|
+
},
|
|
75
|
+
emits: {
|
|
76
|
+
...listTileEmits,
|
|
77
|
+
},
|
|
78
|
+
setup(props, ctx) {
|
|
79
|
+
const vui = useVui();
|
|
80
|
+
const opened = ref(false);
|
|
81
|
+
|
|
82
|
+
const children = computed(() => {
|
|
83
|
+
const c = props.children;
|
|
84
|
+
return c && c.length ? c : undefined;
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
const to = computed(() => ctx.attrs.to);
|
|
88
|
+
|
|
89
|
+
const match = computed(() => {
|
|
90
|
+
const { match } = props;
|
|
91
|
+
const { to } = ctx.attrs;
|
|
92
|
+
if (match) return match;
|
|
93
|
+
if (!to) return;
|
|
94
|
+
if (typeof to === 'string') return to;
|
|
95
|
+
return (to as any).path as string | undefined;
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
const classes = computed(() => [
|
|
99
|
+
{
|
|
100
|
+
'v-navigation-item--opened': opened.value,
|
|
101
|
+
},
|
|
102
|
+
]);
|
|
103
|
+
|
|
104
|
+
const route = useRoute();
|
|
105
|
+
|
|
106
|
+
// const classes = computed(() => [
|
|
107
|
+
// // {
|
|
108
|
+
// // 'v-navigation-item--matched': matched.value,
|
|
109
|
+
// // },
|
|
110
|
+
// ]);
|
|
111
|
+
|
|
112
|
+
watch(
|
|
113
|
+
() => route.path,
|
|
114
|
+
(newPath) => {
|
|
115
|
+
const c = children.value;
|
|
116
|
+
const m = match.value;
|
|
117
|
+
|
|
118
|
+
if (!c || !m) {
|
|
119
|
+
// matched.value = false;
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
if (newPath.match(m)) {
|
|
124
|
+
open();
|
|
125
|
+
// matched.value = true;
|
|
126
|
+
} else {
|
|
127
|
+
close();
|
|
128
|
+
// matched.value = false;
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
{ immediate: true },
|
|
132
|
+
);
|
|
133
|
+
|
|
134
|
+
// const iconPayload = () => opened.value;
|
|
135
|
+
|
|
136
|
+
const _props = computed(() => {
|
|
137
|
+
const c = children.value;
|
|
138
|
+
let { endIcon } = props;
|
|
139
|
+
if (c && !endIcon) {
|
|
140
|
+
endIcon = vui.icon('navigationExpand');
|
|
141
|
+
if (typeof endIcon === 'string') {
|
|
142
|
+
const name = endIcon;
|
|
143
|
+
endIcon = (gen) => {
|
|
144
|
+
return gen({
|
|
145
|
+
name,
|
|
146
|
+
rotate: opened.value ? 180 : 0,
|
|
147
|
+
});
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
const __props: any = {
|
|
153
|
+
...props,
|
|
154
|
+
endIcon,
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
delete __props.children;
|
|
158
|
+
|
|
159
|
+
// const _activeClass = props.activeClass;
|
|
160
|
+
// const activeClass = `v-navigation-item--active${
|
|
161
|
+
// _activeClass ? ` ${_activeClass}` : ''
|
|
162
|
+
// }`;
|
|
163
|
+
|
|
164
|
+
return {
|
|
165
|
+
...__props,
|
|
166
|
+
// activeClass,
|
|
167
|
+
// startIcon: toRawIconProp(__props.startIcon, iconPayload),
|
|
168
|
+
// endIcon: toRawIconProp(__props.endIcon, iconPayload),
|
|
169
|
+
};
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
function open() {
|
|
173
|
+
if (!children.value) return;
|
|
174
|
+
opened.value = true;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
function close() {
|
|
178
|
+
opened.value = false;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
function toggle() {
|
|
182
|
+
return opened.value ? close() : open();
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
const onClick = (ev: MouseEvent) => {
|
|
186
|
+
if (!to.value) {
|
|
187
|
+
return toggle();
|
|
188
|
+
}
|
|
189
|
+
open();
|
|
190
|
+
// if (!to.value) {
|
|
191
|
+
// toggle();
|
|
192
|
+
// }
|
|
193
|
+
// ctx.emit('click', ev);
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
const onChangeActive = (isActive: boolean) => {
|
|
197
|
+
// if (isActive) {
|
|
198
|
+
// // open();
|
|
199
|
+
// // if (typeof window !== 'undefined') {
|
|
200
|
+
// // // open();
|
|
201
|
+
// // // console.log('hoge', window);
|
|
202
|
+
// // setTimeout(() => {
|
|
203
|
+
// // open();
|
|
204
|
+
// // }, 1000);
|
|
205
|
+
// // }
|
|
206
|
+
// // open();
|
|
207
|
+
// // console.log(props);
|
|
208
|
+
// // setTimeout(() => {
|
|
209
|
+
// // open();
|
|
210
|
+
// // }, 500);
|
|
211
|
+
// }
|
|
212
|
+
ctx.emit('changeActive', isActive);
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
ctx.expose({
|
|
216
|
+
close,
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
return () => {
|
|
220
|
+
const _children = children.value;
|
|
221
|
+
const fallbackTag = _children ? 'button' : undefined;
|
|
222
|
+
|
|
223
|
+
return (
|
|
224
|
+
<Fragment>
|
|
225
|
+
<VListTile
|
|
226
|
+
{...ctx.attrs}
|
|
227
|
+
{..._props.value}
|
|
228
|
+
fallbackTag={fallbackTag}
|
|
229
|
+
endIcon={_props.value.endIcon}
|
|
230
|
+
class={['v-navigation-item', classes.value]}
|
|
231
|
+
onClick={onClick}
|
|
232
|
+
onChangeActive={onChangeActive}>
|
|
233
|
+
{renderSlotOrEmpty(ctx.slots, 'default')}
|
|
234
|
+
</VListTile>
|
|
235
|
+
{_children && (
|
|
236
|
+
<VExpandTransition>
|
|
237
|
+
<div class="v-navigation-item__expand" v-show={opened.value}>
|
|
238
|
+
{_children.map((child) =>
|
|
239
|
+
renderNavigationItemInput(child, {
|
|
240
|
+
startIconEmptySpace: _props.value.startIconEmptySpace,
|
|
241
|
+
// onClick,
|
|
242
|
+
// onChangeActive,
|
|
243
|
+
}),
|
|
244
|
+
)}
|
|
245
|
+
</div>
|
|
246
|
+
</VExpandTransition>
|
|
247
|
+
)}
|
|
248
|
+
</Fragment>
|
|
249
|
+
);
|
|
250
|
+
};
|
|
251
|
+
},
|
|
252
|
+
});
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
@use '../../styles/core.scss';
|
|
2
|
+
|
|
3
|
+
.v-option {
|
|
4
|
+
position: relative;
|
|
5
|
+
display: flex;
|
|
6
|
+
width: 100%;
|
|
7
|
+
padding: 0.375em 1em;
|
|
8
|
+
cursor: pointer;
|
|
9
|
+
user-select: none;
|
|
10
|
+
|
|
11
|
+
input {
|
|
12
|
+
@include core.hidden-input-element;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
&::before,
|
|
16
|
+
&::after {
|
|
17
|
+
position: absolute;
|
|
18
|
+
top: 0;
|
|
19
|
+
right: 0;
|
|
20
|
+
bottom: 0;
|
|
21
|
+
left: 0;
|
|
22
|
+
display: block;
|
|
23
|
+
pointer-events: none;
|
|
24
|
+
content: '';
|
|
25
|
+
opacity: 0;
|
|
26
|
+
transition: opacity 0.2s;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
&::before {
|
|
30
|
+
background: currentColor;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
&::after {
|
|
34
|
+
background: var(--palette-primary);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
&:hover,
|
|
38
|
+
&:focus-within {
|
|
39
|
+
&::before {
|
|
40
|
+
opacity: 0.12;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&__label {
|
|
45
|
+
position: relative;
|
|
46
|
+
display: block;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
&--selected::after {
|
|
50
|
+
opacity: 0.12;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
&--selected &__label {
|
|
54
|
+
font-weight: 500;
|
|
55
|
+
color: var(--palette-primary);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
&--has-not-value &__label {
|
|
59
|
+
font-style: italic;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import './VOption.scss';
|
|
2
|
+
import { defineComponent, computed } from 'vue';
|
|
3
|
+
import {
|
|
4
|
+
createFormSelectorItemSettings,
|
|
5
|
+
useFormSelectorItemControl,
|
|
6
|
+
renderSlotOrEmpty,
|
|
7
|
+
} from '@fastkit/vue-kit';
|
|
8
|
+
import { createControlProps, useControl } from '../../composables';
|
|
9
|
+
import { VUI_SELECT_SYMBOL, VUI_OPTION_SYMBOL } from '../../injections';
|
|
10
|
+
|
|
11
|
+
const { props, emits } = createFormSelectorItemSettings();
|
|
12
|
+
|
|
13
|
+
export const VOption = defineComponent({
|
|
14
|
+
name: 'VOption',
|
|
15
|
+
props: {
|
|
16
|
+
...props,
|
|
17
|
+
...createControlProps(),
|
|
18
|
+
},
|
|
19
|
+
emits,
|
|
20
|
+
setup(props, ctx) {
|
|
21
|
+
const nodeControl = useFormSelectorItemControl(props, ctx, {
|
|
22
|
+
nodeType: VUI_OPTION_SYMBOL,
|
|
23
|
+
parentNodeType: VUI_SELECT_SYMBOL,
|
|
24
|
+
});
|
|
25
|
+
const control = useControl(props);
|
|
26
|
+
const classes = computed(() => {
|
|
27
|
+
return [
|
|
28
|
+
'v-option',
|
|
29
|
+
{
|
|
30
|
+
'v-option--selected': nodeControl.selected,
|
|
31
|
+
'v-option--has-not-value': !nodeControl.hasValue,
|
|
32
|
+
'v-option--disabled': nodeControl.isDisabled,
|
|
33
|
+
},
|
|
34
|
+
control.classes.value,
|
|
35
|
+
];
|
|
36
|
+
});
|
|
37
|
+
return {
|
|
38
|
+
...nodeControl.expose(),
|
|
39
|
+
classes,
|
|
40
|
+
};
|
|
41
|
+
},
|
|
42
|
+
render() {
|
|
43
|
+
const { selectorItemControl, classes } = this;
|
|
44
|
+
return (
|
|
45
|
+
<label class={classes} onClick={selectorItemControl.handleClickElement}>
|
|
46
|
+
<span class="v-option__label">
|
|
47
|
+
{renderSlotOrEmpty(this.$slots, 'default')}
|
|
48
|
+
</span>
|
|
49
|
+
</label>
|
|
50
|
+
);
|
|
51
|
+
},
|
|
52
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './VOption';
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import './VOptionGroup.scss';
|
|
2
|
+
import { computed, PropType, defineComponent } from 'vue';
|
|
3
|
+
import {
|
|
4
|
+
createFormSelectorItemGroupProps,
|
|
5
|
+
useFormSelectorItemGroupControl,
|
|
6
|
+
FormSelectorItemGroupControl,
|
|
7
|
+
defineSlotsProps,
|
|
8
|
+
VNodeChildOrSlot,
|
|
9
|
+
resolveVNodeChildOrSlots,
|
|
10
|
+
renderSlotOrEmpty,
|
|
11
|
+
} from '@fastkit/vue-kit';
|
|
12
|
+
import { VUI_SELECT_SYMBOL } from '../../injections';
|
|
13
|
+
|
|
14
|
+
export const VOptionGroup = defineComponent({
|
|
15
|
+
name: 'VOptionGroup',
|
|
16
|
+
props: {
|
|
17
|
+
...createFormSelectorItemGroupProps(),
|
|
18
|
+
// eslint-disable-next-line vue/require-prop-types
|
|
19
|
+
label: {} as PropType<VNodeChildOrSlot<FormSelectorItemGroupControl>>,
|
|
20
|
+
...defineSlotsProps<{
|
|
21
|
+
label: FormSelectorItemGroupControl;
|
|
22
|
+
}>(),
|
|
23
|
+
},
|
|
24
|
+
setup(props, ctx) {
|
|
25
|
+
const groupControl = useFormSelectorItemGroupControl(props, ctx, {
|
|
26
|
+
parentNodeType: VUI_SELECT_SYMBOL,
|
|
27
|
+
});
|
|
28
|
+
const labelSlot = computed(() => {
|
|
29
|
+
return resolveVNodeChildOrSlots(props.label, ctx.slots.label);
|
|
30
|
+
});
|
|
31
|
+
const classes = computed(() => {
|
|
32
|
+
return [
|
|
33
|
+
'v-option-group',
|
|
34
|
+
{
|
|
35
|
+
'v-option-group--disabled': groupControl.isDisabled,
|
|
36
|
+
},
|
|
37
|
+
];
|
|
38
|
+
});
|
|
39
|
+
return {
|
|
40
|
+
...groupControl.expose(),
|
|
41
|
+
classes,
|
|
42
|
+
labelSlot,
|
|
43
|
+
};
|
|
44
|
+
},
|
|
45
|
+
render() {
|
|
46
|
+
const { labelSlot, classes, groupControl } = this;
|
|
47
|
+
const label = labelSlot ? labelSlot(groupControl) : undefined;
|
|
48
|
+
return (
|
|
49
|
+
<div class={classes}>
|
|
50
|
+
{!!label && <div class="v-option-group__label">{label}</div>}
|
|
51
|
+
{renderSlotOrEmpty(this.$slots, 'default')}
|
|
52
|
+
</div>
|
|
53
|
+
);
|
|
54
|
+
},
|
|
55
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './VOptionGroup';
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
@use '../../styles/core.scss';
|
|
2
|
+
|
|
3
|
+
.v-pagination {
|
|
4
|
+
--pagination-size: var(--pagination-item-size);
|
|
5
|
+
--pagination-margin: var(--pagination-item-margin);
|
|
6
|
+
--pagination-font-size: var(--pagination-item-font-size);
|
|
7
|
+
--pagination-radius: var(--pagination-item-radius);
|
|
8
|
+
|
|
9
|
+
&::before {
|
|
10
|
+
width: var(--pagination-size);
|
|
11
|
+
margin: var(--pagination-margin);
|
|
12
|
+
content: none;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
display: flex;
|
|
16
|
+
align-items: center;
|
|
17
|
+
overflow: hidden;
|
|
18
|
+
font-weight: bold;
|
|
19
|
+
line-height: 1;
|
|
20
|
+
|
|
21
|
+
&--left {
|
|
22
|
+
justify-content: flex-start;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
&--center {
|
|
26
|
+
justify-content: center;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
&--right {
|
|
30
|
+
justify-content: flex-end;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
&__item,
|
|
34
|
+
a#{&}__item {
|
|
35
|
+
@include core.button-reset;
|
|
36
|
+
|
|
37
|
+
display: flex;
|
|
38
|
+
align-items: center;
|
|
39
|
+
justify-content: center;
|
|
40
|
+
min-width: var(--pagination-size);
|
|
41
|
+
height: var(--pagination-size);
|
|
42
|
+
margin: calc(var(--pagination-margin) * 0.5);
|
|
43
|
+
font-size: var(--pagination-font-size);
|
|
44
|
+
color: inherit;
|
|
45
|
+
border-radius: var(--pagination-radius);
|
|
46
|
+
transition: 0.1s;
|
|
47
|
+
|
|
48
|
+
&:hover,
|
|
49
|
+
&:focus {
|
|
50
|
+
background: rgba(0, 0, 0, 0.1);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
&--active {
|
|
54
|
+
&,
|
|
55
|
+
&:hover,
|
|
56
|
+
&:focus,
|
|
57
|
+
&:active {
|
|
58
|
+
color: var(--text-color);
|
|
59
|
+
pointer-events: none;
|
|
60
|
+
background-color: var(--main-color);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
&--disabled {
|
|
65
|
+
color: var(--palette-muted) !important;
|
|
66
|
+
pointer-events: none !important;
|
|
67
|
+
background: transparent !important;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
&--truncate {
|
|
71
|
+
color: var(--palette-muted) !important;
|
|
72
|
+
pointer-events: none !important;
|
|
73
|
+
background: transparent !important;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.v-icon {
|
|
77
|
+
font-size: 125%;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
&--dense &__item {
|
|
82
|
+
--pagination-size: var(--pagination-item-size-dense);
|
|
83
|
+
--pagination-margin: var(--pagination-item-margin-dense);
|
|
84
|
+
--pagination-font-size: var(--pagination-item-font-size-dense);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
&--disabled &__item {
|
|
88
|
+
color: var(--palette-muted);
|
|
89
|
+
pointer-events: none;
|
|
90
|
+
|
|
91
|
+
&:hover,
|
|
92
|
+
&:focus {
|
|
93
|
+
background: transparent;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
&--active {
|
|
97
|
+
background: var(--palette-muted);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|