@feltmaps/js-sdk 1.7.0-next.20 → 1.7.0-next.22
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/dist/client.d.cts +2 -2
- package/dist/client.d.ts +2 -2
- package/dist/{controller-9JZIE1UX.d.cts → controller-Bf6iA9-c.d.cts} +339 -139
- package/dist/{controller-9JZIE1UX.d.ts → controller-Bf6iA9-c.d.ts} +339 -139
- package/dist/controller-bundled.d.ts +339 -139
- package/dist/handler.cjs +1 -1
- package/dist/handler.d.cts +73 -10
- package/dist/handler.d.ts +73 -10
- package/dist/handler.js +1 -1
- package/package.json +1 -1
- package/handler.d.ts +0 -4229
- package/handler.js +0 -1
- package/types-B241Rd9q.d.ts +0 -7395
|
@@ -4124,7 +4124,7 @@ interface ElementChangeCallbackParams {
|
|
|
4124
4124
|
*
|
|
4125
4125
|
* If the user is editing an existing element, this will be false.
|
|
4126
4126
|
*
|
|
4127
|
-
* For elements that are created
|
|
4127
|
+
* For elements that are created programmatically, this will be false.
|
|
4128
4128
|
*/
|
|
4129
4129
|
isBeingCreated: boolean;
|
|
4130
4130
|
}
|
|
@@ -4251,7 +4251,7 @@ interface ElementsController {
|
|
|
4251
4251
|
* @example
|
|
4252
4252
|
* ```typescript
|
|
4253
4253
|
* const unsubscribe = felt.onElementCreate({
|
|
4254
|
-
* handler: (element) => console.log(element.id),
|
|
4254
|
+
* handler: ({isBeingCreated, element}) => console.log(element.id),
|
|
4255
4255
|
* });
|
|
4256
4256
|
*
|
|
4257
4257
|
* // later on...
|
|
@@ -4262,7 +4262,7 @@ interface ElementsController {
|
|
|
4262
4262
|
/**
|
|
4263
4263
|
* The handler that is called when an element is created.
|
|
4264
4264
|
*
|
|
4265
|
-
* This will fire when elements are created
|
|
4265
|
+
* This will fire when elements are created programmatically, or when the
|
|
4266
4266
|
* user starts creating an element with a drawing tool.
|
|
4267
4267
|
*
|
|
4268
4268
|
* When the user creates an element with a drawing tool, it can begin in
|
|
@@ -4294,7 +4294,7 @@ interface ElementsController {
|
|
|
4294
4294
|
* @event
|
|
4295
4295
|
* @example
|
|
4296
4296
|
* ```typescript
|
|
4297
|
-
* const unsubscribe = felt.
|
|
4297
|
+
* const unsubscribe = felt.onElementCreateEnd({
|
|
4298
4298
|
* handler: (params) => console.log(params),
|
|
4299
4299
|
* });
|
|
4300
4300
|
*
|
|
@@ -4316,7 +4316,7 @@ interface ElementsController {
|
|
|
4316
4316
|
* Adds a listener for when an element changes.
|
|
4317
4317
|
*
|
|
4318
4318
|
* This will fire when an element is being edited, either on the map by the user
|
|
4319
|
-
* or
|
|
4319
|
+
* or programmatically.
|
|
4320
4320
|
*
|
|
4321
4321
|
* Like the {@link ElementsController.onElementCreate | `onElementCreate`} listener, this will fire when an element is
|
|
4322
4322
|
* still being created by a drawing tool.
|
|
@@ -4416,19 +4416,21 @@ interface ElementsController {
|
|
|
4416
4416
|
*/
|
|
4417
4417
|
createElement(element: ElementCreate): Promise<Element>;
|
|
4418
4418
|
/**
|
|
4419
|
-
* Update an element on the map.
|
|
4419
|
+
* Update an element on the map. The element type must be specified.
|
|
4420
4420
|
*
|
|
4421
4421
|
* @example
|
|
4422
4422
|
* ```typescript
|
|
4423
4423
|
* // Update a place element's coordinates
|
|
4424
4424
|
* await felt.updateElement({
|
|
4425
4425
|
* id: "element-1",
|
|
4426
|
+
* type: "Place",
|
|
4426
4427
|
* coordinates: [10, 20]
|
|
4427
4428
|
* });
|
|
4428
4429
|
*
|
|
4429
4430
|
* // Update a polygon's style
|
|
4430
4431
|
* await felt.updateElement({
|
|
4431
4432
|
* id: "element-2",
|
|
4433
|
+
* type: "Polygon",
|
|
4432
4434
|
* color: "#ABC123",
|
|
4433
4435
|
* fillOpacity: 0.5
|
|
4434
4436
|
* });
|
|
@@ -4754,7 +4756,7 @@ interface GeoJsonUrlVectorSource extends zInfer<typeof GeoJsonUrlVectorSourceSch
|
|
|
4754
4756
|
}
|
|
4755
4757
|
/**
|
|
4756
4758
|
* A GeoJSON data source is a layer that is populated from GeoJSON data, such as
|
|
4757
|
-
* from a local file, or
|
|
4759
|
+
* from a local file, or programmatically-created data.
|
|
4758
4760
|
*
|
|
4759
4761
|
* @group Layer sources
|
|
4760
4762
|
*/
|
|
@@ -6784,7 +6786,7 @@ interface LayersController {
|
|
|
6784
6786
|
* // first get the current style
|
|
6785
6787
|
* const oldStyle = (await felt.getLayer("layer-1")).style;
|
|
6786
6788
|
*
|
|
6787
|
-
* felt.setLayerStyle({ id: "layer-1", style: {
|
|
6789
|
+
* await felt.setLayerStyle({ id: "layer-1", style: {
|
|
6788
6790
|
* ...oldStyle,
|
|
6789
6791
|
* paint: {
|
|
6790
6792
|
* ...oldStyle.paint,
|
|
@@ -6866,7 +6868,7 @@ interface LayersController {
|
|
|
6866
6868
|
*
|
|
6867
6869
|
* const layerFromUrl = await felt.createLayersFromGeoJson({
|
|
6868
6870
|
* source: {
|
|
6869
|
-
*
|
|
6871
|
+
* type: "geoJsonUrl",
|
|
6870
6872
|
* url: "https://example.com/parcels.geojson",
|
|
6871
6873
|
* },
|
|
6872
6874
|
* name: "Parcels",
|
|
@@ -7447,15 +7449,18 @@ interface LayersController {
|
|
|
7447
7449
|
* averages, sums, etc. You can focus your calculation on specific areas or subsets
|
|
7448
7450
|
* of your data using boundaries and filters.
|
|
7449
7451
|
*
|
|
7450
|
-
* When
|
|
7451
|
-
*
|
|
7452
|
+
* When you request an aggregation other than count, you must specify an attribute to
|
|
7453
|
+
* aggregate on.
|
|
7452
7454
|
*
|
|
7453
7455
|
* @example
|
|
7454
7456
|
* ```typescript
|
|
7455
7457
|
* // Count all residential buildings
|
|
7456
7458
|
* const residentialCount = await felt.getAggregates({
|
|
7457
7459
|
* layerId: "buildings",
|
|
7458
|
-
* filters: ["type", "eq", "residential"]
|
|
7460
|
+
* filters: ["type", "eq", "residential"],
|
|
7461
|
+
* aggregation: {
|
|
7462
|
+
* methods: ["count"],
|
|
7463
|
+
* }
|
|
7459
7464
|
* });
|
|
7460
7465
|
*
|
|
7461
7466
|
* // Calculate average home value in a specific neighborhood
|
|
@@ -7833,7 +7838,7 @@ interface SelectionController {
|
|
|
7833
7838
|
*/
|
|
7834
7839
|
selectFeature(params: FeatureSelection): Promise<void>;
|
|
7835
7840
|
/**
|
|
7836
|
-
* Clears the current selection
|
|
7841
|
+
* Clears the current selection (elements, features or both)
|
|
7837
7842
|
*
|
|
7838
7843
|
* @example
|
|
7839
7844
|
* ```typescript
|
|
@@ -9090,6 +9095,112 @@ type UIFlexibleSpaceElementCreateClonable = MakeClonableSchema<UIFlexibleSpaceEl
|
|
|
9090
9095
|
interface UIFlexibleSpaceElementUpdate extends MakeUpdateSchema<UIFlexibleSpaceElement, UIFlexibleSpaceElementCreate> {
|
|
9091
9096
|
}
|
|
9092
9097
|
|
|
9098
|
+
declare const uiIframeElementSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<{
|
|
9099
|
+
onCreate: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
|
|
9100
|
+
id: z.ZodString;
|
|
9101
|
+
}, "strip", z.ZodTypeAny, {
|
|
9102
|
+
id: string;
|
|
9103
|
+
}, {
|
|
9104
|
+
id: string;
|
|
9105
|
+
}>], z.ZodUnknown>, z.ZodVoid>>;
|
|
9106
|
+
onDestroy: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
|
|
9107
|
+
id: z.ZodString;
|
|
9108
|
+
}, "strip", z.ZodTypeAny, {
|
|
9109
|
+
id: string;
|
|
9110
|
+
}, {
|
|
9111
|
+
id: string;
|
|
9112
|
+
}>], z.ZodUnknown>, z.ZodVoid>>;
|
|
9113
|
+
}, {
|
|
9114
|
+
id: z.ZodString;
|
|
9115
|
+
}>, {
|
|
9116
|
+
type: z.ZodLiteral<"Iframe">;
|
|
9117
|
+
/**
|
|
9118
|
+
* The height of the iframe.
|
|
9119
|
+
*
|
|
9120
|
+
* If not provided, the height will be automatically calculated following a 16:9 ratio.
|
|
9121
|
+
*/
|
|
9122
|
+
height: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
9123
|
+
/**
|
|
9124
|
+
* The URL of the iframe.
|
|
9125
|
+
*/
|
|
9126
|
+
url: z.ZodString;
|
|
9127
|
+
}>, "strip", z.ZodTypeAny, {
|
|
9128
|
+
type: "Iframe";
|
|
9129
|
+
id: string;
|
|
9130
|
+
url: string;
|
|
9131
|
+
onCreate?: ((args_0: {
|
|
9132
|
+
id: string;
|
|
9133
|
+
}, ...args: unknown[]) => void) | undefined;
|
|
9134
|
+
onDestroy?: ((args_0: {
|
|
9135
|
+
id: string;
|
|
9136
|
+
}, ...args: unknown[]) => void) | undefined;
|
|
9137
|
+
height?: string | number | undefined;
|
|
9138
|
+
}, {
|
|
9139
|
+
type: "Iframe";
|
|
9140
|
+
id: string;
|
|
9141
|
+
url: string;
|
|
9142
|
+
onCreate?: ((args_0: {
|
|
9143
|
+
id: string;
|
|
9144
|
+
}, ...args: unknown[]) => void) | undefined;
|
|
9145
|
+
onDestroy?: ((args_0: {
|
|
9146
|
+
id: string;
|
|
9147
|
+
}, ...args: unknown[]) => void) | undefined;
|
|
9148
|
+
height?: string | number | undefined;
|
|
9149
|
+
}>;
|
|
9150
|
+
/**
|
|
9151
|
+
* Represents an iframe element in a panel.
|
|
9152
|
+
*
|
|
9153
|
+
* The height of the iframe can be set by using the `height` property
|
|
9154
|
+
* either as a number (measured in pixels) or a string (e.g. “100px” or “50%“).
|
|
9155
|
+
*
|
|
9156
|
+
* By default, the height is calculated following a 16:9 ratio.
|
|
9157
|
+
*
|
|
9158
|
+
* <figure>
|
|
9159
|
+
* <img src="./img/iframe-basic.png" alt="Iframe showing an example website" />
|
|
9160
|
+
* <figcaption>
|
|
9161
|
+
* Iframe with default height (16:9)
|
|
9162
|
+
* </figcaption>
|
|
9163
|
+
* </figure>
|
|
9164
|
+
*
|
|
9165
|
+
* ```typescript
|
|
9166
|
+
* { type: "Iframe", url: "https://www.example.com" }
|
|
9167
|
+
* ```
|
|
9168
|
+
*
|
|
9169
|
+
* <figure>
|
|
9170
|
+
* <img src="./img/iframe-custom-height.png" alt="Iframe showing an example website with a custom height" />
|
|
9171
|
+
* <figcaption>
|
|
9172
|
+
* Iframe with custom height
|
|
9173
|
+
* </figcaption>
|
|
9174
|
+
* </figure>
|
|
9175
|
+
*
|
|
9176
|
+
* ```typescript
|
|
9177
|
+
* { type: "Iframe", url: "https://www.example.com", height: 300 }
|
|
9178
|
+
* ```
|
|
9179
|
+
*/
|
|
9180
|
+
interface UIIframeElement extends UIElementBase, Omit<zInfer<typeof uiIframeElementSchema>, "onCreate" | "onDestroy"> {
|
|
9181
|
+
}
|
|
9182
|
+
/**
|
|
9183
|
+
* The parameters for creating an iframe element.
|
|
9184
|
+
*
|
|
9185
|
+
* See {@link UIIframeElement} for more details.
|
|
9186
|
+
*
|
|
9187
|
+
* @remarks
|
|
9188
|
+
* `id` is optional but recommended if you want to be able to perform updates.
|
|
9189
|
+
*/
|
|
9190
|
+
interface UIIframeElementCreate extends Omit<UIIframeElement, "id">, UIElementBaseCreateParams {
|
|
9191
|
+
}
|
|
9192
|
+
type UIIframeElementCreateClonable = MakeClonableSchema<UIIframeElementCreate>;
|
|
9193
|
+
/**
|
|
9194
|
+
* The parameters for updating an iframe element.
|
|
9195
|
+
*
|
|
9196
|
+
* See {@link UIIframeElement} for more details.
|
|
9197
|
+
*
|
|
9198
|
+
* @remarks
|
|
9199
|
+
* `id` and `type` are required to identify the element to update.
|
|
9200
|
+
*/
|
|
9201
|
+
interface UIIframeElementUpdate extends MakeUpdateSchema<UIIframeElement, UIIframeElementCreate> {
|
|
9202
|
+
}
|
|
9203
|
+
|
|
9093
9204
|
declare const uiToggleGroupElementSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<{
|
|
9094
9205
|
onCreate: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
|
|
9095
9206
|
id: z.ZodString;
|
|
@@ -10134,22 +10245,22 @@ type UIGridContainerElementCreateClonable = Omit<MakeClonableSchema<UIGridContai
|
|
|
10134
10245
|
interface UIGridContainerElementUpdate extends MakeUpdateSchema<UIGridContainerElement, UIGridContainerElementCreate> {
|
|
10135
10246
|
}
|
|
10136
10247
|
|
|
10137
|
-
type UIPanelElement = UIButtonElement | UITextElement | UIDividerElement | UITextInputElement | UISelectElement | UIFlexibleSpaceElement | UIButtonRowElement | UICheckboxGroupElement | UIRadioGroupElement | UIToggleGroupElement | UIGridContainerElement;
|
|
10248
|
+
type UIPanelElement = UIButtonElement | UITextElement | UIDividerElement | UITextInputElement | UISelectElement | UIFlexibleSpaceElement | UIButtonRowElement | UICheckboxGroupElement | UIRadioGroupElement | UIToggleGroupElement | UIIframeElement | UIGridContainerElement;
|
|
10138
10249
|
/**
|
|
10139
10250
|
* This is a union of all the possible elements that can be created inside panel's body or footer.
|
|
10140
10251
|
*
|
|
10141
10252
|
* @remarks
|
|
10142
10253
|
* For the sake of convenience, `id` is optional but recommended if you want to be able to perform updates.
|
|
10143
10254
|
*/
|
|
10144
|
-
type UIPanelElementCreate = UIButtonElementCreate | UITextElementCreate | UIDividerElementCreate | UITextInputElementCreate | UISelectElementCreate | UIFlexibleSpaceElementCreate | UIButtonRowElementCreate | UICheckboxGroupElementCreate | UIRadioGroupElementCreate | UIToggleGroupElementCreate | UIGridContainerElementCreate;
|
|
10145
|
-
type UIPanelElementCreateClonable = UIButtonElementCreateClonable | UITextElementCreateClonable | UIDividerElementCreateClonable | UITextInputElementCreateClonable | UISelectElementCreateClonable | UIFlexibleSpaceElementCreateClonable | UIButtonRowElementCreateClonable | UICheckboxGroupElementCreateClonable | UIRadioGroupElementCreateClonable | UIToggleGroupElementCreateClonable | UIGridContainerElementCreateClonable;
|
|
10255
|
+
type UIPanelElementCreate = UIButtonElementCreate | UITextElementCreate | UIDividerElementCreate | UITextInputElementCreate | UISelectElementCreate | UIFlexibleSpaceElementCreate | UIButtonRowElementCreate | UICheckboxGroupElementCreate | UIRadioGroupElementCreate | UIToggleGroupElementCreate | UIIframeElementCreate | UIGridContainerElementCreate;
|
|
10256
|
+
type UIPanelElementCreateClonable = UIButtonElementCreateClonable | UITextElementCreateClonable | UIDividerElementCreateClonable | UITextInputElementCreateClonable | UISelectElementCreateClonable | UIFlexibleSpaceElementCreateClonable | UIButtonRowElementCreateClonable | UICheckboxGroupElementCreateClonable | UIRadioGroupElementCreateClonable | UIToggleGroupElementCreateClonable | UIIframeElementCreateClonable | UIGridContainerElementCreateClonable;
|
|
10146
10257
|
/**
|
|
10147
10258
|
* This is a union of all the possible elements that can be updated inside panel's body or footer (excluding Divider and FlexibleSpace elements because they cannot be updated).
|
|
10148
10259
|
*
|
|
10149
10260
|
* @remarks
|
|
10150
10261
|
* `id` and `type` are required to identify the element to update.
|
|
10151
10262
|
*/
|
|
10152
|
-
type UIPanelElementUpdate = UIButtonElementUpdate | UITextElementUpdate | UITextInputElementUpdate | UISelectElementUpdate | UIDividerElementUpdate | UIButtonRowElementUpdate | UICheckboxGroupElementUpdate | UIRadioGroupElementUpdate | UIToggleGroupElementUpdate | UIGridContainerElementUpdate | UIFlexibleSpaceElementUpdate;
|
|
10263
|
+
type UIPanelElementUpdate = UIButtonElementUpdate | UITextElementUpdate | UITextInputElementUpdate | UISelectElementUpdate | UIDividerElementUpdate | UIButtonRowElementUpdate | UICheckboxGroupElementUpdate | UIRadioGroupElementUpdate | UIToggleGroupElementUpdate | UIGridContainerElementUpdate | UIFlexibleSpaceElementUpdate | UIIframeElementUpdate;
|
|
10153
10264
|
|
|
10154
10265
|
declare const placementForUiElementSchema: z.ZodUnion<[z.ZodObject<{
|
|
10155
10266
|
after: z.ZodString;
|
|
@@ -10248,70 +10359,54 @@ declare const uiPanelSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.e
|
|
|
10248
10359
|
}, ...args: unknown[]) => void) | undefined;
|
|
10249
10360
|
}>;
|
|
10250
10361
|
/**
|
|
10251
|
-
*
|
|
10252
|
-
* It can be added to the map by using the {@link UiController.createOrUpdatePanel} method.
|
|
10253
|
-
*
|
|
10254
|
-
* A panel is a container for other UI elements.
|
|
10255
|
-
* It can have a title, a body, a footer as well as a close button.
|
|
10256
|
-
*
|
|
10257
|
-
* The body and footer are arrays of UI elements and turn into vertical stacks of elements.
|
|
10362
|
+
* A UI panel that can be added to the map using {@link UiController.createOrUpdatePanel}.
|
|
10258
10363
|
*
|
|
10259
|
-
*
|
|
10260
|
-
*
|
|
10261
|
-
* Usually, you want to call {@link UiController.deletePanel} when the close button is clicked,
|
|
10262
|
-
* e.g. `onClickClose: () => felt.deletePanel("my-panel")`.
|
|
10364
|
+
* Panels are containers for UI elements with title, body, footer, and close button.
|
|
10365
|
+
* Body and footer elements are arranged in vertical stacks.
|
|
10263
10366
|
*
|
|
10264
10367
|
* #### Body
|
|
10265
|
-
*
|
|
10266
|
-
* that it can contain a lot of elements.
|
|
10368
|
+
* Main content area that scrolls when content exceeds available space.
|
|
10267
10369
|
*
|
|
10268
10370
|
* #### Footer
|
|
10269
|
-
*
|
|
10371
|
+
* Sticky bottom section for action buttons (e.g., Save, Cancel).
|
|
10270
10372
|
*
|
|
10271
|
-
*
|
|
10272
|
-
*
|
|
10273
|
-
*
|
|
10274
|
-
* {
|
|
10275
|
-
* title: "My Panel",
|
|
10276
|
-
* body: [
|
|
10277
|
-
* { type: "Text", text: "Hello" },
|
|
10278
|
-
* ],
|
|
10279
|
-
* }
|
|
10280
|
-
* ```
|
|
10373
|
+
* #### Close Button
|
|
10374
|
+
* Optional close icon in header. When `onClickClose` is provided, you must handle
|
|
10375
|
+
* panel cleanup and removal.
|
|
10281
10376
|
*
|
|
10282
10377
|
* @example
|
|
10283
|
-
* #### closable
|
|
10284
10378
|
* ```typescript
|
|
10285
|
-
*
|
|
10286
|
-
*
|
|
10287
|
-
*
|
|
10288
|
-
*
|
|
10289
|
-
*
|
|
10290
|
-
*
|
|
10291
|
-
*
|
|
10292
|
-
*
|
|
10293
|
-
*
|
|
10294
|
-
*
|
|
10295
|
-
*
|
|
10296
|
-
*
|
|
10297
|
-
*
|
|
10298
|
-
*
|
|
10299
|
-
*
|
|
10300
|
-
*
|
|
10301
|
-
*
|
|
10302
|
-
*
|
|
10303
|
-
*
|
|
10304
|
-
*
|
|
10305
|
-
*
|
|
10306
|
-
*
|
|
10307
|
-
*
|
|
10308
|
-
*
|
|
10309
|
-
*
|
|
10310
|
-
*
|
|
10311
|
-
*
|
|
10312
|
-
*
|
|
10379
|
+
* // 1. Create panel ID
|
|
10380
|
+
* const panelId = await felt.createPanelId();
|
|
10381
|
+
*
|
|
10382
|
+
* // 2. Create panel with close button and footer
|
|
10383
|
+
* await felt.createOrUpdatePanel({
|
|
10384
|
+
* panel: {
|
|
10385
|
+
* id: panelId,
|
|
10386
|
+
* title: "My Panel",
|
|
10387
|
+
* body: [
|
|
10388
|
+
* { type: "Text", content: "Hello, world!" },
|
|
10389
|
+
* { type: "TextInput", label: "Name", placeholder: "Enter your name" }
|
|
10390
|
+
* ],
|
|
10391
|
+
* footer: [
|
|
10392
|
+
* {
|
|
10393
|
+
* type: "ButtonRow",
|
|
10394
|
+
* align: "end",
|
|
10395
|
+
* items: [
|
|
10396
|
+
* { type: "Button", label: "Cancel", onClick: () => handleCancel() },
|
|
10397
|
+
* { type: "Button", label: "Save", onClick: () => handleSave() }
|
|
10398
|
+
* ]
|
|
10399
|
+
* }
|
|
10400
|
+
* ],
|
|
10401
|
+
* onClickClose: (args) => {
|
|
10402
|
+
* // Clean up any state or resources
|
|
10403
|
+
* cleanupResources();
|
|
10404
|
+
* // Close the panel
|
|
10405
|
+
* felt.deletePanel(panelId);
|
|
10406
|
+
* }
|
|
10407
|
+
* }
|
|
10408
|
+
* });
|
|
10313
10409
|
* ```
|
|
10314
|
-
*
|
|
10315
10410
|
*/
|
|
10316
10411
|
interface UIPanel extends UIElementBase, Omit<zInfer<typeof uiPanelSchema>, "onClickClose" | "body" | "footer" | "onCreate" | "onDestroy" | "id"> {
|
|
10317
10412
|
/**
|
|
@@ -11865,6 +11960,47 @@ declare const UpdatePanelElementsParamsSchema: z.ZodObject<{
|
|
|
11865
11960
|
id: string;
|
|
11866
11961
|
}, ...args: unknown[]) => void) | undefined;
|
|
11867
11962
|
alignment?: "start" | "end" | undefined;
|
|
11963
|
+
}>, z.ZodObject<{
|
|
11964
|
+
type: z.ZodLiteral<"Iframe">;
|
|
11965
|
+
height: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>>;
|
|
11966
|
+
url: z.ZodOptional<z.ZodString>;
|
|
11967
|
+
id: z.ZodString;
|
|
11968
|
+
onCreate: z.ZodOptional<z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
|
|
11969
|
+
id: z.ZodString;
|
|
11970
|
+
}, "strip", z.ZodTypeAny, {
|
|
11971
|
+
id: string;
|
|
11972
|
+
}, {
|
|
11973
|
+
id: string;
|
|
11974
|
+
}>], z.ZodUnknown>, z.ZodVoid>>>;
|
|
11975
|
+
onDestroy: z.ZodOptional<z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
|
|
11976
|
+
id: z.ZodString;
|
|
11977
|
+
}, "strip", z.ZodTypeAny, {
|
|
11978
|
+
id: string;
|
|
11979
|
+
}, {
|
|
11980
|
+
id: string;
|
|
11981
|
+
}>], z.ZodUnknown>, z.ZodVoid>>>;
|
|
11982
|
+
}, z.UnknownKeysParam, z.ZodTypeAny, {
|
|
11983
|
+
type: "Iframe";
|
|
11984
|
+
id: string;
|
|
11985
|
+
url?: string | undefined;
|
|
11986
|
+
onCreate?: ((args_0: {
|
|
11987
|
+
id: string;
|
|
11988
|
+
}, ...args: unknown[]) => void) | undefined;
|
|
11989
|
+
onDestroy?: ((args_0: {
|
|
11990
|
+
id: string;
|
|
11991
|
+
}, ...args: unknown[]) => void) | undefined;
|
|
11992
|
+
height?: string | number | undefined;
|
|
11993
|
+
}, {
|
|
11994
|
+
type: "Iframe";
|
|
11995
|
+
id: string;
|
|
11996
|
+
url?: string | undefined;
|
|
11997
|
+
onCreate?: ((args_0: {
|
|
11998
|
+
id: string;
|
|
11999
|
+
}, ...args: unknown[]) => void) | undefined;
|
|
12000
|
+
onDestroy?: ((args_0: {
|
|
12001
|
+
id: string;
|
|
12002
|
+
}, ...args: unknown[]) => void) | undefined;
|
|
12003
|
+
height?: string | number | undefined;
|
|
11868
12004
|
}>, z.ZodObject<{
|
|
11869
12005
|
type: z.ZodLiteral<"Grid">;
|
|
11870
12006
|
id: z.ZodString;
|
|
@@ -11885,11 +12021,11 @@ declare const UpdatePanelElementsParamsSchema: z.ZodObject<{
|
|
|
11885
12021
|
grid: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
11886
12022
|
verticalAlignment: z.ZodOptional<z.ZodOptional<z.ZodEnum<["top", "center", "bottom"]>>>;
|
|
11887
12023
|
horizontalDistribution: z.ZodOptional<z.ZodOptional<z.ZodEnum<["start", "center", "end", "space-between", "space-around", "space-evenly"]>>>;
|
|
11888
|
-
items: z.ZodOptional<z.ZodType<(UIButtonElementCreate | UITextElementCreate | UIDividerElementCreate | UITextInputElementCreate | UISelectElementCreate | UIFlexibleSpaceElementCreate | UIButtonRowElementCreate | UICheckboxGroupElementCreate | UIRadioGroupElementCreate | UIToggleGroupElementCreate)[], z.ZodTypeDef, (UIButtonElementCreate | UITextElementCreate | UIDividerElementCreate | UITextInputElementCreate | UISelectElementCreate | UIFlexibleSpaceElementCreate | UIButtonRowElementCreate | UICheckboxGroupElementCreate | UIRadioGroupElementCreate | UIToggleGroupElementCreate)[]>>;
|
|
12024
|
+
items: z.ZodOptional<z.ZodType<(UIButtonElementCreate | UITextElementCreate | UIDividerElementCreate | UITextInputElementCreate | UISelectElementCreate | UIFlexibleSpaceElementCreate | UIButtonRowElementCreate | UICheckboxGroupElementCreate | UIRadioGroupElementCreate | UIToggleGroupElementCreate | UIIframeElementCreate)[], z.ZodTypeDef, (UIButtonElementCreate | UITextElementCreate | UIDividerElementCreate | UITextInputElementCreate | UISelectElementCreate | UIFlexibleSpaceElementCreate | UIButtonRowElementCreate | UICheckboxGroupElementCreate | UIRadioGroupElementCreate | UIToggleGroupElementCreate | UIIframeElementCreate)[]>>;
|
|
11889
12025
|
}, z.UnknownKeysParam, z.ZodTypeAny, {
|
|
11890
12026
|
type: "Grid";
|
|
11891
12027
|
id: string;
|
|
11892
|
-
items?: (UIButtonElementCreate | UITextElementCreate | UIDividerElementCreate | UITextInputElementCreate | UISelectElementCreate | UIFlexibleSpaceElementCreate | UIButtonRowElementCreate | UICheckboxGroupElementCreate | UIRadioGroupElementCreate | UIToggleGroupElementCreate)[] | undefined;
|
|
12028
|
+
items?: (UIButtonElementCreate | UITextElementCreate | UIDividerElementCreate | UITextInputElementCreate | UISelectElementCreate | UIFlexibleSpaceElementCreate | UIButtonRowElementCreate | UICheckboxGroupElementCreate | UIRadioGroupElementCreate | UIToggleGroupElementCreate | UIIframeElementCreate)[] | undefined;
|
|
11893
12029
|
onCreate?: ((args_0: {
|
|
11894
12030
|
id: string;
|
|
11895
12031
|
}, ...args: unknown[]) => void) | undefined;
|
|
@@ -11902,7 +12038,7 @@ declare const UpdatePanelElementsParamsSchema: z.ZodObject<{
|
|
|
11902
12038
|
}, {
|
|
11903
12039
|
type: "Grid";
|
|
11904
12040
|
id: string;
|
|
11905
|
-
items?: (UIButtonElementCreate | UITextElementCreate | UIDividerElementCreate | UITextInputElementCreate | UISelectElementCreate | UIFlexibleSpaceElementCreate | UIButtonRowElementCreate | UICheckboxGroupElementCreate | UIRadioGroupElementCreate | UIToggleGroupElementCreate)[] | undefined;
|
|
12041
|
+
items?: (UIButtonElementCreate | UITextElementCreate | UIDividerElementCreate | UITextInputElementCreate | UISelectElementCreate | UIFlexibleSpaceElementCreate | UIButtonRowElementCreate | UICheckboxGroupElementCreate | UIRadioGroupElementCreate | UIToggleGroupElementCreate | UIIframeElementCreate)[] | undefined;
|
|
11906
12042
|
onCreate?: ((args_0: {
|
|
11907
12043
|
id: string;
|
|
11908
12044
|
}, ...args: unknown[]) => void) | undefined;
|
|
@@ -12093,10 +12229,21 @@ declare const UpdatePanelElementsParamsSchema: z.ZodObject<{
|
|
|
12093
12229
|
id: string;
|
|
12094
12230
|
}, ...args: unknown[]) => void) | undefined;
|
|
12095
12231
|
alignment?: "start" | "end" | undefined;
|
|
12232
|
+
} | {
|
|
12233
|
+
type: "Iframe";
|
|
12234
|
+
id: string;
|
|
12235
|
+
url?: string | undefined;
|
|
12236
|
+
onCreate?: ((args_0: {
|
|
12237
|
+
id: string;
|
|
12238
|
+
}, ...args: unknown[]) => void) | undefined;
|
|
12239
|
+
onDestroy?: ((args_0: {
|
|
12240
|
+
id: string;
|
|
12241
|
+
}, ...args: unknown[]) => void) | undefined;
|
|
12242
|
+
height?: string | number | undefined;
|
|
12096
12243
|
} | {
|
|
12097
12244
|
type: "Grid";
|
|
12098
12245
|
id: string;
|
|
12099
|
-
items?: (UIButtonElementCreate | UITextElementCreate | UIDividerElementCreate | UITextInputElementCreate | UISelectElementCreate | UIFlexibleSpaceElementCreate | UIButtonRowElementCreate | UICheckboxGroupElementCreate | UIRadioGroupElementCreate | UIToggleGroupElementCreate)[] | undefined;
|
|
12246
|
+
items?: (UIButtonElementCreate | UITextElementCreate | UIDividerElementCreate | UITextInputElementCreate | UISelectElementCreate | UIFlexibleSpaceElementCreate | UIButtonRowElementCreate | UICheckboxGroupElementCreate | UIRadioGroupElementCreate | UIToggleGroupElementCreate | UIIframeElementCreate)[] | undefined;
|
|
12100
12247
|
onCreate?: ((args_0: {
|
|
12101
12248
|
id: string;
|
|
12102
12249
|
}, ...args: unknown[]) => void) | undefined;
|
|
@@ -12287,10 +12434,21 @@ declare const UpdatePanelElementsParamsSchema: z.ZodObject<{
|
|
|
12287
12434
|
id: string;
|
|
12288
12435
|
}, ...args: unknown[]) => void) | undefined;
|
|
12289
12436
|
alignment?: "start" | "end" | undefined;
|
|
12437
|
+
} | {
|
|
12438
|
+
type: "Iframe";
|
|
12439
|
+
id: string;
|
|
12440
|
+
url?: string | undefined;
|
|
12441
|
+
onCreate?: ((args_0: {
|
|
12442
|
+
id: string;
|
|
12443
|
+
}, ...args: unknown[]) => void) | undefined;
|
|
12444
|
+
onDestroy?: ((args_0: {
|
|
12445
|
+
id: string;
|
|
12446
|
+
}, ...args: unknown[]) => void) | undefined;
|
|
12447
|
+
height?: string | number | undefined;
|
|
12290
12448
|
} | {
|
|
12291
12449
|
type: "Grid";
|
|
12292
12450
|
id: string;
|
|
12293
|
-
items?: (UIButtonElementCreate | UITextElementCreate | UIDividerElementCreate | UITextInputElementCreate | UISelectElementCreate | UIFlexibleSpaceElementCreate | UIButtonRowElementCreate | UICheckboxGroupElementCreate | UIRadioGroupElementCreate | UIToggleGroupElementCreate)[] | undefined;
|
|
12451
|
+
items?: (UIButtonElementCreate | UITextElementCreate | UIDividerElementCreate | UITextInputElementCreate | UISelectElementCreate | UIFlexibleSpaceElementCreate | UIButtonRowElementCreate | UICheckboxGroupElementCreate | UIRadioGroupElementCreate | UIToggleGroupElementCreate | UIIframeElementCreate)[] | undefined;
|
|
12294
12452
|
onCreate?: ((args_0: {
|
|
12295
12453
|
id: string;
|
|
12296
12454
|
}, ...args: unknown[]) => void) | undefined;
|
|
@@ -12484,10 +12642,21 @@ declare const UpdatePanelElementsParamsSchema: z.ZodObject<{
|
|
|
12484
12642
|
id: string;
|
|
12485
12643
|
}, ...args: unknown[]) => void) | undefined;
|
|
12486
12644
|
alignment?: "start" | "end" | undefined;
|
|
12645
|
+
} | {
|
|
12646
|
+
type: "Iframe";
|
|
12647
|
+
id: string;
|
|
12648
|
+
url?: string | undefined;
|
|
12649
|
+
onCreate?: ((args_0: {
|
|
12650
|
+
id: string;
|
|
12651
|
+
}, ...args: unknown[]) => void) | undefined;
|
|
12652
|
+
onDestroy?: ((args_0: {
|
|
12653
|
+
id: string;
|
|
12654
|
+
}, ...args: unknown[]) => void) | undefined;
|
|
12655
|
+
height?: string | number | undefined;
|
|
12487
12656
|
} | {
|
|
12488
12657
|
type: "Grid";
|
|
12489
12658
|
id: string;
|
|
12490
|
-
items?: (UIButtonElementCreate | UITextElementCreate | UIDividerElementCreate | UITextInputElementCreate | UISelectElementCreate | UIFlexibleSpaceElementCreate | UIButtonRowElementCreate | UICheckboxGroupElementCreate | UIRadioGroupElementCreate | UIToggleGroupElementCreate)[] | undefined;
|
|
12659
|
+
items?: (UIButtonElementCreate | UITextElementCreate | UIDividerElementCreate | UITextInputElementCreate | UISelectElementCreate | UIFlexibleSpaceElementCreate | UIButtonRowElementCreate | UICheckboxGroupElementCreate | UIRadioGroupElementCreate | UIToggleGroupElementCreate | UIIframeElementCreate)[] | undefined;
|
|
12491
12660
|
onCreate?: ((args_0: {
|
|
12492
12661
|
id: string;
|
|
12493
12662
|
}, ...args: unknown[]) => void) | undefined;
|
|
@@ -12681,10 +12850,21 @@ declare const UpdatePanelElementsParamsSchema: z.ZodObject<{
|
|
|
12681
12850
|
id: string;
|
|
12682
12851
|
}, ...args: unknown[]) => void) | undefined;
|
|
12683
12852
|
alignment?: "start" | "end" | undefined;
|
|
12853
|
+
} | {
|
|
12854
|
+
type: "Iframe";
|
|
12855
|
+
id: string;
|
|
12856
|
+
url?: string | undefined;
|
|
12857
|
+
onCreate?: ((args_0: {
|
|
12858
|
+
id: string;
|
|
12859
|
+
}, ...args: unknown[]) => void) | undefined;
|
|
12860
|
+
onDestroy?: ((args_0: {
|
|
12861
|
+
id: string;
|
|
12862
|
+
}, ...args: unknown[]) => void) | undefined;
|
|
12863
|
+
height?: string | number | undefined;
|
|
12684
12864
|
} | {
|
|
12685
12865
|
type: "Grid";
|
|
12686
12866
|
id: string;
|
|
12687
|
-
items?: (UIButtonElementCreate | UITextElementCreate | UIDividerElementCreate | UITextInputElementCreate | UISelectElementCreate | UIFlexibleSpaceElementCreate | UIButtonRowElementCreate | UICheckboxGroupElementCreate | UIRadioGroupElementCreate | UIToggleGroupElementCreate)[] | undefined;
|
|
12867
|
+
items?: (UIButtonElementCreate | UITextElementCreate | UIDividerElementCreate | UITextInputElementCreate | UISelectElementCreate | UIFlexibleSpaceElementCreate | UIButtonRowElementCreate | UICheckboxGroupElementCreate | UIRadioGroupElementCreate | UIToggleGroupElementCreate | UIIframeElementCreate)[] | undefined;
|
|
12688
12868
|
onCreate?: ((args_0: {
|
|
12689
12869
|
id: string;
|
|
12690
12870
|
}, ...args: unknown[]) => void) | undefined;
|
|
@@ -12895,10 +13075,10 @@ interface UiController {
|
|
|
12895
13075
|
* ```typescript
|
|
12896
13076
|
* await felt.createActionTrigger({
|
|
12897
13077
|
* actionTrigger: {
|
|
12898
|
-
* id: "
|
|
12899
|
-
* label: "
|
|
13078
|
+
* id: "enablePolygonTool", // optional. Required if you want to update the action trigger later
|
|
13079
|
+
* label: "Draw polygon",
|
|
12900
13080
|
* onTrigger: async () => {
|
|
12901
|
-
*
|
|
13081
|
+
* felt.setTool("polygon");
|
|
12902
13082
|
* },
|
|
12903
13083
|
* disabled: false, // optional, defaults to false
|
|
12904
13084
|
* },
|
|
@@ -12920,8 +13100,8 @@ interface UiController {
|
|
|
12920
13100
|
* @example
|
|
12921
13101
|
* ```typescript
|
|
12922
13102
|
* await felt.updateActionTrigger({
|
|
12923
|
-
* id: "
|
|
12924
|
-
* label: "
|
|
13103
|
+
* id: "enablePolygonTool",
|
|
13104
|
+
* label: "Enable polygon tool", // only label changes
|
|
12925
13105
|
* });
|
|
12926
13106
|
* ```
|
|
12927
13107
|
*/
|
|
@@ -12933,7 +13113,7 @@ interface UiController {
|
|
|
12933
13113
|
*
|
|
12934
13114
|
* @example
|
|
12935
13115
|
* ```typescript
|
|
12936
|
-
* await felt.deleteActionTrigger("
|
|
13116
|
+
* await felt.deleteActionTrigger("enablePolygonTool");
|
|
12937
13117
|
* ```
|
|
12938
13118
|
*/
|
|
12939
13119
|
deleteActionTrigger(id: string): void;
|
|
@@ -12951,66 +13131,72 @@ interface UiController {
|
|
|
12951
13131
|
/**
|
|
12952
13132
|
* Creates or updates a panel.
|
|
12953
13133
|
*
|
|
12954
|
-
* Panels are rendered on map's right sidebar and
|
|
12955
|
-
*
|
|
12956
|
-
* This way it is possible to cover new use cases while keeping the user experience consistent with the rest of Felt.
|
|
13134
|
+
* Panels are rendered on the map's right sidebar and allow you to extend Felt UI
|
|
13135
|
+
* for your own use cases using Felt UI elements (e.g., Text, Button, etc.).
|
|
12957
13136
|
*
|
|
12958
|
-
* A panel is identified by its ID
|
|
12959
|
-
* Custom IDs are not supported
|
|
13137
|
+
* A panel is identified by its ID, which must be created using {@link createPanelId}.
|
|
13138
|
+
* Custom IDs are not supported to prevent conflicts with other panels.
|
|
12960
13139
|
*
|
|
12961
|
-
* Panels have two sections:
|
|
12962
|
-
* - `body` -
|
|
12963
|
-
* - `footer` -
|
|
13140
|
+
* Panels have two main sections:
|
|
13141
|
+
* - `body` - The main content area of the panel, which is scrollable.
|
|
13142
|
+
* - `footer` - A section that sticks to the bottom of the panel, useful for
|
|
13143
|
+
* action buttons like "Submit" or "Cancel".
|
|
12964
13144
|
*
|
|
12965
|
-
*
|
|
12966
|
-
*
|
|
12967
|
-
*
|
|
13145
|
+
* Panel placement is controlled by the `initialPlacement` parameter. By default,
|
|
13146
|
+
* panels are added to the end of the panel stack, but you can specify a different
|
|
13147
|
+
* placement. Note that this placement cannot be changed after the panel is created.
|
|
12968
13148
|
*
|
|
12969
|
-
*
|
|
12970
|
-
*
|
|
13149
|
+
* Element IDs are required for targeted updates and deletions using the other
|
|
13150
|
+
* panel management methods. For complete panel refreshes with this method,
|
|
13151
|
+
* element IDs are optional but recommended for consistency.
|
|
12971
13152
|
*
|
|
12972
|
-
*
|
|
12973
|
-
*
|
|
12974
|
-
*
|
|
13153
|
+
* For dynamic content management, consider these approaches:
|
|
13154
|
+
* - Use this method for complete panel refreshes (replaces all content)
|
|
13155
|
+
* - Use {@link createPanelElements} to add new elements to existing panels
|
|
13156
|
+
* - Use {@link updatePanelElements} to modify specific existing elements
|
|
13157
|
+
* - Use {@link deletePanelElements} to remove specific elements
|
|
12975
13158
|
*
|
|
12976
|
-
* @param args - The arguments for the
|
|
12977
|
-
* @param args.panel - The panel to
|
|
12978
|
-
* @param args.initialPlacement - The placement of the panel when added.
|
|
12979
|
-
*
|
|
12980
|
-
*
|
|
12981
|
-
*
|
|
12982
|
-
*
|
|
13159
|
+
* @param args - The arguments for creating or updating the panel.
|
|
13160
|
+
* @param args.panel - The panel configuration to create or update.
|
|
13161
|
+
* @param args.initialPlacement - The placement of the panel when first added.
|
|
13162
|
+
* Optional. Defaults to `{ at: "end" }`.
|
|
13163
|
+
* - `{ at: "start" }` - Add the panel to the start of the stack.
|
|
13164
|
+
* - `{ at: "end" }` - Add the panel to the end of the stack.
|
|
13165
|
+
* - `{ after: "panel-1" }` - Add the panel after the panel with the id `panel-1`.
|
|
13166
|
+
* - `{ before: "panel-1" }` - Add the panel before the panel with the id `panel-1`.
|
|
12983
13167
|
*
|
|
12984
13168
|
* @example
|
|
12985
13169
|
* ```typescript
|
|
12986
|
-
*
|
|
13170
|
+
* // 1. Create panel ID first (required)
|
|
13171
|
+
* const panelId = await felt.createPanelId();
|
|
13172
|
+
*
|
|
13173
|
+
* // 2. Define reusable elements
|
|
13174
|
+
* const SELECT = { id: "layer-select", type: "Select", label: "Layer", options: [...] };
|
|
13175
|
+
* const ANALYZE_BTN = { id: "analyze-btn", type: "Button", label: "Analyze", onClick: handleAnalyze };
|
|
13176
|
+
* const STATUS_TEXT = { id: "status-text", type: "Text", content: "" };
|
|
13177
|
+
* const CLEAR_BTN = { id: "clear-btn", type: "Button", label: "Clear", onClick: handleClear };
|
|
12987
13178
|
*
|
|
13179
|
+
* // 3. Initial state
|
|
12988
13180
|
* await felt.createOrUpdatePanel({
|
|
12989
|
-
*
|
|
12990
|
-
*
|
|
12991
|
-
*
|
|
12992
|
-
*
|
|
12993
|
-
*
|
|
12994
|
-
*
|
|
12995
|
-
*
|
|
12996
|
-
*
|
|
12997
|
-
*
|
|
12998
|
-
*
|
|
12999
|
-
*
|
|
13000
|
-
*
|
|
13001
|
-
*
|
|
13002
|
-
*
|
|
13003
|
-
*
|
|
13004
|
-
*
|
|
13005
|
-
*
|
|
13006
|
-
*
|
|
13007
|
-
*
|
|
13008
|
-
* label: "Submit",
|
|
13009
|
-
* onClick: () => submitForm(),
|
|
13010
|
-
* },
|
|
13011
|
-
* ],
|
|
13012
|
-
* },
|
|
13013
|
-
* initialPlacement: { at: "start" }, // when added, the panel will be added to the start of the stack
|
|
13181
|
+
* panel: { id: panelId, title: "Data Analyzer", body: [SELECT, ANALYZE_BTN] }
|
|
13182
|
+
* });
|
|
13183
|
+
*
|
|
13184
|
+
* // 4. Loading state (replaces entire panel)
|
|
13185
|
+
* await felt.createOrUpdatePanel({
|
|
13186
|
+
* panel: {
|
|
13187
|
+
* id: panelId,
|
|
13188
|
+
* title: "Data Analyzer",
|
|
13189
|
+
* body: [SELECT, ANALYZE_BTN, { ...STATUS_TEXT, content: "Loading..." }]
|
|
13190
|
+
* }
|
|
13191
|
+
* });
|
|
13192
|
+
*
|
|
13193
|
+
* // 5. Results state (replaces entire panel)
|
|
13194
|
+
* await felt.createOrUpdatePanel({
|
|
13195
|
+
* panel: {
|
|
13196
|
+
* id: panelId,
|
|
13197
|
+
* title: "Data Analyzer",
|
|
13198
|
+
* body: [SELECT, ANALYZE_BTN, { ...STATUS_TEXT, content: "**Results:**\n- Found 150 features" }, CLEAR_BTN]
|
|
13199
|
+
* }
|
|
13014
13200
|
* });
|
|
13015
13201
|
* ```
|
|
13016
13202
|
*/
|
|
@@ -13063,22 +13249,36 @@ interface UiController {
|
|
|
13063
13249
|
*/
|
|
13064
13250
|
createPanelElements(args: CreatePanelElementsParams): Promise<UIPanel>;
|
|
13065
13251
|
/**
|
|
13066
|
-
* Updates an element in a panel.
|
|
13252
|
+
* Updates an existing element in a panel. This method can only update elements that
|
|
13253
|
+
* already exist in the panel and have an ID.
|
|
13067
13254
|
*
|
|
13068
13255
|
* @param args - The arguments for the method.
|
|
13069
13256
|
* @param args.panelId - The id of the panel to update the element in.
|
|
13070
|
-
* @param args.elements - Array of elements to update
|
|
13257
|
+
* @param args.elements - Array of elements to update. Each element must have an `id` and `type`
|
|
13258
|
+
* to identify which existing element to update. The element must already exist in the panel.
|
|
13071
13259
|
*
|
|
13072
13260
|
* @example
|
|
13073
13261
|
* ```typescript
|
|
13262
|
+
* // 1. Create panel with initial elements
|
|
13263
|
+
* const panelId = await felt.createPanelId();
|
|
13264
|
+
* const STATUS_TEXT = { id: "status-text", type: "Text", content: "Ready" };
|
|
13265
|
+
*
|
|
13266
|
+
* await felt.createOrUpdatePanel({
|
|
13267
|
+
* panel: {
|
|
13268
|
+
* id: panelId,
|
|
13269
|
+
* title: "My Panel",
|
|
13270
|
+
* body: [STATUS_TEXT]
|
|
13271
|
+
* }
|
|
13272
|
+
* });
|
|
13273
|
+
*
|
|
13274
|
+
* // 2. Update the existing element
|
|
13074
13275
|
* await felt.updatePanelElements({
|
|
13075
13276
|
* panelId,
|
|
13076
13277
|
* elements: [
|
|
13077
13278
|
* {
|
|
13078
13279
|
* element: {
|
|
13079
|
-
*
|
|
13080
|
-
*
|
|
13081
|
-
* content: "Hello, world!",
|
|
13280
|
+
* ...STATUS_TEXT, // Reuse the same element structure
|
|
13281
|
+
* content: "Updated content" // Only change what needs updating
|
|
13082
13282
|
* },
|
|
13083
13283
|
* },
|
|
13084
13284
|
* ],
|
|
@@ -13519,4 +13719,4 @@ interface FeltController extends ViewportController, UiController, LayersControl
|
|
|
13519
13719
|
iframe: HTMLIFrameElement | null;
|
|
13520
13720
|
}
|
|
13521
13721
|
|
|
13522
|
-
export { type LayerChangeCallbackParams as $, type TextElementUpdate as A, type ElementsController as B, type CircleElementCreate as C, type MapInteractionEvent as D, type Element as E, type FeltController as F, type GetElementGroupsConstraint as G, type HighlighterElementCreate as H, type ImageElementCreate as I, type InteractionsController as J, type CreateLayersFromGeoJsonParams as K, type LinkElementRead as L, type MarkerElementCreate as M, type NoteElementCreate as N, type DataOnlyLayer as O, type PathElementCreate as P, type FeltTiledVectorSource as Q, type GeoJsonDataVectorSource as R, type GeoJsonFileVectorSource as S, type TextElementCreate as T, type UiControlsOptions as U, type ViewportCenterZoom as V, type GeoJsonUrlVectorSource as W, type GetLayerGroupsConstraint as X, type GetLayersConstraint as Y, type GetRenderedFeaturesConstraint as Z, type Layer as _, type CircleElementRead as a, type LngLatTuple as a$, type LayerCommon as a0, type LayerGroup as a1, type LayerGroupChangeCallbackParams as a2, type LayerProcessingStatus as a3, type LegendItem as a4, type LegendItemChangeCallbackParams as a5, type LegendItemIdentifier as a6, type LegendItemsConstraint as a7, type RasterBand as a8, type RasterLayer as a9, type GetLayerCategoriesParams as aA, type GetLayerHistogramBin as aB, type GetLayerHistogramParams as aC, type GetLayerPrecomputedCalculationParams as aD, type GridConfig as aE, type GridType as aF, type MultiAggregationConfig as aG, type PrecomputedAggregationMethod as aH, type ValueConfiguration as aI, type LayersController as aJ, type MapDetails as aK, type MiscController as aL, type ElementGroupNode as aM, type ElementNode as aN, type EntityNode as aO, type FeatureNode as aP, type FeatureSelection as aQ, type LayerGroupNode as aR, type LayerNode as aS, type SelectionController as aT, type FeltBoundary as aU, type FeltZoom as aV, type GeoJsonFeature as aW, type GeoJsonGeometry as aX, type GeoJsonProperties as aY, type LatLng as aZ, type LineStringGeometry as a_, type RasterLayerSource as aa, type UpdateLayerParams as ab, type VectorLayer as ac, type LayerFeature as ad, type RasterValue as ae, type LayerSchema as af, type LayerSchemaAttribute as ag, type LayerSchemaBooleanAttribute as ah, type LayerSchemaCommonAttribute as ai, type LayerSchemaDateAttribute as aj, type LayerSchemaDateTimeAttribute as ak, type LayerSchemaNumericAttribute as al, type LayerSchemaTextAttribute as am, type FilterExpression as an, type FilterLogicGate as ao, type FilterTernary as ap, type Filters as aq, type GeometryFilter as ar, type LayerBoundaries as as, type LayerFilters as at, type AggregatedGridConfig as au, type AggregationConfig as av, type AggregationMethod as aw, type CountGridConfig as ax, type GetLayerCalculationParams as ay, type GetLayerCategoriesGroup as az, type CircleElementUpdate as b, type UICheckboxGroupElementCreate as b$, type MultiLineStringGeometry as b0, type MultiPointGeometry as b1, type MultiPolygonGeometry as b2, type PointGeometry as b3, type PolygonGeometry as b4, type SetVisibilityRequest as b5, type SortConfig as b6, type SortDirection as b7, type CircleToolSettings as b8, type ConfigurableToolType as b9, type UIButtonElementCreate as bA, type UIButtonElementUpdate as bB, type UITextElement as bC, type UITextElementCreate as bD, type UITextElementUpdate as bE, type UIFlexibleSpaceElement as bF, type UIFlexibleSpaceElementCreate as bG, type UIFlexibleSpaceElementUpdate as bH, type UIDividerElement as bI, type UIDividerElementCreate as bJ, type UIDividerElementUpdate as bK, type UITextInputElement as bL, type UITextInputElementCreate as bM, type UITextInputElementUpdate as bN, type UISelectElement as bO, type UISelectElementCreate as bP, type UISelectElementUpdate as bQ, type UIPanelElement as bR, type UIPanelElementCreate as bS, type UIPanelElementUpdate as bT, type UIGridContainerElement as bU, type UIGridContainerElementCreate as bV, type UIGridContainerElementUpdate as bW, type UIButtonRowElement as bX, type UIButtonRowElementCreate as bY, type UIButtonRowElementUpdate as bZ, type UICheckboxGroupElement as b_, type HighlighterToolSettings as ba, type InputToolSettings as bb, type LineToolSettings as bc, type MarkerToolSettings as bd, type NoteToolSettings as be, type PinToolSettings as bf, type PlaceFrame as bg, type PlaceSymbol as bh, type PolygonToolSettings as bi, type RouteToolSettings as bj, type TextToolSettings as bk, type ToolSettingsChangeEvent as bl, type ToolSettingsMap as bm, type ToolType as bn, type ToolsController as bo, type CreateActionTriggerParams as bp, type CreateOrUpdatePanelParams as bq, type CreatePanelElementsParams as br, type DeletePanelElementsParams as bs, type UiOnMapInteractionsOptions as bt, type UpdateActionTriggerParams as bu, type UpdatePanelElementsParams as bv, type PlacementForUIElement as bw, type UIPanel as bx, type UIPanelCreateOrUpdate as by, type UIButtonElement as bz, type ElementChangeCallbackParams as c, type UICheckboxGroupElementUpdate as c0, type UIRadioGroupElement as c1, type UIRadioGroupElementCreate as c2, type UIRadioGroupElementUpdate as c3, type UIToggleGroupElement as c4, type UIToggleGroupElementCreate as c5, type UIToggleGroupElementUpdate as c6, type
|
|
13722
|
+
export { type LayerChangeCallbackParams as $, type TextElementUpdate as A, type ElementsController as B, type CircleElementCreate as C, type MapInteractionEvent as D, type Element as E, type FeltController as F, type GetElementGroupsConstraint as G, type HighlighterElementCreate as H, type ImageElementCreate as I, type InteractionsController as J, type CreateLayersFromGeoJsonParams as K, type LinkElementRead as L, type MarkerElementCreate as M, type NoteElementCreate as N, type DataOnlyLayer as O, type PathElementCreate as P, type FeltTiledVectorSource as Q, type GeoJsonDataVectorSource as R, type GeoJsonFileVectorSource as S, type TextElementCreate as T, type UiControlsOptions as U, type ViewportCenterZoom as V, type GeoJsonUrlVectorSource as W, type GetLayerGroupsConstraint as X, type GetLayersConstraint as Y, type GetRenderedFeaturesConstraint as Z, type Layer as _, type CircleElementRead as a, type LngLatTuple as a$, type LayerCommon as a0, type LayerGroup as a1, type LayerGroupChangeCallbackParams as a2, type LayerProcessingStatus as a3, type LegendItem as a4, type LegendItemChangeCallbackParams as a5, type LegendItemIdentifier as a6, type LegendItemsConstraint as a7, type RasterBand as a8, type RasterLayer as a9, type GetLayerCategoriesParams as aA, type GetLayerHistogramBin as aB, type GetLayerHistogramParams as aC, type GetLayerPrecomputedCalculationParams as aD, type GridConfig as aE, type GridType as aF, type MultiAggregationConfig as aG, type PrecomputedAggregationMethod as aH, type ValueConfiguration as aI, type LayersController as aJ, type MapDetails as aK, type MiscController as aL, type ElementGroupNode as aM, type ElementNode as aN, type EntityNode as aO, type FeatureNode as aP, type FeatureSelection as aQ, type LayerGroupNode as aR, type LayerNode as aS, type SelectionController as aT, type FeltBoundary as aU, type FeltZoom as aV, type GeoJsonFeature as aW, type GeoJsonGeometry as aX, type GeoJsonProperties as aY, type LatLng as aZ, type LineStringGeometry as a_, type RasterLayerSource as aa, type UpdateLayerParams as ab, type VectorLayer as ac, type LayerFeature as ad, type RasterValue as ae, type LayerSchema as af, type LayerSchemaAttribute as ag, type LayerSchemaBooleanAttribute as ah, type LayerSchemaCommonAttribute as ai, type LayerSchemaDateAttribute as aj, type LayerSchemaDateTimeAttribute as ak, type LayerSchemaNumericAttribute as al, type LayerSchemaTextAttribute as am, type FilterExpression as an, type FilterLogicGate as ao, type FilterTernary as ap, type Filters as aq, type GeometryFilter as ar, type LayerBoundaries as as, type LayerFilters as at, type AggregatedGridConfig as au, type AggregationConfig as av, type AggregationMethod as aw, type CountGridConfig as ax, type GetLayerCalculationParams as ay, type GetLayerCategoriesGroup as az, type CircleElementUpdate as b, type UICheckboxGroupElementCreate as b$, type MultiLineStringGeometry as b0, type MultiPointGeometry as b1, type MultiPolygonGeometry as b2, type PointGeometry as b3, type PolygonGeometry as b4, type SetVisibilityRequest as b5, type SortConfig as b6, type SortDirection as b7, type CircleToolSettings as b8, type ConfigurableToolType as b9, type UIButtonElementCreate as bA, type UIButtonElementUpdate as bB, type UITextElement as bC, type UITextElementCreate as bD, type UITextElementUpdate as bE, type UIFlexibleSpaceElement as bF, type UIFlexibleSpaceElementCreate as bG, type UIFlexibleSpaceElementUpdate as bH, type UIDividerElement as bI, type UIDividerElementCreate as bJ, type UIDividerElementUpdate as bK, type UITextInputElement as bL, type UITextInputElementCreate as bM, type UITextInputElementUpdate as bN, type UISelectElement as bO, type UISelectElementCreate as bP, type UISelectElementUpdate as bQ, type UIPanelElement as bR, type UIPanelElementCreate as bS, type UIPanelElementUpdate as bT, type UIGridContainerElement as bU, type UIGridContainerElementCreate as bV, type UIGridContainerElementUpdate as bW, type UIButtonRowElement as bX, type UIButtonRowElementCreate as bY, type UIButtonRowElementUpdate as bZ, type UICheckboxGroupElement as b_, type HighlighterToolSettings as ba, type InputToolSettings as bb, type LineToolSettings as bc, type MarkerToolSettings as bd, type NoteToolSettings as be, type PinToolSettings as bf, type PlaceFrame as bg, type PlaceSymbol as bh, type PolygonToolSettings as bi, type RouteToolSettings as bj, type TextToolSettings as bk, type ToolSettingsChangeEvent as bl, type ToolSettingsMap as bm, type ToolType as bn, type ToolsController as bo, type CreateActionTriggerParams as bp, type CreateOrUpdatePanelParams as bq, type CreatePanelElementsParams as br, type DeletePanelElementsParams as bs, type UiOnMapInteractionsOptions as bt, type UpdateActionTriggerParams as bu, type UpdatePanelElementsParams as bv, type PlacementForUIElement as bw, type UIPanel as bx, type UIPanelCreateOrUpdate as by, type UIButtonElement as bz, type ElementChangeCallbackParams as c, type UICheckboxGroupElementUpdate as c0, type UIRadioGroupElement as c1, type UIRadioGroupElementCreate as c2, type UIRadioGroupElementUpdate as c3, type UIToggleGroupElement as c4, type UIToggleGroupElementCreate as c5, type UIToggleGroupElementUpdate as c6, type UIIframeElement as c7, type UIIframeElementCreate as c8, type UIIframeElementUpdate as c9, type UIControlElementOption as ca, type UIActionTriggerCreate as cb, type UiController as cc, type SetViewportCenterZoomParams as cd, type ViewportConstraints as ce, type ViewportFitBoundsParams as cf, type ViewportState as cg, type ViewportController as ch, type UnwrapPromise as ci, uiActionTriggerSchema as cj, type UIPanelElementCreateClonable as ck, uiPanelCreateSchema as cl, type UIButtonElementCreateClonable as cm, type MakeClonableSchema as cn, type UIButtonRowElementCreateClonable as co, type PromiseOrNot as cp, type UnionToIntersection as cq, type ElementCreate as d, type ElementGroup as e, type ElementGroupChangeCallbackParams as f, type ElementUpdate as g, type GetElementsConstraint as h, type HighlighterElementRead as i, type HighlighterElementUpdate as j, type ImageElementRead as k, type ImageElementUpdate as l, type MarkerElementRead as m, type MarkerElementUpdate as n, type NoteElementRead as o, type NoteElementUpdate as p, type PathElementRead as q, type PathElementUpdate as r, type PlaceElementCreate as s, type PlaceElementRead as t, type PlaceElementUpdate as u, type PolygonElementCreate as v, type PolygonElementRead as w, type PolygonElementUpdate as x, type TextElementRead as y, type zInfer as z };
|