@journeyapps-labs/reactor-mod-data-browser 3.0.1 → 3.1.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 +45 -0
- package/dist/@types/actions/connections/SetConnectionColorAction.d.ts +11 -0
- package/dist/@types/actions/saved-queries/OpenSavedQueryAction.d.ts +10 -0
- package/dist/@types/actions/saved-queries/RemoveSavedQueryAction.d.ts +9 -0
- package/dist/@types/core/AbstractConnection.d.ts +2 -0
- package/dist/@types/core/SchemaModelDefinition.d.ts +5 -0
- package/dist/@types/core/connection-colors.d.ts +10 -0
- package/dist/@types/core/query/StandardModelFields.d.ts +5 -0
- package/dist/@types/core/query/filters.d.ts +46 -5
- package/dist/@types/core/query/query-simple/SimplePage.d.ts +2 -0
- package/dist/@types/core/query/query-simple/SimpleQuery.d.ts +12 -3
- package/dist/@types/core/query/query-simple/SimpleQueryColumns.d.ts +12 -0
- package/dist/@types/core/query/query-simple/SimpleQueryFilterState.d.ts +37 -0
- package/dist/@types/core/query/query-simple/SimpleQueryPlanner.d.ts +4 -0
- package/dist/@types/core/query/query-simple/SimpleQuerySortState.d.ts +23 -0
- package/dist/@types/core/query/query-simple/SimpleQueryTypes.d.ts +24 -0
- package/dist/@types/core/query/widgets/ColumnDisplayWidget.d.ts +1 -0
- package/dist/@types/core/query/widgets/PeekRelationshipButton.d.ts +7 -0
- package/dist/@types/core/query/widgets/SmartColumnWidget.d.ts +3 -0
- package/dist/@types/core/query/widgets/SmartFilterWidget.d.ts +6 -0
- package/dist/@types/entities/ConnectionEntityDefinition.d.ts +2 -0
- package/dist/@types/entities/SavedQueryEntityDefinition.d.ts +8 -0
- package/dist/@types/entities.d.ts +2 -1
- package/dist/@types/forms/APIConnectionForm.d.ts +1 -0
- package/dist/@types/forms/TypeEngine.d.ts +3 -21
- package/dist/@types/forms/types/attachment-handler.d.ts +2 -0
- package/dist/@types/forms/types/boolean-handler.d.ts +2 -0
- package/dist/@types/forms/types/date-handler.d.ts +2 -0
- package/dist/@types/forms/types/filters/ClearableFilterFormDialogDirective.d.ts +10 -0
- package/dist/@types/forms/types/filters/ConditionalFilterForm.d.ts +23 -0
- package/dist/@types/forms/types/image-handler.d.ts +2 -0
- package/dist/@types/forms/types/location-handler.d.ts +2 -0
- package/dist/@types/forms/types/multiple-choice-handler.d.ts +2 -0
- package/dist/@types/forms/types/multiple-choice-integer-handler.d.ts +2 -0
- package/dist/@types/forms/types/number-handler.d.ts +2 -0
- package/dist/@types/forms/types/shared/type-handler.d.ts +37 -0
- package/dist/@types/forms/types/shared/ui.d.ts +768 -0
- package/dist/@types/forms/types/single-choice-handler.d.ts +2 -0
- package/dist/@types/forms/types/single-choice-integer-handler.d.ts +2 -0
- package/dist/@types/forms/types/text-handler.d.ts +3 -0
- package/dist/@types/index.d.ts +1 -0
- package/dist/@types/panels/_shared/SharedConnectionPanelFactory.d.ts +19 -0
- package/dist/@types/panels/_shared/SharedModelPanelFactory.d.ts +5 -2
- package/dist/@types/panels/query/QueryPanelFactory.d.ts +6 -2
- package/dist/@types/panels/query/TableControlsWidget.d.ts +2 -0
- package/dist/@types/panels/query/table-controls/ChangesControlsWidget.d.ts +8 -0
- package/dist/@types/panels/query/table-controls/FilterControlsWidget.d.ts +7 -0
- package/dist/@types/panels/query/table-controls/PageControlsWidget.d.ts +9 -0
- package/dist/@types/panels/query/table-controls/QueryControlsWidget.d.ts +11 -0
- package/dist/@types/panels/query/table-controls/SortChipWidget.d.ts +10 -0
- package/dist/@types/panels/query/table-controls/SortControlsWidget.d.ts +7 -0
- package/dist/@types/preferences/QueryControlPreferences.d.ts +7 -0
- package/dist/@types/stores/SavedQueryStore.d.ts +34 -0
- package/dist/@types/widgets/EmptyValueWidget.d.ts +7 -0
- package/dist/DataBrowserModule.js +21 -7
- package/dist/DataBrowserModule.js.map +1 -1
- package/dist/actions/connections/AddConnectionAction.js +2 -2
- package/dist/actions/connections/AddConnectionAction.js.map +1 -1
- package/dist/actions/connections/RemoveConnectionAction.js +2 -2
- package/dist/actions/connections/RemoveConnectionAction.js.map +1 -1
- package/dist/actions/connections/SetConnectionColorAction.js +63 -0
- package/dist/actions/connections/SetConnectionColorAction.js.map +1 -0
- package/dist/actions/saved-queries/OpenSavedQueryAction.js +58 -0
- package/dist/actions/saved-queries/OpenSavedQueryAction.js.map +1 -0
- package/dist/actions/saved-queries/RemoveSavedQueryAction.js +43 -0
- package/dist/actions/saved-queries/RemoveSavedQueryAction.js.map +1 -0
- package/dist/actions/schema-definitions/CreateModelAction.js +2 -2
- package/dist/actions/schema-definitions/CreateModelAction.js.map +1 -1
- package/dist/actions/schema-definitions/QuerySchemaModelAction.js +2 -2
- package/dist/actions/schema-definitions/QuerySchemaModelAction.js.map +1 -1
- package/dist/actions/schema-model/EditSchemaModelAction.js +2 -2
- package/dist/actions/schema-model/EditSchemaModelAction.js.map +1 -1
- package/dist/actions/schema-model/ViewSchemaModelAsJsonAction.js +2 -2
- package/dist/actions/schema-model/ViewSchemaModelAsJsonAction.js.map +1 -1
- package/dist/core/AbstractConnection.js +116 -90
- package/dist/core/AbstractConnection.js.map +1 -1
- package/dist/core/SchemaModelDefinition.js +14 -0
- package/dist/core/SchemaModelDefinition.js.map +1 -1
- package/dist/core/connection-colors.js +36 -0
- package/dist/core/connection-colors.js.map +1 -0
- package/dist/core/query/StandardModelFields.js +10 -0
- package/dist/core/query/StandardModelFields.js.map +1 -0
- package/dist/core/query/filters.js +86 -4
- package/dist/core/query/filters.js.map +1 -1
- package/dist/core/query/query-simple/SimplePage.js +2 -4
- package/dist/core/query/query-simple/SimplePage.js.map +1 -1
- package/dist/core/query/query-simple/SimpleQuery.js +64 -68
- package/dist/core/query/query-simple/SimpleQuery.js.map +1 -1
- package/dist/core/query/query-simple/SimpleQueryColumns.js +88 -0
- package/dist/core/query/query-simple/SimpleQueryColumns.js.map +1 -0
- package/dist/core/query/query-simple/SimpleQueryFilterState.js +136 -0
- package/dist/core/query/query-simple/SimpleQueryFilterState.js.map +1 -0
- package/dist/core/query/query-simple/SimpleQueryPlanner.js +14 -0
- package/dist/core/query/query-simple/SimpleQueryPlanner.js.map +1 -0
- package/dist/core/query/query-simple/SimpleQuerySortState.js +140 -0
- package/dist/core/query/query-simple/SimpleQuerySortState.js.map +1 -0
- package/dist/core/query/query-simple/SimpleQueryTypes.js +44 -0
- package/dist/core/query/query-simple/SimpleQueryTypes.js.map +1 -0
- package/dist/core/query/widgets/BelongsToDisplayWidget.js +14 -7
- package/dist/core/query/widgets/BelongsToDisplayWidget.js.map +1 -1
- package/dist/core/query/widgets/CellDisplayWidget.js +5 -9
- package/dist/core/query/widgets/CellDisplayWidget.js.map +1 -1
- package/dist/core/query/widgets/ColumnDisplayWidget.js +13 -12
- package/dist/core/query/widgets/ColumnDisplayWidget.js.map +1 -1
- package/dist/core/query/widgets/PeekRelationshipButton.js +128 -0
- package/dist/core/query/widgets/PeekRelationshipButton.js.map +1 -0
- package/dist/core/query/widgets/SmartColumnWidget.js +18 -3
- package/dist/core/query/widgets/SmartColumnWidget.js.map +1 -1
- package/dist/core/query/widgets/SmartFilterWidget.js +88 -51
- package/dist/core/query/widgets/SmartFilterWidget.js.map +1 -1
- package/dist/entities/ConnectionEntityDefinition.js +32 -7
- package/dist/entities/ConnectionEntityDefinition.js.map +1 -1
- package/dist/entities/SavedQueryEntityDefinition.js +68 -0
- package/dist/entities/SavedQueryEntityDefinition.js.map +1 -0
- package/dist/entities/SchemaModelDefinitionEntityDefinition.js +3 -1
- package/dist/entities/SchemaModelDefinitionEntityDefinition.js.map +1 -1
- package/dist/entities.js +1 -0
- package/dist/entities.js.map +1 -1
- package/dist/forms/APIConnectionForm.js +11 -2
- package/dist/forms/APIConnectionForm.js.map +1 -1
- package/dist/forms/TypeEngine.js +30 -306
- package/dist/forms/TypeEngine.js.map +1 -1
- package/dist/forms/types/attachment-handler.js +29 -0
- package/dist/forms/types/attachment-handler.js.map +1 -0
- package/dist/forms/types/boolean-handler.js +22 -0
- package/dist/forms/types/boolean-handler.js.map +1 -0
- package/dist/forms/types/date-handler.js +97 -0
- package/dist/forms/types/date-handler.js.map +1 -0
- package/dist/forms/types/filters/ClearableFilterFormDialogDirective.js +25 -0
- package/dist/forms/types/filters/ClearableFilterFormDialogDirective.js.map +1 -0
- package/dist/forms/types/filters/ConditionalFilterForm.js +87 -0
- package/dist/forms/types/filters/ConditionalFilterForm.js.map +1 -0
- package/dist/forms/types/image-handler.js +82 -0
- package/dist/forms/types/image-handler.js.map +1 -0
- package/dist/forms/types/location-handler.js +49 -0
- package/dist/forms/types/location-handler.js.map +1 -0
- package/dist/forms/types/multiple-choice-handler.js +37 -0
- package/dist/forms/types/multiple-choice-handler.js.map +1 -0
- package/dist/forms/types/multiple-choice-integer-handler.js +37 -0
- package/dist/forms/types/multiple-choice-integer-handler.js.map +1 -0
- package/dist/forms/types/number-handler.js +79 -0
- package/dist/forms/types/number-handler.js.map +1 -0
- package/dist/forms/types/shared/type-handler.js +2 -0
- package/dist/forms/types/shared/type-handler.js.map +1 -0
- package/dist/forms/types/shared/ui.js +33 -0
- package/dist/forms/types/shared/ui.js.map +1 -0
- package/dist/forms/types/single-choice-handler.js +41 -0
- package/dist/forms/types/single-choice-handler.js.map +1 -0
- package/dist/forms/types/single-choice-integer-handler.js +41 -0
- package/dist/forms/types/single-choice-integer-handler.js.map +1 -0
- package/dist/forms/types/text-handler.js +170 -0
- package/dist/forms/types/text-handler.js.map +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/panels/_shared/SharedConnectionPanelFactory.js +48 -0
- package/dist/panels/_shared/SharedConnectionPanelFactory.js.map +1 -0
- package/dist/panels/_shared/SharedModelPanelFactory.js +7 -2
- package/dist/panels/_shared/SharedModelPanelFactory.js.map +1 -1
- package/dist/panels/query/PageResultsWidget.js +28 -11
- package/dist/panels/query/PageResultsWidget.js.map +1 -1
- package/dist/panels/query/QueryPanelFactory.js +17 -2
- package/dist/panels/query/QueryPanelFactory.js.map +1 -1
- package/dist/panels/query/QueryPanelWidget.js +55 -9
- package/dist/panels/query/QueryPanelWidget.js.map +1 -1
- package/dist/panels/query/TableControlsWidget.js +29 -67
- package/dist/panels/query/TableControlsWidget.js.map +1 -1
- package/dist/panels/query/table-controls/ChangesControlsWidget.js +36 -0
- package/dist/panels/query/table-controls/ChangesControlsWidget.js.map +1 -0
- package/dist/panels/query/table-controls/FilterControlsWidget.js +106 -0
- package/dist/panels/query/table-controls/FilterControlsWidget.js.map +1 -0
- package/dist/panels/query/table-controls/PageControlsWidget.js +65 -0
- package/dist/panels/query/table-controls/PageControlsWidget.js.map +1 -0
- package/dist/panels/query/table-controls/QueryControlsWidget.js +85 -0
- package/dist/panels/query/table-controls/QueryControlsWidget.js.map +1 -0
- package/dist/panels/query/table-controls/SortChipWidget.js +75 -0
- package/dist/panels/query/table-controls/SortChipWidget.js.map +1 -0
- package/dist/panels/query/table-controls/SortControlsWidget.js +65 -0
- package/dist/panels/query/table-controls/SortControlsWidget.js.map +1 -0
- package/dist/preferences/QueryControlPreferences.js +28 -0
- package/dist/preferences/QueryControlPreferences.js.map +1 -0
- package/dist/stores/ConnectionStore.js +2 -0
- package/dist/stores/ConnectionStore.js.map +1 -1
- package/dist/stores/SavedQueryStore.js +131 -0
- package/dist/stores/SavedQueryStore.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/widgets/EmptyValueWidget.js +15 -0
- package/dist/widgets/EmptyValueWidget.js.map +1 -0
- package/dist-module/bundle.js +181 -51
- package/dist-module/bundle.js.map +1 -1
- package/package.json +13 -13
- package/src/DataBrowserModule.ts +21 -7
- package/src/actions/connections/AddConnectionAction.tsx +2 -2
- package/src/actions/connections/RemoveConnectionAction.tsx +2 -2
- package/src/actions/connections/SetConnectionColorAction.ts +52 -0
- package/src/actions/saved-queries/OpenSavedQueryAction.ts +43 -0
- package/src/actions/saved-queries/RemoveSavedQueryAction.ts +27 -0
- package/src/actions/schema-definitions/CreateModelAction.ts +9 -2
- package/src/actions/schema-definitions/QuerySchemaModelAction.ts +9 -2
- package/src/actions/schema-model/EditSchemaModelAction.ts +9 -2
- package/src/actions/schema-model/ViewSchemaModelAsJsonAction.ts +9 -2
- package/src/core/AbstractConnection.ts +7 -1
- package/src/core/SchemaModelDefinition.ts +16 -0
- package/src/core/connection-colors.ts +49 -0
- package/src/core/query/StandardModelFields.ts +9 -0
- package/src/core/query/filters.ts +121 -6
- package/src/core/query/query-simple/SimplePage.ts +4 -5
- package/src/core/query/query-simple/SimpleQuery.tsx +83 -86
- package/src/core/query/query-simple/SimpleQueryColumns.tsx +126 -0
- package/src/core/query/query-simple/SimpleQueryFilterState.ts +160 -0
- package/src/core/query/query-simple/SimpleQueryPlanner.ts +18 -0
- package/src/core/query/query-simple/SimpleQuerySortState.ts +133 -0
- package/src/core/query/query-simple/SimpleQueryTypes.ts +61 -0
- package/src/core/query/widgets/BelongsToDisplayWidget.tsx +19 -11
- package/src/core/query/widgets/CellDisplayWidget.tsx +5 -10
- package/src/core/query/widgets/ColumnDisplayWidget.tsx +24 -20
- package/src/core/query/widgets/PeekRelationshipButton.tsx +161 -0
- package/src/core/query/widgets/SmartColumnWidget.tsx +26 -4
- package/src/core/query/widgets/SmartFilterWidget.tsx +119 -69
- package/src/entities/ConnectionEntityDefinition.tsx +33 -4
- package/src/entities/SavedQueryEntityDefinition.ts +72 -0
- package/src/entities/SchemaModelDefinitionEntityDefinition.ts +5 -2
- package/src/entities.ts +2 -1
- package/src/forms/APIConnectionForm.tsx +15 -2
- package/src/forms/TypeEngine.tsx +35 -421
- package/src/forms/types/attachment-handler.tsx +35 -0
- package/src/forms/types/boolean-handler.tsx +28 -0
- package/src/forms/types/date-handler.tsx +125 -0
- package/src/forms/types/filters/ClearableFilterFormDialogDirective.ts +32 -0
- package/src/forms/types/filters/ConditionalFilterForm.tsx +109 -0
- package/src/forms/types/image-handler.tsx +90 -0
- package/src/forms/types/location-handler.tsx +53 -0
- package/src/forms/types/multiple-choice-handler.tsx +37 -0
- package/src/forms/types/multiple-choice-integer-handler.tsx +37 -0
- package/src/forms/types/number-handler.tsx +100 -0
- package/src/forms/types/shared/type-handler.ts +36 -0
- package/src/forms/types/shared/ui.tsx +40 -0
- package/src/forms/types/single-choice-handler.tsx +47 -0
- package/src/forms/types/single-choice-integer-handler.tsx +47 -0
- package/src/forms/types/text-handler.tsx +247 -0
- package/src/index.ts +1 -0
- package/src/panels/_shared/SharedConnectionPanelFactory.tsx +55 -0
- package/src/panels/_shared/SharedModelPanelFactory.tsx +8 -2
- package/src/panels/query/PageResultsWidget.tsx +40 -28
- package/src/panels/query/QueryPanelFactory.tsx +19 -2
- package/src/panels/query/QueryPanelWidget.tsx +64 -9
- package/src/panels/query/TableControlsWidget.tsx +42 -120
- package/src/panels/query/table-controls/ChangesControlsWidget.tsx +72 -0
- package/src/panels/query/table-controls/FilterControlsWidget.tsx +145 -0
- package/src/panels/query/table-controls/PageControlsWidget.tsx +97 -0
- package/src/panels/query/table-controls/QueryControlsWidget.tsx +127 -0
- package/src/panels/query/table-controls/SortChipWidget.tsx +119 -0
- package/src/panels/query/table-controls/SortControlsWidget.tsx +95 -0
- package/src/preferences/QueryControlPreferences.ts +34 -0
- package/src/stores/ConnectionStore.ts +2 -0
- package/src/stores/SavedQueryStore.ts +121 -0
- package/src/widgets/EmptyValueWidget.tsx +20 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DescendantEntityProviderComponent,
|
|
3
|
+
EntityCardsPresenterComponent,
|
|
3
4
|
EntityDefinition,
|
|
4
5
|
EntityDescriberComponent,
|
|
5
6
|
EntityPanelComponent,
|
|
@@ -11,11 +12,15 @@ import { DataBrowserEntities } from '../entities';
|
|
|
11
12
|
import { ConnectionStore } from '../stores/ConnectionStore';
|
|
12
13
|
import { AbstractConnection } from '../core/AbstractConnection';
|
|
13
14
|
import { AddConnectionAction } from '../actions/connections/AddConnectionAction';
|
|
15
|
+
import { SavedQueryEntity, SavedQueryStore } from '../stores/SavedQueryStore';
|
|
14
16
|
|
|
15
17
|
export class ConnectionEntityDefinition extends EntityDefinition<AbstractConnection> {
|
|
16
18
|
@inject(ConnectionStore)
|
|
17
19
|
accessor connectionStore: ConnectionStore;
|
|
18
20
|
|
|
21
|
+
@inject(SavedQueryStore)
|
|
22
|
+
accessor savedQueryStore: SavedQueryStore;
|
|
23
|
+
|
|
19
24
|
constructor() {
|
|
20
25
|
super({
|
|
21
26
|
type: DataBrowserEntities.CONNECTION,
|
|
@@ -29,7 +34,10 @@ export class ConnectionEntityDefinition extends EntityDefinition<AbstractConnect
|
|
|
29
34
|
new EntityDescriberComponent<AbstractConnection>({
|
|
30
35
|
label: 'Simple',
|
|
31
36
|
describe: (entity: AbstractConnection) => {
|
|
32
|
-
return
|
|
37
|
+
return {
|
|
38
|
+
...entity.name,
|
|
39
|
+
iconColor: entity.color
|
|
40
|
+
};
|
|
33
41
|
}
|
|
34
42
|
})
|
|
35
43
|
);
|
|
@@ -43,7 +51,14 @@ export class ConnectionEntityDefinition extends EntityDefinition<AbstractConnect
|
|
|
43
51
|
})
|
|
44
52
|
);
|
|
45
53
|
|
|
46
|
-
this.registerComponent(
|
|
54
|
+
this.registerComponent(
|
|
55
|
+
new InlineTreePresenterComponent<AbstractConnection>({
|
|
56
|
+
loadChildrenAsNodesAreOpened: true,
|
|
57
|
+
cacheTreeEntities: false
|
|
58
|
+
})
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
this.registerComponent(new EntityCardsPresenterComponent<AbstractConnection>());
|
|
47
62
|
|
|
48
63
|
this.registerComponent(
|
|
49
64
|
new DescendantEntityProviderComponent<AbstractConnection>({
|
|
@@ -52,8 +67,7 @@ export class ConnectionEntityDefinition extends EntityDefinition<AbstractConnect
|
|
|
52
67
|
return {
|
|
53
68
|
category: {
|
|
54
69
|
label: 'Models',
|
|
55
|
-
icon: 'cube'
|
|
56
|
-
openDefault: true
|
|
70
|
+
icon: 'cube'
|
|
57
71
|
},
|
|
58
72
|
descendants: parent.schema_models.items
|
|
59
73
|
};
|
|
@@ -61,6 +75,21 @@ export class ConnectionEntityDefinition extends EntityDefinition<AbstractConnect
|
|
|
61
75
|
})
|
|
62
76
|
);
|
|
63
77
|
|
|
78
|
+
this.registerComponent(
|
|
79
|
+
new DescendantEntityProviderComponent<AbstractConnection, SavedQueryEntity>({
|
|
80
|
+
descendantType: DataBrowserEntities.SAVED_QUERY,
|
|
81
|
+
generateOptions: (parent) => {
|
|
82
|
+
return {
|
|
83
|
+
category: {
|
|
84
|
+
label: 'Saved queries',
|
|
85
|
+
icon: 'bookmark'
|
|
86
|
+
},
|
|
87
|
+
descendants: this.savedQueryStore.getSavedEntitiesForConnection(parent.id)
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
})
|
|
91
|
+
);
|
|
92
|
+
|
|
64
93
|
this.registerComponent(
|
|
65
94
|
new EntityPanelComponent<AbstractConnection>({
|
|
66
95
|
label: 'Connections',
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import {
|
|
2
|
+
EntityActionHandlerComponent,
|
|
3
|
+
EntityCardsPresenterComponent,
|
|
4
|
+
EntityDefinition,
|
|
5
|
+
EntityDescriberComponent,
|
|
6
|
+
inject,
|
|
7
|
+
InlineEntityEncoderComponent,
|
|
8
|
+
InlineTreePresenterComponent
|
|
9
|
+
} from '@journeyapps-labs/reactor-mod';
|
|
10
|
+
import { DataBrowserEntities } from '../entities';
|
|
11
|
+
import { SavedQueryEntity, SavedQueryStore } from '../stores/SavedQueryStore';
|
|
12
|
+
import { OpenSavedQueryAction } from '../actions/saved-queries/OpenSavedQueryAction';
|
|
13
|
+
import { RemoveSavedQueryAction } from '../actions/saved-queries/RemoveSavedQueryAction';
|
|
14
|
+
|
|
15
|
+
interface SavedQueryEntityEncoded {
|
|
16
|
+
id: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export class SavedQueryEntityDefinition extends EntityDefinition<SavedQueryEntity> {
|
|
20
|
+
@inject(SavedQueryStore)
|
|
21
|
+
accessor savedQueryStore: SavedQueryStore;
|
|
22
|
+
|
|
23
|
+
constructor() {
|
|
24
|
+
super({
|
|
25
|
+
type: DataBrowserEntities.SAVED_QUERY,
|
|
26
|
+
category: 'DataBrowser',
|
|
27
|
+
label: 'Saved query',
|
|
28
|
+
icon: 'bookmark',
|
|
29
|
+
iconColor: 'gold'
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
this.registerComponent(
|
|
33
|
+
new EntityDescriberComponent<SavedQueryEntity>({
|
|
34
|
+
label: 'Simple',
|
|
35
|
+
describe: (entity) => {
|
|
36
|
+
return {
|
|
37
|
+
simpleName: entity.saved.name,
|
|
38
|
+
complexName: entity.saved.query.definition,
|
|
39
|
+
tags: ['saved']
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
})
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
this.registerComponent(new InlineTreePresenterComponent<SavedQueryEntity>());
|
|
46
|
+
this.registerComponent(new EntityCardsPresenterComponent<SavedQueryEntity>());
|
|
47
|
+
|
|
48
|
+
this.registerComponent(
|
|
49
|
+
new InlineEntityEncoderComponent<SavedQueryEntity, SavedQueryEntityEncoded>({
|
|
50
|
+
version: 1,
|
|
51
|
+
encode: (entity) => {
|
|
52
|
+
return {
|
|
53
|
+
id: entity.id
|
|
54
|
+
};
|
|
55
|
+
},
|
|
56
|
+
decode: async (entity) => {
|
|
57
|
+
return this.savedQueryStore.getSavedEntityByID(entity.id);
|
|
58
|
+
}
|
|
59
|
+
})
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
this.registerComponent(new EntityActionHandlerComponent(OpenSavedQueryAction.ID));
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
matchEntity(t: any): boolean {
|
|
66
|
+
return t instanceof SavedQueryEntity;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
getEntityUID(t: SavedQueryEntity) {
|
|
70
|
+
return t.id;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
@@ -13,7 +13,6 @@ import { ConnectionStore } from '../stores/ConnectionStore';
|
|
|
13
13
|
import { AbstractConnection } from '../core/AbstractConnection';
|
|
14
14
|
import { SchemaModelDefinition } from '../core/SchemaModelDefinition';
|
|
15
15
|
import { QuerySchemaModelAction } from '../actions/schema-definitions/QuerySchemaModelAction';
|
|
16
|
-
import { V4Index } from '@journeyapps-labs/client-backend-v4';
|
|
17
16
|
import { IndexModel } from '../core/IndexModel';
|
|
18
17
|
|
|
19
18
|
export interface SchemaModelDefinitionEntityDefinitionEncoded {
|
|
@@ -78,7 +77,11 @@ export class SchemaModelDefinitionEntityDefinition extends EntityDefinition<Sche
|
|
|
78
77
|
})
|
|
79
78
|
);
|
|
80
79
|
|
|
81
|
-
this.registerComponent(
|
|
80
|
+
this.registerComponent(
|
|
81
|
+
new InlineTreePresenterComponent({
|
|
82
|
+
loadChildrenAsNodesAreOpened: true
|
|
83
|
+
})
|
|
84
|
+
);
|
|
82
85
|
|
|
83
86
|
this.registerComponent(
|
|
84
87
|
new SimpleParentEntitySearchEngine<AbstractConnection, SchemaModelDefinition>({
|
package/src/entities.ts
CHANGED
|
@@ -4,5 +4,6 @@ export enum DataBrowserEntities {
|
|
|
4
4
|
SCHEMA_MODEL_DEFINITION = 'databrowser/schema_model_definition',
|
|
5
5
|
SCHEMA_MODEL_INDEX = 'databrowser/schema_model_index',
|
|
6
6
|
SCHEMA_MODEL_OBJECT = 'databrowser/schema_model_object',
|
|
7
|
-
QUERY = 'databrowser/query'
|
|
7
|
+
QUERY = 'databrowser/query',
|
|
8
|
+
SAVED_QUERY = 'databrowser/saved_query'
|
|
8
9
|
}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { FormModel, TextInput, TextInputType } from '@journeyapps-labs/reactor-mod';
|
|
1
|
+
import { FormModel, SelectInput, TextInput, TextInputType } from '@journeyapps-labs/reactor-mod';
|
|
2
2
|
import { ManualConnection } from '../core/types/ManualConnection';
|
|
3
3
|
import { ManualConnectionFactory } from '../core/types/ManualConnectionFactory';
|
|
4
|
+
import { DEFAULT_CONNECTION_COLOR, getConnectionColorSetOptions } from '../core/connection-colors';
|
|
4
5
|
|
|
5
6
|
export interface APIConnectionFormValue {
|
|
6
7
|
name: string;
|
|
7
8
|
base_url: string;
|
|
8
9
|
api_token: string;
|
|
10
|
+
color: string;
|
|
9
11
|
}
|
|
10
12
|
|
|
11
13
|
export class APIConnectionForm extends FormModel<APIConnectionFormValue> {
|
|
@@ -36,13 +38,24 @@ export class APIConnectionForm extends FormModel<APIConnectionFormValue> {
|
|
|
36
38
|
value: value?.api_token
|
|
37
39
|
})
|
|
38
40
|
);
|
|
41
|
+
|
|
42
|
+
this.addInput(
|
|
43
|
+
new SelectInput({
|
|
44
|
+
name: 'color',
|
|
45
|
+
label: 'Color',
|
|
46
|
+
value: value?.color || DEFAULT_CONNECTION_COLOR,
|
|
47
|
+
options: getConnectionColorSetOptions()
|
|
48
|
+
})
|
|
49
|
+
);
|
|
39
50
|
}
|
|
40
51
|
|
|
41
52
|
generateConnection(factory: ManualConnectionFactory) {
|
|
42
|
-
|
|
53
|
+
const connection = new ManualConnection(factory, {
|
|
43
54
|
baseUrl: this.value().base_url,
|
|
44
55
|
token: this.value().api_token,
|
|
45
56
|
name: this.value().name
|
|
46
57
|
});
|
|
58
|
+
connection.color = this.value().color;
|
|
59
|
+
return connection;
|
|
47
60
|
}
|
|
48
61
|
}
|
package/src/forms/TypeEngine.tsx
CHANGED
|
@@ -1,70 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
Type
|
|
19
|
-
} from '@journeyapps/db';
|
|
20
|
-
import {
|
|
21
|
-
AbstractMedia,
|
|
22
|
-
BooleanInput,
|
|
23
|
-
CheckboxWidget,
|
|
24
|
-
DateInput,
|
|
25
|
-
DateTimePickerType,
|
|
26
|
-
FileInput,
|
|
27
|
-
FormInput,
|
|
28
|
-
ImageInput,
|
|
29
|
-
ImageMedia,
|
|
30
|
-
inject,
|
|
31
|
-
MediaEngine,
|
|
32
|
-
MetadataWidget,
|
|
33
|
-
NumberInput,
|
|
34
|
-
PanelButtonWidget,
|
|
35
|
-
SelectInput,
|
|
36
|
-
SmartDateDisplayWidget,
|
|
37
|
-
styled,
|
|
38
|
-
TableButtonWidget,
|
|
39
|
-
TextAreaInput,
|
|
40
|
-
TextInput,
|
|
41
|
-
TextInputType,
|
|
42
|
-
MultiSelectInput,
|
|
43
|
-
WorkspaceStore
|
|
44
|
-
} from '@journeyapps-labs/reactor-mod';
|
|
45
|
-
import {} from '@journeyapps-labs/reactor-mod-editor';
|
|
46
|
-
import { LocationInput } from './inputs/LocationInput';
|
|
47
|
-
import * as React from 'react';
|
|
48
|
-
import { JSX } from 'react';
|
|
49
|
-
import { SchemaModelObject } from '../core/SchemaModelObject';
|
|
50
|
-
import * as _ from 'lodash';
|
|
51
|
-
import { ModelJsonPanelModel } from '../panels/model-json/ModelJsonPanelFactory';
|
|
52
|
-
|
|
53
|
-
const MAX_NUMBER_OF_ARR_ITEMS_TO_DISPLAY = 3;
|
|
54
|
-
|
|
55
|
-
export interface TypeHandler<T extends Type = Type, ENCODED = any, DECODED = any> {
|
|
56
|
-
matches: (type: Type) => boolean;
|
|
57
|
-
generateField: (event: { label: string; name: string; type: T }) => FormInput;
|
|
58
|
-
generateDisplay: (event: {
|
|
59
|
-
label: string;
|
|
60
|
-
name: string;
|
|
61
|
-
type: T;
|
|
62
|
-
value: ENCODED;
|
|
63
|
-
model: SchemaModelObject;
|
|
64
|
-
}) => JSX.Element | string;
|
|
65
|
-
decode: (value: ENCODED) => Promise<DECODED>;
|
|
66
|
-
encode: (value: DECODED) => Promise<ENCODED>;
|
|
67
|
-
}
|
|
1
|
+
import { Type } from '@journeyapps/db';
|
|
2
|
+
import { AbstractMedia, inject, MediaEngine, WorkspaceStore } from '@journeyapps-labs/reactor-mod';
|
|
3
|
+
import { displayArray } from './types/shared/ui';
|
|
4
|
+
import { TypeHandler } from './types/shared/type-handler';
|
|
5
|
+
import { dateHandler } from './types/date-handler';
|
|
6
|
+
import { imageHandler } from './types/image-handler';
|
|
7
|
+
import { attachmentHandler } from './types/attachment-handler';
|
|
8
|
+
import { booleanHandler } from './types/boolean-handler';
|
|
9
|
+
import { numberHandler } from './types/number-handler';
|
|
10
|
+
import { textHandler } from './types/text-handler';
|
|
11
|
+
import { locationHandler } from './types/location-handler';
|
|
12
|
+
import { singleChoiceIntegerHandler } from './types/single-choice-integer-handler';
|
|
13
|
+
import { singleChoiceHandler } from './types/single-choice-handler';
|
|
14
|
+
import { multipleChoiceHandler } from './types/multiple-choice-handler';
|
|
15
|
+
import { multipleChoiceIntegerHandler } from './types/multiple-choice-integer-handler';
|
|
16
|
+
|
|
17
|
+
export type { TypeHandler };
|
|
68
18
|
|
|
69
19
|
export class TypeEngine {
|
|
70
20
|
handlers: Set<TypeHandler>;
|
|
@@ -80,318 +30,24 @@ export class TypeEngine {
|
|
|
80
30
|
constructor() {
|
|
81
31
|
this.handlers = new Set();
|
|
82
32
|
this._mediaCache = new Map();
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
return <SmartDateDisplayWidget date={value.toDate()} />;
|
|
102
|
-
}
|
|
103
|
-
return <SmartDateDisplayWidget date={value} />;
|
|
104
|
-
}
|
|
105
|
-
});
|
|
106
|
-
|
|
107
|
-
this.register({
|
|
108
|
-
matches: (type) => type instanceof SignatureType || type instanceof PhotoType,
|
|
109
|
-
encode: async (value: ImageMedia) => {
|
|
110
|
-
return Attachment.create({
|
|
111
|
-
data: await value.toArrayBuffer()
|
|
112
|
-
});
|
|
113
|
-
},
|
|
114
|
-
decode: async (value: Attachment) => {
|
|
115
|
-
if (this._mediaCache.has(value.id)) {
|
|
116
|
-
return this._mediaCache.get(value.id);
|
|
117
|
-
}
|
|
118
|
-
let media = this.mediaEngine.getMediaTypeForPath('.jpg').generateMedia({
|
|
119
|
-
content: await value.toArrayBuffer(),
|
|
120
|
-
name: value.id,
|
|
121
|
-
uid: value.id
|
|
122
|
-
});
|
|
123
|
-
|
|
124
|
-
this._mediaCache.set(value.id, media);
|
|
125
|
-
return media;
|
|
126
|
-
},
|
|
127
|
-
generateField: ({ label, name }) => {
|
|
128
|
-
return new ImageInput({
|
|
129
|
-
name,
|
|
130
|
-
label
|
|
131
|
-
});
|
|
132
|
-
},
|
|
133
|
-
generateDisplay: ({ value, type }) => {
|
|
134
|
-
if (value.uploaded()) {
|
|
135
|
-
return (
|
|
136
|
-
<S.Preview
|
|
137
|
-
onClick={() => {
|
|
138
|
-
this.getHandler(type)
|
|
139
|
-
.decode(value)
|
|
140
|
-
.then((media: ImageMedia) => {
|
|
141
|
-
if (media instanceof ImageMedia) {
|
|
142
|
-
media.open();
|
|
143
|
-
} else {
|
|
144
|
-
window.open(value.url(), '_blank');
|
|
145
|
-
}
|
|
146
|
-
});
|
|
147
|
-
}}
|
|
148
|
-
src={value.urls['thumbnail']}
|
|
149
|
-
/>
|
|
150
|
-
);
|
|
151
|
-
}
|
|
152
|
-
return <S.Empty>Not uploaded</S.Empty>;
|
|
153
|
-
}
|
|
154
|
-
});
|
|
155
|
-
|
|
156
|
-
this.register({
|
|
157
|
-
matches: (type) => type instanceof AttachmentType,
|
|
158
|
-
encode: async (value: File) => {
|
|
159
|
-
return Attachment.create({
|
|
160
|
-
data: await value.arrayBuffer(),
|
|
161
|
-
filename: value.name
|
|
162
|
-
});
|
|
163
|
-
},
|
|
164
|
-
decode: async (value: Attachment) => {
|
|
165
|
-
return new File([await value.toArrayBuffer()], value.id);
|
|
166
|
-
},
|
|
167
|
-
generateField: ({ label, name }) => {
|
|
168
|
-
return new FileInput({
|
|
169
|
-
name,
|
|
170
|
-
label
|
|
171
|
-
});
|
|
172
|
-
},
|
|
173
|
-
generateDisplay: ({ value }) => {
|
|
174
|
-
return (
|
|
175
|
-
<TableButtonWidget
|
|
176
|
-
icon="download"
|
|
177
|
-
action={() => {
|
|
178
|
-
window.open(value.url(), '_blank');
|
|
179
|
-
}}
|
|
180
|
-
/>
|
|
181
|
-
);
|
|
182
|
-
}
|
|
183
|
-
});
|
|
184
|
-
this.register({
|
|
185
|
-
matches: (type) => type instanceof BooleanType,
|
|
186
|
-
encode: async (value: boolean) => value,
|
|
187
|
-
decode: async (value: boolean) => value,
|
|
188
|
-
generateField: ({ label, name }) => {
|
|
189
|
-
return new BooleanInput({
|
|
190
|
-
name,
|
|
191
|
-
label
|
|
192
|
-
});
|
|
193
|
-
},
|
|
194
|
-
generateDisplay: ({ value, type, name, model }) => {
|
|
195
|
-
return (
|
|
196
|
-
<CheckboxWidget
|
|
197
|
-
checked={value}
|
|
198
|
-
onChange={(checked) => {
|
|
199
|
-
model.set(name, checked);
|
|
200
|
-
}}
|
|
201
|
-
/>
|
|
202
|
-
);
|
|
203
|
-
}
|
|
204
|
-
});
|
|
205
|
-
|
|
206
|
-
this.register({
|
|
207
|
-
matches: (type) => type instanceof NumberType,
|
|
208
|
-
encode: async (value: number) => value,
|
|
209
|
-
decode: async (value: number) => value,
|
|
210
|
-
generateField: ({ label, name }) => {
|
|
211
|
-
return new NumberInput({
|
|
212
|
-
name,
|
|
213
|
-
label
|
|
214
|
-
});
|
|
215
|
-
},
|
|
216
|
-
generateDisplay: ({ value, type, name, model }) => {
|
|
217
|
-
return `${value}`;
|
|
218
|
-
}
|
|
219
|
-
});
|
|
220
|
-
|
|
221
|
-
this.register<TextType, string, string>({
|
|
222
|
-
matches: (type) => type instanceof TextType,
|
|
223
|
-
encode: async (value: string) => value,
|
|
224
|
-
decode: async (value: string) => value,
|
|
225
|
-
generateField: ({ label, name, type }) => {
|
|
226
|
-
if (type.subType == 'paragraph') {
|
|
227
|
-
return new TextAreaInput({
|
|
228
|
-
name,
|
|
229
|
-
label
|
|
230
|
-
});
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
if (type.subType == 'password') {
|
|
234
|
-
return new TextInput({
|
|
235
|
-
name,
|
|
236
|
-
label,
|
|
237
|
-
inputType: TextInputType.PASSWORD
|
|
238
|
-
});
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
return new TextInput({
|
|
242
|
-
name,
|
|
243
|
-
label
|
|
244
|
-
});
|
|
245
|
-
},
|
|
246
|
-
generateDisplay: ({ value, type, name, model }) => {
|
|
247
|
-
if (value.trim() === '') {
|
|
248
|
-
return <S.Empty>empty</S.Empty>;
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
if (type.subType == 'password') {
|
|
252
|
-
return '****';
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
if (type.subType == 'paragraph') {
|
|
256
|
-
// could be JSON
|
|
257
|
-
if ((value.startsWith('[') && value.endsWith(']')) || (value.startsWith('{') && value.endsWith('}'))) {
|
|
258
|
-
try {
|
|
259
|
-
let parsed = JSON.parse(value);
|
|
260
|
-
|
|
261
|
-
return (
|
|
262
|
-
<TableButtonWidget
|
|
263
|
-
icon="code"
|
|
264
|
-
label="JSON"
|
|
265
|
-
action={() => {
|
|
266
|
-
this.workspaceStore.addModel(
|
|
267
|
-
new ModelJsonPanelModel({
|
|
268
|
-
definition: model.definition,
|
|
269
|
-
model: model,
|
|
270
|
-
field: name
|
|
271
|
-
})
|
|
272
|
-
);
|
|
273
|
-
}}
|
|
274
|
-
/>
|
|
275
|
-
);
|
|
276
|
-
} catch (ex) {}
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
if (type.subType == 'url') {
|
|
281
|
-
return (
|
|
282
|
-
<S.Container>
|
|
283
|
-
{value}
|
|
284
|
-
<TableButtonWidget
|
|
285
|
-
icon="arrow-right"
|
|
286
|
-
action={() => {
|
|
287
|
-
window.open(value, '_blank');
|
|
288
|
-
}}
|
|
289
|
-
/>
|
|
290
|
-
</S.Container>
|
|
291
|
-
);
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
return <S.Max>{value}</S.Max>;
|
|
295
|
-
}
|
|
296
|
-
});
|
|
297
|
-
this.register({
|
|
298
|
-
matches: (type) => type instanceof LocationType,
|
|
299
|
-
encode: async (value: Location) => value,
|
|
300
|
-
decode: async (value: Location) => value,
|
|
301
|
-
generateField: ({ label, name }) => {
|
|
302
|
-
return new LocationInput({
|
|
303
|
-
name,
|
|
304
|
-
label
|
|
305
|
-
});
|
|
306
|
-
},
|
|
307
|
-
generateDisplay: ({ value }) => {
|
|
308
|
-
return (
|
|
309
|
-
<>
|
|
310
|
-
<MetadataWidget label={'Lat'} value={`${value.latitude}`} />
|
|
311
|
-
<MetadataWidget label={'Long'} value={`${value.longitude}`} />
|
|
312
|
-
</>
|
|
313
|
-
);
|
|
314
|
-
}
|
|
315
|
-
});
|
|
316
|
-
|
|
317
|
-
this.register({
|
|
318
|
-
matches: (type) => type instanceof SingleChoiceIntegerType,
|
|
319
|
-
encode: async (value: string) => parseInt(value),
|
|
320
|
-
decode: async (value: number) => `${value}`,
|
|
321
|
-
generateField: ({ label, name, type }) => {
|
|
322
|
-
return new SelectInput({
|
|
323
|
-
name,
|
|
324
|
-
label,
|
|
325
|
-
options: _.mapValues(type.options, (o) => `${o.value}`)
|
|
326
|
-
});
|
|
327
|
-
},
|
|
328
|
-
generateDisplay: ({ value, type, name, model, label }) => {
|
|
329
|
-
return `${value}`;
|
|
330
|
-
}
|
|
331
|
-
});
|
|
332
|
-
|
|
333
|
-
this.register({
|
|
334
|
-
matches: (type) => type instanceof SingleChoiceType,
|
|
335
|
-
encode: async (value: string) => value,
|
|
336
|
-
decode: async (value: string) => value,
|
|
337
|
-
generateField: ({ label, name, type }) => {
|
|
338
|
-
return new SelectInput({
|
|
339
|
-
name,
|
|
340
|
-
label,
|
|
341
|
-
options: _.mapValues(type.options, (o) => `${o.value}`)
|
|
342
|
-
});
|
|
343
|
-
},
|
|
344
|
-
generateDisplay: ({ value }) => {
|
|
345
|
-
return value;
|
|
346
|
-
}
|
|
347
|
-
});
|
|
348
|
-
|
|
349
|
-
this.register({
|
|
350
|
-
matches: (type) => type instanceof MultipleChoiceType,
|
|
351
|
-
encode: async (value: string[]) => value,
|
|
352
|
-
decode: async (value: string[]) => value,
|
|
353
|
-
generateField: ({ label, name, type }) => {
|
|
354
|
-
return new MultiSelectInput({
|
|
355
|
-
name,
|
|
356
|
-
label,
|
|
357
|
-
options: _.mapValues(type.options, (o) => `${o.value}`)
|
|
358
|
-
});
|
|
359
|
-
},
|
|
360
|
-
generateDisplay: ({ value }) => {
|
|
361
|
-
return this.displayArray(value);
|
|
362
|
-
}
|
|
363
|
-
});
|
|
364
|
-
|
|
365
|
-
this.register({
|
|
366
|
-
matches: (type) => type instanceof MultipleChoiceIntegerType,
|
|
367
|
-
encode: async (value: string[]) => value.map((v) => parseInt(v)),
|
|
368
|
-
decode: async (value: number[]) => value.map((v) => `${v}`),
|
|
369
|
-
generateField: ({ label, name, type }) => {
|
|
370
|
-
return new MultiSelectInput({
|
|
371
|
-
name,
|
|
372
|
-
label,
|
|
373
|
-
options: _.mapValues(type.options, (o) => `${o.value}`)
|
|
374
|
-
});
|
|
375
|
-
},
|
|
376
|
-
generateDisplay: ({ value }) => {
|
|
377
|
-
return this.displayArray(value);
|
|
378
|
-
}
|
|
379
|
-
});
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
displayArray(value: any[]) {
|
|
383
|
-
if (value.length === 0) {
|
|
384
|
-
return <S.Empty>empty array</S.Empty>;
|
|
385
|
-
}
|
|
386
|
-
let items = _.slice(value, 0, MAX_NUMBER_OF_ARR_ITEMS_TO_DISPLAY);
|
|
387
|
-
return (
|
|
388
|
-
<S.Pills>
|
|
389
|
-
{items.map((c) => {
|
|
390
|
-
return <S.pill key={c}>{c}</S.pill>;
|
|
391
|
-
})}
|
|
392
|
-
{items.length !== value.length ? '...' : null}
|
|
393
|
-
</S.Pills>
|
|
394
|
-
);
|
|
33
|
+
const context = {
|
|
34
|
+
mediaEngine: this.mediaEngine,
|
|
35
|
+
workspaceStore: this.workspaceStore,
|
|
36
|
+
mediaCache: this._mediaCache,
|
|
37
|
+
displayArray
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
this.register(dateHandler);
|
|
41
|
+
this.register(imageHandler(context));
|
|
42
|
+
this.register(attachmentHandler);
|
|
43
|
+
this.register(booleanHandler);
|
|
44
|
+
this.register(numberHandler);
|
|
45
|
+
this.register(textHandler(context));
|
|
46
|
+
this.register(locationHandler);
|
|
47
|
+
this.register(singleChoiceIntegerHandler);
|
|
48
|
+
this.register(singleChoiceHandler);
|
|
49
|
+
this.register(multipleChoiceHandler(context));
|
|
50
|
+
this.register(multipleChoiceIntegerHandler(context));
|
|
395
51
|
}
|
|
396
52
|
|
|
397
53
|
getHandler(type: Type) {
|
|
@@ -407,45 +63,3 @@ export class TypeEngine {
|
|
|
407
63
|
this.handlers.add(handler);
|
|
408
64
|
}
|
|
409
65
|
}
|
|
410
|
-
|
|
411
|
-
namespace S {
|
|
412
|
-
export const Preview = styled.img`
|
|
413
|
-
max-height: 40px;
|
|
414
|
-
max-width: 40px;
|
|
415
|
-
cursor: pointer;
|
|
416
|
-
`;
|
|
417
|
-
|
|
418
|
-
export const Empty = styled.div`
|
|
419
|
-
opacity: 0.2;
|
|
420
|
-
`;
|
|
421
|
-
|
|
422
|
-
export const Max = styled.div`
|
|
423
|
-
max-width: 500px;
|
|
424
|
-
white-space: pre;
|
|
425
|
-
display: inline;
|
|
426
|
-
overflow: hidden;
|
|
427
|
-
text-overflow: ellipsis;
|
|
428
|
-
`;
|
|
429
|
-
|
|
430
|
-
export const Container = styled.div`
|
|
431
|
-
display: flex;
|
|
432
|
-
flex-direction: row;
|
|
433
|
-
column-gap: 5px;
|
|
434
|
-
align-items: center;
|
|
435
|
-
justify-content: space-between;
|
|
436
|
-
flex-grow: 1;
|
|
437
|
-
`;
|
|
438
|
-
|
|
439
|
-
export const pill = styled.div`
|
|
440
|
-
padding: 2px 4px;
|
|
441
|
-
background: ${(p) => p.theme.table.pills};
|
|
442
|
-
border-radius: 3px;
|
|
443
|
-
font-size: 12px;
|
|
444
|
-
`;
|
|
445
|
-
|
|
446
|
-
export const Pills = styled.div`
|
|
447
|
-
display: flex;
|
|
448
|
-
column-gap: 2px;
|
|
449
|
-
row-gap: 2px;
|
|
450
|
-
`;
|
|
451
|
-
}
|