@nixxie-cms/core 1.0.0 → 1.0.2
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/README.md +2 -2
- package/admin-ui/components/dist/nixxie-cms-core-admin-ui-components.cjs.js +4 -4
- package/admin-ui/components/dist/nixxie-cms-core-admin-ui-components.esm.js +4 -4
- package/admin-ui/context/dist/nixxie-cms-core-admin-ui-context.cjs.js +2 -2
- package/admin-ui/context/dist/nixxie-cms-core-admin-ui-context.esm.js +2 -2
- package/context/dist/nixxie-cms-core-context.cjs.js +2 -2
- package/context/dist/nixxie-cms-core-context.esm.js +2 -2
- package/dist/{CreateItemDialog-33335548.esm.js → CreateItemDialog-7008b050.esm.js} +1 -1
- package/dist/{CreateItemDialog-56cf59b7.cjs.js → CreateItemDialog-a0cab315.cjs.js} +1 -1
- package/dist/{PageContainer-7db73317.esm.js → PageContainer-5ae731cc.esm.js} +25 -18
- package/dist/{PageContainer-27c27f10.cjs.js → PageContainer-abd7159f.cjs.js} +25 -18
- package/dist/{admin-meta-graphql-6f7f5331.esm.js → admin-meta-graphql-0e6e606e.esm.js} +1 -1
- package/dist/{admin-meta-graphql-c8f926e9.cjs.js → admin-meta-graphql-306c224a.cjs.js} +1 -1
- package/dist/{context-3132c3ed.esm.js → context-af9957ed.esm.js} +2 -2
- package/dist/{context-e7a45152.cjs.js → context-b5204629.cjs.js} +2 -2
- package/dist/declarations/src/admin-ui/components/Navigation.d.ts.map +1 -1
- package/dist/declarations/src/admin-ui/components/PageContainer.d.ts.map +1 -1
- package/dist/declarations/src/helpers.d.ts.map +1 -1
- package/dist/declarations/src/index.d.ts +1 -0
- package/dist/declarations/src/index.d.ts.map +1 -1
- package/dist/declarations/src/internal-unstable/admin-ui/id-field-view.d.ts.map +1 -0
- package/dist/declarations/src/internal-unstable/admin-ui/pages/App/index.d.ts.map +1 -0
- package/dist/declarations/src/internal-unstable/admin-ui/pages/CreateItemPage/index.d.ts.map +1 -0
- package/dist/declarations/src/internal-unstable/admin-ui/pages/HomePage/index.d.ts.map +1 -0
- package/dist/declarations/src/internal-unstable/admin-ui/pages/ItemPage/index.d.ts.map +1 -0
- package/dist/declarations/src/internal-unstable/admin-ui/pages/ListPage/index.d.ts.map +1 -0
- package/dist/declarations/src/internal-unstable/admin-ui/pages/NoAccessPage/index.d.ts.map +1 -0
- package/dist/declarations/src/internal-unstable/artifacts.d.ts.map +1 -0
- package/dist/declarations/src/lib/core/initialise-lists.d.ts +1 -1
- package/dist/declarations/src/schema.d.ts.map +1 -1
- package/dist/declarations/src/types/config/index.d.ts +60 -1
- package/dist/declarations/src/types/config/index.d.ts.map +1 -1
- package/dist/declarations/src/types/config/lists.d.ts +4 -4
- package/dist/declarations/src/types/context.d.ts +150 -0
- package/dist/declarations/src/types/context.d.ts.map +1 -1
- package/dist/declarations/src/types/next-fields.d.ts +1 -1
- package/dist/{express-e9ed9a7d.cjs.js → express-455ae20c.cjs.js} +1 -1
- package/dist/{express-6743b918.esm.js → express-7559ca2d.esm.js} +1 -1
- package/dist/{index-ac01583b.cjs.js → index-89635494.cjs.js} +4 -4
- package/dist/{index-24b78415.esm.js → index-baa799e0.esm.js} +4 -4
- package/dist/nixxie-cms-core.cjs.js +104 -77
- package/dist/nixxie-cms-core.esm.js +104 -77
- package/dist/{non-null-graphql-5315718c.esm.js → non-null-graphql-a84ed64d.esm.js} +1 -1
- package/dist/{non-null-graphql-17b83ddc.cjs.js → non-null-graphql-add6bb3d.cjs.js} +1 -1
- package/dist/{resolve-hooks-66fe8a8e.cjs.js → resolve-hooks-165a9ce2.cjs.js} +1 -1
- package/dist/{resolve-hooks-17aafd37.esm.js → resolve-hooks-6813a045.esm.js} +2 -2
- package/dist/{system-dfec2f0a.esm.js → system-03e49e4f.esm.js} +8 -4
- package/dist/{system-48c5f6df.cjs.js → system-a321642d.cjs.js} +8 -4
- package/dist/{useFilter-0b5a1ee6.esm.js → useFilter-9b6db1f9.esm.js} +1 -1
- package/dist/{useFilter-1a4e6900.cjs.js → useFilter-acc9d413.cjs.js} +1 -1
- package/fields/dist/nixxie-cms-core-fields.cjs.js +16 -16
- package/fields/dist/nixxie-cms-core-fields.esm.js +17 -17
- package/fields/types/bytes/dist/nixxie-cms-core-fields-types-bytes.cjs.js +3 -3
- package/fields/types/bytes/dist/nixxie-cms-core-fields-types-bytes.esm.js +3 -3
- package/fields/types/bytes/views/dist/nixxie-cms-core-fields-types-bytes-views.cjs.js +1 -1
- package/fields/types/bytes/views/dist/nixxie-cms-core-fields-types-bytes-views.esm.js +1 -1
- package/fields/types/password/dist/nixxie-cms-core-fields-types-password.cjs.js +3 -3
- package/fields/types/password/dist/nixxie-cms-core-fields-types-password.esm.js +3 -3
- package/fields/types/relationship/views/dist/nixxie-cms-core-fields-types-relationship-views.cjs.js +4 -4
- package/fields/types/relationship/views/dist/nixxie-cms-core-fields-types-relationship-views.esm.js +4 -4
- package/fields/types/select/views/dist/nixxie-cms-core-fields-types-select-views.cjs.js +1 -1
- package/fields/types/select/views/dist/nixxie-cms-core-fields-types-select-views.esm.js +1 -1
- package/fields/types/text/views/dist/nixxie-cms-core-fields-types-text-views.cjs.js +1 -1
- package/fields/types/text/views/dist/nixxie-cms-core-fields-types-text-views.esm.js +1 -1
- package/internal-unstable/admin-ui/id-field-view/dist/nixxie-cms-core-internal-unstable-admin-ui-id-field-view.cjs.d.ts +2 -0
- package/internal-unstable/admin-ui/id-field-view/dist/nixxie-cms-core-internal-unstable-admin-ui-id-field-view.cjs.js +244 -0
- package/internal-unstable/admin-ui/id-field-view/dist/nixxie-cms-core-internal-unstable-admin-ui-id-field-view.esm.js +235 -0
- package/internal-unstable/admin-ui/id-field-view/package.json +4 -0
- package/internal-unstable/admin-ui/next-config/package.json +4 -0
- package/internal-unstable/admin-ui/pages/App/dist/nixxie-cms-core-internal-unstable-admin-ui-pages-App.cjs.d.ts +2 -0
- package/internal-unstable/admin-ui/pages/App/dist/nixxie-cms-core-internal-unstable-admin-ui-pages-App.cjs.js +59 -0
- package/internal-unstable/admin-ui/pages/App/dist/nixxie-cms-core-internal-unstable-admin-ui-pages-App.esm.js +55 -0
- package/internal-unstable/admin-ui/pages/App/package.json +4 -0
- package/internal-unstable/admin-ui/pages/CreateItemPage/dist/nixxie-cms-core-internal-unstable-admin-ui-pages-CreateItemPage.cjs.d.ts +2 -0
- package/internal-unstable/admin-ui/pages/CreateItemPage/dist/nixxie-cms-core-internal-unstable-admin-ui-pages-CreateItemPage.cjs.js +116 -0
- package/internal-unstable/admin-ui/pages/CreateItemPage/dist/nixxie-cms-core-internal-unstable-admin-ui-pages-CreateItemPage.esm.js +112 -0
- package/internal-unstable/admin-ui/pages/CreateItemPage/package.json +4 -0
- package/internal-unstable/admin-ui/pages/HomePage/dist/nixxie-cms-core-internal-unstable-admin-ui-pages-HomePage.cjs.d.ts +2 -0
- package/internal-unstable/admin-ui/pages/HomePage/dist/nixxie-cms-core-internal-unstable-admin-ui-pages-HomePage.cjs.js +336 -0
- package/internal-unstable/admin-ui/pages/HomePage/dist/nixxie-cms-core-internal-unstable-admin-ui-pages-HomePage.esm.js +332 -0
- package/internal-unstable/admin-ui/pages/HomePage/package.json +4 -0
- package/internal-unstable/admin-ui/pages/ItemPage/dist/nixxie-cms-core-internal-unstable-admin-ui-pages-ItemPage.cjs.d.ts +2 -0
- package/internal-unstable/admin-ui/pages/ItemPage/dist/nixxie-cms-core-internal-unstable-admin-ui-pages-ItemPage.cjs.js +463 -0
- package/internal-unstable/admin-ui/pages/ItemPage/dist/nixxie-cms-core-internal-unstable-admin-ui-pages-ItemPage.esm.js +455 -0
- package/internal-unstable/admin-ui/pages/ItemPage/package.json +4 -0
- package/internal-unstable/admin-ui/pages/ListPage/dist/nixxie-cms-core-internal-unstable-admin-ui-pages-ListPage.cjs.d.ts +2 -0
- package/internal-unstable/admin-ui/pages/ListPage/dist/nixxie-cms-core-internal-unstable-admin-ui-pages-ListPage.cjs.js +1195 -0
- package/internal-unstable/admin-ui/pages/ListPage/dist/nixxie-cms-core-internal-unstable-admin-ui-pages-ListPage.esm.js +1187 -0
- package/internal-unstable/admin-ui/pages/ListPage/package.json +4 -0
- package/internal-unstable/admin-ui/pages/NoAccessPage/dist/nixxie-cms-core-internal-unstable-admin-ui-pages-NoAccessPage.cjs.d.ts +2 -0
- package/internal-unstable/admin-ui/pages/NoAccessPage/dist/nixxie-cms-core-internal-unstable-admin-ui-pages-NoAccessPage.cjs.js +40 -0
- package/internal-unstable/admin-ui/pages/NoAccessPage/dist/nixxie-cms-core-internal-unstable-admin-ui-pages-NoAccessPage.esm.js +35 -0
- package/internal-unstable/admin-ui/pages/NoAccessPage/package.json +4 -0
- package/internal-unstable/artifacts/dist/nixxie-cms-core-internal-unstable-artifacts.cjs.d.ts +2 -0
- package/internal-unstable/artifacts/dist/nixxie-cms-core-internal-unstable-artifacts.cjs.js +51 -0
- package/internal-unstable/artifacts/dist/nixxie-cms-core-internal-unstable-artifacts.esm.js +38 -0
- package/internal-unstable/artifacts/package.json +4 -0
- package/package.json +44 -44
- package/scripts/cli/dist/nixxie-cms-core-scripts-cli.cjs.js +44 -15
- package/scripts/cli/dist/nixxie-cms-core-scripts-cli.esm.js +44 -15
- package/scripts/dist/nixxie-cms-core-scripts.cjs.js +3 -3
- package/scripts/dist/nixxie-cms-core-scripts.esm.js +3 -3
- package/src/admin-ui/admin-meta-graphql.ts +168 -168
- package/src/admin-ui/components/CommandPalette.tsx +433 -431
- package/src/admin-ui/components/Navigation.tsx +389 -385
- package/src/admin-ui/components/PageContainer.tsx +311 -310
- package/src/admin-ui/components/WelcomeDialog.tsx +1 -1
- package/src/admin-ui/context.tsx +338 -338
- package/src/admin-ui/templates/app.ts +60 -60
- package/src/admin-ui/templates/create-item.ts +5 -5
- package/src/admin-ui/templates/home.ts +2 -2
- package/src/admin-ui/templates/item.tsx +5 -5
- package/src/admin-ui/templates/list.tsx +5 -5
- package/src/admin-ui/templates/next-config.ts +29 -0
- package/src/admin-ui/templates/no-access.ts +7 -7
- package/src/fields/types/bigInt/index.ts +181 -181
- package/src/fields/types/bytes/index.ts +275 -275
- package/src/fields/types/calendarDay/index.ts +194 -194
- package/src/fields/types/checkbox/index.ts +76 -76
- package/src/fields/types/decimal/index.ts +182 -182
- package/src/fields/types/file/index.ts +168 -168
- package/src/fields/types/float/index.ts +133 -133
- package/src/fields/types/image/index.ts +244 -244
- package/src/fields/types/integer/index.ts +156 -156
- package/src/fields/types/json/index.ts +77 -77
- package/src/fields/types/multiselect/index.ts +212 -212
- package/src/fields/types/password/index.ts +241 -241
- package/src/fields/types/relationship/index.ts +381 -381
- package/src/fields/types/relationship/views/RelationshipTable.tsx +190 -190
- package/src/fields/types/select/index.ts +226 -226
- package/src/fields/types/text/index.ts +207 -207
- package/src/fields/types/timestamp/index.ts +116 -116
- package/src/fields/types/virtual/index.ts +108 -108
- package/src/helpers.ts +342 -316
- package/src/index.ts +4 -0
- package/src/{___internal-do-not-use-will-break-in-patch → internal-unstable}/admin-ui/id-field-view.tsx +167 -167
- package/src/{___internal-do-not-use-will-break-in-patch → internal-unstable}/admin-ui/pages/App/index.tsx +22 -22
- package/src/{___internal-do-not-use-will-break-in-patch → internal-unstable}/admin-ui/pages/CreateItemPage/index.tsx +71 -71
- package/src/{___internal-do-not-use-will-break-in-patch → internal-unstable}/admin-ui/pages/HomePage/index.tsx +333 -333
- package/src/{___internal-do-not-use-will-break-in-patch → internal-unstable}/admin-ui/pages/ItemPage/common.tsx +358 -358
- package/src/{___internal-do-not-use-will-break-in-patch → internal-unstable}/admin-ui/pages/ItemPage/index.tsx +483 -483
- package/src/{___internal-do-not-use-will-break-in-patch → internal-unstable}/admin-ui/pages/ListPage/FilterAdd.tsx +221 -221
- package/src/{___internal-do-not-use-will-break-in-patch → internal-unstable}/admin-ui/pages/ListPage/PaginationControls.tsx +170 -170
- package/src/{___internal-do-not-use-will-break-in-patch → internal-unstable}/admin-ui/pages/ListPage/Tag.tsx +72 -72
- package/src/{___internal-do-not-use-will-break-in-patch → internal-unstable}/admin-ui/pages/ListPage/index.tsx +1006 -1006
- package/src/{___internal-do-not-use-will-break-in-patch → internal-unstable}/admin-ui/pages/NoAccessPage/index.tsx +24 -24
- package/src/{___internal-do-not-use-will-break-in-patch → internal-unstable}/artifacts.ts +5 -5
- package/src/lib/context/createContext.ts +165 -161
- package/src/lib/core/initialise-lists.ts +1097 -1097
- package/src/lib/id-field.ts +214 -214
- package/src/lib/telemetry.ts +342 -342
- package/src/schema.ts +237 -233
- package/src/scripts/telemetry.ts +1 -1
- package/src/types/config/index.ts +400 -333
- package/src/types/config/lists.ts +4 -4
- package/src/types/context.ts +700 -530
- package/src/types/next-fields.ts +499 -499
- package/src/types/telemetry.ts +51 -51
- package/tests/telemetry.test.ts +361 -361
- package/CHANGELOG.md +0 -3158
- package/___internal-do-not-use-will-break-in-patch/admin-ui/id-field-view/package.json +0 -4
- package/___internal-do-not-use-will-break-in-patch/admin-ui/next-config/package.json +0 -4
- package/___internal-do-not-use-will-break-in-patch/admin-ui/pages/App/package.json +0 -4
- package/___internal-do-not-use-will-break-in-patch/admin-ui/pages/CreateItemPage/package.json +0 -4
- package/___internal-do-not-use-will-break-in-patch/admin-ui/pages/HomePage/package.json +0 -4
- package/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ItemPage/package.json +0 -4
- package/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/package.json +0 -4
- package/___internal-do-not-use-will-break-in-patch/admin-ui/pages/NoAccessPage/package.json +0 -4
- package/___internal-do-not-use-will-break-in-patch/artifacts/package.json +0 -4
- package/dist/declarations/src/___internal-do-not-use-will-break-in-patch/admin-ui/id-field-view.d.ts.map +0 -1
- package/dist/declarations/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/App/index.d.ts.map +0 -1
- package/dist/declarations/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/CreateItemPage/index.d.ts.map +0 -1
- package/dist/declarations/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/HomePage/index.d.ts.map +0 -1
- package/dist/declarations/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ItemPage/index.d.ts.map +0 -1
- package/dist/declarations/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/index.d.ts.map +0 -1
- package/dist/declarations/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/NoAccessPage/index.d.ts.map +0 -1
- package/dist/declarations/src/___internal-do-not-use-will-break-in-patch/artifacts.d.ts.map +0 -1
- /package/dist/{common-1a350e11.cjs.js → common-5933f758.cjs.js} +0 -0
- /package/dist/{common-29fc82e6.esm.js → common-ea5c441a.esm.js} +0 -0
- /package/dist/declarations/src/{___internal-do-not-use-will-break-in-patch → internal-unstable}/admin-ui/id-field-view.d.ts +0 -0
- /package/dist/declarations/src/{___internal-do-not-use-will-break-in-patch → internal-unstable}/admin-ui/pages/App/index.d.ts +0 -0
- /package/dist/declarations/src/{___internal-do-not-use-will-break-in-patch → internal-unstable}/admin-ui/pages/CreateItemPage/index.d.ts +0 -0
- /package/dist/declarations/src/{___internal-do-not-use-will-break-in-patch → internal-unstable}/admin-ui/pages/HomePage/index.d.ts +0 -0
- /package/dist/declarations/src/{___internal-do-not-use-will-break-in-patch → internal-unstable}/admin-ui/pages/ItemPage/index.d.ts +0 -0
- /package/dist/declarations/src/{___internal-do-not-use-will-break-in-patch → internal-unstable}/admin-ui/pages/ListPage/index.d.ts +0 -0
- /package/dist/declarations/src/{___internal-do-not-use-will-break-in-patch → internal-unstable}/admin-ui/pages/NoAccessPage/index.d.ts +0 -0
- /package/dist/declarations/src/{___internal-do-not-use-will-break-in-patch → internal-unstable}/artifacts.d.ts +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { u as userInputError,
|
|
1
|
+
import { u as userInputError, m as merge } from '../../dist/resolve-hooks-6813a045.esm.js';
|
|
2
2
|
import 'pluralize';
|
|
3
3
|
import { f as fieldType, g, o as orderDirectionEnum } from '../../dist/next-fields-9bf04ed8.esm.js';
|
|
4
|
-
import { f as filters, a as resolveCommon, b as resolveString } from '../../dist/index-
|
|
5
|
-
export { r as relationship, t as timestamp } from '../../dist/index-
|
|
6
|
-
import { a as assertReadIsNonNullAllowed, m as makeValidateHook, d as defaultIsRequired, r as resolveDbNullable } from '../../dist/non-null-graphql-
|
|
4
|
+
import { f as filters, a as resolveCommon, b as resolveString } from '../../dist/index-baa799e0.esm.js';
|
|
5
|
+
export { r as relationship, t as timestamp } from '../../dist/index-baa799e0.esm.js';
|
|
6
|
+
import { a as assertReadIsNonNullAllowed, m as makeValidateHook, d as defaultIsRequired, r as resolveDbNullable } from '../../dist/non-null-graphql-a84ed64d.esm.js';
|
|
7
7
|
import 'node:path';
|
|
8
8
|
import { GNonNull } from '@graphql-ts/schema';
|
|
9
9
|
import '@graphql-ts/extend';
|
|
@@ -81,7 +81,7 @@ function checkbox(config = {}) {
|
|
|
81
81
|
output: g.field({
|
|
82
82
|
type: g.Boolean
|
|
83
83
|
}),
|
|
84
|
-
|
|
84
|
+
__nxTelemetryFieldTypeName: '@nixxie-cms/checkbox',
|
|
85
85
|
views: '@nixxie-cms/core/fields/types/checkbox/views',
|
|
86
86
|
getAdminMeta: () => ({
|
|
87
87
|
defaultValue
|
|
@@ -225,7 +225,7 @@ function decimal(config = {}) {
|
|
|
225
225
|
return val;
|
|
226
226
|
}
|
|
227
227
|
}),
|
|
228
|
-
|
|
228
|
+
__nxTelemetryFieldTypeName: '@nixxie-cms/decimal',
|
|
229
229
|
views: '@nixxie-cms/core/fields/types/decimal/views',
|
|
230
230
|
getAdminMeta() {
|
|
231
231
|
return {
|
|
@@ -363,7 +363,7 @@ function file(config) {
|
|
|
363
363
|
};
|
|
364
364
|
}
|
|
365
365
|
}),
|
|
366
|
-
|
|
366
|
+
__nxTelemetryFieldTypeName: '@nixxie-cms/file',
|
|
367
367
|
views: '@nixxie-cms/core/fields/types/file/views'
|
|
368
368
|
});
|
|
369
369
|
};
|
|
@@ -481,7 +481,7 @@ function float(config = {}) {
|
|
|
481
481
|
output: g.field({
|
|
482
482
|
type: g.Float
|
|
483
483
|
}),
|
|
484
|
-
|
|
484
|
+
__nxTelemetryFieldTypeName: '@nixxie-cms/float',
|
|
485
485
|
views: '@nixxie-cms/core/fields/types/float/views',
|
|
486
486
|
getAdminMeta() {
|
|
487
487
|
return {
|
|
@@ -611,7 +611,7 @@ function integer(config = {}) {
|
|
|
611
611
|
output: g.field({
|
|
612
612
|
type: g.Int
|
|
613
613
|
}),
|
|
614
|
-
|
|
614
|
+
__nxTelemetryFieldTypeName: '@nixxie-cms/integer',
|
|
615
615
|
views: '@nixxie-cms/core/fields/types/integer/views',
|
|
616
616
|
getAdminMeta() {
|
|
617
617
|
return {
|
|
@@ -757,7 +757,7 @@ function bigInt(config = {}) {
|
|
|
757
757
|
output: g.field({
|
|
758
758
|
type: g.BigInt
|
|
759
759
|
}),
|
|
760
|
-
|
|
760
|
+
__nxTelemetryFieldTypeName: '@nixxie-cms/bigInt',
|
|
761
761
|
views: '@nixxie-cms/core/fields/types/bigInt/views',
|
|
762
762
|
getAdminMeta() {
|
|
763
763
|
var _min$toString, _max$toString;
|
|
@@ -1006,7 +1006,7 @@ function image(config) {
|
|
|
1006
1006
|
};
|
|
1007
1007
|
}
|
|
1008
1008
|
}),
|
|
1009
|
-
|
|
1009
|
+
__nxTelemetryFieldTypeName: '@nixxie-cms/image',
|
|
1010
1010
|
views: '@nixxie-cms/core/fields/types/image/views'
|
|
1011
1011
|
});
|
|
1012
1012
|
};
|
|
@@ -1038,7 +1038,7 @@ function json({
|
|
|
1038
1038
|
extendPrismaSchema: (_config$db2 = config.db) === null || _config$db2 === void 0 ? void 0 : _config$db2.extendPrismaSchema
|
|
1039
1039
|
})({
|
|
1040
1040
|
...config,
|
|
1041
|
-
|
|
1041
|
+
__nxTelemetryFieldTypeName: '@nixxie-cms/json',
|
|
1042
1042
|
input: {
|
|
1043
1043
|
create: {
|
|
1044
1044
|
arg: g.arg({
|
|
@@ -1118,7 +1118,7 @@ function select(config) {
|
|
|
1118
1118
|
...config.hooks,
|
|
1119
1119
|
validate
|
|
1120
1120
|
},
|
|
1121
|
-
|
|
1121
|
+
__nxTelemetryFieldTypeName: '@nixxie-cms/select',
|
|
1122
1122
|
views: '@nixxie-cms/core/fields/types/select/views',
|
|
1123
1123
|
getAdminMeta: () => {
|
|
1124
1124
|
var _config$type;
|
|
@@ -1408,7 +1408,7 @@ function text(config = {}) {
|
|
|
1408
1408
|
output: g.field({
|
|
1409
1409
|
type: g.String
|
|
1410
1410
|
}),
|
|
1411
|
-
|
|
1411
|
+
__nxTelemetryFieldTypeName: '@nixxie-cms/text',
|
|
1412
1412
|
views: '@nixxie-cms/core/fields/types/text/views',
|
|
1413
1413
|
getAdminMeta() {
|
|
1414
1414
|
var _config$ui$displayMod, _config$ui, _match$explanation2;
|
|
@@ -1460,7 +1460,7 @@ function virtual({
|
|
|
1460
1460
|
return usableField.resolve(item, ...args);
|
|
1461
1461
|
}
|
|
1462
1462
|
}),
|
|
1463
|
-
|
|
1463
|
+
__nxTelemetryFieldTypeName: '@nixxie-cms/virtual',
|
|
1464
1464
|
views: '@nixxie-cms/core/fields/types/virtual/views',
|
|
1465
1465
|
getAdminMeta: () => {
|
|
1466
1466
|
var _config$ui$query, _config$ui4;
|
|
@@ -1566,7 +1566,7 @@ function calendarDay(config = {}) {
|
|
|
1566
1566
|
return value;
|
|
1567
1567
|
}
|
|
1568
1568
|
}),
|
|
1569
|
-
|
|
1569
|
+
__nxTelemetryFieldTypeName: '@nixxie-cms/calendarDay',
|
|
1570
1570
|
views: '@nixxie-cms/core/fields/types/calendarDay/views',
|
|
1571
1571
|
getAdminMeta() {
|
|
1572
1572
|
return {
|
|
@@ -1704,7 +1704,7 @@ function multiselect(config) {
|
|
|
1704
1704
|
})({
|
|
1705
1705
|
...config,
|
|
1706
1706
|
ui,
|
|
1707
|
-
|
|
1707
|
+
__nxTelemetryFieldTypeName: '@nixxie-cms/multiselect',
|
|
1708
1708
|
hooks: {
|
|
1709
1709
|
...config.hooks,
|
|
1710
1710
|
validate
|
|
@@ -4,8 +4,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
require('pluralize');
|
|
6
6
|
var nextFields = require('../../../../dist/next-fields-49c025ef.cjs.js');
|
|
7
|
-
require('../../../../dist/resolve-hooks-
|
|
8
|
-
var nonNullGraphql = require('../../../../dist/non-null-graphql-
|
|
7
|
+
require('../../../../dist/resolve-hooks-165a9ce2.cjs.js');
|
|
8
|
+
var nonNullGraphql = require('../../../../dist/non-null-graphql-add6bb3d.cjs.js');
|
|
9
9
|
require('node:path');
|
|
10
10
|
require('@graphql-ts/schema');
|
|
11
11
|
require('@graphql-ts/extend');
|
|
@@ -132,7 +132,7 @@ function bytes(config = {}) {
|
|
|
132
132
|
output: nextFields.g.field({
|
|
133
133
|
type: scalar
|
|
134
134
|
}),
|
|
135
|
-
|
|
135
|
+
__nxTelemetryFieldTypeName: '@nixxie-cms/bytes',
|
|
136
136
|
views: '@nixxie-cms/core/fields/types/bytes/views',
|
|
137
137
|
getAdminMeta() {
|
|
138
138
|
return {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import 'pluralize';
|
|
2
2
|
import { g, f as fieldType, o as orderDirectionEnum } from '../../../../dist/next-fields-9bf04ed8.esm.js';
|
|
3
|
-
import '../../../../dist/resolve-hooks-
|
|
4
|
-
import { m as makeValidateHook, d as defaultIsRequired } from '../../../../dist/non-null-graphql-
|
|
3
|
+
import '../../../../dist/resolve-hooks-6813a045.esm.js';
|
|
4
|
+
import { m as makeValidateHook, d as defaultIsRequired } from '../../../../dist/non-null-graphql-a84ed64d.esm.js';
|
|
5
5
|
import 'node:path';
|
|
6
6
|
import '@graphql-ts/schema';
|
|
7
7
|
import '@graphql-ts/extend';
|
|
@@ -128,7 +128,7 @@ function bytes(config = {}) {
|
|
|
128
128
|
output: g.field({
|
|
129
129
|
type: scalar
|
|
130
130
|
}),
|
|
131
|
-
|
|
131
|
+
__nxTelemetryFieldTypeName: '@nixxie-cms/bytes',
|
|
132
132
|
views: '@nixxie-cms/core/fields/types/bytes/views',
|
|
133
133
|
getAdminMeta() {
|
|
134
134
|
return {
|
|
@@ -29,7 +29,7 @@ require('@keystar/ui/icon/icons/undo2Icon');
|
|
|
29
29
|
require('@keystar/ui/picker');
|
|
30
30
|
require('@keystar/ui/tag');
|
|
31
31
|
require('@keystar/ui/tooltip');
|
|
32
|
-
require('../../../../../dist/admin-meta-graphql-
|
|
32
|
+
require('../../../../../dist/admin-meta-graphql-306c224a.cjs.js');
|
|
33
33
|
require('@apollo/client');
|
|
34
34
|
require('@apollo/client/react');
|
|
35
35
|
require('next/router');
|
|
@@ -25,7 +25,7 @@ import '@keystar/ui/icon/icons/undo2Icon';
|
|
|
25
25
|
import '@keystar/ui/picker';
|
|
26
26
|
import '@keystar/ui/tag';
|
|
27
27
|
import '@keystar/ui/tooltip';
|
|
28
|
-
import '../../../../../dist/admin-meta-graphql-
|
|
28
|
+
import '../../../../../dist/admin-meta-graphql-0e6e606e.esm.js';
|
|
29
29
|
import '@apollo/client';
|
|
30
30
|
import '@apollo/client/react';
|
|
31
31
|
import 'next/router';
|
|
@@ -4,10 +4,10 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var bcryptjs = require('bcryptjs');
|
|
6
6
|
var dumbPasswords = require('dumb-passwords');
|
|
7
|
-
var resolveHooks = require('../../../../dist/resolve-hooks-
|
|
7
|
+
var resolveHooks = require('../../../../dist/resolve-hooks-165a9ce2.cjs.js');
|
|
8
8
|
require('pluralize');
|
|
9
9
|
var nextFields = require('../../../../dist/next-fields-49c025ef.cjs.js');
|
|
10
|
-
var nonNullGraphql = require('../../../../dist/non-null-graphql-
|
|
10
|
+
var nonNullGraphql = require('../../../../dist/non-null-graphql-add6bb3d.cjs.js');
|
|
11
11
|
require('node:path');
|
|
12
12
|
require('@graphql-ts/schema');
|
|
13
13
|
require('@graphql-ts/extend');
|
|
@@ -158,7 +158,7 @@ function password(config = {}) {
|
|
|
158
158
|
resolve: inputResolver
|
|
159
159
|
}
|
|
160
160
|
},
|
|
161
|
-
|
|
161
|
+
__nxTelemetryFieldTypeName: '@nixxie-cms/password',
|
|
162
162
|
views: '@nixxie-cms/core/fields/types/password/views',
|
|
163
163
|
getAdminMeta: () => {
|
|
164
164
|
var _match$explanation2;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import bcryptjs from 'bcryptjs';
|
|
2
2
|
import dumbPasswords from 'dumb-passwords';
|
|
3
|
-
import { u as userInputError } from '../../../../dist/resolve-hooks-
|
|
3
|
+
import { u as userInputError } from '../../../../dist/resolve-hooks-6813a045.esm.js';
|
|
4
4
|
import 'pluralize';
|
|
5
5
|
import { g, f as fieldType } from '../../../../dist/next-fields-9bf04ed8.esm.js';
|
|
6
|
-
import { m as makeValidateHook, d as defaultIsRequired } from '../../../../dist/non-null-graphql-
|
|
6
|
+
import { m as makeValidateHook, d as defaultIsRequired } from '../../../../dist/non-null-graphql-a84ed64d.esm.js';
|
|
7
7
|
import 'node:path';
|
|
8
8
|
import '@graphql-ts/schema';
|
|
9
9
|
import '@graphql-ts/extend';
|
|
@@ -149,7 +149,7 @@ function password(config = {}) {
|
|
|
149
149
|
resolve: inputResolver
|
|
150
150
|
}
|
|
151
151
|
},
|
|
152
|
-
|
|
152
|
+
__nxTelemetryFieldTypeName: '@nixxie-cms/password',
|
|
153
153
|
views: '@nixxie-cms/core/fields/types/password/views',
|
|
154
154
|
getAdminMeta: () => {
|
|
155
155
|
var _match$explanation2;
|
package/fields/types/relationship/views/dist/nixxie-cms-core-fields-types-relationship-views.cjs.js
CHANGED
|
@@ -22,16 +22,16 @@ require('@keystar/ui/icon/icons/alertTriangleIcon');
|
|
|
22
22
|
require('@keystar/ui/notice');
|
|
23
23
|
require('@keystar/ui/slots');
|
|
24
24
|
require('next/link');
|
|
25
|
-
var adminUi_context_dist_nixxieCmsCoreAdminUiContext = require('../../../../../dist/context-
|
|
25
|
+
var adminUi_context_dist_nixxieCmsCoreAdminUiContext = require('../../../../../dist/context-b5204629.cjs.js');
|
|
26
26
|
require('next/router');
|
|
27
27
|
require('next/head');
|
|
28
|
-
var CreateItemDialog = require('../../../../../dist/CreateItemDialog-
|
|
28
|
+
var CreateItemDialog = require('../../../../../dist/CreateItemDialog-a0cab315.cjs.js');
|
|
29
29
|
var client = require('@apollo/client');
|
|
30
30
|
var arrowUpRightIcon = require('@keystar/ui/icon/icons/arrowUpRightIcon');
|
|
31
31
|
var combobox = require('@keystar/ui/combobox');
|
|
32
32
|
var isDeepEqual = require('fast-deep-equal');
|
|
33
33
|
var react$1 = require('@apollo/client/react');
|
|
34
|
-
var useFilter = require('../../../../../dist/useFilter-
|
|
34
|
+
var useFilter = require('../../../../../dist/useFilter-acc9d413.cjs.js');
|
|
35
35
|
var plusIcon = require('@keystar/ui/icon/icons/plusIcon');
|
|
36
36
|
var menu = require('@keystar/ui/menu');
|
|
37
37
|
var tooltip = require('@keystar/ui/tooltip');
|
|
@@ -51,7 +51,7 @@ require('@nixxie-cms/core/admin-ui/router');
|
|
|
51
51
|
require('@keystar/ui/icon/icons/chevronLeftIcon');
|
|
52
52
|
require('@keystar/ui/icon/icons/undo2Icon');
|
|
53
53
|
require('@keystar/ui/picker');
|
|
54
|
-
require('../../../../../dist/admin-meta-graphql-
|
|
54
|
+
require('../../../../../dist/admin-meta-graphql-306c224a.cjs.js');
|
|
55
55
|
require('../../../../../dist/filters-b3e5eb50.cjs.js');
|
|
56
56
|
require('../../../../../dist/Fields-e2c28056.cjs.js');
|
|
57
57
|
require('../../../../../dist/useCreateItem-1be4987e.cjs.js');
|
package/fields/types/relationship/views/dist/nixxie-cms-core-fields-types-relationship-views.esm.js
CHANGED
|
@@ -18,16 +18,16 @@ import '@keystar/ui/icon/icons/alertTriangleIcon';
|
|
|
18
18
|
import '@keystar/ui/notice';
|
|
19
19
|
import '@keystar/ui/slots';
|
|
20
20
|
import 'next/link';
|
|
21
|
-
import { a as useList, P as PaginationControls } from '../../../../../dist/context-
|
|
21
|
+
import { a as useList, P as PaginationControls } from '../../../../../dist/context-af9957ed.esm.js';
|
|
22
22
|
import 'next/router';
|
|
23
23
|
import 'next/head';
|
|
24
|
-
import { B as BuildItemDialog } from '../../../../../dist/CreateItemDialog-
|
|
24
|
+
import { B as BuildItemDialog } from '../../../../../dist/CreateItemDialog-7008b050.esm.js';
|
|
25
25
|
import { gql, ApolloClient, InMemoryCache } from '@apollo/client';
|
|
26
26
|
import { arrowUpRightIcon } from '@keystar/ui/icon/icons/arrowUpRightIcon';
|
|
27
27
|
import { ComboboxMulti, Item, Combobox } from '@keystar/ui/combobox';
|
|
28
28
|
import isDeepEqual from 'fast-deep-equal';
|
|
29
29
|
import { useApolloClient, useQuery } from '@apollo/client/react';
|
|
30
|
-
import { u as useSearchFilter } from '../../../../../dist/useFilter-
|
|
30
|
+
import { u as useSearchFilter } from '../../../../../dist/useFilter-9b6db1f9.esm.js';
|
|
31
31
|
import { plusIcon } from '@keystar/ui/icon/icons/plusIcon';
|
|
32
32
|
import { ActionMenu, Item as Item$1 } from '@keystar/ui/menu';
|
|
33
33
|
import { TooltipTrigger, Tooltip } from '@keystar/ui/tooltip';
|
|
@@ -47,7 +47,7 @@ import '@nixxie-cms/core/admin-ui/router';
|
|
|
47
47
|
import '@keystar/ui/icon/icons/chevronLeftIcon';
|
|
48
48
|
import '@keystar/ui/icon/icons/undo2Icon';
|
|
49
49
|
import '@keystar/ui/picker';
|
|
50
|
-
import '../../../../../dist/admin-meta-graphql-
|
|
50
|
+
import '../../../../../dist/admin-meta-graphql-0e6e606e.esm.js';
|
|
51
51
|
import '../../../../../dist/filters-8c8616f9.esm.js';
|
|
52
52
|
import '../../../../../dist/Fields-956d9a14.esm.js';
|
|
53
53
|
import '../../../../../dist/useCreateItem-1f94d252.esm.js';
|
|
@@ -32,7 +32,7 @@ require('@keystar/ui/icon/icons/chevronRightIcon');
|
|
|
32
32
|
require('@keystar/ui/icon/icons/undo2Icon');
|
|
33
33
|
require('@keystar/ui/tag');
|
|
34
34
|
require('@keystar/ui/tooltip');
|
|
35
|
-
require('../../../../../dist/admin-meta-graphql-
|
|
35
|
+
require('../../../../../dist/admin-meta-graphql-306c224a.cjs.js');
|
|
36
36
|
require('@apollo/client');
|
|
37
37
|
require('@apollo/client/react');
|
|
38
38
|
require('next/router');
|
|
@@ -28,7 +28,7 @@ import '@keystar/ui/icon/icons/chevronRightIcon';
|
|
|
28
28
|
import '@keystar/ui/icon/icons/undo2Icon';
|
|
29
29
|
import '@keystar/ui/tag';
|
|
30
30
|
import '@keystar/ui/tooltip';
|
|
31
|
-
import '../../../../../dist/admin-meta-graphql-
|
|
31
|
+
import '../../../../../dist/admin-meta-graphql-0e6e606e.esm.js';
|
|
32
32
|
import '@apollo/client';
|
|
33
33
|
import '@apollo/client/react';
|
|
34
34
|
import 'next/router';
|
|
@@ -29,7 +29,7 @@ require('@keystar/ui/icon/icons/undo2Icon');
|
|
|
29
29
|
require('@keystar/ui/picker');
|
|
30
30
|
require('@keystar/ui/tag');
|
|
31
31
|
require('@keystar/ui/tooltip');
|
|
32
|
-
require('../../../../../dist/admin-meta-graphql-
|
|
32
|
+
require('../../../../../dist/admin-meta-graphql-306c224a.cjs.js');
|
|
33
33
|
require('@apollo/client');
|
|
34
34
|
require('@apollo/client/react');
|
|
35
35
|
require('next/router');
|
|
@@ -25,7 +25,7 @@ import '@keystar/ui/icon/icons/undo2Icon';
|
|
|
25
25
|
import '@keystar/ui/picker';
|
|
26
26
|
import '@keystar/ui/tag';
|
|
27
27
|
import '@keystar/ui/tooltip';
|
|
28
|
-
import '../../../../../dist/admin-meta-graphql-
|
|
28
|
+
import '../../../../../dist/admin-meta-graphql-0e6e606e.esm.js';
|
|
29
29
|
import '@apollo/client';
|
|
30
30
|
import '@apollo/client/react';
|
|
31
31
|
import 'next/router';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export * from "../../../../dist/declarations/src/internal-unstable/admin-ui/id-field-view.js";
|
|
2
|
+
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibml4eGllLWNtcy1jb3JlLWludGVybmFsLXVuc3RhYmxlLWFkbWluLXVpLWlkLWZpZWxkLXZpZXcuY2pzLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9kaXN0L2RlY2xhcmF0aW9ucy9zcmMvaW50ZXJuYWwtdW5zdGFibGUvYWRtaW4tdWkvaWQtZmllbGQtdmlldy5kLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBIn0=
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var react = require('react');
|
|
6
|
+
var i18n = require('@react-aria/i18n');
|
|
7
|
+
var copyToClipboard = require('clipboard-copy');
|
|
8
|
+
var button = require('@keystar/ui/button');
|
|
9
|
+
var icon = require('@keystar/ui/icon');
|
|
10
|
+
var clipboardIcon = require('@keystar/ui/icon/icons/clipboardIcon');
|
|
11
|
+
var layout = require('@keystar/ui/layout');
|
|
12
|
+
var tooltip = require('@keystar/ui/tooltip');
|
|
13
|
+
var textField = require('@keystar/ui/text-field');
|
|
14
|
+
var utils = require('../../../../dist/utils-b031e11c.cjs.js');
|
|
15
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
16
|
+
|
|
17
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
18
|
+
|
|
19
|
+
var copyToClipboard__default = /*#__PURE__*/_interopDefault(copyToClipboard);
|
|
20
|
+
|
|
21
|
+
const COPY_TOOLTIP_CONTENT = {
|
|
22
|
+
neutral: 'Copy ID',
|
|
23
|
+
positive: 'Copied to clipboard',
|
|
24
|
+
critical: 'Unable to copy'
|
|
25
|
+
};
|
|
26
|
+
function Field({
|
|
27
|
+
value
|
|
28
|
+
}) {
|
|
29
|
+
const [tooltipState, setTooltipState] = react.useState({
|
|
30
|
+
tone: 'neutral'
|
|
31
|
+
});
|
|
32
|
+
const onCopy = react.useCallback(async () => {
|
|
33
|
+
try {
|
|
34
|
+
if (value) await copyToClipboard__default["default"](value);
|
|
35
|
+
setTooltipState({
|
|
36
|
+
isOpen: true,
|
|
37
|
+
tone: 'positive'
|
|
38
|
+
});
|
|
39
|
+
} catch (err) {
|
|
40
|
+
setTooltipState({
|
|
41
|
+
isOpen: true,
|
|
42
|
+
tone: 'critical'
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// close, then reset the tooltip state after a delay
|
|
47
|
+
setTimeout(() => {
|
|
48
|
+
setTooltipState(state => ({
|
|
49
|
+
...state,
|
|
50
|
+
isOpen: false
|
|
51
|
+
}));
|
|
52
|
+
}, 2000);
|
|
53
|
+
setTimeout(() => {
|
|
54
|
+
setTooltipState({
|
|
55
|
+
isOpen: undefined,
|
|
56
|
+
tone: 'neutral'
|
|
57
|
+
});
|
|
58
|
+
}, 2300);
|
|
59
|
+
}, [value]);
|
|
60
|
+
return /*#__PURE__*/jsxRuntime.jsxs(layout.Grid, {
|
|
61
|
+
gap: "regular",
|
|
62
|
+
columns: "1fr auto",
|
|
63
|
+
alignItems: "end",
|
|
64
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(textField.TextField, {
|
|
65
|
+
label: "Item ID",
|
|
66
|
+
value: value !== null && value !== void 0 ? value : '',
|
|
67
|
+
isReadOnly: true,
|
|
68
|
+
onFocus: ({
|
|
69
|
+
target
|
|
70
|
+
}) => {
|
|
71
|
+
if (target instanceof HTMLInputElement) target.select();
|
|
72
|
+
}
|
|
73
|
+
}), /*#__PURE__*/jsxRuntime.jsxs(tooltip.TooltipTrigger, {
|
|
74
|
+
isOpen: tooltipState.isOpen,
|
|
75
|
+
placement: "top end",
|
|
76
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(button.ActionButton, {
|
|
77
|
+
"aria-label": "copy id",
|
|
78
|
+
onPress: onCopy,
|
|
79
|
+
children: /*#__PURE__*/jsxRuntime.jsx(icon.Icon, {
|
|
80
|
+
src: clipboardIcon.clipboardIcon
|
|
81
|
+
})
|
|
82
|
+
}), /*#__PURE__*/jsxRuntime.jsx(tooltip.Tooltip, {
|
|
83
|
+
tone: tooltipState.tone,
|
|
84
|
+
children: COPY_TOOLTIP_CONTENT[tooltipState.tone]
|
|
85
|
+
})]
|
|
86
|
+
})]
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
function controller(config) {
|
|
90
|
+
return {
|
|
91
|
+
fieldKey: config.fieldKey,
|
|
92
|
+
label: config.label,
|
|
93
|
+
description: config.description,
|
|
94
|
+
defaultValue: null,
|
|
95
|
+
deserialize: data => data[config.fieldKey],
|
|
96
|
+
serialize: value => ({
|
|
97
|
+
[config.fieldKey]: value
|
|
98
|
+
}),
|
|
99
|
+
graphqlSelection: config.fieldKey,
|
|
100
|
+
filter: {
|
|
101
|
+
Filter(props) {
|
|
102
|
+
const {
|
|
103
|
+
autoFocus,
|
|
104
|
+
context,
|
|
105
|
+
onChange,
|
|
106
|
+
type,
|
|
107
|
+
typeLabel,
|
|
108
|
+
value,
|
|
109
|
+
...otherProps
|
|
110
|
+
} = props;
|
|
111
|
+
const labelProps = context === 'add' ? {
|
|
112
|
+
label: config.label,
|
|
113
|
+
description: typeLabel
|
|
114
|
+
} : {
|
|
115
|
+
label: typeLabel
|
|
116
|
+
};
|
|
117
|
+
const [inputValue, setInputValue] = react.useState(() => Array.isArray(value) ? value.join(', ') : value);
|
|
118
|
+
const [lastSeenValue, setLastSeenValue] = react.useState(value);
|
|
119
|
+
if (value !== lastSeenValue && Array.isArray(value)) {
|
|
120
|
+
setInputValue(value.join(', '));
|
|
121
|
+
setLastSeenValue(value);
|
|
122
|
+
}
|
|
123
|
+
return /*#__PURE__*/jsxRuntime.jsx(textField.TextField, {
|
|
124
|
+
...otherProps,
|
|
125
|
+
...labelProps,
|
|
126
|
+
autoFocus: autoFocus,
|
|
127
|
+
onChange: newVal => {
|
|
128
|
+
if (Array.isArray(value)) {
|
|
129
|
+
setInputValue(newVal);
|
|
130
|
+
} else {
|
|
131
|
+
onChange(newVal);
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
onBlur: () => {
|
|
135
|
+
if (Array.isArray(value)) {
|
|
136
|
+
onChange(inputValue.split(',').map(val => val.trim()));
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
value: Array.isArray(value) ? inputValue : value
|
|
140
|
+
});
|
|
141
|
+
},
|
|
142
|
+
Label({
|
|
143
|
+
label,
|
|
144
|
+
value,
|
|
145
|
+
type
|
|
146
|
+
}) {
|
|
147
|
+
const listFormatter = i18n.useListFormatter({
|
|
148
|
+
style: 'short',
|
|
149
|
+
type: 'disjunction'
|
|
150
|
+
});
|
|
151
|
+
if (['in', 'not_in'].includes(type)) {
|
|
152
|
+
return `${label.toLowerCase()} (${listFormatter.format(value)})`;
|
|
153
|
+
}
|
|
154
|
+
return `${label.toLowerCase()} ${value}`;
|
|
155
|
+
},
|
|
156
|
+
graphql: ({
|
|
157
|
+
type,
|
|
158
|
+
value
|
|
159
|
+
}) => {
|
|
160
|
+
const valueWithoutWhitespace = Array.isArray(value) ? value.map(val => val.replace(/\s/g, '')) : value.replace(/\s/g, '');
|
|
161
|
+
if (type === 'not') return {
|
|
162
|
+
[config.fieldKey]: {
|
|
163
|
+
not: {
|
|
164
|
+
equals: valueWithoutWhitespace
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
const key = type === 'is' ? 'equals' : type === 'not_in' ? 'notIn' : type;
|
|
169
|
+
return {
|
|
170
|
+
[config.fieldKey]: {
|
|
171
|
+
[key]: valueWithoutWhitespace
|
|
172
|
+
}
|
|
173
|
+
};
|
|
174
|
+
},
|
|
175
|
+
parseGraphQL: value => {
|
|
176
|
+
return utils.entriesTyped(value).flatMap(([type, value]) => {
|
|
177
|
+
if (!value) return [];
|
|
178
|
+
if (type === 'equals') return {
|
|
179
|
+
type: 'is',
|
|
180
|
+
value
|
|
181
|
+
};
|
|
182
|
+
if (type === 'notIn') return {
|
|
183
|
+
type: 'not_in',
|
|
184
|
+
value
|
|
185
|
+
};
|
|
186
|
+
if (type === 'in') return {
|
|
187
|
+
type: 'in',
|
|
188
|
+
value
|
|
189
|
+
};
|
|
190
|
+
if (type === 'not' && value !== null && value !== void 0 && value.equals) {
|
|
191
|
+
return {
|
|
192
|
+
type: 'not',
|
|
193
|
+
value: value === null || value === void 0 ? void 0 : value.equals
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
if (type === 'gt' || type === 'gte' || type === 'lt' || type === 'lte') {
|
|
197
|
+
return {
|
|
198
|
+
type,
|
|
199
|
+
value
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
return [];
|
|
203
|
+
});
|
|
204
|
+
},
|
|
205
|
+
types: {
|
|
206
|
+
is: {
|
|
207
|
+
label: 'Is exactly',
|
|
208
|
+
initialValue: ''
|
|
209
|
+
},
|
|
210
|
+
not: {
|
|
211
|
+
label: 'Is not exactly',
|
|
212
|
+
initialValue: ''
|
|
213
|
+
},
|
|
214
|
+
gt: {
|
|
215
|
+
label: 'Is greater than',
|
|
216
|
+
initialValue: ''
|
|
217
|
+
},
|
|
218
|
+
lt: {
|
|
219
|
+
label: 'Is less than',
|
|
220
|
+
initialValue: ''
|
|
221
|
+
},
|
|
222
|
+
gte: {
|
|
223
|
+
label: 'Is greater than or equal to',
|
|
224
|
+
initialValue: ''
|
|
225
|
+
},
|
|
226
|
+
lte: {
|
|
227
|
+
label: 'Is less than or equal to',
|
|
228
|
+
initialValue: ''
|
|
229
|
+
},
|
|
230
|
+
in: {
|
|
231
|
+
label: 'Is one of',
|
|
232
|
+
initialValue: []
|
|
233
|
+
},
|
|
234
|
+
not_in: {
|
|
235
|
+
label: 'Is not one of',
|
|
236
|
+
initialValue: []
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
exports.Field = Field;
|
|
244
|
+
exports.controller = controller;
|