@mythpe/quasar-ui-qui 0.3.49 → 0.3.50

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.3.49",
3
+ "version": "0.3.50",
4
4
  "description": "MyTh Quasar UI Kit App Extension",
5
5
  "author": {
6
6
  "name": "MyTh Ahmed Faiz",
@@ -92,6 +92,8 @@ type Props = {
92
92
  copyColumns?: MDatatableProps['copyColumns'];
93
93
  descColumns?: MDatatableProps['descColumns'];
94
94
  help?: MDatatableProps['help'];
95
+ subtitle?: MDatatableProps['subtitle'];
96
+ subtitleClass?: MDatatableProps['subtitleClass'];
95
97
  noWrapBtn?: boolean;
96
98
  lockValue?: MDatatableProps['lockValue'];
97
99
  align?: MDatatableProps['align'];
@@ -165,6 +167,8 @@ const props = withDefaults(defineProps<Props>(), {
165
167
  copyColumns: undefined,
166
168
  descColumns: undefined,
167
169
  help: undefined,
170
+ subtitle: undefined,
171
+ subtitleClass: undefined,
168
172
  noWrapBtn: undefined,
169
173
  lockValue: undefined,
170
174
  align: 'left'
@@ -722,6 +726,7 @@ defineExpose({
722
726
  <template #top="topSlotProps">
723
727
  <MCol col="12">
724
728
  <MContainer :fluid="!1">
729
+ <!--Top Slot-->
725
730
  <slot
726
731
  :dt="datatableItemsScope"
727
732
  :form="useFormContext"
@@ -730,7 +735,9 @@ defineExpose({
730
735
  name="top"
731
736
  v-bind="topSlotProps"
732
737
  />
738
+ <!--Title and Search-->
733
739
  <MRow col>
740
+ <!--Default Title Slot-->
734
741
  <slot
735
742
  :dt="datatableItemsScope"
736
743
  :form="useFormContext"
@@ -739,47 +746,74 @@ defineExpose({
739
746
  name="title"
740
747
  >
741
748
  <MCol col="12">
742
- <div class="row justify-between q-col-gutter-md">
743
- <div
744
- v-if="!noBackBtn"
745
- class="col-auto"
746
- >
747
- <q-btn
748
- :icon="backIcon || `ion-arrow-round-${$q.lang.rtl ? 'forward' : 'back'}`"
749
- flat
750
- @click="$router.back()"
751
- />
752
- </div>
753
- <div class="col">
754
- <div
755
- v-if="!!getTableTitle"
756
- class="text-h5 bordered-bottom ellipsis"
749
+ <q-card class="q-mb-xl">
750
+ <q-card-section>
751
+ <MRow
752
+ class="justify-between"
753
+ col="md"
757
754
  >
758
- <span>{{ getTableTitle }}</span>
759
- <span v-if="!!help">
760
- <q-icon
761
- class="cursor-pointer"
762
- name="ion-ios-information-circle-outline"
763
- right
764
- size="18px"
755
+ <!--Back Button-->
756
+ <MCol
757
+ v-if="!noBackBtn"
758
+ auto
759
+ >
760
+ <q-btn
761
+ :icon="backIcon || `ion-ios-arrow-${$q.lang.rtl ? 'forward' : 'back'}`"
762
+ flat
763
+ @click="$router.back()"
764
+ />
765
+ </MCol>
766
+ <!--Table Title-->
767
+ <MCol col>
768
+ <div
769
+ v-if="!!getTableTitle"
770
+ class="text-h5 ellipsis"
765
771
  >
766
- <q-tooltip>{{ __(help) }}</q-tooltip>
767
- </q-icon>
768
- </span>
769
- </div>
770
- </div>
771
- <!-- Add Btn -->
772
- <div
773
- v-if="hasAddBtn && (addTopBtn===undefined?(pluginOptions.datatable?.addTopBtn===undefined?!0:pluginOptions.datatable?.addTopBtn):addTopBtn)"
774
- class="col-auto"
775
- >
776
- <MBtn
777
- :label="getFormTitle"
778
- no-caps
779
- @click="openCreateDialog()"
780
- />
781
- </div>
782
- </div>
772
+ <span>{{ getTableTitle }}</span>
773
+ <span v-if="!!help">
774
+ <q-icon
775
+ class="cursor-pointer"
776
+ name="ion-ios-information-circle-outline"
777
+ right
778
+ size="18px"
779
+ >
780
+ <q-tooltip>
781
+ <div class="text-body1">
782
+ {{ __(help) }}
783
+ </div>
784
+ </q-tooltip>
785
+ </q-icon>
786
+ </span>
787
+ </div>
788
+ <slot
789
+ :dt="datatableItemsScope"
790
+ :form="useFormContext"
791
+ :index="dialogItemIndex"
792
+ :item="dialogItem"
793
+ name="subtitle"
794
+ >
795
+ <div
796
+ v-if="!!subtitle"
797
+ :class="subtitleClass"
798
+ >
799
+ {{ __(subtitle) }}
800
+ </div>
801
+ </slot>
802
+ </MCol>
803
+ <!-- Add Btn -->
804
+ <MCol
805
+ v-if="hasAddBtn && (addTopBtn===undefined?(pluginOptions.datatable?.addTopBtn===undefined?!0:pluginOptions.datatable?.addTopBtn):addTopBtn)"
806
+ auto
807
+ >
808
+ <MBtn
809
+ :label="getFormTitle"
810
+ no-caps
811
+ @click="openCreateDialog()"
812
+ />
813
+ </MCol>
814
+ </MRow>
815
+ </q-card-section>
816
+ </q-card>
783
817
  </MCol>
784
818
  </slot>
785
819
  <slot
@@ -930,6 +964,7 @@ defineExpose({
930
964
  name="bottom-search"
931
965
  />
932
966
  </MRow>
967
+
933
968
  <!--Buttons-->
934
969
  <MRow
935
970
  class="items-center justify-between"
@@ -1457,57 +1492,6 @@ defineExpose({
1457
1492
  />
1458
1493
  </q-pull-to-refresh>
1459
1494
 
1460
- <!-- Show Dialog -->
1461
- <MDialog
1462
- v-model="showDialogModel"
1463
- v-bind="pluginOptions.dt?.showDialogProps"
1464
- >
1465
- <q-card class="m-dialog-card">
1466
- <q-card-section ref="showTitleRef">
1467
- <q-toolbar>
1468
- <q-toolbar-title>
1469
- <q-btn
1470
- :icon="`ion-ios-arrow-${$q.lang.rtl ? 'forward' : 'back'}`"
1471
- fab-mini
1472
- flat
1473
- @click="closeShowDialog()"
1474
- >
1475
- <q-tooltip class="m-dt-btn-tooltip">
1476
- {{ __('myth.titles.back') }}
1477
- </q-tooltip>
1478
- </q-btn>
1479
- {{ getShowTitle }}
1480
- </q-toolbar-title>
1481
- </q-toolbar>
1482
- </q-card-section>
1483
- <q-separator />
1484
- <q-card-section
1485
- :style="`height: ${($q.screen.height || 100) - 3 - (($refs.showActionsRef as any)?.$el?.offsetHeight || 60) - (($refs.showTitleRef as any)?.$el?.offsetHeight || 80)}px`"
1486
- class="scroll m-datatable__dialog-show-container"
1487
- >
1488
- <slot
1489
- :dt="datatableItemsScope"
1490
- :form="useFormContext"
1491
- :index="dialogItemIndex"
1492
- :item="dialogItem"
1493
- name="show"
1494
- />
1495
- </q-card-section>
1496
- <q-separator />
1497
- <q-card-actions
1498
- ref="showActionsRef"
1499
- align="left"
1500
- class="print-hide"
1501
- >
1502
- <MBtn
1503
- label="myth.titles.close"
1504
- v-bind="pluginOptions.dt?.dialogButtonsProps"
1505
- @click="closeShowDialog"
1506
- />
1507
- </q-card-actions>
1508
- </q-card>
1509
- </MDialog>
1510
-
1511
1495
  <!-- Form Dialog -->
1512
1496
  <MDialog
1513
1497
  v-model="formDialogModel"
@@ -1635,6 +1619,57 @@ defineExpose({
1635
1619
  </div>
1636
1620
  </MDialog>
1637
1621
 
1622
+ <!-- Show Dialog -->
1623
+ <MDialog
1624
+ v-model="showDialogModel"
1625
+ v-bind="pluginOptions.dt?.showDialogProps"
1626
+ >
1627
+ <q-card class="m-dialog-card">
1628
+ <q-card-section ref="showTitleRef">
1629
+ <q-toolbar>
1630
+ <q-toolbar-title>
1631
+ <q-btn
1632
+ :icon="`ion-ios-arrow-${$q.lang.rtl ? 'forward' : 'back'}`"
1633
+ fab-mini
1634
+ flat
1635
+ @click="closeShowDialog()"
1636
+ >
1637
+ <q-tooltip class="m-dt-btn-tooltip">
1638
+ {{ __('myth.titles.back') }}
1639
+ </q-tooltip>
1640
+ </q-btn>
1641
+ {{ getShowTitle }}
1642
+ </q-toolbar-title>
1643
+ </q-toolbar>
1644
+ </q-card-section>
1645
+ <q-separator />
1646
+ <q-card-section
1647
+ :style="`height: ${($q.screen.height || 100) - 3 - (($refs.showActionsRef as any)?.$el?.offsetHeight || 60) - (($refs.showTitleRef as any)?.$el?.offsetHeight || 80)}px`"
1648
+ class="scroll m-datatable__dialog-show-container"
1649
+ >
1650
+ <slot
1651
+ :dt="datatableItemsScope"
1652
+ :form="useFormContext"
1653
+ :index="dialogItemIndex"
1654
+ :item="dialogItem"
1655
+ name="show"
1656
+ />
1657
+ </q-card-section>
1658
+ <q-separator />
1659
+ <q-card-actions
1660
+ ref="showActionsRef"
1661
+ align="left"
1662
+ class="print-hide"
1663
+ >
1664
+ <MBtn
1665
+ label="myth.titles.close"
1666
+ v-bind="pluginOptions.dt?.dialogButtonsProps"
1667
+ @click="closeShowDialog"
1668
+ />
1669
+ </q-card-actions>
1670
+ </q-card>
1671
+ </MDialog>
1672
+
1638
1673
  <!-- Image Dialog -->
1639
1674
  <MDialog v-model="imageDialog.value">
1640
1675
  <q-card>
@@ -45,14 +45,13 @@ defineOptions({
45
45
 
46
46
  <template>
47
47
  <q-dialog
48
- :transition-hide="$q.screen.lt.md ? slideHide : (slideProp ? slideHide : 'jump-down')"
49
- :transition-show="$q.screen.lt.md ? slideShow : (slideProp ? slideShow : 'jump-up')"
48
+ :transition-hide="$q.screen.lt.md ? slideHide : (slideProp ? slideHide : 'slide-down')"
49
+ :transition-show="$q.screen.lt.md ? slideShow : (slideProp ? slideShow : 'slide-up')"
50
50
  allow-focus-outside
51
51
  maximized
52
52
  no-backdrop-dismiss
53
53
  no-esc-dismiss
54
54
  no-shake
55
- persistent
56
55
  v-bind="{...pluginOptions.dialog,...$attrs}"
57
56
  >
58
57
  <slot />
@@ -7,7 +7,7 @@
7
7
  */
8
8
 
9
9
  import type { AxiosResponse } from 'axios'
10
- import type { NamedColor, QAvatarProps, QAvatarSlots, QTableProps, QTableSlots } from 'quasar'
10
+ import type { NamedColor, QAvatarProps, QAvatarSlots, QTableProps, QTableSlots, VueClassProp } from 'quasar'
11
11
  import type { ComputedRef, MaybeRef, MaybeRefOrGetter, Ref, UnwrapNestedRefs, UnwrapRef, VNode } from 'vue'
12
12
  import type { RouteLocationRaw } from 'vue-router'
13
13
  import type { StubSchema } from './api-helpers'
@@ -192,17 +192,26 @@ type MDatatableSlotFn<T = any> = (scope: T) => VNode[];
192
192
 
193
193
  export interface MDatatableSlots extends Omit<QTableSlots, 'top'> {
194
194
  tools: MDatatableSlotFn<{ dt: MDatatableScope }>;
195
- selection: MDatatableSlotFn<{ dt: MDatatableScope }>;
195
+ selection: MDatatableSlotFn<MDatatableMainScope>;
196
196
  filter: MDatatableSlotFn<{ filter: MDatatableFilterForm } & MDatatableMainScope>;
197
197
  show: MDatatableSlotFn<MDatatableMainScope>;
198
198
  form: MDatatableSlotFn<MDatatableMainScope>;
199
199
  'form-actions': MDatatableSlotFn<MDatatableMainScope>;
200
200
  title: MDatatableSlotFn<MDatatableMainScope>;
201
+ subtitle: MDatatableSlotFn<MDatatableMainScope>;
202
+ top: MDatatableSlotFn<MDatatableMainScope & Parameters<QTableSlots['top']>[0]>;
201
203
  'top-search': MDatatableSlotFn<MDatatableMainScope>;
202
204
  'bottom-search': MDatatableSlotFn<MDatatableMainScope>;
205
+ 'form-title': MDatatableSlotFn<MDatatableMainScope>;
206
+ 'form-title-left': MDatatableSlotFn<MDatatableMainScope>;
207
+ 'form-title-right': MDatatableSlotFn<MDatatableMainScope>;
203
208
 
204
209
  [key: `body-cell-${string}`]: MDatatableSlotFn<
205
- Parameters<QTableSlots['body-cell']>[0] & { dt: MDatatableScope }
210
+ Parameters<QTableSlots['body-cell']>[0] & MDatatableMainScope
211
+ >;
212
+
213
+ [key: `header-cell-${string}`]: MDatatableSlotFn<
214
+ Parameters<QTableSlots['header-cell']>[0] & MDatatableMainScope
206
215
  >;
207
216
  }
208
217
 
@@ -329,6 +338,14 @@ export type MDatatableProps<I extends GenericFormValues = GenericFormValues> = O
329
338
  * Help Tooltip
330
339
  */
331
340
  help?: string;
341
+ /**
342
+ * Subtitle of table
343
+ */
344
+ subtitle?: string;
345
+ /**
346
+ * Subtitle of class
347
+ */
348
+ subtitleClass?: VueClassProp;
332
349
  /**
333
350
  * Show, hide wrap the button in the table.
334
351
  */