@citizenplane/pimp 17.0.6 → 17.0.7
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/CpTable.vue.d.ts +1 -1
- package/dist/components/CpTable.vue.d.ts.map +1 -1
- package/dist/constants/CpTableConfig.d.ts +1 -4
- package/dist/constants/CpTableConfig.d.ts.map +1 -1
- package/dist/constants/index.d.ts +2 -1
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/pimp.es.js +3316 -3316
- package/dist/pimp.umd.js +44 -44
- package/package.json +1 -1
- package/src/components/CpTable.vue +5 -4
- package/src/constants/CpTableConfig.ts +1 -4
- package/src/constants/index.ts +2 -1
- package/src/stories/CpTable.stories.ts +1 -3
package/package.json
CHANGED
|
@@ -135,7 +135,8 @@ import CpTableEmptyState from '@/components/CpTableEmptyState.vue'
|
|
|
135
135
|
|
|
136
136
|
import { camelize, decamelize } from '@/helpers/string'
|
|
137
137
|
|
|
138
|
-
import {
|
|
138
|
+
import { RESERVED_KEYS, VISIBLE_ROWS_MAX } from '@/constants'
|
|
139
|
+
import type { PAGINATION_FORMATS } from '@/constants'
|
|
139
140
|
import { capitalizeFirstLetter } from '@/helpers'
|
|
140
141
|
|
|
141
142
|
interface Emits {
|
|
@@ -151,7 +152,7 @@ interface PaginationServer {
|
|
|
151
152
|
|
|
152
153
|
interface Pagination {
|
|
153
154
|
enabled?: boolean
|
|
154
|
-
format?:
|
|
155
|
+
format?: PAGINATION_FORMATS
|
|
155
156
|
limit?: number
|
|
156
157
|
server?: PaginationServer
|
|
157
158
|
}
|
|
@@ -397,7 +398,7 @@ const paginationState = computed(() => {
|
|
|
397
398
|
const hasPagination = computed(() => paginationState.value || numberOfResults.value > VISIBLE_ROWS_MAX)
|
|
398
399
|
const paginationFormat = computed(() => {
|
|
399
400
|
if (typeof props.pagination === 'object' && props.pagination.format) return props.pagination.format
|
|
400
|
-
return
|
|
401
|
+
return 'pages'
|
|
401
402
|
})
|
|
402
403
|
const hasRemainingPages = computed(() => numberOfPages.value > activePage.value)
|
|
403
404
|
const isNextEnabled = computed(() => hasRemainingPages.value && !props.isLoading)
|
|
@@ -433,7 +434,7 @@ const pageLastResultIndex = computed(() => {
|
|
|
433
434
|
})
|
|
434
435
|
|
|
435
436
|
const paginationLabel = computed(() => {
|
|
436
|
-
if (paginationFormat.value ===
|
|
437
|
+
if (paginationFormat.value === 'pages') {
|
|
437
438
|
const pluralizedCount = numberOfPages.value > 1 ? 'pages' : 'page'
|
|
438
439
|
return `${activePage.value}/${numberOfPages.value} ${pluralizedCount}`
|
|
439
440
|
}
|
package/src/constants/index.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export type { Colors } from './colors/Colors'
|
|
2
2
|
export { Position } from './Position'
|
|
3
3
|
export type { ToggleColors } from './colors/ToggleColors'
|
|
4
|
-
export { PAGINATION_FORMATS
|
|
4
|
+
export type { PAGINATION_FORMATS } from './CpTableConfig'
|
|
5
|
+
export { RESERVED_KEYS, VISIBLE_ROWS_MAX } from './CpTableConfig'
|
|
5
6
|
export type { Sizes } from './Sizes'
|
|
6
7
|
|
|
7
8
|
export { CustomCpIcons } from './CpCustomIcons'
|
|
@@ -5,8 +5,6 @@ import type { Meta, StoryObj } from '@storybook/vue3-vite'
|
|
|
5
5
|
|
|
6
6
|
import CpTable from '@/components/CpTable.vue'
|
|
7
7
|
|
|
8
|
-
import { PAGINATION_FORMATS } from '@/constants'
|
|
9
|
-
|
|
10
8
|
const meta = {
|
|
11
9
|
title: 'Organisms/CpTable',
|
|
12
10
|
component: CpTable,
|
|
@@ -133,7 +131,7 @@ export const WithPagination: Story = {
|
|
|
133
131
|
pagination: {
|
|
134
132
|
enabled: true,
|
|
135
133
|
limit: 3,
|
|
136
|
-
format:
|
|
134
|
+
format: 'pages',
|
|
137
135
|
},
|
|
138
136
|
},
|
|
139
137
|
}
|