@winchsa/ui 0.1.33 → 0.1.35
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/dist/components/Breadcrumbs.d.vue.ts +7 -0
- package/dist/components/Breadcrumbs.vue +46 -0
- package/dist/components/Breadcrumbs.vue.d.ts +7 -0
- package/dist/components/CustomizerSection.d.vue.ts +17 -0
- package/dist/components/CustomizerSection.vue +19 -0
- package/dist/components/CustomizerSection.vue.d.ts +17 -0
- package/dist/components/DialogCloseBtn.d.vue.ts +7 -0
- package/dist/components/DialogCloseBtn.vue +20 -0
- package/dist/components/DialogCloseBtn.vue.d.ts +7 -0
- package/dist/components/Drawer.d.vue.ts +28 -0
- package/dist/components/Drawer.vue +60 -0
- package/dist/components/Drawer.vue.d.ts +28 -0
- package/dist/components/IconBtn.d.vue.ts +18 -0
- package/dist/components/IconBtn.vue +24 -0
- package/dist/components/IconBtn.vue.d.ts +18 -0
- package/dist/components/LoadingBar.d.vue.ts +6 -0
- package/dist/components/LoadingBar.vue +31 -0
- package/dist/components/LoadingBar.vue.d.ts +6 -0
- package/dist/components/LoadingDialog.d.vue.ts +12 -0
- package/dist/components/LoadingDialog.vue +41 -0
- package/dist/components/LoadingDialog.vue.d.ts +12 -0
- package/dist/components/LoadingItem.d.vue.ts +25 -0
- package/dist/components/LoadingItem.vue +66 -0
- package/dist/components/LoadingItem.vue.d.ts +25 -0
- package/dist/components/Modal.d.vue.ts +50 -0
- package/dist/components/Modal.vue +155 -0
- package/dist/components/Modal.vue.d.ts +50 -0
- package/dist/components/MoreBtn.d.vue.ts +17 -0
- package/dist/components/MoreBtn.vue +28 -0
- package/dist/components/MoreBtn.vue.d.ts +17 -0
- package/dist/components/ScrollToTop.d.vue.ts +3 -0
- package/dist/components/ScrollToTop.vue +39 -0
- package/dist/components/ScrollToTop.vue.d.ts +3 -0
- package/dist/components/SiteTitle.d.vue.ts +3 -0
- package/dist/components/SiteTitle.vue +14 -0
- package/dist/components/SiteTitle.vue.d.ts +3 -0
- package/dist/components/Toaster.d.vue.ts +6 -0
- package/dist/components/Toaster.vue +19 -0
- package/dist/components/Toaster.vue.d.ts +6 -0
- package/dist/components/cards/AppCard.d.vue.ts +18 -0
- package/dist/components/cards/AppCard.vue +45 -0
- package/dist/components/cards/AppCard.vue.d.ts +18 -0
- package/dist/components/cards/AppCardActions.d.vue.ts +33 -0
- package/dist/components/cards/AppCardActions.vue +126 -0
- package/dist/components/cards/AppCardActions.vue.d.ts +33 -0
- package/dist/components/cards/CardStatisticsHorizontal.d.vue.ts +9 -0
- package/dist/components/cards/CardStatisticsHorizontal.vue +29 -0
- package/dist/components/cards/CardStatisticsHorizontal.vue.d.ts +9 -0
- package/dist/components/cards/CheckboxesCard.d.vue.ts +18 -0
- package/dist/components/cards/CheckboxesCard.vue +108 -0
- package/dist/components/cards/CheckboxesCard.vue.d.ts +18 -0
- package/dist/components/cards/HeaderCard.d.vue.ts +9 -0
- package/dist/components/cards/HeaderCard.vue +31 -0
- package/dist/components/cards/HeaderCard.vue.d.ts +9 -0
- package/dist/components/cards/ImageCard.d.vue.ts +33 -0
- package/dist/components/cards/ImageCard.vue +73 -0
- package/dist/components/cards/ImageCard.vue.d.ts +33 -0
- package/dist/components/cards/InputCard.d.vue.ts +21 -0
- package/dist/components/cards/InputCard.vue +60 -0
- package/dist/components/cards/InputCard.vue.d.ts +21 -0
- package/dist/components/cards/StaticCard.d.vue.ts +21 -0
- package/dist/components/cards/StaticCard.vue +37 -0
- package/dist/components/cards/StaticCard.vue.d.ts +21 -0
- package/dist/components/forms/Accordion.d.vue.ts +19 -0
- package/dist/components/forms/Accordion.vue +43 -0
- package/dist/components/forms/Accordion.vue.d.ts +19 -0
- package/dist/components/forms/AppBarSearch.d.vue.ts +43 -0
- package/dist/components/forms/AppBarSearch.vue +345 -0
- package/dist/components/forms/AppBarSearch.vue.d.ts +43 -0
- package/dist/components/forms/AppCombobox.d.vue.ts +13 -0
- package/dist/components/forms/AppCombobox.vue +60 -0
- package/dist/components/forms/AppCombobox.vue.d.ts +13 -0
- package/dist/components/forms/AppDrawerHeaderSection.d.vue.ts +20 -0
- package/dist/components/forms/AppDrawerHeaderSection.vue +21 -0
- package/dist/components/forms/AppDrawerHeaderSection.vue.d.ts +20 -0
- package/dist/components/forms/AppLabel.d.vue.ts +24 -0
- package/dist/components/forms/AppLabel.vue +47 -0
- package/dist/components/forms/AppLabel.vue.d.ts +24 -0
- package/dist/components/forms/AppLink.d.vue.ts +19 -0
- package/dist/components/forms/AppLink.vue +50 -0
- package/dist/components/forms/AppLink.vue.d.ts +19 -0
- package/dist/components/forms/AppNumberField.d.vue.ts +20 -0
- package/dist/components/forms/AppNumberField.vue +79 -0
- package/dist/components/forms/AppNumberField.vue.d.ts +20 -0
- package/dist/components/forms/AppOtpInput.d.vue.ts +13 -0
- package/dist/components/forms/AppOtpInput.vue +84 -0
- package/dist/components/forms/AppOtpInput.vue.d.ts +13 -0
- package/dist/components/forms/AppSearchHeader.d.vue.ts +8 -0
- package/dist/components/forms/AppSearchHeader.vue +72 -0
- package/dist/components/forms/AppSearchHeader.vue.d.ts +8 -0
- package/dist/components/forms/AppSelect.d.vue.ts +21 -0
- package/dist/components/forms/AppSelect.vue +94 -0
- package/dist/components/forms/AppSelect.vue.d.ts +21 -0
- package/dist/components/forms/AppStepper.d.vue.ts +21 -0
- package/dist/components/forms/AppStepper.vue +232 -0
- package/dist/components/forms/AppStepper.vue.d.ts +21 -0
- package/dist/components/forms/AppSwitch.d.vue.ts +18 -0
- package/dist/components/forms/AppSwitch.vue +60 -0
- package/dist/components/forms/AppSwitch.vue.d.ts +18 -0
- package/dist/components/forms/AppTextField.d.vue.ts +17 -0
- package/dist/components/forms/AppTextField.vue +62 -0
- package/dist/components/forms/AppTextField.vue.d.ts +17 -0
- package/dist/components/forms/AppTextarea.d.vue.ts +17 -0
- package/dist/components/forms/AppTextarea.vue +65 -0
- package/dist/components/forms/AppTextarea.vue.d.ts +17 -0
- package/dist/components/forms/AttachmentCropperInput.d.vue.ts +18 -0
- package/dist/components/forms/AttachmentCropperInput.vue +227 -0
- package/dist/components/forms/AttachmentCropperInput.vue.d.ts +18 -0
- package/dist/components/forms/AttachmentInput.d.vue.ts +16 -0
- package/dist/components/forms/AttachmentInput.vue +116 -0
- package/dist/components/forms/AttachmentInput.vue.d.ts +16 -0
- package/dist/components/forms/AutocompleteInput.d.vue.ts +86 -0
- package/dist/components/forms/AutocompleteInput.vue +778 -0
- package/dist/components/forms/AutocompleteInput.vue.d.ts +86 -0
- package/dist/components/forms/BankSelect.d.vue.ts +21 -0
- package/dist/components/forms/BankSelect.vue +43 -0
- package/dist/components/forms/BankSelect.vue.d.ts +21 -0
- package/dist/components/forms/BaseButton.d.vue.ts +20 -0
- package/dist/components/forms/BaseButton.vue +42 -0
- package/dist/components/forms/BaseButton.vue.d.ts +20 -0
- package/dist/components/forms/CounterInput.d.vue.ts +13 -0
- package/dist/components/forms/CounterInput.vue +71 -0
- package/dist/components/forms/CounterInput.vue.d.ts +13 -0
- package/dist/components/forms/CustomCheckboxes.d.vue.ts +25 -0
- package/dist/components/forms/CustomCheckboxes.vue +69 -0
- package/dist/components/forms/CustomCheckboxes.vue.d.ts +25 -0
- package/dist/components/forms/CustomCheckboxesWithIcon.d.vue.ts +25 -0
- package/dist/components/forms/CustomCheckboxesWithIcon.vue +80 -0
- package/dist/components/forms/CustomCheckboxesWithIcon.vue.d.ts +25 -0
- package/dist/components/forms/CustomCheckboxesWithImage.d.vue.ts +16 -0
- package/dist/components/forms/CustomCheckboxesWithImage.vue +67 -0
- package/dist/components/forms/CustomCheckboxesWithImage.vue.d.ts +16 -0
- package/dist/components/forms/CustomRadios.d.vue.ts +25 -0
- package/dist/components/forms/CustomRadios.vue +69 -0
- package/dist/components/forms/CustomRadios.vue.d.ts +25 -0
- package/dist/components/forms/CustomRadiosWithIcon.d.vue.ts +28 -0
- package/dist/components/forms/CustomRadiosWithIcon.vue +98 -0
- package/dist/components/forms/CustomRadiosWithIcon.vue.d.ts +28 -0
- package/dist/components/forms/CustomRadiosWithImage.d.vue.ts +35 -0
- package/dist/components/forms/CustomRadiosWithImage.vue +69 -0
- package/dist/components/forms/CustomRadiosWithImage.vue.d.ts +35 -0
- package/dist/components/forms/DatePicker.d.vue.ts +29 -0
- package/dist/components/forms/DatePicker.vue +392 -0
- package/dist/components/forms/DatePicker.vue.d.ts +29 -0
- package/dist/components/forms/DatePickerRange.d.vue.ts +24 -0
- package/dist/components/forms/DatePickerRange.vue +127 -0
- package/dist/components/forms/DatePickerRange.vue.d.ts +24 -0
- package/dist/components/forms/DraggedUploadFile.d.vue.ts +11 -0
- package/dist/components/forms/DraggedUploadFile.vue +120 -0
- package/dist/components/forms/DraggedUploadFile.vue.d.ts +11 -0
- package/dist/components/forms/ImageCardInput.d.vue.ts +35 -0
- package/dist/components/forms/ImageCardInput.vue +234 -0
- package/dist/components/forms/ImageCardInput.vue.d.ts +35 -0
- package/dist/components/forms/InputValidationWrapper.d.vue.ts +26 -0
- package/dist/components/forms/InputValidationWrapper.vue +24 -0
- package/dist/components/forms/InputValidationWrapper.vue.d.ts +26 -0
- package/dist/components/forms/LicensePlateInput.d.vue.ts +21 -0
- package/dist/components/forms/LicensePlateInput.vue +175 -0
- package/dist/components/forms/LicensePlateInput.vue.d.ts +21 -0
- package/dist/components/forms/ManualDate.d.vue.ts +20 -0
- package/dist/components/forms/ManualDate.vue +264 -0
- package/dist/components/forms/ManualDate.vue.d.ts +20 -0
- package/dist/components/forms/MobileInput.d.vue.ts +25 -0
- package/dist/components/forms/MobileInput.vue +118 -0
- package/dist/components/forms/MobileInput.vue.d.ts +25 -0
- package/dist/components/forms/PasswordInput.d.vue.ts +11 -0
- package/dist/components/forms/PasswordInput.vue +29 -0
- package/dist/components/forms/PasswordInput.vue.d.ts +11 -0
- package/dist/components/forms/RangeInput.d.vue.ts +10 -0
- package/dist/components/forms/RangeInput.vue +48 -0
- package/dist/components/forms/RangeInput.vue.d.ts +10 -0
- package/dist/components/forms/Tabs.d.vue.ts +23 -0
- package/dist/components/forms/Tabs.vue +35 -0
- package/dist/components/forms/Tabs.vue.d.ts +23 -0
- package/dist/components/forms/TimePicker.d.vue.ts +18 -0
- package/dist/components/forms/TimePicker.vue +370 -0
- package/dist/components/forms/TimePicker.vue.d.ts +18 -0
- package/dist/components/table/DataTable.d.vue.ts +70 -0
- package/dist/components/table/DataTable.vue +361 -0
- package/dist/components/table/DataTable.vue.d.ts +70 -0
- package/dist/components/table/EditableDataTable.d.vue.ts +21 -0
- package/dist/components/table/EditableDataTable.vue +330 -0
- package/dist/components/table/EditableDataTable.vue.d.ts +21 -0
- package/dist/components/table/EditableDataTableRow.d.vue.ts +20 -0
- package/dist/components/table/EditableDataTableRow.vue +252 -0
- package/dist/components/table/EditableDataTableRow.vue.d.ts +20 -0
- package/dist/components/table/FilterGenerator.d.vue.ts +13 -0
- package/dist/components/table/FilterGenerator.vue +231 -0
- package/dist/components/table/FilterGenerator.vue.d.ts +13 -0
- package/dist/components/table/StaticTable.d.vue.ts +34 -0
- package/dist/components/table/StaticTable.vue +152 -0
- package/dist/components/table/StaticTable.vue.d.ts +34 -0
- package/dist/components/table/TablePagination.d.vue.ts +15 -0
- package/dist/components/table/TablePagination.vue +73 -0
- package/dist/components/table/TablePagination.vue.d.ts +15 -0
- package/dist/composables/useIsMobile.d.ts +1 -0
- package/dist/composables/useIsMobile.js +10 -0
- package/dist/composables/useIsMobile.mjs +4 -0
- package/dist/composables/useTableFilters.d.ts +23 -0
- package/dist/composables/useTableFilters.js +197 -0
- package/dist/composables/useTableFilters.mjs +184 -0
- package/dist/images/avatar.png +0 -0
- package/dist/images/sa.svg +1 -0
- package/dist/index.d.ts +65 -0
- package/dist/index.js +454 -0
- package/dist/index.mjs +130 -0
- package/dist/lang/ar.json +54 -0
- package/dist/lang/en.json +54 -0
- package/dist/styles/assets/scss/variables/_template.scss +1 -0
- package/dist/styles/assets/scss/variables/_vuetify.scss +1 -0
- package/dist/styles/core/base/_components.scss +164 -0
- package/dist/styles/core/base/_dark.scss +16 -0
- package/dist/styles/core/base/_default-layout-w-vertical-nav.scss +106 -0
- package/dist/styles/core/base/_default-layout.scss +16 -0
- package/dist/styles/core/base/_index.scss +47 -0
- package/dist/styles/core/base/_layouts.scss +63 -0
- package/dist/styles/core/base/_misc.scss +20 -0
- package/dist/styles/core/base/_mixins.scss +84 -0
- package/dist/styles/core/base/_route-transitions.scss +70 -0
- package/dist/styles/core/base/_utilities.scss +418 -0
- package/dist/styles/core/base/_utils.scss +100 -0
- package/dist/styles/core/base/_variables.scss +190 -0
- package/dist/styles/core/base/_vertical-nav.scss +264 -0
- package/dist/styles/core/base/libs/_perfect-scrollbar.scss +35 -0
- package/dist/styles/core/base/libs/vuetify/_index.scss +1 -0
- package/dist/styles/core/base/libs/vuetify/_overrides.scss +380 -0
- package/dist/styles/core/base/libs/vuetify/_variables.scss +48 -0
- package/dist/styles/core/base/placeholders/_default-layout-vertical-nav.scss +48 -0
- package/dist/styles/core/base/placeholders/_default-layout.scss +3 -0
- package/dist/styles/core/base/placeholders/_index.scss +5 -0
- package/dist/styles/core/base/placeholders/_misc.scss +7 -0
- package/dist/styles/core/base/placeholders/_nav.scss +26 -0
- package/dist/styles/core/base/placeholders/_vertical-nav.scss +84 -0
- package/dist/styles/core/base/skins/_bordered.scss +60 -0
- package/dist/styles/core/base/skins/_index.scss +1 -0
- package/dist/styles/core/template/_components.scss +1044 -0
- package/dist/styles/core/template/_default-layout-w-vertical-nav.scss +20 -0
- package/dist/styles/core/template/_utilities.scss +20 -0
- package/dist/styles/core/template/_variables.scss +67 -0
- package/dist/styles/core/template/_vertical-nav.scss +41 -0
- package/dist/styles/core/template/index.css +18786 -0
- package/dist/styles/core/template/index.scss +15 -0
- package/dist/styles/core/template/libs/vuetify/_variables.scss +464 -0
- package/dist/styles/core/template/libs/vuetify/index.css +739 -0
- package/dist/styles/core/template/libs/vuetify/index.scss +1 -0
- package/dist/styles/core/template/pages/misc.css +16 -0
- package/dist/styles/core/template/pages/misc.scss +20 -0
- package/dist/styles/core/template/placeholders/_default-layout-vertical-nav.scss +9 -0
- package/dist/styles/core/template/placeholders/_index.scss +3 -0
- package/dist/styles/core/template/placeholders/_nav.scss +15 -0
- package/dist/styles/core/template/placeholders/_vertical-nav.scss +18 -0
- package/dist/styles/core/template/skins/_bordered.scss +36 -0
- package/dist/styles/core/template/skins/_index.scss +1 -0
- package/dist/styles/layouts/_classes.scss +3 -0
- package/dist/styles/layouts/_dashboard-layout.scss +43 -0
- package/dist/styles/layouts/_global.scss +10 -0
- package/dist/styles/layouts/_mixins.scss +28 -0
- package/dist/styles/layouts/_placeholders.scss +53 -0
- package/dist/styles/layouts/_rtl.scss +7 -0
- package/dist/styles/layouts/_variables.scss +22 -0
- package/dist/styles/layouts/index.css +14 -0
- package/dist/styles/layouts/index.scss +2 -0
- package/dist/types.d.ts +218 -0
- package/dist/utils/apiUrl.d.ts +1 -0
- package/dist/utils/apiUrl.js +15 -0
- package/dist/utils/apiUrl.mjs +8 -0
- package/dist/utils/client.d.ts +9 -0
- package/dist/utils/client.js +53 -0
- package/dist/utils/client.mjs +39 -0
- package/dist/utils/files.d.ts +2 -0
- package/dist/utils/files.js +35 -0
- package/dist/utils/files.mjs +22 -0
- package/dist/utils/formValidation.d.ts +7 -0
- package/dist/utils/formValidation.js +20 -0
- package/dist/utils/formValidation.mjs +13 -0
- package/dist/utils/formatters.d.ts +12 -0
- package/dist/utils/formatters.js +84 -0
- package/dist/utils/formatters.mjs +56 -0
- package/dist/utils/hijriDate.d.ts +58 -0
- package/dist/utils/hijriDate.js +168 -0
- package/dist/utils/hijriDate.mjs +1951 -0
- package/dist/utils/i18n.d.ts +8 -0
- package/dist/utils/i18n.js +36 -0
- package/dist/utils/i18n.mjs +27 -0
- package/dist/utils/index.d.ts +10 -0
- package/dist/utils/index.js +115 -0
- package/dist/utils/index.mjs +10 -0
- package/dist/utils/queryParams.d.ts +4 -0
- package/dist/utils/queryParams.js +26 -0
- package/dist/utils/queryParams.mjs +18 -0
- package/dist/utils/ruleValidator.d.ts +41 -0
- package/dist/utils/ruleValidator.js +210 -0
- package/dist/utils/ruleValidator.mjs +195 -0
- package/dist/utils/toaster.d.ts +12 -0
- package/dist/utils/toaster.js +68 -0
- package/dist/utils/toaster.mjs +58 -0
- package/dist/utils/utils.d.ts +9 -0
- package/dist/utils/utils.js +84 -0
- package/dist/utils/utils.mjs +67 -0
- package/package.json +67 -67
|
@@ -0,0 +1,361 @@
|
|
|
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>
|
|
@@ -0,0 +1,70 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
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
|
+
};
|