From ef89538864356d3a03cc824d5f4e62ff748bff2f Mon Sep 17 00:00:00 2001 From: simonmilord Date: Thu, 5 Sep 2024 14:59:38 -0400 Subject: [PATCH 1/8] changed the custom DOM events to have quantic prefix --- .../lwc/actionAddFacets/actionAddFacets.js | 4 ++-- .../exampleQuanticRefineToggle.js | 8 ++++---- .../exampleQuanticSort/exampleQuanticSort.js | 4 ++-- .../quanticCardContainer.js | 4 ++-- .../quanticCategoryFacet.js | 2 +- .../quanticCategoryFacetValue.js | 6 +++--- .../__tests__/quanticCitation.test.js | 4 ++-- .../lwc/quanticCitation/quanticCitation.js | 4 ++-- .../lwc/quanticDateFacet/quanticDateFacet.js | 2 +- .../default/lwc/quanticFacet/quanticFacet.js | 2 +- .../lwc/quanticFacetValue/quanticFacetValue.js | 6 +++--- .../__tests__/quanticFeedback.test.js | 9 ++++++--- .../lwc/quanticFeedback/quanticFeedback.js | 18 +++++++++--------- .../quanticFoldedResultList.js | 4 ++-- .../quanticInsightInterface.js | 7 +++++-- .../quanticNumberButton/quanticNumberButton.js | 6 ++++-- .../quanticNumericFacet/quanticNumericFacet.js | 2 +- .../default/lwc/quanticPill/quanticPill.js | 4 ++-- .../__tests__/quanticQuickviewContent.test.js | 2 +- .../quanticQuickviewContent.js | 2 +- .../__tests__/quanticRadioButtonsGroup.test.js | 4 ++-- .../quanticRadioButtonsGroup.js | 4 ++-- .../quanticRecommendationInterface.js | 7 +++++-- .../quanticRecommendationList.js | 4 ++-- .../quanticRefineModalContent.js | 7 +++++-- .../quanticRefineToggle/quanticRefineToggle.js | 7 +++++-- .../lwc/quanticResultList/quanticResultList.js | 4 ++-- .../quanticResultQuickview.js | 9 ++++++--- .../quanticSearchBoxInput.js | 4 ++-- .../quanticSearchBoxSuggestionsList.js | 13 ++++++++----- .../quanticSearchInterface.js | 7 +++++-- .../__tests__/quanticStatefulButton.test.js | 10 ++++++++-- .../quanticStatefulButton.js | 4 ++-- .../main/default/lwc/quanticTab/quanticTab.js | 4 +++- .../default/lwc/quanticTabBar/quanticTabBar.js | 2 +- .../quanticTimeframeFacet.js | 4 ++-- .../default/lwc/quanticUtils/quanticUtils.js | 4 ++-- 37 files changed, 116 insertions(+), 82 deletions(-) diff --git a/packages/quantic/force-app/examples/main/lwc/actionAddFacets/actionAddFacets.js b/packages/quantic/force-app/examples/main/lwc/actionAddFacets/actionAddFacets.js index 616d7e51217..ad76759e81f 100644 --- a/packages/quantic/force-app/examples/main/lwc/actionAddFacets/actionAddFacets.js +++ b/packages/quantic/force-app/examples/main/lwc/actionAddFacets/actionAddFacets.js @@ -10,8 +10,8 @@ export default class ActionAddFacets extends LightningElement { handleAddFacets() { const eventName = this.withoutInputs - ? 'addFacetsWithoutInputs' - : 'addFacets'; + ? 'quantic__addFacetsWithoutInputs' + : 'quantic__addFacets'; const addFacetsEvent = new CustomEvent(eventName, { bubbles: true, composed: true, diff --git a/packages/quantic/force-app/examples/main/lwc/exampleQuanticRefineToggle/exampleQuanticRefineToggle.js b/packages/quantic/force-app/examples/main/lwc/exampleQuanticRefineToggle/exampleQuanticRefineToggle.js index c8576d1b8ea..902ce2bda15 100644 --- a/packages/quantic/force-app/examples/main/lwc/exampleQuanticRefineToggle/exampleQuanticRefineToggle.js +++ b/packages/quantic/force-app/examples/main/lwc/exampleQuanticRefineToggle/exampleQuanticRefineToggle.js @@ -13,17 +13,17 @@ export default class ExampleQuanticRefineToggle extends LightningElement { facetWithoutInputs = false; connectedCallback() { - this.addEventListener('addFacets', this.handleAddFacets); + this.addEventListener('quantic__addFacets', this.handleAddFacets); this.addEventListener( - 'addFacetsWithoutInputs', + 'quantic__addFacetsWithoutInputs', this.handleAddFacetsWithoutInputs ); } disconnectedCallback() { - this.removeEventListener('addFacets', this.handleAddFacets); + this.removeEventListener('quantic__addFacets', this.handleAddFacets); this.removeEventListener( - 'addFacetsWithoutInputs', + 'quantic__addFacetsWithoutInputs', this.handleAddFacetsWithoutInputs ); } diff --git a/packages/quantic/force-app/examples/main/lwc/exampleQuanticSort/exampleQuanticSort.js b/packages/quantic/force-app/examples/main/lwc/exampleQuanticSort/exampleQuanticSort.js index 6771e13f0cf..46a7fa408de 100644 --- a/packages/quantic/force-app/examples/main/lwc/exampleQuanticSort/exampleQuanticSort.js +++ b/packages/quantic/force-app/examples/main/lwc/exampleQuanticSort/exampleQuanticSort.js @@ -14,14 +14,14 @@ export default class ExampleQuanticSort extends LightningElement { connectedCallback() { this.addEventListener( - 'addCustomSortOptions', + 'quantic__addCustomSortOptions', this.handleAddCustomSortOptions ); } disconnectedCallback() { this.removeEventListener( - 'addCustomSortOptions', + 'quantic__addCustomSortOptions', this.handleAddCustomSortOptions ); } diff --git a/packages/quantic/force-app/main/default/lwc/quanticCardContainer/quanticCardContainer.js b/packages/quantic/force-app/main/default/lwc/quanticCardContainer/quanticCardContainer.js index c73b2bb4939..c17e76a6a3d 100644 --- a/packages/quantic/force-app/main/default/lwc/quanticCardContainer/quanticCardContainer.js +++ b/packages/quantic/force-app/main/default/lwc/quanticCardContainer/quanticCardContainer.js @@ -29,14 +29,14 @@ export default class QuanticCardContainer extends LightningElement { handleHeaderClick(evt) { evt.preventDefault(); - const headerClickEvent = new CustomEvent('headerclick', {}); + const headerClickEvent = new CustomEvent('quantic__headerclick', {}); this.dispatchEvent(headerClickEvent); } handleHeaderKeyDown(evt) { if (evt.code === 'Enter' || evt.code === 'Space') { evt.preventDefault(); - const headerKeyDownEvent = new CustomEvent('headerkeydown', {}); + const headerKeyDownEvent = new CustomEvent('quantic__headerkeydown', {}); this.dispatchEvent(headerKeyDownEvent); } } diff --git a/packages/quantic/force-app/main/default/lwc/quanticCategoryFacet/quanticCategoryFacet.js b/packages/quantic/force-app/main/default/lwc/quanticCategoryFacet/quanticCategoryFacet.js index e4b3184b371..af80d9e5c42 100644 --- a/packages/quantic/force-app/main/default/lwc/quanticCategoryFacet/quanticCategoryFacet.js +++ b/packages/quantic/force-app/main/default/lwc/quanticCategoryFacet/quanticCategoryFacet.js @@ -274,7 +274,7 @@ export default class QuanticCategoryFacet extends LightningElement { !this.searchStatus?.state?.hasError && !this.searchStatus?.state?.firstSearchExecuted; - const renderFacetEvent = new CustomEvent('renderfacet', { + const renderFacetEvent = new CustomEvent('quantic__renderfacet', { detail: { id: this.facetId ?? this.field, shouldRenderFacet: !!this.hasParentsOrValues, diff --git a/packages/quantic/force-app/main/default/lwc/quanticCategoryFacetValue/quanticCategoryFacetValue.js b/packages/quantic/force-app/main/default/lwc/quanticCategoryFacetValue/quanticCategoryFacetValue.js index dac0994bdb3..282e9b83744 100644 --- a/packages/quantic/force-app/main/default/lwc/quanticCategoryFacetValue/quanticCategoryFacetValue.js +++ b/packages/quantic/force-app/main/default/lwc/quanticCategoryFacetValue/quanticCategoryFacetValue.js @@ -10,7 +10,7 @@ import {api, LightningElement} from 'lwc'; /** * The `QuanticCategoryFacetValue` component is used by a `QuanticCategoryFacet` component to display a formatted facet value, path to that value and the number of results with that value. - * @fires CustomEvent#selectvalue + * @fires CustomEvent#quantic__selectvalue * @category Search * @category Insight Panel * @example @@ -113,7 +113,7 @@ export default class QuanticCategoryFacetValue extends LightningElement { onSelect(evt) { evt.preventDefault(); this.dispatchEvent( - new CustomEvent('selectvalue', { + new CustomEvent('quantic__selectvalue', { detail: { value: this.facetValue, }, @@ -128,7 +128,7 @@ export default class QuanticCategoryFacetValue extends LightningElement { if (evt.code === 'Enter' || evt.code === 'Space') { evt.preventDefault(); this.dispatchEvent( - new CustomEvent('selectvalue', { + new CustomEvent('quantic__selectvalue', { detail: { value: this.facetValue, }, diff --git a/packages/quantic/force-app/main/default/lwc/quanticCitation/__tests__/quanticCitation.test.js b/packages/quantic/force-app/main/default/lwc/quanticCitation/__tests__/quanticCitation.test.js index f9fe034c507..4d4a3a47cd5 100644 --- a/packages/quantic/force-app/main/default/lwc/quanticCitation/__tests__/quanticCitation.test.js +++ b/packages/quantic/force-app/main/default/lwc/quanticCitation/__tests__/quanticCitation.test.js @@ -155,7 +155,7 @@ describe('c-quantic-citation', () => { it('should dispatch a citation hover event after hovering over the the citation for more than 1200ms, 200ms debounce duration before hover + 1000ms minimum hover duration', async () => { const element = createTestComponent(); await flushPromises(); - setupEventDispatchTest('citationhover'); + setupEventDispatchTest('quantic__citationhover'); const citationLink = element.shadowRoot.querySelector( selectors.citationLink @@ -179,7 +179,7 @@ describe('c-quantic-citation', () => { it('should not dispatch a citation hover event after hovering over the the citation for more than 1200ms', async () => { const element = createTestComponent(); await flushPromises(); - setupEventDispatchTest('citationhover'); + setupEventDispatchTest('quantic__citationhover'); const citationLink = element.shadowRoot.querySelector( selectors.citationLink diff --git a/packages/quantic/force-app/main/default/lwc/quanticCitation/quanticCitation.js b/packages/quantic/force-app/main/default/lwc/quanticCitation/quanticCitation.js index 229118c4b6e..eb3f2e476a1 100644 --- a/packages/quantic/force-app/main/default/lwc/quanticCitation/quanticCitation.js +++ b/packages/quantic/force-app/main/default/lwc/quanticCitation/quanticCitation.js @@ -9,7 +9,7 @@ const debounceDurationBeforeHoverMs = 200; /** * The `QuanticCitation` component renders an individual citation. - * @fires CustomEvent#citationhover + * @fires CustomEvent#quantic__citationhover * @category Internal * @example * @@ -84,7 +84,7 @@ export default class QuanticCitation extends NavigationMixin(LightningElement) { const tooltipDisplayDuration = Date.now() - this.hoverStartTimestamp; if (tooltipDisplayDuration >= minimumTooltipDisplayDurationMs) { this.dispatchEvent( - new CustomEvent('citationhover', { + new CustomEvent('quantic__citationhover', { detail: { citationHoverTimeMs: Date.now() - this.hoverStartTimestamp, }, diff --git a/packages/quantic/force-app/main/default/lwc/quanticDateFacet/quanticDateFacet.js b/packages/quantic/force-app/main/default/lwc/quanticDateFacet/quanticDateFacet.js index e37ae647f0f..39a5a90598b 100644 --- a/packages/quantic/force-app/main/default/lwc/quanticDateFacet/quanticDateFacet.js +++ b/packages/quantic/force-app/main/default/lwc/quanticDateFacet/quanticDateFacet.js @@ -177,7 +177,7 @@ export default class QuanticDateFacet extends LightningElement { !this.searchStatus?.state?.hasError && !this.searchStatus?.state?.firstSearchExecuted; - const renderFacetEvent = new CustomEvent('renderfacet', { + const renderFacetEvent = new CustomEvent('quantic__renderfacet', { detail: { id: this.facetId ?? this.field, shouldRenderFacet: this.hasValues, diff --git a/packages/quantic/force-app/main/default/lwc/quanticFacet/quanticFacet.js b/packages/quantic/force-app/main/default/lwc/quanticFacet/quanticFacet.js index bfb1bbc792a..7994301b74d 100644 --- a/packages/quantic/force-app/main/default/lwc/quanticFacet/quanticFacet.js +++ b/packages/quantic/force-app/main/default/lwc/quanticFacet/quanticFacet.js @@ -272,7 +272,7 @@ export default class QuanticFacet extends LightningElement { !this.searchStatus?.state?.hasError && !this.searchStatus?.state?.firstSearchExecuted; - const renderFacetEvent = new CustomEvent('renderfacet', { + const renderFacetEvent = new CustomEvent('quantic__renderfacet', { detail: { id: this.facetId ?? this.field, shouldRenderFacet: this.hasValues, diff --git a/packages/quantic/force-app/main/default/lwc/quanticFacetValue/quanticFacetValue.js b/packages/quantic/force-app/main/default/lwc/quanticFacetValue/quanticFacetValue.js index 7092728a926..ba30064b7d8 100644 --- a/packages/quantic/force-app/main/default/lwc/quanticFacetValue/quanticFacetValue.js +++ b/packages/quantic/force-app/main/default/lwc/quanticFacetValue/quanticFacetValue.js @@ -13,7 +13,7 @@ import {LightningElement, api} from 'lwc'; /** * The `QuanticFacetValue` component is used by a facet component to display a formatted facet value and the number of results with that value. - * @fires CustomEvent#selectvalue + * @fires CustomEvent#quantic__selectvalue * @category Search * @category Insight Panel * @example @@ -113,7 +113,7 @@ export default class QuanticFacetValue extends LightningElement { onSelect(evt) { evt.preventDefault(); this.dispatchEvent( - new CustomEvent('selectvalue', { + new CustomEvent('quantic__selectvalue', { detail: { value: this.formattedFacetValue, }, @@ -128,7 +128,7 @@ export default class QuanticFacetValue extends LightningElement { if (evt.code === 'Enter' || evt.code === 'Space') { evt.preventDefault(); this.dispatchEvent( - new CustomEvent('selectvalue', { + new CustomEvent('quantic__selectvalue', { detail: { value: this.formattedFacetValue, }, diff --git a/packages/quantic/force-app/main/default/lwc/quanticFeedback/__tests__/quanticFeedback.test.js b/packages/quantic/force-app/main/default/lwc/quanticFeedback/__tests__/quanticFeedback.test.js index 813854d02bc..689f3b8aecb 100644 --- a/packages/quantic/force-app/main/default/lwc/quanticFeedback/__tests__/quanticFeedback.test.js +++ b/packages/quantic/force-app/main/default/lwc/quanticFeedback/__tests__/quanticFeedback.test.js @@ -51,10 +51,13 @@ const defaultOptions = { }; function setupEventListeners(element) { - element.addEventListener('like', functionsMocks.exampleHandleLike); - element.addEventListener('dislike', functionsMocks.exampleHandleDislike); + element.addEventListener('quantic__like', functionsMocks.exampleHandleLike); element.addEventListener( - 'pressexplainwhy', + 'quantic__dislike', + functionsMocks.exampleHandleDislike + ); + element.addEventListener( + 'quantic__pressexplainwhy', functionsMocks.exampleHandleExplainWhy ); } diff --git a/packages/quantic/force-app/main/default/lwc/quanticFeedback/quanticFeedback.js b/packages/quantic/force-app/main/default/lwc/quanticFeedback/quanticFeedback.js index e67a70d7c00..bbe3e788de2 100644 --- a/packages/quantic/force-app/main/default/lwc/quanticFeedback/quanticFeedback.js +++ b/packages/quantic/force-app/main/default/lwc/quanticFeedback/quanticFeedback.js @@ -6,9 +6,9 @@ import {LightningElement, api} from 'lwc'; /** * The `QuanticFeedback` component displays a question and two buttons for giving positive or negative feedback. - * @fires CustomEvent#like - * @fires CustomEvent#dislike - * @fires CustomEvent#pressExplainWhy + * @fires CustomEvent#quantic__like + * @fires CustomEvent#quantic__dislike + * @fires CustomEvent#quantic__pressExplainWhy * @category Search * @category Insight Panel */ @@ -94,12 +94,12 @@ export default class QuanticFeedback extends LightningElement { _size = 'xx-small'; /** - * Fires the "like" event. + * Fires the "quantic__like" event. * @returns {void} */ handleLike() { this.dispatchEvent( - new CustomEvent(`like`, { + new CustomEvent(`quantic__like`, { bubbles: true, composed: true, }) @@ -107,12 +107,12 @@ export default class QuanticFeedback extends LightningElement { } /** - * Fires the "dislike" event. + * Fires the "quantic__dislike" event. * @returns {void} */ handleDislike() { this.dispatchEvent( - new CustomEvent(`dislike`, { + new CustomEvent(`quantic__dislike`, { bubbles: true, composed: true, }) @@ -120,12 +120,12 @@ export default class QuanticFeedback extends LightningElement { } /** - * Fires the "pressexplainwhy" event. + * Fires the "quantic__pressexplainwhy" event. * @returns {void} */ handlePressExplainWhyButton() { this.dispatchEvent( - new CustomEvent(`pressexplainwhy`, { + new CustomEvent(`quantic__pressexplainwhy`, { bubbles: true, composed: true, }) diff --git a/packages/quantic/force-app/main/default/lwc/quanticFoldedResultList/quanticFoldedResultList.js b/packages/quantic/force-app/main/default/lwc/quanticFoldedResultList/quanticFoldedResultList.js index 2cd63fd1cec..804b4b41130 100644 --- a/packages/quantic/force-app/main/default/lwc/quanticFoldedResultList/quanticFoldedResultList.js +++ b/packages/quantic/force-app/main/default/lwc/quanticFoldedResultList/quanticFoldedResultList.js @@ -16,7 +16,7 @@ import {LightningElement, api} from 'lwc'; /** * The `QuanticFoldedResultList` component is responsible for displaying query results by applying one or more result templates. * This component can display query results that have a parent-child relationship with any level of nesting. - * @fires CustomEvent#registerresulttemplates + * @fires CustomEvent#quantic__registerresulttemplates * @category Search * @example * @@ -134,7 +134,7 @@ export default class QuanticFoldedResultList extends LightningElement { registerTemplates() { this.dispatchEvent( - new CustomEvent('registerresulttemplates', { + new CustomEvent('quantic__registerresulttemplates', { bubbles: true, detail: this.resultTemplatesManager, }) diff --git a/packages/quantic/force-app/main/default/lwc/quanticInsightInterface/quanticInsightInterface.js b/packages/quantic/force-app/main/default/lwc/quanticInsightInterface/quanticInsightInterface.js index 801c559afd2..41da4167216 100644 --- a/packages/quantic/force-app/main/default/lwc/quanticInsightInterface/quanticInsightInterface.js +++ b/packages/quantic/force-app/main/default/lwc/quanticInsightInterface/quanticInsightInterface.js @@ -48,9 +48,12 @@ export default class QuanticInsightInterface extends LightningElement { disconnectedCallback() { destroyEngine(this.engineId); if (this.ariaLiveEventsBound) { - this.removeEventListener('arialivemessage', this.handleAriaLiveMessage); this.removeEventListener( - 'registerregion', + 'quantic__arialivemessage', + this.handleAriaLiveMessage + ); + this.removeEventListener( + 'quantic__registerregion', this.handleRegisterAriaLiveRegion ); } diff --git a/packages/quantic/force-app/main/default/lwc/quanticNumberButton/quanticNumberButton.js b/packages/quantic/force-app/main/default/lwc/quanticNumberButton/quanticNumberButton.js index e442d1dfda4..9050740e8f0 100644 --- a/packages/quantic/force-app/main/default/lwc/quanticNumberButton/quanticNumberButton.js +++ b/packages/quantic/force-app/main/default/lwc/quanticNumberButton/quanticNumberButton.js @@ -2,7 +2,7 @@ import {LightningElement, api} from 'lwc'; /** * The `QuanticNumberButton` component is used internally to display a button in a set of buttons with numeric labels. - * @fires CustomEvent#select + * @fires CustomEvent#quantic__select * @category Utility * @example * @@ -40,6 +40,8 @@ export default class QuanticNumberButton extends LightningElement { } select() { - this.dispatchEvent(new CustomEvent('select', {detail: this.number})); + this.dispatchEvent( + new CustomEvent('quantic__select', {detail: this.number}) + ); } } diff --git a/packages/quantic/force-app/main/default/lwc/quanticNumericFacet/quanticNumericFacet.js b/packages/quantic/force-app/main/default/lwc/quanticNumericFacet/quanticNumericFacet.js index 0ab185bfb0a..834a660f81c 100644 --- a/packages/quantic/force-app/main/default/lwc/quanticNumericFacet/quanticNumericFacet.js +++ b/packages/quantic/force-app/main/default/lwc/quanticNumericFacet/quanticNumericFacet.js @@ -293,7 +293,7 @@ export default class QuanticNumericFacet extends LightningElement { !this.searchStatus?.state?.hasError && !this.searchStatus?.state?.firstSearchExecuted; - const renderFacetEvent = new CustomEvent('renderfacet', { + const renderFacetEvent = new CustomEvent('quantic__renderfacet', { detail: { id: this.facetId ?? this.field, shouldRenderFacet: this.shouldRenderFacet, diff --git a/packages/quantic/force-app/main/default/lwc/quanticPill/quanticPill.js b/packages/quantic/force-app/main/default/lwc/quanticPill/quanticPill.js index 339cee100b9..367b6341fe2 100644 --- a/packages/quantic/force-app/main/default/lwc/quanticPill/quanticPill.js +++ b/packages/quantic/force-app/main/default/lwc/quanticPill/quanticPill.js @@ -2,7 +2,7 @@ import {LightningElement, api} from 'lwc'; /** * The `QuanticPill` component is used internally to display a deselectable button. - * @fires CustomEvent#deselect + * @fires CustomEvent#quantic__deselect * @category Utility * @example * @@ -34,7 +34,7 @@ export default class QuanticPill extends LightningElement { @api actionName; deselect() { - this.dispatchEvent(new CustomEvent('deselect')); + this.dispatchEvent(new CustomEvent('quantic__deselect')); } get alternativeText() { diff --git a/packages/quantic/force-app/main/default/lwc/quanticQuickviewContent/__tests__/quanticQuickviewContent.test.js b/packages/quantic/force-app/main/default/lwc/quanticQuickviewContent/__tests__/quanticQuickviewContent.test.js index 787ef93c6f9..1a119247978 100644 --- a/packages/quantic/force-app/main/default/lwc/quanticQuickviewContent/__tests__/quanticQuickviewContent.test.js +++ b/packages/quantic/force-app/main/default/lwc/quanticQuickviewContent/__tests__/quanticQuickviewContent.test.js @@ -68,7 +68,7 @@ describe('c-quantic-quickview-content', () => { const element = createTestComponent(youtubeTestCase.options); await flushPromises(); - setupSimulation(element, 'loadingstatechange'); + setupSimulation(element, 'quantic__loadingstatechange'); const iframe = element.shadowRoot.querySelector( youtubeTestCase.selectors.iframeSelector diff --git a/packages/quantic/force-app/main/default/lwc/quanticQuickviewContent/quanticQuickviewContent.js b/packages/quantic/force-app/main/default/lwc/quanticQuickviewContent/quanticQuickviewContent.js index 6b4f8fc26ef..c38b1f740bf 100644 --- a/packages/quantic/force-app/main/default/lwc/quanticQuickviewContent/quanticQuickviewContent.js +++ b/packages/quantic/force-app/main/default/lwc/quanticQuickviewContent/quanticQuickviewContent.js @@ -33,7 +33,7 @@ export default class QuanticQuickviewContent extends LightningElement { handleIframeLoaded() { this.isLoading = false; - this.dispatchEvent(new CustomEvent('loadingstatechange')); + this.dispatchEvent(new CustomEvent('quantic__loadingstatechange')); } stopPropagation(evt) { diff --git a/packages/quantic/force-app/main/default/lwc/quanticRadioButtonsGroup/__tests__/quanticRadioButtonsGroup.test.js b/packages/quantic/force-app/main/default/lwc/quanticRadioButtonsGroup/__tests__/quanticRadioButtonsGroup.test.js index 7c0648fd214..653ec24cf80 100644 --- a/packages/quantic/force-app/main/default/lwc/quanticRadioButtonsGroup/__tests__/quanticRadioButtonsGroup.test.js +++ b/packages/quantic/force-app/main/default/lwc/quanticRadioButtonsGroup/__tests__/quanticRadioButtonsGroup.test.js @@ -199,7 +199,7 @@ describe('c-quantic-radio-buttons-group', () => { }); describe('User interaction', () => { - it('should dispatch the "change" event when a radio button is clicked', async () => { + it('should dispatch the "quantic__change" event when a radio button is clicked', async () => { const element = createTestComponent(); await flushPromises(); @@ -208,7 +208,7 @@ describe('c-quantic-radio-buttons-group', () => { ); const radioInput = radioInputs[0]; const changeHandler = jest.fn(); - element.addEventListener('change', changeHandler); + element.addEventListener('quantic__change', changeHandler); radioInput.click(); diff --git a/packages/quantic/force-app/main/default/lwc/quanticRadioButtonsGroup/quanticRadioButtonsGroup.js b/packages/quantic/force-app/main/default/lwc/quanticRadioButtonsGroup/quanticRadioButtonsGroup.js index 957e0fb8881..ee1100a4660 100644 --- a/packages/quantic/force-app/main/default/lwc/quanticRadioButtonsGroup/quanticRadioButtonsGroup.js +++ b/packages/quantic/force-app/main/default/lwc/quanticRadioButtonsGroup/quanticRadioButtonsGroup.js @@ -121,7 +121,7 @@ export default class QuanticRadioButtonsGroup extends LightningElement { } this._value = value; this.dispatchEvent( - new CustomEvent('change', { + new CustomEvent('quantic__change', { detail: { value, }, @@ -145,7 +145,7 @@ export default class QuanticRadioButtonsGroup extends LightningElement { this._value = value; this.dispatchEvent( - new CustomEvent('change', { + new CustomEvent('quantic__change', { detail: { value, }, diff --git a/packages/quantic/force-app/main/default/lwc/quanticRecommendationInterface/quanticRecommendationInterface.js b/packages/quantic/force-app/main/default/lwc/quanticRecommendationInterface/quanticRecommendationInterface.js index 28455d6f214..00142193d88 100644 --- a/packages/quantic/force-app/main/default/lwc/quanticRecommendationInterface/quanticRecommendationInterface.js +++ b/packages/quantic/force-app/main/default/lwc/quanticRecommendationInterface/quanticRecommendationInterface.js @@ -104,9 +104,12 @@ export default class QuanticRecommendationInterface extends LightningElement { disconnectedCallback() { if (this.ariaLiveEventsBound) { - this.removeEventListener('arialivemessage', this.handleAriaLiveMessage); this.removeEventListener( - 'registerregion', + 'quantic__arialivemessage', + this.handleAriaLiveMessage + ); + this.removeEventListener( + 'quantic__registerregion', this.handleRegisterAriaLiveRegion ); } diff --git a/packages/quantic/force-app/main/default/lwc/quanticRecommendationList/quanticRecommendationList.js b/packages/quantic/force-app/main/default/lwc/quanticRecommendationList/quanticRecommendationList.js index 44237f127c8..69bf4a9c6f3 100644 --- a/packages/quantic/force-app/main/default/lwc/quanticRecommendationList/quanticRecommendationList.js +++ b/packages/quantic/force-app/main/default/lwc/quanticRecommendationList/quanticRecommendationList.js @@ -29,7 +29,7 @@ import loadingTemplate from './templates/loading.html'; /** * The `QuanticRecommendationList` component displays recommendations by applying one or more result templates in different layouts. - * @fires CustomEvent#registerrecommendationtemplates + * @fires CustomEvent#quantic__registerrecommendationtemplates * @category Recommendation * @example * @@ -182,7 +182,7 @@ export default class QuanticRecommendationList extends LightningElement { conditions: [], }); this.dispatchEvent( - new CustomEvent('registerrecommendationtemplates', { + new CustomEvent('quantic__registerrecommendationtemplates', { bubbles: true, detail: this.resultTemplatesManager, }) diff --git a/packages/quantic/force-app/main/default/lwc/quanticRefineModalContent/quanticRefineModalContent.js b/packages/quantic/force-app/main/default/lwc/quanticRefineModalContent/quanticRefineModalContent.js index aa63e727425..a3ab8dd4ae9 100644 --- a/packages/quantic/force-app/main/default/lwc/quanticRefineModalContent/quanticRefineModalContent.js +++ b/packages/quantic/force-app/main/default/lwc/quanticRefineModalContent/quanticRefineModalContent.js @@ -92,7 +92,7 @@ export default class QuanticRefineModalContent extends LightningElement { connectedCallback() { registerComponentForInit(this, this.engineId); - this.addEventListener('renderfacet', this.handleRenderFacetEvent); + this.addEventListener('quantic__renderfacet', this.handleRenderFacetEvent); } renderedCallback() { @@ -102,7 +102,10 @@ export default class QuanticRefineModalContent extends LightningElement { disconnectedCallback() { this.unsubscribeSearchStatus?.(); this.unsubscribeBreadcrumbManager?.(); - this.removeEventListener('renderfacet', this.handleRenderFacetEvent); + this.removeEventListener( + 'quantic__renderfacet', + this.handleRenderFacetEvent + ); } /** diff --git a/packages/quantic/force-app/main/default/lwc/quanticRefineToggle/quanticRefineToggle.js b/packages/quantic/force-app/main/default/lwc/quanticRefineToggle/quanticRefineToggle.js index 9adc83d18e9..5de9b23d310 100644 --- a/packages/quantic/force-app/main/default/lwc/quanticRefineToggle/quanticRefineToggle.js +++ b/packages/quantic/force-app/main/default/lwc/quanticRefineToggle/quanticRefineToggle.js @@ -106,7 +106,7 @@ export default class QuanticRefineToggle extends LightningElement { connectedCallback() { registerComponentForInit(this, this.engineId); - this.addEventListener('renderfacet', this.handleRenderFacetEvent); + this.addEventListener('quantic__renderfacet', this.handleRenderFacetEvent); } /** @@ -165,7 +165,10 @@ export default class QuanticRefineToggle extends LightningElement { this.unsubscribeQuerySummary?.(); this.unsubscribeBreadcrumbManager?.(); this.unsubscribeSearchStatus?.(); - this.removeEventListener('renderfacet', this.handleRenderFacetEvent); + this.removeEventListener( + 'quantic__renderfacet', + this.handleRenderFacetEvent + ); } get isContentEmpty() { diff --git a/packages/quantic/force-app/main/default/lwc/quanticResultList/quanticResultList.js b/packages/quantic/force-app/main/default/lwc/quanticResultList/quanticResultList.js index 9f64db46449..f1a2d192dd3 100644 --- a/packages/quantic/force-app/main/default/lwc/quanticResultList/quanticResultList.js +++ b/packages/quantic/force-app/main/default/lwc/quanticResultList/quanticResultList.js @@ -16,7 +16,7 @@ import {LightningElement, api, track} from 'lwc'; /** * The `QuanticResultList` component is responsible for displaying query results by applying one or more result templates. - * @fires CustomEvent#registerresulttemplates + * @fires CustomEvent#quantic__registerresulttemplates * @category Search * @category Insight Panel * @example @@ -113,7 +113,7 @@ export default class QuanticResultList extends LightningElement { registerTemplates() { this.dispatchEvent( - new CustomEvent('registerresulttemplates', { + new CustomEvent('quantic__registerresulttemplates', { bubbles: true, detail: this.resultTemplatesManager, }) diff --git a/packages/quantic/force-app/main/default/lwc/quanticResultQuickview/quanticResultQuickview.js b/packages/quantic/force-app/main/default/lwc/quanticResultQuickview/quanticResultQuickview.js index 1a0eb97f5db..9e97c4fc7e8 100644 --- a/packages/quantic/force-app/main/default/lwc/quanticResultQuickview/quanticResultQuickview.js +++ b/packages/quantic/force-app/main/default/lwc/quanticResultQuickview/quanticResultQuickview.js @@ -19,7 +19,7 @@ import {LightningElement, api, track} from 'lwc'; /** * The `QuanticResultQuickview` component renders a button which the end user can click to open a modal box containing certain information about a result. * @category Result Template - * @fires CustomEvent#haspreview + * @fires CustomEvent#quantic__haspreview * @example * */ @@ -121,7 +121,10 @@ export default class QuanticResultQuickview extends LightningElement { ); this.dispatchEvent(resultActionRegister); } - this.addEventListener('loadingstatechange', this.handleLoadingStateChange); + this.addEventListener( + 'quantic__loadingstatechange', + this.handleLoadingStateChange + ); } renderedCallback() { @@ -196,7 +199,7 @@ export default class QuanticResultQuickview extends LightningElement { dispatchHasPreview(hasPreview) { this.dispatchEvent( - new CustomEvent('haspreview', { + new CustomEvent('quantic__haspreview', { detail: { hasPreview, }, diff --git a/packages/quantic/force-app/main/default/lwc/quanticSearchBoxInput/quanticSearchBoxInput.js b/packages/quantic/force-app/main/default/lwc/quanticSearchBoxInput/quanticSearchBoxInput.js index a172df4791a..264d2e2f6b7 100644 --- a/packages/quantic/force-app/main/default/lwc/quanticSearchBoxInput/quanticSearchBoxInput.js +++ b/packages/quantic/force-app/main/default/lwc/quanticSearchBoxInput/quanticSearchBoxInput.js @@ -97,14 +97,14 @@ export default class QuanticSearchBoxInput extends LightningElement { connectedCallback() { this.addEventListener( - 'suggestionlistrender', + 'quantic__suggestionlistrender', this.handleSuggestionListEvent ); } disconnectedCallback() { this.removeEventListener( - 'suggestionlistrender', + 'quantic__suggestionlistrender', this.handleSuggestionListEvent ); } diff --git a/packages/quantic/force-app/main/default/lwc/quanticSearchBoxSuggestionsList/quanticSearchBoxSuggestionsList.js b/packages/quantic/force-app/main/default/lwc/quanticSearchBoxSuggestionsList/quanticSearchBoxSuggestionsList.js index 881fe70c51b..1f5058a8bbc 100644 --- a/packages/quantic/force-app/main/default/lwc/quanticSearchBoxSuggestionsList/quanticSearchBoxSuggestionsList.js +++ b/packages/quantic/force-app/main/default/lwc/quanticSearchBoxSuggestionsList/quanticSearchBoxSuggestionsList.js @@ -163,11 +163,14 @@ export default class QuanticSearchBoxSuggestionsList extends LightningElement { sendSuggestionListIdToInput() { const listboxId = this.template.querySelector('ul').getAttribute('id'); - const suggestionListEvent = new CustomEvent('suggestionlistrender', { - detail: listboxId, - bubbles: true, - composed: true, - }); + const suggestionListEvent = new CustomEvent( + 'quantic__suggestionlistrender', + { + detail: listboxId, + bubbles: true, + composed: true, + } + ); this.dispatchEvent(suggestionListEvent); } diff --git a/packages/quantic/force-app/main/default/lwc/quanticSearchInterface/quanticSearchInterface.js b/packages/quantic/force-app/main/default/lwc/quanticSearchInterface/quanticSearchInterface.js index 5b5756de7fb..c89d25aaf5a 100644 --- a/packages/quantic/force-app/main/default/lwc/quanticSearchInterface/quanticSearchInterface.js +++ b/packages/quantic/force-app/main/default/lwc/quanticSearchInterface/quanticSearchInterface.js @@ -132,9 +132,12 @@ export default class QuanticSearchInterface extends LightningElement { this.unsubscribeUrlManager?.(); window.removeEventListener('hashchange', this.onHashChange); if (this.ariaLiveEventsBound) { - this.removeEventListener('arialivemessage', this.handleAriaLiveMessage); this.removeEventListener( - 'registerregion', + 'quantic__arialivemessage', + this.handleAriaLiveMessage + ); + this.removeEventListener( + 'quantic__registerregion', this.handleRegisterAriaLiveRegion ); } diff --git a/packages/quantic/force-app/main/default/lwc/quanticStatefulButton/__tests__/quanticStatefulButton.test.js b/packages/quantic/force-app/main/default/lwc/quanticStatefulButton/__tests__/quanticStatefulButton.test.js index 5e3228b27af..38675c1cc02 100644 --- a/packages/quantic/force-app/main/default/lwc/quanticStatefulButton/__tests__/quanticStatefulButton.test.js +++ b/packages/quantic/force-app/main/default/lwc/quanticStatefulButton/__tests__/quanticStatefulButton.test.js @@ -20,8 +20,14 @@ const selectors = { }; function setupEventListeners(element) { - element.addEventListener('select', functionsMocks.exampleHandleSelect); - element.addEventListener('deselect', functionsMocks.exampleHandleDeselect); + element.addEventListener( + 'quantic__select', + functionsMocks.exampleHandleSelect + ); + element.addEventListener( + 'quantic__deselect', + functionsMocks.exampleHandleDeselect + ); } const exampleOptions = { diff --git a/packages/quantic/force-app/main/default/lwc/quanticStatefulButton/quanticStatefulButton.js b/packages/quantic/force-app/main/default/lwc/quanticStatefulButton/quanticStatefulButton.js index cc46c8f6567..2f9cbb5f1c8 100644 --- a/packages/quantic/force-app/main/default/lwc/quanticStatefulButton/quanticStatefulButton.js +++ b/packages/quantic/force-app/main/default/lwc/quanticStatefulButton/quanticStatefulButton.js @@ -68,9 +68,9 @@ export default class QuanticStatefulButton extends LightningElement { handleClick(event) { event.stopPropagation(); if (this.selected) { - this.dispatchEvent(new CustomEvent('deselect')); + this.dispatchEvent(new CustomEvent('quantic__deselect')); } else { - this.dispatchEvent(new CustomEvent('select')); + this.dispatchEvent(new CustomEvent('quantic__select')); } } diff --git a/packages/quantic/force-app/main/default/lwc/quanticTab/quanticTab.js b/packages/quantic/force-app/main/default/lwc/quanticTab/quanticTab.js index ed9eef28f6b..85e7c3bb619 100644 --- a/packages/quantic/force-app/main/default/lwc/quanticTab/quanticTab.js +++ b/packages/quantic/force-app/main/default/lwc/quanticTab/quanticTab.js @@ -68,7 +68,9 @@ export default class QuanticTab extends LightningElement { renderedCallback() { initializeWithHeadless(this, this.engineId, this.initialize); - this.dispatchEvent(new CustomEvent('tab_rendered', {bubbles: true})); + this.dispatchEvent( + new CustomEvent('quantic__tab_rendered', {bubbles: true}) + ); } /** diff --git a/packages/quantic/force-app/main/default/lwc/quanticTabBar/quanticTabBar.js b/packages/quantic/force-app/main/default/lwc/quanticTabBar/quanticTabBar.js index 314df55fa3a..f4c5827c4cc 100644 --- a/packages/quantic/force-app/main/default/lwc/quanticTabBar/quanticTabBar.js +++ b/packages/quantic/force-app/main/default/lwc/quanticTabBar/quanticTabBar.js @@ -39,7 +39,7 @@ export default class QuanticTabBar extends LightningElement { connectedCallback() { window.addEventListener('click', this.closeDropdown); window.addEventListener('resize', this.updateTabsDisplay); - this.addEventListener('tab_rendered', this.updateTabsDisplay); + this.addEventListener('quantic__tab_rendered', this.updateTabsDisplay); } renderedCallback() { diff --git a/packages/quantic/force-app/main/default/lwc/quanticTimeframeFacet/quanticTimeframeFacet.js b/packages/quantic/force-app/main/default/lwc/quanticTimeframeFacet/quanticTimeframeFacet.js index b3653d5c73d..eb5e982517c 100644 --- a/packages/quantic/force-app/main/default/lwc/quanticTimeframeFacet/quanticTimeframeFacet.js +++ b/packages/quantic/force-app/main/default/lwc/quanticTimeframeFacet/quanticTimeframeFacet.js @@ -463,10 +463,10 @@ export default class QuanticTimeframeFacet extends LightningElement { } /** - * Fires the 'renderfacet' custom event. + * Fires the 'quantic__renderfacet' custom event. */ sendFacetRenderEvent() { - const renderFacetEvent = new CustomEvent('renderfacet', { + const renderFacetEvent = new CustomEvent('quantic__renderfacet', { detail: { id: this.facetId ?? this.field, shouldRenderFacet: this.showFacet, diff --git a/packages/quantic/force-app/main/default/lwc/quanticUtils/quanticUtils.js b/packages/quantic/force-app/main/default/lwc/quanticUtils/quanticUtils.js index d6092c35252..65452498a5b 100644 --- a/packages/quantic/force-app/main/default/lwc/quanticUtils/quanticUtils.js +++ b/packages/quantic/force-app/main/default/lwc/quanticUtils/quanticUtils.js @@ -550,7 +550,7 @@ export class Store { */ export function AriaLiveRegion(regionName, elem, assertive = false) { function dispatchMessage(message) { - const ariaLiveMessageEvent = new CustomEvent('arialivemessage', { + const ariaLiveMessageEvent = new CustomEvent('quantic__arialivemessage', { bubbles: true, composed: true, detail: { @@ -563,7 +563,7 @@ export function AriaLiveRegion(regionName, elem, assertive = false) { } function registerRegion() { - const registerRegionEvent = new CustomEvent('registerregion', { + const registerRegionEvent = new CustomEvent('quantic__registerregion', { bubbles: true, composed: true, detail: { From e160fdd739fe6ed6317c3a1c9e41a1652096c00e Mon Sep 17 00:00:00 2001 From: simonmilord Date: Thu, 5 Sep 2024 15:24:26 -0400 Subject: [PATCH 2/8] added more changes --- .../actionAddCustomSortOptions.js | 17 ++++++++++------- .../lwc/actionSendRating/actionSendRating.js | 2 +- .../quanticDocumentSuggestion.js | 4 ++-- .../quanticInsightInterface.js | 4 ++-- .../quanticRecommendationInterface.js | 4 ++-- .../quanticSearchInterface.js | 4 ++-- 6 files changed, 19 insertions(+), 16 deletions(-) diff --git a/packages/quantic/force-app/examples/main/lwc/actionAddCustomSortOptions/actionAddCustomSortOptions.js b/packages/quantic/force-app/examples/main/lwc/actionAddCustomSortOptions/actionAddCustomSortOptions.js index 142ff3ef766..0230307f9b9 100644 --- a/packages/quantic/force-app/examples/main/lwc/actionAddCustomSortOptions/actionAddCustomSortOptions.js +++ b/packages/quantic/force-app/examples/main/lwc/actionAddCustomSortOptions/actionAddCustomSortOptions.js @@ -6,13 +6,16 @@ export default class ActionAddCustomSortOptions extends LightningElement { @api label; handleAddCustomSortOptions() { - const addCustomSortOptionsEvent = new CustomEvent('addCustomSortOptions', { - detail: { - withInvalidOptions: this.withInvalidOptions, - }, - bubbles: true, - composed: true, - }); + const addCustomSortOptionsEvent = new CustomEvent( + 'quantic__addCustomSortOptions', + { + detail: { + withInvalidOptions: this.withInvalidOptions, + }, + bubbles: true, + composed: true, + } + ); this.dispatchEvent(addCustomSortOptionsEvent); } } diff --git a/packages/quantic/force-app/examples/main/lwc/actionSendRating/actionSendRating.js b/packages/quantic/force-app/examples/main/lwc/actionSendRating/actionSendRating.js index 5679a2c4dd9..c640269c4e4 100644 --- a/packages/quantic/force-app/examples/main/lwc/actionSendRating/actionSendRating.js +++ b/packages/quantic/force-app/examples/main/lwc/actionSendRating/actionSendRating.js @@ -9,7 +9,7 @@ export default class ActionSendRating extends LightningElement { }, 0); } handleSendRating() { - const customEvent = new CustomEvent('rating', { + const customEvent = new CustomEvent('quantic__rating', { detail: { id: this._id, score: 1, diff --git a/packages/quantic/force-app/main/default/lwc/quanticDocumentSuggestion/quanticDocumentSuggestion.js b/packages/quantic/force-app/main/default/lwc/quanticDocumentSuggestion/quanticDocumentSuggestion.js index 9d9992bdb80..1378d9f4306 100644 --- a/packages/quantic/force-app/main/default/lwc/quanticDocumentSuggestion/quanticDocumentSuggestion.js +++ b/packages/quantic/force-app/main/default/lwc/quanticDocumentSuggestion/quanticDocumentSuggestion.js @@ -84,7 +84,7 @@ export default class QuanticDocumentSuggestion extends LightningElement { this.validateProps(); if (!this.hasInitializationError) { registerComponentForInit(this, this.engineId); - this.template.addEventListener('rating', this.onRating); + this.template.addEventListener('quantic__rating', this.onRating); } } @@ -118,7 +118,7 @@ export default class QuanticDocumentSuggestion extends LightningElement { disconnectedCallback() { this.unsubscribeDocumentSuggestion?.(); - this.template.removeEventListener('rating', this.onRating); + this.template.removeEventListener('quantic__rating', this.onRating); } validateProps() { diff --git a/packages/quantic/force-app/main/default/lwc/quanticInsightInterface/quanticInsightInterface.js b/packages/quantic/force-app/main/default/lwc/quanticInsightInterface/quanticInsightInterface.js index 41da4167216..54f2542a4ac 100644 --- a/packages/quantic/force-app/main/default/lwc/quanticInsightInterface/quanticInsightInterface.js +++ b/packages/quantic/force-app/main/default/lwc/quanticInsightInterface/quanticInsightInterface.js @@ -124,11 +124,11 @@ export default class QuanticInsightInterface extends LightningElement { bindAriaLiveEvents() { this.template.addEventListener( - 'arialivemessage', + 'quantic__arialivemessage', this.handleAriaLiveMessage.bind(this) ); this.template.addEventListener( - 'registerregion', + 'quantic__registerregion', this.handleRegisterAriaLiveRegion.bind(this) ); this.ariaLiveEventsBound = true; diff --git a/packages/quantic/force-app/main/default/lwc/quanticRecommendationInterface/quanticRecommendationInterface.js b/packages/quantic/force-app/main/default/lwc/quanticRecommendationInterface/quanticRecommendationInterface.js index 00142193d88..1d4c83dbf70 100644 --- a/packages/quantic/force-app/main/default/lwc/quanticRecommendationInterface/quanticRecommendationInterface.js +++ b/packages/quantic/force-app/main/default/lwc/quanticRecommendationInterface/quanticRecommendationInterface.js @@ -131,11 +131,11 @@ export default class QuanticRecommendationInterface extends LightningElement { bindAriaLiveEvents() { this.template.addEventListener( - 'arialivemessage', + 'quantic__arialivemessage', this.handleAriaLiveMessage.bind(this) ); this.template.addEventListener( - 'registerregion', + 'quantic__registerregion', this.handleRegisterAriaLiveRegion.bind(this) ); this.ariaLiveEventsBound = true; diff --git a/packages/quantic/force-app/main/default/lwc/quanticSearchInterface/quanticSearchInterface.js b/packages/quantic/force-app/main/default/lwc/quanticSearchInterface/quanticSearchInterface.js index c89d25aaf5a..5e369e464c1 100644 --- a/packages/quantic/force-app/main/default/lwc/quanticSearchInterface/quanticSearchInterface.js +++ b/packages/quantic/force-app/main/default/lwc/quanticSearchInterface/quanticSearchInterface.js @@ -204,11 +204,11 @@ export default class QuanticSearchInterface extends LightningElement { bindAriaLiveEvents() { this.template.addEventListener( - 'arialivemessage', + 'quantic__arialivemessage', this.handleAriaLiveMessage.bind(this) ); this.template.addEventListener( - 'registerregion', + 'quantic__registerregion', this.handleRegisterAriaLiveRegion.bind(this) ); this.ariaLiveEventsBound = true; From 90b5ccb7a403727db6cdf66d8086fb0d49b3b82e Mon Sep 17 00:00:00 2001 From: simonmilord Date: Thu, 12 Sep 2024 09:30:21 -0400 Subject: [PATCH 3/8] reverted naming changes for examples files --- .../actionAddCustomSortOptions.js | 17 +++++++---------- .../main/lwc/actionAddFacets/actionAddFacets.js | 4 ++-- .../lwc/actionSendRating/actionSendRating.js | 2 +- .../exampleQuanticRefineToggle.js | 8 ++++---- .../exampleQuanticSort/exampleQuanticSort.js | 4 ++-- 5 files changed, 16 insertions(+), 19 deletions(-) diff --git a/packages/quantic/force-app/examples/main/lwc/actionAddCustomSortOptions/actionAddCustomSortOptions.js b/packages/quantic/force-app/examples/main/lwc/actionAddCustomSortOptions/actionAddCustomSortOptions.js index 0230307f9b9..142ff3ef766 100644 --- a/packages/quantic/force-app/examples/main/lwc/actionAddCustomSortOptions/actionAddCustomSortOptions.js +++ b/packages/quantic/force-app/examples/main/lwc/actionAddCustomSortOptions/actionAddCustomSortOptions.js @@ -6,16 +6,13 @@ export default class ActionAddCustomSortOptions extends LightningElement { @api label; handleAddCustomSortOptions() { - const addCustomSortOptionsEvent = new CustomEvent( - 'quantic__addCustomSortOptions', - { - detail: { - withInvalidOptions: this.withInvalidOptions, - }, - bubbles: true, - composed: true, - } - ); + const addCustomSortOptionsEvent = new CustomEvent('addCustomSortOptions', { + detail: { + withInvalidOptions: this.withInvalidOptions, + }, + bubbles: true, + composed: true, + }); this.dispatchEvent(addCustomSortOptionsEvent); } } diff --git a/packages/quantic/force-app/examples/main/lwc/actionAddFacets/actionAddFacets.js b/packages/quantic/force-app/examples/main/lwc/actionAddFacets/actionAddFacets.js index ad76759e81f..616d7e51217 100644 --- a/packages/quantic/force-app/examples/main/lwc/actionAddFacets/actionAddFacets.js +++ b/packages/quantic/force-app/examples/main/lwc/actionAddFacets/actionAddFacets.js @@ -10,8 +10,8 @@ export default class ActionAddFacets extends LightningElement { handleAddFacets() { const eventName = this.withoutInputs - ? 'quantic__addFacetsWithoutInputs' - : 'quantic__addFacets'; + ? 'addFacetsWithoutInputs' + : 'addFacets'; const addFacetsEvent = new CustomEvent(eventName, { bubbles: true, composed: true, diff --git a/packages/quantic/force-app/examples/main/lwc/actionSendRating/actionSendRating.js b/packages/quantic/force-app/examples/main/lwc/actionSendRating/actionSendRating.js index c640269c4e4..5679a2c4dd9 100644 --- a/packages/quantic/force-app/examples/main/lwc/actionSendRating/actionSendRating.js +++ b/packages/quantic/force-app/examples/main/lwc/actionSendRating/actionSendRating.js @@ -9,7 +9,7 @@ export default class ActionSendRating extends LightningElement { }, 0); } handleSendRating() { - const customEvent = new CustomEvent('quantic__rating', { + const customEvent = new CustomEvent('rating', { detail: { id: this._id, score: 1, diff --git a/packages/quantic/force-app/examples/main/lwc/exampleQuanticRefineToggle/exampleQuanticRefineToggle.js b/packages/quantic/force-app/examples/main/lwc/exampleQuanticRefineToggle/exampleQuanticRefineToggle.js index 902ce2bda15..c8576d1b8ea 100644 --- a/packages/quantic/force-app/examples/main/lwc/exampleQuanticRefineToggle/exampleQuanticRefineToggle.js +++ b/packages/quantic/force-app/examples/main/lwc/exampleQuanticRefineToggle/exampleQuanticRefineToggle.js @@ -13,17 +13,17 @@ export default class ExampleQuanticRefineToggle extends LightningElement { facetWithoutInputs = false; connectedCallback() { - this.addEventListener('quantic__addFacets', this.handleAddFacets); + this.addEventListener('addFacets', this.handleAddFacets); this.addEventListener( - 'quantic__addFacetsWithoutInputs', + 'addFacetsWithoutInputs', this.handleAddFacetsWithoutInputs ); } disconnectedCallback() { - this.removeEventListener('quantic__addFacets', this.handleAddFacets); + this.removeEventListener('addFacets', this.handleAddFacets); this.removeEventListener( - 'quantic__addFacetsWithoutInputs', + 'addFacetsWithoutInputs', this.handleAddFacetsWithoutInputs ); } diff --git a/packages/quantic/force-app/examples/main/lwc/exampleQuanticSort/exampleQuanticSort.js b/packages/quantic/force-app/examples/main/lwc/exampleQuanticSort/exampleQuanticSort.js index 46a7fa408de..6771e13f0cf 100644 --- a/packages/quantic/force-app/examples/main/lwc/exampleQuanticSort/exampleQuanticSort.js +++ b/packages/quantic/force-app/examples/main/lwc/exampleQuanticSort/exampleQuanticSort.js @@ -14,14 +14,14 @@ export default class ExampleQuanticSort extends LightningElement { connectedCallback() { this.addEventListener( - 'quantic__addCustomSortOptions', + 'addCustomSortOptions', this.handleAddCustomSortOptions ); } disconnectedCallback() { this.removeEventListener( - 'quantic__addCustomSortOptions', + 'addCustomSortOptions', this.handleAddCustomSortOptions ); } From 2072e6255ddfa2273a1c9681ef91ad8dc56d2289 Mon Sep 17 00:00:00 2001 From: simonmilord Date: Thu, 12 Sep 2024 12:47:14 -0400 Subject: [PATCH 4/8] added changes to the html listeners on something.... --- .../recommendation-list/recommendation-list.cypress.ts | 2 +- .../folded-result-list/folded-result-list.cypress.ts | 2 +- .../e2e/default-2/result-list/result-list.cypress.ts | 2 +- .../result-quickview/result-quickview.cypress.ts | 2 +- .../main/lwc/exampleInsightPanel/exampleInsightPanel.html | 2 +- .../exampleQuanticFoldedResultList.html | 2 +- .../exampleQuanticFoldedResultList.js | 2 +- .../exampleQuanticRecommendationList.js | 2 +- .../exampleQuanticResultList/exampleQuanticResultList.js | 2 +- .../examples/main/lwc/exampleSearch/exampleSearch.html | 2 +- .../quanticBreadcrumbManager.html | 8 ++++---- .../lwc/quanticCategoryFacet/quanticCategoryFacet.html | 8 ++++---- .../quanticCategoryFacetValue.js | 2 +- .../default/lwc/quanticDateFacet/quanticDateFacet.html | 4 ++-- .../main/default/lwc/quanticFacet/quanticFacet.html | 8 ++++---- .../default/lwc/quanticFacetValue/quanticFacetValue.js | 2 +- .../lwc/quanticFeedback/__tests__/quanticFeedback.test.js | 8 ++++---- .../main/default/lwc/quanticFeedback/quanticFeedback.html | 4 ++-- .../quanticGeneratedAnswer/templates/generatedAnswer.html | 4 ++-- .../quanticGeneratedAnswerCopyToClipboard.html | 2 +- .../quanticGeneratedAnswerRephraseButtons.html | 2 +- .../lwc/quanticNumberButton/quanticNumberButton.js | 2 +- .../lwc/quanticNumericFacet/quanticNumericFacet.html | 4 ++-- .../main/default/lwc/quanticPager/quanticPager.html | 6 +++--- .../force-app/main/default/lwc/quanticPill/quanticPill.js | 2 +- .../quanticRecentQueriesList.html | 2 +- .../quanticRecentResultsList.html | 2 +- .../main/default/lwc/quanticResult/quanticResult.js | 4 ++-- .../lwc/quanticResultsPerPage/quanticResultsPerPage.html | 2 +- .../lwc/quanticSmartSnippet/quanticSmartSnippet.html | 4 ++-- .../quanticSourceCitations/quanticSourceCitations.html | 2 +- .../force-app/main/default/lwc/quanticTab/quanticTab.js | 2 +- .../main/default/lwc/quanticTabBar/quanticTabBar.js | 2 +- .../lwc/quanticTimeframeFacet/quanticTimeframeFacet.html | 6 +++--- 34 files changed, 56 insertions(+), 56 deletions(-) diff --git a/packages/quantic/cypress/e2e/default-2/recommendation-list/recommendation-list.cypress.ts b/packages/quantic/cypress/e2e/default-2/recommendation-list/recommendation-list.cypress.ts index 71e0cf215d9..a4c933f7f89 100644 --- a/packages/quantic/cypress/e2e/default-2/recommendation-list/recommendation-list.cypress.ts +++ b/packages/quantic/cypress/e2e/default-2/recommendation-list/recommendation-list.cypress.ts @@ -35,7 +35,7 @@ describe('quantic-recommendation-list', () => { const defaultHeadingLevel = 1; const registerRecommendationTemplatesEvent = - 'registerrecommendationtemplates'; + 'quantic__registerrecommendationtemplates'; const recommendationsAlias = '@recommendations'; diff --git a/packages/quantic/cypress/e2e/default-2/result-list/folded-result-list/folded-result-list.cypress.ts b/packages/quantic/cypress/e2e/default-2/result-list/folded-result-list/folded-result-list.cypress.ts index 4843ada2d75..a0bba4476c6 100644 --- a/packages/quantic/cypress/e2e/default-2/result-list/folded-result-list/folded-result-list.cypress.ts +++ b/packages/quantic/cypress/e2e/default-2/result-list/folded-result-list/folded-result-list.cypress.ts @@ -38,7 +38,7 @@ describe('quantic-folded-result-list', () => { const defaultParentField = 'foldingchild'; const defaultChildField = 'foldingparent'; const defaultNumberOfFoldedResults = 2; - const registerResultTemplatesEvent = 'registerresulttemplates'; + const registerResultTemplatesEvent = 'quantic__registerresulttemplates'; function visitFoldedResultList( options: Partial = {}, diff --git a/packages/quantic/cypress/e2e/default-2/result-list/result-list.cypress.ts b/packages/quantic/cypress/e2e/default-2/result-list/result-list.cypress.ts index 7608be658c9..c8f4b7473f6 100644 --- a/packages/quantic/cypress/e2e/default-2/result-list/result-list.cypress.ts +++ b/packages/quantic/cypress/e2e/default-2/result-list/result-list.cypress.ts @@ -25,7 +25,7 @@ describe('quantic-resultlist', () => { const defaultFieldsToInclude = 'date,author,source,language,filetype,parents,sfknowledgearticleid'; - const registerResultTemplatesEvent = 'registerresulttemplates'; + const registerResultTemplatesEvent = 'quantic__registerresulttemplates'; const indexResultsAlias = '@indexResults'; diff --git a/packages/quantic/cypress/e2e/default-2/result-quickview/result-quickview.cypress.ts b/packages/quantic/cypress/e2e/default-2/result-quickview/result-quickview.cypress.ts index 1c3d8695a41..d63bc5c088f 100644 --- a/packages/quantic/cypress/e2e/default-2/result-quickview/result-quickview.cypress.ts +++ b/packages/quantic/cypress/e2e/default-2/result-quickview/result-quickview.cypress.ts @@ -24,7 +24,7 @@ interface ResultQuickviewOptions { describe('quantic-result-quickview', () => { const pageUrl = 's/quantic-result-quickview'; - const haspreview = 'haspreview'; + const haspreview = 'quantic__haspreview'; const resultActionRegister = 'quantic__resultactionregister'; function visitResultQuickview(options: Partial = {}) { diff --git a/packages/quantic/force-app/examples/main/lwc/exampleInsightPanel/exampleInsightPanel.html b/packages/quantic/force-app/examples/main/lwc/exampleInsightPanel/exampleInsightPanel.html index 8e90a8f6f33..dcfa81b965d 100644 --- a/packages/quantic/force-app/examples/main/lwc/exampleInsightPanel/exampleInsightPanel.html +++ b/packages/quantic/force-app/examples/main/lwc/exampleInsightPanel/exampleInsightPanel.html @@ -1,5 +1,5 @@ diff --git a/packages/quantic/force-app/main/default/lwc/quanticTab/quanticTab.js b/packages/quantic/force-app/main/default/lwc/quanticTab/quanticTab.js index 85e7c3bb619..8070b85ff44 100644 --- a/packages/quantic/force-app/main/default/lwc/quanticTab/quanticTab.js +++ b/packages/quantic/force-app/main/default/lwc/quanticTab/quanticTab.js @@ -69,7 +69,7 @@ export default class QuanticTab extends LightningElement { renderedCallback() { initializeWithHeadless(this, this.engineId, this.initialize); this.dispatchEvent( - new CustomEvent('quantic__tab_rendered', {bubbles: true}) + new CustomEvent('quantic__tabrendered', {bubbles: true}) ); } diff --git a/packages/quantic/force-app/main/default/lwc/quanticTabBar/quanticTabBar.js b/packages/quantic/force-app/main/default/lwc/quanticTabBar/quanticTabBar.js index f4c5827c4cc..72a36a2e421 100644 --- a/packages/quantic/force-app/main/default/lwc/quanticTabBar/quanticTabBar.js +++ b/packages/quantic/force-app/main/default/lwc/quanticTabBar/quanticTabBar.js @@ -39,7 +39,7 @@ export default class QuanticTabBar extends LightningElement { connectedCallback() { window.addEventListener('click', this.closeDropdown); window.addEventListener('resize', this.updateTabsDisplay); - this.addEventListener('quantic__tab_rendered', this.updateTabsDisplay); + this.addEventListener('quantic__tabrendered', this.updateTabsDisplay); } renderedCallback() { diff --git a/packages/quantic/force-app/main/default/lwc/quanticTimeframeFacet/quanticTimeframeFacet.html b/packages/quantic/force-app/main/default/lwc/quanticTimeframeFacet/quanticTimeframeFacet.html index d19a27bcab3..47cef4a038a 100644 --- a/packages/quantic/force-app/main/default/lwc/quanticTimeframeFacet/quanticTimeframeFacet.html +++ b/packages/quantic/force-app/main/default/lwc/quanticTimeframeFacet/quanticTimeframeFacet.html @@ -12,7 +12,7 @@