Repository navigation
FOUR-19237: Cases list "Pagination" #7403
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
45d47f5
FOUR-19237: Cases list Pagination
hjonathan 5c62a1b
FOUR-19237: Cases list Pagination
hjonathan 82c9408
FOUR-19237: Cases list Pagination
hjonathan 23906d9
FOUR-19237: Cases list Pagination
hjonathan 686f04b
FOUR-19237: Cases list Pagination
hjonathan 33642d4
Merge branch 'feature/FOUR-18130' of github.com:ProcessMaker/processm…
hjonathan cc5e79a
FOUR-19237: Cases list Pagination
hjonathan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next
Next commit
FOUR-19237: Cases list Pagination
- Loading branch information
commit 45d47f504948c4098e829dcfad4b2f6a57169279
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
pmPaulis marked this conversation as resolved.
Resolved
pmPaulis marked this conversation as resolved.
Resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,82 +1,238 @@ | ||
| <template> | ||
| <div | ||
| class="tw-flex tw-items-center tw-justify-start tw-space-x-2 tw-bg-white"> | ||
| <div> | ||
| <svg | ||
| class="tw-h-5 tw-w-5" | ||
| viewBox="0 0 20 20" | ||
| fill="currentColor" | ||
| aria-hidden="true"> | ||
| class="tw-flex tw-items-center tw-justify-start tw-space-x-2 tw-text-gray-500 tw-text-sm"> | ||
| <svg | ||
| :class="{ | ||
| 'hover:tw-cursor-pointer hover:tw-bg-gray-100': pageModel >0 | ||
| }" | ||
| class=" tw-rounded-md" | ||
| width="20" | ||
| height="20" | ||
| viewBox="0 0 20 20" | ||
| fill="none" | ||
| xmlns="http://www.w3.org/2000/svg" | ||
| @click="first"> | ||
| <g id="chevron-double-left"> | ||
| <path | ||
| fill-rule="evenodd" | ||
| d="M12.79 5.23a.75.75 0 01-.02 1.06L8.832 10l3.938 3.71a.75.75 0 11-1.04 1.08l-4.5-4.25a.75.75 0 010-1.08l4.5-4.25a.75.75 0 011.06.02z" | ||
| clip-rule="evenodd" /> | ||
| </svg> | ||
| </div> | ||
| id="Shape" | ||
| d="M10 15L5 10L10 5M15 15L10 10L15 5" | ||
| stroke="#9FA8B5" | ||
| stroke-width="1.25" | ||
| stroke-linecap="round" | ||
| stroke-linejoin="round" /> | ||
| </g> | ||
| </svg> | ||
|
|
||
| <div> | ||
| <svg | ||
| class="tw-h-5 tw-w-5" | ||
| viewBox="0 0 20 20" | ||
| fill="currentColor" | ||
| aria-hidden="true"> | ||
| <svg | ||
| :class="{ | ||
| 'hover:tw-cursor-pointer hover:tw-bg-gray-100 ': pageModel >0 | ||
| }" | ||
| class="tw-rounded-md" | ||
| width="20" | ||
| height="20" | ||
| viewBox="0 0 20 20" | ||
| fill="none" | ||
| xmlns="http://www.w3.org/2000/svg" | ||
| @click="prev"> | ||
| <g id="chevron-left"> | ||
| <path | ||
| fill-rule="evenodd" | ||
| d="M12.79 5.23a.75.75 0 01-.02 1.06L8.832 10l3.938 3.71a.75.75 0 11-1.04 1.08l-4.5-4.25a.75.75 0 010-1.08l4.5-4.25a.75.75 0 011.06.02z" | ||
| clip-rule="evenodd" /> | ||
| </svg> | ||
| </div> | ||
| id="Shape" | ||
| d="M12.5 15L7.5 10L12.5 5" | ||
| stroke="#9FA8B5" | ||
| stroke-width="1.25" | ||
| stroke-linecap="round" | ||
| stroke-linejoin="round" /> | ||
| </g> | ||
| </svg> | ||
|
|
||
| <div> | ||
| <div | ||
| class="tw-flex tw-border-1 tw-rounded-md tw-ring-1 tw-ring-inset tw-ring-gray-300"> | ||
| <input | ||
| class="tw-block tw-flex-1 tw-border-0 tw-bg-transparent tw-pl-1 focus-visible:tw-outline-none placeholder:tw-text-gray-400" | ||
| placeholder="1" /> | ||
| </div> | ||
| <div | ||
| class="tw-flex tw-border-1 tw-rounded-md tw-ring-1 tw-ring-inset tw-ring-gray-300"> | ||
| <input | ||
| inputmode="numeric" | ||
| pattern="\d*" | ||
| :value="pageModel" | ||
| class="tw-block tw-w-10 tw-text-center tw-flex-1 tw-border-0 tw-bg-transparent tw-pl-1 | ||
| focus-visible:tw-outline-none placeholder:tw-text-gray-400" | ||
| placeholder="1" | ||
| @change="$emit('go',parseInt($event.target.value))"> | ||
| </div> | ||
|
|
||
| <div> | ||
| <svg | ||
| class="tw-h-5 tw-w-5" | ||
| viewBox="0 0 20 20" | ||
| fill="currentColor" | ||
| aria-hidden="true"> | ||
| <svg | ||
| :class="{ | ||
| 'hover:tw-cursor-pointer hover:tw-bg-gray-100': pageModel < pages-1 | ||
| }" | ||
| class="tw-rounded-md" | ||
| width="20" | ||
| height="20" | ||
| viewBox="0 0 20 20" | ||
| fill="none" | ||
| xmlns="http://www.w3.org/2000/svg" | ||
| @click="next"> | ||
| <g id="chevron-right"> | ||
| <path | ||
| fill-rule="evenodd" | ||
| d="M12.79 5.23a.75.75 0 01-.02 1.06L8.832 10l3.938 3.71a.75.75 0 11-1.04 1.08l-4.5-4.25a.75.75 0 010-1.08l4.5-4.25a.75.75 0 011.06.02z" | ||
| clip-rule="evenodd" /> | ||
| </svg> | ||
| </div> | ||
| id="Shape" | ||
| d="M7.5 5L12.5 10L7.5 15" | ||
| stroke="#9FA8B5" | ||
| stroke-width="1.25" | ||
| stroke-linecap="round" | ||
| stroke-linejoin="round" /> | ||
| </g> | ||
| </svg> | ||
|
|
||
| <div> | ||
| <svg | ||
| class="tw-h-5 tw-w-5" | ||
| viewBox="0 0 20 20" | ||
| fill="currentColor" | ||
| aria-hidden="true"> | ||
| <svg | ||
| :class="{ | ||
| 'hover:tw-cursor-pointer hover:tw-bg-gray-100': pageModel < pages-1 | ||
| }" | ||
| class="tw-rounded-md" | ||
| width="20" | ||
| height="20" | ||
| viewBox="0 0 20 20" | ||
| fill="none" | ||
| xmlns="http://www.w3.org/2000/svg" | ||
| @click="last"> | ||
| <g id="chevron-double-right"> | ||
| <path | ||
| fill-rule="evenodd" | ||
| d="M12.79 5.23a.75.75 0 01-.02 1.06L8.832 10l3.938 3.71a.75.75 0 11-1.04 1.08l-4.5-4.25a.75.75 0 010-1.08l4.5-4.25a.75.75 0 011.06.02z" | ||
| clip-rule="evenodd" /> | ||
| </svg> | ||
| </div> | ||
| id="Shape" | ||
| d="M10 5L15 10L10 15M5 5L10 10L5 15" | ||
| stroke="#9FA8B5" | ||
| stroke-width="1.25" | ||
| stroke-linecap="round" | ||
| stroke-linejoin="round" /> | ||
| </g> | ||
| </svg> | ||
|
|
||
| <div> | ||
| <span> 153 items </span> | ||
| <div class="tw-px-2"> | ||
| <span>{{ `${totalModel} items` }} </span> | ||
| </div> | ||
|
|
||
| <div> | ||
| <span> 15 per page</span> | ||
| <Dropdown | ||
| v-model="selectedOption" | ||
| class="tw-w-40" | ||
| :options="options" | ||
| @change="onChangeOption"> | ||
| <template #input="{toogleShow}"> | ||
| <div | ||
| class="tw-flex tw-full tw-items-center tw-space-x-2" | ||
| @click.prevent.stop="toogleShow()"> | ||
| <span> | ||
| {{ `${selectedOption.value} per page` }} | ||
| </span> | ||
|
|
||
| <i | ||
| class=" hover:tw-bg-gray-100 tw-rounded-md hover:tw-cursor-pointer tw-p-1 fas fa-chevron-down" /> | ||
| </div> | ||
| </template> | ||
| </Dropdown> | ||
| </div> | ||
| </div> | ||
| </template> | ||
| <script> | ||
| import { defineComponent } from "vue"; | ||
| import { defineComponent, ref, computed } from "vue"; | ||
| import { Dropdown } from "../form"; | ||
|
|
||
| const optionsPerPage = [ | ||
| { | ||
| value: 15, | ||
| label: "15 items", | ||
| }, | ||
| { | ||
| value: 30, | ||
| label: "30 items", | ||
| }, | ||
| { | ||
| value: 50, | ||
| label: "50 items", | ||
|
|
||
| }, | ||
| ]; | ||
|
|
||
| export default defineComponent({ | ||
| setup() { | ||
| return {}; | ||
| components: { | ||
| Dropdown, | ||
| }, | ||
| props: { | ||
| total: { | ||
| type: Number, | ||
| default: () => (0), | ||
| }, | ||
| page: { | ||
| type: Number, | ||
| default: () => (0), | ||
| }, | ||
| pages: { | ||
| type: Number, | ||
| default: () => (0), | ||
| }, | ||
| }, | ||
| emits: ["perPage", "go"], | ||
| setup(props, { emit }) { | ||
| const options = ref(optionsPerPage); | ||
| const totalModel = computed(() => props.total); | ||
| const pageModel = ref(props.page); | ||
|
|
||
| const selectedOption = ref({ | ||
| value: 15, | ||
| label: "15 items", | ||
| }); | ||
|
|
||
| const first = () => { | ||
| if (pageModel.value > 0) { | ||
| pageModel.value = 0; | ||
| emit("go", 0); | ||
| } | ||
| }; | ||
|
|
||
| const prev = () => { | ||
| if (pageModel.value > 0) { | ||
| pageModel.value -= 1; | ||
| emit("go", pageModel.value); | ||
| } | ||
| }; | ||
|
|
||
| const next = () => { | ||
| if (pageModel.value < props.pages - 1) { | ||
| pageModel.value += 1; | ||
| emit("go", pageModel.value); | ||
| } | ||
| }; | ||
|
|
||
| const last = () => { | ||
| if (pageModel.value < props.pages - 1) { | ||
| pageModel.value = props.pages - 1; | ||
| emit("go", pageModel.value); | ||
| } | ||
| }; | ||
|
|
||
| const onChangeOption = (e) => { | ||
| selectedOption.value = e; | ||
| emit("perPage", e.value); | ||
| }; | ||
|
|
||
| return { | ||
| options, | ||
| selectedOption, | ||
| totalModel, | ||
| pageModel, | ||
| first, | ||
| last, | ||
| next, | ||
| onChangeOption, | ||
| prev, | ||
| }; | ||
| }, | ||
| }); | ||
| </script> | ||
| <style scoped> | ||
| /* Chrome, Safari, Edge, Opera */ | ||
| input::-webkit-outer-spin-button, | ||
| input::-webkit-inner-spin-button { | ||
| -webkit-appearance: none; | ||
| margin: 0; | ||
| } | ||
|
|
||
| /* Firefox */ | ||
| input[type=number] { | ||
| -moz-appearance: textfield; | ||
| } | ||
| </style> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.