@abgov/jsonforms-components 2.69.0 → 2.70.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/index.esm.js +770 -19
- package/package.json +2 -2
- package/renderer-catalog.json +2 -2
package/index.esm.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { jsx, Fragment
|
|
2
|
-
import React, { useContext, useReducer, useMemo,
|
|
3
|
-
import { GoabFormItem, GoabDropdown, GoabDropdownItem, GoabInput, GoabTextArea, GoabCallout, GoabRadioGroup, GoabRadioItem, GoabCheckbox, GoabIcon, GoabButton, GoabTable, GoabGrid, GoabIconButton, GoabModal, GoabButtonGroup, GoabContainer, GoabDetails, GoabFormStepper, GoabFormStep, GoabPages, GoabBadge, GoabText, GoabFileUploadInput, GoabCircularProgress, GoabSpinner } from '@abgov/react-components';
|
|
1
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import React, { useRef, useEffect, useContext, useReducer, useMemo, createContext, useCallback, useState, useLayoutEffect } from 'react';
|
|
4
3
|
import Ajv from 'ajv';
|
|
5
4
|
import styled from 'styled-components';
|
|
6
5
|
import axios from 'axios';
|
|
@@ -15,6 +14,7 @@ import merge from 'lodash/merge';
|
|
|
15
14
|
import isEmpty$1 from 'lodash/isEmpty';
|
|
16
15
|
import range from 'lodash/range';
|
|
17
16
|
import pluralize from 'pluralize';
|
|
17
|
+
import { GoabTable as GoabTable$1, GoabGrid as GoabGrid$1, GoabContainer as GoabContainer$1 } from '@abgov/react-components';
|
|
18
18
|
import { compileSync } from '@mdx-js/mdx';
|
|
19
19
|
import ReactMarkdown from 'react-markdown';
|
|
20
20
|
import rehypeSanitize, { defaultSchema } from 'rehype-sanitize';
|
|
@@ -1826,6 +1826,759 @@ $$J({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {
|
|
|
1826
1826
|
}
|
|
1827
1827
|
});
|
|
1828
1828
|
|
|
1829
|
+
const lowercase = (input) => input.toLowerCase();
|
|
1830
|
+
function transformProps(props, transform = lowercase) {
|
|
1831
|
+
const result = {};
|
|
1832
|
+
for (const [key, value] of Object.entries(props)) {
|
|
1833
|
+
if (value === void 0) continue;
|
|
1834
|
+
if (key.startsWith("data-")) {
|
|
1835
|
+
result[key] = value;
|
|
1836
|
+
} else {
|
|
1837
|
+
result[transform(key)] = value;
|
|
1838
|
+
}
|
|
1839
|
+
}
|
|
1840
|
+
return result;
|
|
1841
|
+
}
|
|
1842
|
+
|
|
1843
|
+
function getIconValue(icon, iconType) {
|
|
1844
|
+
if (icon !== void 0) {
|
|
1845
|
+
return icon ? "true" : "false";
|
|
1846
|
+
}
|
|
1847
|
+
return iconType ? "true" : "false";
|
|
1848
|
+
}
|
|
1849
|
+
function GoabBadge({ icon, iconType, ...rest }) {
|
|
1850
|
+
const _props = transformProps(rest, lowercase);
|
|
1851
|
+
return /* @__PURE__ */ jsx(
|
|
1852
|
+
"goa-badge",
|
|
1853
|
+
{
|
|
1854
|
+
icon: getIconValue(icon, iconType),
|
|
1855
|
+
icontype: iconType,
|
|
1856
|
+
..._props
|
|
1857
|
+
}
|
|
1858
|
+
);
|
|
1859
|
+
}
|
|
1860
|
+
function GoabButton({
|
|
1861
|
+
disabled,
|
|
1862
|
+
onClick,
|
|
1863
|
+
actionArgs,
|
|
1864
|
+
actionArg,
|
|
1865
|
+
children,
|
|
1866
|
+
...rest
|
|
1867
|
+
}) {
|
|
1868
|
+
const el = useRef(null);
|
|
1869
|
+
const _props = transformProps(rest, lowercase);
|
|
1870
|
+
useEffect(() => {
|
|
1871
|
+
if (!el.current) {
|
|
1872
|
+
return;
|
|
1873
|
+
}
|
|
1874
|
+
if (!onClick) {
|
|
1875
|
+
return;
|
|
1876
|
+
}
|
|
1877
|
+
const current = el.current;
|
|
1878
|
+
const listener = () => {
|
|
1879
|
+
onClick == null ? void 0 : onClick();
|
|
1880
|
+
};
|
|
1881
|
+
current.addEventListener("_click", listener);
|
|
1882
|
+
return () => {
|
|
1883
|
+
current.removeEventListener("_click", listener);
|
|
1884
|
+
};
|
|
1885
|
+
}, [el, onClick]);
|
|
1886
|
+
return /* @__PURE__ */ jsx(
|
|
1887
|
+
"goa-button",
|
|
1888
|
+
{
|
|
1889
|
+
ref: el,
|
|
1890
|
+
disabled: disabled ? "true" : void 0,
|
|
1891
|
+
"action-arg": actionArg,
|
|
1892
|
+
"action-args": JSON.stringify(actionArgs),
|
|
1893
|
+
..._props,
|
|
1894
|
+
children
|
|
1895
|
+
}
|
|
1896
|
+
);
|
|
1897
|
+
}
|
|
1898
|
+
function GoabButtonGroup({
|
|
1899
|
+
children,
|
|
1900
|
+
...rest
|
|
1901
|
+
}) {
|
|
1902
|
+
const _props = transformProps(rest, lowercase);
|
|
1903
|
+
return /* @__PURE__ */ jsx("goa-button-group", { ..._props, children });
|
|
1904
|
+
}
|
|
1905
|
+
const GoabCallout = ({
|
|
1906
|
+
type = "information",
|
|
1907
|
+
iconTheme = "outline",
|
|
1908
|
+
size = "large",
|
|
1909
|
+
ariaLive = "off",
|
|
1910
|
+
children,
|
|
1911
|
+
...rest
|
|
1912
|
+
}) => {
|
|
1913
|
+
const _props = transformProps(
|
|
1914
|
+
{ type, icontheme: iconTheme, size, arialive: ariaLive, ...rest },
|
|
1915
|
+
lowercase
|
|
1916
|
+
);
|
|
1917
|
+
return /* @__PURE__ */ jsx("goa-callout", { ..._props, children });
|
|
1918
|
+
};
|
|
1919
|
+
function GoabCheckbox({
|
|
1920
|
+
error,
|
|
1921
|
+
checked,
|
|
1922
|
+
indeterminate,
|
|
1923
|
+
disabled,
|
|
1924
|
+
value,
|
|
1925
|
+
description,
|
|
1926
|
+
reveal,
|
|
1927
|
+
onChange,
|
|
1928
|
+
name,
|
|
1929
|
+
children,
|
|
1930
|
+
...rest
|
|
1931
|
+
}) {
|
|
1932
|
+
const el = useRef(null);
|
|
1933
|
+
const _props = transformProps(rest, lowercase);
|
|
1934
|
+
useEffect(() => {
|
|
1935
|
+
if (!el.current) {
|
|
1936
|
+
return;
|
|
1937
|
+
}
|
|
1938
|
+
const current = el.current;
|
|
1939
|
+
const listener = (e) => {
|
|
1940
|
+
const detail = e.detail;
|
|
1941
|
+
onChange == null ? void 0 : onChange({ ...detail, event: e });
|
|
1942
|
+
};
|
|
1943
|
+
current.addEventListener("_change", listener);
|
|
1944
|
+
return () => {
|
|
1945
|
+
current.removeEventListener("_change", listener);
|
|
1946
|
+
};
|
|
1947
|
+
}, [name, onChange]);
|
|
1948
|
+
return /* @__PURE__ */ jsxs(
|
|
1949
|
+
"goa-checkbox",
|
|
1950
|
+
{
|
|
1951
|
+
ref: el,
|
|
1952
|
+
..._props,
|
|
1953
|
+
name,
|
|
1954
|
+
error: error ? "true" : void 0,
|
|
1955
|
+
checked: checked ? "true" : void 0,
|
|
1956
|
+
indeterminate: indeterminate ? "true" : void 0,
|
|
1957
|
+
disabled: disabled ? "true" : void 0,
|
|
1958
|
+
value: typeof value === "boolean" ? value ? "true" : void 0 : value,
|
|
1959
|
+
description: typeof description === "string" ? description : void 0,
|
|
1960
|
+
children: [
|
|
1961
|
+
children,
|
|
1962
|
+
typeof description !== "string" && description && /* @__PURE__ */ jsx("div", { slot: "description", children: description }),
|
|
1963
|
+
reveal && /* @__PURE__ */ jsx("div", { slot: "reveal", children: reveal })
|
|
1964
|
+
]
|
|
1965
|
+
}
|
|
1966
|
+
);
|
|
1967
|
+
}
|
|
1968
|
+
const GoabCircularProgress = ({
|
|
1969
|
+
visible,
|
|
1970
|
+
message,
|
|
1971
|
+
progress,
|
|
1972
|
+
variant,
|
|
1973
|
+
size,
|
|
1974
|
+
testId
|
|
1975
|
+
}) => {
|
|
1976
|
+
return /* @__PURE__ */ jsx(
|
|
1977
|
+
"goa-circular-progress",
|
|
1978
|
+
{
|
|
1979
|
+
visible: visible ? "true" : void 0,
|
|
1980
|
+
message,
|
|
1981
|
+
progress,
|
|
1982
|
+
variant,
|
|
1983
|
+
size,
|
|
1984
|
+
testid: testId
|
|
1985
|
+
}
|
|
1986
|
+
);
|
|
1987
|
+
};
|
|
1988
|
+
function GoabContainer({
|
|
1989
|
+
heading,
|
|
1990
|
+
title,
|
|
1991
|
+
actions,
|
|
1992
|
+
children,
|
|
1993
|
+
...rest
|
|
1994
|
+
}) {
|
|
1995
|
+
const _props = transformProps(rest, lowercase);
|
|
1996
|
+
const headingContent = heading || title;
|
|
1997
|
+
return /* @__PURE__ */ jsxs("goa-container", { ..._props, children: [
|
|
1998
|
+
headingContent && /* @__PURE__ */ jsx("div", { slot: "title", children: headingContent }),
|
|
1999
|
+
children,
|
|
2000
|
+
actions && /* @__PURE__ */ jsx("div", { slot: "actions", children: actions })
|
|
2001
|
+
] });
|
|
2002
|
+
}
|
|
2003
|
+
function GoabDetails({
|
|
2004
|
+
open,
|
|
2005
|
+
children,
|
|
2006
|
+
...rest
|
|
2007
|
+
}) {
|
|
2008
|
+
const _props = transformProps(rest, lowercase);
|
|
2009
|
+
return /* @__PURE__ */ jsx(
|
|
2010
|
+
"goa-details",
|
|
2011
|
+
{
|
|
2012
|
+
open: open ? "true" : void 0,
|
|
2013
|
+
..._props,
|
|
2014
|
+
children
|
|
2015
|
+
}
|
|
2016
|
+
);
|
|
2017
|
+
}
|
|
2018
|
+
function stringify(value) {
|
|
2019
|
+
if (typeof value === "undefined") {
|
|
2020
|
+
return "";
|
|
2021
|
+
}
|
|
2022
|
+
if (typeof value === "string") {
|
|
2023
|
+
return value;
|
|
2024
|
+
}
|
|
2025
|
+
return JSON.stringify(value);
|
|
2026
|
+
}
|
|
2027
|
+
function GoabDropdown({
|
|
2028
|
+
value,
|
|
2029
|
+
onChange,
|
|
2030
|
+
disabled,
|
|
2031
|
+
error,
|
|
2032
|
+
filterable,
|
|
2033
|
+
multiselect,
|
|
2034
|
+
native,
|
|
2035
|
+
relative,
|
|
2036
|
+
children,
|
|
2037
|
+
...rest
|
|
2038
|
+
}) {
|
|
2039
|
+
const el = useRef(null);
|
|
2040
|
+
const _props = transformProps(rest, lowercase);
|
|
2041
|
+
useEffect(() => {
|
|
2042
|
+
if (!el.current) {
|
|
2043
|
+
return;
|
|
2044
|
+
}
|
|
2045
|
+
const current = el.current;
|
|
2046
|
+
const handler = (e) => {
|
|
2047
|
+
const detail = e.detail;
|
|
2048
|
+
onChange == null ? void 0 : onChange({ ...detail, event: e });
|
|
2049
|
+
};
|
|
2050
|
+
if (onChange) {
|
|
2051
|
+
current.addEventListener("_change", handler);
|
|
2052
|
+
}
|
|
2053
|
+
return () => {
|
|
2054
|
+
if (onChange) {
|
|
2055
|
+
current.removeEventListener("_change", handler);
|
|
2056
|
+
}
|
|
2057
|
+
};
|
|
2058
|
+
}, [el, onChange]);
|
|
2059
|
+
return /* @__PURE__ */ jsx(
|
|
2060
|
+
"goa-dropdown",
|
|
2061
|
+
{
|
|
2062
|
+
ref: el,
|
|
2063
|
+
value: stringify(value),
|
|
2064
|
+
disabled: disabled ? "true" : void 0,
|
|
2065
|
+
error: error ? "true" : void 0,
|
|
2066
|
+
filterable: filterable ? "true" : void 0,
|
|
2067
|
+
multiselect: multiselect ? "true" : void 0,
|
|
2068
|
+
native: native ? "true" : void 0,
|
|
2069
|
+
relative: relative ? "true" : void 0,
|
|
2070
|
+
..._props,
|
|
2071
|
+
children
|
|
2072
|
+
}
|
|
2073
|
+
);
|
|
2074
|
+
}
|
|
2075
|
+
function GoabDropdownItem({
|
|
2076
|
+
value,
|
|
2077
|
+
label,
|
|
2078
|
+
filter,
|
|
2079
|
+
name,
|
|
2080
|
+
mountType = "append"
|
|
2081
|
+
}) {
|
|
2082
|
+
return /* @__PURE__ */ jsx(
|
|
2083
|
+
"goa-dropdown-item",
|
|
2084
|
+
{
|
|
2085
|
+
value,
|
|
2086
|
+
label,
|
|
2087
|
+
filter,
|
|
2088
|
+
name,
|
|
2089
|
+
mount: mountType
|
|
2090
|
+
}
|
|
2091
|
+
);
|
|
2092
|
+
}
|
|
2093
|
+
function GoabFileUploadInput({
|
|
2094
|
+
onSelectFile,
|
|
2095
|
+
...rest
|
|
2096
|
+
}) {
|
|
2097
|
+
const el = useRef(null);
|
|
2098
|
+
const _props = transformProps(rest, lowercase);
|
|
2099
|
+
useEffect(() => {
|
|
2100
|
+
if (!el.current) return;
|
|
2101
|
+
const current = el.current;
|
|
2102
|
+
const handler = (e) => {
|
|
2103
|
+
const detail = e.detail;
|
|
2104
|
+
onSelectFile({ ...detail, event: e });
|
|
2105
|
+
};
|
|
2106
|
+
current.addEventListener("_selectFile", handler);
|
|
2107
|
+
return () => {
|
|
2108
|
+
current.removeEventListener("_selectFile", handler);
|
|
2109
|
+
};
|
|
2110
|
+
}, [el, onSelectFile]);
|
|
2111
|
+
return /* @__PURE__ */ jsx("goa-file-upload-input", { ref: el, ..._props });
|
|
2112
|
+
}
|
|
2113
|
+
function GoabFormItem({
|
|
2114
|
+
error,
|
|
2115
|
+
helpText,
|
|
2116
|
+
publicFormSummaryOrder,
|
|
2117
|
+
children,
|
|
2118
|
+
...rest
|
|
2119
|
+
}) {
|
|
2120
|
+
const _props = transformProps(rest, lowercase);
|
|
2121
|
+
return /* @__PURE__ */ jsxs(
|
|
2122
|
+
"goa-form-item",
|
|
2123
|
+
{
|
|
2124
|
+
error: typeof error === "string" ? error : void 0,
|
|
2125
|
+
helptext: typeof helpText === "string" ? helpText : void 0,
|
|
2126
|
+
"public-form-summary-order": publicFormSummaryOrder,
|
|
2127
|
+
..._props,
|
|
2128
|
+
children: [
|
|
2129
|
+
error && typeof error !== "string" && /* @__PURE__ */ jsx("div", { slot: "error", children: error }),
|
|
2130
|
+
helpText && typeof helpText !== "string" && /* @__PURE__ */ jsx("div", { slot: "helptext", children: helpText }),
|
|
2131
|
+
children
|
|
2132
|
+
]
|
|
2133
|
+
}
|
|
2134
|
+
);
|
|
2135
|
+
}
|
|
2136
|
+
function GoabFormStep(props) {
|
|
2137
|
+
return /* @__PURE__ */ jsx("goa-form-step", { text: props.text, status: props.status });
|
|
2138
|
+
}
|
|
2139
|
+
function GoabFormStepper({
|
|
2140
|
+
testId,
|
|
2141
|
+
step,
|
|
2142
|
+
mt,
|
|
2143
|
+
mb,
|
|
2144
|
+
ml,
|
|
2145
|
+
mr,
|
|
2146
|
+
onChange,
|
|
2147
|
+
children
|
|
2148
|
+
}) {
|
|
2149
|
+
const ref = useRef(null);
|
|
2150
|
+
useEffect(() => {
|
|
2151
|
+
if (!ref.current) {
|
|
2152
|
+
return;
|
|
2153
|
+
}
|
|
2154
|
+
const current = ref.current;
|
|
2155
|
+
const changeListener = (e) => {
|
|
2156
|
+
const detail = e.detail;
|
|
2157
|
+
onChange == null ? void 0 : onChange(detail);
|
|
2158
|
+
};
|
|
2159
|
+
current.addEventListener("_change", changeListener);
|
|
2160
|
+
return () => {
|
|
2161
|
+
current.removeEventListener("_change", changeListener);
|
|
2162
|
+
};
|
|
2163
|
+
}, [ref, onChange]);
|
|
2164
|
+
return /* @__PURE__ */ jsx(
|
|
2165
|
+
"goa-form-stepper",
|
|
2166
|
+
{
|
|
2167
|
+
ref,
|
|
2168
|
+
testid: testId,
|
|
2169
|
+
step,
|
|
2170
|
+
mt,
|
|
2171
|
+
mr,
|
|
2172
|
+
mb,
|
|
2173
|
+
ml,
|
|
2174
|
+
children
|
|
2175
|
+
}
|
|
2176
|
+
);
|
|
2177
|
+
}
|
|
2178
|
+
function GoabGrid({
|
|
2179
|
+
gap,
|
|
2180
|
+
minChildWidth,
|
|
2181
|
+
mt,
|
|
2182
|
+
mr,
|
|
2183
|
+
mb,
|
|
2184
|
+
ml,
|
|
2185
|
+
testId,
|
|
2186
|
+
children
|
|
2187
|
+
}) {
|
|
2188
|
+
return /* @__PURE__ */ jsx(
|
|
2189
|
+
"goa-grid",
|
|
2190
|
+
{
|
|
2191
|
+
gap,
|
|
2192
|
+
minchildwidth: minChildWidth,
|
|
2193
|
+
mt,
|
|
2194
|
+
mr,
|
|
2195
|
+
mb,
|
|
2196
|
+
ml,
|
|
2197
|
+
testid: testId,
|
|
2198
|
+
children
|
|
2199
|
+
}
|
|
2200
|
+
);
|
|
2201
|
+
}
|
|
2202
|
+
function GoabIconButton({
|
|
2203
|
+
variant = "color",
|
|
2204
|
+
size = "medium",
|
|
2205
|
+
disabled,
|
|
2206
|
+
onClick,
|
|
2207
|
+
actionArgs,
|
|
2208
|
+
actionArg,
|
|
2209
|
+
children,
|
|
2210
|
+
...rest
|
|
2211
|
+
}) {
|
|
2212
|
+
const ref = useRef(null);
|
|
2213
|
+
const _props = transformProps(
|
|
2214
|
+
{ variant, size, ...rest },
|
|
2215
|
+
lowercase
|
|
2216
|
+
);
|
|
2217
|
+
useEffect(() => {
|
|
2218
|
+
if (!ref.current) {
|
|
2219
|
+
return;
|
|
2220
|
+
}
|
|
2221
|
+
if (!onClick) {
|
|
2222
|
+
return;
|
|
2223
|
+
}
|
|
2224
|
+
const current = ref.current;
|
|
2225
|
+
const listener = () => {
|
|
2226
|
+
onClick == null ? void 0 : onClick();
|
|
2227
|
+
};
|
|
2228
|
+
current.addEventListener("_click", listener);
|
|
2229
|
+
return () => {
|
|
2230
|
+
current.removeEventListener("_click", listener);
|
|
2231
|
+
};
|
|
2232
|
+
}, [ref, onClick]);
|
|
2233
|
+
return /* @__PURE__ */ jsx(
|
|
2234
|
+
"goa-icon-button",
|
|
2235
|
+
{
|
|
2236
|
+
ref,
|
|
2237
|
+
disabled: disabled ? "true" : void 0,
|
|
2238
|
+
"action-arg": actionArg,
|
|
2239
|
+
"action-args": JSON.stringify(actionArgs),
|
|
2240
|
+
..._props,
|
|
2241
|
+
children
|
|
2242
|
+
}
|
|
2243
|
+
);
|
|
2244
|
+
}
|
|
2245
|
+
function GoabIcon({
|
|
2246
|
+
inverted,
|
|
2247
|
+
...rest
|
|
2248
|
+
}) {
|
|
2249
|
+
const _props = transformProps(rest, lowercase);
|
|
2250
|
+
return /* @__PURE__ */ jsx(
|
|
2251
|
+
"goa-icon",
|
|
2252
|
+
{
|
|
2253
|
+
inverted: typeof inverted === "boolean" ? inverted ? "true" : void 0 : inverted,
|
|
2254
|
+
..._props
|
|
2255
|
+
}
|
|
2256
|
+
);
|
|
2257
|
+
}
|
|
2258
|
+
function GoabInput({
|
|
2259
|
+
variant = "goa",
|
|
2260
|
+
textAlign = "left",
|
|
2261
|
+
focused,
|
|
2262
|
+
disabled,
|
|
2263
|
+
readonly,
|
|
2264
|
+
error,
|
|
2265
|
+
leadingContent,
|
|
2266
|
+
trailingContent,
|
|
2267
|
+
onTrailingIconClick,
|
|
2268
|
+
onChange,
|
|
2269
|
+
onFocus,
|
|
2270
|
+
onBlur,
|
|
2271
|
+
onKeyPress,
|
|
2272
|
+
...rest
|
|
2273
|
+
}) {
|
|
2274
|
+
const ref = useRef(null);
|
|
2275
|
+
const _props = transformProps({ variant, textalign: textAlign, ...rest }, lowercase);
|
|
2276
|
+
useEffect(() => {
|
|
2277
|
+
if (!ref.current) {
|
|
2278
|
+
return;
|
|
2279
|
+
}
|
|
2280
|
+
const current = ref.current;
|
|
2281
|
+
const changeListener = (e) => {
|
|
2282
|
+
const detail = e.detail;
|
|
2283
|
+
onChange == null ? void 0 : onChange({ ...detail, event: e });
|
|
2284
|
+
};
|
|
2285
|
+
const clickListener = () => {
|
|
2286
|
+
onTrailingIconClick == null ? void 0 : onTrailingIconClick();
|
|
2287
|
+
};
|
|
2288
|
+
const focusListener = (e) => {
|
|
2289
|
+
const detail = e.detail;
|
|
2290
|
+
onFocus == null ? void 0 : onFocus({ ...detail, event: e });
|
|
2291
|
+
};
|
|
2292
|
+
const blurListener = (e) => {
|
|
2293
|
+
const detail = e.detail;
|
|
2294
|
+
onBlur == null ? void 0 : onBlur({ ...detail, event: e });
|
|
2295
|
+
};
|
|
2296
|
+
const keypressListener = (e) => {
|
|
2297
|
+
const detail = e.detail;
|
|
2298
|
+
onKeyPress == null ? void 0 : onKeyPress({ ...detail, event: e });
|
|
2299
|
+
};
|
|
2300
|
+
current.addEventListener("_change", changeListener);
|
|
2301
|
+
current.addEventListener("_trailingIconClick", clickListener);
|
|
2302
|
+
current.addEventListener("_focus", focusListener);
|
|
2303
|
+
current.addEventListener("_blur", blurListener);
|
|
2304
|
+
current.addEventListener("_keyPress", keypressListener);
|
|
2305
|
+
return () => {
|
|
2306
|
+
current.removeEventListener("_change", changeListener);
|
|
2307
|
+
current.removeEventListener("_trailingIconClick", clickListener);
|
|
2308
|
+
current.removeEventListener("_focus", focusListener);
|
|
2309
|
+
current.removeEventListener("_blur", blurListener);
|
|
2310
|
+
current.removeEventListener("_keyPress", keypressListener);
|
|
2311
|
+
};
|
|
2312
|
+
}, [ref, onChange, onTrailingIconClick, onFocus, onBlur, onKeyPress]);
|
|
2313
|
+
return /* @__PURE__ */ jsxs(
|
|
2314
|
+
"goa-input",
|
|
2315
|
+
{
|
|
2316
|
+
ref,
|
|
2317
|
+
..._props,
|
|
2318
|
+
focused: focused ? "true" : void 0,
|
|
2319
|
+
disabled: disabled ? "true" : void 0,
|
|
2320
|
+
readonly: readonly ? "true" : void 0,
|
|
2321
|
+
error: error ? "true" : void 0,
|
|
2322
|
+
handletrailingiconclick: onTrailingIconClick ? "true" : "false",
|
|
2323
|
+
children: [
|
|
2324
|
+
leadingContent && /* @__PURE__ */ jsx("div", { slot: "leadingContent", children: leadingContent }),
|
|
2325
|
+
trailingContent && /* @__PURE__ */ jsx("div", { slot: "trailingContent", children: trailingContent })
|
|
2326
|
+
]
|
|
2327
|
+
}
|
|
2328
|
+
);
|
|
2329
|
+
}
|
|
2330
|
+
function GoabModal({
|
|
2331
|
+
heading,
|
|
2332
|
+
children,
|
|
2333
|
+
maxWidth,
|
|
2334
|
+
open,
|
|
2335
|
+
actions,
|
|
2336
|
+
transition,
|
|
2337
|
+
calloutVariant,
|
|
2338
|
+
onClose,
|
|
2339
|
+
testId
|
|
2340
|
+
}) {
|
|
2341
|
+
const el = useRef(null);
|
|
2342
|
+
useEffect(() => {
|
|
2343
|
+
if (!el.current) {
|
|
2344
|
+
return;
|
|
2345
|
+
}
|
|
2346
|
+
const current = el.current;
|
|
2347
|
+
const listener = () => {
|
|
2348
|
+
onClose == null ? void 0 : onClose();
|
|
2349
|
+
};
|
|
2350
|
+
current.addEventListener("_close", listener);
|
|
2351
|
+
return () => {
|
|
2352
|
+
current.removeEventListener("_close", listener);
|
|
2353
|
+
};
|
|
2354
|
+
}, [el, onClose]);
|
|
2355
|
+
return /* @__PURE__ */ jsxs(
|
|
2356
|
+
"goa-modal",
|
|
2357
|
+
{
|
|
2358
|
+
ref: el,
|
|
2359
|
+
open: open ? "true" : void 0,
|
|
2360
|
+
closable: onClose ? "true" : "false",
|
|
2361
|
+
heading: typeof heading === "string" ? heading : void 0,
|
|
2362
|
+
maxwidth: maxWidth,
|
|
2363
|
+
transition,
|
|
2364
|
+
calloutvariant: calloutVariant,
|
|
2365
|
+
testid: testId,
|
|
2366
|
+
children: [
|
|
2367
|
+
heading && typeof heading !== "string" && /* @__PURE__ */ jsx("div", { slot: "heading", children: heading }),
|
|
2368
|
+
actions && /* @__PURE__ */ jsx("div", { slot: "actions", children: actions }),
|
|
2369
|
+
children
|
|
2370
|
+
]
|
|
2371
|
+
}
|
|
2372
|
+
);
|
|
2373
|
+
}
|
|
2374
|
+
function GoabPages(props) {
|
|
2375
|
+
return /* @__PURE__ */ jsx(
|
|
2376
|
+
"goa-pages",
|
|
2377
|
+
{
|
|
2378
|
+
current: props.current,
|
|
2379
|
+
ml: props.ml,
|
|
2380
|
+
mr: props.mr,
|
|
2381
|
+
mt: props.mt,
|
|
2382
|
+
mb: props.mb,
|
|
2383
|
+
children: props.children
|
|
2384
|
+
}
|
|
2385
|
+
);
|
|
2386
|
+
}
|
|
2387
|
+
function GoabRadioItem({
|
|
2388
|
+
name,
|
|
2389
|
+
label,
|
|
2390
|
+
value,
|
|
2391
|
+
description,
|
|
2392
|
+
reveal,
|
|
2393
|
+
revealAriaLabel,
|
|
2394
|
+
maxWidth,
|
|
2395
|
+
disabled,
|
|
2396
|
+
checked,
|
|
2397
|
+
error,
|
|
2398
|
+
ariaLabel,
|
|
2399
|
+
children,
|
|
2400
|
+
mt,
|
|
2401
|
+
mr,
|
|
2402
|
+
mb,
|
|
2403
|
+
ml
|
|
2404
|
+
}) {
|
|
2405
|
+
return /* @__PURE__ */ jsxs(
|
|
2406
|
+
"goa-radio-item",
|
|
2407
|
+
{
|
|
2408
|
+
name,
|
|
2409
|
+
label,
|
|
2410
|
+
value,
|
|
2411
|
+
description: typeof description === "string" ? description : void 0,
|
|
2412
|
+
maxwidth: maxWidth,
|
|
2413
|
+
error: error ? "true" : void 0,
|
|
2414
|
+
disabled: disabled ? "true" : void 0,
|
|
2415
|
+
checked: checked ? "true" : void 0,
|
|
2416
|
+
arialabel: ariaLabel,
|
|
2417
|
+
revealarialabel: revealAriaLabel,
|
|
2418
|
+
mt,
|
|
2419
|
+
mr,
|
|
2420
|
+
mb,
|
|
2421
|
+
ml,
|
|
2422
|
+
children: [
|
|
2423
|
+
description && typeof description !== "string" && /* @__PURE__ */ jsx("div", { slot: "description", children: description }),
|
|
2424
|
+
reveal && /* @__PURE__ */ jsx("div", { slot: "reveal", children: reveal }),
|
|
2425
|
+
children
|
|
2426
|
+
]
|
|
2427
|
+
}
|
|
2428
|
+
);
|
|
2429
|
+
}
|
|
2430
|
+
function GoabRadioGroup({
|
|
2431
|
+
disabled,
|
|
2432
|
+
error,
|
|
2433
|
+
onChange,
|
|
2434
|
+
name,
|
|
2435
|
+
children,
|
|
2436
|
+
...rest
|
|
2437
|
+
}) {
|
|
2438
|
+
const el = useRef(null);
|
|
2439
|
+
const _props = transformProps(rest, lowercase);
|
|
2440
|
+
useEffect(() => {
|
|
2441
|
+
if (!el.current) return;
|
|
2442
|
+
const listener = (e) => {
|
|
2443
|
+
const detail = e.detail;
|
|
2444
|
+
onChange == null ? void 0 : onChange({ ...detail, event: e });
|
|
2445
|
+
};
|
|
2446
|
+
const currentEl = el.current;
|
|
2447
|
+
if (onChange) {
|
|
2448
|
+
currentEl.addEventListener("_change", listener);
|
|
2449
|
+
}
|
|
2450
|
+
return () => {
|
|
2451
|
+
if (onChange) {
|
|
2452
|
+
currentEl.removeEventListener("_change", listener);
|
|
2453
|
+
}
|
|
2454
|
+
};
|
|
2455
|
+
}, [name, onChange]);
|
|
2456
|
+
return /* @__PURE__ */ jsx(
|
|
2457
|
+
"goa-radio-group",
|
|
2458
|
+
{
|
|
2459
|
+
ref: el,
|
|
2460
|
+
..._props,
|
|
2461
|
+
name,
|
|
2462
|
+
disabled: disabled ? "true" : void 0,
|
|
2463
|
+
error: error ? "true" : void 0,
|
|
2464
|
+
children
|
|
2465
|
+
}
|
|
2466
|
+
);
|
|
2467
|
+
}
|
|
2468
|
+
function GoabSpinner({
|
|
2469
|
+
type,
|
|
2470
|
+
size,
|
|
2471
|
+
progress,
|
|
2472
|
+
invert,
|
|
2473
|
+
testId
|
|
2474
|
+
}) {
|
|
2475
|
+
return /* @__PURE__ */ jsx(
|
|
2476
|
+
"goa-spinner",
|
|
2477
|
+
{
|
|
2478
|
+
type,
|
|
2479
|
+
size,
|
|
2480
|
+
progress,
|
|
2481
|
+
invert: invert ? "true" : void 0,
|
|
2482
|
+
testid: testId
|
|
2483
|
+
}
|
|
2484
|
+
);
|
|
2485
|
+
}
|
|
2486
|
+
function GoabTable({ onSort, ...props }) {
|
|
2487
|
+
const ref = useRef(null);
|
|
2488
|
+
useEffect(() => {
|
|
2489
|
+
if (!ref.current) {
|
|
2490
|
+
return;
|
|
2491
|
+
}
|
|
2492
|
+
const current = ref.current;
|
|
2493
|
+
const sortListener = (e) => {
|
|
2494
|
+
const detail = e.detail;
|
|
2495
|
+
onSort == null ? void 0 : onSort(detail);
|
|
2496
|
+
};
|
|
2497
|
+
current.addEventListener("_sort", sortListener);
|
|
2498
|
+
return () => {
|
|
2499
|
+
current.removeEventListener("_sort", sortListener);
|
|
2500
|
+
};
|
|
2501
|
+
}, [ref, onSort]);
|
|
2502
|
+
return /* @__PURE__ */ jsx(
|
|
2503
|
+
"goa-table",
|
|
2504
|
+
{
|
|
2505
|
+
ref,
|
|
2506
|
+
width: props.width,
|
|
2507
|
+
variant: props.variant,
|
|
2508
|
+
testid: props.testId,
|
|
2509
|
+
mt: props.mt,
|
|
2510
|
+
mb: props.mb,
|
|
2511
|
+
ml: props.ml,
|
|
2512
|
+
mr: props.mr,
|
|
2513
|
+
children: /* @__PURE__ */ jsx("table", { style: { width: "100%" }, children: props.children })
|
|
2514
|
+
}
|
|
2515
|
+
);
|
|
2516
|
+
}
|
|
2517
|
+
function GoabText({
|
|
2518
|
+
as,
|
|
2519
|
+
tag,
|
|
2520
|
+
children,
|
|
2521
|
+
...rest
|
|
2522
|
+
}) {
|
|
2523
|
+
const _props = transformProps(rest, lowercase);
|
|
2524
|
+
return /* @__PURE__ */ jsx(
|
|
2525
|
+
"goa-text",
|
|
2526
|
+
{
|
|
2527
|
+
as: tag || as,
|
|
2528
|
+
..._props,
|
|
2529
|
+
children
|
|
2530
|
+
}
|
|
2531
|
+
);
|
|
2532
|
+
}
|
|
2533
|
+
function GoabTextArea({
|
|
2534
|
+
readOnly,
|
|
2535
|
+
disabled,
|
|
2536
|
+
error,
|
|
2537
|
+
onChange,
|
|
2538
|
+
onKeyPress,
|
|
2539
|
+
onBlur,
|
|
2540
|
+
...rest
|
|
2541
|
+
}) {
|
|
2542
|
+
const el = useRef(null);
|
|
2543
|
+
const _props = transformProps(rest, lowercase);
|
|
2544
|
+
useEffect(() => {
|
|
2545
|
+
if (!el.current) {
|
|
2546
|
+
return;
|
|
2547
|
+
}
|
|
2548
|
+
const current = el.current;
|
|
2549
|
+
const changeListener = (e) => {
|
|
2550
|
+
const detail = e.detail;
|
|
2551
|
+
onChange == null ? void 0 : onChange({ ...detail, event: e });
|
|
2552
|
+
};
|
|
2553
|
+
const keypressListener = (e) => {
|
|
2554
|
+
const detail = e.detail;
|
|
2555
|
+
onKeyPress == null ? void 0 : onKeyPress({ ...detail, event: e });
|
|
2556
|
+
};
|
|
2557
|
+
const blurListener = (e) => {
|
|
2558
|
+
const detail = e.detail;
|
|
2559
|
+
onBlur == null ? void 0 : onBlur({ ...detail, event: e });
|
|
2560
|
+
};
|
|
2561
|
+
current.addEventListener("_change", changeListener);
|
|
2562
|
+
current.addEventListener("_keyPress", keypressListener);
|
|
2563
|
+
current.addEventListener("_blur", blurListener);
|
|
2564
|
+
return () => {
|
|
2565
|
+
current.removeEventListener("_change", changeListener);
|
|
2566
|
+
current.removeEventListener("_keyPress", keypressListener);
|
|
2567
|
+
current.removeEventListener("_blur", blurListener);
|
|
2568
|
+
};
|
|
2569
|
+
}, [el, onChange, onKeyPress, onBlur]);
|
|
2570
|
+
return /* @__PURE__ */ jsx(
|
|
2571
|
+
"goa-textarea",
|
|
2572
|
+
{
|
|
2573
|
+
ref: el,
|
|
2574
|
+
readOnly: readOnly ? "true" : void 0,
|
|
2575
|
+
disabled: disabled ? "true" : void 0,
|
|
2576
|
+
error: error ? "true" : void 0,
|
|
2577
|
+
..._props
|
|
2578
|
+
}
|
|
2579
|
+
);
|
|
2580
|
+
}
|
|
2581
|
+
|
|
1829
2582
|
var NATIVE_BIND$1 = functionBindNative;
|
|
1830
2583
|
|
|
1831
2584
|
var FunctionPrototype = Function.prototype;
|
|
@@ -8678,7 +9431,8 @@ const CheckboxGroup = props => {
|
|
|
8678
9431
|
newData = newData.filter(item => item !== enumValue);
|
|
8679
9432
|
}
|
|
8680
9433
|
handleChange(path, newData.length === 0 ? undefined : newData);
|
|
8681
|
-
}
|
|
9434
|
+
},
|
|
9435
|
+
mt: "s"
|
|
8682
9436
|
}), enumValue);
|
|
8683
9437
|
})
|
|
8684
9438
|
});
|
|
@@ -9317,7 +10071,7 @@ const DataTable = ({
|
|
|
9317
10071
|
columnLabels
|
|
9318
10072
|
}) => {
|
|
9319
10073
|
var _Object$keys;
|
|
9320
|
-
return jsxs(GoabTable, {
|
|
10074
|
+
return jsxs(GoabTable$1, {
|
|
9321
10075
|
width: "100%",
|
|
9322
10076
|
children: [jsx("thead", {
|
|
9323
10077
|
children: jsx("tr", {
|
|
@@ -10662,7 +11416,6 @@ const GoAInputBaseTableReview = props => {
|
|
|
10662
11416
|
})]
|
|
10663
11417
|
}), stepId !== undefined && !((_uischema$options6 = uischema.options) != null && (_uischema$options6 = _uischema$options6.componentProps) != null && _uischema$options6.readOnly) && jsx(GoabButton, {
|
|
10664
11418
|
type: "tertiary",
|
|
10665
|
-
size: "compact",
|
|
10666
11419
|
onClick: handleChangeClick,
|
|
10667
11420
|
children: "Change"
|
|
10668
11421
|
})]
|
|
@@ -10944,7 +11697,7 @@ const LayoutRenderer = ({
|
|
|
10944
11697
|
if (direction === 'row') {
|
|
10945
11698
|
return jsx(Visible, {
|
|
10946
11699
|
"$visible": visible,
|
|
10947
|
-
children: jsx(GoabGrid, {
|
|
11700
|
+
children: jsx(GoabGrid$1, {
|
|
10948
11701
|
minChildWidth: width || '10ch',
|
|
10949
11702
|
children: renderLayoutElements(elements, schema, path, enabled, renderers, cells)
|
|
10950
11703
|
})
|
|
@@ -11455,8 +12208,7 @@ const FullNameControlReview = props => {
|
|
|
11455
12208
|
children: " (required)"
|
|
11456
12209
|
})]
|
|
11457
12210
|
}), stepId !== undefined && !((_uischema$options = uischema.options) != null && (_uischema$options = _uischema$options.componentProps) != null && _uischema$options.readOnly) && jsx(GoabButton, {
|
|
11458
|
-
type: "
|
|
11459
|
-
size: "compact",
|
|
12211
|
+
type: "text",
|
|
11460
12212
|
onClick: () => context == null ? void 0 : context.goToPage(stepId, uischema.scope),
|
|
11461
12213
|
testId: `${fieldName}-change-btn`,
|
|
11462
12214
|
children: "Change"
|
|
@@ -11504,8 +12256,7 @@ const FullNameDobReviewControl = props => {
|
|
|
11504
12256
|
children: " (required)"
|
|
11505
12257
|
})]
|
|
11506
12258
|
}), stepId !== undefined && !((_uischema$options2 = uischema.options) != null && (_uischema$options2 = _uischema$options2.componentProps) != null && _uischema$options2.readOnly) && jsx(GoabButton, {
|
|
11507
|
-
type: "
|
|
11508
|
-
size: "compact",
|
|
12259
|
+
type: "text",
|
|
11509
12260
|
onClick: () => context == null ? void 0 : context.goToPage(stepId, uischema.scope),
|
|
11510
12261
|
testId: `${fieldName}-change-btn`,
|
|
11511
12262
|
children: "Change"
|
|
@@ -11894,8 +12645,7 @@ const ContractInfoControlReview = props => {
|
|
|
11894
12645
|
children: [jsx(ReviewLabel, {
|
|
11895
12646
|
children: fieldLabel
|
|
11896
12647
|
}), stepId !== undefined && !((_uischema$options = uischema.options) != null && (_uischema$options = _uischema$options.componentProps) != null && _uischema$options.readOnly) && jsx(GoabButton, {
|
|
11897
|
-
type: "
|
|
11898
|
-
size: "compact",
|
|
12648
|
+
type: "text",
|
|
11899
12649
|
onClick: () => context == null ? void 0 : context.goToPage(stepId, uischema.scope),
|
|
11900
12650
|
testId: `${fieldName}-change-btn`,
|
|
11901
12651
|
children: "Change"
|
|
@@ -13071,6 +13821,7 @@ const PrimitiveArrayControl = props => {
|
|
|
13071
13821
|
checked: checked,
|
|
13072
13822
|
disabled: !enabled,
|
|
13073
13823
|
testId: `${value}-checkbox`,
|
|
13824
|
+
mt: "s",
|
|
13074
13825
|
onChange: detail => {
|
|
13075
13826
|
let newValue = [...items];
|
|
13076
13827
|
if (detail.value) {
|
|
@@ -13500,7 +14251,7 @@ const AddressLoopUpControlTableReview = props => {
|
|
|
13500
14251
|
children: " (required)"
|
|
13501
14252
|
})]
|
|
13502
14253
|
}), showButton && stepId !== undefined && !((_uischema$options2 = uischema.options) != null && (_uischema$options2 = _uischema$options2.componentProps) != null && _uischema$options2.readOnly) && jsx(GoabButton, {
|
|
13503
|
-
type: "
|
|
14254
|
+
type: "text",
|
|
13504
14255
|
size: "compact",
|
|
13505
14256
|
onClick: () => formStepperCtx == null ? void 0 : formStepperCtx.goToPage(stepId, targetScope),
|
|
13506
14257
|
testId: "address-change-btn",
|
|
@@ -13526,7 +14277,7 @@ const AddressLoopUpControlTableReview = props => {
|
|
|
13526
14277
|
children: [jsx(ReviewLabel, {
|
|
13527
14278
|
children: `${isAlbertaAddress ? 'Alberta' : 'Canada'} postal address`
|
|
13528
14279
|
}), stepId !== undefined && !((_uischema$options3 = uischema.options) != null && (_uischema$options3 = _uischema$options3.componentProps) != null && _uischema$options3.readOnly) && jsx(GoabButton, {
|
|
13529
|
-
type: "
|
|
14280
|
+
type: "text",
|
|
13530
14281
|
size: "compact",
|
|
13531
14282
|
onClick: () => formStepperCtx == null ? void 0 : formStepperCtx.goToPage(stepId, targetScope),
|
|
13532
14283
|
testId: "address-change-btn",
|
|
@@ -13656,20 +14407,20 @@ const GoAGroupControlComponent = props => {
|
|
|
13656
14407
|
const accent = componentProps == null ? void 0 : componentProps.accent;
|
|
13657
14408
|
return jsxs(Visible, {
|
|
13658
14409
|
"$visible": visible,
|
|
13659
|
-
children: [accent === 'thick' && jsx(GoabContainer, Object.assign({
|
|
14410
|
+
children: [accent === 'thick' && jsx(GoabContainer$1, Object.assign({
|
|
13660
14411
|
heading: group.label
|
|
13661
14412
|
}, componentProps, {
|
|
13662
14413
|
children: renderLayoutElements(group.elements, schema, path, enabled, renderers, cells)
|
|
13663
14414
|
})), (accent === 'thin' || accent === 'filled') && jsxs("div", {
|
|
13664
14415
|
children: [group.label && jsx("h3", {
|
|
13665
14416
|
children: group.label
|
|
13666
|
-
}), jsx(GoabContainer, Object.assign({}, componentProps, {
|
|
14417
|
+
}), jsx(GoabContainer$1, Object.assign({}, componentProps, {
|
|
13667
14418
|
children: renderLayoutElements(group.elements, schema, path, enabled, renderers, cells)
|
|
13668
14419
|
}))]
|
|
13669
14420
|
}), componentProps && !accent && jsxs("div", {
|
|
13670
14421
|
children: [group.label && jsx("h3", {
|
|
13671
14422
|
children: group.label
|
|
13672
|
-
}), jsx(GoabContainer, Object.assign({}, componentProps, {
|
|
14423
|
+
}), jsx(GoabContainer$1, Object.assign({}, componentProps, {
|
|
13673
14424
|
children: renderLayoutElements(group.elements, schema, path, enabled, renderers, cells)
|
|
13674
14425
|
}))]
|
|
13675
14426
|
}), !componentProps && jsxs("div", {
|
|
@@ -13677,7 +14428,7 @@ const GoAGroupControlComponent = props => {
|
|
|
13677
14428
|
children: group.label
|
|
13678
14429
|
}), isStepperReview ? jsx(Fragment, {
|
|
13679
14430
|
children: renderLayoutElements(group.elements, schema, path, enabled, renderers, cells)
|
|
13680
|
-
}) : jsx(GoabContainer, {
|
|
14431
|
+
}) : jsx(GoabContainer$1, {
|
|
13681
14432
|
children: renderLayoutElements(group.elements, schema, path, enabled, renderers, cells)
|
|
13682
14433
|
})]
|
|
13683
14434
|
})]
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abgov/jsonforms-components",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.70.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "Government of Alberta - React renderers for JSON Forms based on the design system.",
|
|
6
6
|
"repository": "https://github.com/GovAlta/adsp-monorepo",
|
|
7
7
|
"peerDependencies": {
|
|
8
8
|
"@abgov/react-components": "^6.9.3",
|
|
9
|
-
"@abgov/ui-components-common": "
|
|
9
|
+
"@abgov/ui-components-common": "2.2.1",
|
|
10
10
|
"@jsonforms/core": "^3.1.0",
|
|
11
11
|
"@jsonforms/react": "^3.1.0",
|
|
12
12
|
"react": "^18.0.0",
|
package/renderer-catalog.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": "1.0.0",
|
|
3
|
-
"generatedAt": "2026-07-
|
|
4
|
-
"sourceCommit": "
|
|
3
|
+
"generatedAt": "2026-07-23T15:27:18.993Z",
|
|
4
|
+
"sourceCommit": "f9c7063696b8fa8c87eb247175573525da9d3ffe",
|
|
5
5
|
"sourcePath": "libs/jsonforms-components/src/index.ts",
|
|
6
6
|
"rendererCount": 33,
|
|
7
7
|
"renderers": [
|