-
Notifications
You must be signed in to change notification settings - Fork 328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rename GOVUKFrontendComponentConfigurable
, export ConfigurableComponent
#5499
Conversation
📋 StatsFile sizes
Modules
View stats and visualisations on the review app Action run for 81b8df2 |
JavaScript changes to npm packagediff --git a/packages/govuk-frontend/dist/govuk/govuk-frontend.min.js b/packages/govuk-frontend/dist/govuk/govuk-frontend.min.js
index f69163a5d..5a4b212e3 100644
--- a/packages/govuk-frontend/dist/govuk/govuk-frontend.min.js
+++ b/packages/govuk-frontend/dist/govuk/govuk-frontend.min.js
@@ -109,7 +109,7 @@ class GOVUKFrontendComponent {
}
GOVUKFrontendComponent.elementType = HTMLElement;
const t = Symbol.for("configOverride");
-class GOVUKFrontendComponentConfigurable extends GOVUKFrontendComponent {
+class ConfigurableComponent extends GOVUKFrontendComponent {
[t](t) {
return {}
}
@@ -252,7 +252,7 @@ I18n.pluralRulesMap = {
spanish: t => 1 === t ? "one" : t % 1e6 == 0 && 0 !== t ? "many" : "other",
welsh: t => 0 === t ? "zero" : 1 === t ? "one" : 2 === t ? "two" : 3 === t ? "few" : 6 === t ? "many" : "other"
};
-class Accordion extends GOVUKFrontendComponentConfigurable {
+class Accordion extends ConfigurableComponent {
constructor(t, e = {}) {
super(t, e), this.i18n = void 0, this.controlsClass = "govuk-accordion__controls", this.showAllClass = "govuk-accordion__show-all", this.showAllTextClass = "govuk-accordion__show-all-text", this.sectionClass = "govuk-accordion__section", this.sectionExpandedClass = "govuk-accordion__section--expanded", this.sectionButtonClass = "govuk-accordion__section-button", this.sectionHeaderClass = "govuk-accordion__section-header", this.sectionHeadingClass = "govuk-accordion__section-heading", this.sectionHeadingDividerClass = "govuk-accordion__section-heading-divider", this.sectionHeadingTextClass = "govuk-accordion__section-heading-text", this.sectionHeadingTextFocusClass = "govuk-accordion__section-heading-text-focus", this.sectionShowHideToggleClass = "govuk-accordion__section-toggle", this.sectionShowHideToggleFocusClass = "govuk-accordion__section-toggle-focus", this.sectionShowHideTextClass = "govuk-accordion__section-toggle-text", this.upChevronIconClass = "govuk-accordion-nav__chevron", this.downChevronIconClass = "govuk-accordion-nav__chevron--down", this.sectionSummaryClass = "govuk-accordion__section-summary", this.sectionSummaryFocusClass = "govuk-accordion__section-summary-focus", this.sectionContentClass = "govuk-accordion__section-content", this.$sections = void 0, this.$showAllButton = null, this.$showAllIcon = null, this.$showAllText = null, this.i18n = new I18n(this.config.i18n);
const n = this.$root.querySelectorAll(`.${this.sectionClass}`);
@@ -400,7 +400,7 @@ Accordion.moduleName = "govuk-accordion", Accordion.defaults = Object.freeze({
}
}
});
-class Button extends GOVUKFrontendComponentConfigurable {
+class Button extends ConfigurableComponent {
constructor(t, e = {}) {
super(t, e), this.debounceFormSubmitTimer = null, this.$root.addEventListener("keydown", (t => this.handleKeyDown(t))), this.$root.addEventListener("click", (t => this.debounce(t)))
}
@@ -428,7 +428,7 @@ Button.moduleName = "govuk-button", Button.defaults = Object.freeze({
}
}
});
-class CharacterCount extends GOVUKFrontendComponentConfigurable {
+class CharacterCount extends ConfigurableComponent {
[t](t) {
let e = {};
return ("maxwords" in t || "maxlength" in t) && (e = {
@@ -629,7 +629,7 @@ class Checkboxes extends GOVUKFrontendComponent {
}
}
Checkboxes.moduleName = "govuk-checkboxes";
-class ErrorSummary extends GOVUKFrontendComponentConfigurable {
+class ErrorSummary extends ConfigurableComponent {
constructor(t, e = {}) {
super(t, e), this.config.disableAutoFocus || setFocus(this.$root), this.$root.addEventListener("click", (t => this.handleClick(t)))
}
@@ -675,7 +675,7 @@ ErrorSummary.moduleName = "govuk-error-summary", ErrorSummary.defaults = Object.
}
}
});
-class ExitThisPage extends GOVUKFrontendComponentConfigurable {
+class ExitThisPage extends ConfigurableComponent {
constructor(t, e = {}) {
super(t, e), this.i18n = void 0, this.$button = void 0, this.$skiplinkButton = null, this.$updateSpan = null, this.$indicatorContainer = null, this.$overlay = null, this.keypressCounter = 0, this.lastKeyWasModified = !1, this.timeoutTime = 5e3, this.keypressTimeoutId = null, this.timeoutMessageId = null;
const n = this.$root.querySelector(".govuk-exit-this-page__button");
@@ -782,7 +782,7 @@ class Header extends GOVUKFrontendComponent {
}
}
Header.moduleName = "govuk-header";
-class NotificationBanner extends GOVUKFrontendComponentConfigurable {
+class NotificationBanner extends ConfigurableComponent {
constructor(t, e = {}) {
super(t, e), "alert" !== this.$root.getAttribute("role") || this.config.disableAutoFocus || setFocus(this.$root)
}
@@ -796,7 +796,7 @@ NotificationBanner.moduleName = "govuk-notification-banner", NotificationBanner.
}
}
});
-class PasswordInput extends GOVUKFrontendComponentConfigurable {
+class PasswordInput extends ConfigurableComponent {
constructor(t, e = {}) {
super(t, e), this.i18n = void 0, this.$input = void 0, this.$showHideButton = void 0, this.$screenReaderStatusMessage = void 0;
const n = this.$root.querySelector(".govuk-js-password-input-input");
@@ -1164,6 +1164,7 @@ export {
CharacterCount,
Checkboxes,
GOVUKFrontendComponent as Component,
+ ConfigurableComponent,
ErrorSummary,
ExitThisPage,
Header,
Action run for 81b8df2 |
Other changes to npm packagediff --git a/packages/govuk-frontend/dist/govuk/all.bundle.js b/packages/govuk-frontend/dist/govuk/all.bundle.js
index ab5747462..a18e50106 100644
--- a/packages/govuk-frontend/dist/govuk/all.bundle.js
+++ b/packages/govuk-frontend/dist/govuk/all.bundle.js
@@ -186,7 +186,7 @@
GOVUKFrontendComponent.elementType = HTMLElement;
const configOverride = Symbol.for('configOverride');
- class GOVUKFrontendComponentConfigurable extends GOVUKFrontendComponent {
+ class ConfigurableComponent extends GOVUKFrontendComponent {
[configOverride](param) {
return {};
}
@@ -549,9 +549,9 @@
* attribute, which also provides accessibility.
*
* @preserve
- * @augments GOVUKFrontendComponentConfigurable<AccordionConfig>
+ * @augments ConfigurableComponent<AccordionConfig>
*/
- class Accordion extends GOVUKFrontendComponentConfigurable {
+ class Accordion extends ConfigurableComponent {
/**
* @param {Element | null} $root - HTML element to use for accordion
* @param {AccordionConfig} [config] - Accordion config
@@ -882,9 +882,9 @@
* JavaScript enhancements for the Button component
*
* @preserve
- * @augments GOVUKFrontendComponentConfigurable<ButtonConfig>
+ * @augments ConfigurableComponent<ButtonConfig>
*/
- class Button extends GOVUKFrontendComponentConfigurable {
+ class Button extends ConfigurableComponent {
/**
* @param {Element | null} $root - HTML element to use for button
* @param {ButtonConfig} [config] - Button config
@@ -958,9 +958,9 @@
* of the available characters/words has been entered.
*
* @preserve
- * @augments GOVUKFrontendComponentConfigurable<CharacterCountConfig>
+ * @augments ConfigurableComponent<CharacterCountConfig>
*/
- class CharacterCount extends GOVUKFrontendComponentConfigurable {
+ class CharacterCount extends ConfigurableComponent {
[configOverride](datasetConfig) {
let configOverrides = {};
if ('maxwords' in datasetConfig || 'maxlength' in datasetConfig) {
@@ -1348,9 +1348,9 @@
* configuration.
*
* @preserve
- * @augments GOVUKFrontendComponentConfigurable<ErrorSummaryConfig>
+ * @augments ConfigurableComponent<ErrorSummaryConfig>
*/
- class ErrorSummary extends GOVUKFrontendComponentConfigurable {
+ class ErrorSummary extends ConfigurableComponent {
/**
* @param {Element | null} $root - HTML element to use for error summary
* @param {ErrorSummaryConfig} [config] - Error summary config
@@ -1441,9 +1441,9 @@
* Exit this page component
*
* @preserve
- * @augments GOVUKFrontendComponentConfigurable<ExitThisPageConfig>
+ * @augments ConfigurableComponent<ExitThisPageConfig>
*/
- class ExitThisPage extends GOVUKFrontendComponentConfigurable {
+ class ExitThisPage extends ConfigurableComponent {
/**
* @param {Element | null} $root - HTML element that wraps the Exit This Page button
* @param {ExitThisPageConfig} [config] - Exit This Page config
@@ -1740,9 +1740,9 @@
* Notification Banner component
*
* @preserve
- * @augments GOVUKFrontendComponentConfigurable<NotificationBannerConfig>
+ * @augments ConfigurableComponent<NotificationBannerConfig>
*/
- class NotificationBanner extends GOVUKFrontendComponentConfigurable {
+ class NotificationBanner extends ConfigurableComponent {
/**
* @param {Element | null} $root - HTML element to use for notification banner
* @param {NotificationBannerConfig} [config] - Notification banner config
@@ -1784,9 +1784,9 @@
* Password input component
*
* @preserve
- * @augments GOVUKFrontendComponentConfigurable<PasswordInputConfig>
+ * @augments ConfigurableComponent<PasswordInputConfig>
*/
- class PasswordInput extends GOVUKFrontendComponentConfigurable {
+ class PasswordInput extends ConfigurableComponent {
/**
* @param {Element | null} $root - HTML element to use for password input
* @param {PasswordInputConfig} [config] - Password input config
@@ -2568,6 +2568,7 @@
exports.CharacterCount = CharacterCount;
exports.Checkboxes = Checkboxes;
exports.Component = GOVUKFrontendComponent;
+ exports.ConfigurableComponent = ConfigurableComponent;
exports.ErrorSummary = ErrorSummary;
exports.ExitThisPage = ExitThisPage;
exports.Header = Header;
diff --git a/packages/govuk-frontend/dist/govuk/all.bundle.mjs b/packages/govuk-frontend/dist/govuk/all.bundle.mjs
index 654758d17..536f4b22d 100644
--- a/packages/govuk-frontend/dist/govuk/all.bundle.mjs
+++ b/packages/govuk-frontend/dist/govuk/all.bundle.mjs
@@ -180,7 +180,7 @@ class GOVUKFrontendComponent {
GOVUKFrontendComponent.elementType = HTMLElement;
const configOverride = Symbol.for('configOverride');
-class GOVUKFrontendComponentConfigurable extends GOVUKFrontendComponent {
+class ConfigurableComponent extends GOVUKFrontendComponent {
[configOverride](param) {
return {};
}
@@ -543,9 +543,9 @@ I18n.pluralRules = {
* attribute, which also provides accessibility.
*
* @preserve
- * @augments GOVUKFrontendComponentConfigurable<AccordionConfig>
+ * @augments ConfigurableComponent<AccordionConfig>
*/
-class Accordion extends GOVUKFrontendComponentConfigurable {
+class Accordion extends ConfigurableComponent {
/**
* @param {Element | null} $root - HTML element to use for accordion
* @param {AccordionConfig} [config] - Accordion config
@@ -876,9 +876,9 @@ const DEBOUNCE_TIMEOUT_IN_SECONDS = 1;
* JavaScript enhancements for the Button component
*
* @preserve
- * @augments GOVUKFrontendComponentConfigurable<ButtonConfig>
+ * @augments ConfigurableComponent<ButtonConfig>
*/
-class Button extends GOVUKFrontendComponentConfigurable {
+class Button extends ConfigurableComponent {
/**
* @param {Element | null} $root - HTML element to use for button
* @param {ButtonConfig} [config] - Button config
@@ -952,9 +952,9 @@ function closestAttributeValue($element, attributeName) {
* of the available characters/words has been entered.
*
* @preserve
- * @augments GOVUKFrontendComponentConfigurable<CharacterCountConfig>
+ * @augments ConfigurableComponent<CharacterCountConfig>
*/
-class CharacterCount extends GOVUKFrontendComponentConfigurable {
+class CharacterCount extends ConfigurableComponent {
[configOverride](datasetConfig) {
let configOverrides = {};
if ('maxwords' in datasetConfig || 'maxlength' in datasetConfig) {
@@ -1342,9 +1342,9 @@ Checkboxes.moduleName = 'govuk-checkboxes';
* configuration.
*
* @preserve
- * @augments GOVUKFrontendComponentConfigurable<ErrorSummaryConfig>
+ * @augments ConfigurableComponent<ErrorSummaryConfig>
*/
-class ErrorSummary extends GOVUKFrontendComponentConfigurable {
+class ErrorSummary extends ConfigurableComponent {
/**
* @param {Element | null} $root - HTML element to use for error summary
* @param {ErrorSummaryConfig} [config] - Error summary config
@@ -1435,9 +1435,9 @@ ErrorSummary.schema = Object.freeze({
* Exit this page component
*
* @preserve
- * @augments GOVUKFrontendComponentConfigurable<ExitThisPageConfig>
+ * @augments ConfigurableComponent<ExitThisPageConfig>
*/
-class ExitThisPage extends GOVUKFrontendComponentConfigurable {
+class ExitThisPage extends ConfigurableComponent {
/**
* @param {Element | null} $root - HTML element that wraps the Exit This Page button
* @param {ExitThisPageConfig} [config] - Exit This Page config
@@ -1734,9 +1734,9 @@ Header.moduleName = 'govuk-header';
* Notification Banner component
*
* @preserve
- * @augments GOVUKFrontendComponentConfigurable<NotificationBannerConfig>
+ * @augments ConfigurableComponent<NotificationBannerConfig>
*/
-class NotificationBanner extends GOVUKFrontendComponentConfigurable {
+class NotificationBanner extends ConfigurableComponent {
/**
* @param {Element | null} $root - HTML element to use for notification banner
* @param {NotificationBannerConfig} [config] - Notification banner config
@@ -1778,9 +1778,9 @@ NotificationBanner.schema = Object.freeze({
* Password input component
*
* @preserve
- * @augments GOVUKFrontendComponentConfigurable<PasswordInputConfig>
+ * @augments ConfigurableComponent<PasswordInputConfig>
*/
-class PasswordInput extends GOVUKFrontendComponentConfigurable {
+class PasswordInput extends ConfigurableComponent {
/**
* @param {Element | null} $root - HTML element to use for password input
* @param {PasswordInputConfig} [config] - Password input config
@@ -2557,5 +2557,5 @@ function createAll(Component, config, createAllOptions) {
* @property {OnErrorCallback<ComponentClass>} [onError] - callback function if error throw by component on init
*/
-export { Accordion, Button, CharacterCount, Checkboxes, GOVUKFrontendComponent as Component, ErrorSummary, ExitThisPage, Header, NotificationBanner, PasswordInput, Radios, ServiceNavigation, SkipLink, Tabs, createAll, initAll, isSupported, version };
+export { Accordion, Button, CharacterCount, Checkboxes, GOVUKFrontendComponent as Component, ConfigurableComponent, ErrorSummary, ExitThisPage, Header, NotificationBanner, PasswordInput, Radios, ServiceNavigation, SkipLink, Tabs, createAll, initAll, isSupported, version };
//# sourceMappingURL=all.bundle.mjs.map
diff --git a/packages/govuk-frontend/dist/govuk/all.mjs b/packages/govuk-frontend/dist/govuk/all.mjs
index 1d37a44bd..0ebb2d609 100644
--- a/packages/govuk-frontend/dist/govuk/all.mjs
+++ b/packages/govuk-frontend/dist/govuk/all.mjs
@@ -15,4 +15,5 @@ export { Tabs } from './components/tabs/tabs.mjs';
export { createAll, initAll } from './init.mjs';
export { isSupported } from './common/index.mjs';
export { GOVUKFrontendComponent as Component } from './govuk-frontend-component.mjs';
+export { ConfigurableComponent } from './common/configuration.mjs';
//# sourceMappingURL=all.mjs.map
diff --git a/packages/govuk-frontend/dist/govuk/common/configuration.mjs b/packages/govuk-frontend/dist/govuk/common/configuration.mjs
index b7ad735b3..7bdc8f483 100644
--- a/packages/govuk-frontend/dist/govuk/common/configuration.mjs
+++ b/packages/govuk-frontend/dist/govuk/common/configuration.mjs
@@ -3,7 +3,7 @@ import { GOVUKFrontendComponent } from '../govuk-frontend-component.mjs';
import { formatErrorMessage, isObject } from './index.mjs';
const configOverride = Symbol.for('configOverride');
-class GOVUKFrontendComponentConfigurable extends GOVUKFrontendComponent {
+class ConfigurableComponent extends GOVUKFrontendComponent {
[configOverride](param) {
return {};
}
@@ -160,5 +160,5 @@ function extractConfigByNamespace(schema, dataset, namespace) {
* @typedef {typeof GOVUKFrontendComponent & ChildClass<ConfigurationType>} ChildClassConstructor<ConfigurationType>
*/
-export { GOVUKFrontendComponentConfigurable, configOverride, extractConfigByNamespace, mergeConfigs, normaliseDataset, normaliseString, validateConfig };
+export { ConfigurableComponent, configOverride, extractConfigByNamespace, mergeConfigs, normaliseDataset, normaliseString, validateConfig };
//# sourceMappingURL=configuration.mjs.map
diff --git a/packages/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.js b/packages/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.js
index 949910dc2..c96cd5e2e 100644
--- a/packages/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.js
+++ b/packages/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.js
@@ -146,7 +146,7 @@
GOVUKFrontendComponent.elementType = HTMLElement;
const configOverride = Symbol.for('configOverride');
- class GOVUKFrontendComponentConfigurable extends GOVUKFrontendComponent {
+ class ConfigurableComponent extends GOVUKFrontendComponent {
[configOverride](param) {
return {};
}
@@ -489,9 +489,9 @@
* attribute, which also provides accessibility.
*
* @preserve
- * @augments GOVUKFrontendComponentConfigurable<AccordionConfig>
+ * @augments ConfigurableComponent<AccordionConfig>
*/
- class Accordion extends GOVUKFrontendComponentConfigurable {
+ class Accordion extends ConfigurableComponent {
/**
* @param {Element | null} $root - HTML element to use for accordion
* @param {AccordionConfig} [config] - Accordion config
diff --git a/packages/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.mjs b/packages/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.mjs
index 521b35c78..f16d67139 100644
--- a/packages/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.mjs
+++ b/packages/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.mjs
@@ -140,7 +140,7 @@ class GOVUKFrontendComponent {
GOVUKFrontendComponent.elementType = HTMLElement;
const configOverride = Symbol.for('configOverride');
-class GOVUKFrontendComponentConfigurable extends GOVUKFrontendComponent {
+class ConfigurableComponent extends GOVUKFrontendComponent {
[configOverride](param) {
return {};
}
@@ -483,9 +483,9 @@ I18n.pluralRules = {
* attribute, which also provides accessibility.
*
* @preserve
- * @augments GOVUKFrontendComponentConfigurable<AccordionConfig>
+ * @augments ConfigurableComponent<AccordionConfig>
*/
-class Accordion extends GOVUKFrontendComponentConfigurable {
+class Accordion extends ConfigurableComponent {
/**
* @param {Element | null} $root - HTML element to use for accordion
* @param {AccordionConfig} [config] - Accordion config
diff --git a/packages/govuk-frontend/dist/govuk/components/accordion/accordion.mjs b/packages/govuk-frontend/dist/govuk/components/accordion/accordion.mjs
index 4cd678923..57b4b84d0 100644
--- a/packages/govuk-frontend/dist/govuk/components/accordion/accordion.mjs
+++ b/packages/govuk-frontend/dist/govuk/components/accordion/accordion.mjs
@@ -1,4 +1,4 @@
-import { GOVUKFrontendComponentConfigurable } from '../../common/configuration.mjs';
+import { ConfigurableComponent } from '../../common/configuration.mjs';
import { ElementError } from '../../errors/index.mjs';
import { I18n } from '../../i18n.mjs';
@@ -15,9 +15,9 @@ import { I18n } from '../../i18n.mjs';
* attribute, which also provides accessibility.
*
* @preserve
- * @augments GOVUKFrontendComponentConfigurable<AccordionConfig>
+ * @augments ConfigurableComponent<AccordionConfig>
*/
-class Accordion extends GOVUKFrontendComponentConfigurable {
+class Accordion extends ConfigurableComponent {
/**
* @param {Element | null} $root - HTML element to use for accordion
* @param {AccordionConfig} [config] - Accordion config
diff --git a/packages/govuk-frontend/dist/govuk/components/button/button.bundle.js b/packages/govuk-frontend/dist/govuk/components/button/button.bundle.js
index 54849012d..58285df0b 100644
--- a/packages/govuk-frontend/dist/govuk/components/button/button.bundle.js
+++ b/packages/govuk-frontend/dist/govuk/components/button/button.bundle.js
@@ -146,7 +146,7 @@
GOVUKFrontendComponent.elementType = HTMLElement;
const configOverride = Symbol.for('configOverride');
- class GOVUKFrontendComponentConfigurable extends GOVUKFrontendComponent {
+ class ConfigurableComponent extends GOVUKFrontendComponent {
[configOverride](param) {
return {};
}
@@ -289,9 +289,9 @@
* JavaScript enhancements for the Button component
*
* @preserve
- * @augments GOVUKFrontendComponentConfigurable<ButtonConfig>
+ * @augments ConfigurableComponent<ButtonConfig>
*/
- class Button extends GOVUKFrontendComponentConfigurable {
+ class Button extends ConfigurableComponent {
/**
* @param {Element | null} $root - HTML element to use for button
* @param {ButtonConfig} [config] - Button config
diff --git a/packages/govuk-frontend/dist/govuk/components/button/button.bundle.mjs b/packages/govuk-frontend/dist/govuk/components/button/button.bundle.mjs
index b5ff0c905..d483bfe71 100644
--- a/packages/govuk-frontend/dist/govuk/components/button/button.bundle.mjs
+++ b/packages/govuk-frontend/dist/govuk/components/button/button.bundle.mjs
@@ -140,7 +140,7 @@ class GOVUKFrontendComponent {
GOVUKFrontendComponent.elementType = HTMLElement;
const configOverride = Symbol.for('configOverride');
-class GOVUKFrontendComponentConfigurable extends GOVUKFrontendComponent {
+class ConfigurableComponent extends GOVUKFrontendComponent {
[configOverride](param) {
return {};
}
@@ -283,9 +283,9 @@ const DEBOUNCE_TIMEOUT_IN_SECONDS = 1;
* JavaScript enhancements for the Button component
*
* @preserve
- * @augments GOVUKFrontendComponentConfigurable<ButtonConfig>
+ * @augments ConfigurableComponent<ButtonConfig>
*/
-class Button extends GOVUKFrontendComponentConfigurable {
+class Button extends ConfigurableComponent {
/**
* @param {Element | null} $root - HTML element to use for button
* @param {ButtonConfig} [config] - Button config
diff --git a/packages/govuk-frontend/dist/govuk/components/button/button.mjs b/packages/govuk-frontend/dist/govuk/components/button/button.mjs
index 6863c08e0..3db291692 100644
--- a/packages/govuk-frontend/dist/govuk/components/button/button.mjs
+++ b/packages/govuk-frontend/dist/govuk/components/button/button.mjs
@@ -1,4 +1,4 @@
-import { GOVUKFrontendComponentConfigurable } from '../../common/configuration.mjs';
+import { ConfigurableComponent } from '../../common/configuration.mjs';
const DEBOUNCE_TIMEOUT_IN_SECONDS = 1;
@@ -6,9 +6,9 @@ const DEBOUNCE_TIMEOUT_IN_SECONDS = 1;
* JavaScript enhancements for the Button component
*
* @preserve
- * @augments GOVUKFrontendComponentConfigurable<ButtonConfig>
+ * @augments ConfigurableComponent<ButtonConfig>
*/
-class Button extends GOVUKFrontendComponentConfigurable {
+class Button extends ConfigurableComponent {
/**
* @param {Element | null} $root - HTML element to use for button
* @param {ButtonConfig} [config] - Button config
diff --git a/packages/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.js b/packages/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.js
index cc24a93af..464fcf2b2 100644
--- a/packages/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.js
+++ b/packages/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.js
@@ -151,7 +151,7 @@
GOVUKFrontendComponent.elementType = HTMLElement;
const configOverride = Symbol.for('configOverride');
- class GOVUKFrontendComponentConfigurable extends GOVUKFrontendComponent {
+ class ConfigurableComponent extends GOVUKFrontendComponent {
[configOverride](param) {
return {};
}
@@ -512,9 +512,9 @@
* of the available characters/words has been entered.
*
* @preserve
- * @augments GOVUKFrontendComponentConfigurable<CharacterCountConfig>
+ * @augments ConfigurableComponent<CharacterCountConfig>
*/
- class CharacterCount extends GOVUKFrontendComponentConfigurable {
+ class CharacterCount extends ConfigurableComponent {
[configOverride](datasetConfig) {
let configOverrides = {};
if ('maxwords' in datasetConfig || 'maxlength' in datasetConfig) {
diff --git a/packages/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.mjs b/packages/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.mjs
index 030682a94..2a598bbed 100644
--- a/packages/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.mjs
+++ b/packages/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.mjs
@@ -145,7 +145,7 @@ class GOVUKFrontendComponent {
GOVUKFrontendComponent.elementType = HTMLElement;
const configOverride = Symbol.for('configOverride');
-class GOVUKFrontendComponentConfigurable extends GOVUKFrontendComponent {
+class ConfigurableComponent extends GOVUKFrontendComponent {
[configOverride](param) {
return {};
}
@@ -506,9 +506,9 @@ I18n.pluralRules = {
* of the available characters/words has been entered.
*
* @preserve
- * @augments GOVUKFrontendComponentConfigurable<CharacterCountConfig>
+ * @augments ConfigurableComponent<CharacterCountConfig>
*/
-class CharacterCount extends GOVUKFrontendComponentConfigurable {
+class CharacterCount extends ConfigurableComponent {
[configOverride](datasetConfig) {
let configOverrides = {};
if ('maxwords' in datasetConfig || 'maxlength' in datasetConfig) {
diff --git a/packages/govuk-frontend/dist/govuk/components/character-count/character-count.mjs b/packages/govuk-frontend/dist/govuk/components/character-count/character-count.mjs
index dda6c3e8b..06ebafc28 100644
--- a/packages/govuk-frontend/dist/govuk/components/character-count/character-count.mjs
+++ b/packages/govuk-frontend/dist/govuk/components/character-count/character-count.mjs
@@ -1,5 +1,5 @@
import { closestAttributeValue } from '../../common/closest-attribute-value.mjs';
-import { GOVUKFrontendComponentConfigurable, configOverride, validateConfig } from '../../common/configuration.mjs';
+import { ConfigurableComponent, configOverride, validateConfig } from '../../common/configuration.mjs';
import { formatErrorMessage } from '../../common/index.mjs';
import { ElementError, ConfigError } from '../../errors/index.mjs';
import { I18n } from '../../i18n.mjs';
@@ -15,9 +15,9 @@ import { I18n } from '../../i18n.mjs';
* of the available characters/words has been entered.
*
* @preserve
- * @augments GOVUKFrontendComponentConfigurable<CharacterCountConfig>
+ * @augments ConfigurableComponent<CharacterCountConfig>
*/
-class CharacterCount extends GOVUKFrontendComponentConfigurable {
+class CharacterCount extends ConfigurableComponent {
[configOverride](datasetConfig) {
let configOverrides = {};
if ('maxwords' in datasetConfig || 'maxlength' in datasetConfig) {
diff --git a/packages/govuk-frontend/dist/govuk/components/error-summary/error-summary.bundle.js b/packages/govuk-frontend/dist/govuk/components/error-summary/error-summary.bundle.js
index 0280ff8f5..be36af688 100644
--- a/packages/govuk-frontend/dist/govuk/components/error-summary/error-summary.bundle.js
+++ b/packages/govuk-frontend/dist/govuk/components/error-summary/error-summary.bundle.js
@@ -176,7 +176,7 @@
GOVUKFrontendComponent.elementType = HTMLElement;
const configOverride = Symbol.for('configOverride');
- class GOVUKFrontendComponentConfigurable extends GOVUKFrontendComponent {
+ class ConfigurableComponent extends GOVUKFrontendComponent {
[configOverride](param) {
return {};
}
@@ -320,9 +320,9 @@
* configuration.
*
* @preserve
- * @augments GOVUKFrontendComponentConfigurable<ErrorSummaryConfig>
+ * @augments ConfigurableComponent<ErrorSummaryConfig>
*/
- class ErrorSummary extends GOVUKFrontendComponentConfigurable {
+ class ErrorSummary extends ConfigurableComponent {
/**
* @param {Element | null} $root - HTML element to use for error summary
* @param {ErrorSummaryConfig} [config] - Error summary config
diff --git a/packages/govuk-frontend/dist/govuk/components/error-summary/error-summary.bundle.mjs b/packages/govuk-frontend/dist/govuk/components/error-summary/error-summary.bundle.mjs
index d7f644f4e..acc262b51 100644
--- a/packages/govuk-frontend/dist/govuk/components/error-summary/error-summary.bundle.mjs
+++ b/packages/govuk-frontend/dist/govuk/components/error-summary/error-summary.bundle.mjs
@@ -170,7 +170,7 @@ class GOVUKFrontendComponent {
GOVUKFrontendComponent.elementType = HTMLElement;
const configOverride = Symbol.for('configOverride');
-class GOVUKFrontendComponentConfigurable extends GOVUKFrontendComponent {
+class ConfigurableComponent extends GOVUKFrontendComponent {
[configOverride](param) {
return {};
}
@@ -314,9 +314,9 @@ function extractConfigByNamespace(schema, dataset, namespace) {
* configuration.
*
* @preserve
- * @augments GOVUKFrontendComponentConfigurable<ErrorSummaryConfig>
+ * @augments ConfigurableComponent<ErrorSummaryConfig>
*/
-class ErrorSummary extends GOVUKFrontendComponentConfigurable {
+class ErrorSummary extends ConfigurableComponent {
/**
* @param {Element | null} $root - HTML element to use for error summary
* @param {ErrorSummaryConfig} [config] - Error summary config
diff --git a/packages/govuk-frontend/dist/govuk/components/error-summary/error-summary.mjs b/packages/govuk-frontend/dist/govuk/components/error-summary/error-summary.mjs
index ce76581d6..a99ce7fad 100644
--- a/packages/govuk-frontend/dist/govuk/components/error-summary/error-summary.mjs
+++ b/packages/govuk-frontend/dist/govuk/components/error-summary/error-summary.mjs
@@ -1,4 +1,4 @@
-import { GOVUKFrontendComponentConfigurable } from '../../common/configuration.mjs';
+import { ConfigurableComponent } from '../../common/configuration.mjs';
import { setFocus, getFragmentFromUrl } from '../../common/index.mjs';
/**
@@ -8,9 +8,9 @@ import { setFocus, getFragmentFromUrl } from '../../common/index.mjs';
* configuration.
*
* @preserve
- * @augments GOVUKFrontendComponentConfigurable<ErrorSummaryConfig>
+ * @augments ConfigurableComponent<ErrorSummaryConfig>
*/
-class ErrorSummary extends GOVUKFrontendComponentConfigurable {
+class ErrorSummary extends ConfigurableComponent {
/**
* @param {Element | null} $root - HTML element to use for error summary
* @param {ErrorSummaryConfig} [config] - Error summary config
diff --git a/packages/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.js b/packages/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.js
index a9ad88164..720200025 100644
--- a/packages/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.js
+++ b/packages/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.js
@@ -146,7 +146,7 @@
GOVUKFrontendComponent.elementType = HTMLElement;
const configOverride = Symbol.for('configOverride');
- class GOVUKFrontendComponentConfigurable extends GOVUKFrontendComponent {
+ class ConfigurableComponent extends GOVUKFrontendComponent {
[configOverride](param) {
return {};
}
@@ -480,9 +480,9 @@
* Exit this page component
*
* @preserve
- * @augments GOVUKFrontendComponentConfigurable<ExitThisPageConfig>
+ * @augments ConfigurableComponent<ExitThisPageConfig>
*/
- class ExitThisPage extends GOVUKFrontendComponentConfigurable {
+ class ExitThisPage extends ConfigurableComponent {
/**
* @param {Element | null} $root - HTML element that wraps the Exit This Page button
* @param {ExitThisPageConfig} [config] - Exit This Page config
diff --git a/packages/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.mjs b/packages/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.mjs
index 726290eeb..bba2c7eae 100644
--- a/packages/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.mjs
+++ b/packages/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.mjs
@@ -140,7 +140,7 @@ class GOVUKFrontendComponent {
GOVUKFrontendComponent.elementType = HTMLElement;
const configOverride = Symbol.for('configOverride');
-class GOVUKFrontendComponentConfigurable extends GOVUKFrontendComponent {
+class ConfigurableComponent extends GOVUKFrontendComponent {
[configOverride](param) {
return {};
}
@@ -474,9 +474,9 @@ I18n.pluralRules = {
* Exit this page component
*
* @preserve
- * @augments GOVUKFrontendComponentConfigurable<ExitThisPageConfig>
+ * @augments ConfigurableComponent<ExitThisPageConfig>
*/
-class ExitThisPage extends GOVUKFrontendComponentConfigurable {
+class ExitThisPage extends ConfigurableComponent {
/**
* @param {Element | null} $root - HTML element that wraps the Exit This Page button
* @param {ExitThisPageConfig} [config] - Exit This Page config
diff --git a/packages/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.mjs b/packages/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.mjs
index c190372f2..7e6bc888e 100644
--- a/packages/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.mjs
+++ b/packages/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.mjs
@@ -1,4 +1,4 @@
-import { GOVUKFrontendComponentConfigurable } from '../../common/configuration.mjs';
+import { ConfigurableComponent } from '../../common/configuration.mjs';
import { ElementError } from '../../errors/index.mjs';
import { I18n } from '../../i18n.mjs';
@@ -6,9 +6,9 @@ import { I18n } from '../../i18n.mjs';
* Exit this page component
*
* @preserve
- * @augments GOVUKFrontendComponentConfigurable<ExitThisPageConfig>
+ * @augments ConfigurableComponent<ExitThisPageConfig>
*/
-class ExitThisPage extends GOVUKFrontendComponentConfigurable {
+class ExitThisPage extends ConfigurableComponent {
/**
* @param {Element | null} $root - HTML element that wraps the Exit This Page button
* @param {ExitThisPageConfig} [config] - Exit This Page config
diff --git a/packages/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.bundle.js b/packages/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.bundle.js
index a64b09dd1..f2e182d04 100644
--- a/packages/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.bundle.js
+++ b/packages/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.bundle.js
@@ -170,7 +170,7 @@
GOVUKFrontendComponent.elementType = HTMLElement;
const configOverride = Symbol.for('configOverride');
- class GOVUKFrontendComponentConfigurable extends GOVUKFrontendComponent {
+ class ConfigurableComponent extends GOVUKFrontendComponent {
[configOverride](param) {
return {};
}
@@ -311,9 +311,9 @@
* Notification Banner component
*
* @preserve
- * @augments GOVUKFrontendComponentConfigurable<NotificationBannerConfig>
+ * @augments ConfigurableComponent<NotificationBannerConfig>
*/
- class NotificationBanner extends GOVUKFrontendComponentConfigurable {
+ class NotificationBanner extends ConfigurableComponent {
/**
* @param {Element | null} $root - HTML element to use for notification banner
* @param {NotificationBannerConfig} [config] - Notification banner config
diff --git a/packages/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.bundle.mjs b/packages/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.bundle.mjs
index d81bfcc4d..a151d2eda 100644
--- a/packages/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.bundle.mjs
+++ b/packages/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.bundle.mjs
@@ -164,7 +164,7 @@ class GOVUKFrontendComponent {
GOVUKFrontendComponent.elementType = HTMLElement;
const configOverride = Symbol.for('configOverride');
-class GOVUKFrontendComponentConfigurable extends GOVUKFrontendComponent {
+class ConfigurableComponent extends GOVUKFrontendComponent {
[configOverride](param) {
return {};
}
@@ -305,9 +305,9 @@ function extractConfigByNamespace(schema, dataset, namespace) {
* Notification Banner component
*
* @preserve
- * @augments GOVUKFrontendComponentConfigurable<NotificationBannerConfig>
+ * @augments ConfigurableComponent<NotificationBannerConfig>
*/
-class NotificationBanner extends GOVUKFrontendComponentConfigurable {
+class NotificationBanner extends ConfigurableComponent {
/**
* @param {Element | null} $root - HTML element to use for notification banner
* @param {NotificationBannerConfig} [config] - Notification banner config
diff --git a/packages/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.mjs b/packages/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.mjs
index 4f9fa98da..51afc2e41 100644
--- a/packages/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.mjs
+++ b/packages/govuk-frontend/dist/govuk/components/notification-banner/notification-banner.mjs
@@ -1,13 +1,13 @@
-import { GOVUKFrontendComponentConfigurable } from '../../common/configuration.mjs';
+import { ConfigurableComponent } from '../../common/configuration.mjs';
import { setFocus } from '../../common/index.mjs';
/**
* Notification Banner component
*
* @preserve
- * @augments GOVUKFrontendComponentConfigurable<NotificationBannerConfig>
+ * @augments ConfigurableComponent<NotificationBannerConfig>
*/
-class NotificationBanner extends GOVUKFrontendComponentConfigurable {
+class NotificationBanner extends ConfigurableComponent {
/**
* @param {Element | null} $root - HTML element to use for notification banner
* @param {NotificationBannerConfig} [config] - Notification banner config
diff --git a/packages/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.js b/packages/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.js
index ddd2862a3..98a4fe025 100644
--- a/packages/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.js
+++ b/packages/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.js
@@ -151,7 +151,7 @@
GOVUKFrontendComponent.elementType = HTMLElement;
const configOverride = Symbol.for('configOverride');
- class GOVUKFrontendComponentConfigurable extends GOVUKFrontendComponent {
+ class ConfigurableComponent extends GOVUKFrontendComponent {
[configOverride](param) {
return {};
}
@@ -485,9 +485,9 @@
* Password input component
*
* @preserve
- * @augments GOVUKFrontendComponentConfigurable<PasswordInputConfig>
+ * @augments ConfigurableComponent<PasswordInputConfig>
*/
- class PasswordInput extends GOVUKFrontendComponentConfigurable {
+ class PasswordInput extends ConfigurableComponent {
/**
* @param {Element | null} $root - HTML element to use for password input
* @param {PasswordInputConfig} [config] - Password input config
diff --git a/packages/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.mjs b/packages/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.mjs
index 1b4d22544..768df71f6 100644
--- a/packages/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.mjs
+++ b/packages/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.mjs
@@ -145,7 +145,7 @@ class GOVUKFrontendComponent {
GOVUKFrontendComponent.elementType = HTMLElement;
const configOverride = Symbol.for('configOverride');
-class GOVUKFrontendComponentConfigurable extends GOVUKFrontendComponent {
+class ConfigurableComponent extends GOVUKFrontendComponent {
[configOverride](param) {
return {};
}
@@ -479,9 +479,9 @@ I18n.pluralRules = {
* Password input component
*
* @preserve
- * @augments GOVUKFrontendComponentConfigurable<PasswordInputConfig>
+ * @augments ConfigurableComponent<PasswordInputConfig>
*/
-class PasswordInput extends GOVUKFrontendComponentConfigurable {
+class PasswordInput extends ConfigurableComponent {
/**
* @param {Element | null} $root - HTML element to use for password input
* @param {PasswordInputConfig} [config] - Password input config
diff --git a/packages/govuk-frontend/dist/govuk/components/password-input/password-input.mjs b/packages/govuk-frontend/dist/govuk/components/password-input/password-input.mjs
index 2900e7028..6e23e64b1 100644
--- a/packages/govuk-frontend/dist/govuk/components/password-input/password-input.mjs
+++ b/packages/govuk-frontend/dist/govuk/components/password-input/password-input.mjs
@@ -1,5 +1,5 @@
import { closestAttributeValue } from '../../common/closest-attribute-value.mjs';
-import { GOVUKFrontendComponentConfigurable } from '../../common/configuration.mjs';
+import { ConfigurableComponent } from '../../common/configuration.mjs';
import { ElementError } from '../../errors/index.mjs';
import { I18n } from '../../i18n.mjs';
@@ -7,9 +7,9 @@ import { I18n } from '../../i18n.mjs';
* Password input component
*
* @preserve
- * @augments GOVUKFrontendComponentConfigurable<PasswordInputConfig>
+ * @augments ConfigurableComponent<PasswordInputConfig>
*/
-class PasswordInput extends GOVUKFrontendComponentConfigurable {
+class PasswordInput extends ConfigurableComponent {
/**
* @param {Element | null} $root - HTML element to use for password input
* @param {PasswordInputConfig} [config] - Password input config
Action run for 81b8df2 |
574ea41
to
8ffe060
Compare
GOVUKFrontendComponentConfigurable
GOVUKFrontendComponentConfigurable
, export ConfigurableComponent
8ffe060
to
c257ca3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All good to go once we have the docs ready 🥳
@patrickpatrickpatrick Code looks good, but I missed that there was no changelog entry for the new feature we're providing, sorry. It doesn't need to be massive, likely something along the lines of what we wrote for the base |
CHANGELOG.md
Outdated
@@ -4,6 +4,21 @@ For advice on how to use these release notes see [our guidance on staying up to | |||
|
|||
## Unreleased | |||
|
|||
### Use our base configurable component to build your own configurable component | |||
|
|||
We've added a ConfigurableComponent class to help you build your own configurable components. It extends our base component class and so it allows you to focus on your components' specific features by handling these shared behaviours across components: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We've added a ConfigurableComponent class to help you build your own configurable components. It extends our base component class and so it allows you to focus on your components' specific features by handling these shared behaviours across components: | |
We've added a `ConfigurableComponent` class to help you build your own configurable components. It extends our base component class and so it allows you to focus on your components' specific features by handling these shared behaviours across components: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One little suggestion, but going to approve.
It'd be good to get a content eye on this entry, but we can finesse this when we generate release notes.
2dccd2d
to
bd2f61d
Compare
`GOVUKFrontendComponentConfigurable` renamed to `ConfigurableComponent`. References to class and test file name updated.
Export as `ConfigurableComponent` from `all.mjs`. Update `all.puppeteer.test.js` test.
bd2f61d
to
81b8df2
Compare
What
GOVUKFrontendComponentConfigurable
renamed toConfigurableComponent
. References to class and test file name updatedConfigurableComponent
exported fromall.mjs
andall.puppeteer.test.js
updated to reflect changeWhy
Fixes #5463