@winchsa/ui 0.1.30 → 0.1.33
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/dist/components/Breadcrumbs.d.vue.ts +0 -7
- package/dist/components/Breadcrumbs.vue +0 -46
- package/dist/components/Breadcrumbs.vue.d.ts +0 -7
- package/dist/components/CustomizerSection.d.vue.ts +0 -17
- package/dist/components/CustomizerSection.vue +0 -19
- package/dist/components/CustomizerSection.vue.d.ts +0 -17
- package/dist/components/DialogCloseBtn.d.vue.ts +0 -7
- package/dist/components/DialogCloseBtn.vue +0 -20
- package/dist/components/DialogCloseBtn.vue.d.ts +0 -7
- package/dist/components/Drawer.d.vue.ts +0 -28
- package/dist/components/Drawer.vue +0 -60
- package/dist/components/Drawer.vue.d.ts +0 -28
- package/dist/components/IconBtn.d.vue.ts +0 -18
- package/dist/components/IconBtn.vue +0 -24
- package/dist/components/IconBtn.vue.d.ts +0 -18
- package/dist/components/LoadingBar.d.vue.ts +0 -6
- package/dist/components/LoadingBar.vue +0 -31
- package/dist/components/LoadingBar.vue.d.ts +0 -6
- package/dist/components/LoadingDialog.d.vue.ts +0 -12
- package/dist/components/LoadingDialog.vue +0 -41
- package/dist/components/LoadingDialog.vue.d.ts +0 -12
- package/dist/components/LoadingItem.d.vue.ts +0 -25
- package/dist/components/LoadingItem.vue +0 -66
- package/dist/components/LoadingItem.vue.d.ts +0 -25
- package/dist/components/Modal.d.vue.ts +0 -50
- package/dist/components/Modal.vue +0 -155
- package/dist/components/Modal.vue.d.ts +0 -50
- package/dist/components/MoreBtn.d.vue.ts +0 -17
- package/dist/components/MoreBtn.vue +0 -28
- package/dist/components/MoreBtn.vue.d.ts +0 -17
- package/dist/components/ScrollToTop.d.vue.ts +0 -3
- package/dist/components/ScrollToTop.vue +0 -39
- package/dist/components/ScrollToTop.vue.d.ts +0 -3
- package/dist/components/SiteTitle.d.vue.ts +0 -3
- package/dist/components/SiteTitle.vue +0 -14
- package/dist/components/SiteTitle.vue.d.ts +0 -3
- package/dist/components/Toaster.d.vue.ts +0 -6
- package/dist/components/Toaster.vue +0 -19
- package/dist/components/Toaster.vue.d.ts +0 -6
- package/dist/components/cards/AppCard.d.vue.ts +0 -18
- package/dist/components/cards/AppCard.vue +0 -45
- package/dist/components/cards/AppCard.vue.d.ts +0 -18
- package/dist/components/cards/AppCardActions.d.vue.ts +0 -33
- package/dist/components/cards/AppCardActions.vue +0 -126
- package/dist/components/cards/AppCardActions.vue.d.ts +0 -33
- package/dist/components/cards/CardStatisticsHorizontal.d.vue.ts +0 -9
- package/dist/components/cards/CardStatisticsHorizontal.vue +0 -29
- package/dist/components/cards/CardStatisticsHorizontal.vue.d.ts +0 -9
- package/dist/components/cards/CheckboxesCard.d.vue.ts +0 -18
- package/dist/components/cards/CheckboxesCard.vue +0 -108
- package/dist/components/cards/CheckboxesCard.vue.d.ts +0 -18
- package/dist/components/cards/HeaderCard.d.vue.ts +0 -9
- package/dist/components/cards/HeaderCard.vue +0 -31
- package/dist/components/cards/HeaderCard.vue.d.ts +0 -9
- package/dist/components/cards/ImageCard.d.vue.ts +0 -33
- package/dist/components/cards/ImageCard.vue +0 -73
- package/dist/components/cards/ImageCard.vue.d.ts +0 -33
- package/dist/components/cards/InputCard.d.vue.ts +0 -21
- package/dist/components/cards/InputCard.vue +0 -60
- package/dist/components/cards/InputCard.vue.d.ts +0 -21
- package/dist/components/cards/StaticCard.d.vue.ts +0 -21
- package/dist/components/cards/StaticCard.vue +0 -37
- package/dist/components/cards/StaticCard.vue.d.ts +0 -21
- package/dist/components/forms/Accordion.d.vue.ts +0 -19
- package/dist/components/forms/Accordion.vue +0 -43
- package/dist/components/forms/Accordion.vue.d.ts +0 -19
- package/dist/components/forms/AppBarSearch.d.vue.ts +0 -43
- package/dist/components/forms/AppBarSearch.vue +0 -345
- package/dist/components/forms/AppBarSearch.vue.d.ts +0 -43
- package/dist/components/forms/AppCombobox.d.vue.ts +0 -13
- package/dist/components/forms/AppCombobox.vue +0 -67
- package/dist/components/forms/AppCombobox.vue.d.ts +0 -13
- package/dist/components/forms/AppDrawerHeaderSection.d.vue.ts +0 -20
- package/dist/components/forms/AppDrawerHeaderSection.vue +0 -21
- package/dist/components/forms/AppDrawerHeaderSection.vue.d.ts +0 -20
- package/dist/components/forms/AppLabel.d.vue.ts +0 -24
- package/dist/components/forms/AppLabel.vue +0 -47
- package/dist/components/forms/AppLabel.vue.d.ts +0 -24
- package/dist/components/forms/AppLink.d.vue.ts +0 -19
- package/dist/components/forms/AppLink.vue +0 -50
- package/dist/components/forms/AppLink.vue.d.ts +0 -19
- package/dist/components/forms/AppNumberField.d.vue.ts +0 -20
- package/dist/components/forms/AppNumberField.vue +0 -85
- package/dist/components/forms/AppNumberField.vue.d.ts +0 -20
- package/dist/components/forms/AppOtpInput.d.vue.ts +0 -13
- package/dist/components/forms/AppOtpInput.vue +0 -84
- package/dist/components/forms/AppOtpInput.vue.d.ts +0 -13
- package/dist/components/forms/AppSearchHeader.d.vue.ts +0 -8
- package/dist/components/forms/AppSearchHeader.vue +0 -72
- package/dist/components/forms/AppSearchHeader.vue.d.ts +0 -8
- package/dist/components/forms/AppSelect.d.vue.ts +0 -17
- package/dist/components/forms/AppSelect.vue +0 -98
- package/dist/components/forms/AppSelect.vue.d.ts +0 -17
- package/dist/components/forms/AppStepper.d.vue.ts +0 -21
- package/dist/components/forms/AppStepper.vue +0 -232
- package/dist/components/forms/AppStepper.vue.d.ts +0 -21
- package/dist/components/forms/AppSwitch.d.vue.ts +0 -16
- package/dist/components/forms/AppSwitch.vue +0 -59
- package/dist/components/forms/AppSwitch.vue.d.ts +0 -16
- package/dist/components/forms/AppTextField.d.vue.ts +0 -13
- package/dist/components/forms/AppTextField.vue +0 -66
- package/dist/components/forms/AppTextField.vue.d.ts +0 -13
- package/dist/components/forms/AppTextarea.d.vue.ts +0 -13
- package/dist/components/forms/AppTextarea.vue +0 -69
- package/dist/components/forms/AppTextarea.vue.d.ts +0 -13
- package/dist/components/forms/AttachmentCropperInput.d.vue.ts +0 -18
- package/dist/components/forms/AttachmentCropperInput.vue +0 -227
- package/dist/components/forms/AttachmentCropperInput.vue.d.ts +0 -18
- package/dist/components/forms/AttachmentInput.d.vue.ts +0 -16
- package/dist/components/forms/AttachmentInput.vue +0 -116
- package/dist/components/forms/AttachmentInput.vue.d.ts +0 -16
- package/dist/components/forms/AutocompleteInput.d.vue.ts +0 -84
- package/dist/components/forms/AutocompleteInput.vue +0 -760
- package/dist/components/forms/AutocompleteInput.vue.d.ts +0 -84
- package/dist/components/forms/BankSelect.d.vue.ts +0 -21
- package/dist/components/forms/BankSelect.vue +0 -43
- package/dist/components/forms/BankSelect.vue.d.ts +0 -21
- package/dist/components/forms/BaseButton.d.vue.ts +0 -20
- package/dist/components/forms/BaseButton.vue +0 -42
- package/dist/components/forms/BaseButton.vue.d.ts +0 -20
- package/dist/components/forms/CounterInput.d.vue.ts +0 -13
- package/dist/components/forms/CounterInput.vue +0 -71
- package/dist/components/forms/CounterInput.vue.d.ts +0 -13
- package/dist/components/forms/CustomCheckboxes.d.vue.ts +0 -25
- package/dist/components/forms/CustomCheckboxes.vue +0 -69
- package/dist/components/forms/CustomCheckboxes.vue.d.ts +0 -25
- package/dist/components/forms/CustomCheckboxesWithIcon.d.vue.ts +0 -25
- package/dist/components/forms/CustomCheckboxesWithIcon.vue +0 -80
- package/dist/components/forms/CustomCheckboxesWithIcon.vue.d.ts +0 -25
- package/dist/components/forms/CustomCheckboxesWithImage.d.vue.ts +0 -16
- package/dist/components/forms/CustomCheckboxesWithImage.vue +0 -67
- package/dist/components/forms/CustomCheckboxesWithImage.vue.d.ts +0 -16
- package/dist/components/forms/CustomRadios.d.vue.ts +0 -25
- package/dist/components/forms/CustomRadios.vue +0 -69
- package/dist/components/forms/CustomRadios.vue.d.ts +0 -25
- package/dist/components/forms/CustomRadiosWithIcon.d.vue.ts +0 -28
- package/dist/components/forms/CustomRadiosWithIcon.vue +0 -98
- package/dist/components/forms/CustomRadiosWithIcon.vue.d.ts +0 -28
- package/dist/components/forms/CustomRadiosWithImage.d.vue.ts +0 -35
- package/dist/components/forms/CustomRadiosWithImage.vue +0 -69
- package/dist/components/forms/CustomRadiosWithImage.vue.d.ts +0 -35
- package/dist/components/forms/DatePicker.d.vue.ts +0 -29
- package/dist/components/forms/DatePicker.vue +0 -400
- package/dist/components/forms/DatePicker.vue.d.ts +0 -29
- package/dist/components/forms/DatePickerRange.d.vue.ts +0 -24
- package/dist/components/forms/DatePickerRange.vue +0 -127
- package/dist/components/forms/DatePickerRange.vue.d.ts +0 -24
- package/dist/components/forms/DraggedUploadFile.d.vue.ts +0 -11
- package/dist/components/forms/DraggedUploadFile.vue +0 -120
- package/dist/components/forms/DraggedUploadFile.vue.d.ts +0 -11
- package/dist/components/forms/ImageCardInput.d.vue.ts +0 -35
- package/dist/components/forms/ImageCardInput.vue +0 -234
- package/dist/components/forms/ImageCardInput.vue.d.ts +0 -35
- package/dist/components/forms/InputValidationWrapper.d.vue.ts +0 -26
- package/dist/components/forms/InputValidationWrapper.vue +0 -24
- package/dist/components/forms/InputValidationWrapper.vue.d.ts +0 -26
- package/dist/components/forms/LicensePlateInput.d.vue.ts +0 -21
- package/dist/components/forms/LicensePlateInput.vue +0 -175
- package/dist/components/forms/LicensePlateInput.vue.d.ts +0 -21
- package/dist/components/forms/ManualDate.d.vue.ts +0 -20
- package/dist/components/forms/ManualDate.vue +0 -264
- package/dist/components/forms/ManualDate.vue.d.ts +0 -20
- package/dist/components/forms/MobileInput.d.vue.ts +0 -25
- package/dist/components/forms/MobileInput.vue +0 -118
- package/dist/components/forms/MobileInput.vue.d.ts +0 -25
- package/dist/components/forms/PasswordInput.d.vue.ts +0 -11
- package/dist/components/forms/PasswordInput.vue +0 -29
- package/dist/components/forms/PasswordInput.vue.d.ts +0 -11
- package/dist/components/forms/RangeInput.d.vue.ts +0 -10
- package/dist/components/forms/RangeInput.vue +0 -48
- package/dist/components/forms/RangeInput.vue.d.ts +0 -10
- package/dist/components/forms/Tabs.d.vue.ts +0 -23
- package/dist/components/forms/Tabs.vue +0 -35
- package/dist/components/forms/Tabs.vue.d.ts +0 -23
- package/dist/components/forms/TimePicker.d.vue.ts +0 -18
- package/dist/components/forms/TimePicker.vue +0 -370
- package/dist/components/forms/TimePicker.vue.d.ts +0 -18
- package/dist/components/table/DataTable.d.vue.ts +0 -70
- package/dist/components/table/DataTable.vue +0 -361
- package/dist/components/table/DataTable.vue.d.ts +0 -70
- package/dist/components/table/EditableDataTable.d.vue.ts +0 -21
- package/dist/components/table/EditableDataTable.vue +0 -328
- package/dist/components/table/EditableDataTable.vue.d.ts +0 -21
- package/dist/components/table/EditableDataTableRow.d.vue.ts +0 -20
- package/dist/components/table/EditableDataTableRow.vue +0 -253
- package/dist/components/table/EditableDataTableRow.vue.d.ts +0 -20
- package/dist/components/table/FilterGenerator.d.vue.ts +0 -13
- package/dist/components/table/FilterGenerator.vue +0 -231
- package/dist/components/table/FilterGenerator.vue.d.ts +0 -13
- package/dist/components/table/StaticTable.d.vue.ts +0 -34
- package/dist/components/table/StaticTable.vue +0 -152
- package/dist/components/table/StaticTable.vue.d.ts +0 -34
- package/dist/components/table/TablePagination.d.vue.ts +0 -15
- package/dist/components/table/TablePagination.vue +0 -73
- package/dist/components/table/TablePagination.vue.d.ts +0 -15
- package/dist/composables/useIsMobile.d.ts +0 -1
- package/dist/composables/useIsMobile.js +0 -10
- package/dist/composables/useIsMobile.mjs +0 -4
- package/dist/composables/useTableFilters.d.ts +0 -23
- package/dist/composables/useTableFilters.js +0 -197
- package/dist/composables/useTableFilters.mjs +0 -184
- package/dist/images/avatar.png +0 -0
- package/dist/images/sa.svg +0 -1
- package/dist/index.d.ts +0 -65
- package/dist/index.js +0 -454
- package/dist/index.mjs +0 -130
- package/dist/lang/ar.json +0 -54
- package/dist/lang/en.json +0 -54
- package/dist/styles/assets/scss/variables/_template.scss +0 -1
- package/dist/styles/assets/scss/variables/_vuetify.scss +0 -1
- package/dist/styles/core/base/_components.scss +0 -164
- package/dist/styles/core/base/_dark.scss +0 -16
- package/dist/styles/core/base/_default-layout-w-vertical-nav.scss +0 -106
- package/dist/styles/core/base/_default-layout.scss +0 -16
- package/dist/styles/core/base/_index.scss +0 -47
- package/dist/styles/core/base/_layouts.scss +0 -63
- package/dist/styles/core/base/_misc.scss +0 -20
- package/dist/styles/core/base/_mixins.scss +0 -84
- package/dist/styles/core/base/_route-transitions.scss +0 -70
- package/dist/styles/core/base/_utilities.scss +0 -418
- package/dist/styles/core/base/_utils.scss +0 -100
- package/dist/styles/core/base/_variables.scss +0 -190
- package/dist/styles/core/base/_vertical-nav.scss +0 -264
- package/dist/styles/core/base/libs/_perfect-scrollbar.scss +0 -35
- package/dist/styles/core/base/libs/vuetify/_index.scss +0 -1
- package/dist/styles/core/base/libs/vuetify/_overrides.scss +0 -380
- package/dist/styles/core/base/libs/vuetify/_variables.scss +0 -48
- package/dist/styles/core/base/placeholders/_default-layout-vertical-nav.scss +0 -48
- package/dist/styles/core/base/placeholders/_default-layout.scss +0 -3
- package/dist/styles/core/base/placeholders/_index.scss +0 -5
- package/dist/styles/core/base/placeholders/_misc.scss +0 -7
- package/dist/styles/core/base/placeholders/_nav.scss +0 -26
- package/dist/styles/core/base/placeholders/_vertical-nav.scss +0 -84
- package/dist/styles/core/base/skins/_bordered.scss +0 -60
- package/dist/styles/core/base/skins/_index.scss +0 -1
- package/dist/styles/core/template/_components.scss +0 -1035
- package/dist/styles/core/template/_default-layout-w-vertical-nav.scss +0 -20
- package/dist/styles/core/template/_utilities.scss +0 -20
- package/dist/styles/core/template/_variables.scss +0 -67
- package/dist/styles/core/template/_vertical-nav.scss +0 -41
- package/dist/styles/core/template/index.css +0 -18779
- package/dist/styles/core/template/index.scss +0 -15
- package/dist/styles/core/template/libs/vuetify/_variables.scss +0 -464
- package/dist/styles/core/template/libs/vuetify/index.css +0 -739
- package/dist/styles/core/template/libs/vuetify/index.scss +0 -1
- package/dist/styles/core/template/pages/misc.css +0 -16
- package/dist/styles/core/template/pages/misc.scss +0 -20
- package/dist/styles/core/template/placeholders/_default-layout-vertical-nav.scss +0 -9
- package/dist/styles/core/template/placeholders/_index.scss +0 -3
- package/dist/styles/core/template/placeholders/_nav.scss +0 -15
- package/dist/styles/core/template/placeholders/_vertical-nav.scss +0 -18
- package/dist/styles/core/template/skins/_bordered.scss +0 -36
- package/dist/styles/core/template/skins/_index.scss +0 -1
- package/dist/styles/layouts/_classes.scss +0 -3
- package/dist/styles/layouts/_dashboard-layout.scss +0 -43
- package/dist/styles/layouts/_global.scss +0 -10
- package/dist/styles/layouts/_mixins.scss +0 -28
- package/dist/styles/layouts/_placeholders.scss +0 -53
- package/dist/styles/layouts/_rtl.scss +0 -7
- package/dist/styles/layouts/_variables.scss +0 -22
- package/dist/styles/layouts/index.css +0 -14
- package/dist/styles/layouts/index.scss +0 -2
- package/dist/types.d.ts +0 -218
- package/dist/utils/apiUrl.d.ts +0 -1
- package/dist/utils/apiUrl.js +0 -15
- package/dist/utils/apiUrl.mjs +0 -8
- package/dist/utils/client.d.ts +0 -9
- package/dist/utils/client.js +0 -53
- package/dist/utils/client.mjs +0 -39
- package/dist/utils/files.d.ts +0 -2
- package/dist/utils/files.js +0 -35
- package/dist/utils/files.mjs +0 -22
- package/dist/utils/formValidation.d.ts +0 -7
- package/dist/utils/formValidation.js +0 -20
- package/dist/utils/formValidation.mjs +0 -13
- package/dist/utils/formatters.d.ts +0 -12
- package/dist/utils/formatters.js +0 -84
- package/dist/utils/formatters.mjs +0 -56
- package/dist/utils/hijriDate.d.ts +0 -58
- package/dist/utils/hijriDate.js +0 -168
- package/dist/utils/hijriDate.mjs +0 -1951
- package/dist/utils/i18n.d.ts +0 -8
- package/dist/utils/i18n.js +0 -36
- package/dist/utils/i18n.mjs +0 -27
- package/dist/utils/index.d.ts +0 -10
- package/dist/utils/index.js +0 -115
- package/dist/utils/index.mjs +0 -10
- package/dist/utils/queryParams.d.ts +0 -4
- package/dist/utils/queryParams.js +0 -26
- package/dist/utils/queryParams.mjs +0 -18
- package/dist/utils/ruleValidator.d.ts +0 -41
- package/dist/utils/ruleValidator.js +0 -210
- package/dist/utils/ruleValidator.mjs +0 -195
- package/dist/utils/toaster.d.ts +0 -12
- package/dist/utils/toaster.js +0 -68
- package/dist/utils/toaster.mjs +0 -58
- package/dist/utils/utils.d.ts +0 -9
- package/dist/utils/utils.js +0 -84
- package/dist/utils/utils.mjs +0 -67
|
@@ -1,361 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { VCol, VRow, VCardText, VDivider, VProgressCircular, VIcon, VSpacer, VDataTableServer } from "vuetify/components";
|
|
3
|
-
import { useQuery } from "@tanstack/vue-query";
|
|
4
|
-
import { useRoute, useRouter } from "vue-router";
|
|
5
|
-
import { computed, reactive, ref, watch } from "vue";
|
|
6
|
-
import { useI18n } from "vue-i18n";
|
|
7
|
-
import AppCard from "../cards/AppCard.vue";
|
|
8
|
-
import { responseAlert } from "../../utils/toaster";
|
|
9
|
-
import { buildQueryString } from "../../utils/queryParams";
|
|
10
|
-
import { client } from "../../utils/client";
|
|
11
|
-
import { formatDate } from "../../utils/formatters";
|
|
12
|
-
import { useTableFilters, usePagination } from "../../composables/useTableFilters";
|
|
13
|
-
import { useIsMobile } from "../../composables/useIsMobile";
|
|
14
|
-
import BaseButton from "../forms/BaseButton.vue";
|
|
15
|
-
import AppSelect from "../forms/AppSelect.vue";
|
|
16
|
-
import FilterGenerator from "./FilterGenerator.vue";
|
|
17
|
-
import TablePagination from "./TablePagination.vue";
|
|
18
|
-
const { t } = useI18n();
|
|
19
|
-
const { showValidationAlert } = responseAlert();
|
|
20
|
-
const route = useRoute();
|
|
21
|
-
const router = useRouter();
|
|
22
|
-
const pageSizeOptions = [
|
|
23
|
-
{ value: 30, title: "30" },
|
|
24
|
-
{ value: 60, title: "60" },
|
|
25
|
-
{ value: 90, title: "90" },
|
|
26
|
-
{ value: 120, title: "120" }
|
|
27
|
-
];
|
|
28
|
-
const props = defineProps({
|
|
29
|
-
headers: { type: Array, required: true, default: () => [] },
|
|
30
|
-
formFilters: { type: Array, required: false, default: () => [] },
|
|
31
|
-
url: { type: String, required: false, default: "" },
|
|
32
|
-
queryParams: { type: Object, required: false, default: () => ({}) },
|
|
33
|
-
enableButtons: { type: Boolean, required: false, default: false },
|
|
34
|
-
enableButtonsFilter: { type: Boolean, required: false, default: true },
|
|
35
|
-
enablePageSizeOptions: { type: Boolean, required: false, default: true },
|
|
36
|
-
enableActionButtons: { type: Boolean, required: false, default: true },
|
|
37
|
-
enableBaseButtons: { type: Boolean, required: false, default: true },
|
|
38
|
-
secondaryStyle: { type: Boolean, required: false },
|
|
39
|
-
replaceNullWithDash: { type: Boolean, required: false, default: true },
|
|
40
|
-
withoutQueryParams: { type: Boolean, required: false, default: false },
|
|
41
|
-
showSelect: { type: Boolean, required: false },
|
|
42
|
-
returnObject: { type: Boolean, required: false, default: false },
|
|
43
|
-
stickyActions: { type: Boolean, required: false, default: false }
|
|
44
|
-
});
|
|
45
|
-
const modelValue = defineModel({ type: Array, ...{ default: [] } });
|
|
46
|
-
const { processedFormFilters, filters, urlQueryParams } = useTableFilters({
|
|
47
|
-
formFilters: computed(() => props.formFilters),
|
|
48
|
-
syncFiltersWithUrl: !props.withoutQueryParams
|
|
49
|
-
});
|
|
50
|
-
const { currentPage, itemsPerPage } = usePagination({
|
|
51
|
-
syncFiltersWithUrl: !props.withoutQueryParams,
|
|
52
|
-
defaultValues: {
|
|
53
|
-
pageSize: pageSizeOptions[0].value
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
const errors = reactive({ data: [] });
|
|
57
|
-
const totals = ref({});
|
|
58
|
-
const pagination = ref({
|
|
59
|
-
to: 1,
|
|
60
|
-
from: 1,
|
|
61
|
-
total: 1,
|
|
62
|
-
count: 1,
|
|
63
|
-
per_page: 1,
|
|
64
|
-
current_page: 1,
|
|
65
|
-
last_page: 1
|
|
66
|
-
});
|
|
67
|
-
const queryParamsString = computed(() => buildQueryString({
|
|
68
|
-
...props.queryParams,
|
|
69
|
-
...urlQueryParams.value,
|
|
70
|
-
page: currentPage.value,
|
|
71
|
-
pages_count: itemsPerPage.value
|
|
72
|
-
}));
|
|
73
|
-
const queryKey = computed(() => ["table-data", props.url, queryParamsString.value]);
|
|
74
|
-
const { data, error: tableError, isLoading, refetch: refresh } = useQuery({
|
|
75
|
-
queryKey,
|
|
76
|
-
queryFn: async () => {
|
|
77
|
-
const response = await client.get(`${props.url}?${queryParamsString.value}`);
|
|
78
|
-
pagination.value = response.pagination;
|
|
79
|
-
totals.value = response.totals ?? {};
|
|
80
|
-
errors.data = [];
|
|
81
|
-
return response;
|
|
82
|
-
},
|
|
83
|
-
select: ({ data: data2, ...rest }) => {
|
|
84
|
-
return {
|
|
85
|
-
rows: props.replaceNullWithDash ? data2.map((item) => replaceItemNullWithDash(item)) : data2,
|
|
86
|
-
...rest
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
function reset() {
|
|
91
|
-
const defaults = {};
|
|
92
|
-
processedFormFilters.value.forEach((filter) => {
|
|
93
|
-
defaults[filter.name] = null;
|
|
94
|
-
});
|
|
95
|
-
router.replace({ path: route.path, query: props.withoutQueryParams ? {} : props.queryParams }).finally(() => {
|
|
96
|
-
filters.value = defaults;
|
|
97
|
-
currentPage.value = 1;
|
|
98
|
-
itemsPerPage.value = pageSizeOptions[0].value;
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
function replaceItemNullWithDash(item) {
|
|
102
|
-
if (Array.isArray(item)) {
|
|
103
|
-
return item.map(replaceItemNullWithDash);
|
|
104
|
-
}
|
|
105
|
-
if (typeof item === "object") {
|
|
106
|
-
return Object.fromEntries(
|
|
107
|
-
Object.entries(item).map(([key, value]) => [
|
|
108
|
-
key,
|
|
109
|
-
value === null ? "-" : typeof value === "object" ? replaceItemNullWithDash(value) : value
|
|
110
|
-
])
|
|
111
|
-
);
|
|
112
|
-
}
|
|
113
|
-
return item;
|
|
114
|
-
}
|
|
115
|
-
const hasFilters = computed(() => processedFormFilters.value.length > 0);
|
|
116
|
-
const headers = computed(() => props.headers.map((header) => ({
|
|
117
|
-
...header,
|
|
118
|
-
title: t(header.title),
|
|
119
|
-
sortable: false
|
|
120
|
-
})));
|
|
121
|
-
watch(tableError, (data2) => {
|
|
122
|
-
if (data2) {
|
|
123
|
-
errors.data = data2.response?._data?.status.errors_list;
|
|
124
|
-
showValidationAlert(data2);
|
|
125
|
-
}
|
|
126
|
-
});
|
|
127
|
-
defineExpose({
|
|
128
|
-
filterQueryString: queryParamsString,
|
|
129
|
-
isLoading,
|
|
130
|
-
filters,
|
|
131
|
-
refresh,
|
|
132
|
-
totals
|
|
133
|
-
});
|
|
134
|
-
</script>
|
|
135
|
-
|
|
136
|
-
<template>
|
|
137
|
-
<section>
|
|
138
|
-
<VRow>
|
|
139
|
-
<VCol cols="12">
|
|
140
|
-
<AppCard
|
|
141
|
-
:style="{
|
|
142
|
-
overflow: useIsMobile().value ? 'auto !important' : 'inherit !important'
|
|
143
|
-
}"
|
|
144
|
-
style="z-index: unset !important;"
|
|
145
|
-
:is-loading="isLoading && secondaryStyle"
|
|
146
|
-
>
|
|
147
|
-
<template v-if="enableButtons" #append>
|
|
148
|
-
<slot name="buttons" />
|
|
149
|
-
</template>
|
|
150
|
-
<!-- filters -->
|
|
151
|
-
<VCardText v-if="hasFilters" class="pt-0">
|
|
152
|
-
<slot name="filters">
|
|
153
|
-
<FilterGenerator
|
|
154
|
-
v-model="filters"
|
|
155
|
-
:forms="processedFormFilters"
|
|
156
|
-
:errors="errors.data"
|
|
157
|
-
/>
|
|
158
|
-
</slot>
|
|
159
|
-
</VCardText>
|
|
160
|
-
|
|
161
|
-
<VDivider v-if="hasFilters" />
|
|
162
|
-
|
|
163
|
-
<!-- options and buttons -->
|
|
164
|
-
<VCardText
|
|
165
|
-
v-if="enablePageSizeOptions || enableActionButtons"
|
|
166
|
-
:class="['d-flex flex-wrap py-4 gap-4', {
|
|
167
|
-
'sticky-actions': stickyActions
|
|
168
|
-
}]"
|
|
169
|
-
>
|
|
170
|
-
<!-- Page Size options -->
|
|
171
|
-
<div v-if="enablePageSizeOptions" class="me-3 d-flex gap-3">
|
|
172
|
-
<AppSelect
|
|
173
|
-
hide-details
|
|
174
|
-
:model-value="itemsPerPage"
|
|
175
|
-
:items="pageSizeOptions"
|
|
176
|
-
style="width: 6.25rem"
|
|
177
|
-
@update:model-value="val => itemsPerPage = Number(val)"
|
|
178
|
-
/>
|
|
179
|
-
</div>
|
|
180
|
-
|
|
181
|
-
<VSpacer />
|
|
182
|
-
|
|
183
|
-
<!-- buttons -->
|
|
184
|
-
<div v-if="enableActionButtons" class="d-flex align-center table-buttons">
|
|
185
|
-
<slot name="action-buttons" />
|
|
186
|
-
|
|
187
|
-
<template v-if="enableBaseButtons">
|
|
188
|
-
<BaseButton
|
|
189
|
-
size="38"
|
|
190
|
-
color="secondary"
|
|
191
|
-
class="ms-2"
|
|
192
|
-
@click="reset"
|
|
193
|
-
>
|
|
194
|
-
<VIcon
|
|
195
|
-
icon="tabler-filter-x"
|
|
196
|
-
size="22"
|
|
197
|
-
/>
|
|
198
|
-
</BaseButton>
|
|
199
|
-
|
|
200
|
-
<BaseButton
|
|
201
|
-
size="38"
|
|
202
|
-
color="secondary"
|
|
203
|
-
class="ms-2"
|
|
204
|
-
@click="refresh"
|
|
205
|
-
>
|
|
206
|
-
<VIcon
|
|
207
|
-
icon="tabler-refresh"
|
|
208
|
-
size="22"
|
|
209
|
-
/>
|
|
210
|
-
</BaseButton>
|
|
211
|
-
</template>
|
|
212
|
-
</div>
|
|
213
|
-
</VCardText>
|
|
214
|
-
|
|
215
|
-
<VDivider v-if="enableButtonsFilter" :class="{
|
|
216
|
-
'sticky-divider': stickyActions
|
|
217
|
-
}" />
|
|
218
|
-
|
|
219
|
-
<div :class="[!useIsMobile().value || 'overflow-auto app-h-fit', {
|
|
220
|
-
'secondary-table': secondaryStyle,
|
|
221
|
-
'responsive-table': useIsMobile().value
|
|
222
|
-
}]">
|
|
223
|
-
<!-- table -->
|
|
224
|
-
<VDataTableServer
|
|
225
|
-
v-model="modelValue"
|
|
226
|
-
:class="{
|
|
227
|
-
'mt-5 px-5': secondaryStyle
|
|
228
|
-
}"
|
|
229
|
-
:items="data?.rows"
|
|
230
|
-
:items-length="data?.pagination.total ?? 0"
|
|
231
|
-
:headers="headers"
|
|
232
|
-
:loading="isLoading"
|
|
233
|
-
:no-data-text="t('no_data')"
|
|
234
|
-
:fixed-header="useIsMobile().value"
|
|
235
|
-
:show-select="showSelect"
|
|
236
|
-
:return-object="returnObject"
|
|
237
|
-
>
|
|
238
|
-
<!-- columns -->
|
|
239
|
-
<template v-for="(_, name) in $slots" #[name]="slotProps">
|
|
240
|
-
<slot :name="name" v-bind="slotProps || {}" />
|
|
241
|
-
</template>
|
|
242
|
-
|
|
243
|
-
<template #item.index="{ index }">
|
|
244
|
-
{{ (data?.pagination.total ?? 0) - index - (data?.pagination.from ?? 0) + 1 }}
|
|
245
|
-
</template>
|
|
246
|
-
|
|
247
|
-
<template #item.created_at="{ item }">
|
|
248
|
-
<div class="d-flex text-pre-line">
|
|
249
|
-
{{ formatDate(item.raw?.created_at) }}
|
|
250
|
-
</div>
|
|
251
|
-
</template>
|
|
252
|
-
|
|
253
|
-
<template #loader />
|
|
254
|
-
|
|
255
|
-
<!-- loading -->
|
|
256
|
-
<template #loading>
|
|
257
|
-
<div class="text-center">
|
|
258
|
-
<VProgressCircular indeterminate />
|
|
259
|
-
</div>
|
|
260
|
-
</template>
|
|
261
|
-
|
|
262
|
-
<!-- pagination -->
|
|
263
|
-
<template #bottom>
|
|
264
|
-
<slot name="inside-bottom" :totals="data?.totals" />
|
|
265
|
-
<TablePagination v-model="currentPage" :pagination="pagination" />
|
|
266
|
-
</template>
|
|
267
|
-
</VDataTableServer>
|
|
268
|
-
</div>
|
|
269
|
-
</AppCard>
|
|
270
|
-
</VCol>
|
|
271
|
-
</VRow>
|
|
272
|
-
</section>
|
|
273
|
-
</template>
|
|
274
|
-
|
|
275
|
-
<style scoped>
|
|
276
|
-
.sticky-actions {
|
|
277
|
-
position: sticky !important;
|
|
278
|
-
position: -webkit-sticky;
|
|
279
|
-
top: 75px;
|
|
280
|
-
z-index: 11 !important;
|
|
281
|
-
background-color: rgb(var(--v-theme-surface)) !important;
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
.sticky-divider {
|
|
285
|
-
position: sticky !important;
|
|
286
|
-
position: -webkit-sticky;
|
|
287
|
-
top: 146px;
|
|
288
|
-
z-index: 11 !important;
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
:deep(.v-table) .v-table__wrapper > table > tbody > tr > td,
|
|
292
|
-
:deep(.v-table) .v-table__wrapper > table > tbody > tr > th {
|
|
293
|
-
border-bottom: 8px solid rgba(var(--v-table-divider)) !important;
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
:deep(.v-table__wrapper) {
|
|
297
|
-
overflow: inherit !important;
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
:deep(table) tr th {
|
|
301
|
-
position: sticky !important;
|
|
302
|
-
position: -webkit-sticky;
|
|
303
|
-
top: 70px;
|
|
304
|
-
z-index: 10;
|
|
305
|
-
padding-bottom: 0.75rem;
|
|
306
|
-
background-color: rgb(var(--v-theme-surface)) !important;
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
.sticky-actions ~ div :deep(table) tr th {
|
|
310
|
-
top: 146px !important;
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
.table-buttons .v-btn .v-btn__overlay {
|
|
314
|
-
display: none !important;
|
|
315
|
-
}
|
|
316
|
-
.table-buttons .v-btn:hover {
|
|
317
|
-
background-color: rgba(var(--v-theme-secondary), 0.82) !important;
|
|
318
|
-
color: rgb(var(--v-theme-on-secondary)) !important;
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
.secondary-table :deep(table) {
|
|
322
|
-
width: 100% !important;
|
|
323
|
-
border-collapse: collapse !important;
|
|
324
|
-
border-spacing: 0 !important;
|
|
325
|
-
border: 1px solid rgb(var(--v-theme-silver)) !important;
|
|
326
|
-
border-collapse: collapse !important;
|
|
327
|
-
font-size: 13px !important;
|
|
328
|
-
}
|
|
329
|
-
.secondary-table :deep(table) th {
|
|
330
|
-
padding: 14px 16px !important;
|
|
331
|
-
height: fit-content !important;
|
|
332
|
-
top: 80px !important;
|
|
333
|
-
border: 1px solid rgb(var(--v-theme-silver)) !important;
|
|
334
|
-
background-color: rgb(var(--v-theme-gray-200)) !important;
|
|
335
|
-
color: rgb(var(--v-theme-on-surface)) !important;
|
|
336
|
-
}
|
|
337
|
-
.secondary-table :deep(table) td {
|
|
338
|
-
padding: 16px !important;
|
|
339
|
-
height: auto !important;
|
|
340
|
-
border: 1px solid rgb(var(--v-theme-silver)) !important;
|
|
341
|
-
color: rgb(var(--v-theme-on-surface)) !important;
|
|
342
|
-
}
|
|
343
|
-
.secondary-table :deep(.v-table) .v-table__wrapper > table > tbody > tr > td,
|
|
344
|
-
.secondary-table :deep(.v-table) .v-table__wrapper > table > tbody > tr > th {
|
|
345
|
-
border-bottom: 1px solid rgba(var(--v-theme-silver)) !important;
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
.sticky-actions ~ div .secondary-table :deep(table) th {
|
|
349
|
-
top: 156px !important;
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
:deep(.v-overlay) {
|
|
353
|
-
z-index: 500 !important;
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
.responsive-table :deep(table) th {
|
|
357
|
-
position: unset !important;
|
|
358
|
-
top: 0 !important;
|
|
359
|
-
z-index: 10 !important;
|
|
360
|
-
}
|
|
361
|
-
</style>
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import type { FormFilter, Header, ErrorResponseFiled, Pagination, ReplaceableItem } from '../../types';
|
|
2
|
-
type __VLS_Props = {
|
|
3
|
-
headers: Header[];
|
|
4
|
-
formFilters?: FormFilter[];
|
|
5
|
-
url?: string;
|
|
6
|
-
queryParams?: Record<string, string>;
|
|
7
|
-
enableButtons?: boolean;
|
|
8
|
-
enableButtonsFilter?: boolean;
|
|
9
|
-
enablePageSizeOptions?: boolean;
|
|
10
|
-
enableActionButtons?: boolean;
|
|
11
|
-
enableBaseButtons?: boolean;
|
|
12
|
-
secondaryStyle?: boolean;
|
|
13
|
-
replaceNullWithDash?: boolean;
|
|
14
|
-
withoutQueryParams?: boolean;
|
|
15
|
-
showSelect?: boolean;
|
|
16
|
-
returnObject?: boolean;
|
|
17
|
-
stickyActions?: boolean;
|
|
18
|
-
};
|
|
19
|
-
type __VLS_ModelProps = {
|
|
20
|
-
modelValue?: string[];
|
|
21
|
-
};
|
|
22
|
-
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
23
|
-
declare var __VLS_19: {}, __VLS_27: {}, __VLS_59: {}, __VLS_101: string | number, __VLS_102: any, __VLS_115: {
|
|
24
|
-
totals: {
|
|
25
|
-
[key: string]: number;
|
|
26
|
-
} | undefined;
|
|
27
|
-
};
|
|
28
|
-
type __VLS_Slots = {} & {
|
|
29
|
-
[K in NonNullable<typeof __VLS_101>]?: (props: typeof __VLS_102) => any;
|
|
30
|
-
} & {
|
|
31
|
-
buttons?: (props: typeof __VLS_19) => any;
|
|
32
|
-
} & {
|
|
33
|
-
filters?: (props: typeof __VLS_27) => any;
|
|
34
|
-
} & {
|
|
35
|
-
'action-buttons'?: (props: typeof __VLS_59) => any;
|
|
36
|
-
} & {
|
|
37
|
-
'inside-bottom'?: (props: typeof __VLS_115) => any;
|
|
38
|
-
};
|
|
39
|
-
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
40
|
-
filterQueryString: import("vue").ComputedRef<string>;
|
|
41
|
-
isLoading: import("vue").Ref<boolean, boolean> | import("vue").Ref<false, false> | import("vue").Ref<true, true>;
|
|
42
|
-
filters: import("vue").Ref<Record<string, string | number | string[] | [] | number[] | object[] | (string | number | null)[] | null | undefined>, Record<string, string | number | string[] | [] | number[] | object[] | (string | number | null)[] | null | undefined>>;
|
|
43
|
-
refresh: (options?: import("@tanstack/vue-query").RefetchOptions) => Promise<import("@tanstack/vue-query").QueryObserverResult<{
|
|
44
|
-
status: {
|
|
45
|
-
success: boolean;
|
|
46
|
-
code: number;
|
|
47
|
-
message: string;
|
|
48
|
-
error_key: string;
|
|
49
|
-
errors_list?: ErrorResponseFiled[];
|
|
50
|
-
};
|
|
51
|
-
totals?: {
|
|
52
|
-
[key: string]: number;
|
|
53
|
-
};
|
|
54
|
-
pagination: Pagination;
|
|
55
|
-
rows: ReplaceableItem[];
|
|
56
|
-
}, Error>>;
|
|
57
|
-
totals: import("vue").Ref<Record<string, number>, Record<string, number>>;
|
|
58
|
-
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
59
|
-
"update:modelValue": (value: string[]) => any;
|
|
60
|
-
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
61
|
-
"onUpdate:modelValue"?: ((value: string[]) => any) | undefined;
|
|
62
|
-
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
63
|
-
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
64
|
-
declare const _default: typeof __VLS_export;
|
|
65
|
-
export default _default;
|
|
66
|
-
type __VLS_WithSlots<T, S> = T & {
|
|
67
|
-
new (): {
|
|
68
|
-
$slots: S;
|
|
69
|
-
};
|
|
70
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { EditableDataTableItem, ErrorResponseFiled } from '../../types';
|
|
2
|
-
type __VLS_Props = {
|
|
3
|
-
headers: EditableDataTableItem[];
|
|
4
|
-
items: [];
|
|
5
|
-
errors?: ErrorResponseFiled[];
|
|
6
|
-
loading?: boolean;
|
|
7
|
-
module?: string;
|
|
8
|
-
};
|
|
9
|
-
declare var __VLS_39: string | number, __VLS_40: any;
|
|
10
|
-
type __VLS_Slots = {} & {
|
|
11
|
-
[K in NonNullable<typeof __VLS_39>]?: (props: typeof __VLS_40) => any;
|
|
12
|
-
};
|
|
13
|
-
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
14
|
-
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
15
|
-
declare const _default: typeof __VLS_export;
|
|
16
|
-
export default _default;
|
|
17
|
-
type __VLS_WithSlots<T, S> = T & {
|
|
18
|
-
new (): {
|
|
19
|
-
$slots: S;
|
|
20
|
-
};
|
|
21
|
-
};
|