@abgov/react-components 4.0.0-alpha.142 → 4.0.0-alpha.144
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/lib/popover/popover.d.ts +3 -2
- package/package.json +1 -1
- package/react-components.esm.js +193 -47
- package/react-components.umd.js +196 -49
package/lib/popover/popover.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { FC, ReactNode } from "react";
|
|
2
|
-
|
|
2
|
+
import { Margins } from "../../common/styling";
|
|
3
|
+
interface WCProps extends Margins {
|
|
3
4
|
maxwidth?: string;
|
|
4
5
|
padded?: boolean;
|
|
5
6
|
}
|
|
@@ -10,7 +11,7 @@ declare global {
|
|
|
10
11
|
}
|
|
11
12
|
}
|
|
12
13
|
}
|
|
13
|
-
interface Props {
|
|
14
|
+
interface Props extends Margins {
|
|
14
15
|
target?: ReactNode;
|
|
15
16
|
testId?: string;
|
|
16
17
|
maxWidth?: string;
|
package/package.json
CHANGED
package/react-components.esm.js
CHANGED
|
@@ -12361,35 +12361,25 @@ customElements.define("goa-input", Input);
|
|
|
12361
12361
|
/* libs/web-components/src/components/microsite-header/MicrositeHeader.svelte generated by Svelte v3.51.0 */
|
|
12362
12362
|
|
|
12363
12363
|
function create_if_block_3$5(ctx) {
|
|
12364
|
-
let
|
|
12365
|
-
let t0;
|
|
12366
|
-
let div1;
|
|
12364
|
+
let div;
|
|
12367
12365
|
return {
|
|
12368
12366
|
c() {
|
|
12369
|
-
|
|
12370
|
-
|
|
12371
|
-
|
|
12372
|
-
|
|
12373
|
-
div1.innerHTML = `An official site of the <a href="https://www.alberta.ca/index.aspx">Alberta Government</a>`;
|
|
12374
|
-
attr(div0, "class", "service-type service-type--live");
|
|
12375
|
-
attr(div1, "data-testid", "type");
|
|
12376
|
-
attr(div1, "class", "site-text");
|
|
12367
|
+
div = element("div");
|
|
12368
|
+
div.innerHTML = `An official site of the <a href="https://www.alberta.ca/index.aspx">Alberta Government</a>`;
|
|
12369
|
+
attr(div, "data-testid", "type");
|
|
12370
|
+
attr(div, "class", "site-text");
|
|
12377
12371
|
},
|
|
12378
12372
|
|
|
12379
12373
|
m(target, anchor) {
|
|
12380
|
-
insert(target,
|
|
12381
|
-
insert(target, t0, anchor);
|
|
12382
|
-
insert(target, div1, anchor);
|
|
12374
|
+
insert(target, div, anchor);
|
|
12383
12375
|
},
|
|
12384
12376
|
|
|
12385
12377
|
d(detaching) {
|
|
12386
|
-
if (detaching) detach(
|
|
12387
|
-
if (detaching) detach(t0);
|
|
12388
|
-
if (detaching) detach(div1);
|
|
12378
|
+
if (detaching) detach(div);
|
|
12389
12379
|
}
|
|
12390
12380
|
|
|
12391
12381
|
};
|
|
12392
|
-
} // (
|
|
12382
|
+
} // (29:2) {#if ["alpha", "beta"].includes(type)}
|
|
12393
12383
|
|
|
12394
12384
|
|
|
12395
12385
|
function create_if_block_1$5(ctx) {
|
|
@@ -12477,7 +12467,7 @@ function create_if_block_1$5(ctx) {
|
|
|
12477
12467
|
}
|
|
12478
12468
|
|
|
12479
12469
|
};
|
|
12480
|
-
} // (
|
|
12470
|
+
} // (38:6) {#if feedbackurl}
|
|
12481
12471
|
|
|
12482
12472
|
|
|
12483
12473
|
function create_if_block_2$5(ctx) {
|
|
@@ -12519,7 +12509,7 @@ function create_if_block_2$5(ctx) {
|
|
|
12519
12509
|
}
|
|
12520
12510
|
|
|
12521
12511
|
};
|
|
12522
|
-
} // (
|
|
12512
|
+
} // (44:2) {#if version}
|
|
12523
12513
|
|
|
12524
12514
|
|
|
12525
12515
|
function create_if_block$b(ctx) {
|
|
@@ -12691,7 +12681,7 @@ function instance$k($$self, $$props, $$invalidate) {
|
|
|
12691
12681
|
class MicrositeHeader extends SvelteElement {
|
|
12692
12682
|
constructor(options) {
|
|
12693
12683
|
super();
|
|
12694
|
-
this.shadowRoot.innerHTML = `<style>:host{box-sizing:border-box;font-family:var(--goa-font-family-sans)}a{color:var(--goa-color-interactive-default);cursor:pointer}a:hover{color:var(--goa-color-interactive-hover)}a:focus{outline-width:thin;outline-style:solid;outline-color:var(--goa-color-interactive-hover);outline-offset:0px}.goa-official-site-header{display:flex;font-size:var(--goa-font-size-2);background-color:var(--goa-color-greyscale-100);align-items:center;justify-content:space-between;padding:0.25rem 1.5rem}@media(max-width: 640px){.goa-official-site-header{padding:0.5rem 1rem;align-items:start}}.spacer{flex:1 1 auto}.version{color:var(--goa-color-text-secondary);padding-left:1rem;line-height:1.25rem}.service-type{font-weight:bold;padding:0.125rem 0.25rem;display:flex;margin-right:1rem;line-height:initial}.service-type--alpha{background-color:var(--goa-color-warning-default);color:var(--goa-color-text-default)}.service-type--beta{background-color:var(--goa-color-brand-default);color:var(--goa-color-text-light)}.
|
|
12684
|
+
this.shadowRoot.innerHTML = `<style>:host{box-sizing:border-box;font-family:var(--goa-font-family-sans)}a{color:var(--goa-color-interactive-default);cursor:pointer}a:hover{color:var(--goa-color-interactive-hover)}a:focus{outline-width:thin;outline-style:solid;outline-color:var(--goa-color-interactive-hover);outline-offset:0px}.goa-official-site-header{display:flex;font-size:var(--goa-font-size-2);background-color:var(--goa-color-greyscale-100);align-items:center;justify-content:space-between;padding:0.25rem 1.5rem}@media(max-width: 640px){.goa-official-site-header{padding:0.5rem 1rem;align-items:start}}.spacer{flex:1 1 auto}.version{color:var(--goa-color-text-secondary);padding-left:1rem;line-height:1.25rem}.service-type{font-weight:bold;padding:0.125rem 0.25rem;display:flex;margin-right:1rem;line-height:initial}.service-type--alpha{background-color:var(--goa-color-warning-default);color:var(--goa-color-text-default)}.service-type--beta{background-color:var(--goa-color-brand-default);color:var(--goa-color-text-light)}.site-text{color:var(--goa-color-text-default);line-height:1.25rem}</style>`;
|
|
12695
12685
|
init(this, {
|
|
12696
12686
|
target: this.shadowRoot,
|
|
12697
12687
|
props: attribute_to_object(this.attributes),
|
|
@@ -14549,11 +14539,11 @@ function create_if_block$7(ctx) {
|
|
|
14549
14539
|
ctx[1]);
|
|
14550
14540
|
set_style(section, "padding",
|
|
14551
14541
|
/*paddedContent*/
|
|
14552
|
-
ctx[
|
|
14542
|
+
ctx[9] ? 'var(--goa-space-m)' : '0');
|
|
14553
14543
|
attr(div1, "class", "popover-container");
|
|
14554
14544
|
set_custom_element_data(goa_focus_trap, "active",
|
|
14555
14545
|
/*_isContentVisible*/
|
|
14556
|
-
ctx[
|
|
14546
|
+
ctx[6]);
|
|
14557
14547
|
},
|
|
14558
14548
|
|
|
14559
14549
|
m(target, anchor) {
|
|
@@ -14563,11 +14553,14 @@ function create_if_block$7(ctx) {
|
|
|
14563
14553
|
append(goa_focus_trap, div1);
|
|
14564
14554
|
append(div1, section);
|
|
14565
14555
|
append(section, slot);
|
|
14556
|
+
/*section_binding*/
|
|
14557
|
+
|
|
14558
|
+
ctx[14](section);
|
|
14566
14559
|
|
|
14567
14560
|
if (!mounted) {
|
|
14568
14561
|
dispose = listen(div0, "click",
|
|
14569
14562
|
/*closePopover*/
|
|
14570
|
-
ctx[
|
|
14563
|
+
ctx[11]);
|
|
14571
14564
|
mounted = true;
|
|
14572
14565
|
}
|
|
14573
14566
|
},
|
|
@@ -14583,23 +14576,26 @@ function create_if_block$7(ctx) {
|
|
|
14583
14576
|
|
|
14584
14577
|
if (dirty &
|
|
14585
14578
|
/*paddedContent*/
|
|
14586
|
-
|
|
14579
|
+
512) {
|
|
14587
14580
|
set_style(section, "padding",
|
|
14588
14581
|
/*paddedContent*/
|
|
14589
|
-
ctx[
|
|
14582
|
+
ctx[9] ? 'var(--goa-space-m)' : '0');
|
|
14590
14583
|
}
|
|
14591
14584
|
|
|
14592
14585
|
if (dirty &
|
|
14593
14586
|
/*_isContentVisible*/
|
|
14594
|
-
|
|
14587
|
+
64) {
|
|
14595
14588
|
set_custom_element_data(goa_focus_trap, "active",
|
|
14596
14589
|
/*_isContentVisible*/
|
|
14597
|
-
ctx[
|
|
14590
|
+
ctx[6]);
|
|
14598
14591
|
}
|
|
14599
14592
|
},
|
|
14600
14593
|
|
|
14601
14594
|
d(detaching) {
|
|
14602
14595
|
if (detaching) detach(goa_focus_trap);
|
|
14596
|
+
/*section_binding*/
|
|
14597
|
+
|
|
14598
|
+
ctx[14](null);
|
|
14603
14599
|
mounted = false;
|
|
14604
14600
|
dispose();
|
|
14605
14601
|
}
|
|
@@ -14611,11 +14607,12 @@ function create_fragment$h(ctx) {
|
|
|
14611
14607
|
let div1;
|
|
14612
14608
|
let div0;
|
|
14613
14609
|
let t;
|
|
14610
|
+
let div1_style_value;
|
|
14614
14611
|
let mounted;
|
|
14615
14612
|
let dispose;
|
|
14616
14613
|
let if_block =
|
|
14617
14614
|
/*_isContentVisible*/
|
|
14618
|
-
ctx[
|
|
14615
|
+
ctx[6] && create_if_block$7(ctx);
|
|
14619
14616
|
return {
|
|
14620
14617
|
c() {
|
|
14621
14618
|
div1 = element("div");
|
|
@@ -14630,6 +14627,15 @@ function create_fragment$h(ctx) {
|
|
|
14630
14627
|
attr(div1, "data-testid",
|
|
14631
14628
|
/*testid*/
|
|
14632
14629
|
ctx[0]);
|
|
14630
|
+
attr(div1, "style", div1_style_value = calculateMargin(
|
|
14631
|
+
/*mt*/
|
|
14632
|
+
ctx[2],
|
|
14633
|
+
/*mr*/
|
|
14634
|
+
ctx[3],
|
|
14635
|
+
/*mb*/
|
|
14636
|
+
ctx[4],
|
|
14637
|
+
/*ml*/
|
|
14638
|
+
ctx[5]));
|
|
14633
14639
|
},
|
|
14634
14640
|
|
|
14635
14641
|
m(target, anchor) {
|
|
@@ -14637,14 +14643,14 @@ function create_fragment$h(ctx) {
|
|
|
14637
14643
|
append(div1, div0);
|
|
14638
14644
|
/*div0_binding*/
|
|
14639
14645
|
|
|
14640
|
-
ctx[
|
|
14646
|
+
ctx[13](div0);
|
|
14641
14647
|
append(div1, t);
|
|
14642
14648
|
if (if_block) if_block.m(div1, null);
|
|
14643
14649
|
|
|
14644
14650
|
if (!mounted) {
|
|
14645
14651
|
dispose = listen(div0, "click",
|
|
14646
14652
|
/*showPopover*/
|
|
14647
|
-
ctx[
|
|
14653
|
+
ctx[10]);
|
|
14648
14654
|
mounted = true;
|
|
14649
14655
|
}
|
|
14650
14656
|
},
|
|
@@ -14652,7 +14658,7 @@ function create_fragment$h(ctx) {
|
|
|
14652
14658
|
p(ctx, [dirty]) {
|
|
14653
14659
|
if (
|
|
14654
14660
|
/*_isContentVisible*/
|
|
14655
|
-
ctx[
|
|
14661
|
+
ctx[6]) {
|
|
14656
14662
|
if (if_block) {
|
|
14657
14663
|
if_block.p(ctx, dirty);
|
|
14658
14664
|
} else {
|
|
@@ -14672,6 +14678,20 @@ function create_fragment$h(ctx) {
|
|
|
14672
14678
|
/*testid*/
|
|
14673
14679
|
ctx[0]);
|
|
14674
14680
|
}
|
|
14681
|
+
|
|
14682
|
+
if (dirty &
|
|
14683
|
+
/*mt, mr, mb, ml*/
|
|
14684
|
+
60 && div1_style_value !== (div1_style_value = calculateMargin(
|
|
14685
|
+
/*mt*/
|
|
14686
|
+
ctx[2],
|
|
14687
|
+
/*mr*/
|
|
14688
|
+
ctx[3],
|
|
14689
|
+
/*mb*/
|
|
14690
|
+
ctx[4],
|
|
14691
|
+
/*ml*/
|
|
14692
|
+
ctx[5]))) {
|
|
14693
|
+
attr(div1, "style", div1_style_value);
|
|
14694
|
+
}
|
|
14675
14695
|
},
|
|
14676
14696
|
|
|
14677
14697
|
i: noop,
|
|
@@ -14681,7 +14701,7 @@ function create_fragment$h(ctx) {
|
|
|
14681
14701
|
if (detaching) detach(div1);
|
|
14682
14702
|
/*div0_binding*/
|
|
14683
14703
|
|
|
14684
|
-
ctx[
|
|
14704
|
+
ctx[13](null);
|
|
14685
14705
|
if (if_block) if_block.d();
|
|
14686
14706
|
mounted = false;
|
|
14687
14707
|
dispose();
|
|
@@ -14690,6 +14710,25 @@ function create_fragment$h(ctx) {
|
|
|
14690
14710
|
};
|
|
14691
14711
|
}
|
|
14692
14712
|
|
|
14713
|
+
function getBoundingClientRectWithMargins(el) {
|
|
14714
|
+
const rect = el.getBoundingClientRect();
|
|
14715
|
+
const style = window.getComputedStyle(el);
|
|
14716
|
+
const mTop = parseInt(style.marginTop, 10) || 0;
|
|
14717
|
+
const mRight = parseInt(style.marginRight, 10) || 0;
|
|
14718
|
+
const mBottom = parseInt(style.marginBottom, 10) || 0;
|
|
14719
|
+
const mLeft = parseInt(style.marginLeft, 10) || 0;
|
|
14720
|
+
return {
|
|
14721
|
+
top: rect.top - mTop,
|
|
14722
|
+
right: rect.right + mRight,
|
|
14723
|
+
bottom: rect.bottom + mBottom,
|
|
14724
|
+
left: rect.left - mLeft,
|
|
14725
|
+
width: rect.width + mLeft + mRight,
|
|
14726
|
+
height: rect.height + mTop + mBottom,
|
|
14727
|
+
x: rect.x - mLeft,
|
|
14728
|
+
y: rect.y - mTop
|
|
14729
|
+
};
|
|
14730
|
+
}
|
|
14731
|
+
|
|
14693
14732
|
function instance$f($$self, $$props, $$invalidate) {
|
|
14694
14733
|
let paddedContent;
|
|
14695
14734
|
let {
|
|
@@ -14705,6 +14744,20 @@ function instance$f($$self, $$props, $$invalidate) {
|
|
|
14705
14744
|
|
|
14706
14745
|
let _targetEl;
|
|
14707
14746
|
|
|
14747
|
+
let _popoverEl;
|
|
14748
|
+
|
|
14749
|
+
let {
|
|
14750
|
+
mt = null
|
|
14751
|
+
} = $$props;
|
|
14752
|
+
let {
|
|
14753
|
+
mr = null
|
|
14754
|
+
} = $$props;
|
|
14755
|
+
let {
|
|
14756
|
+
mb = null
|
|
14757
|
+
} = $$props;
|
|
14758
|
+
let {
|
|
14759
|
+
ml = null
|
|
14760
|
+
} = $$props;
|
|
14708
14761
|
onMount(async () => {
|
|
14709
14762
|
await tick();
|
|
14710
14763
|
addFocusEventListener();
|
|
@@ -14713,12 +14766,14 @@ function instance$f($$self, $$props, $$invalidate) {
|
|
|
14713
14766
|
removeEventListeners();
|
|
14714
14767
|
});
|
|
14715
14768
|
|
|
14716
|
-
function showPopover() {
|
|
14717
|
-
$$invalidate(
|
|
14769
|
+
async function showPopover() {
|
|
14770
|
+
$$invalidate(6, _isContentVisible = true);
|
|
14771
|
+
await tick();
|
|
14772
|
+
setPopoverPosition();
|
|
14718
14773
|
}
|
|
14719
14774
|
|
|
14720
14775
|
function closePopover() {
|
|
14721
|
-
$$invalidate(
|
|
14776
|
+
$$invalidate(6, _isContentVisible = false);
|
|
14722
14777
|
}
|
|
14723
14778
|
|
|
14724
14779
|
const onInputKeyDown = e => {
|
|
@@ -14736,6 +14791,30 @@ function instance$f($$self, $$props, $$invalidate) {
|
|
|
14736
14791
|
}
|
|
14737
14792
|
};
|
|
14738
14793
|
|
|
14794
|
+
function setPopoverPosition() {
|
|
14795
|
+
// Get target and content rectangles
|
|
14796
|
+
const targetRect = getBoundingClientRectWithMargins(_targetEl);
|
|
14797
|
+
const contentRect = getBoundingClientRectWithMargins(_popoverEl); // Calculate available space above and below the target element
|
|
14798
|
+
|
|
14799
|
+
const spaceAbove = targetRect.top;
|
|
14800
|
+
const spaceBelow = window.innerHeight - targetRect.bottom; // Determine if there's more space above or below the target element
|
|
14801
|
+
|
|
14802
|
+
const displayAbove = spaceAbove > contentRect.height && spaceAbove > spaceBelow && spaceBelow < contentRect.height; // If there's more space above, display the popover above the target element
|
|
14803
|
+
|
|
14804
|
+
if (displayAbove) {
|
|
14805
|
+
$$invalidate(8, _popoverEl.style.top = `${-contentRect.height - targetRect.height - 4}px`, _popoverEl);
|
|
14806
|
+
} else {
|
|
14807
|
+
$$invalidate(8, _popoverEl.style.top = '0px', _popoverEl);
|
|
14808
|
+
} // Move the popover to the left if it is too far to the right and only if there is space to the left
|
|
14809
|
+
|
|
14810
|
+
|
|
14811
|
+
if (window.innerWidth - targetRect.right < contentRect.width && targetRect.left > contentRect.width) {
|
|
14812
|
+
$$invalidate(8, _popoverEl.style.left = `-${contentRect.width - targetRect.width}px`, _popoverEl);
|
|
14813
|
+
} else {
|
|
14814
|
+
$$invalidate(8, _popoverEl.style.left = '0px', _popoverEl);
|
|
14815
|
+
}
|
|
14816
|
+
}
|
|
14817
|
+
|
|
14739
14818
|
function addFocusEventListener() {
|
|
14740
14819
|
_targetEl.addEventListener("focus", onFocus, true);
|
|
14741
14820
|
}
|
|
@@ -14754,31 +14833,42 @@ function instance$f($$self, $$props, $$invalidate) {
|
|
|
14754
14833
|
function div0_binding($$value) {
|
|
14755
14834
|
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
|
14756
14835
|
_targetEl = $$value;
|
|
14757
|
-
$$invalidate(
|
|
14836
|
+
$$invalidate(7, _targetEl);
|
|
14837
|
+
});
|
|
14838
|
+
}
|
|
14839
|
+
|
|
14840
|
+
function section_binding($$value) {
|
|
14841
|
+
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
|
14842
|
+
_popoverEl = $$value;
|
|
14843
|
+
$$invalidate(8, _popoverEl);
|
|
14758
14844
|
});
|
|
14759
14845
|
}
|
|
14760
14846
|
|
|
14761
14847
|
$$self.$$set = $$props => {
|
|
14762
14848
|
if ('testid' in $$props) $$invalidate(0, testid = $$props.testid);
|
|
14763
14849
|
if ('maxwidth' in $$props) $$invalidate(1, maxwidth = $$props.maxwidth);
|
|
14764
|
-
if ('padded' in $$props) $$invalidate(
|
|
14850
|
+
if ('padded' in $$props) $$invalidate(12, padded = $$props.padded);
|
|
14851
|
+
if ('mt' in $$props) $$invalidate(2, mt = $$props.mt);
|
|
14852
|
+
if ('mr' in $$props) $$invalidate(3, mr = $$props.mr);
|
|
14853
|
+
if ('mb' in $$props) $$invalidate(4, mb = $$props.mb);
|
|
14854
|
+
if ('ml' in $$props) $$invalidate(5, ml = $$props.ml);
|
|
14765
14855
|
};
|
|
14766
14856
|
|
|
14767
14857
|
$$self.$$.update = () => {
|
|
14768
14858
|
if ($$self.$$.dirty &
|
|
14769
14859
|
/*padded*/
|
|
14770
|
-
|
|
14771
|
-
$$invalidate(
|
|
14860
|
+
4096) {
|
|
14861
|
+
$$invalidate(9, paddedContent = toBoolean(padded));
|
|
14772
14862
|
}
|
|
14773
14863
|
};
|
|
14774
14864
|
|
|
14775
|
-
return [testid, maxwidth, _isContentVisible, _targetEl, paddedContent, showPopover, closePopover, padded, div0_binding];
|
|
14865
|
+
return [testid, maxwidth, mt, mr, mb, ml, _isContentVisible, _targetEl, _popoverEl, paddedContent, showPopover, closePopover, padded, div0_binding, section_binding];
|
|
14776
14866
|
}
|
|
14777
14867
|
|
|
14778
14868
|
class Popover extends SvelteElement {
|
|
14779
14869
|
constructor(options) {
|
|
14780
14870
|
super();
|
|
14781
|
-
this.shadowRoot.innerHTML = `<style>:host{box-sizing:border-box;font-family:var(--goa-font-family-sans);font-size:var(--goa-font-size-4)}.popover-target{width:fit-content;cursor:pointer}.popover-target:focus{outline:var(--goa-border-width-l) solid var(--goa-color-interactive-focus)}.popover-content{position:absolute;left:0;right:0;margin-top:3px;list-style-type:none;background:var(--goa-color-greyscale-white);
|
|
14871
|
+
this.shadowRoot.innerHTML = `<style>:host{box-sizing:border-box;font-family:var(--goa-font-family-sans);font-size:var(--goa-font-size-4)}.popover-target{width:fit-content;cursor:pointer}.popover-target:focus{outline:var(--goa-border-width-l) solid var(--goa-color-interactive-focus)}.popover-content{position:absolute;left:0;right:0;margin-top:3px;list-style-type:none;background:var(--goa-color-greyscale-white);outline:none;filter:drop-shadow(0px 2px 4px rgba(0, 0, 0, 0.2));z-index:99;width:max-content}.popover-background{cursor:default;position:fixed;z-index:98;inset:0}.popover-container{position:relative}</style>`;
|
|
14782
14872
|
init(this, {
|
|
14783
14873
|
target: this.shadowRoot,
|
|
14784
14874
|
props: attribute_to_object(this.attributes),
|
|
@@ -14786,7 +14876,11 @@ class Popover extends SvelteElement {
|
|
|
14786
14876
|
}, instance$f, create_fragment$h, safe_not_equal, {
|
|
14787
14877
|
testid: 0,
|
|
14788
14878
|
maxwidth: 1,
|
|
14789
|
-
padded:
|
|
14879
|
+
padded: 12,
|
|
14880
|
+
mt: 2,
|
|
14881
|
+
mr: 3,
|
|
14882
|
+
mb: 4,
|
|
14883
|
+
ml: 5
|
|
14790
14884
|
}, null);
|
|
14791
14885
|
|
|
14792
14886
|
if (options) {
|
|
@@ -14802,7 +14896,7 @@ class Popover extends SvelteElement {
|
|
|
14802
14896
|
}
|
|
14803
14897
|
|
|
14804
14898
|
static get observedAttributes() {
|
|
14805
|
-
return ["testid", "maxwidth", "padded"];
|
|
14899
|
+
return ["testid", "maxwidth", "padded", "mt", "mr", "mb", "ml"];
|
|
14806
14900
|
}
|
|
14807
14901
|
|
|
14808
14902
|
get testid() {
|
|
@@ -14828,7 +14922,7 @@ class Popover extends SvelteElement {
|
|
|
14828
14922
|
}
|
|
14829
14923
|
|
|
14830
14924
|
get padded() {
|
|
14831
|
-
return this.$$.ctx[
|
|
14925
|
+
return this.$$.ctx[12];
|
|
14832
14926
|
}
|
|
14833
14927
|
|
|
14834
14928
|
set padded(padded) {
|
|
@@ -14838,6 +14932,50 @@ class Popover extends SvelteElement {
|
|
|
14838
14932
|
flush();
|
|
14839
14933
|
}
|
|
14840
14934
|
|
|
14935
|
+
get mt() {
|
|
14936
|
+
return this.$$.ctx[2];
|
|
14937
|
+
}
|
|
14938
|
+
|
|
14939
|
+
set mt(mt) {
|
|
14940
|
+
this.$$set({
|
|
14941
|
+
mt
|
|
14942
|
+
});
|
|
14943
|
+
flush();
|
|
14944
|
+
}
|
|
14945
|
+
|
|
14946
|
+
get mr() {
|
|
14947
|
+
return this.$$.ctx[3];
|
|
14948
|
+
}
|
|
14949
|
+
|
|
14950
|
+
set mr(mr) {
|
|
14951
|
+
this.$$set({
|
|
14952
|
+
mr
|
|
14953
|
+
});
|
|
14954
|
+
flush();
|
|
14955
|
+
}
|
|
14956
|
+
|
|
14957
|
+
get mb() {
|
|
14958
|
+
return this.$$.ctx[4];
|
|
14959
|
+
}
|
|
14960
|
+
|
|
14961
|
+
set mb(mb) {
|
|
14962
|
+
this.$$set({
|
|
14963
|
+
mb
|
|
14964
|
+
});
|
|
14965
|
+
flush();
|
|
14966
|
+
}
|
|
14967
|
+
|
|
14968
|
+
get ml() {
|
|
14969
|
+
return this.$$.ctx[5];
|
|
14970
|
+
}
|
|
14971
|
+
|
|
14972
|
+
set ml(ml) {
|
|
14973
|
+
this.$$set({
|
|
14974
|
+
ml
|
|
14975
|
+
});
|
|
14976
|
+
flush();
|
|
14977
|
+
}
|
|
14978
|
+
|
|
14841
14979
|
}
|
|
14842
14980
|
|
|
14843
14981
|
customElements.define("goa-popover", Popover);
|
|
@@ -22862,12 +23000,20 @@ const GoAPopover = ({
|
|
|
22862
23000
|
testId,
|
|
22863
23001
|
maxWidth,
|
|
22864
23002
|
padded,
|
|
22865
|
-
children
|
|
23003
|
+
children,
|
|
23004
|
+
mt,
|
|
23005
|
+
mr,
|
|
23006
|
+
mb,
|
|
23007
|
+
ml
|
|
22866
23008
|
}) => {
|
|
22867
23009
|
return jsxs("goa-popover", Object.assign({
|
|
22868
23010
|
"data-testid": testId,
|
|
22869
23011
|
maxwidth: maxWidth,
|
|
22870
|
-
padded: padded
|
|
23012
|
+
padded: padded,
|
|
23013
|
+
mt: mt,
|
|
23014
|
+
mr: mr,
|
|
23015
|
+
mb: mb,
|
|
23016
|
+
ml: ml
|
|
22871
23017
|
}, {
|
|
22872
23018
|
children: [children, target && jsx("div", Object.assign({
|
|
22873
23019
|
slot: "target"
|
package/react-components.umd.js
CHANGED
|
@@ -12407,35 +12407,25 @@
|
|
|
12407
12407
|
/* libs/web-components/src/components/microsite-header/MicrositeHeader.svelte generated by Svelte v3.51.0 */
|
|
12408
12408
|
|
|
12409
12409
|
function create_if_block_3$5(ctx) {
|
|
12410
|
-
let
|
|
12411
|
-
let t0;
|
|
12412
|
-
let div1;
|
|
12410
|
+
let div;
|
|
12413
12411
|
return {
|
|
12414
12412
|
c() {
|
|
12415
|
-
|
|
12416
|
-
|
|
12417
|
-
|
|
12418
|
-
|
|
12419
|
-
div1.innerHTML = `An official site of the <a href="https://www.alberta.ca/index.aspx">Alberta Government</a>`;
|
|
12420
|
-
attr(div0, "class", "service-type service-type--live");
|
|
12421
|
-
attr(div1, "data-testid", "type");
|
|
12422
|
-
attr(div1, "class", "site-text");
|
|
12413
|
+
div = element("div");
|
|
12414
|
+
div.innerHTML = `An official site of the <a href="https://www.alberta.ca/index.aspx">Alberta Government</a>`;
|
|
12415
|
+
attr(div, "data-testid", "type");
|
|
12416
|
+
attr(div, "class", "site-text");
|
|
12423
12417
|
},
|
|
12424
12418
|
|
|
12425
12419
|
m(target, anchor) {
|
|
12426
|
-
insert(target,
|
|
12427
|
-
insert(target, t0, anchor);
|
|
12428
|
-
insert(target, div1, anchor);
|
|
12420
|
+
insert(target, div, anchor);
|
|
12429
12421
|
},
|
|
12430
12422
|
|
|
12431
12423
|
d(detaching) {
|
|
12432
|
-
if (detaching) detach(
|
|
12433
|
-
if (detaching) detach(t0);
|
|
12434
|
-
if (detaching) detach(div1);
|
|
12424
|
+
if (detaching) detach(div);
|
|
12435
12425
|
}
|
|
12436
12426
|
|
|
12437
12427
|
};
|
|
12438
|
-
} // (
|
|
12428
|
+
} // (29:2) {#if ["alpha", "beta"].includes(type)}
|
|
12439
12429
|
|
|
12440
12430
|
|
|
12441
12431
|
function create_if_block_1$5(ctx) {
|
|
@@ -12523,7 +12513,7 @@
|
|
|
12523
12513
|
}
|
|
12524
12514
|
|
|
12525
12515
|
};
|
|
12526
|
-
} // (
|
|
12516
|
+
} // (38:6) {#if feedbackurl}
|
|
12527
12517
|
|
|
12528
12518
|
|
|
12529
12519
|
function create_if_block_2$5(ctx) {
|
|
@@ -12565,7 +12555,7 @@
|
|
|
12565
12555
|
}
|
|
12566
12556
|
|
|
12567
12557
|
};
|
|
12568
|
-
} // (
|
|
12558
|
+
} // (44:2) {#if version}
|
|
12569
12559
|
|
|
12570
12560
|
|
|
12571
12561
|
function create_if_block$b(ctx) {
|
|
@@ -12737,7 +12727,7 @@
|
|
|
12737
12727
|
class MicrositeHeader extends SvelteElement {
|
|
12738
12728
|
constructor(options) {
|
|
12739
12729
|
super();
|
|
12740
|
-
this.shadowRoot.innerHTML = `<style>:host{box-sizing:border-box;font-family:var(--goa-font-family-sans)}a{color:var(--goa-color-interactive-default);cursor:pointer}a:hover{color:var(--goa-color-interactive-hover)}a:focus{outline-width:thin;outline-style:solid;outline-color:var(--goa-color-interactive-hover);outline-offset:0px}.goa-official-site-header{display:flex;font-size:var(--goa-font-size-2);background-color:var(--goa-color-greyscale-100);align-items:center;justify-content:space-between;padding:0.25rem 1.5rem}@media(max-width: 640px){.goa-official-site-header{padding:0.5rem 1rem;align-items:start}}.spacer{flex:1 1 auto}.version{color:var(--goa-color-text-secondary);padding-left:1rem;line-height:1.25rem}.service-type{font-weight:bold;padding:0.125rem 0.25rem;display:flex;margin-right:1rem;line-height:initial}.service-type--alpha{background-color:var(--goa-color-warning-default);color:var(--goa-color-text-default)}.service-type--beta{background-color:var(--goa-color-brand-default);color:var(--goa-color-text-light)}.
|
|
12730
|
+
this.shadowRoot.innerHTML = `<style>:host{box-sizing:border-box;font-family:var(--goa-font-family-sans)}a{color:var(--goa-color-interactive-default);cursor:pointer}a:hover{color:var(--goa-color-interactive-hover)}a:focus{outline-width:thin;outline-style:solid;outline-color:var(--goa-color-interactive-hover);outline-offset:0px}.goa-official-site-header{display:flex;font-size:var(--goa-font-size-2);background-color:var(--goa-color-greyscale-100);align-items:center;justify-content:space-between;padding:0.25rem 1.5rem}@media(max-width: 640px){.goa-official-site-header{padding:0.5rem 1rem;align-items:start}}.spacer{flex:1 1 auto}.version{color:var(--goa-color-text-secondary);padding-left:1rem;line-height:1.25rem}.service-type{font-weight:bold;padding:0.125rem 0.25rem;display:flex;margin-right:1rem;line-height:initial}.service-type--alpha{background-color:var(--goa-color-warning-default);color:var(--goa-color-text-default)}.service-type--beta{background-color:var(--goa-color-brand-default);color:var(--goa-color-text-light)}.site-text{color:var(--goa-color-text-default);line-height:1.25rem}</style>`;
|
|
12741
12731
|
init(this, {
|
|
12742
12732
|
target: this.shadowRoot,
|
|
12743
12733
|
props: attribute_to_object(this.attributes),
|
|
@@ -14597,11 +14587,11 @@
|
|
|
14597
14587
|
ctx[1]);
|
|
14598
14588
|
set_style(section, "padding",
|
|
14599
14589
|
/*paddedContent*/
|
|
14600
|
-
ctx[
|
|
14590
|
+
ctx[9] ? 'var(--goa-space-m)' : '0');
|
|
14601
14591
|
attr(div1, "class", "popover-container");
|
|
14602
14592
|
set_custom_element_data(goa_focus_trap, "active",
|
|
14603
14593
|
/*_isContentVisible*/
|
|
14604
|
-
ctx[
|
|
14594
|
+
ctx[6]);
|
|
14605
14595
|
},
|
|
14606
14596
|
|
|
14607
14597
|
m(target, anchor) {
|
|
@@ -14611,11 +14601,14 @@
|
|
|
14611
14601
|
append(goa_focus_trap, div1);
|
|
14612
14602
|
append(div1, section);
|
|
14613
14603
|
append(section, slot);
|
|
14604
|
+
/*section_binding*/
|
|
14605
|
+
|
|
14606
|
+
ctx[14](section);
|
|
14614
14607
|
|
|
14615
14608
|
if (!mounted) {
|
|
14616
14609
|
dispose = listen(div0, "click",
|
|
14617
14610
|
/*closePopover*/
|
|
14618
|
-
ctx[
|
|
14611
|
+
ctx[11]);
|
|
14619
14612
|
mounted = true;
|
|
14620
14613
|
}
|
|
14621
14614
|
},
|
|
@@ -14631,23 +14624,26 @@
|
|
|
14631
14624
|
|
|
14632
14625
|
if (dirty &
|
|
14633
14626
|
/*paddedContent*/
|
|
14634
|
-
|
|
14627
|
+
512) {
|
|
14635
14628
|
set_style(section, "padding",
|
|
14636
14629
|
/*paddedContent*/
|
|
14637
|
-
ctx[
|
|
14630
|
+
ctx[9] ? 'var(--goa-space-m)' : '0');
|
|
14638
14631
|
}
|
|
14639
14632
|
|
|
14640
14633
|
if (dirty &
|
|
14641
14634
|
/*_isContentVisible*/
|
|
14642
|
-
|
|
14635
|
+
64) {
|
|
14643
14636
|
set_custom_element_data(goa_focus_trap, "active",
|
|
14644
14637
|
/*_isContentVisible*/
|
|
14645
|
-
ctx[
|
|
14638
|
+
ctx[6]);
|
|
14646
14639
|
}
|
|
14647
14640
|
},
|
|
14648
14641
|
|
|
14649
14642
|
d(detaching) {
|
|
14650
14643
|
if (detaching) detach(goa_focus_trap);
|
|
14644
|
+
/*section_binding*/
|
|
14645
|
+
|
|
14646
|
+
ctx[14](null);
|
|
14651
14647
|
mounted = false;
|
|
14652
14648
|
dispose();
|
|
14653
14649
|
}
|
|
@@ -14659,11 +14655,12 @@
|
|
|
14659
14655
|
let div1;
|
|
14660
14656
|
let div0;
|
|
14661
14657
|
let t;
|
|
14658
|
+
let div1_style_value;
|
|
14662
14659
|
let mounted;
|
|
14663
14660
|
let dispose;
|
|
14664
14661
|
let if_block =
|
|
14665
14662
|
/*_isContentVisible*/
|
|
14666
|
-
ctx[
|
|
14663
|
+
ctx[6] && create_if_block$7(ctx);
|
|
14667
14664
|
return {
|
|
14668
14665
|
c() {
|
|
14669
14666
|
div1 = element("div");
|
|
@@ -14678,6 +14675,15 @@
|
|
|
14678
14675
|
attr(div1, "data-testid",
|
|
14679
14676
|
/*testid*/
|
|
14680
14677
|
ctx[0]);
|
|
14678
|
+
attr(div1, "style", div1_style_value = calculateMargin(
|
|
14679
|
+
/*mt*/
|
|
14680
|
+
ctx[2],
|
|
14681
|
+
/*mr*/
|
|
14682
|
+
ctx[3],
|
|
14683
|
+
/*mb*/
|
|
14684
|
+
ctx[4],
|
|
14685
|
+
/*ml*/
|
|
14686
|
+
ctx[5]));
|
|
14681
14687
|
},
|
|
14682
14688
|
|
|
14683
14689
|
m(target, anchor) {
|
|
@@ -14685,14 +14691,14 @@
|
|
|
14685
14691
|
append(div1, div0);
|
|
14686
14692
|
/*div0_binding*/
|
|
14687
14693
|
|
|
14688
|
-
ctx[
|
|
14694
|
+
ctx[13](div0);
|
|
14689
14695
|
append(div1, t);
|
|
14690
14696
|
if (if_block) if_block.m(div1, null);
|
|
14691
14697
|
|
|
14692
14698
|
if (!mounted) {
|
|
14693
14699
|
dispose = listen(div0, "click",
|
|
14694
14700
|
/*showPopover*/
|
|
14695
|
-
ctx[
|
|
14701
|
+
ctx[10]);
|
|
14696
14702
|
mounted = true;
|
|
14697
14703
|
}
|
|
14698
14704
|
},
|
|
@@ -14700,7 +14706,7 @@
|
|
|
14700
14706
|
p(ctx, [dirty]) {
|
|
14701
14707
|
if (
|
|
14702
14708
|
/*_isContentVisible*/
|
|
14703
|
-
ctx[
|
|
14709
|
+
ctx[6]) {
|
|
14704
14710
|
if (if_block) {
|
|
14705
14711
|
if_block.p(ctx, dirty);
|
|
14706
14712
|
} else {
|
|
@@ -14720,6 +14726,20 @@
|
|
|
14720
14726
|
/*testid*/
|
|
14721
14727
|
ctx[0]);
|
|
14722
14728
|
}
|
|
14729
|
+
|
|
14730
|
+
if (dirty &
|
|
14731
|
+
/*mt, mr, mb, ml*/
|
|
14732
|
+
60 && div1_style_value !== (div1_style_value = calculateMargin(
|
|
14733
|
+
/*mt*/
|
|
14734
|
+
ctx[2],
|
|
14735
|
+
/*mr*/
|
|
14736
|
+
ctx[3],
|
|
14737
|
+
/*mb*/
|
|
14738
|
+
ctx[4],
|
|
14739
|
+
/*ml*/
|
|
14740
|
+
ctx[5]))) {
|
|
14741
|
+
attr(div1, "style", div1_style_value);
|
|
14742
|
+
}
|
|
14723
14743
|
},
|
|
14724
14744
|
|
|
14725
14745
|
i: noop,
|
|
@@ -14729,7 +14749,7 @@
|
|
|
14729
14749
|
if (detaching) detach(div1);
|
|
14730
14750
|
/*div0_binding*/
|
|
14731
14751
|
|
|
14732
|
-
ctx[
|
|
14752
|
+
ctx[13](null);
|
|
14733
14753
|
if (if_block) if_block.d();
|
|
14734
14754
|
mounted = false;
|
|
14735
14755
|
dispose();
|
|
@@ -14738,7 +14758,33 @@
|
|
|
14738
14758
|
};
|
|
14739
14759
|
}
|
|
14740
14760
|
|
|
14761
|
+
function getBoundingClientRectWithMargins(el) {
|
|
14762
|
+
const rect = el.getBoundingClientRect();
|
|
14763
|
+
const style = window.getComputedStyle(el);
|
|
14764
|
+
const mTop = parseInt(style.marginTop, 10) || 0;
|
|
14765
|
+
const mRight = parseInt(style.marginRight, 10) || 0;
|
|
14766
|
+
const mBottom = parseInt(style.marginBottom, 10) || 0;
|
|
14767
|
+
const mLeft = parseInt(style.marginLeft, 10) || 0;
|
|
14768
|
+
return {
|
|
14769
|
+
top: rect.top - mTop,
|
|
14770
|
+
right: rect.right + mRight,
|
|
14771
|
+
bottom: rect.bottom + mBottom,
|
|
14772
|
+
left: rect.left - mLeft,
|
|
14773
|
+
width: rect.width + mLeft + mRight,
|
|
14774
|
+
height: rect.height + mTop + mBottom,
|
|
14775
|
+
x: rect.x - mLeft,
|
|
14776
|
+
y: rect.y - mTop
|
|
14777
|
+
};
|
|
14778
|
+
}
|
|
14779
|
+
|
|
14741
14780
|
function instance$f($$self, $$props, $$invalidate) {
|
|
14781
|
+
const showPopover = _async(function () {
|
|
14782
|
+
$$invalidate(6, _isContentVisible = true);
|
|
14783
|
+
return _call(tick, function () {
|
|
14784
|
+
setPopoverPosition();
|
|
14785
|
+
});
|
|
14786
|
+
});
|
|
14787
|
+
|
|
14742
14788
|
let paddedContent;
|
|
14743
14789
|
let {
|
|
14744
14790
|
testid = ""
|
|
@@ -14753,6 +14799,20 @@
|
|
|
14753
14799
|
|
|
14754
14800
|
let _targetEl;
|
|
14755
14801
|
|
|
14802
|
+
let _popoverEl;
|
|
14803
|
+
|
|
14804
|
+
let {
|
|
14805
|
+
mt = null
|
|
14806
|
+
} = $$props;
|
|
14807
|
+
let {
|
|
14808
|
+
mr = null
|
|
14809
|
+
} = $$props;
|
|
14810
|
+
let {
|
|
14811
|
+
mb = null
|
|
14812
|
+
} = $$props;
|
|
14813
|
+
let {
|
|
14814
|
+
ml = null
|
|
14815
|
+
} = $$props;
|
|
14756
14816
|
onMount(function () {
|
|
14757
14817
|
return _call(tick, function () {
|
|
14758
14818
|
addFocusEventListener();
|
|
@@ -14762,12 +14822,8 @@
|
|
|
14762
14822
|
removeEventListeners();
|
|
14763
14823
|
});
|
|
14764
14824
|
|
|
14765
|
-
function showPopover() {
|
|
14766
|
-
$$invalidate(2, _isContentVisible = true);
|
|
14767
|
-
}
|
|
14768
|
-
|
|
14769
14825
|
function closePopover() {
|
|
14770
|
-
$$invalidate(
|
|
14826
|
+
$$invalidate(6, _isContentVisible = false);
|
|
14771
14827
|
}
|
|
14772
14828
|
|
|
14773
14829
|
const onInputKeyDown = e => {
|
|
@@ -14785,6 +14841,30 @@
|
|
|
14785
14841
|
}
|
|
14786
14842
|
};
|
|
14787
14843
|
|
|
14844
|
+
function setPopoverPosition() {
|
|
14845
|
+
// Get target and content rectangles
|
|
14846
|
+
const targetRect = getBoundingClientRectWithMargins(_targetEl);
|
|
14847
|
+
const contentRect = getBoundingClientRectWithMargins(_popoverEl); // Calculate available space above and below the target element
|
|
14848
|
+
|
|
14849
|
+
const spaceAbove = targetRect.top;
|
|
14850
|
+
const spaceBelow = window.innerHeight - targetRect.bottom; // Determine if there's more space above or below the target element
|
|
14851
|
+
|
|
14852
|
+
const displayAbove = spaceAbove > contentRect.height && spaceAbove > spaceBelow && spaceBelow < contentRect.height; // If there's more space above, display the popover above the target element
|
|
14853
|
+
|
|
14854
|
+
if (displayAbove) {
|
|
14855
|
+
$$invalidate(8, _popoverEl.style.top = `${-contentRect.height - targetRect.height - 4}px`, _popoverEl);
|
|
14856
|
+
} else {
|
|
14857
|
+
$$invalidate(8, _popoverEl.style.top = '0px', _popoverEl);
|
|
14858
|
+
} // Move the popover to the left if it is too far to the right and only if there is space to the left
|
|
14859
|
+
|
|
14860
|
+
|
|
14861
|
+
if (window.innerWidth - targetRect.right < contentRect.width && targetRect.left > contentRect.width) {
|
|
14862
|
+
$$invalidate(8, _popoverEl.style.left = `-${contentRect.width - targetRect.width}px`, _popoverEl);
|
|
14863
|
+
} else {
|
|
14864
|
+
$$invalidate(8, _popoverEl.style.left = '0px', _popoverEl);
|
|
14865
|
+
}
|
|
14866
|
+
}
|
|
14867
|
+
|
|
14788
14868
|
function addFocusEventListener() {
|
|
14789
14869
|
_targetEl.addEventListener("focus", onFocus, true);
|
|
14790
14870
|
}
|
|
@@ -14803,31 +14883,42 @@
|
|
|
14803
14883
|
function div0_binding($$value) {
|
|
14804
14884
|
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
|
14805
14885
|
_targetEl = $$value;
|
|
14806
|
-
$$invalidate(
|
|
14886
|
+
$$invalidate(7, _targetEl);
|
|
14887
|
+
});
|
|
14888
|
+
}
|
|
14889
|
+
|
|
14890
|
+
function section_binding($$value) {
|
|
14891
|
+
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
|
14892
|
+
_popoverEl = $$value;
|
|
14893
|
+
$$invalidate(8, _popoverEl);
|
|
14807
14894
|
});
|
|
14808
14895
|
}
|
|
14809
14896
|
|
|
14810
14897
|
$$self.$$set = $$props => {
|
|
14811
14898
|
if ('testid' in $$props) $$invalidate(0, testid = $$props.testid);
|
|
14812
14899
|
if ('maxwidth' in $$props) $$invalidate(1, maxwidth = $$props.maxwidth);
|
|
14813
|
-
if ('padded' in $$props) $$invalidate(
|
|
14900
|
+
if ('padded' in $$props) $$invalidate(12, padded = $$props.padded);
|
|
14901
|
+
if ('mt' in $$props) $$invalidate(2, mt = $$props.mt);
|
|
14902
|
+
if ('mr' in $$props) $$invalidate(3, mr = $$props.mr);
|
|
14903
|
+
if ('mb' in $$props) $$invalidate(4, mb = $$props.mb);
|
|
14904
|
+
if ('ml' in $$props) $$invalidate(5, ml = $$props.ml);
|
|
14814
14905
|
};
|
|
14815
14906
|
|
|
14816
14907
|
$$self.$$.update = () => {
|
|
14817
14908
|
if ($$self.$$.dirty &
|
|
14818
14909
|
/*padded*/
|
|
14819
|
-
|
|
14820
|
-
$$invalidate(
|
|
14910
|
+
4096) {
|
|
14911
|
+
$$invalidate(9, paddedContent = toBoolean(padded));
|
|
14821
14912
|
}
|
|
14822
14913
|
};
|
|
14823
14914
|
|
|
14824
|
-
return [testid, maxwidth, _isContentVisible, _targetEl, paddedContent, showPopover, closePopover, padded, div0_binding];
|
|
14915
|
+
return [testid, maxwidth, mt, mr, mb, ml, _isContentVisible, _targetEl, _popoverEl, paddedContent, showPopover, closePopover, padded, div0_binding, section_binding];
|
|
14825
14916
|
}
|
|
14826
14917
|
|
|
14827
14918
|
class Popover extends SvelteElement {
|
|
14828
14919
|
constructor(options) {
|
|
14829
14920
|
super();
|
|
14830
|
-
this.shadowRoot.innerHTML = `<style>:host{box-sizing:border-box;font-family:var(--goa-font-family-sans);font-size:var(--goa-font-size-4)}.popover-target{width:fit-content;cursor:pointer}.popover-target:focus{outline:var(--goa-border-width-l) solid var(--goa-color-interactive-focus)}.popover-content{position:absolute;left:0;right:0;margin-top:3px;list-style-type:none;background:var(--goa-color-greyscale-white);
|
|
14921
|
+
this.shadowRoot.innerHTML = `<style>:host{box-sizing:border-box;font-family:var(--goa-font-family-sans);font-size:var(--goa-font-size-4)}.popover-target{width:fit-content;cursor:pointer}.popover-target:focus{outline:var(--goa-border-width-l) solid var(--goa-color-interactive-focus)}.popover-content{position:absolute;left:0;right:0;margin-top:3px;list-style-type:none;background:var(--goa-color-greyscale-white);outline:none;filter:drop-shadow(0px 2px 4px rgba(0, 0, 0, 0.2));z-index:99;width:max-content}.popover-background{cursor:default;position:fixed;z-index:98;inset:0}.popover-container{position:relative}</style>`;
|
|
14831
14922
|
init(this, {
|
|
14832
14923
|
target: this.shadowRoot,
|
|
14833
14924
|
props: attribute_to_object(this.attributes),
|
|
@@ -14835,7 +14926,11 @@
|
|
|
14835
14926
|
}, instance$f, create_fragment$h, safe_not_equal, {
|
|
14836
14927
|
testid: 0,
|
|
14837
14928
|
maxwidth: 1,
|
|
14838
|
-
padded:
|
|
14929
|
+
padded: 12,
|
|
14930
|
+
mt: 2,
|
|
14931
|
+
mr: 3,
|
|
14932
|
+
mb: 4,
|
|
14933
|
+
ml: 5
|
|
14839
14934
|
}, null);
|
|
14840
14935
|
|
|
14841
14936
|
if (options) {
|
|
@@ -14851,7 +14946,7 @@
|
|
|
14851
14946
|
}
|
|
14852
14947
|
|
|
14853
14948
|
static get observedAttributes() {
|
|
14854
|
-
return ["testid", "maxwidth", "padded"];
|
|
14949
|
+
return ["testid", "maxwidth", "padded", "mt", "mr", "mb", "ml"];
|
|
14855
14950
|
}
|
|
14856
14951
|
|
|
14857
14952
|
get testid() {
|
|
@@ -14877,7 +14972,7 @@
|
|
|
14877
14972
|
}
|
|
14878
14973
|
|
|
14879
14974
|
get padded() {
|
|
14880
|
-
return this.$$.ctx[
|
|
14975
|
+
return this.$$.ctx[12];
|
|
14881
14976
|
}
|
|
14882
14977
|
|
|
14883
14978
|
set padded(padded) {
|
|
@@ -14887,6 +14982,50 @@
|
|
|
14887
14982
|
flush();
|
|
14888
14983
|
}
|
|
14889
14984
|
|
|
14985
|
+
get mt() {
|
|
14986
|
+
return this.$$.ctx[2];
|
|
14987
|
+
}
|
|
14988
|
+
|
|
14989
|
+
set mt(mt) {
|
|
14990
|
+
this.$$set({
|
|
14991
|
+
mt
|
|
14992
|
+
});
|
|
14993
|
+
flush();
|
|
14994
|
+
}
|
|
14995
|
+
|
|
14996
|
+
get mr() {
|
|
14997
|
+
return this.$$.ctx[3];
|
|
14998
|
+
}
|
|
14999
|
+
|
|
15000
|
+
set mr(mr) {
|
|
15001
|
+
this.$$set({
|
|
15002
|
+
mr
|
|
15003
|
+
});
|
|
15004
|
+
flush();
|
|
15005
|
+
}
|
|
15006
|
+
|
|
15007
|
+
get mb() {
|
|
15008
|
+
return this.$$.ctx[4];
|
|
15009
|
+
}
|
|
15010
|
+
|
|
15011
|
+
set mb(mb) {
|
|
15012
|
+
this.$$set({
|
|
15013
|
+
mb
|
|
15014
|
+
});
|
|
15015
|
+
flush();
|
|
15016
|
+
}
|
|
15017
|
+
|
|
15018
|
+
get ml() {
|
|
15019
|
+
return this.$$.ctx[5];
|
|
15020
|
+
}
|
|
15021
|
+
|
|
15022
|
+
set ml(ml) {
|
|
15023
|
+
this.$$set({
|
|
15024
|
+
ml
|
|
15025
|
+
});
|
|
15026
|
+
flush();
|
|
15027
|
+
}
|
|
15028
|
+
|
|
14890
15029
|
}
|
|
14891
15030
|
|
|
14892
15031
|
customElements.define("goa-popover", Popover);
|
|
@@ -22906,11 +23045,19 @@
|
|
|
22906
23045
|
testId = _a.testId,
|
|
22907
23046
|
maxWidth = _a.maxWidth,
|
|
22908
23047
|
padded = _a.padded,
|
|
22909
|
-
children = _a.children
|
|
23048
|
+
children = _a.children,
|
|
23049
|
+
mt = _a.mt,
|
|
23050
|
+
mr = _a.mr,
|
|
23051
|
+
mb = _a.mb,
|
|
23052
|
+
ml = _a.ml;
|
|
22910
23053
|
return jsxRuntime.jsxs("goa-popover", __assign({
|
|
22911
23054
|
"data-testid": testId,
|
|
22912
23055
|
maxwidth: maxWidth,
|
|
22913
|
-
padded: padded
|
|
23056
|
+
padded: padded,
|
|
23057
|
+
mt: mt,
|
|
23058
|
+
mr: mr,
|
|
23059
|
+
mb: mb,
|
|
23060
|
+
ml: ml
|
|
22914
23061
|
}, {
|
|
22915
23062
|
children: [children, target && jsxRuntime.jsx("div", __assign({
|
|
22916
23063
|
slot: "target"
|