@abgov/react-components 3.4.0-alpha.48 → 3.4.0-alpha.50

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.
@@ -1,33 +1,35 @@
1
1
  import React, { FC } from "react";
2
2
  import { GoAIconType } from "../icons";
3
3
  export * from './dropdown-option';
4
- interface DropdownProps {
4
+ interface WCProps {
5
5
  ref: React.MutableRefObject<HTMLElement | null>;
6
6
  name: string;
7
7
  values: string;
8
8
  leadingicon?: string;
9
9
  maxheight?: number;
10
10
  placeholder?: string;
11
- autocomplete?: boolean;
11
+ filterable?: boolean;
12
12
  disabled?: boolean;
13
+ error?: boolean;
13
14
  multiselect?: boolean;
14
15
  }
15
16
  declare global {
16
17
  namespace JSX {
17
18
  interface IntrinsicElements {
18
- 'goa-dropdown': DropdownProps & React.HTMLAttributes<HTMLElement>;
19
+ 'goa-dropdown': WCProps & React.HTMLAttributes<HTMLElement>;
19
20
  }
20
21
  }
21
22
  }
22
23
  interface Props {
23
24
  name: string;
24
- selectedValues: string[];
25
+ values: string[];
25
26
  onChange: (name: string, values: string[]) => void;
26
27
  disabled?: boolean;
27
- autoComplete?: boolean;
28
+ filterable?: boolean;
28
29
  leadingIcon?: GoAIconType;
29
30
  maxHeight?: number;
30
- multiSelect?: boolean;
31
+ error?: boolean;
32
+ multiselect?: boolean;
31
33
  placeholder?: string;
32
34
  testId?: string;
33
35
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abgov/react-components",
3
- "version": "3.4.0-alpha.48",
3
+ "version": "3.4.0-alpha.50",
4
4
  "description": "Government of Alberta - UI components for React",
5
5
  "bugs": {
6
6
  "url": "https://github.com/GovAlta/ui-components/issues"
@@ -277,7 +277,7 @@ const GoADropdown = props => {
277
277
  const {
278
278
  name,
279
279
  value
280
- } = state.detail.data;
280
+ } = state.detail;
281
281
  props.onChange(name, value);
282
282
  };
283
283
 
@@ -289,13 +289,14 @@ const GoADropdown = props => {
289
289
  return jsx("goa-dropdown", Object.assign({
290
290
  ref: el,
291
291
  name: props.name,
292
- values: JSON.stringify(props.selectedValues),
292
+ values: JSON.stringify(props.values),
293
293
  leadingicon: props.leadingIcon,
294
294
  maxheight: props.maxHeight,
295
295
  placeholder: props.placeholder,
296
- autocomplete: props.autoComplete,
296
+ filterable: props.filterable,
297
297
  disabled: props.disabled,
298
- multiselect: props.multiSelect,
298
+ multiselect: props.multiselect,
299
+ error: props.error,
299
300
  "data-testid": props.testId
300
301
  }, {
301
302
  children: props.children
@@ -699,6 +700,11 @@ const GoARadioGroup = ({
699
700
  }
700
701
 
701
702
  const listener = e => {
703
+ if (!onChange) {
704
+ console.warn("Missing onChange function");
705
+ return;
706
+ }
707
+
702
708
  onChange(name, e.detail.value);
703
709
  };
704
710
 
@@ -312,7 +312,7 @@
312
312
  var current = el.current;
313
313
 
314
314
  var handler = function handler(state) {
315
- var _a = state.detail.data,
315
+ var _a = state.detail,
316
316
  name = _a.name,
317
317
  value = _a.value;
318
318
  props.onChange(name, value);
@@ -326,13 +326,14 @@
326
326
  return jsxRuntime.jsx("goa-dropdown", __assign({
327
327
  ref: el,
328
328
  name: props.name,
329
- values: JSON.stringify(props.selectedValues),
329
+ values: JSON.stringify(props.values),
330
330
  leadingicon: props.leadingIcon,
331
331
  maxheight: props.maxHeight,
332
332
  placeholder: props.placeholder,
333
- autocomplete: props.autoComplete,
333
+ filterable: props.filterable,
334
334
  disabled: props.disabled,
335
- multiselect: props.multiSelect,
335
+ multiselect: props.multiselect,
336
+ error: props.error,
336
337
  "data-testid": props.testId
337
338
  }, {
338
339
  children: props.children
@@ -707,6 +708,11 @@
707
708
  }
708
709
 
709
710
  var listener = function listener(e) {
711
+ if (!onChange) {
712
+ console.warn("Missing onChange function");
713
+ return;
714
+ }
715
+
710
716
  onChange(name, e.detail.value);
711
717
  };
712
718