@mythpe/quasar-ui-qui 0.3.2 → 0.3.4

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.2",
3
+ "version": "0.3.4",
4
4
  "description": "MyTh Quasar UI Kit App Extension",
5
5
  "author": {
6
6
  "name": "MyTh Ahmed Faiz",
@@ -90,6 +90,7 @@ type Props = {
90
90
  copyColumns?: MDatatableProps['copyColumns'];
91
91
  descColumns?: MDatatableProps['descColumns'];
92
92
  help?: MDatatableProps['help'];
93
+ noWrapBtn?: boolean;
93
94
  }
94
95
 
95
96
  const props = withDefaults(defineProps<Props>(), {
@@ -158,7 +159,8 @@ const props = withDefaults(defineProps<Props>(), {
158
159
  sarColumns: undefined,
159
160
  copyColumns: undefined,
160
161
  descColumns: undefined,
161
- help: undefined
162
+ help: undefined,
163
+ noWrapBtn: undefined
162
164
  })
163
165
 
164
166
  interface Emits {
@@ -408,7 +410,12 @@ const colorColumnsProp = computed<string[]>(() => toValue(props.colorColumns ||
408
410
  const sarColumnsProp = computed<string[]>(() => toValue(props.sarColumns || []))
409
411
  const copyColumnsProp = computed<string[]>(() => toValue(props.copyColumns || []))
410
412
  const descColumnsProp = computed<string[]>(() => toValue(props.descColumns || []))
411
- onMounted(() => refresh())
413
+ const noWrapBtnProp = computed(() => getProp.value('noWrapBtn'))
414
+ const wrapCellsRef = ref<boolean>(!1)
415
+ onMounted(() => {
416
+ wrapCellsRef.value = getProp.value('wrapCells') ?? !1
417
+ refresh()
418
+ })
412
419
  watch(loading, v => {
413
420
  if (pluginOptions.value?.dt?.useQuasarLoading) {
414
421
  if (v) {
@@ -540,13 +547,13 @@ defineExpose({
540
547
  table-class="m-datatable-container"
541
548
  v-bind="{
542
549
  virtualScroll: !0,
543
- wrapCells:!0,
544
550
  ...pluginOptions.datatable as any,
545
551
  ...$attrs as any,
546
552
  title: getTableTitle,
547
553
  bordered: bordered === undefined ? pluginOptions.datatable?.bordered : bordered,
548
554
  dense: dense === undefined ? ( theme.inputs.dense !== undefined ? theme.inputs.dense : pluginOptions.datatable?.dense) : dense,
549
555
  flat: flat === undefined ? pluginOptions.datatable?.flat : flat,
556
+ wrapCells: wrapCellsRef,
550
557
  } as any"
551
558
  @request="fetchDatatableItems"
552
559
  @update:selected="onUpdateSelectedItems"
@@ -608,6 +615,7 @@ defineExpose({
608
615
  >
609
616
  <template v-if="imageColumnsProp.indexOf(col.name) !== -1">
610
617
  <MDtImageColumn
618
+ v-if="col.value !== undefined && col.value !== null"
611
619
  :image-mode="getProp('imageMode')"
612
620
  :image-size="getProp('imageSize')"
613
621
  :value="col.value"
@@ -616,18 +624,26 @@ defineExpose({
616
624
  </template>
617
625
  <template v-else-if="urlColumnsProp.indexOf(col.name) !== -1">
618
626
  <MDtUrlColumn
627
+ v-if="col.value !== undefined && col.value !== null"
619
628
  :value="col.value"
620
629
  @click="openWindow(col.value)"
621
630
  />
622
631
  </template>
623
632
  <template v-else-if="colorColumnsProp.indexOf(col.name) !== -1">
624
- <MDtColorColumn :value="col.value" />
633
+ <MDtColorColumn
634
+ v-if="col.value !== undefined && col.value !== null"
635
+ :value="col.value"
636
+ />
625
637
  </template>
626
638
  <template v-else-if="sarColumnsProp.indexOf(col.name) !== -1">
627
- <MDtSarColumn :value="col.value" />
639
+ <MDtSarColumn
640
+ v-if="col.value !== undefined && col.value !== null"
641
+ :value="col.value"
642
+ />
628
643
  </template>
629
644
  <template v-else-if="copyColumnsProp.indexOf(col.name) !== -1">
630
645
  <MDtCopyColumn
646
+ v-if="col.value !== undefined && col.value !== null"
631
647
  :label="col.value"
632
648
  :value="col.value"
633
649
  />
@@ -878,7 +894,6 @@ defineExpose({
878
894
  {{ __('myth.titles.exportPdf') }}
879
895
  </q-tooltip>
880
896
  </MDtBtn>
881
-
882
897
  <!-- Export Excel-->
883
898
  <MDtBtn
884
899
  v-if="excel && getRows.length > 0"
@@ -891,7 +906,6 @@ defineExpose({
891
906
  {{ __('myth.titles.exportExcel') }}
892
907
  </q-tooltip>
893
908
  </MDtBtn>
894
-
895
909
  <!-- Filter dialog -->
896
910
  <MDtBtn
897
911
  v-if="hasFilterDialog"
@@ -904,6 +918,7 @@ defineExpose({
904
918
  >
905
919
  <MModalMenu
906
920
  v-model="filterDialogModel"
921
+ :offset="[10,10]"
907
922
  no-close-btn
908
923
  persistent
909
924
  position="top"
@@ -961,7 +976,6 @@ defineExpose({
961
976
  </q-card>
962
977
  </MModalMenu>
963
978
  </MDtBtn>
964
-
965
979
  <!--Refresh-->
966
980
  <MDtBtn
967
981
  v-if="!noRefreshBtn"
@@ -972,7 +986,6 @@ defineExpose({
972
986
  v-bind="{...defaultTopBtnProps,...pluginOptions.dt?.buttons?.refresh as any}"
973
987
  @click="refreshNoUpdate()"
974
988
  />
975
-
976
989
  <!--Fullscreen-->
977
990
  <MDtBtn
978
991
  v-if="fullscreenBtn === undefined ? ( !!pluginOptions.datatable?.fullscreenBtn) : fullscreenBtn"
@@ -1036,72 +1049,80 @@ defineExpose({
1036
1049
  </template>
1037
1050
  </template>
1038
1051
 
1052
+ <q-space />
1039
1053
  <!-- Manage Columns -->
1040
- <template v-if="manageColumns">
1041
- <q-space />
1042
- <MDtBtn
1043
- key="manage-columns-btn"
1044
- :disable="loading"
1045
- color="brand"
1046
- icon="ion-ios-desktop"
1047
- label="myth.datatable.columnsToShow"
1048
- text-color="on-brand"
1049
- tooltip="myth.datatable.columnsToShowCaption"
1054
+ <MDtBtn
1055
+ v-if="manageColumns"
1056
+ key="manage-columns-btn"
1057
+ :disable="loading"
1058
+ color="brand"
1059
+ icon="ion-ios-desktop"
1060
+ label="myth.datatable.columnsToShow"
1061
+ text-color="on-brand"
1062
+ tooltip="myth.datatable.columnsToShowCaption"
1063
+ >
1064
+ <MModalMenu
1065
+ :no-close-btn="$q.screen.gt.xs"
1066
+ :offset="[10,10]"
1050
1067
  >
1051
- <MModalMenu
1052
- :no-close-btn="$q.screen.gt.xs"
1053
- :offset="[10,10]"
1054
- >
1055
- <q-card style="min-width: 250px; max-width: 900px">
1056
- <q-card-section>
1057
- <div class="text-body1 q-mb-md">
1058
- {{ __('myth.datatable.columnsToShow') }}
1059
- </div>
1060
- <div class="text-body2">
1061
- <q-icon name="ion-ios-information-circle-outline" />
1062
- {{ __('myth.datatable.columnsToShowCaption') }}
1063
- </div>
1064
- </q-card-section>
1065
- <q-card-section>
1066
- <template
1067
- v-for="h in getHeaders"
1068
- :key="h.name"
1069
- >
1070
- <q-checkbox
1071
- v-model="visibleHeaders"
1072
- :disable="visibleHeaders.length < 2 && visibleHeaders.indexOf(h.name) !== -1"
1073
- :label="h.label"
1074
- :val="h.name"
1075
- />
1076
- </template>
1077
- </q-card-section>
1078
- <q-card-section>
1079
- <MBtn
1080
- v-if="$q.screen.gt.xs"
1081
- v-close-popup
1082
- :class="{'q-mr-sm': !$q.screen.xs}"
1083
- color="brand"
1084
- label="labels.close"
1085
- no-caps
1086
- style="min-width: 100px"
1087
- text-color="on-brand"
1088
- unelevated
1089
- />
1090
- <MBtn
1091
- :class="{'full-width': $q.screen.xs}"
1092
- :label="__(`labels.${visibleHeaders.length === getHeaders.length ? 'unselect':'select'}_all`)"
1093
- color="brand"
1094
- no-caps
1095
- style="min-width: 100px"
1096
- text-color="on-brand"
1097
- unelevated
1098
- @click="onManageColumnsClick()"
1068
+ <q-card style="min-width: 250px; max-width: 900px">
1069
+ <q-card-section>
1070
+ <div class="text-body1 q-mb-md">
1071
+ {{ __('myth.datatable.columnsToShow') }}
1072
+ </div>
1073
+ <div class="text-body2">
1074
+ <q-icon name="ion-ios-information-circle-outline" />
1075
+ {{ __('myth.datatable.columnsToShowCaption') }}
1076
+ </div>
1077
+ </q-card-section>
1078
+ <q-card-section>
1079
+ <template
1080
+ v-for="h in getHeaders"
1081
+ :key="h.name"
1082
+ >
1083
+ <q-checkbox
1084
+ v-model="visibleHeaders"
1085
+ :disable="visibleHeaders.length < 2 && visibleHeaders.indexOf(h.name) !== -1"
1086
+ :label="h.label"
1087
+ :val="h.name"
1099
1088
  />
1100
- </q-card-section>
1101
- </q-card>
1102
- </MModalMenu>
1103
- </MDtBtn>
1104
- </template>
1089
+ </template>
1090
+ </q-card-section>
1091
+ <q-card-section>
1092
+ <MBtn
1093
+ v-if="$q.screen.gt.xs"
1094
+ v-close-popup
1095
+ :class="{'q-mr-sm': !$q.screen.xs}"
1096
+ color="brand"
1097
+ label="labels.close"
1098
+ no-caps
1099
+ style="min-width: 100px"
1100
+ text-color="on-brand"
1101
+ unelevated
1102
+ />
1103
+ <MBtn
1104
+ :class="{'full-width': $q.screen.xs}"
1105
+ :label="__(`labels.${visibleHeaders.length === getHeaders.length ? 'unselect':'select'}_all`)"
1106
+ color="brand"
1107
+ no-caps
1108
+ style="min-width: 100px"
1109
+ text-color="on-brand"
1110
+ unelevated
1111
+ @click="onManageColumnsClick()"
1112
+ />
1113
+ </q-card-section>
1114
+ </q-card>
1115
+ </MModalMenu>
1116
+ </MDtBtn>
1117
+ <!-- Wrap Btn -->
1118
+ <MDtBtn
1119
+ v-if="!noWrapBtnProp"
1120
+ :icon="`ion-ios-${!wrapCellsRef ? 'grid' : 'list'}`"
1121
+ color="brand"
1122
+ flat
1123
+ text-color="brand"
1124
+ @click="wrapCellsRef = !wrapCellsRef"
1125
+ />
1105
1126
  </MRow>
1106
1127
 
1107
1128
  <!-- Manage Columns -->
@@ -1268,6 +1289,7 @@ defineExpose({
1268
1289
  >
1269
1290
  <q-td :props="imageColProps">
1270
1291
  <MDtImageColumn
1292
+ v-if="imageColProps.row[imageColProps.col.field] !== undefined && imageColProps.row[imageColProps.col.field] !== null"
1271
1293
  :image-mode="getProp('imageMode')"
1272
1294
  :image-size="getProp('imageSize')"
1273
1295
  :value="imageColProps.row[imageColProps.col.field]"
@@ -1282,6 +1304,7 @@ defineExpose({
1282
1304
  >
1283
1305
  <q-td :props="urlProps">
1284
1306
  <MDtUrlColumn
1307
+ v-if="urlProps.row[urlProps.col.field] !== undefined && urlProps.row[urlProps.col.field] !== null"
1285
1308
  :value="urlProps.row[urlProps.col.field]"
1286
1309
  @click="openWindow(urlProps.row[urlProps.col.field])"
1287
1310
  />
@@ -1293,7 +1316,10 @@ defineExpose({
1293
1316
  #[`body-cell-${cc}`]="ccProps"
1294
1317
  >
1295
1318
  <q-td :props="ccProps">
1296
- <MDtColorColumn :value="ccProps.row[ccProps.col.field]" />
1319
+ <MDtColorColumn
1320
+ v-if="ccProps.row[ccProps.col.field] !== undefined && ccProps.row[ccProps.col.field] !== null"
1321
+ :value="ccProps.row[ccProps.col.field]"
1322
+ />
1297
1323
  </q-td>
1298
1324
  </template>
1299
1325
  <template
@@ -1302,7 +1328,10 @@ defineExpose({
1302
1328
  #[`body-cell-${sr}`]="srProps"
1303
1329
  >
1304
1330
  <q-td :props="srProps">
1305
- <MDtSarColumn :value="srProps.row[srProps.col.field]" />
1331
+ <MDtSarColumn
1332
+ v-if="srProps.row[srProps.col.field] !== undefined && srProps.row[srProps.col.field] !== null"
1333
+ :value="srProps.row[srProps.col.field]"
1334
+ />
1306
1335
  </q-td>
1307
1336
  </template>
1308
1337
  <template
@@ -1312,12 +1341,12 @@ defineExpose({
1312
1341
  >
1313
1342
  <q-td :props="copyColumnProps">
1314
1343
  <MDtCopyColumn
1344
+ v-if="copyColumnProps.row[copyColumnProps.col.field] !== undefined && copyColumnProps.row[copyColumnProps.col.field] !== null"
1315
1345
  :label="copyColumnProps.row[copyColumnProps.col.field]"
1316
1346
  :value="copyColumnProps.row[copyColumnProps.col.field]"
1317
1347
  />
1318
1348
  </q-td>
1319
1349
  </template>
1320
-
1321
1350
  <template
1322
1351
  v-for="cdd in descColumnsProp"
1323
1352
  :key="`a-cdd-body-cell-${cdd}`"
@@ -1325,6 +1354,7 @@ defineExpose({
1325
1354
  >
1326
1355
  <q-td :props="descColumnProps">
1327
1356
  <MDtDescColumn
1357
+ v-if="descColumnProps.row[descColumnProps.col.field] !== undefined && descColumnProps.row[descColumnProps.col.field] !== null"
1328
1358
  :value="descColumnProps.row[descColumnProps.col.field]"
1329
1359
  />
1330
1360
  </q-td>
@@ -1345,13 +1375,6 @@ defineExpose({
1345
1375
  />
1346
1376
  </template>
1347
1377
  </q-table>
1348
- <q-inner-loading
1349
- :label="__('labels.plz_wait')"
1350
- :showing="loading"
1351
- color="brand"
1352
- label-class="text-brand"
1353
- label-style="font-size: 1.1em"
1354
- />
1355
1378
  <slot
1356
1379
  :dt="datatableItemsScope"
1357
1380
  :form="useFormContext"
@@ -1610,5 +1633,10 @@ defineExpose({
1610
1633
  </MTooltip>
1611
1634
  </q-btn>
1612
1635
  </q-page-sticky>
1636
+
1637
+ <MInnerLoading
1638
+ :showing="loading && !search"
1639
+ style="z-index: 10000"
1640
+ />
1613
1641
  </div>
1614
1642
  </template>
@@ -18,7 +18,7 @@ interface Props {
18
18
  }
19
19
 
20
20
  defineProps<Props>()
21
- const { __, copyText } = useMyth()
21
+ const { copyText } = useMyth()
22
22
  defineOptions({
23
23
  name: 'MDtCopyColumn',
24
24
  inheritAttrs: !1
@@ -26,8 +26,8 @@ defineOptions({
26
26
  </script>
27
27
 
28
28
  <template>
29
- <div
30
- class="row q-gutter-md items-center justify-center"
29
+ <MRow
30
+ class="items-center justify-center"
31
31
  v-bind="$attrs"
32
32
  >
33
33
  <div
@@ -49,5 +49,5 @@ defineOptions({
49
49
  </q-tooltip>
50
50
  </div>
51
51
  <slot />
52
- </div>
52
+ </MRow>
53
53
  </template>
@@ -139,8 +139,9 @@ onMounted(() => {
139
139
  prepare()
140
140
  } else {
141
141
  if (fieldValue.value) {
142
+ const id = typeof fieldValue.value === 'object' ? fieldValue.value.value : fieldValue.value
142
143
  setTimeout(() => {
143
- prepare(!1, { filter: { id: fieldValue.value } })
144
+ prepare(!1, { filter: { id } })
144
145
  }, 300)
145
146
  }
146
147
  }
@@ -328,6 +328,10 @@ export type MDatatableProps<I extends GenericFormValues = GenericFormValues> = O
328
328
  * Help Tooltip
329
329
  */
330
330
  help?: string;
331
+ /**
332
+ * Show, hide wrap the button in the table.
333
+ */
334
+ noWrapBtn?: boolean;
331
335
  }
332
336
 
333
337
  export interface MDtAvatarProps extends QAvatarProps {