@fastkit/vui 1.0.0 → 1.1.1
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/after-effects/display-flow.scss +2 -2
- package/dist/vui.css +9 -9
- package/dist/vui.d.ts +517 -396
- package/dist/vui.mjs +85 -76
- package/dist/vui.mjs.map +1 -1
- package/package.json +32 -28
- package/src/components/VAvatar/VAvatar.scss +4 -4
- package/src/components/VAvatar/VAvatar.tsx +0 -1
- package/src/components/VBreadcrumbs/VBreadcrumbs.scss +2 -2
- package/src/components/VBreadcrumbs/VBreadcrumbs.tsx +1 -1
- package/src/components/VBusyImage/VBusyImage.scss +1 -1
- package/src/components/VButton/VButton.scss +3 -3
- package/src/components/VButton/VButton.tsx +0 -1
- package/src/components/VCard/VCard.scss +2 -2
- package/src/components/VCheckable/VCheckable.scss +1 -1
- package/src/components/VCheckable/VCheckable.tsx +4 -1
- package/src/components/VCheckbox/VCheckbox.scss +3 -3
- package/src/components/VCheckbox/VCheckbox.tsx +0 -1
- package/src/components/VChip/VChip.scss +4 -4
- package/src/components/VChip/VChip.tsx +0 -1
- package/src/components/VControlField/VControlField.scss +1 -1
- package/src/components/VControlField/VControlField.tsx +4 -3
- package/src/components/VDataTable/VDataTable.scss +3 -3
- package/src/components/VDataTable/VDataTable.tsx +0 -2
- package/src/components/VDialog/VDialog.scss +1 -1
- package/src/components/VDisabledReason/VDisabledReason.scss +1 -1
- package/src/components/VDisabledReason/VDisabledReason.tsx +78 -7
- package/src/components/VForm/VForm.tsx +20 -8
- package/src/components/VFormControl/VFormControl.scss +1 -1
- package/src/components/VFormControl/VFormControl.tsx +2 -6
- package/src/components/VFormGroup/VFormGroup.tsx +0 -1
- package/src/components/VGrid/schemes.ts +0 -1
- package/src/components/VListTile/VListTile.scss +1 -1
- package/src/components/VListTile/VListTile.tsx +0 -2
- package/src/components/VNavigation/VNavigation.tsx +1 -2
- package/src/components/VNavigation/VNavigationItem.tsx +1 -4
- package/src/components/VNumberField/VNumberField.tsx +0 -1
- package/src/components/VOption/VOption.scss +1 -1
- package/src/components/VOption/VOption.tsx +0 -1
- package/src/components/VPagination/VPagination.scss +2 -2
- package/src/components/VPagination/VPagination.tsx +1 -2
- package/src/components/VRadio/VRadio.scss +1 -1
- package/src/components/VRadio/VRadio.tsx +0 -1
- package/src/components/VSelect/VSelect.scss +2 -2
- package/src/components/VSelect/VSelect.tsx +1 -3
- package/src/components/VSheetModal/VSheetModal.tsx +0 -1
- package/src/components/VSkeltonLoader/VSkeltonLoaderBone.scss +4 -4
- package/src/components/VSwitch/VSwitch.scss +1 -1
- package/src/components/VSwitch/VSwitch.tsx +0 -1
- package/src/components/VTabs/VTab.scss +3 -3
- package/src/components/VTabs/VTabs.tsx +1 -4
- package/src/components/VTextField/VTextField.scss +3 -3
- package/src/components/VTextField/VTextField.tsx +0 -1
- package/src/components/VTextarea/VTextarea.scss +2 -2
- package/src/components/VTextarea/VTextarea.tsx +0 -1
- package/src/components/VToolbar/VToolbarMenu.tsx +0 -1
- package/src/composables/form-selector.tsx +1 -2
- package/src/plugin.tsx +1 -2
- package/src/service.tsx +0 -1
- package/src/styles/base.scss +2 -2
- package/src/styles/core/functions.scss +8 -4
- package/src/styles/core.scss +2 -2
- package/src/styles/elevation.scss +1 -1
- package/src/styles/group.scss +3 -3
- package/src/styles/index.scss +7 -7
- package/src/styles/typo.scss +1 -1
- package/src/styles/variables.scss +31 -26
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fastkit/vui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "A simple, extensible UI kit for Vue applications.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"fastkit",
|
|
@@ -44,32 +44,36 @@
|
|
|
44
44
|
"src"
|
|
45
45
|
],
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@fastkit/
|
|
48
|
-
"@fastkit/
|
|
49
|
-
"@fastkit/
|
|
50
|
-
"@fastkit/
|
|
51
|
-
"@fastkit/
|
|
52
|
-
"@fastkit/
|
|
47
|
+
"@fastkit/color-scheme": "^2.1.0",
|
|
48
|
+
"@fastkit/helpers": "^0.15.0",
|
|
49
|
+
"@fastkit/color-scheme-gen": "^1.1.0",
|
|
50
|
+
"@fastkit/icon-font": "^2.1.0",
|
|
51
|
+
"@fastkit/dom": "^0.3.0",
|
|
52
|
+
"@fastkit/media-match": "^2.1.0",
|
|
53
|
+
"@fastkit/tiny-logger": "^0.15.0",
|
|
54
|
+
"@fastkit/media-match-gen": "^1.1.0",
|
|
53
55
|
"@fastkit/stylebase": "^0.13.1",
|
|
54
|
-
"@fastkit/
|
|
55
|
-
"@fastkit/
|
|
56
|
-
"@fastkit/
|
|
57
|
-
"@fastkit/vue-
|
|
58
|
-
"@fastkit/
|
|
59
|
-
"@fastkit/vue-body-scroll-lock": "^0.
|
|
60
|
-
"@fastkit/vue-
|
|
61
|
-
"@fastkit/vue-
|
|
62
|
-
"@fastkit/vue-
|
|
63
|
-
"@fastkit/vue-
|
|
64
|
-
"@fastkit/vue-
|
|
65
|
-
"@fastkit/vue-
|
|
66
|
-
"@fastkit/vue-
|
|
67
|
-
"@fastkit/vue-
|
|
68
|
-
"@fastkit/vue-
|
|
69
|
-
"@fastkit/vue-
|
|
70
|
-
"@fastkit/vue-
|
|
71
|
-
|
|
72
|
-
|
|
56
|
+
"@fastkit/vue-action": "^0.4.0",
|
|
57
|
+
"@fastkit/rules": "^0.15.0",
|
|
58
|
+
"@fastkit/vue-click-outside": "^0.3.0",
|
|
59
|
+
"@fastkit/vue-disabled-reason": "^0.1.0",
|
|
60
|
+
"@fastkit/vue-form-control": "^0.22.1",
|
|
61
|
+
"@fastkit/vue-body-scroll-lock": "^0.3.0",
|
|
62
|
+
"@fastkit/vue-keyboard": "^0.3.0",
|
|
63
|
+
"@fastkit/vue-loading": "^0.16.0",
|
|
64
|
+
"@fastkit/vue-app-layout": "^0.17.0",
|
|
65
|
+
"@fastkit/vue-location": "^0.5.0",
|
|
66
|
+
"@fastkit/vue-color-scheme": "^0.16.0",
|
|
67
|
+
"@fastkit/vue-media-match": "^0.15.0",
|
|
68
|
+
"@fastkit/vue-scroller": "^0.16.0",
|
|
69
|
+
"@fastkit/vue-resize": "^0.3.0",
|
|
70
|
+
"@fastkit/vue-stack": "^0.18.0",
|
|
71
|
+
"@fastkit/vue-utils": "^0.16.0",
|
|
72
|
+
"@fastkit/vue-transitions": "^0.3.0"
|
|
73
|
+
},
|
|
74
|
+
"devDependencies": {
|
|
75
|
+
"vue": "^3.5.21",
|
|
76
|
+
"vue-router": "^4.5.1"
|
|
73
77
|
},
|
|
74
78
|
"peerDependencies": {
|
|
75
79
|
"vue": "^3.4.0",
|
|
@@ -89,8 +93,8 @@
|
|
|
89
93
|
"scripts": {
|
|
90
94
|
"build": "plugboy build",
|
|
91
95
|
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist",
|
|
92
|
-
"eslint": "eslint .
|
|
93
|
-
"eslint:fix": "eslint . --
|
|
96
|
+
"eslint": "eslint .",
|
|
97
|
+
"eslint:fix": "eslint . --fix",
|
|
94
98
|
"format": "pnpm run \"/^(eslint:fix|stylelint:fix)$/\"",
|
|
95
99
|
"lint": "pnpm run \"/^(eslint|stylelint)$/\"",
|
|
96
100
|
"stub": "plugboy stub",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@use '../../styles/core
|
|
1
|
+
@use '../../styles/core';
|
|
2
2
|
|
|
3
3
|
@layer vui {
|
|
4
4
|
.v-avatar {
|
|
@@ -22,15 +22,15 @@
|
|
|
22
22
|
font-size: var(--avatar-font-size);
|
|
23
23
|
font-weight: var(--avatar-font-weight);
|
|
24
24
|
line-height: 1;
|
|
25
|
-
text-align: center;
|
|
26
25
|
vertical-align: bottom;
|
|
26
|
+
text-align: center;
|
|
27
27
|
cursor: default;
|
|
28
28
|
border-style: solid;
|
|
29
29
|
border-width: 1px;
|
|
30
30
|
border-radius: var(--avatar-radius);
|
|
31
31
|
|
|
32
|
-
--shadow-color:
|
|
33
|
-
--focusShadow-color:
|
|
32
|
+
--shadow-color: rgb(0, 0, 0, 0) !important; // @TODO layer supports
|
|
33
|
+
--focusShadow-color: rgb(0, 0, 0, 0) !important; // @TODO layer supports
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
&--clickable {
|
|
@@ -8,7 +8,6 @@ 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
|
|
12
11
|
import { RouteLocationRaw } from 'vue-router';
|
|
13
12
|
|
|
14
13
|
export const AVATAR_SIZES = ['sm', 'md', 'lg'] as const;
|
|
@@ -30,17 +30,17 @@
|
|
|
30
30
|
// font-size: calc(var(--root-em) * 0.875);
|
|
31
31
|
font-weight: 500;
|
|
32
32
|
line-height: 1;
|
|
33
|
-
|
|
33
|
+
vertical-align: bottom;
|
|
34
34
|
text-transform: uppercase;
|
|
35
35
|
letter-spacing: math.div(1.25, 14) * 1em; // 1.25px;
|
|
36
|
-
|
|
36
|
+
text-decoration: none;
|
|
37
37
|
appearance: none;
|
|
38
38
|
cursor: pointer;
|
|
39
39
|
user-select: none;
|
|
40
|
+
outline: 0;
|
|
40
41
|
border-style: solid;
|
|
41
42
|
border-width: 1px;
|
|
42
43
|
border-radius: var(--control-field-radius);
|
|
43
|
-
outline: 0;
|
|
44
44
|
transition:
|
|
45
45
|
0.3s cubic-bezier(0.25, 0.8, 0.5, 1),
|
|
46
46
|
color 1ms;
|
|
@@ -23,7 +23,6 @@ import type { IconName } from '../VIcon';
|
|
|
23
23
|
// @TODO Unable to resolve dts for `navigationableInheritProps`.
|
|
24
24
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
25
25
|
// @ts-ignore
|
|
26
|
-
// eslint-disable-next-line import/order
|
|
27
26
|
import { RouteLocationRaw } from 'vue-router';
|
|
28
27
|
|
|
29
28
|
export type VButtonSpacer = 'left' | 'right';
|
|
@@ -2,6 +2,7 @@ import './VCheckable.scss';
|
|
|
2
2
|
import { computed, defineComponent } from 'vue';
|
|
3
3
|
import { defineSlots } from '@fastkit/vue-utils';
|
|
4
4
|
import { FormNodeErrorSlotsSource } from '@fastkit/vue-form-control';
|
|
5
|
+
import { DISABLED_REASON_CONTAINER_BIND } from '@fastkit/vue-disabled-reason';
|
|
5
6
|
import { useVuiColorProvider } from '../../injections';
|
|
6
7
|
|
|
7
8
|
export const CHECKABLE_SLOTS = defineSlots<
|
|
@@ -44,7 +45,9 @@ export const VCheckable = defineComponent({
|
|
|
44
45
|
]);
|
|
45
46
|
|
|
46
47
|
return () => (
|
|
47
|
-
<label
|
|
48
|
+
<label
|
|
49
|
+
class={['v-checkable', classes.value]}
|
|
50
|
+
{...DISABLED_REASON_CONTAINER_BIND}>
|
|
48
51
|
<span class="v-checkable__faux">
|
|
49
52
|
{ctx.slots.input?.()}
|
|
50
53
|
{ctx.slots.icon ? (
|
|
@@ -15,6 +15,9 @@
|
|
|
15
15
|
display: block;
|
|
16
16
|
width: 100%;
|
|
17
17
|
height: 100%;
|
|
18
|
+
background: var(--my-faux-bg-color);
|
|
19
|
+
border: solid 2px var(--my-border-color);
|
|
20
|
+
border-radius: var(--control-field-radius);
|
|
18
21
|
clip-path: polygon(
|
|
19
22
|
0 0,
|
|
20
23
|
0 100%,
|
|
@@ -29,9 +32,6 @@
|
|
|
29
32
|
88.25% 28.25%,
|
|
30
33
|
100% 0
|
|
31
34
|
);
|
|
32
|
-
background: var(--my-faux-bg-color);
|
|
33
|
-
border: solid 2px var(--my-border-color);
|
|
34
|
-
border-radius: var(--control-field-radius);
|
|
35
35
|
transition:
|
|
36
36
|
border-color 0.2s,
|
|
37
37
|
background-color 0.2s;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@use '../../styles/core
|
|
1
|
+
@use '../../styles/core';
|
|
2
2
|
|
|
3
3
|
@layer vui {
|
|
4
4
|
.v-chip {
|
|
@@ -19,16 +19,16 @@
|
|
|
19
19
|
font-size: var(--chip-font-size);
|
|
20
20
|
font-weight: var(--chip-font-weight);
|
|
21
21
|
line-height: 1;
|
|
22
|
+
vertical-align: bottom;
|
|
22
23
|
text-align: center;
|
|
23
24
|
white-space: nowrap;
|
|
24
|
-
vertical-align: bottom;
|
|
25
25
|
cursor: default;
|
|
26
26
|
border-style: solid;
|
|
27
27
|
border-width: 1px;
|
|
28
28
|
border-radius: var(--chip-radius);
|
|
29
29
|
|
|
30
|
-
--shadow-color:
|
|
31
|
-
--focusShadow-color:
|
|
30
|
+
--shadow-color: rgb(0, 0, 0, 0) !important; // @TODO layer supports
|
|
31
|
+
--focusShadow-color: rgb(0, 0, 0, 0) !important; // @TODO layer supports
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
&--clickable {
|
|
@@ -9,7 +9,6 @@ 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
|
|
13
12
|
import { RouteLocationRaw } from 'vue-router';
|
|
14
13
|
|
|
15
14
|
export const CHIP_SIZES = ['xs', 'sm', 'md', 'lg', 'xl'] as const;
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
defineSlots,
|
|
10
10
|
DefineSlotsType,
|
|
11
11
|
} from '@fastkit/vue-utils';
|
|
12
|
+
import { DISABLED_REASON_CONTAINER_BIND } from '@fastkit/vue-disabled-reason';
|
|
12
13
|
import {
|
|
13
14
|
createControlProps,
|
|
14
15
|
useControl,
|
|
@@ -62,10 +63,10 @@ export const VControlField = defineComponent({
|
|
|
62
63
|
...slots(),
|
|
63
64
|
error: Boolean,
|
|
64
65
|
},
|
|
65
|
-
slots,
|
|
66
66
|
emits: {
|
|
67
67
|
click: (ev: MouseEvent) => true,
|
|
68
68
|
},
|
|
69
|
+
slots,
|
|
69
70
|
setup(props, ctx) {
|
|
70
71
|
const parentNode = useParentFormNode();
|
|
71
72
|
const control = useControl(props);
|
|
@@ -95,7 +96,6 @@ export const VControlField = defineComponent({
|
|
|
95
96
|
},
|
|
96
97
|
control.classes.value,
|
|
97
98
|
colorProvider.className(
|
|
98
|
-
// eslint-disable-next-line no-nested-ternary
|
|
99
99
|
props.error
|
|
100
100
|
? 'error'
|
|
101
101
|
: invalid.value && !readonly.value
|
|
@@ -146,7 +146,8 @@ export const VControlField = defineComponent({
|
|
|
146
146
|
class={classes.value}
|
|
147
147
|
onClick={handleClick}
|
|
148
148
|
// tabindex={this.computedTabindex}
|
|
149
|
-
ref={hostElRef}
|
|
149
|
+
ref={hostElRef}
|
|
150
|
+
{...DISABLED_REASON_CONTAINER_BIND}>
|
|
150
151
|
{renderAdornment('start')}
|
|
151
152
|
<div class="v-control-field__body">{ctx.slots.default?.()}</div>
|
|
152
153
|
{renderAdornment('end')}
|
|
@@ -118,10 +118,10 @@
|
|
|
118
118
|
|
|
119
119
|
&__cell {
|
|
120
120
|
position: relative;
|
|
121
|
+
vertical-align: middle;
|
|
121
122
|
text-align: left;
|
|
122
123
|
white-space: nowrap;
|
|
123
|
-
|
|
124
|
-
border-bottom: thin solid rgba(0, 0, 0, 0.12);
|
|
124
|
+
border-bottom: thin solid rgb(0, 0, 0, 0.12);
|
|
125
125
|
transition: background 0.2s;
|
|
126
126
|
|
|
127
127
|
&:first-child {
|
|
@@ -180,7 +180,7 @@
|
|
|
180
180
|
|
|
181
181
|
&__header &__cell {
|
|
182
182
|
user-select: none;
|
|
183
|
-
background:
|
|
183
|
+
background: rgb(255, 255, 255, 0.85);
|
|
184
184
|
backdrop-filter: blur(3px);
|
|
185
185
|
|
|
186
186
|
// &--active[tabindex='0'] {
|
|
@@ -213,7 +213,6 @@ 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
|
|
217
216
|
const { rowSettings } = props;
|
|
218
217
|
if (!rowSettings) return () => ({});
|
|
219
218
|
return typeof rowSettings === 'function'
|
|
@@ -689,7 +688,6 @@ export const VDataTable = defineComponent({
|
|
|
689
688
|
}
|
|
690
689
|
|
|
691
690
|
if (!cellChildren) {
|
|
692
|
-
// eslint-disable-next-line default-case
|
|
693
691
|
switch (headerKey) {
|
|
694
692
|
case SELECTABLE_HEADER_SYMBOL: {
|
|
695
693
|
cellChildren = [
|
|
@@ -1,7 +1,20 @@
|
|
|
1
1
|
import './VDisabledReason.scss';
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import {
|
|
3
|
+
type PropType,
|
|
4
|
+
type ExtractPublicPropTypes,
|
|
5
|
+
type VNodeChild,
|
|
6
|
+
} from 'vue';
|
|
7
|
+
import {
|
|
8
|
+
defineDisabledReasonComponent,
|
|
9
|
+
DISABLED_REASON_BASE_PROPS,
|
|
10
|
+
} from '@fastkit/vue-disabled-reason';
|
|
4
11
|
import { createMenuProps } from '@fastkit/vue-stack';
|
|
12
|
+
import { createPropsOptions } from '@fastkit/vue-utils';
|
|
13
|
+
import {
|
|
14
|
+
registerActionableAttrsResolver,
|
|
15
|
+
registerActionableRenderWrapper,
|
|
16
|
+
type ActionableCustomProps as _ActionableCustomProps,
|
|
17
|
+
} from '@fastkit/vue-action';
|
|
5
18
|
import { VTooltip } from '../VTooltip';
|
|
6
19
|
|
|
7
20
|
const menuProps = createMenuProps();
|
|
@@ -13,10 +26,9 @@ const menuProps = createMenuProps();
|
|
|
13
26
|
*/
|
|
14
27
|
export type DisabledReasonType = 'tooltip';
|
|
15
28
|
|
|
16
|
-
export const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
...menuProps,
|
|
29
|
+
export const DISABLED_REASON_PROPS = {
|
|
30
|
+
...menuProps,
|
|
31
|
+
...createPropsOptions({
|
|
20
32
|
/**
|
|
21
33
|
* Display type
|
|
22
34
|
*
|
|
@@ -28,7 +40,17 @@ export const VDisabledReason = defineDisabledReasonComponent({
|
|
|
28
40
|
type: String as PropType<DisabledReasonType>,
|
|
29
41
|
default: 'tooltip' satisfies DisabledReasonType,
|
|
30
42
|
},
|
|
31
|
-
},
|
|
43
|
+
}),
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export interface DisabledReasonInput
|
|
47
|
+
extends ExtractPublicPropTypes<
|
|
48
|
+
typeof DISABLED_REASON_PROPS & typeof DISABLED_REASON_BASE_PROPS
|
|
49
|
+
> {}
|
|
50
|
+
|
|
51
|
+
export const VDisabledReason = defineDisabledReasonComponent({
|
|
52
|
+
name: 'VDisabledReason',
|
|
53
|
+
props: DISABLED_REASON_PROPS,
|
|
32
54
|
setup(api) {
|
|
33
55
|
return (reason) => {
|
|
34
56
|
const { type: _type, ...tooltipProps } = api.props;
|
|
@@ -52,3 +74,52 @@ export const VDisabledReason = defineDisabledReasonComponent({
|
|
|
52
74
|
};
|
|
53
75
|
},
|
|
54
76
|
});
|
|
77
|
+
|
|
78
|
+
// Customize '@fastkit/vue-action' so that when the custom attribute
|
|
79
|
+
// "disabledReason" is set, it wraps the element with `VDisabledReason`
|
|
80
|
+
// to display the reason for being disabled.
|
|
81
|
+
|
|
82
|
+
// 1. Extend the '@fastkit/vue-action' interface
|
|
83
|
+
declare module '@fastkit/vue-action' {
|
|
84
|
+
interface ActionableCustomProps {
|
|
85
|
+
/**
|
|
86
|
+
* Reason why this element is disabled.
|
|
87
|
+
*
|
|
88
|
+
* If set, hovering over the disabled element will display the reason
|
|
89
|
+
* using `VDisabledReason`.
|
|
90
|
+
*/
|
|
91
|
+
disabledReason: PropType<string | (() => VNodeChild) | DisabledReasonInput>;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// 2. Handle `disabledReason` as a custom attribute of '@fastkit/vue-action'
|
|
96
|
+
registerActionableAttrsResolver((attrs, ctx) => {
|
|
97
|
+
const disabledReason = ctx.getAttr('disabledReason');
|
|
98
|
+
if (disabledReason) {
|
|
99
|
+
// Remove disabledReason from the original attrs
|
|
100
|
+
// (to prevent adding unnecessary attributes to the element)
|
|
101
|
+
delete attrs.disabledReason;
|
|
102
|
+
return [
|
|
103
|
+
undefined,
|
|
104
|
+
{
|
|
105
|
+
disabledReason,
|
|
106
|
+
},
|
|
107
|
+
];
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
// 3. Register a custom render wrapper for '@fastkit/vue-action'
|
|
112
|
+
registerActionableRenderWrapper((customProps, currentNode) => {
|
|
113
|
+
const { disabledReason } = customProps;
|
|
114
|
+
const disabledReasonInput =
|
|
115
|
+
typeof disabledReason === 'string' || typeof disabledReason === 'function'
|
|
116
|
+
? { reason: disabledReason }
|
|
117
|
+
: disabledReason;
|
|
118
|
+
|
|
119
|
+
if (disabledReasonInput) {
|
|
120
|
+
return (
|
|
121
|
+
<VDisabledReason {...disabledReasonInput}>{currentNode}</VDisabledReason>
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
return currentNode;
|
|
125
|
+
});
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
defineComponent,
|
|
3
|
+
computed,
|
|
4
|
+
type RenderFunction,
|
|
5
|
+
getCurrentInstance,
|
|
6
|
+
} from 'vue';
|
|
2
7
|
import {
|
|
3
8
|
VueForm,
|
|
4
9
|
createFormSettings,
|
|
@@ -12,6 +17,14 @@ const { props, emits } = createFormSettings({
|
|
|
12
17
|
nodeType: VUI_FORM_SYMBOL,
|
|
13
18
|
});
|
|
14
19
|
|
|
20
|
+
/**
|
|
21
|
+
* @TODO Externalize
|
|
22
|
+
*/
|
|
23
|
+
function useRender(render: RenderFunction) {
|
|
24
|
+
const vm = getCurrentInstance() as any;
|
|
25
|
+
vm.render = render;
|
|
26
|
+
}
|
|
27
|
+
|
|
15
28
|
export type VFormSlots = DefineSlotsType<{
|
|
16
29
|
default?: (form: VueForm) => any;
|
|
17
30
|
}>;
|
|
@@ -31,7 +44,6 @@ export const VForm = defineComponent({
|
|
|
31
44
|
props: createVFormProps(),
|
|
32
45
|
emits,
|
|
33
46
|
slots: formSlots,
|
|
34
|
-
// eslint-disable-next-line no-shadow
|
|
35
47
|
setup(props, ctx) {
|
|
36
48
|
const nodeControl = useForm(props, ctx as any, {
|
|
37
49
|
nodeType: VUI_FORM_SYMBOL,
|
|
@@ -49,14 +61,14 @@ export const VForm = defineComponent({
|
|
|
49
61
|
]);
|
|
50
62
|
useControl(props);
|
|
51
63
|
|
|
52
|
-
|
|
53
|
-
control: nodeControl,
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
return () => (
|
|
64
|
+
useRender(() => (
|
|
57
65
|
<form class={classes.value} {...nodeControl.formAttrs}>
|
|
58
66
|
{ctx.slots.default?.(nodeControl)}
|
|
59
67
|
</form>
|
|
60
|
-
);
|
|
68
|
+
));
|
|
69
|
+
|
|
70
|
+
return {
|
|
71
|
+
control: nodeControl,
|
|
72
|
+
};
|
|
61
73
|
},
|
|
62
74
|
});
|
|
@@ -17,7 +17,6 @@ const { props, emits } = createFormNodeWrapperSettings();
|
|
|
17
17
|
|
|
18
18
|
export function createRequiredChipRenderer(
|
|
19
19
|
required: () => boolean,
|
|
20
|
-
// eslint-disable-next-line no-shadow
|
|
21
20
|
props: {
|
|
22
21
|
requiredChip?: RequiredChipSource;
|
|
23
22
|
},
|
|
@@ -55,9 +54,9 @@ export const VFormControl = defineComponent({
|
|
|
55
54
|
...slots(),
|
|
56
55
|
error: Boolean,
|
|
57
56
|
},
|
|
58
|
-
slots,
|
|
59
57
|
emits,
|
|
60
|
-
|
|
58
|
+
slots,
|
|
59
|
+
|
|
61
60
|
setup(props, ctx) {
|
|
62
61
|
const vui = useVui();
|
|
63
62
|
const control = useFormNodeWrapper(props, ctx, {
|
|
@@ -70,7 +69,6 @@ export const VFormControl = defineComponent({
|
|
|
70
69
|
});
|
|
71
70
|
|
|
72
71
|
const hinttipDelay = computed(() => {
|
|
73
|
-
// eslint-disable-next-line no-shadow
|
|
74
72
|
let { hinttipDelay } = control;
|
|
75
73
|
if (hinttipDelay == null) {
|
|
76
74
|
hinttipDelay = vui.setting('hinttipDelay');
|
|
@@ -103,7 +101,6 @@ export const VFormControl = defineComponent({
|
|
|
103
101
|
'v-form-control--valid': control.valid,
|
|
104
102
|
},
|
|
105
103
|
colorProvider.className(
|
|
106
|
-
// eslint-disable-next-line no-nested-ternary
|
|
107
104
|
props.error
|
|
108
105
|
? 'error'
|
|
109
106
|
: control.invalid && !control.isReadonly
|
|
@@ -146,7 +143,6 @@ export const VFormControl = defineComponent({
|
|
|
146
143
|
activator: (tooltip) => (
|
|
147
144
|
<a
|
|
148
145
|
class="v-form-control__label__hinttip"
|
|
149
|
-
// eslint-disable-next-line no-script-url
|
|
150
146
|
href="javascript:void(0)"
|
|
151
147
|
{...tooltip.attrs}>
|
|
152
148
|
{hinttip.tip}
|
|
@@ -33,7 +33,6 @@ export const VFormGroup = defineComponent({
|
|
|
33
33
|
props: createVFormGroupProps(),
|
|
34
34
|
emits,
|
|
35
35
|
slots: formGroupSlots,
|
|
36
|
-
// eslint-disable-next-line no-shadow
|
|
37
36
|
setup(props, ctx) {
|
|
38
37
|
const nodeControl = useFormGroup(props, ctx as any, {
|
|
39
38
|
nodeType: VUI_FORM_GROUP_SYMBOL,
|
|
@@ -23,11 +23,11 @@
|
|
|
23
23
|
text-decoration: none;
|
|
24
24
|
appearance: none;
|
|
25
25
|
user-select: none;
|
|
26
|
+
outline: 0;
|
|
26
27
|
background: var(--tile-background);
|
|
27
28
|
border: 0;
|
|
28
29
|
border-left: 3px solid var(--tile-pin-color);
|
|
29
30
|
border-radius: 0;
|
|
30
|
-
outline: 0;
|
|
31
31
|
transition:
|
|
32
32
|
color 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,
|
|
33
33
|
background-color 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
|
|
@@ -15,7 +15,6 @@ import { useVui } from '../../injections';
|
|
|
15
15
|
// @TODO Unable to resolve dts for `actionableInheritProps`.
|
|
16
16
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
17
17
|
// @ts-ignore
|
|
18
|
-
// eslint-disable-next-line import/order
|
|
19
18
|
import { RouteLocationRaw } from 'vue-router';
|
|
20
19
|
import { rawIconProp, resolveRawIconProp } from '../VIcon';
|
|
21
20
|
|
|
@@ -87,7 +86,6 @@ export const VListTile = defineComponent({
|
|
|
87
86
|
|
|
88
87
|
watch(
|
|
89
88
|
() => isActive.value,
|
|
90
|
-
// eslint-disable-next-line no-shadow
|
|
91
89
|
(isActive) => {
|
|
92
90
|
ctx.emit('changeActive', isActive);
|
|
93
91
|
},
|