@genesislcap/foundation-forms 14.424.1-alpha-cfc2887.0 → 14.425.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.
@@ -1901,232 +1901,6 @@
1901
1901
  }
1902
1902
  ]
1903
1903
  },
1904
- {
1905
- "kind": "javascript-module",
1906
- "path": "src/jsonforms/testers/isArray.ts",
1907
- "declarations": [
1908
- {
1909
- "kind": "function",
1910
- "name": "isArray",
1911
- "parameters": [
1912
- {
1913
- "name": "itemsType",
1914
- "type": {
1915
- "text": "ArrayItemsType"
1916
- }
1917
- }
1918
- ]
1919
- }
1920
- ],
1921
- "exports": [
1922
- {
1923
- "kind": "js",
1924
- "name": "isArray",
1925
- "declaration": {
1926
- "name": "isArray",
1927
- "module": "src/jsonforms/testers/isArray.ts"
1928
- }
1929
- }
1930
- ]
1931
- },
1932
- {
1933
- "kind": "javascript-module",
1934
- "path": "src/jsonforms/testers/isDate.ts",
1935
- "declarations": [
1936
- {
1937
- "kind": "variable",
1938
- "name": "isOneOfDate"
1939
- }
1940
- ],
1941
- "exports": [
1942
- {
1943
- "kind": "js",
1944
- "name": "isOneOfDate",
1945
- "declaration": {
1946
- "name": "isOneOfDate",
1947
- "module": "src/jsonforms/testers/isDate.ts"
1948
- }
1949
- }
1950
- ]
1951
- },
1952
- {
1953
- "kind": "javascript-module",
1954
- "path": "src/jsonforms/testers/isInvisible.ts",
1955
- "declarations": [
1956
- {
1957
- "kind": "function",
1958
- "name": "isInvisible",
1959
- "return": {
1960
- "type": {
1961
- "text": "boolean"
1962
- }
1963
- },
1964
- "parameters": [
1965
- {
1966
- "name": "uischema",
1967
- "type": {
1968
- "text": "UISchemaElement"
1969
- }
1970
- },
1971
- {
1972
- "name": "schema",
1973
- "type": {
1974
- "text": "JsonSchema"
1975
- }
1976
- },
1977
- {
1978
- "name": "context",
1979
- "type": {
1980
- "text": "TesterContext"
1981
- }
1982
- }
1983
- ]
1984
- }
1985
- ],
1986
- "exports": [
1987
- {
1988
- "kind": "js",
1989
- "name": "isInvisible",
1990
- "declaration": {
1991
- "name": "isInvisible",
1992
- "module": "src/jsonforms/testers/isInvisible.ts"
1993
- }
1994
- }
1995
- ]
1996
- },
1997
- {
1998
- "kind": "javascript-module",
1999
- "path": "src/jsonforms/testers/isOneOfBoolean.ts",
2000
- "declarations": [
2001
- {
2002
- "kind": "variable",
2003
- "name": "isOneOfBoolean"
2004
- }
2005
- ],
2006
- "exports": [
2007
- {
2008
- "kind": "js",
2009
- "name": "isOneOfBoolean",
2010
- "declaration": {
2011
- "name": "isOneOfBoolean",
2012
- "module": "src/jsonforms/testers/isOneOfBoolean.ts"
2013
- }
2014
- }
2015
- ]
2016
- },
2017
- {
2018
- "kind": "javascript-module",
2019
- "path": "src/jsonforms/testers/isOneOfEnum.ts",
2020
- "declarations": [
2021
- {
2022
- "kind": "variable",
2023
- "name": "isOneOfEnum"
2024
- }
2025
- ],
2026
- "exports": [
2027
- {
2028
- "kind": "js",
2029
- "name": "isOneOfEnum",
2030
- "declaration": {
2031
- "name": "isOneOfEnum",
2032
- "module": "src/jsonforms/testers/isOneOfEnum.ts"
2033
- }
2034
- }
2035
- ]
2036
- },
2037
- {
2038
- "kind": "javascript-module",
2039
- "path": "src/jsonforms/testers/isOneOfNumber.ts",
2040
- "declarations": [
2041
- {
2042
- "kind": "variable",
2043
- "name": "isOneOfNumber"
2044
- }
2045
- ],
2046
- "exports": [
2047
- {
2048
- "kind": "js",
2049
- "name": "isOneOfNumber",
2050
- "declaration": {
2051
- "name": "isOneOfNumber",
2052
- "module": "src/jsonforms/testers/isOneOfNumber.ts"
2053
- }
2054
- }
2055
- ]
2056
- },
2057
- {
2058
- "kind": "javascript-module",
2059
- "path": "src/jsonforms/testers/isOneOfOptionMultiselect.ts",
2060
- "declarations": [
2061
- {
2062
- "kind": "variable",
2063
- "name": "isOneOfOptionMultiselect"
2064
- }
2065
- ],
2066
- "exports": [
2067
- {
2068
- "kind": "js",
2069
- "name": "isOneOfOptionMultiselect",
2070
- "declaration": {
2071
- "name": "isOneOfOptionMultiselect",
2072
- "module": "src/jsonforms/testers/isOneOfOptionMultiselect.ts"
2073
- }
2074
- }
2075
- ]
2076
- },
2077
- {
2078
- "kind": "javascript-module",
2079
- "path": "src/jsonforms/testers/isTime.ts",
2080
- "declarations": [
2081
- {
2082
- "kind": "variable",
2083
- "name": "isOneOfTime"
2084
- }
2085
- ],
2086
- "exports": [
2087
- {
2088
- "kind": "js",
2089
- "name": "isOneOfTime",
2090
- "declaration": {
2091
- "name": "isOneOfTime",
2092
- "module": "src/jsonforms/testers/isTime.ts"
2093
- }
2094
- }
2095
- ]
2096
- },
2097
- {
2098
- "kind": "javascript-module",
2099
- "path": "src/jsonforms/testers/optionIs.ts",
2100
- "declarations": [
2101
- {
2102
- "kind": "function",
2103
- "name": "optionIs",
2104
- "return": {
2105
- "type": {
2106
- "text": "Tester"
2107
- }
2108
- },
2109
- "parameters": [
2110
- {
2111
- "name": "optionName",
2112
- "type": {
2113
- "text": "string"
2114
- }
2115
- }
2116
- ]
2117
- }
2118
- ],
2119
- "exports": [
2120
- {
2121
- "kind": "js",
2122
- "name": "optionIs",
2123
- "declaration": {
2124
- "name": "optionIs",
2125
- "module": "src/jsonforms/testers/optionIs.ts"
2126
- }
2127
- }
2128
- ]
2129
- },
2130
1904
  {
2131
1905
  "kind": "javascript-module",
2132
1906
  "path": "src/jsonforms/renderers/ArrayListWrapperRenderer.ts",
@@ -4287,6 +4061,232 @@
4287
4061
  }
4288
4062
  }
4289
4063
  ]
4064
+ },
4065
+ {
4066
+ "kind": "javascript-module",
4067
+ "path": "src/jsonforms/testers/isArray.ts",
4068
+ "declarations": [
4069
+ {
4070
+ "kind": "function",
4071
+ "name": "isArray",
4072
+ "parameters": [
4073
+ {
4074
+ "name": "itemsType",
4075
+ "type": {
4076
+ "text": "ArrayItemsType"
4077
+ }
4078
+ }
4079
+ ]
4080
+ }
4081
+ ],
4082
+ "exports": [
4083
+ {
4084
+ "kind": "js",
4085
+ "name": "isArray",
4086
+ "declaration": {
4087
+ "name": "isArray",
4088
+ "module": "src/jsonforms/testers/isArray.ts"
4089
+ }
4090
+ }
4091
+ ]
4092
+ },
4093
+ {
4094
+ "kind": "javascript-module",
4095
+ "path": "src/jsonforms/testers/isDate.ts",
4096
+ "declarations": [
4097
+ {
4098
+ "kind": "variable",
4099
+ "name": "isOneOfDate"
4100
+ }
4101
+ ],
4102
+ "exports": [
4103
+ {
4104
+ "kind": "js",
4105
+ "name": "isOneOfDate",
4106
+ "declaration": {
4107
+ "name": "isOneOfDate",
4108
+ "module": "src/jsonforms/testers/isDate.ts"
4109
+ }
4110
+ }
4111
+ ]
4112
+ },
4113
+ {
4114
+ "kind": "javascript-module",
4115
+ "path": "src/jsonforms/testers/isInvisible.ts",
4116
+ "declarations": [
4117
+ {
4118
+ "kind": "function",
4119
+ "name": "isInvisible",
4120
+ "return": {
4121
+ "type": {
4122
+ "text": "boolean"
4123
+ }
4124
+ },
4125
+ "parameters": [
4126
+ {
4127
+ "name": "uischema",
4128
+ "type": {
4129
+ "text": "UISchemaElement"
4130
+ }
4131
+ },
4132
+ {
4133
+ "name": "schema",
4134
+ "type": {
4135
+ "text": "JsonSchema"
4136
+ }
4137
+ },
4138
+ {
4139
+ "name": "context",
4140
+ "type": {
4141
+ "text": "TesterContext"
4142
+ }
4143
+ }
4144
+ ]
4145
+ }
4146
+ ],
4147
+ "exports": [
4148
+ {
4149
+ "kind": "js",
4150
+ "name": "isInvisible",
4151
+ "declaration": {
4152
+ "name": "isInvisible",
4153
+ "module": "src/jsonforms/testers/isInvisible.ts"
4154
+ }
4155
+ }
4156
+ ]
4157
+ },
4158
+ {
4159
+ "kind": "javascript-module",
4160
+ "path": "src/jsonforms/testers/isOneOfBoolean.ts",
4161
+ "declarations": [
4162
+ {
4163
+ "kind": "variable",
4164
+ "name": "isOneOfBoolean"
4165
+ }
4166
+ ],
4167
+ "exports": [
4168
+ {
4169
+ "kind": "js",
4170
+ "name": "isOneOfBoolean",
4171
+ "declaration": {
4172
+ "name": "isOneOfBoolean",
4173
+ "module": "src/jsonforms/testers/isOneOfBoolean.ts"
4174
+ }
4175
+ }
4176
+ ]
4177
+ },
4178
+ {
4179
+ "kind": "javascript-module",
4180
+ "path": "src/jsonforms/testers/isOneOfEnum.ts",
4181
+ "declarations": [
4182
+ {
4183
+ "kind": "variable",
4184
+ "name": "isOneOfEnum"
4185
+ }
4186
+ ],
4187
+ "exports": [
4188
+ {
4189
+ "kind": "js",
4190
+ "name": "isOneOfEnum",
4191
+ "declaration": {
4192
+ "name": "isOneOfEnum",
4193
+ "module": "src/jsonforms/testers/isOneOfEnum.ts"
4194
+ }
4195
+ }
4196
+ ]
4197
+ },
4198
+ {
4199
+ "kind": "javascript-module",
4200
+ "path": "src/jsonforms/testers/isOneOfNumber.ts",
4201
+ "declarations": [
4202
+ {
4203
+ "kind": "variable",
4204
+ "name": "isOneOfNumber"
4205
+ }
4206
+ ],
4207
+ "exports": [
4208
+ {
4209
+ "kind": "js",
4210
+ "name": "isOneOfNumber",
4211
+ "declaration": {
4212
+ "name": "isOneOfNumber",
4213
+ "module": "src/jsonforms/testers/isOneOfNumber.ts"
4214
+ }
4215
+ }
4216
+ ]
4217
+ },
4218
+ {
4219
+ "kind": "javascript-module",
4220
+ "path": "src/jsonforms/testers/isOneOfOptionMultiselect.ts",
4221
+ "declarations": [
4222
+ {
4223
+ "kind": "variable",
4224
+ "name": "isOneOfOptionMultiselect"
4225
+ }
4226
+ ],
4227
+ "exports": [
4228
+ {
4229
+ "kind": "js",
4230
+ "name": "isOneOfOptionMultiselect",
4231
+ "declaration": {
4232
+ "name": "isOneOfOptionMultiselect",
4233
+ "module": "src/jsonforms/testers/isOneOfOptionMultiselect.ts"
4234
+ }
4235
+ }
4236
+ ]
4237
+ },
4238
+ {
4239
+ "kind": "javascript-module",
4240
+ "path": "src/jsonforms/testers/isTime.ts",
4241
+ "declarations": [
4242
+ {
4243
+ "kind": "variable",
4244
+ "name": "isOneOfTime"
4245
+ }
4246
+ ],
4247
+ "exports": [
4248
+ {
4249
+ "kind": "js",
4250
+ "name": "isOneOfTime",
4251
+ "declaration": {
4252
+ "name": "isOneOfTime",
4253
+ "module": "src/jsonforms/testers/isTime.ts"
4254
+ }
4255
+ }
4256
+ ]
4257
+ },
4258
+ {
4259
+ "kind": "javascript-module",
4260
+ "path": "src/jsonforms/testers/optionIs.ts",
4261
+ "declarations": [
4262
+ {
4263
+ "kind": "function",
4264
+ "name": "optionIs",
4265
+ "return": {
4266
+ "type": {
4267
+ "text": "Tester"
4268
+ }
4269
+ },
4270
+ "parameters": [
4271
+ {
4272
+ "name": "optionName",
4273
+ "type": {
4274
+ "text": "string"
4275
+ }
4276
+ }
4277
+ ]
4278
+ }
4279
+ ],
4280
+ "exports": [
4281
+ {
4282
+ "kind": "js",
4283
+ "name": "optionIs",
4284
+ "declaration": {
4285
+ "name": "optionIs",
4286
+ "module": "src/jsonforms/testers/optionIs.ts"
4287
+ }
4288
+ }
4289
+ ]
4290
4290
  }
4291
4291
  ]
4292
4292
  }
package/dist/react.cjs CHANGED
@@ -5,7 +5,6 @@
5
5
 
6
6
  'use strict';
7
7
 
8
- const { provideReactWrapper } = require('@microsoft/fast-react-wrapper');
9
8
  const React = require('react');
10
9
  const { Filters: FiltersWC } = require('./esm/filters/filters.js');
11
10
  const { Form: FormWC } = require('./esm/form.js');
@@ -18,46 +17,143 @@ const { StepperWrapper: StepperWrapperWC } = require('./esm/jsonforms/renderers/
18
17
  const { VerticalCategorizationWrapper: VerticalCategorizationWrapperWC } = require('./esm/jsonforms/renderers/VerticalCategorizationWrapperRenderer.js');
19
18
  const { DispatchRenderer: DispatchRendererWC } = require('./esm/jsonforms/renderers/dispatch-renderer.js');
20
19
 
21
- const { wrap } = provideReactWrapper(React);
20
+ function _mergeRefs(...refs) {
21
+ return (value) => {
22
+ for (const ref of refs) {
23
+ if (typeof ref === 'function') ref(value);
24
+ else if (ref != null) ref.current = value;
25
+ }
26
+ };
27
+ }
22
28
 
23
- const Form = wrap(FormWC, {
24
- events: {
25
- onSubmitFailure: 'submit-failure',
26
- onSubmitSuccess: 'submit-success',
27
- onSubmitPartialSuccess: 'submit-partial-success',
28
- onRowStatusChanged: 'row-status-changed',
29
- onBulkSubmitComplete: 'bulk-submit-complete',
30
- onRowSubmitFailure: 'row-submit-failure',
31
- onRowSubmitSuccess: 'row-submit-success',
32
- onDataChange: 'data-change',
33
- onCsvParseError: 'csv-parse-error',
34
- onCsvImported: 'csv-imported',
35
- onCsvTemplateError: 'csv-template-error',
36
- onCsvTemplateDownloaded: 'csv-template-downloaded',
37
- },
29
+ const Form = React.forwardRef(function Form(props, ref) {
30
+ const { onSubmitFailure, onSubmitSuccess, onSubmitPartialSuccess, onRowStatusChanged, onBulkSubmitComplete, onRowSubmitFailure, onRowSubmitSuccess, onDataChange, onCsvParseError, onCsvImported, onCsvTemplateError, onCsvTemplateDownloaded, children, ...rest } = props;
31
+ const _innerRef = React.useRef(null);
32
+ const _onSubmitFailureRef = React.useRef(onSubmitFailure);
33
+ _onSubmitFailureRef.current = onSubmitFailure;
34
+ const _onSubmitSuccessRef = React.useRef(onSubmitSuccess);
35
+ _onSubmitSuccessRef.current = onSubmitSuccess;
36
+ const _onSubmitPartialSuccessRef = React.useRef(onSubmitPartialSuccess);
37
+ _onSubmitPartialSuccessRef.current = onSubmitPartialSuccess;
38
+ const _onRowStatusChangedRef = React.useRef(onRowStatusChanged);
39
+ _onRowStatusChangedRef.current = onRowStatusChanged;
40
+ const _onBulkSubmitCompleteRef = React.useRef(onBulkSubmitComplete);
41
+ _onBulkSubmitCompleteRef.current = onBulkSubmitComplete;
42
+ const _onRowSubmitFailureRef = React.useRef(onRowSubmitFailure);
43
+ _onRowSubmitFailureRef.current = onRowSubmitFailure;
44
+ const _onRowSubmitSuccessRef = React.useRef(onRowSubmitSuccess);
45
+ _onRowSubmitSuccessRef.current = onRowSubmitSuccess;
46
+ const _onDataChangeRef = React.useRef(onDataChange);
47
+ _onDataChangeRef.current = onDataChange;
48
+ const _onCsvParseErrorRef = React.useRef(onCsvParseError);
49
+ _onCsvParseErrorRef.current = onCsvParseError;
50
+ const _onCsvImportedRef = React.useRef(onCsvImported);
51
+ _onCsvImportedRef.current = onCsvImported;
52
+ const _onCsvTemplateErrorRef = React.useRef(onCsvTemplateError);
53
+ _onCsvTemplateErrorRef.current = onCsvTemplateError;
54
+ const _onCsvTemplateDownloadedRef = React.useRef(onCsvTemplateDownloaded);
55
+ _onCsvTemplateDownloadedRef.current = onCsvTemplateDownloaded;
56
+ React.useLayoutEffect(() => {
57
+ const el = _innerRef.current;
58
+ if (!el) return;
59
+ const _onSubmitFailureFn = (e) => _onSubmitFailureRef.current?.(e);
60
+ el.addEventListener('submit-failure', _onSubmitFailureFn);
61
+ const _onSubmitSuccessFn = (e) => _onSubmitSuccessRef.current?.(e);
62
+ el.addEventListener('submit-success', _onSubmitSuccessFn);
63
+ const _onSubmitPartialSuccessFn = (e) => _onSubmitPartialSuccessRef.current?.(e);
64
+ el.addEventListener('submit-partial-success', _onSubmitPartialSuccessFn);
65
+ const _onRowStatusChangedFn = (e) => _onRowStatusChangedRef.current?.(e);
66
+ el.addEventListener('row-status-changed', _onRowStatusChangedFn);
67
+ const _onBulkSubmitCompleteFn = (e) => _onBulkSubmitCompleteRef.current?.(e);
68
+ el.addEventListener('bulk-submit-complete', _onBulkSubmitCompleteFn);
69
+ const _onRowSubmitFailureFn = (e) => _onRowSubmitFailureRef.current?.(e);
70
+ el.addEventListener('row-submit-failure', _onRowSubmitFailureFn);
71
+ const _onRowSubmitSuccessFn = (e) => _onRowSubmitSuccessRef.current?.(e);
72
+ el.addEventListener('row-submit-success', _onRowSubmitSuccessFn);
73
+ const _onDataChangeFn = (e) => _onDataChangeRef.current?.(e);
74
+ el.addEventListener('data-change', _onDataChangeFn);
75
+ const _onCsvParseErrorFn = (e) => _onCsvParseErrorRef.current?.(e);
76
+ el.addEventListener('csv-parse-error', _onCsvParseErrorFn);
77
+ const _onCsvImportedFn = (e) => _onCsvImportedRef.current?.(e);
78
+ el.addEventListener('csv-imported', _onCsvImportedFn);
79
+ const _onCsvTemplateErrorFn = (e) => _onCsvTemplateErrorRef.current?.(e);
80
+ el.addEventListener('csv-template-error', _onCsvTemplateErrorFn);
81
+ const _onCsvTemplateDownloadedFn = (e) => _onCsvTemplateDownloadedRef.current?.(e);
82
+ el.addEventListener('csv-template-downloaded', _onCsvTemplateDownloadedFn);
83
+ return () => {
84
+ el.removeEventListener('submit-failure', _onSubmitFailureFn);
85
+ el.removeEventListener('submit-success', _onSubmitSuccessFn);
86
+ el.removeEventListener('submit-partial-success', _onSubmitPartialSuccessFn);
87
+ el.removeEventListener('row-status-changed', _onRowStatusChangedFn);
88
+ el.removeEventListener('bulk-submit-complete', _onBulkSubmitCompleteFn);
89
+ el.removeEventListener('row-submit-failure', _onRowSubmitFailureFn);
90
+ el.removeEventListener('row-submit-success', _onRowSubmitSuccessFn);
91
+ el.removeEventListener('data-change', _onDataChangeFn);
92
+ el.removeEventListener('csv-parse-error', _onCsvParseErrorFn);
93
+ el.removeEventListener('csv-imported', _onCsvImportedFn);
94
+ el.removeEventListener('csv-template-error', _onCsvTemplateErrorFn);
95
+ el.removeEventListener('csv-template-downloaded', _onCsvTemplateDownloadedFn);
96
+ };
97
+ }, []);
98
+ return React.createElement(customElements.getName(FormWC) ?? 'foundation-form', { ...rest, ref: _mergeRefs(_innerRef, ref) }, children);
38
99
  });
39
100
 
40
- const Filters = wrap(FiltersWC);
101
+ const Filters = React.forwardRef(function Filters(props, ref) {
102
+ const { children, ...rest } = props;
103
+ return React.createElement(customElements.getName(FiltersWC) ?? 'foundation-filters', { ...rest, ref }, children);
104
+ });
41
105
 
42
- const JSONForms = wrap(JSONFormsWC, {
43
- events: {
44
- onDataChange: 'data-change',
45
- },
106
+ const JSONForms = React.forwardRef(function JSONForms(props, ref) {
107
+ const { onDataChange, children, ...rest } = props;
108
+ const _innerRef = React.useRef(null);
109
+ const _onDataChangeRef = React.useRef(onDataChange);
110
+ _onDataChangeRef.current = onDataChange;
111
+ React.useLayoutEffect(() => {
112
+ const el = _innerRef.current;
113
+ if (!el) return;
114
+ const _onDataChangeFn = (e) => _onDataChangeRef.current?.(e);
115
+ el.addEventListener('data-change', _onDataChangeFn);
116
+ return () => {
117
+ el.removeEventListener('data-change', _onDataChangeFn);
118
+ };
119
+ }, []);
120
+ return React.createElement(customElements.getName(JSONFormsWC) ?? 'json-forms', { ...rest, ref: _mergeRefs(_innerRef, ref) }, children);
46
121
  });
47
122
 
48
- const ArrayListWrapper = wrap(ArrayListWrapperWC);
123
+ const ArrayListWrapper = React.forwardRef(function ArrayListWrapper(props, ref) {
124
+ const { children, ...rest } = props;
125
+ return React.createElement(customElements.getName(ArrayListWrapperWC) ?? 'array-list-wrapper', { ...rest, ref }, children);
126
+ });
49
127
 
50
- const CategorizationWrapper = wrap(CategorizationWrapperWC);
128
+ const CategorizationWrapper = React.forwardRef(function CategorizationWrapper(props, ref) {
129
+ const { children, ...rest } = props;
130
+ return React.createElement(customElements.getName(CategorizationWrapperWC) ?? 'categorization-wrapper', { ...rest, ref }, children);
131
+ });
51
132
 
52
- const ControlWrapper = wrap(ControlWrapperWC);
133
+ const ControlWrapper = React.forwardRef(function ControlWrapper(props, ref) {
134
+ const { children, ...rest } = props;
135
+ return React.createElement(customElements.getName(ControlWrapperWC) ?? 'control-wrapper', { ...rest, ref }, children);
136
+ });
53
137
 
54
- const LayoutWrapper = wrap(LayoutWrapperWC);
138
+ const LayoutWrapper = React.forwardRef(function LayoutWrapper(props, ref) {
139
+ const { children, ...rest } = props;
140
+ return React.createElement(customElements.getName(LayoutWrapperWC) ?? 'layout-wrapper', { ...rest, ref }, children);
141
+ });
55
142
 
56
- const StepperWrapper = wrap(StepperWrapperWC);
143
+ const StepperWrapper = React.forwardRef(function StepperWrapper(props, ref) {
144
+ const { children, ...rest } = props;
145
+ return React.createElement(customElements.getName(StepperWrapperWC) ?? 'stepper-wrapper', { ...rest, ref }, children);
146
+ });
57
147
 
58
- const VerticalCategorizationWrapper = wrap(VerticalCategorizationWrapperWC);
148
+ const VerticalCategorizationWrapper = React.forwardRef(function VerticalCategorizationWrapper(props, ref) {
149
+ const { children, ...rest } = props;
150
+ return React.createElement(customElements.getName(VerticalCategorizationWrapperWC) ?? 'vertical-categorization-wrapper', { ...rest, ref }, children);
151
+ });
59
152
 
60
- const DispatchRenderer = wrap(DispatchRendererWC);
153
+ const DispatchRenderer = React.forwardRef(function DispatchRenderer(props, ref) {
154
+ const { children, ...rest } = props;
155
+ return React.createElement(customElements.getName(DispatchRendererWC) ?? 'dispatch-renderer', { ...rest, ref }, children);
156
+ });
61
157
 
62
158
  module.exports = {
63
159
  Form,
package/dist/react.mjs CHANGED
@@ -3,7 +3,6 @@
3
3
  * Generated from custom-elements manifest.
4
4
  */
5
5
 
6
- import { provideReactWrapper } from '@microsoft/fast-react-wrapper';
7
6
  import React from 'react';
8
7
  import { Filters as FiltersWC } from './esm/filters/filters.js';
9
8
  import { Form as FormWC } from './esm/form.js';
@@ -16,43 +15,140 @@ import { StepperWrapper as StepperWrapperWC } from './esm/jsonforms/renderers/St
16
15
  import { VerticalCategorizationWrapper as VerticalCategorizationWrapperWC } from './esm/jsonforms/renderers/VerticalCategorizationWrapperRenderer.js';
17
16
  import { DispatchRenderer as DispatchRendererWC } from './esm/jsonforms/renderers/dispatch-renderer.js';
18
17
 
19
- const { wrap } = provideReactWrapper(React);
18
+ function _mergeRefs(...refs) {
19
+ return (value) => {
20
+ for (const ref of refs) {
21
+ if (typeof ref === 'function') ref(value);
22
+ else if (ref != null) ref.current = value;
23
+ }
24
+ };
25
+ }
20
26
 
21
- export const Form = wrap(FormWC, {
22
- events: {
23
- onSubmitFailure: 'submit-failure',
24
- onSubmitSuccess: 'submit-success',
25
- onSubmitPartialSuccess: 'submit-partial-success',
26
- onRowStatusChanged: 'row-status-changed',
27
- onBulkSubmitComplete: 'bulk-submit-complete',
28
- onRowSubmitFailure: 'row-submit-failure',
29
- onRowSubmitSuccess: 'row-submit-success',
30
- onDataChange: 'data-change',
31
- onCsvParseError: 'csv-parse-error',
32
- onCsvImported: 'csv-imported',
33
- onCsvTemplateError: 'csv-template-error',
34
- onCsvTemplateDownloaded: 'csv-template-downloaded',
35
- },
27
+ export const Form = React.forwardRef(function Form(props, ref) {
28
+ const { onSubmitFailure, onSubmitSuccess, onSubmitPartialSuccess, onRowStatusChanged, onBulkSubmitComplete, onRowSubmitFailure, onRowSubmitSuccess, onDataChange, onCsvParseError, onCsvImported, onCsvTemplateError, onCsvTemplateDownloaded, children, ...rest } = props;
29
+ const _innerRef = React.useRef(null);
30
+ const _onSubmitFailureRef = React.useRef(onSubmitFailure);
31
+ _onSubmitFailureRef.current = onSubmitFailure;
32
+ const _onSubmitSuccessRef = React.useRef(onSubmitSuccess);
33
+ _onSubmitSuccessRef.current = onSubmitSuccess;
34
+ const _onSubmitPartialSuccessRef = React.useRef(onSubmitPartialSuccess);
35
+ _onSubmitPartialSuccessRef.current = onSubmitPartialSuccess;
36
+ const _onRowStatusChangedRef = React.useRef(onRowStatusChanged);
37
+ _onRowStatusChangedRef.current = onRowStatusChanged;
38
+ const _onBulkSubmitCompleteRef = React.useRef(onBulkSubmitComplete);
39
+ _onBulkSubmitCompleteRef.current = onBulkSubmitComplete;
40
+ const _onRowSubmitFailureRef = React.useRef(onRowSubmitFailure);
41
+ _onRowSubmitFailureRef.current = onRowSubmitFailure;
42
+ const _onRowSubmitSuccessRef = React.useRef(onRowSubmitSuccess);
43
+ _onRowSubmitSuccessRef.current = onRowSubmitSuccess;
44
+ const _onDataChangeRef = React.useRef(onDataChange);
45
+ _onDataChangeRef.current = onDataChange;
46
+ const _onCsvParseErrorRef = React.useRef(onCsvParseError);
47
+ _onCsvParseErrorRef.current = onCsvParseError;
48
+ const _onCsvImportedRef = React.useRef(onCsvImported);
49
+ _onCsvImportedRef.current = onCsvImported;
50
+ const _onCsvTemplateErrorRef = React.useRef(onCsvTemplateError);
51
+ _onCsvTemplateErrorRef.current = onCsvTemplateError;
52
+ const _onCsvTemplateDownloadedRef = React.useRef(onCsvTemplateDownloaded);
53
+ _onCsvTemplateDownloadedRef.current = onCsvTemplateDownloaded;
54
+ React.useLayoutEffect(() => {
55
+ const el = _innerRef.current;
56
+ if (!el) return;
57
+ const _onSubmitFailureFn = (e) => _onSubmitFailureRef.current?.(e);
58
+ el.addEventListener('submit-failure', _onSubmitFailureFn);
59
+ const _onSubmitSuccessFn = (e) => _onSubmitSuccessRef.current?.(e);
60
+ el.addEventListener('submit-success', _onSubmitSuccessFn);
61
+ const _onSubmitPartialSuccessFn = (e) => _onSubmitPartialSuccessRef.current?.(e);
62
+ el.addEventListener('submit-partial-success', _onSubmitPartialSuccessFn);
63
+ const _onRowStatusChangedFn = (e) => _onRowStatusChangedRef.current?.(e);
64
+ el.addEventListener('row-status-changed', _onRowStatusChangedFn);
65
+ const _onBulkSubmitCompleteFn = (e) => _onBulkSubmitCompleteRef.current?.(e);
66
+ el.addEventListener('bulk-submit-complete', _onBulkSubmitCompleteFn);
67
+ const _onRowSubmitFailureFn = (e) => _onRowSubmitFailureRef.current?.(e);
68
+ el.addEventListener('row-submit-failure', _onRowSubmitFailureFn);
69
+ const _onRowSubmitSuccessFn = (e) => _onRowSubmitSuccessRef.current?.(e);
70
+ el.addEventListener('row-submit-success', _onRowSubmitSuccessFn);
71
+ const _onDataChangeFn = (e) => _onDataChangeRef.current?.(e);
72
+ el.addEventListener('data-change', _onDataChangeFn);
73
+ const _onCsvParseErrorFn = (e) => _onCsvParseErrorRef.current?.(e);
74
+ el.addEventListener('csv-parse-error', _onCsvParseErrorFn);
75
+ const _onCsvImportedFn = (e) => _onCsvImportedRef.current?.(e);
76
+ el.addEventListener('csv-imported', _onCsvImportedFn);
77
+ const _onCsvTemplateErrorFn = (e) => _onCsvTemplateErrorRef.current?.(e);
78
+ el.addEventListener('csv-template-error', _onCsvTemplateErrorFn);
79
+ const _onCsvTemplateDownloadedFn = (e) => _onCsvTemplateDownloadedRef.current?.(e);
80
+ el.addEventListener('csv-template-downloaded', _onCsvTemplateDownloadedFn);
81
+ return () => {
82
+ el.removeEventListener('submit-failure', _onSubmitFailureFn);
83
+ el.removeEventListener('submit-success', _onSubmitSuccessFn);
84
+ el.removeEventListener('submit-partial-success', _onSubmitPartialSuccessFn);
85
+ el.removeEventListener('row-status-changed', _onRowStatusChangedFn);
86
+ el.removeEventListener('bulk-submit-complete', _onBulkSubmitCompleteFn);
87
+ el.removeEventListener('row-submit-failure', _onRowSubmitFailureFn);
88
+ el.removeEventListener('row-submit-success', _onRowSubmitSuccessFn);
89
+ el.removeEventListener('data-change', _onDataChangeFn);
90
+ el.removeEventListener('csv-parse-error', _onCsvParseErrorFn);
91
+ el.removeEventListener('csv-imported', _onCsvImportedFn);
92
+ el.removeEventListener('csv-template-error', _onCsvTemplateErrorFn);
93
+ el.removeEventListener('csv-template-downloaded', _onCsvTemplateDownloadedFn);
94
+ };
95
+ }, []);
96
+ return React.createElement(customElements.getName(FormWC) ?? 'foundation-form', { ...rest, ref: _mergeRefs(_innerRef, ref) }, children);
36
97
  });
37
98
 
38
- export const Filters = wrap(FiltersWC);
99
+ export const Filters = React.forwardRef(function Filters(props, ref) {
100
+ const { children, ...rest } = props;
101
+ return React.createElement(customElements.getName(FiltersWC) ?? 'foundation-filters', { ...rest, ref }, children);
102
+ });
39
103
 
40
- export const JSONForms = wrap(JSONFormsWC, {
41
- events: {
42
- onDataChange: 'data-change',
43
- },
104
+ export const JSONForms = React.forwardRef(function JSONForms(props, ref) {
105
+ const { onDataChange, children, ...rest } = props;
106
+ const _innerRef = React.useRef(null);
107
+ const _onDataChangeRef = React.useRef(onDataChange);
108
+ _onDataChangeRef.current = onDataChange;
109
+ React.useLayoutEffect(() => {
110
+ const el = _innerRef.current;
111
+ if (!el) return;
112
+ const _onDataChangeFn = (e) => _onDataChangeRef.current?.(e);
113
+ el.addEventListener('data-change', _onDataChangeFn);
114
+ return () => {
115
+ el.removeEventListener('data-change', _onDataChangeFn);
116
+ };
117
+ }, []);
118
+ return React.createElement(customElements.getName(JSONFormsWC) ?? 'json-forms', { ...rest, ref: _mergeRefs(_innerRef, ref) }, children);
44
119
  });
45
120
 
46
- export const ArrayListWrapper = wrap(ArrayListWrapperWC);
121
+ export const ArrayListWrapper = React.forwardRef(function ArrayListWrapper(props, ref) {
122
+ const { children, ...rest } = props;
123
+ return React.createElement(customElements.getName(ArrayListWrapperWC) ?? 'array-list-wrapper', { ...rest, ref }, children);
124
+ });
47
125
 
48
- export const CategorizationWrapper = wrap(CategorizationWrapperWC);
126
+ export const CategorizationWrapper = React.forwardRef(function CategorizationWrapper(props, ref) {
127
+ const { children, ...rest } = props;
128
+ return React.createElement(customElements.getName(CategorizationWrapperWC) ?? 'categorization-wrapper', { ...rest, ref }, children);
129
+ });
49
130
 
50
- export const ControlWrapper = wrap(ControlWrapperWC);
131
+ export const ControlWrapper = React.forwardRef(function ControlWrapper(props, ref) {
132
+ const { children, ...rest } = props;
133
+ return React.createElement(customElements.getName(ControlWrapperWC) ?? 'control-wrapper', { ...rest, ref }, children);
134
+ });
51
135
 
52
- export const LayoutWrapper = wrap(LayoutWrapperWC);
136
+ export const LayoutWrapper = React.forwardRef(function LayoutWrapper(props, ref) {
137
+ const { children, ...rest } = props;
138
+ return React.createElement(customElements.getName(LayoutWrapperWC) ?? 'layout-wrapper', { ...rest, ref }, children);
139
+ });
53
140
 
54
- export const StepperWrapper = wrap(StepperWrapperWC);
141
+ export const StepperWrapper = React.forwardRef(function StepperWrapper(props, ref) {
142
+ const { children, ...rest } = props;
143
+ return React.createElement(customElements.getName(StepperWrapperWC) ?? 'stepper-wrapper', { ...rest, ref }, children);
144
+ });
55
145
 
56
- export const VerticalCategorizationWrapper = wrap(VerticalCategorizationWrapperWC);
146
+ export const VerticalCategorizationWrapper = React.forwardRef(function VerticalCategorizationWrapper(props, ref) {
147
+ const { children, ...rest } = props;
148
+ return React.createElement(customElements.getName(VerticalCategorizationWrapperWC) ?? 'vertical-categorization-wrapper', { ...rest, ref }, children);
149
+ });
57
150
 
58
- export const DispatchRenderer = wrap(DispatchRendererWC);
151
+ export const DispatchRenderer = React.forwardRef(function DispatchRenderer(props, ref) {
152
+ const { children, ...rest } = props;
153
+ return React.createElement(customElements.getName(DispatchRendererWC) ?? 'dispatch-renderer', { ...rest, ref }, children);
154
+ });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@genesislcap/foundation-forms",
3
3
  "description": "Genesis Foundation Forms",
4
- "version": "14.424.1-alpha-cfc2887.0",
4
+ "version": "14.425.0",
5
5
  "sideEffects": false,
6
6
  "license": "SEE LICENSE IN license.txt",
7
7
  "main": "dist/esm/index.js",
@@ -55,23 +55,23 @@
55
55
  }
56
56
  },
57
57
  "devDependencies": {
58
- "@genesislcap/foundation-testing": "14.424.1-alpha-cfc2887.0",
59
- "@genesislcap/genx": "14.424.1-alpha-cfc2887.0",
60
- "@genesislcap/rollup-builder": "14.424.1-alpha-cfc2887.0",
61
- "@genesislcap/ts-builder": "14.424.1-alpha-cfc2887.0",
62
- "@genesislcap/uvu-playwright-builder": "14.424.1-alpha-cfc2887.0",
63
- "@genesislcap/vite-builder": "14.424.1-alpha-cfc2887.0",
64
- "@genesislcap/webpack-builder": "14.424.1-alpha-cfc2887.0",
58
+ "@genesislcap/foundation-testing": "14.425.0",
59
+ "@genesislcap/genx": "14.425.0",
60
+ "@genesislcap/rollup-builder": "14.425.0",
61
+ "@genesislcap/ts-builder": "14.425.0",
62
+ "@genesislcap/uvu-playwright-builder": "14.425.0",
63
+ "@genesislcap/vite-builder": "14.425.0",
64
+ "@genesislcap/webpack-builder": "14.425.0",
65
65
  "@types/json-schema": "^7.0.11",
66
66
  "@types/papaparse": "^5.3.14"
67
67
  },
68
68
  "dependencies": {
69
- "@genesislcap/foundation-comms": "14.424.1-alpha-cfc2887.0",
70
- "@genesislcap/foundation-criteria": "14.424.1-alpha-cfc2887.0",
71
- "@genesislcap/foundation-logger": "14.424.1-alpha-cfc2887.0",
72
- "@genesislcap/foundation-notifications": "14.424.1-alpha-cfc2887.0",
73
- "@genesislcap/foundation-ui": "14.424.1-alpha-cfc2887.0",
74
- "@genesislcap/foundation-utils": "14.424.1-alpha-cfc2887.0",
69
+ "@genesislcap/foundation-comms": "14.425.0",
70
+ "@genesislcap/foundation-criteria": "14.425.0",
71
+ "@genesislcap/foundation-logger": "14.425.0",
72
+ "@genesislcap/foundation-notifications": "14.425.0",
73
+ "@genesislcap/foundation-ui": "14.425.0",
74
+ "@genesislcap/foundation-utils": "14.425.0",
75
75
  "@json-schema-tools/dereferencer": "^1.6.1",
76
76
  "@jsonforms/core": "^3.2.1",
77
77
  "@microsoft/fast-components": "2.30.6",
@@ -93,8 +93,5 @@
93
93
  "access": "public"
94
94
  },
95
95
  "customElements": "dist/custom-elements.json",
96
- "peerDependencies": {
97
- "@microsoft/fast-react-wrapper": ">=0.3.0"
98
- },
99
- "gitHead": "0460a55fc4d9bde4d0e6e11db51125a371bf5b4d"
96
+ "gitHead": "c49bb94fbc3a74e84f18c7445398af116e1a58bb"
100
97
  }