@streamline-pulse/formkrafter-wc 0.24.0 → 0.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/fk-brick-actions.js +1 -1
- package/dist/components/fk-brick-list.js +1 -1
- package/dist/components/fk-brick-mold-item.js +1 -1
- package/dist/components/fk-brick-not-found.js +1 -1
- package/dist/components/fk-brick-render.js +1 -1
- package/dist/components/fk-code-editor.js +1 -1
- package/dist/components/fk-data-grid.js +1 -1
- package/dist/components/fk-drop-area.js +1 -1
- package/dist/components/fk-empty-form.js +1 -1
- package/dist/components/fk-file-input.js +1 -1
- package/dist/components/fk-form-builder.js +1 -1
- package/dist/components/fk-form-render.js +1 -1
- package/dist/components/fk-form-review.js +1 -1
- package/dist/components/fk-geo-map.d.ts +11 -0
- package/dist/components/fk-geo-map.js +1 -0
- package/dist/components/fk-property-panel.js +1 -1
- package/dist/components/fk-rules-editor.js +1 -1
- package/dist/components/fk-select-input.js +1 -1
- package/dist/components/fk-signature-input.js +1 -1
- package/dist/components/fk-stepper.js +1 -1
- package/dist/components/fk-tabs.js +1 -1
- package/dist/components/fk-variable-picker.d.ts +11 -0
- package/dist/components/fk-variable-picker.js +1 -0
- package/dist/components/index.js +1 -1
- package/dist/components/p-2CyX0nUR.js +1 -0
- package/dist/components/p-8ICOcloT.js +1 -0
- package/dist/components/{p-CIGtlYQn.js → p-BE5v8BN3.js} +1 -1
- package/dist/components/{p-DGScbbLx.js → p-BNgstTrs.js} +1 -1
- package/dist/components/{p-MGQtftHl.js → p-BYnOpgog.js} +1 -1
- package/dist/components/{p-XP4h_v8Q.js → p-BiRWoCM5.js} +1 -1
- package/dist/components/{p-1_c29Rag.js → p-C1QFqyCY.js} +1 -1
- package/dist/components/p-CRwXPnZM.js +1 -0
- package/dist/components/{p-KYwjk9Yt.js → p-CWB1pV6F.js} +1 -1
- package/dist/components/{p-BpDsZSJX.js → p-Ca6m8UMG.js} +1 -1
- package/dist/components/{p-DCKXkdxG.js → p-D4AIlVj7.js} +1 -1
- package/dist/components/p-DGWNeoAv.js +1 -0
- package/dist/components/{p-CgWxWEuI.js → p-DXpuft_B.js} +1 -1
- package/dist/components/p-Dijf1OvK.js +1 -0
- package/dist/components/{p-D6WtQeaQ.js → p-DrMYb2JF.js} +1 -1
- package/dist/components/p-Ri4dmHJc.js +5 -0
- package/dist/components/{p-0sDICgJ3.js → p-UBqrhUH9.js} +1 -1
- package/dist/components/{p-BPwPAGJq.js → p-_r5Y7ZTv.js} +1 -1
- package/dist/components/{p-DLYnonbs.js → p-fyNpcz6u.js} +1 -1
- package/dist/components/p-n1ZfmAbp.js +1 -0
- package/dist/components/{p-DzPxItO6.js → p-yL2ezQGT.js} +1 -1
- package/dist/formkrafter-wc/formkrafter-wc.css +1 -1
- package/dist/formkrafter-wc/formkrafter-wc.esm.js +1 -1
- package/dist/formkrafter-wc/index.esm.js +1 -1
- package/dist/formkrafter-wc/{p-7kO7VDbG.js → p-0--P75z3.js} +1 -1
- package/dist/formkrafter-wc/{p-7bf6a9d1.entry.js → p-65431291.entry.js} +1 -1
- package/dist/formkrafter-wc/p-71246548.entry.js +1 -0
- package/dist/formkrafter-wc/p-BDqOS1za.js +2 -0
- package/dist/formkrafter-wc/p-CI3OKuAu.js +5 -0
- package/dist/formkrafter-wc/p-c6783c00.entry.js +1 -0
- package/dist/types/components/fk-geo-map/fk-geo-map.d.ts +63 -0
- package/dist/types/components/fk-variable-picker/fk-variable-picker.d.ts +33 -0
- package/dist/types/components.d.ts +204 -0
- package/dist/types/registry/default-bricks.d.ts +36 -0
- package/package.json +4 -2
- package/dist/components/p-B29HakDD.js +0 -1
- package/dist/components/p-BOZ5pg73.js +0 -1
- package/dist/components/p-BTxz9ZnS.js +0 -1
- package/dist/components/p-_yrgEKkN.js +0 -1
- package/dist/formkrafter-wc/p-0521c981.entry.js +0 -1
- package/dist/formkrafter-wc/p-0a5ee682.entry.js +0 -1
- package/dist/formkrafter-wc/p-C7Z9P9uL.js +0 -2
|
@@ -7,8 +7,12 @@
|
|
|
7
7
|
import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
|
|
8
8
|
import { BrickConfigsChangeDetail, BrickDropDetail, BrickPathDetail, BrickReviewChangeDetail, BrickRulesChangeDetail, BrickStylesChangeDetail, BrickValidationsChangeDetail, DataChangeDetail, ReviewChangeDetail, SpecChangeDetail, ValidityChangeDetail } from "./utils/events";
|
|
9
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";
|
|
11
|
+
import { FkVariable } from "./components/fk-variable-picker/fk-variable-picker";
|
|
10
12
|
export { BrickConfigsChangeDetail, BrickDropDetail, BrickPathDetail, BrickReviewChangeDetail, BrickRulesChangeDetail, BrickStylesChangeDetail, BrickValidationsChangeDetail, DataChangeDetail, ReviewChangeDetail, SpecChangeDetail, ValidityChangeDetail } from "./utils/events";
|
|
11
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";
|
|
15
|
+
export { FkVariable } from "./components/fk-variable-picker/fk-variable-picker";
|
|
12
16
|
export namespace Components {
|
|
13
17
|
interface FkBrickActions {
|
|
14
18
|
"path": string;
|
|
@@ -194,6 +198,52 @@ export namespace Components {
|
|
|
194
198
|
"reviews"?: FieldAnnotations;
|
|
195
199
|
"spec": BrickSpec;
|
|
196
200
|
}
|
|
201
|
+
/**
|
|
202
|
+
* A Leaflet map that edits one GeoJSON geometry: a point, a polygon or a
|
|
203
|
+
* line. Leaflet is loaded on first use so forms without a map stay light.
|
|
204
|
+
* The value also stays editable without the map: a point has latitude and
|
|
205
|
+
* longitude inputs, so the field works when tiles cannot load.
|
|
206
|
+
*/
|
|
207
|
+
interface FkGeoMap {
|
|
208
|
+
/**
|
|
209
|
+
* @default '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
|
|
210
|
+
*/
|
|
211
|
+
"attribution": string;
|
|
212
|
+
/**
|
|
213
|
+
* Initial view as [latitude, longitude], used when there is no value yet.
|
|
214
|
+
*/
|
|
215
|
+
"center"?: [number, number];
|
|
216
|
+
/**
|
|
217
|
+
* @default false
|
|
218
|
+
*/
|
|
219
|
+
"disabled": boolean;
|
|
220
|
+
/**
|
|
221
|
+
* @default 320
|
|
222
|
+
*/
|
|
223
|
+
"height": number;
|
|
224
|
+
/**
|
|
225
|
+
* Show latitude and longitude inputs under a point map.
|
|
226
|
+
* @default true
|
|
227
|
+
*/
|
|
228
|
+
"manual": boolean;
|
|
229
|
+
/**
|
|
230
|
+
* @default 'point'
|
|
231
|
+
*/
|
|
232
|
+
"mode": GeoMode;
|
|
233
|
+
/**
|
|
234
|
+
* @default false
|
|
235
|
+
*/
|
|
236
|
+
"readOnly": boolean;
|
|
237
|
+
/**
|
|
238
|
+
* @default 'https://tile.openstreetmap.org/{z}/{x}/{y}.png'
|
|
239
|
+
*/
|
|
240
|
+
"tileUrl": string;
|
|
241
|
+
"value"?: GeoGeometry;
|
|
242
|
+
/**
|
|
243
|
+
* @default 6
|
|
244
|
+
*/
|
|
245
|
+
"zoom": number;
|
|
246
|
+
}
|
|
197
247
|
interface FkPropertyPanel {
|
|
198
248
|
"brick": BrickSpec;
|
|
199
249
|
"editLocale"?: string;
|
|
@@ -271,6 +321,18 @@ export namespace Components {
|
|
|
271
321
|
*/
|
|
272
322
|
"tabLabels": string[];
|
|
273
323
|
}
|
|
324
|
+
/**
|
|
325
|
+
* Suggests template variables inside the text control that precedes it.
|
|
326
|
+
* Typing `{{` opens the list, the text after it filters, Enter or a click
|
|
327
|
+
* inserts `{{name}}` in place of what was typed. The host form passes the
|
|
328
|
+
* variables through its context as `_variables`.
|
|
329
|
+
*/
|
|
330
|
+
interface FkVariablePicker {
|
|
331
|
+
/**
|
|
332
|
+
* @default []
|
|
333
|
+
*/
|
|
334
|
+
"variables": FkVariable[];
|
|
335
|
+
}
|
|
274
336
|
}
|
|
275
337
|
export interface FkBrickActionsCustomEvent<T> extends CustomEvent<T> {
|
|
276
338
|
detail: T;
|
|
@@ -308,6 +370,10 @@ export interface FkFormReviewCustomEvent<T> extends CustomEvent<T> {
|
|
|
308
370
|
detail: T;
|
|
309
371
|
target: HTMLFkFormReviewElement;
|
|
310
372
|
}
|
|
373
|
+
export interface FkGeoMapCustomEvent<T> extends CustomEvent<T> {
|
|
374
|
+
detail: T;
|
|
375
|
+
target: HTMLFkGeoMapElement;
|
|
376
|
+
}
|
|
311
377
|
export interface FkPropertyPanelCustomEvent<T> extends CustomEvent<T> {
|
|
312
378
|
detail: T;
|
|
313
379
|
target: HTMLFkPropertyPanelElement;
|
|
@@ -332,6 +398,10 @@ export interface FkTabsCustomEvent<T> extends CustomEvent<T> {
|
|
|
332
398
|
detail: T;
|
|
333
399
|
target: HTMLFkTabsElement;
|
|
334
400
|
}
|
|
401
|
+
export interface FkVariablePickerCustomEvent<T> extends CustomEvent<T> {
|
|
402
|
+
detail: T;
|
|
403
|
+
target: HTMLFkVariablePickerElement;
|
|
404
|
+
}
|
|
335
405
|
declare global {
|
|
336
406
|
interface HTMLFkBrickActionsElementEventMap {
|
|
337
407
|
"brickRemove": BrickPathDetail;
|
|
@@ -528,6 +598,29 @@ declare global {
|
|
|
528
598
|
prototype: HTMLFkFormReviewElement;
|
|
529
599
|
new (): HTMLFkFormReviewElement;
|
|
530
600
|
};
|
|
601
|
+
interface HTMLFkGeoMapElementEventMap {
|
|
602
|
+
"geoChange": GeoGeometry | undefined;
|
|
603
|
+
}
|
|
604
|
+
/**
|
|
605
|
+
* A Leaflet map that edits one GeoJSON geometry: a point, a polygon or a
|
|
606
|
+
* line. Leaflet is loaded on first use so forms without a map stay light.
|
|
607
|
+
* The value also stays editable without the map: a point has latitude and
|
|
608
|
+
* longitude inputs, so the field works when tiles cannot load.
|
|
609
|
+
*/
|
|
610
|
+
interface HTMLFkGeoMapElement extends Components.FkGeoMap, HTMLStencilElement {
|
|
611
|
+
addEventListener<K extends keyof HTMLFkGeoMapElementEventMap>(type: K, listener: (this: HTMLFkGeoMapElement, ev: FkGeoMapCustomEvent<HTMLFkGeoMapElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
|
|
612
|
+
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
613
|
+
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
614
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
615
|
+
removeEventListener<K extends keyof HTMLFkGeoMapElementEventMap>(type: K, listener: (this: HTMLFkGeoMapElement, ev: FkGeoMapCustomEvent<HTMLFkGeoMapElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
|
|
616
|
+
removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
617
|
+
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
618
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
619
|
+
}
|
|
620
|
+
var HTMLFkGeoMapElement: {
|
|
621
|
+
prototype: HTMLFkGeoMapElement;
|
|
622
|
+
new (): HTMLFkGeoMapElement;
|
|
623
|
+
};
|
|
531
624
|
interface HTMLFkPropertyPanelElementEventMap {
|
|
532
625
|
"brickConfigsChange": BrickConfigsChangeDetail;
|
|
533
626
|
"brickValidationsChange": BrickValidationsChangeDetail;
|
|
@@ -633,6 +726,29 @@ declare global {
|
|
|
633
726
|
prototype: HTMLFkTabsElement;
|
|
634
727
|
new (): HTMLFkTabsElement;
|
|
635
728
|
};
|
|
729
|
+
interface HTMLFkVariablePickerElementEventMap {
|
|
730
|
+
"variablePick": string;
|
|
731
|
+
}
|
|
732
|
+
/**
|
|
733
|
+
* Suggests template variables inside the text control that precedes it.
|
|
734
|
+
* Typing `{{` opens the list, the text after it filters, Enter or a click
|
|
735
|
+
* inserts `{{name}}` in place of what was typed. The host form passes the
|
|
736
|
+
* variables through its context as `_variables`.
|
|
737
|
+
*/
|
|
738
|
+
interface HTMLFkVariablePickerElement extends Components.FkVariablePicker, HTMLStencilElement {
|
|
739
|
+
addEventListener<K extends keyof HTMLFkVariablePickerElementEventMap>(type: K, listener: (this: HTMLFkVariablePickerElement, ev: FkVariablePickerCustomEvent<HTMLFkVariablePickerElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
|
|
740
|
+
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
741
|
+
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
742
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
743
|
+
removeEventListener<K extends keyof HTMLFkVariablePickerElementEventMap>(type: K, listener: (this: HTMLFkVariablePickerElement, ev: FkVariablePickerCustomEvent<HTMLFkVariablePickerElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
|
|
744
|
+
removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
745
|
+
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
746
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
747
|
+
}
|
|
748
|
+
var HTMLFkVariablePickerElement: {
|
|
749
|
+
prototype: HTMLFkVariablePickerElement;
|
|
750
|
+
new (): HTMLFkVariablePickerElement;
|
|
751
|
+
};
|
|
636
752
|
interface HTMLElementTagNameMap {
|
|
637
753
|
"fk-brick-actions": HTMLFkBrickActionsElement;
|
|
638
754
|
"fk-brick-list": HTMLFkBrickListElement;
|
|
@@ -647,12 +763,14 @@ declare global {
|
|
|
647
763
|
"fk-form-builder": HTMLFkFormBuilderElement;
|
|
648
764
|
"fk-form-render": HTMLFkFormRenderElement;
|
|
649
765
|
"fk-form-review": HTMLFkFormReviewElement;
|
|
766
|
+
"fk-geo-map": HTMLFkGeoMapElement;
|
|
650
767
|
"fk-property-panel": HTMLFkPropertyPanelElement;
|
|
651
768
|
"fk-rules-editor": HTMLFkRulesEditorElement;
|
|
652
769
|
"fk-select-input": HTMLFkSelectInputElement;
|
|
653
770
|
"fk-signature-input": HTMLFkSignatureInputElement;
|
|
654
771
|
"fk-stepper": HTMLFkStepperElement;
|
|
655
772
|
"fk-tabs": HTMLFkTabsElement;
|
|
773
|
+
"fk-variable-picker": HTMLFkVariablePickerElement;
|
|
656
774
|
}
|
|
657
775
|
}
|
|
658
776
|
declare namespace LocalJSX {
|
|
@@ -869,6 +987,53 @@ declare namespace LocalJSX {
|
|
|
869
987
|
"reviews"?: FieldAnnotations;
|
|
870
988
|
"spec": BrickSpec;
|
|
871
989
|
}
|
|
990
|
+
/**
|
|
991
|
+
* A Leaflet map that edits one GeoJSON geometry: a point, a polygon or a
|
|
992
|
+
* line. Leaflet is loaded on first use so forms without a map stay light.
|
|
993
|
+
* The value also stays editable without the map: a point has latitude and
|
|
994
|
+
* longitude inputs, so the field works when tiles cannot load.
|
|
995
|
+
*/
|
|
996
|
+
interface FkGeoMap {
|
|
997
|
+
/**
|
|
998
|
+
* @default '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
|
|
999
|
+
*/
|
|
1000
|
+
"attribution"?: string;
|
|
1001
|
+
/**
|
|
1002
|
+
* Initial view as [latitude, longitude], used when there is no value yet.
|
|
1003
|
+
*/
|
|
1004
|
+
"center"?: [number, number];
|
|
1005
|
+
/**
|
|
1006
|
+
* @default false
|
|
1007
|
+
*/
|
|
1008
|
+
"disabled"?: boolean;
|
|
1009
|
+
/**
|
|
1010
|
+
* @default 320
|
|
1011
|
+
*/
|
|
1012
|
+
"height"?: number;
|
|
1013
|
+
/**
|
|
1014
|
+
* Show latitude and longitude inputs under a point map.
|
|
1015
|
+
* @default true
|
|
1016
|
+
*/
|
|
1017
|
+
"manual"?: boolean;
|
|
1018
|
+
/**
|
|
1019
|
+
* @default 'point'
|
|
1020
|
+
*/
|
|
1021
|
+
"mode"?: GeoMode;
|
|
1022
|
+
"onGeoChange"?: (event: FkGeoMapCustomEvent<GeoGeometry | undefined>) => void;
|
|
1023
|
+
/**
|
|
1024
|
+
* @default false
|
|
1025
|
+
*/
|
|
1026
|
+
"readOnly"?: boolean;
|
|
1027
|
+
/**
|
|
1028
|
+
* @default 'https://tile.openstreetmap.org/{z}/{x}/{y}.png'
|
|
1029
|
+
*/
|
|
1030
|
+
"tileUrl"?: string;
|
|
1031
|
+
"value"?: GeoGeometry;
|
|
1032
|
+
/**
|
|
1033
|
+
* @default 6
|
|
1034
|
+
*/
|
|
1035
|
+
"zoom"?: number;
|
|
1036
|
+
}
|
|
872
1037
|
interface FkPropertyPanel {
|
|
873
1038
|
"brick": BrickSpec;
|
|
874
1039
|
"editLocale"?: string;
|
|
@@ -955,6 +1120,19 @@ declare namespace LocalJSX {
|
|
|
955
1120
|
*/
|
|
956
1121
|
"tabLabels"?: string[];
|
|
957
1122
|
}
|
|
1123
|
+
/**
|
|
1124
|
+
* Suggests template variables inside the text control that precedes it.
|
|
1125
|
+
* Typing `{{` opens the list, the text after it filters, Enter or a click
|
|
1126
|
+
* inserts `{{name}}` in place of what was typed. The host form passes the
|
|
1127
|
+
* variables through its context as `_variables`.
|
|
1128
|
+
*/
|
|
1129
|
+
interface FkVariablePicker {
|
|
1130
|
+
"onVariablePick"?: (event: FkVariablePickerCustomEvent<string>) => void;
|
|
1131
|
+
/**
|
|
1132
|
+
* @default []
|
|
1133
|
+
*/
|
|
1134
|
+
"variables"?: FkVariable[];
|
|
1135
|
+
}
|
|
958
1136
|
|
|
959
1137
|
interface FkBrickActionsAttributes {
|
|
960
1138
|
"path": string;
|
|
@@ -1008,6 +1186,16 @@ declare namespace LocalJSX {
|
|
|
1008
1186
|
interface FkFormReviewAttributes {
|
|
1009
1187
|
"locale": string;
|
|
1010
1188
|
}
|
|
1189
|
+
interface FkGeoMapAttributes {
|
|
1190
|
+
"mode": GeoMode;
|
|
1191
|
+
"zoom": number;
|
|
1192
|
+
"tileUrl": string;
|
|
1193
|
+
"attribution": string;
|
|
1194
|
+
"height": number;
|
|
1195
|
+
"disabled": boolean;
|
|
1196
|
+
"readOnly": boolean;
|
|
1197
|
+
"manual": boolean;
|
|
1198
|
+
}
|
|
1011
1199
|
interface FkPropertyPanelAttributes {
|
|
1012
1200
|
"path": string;
|
|
1013
1201
|
"locale": string;
|
|
@@ -1051,12 +1239,14 @@ declare namespace LocalJSX {
|
|
|
1051
1239
|
"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] };
|
|
1052
1240
|
"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] };
|
|
1053
1241
|
"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] };
|
|
1242
|
+
"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] };
|
|
1054
1243
|
"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] };
|
|
1055
1244
|
"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] };
|
|
1056
1245
|
"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] };
|
|
1057
1246
|
"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] };
|
|
1058
1247
|
"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] };
|
|
1059
1248
|
"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
|
+
"fk-variable-picker": FkVariablePicker;
|
|
1060
1250
|
}
|
|
1061
1251
|
}
|
|
1062
1252
|
export { LocalJSX as JSX };
|
|
@@ -1081,12 +1271,26 @@ declare module "@stencil/core" {
|
|
|
1081
1271
|
* holds the review map and emits it.
|
|
1082
1272
|
*/
|
|
1083
1273
|
"fk-form-review": LocalJSX.IntrinsicElements["fk-form-review"] & JSXBase.HTMLAttributes<HTMLFkFormReviewElement>;
|
|
1274
|
+
/**
|
|
1275
|
+
* A Leaflet map that edits one GeoJSON geometry: a point, a polygon or a
|
|
1276
|
+
* line. Leaflet is loaded on first use so forms without a map stay light.
|
|
1277
|
+
* The value also stays editable without the map: a point has latitude and
|
|
1278
|
+
* longitude inputs, so the field works when tiles cannot load.
|
|
1279
|
+
*/
|
|
1280
|
+
"fk-geo-map": LocalJSX.IntrinsicElements["fk-geo-map"] & JSXBase.HTMLAttributes<HTMLFkGeoMapElement>;
|
|
1084
1281
|
"fk-property-panel": LocalJSX.IntrinsicElements["fk-property-panel"] & JSXBase.HTMLAttributes<HTMLFkPropertyPanelElement>;
|
|
1085
1282
|
"fk-rules-editor": LocalJSX.IntrinsicElements["fk-rules-editor"] & JSXBase.HTMLAttributes<HTMLFkRulesEditorElement>;
|
|
1086
1283
|
"fk-select-input": LocalJSX.IntrinsicElements["fk-select-input"] & JSXBase.HTMLAttributes<HTMLFkSelectInputElement>;
|
|
1087
1284
|
"fk-signature-input": LocalJSX.IntrinsicElements["fk-signature-input"] & JSXBase.HTMLAttributes<HTMLFkSignatureInputElement>;
|
|
1088
1285
|
"fk-stepper": LocalJSX.IntrinsicElements["fk-stepper"] & JSXBase.HTMLAttributes<HTMLFkStepperElement>;
|
|
1089
1286
|
"fk-tabs": LocalJSX.IntrinsicElements["fk-tabs"] & JSXBase.HTMLAttributes<HTMLFkTabsElement>;
|
|
1287
|
+
/**
|
|
1288
|
+
* Suggests template variables inside the text control that precedes it.
|
|
1289
|
+
* Typing `{{` opens the list, the text after it filters, Enter or a click
|
|
1290
|
+
* inserts `{{name}}` in place of what was typed. The host form passes the
|
|
1291
|
+
* variables through its context as `_variables`.
|
|
1292
|
+
*/
|
|
1293
|
+
"fk-variable-picker": LocalJSX.IntrinsicElements["fk-variable-picker"] & JSXBase.HTMLAttributes<HTMLFkVariablePickerElement>;
|
|
1090
1294
|
}
|
|
1091
1295
|
}
|
|
1092
1296
|
}
|
|
@@ -271,6 +271,42 @@ export declare const signatureBrick: {
|
|
|
271
271
|
readonly defaultConfigs?: Record<string, unknown>;
|
|
272
272
|
getBrickEmptySpec(): BrickSpec;
|
|
273
273
|
};
|
|
274
|
+
export declare const geoPointBrick: {
|
|
275
|
+
render(props: WcBrickProps): VNode;
|
|
276
|
+
renderBuilder(props: WcBrickProps): VNode;
|
|
277
|
+
getComponent(props: WcBrickProps): VNode;
|
|
278
|
+
getComponentWithActions(props: WcBrickProps): VNode;
|
|
279
|
+
readonly type: import("@streamline-pulse/formkrafter-core").BrickType;
|
|
280
|
+
readonly dataType: import("@streamline-pulse/formkrafter-core").JSONSchemaType;
|
|
281
|
+
readonly id: string;
|
|
282
|
+
readonly name: string;
|
|
283
|
+
readonly configsForm?: BrickSpec;
|
|
284
|
+
readonly category?: string;
|
|
285
|
+
readonly styles?: Record<string, unknown>;
|
|
286
|
+
readonly unWrapData: boolean;
|
|
287
|
+
readonly isPrivate: boolean;
|
|
288
|
+
readonly validators: import("@streamline-pulse/formkrafter-core").Validator[];
|
|
289
|
+
readonly defaultConfigs?: Record<string, unknown>;
|
|
290
|
+
getBrickEmptySpec(): BrickSpec;
|
|
291
|
+
};
|
|
292
|
+
export declare const geoAreaBrick: {
|
|
293
|
+
render(props: WcBrickProps): VNode;
|
|
294
|
+
renderBuilder(props: WcBrickProps): VNode;
|
|
295
|
+
getComponent(props: WcBrickProps): VNode;
|
|
296
|
+
getComponentWithActions(props: WcBrickProps): VNode;
|
|
297
|
+
readonly type: import("@streamline-pulse/formkrafter-core").BrickType;
|
|
298
|
+
readonly dataType: import("@streamline-pulse/formkrafter-core").JSONSchemaType;
|
|
299
|
+
readonly id: string;
|
|
300
|
+
readonly name: string;
|
|
301
|
+
readonly configsForm?: BrickSpec;
|
|
302
|
+
readonly category?: string;
|
|
303
|
+
readonly styles?: Record<string, unknown>;
|
|
304
|
+
readonly unWrapData: boolean;
|
|
305
|
+
readonly isPrivate: boolean;
|
|
306
|
+
readonly validators: import("@streamline-pulse/formkrafter-core").Validator[];
|
|
307
|
+
readonly defaultConfigs?: Record<string, unknown>;
|
|
308
|
+
getBrickEmptySpec(): BrickSpec;
|
|
309
|
+
};
|
|
274
310
|
export declare const tabsBrick: {
|
|
275
311
|
render(props: WcBrickProps): VNode;
|
|
276
312
|
renderBuilder(props: WcBrickProps): VNode;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@streamline-pulse/formkrafter-wc",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.26.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "FormKrafter web components (Stencil)",
|
|
6
6
|
"main": "dist/components/index.js",
|
|
@@ -62,12 +62,14 @@
|
|
|
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.
|
|
65
|
+
"@streamline-pulse/formkrafter-core": "0.26.0",
|
|
66
|
+
"leaflet": "1.9.4"
|
|
66
67
|
},
|
|
67
68
|
"devDependencies": {
|
|
68
69
|
"@stencil/core": "^4.43.5",
|
|
69
70
|
"@stencil/react-output-target": "^1.6.1",
|
|
70
71
|
"@stencil/vue-output-target": "^0.14.1",
|
|
72
|
+
"@types/leaflet": "1.9.12",
|
|
71
73
|
"@types/node": "^26.1.1",
|
|
72
74
|
"happy-dom": "^20.11.0"
|
|
73
75
|
},
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function t(t,n,e){const o="undefined"!=typeof HTMLElement?HTMLElement.prototype:null;for(;t&&t!==o;){const o=Object.getOwnPropertyDescriptor(t,n);if(o&&(!e||o.get))return o;t=Object.getPrototypeOf(t)}}var n=(n,e)=>{var o;Object.entries(null!=(o=e.o.t)?o:{}).map((([o,[l]])=>{if(31&l||32&l){const l=n[o],s=t(Object.getPrototypeOf(n),o,!0)||Object.getOwnPropertyDescriptor(n,o);s&&Object.defineProperty(n,o,{get(){return s.get.call(this)},set(t){s.set.call(this,t)},configurable:!0,enumerable:!0}),e.l.has(o)?n[o]=e.l.get(o):void 0!==l&&(n[o]=l)}}))},e=t=>{if(t.__stencil__getHostRef)return t.__stencil__getHostRef()},o=(t,n)=>n in t,l=(t,n)=>(0,console.error)(t,n),s=new Map,i="http://www.w3.org/1999/xlink",r=["formAssociatedCallback","formResetCallback","formDisabledCallback","formStateRestoreCallback"],c="undefined"!=typeof window?window:{},f=c.HTMLElement||class{},u={i:0,u:"",jmp:t=>t(),raf:t=>requestAnimationFrame(t),ael:(t,n,e,o)=>t.addEventListener(n,e,o),rel:(t,n,e,o)=>t.removeEventListener(n,e,o),ce:(t,n)=>new CustomEvent(t,n)},a=(()=>{var t;let n=!1;try{null==(t=c.document)||t.addEventListener("e",null,Object.defineProperty({},"passive",{get(){n=!0}}))}catch(t){}return n})(),d=(()=>{try{return!!c.document.adoptedStyleSheets&&(new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync)}catch(t){}return!1})(),p=!!d&&(()=>!!c.document&&Object.getOwnPropertyDescriptor(c.document.adoptedStyleSheets,"length").writable)(),h=!1,v=[],b=[],m=(t,n)=>e=>{t.push(e),h||(h=!0,n&&4&u.i?g($):u.raf($))},y=t=>{for(let n=0;n<t.length;n++)try{t[n](performance.now())}catch(t){l(t)}t.length=0},$=()=>{y(v),y(b),(h=v.length>0)&&u.raf($)},g=t=>Promise.resolve(undefined).then(t),w=m(b,!0),j=t=>{const n=new URL(t,u.u);return n.origin!==c.location.origin?n.href:n.pathname},O=t=>u.u=t,S=t=>{const n=E(t,"childNodes");t.tagName&&t.tagName.includes("-")&&t["s-cr"]&&"SLOT-FB"!==t.tagName&&k(n,t.tagName).forEach((t=>{1===t.nodeType&&"SLOT-FB"===t.tagName&&(t.hidden=!!N(t,M(t),!1).length)}));let e=0;for(e=0;e<n.length;e++){const t=n[e];1===t.nodeType&&E(t,"childNodes").length&&S(t)}};function k(t,n,e){let o,l=0,s=[];for(;l<t.length;l++){if(o=t[l],o["s-sr"]&&(!n||o["s-hn"]===n)&&(void 0===e||M(o)===e)&&(s.push(o),void 0!==e))return s;s=[...s,...k(o.childNodes,n,e)]}return s}var N=(t,n,e=!0)=>{const o=[];(e&&t["s-sr"]||!t["s-sr"])&&o.push(t);let l=t;for(;l=l.nextSibling;)M(l)!==n||!e&&l["s-sr"]||o.push(l);return o},C=(t,n)=>1===t.nodeType?null===t.getAttribute("slot")&&""===n||t.getAttribute("slot")===n:t["s-sn"]===n||""===n,M=t=>"string"==typeof t["s-sn"]?t["s-sn"]:1===t.nodeType&&t.getAttribute("slot")||void 0;function E(t,n){if("__"+n in t){const e=t["__"+n];return"function"!=typeof e?e:e.bind(t)}return"function"!=typeof t[n]?t[n]:t[n].bind(t)}var A,R,_,L=new WeakMap,x=t=>"sc-"+t.p,T=t=>"object"==(t=typeof t)||"function"===t,D=(t,n,...e)=>{let o=null,l=null,s=null,i=!1,r=!1;const c=[],f=n=>{for(let e=0;e<n.length;e++)o=n[e],Array.isArray(o)?f(o):null!=o&&"boolean"!=typeof o&&((i="function"!=typeof t&&!T(o))&&(o=String(o)),i&&r?c[c.length-1].h+=o:c.push(i?F(null,o):o),r=i)};if(f(e),n){n.key&&(l=n.key),n.name&&(s=n.name);{const t=n.className||n.class;t&&(n.class="object"!=typeof t?t:Object.keys(t).filter((n=>t[n])).join(" "))}}const u=F(t,null);return u.v=n,c.length>0&&(u.m=c),u.$=l,u.j=s,u},F=(t,n)=>({i:0,O:t,h:null!=n?n:null,S:null,m:null,v:null,$:null,j:null}),H={},P=t=>{if(!t)return;const n=Object.keys(t);if(0===n.length)return;let e=!1;for(const o of n){if(e)break;for(const n of t[o])if("string"==typeof n){e=!0;break}}if(!e)return t;const o={};for(const e of n)o[e]=t[e].map((t=>"string"==typeof t?{[t]:0}:t));return o},W=(t,n,e)=>null==t||T(t)?t:4&n?(e&&"string"==typeof t||"false"!==t)&&(""===t||!!t):1&n?String(t):t,U=(t,n)=>{const e=t;return{emit:t=>B(e,n,{bubbles:!0,composed:!0,cancelable:!0,detail:t})}},B=(t,n,e)=>{const o=u.ce(n,e);return t.dispatchEvent(o),o},V=(t,n,l,s,r,f)=>{if(l===s)return;let a=o(t,n),d=n.toLowerCase();if("class"===n){const n=t.classList,e=z(l);let o=z(s);n.remove(...e.filter((t=>t&&!o.includes(t)))),n.add(...o.filter((t=>t&&!e.includes(t))))}else if("style"===n){for(const n in l)s&&null!=s[n]||(n.includes("-")?t.style.removeProperty(n):t.style[n]="");for(const n in s)l&&s[n]===l[n]||(n.includes("-")?t.style.setProperty(n,s[n]):t.style[n]=s[n])}else if("key"===n);else if("ref"===n)s&&pt(s,t);else if(t.__lookupSetter__(n)||"o"!==n[0]||"n"!==n[1]){if("a"===n[0]&&n.startsWith("attr:")){const o=n.slice(5);let l;{const n=e(t);if(n&&n.o&&n.o.t){const t=n.o.t[o];t&&t[1]&&(l=t[1])}}return l||(l=o.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()),void(null==s||!1===s?!1===s&&""!==t.getAttribute(l)||t.removeAttribute(l):t.setAttribute(l,!0===s?"":s))}if("p"===n[0]&&n.startsWith("prop:")){const e=n.slice(5);try{t[e]=s}catch(t){}return}{const e=T(s);if((a||e&&null!==s)&&!r)try{if(t.tagName.includes("-"))t[n]!==s&&(t[n]=s);else{const e=null==s?"":s;"list"===n?a=!1:null!=l&&t[n]===e||("function"==typeof t.__lookupSetter__(n)?t[n]=e:t.setAttribute(n,e))}}catch(t){}let o=!1;d!==(d=d.replace(/^xlink\:?/,""))&&(n=d,o=!0),null==s||!1===s?!1===s&&""!==t.getAttribute(n)||(o?t.removeAttributeNS(i,n):t.removeAttribute(n)):(!a||4&f||r)&&!e&&1===t.nodeType&&(s=!0===s?"":s,o?t.setAttributeNS(i,n,s):t.setAttribute(n,s))}}else if(n="-"===n[2]?n.slice(3):o(c,d)?d.slice(2):d[2]+n.slice(3),l||s){const e=n.endsWith(Y);n=n.replace(I,""),l&&u.rel(t,n,l,e),s&&u.ael(t,n,s,e)}},q=/\s/,z=t=>("object"==typeof t&&t&&"baseVal"in t&&(t=t.baseVal),t&&"string"==typeof t?t.split(q):[]),Y="Capture",I=new RegExp(Y+"$"),Z=(t,n,e)=>{const o=11===n.S.nodeType&&n.S.host?n.S.host:n.S,l=t&&t.v||{},s=n.v||{};for(const t of G(Object.keys(l)))t in s||V(o,t,l[t],void 0,e,n.i);for(const t of G(Object.keys(s)))V(o,t,l[t],s[t],e,n.i)};function G(t){return t.includes("ref")?[...t.filter((t=>"ref"!==t)),"ref"]:t}var J=!1,K=!1,Q=!1,X=!1,tt=[],nt=[],et=(t,n,e)=>{var o;const l=n.m[e];let s,i,r,f=0;if(J||(Q=!0,"slot"===l.O&&(l.i|=l.m?2:1)),null!=l.h)s=l.S=c.document.createTextNode(l.h);else if(1&l.i)s=l.S=c.document.createTextNode(""),Z(null,l,X);else{if(X||(X="svg"===l.O),!c.document)throw new Error("You are trying to render a Stencil component in an environment that doesn't support the DOM.");if(s=l.S=c.document.createElementNS(X?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",!J&&2&l.i?"slot-fb":l.O),X&&"foreignObject"===l.O&&(X=!1),Z(null,l,X),null!=(u=A)&&void 0!==u&&s["s-si"]!==A&&s.classList.add(s["s-si"]=A),l.m){const n="template"===l.O?s.content:s;for(f=0;f<l.m.length;++f)i=et(t,l,f),i&&n.appendChild(i)}"svg"===l.O?X=!1:"foreignObject"===s.tagName&&(X=!0)}var u;return s["s-hn"]=_,3&l.i&&(s["s-sr"]=!0,s["s-cr"]=R,s["s-sn"]=l.j||"",s["s-rf"]=null==(o=l.v)?void 0:o.ref,function(t){if(t.assignedElements||t.assignedNodes||!t["s-sr"])return;const n=n=>function(t){const e=[],o=this["s-sn"];(null==t?void 0:t.flatten)&&console.error("\n Flattening is not supported for Stencil non-shadow slots.\n You can use `.childNodes` to nested slot fallback content.\n If you have a particular use case, please open an issue on the Stencil repo.\n ");const l=this["s-cr"].parentElement;return(l.__childNodes?l.childNodes:(t=>{const n=[];for(let e=0;e<t.length;e++){const o=t[e]["s-nr"]||void 0;o&&o.isConnected&&n.push(o)}return n})(l.childNodes)).forEach((t=>{o===M(t)&&e.push(t)})),n?e.filter((t=>1===t.nodeType)):e}.bind(t);t.assignedElements=n(!0),t.assignedNodes=n(!1)}(s),r=t&&t.m&&t.m[e],r&&r.O===l.O&&t.S&&ot(t.S),vt(R,s,n.S,null==t?void 0:t.S)),s},ot=t=>{u.i|=1;const n=t.closest(_.toLowerCase());if(null!=n){const e=Array.from(n.__childNodes||n.childNodes).find((t=>t["s-cr"])),o=Array.from(t.__childNodes||t.childNodes);for(const t of e?o.reverse():o)null!=t["s-sh"]&&(ht(n,t,null!=e?e:null),t["s-sh"]=void 0,Q=!0)}u.i&=-2},lt=(t,n)=>{u.i|=1;const e=Array.from(t.__childNodes||t.childNodes);if(t["s-sr"]){let n=t;for(;n=n.nextSibling;)n&&n["s-sn"]===t["s-sn"]&&n["s-sh"]===_&&e.push(n)}for(let t=e.length-1;t>=0;t--){const o=e[t];o["s-hn"]!==_&&o["s-ol"]&&(ht(ct(o).parentNode,o,ct(o)),o["s-ol"].remove(),o["s-ol"]=void 0,o["s-sh"]=void 0,Q=!0),n&<(o,n)}u.i&=-2},st=(t,n,e,o,l,s)=>{let i,r=t["s-cr"]&&t["s-cr"].parentNode||t;for("template"===e.O&&(r=r.content);l<=s;++l)o[l]&&(i=et(null,e,l),i&&(o[l].S=i,ht(r,i,ct(n))))},it=(t,n,e)=>{for(let o=n;o<=e;++o){const n=t[o];if(n){const t=n.S;dt(n),t&&(K=!0,t["s-ol"]?t["s-ol"].remove():lt(t,!0),t.remove())}}},rt=(t,n,e=!1)=>t.O===n.O&&("slot"===t.O?t.j===n.j:e?(e&&!t.$&&n.$&&(t.$=n.$),!0):t.$===n.$),ct=t=>t&&t["s-ol"]||t,ft=(t,n,e=!1)=>{const o=n.S=t.S,l=t.m,s=n.m,i=n.O,r=n.h;let c;null==r?(X="svg"===i||"foreignObject"!==i&&X,"slot"!==i||J||t.j!==n.j&&(n.S["s-sn"]=n.j||"",ot(n.S.parentElement)),Z(t,n,X),null!==l&&null!==s?((t,n,e,o,l=!1)=>{let s,i,r=0,c=0,f=0,u=0,a=n.length-1,d=n[0],p=n[a],h=o.length-1,v=o[0],b=o[h];const m="template"===e.O?t.content:t;for(;r<=a&&c<=h;)if(null==d)d=n[++r];else if(null==p)p=n[--a];else if(null==v)v=o[++c];else if(null==b)b=o[--h];else if(rt(d,v,l))ft(d,v,l),d=n[++r],v=o[++c];else if(rt(p,b,l))ft(p,b,l),p=n[--a],b=o[--h];else if(rt(d,b,l))"slot"!==d.O&&"slot"!==b.O||lt(d.S.parentNode,!1),ft(d,b,l),ht(m,d.S,p.S.nextSibling),d=n[++r],b=o[--h];else if(rt(p,v,l))"slot"!==d.O&&"slot"!==b.O||lt(p.S.parentNode,!1),ft(p,v,l),ht(m,p.S,d.S),p=n[--a],v=o[++c];else{for(f=-1,u=r;u<=a;++u)if(n[u]&&null!==n[u].$&&n[u].$===v.$){f=u;break}f>=0?(i=n[f],i.O!==v.O?s=et(n&&n[c],e,f):(ft(i,v,l),n[f]=void 0,s=i.S),v=o[++c]):(s=et(n&&n[c],e,c),v=o[++c]),s&&ht(ct(d.S).parentNode,s,ct(d.S))}r>a?st(t,null==o[h+1]?null:o[h+1].S,e,o,c,h):c>h&&it(n,r,a)})(o,l,n,s,e):null!==s?(null!==t.h&&(o.textContent=""),st(o,null,n,s,0,s.length-1)):!e&&null!==l&&it(l,0,l.length-1),X&&"svg"===i&&(X=!1)):(c=o["s-cr"])?c.parentNode.textContent=r:t.h!==r&&(o.data=r)},ut=[],at=t=>{let n,e,o;const l=t.__childNodes||t.childNodes;for(const t of l){if(t["s-sr"]&&(n=t["s-cr"])&&n.parentNode){e=n.parentNode.__childNodes||n.parentNode.childNodes;const l=t["s-sn"];for(o=e.length-1;o>=0;o--)if(n=e[o],!(n["s-cn"]||n["s-nr"]||n["s-hn"]===t["s-hn"]||n["s-sh"]&&n["s-sh"]===t["s-hn"]))if(C(n,l)){let e=ut.find((t=>t.k===n));K=!0,n["s-sn"]=n["s-sn"]||l,e?(e.k["s-sh"]=t["s-hn"],e.N=t):(n["s-sh"]=t["s-hn"],ut.push({N:t,k:n})),n["s-sr"]&&ut.map((t=>{C(t.k,n["s-sn"])&&(e=ut.find((t=>t.k===n)),e&&!t.N&&(t.N=e.N))}))}else ut.some((t=>t.k===n))||ut.push({k:n})}1===t.nodeType&&at(t)}},dt=t=>{t.v&&t.v.ref&&tt.push((()=>t.v.ref(null))),t.m&&t.m.map(dt)},pt=(t,n)=>{nt.push((()=>t(n)))},ht=(t,n,e,o)=>{if("string"==typeof n["s-sn"]&&n["s-sr"]&&n["s-cr"])vt(n["s-cr"],n,t,n.parentElement);else if("string"==typeof n["s-sn"]){t.insertBefore(n,e);const{slotNode:l}=function(t,n){var e;if(!(n=n||(null==(e=t["s-ol"])?void 0:e.parentElement)))return{slotNode:null,slotName:""};const o=t["s-sn"]=M(t)||"";return{slotNode:k(E(n,"childNodes"),n.tagName,o)[0],slotName:o}}(n);return l&&!o&&l.dispatchEvent(new CustomEvent("slotchange",{bubbles:!1,cancelable:!1,composed:!1})),n}return t.__insertBefore?t.__insertBefore(n,e):null==t?void 0:t.insertBefore(n,e)};function vt(t,n,e,o){var l,s;let i;if(t&&"string"==typeof n["s-sn"]&&n["s-sr"]&&t.parentNode&&t.parentNode["s-sc"]&&(i=n["s-si"]||t.parentNode["s-sc"])){const t=n["s-sn"],r=n["s-hn"];if(null==(l=e.classList)||l.add(i+"-s"),o&&(null==(s=o.classList)?void 0:s.contains(i+"-s"))){let n=(o.__childNodes||o.childNodes)[0],e=!1;for(;n;){if(n["s-sn"]!==t&&n["s-hn"]===r&&n["s-sr"]){e=!0;break}n=n.nextSibling}e||o.classList.remove(i+"-s")}}}var bt=(t,n,e=!1)=>{var o,l,s,i,r;const f=t.$hostElement$,a=t.o,d=t.C||F(null,null);var p;const h=(p=n)&&p.O===H?n:D(null,null,n);if(_=f.tagName,e&&h.v)for(const t of Object.keys(h.v))f.hasAttribute(t)&&!["key","ref","style","class"].includes(t)&&(h.v[t]=f[t]);if(h.O=null,h.i|=4,t.C=h,h.S=d.S=f,A=f["s-sc"],J=false,R=f["s-cr"],K=!1,ft(d,h,e),u.i|=1,Q){at(h.S);for(const t of ut){const n=t.k;if(!n["s-ol"]&&c.document){const t=c.document.createTextNode("");t["s-nr"]=n,ht(n.parentNode,n["s-ol"]=t,n,e)}}for(const t of ut){const n=t.k,r=t.N;if(1===n.nodeType&&e&&(n["s-ih"]=null!=(o=n.hidden)&&o),r){const t=r.parentNode;let o=r.nextSibling;if(o&&1===o.nodeType){let e=null==(l=n["s-ol"])?void 0:l.previousSibling;for(;e;){let l=null!=(s=e["s-nr"])?s:null;if(l&&l["s-sn"]===n["s-sn"]&&t===(l.__parentNode||l.parentNode)){for(l=l.nextSibling;l===n||(null==l?void 0:l["s-sr"]);)l=null==l?void 0:l.nextSibling;if(!l||!l["s-nr"]){o=l;break}}e=e.previousSibling}}if((!o&&t!==(n.__parentNode||n.parentNode)||(n.__nextSibling||n.nextSibling)!==o)&&n!==o){if(ht(t,n,o,e),8===n.nodeType&&n.nodeValue.startsWith("s-nt-")){const t=c.document.createTextNode(n.nodeValue.replace(/^s-nt-/,""));t["s-hn"]=n["s-hn"],t["s-sn"]=n["s-sn"],t["s-sh"]=n["s-sh"],t["s-sr"]=n["s-sr"],t["s-ol"]=n["s-ol"],t["s-ol"]["s-nr"]=t,ht(n.parentNode,t,n,e),n.parentNode.removeChild(n)}1===n.nodeType&&"SLOT-FB"!==n.tagName&&(n.hidden=null!=(i=n["s-ih"])&&i)}n&&"function"==typeof r["s-rf"]&&r["s-rf"](r)}else 1===n.nodeType&&(n.hidden=!0)}}if(K&&S(h.S),u.i&=-2,ut.length=0,!J&&!(1&a.i)&&f["s-cr"]){const t=h.S.__childNodes||h.S.childNodes;for(const n of t)if(n["s-hn"]!==_&&!n["s-sh"])if(e&&null==n["s-ih"]&&(n["s-ih"]=null!=(r=n.hidden)&&r),1===n.nodeType)n.hidden=!0;else if(3===n.nodeType&&n.nodeValue.trim()){const t=c.document.createComment("s-nt-"+n.nodeValue);t["s-sn"]=n["s-sn"],ht(n.parentNode,t,n,e),n.parentNode.removeChild(n)}}R=void 0,tt.forEach((t=>t())),tt.length=0,nt.forEach((t=>t())),nt.length=0},mt=(t,n)=>{if(n&&!t.M&&n["s-p"]){const e=n["s-p"].push(new Promise((o=>t.M=()=>{n["s-p"].splice(e-1,1),o()})))}},yt=(t,n)=>{if(t.i|=16,4&t.i)return void(t.i|=512);mt(t,t.A);const e=()=>$t(t,n);if(!n)return w(e);queueMicrotask((()=>{e()}))},$t=(t,n)=>{const e=t.$hostElement$,o=e;if(!o)throw new Error(`Can't render component <${e.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`);let l;return l=Nt(o,n?"componentWillLoad":"componentWillUpdate",void 0,e),l=gt(l,(()=>Nt(o,"componentWillRender",void 0,e))),gt(l,(()=>jt(t,o,n)))},gt=(t,n)=>wt(t)?t.then(n).catch((t=>{console.error(t),n()})):n(),wt=t=>t instanceof Promise||t&&t.then&&"function"==typeof t.then,jt=async(t,n,e)=>{var o;const l=t.$hostElement$,i=l["s-rc"];e&&(t=>{const n=t.o,e=t.$hostElement$,o=n.i,l=((t,n)=>{var e,o,l;const i=x(n),r=s.get(i);if(!c.document)return i;if(t=11===t.nodeType?t:c.document,r)if("string"==typeof r){let l,s=L.get(t=t.head||t);if(s||L.set(t,s=new Set),!s.has(i)){l=c.document.createElement("style"),l.textContent=r;const f=null!=(e=u.R)?e:function(){var t,n,e;return null!=(e=null==(n=null==(t=c.document.head)?void 0:t.querySelector('meta[name="csp-nonce"]'))?void 0:n.getAttribute("content"))?e:void 0}();if(null!=f&&l.setAttribute("nonce",f),!(1&n.i))if("HEAD"===t.nodeName){const n=t.querySelectorAll("link[rel=preconnect]"),e=n.length>0?n[n.length-1].nextSibling:t.querySelector("style");t.insertBefore(l,(null==e?void 0:e.parentNode)===t?e:null)}else if("host"in t)if(d){const n=new(null!=(o=t.defaultView)?o:t.ownerDocument.defaultView).CSSStyleSheet;n.replaceSync(r),p?t.adoptedStyleSheets.unshift(n):t.adoptedStyleSheets=[n,...t.adoptedStyleSheets]}else{const n=t.querySelector("style");n?n.textContent=r+n.textContent:t.prepend(l)}else t.append(l);1&n.i&&t.insertBefore(l,null),4&n.i&&(l.textContent+="slot-fb{display:contents}slot-fb[hidden]{display:none}"),s&&s.add(i)}}else{let n=L.get(t);if(n||L.set(t,n=new Set),!n.has(i)){const e=null!=(l=t.defaultView)?l:t.ownerDocument.defaultView;let o;if(r.constructor===e.CSSStyleSheet)o=r;else{o=new e.CSSStyleSheet;for(let t=0;t<r.cssRules.length;t++)o.insertRule(r.cssRules[t].cssText,t)}p?t.adoptedStyleSheets.push(o):t.adoptedStyleSheets=[...t.adoptedStyleSheets,o],n.add(i)}}return i})(e.getRootNode(),n);10&o&&(e["s-sc"]=l,e.classList.add(l+"-h"))})(t);Ot(t,n,l,e),i&&(i.map((t=>t())),l["s-rc"]=void 0);{const n=null!=(o=l["s-p"])?o:[],e=()=>St(t);0===n.length?e():(Promise.all(n).then(e).catch(e),t.i|=4,n.length=0)}},Ot=(t,n,e,o)=>{try{n=n.render(),t.i&=-17,t.i|=2,bt(t,n,o)}catch(n){l(n,t.$hostElement$)}return null},St=t=>{const n=t.$hostElement$,e=n,o=t.A;Nt(e,"componentDidRender",void 0,n),64&t.i?Nt(e,"componentDidUpdate",void 0,n):(t.i|=64,Ct(n),Nt(e,"componentDidLoad",void 0,n),t._(n),o||kt()),t.M&&(t.M(),t.M=void 0),512&t.i&&g((()=>yt(t,!1))),t.i&=-517},kt=()=>{g((()=>B(c,"appload",{detail:{namespace:"formkrafter-wc"}})))},Nt=(t,n,e,o)=>{if(t&&t[n])try{return t[n](e)}catch(t){l(t,o)}},Ct=t=>t.classList.add("hydrated"),Mt=(t,n,o,s)=>{const i=e(t);if(!i)return;const r=t,c=i.l.get(n),f=i.i,u=r;o=W(o,s.t[n][0],!!(64&s.i));const a=Number.isNaN(c)&&Number.isNaN(o);if(o!==c&&!a){if(i.l.set(n,o),s.L){const t=s.L[n];t&&t.map((t=>{try{const[[e,l]]=Object.entries(t);(128&f||1&l)&&(u?u[e](o,c,n):i.T.push((()=>{i.D[e](o,c,n)})))}catch(t){l(t,r)}}))}if(2&f){if(u.componentShouldUpdate&&!1===u.componentShouldUpdate(o,c,n)&&!(16&f))return;16&f||yt(i,!1)}}},Et=(n,o,l)=>{var s,i;const c=n.prototype;64&o.i&&1&l&&r.forEach((t=>{const n=c[t];Object.defineProperty(c,t,{value(...o){var l;const s=e(this),i=this;i?"function"==typeof n&&n.call(i,...o):null==(l=null==s?void 0:s.F)||l.then((n=>{const e=n[t];"function"==typeof e&&e.call(n,...o)}))}})}));{n.watchers&&!o.L&&(o.L=P(n.watchers)),n.deserializers&&!o.H&&(o.H=n.deserializers),n.serializers&&!o.P&&(o.P=n.serializers);const l=Object.entries(null!=(s=o.t)?s:{});l.map((([n,[l]])=>{if(31&l||32&l){const{get:s,set:i}=t(c,n)||{};s&&(o.t[n][0]|=2048),i&&(o.t[n][0]|=4096),Object.defineProperty(c,n,{get(){return s?s.apply(this):(t=n,e(this).l.get(t));var t},configurable:!0,enumerable:!0}),Object.defineProperty(c,n,{set(t){const s=e(this);if(s){if(i)return void 0===(32&l?this[n]:s.$hostElement$[n])&&s.l.get(n)&&(t=s.l.get(n)),i.apply(this,[W(t,l,!!(64&o.i))]),void Mt(this,n,t=32&l?this[n]:s.$hostElement$[n],o);Mt(this,n,t,o)}}})}}));{const t=new Map;c.attributeChangedCallback=function(n,s,i){u.jmp((()=>{var r;const f=t.get(n),u=e(this);if(this.hasOwnProperty(f),c.hasOwnProperty(f)&&"number"==typeof this[f]&&this[f]==i)return;if(null==f){const t=null==u?void 0:u.i;if(u&&t&&!(8&t)&&i!==s){const e=this,l=null==(r=o.L)?void 0:r[n];null==l||l.forEach((o=>{const[[l,r]]=Object.entries(o);null!=e[l]&&(128&t||1&r)&&e[l].call(e,i,s,n)}))}return}const a=l.find((([t])=>t===f)),d=a&&4&a[1][0],p=d&&null===i&&void 0===this[f];d&&(i=null!==i&&"false"!==i);const h=Object.getOwnPropertyDescriptor(c,f);p||i==this[f]||h.get&&!h.set||(this[f]=i)}))},n.observedAttributes=Array.from(new Set([...Object.keys(null!=(i=o.L)?i:{}),...l.filter((([t,n])=>31&n[0])).map((([n,e])=>{const o=e[1]||n;return t.set(o,n),o}))]))}}return n},At=(t,o)=>{const i={i:o[0],p:o[1]};try{i.t=o[2],i.W=o[3],i.L=P(t.L),i.H=t.H,i.P=t.P;const r=t.prototype.connectedCallback,f=t.prototype.disconnectedCallback;return Object.assign(t.prototype,{__hasHostListenerAttached:!1,__registerHost(){((t,e)=>{const o={i:0,$hostElement$:t,o:e,l:new Map,U:new Map};o.F=new Promise((t=>o._=t)),t["s-p"]=[],t["s-rc"]=[];const l=o;t.__stencil__getHostRef=()=>l,512&e.i&&n(t,o)})(this,i)},connectedCallback(){if(!this.__hasHostListenerAttached){const t=e(this);if(!t)return;Rt(this,t,i.W),this.__hasHostListenerAttached=!0}(t=>{if(!(1&u.i)){const n=e(t);if(!n)return;const o=n.o,i=()=>{};if(1&n.i)Rt(t,n,o.W),(null==n?void 0:n.D)||(null==n?void 0:n.F)&&n.F.then((()=>{}));else{n.i|=1,12&o.i&&(t=>{if(!c.document)return;const n=t["s-cr"]=c.document.createComment("");n["s-cn"]=!0,ht(t,n,t.firstChild)})(t);{let e=t;for(;e=e.parentNode||e.host;)if(e["s-p"]){mt(n,n.A=e);break}}o.t&&Object.entries(o.t).map((([n,[e]])=>{if(31&e&&Object.prototype.hasOwnProperty.call(t,n)){const e=t[n];delete t[n],t[n]=e}})),(async(t,n,e)=>{let o;try{if(!(32&n.i)&&(n.i|=32,o=t.constructor,customElements.whenDefined(t.localName).then((()=>n.i|=128)),o&&o.style)){let t;"string"==typeof o.style&&(t=o.style);const n=x(e);if(!s.has(n)){const o=()=>{};((t,n,e)=>{let o=s.get(t);d&&e?(o=o||new CSSStyleSheet,"string"==typeof o?o=n:o.replaceSync(n)):o=n,s.set(t,o)})(n,t,!!(1&e.i)),o()}}const l=n.A,i=()=>yt(n,!0);l&&l["s-rc"]?l["s-rc"].push(i):i()}catch(e){l(e,t),n.M&&(n.M(),n.M=void 0),n._&&n._(t)}})(t,n,o)}i()}})(this),r&&r.call(this)},disconnectedCallback(){(async t=>{if(!(1&u.i)){const n=e(t);(null==n?void 0:n.B)&&(n.B.map((t=>t())),n.B=void 0)}L.has(t)&&L.delete(t),t.shadowRoot&&L.has(t.shadowRoot)&&L.delete(t.shadowRoot)})(this),f&&f.call(this)},__attachShadow(){this.shadowRoot=this}}),Object.defineProperty(t,"is",{value:i.p,configurable:!0}),Et(t,i,3)}catch(n){return l(n),t}},Rt=(t,n,e)=>{e&&c.document&&e.map((([e,o,l])=>{const s=Lt(c.document,t,e),i=_t(n,l),r=xt(e);u.ael(s,o,i,r),(n.B=n.B||[]).push((()=>u.rel(s,o,i,r)))}))},_t=(t,n)=>e=>{try{t.$hostElement$[n](e)}catch(n){l(n,t.$hostElement$)}},Lt=(t,n,e)=>4&e?t:8&e?c:n,xt=t=>a?{passive:!!(1&t),capture:!!(2&t)}:!!(2&t),Tt=t=>u.R=t,Dt=t=>Object.assign(u,t),Ft=new WeakMap;function Ht(t,n){let e=Ft.get(n);e||(e={i:0,o:{i:0,p:n.tagName},$hostElement$:n},Ft.set(n,e)),bt(e,t)}function Pt(t){return t}export{f as H,H as a,Tt as b,U as c,Dt as d,j as g,D as h,At as p,Ht as r,O as s,Pt as t}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e,p as t,H as s,c as o,h as r}from"./p-B29HakDD.js";import{b as a,j as l,f as i}from"./p-D6WtQeaQ.js";import{d as p}from"./p-CIGtlYQn.js";import{d as n}from"./p-0sDICgJ3.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&&"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:"db090ba35cdeacdb87e89c7eb47375872facf223",class:"fk-props"},r("header",{key:"d13712ea4694cff8a4b4dafa0d21d3633d3aab06",class:"fk-props__header"},r("span",{key:"ae186ba6026de0f2297400cf9e4984491db0c629",class:"fk-props__type"},this.brick.type),r("h4",{key:"8ceb17eb21aa8d0430f3277951840105a01cfd01",class:"fk-props__title"},i(`brick.${this.brick.id}.name`,this.brick.name))),r("div",{key:"2d84ee51af8cbfdc575769ea784c38a3a66b19ef",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 as o,p as c,H as d,h as r,a as e}from"./p-B29HakDD.js";const n=c(class extends d{constructor(o){super(),!1!==o&&this.__registerHost()}render(){return r(e,{key:"558231ac77ac07f7b40bd08081a498dc5623442c"},r("p",{key:"f1ca1f59750c6ed2b1a3c2e22bd6f7f1dc721496",class:"fk-not-found"},"Brick ",r("slot",{key:"0003d9dcc23c52cb8d466d794eafd4dd6be4b708"})," not found"))}static get style(){return".fk-not-found.sc-fk-brick-not-found{margin:0;padding:calc(var(--fk-spacing) * 1.5);border:1px dashed var(--fk-color-danger);border-radius:var(--fk-radius);color:var(--fk-color-danger);font-size:0.875rem}"}},[262,"fk-brick-not-found"]);function t(){"undefined"!=typeof customElements&&["fk-brick-not-found"].forEach((c=>{"fk-brick-not-found"===c&&(customElements.get(o(c))||customElements.define(o(c),n))}))}t();export{n as F,t as d}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t,p as s,H as i,c as e,h as r}from"./p-B29HakDD.js";import{b as a,d as o,h as n,e as h,i as c,g as d,v as l}from"./p-D6WtQeaQ.js";import{registerDefaultBricks as f}from"./index.js";import{d as m}from"./p-DCKXkdxG.js";import{d as u}from"./p-BTxz9ZnS.js";import{d as p}from"./p-MGQtftHl.js";import{d as b}from"./p-CIGtlYQn.js";import{d as k}from"./p-DGScbbLx.js";import{d as v}from"./p-KYwjk9Yt.js";import{d as j}from"./p-BPwPAGJq.js";import{d as y}from"./p-DzPxItO6.js";import{d as g}from"./p-BpDsZSJX.js";import{d as O}from"./p-XP4h_v8Q.js";import{d as S}from"./p-1_c29Rag.js";const E=s(class extends i{constructor(t){super(),!1!==t&&this.__registerHost(),this.formDataChange=e(this,"formDataChange"),this.formSubmit=e(this,"formSubmit"),this.validityChange=e(this,"validityChange"),this.editable=!1,this.readOnly=!1,this.disabled=!1,this.showSubmit=!1,this.reviewable=!1,this.currentData={},this.touched={},this.expanding=!1,this.utils={validateForm:()=>({isValid:this.runValidation().valid})}}componentWillLoad(){return f(),this.attachFormInternals(),this.currentData=this.seeded(this.data),this.runExpansion()}syncData(t){this.currentData=this.seeded(t)}onSpecChange(){this.currentData=this.seeded(this.data),this.runExpansion()}componentDidLoad(){this.emitValidity()}emitValidity(t){const{valid:s,errors:i}=null!=t?t:this.runValidation(),e=`${s}|${Object.keys(i).sort().join(",")}`;e!==this.lastValidity&&(this.lastValidity=e,this.validityChange.emit({valid:s,errors:i}),this.reportToForm(s,i))}attachFormInternals(){const t=this.host;if("function"==typeof t.attachInternals)try{this.internals=t.attachInternals()}catch(t){this.internals=void 0}}reportToForm(t,s){var i,e,r;if(null===(i=this.internals)||void 0===i?void 0:i.setValidity)try{this.internals.setFormValue(JSON.stringify(this.publicData())),t?this.internals.setValidity({}):this.internals.setValidity({customError:!0},null!==(e=Object.values(s)[0])&&void 0!==e?e:a("form.invalid"),null!==(r=this.host.querySelector("input, select, textarea"))&&void 0!==r?r:void 0)}catch(t){}}handleHostFormSubmit(t){var s;const i=null===(s=this.internals)||void 0===s?void 0:s.form;i&&t.target===i&&(t.preventDefault(),this.submit())}seeded(t){return Object.assign(Object.assign({},o(this.effectiveSpec())),t)}effectiveSpec(){var t;return null!==(t=this.expandedSpec)&&void 0!==t?t:this.spec}async runExpansion(){if(this.expandError=void 0,this.editable||!n(this.spec))return void(this.expandedSpec=void 0);const t=this.spec;this.expanding=!0;try{const s=await h(t);this.spec===t&&(this.expandedSpec=s,this.currentData=this.seeded(this.currentData))}catch(s){this.spec===t&&(this.expandedSpec=void 0,this.expandError=s instanceof Error?s.message:String(s))}finally{this.spec===t&&(this.expanding=!1)}}publicData(){return Object.fromEntries(Object.entries(this.currentData).filter((([t])=>!t.startsWith("_"))))}dataMap(t=this.currentData){return this.context?Object.assign(Object.assign({},t),this.context):t}handleBrickDataChange(t){t.stopPropagation(),this.currentData=this.applyValueEffects(Object.assign(Object.assign({},this.currentData),t.detail));const s=Object.assign({},this.touched);for(const i of Object.keys(t.detail))s[i]=!0;this.touched=s;const{valid:i,errors:e}=this.runValidation();this.formDataChange.emit({data:this.publicData(),isValid:i,errors:e}),this.emitValidity({valid:i,errors:e})}applyValueEffects(t){var s,i;let e=t;for(const{brick:t}of c(this.effectiveSpec())){const r=null===(s=t.configs)||void 0===s?void 0:s.key;if(!r||!(null===(i=t.rules)||void 0===i?void 0:i.length))continue;const a=d(t.rules,this.dataMap(e));void 0!==a.value&&e[r]!==a.value&&(e=Object.assign(Object.assign({},e),{[r]:a.value}))}return e}async validate(){var t;const s={};for(const{brick:i}of c(this.effectiveSpec())){const e=null===(t=i.configs)||void 0===t?void 0:t.key;e&&(s[e]=!0)}this.touched=s;const i=this.runValidation(),e=Object.assign({},i.errors);let r=i.valid;const a=Array.from(this.host.querySelectorAll("fk-data-grid"));for(const t of a){const s=await t.validateRows();r=r&&s.valid,Object.assign(e,s.errors)}const o={valid:r,errors:e};return this.emitValidity(o),this.formDataChange.emit({data:this.publicData(),isValid:o.valid,errors:o.errors}),o}async submit(){const t=await this.validate();return!t.valid||this.readOnly||this.disabled||this.formSubmit.emit({data:this.publicData(),isValid:!0,errors:{}}),t}handleStepTouch(t){t.stopPropagation();const s=Object.assign({},this.touched);for(const i of t.detail.keys)s[i]=!0;this.touched=s}async handleStepperSubmit(t){t.stopPropagation(),await this.submit()}runValidation(){const t=Object.fromEntries(Object.entries(this.currentData).filter((([,t])=>""!==t&&null!=t)));return l(this.effectiveSpec(),t,this.locale,this.context?this.dataMap(t):void 0)}visibleErrors(){if(this.editable)return{};const t={};for(const[s,i]of Object.entries(this.runValidation().errors))this.touched[s]&&(t[s]=i);return t}render(){var t;return this.spec?this.expanding?r("p",{class:"fk-form__expanding"},a("nestedForm.loading")):r("form",{class:"fk-form",onSubmit:t=>t.preventDefault()},this.expandError?r("span",{class:"fk-field__error",role:"alert"},this.expandError):null,r("fk-brick-render",{brickSpec:this.effectiveSpec(),rootSpec:this.effectiveSpec(),data:this.currentData,dataMap:this.dataMap(),errors:this.visibleErrors(),annotations:this.annotations,notes:this.notes,editableKeys:this.editableKeys,reviewable:this.reviewable,locale:this.locale,path:"0",editable:this.editable,readOnly:this.readOnly,disabled:this.disabled,selectedPath:this.selectedPath,utils:this.utils}),!this.showSubmit||this.editable||this.readOnly||this.disabled?null:r("button",{type:"submit",class:"fk-form__submit",onClick:t=>{t.preventDefault(),this.submit()}},null!==(t=this.submitLabel)&&void 0!==t?t:a("form.submit"))):null}static get formAssociated(){return!0}get host(){return this}static get watchers(){return{data:[{syncData:0}],spec:[{onSpecChange:0}]}}static get style(){return".fk-form.sc-fk-form-render{display:flex;flex-direction:column;gap:var(--fk-spacing);font-family:var(--fk-font);color:var(--fk-color-text)}"}},[66,"fk-form-render",{spec:[16],data:[16],context:[16],editable:[4],readOnly:[4,"read-only"],disabled:[4],showSubmit:[4,"show-submit"],submitLabel:[1,"submit-label"],selectedPath:[1,"selected-path"],locale:[1],annotations:[16],notes:[16],editableKeys:[16],reviewable:[4],currentData:[32],touched:[32],expandedSpec:[32],expanding:[32],expandError:[32],validate:[64],submit:[64]},[[8,"submit","handleHostFormSubmit"],[0,"brickDataChange","handleBrickDataChange"],[0,"stepTouch","handleStepTouch"],[0,"stepperSubmit","handleStepperSubmit"]],{data:[{syncData:0}],spec:[{onSpecChange:0}]}]);function x(){"undefined"!=typeof customElements&&["fk-form-render","fk-brick-actions","fk-brick-not-found","fk-brick-render","fk-code-editor","fk-data-grid","fk-drop-area","fk-file-input","fk-select-input","fk-signature-input","fk-stepper","fk-tabs"].forEach((s=>{switch(s){case"fk-form-render":customElements.get(t(s))||customElements.define(t(s),E);break;case"fk-brick-actions":customElements.get(t(s))||m();break;case"fk-brick-not-found":customElements.get(t(s))||u();break;case"fk-brick-render":customElements.get(t(s))||p();break;case"fk-code-editor":customElements.get(t(s))||b();break;case"fk-data-grid":customElements.get(t(s))||k();break;case"fk-drop-area":customElements.get(t(s))||v();break;case"fk-file-input":customElements.get(t(s))||j();break;case"fk-select-input":customElements.get(t(s))||y();break;case"fk-signature-input":customElements.get(t(s))||g();break;case"fk-stepper":customElements.get(t(s))||O();break;case"fk-tabs":customElements.get(t(s))||S()}}))}x();export{E as F,x as d}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,h as t,H as a}from"./p-C7Z9P9uL.js";import{a as r}from"./p-7kO7VDbG.js";const c=class{constructor(t){e(this,t)}render(){return t(a,{key:"a4d0825c084d261dfb8dc99a366a1e3f6e0c862d"},t("div",{key:"3e012165aec178ac8ea8e1211d891aa4d1d42d55",class:"fk-empty"},t("p",{key:"8c99ad57686aadd9d68a52767743ab907ec8e692",class:"fk-empty__title"},r("empty.title")),t("p",{key:"585262991b3497a3fcf430e26d53adc66ae9f74d",class:"fk-empty__hint"},r("empty.hint"))))}};c.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{c as fk_empty_form}
|