@streamline-pulse/formkrafter-wc 0.26.0 → 0.28.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 (67) 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-data-grid.js +1 -1
  9. package/dist/components/fk-drop-area.js +1 -1
  10. package/dist/components/fk-empty-form.js +1 -1
  11. package/dist/components/fk-file-input.js +1 -1
  12. package/dist/components/fk-form-builder.js +1 -1
  13. package/dist/components/fk-form-render.js +1 -1
  14. package/dist/components/fk-form-review.js +1 -1
  15. package/dist/components/fk-geo-map.js +1 -1
  16. package/dist/components/fk-property-panel.js +1 -1
  17. package/dist/components/fk-rules-editor.js +1 -1
  18. package/dist/components/fk-select-input.js +1 -1
  19. package/dist/components/fk-signature-input.js +1 -1
  20. package/dist/components/fk-slot-picker.d.ts +11 -0
  21. package/dist/components/fk-slot-picker.js +1 -0
  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-n1ZfmAbp.js → p-1Ki_1K2W.js} +1 -1
  27. package/dist/components/{p-_r5Y7ZTv.js → p-B5gG7fHb.js} +1 -1
  28. package/dist/components/{p-BiRWoCM5.js → p-BEft-cf2.js} +1 -1
  29. package/dist/components/p-BGax6QkM.js +1 -0
  30. package/dist/components/p-Bs2c_rtu.js +1 -0
  31. package/dist/components/p-C8yXvs3g.js +1 -0
  32. package/dist/components/{p-DXpuft_B.js → p-CIZUeonQ.js} +1 -1
  33. package/dist/components/{p-Ri4dmHJc.js → p-CuF0gbWB.js} +1 -1
  34. package/dist/components/{p-BYnOpgog.js → p-DIW5FtAy.js} +1 -1
  35. package/dist/components/{p-D4AIlVj7.js → p-DJxeNTfC.js} +1 -1
  36. package/dist/components/{p-UBqrhUH9.js → p-DK2UgrV9.js} +1 -1
  37. package/dist/components/p-DMLnAgzb.js +1 -0
  38. package/dist/components/{p-DrMYb2JF.js → p-Ddiv4Djm.js} +7 -7
  39. package/dist/components/{p-Ca6m8UMG.js → p-Di7uMflS.js} +1 -1
  40. package/dist/components/p-DskfAsd6.js +1 -0
  41. package/dist/components/{p-CWB1pV6F.js → p-Dt5tFknh.js} +1 -1
  42. package/dist/components/{p-yL2ezQGT.js → p-DtPhC0nx.js} +1 -1
  43. package/dist/components/p-FSCguIuu.js +1 -0
  44. package/dist/components/p-YMLbA4H2.js +1 -0
  45. package/dist/components/{p-fyNpcz6u.js → p-lOT7NMxD.js} +1 -1
  46. package/dist/components/{p-BNgstTrs.js → p-xvN-OJAU.js} +1 -1
  47. package/dist/formkrafter-wc/formkrafter-wc.css +1 -1
  48. package/dist/formkrafter-wc/formkrafter-wc.esm.js +1 -1
  49. package/dist/formkrafter-wc/index.esm.js +1 -1
  50. package/dist/formkrafter-wc/{p-65431291.entry.js → p-730cac62.entry.js} +1 -1
  51. package/dist/formkrafter-wc/p-7bc82da2.entry.js +1 -0
  52. package/dist/formkrafter-wc/{p-CI3OKuAu.js → p-CiXmtjEN.js} +1 -1
  53. package/dist/formkrafter-wc/{p-0--P75z3.js → p-D3ItRsmP.js} +7 -7
  54. package/dist/formkrafter-wc/p-d1d683b6.entry.js +1 -0
  55. package/dist/types/components/fk-address-search/fk-address-search.d.ts +57 -0
  56. package/dist/types/components/fk-geo-map/fk-geo-map.d.ts +31 -1
  57. package/dist/types/components/fk-slot-picker/fk-slot-picker.d.ts +33 -0
  58. package/dist/types/components.d.ts +258 -4
  59. package/dist/types/registry/default-bricks.d.ts +162 -0
  60. package/package.json +2 -2
  61. package/dist/components/p-2CyX0nUR.js +0 -1
  62. package/dist/components/p-C1QFqyCY.js +0 -1
  63. package/dist/components/p-CRwXPnZM.js +0 -1
  64. package/dist/components/p-DGWNeoAv.js +0 -1
  65. package/dist/components/p-Dijf1OvK.js +0 -1
  66. package/dist/formkrafter-wc/p-71246548.entry.js +0 -1
  67. package/dist/formkrafter-wc/p-c6783c00.entry.js +0 -1
@@ -5,15 +5,51 @@
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
- import { BrickMold, BrickSpec, FieldAnnotations, UploadedFile, Utils, ValidationResult } from "@streamline-pulse/formkrafter-core";
10
- import { GeoGeometry, GeoMode } from "./components/fk-geo-map/fk-geo-map";
10
+ import { BrickMold, BrickSpec, FieldAnnotations, SlotRules, UploadedFile, Utils, ValidationResult } from "@streamline-pulse/formkrafter-core";
11
+ import { GeoGeometry, GeoMode, GeoZone } from "./components/fk-geo-map/fk-geo-map";
12
+ import { PickedSlot } from "./components/fk-slot-picker/fk-slot-picker";
11
13
  import { FkVariable } from "./components/fk-variable-picker/fk-variable-picker";
14
+ export { AddressFeature } from "./components/fk-address-search/fk-address-search";
12
15
  export { BrickConfigsChangeDetail, BrickDropDetail, BrickPathDetail, BrickReviewChangeDetail, BrickRulesChangeDetail, BrickStylesChangeDetail, BrickValidationsChangeDetail, DataChangeDetail, ReviewChangeDetail, SpecChangeDetail, ValidityChangeDetail } from "./utils/events";
13
- export { BrickMold, BrickSpec, FieldAnnotations, UploadedFile, Utils, ValidationResult } from "@streamline-pulse/formkrafter-core";
14
- export { GeoGeometry, GeoMode } from "./components/fk-geo-map/fk-geo-map";
16
+ export { BrickMold, BrickSpec, FieldAnnotations, SlotRules, UploadedFile, Utils, ValidationResult } from "@streamline-pulse/formkrafter-core";
17
+ export { GeoGeometry, GeoMode, GeoZone } from "./components/fk-geo-map/fk-geo-map";
18
+ export { PickedSlot } from "./components/fk-slot-picker/fk-slot-picker";
15
19
  export { FkVariable } from "./components/fk-variable-picker/fk-variable-picker";
16
20
  export namespace Components {
21
+ /**
22
+ * An address search box: what is typed is looked up after a pause, the
23
+ * matches are listed, a pick stores the normalised address with its point.
24
+ * Text that is never picked stays as a label without geometry, so an address
25
+ * the provider does not know is still accepted.
26
+ */
27
+ interface FkAddressSearch {
28
+ /**
29
+ * Comma-separated ISO codes to restrict the search (Nominatim `countrycodes`).
30
+ */
31
+ "countryCodes"?: string;
32
+ /**
33
+ * @default false
34
+ */
35
+ "disabled": boolean;
36
+ "language"?: string;
37
+ /**
38
+ * @default 3
39
+ */
40
+ "minChars": number;
41
+ "placeholder"?: string;
42
+ /**
43
+ * @default false
44
+ */
45
+ "readOnly": boolean;
46
+ /**
47
+ * Search URL with `{q}` for the query; Nominatim jsonv2 by default.
48
+ * @default 'https://nominatim.openstreetmap.org/search?format=jsonv2&addressdetails=1&limit=5&q={q}'
49
+ */
50
+ "searchUrl": string;
51
+ "value"?: AddressFeature;
52
+ }
17
53
  interface FkBrickActions {
18
54
  "path": string;
19
55
  /**
@@ -221,6 +257,18 @@ export namespace Components {
221
257
  * @default 320
222
258
  */
223
259
  "height": number;
260
+ /**
261
+ * @default 'code'
262
+ */
263
+ "layerCodeProperty": string;
264
+ /**
265
+ * @default 'name'
266
+ */
267
+ "layerNameProperty": string;
268
+ /**
269
+ * Layer mode: GeoJSON FeatureCollection to pick zones from.
270
+ */
271
+ "layerUrl"?: string;
224
272
  /**
225
273
  * Show latitude and longitude inputs under a point map.
226
274
  * @default true
@@ -230,10 +278,19 @@ export namespace Components {
230
278
  * @default 'point'
231
279
  */
232
280
  "mode": GeoMode;
281
+ /**
282
+ * @default false
283
+ */
284
+ "multiple": boolean;
233
285
  /**
234
286
  * @default false
235
287
  */
236
288
  "readOnly": boolean;
289
+ /**
290
+ * Layer mode: codes of the selected zones.
291
+ * @default []
292
+ */
293
+ "selected": string[];
237
294
  /**
238
295
  * @default 'https://tile.openstreetmap.org/{z}/{x}/{y}.png'
239
296
  */
@@ -291,6 +348,29 @@ export namespace Components {
291
348
  "disabled": boolean;
292
349
  "value"?: string;
293
350
  }
351
+ /**
352
+ * Picks an appointment slot (the event is `slotPick`: `slotChange` would collide with
353
+ * the browser's native `slotchange` event in the JSX binding): the days that still have slots, then the slots
354
+ * of the chosen day. Slots come from a URL (`slotsUrl`, answering a list with
355
+ * `remaining` counts) or are generated from the opening rules.
356
+ */
357
+ interface FkSlotPicker {
358
+ /**
359
+ * @default false
360
+ */
361
+ "disabled": boolean;
362
+ "locale"?: string;
363
+ /**
364
+ * @default false
365
+ */
366
+ "readOnly": boolean;
367
+ /**
368
+ * @default {}
369
+ */
370
+ "rules": SlotRules;
371
+ "slotsUrl"?: string;
372
+ "value"?: PickedSlot;
373
+ }
294
374
  interface FkStepper {
295
375
  "dataMap"?: Record<string, unknown>;
296
376
  /**
@@ -334,6 +414,10 @@ export namespace Components {
334
414
  "variables": FkVariable[];
335
415
  }
336
416
  }
417
+ export interface FkAddressSearchCustomEvent<T> extends CustomEvent<T> {
418
+ detail: T;
419
+ target: HTMLFkAddressSearchElement;
420
+ }
337
421
  export interface FkBrickActionsCustomEvent<T> extends CustomEvent<T> {
338
422
  detail: T;
339
423
  target: HTMLFkBrickActionsElement;
@@ -390,6 +474,10 @@ export interface FkSignatureInputCustomEvent<T> extends CustomEvent<T> {
390
474
  detail: T;
391
475
  target: HTMLFkSignatureInputElement;
392
476
  }
477
+ export interface FkSlotPickerCustomEvent<T> extends CustomEvent<T> {
478
+ detail: T;
479
+ target: HTMLFkSlotPickerElement;
480
+ }
393
481
  export interface FkStepperCustomEvent<T> extends CustomEvent<T> {
394
482
  detail: T;
395
483
  target: HTMLFkStepperElement;
@@ -403,6 +491,29 @@ export interface FkVariablePickerCustomEvent<T> extends CustomEvent<T> {
403
491
  target: HTMLFkVariablePickerElement;
404
492
  }
405
493
  declare global {
494
+ interface HTMLFkAddressSearchElementEventMap {
495
+ "addressChange": AddressFeature | undefined;
496
+ }
497
+ /**
498
+ * An address search box: what is typed is looked up after a pause, the
499
+ * matches are listed, a pick stores the normalised address with its point.
500
+ * Text that is never picked stays as a label without geometry, so an address
501
+ * the provider does not know is still accepted.
502
+ */
503
+ interface HTMLFkAddressSearchElement extends Components.FkAddressSearch, HTMLStencilElement {
504
+ addEventListener<K extends keyof HTMLFkAddressSearchElementEventMap>(type: K, listener: (this: HTMLFkAddressSearchElement, ev: FkAddressSearchCustomEvent<HTMLFkAddressSearchElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
505
+ addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
506
+ addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
507
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
508
+ removeEventListener<K extends keyof HTMLFkAddressSearchElementEventMap>(type: K, listener: (this: HTMLFkAddressSearchElement, ev: FkAddressSearchCustomEvent<HTMLFkAddressSearchElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
509
+ removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
510
+ removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
511
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
512
+ }
513
+ var HTMLFkAddressSearchElement: {
514
+ prototype: HTMLFkAddressSearchElement;
515
+ new (): HTMLFkAddressSearchElement;
516
+ };
406
517
  interface HTMLFkBrickActionsElementEventMap {
407
518
  "brickRemove": BrickPathDetail;
408
519
  "brickDuplicate": BrickPathDetail;
@@ -600,6 +711,7 @@ declare global {
600
711
  };
601
712
  interface HTMLFkGeoMapElementEventMap {
602
713
  "geoChange": GeoGeometry | undefined;
714
+ "layerChange": GeoZone[];
603
715
  }
604
716
  /**
605
717
  * A Leaflet map that edits one GeoJSON geometry: a point, a polygon or a
@@ -691,6 +803,29 @@ declare global {
691
803
  prototype: HTMLFkSignatureInputElement;
692
804
  new (): HTMLFkSignatureInputElement;
693
805
  };
806
+ interface HTMLFkSlotPickerElementEventMap {
807
+ "slotPick": PickedSlot | undefined;
808
+ }
809
+ /**
810
+ * Picks an appointment slot (the event is `slotPick`: `slotChange` would collide with
811
+ * the browser's native `slotchange` event in the JSX binding): the days that still have slots, then the slots
812
+ * of the chosen day. Slots come from a URL (`slotsUrl`, answering a list with
813
+ * `remaining` counts) or are generated from the opening rules.
814
+ */
815
+ interface HTMLFkSlotPickerElement extends Components.FkSlotPicker, HTMLStencilElement {
816
+ addEventListener<K extends keyof HTMLFkSlotPickerElementEventMap>(type: K, listener: (this: HTMLFkSlotPickerElement, ev: FkSlotPickerCustomEvent<HTMLFkSlotPickerElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
817
+ addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
818
+ addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
819
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
820
+ removeEventListener<K extends keyof HTMLFkSlotPickerElementEventMap>(type: K, listener: (this: HTMLFkSlotPickerElement, ev: FkSlotPickerCustomEvent<HTMLFkSlotPickerElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
821
+ removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
822
+ removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
823
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
824
+ }
825
+ var HTMLFkSlotPickerElement: {
826
+ prototype: HTMLFkSlotPickerElement;
827
+ new (): HTMLFkSlotPickerElement;
828
+ };
694
829
  interface HTMLFkStepperElementEventMap {
695
830
  "stepTouch": { keys: string[] };
696
831
  "stepperSubmit": void;
@@ -750,6 +885,7 @@ declare global {
750
885
  new (): HTMLFkVariablePickerElement;
751
886
  };
752
887
  interface HTMLElementTagNameMap {
888
+ "fk-address-search": HTMLFkAddressSearchElement;
753
889
  "fk-brick-actions": HTMLFkBrickActionsElement;
754
890
  "fk-brick-list": HTMLFkBrickListElement;
755
891
  "fk-brick-mold-item": HTMLFkBrickMoldItemElement;
@@ -768,6 +904,7 @@ declare global {
768
904
  "fk-rules-editor": HTMLFkRulesEditorElement;
769
905
  "fk-select-input": HTMLFkSelectInputElement;
770
906
  "fk-signature-input": HTMLFkSignatureInputElement;
907
+ "fk-slot-picker": HTMLFkSlotPickerElement;
771
908
  "fk-stepper": HTMLFkStepperElement;
772
909
  "fk-tabs": HTMLFkTabsElement;
773
910
  "fk-variable-picker": HTMLFkVariablePickerElement;
@@ -776,6 +913,39 @@ declare global {
776
913
  declare namespace LocalJSX {
777
914
  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 };
778
915
 
916
+ /**
917
+ * An address search box: what is typed is looked up after a pause, the
918
+ * matches are listed, a pick stores the normalised address with its point.
919
+ * Text that is never picked stays as a label without geometry, so an address
920
+ * the provider does not know is still accepted.
921
+ */
922
+ interface FkAddressSearch {
923
+ /**
924
+ * Comma-separated ISO codes to restrict the search (Nominatim `countrycodes`).
925
+ */
926
+ "countryCodes"?: string;
927
+ /**
928
+ * @default false
929
+ */
930
+ "disabled"?: boolean;
931
+ "language"?: string;
932
+ /**
933
+ * @default 3
934
+ */
935
+ "minChars"?: number;
936
+ "onAddressChange"?: (event: FkAddressSearchCustomEvent<AddressFeature | undefined>) => void;
937
+ "placeholder"?: string;
938
+ /**
939
+ * @default false
940
+ */
941
+ "readOnly"?: boolean;
942
+ /**
943
+ * Search URL with `{q}` for the query; Nominatim jsonv2 by default.
944
+ * @default 'https://nominatim.openstreetmap.org/search?format=jsonv2&addressdetails=1&limit=5&q={q}'
945
+ */
946
+ "searchUrl"?: string;
947
+ "value"?: AddressFeature;
948
+ }
779
949
  interface FkBrickActions {
780
950
  "onBrickDrop"?: (event: FkBrickActionsCustomEvent<BrickDropDetail>) => void;
781
951
  "onBrickDuplicate"?: (event: FkBrickActionsCustomEvent<BrickPathDetail>) => void;
@@ -1010,6 +1180,18 @@ declare namespace LocalJSX {
1010
1180
  * @default 320
1011
1181
  */
1012
1182
  "height"?: number;
1183
+ /**
1184
+ * @default 'code'
1185
+ */
1186
+ "layerCodeProperty"?: string;
1187
+ /**
1188
+ * @default 'name'
1189
+ */
1190
+ "layerNameProperty"?: string;
1191
+ /**
1192
+ * Layer mode: GeoJSON FeatureCollection to pick zones from.
1193
+ */
1194
+ "layerUrl"?: string;
1013
1195
  /**
1014
1196
  * Show latitude and longitude inputs under a point map.
1015
1197
  * @default true
@@ -1019,11 +1201,24 @@ declare namespace LocalJSX {
1019
1201
  * @default 'point'
1020
1202
  */
1021
1203
  "mode"?: GeoMode;
1204
+ /**
1205
+ * @default false
1206
+ */
1207
+ "multiple"?: boolean;
1022
1208
  "onGeoChange"?: (event: FkGeoMapCustomEvent<GeoGeometry | undefined>) => void;
1209
+ /**
1210
+ * Layer mode: the selected zones, in selection order.
1211
+ */
1212
+ "onLayerChange"?: (event: FkGeoMapCustomEvent<GeoZone[]>) => void;
1023
1213
  /**
1024
1214
  * @default false
1025
1215
  */
1026
1216
  "readOnly"?: boolean;
1217
+ /**
1218
+ * Layer mode: codes of the selected zones.
1219
+ * @default []
1220
+ */
1221
+ "selected"?: string[];
1027
1222
  /**
1028
1223
  * @default 'https://tile.openstreetmap.org/{z}/{x}/{y}.png'
1029
1224
  */
@@ -1087,6 +1282,30 @@ declare namespace LocalJSX {
1087
1282
  "onSignatureChange"?: (event: FkSignatureInputCustomEvent<string | undefined>) => void;
1088
1283
  "value"?: string;
1089
1284
  }
1285
+ /**
1286
+ * Picks an appointment slot (the event is `slotPick`: `slotChange` would collide with
1287
+ * the browser's native `slotchange` event in the JSX binding): the days that still have slots, then the slots
1288
+ * of the chosen day. Slots come from a URL (`slotsUrl`, answering a list with
1289
+ * `remaining` counts) or are generated from the opening rules.
1290
+ */
1291
+ interface FkSlotPicker {
1292
+ /**
1293
+ * @default false
1294
+ */
1295
+ "disabled"?: boolean;
1296
+ "locale"?: string;
1297
+ "onSlotPick"?: (event: FkSlotPickerCustomEvent<PickedSlot | undefined>) => void;
1298
+ /**
1299
+ * @default false
1300
+ */
1301
+ "readOnly"?: boolean;
1302
+ /**
1303
+ * @default {}
1304
+ */
1305
+ "rules"?: SlotRules;
1306
+ "slotsUrl"?: string;
1307
+ "value"?: PickedSlot;
1308
+ }
1090
1309
  interface FkStepper {
1091
1310
  "dataMap"?: Record<string, unknown>;
1092
1311
  /**
@@ -1134,6 +1353,15 @@ declare namespace LocalJSX {
1134
1353
  "variables"?: FkVariable[];
1135
1354
  }
1136
1355
 
1356
+ interface FkAddressSearchAttributes {
1357
+ "searchUrl": string;
1358
+ "countryCodes": string;
1359
+ "language": string;
1360
+ "placeholder": string;
1361
+ "disabled": boolean;
1362
+ "readOnly": boolean;
1363
+ "minChars": number;
1364
+ }
1137
1365
  interface FkBrickActionsAttributes {
1138
1366
  "path": string;
1139
1367
  "selected": boolean;
@@ -1195,6 +1423,10 @@ declare namespace LocalJSX {
1195
1423
  "disabled": boolean;
1196
1424
  "readOnly": boolean;
1197
1425
  "manual": boolean;
1426
+ "layerUrl": string;
1427
+ "layerCodeProperty": string;
1428
+ "layerNameProperty": string;
1429
+ "multiple": boolean;
1198
1430
  }
1199
1431
  interface FkPropertyPanelAttributes {
1200
1432
  "path": string;
@@ -1215,6 +1447,12 @@ declare namespace LocalJSX {
1215
1447
  "value": string;
1216
1448
  "disabled": boolean;
1217
1449
  }
1450
+ interface FkSlotPickerAttributes {
1451
+ "slotsUrl": string;
1452
+ "locale": string;
1453
+ "disabled": boolean;
1454
+ "readOnly": boolean;
1455
+ }
1218
1456
  interface FkStepperAttributes {
1219
1457
  "editable": boolean;
1220
1458
  "readOnly": boolean;
@@ -1226,6 +1464,7 @@ declare namespace LocalJSX {
1226
1464
  }
1227
1465
 
1228
1466
  interface IntrinsicElements {
1467
+ "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] };
1229
1468
  "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"]>;
1230
1469
  "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] };
1231
1470
  "fk-brick-mold-item": FkBrickMoldItem;
@@ -1244,6 +1483,7 @@ declare namespace LocalJSX {
1244
1483
  "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] };
1245
1484
  "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] };
1246
1485
  "fk-signature-input": Omit<FkSignatureInput, keyof FkSignatureInputAttributes> & { [K in keyof FkSignatureInput & keyof FkSignatureInputAttributes]?: FkSignatureInput[K] } & { [K in keyof FkSignatureInput & keyof FkSignatureInputAttributes as `attr:${K}`]?: FkSignatureInputAttributes[K] } & { [K in keyof FkSignatureInput & keyof FkSignatureInputAttributes as `prop:${K}`]?: FkSignatureInput[K] };
1486
+ "fk-slot-picker": Omit<FkSlotPicker, keyof FkSlotPickerAttributes> & { [K in keyof FkSlotPicker & keyof FkSlotPickerAttributes]?: FkSlotPicker[K] } & { [K in keyof FkSlotPicker & keyof FkSlotPickerAttributes as `attr:${K}`]?: FkSlotPickerAttributes[K] } & { [K in keyof FkSlotPicker & keyof FkSlotPickerAttributes as `prop:${K}`]?: FkSlotPicker[K] };
1247
1487
  "fk-stepper": Omit<FkStepper, keyof FkStepperAttributes> & { [K in keyof FkStepper & keyof FkStepperAttributes]?: FkStepper[K] } & { [K in keyof FkStepper & keyof FkStepperAttributes as `attr:${K}`]?: FkStepperAttributes[K] } & { [K in keyof FkStepper & keyof FkStepperAttributes as `prop:${K}`]?: FkStepper[K] };
1248
1488
  "fk-tabs": Omit<FkTabs, keyof FkTabsAttributes> & { [K in keyof FkTabs & keyof FkTabsAttributes]?: FkTabs[K] } & { [K in keyof FkTabs & keyof FkTabsAttributes as `attr:${K}`]?: FkTabsAttributes[K] } & { [K in keyof FkTabs & keyof FkTabsAttributes as `prop:${K}`]?: FkTabs[K] };
1249
1489
  "fk-variable-picker": FkVariablePicker;
@@ -1253,6 +1493,13 @@ export { LocalJSX as JSX };
1253
1493
  declare module "@stencil/core" {
1254
1494
  export namespace JSX {
1255
1495
  interface IntrinsicElements {
1496
+ /**
1497
+ * An address search box: what is typed is looked up after a pause, the
1498
+ * matches are listed, a pick stores the normalised address with its point.
1499
+ * Text that is never picked stays as a label without geometry, so an address
1500
+ * the provider does not know is still accepted.
1501
+ */
1502
+ "fk-address-search": LocalJSX.IntrinsicElements["fk-address-search"] & JSXBase.HTMLAttributes<HTMLFkAddressSearchElement>;
1256
1503
  "fk-brick-actions": LocalJSX.IntrinsicElements["fk-brick-actions"] & JSXBase.HTMLAttributes<HTMLFkBrickActionsElement>;
1257
1504
  "fk-brick-list": LocalJSX.IntrinsicElements["fk-brick-list"] & JSXBase.HTMLAttributes<HTMLFkBrickListElement>;
1258
1505
  "fk-brick-mold-item": LocalJSX.IntrinsicElements["fk-brick-mold-item"] & JSXBase.HTMLAttributes<HTMLFkBrickMoldItemElement>;
@@ -1282,6 +1529,13 @@ declare module "@stencil/core" {
1282
1529
  "fk-rules-editor": LocalJSX.IntrinsicElements["fk-rules-editor"] & JSXBase.HTMLAttributes<HTMLFkRulesEditorElement>;
1283
1530
  "fk-select-input": LocalJSX.IntrinsicElements["fk-select-input"] & JSXBase.HTMLAttributes<HTMLFkSelectInputElement>;
1284
1531
  "fk-signature-input": LocalJSX.IntrinsicElements["fk-signature-input"] & JSXBase.HTMLAttributes<HTMLFkSignatureInputElement>;
1532
+ /**
1533
+ * Picks an appointment slot (the event is `slotPick`: `slotChange` would collide with
1534
+ * the browser's native `slotchange` event in the JSX binding): the days that still have slots, then the slots
1535
+ * of the chosen day. Slots come from a URL (`slotsUrl`, answering a list with
1536
+ * `remaining` counts) or are generated from the opening rules.
1537
+ */
1538
+ "fk-slot-picker": LocalJSX.IntrinsicElements["fk-slot-picker"] & JSXBase.HTMLAttributes<HTMLFkSlotPickerElement>;
1285
1539
  "fk-stepper": LocalJSX.IntrinsicElements["fk-stepper"] & JSXBase.HTMLAttributes<HTMLFkStepperElement>;
1286
1540
  "fk-tabs": LocalJSX.IntrinsicElements["fk-tabs"] & JSXBase.HTMLAttributes<HTMLFkTabsElement>;
1287
1541
  /**
@@ -307,6 +307,168 @@ export declare const geoAreaBrick: {
307
307
  readonly defaultConfigs?: Record<string, unknown>;
308
308
  getBrickEmptySpec(): BrickSpec;
309
309
  };
310
+ export declare const geoAddressBrick: {
311
+ render(props: WcBrickProps): VNode;
312
+ renderBuilder(props: WcBrickProps): VNode;
313
+ getComponent(props: WcBrickProps): VNode;
314
+ getComponentWithActions(props: WcBrickProps): VNode;
315
+ readonly type: import("@streamline-pulse/formkrafter-core").BrickType;
316
+ readonly dataType: import("@streamline-pulse/formkrafter-core").JSONSchemaType;
317
+ readonly id: string;
318
+ readonly name: string;
319
+ readonly configsForm?: BrickSpec;
320
+ readonly category?: string;
321
+ readonly styles?: Record<string, unknown>;
322
+ readonly unWrapData: boolean;
323
+ readonly isPrivate: boolean;
324
+ readonly validators: import("@streamline-pulse/formkrafter-core").Validator[];
325
+ readonly defaultConfigs?: Record<string, unknown>;
326
+ getBrickEmptySpec(): BrickSpec;
327
+ };
328
+ export declare const geoLayerBrick: {
329
+ render(props: WcBrickProps): VNode;
330
+ renderBuilder(props: WcBrickProps): VNode;
331
+ getComponent(props: WcBrickProps): VNode;
332
+ getComponentWithActions(props: WcBrickProps): VNode;
333
+ readonly type: import("@streamline-pulse/formkrafter-core").BrickType;
334
+ readonly dataType: import("@streamline-pulse/formkrafter-core").JSONSchemaType;
335
+ readonly id: string;
336
+ readonly name: string;
337
+ readonly configsForm?: BrickSpec;
338
+ readonly category?: string;
339
+ readonly styles?: Record<string, unknown>;
340
+ readonly unWrapData: boolean;
341
+ readonly isPrivate: boolean;
342
+ readonly validators: import("@streamline-pulse/formkrafter-core").Validator[];
343
+ readonly defaultConfigs?: Record<string, unknown>;
344
+ getBrickEmptySpec(): BrickSpec;
345
+ };
346
+ export declare const nationalIdBrick: {
347
+ render(props: WcBrickProps): VNode;
348
+ renderBuilder(props: WcBrickProps): VNode;
349
+ getComponent(props: WcBrickProps): VNode;
350
+ getComponentWithActions(props: WcBrickProps): VNode;
351
+ readonly type: import("@streamline-pulse/formkrafter-core").BrickType;
352
+ readonly dataType: import("@streamline-pulse/formkrafter-core").JSONSchemaType;
353
+ readonly id: string;
354
+ readonly name: string;
355
+ readonly configsForm?: BrickSpec;
356
+ readonly category?: string;
357
+ readonly styles?: Record<string, unknown>;
358
+ readonly unWrapData: boolean;
359
+ readonly isPrivate: boolean;
360
+ readonly validators: import("@streamline-pulse/formkrafter-core").Validator[];
361
+ readonly defaultConfigs?: Record<string, unknown>;
362
+ getBrickEmptySpec(): BrickSpec;
363
+ };
364
+ export declare const mrzBrick: {
365
+ render(props: WcBrickProps): VNode;
366
+ renderBuilder(props: WcBrickProps): VNode;
367
+ getComponent(props: WcBrickProps): VNode;
368
+ getComponentWithActions(props: WcBrickProps): VNode;
369
+ readonly type: import("@streamline-pulse/formkrafter-core").BrickType;
370
+ readonly dataType: import("@streamline-pulse/formkrafter-core").JSONSchemaType;
371
+ readonly id: string;
372
+ readonly name: string;
373
+ readonly configsForm?: BrickSpec;
374
+ readonly category?: string;
375
+ readonly styles?: Record<string, unknown>;
376
+ readonly unWrapData: boolean;
377
+ readonly isPrivate: boolean;
378
+ readonly validators: import("@streamline-pulse/formkrafter-core").Validator[];
379
+ readonly defaultConfigs?: Record<string, unknown>;
380
+ getBrickEmptySpec(): BrickSpec;
381
+ };
382
+ export declare const taxIdBrick: {
383
+ render(props: WcBrickProps): VNode;
384
+ renderBuilder(props: WcBrickProps): VNode;
385
+ getComponent(props: WcBrickProps): VNode;
386
+ getComponentWithActions(props: WcBrickProps): VNode;
387
+ readonly type: import("@streamline-pulse/formkrafter-core").BrickType;
388
+ readonly dataType: import("@streamline-pulse/formkrafter-core").JSONSchemaType;
389
+ readonly id: string;
390
+ readonly name: string;
391
+ readonly configsForm?: BrickSpec;
392
+ readonly category?: string;
393
+ readonly styles?: Record<string, unknown>;
394
+ readonly unWrapData: boolean;
395
+ readonly isPrivate: boolean;
396
+ readonly validators: import("@streamline-pulse/formkrafter-core").Validator[];
397
+ readonly defaultConfigs?: Record<string, unknown>;
398
+ getBrickEmptySpec(): BrickSpec;
399
+ };
400
+ export declare const ibanBrick: {
401
+ render(props: WcBrickProps): VNode;
402
+ renderBuilder(props: WcBrickProps): VNode;
403
+ getComponent(props: WcBrickProps): VNode;
404
+ getComponentWithActions(props: WcBrickProps): VNode;
405
+ readonly type: import("@streamline-pulse/formkrafter-core").BrickType;
406
+ readonly dataType: import("@streamline-pulse/formkrafter-core").JSONSchemaType;
407
+ readonly id: string;
408
+ readonly name: string;
409
+ readonly configsForm?: BrickSpec;
410
+ readonly category?: string;
411
+ readonly styles?: Record<string, unknown>;
412
+ readonly unWrapData: boolean;
413
+ readonly isPrivate: boolean;
414
+ readonly validators: import("@streamline-pulse/formkrafter-core").Validator[];
415
+ readonly defaultConfigs?: Record<string, unknown>;
416
+ getBrickEmptySpec(): BrickSpec;
417
+ };
418
+ export declare const moneyBrick: {
419
+ render(props: WcBrickProps): VNode;
420
+ renderBuilder(props: WcBrickProps): VNode;
421
+ getComponent(props: WcBrickProps): VNode;
422
+ getComponentWithActions(props: WcBrickProps): VNode;
423
+ readonly type: import("@streamline-pulse/formkrafter-core").BrickType;
424
+ readonly dataType: import("@streamline-pulse/formkrafter-core").JSONSchemaType;
425
+ readonly id: string;
426
+ readonly name: string;
427
+ readonly configsForm?: BrickSpec;
428
+ readonly category?: string;
429
+ readonly styles?: Record<string, unknown>;
430
+ readonly unWrapData: boolean;
431
+ readonly isPrivate: boolean;
432
+ readonly validators: import("@streamline-pulse/formkrafter-core").Validator[];
433
+ readonly defaultConfigs?: Record<string, unknown>;
434
+ getBrickEmptySpec(): BrickSpec;
435
+ };
436
+ export declare const appointmentBrick: {
437
+ render(props: WcBrickProps): VNode;
438
+ renderBuilder(props: WcBrickProps): VNode;
439
+ getComponent(props: WcBrickProps): VNode;
440
+ getComponentWithActions(props: WcBrickProps): VNode;
441
+ readonly type: import("@streamline-pulse/formkrafter-core").BrickType;
442
+ readonly dataType: import("@streamline-pulse/formkrafter-core").JSONSchemaType;
443
+ readonly id: string;
444
+ readonly name: string;
445
+ readonly configsForm?: BrickSpec;
446
+ readonly category?: string;
447
+ readonly styles?: Record<string, unknown>;
448
+ readonly unWrapData: boolean;
449
+ readonly isPrivate: boolean;
450
+ readonly validators: import("@streamline-pulse/formkrafter-core").Validator[];
451
+ readonly defaultConfigs?: Record<string, unknown>;
452
+ getBrickEmptySpec(): BrickSpec;
453
+ };
454
+ export declare const dateRangeBrick: {
455
+ render(props: WcBrickProps): VNode;
456
+ renderBuilder(props: WcBrickProps): VNode;
457
+ getComponent(props: WcBrickProps): VNode;
458
+ getComponentWithActions(props: WcBrickProps): VNode;
459
+ readonly type: import("@streamline-pulse/formkrafter-core").BrickType;
460
+ readonly dataType: import("@streamline-pulse/formkrafter-core").JSONSchemaType;
461
+ readonly id: string;
462
+ readonly name: string;
463
+ readonly configsForm?: BrickSpec;
464
+ readonly category?: string;
465
+ readonly styles?: Record<string, unknown>;
466
+ readonly unWrapData: boolean;
467
+ readonly isPrivate: boolean;
468
+ readonly validators: import("@streamline-pulse/formkrafter-core").Validator[];
469
+ readonly defaultConfigs?: Record<string, unknown>;
470
+ getBrickEmptySpec(): BrickSpec;
471
+ };
310
472
  export declare const tabsBrick: {
311
473
  render(props: WcBrickProps): VNode;
312
474
  renderBuilder(props: WcBrickProps): VNode;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamline-pulse/formkrafter-wc",
3
- "version": "0.26.0",
3
+ "version": "0.28.0",
4
4
  "type": "module",
5
5
  "description": "FormKrafter web components (Stencil)",
6
6
  "main": "dist/components/index.js",
@@ -62,7 +62,7 @@
62
62
  "@codemirror/state": "^6.7.1",
63
63
  "@codemirror/theme-one-dark": "^6.1.3",
64
64
  "@codemirror/view": "^6.43.6",
65
- "@streamline-pulse/formkrafter-core": "0.26.0",
65
+ "@streamline-pulse/formkrafter-core": "0.28.0",
66
66
  "leaflet": "1.9.4"
67
67
  },
68
68
  "devDependencies": {
@@ -1 +0,0 @@
1
- import{t as e,p as t,H as s,c as o,h as r}from"./p-8ICOcloT.js";import{b as a,j as l,f as i}from"./p-DrMYb2JF.js";import{d as p}from"./p-BE5v8BN3.js";import{d as n}from"./p-UBqrhUH9.js";const c=t(class extends s{constructor(e){super(),!1!==e&&this.__registerHost(),this.brickConfigsChange=o(this,"brickConfigsChange"),this.brickValidationsChange=o(this,"brickValidationsChange"),this.brickStylesChange=o(this,"brickStylesChange"),this.fields=[],this.locales=[],this.activeTab="config",this.newStyleKey=""}onBrickChange(){this.availableTabs().some((e=>e.id===this.activeTab))||(this.activeTab="config")}availableTabs(){const e=[{id:"config",label:a("panel.tab.config")}];return"input"===this.brick.type&&e.push({id:"validation",label:a("panel.tab.validation")}),e.push({id:"styles",label:a("panel.tab.styles")},{id:"rules",label:a("panel.tab.rules")}),e}localized(e,t){var s;if(this.locales.length<=1)return t||void 0;const o=l(e)?Object.assign({},e):{};return"string"==typeof e&&e&&!l(e)&&(o[this.locales[0]]=e),o[null!==(s=this.editLocale)&&void 0!==s?s:this.locales[0]]=t,o}readLocalized(e){var t,s,o;return l(e)?null!==(s=e[null!==(t=this.editLocale)&&void 0!==t?t:this.locales[0]])&&void 0!==s?s:"":null!==(o=e)&&void 0!==o?o:""}writeTextConfig(e,t){var s;this.emitConfigs({[e]:this.localized(null===(s=this.brick.configs)||void 0===s?void 0:s[e],t)})}emitConfigs(e){this.path&&this.brickConfigsChange.emit({configs:e,path:this.path})}emitValidations(e){this.path&&this.brickValidationsChange.emit({validations:e,path:this.path})}emitStyles(e){this.path&&this.brickStylesChange.emit({styles:e,path:this.path})}validationOf(e){var t;return null===(t=this.brick.validations)||void 0===t?void 0:t.find((t=>t.validator===e))}setValidation(e,t,s={}){var o;const r=this.validationOf(e),a=(null!==(o=this.brick.validations)&&void 0!==o?o:[]).filter((t=>t.validator!==e));this.emitValidations(t?[...a,Object.assign(Object.assign(Object.assign({},r),{validator:e}),s)]:a)}addStyle(e){const t=this.newStyleKey.trim();t&&(this.emitStyles({[t]:e}),this.newStyleKey="")}textField(e,t,s){var o;return r("label",{class:"fk-props__field"},r("span",{class:"fk-props__label"},e),r("input",{class:"fk-props__input",type:"text",value:null!==(o=t)&&void 0!==o?o:"",onChange:e=>s(e.target.value)}))}optionsFields(){var e,t,s;const o=this.brick.configs;if(!o||!("options"in o)&&!("optionsSource"in o))return[];const l="optionsSource"in o,i=l&&null!==(e=o.optionsSource)&&void 0!==e?e:"static",p=l?[r("label",{class:"fk-props__field"},r("span",{class:"fk-props__label"},a("panel.optionsSource")),r("select",{class:"fk-props__input",onChange:e=>this.emitConfigs({optionsSource:e.target.value})},["static","dataMap","remote","js","catalog"].map((e=>r("option",{value:e,selected:e===i},e)))))]:[];return"static"===i&&p.push(r("label",{class:"fk-props__field"},r("span",{class:"fk-props__label"},a("panel.options")),r("textarea",{class:"fk-props__input fk-props__input--textarea",onChange:e=>this.writeTextConfig("options",e.target.value)},this.readLocalized(o.options)))),"dataMap"===i&&p.push(this.textField(a("panel.dataKey"),o.optionsPath,(e=>this.emitConfigs({optionsPath:e})))),"remote"===i&&p.push(this.textField(a("panel.url"),o.optionsUrl,(e=>this.emitConfigs({optionsUrl:e}))),this.textField(a("panel.responsePath"),o.optionsPath,(e=>this.emitConfigs({optionsPath:e||void 0}))),r("label",{class:"fk-props__field"},r("span",{class:"fk-props__label"},a("panel.headers")),r("textarea",{class:"fk-props__input fk-props__input--textarea",placeholder:"Authorization: Bearer {token}",onChange:e=>this.emitConfigs({optionsHeaders:e.target.value||void 0})},null!==(t=o.optionsHeaders)&&void 0!==t?t:"")),this.textField(a("panel.searchParam"),o.searchParam,(e=>this.emitConfigs({searchParam:e||void 0})))),"js"===i&&p.push(r("label",{class:"fk-props__field"},r("span",{class:"fk-props__label"},"Code"),r("fk-code-editor",{completions:this.fields,value:null!==(s=o.optionsCode)&&void 0!==s?s:"",placeholder:"return dataMap.country === 'BJ' ? ['Cotonou'] : ['Paris'];",onCodeChange:e=>this.emitConfigs({optionsCode:e.detail})}))),"catalog"===i&&p.push(this.textField(a("panel.optionsRef"),o.optionsRef,(e=>this.emitConfigs({optionsRef:e})))),"remote"!==i&&"js"!==i&&"catalog"!==i||p.push(this.textField(a("panel.labelKey"),o.labelKey,(e=>this.emitConfigs({labelKey:e}))),this.textField(a("panel.valueKey"),o.valueKey,(e=>this.emitConfigs({valueKey:e})))),p}renderConfigTab(){const e=this.brick.configs,t="input"===this.brick.type;return r("section",{class:"fk-props__section"},this.textField(a("panel.key"),null==e?void 0:e.key,(e=>this.emitConfigs({key:e}))),this.textField(a("panel.label"),this.readLocalized(null==e?void 0:e.label),(e=>this.writeTextConfig("label",e))),t?[this.textField(a("panel.placeholder"),this.readLocalized(null==e?void 0:e.placeholder),(e=>this.writeTextConfig("placeholder",e))),this.textField(a("panel.prefix"),null==e?void 0:e.prefix,(e=>this.emitConfigs({prefix:e||void 0}))),this.textField(a("panel.suffix"),null==e?void 0:e.suffix,(e=>this.emitConfigs({suffix:e||void 0})))]:null,e&&"specRef"in e?this.textField(i("panel.specRef","Referenced form (specRef)"),e.specRef,(e=>this.emitConfigs({specRef:e}))):null,e&&"mask"in e?this.textField(i("panel.mask","Input mask (9=digit, a=letter, *=any)"),e.mask,(e=>this.emitConfigs({mask:e}))):null,e&&"tileUrl"in e?[this.textField(i("panel.center","Initial center (lat, lng)"),e.center,(e=>this.emitConfigs({center:e}))),this.textField(i("panel.zoom","Initial zoom"),e.zoom,(e=>this.emitConfigs({zoom:""===e?void 0:Number(e)}))),this.textField(i("panel.height","Height (px)"),e.height,(e=>this.emitConfigs({height:""===e?void 0:Number(e)}))),this.textField(i("panel.tileUrl","Tile URL"),e.tileUrl,(e=>this.emitConfigs({tileUrl:e}))),"shape"in e?this.textField(i("panel.shape","Shape (polygon or line)"),e.shape,(e=>this.emitConfigs({shape:"line"===e?"line":"polygon"}))):null]:null,e&&"accept"in e?this.textField(i("panel.accept","Accepted file types"),e.accept,(e=>this.emitConfigs({accept:e}))):null,e&&"uploadUrl"in e?this.textField(i("panel.uploadUrl","Upload URL"),e.uploadUrl,(e=>this.emitConfigs({uploadUrl:e}))):null,this.optionsFields(),Object.entries(null!=e?e:{}).filter((([,e])=>"boolean"==typeof e)).map((([e,t])=>r("label",{class:"fk-props__field fk-props__field--inline",key:e},r("input",{type:"checkbox",checked:!0===t,onChange:t=>this.emitConfigs({[e]:t.target.checked})}),r("span",{class:"fk-props__label"},i(`panel.cfg.${e}`,e))))),e&&"content"in e?r("label",{class:"fk-props__field"},r("span",{class:"fk-props__label"},a("panel.content")),r("textarea",{class:"fk-props__input fk-props__input--textarea",onChange:e=>this.writeTextConfig("content",e.target.value)},this.readLocalized(e.content))):null)}validationRow(e,t,s){const o=this.validationOf(e);return r("div",{class:"fk-props__vrule"},r("label",{class:"fk-props__field fk-props__field--inline"},r("input",{type:"checkbox",checked:!!o,onChange:t=>this.setValidation(e,t.target.checked)}),r("span",{class:"fk-props__label"},t)),o&&s?r("input",{class:"fk-props__input",type:s,placeholder:"number"===s?"value":"regex",value:null==o.value?"":String(o.value),onChange:t=>{const o=t.target.value;this.setValidation(e,!0,{value:"number"===s?""===o?void 0:Number(o):o||void 0})}}):null,o?this.textField(a("panel.errorMessage"),this.readLocalized(o.message),(t=>this.setValidation(e,!0,{message:this.localized(o.message,t)}))):null)}renderValidationTab(){var e;const t=this.brick.dataType,s=this.validationOf("custom");return r("section",{class:"fk-props__section"},this.validationRow("required",a("panel.required")),"string"===t?[this.validationRow("minLength",a("panel.minLength"),"number"),this.validationRow("maxLength",a("panel.maxLength"),"number"),this.validationRow("pattern",a("panel.pattern"),"text"),this.validationRow("email",a("panel.emailFormat")),this.validationRow("url",a("panel.urlFormat"))]:null,"number"===t?[this.validationRow("min",a("panel.min"),"number"),this.validationRow("max",a("panel.max"),"number")]:null,"array"===t?[this.validationRow("minItems",a("panel.minItems"),"number"),this.validationRow("maxItems",a("panel.maxItems"),"number")]:null,r("div",{class:"fk-props__vrule"},r("label",{class:"fk-props__field fk-props__field--inline"},r("input",{type:"checkbox",checked:!!s,onChange:e=>{var t;return this.setValidation("custom",e.target.checked,{customValidator:null!==(t=null==s?void 0:s.customValidator)&&void 0!==t?t:"return true;"})}}),r("span",{class:"fk-props__label"},a("panel.custom"))),s?r("fk-code-editor",{completions:this.fields,value:null!==(e=s.customValidator)&&void 0!==e?e:"",placeholder:'return value?.startsWith("BJ-") ? true : "Must start with BJ-";',onCodeChange:e=>this.setValidation("custom",!0,{customValidator:e.detail})}):null,s?this.textField(a("panel.fallbackMessage"),this.readLocalized(s.message),(e=>this.setValidation("custom",!0,{message:this.localized(s.message,e)}))):null))}renderStylesTab(){var e;return r("section",{class:"fk-props__section"},Object.entries(null!==(e=this.brick.styles)&&void 0!==e?e:{}).map((([e,t])=>r("div",{class:"fk-props__style-row",key:e},r("span",{class:"fk-props__style-key"},e),r("input",{class:"fk-props__input fk-props__input--grow",type:"text",value:String(null!=t?t:""),onChange:t=>this.emitStyles({[e]:t.target.value})}),r("button",{type:"button",class:"fk-props__remove",title:"Remove style",onClick:()=>this.emitStyles({[e]:void 0})},"✕")))),r("div",{class:"fk-props__style-row"},r("input",{class:"fk-props__input",type:"text",placeholder:a("panel.styleProperty"),value:this.newStyleKey,onInput:e=>this.newStyleKey=e.target.value}),r("input",{class:"fk-props__input fk-props__input--grow",type:"text",placeholder:a("panel.styleValue"),onChange:e=>{const t=e.target;this.addStyle(t.value),t.value=""}})))}render(){return r("div",{key:"30efca5722cb5978d6002b19fb49fbda7ea22d96",class:"fk-props"},r("header",{key:"5702bff6561c3ce700ac58487f869ca773a30ad2",class:"fk-props__header"},r("span",{key:"8b4ea09dbb52af383fc64f51e1928992156cf38a",class:"fk-props__type"},this.brick.type),r("h4",{key:"2f94daa6ad56a004eb17ea0aee65ba2f253cc08a",class:"fk-props__title"},i(`brick.${this.brick.id}.name`,this.brick.name))),r("div",{key:"04f9a4392708cb8bce3f6c0d1508e2de792423b8",class:"fk-props__tabs"},this.availableTabs().map((e=>r("button",{key:e.id,type:"button",class:{"fk-props__tab":!0,"fk-props__tab--active":this.activeTab===e.id},onClick:()=>this.activeTab=e.id},e.label)))),"config"===this.activeTab?this.renderConfigTab():null,"validation"===this.activeTab?this.renderValidationTab():null,"styles"===this.activeTab?this.renderStylesTab():null,"rules"===this.activeTab?r("section",{class:"fk-props__section"},r("fk-rules-editor",{brick:this.brick,path:this.path,fields:this.fields})):null)}static get watchers(){return{brick:[{onBrickChange:0}]}}static get style(){return".sc-fk-property-panel-h{display:block}.fk-props.sc-fk-property-panel{display:flex;flex-direction:column;gap:calc(var(--fk-spacing) * 1.5)}.fk-props__header.sc-fk-property-panel{display:flex;flex-direction:column;gap:2px}.fk-props__type.sc-fk-property-panel{font-size:0.65rem;font-weight:700;text-transform:uppercase;letter-spacing:0.08em;color:var(--fk-color-primary)}.fk-props__title.sc-fk-property-panel{margin:0;font-size:0.95rem;color:var(--fk-color-text)}.fk-props__section.sc-fk-property-panel{display:flex;flex-direction:column;gap:var(--fk-spacing);padding-top:var(--fk-spacing)}.fk-props__tabs.sc-fk-property-panel{display:flex;gap:2px;border-bottom:1px solid var(--fk-color-border)}.fk-props__tab.sc-fk-property-panel{font:inherit;font-size:0.72rem;font-weight:600;padding:5px 9px;border:none;border-bottom:2px solid transparent;border-radius:0;background:transparent;color:var(--fk-color-muted);text-transform:none;letter-spacing:normal;cursor:pointer}.fk-props__tab.sc-fk-property-panel:hover{color:var(--fk-color-text)}.fk-props__tab--active.sc-fk-property-panel{color:var(--fk-color-primary);border-bottom-color:var(--fk-color-primary)}.fk-props__section-title.sc-fk-property-panel{margin:0;font-size:0.7rem;font-weight:700;text-transform:uppercase;letter-spacing:0.08em;color:var(--fk-color-muted)}.fk-props__field.sc-fk-property-panel{display:flex;flex-direction:column;gap:4px;font-style:normal;text-decoration:none}.fk-props__field--inline.sc-fk-property-panel{flex-direction:row;align-items:center;gap:8px}.fk-props__label.sc-fk-property-panel{font-size:0.75rem;font-weight:600;color:var(--fk-color-muted);font-style:normal;text-decoration:none}.fk-props__input.sc-fk-property-panel{font:inherit;font-size:0.85rem;padding:6px 8px;border:1px solid var(--fk-color-border);border-radius:calc(var(--fk-radius) / 2);background:var(--fk-color-surface);color:var(--fk-color-text)}.fk-props__input.sc-fk-property-panel:focus{outline:none;border-color:var(--fk-color-primary);box-shadow:0 0 0 2px color-mix(in srgb, var(--fk-color-primary) 20%, transparent)}.fk-props__input--textarea.sc-fk-property-panel{min-height:72px;resize:vertical}.fk-props__vrule.sc-fk-property-panel{display:flex;flex-direction:column;gap:6px;padding:calc(var(--fk-spacing) / 1.5);border:1px solid var(--fk-color-border);border-radius:calc(var(--fk-radius) / 1.5)}.fk-props__style-row.sc-fk-property-panel{display:flex;align-items:center;gap:6px}.fk-props__style-key.sc-fk-property-panel{font-family:ui-monospace, SFMono-Regular, Menlo, monospace;font-size:0.75rem;color:var(--fk-color-text);min-width:72px}.fk-props__input--grow.sc-fk-property-panel{flex:1;min-width:0}.fk-props__remove.sc-fk-property-panel{border:none;background:transparent;color:var(--fk-color-muted);font-size:0.75rem;cursor:pointer;padding:2px 4px;border-radius:calc(var(--fk-radius) / 2)}.fk-props__remove.sc-fk-property-panel:hover{color:var(--fk-color-danger);background:color-mix(in srgb, var(--fk-color-danger) 10%, transparent)}"}},[2,"fk-property-panel",{brick:[16],path:[1],fields:[16],locales:[16],locale:[1],editLocale:[1,"edit-locale"],activeTab:[32],newStyleKey:[32]},void 0,{brick:[{onBrickChange:0}]}]);function f(){"undefined"!=typeof customElements&&["fk-property-panel","fk-code-editor","fk-rules-editor"].forEach((t=>{switch(t){case"fk-property-panel":customElements.get(e(t))||customElements.define(e(t),c);break;case"fk-code-editor":customElements.get(e(t))||p();break;case"fk-rules-editor":customElements.get(e(t))||n()}}))}f();export{c as F,f as d}
@@ -1 +0,0 @@
1
- import{t,p as s,H as a,c as e,h as i}from"./p-8ICOcloT.js";import{o,v as r}from"./p-DrMYb2JF.js";const n=s(class extends a{constructor(t){super(),!1!==t&&this.__registerHost(),this.stepTouch=e(this,"stepTouch"),this.tabLabels=[],this.editable=!1,this.active=0}clampActive(){this.active>Math.max(this.tabLabels.length-1,0)&&(this.active=0)}componentDidRender(){const t=this.host.querySelector(".fk-tabs__body");t&&Array.from(t.children).forEach(((t,s)=>{const a=t;this.editable?a.style.removeProperty("display"):a.style.display=s===this.active?"":"none"}))}validateTabs(){var t,s;return!0===(null===(s=null===(t=this.spec)||void 0===t?void 0:t.configs)||void 0===s?void 0:s.validateTabs)}tabSpec(t){var s,a,e;const i=null===(a=null===(s=this.spec)||void 0===s?void 0:s.children)||void 0===a?void 0:a[t];if(i&&this.spec)return(null===(e=this.tabCache)||void 0===e?void 0:e.source)!==this.spec&&(this.tabCache={source:this.spec,specs:[]}),this.tabCache.specs[t]||(this.tabCache.specs[t]={type:"panel",id:"tab",name:"Tab",configs:{key:`tab_${t}`},children:[i]}),this.tabCache.specs[t]}tabKeys(t){var s,a,e;const i=null===(a=null===(s=this.spec)||void 0===s?void 0:s.children)||void 0===a?void 0:a[t];if(!i)return[];const r=[];for(const t of o(i))(null===(e=t.configs)||void 0===e?void 0:e.key)&&r.push(t.configs.key);return r}tabValid(t){var s;const a=this.tabSpec(t);if(!a)return!0;const e=Object.fromEntries(Object.entries(null!==(s=this.dataMap)&&void 0!==s?s:{}).filter((([,t])=>""!==t&&null!=t)));return r(a,e,this.locale).valid}goToTab(t){t!==this.active&&(this.editable||!this.validateTabs()||this.tabValid(this.active)?this.active=t:this.stepTouch.emit({keys:this.tabKeys(this.active)}))}render(){return i("div",{key:"cf767982d487933d1e73b7e2ce8eb28ceb8cf815",class:"fk-tabs"},i("div",{key:"9f42d561ee00d74e7946a0da17948b2460637bbf",class:"fk-tabs__nav",role:"tablist"},this.tabLabels.map(((t,s)=>i("button",{key:`${s}-${t}`,type:"button",role:"tab","aria-selected":s===this.active?"true":"false",tabIndex:s===this.active?0:-1,class:{"fk-tabs__tab":!0,"fk-tabs__tab--active":s===this.active},onKeyDown:t=>{const a=this.tabLabels.length;!a||"ArrowRight"!==t.key&&"ArrowLeft"!==t.key||(t.preventDefault(),this.goToTab((s+("ArrowRight"===t.key?1:-1)+a)%a),requestAnimationFrame((()=>{var t;null===(t=this.host.querySelector(".fk-tabs__tab--active"))||void 0===t||t.focus()})))},onClick:t=>{t.preventDefault(),this.goToTab(s)}},t)))),i("div",{key:"6c9ea54312cdac931af757109d546b5dded27dbc",class:"fk-tabs__body"},i("slot",{key:"245d9bd9763752ec9124d67fbf736922a66eede3"})))}get host(){return this}static get watchers(){return{tabLabels:[{clampActive:0}]}}static get style(){return".sc-fk-tabs-h{display:block}.fk-tabs.sc-fk-tabs{display:flex;flex-direction:column;gap:var(--fk-spacing)}.fk-tabs__nav.sc-fk-tabs{display:flex;flex-wrap:wrap;gap:2px;border-bottom:1px solid var(--fk-color-border)}.fk-tabs__tab.sc-fk-tabs{font:inherit;font-size:0.85rem;font-weight:500;padding:calc(var(--fk-spacing) / 1.5) var(--fk-spacing);min-height:24px;border:none;border-bottom:2px solid transparent;border-radius:0;background:transparent;color:var(--fk-color-muted);text-transform:none;letter-spacing:normal;cursor:pointer}.fk-tabs__tab.sc-fk-tabs:hover{color:var(--fk-color-text)}.fk-tabs__tab--active.sc-fk-tabs{color:var(--fk-color-primary);border-bottom-color:var(--fk-color-primary);font-weight:600}"}},[262,"fk-tabs",{tabLabels:[16],editable:[4],spec:[16],dataMap:[16],locale:[1],active:[32]},void 0,{tabLabels:[{clampActive:0}]}]);function c(){"undefined"!=typeof customElements&&["fk-tabs"].forEach((s=>{"fk-tabs"===s&&(customElements.get(t(s))||customElements.define(t(s),n))}))}c();export{n as F,c as d}