@streamline-pulse/formkrafter-wc 0.25.0 → 0.27.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.
Files changed (68) hide show
  1. package/dist/components/fk-address-search.d.ts +11 -0
  2. package/dist/components/fk-address-search.js +1 -0
  3. package/dist/components/fk-brick-actions.js +1 -1
  4. package/dist/components/fk-brick-list.js +1 -1
  5. package/dist/components/fk-brick-mold-item.js +1 -1
  6. package/dist/components/fk-brick-not-found.js +1 -1
  7. package/dist/components/fk-brick-render.js +1 -1
  8. package/dist/components/fk-code-editor.js +1 -1
  9. package/dist/components/fk-data-grid.js +1 -1
  10. package/dist/components/fk-drop-area.js +1 -1
  11. package/dist/components/fk-empty-form.js +1 -1
  12. package/dist/components/fk-file-input.js +1 -1
  13. package/dist/components/fk-form-builder.js +1 -1
  14. package/dist/components/fk-form-render.js +1 -1
  15. package/dist/components/fk-form-review.js +1 -1
  16. package/dist/components/fk-geo-map.d.ts +11 -0
  17. package/dist/components/fk-geo-map.js +1 -0
  18. package/dist/components/fk-property-panel.js +1 -1
  19. package/dist/components/fk-rules-editor.js +1 -1
  20. package/dist/components/fk-select-input.js +1 -1
  21. package/dist/components/fk-signature-input.js +1 -1
  22. package/dist/components/fk-stepper.js +1 -1
  23. package/dist/components/fk-tabs.js +1 -1
  24. package/dist/components/fk-variable-picker.js +1 -1
  25. package/dist/components/index.js +1 -1
  26. package/dist/components/{p-C6emCV3T.js → p-4J6WHge8.js} +1 -1
  27. package/dist/components/{p-BemdqIL_.js → p-6IFMAlaM.js} +1 -1
  28. package/dist/components/p-8ICOcloT.js +1 -0
  29. package/dist/components/{p-CYfQK2Pw.js → p-AxQWXLy8.js} +1 -1
  30. package/dist/components/{p-CIGtlYQn.js → p-BE5v8BN3.js} +1 -1
  31. package/dist/components/{p-Bq81YnKC.js → p-BJPNcA2I.js} +1 -1
  32. package/dist/components/p-BdV2F17R.js +1 -0
  33. package/dist/components/{p-Cha7IcHb.js → p-CJAIx_lh.js} +1 -1
  34. package/dist/components/{p-B-50T6sz.js → p-CV5yMN-W.js} +5 -5
  35. package/dist/components/p-CY-uaS2y.js +1 -0
  36. package/dist/components/{p-BUAEhrDQ.js → p-Ck8lu3cO.js} +1 -1
  37. package/dist/components/p-D23KNvvF.js +1 -0
  38. package/dist/components/{p-WL4Z1HBm.js → p-DLWd_wkA.js} +1 -1
  39. package/dist/components/p-DMLnAgzb.js +1 -0
  40. package/dist/components/{p-CAMQHIiV.js → p-DSArI0Qr.js} +1 -1
  41. package/dist/components/p-Deomtk7O.js +5 -0
  42. package/dist/components/{p-Bdaaog9G.js → p-DoRivFlV.js} +1 -1
  43. package/dist/components/{p-BJMoesgM.js → p-Dwz_AerL.js} +1 -1
  44. package/dist/components/{p-BoUU2NWO.js → p-N4ocWM74.js} +1 -1
  45. package/dist/components/{p-jI4tn-a2.js → p-QhU0FQmA.js} +1 -1
  46. package/dist/components/{p-CTo62I8g.js → p-xwwy55X1.js} +1 -1
  47. package/dist/components/p-yZ54sN-p.js +1 -0
  48. package/dist/formkrafter-wc/formkrafter-wc.css +1 -1
  49. package/dist/formkrafter-wc/formkrafter-wc.esm.js +1 -1
  50. package/dist/formkrafter-wc/index.esm.js +1 -1
  51. package/dist/formkrafter-wc/p--7ABNliQ.js +5 -0
  52. package/dist/formkrafter-wc/{p-87fcea14.entry.js → p-1f9e4187.entry.js} +1 -1
  53. package/dist/formkrafter-wc/p-36f8ef99.entry.js +1 -0
  54. package/dist/formkrafter-wc/p-BDqOS1za.js +2 -0
  55. package/dist/formkrafter-wc/{p-CR0WTblB.js → p-DoSYU_vL.js} +5 -5
  56. package/dist/formkrafter-wc/p-f7ffd2a4.entry.js +1 -0
  57. package/dist/types/components/fk-address-search/fk-address-search.d.ts +57 -0
  58. package/dist/types/components/fk-geo-map/fk-geo-map.d.ts +93 -0
  59. package/dist/types/components.d.ts +304 -0
  60. package/dist/types/registry/default-bricks.d.ts +162 -0
  61. package/package.json +4 -2
  62. package/dist/components/p-B29HakDD.js +0 -1
  63. package/dist/components/p-BTxz9ZnS.js +0 -1
  64. package/dist/components/p-D9ZgC9I3.js +0 -1
  65. package/dist/components/p-DC8hPiiS.js +0 -1
  66. package/dist/formkrafter-wc/p-C7Z9P9uL.js +0 -2
  67. package/dist/formkrafter-wc/p-a4cf0527.entry.js +0 -1
  68. package/dist/formkrafter-wc/p-d8688a2e.entry.js +0 -1
@@ -0,0 +1 @@
1
+ import{r as e,h as t,H as r}from"./p-BDqOS1za.js";import{a as f}from"./p-DoSYU_vL.js";const a=class{constructor(t){e(this,t)}render(){return t(r,{key:"b90ba0b48a5b965c2d1e0f16732ef0664e370796"},t("div",{key:"c9858e4f28be65f58e5f02b86a2ae7b3c1e74b4c",class:"fk-empty"},t("p",{key:"625eae4fd358f64f729bd9c066f6ae8780fa4cb2",class:"fk-empty__title"},f("empty.title")),t("p",{key:"6b60a6f830e9938df4600209b3a5700a3bb7728c",class:"fk-empty__hint"},f("empty.hint"))))}};a.style=".fk-empty.sc-fk-empty-form{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:calc(var(--fk-spacing) / 2);min-height:160px;border:2px dashed var(--fk-color-border);border-radius:var(--fk-radius);color:var(--fk-color-muted);text-align:center}.fk-empty__title.sc-fk-empty-form{margin:0;font-weight:600}.fk-empty__hint.sc-fk-empty-form{margin:0;font-size:0.875rem}";export{a as fk_empty_form}
@@ -0,0 +1,57 @@
1
+ import type { EventEmitter } from '../../stencil-public-runtime';
2
+ export interface AddressProperties {
3
+ label: string;
4
+ street?: string;
5
+ city?: string;
6
+ postcode?: string;
7
+ country?: string;
8
+ countryCode?: string;
9
+ placeId?: string;
10
+ }
11
+ /** A geocoded address: GeoJSON Feature, geometry null when it was typed but not located. */
12
+ export interface AddressFeature {
13
+ type: 'Feature';
14
+ geometry: {
15
+ type: 'Point';
16
+ coordinates: [number, number];
17
+ } | null;
18
+ properties: AddressProperties;
19
+ }
20
+ /**
21
+ * An address search box: what is typed is looked up after a pause, the
22
+ * matches are listed, a pick stores the normalised address with its point.
23
+ * Text that is never picked stays as a label without geometry, so an address
24
+ * the provider does not know is still accepted.
25
+ */
26
+ export declare class FkAddressSearch {
27
+ el: HTMLElement;
28
+ value?: AddressFeature;
29
+ /** Search URL with `{q}` for the query; Nominatim jsonv2 by default. */
30
+ searchUrl: string;
31
+ /** Comma-separated ISO codes to restrict the search (Nominatim `countrycodes`). */
32
+ countryCodes?: string;
33
+ language?: string;
34
+ placeholder?: string;
35
+ disabled: boolean;
36
+ readOnly: boolean;
37
+ minChars: number;
38
+ addressChange: EventEmitter<AddressFeature | undefined>;
39
+ query: string;
40
+ results: AddressFeature[];
41
+ open: boolean;
42
+ loading: boolean;
43
+ failed: boolean;
44
+ index: number;
45
+ private timer?;
46
+ private request;
47
+ private focused;
48
+ componentWillLoad(): void;
49
+ onValueChange(next: AddressFeature | undefined): void;
50
+ private get locked();
51
+ private buildUrl;
52
+ private search;
53
+ private onInput;
54
+ private pick;
55
+ private onKeyDown;
56
+ render(): any;
57
+ }
@@ -0,0 +1,93 @@
1
+ import type { EventEmitter } from '../../stencil-public-runtime';
2
+ export type GeoPoint = {
3
+ type: 'Point';
4
+ coordinates: [number, number];
5
+ };
6
+ export type GeoPolygon = {
7
+ type: 'Polygon';
8
+ coordinates: [number, number][][];
9
+ };
10
+ export type GeoLine = {
11
+ type: 'LineString';
12
+ coordinates: [number, number][];
13
+ };
14
+ export type GeoGeometry = GeoPoint | GeoPolygon | GeoLine;
15
+ export type GeoMode = 'point' | 'polygon' | 'line' | 'layer';
16
+ /** One zone of a reference layer, as the field stores it. */
17
+ export interface GeoZone {
18
+ code: string;
19
+ name: string;
20
+ }
21
+ /**
22
+ * A Leaflet map that edits one GeoJSON geometry: a point, a polygon or a
23
+ * line. Leaflet is loaded on first use so forms without a map stay light.
24
+ * The value also stays editable without the map: a point has latitude and
25
+ * longitude inputs, so the field works when tiles cannot load.
26
+ */
27
+ export declare class FkGeoMap {
28
+ el: HTMLElement;
29
+ value?: GeoGeometry;
30
+ mode: GeoMode;
31
+ /** Initial view as [latitude, longitude], used when there is no value yet. */
32
+ center?: [number, number];
33
+ zoom: number;
34
+ tileUrl: string;
35
+ attribution: string;
36
+ height: number;
37
+ disabled: boolean;
38
+ readOnly: boolean;
39
+ /** Show latitude and longitude inputs under a point map. */
40
+ manual: boolean;
41
+ /** Layer mode: GeoJSON FeatureCollection to pick zones from. */
42
+ layerUrl?: string;
43
+ layerCodeProperty: string;
44
+ layerNameProperty: string;
45
+ /** Layer mode: codes of the selected zones. */
46
+ selected: string[];
47
+ multiple: boolean;
48
+ geoChange: EventEmitter<GeoGeometry | undefined>;
49
+ /** Layer mode: the selected zones, in selection order. */
50
+ layerChange: EventEmitter<GeoZone[]>;
51
+ failed: boolean;
52
+ vertexCount: number;
53
+ zones: GeoZone[];
54
+ layerFailed: boolean;
55
+ private layer?;
56
+ private layerData?;
57
+ private selectEl?;
58
+ private map?;
59
+ private L?;
60
+ private container?;
61
+ private shapes;
62
+ private vertices;
63
+ private lastEmitted;
64
+ private observer?;
65
+ private get locked();
66
+ componentDidLoad(): Promise<void>;
67
+ disconnectedCallback(): void;
68
+ onValueChange(next: GeoGeometry | undefined): void;
69
+ onLockChange(): void;
70
+ onSelectedChange(): void;
71
+ onLayerUrlChange(): void;
72
+ private initMap;
73
+ /** Reads the value into vertices and draws it, without emitting. */
74
+ private draw;
75
+ private countVertices;
76
+ private render_shapes;
77
+ private setVertices;
78
+ private geometry;
79
+ private emit;
80
+ private clear;
81
+ /** Manual latitude / longitude edit of a point, map or not. Emptying either empties the point. */
82
+ private setManual;
83
+ componentDidRender(): void;
84
+ private zoneOf;
85
+ private fetchLayer;
86
+ private layerStyle;
87
+ private drawLayer;
88
+ private restyleLayer;
89
+ private toggleZone;
90
+ private emitZones;
91
+ private renderLayerBar;
92
+ render(): any;
93
+ }
@@ -5,13 +5,49 @@
5
5
  * It contains typing information for all components that exist in this project.
6
6
  */
7
7
  import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
8
+ import { AddressFeature } from "./components/fk-address-search/fk-address-search";
8
9
  import { BrickConfigsChangeDetail, BrickDropDetail, BrickPathDetail, BrickReviewChangeDetail, BrickRulesChangeDetail, BrickStylesChangeDetail, BrickValidationsChangeDetail, DataChangeDetail, ReviewChangeDetail, SpecChangeDetail, ValidityChangeDetail } from "./utils/events";
9
10
  import { BrickMold, BrickSpec, FieldAnnotations, UploadedFile, Utils, ValidationResult } from "@streamline-pulse/formkrafter-core";
11
+ import { GeoGeometry, GeoMode, GeoZone } from "./components/fk-geo-map/fk-geo-map";
10
12
  import { FkVariable } from "./components/fk-variable-picker/fk-variable-picker";
13
+ export { AddressFeature } from "./components/fk-address-search/fk-address-search";
11
14
  export { BrickConfigsChangeDetail, BrickDropDetail, BrickPathDetail, BrickReviewChangeDetail, BrickRulesChangeDetail, BrickStylesChangeDetail, BrickValidationsChangeDetail, DataChangeDetail, ReviewChangeDetail, SpecChangeDetail, ValidityChangeDetail } from "./utils/events";
12
15
  export { BrickMold, BrickSpec, FieldAnnotations, UploadedFile, Utils, ValidationResult } from "@streamline-pulse/formkrafter-core";
16
+ export { GeoGeometry, GeoMode, GeoZone } from "./components/fk-geo-map/fk-geo-map";
13
17
  export { FkVariable } from "./components/fk-variable-picker/fk-variable-picker";
14
18
  export namespace Components {
19
+ /**
20
+ * An address search box: what is typed is looked up after a pause, the
21
+ * matches are listed, a pick stores the normalised address with its point.
22
+ * Text that is never picked stays as a label without geometry, so an address
23
+ * the provider does not know is still accepted.
24
+ */
25
+ interface FkAddressSearch {
26
+ /**
27
+ * Comma-separated ISO codes to restrict the search (Nominatim `countrycodes`).
28
+ */
29
+ "countryCodes"?: string;
30
+ /**
31
+ * @default false
32
+ */
33
+ "disabled": boolean;
34
+ "language"?: string;
35
+ /**
36
+ * @default 3
37
+ */
38
+ "minChars": number;
39
+ "placeholder"?: string;
40
+ /**
41
+ * @default false
42
+ */
43
+ "readOnly": boolean;
44
+ /**
45
+ * Search URL with `{q}` for the query; Nominatim jsonv2 by default.
46
+ * @default 'https://nominatim.openstreetmap.org/search?format=jsonv2&addressdetails=1&limit=5&q={q}'
47
+ */
48
+ "searchUrl": string;
49
+ "value"?: AddressFeature;
50
+ }
15
51
  interface FkBrickActions {
16
52
  "path": string;
17
53
  /**
@@ -196,6 +232,73 @@ export namespace Components {
196
232
  "reviews"?: FieldAnnotations;
197
233
  "spec": BrickSpec;
198
234
  }
235
+ /**
236
+ * A Leaflet map that edits one GeoJSON geometry: a point, a polygon or a
237
+ * line. Leaflet is loaded on first use so forms without a map stay light.
238
+ * The value also stays editable without the map: a point has latitude and
239
+ * longitude inputs, so the field works when tiles cannot load.
240
+ */
241
+ interface FkGeoMap {
242
+ /**
243
+ * @default '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
244
+ */
245
+ "attribution": string;
246
+ /**
247
+ * Initial view as [latitude, longitude], used when there is no value yet.
248
+ */
249
+ "center"?: [number, number];
250
+ /**
251
+ * @default false
252
+ */
253
+ "disabled": boolean;
254
+ /**
255
+ * @default 320
256
+ */
257
+ "height": number;
258
+ /**
259
+ * @default 'code'
260
+ */
261
+ "layerCodeProperty": string;
262
+ /**
263
+ * @default 'name'
264
+ */
265
+ "layerNameProperty": string;
266
+ /**
267
+ * Layer mode: GeoJSON FeatureCollection to pick zones from.
268
+ */
269
+ "layerUrl"?: string;
270
+ /**
271
+ * Show latitude and longitude inputs under a point map.
272
+ * @default true
273
+ */
274
+ "manual": boolean;
275
+ /**
276
+ * @default 'point'
277
+ */
278
+ "mode": GeoMode;
279
+ /**
280
+ * @default false
281
+ */
282
+ "multiple": boolean;
283
+ /**
284
+ * @default false
285
+ */
286
+ "readOnly": boolean;
287
+ /**
288
+ * Layer mode: codes of the selected zones.
289
+ * @default []
290
+ */
291
+ "selected": string[];
292
+ /**
293
+ * @default 'https://tile.openstreetmap.org/{z}/{x}/{y}.png'
294
+ */
295
+ "tileUrl": string;
296
+ "value"?: GeoGeometry;
297
+ /**
298
+ * @default 6
299
+ */
300
+ "zoom": number;
301
+ }
199
302
  interface FkPropertyPanel {
200
303
  "brick": BrickSpec;
201
304
  "editLocale"?: string;
@@ -286,6 +389,10 @@ export namespace Components {
286
389
  "variables": FkVariable[];
287
390
  }
288
391
  }
392
+ export interface FkAddressSearchCustomEvent<T> extends CustomEvent<T> {
393
+ detail: T;
394
+ target: HTMLFkAddressSearchElement;
395
+ }
289
396
  export interface FkBrickActionsCustomEvent<T> extends CustomEvent<T> {
290
397
  detail: T;
291
398
  target: HTMLFkBrickActionsElement;
@@ -322,6 +429,10 @@ export interface FkFormReviewCustomEvent<T> extends CustomEvent<T> {
322
429
  detail: T;
323
430
  target: HTMLFkFormReviewElement;
324
431
  }
432
+ export interface FkGeoMapCustomEvent<T> extends CustomEvent<T> {
433
+ detail: T;
434
+ target: HTMLFkGeoMapElement;
435
+ }
325
436
  export interface FkPropertyPanelCustomEvent<T> extends CustomEvent<T> {
326
437
  detail: T;
327
438
  target: HTMLFkPropertyPanelElement;
@@ -351,6 +462,29 @@ export interface FkVariablePickerCustomEvent<T> extends CustomEvent<T> {
351
462
  target: HTMLFkVariablePickerElement;
352
463
  }
353
464
  declare global {
465
+ interface HTMLFkAddressSearchElementEventMap {
466
+ "addressChange": AddressFeature | undefined;
467
+ }
468
+ /**
469
+ * An address search box: what is typed is looked up after a pause, the
470
+ * matches are listed, a pick stores the normalised address with its point.
471
+ * Text that is never picked stays as a label without geometry, so an address
472
+ * the provider does not know is still accepted.
473
+ */
474
+ interface HTMLFkAddressSearchElement extends Components.FkAddressSearch, HTMLStencilElement {
475
+ addEventListener<K extends keyof HTMLFkAddressSearchElementEventMap>(type: K, listener: (this: HTMLFkAddressSearchElement, ev: FkAddressSearchCustomEvent<HTMLFkAddressSearchElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
476
+ addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
477
+ addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
478
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
479
+ removeEventListener<K extends keyof HTMLFkAddressSearchElementEventMap>(type: K, listener: (this: HTMLFkAddressSearchElement, ev: FkAddressSearchCustomEvent<HTMLFkAddressSearchElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
480
+ removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
481
+ removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
482
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
483
+ }
484
+ var HTMLFkAddressSearchElement: {
485
+ prototype: HTMLFkAddressSearchElement;
486
+ new (): HTMLFkAddressSearchElement;
487
+ };
354
488
  interface HTMLFkBrickActionsElementEventMap {
355
489
  "brickRemove": BrickPathDetail;
356
490
  "brickDuplicate": BrickPathDetail;
@@ -546,6 +680,30 @@ declare global {
546
680
  prototype: HTMLFkFormReviewElement;
547
681
  new (): HTMLFkFormReviewElement;
548
682
  };
683
+ interface HTMLFkGeoMapElementEventMap {
684
+ "geoChange": GeoGeometry | undefined;
685
+ "layerChange": GeoZone[];
686
+ }
687
+ /**
688
+ * A Leaflet map that edits one GeoJSON geometry: a point, a polygon or a
689
+ * line. Leaflet is loaded on first use so forms without a map stay light.
690
+ * The value also stays editable without the map: a point has latitude and
691
+ * longitude inputs, so the field works when tiles cannot load.
692
+ */
693
+ interface HTMLFkGeoMapElement extends Components.FkGeoMap, HTMLStencilElement {
694
+ addEventListener<K extends keyof HTMLFkGeoMapElementEventMap>(type: K, listener: (this: HTMLFkGeoMapElement, ev: FkGeoMapCustomEvent<HTMLFkGeoMapElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
695
+ addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
696
+ addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
697
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
698
+ removeEventListener<K extends keyof HTMLFkGeoMapElementEventMap>(type: K, listener: (this: HTMLFkGeoMapElement, ev: FkGeoMapCustomEvent<HTMLFkGeoMapElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
699
+ removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
700
+ removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
701
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
702
+ }
703
+ var HTMLFkGeoMapElement: {
704
+ prototype: HTMLFkGeoMapElement;
705
+ new (): HTMLFkGeoMapElement;
706
+ };
549
707
  interface HTMLFkPropertyPanelElementEventMap {
550
708
  "brickConfigsChange": BrickConfigsChangeDetail;
551
709
  "brickValidationsChange": BrickValidationsChangeDetail;
@@ -675,6 +833,7 @@ declare global {
675
833
  new (): HTMLFkVariablePickerElement;
676
834
  };
677
835
  interface HTMLElementTagNameMap {
836
+ "fk-address-search": HTMLFkAddressSearchElement;
678
837
  "fk-brick-actions": HTMLFkBrickActionsElement;
679
838
  "fk-brick-list": HTMLFkBrickListElement;
680
839
  "fk-brick-mold-item": HTMLFkBrickMoldItemElement;
@@ -688,6 +847,7 @@ declare global {
688
847
  "fk-form-builder": HTMLFkFormBuilderElement;
689
848
  "fk-form-render": HTMLFkFormRenderElement;
690
849
  "fk-form-review": HTMLFkFormReviewElement;
850
+ "fk-geo-map": HTMLFkGeoMapElement;
691
851
  "fk-property-panel": HTMLFkPropertyPanelElement;
692
852
  "fk-rules-editor": HTMLFkRulesEditorElement;
693
853
  "fk-select-input": HTMLFkSelectInputElement;
@@ -700,6 +860,39 @@ declare global {
700
860
  declare namespace LocalJSX {
701
861
  type OneOf<K extends string, PropT, AttrT = PropT> = { [P in K]: PropT } & { [P in `attr:${K}` | `prop:${K}`]?: never } | { [P in `attr:${K}`]: AttrT } & { [P in K | `prop:${K}`]?: never } | { [P in `prop:${K}`]: PropT } & { [P in K | `attr:${K}`]?: never };
702
862
 
863
+ /**
864
+ * An address search box: what is typed is looked up after a pause, the
865
+ * matches are listed, a pick stores the normalised address with its point.
866
+ * Text that is never picked stays as a label without geometry, so an address
867
+ * the provider does not know is still accepted.
868
+ */
869
+ interface FkAddressSearch {
870
+ /**
871
+ * Comma-separated ISO codes to restrict the search (Nominatim `countrycodes`).
872
+ */
873
+ "countryCodes"?: string;
874
+ /**
875
+ * @default false
876
+ */
877
+ "disabled"?: boolean;
878
+ "language"?: string;
879
+ /**
880
+ * @default 3
881
+ */
882
+ "minChars"?: number;
883
+ "onAddressChange"?: (event: FkAddressSearchCustomEvent<AddressFeature | undefined>) => void;
884
+ "placeholder"?: string;
885
+ /**
886
+ * @default false
887
+ */
888
+ "readOnly"?: boolean;
889
+ /**
890
+ * Search URL with `{q}` for the query; Nominatim jsonv2 by default.
891
+ * @default 'https://nominatim.openstreetmap.org/search?format=jsonv2&addressdetails=1&limit=5&q={q}'
892
+ */
893
+ "searchUrl"?: string;
894
+ "value"?: AddressFeature;
895
+ }
703
896
  interface FkBrickActions {
704
897
  "onBrickDrop"?: (event: FkBrickActionsCustomEvent<BrickDropDetail>) => void;
705
898
  "onBrickDuplicate"?: (event: FkBrickActionsCustomEvent<BrickPathDetail>) => void;
@@ -911,6 +1104,78 @@ declare namespace LocalJSX {
911
1104
  "reviews"?: FieldAnnotations;
912
1105
  "spec": BrickSpec;
913
1106
  }
1107
+ /**
1108
+ * A Leaflet map that edits one GeoJSON geometry: a point, a polygon or a
1109
+ * line. Leaflet is loaded on first use so forms without a map stay light.
1110
+ * The value also stays editable without the map: a point has latitude and
1111
+ * longitude inputs, so the field works when tiles cannot load.
1112
+ */
1113
+ interface FkGeoMap {
1114
+ /**
1115
+ * @default '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
1116
+ */
1117
+ "attribution"?: string;
1118
+ /**
1119
+ * Initial view as [latitude, longitude], used when there is no value yet.
1120
+ */
1121
+ "center"?: [number, number];
1122
+ /**
1123
+ * @default false
1124
+ */
1125
+ "disabled"?: boolean;
1126
+ /**
1127
+ * @default 320
1128
+ */
1129
+ "height"?: number;
1130
+ /**
1131
+ * @default 'code'
1132
+ */
1133
+ "layerCodeProperty"?: string;
1134
+ /**
1135
+ * @default 'name'
1136
+ */
1137
+ "layerNameProperty"?: string;
1138
+ /**
1139
+ * Layer mode: GeoJSON FeatureCollection to pick zones from.
1140
+ */
1141
+ "layerUrl"?: string;
1142
+ /**
1143
+ * Show latitude and longitude inputs under a point map.
1144
+ * @default true
1145
+ */
1146
+ "manual"?: boolean;
1147
+ /**
1148
+ * @default 'point'
1149
+ */
1150
+ "mode"?: GeoMode;
1151
+ /**
1152
+ * @default false
1153
+ */
1154
+ "multiple"?: boolean;
1155
+ "onGeoChange"?: (event: FkGeoMapCustomEvent<GeoGeometry | undefined>) => void;
1156
+ /**
1157
+ * Layer mode: the selected zones, in selection order.
1158
+ */
1159
+ "onLayerChange"?: (event: FkGeoMapCustomEvent<GeoZone[]>) => void;
1160
+ /**
1161
+ * @default false
1162
+ */
1163
+ "readOnly"?: boolean;
1164
+ /**
1165
+ * Layer mode: codes of the selected zones.
1166
+ * @default []
1167
+ */
1168
+ "selected"?: string[];
1169
+ /**
1170
+ * @default 'https://tile.openstreetmap.org/{z}/{x}/{y}.png'
1171
+ */
1172
+ "tileUrl"?: string;
1173
+ "value"?: GeoGeometry;
1174
+ /**
1175
+ * @default 6
1176
+ */
1177
+ "zoom"?: number;
1178
+ }
914
1179
  interface FkPropertyPanel {
915
1180
  "brick": BrickSpec;
916
1181
  "editLocale"?: string;
@@ -1011,6 +1276,15 @@ declare namespace LocalJSX {
1011
1276
  "variables"?: FkVariable[];
1012
1277
  }
1013
1278
 
1279
+ interface FkAddressSearchAttributes {
1280
+ "searchUrl": string;
1281
+ "countryCodes": string;
1282
+ "language": string;
1283
+ "placeholder": string;
1284
+ "disabled": boolean;
1285
+ "readOnly": boolean;
1286
+ "minChars": number;
1287
+ }
1014
1288
  interface FkBrickActionsAttributes {
1015
1289
  "path": string;
1016
1290
  "selected": boolean;
@@ -1063,6 +1337,20 @@ declare namespace LocalJSX {
1063
1337
  interface FkFormReviewAttributes {
1064
1338
  "locale": string;
1065
1339
  }
1340
+ interface FkGeoMapAttributes {
1341
+ "mode": GeoMode;
1342
+ "zoom": number;
1343
+ "tileUrl": string;
1344
+ "attribution": string;
1345
+ "height": number;
1346
+ "disabled": boolean;
1347
+ "readOnly": boolean;
1348
+ "manual": boolean;
1349
+ "layerUrl": string;
1350
+ "layerCodeProperty": string;
1351
+ "layerNameProperty": string;
1352
+ "multiple": boolean;
1353
+ }
1066
1354
  interface FkPropertyPanelAttributes {
1067
1355
  "path": string;
1068
1356
  "locale": string;
@@ -1093,6 +1381,7 @@ declare namespace LocalJSX {
1093
1381
  }
1094
1382
 
1095
1383
  interface IntrinsicElements {
1384
+ "fk-address-search": Omit<FkAddressSearch, keyof FkAddressSearchAttributes> & { [K in keyof FkAddressSearch & keyof FkAddressSearchAttributes]?: FkAddressSearch[K] } & { [K in keyof FkAddressSearch & keyof FkAddressSearchAttributes as `attr:${K}`]?: FkAddressSearchAttributes[K] } & { [K in keyof FkAddressSearch & keyof FkAddressSearchAttributes as `prop:${K}`]?: FkAddressSearch[K] };
1096
1385
  "fk-brick-actions": Omit<FkBrickActions, keyof FkBrickActionsAttributes> & { [K in keyof FkBrickActions & keyof FkBrickActionsAttributes]?: FkBrickActions[K] } & { [K in keyof FkBrickActions & keyof FkBrickActionsAttributes as `attr:${K}`]?: FkBrickActionsAttributes[K] } & { [K in keyof FkBrickActions & keyof FkBrickActionsAttributes as `prop:${K}`]?: FkBrickActions[K] } & OneOf<"path", FkBrickActions["path"], FkBrickActionsAttributes["path"]>;
1097
1386
  "fk-brick-list": Omit<FkBrickList, keyof FkBrickListAttributes> & { [K in keyof FkBrickList & keyof FkBrickListAttributes]?: FkBrickList[K] } & { [K in keyof FkBrickList & keyof FkBrickListAttributes as `attr:${K}`]?: FkBrickListAttributes[K] } & { [K in keyof FkBrickList & keyof FkBrickListAttributes as `prop:${K}`]?: FkBrickList[K] };
1098
1387
  "fk-brick-mold-item": FkBrickMoldItem;
@@ -1106,6 +1395,7 @@ declare namespace LocalJSX {
1106
1395
  "fk-form-builder": Omit<FkFormBuilder, keyof FkFormBuilderAttributes> & { [K in keyof FkFormBuilder & keyof FkFormBuilderAttributes]?: FkFormBuilder[K] } & { [K in keyof FkFormBuilder & keyof FkFormBuilderAttributes as `attr:${K}`]?: FkFormBuilderAttributes[K] } & { [K in keyof FkFormBuilder & keyof FkFormBuilderAttributes as `prop:${K}`]?: FkFormBuilder[K] };
1107
1396
  "fk-form-render": Omit<FkFormRender, keyof FkFormRenderAttributes> & { [K in keyof FkFormRender & keyof FkFormRenderAttributes]?: FkFormRender[K] } & { [K in keyof FkFormRender & keyof FkFormRenderAttributes as `attr:${K}`]?: FkFormRenderAttributes[K] } & { [K in keyof FkFormRender & keyof FkFormRenderAttributes as `prop:${K}`]?: FkFormRender[K] };
1108
1397
  "fk-form-review": Omit<FkFormReview, keyof FkFormReviewAttributes> & { [K in keyof FkFormReview & keyof FkFormReviewAttributes]?: FkFormReview[K] } & { [K in keyof FkFormReview & keyof FkFormReviewAttributes as `attr:${K}`]?: FkFormReviewAttributes[K] } & { [K in keyof FkFormReview & keyof FkFormReviewAttributes as `prop:${K}`]?: FkFormReview[K] };
1398
+ "fk-geo-map": Omit<FkGeoMap, keyof FkGeoMapAttributes> & { [K in keyof FkGeoMap & keyof FkGeoMapAttributes]?: FkGeoMap[K] } & { [K in keyof FkGeoMap & keyof FkGeoMapAttributes as `attr:${K}`]?: FkGeoMapAttributes[K] } & { [K in keyof FkGeoMap & keyof FkGeoMapAttributes as `prop:${K}`]?: FkGeoMap[K] };
1109
1399
  "fk-property-panel": Omit<FkPropertyPanel, keyof FkPropertyPanelAttributes> & { [K in keyof FkPropertyPanel & keyof FkPropertyPanelAttributes]?: FkPropertyPanel[K] } & { [K in keyof FkPropertyPanel & keyof FkPropertyPanelAttributes as `attr:${K}`]?: FkPropertyPanelAttributes[K] } & { [K in keyof FkPropertyPanel & keyof FkPropertyPanelAttributes as `prop:${K}`]?: FkPropertyPanel[K] };
1110
1400
  "fk-rules-editor": Omit<FkRulesEditor, keyof FkRulesEditorAttributes> & { [K in keyof FkRulesEditor & keyof FkRulesEditorAttributes]?: FkRulesEditor[K] } & { [K in keyof FkRulesEditor & keyof FkRulesEditorAttributes as `attr:${K}`]?: FkRulesEditorAttributes[K] } & { [K in keyof FkRulesEditor & keyof FkRulesEditorAttributes as `prop:${K}`]?: FkRulesEditor[K] };
1111
1401
  "fk-select-input": Omit<FkSelectInput, keyof FkSelectInputAttributes> & { [K in keyof FkSelectInput & keyof FkSelectInputAttributes]?: FkSelectInput[K] } & { [K in keyof FkSelectInput & keyof FkSelectInputAttributes as `attr:${K}`]?: FkSelectInputAttributes[K] } & { [K in keyof FkSelectInput & keyof FkSelectInputAttributes as `prop:${K}`]?: FkSelectInput[K] };
@@ -1119,6 +1409,13 @@ export { LocalJSX as JSX };
1119
1409
  declare module "@stencil/core" {
1120
1410
  export namespace JSX {
1121
1411
  interface IntrinsicElements {
1412
+ /**
1413
+ * An address search box: what is typed is looked up after a pause, the
1414
+ * matches are listed, a pick stores the normalised address with its point.
1415
+ * Text that is never picked stays as a label without geometry, so an address
1416
+ * the provider does not know is still accepted.
1417
+ */
1418
+ "fk-address-search": LocalJSX.IntrinsicElements["fk-address-search"] & JSXBase.HTMLAttributes<HTMLFkAddressSearchElement>;
1122
1419
  "fk-brick-actions": LocalJSX.IntrinsicElements["fk-brick-actions"] & JSXBase.HTMLAttributes<HTMLFkBrickActionsElement>;
1123
1420
  "fk-brick-list": LocalJSX.IntrinsicElements["fk-brick-list"] & JSXBase.HTMLAttributes<HTMLFkBrickListElement>;
1124
1421
  "fk-brick-mold-item": LocalJSX.IntrinsicElements["fk-brick-mold-item"] & JSXBase.HTMLAttributes<HTMLFkBrickMoldItemElement>;
@@ -1137,6 +1434,13 @@ declare module "@stencil/core" {
1137
1434
  * holds the review map and emits it.
1138
1435
  */
1139
1436
  "fk-form-review": LocalJSX.IntrinsicElements["fk-form-review"] & JSXBase.HTMLAttributes<HTMLFkFormReviewElement>;
1437
+ /**
1438
+ * A Leaflet map that edits one GeoJSON geometry: a point, a polygon or a
1439
+ * line. Leaflet is loaded on first use so forms without a map stay light.
1440
+ * The value also stays editable without the map: a point has latitude and
1441
+ * longitude inputs, so the field works when tiles cannot load.
1442
+ */
1443
+ "fk-geo-map": LocalJSX.IntrinsicElements["fk-geo-map"] & JSXBase.HTMLAttributes<HTMLFkGeoMapElement>;
1140
1444
  "fk-property-panel": LocalJSX.IntrinsicElements["fk-property-panel"] & JSXBase.HTMLAttributes<HTMLFkPropertyPanelElement>;
1141
1445
  "fk-rules-editor": LocalJSX.IntrinsicElements["fk-rules-editor"] & JSXBase.HTMLAttributes<HTMLFkRulesEditorElement>;
1142
1446
  "fk-select-input": LocalJSX.IntrinsicElements["fk-select-input"] & JSXBase.HTMLAttributes<HTMLFkSelectInputElement>;