@mythpe/quasar-ui-qui 0.3.7 → 0.3.9

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mythpe/quasar-ui-qui",
3
- "version": "0.3.7",
3
+ "version": "0.3.9",
4
4
  "description": "MyTh Quasar UI Kit App Extension",
5
5
  "author": {
6
6
  "name": "MyTh Ahmed Faiz",
@@ -128,7 +128,7 @@ export const useBindInput = <P extends G = G> (Props: MaybeRefOrGetter<P>, key:
128
128
  if (typeof props.images === 'string' && props.images?.length > 0) {
129
129
  l.push(props.images)
130
130
  } else {
131
- l.push('image/png,image/jpg,image/jpeg')
131
+ l.push('image/png,image/jpg,image/jpeg,image/webp')
132
132
  }
133
133
  }
134
134
  if (props.svg) {
@@ -290,7 +290,28 @@ export const useMyth = () => {
290
290
  }
291
291
  return `${attr} ${value};`
292
292
  }
293
+ const dimension = (options?: {
294
+ width?: string | number;
295
+ height?: string | number;
296
+ ratio?: string | number;
297
+ }): number | null => {
298
+ const is = (v: any): v is number | string => v !== undefined && v !== null
299
+ let { width, height, ratio } = options || {}
300
+ ratio = is(ratio) ? (typeof ratio === 'string' ? parseFloat(ratio) : ratio) : undefined
301
+ height = is(height) ? (typeof height === 'string' ? parseFloat(height) : height) : undefined
302
+ width = is(width) ? (typeof width === 'string' ? parseFloat(width) : width) : undefined
303
+ if (is(width) && is(height)) {
304
+ return width / height
305
+ }
306
+ if (is(ratio) && is(height)) {
307
+ return ratio * height
308
+ }
309
+ if (is(ratio) && is(width)) {
310
+ return width / ratio
311
+ }
293
312
 
313
+ return null
314
+ }
294
315
  return {
295
316
  __,
296
317
  getPageTitle,
@@ -306,6 +327,7 @@ export const useMyth = () => {
306
327
  veeRules,
307
328
  isSmall,
308
329
  colorStyle,
330
+ dimension,
309
331
  ...plugin
310
332
  }
311
333
  }
@@ -1,6 +0,0 @@
1
- export const useColor = () => {
2
- const toColors = (color: any) => {
3
-
4
- }
5
- return { toColors }
6
- }