jmapcloud-ng-core-types 1.0.33 → 1.0.35

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/index.ts CHANGED
@@ -577,7 +577,8 @@ export interface JServerState extends JServerInfo {
577
577
  export type JHistoryListener = (oldValue: string | undefined, newValue: string | undefined) => void
578
578
 
579
579
  export interface JFormJMCService {
580
- getJsonForm(layerId: string): JJsonFormSchemas
580
+ getJsonForm(layerId: string): any
581
+ getForm(layerId: string): any
581
582
  }
582
583
 
583
584
  export interface JFormService {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jmapcloud-ng-core-types",
3
- "version": "1.0.33",
3
+ "version": "1.0.35",
4
4
  "description": "JMap Cloud specific version of JMap Cloud NG Core types and interfaces",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -36,4 +36,4 @@
36
36
  "maplibre-gl": "^4.3.1",
37
37
  "redux": "^5.0.1"
38
38
  }
39
- }
39
+ }
package/public/core.d.ts CHANGED
@@ -10262,7 +10262,26 @@ declare namespace JMap {
10262
10262
  * .catch(error => console.error("An error occurred when getting jsonForm schema", error))
10263
10263
  * ```
10264
10264
  */
10265
- function getJsonForm(layerId: JId): JJsonFormSchemas
10265
+ function getJsonForm(layerId: JId): any
10266
+
10267
+ /**
10268
+ * ***JMap.FormJMC.getForm***
10269
+ *
10270
+ * Returns the form for a layer.
10271
+ *
10272
+ * @param layerId the JMap layer id
10273
+ * @example
10274
+ * ```ts
10275
+ * // returns the form for layer id=f47ac10b-58cc-4372-a567-0e02b2c3d479
10276
+
10277
+
10278
+ * JMap.FormJMC
10279
+ * .getForm("f47ac10b-58cc-4372-a567-0e02b2c3d479")
10280
+ * .then(form => console.log("form of layer f47ac10b-58cc-4372-a567-0e02b2c3d479", form))
10281
+ * .catch(error => console.error("An error occurred when getting the form for layer f47ac10b-58cc-4372-a567-0e02b2c3d479", error))
10282
+ * ```
10283
+ */
10284
+ function getForm(layerId: JId): any
10266
10285
  }
10267
10286
  /**
10268
10287
  * **JMap.Form**
@@ -22,7 +22,110 @@ declare interface JJsonFormControlElement {
22
22
  }
23
23
  }
24
24
 
25
+ declare interface JFormJMC {
26
+ id: string
27
+ name: any
28
+ createdBy: string
29
+ creationDate: Date
30
+ lastModifiedBy: string
31
+ lastModificationDate: Date
32
+ organizationId: string
33
+ uiSchema: FormNodeVertical
34
+ formSchema: any
35
+ tags: any[]
36
+ dataSourceId: string
37
+ }
38
+
25
39
  declare interface JJsonFormUISchema {
26
40
  type: "VerticalLayout"
27
41
  elements: JJsonFormControlElement[]
28
42
  }
43
+
44
+ interface FormNodeBase {
45
+ type: string
46
+ designComponent: string
47
+ id: string
48
+ icon: any
49
+ }
50
+
51
+ export interface FormNodeControl extends FormNodeBase {
52
+ type: "Control"
53
+ title?: string
54
+ scope: string
55
+ options: {
56
+ readonly: boolean
57
+ }
58
+ }
59
+ export interface FormNodeLabel extends FormNodeBase {
60
+ designComponent: "Label"
61
+ type: "Label"
62
+ text?: string
63
+ }
64
+
65
+ export interface FormNodeText extends FormNodeControl {
66
+ designComponent: "Text"
67
+ options: FormNodeControl["options"] & {
68
+ multi: boolean
69
+ }
70
+ }
71
+ export interface FormNodeNumber extends FormNodeControl {
72
+ designComponent: "Number"
73
+ options: FormNodeControl["options"] & {
74
+ slider: boolean
75
+ }
76
+ }
77
+ export interface FormNodeBoolean extends FormNodeControl {
78
+ designComponent: "Boolean"
79
+ options: FormNodeControl["options"] & {
80
+ toggle: boolean
81
+ asBoolean: boolean
82
+ checkedValue: string | number
83
+ uncheckedValue: string | number
84
+ }
85
+ }
86
+ export interface FormNodeDate extends FormNodeControl {
87
+ designComponent: "Date"
88
+ }
89
+ export interface FormNodeList extends FormNodeControl {
90
+ designComponent: "List"
91
+ options: FormNodeControl["options"] & {
92
+ format?: string
93
+ }
94
+ }
95
+
96
+ export interface FormNodeLayout extends FormNodeBase {
97
+ type: string
98
+ elements: FormNode[]
99
+ }
100
+
101
+ export interface FormNodeVertical extends FormNodeLayout {
102
+ type: "VerticalLayout"
103
+ designComponent: "VerticalLayout"
104
+ isRoot?: boolean
105
+ }
106
+
107
+ export interface FormNodeHorizontal extends FormNodeLayout {
108
+ type: "HorizontalLayout"
109
+ designComponent: "HorizontalLayout"
110
+ }
111
+ export interface FormNodeGroup extends FormNodeLayout {
112
+ type: "Group"
113
+ designComponent: "Group"
114
+ label?: string
115
+ }
116
+
117
+ export interface FormNodeTabs extends FormNodeLayout {
118
+ type: "Categorization"
119
+ designComponent: "Tabs"
120
+ }
121
+
122
+ export interface FormNodeTab extends FormNodeLayout {
123
+ type: "Category"
124
+ designComponent: "Category"
125
+ label?: string
126
+ }
127
+
128
+ export type FormNodesControl = FormNodeText | FormNodeNumber | FormNodeBoolean | FormNodeDate | FormNodeList
129
+ export type FormNodesLayout = FormNodeVertical | FormNodeHorizontal | FormNodeGroup | FormNodeTabs | FormNodeTab
130
+
131
+ export type FormNode = FormNodesControl | FormNodesLayout | FormNodeLabel