@mythpe/quasar-ui-qui 0.4.4 → 0.4.6

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.4",
3
+ "version": "0.4.6",
4
4
  "description": "MyTh Quasar UI Kit App Extension",
5
5
  "author": {
6
6
  "name": "MyTh Ahmed Faiz",
@@ -103,6 +103,7 @@ type Props = {
103
103
  align?: MDatatableProps['align'];
104
104
  importBtn?: MDatatableProps['importBtn'];
105
105
  noExampleBtn?: MDatatableProps['noExampleBtn'];
106
+ wrapCells?: MDatatableProps['wrapCells'];
106
107
  }
107
108
 
108
109
  const props = withDefaults(defineProps<Props>(), {
@@ -182,7 +183,8 @@ const props = withDefaults(defineProps<Props>(), {
182
183
  lockValue: undefined,
183
184
  align: 'left',
184
185
  importBtn: undefined,
185
- noExampleBtn: undefined
186
+ noExampleBtn: undefined,
187
+ wrapCells: undefined
186
188
  })
187
189
 
188
190
  interface Emits {
@@ -482,8 +484,7 @@ const mainAttrs = computed(() => ({
482
484
  title: getTableTitle.value,
483
485
  bordered: props.bordered === undefined ? pluginOptions.value.datatable?.bordered : props.bordered,
484
486
  dense: props.dense === undefined ? (theme.value?.inputs?.dense !== undefined ? theme.value.inputs.dense : pluginOptions.value.datatable?.dense) : props.dense,
485
- flat: props.flat === undefined ? pluginOptions.value.datatable?.flat : props.flat,
486
- wrapCells: wrapCellsRef.value
487
+ flat: props.flat === undefined ? pluginOptions.value.datatable?.flat : props.flat
487
488
  }))
488
489
  const attrs = useAttrs()
489
490
  const bindAttr = computed(() => ({
@@ -622,6 +623,7 @@ defineExpose({
622
623
  :rows-per-page-options="getRowsPerPageOptions"
623
624
  :selection="getShowSelection ? (multiSelection ? 'multiple' : 'single') : 'none'"
624
625
  :visible-columns="visibleHeaders"
626
+ :wrap-cells="wrapCellsRef"
625
627
  card-container-class="m-datatable-container"
626
628
  color="primary"
627
629
  table-class="m-datatable-container"
@@ -9,7 +9,7 @@
9
9
  <script lang="ts" setup>
10
10
 
11
11
  import { useFieldValue } from 'vee-validate'
12
- import { computed, useTemplateRef } from 'vue'
12
+ import { computed, ref, useTemplateRef } from 'vue'
13
13
  import type { MInputSlots, MPhoneProps as Props } from '../../types'
14
14
  import { useMyth } from '../../composable'
15
15
  import MInput from './MInput.vue'
@@ -36,12 +36,15 @@ interface P {
36
36
  noIcon?: Props['noIcon'];
37
37
  selectProps?: Props['selectProps'];
38
38
  noCountry?: Props['noCountry'];
39
+ prefix?: Props['prefix'];
40
+ suffix?: Props['suffix'];
39
41
  }
40
42
 
41
43
  const props = defineProps<P>()
42
44
  const countryName = computed(() => props.countryPhone || `${props.name}_country`)
43
45
  const countryValue = useFieldValue(countryName)
44
46
  const $q = useQuasar()
47
+ const rtl = computed(() => $q.lang.rtl)
45
48
  const { __ } = useMyth()
46
49
  const getPlaceholder = computed(() => {
47
50
  return !countryValue.value ? __('replace.choose', { name: __(`attributes.${countryName.value}`) }) : props.placeholder
@@ -58,6 +61,13 @@ const onSelectCountry = () => {
58
61
  }
59
62
 
60
63
  const phoneRef = useTemplateRef<InstanceType<typeof MInput>>('phoneRef')
64
+ const countries = ref<any[]>([])
65
+ const selectedCountryKey = computed<string | undefined>(() => {
66
+ if (!countryValue.value) {
67
+ return undefined
68
+ }
69
+ return countries.value.find((e: any) => !!e?.id && e?.id === countryValue.value)?.key || undefined
70
+ })
61
71
 
62
72
  interface MPhoneExposed {
63
73
  focus: () => void;
@@ -92,6 +102,7 @@ defineOptions({
92
102
  >
93
103
  <MRow :col="noCountry ? undefined : !0">
94
104
  <MAxios
105
+ v-model:items="countries"
95
106
  :autocomplete="false"
96
107
  :class="['self-start overflow-hidden',{hidden: readonly || !!noCountry,'order-last': $q.lang.rtl}]"
97
108
  :dense="dense"
@@ -121,6 +132,8 @@ defineOptions({
121
132
  :ltr="!!countryValue"
122
133
  :mobile="mobile === undefined ? !1 : mobile"
123
134
  :name="name"
135
+ :prefix="noCountry ? (prefix ?? (!rtl ? (selectedCountryKey ?? prefix) : prefix)) : prefix"
136
+ :suffix="noCountry ? (suffix ?? (rtl ? (selectedCountryKey ?? suffix) : suffix)) : suffix"
124
137
  prepend-icon="ion-ios-phone-portrait"
125
138
  stack-label
126
139
  type="text"