@fastkit/vui 0.18.31 → 0.18.33
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/vui.d.ts +214 -214
- package/dist/vui.mjs +402 -484
- package/dist/vui.mjs.map +1 -1
- package/package.json +25 -25
- package/src/components/VApp/VApp.tsx +5 -7
- package/src/components/VAvatar/VAvatar.tsx +1 -0
- package/src/components/VBreadcrumbs/VBreadcrumbs.tsx +8 -7
- package/src/components/VButton/VButton.tsx +28 -28
- package/src/components/VButton/VButtonGroup.tsx +2 -2
- package/src/components/VCard/VCard.tsx +2 -13
- package/src/components/VCard/VCardActions.tsx +1 -3
- package/src/components/VCard/VCardContent.tsx +1 -3
- package/src/components/VCheckable/VCheckable.tsx +12 -14
- package/src/components/VCheckbox/VCheckbox.tsx +11 -12
- package/src/components/VChip/VChip.tsx +1 -0
- package/src/components/VContentSwitcher/VContentSwitcher.tsx +5 -7
- package/src/components/VControlField/VControlField.tsx +19 -20
- package/src/components/VDataTable/VDataTable.tsx +20 -23
- package/src/components/VDialog/VDialog.tsx +1 -2
- package/src/components/VForm/VForm.tsx +12 -13
- package/src/components/VFormControl/VFormControl.tsx +7 -2
- package/src/components/VFormGroup/VFormGroup.tsx +1 -0
- package/src/components/VGrid/schemes.ts +7 -5
- package/src/components/VListTile/VListTile.tsx +4 -1
- package/src/components/VMenu/VMenu.tsx +5 -7
- package/src/components/VNavigation/VNavigation.tsx +5 -3
- package/src/components/VNavigation/VNavigationItem.tsx +13 -66
- package/src/components/VNumberField/VNumberField.tsx +13 -14
- package/src/components/VOption/VOption.tsx +20 -23
- package/src/components/VOptionGroup/VOptionGroup.tsx +9 -11
- package/src/components/VPagination/VPagination.tsx +21 -20
- package/src/components/VPaper/VPaper.tsx +1 -1
- package/src/components/VRadio/VRadio.tsx +11 -12
- package/src/components/VSelect/VSelect.tsx +85 -95
- package/src/components/VSheetModal/VSheetModal.tsx +20 -36
- package/src/components/VSnackbar/VSnackbar.tsx +2 -4
- package/src/components/VSwitch/VSwitch.tsx +11 -12
- package/src/components/VTabs/VTab.tsx +13 -20
- package/src/components/VTabs/VTabs.tsx +12 -15
- package/src/components/VTextField/VTextField.tsx +34 -37
- package/src/components/VTextarea/VTextarea.tsx +36 -43
- package/src/components/VToolbar/VToolbar.tsx +11 -15
- package/src/components/VToolbar/VToolbarMenu.tsx +1 -0
- package/src/components/VTooltip/VTooltip.tsx +3 -7
- package/src/composables/control.ts +9 -16
- package/src/composables/form-selector.tsx +61 -67
- package/src/composables/vui.ts +2 -1
- package/src/injections.ts +5 -5
- package/src/plugin.tsx +8 -7
- package/src/service.tsx +42 -32
|
@@ -17,6 +17,7 @@ const { props, emits } = createFormNodeWrapperSettings();
|
|
|
17
17
|
|
|
18
18
|
export function createRequiredChipRenderer(
|
|
19
19
|
required: () => boolean,
|
|
20
|
+
// eslint-disable-next-line no-shadow
|
|
20
21
|
props: {
|
|
21
22
|
requiredChip?: RequiredChipSource;
|
|
22
23
|
},
|
|
@@ -56,6 +57,7 @@ export const VFormControl = defineComponent({
|
|
|
56
57
|
},
|
|
57
58
|
slots,
|
|
58
59
|
emits,
|
|
60
|
+
// eslint-disable-next-line no-shadow
|
|
59
61
|
setup(props, ctx) {
|
|
60
62
|
const vui = useVui();
|
|
61
63
|
const control = useFormNodeWrapper(props, ctx, {
|
|
@@ -68,6 +70,7 @@ export const VFormControl = defineComponent({
|
|
|
68
70
|
});
|
|
69
71
|
|
|
70
72
|
const hinttipDelay = computed(() => {
|
|
73
|
+
// eslint-disable-next-line no-shadow
|
|
71
74
|
let { hinttipDelay } = control;
|
|
72
75
|
if (hinttipDelay == null) {
|
|
73
76
|
hinttipDelay = vui.setting('hinttipDelay');
|
|
@@ -100,11 +103,12 @@ export const VFormControl = defineComponent({
|
|
|
100
103
|
'v-form-control--valid': control.valid,
|
|
101
104
|
},
|
|
102
105
|
colorProvider.className(
|
|
106
|
+
// eslint-disable-next-line no-nested-ternary
|
|
103
107
|
props.error
|
|
104
108
|
? 'error'
|
|
105
109
|
: control.invalid && !control.isReadonly
|
|
106
|
-
|
|
107
|
-
|
|
110
|
+
? 'error'
|
|
111
|
+
: 'primary',
|
|
108
112
|
),
|
|
109
113
|
]);
|
|
110
114
|
|
|
@@ -142,6 +146,7 @@ export const VFormControl = defineComponent({
|
|
|
142
146
|
activator: (tooltip) => (
|
|
143
147
|
<a
|
|
144
148
|
class="v-form-control__label__hinttip"
|
|
149
|
+
// eslint-disable-next-line no-script-url
|
|
145
150
|
href="javascript:void(0)"
|
|
146
151
|
{...tooltip.attrs}>
|
|
147
152
|
{hinttip.tip}
|
|
@@ -33,6 +33,7 @@ export const VFormGroup = defineComponent({
|
|
|
33
33
|
props: createVFormGroupProps(),
|
|
34
34
|
emits,
|
|
35
35
|
slots: formGroupSlots,
|
|
36
|
+
// eslint-disable-next-line no-shadow
|
|
36
37
|
setup(props, ctx) {
|
|
37
38
|
const nodeControl = useFormGroup(props, ctx as any, {
|
|
38
39
|
nodeType: VUI_FORM_GROUP_SYMBOL,
|
|
@@ -14,15 +14,17 @@ export function extractRawGridValueClasses<
|
|
|
14
14
|
>(
|
|
15
15
|
value: NonNullable<RawGridValue<T>>,
|
|
16
16
|
prefix: string,
|
|
17
|
+
// eslint-disable-next-line no-shadow
|
|
17
18
|
getter?: (value: T) => string,
|
|
18
19
|
): string | string[] {
|
|
19
20
|
if (typeof value !== 'object')
|
|
20
21
|
return `${prefix}${getter ? getter(value) : value}`;
|
|
21
|
-
return Object.entries(value).map(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
return Object.entries(value).map(
|
|
23
|
+
([breakpoint, breakpointValue]) =>
|
|
24
|
+
`${prefix}${
|
|
25
|
+
getter ? getter(breakpointValue) : breakpointValue
|
|
26
|
+
}--${breakpoint}`,
|
|
27
|
+
);
|
|
26
28
|
}
|
|
27
29
|
|
|
28
30
|
// export const DEFAULT_MEDIA_MATCH_KEY = MEDIA_MATCH_CONDITIONS[0].key;
|
|
@@ -7,7 +7,6 @@ import {
|
|
|
7
7
|
ComputedRef,
|
|
8
8
|
watch,
|
|
9
9
|
} from 'vue';
|
|
10
|
-
import { rawIconProp, resolveRawIconProp } from '../VIcon';
|
|
11
10
|
import { createPropsOptions } from '@fastkit/vue-utils';
|
|
12
11
|
import { actionableInheritProps, VAction } from '@fastkit/vue-action';
|
|
13
12
|
import { useScopeColorClass, ScopeName } from '@fastkit/vue-color-scheme';
|
|
@@ -16,7 +15,9 @@ import { useVui } from '../../injections';
|
|
|
16
15
|
// @TODO Unable to resolve dts for `actionableInheritProps`.
|
|
17
16
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
18
17
|
// @ts-ignore
|
|
18
|
+
// eslint-disable-next-line import/order
|
|
19
19
|
import { RouteLocationRaw } from 'vue-router';
|
|
20
|
+
import { rawIconProp, resolveRawIconProp } from '../VIcon';
|
|
20
21
|
|
|
21
22
|
export function createListTileProps() {
|
|
22
23
|
const icon = rawIconProp();
|
|
@@ -76,6 +77,7 @@ export const VListTile = defineComponent({
|
|
|
76
77
|
|
|
77
78
|
return [
|
|
78
79
|
color.value.className,
|
|
80
|
+
'clickable',
|
|
79
81
|
{
|
|
80
82
|
'v-list-tile--plain': !hasColor,
|
|
81
83
|
'v-list-tile--has-color': hasColor,
|
|
@@ -86,6 +88,7 @@ export const VListTile = defineComponent({
|
|
|
86
88
|
|
|
87
89
|
watch(
|
|
88
90
|
() => isActive.value,
|
|
91
|
+
// eslint-disable-next-line no-shadow
|
|
89
92
|
(isActive) => {
|
|
90
93
|
ctx.emit('changeActive', isActive);
|
|
91
94
|
},
|
|
@@ -20,12 +20,10 @@ export const VMenu = defineMenuComponent({
|
|
|
20
20
|
menu: ctx,
|
|
21
21
|
});
|
|
22
22
|
|
|
23
|
-
return (children) =>
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
);
|
|
29
|
-
};
|
|
23
|
+
return (children) => (
|
|
24
|
+
<div class={['v-menu__body', color.colorClasses.value]} {...ctx.attrs}>
|
|
25
|
+
{children}
|
|
26
|
+
</div>
|
|
27
|
+
);
|
|
30
28
|
},
|
|
31
29
|
});
|
|
@@ -7,12 +7,12 @@ import {
|
|
|
7
7
|
onBeforeUpdate,
|
|
8
8
|
ref,
|
|
9
9
|
} from 'vue';
|
|
10
|
+
import { useScopeColorClass, ScopeName } from '@fastkit/vue-color-scheme';
|
|
11
|
+
import { createPropsOptions, ExtractPropInput } from '@fastkit/vue-utils';
|
|
10
12
|
import {
|
|
11
13
|
NavigationItemInput,
|
|
12
14
|
renderNavigationItemInput,
|
|
13
15
|
} from './VNavigationItem';
|
|
14
|
-
import { useScopeColorClass, ScopeName } from '@fastkit/vue-color-scheme';
|
|
15
|
-
import { createPropsOptions, ExtractPropInput } from '@fastkit/vue-utils';
|
|
16
16
|
|
|
17
17
|
export function createNavigationProps() {
|
|
18
18
|
return createPropsOptions({
|
|
@@ -56,6 +56,7 @@ export const VNavigation = defineComponent({
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
function onItemActivated(item: NavigationItemInput) {
|
|
59
|
+
// eslint-disable-next-line no-shadow
|
|
59
60
|
itemsRef.value.forEach(({ key, ref }) => {
|
|
60
61
|
if (key === item.key) return;
|
|
61
62
|
ref.close();
|
|
@@ -71,11 +72,12 @@ export const VNavigation = defineComponent({
|
|
|
71
72
|
renderNavigationItemInput(item, {
|
|
72
73
|
class: 'v-navigation__item',
|
|
73
74
|
startIconEmptySpace: startIconEmptySpace.value,
|
|
75
|
+
// eslint-disable-next-line no-shadow
|
|
74
76
|
ref: (ref: any) => {
|
|
75
77
|
setItemRef(item, ref);
|
|
76
78
|
},
|
|
77
79
|
onChangeActive: (isActive: boolean) => {
|
|
78
|
-
if (isActive /* && item.children && item.children.length*/) {
|
|
80
|
+
if (isActive /* && item.children && item.children.length */) {
|
|
79
81
|
onItemActivated(item);
|
|
80
82
|
}
|
|
81
83
|
},
|
|
@@ -9,17 +9,17 @@ import {
|
|
|
9
9
|
ref,
|
|
10
10
|
watch,
|
|
11
11
|
} from 'vue';
|
|
12
|
-
import { createListTileProps, listTileEmits, VListTile } from '../VListTile';
|
|
13
12
|
import { ExtractPropInput } from '@fastkit/vue-utils';
|
|
14
13
|
import { VExpandTransition } from '@fastkit/vue-transitions';
|
|
15
|
-
import { useVui } from '../../injections';
|
|
16
|
-
import { useRoute } from 'vue-router';
|
|
17
14
|
import { ScopeName } from '@fastkit/color-scheme';
|
|
18
15
|
|
|
19
16
|
// @TODO Unable to resolve dts for `actionableInheritProps`.
|
|
20
17
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
21
18
|
// @ts-ignore
|
|
22
|
-
|
|
19
|
+
// eslint-disable-next-line import/no-duplicates
|
|
20
|
+
import { useRoute, RouteLocationRaw } from 'vue-router';
|
|
21
|
+
import { useVui } from '../../injections';
|
|
22
|
+
import { createListTileProps, listTileEmits, VListTile } from '../VListTile';
|
|
23
23
|
|
|
24
24
|
export function createNavigationItemProps() {
|
|
25
25
|
return {
|
|
@@ -31,10 +31,6 @@ export function createNavigationItemProps() {
|
|
|
31
31
|
},
|
|
32
32
|
nested: Boolean,
|
|
33
33
|
color: String as PropType<ScopeName>,
|
|
34
|
-
// key: {
|
|
35
|
-
// type: [String, Number],
|
|
36
|
-
// required: true,
|
|
37
|
-
// },
|
|
38
34
|
};
|
|
39
35
|
}
|
|
40
36
|
|
|
@@ -47,7 +43,7 @@ export interface NavigationItemInput
|
|
|
47
43
|
}
|
|
48
44
|
|
|
49
45
|
export function resolveNavigationItemInput(input: NavigationItemInput) {
|
|
50
|
-
let label = input
|
|
46
|
+
let { label } = input;
|
|
51
47
|
const props: NavigationItemInput = {
|
|
52
48
|
...input,
|
|
53
49
|
};
|
|
@@ -76,8 +72,8 @@ export function renderNavigationItemInput(
|
|
|
76
72
|
|
|
77
73
|
const TRIM_END_SLASH_RE = /\/$/;
|
|
78
74
|
|
|
79
|
-
function trimEndSlash<T extends string | undefined>(
|
|
80
|
-
return
|
|
75
|
+
function trimEndSlash<T extends string | undefined>(source: T) {
|
|
76
|
+
return source ? source.replace(TRIM_END_SLASH_RE, '') : source;
|
|
81
77
|
}
|
|
82
78
|
|
|
83
79
|
export const VNavigationItem = defineComponent({
|
|
@@ -102,7 +98,9 @@ export const VNavigationItem = defineComponent({
|
|
|
102
98
|
const to = computed(() => ctx.attrs.to);
|
|
103
99
|
|
|
104
100
|
const match = computed<string[] | undefined>(() => {
|
|
101
|
+
// eslint-disable-next-line no-shadow
|
|
105
102
|
const { match } = props;
|
|
103
|
+
// eslint-disable-next-line no-shadow
|
|
106
104
|
const { to } = ctx.attrs;
|
|
107
105
|
if (match) {
|
|
108
106
|
return (Array.isArray(match) ? match : [match]).map(trimEndSlash);
|
|
@@ -122,12 +120,6 @@ export const VNavigationItem = defineComponent({
|
|
|
122
120
|
|
|
123
121
|
const route = useRoute();
|
|
124
122
|
|
|
125
|
-
// const classes = computed(() => [
|
|
126
|
-
// // {
|
|
127
|
-
// // 'v-navigation-item--matched': matched.value,
|
|
128
|
-
// // },
|
|
129
|
-
// ]);
|
|
130
|
-
|
|
131
123
|
watch(
|
|
132
124
|
() => route.path,
|
|
133
125
|
(newPath) => {
|
|
@@ -135,32 +127,19 @@ export const VNavigationItem = defineComponent({
|
|
|
135
127
|
const m = match.value;
|
|
136
128
|
|
|
137
129
|
if (!c || !m || !m.length) {
|
|
138
|
-
// matched.value = false;
|
|
139
130
|
return;
|
|
140
131
|
}
|
|
141
132
|
|
|
142
|
-
const
|
|
143
|
-
if (m.some((_) =>
|
|
133
|
+
const trimmedNewPath = trimEndSlash(newPath);
|
|
134
|
+
if (m.some((_) => trimmedNewPath.match(_))) {
|
|
144
135
|
open();
|
|
145
|
-
// matched.value = true;
|
|
146
136
|
} else {
|
|
147
137
|
close();
|
|
148
|
-
// matched.value = false;
|
|
149
138
|
}
|
|
150
|
-
|
|
151
|
-
// if (trimEndSlash(newPath).match(m)) {
|
|
152
|
-
// open();
|
|
153
|
-
// // matched.value = true;
|
|
154
|
-
// } else {
|
|
155
|
-
// close();
|
|
156
|
-
// // matched.value = false;
|
|
157
|
-
// }
|
|
158
139
|
},
|
|
159
140
|
{ immediate: true },
|
|
160
141
|
);
|
|
161
142
|
|
|
162
|
-
// const iconPayload = () => opened.value;
|
|
163
|
-
|
|
164
143
|
const _props = computed(() => {
|
|
165
144
|
const c = children.value;
|
|
166
145
|
let { endIcon } = props;
|
|
@@ -168,12 +147,11 @@ export const VNavigationItem = defineComponent({
|
|
|
168
147
|
endIcon = vui.icon('navigationExpand');
|
|
169
148
|
if (typeof endIcon === 'string') {
|
|
170
149
|
const name = endIcon;
|
|
171
|
-
endIcon = (gen) =>
|
|
172
|
-
|
|
150
|
+
endIcon = (gen) =>
|
|
151
|
+
gen({
|
|
173
152
|
name,
|
|
174
153
|
rotate: opened.value ? 180 : 0,
|
|
175
154
|
});
|
|
176
|
-
};
|
|
177
155
|
}
|
|
178
156
|
}
|
|
179
157
|
|
|
@@ -184,16 +162,8 @@ export const VNavigationItem = defineComponent({
|
|
|
184
162
|
|
|
185
163
|
delete __props.children;
|
|
186
164
|
|
|
187
|
-
// const _activeClass = props.activeClass;
|
|
188
|
-
// const activeClass = `v-navigation-item--active${
|
|
189
|
-
// _activeClass ? ` ${_activeClass}` : ''
|
|
190
|
-
// }`;
|
|
191
|
-
|
|
192
165
|
return {
|
|
193
166
|
...__props,
|
|
194
|
-
// activeClass,
|
|
195
|
-
// startIcon: toRawIconProp(__props.startIcon, iconPayload),
|
|
196
|
-
// endIcon: toRawIconProp(__props.endIcon, iconPayload),
|
|
197
167
|
};
|
|
198
168
|
});
|
|
199
169
|
|
|
@@ -214,30 +184,9 @@ export const VNavigationItem = defineComponent({
|
|
|
214
184
|
if (!to.value) {
|
|
215
185
|
return toggle();
|
|
216
186
|
}
|
|
217
|
-
// console.log('★');
|
|
218
|
-
// open();
|
|
219
|
-
// if (!to.value) {
|
|
220
|
-
// toggle();
|
|
221
|
-
// }
|
|
222
|
-
// ctx.emit('click', ev);
|
|
223
187
|
};
|
|
224
188
|
|
|
225
189
|
const onChangeActive = (isActive: boolean) => {
|
|
226
|
-
// if (isActive) {
|
|
227
|
-
// // open();
|
|
228
|
-
// // if (typeof window !== 'undefined') {
|
|
229
|
-
// // // open();
|
|
230
|
-
// // // console.log('hoge', window);
|
|
231
|
-
// // setTimeout(() => {
|
|
232
|
-
// // open();
|
|
233
|
-
// // }, 1000);
|
|
234
|
-
// // }
|
|
235
|
-
// // open();
|
|
236
|
-
// // console.log(props);
|
|
237
|
-
// // setTimeout(() => {
|
|
238
|
-
// // open();
|
|
239
|
-
// // }, 500);
|
|
240
|
-
// }
|
|
241
190
|
ctx.emit('changeActive', isActive);
|
|
242
191
|
};
|
|
243
192
|
|
|
@@ -273,8 +222,6 @@ export const VNavigationItem = defineComponent({
|
|
|
273
222
|
{
|
|
274
223
|
startIconEmptySpace: _props.value.startIconEmptySpace,
|
|
275
224
|
depth: props.nested ? props.depth + 1 : props.depth,
|
|
276
|
-
// onClick,
|
|
277
|
-
// onChangeActive,
|
|
278
225
|
},
|
|
279
226
|
),
|
|
280
227
|
)}
|
|
@@ -44,6 +44,7 @@ export const VNumberField = defineComponent({
|
|
|
44
44
|
});
|
|
45
45
|
|
|
46
46
|
const inputmode = computed<TextFieldInput['inputmode']>(() => {
|
|
47
|
+
// eslint-disable-next-line no-shadow
|
|
47
48
|
const { inputmode } = ctx.attrs as TextFieldInput;
|
|
48
49
|
if (inputmode) return inputmode;
|
|
49
50
|
return hasNumberMask.value ? 'decimal' : undefined;
|
|
@@ -57,19 +58,17 @@ export const VNumberField = defineComponent({
|
|
|
57
58
|
ctx.emit('change', toNumber(value));
|
|
58
59
|
};
|
|
59
60
|
|
|
60
|
-
return () =>
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
);
|
|
73
|
-
};
|
|
61
|
+
return () => (
|
|
62
|
+
<VTextField
|
|
63
|
+
{...ctx.attrs}
|
|
64
|
+
type={hasNumberMask.value ? 'text' : 'number'}
|
|
65
|
+
inputmode={inputmode.value}
|
|
66
|
+
maskModel="typed"
|
|
67
|
+
modelValue={toString(props.modelValue)}
|
|
68
|
+
onUpdate:modelValue={onUpdateModelValue}
|
|
69
|
+
onChange={onChange}
|
|
70
|
+
v-slots={ctx.slots as any}
|
|
71
|
+
/>
|
|
72
|
+
);
|
|
74
73
|
},
|
|
75
74
|
});
|
|
@@ -16,35 +16,32 @@ export const VOption = defineComponent({
|
|
|
16
16
|
...createControlProps(),
|
|
17
17
|
},
|
|
18
18
|
emits,
|
|
19
|
+
// eslint-disable-next-line no-shadow
|
|
19
20
|
setup(props, ctx) {
|
|
20
21
|
const nodeControl = useFormSelectorItemControl(props, ctx, {
|
|
21
22
|
nodeType: VUI_OPTION_SYMBOL,
|
|
22
23
|
parentNodeType: VUI_SELECT_SYMBOL,
|
|
23
24
|
});
|
|
24
25
|
const control = useControl(props);
|
|
25
|
-
const classes = computed(() =>
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
];
|
|
35
|
-
});
|
|
26
|
+
const classes = computed(() => [
|
|
27
|
+
'v-option',
|
|
28
|
+
{
|
|
29
|
+
'v-option--selected': nodeControl.selected,
|
|
30
|
+
'v-option--has-not-value': !nodeControl.hasValue,
|
|
31
|
+
'v-option--disabled': nodeControl.isDisabled,
|
|
32
|
+
},
|
|
33
|
+
control.classes.value,
|
|
34
|
+
]);
|
|
36
35
|
|
|
37
|
-
return () =>
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
);
|
|
48
|
-
};
|
|
36
|
+
return () => (
|
|
37
|
+
<label
|
|
38
|
+
class={classes.value}
|
|
39
|
+
onClick={nodeControl.handleClickElement}
|
|
40
|
+
tabindex={nodeControl.tabindex}
|
|
41
|
+
data-value={nodeControl.propValue}
|
|
42
|
+
aria-disabled={nodeControl.isDisabled}>
|
|
43
|
+
<span class="v-option__label">{ctx.slots.default?.()}</span>
|
|
44
|
+
</label>
|
|
45
|
+
);
|
|
49
46
|
},
|
|
50
47
|
});
|
|
@@ -30,17 +30,15 @@ export const VOptionGroup = defineComponent({
|
|
|
30
30
|
const groupControl = useFormSelectorItemGroupControl(props, ctx, {
|
|
31
31
|
parentNodeType: VUI_SELECT_SYMBOL,
|
|
32
32
|
});
|
|
33
|
-
const labelSlot = computed(() =>
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
const classes = computed(() =>
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
];
|
|
43
|
-
});
|
|
33
|
+
const labelSlot = computed(() =>
|
|
34
|
+
resolveVNodeChildOrSlots(props.label, ctx.slots.label),
|
|
35
|
+
);
|
|
36
|
+
const classes = computed(() => [
|
|
37
|
+
'v-option-group',
|
|
38
|
+
{
|
|
39
|
+
'v-option-group--disabled': groupControl.isDisabled,
|
|
40
|
+
},
|
|
41
|
+
]);
|
|
44
42
|
|
|
45
43
|
ctx.expose({
|
|
46
44
|
control: groupControl,
|
|
@@ -15,9 +15,9 @@ import {
|
|
|
15
15
|
} from '@fastkit/vue-utils';
|
|
16
16
|
import { isPromise } from '@fastkit/helpers';
|
|
17
17
|
import { useRouter, RouterLink } from 'vue-router';
|
|
18
|
-
import { resolveRawIconProp } from '../VIcon';
|
|
19
18
|
import { resizeDirectiveArgument } from '@fastkit/vue-resize';
|
|
20
19
|
import { useScopeColorClass, ScopeName } from '@fastkit/vue-color-scheme';
|
|
20
|
+
import { resolveRawIconProp } from '../VIcon';
|
|
21
21
|
import { useVui } from '../../injections';
|
|
22
22
|
|
|
23
23
|
export type VPaginationGuard = (
|
|
@@ -142,15 +142,16 @@ export const VPagination = defineComponent({
|
|
|
142
142
|
const end = pageValue + left - 2 - even;
|
|
143
143
|
|
|
144
144
|
return [1, 'truncate', ..._range(start, end), 'truncate', length];
|
|
145
|
-
}
|
|
145
|
+
}
|
|
146
|
+
if (pageValue === left) {
|
|
146
147
|
const end = pageValue + left - 1 - even;
|
|
147
148
|
return [..._range(1, end), 'truncate', length];
|
|
148
|
-
}
|
|
149
|
+
}
|
|
150
|
+
if (pageValue === right) {
|
|
149
151
|
const start = pageValue - left + 1;
|
|
150
152
|
return [1, 'truncate', ..._range(start, length)];
|
|
151
|
-
} else {
|
|
152
|
-
return [..._range(1, left), 'truncate', ..._range(right, length)];
|
|
153
153
|
}
|
|
154
|
+
return [..._range(1, left), 'truncate', ..._range(right, length)];
|
|
154
155
|
});
|
|
155
156
|
|
|
156
157
|
const isActive = computed(() => computedLength.value > 1);
|
|
@@ -190,11 +191,10 @@ export const VPagination = defineComponent({
|
|
|
190
191
|
return router.push(to).then((failure) => {
|
|
191
192
|
!failure && ctx.emit('change', newPage);
|
|
192
193
|
});
|
|
193
|
-
} else {
|
|
194
|
-
internalValue.value = newPage;
|
|
195
|
-
(ctx as any).emit('update:modelValue', newPage);
|
|
196
|
-
ctx.emit('change', newPage);
|
|
197
194
|
}
|
|
195
|
+
internalValue.value = newPage;
|
|
196
|
+
(ctx as any).emit('update:modelValue', newPage);
|
|
197
|
+
ctx.emit('change', newPage);
|
|
198
198
|
}
|
|
199
199
|
|
|
200
200
|
function createPageInfo(source: ItemSource): {
|
|
@@ -245,6 +245,7 @@ export const VPagination = defineComponent({
|
|
|
245
245
|
function genItem(source: ItemSource, index: number) {
|
|
246
246
|
const { number, page, active, disabled } = createPageInfo(source);
|
|
247
247
|
const type = number ? 'num' : source;
|
|
248
|
+
// eslint-disable-next-line no-shadow
|
|
248
249
|
const classes = [
|
|
249
250
|
'v-pagination__item',
|
|
250
251
|
{
|
|
@@ -296,18 +297,17 @@ export const VPagination = defineComponent({
|
|
|
296
297
|
{children}
|
|
297
298
|
</RouterLink>
|
|
298
299
|
);
|
|
299
|
-
} else {
|
|
300
|
-
return (
|
|
301
|
-
<button
|
|
302
|
-
class={classes}
|
|
303
|
-
type="button"
|
|
304
|
-
value={page}
|
|
305
|
-
onClick={onClick}
|
|
306
|
-
key={key}>
|
|
307
|
-
{children}
|
|
308
|
-
</button>
|
|
309
|
-
);
|
|
310
300
|
}
|
|
301
|
+
return (
|
|
302
|
+
<button
|
|
303
|
+
class={classes}
|
|
304
|
+
type="button"
|
|
305
|
+
value={page}
|
|
306
|
+
onClick={onClick}
|
|
307
|
+
key={key}>
|
|
308
|
+
{children}
|
|
309
|
+
</button>
|
|
310
|
+
);
|
|
311
311
|
}
|
|
312
312
|
|
|
313
313
|
watch(
|
|
@@ -335,6 +335,7 @@ export const VPagination = defineComponent({
|
|
|
335
335
|
const el = elRef.value;
|
|
336
336
|
if (el) {
|
|
337
337
|
const style = window.getComputedStyle(el, 'before');
|
|
338
|
+
// eslint-disable-next-line no-shadow
|
|
338
339
|
const width = style.getPropertyValue('width');
|
|
339
340
|
const margin = style.getPropertyValue('margin');
|
|
340
341
|
const size = parseFloat(width) + parseFloat(margin) * 0.5;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import './VPaper.scss';
|
|
2
2
|
import { defineComponent, computed, PropType, VNodeProps } from 'vue';
|
|
3
|
-
import { createElevationProps, useElevation } from '../../composables';
|
|
4
3
|
import { renderSlotOrEmpty, defineSlots } from '@fastkit/vue-utils';
|
|
5
4
|
import { useScopeColorClass, ScopeName } from '@fastkit/vue-color-scheme';
|
|
5
|
+
import { createElevationProps, useElevation } from '../../composables';
|
|
6
6
|
|
|
7
7
|
export const paperBaseSlots = defineSlots<{
|
|
8
8
|
header?: () => void;
|
|
@@ -17,6 +17,7 @@ export const VRadio = defineComponent({
|
|
|
17
17
|
...createControlProps(),
|
|
18
18
|
},
|
|
19
19
|
emits,
|
|
20
|
+
// eslint-disable-next-line no-shadow
|
|
20
21
|
setup(props, ctx) {
|
|
21
22
|
const nodeControl = useFormSelectorItemControl(props, ctx, {
|
|
22
23
|
nodeType: VUI_RADIO_SYMBOL,
|
|
@@ -36,17 +37,15 @@ export const VRadio = defineComponent({
|
|
|
36
37
|
label: () => ctx.slots.default?.(),
|
|
37
38
|
};
|
|
38
39
|
|
|
39
|
-
return () =>
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
);
|
|
50
|
-
};
|
|
40
|
+
return () => (
|
|
41
|
+
<VCheckable
|
|
42
|
+
class={classes.value}
|
|
43
|
+
checked={nodeControl.selected}
|
|
44
|
+
invalid={nodeControl.invalid}
|
|
45
|
+
disabled={nodeControl.isDisabled}
|
|
46
|
+
readonly={nodeControl.isReadonly}
|
|
47
|
+
v-slots={slots}
|
|
48
|
+
/>
|
|
49
|
+
);
|
|
51
50
|
},
|
|
52
51
|
});
|