@streamline-pulse/formkrafter-wc 0.17.1 → 0.18.1

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 (60) hide show
  1. package/dist/components/fk-brick-actions.js +1 -1
  2. package/dist/components/fk-brick-list.js +1 -1
  3. package/dist/components/fk-brick-mold-item.js +1 -1
  4. package/dist/components/fk-brick-not-found.js +1 -1
  5. package/dist/components/fk-brick-render.js +1 -1
  6. package/dist/components/fk-code-editor.js +1 -1
  7. package/dist/components/fk-data-grid.js +1 -1
  8. package/dist/components/fk-drop-area.js +1 -1
  9. package/dist/components/fk-empty-form.js +1 -1
  10. package/dist/components/fk-file-input.js +1 -1
  11. package/dist/components/fk-form-builder.js +1 -1
  12. package/dist/components/fk-form-render.js +1 -1
  13. package/dist/components/fk-property-panel.js +1 -1
  14. package/dist/components/fk-rules-editor.js +1 -1
  15. package/dist/components/fk-select-input.js +1 -1
  16. package/dist/components/fk-signature-input.js +1 -1
  17. package/dist/components/fk-stepper.js +1 -1
  18. package/dist/components/fk-tabs.js +1 -1
  19. package/dist/components/index.js +1 -1
  20. package/dist/components/p-B29HakDD.js +1 -0
  21. package/dist/components/{p-D0WC9b0b.js → p-B6O_oDBF.js} +1 -1
  22. package/dist/components/{p-BfcoJWPo.js → p-BFUJv0mU.js} +1 -1
  23. package/dist/components/{p-NDbmiiYk.js → p-BTxz9ZnS.js} +1 -1
  24. package/dist/components/{p-DGP0c8y0.js → p-Bvw9dmIO.js} +1 -1
  25. package/dist/components/{p-9IDUDeP6.js → p-BwAXv6je.js} +1 -1
  26. package/dist/components/p-BypSt35U.js +17 -0
  27. package/dist/components/{p-Bih9I9WU.js → p-CQQ6GwnV.js} +1 -1
  28. package/dist/components/p-CguFu_10.js +1 -0
  29. package/dist/components/{p-BtHcMzF4.js → p-Ckvrbn3F.js} +1 -1
  30. package/dist/components/{p-8ZeGXEsz.js → p-CtC4VjhX.js} +1 -1
  31. package/dist/components/{p-DF2zcI6f.js → p-Cxx8Ejax.js} +1 -1
  32. package/dist/components/{p-BLq8UE1k.js → p-DFXre2Vw.js} +1 -1
  33. package/dist/components/{p-Bl2nvYDj.js → p-DumoqCP0.js} +1 -1
  34. package/dist/components/{p-sm15Uakg.js → p-HXtoKsEx.js} +1 -1
  35. package/dist/components/p-HpO7Idro.js +1 -0
  36. package/dist/components/p-e6ZaFhWA.js +1 -0
  37. package/dist/components/p-vU0qXghd.js +1 -0
  38. package/dist/formkrafter-wc/formkrafter-wc.css +1 -1
  39. package/dist/formkrafter-wc/formkrafter-wc.esm.js +1 -1
  40. package/dist/formkrafter-wc/index.esm.js +1 -1
  41. package/dist/formkrafter-wc/p-161af28b.entry.js +1 -0
  42. package/dist/formkrafter-wc/{p-98a3f01b.entry.js → p-87fbf005.entry.js} +1 -1
  43. package/dist/formkrafter-wc/p-C7Z9P9uL.js +2 -0
  44. package/dist/formkrafter-wc/p-CVCwXROd.js +17 -0
  45. package/dist/types/components/fk-brick-render/fk-brick-render.d.ts +1 -0
  46. package/dist/types/components/fk-data-grid/fk-data-grid.d.ts +1 -0
  47. package/dist/types/components/fk-form-render/fk-form-render.d.ts +14 -1
  48. package/dist/types/components/fk-stepper/fk-stepper.d.ts +1 -0
  49. package/dist/types/components.d.ts +65 -2
  50. package/dist/types/utils/events.d.ts +4 -0
  51. package/package.json +2 -2
  52. package/dist/components/p-BB4Llg42.js +0 -1
  53. package/dist/components/p-BMOajGpj.js +0 -1
  54. package/dist/components/p-C8VbvcjS.js +0 -1
  55. package/dist/components/p-DSl8gGnO.js +0 -17
  56. package/dist/components/p-DiJ__tRM.js +0 -1
  57. package/dist/components/p-DmMy4yht.js +0 -1
  58. package/dist/formkrafter-wc/p-DQlq41h1.js +0 -17
  59. package/dist/formkrafter-wc/p-d1023691.entry.js +0 -1
  60. package/dist/formkrafter-wc/p-qLZlXROB.js +0 -2
@@ -8,6 +8,7 @@ export declare class FkBrickRender {
8
8
  dataMap?: Record<string, unknown>;
9
9
  path: string;
10
10
  editable: boolean;
11
+ readOnly: boolean;
11
12
  selectedPath?: string;
12
13
  errors: Record<string, string>;
13
14
  locale?: string;
@@ -4,6 +4,7 @@ export declare class FkDataGrid {
4
4
  spec: BrickSpec;
5
5
  value?: unknown;
6
6
  disabled: boolean;
7
+ readOnly: boolean;
7
8
  locale?: string;
8
9
  utils: Utils;
9
10
  gridValueChange: EventEmitter<Array<Record<string, unknown>> | undefined>;
@@ -1,24 +1,36 @@
1
1
  import type { EventEmitter } from '../../stencil-public-runtime';
2
2
  import type { BrickSpec, ValidationResult } from '@streamline-pulse/formkrafter-core';
3
- import type { DataChangeDetail } from '../../utils/events';
3
+ import type { DataChangeDetail, ValidityChangeDetail } from '../../utils/events';
4
4
  export declare class FkFormRender {
5
5
  host: HTMLElement;
6
6
  spec: BrickSpec;
7
7
  data?: Record<string, unknown>;
8
8
  context?: Record<string, unknown>;
9
9
  editable: boolean;
10
+ readOnly: boolean;
11
+ showSubmit: boolean;
12
+ submitLabel?: string;
10
13
  selectedPath?: string;
11
14
  locale?: string;
12
15
  formDataChange: EventEmitter<DataChangeDetail>;
13
16
  formSubmit: EventEmitter<DataChangeDetail>;
17
+ validityChange: EventEmitter<ValidityChangeDetail>;
14
18
  currentData: Record<string, unknown>;
15
19
  touched: Record<string, boolean>;
16
20
  expandedSpec?: BrickSpec;
17
21
  expanding: boolean;
18
22
  expandError?: string;
23
+ private lastValidity?;
24
+ private internals?;
19
25
  componentWillLoad(): Promise<void>;
20
26
  syncData(next?: Record<string, unknown>): void;
21
27
  onSpecChange(): void;
28
+ componentDidLoad(): void;
29
+ private emitValidity;
30
+ private attachFormInternals;
31
+ private reportToForm;
32
+ handleHostFormSubmit(event: Event): void;
33
+ private seeded;
22
34
  private effectiveSpec;
23
35
  private runExpansion;
24
36
  private publicData;
@@ -26,6 +38,7 @@ export declare class FkFormRender {
26
38
  handleBrickDataChange(event: CustomEvent<Record<string, unknown>>): void;
27
39
  private applyValueEffects;
28
40
  validate(): Promise<ValidationResult>;
41
+ submit(): Promise<ValidationResult>;
29
42
  handleStepTouch(event: CustomEvent<{
30
43
  keys: string[];
31
44
  }>): void;
@@ -4,6 +4,7 @@ export declare class FkStepper {
4
4
  host: HTMLElement;
5
5
  stepLabels: string[];
6
6
  editable: boolean;
7
+ readOnly: boolean;
7
8
  spec?: BrickSpec;
8
9
  dataMap?: Record<string, unknown>;
9
10
  locale?: string;
@@ -5,9 +5,9 @@
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 { BrickConfigsChangeDetail, BrickDropDetail, BrickPathDetail, BrickRulesChangeDetail, BrickStylesChangeDetail, BrickValidationsChangeDetail, DataChangeDetail, SpecChangeDetail } from "./utils/events";
8
+ import { BrickConfigsChangeDetail, BrickDropDetail, BrickPathDetail, BrickRulesChangeDetail, BrickStylesChangeDetail, BrickValidationsChangeDetail, DataChangeDetail, SpecChangeDetail, ValidityChangeDetail } from "./utils/events";
9
9
  import { BrickMold, BrickSpec, UploadedFile, Utils, ValidationResult } from "@streamline-pulse/formkrafter-core";
10
- export { BrickConfigsChangeDetail, BrickDropDetail, BrickPathDetail, BrickRulesChangeDetail, BrickStylesChangeDetail, BrickValidationsChangeDetail, DataChangeDetail, SpecChangeDetail } from "./utils/events";
10
+ export { BrickConfigsChangeDetail, BrickDropDetail, BrickPathDetail, BrickRulesChangeDetail, BrickStylesChangeDetail, BrickValidationsChangeDetail, DataChangeDetail, SpecChangeDetail, ValidityChangeDetail } from "./utils/events";
11
11
  export { BrickMold, BrickSpec, UploadedFile, Utils, ValidationResult } from "@streamline-pulse/formkrafter-core";
12
12
  export namespace Components {
13
13
  interface FkBrickActions {
@@ -42,6 +42,10 @@ export namespace Components {
42
42
  * @default '0'
43
43
  */
44
44
  "path": string;
45
+ /**
46
+ * @default false
47
+ */
48
+ "readOnly": boolean;
45
49
  "rootSpec"?: BrickSpec;
46
50
  "selectedPath"?: string;
47
51
  "utils": Utils;
@@ -66,6 +70,10 @@ export namespace Components {
66
70
  */
67
71
  "disabled": boolean;
68
72
  "locale"?: string;
73
+ /**
74
+ * @default false
75
+ */
76
+ "readOnly": boolean;
69
77
  "spec": BrickSpec;
70
78
  "utils": Utils;
71
79
  "validateRows": () => Promise<ValidationResult>;
@@ -111,8 +119,18 @@ export namespace Components {
111
119
  */
112
120
  "editable": boolean;
113
121
  "locale"?: string;
122
+ /**
123
+ * @default false
124
+ */
125
+ "readOnly": boolean;
114
126
  "selectedPath"?: string;
127
+ /**
128
+ * @default false
129
+ */
130
+ "showSubmit": boolean;
115
131
  "spec": BrickSpec;
132
+ "submit": () => Promise<ValidationResult>;
133
+ "submitLabel"?: string;
116
134
  "validate": () => Promise<ValidationResult>;
117
135
  }
118
136
  interface FkPropertyPanel {
@@ -169,6 +187,10 @@ export namespace Components {
169
187
  */
170
188
  "editable": boolean;
171
189
  "locale"?: string;
190
+ /**
191
+ * @default false
192
+ */
193
+ "readOnly": boolean;
172
194
  "spec"?: BrickSpec;
173
195
  /**
174
196
  * @default []
@@ -401,6 +423,7 @@ declare global {
401
423
  interface HTMLFkFormRenderElementEventMap {
402
424
  "formDataChange": DataChangeDetail;
403
425
  "formSubmit": DataChangeDetail;
426
+ "validityChange": ValidityChangeDetail;
404
427
  }
405
428
  interface HTMLFkFormRenderElement extends Components.FkFormRender, HTMLStencilElement {
406
429
  addEventListener<K extends keyof HTMLFkFormRenderElementEventMap>(type: K, listener: (this: HTMLFkFormRenderElement, ev: FkFormRenderCustomEvent<HTMLFkFormRenderElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
@@ -588,6 +611,10 @@ declare namespace LocalJSX {
588
611
  * @default '0'
589
612
  */
590
613
  "path"?: string;
614
+ /**
615
+ * @default false
616
+ */
617
+ "readOnly"?: boolean;
591
618
  "rootSpec"?: BrickSpec;
592
619
  "selectedPath"?: string;
593
620
  "utils": Utils;
@@ -614,6 +641,10 @@ declare namespace LocalJSX {
614
641
  "disabled"?: boolean;
615
642
  "locale"?: string;
616
643
  "onGridValueChange"?: (event: FkDataGridCustomEvent<Array<Record<string, unknown>> | undefined>) => void;
644
+ /**
645
+ * @default false
646
+ */
647
+ "readOnly"?: boolean;
617
648
  "spec": BrickSpec;
618
649
  "utils": Utils;
619
650
  "value"?: unknown;
@@ -656,15 +687,37 @@ declare namespace LocalJSX {
656
687
  interface FkFormRender {
657
688
  "context"?: Record<string, unknown>;
658
689
  "data"?: Record<string, unknown>;
690
+ /**
691
+ * If `true`, the user cannot interact with the element.
692
+ */
693
+ "disabled"?: boolean;
659
694
  /**
660
695
  * @default false
661
696
  */
662
697
  "editable"?: boolean;
698
+ /**
699
+ * The `id` of a `<form>` element to associate this element with.
700
+ */
701
+ "form"?: string;
663
702
  "locale"?: string;
703
+ /**
704
+ * The name of the element, used when submitting an HTML form.
705
+ */
706
+ "name"?: string;
664
707
  "onFormDataChange"?: (event: FkFormRenderCustomEvent<DataChangeDetail>) => void;
665
708
  "onFormSubmit"?: (event: FkFormRenderCustomEvent<DataChangeDetail>) => void;
709
+ "onValidityChange"?: (event: FkFormRenderCustomEvent<ValidityChangeDetail>) => void;
710
+ /**
711
+ * @default false
712
+ */
713
+ "readOnly"?: boolean;
666
714
  "selectedPath"?: string;
715
+ /**
716
+ * @default false
717
+ */
718
+ "showSubmit"?: boolean;
667
719
  "spec": BrickSpec;
720
+ "submitLabel"?: string;
668
721
  }
669
722
  interface FkPropertyPanel {
670
723
  "brick": BrickSpec;
@@ -728,6 +781,10 @@ declare namespace LocalJSX {
728
781
  "locale"?: string;
729
782
  "onStepTouch"?: (event: FkStepperCustomEvent<{ keys: string[] }>) => void;
730
783
  "onStepperSubmit"?: (event: FkStepperCustomEvent<void>) => void;
784
+ /**
785
+ * @default false
786
+ */
787
+ "readOnly"?: boolean;
731
788
  "spec"?: BrickSpec;
732
789
  /**
733
790
  * @default []
@@ -759,6 +816,7 @@ declare namespace LocalJSX {
759
816
  interface FkBrickRenderAttributes {
760
817
  "path": string;
761
818
  "editable": boolean;
819
+ "readOnly": boolean;
762
820
  "selectedPath": string;
763
821
  "locale": string;
764
822
  }
@@ -768,6 +826,7 @@ declare namespace LocalJSX {
768
826
  }
769
827
  interface FkDataGridAttributes {
770
828
  "disabled": boolean;
829
+ "readOnly": boolean;
771
830
  "locale": string;
772
831
  }
773
832
  interface FkDropAreaAttributes {
@@ -785,6 +844,9 @@ declare namespace LocalJSX {
785
844
  }
786
845
  interface FkFormRenderAttributes {
787
846
  "editable": boolean;
847
+ "readOnly": boolean;
848
+ "showSubmit": boolean;
849
+ "submitLabel": string;
788
850
  "selectedPath": string;
789
851
  "locale": string;
790
852
  }
@@ -809,6 +871,7 @@ declare namespace LocalJSX {
809
871
  }
810
872
  interface FkStepperAttributes {
811
873
  "editable": boolean;
874
+ "readOnly": boolean;
812
875
  "locale": string;
813
876
  }
814
877
  interface FkTabsAttributes {
@@ -30,6 +30,10 @@ export interface SpecChangeDetail {
30
30
  patches: Operation[];
31
31
  inverse: Operation[];
32
32
  }
33
+ export interface ValidityChangeDetail {
34
+ valid: boolean;
35
+ errors: Record<string, string>;
36
+ }
33
37
  export interface DataChangeDetail {
34
38
  data: Record<string, unknown>;
35
39
  isValid: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamline-pulse/formkrafter-wc",
3
- "version": "0.17.1",
3
+ "version": "0.18.1",
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.17.1"
65
+ "@streamline-pulse/formkrafter-core": "0.18.1"
66
66
  },
67
67
  "devDependencies": {
68
68
  "@stencil/core": "^4.43.5",
@@ -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="undefined"!=typeof window?window:{},c=r.HTMLElement||class{},f={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)},u=(()=>{var t;let n=!1;try{null==(t=r.document)||t.addEventListener("e",null,Object.defineProperty({},"passive",{get(){n=!0}}))}catch(t){}return n})(),a=(()=>{try{return!!r.document.adoptedStyleSheets&&(new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync)}catch(t){}return!1})(),d=!!a&&(()=>!!r.document&&Object.getOwnPropertyDescriptor(r.document.adoptedStyleSheets,"length").writable)(),p=!1,h=[],v=[],b=(t,n)=>e=>{t.push(e),p||(p=!0,n&&4&f.i?$(y):f.raf(y))},m=t=>{for(let n=0;n<t.length;n++)try{t[n](performance.now())}catch(t){l(t)}t.length=0},y=()=>{m(h),m(v),(p=h.length>0)&&f.raf(y)},$=t=>Promise.resolve(undefined).then(t),g=b(v,!0),w=t=>{const n=new URL(t,f.u);return n.origin!==r.location.origin?n.href:n.pathname},j=t=>f.u=t,O=t=>{const n=E(t,"childNodes");t.tagName&&t.tagName.includes("-")&&t["s-cr"]&&"SLOT-FB"!==t.tagName&&S(n,t.tagName).forEach((t=>{1===t.nodeType&&"SLOT-FB"===t.tagName&&(t.hidden=!!k(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&&O(t)}};function S(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,...S(o.childNodes,n,e)]}return s}var k=(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},N=(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,C,L=new WeakMap,x=t=>"sc-"+t.p,R=t=>"object"==(t=typeof t)||"function"===t,T=(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&&!R(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}),D={},H=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},P=(t,n)=>null==t||R(t)?t:4&n?"false"!==t&&(""===t||!!t):1&n?String(t):t,W=(t,n)=>{const e=t;return{emit:t=>U(e,n,{bubbles:!0,composed:!0,cancelable:!0,detail:t})}},U=(t,n,e)=>{const o=f.ce(n,e);return t.dispatchEvent(o),o},B=(t,n,l,s,c,u)=>{if(l===s)return;let a=o(t,n),d=n.toLowerCase();if("class"===n){const n=t.classList,e=q(l);let o=q(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&&dt(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=R(s);if((a||e&&null!==s)&&!c)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&u||c)&&!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(r,d)?d.slice(2):d[2]+n.slice(3),l||s){const e=n.endsWith(z);n=n.replace(Y,""),l&&f.rel(t,n,l,e),s&&f.ael(t,n,s,e)}},V=/\s/,q=t=>("object"==typeof t&&t&&"baseVal"in t&&(t=t.baseVal),t&&"string"==typeof t?t.split(V):[]),z="Capture",Y=new RegExp(z+"$"),I=(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 Z(Object.keys(l)))t in s||B(o,t,l[t],void 0,e,n.i);for(const t of Z(Object.keys(s)))B(o,t,l[t],s[t],e,n.i)};function Z(t){return t.includes("ref")?[...t.filter((t=>"ref"!==t)),"ref"]:t}var G=!1,J=!1,K=!1,Q=!1,X=[],tt=[],nt=(t,n,e)=>{var o;const l=n.m[e];let s,i,c,f=0;if(G||(K=!0,"slot"===l.O&&(l.i|=l.m?2:1)),null!=l.h)s=l.S=r.document.createTextNode(l.h);else if(1&l.i)s=l.S=r.document.createTextNode(""),I(null,l,Q);else{if(Q||(Q="svg"===l.O),!r.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=r.document.createElementNS(Q?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",!G&&2&l.i?"slot-fb":l.O),Q&&"foreignObject"===l.O&&(Q=!1),I(null,l,Q),null!=(u=_)&&void 0!==u&&s["s-si"]!==_&&s.classList.add(s["s-si"]=_),l.m){const n="template"===l.O?s.content:s;for(f=0;f<l.m.length;++f)i=nt(t,l,f),i&&n.appendChild(i)}"svg"===l.O?Q=!1:"foreignObject"===s.tagName&&(Q=!0)}var u;return s["s-hn"]=C,3&l.i&&(s["s-sr"]=!0,s["s-cr"]=A,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),c=t&&t.m&&t.m[e],c&&c.O===l.O&&t.S&&et(t.S),ht(A,s,n.S,null==t?void 0:t.S)),s},et=t=>{f.i|=1;const n=t.closest(C.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"]&&(pt(n,t,null!=e?e:null),t["s-sh"]=void 0,K=!0)}f.i&=-2},ot=(t,n)=>{f.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"]===C&&e.push(n)}for(let t=e.length-1;t>=0;t--){const o=e[t];o["s-hn"]!==C&&o["s-ol"]&&(pt(rt(o).parentNode,o,rt(o)),o["s-ol"].remove(),o["s-ol"]=void 0,o["s-sh"]=void 0,K=!0),n&&ot(o,n)}f.i&=-2},lt=(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=nt(null,e,l),i&&(o[l].S=i,pt(r,i,rt(n))))},st=(t,n,e)=>{for(let o=n;o<=e;++o){const n=t[o];if(n){const t=n.S;at(n),t&&(J=!0,t["s-ol"]?t["s-ol"].remove():ot(t,!0),t.remove())}}},it=(t,n,e=!1)=>t.O===n.O&&("slot"===t.O?t.j===n.j:e?(e&&!t.$&&n.$&&(t.$=n.$),!0):t.$===n.$),rt=t=>t&&t["s-ol"]||t,ct=(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?(Q="svg"===i||"foreignObject"!==i&&Q,"slot"!==i||G||t.j!==n.j&&(n.S["s-sn"]=n.j||"",et(n.S.parentElement)),I(t,n,Q),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(it(d,v,l))ct(d,v,l),d=n[++r],v=o[++c];else if(it(p,b,l))ct(p,b,l),p=n[--a],b=o[--h];else if(it(d,b,l))"slot"!==d.O&&"slot"!==b.O||ot(d.S.parentNode,!1),ct(d,b,l),pt(m,d.S,p.S.nextSibling),d=n[++r],b=o[--h];else if(it(p,v,l))"slot"!==d.O&&"slot"!==b.O||ot(p.S.parentNode,!1),ct(p,v,l),pt(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=nt(n&&n[c],e,f):(ct(i,v,l),n[f]=void 0,s=i.S),v=o[++c]):(s=nt(n&&n[c],e,c),v=o[++c]),s&&pt(rt(d.S).parentNode,s,rt(d.S))}r>a?lt(t,null==o[h+1]?null:o[h+1].S,e,o,c,h):c>h&&st(n,r,a)})(o,l,n,s,e):null!==s?(null!==t.h&&(o.textContent=""),lt(o,null,n,s,0,s.length-1)):!e&&null!==l&&st(l,0,l.length-1),Q&&"svg"===i&&(Q=!1)):(c=o["s-cr"])?c.parentNode.textContent=r:t.h!==r&&(o.data=r)},ft=[],ut=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(N(n,l)){let e=ft.find((t=>t.k===n));J=!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"],ft.push({N:t,k:n})),n["s-sr"]&&ft.map((t=>{N(t.k,n["s-sn"])&&(e=ft.find((t=>t.k===n)),e&&!t.N&&(t.N=e.N))}))}else ft.some((t=>t.k===n))||ft.push({k:n})}1===t.nodeType&&ut(t)}},at=t=>{t.v&&t.v.ref&&X.push((()=>t.v.ref(null))),t.m&&t.m.map(at)},dt=(t,n)=>{tt.push((()=>t(n)))},pt=(t,n,e,o)=>{if("string"==typeof n["s-sn"]&&n["s-sr"]&&n["s-cr"])ht(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:S(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 ht(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 vt=(t,n,e=!1)=>{var o,l,s,i,c;const u=t.$hostElement$,a=t.o,d=t.M||F(null,null);var p;const h=(p=n)&&p.O===D?n:T(null,null,n);if(C=u.tagName,e&&h.v)for(const t of Object.keys(h.v))u.hasAttribute(t)&&!["key","ref","style","class"].includes(t)&&(h.v[t]=u[t]);if(h.O=null,h.i|=4,t.M=h,h.S=d.S=u,_=u["s-sc"],G=false,A=u["s-cr"],J=!1,ct(d,h,e),f.i|=1,K){ut(h.S);for(const t of ft){const n=t.k;if(!n["s-ol"]&&r.document){const t=r.document.createTextNode("");t["s-nr"]=n,pt(n.parentNode,n["s-ol"]=t,n,e)}}for(const t of ft){const n=t.k,c=t.N;if(1===n.nodeType&&e&&(n["s-ih"]=null!=(o=n.hidden)&&o),c){const t=c.parentNode;let o=c.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(pt(t,n,o,e),8===n.nodeType&&n.nodeValue.startsWith("s-nt-")){const t=r.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,pt(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 c["s-rf"]&&c["s-rf"](c)}else 1===n.nodeType&&(n.hidden=!0)}}if(J&&O(h.S),f.i&=-2,ft.length=0,!G&&!(1&a.i)&&u["s-cr"]){const t=h.S.__childNodes||h.S.childNodes;for(const n of t)if(n["s-hn"]!==C&&!n["s-sh"])if(e&&null==n["s-ih"]&&(n["s-ih"]=null!=(c=n.hidden)&&c),1===n.nodeType)n.hidden=!0;else if(3===n.nodeType&&n.nodeValue.trim()){const t=r.document.createComment("s-nt-"+n.nodeValue);t["s-sn"]=n["s-sn"],pt(n.parentNode,t,n,e),n.parentNode.removeChild(n)}}A=void 0,X.forEach((t=>t())),X.length=0,tt.forEach((t=>t())),tt.length=0},bt=(t,n)=>{if(n&&!t._&&n["s-p"]){const e=n["s-p"].push(new Promise((o=>t._=()=>{n["s-p"].splice(e-1,1),o()})))}},mt=(t,n)=>{if(t.i|=16,4&t.i)return void(t.i|=512);bt(t,t.A);const e=()=>yt(t,n);if(!n)return g(e);queueMicrotask((()=>{e()}))},yt=(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=kt(o,n?"componentWillLoad":"componentWillUpdate",void 0,e),l=$t(l,(()=>kt(o,"componentWillRender",void 0,e))),$t(l,(()=>wt(t,o,n)))},$t=(t,n)=>gt(t)?t.then(n).catch((t=>{console.error(t),n()})):n(),gt=t=>t instanceof Promise||t&&t.then&&"function"==typeof t.then,wt=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),c=s.get(i);if(!r.document)return i;if(t=11===t.nodeType?t:r.document,c)if("string"==typeof c){let l,s=L.get(t=t.head||t);if(s||L.set(t,s=new Set),!s.has(i)){l=r.document.createElement("style"),l.textContent=c;const u=null!=(e=f.C)?e:function(){var t,n,e;return null!=(e=null==(n=null==(t=r.document.head)?void 0:t.querySelector('meta[name="csp-nonce"]'))?void 0:n.getAttribute("content"))?e:void 0}();if(null!=u&&l.setAttribute("nonce",u),!(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(a){const n=new(null!=(o=t.defaultView)?o:t.ownerDocument.defaultView).CSSStyleSheet;n.replaceSync(c),d?t.adoptedStyleSheets.unshift(n):t.adoptedStyleSheets=[n,...t.adoptedStyleSheets]}else{const n=t.querySelector("style");n?n.textContent=c+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(c.constructor===e.CSSStyleSheet)o=c;else{o=new e.CSSStyleSheet;for(let t=0;t<c.cssRules.length;t++)o.insertRule(c.cssRules[t].cssText,t)}d?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);jt(t,n,l,e),i&&(i.map((t=>t())),l["s-rc"]=void 0);{const n=null!=(o=l["s-p"])?o:[],e=()=>Ot(t);0===n.length?e():(Promise.all(n).then(e).catch(e),t.i|=4,n.length=0)}},jt=(t,n,e,o)=>{try{n=n.render(),t.i&=-17,t.i|=2,vt(t,n,o)}catch(n){l(n,t.$hostElement$)}return null},Ot=t=>{const n=t.$hostElement$,e=n,o=t.A;kt(e,"componentDidRender",void 0,n),64&t.i?kt(e,"componentDidUpdate",void 0,n):(t.i|=64,Nt(n),kt(e,"componentDidLoad",void 0,n),t.L(n),o||St()),t._&&(t._(),t._=void 0),512&t.i&&$((()=>mt(t,!1))),t.i&=-517},St=()=>{$((()=>U(r,"appload",{detail:{namespace:"formkrafter-wc"}})))},kt=(t,n,e,o)=>{if(t&&t[n])try{return t[n](e)}catch(t){l(t,o)}},Nt=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=P(o,s.t[n][0]);const a=Number.isNaN(c)&&Number.isNaN(o);if(o!==c&&!a){if(i.l.set(n,o),s.R){const t=s.R[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.F[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||mt(i,!1)}}},Et=(n,o)=>{var l,s;const i=n.prototype;{n.watchers&&!o.R&&(o.R=H(n.watchers)),n.deserializers&&!o.D&&(o.D=n.deserializers),n.serializers&&!o.H&&(o.H=n.serializers);const r=Object.entries(null!=(l=o.t)?l:{});r.map((([n,[l]])=>{if(31&l||32&l){const{get:s,set:r}=t(i,n)||{};s&&(o.t[n][0]|=2048),r&&(o.t[n][0]|=4096),Object.defineProperty(i,n,{get(){return s?s.apply(this):(t=n,e(this).l.get(t));var t},configurable:!0,enumerable:!0}),Object.defineProperty(i,n,{set(t){const s=e(this);if(s){if(r)return void 0===(32&l?this[n]:s.$hostElement$[n])&&s.l.get(n)&&(t=s.l.get(n)),r.apply(this,[P(t,l)]),void Mt(this,n,t=32&l?this[n]:s.$hostElement$[n],o);Mt(this,n,t,o)}}})}}));{const t=new Map;i.attributeChangedCallback=function(n,l,s){f.jmp((()=>{var c;const f=t.get(n),u=e(this);if(this.hasOwnProperty(f),i.hasOwnProperty(f)&&"number"==typeof this[f]&&this[f]==s)return;if(null==f){const t=null==u?void 0:u.i;if(u&&t&&!(8&t)&&s!==l){const e=this,i=null==(c=o.R)?void 0:c[n];null==i||i.forEach((o=>{const[[i,r]]=Object.entries(o);null!=e[i]&&(128&t||1&r)&&e[i].call(e,s,l,n)}))}return}const a=r.find((([t])=>t===f)),d=a&&4&a[1][0],p=d&&null===s&&void 0===this[f];d&&(s=null!==s&&"false"!==s);const h=Object.getOwnPropertyDescriptor(i,f);p||s==this[f]||h.get&&!h.set||(this[f]=s)}))},n.observedAttributes=Array.from(new Set([...Object.keys(null!=(s=o.R)?s:{}),...r.filter((([t,n])=>31&n[0])).map((([n,e])=>{const o=e[1]||n;return t.set(o,n),o}))]))}}return n},_t=(t,o)=>{const i={i:o[0],p:o[1]};try{i.t=o[2],i.P=o[3],i.R=H(t.R),i.D=t.D,i.H=t.H;const c=t.prototype.connectedCallback,u=t.prototype.disconnectedCallback;return Object.assign(t.prototype,{__hasHostListenerAttached:!1,__registerHost(){((t,e)=>{const o={i:0,$hostElement$:t,o:e,l:new Map,W:new Map};o.U=new Promise((t=>o.L=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;At(this,t,i.P),this.__hasHostListenerAttached=!0}(t=>{if(!(1&f.i)){const n=e(t);if(!n)return;const o=n.o,i=()=>{};if(1&n.i)At(t,n,o.P),(null==n?void 0:n.F)||(null==n?void 0:n.U)&&n.U.then((()=>{}));else{n.i|=1,12&o.i&&(t=>{if(!r.document)return;const n=t["s-cr"]=r.document.createComment("");n["s-cn"]=!0,pt(t,n,t.firstChild)})(t);{let e=t;for(;e=e.parentNode||e.host;)if(e["s-p"]){bt(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);a&&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=()=>mt(n,!0);l&&l["s-rc"]?l["s-rc"].push(i):i()}catch(e){l(e,t),n._&&(n._(),n._=void 0),n.L&&n.L(t)}})(t,n,o)}i()}})(this),c&&c.call(this)},disconnectedCallback(){(async t=>{if(!(1&f.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),u&&u.call(this)},__attachShadow(){this.shadowRoot=this}}),Object.defineProperty(t,"is",{value:i.p,configurable:!0}),Et(t,i)}catch(n){return l(n),t}},At=(t,n,e)=>{e&&r.document&&e.map((([e,o,l])=>{const s=Lt(r.document,t,e),i=Ct(n,l),c=xt(e);f.ael(s,o,i,c),(n.B=n.B||[]).push((()=>f.rel(s,o,i,c)))}))},Ct=(t,n)=>e=>{try{t.$hostElement$[n](e)}catch(n){l(n,t.$hostElement$)}},Lt=(t,n,e)=>4&e?t:n,xt=t=>u?{passive:!!(1&t),capture:!!(2&t)}:!!(2&t),Rt=t=>f.C=t,Tt=t=>Object.assign(f,t),Ft=new WeakMap;function Dt(t,n){let e=Ft.get(n);e||(e={i:0,o:{i:0,p:n.tagName},$hostElement$:n},Ft.set(n,e)),vt(e,t)}function Ht(t){return t}export{c as H,D as a,Rt as b,W as c,Tt as d,w as g,T as h,_t as p,Dt as r,j as s,Ht as t}
@@ -1 +0,0 @@
1
- import{t,p as s,H as i,c as e,h as a}from"./p-BB4Llg42.js";import{g as r,r as n,a as o,w as h}from"./p-DSl8gGnO.js";import{g as l}from"./p-BMtyMU2R.js";import{d as c}from"./p-Bih9I9WU.js";import{d}from"./p-NDbmiiYk.js";import{d as p}from"./p-D0WC9b0b.js";const k=s(class extends i{constructor(t){super(),!1!==t&&this.__registerHost(),this.brickDataChange=e(this,"brickDataChange"),this.brickConfigsChange=e(this,"brickConfigsChange"),this.brickStylesChange=e(this,"brickStylesChange"),this.brickValidationsChange=e(this,"brickValidationsChange"),this.brickRulesChange=e(this,"brickRulesChange"),this.brickRemove=e(this,"brickRemove"),this.brickDuplicate=e(this,"brickDuplicate"),this.path="0",this.editable=!1,this.errors={}}render(){var t,s,i,e,c;const d=this.brickSpec;if(!d)return null;const p=l(d.type,d.id);if(!p)return a("fk-brick-not-found",null,`${d.type}:${d.id}`);const k=this.editable&&(null===(t=d.editable)||void 0===t||t),u=r(d.rules,this.dataMap);if(!k&&!0===u.hidden)return null;const f="panel"===d.type||"collection"===d.type,b=(null!==(s=d.children)&&void 0!==s?s:[]).map(((t,s)=>{var i;return a("fk-brick-render",{brickSpec:t,rootSpec:null!==(i=this.rootSpec)&&void 0!==i?i:this.brickSpec,data:this.data,dataMap:this.dataMap,errors:this.errors,locale:this.locale,path:`${this.path}.${s}`,editable:this.editable,selectedPath:this.selectedPath,utils:this.utils})}));k&&f&&b.push(a("fk-drop-area",{path:this.path}));const m={brickSpec:d,configsForm:d.configsForm,configs:n(d.configs,this.locale),locale:this.locale,styles:null!==(i=d.styles)&&void 0!==i?i:{},data:o(d,this.data),dataMap:this.dataMap,rootSpec:null!==(e=this.rootSpec)&&void 0!==e?e:this.brickSpec,error:(null===(c=d.configs)||void 0===c?void 0:c.key)?this.errors[d.configs.key]:void 0,disabled:!k&&!0===u.disabled,path:this.path,editable:k,children:b,validations:d.validations,rules:d.rules,utils:this.utils,onDataChange:t=>{const s=h(d,t);void 0!==s&&this.brickDataChange.emit(s)},onConfigsChange:(t,s)=>this.brickConfigsChange.emit({configs:t,path:null!=s?s:this.path}),onStylesChange:(t,s)=>this.brickStylesChange.emit({styles:t,path:null!=s?s:this.path}),onValidationsChange:(t,s)=>this.brickValidationsChange.emit({validations:t,path:null!=s?s:this.path}),onRulesChange:(t,s)=>this.brickRulesChange.emit({rules:t,path:null!=s?s:this.path}),onDelete:t=>this.brickRemove.emit({path:t}),onDuplicate:t=>this.brickDuplicate.emit({path:t})},g=k?p.renderBuilder(m):p.render(m);return k&&"0"!==this.path?a("fk-brick-actions",{path:this.path,selected:this.path===this.selectedPath},g):g}},[0,"fk-brick-render",{brickSpec:[16],rootSpec:[16],data:[16],dataMap:[16],path:[1],editable:[4],selectedPath:[1,"selected-path"],errors:[16],locale:[1],utils:[16]}]);function u(){"undefined"!=typeof customElements&&["fk-brick-render","fk-brick-actions","fk-brick-not-found","fk-brick-render","fk-drop-area"].forEach((s=>{switch(s){case"fk-brick-render":customElements.get(t(s))||customElements.define(t(s),k);break;case"fk-brick-actions":customElements.get(t(s))||c();break;case"fk-brick-not-found":customElements.get(t(s))||d();break;case"fk-brick-render":customElements.get(t(s))||u();break;case"fk-drop-area":customElements.get(t(s))||p()}}))}u();export{k as F,u as d}
@@ -1 +0,0 @@
1
- import{t as r,p as o,H as i,c as a,h as t}from"./p-BB4Llg42.js";import{v as s,b as e,f as d}from"./p-DSl8gGnO.js";import{d as c}from"./p-Bih9I9WU.js";import{d as n}from"./p-NDbmiiYk.js";import{d as l}from"./p-BMOajGpj.js";import{d as f}from"./p-D0WC9b0b.js";const k=o(class extends i{constructor(r){super(),!1!==r&&this.__registerHost(),this.gridValueChange=a(this,"gridValueChange"),this.disabled=!1,this.touched={},this.addRow=r=>{r.preventDefault(),this.gridValueChange.emit([...this.rows(),{}])}}rows(){return Array.isArray(this.value)?this.value:[]}rowSpec(){var r,o;return(null===(r=this.rowSpecCache)||void 0===r?void 0:r.source)!==this.spec&&(this.rowSpecCache={source:this.spec,rowSpec:{type:"panel",id:"grid-row",name:"Row",configs:{key:"row"},children:null!==(o=this.spec.children)&&void 0!==o?o:[]}}),this.rowSpecCache.rowSpec}rowErrors(r){const o=Object.fromEntries(Object.entries(r).filter((([,r])=>""!==r&&null!=r)));return s(this.rowSpec(),o,this.locale).errors}visibleRowErrors(r){var o,i;const a=null!==(o=this.rows()[r])&&void 0!==o?o:{},t=null!==(i=this.touched[r])&&void 0!==i?i:{},s={};for(const[r,o]of Object.entries(this.rowErrors(a)))t[r]&&(s[r]=o);return s}handleRowChange(r){var o,i;r.stopPropagation();const a=r.target.closest("[data-grid-row]"),t=Number(null!==(o=null==a?void 0:a.getAttribute("data-grid-row"))&&void 0!==o?o:-1);if(t<0)return;const s=Object.assign({},null!==(i=this.touched[t])&&void 0!==i?i:{});for(const o of Object.keys(r.detail))s[o]=!0;this.touched=Object.assign(Object.assign({},this.touched),{[t]:s});const e=this.rows().map(((o,i)=>i===t?Object.assign(Object.assign({},o),r.detail):o));this.gridValueChange.emit(e)}async validateRows(){var r,o;const i=this.rows(),a=null!==(o=null===(r=this.spec.configs)||void 0===r?void 0:r.key)&&void 0!==o?o:"grid",t={},s={};return i.forEach(((r,o)=>{var i,e;const d={};for(const r of null!==(i=this.spec.children)&&void 0!==i?i:[])(null===(e=r.configs)||void 0===e?void 0:e.key)&&(d[r.configs.key]=!0);t[o]=d;for(const[i,t]of Object.entries(this.rowErrors(r)))s[`${a}[${o}].${i}`]=t})),this.touched=t,{valid:0===Object.keys(s).length,errors:s}}moveRow(r,o){const i=[...this.rows()],a=r+o;if(a<0||a>=i.length)return;const[t]=i.splice(r,1);i.splice(a,0,t);const s=Object.assign({},this.touched),e=s[r];s[r]=s[a],s[a]=e,this.touched=s,this.gridValueChange.emit(i)}removeRow(r){const o=this.rows().filter(((o,i)=>i!==r)),i={};for(const[o,a]of Object.entries(this.touched)){const t=Number(o);t<r?i[t]=a:t>r&&(i[t-1]=a)}this.touched=i,this.gridValueChange.emit(o.length?o:void 0)}render(){var r;const o=null!==(r=this.spec.children)&&void 0!==r?r:[],i=this.rows();return t("div",{key:"32c03a6c5e156ea13b98188a6ea0a1417d584e12",class:"fk-grid"},0===i.length?t("p",{class:"fk-grid__empty"},e("grid.empty")):null,i.map(((r,a)=>t("div",{class:"fk-grid__row","data-grid-row":a,key:a},t("div",{class:"fk-grid__cells"},o.map(((o,i)=>t("fk-brick-render",{brickSpec:o,data:r,dataMap:r,errors:this.visibleRowErrors(a),locale:this.locale,path:`grid.${a}.${i}`,utils:this.utils})))),t("div",{class:"fk-grid__row-actions"},t("button",{type:"button",class:"fk-grid__move",title:d("grid.moveUp","Move row up"),"aria-label":d("grid.moveUp","Move row up"),disabled:this.disabled||0===a,onClick:r=>{r.preventDefault(),this.moveRow(a,-1)}},"↑"),t("button",{type:"button",class:"fk-grid__move",title:d("grid.moveDown","Move row down"),"aria-label":d("grid.moveDown","Move row down"),disabled:this.disabled||a===i.length-1,onClick:r=>{r.preventDefault(),this.moveRow(a,1)}},"↓"),t("button",{type:"button",class:"fk-grid__remove",title:e("grid.removeRow"),"aria-label":e("grid.removeRow"),disabled:this.disabled,onClick:r=>{r.preventDefault(),this.removeRow(a)}},"✕"))))),t("button",{key:"548ec4b5763e128d428047c06236d13100e76dfa",type:"button",class:"fk-grid__add",disabled:this.disabled,onClick:this.addRow},e("grid.addRow")))}static get style(){return".sc-fk-data-grid-h{display:block}.fk-grid.sc-fk-data-grid{display:flex;flex-direction:column;gap:var(--fk-spacing)}.fk-grid__empty.sc-fk-data-grid{margin:0;padding:var(--fk-spacing);border:1px dashed var(--fk-color-border);border-radius:var(--fk-radius);font-size:0.85rem;color:var(--fk-color-muted);text-align:center}.fk-grid__row.sc-fk-data-grid{display:flex;align-items:flex-start;gap:var(--fk-spacing);padding:var(--fk-spacing);border:1px solid var(--fk-color-border);border-radius:var(--fk-radius);background:color-mix(in srgb, var(--fk-color-surface) 60%, transparent)}.fk-grid__cells.sc-fk-data-grid{display:flex;flex:1;flex-wrap:wrap;gap:var(--fk-spacing);min-width:0}.fk-grid__cells.sc-fk-data-grid>*.sc-fk-data-grid{flex:1;min-width:160px}.fk-grid__remove.sc-fk-data-grid{border:none;background:transparent;color:var(--fk-color-muted);font-size:0.8rem;cursor:pointer;padding:4px 6px;border-radius:calc(var(--fk-radius) / 2)}.fk-grid__remove.sc-fk-data-grid:hover:not(:disabled){color:var(--fk-color-danger);background:color-mix(in srgb, var(--fk-color-danger) 10%, transparent)}.fk-grid__add.sc-fk-data-grid{align-self:flex-start;font:inherit;font-size:0.8rem;font-weight:600;padding:calc(var(--fk-spacing) / 1.5) var(--fk-spacing);border:1px dashed var(--fk-color-border);border-radius:var(--fk-radius);background:transparent;color:var(--fk-color-muted);cursor:pointer}.fk-grid__add.sc-fk-data-grid:hover:not(:disabled){border-color:var(--fk-color-primary);color:var(--fk-color-primary)}.fk-grid__row-actions.sc-fk-data-grid{display:flex;flex-direction:column;gap:2px;flex-shrink:0}.fk-grid__move.sc-fk-data-grid{border:none;background:transparent;color:var(--fk-color-muted);font-size:0.8rem;cursor:pointer;padding:2px 6px;border-radius:calc(var(--fk-radius) / 2)}.fk-grid__move.sc-fk-data-grid:hover:not(:disabled){color:var(--fk-color-primary);background:color-mix(in srgb, var(--fk-color-primary) 10%, transparent)}.fk-grid__move.sc-fk-data-grid:disabled{opacity:0.3;cursor:default}.fk-grid__move.sc-fk-data-grid:focus-visible,.fk-grid__remove.sc-fk-data-grid:focus-visible{outline:2px solid color-mix(in srgb, var(--fk-color-primary) 55%, transparent);outline-offset:1px}"}},[2,"fk-data-grid",{spec:[16],value:[16],disabled:[4],locale:[1],utils:[16],touched:[32],validateRows:[64]},[[0,"brickDataChange","handleRowChange"]]]);function g(){"undefined"!=typeof customElements&&["fk-data-grid","fk-brick-actions","fk-brick-not-found","fk-brick-render","fk-drop-area"].forEach((o=>{switch(o){case"fk-data-grid":customElements.get(r(o))||customElements.define(r(o),k);break;case"fk-brick-actions":customElements.get(r(o))||c();break;case"fk-brick-not-found":customElements.get(r(o))||n();break;case"fk-brick-render":customElements.get(r(o))||l();break;case"fk-drop-area":customElements.get(r(o))||f()}}))}g();export{k as F,g as d}