From 45d47f504948c4098e829dcfad4b2f6a57169279 Mon Sep 17 00:00:00 2001 From: Henry Jonas Date: Mon, 23 Sep 2024 15:40:42 -0400 Subject: [PATCH 1/6] FOUR-19237: Cases list Pagination --- .../jscomposition/base/form/Dropdown.vue | 26 +- .../jscomposition/base/table/Pagination.vue | 272 ++++++++++++++---- resources/jscomposition/base/table/TCell.vue | 13 +- resources/jscomposition/base/ui/AppAvatar.vue | 24 +- .../jscomposition/base/ui/AppPopover.vue | 32 +-- .../cases/casesMain/CasesDataSection.vue | 37 ++- .../cases/casesMain/api/index.js | 133 ++++++--- .../cases/casesMain/config/columns.js | 54 +++- .../system/table/cell/CaseTitleCell.vue | 43 +-- .../system/table/cell/LinkCell.vue | 55 ++++ .../system/table/cell/ParticipantsCell.vue | 19 +- .../table/cell/TruncatedOptionsCell.vue | 25 +- .../jscomposition/system/table/cell/index.js | 14 +- 13 files changed, 580 insertions(+), 167 deletions(-) create mode 100644 resources/jscomposition/system/table/cell/LinkCell.vue diff --git a/resources/jscomposition/base/form/Dropdown.vue b/resources/jscomposition/base/form/Dropdown.vue index 6c2e839aad..6ad84225d4 100644 --- a/resources/jscomposition/base/form/Dropdown.vue +++ b/resources/jscomposition/base/form/Dropdown.vue @@ -21,6 +21,7 @@
    @@ -92,6 +93,8 @@ export default defineComponent({ emits: ["input", "change"], setup(props, { emit }) { const inputRef = ref(); + const containerRef = ref(); + const show = ref(false); const widthContainer = ref(100); const top = ref(0); @@ -121,8 +124,18 @@ export default defineComponent({ emit("change", option); }; + /** + * This method calculates the new position for dropdown menu + * Considers: + * - Space down in relation to viewport + * + * Increase other use cases + */ const calculatePosition = () => { const rect = inputRef.value?.getBoundingClientRect(); + const containerRect = containerRef.value.getBoundingClientRect(); + const viewportWidth = window.innerWidth; + const viewportHeight = window.innerHeight; widthContainer.value = rect.width || 100; @@ -137,6 +150,14 @@ export default defineComponent({ container = container.parentElement; } + // Check: Does the dropdown menu have space down? + if (rect.top + containerRect.height > viewportHeight) { + topPosition = rect.top - containerRect.height; + + top.value = topPosition; + return; + } + top.value = inputRef.value.offsetTop - topPosition; }; @@ -145,10 +166,10 @@ export default defineComponent({ }; const toogleShow = ($event) => { - calculatePosition($event); + show.value = !show.value; nextTick(() => { - show.value = !show.value; + calculatePosition($event); }); }; @@ -161,6 +182,7 @@ export default defineComponent({ }); return { + containerRef, show, data, inputRef, diff --git a/resources/jscomposition/base/table/Pagination.vue b/resources/jscomposition/base/table/Pagination.vue index 548b10e20f..d0f5d3ceb6 100644 --- a/resources/jscomposition/base/table/Pagination.vue +++ b/resources/jscomposition/base/table/Pagination.vue @@ -1,82 +1,238 @@ + diff --git a/resources/jscomposition/base/table/TCell.vue b/resources/jscomposition/base/table/TCell.vue index 74d87bdc2f..7b79296be8 100644 --- a/resources/jscomposition/base/table/TCell.vue +++ b/resources/jscomposition/base/table/TCell.vue @@ -11,8 +11,9 @@
@@ -45,7 +46,17 @@ export default defineComponent({ } return get(props.row, props.column?.field) || ""; }; + + const getComponent = () => props.column.cellRenderer().component; + + const getParams = () => { + console.log("BREAK POINT AQUIII renderer"); + return props.column.cellRenderer().params || {}; + }; + return { + getComponent, + getParams, getValue, }; }, diff --git a/resources/jscomposition/base/ui/AppAvatar.vue b/resources/jscomposition/base/ui/AppAvatar.vue index cdad2ccb14..185a9a4eb8 100644 --- a/resources/jscomposition/base/ui/AppAvatar.vue +++ b/resources/jscomposition/base/ui/AppAvatar.vue @@ -1,16 +1,22 @@ diff --git a/resources/jscomposition/system/table/cell/ParticipantsCell.vue b/resources/jscomposition/system/table/cell/ParticipantsCell.vue index 4d00a596bb..4907726bd9 100644 --- a/resources/jscomposition/system/table/cell/ParticipantsCell.vue +++ b/resources/jscomposition/system/table/cell/ParticipantsCell.vue @@ -6,15 +6,12 @@ class="tw-group"> + :hover="true"> - + @click="onClick(participant)" />