@fastkit/vui 0.12.8 → 0.12.9
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/LICENSE +1 -1
- package/dist/vui.css +2786 -2716
- package/dist/vui.css.map +1 -0
- package/dist/vui.d.ts +9072 -10172
- package/dist/vui.mjs +2141 -1969
- package/dist/vui.mjs.map +1 -0
- package/package.json +89 -59
- package/src/components/VApp/VApp.tsx +3 -1
- package/src/components/VAvatar/VAvatar.scss +62 -60
- package/src/components/VAvatar/VAvatar.tsx +6 -1
- package/src/components/VBreadcrumbs/VBreadcrumbs.scss +53 -51
- package/src/components/VBusyImage/VBusyImage.scss +50 -51
- package/src/components/VButton/VButton.scss +120 -118
- package/src/components/VButton/VButton.tsx +6 -1
- package/src/components/VButton/VButtonGroup.scss +21 -19
- package/src/components/VCard/VCard.scss +41 -42
- package/src/components/VCard/VCard.tsx +5 -0
- package/src/components/VCard/VCardActions.scss +9 -7
- package/src/components/VCard/VCardContent.scss +4 -2
- package/src/components/VCheckable/VCheckable.scss +79 -80
- package/src/components/VCheckable/VCheckable.tsx +1 -1
- package/src/components/VCheckbox/VCheckbox.scss +50 -48
- package/src/components/VCheckbox/VCheckbox.tsx +2 -2
- package/src/components/VChip/VChip.scss +61 -59
- package/src/components/VChip/VChip.tsx +6 -1
- package/src/components/VContentSwitcher/VContentSwitcher.scss +52 -50
- package/src/components/VControlField/VControlField.scss +148 -146
- package/src/components/VControlField/VControlField.tsx +3 -3
- package/src/components/VDataTable/VDataTable.scss +167 -168
- package/src/components/VDrawerLayout/VDrawerLayout.scss +27 -25
- package/src/components/VForm/VForm.tsx +3 -4
- package/src/components/VFormControl/VFormControl.scss +84 -82
- package/src/components/VFormControl/VFormControl.tsx +2 -3
- package/src/components/VGrid/VGridContainer.scss +5 -3
- package/src/components/VGrid/VGridItem.scss +4 -2
- package/src/components/VHero/VHero.scss +23 -21
- package/src/components/VIcon/VIcon.scss +19 -17
- package/src/components/VListTile/VListTile.scss +60 -58
- package/src/components/VListTile/VListTile.tsx +5 -0
- package/src/components/VNavigation/VNavigation.scss +12 -10
- package/src/components/VNavigation/VNavigationItem.scss +21 -19
- package/src/components/VNavigation/VNavigationItem.tsx +5 -0
- package/src/components/VOption/VOption.scss +55 -56
- package/src/components/VOption/VOption.tsx +2 -2
- package/src/components/VOptionGroup/VOptionGroup.scss +14 -12
- package/src/components/VOptionGroup/VOptionGroup.tsx +3 -1
- package/src/components/VPagination/VPagination.scss +81 -79
- package/src/components/VPagination/VPagination.tsx +1 -1
- package/src/components/VPaper/VPaper.scss +43 -41
- package/src/components/VRadio/VRadio.scss +52 -53
- package/src/components/VRadio/VRadio.tsx +2 -2
- package/src/components/VSelect/VSelect.scss +77 -75
- package/src/components/VSelect/VSelect.tsx +5 -2
- package/src/components/VSkeltonLoader/VSkeltonLoaderBone.scss +24 -22
- package/src/components/VSwitch/VSwitch.scss +96 -94
- package/src/components/VSwitch/VSwitch.tsx +2 -2
- package/src/components/VTabs/VTab.scss +59 -57
- package/src/components/VTabs/VTabs.scss +41 -39
- package/src/components/VTabs/VTabs.tsx +5 -2
- package/src/components/VTextCounter/VTextCounter.scss +4 -2
- package/src/components/VTextField/VTextField.scss +37 -35
- package/src/components/VTextField/VTextField.tsx +2 -2
- package/src/components/VTextarea/VTextarea.scss +33 -31
- package/src/components/VTextarea/VTextarea.tsx +2 -2
- package/src/components/VToolbar/VToolbar.scss +19 -17
- package/src/components/VToolbar/VToolbarEdge.scss +21 -19
- package/src/components/VToolbar/VToolbarMenu.scss +6 -4
- package/src/components/VToolbar/VToolbarMenu.tsx +5 -0
- package/src/components/VToolbar/VToolbarTitle.scss +19 -17
- package/src/components/VWysiwygEditor/VWysiwygEditor.scss +52 -50
- package/src/components/VWysiwygEditor/VWysiwygEditor.tsx +2 -2
- package/src/components/VWysiwygEditor/extensions/linter/Linter.scss +108 -109
- package/src/components/VWysiwygEditor/schemes.ts +1 -1
- package/src/components/VWysiwygEditor/tools/color.scss +106 -112
- package/src/components/kits.ts +1 -1
- package/src/composables/control.ts +1 -1
- package/src/composables/form-selector.scss +20 -18
- package/src/composables/form-selector.tsx +5 -3
- package/src/index.ts +13 -2
- package/src/plugin.tsx +4 -4
- package/src/schemes/control.ts +2 -2
- package/src/service.tsx +5 -5
- package/src/styles/core/functions.scss +2 -2
- package/src/styles/index.scss +23 -9
- package/dist/tool/index.d.ts +0 -2
- package/dist/tool/index.d.ts.map +0 -1
- package/dist/tool/index.mjs +0 -193
- package/dist/tool/vite-plugin.d.ts +0 -25
- package/dist/tool/vite-plugin.d.ts.map +0 -1
- package/src/.DS_Store +0 -0
- package/src/assets/builtins/color-scheme.ts +0 -9
- package/src/assets/builtins/media-match.ts +0 -3
- package/src/components/.DS_Store +0 -0
- package/src/components/VAvatar/.DS_Store +0 -0
- package/src/components/VChip/.DS_Store +0 -0
- package/src/components/VSkeltonLoader/.DS_Store +0 -0
- package/src/components/VTextField/.DS_Store +0 -0
- package/src/components/VWysiwygEditor/.DS_Store +0 -0
- package/src/components/VWysiwygEditor/extensions/.DS_Store +0 -0
- package/src/components/VWysiwygEditor/extensions/linter/.DS_Store +0 -0
- package/src/tool/index.ts +0 -2
- package/src/tool/vite-plugin.ts +0 -266
- /package/{src/styles → dist}/after-effects/display-flow.scss +0 -0
- /package/{src/styles → dist}/after-effects/spacing.scss +0 -0
- /package/{src/styles → dist}/after-effects/text.scss +0 -0
- /package/{src/styles → dist}/after-effects.scss +0 -0
- /package/dist/{assets/builtins → builtins}/color-scheme.ts +0 -0
- /package/dist/{assets/builtins → builtins}/media-match.ts +0 -0
|
@@ -2,139 +2,133 @@
|
|
|
2
2
|
--v-wysiwyg-color-tool: 30px;
|
|
3
3
|
}
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
display: inline-flex;
|
|
9
|
-
align-items: center;
|
|
10
|
-
justify-content: center;
|
|
11
|
-
vertical-align: bottom;
|
|
12
|
-
|
|
13
|
-
&__bar {
|
|
14
|
-
position: absolute;
|
|
15
|
-
right: 0;
|
|
16
|
-
bottom: 0;
|
|
17
|
-
left: 0;
|
|
18
|
-
display: block;
|
|
19
|
-
height: 2px;
|
|
20
|
-
background: currentColor;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
&__menu {
|
|
25
|
-
.v-dialog__content {
|
|
26
|
-
min-width: 0;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.v-dialog__body {
|
|
30
|
-
padding: 2px;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
&__items {
|
|
35
|
-
--item-size: var(--v-wysiwyg-color-tool);
|
|
36
|
-
|
|
37
|
-
display: inline-flex;
|
|
38
|
-
flex-wrap: wrap;
|
|
39
|
-
align-items: center;
|
|
40
|
-
max-width: calc(var(--item-size) * 5);
|
|
41
|
-
vertical-align: bottom;
|
|
42
|
-
|
|
43
|
-
&--with-label {
|
|
44
|
-
display: flex;
|
|
45
|
-
flex-direction: column;
|
|
46
|
-
// flex-wrap: nowrap;
|
|
47
|
-
align-items: flex-start;
|
|
48
|
-
max-width: none;
|
|
49
|
-
padding: 2px;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
&__item {
|
|
54
|
-
--focus-offset: calc(var(--item-size) * 0.05);
|
|
55
|
-
|
|
56
|
-
position: relative;
|
|
57
|
-
display: flex;
|
|
58
|
-
flex-basis: var(--item-size);
|
|
59
|
-
align-items: center;
|
|
60
|
-
width: var(--item-size);
|
|
61
|
-
height: var(--item-size);
|
|
62
|
-
padding: 0;
|
|
63
|
-
margin: 0;
|
|
64
|
-
// margin: 2px;
|
|
65
|
-
cursor: pointer;
|
|
66
|
-
background: transparent;
|
|
67
|
-
border: 0;
|
|
68
|
-
border-radius: 0;
|
|
69
|
-
outline: 0;
|
|
70
|
-
appearance: none;
|
|
71
|
-
|
|
72
|
-
&__color {
|
|
5
|
+
@layer vui {
|
|
6
|
+
.v-wysiwyg-color-tool {
|
|
7
|
+
&__button {
|
|
73
8
|
position: relative;
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
9
|
+
display: inline-flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
justify-content: center;
|
|
12
|
+
vertical-align: bottom;
|
|
77
13
|
|
|
78
|
-
|
|
14
|
+
&__bar {
|
|
79
15
|
position: absolute;
|
|
80
|
-
top: 0;
|
|
81
16
|
right: 0;
|
|
82
17
|
bottom: 0;
|
|
83
18
|
left: 0;
|
|
84
19
|
display: block;
|
|
85
|
-
|
|
20
|
+
height: 2px;
|
|
86
21
|
background: currentColor;
|
|
87
|
-
border: solid 1px transparent;
|
|
88
|
-
transition: all 0.15s;
|
|
89
22
|
}
|
|
90
23
|
}
|
|
91
24
|
|
|
92
|
-
&
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
25
|
+
&__menu {
|
|
26
|
+
.v-dialog__content {
|
|
27
|
+
min-width: 0;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.v-dialog__body {
|
|
31
|
+
padding: 2px;
|
|
32
|
+
}
|
|
97
33
|
}
|
|
98
34
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
35
|
+
&__items {
|
|
36
|
+
--item-size: var(--v-wysiwyg-color-tool);
|
|
37
|
+
|
|
38
|
+
display: inline-flex;
|
|
39
|
+
flex-wrap: wrap;
|
|
40
|
+
align-items: center;
|
|
41
|
+
max-width: calc(var(--item-size) * 5);
|
|
42
|
+
vertical-align: bottom;
|
|
43
|
+
|
|
44
|
+
&--with-label {
|
|
45
|
+
display: flex;
|
|
46
|
+
flex-direction: column;
|
|
47
|
+
// flex-wrap: nowrap;
|
|
48
|
+
align-items: flex-start;
|
|
49
|
+
max-width: none;
|
|
50
|
+
padding: 2px;
|
|
107
51
|
}
|
|
108
52
|
}
|
|
109
|
-
}
|
|
110
53
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
background:
|
|
125
|
-
|
|
126
|
-
|
|
54
|
+
&__item {
|
|
55
|
+
--focus-offset: calc(var(--item-size) * 0.05);
|
|
56
|
+
|
|
57
|
+
position: relative;
|
|
58
|
+
display: flex;
|
|
59
|
+
flex-basis: var(--item-size);
|
|
60
|
+
align-items: center;
|
|
61
|
+
width: var(--item-size);
|
|
62
|
+
height: var(--item-size);
|
|
63
|
+
padding: 0;
|
|
64
|
+
margin: 0;
|
|
65
|
+
// margin: 2px;
|
|
66
|
+
cursor: pointer;
|
|
67
|
+
background: transparent;
|
|
68
|
+
border: 0;
|
|
69
|
+
border-radius: 0;
|
|
70
|
+
outline: 0;
|
|
71
|
+
appearance: none;
|
|
72
|
+
|
|
73
|
+
&__color {
|
|
74
|
+
position: relative;
|
|
75
|
+
flex: 0 0 var(--item-size);
|
|
76
|
+
width: var(--item-size);
|
|
77
|
+
height: var(--item-size);
|
|
78
|
+
|
|
79
|
+
&::before {
|
|
80
|
+
position: absolute;
|
|
81
|
+
inset: 0;
|
|
82
|
+
display: block;
|
|
83
|
+
content: '';
|
|
84
|
+
background: currentColor;
|
|
85
|
+
border: solid 1px transparent;
|
|
86
|
+
transition: all 0.15s;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
&__name {
|
|
91
|
+
position: relative;
|
|
92
|
+
padding: 0 8px;
|
|
93
|
+
font-size: 12px;
|
|
94
|
+
white-space: nowrap;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
&:hover &__color,
|
|
98
|
+
&:focus &__color {
|
|
99
|
+
&::before {
|
|
100
|
+
inset: var(--focus-offset) var(--focus-offset) var(--focus-offset)
|
|
101
|
+
var(--focus-offset);
|
|
102
|
+
border-color: rgba(0, 0, 0, 0.1);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
127
105
|
}
|
|
128
106
|
|
|
129
|
-
|
|
130
|
-
|
|
107
|
+
&__items--with-label &__item {
|
|
108
|
+
flex-basis: auto;
|
|
109
|
+
width: auto;
|
|
110
|
+
width: 100%;
|
|
111
|
+
|
|
131
112
|
&::before {
|
|
132
|
-
|
|
113
|
+
position: absolute;
|
|
114
|
+
inset: 0;
|
|
115
|
+
display: block;
|
|
116
|
+
content: '';
|
|
117
|
+
background: currentColor;
|
|
118
|
+
opacity: 0;
|
|
119
|
+
transition: opacity 0.15s;
|
|
133
120
|
}
|
|
134
|
-
}
|
|
135
121
|
|
|
136
|
-
|
|
137
|
-
|
|
122
|
+
&:hover,
|
|
123
|
+
&:focus {
|
|
124
|
+
&::before {
|
|
125
|
+
opacity: 0.1;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
& + .v-wysiwyg-color-tool__item {
|
|
130
|
+
margin-top: 2px;
|
|
131
|
+
}
|
|
138
132
|
}
|
|
139
133
|
}
|
|
140
134
|
}
|
package/src/components/kits.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { VDialog, VMenu, VSnackbar, VTooltip } from '@fastkit/vue-
|
|
1
|
+
export { VDialog, VMenu, VSnackbar, VTooltip } from '@fastkit/vue-stack';
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
ControlFieldVariant,
|
|
13
13
|
CONTROL_FIELD_VARIANTS,
|
|
14
14
|
} from '../schemes';
|
|
15
|
-
import { createPropsOptions } from '@fastkit/vue-
|
|
15
|
+
import { createPropsOptions } from '@fastkit/vue-utils';
|
|
16
16
|
import {
|
|
17
17
|
VuiControlInjectionKey,
|
|
18
18
|
VuiControlFieldInjectionKey,
|
|
@@ -1,24 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
@layer vui {
|
|
2
|
+
.v-form-selector {
|
|
3
|
+
&__body {
|
|
4
|
+
display: block;
|
|
5
|
+
}
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
&__placeholder {
|
|
8
|
+
display: flex;
|
|
9
|
+
align-items: center;
|
|
10
|
+
margin-top: 8px;
|
|
11
|
+
font-style: italic;
|
|
12
|
+
opacity: 0.5;
|
|
12
13
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
&--error {
|
|
15
|
+
color: var(--main-color);
|
|
16
|
+
opacity: 1;
|
|
17
|
+
}
|
|
16
18
|
}
|
|
17
|
-
}
|
|
18
19
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
&--stacked &__body {
|
|
21
|
+
display: flex;
|
|
22
|
+
flex-direction: column;
|
|
23
|
+
align-items: flex-start;
|
|
24
|
+
}
|
|
23
25
|
}
|
|
24
26
|
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import './form-selector.scss';
|
|
2
2
|
import { VNodeChild, defineComponent, PropType, computed } from 'vue';
|
|
3
3
|
import {
|
|
4
|
-
defineSlotsProps,
|
|
5
|
-
TypedSlot,
|
|
6
4
|
createFormControlProps,
|
|
7
5
|
createFormSelectorSettings,
|
|
8
6
|
FormControlSlots,
|
|
@@ -10,10 +8,14 @@ import {
|
|
|
10
8
|
FormSelectorControl,
|
|
11
9
|
ResolvedFormSelectorItem,
|
|
12
10
|
FormNodeControl,
|
|
11
|
+
} from '@fastkit/vue-form-control';
|
|
12
|
+
import {
|
|
13
|
+
defineSlotsProps,
|
|
14
|
+
TypedSlot,
|
|
13
15
|
renderSlotOrEmpty,
|
|
14
16
|
VNodeChildOrSlot,
|
|
15
17
|
resolveVNodeChildOrSlots,
|
|
16
|
-
} from '@fastkit/vue-
|
|
18
|
+
} from '@fastkit/vue-utils';
|
|
17
19
|
import { createControlProps, useControl } from './control';
|
|
18
20
|
import { VFormControl } from '../components/VFormControl';
|
|
19
21
|
import { useVui } from '../injections';
|
package/src/index.ts
CHANGED
|
@@ -1,7 +1,18 @@
|
|
|
1
|
-
export * from '@fastkit/vue-kit';
|
|
2
|
-
|
|
3
1
|
import './styles/index.scss';
|
|
4
2
|
|
|
3
|
+
export * from '@fastkit/helpers';
|
|
4
|
+
export * from '@fastkit/icon-font';
|
|
5
|
+
export * from '@fastkit/media-match';
|
|
6
|
+
export * from '@fastkit/vue-media-match';
|
|
7
|
+
export * from '@fastkit/rules';
|
|
8
|
+
export * from '@fastkit/vue-app-layout';
|
|
9
|
+
export * from '@fastkit/vue-color-scheme';
|
|
10
|
+
export * from '@fastkit/vue-form-control';
|
|
11
|
+
export * from '@fastkit/vue-scroller';
|
|
12
|
+
export * from '@fastkit/vue-stack';
|
|
13
|
+
export * from '@fastkit/vue-utils';
|
|
14
|
+
export * from '@fastkit/vue-loading';
|
|
15
|
+
|
|
5
16
|
export * from './schemes';
|
|
6
17
|
export * from './composables';
|
|
7
18
|
export * from './components';
|
package/src/plugin.tsx
CHANGED
|
@@ -7,12 +7,12 @@ import {
|
|
|
7
7
|
VuiInjectionKey,
|
|
8
8
|
} from './service';
|
|
9
9
|
import {
|
|
10
|
-
installVueAppLayout,
|
|
11
10
|
installVueStackPlugin,
|
|
12
11
|
VueStackServiceOptions,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
} from '@fastkit/vue-
|
|
12
|
+
} from '@fastkit/vue-stack';
|
|
13
|
+
import { VueColorSchemePlugin } from '@fastkit/vue-color-scheme';
|
|
14
|
+
import { installVueAppLayout } from '@fastkit/vue-app-layout';
|
|
15
|
+
import { onAppUnmount } from '@fastkit/vue-utils';
|
|
16
16
|
import { VButton } from './components/VButton';
|
|
17
17
|
|
|
18
18
|
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
package/src/schemes/control.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export const CONTROL_SIZES = ['sm', 'md', 'lg'] as const;
|
|
2
2
|
|
|
3
|
-
export type ControlSize = typeof CONTROL_SIZES[number];
|
|
3
|
+
export type ControlSize = (typeof CONTROL_SIZES)[number];
|
|
4
4
|
|
|
5
5
|
export const CONTROL_FIELD_VARIANTS = ['outlined', 'filled', 'flat'] as const;
|
|
6
6
|
|
|
7
|
-
export type ControlFieldVariant = typeof CONTROL_FIELD_VARIANTS[number];
|
|
7
|
+
export type ControlFieldVariant = (typeof CONTROL_FIELD_VARIANTS)[number];
|
|
8
8
|
|
|
9
9
|
export const CONTROL_LOADING_SPINNER_SIZES: Record<ControlSize, number> = {
|
|
10
10
|
sm: 16,
|
package/src/service.tsx
CHANGED
|
@@ -4,20 +4,20 @@ import { VNodeChild, reactive, UnwrapNestedRefs } from 'vue';
|
|
|
4
4
|
import { ScopeName, ColorVariant } from '@fastkit/color-scheme';
|
|
5
5
|
import type { IconName, RawIconProp } from './components/VIcon';
|
|
6
6
|
import {
|
|
7
|
-
type VueColorSchemePluginSettings,
|
|
8
7
|
type VueStackService,
|
|
9
8
|
type VDialogProps,
|
|
10
9
|
type VStackControl,
|
|
11
|
-
type VNodeChildOrSlot,
|
|
12
10
|
resolveVStackDynamicInput,
|
|
13
|
-
} from '@fastkit/vue-
|
|
11
|
+
} from '@fastkit/vue-stack';
|
|
12
|
+
import { type VNodeChildOrSlot } from '@fastkit/vue-utils';
|
|
13
|
+
import { type VueColorSchemePluginSettings } from '@fastkit/vue-color-scheme';
|
|
14
14
|
import type { Router } from 'vue-router';
|
|
15
15
|
import { RouterLink, useLink, UseLinkOptions } from 'vue-router';
|
|
16
16
|
import { LocationService, setDefaultRouterLink } from '@fastkit/vue-utils';
|
|
17
17
|
import { VForm } from './components/VForm';
|
|
18
18
|
import { VTextField, TextFieldInput } from './components/VTextField';
|
|
19
19
|
import { VueForm, FormControlHinttipDelay } from '@fastkit/vue-form-control';
|
|
20
|
-
import { getDocumentScroller } from '@fastkit/vue-scroller';
|
|
20
|
+
import { getDocumentScroller, UseScroller } from '@fastkit/vue-scroller';
|
|
21
21
|
import { ControlSize } from './schemes';
|
|
22
22
|
|
|
23
23
|
export type UseLinkResult = ReturnType<typeof useLink>;
|
|
@@ -188,7 +188,7 @@ export class VuiService {
|
|
|
188
188
|
readonly stack: VueStackService;
|
|
189
189
|
readonly useLink: typeof useLink;
|
|
190
190
|
|
|
191
|
-
get scroller() {
|
|
191
|
+
get scroller(): UseScroller {
|
|
192
192
|
return getDocumentScroller();
|
|
193
193
|
}
|
|
194
194
|
|
package/src/styles/index.scss
CHANGED
|
@@ -1,9 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
@
|
|
4
|
-
|
|
5
|
-
@
|
|
6
|
-
@
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
@use 'sass:meta';
|
|
2
|
+
|
|
3
|
+
@layer vui-normalize, vui-color-scheme, vui;
|
|
4
|
+
|
|
5
|
+
@layer vui-normalize {
|
|
6
|
+
@include meta.load-css('@fastkit/stylebase/normalize.css');
|
|
7
|
+
|
|
8
|
+
button {
|
|
9
|
+
background-color: transparent;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@layer vui {
|
|
14
|
+
// @include meta.load-css('@fastkit/stylebase/normalize.css');
|
|
15
|
+
|
|
16
|
+
@include meta.load-css('./variables.scss');
|
|
17
|
+
@include meta.load-css('./base.scss');
|
|
18
|
+
@include meta.load-css('./typo.scss');
|
|
19
|
+
@include meta.load-css('./elevation.scss');
|
|
20
|
+
@include meta.load-css('./group.scss');
|
|
21
|
+
@include meta.load-css('./control.scss');
|
|
22
|
+
@include meta.load-css('./wysiwyg.scss');
|
|
23
|
+
}
|
package/dist/tool/index.d.ts
DELETED
package/dist/tool/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../packages/vui/src/tool/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
|
package/dist/tool/index.mjs
DELETED
|
@@ -1,193 +0,0 @@
|
|
|
1
|
-
import { dynamicSrcVitePlugin } from '@fastkit/vite-kit';
|
|
2
|
-
import path from 'node:path';
|
|
3
|
-
import fs from 'fs-extra';
|
|
4
|
-
import { getDirname, findPackageDirSync } from '@fastkit/node-util';
|
|
5
|
-
import { render } from 'eta';
|
|
6
|
-
import { TinyLogger, createTinyError } from '@fastkit/tiny-logger';
|
|
7
|
-
|
|
8
|
-
const name = 'vui';
|
|
9
|
-
new TinyLogger(name);
|
|
10
|
-
const VuiError = createTinyError(name);
|
|
11
|
-
|
|
12
|
-
const VUI_PACKAGE_DIR = path.resolve(getDirname(import.meta.url), '../..');
|
|
13
|
-
const STYLE_AFTER_EFFECTS_PATH = path.join(VUI_PACKAGE_DIR, 'src/styles/after-effects.scss');
|
|
14
|
-
const COLOR_DUMP_STYLE = `@include dump-color-scheme(true);`;
|
|
15
|
-
const TEMPLATE = `
|
|
16
|
-
/* eslint-disable */
|
|
17
|
-
// @ts-nocheck
|
|
18
|
-
<% if (!it.__dev) { %>
|
|
19
|
-
import '@fastkit/vue-stack/vue-stack.css';
|
|
20
|
-
import '@fastkit/vue-app-layout/vue-app-layout.css';
|
|
21
|
-
import '@fastkit/vue-loading/vue-loading.css';
|
|
22
|
-
import '@fastkit/vue-scroller/vue-scroller.css';
|
|
23
|
-
import '@fastkit/vui/vui.css';
|
|
24
|
-
<% } %>
|
|
25
|
-
import './setup.scss';
|
|
26
|
-
import type { App } from 'vue';
|
|
27
|
-
import type { Router } from 'vue-router';
|
|
28
|
-
import { VPageLink } from '@fastkit/vue-page';
|
|
29
|
-
import { installVuiPlugin as _installVuiPlugin, RawVuiPluginOptions, mergeVuiPluginOptions } from '@fastkit/vui';
|
|
30
|
-
import { colorScheme } from '<%~ it.colorScheme %>';
|
|
31
|
-
import '<%~ it.mediaMatch %>';
|
|
32
|
-
import './icon-font';
|
|
33
|
-
import '${STYLE_AFTER_EFFECTS_PATH}';
|
|
34
|
-
|
|
35
|
-
export function installVui(settings: { app: App, router: Router }, options?: RawVuiPluginOptions) {
|
|
36
|
-
const merged = mergeVuiPluginOptions({
|
|
37
|
-
RouterLink: VPageLink,
|
|
38
|
-
colorScheme,
|
|
39
|
-
uiSettings: <%~ it.uiSettings %>,
|
|
40
|
-
icons: <%~ it.icons %>,
|
|
41
|
-
...settings,
|
|
42
|
-
}, options);
|
|
43
|
-
_installVuiPlugin(settings.app, merged);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export default installVui;
|
|
47
|
-
`.trim();
|
|
48
|
-
async function renderTemplate({ colorScheme, mediaMatch, uiSettings, icons, __dev, }) {
|
|
49
|
-
const result = await render(TEMPLATE, {
|
|
50
|
-
colorScheme,
|
|
51
|
-
mediaMatch,
|
|
52
|
-
uiSettings: JSON.stringify(uiSettings),
|
|
53
|
-
icons: JSON.stringify(icons),
|
|
54
|
-
__dev,
|
|
55
|
-
}, { async: true });
|
|
56
|
-
if (!result) {
|
|
57
|
-
throw new VuiError('template render error.');
|
|
58
|
-
}
|
|
59
|
-
return result;
|
|
60
|
-
}
|
|
61
|
-
function defaultDynamicDest() {
|
|
62
|
-
return path.resolve('.vui');
|
|
63
|
-
}
|
|
64
|
-
function getBuiltinsDir() {
|
|
65
|
-
const pkgDir = findPackageDirSync(undefined, true);
|
|
66
|
-
if (!pkgDir) {
|
|
67
|
-
throw new Error(`missing package directory`);
|
|
68
|
-
}
|
|
69
|
-
return path.join(pkgDir, 'node_modules/@fastkit/vui/dist/assets/builtins');
|
|
70
|
-
}
|
|
71
|
-
function viteVuiPlugin(options = {}) {
|
|
72
|
-
const plugins = [];
|
|
73
|
-
const builtinsDir = getBuiltinsDir();
|
|
74
|
-
const { colorScheme = path.join(builtinsDir, 'color-scheme'), mediaMatch = path.join(builtinsDir, 'media-match'), iconFont, iconFontDefaults, onBooted, onBootError, uiSettings = {
|
|
75
|
-
primaryScope: 'primary',
|
|
76
|
-
plainVariant: 'plain',
|
|
77
|
-
containedVariant: 'contained',
|
|
78
|
-
warningScope: 'warning',
|
|
79
|
-
errorScope: 'error',
|
|
80
|
-
buttonDefault: {
|
|
81
|
-
color: 'base',
|
|
82
|
-
variant: 'contained',
|
|
83
|
-
},
|
|
84
|
-
tabDefault: {
|
|
85
|
-
color: 'accent',
|
|
86
|
-
},
|
|
87
|
-
dialogOk: {
|
|
88
|
-
color: 'primary',
|
|
89
|
-
},
|
|
90
|
-
}, icons = {
|
|
91
|
-
menuDown: 'mdi-menu-down',
|
|
92
|
-
navigationExpand: 'mdi-menu-down',
|
|
93
|
-
prev: 'mdi-chevron-left',
|
|
94
|
-
next: 'mdi-chevron-right',
|
|
95
|
-
sort: 'mdi-chevron-down',
|
|
96
|
-
editorTextColor: 'mdi-format-color-text',
|
|
97
|
-
editorformatBold: 'mdi-format-bold',
|
|
98
|
-
editorformatUnderline: 'mdi-format-underline',
|
|
99
|
-
editorformatItalic: 'mdi-format-italic',
|
|
100
|
-
editorformatListBulleted: 'mdi-format-list-bulleted',
|
|
101
|
-
editorformatListNumbered: 'mdi-format-list-numbered',
|
|
102
|
-
editorLink: 'mdi-link',
|
|
103
|
-
editorLinkOff: 'mdi-link-off',
|
|
104
|
-
editorUndo: 'mdi-undo-variant',
|
|
105
|
-
editorRedo: 'mdi-redo-variant',
|
|
106
|
-
hinttip: 'mdi-help-circle-outline',
|
|
107
|
-
clear: 'mdi-close',
|
|
108
|
-
reload: 'mdi-reload',
|
|
109
|
-
// navigationExpand: (gen, active) => {
|
|
110
|
-
// return gen({
|
|
111
|
-
// name: 'mdi-menu-down' as any,
|
|
112
|
-
// rotate: active ? 180 : 0,
|
|
113
|
-
// });
|
|
114
|
-
// },
|
|
115
|
-
...options.icons,
|
|
116
|
-
}, __dev, } = options;
|
|
117
|
-
let dynamicDest;
|
|
118
|
-
const { dynamicDest: _dynamicDest } = options;
|
|
119
|
-
if (!_dynamicDest) {
|
|
120
|
-
dynamicDest = defaultDynamicDest();
|
|
121
|
-
}
|
|
122
|
-
else {
|
|
123
|
-
dynamicDest = _dynamicDest;
|
|
124
|
-
}
|
|
125
|
-
const colorSchemeSrc = path.resolve(colorScheme);
|
|
126
|
-
const colorSchemeDest = path.join(dynamicDest, 'color-scheme');
|
|
127
|
-
const mediaMatchDest = path.join(dynamicDest, 'media-match');
|
|
128
|
-
const dts = `
|
|
129
|
-
/// <reference path="./color-scheme/color-scheme.info.ts" />
|
|
130
|
-
/// <reference path="./icon-font/index.ts" />
|
|
131
|
-
/// <reference path="./media-match/media-match.ts" />
|
|
132
|
-
export {};
|
|
133
|
-
`.trim();
|
|
134
|
-
fs.ensureDirSync(dynamicDest);
|
|
135
|
-
fs.writeFileSync(path.join(dynamicDest, 'setup.scss'), COLOR_DUMP_STYLE);
|
|
136
|
-
fs.writeFileSync(path.join(dynamicDest, 'vui.d.ts'), dts);
|
|
137
|
-
let iconFontEntries = iconFont || [
|
|
138
|
-
{
|
|
139
|
-
src: '@mdi',
|
|
140
|
-
},
|
|
141
|
-
];
|
|
142
|
-
if (iconFontDefaults) {
|
|
143
|
-
iconFontEntries = iconFontEntries.map((entry) => {
|
|
144
|
-
return {
|
|
145
|
-
...iconFontDefaults,
|
|
146
|
-
...entry,
|
|
147
|
-
};
|
|
148
|
-
});
|
|
149
|
-
}
|
|
150
|
-
plugins.push(dynamicSrcVitePlugin({
|
|
151
|
-
colorScheme: {
|
|
152
|
-
src: colorSchemeSrc,
|
|
153
|
-
dest: colorSchemeDest,
|
|
154
|
-
},
|
|
155
|
-
mediaMatch: {
|
|
156
|
-
src: path.resolve(mediaMatch),
|
|
157
|
-
dest: mediaMatchDest,
|
|
158
|
-
},
|
|
159
|
-
iconFont: {
|
|
160
|
-
entries: iconFontEntries,
|
|
161
|
-
dest: path.join(dynamicDest, 'icon-font'),
|
|
162
|
-
},
|
|
163
|
-
onBooted,
|
|
164
|
-
onBootError,
|
|
165
|
-
}));
|
|
166
|
-
const plugin = {
|
|
167
|
-
name: 'vite:vui',
|
|
168
|
-
enforce: 'pre',
|
|
169
|
-
async config(config) {
|
|
170
|
-
await fs.writeFile(path.join(dynamicDest, 'installer.ts'), await renderTemplate(settings));
|
|
171
|
-
const ssr = config.ssr || {};
|
|
172
|
-
ssr.noExternal = ssr.noExternal || [];
|
|
173
|
-
ssr.noExternal.push(/\/vui\/dist\/assets\//);
|
|
174
|
-
config.ssr = ssr;
|
|
175
|
-
return config;
|
|
176
|
-
},
|
|
177
|
-
};
|
|
178
|
-
plugins.push(plugin);
|
|
179
|
-
const settings = {
|
|
180
|
-
colorScheme: path.join(colorSchemeDest, 'color-scheme.info'),
|
|
181
|
-
mediaMatch: path.join(mediaMatchDest, 'media-match'),
|
|
182
|
-
uiSettings,
|
|
183
|
-
icons,
|
|
184
|
-
__dev,
|
|
185
|
-
};
|
|
186
|
-
return {
|
|
187
|
-
plugins,
|
|
188
|
-
dest: dynamicDest,
|
|
189
|
-
settings,
|
|
190
|
-
};
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
export { viteVuiPlugin };
|