@vuetify/v0 0.0.16 → 0.0.20
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/README.md +125 -47
- package/dist/browser/index.js +1801 -1604
- package/dist/components/index.d.mts +4 -4
- package/dist/components/index.mjs +6 -6
- package/dist/{components-Dk00OFL2.mjs → components-D590hSY0.mjs} +151 -54
- package/dist/composables/index.d.mts +4 -4
- package/dist/composables/index.mjs +5 -5
- package/dist/{composables-YOUVfUsn.mjs → composables-FE6B8JUW.mjs} +370 -303
- package/dist/constants/index.d.mts +1 -1
- package/dist/constants/index.mjs +3 -3
- package/dist/{globals-Rnihe4SF.mjs → globals-exvZ8fiO.mjs} +1 -1
- package/dist/index-4jSy8KIt.d.mts +73 -0
- package/dist/{index-BzW68rBC.d.mts → index-BYyEPh1S.d.mts} +227 -17
- package/dist/index-CjzlIAtF.d.mts +296 -0
- package/dist/{index-BeJMYhId.d.mts → index-DahjxaTj.d.mts} +899 -136
- package/dist/{index-BulceeMA.d.mts → index-Gr6XPRWt.d.mts} +50 -18
- package/dist/index.d.mts +7 -7
- package/dist/index.mjs +8 -8
- package/dist/types/index.d.mts +1 -1
- package/dist/{useStep-Bqhi_DDs.mjs → useStep-Dw7XloDM.mjs} +1067 -1258
- package/dist/utilities/index.d.mts +2 -2
- package/dist/utilities/index.mjs +1 -1
- package/dist/utilities-BrFKLHFS.mjs +363 -0
- package/package.json +3 -3
- package/dist/index-BXN7M6o_.d.mts +0 -71
- package/dist/index-Bd3J4RNS.d.mts +0 -11
- package/dist/utilities-DQWf_4V_.mjs +0 -139
- /package/dist/{constants-BWV0uYsM.mjs → constants-DypzAkYp.mjs} +0 -0
- /package/dist/{htmlElements-BYo-fMlZ.mjs → htmlElements-CXObxj0V.mjs} +0 -0
- /package/dist/{index-B6lIRI3i.d.mts → index-B9mKi4pr.d.mts} +0 -0
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
import { n as DeepPartial } from "./index-4jSy8KIt.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/utilities/helpers.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Checks if a value is a function
|
|
7
|
+
*
|
|
8
|
+
* @param item The value to check
|
|
9
|
+
* @returns True if the value is a function
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* isFunction(() => {}) // true
|
|
14
|
+
* isFunction('string') // false
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
declare function isFunction(item: unknown): item is Function;
|
|
18
|
+
/**
|
|
19
|
+
* Checks if a value is a string
|
|
20
|
+
*
|
|
21
|
+
* @param item The value to check
|
|
22
|
+
* @returns True if the value is a string
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* isString('hello') // true
|
|
27
|
+
* isString(123) // false
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
declare function isString(item: unknown): item is string;
|
|
31
|
+
/**
|
|
32
|
+
* Checks if a value is a number
|
|
33
|
+
*
|
|
34
|
+
* @param item The value to check
|
|
35
|
+
* @returns True if the value is a number (including NaN)
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```ts
|
|
39
|
+
* isNumber(123) // true
|
|
40
|
+
* isNumber(NaN) // true
|
|
41
|
+
* isNumber('123') // false
|
|
42
|
+
* ```
|
|
43
|
+
*
|
|
44
|
+
* @see {@link isNaN} to check for NaN specifically
|
|
45
|
+
*/
|
|
46
|
+
declare function isNumber(item: unknown): item is number;
|
|
47
|
+
/**
|
|
48
|
+
* Checks if a value is a boolean
|
|
49
|
+
*
|
|
50
|
+
* @param item The value to check
|
|
51
|
+
* @returns True if the value is a boolean
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```ts
|
|
55
|
+
* isBoolean(true) // true
|
|
56
|
+
* isBoolean(false) // true
|
|
57
|
+
* isBoolean(0) // false
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
declare function isBoolean(item: unknown): item is boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Checks if a value is a plain object (excludes null and arrays)
|
|
63
|
+
*
|
|
64
|
+
* @param item The value to check
|
|
65
|
+
* @returns True if the value is a plain object
|
|
66
|
+
*
|
|
67
|
+
* @remarks
|
|
68
|
+
* Returns false for null and arrays, even though `typeof null === 'object'`
|
|
69
|
+
* and `typeof [] === 'object'` in JavaScript.
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* ```ts
|
|
73
|
+
* isObject({}) // true
|
|
74
|
+
* isObject({ a: 1 }) // true
|
|
75
|
+
* isObject(null) // false
|
|
76
|
+
* isObject([]) // false
|
|
77
|
+
* ```
|
|
78
|
+
*
|
|
79
|
+
* @see {@link isArray} to check for arrays
|
|
80
|
+
* @see {@link isNull} to check for null
|
|
81
|
+
*/
|
|
82
|
+
declare function isObject(item: unknown): item is Record<string, unknown>;
|
|
83
|
+
/**
|
|
84
|
+
* Checks if a value is an array
|
|
85
|
+
*
|
|
86
|
+
* @param item The value to check
|
|
87
|
+
* @returns True if the value is an array
|
|
88
|
+
*
|
|
89
|
+
* @example
|
|
90
|
+
* ```ts
|
|
91
|
+
* isArray([]) // true
|
|
92
|
+
* isArray([1, 2, 3]) // true
|
|
93
|
+
* isArray('string') // false
|
|
94
|
+
* ```
|
|
95
|
+
*/
|
|
96
|
+
declare function isArray(item: unknown): item is unknown[];
|
|
97
|
+
/**
|
|
98
|
+
* Checks if a value is null
|
|
99
|
+
*
|
|
100
|
+
* @param item The value to check
|
|
101
|
+
* @returns True if the value is null
|
|
102
|
+
*
|
|
103
|
+
* @example
|
|
104
|
+
* ```ts
|
|
105
|
+
* isNull(null) // true
|
|
106
|
+
* isNull(undefined) // false
|
|
107
|
+
* ```
|
|
108
|
+
*
|
|
109
|
+
* @see {@link isUndefined} to check for undefined
|
|
110
|
+
* @see {@link isNullOrUndefined} to check for either
|
|
111
|
+
*/
|
|
112
|
+
declare function isNull(item: unknown): item is null;
|
|
113
|
+
/**
|
|
114
|
+
* Checks if a value is null or undefined
|
|
115
|
+
*
|
|
116
|
+
* @param item The value to check
|
|
117
|
+
* @returns True if the value is null or undefined
|
|
118
|
+
*
|
|
119
|
+
* @remarks
|
|
120
|
+
* Uses loose equality (`== null`) which matches both null and undefined.
|
|
121
|
+
*
|
|
122
|
+
* @example
|
|
123
|
+
* ```ts
|
|
124
|
+
* isNullOrUndefined(null) // true
|
|
125
|
+
* isNullOrUndefined(undefined) // true
|
|
126
|
+
* isNullOrUndefined(0) // false
|
|
127
|
+
* isNullOrUndefined('') // false
|
|
128
|
+
* ```
|
|
129
|
+
*
|
|
130
|
+
* @see {@link isNull} to check for null only
|
|
131
|
+
* @see {@link isUndefined} to check for undefined only
|
|
132
|
+
*/
|
|
133
|
+
declare function isNullOrUndefined(item: unknown): item is null | undefined;
|
|
134
|
+
/**
|
|
135
|
+
* Checks if a value is undefined
|
|
136
|
+
*
|
|
137
|
+
* @param item The value to check
|
|
138
|
+
* @returns True if the value is undefined
|
|
139
|
+
*
|
|
140
|
+
* @example
|
|
141
|
+
* ```ts
|
|
142
|
+
* isUndefined(undefined) // true
|
|
143
|
+
* isUndefined(null) // false
|
|
144
|
+
* ```
|
|
145
|
+
*
|
|
146
|
+
* @see {@link isNull} to check for null
|
|
147
|
+
* @see {@link isNullOrUndefined} to check for either
|
|
148
|
+
*/
|
|
149
|
+
declare function isUndefined(item: unknown): item is undefined;
|
|
150
|
+
/**
|
|
151
|
+
* Checks if a value is a primitive (string, number, or boolean)
|
|
152
|
+
*
|
|
153
|
+
* @param item The value to check
|
|
154
|
+
* @returns True if the value is a string, number, or boolean
|
|
155
|
+
*
|
|
156
|
+
* @example
|
|
157
|
+
* ```ts
|
|
158
|
+
* isPrimitive('hello') // true
|
|
159
|
+
* isPrimitive(123) // true
|
|
160
|
+
* isPrimitive(true) // true
|
|
161
|
+
* isPrimitive({}) // false
|
|
162
|
+
* isPrimitive(null) // false
|
|
163
|
+
* ```
|
|
164
|
+
*/
|
|
165
|
+
declare function isPrimitive(item: unknown): item is string | number | boolean;
|
|
166
|
+
/**
|
|
167
|
+
* Checks if a value is a symbol
|
|
168
|
+
*
|
|
169
|
+
* @param item The value to check
|
|
170
|
+
* @returns True if the value is a symbol
|
|
171
|
+
*
|
|
172
|
+
* @example
|
|
173
|
+
* ```ts
|
|
174
|
+
* isSymbol(Symbol('test')) // true
|
|
175
|
+
* isSymbol('symbol') // false
|
|
176
|
+
* ```
|
|
177
|
+
*/
|
|
178
|
+
declare function isSymbol(item: unknown): item is symbol;
|
|
179
|
+
/**
|
|
180
|
+
* Checks if a value is NaN (Not a Number)
|
|
181
|
+
*
|
|
182
|
+
* @param item The value to check
|
|
183
|
+
* @returns True if the value is NaN
|
|
184
|
+
*
|
|
185
|
+
* @remarks
|
|
186
|
+
* Uses `Number.isNaN()` which only returns true for the actual NaN value,
|
|
187
|
+
* unlike the global `isNaN()` which coerces the argument to a number first.
|
|
188
|
+
*
|
|
189
|
+
* @example
|
|
190
|
+
* ```ts
|
|
191
|
+
* isNaN(NaN) // true
|
|
192
|
+
* isNaN(123) // false
|
|
193
|
+
* isNaN('hello') // false (unlike global isNaN)
|
|
194
|
+
* isNaN(undefined) // false (unlike global isNaN)
|
|
195
|
+
* ```
|
|
196
|
+
*
|
|
197
|
+
* @see {@link isNumber} to check if a value is a number type
|
|
198
|
+
*/
|
|
199
|
+
declare function isNaN(item: unknown): item is number;
|
|
200
|
+
/**
|
|
201
|
+
* Deeply merges source objects into a target object
|
|
202
|
+
*
|
|
203
|
+
* @param target The target object to merge into (will be mutated)
|
|
204
|
+
* @param sources One or more source objects to merge from
|
|
205
|
+
* @returns The mutated target object
|
|
206
|
+
*
|
|
207
|
+
* @remarks
|
|
208
|
+
* - Mutates the target object in place
|
|
209
|
+
* - Nested objects are recursively merged
|
|
210
|
+
* - Arrays are replaced, not merged
|
|
211
|
+
* - Primitives from sources overwrite target values
|
|
212
|
+
*
|
|
213
|
+
* @example
|
|
214
|
+
* ```ts
|
|
215
|
+
* const target = { a: 1, b: { c: 2 } }
|
|
216
|
+
* mergeDeep(target, { b: { d: 3 } })
|
|
217
|
+
* // target is now { a: 1, b: { c: 2, d: 3 } }
|
|
218
|
+
*
|
|
219
|
+
* // Multiple sources
|
|
220
|
+
* mergeDeep({}, { a: 1 }, { b: 2 }) // { a: 1, b: 2 }
|
|
221
|
+
*
|
|
222
|
+
* // Arrays are replaced
|
|
223
|
+
* mergeDeep({ arr: [1, 2] }, { arr: [3] }) // { arr: [3] }
|
|
224
|
+
* ```
|
|
225
|
+
*/
|
|
226
|
+
declare function mergeDeep<T extends object>(target: T, ...sources: DeepPartial<T>[]): T;
|
|
227
|
+
/**
|
|
228
|
+
* Generates a random 7-character alphanumeric ID
|
|
229
|
+
*
|
|
230
|
+
* @returns A random string of 7 characters (a-z, 0-9)
|
|
231
|
+
*
|
|
232
|
+
* @remarks
|
|
233
|
+
* Uses `Math.random()` converted to base-36. Not cryptographically secure.
|
|
234
|
+
* Suitable for unique keys in UI components, not for security purposes.
|
|
235
|
+
*
|
|
236
|
+
* @example
|
|
237
|
+
* ```ts
|
|
238
|
+
* genId() // 'k7x9m2p'
|
|
239
|
+
* genId() // 'a3b8c1d'
|
|
240
|
+
* ```
|
|
241
|
+
*/
|
|
242
|
+
declare function genId(): string;
|
|
243
|
+
/**
|
|
244
|
+
* Clamps a value between a minimum and maximum
|
|
245
|
+
*
|
|
246
|
+
* @param value The value to clamp
|
|
247
|
+
* @param min The minimum value (default: 0)
|
|
248
|
+
* @param max The maximum value (default: 1)
|
|
249
|
+
* @returns The clamped value
|
|
250
|
+
*
|
|
251
|
+
* @example
|
|
252
|
+
* ```ts
|
|
253
|
+
* clamp(5, 0, 10) // 5
|
|
254
|
+
* clamp(-5, 0, 10) // 0
|
|
255
|
+
* clamp(15, 0, 10) // 10
|
|
256
|
+
* ```
|
|
257
|
+
*/
|
|
258
|
+
declare function clamp(value: number, min?: number, max?: number): number;
|
|
259
|
+
/**
|
|
260
|
+
* Creates an array of sequential numbers
|
|
261
|
+
*
|
|
262
|
+
* @param length The length of the array to create
|
|
263
|
+
* @param start The starting index (default: 0)
|
|
264
|
+
* @returns An array of sequential numbers
|
|
265
|
+
*
|
|
266
|
+
* @example
|
|
267
|
+
* ```ts
|
|
268
|
+
* range(3) // [0, 1, 2]
|
|
269
|
+
* range(3, 1) // [1, 2, 3]
|
|
270
|
+
* range(5, 10) // [10, 11, 12, 13, 14]
|
|
271
|
+
* range(0) // []
|
|
272
|
+
* ```
|
|
273
|
+
*/
|
|
274
|
+
declare function range(length: number, start?: number): number[];
|
|
275
|
+
/**
|
|
276
|
+
* Debounces a function call by the specified delay
|
|
277
|
+
*
|
|
278
|
+
* @param fn The function to debounce
|
|
279
|
+
* @param delay The delay in milliseconds
|
|
280
|
+
* @returns A debounced function with clear and immediate methods
|
|
281
|
+
*
|
|
282
|
+
* @example
|
|
283
|
+
* ```ts
|
|
284
|
+
* const debouncedFn = debounce(() => console.log('called'), 500)
|
|
285
|
+
* debouncedFn() // Will call after 500ms
|
|
286
|
+
* debouncedFn.clear() // Cancel pending call
|
|
287
|
+
* debouncedFn.immediate() // Call immediately
|
|
288
|
+
* ```
|
|
289
|
+
*/
|
|
290
|
+
declare function debounce<T extends (...args: any[]) => any>(fn: T, delay: number): {
|
|
291
|
+
(...args: Parameters<T>): void;
|
|
292
|
+
clear(): void;
|
|
293
|
+
immediate(...args: Parameters<T>): void;
|
|
294
|
+
};
|
|
295
|
+
//#endregion
|
|
296
|
+
export { range as _, isBoolean as a, isNull as c, isObject as d, isPrimitive as f, mergeDeep as g, isUndefined as h, isArray as i, isNullOrUndefined as l, isSymbol as m, debounce as n, isFunction as o, isString as p, genId as r, isNaN as s, clamp as t, isNumber as u };
|