@fastkit/vui 0.12.8 → 0.12.10

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.
Files changed (130) hide show
  1. package/LICENSE +1 -1
  2. package/dist/vui.css +2522 -2723
  3. package/dist/vui.css.map +1 -0
  4. package/dist/vui.d.ts +8760 -10172
  5. package/dist/vui.mjs +1704 -2490
  6. package/dist/vui.mjs.map +1 -0
  7. package/package.json +69 -61
  8. package/src/components/VApp/VApp.tsx +3 -1
  9. package/src/components/VAvatar/VAvatar.scss +62 -60
  10. package/src/components/VAvatar/VAvatar.tsx +6 -1
  11. package/src/components/VBreadcrumbs/VBreadcrumbs.scss +53 -51
  12. package/src/components/VBusyImage/VBusyImage.scss +50 -51
  13. package/src/components/VButton/VButton.scss +120 -118
  14. package/src/components/VButton/VButton.tsx +6 -1
  15. package/src/components/VButton/VButtonGroup.scss +21 -19
  16. package/src/components/VCard/VCard.scss +41 -42
  17. package/src/components/VCard/VCard.tsx +5 -0
  18. package/src/components/VCard/VCardActions.scss +9 -7
  19. package/src/components/VCard/VCardContent.scss +4 -2
  20. package/src/components/VCheckable/VCheckable.scss +79 -80
  21. package/src/components/VCheckable/VCheckable.tsx +1 -1
  22. package/src/components/VCheckbox/VCheckbox.scss +50 -48
  23. package/src/components/VCheckbox/VCheckbox.tsx +2 -2
  24. package/src/components/VChip/VChip.scss +61 -59
  25. package/src/components/VChip/VChip.tsx +6 -1
  26. package/src/components/VContentSwitcher/VContentSwitcher.scss +52 -50
  27. package/src/components/VControlField/VControlField.scss +148 -146
  28. package/src/components/VControlField/VControlField.tsx +3 -3
  29. package/src/components/VDataTable/VDataTable.scss +167 -168
  30. package/src/components/VDrawerLayout/VDrawerLayout.scss +27 -25
  31. package/src/components/VForm/VForm.tsx +3 -4
  32. package/src/components/VFormControl/VFormControl.scss +84 -82
  33. package/src/components/VFormControl/VFormControl.tsx +2 -3
  34. package/src/components/VGrid/VGridContainer.scss +5 -3
  35. package/src/components/VGrid/VGridItem.scss +4 -2
  36. package/src/components/VHero/VHero.scss +23 -21
  37. package/src/components/VIcon/VIcon.scss +19 -17
  38. package/src/components/VListTile/VListTile.scss +60 -58
  39. package/src/components/VListTile/VListTile.tsx +5 -0
  40. package/src/components/VNavigation/VNavigation.scss +12 -10
  41. package/src/components/VNavigation/VNavigationItem.scss +21 -19
  42. package/src/components/VNavigation/VNavigationItem.tsx +5 -0
  43. package/src/components/VOption/VOption.scss +55 -56
  44. package/src/components/VOption/VOption.tsx +2 -2
  45. package/src/components/VOptionGroup/VOptionGroup.scss +14 -12
  46. package/src/components/VOptionGroup/VOptionGroup.tsx +3 -1
  47. package/src/components/VPagination/VPagination.scss +81 -79
  48. package/src/components/VPagination/VPagination.tsx +1 -1
  49. package/src/components/VPaper/VPaper.scss +43 -41
  50. package/src/components/VRadio/VRadio.scss +52 -53
  51. package/src/components/VRadio/VRadio.tsx +2 -2
  52. package/src/components/VSelect/VSelect.scss +77 -75
  53. package/src/components/VSelect/VSelect.tsx +5 -2
  54. package/src/components/VSkeltonLoader/VSkeltonLoaderBone.scss +24 -22
  55. package/src/components/VSwitch/VSwitch.scss +96 -94
  56. package/src/components/VSwitch/VSwitch.tsx +2 -2
  57. package/src/components/VTabs/VTab.scss +59 -57
  58. package/src/components/VTabs/VTabs.scss +41 -39
  59. package/src/components/VTabs/VTabs.tsx +5 -2
  60. package/src/components/VTextCounter/VTextCounter.scss +4 -2
  61. package/src/components/VTextField/VTextField.scss +37 -35
  62. package/src/components/VTextField/VTextField.tsx +2 -2
  63. package/src/components/VTextarea/VTextarea.scss +33 -31
  64. package/src/components/VTextarea/VTextarea.tsx +2 -2
  65. package/src/components/VToolbar/VToolbar.scss +19 -17
  66. package/src/components/VToolbar/VToolbarEdge.scss +21 -19
  67. package/src/components/VToolbar/VToolbarMenu.scss +6 -4
  68. package/src/components/VToolbar/VToolbarMenu.tsx +5 -0
  69. package/src/components/VToolbar/VToolbarTitle.scss +19 -17
  70. package/src/components/index.ts +3 -1
  71. package/src/components/kits.ts +1 -1
  72. package/src/composables/control.ts +1 -1
  73. package/src/composables/form-selector.scss +20 -18
  74. package/src/composables/form-selector.tsx +5 -3
  75. package/src/index.ts +13 -2
  76. package/src/injections.ts +1 -1
  77. package/src/plugin.tsx +4 -4
  78. package/src/schemes/control.ts +2 -2
  79. package/src/service.tsx +5 -5
  80. package/src/styles/core/functions.scss +2 -2
  81. package/src/styles/index.scss +23 -9
  82. package/dist/tool/index.d.ts +0 -2
  83. package/dist/tool/index.d.ts.map +0 -1
  84. package/dist/tool/index.mjs +0 -193
  85. package/dist/tool/vite-plugin.d.ts +0 -25
  86. package/dist/tool/vite-plugin.d.ts.map +0 -1
  87. package/src/.DS_Store +0 -0
  88. package/src/assets/builtins/color-scheme.ts +0 -9
  89. package/src/assets/builtins/media-match.ts +0 -3
  90. package/src/components/.DS_Store +0 -0
  91. package/src/components/VAvatar/.DS_Store +0 -0
  92. package/src/components/VChip/.DS_Store +0 -0
  93. package/src/components/VSkeltonLoader/.DS_Store +0 -0
  94. package/src/components/VTextField/.DS_Store +0 -0
  95. package/src/components/VWysiwygEditor/.DS_Store +0 -0
  96. package/src/components/VWysiwygEditor/VWysiwygEditor.scss +0 -66
  97. package/src/components/VWysiwygEditor/VWysiwygEditor.tsx +0 -354
  98. package/src/components/VWysiwygEditor/extensions/.DS_Store +0 -0
  99. package/src/components/VWysiwygEditor/extensions/color.ts +0 -72
  100. package/src/components/VWysiwygEditor/extensions/index.ts +0 -2
  101. package/src/components/VWysiwygEditor/extensions/linter/.DS_Store +0 -0
  102. package/src/components/VWysiwygEditor/extensions/linter/Linter.scss +0 -140
  103. package/src/components/VWysiwygEditor/extensions/linter/Linter.tsx +0 -210
  104. package/src/components/VWysiwygEditor/extensions/linter/LinterPlugin.ts +0 -65
  105. package/src/components/VWysiwygEditor/extensions/linter/index.ts +0 -5
  106. package/src/components/VWysiwygEditor/extensions/linter/plugins/BadWords.tsx +0 -50
  107. package/src/components/VWysiwygEditor/extensions/linter/plugins/HeadingLevel.ts +0 -39
  108. package/src/components/VWysiwygEditor/extensions/linter/plugins/Punctuation.ts +0 -49
  109. package/src/components/VWysiwygEditor/extensions/linter/plugins/index.ts +0 -3
  110. package/src/components/VWysiwygEditor/extensions/linter/utils.ts +0 -28
  111. package/src/components/VWysiwygEditor/index.ts +0 -4
  112. package/src/components/VWysiwygEditor/schemes.ts +0 -251
  113. package/src/components/VWysiwygEditor/tools/bullet-list.ts +0 -18
  114. package/src/components/VWysiwygEditor/tools/color.scss +0 -140
  115. package/src/components/VWysiwygEditor/tools/color.tsx +0 -90
  116. package/src/components/VWysiwygEditor/tools/format-bold.ts +0 -19
  117. package/src/components/VWysiwygEditor/tools/format-italic.ts +0 -18
  118. package/src/components/VWysiwygEditor/tools/format-underline.ts +0 -18
  119. package/src/components/VWysiwygEditor/tools/history.ts +0 -26
  120. package/src/components/VWysiwygEditor/tools/index.ts +0 -8
  121. package/src/components/VWysiwygEditor/tools/link.ts +0 -57
  122. package/src/components/VWysiwygEditor/tools/ordered-list.ts +0 -21
  123. package/src/tool/index.ts +0 -2
  124. package/src/tool/vite-plugin.ts +0 -266
  125. /package/{src/styles → dist}/after-effects/display-flow.scss +0 -0
  126. /package/{src/styles → dist}/after-effects/spacing.scss +0 -0
  127. /package/{src/styles → dist}/after-effects/text.scss +0 -0
  128. /package/{src/styles → dist}/after-effects.scss +0 -0
  129. /package/dist/{assets/builtins → builtins}/color-scheme.ts +0 -0
  130. /package/dist/{assets/builtins → builtins}/media-match.ts +0 -0
@@ -1,266 +0,0 @@
1
- import { Plugin } from 'vite';
2
- import { dynamicSrcVitePlugin } from '@fastkit/vite-kit';
3
- import path from 'node:path';
4
- import fs from 'fs-extra';
5
- import { findPackageDirSync, getDirname } from '@fastkit/node-util';
6
- import { RawIconFontEntry, IconFontSettings } from '@fastkit/icon-font-gen';
7
- import { VuiServiceOptions } from '../service';
8
- import { render } from 'eta';
9
- import { VuiError } from '../logger';
10
-
11
- const VUI_PACKAGE_DIR = path.resolve(getDirname(import.meta.url), '../..');
12
- const STYLE_AFTER_EFFECTS_PATH = path.join(
13
- VUI_PACKAGE_DIR,
14
- 'src/styles/after-effects.scss',
15
- );
16
-
17
- const COLOR_DUMP_STYLE = `@include dump-color-scheme(true);`;
18
-
19
- const TEMPLATE = `
20
- /* eslint-disable */
21
- // @ts-nocheck
22
- <% if (!it.__dev) { %>
23
- import '@fastkit/vue-stack/vue-stack.css';
24
- import '@fastkit/vue-app-layout/vue-app-layout.css';
25
- import '@fastkit/vue-loading/vue-loading.css';
26
- import '@fastkit/vue-scroller/vue-scroller.css';
27
- import '@fastkit/vui/vui.css';
28
- <% } %>
29
- import './setup.scss';
30
- import type { App } from 'vue';
31
- import type { Router } from 'vue-router';
32
- import { VPageLink } from '@fastkit/vue-page';
33
- import { installVuiPlugin as _installVuiPlugin, RawVuiPluginOptions, mergeVuiPluginOptions } from '@fastkit/vui';
34
- import { colorScheme } from '<%~ it.colorScheme %>';
35
- import '<%~ it.mediaMatch %>';
36
- import './icon-font';
37
- import '${STYLE_AFTER_EFFECTS_PATH}';
38
-
39
- export function installVui(settings: { app: App, router: Router }, options?: RawVuiPluginOptions) {
40
- const merged = mergeVuiPluginOptions({
41
- RouterLink: VPageLink,
42
- colorScheme,
43
- uiSettings: <%~ it.uiSettings %>,
44
- icons: <%~ it.icons %>,
45
- ...settings,
46
- }, options);
47
- _installVuiPlugin(settings.app, merged);
48
- }
49
-
50
- export default installVui;
51
- `.trim();
52
-
53
- async function renderTemplate({
54
- colorScheme,
55
- mediaMatch,
56
- uiSettings,
57
- icons,
58
- __dev,
59
- }: ViteVuiPluginResultSettings) {
60
- const result = await render(
61
- TEMPLATE,
62
- {
63
- colorScheme,
64
- mediaMatch,
65
- uiSettings: JSON.stringify(uiSettings),
66
- icons: JSON.stringify(icons),
67
- __dev,
68
- },
69
- { async: true },
70
- );
71
- if (!result) {
72
- throw new VuiError('template render error.');
73
- }
74
- return result;
75
- }
76
-
77
- function defaultDynamicDest() {
78
- return path.resolve('.vui');
79
- }
80
-
81
- function getBuiltinsDir() {
82
- const pkgDir = findPackageDirSync(undefined, true);
83
- if (!pkgDir) {
84
- throw new Error(`missing package directory`);
85
- }
86
-
87
- return path.join(pkgDir, 'node_modules/@fastkit/vui/dist/assets/builtins');
88
- }
89
-
90
- export interface ViteVuiPluginOptions
91
- extends Partial<Pick<VuiServiceOptions, 'uiSettings' | 'icons'>> {
92
- dynamicDest?: string;
93
- colorScheme?: string;
94
- mediaMatch?: string;
95
- iconFont?: RawIconFontEntry[];
96
- iconFontDefaults?: IconFontSettings;
97
- onBooted?: (() => any) | (() => Promise<any>);
98
- onBootError?: ((err: unknown) => any) | ((err: unknown) => Promise<any>);
99
- __dev?: boolean;
100
- }
101
-
102
- export interface ViteVuiPluginResultSettings
103
- extends Pick<VuiServiceOptions, 'uiSettings' | 'icons'> {
104
- colorScheme: string;
105
- mediaMatch: string;
106
- __dev?: boolean;
107
- }
108
-
109
- export interface ViteVuiPluginResult {
110
- settings: ViteVuiPluginResultSettings;
111
- plugins: (Plugin | Plugin[])[];
112
- dest: string;
113
- }
114
-
115
- export function viteVuiPlugin(
116
- options: ViteVuiPluginOptions = {},
117
- ): ViteVuiPluginResult {
118
- const plugins: (Plugin | Plugin[])[] = [];
119
-
120
- const builtinsDir = getBuiltinsDir();
121
- const {
122
- colorScheme = path.join(builtinsDir, 'color-scheme'),
123
- mediaMatch = path.join(builtinsDir, 'media-match'),
124
- iconFont,
125
- iconFontDefaults,
126
- onBooted,
127
- onBootError,
128
- uiSettings = {
129
- primaryScope: 'primary' as any,
130
- plainVariant: 'plain' as any,
131
- containedVariant: 'contained' as any,
132
- warningScope: 'warning' as any,
133
- errorScope: 'error' as any,
134
- buttonDefault: {
135
- color: 'base' as any,
136
- variant: 'contained' as any,
137
- },
138
- tabDefault: {
139
- color: 'accent' as any,
140
- },
141
- dialogOk: {
142
- color: 'primary' as any,
143
- },
144
- },
145
- icons = {
146
- menuDown: 'mdi-menu-down' as any,
147
- navigationExpand: 'mdi-menu-down' as any,
148
- prev: 'mdi-chevron-left' as any,
149
- next: 'mdi-chevron-right' as any,
150
- sort: 'mdi-chevron-down' as any,
151
- editorTextColor: 'mdi-format-color-text' as any,
152
- editorformatBold: 'mdi-format-bold' as any,
153
- editorformatUnderline: 'mdi-format-underline' as any,
154
- editorformatItalic: 'mdi-format-italic' as any,
155
- editorformatListBulleted: 'mdi-format-list-bulleted' as any,
156
- editorformatListNumbered: 'mdi-format-list-numbered' as any,
157
- editorLink: 'mdi-link' as any,
158
- editorLinkOff: 'mdi-link-off' as any,
159
- editorUndo: 'mdi-undo-variant' as any,
160
- editorRedo: 'mdi-redo-variant' as any,
161
- hinttip: 'mdi-help-circle-outline' as any,
162
- clear: 'mdi-close' as any,
163
- reload: 'mdi-reload' as any,
164
- // navigationExpand: (gen, active) => {
165
- // return gen({
166
- // name: 'mdi-menu-down' as any,
167
- // rotate: active ? 180 : 0,
168
- // });
169
- // },
170
- ...options.icons,
171
- } as VuiServiceOptions['icons'],
172
- __dev,
173
- } = options;
174
-
175
- let dynamicDest: string;
176
-
177
- const { dynamicDest: _dynamicDest } = options;
178
-
179
- if (!_dynamicDest) {
180
- dynamicDest = defaultDynamicDest();
181
- } else {
182
- dynamicDest = _dynamicDest;
183
- }
184
-
185
- const colorSchemeSrc = path.resolve(colorScheme);
186
- const colorSchemeDest = path.join(dynamicDest, 'color-scheme');
187
- const mediaMatchDest = path.join(dynamicDest, 'media-match');
188
- const dts = `
189
- /// <reference path="./color-scheme/color-scheme.info.ts" />
190
- /// <reference path="./icon-font/index.ts" />
191
- /// <reference path="./media-match/media-match.ts" />
192
- export {};
193
- `.trim();
194
-
195
- fs.ensureDirSync(dynamicDest);
196
- fs.writeFileSync(path.join(dynamicDest, 'setup.scss'), COLOR_DUMP_STYLE);
197
- fs.writeFileSync(path.join(dynamicDest, 'vui.d.ts'), dts);
198
-
199
- let iconFontEntries: RawIconFontEntry[] = iconFont || [
200
- {
201
- src: '@mdi',
202
- },
203
- ];
204
-
205
- if (iconFontDefaults) {
206
- iconFontEntries = iconFontEntries.map((entry) => {
207
- return {
208
- ...iconFontDefaults,
209
- ...entry,
210
- };
211
- });
212
- }
213
-
214
- plugins.push(
215
- dynamicSrcVitePlugin({
216
- colorScheme: {
217
- src: colorSchemeSrc,
218
- dest: colorSchemeDest,
219
- },
220
- mediaMatch: {
221
- src: path.resolve(mediaMatch),
222
- dest: mediaMatchDest,
223
- },
224
- iconFont: {
225
- entries: iconFontEntries,
226
- dest: path.join(dynamicDest, 'icon-font'),
227
- },
228
- onBooted,
229
- onBootError,
230
- }),
231
- );
232
-
233
- const plugin: Plugin = {
234
- name: 'vite:vui',
235
- enforce: 'pre',
236
- async config(config) {
237
- await fs.writeFile(
238
- path.join(dynamicDest, 'installer.ts'),
239
- await renderTemplate(settings),
240
- );
241
-
242
- const ssr = (config as any).ssr || {};
243
- ssr.noExternal = ssr.noExternal || [];
244
- ssr.noExternal.push(/\/vui\/dist\/assets\//);
245
-
246
- (config as any).ssr = ssr;
247
- return config;
248
- },
249
- };
250
-
251
- plugins.push(plugin);
252
-
253
- const settings = {
254
- colorScheme: path.join(colorSchemeDest, 'color-scheme.info'),
255
- mediaMatch: path.join(mediaMatchDest, 'media-match'),
256
- uiSettings,
257
- icons,
258
- __dev,
259
- };
260
-
261
- return {
262
- plugins,
263
- dest: dynamicDest,
264
- settings,
265
- };
266
- }
File without changes
File without changes
File without changes