@mythpe/quasar-ui-qui 0.1.85 → 0.1.86

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.1.85",
3
+ "version": "0.1.86",
4
4
  "description": "MyTh Quasar UI Kit App Extension",
5
5
  "author": {
6
6
  "name": "MyTh Ahmed Faiz",
@@ -33,7 +33,6 @@
33
33
  "axios": "^1.7.8",
34
34
  "change-case": "^5.4.4",
35
35
  "ckeditor5": "^43.3.1",
36
- "pluralize": "^8.0.0",
37
36
  "qs": "^6.13.1",
38
37
  "radash": "^12.1.0",
39
38
  "typed.js": "^2.1.0",
@@ -50,7 +49,6 @@
50
49
  "@rollup/plugin-replace": "^6.0.1",
51
50
  "@types/express": "^5.0.0",
52
51
  "@types/node": "^22.10.1",
53
- "@types/pluralize": "^0.0.33",
54
52
  "@typescript-eslint/eslint-plugin": "^7.16.0",
55
53
  "@typescript-eslint/parser": "^7.16.0",
56
54
  "autoprefixer": "^10.4.20",
@@ -11,13 +11,26 @@
11
11
  setup
12
12
  >
13
13
  import type { MInputProps as Props, MInputSlots } from '../../types'
14
- import { useTemplateRef } from 'vue'
14
+ import { computed, toValue, useTemplateRef } from 'vue'
15
15
  import MInput from './MInput.vue'
16
16
  import { useMyth } from '../../composable'
17
17
 
18
18
  const { props: pluginOptions, mobileRule: mobile } = useMyth()
19
19
  const modelValue = defineModel<Props['modelValue']>({ required: !1, default: undefined })
20
20
  const input = useTemplateRef<InstanceType<typeof MInput>>('input')
21
+ const mobileLength = computed(() => {
22
+ const final = toValue(mobile)
23
+ if (typeof final === 'function') {
24
+ return final(modelValue.value)
25
+ }
26
+ if (final === !0) {
27
+ return 10
28
+ }
29
+ if (!final) {
30
+ return undefined
31
+ }
32
+ return parseInt(final?.toString() || '0') || undefined
33
+ })
21
34
  defineExpose<{ input: typeof input }>({ input })
22
35
  defineOptions({
23
36
  name: 'MMobile',
@@ -29,7 +42,15 @@ defineOptions({
29
42
  <MInput
30
43
  ref="input"
31
44
  v-model="modelValue"
32
- v-bind="{ type: 'tel', mobile, maxlength:mobile === !0 ? 10 : (mobile ?? 10), ...pluginOptions.mobile as any, ...$attrs }"
45
+ v-bind="{
46
+ type: 'tel',
47
+ mobile: typeof mobile === 'function' ? mobile(modelValue) : (
48
+ mobile !== !1 && mobile !== undefined && mobile !== null
49
+ ),
50
+ maxlength: mobileLength,
51
+ ...pluginOptions.mobile as any,
52
+ ...$attrs
53
+ }"
33
54
  >
34
55
  <template
35
56
  v-for="(_,slot) in $slots as Readonly<MInputSlots>"
@@ -38,5 +38,5 @@ export interface MythApi {
38
38
  * Default is true.
39
39
  * The Length must be 10.
40
40
  */
41
- mobileRule?: boolean | string | number;
41
+ mobileRule?: boolean | string | number | ((value: unknown) => number | undefined);
42
42
  }