@mythpe/quasar-ui-qui 0.0.47 → 0.0.49
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 +1 -1
- package/src/components/datatable/MDatatable.vue +66 -70
- package/src/components/datatable/MDtBtn.vue +13 -13
- package/src/components/form/MBtn.vue +8 -155
- package/src/components/form/MCkeditor.vue +2 -2
- package/src/components/form/MEditor.vue +2 -4
- package/src/components/form/MField.vue +2 -6
- package/src/components/form/MFile.vue +6 -4
- package/src/components/form/MMobile.vue +3 -3
- package/src/components/form/MOptions.vue +1 -3
- package/src/components/form/MOtp.vue +1 -3
- package/src/components/form/MPicker.vue +8 -11
- package/src/components/form/MRadio.vue +4 -7
- package/src/components/form/MSelect.vue +3 -5
- package/src/components/form/MToggle.vue +3 -6
- package/src/components/form/MUploader.vue +8 -10
- package/src/components/grid/MBlock.vue +14 -4
- package/src/components/grid/MContainer.vue +10 -5
- package/src/components/grid/MRow.vue +5 -4
- package/src/components/modal/MDialog.vue +2 -2
- package/src/components/modal/MModalMenu.vue +4 -5
- package/src/components/modal/MTooltip.vue +2 -2
- package/src/components/parials/MUploaderItem.vue +5 -6
- package/src/composable/useBindInput.ts +12 -11
- package/src/composable/useMyth.ts +7 -16
- package/src/types/components.d.ts +5 -2
- package/src/types/index.d.ts +1 -4
- package/src/types/install-options.d.ts +15 -5
- package/src/types/myth-api.ts +36 -0
- package/src/types/plugin-props-option.d.ts +1 -11
- package/src/types/theme.d.ts +47 -0
- package/src/utils/const.ts +1 -0
- package/src/utils/createMyth.ts +42 -0
- package/src/utils/index.ts +3 -2
- package/src/utils/vue-plugin.ts +7 -3
- package/src/plugin/defineOptions.ts +0 -38
- package/src/utils/myth.ts +0 -112
package/package.json
CHANGED
|
@@ -167,7 +167,6 @@ interface Emits {
|
|
|
167
167
|
|
|
168
168
|
const emit = defineEmits<Emits>()
|
|
169
169
|
|
|
170
|
-
const $myth = useMyth()
|
|
171
170
|
const {
|
|
172
171
|
__,
|
|
173
172
|
parseHeaders,
|
|
@@ -177,9 +176,12 @@ const {
|
|
|
177
176
|
confirmMessage,
|
|
178
177
|
alertSuccess,
|
|
179
178
|
scrollToElementFromErrors,
|
|
180
|
-
downloadFromResponse
|
|
181
|
-
|
|
182
|
-
|
|
179
|
+
downloadFromResponse,
|
|
180
|
+
props: pluginOptions,
|
|
181
|
+
theme,
|
|
182
|
+
isSmall,
|
|
183
|
+
api
|
|
184
|
+
} = useMyth()
|
|
183
185
|
const slots = useSlots()
|
|
184
186
|
const router = useRouter()
|
|
185
187
|
const route = useRoute()
|
|
@@ -201,10 +203,10 @@ const resetVeeForm = async (attrs?: Record<string, any>) => {
|
|
|
201
203
|
}
|
|
202
204
|
const serviceName = computed(() => props.serviceName)
|
|
203
205
|
const exportToBlob = computed(() => {
|
|
204
|
-
if (props.exportUrl === undefined &&
|
|
206
|
+
if (props.exportUrl === undefined && pluginOptions.value.datatable?.exportUrl === undefined) {
|
|
205
207
|
return !0
|
|
206
208
|
}
|
|
207
|
-
const t = props.exportUrl === undefined ?
|
|
209
|
+
const t = props.exportUrl === undefined ? pluginOptions.value.datatable?.exportUrl : props.exportUrl
|
|
208
210
|
if (t !== undefined) {
|
|
209
211
|
if (t.toString() === 'true' || t.toString() === '') {
|
|
210
212
|
return !1
|
|
@@ -320,8 +322,8 @@ const addListBtnComputed = computed(() => {
|
|
|
320
322
|
if (props.addListBtn !== undefined) {
|
|
321
323
|
return props.addListBtn
|
|
322
324
|
}
|
|
323
|
-
if (
|
|
324
|
-
return
|
|
325
|
+
if (pluginOptions.value.datatable?.addListBtn !== undefined) {
|
|
326
|
+
return pluginOptions.value.datatable?.addListBtn
|
|
325
327
|
}
|
|
326
328
|
return !1
|
|
327
329
|
})
|
|
@@ -384,7 +386,7 @@ const getMythApiServicesSchema = (): MDtMythApiServicesSchema => {
|
|
|
384
386
|
if (typeof serviceName.value === 'function') {
|
|
385
387
|
return serviceName.value() as MDtMythApiServicesSchema
|
|
386
388
|
}
|
|
387
|
-
const c = api[serviceName.value]
|
|
389
|
+
const c = api.value.services[serviceName.value]
|
|
388
390
|
if (!c) {
|
|
389
391
|
throw Error(`No Service: ${serviceName.value}`)
|
|
390
392
|
}
|
|
@@ -880,7 +882,7 @@ const onSuccess: SubmissionHandler = async (form) => {
|
|
|
880
882
|
const onInvalidSubmit: InvalidSubmissionHandler = ({ errors }) => {
|
|
881
883
|
const keys: (keyof typeof errors)[] = Object.keys(errors)
|
|
882
884
|
if (keys[0]) {
|
|
883
|
-
const message = errors[keys[0]] as string ||
|
|
885
|
+
const message = errors[keys[0]] as string || __('messages.the_given_data_was_invalid')
|
|
884
886
|
scrollToElementFromErrors({ [keys[0]]: [message] }, undefined, '.m--datatable__dialog-form-container')
|
|
885
887
|
}
|
|
886
888
|
}
|
|
@@ -952,13 +954,7 @@ const deleteSelectionItem = () => {
|
|
|
952
954
|
})
|
|
953
955
|
}
|
|
954
956
|
const logoutDatatable = () => {
|
|
955
|
-
|
|
956
|
-
// removeStorage()
|
|
957
|
-
// logout(window.push_token)
|
|
958
|
-
// const name = this.$routes.auth.login
|
|
959
|
-
// if (this.$route.name !== name) {
|
|
960
|
-
// this.$router.replace({ name })
|
|
961
|
-
// }
|
|
957
|
+
//
|
|
962
958
|
}
|
|
963
959
|
/**
|
|
964
960
|
* ---
|
|
@@ -993,7 +989,7 @@ const contextmenuItems = computed<any>(() => ([
|
|
|
993
989
|
...(contextmenuItemsProp.value || []).sort((a, b) => (a.order ?? 0) - (b.order ?? 0)),
|
|
994
990
|
{
|
|
995
991
|
name: 'show',
|
|
996
|
-
label:
|
|
992
|
+
label: pluginOptions.value?.dt?.contextmenu?.btnStyle?.showLabel ? 'labels.show' : undefined,
|
|
997
993
|
click: (item: MDtItem, index: MDtItemIndex) => {
|
|
998
994
|
openShowDialog(item, index)
|
|
999
995
|
},
|
|
@@ -1001,7 +997,7 @@ const contextmenuItems = computed<any>(() => ([
|
|
|
1001
997
|
},
|
|
1002
998
|
{
|
|
1003
999
|
name: 'update',
|
|
1004
|
-
label:
|
|
1000
|
+
label: pluginOptions.value?.dt?.contextmenu?.btnStyle?.showLabel ? 'labels.update' : undefined,
|
|
1005
1001
|
click: (item: MDtItem, index: MDtItemIndex) => {
|
|
1006
1002
|
openUpdateDialog(item, index)
|
|
1007
1003
|
},
|
|
@@ -1009,7 +1005,7 @@ const contextmenuItems = computed<any>(() => ([
|
|
|
1009
1005
|
},
|
|
1010
1006
|
{
|
|
1011
1007
|
name: 'destroy',
|
|
1012
|
-
label:
|
|
1008
|
+
label: pluginOptions.value?.dt?.contextmenu?.btnStyle?.showLabel ? 'labels.destroy' : undefined,
|
|
1013
1009
|
click: (item: MDtItem, index: MDtItemIndex) => {
|
|
1014
1010
|
selected.value = [item]
|
|
1015
1011
|
onDeleteItem(item, index)
|
|
@@ -1053,7 +1049,7 @@ const closeImageDialog = () => {
|
|
|
1053
1049
|
onMounted(() => refresh())
|
|
1054
1050
|
|
|
1055
1051
|
watch(loading, v => {
|
|
1056
|
-
if (
|
|
1052
|
+
if (pluginOptions.value?.dt?.useQuasarLoading) {
|
|
1057
1053
|
if (v) {
|
|
1058
1054
|
$q.loading.show()
|
|
1059
1055
|
} else {
|
|
@@ -1140,8 +1136,8 @@ const getProp = computed(() => (k: keyof Props) => {
|
|
|
1140
1136
|
if (props[k] !== undefined) {
|
|
1141
1137
|
return props[k]
|
|
1142
1138
|
}
|
|
1143
|
-
if (
|
|
1144
|
-
return
|
|
1139
|
+
if (pluginOptions.value.datatable?.[k] !== undefined) {
|
|
1140
|
+
return pluginOptions.value.datatable?.[k]
|
|
1145
1141
|
}
|
|
1146
1142
|
return props[k]
|
|
1147
1143
|
})
|
|
@@ -1161,9 +1157,9 @@ defineOptions({
|
|
|
1161
1157
|
<div
|
|
1162
1158
|
:class="{
|
|
1163
1159
|
'm--datatable-component': !0,
|
|
1164
|
-
'm--datatable-component__fixed': fixed === undefined ? (
|
|
1160
|
+
'm--datatable-component__fixed': fixed === undefined ? ( pluginOptions.datatable?.fixed === undefined ? undefined : pluginOptions.datatable?.fixed) : fixed,
|
|
1165
1161
|
'm--datatable-component__too_small': $q.screen.height < 900,
|
|
1166
|
-
'm--datatable-component__fab': hasAddBtn && (addFabBtn === undefined ? !!
|
|
1162
|
+
'm--datatable-component__fab': hasAddBtn && (addFabBtn === undefined ? !!pluginOptions.datatable?.addFabBtn : addFabBtn)
|
|
1167
1163
|
}"
|
|
1168
1164
|
>
|
|
1169
1165
|
<!-- Context Menu -->
|
|
@@ -1173,14 +1169,14 @@ defineOptions({
|
|
|
1173
1169
|
context-menu
|
|
1174
1170
|
position="standard"
|
|
1175
1171
|
touch-position
|
|
1176
|
-
v-bind="
|
|
1172
|
+
v-bind="pluginOptions.dt?.contextmenu?.menu"
|
|
1177
1173
|
@hide="resetDialogs()"
|
|
1178
1174
|
>
|
|
1179
1175
|
<q-list
|
|
1180
1176
|
v-if="dialogs.item"
|
|
1181
1177
|
:separator="!isSmall"
|
|
1182
1178
|
style="min-width: 280px;"
|
|
1183
|
-
v-bind="
|
|
1179
|
+
v-bind="pluginOptions.dt?.contextmenu?.list"
|
|
1184
1180
|
>
|
|
1185
1181
|
<template
|
|
1186
1182
|
v-for="(contextmenuItem,i) in contextmenuItems"
|
|
@@ -1189,7 +1185,7 @@ defineOptions({
|
|
|
1189
1185
|
<MDtBtn
|
|
1190
1186
|
v-if="typeof contextmenuItem.showIf === 'function' ? contextmenuItem.showIf(dialogs.item,dialogs.index) : contextmenuItem.showIf"
|
|
1191
1187
|
:[contextmenuItem.name]="!0"
|
|
1192
|
-
:dense="dense === undefined ? (
|
|
1188
|
+
:dense="dense === undefined ? (theme.buttons.dense !== undefined ? theme.buttons.dense : pluginOptions.datatable?.dense) : dense"
|
|
1193
1189
|
:label="contextmenuItem.contextLabel !== undefined ? (contextmenuItem.contextLabel === null ? undefined : __(contextmenuItem.contextLabel)) : __(contextmenuItem.label || contextmenuItem.name) "
|
|
1194
1190
|
list-item
|
|
1195
1191
|
v-bind="contextmenuItem.attr"
|
|
@@ -1225,11 +1221,11 @@ defineOptions({
|
|
|
1225
1221
|
v-bind="{
|
|
1226
1222
|
virtualScroll: !0,
|
|
1227
1223
|
wrapCells:!0,
|
|
1228
|
-
...
|
|
1224
|
+
...pluginOptions.datatable,
|
|
1229
1225
|
...$attrs,
|
|
1230
|
-
bordered: bordered === undefined ?
|
|
1231
|
-
dense: dense === undefined ? (
|
|
1232
|
-
flat: flat === undefined ?
|
|
1226
|
+
bordered: bordered === undefined ? pluginOptions.datatable?.bordered : bordered,
|
|
1227
|
+
dense: dense === undefined ? ( theme.inputs.dense !== undefined ? theme.inputs.dense : pluginOptions.datatable?.dense) : dense,
|
|
1228
|
+
flat: flat === undefined ? pluginOptions.datatable?.flat : flat,
|
|
1233
1229
|
}"
|
|
1234
1230
|
@request="fetchDatatableItems"
|
|
1235
1231
|
@update:selected="onUpdateSelectedItems"
|
|
@@ -1292,7 +1288,7 @@ defineOptions({
|
|
|
1292
1288
|
:key="col.name"
|
|
1293
1289
|
>
|
|
1294
1290
|
<MRow
|
|
1295
|
-
v-if="col.name !== controlKey || (col.name === controlKey && ( showCardControlHeader === undefined ?
|
|
1291
|
+
v-if="col.name !== controlKey || (col.name === controlKey && ( showCardControlHeader === undefined ? pluginOptions.datatable?.showCardControlHeader : showCardControlHeader ))"
|
|
1296
1292
|
class="justify-between"
|
|
1297
1293
|
>
|
|
1298
1294
|
<MCol
|
|
@@ -1409,13 +1405,13 @@ defineOptions({
|
|
|
1409
1405
|
v-if="!hideSearch && !dialogs.form"
|
|
1410
1406
|
v-model="tableOptions.search"
|
|
1411
1407
|
:debounce="searchDebounce"
|
|
1412
|
-
:dense="dense === undefined ? (
|
|
1408
|
+
:dense="dense === undefined ? (pluginOptions.datatable?.dense !== undefined ? pluginOptions.datatable?.dense : !0) : dense"
|
|
1413
1409
|
:placeholder="searchPlaceholder"
|
|
1414
1410
|
autocomplete="none"
|
|
1415
1411
|
col="12"
|
|
1416
1412
|
name="search"
|
|
1417
1413
|
outlined
|
|
1418
|
-
v-bind="
|
|
1414
|
+
v-bind="pluginOptions.dt?.searchInput?.props"
|
|
1419
1415
|
>
|
|
1420
1416
|
<template #prepend>
|
|
1421
1417
|
<q-icon
|
|
@@ -1440,16 +1436,16 @@ defineOptions({
|
|
|
1440
1436
|
<template #after>
|
|
1441
1437
|
<q-btn
|
|
1442
1438
|
:aria-label="__('menu')"
|
|
1443
|
-
:icon="
|
|
1439
|
+
:icon="pluginOptions.dt?.searchInput?.optionsIcon || 'ion-ios-options'"
|
|
1444
1440
|
dense
|
|
1445
1441
|
flat
|
|
1446
1442
|
round
|
|
1447
|
-
v-bind="
|
|
1443
|
+
v-bind="pluginOptions.dt?.searchInput?.menuBtn"
|
|
1448
1444
|
>
|
|
1449
1445
|
<MModalMenu
|
|
1450
1446
|
:offset="[10,10]"
|
|
1451
1447
|
no-close-btn
|
|
1452
|
-
v-bind="
|
|
1448
|
+
v-bind="pluginOptions.dt?.searchInput?.menuProps as any"
|
|
1453
1449
|
>
|
|
1454
1450
|
<q-toolbar>
|
|
1455
1451
|
<q-toolbar-title>
|
|
@@ -1511,23 +1507,23 @@ defineOptions({
|
|
|
1511
1507
|
:disable="tableOptions.loading"
|
|
1512
1508
|
icon="ion-ios-options"
|
|
1513
1509
|
tooltip="myth.datatable.hints.more"
|
|
1514
|
-
v-bind="{...defaultTopBtnProps,...
|
|
1510
|
+
v-bind="{...defaultTopBtnProps,...pluginOptions.dt?.buttons?.more}"
|
|
1515
1511
|
>
|
|
1516
1512
|
<MModalMenu
|
|
1517
1513
|
:offset="[10,10]"
|
|
1518
1514
|
position="top"
|
|
1519
|
-
v-bind="
|
|
1515
|
+
v-bind="pluginOptions.dt?.buttons?.moreMenu as any"
|
|
1520
1516
|
>
|
|
1521
1517
|
<q-list
|
|
1522
1518
|
style="min-width: 250px"
|
|
1523
|
-
v-bind="
|
|
1519
|
+
v-bind="pluginOptions.dt?.buttons?.moreList"
|
|
1524
1520
|
>
|
|
1525
1521
|
<!-- Add Btn -->
|
|
1526
1522
|
<q-item
|
|
1527
1523
|
v-if="hasAddBtn && !!addListBtnComputed"
|
|
1528
1524
|
v-close-popup
|
|
1529
1525
|
clickable
|
|
1530
|
-
v-bind="
|
|
1526
|
+
v-bind="pluginOptions.dt?.buttons?.moreItem"
|
|
1531
1527
|
@click="openCreateDialog()"
|
|
1532
1528
|
>
|
|
1533
1529
|
<q-item-section thumbnail>
|
|
@@ -1546,7 +1542,7 @@ defineOptions({
|
|
|
1546
1542
|
v-if="pdf"
|
|
1547
1543
|
v-close-popup
|
|
1548
1544
|
clickable
|
|
1549
|
-
v-bind="
|
|
1545
|
+
v-bind="pluginOptions.dt?.buttons?.moreItem"
|
|
1550
1546
|
@click="exportData('pdf')"
|
|
1551
1547
|
>
|
|
1552
1548
|
<q-item-section thumbnail>
|
|
@@ -1573,7 +1569,7 @@ defineOptions({
|
|
|
1573
1569
|
v-if="excel"
|
|
1574
1570
|
v-close-popup
|
|
1575
1571
|
clickable
|
|
1576
|
-
v-bind="
|
|
1572
|
+
v-bind="pluginOptions.dt?.buttons?.moreItem"
|
|
1577
1573
|
@click="exportData('excel')"
|
|
1578
1574
|
>
|
|
1579
1575
|
<q-item-section thumbnail>
|
|
@@ -1597,10 +1593,10 @@ defineOptions({
|
|
|
1597
1593
|
</q-item-section>
|
|
1598
1594
|
</q-item>
|
|
1599
1595
|
<q-item
|
|
1600
|
-
v-if="fullscreenBtn === undefined ? ( !!
|
|
1596
|
+
v-if="fullscreenBtn === undefined ? ( !!pluginOptions.datatable?.fullscreenBtn) : fullscreenBtn"
|
|
1601
1597
|
v-close-popup
|
|
1602
1598
|
clickable
|
|
1603
|
-
v-bind="
|
|
1599
|
+
v-bind="pluginOptions.dt?.buttons?.moreItem"
|
|
1604
1600
|
@click="tableOptions.fullscreen = !tableOptions.fullscreen"
|
|
1605
1601
|
>
|
|
1606
1602
|
<q-item-section thumbnail>
|
|
@@ -1622,13 +1618,13 @@ defineOptions({
|
|
|
1622
1618
|
key="filter-selection-btn"
|
|
1623
1619
|
icon="o_filter_alt"
|
|
1624
1620
|
tooltip="myth.datatable.hints.filter"
|
|
1625
|
-
v-bind="{...defaultTopBtnProps,...
|
|
1621
|
+
v-bind="{...defaultTopBtnProps,...pluginOptions.dt?.buttons?.filter}"
|
|
1626
1622
|
@click="openFilterDialog()"
|
|
1627
1623
|
>
|
|
1628
1624
|
<MModalMenu
|
|
1629
1625
|
no-close-btn
|
|
1630
1626
|
persistent
|
|
1631
|
-
v-bind="
|
|
1627
|
+
v-bind="pluginOptions.dt?.filterDialogProps"
|
|
1632
1628
|
>
|
|
1633
1629
|
<q-card
|
|
1634
1630
|
:style="$q.screen.gt.sm?`width: ${Math.ceil($q.screen.width/2)}px` : undefined"
|
|
@@ -1665,7 +1661,7 @@ defineOptions({
|
|
|
1665
1661
|
:label="__('myth.datatable.filter.cancel')"
|
|
1666
1662
|
color="negative"
|
|
1667
1663
|
flat
|
|
1668
|
-
v-bind="
|
|
1664
|
+
v-bind="pluginOptions.dt?.dialogButtonsProps"
|
|
1669
1665
|
@click="closeFilterDialog"
|
|
1670
1666
|
/>
|
|
1671
1667
|
<MBtn
|
|
@@ -1673,7 +1669,7 @@ defineOptions({
|
|
|
1673
1669
|
:label="__('myth.datatable.filter.save')"
|
|
1674
1670
|
color="positive"
|
|
1675
1671
|
flat
|
|
1676
|
-
v-bind="
|
|
1672
|
+
v-bind="pluginOptions.dt?.dialogButtonsProps"
|
|
1677
1673
|
@click="saveFilterDialog"
|
|
1678
1674
|
/>
|
|
1679
1675
|
</MRow>
|
|
@@ -1690,17 +1686,17 @@ defineOptions({
|
|
|
1690
1686
|
:disable="tableOptions.loading"
|
|
1691
1687
|
icon="ion-ios-refresh"
|
|
1692
1688
|
tooltip="myth.datatable.hints.refresh"
|
|
1693
|
-
v-bind="{...defaultTopBtnProps,...
|
|
1689
|
+
v-bind="{...defaultTopBtnProps,...pluginOptions.dt?.buttons?.refresh}"
|
|
1694
1690
|
@click="refreshNoUpdate()"
|
|
1695
1691
|
/>
|
|
1696
1692
|
<!--Fullscreen-->
|
|
1697
1693
|
<MDtBtn
|
|
1698
|
-
v-if="fullscreenBtn === undefined ? ( !!
|
|
1694
|
+
v-if="fullscreenBtn === undefined ? ( !!pluginOptions.datatable?.fullscreenBtn) : fullscreenBtn"
|
|
1699
1695
|
key="fullscreen-selection-btn"
|
|
1700
1696
|
:disable="tableOptions.loading"
|
|
1701
1697
|
:icon="tableOptions.fullscreen ? 'ion-ios-contract' : 'ion-ios-desktop'"
|
|
1702
|
-
:tooltip="
|
|
1703
|
-
v-bind="{...defaultTopBtnProps,...
|
|
1698
|
+
:tooltip="`myth.datatable.${tableOptions.fullscreen ? 'exitFullscreen' : 'fullscreen'}`"
|
|
1699
|
+
v-bind="{...defaultTopBtnProps,...pluginOptions.dt?.buttons?.fullscreen}"
|
|
1704
1700
|
@click="tableOptions.fullscreen = !tableOptions.fullscreen"
|
|
1705
1701
|
/>
|
|
1706
1702
|
|
|
@@ -1711,7 +1707,7 @@ defineOptions({
|
|
|
1711
1707
|
:disable="tableOptions.loading"
|
|
1712
1708
|
icon="ion-ios-create"
|
|
1713
1709
|
update
|
|
1714
|
-
v-bind="{...defaultTopBtnProps,...
|
|
1710
|
+
v-bind="{...defaultTopBtnProps,...pluginOptions.dt?.topSelection?.btn}"
|
|
1715
1711
|
@click="openUpdateDialogNoIndex(tableOptions.selected[0] as any)"
|
|
1716
1712
|
/>
|
|
1717
1713
|
<MDtBtn
|
|
@@ -1720,7 +1716,7 @@ defineOptions({
|
|
|
1720
1716
|
:disable="tableOptions.loading"
|
|
1721
1717
|
icon="ion-ios-eye"
|
|
1722
1718
|
show
|
|
1723
|
-
v-bind="{...defaultTopBtnProps,...
|
|
1719
|
+
v-bind="{...defaultTopBtnProps,...pluginOptions.dt?.topSelection?.btn}"
|
|
1724
1720
|
@click="openShowDialogNoIndex(tableOptions.selected[0] as any)"
|
|
1725
1721
|
/>
|
|
1726
1722
|
<MDtBtn
|
|
@@ -1730,7 +1726,7 @@ defineOptions({
|
|
|
1730
1726
|
color="negative"
|
|
1731
1727
|
destroy
|
|
1732
1728
|
icon="ion-ios-trash"
|
|
1733
|
-
v-bind="{...defaultTopBtnProps,...
|
|
1729
|
+
v-bind="{...defaultTopBtnProps,...pluginOptions.dt?.topSelection?.btn}"
|
|
1734
1730
|
@click="deleteSelectionItem()"
|
|
1735
1731
|
/>
|
|
1736
1732
|
<template
|
|
@@ -1740,7 +1736,7 @@ defineOptions({
|
|
|
1740
1736
|
<MDtBtn
|
|
1741
1737
|
v-if="(typeof contextBtn.showIf === 'function' ? contextBtn.showIf(tableOptions.selected[0],0) : contextBtn.showIf) && ( (contextBtn.click && isSingleSelectedItem) || (contextBtn.multiClick && !isSingleSelectedItem) )"
|
|
1742
1738
|
:tooltip="__(contextBtn.tooltip || contextBtn.name)"
|
|
1743
|
-
v-bind="{...defaultTopBtnProps,...
|
|
1739
|
+
v-bind="{...defaultTopBtnProps,...pluginOptions.dt?.topSelection?.btn,...contextBtn,...contextBtn.attr}"
|
|
1744
1740
|
@click="contextBtn.click ? contextBtn.click(tableOptions.selected[0],0) : (contextBtn.multiClick ? contextBtn.multiClick(tableOptions.selected) : undefined)"
|
|
1745
1741
|
/>
|
|
1746
1742
|
</template>
|
|
@@ -1749,7 +1745,7 @@ defineOptions({
|
|
|
1749
1745
|
<q-space />
|
|
1750
1746
|
<!-- Add Btn -->
|
|
1751
1747
|
<template
|
|
1752
|
-
v-if="hasAddBtn && (addTopBtn===undefined?(
|
|
1748
|
+
v-if="hasAddBtn && (addTopBtn===undefined?(pluginOptions.datatable?.addTopBtn===undefined?!0:pluginOptions.datatable?.addTopBtn):addTopBtn)"
|
|
1753
1749
|
>
|
|
1754
1750
|
<MBtn
|
|
1755
1751
|
:label="getFormTitle"
|
|
@@ -1879,7 +1875,7 @@ defineOptions({
|
|
|
1879
1875
|
color="primary"
|
|
1880
1876
|
dense
|
|
1881
1877
|
outline
|
|
1882
|
-
v-bind="
|
|
1878
|
+
v-bind="pluginOptions.dt?.controlDropdown"
|
|
1883
1879
|
>
|
|
1884
1880
|
<q-list>
|
|
1885
1881
|
<MDtContextmenuItems
|
|
@@ -1968,7 +1964,7 @@ defineOptions({
|
|
|
1968
1964
|
<!-- Show Dialog -->
|
|
1969
1965
|
<MDialog
|
|
1970
1966
|
v-model="dialogs.show"
|
|
1971
|
-
v-bind="
|
|
1967
|
+
v-bind="pluginOptions.dt?.showDialogProps"
|
|
1972
1968
|
>
|
|
1973
1969
|
<q-card class="m--dialog-card">
|
|
1974
1970
|
<q-card-section ref="showTitleRef">
|
|
@@ -2010,7 +2006,7 @@ defineOptions({
|
|
|
2010
2006
|
<MBtn
|
|
2011
2007
|
:label="__('myth.titles.close')"
|
|
2012
2008
|
color="negative"
|
|
2013
|
-
v-bind="
|
|
2009
|
+
v-bind="pluginOptions.dt?.dialogButtonsProps"
|
|
2014
2010
|
@click="closeShowDialog"
|
|
2015
2011
|
/>
|
|
2016
2012
|
</q-card-actions>
|
|
@@ -2020,7 +2016,7 @@ defineOptions({
|
|
|
2020
2016
|
<!-- Form Dialog -->
|
|
2021
2017
|
<MDialog
|
|
2022
2018
|
v-model="dialogs.form"
|
|
2023
|
-
v-bind="
|
|
2019
|
+
v-bind="pluginOptions.dt?.formDialogProps"
|
|
2024
2020
|
>
|
|
2025
2021
|
<div
|
|
2026
2022
|
class="m--form__container full-height no-wrap"
|
|
@@ -2134,7 +2130,7 @@ defineOptions({
|
|
|
2134
2130
|
color="positive"
|
|
2135
2131
|
no-caps
|
|
2136
2132
|
type="submit"
|
|
2137
|
-
v-bind="
|
|
2133
|
+
v-bind="pluginOptions.dt?.dialogButtonsProps"
|
|
2138
2134
|
/>
|
|
2139
2135
|
</slot>
|
|
2140
2136
|
<MBtn
|
|
@@ -2143,7 +2139,7 @@ defineOptions({
|
|
|
2143
2139
|
:label="__('myth.titles.close')"
|
|
2144
2140
|
color="negative"
|
|
2145
2141
|
no-caps
|
|
2146
|
-
v-bind="
|
|
2142
|
+
v-bind="pluginOptions.dt?.dialogButtonsProps"
|
|
2147
2143
|
@click="closeFormDialog"
|
|
2148
2144
|
/>
|
|
2149
2145
|
</q-card-actions>
|
|
@@ -2203,16 +2199,16 @@ defineOptions({
|
|
|
2203
2199
|
|
|
2204
2200
|
<!-- Add Btn -->
|
|
2205
2201
|
<q-page-sticky
|
|
2206
|
-
v-if="hasAddBtn && (addFabBtn === undefined ? !!
|
|
2207
|
-
:offset="
|
|
2208
|
-
:position="
|
|
2209
|
-
v-bind="
|
|
2202
|
+
v-if="hasAddBtn && (addFabBtn === undefined ? !!pluginOptions.datatable?.addFabBtn : addFabBtn)"
|
|
2203
|
+
:offset="pluginOptions.dt?.fabBtn?.offset|| [25,25]"
|
|
2204
|
+
:position="pluginOptions.dt?.fabBtn?.position || 'bottom-right'"
|
|
2205
|
+
v-bind="pluginOptions.dt?.fabBtn?.pageStickyProps"
|
|
2210
2206
|
>
|
|
2211
2207
|
<q-btn
|
|
2212
2208
|
color="primary"
|
|
2213
2209
|
fab
|
|
2214
2210
|
icon="ion-ios-add"
|
|
2215
|
-
v-bind="
|
|
2211
|
+
v-bind="pluginOptions.dt?.fabBtn?.buttonProps"
|
|
2216
2212
|
@click="openCreateDialog()"
|
|
2217
2213
|
>
|
|
2218
2214
|
<MTooltip
|
|
@@ -47,7 +47,7 @@ type Events = {
|
|
|
47
47
|
const emit = defineEmits<Events>()
|
|
48
48
|
|
|
49
49
|
const hasTooltip = computed(() => !!props.tooltip || !!props.show || !!props.update || !!props.destroy)
|
|
50
|
-
const { __,
|
|
50
|
+
const { __, props: pluginOptions } = useMyth()
|
|
51
51
|
const getTooltip = computed(() => {
|
|
52
52
|
if (props.tooltip !== undefined) {
|
|
53
53
|
return props.tooltip ? __(props.tooltip) : props.tooltip
|
|
@@ -75,11 +75,11 @@ const getColor = computed<string | undefined>(() => {
|
|
|
75
75
|
return props.color
|
|
76
76
|
}
|
|
77
77
|
if (props.show) {
|
|
78
|
-
return
|
|
78
|
+
return pluginOptions.value?.dt?.contextmenu?.btnStyle?.showColor
|
|
79
79
|
} else if (props.update) {
|
|
80
|
-
return
|
|
80
|
+
return pluginOptions.value?.dt?.contextmenu?.btnStyle?.updateColor
|
|
81
81
|
} else if (props.destroy) {
|
|
82
|
-
return
|
|
82
|
+
return pluginOptions.value?.dt?.contextmenu?.btnStyle?.destroyColor
|
|
83
83
|
}
|
|
84
84
|
return props.color
|
|
85
85
|
})
|
|
@@ -107,21 +107,21 @@ defineOptions({
|
|
|
107
107
|
v-if="listItem"
|
|
108
108
|
v-close-popup
|
|
109
109
|
clickable
|
|
110
|
-
v-bind="{...
|
|
110
|
+
v-bind="{...pluginOptions.dt?.MDtBtn?.item?.props,...$attrs}"
|
|
111
111
|
@click="emit('click',$event)"
|
|
112
112
|
>
|
|
113
113
|
<q-item-section
|
|
114
114
|
side
|
|
115
|
-
v-bind="
|
|
115
|
+
v-bind="pluginOptions.dt?.MDtBtn?.item?.avatarProps"
|
|
116
116
|
>
|
|
117
117
|
<q-icon
|
|
118
118
|
:color="getColor"
|
|
119
119
|
:name="getIcon"
|
|
120
|
-
v-bind="
|
|
120
|
+
v-bind="pluginOptions.dt?.MDtBtn?.item?.iconProps"
|
|
121
121
|
/>
|
|
122
122
|
</q-item-section>
|
|
123
|
-
<q-item-section v-bind="
|
|
124
|
-
<q-item-label v-bind="
|
|
123
|
+
<q-item-section v-bind="pluginOptions.dt?.MDtBtn?.item?.labelSectionProps">
|
|
124
|
+
<q-item-label v-bind="pluginOptions.dt?.MDtBtn?.item?.itemLabelProps">
|
|
125
125
|
<slot>
|
|
126
126
|
{{ label ? __(label) : label }}
|
|
127
127
|
</slot>
|
|
@@ -131,11 +131,11 @@ defineOptions({
|
|
|
131
131
|
<q-btn
|
|
132
132
|
v-else
|
|
133
133
|
v-bind="{
|
|
134
|
-
...
|
|
134
|
+
...pluginOptions.dt?.MDtBtn?.btn?.props,
|
|
135
135
|
...$attrs,
|
|
136
|
-
fabMini: fabMini !== undefined ? fabMini : (
|
|
137
|
-
round: round !== undefined ? round : (
|
|
138
|
-
dense: dense !== undefined ? dense : (
|
|
136
|
+
fabMini: fabMini !== undefined ? fabMini : ( pluginOptions.dt?.btn?.fabMini !== undefined ? pluginOptions.dt.btn.fabMini : label === undefined),
|
|
137
|
+
round: round !== undefined ? round : ( pluginOptions.dt?.btn?.round !== undefined ? pluginOptions.dt.btn.round : label === undefined),
|
|
138
|
+
dense: dense !== undefined ? dense : ( pluginOptions.dt?.btn?.dense !== undefined ? pluginOptions.dt.btn.dense : label === undefined),
|
|
139
139
|
label: label !== undefined ? __(label) : label,
|
|
140
140
|
icon: getIcon,
|
|
141
141
|
color: getColor
|