@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@citizenplane/pimp",
3
- "version": "17.0.6",
3
+ "version": "17.0.8",
4
4
  "scripts": {
5
5
  "dev": "storybook dev -p 8081",
6
6
  "build-storybook": "storybook build --output-dir ./docs",
@@ -135,7 +135,7 @@ import CpTableEmptyState from '@/components/CpTableEmptyState.vue'
135
135
 
136
136
  import { camelize, decamelize } from '@/helpers/string'
137
137
 
138
- import { PAGINATION_FORMATS, RESERVED_KEYS, VISIBLE_ROWS_MAX } from '@/constants'
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?: (typeof PAGINATION_FORMATS)[keyof typeof PAGINATION_FORMATS]
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 PAGINATION_FORMATS.PAGES
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 === PAGINATION_FORMATS.PAGES) {
436
+ if (paginationFormat.value === 'pages') {
437
437
  const pluralizedCount = numberOfPages.value > 1 ? 'pages' : 'page'
438
438
  return `${activePage.value}/${numberOfPages.value} ${pluralizedCount}`
439
439
  }
@@ -5,8 +5,3 @@ export enum RESERVED_KEYS {
5
5
  FULL_WIDTH = 'fullWidth',
6
6
  IS_SELECTED = 'isSelected',
7
7
  }
8
-
9
- export enum PAGINATION_FORMATS {
10
- RESULTS = 'results',
11
- PAGES = 'pages',
12
- }
@@ -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 { PAGINATION_FORMATS, RESERVED_KEYS, VISIBLE_ROWS_MAX } from './CpTableConfig'
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: PAGINATION_FORMATS.PAGES,
134
+ format: 'pages',
137
135
  },
138
136
  },
139
137
  }