@mythpe/quasar-ui-qui 0.1.53 → 0.1.55

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.53",
3
+ "version": "0.1.55",
4
4
  "description": "MyTh Quasar UI Kit App Extension",
5
5
  "author": {
6
6
  "name": "MyTh Ahmed Faiz",
@@ -13,7 +13,7 @@
13
13
  import type { MDatatableProps } from '../../types'
14
14
  import type { InvalidSubmissionHandler, SubmissionHandler } from 'vee-validate'
15
15
  import { useForm } from 'vee-validate'
16
- import { onMounted, ref, toValue, watch } from 'vue'
16
+ import { computed, onMounted, ref, toValue, watch } from 'vue'
17
17
  import { is as quasarHelpers, QCardSection, QTable, useQuasar } from 'quasar'
18
18
  import lodash from 'lodash'
19
19
  import { useDtHelpers, useMyth } from '../../composable'
@@ -380,7 +380,9 @@ watch(formDialogModel, (v) => {
380
380
  dialogErrors.value = {}
381
381
  }
382
382
  })
383
-
383
+ const activeContextItems = computed(() => {
384
+ return contextmenuItems.value.filter((e, i) => typeof e.showIf === 'function' ? e.showIf(e, i) : e.showIf !== !1) as Required<MDatatableProps['contextItems']> || []
385
+ })
384
386
  const table = ref<InstanceType<typeof QTable>>()
385
387
  defineOptions({
386
388
  name: 'MDatatable',
@@ -451,7 +453,7 @@ defineExpose({
451
453
  :key="i"
452
454
  >
453
455
  <MDtBtn
454
- v-if="typeof contextmenuItem.showIf === 'function' ? contextmenuItem.showIf(dialogItem,dialogItemIndex) : contextmenuItem.showIf"
456
+ v-if="typeof contextmenuItem.showIf === 'function' ? contextmenuItem.showIf(dialogItem,dialogItemIndex) : contextmenuItem.showIf !== !1"
455
457
  :[contextmenuItem.name]="!0"
456
458
  :dense="dense === undefined ? (theme.buttons.dense !== undefined ? theme.buttons.dense : pluginOptions.datatable?.dense) : dense"
457
459
  :label="contextmenuItem.contextLabel !== undefined ? (contextmenuItem.contextLabel === null ? undefined : __(contextmenuItem.contextLabel)) : __(contextmenuItem.label || contextmenuItem.name) "
@@ -967,7 +969,8 @@ defineExpose({
967
969
  :key="`top-s-${i}`"
968
970
  >
969
971
  <MDtBtn
970
- v-if="(typeof contextBtn.showIf === 'function' ? contextBtn.showIf(selected[0],0) : contextBtn.showIf) && ( (contextBtn.click && isSingleSelectedItem) || (contextBtn.multiClick && !isSingleSelectedItem) )"
972
+ v-if="(typeof contextBtn.showIf === 'function' ? contextBtn.showIf(selected[0],0) : contextBtn.showIf !==!1) && ( (contextBtn.click && isSingleSelectedItem)
973
+ || (contextBtn.multiClick && !isSingleSelectedItem) )"
971
974
  :tooltip="contextBtn.tooltip?__(contextBtn.tooltip):(contextBtn.label?(te(`labels.${contextBtn.label}`) ?
972
975
  __(`labels.${contextBtn.label}`) : __(contextBtn.label) ):undefined)"
973
976
  v-bind="{...defaultTopBtnProps,...pluginOptions.dt?.topSelection?.btn as any,...contextBtn as any,...contextBtn.attr as any}"
@@ -1098,7 +1101,7 @@ defineExpose({
1098
1101
  <q-td :props="noBodyProps">
1099
1102
  <!--Control-->
1100
1103
  <q-btn-dropdown
1101
- v-if="contextmenuItems.length > contextItemsLength"
1104
+ v-if="activeContextItems.length > contextItemsLength"
1102
1105
  v-close-popup
1103
1106
  :menu-offset="[0,10]"
1104
1107
  color="primary"
@@ -13,6 +13,7 @@
13
13
 
14
14
  import { computed } from 'vue'
15
15
  import { useMyth } from '../../composable'
16
+ import type { NamedColor } from 'quasar'
16
17
 
17
18
  interface Props {
18
19
  show?: boolean | undefined;
@@ -20,7 +21,7 @@ interface Props {
20
21
  destroy?: boolean | undefined;
21
22
  clone?: boolean | undefined;
22
23
  tooltip?: string | null | undefined;
23
- color?: string | undefined;
24
+ color?: NamedColor | undefined;
24
25
  icon?: string | undefined;
25
26
  listItem?: boolean | undefined;
26
27
  label?: string | undefined;
@@ -46,7 +46,7 @@ defineOptions({
46
46
  :key="`MDtContextmenuItems-i${i}`"
47
47
  >
48
48
  <MDtBtn
49
- v-if="typeof m.showIf === 'function' ? m.showIf(item,index) : m.showIf"
49
+ v-if="typeof m.showIf === 'function' ? m.showIf(item,index) : m.showIf !== !1"
50
50
  :[m.name]="!0"
51
51
  :label="itemMode&&m.label===undefined?(te(`labels.${m.name}`)?__(`labels.${m.name}`):__(m.tooltip || m.attr?.label || m.attr?.tooltip || m.name)):(m.label!==undefined?__(m.label || m.name):undefined)"
52
52
  :list-item="itemMode"
@@ -33,6 +33,7 @@ defineOptions({
33
33
  }"
34
34
  v-bind="$attrs"
35
35
  >
36
+ <slot name="before" />
36
37
  <div class="m--input__top-label__content">
37
38
  {{ label !== undefined ? __(label) : field?.label }}
38
39
  </div>
@@ -132,18 +132,21 @@ defineOptions({
132
132
  v-if="!!getLabel && (!viewMode || (theme.topLabel || getProp('topLabel')))"
133
133
  :field="scopes"
134
134
  >
135
- <MHelpRow
136
- v-if="!!help"
137
- :text="help"
138
- tooltip
139
- />
140
- <template v-if="loading">
141
- <div class="flex-break" />
142
- <q-spinner-dots
143
- class="q-mt-lg q-ml-lg"
144
- color="primary"
145
- size="22px"
135
+ <template #default>
136
+ <MHelpRow
137
+ v-if="!!help"
138
+ :text="help"
139
+ class="q-ml-lg"
140
+ tooltip
146
141
  />
142
+ <template v-if="loading">
143
+ <div class="flex-break" />
144
+ <q-spinner-dots
145
+ class="q-mt-lg q-ml-lg"
146
+ color="primary"
147
+ size="22px"
148
+ />
149
+ </template>
147
150
  </template>
148
151
  </MInputLabel>
149
152
  </slot>
@@ -29,6 +29,7 @@ defineOptions({
29
29
  <div
30
30
  v-if="text || tooltip"
31
31
  class="m--help-row row"
32
+ v-bind="$attrs"
32
33
  >
33
34
  <div class="col-auto">
34
35
  <q-icon
@@ -174,6 +174,7 @@ defineOptions({ name: 'MUploaderItem' })
174
174
  :ratio="1"
175
175
  :src="modelValue.__img ? modelValue.__img.src : mediaProp.url"
176
176
  fit="contain"
177
+ no-spinner
177
178
  />
178
179
  <q-icon
179
180
  v-else
@@ -208,6 +208,7 @@ export type MInputFieldControlSlots = {
208
208
  export type MInputLabelProps = BaseInputFieldProps
209
209
 
210
210
  export type MInputLabelSlots = {
211
+ before?: () => VNode[];
211
212
  default?: () => VNode[];
212
213
  }
213
214
 
@@ -7,7 +7,7 @@
7
7
  */
8
8
 
9
9
  import type { AxiosResponse } from 'axios'
10
- import type { QAvatarProps, QAvatarSlots, QTableProps, QTableSlots } from 'quasar'
10
+ import type { NamedColor, QAvatarProps, QAvatarSlots, QTableProps, QTableSlots } from 'quasar'
11
11
  import type { ComputedRef, MaybeRef, Ref, UnwrapNestedRefs, UnwrapRef, VNode } from 'vue'
12
12
  import type { RouteLocationRaw } from 'vue-router'
13
13
  import type { GenericFormValues, MBtnProps, MBtnSlots, MFormSlots } from './components'
@@ -117,7 +117,7 @@ export interface MDtBtnProps extends MBtnProps {
117
117
  clone?: boolean;
118
118
  destroy?: boolean;
119
119
  tooltip?: string | undefined;
120
- color?: string;
120
+ color?: NamedColor | undefined;
121
121
  icon?: string;
122
122
  listItem?: boolean;
123
123
  fabMini?: boolean;
@@ -169,7 +169,7 @@ export type GenericMDtBtn<T extends E = E> = Record<string, any> & {
169
169
  multiClick?: (items: T[]) => void;
170
170
  showIf?: boolean | ((item: UnwrapRef<MDatatableDialogsOptions['item']>, index: UnwrapRef<MDatatableDialogsOptions['index']>) => boolean);
171
171
  order?: number;
172
- attr?: Partial<MDtBtnProps> & Partial<{ icon?: string; textColor?: string; color?: string; }>;
172
+ attr?: Partial<MDtBtnProps> & Partial<{ icon?: string; textColor?: NamedColor | undefined; color?: NamedColor | undefined; }>;
173
173
  }
174
174
 
175
175
  type MDatatableFormScope = Parameters<MFormSlots['default']>[0]
@@ -1,4 +1,4 @@
1
- import type { QBtnProps, QInputProps } from 'quasar'
1
+ import type { NamedColor, QBtnProps, QInputProps } from 'quasar'
2
2
 
3
3
  export type ThemeSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'none' | string;
4
4
  export type ThemeShadow = string | number | 'transition' | 'none';
@@ -51,7 +51,7 @@ export type Theme = {
51
51
 
52
52
  export type ButtonLoadingOptions = {
53
53
  type: 'audio' | 'ball' | 'bars' | 'box' | 'clock' | 'comment' | 'cube' | 'dots' | 'facebook' | 'gears' | 'grid' | 'hearts' | 'hourglass' | 'infinity' | 'ios' | 'orbit' | 'oval' | 'pie' | 'puff' | 'radio' | 'rings' | 'tail' | 'spinner';
54
- color?: string | undefined;
54
+ color?: NamedColor | undefined;
55
55
  size?: string | undefined;
56
56
  label?: boolean;
57
57
  }