@abgov/react-components 4.0.0-alpha.98 → 4.0.0-alpha.99
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/input/input.d.ts +2 -0
- package/package.json +1 -1
- package/react-components.esm.js +80 -46
- package/react-components.umd.js +80 -46
package/lib/input/input.d.ts
CHANGED
|
@@ -54,6 +54,8 @@ interface BaseProps extends Margins {
|
|
|
54
54
|
suffix?: string;
|
|
55
55
|
testId?: string;
|
|
56
56
|
ariaLabel?: string;
|
|
57
|
+
leadingContent?: React.ReactNode;
|
|
58
|
+
trailingContent?: React.ReactNode;
|
|
57
59
|
}
|
|
58
60
|
declare type OnChange = (name: string, value: string) => void;
|
|
59
61
|
export interface InputProps extends BaseProps {
|
package/package.json
CHANGED
package/react-components.esm.js
CHANGED
|
@@ -10357,7 +10357,7 @@ function create_if_block_4$1(ctx) {
|
|
|
10357
10357
|
}
|
|
10358
10358
|
|
|
10359
10359
|
};
|
|
10360
|
-
} // (
|
|
10360
|
+
} // (95:4) {#if leadingicon}
|
|
10361
10361
|
|
|
10362
10362
|
|
|
10363
10363
|
function create_if_block_3$2(ctx) {
|
|
@@ -10391,7 +10391,7 @@ function create_if_block_3$2(ctx) {
|
|
|
10391
10391
|
}
|
|
10392
10392
|
|
|
10393
10393
|
};
|
|
10394
|
-
} // (
|
|
10394
|
+
} // (125:4) {#if trailingicon && !handlesTrailingIconClick}
|
|
10395
10395
|
|
|
10396
10396
|
|
|
10397
10397
|
function create_if_block_2$3(ctx) {
|
|
@@ -10426,7 +10426,7 @@ function create_if_block_2$3(ctx) {
|
|
|
10426
10426
|
}
|
|
10427
10427
|
|
|
10428
10428
|
};
|
|
10429
|
-
} // (
|
|
10429
|
+
} // (135:4) {#if trailingicon && handlesTrailingIconClick}
|
|
10430
10430
|
|
|
10431
10431
|
|
|
10432
10432
|
function create_if_block_1$3(ctx) {
|
|
@@ -10481,7 +10481,7 @@ function create_if_block_1$3(ctx) {
|
|
|
10481
10481
|
}
|
|
10482
10482
|
|
|
10483
10483
|
};
|
|
10484
|
-
} // (
|
|
10484
|
+
} // (147:4) {#if suffix}
|
|
10485
10485
|
|
|
10486
10486
|
|
|
10487
10487
|
function create_if_block$5(ctx) {
|
|
@@ -10517,19 +10517,23 @@ function create_if_block$5(ctx) {
|
|
|
10517
10517
|
}
|
|
10518
10518
|
|
|
10519
10519
|
function create_fragment$e(ctx) {
|
|
10520
|
-
let
|
|
10521
|
-
let
|
|
10520
|
+
let div3;
|
|
10521
|
+
let div2;
|
|
10522
10522
|
let t0;
|
|
10523
|
+
let div0;
|
|
10523
10524
|
let t1;
|
|
10525
|
+
let t2;
|
|
10524
10526
|
let input;
|
|
10525
10527
|
let input_class_value;
|
|
10526
10528
|
let input_style_value;
|
|
10527
10529
|
let input_aria_label_value;
|
|
10528
|
-
let t2;
|
|
10529
10530
|
let t3;
|
|
10530
10531
|
let t4;
|
|
10531
|
-
let
|
|
10532
|
-
let
|
|
10532
|
+
let t5;
|
|
10533
|
+
let t6;
|
|
10534
|
+
let div1;
|
|
10535
|
+
let div2_class_value;
|
|
10536
|
+
let div3_style_value;
|
|
10533
10537
|
let mounted;
|
|
10534
10538
|
let dispose;
|
|
10535
10539
|
let if_block0 =
|
|
@@ -10553,20 +10557,27 @@ function create_fragment$e(ctx) {
|
|
|
10553
10557
|
ctx[15] && create_if_block$5(ctx);
|
|
10554
10558
|
return {
|
|
10555
10559
|
c() {
|
|
10556
|
-
|
|
10557
|
-
|
|
10560
|
+
div3 = element("div");
|
|
10561
|
+
div2 = element("div");
|
|
10558
10562
|
if (if_block0) if_block0.c();
|
|
10559
10563
|
t0 = space();
|
|
10560
|
-
|
|
10564
|
+
div0 = element("div");
|
|
10565
|
+
div0.innerHTML = `<slot name="leadingContent"></slot>`;
|
|
10561
10566
|
t1 = space();
|
|
10562
|
-
|
|
10567
|
+
if (if_block1) if_block1.c();
|
|
10563
10568
|
t2 = space();
|
|
10564
|
-
|
|
10569
|
+
input = element("input");
|
|
10565
10570
|
t3 = space();
|
|
10566
|
-
if (
|
|
10571
|
+
if (if_block2) if_block2.c();
|
|
10567
10572
|
t4 = space();
|
|
10573
|
+
if (if_block3) if_block3.c();
|
|
10574
|
+
t5 = space();
|
|
10568
10575
|
if (if_block4) if_block4.c();
|
|
10576
|
+
t6 = space();
|
|
10577
|
+
div1 = element("div");
|
|
10578
|
+
div1.innerHTML = `<slot name="trailingContent"></slot>`;
|
|
10569
10579
|
this.c = noop;
|
|
10580
|
+
attr(div0, "class", "leading-content");
|
|
10570
10581
|
attr(input, "class", input_class_value = `input--${
|
|
10571
10582
|
/*variant*/
|
|
10572
10583
|
ctx[7]}`);
|
|
@@ -10612,7 +10623,8 @@ function create_fragment$e(ctx) {
|
|
|
10612
10623
|
ctx[10] ||
|
|
10613
10624
|
/*name*/
|
|
10614
10625
|
ctx[2]);
|
|
10615
|
-
attr(
|
|
10626
|
+
attr(div1, "class", "trailing-content");
|
|
10627
|
+
attr(div2, "class", div2_class_value = `
|
|
10616
10628
|
goa-input
|
|
10617
10629
|
${
|
|
10618
10630
|
/*isDisabled*/
|
|
@@ -10624,11 +10636,11 @@ function create_fragment$e(ctx) {
|
|
|
10624
10636
|
/*type*/
|
|
10625
10637
|
ctx[1]}
|
|
10626
10638
|
`);
|
|
10627
|
-
toggle_class(
|
|
10639
|
+
toggle_class(div2, "error",
|
|
10628
10640
|
/*isError*/
|
|
10629
10641
|
ctx[22]);
|
|
10630
|
-
attr(
|
|
10631
|
-
attr(
|
|
10642
|
+
attr(div3, "class", "container");
|
|
10643
|
+
attr(div3, "style", div3_style_value = `
|
|
10632
10644
|
${calculateMargin(
|
|
10633
10645
|
/*mt*/
|
|
10634
10646
|
ctx[16],
|
|
@@ -10645,22 +10657,26 @@ function create_fragment$e(ctx) {
|
|
|
10645
10657
|
},
|
|
10646
10658
|
|
|
10647
10659
|
m(target, anchor) {
|
|
10648
|
-
insert(target,
|
|
10649
|
-
append(
|
|
10650
|
-
if (if_block0) if_block0.m(
|
|
10651
|
-
append(
|
|
10652
|
-
|
|
10653
|
-
append(
|
|
10654
|
-
|
|
10660
|
+
insert(target, div3, anchor);
|
|
10661
|
+
append(div3, div2);
|
|
10662
|
+
if (if_block0) if_block0.m(div2, null);
|
|
10663
|
+
append(div2, t0);
|
|
10664
|
+
append(div2, div0);
|
|
10665
|
+
append(div2, t1);
|
|
10666
|
+
if (if_block1) if_block1.m(div2, null);
|
|
10667
|
+
append(div2, t2);
|
|
10668
|
+
append(div2, input);
|
|
10655
10669
|
/*input_binding*/
|
|
10656
10670
|
|
|
10657
10671
|
ctx[32](input);
|
|
10658
|
-
append(
|
|
10659
|
-
if (if_block2) if_block2.m(
|
|
10660
|
-
append(
|
|
10661
|
-
if (if_block3) if_block3.m(
|
|
10662
|
-
append(
|
|
10663
|
-
if (if_block4) if_block4.m(
|
|
10672
|
+
append(div2, t3);
|
|
10673
|
+
if (if_block2) if_block2.m(div2, null);
|
|
10674
|
+
append(div2, t4);
|
|
10675
|
+
if (if_block3) if_block3.m(div2, null);
|
|
10676
|
+
append(div2, t5);
|
|
10677
|
+
if (if_block4) if_block4.m(div2, null);
|
|
10678
|
+
append(div2, t6);
|
|
10679
|
+
append(div2, div1);
|
|
10664
10680
|
|
|
10665
10681
|
if (!mounted) {
|
|
10666
10682
|
dispose = [listen(input, "keyup",
|
|
@@ -10681,7 +10697,7 @@ function create_fragment$e(ctx) {
|
|
|
10681
10697
|
} else {
|
|
10682
10698
|
if_block0 = create_if_block_4$1(ctx);
|
|
10683
10699
|
if_block0.c();
|
|
10684
|
-
if_block0.m(
|
|
10700
|
+
if_block0.m(div2, t0);
|
|
10685
10701
|
}
|
|
10686
10702
|
} else if (if_block0) {
|
|
10687
10703
|
if_block0.d(1);
|
|
@@ -10696,7 +10712,7 @@ function create_fragment$e(ctx) {
|
|
|
10696
10712
|
} else {
|
|
10697
10713
|
if_block1 = create_if_block_3$2(ctx);
|
|
10698
10714
|
if_block1.c();
|
|
10699
|
-
if_block1.m(
|
|
10715
|
+
if_block1.m(div2, t2);
|
|
10700
10716
|
}
|
|
10701
10717
|
} else if (if_block1) {
|
|
10702
10718
|
if_block1.d(1);
|
|
@@ -10829,7 +10845,7 @@ function create_fragment$e(ctx) {
|
|
|
10829
10845
|
} else {
|
|
10830
10846
|
if_block2 = create_if_block_2$3(ctx);
|
|
10831
10847
|
if_block2.c();
|
|
10832
|
-
if_block2.m(
|
|
10848
|
+
if_block2.m(div2, t4);
|
|
10833
10849
|
}
|
|
10834
10850
|
} else if (if_block2) {
|
|
10835
10851
|
if_block2.d(1);
|
|
@@ -10846,7 +10862,7 @@ function create_fragment$e(ctx) {
|
|
|
10846
10862
|
} else {
|
|
10847
10863
|
if_block3 = create_if_block_1$3(ctx);
|
|
10848
10864
|
if_block3.c();
|
|
10849
|
-
if_block3.m(
|
|
10865
|
+
if_block3.m(div2, t5);
|
|
10850
10866
|
}
|
|
10851
10867
|
} else if (if_block3) {
|
|
10852
10868
|
if_block3.d(1);
|
|
@@ -10861,7 +10877,7 @@ function create_fragment$e(ctx) {
|
|
|
10861
10877
|
} else {
|
|
10862
10878
|
if_block4 = create_if_block$5(ctx);
|
|
10863
10879
|
if_block4.c();
|
|
10864
|
-
if_block4.m(
|
|
10880
|
+
if_block4.m(div2, t6);
|
|
10865
10881
|
}
|
|
10866
10882
|
} else if (if_block4) {
|
|
10867
10883
|
if_block4.d(1);
|
|
@@ -10870,7 +10886,7 @@ function create_fragment$e(ctx) {
|
|
|
10870
10886
|
|
|
10871
10887
|
if (dirty[0] &
|
|
10872
10888
|
/*isDisabled, variant, type*/
|
|
10873
|
-
2097282 &&
|
|
10889
|
+
2097282 && div2_class_value !== (div2_class_value = `
|
|
10874
10890
|
goa-input
|
|
10875
10891
|
${
|
|
10876
10892
|
/*isDisabled*/
|
|
@@ -10882,20 +10898,20 @@ function create_fragment$e(ctx) {
|
|
|
10882
10898
|
/*type*/
|
|
10883
10899
|
ctx[1]}
|
|
10884
10900
|
`)) {
|
|
10885
|
-
attr(
|
|
10901
|
+
attr(div2, "class", div2_class_value);
|
|
10886
10902
|
}
|
|
10887
10903
|
|
|
10888
10904
|
if (dirty[0] &
|
|
10889
10905
|
/*isDisabled, variant, type, isError*/
|
|
10890
10906
|
6291586) {
|
|
10891
|
-
toggle_class(
|
|
10907
|
+
toggle_class(div2, "error",
|
|
10892
10908
|
/*isError*/
|
|
10893
10909
|
ctx[22]);
|
|
10894
10910
|
}
|
|
10895
10911
|
|
|
10896
10912
|
if (dirty[0] &
|
|
10897
10913
|
/*mt, mr, mb, ml, width*/
|
|
10898
|
-
983552 &&
|
|
10914
|
+
983552 && div3_style_value !== (div3_style_value = `
|
|
10899
10915
|
${calculateMargin(
|
|
10900
10916
|
/*mt*/
|
|
10901
10917
|
ctx[16],
|
|
@@ -10909,7 +10925,7 @@ function create_fragment$e(ctx) {
|
|
|
10909
10925
|
/*width*/
|
|
10910
10926
|
ctx[9]};
|
|
10911
10927
|
`)) {
|
|
10912
|
-
attr(
|
|
10928
|
+
attr(div3, "style", div3_style_value);
|
|
10913
10929
|
}
|
|
10914
10930
|
},
|
|
10915
10931
|
|
|
@@ -10917,7 +10933,7 @@ function create_fragment$e(ctx) {
|
|
|
10917
10933
|
o: noop,
|
|
10918
10934
|
|
|
10919
10935
|
d(detaching) {
|
|
10920
|
-
if (detaching) detach(
|
|
10936
|
+
if (detaching) detach(div3);
|
|
10921
10937
|
if (if_block0) if_block0.d();
|
|
10922
10938
|
if (if_block1) if_block1.d();
|
|
10923
10939
|
/*input_binding*/
|
|
@@ -11036,6 +11052,12 @@ function instance$c($$self, $$props, $$invalidate) {
|
|
|
11036
11052
|
$$invalidate(0, value = ee.value);
|
|
11037
11053
|
}
|
|
11038
11054
|
|
|
11055
|
+
onMount(() => {
|
|
11056
|
+
if (prefix != "" || suffix != "") {
|
|
11057
|
+
console.warn("GoAInput [prefix] and [suffix] properties are deprecated. Instead use leadingContent and trailingContent.");
|
|
11058
|
+
}
|
|
11059
|
+
});
|
|
11060
|
+
|
|
11039
11061
|
function input_binding($$value) {
|
|
11040
11062
|
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
|
11041
11063
|
inputEl = $$value;
|
|
@@ -11129,7 +11151,7 @@ function instance$c($$self, $$props, $$invalidate) {
|
|
|
11129
11151
|
class Input extends SvelteElement {
|
|
11130
11152
|
constructor(options) {
|
|
11131
11153
|
super();
|
|
11132
|
-
this.shadowRoot.innerHTML = `<style>:host{box-sizing:border-box}.container{position:relative;width:100%;display:inline-block}@media(min-width: 640px){.container{width:var(--width)}}.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:var(--input-border-radius);display:inline-flex;align-items:stretch;vertical-align:middle;min-width:100%}.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.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{margin-left:0.5rem}.goa-input-trailing-icon{margin-right:0.5rem}input{display:inline-block;color:var(--goa-color-text);font-size:var(--input-font-size);padding:var(--input-padding);line-height:calc(40px - calc(var(--input-padding) * 2));background-color:transparent;width:0;flex:1 1 auto}input[type="text"],input[type="date"],input[type="time"],input[type="datetime-local"],input[type="number"]{font-family:var(--font-family)}input[readonly]{cursor:pointer}.goa-input-leading-icon+input{padding-left:0.5rem}input,input:focus,input:hover,input:active{outline:none;border:none}.goa-input--disabled,.goa-input--disabled:hover,.goa-input--disabled:active,.goa-input--disabled:focus{background-color:var(--color-gray-100);border-color:var(--color-gray-200);cursor:default;box-shadow:none}.goa-input--disabled input,.goa-input--disabled input:hover,.goa-input--disabled input:active,.goa-input--disabled input:focus{color:var(--goa-color-text-secondary)}.goa-input--disabled input:hover{cursor:default !important}.prefix,.suffix{background-color:var(--color-gray-100);padding:0 0.75rem;display:flex;align-items:center}.prefix{border-top-left-radius:var(--input-border-radius);border-bottom-left-radius:var(--input-border-radius);border-right:1px solid var(--color-gray-600)}.suffix{border-top-right-radius:var(--input-border-radius);border-bottom-right-radius:var(--input-border-radius);border-left:1px solid var(--color-gray-600)}.goa-input--disabled .prefix{border-right:1px solid var(--color-gray-200)}.goa-input--disabled .suffix{border-left:1px solid var(--color-gray-200)}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-interactive--error)}input[type="search" i]:enabled:read-write:-webkit-any(:focus, :hover)::-webkit-search-cancel-button{position:relative;right:var(--search-icon-offset);cursor:pointer;-webkit-appearance:none;height:1.2rem;width:1.2rem;background:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="%23333" d="M405 136.798L375.202 107 256 226.202 136.798 107 107 136.798 226.202 256 107 375.202 136.798 405 256 285.798 375.202 405 405 375.202 285.798 256z"/></svg>')
|
|
11154
|
+
this.shadowRoot.innerHTML = `<style>:host{box-sizing:border-box}.container{position:relative;width:100%;display:inline-block}@media(min-width: 640px){.container{width:var(--width)}}.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:var(--input-border-radius);display:inline-flex;align-items:stretch;vertical-align:middle;min-width:100%}.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.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{margin-left:0.5rem}.goa-input-trailing-icon{margin-right:0.5rem}input{display:inline-block;color:var(--goa-color-text);font-size:var(--input-font-size);padding:var(--input-padding);line-height:calc(40px - calc(var(--input-padding) * 2));background-color:transparent;width:0;flex:1 1 auto}input[type="text"],input[type="date"],input[type="time"],input[type="datetime-local"],input[type="number"]{font-family:var(--font-family)}input[readonly]{cursor:pointer}.goa-input-leading-icon+input{padding-left:0.5rem}input,input:focus,input:hover,input:active{outline:none;border:none}.goa-input--disabled,.goa-input--disabled:hover,.goa-input--disabled:active,.goa-input--disabled:focus{background-color:var(--color-gray-100);border-color:var(--color-gray-200);cursor:default;box-shadow:none}.goa-input--disabled input,.goa-input--disabled input:hover,.goa-input--disabled input:active,.goa-input--disabled input:focus{color:var(--goa-color-text-secondary)}.goa-input--disabled input:hover{cursor:default !important}.prefix,.suffix,.leading-content ::slotted(div),.trailing-content ::slotted(div){background-color:var(--color-gray-100);padding:0 0.75rem;display:flex;align-items:center}.leading-content ::slotted(div),.trailing-content ::slotted(div){padding:0.5rem 0.75rem}.prefix,.leading-content ::slotted(div){border-top-left-radius:var(--input-border-radius);border-bottom-left-radius:var(--input-border-radius);border-right:1px solid var(--color-gray-600)}.suffix,.trailing-content ::slotted(div){border-top-right-radius:var(--input-border-radius);border-bottom-right-radius:var(--input-border-radius);border-left:1px solid var(--color-gray-600)}.goa-input--disabled .prefix,.goa-input--disabled .leading-content ::slotted(div){border-right:1px solid var(--color-gray-200)}.goa-input--disabled .suffix,.goa-input--disabled .trailing-content ::slotted(div){border-left:1px solid var(--color-gray-200)}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-interactive--error)}input[type="search" i]:enabled:read-write:-webkit-any(:focus, :hover)::-webkit-search-cancel-button{position:relative;right:var(--search-icon-offset);cursor:pointer;-webkit-appearance:none;height:1.2rem;width:1.2rem;background:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="%23333" d="M405 136.798L375.202 107 256 226.202 136.798 107 107 136.798 226.202 256 107 375.202 136.798 405 256 285.798 375.202 405 405 375.202 285.798 256z"/></svg>')
|
|
11133
11155
|
center center no-repeat}</style>`;
|
|
11134
11156
|
init(this, {
|
|
11135
11157
|
target: this.shadowRoot,
|
|
@@ -16661,6 +16683,8 @@ const GoAInput = ({
|
|
|
16661
16683
|
mr,
|
|
16662
16684
|
mb,
|
|
16663
16685
|
ml,
|
|
16686
|
+
leadingContent,
|
|
16687
|
+
trailingContent,
|
|
16664
16688
|
onTrailingIconClick,
|
|
16665
16689
|
onChange
|
|
16666
16690
|
}) => {
|
|
@@ -16691,7 +16715,7 @@ const GoAInput = ({
|
|
|
16691
16715
|
current.removeEventListener("_trailingIconClick", clickListener);
|
|
16692
16716
|
};
|
|
16693
16717
|
}, [ref, onChange, onTrailingIconClick]);
|
|
16694
|
-
return
|
|
16718
|
+
return jsxs("goa-input", Object.assign({
|
|
16695
16719
|
ref: ref,
|
|
16696
16720
|
focused: focused,
|
|
16697
16721
|
type: type,
|
|
@@ -16719,7 +16743,17 @@ const GoAInput = ({
|
|
|
16719
16743
|
mb: mb,
|
|
16720
16744
|
ml: ml,
|
|
16721
16745
|
handletrailingiconclick: !!onTrailingIconClick
|
|
16722
|
-
},
|
|
16746
|
+
}, {
|
|
16747
|
+
children: [leadingContent && jsx("div", Object.assign({
|
|
16748
|
+
slot: "leadingContent"
|
|
16749
|
+
}, {
|
|
16750
|
+
children: leadingContent
|
|
16751
|
+
}), void 0), trailingContent && jsx("div", Object.assign({
|
|
16752
|
+
slot: "trailingContent"
|
|
16753
|
+
}, {
|
|
16754
|
+
children: trailingContent
|
|
16755
|
+
}), void 0)]
|
|
16756
|
+
}), void 0);
|
|
16723
16757
|
};
|
|
16724
16758
|
|
|
16725
16759
|
const onDateChangeHandler = onChange => {
|
package/react-components.umd.js
CHANGED
|
@@ -10402,7 +10402,7 @@
|
|
|
10402
10402
|
}
|
|
10403
10403
|
|
|
10404
10404
|
};
|
|
10405
|
-
} // (
|
|
10405
|
+
} // (95:4) {#if leadingicon}
|
|
10406
10406
|
|
|
10407
10407
|
|
|
10408
10408
|
function create_if_block_3$2(ctx) {
|
|
@@ -10436,7 +10436,7 @@
|
|
|
10436
10436
|
}
|
|
10437
10437
|
|
|
10438
10438
|
};
|
|
10439
|
-
} // (
|
|
10439
|
+
} // (125:4) {#if trailingicon && !handlesTrailingIconClick}
|
|
10440
10440
|
|
|
10441
10441
|
|
|
10442
10442
|
function create_if_block_2$3(ctx) {
|
|
@@ -10471,7 +10471,7 @@
|
|
|
10471
10471
|
}
|
|
10472
10472
|
|
|
10473
10473
|
};
|
|
10474
|
-
} // (
|
|
10474
|
+
} // (135:4) {#if trailingicon && handlesTrailingIconClick}
|
|
10475
10475
|
|
|
10476
10476
|
|
|
10477
10477
|
function create_if_block_1$3(ctx) {
|
|
@@ -10526,7 +10526,7 @@
|
|
|
10526
10526
|
}
|
|
10527
10527
|
|
|
10528
10528
|
};
|
|
10529
|
-
} // (
|
|
10529
|
+
} // (147:4) {#if suffix}
|
|
10530
10530
|
|
|
10531
10531
|
|
|
10532
10532
|
function create_if_block$5(ctx) {
|
|
@@ -10562,19 +10562,23 @@
|
|
|
10562
10562
|
}
|
|
10563
10563
|
|
|
10564
10564
|
function create_fragment$e(ctx) {
|
|
10565
|
-
let
|
|
10566
|
-
let
|
|
10565
|
+
let div3;
|
|
10566
|
+
let div2;
|
|
10567
10567
|
let t0;
|
|
10568
|
+
let div0;
|
|
10568
10569
|
let t1;
|
|
10570
|
+
let t2;
|
|
10569
10571
|
let input;
|
|
10570
10572
|
let input_class_value;
|
|
10571
10573
|
let input_style_value;
|
|
10572
10574
|
let input_aria_label_value;
|
|
10573
|
-
let t2;
|
|
10574
10575
|
let t3;
|
|
10575
10576
|
let t4;
|
|
10576
|
-
let
|
|
10577
|
-
let
|
|
10577
|
+
let t5;
|
|
10578
|
+
let t6;
|
|
10579
|
+
let div1;
|
|
10580
|
+
let div2_class_value;
|
|
10581
|
+
let div3_style_value;
|
|
10578
10582
|
let mounted;
|
|
10579
10583
|
let dispose;
|
|
10580
10584
|
let if_block0 =
|
|
@@ -10598,20 +10602,27 @@
|
|
|
10598
10602
|
ctx[15] && create_if_block$5(ctx);
|
|
10599
10603
|
return {
|
|
10600
10604
|
c() {
|
|
10601
|
-
|
|
10602
|
-
|
|
10605
|
+
div3 = element("div");
|
|
10606
|
+
div2 = element("div");
|
|
10603
10607
|
if (if_block0) if_block0.c();
|
|
10604
10608
|
t0 = space();
|
|
10605
|
-
|
|
10609
|
+
div0 = element("div");
|
|
10610
|
+
div0.innerHTML = `<slot name="leadingContent"></slot>`;
|
|
10606
10611
|
t1 = space();
|
|
10607
|
-
|
|
10612
|
+
if (if_block1) if_block1.c();
|
|
10608
10613
|
t2 = space();
|
|
10609
|
-
|
|
10614
|
+
input = element("input");
|
|
10610
10615
|
t3 = space();
|
|
10611
|
-
if (
|
|
10616
|
+
if (if_block2) if_block2.c();
|
|
10612
10617
|
t4 = space();
|
|
10618
|
+
if (if_block3) if_block3.c();
|
|
10619
|
+
t5 = space();
|
|
10613
10620
|
if (if_block4) if_block4.c();
|
|
10621
|
+
t6 = space();
|
|
10622
|
+
div1 = element("div");
|
|
10623
|
+
div1.innerHTML = `<slot name="trailingContent"></slot>`;
|
|
10614
10624
|
this.c = noop;
|
|
10625
|
+
attr(div0, "class", "leading-content");
|
|
10615
10626
|
attr(input, "class", input_class_value = `input--${
|
|
10616
10627
|
/*variant*/
|
|
10617
10628
|
ctx[7]}`);
|
|
@@ -10657,7 +10668,8 @@
|
|
|
10657
10668
|
ctx[10] ||
|
|
10658
10669
|
/*name*/
|
|
10659
10670
|
ctx[2]);
|
|
10660
|
-
attr(
|
|
10671
|
+
attr(div1, "class", "trailing-content");
|
|
10672
|
+
attr(div2, "class", div2_class_value = `
|
|
10661
10673
|
goa-input
|
|
10662
10674
|
${
|
|
10663
10675
|
/*isDisabled*/
|
|
@@ -10669,11 +10681,11 @@
|
|
|
10669
10681
|
/*type*/
|
|
10670
10682
|
ctx[1]}
|
|
10671
10683
|
`);
|
|
10672
|
-
toggle_class(
|
|
10684
|
+
toggle_class(div2, "error",
|
|
10673
10685
|
/*isError*/
|
|
10674
10686
|
ctx[22]);
|
|
10675
|
-
attr(
|
|
10676
|
-
attr(
|
|
10687
|
+
attr(div3, "class", "container");
|
|
10688
|
+
attr(div3, "style", div3_style_value = `
|
|
10677
10689
|
${calculateMargin(
|
|
10678
10690
|
/*mt*/
|
|
10679
10691
|
ctx[16],
|
|
@@ -10690,22 +10702,26 @@
|
|
|
10690
10702
|
},
|
|
10691
10703
|
|
|
10692
10704
|
m(target, anchor) {
|
|
10693
|
-
insert(target,
|
|
10694
|
-
append(
|
|
10695
|
-
if (if_block0) if_block0.m(
|
|
10696
|
-
append(
|
|
10697
|
-
|
|
10698
|
-
append(
|
|
10699
|
-
|
|
10705
|
+
insert(target, div3, anchor);
|
|
10706
|
+
append(div3, div2);
|
|
10707
|
+
if (if_block0) if_block0.m(div2, null);
|
|
10708
|
+
append(div2, t0);
|
|
10709
|
+
append(div2, div0);
|
|
10710
|
+
append(div2, t1);
|
|
10711
|
+
if (if_block1) if_block1.m(div2, null);
|
|
10712
|
+
append(div2, t2);
|
|
10713
|
+
append(div2, input);
|
|
10700
10714
|
/*input_binding*/
|
|
10701
10715
|
|
|
10702
10716
|
ctx[32](input);
|
|
10703
|
-
append(
|
|
10704
|
-
if (if_block2) if_block2.m(
|
|
10705
|
-
append(
|
|
10706
|
-
if (if_block3) if_block3.m(
|
|
10707
|
-
append(
|
|
10708
|
-
if (if_block4) if_block4.m(
|
|
10717
|
+
append(div2, t3);
|
|
10718
|
+
if (if_block2) if_block2.m(div2, null);
|
|
10719
|
+
append(div2, t4);
|
|
10720
|
+
if (if_block3) if_block3.m(div2, null);
|
|
10721
|
+
append(div2, t5);
|
|
10722
|
+
if (if_block4) if_block4.m(div2, null);
|
|
10723
|
+
append(div2, t6);
|
|
10724
|
+
append(div2, div1);
|
|
10709
10725
|
|
|
10710
10726
|
if (!mounted) {
|
|
10711
10727
|
dispose = [listen(input, "keyup",
|
|
@@ -10726,7 +10742,7 @@
|
|
|
10726
10742
|
} else {
|
|
10727
10743
|
if_block0 = create_if_block_4$1(ctx);
|
|
10728
10744
|
if_block0.c();
|
|
10729
|
-
if_block0.m(
|
|
10745
|
+
if_block0.m(div2, t0);
|
|
10730
10746
|
}
|
|
10731
10747
|
} else if (if_block0) {
|
|
10732
10748
|
if_block0.d(1);
|
|
@@ -10741,7 +10757,7 @@
|
|
|
10741
10757
|
} else {
|
|
10742
10758
|
if_block1 = create_if_block_3$2(ctx);
|
|
10743
10759
|
if_block1.c();
|
|
10744
|
-
if_block1.m(
|
|
10760
|
+
if_block1.m(div2, t2);
|
|
10745
10761
|
}
|
|
10746
10762
|
} else if (if_block1) {
|
|
10747
10763
|
if_block1.d(1);
|
|
@@ -10874,7 +10890,7 @@
|
|
|
10874
10890
|
} else {
|
|
10875
10891
|
if_block2 = create_if_block_2$3(ctx);
|
|
10876
10892
|
if_block2.c();
|
|
10877
|
-
if_block2.m(
|
|
10893
|
+
if_block2.m(div2, t4);
|
|
10878
10894
|
}
|
|
10879
10895
|
} else if (if_block2) {
|
|
10880
10896
|
if_block2.d(1);
|
|
@@ -10891,7 +10907,7 @@
|
|
|
10891
10907
|
} else {
|
|
10892
10908
|
if_block3 = create_if_block_1$3(ctx);
|
|
10893
10909
|
if_block3.c();
|
|
10894
|
-
if_block3.m(
|
|
10910
|
+
if_block3.m(div2, t5);
|
|
10895
10911
|
}
|
|
10896
10912
|
} else if (if_block3) {
|
|
10897
10913
|
if_block3.d(1);
|
|
@@ -10906,7 +10922,7 @@
|
|
|
10906
10922
|
} else {
|
|
10907
10923
|
if_block4 = create_if_block$5(ctx);
|
|
10908
10924
|
if_block4.c();
|
|
10909
|
-
if_block4.m(
|
|
10925
|
+
if_block4.m(div2, t6);
|
|
10910
10926
|
}
|
|
10911
10927
|
} else if (if_block4) {
|
|
10912
10928
|
if_block4.d(1);
|
|
@@ -10915,7 +10931,7 @@
|
|
|
10915
10931
|
|
|
10916
10932
|
if (dirty[0] &
|
|
10917
10933
|
/*isDisabled, variant, type*/
|
|
10918
|
-
2097282 &&
|
|
10934
|
+
2097282 && div2_class_value !== (div2_class_value = `
|
|
10919
10935
|
goa-input
|
|
10920
10936
|
${
|
|
10921
10937
|
/*isDisabled*/
|
|
@@ -10927,20 +10943,20 @@
|
|
|
10927
10943
|
/*type*/
|
|
10928
10944
|
ctx[1]}
|
|
10929
10945
|
`)) {
|
|
10930
|
-
attr(
|
|
10946
|
+
attr(div2, "class", div2_class_value);
|
|
10931
10947
|
}
|
|
10932
10948
|
|
|
10933
10949
|
if (dirty[0] &
|
|
10934
10950
|
/*isDisabled, variant, type, isError*/
|
|
10935
10951
|
6291586) {
|
|
10936
|
-
toggle_class(
|
|
10952
|
+
toggle_class(div2, "error",
|
|
10937
10953
|
/*isError*/
|
|
10938
10954
|
ctx[22]);
|
|
10939
10955
|
}
|
|
10940
10956
|
|
|
10941
10957
|
if (dirty[0] &
|
|
10942
10958
|
/*mt, mr, mb, ml, width*/
|
|
10943
|
-
983552 &&
|
|
10959
|
+
983552 && div3_style_value !== (div3_style_value = `
|
|
10944
10960
|
${calculateMargin(
|
|
10945
10961
|
/*mt*/
|
|
10946
10962
|
ctx[16],
|
|
@@ -10954,7 +10970,7 @@
|
|
|
10954
10970
|
/*width*/
|
|
10955
10971
|
ctx[9]};
|
|
10956
10972
|
`)) {
|
|
10957
|
-
attr(
|
|
10973
|
+
attr(div3, "style", div3_style_value);
|
|
10958
10974
|
}
|
|
10959
10975
|
},
|
|
10960
10976
|
|
|
@@ -10962,7 +10978,7 @@
|
|
|
10962
10978
|
o: noop,
|
|
10963
10979
|
|
|
10964
10980
|
d(detaching) {
|
|
10965
|
-
if (detaching) detach(
|
|
10981
|
+
if (detaching) detach(div3);
|
|
10966
10982
|
if (if_block0) if_block0.d();
|
|
10967
10983
|
if (if_block1) if_block1.d();
|
|
10968
10984
|
/*input_binding*/
|
|
@@ -11081,6 +11097,12 @@
|
|
|
11081
11097
|
$$invalidate(0, value = ee.value);
|
|
11082
11098
|
}
|
|
11083
11099
|
|
|
11100
|
+
onMount(() => {
|
|
11101
|
+
if (prefix != "" || suffix != "") {
|
|
11102
|
+
console.warn("GoAInput [prefix] and [suffix] properties are deprecated. Instead use leadingContent and trailingContent.");
|
|
11103
|
+
}
|
|
11104
|
+
});
|
|
11105
|
+
|
|
11084
11106
|
function input_binding($$value) {
|
|
11085
11107
|
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
|
11086
11108
|
inputEl = $$value;
|
|
@@ -11174,7 +11196,7 @@
|
|
|
11174
11196
|
class Input extends SvelteElement {
|
|
11175
11197
|
constructor(options) {
|
|
11176
11198
|
super();
|
|
11177
|
-
this.shadowRoot.innerHTML = `<style>:host{box-sizing:border-box}.container{position:relative;width:100%;display:inline-block}@media(min-width: 640px){.container{width:var(--width)}}.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:var(--input-border-radius);display:inline-flex;align-items:stretch;vertical-align:middle;min-width:100%}.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.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{margin-left:0.5rem}.goa-input-trailing-icon{margin-right:0.5rem}input{display:inline-block;color:var(--goa-color-text);font-size:var(--input-font-size);padding:var(--input-padding);line-height:calc(40px - calc(var(--input-padding) * 2));background-color:transparent;width:0;flex:1 1 auto}input[type="text"],input[type="date"],input[type="time"],input[type="datetime-local"],input[type="number"]{font-family:var(--font-family)}input[readonly]{cursor:pointer}.goa-input-leading-icon+input{padding-left:0.5rem}input,input:focus,input:hover,input:active{outline:none;border:none}.goa-input--disabled,.goa-input--disabled:hover,.goa-input--disabled:active,.goa-input--disabled:focus{background-color:var(--color-gray-100);border-color:var(--color-gray-200);cursor:default;box-shadow:none}.goa-input--disabled input,.goa-input--disabled input:hover,.goa-input--disabled input:active,.goa-input--disabled input:focus{color:var(--goa-color-text-secondary)}.goa-input--disabled input:hover{cursor:default !important}.prefix,.suffix{background-color:var(--color-gray-100);padding:0 0.75rem;display:flex;align-items:center}.prefix{border-top-left-radius:var(--input-border-radius);border-bottom-left-radius:var(--input-border-radius);border-right:1px solid var(--color-gray-600)}.suffix{border-top-right-radius:var(--input-border-radius);border-bottom-right-radius:var(--input-border-radius);border-left:1px solid var(--color-gray-600)}.goa-input--disabled .prefix{border-right:1px solid var(--color-gray-200)}.goa-input--disabled .suffix{border-left:1px solid var(--color-gray-200)}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-interactive--error)}input[type="search" i]:enabled:read-write:-webkit-any(:focus, :hover)::-webkit-search-cancel-button{position:relative;right:var(--search-icon-offset);cursor:pointer;-webkit-appearance:none;height:1.2rem;width:1.2rem;background:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="%23333" d="M405 136.798L375.202 107 256 226.202 136.798 107 107 136.798 226.202 256 107 375.202 136.798 405 256 285.798 375.202 405 405 375.202 285.798 256z"/></svg>')
|
|
11199
|
+
this.shadowRoot.innerHTML = `<style>:host{box-sizing:border-box}.container{position:relative;width:100%;display:inline-block}@media(min-width: 640px){.container{width:var(--width)}}.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:var(--input-border-radius);display:inline-flex;align-items:stretch;vertical-align:middle;min-width:100%}.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.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{margin-left:0.5rem}.goa-input-trailing-icon{margin-right:0.5rem}input{display:inline-block;color:var(--goa-color-text);font-size:var(--input-font-size);padding:var(--input-padding);line-height:calc(40px - calc(var(--input-padding) * 2));background-color:transparent;width:0;flex:1 1 auto}input[type="text"],input[type="date"],input[type="time"],input[type="datetime-local"],input[type="number"]{font-family:var(--font-family)}input[readonly]{cursor:pointer}.goa-input-leading-icon+input{padding-left:0.5rem}input,input:focus,input:hover,input:active{outline:none;border:none}.goa-input--disabled,.goa-input--disabled:hover,.goa-input--disabled:active,.goa-input--disabled:focus{background-color:var(--color-gray-100);border-color:var(--color-gray-200);cursor:default;box-shadow:none}.goa-input--disabled input,.goa-input--disabled input:hover,.goa-input--disabled input:active,.goa-input--disabled input:focus{color:var(--goa-color-text-secondary)}.goa-input--disabled input:hover{cursor:default !important}.prefix,.suffix,.leading-content ::slotted(div),.trailing-content ::slotted(div){background-color:var(--color-gray-100);padding:0 0.75rem;display:flex;align-items:center}.leading-content ::slotted(div),.trailing-content ::slotted(div){padding:0.5rem 0.75rem}.prefix,.leading-content ::slotted(div){border-top-left-radius:var(--input-border-radius);border-bottom-left-radius:var(--input-border-radius);border-right:1px solid var(--color-gray-600)}.suffix,.trailing-content ::slotted(div){border-top-right-radius:var(--input-border-radius);border-bottom-right-radius:var(--input-border-radius);border-left:1px solid var(--color-gray-600)}.goa-input--disabled .prefix,.goa-input--disabled .leading-content ::slotted(div){border-right:1px solid var(--color-gray-200)}.goa-input--disabled .suffix,.goa-input--disabled .trailing-content ::slotted(div){border-left:1px solid var(--color-gray-200)}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-interactive--error)}input[type="search" i]:enabled:read-write:-webkit-any(:focus, :hover)::-webkit-search-cancel-button{position:relative;right:var(--search-icon-offset);cursor:pointer;-webkit-appearance:none;height:1.2rem;width:1.2rem;background:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="%23333" d="M405 136.798L375.202 107 256 226.202 136.798 107 107 136.798 226.202 256 107 375.202 136.798 405 256 285.798 375.202 405 405 375.202 285.798 256z"/></svg>')
|
|
11178
11200
|
center center no-repeat}</style>`;
|
|
11179
11201
|
init(this, {
|
|
11180
11202
|
target: this.shadowRoot,
|
|
@@ -16704,6 +16726,8 @@
|
|
|
16704
16726
|
mr = _a.mr,
|
|
16705
16727
|
mb = _a.mb,
|
|
16706
16728
|
ml = _a.ml,
|
|
16729
|
+
leadingContent = _a.leadingContent,
|
|
16730
|
+
trailingContent = _a.trailingContent,
|
|
16707
16731
|
onTrailingIconClick = _a.onTrailingIconClick,
|
|
16708
16732
|
onChange = _a.onChange;
|
|
16709
16733
|
var ref = react.useRef(null);
|
|
@@ -16732,7 +16756,7 @@
|
|
|
16732
16756
|
current.removeEventListener("_trailingIconClick", clickListener);
|
|
16733
16757
|
};
|
|
16734
16758
|
}, [ref, onChange, onTrailingIconClick]);
|
|
16735
|
-
return jsxRuntime.
|
|
16759
|
+
return jsxRuntime.jsxs("goa-input", __assign({
|
|
16736
16760
|
ref: ref,
|
|
16737
16761
|
focused: focused,
|
|
16738
16762
|
type: type,
|
|
@@ -16760,7 +16784,17 @@
|
|
|
16760
16784
|
mb: mb,
|
|
16761
16785
|
ml: ml,
|
|
16762
16786
|
handletrailingiconclick: !!onTrailingIconClick
|
|
16763
|
-
},
|
|
16787
|
+
}, {
|
|
16788
|
+
children: [leadingContent && jsxRuntime.jsx("div", __assign({
|
|
16789
|
+
slot: "leadingContent"
|
|
16790
|
+
}, {
|
|
16791
|
+
children: leadingContent
|
|
16792
|
+
}), void 0), trailingContent && jsxRuntime.jsx("div", __assign({
|
|
16793
|
+
slot: "trailingContent"
|
|
16794
|
+
}, {
|
|
16795
|
+
children: trailingContent
|
|
16796
|
+
}), void 0)]
|
|
16797
|
+
}), void 0);
|
|
16764
16798
|
};
|
|
16765
16799
|
|
|
16766
16800
|
var onDateChangeHandler = function onDateChangeHandler(onChange) {
|