@gov-design-system-ce/components 4.0.8-rc12 → 4.0.8-rc14
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/dist/cjs/core.cjs.js +1 -1
- package/dist/cjs/gov-form-input.cjs.entry.js +4 -3
- package/dist/cjs/gov-form-input.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-icon.cjs.entry.js +1 -1
- package/dist/cjs/gov-pagination.cjs.entry.js +3 -1
- package/dist/cjs/gov-pagination.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-tabs-item.cjs.entry.js +12 -1
- package/dist/cjs/gov-tabs-item.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-tabs.cjs.entry.js +33 -41
- package/dist/cjs/gov-tabs.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-tooltip.cjs.entry.js +6 -4
- package/dist/cjs/gov-tooltip.cjs.entry.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/gov-form/input/gov-form-input.js +22 -4
- package/dist/collection/components/gov-form/input/gov-form-input.js.map +1 -1
- package/dist/collection/components/gov-pagination/gov-pagination.js +20 -1
- package/dist/collection/components/gov-pagination/gov-pagination.js.map +1 -1
- package/dist/collection/components/gov-tabs/gov-tabs-item.js +20 -2
- package/dist/collection/components/gov-tabs/gov-tabs-item.js.map +1 -1
- package/dist/collection/components/gov-tabs/gov-tabs.js +52 -43
- package/dist/collection/components/gov-tabs/gov-tabs.js.map +1 -1
- package/dist/collection/components/gov-tooltip/gov-tooltip.js +6 -4
- package/dist/collection/components/gov-tooltip/gov-tooltip.js.map +1 -1
- package/dist/components/gov-accordion-item.js +1 -1
- package/dist/components/gov-attachments-item.js +1 -1
- package/dist/components/gov-breadcrumbs.js +1 -1
- package/dist/components/gov-button.js +1 -1
- package/dist/components/gov-card.js +1 -1
- package/dist/components/gov-chip.js +1 -1
- package/dist/components/gov-form-autocomplete.js +1 -1
- package/dist/components/gov-form-checkbox.js +1 -1
- package/dist/components/gov-form-file.js +1 -1
- package/dist/components/gov-form-input.js +1 -1
- package/dist/components/gov-form-multi-select.js +1 -1
- package/dist/components/gov-form-select.js +1 -1
- package/dist/components/gov-icon.js +1 -1
- package/dist/components/gov-infobar.js +1 -1
- package/dist/components/gov-loading.js +1 -1
- package/dist/components/gov-modal.js +1 -1
- package/dist/components/gov-pagination.js +1 -1
- package/dist/components/gov-pagination.js.map +1 -1
- package/dist/components/gov-prompt.js +1 -1
- package/dist/components/gov-side-nav-item.js +1 -1
- package/dist/components/gov-tabs-item.js +1 -1
- package/dist/components/gov-tabs-item.js.map +1 -1
- package/dist/components/gov-tabs.js +1 -1
- package/dist/components/gov-tabs.js.map +1 -1
- package/dist/components/gov-tag.js +1 -1
- package/dist/components/gov-toast.js +1 -1
- package/dist/components/gov-tooltip-content.js +1 -1
- package/dist/components/gov-tooltip.js +1 -1
- package/dist/components/gov-tooltip.js.map +1 -1
- package/dist/components/gov-wizard-item.js +1 -1
- package/dist/components/{p-6b70bb05.js → p-206c135b.js} +2 -2
- package/dist/components/p-206c135b.js.map +1 -0
- package/dist/components/{p-44f0bc16.js → p-3b224410.js} +2 -2
- package/dist/components/{p-93748f78.js → p-65aa0e09.js} +2 -2
- package/dist/components/{p-4fa21d88.js → p-a2604cc2.js} +2 -2
- package/dist/components/{p-f5db4029.js → p-aae934b8.js} +2 -2
- package/dist/components/{p-24033114.js → p-b322d172.js} +2 -2
- package/dist/components/{p-659a5e9b.js → p-da84987f.js} +2 -2
- package/dist/core/core.esm.js +1 -1
- package/dist/core/core.esm.js.map +1 -1
- package/dist/core/{p-7b210966.entry.js → p-0d99a3d8.entry.js} +2 -2
- package/dist/core/p-0d99a3d8.entry.js.map +1 -0
- package/dist/core/p-31a7316b.entry.js +2 -0
- package/dist/core/p-31a7316b.entry.js.map +1 -0
- package/dist/core/p-56d42f3e.entry.js +2 -0
- package/dist/core/p-56d42f3e.entry.js.map +1 -0
- package/dist/core/{p-ea506584.entry.js → p-595737c1.entry.js} +2 -2
- package/dist/core/p-618df4db.entry.js +2 -0
- package/dist/core/p-618df4db.entry.js.map +1 -0
- package/dist/core/{p-6def30bc.entry.js → p-aa9b5731.entry.js} +2 -2
- package/dist/core/p-aa9b5731.entry.js.map +1 -0
- package/dist/esm/core.js +1 -1
- package/dist/esm/gov-form-input.entry.js +4 -3
- package/dist/esm/gov-form-input.entry.js.map +1 -1
- package/dist/esm/gov-icon.entry.js +1 -1
- package/dist/esm/gov-pagination.entry.js +3 -1
- package/dist/esm/gov-pagination.entry.js.map +1 -1
- package/dist/esm/gov-tabs-item.entry.js +13 -2
- package/dist/esm/gov-tabs-item.entry.js.map +1 -1
- package/dist/esm/gov-tabs.entry.js +34 -42
- package/dist/esm/gov-tabs.entry.js.map +1 -1
- package/dist/esm/gov-tooltip.entry.js +6 -4
- package/dist/esm/gov-tooltip.entry.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/hydrate/index.js +62 -51
- package/dist/hydrate/index.mjs +62 -51
- package/dist/types/components/gov-form/input/gov-form-input.d.ts +5 -1
- package/dist/types/components/gov-pagination/gov-pagination.d.ts +5 -0
- package/dist/types/components/gov-tabs/gov-tabs-item.d.ts +1 -0
- package/dist/types/components/gov-tabs/gov-tabs.d.ts +6 -4
- package/dist/types/components/gov-tooltip/gov-tooltip.d.ts +1 -0
- package/dist/types/components.d.ts +22 -2
- package/package.json +1 -1
- package/dist/components/p-6b70bb05.js.map +0 -1
- package/dist/core/p-24e32e0f.entry.js +0 -2
- package/dist/core/p-24e32e0f.entry.js.map +0 -1
- package/dist/core/p-6def30bc.entry.js.map +0 -1
- package/dist/core/p-7a0b3094.entry.js +0 -2
- package/dist/core/p-7a0b3094.entry.js.map +0 -1
- package/dist/core/p-7b210966.entry.js.map +0 -1
- package/dist/core/p-9ae7429a.entry.js +0 -2
- package/dist/core/p-9ae7429a.entry.js.map +0 -1
- /package/dist/components/{p-44f0bc16.js.map → p-3b224410.js.map} +0 -0
- /package/dist/components/{p-93748f78.js.map → p-65aa0e09.js.map} +0 -0
- /package/dist/components/{p-4fa21d88.js.map → p-a2604cc2.js.map} +0 -0
- /package/dist/components/{p-f5db4029.js.map → p-aae934b8.js.map} +0 -0
- /package/dist/components/{p-24033114.js.map → p-b322d172.js.map} +0 -0
- /package/dist/components/{p-659a5e9b.js.map → p-da84987f.js.map} +0 -0
- /package/dist/core/{p-ea506584.entry.js.map → p-595737c1.entry.js.map} +0 -0
package/dist/hydrate/index.js
CHANGED
|
@@ -4873,6 +4873,7 @@ class GovFormInput {
|
|
|
4873
4873
|
this.autocomplete = undefined;
|
|
4874
4874
|
this.autocorrect = undefined;
|
|
4875
4875
|
this.spellcheck = undefined;
|
|
4876
|
+
this.inputLang = undefined;
|
|
4876
4877
|
this.type = undefined;
|
|
4877
4878
|
this.inputType = "text";
|
|
4878
4879
|
this.role = undefined;
|
|
@@ -4918,9 +4919,9 @@ class GovFormInput {
|
|
|
4918
4919
|
}
|
|
4919
4920
|
render() {
|
|
4920
4921
|
const Tag = this.multiline ? Tags$1.TEXTAREA : Tags$1.INPUT;
|
|
4921
|
-
return (hAsync(Host, { key: '
|
|
4922
|
-
hAsync("gov-icon", { key: '
|
|
4923
|
-
hAsync("gov-icon", { key: '
|
|
4922
|
+
return (hAsync(Host, { key: '1d217855ba964b9c637373529e2b677fb09f8034', class: FormInputClass.root, size: this.size, variant: this.variant, type: this.type }, this.h.hasSlot("prefix") && hAsync("slot", { key: '75b989d2f4b70cf43e9a5315fdb6eb56af832118', name: "prefix" }), hAsync("span", { key: '39f063be627ad300abe364adfa4a32b79a879773', class: "element" }, this.h.hasSlot("left-icon") && hAsync("slot", { key: '84da6d8d05274f5a9760b871ffb89dec870122f8', name: "left-icon" }), this.h.hasSlot("right-icon") && !(this.success || this.invalid) && hAsync("slot", { key: 'b8ede08c703cc88e526593cb5aac4a868293543c', name: "right-icon" }), this.success && !this.multiline &&
|
|
4923
|
+
hAsync("gov-icon", { key: '1dad15f0bbab72fef2f2d596fb2ce27b097eb3a4', slot: "right-icon", class: "icon-validation", name: "check-lg" }), this.invalid && !this.multiline &&
|
|
4924
|
+
hAsync("gov-icon", { key: '9d8ed110a2640133ecc462c6b06f1f5496fb61f7', slot: "right-icon", class: "icon-validation", name: "exclamation-lg" }), hAsync(Tag, { key: '62ac8ee0c14c5289c377685fabf535947a43f4c5', type: this.inputType, disabled: this.disabled, id: this.identifier || this.inputId, name: this.name, onFocus: this.onFocusHandler.bind(this), onInput: this.onInputHandler.bind(this), onBlur: this.onBlurHandler.bind(this), onKeyUp: this.onKeyUpHandler.bind(this), onKeyDown: this.onKeyDownHandler.bind(this), ref: el => (this.inputRef = el), placeholder: this.placeholder, value: this.value, spellcheck: toBoolAttrIfDefined(this.spellcheck), lang: this.inputLang, readonly: toBoolAttrIfDefined(this.readonly), autocomplete: toOnOffAttrIfDefined(this.autocomplete), autocorrect: toOnOffAttrIfDefined(this.autocorrect), minlength: this.minlength, maxlength: this.maxlength, min: this.min, max: this.max, required: this.required, rows: this.rows, cols: this.cols, role: this.role, "aria-required": toBoolAttrIfDefined(this.required), "aria-invalid": toBoolAttrIfDefined(this.invalid), "aria-disabled": toBoolAttrIfDefined(this.disabled), "aria-describedby": this.wcagDescribedBy, "aria-labelledby": this.wcagLabelledBy, "aria-owns": this.wcagOwns, "aria-expanded": toBoolAttrIfDefined(this.wcagExpanded), "aria-autocomplete": this.wcagAutocomplete })), this.h.hasSlot("sufix") && hAsync("slot", { key: '9746bac959c672b37d1c5529cbbe0da13ecf4ce8', name: "sufix" })));
|
|
4924
4925
|
}
|
|
4925
4926
|
onFocusHandler(e) {
|
|
4926
4927
|
e.stopPropagation();
|
|
@@ -5032,6 +5033,7 @@ class GovFormInput {
|
|
|
5032
5033
|
"autocomplete": [4],
|
|
5033
5034
|
"autocorrect": [4],
|
|
5034
5035
|
"spellcheck": [4],
|
|
5036
|
+
"inputLang": [1, "input-lang"],
|
|
5035
5037
|
"type": [1],
|
|
5036
5038
|
"inputType": [1, "input-type"],
|
|
5037
5039
|
"role": [1],
|
|
@@ -6690,6 +6692,7 @@ class GovPagination {
|
|
|
6690
6692
|
this.current = 1;
|
|
6691
6693
|
this.total = 0;
|
|
6692
6694
|
this.inverse = undefined;
|
|
6695
|
+
this.selectIdentifier = undefined;
|
|
6693
6696
|
this.size = "m";
|
|
6694
6697
|
this.variant = "primary";
|
|
6695
6698
|
this.pageSize = 10;
|
|
@@ -6706,6 +6709,7 @@ class GovPagination {
|
|
|
6706
6709
|
this.pagination = undefined;
|
|
6707
6710
|
this.h = govHost(this.host);
|
|
6708
6711
|
this.pageSelectId = createID("GovPageSelect");
|
|
6712
|
+
this.selectId = createID("GovSelect");
|
|
6709
6713
|
}
|
|
6710
6714
|
validateType(newValue) {
|
|
6711
6715
|
validateProp(PaginationTypes, newValue, PaginationClass.root);
|
|
@@ -6761,7 +6765,7 @@ class GovPagination {
|
|
|
6761
6765
|
const ariaCurrent = toBoolAttrIfDefined(this.pagination.currentPage === page ? true : undefined);
|
|
6762
6766
|
return (hAsync("gov-button", { href: this.prepareLinkUrl(page), variant: this.variant, size: this.size, type: "base", disabled: isDisabled, "on-gov-click": (e) => this.onClickHandler(e, page), "wcag-label": description ? description : page > -1 ? this.wcagPageLabel + " " + page : undefined, "wcag-current": ariaCurrent, class: PaginationClass.inner }, content));
|
|
6763
6767
|
};
|
|
6764
|
-
return (hAsync(Host, { class: this.h.classes(PaginationClass.root), type: this.type, variant: this.variant, size: this.size }, hAsync("nav", { "aria-label": this.wcagLabel, "aria-labelledby": this.wcagLabelledBy }, hAsync("ul", { class: PaginationClass.list }, hAsync("li", { class: prepareClasses([PaginationClass.item, PaginationClass.itemArrow]) }, pageResolver(this.pagination.currentPage > 1 ? 1 : -1, hAsync("gov-icon", { class: PaginationClass.arrow, name: "chevron-double-left" }), this.labelStart)), hAsync("li", { class: prepareClasses([PaginationClass.item, PaginationClass.itemArrow]) }, pageResolver(this.pagination.startPage < this.pagination.currentPage ? this.pagination.currentPage - 1 : -1, hAsync("gov-icon", { class: PaginationClass.arrow, name: "chevron-left" }), this.labelPrev)), this.type == "select" ? (hAsync("li", { class: prepareClasses([PaginationClass.item, PaginationClass.itemSelect]) }, hAsync("span", { class: PaginationClass.inner }, hAsync("span", { id: this.pageSelectId, hidden: true }, this.wcagSelectLabel), hAsync("gov-form-select", { size: this.size, variant: this.variant, "wcag-labelled-by": this.pageSelectId, "on-gov-change": this.onSelectHandler.bind(this) }, createArrayRange(1, this.pagination.totalPages).map(page => (hAsync("option", { value: page, selected: this.pagination.currentPage === page }, page))))))) : (hAsync(Fragment, null, this.pagination.pages.map(page => (hAsync("li", { class: this.isActivePageClass(PaginationClass.item, page) }, pageResolver(page, page, '')))), this.pagination.totalPages ? (hAsync("li", { class: prepareClasses([PaginationClass.item, PaginationClass.itemMore]) }, hAsync("span", { class: PaginationClass.inner }, hAsync("span", { id: this.pageSelectId, hidden: true }, this.wcagSelectLabel), hAsync("gov-form-select", { size: this.size, variant: this.variant, "wcag-labelled-by": this.pageSelectId, ref: el => (this.spreadSelectRef = el), "on-gov-change": this.onSelectHandler.bind(this) }, hAsync("option", { selected: true, hidden: true }, "..."), createArrayRange(1, this.pagination.totalPages).map(page => (hAsync("option", { value: page, selected: false }, page))))))) : null)), hAsync("li", { class: prepareClasses([PaginationClass.item, PaginationClass.itemArrow]) }, pageResolver(this.pagination.totalPages > this.pagination.currentPage ? this.pagination.currentPage + 1 : -1, hAsync("gov-icon", { class: PaginationClass.arrow, name: "chevron-right" }), this.labelNext)), hAsync("li", { class: prepareClasses([PaginationClass.item, PaginationClass.itemArrow]) }, pageResolver(this.pagination.totalPages > this.pagination.currentPage ? this.pagination.totalPages : -1, hAsync("gov-icon", { class: PaginationClass.arrow, name: "chevron-double-right" }), this.labelEnd))))));
|
|
6768
|
+
return (hAsync(Host, { class: this.h.classes(PaginationClass.root), type: this.type, variant: this.variant, size: this.size }, hAsync("nav", { "aria-label": this.wcagLabel, "aria-labelledby": this.wcagLabelledBy }, hAsync("ul", { class: PaginationClass.list }, hAsync("li", { class: prepareClasses([PaginationClass.item, PaginationClass.itemArrow]) }, pageResolver(this.pagination.currentPage > 1 ? 1 : -1, hAsync("gov-icon", { class: PaginationClass.arrow, name: "chevron-double-left" }), this.labelStart)), hAsync("li", { class: prepareClasses([PaginationClass.item, PaginationClass.itemArrow]) }, pageResolver(this.pagination.startPage < this.pagination.currentPage ? this.pagination.currentPage - 1 : -1, hAsync("gov-icon", { class: PaginationClass.arrow, name: "chevron-left" }), this.labelPrev)), this.type == "select" ? (hAsync("li", { class: prepareClasses([PaginationClass.item, PaginationClass.itemSelect]) }, hAsync("span", { class: PaginationClass.inner }, hAsync("span", { id: this.pageSelectId, hidden: true }, this.wcagSelectLabel), hAsync("gov-form-select", { size: this.size, variant: this.variant, identifier: this.selectIdentifier || this.selectId, "wcag-labelled-by": this.pageSelectId, "on-gov-change": this.onSelectHandler.bind(this) }, createArrayRange(1, this.pagination.totalPages).map(page => (hAsync("option", { value: page, selected: this.pagination.currentPage === page }, page))))))) : (hAsync(Fragment, null, this.pagination.pages.map(page => (hAsync("li", { class: this.isActivePageClass(PaginationClass.item, page) }, pageResolver(page, page, '')))), this.pagination.totalPages ? (hAsync("li", { class: prepareClasses([PaginationClass.item, PaginationClass.itemMore]) }, hAsync("span", { class: PaginationClass.inner }, hAsync("span", { id: this.pageSelectId, hidden: true }, this.wcagSelectLabel), hAsync("gov-form-select", { size: this.size, variant: this.variant, identifier: this.selectIdentifier || this.selectId, "wcag-labelled-by": this.pageSelectId, ref: el => (this.spreadSelectRef = el), "on-gov-change": this.onSelectHandler.bind(this) }, hAsync("option", { selected: true, hidden: true }, "..."), createArrayRange(1, this.pagination.totalPages).map(page => (hAsync("option", { value: page, selected: false }, page))))))) : null)), hAsync("li", { class: prepareClasses([PaginationClass.item, PaginationClass.itemArrow]) }, pageResolver(this.pagination.totalPages > this.pagination.currentPage ? this.pagination.currentPage + 1 : -1, hAsync("gov-icon", { class: PaginationClass.arrow, name: "chevron-right" }), this.labelNext)), hAsync("li", { class: prepareClasses([PaginationClass.item, PaginationClass.itemArrow]) }, pageResolver(this.pagination.totalPages > this.pagination.currentPage ? this.pagination.totalPages : -1, hAsync("gov-icon", { class: PaginationClass.arrow, name: "chevron-double-right" }), this.labelEnd))))));
|
|
6765
6769
|
}
|
|
6766
6770
|
onClickHandler(e, page) {
|
|
6767
6771
|
e.stopPropagation();
|
|
@@ -6815,6 +6819,7 @@ class GovPagination {
|
|
|
6815
6819
|
"current": [2],
|
|
6816
6820
|
"total": [2],
|
|
6817
6821
|
"inverse": [4],
|
|
6822
|
+
"selectIdentifier": [1, "select-identifier"],
|
|
6818
6823
|
"size": [1],
|
|
6819
6824
|
"variant": [1],
|
|
6820
6825
|
"pageSize": [2, "page-size"],
|
|
@@ -7560,7 +7565,7 @@ class GovTabs {
|
|
|
7560
7565
|
registerInstance(this, hostRef);
|
|
7561
7566
|
this.govChange = createEvent(this, "gov-change", 7);
|
|
7562
7567
|
this.triggerRefs = {};
|
|
7563
|
-
this.
|
|
7568
|
+
this.controllers = [];
|
|
7564
7569
|
this.focusIndex = 0;
|
|
7565
7570
|
this.compactControls = false;
|
|
7566
7571
|
this.type = "text";
|
|
@@ -7579,17 +7584,16 @@ class GovTabs {
|
|
|
7579
7584
|
validateProp(TabVariants, newValue, TabsClass.root);
|
|
7580
7585
|
}
|
|
7581
7586
|
componentWillLoad() {
|
|
7582
|
-
this.
|
|
7587
|
+
this.prepareControllers();
|
|
7583
7588
|
}
|
|
7584
7589
|
async componentDidRender() {
|
|
7585
7590
|
if (canValidateWcagOnRender()) {
|
|
7586
7591
|
await delay(500);
|
|
7587
7592
|
await this.validateWcag();
|
|
7588
7593
|
}
|
|
7589
|
-
this.resizeObserver();
|
|
7590
7594
|
}
|
|
7591
|
-
|
|
7592
|
-
this.
|
|
7595
|
+
prepareControllers() {
|
|
7596
|
+
this.controllers = [];
|
|
7593
7597
|
const promises = [];
|
|
7594
7598
|
this.host.querySelectorAll(TabsItemClass.root).forEach((tab) => {
|
|
7595
7599
|
const controlItem = Promise.all([
|
|
@@ -7611,49 +7615,36 @@ class GovTabs {
|
|
|
7611
7615
|
promises.push(controlItem);
|
|
7612
7616
|
});
|
|
7613
7617
|
Promise.all(promises).then(controllers => {
|
|
7614
|
-
let
|
|
7615
|
-
if (
|
|
7616
|
-
|
|
7617
|
-
this.focusIndex =
|
|
7618
|
-
controllers[
|
|
7619
|
-
this.
|
|
7618
|
+
let defaultTabIndex = controllers.findIndex(controller => controller.default);
|
|
7619
|
+
if (defaultTabIndex === -1)
|
|
7620
|
+
defaultTabIndex = 0;
|
|
7621
|
+
this.focusIndex = defaultTabIndex;
|
|
7622
|
+
controllers[defaultTabIndex].active = true;
|
|
7623
|
+
this.controllers = [...controllers];
|
|
7620
7624
|
this.reRender();
|
|
7621
7625
|
});
|
|
7622
7626
|
}
|
|
7623
7627
|
setActiveByIdentifier(identifier) {
|
|
7624
7628
|
const temp = [];
|
|
7625
|
-
this.
|
|
7629
|
+
this.controllers.map(item => {
|
|
7626
7630
|
item.active = identifier === item.triggerIdentifier || identifier === item.contentIdentifier;
|
|
7627
7631
|
temp.push(item);
|
|
7628
7632
|
});
|
|
7629
|
-
this.
|
|
7633
|
+
this.controllers = [...temp];
|
|
7630
7634
|
}
|
|
7631
7635
|
reRender() {
|
|
7632
|
-
this.
|
|
7633
|
-
control.element.setActiveStatus(control.active);
|
|
7636
|
+
this.controllers.map(control => {
|
|
7637
|
+
control.element.setActiveStatus(control.active).catch();
|
|
7634
7638
|
});
|
|
7635
7639
|
}
|
|
7636
|
-
/*
|
|
7637
|
-
private evaluateControls() {
|
|
7638
|
-
this.compactControls = false
|
|
7639
|
-
let sumOfWidth = this.tabsRef.querySelector("ul").offsetWidth
|
|
7640
|
-
this.compactControls = this.tabsRef.offsetWidth < sumOfWidth
|
|
7641
|
-
}
|
|
7642
|
-
*/
|
|
7643
|
-
resizeObserver() {
|
|
7644
|
-
const resizeObserver = new ResizeObserver(throttle(() => {
|
|
7645
|
-
// this.evaluateControls()
|
|
7646
|
-
}, 200));
|
|
7647
|
-
resizeObserver.observe(this.tabsRef);
|
|
7648
|
-
}
|
|
7649
7640
|
render() {
|
|
7650
|
-
return (hAsync(Host, { key: '
|
|
7641
|
+
return (hAsync(Host, { key: 'fa6bb0777c56edcb61f5acfa4cac75fae2f8bb78', class: this.h.classes(TabsClass.root), variant: this.variant, type: this.type, role: "tablist", "aria-label": this.wcagLabel, "aria-labelledby": this.wcagLabelledBy, onKeyDown: this.onKeydownHandler.bind(this) }, hAsync("div", { key: '3e764b20b9a1e3221232d7567e45acae8701a963', class: TabsClass.tabs, "aria-hidden": toBoolAttr(this.compactControls) }, hAsync("ul", { key: 'adedeb20cd2d5608502410f1b843ba6293000e7c', class: TabsClass.list }, this.controllers.map(control => (hAsync("li", { class: TabsClass.item }, this.type == "text" ? (hAsync("button", { class: TabsClass.btn, id: control.triggerIdentifier, role: "tab", onClick: () => this.onSelectHandler(control), disabled: control.disabled, "aria-disabled": toBoolAttr(control.disabled), "aria-selected": toBoolAttr(control.active), "aria-controls": control.contentIdentifier, tabindex: control.active && !control.disabled ? 0 : -1, ref: el => (this.triggerRefs[control.triggerIdentifier] = el) }, control.label)) : (hAsync("gov-chip", { role: "tab", tag: 'button', identifier: control.triggerIdentifier, "wcag-selected": control.active, "wcag-controls": control.contentIdentifier, focusable: control.active, disabled: control.disabled, variant: this.variant, inverse: !control.active, ref: el => (this.triggerRefs[control.triggerIdentifier] = el), "on-gov-click": () => this.onSelectHandler(control) }, control.label))))))), hAsync("span", { key: '6d855cd5195673b6a13aaf4b357b74bdcfd0ef4d', id: this.formSelectId, hidden: true }, this.wcagSelectLabel), this.compactControls ? (hAsync("gov-form-select", { "wcag-labelled-by": this.formSelectId, "onGov-change": this.onChangeHandler.bind(this) }, this.controllers.map(control => (hAsync("option", { value: control.triggerIdentifier, selected: control.active }, control.label))))) : null, hAsync("slot", { key: 'd7ea30baebad93b05c1f978fcca0c19989be7227' })));
|
|
7651
7642
|
}
|
|
7652
7643
|
getCurrentTab() {
|
|
7653
|
-
return this.
|
|
7644
|
+
return this.controllers.find(control => control.active) || null;
|
|
7654
7645
|
}
|
|
7655
7646
|
onSelectHandler(control) {
|
|
7656
|
-
const index = this.
|
|
7647
|
+
const index = this.controllers.findIndex(t => t.triggerIdentifier === control.triggerIdentifier);
|
|
7657
7648
|
this.focusIndex = index;
|
|
7658
7649
|
this.setActiveByIdentifier(control.triggerIdentifier);
|
|
7659
7650
|
this.reRender();
|
|
@@ -7673,30 +7664,30 @@ class GovTabs {
|
|
|
7673
7664
|
}
|
|
7674
7665
|
goToPrevNext(keyCode) {
|
|
7675
7666
|
if ([37, 38, 39, 40].includes(keyCode)) {
|
|
7676
|
-
if (false === (this.focusIndex >= 0 && this.focusIndex <= this.
|
|
7667
|
+
if (false === (this.focusIndex >= 0 && this.focusIndex <= this.controllers.length - 1)) {
|
|
7677
7668
|
return;
|
|
7678
7669
|
}
|
|
7679
|
-
this.
|
|
7670
|
+
this.controllers[this.focusIndex].active = false;
|
|
7680
7671
|
if (keyCode === 39 || keyCode === 40) {
|
|
7681
7672
|
this.focusIndex++;
|
|
7682
|
-
if (this.focusIndex >= this.
|
|
7673
|
+
if (this.focusIndex >= this.controllers.length) {
|
|
7683
7674
|
this.focusIndex = 0;
|
|
7684
7675
|
}
|
|
7685
|
-
if (this.
|
|
7676
|
+
if (this.controllers[this.focusIndex].disabled) {
|
|
7686
7677
|
this.goToPrevNext(40);
|
|
7687
7678
|
}
|
|
7688
7679
|
}
|
|
7689
7680
|
else if (keyCode === 37 || keyCode === 38) {
|
|
7690
7681
|
this.focusIndex--;
|
|
7691
7682
|
if (this.focusIndex < 0) {
|
|
7692
|
-
this.focusIndex = this.
|
|
7683
|
+
this.focusIndex = this.controllers.length - 1;
|
|
7693
7684
|
}
|
|
7694
|
-
if (this.
|
|
7685
|
+
if (this.controllers[this.focusIndex].disabled) {
|
|
7695
7686
|
this.goToPrevNext(38);
|
|
7696
7687
|
}
|
|
7697
7688
|
}
|
|
7698
|
-
if (this.focusIndex >= 0 && this.focusIndex <= this.
|
|
7699
|
-
const current = this.
|
|
7689
|
+
if (this.focusIndex >= 0 && this.focusIndex <= this.controllers.length - 1) {
|
|
7690
|
+
const current = this.controllers[this.focusIndex];
|
|
7700
7691
|
current.active = true;
|
|
7701
7692
|
const trigger = this.triggerRefs[current.triggerIdentifier];
|
|
7702
7693
|
if (trigger.nodeName.toLowerCase() === 'gov-chip') {
|
|
@@ -7705,7 +7696,7 @@ class GovTabs {
|
|
|
7705
7696
|
else {
|
|
7706
7697
|
this.triggerRefs[current.triggerIdentifier].focus();
|
|
7707
7698
|
}
|
|
7708
|
-
this.
|
|
7699
|
+
this.controllers = [...this.controllers];
|
|
7709
7700
|
this.reRender();
|
|
7710
7701
|
this.govChange.emit(this.getCurrentTab().element);
|
|
7711
7702
|
}
|
|
@@ -7715,7 +7706,7 @@ class GovTabs {
|
|
|
7715
7706
|
* Regenerate tabs controllers
|
|
7716
7707
|
*/
|
|
7717
7708
|
async refresh() {
|
|
7718
|
-
this.
|
|
7709
|
+
this.prepareControllers();
|
|
7719
7710
|
}
|
|
7720
7711
|
/**
|
|
7721
7712
|
* Returns the currently selected tabs-item
|
|
@@ -7730,6 +7721,12 @@ class GovTabs {
|
|
|
7730
7721
|
this.setActiveByIdentifier(identifier);
|
|
7731
7722
|
this.reRender();
|
|
7732
7723
|
}
|
|
7724
|
+
/**
|
|
7725
|
+
* Regenerate tabs controllers
|
|
7726
|
+
*/
|
|
7727
|
+
async rerender() {
|
|
7728
|
+
this.prepareControllers();
|
|
7729
|
+
}
|
|
7733
7730
|
/**
|
|
7734
7731
|
* Validate the WCAG attributes of the component
|
|
7735
7732
|
*/
|
|
@@ -7753,12 +7750,13 @@ class GovTabs {
|
|
|
7753
7750
|
"wcagLabel": [1, "wcag-label"],
|
|
7754
7751
|
"wcagSelectLabel": [1, "wcag-select-label"],
|
|
7755
7752
|
"wcagLabelledBy": [1, "wcag-labelled-by"],
|
|
7756
|
-
"
|
|
7753
|
+
"controllers": [32],
|
|
7757
7754
|
"focusIndex": [32],
|
|
7758
7755
|
"compactControls": [32],
|
|
7759
7756
|
"refresh": [64],
|
|
7760
7757
|
"currentTab": [64],
|
|
7761
7758
|
"setActiveTab": [64],
|
|
7759
|
+
"rerender": [64],
|
|
7762
7760
|
"validateWcag": [64]
|
|
7763
7761
|
},
|
|
7764
7762
|
"$listeners$": undefined,
|
|
@@ -7783,8 +7781,14 @@ class GovTabsItem {
|
|
|
7783
7781
|
this.contentId = createID('GovTabContent');
|
|
7784
7782
|
this.triggerId = createID('GovTabTrigger');
|
|
7785
7783
|
}
|
|
7784
|
+
rerenderParent() {
|
|
7785
|
+
const element = this.h.getParent(TabsClass.root);
|
|
7786
|
+
if (element) {
|
|
7787
|
+
element.rerender().catch();
|
|
7788
|
+
}
|
|
7789
|
+
}
|
|
7786
7790
|
render() {
|
|
7787
|
-
return (hAsync(Host, { key: '
|
|
7791
|
+
return (hAsync(Host, { key: 'b316d961cabc1aed647deaa504ddca1184860f70', class: this.h.classes(TabsItemClass.root), default: this.default }, hAsync("div", { key: 'd73aa35cc5131b81eaceff6afab13250b2587aec', class: TabsItemClass.inner, role: "tabpanel", id: this.identifier || this.contentId, hidden: !this.isActive, "aria-labelledby": this.triggerIdentifier || this.triggerId, "aria-hidden": toBoolAttrIfDefined(!this.isActive) }, hAsync("slot", { key: '4bdf7cd566204ab3ac1883a5194abce6526fc0f0' }))));
|
|
7788
7792
|
}
|
|
7789
7793
|
/**
|
|
7790
7794
|
* Returns a unique tab content identifier
|
|
@@ -7811,6 +7815,11 @@ class GovTabsItem {
|
|
|
7811
7815
|
this.isActive = status;
|
|
7812
7816
|
}
|
|
7813
7817
|
get host() { return getElement(this); }
|
|
7818
|
+
static get watchers() { return {
|
|
7819
|
+
"label": ["rerenderParent"],
|
|
7820
|
+
"disabled": ["rerenderParent"],
|
|
7821
|
+
"default": ["rerenderParent"]
|
|
7822
|
+
}; }
|
|
7814
7823
|
static get style() { return GovTabsItemStyle0; }
|
|
7815
7824
|
static get cmpMeta() { return {
|
|
7816
7825
|
"$flags$": 4,
|
|
@@ -8117,12 +8126,14 @@ class GovTooltip {
|
|
|
8117
8126
|
rerenderMessage() {
|
|
8118
8127
|
this.createContentWrapper();
|
|
8119
8128
|
}
|
|
8129
|
+
connectedCallback() {
|
|
8130
|
+
this.createContentWrapper();
|
|
8131
|
+
this.registerListeners();
|
|
8132
|
+
}
|
|
8120
8133
|
componentWillLoad() {
|
|
8121
8134
|
this.validateVariant(this.variant);
|
|
8122
8135
|
this.validateSize(this.size);
|
|
8123
8136
|
this.validatePosition(this.position);
|
|
8124
|
-
this.createContentWrapper();
|
|
8125
|
-
this.registerListeners();
|
|
8126
8137
|
}
|
|
8127
8138
|
componentDidUpdate() {
|
|
8128
8139
|
this.createContentWrapper();
|
|
@@ -8279,11 +8290,11 @@ class GovTooltip {
|
|
|
8279
8290
|
}
|
|
8280
8291
|
render() {
|
|
8281
8292
|
var _a;
|
|
8282
|
-
return (hAsync(Host, { key: '
|
|
8293
|
+
return (hAsync(Host, { key: '79f1e7f55aa44da4cc08be8f388921c2c940d834', id: this.tooltipId, class: this.h.classes(TooltipClass.root), position: this.position }, hAsync("span", { key: '361c2997c12aa96a171ebb1558986b83990b5778', role: 'button', tabindex: 0, onKeyPress: () => this.showTooltip(), onBlur: () => {
|
|
8283
8294
|
if (this.persist === false) {
|
|
8284
8295
|
this.hideTooltip();
|
|
8285
8296
|
}
|
|
8286
|
-
}, "aria-describedby": (_a = this.identifier) !== null && _a !== void 0 ? _a : this.tooltipContentId }, hAsync("slot", { key: '
|
|
8297
|
+
}, "aria-describedby": (_a = this.identifier) !== null && _a !== void 0 ? _a : this.tooltipContentId }, hAsync("slot", { key: 'bffc64135254b57fb4514a8afdc44bfe4b8f3015' }))));
|
|
8287
8298
|
}
|
|
8288
8299
|
/**
|
|
8289
8300
|
* Showing the modal
|
package/dist/hydrate/index.mjs
CHANGED
|
@@ -4869,6 +4869,7 @@ class GovFormInput {
|
|
|
4869
4869
|
this.autocomplete = undefined;
|
|
4870
4870
|
this.autocorrect = undefined;
|
|
4871
4871
|
this.spellcheck = undefined;
|
|
4872
|
+
this.inputLang = undefined;
|
|
4872
4873
|
this.type = undefined;
|
|
4873
4874
|
this.inputType = "text";
|
|
4874
4875
|
this.role = undefined;
|
|
@@ -4914,9 +4915,9 @@ class GovFormInput {
|
|
|
4914
4915
|
}
|
|
4915
4916
|
render() {
|
|
4916
4917
|
const Tag = this.multiline ? Tags$1.TEXTAREA : Tags$1.INPUT;
|
|
4917
|
-
return (hAsync(Host, { key: '
|
|
4918
|
-
hAsync("gov-icon", { key: '
|
|
4919
|
-
hAsync("gov-icon", { key: '
|
|
4918
|
+
return (hAsync(Host, { key: '1d217855ba964b9c637373529e2b677fb09f8034', class: FormInputClass.root, size: this.size, variant: this.variant, type: this.type }, this.h.hasSlot("prefix") && hAsync("slot", { key: '75b989d2f4b70cf43e9a5315fdb6eb56af832118', name: "prefix" }), hAsync("span", { key: '39f063be627ad300abe364adfa4a32b79a879773', class: "element" }, this.h.hasSlot("left-icon") && hAsync("slot", { key: '84da6d8d05274f5a9760b871ffb89dec870122f8', name: "left-icon" }), this.h.hasSlot("right-icon") && !(this.success || this.invalid) && hAsync("slot", { key: 'b8ede08c703cc88e526593cb5aac4a868293543c', name: "right-icon" }), this.success && !this.multiline &&
|
|
4919
|
+
hAsync("gov-icon", { key: '1dad15f0bbab72fef2f2d596fb2ce27b097eb3a4', slot: "right-icon", class: "icon-validation", name: "check-lg" }), this.invalid && !this.multiline &&
|
|
4920
|
+
hAsync("gov-icon", { key: '9d8ed110a2640133ecc462c6b06f1f5496fb61f7', slot: "right-icon", class: "icon-validation", name: "exclamation-lg" }), hAsync(Tag, { key: '62ac8ee0c14c5289c377685fabf535947a43f4c5', type: this.inputType, disabled: this.disabled, id: this.identifier || this.inputId, name: this.name, onFocus: this.onFocusHandler.bind(this), onInput: this.onInputHandler.bind(this), onBlur: this.onBlurHandler.bind(this), onKeyUp: this.onKeyUpHandler.bind(this), onKeyDown: this.onKeyDownHandler.bind(this), ref: el => (this.inputRef = el), placeholder: this.placeholder, value: this.value, spellcheck: toBoolAttrIfDefined(this.spellcheck), lang: this.inputLang, readonly: toBoolAttrIfDefined(this.readonly), autocomplete: toOnOffAttrIfDefined(this.autocomplete), autocorrect: toOnOffAttrIfDefined(this.autocorrect), minlength: this.minlength, maxlength: this.maxlength, min: this.min, max: this.max, required: this.required, rows: this.rows, cols: this.cols, role: this.role, "aria-required": toBoolAttrIfDefined(this.required), "aria-invalid": toBoolAttrIfDefined(this.invalid), "aria-disabled": toBoolAttrIfDefined(this.disabled), "aria-describedby": this.wcagDescribedBy, "aria-labelledby": this.wcagLabelledBy, "aria-owns": this.wcagOwns, "aria-expanded": toBoolAttrIfDefined(this.wcagExpanded), "aria-autocomplete": this.wcagAutocomplete })), this.h.hasSlot("sufix") && hAsync("slot", { key: '9746bac959c672b37d1c5529cbbe0da13ecf4ce8', name: "sufix" })));
|
|
4920
4921
|
}
|
|
4921
4922
|
onFocusHandler(e) {
|
|
4922
4923
|
e.stopPropagation();
|
|
@@ -5028,6 +5029,7 @@ class GovFormInput {
|
|
|
5028
5029
|
"autocomplete": [4],
|
|
5029
5030
|
"autocorrect": [4],
|
|
5030
5031
|
"spellcheck": [4],
|
|
5032
|
+
"inputLang": [1, "input-lang"],
|
|
5031
5033
|
"type": [1],
|
|
5032
5034
|
"inputType": [1, "input-type"],
|
|
5033
5035
|
"role": [1],
|
|
@@ -6686,6 +6688,7 @@ class GovPagination {
|
|
|
6686
6688
|
this.current = 1;
|
|
6687
6689
|
this.total = 0;
|
|
6688
6690
|
this.inverse = undefined;
|
|
6691
|
+
this.selectIdentifier = undefined;
|
|
6689
6692
|
this.size = "m";
|
|
6690
6693
|
this.variant = "primary";
|
|
6691
6694
|
this.pageSize = 10;
|
|
@@ -6702,6 +6705,7 @@ class GovPagination {
|
|
|
6702
6705
|
this.pagination = undefined;
|
|
6703
6706
|
this.h = govHost(this.host);
|
|
6704
6707
|
this.pageSelectId = createID("GovPageSelect");
|
|
6708
|
+
this.selectId = createID("GovSelect");
|
|
6705
6709
|
}
|
|
6706
6710
|
validateType(newValue) {
|
|
6707
6711
|
validateProp(PaginationTypes, newValue, PaginationClass.root);
|
|
@@ -6757,7 +6761,7 @@ class GovPagination {
|
|
|
6757
6761
|
const ariaCurrent = toBoolAttrIfDefined(this.pagination.currentPage === page ? true : undefined);
|
|
6758
6762
|
return (hAsync("gov-button", { href: this.prepareLinkUrl(page), variant: this.variant, size: this.size, type: "base", disabled: isDisabled, "on-gov-click": (e) => this.onClickHandler(e, page), "wcag-label": description ? description : page > -1 ? this.wcagPageLabel + " " + page : undefined, "wcag-current": ariaCurrent, class: PaginationClass.inner }, content));
|
|
6759
6763
|
};
|
|
6760
|
-
return (hAsync(Host, { class: this.h.classes(PaginationClass.root), type: this.type, variant: this.variant, size: this.size }, hAsync("nav", { "aria-label": this.wcagLabel, "aria-labelledby": this.wcagLabelledBy }, hAsync("ul", { class: PaginationClass.list }, hAsync("li", { class: prepareClasses([PaginationClass.item, PaginationClass.itemArrow]) }, pageResolver(this.pagination.currentPage > 1 ? 1 : -1, hAsync("gov-icon", { class: PaginationClass.arrow, name: "chevron-double-left" }), this.labelStart)), hAsync("li", { class: prepareClasses([PaginationClass.item, PaginationClass.itemArrow]) }, pageResolver(this.pagination.startPage < this.pagination.currentPage ? this.pagination.currentPage - 1 : -1, hAsync("gov-icon", { class: PaginationClass.arrow, name: "chevron-left" }), this.labelPrev)), this.type == "select" ? (hAsync("li", { class: prepareClasses([PaginationClass.item, PaginationClass.itemSelect]) }, hAsync("span", { class: PaginationClass.inner }, hAsync("span", { id: this.pageSelectId, hidden: true }, this.wcagSelectLabel), hAsync("gov-form-select", { size: this.size, variant: this.variant, "wcag-labelled-by": this.pageSelectId, "on-gov-change": this.onSelectHandler.bind(this) }, createArrayRange(1, this.pagination.totalPages).map(page => (hAsync("option", { value: page, selected: this.pagination.currentPage === page }, page))))))) : (hAsync(Fragment, null, this.pagination.pages.map(page => (hAsync("li", { class: this.isActivePageClass(PaginationClass.item, page) }, pageResolver(page, page, '')))), this.pagination.totalPages ? (hAsync("li", { class: prepareClasses([PaginationClass.item, PaginationClass.itemMore]) }, hAsync("span", { class: PaginationClass.inner }, hAsync("span", { id: this.pageSelectId, hidden: true }, this.wcagSelectLabel), hAsync("gov-form-select", { size: this.size, variant: this.variant, "wcag-labelled-by": this.pageSelectId, ref: el => (this.spreadSelectRef = el), "on-gov-change": this.onSelectHandler.bind(this) }, hAsync("option", { selected: true, hidden: true }, "..."), createArrayRange(1, this.pagination.totalPages).map(page => (hAsync("option", { value: page, selected: false }, page))))))) : null)), hAsync("li", { class: prepareClasses([PaginationClass.item, PaginationClass.itemArrow]) }, pageResolver(this.pagination.totalPages > this.pagination.currentPage ? this.pagination.currentPage + 1 : -1, hAsync("gov-icon", { class: PaginationClass.arrow, name: "chevron-right" }), this.labelNext)), hAsync("li", { class: prepareClasses([PaginationClass.item, PaginationClass.itemArrow]) }, pageResolver(this.pagination.totalPages > this.pagination.currentPage ? this.pagination.totalPages : -1, hAsync("gov-icon", { class: PaginationClass.arrow, name: "chevron-double-right" }), this.labelEnd))))));
|
|
6764
|
+
return (hAsync(Host, { class: this.h.classes(PaginationClass.root), type: this.type, variant: this.variant, size: this.size }, hAsync("nav", { "aria-label": this.wcagLabel, "aria-labelledby": this.wcagLabelledBy }, hAsync("ul", { class: PaginationClass.list }, hAsync("li", { class: prepareClasses([PaginationClass.item, PaginationClass.itemArrow]) }, pageResolver(this.pagination.currentPage > 1 ? 1 : -1, hAsync("gov-icon", { class: PaginationClass.arrow, name: "chevron-double-left" }), this.labelStart)), hAsync("li", { class: prepareClasses([PaginationClass.item, PaginationClass.itemArrow]) }, pageResolver(this.pagination.startPage < this.pagination.currentPage ? this.pagination.currentPage - 1 : -1, hAsync("gov-icon", { class: PaginationClass.arrow, name: "chevron-left" }), this.labelPrev)), this.type == "select" ? (hAsync("li", { class: prepareClasses([PaginationClass.item, PaginationClass.itemSelect]) }, hAsync("span", { class: PaginationClass.inner }, hAsync("span", { id: this.pageSelectId, hidden: true }, this.wcagSelectLabel), hAsync("gov-form-select", { size: this.size, variant: this.variant, identifier: this.selectIdentifier || this.selectId, "wcag-labelled-by": this.pageSelectId, "on-gov-change": this.onSelectHandler.bind(this) }, createArrayRange(1, this.pagination.totalPages).map(page => (hAsync("option", { value: page, selected: this.pagination.currentPage === page }, page))))))) : (hAsync(Fragment, null, this.pagination.pages.map(page => (hAsync("li", { class: this.isActivePageClass(PaginationClass.item, page) }, pageResolver(page, page, '')))), this.pagination.totalPages ? (hAsync("li", { class: prepareClasses([PaginationClass.item, PaginationClass.itemMore]) }, hAsync("span", { class: PaginationClass.inner }, hAsync("span", { id: this.pageSelectId, hidden: true }, this.wcagSelectLabel), hAsync("gov-form-select", { size: this.size, variant: this.variant, identifier: this.selectIdentifier || this.selectId, "wcag-labelled-by": this.pageSelectId, ref: el => (this.spreadSelectRef = el), "on-gov-change": this.onSelectHandler.bind(this) }, hAsync("option", { selected: true, hidden: true }, "..."), createArrayRange(1, this.pagination.totalPages).map(page => (hAsync("option", { value: page, selected: false }, page))))))) : null)), hAsync("li", { class: prepareClasses([PaginationClass.item, PaginationClass.itemArrow]) }, pageResolver(this.pagination.totalPages > this.pagination.currentPage ? this.pagination.currentPage + 1 : -1, hAsync("gov-icon", { class: PaginationClass.arrow, name: "chevron-right" }), this.labelNext)), hAsync("li", { class: prepareClasses([PaginationClass.item, PaginationClass.itemArrow]) }, pageResolver(this.pagination.totalPages > this.pagination.currentPage ? this.pagination.totalPages : -1, hAsync("gov-icon", { class: PaginationClass.arrow, name: "chevron-double-right" }), this.labelEnd))))));
|
|
6761
6765
|
}
|
|
6762
6766
|
onClickHandler(e, page) {
|
|
6763
6767
|
e.stopPropagation();
|
|
@@ -6811,6 +6815,7 @@ class GovPagination {
|
|
|
6811
6815
|
"current": [2],
|
|
6812
6816
|
"total": [2],
|
|
6813
6817
|
"inverse": [4],
|
|
6818
|
+
"selectIdentifier": [1, "select-identifier"],
|
|
6814
6819
|
"size": [1],
|
|
6815
6820
|
"variant": [1],
|
|
6816
6821
|
"pageSize": [2, "page-size"],
|
|
@@ -7556,7 +7561,7 @@ class GovTabs {
|
|
|
7556
7561
|
registerInstance(this, hostRef);
|
|
7557
7562
|
this.govChange = createEvent(this, "gov-change", 7);
|
|
7558
7563
|
this.triggerRefs = {};
|
|
7559
|
-
this.
|
|
7564
|
+
this.controllers = [];
|
|
7560
7565
|
this.focusIndex = 0;
|
|
7561
7566
|
this.compactControls = false;
|
|
7562
7567
|
this.type = "text";
|
|
@@ -7575,17 +7580,16 @@ class GovTabs {
|
|
|
7575
7580
|
validateProp(TabVariants, newValue, TabsClass.root);
|
|
7576
7581
|
}
|
|
7577
7582
|
componentWillLoad() {
|
|
7578
|
-
this.
|
|
7583
|
+
this.prepareControllers();
|
|
7579
7584
|
}
|
|
7580
7585
|
async componentDidRender() {
|
|
7581
7586
|
if (canValidateWcagOnRender()) {
|
|
7582
7587
|
await delay(500);
|
|
7583
7588
|
await this.validateWcag();
|
|
7584
7589
|
}
|
|
7585
|
-
this.resizeObserver();
|
|
7586
7590
|
}
|
|
7587
|
-
|
|
7588
|
-
this.
|
|
7591
|
+
prepareControllers() {
|
|
7592
|
+
this.controllers = [];
|
|
7589
7593
|
const promises = [];
|
|
7590
7594
|
this.host.querySelectorAll(TabsItemClass.root).forEach((tab) => {
|
|
7591
7595
|
const controlItem = Promise.all([
|
|
@@ -7607,49 +7611,36 @@ class GovTabs {
|
|
|
7607
7611
|
promises.push(controlItem);
|
|
7608
7612
|
});
|
|
7609
7613
|
Promise.all(promises).then(controllers => {
|
|
7610
|
-
let
|
|
7611
|
-
if (
|
|
7612
|
-
|
|
7613
|
-
this.focusIndex =
|
|
7614
|
-
controllers[
|
|
7615
|
-
this.
|
|
7614
|
+
let defaultTabIndex = controllers.findIndex(controller => controller.default);
|
|
7615
|
+
if (defaultTabIndex === -1)
|
|
7616
|
+
defaultTabIndex = 0;
|
|
7617
|
+
this.focusIndex = defaultTabIndex;
|
|
7618
|
+
controllers[defaultTabIndex].active = true;
|
|
7619
|
+
this.controllers = [...controllers];
|
|
7616
7620
|
this.reRender();
|
|
7617
7621
|
});
|
|
7618
7622
|
}
|
|
7619
7623
|
setActiveByIdentifier(identifier) {
|
|
7620
7624
|
const temp = [];
|
|
7621
|
-
this.
|
|
7625
|
+
this.controllers.map(item => {
|
|
7622
7626
|
item.active = identifier === item.triggerIdentifier || identifier === item.contentIdentifier;
|
|
7623
7627
|
temp.push(item);
|
|
7624
7628
|
});
|
|
7625
|
-
this.
|
|
7629
|
+
this.controllers = [...temp];
|
|
7626
7630
|
}
|
|
7627
7631
|
reRender() {
|
|
7628
|
-
this.
|
|
7629
|
-
control.element.setActiveStatus(control.active);
|
|
7632
|
+
this.controllers.map(control => {
|
|
7633
|
+
control.element.setActiveStatus(control.active).catch();
|
|
7630
7634
|
});
|
|
7631
7635
|
}
|
|
7632
|
-
/*
|
|
7633
|
-
private evaluateControls() {
|
|
7634
|
-
this.compactControls = false
|
|
7635
|
-
let sumOfWidth = this.tabsRef.querySelector("ul").offsetWidth
|
|
7636
|
-
this.compactControls = this.tabsRef.offsetWidth < sumOfWidth
|
|
7637
|
-
}
|
|
7638
|
-
*/
|
|
7639
|
-
resizeObserver() {
|
|
7640
|
-
const resizeObserver = new ResizeObserver(throttle(() => {
|
|
7641
|
-
// this.evaluateControls()
|
|
7642
|
-
}, 200));
|
|
7643
|
-
resizeObserver.observe(this.tabsRef);
|
|
7644
|
-
}
|
|
7645
7636
|
render() {
|
|
7646
|
-
return (hAsync(Host, { key: '
|
|
7637
|
+
return (hAsync(Host, { key: 'fa6bb0777c56edcb61f5acfa4cac75fae2f8bb78', class: this.h.classes(TabsClass.root), variant: this.variant, type: this.type, role: "tablist", "aria-label": this.wcagLabel, "aria-labelledby": this.wcagLabelledBy, onKeyDown: this.onKeydownHandler.bind(this) }, hAsync("div", { key: '3e764b20b9a1e3221232d7567e45acae8701a963', class: TabsClass.tabs, "aria-hidden": toBoolAttr(this.compactControls) }, hAsync("ul", { key: 'adedeb20cd2d5608502410f1b843ba6293000e7c', class: TabsClass.list }, this.controllers.map(control => (hAsync("li", { class: TabsClass.item }, this.type == "text" ? (hAsync("button", { class: TabsClass.btn, id: control.triggerIdentifier, role: "tab", onClick: () => this.onSelectHandler(control), disabled: control.disabled, "aria-disabled": toBoolAttr(control.disabled), "aria-selected": toBoolAttr(control.active), "aria-controls": control.contentIdentifier, tabindex: control.active && !control.disabled ? 0 : -1, ref: el => (this.triggerRefs[control.triggerIdentifier] = el) }, control.label)) : (hAsync("gov-chip", { role: "tab", tag: 'button', identifier: control.triggerIdentifier, "wcag-selected": control.active, "wcag-controls": control.contentIdentifier, focusable: control.active, disabled: control.disabled, variant: this.variant, inverse: !control.active, ref: el => (this.triggerRefs[control.triggerIdentifier] = el), "on-gov-click": () => this.onSelectHandler(control) }, control.label))))))), hAsync("span", { key: '6d855cd5195673b6a13aaf4b357b74bdcfd0ef4d', id: this.formSelectId, hidden: true }, this.wcagSelectLabel), this.compactControls ? (hAsync("gov-form-select", { "wcag-labelled-by": this.formSelectId, "onGov-change": this.onChangeHandler.bind(this) }, this.controllers.map(control => (hAsync("option", { value: control.triggerIdentifier, selected: control.active }, control.label))))) : null, hAsync("slot", { key: 'd7ea30baebad93b05c1f978fcca0c19989be7227' })));
|
|
7647
7638
|
}
|
|
7648
7639
|
getCurrentTab() {
|
|
7649
|
-
return this.
|
|
7640
|
+
return this.controllers.find(control => control.active) || null;
|
|
7650
7641
|
}
|
|
7651
7642
|
onSelectHandler(control) {
|
|
7652
|
-
const index = this.
|
|
7643
|
+
const index = this.controllers.findIndex(t => t.triggerIdentifier === control.triggerIdentifier);
|
|
7653
7644
|
this.focusIndex = index;
|
|
7654
7645
|
this.setActiveByIdentifier(control.triggerIdentifier);
|
|
7655
7646
|
this.reRender();
|
|
@@ -7669,30 +7660,30 @@ class GovTabs {
|
|
|
7669
7660
|
}
|
|
7670
7661
|
goToPrevNext(keyCode) {
|
|
7671
7662
|
if ([37, 38, 39, 40].includes(keyCode)) {
|
|
7672
|
-
if (false === (this.focusIndex >= 0 && this.focusIndex <= this.
|
|
7663
|
+
if (false === (this.focusIndex >= 0 && this.focusIndex <= this.controllers.length - 1)) {
|
|
7673
7664
|
return;
|
|
7674
7665
|
}
|
|
7675
|
-
this.
|
|
7666
|
+
this.controllers[this.focusIndex].active = false;
|
|
7676
7667
|
if (keyCode === 39 || keyCode === 40) {
|
|
7677
7668
|
this.focusIndex++;
|
|
7678
|
-
if (this.focusIndex >= this.
|
|
7669
|
+
if (this.focusIndex >= this.controllers.length) {
|
|
7679
7670
|
this.focusIndex = 0;
|
|
7680
7671
|
}
|
|
7681
|
-
if (this.
|
|
7672
|
+
if (this.controllers[this.focusIndex].disabled) {
|
|
7682
7673
|
this.goToPrevNext(40);
|
|
7683
7674
|
}
|
|
7684
7675
|
}
|
|
7685
7676
|
else if (keyCode === 37 || keyCode === 38) {
|
|
7686
7677
|
this.focusIndex--;
|
|
7687
7678
|
if (this.focusIndex < 0) {
|
|
7688
|
-
this.focusIndex = this.
|
|
7679
|
+
this.focusIndex = this.controllers.length - 1;
|
|
7689
7680
|
}
|
|
7690
|
-
if (this.
|
|
7681
|
+
if (this.controllers[this.focusIndex].disabled) {
|
|
7691
7682
|
this.goToPrevNext(38);
|
|
7692
7683
|
}
|
|
7693
7684
|
}
|
|
7694
|
-
if (this.focusIndex >= 0 && this.focusIndex <= this.
|
|
7695
|
-
const current = this.
|
|
7685
|
+
if (this.focusIndex >= 0 && this.focusIndex <= this.controllers.length - 1) {
|
|
7686
|
+
const current = this.controllers[this.focusIndex];
|
|
7696
7687
|
current.active = true;
|
|
7697
7688
|
const trigger = this.triggerRefs[current.triggerIdentifier];
|
|
7698
7689
|
if (trigger.nodeName.toLowerCase() === 'gov-chip') {
|
|
@@ -7701,7 +7692,7 @@ class GovTabs {
|
|
|
7701
7692
|
else {
|
|
7702
7693
|
this.triggerRefs[current.triggerIdentifier].focus();
|
|
7703
7694
|
}
|
|
7704
|
-
this.
|
|
7695
|
+
this.controllers = [...this.controllers];
|
|
7705
7696
|
this.reRender();
|
|
7706
7697
|
this.govChange.emit(this.getCurrentTab().element);
|
|
7707
7698
|
}
|
|
@@ -7711,7 +7702,7 @@ class GovTabs {
|
|
|
7711
7702
|
* Regenerate tabs controllers
|
|
7712
7703
|
*/
|
|
7713
7704
|
async refresh() {
|
|
7714
|
-
this.
|
|
7705
|
+
this.prepareControllers();
|
|
7715
7706
|
}
|
|
7716
7707
|
/**
|
|
7717
7708
|
* Returns the currently selected tabs-item
|
|
@@ -7726,6 +7717,12 @@ class GovTabs {
|
|
|
7726
7717
|
this.setActiveByIdentifier(identifier);
|
|
7727
7718
|
this.reRender();
|
|
7728
7719
|
}
|
|
7720
|
+
/**
|
|
7721
|
+
* Regenerate tabs controllers
|
|
7722
|
+
*/
|
|
7723
|
+
async rerender() {
|
|
7724
|
+
this.prepareControllers();
|
|
7725
|
+
}
|
|
7729
7726
|
/**
|
|
7730
7727
|
* Validate the WCAG attributes of the component
|
|
7731
7728
|
*/
|
|
@@ -7749,12 +7746,13 @@ class GovTabs {
|
|
|
7749
7746
|
"wcagLabel": [1, "wcag-label"],
|
|
7750
7747
|
"wcagSelectLabel": [1, "wcag-select-label"],
|
|
7751
7748
|
"wcagLabelledBy": [1, "wcag-labelled-by"],
|
|
7752
|
-
"
|
|
7749
|
+
"controllers": [32],
|
|
7753
7750
|
"focusIndex": [32],
|
|
7754
7751
|
"compactControls": [32],
|
|
7755
7752
|
"refresh": [64],
|
|
7756
7753
|
"currentTab": [64],
|
|
7757
7754
|
"setActiveTab": [64],
|
|
7755
|
+
"rerender": [64],
|
|
7758
7756
|
"validateWcag": [64]
|
|
7759
7757
|
},
|
|
7760
7758
|
"$listeners$": undefined,
|
|
@@ -7779,8 +7777,14 @@ class GovTabsItem {
|
|
|
7779
7777
|
this.contentId = createID('GovTabContent');
|
|
7780
7778
|
this.triggerId = createID('GovTabTrigger');
|
|
7781
7779
|
}
|
|
7780
|
+
rerenderParent() {
|
|
7781
|
+
const element = this.h.getParent(TabsClass.root);
|
|
7782
|
+
if (element) {
|
|
7783
|
+
element.rerender().catch();
|
|
7784
|
+
}
|
|
7785
|
+
}
|
|
7782
7786
|
render() {
|
|
7783
|
-
return (hAsync(Host, { key: '
|
|
7787
|
+
return (hAsync(Host, { key: 'b316d961cabc1aed647deaa504ddca1184860f70', class: this.h.classes(TabsItemClass.root), default: this.default }, hAsync("div", { key: 'd73aa35cc5131b81eaceff6afab13250b2587aec', class: TabsItemClass.inner, role: "tabpanel", id: this.identifier || this.contentId, hidden: !this.isActive, "aria-labelledby": this.triggerIdentifier || this.triggerId, "aria-hidden": toBoolAttrIfDefined(!this.isActive) }, hAsync("slot", { key: '4bdf7cd566204ab3ac1883a5194abce6526fc0f0' }))));
|
|
7784
7788
|
}
|
|
7785
7789
|
/**
|
|
7786
7790
|
* Returns a unique tab content identifier
|
|
@@ -7807,6 +7811,11 @@ class GovTabsItem {
|
|
|
7807
7811
|
this.isActive = status;
|
|
7808
7812
|
}
|
|
7809
7813
|
get host() { return getElement(this); }
|
|
7814
|
+
static get watchers() { return {
|
|
7815
|
+
"label": ["rerenderParent"],
|
|
7816
|
+
"disabled": ["rerenderParent"],
|
|
7817
|
+
"default": ["rerenderParent"]
|
|
7818
|
+
}; }
|
|
7810
7819
|
static get style() { return GovTabsItemStyle0; }
|
|
7811
7820
|
static get cmpMeta() { return {
|
|
7812
7821
|
"$flags$": 4,
|
|
@@ -8113,12 +8122,14 @@ class GovTooltip {
|
|
|
8113
8122
|
rerenderMessage() {
|
|
8114
8123
|
this.createContentWrapper();
|
|
8115
8124
|
}
|
|
8125
|
+
connectedCallback() {
|
|
8126
|
+
this.createContentWrapper();
|
|
8127
|
+
this.registerListeners();
|
|
8128
|
+
}
|
|
8116
8129
|
componentWillLoad() {
|
|
8117
8130
|
this.validateVariant(this.variant);
|
|
8118
8131
|
this.validateSize(this.size);
|
|
8119
8132
|
this.validatePosition(this.position);
|
|
8120
|
-
this.createContentWrapper();
|
|
8121
|
-
this.registerListeners();
|
|
8122
8133
|
}
|
|
8123
8134
|
componentDidUpdate() {
|
|
8124
8135
|
this.createContentWrapper();
|
|
@@ -8275,11 +8286,11 @@ class GovTooltip {
|
|
|
8275
8286
|
}
|
|
8276
8287
|
render() {
|
|
8277
8288
|
var _a;
|
|
8278
|
-
return (hAsync(Host, { key: '
|
|
8289
|
+
return (hAsync(Host, { key: '79f1e7f55aa44da4cc08be8f388921c2c940d834', id: this.tooltipId, class: this.h.classes(TooltipClass.root), position: this.position }, hAsync("span", { key: '361c2997c12aa96a171ebb1558986b83990b5778', role: 'button', tabindex: 0, onKeyPress: () => this.showTooltip(), onBlur: () => {
|
|
8279
8290
|
if (this.persist === false) {
|
|
8280
8291
|
this.hideTooltip();
|
|
8281
8292
|
}
|
|
8282
|
-
}, "aria-describedby": (_a = this.identifier) !== null && _a !== void 0 ? _a : this.tooltipContentId }, hAsync("slot", { key: '
|
|
8293
|
+
}, "aria-describedby": (_a = this.identifier) !== null && _a !== void 0 ? _a : this.tooltipContentId }, hAsync("slot", { key: 'bffc64135254b57fb4514a8afdc44bfe4b8f3015' }))));
|
|
8283
8294
|
}
|
|
8284
8295
|
/**
|
|
8285
8296
|
* Showing the modal
|