@citizenplane/pimp 17.0.6 → 17.0.8
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 -2
- package/dist/components/CpTable.vue.d.ts.map +1 -1
- package/dist/constants/CpTableConfig.d.ts +0 -4
- package/dist/constants/CpTableConfig.d.ts.map +1 -1
- package/dist/constants/index.d.ts +1 -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 +4 -4
- package/src/constants/CpTableConfig.ts +0 -5
- package/src/constants/index.ts +1 -1
- package/src/stories/CpTable.stories.ts +1 -3
package/package.json
CHANGED
|
@@ -135,7 +135,7 @@ 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
139
|
import { capitalizeFirstLetter } from '@/helpers'
|
|
140
140
|
|
|
141
141
|
interface Emits {
|
|
@@ -151,7 +151,7 @@ interface PaginationServer {
|
|
|
151
151
|
|
|
152
152
|
interface Pagination {
|
|
153
153
|
enabled?: boolean
|
|
154
|
-
format?:
|
|
154
|
+
format?: 'results' | 'pages'
|
|
155
155
|
limit?: number
|
|
156
156
|
server?: PaginationServer
|
|
157
157
|
}
|
|
@@ -397,7 +397,7 @@ const paginationState = computed(() => {
|
|
|
397
397
|
const hasPagination = computed(() => paginationState.value || numberOfResults.value > VISIBLE_ROWS_MAX)
|
|
398
398
|
const paginationFormat = computed(() => {
|
|
399
399
|
if (typeof props.pagination === 'object' && props.pagination.format) return props.pagination.format
|
|
400
|
-
return
|
|
400
|
+
return 'pages'
|
|
401
401
|
})
|
|
402
402
|
const hasRemainingPages = computed(() => numberOfPages.value > activePage.value)
|
|
403
403
|
const isNextEnabled = computed(() => hasRemainingPages.value && !props.isLoading)
|
|
@@ -433,7 +433,7 @@ const pageLastResultIndex = computed(() => {
|
|
|
433
433
|
})
|
|
434
434
|
|
|
435
435
|
const paginationLabel = computed(() => {
|
|
436
|
-
if (paginationFormat.value ===
|
|
436
|
+
if (paginationFormat.value === 'pages') {
|
|
437
437
|
const pluralizedCount = numberOfPages.value > 1 ? 'pages' : 'page'
|
|
438
438
|
return `${activePage.value}/${numberOfPages.value} ${pluralizedCount}`
|
|
439
439
|
}
|
package/src/constants/index.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export type { Colors } from './colors/Colors'
|
|
2
2
|
export { Position } from './Position'
|
|
3
3
|
export type { ToggleColors } from './colors/ToggleColors'
|
|
4
|
-
export {
|
|
4
|
+
export { RESERVED_KEYS, VISIBLE_ROWS_MAX } from './CpTableConfig'
|
|
5
5
|
export type { Sizes } from './Sizes'
|
|
6
6
|
|
|
7
7
|
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
|
}
|