@mythpe/quasar-ui-qui 0.1.10 → 0.1.11

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.10",
3
+ "version": "0.1.11",
4
4
  "description": "MyTh Quasar UI Kit App Extension",
5
5
  "author": {
6
6
  "name": "MyTh Ahmed Faiz",
@@ -284,8 +284,10 @@ const resetDialogs = () => {
284
284
  /** --- */
285
285
  const headersProp = computed(() => props.headers)
286
286
  const getHeaders = computed<any[]>(() => parseHeaders(headersProp.value, reactive({ noSort: props.imageColumns })) || [])
287
- const visibleColumnsProp = computed(() => props.visibleColumns)
288
- const visibleHeaders = ref(parseHeaders(visibleColumnsProp.value || headersProp.value).map(e => e.name))
287
+ const visibleHeaders = ref<string[]>(parseHeaders(props.visibleColumns || headersProp.value).map(e => e.name))
288
+ watch(() => toValue(props.visibleColumns), v => {
289
+ visibleHeaders.value = v ? parseHeaders(v).map(e => e.name) : []
290
+ }, { deep: !0 })
289
291
  /** --- */
290
292
 
291
293
  const selected = ref<MDtItem[]>([])
@@ -334,7 +336,7 @@ const tableOptions = reactive<MDatatableOptions>({
334
336
  /** Table */
335
337
 
336
338
  /** --- */
337
- const addListBtnComputed = computed(() => {
339
+ /* const addListBtnComputed = computed(() => {
338
340
  if (props.addListBtn !== undefined) {
339
341
  return props.addListBtn
340
342
  }
@@ -342,7 +344,7 @@ const addListBtnComputed = computed(() => {
342
344
  return pluginOptions.value.datatable?.addListBtn
343
345
  }
344
346
  return !1
345
- })
347
+ }) */
346
348
  const hasAddBtn = computed<boolean>(() => {
347
349
  if (props.hideAddBtn) {
348
350
  return !1
@@ -364,14 +366,14 @@ const hasShowBtn = computed<boolean>(() => {
364
366
  })
365
367
  const hasDestroyBtn = computed<boolean>(() => !props.hideDestroyBtn)
366
368
  const hasFilterDialog = computed<boolean>(() => !!slots.filter)
367
- const hasMenu = computed<boolean>(() => {
369
+ /* const hasMenu = computed<boolean>(() => {
368
370
  const pdf = props.pdf && getRows.value.length > 0
369
371
  const excel = props.excel && getRows.value.length > 0
370
372
  if (pdf || excel) {
371
373
  return !0
372
374
  }
373
375
  return hasAddBtn.value && !!addListBtnComputed.value
374
- })
376
+ }) */
375
377
 
376
378
  const isUpdateMode = ref<boolean>(!1)
377
379
  const formMode = computed<'update' | 'store'>(() => isUpdateMode.value ? 'update' : 'store')
@@ -1579,124 +1581,29 @@ defineOptions({
1579
1581
  />
1580
1582
  </MRow>
1581
1583
  <!--Buttons-->
1582
- <MRow class="row q-gutter-x-sm q-gutter-xs-y-sm items-center">
1583
- <!--More Menu-->
1584
+ <MRow class="q-gutter-x-sm q-gutter-xs-y-sm items-center">
1585
+ <!-- Export PDF-->
1584
1586
  <MDtBtn
1585
- v-if="hasMenu"
1586
- key="more-selection-btn"
1587
- :disable="tableOptions.loading"
1588
- icon="ion-ios-options"
1589
- label="myth.datatable.hints.options"
1590
- tooltip="myth.datatable.hints.more"
1591
- v-bind="{...defaultTopBtnProps,...pluginOptions.dt?.buttons?.more}"
1587
+ v-if="pdf && getRows.length > 0"
1588
+ icon="fa-solid fa-file-pdf"
1589
+ text-color="red"
1590
+ v-bind="{...defaultTopBtnProps,...pluginOptions.dt?.buttons?.filter}"
1591
+ @click="exportData('pdf')"
1592
1592
  >
1593
- <MModalMenu
1594
- :offset="[10,10]"
1595
- position="bottom"
1596
- v-bind="pluginOptions.dt?.buttons?.moreMenu as any"
1597
- >
1598
- <q-list
1599
- style="min-width: 250px"
1600
- v-bind="pluginOptions.dt?.buttons?.moreList"
1601
- >
1602
- <!-- Add Btn -->
1603
- <q-item
1604
- v-if="hasAddBtn && !!addListBtnComputed"
1605
- v-close-popup
1606
- clickable
1607
- v-bind="pluginOptions.dt?.buttons?.moreItem"
1608
- @click="openCreateDialog()"
1609
- >
1610
- <q-item-section thumbnail>
1611
- <q-icon
1612
- color="primary"
1613
- name="add"
1614
- right
1615
- size="xs"
1616
- />
1617
- </q-item-section>
1618
- <q-item-section>
1619
- <span> {{ getFormTitle }}</span>
1620
- </q-item-section>
1621
- </q-item>
1622
- <!-- Export PDF-->
1623
- <q-item
1624
- v-if="pdf && getRows.length > 0"
1625
- v-close-popup
1626
- clickable
1627
- v-bind="pluginOptions.dt?.buttons?.moreItem"
1628
- @click="exportData('pdf')"
1629
- >
1630
- <q-item-section thumbnail>
1631
- <q-icon
1632
- color="red"
1633
- name="fa-solid fa-file-pdf"
1634
- right
1635
- size="xs"
1636
- />
1637
- </q-item-section>
1638
- <q-item-section>
1639
- <span>
1640
- {{ __('myth.titles.exportPdf') }}
1641
- <q-badge
1642
- v-if="tableOptions.selected.length > 1"
1643
- :label="tableOptions.selected.length"
1644
- align="top"
1645
- rounded
1646
- />
1647
- </span>
1648
- </q-item-section>
1649
- </q-item>
1650
- <!-- Export Excel-->
1651
- <q-item
1652
- v-if="excel && getRows.length > 0"
1653
- v-close-popup
1654
- clickable
1655
- v-bind="pluginOptions.dt?.buttons?.moreItem"
1656
- @click="exportData('excel')"
1657
- >
1658
- <q-item-section thumbnail>
1659
- <q-icon
1660
- color="green"
1661
- name="fa-solid fa-file-excel"
1662
- right
1663
- size="xs"
1664
- />
1665
- </q-item-section>
1666
- <q-item-section>
1667
- <span>
1668
- {{ __('myth.titles.exportExcel') }}
1669
- <q-badge
1670
- v-if="tableOptions.selected.length>1"
1671
- :label="tableOptions.selected.length"
1672
- align="top"
1673
- rounded
1674
- />
1675
- </span>
1676
- </q-item-section>
1677
- </q-item>
1678
- <q-item
1679
- v-if="fullscreenBtn === undefined ? ( !!pluginOptions.datatable?.fullscreenBtn) : fullscreenBtn"
1680
- v-close-popup
1681
- clickable
1682
- v-bind="pluginOptions.dt?.buttons?.moreItem"
1683
- @click="tableOptions.fullscreen = !tableOptions.fullscreen"
1684
- >
1685
- <q-item-section thumbnail>
1686
- <q-icon
1687
- :name="tableOptions.fullscreen ? 'ion-ios-contract' : 'ion-ios-desktop'"
1688
- right
1689
- />
1690
- </q-item-section>
1691
- <q-item-section>
1692
- <q-item-label>
1693
- {{ __('myth.datatable.' + (tableOptions.fullscreen ? 'exitFullscreen' : 'fullscreen')) }}
1694
- </q-item-label>
1695
- </q-item-section>
1696
- </q-item>
1697
- </q-list>
1698
- </MModalMenu>
1593
+ <q-tooltip>{{ __('myth.titles.exportPdf') }}</q-tooltip>
1594
+ </MDtBtn>
1595
+
1596
+ <!-- Export Excel-->
1597
+ <MDtBtn
1598
+ v-if="excel && getRows.length > 0"
1599
+ icon="fa-solid fa-file-excel"
1600
+ text-color="green"
1601
+ v-bind="{...defaultTopBtnProps,...pluginOptions.dt?.buttons?.filter}"
1602
+ @click="exportData('excel')"
1603
+ >
1604
+ <q-tooltip>{{ __('myth.titles.exportExcel') }}</q-tooltip>
1699
1605
  </MDtBtn>
1606
+
1700
1607
  <!-- Filter dialog -->
1701
1608
  <MDtBtn
1702
1609
  v-if="hasFilterDialog"
@@ -1772,6 +1679,7 @@ defineOptions({
1772
1679
  </q-card>
1773
1680
  </MModalMenu>
1774
1681
  </MDtBtn>
1682
+
1775
1683
  <!--Refresh-->
1776
1684
  <MDtBtn
1777
1685
  v-if="!noRefreshBtn"
@@ -1782,6 +1690,7 @@ defineOptions({
1782
1690
  v-bind="{...defaultTopBtnProps,...pluginOptions.dt?.buttons?.refresh}"
1783
1691
  @click="refreshNoUpdate()"
1784
1692
  />
1693
+
1785
1694
  <!--Fullscreen-->
1786
1695
  <MDtBtn
1787
1696
  v-if="fullscreenBtn === undefined ? ( !!pluginOptions.datatable?.fullscreenBtn) : fullscreenBtn"
@@ -290,9 +290,9 @@ defineOptions({
290
290
  <MBtn
291
291
  v-else
292
292
  :disable="!isLoaded && !!url"
293
+ :label="'labels.' + ( clearable ? ( hasSrc ? 'remove' : btnLabel ) : ( required ? ( hasSrc ? 'change' : btnLabel ) : btnLabel ) )"
293
294
  :loading="loadingSrc"
294
295
  icon="ion-ios-images"
295
- :label="'labels.' + ( clearable ? ( hasSrc ? 'remove' : btnLabel ) : ( required ? ( hasSrc ? 'change' : btnLabel ) : btnLabel ) )"
296
296
  outline
297
297
  @click="onClick"
298
298
  />
@@ -210,8 +210,8 @@ defineOptions({
210
210
  <template #append>
211
211
  <q-btn
212
212
  v-if="!disable && !readonly && !viewMode"
213
- :icon="isDate ? 'ion-ios-calendar' : 'ion-ios-clock'"
214
213
  :color="!!errorMessage ? 'negative' : undefined"
214
+ :icon="isDate ? 'ion-ios-calendar' : 'ion-ios-clock'"
215
215
  flat
216
216
  round
217
217
  v-bind="{...pluginOptions?.pickerBtn, ...btnProps}"
@@ -19,7 +19,6 @@ $m--input-helpers-margin: 5px !default
19
19
  width: 0 !important
20
20
 
21
21
 
22
-
23
22
  .m--row + .m--row
24
23
  margin-top: $m--row-margin-top
25
24
 
@@ -1,6 +1,6 @@
1
1
  import type { NamedColor, QAvatarProps, QAvatarSlots, QImgProps } from 'quasar'
2
2
  import type { VNode } from 'vue'
3
- import type { InputErrorsContext, InputFormErrorsContext, InputRulesContext, MColProps } from '../components'
3
+ import type { InputRulesContext, MColProps } from '../components'
4
4
 
5
5
  export type MAvatarViewerModelValue = File | null | undefined;
6
6
 
@@ -36,5 +36,5 @@ export interface MAxiosProps extends Omit<MSelectProps, 'options' | 'axiosMode'>
36
36
  }
37
37
 
38
38
  export interface MAxiosSlots extends MSelectSlots {
39
- [ k : keyof MSelectSlots ]
39
+ [k: keyof MSelectSlots]
40
40
  }
@@ -37,16 +37,7 @@ import type { TypedOptions } from 'typed.js'
37
37
  import type { FieldContext, FieldOptions, FormContext, FormOptions, FormState } from 'vee-validate'
38
38
  import type { ThemeShadow, ThemeSize } from './theme'
39
39
  import type { ApiInterface, HelpersStubSchema } from './api-helpers'
40
- import type {
41
- MDatatableProps,
42
- MDatatableSlots,
43
- MDtAvatarProps,
44
- MDtAvatarSlots,
45
- MDtBtnProps,
46
- MDtBtnSlots,
47
- MDtContextmenuItemsProps,
48
- MDtContextmenuItemsSlots
49
- } from './m-datatable'
40
+ import type { MDatatableProps, MDatatableSlots, MDtAvatarProps, MDtAvatarSlots, MDtBtnProps, MDtBtnSlots, MDtContextmenuItemsProps, MDtContextmenuItemsSlots } from './m-datatable'
50
41
  import type { EditorConfig } from 'ckeditor5'
51
42
  import type { MAvatarViewerProps, MAvatarViewerSlots } from './api/MAvatarViewer'
52
43
  import type { MTransitionProps, MTransitionsSlots } from './api/MTransition'
@@ -231,11 +231,11 @@ export interface MythComponentsProps {
231
231
  buttons?: {
232
232
  filter?: Partial<MDtBtnProps>;
233
233
  refresh?: Partial<MDtBtnProps>;
234
- more?: Partial<MDtBtnProps>;
234
+ // more?: Partial<MDtBtnProps>;
235
235
  fullscreen?: Partial<MDtBtnProps>;
236
- moreMenu?: Partial<QMenuProps>;
237
- moreList?: Partial<QListProps>;
238
- moreItem?: Partial<QItemProps>;
236
+ // moreMenu?: Partial<QMenuProps>;
237
+ // moreList?: Partial<QListProps>;
238
+ // moreItem?: Partial<QItemProps>;
239
239
  },
240
240
  topSelection?: {
241
241
  btn?: Partial<MDtBtnProps>;