@mythpe/quasar-ui-qui 0.0.68 → 0.0.70

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.0.68",
3
+ "version": "0.0.70",
4
4
  "description": "MyTh Quasar UI Kit App Extension",
5
5
  "author": {
6
6
  "name": "MyTh Ahmed Faiz",
@@ -51,6 +51,7 @@ interface Props {
51
51
  controlKey?: MDatatableProps['controlKey'];
52
52
  defaultItem?: MDatatableProps['defaultItem'];
53
53
  contextItems?: MDatatableProps['contextItems'];
54
+ contextItemsLength?: MDatatableProps['contextItemsLength'];
54
55
  hideAutoMessage?: MDatatableProps['hideAutoMessage'];
55
56
  headers: MDatatableProps['headers'];
56
57
  serviceName?: MDatatableProps['serviceName'];
@@ -109,6 +110,7 @@ const props = withDefaults(defineProps<Props>(), {
109
110
  controlKey: () => 'control',
110
111
  defaultItem: undefined,
111
112
  contextItems: undefined,
113
+ contextItemsLength: 4,
112
114
  hideAutoMessage: undefined,
113
115
  headers: () => ([]),
114
116
  serviceName: () => '',
@@ -453,10 +455,7 @@ const getRequestWith = (type: 'withIndex' | 'withShow' | 'withUpdate' | 'withSto
453
455
  }
454
456
  return v.join(',') ?? null
455
457
  }
456
- const getDatatableParams = ({
457
- pagination,
458
- filter
459
- }: FetchRowsArgs = {}, merge: Partial<ApiServiceParams> = {}): ApiServiceParams => {
458
+ const getDatatableParams = ({ pagination, filter }: FetchRowsArgs = {}, merge: Partial<ApiServiceParams> = {}): ApiServiceParams => {
460
459
  let params: ApiServiceParams = {
461
460
  // filter: tableOptions.filter,
462
461
  // search: filter || undefined,
@@ -997,14 +996,15 @@ const onRowContextmenu = (e: MouseEvent | Event, row: MDtItem, index: number | u
997
996
  }
998
997
  const contextmenuItemsProp = computed(() => props.contextItems)
999
998
  const contextmenuItems = computed<any>(() => ([
1000
- ...(contextmenuItemsProp.value || []).sort((a, b) => (a.order ?? 0) - (b.order ?? 0)),
999
+ ...(contextmenuItemsProp.value || []),
1001
1000
  {
1002
1001
  name: 'show',
1003
1002
  label: pluginOptions.value?.dt?.contextmenu?.btnStyle?.showLabel ? 'labels.show' : undefined,
1004
1003
  click: (item: MDtItem, index: MDtItemIndex) => {
1005
1004
  openShowDialog(item, index)
1006
1005
  },
1007
- showIf: hasShowBtn.value
1006
+ showIf: hasShowBtn.value,
1007
+ order: 100
1008
1008
  },
1009
1009
  {
1010
1010
  name: 'update',
@@ -1012,7 +1012,8 @@ const contextmenuItems = computed<any>(() => ([
1012
1012
  click: (item: MDtItem, index: MDtItemIndex) => {
1013
1013
  openUpdateDialog(item, index)
1014
1014
  },
1015
- showIf: hasUpdateBtn.value
1015
+ showIf: hasUpdateBtn.value,
1016
+ order: 200
1016
1017
  },
1017
1018
  {
1018
1019
  name: 'destroy',
@@ -1024,9 +1025,10 @@ const contextmenuItems = computed<any>(() => ([
1024
1025
  showIf: hasDestroyBtn.value,
1025
1026
  attr: {
1026
1027
  color: 'negative'
1027
- }
1028
+ },
1029
+ order: 300
1028
1030
  }
1029
- ]))
1031
+ ].sort((a, b) => (a.order ?? 0) - (b.order ?? 0))))
1030
1032
  const endReach = computed<boolean>(() => Boolean(props.endReach))
1031
1033
  const rowsPerPageOptions = computed(() => props.rowsPerPageOptions)
1032
1034
  const getRowsPerPageOptions = computed<any[]>(() => endReach.value ? [0] : (rowsPerPageOptions.value || [0]))
@@ -1899,7 +1901,7 @@ defineOptions({
1899
1901
  <q-td :props="noBodyProps">
1900
1902
  <!--Control-->
1901
1903
  <q-btn-dropdown
1902
- v-if="contextmenuItems.length>3"
1904
+ v-if="contextmenuItems.length>contextItemsLength"
1903
1905
  v-close-popup
1904
1906
  :menu-offset="[0,10]"
1905
1907
  color="primary"
@@ -1929,7 +1931,7 @@ defineOptions({
1929
1931
  </q-btn-dropdown>
1930
1932
  <MRow
1931
1933
  v-else
1932
- class="m--dt-context_menu_items"
1934
+ class="m--dt-context_menu_items justify-end"
1933
1935
  gutter
1934
1936
  space="xs"
1935
1937
  >
@@ -47,6 +47,8 @@ defineOptions({ name: 'MDtContextmenuItems', inheritAttrs: !1 })
47
47
  undefined)"
48
48
  :list-item="itemMode"
49
49
  :tooltip="m.tooltip !== undefined ? m.tooltip : (m.label === undefined ? m.name : undefined)"
50
+ flat
51
+ dense
50
52
  v-bind="m.attr"
51
53
  @click="m.click ? m.click(item,index) : undefined"
52
54
  />
@@ -162,7 +162,8 @@ pre
162
162
  line-height: 1.25rem
163
163
  letter-spacing: 0.03333em
164
164
 
165
- $control-max-width: 250px !default
165
+ $control-max-width: 200px !default
166
+
166
167
  .m--control-cell,
167
168
  .m--control-header
168
- max-width: $control-max-width
169
+ width: $control-max-width
@@ -210,6 +210,7 @@ export type MDatatableProps<I extends GenericFormValues = GenericFormValues> = O
210
210
  controlKey?: string;
211
211
  defaultItem?: Partial<MDtItem<I>>
212
212
  contextItems?: GenericMDtBtn[];
213
+ contextItemsLength?: number;
213
214
  hideAutoMessage?: boolean;
214
215
  headers: string[] | Partial<QTableProps['columns']> | any[];
215
216
  serviceName?: MDtServiceNameStringProp | MDtServiceNameCallbackProp;