@abgov/web-components 1.0.0-alpha.138 → 1.0.0-alpha.139

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abgov/web-components",
3
- "version": "1.0.0-alpha.138",
3
+ "version": "1.0.0-alpha.139",
4
4
  "description": "Government of Alberta - UI Web components",
5
5
  "bugs": {
6
6
  "url": "https://github.com/GovAlta/ui-components/issues"
@@ -8412,7 +8412,7 @@ function create_if_block_4$1(ctx) {
8412
8412
  };
8413
8413
  }
8414
8414
 
8415
- // (86:4) {#if leadingicon}
8415
+ // (95:4) {#if leadingicon}
8416
8416
  function create_if_block_3$2(ctx) {
8417
8417
  let goa_icon;
8418
8418
 
@@ -8437,7 +8437,7 @@ function create_if_block_3$2(ctx) {
8437
8437
  };
8438
8438
  }
8439
8439
 
8440
- // (116:4) {#if trailingicon && !handlesTrailingIconClick}
8440
+ // (125:4) {#if trailingicon && !handlesTrailingIconClick}
8441
8441
  function create_if_block_2$3(ctx) {
8442
8442
  let goa_icon;
8443
8443
 
@@ -8463,7 +8463,7 @@ function create_if_block_2$3(ctx) {
8463
8463
  };
8464
8464
  }
8465
8465
 
8466
- // (126:4) {#if trailingicon && handlesTrailingIconClick}
8466
+ // (135:4) {#if trailingicon && handlesTrailingIconClick}
8467
8467
  function create_if_block_1$3(ctx) {
8468
8468
  let goa_icon_button;
8469
8469
  let mounted;
@@ -8503,7 +8503,7 @@ function create_if_block_1$3(ctx) {
8503
8503
  };
8504
8504
  }
8505
8505
 
8506
- // (138:4) {#if suffix}
8506
+ // (147:4) {#if suffix}
8507
8507
  function create_if_block$5(ctx) {
8508
8508
  let span;
8509
8509
  let t;
@@ -8528,19 +8528,23 @@ function create_if_block$5(ctx) {
8528
8528
  }
8529
8529
 
8530
8530
  function create_fragment$e(ctx) {
8531
- let div1;
8532
- let div0;
8531
+ let div3;
8532
+ let div2;
8533
8533
  let t0;
8534
+ let div0;
8534
8535
  let t1;
8536
+ let t2;
8535
8537
  let input;
8536
8538
  let input_class_value;
8537
8539
  let input_style_value;
8538
8540
  let input_aria_label_value;
8539
- let t2;
8540
8541
  let t3;
8541
8542
  let t4;
8542
- let div0_class_value;
8543
- let div1_style_value;
8543
+ let t5;
8544
+ let t6;
8545
+ let div1;
8546
+ let div2_class_value;
8547
+ let div3_style_value;
8544
8548
  let mounted;
8545
8549
  let dispose;
8546
8550
  let if_block0 = /*prefix*/ ctx[14] && create_if_block_4$1(ctx);
@@ -8551,20 +8555,27 @@ function create_fragment$e(ctx) {
8551
8555
 
8552
8556
  return {
8553
8557
  c() {
8554
- div1 = element("div");
8555
- div0 = element("div");
8558
+ div3 = element("div");
8559
+ div2 = element("div");
8556
8560
  if (if_block0) if_block0.c();
8557
8561
  t0 = space();
8558
- if (if_block1) if_block1.c();
8562
+ div0 = element("div");
8563
+ div0.innerHTML = `<slot name="leadingContent"></slot>`;
8559
8564
  t1 = space();
8560
- input = element("input");
8565
+ if (if_block1) if_block1.c();
8561
8566
  t2 = space();
8562
- if (if_block2) if_block2.c();
8567
+ input = element("input");
8563
8568
  t3 = space();
8564
- if (if_block3) if_block3.c();
8569
+ if (if_block2) if_block2.c();
8565
8570
  t4 = space();
8571
+ if (if_block3) if_block3.c();
8572
+ t5 = space();
8566
8573
  if (if_block4) if_block4.c();
8574
+ t6 = space();
8575
+ div1 = element("div");
8576
+ div1.innerHTML = `<slot name="trailingContent"></slot>`;
8567
8577
  this.c = noop;
8578
+ attr(div0, "class", "leading-content");
8568
8579
  attr(input, "class", input_class_value = `input--${/*variant*/ ctx[7]}`);
8569
8580
  attr(input, "style", input_style_value = `--search-icon-offset: ${/*trailingicon*/ ctx[6] ? "-0.5rem" : "0"}`);
8570
8581
  input.readOnly = /*isReadonly*/ ctx[23];
@@ -8580,37 +8591,42 @@ function create_fragment$e(ctx) {
8580
8591
  attr(input, "step", /*step*/ ctx[13]);
8581
8592
  attr(input, "role", "textbox");
8582
8593
  attr(input, "aria-label", input_aria_label_value = /*arialabel*/ ctx[10] || /*name*/ ctx[2]);
8594
+ attr(div1, "class", "trailing-content");
8583
8595
 
8584
- attr(div0, "class", div0_class_value = `
8596
+ attr(div2, "class", div2_class_value = `
8585
8597
  goa-input
8586
8598
  ${/*isDisabled*/ ctx[21] ? "goa-input--disabled" : ""}
8587
8599
  variant--${/*variant*/ ctx[7]}
8588
8600
  type--${/*type*/ ctx[1]}
8589
8601
  `);
8590
8602
 
8591
- toggle_class(div0, "error", /*isError*/ ctx[22]);
8592
- attr(div1, "class", "container");
8603
+ toggle_class(div2, "error", /*isError*/ ctx[22]);
8604
+ attr(div3, "class", "container");
8593
8605
 
8594
- attr(div1, "style", div1_style_value = `
8606
+ attr(div3, "style", div3_style_value = `
8595
8607
  ${calculateMargin(/*mt*/ ctx[16], /*mr*/ ctx[17], /*mb*/ ctx[18], /*ml*/ ctx[19])};
8596
8608
  --width: ${/*width*/ ctx[9]};
8597
8609
  `);
8598
8610
  },
8599
8611
  m(target, anchor) {
8600
- insert(target, div1, anchor);
8601
- append(div1, div0);
8602
- if (if_block0) if_block0.m(div0, null);
8603
- append(div0, t0);
8604
- if (if_block1) if_block1.m(div0, null);
8605
- append(div0, t1);
8606
- append(div0, input);
8612
+ insert(target, div3, anchor);
8613
+ append(div3, div2);
8614
+ if (if_block0) if_block0.m(div2, null);
8615
+ append(div2, t0);
8616
+ append(div2, div0);
8617
+ append(div2, t1);
8618
+ if (if_block1) if_block1.m(div2, null);
8619
+ append(div2, t2);
8620
+ append(div2, input);
8607
8621
  /*input_binding*/ ctx[32](input);
8608
- append(div0, t2);
8609
- if (if_block2) if_block2.m(div0, null);
8610
- append(div0, t3);
8611
- if (if_block3) if_block3.m(div0, null);
8612
- append(div0, t4);
8613
- if (if_block4) if_block4.m(div0, null);
8622
+ append(div2, t3);
8623
+ if (if_block2) if_block2.m(div2, null);
8624
+ append(div2, t4);
8625
+ if (if_block3) if_block3.m(div2, null);
8626
+ append(div2, t5);
8627
+ if (if_block4) if_block4.m(div2, null);
8628
+ append(div2, t6);
8629
+ append(div2, div1);
8614
8630
 
8615
8631
  if (!mounted) {
8616
8632
  dispose = [
@@ -8628,7 +8644,7 @@ function create_fragment$e(ctx) {
8628
8644
  } else {
8629
8645
  if_block0 = create_if_block_4$1(ctx);
8630
8646
  if_block0.c();
8631
- if_block0.m(div0, t0);
8647
+ if_block0.m(div2, t0);
8632
8648
  }
8633
8649
  } else if (if_block0) {
8634
8650
  if_block0.d(1);
@@ -8641,7 +8657,7 @@ function create_fragment$e(ctx) {
8641
8657
  } else {
8642
8658
  if_block1 = create_if_block_3$2(ctx);
8643
8659
  if_block1.c();
8644
- if_block1.m(div0, t1);
8660
+ if_block1.m(div2, t2);
8645
8661
  }
8646
8662
  } else if (if_block1) {
8647
8663
  if_block1.d(1);
@@ -8710,7 +8726,7 @@ function create_fragment$e(ctx) {
8710
8726
  } else {
8711
8727
  if_block2 = create_if_block_2$3(ctx);
8712
8728
  if_block2.c();
8713
- if_block2.m(div0, t3);
8729
+ if_block2.m(div2, t4);
8714
8730
  }
8715
8731
  } else if (if_block2) {
8716
8732
  if_block2.d(1);
@@ -8723,7 +8739,7 @@ function create_fragment$e(ctx) {
8723
8739
  } else {
8724
8740
  if_block3 = create_if_block_1$3(ctx);
8725
8741
  if_block3.c();
8726
- if_block3.m(div0, t4);
8742
+ if_block3.m(div2, t5);
8727
8743
  }
8728
8744
  } else if (if_block3) {
8729
8745
  if_block3.d(1);
@@ -8736,37 +8752,37 @@ function create_fragment$e(ctx) {
8736
8752
  } else {
8737
8753
  if_block4 = create_if_block$5(ctx);
8738
8754
  if_block4.c();
8739
- if_block4.m(div0, null);
8755
+ if_block4.m(div2, t6);
8740
8756
  }
8741
8757
  } else if (if_block4) {
8742
8758
  if_block4.d(1);
8743
8759
  if_block4 = null;
8744
8760
  }
8745
8761
 
8746
- if (dirty[0] & /*isDisabled, variant, type*/ 2097282 && div0_class_value !== (div0_class_value = `
8762
+ if (dirty[0] & /*isDisabled, variant, type*/ 2097282 && div2_class_value !== (div2_class_value = `
8747
8763
  goa-input
8748
8764
  ${/*isDisabled*/ ctx[21] ? "goa-input--disabled" : ""}
8749
8765
  variant--${/*variant*/ ctx[7]}
8750
8766
  type--${/*type*/ ctx[1]}
8751
8767
  `)) {
8752
- attr(div0, "class", div0_class_value);
8768
+ attr(div2, "class", div2_class_value);
8753
8769
  }
8754
8770
 
8755
8771
  if (dirty[0] & /*isDisabled, variant, type, isError*/ 6291586) {
8756
- toggle_class(div0, "error", /*isError*/ ctx[22]);
8772
+ toggle_class(div2, "error", /*isError*/ ctx[22]);
8757
8773
  }
8758
8774
 
8759
- if (dirty[0] & /*mt, mr, mb, ml, width*/ 983552 && div1_style_value !== (div1_style_value = `
8775
+ if (dirty[0] & /*mt, mr, mb, ml, width*/ 983552 && div3_style_value !== (div3_style_value = `
8760
8776
  ${calculateMargin(/*mt*/ ctx[16], /*mr*/ ctx[17], /*mb*/ ctx[18], /*ml*/ ctx[19])};
8761
8777
  --width: ${/*width*/ ctx[9]};
8762
8778
  `)) {
8763
- attr(div1, "style", div1_style_value);
8779
+ attr(div3, "style", div3_style_value);
8764
8780
  }
8765
8781
  },
8766
8782
  i: noop,
8767
8783
  o: noop,
8768
8784
  d(detaching) {
8769
- if (detaching) detach(div1);
8785
+ if (detaching) detach(div3);
8770
8786
  if (if_block0) if_block0.d();
8771
8787
  if (if_block1) if_block1.d();
8772
8788
  /*input_binding*/ ctx[32](null);
@@ -8830,6 +8846,12 @@ function instance$c($$self, $$props, $$invalidate) {
8830
8846
  $$invalidate(0, value = ee.value);
8831
8847
  }
8832
8848
 
8849
+ onMount(() => {
8850
+ if (prefix != "" || suffix != "") {
8851
+ console.warn("GoAInput [prefix] and [suffix] properties are deprecated. Instead use leadingContent and trailingContent.");
8852
+ }
8853
+ });
8854
+
8833
8855
  function input_binding($$value) {
8834
8856
  binding_callbacks[$$value ? 'unshift' : 'push'](() => {
8835
8857
  inputEl = $$value;
@@ -8942,7 +8964,7 @@ class Input extends SvelteElement {
8942
8964
  constructor(options) {
8943
8965
  super();
8944
8966
 
8945
- 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>')
8967
+ 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>')
8946
8968
  center center no-repeat}</style>`;
8947
8969
 
8948
8970
  init(