@nixxie-cms/core 1.0.3 → 2.0.0
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/CHANGELOG.md +36 -0
- package/CHANGES-1.1.md +134 -0
- package/context/dist/nixxie-cms-core-context.cjs.js +4 -3
- package/context/dist/nixxie-cms-core-context.esm.js +3 -2
- package/dist/declarations/src/access.d.ts +2 -2
- package/dist/declarations/src/access.d.ts.map +1 -1
- package/dist/declarations/src/admin-ui/components/Navigation.d.ts +2 -2
- package/dist/declarations/src/admin-ui/components/Navigation.d.ts.map +1 -1
- package/dist/declarations/src/admin-ui/context.d.ts +6 -6
- package/dist/declarations/src/admin-ui/context.d.ts.map +1 -1
- package/dist/declarations/src/admin-ui/utils/Fields.d.ts +3 -3
- package/dist/declarations/src/admin-ui/utils/Fields.d.ts.map +1 -1
- package/dist/declarations/src/admin-ui/utils/filters.d.ts +5 -5
- package/dist/declarations/src/admin-ui/utils/filters.d.ts.map +1 -1
- package/dist/declarations/src/admin-ui/utils/useCreateItem.d.ts +3 -3
- package/dist/declarations/src/admin-ui/utils/useCreateItem.d.ts.map +1 -1
- package/dist/declarations/src/admin-ui/utils/utils.d.ts +2 -2
- package/dist/declarations/src/admin-ui/utils/utils.d.ts.map +1 -1
- package/dist/declarations/src/context.d.ts +1 -1
- package/dist/declarations/src/context.d.ts.map +1 -1
- package/dist/declarations/src/fields/types/bigInt/index.d.ts +3 -3
- package/dist/declarations/src/fields/types/bigInt/index.d.ts.map +1 -1
- package/dist/declarations/src/fields/types/bytes/index.d.ts +3 -3
- package/dist/declarations/src/fields/types/bytes/index.d.ts.map +1 -1
- package/dist/declarations/src/fields/types/calendarDay/index.d.ts +3 -3
- package/dist/declarations/src/fields/types/calendarDay/index.d.ts.map +1 -1
- package/dist/declarations/src/fields/types/checkbox/index.d.ts +3 -3
- package/dist/declarations/src/fields/types/checkbox/index.d.ts.map +1 -1
- package/dist/declarations/src/fields/types/decimal/index.d.ts +3 -3
- package/dist/declarations/src/fields/types/decimal/index.d.ts.map +1 -1
- package/dist/declarations/src/fields/types/file/index.d.ts +4 -4
- package/dist/declarations/src/fields/types/file/index.d.ts.map +1 -1
- package/dist/declarations/src/fields/types/float/index.d.ts +3 -3
- package/dist/declarations/src/fields/types/float/index.d.ts.map +1 -1
- package/dist/declarations/src/fields/types/image/index.d.ts +4 -4
- package/dist/declarations/src/fields/types/image/index.d.ts.map +1 -1
- package/dist/declarations/src/fields/types/integer/index.d.ts +3 -3
- package/dist/declarations/src/fields/types/integer/index.d.ts.map +1 -1
- package/dist/declarations/src/fields/types/json/index.d.ts +3 -3
- package/dist/declarations/src/fields/types/json/index.d.ts.map +1 -1
- package/dist/declarations/src/fields/types/multiselect/index.d.ts +3 -3
- package/dist/declarations/src/fields/types/multiselect/index.d.ts.map +1 -1
- package/dist/declarations/src/fields/types/multiselect/views/index.d.ts.map +1 -1
- package/dist/declarations/src/fields/types/password/index.d.ts +3 -3
- package/dist/declarations/src/fields/types/password/index.d.ts.map +1 -1
- package/dist/declarations/src/fields/types/relationship/index.d.ts +8 -8
- package/dist/declarations/src/fields/types/relationship/index.d.ts.map +1 -1
- package/dist/declarations/src/fields/types/relationship/views/ComboboxMany.d.ts +3 -3
- package/dist/declarations/src/fields/types/relationship/views/ComboboxMany.d.ts.map +1 -1
- package/dist/declarations/src/fields/types/relationship/views/ComboboxSingle.d.ts +3 -3
- package/dist/declarations/src/fields/types/relationship/views/ComboboxSingle.d.ts.map +1 -1
- package/dist/declarations/src/fields/types/relationship/views/index.d.ts +3 -3
- package/dist/declarations/src/fields/types/relationship/views/index.d.ts.map +1 -1
- package/dist/declarations/src/fields/types/relationship/views/types.d.ts +3 -3
- package/dist/declarations/src/fields/types/relationship/views/types.d.ts.map +1 -1
- package/dist/declarations/src/fields/types/select/index.d.ts +3 -3
- package/dist/declarations/src/fields/types/select/index.d.ts.map +1 -1
- package/dist/declarations/src/fields/types/text/index.d.ts +3 -3
- package/dist/declarations/src/fields/types/text/index.d.ts.map +1 -1
- package/dist/declarations/src/fields/types/timestamp/index.d.ts +3 -3
- package/dist/declarations/src/fields/types/timestamp/index.d.ts.map +1 -1
- package/dist/declarations/src/fields/types/virtual/index.d.ts +7 -7
- package/dist/declarations/src/fields/types/virtual/index.d.ts.map +1 -1
- package/dist/declarations/src/helpers.d.ts +249 -13
- package/dist/declarations/src/helpers.d.ts.map +1 -1
- package/dist/declarations/src/index.d.ts +9 -4
- package/dist/declarations/src/index.d.ts.map +1 -1
- package/dist/declarations/src/internal-unstable/admin-ui/pages/ListPage/index.d.ts.map +1 -1
- package/dist/declarations/src/lib/admin-meta.d.ts +11 -11
- package/dist/declarations/src/lib/admin-meta.d.ts.map +1 -1
- package/dist/declarations/src/lib/core/access-control.d.ts +18 -18
- package/dist/declarations/src/lib/core/access-control.d.ts.map +1 -1
- package/dist/declarations/src/lib/core/cascade.d.ts +47 -0
- package/dist/declarations/src/lib/core/cascade.d.ts.map +1 -0
- package/dist/declarations/src/lib/core/initialise-lists.d.ts +27 -24
- package/dist/declarations/src/lib/core/initialise-lists.d.ts.map +1 -1
- package/dist/declarations/src/lib/env.d.ts +9 -0
- package/dist/declarations/src/lib/env.d.ts.map +1 -0
- package/dist/declarations/src/lib/system.d.ts +1 -1
- package/dist/declarations/src/lib/system.d.ts.map +1 -1
- package/dist/declarations/src/list-features.d.ts +162 -0
- package/dist/declarations/src/list-features.d.ts.map +1 -0
- package/dist/declarations/src/schema.d.ts +24 -23
- package/dist/declarations/src/schema.d.ts.map +1 -1
- package/dist/declarations/src/session.d.ts +75 -0
- package/dist/declarations/src/session.d.ts.map +1 -1
- package/dist/declarations/src/types/admin-meta.d.ts +11 -11
- package/dist/declarations/src/types/admin-meta.d.ts.map +1 -1
- package/dist/declarations/src/types/config/access-control.d.ts +42 -42
- package/dist/declarations/src/types/config/access-control.d.ts.map +1 -1
- package/dist/declarations/src/types/config/fields.d.ts +19 -19
- package/dist/declarations/src/types/config/fields.d.ts.map +1 -1
- package/dist/declarations/src/types/config/hooks.d.ts +131 -131
- package/dist/declarations/src/types/config/hooks.d.ts.map +1 -1
- package/dist/declarations/src/types/config/index.d.ts +190 -8
- package/dist/declarations/src/types/config/index.d.ts.map +1 -1
- package/dist/declarations/src/types/config/lists.d.ts +146 -108
- package/dist/declarations/src/types/config/lists.d.ts.map +1 -1
- package/dist/declarations/src/types/context.d.ts +507 -47
- package/dist/declarations/src/types/context.d.ts.map +1 -1
- package/dist/declarations/src/types/next-fields.d.ts +28 -28
- package/dist/declarations/src/types/next-fields.d.ts.map +1 -1
- package/dist/declarations/src/types/type-info.d.ts +3 -3
- package/dist/declarations/src/types/type-info.d.ts.map +1 -1
- package/dist/{express-455ae20c.cjs.js → express-84d534c2.cjs.js} +6 -6
- package/dist/{express-7559ca2d.esm.js → express-d0a4ce99.esm.js} +6 -6
- package/dist/{index-15c8f81e.esm.js → index-5d8b0b4e.esm.js} +363 -183
- package/dist/index-6055753b.cjs.js +393 -0
- package/dist/{index-42045902.cjs.js → index-ac29f382.cjs.js} +363 -185
- package/dist/index-f1703b7b.esm.js +386 -0
- package/dist/nixxie-cms-core.cjs.js +1388 -30
- package/dist/nixxie-cms-core.esm.js +1362 -24
- package/dist/{non-null-graphql-add6bb3d.cjs.js → non-null-graphql-4a44c122.cjs.js} +1 -1
- package/dist/{non-null-graphql-a84ed64d.esm.js → non-null-graphql-8c5feaae.esm.js} +1 -1
- package/dist/{resolve-hooks-165a9ce2.cjs.js → resolve-hooks-10a5f84c.cjs.js} +240 -6
- package/dist/{resolve-hooks-6813a045.esm.js → resolve-hooks-9e676794.esm.js} +238 -7
- package/dist/{system-a321642d.cjs.js → system-6b37a5f8.cjs.js} +33 -7
- package/dist/{system-03e49e4f.esm.js → system-e591d821.esm.js} +33 -7
- package/fields/dist/nixxie-cms-core-fields.cjs.js +29 -576
- package/fields/dist/nixxie-cms-core-fields.esm.js +18 -565
- package/fields/types/bytes/dist/nixxie-cms-core-fields-types-bytes.cjs.js +4 -2
- package/fields/types/bytes/dist/nixxie-cms-core-fields-types-bytes.esm.js +4 -2
- package/fields/types/multiselect/views/dist/nixxie-cms-core-fields-types-multiselect-views.cjs.js +1 -6
- package/fields/types/multiselect/views/dist/nixxie-cms-core-fields-types-multiselect-views.esm.js +1 -6
- package/fields/types/password/dist/nixxie-cms-core-fields-types-password.cjs.js +4 -2
- package/fields/types/password/dist/nixxie-cms-core-fields-types-password.esm.js +4 -2
- package/internal-unstable/artifacts/dist/nixxie-cms-core-internal-unstable-artifacts.cjs.js +4 -3
- package/internal-unstable/artifacts/dist/nixxie-cms-core-internal-unstable-artifacts.esm.js +4 -3
- package/package.json +4 -4
- package/scripts/cli/dist/nixxie-cms-core-scripts-cli.cjs.js +4 -3
- package/scripts/cli/dist/nixxie-cms-core-scripts-cli.esm.js +4 -3
- package/scripts/dist/nixxie-cms-core-scripts.cjs.js +4 -3
- package/scripts/dist/nixxie-cms-core-scripts.esm.js +4 -3
- package/session/dist/nixxie-cms-core-session.cjs.js +286 -0
- package/session/dist/nixxie-cms-core-session.esm.js +279 -1
- package/src/access.ts +25 -25
- package/src/admin-ui/admin-meta-graphql.ts +5 -5
- package/src/admin-ui/components/CreateButtonLink.tsx +46 -46
- package/src/admin-ui/components/Navigation.tsx +3 -3
- package/src/admin-ui/context.tsx +6 -6
- package/src/admin-ui/utils/Fields.tsx +241 -241
- package/src/admin-ui/utils/actionData.ts +36 -36
- package/src/admin-ui/utils/filters.ts +148 -148
- package/src/admin-ui/utils/useCreateItem.ts +171 -171
- package/src/admin-ui/utils/utils.tsx +127 -127
- package/src/context.ts +1 -1
- package/src/fields/non-null-graphql.ts +115 -115
- package/src/fields/types/bigInt/index.ts +6 -6
- package/src/fields/types/bytes/index.ts +6 -6
- package/src/fields/types/calendarDay/index.ts +18 -19
- package/src/fields/types/checkbox/index.ts +6 -6
- package/src/fields/types/decimal/index.ts +6 -6
- package/src/fields/types/file/index.ts +8 -8
- package/src/fields/types/float/index.ts +6 -6
- package/src/fields/types/image/index.ts +8 -8
- package/src/fields/types/integer/index.ts +6 -6
- package/src/fields/types/json/index.ts +5 -5
- package/src/fields/types/multiselect/index.ts +7 -7
- package/src/fields/types/multiselect/views/index.tsx +149 -151
- package/src/fields/types/password/index.ts +6 -6
- package/src/fields/types/relationship/index.ts +13 -13
- package/src/fields/types/relationship/views/ComboboxMany.tsx +110 -110
- package/src/fields/types/relationship/views/ComboboxSingle.tsx +115 -115
- package/src/fields/types/relationship/views/ContextualActions.tsx +139 -139
- package/src/fields/types/relationship/views/index.tsx +492 -492
- package/src/fields/types/relationship/views/types.ts +46 -46
- package/src/fields/types/relationship/views/useApolloQuery.ts +185 -185
- package/src/fields/types/relationship/views/useFilter.tsx +109 -109
- package/src/fields/types/select/index.ts +6 -6
- package/src/fields/types/text/index.ts +6 -6
- package/src/fields/types/timestamp/index.ts +23 -21
- package/src/fields/types/virtual/index.ts +11 -11
- package/src/helpers.ts +773 -42
- package/src/index.ts +66 -24
- package/src/internal-unstable/admin-ui/pages/ItemPage/common.tsx +4 -4
- package/src/internal-unstable/admin-ui/pages/ItemPage/index.tsx +5 -5
- package/src/internal-unstable/admin-ui/pages/ListPage/index.tsx +8 -8
- package/src/lib/admin-meta.ts +369 -369
- package/src/lib/context/createContext.ts +6 -0
- package/src/lib/core/access-control.ts +434 -434
- package/src/lib/core/cascade.ts +236 -0
- package/src/lib/core/initialise-lists.ts +49 -33
- package/src/lib/core/mutations/index.ts +7 -0
- package/src/lib/core/mutations/nested-mutation-many-input-resolvers.ts +145 -145
- package/src/lib/core/mutations/nested-mutation-one-input-resolvers.ts +71 -71
- package/src/lib/core/queries/output-field.ts +178 -178
- package/src/lib/env.ts +50 -0
- package/src/lib/id-field.ts +2 -2
- package/src/lib/system.ts +221 -207
- package/src/lib/typescript-schema-printer.ts +227 -227
- package/src/list-features.ts +476 -0
- package/src/schema.ts +92 -22
- package/src/session.ts +225 -0
- package/src/types/admin-meta.ts +218 -218
- package/src/types/config/access-control.ts +186 -186
- package/src/types/config/fields.ts +96 -96
- package/src/types/config/hooks.ts +529 -529
- package/src/types/config/index.ts +206 -7
- package/src/types/config/lists.ts +606 -565
- package/src/types/context.ts +592 -55
- package/src/types/next-fields.ts +31 -31
- package/src/types/type-info.ts +38 -38
- package/src/types/type-tests.ts +21 -21
package/src/index.ts
CHANGED
|
@@ -1,24 +1,66 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export type
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
export
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
1
|
+
export { collection, fieldGroup, createAction } from './schema'
|
|
2
|
+
export { validateEnv } from './lib/env'
|
|
3
|
+
export { previewDelete } from './lib/core/cascade'
|
|
4
|
+
export type { CascadePreview, CascadePreviewNode } from './lib/core/cascade'
|
|
5
|
+
export type { CascadeRule, CascadeAction } from './types/config/lists'
|
|
6
|
+
export type {
|
|
7
|
+
CollectionConfig,
|
|
8
|
+
BaseFields,
|
|
9
|
+
NixxiePlugin,
|
|
10
|
+
NixxieEnvSpec,
|
|
11
|
+
NixxieEnvVarSpec,
|
|
12
|
+
} from './types'
|
|
13
|
+
// Re-export the runtime-service & context types (NixxieContext, NixxieStorageService,
|
|
14
|
+
// NixxieSearchService, NixxieEmail*, NixxieCacheService, etc.) so the first-party service packages
|
|
15
|
+
// (@nixxie-cms/storage, /search, /email, …) can import them from the package root.
|
|
16
|
+
export type * from './types/context'
|
|
17
|
+
export {
|
|
18
|
+
defineCollection,
|
|
19
|
+
defineConfig,
|
|
20
|
+
defineAction,
|
|
21
|
+
withTimestamps,
|
|
22
|
+
withSoftDelete,
|
|
23
|
+
withAudit,
|
|
24
|
+
withSlug,
|
|
25
|
+
withPublishing,
|
|
26
|
+
withSEO,
|
|
27
|
+
withSortable,
|
|
28
|
+
withTreeStructure,
|
|
29
|
+
withTenant,
|
|
30
|
+
tenantAccessFilter,
|
|
31
|
+
withScheduledPublishing,
|
|
32
|
+
applyScheduledPublishing,
|
|
33
|
+
withLocale,
|
|
34
|
+
withApproval,
|
|
35
|
+
submitForApproval,
|
|
36
|
+
approveChanges,
|
|
37
|
+
rejectChanges,
|
|
38
|
+
withExpiry,
|
|
39
|
+
purgeExpired,
|
|
40
|
+
withViewCount,
|
|
41
|
+
recordView,
|
|
42
|
+
cleanupOrphans,
|
|
43
|
+
createMixin,
|
|
44
|
+
accessPresets,
|
|
45
|
+
validators,
|
|
46
|
+
} from './helpers'
|
|
47
|
+
export type { CollectionMixin } from './helpers'
|
|
48
|
+
export type {
|
|
49
|
+
ListFeaturesConfig,
|
|
50
|
+
ComputedConfig,
|
|
51
|
+
ConstraintsConfig,
|
|
52
|
+
DefaultFilterConfig,
|
|
53
|
+
StateMachineConfig,
|
|
54
|
+
PoliciesConfig,
|
|
55
|
+
PolicyRule,
|
|
56
|
+
EventsConfig,
|
|
57
|
+
SearchableConfig,
|
|
58
|
+
VersionedConfig,
|
|
59
|
+
} from './list-features'
|
|
60
|
+
// this re-exports `g` and `graphql`
|
|
61
|
+
// note the usage of export * over explicitly listing the exports
|
|
62
|
+
// is intentional here so that users can use "Rename Symbol" to
|
|
63
|
+
// change their usage of `graphql` to `g` in their project
|
|
64
|
+
// if this was an explicit list, it would change the re-export here
|
|
65
|
+
// rather than the usage in their project
|
|
66
|
+
export * from './types/schema'
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
getActionGraphQLArgs,
|
|
21
21
|
getActionGraphQLVariables,
|
|
22
22
|
} from '../../../../admin-ui/utils/actionData'
|
|
23
|
-
import type { ActionMeta,
|
|
23
|
+
import type { ActionMeta, CollectionMeta } from '../../../../types'
|
|
24
24
|
|
|
25
25
|
export function ItemPageHeader({
|
|
26
26
|
list,
|
|
@@ -32,7 +32,7 @@ export function ItemPageHeader({
|
|
|
32
32
|
title = label,
|
|
33
33
|
onAction,
|
|
34
34
|
}: {
|
|
35
|
-
list:
|
|
35
|
+
list: CollectionMeta
|
|
36
36
|
actions: ActionMeta[]
|
|
37
37
|
item: Record<string, unknown> | null
|
|
38
38
|
value: Record<string, unknown> | null
|
|
@@ -92,7 +92,7 @@ export function ItemPageHeader({
|
|
|
92
92
|
|
|
93
93
|
function replace(
|
|
94
94
|
s: string,
|
|
95
|
-
list:
|
|
95
|
+
list: CollectionMeta,
|
|
96
96
|
args: ActionMeta & {
|
|
97
97
|
itemLabel?: string
|
|
98
98
|
}
|
|
@@ -120,7 +120,7 @@ function ItemActions({
|
|
|
120
120
|
actions,
|
|
121
121
|
onAction,
|
|
122
122
|
}: {
|
|
123
|
-
list:
|
|
123
|
+
list: CollectionMeta
|
|
124
124
|
item: Record<string, unknown>
|
|
125
125
|
value: Record<string, unknown> | null
|
|
126
126
|
initialValue: Record<string, unknown> | null
|
|
@@ -40,10 +40,10 @@ import {
|
|
|
40
40
|
import { pick } from '../../../../admin-ui/utils/pick'
|
|
41
41
|
import type {
|
|
42
42
|
ActionMeta,
|
|
43
|
-
|
|
43
|
+
BaseCollectionTypeInfo,
|
|
44
44
|
ConditionalFilter,
|
|
45
45
|
ConditionalFilterCase,
|
|
46
|
-
|
|
46
|
+
CollectionMeta,
|
|
47
47
|
} from '../../../../types'
|
|
48
48
|
import { BaseToolbar, ColumnLayout, ItemPageHeader, StickySidebar } from './common'
|
|
49
49
|
|
|
@@ -67,7 +67,7 @@ function DeleteButton({
|
|
|
67
67
|
itemId,
|
|
68
68
|
itemLabel,
|
|
69
69
|
}: {
|
|
70
|
-
list:
|
|
70
|
+
list: CollectionMeta
|
|
71
71
|
itemId: string
|
|
72
72
|
itemLabel: string
|
|
73
73
|
}) {
|
|
@@ -183,9 +183,9 @@ function ItemForm({
|
|
|
183
183
|
onSaveSuccess: () => void
|
|
184
184
|
fieldModes: Record<
|
|
185
185
|
string,
|
|
186
|
-
ConditionalFilter<'edit' | 'read' | 'hidden', 'read' | 'hidden',
|
|
186
|
+
ConditionalFilter<'edit' | 'read' | 'hidden', 'read' | 'hidden', BaseCollectionTypeInfo>
|
|
187
187
|
>
|
|
188
|
-
isRequireds: Record<string, ConditionalFilterCase<
|
|
188
|
+
isRequireds: Record<string, ConditionalFilterCase<BaseCollectionTypeInfo>>
|
|
189
189
|
fieldPositions: Record<string, 'form' | 'sidebar'>
|
|
190
190
|
}) {
|
|
191
191
|
const list = useList(listKey)
|
|
@@ -51,7 +51,7 @@ import {
|
|
|
51
51
|
import { getActionArguments } from '../../../../admin-ui/utils/actionData'
|
|
52
52
|
import { pick } from '../../../../admin-ui/utils/pick'
|
|
53
53
|
import { useSearchFilter } from '../../../../fields/types/relationship/views/useFilter'
|
|
54
|
-
import type { ActionMeta, FieldMeta, JSONValue,
|
|
54
|
+
import type { ActionMeta, FieldMeta, JSONValue, CollectionMeta } from '../../../../types'
|
|
55
55
|
import { FilterAdd } from './FilterAdd'
|
|
56
56
|
import { PaginationControls, snapValueToClosest } from './PaginationControls'
|
|
57
57
|
import { Tag } from './Tag'
|
|
@@ -156,7 +156,7 @@ function FilterEdit({
|
|
|
156
156
|
)
|
|
157
157
|
}
|
|
158
158
|
|
|
159
|
-
function getFilters(list:
|
|
159
|
+
function getFilters(list: CollectionMeta, query: ParsedUrlQueryInput): Filter[] {
|
|
160
160
|
const param_ = query.filter
|
|
161
161
|
const params = Array.isArray(param_) ? param_ : typeof param_ === 'string' ? [param_] : []
|
|
162
162
|
|
|
@@ -214,7 +214,7 @@ function getFilters(list: ListMeta, query: ParsedUrlQueryInput): Filter[] {
|
|
|
214
214
|
return filters
|
|
215
215
|
}
|
|
216
216
|
|
|
217
|
-
function getSort(list:
|
|
217
|
+
function getSort(list: CollectionMeta, query: ParsedUrlQueryInput): SortDescriptor | null {
|
|
218
218
|
const param = typeof query.sortBy === 'string' ? query.sortBy : null
|
|
219
219
|
if (param === '') return null
|
|
220
220
|
if (!param) {
|
|
@@ -237,19 +237,19 @@ function getSort(list: ListMeta, query: ParsedUrlQueryInput): SortDescriptor | n
|
|
|
237
237
|
}
|
|
238
238
|
}
|
|
239
239
|
|
|
240
|
-
function getCurrentPage(_:
|
|
240
|
+
function getCurrentPage(_: CollectionMeta, query: ParsedUrlQuery) {
|
|
241
241
|
const currentPage = Number(query.page)
|
|
242
242
|
if (Number.isNaN(currentPage) || currentPage < 1) return 1
|
|
243
243
|
return currentPage
|
|
244
244
|
}
|
|
245
245
|
|
|
246
|
-
function getPageSize(list:
|
|
246
|
+
function getPageSize(list: CollectionMeta, query: ParsedUrlQuery) {
|
|
247
247
|
const pageSize = Number(query.pageSize)
|
|
248
248
|
if (Number.isNaN(pageSize) || pageSize < 1) return list.pageSize
|
|
249
249
|
return snapValueToClosest(pageSize)
|
|
250
250
|
}
|
|
251
251
|
|
|
252
|
-
function getColumns(list:
|
|
252
|
+
function getColumns(list: CollectionMeta, query: ParsedUrlQueryInput): string[] {
|
|
253
253
|
const param_ = query.column
|
|
254
254
|
const params = Array.isArray(param_) ? param_ : typeof param_ === 'string' ? [param_] : []
|
|
255
255
|
if (!params.length) return list.initialColumns
|
|
@@ -840,7 +840,7 @@ function ListPageHeader({ listKey, showCreate }: { listKey: string; showCreate?:
|
|
|
840
840
|
|
|
841
841
|
function replace(
|
|
842
842
|
s: string,
|
|
843
|
-
list:
|
|
843
|
+
list: CollectionMeta,
|
|
844
844
|
args: ActionMeta & {
|
|
845
845
|
itemLabel?: string
|
|
846
846
|
count?: number
|
|
@@ -878,7 +878,7 @@ function ActionItemsDialog({
|
|
|
878
878
|
onErrors,
|
|
879
879
|
action,
|
|
880
880
|
}: {
|
|
881
|
-
list:
|
|
881
|
+
list: CollectionMeta
|
|
882
882
|
itemIds: string[]
|
|
883
883
|
items: Record<string, unknown>[]
|
|
884
884
|
onSuccess: (remaining: Set<string>) => void
|