@mythpe/quasar-ui-qui 0.4.69 → 0.4.71

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.4.69",
3
+ "version": "0.4.71",
4
4
  "description": "MyTh Quasar UI Kit App Extension",
5
5
  "author": {
6
6
  "name": "MyTh Ahmed Faiz",
@@ -109,6 +109,7 @@ type Props = {
109
109
  noExampleBtn?: MDatatableProps['noExampleBtn'];
110
110
  wrapCells?: MDatatableProps['wrapCells'];
111
111
  tooSmall?: MDatatableProps['tooSmall'];
112
+ color?: MDatatableProps['color'];
112
113
  }
113
114
 
114
115
  const props = withDefaults(defineProps<Props>(), {
@@ -193,7 +194,8 @@ const props = withDefaults(defineProps<Props>(), {
193
194
  importBtn: undefined,
194
195
  noExampleBtn: undefined,
195
196
  wrapCells: undefined,
196
- tooSmall: undefined
197
+ tooSmall: undefined,
198
+ color: 'primary'
197
199
  })
198
200
 
199
201
  interface Emits {
@@ -645,6 +647,7 @@ defineExpose({
645
647
  v-model:pagination="pagination"
646
648
  v-model:selected="selected"
647
649
  :class="['m-datatable',{'m-datatable-grid' : isSmall}]"
650
+ :color="color"
648
651
  :columns="getSortedHeaders"
649
652
  :filter="search"
650
653
  :grid="isGrid"
@@ -656,7 +659,6 @@ defineExpose({
656
659
  :visible-columns="visibleHeaders"
657
660
  :wrap-cells="wrapCellsRef"
658
661
  card-container-class="m-datatable-container"
659
- color="primary"
660
662
  table-class="m-datatable-container"
661
663
  v-bind="bindAttr"
662
664
  @request="fetchDatatableItems"
@@ -1519,7 +1521,6 @@ defineExpose({
1519
1521
  />
1520
1522
  </q-td>
1521
1523
  </template>
1522
-
1523
1524
  <template
1524
1525
  v-for="slotName in getSlots"
1525
1526
  :key="slotName"
@@ -94,6 +94,9 @@ const sarValue = computed<string | null>(() => {
94
94
  })
95
95
  const viewModeAttribute = useFieldValue(() => props.viewModeKey || props.name)
96
96
  const computedViewModeValue = computed<any>(() => {
97
+ if (props.viewModeValue !== undefined) {
98
+ return props.viewModeValue
99
+ }
97
100
  if (props.viewModeKey) {
98
101
  return viewModeAttribute.value
99
102
  }
@@ -14,6 +14,7 @@ import type { MInputSlots, MPhoneProps as Props } from '../../types'
14
14
  import { useMyth } from '../../composable'
15
15
  import MInput from './MInput.vue'
16
16
  import { useQuasar } from 'quasar'
17
+ import type Select from './MAxios.vue'
17
18
 
18
19
  interface P {
19
20
  name: Props['name'];
@@ -38,6 +39,7 @@ interface P {
38
39
  noCountry?: Props['noCountry'];
39
40
  prefix?: Props['prefix'];
40
41
  suffix?: Props['suffix'];
42
+ copy?: Props['copy'];
41
43
  }
42
44
 
43
45
  const props = defineProps<P>()
@@ -47,7 +49,7 @@ const $q = useQuasar()
47
49
  const rtl = computed(() => $q.lang.rtl)
48
50
  const { __ } = useMyth()
49
51
  const getPlaceholder = computed(() => {
50
- return !countryValue.value ? __('replace.choose', { name: __(`attributes.${countryName.value}`) }) : props.placeholder
52
+ return !countryValue.value && !props.readonly ? __('replace.choose', { name: __(`attributes.${countryName.value}`) }) : props.placeholder
51
53
  })
52
54
  const isSmall = computed(() => $q.screen.lt.md)
53
55
  const focus = () => {
@@ -62,6 +64,7 @@ const onSelectCountry = () => {
62
64
  }
63
65
 
64
66
  const phoneRef = useTemplateRef<InstanceType<typeof MInput>>('phoneRef')
67
+ const axiosRef = useTemplateRef<InstanceType<typeof Select>>('axiosRef')
65
68
  const countries = ref<any[]>([])
66
69
  const selectedCountryKey = computed<string | undefined>(() => {
67
70
  if (!countryValue.value) {
@@ -69,6 +72,23 @@ const selectedCountryKey = computed<string | undefined>(() => {
69
72
  }
70
73
  return countries.value.find((e: any) => !!e?.id && e?.id === countryValue.value)?.key || undefined
71
74
  })
75
+ const copyComputed = computed(() => {
76
+ if (!countryValue.value) {
77
+ return !1
78
+ }
79
+ return props.copy
80
+ })
81
+ const countryIconComputed = computed<any>(() => {
82
+ if (props.noIcon) {
83
+ return undefined
84
+ }
85
+ if (!isSmall.value) {
86
+ if (axiosRef.value?.$el?.offsetWidth && axiosRef.value?.$el?.offsetWidth > 199) {
87
+ return 'ion-keypad'
88
+ }
89
+ }
90
+ return undefined
91
+ })
72
92
 
73
93
  interface MPhoneExposed {
74
94
  focus: () => void;
@@ -102,11 +122,13 @@ defineOptions({
102
122
  >
103
123
  <MRow :col="noCountry ? undefined : 'xs'">
104
124
  <MAxios
125
+ ref="axiosRef"
105
126
  v-model:items="countries"
106
127
  :autocomplete="false"
107
128
  :class="['self-start overflow-hidden',{hidden: readonly || !!noCountry,'order-last': $q.lang.rtl}]"
108
129
  :dense="dense"
109
130
  :name="countryName"
131
+ :prepend-icon="countryIconComputed"
110
132
  :required="readonly ? undefined : required"
111
133
  :search-length="searchLength ?? 0"
112
134
  :style="`widthf: ${isSmall ? 150 : 200}px;max-height: 60px;`"
@@ -141,11 +163,12 @@ defineOptions({
141
163
  ...$attrs,
142
164
  required,
143
165
  dense,
144
- viewModeValue: viewModeValue !== undefined ? viewModeValue : getPlaceholder,
145
- placeholder:getPlaceholder,
166
+ viewModeValue: viewModeValue === undefined ? getPlaceholder : viewModeValue,
167
+ placeholder: getPlaceholder,
146
168
  col: (readonly || viewMode || noCountry) ? 12 : 8,
147
169
  viewMode: (readonly || viewMode) ? !0 : !countryValue,
148
170
  readonly: undefined,
171
+ copy: copyComputed,
149
172
  }"
150
173
  >
151
174
  <template