@mythpe/quasar-ui-qui 0.4.101 → 0.4.103

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.101",
3
+ "version": "0.4.103",
4
4
  "description": "MyTh Quasar UI Kit App Extension",
5
5
  "author": {
6
6
  "name": "MyTh Ahmed Faiz",
@@ -14,7 +14,7 @@ import type { ApiInterface, GenericMDtBtn, MDatatableProps, MDtExportOptions } f
14
14
  import type { InvalidSubmissionHandler, SubmissionHandler } from 'vee-validate'
15
15
  import { useForm } from 'vee-validate'
16
16
  import { computed, nextTick, onMounted, ref, toValue, useAttrs, watch } from 'vue'
17
- import { is as quasarHelpers, QCardSection, QTable, useQuasar } from 'quasar'
17
+ import { extend, is as quasarHelpers, QCardSection, QTable, useQuasar } from 'quasar'
18
18
  import { useDtHelpers, useMyth } from '../../composable'
19
19
  import { useI18n } from 'vue-i18n'
20
20
  import MDtImageColumn from './MDtImageColumn.vue'
@@ -418,7 +418,7 @@ const onSuccess: SubmissionHandler = async (form) => {
418
418
  if (isUpdateMode.value) {
419
419
  if (_data) {
420
420
  updateDatatableItem(_data as any, dialogItemIndex.value)
421
- resetVeeForm({ ...defaultItem.value, ..._data })
421
+ await resetVeeForm(extend(!0, {}, defaultItem.value, _data as any))
422
422
  }
423
423
  emit('update', response)
424
424
  if (!props.noUpdateClose && !props.noAutoClose) {
@@ -774,9 +774,9 @@ defineExpose({
774
774
  :align="col.align as any"
775
775
  :copy="computedCopyColumns.includes(col.name)"
776
776
  :copy-value="col.copyValue && typeof col.copyValue === 'function' ? () => col.copyValue(itemProps.row) : itemProps.row[col.copyValue || col.field]"
777
+ :digits="col.digits"
777
778
  :string="col.field.includes('_to_string') || col.field.includes('ToString') || col.string === !0"
778
779
  :value="col.value"
779
- :digits="col.digits"
780
780
  />
781
781
  </template>
782
782
  <template v-else-if="computedDescColumns.indexOf(col.name) !== -1">
@@ -1486,9 +1486,9 @@ defineExpose({
1486
1486
  :align="sarCellProps.col.align as any"
1487
1487
  :copy="computedCopyColumns.includes(sarCellProps.col.name)"
1488
1488
  :copy-value="sarCellProps.col.copyValue && typeof sarCellProps.col.copyValue === 'function' ? () => sarCellProps.col.copyValue(sarCellProps.row) : sarCellProps.row[sarCellProps.col.copyValue || sarCellProps.col.field]"
1489
+ :digits="sarCellProps.col.digits"
1489
1490
  :string="sarCellProps.col.field.includes('_to_string') || sarCellProps.col.field.includes('ToString') || sarCellProps.col.string === !0"
1490
1491
  :value="sarCellProps.row[sarCellProps.col.field]"
1491
- :digits="sarCellProps.col.digits"
1492
1492
  />
1493
1493
  </q-td>
1494
1494
  </template>
@@ -36,6 +36,7 @@ type P = {
36
36
  searchLength?: Props['searchLength'];
37
37
  required?: Props['required'];
38
38
  multiple?: Props['multiple'];
39
+ copy?: boolean;
39
40
  }
40
41
 
41
42
  const props = withDefaults(defineProps<P>(), {
@@ -55,7 +56,8 @@ const props = withDefaults(defineProps<P>(), {
55
56
  byId: undefined,
56
57
  searchLength: undefined,
57
58
  required: undefined,
58
- multiple: undefined
59
+ multiple: undefined,
60
+ copy: undefined
59
61
  })
60
62
  const modelValue = defineModel<Props['modelValue']>({ required: !1, default: undefined })
61
63
  type Emits = {
@@ -188,6 +190,7 @@ defineOptions({ name: 'MAxios', inheritAttrs: !1 })
188
190
  v-model="modelValue"
189
191
  v-model:loading="loading"
190
192
  v-model:search="search"
193
+ :copy="copy"
191
194
  :label="label"
192
195
  :multiple="multiple"
193
196
  :name="name"
@@ -48,7 +48,7 @@ interface P {
48
48
  prependIconProps?: Props['prependIconProps'];
49
49
  appendIcon?: Props['appendIcon'];
50
50
  appendIconProps?: Props['appendIconProps'];
51
- copy?: Props['copy'];
51
+ copy?: boolean;
52
52
  type?: Props['type'];
53
53
  ltr?: Props['ltr'];
54
54
  rtl?: Props['rtl'];
@@ -39,7 +39,7 @@ interface P {
39
39
  noCountry?: Props['noCountry'];
40
40
  prefix?: Props['prefix'];
41
41
  suffix?: Props['suffix'];
42
- copy?: Props['copy'];
42
+ copy?: boolean;
43
43
  }
44
44
 
45
45
  const props = defineProps<P>()
@@ -64,6 +64,7 @@ type P = {
64
64
  prependIconProps?: Props['prependIconProps'];
65
65
  appendIcon?: Props['appendIcon'];
66
66
  appendIconProps?: Props['appendIconProps'];
67
+ copy?: boolean;
67
68
  }
68
69
 
69
70
  const props = withDefaults(defineProps<P>(), {
@@ -112,7 +113,8 @@ const props = withDefaults(defineProps<P>(), {
112
113
  prependIcon: undefined,
113
114
  prependIconProps: undefined,
114
115
  appendIcon: undefined,
115
- appendIconProps: undefined
116
+ appendIconProps: undefined,
117
+ copy: undefined
116
118
  })
117
119
  defineModel<Props['modelValue']>({ required: !1, default: undefined })
118
120
 
@@ -122,7 +124,7 @@ type Emits = {
122
124
  const emit = defineEmits<Emits>()
123
125
  const $q = useQuasar()
124
126
 
125
- const { __, props: pluginOptions } = useMyth()
127
+ const { __, props: pluginOptions, copyText } = useMyth()
126
128
  const helper = useBindInput<P & Props>(() => props, 'select', () => ({ choose: !0 }))
127
129
  const { theme, hasTopLabel, getLabel, getAutocompleteAttribute, inputRules, getProp } = helper
128
130
  const inputScope = useField<Props['modelValue']>(() => props.name, inputRules, {
@@ -326,6 +328,22 @@ defineOptions({
326
328
  v-bind="appendIconProps"
327
329
  />
328
330
  </template>
331
+ <template
332
+ v-else-if="copy && !!getViewModeValue && viewMode"
333
+ #append
334
+ >
335
+ <q-btn
336
+ flat
337
+ icon="ion-copy"
338
+ round
339
+ size="sm"
340
+ @click="copyText(getViewModeValue)"
341
+ >
342
+ <q-tooltip v-if="!!getViewModeValue">
343
+ {{ __('labels.copy') }}
344
+ </q-tooltip>
345
+ </q-btn>
346
+ </template>
329
347
  <template
330
348
  v-if="!hideEmptyList"
331
349
  #no-option
@@ -33,6 +33,11 @@ export interface MSelectProps extends Omit<QSelectProps, 'rules' | 'name' | 'mod
33
33
  * dont use default loading slot.
34
34
  */
35
35
  noLoading?: boolean;
36
+ /**
37
+ * Show copy button.
38
+ * Default: false.
39
+ */
40
+ copy?: boolean;
36
41
  }
37
42
 
38
43
  type ItemsScope = { items: any[], value: any };