@kong-ui-public/freeform 0.11.1 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/README.md +5 -2
  2. package/dist/filler/cypress/index.js +1 -1
  3. package/dist/filler/{field-walker-Br7Nv34c.js → field-walker-D8i4HBJh.js} +4860 -6371
  4. package/dist/filler/packages/core/freeform/src/composables/errors.d.ts +7 -1
  5. package/dist/filler/packages/core/freeform/src/composables/errors.d.ts.map +1 -1
  6. package/dist/filler/packages/core/freeform/src/composables/field.d.ts +7 -1
  7. package/dist/filler/packages/core/freeform/src/composables/field.d.ts.map +1 -1
  8. package/dist/filler/packages/core/freeform/src/composables/form-context.d.ts +2 -0
  9. package/dist/filler/packages/core/freeform/src/composables/form-context.d.ts.map +1 -1
  10. package/dist/filler/packages/core/freeform/src/composables/index.d.ts +1 -0
  11. package/dist/filler/packages/core/freeform/src/composables/index.d.ts.map +1 -1
  12. package/dist/filler/packages/core/freeform/src/composables/reveal-open.d.ts +15 -0
  13. package/dist/filler/packages/core/freeform/src/composables/reveal-open.d.ts.map +1 -0
  14. package/dist/filler/packages/core/freeform/src/composables/reveal.d.ts +7 -0
  15. package/dist/filler/packages/core/freeform/src/composables/reveal.d.ts.map +1 -1
  16. package/dist/filler/playwright/index.js +1 -1
  17. package/dist/freeform.es.js +1606 -1563
  18. package/dist/freeform.umd.js +5 -5
  19. package/dist/style.css +1 -1
  20. package/dist/types/composables/errors.d.ts +7 -1
  21. package/dist/types/composables/errors.d.ts.map +1 -1
  22. package/dist/types/composables/field.d.ts +7 -1
  23. package/dist/types/composables/field.d.ts.map +1 -1
  24. package/dist/types/composables/form-context.d.ts +2 -0
  25. package/dist/types/composables/form-context.d.ts.map +1 -1
  26. package/dist/types/composables/index.d.ts +1 -0
  27. package/dist/types/composables/index.d.ts.map +1 -1
  28. package/dist/types/composables/reveal-open.d.ts +15 -0
  29. package/dist/types/composables/reveal-open.d.ts.map +1 -0
  30. package/dist/types/composables/reveal.d.ts +7 -0
  31. package/dist/types/composables/reveal.d.ts.map +1 -1
  32. package/package.json +5 -5
@@ -33,6 +33,7 @@ export declare const provideFormShared: (options: {
33
33
  getEmptyOrDefault: <T = unknown>(path?: string) => EmptyValue | T;
34
34
  revealTarget: import("vue").ShallowRef<string | null, string | null>;
35
35
  registerFieldElement: (entry: import("./reveal").FieldElementEntry) => () => void;
36
+ findCoveringElement: (fieldPath: string) => Element | null;
36
37
  /**
37
38
  * Reveals the field at a data path, see `createFieldReveal`
38
39
  */
@@ -92,6 +93,7 @@ export declare const provideFormShared: (options: {
92
93
  getEmptyOrDefault: <T = unknown>(path?: string) => EmptyValue | T;
93
94
  revealTarget: import("vue").ShallowRef<string | null, string | null>;
94
95
  registerFieldElement: (entry: import("./reveal").FieldElementEntry) => () => void;
96
+ findCoveringElement: (fieldPath: string) => Element | null;
95
97
  /**
96
98
  * Reveals the field at a data path, see `createFieldReveal`
97
99
  */
@@ -1 +1 @@
1
- {"version":3,"file":"form-context.d.ts","sourceRoot":"","sources":["../../../src/composables/form-context.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,KAAK,CAAA;AACxD,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AACzF,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAElE,eAAO,MAAO,iBAAiB;YAEnB,UAAU,GAAG,gBAAgB;;;uBAGlB,gBAAgB,CAAC,WAAW,GAAG,SAAS,CAAC;kBAC9C,gBAAgB,CAAC,UAAU,EAAE,GAAG,SAAS,CAAC;kDAC7B,IAAI;qBACd,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,IAAI;;;;;;;;;;;;;;;;;;;;;wBAqJpB,MAAM;wBAIN,CAAC,mBAAmB,MAAM;;;I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AAM;wBAIN,CAAC,mBAAmB,MAAM;;;;IA0CnD;;OAEG;;;;;;;;;;;;;;;;;IAvBH;;OAEG;;;;;;;;;aA6C8jN,CAAC;qBAA6D,CAAC;;;;GArOrmN,qBAAqB;;;;;;;;;;;;;;;;;;;;wBA6JvB,MAAM;wBAIN,CAAC,mBAAmB,MAAM;;;;IA0CnD;;OAEG;;;;;;;;;;;;;;;;;IAvBH;;OAEG;;;;;;;;;aA6C8jN,CAAC;qBAA6D,CAAC;;;;aAfroN,CAAA;AAED,wBAAgB,aAAa,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAM/D,UAAU,CAAC,OAAO,qBAAqB,CAAC,GAAG;IACzD,QAAQ,EAAE,CAAC,CAAA;IACX,MAAM,EAAE,WAAW,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAA;IAClC,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,IAAI,CAAA;IAC/B,QAAQ,EAAE,MAAM,CAAC,CAAA;CAClB,CACF"}
@@ -8,6 +8,7 @@ export * from './form-context';
8
8
  export * from './labels';
9
9
  export type { RevealOptions, RevealResult } from './reveal';
10
10
  export { DEFAULT_REVEAL_DURATION, DEFAULT_REVEAL_HIGHLIGHT_DURATION } from './reveal';
11
+ export * from './reveal-open';
11
12
  export * from './schema';
12
13
  export * from './useMapField';
13
14
  export { renderRuleExactMatch } from './render-rules';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/composables/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,oBAAoB,CAAA;AAClC,cAAc,cAAc,CAAA;AAC5B,cAAc,SAAS,CAAA;AACvB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,UAAU,CAAA;AACxB,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAC3D,OAAO,EAAE,uBAAuB,EAAE,iCAAiC,EAAE,MAAM,UAAU,CAAA;AACrF,cAAc,UAAU,CAAA;AACxB,cAAc,eAAe,CAAA;AAC7B,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/composables/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,oBAAoB,CAAA;AAClC,cAAc,cAAc,CAAA;AAC5B,cAAc,SAAS,CAAA;AACvB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,UAAU,CAAA;AACxB,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAC3D,OAAO,EAAE,uBAAuB,EAAE,iCAAiC,EAAE,MAAM,UAAU,CAAA;AACrF,cAAc,eAAe,CAAA;AAC7B,cAAc,UAAU,CAAA;AACxB,cAAc,eAAe,CAAA;AAC7B,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAA"}
@@ -0,0 +1,15 @@
1
+ import type { MaybeRefOrGetter } from 'vue';
2
+ /**
3
+ * Opens a collapsed section when a reveal heads for a field inside it.
4
+ *
5
+ * For a section that hides its content but keeps it mounted (e.g. `KCollapse`,
6
+ * which uses `v-show`): the fields inside are registered, so the form knows
7
+ * which mounted field stands for the target. When that field's element is
8
+ * inside `container`, `open` is called, and the reveal lands once the field
9
+ * shows. A section that unmounts its content can't tell what is inside it.
10
+ *
11
+ * @param container The section's root element
12
+ * @param open Opens the section; only view state should change
13
+ */
14
+ export declare function useRevealOpen(container: MaybeRefOrGetter<Element | null | undefined>, open: () => void): void;
15
+ //# sourceMappingURL=reveal-open.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reveal-open.d.ts","sourceRoot":"","sources":["../../../src/composables/reveal-open.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,KAAK,CAAA;AAE3C;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAAC,SAAS,EAAE,gBAAgB,CAAC,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC,EAAE,IAAI,EAAE,MAAM,IAAI,QAgBtG"}
@@ -33,6 +33,11 @@ export interface FieldElementEntry {
33
33
  /** The field path, with key IDs for map entries */
34
34
  path: () => string;
35
35
  element: () => Element | null;
36
+ /**
37
+ * Child fields it leaves out, e.g. `ObjectField`'s `omit`. The entry stands
38
+ * for its path and everything below it except these.
39
+ */
40
+ exclude?: () => string[] | undefined;
36
41
  }
37
42
  type PathMapOptions = {
38
43
  formData: Record<string, any>;
@@ -58,6 +63,8 @@ export declare function toDataPath(fieldPath: string, getKey: PathMapOptions['ge
58
63
  export declare function createFieldReveal(options: PathMapOptions): {
59
64
  revealTarget: import("vue").ShallowRef<string | null, string | null>;
60
65
  registerFieldElement: (entry: FieldElementEntry) => () => void;
66
+ isFieldRendered: (fieldPath: string) => boolean;
67
+ findCoveringElement: (fieldPath: string) => Element | null;
61
68
  reveal: (path: string, { duration, highlight: withHighlight }?: RevealOptions) => Promise<RevealResult | null>;
62
69
  };
63
70
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"reveal.d.ts","sourceRoot":"","sources":["../../../src/composables/reveal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,KAAK,KAAK,EAAE,MAAM,KAAK,CAAA;AAMtD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AACrC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAEtD,MAAM,WAAW,YAAY;IAC3B;;;;OAIG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ,6CAA6C;IAC7C,KAAK,EAAE,OAAO,CAAA;CACf;AAED,MAAM,WAAW,aAAa;IAC5B;;;;OAI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YlB,iBAAiB;iCAgDlB,MAAM,KAAG,OAAO;qCASZ,MAAM,KAAG,OAAO,GAAG,IAAI;mBAgCvD,MAAM,2CAC6D,aAAa,KACrF,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC;EAmEhC;AAmBD;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,GAAG,IAAI,CAiB5D"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kong-ui-public/freeform",
3
- "version": "0.11.1",
3
+ "version": "0.12.0",
4
4
  "type": "module",
5
5
  "main": "./dist/freeform.umd.js",
6
6
  "module": "./dist/freeform.es.js",
@@ -36,14 +36,14 @@
36
36
  "marked": "^18.1.0"
37
37
  },
38
38
  "peerDependencies": {
39
- "@kong-ui-public/forms": "^4.36.15",
39
+ "@kong-ui-public/forms": "^4.36.16",
40
40
  "@kong-ui-public/i18n": "^2.5.1",
41
41
  "@kong-ui-public/misc-widgets": "^2.7.7",
42
42
  "@kong/design-tokens": "^3.3.0",
43
43
  "@kong/icons": "^1.58.0",
44
44
  "@kong/kongponents": "^9.64.0",
45
45
  "@playwright/test": ">= 1.0.0 < 2.0.0",
46
- "@vueuse/core": "^14.3.0",
46
+ "@vueuse/core": "^14.3.0 || ^15.0.0",
47
47
  "vue": ">= 3.5.0 < 4"
48
48
  },
49
49
  "peerDependenciesMeta": {
@@ -52,7 +52,7 @@
52
52
  }
53
53
  },
54
54
  "devDependencies": {
55
- "@kong-ui-public/forms": "^4.36.15",
55
+ "@kong-ui-public/forms": "^4.36.16",
56
56
  "@kong-ui-public/i18n": "^2.5.1",
57
57
  "@kong-ui-public/misc-widgets": "^2.7.7",
58
58
  "@kong-ui-public/sandbox-layout": "^2.8.8",
@@ -61,7 +61,7 @@
61
61
  "@kong/kongponents": "9.66.16",
62
62
  "@playwright/experimental-ct-vue": "^1.62.1",
63
63
  "@playwright/test": "^1.64.1",
64
- "@vueuse/core": "^14.4.0",
64
+ "@vueuse/core": "^15.0.0",
65
65
  "vue": "^3.5.43",
66
66
  "vue-router": "^5.4.0"
67
67
  },