vuetify-nuxt-module 0.5.13 → 0.5.14

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/module.d.ts CHANGED
@@ -69,6 +69,44 @@ interface FontIconSet {
69
69
  */
70
70
  cdn?: string;
71
71
  }
72
+ interface UnoCCSMdiIconSet {
73
+ collapse?: string;
74
+ complete?: string;
75
+ cancel?: string;
76
+ close?: string;
77
+ delete?: string;
78
+ clear?: string;
79
+ success?: string;
80
+ info?: string;
81
+ warning?: string;
82
+ error?: string;
83
+ prev?: string;
84
+ next?: string;
85
+ checkboxOn?: string;
86
+ checkboxOff?: string;
87
+ checkboxIndeterminate?: string;
88
+ delimiter?: string;
89
+ sortAsc?: string;
90
+ sortDesc?: string;
91
+ expand?: string;
92
+ menu?: string;
93
+ subgroup?: string;
94
+ dropdown?: string;
95
+ radioOn?: string;
96
+ radioOff?: string;
97
+ edit?: string;
98
+ ratingEmpty?: string;
99
+ ratingFull?: string;
100
+ ratingHalf?: string;
101
+ loading?: string;
102
+ first?: string;
103
+ last?: string;
104
+ unfold?: string;
105
+ file?: string;
106
+ plus?: string;
107
+ minus?: string;
108
+ calendar?: string;
109
+ }
72
110
  interface IconsOptions {
73
111
  /**
74
112
  * @default 'mdi'
@@ -80,6 +118,14 @@ interface IconsOptions {
80
118
  * @default 'i-'
81
119
  */
82
120
  unocssIconPrefix?: string;
121
+ /**
122
+ * Override the default mdi icons.
123
+ *
124
+ * Icon names should include the prefix and the collection, for example:
125
+ * - home: i-<collection>:<icon>
126
+ */
127
+ unocssIcons?: UnoCCSMdiIconSet;
128
+ unocssAdditionalIcons?: Record<string, string>;
83
129
  sets?: IconFontName | IconFontName[] | FontIconSet[];
84
130
  svg?: {
85
131
  mdi?: JSSVGIconSet;
@@ -380,4 +426,4 @@ declare module '#app' {
380
426
 
381
427
  declare const _default: _nuxt_schema.NuxtModule<ModuleOptions>;
382
428
 
383
- export { ComponentName, Components, DateAdapter, DateOptions, DirectiveName, Directives, ExternalVuetifyOptions, FontAwesomeSvgIconSet, FontIconSet, IconFontName, IconSetName, IconsOptions, InlineModuleOptions, JSSVGIconSet, LabComponentName, LabComponents, MOptions, ModuleOptions, SSRClientHints, SSRClientHintsConfiguration, VOptions, VuetifyLocale, _default as default };
429
+ export { ComponentName, Components, DateAdapter, DateOptions, DirectiveName, Directives, ExternalVuetifyOptions, FontAwesomeSvgIconSet, FontIconSet, IconFontName, IconSetName, IconsOptions, InlineModuleOptions, JSSVGIconSet, LabComponentName, LabComponents, MOptions, ModuleOptions, SSRClientHints, SSRClientHintsConfiguration, UnoCCSMdiIconSet, VOptions, VuetifyLocale, _default as default };
package/dist/module.json CHANGED
@@ -4,5 +4,5 @@
4
4
  "compatibility": {
5
5
  "nuxt": "^3.0.0"
6
6
  },
7
- "version": "0.5.13"
7
+ "version": "0.5.14"
8
8
  }
package/dist/module.mjs CHANGED
@@ -12,7 +12,7 @@ import vuetify, { transformAssetUrls } from 'vite-plugin-vuetify';
12
12
  import { isAbsolute, join, relative } from 'pathe';
13
13
  import { normalizePath as normalizePath$1 } from 'vite';
14
14
 
15
- const version = "0.5.13";
15
+ const version = "0.5.14";
16
16
 
17
17
  const VIRTUAL_VUETIFY_CONFIGURATION = "virtual:vuetify-configuration";
18
18
  const RESOLVED_VIRTUAL_VUETIFY_CONFIGURATION = `/@nuxt-vuetify-configuration/${VIRTUAL_VUETIFY_CONFIGURATION.slice("virtual:".length)}`;
@@ -198,6 +198,8 @@ const disabledResolvedIcons = Object.freeze({
198
198
  unocss: false,
199
199
  unocssAliases: false,
200
200
  unocssIconPrefix: "i-",
201
+ unocssIcons: {},
202
+ unocssAdditionalIcons: {},
201
203
  imports: [],
202
204
  aliases: [],
203
205
  aliasesImportPresent: false,
@@ -221,6 +223,8 @@ function prepareIcons(unocssPresent, logger, vuetifyOptions) {
221
223
  unocss: unocssPresent && (defaultSet === "unocss-mdi" || sets.some((s) => s.name === "unocss-mdi")),
222
224
  unocssAliases: defaultSet === "unocss-mdi",
223
225
  unocssIconPrefix: icons.unocssIconPrefix ?? "i-",
226
+ unocssIcons: icons.unocssIcons ?? {},
227
+ unocssAdditionalIcons: icons.unocssAdditionalIcons ?? {},
224
228
  defaultSet,
225
229
  sets: [],
226
230
  aliases: [],
@@ -658,6 +662,15 @@ function vuetifyStylesPlugin(options, logger) {
658
662
  };
659
663
  }
660
664
 
665
+ function toKebabCase(str = "") {
666
+ if (toKebabCase.cache.has(str))
667
+ return toKebabCase.cache.get(str);
668
+ const kebab = str.replace(/[^a-z]/gi, "-").replace(/\B([A-Z])/g, "-$1").toLowerCase();
669
+ toKebabCase.cache.set(str, kebab);
670
+ return kebab;
671
+ }
672
+ toKebabCase.cache = /* @__PURE__ */ new Map();
673
+
661
674
  function vuetifyConfigurationPlugin(ctx) {
662
675
  return {
663
676
  name: "vuetify:configuration:nuxt",
@@ -744,8 +757,8 @@ async function buildConfiguration(ctx) {
744
757
  config.imports.push("import * as directives from 'vuetify/directives'");
745
758
  config.directives = "options.directives = directives";
746
759
  } else {
747
- const useDirectives = Array.isArray(directives) ? [...new Set(...directives)] : [directives];
748
- config.imports.push(useDirectives.map((d) => `import { ${d} } from 'vuetify/directives/${d}'`).join("\n"));
760
+ const useDirectives = Array.isArray(directives) ? [...new Set(directives)] : [directives];
761
+ config.imports.push(useDirectives.map((d) => `import {${d}} from 'vuetify/directives/${toKebabCase(d)}'`).join("\n"));
749
762
  config.directives = `options.directives = {${useDirectives.join(",")}}`;
750
763
  }
751
764
  }
@@ -960,46 +973,87 @@ ${unocss}
960
973
  if (ctx.icons.unocss && ctx.icons.unocssAliases) {
961
974
  ctx.icons.imports.unshift("// @unocss-include");
962
975
  const prefix = `${ctx.icons.unocssIconPrefix}mdi:`;
963
- unocss = `const aliases = JSON.parse('${JSON.stringify({
964
- collapse: `${prefix}chevron-up`,
965
- complete: `${prefix}check`,
966
- cancel: `${prefix}close-circle`,
967
- close: `${prefix}close`,
968
- delete: `${prefix}close-circle`,
976
+ const {
977
+ collapse = `${prefix}chevron-up`,
978
+ complete = `${prefix}check`,
979
+ cancel = `${prefix}close-circle`,
980
+ close = `${prefix}close`,
969
981
  // delete (e.g. v-chip close)
970
- clear: `${prefix}close-circle`,
971
- success: `${prefix}check-circle`,
972
- info: `${prefix}information`,
973
- warning: `${prefix}alert-circle`,
974
- error: `${prefix}close-circle`,
975
- prev: `${prefix}chevron-left`,
976
- next: `${prefix}chevron-right`,
977
- checkboxOn: `${prefix}checkbox-marked`,
978
- checkboxOff: `${prefix}checkbox-blank-outline`,
979
- checkboxIndeterminate: `${prefix}minus-box`,
980
- delimiter: `${prefix}circle`,
982
+ clear = `${prefix}close-circle`,
983
+ success = `${prefix}check-circle`,
984
+ info = `${prefix}information`,
985
+ warning = `${prefix}alert-circle`,
986
+ error = `${prefix}close-circle`,
987
+ prev = `${prefix}chevron-left`,
988
+ next = `${prefix}chevron-right`,
989
+ checkboxOn = `${prefix}checkbox-marked`,
990
+ checkboxOff = `${prefix}checkbox-blank-outline`,
991
+ checkboxIndeterminate = `${prefix}minus-box`,
992
+ delimiter = `${prefix}circle`,
981
993
  // for carousel
982
- sortAsc: `${prefix}arrow-up`,
983
- sortDesc: `${prefix}arrow-down`,
984
- expand: `${prefix}chevron-down`,
985
- menu: `${prefix}menu`,
986
- subgroup: `${prefix}menu-down`,
987
- dropdown: `${prefix}menu-down`,
988
- radioOn: `${prefix}radiobox-marked`,
989
- radioOff: `${prefix}radiobox-blank`,
990
- edit: `${prefix}pencil`,
991
- ratingEmpty: `${prefix}star-outline`,
992
- ratingFull: `${prefix}star`,
993
- ratingHalf: `${prefix}star-half-full`,
994
- loading: `${prefix}cached`,
995
- first: `${prefix}page-first`,
996
- last: `${prefix}page-last`,
997
- unfold: `${prefix}unfold-more-horizontal`,
998
- file: `${prefix}paperclip`,
999
- plus: `${prefix}plus`,
1000
- minus: `${prefix}minus`,
1001
- calendar: `${prefix}calendar`
1002
- })}');
994
+ sortAsc = `${prefix}arrow-up`,
995
+ sortDesc = `${prefix}arrow-down`,
996
+ expand = `${prefix}chevron-down`,
997
+ menu = `${prefix}menu`,
998
+ subgroup = `${prefix}menu-down`,
999
+ dropdown = `${prefix}menu-down`,
1000
+ radioOn = `${prefix}radiobox-marked`,
1001
+ radioOff = `${prefix}radiobox-blank`,
1002
+ edit = `${prefix}pencil`,
1003
+ ratingEmpty = `${prefix}star-outline`,
1004
+ ratingFull = `${prefix}star`,
1005
+ ratingHalf = `${prefix}star-half-full`,
1006
+ loading = `${prefix}cached`,
1007
+ first = `${prefix}page-first`,
1008
+ last = `${prefix}page-last`,
1009
+ unfold = `${prefix}unfold-more-horizontal`,
1010
+ file = `${prefix}paperclip`,
1011
+ plus = `${prefix}plus`,
1012
+ minus = `${prefix}minus`,
1013
+ calendar = `${prefix}calendar`
1014
+ } = ctx.icons.unocssIcons;
1015
+ const useIcons = {
1016
+ collapse,
1017
+ complete,
1018
+ cancel,
1019
+ close,
1020
+ delete: ctx.icons.unocssIcons.delete ?? `${prefix}close-circle`,
1021
+ clear,
1022
+ success,
1023
+ info,
1024
+ warning,
1025
+ error,
1026
+ prev,
1027
+ next,
1028
+ checkboxOn,
1029
+ checkboxOff,
1030
+ checkboxIndeterminate,
1031
+ delimiter,
1032
+ sortAsc,
1033
+ sortDesc,
1034
+ expand,
1035
+ menu,
1036
+ subgroup,
1037
+ dropdown,
1038
+ radioOn,
1039
+ radioOff,
1040
+ edit,
1041
+ ratingEmpty,
1042
+ ratingFull,
1043
+ ratingHalf,
1044
+ loading,
1045
+ first,
1046
+ last,
1047
+ unfold,
1048
+ file,
1049
+ plus,
1050
+ minus,
1051
+ calendar
1052
+ };
1053
+ Object.entries(ctx.icons.unocssAdditionalIcons).forEach(([key, value]) => {
1054
+ useIcons[key] = value;
1055
+ });
1056
+ unocss = `const aliases = JSON.parse('${JSON.stringify(useIcons)}');
1003
1057
  `;
1004
1058
  }
1005
1059
  return {
@@ -1106,15 +1160,6 @@ function configureVite(configKey, nuxt, ctx) {
1106
1160
  });
1107
1161
  }
1108
1162
 
1109
- function toKebabCase(str = "") {
1110
- if (toKebabCase.cache.has(str))
1111
- return toKebabCase.cache.get(str);
1112
- const kebab = str.replace(/[^a-z]/gi, "-").replace(/\B([A-Z])/g, "-$1").toLowerCase();
1113
- toKebabCase.cache.set(str, kebab);
1114
- return kebab;
1115
- }
1116
- toKebabCase.cache = /* @__PURE__ */ new Map();
1117
-
1118
1163
  function configureNuxt(configKey, nuxt, ctx) {
1119
1164
  var _a, _b, _c;
1120
1165
  const {
package/dist/types.d.ts CHANGED
@@ -12,4 +12,4 @@ declare module 'nuxt/schema' {
12
12
  }
13
13
 
14
14
 
15
- export { ComponentName, Components, DateAdapter, DateOptions, DirectiveName, Directives, ExternalVuetifyOptions, FontAwesomeSvgIconSet, FontIconSet, IconFontName, IconSetName, IconsOptions, InlineModuleOptions, JSSVGIconSet, LabComponentName, LabComponents, MOptions, ModuleOptions, SSRClientHints, SSRClientHintsConfiguration, VOptions, VuetifyLocale, default } from './module'
15
+ export { ComponentName, Components, DateAdapter, DateOptions, DirectiveName, Directives, ExternalVuetifyOptions, FontAwesomeSvgIconSet, FontIconSet, IconFontName, IconSetName, IconsOptions, InlineModuleOptions, JSSVGIconSet, LabComponentName, LabComponents, MOptions, ModuleOptions, SSRClientHints, SSRClientHintsConfiguration, UnoCCSMdiIconSet, VOptions, VuetifyLocale, default } from './module'
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "vuetify-nuxt-module",
3
3
  "type": "module",
4
- "version": "0.5.13",
5
- "packageManager": "pnpm@8.8.0",
4
+ "version": "0.5.14",
5
+ "packageManager": "pnpm@8.9.0",
6
6
  "description": "Zero-Config Nuxt Module for Vuetify",
7
7
  "author": "userquin <userquin@gmail.com>",
8
8
  "license": "MIT",
@@ -128,4 +128,4 @@
128
128
  "installDependencies": false,
129
129
  "startCommand": "node .stackblitz.js && pnpm install && pnpm run dev"
130
130
  }
131
- }
131
+ }