@genesislcap/foundation-react-utils 14.429.0 → 14.429.2-alpha-0d0a008.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/custom-elements.json +1 -1
- package/dist/dts/create-react-renderer.d.ts +6 -9
- package/dist/dts/create-react-renderer.d.ts.map +1 -1
- package/dist/esm/create-react-renderer.js +5 -3
- package/dist/foundation-react-utils.d.ts +6 -9
- package/package.json +13 -13
- package/src/create-react-renderer.ts +14 -12
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
{
|
|
25
25
|
"name": "options",
|
|
26
26
|
"type": {
|
|
27
|
-
"text": "{\n /**\n * The custom element tag name to register. Must be unique and contain a hyphen.\n * e.g. 'my-price-renderer'\n */\n name: string;\n /**\n * RankedTester from @jsonforms/core — determines when this renderer applies.\n * Use rankWith(rank, tester) — rank 5+ recommended to override built-ins.\n */\n tester: RankedTester;\n /**\n * Custom mapper if you need to transform state differently.\n * Defaults to mapStateToControlProps from @jsonforms/core.\n */\n mapper?: (state: JsonFormsState, ownProps: OwnPropsOfControl) => StatePropsOfControl;\n /**\n * Whether to wrap the React component in the platform's
|
|
27
|
+
"text": "{\n /**\n * The custom element tag name to register. Must be unique and contain a hyphen.\n * e.g. 'my-price-renderer'\n */\n name: string;\n /**\n * RankedTester from @jsonforms/core — determines when this renderer applies.\n * Use rankWith(rank, tester) — rank 5+ recommended to override built-ins.\n */\n tester: RankedTester;\n /**\n * Custom mapper if you need to transform state differently.\n * Defaults to mapStateToControlProps from @jsonforms/core.\n */\n mapper?: (state: JsonFormsState, ownProps: OwnPropsOfControl) => StatePropsOfControl;\n /**\n * Whether to wrap the React component in the platform's control-wrapper template,\n * which provides consistent label rendering, error display, and accessibility.\n * Defaults to true. Set to false if your React component handles its own labels/errors.\n *\n * Note: if your component has layout conflicts with the wrapper's internal flex styles\n * (e.g. a block-level combobox that shrinks to content width), you can target the\n * wrapper's inner element directly in light DOM:\n *\n * .foundation-control-wrapper { display: block; }\n */\n wrapWithControlWrapper?: boolean;\n }"
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
],
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type RendererControlProps, type RendererEntry } from '@genesislcap/foundation-forms';
|
|
2
2
|
import { type JsonFormsState, type OwnPropsOfControl, type RankedTester, type StatePropsOfControl } from '@jsonforms/core';
|
|
3
3
|
import type { ComponentType } from 'react';
|
|
4
4
|
/**
|
|
@@ -66,18 +66,15 @@ export declare function createReactRenderer(Component: ComponentType<RendererCon
|
|
|
66
66
|
*/
|
|
67
67
|
mapper?: (state: JsonFormsState, ownProps: OwnPropsOfControl) => StatePropsOfControl;
|
|
68
68
|
/**
|
|
69
|
-
* Whether to wrap the React component in the platform's
|
|
69
|
+
* Whether to wrap the React component in the platform's control-wrapper template,
|
|
70
70
|
* which provides consistent label rendering, error display, and accessibility.
|
|
71
71
|
* Defaults to true. Set to false if your React component handles its own labels/errors.
|
|
72
72
|
*
|
|
73
|
-
* Note: if your component has layout conflicts with
|
|
74
|
-
* (e.g. a block-level combobox that shrinks to content width),
|
|
75
|
-
*
|
|
73
|
+
* Note: if your component has layout conflicts with the wrapper's internal flex styles
|
|
74
|
+
* (e.g. a block-level combobox that shrinks to content width), you can target the
|
|
75
|
+
* wrapper's inner element directly in light DOM:
|
|
76
76
|
*
|
|
77
|
-
* control-wrapper
|
|
78
|
-
*
|
|
79
|
-
* This avoids losing built-in label/error/accessibility while still allowing external styling.
|
|
80
|
-
* The `part="wrapper"` is exposed on the inner slot-hosting div of <control-wrapper>.
|
|
77
|
+
* .foundation-control-wrapper { display: block; }
|
|
81
78
|
*/
|
|
82
79
|
wrapWithControlWrapper?: boolean;
|
|
83
80
|
}): RendererEntry;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-react-renderer.d.ts","sourceRoot":"","sources":["../../src/create-react-renderer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"create-react-renderer.d.ts","sourceRoot":"","sources":["../../src/create-react-renderer.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,oBAAoB,EACzB,KAAK,aAAa,EACnB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACzB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,wBAAgB,mBAAmB,CACjC,SAAS,EAAE,aAAa,CAAC,oBAAoB,CAAC,EAC9C,OAAO,EAAE;IACP;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,MAAM,EAAE,YAAY,CAAC;IACrB;;;OAGG;IACH,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,iBAAiB,KAAK,mBAAmB,CAAC;IACrF;;;;;;;;;;OAUG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC,GACA,aAAa,CAoDf"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { controlWrapperTemplate, } from '@genesislcap/foundation-forms';
|
|
1
2
|
import { html } from '@genesislcap/web-core';
|
|
2
3
|
import { mapStateToControlProps, } from '@jsonforms/core';
|
|
3
4
|
import r2wc from '@r2wc/react-to-web-component';
|
|
@@ -83,9 +84,10 @@ export function createReactRenderer(Component, options) {
|
|
|
83
84
|
const template = useWrapper
|
|
84
85
|
? html `
|
|
85
86
|
<template>
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
87
|
+
${controlWrapperTemplate({
|
|
88
|
+
prefix: 'zero',
|
|
89
|
+
innerTemplate: innerTemplate(name),
|
|
90
|
+
})}
|
|
89
91
|
</template>
|
|
90
92
|
`
|
|
91
93
|
: html `
|
|
@@ -5,7 +5,7 @@ import { OwnPropsOfControl } from '@jsonforms/core';
|
|
|
5
5
|
import { RankedTester } from '@jsonforms/core';
|
|
6
6
|
import * as React_2 from 'react';
|
|
7
7
|
import { RendererControlProps } from '@genesislcap/foundation-forms';
|
|
8
|
-
import
|
|
8
|
+
import { RendererEntry } from '@genesislcap/foundation-forms';
|
|
9
9
|
import { StatePropsOfControl } from '@jsonforms/core';
|
|
10
10
|
|
|
11
11
|
/**
|
|
@@ -73,18 +73,15 @@ export declare function createReactRenderer(Component: ComponentType<RendererCon
|
|
|
73
73
|
*/
|
|
74
74
|
mapper?: (state: JsonFormsState, ownProps: OwnPropsOfControl) => StatePropsOfControl;
|
|
75
75
|
/**
|
|
76
|
-
* Whether to wrap the React component in the platform's
|
|
76
|
+
* Whether to wrap the React component in the platform's control-wrapper template,
|
|
77
77
|
* which provides consistent label rendering, error display, and accessibility.
|
|
78
78
|
* Defaults to true. Set to false if your React component handles its own labels/errors.
|
|
79
79
|
*
|
|
80
|
-
* Note: if your component has layout conflicts with
|
|
81
|
-
* (e.g. a block-level combobox that shrinks to content width),
|
|
82
|
-
*
|
|
80
|
+
* Note: if your component has layout conflicts with the wrapper's internal flex styles
|
|
81
|
+
* (e.g. a block-level combobox that shrinks to content width), you can target the
|
|
82
|
+
* wrapper's inner element directly in light DOM:
|
|
83
83
|
*
|
|
84
|
-
* control-wrapper
|
|
85
|
-
*
|
|
86
|
-
* This avoids losing built-in label/error/accessibility while still allowing external styling.
|
|
87
|
-
* The `part="wrapper"` is exposed on the inner slot-hosting div of <control-wrapper>.
|
|
84
|
+
* .foundation-control-wrapper { display: block; }
|
|
88
85
|
*/
|
|
89
86
|
wrapWithControlWrapper?: boolean;
|
|
90
87
|
}): RendererEntry;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@genesislcap/foundation-react-utils",
|
|
3
3
|
"description": "Genesis Foundation React Utils",
|
|
4
|
-
"version": "14.429.0",
|
|
4
|
+
"version": "14.429.2-alpha-0d0a008.0",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"license": "SEE LICENSE IN license.txt",
|
|
7
7
|
"main": "dist/esm/index.js",
|
|
@@ -29,23 +29,23 @@
|
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@genesislcap/foundation-testing": "14.429.0",
|
|
33
|
-
"@genesislcap/genx": "14.429.0",
|
|
34
|
-
"@genesislcap/rollup-builder": "14.429.0",
|
|
35
|
-
"@genesislcap/ts-builder": "14.429.0",
|
|
36
|
-
"@genesislcap/uvu-playwright-builder": "14.429.0",
|
|
37
|
-
"@genesislcap/vite-builder": "14.429.0",
|
|
38
|
-
"@genesislcap/webpack-builder": "14.429.0"
|
|
32
|
+
"@genesislcap/foundation-testing": "14.429.2-alpha-0d0a008.0",
|
|
33
|
+
"@genesislcap/genx": "14.429.2-alpha-0d0a008.0",
|
|
34
|
+
"@genesislcap/rollup-builder": "14.429.2-alpha-0d0a008.0",
|
|
35
|
+
"@genesislcap/ts-builder": "14.429.2-alpha-0d0a008.0",
|
|
36
|
+
"@genesislcap/uvu-playwright-builder": "14.429.2-alpha-0d0a008.0",
|
|
37
|
+
"@genesislcap/vite-builder": "14.429.2-alpha-0d0a008.0",
|
|
38
|
+
"@genesislcap/webpack-builder": "14.429.2-alpha-0d0a008.0"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"react": "^19.0.0",
|
|
42
42
|
"react-dom": "^19.0.0"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@genesislcap/foundation-forms": "14.429.0",
|
|
46
|
-
"@genesislcap/foundation-layout": "14.429.0",
|
|
47
|
-
"@genesislcap/foundation-logger": "14.429.0",
|
|
48
|
-
"@genesislcap/web-core": "14.429.0",
|
|
45
|
+
"@genesislcap/foundation-forms": "14.429.2-alpha-0d0a008.0",
|
|
46
|
+
"@genesislcap/foundation-layout": "14.429.2-alpha-0d0a008.0",
|
|
47
|
+
"@genesislcap/foundation-logger": "14.429.2-alpha-0d0a008.0",
|
|
48
|
+
"@genesislcap/web-core": "14.429.2-alpha-0d0a008.0",
|
|
49
49
|
"@jsonforms/core": "^3.2.1",
|
|
50
50
|
"@r2wc/react-to-web-component": "^2.0.2"
|
|
51
51
|
},
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"access": "public"
|
|
59
59
|
},
|
|
60
60
|
"customElements": "dist/custom-elements.json",
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "70bcfc8eced0a855333c57f9a5a18782ff49c7f5"
|
|
62
62
|
}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import {
|
|
2
|
+
controlWrapperTemplate,
|
|
3
|
+
type RendererControlProps,
|
|
4
|
+
type RendererEntry,
|
|
5
|
+
} from '@genesislcap/foundation-forms';
|
|
2
6
|
import { html } from '@genesislcap/web-core';
|
|
3
7
|
import {
|
|
4
8
|
mapStateToControlProps,
|
|
@@ -77,18 +81,15 @@ export function createReactRenderer(
|
|
|
77
81
|
*/
|
|
78
82
|
mapper?: (state: JsonFormsState, ownProps: OwnPropsOfControl) => StatePropsOfControl;
|
|
79
83
|
/**
|
|
80
|
-
* Whether to wrap the React component in the platform's
|
|
84
|
+
* Whether to wrap the React component in the platform's control-wrapper template,
|
|
81
85
|
* which provides consistent label rendering, error display, and accessibility.
|
|
82
86
|
* Defaults to true. Set to false if your React component handles its own labels/errors.
|
|
83
87
|
*
|
|
84
|
-
* Note: if your component has layout conflicts with
|
|
85
|
-
* (e.g. a block-level combobox that shrinks to content width),
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
* control-wrapper::part(wrapper) { display: block; }
|
|
88
|
+
* Note: if your component has layout conflicts with the wrapper's internal flex styles
|
|
89
|
+
* (e.g. a block-level combobox that shrinks to content width), you can target the
|
|
90
|
+
* wrapper's inner element directly in light DOM:
|
|
89
91
|
*
|
|
90
|
-
*
|
|
91
|
-
* The `part="wrapper"` is exposed on the inner slot-hosting div of <control-wrapper>.
|
|
92
|
+
* .foundation-control-wrapper { display: block; }
|
|
92
93
|
*/
|
|
93
94
|
wrapWithControlWrapper?: boolean;
|
|
94
95
|
},
|
|
@@ -129,9 +130,10 @@ export function createReactRenderer(
|
|
|
129
130
|
const template = useWrapper
|
|
130
131
|
? html`
|
|
131
132
|
<template>
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
133
|
+
${controlWrapperTemplate({
|
|
134
|
+
prefix: 'zero',
|
|
135
|
+
innerTemplate: innerTemplate(name) as any,
|
|
136
|
+
})}
|
|
135
137
|
</template>
|
|
136
138
|
`
|
|
137
139
|
: html`
|