@fastkit/vui 0.18.30 → 0.18.32
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 +400 -482
- 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 +27 -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 +3 -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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fastkit/vui",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.32",
|
|
4
4
|
"description": "A simple, extensible UI kit for Vue applications.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"fastkit",
|
|
@@ -44,31 +44,31 @@
|
|
|
44
44
|
"src"
|
|
45
45
|
],
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@fastkit/color-scheme": "1.0.
|
|
48
|
-
"@fastkit/dom": "0.1.
|
|
49
|
-
"@fastkit/color-scheme-gen": "0.13.
|
|
50
|
-
"@fastkit/helpers": "0.13.
|
|
51
|
-
"@fastkit/
|
|
52
|
-
"@fastkit/media-match
|
|
53
|
-
"@fastkit/
|
|
47
|
+
"@fastkit/color-scheme": "1.0.15",
|
|
48
|
+
"@fastkit/dom": "0.1.8",
|
|
49
|
+
"@fastkit/color-scheme-gen": "0.13.15",
|
|
50
|
+
"@fastkit/helpers": "0.13.8",
|
|
51
|
+
"@fastkit/icon-font": "1.0.10",
|
|
52
|
+
"@fastkit/media-match": "1.0.10",
|
|
53
|
+
"@fastkit/media-match-gen": "0.13.15",
|
|
54
|
+
"@fastkit/rules": "0.13.10",
|
|
55
|
+
"@fastkit/tiny-logger": "0.13.8",
|
|
56
|
+
"@fastkit/vue-action": "0.2.21",
|
|
57
|
+
"@fastkit/vue-app-layout": "0.14.22",
|
|
58
|
+
"@fastkit/vue-body-scroll-lock": "0.1.19",
|
|
59
|
+
"@fastkit/vue-color-scheme": "0.14.19",
|
|
60
|
+
"@fastkit/vue-form-control": "0.19.19",
|
|
61
|
+
"@fastkit/vue-keyboard": "0.1.8",
|
|
62
|
+
"@fastkit/vue-location": "0.1.26",
|
|
63
|
+
"@fastkit/vue-resize": "0.1.19",
|
|
64
|
+
"@fastkit/vue-media-match": "0.13.15",
|
|
65
|
+
"@fastkit/vue-scroller": "0.14.21",
|
|
66
|
+
"@fastkit/vue-transitions": "0.1.23",
|
|
67
|
+
"@fastkit/vue-utils": "0.14.17",
|
|
68
|
+
"@fastkit/vue-click-outside": "0.1.20",
|
|
69
|
+
"@fastkit/vue-loading": "0.14.20",
|
|
54
70
|
"@fastkit/stylebase": "0.13.1",
|
|
55
|
-
"@fastkit/
|
|
56
|
-
"@fastkit/tiny-logger": "0.13.7",
|
|
57
|
-
"@fastkit/vue-action": "0.2.20",
|
|
58
|
-
"@fastkit/vue-app-layout": "0.14.21",
|
|
59
|
-
"@fastkit/vue-color-scheme": "0.14.18",
|
|
60
|
-
"@fastkit/vue-click-outside": "0.1.19",
|
|
61
|
-
"@fastkit/vue-body-scroll-lock": "0.1.18",
|
|
62
|
-
"@fastkit/vue-keyboard": "0.1.7",
|
|
63
|
-
"@fastkit/vue-loading": "0.14.19",
|
|
64
|
-
"@fastkit/vue-form-control": "0.19.18",
|
|
65
|
-
"@fastkit/vue-location": "0.1.25",
|
|
66
|
-
"@fastkit/vue-media-match": "0.13.14",
|
|
67
|
-
"@fastkit/vue-resize": "0.1.18",
|
|
68
|
-
"@fastkit/vue-scroller": "0.14.20",
|
|
69
|
-
"@fastkit/vue-transitions": "0.1.22",
|
|
70
|
-
"@fastkit/vue-stack": "0.15.51",
|
|
71
|
-
"@fastkit/vue-utils": "0.14.16"
|
|
71
|
+
"@fastkit/vue-stack": "0.15.53"
|
|
72
72
|
},
|
|
73
73
|
"peerDependencies": {
|
|
74
74
|
"vue": "^3.3.0",
|
|
@@ -8,12 +8,10 @@ export const VApp = defineComponent({
|
|
|
8
8
|
setup(_props, ctx) {
|
|
9
9
|
useInjectTheme();
|
|
10
10
|
|
|
11
|
-
return () =>
|
|
12
|
-
|
|
13
|
-
<
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
);
|
|
17
|
-
};
|
|
11
|
+
return () => (
|
|
12
|
+
<VDynamicStacks>
|
|
13
|
+
<VAppLayout v-slots={ctx.slots} />
|
|
14
|
+
</VDynamicStacks>
|
|
15
|
+
);
|
|
18
16
|
},
|
|
19
17
|
});
|
|
@@ -8,6 +8,7 @@ import { VBusyImage } from '../VBusyImage';
|
|
|
8
8
|
// @TODO Unable to resolve dts for `navigationableInheritProps`.
|
|
9
9
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
10
10
|
// @ts-ignore
|
|
11
|
+
// eslint-disable-next-line import/order
|
|
11
12
|
import { RouteLocationRaw } from 'vue-router';
|
|
12
13
|
|
|
13
14
|
export const AVATAR_SIZES = ['sm', 'md', 'lg'] as const;
|
|
@@ -33,13 +33,13 @@ export const VBreadcrumbs = defineComponent({
|
|
|
33
33
|
const vui = useVui();
|
|
34
34
|
|
|
35
35
|
const computedItemsRef = computed(() => {
|
|
36
|
-
const items: BreadcrumbsItem[] = props.items.map((rawItem) =>
|
|
37
|
-
|
|
36
|
+
const items: BreadcrumbsItem[] = props.items.map((rawItem) =>
|
|
37
|
+
typeof rawItem === 'string'
|
|
38
38
|
? {
|
|
39
39
|
text: rawItem,
|
|
40
40
|
}
|
|
41
|
-
: rawItem
|
|
42
|
-
|
|
41
|
+
: rawItem,
|
|
42
|
+
);
|
|
43
43
|
|
|
44
44
|
return items.map((item) => {
|
|
45
45
|
const { to, text } = item;
|
|
@@ -56,12 +56,13 @@ export const VBreadcrumbs = defineComponent({
|
|
|
56
56
|
|
|
57
57
|
const lengthRef = computed(() => computedItemsRef.value.length);
|
|
58
58
|
|
|
59
|
-
const defaultDividerSlot = () =>
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
const defaultDividerSlot = () => [
|
|
60
|
+
<i class="v-breadcrumbs__divider__icon" />,
|
|
61
|
+
];
|
|
62
62
|
|
|
63
63
|
return () => {
|
|
64
64
|
if (lengthRef.value < 1) return;
|
|
65
|
+
// eslint-disable-next-line no-shadow
|
|
65
66
|
let dividerSlot: (vui: VuiService) => VNodeChild;
|
|
66
67
|
const propDivider = props.divider;
|
|
67
68
|
if (propDivider) {
|
|
@@ -19,6 +19,7 @@ import type { IconName } from '../VIcon';
|
|
|
19
19
|
// @TODO Unable to resolve dts for `navigationableInheritProps`.
|
|
20
20
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
21
21
|
// @ts-ignore
|
|
22
|
+
// eslint-disable-next-line import/order
|
|
22
23
|
import { RouteLocationRaw } from 'vue-router';
|
|
23
24
|
|
|
24
25
|
export type VButtonSpacer = 'left' | 'right';
|
|
@@ -129,33 +130,31 @@ export const VButton = defineComponent({
|
|
|
129
130
|
},
|
|
130
131
|
]);
|
|
131
132
|
|
|
132
|
-
return () =>
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
);
|
|
159
|
-
};
|
|
133
|
+
return () => (
|
|
134
|
+
<VAction
|
|
135
|
+
{...ctx.attrs}
|
|
136
|
+
class={['v-button', classes.value]}
|
|
137
|
+
guardInProgressClass="v-button--guard-in-progress"
|
|
138
|
+
v-slots={{
|
|
139
|
+
default: () => (
|
|
140
|
+
<>
|
|
141
|
+
<span class="v-button__content">
|
|
142
|
+
{startIcon.value}
|
|
143
|
+
{ctx.slots.default?.()}
|
|
144
|
+
{icon.value}
|
|
145
|
+
{endIcon.value}
|
|
146
|
+
</span>
|
|
147
|
+
{isLoading.value && (
|
|
148
|
+
<VProgressCircular
|
|
149
|
+
class="v-button__loading"
|
|
150
|
+
indeterminate
|
|
151
|
+
size={LOADING_SIZE_MAP[control.size.value]}
|
|
152
|
+
/>
|
|
153
|
+
)}
|
|
154
|
+
</>
|
|
155
|
+
),
|
|
156
|
+
}}
|
|
157
|
+
/>
|
|
158
|
+
);
|
|
160
159
|
},
|
|
161
160
|
});
|
|
@@ -2,8 +2,8 @@ import './VButtonGroup.scss';
|
|
|
2
2
|
|
|
3
3
|
import { defineComponent, isVNode, cloneVNode, VNodeChild, VNode } from 'vue';
|
|
4
4
|
import { colorSchemeProps } from '@fastkit/vue-color-scheme';
|
|
5
|
-
import { createControlProps } from '../../composables';
|
|
6
5
|
import { renderSlotOrEmpty, isFragment } from '@fastkit/vue-utils';
|
|
6
|
+
import { createControlProps } from '../../composables';
|
|
7
7
|
import { VButton } from './VButton';
|
|
8
8
|
|
|
9
9
|
type VButtonGroupChild =
|
|
@@ -68,7 +68,7 @@ export const VButtonGroup = defineComponent({
|
|
|
68
68
|
return cloneVNode(child.node, {
|
|
69
69
|
...props,
|
|
70
70
|
...childProps,
|
|
71
|
-
|
|
71
|
+
rounded: false,
|
|
72
72
|
class: [
|
|
73
73
|
'v-button-group__item',
|
|
74
74
|
{
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import './VCard.scss';
|
|
2
2
|
import { defineComponent, computed } from 'vue';
|
|
3
|
-
import { VPaper, createPaperProps } from '../VPaper';
|
|
4
3
|
import { actionableInheritProps, VAction } from '@fastkit/vue-action';
|
|
5
4
|
|
|
6
5
|
// @TODO Unable to resolve dts for `actionableInheritProps`.
|
|
7
6
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
8
7
|
// @ts-ignore
|
|
9
8
|
import { RouteLocationRaw } from 'vue-router';
|
|
9
|
+
import { VPaper, createPaperProps } from '../VPaper';
|
|
10
10
|
|
|
11
11
|
export function createCardProps() {
|
|
12
12
|
return {
|
|
@@ -45,17 +45,6 @@ export const VCard = defineComponent({
|
|
|
45
45
|
return { attrs };
|
|
46
46
|
});
|
|
47
47
|
|
|
48
|
-
return () => {
|
|
49
|
-
return (
|
|
50
|
-
<VPaper
|
|
51
|
-
{...data.value.attrs}
|
|
52
|
-
// {..._props.value}
|
|
53
|
-
// {...ctx.attrs}
|
|
54
|
-
// class="v-card"
|
|
55
|
-
// tag={VLink}
|
|
56
|
-
v-slots={ctx.slots}
|
|
57
|
-
/>
|
|
58
|
-
);
|
|
59
|
-
};
|
|
48
|
+
return () => <VPaper {...data.value.attrs} v-slots={ctx.slots} />;
|
|
60
49
|
},
|
|
61
50
|
});
|
|
@@ -4,8 +4,6 @@ import { defineComponent } from 'vue';
|
|
|
4
4
|
export const VCardActions = defineComponent({
|
|
5
5
|
name: 'VCardActions',
|
|
6
6
|
setup(_props, ctx) {
|
|
7
|
-
return () => {
|
|
8
|
-
return <div class="v-card-actions">{ctx.slots.default?.()}</div>;
|
|
9
|
-
};
|
|
7
|
+
return () => <div class="v-card-actions">{ctx.slots.default?.()}</div>;
|
|
10
8
|
},
|
|
11
9
|
});
|
|
@@ -4,8 +4,6 @@ import { defineComponent } from 'vue';
|
|
|
4
4
|
export const VCardContent = defineComponent({
|
|
5
5
|
name: 'VCardContent',
|
|
6
6
|
setup(_props, ctx) {
|
|
7
|
-
return () => {
|
|
8
|
-
return <div class="v-card-content">{ctx.slots.default?.()}</div>;
|
|
9
|
-
};
|
|
7
|
+
return () => <div class="v-card-content">{ctx.slots.default?.()}</div>;
|
|
10
8
|
},
|
|
11
9
|
});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import './VCheckable.scss';
|
|
2
2
|
import { computed, defineComponent } from 'vue';
|
|
3
3
|
import { defineSlots } from '@fastkit/vue-utils';
|
|
4
|
-
import { useVuiColorProvider } from '../../injections';
|
|
5
4
|
import { FormNodeErrorSlotsSource } from '@fastkit/vue-form-control';
|
|
5
|
+
import { useVuiColorProvider } from '../../injections';
|
|
6
6
|
|
|
7
7
|
export const CHECKABLE_SLOTS = defineSlots<
|
|
8
8
|
{
|
|
@@ -31,19 +31,17 @@ export const VCheckable = defineComponent({
|
|
|
31
31
|
const readonly = computed(() => props.readonly);
|
|
32
32
|
const checked = computed(() => props.checked);
|
|
33
33
|
// const autoWidth = computed(() => props.autoWidth);
|
|
34
|
-
const classes = computed(() =>
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
];
|
|
46
|
-
});
|
|
34
|
+
const classes = computed(() => [
|
|
35
|
+
{
|
|
36
|
+
'v-checkable--invalid': invalid.value,
|
|
37
|
+
'v-checkable--disabled': disabled.value,
|
|
38
|
+
'v-checkable--readonly': readonly.value,
|
|
39
|
+
'v-checkable--checked': checked.value,
|
|
40
|
+
'v-checkable--custom-icon': !!ctx.slots.icon,
|
|
41
|
+
disabled: disabled.value,
|
|
42
|
+
},
|
|
43
|
+
colorProvider.className(invalid.value ? 'error' : 'primary'),
|
|
44
|
+
]);
|
|
47
45
|
|
|
48
46
|
return () => (
|
|
49
47
|
<label class={['v-checkable', classes.value]}>
|
|
@@ -21,6 +21,7 @@ export const VCheckbox = defineComponent({
|
|
|
21
21
|
indeterminate: Boolean,
|
|
22
22
|
},
|
|
23
23
|
emits,
|
|
24
|
+
// eslint-disable-next-line no-shadow
|
|
24
25
|
setup(props, ctx) {
|
|
25
26
|
const nodeControl = useFormSelectorItemControl(props, ctx, {
|
|
26
27
|
nodeType: VUI_CHECKBOX_SYMBOL,
|
|
@@ -53,17 +54,15 @@ export const VCheckbox = defineComponent({
|
|
|
53
54
|
label: () => ctx.slots.default?.(),
|
|
54
55
|
};
|
|
55
56
|
|
|
56
|
-
return () =>
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
);
|
|
67
|
-
};
|
|
57
|
+
return () => (
|
|
58
|
+
<VCheckable
|
|
59
|
+
class={classes.value}
|
|
60
|
+
checked={nodeControl.selected || isIndeterminate.value}
|
|
61
|
+
invalid={nodeControl.invalid}
|
|
62
|
+
disabled={nodeControl.isDisabled}
|
|
63
|
+
readonly={nodeControl.isReadonly}
|
|
64
|
+
v-slots={slots}
|
|
65
|
+
/>
|
|
66
|
+
);
|
|
68
67
|
},
|
|
69
68
|
});
|
|
@@ -9,6 +9,7 @@ import { VIcon } from '../VIcon';
|
|
|
9
9
|
// @TODO Unable to resolve dts for `actionableInheritProps`.
|
|
10
10
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
11
11
|
// @ts-ignore
|
|
12
|
+
// eslint-disable-next-line import/order
|
|
12
13
|
import { RouteLocationRaw } from 'vue-router';
|
|
13
14
|
|
|
14
15
|
export const CHIP_SIZES = ['xs', 'sm', 'md', 'lg', 'xl'] as const;
|
|
@@ -44,9 +44,7 @@ export const VContentSwitcher = defineComponent({
|
|
|
44
44
|
const elRef = ref<HTMLElement | null>(null);
|
|
45
45
|
const anchorRef = ref<HTMLElement | null>(null);
|
|
46
46
|
const computedOrderRef = computed(() =>
|
|
47
|
-
props.order.map((row) =>
|
|
48
|
-
return typeof row === 'string' ? row : row.value;
|
|
49
|
-
}),
|
|
47
|
+
props.order.map((row) => (typeof row === 'string' ? row : row.value)),
|
|
50
48
|
);
|
|
51
49
|
const currentRef = computed({
|
|
52
50
|
get: () => internalValueRef.value,
|
|
@@ -69,10 +67,10 @@ export const VContentSwitcher = defineComponent({
|
|
|
69
67
|
});
|
|
70
68
|
|
|
71
69
|
function seeTop(options?: ContentSwitcherSeeTopOptions) {
|
|
72
|
-
const
|
|
70
|
+
const scroller = getDocumentScroller();
|
|
73
71
|
const { value: anchor } = anchorRef;
|
|
74
72
|
if (anchor) {
|
|
75
|
-
|
|
73
|
+
scroller.toElement(anchor, options);
|
|
76
74
|
}
|
|
77
75
|
}
|
|
78
76
|
|
|
@@ -132,10 +130,10 @@ export const VContentSwitcher = defineComponent({
|
|
|
132
130
|
<Transition
|
|
133
131
|
name={transitionRef.value}
|
|
134
132
|
onBeforeLeave={(el) => {
|
|
135
|
-
getEl().style.height = (el as HTMLElement).offsetHeight
|
|
133
|
+
getEl().style.height = `${(el as HTMLElement).offsetHeight}px`;
|
|
136
134
|
}}
|
|
137
135
|
onEnter={(el) => {
|
|
138
|
-
getEl().style.height = (el as HTMLElement).offsetHeight
|
|
136
|
+
getEl().style.height = `${(el as HTMLElement).offsetHeight}px`;
|
|
139
137
|
}}
|
|
140
138
|
onAfterEnter={() => {
|
|
141
139
|
getEl().style.height = '';
|
|
@@ -83,7 +83,7 @@ export const VControlField = defineComponent({
|
|
|
83
83
|
const colorProvider = useVuiColorProvider();
|
|
84
84
|
|
|
85
85
|
const classes = computed(() => {
|
|
86
|
-
const
|
|
86
|
+
const _classes = [
|
|
87
87
|
'v-control-field',
|
|
88
88
|
`v-control-field--${inputBox.variant.value}`,
|
|
89
89
|
{
|
|
@@ -95,23 +95,24 @@ export const VControlField = defineComponent({
|
|
|
95
95
|
},
|
|
96
96
|
control.classes.value,
|
|
97
97
|
colorProvider.className(
|
|
98
|
+
// eslint-disable-next-line no-nested-ternary
|
|
98
99
|
props.error
|
|
99
100
|
? 'error'
|
|
100
101
|
: invalid.value && !readonly.value
|
|
101
|
-
|
|
102
|
-
|
|
102
|
+
? 'error'
|
|
103
|
+
: 'primary',
|
|
103
104
|
),
|
|
104
105
|
];
|
|
105
|
-
return
|
|
106
|
+
return _classes;
|
|
106
107
|
});
|
|
107
108
|
|
|
108
109
|
const resolvedSlots = computed(() => {
|
|
109
|
-
const
|
|
110
|
+
const _slots: ResolvedSlots = {};
|
|
110
111
|
ADORNMENT_POSITIONS.forEach((position) => {
|
|
111
112
|
const key = `${position}Adornment` as const;
|
|
112
|
-
|
|
113
|
+
_slots[position] = resolveVNodeChildOrSlots(props[key], ctx.slots[key]);
|
|
113
114
|
});
|
|
114
|
-
return
|
|
115
|
+
return _slots;
|
|
115
116
|
});
|
|
116
117
|
|
|
117
118
|
const renderAdornment = (position: AdornmentPosition) => {
|
|
@@ -140,18 +141,16 @@ export const VControlField = defineComponent({
|
|
|
140
141
|
|
|
141
142
|
const handleClick = (ev: MouseEvent) => ctx.emit('click', ev);
|
|
142
143
|
|
|
143
|
-
return () =>
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
);
|
|
155
|
-
};
|
|
144
|
+
return () => (
|
|
145
|
+
<div
|
|
146
|
+
class={classes.value}
|
|
147
|
+
onClick={handleClick}
|
|
148
|
+
// tabindex={this.computedTabindex}
|
|
149
|
+
ref={hostElRef}>
|
|
150
|
+
{renderAdornment('start')}
|
|
151
|
+
<div class="v-control-field__body">{ctx.slots.default?.()}</div>
|
|
152
|
+
{renderAdornment('end')}
|
|
153
|
+
</div>
|
|
154
|
+
);
|
|
156
155
|
},
|
|
157
156
|
});
|
|
@@ -15,6 +15,10 @@ import {
|
|
|
15
15
|
isVNode,
|
|
16
16
|
HTMLAttributes,
|
|
17
17
|
} from 'vue';
|
|
18
|
+
import { VNodeChildOrSlot } from '@fastkit/vue-utils';
|
|
19
|
+
import { resizeDirectiveArgument } from '@fastkit/vue-resize';
|
|
20
|
+
import { VueAppLayout } from '@fastkit/vue-app-layout';
|
|
21
|
+
import { ScopeName, toScopeColorClass } from '@fastkit/vue-color-scheme';
|
|
18
22
|
import { useVui } from '../../injections';
|
|
19
23
|
import type { VuiService } from '../../service';
|
|
20
24
|
import { VSelect } from '../VSelect';
|
|
@@ -22,10 +26,6 @@ import { VPagination } from '../VPagination';
|
|
|
22
26
|
import { VCheckbox } from '../VCheckbox';
|
|
23
27
|
import { VIcon, resolveRawIconProp } from '../VIcon';
|
|
24
28
|
import { VProgressCircular } from '../loading';
|
|
25
|
-
import { VNodeChildOrSlot } from '@fastkit/vue-utils';
|
|
26
|
-
import { resizeDirectiveArgument } from '@fastkit/vue-resize';
|
|
27
|
-
import { VueAppLayout } from '@fastkit/vue-app-layout';
|
|
28
|
-
import { ScopeName, toScopeColorClass } from '@fastkit/vue-color-scheme';
|
|
29
29
|
import { VPaper } from '../VPaper';
|
|
30
30
|
|
|
31
31
|
export type DataTableHeaderAlign = 'left' | 'center' | 'right';
|
|
@@ -213,6 +213,7 @@ export const VDataTable = defineComponent({
|
|
|
213
213
|
const footerHeightRef = ref(0);
|
|
214
214
|
const internalValues = ref<string[]>(props.modelValue.slice());
|
|
215
215
|
const rowSettings = computed<DataTableRowSettingsFn>(() => {
|
|
216
|
+
// eslint-disable-next-line no-shadow
|
|
216
217
|
const { rowSettings } = props;
|
|
217
218
|
if (!rowSettings) return () => ({});
|
|
218
219
|
return typeof rowSettings === 'function'
|
|
@@ -314,14 +315,14 @@ export const VDataTable = defineComponent({
|
|
|
314
315
|
: props.descQueryValue,
|
|
315
316
|
);
|
|
316
317
|
|
|
317
|
-
const isTransitioningRef = computed(() =>
|
|
318
|
-
|
|
318
|
+
const isTransitioningRef = computed(() =>
|
|
319
|
+
vui.location.isQueryOnlyTransitioning([
|
|
319
320
|
props.pageQuery,
|
|
320
321
|
props.sortQuery,
|
|
321
322
|
props.orderQuery,
|
|
322
323
|
props.limitQuery,
|
|
323
|
-
])
|
|
324
|
-
|
|
324
|
+
]),
|
|
325
|
+
);
|
|
325
326
|
|
|
326
327
|
const pageRef = computed(() =>
|
|
327
328
|
vui.location.getQuery(props.pageQuery, Number, 1),
|
|
@@ -332,9 +333,7 @@ export const VDataTable = defineComponent({
|
|
|
332
333
|
);
|
|
333
334
|
|
|
334
335
|
const sortByRef = computed({
|
|
335
|
-
get: () =>
|
|
336
|
-
return vui.location.getQuery(props.sortQuery);
|
|
337
|
-
},
|
|
336
|
+
get: () => vui.location.getQuery(props.sortQuery),
|
|
338
337
|
set(value) {
|
|
339
338
|
vui.location.pushQuery({
|
|
340
339
|
[props.sortQuery]: value || null,
|
|
@@ -395,12 +394,11 @@ export const VDataTable = defineComponent({
|
|
|
395
394
|
let icon = vui.icon('sort');
|
|
396
395
|
if (typeof icon === 'string') {
|
|
397
396
|
const name = icon;
|
|
398
|
-
icon = (gen) =>
|
|
399
|
-
|
|
397
|
+
icon = (gen) =>
|
|
398
|
+
gen({
|
|
400
399
|
name,
|
|
401
400
|
rotate: isASCRef.value ? 180 : 0,
|
|
402
401
|
});
|
|
403
|
-
};
|
|
404
402
|
}
|
|
405
403
|
return icon;
|
|
406
404
|
});
|
|
@@ -544,12 +542,10 @@ export const VDataTable = defineComponent({
|
|
|
544
542
|
size="sm"
|
|
545
543
|
hiddenInfo
|
|
546
544
|
disabled={isTransitioningRef.value}
|
|
547
|
-
items={props.limits.map((limit) => {
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
};
|
|
552
|
-
})}
|
|
545
|
+
items={props.limits.map((limit) => ({
|
|
546
|
+
label: `${limit}件`,
|
|
547
|
+
value: limit,
|
|
548
|
+
}))}
|
|
553
549
|
v-model={limitRef.value}
|
|
554
550
|
/>
|
|
555
551
|
</div>
|
|
@@ -693,6 +689,7 @@ export const VDataTable = defineComponent({
|
|
|
693
689
|
}
|
|
694
690
|
|
|
695
691
|
if (!cellChildren) {
|
|
692
|
+
// eslint-disable-next-line default-case
|
|
696
693
|
switch (headerKey) {
|
|
697
694
|
case SELECTABLE_HEADER_SYMBOL: {
|
|
698
695
|
cellChildren = [
|
|
@@ -766,9 +763,9 @@ export const VDataTable = defineComponent({
|
|
|
766
763
|
watch(
|
|
767
764
|
() => props.items,
|
|
768
765
|
(items) => {
|
|
769
|
-
internalValues.value = internalValues.value.filter((key) =>
|
|
770
|
-
|
|
771
|
-
|
|
766
|
+
internalValues.value = internalValues.value.filter((key) =>
|
|
767
|
+
sortedItemKeysRef.value.includes(key),
|
|
768
|
+
);
|
|
772
769
|
},
|
|
773
770
|
);
|
|
774
771
|
|
|
@@ -24,9 +24,8 @@ export const VDialog = defineDialogComponent({
|
|
|
24
24
|
resolver: (actions) => {
|
|
25
25
|
if (actions.length === 0) {
|
|
26
26
|
return [vui.stackAction('close')];
|
|
27
|
-
} else {
|
|
28
|
-
return actions;
|
|
29
27
|
}
|
|
28
|
+
return actions;
|
|
30
29
|
},
|
|
31
30
|
});
|
|
32
31
|
const color = useColorClasses(props, { useRootThemeDefault: true });
|
|
@@ -31,23 +31,22 @@ export const VForm = defineComponent({
|
|
|
31
31
|
props: createVFormProps(),
|
|
32
32
|
emits,
|
|
33
33
|
slots: formSlots,
|
|
34
|
+
// eslint-disable-next-line no-shadow
|
|
34
35
|
setup(props, ctx) {
|
|
35
36
|
const nodeControl = useForm(props, ctx as any, {
|
|
36
37
|
nodeType: VUI_FORM_SYMBOL,
|
|
37
38
|
});
|
|
38
|
-
const classes = computed(() =>
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
];
|
|
50
|
-
});
|
|
39
|
+
const classes = computed(() => [
|
|
40
|
+
'v-form',
|
|
41
|
+
{
|
|
42
|
+
'v-form--valid': nodeControl.valid,
|
|
43
|
+
'v-form--invalid': nodeControl.invalid,
|
|
44
|
+
'v-form--disabled': nodeControl.isDisabled,
|
|
45
|
+
'v-form--validating': nodeControl.validating,
|
|
46
|
+
'v-form--pending': nodeControl.pending,
|
|
47
|
+
'v-form--sending': nodeControl.sending,
|
|
48
|
+
},
|
|
49
|
+
]);
|
|
51
50
|
useControl(props);
|
|
52
51
|
|
|
53
52
|
ctx.expose({
|