@abgov/web-components 1.14.0-alpha.2 → 1.15.0-alpha.1
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/html.html-data.json +1 -1
- package/package.json +1 -1
- package/web-components.es.js +95 -69
- package/web-components.umd.js +46 -46
package/web-components.es.js
CHANGED
|
@@ -9163,7 +9163,8 @@ function create_if_block_2$9(ctx) {
|
|
|
9163
9163
|
let div;
|
|
9164
9164
|
let t0;
|
|
9165
9165
|
let t1;
|
|
9166
|
-
let show_if = /*requirement*/ ctx[
|
|
9166
|
+
let show_if = /*requirement*/ ctx[9] && /*REQUIREMENT_TYPES*/ ctx[11].includes(/*requirement*/ ctx[9]);
|
|
9167
|
+
let div_class_value;
|
|
9167
9168
|
let if_block = show_if && create_if_block_3$9(ctx);
|
|
9168
9169
|
|
|
9169
9170
|
return {
|
|
@@ -9172,8 +9173,8 @@ function create_if_block_2$9(ctx) {
|
|
|
9172
9173
|
t0 = text(/*label*/ ctx[5]);
|
|
9173
9174
|
t1 = space();
|
|
9174
9175
|
if (if_block) if_block.c();
|
|
9175
|
-
attr(div, "class",
|
|
9176
|
-
attr(div, "id", /*id*/ ctx[
|
|
9176
|
+
attr(div, "class", div_class_value = `label ${/*labelsize*/ ctx[6]}`);
|
|
9177
|
+
attr(div, "id", /*id*/ ctx[10]);
|
|
9177
9178
|
},
|
|
9178
9179
|
m(target, anchor) {
|
|
9179
9180
|
insert(target, div, anchor);
|
|
@@ -9183,7 +9184,7 @@ function create_if_block_2$9(ctx) {
|
|
|
9183
9184
|
},
|
|
9184
9185
|
p(ctx, dirty) {
|
|
9185
9186
|
if (dirty & /*label*/ 32) set_data(t0, /*label*/ ctx[5]);
|
|
9186
|
-
if (dirty & /*requirement*/
|
|
9187
|
+
if (dirty & /*requirement*/ 512) show_if = /*requirement*/ ctx[9] && /*REQUIREMENT_TYPES*/ ctx[11].includes(/*requirement*/ ctx[9]);
|
|
9187
9188
|
|
|
9188
9189
|
if (show_if) {
|
|
9189
9190
|
if (if_block) {
|
|
@@ -9198,8 +9199,12 @@ function create_if_block_2$9(ctx) {
|
|
|
9198
9199
|
if_block = null;
|
|
9199
9200
|
}
|
|
9200
9201
|
|
|
9201
|
-
if (dirty & /*
|
|
9202
|
-
attr(div, "
|
|
9202
|
+
if (dirty & /*labelsize*/ 64 && div_class_value !== (div_class_value = `label ${/*labelsize*/ ctx[6]}`)) {
|
|
9203
|
+
attr(div, "class", div_class_value);
|
|
9204
|
+
}
|
|
9205
|
+
|
|
9206
|
+
if (dirty & /*id*/ 1024) {
|
|
9207
|
+
attr(div, "id", /*id*/ ctx[10]);
|
|
9203
9208
|
}
|
|
9204
9209
|
},
|
|
9205
9210
|
d(detaching) {
|
|
@@ -9209,7 +9214,7 @@ function create_if_block_2$9(ctx) {
|
|
|
9209
9214
|
};
|
|
9210
9215
|
}
|
|
9211
9216
|
|
|
9212
|
-
// (
|
|
9217
|
+
// (37:6) {#if requirement && REQUIREMENT_TYPES.includes(requirement)}
|
|
9213
9218
|
function create_if_block_3$9(ctx) {
|
|
9214
9219
|
let em;
|
|
9215
9220
|
let t0;
|
|
@@ -9220,7 +9225,7 @@ function create_if_block_3$9(ctx) {
|
|
|
9220
9225
|
c() {
|
|
9221
9226
|
em = element("em");
|
|
9222
9227
|
t0 = text("(");
|
|
9223
|
-
t1 = text(/*requirement*/ ctx[
|
|
9228
|
+
t1 = text(/*requirement*/ ctx[9]);
|
|
9224
9229
|
t2 = text(")");
|
|
9225
9230
|
},
|
|
9226
9231
|
m(target, anchor) {
|
|
@@ -9230,7 +9235,7 @@ function create_if_block_3$9(ctx) {
|
|
|
9230
9235
|
append(em, t2);
|
|
9231
9236
|
},
|
|
9232
9237
|
p(ctx, dirty) {
|
|
9233
|
-
if (dirty & /*requirement*/
|
|
9238
|
+
if (dirty & /*requirement*/ 512) set_data(t1, /*requirement*/ ctx[9]);
|
|
9234
9239
|
},
|
|
9235
9240
|
d(detaching) {
|
|
9236
9241
|
if (detaching) detach(em);
|
|
@@ -9238,7 +9243,7 @@ function create_if_block_3$9(ctx) {
|
|
|
9238
9243
|
};
|
|
9239
9244
|
}
|
|
9240
9245
|
|
|
9241
|
-
// (
|
|
9246
|
+
// (45:2) {#if error}
|
|
9242
9247
|
function create_if_block_1$b(ctx) {
|
|
9243
9248
|
let div;
|
|
9244
9249
|
let goa_icon;
|
|
@@ -9250,7 +9255,7 @@ function create_if_block_1$b(ctx) {
|
|
|
9250
9255
|
div = element("div");
|
|
9251
9256
|
goa_icon = element("goa-icon");
|
|
9252
9257
|
t0 = space();
|
|
9253
|
-
t1 = text(/*error*/ ctx[
|
|
9258
|
+
t1 = text(/*error*/ ctx[8]);
|
|
9254
9259
|
set_custom_element_data(goa_icon, "type", "warning");
|
|
9255
9260
|
set_custom_element_data(goa_icon, "size", "small");
|
|
9256
9261
|
set_custom_element_data(goa_icon, "theme", "filled");
|
|
@@ -9264,7 +9269,7 @@ function create_if_block_1$b(ctx) {
|
|
|
9264
9269
|
append(div, t1);
|
|
9265
9270
|
},
|
|
9266
9271
|
p(ctx, dirty) {
|
|
9267
|
-
if (dirty & /*error*/
|
|
9272
|
+
if (dirty & /*error*/ 256) set_data(t1, /*error*/ ctx[8]);
|
|
9268
9273
|
},
|
|
9269
9274
|
d(detaching) {
|
|
9270
9275
|
if (detaching) detach(div);
|
|
@@ -9272,7 +9277,7 @@ function create_if_block_1$b(ctx) {
|
|
|
9272
9277
|
};
|
|
9273
9278
|
}
|
|
9274
9279
|
|
|
9275
|
-
// (
|
|
9280
|
+
// (51:2) {#if helptext}
|
|
9276
9281
|
function create_if_block$l(ctx) {
|
|
9277
9282
|
let div;
|
|
9278
9283
|
let t;
|
|
@@ -9280,7 +9285,7 @@ function create_if_block$l(ctx) {
|
|
|
9280
9285
|
return {
|
|
9281
9286
|
c() {
|
|
9282
9287
|
div = element("div");
|
|
9283
|
-
t = text(/*helptext*/ ctx[
|
|
9288
|
+
t = text(/*helptext*/ ctx[7]);
|
|
9284
9289
|
attr(div, "class", "help-msg");
|
|
9285
9290
|
},
|
|
9286
9291
|
m(target, anchor) {
|
|
@@ -9288,7 +9293,7 @@ function create_if_block$l(ctx) {
|
|
|
9288
9293
|
append(div, t);
|
|
9289
9294
|
},
|
|
9290
9295
|
p(ctx, dirty) {
|
|
9291
|
-
if (dirty & /*helptext*/
|
|
9296
|
+
if (dirty & /*helptext*/ 128) set_data(t, /*helptext*/ ctx[7]);
|
|
9292
9297
|
},
|
|
9293
9298
|
d(detaching) {
|
|
9294
9299
|
if (detaching) detach(div);
|
|
@@ -9304,8 +9309,8 @@ function create_fragment$B(ctx) {
|
|
|
9304
9309
|
let t2;
|
|
9305
9310
|
let div1_style_value;
|
|
9306
9311
|
let if_block0 = /*label*/ ctx[5] && create_if_block_2$9(ctx);
|
|
9307
|
-
let if_block1 = /*error*/ ctx[
|
|
9308
|
-
let if_block2 = /*helptext*/ ctx[
|
|
9312
|
+
let if_block1 = /*error*/ ctx[8] && create_if_block_1$b(ctx);
|
|
9313
|
+
let if_block2 = /*helptext*/ ctx[7] && create_if_block$l(ctx);
|
|
9309
9314
|
|
|
9310
9315
|
return {
|
|
9311
9316
|
c() {
|
|
@@ -9348,7 +9353,7 @@ function create_fragment$B(ctx) {
|
|
|
9348
9353
|
if_block0 = null;
|
|
9349
9354
|
}
|
|
9350
9355
|
|
|
9351
|
-
if (/*error*/ ctx[
|
|
9356
|
+
if (/*error*/ ctx[8]) {
|
|
9352
9357
|
if (if_block1) {
|
|
9353
9358
|
if_block1.p(ctx, dirty);
|
|
9354
9359
|
} else {
|
|
@@ -9361,7 +9366,7 @@ function create_fragment$B(ctx) {
|
|
|
9361
9366
|
if_block1 = null;
|
|
9362
9367
|
}
|
|
9363
9368
|
|
|
9364
|
-
if (/*helptext*/ ctx[
|
|
9369
|
+
if (/*helptext*/ ctx[7]) {
|
|
9365
9370
|
if (if_block2) {
|
|
9366
9371
|
if_block2.p(ctx, dirty);
|
|
9367
9372
|
} else {
|
|
@@ -9401,6 +9406,7 @@ function instance$y($$self, $$props, $$invalidate) {
|
|
|
9401
9406
|
let { mb = null } = $$props;
|
|
9402
9407
|
let { ml = null } = $$props;
|
|
9403
9408
|
let { label = "" } = $$props;
|
|
9409
|
+
let { labelsize = "regular" } = $$props;
|
|
9404
9410
|
let { helptext = "" } = $$props;
|
|
9405
9411
|
let { error = "" } = $$props;
|
|
9406
9412
|
let { requirement = "" } = $$props;
|
|
@@ -9417,10 +9423,11 @@ function instance$y($$self, $$props, $$invalidate) {
|
|
|
9417
9423
|
if ('mb' in $$props) $$invalidate(3, mb = $$props.mb);
|
|
9418
9424
|
if ('ml' in $$props) $$invalidate(4, ml = $$props.ml);
|
|
9419
9425
|
if ('label' in $$props) $$invalidate(5, label = $$props.label);
|
|
9420
|
-
if ('
|
|
9421
|
-
if ('
|
|
9422
|
-
if ('
|
|
9423
|
-
if ('
|
|
9426
|
+
if ('labelsize' in $$props) $$invalidate(6, labelsize = $$props.labelsize);
|
|
9427
|
+
if ('helptext' in $$props) $$invalidate(7, helptext = $$props.helptext);
|
|
9428
|
+
if ('error' in $$props) $$invalidate(8, error = $$props.error);
|
|
9429
|
+
if ('requirement' in $$props) $$invalidate(9, requirement = $$props.requirement);
|
|
9430
|
+
if ('id' in $$props) $$invalidate(10, id = $$props.id);
|
|
9424
9431
|
};
|
|
9425
9432
|
|
|
9426
9433
|
return [
|
|
@@ -9430,6 +9437,7 @@ function instance$y($$self, $$props, $$invalidate) {
|
|
|
9430
9437
|
mb,
|
|
9431
9438
|
ml,
|
|
9432
9439
|
label,
|
|
9440
|
+
labelsize,
|
|
9433
9441
|
helptext,
|
|
9434
9442
|
error,
|
|
9435
9443
|
requirement,
|
|
@@ -9442,7 +9450,7 @@ class FormItem extends SvelteElement {
|
|
|
9442
9450
|
constructor(options) {
|
|
9443
9451
|
super();
|
|
9444
9452
|
const style = document.createElement('style');
|
|
9445
|
-
style.textContent = `:host{box-sizing:border-box;font-family:var(--goa-font-family-sans)}*{box-sizing:border-box}.label{display:block;font-weight:var(--goa-font-weight-bold);color:var(--goa-color-text-default);font-size:var(--goa-font-size-4);padding:0.5rem 0}.label em{color:var(--goa-color-greyscale-700);font-weight:var(--goa-font-weight-regular);font-size:var(--goa-font-size-2);line-height:var(--goa-line-height-1);font-style:normal}.form-item-input{margin-bottom:0.25rem}.help-msg{font-size:var(--goa-font-size-2);color:var(--goa-color-text-default);margin-right:56px}.error-msg{display:inline-flex;gap:0.25rem;font-size:var(--goa-font-size-2);color:var(--goa-color-interactive-error);margin-bottom:0.25rem}`;
|
|
9453
|
+
style.textContent = `:host{box-sizing:border-box;font-family:var(--goa-font-family-sans)}*{box-sizing:border-box}.label{display:block;font-weight:var(--goa-font-weight-bold);color:var(--goa-color-text-default);font-size:var(--goa-font-size-4);padding:0.5rem 0}.label.large{font:var(--goa-typography-heading-l)}.label em{color:var(--goa-color-greyscale-700);font-weight:var(--goa-font-weight-regular);font-size:var(--goa-font-size-2);line-height:var(--goa-line-height-1);font-style:normal}.form-item-input{margin-bottom:0.25rem}.help-msg{font-size:var(--goa-font-size-2);color:var(--goa-color-text-default);margin-right:56px}.error-msg{display:inline-flex;gap:0.25rem;font-size:var(--goa-font-size-2);color:var(--goa-color-interactive-error);margin-bottom:0.25rem}`;
|
|
9446
9454
|
this.shadowRoot.appendChild(style);
|
|
9447
9455
|
|
|
9448
9456
|
init(
|
|
@@ -9462,10 +9470,11 @@ class FormItem extends SvelteElement {
|
|
|
9462
9470
|
mb: 3,
|
|
9463
9471
|
ml: 4,
|
|
9464
9472
|
label: 5,
|
|
9465
|
-
|
|
9466
|
-
|
|
9467
|
-
|
|
9468
|
-
|
|
9473
|
+
labelsize: 6,
|
|
9474
|
+
helptext: 7,
|
|
9475
|
+
error: 8,
|
|
9476
|
+
requirement: 9,
|
|
9477
|
+
id: 10
|
|
9469
9478
|
},
|
|
9470
9479
|
null
|
|
9471
9480
|
);
|
|
@@ -9490,6 +9499,7 @@ class FormItem extends SvelteElement {
|
|
|
9490
9499
|
"mb",
|
|
9491
9500
|
"ml",
|
|
9492
9501
|
"label",
|
|
9502
|
+
"labelsize",
|
|
9493
9503
|
"helptext",
|
|
9494
9504
|
"error",
|
|
9495
9505
|
"requirement",
|
|
@@ -9551,17 +9561,26 @@ class FormItem extends SvelteElement {
|
|
|
9551
9561
|
flush();
|
|
9552
9562
|
}
|
|
9553
9563
|
|
|
9554
|
-
get
|
|
9564
|
+
get labelsize() {
|
|
9555
9565
|
return this.$$.ctx[6];
|
|
9556
9566
|
}
|
|
9557
9567
|
|
|
9568
|
+
set labelsize(labelsize) {
|
|
9569
|
+
this.$$set({ labelsize });
|
|
9570
|
+
flush();
|
|
9571
|
+
}
|
|
9572
|
+
|
|
9573
|
+
get helptext() {
|
|
9574
|
+
return this.$$.ctx[7];
|
|
9575
|
+
}
|
|
9576
|
+
|
|
9558
9577
|
set helptext(helptext) {
|
|
9559
9578
|
this.$$set({ helptext });
|
|
9560
9579
|
flush();
|
|
9561
9580
|
}
|
|
9562
9581
|
|
|
9563
9582
|
get error() {
|
|
9564
|
-
return this.$$.ctx[
|
|
9583
|
+
return this.$$.ctx[8];
|
|
9565
9584
|
}
|
|
9566
9585
|
|
|
9567
9586
|
set error(error) {
|
|
@@ -9570,7 +9589,7 @@ class FormItem extends SvelteElement {
|
|
|
9570
9589
|
}
|
|
9571
9590
|
|
|
9572
9591
|
get requirement() {
|
|
9573
|
-
return this.$$.ctx[
|
|
9592
|
+
return this.$$.ctx[9];
|
|
9574
9593
|
}
|
|
9575
9594
|
|
|
9576
9595
|
set requirement(requirement) {
|
|
@@ -9579,7 +9598,7 @@ class FormItem extends SvelteElement {
|
|
|
9579
9598
|
}
|
|
9580
9599
|
|
|
9581
9600
|
get id() {
|
|
9582
|
-
return this.$$.ctx[
|
|
9601
|
+
return this.$$.ctx[10];
|
|
9583
9602
|
}
|
|
9584
9603
|
|
|
9585
9604
|
set id(id) {
|
|
@@ -16622,7 +16641,7 @@ function create_else_block$6(ctx) {
|
|
|
16622
16641
|
};
|
|
16623
16642
|
}
|
|
16624
16643
|
|
|
16625
|
-
// (
|
|
16644
|
+
// (85:2) {#if _isTableRoot}
|
|
16626
16645
|
function create_if_block$a(ctx) {
|
|
16627
16646
|
let slot;
|
|
16628
16647
|
|
|
@@ -16754,49 +16773,56 @@ function instance$h($$self, $$props, $$invalidate) {
|
|
|
16754
16773
|
});
|
|
16755
16774
|
|
|
16756
16775
|
async function attachSortEventHandling() {
|
|
16776
|
+
var _a;
|
|
16757
16777
|
await tick();
|
|
16758
|
-
const
|
|
16759
|
-
|
|
16760
|
-
headings.forEach(heading => {
|
|
16761
|
-
heading.addEventListener("click", () => {
|
|
16762
|
-
const sortBy = heading.getAttribute("name");
|
|
16763
|
-
let sortDir;
|
|
16778
|
+
const contentSlot = _rootEl.querySelector("slot");
|
|
16764
16779
|
|
|
16765
|
-
|
|
16766
|
-
|
|
16767
|
-
|
|
16768
|
-
const direction = child["direction"];
|
|
16780
|
+
const headings = (_a = contentSlot.assignedElements().find(el => el.tagName === "THEAD" || el.tagName === "TABLE")) === null || _a === void 0
|
|
16781
|
+
? void 0
|
|
16782
|
+
: _a.querySelectorAll("goa-table-sort-header");
|
|
16769
16783
|
|
|
16770
|
-
|
|
16771
|
-
|
|
16784
|
+
headings === null || headings === void 0
|
|
16785
|
+
? void 0
|
|
16786
|
+
: headings.forEach(heading => {
|
|
16787
|
+
heading.addEventListener("click", () => {
|
|
16788
|
+
const sortBy = heading.getAttribute("name");
|
|
16789
|
+
let sortDir;
|
|
16790
|
+
|
|
16791
|
+
// relay state to all children
|
|
16792
|
+
headings.forEach(child => {
|
|
16793
|
+
if (child.getAttribute("name") === sortBy) {
|
|
16794
|
+
const direction = child["direction"];
|
|
16795
|
+
|
|
16796
|
+
// starting direction is asc
|
|
16797
|
+
const newDirection = direction === "asc" ? "desc" : "asc";
|
|
16798
|
+
|
|
16799
|
+
sortDir = newDirection === "asc" ? 1 : -1;
|
|
16800
|
+
child.setAttribute("direction", newDirection);
|
|
16801
|
+
} else {
|
|
16802
|
+
child.setAttribute("direction", "none");
|
|
16803
|
+
}
|
|
16804
|
+
});
|
|
16772
16805
|
|
|
16773
|
-
|
|
16774
|
-
child.setAttribute("direction", newDirection);
|
|
16775
|
-
} else {
|
|
16776
|
-
child.setAttribute("direction", "none");
|
|
16777
|
-
}
|
|
16806
|
+
dispatch(heading, { sortBy, sortDir });
|
|
16778
16807
|
});
|
|
16779
16808
|
|
|
16780
|
-
dispatch
|
|
16809
|
+
// dispatch the default sort params if initially set
|
|
16810
|
+
const initialSortBy = heading.getAttribute("name");
|
|
16811
|
+
|
|
16812
|
+
const initialDirection = heading["direction"];
|
|
16813
|
+
|
|
16814
|
+
if (initialDirection && initialDirection !== "none") {
|
|
16815
|
+
setTimeout(
|
|
16816
|
+
() => {
|
|
16817
|
+
dispatch(heading, {
|
|
16818
|
+
sortBy: initialSortBy,
|
|
16819
|
+
sortDir: initialDirection === "asc" ? 1 : -1
|
|
16820
|
+
});
|
|
16821
|
+
},
|
|
16822
|
+
10
|
|
16823
|
+
);
|
|
16824
|
+
}
|
|
16781
16825
|
});
|
|
16782
|
-
|
|
16783
|
-
// dispatch the default sort params if initially set
|
|
16784
|
-
const initialSortBy = heading.getAttribute("name");
|
|
16785
|
-
|
|
16786
|
-
const initialDirection = heading["direction"];
|
|
16787
|
-
|
|
16788
|
-
if (initialDirection && initialDirection !== "none") {
|
|
16789
|
-
setTimeout(
|
|
16790
|
-
() => {
|
|
16791
|
-
dispatch(heading, {
|
|
16792
|
-
sortBy: initialSortBy,
|
|
16793
|
-
sortDir: initialDirection === "asc" ? 1 : -1
|
|
16794
|
-
});
|
|
16795
|
-
},
|
|
16796
|
-
10
|
|
16797
|
-
);
|
|
16798
|
-
}
|
|
16799
|
-
});
|
|
16800
16826
|
}
|
|
16801
16827
|
|
|
16802
16828
|
function div_binding($$value) {
|