@abgov/web-components 1.0.0-alpha.169 → 1.0.0-alpha.170

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.169",
3
+ "version": "1.0.0-alpha.170",
4
4
  "description": "Government of Alberta - UI Web components",
5
5
  "bugs": {
6
6
  "url": "https://github.com/GovAlta/ui-components/issues"
@@ -5489,7 +5489,7 @@ function get_each_context_1(ctx, list, i) {
5489
5489
  return child_ctx;
5490
5490
  }
5491
5491
 
5492
- function get_each_context$4(ctx, list, i) {
5492
+ function get_each_context$5(ctx, list, i) {
5493
5493
  const child_ctx = ctx.slice();
5494
5494
  child_ctx[50] = list[i];
5495
5495
  return child_ctx;
@@ -5686,7 +5686,7 @@ function create_if_block$f(ctx) {
5686
5686
  let each_blocks = [];
5687
5687
 
5688
5688
  for (let i = 0; i < each_value.length; i += 1) {
5689
- each_blocks[i] = create_each_block$4(get_each_context$4(ctx, each_value, i));
5689
+ each_blocks[i] = create_each_block$5(get_each_context$5(ctx, each_value, i));
5690
5690
  }
5691
5691
 
5692
5692
  return {
@@ -5723,12 +5723,12 @@ function create_if_block$f(ctx) {
5723
5723
  let i;
5724
5724
 
5725
5725
  for (i = 0; i < each_value.length; i += 1) {
5726
- const child_ctx = get_each_context$4(ctx, each_value, i);
5726
+ const child_ctx = get_each_context$5(ctx, each_value, i);
5727
5727
 
5728
5728
  if (each_blocks[i]) {
5729
5729
  each_blocks[i].p(child_ctx, dirty);
5730
5730
  } else {
5731
- each_blocks[i] = create_each_block$4(child_ctx);
5731
+ each_blocks[i] = create_each_block$5(child_ctx);
5732
5732
  each_blocks[i].c();
5733
5733
  each_blocks[i].m(select, null);
5734
5734
  }
@@ -5906,7 +5906,7 @@ function create_each_block_1(key_1, ctx) {
5906
5906
  }
5907
5907
 
5908
5908
  // (260:6) {#each _options as option}
5909
- function create_each_block$4(ctx) {
5909
+ function create_each_block$5(ctx) {
5910
5910
  let option;
5911
5911
  let t0_value = /*option*/ ctx[50].label + "";
5912
5912
  let t0;
@@ -6400,7 +6400,7 @@ function instance$s($$self, $$props, $$invalidate) {
6400
6400
  class Dropdown extends SvelteElement {
6401
6401
  constructor(options) {
6402
6402
  super();
6403
- this.shadowRoot.innerHTML = `<style>:host{box-sizing:border-box;font-family:var(--goa-font-family-sans)}.dropdown{position:relative;cursor:pointer;display:inline-block;width:100%}@media(min-width: 640px){.dropdown{width:var(--width)}}.dropdown-background{cursor:default;position:fixed;z-index:98;inset:0}.dropdown-list{position:absolute;left:0;right:0;padding:0;margin:0;margin-top:3px;list-style-type:none;background:var(--goa-color-greyscale-white);border-radius:var(--goa-border-radius-m);outline:none;box-shadow:var(--shadow-1);z-index:99;bottom:var(--bottom);scroll-behavior:smooth;scrollbar-width:thin;display:none}.dropdown-active{display:block}.dropdown-list::-webkit-scrollbar{width:6px}.dropdown-list::-webkit-scrollbar-track{background:#f1f1f1}.dropdown-list::-webkit-scrollbar-thumb{background:#888}.dropdown-list::-webkit-scrollbar-thumb:hover{background:#555}.dropdown-item{margin:0;padding:0.5rem;cursor:pointer;color:var(--goa-color-greyscale-black);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dropdown-item--tabbed{background:var(--goa-color-greyscale-100);color:var(--goa-color-interactive-hover)}.dropdown-item--disabled{opacity:0.5;cursor:default}.dropdown-item--disabled:hover{cursor:default;color:var(--goa-color-greyscale-700)}.dropdown-item--selected{background:var(--goa-color-interactive-default);color:var(--goa-color-greyscale-white)}.dropdown-item--tabbed.dropdown-item--selected,.dropdown-item--selected:hover{background:var(--goa-color-interactive-hover);color:var(--goa-color-greyscale-white)}.dropdown-native{border:1px solid var(--goa-color-greyscale-700);border-radius:var(--goa-border-radius-m);background-color:var(--goa-color-greyscale-white);transition:box-shadow 0.1s ease-in}.dropdown-native:has(select:disabled){background-color:var(--goa-color-greyscale-100);border-color:var(--goa-color-greyscale-200);box-shadow:none;color:var(--goa-color-text-secondary);cursor:default}.dropdown-native:has(select.error){border:2px solid var(--goa-color-interactive-error)}.dropdown-native:hover{border-color:var(--goa-color-interactive-hover);box-shadow:0 0 0 var(--goa-border-width-m) var(--goa-color-interactive-hover)}select{border:none;background-color:transparent;color:var(--goa-color-text-default);font-size:var(--goa-font-size-4);appearance:none;padding:calc(var(--goa-space-xs) + 2px);padding-left:0.5rem;padding-right:3rem;outline:none;width:100%}.dropdown-native::after{content:"";position:absolute;right:0.6rem;top:0.6rem;pointer-events:none;width:1.5rem;height:1.5rem;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'><path fill='none' stroke='%23333333' stroke-linecap='round' stroke-linejoin='round' stroke-width='48' d='M112 184l144 144 144-144' /%3E%3C/svg%3E");background-repeat:none}.dropdown-native:focus-within{box-shadow:0 0 0 3px var(--goa-color-interactive-focus)}</style>`;
6403
+ this.shadowRoot.innerHTML = `<style>:host{box-sizing:border-box;font-family:var(--goa-font-family-sans)}.dropdown{position:relative;cursor:pointer;display:inline-block;width:var(--width, 100%)}.dropdown-background{cursor:default;position:fixed;z-index:98;inset:0}.dropdown-list{position:absolute;left:0;right:0;padding:0;margin:0;margin-top:3px;list-style-type:none;background:var(--goa-color-greyscale-white);border-radius:var(--goa-border-radius-m);outline:none;box-shadow:var(--shadow-1);z-index:99;bottom:var(--bottom);scroll-behavior:smooth;scrollbar-width:thin;display:none}.dropdown-active{display:block}.dropdown-list::-webkit-scrollbar{width:6px}.dropdown-list::-webkit-scrollbar-track{background:#f1f1f1}.dropdown-list::-webkit-scrollbar-thumb{background:#888}.dropdown-list::-webkit-scrollbar-thumb:hover{background:#555}.dropdown-item{margin:0;padding:0.5rem;cursor:pointer;color:var(--goa-color-greyscale-black);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dropdown-item--tabbed{background:var(--goa-color-greyscale-100);color:var(--goa-color-interactive-hover)}.dropdown-item--disabled{opacity:0.5;cursor:default}.dropdown-item--disabled:hover{cursor:default;color:var(--goa-color-greyscale-700)}.dropdown-item--selected{background:var(--goa-color-interactive-default);color:var(--goa-color-greyscale-white)}.dropdown-item--tabbed.dropdown-item--selected,.dropdown-item--selected:hover{background:var(--goa-color-interactive-hover);color:var(--goa-color-greyscale-white)}.dropdown-native{border:1px solid var(--goa-color-greyscale-700);border-radius:var(--goa-border-radius-m);background-color:var(--goa-color-greyscale-white);transition:box-shadow 0.1s ease-in}.dropdown-native:has(select:disabled){background-color:var(--goa-color-greyscale-100);border-color:var(--goa-color-greyscale-200);box-shadow:none;color:var(--goa-color-text-secondary);cursor:default}.dropdown-native:has(select.error){border:2px solid var(--goa-color-interactive-error)}.dropdown-native:hover{border-color:var(--goa-color-interactive-hover);box-shadow:0 0 0 var(--goa-border-width-m) var(--goa-color-interactive-hover)}select{border:none;background-color:transparent;color:var(--goa-color-text-default);font-size:var(--goa-font-size-4);appearance:none;padding:calc(var(--goa-space-xs) + 2px);padding-left:0.5rem;padding-right:3rem;outline:none;width:100%}.dropdown-native::after{content:"";position:absolute;right:0.6rem;top:0.6rem;pointer-events:none;width:1.5rem;height:1.5rem;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'><path fill='none' stroke='%23333333' stroke-linecap='round' stroke-linejoin='round' stroke-width='48' d='M112 184l144 144 144-144' /%3E%3C/svg%3E");background-repeat:none}.dropdown-native:focus-within{box-shadow:0 0 0 3px var(--goa-color-interactive-focus)}</style>`;
6404
6404
 
6405
6405
  init(
6406
6406
  this,
@@ -7106,14 +7106,14 @@ customElements.define("goa-app-footer", Footer);
7106
7106
 
7107
7107
  /* libs/web-components/src/components/footer-meta-section/FooterMetaSection.svelte generated by Svelte v3.51.0 */
7108
7108
 
7109
- function get_each_context$3(ctx, list, i) {
7109
+ function get_each_context$4(ctx, list, i) {
7110
7110
  const child_ctx = ctx.slice();
7111
7111
  child_ctx[3] = list[i];
7112
7112
  return child_ctx;
7113
7113
  }
7114
7114
 
7115
7115
  // (52:4) {#each children as child}
7116
- function create_each_block$3(ctx) {
7116
+ function create_each_block$4(ctx) {
7117
7117
  let li;
7118
7118
  let a;
7119
7119
  let t_value = /*child*/ ctx[3].innerHTML + "";
@@ -7154,7 +7154,7 @@ function create_fragment$r(ctx) {
7154
7154
  let each_blocks = [];
7155
7155
 
7156
7156
  for (let i = 0; i < each_value.length; i += 1) {
7157
- each_blocks[i] = create_each_block$3(get_each_context$3(ctx, each_value, i));
7157
+ each_blocks[i] = create_each_block$4(get_each_context$4(ctx, each_value, i));
7158
7158
  }
7159
7159
 
7160
7160
  return {
@@ -7190,12 +7190,12 @@ function create_fragment$r(ctx) {
7190
7190
  let i;
7191
7191
 
7192
7192
  for (i = 0; i < each_value.length; i += 1) {
7193
- const child_ctx = get_each_context$3(ctx, each_value, i);
7193
+ const child_ctx = get_each_context$4(ctx, each_value, i);
7194
7194
 
7195
7195
  if (each_blocks[i]) {
7196
7196
  each_blocks[i].p(child_ctx, dirty);
7197
7197
  } else {
7198
- each_blocks[i] = create_each_block$3(child_ctx);
7198
+ each_blocks[i] = create_each_block$4(child_ctx);
7199
7199
  each_blocks[i].c();
7200
7200
  each_blocks[i].m(ul, null);
7201
7201
  }
@@ -7281,7 +7281,7 @@ customElements.define("goa-app-footer-meta-section", FooterMetaSection);
7281
7281
 
7282
7282
  /* libs/web-components/src/components/footer-nav-section/FooterNavSection.svelte generated by Svelte v3.51.0 */
7283
7283
 
7284
- function get_each_context$2(ctx, list, i) {
7284
+ function get_each_context$3(ctx, list, i) {
7285
7285
  const child_ctx = ctx.slice();
7286
7286
  child_ctx[5] = list[i];
7287
7287
  return child_ctx;
@@ -7321,7 +7321,7 @@ function create_if_block$d(ctx) {
7321
7321
  }
7322
7322
 
7323
7323
  // (49:4) {#each children as child}
7324
- function create_each_block$2(ctx) {
7324
+ function create_each_block$3(ctx) {
7325
7325
  let li;
7326
7326
  let a;
7327
7327
  let t_value = /*child*/ ctx[5].innerHTML + "";
@@ -7365,7 +7365,7 @@ function create_fragment$q(ctx) {
7365
7365
  let each_blocks = [];
7366
7366
 
7367
7367
  for (let i = 0; i < each_value.length; i += 1) {
7368
- each_blocks[i] = create_each_block$2(get_each_context$2(ctx, each_value, i));
7368
+ each_blocks[i] = create_each_block$3(get_each_context$3(ctx, each_value, i));
7369
7369
  }
7370
7370
 
7371
7371
  return {
@@ -7428,12 +7428,12 @@ function create_fragment$q(ctx) {
7428
7428
  let i;
7429
7429
 
7430
7430
  for (i = 0; i < each_value.length; i += 1) {
7431
- const child_ctx = get_each_context$2(ctx, each_value, i);
7431
+ const child_ctx = get_each_context$3(ctx, each_value, i);
7432
7432
 
7433
7433
  if (each_blocks[i]) {
7434
7434
  each_blocks[i].p(child_ctx, dirty);
7435
7435
  } else {
7436
- each_blocks[i] = create_each_block$2(child_ctx);
7436
+ each_blocks[i] = create_each_block$3(child_ctx);
7437
7437
  each_blocks[i].c();
7438
7438
  each_blocks[i].m(ul, null);
7439
7439
  }
@@ -11357,17 +11357,31 @@ customElements.define("goa-page-block", PageBlock);
11357
11357
 
11358
11358
  /* libs/web-components/src/components/pagination/Pagination.svelte generated by Svelte v3.51.0 */
11359
11359
 
11360
+ function get_each_context$2(ctx, list, i) {
11361
+ const child_ctx = ctx.slice();
11362
+ child_ctx[18] = list[i];
11363
+ child_ctx[20] = i;
11364
+ return child_ctx;
11365
+ }
11366
+
11367
+ // (66:4) {#if variant === "all"}
11360
11368
  function create_if_block$6(ctx) {
11361
11369
  let goa_block;
11362
11370
  let span0;
11363
11371
  let t1;
11364
11372
  let input;
11365
11373
  let t2;
11366
- let goa_input;
11374
+ let goa_dropdown;
11367
11375
  let t3;
11368
11376
  let span1;
11369
11377
  let t4;
11370
11378
  let t5;
11379
+ let each_value = { length: /*_pageCount*/ ctx[8] };
11380
+ let each_blocks = [];
11381
+
11382
+ for (let i = 0; i < each_value.length; i += 1) {
11383
+ each_blocks[i] = create_each_block$2(get_each_context$2(ctx, each_value, i));
11384
+ }
11371
11385
 
11372
11386
  return {
11373
11387
  c() {
@@ -11377,18 +11391,19 @@ function create_if_block$6(ctx) {
11377
11391
  t1 = space();
11378
11392
  input = element("input");
11379
11393
  t2 = space();
11380
- goa_input = element("goa-input");
11394
+ goa_dropdown = element("goa-dropdown");
11395
+
11396
+ for (let i = 0; i < each_blocks.length; i += 1) {
11397
+ each_blocks[i].c();
11398
+ }
11399
+
11381
11400
  t3 = space();
11382
11401
  span1 = element("span");
11383
11402
  t4 = text("of ");
11384
11403
  t5 = text(/*_pageCount*/ ctx[8]);
11385
11404
  attr(input, "type", "hidden");
11386
- set_custom_element_data(goa_input, "type", "number");
11387
- set_custom_element_data(goa_input, "value", /*pagenumber*/ ctx[0]);
11388
- set_custom_element_data(goa_input, "width", "8ch");
11389
- set_custom_element_data(goa_input, "debounce", "500");
11390
- set_custom_element_data(goa_input, "min", "1");
11391
- set_custom_element_data(goa_input, "max", /*_pageCount*/ ctx[8]);
11405
+ set_custom_element_data(goa_dropdown, "value", /*pagenumber*/ ctx[0]);
11406
+ set_custom_element_data(goa_dropdown, "width", "70px");
11392
11407
  set_custom_element_data(goa_block, "data-testid", "page-selector");
11393
11408
  set_custom_element_data(goa_block, "alignment", "center");
11394
11409
  set_custom_element_data(goa_block, "gap", "s");
@@ -11400,20 +11415,44 @@ function create_if_block$6(ctx) {
11400
11415
  append(goa_block, input);
11401
11416
  /*input_binding*/ ctx[12](input);
11402
11417
  append(goa_block, t2);
11403
- append(goa_block, goa_input);
11404
- /*goa_input_binding*/ ctx[13](goa_input);
11418
+ append(goa_block, goa_dropdown);
11419
+
11420
+ for (let i = 0; i < each_blocks.length; i += 1) {
11421
+ each_blocks[i].m(goa_dropdown, null);
11422
+ }
11423
+
11424
+ /*goa_dropdown_binding*/ ctx[13](goa_dropdown);
11405
11425
  append(goa_block, t3);
11406
11426
  append(goa_block, span1);
11407
11427
  append(span1, t4);
11408
11428
  append(span1, t5);
11409
11429
  },
11410
11430
  p(ctx, dirty) {
11411
- if (dirty & /*pagenumber*/ 1) {
11412
- set_custom_element_data(goa_input, "value", /*pagenumber*/ ctx[0]);
11431
+ if (dirty & /*_pageCount*/ 256) {
11432
+ each_value = { length: /*_pageCount*/ ctx[8] };
11433
+ let i;
11434
+
11435
+ for (i = 0; i < each_value.length; i += 1) {
11436
+ const child_ctx = get_each_context$2(ctx, each_value, i);
11437
+
11438
+ if (each_blocks[i]) {
11439
+ each_blocks[i].p(child_ctx, dirty);
11440
+ } else {
11441
+ each_blocks[i] = create_each_block$2(child_ctx);
11442
+ each_blocks[i].c();
11443
+ each_blocks[i].m(goa_dropdown, null);
11444
+ }
11445
+ }
11446
+
11447
+ for (; i < each_blocks.length; i += 1) {
11448
+ each_blocks[i].d(1);
11449
+ }
11450
+
11451
+ each_blocks.length = each_value.length;
11413
11452
  }
11414
11453
 
11415
- if (dirty & /*_pageCount*/ 256) {
11416
- set_custom_element_data(goa_input, "max", /*_pageCount*/ ctx[8]);
11454
+ if (dirty & /*pagenumber*/ 1) {
11455
+ set_custom_element_data(goa_dropdown, "value", /*pagenumber*/ ctx[0]);
11417
11456
  }
11418
11457
 
11419
11458
  if (dirty & /*_pageCount*/ 256) set_data(t5, /*_pageCount*/ ctx[8]);
@@ -11421,7 +11460,28 @@ function create_if_block$6(ctx) {
11421
11460
  d(detaching) {
11422
11461
  if (detaching) detach(goa_block);
11423
11462
  /*input_binding*/ ctx[12](null);
11424
- /*goa_input_binding*/ ctx[13](null);
11463
+ destroy_each(each_blocks, detaching);
11464
+ /*goa_dropdown_binding*/ ctx[13](null);
11465
+ }
11466
+ };
11467
+ }
11468
+
11469
+ // (71:10) {#each {length: _pageCount} as _, i}
11470
+ function create_each_block$2(ctx) {
11471
+ let goa_dropdown_item;
11472
+
11473
+ return {
11474
+ c() {
11475
+ goa_dropdown_item = element("goa-dropdown-item");
11476
+ set_custom_element_data(goa_dropdown_item, "value", /*i*/ ctx[20] + 1);
11477
+ set_custom_element_data(goa_dropdown_item, "label", /*i*/ ctx[20] + 1);
11478
+ },
11479
+ m(target, anchor) {
11480
+ insert(target, goa_dropdown_item, anchor);
11481
+ },
11482
+ p: noop,
11483
+ d(detaching) {
11484
+ if (detaching) detach(goa_dropdown_item);
11425
11485
  }
11426
11486
  };
11427
11487
  }
@@ -11560,7 +11620,7 @@ function instance$d($$self, $$props, $$invalidate) {
11560
11620
  let { ml = null } = $$props;
11561
11621
 
11562
11622
  // private
11563
- let inputEl = null;
11623
+ let pageDropdownEl = null;
11564
11624
 
11565
11625
  let hiddenEl = null; // needed to allow the inputEl's event to be cancelled
11566
11626
 
@@ -11570,16 +11630,11 @@ function instance$d($$self, $$props, $$invalidate) {
11570
11630
  validateRequired("GoAPagination", { itemcount, pagenumber });
11571
11631
  validateVariant(variant);
11572
11632
 
11573
- // prevent event propagation if value is non-numeric
11574
- // (input[type=number] returns blank for non-numeric numbers)
11575
- inputEl && inputEl.addEventListener("_change", e => {
11633
+ // prevent event propagation
11634
+ pageDropdownEl && pageDropdownEl.addEventListener("_change", e => {
11576
11635
  const page = Number.parseInt(e.detail.value);
11577
11636
  e.stopPropagation();
11578
11637
 
11579
- if (isNaN(page)) {
11580
- return;
11581
- }
11582
-
11583
11638
  hiddenEl.dispatchEvent(new CustomEvent("_change",
11584
11639
  {
11585
11640
  composed: true,
@@ -11612,10 +11667,10 @@ function instance$d($$self, $$props, $$invalidate) {
11612
11667
  });
11613
11668
  }
11614
11669
 
11615
- function goa_input_binding($$value) {
11670
+ function goa_dropdown_binding($$value) {
11616
11671
  binding_callbacks[$$value ? 'unshift' : 'push'](() => {
11617
- inputEl = $$value;
11618
- $$invalidate(6, inputEl);
11672
+ pageDropdownEl = $$value;
11673
+ $$invalidate(6, pageDropdownEl);
11619
11674
  });
11620
11675
  }
11621
11676
 
@@ -11647,14 +11702,14 @@ function instance$d($$self, $$props, $$invalidate) {
11647
11702
  mr,
11648
11703
  mb,
11649
11704
  ml,
11650
- inputEl,
11705
+ pageDropdownEl,
11651
11706
  hiddenEl,
11652
11707
  _pageCount,
11653
11708
  goto,
11654
11709
  itemcount,
11655
11710
  perpagecount,
11656
11711
  input_binding,
11657
- goa_input_binding,
11712
+ goa_dropdown_binding,
11658
11713
  click_handler,
11659
11714
  click_handler_1
11660
11715
  ];