@mythpe/quasar-ui-qui 0.0.66 → 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
|
@@ -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: () => '',
|
|
@@ -853,7 +855,12 @@ const onSuccess: SubmissionHandler = async (form) => {
|
|
|
853
855
|
}
|
|
854
856
|
}
|
|
855
857
|
}
|
|
856
|
-
const _conf: any = {
|
|
858
|
+
const _conf: any = {
|
|
859
|
+
params: {
|
|
860
|
+
fdt,
|
|
861
|
+
requestWith: getRequestWith(isUpdateMode.value ? 'withUpdate' : 'withStore') || undefined
|
|
862
|
+
}
|
|
863
|
+
}
|
|
857
864
|
const method = async () => isUpdateMode.value ? await apiServices.update(dialogs.item?.id || '', form, _conf) : await apiServices.store(form, _conf)
|
|
858
865
|
try {
|
|
859
866
|
const { _data, _message, _success }: any = await method()
|
|
@@ -935,7 +942,10 @@ const deleteSelectionItem = () => {
|
|
|
935
942
|
confirmMessage(__('messages.confirm_delete')).onOk(async () => {
|
|
936
943
|
loading.value = !0
|
|
937
944
|
try {
|
|
938
|
-
const {
|
|
945
|
+
const {
|
|
946
|
+
_message,
|
|
947
|
+
_success
|
|
948
|
+
} = await getMythApiServicesSchema().destroyAll(tableOptions.selected.map((e: MDtItem) => e.id))
|
|
939
949
|
if (!hideAutoMessage.value && _success && _message) {
|
|
940
950
|
_message && alertSuccess(_message)
|
|
941
951
|
}
|
|
@@ -986,14 +996,15 @@ const onRowContextmenu = (e: MouseEvent | Event, row: MDtItem, index: number | u
|
|
|
986
996
|
}
|
|
987
997
|
const contextmenuItemsProp = computed(() => props.contextItems)
|
|
988
998
|
const contextmenuItems = computed<any>(() => ([
|
|
989
|
-
...(contextmenuItemsProp.value || [])
|
|
999
|
+
...(contextmenuItemsProp.value || []),
|
|
990
1000
|
{
|
|
991
1001
|
name: 'show',
|
|
992
1002
|
label: pluginOptions.value?.dt?.contextmenu?.btnStyle?.showLabel ? 'labels.show' : undefined,
|
|
993
1003
|
click: (item: MDtItem, index: MDtItemIndex) => {
|
|
994
1004
|
openShowDialog(item, index)
|
|
995
1005
|
},
|
|
996
|
-
showIf: hasShowBtn.value
|
|
1006
|
+
showIf: hasShowBtn.value,
|
|
1007
|
+
order: 100
|
|
997
1008
|
},
|
|
998
1009
|
{
|
|
999
1010
|
name: 'update',
|
|
@@ -1001,7 +1012,8 @@ const contextmenuItems = computed<any>(() => ([
|
|
|
1001
1012
|
click: (item: MDtItem, index: MDtItemIndex) => {
|
|
1002
1013
|
openUpdateDialog(item, index)
|
|
1003
1014
|
},
|
|
1004
|
-
showIf: hasUpdateBtn.value
|
|
1015
|
+
showIf: hasUpdateBtn.value,
|
|
1016
|
+
order: 200
|
|
1005
1017
|
},
|
|
1006
1018
|
{
|
|
1007
1019
|
name: 'destroy',
|
|
@@ -1013,9 +1025,10 @@ const contextmenuItems = computed<any>(() => ([
|
|
|
1013
1025
|
showIf: hasDestroyBtn.value,
|
|
1014
1026
|
attr: {
|
|
1015
1027
|
color: 'negative'
|
|
1016
|
-
}
|
|
1028
|
+
},
|
|
1029
|
+
order: 300
|
|
1017
1030
|
}
|
|
1018
|
-
]))
|
|
1031
|
+
].sort((a, b) => (a.order ?? 0) - (b.order ?? 0))))
|
|
1019
1032
|
const endReach = computed<boolean>(() => Boolean(props.endReach))
|
|
1020
1033
|
const rowsPerPageOptions = computed(() => props.rowsPerPageOptions)
|
|
1021
1034
|
const getRowsPerPageOptions = computed<any[]>(() => endReach.value ? [0] : (rowsPerPageOptions.value || [0]))
|
|
@@ -1282,7 +1295,7 @@ defineOptions({
|
|
|
1282
1295
|
</div>
|
|
1283
1296
|
<q-separator />
|
|
1284
1297
|
</template>
|
|
1285
|
-
<MContainer>
|
|
1298
|
+
<MContainer :fluid="!1">
|
|
1286
1299
|
<template
|
|
1287
1300
|
v-for="col in iTempProps.cols"
|
|
1288
1301
|
:key="col.name"
|
|
@@ -1367,7 +1380,10 @@ defineOptions({
|
|
|
1367
1380
|
|
|
1368
1381
|
<template #top="topSlotProps">
|
|
1369
1382
|
<MCol col="12">
|
|
1370
|
-
<MContainer
|
|
1383
|
+
<MContainer
|
|
1384
|
+
:fluid="!1"
|
|
1385
|
+
class="no-padding"
|
|
1386
|
+
>
|
|
1371
1387
|
<slot
|
|
1372
1388
|
:dt="datatableItemsScope"
|
|
1373
1389
|
:form="formScope"
|
|
@@ -1453,7 +1469,10 @@ defineOptions({
|
|
|
1453
1469
|
</q-toolbar-title>
|
|
1454
1470
|
</q-toolbar>
|
|
1455
1471
|
<q-separator />
|
|
1456
|
-
<MContainer
|
|
1472
|
+
<MContainer
|
|
1473
|
+
:fluid="!1"
|
|
1474
|
+
style="min-width: 250px; max-width: 450px"
|
|
1475
|
+
>
|
|
1457
1476
|
<MRow class="items-center">
|
|
1458
1477
|
<MCol col="12">
|
|
1459
1478
|
<template
|
|
@@ -1606,7 +1625,9 @@ defineOptions({
|
|
|
1606
1625
|
/>
|
|
1607
1626
|
</q-item-section>
|
|
1608
1627
|
<q-item-section>
|
|
1609
|
-
<q-item-label>
|
|
1628
|
+
<q-item-label>
|
|
1629
|
+
{{ __('myth.datatable.' + (tableOptions.fullscreen ? 'exitFullscreen' : 'fullscreen')) }}
|
|
1630
|
+
</q-item-label>
|
|
1610
1631
|
</q-item-section>
|
|
1611
1632
|
</q-item>
|
|
1612
1633
|
</q-list>
|
|
@@ -1631,7 +1652,10 @@ defineOptions({
|
|
|
1631
1652
|
flat
|
|
1632
1653
|
square
|
|
1633
1654
|
>
|
|
1634
|
-
<MContainer
|
|
1655
|
+
<MContainer
|
|
1656
|
+
:fluid="!1"
|
|
1657
|
+
class="q-pa-md"
|
|
1658
|
+
>
|
|
1635
1659
|
<q-toolbar :class="{'q-pa-none': $q.screen.lt.md}">
|
|
1636
1660
|
<q-toolbar-title>
|
|
1637
1661
|
{{ __('myth.datatable.filter.title') }}
|
|
@@ -1640,7 +1664,10 @@ defineOptions({
|
|
|
1640
1664
|
<q-separator />
|
|
1641
1665
|
<MRow class="items-center">
|
|
1642
1666
|
<MCol col="12">
|
|
1643
|
-
<MContainer
|
|
1667
|
+
<MContainer
|
|
1668
|
+
:fluid="!1"
|
|
1669
|
+
class="q-pa-md"
|
|
1670
|
+
>
|
|
1644
1671
|
<slot
|
|
1645
1672
|
:dt="datatableItemsScope"
|
|
1646
1673
|
:filter="tableOptions.tempFilter"
|
|
@@ -1806,7 +1833,6 @@ defineOptions({
|
|
|
1806
1833
|
col="auto"
|
|
1807
1834
|
>
|
|
1808
1835
|
<q-chip
|
|
1809
|
-
class="q-pr-md"
|
|
1810
1836
|
clickable
|
|
1811
1837
|
color="primary"
|
|
1812
1838
|
icon-remove="clear"
|
|
@@ -1815,14 +1841,20 @@ defineOptions({
|
|
|
1815
1841
|
@click="openFilterDialog()"
|
|
1816
1842
|
@remove="onRemoveFilter(filterKey)"
|
|
1817
1843
|
>
|
|
1818
|
-
<span>
|
|
1844
|
+
<span>
|
|
1845
|
+
{{ getHeaders.find(e => e.name === filterKey)?.label || __(`attributes.${filterKey}`) }}
|
|
1846
|
+
</span>
|
|
1819
1847
|
<span v-if="typeof filterValue === 'boolean'">: {{ __(filterValue ? 'yes' : 'no') }}</span>
|
|
1820
1848
|
<span v-else-if="typeof filterValue === 'string'">: {{ filterValue }}</span>
|
|
1821
|
-
<span
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1849
|
+
<span
|
|
1850
|
+
v-else-if="lodash.isArray(filterValue) && !quasarHelpers.object(filterValue[0])"
|
|
1851
|
+
>: {{ filterValue.join(', ') }}</span>
|
|
1852
|
+
<span
|
|
1853
|
+
v-else-if="lodash.isArray(filterValue) && quasarHelpers.object(filterValue[0])"
|
|
1854
|
+
>: {{ filterValue.map(e => e.label).join(', ') }}</span>
|
|
1855
|
+
<span
|
|
1856
|
+
v-else-if="quasarHelpers.object(filterValue) && filterValue.label"
|
|
1857
|
+
>: {{ filterValue.label }}</span>
|
|
1826
1858
|
</q-chip>
|
|
1827
1859
|
</MCol>
|
|
1828
1860
|
</template>
|
|
@@ -1869,7 +1901,7 @@ defineOptions({
|
|
|
1869
1901
|
<q-td :props="noBodyProps">
|
|
1870
1902
|
<!--Control-->
|
|
1871
1903
|
<q-btn-dropdown
|
|
1872
|
-
v-if="contextmenuItems.length>
|
|
1904
|
+
v-if="contextmenuItems.length>contextItemsLength"
|
|
1873
1905
|
v-close-popup
|
|
1874
1906
|
:menu-offset="[0,10]"
|
|
1875
1907
|
color="primary"
|
|
@@ -1899,7 +1931,7 @@ defineOptions({
|
|
|
1899
1931
|
</q-btn-dropdown>
|
|
1900
1932
|
<MRow
|
|
1901
1933
|
v-else
|
|
1902
|
-
class="m--dt-context_menu_items"
|
|
1934
|
+
class="m--dt-context_menu_items justify-end"
|
|
1903
1935
|
gutter
|
|
1904
1936
|
space="xs"
|
|
1905
1937
|
>
|
|
@@ -2084,7 +2116,10 @@ defineOptions({
|
|
|
2084
2116
|
:style="`height: ${($q.screen.height || 100) - 3 - (($refs.formActions as any)?.$el?.offsetHeight || 60) - (($refs.formTitle as any)?.$el?.offsetHeight || 80)}px`"
|
|
2085
2117
|
class="scroll m--datatable__dialog-form-container"
|
|
2086
2118
|
>
|
|
2087
|
-
<MContainer
|
|
2119
|
+
<MContainer
|
|
2120
|
+
v-if="tableOptions.loading && !dialogs.item"
|
|
2121
|
+
:fluid="!1"
|
|
2122
|
+
>
|
|
2088
2123
|
<MRow
|
|
2089
2124
|
v-if="tableOptions.loading"
|
|
2090
2125
|
col
|
|
@@ -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
|
/>
|
|
@@ -39,8 +39,8 @@ type P = {
|
|
|
39
39
|
colProps?: Props['colProps'];
|
|
40
40
|
viewMode?: Props['viewMode'];
|
|
41
41
|
fieldOptions?: Props['fieldOptions'];
|
|
42
|
-
autocomplete
|
|
43
|
-
disable
|
|
42
|
+
autocomplete?: Props['autocomplete'];
|
|
43
|
+
disable?: Props['disable'];
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
const props = withDefaults(defineProps<P>(), {
|
|
@@ -125,11 +125,10 @@ defineOptions({
|
|
|
125
125
|
<MCol v-bind="colProps">
|
|
126
126
|
<q-field
|
|
127
127
|
v-bind="{
|
|
128
|
-
...theme,
|
|
129
|
-
...pluginOptions.field,
|
|
130
128
|
error: !!errorMessage,
|
|
131
129
|
errorMessage,
|
|
132
130
|
hint: hint ? __(hint) : hint,
|
|
131
|
+
dense: !0,
|
|
133
132
|
borderless: !0,
|
|
134
133
|
outlined: !1,
|
|
135
134
|
stackLabel: !0
|
package/src/style/main.sass
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
@use 'sass:map'
|
|
2
2
|
@use "quasar/src/css/variables" as q
|
|
3
3
|
|
|
4
|
+
$m--row-margin-top: 1rem !default
|
|
5
|
+
$m--input-helpers-margin: 5px !default
|
|
6
|
+
|
|
4
7
|
// Flex.
|
|
5
8
|
.flex-break
|
|
6
9
|
flex: 1 0 100% !important
|
|
@@ -15,7 +18,7 @@
|
|
|
15
18
|
.flex-break
|
|
16
19
|
width: 0 !important
|
|
17
20
|
|
|
18
|
-
|
|
21
|
+
|
|
19
22
|
|
|
20
23
|
.m--row + .m--row
|
|
21
24
|
margin-top: $m--row-margin-top
|
|
@@ -126,6 +129,7 @@ pre
|
|
|
126
129
|
.m--input__top-label__content
|
|
127
130
|
color: q.$negative
|
|
128
131
|
|
|
132
|
+
|
|
129
133
|
[data-input-name].m--input__required
|
|
130
134
|
&:not(.m--input__is-top-label)
|
|
131
135
|
> .q-field
|
|
@@ -136,6 +140,7 @@ pre
|
|
|
136
140
|
.m--input__top-label__content::after
|
|
137
141
|
content: ' *'
|
|
138
142
|
|
|
143
|
+
|
|
139
144
|
.m--input__color-preview
|
|
140
145
|
border: 1px solid q.$primary
|
|
141
146
|
border-radius: $radius-value
|
|
@@ -144,3 +149,21 @@ pre
|
|
|
144
149
|
.m--confirm.actions-between
|
|
145
150
|
.q-card__actions
|
|
146
151
|
justify-content: space-between !important
|
|
152
|
+
|
|
153
|
+
.m--input__top-label,
|
|
154
|
+
.m--input__hint
|
|
155
|
+
margin-bottom: $m--input-helpers-margin
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
.m--input__caption
|
|
159
|
+
margin-bottom: $m--input-helpers-margin
|
|
160
|
+
font-size: 0.75rem
|
|
161
|
+
font-weight: 400
|
|
162
|
+
line-height: 1.25rem
|
|
163
|
+
letter-spacing: 0.03333em
|
|
164
|
+
|
|
165
|
+
$control-max-width: 200px !default
|
|
166
|
+
|
|
167
|
+
.m--control-cell,
|
|
168
|
+
.m--control-header
|
|
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;
|