@abgov/web-components 1.0.0-alpha.43 → 1.0.0-alpha.44

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.
@@ -2625,7 +2625,38 @@ function writable(value, start = noop) {
2625
2625
  return { set, update, subscribe };
2626
2626
  }
2627
2627
 
2628
- const messageChannel$1 = writable({});
2628
+ const stores = {};
2629
+ class ContextStore {
2630
+ constructor() {
2631
+ this.store = writable({});
2632
+ }
2633
+ subscribe(event, cb) {
2634
+ return this.store.subscribe((state) => {
2635
+ if (state.type === event) {
2636
+ cb(state);
2637
+ }
2638
+ });
2639
+ }
2640
+ notify(event, data) {
2641
+ this.store.update(() => ({
2642
+ type: event,
2643
+ ...data
2644
+ }));
2645
+ }
2646
+ }
2647
+ function getContext(name) {
2648
+ if (stores[name]) {
2649
+ return stores[name];
2650
+ }
2651
+ stores[name] = new ContextStore();
2652
+ return stores[name];
2653
+ }
2654
+ function deleteContext(name) {
2655
+ const store = stores[name];
2656
+ if (!store)
2657
+ return;
2658
+ delete stores[name];
2659
+ }
2629
2660
 
2630
2661
  /* libs/web-components/src/components/dropdown/Dropdown.svelte generated by Svelte v3.44.3 */
2631
2662
 
@@ -2645,7 +2676,7 @@ function create_if_block_3$4(ctx) {
2645
2676
  insert(target, div, anchor);
2646
2677
 
2647
2678
  if (!mounted) {
2648
- dispose = listen(div, "click", /*closeMenu*/ ctx[12]);
2679
+ dispose = listen(div, "click", /*closeMenu*/ ctx[14]);
2649
2680
  mounted = true;
2650
2681
  }
2651
2682
  },
@@ -2662,7 +2693,7 @@ function create_if_block_3$4(ctx) {
2662
2693
  };
2663
2694
  }
2664
2695
 
2665
- // (136:4) {#if !isMenuVisible || !isAutoComplete}
2696
+ // (151:4) {#if !isMenuVisible || !filterable}
2666
2697
  function create_if_block_2$5(ctx) {
2667
2698
  let div;
2668
2699
  let goa_input;
@@ -2676,7 +2707,8 @@ function create_if_block_2$5(ctx) {
2676
2707
  c() {
2677
2708
  div = element("div");
2678
2709
  goa_input = element("goa-input");
2679
- set_custom_element_data(goa_input, "disabled", /*isDisabled*/ ctx[10]);
2710
+ set_custom_element_data(goa_input, "error", /*isError*/ ctx[12]);
2711
+ set_custom_element_data(goa_input, "disabled", /*disabled*/ ctx[4]);
2680
2712
  set_custom_element_data(goa_input, "leadingicon", /*leadingicon*/ ctx[1]);
2681
2713
  set_custom_element_data(goa_input, "placeholder", /*placeholder*/ ctx[3]);
2682
2714
  set_custom_element_data(goa_input, "id", goa_input_id_value = `${/*name*/ ctx[0]}-dropdown-input`);
@@ -2685,7 +2717,7 @@ function create_if_block_2$5(ctx) {
2685
2717
  set_custom_element_data(goa_input, "trailingicon", "chevron-down");
2686
2718
  set_custom_element_data(goa_input, "handletrailingiconclick", "");
2687
2719
  set_custom_element_data(goa_input, "type", "text");
2688
- set_custom_element_data(goa_input, "value", goa_input_value_value = /*selectedLabels*/ ctx[4].join(', '));
2720
+ set_custom_element_data(goa_input, "value", goa_input_value_value = /*selectedLabels*/ ctx[7].join(", "));
2689
2721
  attr(div, "data-testid", div_data_testid_value = `${/*name*/ ctx[0]}-dropdown`);
2690
2722
  },
2691
2723
  m(target, anchor) {
@@ -2693,13 +2725,17 @@ function create_if_block_2$5(ctx) {
2693
2725
  append(div, goa_input);
2694
2726
 
2695
2727
  if (!mounted) {
2696
- dispose = listen(goa_input, "focus", /*showMenu*/ ctx[11]);
2728
+ dispose = listen(goa_input, "focus", /*showMenu*/ ctx[13]);
2697
2729
  mounted = true;
2698
2730
  }
2699
2731
  },
2700
2732
  p(ctx, dirty) {
2701
- if (dirty & /*isDisabled*/ 1024) {
2702
- set_custom_element_data(goa_input, "disabled", /*isDisabled*/ ctx[10]);
2733
+ if (dirty & /*isError*/ 4096) {
2734
+ set_custom_element_data(goa_input, "error", /*isError*/ ctx[12]);
2735
+ }
2736
+
2737
+ if (dirty & /*disabled*/ 16) {
2738
+ set_custom_element_data(goa_input, "disabled", /*disabled*/ ctx[4]);
2703
2739
  }
2704
2740
 
2705
2741
  if (dirty & /*leadingicon*/ 2) {
@@ -2714,7 +2750,7 @@ function create_if_block_2$5(ctx) {
2714
2750
  set_custom_element_data(goa_input, "id", goa_input_id_value);
2715
2751
  }
2716
2752
 
2717
- if (dirty & /*selectedLabels*/ 16 && goa_input_value_value !== (goa_input_value_value = /*selectedLabels*/ ctx[4].join(', '))) {
2753
+ if (dirty & /*selectedLabels*/ 128 && goa_input_value_value !== (goa_input_value_value = /*selectedLabels*/ ctx[7].join(", "))) {
2718
2754
  set_custom_element_data(goa_input, "value", goa_input_value_value);
2719
2755
  }
2720
2756
 
@@ -2730,14 +2766,14 @@ function create_if_block_2$5(ctx) {
2730
2766
  };
2731
2767
  }
2732
2768
 
2733
- // (155:4) {#if isMenuVisible}
2769
+ // (171:4) {#if isMenuVisible}
2734
2770
  function create_if_block$a(ctx) {
2735
2771
  let div;
2736
2772
  let t;
2737
2773
  let ul;
2738
2774
  let slot;
2739
2775
  let ul_style_value;
2740
- let if_block = /*isAutoComplete*/ ctx[9] && create_if_block_1$7(ctx);
2776
+ let if_block = /*filterable*/ ctx[5] && create_if_block_1$7(ctx);
2741
2777
 
2742
2778
  return {
2743
2779
  c() {
@@ -2747,7 +2783,7 @@ function create_if_block$a(ctx) {
2747
2783
  ul = element("ul");
2748
2784
  slot = element("slot");
2749
2785
  attr(ul, "class", "goa-dropdown-list");
2750
- attr(ul, "style", ul_style_value = `overflow-y: auto; max-height: ${/*maxheight*/ ctx[2] || MAX_HEIGHT}px`);
2786
+ attr(ul, "style", ul_style_value = `overflow-y: auto; max-height: ${/*maxheight*/ ctx[2]}px`);
2751
2787
  attr(div, "class", "menu");
2752
2788
  },
2753
2789
  m(target, anchor) {
@@ -2758,7 +2794,7 @@ function create_if_block$a(ctx) {
2758
2794
  append(ul, slot);
2759
2795
  },
2760
2796
  p(ctx, dirty) {
2761
- if (/*isAutoComplete*/ ctx[9]) {
2797
+ if (/*filterable*/ ctx[5]) {
2762
2798
  if (if_block) {
2763
2799
  if_block.p(ctx, dirty);
2764
2800
  } else {
@@ -2771,7 +2807,7 @@ function create_if_block$a(ctx) {
2771
2807
  if_block = null;
2772
2808
  }
2773
2809
 
2774
- if (dirty & /*maxheight*/ 4 && ul_style_value !== (ul_style_value = `overflow-y: auto; max-height: ${/*maxheight*/ ctx[2] || MAX_HEIGHT}px`)) {
2810
+ if (dirty & /*maxheight*/ 4 && ul_style_value !== (ul_style_value = `overflow-y: auto; max-height: ${/*maxheight*/ ctx[2]}px`)) {
2775
2811
  attr(ul, "style", ul_style_value);
2776
2812
  }
2777
2813
  },
@@ -2782,42 +2818,54 @@ function create_if_block$a(ctx) {
2782
2818
  };
2783
2819
  }
2784
2820
 
2785
- // (158:8) {#if isAutoComplete}
2821
+ // (174:8) {#if filterable}
2786
2822
  function create_if_block_1$7(ctx) {
2787
2823
  let goa_input;
2824
+ let goa_input_id_value;
2788
2825
  let goa_input_trailingicon_value;
2789
2826
 
2790
2827
  return {
2791
2828
  c() {
2792
2829
  goa_input = element("goa-input");
2793
- set_custom_element_data(goa_input, "focused", /*isMenuVisible*/ ctx[5]);
2830
+ set_custom_element_data(goa_input, "id", goa_input_id_value = `${/*name*/ ctx[0]}-dropdown-filter`);
2831
+ set_custom_element_data(goa_input, "focused", /*isMenuVisible*/ ctx[8]);
2794
2832
  set_custom_element_data(goa_input, "name", "filter");
2795
2833
  set_custom_element_data(goa_input, "placeholder", "Filter");
2796
- set_custom_element_data(goa_input, "trailingicon", goa_input_trailingicon_value = /*filter*/ ctx[8].length > 0 ? 'close-circle' : 'search');
2834
+
2835
+ set_custom_element_data(goa_input, "trailingicon", goa_input_trailingicon_value = /*filter*/ ctx[11].length > 0
2836
+ ? "close-circle"
2837
+ : "search");
2838
+
2797
2839
  set_custom_element_data(goa_input, "handletrailingiconclick", "");
2798
2840
  set_custom_element_data(goa_input, "type", "text");
2799
- set_custom_element_data(goa_input, "value", /*filter*/ ctx[8]);
2841
+ set_custom_element_data(goa_input, "value", /*filter*/ ctx[11]);
2800
2842
  },
2801
2843
  m(target, anchor) {
2802
2844
  insert(target, goa_input, anchor);
2803
- /*goa_input_binding*/ ctx[17](goa_input);
2845
+ /*goa_input_binding*/ ctx[19](goa_input);
2804
2846
  },
2805
2847
  p(ctx, dirty) {
2806
- if (dirty & /*isMenuVisible*/ 32) {
2807
- set_custom_element_data(goa_input, "focused", /*isMenuVisible*/ ctx[5]);
2848
+ if (dirty & /*name*/ 1 && goa_input_id_value !== (goa_input_id_value = `${/*name*/ ctx[0]}-dropdown-filter`)) {
2849
+ set_custom_element_data(goa_input, "id", goa_input_id_value);
2850
+ }
2851
+
2852
+ if (dirty & /*isMenuVisible*/ 256) {
2853
+ set_custom_element_data(goa_input, "focused", /*isMenuVisible*/ ctx[8]);
2808
2854
  }
2809
2855
 
2810
- if (dirty & /*filter*/ 256 && goa_input_trailingicon_value !== (goa_input_trailingicon_value = /*filter*/ ctx[8].length > 0 ? 'close-circle' : 'search')) {
2856
+ if (dirty & /*filter*/ 2048 && goa_input_trailingicon_value !== (goa_input_trailingicon_value = /*filter*/ ctx[11].length > 0
2857
+ ? "close-circle"
2858
+ : "search")) {
2811
2859
  set_custom_element_data(goa_input, "trailingicon", goa_input_trailingicon_value);
2812
2860
  }
2813
2861
 
2814
- if (dirty & /*filter*/ 256) {
2815
- set_custom_element_data(goa_input, "value", /*filter*/ ctx[8]);
2862
+ if (dirty & /*filter*/ 2048) {
2863
+ set_custom_element_data(goa_input, "value", /*filter*/ ctx[11]);
2816
2864
  }
2817
2865
  },
2818
2866
  d(detaching) {
2819
2867
  if (detaching) detach(goa_input);
2820
- /*goa_input_binding*/ ctx[17](null);
2868
+ /*goa_input_binding*/ ctx[19](null);
2821
2869
  }
2822
2870
  };
2823
2871
  }
@@ -2827,9 +2875,9 @@ function create_fragment$j(ctx) {
2827
2875
  let t0;
2828
2876
  let div0;
2829
2877
  let t1;
2830
- let if_block0 = /*isMenuVisible*/ ctx[5] && create_if_block_3$4(ctx);
2831
- let if_block1 = (!/*isMenuVisible*/ ctx[5] || !/*isAutoComplete*/ ctx[9]) && create_if_block_2$5(ctx);
2832
- let if_block2 = /*isMenuVisible*/ ctx[5] && create_if_block$a(ctx);
2878
+ let if_block0 = /*isMenuVisible*/ ctx[8] && create_if_block_3$4(ctx);
2879
+ let if_block1 = (!/*isMenuVisible*/ ctx[8] || !/*filterable*/ ctx[5]) && create_if_block_2$5(ctx);
2880
+ let if_block2 = /*isMenuVisible*/ ctx[8] && create_if_block$a(ctx);
2833
2881
 
2834
2882
  return {
2835
2883
  c() {
@@ -2841,6 +2889,7 @@ function create_fragment$j(ctx) {
2841
2889
  t1 = space();
2842
2890
  if (if_block2) if_block2.c();
2843
2891
  this.c = noop;
2892
+ attr(div1, "data-testid", /*testid*/ ctx[6]);
2844
2893
  attr(div1, "class", "goa-dropdown-box");
2845
2894
  },
2846
2895
  m(target, anchor) {
@@ -2851,10 +2900,10 @@ function create_fragment$j(ctx) {
2851
2900
  if (if_block1) if_block1.m(div0, null);
2852
2901
  append(div0, t1);
2853
2902
  if (if_block2) if_block2.m(div0, null);
2854
- /*div1_binding*/ ctx[18](div1);
2903
+ /*div1_binding*/ ctx[20](div1);
2855
2904
  },
2856
2905
  p(ctx, [dirty]) {
2857
- if (/*isMenuVisible*/ ctx[5]) {
2906
+ if (/*isMenuVisible*/ ctx[8]) {
2858
2907
  if (if_block0) {
2859
2908
  if_block0.p(ctx, dirty);
2860
2909
  } else {
@@ -2867,7 +2916,7 @@ function create_fragment$j(ctx) {
2867
2916
  if_block0 = null;
2868
2917
  }
2869
2918
 
2870
- if (!/*isMenuVisible*/ ctx[5] || !/*isAutoComplete*/ ctx[9]) {
2919
+ if (!/*isMenuVisible*/ ctx[8] || !/*filterable*/ ctx[5]) {
2871
2920
  if (if_block1) {
2872
2921
  if_block1.p(ctx, dirty);
2873
2922
  } else {
@@ -2880,7 +2929,7 @@ function create_fragment$j(ctx) {
2880
2929
  if_block1 = null;
2881
2930
  }
2882
2931
 
2883
- if (/*isMenuVisible*/ ctx[5]) {
2932
+ if (/*isMenuVisible*/ ctx[8]) {
2884
2933
  if (if_block2) {
2885
2934
  if_block2.p(ctx, dirty);
2886
2935
  } else {
@@ -2892,6 +2941,10 @@ function create_fragment$j(ctx) {
2892
2941
  if_block2.d(1);
2893
2942
  if_block2 = null;
2894
2943
  }
2944
+
2945
+ if (dirty & /*testid*/ 64) {
2946
+ attr(div1, "data-testid", /*testid*/ ctx[6]);
2947
+ }
2895
2948
  },
2896
2949
  i: noop,
2897
2950
  o: noop,
@@ -2900,7 +2953,7 @@ function create_fragment$j(ctx) {
2900
2953
  if (if_block0) if_block0.d();
2901
2954
  if (if_block1) if_block1.d();
2902
2955
  if (if_block2) if_block2.d();
2903
- /*div1_binding*/ ctx[18](null);
2956
+ /*div1_binding*/ ctx[20](null);
2904
2957
  }
2905
2958
  };
2906
2959
  }
@@ -2908,127 +2961,103 @@ function create_fragment$j(ctx) {
2908
2961
  const MAX_HEIGHT = 300;
2909
2962
 
2910
2963
  function instance$i($$self, $$props, $$invalidate) {
2911
- let isMultiSelect;
2912
- let isDisabled;
2913
- let isAutoComplete;
2964
+ let isError;
2914
2965
  let { name } = $$props;
2915
2966
  let { values } = $$props;
2916
2967
  let { leadingicon } = $$props;
2917
- let { maxheight } = $$props;
2918
- let { placeholder } = $$props;
2968
+ let { maxheight = MAX_HEIGHT } = $$props;
2969
+ let { placeholder = "" } = $$props;
2919
2970
  let { multiselect } = $$props;
2920
2971
  let { disabled } = $$props;
2921
- let { autocomplete } = $$props;
2972
+ let { filterable } = $$props;
2973
+ let { error } = $$props;
2974
+ let { testid } = $$props;
2922
2975
 
2923
2976
  // Private
2924
2977
  let selectedLabels = [];
2925
2978
 
2926
- let selectedValues = [];
2979
+ let selectedValues;
2927
2980
  let isMenuVisible = false;
2928
2981
  let el;
2929
2982
  let filterEl;
2930
- let filter = '';
2931
-
2932
- // Init
2933
- const unsubscribe = messageChannel$1.subscribe(channel => {
2934
- var _a, _b;
2935
-
2936
- if (((_a = channel[name]) === null || _a === void 0
2937
- ? void 0
2938
- : _a.tag) !== name) {
2939
- return;
2940
- }
2983
+ let filter = "";
2984
+ let ctx;
2985
+ let unsubChangeSelected;
2986
+ let unsubInit;
2941
2987
 
2942
- const msg = channel[name];
2943
-
2944
- switch ((_b = msg === null || msg === void 0 ? void 0 : msg.payload) === null || _b === void 0
2945
- ? void 0
2946
- : _b.type) {
2947
- case 'DropDownAction':
2948
- {
2949
- if (msg.payload.action === 'select') {
2950
- if (isMultiSelect) {
2951
- $$invalidate(4, selectedLabels = [...selectedLabels, msg.payload.label]);
2952
- selectedValues = [...selectedValues, msg.payload.value];
2953
- } else {
2954
- $$invalidate(4, selectedLabels = [msg.payload.label]);
2955
- selectedValues = [msg.payload.value];
2956
- }
2957
- }
2958
-
2959
- if (msg.payload.action === 'deselect') {
2960
- const _label = msg.payload.label;
2961
- const _value = msg.payload.value;
2962
- $$invalidate(4, selectedLabels = selectedLabels.filter(label => label !== _label));
2963
- selectedValues = selectedValues.filter(value => value !== _value);
2964
- }
2965
-
2966
- if (!isMultiSelect) {
2967
- $$invalidate(5, isMenuVisible = false);
2968
- }
2969
-
2970
- messageChannel$1.update(old => Object.assign(Object.assign({}, old), { [name]: null }));
2971
-
2972
- el.dispatchEvent(new CustomEvent('_change',
2973
- {
2974
- composed: true,
2975
- detail: { event: null, name, value: selectedValues }
2976
- }));
2977
-
2978
- break;
2979
- }
2980
- }
2981
- });
2982
-
2983
- // Hooks
2984
2988
  onMount(async () => {
2985
2989
  await tick();
2990
+ $$invalidate(18, ctx = getContext(name));
2991
+
2992
+ // Listen for initial label selection updates on initial mount.
2993
+ // > This is required because the parent does not know the label values
2994
+ // > for each of the children, so on the initial load any preselected values
2995
+ // > have to communicated back to the parent of the label values that correspond
2996
+ // > to the preselected values.
2997
+ // > A separate event is required to prevent circular updates.
2998
+ unsubInit = ctx.subscribe("init", data => {
2999
+ if (multiselect) {
3000
+ $$invalidate(7, selectedLabels = [...selectedLabels, data.label]);
3001
+ } else {
3002
+ $$invalidate(7, selectedLabels = [data.label]);
3003
+ }
2986
3004
 
2987
- // set initial values state
2988
- messageChannel$1.update(old => Object.assign(Object.assign({}, old), {
2989
- [name]: {
2990
- tag: name,
2991
- payload: {
2992
- type: 'DropDownInit',
2993
- values: values ? JSON.parse(values) : [],
2994
- multiSelect: isMultiSelect
3005
+ // calling the unsub init
3006
+ unsubInit();
3007
+ });
3008
+
3009
+ // listen for change messages from children
3010
+ unsubChangeSelected = ctx.subscribe("selectionChange", data => {
3011
+ if (data.selected) {
3012
+ if (multiselect) {
3013
+ $$invalidate(7, selectedLabels = [...selectedLabels, data.label]);
3014
+ selectedValues = [...selectedValues, data.value];
3015
+ } else {
3016
+ $$invalidate(7, selectedLabels = [data.label]);
3017
+ selectedValues = [data.value];
2995
3018
  }
3019
+ } else {
3020
+ $$invalidate(7, selectedLabels = selectedLabels.filter(label => label !== data.label));
3021
+ selectedValues = selectedValues.filter(value => value !== data.value);
2996
3022
  }
2997
- }));
2998
- });
2999
3023
 
3000
- onDestroy(() => {
3001
- messageChannel$1.update(old => {
3002
- delete old[name];
3003
- return old;
3024
+ if (!multiselect) {
3025
+ $$invalidate(8, isMenuVisible = false);
3026
+ }
3027
+
3028
+ // This isn't required when the component is properly bound, but this
3029
+ // will make the component appear to work properly before the component
3030
+ // is properly bound.
3031
+ ctx.notify("propChange", {
3032
+ multiSelect: multiselect,
3033
+ values: selectedValues
3034
+ });
3035
+
3036
+ el.dispatchEvent(new CustomEvent("_change",
3037
+ {
3038
+ composed: true,
3039
+ detail: { name, value: selectedValues }, // TODO: send single value if multiselect is false
3040
+
3041
+ }));
3004
3042
  });
3043
+ });
3005
3044
 
3006
- unsubscribe();
3045
+ onDestroy(() => {
3046
+ unsubChangeSelected();
3047
+ deleteContext(name);
3007
3048
  });
3008
3049
 
3009
3050
  // Reactive
3010
3051
  let filterOnChangeListener = e => {
3011
3052
  e.stopPropagation();
3012
- $$invalidate(8, filter = e.detail.value);
3013
-
3014
- messageChannel$1.update(old => Object.assign(Object.assign({}, old), {
3015
- [name]: {
3016
- tag: name,
3017
- payload: { type: 'FilterChange', filter }
3018
- }
3019
- }));
3053
+ $$invalidate(11, filter = e.detail.value);
3054
+ ctx.notify("filterChange", { filter });
3020
3055
  };
3021
3056
 
3022
3057
  let filterOnTrailingIconClickListener = e => {
3023
3058
  e.stopPropagation();
3024
- $$invalidate(8, filter = '');
3025
-
3026
- messageChannel$1.update(old => Object.assign(Object.assign({}, old), {
3027
- [name]: {
3028
- tag: name,
3029
- payload: { type: 'FilterChange', filter }
3030
- }
3031
- }));
3059
+ $$invalidate(11, filter = "");
3060
+ ctx.notify("filterChange", { filter });
3032
3061
 
3033
3062
  filterEl === null || filterEl === void 0
3034
3063
  ? void 0
@@ -3037,18 +3066,22 @@ function instance$i($$self, $$props, $$invalidate) {
3037
3066
 
3038
3067
  // Functions
3039
3068
  async function showMenu() {
3040
- $$invalidate(5, isMenuVisible = true);
3069
+ if (disabled) {
3070
+ return;
3071
+ }
3072
+
3073
+ $$invalidate(8, isMenuVisible = true);
3041
3074
  await tick();
3042
3075
 
3043
3076
  // To prevent the event from bubbling up to the parent, we need to listen to the event on the element itself
3044
3077
  // then we can stop propagation and prevent default
3045
3078
  filterEl === null || filterEl === void 0
3046
3079
  ? void 0
3047
- : filterEl.addEventListener('_change', filterOnChangeListener);
3080
+ : filterEl.addEventListener("_change", filterOnChangeListener);
3048
3081
 
3049
3082
  filterEl === null || filterEl === void 0
3050
3083
  ? void 0
3051
- : filterEl.addEventListener('_trailingIconClick', filterOnTrailingIconClickListener);
3084
+ : filterEl.addEventListener("_trailingIconClick", filterOnTrailingIconClickListener);
3052
3085
 
3053
3086
  filterEl === null || filterEl === void 0
3054
3087
  ? void 0
@@ -3056,53 +3089,69 @@ function instance$i($$self, $$props, $$invalidate) {
3056
3089
  }
3057
3090
 
3058
3091
  function closeMenu() {
3059
- $$invalidate(5, isMenuVisible = false);
3092
+ $$invalidate(8, isMenuVisible = false);
3060
3093
 
3061
3094
  filterEl === null || filterEl === void 0
3062
3095
  ? void 0
3063
- : filterEl.removeEventListener('_change', filterOnChangeListener);
3096
+ : filterEl.removeEventListener("_change", filterOnChangeListener);
3064
3097
 
3065
3098
  filterEl === null || filterEl === void 0
3066
3099
  ? void 0
3067
- : filterEl.removeEventListener('_trailingIconClick', filterOnTrailingIconClickListener);
3100
+ : filterEl.removeEventListener("_trailingIconClick", filterOnTrailingIconClickListener);
3068
3101
  }
3069
3102
 
3070
3103
  function goa_input_binding($$value) {
3071
3104
  binding_callbacks[$$value ? 'unshift' : 'push'](() => {
3072
3105
  filterEl = $$value;
3073
- $$invalidate(7, filterEl);
3106
+ $$invalidate(10, filterEl);
3074
3107
  });
3075
3108
  }
3076
3109
 
3077
3110
  function div1_binding($$value) {
3078
3111
  binding_callbacks[$$value ? 'unshift' : 'push'](() => {
3079
3112
  el = $$value;
3080
- $$invalidate(6, el);
3113
+ $$invalidate(9, el);
3081
3114
  });
3082
3115
  }
3083
3116
 
3084
3117
  $$self.$$set = $$props => {
3085
3118
  if ('name' in $$props) $$invalidate(0, name = $$props.name);
3086
- if ('values' in $$props) $$invalidate(13, values = $$props.values);
3119
+ if ('values' in $$props) $$invalidate(15, values = $$props.values);
3087
3120
  if ('leadingicon' in $$props) $$invalidate(1, leadingicon = $$props.leadingicon);
3088
3121
  if ('maxheight' in $$props) $$invalidate(2, maxheight = $$props.maxheight);
3089
3122
  if ('placeholder' in $$props) $$invalidate(3, placeholder = $$props.placeholder);
3090
- if ('multiselect' in $$props) $$invalidate(14, multiselect = $$props.multiselect);
3091
- if ('disabled' in $$props) $$invalidate(15, disabled = $$props.disabled);
3092
- if ('autocomplete' in $$props) $$invalidate(16, autocomplete = $$props.autocomplete);
3123
+ if ('multiselect' in $$props) $$invalidate(16, multiselect = $$props.multiselect);
3124
+ if ('disabled' in $$props) $$invalidate(4, disabled = $$props.disabled);
3125
+ if ('filterable' in $$props) $$invalidate(5, filterable = $$props.filterable);
3126
+ if ('error' in $$props) $$invalidate(17, error = $$props.error);
3127
+ if ('testid' in $$props) $$invalidate(6, testid = $$props.testid);
3093
3128
  };
3094
3129
 
3095
3130
  $$self.$$.update = () => {
3096
- if ($$self.$$.dirty & /*multiselect*/ 16384) {
3097
- isMultiSelect = toBoolean(multiselect);
3131
+ if ($$self.$$.dirty & /*error*/ 131072) {
3132
+ // TODO: remove this once goa-input has the toBoolean method removed
3133
+ $$invalidate(12, isError = error ? "true" : "false");
3098
3134
  }
3099
3135
 
3100
- if ($$self.$$.dirty & /*disabled*/ 32768) {
3101
- $$invalidate(10, isDisabled = toBoolean(disabled));
3102
- }
3136
+ if ($$self.$$.dirty & /*values, ctx, multiselect*/ 360448) {
3137
+ // notify children of value change
3138
+ {
3139
+ if (values !== undefined) {
3140
+ let vals;
3103
3141
 
3104
- if ($$self.$$.dirty & /*autocomplete*/ 65536) {
3105
- $$invalidate(9, isAutoComplete = toBoolean(autocomplete));
3142
+ if (typeof values === "string") {
3143
+ vals = values ? JSON.parse(values) : [];
3144
+ } else {
3145
+ vals = values;
3146
+ }
3147
+
3148
+ selectedValues = vals;
3149
+
3150
+ ctx === null || ctx === void 0
3151
+ ? void 0
3152
+ : ctx.notify("propChange", { multiSelect: multiselect, values: vals });
3153
+ }
3154
+ }
3106
3155
  }
3107
3156
  };
3108
3157
 
@@ -3111,19 +3160,21 @@ function instance$i($$self, $$props, $$invalidate) {
3111
3160
  leadingicon,
3112
3161
  maxheight,
3113
3162
  placeholder,
3163
+ disabled,
3164
+ filterable,
3165
+ testid,
3114
3166
  selectedLabels,
3115
3167
  isMenuVisible,
3116
3168
  el,
3117
3169
  filterEl,
3118
3170
  filter,
3119
- isAutoComplete,
3120
- isDisabled,
3171
+ isError,
3121
3172
  showMenu,
3122
3173
  closeMenu,
3123
3174
  values,
3124
3175
  multiselect,
3125
- disabled,
3126
- autocomplete,
3176
+ error,
3177
+ ctx,
3127
3178
  goa_input_binding,
3128
3179
  div1_binding
3129
3180
  ];
@@ -3132,7 +3183,7 @@ function instance$i($$self, $$props, $$invalidate) {
3132
3183
  class Dropdown extends SvelteElement {
3133
3184
  constructor(options) {
3134
3185
  super();
3135
- this.shadowRoot.innerHTML = `<style>:host{box-sizing:border-box;font-family:var(--font-family)}.goa-dropdown-box{position:relative}.menu goa-input{position:relative}.goa-dropdown-background{position:fixed;inset:0}.goa-dropdown-list{position:absolute;left:0;right:0;padding:0;margin:0;margin-top:3px;list-style-type:none;background:var(--color-white);border-radius:var(--input-border-radius);box-shadow:var(--shadow-1);z-index:99}.goa-dropdown-list{scroll-behavior:smooth;scrollbar-width:thin}.goa-dropdown-list::-webkit-scrollbar{width:6px}.goa-dropdown-list::-webkit-scrollbar-track{background:#f1f1f1}.goa-dropdown-list::-webkit-scrollbar-thumb{background:#888}.goa-dropdown-list::-webkit-scrollbar-thumb:hover{background:#555}</style>`;
3186
+ this.shadowRoot.innerHTML = `<style>:host{box-sizing:border-box;font-family:var(--font-family)}.goa-dropdown-box{position:relative}.menu goa-input{position:relative}.goa-dropdown-background{position:fixed;z-index:98;inset:0}.goa-dropdown-list{position:absolute;left:0;right:0;padding:0;margin:0;margin-top:3px;list-style-type:none;background:var(--color-white);border-radius:var(--input-border-radius);box-shadow:var(--shadow-1);z-index:99}.goa-dropdown-list{scroll-behavior:smooth;scrollbar-width:thin}.goa-dropdown-list::-webkit-scrollbar{width:6px}.goa-dropdown-list::-webkit-scrollbar-track{background:#f1f1f1}.goa-dropdown-list::-webkit-scrollbar-thumb{background:#888}.goa-dropdown-list::-webkit-scrollbar-thumb:hover{background:#555}</style>`;
3136
3187
 
3137
3188
  init(
3138
3189
  this,
@@ -3146,13 +3197,15 @@ class Dropdown extends SvelteElement {
3146
3197
  safe_not_equal,
3147
3198
  {
3148
3199
  name: 0,
3149
- values: 13,
3200
+ values: 15,
3150
3201
  leadingicon: 1,
3151
3202
  maxheight: 2,
3152
3203
  placeholder: 3,
3153
- multiselect: 14,
3154
- disabled: 15,
3155
- autocomplete: 16
3204
+ multiselect: 16,
3205
+ disabled: 4,
3206
+ filterable: 5,
3207
+ error: 17,
3208
+ testid: 6
3156
3209
  },
3157
3210
  null
3158
3211
  );
@@ -3178,7 +3231,9 @@ class Dropdown extends SvelteElement {
3178
3231
  "placeholder",
3179
3232
  "multiselect",
3180
3233
  "disabled",
3181
- "autocomplete"
3234
+ "filterable",
3235
+ "error",
3236
+ "testid"
3182
3237
  ];
3183
3238
  }
3184
3239
 
@@ -3192,7 +3247,7 @@ class Dropdown extends SvelteElement {
3192
3247
  }
3193
3248
 
3194
3249
  get values() {
3195
- return this.$$.ctx[13];
3250
+ return this.$$.ctx[15];
3196
3251
  }
3197
3252
 
3198
3253
  set values(values) {
@@ -3228,7 +3283,7 @@ class Dropdown extends SvelteElement {
3228
3283
  }
3229
3284
 
3230
3285
  get multiselect() {
3231
- return this.$$.ctx[14];
3286
+ return this.$$.ctx[16];
3232
3287
  }
3233
3288
 
3234
3289
  set multiselect(multiselect) {
@@ -3237,7 +3292,7 @@ class Dropdown extends SvelteElement {
3237
3292
  }
3238
3293
 
3239
3294
  get disabled() {
3240
- return this.$$.ctx[15];
3295
+ return this.$$.ctx[4];
3241
3296
  }
3242
3297
 
3243
3298
  set disabled(disabled) {
@@ -3245,19 +3300,37 @@ class Dropdown extends SvelteElement {
3245
3300
  flush();
3246
3301
  }
3247
3302
 
3248
- get autocomplete() {
3249
- return this.$$.ctx[16];
3303
+ get filterable() {
3304
+ return this.$$.ctx[5];
3250
3305
  }
3251
3306
 
3252
- set autocomplete(autocomplete) {
3253
- this.$$set({ autocomplete });
3307
+ set filterable(filterable) {
3308
+ this.$$set({ filterable });
3309
+ flush();
3310
+ }
3311
+
3312
+ get error() {
3313
+ return this.$$.ctx[17];
3314
+ }
3315
+
3316
+ set error(error) {
3317
+ this.$$set({ error });
3318
+ flush();
3319
+ }
3320
+
3321
+ get testid() {
3322
+ return this.$$.ctx[6];
3323
+ }
3324
+
3325
+ set testid(testid) {
3326
+ this.$$set({ testid });
3254
3327
  flush();
3255
3328
  }
3256
3329
  }
3257
3330
 
3258
3331
  customElements.define("goa-dropdown", Dropdown);
3259
3332
 
3260
- /* libs/web-components/src/components/dropdown-item/DropdownItem.svelte generated by Svelte v3.44.3 */
3333
+ /* libs/web-components/src/components/dropdown/DropdownItem.svelte generated by Svelte v3.44.3 */
3261
3334
 
3262
3335
  function create_fragment$i(ctx) {
3263
3336
  let li;
@@ -3272,7 +3345,7 @@ function create_fragment$i(ctx) {
3272
3345
  this.c = noop;
3273
3346
  attr(li, "class", "goa-dropdown-option");
3274
3347
  attr(li, "style", li_style_value = `display: ${/*isHidden*/ ctx[4] ? "none" : "block"}`);
3275
- attr(li, "data-testid", /*testId*/ ctx[1]);
3348
+ attr(li, "data-testid", /*testid*/ ctx[1]);
3276
3349
  toggle_class(li, "goa-dropdown-option--disabled", /*isDisabled*/ ctx[5]);
3277
3350
  toggle_class(li, "goa-dropdown-option--selected", /*isSelected*/ ctx[3]);
3278
3351
  },
@@ -3291,8 +3364,8 @@ function create_fragment$i(ctx) {
3291
3364
  attr(li, "style", li_style_value);
3292
3365
  }
3293
3366
 
3294
- if (dirty & /*testId*/ 2) {
3295
- attr(li, "data-testid", /*testId*/ ctx[1]);
3367
+ if (dirty & /*testid*/ 2) {
3368
+ attr(li, "data-testid", /*testid*/ ctx[1]);
3296
3369
  }
3297
3370
 
3298
3371
  if (dirty & /*isDisabled*/ 32) {
@@ -3320,16 +3393,16 @@ function instance$h($$self, $$props, $$invalidate) {
3320
3393
  let { name = "" } = $$props;
3321
3394
  let { value = "" } = $$props;
3322
3395
  let { label = "" } = $$props;
3323
- let { testId = "" } = $$props;
3324
3396
  let { selected = "false" } = $$props;
3325
3397
  let { disabled = "false" } = $$props;
3326
3398
  let { hide = "false" } = $$props;
3399
+ let { testid } = $$props;
3327
3400
 
3328
3401
  // private
3329
- let multiSelect;
3330
-
3331
3402
  let filteredLabel;
3332
3403
 
3404
+ let ctx;
3405
+
3333
3406
  function getFilteredLabel(filter) {
3334
3407
  if (filter.length === 0) {
3335
3408
  return label;
@@ -3353,89 +3426,73 @@ function instance$h($$self, $$props, $$invalidate) {
3353
3426
  return filteredLabel;
3354
3427
  }
3355
3428
 
3356
- messageChannel$1.subscribe(channel => {
3357
- const msg = channel[name];
3358
-
3359
- if (!msg) {
3360
- return;
3361
- }
3429
+ function onSelect() {
3430
+ $$invalidate(3, isSelected = !isSelected);
3431
+ ctx.notify("selectionChange", { label, value, selected: isSelected });
3432
+ }
3362
3433
 
3363
- if (msg.tag !== name) {
3364
- return;
3365
- }
3434
+ // Hooks
3435
+ let unsub;
3366
3436
 
3367
- switch (msg.payload.type) {
3368
- case "FilterChange":
3369
- {
3370
- const filter = msg.payload.filter.toLowerCase();
3437
+ onMount(() => {
3438
+ ctx = getContext(name);
3371
3439
 
3372
- if (!value && !label) {
3373
- $$invalidate(7, hide = "false");
3374
- } else {
3375
- const matches = value.toLowerCase().includes(filter) || label.toLowerCase().includes(filter);
3376
- $$invalidate(7, hide = fromBoolean(!matches));
3377
- }
3440
+ ctx.subscribe("propChange", data => {
3441
+ $$invalidate(3, isSelected = data.values.includes(value));
3442
+ });
3378
3443
 
3379
- $$invalidate(2, filteredLabel = getFilteredLabel(filter));
3380
- break;
3381
- }
3382
- case "DropDownAction":
3383
- {
3384
- if (msg.payload.label !== label && !multiSelect) {
3385
- $$invalidate(3, isSelected = false);
3386
- }
3444
+ unsub = ctx.subscribe("propChange", data => {
3445
+ const isSelected = data.values.includes(value);
3387
3446
 
3388
- break;
3389
- }
3390
- case "DropDownInit":
3391
- {
3392
- $$invalidate(3, isSelected = msg.payload.values.includes(value));
3393
- multiSelect = msg.payload.multiSelect;
3394
-
3395
- if (isSelected) {
3396
- messageChannel$1.update(old => Object.assign(Object.assign({}, old), {
3397
- [name]: {
3398
- tag: name,
3399
- payload: {
3400
- type: "DropDownAction",
3401
- action: "select",
3402
- label,
3403
- value
3404
- }
3405
- }
3406
- }));
3407
- }
3447
+ if (isSelected) {
3448
+ ctx.notify("init", { label, value, selected: true });
3449
+ }
3408
3450
 
3409
- break;
3410
- }
3411
- }
3412
- });
3451
+ unsub();
3452
+ });
3413
3453
 
3414
- function onSelect() {
3415
- $$invalidate(3, isSelected = !isSelected);
3454
+ ctx.subscribe("filterChange", data => {
3455
+ const filter = data.filter.toLowerCase();
3416
3456
 
3417
- messageChannel$1.update(old => Object.assign(Object.assign({}, old), {
3418
- [name]: {
3419
- tag: name,
3420
- payload: {
3421
- type: "DropDownAction",
3422
- action: isSelected ? "select" : "deselect",
3423
- label,
3424
- value,
3425
- multiSelect
3457
+ if (!value && !label) {
3458
+ $$invalidate(7, hide = "false");
3459
+ } else {
3460
+ let matches;
3461
+
3462
+ switch (typeof value) {
3463
+ case "string":
3464
+ matches = (value === null || value === void 0
3465
+ ? void 0
3466
+ : value.toLowerCase().includes(filter)) || (label === null || label === void 0
3467
+ ? void 0
3468
+ : label.toLowerCase().includes(filter));
3469
+ break;
3470
+ case "number":
3471
+ matches = value === filter || (label === null || label === void 0
3472
+ ? void 0
3473
+ : label.toLowerCase().includes(filter));
3474
+ break;
3426
3475
  }
3476
+
3477
+ $$invalidate(7, hide = fromBoolean(!matches));
3427
3478
  }
3428
- }));
3429
- }
3479
+
3480
+ $$invalidate(2, filteredLabel = getFilteredLabel(filter));
3481
+ });
3482
+ });
3483
+
3484
+ onDestroy(() => {
3485
+ unsub();
3486
+ });
3430
3487
 
3431
3488
  $$self.$$set = $$props => {
3432
3489
  if ('name' in $$props) $$invalidate(8, name = $$props.name);
3433
3490
  if ('value' in $$props) $$invalidate(9, value = $$props.value);
3434
3491
  if ('label' in $$props) $$invalidate(0, label = $$props.label);
3435
- if ('testId' in $$props) $$invalidate(1, testId = $$props.testId);
3436
3492
  if ('selected' in $$props) $$invalidate(10, selected = $$props.selected);
3437
3493
  if ('disabled' in $$props) $$invalidate(11, disabled = $$props.disabled);
3438
3494
  if ('hide' in $$props) $$invalidate(7, hide = $$props.hide);
3495
+ if ('testid' in $$props) $$invalidate(1, testid = $$props.testid);
3439
3496
  };
3440
3497
 
3441
3498
  $$self.$$.update = () => {
@@ -3454,7 +3511,7 @@ function instance$h($$self, $$props, $$invalidate) {
3454
3511
 
3455
3512
  return [
3456
3513
  label,
3457
- testId,
3514
+ testid,
3458
3515
  filteredLabel,
3459
3516
  isSelected,
3460
3517
  isHidden,
@@ -3487,10 +3544,10 @@ class DropdownItem extends SvelteElement {
3487
3544
  name: 8,
3488
3545
  value: 9,
3489
3546
  label: 0,
3490
- testId: 1,
3491
3547
  selected: 10,
3492
3548
  disabled: 11,
3493
- hide: 7
3549
+ hide: 7,
3550
+ testid: 1
3494
3551
  },
3495
3552
  null
3496
3553
  );
@@ -3508,7 +3565,7 @@ class DropdownItem extends SvelteElement {
3508
3565
  }
3509
3566
 
3510
3567
  static get observedAttributes() {
3511
- return ["name", "value", "label", "testId", "selected", "disabled", "hide"];
3568
+ return ["name", "value", "label", "selected", "disabled", "hide", "testid"];
3512
3569
  }
3513
3570
 
3514
3571
  get name() {
@@ -3538,15 +3595,6 @@ class DropdownItem extends SvelteElement {
3538
3595
  flush();
3539
3596
  }
3540
3597
 
3541
- get testId() {
3542
- return this.$$.ctx[1];
3543
- }
3544
-
3545
- set testId(testId) {
3546
- this.$$set({ testId });
3547
- flush();
3548
- }
3549
-
3550
3598
  get selected() {
3551
3599
  return this.$$.ctx[10];
3552
3600
  }
@@ -3573,6 +3621,15 @@ class DropdownItem extends SvelteElement {
3573
3621
  this.$$set({ hide });
3574
3622
  flush();
3575
3623
  }
3624
+
3625
+ get testid() {
3626
+ return this.$$.ctx[1];
3627
+ }
3628
+
3629
+ set testid(testid) {
3630
+ this.$$set({ testid });
3631
+ flush();
3632
+ }
3576
3633
  }
3577
3634
 
3578
3635
  customElements.define("goa-dropdown-item", DropdownItem);
@@ -4956,7 +5013,7 @@ function instance$b($$self, $$props, $$invalidate) {
4956
5013
  class Input extends SvelteElement {
4957
5014
  constructor(options) {
4958
5015
  super();
4959
- this.shadowRoot.innerHTML = `<style>:host{box-sizing:border-box;font-family:var(--font-family)}.goa-input,.goa-input *{box-sizing:border-box}.goa-input{box-sizing:border-box;outline:none;transition:box-shadow 0.1s ease-in;border:1px solid var(--color-gray-600);border-radius:3px;background:white;color:var(--color-black, #ccc);padding:var(--input-padding, 0.5rem) 0.5rem;display:inline-flex;align-items:center}.goa-input:hover{border-color:var(--goa-color-interactive--hover)}.goa-input:active,.goa-input:focus,.goa-input:focus-within{box-shadow:0 0 0 3px var(--goa-color-interactive--focus)}.goa-input:disabled{border-color:var(--color-gray-500)}.goa-input:disabled:hover{border-color:var(--color-gray-500)}.goa-input:disabled:focus{box-shadow:none}.goa-input input[readonly]{cursor:pointer}.goa-input.type--range{border:none}.goa-input.type--range:active,.goa-input.type--range:focus,.goa-input.type--range:focus-within{box-shadow:none}.goa-input-leading-icon{line-height:18px}.goa-input-trailing-icon{display:flex;align-items:center}.goa-input-trailing-icon>.goa-icon-button{margin-right:-0.5rem}input{display:block;width:100%;font-size:var(--input-font-size)}.goa-input-leading-icon+input{padding-left:0.5rem}input,input:focus,input:hover,input:active{outline:none;border:none}.goa-input--disabled{opacity:0.5;cursor:default;border-color:var(--color-black)}.goa-input--disabled:hover,.goa-input--disabled:active,.goa-input--disabled:focus{border-color:var(--color-black);cursor:default;box-shadow:none}.goa-input--disabled input:hover{cursor:default !important}input.input--goa{display:block;border:none;flex:1 1 auto}.variant--bare{border:none}.variant--bare:focus,.variant--bare:active,.variant--bare:focus-within{box-shadow:none}.goa-state--error .goa-input{border:2px solid var(--goa-color-status-emergency)}.error:hover,.error:focus,.error{border:2px solid var(--goa-color-status-emergency-dark)}</style>`;
5016
+ this.shadowRoot.innerHTML = `<style>:host{box-sizing:border-box;font-family:var(--font-family)}.goa-input,.goa-input *{box-sizing:border-box}.goa-input{box-sizing:border-box;outline:none;transition:box-shadow 0.1s ease-in;border:1px solid var(--color-gray-600);border-radius:3px;background:white;color:var(--color-black, #ccc);padding:var(--input-padding, 0.5rem) 0.5rem;display:inline-flex;align-items:center}.goa-input:hover{border-color:var(--goa-color-interactive--hover)}.goa-input:active,.goa-input:focus,.goa-input:focus-within{box-shadow:0 0 0 3px var(--goa-color-interactive--focus)}.goa-input:disabled{border-color:var(--color-gray-500)}.goa-input:disabled:hover{border-color:var(--color-gray-500)}.goa-input:disabled:focus{box-shadow:none}.goa-input input[readonly]{cursor:pointer}.goa-input.type--range{border:none}.goa-input.type--range:active,.goa-input.type--range:focus,.goa-input.type--range:focus-within{box-shadow:none}.goa-input-leading-icon{line-height:18px}.goa-input-trailing-icon{display:flex;align-items:center}.goa-input-trailing-icon>.goa-icon-button{margin-right:-0.5rem}input{display:block;width:100%;font-size:var(--input-font-size)}.goa-input-leading-icon+input{padding-left:0.5rem}input,input:focus,input:hover,input:active{outline:none;border:none}.goa-input--disabled{opacity:0.5;cursor:default;border-color:var(--color-black)}.goa-input--disabled:hover,.goa-input--disabled:active,.goa-input--disabled:focus{border-color:var(--color-black);cursor:default;box-shadow:none}.goa-input--disabled input:hover{cursor:default !important}input.input--goa{display:block;border:none;flex:1 1 auto}.variant--bare{border:none}.variant--bare:focus,.variant--bare:active,.variant--bare:focus-within{box-shadow:none}.error:hover,.error:focus,.error{border:2px solid var(--goa-color-status-emergency-dark)}</style>`;
4960
5017
 
4961
5018
  init(
4962
5019
  this,
@@ -6477,45 +6534,40 @@ class CircularProgress extends SvelteElement {
6477
6534
 
6478
6535
  customElements.define("goa-circular-progress", CircularProgress);
6479
6536
 
6480
- const messageChannel = writable({});
6481
-
6482
6537
  /* libs/web-components/src/components/radio-group/RadioGroup.svelte generated by Svelte v3.44.3 */
6483
6538
 
6484
6539
  function create_fragment$7(ctx) {
6485
- let div1;
6486
- let div0;
6540
+ let div;
6487
6541
  let slot;
6488
- let div0_class_value;
6542
+ let div_class_value;
6489
6543
 
6490
6544
  return {
6491
6545
  c() {
6492
- div1 = element("div");
6493
- div0 = element("div");
6546
+ div = element("div");
6494
6547
  slot = element("slot");
6495
6548
  this.c = noop;
6496
- attr(div0, "class", div0_class_value = `goa-radio-group--${/*orientation*/ ctx[0]}`);
6497
- attr(div0, "data-testid", /*testid*/ ctx[1]);
6549
+ attr(div, "class", div_class_value = `goa-radio-group--${/*orientation*/ ctx[0]}`);
6550
+ attr(div, "data-testid", /*testid*/ ctx[1]);
6498
6551
  },
6499
6552
  m(target, anchor) {
6500
- insert(target, div1, anchor);
6501
- append(div1, div0);
6502
- append(div0, slot);
6503
- /*div0_binding*/ ctx[9](div0);
6553
+ insert(target, div, anchor);
6554
+ append(div, slot);
6555
+ /*div_binding*/ ctx[10](div);
6504
6556
  },
6505
6557
  p(ctx, [dirty]) {
6506
- if (dirty & /*orientation*/ 1 && div0_class_value !== (div0_class_value = `goa-radio-group--${/*orientation*/ ctx[0]}`)) {
6507
- attr(div0, "class", div0_class_value);
6558
+ if (dirty & /*orientation*/ 1 && div_class_value !== (div_class_value = `goa-radio-group--${/*orientation*/ ctx[0]}`)) {
6559
+ attr(div, "class", div_class_value);
6508
6560
  }
6509
6561
 
6510
6562
  if (dirty & /*testid*/ 2) {
6511
- attr(div0, "data-testid", /*testid*/ ctx[1]);
6563
+ attr(div, "data-testid", /*testid*/ ctx[1]);
6512
6564
  }
6513
6565
  },
6514
6566
  i: noop,
6515
6567
  o: noop,
6516
6568
  d(detaching) {
6517
- if (detaching) detach(div1);
6518
- /*div0_binding*/ ctx[9](null);
6569
+ if (detaching) detach(div);
6570
+ /*div_binding*/ ctx[10](null);
6519
6571
  }
6520
6572
  };
6521
6573
  }
@@ -6525,48 +6577,42 @@ function instance$7($$self, $$props, $$invalidate) {
6525
6577
  let { name } = $$props;
6526
6578
  let { value } = $$props;
6527
6579
  let { orientation = 'vertical' } = $$props;
6528
- let { disabled } = $$props;
6529
- let { error } = $$props;
6530
- let { testid } = $$props;
6580
+ let { disabled = "false" } = $$props;
6581
+ let { error = "false" } = $$props;
6582
+ let { testid = "" } = $$props;
6531
6583
 
6532
6584
  // private
6533
6585
  let isError;
6586
+
6587
+ let ctx;
6534
6588
  let el;
6535
- let unsubscribe;
6536
6589
 
6537
6590
  onMount(() => {
6538
- // set initial state
6539
- messageChannel.update(prev => {
6540
- return Object.assign(Object.assign({}, prev), {
6541
- [name]: {
6542
- tag: name,
6543
- payload: {
6544
- value,
6545
- disabled: isDisabled,
6546
- error: isError
6547
- }
6548
- }
6591
+ $$invalidate(8, ctx = getContext(name));
6592
+
6593
+ ctx.subscribe("optionChange", state => {
6594
+ // This isn't required when the component is properly bound, but this
6595
+ // will make the component appear to work properly before the component
6596
+ // is properly bound.
6597
+ ctx.notify("propChange", {
6598
+ value: state.value,
6599
+ disabled: state.disabled,
6600
+ error: state.error
6549
6601
  });
6550
- });
6551
-
6552
- unsubscribe = messageChannel.subscribe(state => {
6553
- const payload = state[name].payload;
6554
-
6555
- if (payload.value !== value) {
6556
- $$invalidate(3, value = payload.value);
6557
6602
 
6558
- el.dispatchEvent(new CustomEvent('_change',
6559
- {
6560
- composed: true,
6561
- detail: { name, value: payload.value }
6562
- }));
6563
- }
6603
+ el.dispatchEvent(new CustomEvent('_change',
6604
+ {
6605
+ composed: true,
6606
+ detail: { name, value: state.value }
6607
+ }));
6564
6608
  });
6565
6609
  });
6566
6610
 
6567
- onDestroy(unsubscribe);
6611
+ onDestroy(() => {
6612
+ deleteContext(name);
6613
+ });
6568
6614
 
6569
- function div0_binding($$value) {
6615
+ function div_binding($$value) {
6570
6616
  binding_callbacks[$$value ? 'unshift' : 'push'](() => {
6571
6617
  el = $$value;
6572
6618
  $$invalidate(2, el);
@@ -6574,8 +6620,8 @@ function instance$7($$self, $$props, $$invalidate) {
6574
6620
  }
6575
6621
 
6576
6622
  $$self.$$set = $$props => {
6577
- if ('name' in $$props) $$invalidate(4, name = $$props.name);
6578
- if ('value' in $$props) $$invalidate(3, value = $$props.value);
6623
+ if ('name' in $$props) $$invalidate(3, name = $$props.name);
6624
+ if ('value' in $$props) $$invalidate(4, value = $$props.value);
6579
6625
  if ('orientation' in $$props) $$invalidate(0, orientation = $$props.orientation);
6580
6626
  if ('disabled' in $$props) $$invalidate(5, disabled = $$props.disabled);
6581
6627
  if ('error' in $$props) $$invalidate(6, error = $$props.error);
@@ -6584,25 +6630,23 @@ function instance$7($$self, $$props, $$invalidate) {
6584
6630
 
6585
6631
  $$self.$$.update = () => {
6586
6632
  if ($$self.$$.dirty & /*disabled*/ 32) {
6587
- $$invalidate(8, isDisabled = toBoolean(disabled));
6633
+ $$invalidate(9, isDisabled = toBoolean(disabled));
6634
+ }
6635
+
6636
+ if ($$self.$$.dirty & /*error*/ 64) {
6637
+ $$invalidate(7, isError = toBoolean(error));
6588
6638
  }
6589
6639
 
6590
- if ($$self.$$.dirty & /*error, name, value, isDisabled, isError*/ 472) {
6640
+ if ($$self.$$.dirty & /*ctx, value, isDisabled, isError*/ 912) {
6641
+ // reactive updates to exposed properties
6591
6642
  {
6592
- $$invalidate(7, isError = toBoolean(error));
6593
-
6594
- messageChannel.update(prev => {
6595
- return Object.assign(Object.assign({}, prev), {
6596
- [name]: {
6597
- tag: name,
6598
- payload: {
6599
- value,
6600
- disabled: isDisabled,
6601
- error: isError
6602
- }
6603
- }
6643
+ ctx === null || ctx === void 0
6644
+ ? void 0
6645
+ : ctx.notify("propChange", {
6646
+ value,
6647
+ disabled: isDisabled,
6648
+ error: isError
6604
6649
  });
6605
- });
6606
6650
  }
6607
6651
  }
6608
6652
  };
@@ -6611,13 +6655,14 @@ function instance$7($$self, $$props, $$invalidate) {
6611
6655
  orientation,
6612
6656
  testid,
6613
6657
  el,
6614
- value,
6615
6658
  name,
6659
+ value,
6616
6660
  disabled,
6617
6661
  error,
6618
6662
  isError,
6663
+ ctx,
6619
6664
  isDisabled,
6620
- div0_binding
6665
+ div_binding
6621
6666
  ];
6622
6667
  }
6623
6668
 
@@ -6637,8 +6682,8 @@ class RadioGroup extends SvelteElement {
6637
6682
  create_fragment$7,
6638
6683
  safe_not_equal,
6639
6684
  {
6640
- name: 4,
6641
- value: 3,
6685
+ name: 3,
6686
+ value: 4,
6642
6687
  orientation: 0,
6643
6688
  disabled: 5,
6644
6689
  error: 6,
@@ -6664,7 +6709,7 @@ class RadioGroup extends SvelteElement {
6664
6709
  }
6665
6710
 
6666
6711
  get name() {
6667
- return this.$$.ctx[4];
6712
+ return this.$$.ctx[3];
6668
6713
  }
6669
6714
 
6670
6715
  set name(name) {
@@ -6673,7 +6718,7 @@ class RadioGroup extends SvelteElement {
6673
6718
  }
6674
6719
 
6675
6720
  get value() {
6676
- return this.$$.ctx[3];
6721
+ return this.$$.ctx[4];
6677
6722
  }
6678
6723
 
6679
6724
  set value(value) {
@@ -6720,7 +6765,7 @@ class RadioGroup extends SvelteElement {
6720
6765
 
6721
6766
  customElements.define("goa-radio-group", RadioGroup);
6722
6767
 
6723
- /* libs/web-components/src/components/radio-item/RadioItem.svelte generated by Svelte v3.44.3 */
6768
+ /* libs/web-components/src/components/radio-group/RadioItem.svelte generated by Svelte v3.44.3 */
6724
6769
 
6725
6770
  function create_fragment$6(ctx) {
6726
6771
  let label_1;
@@ -6732,6 +6777,7 @@ function create_fragment$6(ctx) {
6732
6777
  let slot;
6733
6778
  let t2_value = (/*label*/ ctx[1] || /*value*/ ctx[0]) + "";
6734
6779
  let t2;
6780
+ let label_1_data_testid_value;
6735
6781
  let mounted;
6736
6782
  let dispose;
6737
6783
 
@@ -6747,13 +6793,13 @@ function create_fragment$6(ctx) {
6747
6793
  t2 = text(t2_value);
6748
6794
  this.c = noop;
6749
6795
  attr(input, "type", "radio");
6750
- attr(input, "data-testid", "radio-input");
6751
6796
  attr(input, "name", /*name*/ ctx[2]);
6752
6797
  input.value = /*value*/ ctx[0];
6753
6798
  input.checked = /*checked*/ ctx[4];
6754
6799
  input.disabled = /*disabled*/ ctx[3];
6755
6800
  attr(div, "class", "goa-radio-icon");
6756
6801
  attr(span, "class", "goa-radio-label");
6802
+ attr(label_1, "data-testid", label_1_data_testid_value = "radio-item-" + /*value*/ ctx[0]);
6757
6803
  attr(label_1, "class", "goa-radio");
6758
6804
  toggle_class(label_1, "goa-radio--disabled", /*disabled*/ ctx[3]);
6759
6805
  toggle_class(label_1, "goa-radio--error", /*error*/ ctx[5]);
@@ -6792,6 +6838,10 @@ function create_fragment$6(ctx) {
6792
6838
 
6793
6839
  if (dirty & /*label, value*/ 3 && t2_value !== (t2_value = (/*label*/ ctx[1] || /*value*/ ctx[0]) + "")) set_data(t2, t2_value);
6794
6840
 
6841
+ if (dirty & /*value*/ 1 && label_1_data_testid_value !== (label_1_data_testid_value = "radio-item-" + /*value*/ ctx[0])) {
6842
+ attr(label_1, "data-testid", label_1_data_testid_value);
6843
+ }
6844
+
6795
6845
  if (dirty & /*disabled*/ 8) {
6796
6846
  toggle_class(label_1, "goa-radio--disabled", /*disabled*/ ctx[3]);
6797
6847
  }
@@ -6820,35 +6870,25 @@ function instance$6($$self, $$props, $$invalidate) {
6820
6870
 
6821
6871
  let checked = false;
6822
6872
  let error = false;
6823
- let unsubscribe;
6873
+ let ctx;
6824
6874
 
6825
6875
  // Hooks
6826
6876
  onMount(() => {
6827
- unsubscribe = messageChannel.subscribe(channel => {
6828
- const msg = channel[name];
6829
-
6830
- if ((msg === null || msg === void 0 ? void 0 : msg.tag) !== name) {
6831
- return;
6832
- }
6877
+ ctx = getContext(name);
6833
6878
 
6834
- $$invalidate(4, checked = msg.payload.value === value);
6835
- $$invalidate(3, disabled = msg.payload.disabled);
6836
- $$invalidate(5, error = msg.payload.error);
6879
+ ctx.subscribe("propChange", state => {
6880
+ $$invalidate(4, checked = state.value === value);
6881
+ $$invalidate(3, disabled = state.disabled);
6882
+ $$invalidate(5, error = state.error);
6837
6883
  });
6838
6884
  });
6839
6885
 
6840
- onDestroy(unsubscribe);
6841
-
6842
6886
  // Events
6843
6887
  function onChange(e) {
6844
6888
  $$invalidate(4, checked = !checked);
6845
6889
 
6846
6890
  if (checked) {
6847
- messageChannel.update(prev => {
6848
- return Object.assign(Object.assign({}, prev), {
6849
- [name]: { tag: name, payload: { disabled, value } }
6850
- });
6851
- });
6891
+ ctx.notify("optionChange", { checked, disabled, value });
6852
6892
  }
6853
6893
  }
6854
6894