@fastkit/vui 0.6.12 → 0.6.16

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.
@@ -37,18 +37,18 @@ import './icon-font';
37
37
  export function installVui(app: App) {
38
38
  _installVuiPlugin(app, {
39
39
  colorScheme,
40
- colors: <%~ it.colors %>,
40
+ uiSettings: <%~ it.uiSettings %>,
41
41
  icons: <%~ it.icons %>,
42
42
  });
43
43
  }
44
44
 
45
45
  export default installVui;
46
46
  `.trim();
47
- async function renderTemplate({ colorScheme, mediaMatch, colors, icons, __dev, }) {
47
+ async function renderTemplate({ colorScheme, mediaMatch, uiSettings, icons, __dev, }) {
48
48
  const result = await eta.render(TEMPLATE, {
49
49
  colorScheme,
50
50
  mediaMatch,
51
- colors: JSON.stringify(colors),
51
+ uiSettings: JSON.stringify(uiSettings),
52
52
  icons: JSON.stringify(icons),
53
53
  __dev,
54
54
  }, { async: true });
@@ -82,11 +82,28 @@ function getBuiltinsDir() {
82
82
  function viteVuiPlugin(options = {}) {
83
83
  const plugins = [];
84
84
  const builtinsDir = getBuiltinsDir();
85
- const { colorScheme = path__default.join(builtinsDir, 'color-scheme'), mediaMatch = path__default.join(builtinsDir, 'media-match'), iconFont, iconFontDefaults, onBooted, onBootError, colors = {
86
- primary: 'primary',
87
- error: 'error',
85
+ const { colorScheme = path__default.join(builtinsDir, 'color-scheme'), mediaMatch = path__default.join(builtinsDir, 'media-match'), iconFont, iconFontDefaults, onBooted, onBootError, uiSettings = {
86
+ primaryScope: 'primary',
87
+ plainVariant: 'plain',
88
+ containedVariant: 'contained',
89
+ errorScope: 'error',
90
+ buttonDefault: {
91
+ color: 'base',
92
+ variant: 'contained',
93
+ },
94
+ dialogOk: {
95
+ color: 'primary',
96
+ },
88
97
  }, icons = {
89
98
  menuDown: 'mdi-menu-down',
99
+ navigationExpand: 'mdi-menu-down',
100
+ // navigationExpand: (gen, active) => {
101
+ // return gen({
102
+ // name: 'mdi-menu-down' as any,
103
+ // rotate: active ? 180 : 0,
104
+ // });
105
+ // },
106
+ ...options.icons,
90
107
  }, __dev, } = options;
91
108
  let dynamicDest;
92
109
  const { dynamicDest: _dynamicDest } = options;
@@ -159,7 +176,7 @@ export {};
159
176
  const settings = {
160
177
  colorScheme: path__default.join(colorSchemeDest, 'color-scheme.info'),
161
178
  mediaMatch: path__default.join(mediaMatchDest, 'media-match'),
162
- colors,
179
+ uiSettings,
163
180
  icons,
164
181
  __dev,
165
182
  };
@@ -1,7 +1,7 @@
1
1
  import { Plugin } from 'vite';
2
2
  import { RawIconFontEntry, IconFontSettings } from '@fastkit/icon-font-gen';
3
3
  import { VuiServiceOptions } from '../service';
4
- export interface ViteVuiPluginOptions extends Partial<Pick<VuiServiceOptions, 'colors' | 'icons'>> {
4
+ export interface ViteVuiPluginOptions extends Partial<Pick<VuiServiceOptions, 'uiSettings' | 'icons'>> {
5
5
  dynamicDest?: string;
6
6
  colorScheme?: string;
7
7
  mediaMatch?: string;
@@ -11,7 +11,7 @@ export interface ViteVuiPluginOptions extends Partial<Pick<VuiServiceOptions, 'c
11
11
  onBootError?: (err: unknown) => any;
12
12
  __dev?: boolean;
13
13
  }
14
- export interface ViteVuiPluginResultSettings extends Pick<VuiServiceOptions, 'colors' | 'icons'> {
14
+ export interface ViteVuiPluginResultSettings extends Pick<VuiServiceOptions, 'uiSettings' | 'icons'> {
15
15
  colorScheme: string;
16
16
  mediaMatch: string;
17
17
  __dev?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"vite-plugin.d.ts","sourceRoot":"","sources":["../../../../../../../packages/vui/src/tool/vite-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAK9B,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAkF/C,MAAM,WAAW,oBACf,SAAQ,OAAO,CAAC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