From efbf0f01432efb80a64fecb4bf021100687d49cf Mon Sep 17 00:00:00 2001 From: Cory Rylan Date: Wed, 9 Feb 2022 09:37:20 -0600 Subject: [PATCH] fix(core): lit lifecycle type - fixes change from upstream lit release - closes #6654 Signed-off-by: Cory Rylan --- packages/core/npm.json | 2 +- packages/core/package.json | 2 +- .../src/accordion/accordion-panel.element.ts | 4 ++-- .../core/src/alert/alert-actions.element.ts | 6 +++--- .../core/src/alert/alert-group.element.ts | 8 ++++---- packages/core/src/alert/alert.element.ts | 4 ++-- .../button-action/button-action.element.ts | 2 +- .../button-expand/button-expand.element.ts | 4 ++-- packages/core/src/button/button.element.ts | 6 +++--- .../core/src/dropdown/dropdown.stories.ts | 14 ++++++------- packages/core/src/file/file.element.ts | 6 +++--- .../control-action/control-action.element.ts | 4 ++-- .../control-group/control-group.element.ts | 8 ++++---- .../control-inline/control-inline.element.ts | 8 ++++---- .../core/src/forms/control/control.element.ts | 8 ++++---- .../forms/form-group/form-group.element.ts | 8 ++++---- packages/core/src/icon/icon.element.ts | 8 ++++---- .../core/src/input/input-group.element.ts | 5 +++-- .../overlay/overlay.element.spec.ts | 6 +++--- .../overlay/overlay.element.ts | 6 +++--- .../popup/popup.element.spec.ts | 8 ++++---- .../popup/popup.element.ts | 8 ++++---- .../core/src/internal/decorators/animate.ts | 5 +++-- .../core/src/internal/decorators/property.ts | 5 +++-- .../src/internal/decorators/query-slot.ts | 6 +++--- .../core/src/internal/motion/utils.spec.ts | 12 +++++------ packages/core/src/internal/motion/utils.ts | 9 +++++---- packages/core/src/internal/utils/lit.ts | 8 +++++--- .../navigation/navigation-group.element.ts | 4 ++-- .../src/navigation/navigation-item.element.ts | 6 +++--- .../navigation/navigation-start.element.ts | 6 +++--- .../core/src/navigation/navigation.element.ts | 4 ++-- .../pagination/pagination-button.element.ts | 4 ++-- .../core/src/pagination/pagination.element.ts | 6 +++--- .../progress-circle.element.ts | 4 ++-- .../core/src/radio/radio-group.element.ts | 5 +++-- packages/core/src/radio/radio.element.ts | 5 +++-- packages/core/src/range/range.element.ts | 6 +++--- packages/core/src/select/select.element.ts | 6 +++--- packages/core/src/tag/tag.element.ts | 6 +++--- packages/core/src/toggle/toggle.element.ts | 6 ++++-- .../core/src/tree-view/tree-item.element.ts | 4 ++-- yarn.lock | 20 +++++++++---------- 43 files changed, 141 insertions(+), 131 deletions(-) diff --git a/packages/core/npm.json b/packages/core/npm.json index 1adc819dc..a651cbf9b 100644 --- a/packages/core/npm.json +++ b/packages/core/npm.json @@ -27,7 +27,7 @@ "*" ], "dependencies": { - "lit": "2.1.2", + "lit": "^2.1.3", "ramda": "^0.28.0", "tslib": "^2.3.1" }, diff --git a/packages/core/package.json b/packages/core/package.json index 0da4d696f..e50dc8504 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -47,7 +47,7 @@ "url": "https://github.com/vmware/clarity/issues" }, "dependencies": { - "lit": "2.1.2", + "lit": "^2.1.3", "ramda": "^0.28.0", "tslib": "^2.3.1" }, diff --git a/packages/core/src/accordion/accordion-panel.element.ts b/packages/core/src/accordion/accordion-panel.element.ts index 3a947084a..8ec316bfe 100644 --- a/packages/core/src/accordion/accordion-panel.element.ts +++ b/packages/core/src/accordion/accordion-panel.element.ts @@ -4,7 +4,7 @@ * The full license information can be found in LICENSE in the root directory of this project. */ -import { html, LitElement } from 'lit'; +import { html, LitElement, PropertyValues } from 'lit'; import { AnimationAccordionPanelOpenName, reverseAnimation, @@ -77,7 +77,7 @@ export class CdsAccordionPanel extends LitElement { this.expandedChange.emit(!this.expanded); } - updated(props: Map) { + updated(props: PropertyValues) { super.updated(props); if (this.content && this.header) { diff --git a/packages/core/src/alert/alert-actions.element.ts b/packages/core/src/alert/alert-actions.element.ts index a4f0c894d..cb407510e 100644 --- a/packages/core/src/alert/alert-actions.element.ts +++ b/packages/core/src/alert/alert-actions.element.ts @@ -1,13 +1,13 @@ /* - * Copyright (c) 2016-2021 VMware, Inc. All Rights Reserved. + * Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved. * This software is released under MIT license. * The full license information can be found in LICENSE in the root directory of this project. */ +import { html, LitElement, PropertyValues } from 'lit'; import { AlertGroupTypes } from '@cds/core/alert'; import { CdsButton } from '@cds/core/button'; import { assignSlotNames, baseStyles, querySlotAll, state } from '@cds/core/internal'; -import { html, LitElement } from 'lit'; import styles from './alert-actions.element.scss'; /** @@ -54,7 +54,7 @@ export class CdsAlertActions extends LitElement { assignSlotNames([this, 'actions']); } - updated(props: Map) { + updated(props: PropertyValues) { super.updated(props); this.buttons.forEach(b => { b.status = this.type === 'banner' ? 'inverse' : 'primary'; diff --git a/packages/core/src/alert/alert-group.element.ts b/packages/core/src/alert/alert-group.element.ts index 5b5f7421e..5ef993ba1 100644 --- a/packages/core/src/alert/alert-group.element.ts +++ b/packages/core/src/alert/alert-group.element.ts @@ -1,10 +1,10 @@ /* - * Copyright (c) 2016-2021 VMware, Inc. All Rights Reserved. + * Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved. * This software is released under MIT license. * The full license information can be found in LICENSE in the root directory of this project. */ -import { html, LitElement } from 'lit'; +import { html, LitElement, PropertyValues } from 'lit'; import { query } from 'lit/decorators/query.js'; import { baseStyles, property, querySlot, querySlotAll, syncProps } from '@cds/core/internal'; import { CdsAlert } from './alert.element.js'; @@ -110,7 +110,7 @@ export class CdsAlertGroup extends LitElement { this.role = 'region'; } - firstUpdated(props: Map) { + firstUpdated(props: PropertyValues) { super.firstUpdated(props); this.setupAlertsUpdate(); } @@ -132,7 +132,7 @@ export class CdsAlertGroup extends LitElement { ); } - updated(props: Map) { + updated(props: PropertyValues) { super.updated(props); this.syncAlerts({ status: props.has('status'), diff --git a/packages/core/src/alert/alert.element.ts b/packages/core/src/alert/alert.element.ts index 7d9f200f6..5ef776c40 100644 --- a/packages/core/src/alert/alert.element.ts +++ b/packages/core/src/alert/alert.element.ts @@ -4,7 +4,7 @@ * The full license information can be found in LICENSE in the root directory of this project. */ -import { html, LitElement } from 'lit'; +import { html, LitElement, PropertyValues } from 'lit'; import { baseStyles, event, @@ -181,7 +181,7 @@ export class CdsAlert extends LitElement { setAttributes(this, ['aria-describedby', this.idForAriaDescriber], ['role', 'region']); } - updated(props: Map) { + updated(props: PropertyValues) { super.updated(props); syncDefinedProps(props, this, [this.alertActions]); } diff --git a/packages/core/src/button-action/button-action.element.ts b/packages/core/src/button-action/button-action.element.ts index 827f83110..9d08d1654 100644 --- a/packages/core/src/button-action/button-action.element.ts +++ b/packages/core/src/button-action/button-action.element.ts @@ -59,7 +59,7 @@ export class CdsButtonAction extends CdsBaseButton { `; } - updated(props: PropertyValues) { + updated(props: PropertyValues) { super.updated(props); if (!this.ariaLabel && !this.readonly) { diff --git a/packages/core/src/button-expand/button-expand.element.ts b/packages/core/src/button-expand/button-expand.element.ts index dc042f954..248c9c332 100644 --- a/packages/core/src/button-expand/button-expand.element.ts +++ b/packages/core/src/button-expand/button-expand.element.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2021 VMware, Inc. All Rights Reserved. + * Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved. * This software is released under MIT license. * The full license information can be found in LICENSE in the root directory of this project. */ @@ -61,7 +61,7 @@ export class CdsButtonExpand extends CdsButtonAction { this.pressed = false; } - firstUpdated(props: PropertyValues) { + firstUpdated(props: PropertyValues) { super.firstUpdated(props); if (!this.readonly) { diff --git a/packages/core/src/button/button.element.ts b/packages/core/src/button/button.element.ts index 8aacdb45b..d96906a8c 100644 --- a/packages/core/src/button/button.element.ts +++ b/packages/core/src/button/button.element.ts @@ -4,8 +4,8 @@ * The full license information can be found in LICENSE in the root directory of this project. */ +import { html, PropertyValues } from 'lit'; import { baseStyles, CdsBaseButton, getElementWidth, property } from '@cds/core/internal'; -import { html } from 'lit'; import styles from './button.element.scss'; export const enum ClrLoadingState { @@ -83,7 +83,7 @@ export class CdsButton extends CdsBaseButton { @property({ type: String }) loadingState: keyof typeof ClrLoadingState = ClrLoadingState.default; - firstUpdated(props: Map) { + firstUpdated(props: PropertyValues) { super.firstUpdated(props); if (!this.isDefaultLoadingState(this.loadingState)) { @@ -91,7 +91,7 @@ export class CdsButton extends CdsBaseButton { } } - update(props: Map) { + update(props: PropertyValues) { if (props.has('loadingState')) { if (this.isDefaultLoadingState(props.get('loadingState'))) { // track prior disabled state to set prior value after button is re-enabled from a loading state diff --git a/packages/core/src/dropdown/dropdown.stories.ts b/packages/core/src/dropdown/dropdown.stories.ts index d2ac575af..e45071967 100644 --- a/packages/core/src/dropdown/dropdown.stories.ts +++ b/packages/core/src/dropdown/dropdown.stories.ts @@ -1,17 +1,17 @@ /* - * Copyright (c) 2016-2021 VMware, Inc. All Rights Reserved. + * Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved. * This software is released under MIT license. * The full license information can be found in LICENSE in the root directory of this project. */ +import { html, LitElement, PropertyValues } from 'lit'; +import { query } from 'lit/decorators/query.js'; +import { customElement } from 'lit/decorators/custom-element.js'; import '@cds/core/button/register.js'; import '@cds/core/radio/register.js'; import '@cds/core/dropdown/register.js'; import '@cds/core/modal/register.js'; -import { customElement } from 'lit/decorators/custom-element.js'; import { spreadProps, getElementStorybookArgs, state, property } from '@cds/core/internal'; -import { html, LitElement } from 'lit'; -import { query } from 'lit/decorators/query.js'; import { CdsButton } from '@cds/core/button'; import { CdsDropdown } from '@cds/core/dropdown'; import { CdsModal } from '@cds/core/modal'; @@ -49,7 +49,7 @@ class DemoDropdown extends LitElement { @customElement('demo-dropdown-basic') class DemoDropdownBasic extends DemoDropdown { - firstUpdated(props: Map) { + firstUpdated(props: PropertyValues) { super.firstUpdated(props); this.popup.anchor = this.popupAnchor; } @@ -81,7 +81,7 @@ class DemoDropdownBasic extends DemoDropdown { @customElement('demo-dropdown-scrollable') class DemoDropdownScrollable extends DemoDropdown { - firstUpdated(props: Map) { + firstUpdated(props: PropertyValues) { super.firstUpdated(props); this.popup.anchor = this.popupAnchor; } @@ -292,7 +292,7 @@ class DemoDropdownResponsive extends DemoDropdown { @customElement('demo-dropdown-closable') class DemoDropdownClosable extends DemoDropdown { - firstUpdated(props: Map) { + firstUpdated(props: PropertyValues) { super.firstUpdated(props); this.popup.anchor = this.popupAnchor; } diff --git a/packages/core/src/file/file.element.ts b/packages/core/src/file/file.element.ts index 806f4b6f9..bb93a267a 100644 --- a/packages/core/src/file/file.element.ts +++ b/packages/core/src/file/file.element.ts @@ -1,10 +1,10 @@ /* - * Copyright (c) 2016-2021 VMware, Inc. All Rights Reserved. + * Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved. * This software is released under MIT license. * The full license information can be found in LICENSE in the root directory of this project. */ -import { html } from 'lit'; +import { html, PropertyValues } from 'lit'; import { state } from '@cds/core/internal'; import { i18n, I18nService } from '@cds/core/internal'; import { CdsControl } from '@cds/core/forms'; @@ -62,7 +62,7 @@ export class CdsFile extends CdsControl { : html``; } - firstUpdated(props: Map) { + firstUpdated(props: PropertyValues) { super.firstUpdated(props); (this.inputControl as Element).addEventListener('change', e => { // NOTE: have to distinguish here being user-caused events and programmatic diff --git a/packages/core/src/forms/control-action/control-action.element.ts b/packages/core/src/forms/control-action/control-action.element.ts index 824656e9f..c63c8edcc 100644 --- a/packages/core/src/forms/control-action/control-action.element.ts +++ b/packages/core/src/forms/control-action/control-action.element.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2021 VMware, Inc. All Rights Reserved. + * Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved. * This software is released under MIT license. * The full license information can be found in LICENSE in the root directory of this project. */ @@ -27,7 +27,7 @@ import { CdsButtonAction } from '@cds/core/button-action'; export class CdsControlAction extends CdsButtonAction { @property({ type: String, reflect: true }) action: 'label' | 'prefix' | 'suffix'; - updated(props: PropertyValues) { + updated(props: PropertyValues) { super.updated(props); assignSlotNames([this, this.action ?? false]); } diff --git a/packages/core/src/forms/control-group/control-group.element.ts b/packages/core/src/forms/control-group/control-group.element.ts index 8e0caa0da..f31f80471 100644 --- a/packages/core/src/forms/control-group/control-group.element.ts +++ b/packages/core/src/forms/control-group/control-group.element.ts @@ -1,10 +1,10 @@ /* - * Copyright (c) 2016-2021 VMware, Inc. All Rights Reserved. + * Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved. * This software is released under MIT license. * The full license information can be found in LICENSE in the root directory of this project. */ -import { html, LitElement } from 'lit'; +import { html, LitElement, PropertyValues } from 'lit'; import { query } from 'lit/decorators/query.js'; import { baseStyles, @@ -181,13 +181,13 @@ export class CdsInternalControlGroup extends LitElement { setAttributes(this, ['role', 'group'], ['cds-control-group', '']); } - firstUpdated(props: Map) { + firstUpdated(props: PropertyValues) { super.firstUpdated(props); this.associateLabelAndGroup(); this.setupResponsive(); } - updated(props: Map) { + updated(props: PropertyValues) { super.updated(props); props.set('isControlGroup', true); this.controls.forEach((c: any) => (c.isControlGroup = true)); diff --git a/packages/core/src/forms/control-inline/control-inline.element.ts b/packages/core/src/forms/control-inline/control-inline.element.ts index 9a560c2ba..16bb668e5 100644 --- a/packages/core/src/forms/control-inline/control-inline.element.ts +++ b/packages/core/src/forms/control-inline/control-inline.element.ts @@ -1,10 +1,10 @@ /* - * Copyright (c) 2016-2021 VMware, Inc. All Rights Reserved. + * Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved. * This software is released under MIT license. * The full license information can be found in LICENSE in the root directory of this project. */ -import { html } from 'lit'; +import { html, PropertyValues } from 'lit'; import { EventEmitter, property, event, getElementUpdates, state } from '@cds/core/internal'; import styles from './control-inline.element.scss'; import { CdsControl } from '../control/control.element.js'; @@ -86,7 +86,7 @@ export class CdsInternalControlInline extends CdsControl { `; } - firstUpdated(props: Map) { + firstUpdated(props: PropertyValues) { super.firstUpdated(props); this.inputControl.addEventListener('change', () => (this.checked = this.inputControl.checked)); this.observers.push( @@ -99,7 +99,7 @@ export class CdsInternalControlInline extends CdsControl { ); } - updated(props: Map) { + updated(props: PropertyValues) { super.updated(props); if (props.has('indeterminate') && props.get('indeterminate') !== this.indeterminate && this.indeterminate) { diff --git a/packages/core/src/forms/control/control.element.ts b/packages/core/src/forms/control/control.element.ts index a95878d36..5fc67fc02 100644 --- a/packages/core/src/forms/control/control.element.ts +++ b/packages/core/src/forms/control/control.element.ts @@ -1,10 +1,10 @@ /* - * Copyright (c) 2016-2021 VMware, Inc. All Rights Reserved. + * Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved. * This software is released under MIT license. * The full license information can be found in LICENSE in the root directory of this project. */ -import { html, LitElement, TemplateResult } from 'lit'; +import { html, LitElement, TemplateResult, PropertyValues } from 'lit'; import { query } from 'lit/decorators/query.js'; import { baseStyles, @@ -282,7 +282,7 @@ export class CdsControl extends LitElement { this.setAttribute('cds-control', ''); } - firstUpdated(props: Map) { + firstUpdated(props: PropertyValues) { super.firstUpdated(props); this.setupHostAttributes(); this.setupHTML5Validation(); @@ -293,7 +293,7 @@ export class CdsControl extends LitElement { this.assignSlotIfInControlGroup(); } - updated(props: Map) { + updated(props: PropertyValues) { super.updated(props); this.messages.forEach(message => syncProps(message, this, { disabled: props.has('disabled') })); diff --git a/packages/core/src/forms/form-group/form-group.element.ts b/packages/core/src/forms/form-group/form-group.element.ts index e428368f6..8d8475cc8 100644 --- a/packages/core/src/forms/form-group/form-group.element.ts +++ b/packages/core/src/forms/form-group/form-group.element.ts @@ -1,10 +1,10 @@ /* - * Copyright (c) 2016-2021 VMware, Inc. All Rights Reserved. + * Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved. * This software is released under MIT license. * The full license information can be found in LICENSE in the root directory of this project. */ -import { LitElement, html } from 'lit'; +import { LitElement, html, PropertyValues } from 'lit'; import { baseStyles, querySlotAll, @@ -97,14 +97,14 @@ export class CdsFormGroup extends LitElement { private overflowElement: CdsControl | null; - firstUpdated(props: Map) { + firstUpdated(props: PropertyValues) { super.firstUpdated(props); this.syncLayouts(); this.setControlLabelWidths(); this.observers.push(elementVisible(this, () => this.setControlLabelWidths())); } - updated(props: Map) { + updated(props: PropertyValues) { super.updated(props); syncDefinedProps(props, this, this.controlsAndGroups); } diff --git a/packages/core/src/icon/icon.element.ts b/packages/core/src/icon/icon.element.ts index f615ed328..5e344dc79 100644 --- a/packages/core/src/icon/icon.element.ts +++ b/packages/core/src/icon/icon.element.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2021 VMware, Inc. All Rights Reserved. + * Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved. * This software is released under MIT license. * The full license information can be found in LICENSE in the root directory of this project. */ @@ -18,7 +18,7 @@ import { EventSubscription, GlobalStateService, } from '@cds/core/internal'; -import { html, LitElement, svg } from 'lit'; +import { html, LitElement, svg, PropertyValues } from 'lit'; import { query } from 'lit/decorators/query.js'; import styles from './icon.element.scss'; import { ClarityIcons } from './icon.service.js'; @@ -156,7 +156,7 @@ export class CdsIcon extends LitElement { private subscription: EventSubscription; - updated(props: Map) { + updated(props: PropertyValues) { if (props.has('innerOffset') && this.innerOffset > 0) { const val = pxToRem(-1 * this.innerOffset); const dimension = `calc(100% + ${pxToRem(this.innerOffset * 2)})`; @@ -166,7 +166,7 @@ export class CdsIcon extends LitElement { } } - firstUpdated(props: Map) { + firstUpdated(props: PropertyValues) { super.firstUpdated(props); let prior = 'unknown'; diff --git a/packages/core/src/input/input-group.element.ts b/packages/core/src/input/input-group.element.ts index d0430de28..e5453910b 100644 --- a/packages/core/src/input/input-group.element.ts +++ b/packages/core/src/input/input-group.element.ts @@ -1,9 +1,10 @@ /* - * Copyright (c) 2016-2021 VMware, Inc. All Rights Reserved. + * Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved. * This software is released under MIT license. * The full license information can be found in LICENSE in the root directory of this project. */ +import { PropertyValues } from 'lit'; import { querySlotAll } from '@cds/core/internal'; import { CdsInternalControlGroup, ControlLabelLayout } from '@cds/core/forms'; import styles from './input-group.element.scss'; @@ -47,7 +48,7 @@ export class CdsInputGroup extends CdsInternalControlGroup { return [super.styles, styles]; } - firstUpdated(props: Map) { + firstUpdated(props: PropertyValues) { super.firstUpdated(props); this.controls.forEach(c => { c.responsive = false; diff --git a/packages/core/src/internal-components/overlay/overlay.element.spec.ts b/packages/core/src/internal-components/overlay/overlay.element.spec.ts index d4d3f8af7..3f1a0744a 100644 --- a/packages/core/src/internal-components/overlay/overlay.element.spec.ts +++ b/packages/core/src/internal-components/overlay/overlay.element.spec.ts @@ -1,9 +1,9 @@ /* - * Copyright (c) 2016-2021 VMware, Inc. All Rights Reserved. + * Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved. * This software is released under MIT license. * The full license information can be found in LICENSE in the root directory of this project. */ -import { html, LitElement } from 'lit'; +import { html, LitElement, PropertyValues } from 'lit'; import { query } from 'lit/decorators/query.js'; import '@cds/core/internal-components/overlay/register.js'; import { CdsInternalOverlay, isNestedOverlay, overlayIsActive } from '@cds/core/internal-components/overlay'; @@ -182,7 +182,7 @@ class NestedOverlayTestComponent extends LitElement { @property({ type: String }) overlayId: string; - firstUpdated(props: Map) { + firstUpdated(props: PropertyValues) { super.firstUpdated(props); this.overlay.addEventListener('closeChange', () => { this.overlay.hidden = true; diff --git a/packages/core/src/internal-components/overlay/overlay.element.ts b/packages/core/src/internal-components/overlay/overlay.element.ts index d987d24f4..4945312a0 100644 --- a/packages/core/src/internal-components/overlay/overlay.element.ts +++ b/packages/core/src/internal-components/overlay/overlay.element.ts @@ -21,7 +21,7 @@ import { property, reverseAnimation, } from '@cds/core/internal'; -import { html } from 'lit'; +import { html, PropertyValues } from 'lit'; import { query } from 'lit/decorators/query.js'; import styles from './overlay.element.scss'; import sharedStyles from './shared.element.scss'; @@ -95,12 +95,12 @@ export class CdsInternalStaticOverlay extends CdsBaseFocusTrap { this.ariaModal = 'true'; } - firstUpdated(props: Map) { + firstUpdated(props: PropertyValues) { super.firstUpdated(props); this.backdrop.addEventListener('click', this.fireEventOnBackdropClick); } - updated(props: Map) { + updated(props: PropertyValues) { super.updated(props); const oldLayered = this.isLayered; const newLayered = isNestedOverlay( diff --git a/packages/core/src/internal-components/popup/popup.element.spec.ts b/packages/core/src/internal-components/popup/popup.element.spec.ts index 04c6028d0..2f27d9a75 100644 --- a/packages/core/src/internal-components/popup/popup.element.spec.ts +++ b/packages/core/src/internal-components/popup/popup.element.spec.ts @@ -1,10 +1,10 @@ /* - * Copyright (c) 2016-2021 VMware, Inc. All Rights Reserved. + * Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved. * This software is released under MIT license. * The full license information can be found in LICENSE in the root directory of this project. */ -import { html, LitElement } from 'lit'; +import { html, LitElement, PropertyValues } from 'lit'; import { query } from 'lit/decorators/query.js'; import { customElement } from 'lit/decorators/custom-element.js'; import '@cds/core/internal-components/popup/register.js'; @@ -28,7 +28,7 @@ class PopupTestBasic extends LitElement { testAnchorId = 'my-anchor'; - firstUpdated(props: Map) { + firstUpdated(props: PropertyValues) { super.firstUpdated(props); this.popup.container = this; } @@ -48,7 +48,7 @@ class PopupTestAnchors extends LitElement { testAnchorOneId = 'anchor-one'; testAnchorTwoId = 'anchor-two'; - firstUpdated(props: Map) { + firstUpdated(props: PropertyValues) { super.firstUpdated(props); this.popup.container = this; } diff --git a/packages/core/src/internal-components/popup/popup.element.ts b/packages/core/src/internal-components/popup/popup.element.ts index 973d20d68..93fd03913 100644 --- a/packages/core/src/internal-components/popup/popup.element.ts +++ b/packages/core/src/internal-components/popup/popup.element.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2021 VMware, Inc. All Rights Reserved. + * Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved. * This software is released under MIT license. * The full license information can be found in LICENSE in the root directory of this project. */ @@ -24,7 +24,7 @@ import { setPopupPosition, state, } from '@cds/core/internal'; -import { html } from 'lit'; +import { html, PropertyValues } from 'lit'; import { query } from 'lit/decorators/query.js'; import { CdsInternalStaticOverlay } from '@cds/core/internal-components/overlay'; @@ -221,12 +221,12 @@ export class CdsInternalPopup extends CdsInternalStaticOverlay implements Positi // --- lifecycle --- - firstUpdated(props: Map) { + firstUpdated(props: PropertyValues) { super.firstUpdated(props); this.setUpPositioningObserver(); } - updated(props: Map) { + updated(props: PropertyValues) { if (this.pointer && !this.pointer.hasAttribute('part')) { setAttributes(this.pointer, ['part', 'pointer']); } diff --git a/packages/core/src/internal/decorators/animate.ts b/packages/core/src/internal/decorators/animate.ts index 6552dc680..b4edd1aa9 100644 --- a/packages/core/src/internal/decorators/animate.ts +++ b/packages/core/src/internal/decorators/animate.ts @@ -1,9 +1,10 @@ /* - * Copyright (c) 2016-2021 VMware, Inc. All Rights Reserved. + * Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved. * This software is released under MIT license. * The full license information can be found in LICENSE in the root directory of this project. */ +import { PropertyValues } from 'lit'; import { AnimatableElement, AnimationStatus, @@ -23,7 +24,7 @@ export function animate(config: PropertyDrivenAnimation) { _animations = config; - updated(props: Map) { + updated(props: PropertyValues) { super.updated(props); if (!this._animationReady && !this.hasAttribute(PRIVATE_ANIMATION_STATUS_ATTR_NAME)) { diff --git a/packages/core/src/internal/decorators/property.ts b/packages/core/src/internal/decorators/property.ts index 53ca58cab..4256407de 100644 --- a/packages/core/src/internal/decorators/property.ts +++ b/packages/core/src/internal/decorators/property.ts @@ -1,9 +1,10 @@ /* - * Copyright (c) 2016-2021 VMware, Inc. All Rights Reserved. + * Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved. * This software is released under MIT license. * The full license information can be found in LICENSE in the root directory of this project. */ +import { PropertyValues } from 'lit'; import { property as _property } from 'lit/decorators/property.js'; import { camelCaseToKebabCase, kebabCaseToPascalCase, capitalizeFirstLetter } from '../utils/string.js'; import { LogService } from '../services/log.service.js'; @@ -70,7 +71,7 @@ export function getDefaultOptions(propertyKey: string, options?: PropertyConfig) export function requirePropertyCheck(protoOrDescriptor: any, name: string, options?: PropertyConfig) { const targetFirstUpdated: () => void = protoOrDescriptor.firstUpdated; - function firstUpdated(this: any, props: Map): void { + function firstUpdated(this: any, props: PropertyValues): void { if (options && options.required && isNilOrEmpty(this[name])) { const message = options.requiredMessage || getRequiredMessage(options.required, name, this.tagName); if (options.required === 'error') { diff --git a/packages/core/src/internal/decorators/query-slot.ts b/packages/core/src/internal/decorators/query-slot.ts index eb5a03f5d..0c1064f30 100644 --- a/packages/core/src/internal/decorators/query-slot.ts +++ b/packages/core/src/internal/decorators/query-slot.ts @@ -1,10 +1,10 @@ /* - * Copyright (c) 2016-2021 VMware, Inc. All Rights Reserved. + * Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved. * This software is released under MIT license. * The full license information can be found in LICENSE in the root directory of this project. */ -import { LitElement } from 'lit'; +import { LitElement, PropertyValues } from 'lit'; import { LogService, notProductionEnvironment } from '../services/log.service.js'; // Slot Query decorators are similar to the query decorator in lit. @@ -93,7 +93,7 @@ export function querySlotAll(selector: string, config?: QuerySlotConfig) { return (protoOrDescriptor: Record | any, name?: PropertyKey): any => { const targetFirstUpdated: () => void = protoOrDescriptor.firstUpdated; - function firstUpdated(this: any, props: Map): void { + function firstUpdated(this: any, props: PropertyValues): void { if (config?.assign) { Array.from(this.querySelectorAll(selector)) .filter((i: any) => !i.hasAttribute('slot')) diff --git a/packages/core/src/internal/motion/utils.spec.ts b/packages/core/src/internal/motion/utils.spec.ts index 7acc286ec..6bbd16819 100644 --- a/packages/core/src/internal/motion/utils.spec.ts +++ b/packages/core/src/internal/motion/utils.spec.ts @@ -4,7 +4,7 @@ * The full license information can be found in LICENSE in the root directory of this project. */ -import { html, LitElement } from 'lit'; +import { html, LitElement, PropertyValues } from 'lit'; import clone from 'ramda/es/clone.js'; import { componentIsStable, createTestElement, removeTestElement } from '@cds/core/test'; import { registerElementSafely, property, event, EventEmitter } from '@cds/core/internal'; @@ -120,7 +120,7 @@ describe('Animation Helpers: ', () => { it('bails if the host element does not have the property (weird edge case)', async () => { const testElement = await createTestElement(html`
ohai
`); - const propMap: Map = new Map(); + const propMap: PropertyValues = new Map(); propMap.set('jabberwocky', 'wat'); const didRun = await runPropertyAnimations(propMap, (testElement as unknown) as AnimatableElement); @@ -135,7 +135,7 @@ describe('Animation Helpers: ', () => { ); component.everythingIsFine = false; - const propMap: Map = new Map(); + const propMap: PropertyValues = new Map(); propMap.set('everythingIsFine', false); const didRun = await runPropertyAnimations(propMap, component); @@ -146,7 +146,7 @@ describe('Animation Helpers: ', () => { it('bails if there is no animation associated with the property value', async () => { const testElement = await createTestElement(html`
ohai
`); const component = testElement.querySelector('.hayy'); - const propMap: Map = new Map(); + const propMap: PropertyValues = new Map(); propMap.set('jabberwocky', 'wat'); (component as any).jabberwocky = 'wat'; const didRun = await runPropertyAnimations(propMap, (component as unknown) as AnimatableElement); @@ -160,7 +160,7 @@ describe('Animation Helpers: ', () => { ClarityMotion.add('something', [{ animation: [{ opacity: 0 }, { opacity: 1 }] }]); component.everythingIsFine = true; await componentIsStable(component); - const propMap: Map = new Map(); + const propMap: PropertyValues = new Map(); propMap.set('everythingIsFine', !component.everythingIsFine); // wants to run the 'something' animation const didRun = await runPropertyAnimations(propMap, (component as unknown) as AnimatableElement); expect(didRun).toBe(true); @@ -172,7 +172,7 @@ describe('Animation Helpers: ', () => { const component = testElement.querySelector('test-animate-utils-element'); component.everythingIsFine = false; await componentIsStable(component); - const propMap: Map = new Map(); + const propMap: PropertyValues = new Map(); propMap.set('everythingIsFine', !component.everythingIsFine); // wants to run a 'nothing' animation; which does not exist! const didRun = await runPropertyAnimations(propMap, (component as unknown) as AnimatableElement); expect(didRun).toBe(false); diff --git a/packages/core/src/internal/motion/utils.ts b/packages/core/src/internal/motion/utils.ts index dd46ec9e8..546b71f1a 100644 --- a/packages/core/src/internal/motion/utils.ts +++ b/packages/core/src/internal/motion/utils.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2021 VMware, Inc. All Rights Reserved. + * Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved. * This software is released under MIT license. * The full license information can be found in LICENSE in the root directory of this project. */ @@ -26,6 +26,7 @@ import { isPrefixedBy, isSuffixedBy, getNumericValueFromCssSecondsStyleValue, re import { queryChildFromLightOrShadowDom } from '../utils/dom.js'; import { allPropertiesPass } from '../utils/identity.js'; import { getMillisecondsFromSeconds } from '../utils/math.js'; +import { PropertyValues } from 'lit'; /** * runPropertyAnimations() is a utility function called by the @animate(). It is a single point of entry @@ -40,7 +41,7 @@ import { getMillisecondsFromSeconds } from '../utils/math.js'; * @internal */ /* c8 ignore next */ -export async function runPropertyAnimations(props: Map, hostEl: AnimatableElement): Promise { +export async function runPropertyAnimations(props: PropertyValues, hostEl: AnimatableElement): Promise { if (!hostEl._animations) { LogService.warn(`${hostEl.tagName.toLocaleLowerCase()} is trying to animate but no animations are defined.`); return false; @@ -372,7 +373,7 @@ export function sizeDimensionKeyframes( /* c8 ignore next */ export function filterAnimationsByUpdatedProperties( animations: PropertyDrivenAnimation, - updatingProps: Map + updatingProps: PropertyValues ): PropertyDrivenAnimation | null { if (animations === null || animations === undefined) { return null; @@ -442,7 +443,7 @@ export function getHidingAndNonHidingPropertyAnimations( /* c8 ignore next */ export function getPropertyAnimations( animations: PropertyDrivenAnimation, - updatingProps: Map + updatingProps: PropertyValues ): TargetedAnimationAsPropertyTuple[] { const activeAnimations = filterAnimationsByUpdatedProperties(animations || {}, updatingProps); diff --git a/packages/core/src/internal/utils/lit.ts b/packages/core/src/internal/utils/lit.ts index 2b07fb465..30f07ade9 100644 --- a/packages/core/src/internal/utils/lit.ts +++ b/packages/core/src/internal/utils/lit.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2021 VMware, Inc. All Rights Reserved. + * Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved. * This software is released under MIT license. * The full license information can be found in LICENSE in the root directory of this project. */ @@ -20,11 +20,13 @@ export function childrenUpdateComplete(elements: LitElement[] | NodeListOf, + props: PropertyValues, source: { [prop: string]: any }, targets: { [prop: string]: any }[] ) { - props.forEach((_value, key) => targets.filter(t => t && t[key] !== undefined).forEach(t => (t[key] = source[key]))); + props.forEach((_value, key: any) => + targets.filter(t => t && t[key] !== undefined).forEach(t => (t[key] = source[key])) + ); } /** diff --git a/packages/core/src/navigation/navigation-group.element.ts b/packages/core/src/navigation/navigation-group.element.ts index 9b763db16..342fbfd48 100644 --- a/packages/core/src/navigation/navigation-group.element.ts +++ b/packages/core/src/navigation/navigation-group.element.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2021 VMware, Inc. All Rights Reserved. + * Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved. * This software is released under MIT license. * The full license information can be found in LICENSE in the root directory of this project. */ @@ -161,7 +161,7 @@ export class CdsNavigationGroup extends LitElement { this.groupStart.removeEventListener('click', this.toggle.bind(this)); } - protected firstUpdated(props: PropertyValues) { + protected firstUpdated(props: PropertyValues) { super.firstUpdated(props); if (this.groupStart) { this.groupStart.addEventListener('click', this.toggle.bind(this)); diff --git a/packages/core/src/navigation/navigation-item.element.ts b/packages/core/src/navigation/navigation-item.element.ts index 2b6130d5e..9115c83a8 100644 --- a/packages/core/src/navigation/navigation-item.element.ts +++ b/packages/core/src/navigation/navigation-item.element.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2021 VMware, Inc. All Rights Reserved. + * Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved. * This software is released under MIT license. * The full license information can be found in LICENSE in the root directory of this project. */ @@ -79,7 +79,7 @@ export class CdsNavigationItem extends LitElement implements FocusableItem { } } - firstUpdated(props: PropertyValues) { + firstUpdated(props: PropertyValues) { super.firstUpdated(props); this.handleItemAnchorText(); manageScreenReaderElements(this, this.expanded); @@ -108,7 +108,7 @@ export class CdsNavigationItem extends LitElement implements FocusableItem { return [baseStyles, styles]; } - protected updated(props: PropertyValues) { + protected updated(props: PropertyValues) { super.updated(props); manageScreenReaderElements(this, this.expanded); } diff --git a/packages/core/src/navigation/navigation-start.element.ts b/packages/core/src/navigation/navigation-start.element.ts index da31736fd..ea27eed1c 100644 --- a/packages/core/src/navigation/navigation-start.element.ts +++ b/packages/core/src/navigation/navigation-start.element.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2021 VMware, Inc. All Rights Reserved. + * Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved. * This software is released under MIT license. * The full license information can be found in LICENSE in the root directory of this project. */ @@ -110,7 +110,7 @@ export class CdsNavigationStart extends LitElement implements FocusableItem { } } - firstUpdated(props: PropertyValues) { + firstUpdated(props: PropertyValues) { super.firstUpdated(props); const button = this.shadowRoot?.querySelector('button'); if (button) { @@ -191,7 +191,7 @@ export class CdsNavigationStart extends LitElement implements FocusableItem { return getToggleIconDirection(this); } - updated(props: PropertyValues) { + updated(props: PropertyValues) { super.updated(props); manageScreenReaderElements(this, this.expandedRoot); } diff --git a/packages/core/src/navigation/navigation.element.ts b/packages/core/src/navigation/navigation.element.ts index cbf030733..44e45de6a 100644 --- a/packages/core/src/navigation/navigation.element.ts +++ b/packages/core/src/navigation/navigation.element.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2021 VMware, Inc. All Rights Reserved. + * Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved. * This software is released under MIT license. * The full license information can be found in LICENSE in the root directory of this project. */ @@ -218,7 +218,7 @@ export class CdsNavigation extends LitElement { } } - firstUpdated(props: PropertyValues) { + firstUpdated(props: PropertyValues) { super.firstUpdated(props); // set all visible navigation elements to tabindex = -1 this.allNavigationElements.forEach(item => { diff --git a/packages/core/src/pagination/pagination-button.element.ts b/packages/core/src/pagination/pagination-button.element.ts index 8bf0c8f4a..af9f10af4 100644 --- a/packages/core/src/pagination/pagination-button.element.ts +++ b/packages/core/src/pagination/pagination-button.element.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2021 VMware, Inc. All Rights Reserved. + * Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved. * This software is released under MIT license. * The full license information can be found in LICENSE in the root directory of this project. */ @@ -54,7 +54,7 @@ export class CdsPaginationButton extends CdsButtonAction { @query('cds-icon') private cdsIcon: CdsIcon; - updated(props: PropertyValues) { + updated(props: PropertyValues) { super.updated(props); const { shape, direction } = getPaginationIconConfig(this.action); diff --git a/packages/core/src/pagination/pagination.element.ts b/packages/core/src/pagination/pagination.element.ts index 91d7dcc59..bdb245688 100644 --- a/packages/core/src/pagination/pagination.element.ts +++ b/packages/core/src/pagination/pagination.element.ts @@ -1,12 +1,12 @@ /* - * Copyright (c) 2016-2021 VMware, Inc. All Rights Reserved. + * Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved. * This software is released under MIT license. * The full license information can be found in LICENSE in the root directory of this project. */ -import { baseStyles, globalStyle, LogService, notProductionEnvironment, querySlot } from '@cds/core/internal'; import { css, html, LitElement, PropertyValues } from 'lit'; import { cache } from 'lit/directives/cache.js'; +import { baseStyles, globalStyle, LogService, notProductionEnvironment, querySlot } from '@cds/core/internal'; import { CdsInput } from '@cds/core/input'; import styles from './pagination.element.scss'; @@ -55,7 +55,7 @@ export class CdsPagination extends LitElement { return [baseStyles, styles]; } - firstUpdated(props: PropertyValues) { + firstUpdated(props: PropertyValues) { super.firstUpdated(props); this.setupNumberInput(); this.validateAriaLabel(); diff --git a/packages/core/src/progress-circle/progress-circle.element.ts b/packages/core/src/progress-circle/progress-circle.element.ts index 314926722..7f60c4eac 100644 --- a/packages/core/src/progress-circle/progress-circle.element.ts +++ b/packages/core/src/progress-circle/progress-circle.element.ts @@ -4,6 +4,7 @@ * The full license information can be found in LICENSE in the root directory of this project. */ +import { html, LitElement, PropertyValues } from 'lit'; import { baseStyles, hasStringPropertyChanged, @@ -14,7 +15,6 @@ import { i18n, isNilOrEmpty, } from '@cds/core/internal'; -import { html, LitElement, PropertyValues } from 'lit'; import { getProgressCircleRadius } from './progress-circle.utils.js'; import styles from './progress-circle.element.scss'; @@ -119,7 +119,7 @@ export class CdsProgressCircle extends LitElement { this.updateAria(); } - protected updated(props: PropertyValues) { + protected updated(props: PropertyValues) { super.updated(props); if (props.has('value') || props.has('i18n')) { diff --git a/packages/core/src/radio/radio-group.element.ts b/packages/core/src/radio/radio-group.element.ts index 621326de0..c41c635c2 100644 --- a/packages/core/src/radio/radio-group.element.ts +++ b/packages/core/src/radio/radio-group.element.ts @@ -1,9 +1,10 @@ /* - * Copyright (c) 2016-2021 VMware, Inc. All Rights Reserved. + * Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved. * This software is released under MIT license. * The full license information can be found in LICENSE in the root directory of this project. */ +import { PropertyValues } from 'lit'; import { querySlotAll, id } from '@cds/core/internal'; import { CdsInternalControlGroup } from '@cds/core/forms'; import { CdsRadio } from './radio.element.js'; @@ -42,7 +43,7 @@ export class CdsRadioGroup extends CdsInternalControlGroup { return [...super.styles]; } - firstUpdated(props: Map) { + firstUpdated(props: PropertyValues) { super.firstUpdated(props); this.associateRadioControls(); this.syncRadioControls(); diff --git a/packages/core/src/radio/radio.element.ts b/packages/core/src/radio/radio.element.ts index dc6bb7e94..d399d14c8 100644 --- a/packages/core/src/radio/radio.element.ts +++ b/packages/core/src/radio/radio.element.ts @@ -1,9 +1,10 @@ /* - * Copyright (c) 2016-2021 VMware, Inc. All Rights Reserved. + * Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved. * This software is released under MIT license. * The full license information can be found in LICENSE in the root directory of this project. */ +import { PropertyValues } from 'lit'; import { CdsInternalControlInline } from '@cds/core/forms'; import styles from './radio.element.scss'; @@ -33,7 +34,7 @@ export class CdsRadio extends CdsInternalControlInline { return [...super.styles, styles]; } - firstUpdated(props: Map) { + firstUpdated(props: PropertyValues) { super.firstUpdated(props); if (!this.isControlGroup) { diff --git a/packages/core/src/range/range.element.ts b/packages/core/src/range/range.element.ts index 7246f6188..f4feff237 100644 --- a/packages/core/src/range/range.element.ts +++ b/packages/core/src/range/range.element.ts @@ -1,10 +1,10 @@ /* - * Copyright (c) 2016-2021 VMware, Inc. All Rights Reserved. + * Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved. * This software is released under MIT license. * The full license information can be found in LICENSE in the root directory of this project. */ -import { html } from 'lit'; +import { html, PropertyValues } from 'lit'; import { globalStyle } from '@cds/core/internal'; import { CdsControl } from '@cds/core/forms'; import globalStyles from './range.global.scss'; @@ -47,7 +47,7 @@ export class CdsRange extends CdsControl { return html`
`; } - firstUpdated(props: Map) { + firstUpdated(props: PropertyValues) { super.firstUpdated(props); this.setTrackWidth(); this.inputControl.addEventListener('input', () => this.setTrackWidth()); diff --git a/packages/core/src/select/select.element.ts b/packages/core/src/select/select.element.ts index 4e11ee132..efd7dc3ff 100644 --- a/packages/core/src/select/select.element.ts +++ b/packages/core/src/select/select.element.ts @@ -1,10 +1,10 @@ /* - * Copyright (c) 2016-2021 VMware, Inc. All Rights Reserved. + * Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved. * This software is released under MIT license. * The full license information can be found in LICENSE in the root directory of this project. */ -import { html } from 'lit'; +import { html, PropertyValues } from 'lit'; import { globalStyle, state, listenForAttributeChange } from '@cds/core/internal'; import { CdsControl } from '@cds/core/forms'; import { inputStyles } from '@cds/core/input'; @@ -57,7 +57,7 @@ export class CdsSelect extends CdsControl { @state({ type: Boolean, reflect: true }) protected size = false; - firstUpdated(props: Map) { + firstUpdated(props: PropertyValues) { super.firstUpdated(props); this.multiple = this.inputControl.hasAttribute('multiple'); this.observers.push(listenForAttributeChange(this.inputControl, 'multiple', val => (this.multiple = val !== null))); diff --git a/packages/core/src/tag/tag.element.ts b/packages/core/src/tag/tag.element.ts index 873c3212d..e4b4acde5 100644 --- a/packages/core/src/tag/tag.element.ts +++ b/packages/core/src/tag/tag.element.ts @@ -1,11 +1,11 @@ /* - * Copyright (c) 2016-2021 VMware, Inc. All Rights Reserved. + * Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved. * This software is released under MIT license. * The full license information can be found in LICENSE in the root directory of this project. */ +import { html, PropertyValues } from 'lit'; import { baseStyles, CdsBaseButton, id, property, querySlot, StatusTypes, syncProps } from '@cds/core/internal'; -import { html } from 'lit'; import styles from './tag.element.scss'; /** @@ -63,7 +63,7 @@ export class CdsTag extends CdsBaseButton { @querySlot('cds-badge', { assign: 'tag-badge' }) protected badge: HTMLElement; - updated(props: Map) { + updated(props: PropertyValues) { super.updated(props); if (props.has('closable') && props.get('closable') === true) { diff --git a/packages/core/src/toggle/toggle.element.ts b/packages/core/src/toggle/toggle.element.ts index 262b6250d..59e0fdb38 100644 --- a/packages/core/src/toggle/toggle.element.ts +++ b/packages/core/src/toggle/toggle.element.ts @@ -1,8 +1,10 @@ /* - * Copyright (c) 2016-2021 VMware, Inc. All Rights Reserved. + * Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved. * This software is released under MIT license. * The full license information can be found in LICENSE in the root directory of this project. */ + +import { PropertyValues } from 'lit'; import { property } from '@cds/core/internal'; import { CdsInternalControlInline } from '@cds/core/forms'; import styles from './toggle.element.scss'; @@ -38,7 +40,7 @@ export class CdsToggle extends CdsInternalControlInline { @property({ type: String }) cdsMotion = 'on'; - async updated(props: Map) { + async updated(props: PropertyValues) { super.updated(props); // this section fixes an issue with toggles animating when the page loads diff --git a/packages/core/src/tree-view/tree-item.element.ts b/packages/core/src/tree-view/tree-item.element.ts index dfcf86573..dd9f52032 100644 --- a/packages/core/src/tree-view/tree-item.element.ts +++ b/packages/core/src/tree-view/tree-item.element.ts @@ -18,7 +18,7 @@ import { querySlotAll, reverseAnimation, } from '@cds/core/internal'; -import { html, LitElement } from 'lit'; +import { html, LitElement, PropertyValues } from 'lit'; import { ifDefined } from 'lit/directives/if-defined.js'; import styles from './tree-item.element.scss'; @@ -117,7 +117,7 @@ export class CdsTreeItem extends LitElement { } } - updated(props: Map) { + updated(props: PropertyValues) { super.updated(props); if (this.treeItemChildren.length > 0) { diff --git a/yarn.lock b/yarn.lock index 9f75e6fb0..5c6ec3cb1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4879,7 +4879,7 @@ integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== "@cds/angular@./dist/angular": - version "6.0.0-next.3" + version "6.0.0-next.4" dependencies: jsdom "^16.5.3" tslib "^2.0.0" @@ -4892,7 +4892,7 @@ "@cds/core@./dist/core": version "0.0.0" dependencies: - lit "2.1.2" + lit "^2.1.3" ramda "^0.28.0" tslib "^2.3.1" optionalDependencies: @@ -22382,19 +22382,19 @@ lit@2.0.2, lit@^2.0.0: lit-element "^3.0.0" lit-html "^2.0.0" -lit@2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/lit/-/lit-2.1.2.tgz#e08c24c950fb15a98cc328a8c17e7b4d377f5c48" - integrity sha512-XacK89dJXF7BJbpiZSMvzT4RxHag7Wt+yNx7tErEVgGVlOFAeN871bj7ivotCMgYeBFWVp/hjKF/PDTk6L7gMA== +lit@^2.0.2: + version "2.1.0" + resolved "https://registry.yarnpkg.com/lit/-/lit-2.1.0.tgz#27b8767efbc400bd31bf62257113951fb878dd01" + integrity sha512-C0YoUUzxHA1S8gR7AmgD+k9GZlw3QD2ECgARo/jMx76RfVEAmEubF9t5sON9frMEZ++YvuokR5o8FgIUF7nnag== dependencies: "@lit/reactive-element" "^1.1.0" lit-element "^3.1.0" lit-html "^2.1.0" -lit@^2.0.2: - version "2.1.0" - resolved "https://registry.yarnpkg.com/lit/-/lit-2.1.0.tgz#27b8767efbc400bd31bf62257113951fb878dd01" - integrity sha512-C0YoUUzxHA1S8gR7AmgD+k9GZlw3QD2ECgARo/jMx76RfVEAmEubF9t5sON9frMEZ++YvuokR5o8FgIUF7nnag== +lit@^2.1.3: + version "2.1.3" + resolved "https://registry.yarnpkg.com/lit/-/lit-2.1.3.tgz#b8a94ae2303eb6eb802a6f28cfdf3f288d4fa879" + integrity sha512-46KtKy7iDoY3wZ5VSqBlXll6J/tli5gRMPFRWi5qQ01lvIqcO+dYQwb1l1NYZjbzcHnGnCKrMb8nDv7/ZE4Y4g== dependencies: "@lit/reactive-element" "^1.1.0" lit-element "^3.1.0"