@abgov/react-components 7.2.2 → 7.4.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/README.md +60 -0
- package/index.d.ts +3 -0
- package/index.js +268 -15
- package/index.js.map +1 -1
- package/index.mjs +269 -16
- package/index.mjs.map +1 -1
- package/lib/app-header/app-header.d.ts +12 -4
- package/lib/app-header-menu/app-header-menu.d.ts +1 -1
- package/lib/badge/badge.d.ts +4 -4
- package/lib/block/block.d.ts +4 -1
- package/lib/checkbox/checkbox.d.ts +6 -2
- package/lib/checkbox-list/checkbox-list.d.ts +6 -2
- package/lib/date-picker/date-picker.d.ts +6 -2
- package/lib/dropdown/dropdown-item.d.ts +5 -2
- package/lib/dropdown/dropdown.d.ts +6 -2
- package/lib/dropdown-multiselect/dropdown-multiselect.d.ts +66 -0
- package/lib/filter-chip/filter-chip.d.ts +8 -4
- package/lib/icon-button/icon-button.d.ts +5 -2
- package/lib/radio-group/radio-group.d.ts +6 -2
- package/lib/scroll-panel/scroll-panel.d.ts +39 -0
- package/lib/textarea/textarea.d.ts +4 -2
- package/lib/workspace-layout/workspace-layout-scroll-state.d.ts +22 -0
- package/lib/workspace-layout/workspace-layout.d.ts +42 -0
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# React UI Components
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@abgov/react-components)
|
|
4
|
+
|
|
5
|
+
React wrappers for the Government of Alberta Design System web components.
|
|
6
|
+
|
|
7
|
+
Supported React versions: 17, 18, and 19.
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm i @abgov/react-components @abgov/web-components @abgov/ui-components-common @abgov/design-tokens
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Register the web components
|
|
16
|
+
|
|
17
|
+
Import the underlying web components once in your application entry point, such as
|
|
18
|
+
`src/main.tsx`:
|
|
19
|
+
|
|
20
|
+
```typescript
|
|
21
|
+
import "@abgov/web-components";
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Add styles
|
|
25
|
+
|
|
26
|
+
Import the component styles and design tokens in your main stylesheet, such as
|
|
27
|
+
`src/index.css`:
|
|
28
|
+
|
|
29
|
+
```css
|
|
30
|
+
@import "@abgov/web-components/index.css";
|
|
31
|
+
@import "@abgov/design-tokens/dist/tokens.css";
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Add icons
|
|
35
|
+
|
|
36
|
+
Add Ionicons to the `<head>` of `index.html`:
|
|
37
|
+
|
|
38
|
+
```html
|
|
39
|
+
<script
|
|
40
|
+
type="module"
|
|
41
|
+
src="https://cdn.jsdelivr.net/npm/ionicons@latest/dist/ionicons/ionicons.esm.js"
|
|
42
|
+
></script>
|
|
43
|
+
<script
|
|
44
|
+
nomodule
|
|
45
|
+
src="https://cdn.jsdelivr.net/npm/ionicons@latest/dist/ionicons/ionicons.js"
|
|
46
|
+
></script>
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Use a component
|
|
50
|
+
|
|
51
|
+
```tsx
|
|
52
|
+
import { GoabButton } from "@abgov/react-components";
|
|
53
|
+
|
|
54
|
+
export function App() {
|
|
55
|
+
return <GoabButton type="primary">Continue</GoabButton>;
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
See the [developer setup guide](https://design.alberta.ca/get-started/developers/setup/) and
|
|
60
|
+
[Government of Alberta Design System](https://design.alberta.ca) for more information.
|
package/index.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ export * from './lib/divider/divider';
|
|
|
19
19
|
export * from './lib/drawer/drawer';
|
|
20
20
|
export * from './lib/dropdown/dropdown';
|
|
21
21
|
export * from './lib/dropdown/dropdown-item';
|
|
22
|
+
export * from './lib/dropdown-multiselect/dropdown-multiselect';
|
|
22
23
|
export * from './lib/file-upload-card/file-upload-card';
|
|
23
24
|
export * from './lib/file-upload-input/file-upload-input';
|
|
24
25
|
export * from './lib/footer/footer';
|
|
@@ -62,6 +63,7 @@ export * from './lib/side-menu/side-menu';
|
|
|
62
63
|
export * from './lib/skeleton/skeleton';
|
|
63
64
|
export * from './lib/spacer/spacer';
|
|
64
65
|
export * from './lib/spinner/spinner';
|
|
66
|
+
export * from './lib/scroll-panel/scroll-panel';
|
|
65
67
|
export * from './lib/table/table';
|
|
66
68
|
export * from './lib/table/table-sort-header';
|
|
67
69
|
export * from './lib/tabs/tabs';
|
|
@@ -80,3 +82,4 @@ export * from './lib/work-side-menu-item/work-side-menu-item';
|
|
|
80
82
|
export * from './lib/work-side-notification-item/work-side-notification-item';
|
|
81
83
|
export * from './lib/work-side-notification-panel/work-side-notification-panel';
|
|
82
84
|
export * from './lib/theme/theme-context';
|
|
85
|
+
export * from './lib/workspace-layout/workspace-layout';
|
package/index.js
CHANGED
|
@@ -65,10 +65,26 @@ function GoabAccordion({
|
|
|
65
65
|
}
|
|
66
66
|
);
|
|
67
67
|
}
|
|
68
|
+
function renderSlottedItems(children, slot) {
|
|
69
|
+
return react.Children.map(children, (child) => {
|
|
70
|
+
if (!react.isValidElement(child)) {
|
|
71
|
+
return child;
|
|
72
|
+
}
|
|
73
|
+
if (child.type === react.Fragment) {
|
|
74
|
+
const fragment = child;
|
|
75
|
+
return renderSlottedItems(fragment.props.children, slot);
|
|
76
|
+
}
|
|
77
|
+
return react.cloneElement(child, { slot });
|
|
78
|
+
});
|
|
79
|
+
}
|
|
68
80
|
function GoabAppHeader({
|
|
69
81
|
onMenuClick,
|
|
70
82
|
children,
|
|
71
83
|
secondaryText,
|
|
84
|
+
banner,
|
|
85
|
+
phase,
|
|
86
|
+
navigation,
|
|
87
|
+
utilities,
|
|
72
88
|
...rest
|
|
73
89
|
}) {
|
|
74
90
|
const el = react.useRef(null);
|
|
@@ -89,7 +105,7 @@ function GoabAppHeader({
|
|
|
89
105
|
current.removeEventListener("_menuClick", listener);
|
|
90
106
|
};
|
|
91
107
|
}, [el, onMenuClick]);
|
|
92
|
-
return /* @__PURE__ */ jsxRuntime.
|
|
108
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
93
109
|
"goa-app-header",
|
|
94
110
|
{
|
|
95
111
|
ref: el,
|
|
@@ -97,7 +113,13 @@ function GoabAppHeader({
|
|
|
97
113
|
secondarytext: secondaryText,
|
|
98
114
|
..._props,
|
|
99
115
|
version: "2",
|
|
100
|
-
children
|
|
116
|
+
children: [
|
|
117
|
+
children,
|
|
118
|
+
banner && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "banner", children: banner }),
|
|
119
|
+
phase && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "phase", children: phase }),
|
|
120
|
+
navigation && renderSlottedItems(navigation, "navigation"),
|
|
121
|
+
utilities && renderSlottedItems(utilities, "utilities")
|
|
122
|
+
]
|
|
101
123
|
}
|
|
102
124
|
);
|
|
103
125
|
}
|
|
@@ -116,6 +138,7 @@ function getIconValue(icon, iconType) {
|
|
|
116
138
|
return iconType ? "true" : "false";
|
|
117
139
|
}
|
|
118
140
|
function GoabBadge({
|
|
141
|
+
content,
|
|
119
142
|
icon,
|
|
120
143
|
iconType,
|
|
121
144
|
size = "medium",
|
|
@@ -128,16 +151,23 @@ function GoabBadge({
|
|
|
128
151
|
{
|
|
129
152
|
icon: getIconValue(icon, iconType),
|
|
130
153
|
icontype: iconType,
|
|
154
|
+
content: typeof content === "string" ? content : void 0,
|
|
131
155
|
..._props,
|
|
132
156
|
version: "2",
|
|
133
157
|
size,
|
|
134
|
-
emphasis
|
|
158
|
+
emphasis,
|
|
159
|
+
children: typeof content !== "string" && content != null && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "content", children: content })
|
|
135
160
|
}
|
|
136
161
|
);
|
|
137
162
|
}
|
|
138
|
-
function GoabBlock({
|
|
163
|
+
function GoabBlock({
|
|
164
|
+
testId,
|
|
165
|
+
stretch,
|
|
166
|
+
children,
|
|
167
|
+
...rest
|
|
168
|
+
}) {
|
|
139
169
|
const _props = transformProps({ testid: testId, ...rest }, kebab);
|
|
140
|
-
return /* @__PURE__ */ jsxRuntime.jsx("goa-block", { ..._props, children });
|
|
170
|
+
return /* @__PURE__ */ jsxRuntime.jsx("goa-block", { ..._props, stretch: stretch ? "true" : void 0, children });
|
|
141
171
|
}
|
|
142
172
|
function GoabButton({
|
|
143
173
|
disabled,
|
|
@@ -246,6 +276,8 @@ function GoabCheckbox({
|
|
|
246
276
|
description,
|
|
247
277
|
reveal,
|
|
248
278
|
onChange,
|
|
279
|
+
onFocus,
|
|
280
|
+
onBlur,
|
|
249
281
|
name,
|
|
250
282
|
children,
|
|
251
283
|
size = "default",
|
|
@@ -262,11 +294,23 @@ function GoabCheckbox({
|
|
|
262
294
|
const detail = e.detail;
|
|
263
295
|
onChange == null ? void 0 : onChange({ ...detail, event: e });
|
|
264
296
|
};
|
|
297
|
+
const focusListener = (e) => {
|
|
298
|
+
const detail = e.detail;
|
|
299
|
+
onFocus == null ? void 0 : onFocus({ ...detail, event: e });
|
|
300
|
+
};
|
|
301
|
+
const blurListener = (e) => {
|
|
302
|
+
const detail = e.detail;
|
|
303
|
+
onBlur == null ? void 0 : onBlur({ ...detail, event: e });
|
|
304
|
+
};
|
|
265
305
|
current.addEventListener("_change", listener);
|
|
306
|
+
current.addEventListener("_focus", focusListener);
|
|
307
|
+
current.addEventListener("_blur", blurListener);
|
|
266
308
|
return () => {
|
|
267
309
|
current.removeEventListener("_change", listener);
|
|
310
|
+
current.removeEventListener("_focus", focusListener);
|
|
311
|
+
current.removeEventListener("_blur", blurListener);
|
|
268
312
|
};
|
|
269
|
-
}, [name, onChange]);
|
|
313
|
+
}, [name, onChange, onFocus, onBlur]);
|
|
270
314
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
271
315
|
"goa-checkbox",
|
|
272
316
|
{
|
|
@@ -298,6 +342,8 @@ function GoabCheckboxList({
|
|
|
298
342
|
size = "default",
|
|
299
343
|
children,
|
|
300
344
|
onChange,
|
|
345
|
+
onFocus,
|
|
346
|
+
onBlur,
|
|
301
347
|
mt,
|
|
302
348
|
mr,
|
|
303
349
|
mb,
|
|
@@ -311,11 +357,23 @@ function GoabCheckboxList({
|
|
|
311
357
|
const detail = e.detail;
|
|
312
358
|
onChange == null ? void 0 : onChange({ ...detail, event: e });
|
|
313
359
|
};
|
|
360
|
+
const focusListener = (e) => {
|
|
361
|
+
const detail = e.detail;
|
|
362
|
+
onFocus == null ? void 0 : onFocus({ ...detail, event: e });
|
|
363
|
+
};
|
|
364
|
+
const blurListener = (e) => {
|
|
365
|
+
const detail = e.detail;
|
|
366
|
+
onBlur == null ? void 0 : onBlur({ ...detail, event: e });
|
|
367
|
+
};
|
|
314
368
|
current.addEventListener("_change", listener);
|
|
369
|
+
current.addEventListener("_focus", focusListener);
|
|
370
|
+
current.addEventListener("_blur", blurListener);
|
|
315
371
|
return () => {
|
|
316
372
|
current.removeEventListener("_change", listener);
|
|
373
|
+
current.removeEventListener("_focus", focusListener);
|
|
374
|
+
current.removeEventListener("_blur", blurListener);
|
|
317
375
|
};
|
|
318
|
-
}, [onChange]);
|
|
376
|
+
}, [onChange, onFocus, onBlur]);
|
|
319
377
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
320
378
|
"goa-checkbox-list",
|
|
321
379
|
{
|
|
@@ -412,6 +470,9 @@ function GoabDataGrid({
|
|
|
412
470
|
}
|
|
413
471
|
);
|
|
414
472
|
}
|
|
473
|
+
const GoabWorkspaceLayoutScrollState = {
|
|
474
|
+
NO_SCROLL: "no-scroll"
|
|
475
|
+
};
|
|
415
476
|
function dispatch(el, eventName, detail, opts) {
|
|
416
477
|
if (!el) {
|
|
417
478
|
console.error("dispatch element is null");
|
|
@@ -2611,6 +2672,8 @@ function GoabDatePicker({
|
|
|
2611
2672
|
disabled,
|
|
2612
2673
|
relative,
|
|
2613
2674
|
onChange,
|
|
2675
|
+
onFocus,
|
|
2676
|
+
onBlur,
|
|
2614
2677
|
...rest
|
|
2615
2678
|
}) {
|
|
2616
2679
|
const ref = react.useRef(null);
|
|
@@ -2631,15 +2694,27 @@ function GoabDatePicker({
|
|
|
2631
2694
|
const detail = e.detail;
|
|
2632
2695
|
onChange == null ? void 0 : onChange({ ...detail, event: e });
|
|
2633
2696
|
};
|
|
2697
|
+
const handleFocus = (e) => {
|
|
2698
|
+
const detail = e.detail;
|
|
2699
|
+
onFocus == null ? void 0 : onFocus({ ...detail, event: e });
|
|
2700
|
+
};
|
|
2701
|
+
const handleBlur = (e) => {
|
|
2702
|
+
const detail = e.detail;
|
|
2703
|
+
onBlur == null ? void 0 : onBlur({ ...detail, event: e });
|
|
2704
|
+
};
|
|
2634
2705
|
if (onChange) {
|
|
2635
2706
|
current.addEventListener("_change", handleChange);
|
|
2636
2707
|
}
|
|
2708
|
+
current.addEventListener("_focus", handleFocus);
|
|
2709
|
+
current.addEventListener("_blur", handleBlur);
|
|
2637
2710
|
return () => {
|
|
2638
2711
|
if (onChange) {
|
|
2639
2712
|
current.removeEventListener("_change", handleChange);
|
|
2640
2713
|
}
|
|
2714
|
+
current.removeEventListener("_focus", handleFocus);
|
|
2715
|
+
current.removeEventListener("_blur", handleBlur);
|
|
2641
2716
|
};
|
|
2642
|
-
}, [onChange]);
|
|
2717
|
+
}, [onChange, onFocus, onBlur]);
|
|
2643
2718
|
const formatValue = (val) => {
|
|
2644
2719
|
if (!val) return "";
|
|
2645
2720
|
if (val instanceof Date) {
|
|
@@ -2735,6 +2810,8 @@ function stringify(value) {
|
|
|
2735
2810
|
function GoabDropdown({
|
|
2736
2811
|
value,
|
|
2737
2812
|
onChange,
|
|
2813
|
+
onFocus,
|
|
2814
|
+
onBlur,
|
|
2738
2815
|
disabled,
|
|
2739
2816
|
error,
|
|
2740
2817
|
filterable,
|
|
@@ -2756,15 +2833,27 @@ function GoabDropdown({
|
|
|
2756
2833
|
const detail = e.detail;
|
|
2757
2834
|
onChange == null ? void 0 : onChange({ ...detail, event: e });
|
|
2758
2835
|
};
|
|
2836
|
+
const focusListener = (e) => {
|
|
2837
|
+
const detail = e.detail;
|
|
2838
|
+
onFocus == null ? void 0 : onFocus({ ...detail, event: e });
|
|
2839
|
+
};
|
|
2840
|
+
const blurListener = (e) => {
|
|
2841
|
+
const detail = e.detail;
|
|
2842
|
+
onBlur == null ? void 0 : onBlur({ ...detail, event: e });
|
|
2843
|
+
};
|
|
2759
2844
|
if (onChange) {
|
|
2760
2845
|
current.addEventListener("_change", handler);
|
|
2761
2846
|
}
|
|
2847
|
+
current.addEventListener("_focus", focusListener);
|
|
2848
|
+
current.addEventListener("_blur", blurListener);
|
|
2762
2849
|
return () => {
|
|
2763
2850
|
if (onChange) {
|
|
2764
2851
|
current.removeEventListener("_change", handler);
|
|
2765
2852
|
}
|
|
2853
|
+
current.removeEventListener("_focus", focusListener);
|
|
2854
|
+
current.removeEventListener("_blur", blurListener);
|
|
2766
2855
|
};
|
|
2767
|
-
}, [el, onChange]);
|
|
2856
|
+
}, [el, onChange, onFocus, onBlur]);
|
|
2768
2857
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2769
2858
|
"goa-dropdown",
|
|
2770
2859
|
{
|
|
@@ -2793,7 +2882,8 @@ function GoabDropdownItem({
|
|
|
2793
2882
|
label,
|
|
2794
2883
|
filter,
|
|
2795
2884
|
name,
|
|
2796
|
-
mountType = "append"
|
|
2885
|
+
mountType = "append",
|
|
2886
|
+
children
|
|
2797
2887
|
}) {
|
|
2798
2888
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2799
2889
|
"goa-dropdown-item",
|
|
@@ -2802,7 +2892,71 @@ function GoabDropdownItem({
|
|
|
2802
2892
|
label,
|
|
2803
2893
|
filter,
|
|
2804
2894
|
name,
|
|
2805
|
-
mount: mountType
|
|
2895
|
+
mount: mountType,
|
|
2896
|
+
children
|
|
2897
|
+
}
|
|
2898
|
+
);
|
|
2899
|
+
}
|
|
2900
|
+
function GoabDropdownMultiselect({
|
|
2901
|
+
name,
|
|
2902
|
+
value = [],
|
|
2903
|
+
placeholder,
|
|
2904
|
+
disabled,
|
|
2905
|
+
error,
|
|
2906
|
+
filterable,
|
|
2907
|
+
leadingIcon,
|
|
2908
|
+
showSelectAll,
|
|
2909
|
+
testId,
|
|
2910
|
+
ariaLabel,
|
|
2911
|
+
ariaLabelledBy,
|
|
2912
|
+
maxHeight,
|
|
2913
|
+
width,
|
|
2914
|
+
size = "default",
|
|
2915
|
+
labelFormat,
|
|
2916
|
+
children,
|
|
2917
|
+
onChange,
|
|
2918
|
+
mt,
|
|
2919
|
+
mr,
|
|
2920
|
+
mb,
|
|
2921
|
+
ml
|
|
2922
|
+
}) {
|
|
2923
|
+
const el = react.useRef(null);
|
|
2924
|
+
react.useEffect(() => {
|
|
2925
|
+
if (!el.current) return;
|
|
2926
|
+
const current = el.current;
|
|
2927
|
+
const listener = (e) => {
|
|
2928
|
+
const detail = e.detail;
|
|
2929
|
+
onChange == null ? void 0 : onChange({ ...detail, event: e });
|
|
2930
|
+
};
|
|
2931
|
+
current.addEventListener("_change", listener);
|
|
2932
|
+
return () => {
|
|
2933
|
+
current.removeEventListener("_change", listener);
|
|
2934
|
+
};
|
|
2935
|
+
}, [onChange]);
|
|
2936
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2937
|
+
"goa-dropdown-multiselect",
|
|
2938
|
+
{
|
|
2939
|
+
ref: el,
|
|
2940
|
+
name,
|
|
2941
|
+
value,
|
|
2942
|
+
placeholder,
|
|
2943
|
+
disabled: disabled ? "true" : void 0,
|
|
2944
|
+
error: error ? "true" : void 0,
|
|
2945
|
+
filterable: filterable ? "true" : void 0,
|
|
2946
|
+
"leading-icon": leadingIcon,
|
|
2947
|
+
testid: testId,
|
|
2948
|
+
"aria-label": ariaLabel,
|
|
2949
|
+
"aria-labelledby": ariaLabelledBy,
|
|
2950
|
+
"max-height": maxHeight,
|
|
2951
|
+
width,
|
|
2952
|
+
size,
|
|
2953
|
+
"label-format": labelFormat ? labelFormat : void 0,
|
|
2954
|
+
"show-select-all": showSelectAll ? "true" : void 0,
|
|
2955
|
+
mt,
|
|
2956
|
+
mr,
|
|
2957
|
+
mb,
|
|
2958
|
+
ml,
|
|
2959
|
+
children
|
|
2806
2960
|
}
|
|
2807
2961
|
);
|
|
2808
2962
|
}
|
|
@@ -3167,6 +3321,7 @@ function GoabHeroBannerActions({
|
|
|
3167
3321
|
}
|
|
3168
3322
|
function GoabIconButton({
|
|
3169
3323
|
variant = "color",
|
|
3324
|
+
type = "default",
|
|
3170
3325
|
size = "medium",
|
|
3171
3326
|
theme = "outline",
|
|
3172
3327
|
disabled,
|
|
@@ -3177,7 +3332,7 @@ function GoabIconButton({
|
|
|
3177
3332
|
...rest
|
|
3178
3333
|
}) {
|
|
3179
3334
|
const ref = react.useRef(null);
|
|
3180
|
-
const _props = transformProps({ variant, size, theme, ...rest }, lowercase);
|
|
3335
|
+
const _props = transformProps({ variant, type, size, theme, ...rest }, lowercase);
|
|
3181
3336
|
react.useEffect(() => {
|
|
3182
3337
|
if (!ref.current) {
|
|
3183
3338
|
return;
|
|
@@ -3833,6 +3988,8 @@ function GoabRadioGroup({
|
|
|
3833
3988
|
disabled,
|
|
3834
3989
|
error,
|
|
3835
3990
|
onChange,
|
|
3991
|
+
onFocus,
|
|
3992
|
+
onBlur,
|
|
3836
3993
|
name,
|
|
3837
3994
|
children,
|
|
3838
3995
|
size = "default",
|
|
@@ -3846,16 +4003,28 @@ function GoabRadioGroup({
|
|
|
3846
4003
|
const detail = e.detail;
|
|
3847
4004
|
onChange == null ? void 0 : onChange({ ...detail, event: e });
|
|
3848
4005
|
};
|
|
4006
|
+
const focusListener = (e) => {
|
|
4007
|
+
const detail = e.detail;
|
|
4008
|
+
onFocus == null ? void 0 : onFocus({ ...detail, event: e });
|
|
4009
|
+
};
|
|
4010
|
+
const blurListener = (e) => {
|
|
4011
|
+
const detail = e.detail;
|
|
4012
|
+
onBlur == null ? void 0 : onBlur({ ...detail, event: e });
|
|
4013
|
+
};
|
|
3849
4014
|
const currentEl = el.current;
|
|
3850
4015
|
if (onChange) {
|
|
3851
4016
|
currentEl.addEventListener("_change", listener);
|
|
3852
4017
|
}
|
|
4018
|
+
currentEl.addEventListener("_focus", focusListener);
|
|
4019
|
+
currentEl.addEventListener("_blur", blurListener);
|
|
3853
4020
|
return () => {
|
|
3854
4021
|
if (onChange) {
|
|
3855
4022
|
currentEl.removeEventListener("_change", listener);
|
|
3856
4023
|
}
|
|
4024
|
+
currentEl.removeEventListener("_focus", focusListener);
|
|
4025
|
+
currentEl.removeEventListener("_blur", blurListener);
|
|
3857
4026
|
};
|
|
3858
|
-
}, [name, onChange]);
|
|
4027
|
+
}, [name, onChange, onFocus, onBlur]);
|
|
3859
4028
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3860
4029
|
"goa-radio-group",
|
|
3861
4030
|
{
|
|
@@ -3962,6 +4131,32 @@ function GoabSpinner({
|
|
|
3962
4131
|
}
|
|
3963
4132
|
);
|
|
3964
4133
|
}
|
|
4134
|
+
function GoabScrollPanel({
|
|
4135
|
+
header,
|
|
4136
|
+
children,
|
|
4137
|
+
footer,
|
|
4138
|
+
height,
|
|
4139
|
+
testId,
|
|
4140
|
+
direction = "vertical",
|
|
4141
|
+
...rest
|
|
4142
|
+
}) {
|
|
4143
|
+
const hostStyle = height ? { height } : void 0;
|
|
4144
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4145
|
+
"goa-scroll-panel",
|
|
4146
|
+
{
|
|
4147
|
+
height,
|
|
4148
|
+
testid: testId,
|
|
4149
|
+
direction,
|
|
4150
|
+
style: hostStyle,
|
|
4151
|
+
...rest,
|
|
4152
|
+
children: [
|
|
4153
|
+
header && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "header", children: header }),
|
|
4154
|
+
children,
|
|
4155
|
+
footer && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "footer", children: footer })
|
|
4156
|
+
]
|
|
4157
|
+
}
|
|
4158
|
+
);
|
|
4159
|
+
}
|
|
3965
4160
|
function GoabTable({ onSort, onMultiSort, sortMode, ...props }) {
|
|
3966
4161
|
const ref = react.useRef(null);
|
|
3967
4162
|
react.useEffect(() => {
|
|
@@ -4104,6 +4299,7 @@ function GoabTextArea({
|
|
|
4104
4299
|
error,
|
|
4105
4300
|
onChange,
|
|
4106
4301
|
onKeyPress,
|
|
4302
|
+
onFocus,
|
|
4107
4303
|
onBlur,
|
|
4108
4304
|
...rest
|
|
4109
4305
|
}) {
|
|
@@ -4122,19 +4318,25 @@ function GoabTextArea({
|
|
|
4122
4318
|
const detail = e.detail;
|
|
4123
4319
|
onKeyPress == null ? void 0 : onKeyPress({ ...detail, event: e });
|
|
4124
4320
|
};
|
|
4321
|
+
const focusListener = (e) => {
|
|
4322
|
+
const detail = e.detail;
|
|
4323
|
+
onFocus == null ? void 0 : onFocus({ ...detail, event: e });
|
|
4324
|
+
};
|
|
4125
4325
|
const blurListener = (e) => {
|
|
4126
4326
|
const detail = e.detail;
|
|
4127
4327
|
onBlur == null ? void 0 : onBlur({ ...detail, event: e });
|
|
4128
4328
|
};
|
|
4129
4329
|
current.addEventListener("_change", changeListener);
|
|
4130
4330
|
current.addEventListener("_keyPress", keypressListener);
|
|
4331
|
+
current.addEventListener("_focus", focusListener);
|
|
4131
4332
|
current.addEventListener("_blur", blurListener);
|
|
4132
4333
|
return () => {
|
|
4133
4334
|
current.removeEventListener("_change", changeListener);
|
|
4134
4335
|
current.removeEventListener("_keyPress", keypressListener);
|
|
4336
|
+
current.removeEventListener("_focus", focusListener);
|
|
4135
4337
|
current.removeEventListener("_blur", blurListener);
|
|
4136
4338
|
};
|
|
4137
|
-
}, [el, onChange, onKeyPress, onBlur]);
|
|
4339
|
+
}, [el, onChange, onKeyPress, onFocus, onBlur]);
|
|
4138
4340
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4139
4341
|
"goa-textarea",
|
|
4140
4342
|
{
|
|
@@ -4193,6 +4395,7 @@ function GoabTwoColumnLayout(props) {
|
|
|
4193
4395
|
);
|
|
4194
4396
|
}
|
|
4195
4397
|
const GoabFilterChip = ({
|
|
4398
|
+
content,
|
|
4196
4399
|
iconTheme = "outline",
|
|
4197
4400
|
error,
|
|
4198
4401
|
onClick,
|
|
@@ -4213,9 +4416,11 @@ const GoabFilterChip = ({
|
|
|
4213
4416
|
"goa-filter-chip",
|
|
4214
4417
|
{
|
|
4215
4418
|
ref: el,
|
|
4419
|
+
content: typeof content === "string" ? content : void 0,
|
|
4216
4420
|
error: error ? "true" : void 0,
|
|
4217
4421
|
version: "2",
|
|
4218
|
-
..._props
|
|
4422
|
+
..._props,
|
|
4423
|
+
children: typeof content !== "string" && content != null && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "content", children: content })
|
|
4219
4424
|
}
|
|
4220
4425
|
);
|
|
4221
4426
|
};
|
|
@@ -4505,6 +4710,50 @@ function useTheme() {
|
|
|
4505
4710
|
}
|
|
4506
4711
|
return ctx;
|
|
4507
4712
|
}
|
|
4713
|
+
const GoabWorkspaceLayoutScrollStateDefault = {
|
|
4714
|
+
scrollPosition: GoabWorkspaceLayoutScrollState.NO_SCROLL,
|
|
4715
|
+
isScrollable: false
|
|
4716
|
+
};
|
|
4717
|
+
const GoabWorkspaceLayoutScrollStateContext = react.createContext(
|
|
4718
|
+
GoabWorkspaceLayoutScrollStateDefault
|
|
4719
|
+
);
|
|
4720
|
+
function useGoabWorkspaceLayoutScrollState() {
|
|
4721
|
+
return react.useContext(GoabWorkspaceLayoutScrollStateContext);
|
|
4722
|
+
}
|
|
4723
|
+
function GoabWorkspaceLayout({
|
|
4724
|
+
sideMenu,
|
|
4725
|
+
pageHeader,
|
|
4726
|
+
pageFooter,
|
|
4727
|
+
pushDrawer,
|
|
4728
|
+
children,
|
|
4729
|
+
testId,
|
|
4730
|
+
onScrollStateChange,
|
|
4731
|
+
...rest
|
|
4732
|
+
}) {
|
|
4733
|
+
const ref = react.useRef(null);
|
|
4734
|
+
const [scrollState, setScrollState] = react.useState(GoabWorkspaceLayoutScrollStateDefault);
|
|
4735
|
+
react.useEffect(() => {
|
|
4736
|
+
const el = ref.current;
|
|
4737
|
+
if (!el) return;
|
|
4738
|
+
const listener = (e) => {
|
|
4739
|
+
const detail = e.detail;
|
|
4740
|
+
setScrollState({
|
|
4741
|
+
scrollPosition: detail.state,
|
|
4742
|
+
isScrollable: detail.isScrollable
|
|
4743
|
+
});
|
|
4744
|
+
onScrollStateChange == null ? void 0 : onScrollStateChange({ ...detail, event: e });
|
|
4745
|
+
};
|
|
4746
|
+
el.addEventListener("_scrollStateChange", listener);
|
|
4747
|
+
return () => el.removeEventListener("_scrollStateChange", listener);
|
|
4748
|
+
}, [onScrollStateChange]);
|
|
4749
|
+
return /* @__PURE__ */ jsxRuntime.jsx(GoabWorkspaceLayoutScrollStateContext.Provider, { value: scrollState, children: /* @__PURE__ */ jsxRuntime.jsxs("goa-workspace-layout", { ref, testid: testId, ...rest, children: [
|
|
4750
|
+
sideMenu && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "side-menu", children: sideMenu }),
|
|
4751
|
+
pageHeader && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "page-header", children: pageHeader }),
|
|
4752
|
+
children,
|
|
4753
|
+
pageFooter && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "page-footer", children: pageFooter }),
|
|
4754
|
+
pushDrawer && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "push-drawer", children: pushDrawer })
|
|
4755
|
+
] }) });
|
|
4756
|
+
}
|
|
4508
4757
|
exports.GoALinkButton = GoALinkButton;
|
|
4509
4758
|
exports.GoabAccordion = GoabAccordion;
|
|
4510
4759
|
exports.GoabAppFooter = GoabAppFooter;
|
|
@@ -4530,6 +4779,7 @@ exports.GoabDivider = GoabDivider;
|
|
|
4530
4779
|
exports.GoabDrawer = GoabDrawer;
|
|
4531
4780
|
exports.GoabDropdown = GoabDropdown;
|
|
4532
4781
|
exports.GoabDropdownItem = GoabDropdownItem;
|
|
4782
|
+
exports.GoabDropdownMultiselect = GoabDropdownMultiselect;
|
|
4533
4783
|
exports.GoabDropdownOption = GoabDropdownOption;
|
|
4534
4784
|
exports.GoabFieldset = GoabFieldset;
|
|
4535
4785
|
exports.GoabFileUploadCard = GoabFileUploadCard;
|
|
@@ -4579,6 +4829,7 @@ exports.GoabPublicSubformIndex = GoabPublicSubformIndex;
|
|
|
4579
4829
|
exports.GoabPushDrawer = GoabPushDrawer;
|
|
4580
4830
|
exports.GoabRadioGroup = GoabRadioGroup;
|
|
4581
4831
|
exports.GoabRadioItem = GoabRadioItem;
|
|
4832
|
+
exports.GoabScrollPanel = GoabScrollPanel;
|
|
4582
4833
|
exports.GoabSideMenu = GoabSideMenu;
|
|
4583
4834
|
exports.GoabSideMenuGroup = GoabSideMenuGroup;
|
|
4584
4835
|
exports.GoabSideMenuHeading = GoabSideMenuHeading;
|
|
@@ -4602,6 +4853,8 @@ exports.GoabWorkSideMenuGroup = GoabWorkSideMenuGroup;
|
|
|
4602
4853
|
exports.GoabWorkSideMenuItem = GoabWorkSideMenuItem;
|
|
4603
4854
|
exports.GoabWorkSideNotificationItem = GoabWorkSideNotificationItem;
|
|
4604
4855
|
exports.GoabWorkSideNotificationPanel = GoabWorkSideNotificationPanel;
|
|
4856
|
+
exports.GoabWorkspaceLayout = GoabWorkspaceLayout;
|
|
4857
|
+
exports.useGoabWorkspaceLayoutScrollState = useGoabWorkspaceLayoutScrollState;
|
|
4605
4858
|
exports.usePublicFormController = usePublicFormController;
|
|
4606
4859
|
exports.useTheme = useTheme;
|
|
4607
4860
|
//# sourceMappingURL=index.js.map
|