maz-ui 3.48.3 → 3.48.4-beta.0
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/nuxt/index.d.mts +7 -0
- package/nuxt/index.d.ts +7 -0
- package/nuxt/index.json +1 -1
- package/nuxt/index.mjs +17 -16
- package/package.json +1 -1
package/nuxt/index.d.mts
CHANGED
|
@@ -2,6 +2,13 @@ import * as _nuxt_schema from '@nuxt/schema';
|
|
|
2
2
|
import { AosOptions, ToasterOptions, DialogOptions, ThemeHandlerOptions, vLazyImgOptions, vTooltipOptions } from 'maz-ui';
|
|
3
3
|
|
|
4
4
|
interface MazUiNuxtOptions {
|
|
5
|
+
/**
|
|
6
|
+
* Prefix for composables
|
|
7
|
+
* @description This prefix will be added after `use` keyword
|
|
8
|
+
* @example `composablePrefix: 'Maz'` will generate `useMazToast` composable instead of `useToast`
|
|
9
|
+
* @default ''
|
|
10
|
+
*/
|
|
11
|
+
autoImportPrefix?: string;
|
|
5
12
|
/**
|
|
6
13
|
* Enable auto-import of main css file
|
|
7
14
|
* @default true
|
package/nuxt/index.d.ts
CHANGED
|
@@ -2,6 +2,13 @@ import * as _nuxt_schema from '@nuxt/schema';
|
|
|
2
2
|
import { AosOptions, ToasterOptions, DialogOptions, ThemeHandlerOptions, vLazyImgOptions, vTooltipOptions } from 'maz-ui';
|
|
3
3
|
|
|
4
4
|
interface MazUiNuxtOptions {
|
|
5
|
+
/**
|
|
6
|
+
* Prefix for composables
|
|
7
|
+
* @description This prefix will be added after `use` keyword
|
|
8
|
+
* @example `composablePrefix: 'Maz'` will generate `useMazToast` composable instead of `useToast`
|
|
9
|
+
* @default ''
|
|
10
|
+
*/
|
|
11
|
+
autoImportPrefix?: string;
|
|
5
12
|
/**
|
|
6
13
|
* Enable auto-import of main css file
|
|
7
14
|
* @default true
|
package/nuxt/index.json
CHANGED
package/nuxt/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { defineNuxtModule, createResolver, addComponent, addPlugin, addImports } from '@nuxt/kit';
|
|
1
2
|
import { resolve, dirname } from 'node:path';
|
|
2
3
|
import { fileURLToPath } from 'node:url';
|
|
3
|
-
import { defineNuxtModule, createResolver, addComponent, addPlugin, addImports } from '@nuxt/kit';
|
|
4
4
|
import { readdir } from 'node:fs/promises';
|
|
5
5
|
|
|
6
6
|
function isPlainObject(value) {
|
|
@@ -81,6 +81,7 @@ async function getComponentList() {
|
|
|
81
81
|
const _dirname = dirname(fileURLToPath(import.meta.url));
|
|
82
82
|
const defaults = {
|
|
83
83
|
defaultMazIconPath: "",
|
|
84
|
+
autoImportPrefix: "",
|
|
84
85
|
devtools: true,
|
|
85
86
|
injectAos: true,
|
|
86
87
|
injectComponents: true,
|
|
@@ -137,7 +138,7 @@ const module = defineNuxtModule({
|
|
|
137
138
|
addImports({
|
|
138
139
|
from: resolve(_dirname, "./runtime/composables/useAos"),
|
|
139
140
|
name: "useAos",
|
|
140
|
-
as:
|
|
141
|
+
as: `use${moduleOptions.autoImportPrefix}Aos`
|
|
141
142
|
});
|
|
142
143
|
const injectAosCSS = typeof moduleOptions.injectAos === "object" && typeof moduleOptions.injectAos.injectCss === "boolean" ? moduleOptions.injectAos.injectCss : true;
|
|
143
144
|
if (typeof moduleOptions.injectAos === "object" && injectAosCSS && process.env.MAZ_UI_DEV === "true") {
|
|
@@ -166,7 +167,7 @@ const module = defineNuxtModule({
|
|
|
166
167
|
addImports({
|
|
167
168
|
from: resolve(_dirname, "./runtime/composables/useToast"),
|
|
168
169
|
name: "useToast",
|
|
169
|
-
as:
|
|
170
|
+
as: `use${moduleOptions.autoImportPrefix}Toast`
|
|
170
171
|
});
|
|
171
172
|
}
|
|
172
173
|
if (moduleOptions.injectUseDialog) {
|
|
@@ -174,7 +175,7 @@ const module = defineNuxtModule({
|
|
|
174
175
|
addImports({
|
|
175
176
|
from: resolve(_dirname, "./runtime/composables/useDialog"),
|
|
176
177
|
name: "useDialog",
|
|
177
|
-
as:
|
|
178
|
+
as: `use${moduleOptions.autoImportPrefix}Dialog`
|
|
178
179
|
});
|
|
179
180
|
}
|
|
180
181
|
if (moduleOptions.injectUseWait) {
|
|
@@ -182,35 +183,35 @@ const module = defineNuxtModule({
|
|
|
182
183
|
addImports({
|
|
183
184
|
from: resolve(_dirname, "./runtime/composables/useWait"),
|
|
184
185
|
name: "useWait",
|
|
185
|
-
as:
|
|
186
|
+
as: `use${moduleOptions.autoImportPrefix}Wait`
|
|
186
187
|
});
|
|
187
188
|
}
|
|
188
189
|
if (moduleOptions.injectUseThemeHandler) {
|
|
189
190
|
addImports({
|
|
190
191
|
from: resolve(_dirname, "./runtime/composables/useThemeHandler"),
|
|
191
192
|
name: "useThemeHandler",
|
|
192
|
-
as:
|
|
193
|
+
as: `use${moduleOptions.autoImportPrefix}ThemeHandler`
|
|
193
194
|
});
|
|
194
195
|
}
|
|
195
196
|
if (moduleOptions.injectUseIdleTimeout) {
|
|
196
197
|
addImports({
|
|
197
198
|
from: "maz-ui",
|
|
198
199
|
name: "useIdleTimeout",
|
|
199
|
-
as:
|
|
200
|
+
as: `use${moduleOptions.autoImportPrefix}IdleTimeout`
|
|
200
201
|
});
|
|
201
202
|
}
|
|
202
203
|
if (moduleOptions.injectUseReadingTime) {
|
|
203
204
|
addImports({
|
|
204
205
|
from: "maz-ui",
|
|
205
206
|
name: "useReadingTime",
|
|
206
|
-
as:
|
|
207
|
+
as: `use${moduleOptions.autoImportPrefix}ReadingTime`
|
|
207
208
|
});
|
|
208
209
|
}
|
|
209
210
|
if (moduleOptions.injectUseWindowSize) {
|
|
210
211
|
addImports({
|
|
211
212
|
from: "maz-ui",
|
|
212
213
|
name: "useWindowSize",
|
|
213
|
-
as:
|
|
214
|
+
as: `use${moduleOptions.autoImportPrefix}WindowSize`
|
|
214
215
|
});
|
|
215
216
|
}
|
|
216
217
|
if (moduleOptions.injectUseBreakpoints) {
|
|
@@ -224,47 +225,47 @@ const module = defineNuxtModule({
|
|
|
224
225
|
addImports({
|
|
225
226
|
from: "maz-ui",
|
|
226
227
|
name: "useUserVisibility",
|
|
227
|
-
as:
|
|
228
|
+
as: `use${moduleOptions.autoImportPrefix}UserVisibility`
|
|
228
229
|
});
|
|
229
230
|
}
|
|
230
231
|
if (moduleOptions.injectUseUserVisibility) {
|
|
231
232
|
addImports({
|
|
232
233
|
from: "maz-ui",
|
|
233
234
|
name: "useUserVisibility",
|
|
234
|
-
as:
|
|
235
|
+
as: `use${moduleOptions.autoImportPrefix}UserVisibility`
|
|
235
236
|
});
|
|
236
237
|
}
|
|
237
238
|
if (moduleOptions.injectUseStringMatching) {
|
|
238
239
|
addImports({
|
|
239
240
|
from: "maz-ui",
|
|
240
241
|
name: "useStringMatching",
|
|
241
|
-
as:
|
|
242
|
+
as: `use${moduleOptions.autoImportPrefix}StringMatching`
|
|
242
243
|
});
|
|
243
244
|
}
|
|
244
245
|
if (moduleOptions.injectUseTimer) {
|
|
245
246
|
addImports({
|
|
246
247
|
from: "maz-ui",
|
|
247
248
|
name: "useTimer",
|
|
248
|
-
as:
|
|
249
|
+
as: `use${moduleOptions.autoImportPrefix}Timer`
|
|
249
250
|
});
|
|
250
251
|
}
|
|
251
252
|
if (moduleOptions.injectUseFormValidator) {
|
|
252
253
|
addImports({
|
|
253
254
|
from: "maz-ui",
|
|
254
255
|
name: "useFormValidator",
|
|
255
|
-
as:
|
|
256
|
+
as: `use${moduleOptions.autoImportPrefix}FormValidator`
|
|
256
257
|
});
|
|
257
258
|
addImports({
|
|
258
259
|
from: "maz-ui",
|
|
259
260
|
name: "useFormField",
|
|
260
|
-
as:
|
|
261
|
+
as: `use${moduleOptions.autoImportPrefix}FormField`
|
|
261
262
|
});
|
|
262
263
|
}
|
|
263
264
|
if (moduleOptions.injectUseLanguageDisplayNames) {
|
|
264
265
|
addImports({
|
|
265
266
|
from: "maz-ui",
|
|
266
267
|
name: "useLanguageDisplayNames",
|
|
267
|
-
as:
|
|
268
|
+
as: `use${moduleOptions.autoImportPrefix}LanguageDisplayNames`
|
|
268
269
|
});
|
|
269
270
|
}
|
|
270
271
|
if (moduleOptions.defaultMazIconPath) {
|
package/package.json
CHANGED