diff --git a/web-components/packages/carbon-web-components/src/components/accordion/accordion-item.ts b/web-components/packages/carbon-web-components/src/components/accordion/accordion-item.ts index e4c2f37182ec..bc7f54f6efa3 100644 --- a/web-components/packages/carbon-web-components/src/components/accordion/accordion-item.ts +++ b/web-components/packages/carbon-web-components/src/components/accordion/accordion-item.ts @@ -1,7 +1,7 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. @@ -9,12 +9,13 @@ import settings from 'carbon-components/es/globals/js/settings'; import { classMap } from 'lit-html/directives/class-map'; -import { html, property, customElement, LitElement } from 'lit-element'; +import { html, property, LitElement } from 'lit-element'; import ChevronRight16 from '@carbon/icons/lib/chevron--right/16'; import FocusMixin from '../../globals/mixins/focus'; import Handle from '../../globals/internal/handle'; import { ACCORDION_ITEM_BREAKPOINT } from './defs'; import styles from './accordion.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; export { ACCORDION_ITEM_BREAKPOINT }; @@ -189,7 +190,7 @@ class BXAccordionItem extends FocusMixin(LitElement) { part="expando" class="${prefix}--accordion__heading" aria-controls="content" - aria-expanded="${String(Boolean(open))}" + aria-expanded="${open}" @click="${handleClickExpando}" @keydown="${handleKeydownExpando}"> ${ChevronRight16({ diff --git a/web-components/packages/carbon-web-components/src/components/accordion/accordion.ts b/web-components/packages/carbon-web-components/src/components/accordion/accordion.ts index 5dd3b663114b..1ce7ad9c7bb6 100644 --- a/web-components/packages/carbon-web-components/src/components/accordion/accordion.ts +++ b/web-components/packages/carbon-web-components/src/components/accordion/accordion.ts @@ -1,17 +1,18 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ -import { html, property, customElement, LitElement } from 'lit-element'; +import { html, property, LitElement } from 'lit-element'; import settings from 'carbon-components/es/globals/js/settings'; import { forEach } from '../../globals/internal/collection-helpers'; import { ACCORDION_SIZE } from './defs'; import styles from './accordion.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; export { ACCORDION_SIZE }; diff --git a/web-components/packages/carbon-web-components/src/components/breadcrumb/breadcrumb-item.ts b/web-components/packages/carbon-web-components/src/components/breadcrumb/breadcrumb-item.ts index b9abe902c9d8..5eb4609d3692 100644 --- a/web-components/packages/carbon-web-components/src/components/breadcrumb/breadcrumb-item.ts +++ b/web-components/packages/carbon-web-components/src/components/breadcrumb/breadcrumb-item.ts @@ -1,15 +1,16 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ -import { html, customElement, LitElement } from 'lit-element'; +import { html, LitElement } from 'lit-element'; import settings from 'carbon-components/es/globals/js/settings'; import styles from './breadcrumb.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/breadcrumb/breadcrumb-link.ts b/web-components/packages/carbon-web-components/src/components/breadcrumb/breadcrumb-link.ts index 9819284ed46b..09d393fce84d 100644 --- a/web-components/packages/carbon-web-components/src/components/breadcrumb/breadcrumb-link.ts +++ b/web-components/packages/carbon-web-components/src/components/breadcrumb/breadcrumb-link.ts @@ -1,16 +1,16 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ -import { customElement } from 'lit-element'; import settings from 'carbon-components/es/globals/js/settings'; import BXLink from '../link/link'; import styles from './breadcrumb.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/breadcrumb/breadcrumb-overflow-menu.ts b/web-components/packages/carbon-web-components/src/components/breadcrumb/breadcrumb-overflow-menu.ts index e3aab0ac9e48..b014362912dd 100644 --- a/web-components/packages/carbon-web-components/src/components/breadcrumb/breadcrumb-overflow-menu.ts +++ b/web-components/packages/carbon-web-components/src/components/breadcrumb/breadcrumb-overflow-menu.ts @@ -1,17 +1,18 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ -import { customElement, html } from 'lit-element'; +import { html } from 'lit-element'; import settings from 'carbon-components/es/globals/js/settings'; import OverflowMenuHorizontal16 from '@carbon/icons/lib/overflow-menu--horizontal/16'; import BXOverflowMenu from '../overflow-menu/overflow-menu'; import styles from './breadcrumb.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/breadcrumb/breadcrumb.ts b/web-components/packages/carbon-web-components/src/components/breadcrumb/breadcrumb.ts index 7215dfb036e4..7e98d5961511 100644 --- a/web-components/packages/carbon-web-components/src/components/breadcrumb/breadcrumb.ts +++ b/web-components/packages/carbon-web-components/src/components/breadcrumb/breadcrumb.ts @@ -1,15 +1,16 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ -import { html, customElement, LitElement } from 'lit-element'; +import { html, LitElement } from 'lit-element'; import settings from 'carbon-components/es/globals/js/settings'; import styles from './breadcrumb.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/button/button-skeleton.ts b/web-components/packages/carbon-web-components/src/components/button/button-skeleton.ts index 9109de2a304d..20a3fd7f2df0 100644 --- a/web-components/packages/carbon-web-components/src/components/button/button-skeleton.ts +++ b/web-components/packages/carbon-web-components/src/components/button/button-skeleton.ts @@ -1,7 +1,7 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. @@ -9,10 +9,11 @@ import settings from 'carbon-components/es/globals/js/settings'; import { classMap } from 'lit-html/directives/class-map'; -import { html, customElement } from 'lit-element'; +import { html } from 'lit-element'; import ifNonNull from '../../globals/directives/if-non-null'; import BXButton from './button'; import styles from './button.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/button/button.ts b/web-components/packages/carbon-web-components/src/components/button/button.ts index 9342d9a2ae3e..ce03a3f106ca 100644 --- a/web-components/packages/carbon-web-components/src/components/button/button.ts +++ b/web-components/packages/carbon-web-components/src/components/button/button.ts @@ -1,7 +1,7 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. @@ -9,13 +9,14 @@ import settings from 'carbon-components/es/globals/js/settings'; import { classMap } from 'lit-html/directives/class-map'; -import { html, property, customElement, LitElement } from 'lit-element'; +import { html, property, LitElement } from 'lit-element'; import ifNonNull from '../../globals/directives/if-non-null'; import FocusMixin from '../../globals/mixins/focus'; import { BUTTON_KIND, BUTTON_SIZE, BUTTON_ICON_LAYOUT } from './defs'; import styles from './button.scss'; import HostListener from '../../globals/decorators/host-listener'; import HostListenerMixin from '../../globals/mixins/host-listener'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; export { BUTTON_KIND, BUTTON_SIZE, BUTTON_ICON_LAYOUT }; diff --git a/web-components/packages/carbon-web-components/src/components/checkbox/checkbox.ts b/web-components/packages/carbon-web-components/src/components/checkbox/checkbox.ts index 16ffb562eccd..6b37a838553a 100644 --- a/web-components/packages/carbon-web-components/src/components/checkbox/checkbox.ts +++ b/web-components/packages/carbon-web-components/src/components/checkbox/checkbox.ts @@ -1,19 +1,20 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ import { classMap } from 'lit-html/directives/class-map'; -import { html, property, query, customElement, LitElement } from 'lit-element'; +import { html, property, query, LitElement } from 'lit-element'; import settings from 'carbon-components/es/globals/js/settings'; import ifNonNull from '../../globals/directives/if-non-null'; import FocusMixin from '../../globals/mixins/focus'; import FormMixin from '../../globals/mixins/form'; import styles from './checkbox.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/code-snippet/code-snippet-skeleton.ts b/web-components/packages/carbon-web-components/src/components/code-snippet/code-snippet-skeleton.ts index 66af11772d42..c5598a11e6cf 100644 --- a/web-components/packages/carbon-web-components/src/components/code-snippet/code-snippet-skeleton.ts +++ b/web-components/packages/carbon-web-components/src/components/code-snippet/code-snippet-skeleton.ts @@ -1,16 +1,17 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ -import { html, property, customElement, LitElement } from 'lit-element'; +import { html, property, LitElement } from 'lit-element'; import settings from 'carbon-components/es/globals/js/settings'; import { CODE_SNIPPET_TYPE } from './code-snippet'; import styles from './code-snippet.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/code-snippet/code-snippet.ts b/web-components/packages/carbon-web-components/src/components/code-snippet/code-snippet.ts index 4a090f6f94b6..5f601d5390a8 100644 --- a/web-components/packages/carbon-web-components/src/components/code-snippet/code-snippet.ts +++ b/web-components/packages/carbon-web-components/src/components/code-snippet/code-snippet.ts @@ -1,7 +1,7 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. @@ -9,7 +9,7 @@ import { classMap } from 'lit-html/directives/class-map'; import { TemplateResult } from 'lit-html'; -import { html, property, query, customElement, LitElement } from 'lit-element'; +import { html, property, query, LitElement } from 'lit-element'; import ChevronDown16 from '@carbon/icons/lib/chevron--down/16'; import settings from 'carbon-components/es/globals/js/settings'; import FocusMixin from '../../globals/mixins/focus'; @@ -19,6 +19,7 @@ import { } from '../copy-button/copy-button'; import { CODE_SNIPPET_COLOR_SCHEME, CODE_SNIPPET_TYPE } from './defs'; import styles from './code-snippet.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; export { CODE_SNIPPET_COLOR_SCHEME, CODE_SNIPPET_TYPE }; diff --git a/web-components/packages/carbon-web-components/src/components/combo-box/combo-box-item.ts b/web-components/packages/carbon-web-components/src/components/combo-box/combo-box-item.ts index b0a350c89ab7..d1b679c2fbe7 100644 --- a/web-components/packages/carbon-web-components/src/components/combo-box/combo-box-item.ts +++ b/web-components/packages/carbon-web-components/src/components/combo-box/combo-box-item.ts @@ -1,14 +1,14 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ import settings from 'carbon-components/es/globals/js/settings'; -import { customElement } from 'lit-element'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; import BXDropdownItem from '../dropdown/dropdown-item'; import styles from './combo-box.scss'; diff --git a/web-components/packages/carbon-web-components/src/components/combo-box/combo-box.ts b/web-components/packages/carbon-web-components/src/components/combo-box/combo-box.ts index 62538e3ebf52..9d1f61bea5eb 100644 --- a/web-components/packages/carbon-web-components/src/components/combo-box/combo-box.ts +++ b/web-components/packages/carbon-web-components/src/components/combo-box/combo-box.ts @@ -1,7 +1,7 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. @@ -9,12 +9,13 @@ import settings from 'carbon-components/es/globals/js/settings'; import { TemplateResult } from 'lit-html'; -import { html, property, query, customElement } from 'lit-element'; +import { html, property, query } from 'lit-element'; import Close16 from '@carbon/icons/lib/close/16'; import { findIndex, forEach } from '../../globals/internal/collection-helpers'; import BXDropdown, { DROPDOWN_KEYBOARD_ACTION } from '../dropdown/dropdown'; import BXComboBoxItem from './combo-box-item'; import styles from './combo-box.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; export { DROPDOWN_COLOR_SCHEME, diff --git a/web-components/packages/carbon-web-components/src/components/content-switcher/content-switcher-item.ts b/web-components/packages/carbon-web-components/src/components/content-switcher/content-switcher-item.ts index e6f3485be425..2856b42a85ba 100644 --- a/web-components/packages/carbon-web-components/src/components/content-switcher/content-switcher-item.ts +++ b/web-components/packages/carbon-web-components/src/components/content-switcher/content-switcher-item.ts @@ -1,18 +1,19 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ import { classMap } from 'lit-html/directives/class-map'; -import { html, property, customElement, LitElement } from 'lit-element'; +import { html, property, LitElement } from 'lit-element'; import settings from 'carbon-components/es/globals/js/settings'; import ifNonNull from '../../globals/directives/if-non-null'; import FocusMixin from '../../globals/mixins/focus'; import styles from './content-switcher.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/content-switcher/content-switcher.ts b/web-components/packages/carbon-web-components/src/components/content-switcher/content-switcher.ts index d945b170f1fd..5c8d35fd50a3 100644 --- a/web-components/packages/carbon-web-components/src/components/content-switcher/content-switcher.ts +++ b/web-components/packages/carbon-web-components/src/components/content-switcher/content-switcher.ts @@ -1,18 +1,19 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ -import { html, property, customElement, LitElement } from 'lit-element'; +import { html, property, LitElement } from 'lit-element'; import settings from 'carbon-components/es/globals/js/settings'; import { forEach, indexOf } from '../../globals/internal/collection-helpers'; import { NAVIGATION_DIRECTION, CONTENT_SWITCHER_SIZE } from './defs'; import BXSwitch from './content-switcher-item'; import styles from './content-switcher.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; export { NAVIGATION_DIRECTION, CONTENT_SWITCHER_SIZE }; diff --git a/web-components/packages/carbon-web-components/src/components/copy-button/copy-button.ts b/web-components/packages/carbon-web-components/src/components/copy-button/copy-button.ts index b507d1503421..ebd225d53eb7 100644 --- a/web-components/packages/carbon-web-components/src/components/copy-button/copy-button.ts +++ b/web-components/packages/carbon-web-components/src/components/copy-button/copy-button.ts @@ -1,7 +1,7 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. @@ -10,11 +10,12 @@ import { classMap } from 'lit-html/directives/class-map'; import { TemplateResult } from 'lit-html'; import { ifDefined } from 'lit-html/directives/if-defined'; -import { html, property, customElement, LitElement } from 'lit-element'; +import { html, property, LitElement } from 'lit-element'; import Copy16 from '@carbon/icons/lib/copy/16'; import settings from 'carbon-components/es/globals/js/settings'; import FocusMixin from '../../globals/mixins/focus'; import styles from './copy-button.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/data-table/table-batch-actions.ts b/web-components/packages/carbon-web-components/src/components/data-table/table-batch-actions.ts index 2e49854c8ad6..5ee196fc1857 100644 --- a/web-components/packages/carbon-web-components/src/components/data-table/table-batch-actions.ts +++ b/web-components/packages/carbon-web-components/src/components/data-table/table-batch-actions.ts @@ -1,15 +1,16 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ -import { html, property, customElement, LitElement } from 'lit-element'; +import { html, property, LitElement } from 'lit-element'; import settings from 'carbon-components/es/globals/js/settings'; import styles from './data-table.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/data-table/table-body.ts b/web-components/packages/carbon-web-components/src/components/data-table/table-body.ts index 18da51545750..0a071217e9bc 100644 --- a/web-components/packages/carbon-web-components/src/components/data-table/table-body.ts +++ b/web-components/packages/carbon-web-components/src/components/data-table/table-body.ts @@ -1,17 +1,18 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ import settings from 'carbon-components/es/globals/js/settings'; -import { html, property, query, customElement, LitElement } from 'lit-element'; +import { html, property, query, LitElement } from 'lit-element'; import { TABLE_COLOR_SCHEME } from './defs'; import BXTableRow from './table-row'; import styles from './data-table.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/data-table/table-cell-skeleton.ts b/web-components/packages/carbon-web-components/src/components/data-table/table-cell-skeleton.ts index 2eedbab50e82..c97c5ccdf46a 100644 --- a/web-components/packages/carbon-web-components/src/components/data-table/table-cell-skeleton.ts +++ b/web-components/packages/carbon-web-components/src/components/data-table/table-cell-skeleton.ts @@ -1,15 +1,16 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ -import { html, customElement } from 'lit-element'; +import { html } from 'lit-element'; import settings from 'carbon-components/es/globals/js/settings'; import BXTableCell from './table-cell'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/data-table/table-cell.ts b/web-components/packages/carbon-web-components/src/components/data-table/table-cell.ts index 44f4daa88408..4d333ab74aec 100644 --- a/web-components/packages/carbon-web-components/src/components/data-table/table-cell.ts +++ b/web-components/packages/carbon-web-components/src/components/data-table/table-cell.ts @@ -1,14 +1,15 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ import settings from 'carbon-components/es/globals/js/settings'; -import { html, customElement, LitElement } from 'lit-element'; +import { html, LitElement } from 'lit-element'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; import styles from './data-table.scss'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/data-table/table-expand-row.ts b/web-components/packages/carbon-web-components/src/components/data-table/table-expand-row.ts index aea6983e7e2e..7e4349c31ef9 100644 --- a/web-components/packages/carbon-web-components/src/components/data-table/table-expand-row.ts +++ b/web-components/packages/carbon-web-components/src/components/data-table/table-expand-row.ts @@ -1,13 +1,13 @@ /** * @license * - * Copyright IBM Corp. 2020, 2022 + * Copyright IBM Corp. 2020, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ -import { html, property, customElement } from 'lit-element'; +import { html, property } from 'lit-element'; import ChevronRight16 from '@carbon/icons/lib/chevron--right/16'; import settings from 'carbon-components/es/globals/js/settings'; import HostListenerMixin from '../../globals/mixins/host-listener'; @@ -15,6 +15,7 @@ import HostListener from '../../globals/decorators/host-listener'; import BXTableRow from './table-row'; import BXTableExpandedRow from './table-expanded-row'; import styles from './data-table.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/data-table/table-expanded-row.ts b/web-components/packages/carbon-web-components/src/components/data-table/table-expanded-row.ts index 7f0f72b21844..5bd8e6ec9ffe 100644 --- a/web-components/packages/carbon-web-components/src/components/data-table/table-expanded-row.ts +++ b/web-components/packages/carbon-web-components/src/components/data-table/table-expanded-row.ts @@ -1,15 +1,16 @@ /** * @license * - * Copyright IBM Corp. 2020, 2022 + * Copyright IBM Corp. 2020, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ -import { html, property, customElement, LitElement } from 'lit-element'; +import { html, property, LitElement } from 'lit-element'; import settings from 'carbon-components/es/globals/js/settings'; import styles from './data-table.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/data-table/table-head.ts b/web-components/packages/carbon-web-components/src/components/data-table/table-head.ts index 3fe0cf64420e..981cedd86820 100644 --- a/web-components/packages/carbon-web-components/src/components/data-table/table-head.ts +++ b/web-components/packages/carbon-web-components/src/components/data-table/table-head.ts @@ -1,14 +1,15 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ import settings from 'carbon-components/es/globals/js/settings'; -import { html, customElement, LitElement } from 'lit-element'; +import { html, LitElement } from 'lit-element'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; import styles from './data-table.scss'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/data-table/table-header-cell-skeleton.ts b/web-components/packages/carbon-web-components/src/components/data-table/table-header-cell-skeleton.ts index 2a6bd555d7de..9fae6de6892f 100644 --- a/web-components/packages/carbon-web-components/src/components/data-table/table-header-cell-skeleton.ts +++ b/web-components/packages/carbon-web-components/src/components/data-table/table-header-cell-skeleton.ts @@ -1,15 +1,15 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ -import { customElement } from 'lit-element'; import settings from 'carbon-components/es/globals/js/settings'; import BXTableCell from './table-cell'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/data-table/table-header-cell.ts b/web-components/packages/carbon-web-components/src/components/data-table/table-header-cell.ts index 80ce8719125c..c852ba08cd02 100644 --- a/web-components/packages/carbon-web-components/src/components/data-table/table-header-cell.ts +++ b/web-components/packages/carbon-web-components/src/components/data-table/table-header-cell.ts @@ -1,14 +1,14 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ import settings from 'carbon-components/es/globals/js/settings'; -import { html, property, customElement, LitElement } from 'lit-element'; +import { html, property, LitElement } from 'lit-element'; import Arrows16 from '@carbon/icons/lib/arrows/16'; import ArrowDown16 from '@carbon/icons/lib/arrow--down/16'; import FocusMixin from '../../globals/mixins/focus'; @@ -18,6 +18,7 @@ import { TABLE_SORT_DIRECTION, } from './defs'; import styles from './data-table.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; export { TABLE_SORT_CYCLE, TABLE_SORT_CYCLES, TABLE_SORT_DIRECTION }; diff --git a/web-components/packages/carbon-web-components/src/components/data-table/table-header-expand-row.ts b/web-components/packages/carbon-web-components/src/components/data-table/table-header-expand-row.ts index ad90d2e24058..d05e6ddd61a9 100644 --- a/web-components/packages/carbon-web-components/src/components/data-table/table-header-expand-row.ts +++ b/web-components/packages/carbon-web-components/src/components/data-table/table-header-expand-row.ts @@ -1,14 +1,14 @@ /** * @license * - * Copyright IBM Corp. 2020, 2022 + * Copyright IBM Corp. 2020, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ import settings from 'carbon-components/es/globals/js/settings'; -import { customElement } from 'lit-element'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; import BXTableExpandRow from './table-expand-row'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/data-table/table-header-row.ts b/web-components/packages/carbon-web-components/src/components/data-table/table-header-row.ts index 6a130b1b47c6..df675b35f792 100644 --- a/web-components/packages/carbon-web-components/src/components/data-table/table-header-row.ts +++ b/web-components/packages/carbon-web-components/src/components/data-table/table-header-row.ts @@ -1,14 +1,14 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ import settings from 'carbon-components/es/globals/js/settings'; -import { customElement } from 'lit-element'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; import BXTableRow from './table-row'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/data-table/table-row.ts b/web-components/packages/carbon-web-components/src/components/data-table/table-row.ts index 0a2bfc12e74c..d5225942efb7 100644 --- a/web-components/packages/carbon-web-components/src/components/data-table/table-row.ts +++ b/web-components/packages/carbon-web-components/src/components/data-table/table-row.ts @@ -1,14 +1,15 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ import settings from 'carbon-components/es/globals/js/settings'; -import { html, property, customElement, LitElement } from 'lit-element'; +import { html, property, LitElement } from 'lit-element'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; import FocusMixin from '../../globals/mixins/focus'; import styles from './data-table.scss'; diff --git a/web-components/packages/carbon-web-components/src/components/data-table/table-toolbar-content.ts b/web-components/packages/carbon-web-components/src/components/data-table/table-toolbar-content.ts index 83a1ef9e804b..1bf7a369c5f3 100644 --- a/web-components/packages/carbon-web-components/src/components/data-table/table-toolbar-content.ts +++ b/web-components/packages/carbon-web-components/src/components/data-table/table-toolbar-content.ts @@ -1,15 +1,16 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ -import { html, property, customElement, LitElement } from 'lit-element'; +import { html, property, LitElement } from 'lit-element'; import settings from 'carbon-components/es/globals/js/settings'; import styles from './data-table.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/data-table/table-toolbar-search.ts b/web-components/packages/carbon-web-components/src/components/data-table/table-toolbar-search.ts index 0b5490455dea..3057c5d6103a 100644 --- a/web-components/packages/carbon-web-components/src/components/data-table/table-toolbar-search.ts +++ b/web-components/packages/carbon-web-components/src/components/data-table/table-toolbar-search.ts @@ -1,20 +1,21 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ import { classMap } from 'lit-html/directives/class-map'; -import { html, property, query, customElement } from 'lit-element'; +import { html, property, query } from 'lit-element'; import settings from 'carbon-components/es/globals/js/settings'; import HostListenerMixin from '../../globals/mixins/host-listener'; import HostListener from '../../globals/decorators/host-listener'; import { INPUT_SIZE } from '../input/input'; import BXSearch from '../search/search'; import styles from './data-table.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/data-table/table-toolbar.ts b/web-components/packages/carbon-web-components/src/components/data-table/table-toolbar.ts index 6b076bb8d24b..c63a5c9c6e62 100644 --- a/web-components/packages/carbon-web-components/src/components/data-table/table-toolbar.ts +++ b/web-components/packages/carbon-web-components/src/components/data-table/table-toolbar.ts @@ -1,15 +1,16 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ -import { html, customElement, LitElement } from 'lit-element'; +import { html, LitElement } from 'lit-element'; import settings from 'carbon-components/es/globals/js/settings'; import styles from './data-table.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/data-table/table.ts b/web-components/packages/carbon-web-components/src/components/data-table/table.ts index f4a89ccad910..c3fd8f6e09c2 100644 --- a/web-components/packages/carbon-web-components/src/components/data-table/table.ts +++ b/web-components/packages/carbon-web-components/src/components/data-table/table.ts @@ -1,17 +1,18 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ import settings from 'carbon-components/es/globals/js/settings'; -import { html, property, customElement, LitElement } from 'lit-element'; +import { html, property, LitElement } from 'lit-element'; import { forEach } from '../../globals/internal/collection-helpers'; import { TABLE_COLOR_SCHEME, TABLE_SIZE } from './defs'; import styles from './data-table.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; export { TABLE_COLOR_SCHEME, TABLE_SIZE }; diff --git a/web-components/packages/carbon-web-components/src/components/date-picker/date-picker-input-skeleton.ts b/web-components/packages/carbon-web-components/src/components/date-picker/date-picker-input-skeleton.ts index b69324244d23..f027b393d54f 100644 --- a/web-components/packages/carbon-web-components/src/components/date-picker/date-picker-input-skeleton.ts +++ b/web-components/packages/carbon-web-components/src/components/date-picker/date-picker-input-skeleton.ts @@ -1,16 +1,17 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ -import { html, property, customElement, LitElement } from 'lit-element'; +import { html, property, LitElement } from 'lit-element'; import settings from 'carbon-components/es/globals/js/settings'; import { DATE_PICKER_INPUT_KIND } from './date-picker-input'; import styles from './date-picker.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/date-picker/date-picker-input.ts b/web-components/packages/carbon-web-components/src/components/date-picker/date-picker-input.ts index 27055de1d680..ea7962e98ca3 100644 --- a/web-components/packages/carbon-web-components/src/components/date-picker/date-picker-input.ts +++ b/web-components/packages/carbon-web-components/src/components/date-picker/date-picker-input.ts @@ -1,14 +1,14 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ import { classMap } from 'lit-html/directives/class-map'; -import { html, property, query, customElement, LitElement } from 'lit-element'; +import { html, property, query, LitElement } from 'lit-element'; import Calendar16 from '@carbon/icons/lib/calendar/16'; import settings from 'carbon-components/es/globals/js/settings'; import ifNonNull from '../../globals/directives/if-non-null'; @@ -21,6 +21,7 @@ import { DATE_PICKER_INPUT_SIZE_HORIZONTAL, } from './defs'; import styles from './date-picker.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; export { DATE_PICKER_INPUT_COLOR_SCHEME, diff --git a/web-components/packages/carbon-web-components/src/components/date-picker/date-picker.ts b/web-components/packages/carbon-web-components/src/components/date-picker/date-picker.ts index 8495b75cdc8d..84288b03738e 100644 --- a/web-components/packages/carbon-web-components/src/components/date-picker/date-picker.ts +++ b/web-components/packages/carbon-web-components/src/components/date-picker/date-picker.ts @@ -1,13 +1,13 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ -import { html, property, query, customElement, LitElement } from 'lit-element'; +import { html, property, query, LitElement } from 'lit-element'; import flatpickr from 'flatpickr'; import { Instance as FlatpickrInstance } from 'flatpickr/dist/types/instance'; import { Locale as FlatpickrLocale } from 'flatpickr/dist/types/locale'; @@ -31,6 +31,7 @@ import rangePlugin from './range-plugin'; import shadowDOMEventPlugin from './shadow-dom-events-plugin'; import stateHandshakePlugin from './state-handshake-plugin'; import styles from './date-picker.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/dropdown/dropdown-item.ts b/web-components/packages/carbon-web-components/src/components/dropdown/dropdown-item.ts index fd85f2bdf6ab..034e67d6c240 100644 --- a/web-components/packages/carbon-web-components/src/components/dropdown/dropdown-item.ts +++ b/web-components/packages/carbon-web-components/src/components/dropdown/dropdown-item.ts @@ -1,17 +1,18 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ import settings from 'carbon-components/es/globals/js/settings'; -import { html, property, customElement, LitElement } from 'lit-element'; +import { html, property, LitElement } from 'lit-element'; import Checkmark16 from '@carbon/icons/lib/checkmark/16'; import { DROPDOWN_SIZE } from './dropdown'; import styles from './dropdown.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/dropdown/dropdown-skeleton.ts b/web-components/packages/carbon-web-components/src/components/dropdown/dropdown-skeleton.ts index bdac20c0fc26..d2a1dbef8c85 100644 --- a/web-components/packages/carbon-web-components/src/components/dropdown/dropdown-skeleton.ts +++ b/web-components/packages/carbon-web-components/src/components/dropdown/dropdown-skeleton.ts @@ -1,15 +1,16 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ -import { html, customElement, LitElement } from 'lit-element'; +import { html, LitElement } from 'lit-element'; import settings from 'carbon-components/es/globals/js/settings'; import styles from './dropdown.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/dropdown/dropdown.ts b/web-components/packages/carbon-web-components/src/components/dropdown/dropdown.ts index 9b075c1252ba..b7da8aba4ac4 100644 --- a/web-components/packages/carbon-web-components/src/components/dropdown/dropdown.ts +++ b/web-components/packages/carbon-web-components/src/components/dropdown/dropdown.ts @@ -11,7 +11,7 @@ import settings from 'carbon-components/es/globals/js/settings'; import { classMap } from 'lit-html/directives/class-map'; import { TemplateResult } from 'lit-html'; import { ifDefined } from 'lit-html/directives/if-defined'; -import { html, property, query, customElement, LitElement } from 'lit-element'; +import { html, property, query, LitElement } from 'lit-element'; import ChevronDown16 from '@carbon/icons/lib/chevron--down/16'; import WarningFilled16 from '@carbon/icons/lib/warning--filled/16'; import FocusMixin from '../../globals/mixins/focus'; @@ -33,6 +33,7 @@ import { } from './defs'; import BXDropdownItem from './dropdown-item'; import styles from './dropdown.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; export { DROPDOWN_COLOR_SCHEME, diff --git a/web-components/packages/carbon-web-components/src/components/file-uploader/drop-container.ts b/web-components/packages/carbon-web-components/src/components/file-uploader/drop-container.ts index 0f1ede1b9908..47750faf2578 100644 --- a/web-components/packages/carbon-web-components/src/components/file-uploader/drop-container.ts +++ b/web-components/packages/carbon-web-components/src/components/file-uploader/drop-container.ts @@ -1,19 +1,20 @@ /** * @license * - * Copyright IBM Corp. 2020, 2022 + * Copyright IBM Corp. 2020, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ import { classMap } from 'lit-html/directives/class-map'; -import { html, property, customElement, LitElement } from 'lit-element'; +import { html, property, LitElement } from 'lit-element'; import settings from 'carbon-components/es/globals/js/settings'; import HostListenerMixin from '../../globals/mixins/host-listener'; import HostListener from '../../globals/decorators/host-listener'; import ifNonEmpty from '../../globals/directives/if-non-empty'; import styles from './file-uploader.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; export { FORM_ELEMENT_COLOR_SCHEME as TILE_COLOR_SCHEME } from '../../globals/shared-enums'; diff --git a/web-components/packages/carbon-web-components/src/components/file-uploader/file-uploader-item.ts b/web-components/packages/carbon-web-components/src/components/file-uploader/file-uploader-item.ts index 2f004caa8320..34747baa19e0 100644 --- a/web-components/packages/carbon-web-components/src/components/file-uploader/file-uploader-item.ts +++ b/web-components/packages/carbon-web-components/src/components/file-uploader/file-uploader-item.ts @@ -1,13 +1,13 @@ /** * @license * - * Copyright IBM Corp. 2020, 2022 + * Copyright IBM Corp. 2020, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ -import { html, property, customElement, LitElement } from 'lit-element'; +import { html, property, LitElement } from 'lit-element'; import CheckmarkFilled16 from '@carbon/icons/lib/checkmark--filled/16'; import Close16 from '@carbon/icons/lib/close/16'; import WarningFilled16 from '@carbon/icons/lib/warning--filled/16'; @@ -15,6 +15,7 @@ import settings from 'carbon-components/es/globals/js/settings'; import { LOADING_TYPE } from '../loading/loading'; import { FILE_UPLOADER_ITEM_SIZE, FILE_UPLOADER_ITEM_STATE } from './defs'; import styles from './file-uploader.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; export { FILE_UPLOADER_ITEM_SIZE, FILE_UPLOADER_ITEM_STATE }; diff --git a/web-components/packages/carbon-web-components/src/components/file-uploader/file-uploader.ts b/web-components/packages/carbon-web-components/src/components/file-uploader/file-uploader.ts index a4f755b55e8f..4b86a0685d25 100644 --- a/web-components/packages/carbon-web-components/src/components/file-uploader/file-uploader.ts +++ b/web-components/packages/carbon-web-components/src/components/file-uploader/file-uploader.ts @@ -1,15 +1,16 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ -import { html, property, customElement, LitElement } from 'lit-element'; +import { html, property, LitElement } from 'lit-element'; import settings from 'carbon-components/es/globals/js/settings'; import styles from './file-uploader.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/form/form-item.ts b/web-components/packages/carbon-web-components/src/components/form/form-item.ts index 9b07bd68923e..4b8a88c63458 100644 --- a/web-components/packages/carbon-web-components/src/components/form/form-item.ts +++ b/web-components/packages/carbon-web-components/src/components/form/form-item.ts @@ -1,14 +1,15 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ import settings from 'carbon-components/es/globals/js/settings'; -import { customElement, LitElement, html } from 'lit-element'; +import { LitElement, html } from 'lit-element'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; import styles from './form-item.scss'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/inline-loading/inline-loading.ts b/web-components/packages/carbon-web-components/src/components/inline-loading/inline-loading.ts index 501c40a569dc..2b577ca3dcb1 100644 --- a/web-components/packages/carbon-web-components/src/components/inline-loading/inline-loading.ts +++ b/web-components/packages/carbon-web-components/src/components/inline-loading/inline-loading.ts @@ -1,13 +1,13 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ -import { html, property, customElement, LitElement } from 'lit-element'; +import { html, property, LitElement } from 'lit-element'; import { classMap } from 'lit-html/directives/class-map'; import CheckmarkFilled16 from '@carbon/icons/lib/checkmark--filled/16'; import ErrorFilled16 from '@carbon/icons/lib/error--filled/16'; @@ -16,6 +16,7 @@ import LOADING_TYPE from '../loading/types'; import getLoadingIcon from '../loading/loading-icon'; import { INLINE_LOADING_STATE } from './defs'; import styles from './inline-loading.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; export { INLINE_LOADING_STATE }; diff --git a/web-components/packages/carbon-web-components/src/components/input/input.ts b/web-components/packages/carbon-web-components/src/components/input/input.ts index 7fb8b4cb6b7c..067f044bc724 100644 --- a/web-components/packages/carbon-web-components/src/components/input/input.ts +++ b/web-components/packages/carbon-web-components/src/components/input/input.ts @@ -1,13 +1,13 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ -import { html, property, query, customElement, LitElement } from 'lit-element'; +import { html, property, query, LitElement } from 'lit-element'; import { classMap } from 'lit-html/directives/class-map'; import settings from 'carbon-components/es/globals/js/settings'; import View16 from '@carbon/icons/lib/view/16'; @@ -22,6 +22,7 @@ import FormMixin from '../../globals/mixins/form'; import ValidityMixin from '../../globals/mixins/validity'; import { INPUT_COLOR_SCHEME, INPUT_SIZE, INPUT_TYPE } from './defs'; import styles from './input.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; export { INPUT_COLOR_SCHEME, INPUT_SIZE, INPUT_TYPE }; diff --git a/web-components/packages/carbon-web-components/src/components/link/link.ts b/web-components/packages/carbon-web-components/src/components/link/link.ts index c12f154a9d3b..eb1c32b23331 100644 --- a/web-components/packages/carbon-web-components/src/components/link/link.ts +++ b/web-components/packages/carbon-web-components/src/components/link/link.ts @@ -1,14 +1,15 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ import { classMap } from 'lit-html/directives/class-map'; -import { html, property, customElement, LitElement, query } from 'lit-element'; +import { html, property, LitElement, query } from 'lit-element'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; import settings from 'carbon-components/es/globals/js/settings'; import ifNonNull from '../../globals/directives/if-non-null'; import FocusMixin from '../../globals/mixins/focus'; diff --git a/web-components/packages/carbon-web-components/src/components/list/list-item.ts b/web-components/packages/carbon-web-components/src/components/list/list-item.ts index eb9dff08d446..276a53e606e2 100644 --- a/web-components/packages/carbon-web-components/src/components/list/list-item.ts +++ b/web-components/packages/carbon-web-components/src/components/list/list-item.ts @@ -1,15 +1,16 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ -import { html, property, customElement, LitElement } from 'lit-element'; +import { html, property, LitElement } from 'lit-element'; import settings from 'carbon-components/es/globals/js/settings'; import styles from './list.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/list/ordered-list.ts b/web-components/packages/carbon-web-components/src/components/list/ordered-list.ts index 05311305c776..ead05351624b 100644 --- a/web-components/packages/carbon-web-components/src/components/list/ordered-list.ts +++ b/web-components/packages/carbon-web-components/src/components/list/ordered-list.ts @@ -1,16 +1,17 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ import { classMap } from 'lit-html/directives/class-map'; -import { html, customElement } from 'lit-element'; +import { html } from 'lit-element'; import settings from 'carbon-components/es/globals/js/settings'; import BXUnorderedList from './unordered-list'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/list/unordered-list.ts b/web-components/packages/carbon-web-components/src/components/list/unordered-list.ts index 79d8d7d1f429..c38ad5e4eeee 100644 --- a/web-components/packages/carbon-web-components/src/components/list/unordered-list.ts +++ b/web-components/packages/carbon-web-components/src/components/list/unordered-list.ts @@ -1,16 +1,17 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ import { classMap } from 'lit-html/directives/class-map'; -import { html, customElement, LitElement, property } from 'lit-element'; +import { html, LitElement, property } from 'lit-element'; import settings from 'carbon-components/es/globals/js/settings'; import styles from './list.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/loading/loading.ts b/web-components/packages/carbon-web-components/src/components/loading/loading.ts index 447825e2dd9c..01354e947291 100644 --- a/web-components/packages/carbon-web-components/src/components/loading/loading.ts +++ b/web-components/packages/carbon-web-components/src/components/loading/loading.ts @@ -1,7 +1,7 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. @@ -9,10 +9,11 @@ import settings from 'carbon-components/es/globals/js/settings'; import { classMap } from 'lit-html/directives/class-map'; -import { html, property, customElement, LitElement } from 'lit-element'; +import { html, property, LitElement } from 'lit-element'; import { LOADING_TYPE } from './defs'; import getLoadingIcon from './loading-icon'; import styles from './loading.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/modal/modal-body.ts b/web-components/packages/carbon-web-components/src/components/modal/modal-body.ts index 443e1565cc69..7e34de1a5e12 100644 --- a/web-components/packages/carbon-web-components/src/components/modal/modal-body.ts +++ b/web-components/packages/carbon-web-components/src/components/modal/modal-body.ts @@ -1,15 +1,16 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ -import { html, customElement, LitElement } from 'lit-element'; +import { html, LitElement } from 'lit-element'; import settings from 'carbon-components/es/globals/js/settings'; import styles from './modal.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/modal/modal-close-button.ts b/web-components/packages/carbon-web-components/src/components/modal/modal-close-button.ts index 1cd5ed176cd5..ceadc9143479 100644 --- a/web-components/packages/carbon-web-components/src/components/modal/modal-close-button.ts +++ b/web-components/packages/carbon-web-components/src/components/modal/modal-close-button.ts @@ -1,18 +1,19 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ -import { html, property, customElement, LitElement } from 'lit-element'; +import { html, property, LitElement } from 'lit-element'; import Close20 from '@carbon/icons/lib/close/20'; import settings from 'carbon-components/es/globals/js/settings'; import ifNonNull from '../../globals/directives/if-non-null'; import FocusMixin from '../../globals/mixins/focus'; import styles from './modal.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/modal/modal-footer-button.ts b/web-components/packages/carbon-web-components/src/components/modal/modal-footer-button.ts index 831229f4a6fe..e3c873dcd0e1 100644 --- a/web-components/packages/carbon-web-components/src/components/modal/modal-footer-button.ts +++ b/web-components/packages/carbon-web-components/src/components/modal/modal-footer-button.ts @@ -1,17 +1,17 @@ /** * @license * - * Copyright IBM Corp. 2021, 2022 + * Copyright IBM Corp. 2021, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ -import { customElement } from 'lit-element'; import settings from 'carbon-components/es/globals/js/settings'; import BXButton from '../button/button'; import buttonStyles from '../button/button.scss'; import styles from './modal.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/modal/modal-footer.ts b/web-components/packages/carbon-web-components/src/components/modal/modal-footer.ts index f13143cc2fa1..01d5742facb9 100644 --- a/web-components/packages/carbon-web-components/src/components/modal/modal-footer.ts +++ b/web-components/packages/carbon-web-components/src/components/modal/modal-footer.ts @@ -1,16 +1,17 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ import { classMap } from 'lit-html/directives/class-map'; -import { html, customElement, LitElement } from 'lit-element'; +import { html, LitElement } from 'lit-element'; import settings from 'carbon-components/es/globals/js/settings'; import styles from './modal.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/modal/modal-header.ts b/web-components/packages/carbon-web-components/src/components/modal/modal-header.ts index 9ed18a639f7d..988e904b2c26 100644 --- a/web-components/packages/carbon-web-components/src/components/modal/modal-header.ts +++ b/web-components/packages/carbon-web-components/src/components/modal/modal-header.ts @@ -1,15 +1,16 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ -import { html, customElement, LitElement } from 'lit-element'; +import { html, LitElement } from 'lit-element'; import settings from 'carbon-components/es/globals/js/settings'; import styles from './modal.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/modal/modal-heading.ts b/web-components/packages/carbon-web-components/src/components/modal/modal-heading.ts index 39d0f265ba40..641dbf75a62a 100644 --- a/web-components/packages/carbon-web-components/src/components/modal/modal-heading.ts +++ b/web-components/packages/carbon-web-components/src/components/modal/modal-heading.ts @@ -1,15 +1,16 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ -import { html, LitElement, customElement } from 'lit-element'; +import { html, LitElement } from 'lit-element'; import settings from 'carbon-components/es/globals/js/settings'; import styles from './modal.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/modal/modal-label.ts b/web-components/packages/carbon-web-components/src/components/modal/modal-label.ts index 9effd13bf6bd..7b8a00afb5dd 100644 --- a/web-components/packages/carbon-web-components/src/components/modal/modal-label.ts +++ b/web-components/packages/carbon-web-components/src/components/modal/modal-label.ts @@ -1,15 +1,16 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ -import { html, LitElement, customElement } from 'lit-element'; +import { html, LitElement } from 'lit-element'; import settings from 'carbon-components/es/globals/js/settings'; import styles from './modal.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/modal/modal.ts b/web-components/packages/carbon-web-components/src/components/modal/modal.ts index 80c85d3510dd..38f024f6dc97 100644 --- a/web-components/packages/carbon-web-components/src/components/modal/modal.ts +++ b/web-components/packages/carbon-web-components/src/components/modal/modal.ts @@ -1,7 +1,7 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. @@ -9,12 +9,13 @@ import settings from 'carbon-components/es/globals/js/settings'; import { classMap } from 'lit-html/directives/class-map'; -import { html, property, query, customElement, LitElement } from 'lit-element'; +import { html, property, query, LitElement } from 'lit-element'; import HostListener from '../../globals/decorators/host-listener'; import HostListenerMixin from '../../globals/mixins/host-listener'; import { MODAL_SIZE } from './defs'; import styles from './modal.scss'; import { selectorTabbable } from '../../globals/settings'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; export { MODAL_SIZE }; diff --git a/web-components/packages/carbon-web-components/src/components/multi-select/multi-select-item.ts b/web-components/packages/carbon-web-components/src/components/multi-select/multi-select-item.ts index 20d69594ab18..fb0fce8f8f0e 100644 --- a/web-components/packages/carbon-web-components/src/components/multi-select/multi-select-item.ts +++ b/web-components/packages/carbon-web-components/src/components/multi-select/multi-select-item.ts @@ -1,7 +1,7 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. @@ -9,9 +9,10 @@ import settings from 'carbon-components/es/globals/js/settings'; import { ifDefined } from 'lit-html/directives/if-defined'; -import { html, property, customElement } from 'lit-element'; +import { html, property } from 'lit-element'; import BXDropdownItem from '../dropdown/dropdown-item'; import styles from './multi-select.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/multi-select/multi-select.ts b/web-components/packages/carbon-web-components/src/components/multi-select/multi-select.ts index 9390a209d39a..a4597690f8b3 100644 --- a/web-components/packages/carbon-web-components/src/components/multi-select/multi-select.ts +++ b/web-components/packages/carbon-web-components/src/components/multi-select/multi-select.ts @@ -1,20 +1,14 @@ /** * @license * - * Copyright IBM Corp. 2020, 2022 + * Copyright IBM Corp. 2020, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ import settings from 'carbon-components/es/globals/js/settings'; -import { - html, - property, - query, - customElement, - TemplateResult, -} from 'lit-element'; +import { html, property, query, TemplateResult } from 'lit-element'; import Close16 from '@carbon/icons/lib/close/16'; import { filter, @@ -24,6 +18,7 @@ import { import BXDropdown, { DROPDOWN_KEYBOARD_ACTION } from '../dropdown/dropdown'; import BXMultiSelectItem from './multi-select-item'; import styles from './multi-select.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; export { DROPDOWN_COLOR_SCHEME, diff --git a/web-components/packages/carbon-web-components/src/components/notification/inline-notification.ts b/web-components/packages/carbon-web-components/src/components/notification/inline-notification.ts index 02d1e1498938..4ea0177662d6 100644 --- a/web-components/packages/carbon-web-components/src/components/notification/inline-notification.ts +++ b/web-components/packages/carbon-web-components/src/components/notification/inline-notification.ts @@ -1,7 +1,7 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. @@ -12,8 +12,9 @@ import Close20 from '@carbon/icons/lib/close/20'; import ErrorFilled20 from '@carbon/icons/lib/error--filled/20'; import WarningFilled20 from '@carbon/icons/lib/warning--filled/20'; import settings from 'carbon-components/es/globals/js/settings'; -import { customElement, html, LitElement, property, svg } from 'lit-element'; +import { html, LitElement, property, svg } from 'lit-element'; import { ifDefined } from 'lit-html/directives/if-defined'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; import FocusMixin from '../../globals/mixins/focus'; import { NOTIFICATION_KIND, NOTIFICATION_TYPE } from './defs'; import styles from './inline-notification.scss'; diff --git a/web-components/packages/carbon-web-components/src/components/notification/toast-notification.ts b/web-components/packages/carbon-web-components/src/components/notification/toast-notification.ts index d510dba35bfc..3dc162808989 100644 --- a/web-components/packages/carbon-web-components/src/components/notification/toast-notification.ts +++ b/web-components/packages/carbon-web-components/src/components/notification/toast-notification.ts @@ -1,14 +1,15 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ import settings from 'carbon-components/es/globals/js/settings'; -import { html, property, customElement } from 'lit-element'; +import { html, property } from 'lit-element'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; import { NOTIFICATION_TYPE } from './defs'; import BXInlineNotification from './inline-notification'; import styles from './toast-notification.scss'; diff --git a/web-components/packages/carbon-web-components/src/components/number-input/number-input-skeleton.ts b/web-components/packages/carbon-web-components/src/components/number-input/number-input-skeleton.ts index bcc5c493f964..0469bc208f53 100644 --- a/web-components/packages/carbon-web-components/src/components/number-input/number-input-skeleton.ts +++ b/web-components/packages/carbon-web-components/src/components/number-input/number-input-skeleton.ts @@ -1,15 +1,16 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ -import { html, property, customElement, LitElement } from 'lit-element'; +import { html, property, LitElement } from 'lit-element'; import settings from 'carbon-components/es/globals/js/settings'; import styles from './number-input.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/number-input/number-input.ts b/web-components/packages/carbon-web-components/src/components/number-input/number-input.ts index 8d5712192646..6e0d953354b5 100644 --- a/web-components/packages/carbon-web-components/src/components/number-input/number-input.ts +++ b/web-components/packages/carbon-web-components/src/components/number-input/number-input.ts @@ -1,13 +1,13 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ -import { html, property, query, customElement } from 'lit-element'; +import { html, property, query } from 'lit-element'; import { classMap } from 'lit-html/directives/class-map'; import settings from 'carbon-components/es/globals/js/settings'; import WarningFilled16 from '@carbon/icons/lib/warning--filled/16'; @@ -20,6 +20,7 @@ import { } from './defs'; import styles from './number-input.scss'; import BXInput, { INPUT_SIZE } from '../input/input'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; export { NUMBER_INPUT_COLOR_SCHEME, NUMBER_INPUT_VALIDATION_STATUS }; diff --git a/web-components/packages/carbon-web-components/src/components/overflow-menu/overflow-menu-body.ts b/web-components/packages/carbon-web-components/src/components/overflow-menu/overflow-menu-body.ts index 77ee13af15fc..bd47eeca5727 100644 --- a/web-components/packages/carbon-web-components/src/components/overflow-menu/overflow-menu-body.ts +++ b/web-components/packages/carbon-web-components/src/components/overflow-menu/overflow-menu-body.ts @@ -1,14 +1,14 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ import settings from 'carbon-components/es/globals/js/settings'; -import { html, property, customElement } from 'lit-element'; +import { html, property } from 'lit-element'; import BXFloatingMenu, { FLOATING_MENU_ALIGNMENT, FLOATING_MENU_DIRECTION, @@ -18,6 +18,7 @@ import styles from './overflow-menu.scss'; import BXOverflowMenuItem from './overflow-menu-item'; import HostListener from '../../globals/decorators/host-listener'; import { indexOf } from '../../globals/internal/collection-helpers'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/overflow-menu/overflow-menu-item.ts b/web-components/packages/carbon-web-components/src/components/overflow-menu/overflow-menu-item.ts index 38d908fce03d..b8c30172f5b0 100644 --- a/web-components/packages/carbon-web-components/src/components/overflow-menu/overflow-menu-item.ts +++ b/web-components/packages/carbon-web-components/src/components/overflow-menu/overflow-menu-item.ts @@ -1,14 +1,15 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ import settings from 'carbon-components/es/globals/js/settings'; -import { html, property, customElement, LitElement } from 'lit-element'; +import { html, property, LitElement } from 'lit-element'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; import FocusMixin from '../../globals/mixins/focus'; import styles from './overflow-menu.scss'; diff --git a/web-components/packages/carbon-web-components/src/components/overflow-menu/overflow-menu.ts b/web-components/packages/carbon-web-components/src/components/overflow-menu/overflow-menu.ts index cb17226411ff..fe0f005c1f95 100644 --- a/web-components/packages/carbon-web-components/src/components/overflow-menu/overflow-menu.ts +++ b/web-components/packages/carbon-web-components/src/components/overflow-menu/overflow-menu.ts @@ -1,14 +1,14 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ import settings from 'carbon-components/es/globals/js/settings'; -import { html, property, customElement, LitElement } from 'lit-element'; +import { html, property, LitElement } from 'lit-element'; import OverflowMenuVertical16 from '@carbon/icons/lib/overflow-menu--vertical/16'; import HostListener from '../../globals/decorators/host-listener'; import FocusMixin from '../../globals/mixins/focus'; @@ -18,6 +18,7 @@ import BXFloatingMenuTrigger from '../floating-menu/floating-menu-trigger'; import { OVERFLOW_MENU_COLOR_SCHEME, OVERFLOW_MENU_SIZE } from './defs'; import BXOverflowMenuBody from './overflow-menu-body'; import styles from './overflow-menu.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; export { OVERFLOW_MENU_COLOR_SCHEME, OVERFLOW_MENU_SIZE }; diff --git a/web-components/packages/carbon-web-components/src/components/pagination/page-sizes-select.ts b/web-components/packages/carbon-web-components/src/components/pagination/page-sizes-select.ts index 938121b4aaaf..aca89978367d 100644 --- a/web-components/packages/carbon-web-components/src/components/pagination/page-sizes-select.ts +++ b/web-components/packages/carbon-web-components/src/components/pagination/page-sizes-select.ts @@ -1,17 +1,18 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ -import { html, property, query, customElement, LitElement } from 'lit-element'; +import { html, property, query, LitElement } from 'lit-element'; import ChevronDown16 from '@carbon/icons/lib/chevron--down/16'; import settings from 'carbon-components/es/globals/js/settings'; import FocusMixin from '../../globals/mixins/focus'; import styles from './pagination.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/pagination/pages-select.ts b/web-components/packages/carbon-web-components/src/components/pagination/pages-select.ts index dbb16eb38c86..eea2b196b88b 100644 --- a/web-components/packages/carbon-web-components/src/components/pagination/pages-select.ts +++ b/web-components/packages/carbon-web-components/src/components/pagination/pages-select.ts @@ -1,17 +1,18 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ -import { html, property, customElement, LitElement } from 'lit-element'; +import { html, property, LitElement } from 'lit-element'; import ChevronDown16 from '@carbon/icons/lib/chevron--down/16'; import settings from 'carbon-components/es/globals/js/settings'; import FocusMixin from '../../globals/mixins/focus'; import styles from './pagination.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/pagination/pagination.ts b/web-components/packages/carbon-web-components/src/components/pagination/pagination.ts index 06cf4fa574c0..ea50b0c56f86 100644 --- a/web-components/packages/carbon-web-components/src/components/pagination/pagination.ts +++ b/web-components/packages/carbon-web-components/src/components/pagination/pagination.ts @@ -1,14 +1,14 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ import { classMap } from 'lit-html/directives/class-map'; -import { html, property, customElement, LitElement } from 'lit-element'; +import { html, property, LitElement } from 'lit-element'; import CaretLeft24 from '@carbon/icons/lib/caret--left/24'; import CaretRight24 from '@carbon/icons/lib/caret--right/24'; import settings from 'carbon-components/es/globals/js/settings'; @@ -19,6 +19,7 @@ import { forEach } from '../../globals/internal/collection-helpers'; import BXPagesSelect from './pages-select'; import BXPageSizesSelect from './page-sizes-select'; import styles from './pagination.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/progress-indicator/progress-indicator-skeleton.ts b/web-components/packages/carbon-web-components/src/components/progress-indicator/progress-indicator-skeleton.ts index 43cf0c928226..95404ea7d45c 100644 --- a/web-components/packages/carbon-web-components/src/components/progress-indicator/progress-indicator-skeleton.ts +++ b/web-components/packages/carbon-web-components/src/components/progress-indicator/progress-indicator-skeleton.ts @@ -1,17 +1,18 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ -import { html, property, customElement, LitElement } from 'lit-element'; +import { html, property, LitElement } from 'lit-element'; import settings from 'carbon-components/es/globals/js/settings'; import { forEach } from '../../globals/internal/collection-helpers'; import BXProgressStepSkeleton from './progress-step-skeleton'; import styles from './progress-indicator.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/progress-indicator/progress-indicator.ts b/web-components/packages/carbon-web-components/src/components/progress-indicator/progress-indicator.ts index 09c8ee6b32fe..9611c28cd454 100644 --- a/web-components/packages/carbon-web-components/src/components/progress-indicator/progress-indicator.ts +++ b/web-components/packages/carbon-web-components/src/components/progress-indicator/progress-indicator.ts @@ -1,17 +1,18 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ -import { html, property, customElement, LitElement } from 'lit-element'; +import { html, property, LitElement } from 'lit-element'; import settings from 'carbon-components/es/globals/js/settings'; import { forEach } from '../../globals/internal/collection-helpers'; import BXProgressStep from './progress-step'; import styles from './progress-indicator.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/progress-indicator/progress-step-skeleton.ts b/web-components/packages/carbon-web-components/src/components/progress-indicator/progress-step-skeleton.ts index 2a121a817409..5065721f15ce 100644 --- a/web-components/packages/carbon-web-components/src/components/progress-indicator/progress-step-skeleton.ts +++ b/web-components/packages/carbon-web-components/src/components/progress-indicator/progress-step-skeleton.ts @@ -1,15 +1,16 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ -import { html, property, customElement, LitElement } from 'lit-element'; +import { html, property, LitElement } from 'lit-element'; import settings from 'carbon-components/es/globals/js/settings'; import styles from './progress-indicator.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/progress-indicator/progress-step.ts b/web-components/packages/carbon-web-components/src/components/progress-indicator/progress-step.ts index 853ebad67292..9d2d4a5db782 100644 --- a/web-components/packages/carbon-web-components/src/components/progress-indicator/progress-step.ts +++ b/web-components/packages/carbon-web-components/src/components/progress-indicator/progress-step.ts @@ -1,14 +1,14 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ import { SVGTemplateResult } from 'lit-html'; -import { html, svg, property, customElement, LitElement } from 'lit-element'; +import { html, svg, property, LitElement } from 'lit-element'; import CheckmarkOutline16 from '@carbon/icons/lib/checkmark--outline/16'; import Warning16 from '@carbon/icons/lib/warning/16'; import settings from 'carbon-components/es/globals/js/settings'; @@ -16,6 +16,7 @@ import spread from '../../globals/directives/spread'; import FocusMixin from '../../globals/mixins/focus'; import { PROGRESS_STEP_STAT } from './defs'; import styles from './progress-indicator.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; export { PROGRESS_STEP_STAT }; diff --git a/web-components/packages/carbon-web-components/src/components/radio-button/radio-button-group.ts b/web-components/packages/carbon-web-components/src/components/radio-button/radio-button-group.ts index 89046a6e6e7e..332fbc20bc62 100644 --- a/web-components/packages/carbon-web-components/src/components/radio-button/radio-button-group.ts +++ b/web-components/packages/carbon-web-components/src/components/radio-button/radio-button-group.ts @@ -1,13 +1,13 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ -import { html, property, customElement, LitElement } from 'lit-element'; +import { html, property, LitElement } from 'lit-element'; import settings from 'carbon-components/es/globals/js/settings'; import FormMixin from '../../globals/mixins/form'; import HostListenerMixin from '../../globals/mixins/host-listener'; @@ -16,6 +16,7 @@ import { find, forEach } from '../../globals/internal/collection-helpers'; import { RADIO_BUTTON_LABEL_POSITION, RADIO_BUTTON_ORIENTATION } from './defs'; import BXRadioButton from './radio-button'; import styles from './radio-button.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; export { RADIO_BUTTON_ORIENTATION }; diff --git a/web-components/packages/carbon-web-components/src/components/radio-button/radio-button-skeleton.ts b/web-components/packages/carbon-web-components/src/components/radio-button/radio-button-skeleton.ts index 288be4a72253..1bd3877fab3e 100644 --- a/web-components/packages/carbon-web-components/src/components/radio-button/radio-button-skeleton.ts +++ b/web-components/packages/carbon-web-components/src/components/radio-button/radio-button-skeleton.ts @@ -1,15 +1,16 @@ /** * @license * - * Copyright IBM Corp. 2019 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ -import { html, customElement, LitElement } from 'lit-element'; +import { html, LitElement } from 'lit-element'; import settings from 'carbon-components/es/globals/js/settings'; import styles from './radio-button.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/radio-button/radio-button.ts b/web-components/packages/carbon-web-components/src/components/radio-button/radio-button.ts index be955076e170..317ebdcedf85 100644 --- a/web-components/packages/carbon-web-components/src/components/radio-button/radio-button.ts +++ b/web-components/packages/carbon-web-components/src/components/radio-button/radio-button.ts @@ -1,14 +1,14 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ import { classMap } from 'lit-html/directives/class-map'; -import { html, property, query, customElement, LitElement } from 'lit-element'; +import { html, property, query, LitElement } from 'lit-element'; import settings from 'carbon-components/es/globals/js/settings'; import ifNonNull from '../../globals/directives/if-non-null'; import HostListener from '../../globals/decorators/host-listener'; @@ -20,6 +20,7 @@ import RadioGroupManager, { } from '../../globals/internal/radio-group-manager'; import { RADIO_BUTTON_LABEL_POSITION, RADIO_BUTTON_ORIENTATION } from './defs'; import styles from './radio-button.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; export { RADIO_BUTTON_LABEL_POSITION }; diff --git a/web-components/packages/carbon-web-components/src/components/search/search-skeleton.ts b/web-components/packages/carbon-web-components/src/components/search/search-skeleton.ts index d61f96879af4..a01366cd2619 100644 --- a/web-components/packages/carbon-web-components/src/components/search/search-skeleton.ts +++ b/web-components/packages/carbon-web-components/src/components/search/search-skeleton.ts @@ -1,16 +1,17 @@ /** * @license * - * Copyright IBM Corp. 2019, 2020 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ -import { html, property, customElement, LitElement } from 'lit-element'; +import { html, property, LitElement } from 'lit-element'; import settings from 'carbon-components/es/globals/js/settings'; import { INPUT_SIZE } from '../input/input'; import styles from './search.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/search/search.ts b/web-components/packages/carbon-web-components/src/components/search/search.ts index 46e47eb0e742..74f81412f5b3 100644 --- a/web-components/packages/carbon-web-components/src/components/search/search.ts +++ b/web-components/packages/carbon-web-components/src/components/search/search.ts @@ -1,14 +1,14 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ import { classMap } from 'lit-html/directives/class-map'; -import { html, property, customElement, LitElement } from 'lit-element'; +import { html, property, LitElement } from 'lit-element'; import Close16 from '@carbon/icons/lib/close/16'; import Close20 from '@carbon/icons/lib/close/20'; import Search16 from '@carbon/icons/lib/search/16'; @@ -19,6 +19,7 @@ import FormMixin from '../../globals/mixins/form'; import { INPUT_SIZE } from '../input/input'; import { SEARCH_COLOR_SCHEME } from './defs'; import styles from './search.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; export { SEARCH_COLOR_SCHEME }; diff --git a/web-components/packages/carbon-web-components/src/components/select/select-item-group.ts b/web-components/packages/carbon-web-components/src/components/select/select-item-group.ts index a91c1bba3303..23ea02b9a35b 100644 --- a/web-components/packages/carbon-web-components/src/components/select/select-item-group.ts +++ b/web-components/packages/carbon-web-components/src/components/select/select-item-group.ts @@ -1,14 +1,15 @@ /** * @license * - * Copyright IBM Corp. 2020, 2022 + * Copyright IBM Corp. 2020, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ -import { property, customElement, LitElement } from 'lit-element'; +import { property, LitElement } from 'lit-element'; import settings from 'carbon-components/es/globals/js/settings'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/select/select-item.ts b/web-components/packages/carbon-web-components/src/components/select/select-item.ts index 35d640becf6f..3127a01eb9e4 100644 --- a/web-components/packages/carbon-web-components/src/components/select/select-item.ts +++ b/web-components/packages/carbon-web-components/src/components/select/select-item.ts @@ -1,14 +1,15 @@ /** * @license * - * Copyright IBM Corp. 2020, 2022 + * Copyright IBM Corp. 2020, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ -import { property, customElement, LitElement } from 'lit-element'; +import { property, LitElement } from 'lit-element'; import settings from 'carbon-components/es/globals/js/settings'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/select/select.ts b/web-components/packages/carbon-web-components/src/components/select/select.ts index 12ece302f444..23251a95bd23 100644 --- a/web-components/packages/carbon-web-components/src/components/select/select.ts +++ b/web-components/packages/carbon-web-components/src/components/select/select.ts @@ -1,14 +1,14 @@ /** * @license * - * Copyright IBM Corp. 2020, 2022 + * Copyright IBM Corp. 2020, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ import { ifDefined } from 'lit-html/directives/if-defined'; -import { html, property, query, customElement, LitElement } from 'lit-element'; +import { html, property, query, LitElement } from 'lit-element'; import { classMap } from 'lit-html/directives/class-map'; import settings from 'carbon-components/es/globals/js/settings'; import ChevronDown16 from '@carbon/icons/lib/chevron--down/16'; @@ -20,6 +20,7 @@ import ValidityMixin from '../../globals/mixins/validity'; import { filter } from '../../globals/internal/collection-helpers'; import { INPUT_SIZE } from '../input/input'; import styles from './select.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; export { FORM_ELEMENT_COLOR_SCHEME as SELECT_COLOR_SCHEME } from '../../globals/shared-enums'; diff --git a/web-components/packages/carbon-web-components/src/components/skeleton-placeholder/skeleton-placeholder.ts b/web-components/packages/carbon-web-components/src/components/skeleton-placeholder/skeleton-placeholder.ts index d7f678a692f0..535dda455209 100644 --- a/web-components/packages/carbon-web-components/src/components/skeleton-placeholder/skeleton-placeholder.ts +++ b/web-components/packages/carbon-web-components/src/components/skeleton-placeholder/skeleton-placeholder.ts @@ -1,15 +1,16 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ -import { html, customElement, LitElement } from 'lit-element'; +import { html, LitElement } from 'lit-element'; import settings from 'carbon-components/es/globals/js/settings'; import styles from './skeleton-placeholder.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/skeleton-text/skeleton-text.ts b/web-components/packages/carbon-web-components/src/components/skeleton-text/skeleton-text.ts index 0ab67fd04471..2278f24dc2a5 100644 --- a/web-components/packages/carbon-web-components/src/components/skeleton-text/skeleton-text.ts +++ b/web-components/packages/carbon-web-components/src/components/skeleton-text/skeleton-text.ts @@ -1,17 +1,18 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ import { classMap } from 'lit-html/directives/class-map'; -import { html, property, customElement, LitElement } from 'lit-element'; +import { html, property, LitElement } from 'lit-element'; import settings from 'carbon-components/es/globals/js/settings'; import { SKELETON_TEXT_TYPE } from './defs'; import styles from './skeleton-text.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; export { SKELETON_TEXT_TYPE }; diff --git a/web-components/packages/carbon-web-components/src/components/skip-to-content/skip-to-content.ts b/web-components/packages/carbon-web-components/src/components/skip-to-content/skip-to-content.ts index be657f7c0521..26ed8df915b1 100644 --- a/web-components/packages/carbon-web-components/src/components/skip-to-content/skip-to-content.ts +++ b/web-components/packages/carbon-web-components/src/components/skip-to-content/skip-to-content.ts @@ -1,17 +1,18 @@ /** * @license * - * Copyright IBM Corp. 2020, 2022 + * Copyright IBM Corp. 2020, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ -import { html, property, customElement, LitElement } from 'lit-element'; +import { html, property, LitElement } from 'lit-element'; import settings from 'carbon-components/es/globals/js/settings.js'; import ifNonNull from '../../globals/directives/if-non-null'; import FocusMixin from '../../globals/mixins/focus'; import styles from './skip-to-content.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/slider/slider-input.ts b/web-components/packages/carbon-web-components/src/components/slider/slider-input.ts index c13a8b9089ae..ec3a326e3bfd 100644 --- a/web-components/packages/carbon-web-components/src/components/slider/slider-input.ts +++ b/web-components/packages/carbon-web-components/src/components/slider/slider-input.ts @@ -1,19 +1,20 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ import { classMap } from 'lit-html/directives/class-map'; -import { html, property, customElement, LitElement } from 'lit-element'; +import { html, property, LitElement } from 'lit-element'; import settings from 'carbon-components/es/globals/js/settings'; import ifNonNull from '../../globals/directives/if-non-null'; import FocusMixin from '../../globals/mixins/focus'; import { SLIDER_INPUT_COLOR_SCHEME } from './defs'; import styles from './slider.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; export { SLIDER_INPUT_COLOR_SCHEME }; diff --git a/web-components/packages/carbon-web-components/src/components/slider/slider-skeleton.ts b/web-components/packages/carbon-web-components/src/components/slider/slider-skeleton.ts index f6864a32cbba..14282962bf75 100644 --- a/web-components/packages/carbon-web-components/src/components/slider/slider-skeleton.ts +++ b/web-components/packages/carbon-web-components/src/components/slider/slider-skeleton.ts @@ -1,15 +1,16 @@ /** * @license * - * Copyright IBM Corp. 2019 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ -import { html, customElement, LitElement } from 'lit-element'; +import { html, LitElement } from 'lit-element'; import settings from 'carbon-components/es/globals/js/settings'; import styles from './slider.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/slider/slider.ts b/web-components/packages/carbon-web-components/src/components/slider/slider.ts index c362a92918d4..18403d87ab52 100644 --- a/web-components/packages/carbon-web-components/src/components/slider/slider.ts +++ b/web-components/packages/carbon-web-components/src/components/slider/slider.ts @@ -1,7 +1,7 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. @@ -9,7 +9,7 @@ import { classMap } from 'lit-html/directives/class-map'; import throttle from 'lodash-es/throttle'; -import { html, property, query, customElement, LitElement } from 'lit-element'; +import { html, property, query, LitElement } from 'lit-element'; import settings from 'carbon-components/es/globals/js/settings'; import FocusMixin from '../../globals/mixins/focus'; import FormMixin from '../../globals/mixins/form'; @@ -18,6 +18,7 @@ import HostListener from '../../globals/decorators/host-listener'; import ifNonEmpty from '../../globals/directives/if-non-empty'; import BXSliderInput from './slider-input'; import styles from './slider.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/structured-list/structured-list-body.ts b/web-components/packages/carbon-web-components/src/components/structured-list/structured-list-body.ts index 723307619c61..40753bfa5492 100644 --- a/web-components/packages/carbon-web-components/src/components/structured-list/structured-list-body.ts +++ b/web-components/packages/carbon-web-components/src/components/structured-list/structured-list-body.ts @@ -1,14 +1,15 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ import settings from 'carbon-components/es/globals/js/settings'; -import { html, customElement, LitElement } from 'lit-element'; +import { html, LitElement } from 'lit-element'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; import styles from './structured-list.scss'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/structured-list/structured-list-cell.ts b/web-components/packages/carbon-web-components/src/components/structured-list/structured-list-cell.ts index 2e491b43b69d..ae2a1a10ad51 100644 --- a/web-components/packages/carbon-web-components/src/components/structured-list/structured-list-cell.ts +++ b/web-components/packages/carbon-web-components/src/components/structured-list/structured-list-cell.ts @@ -1,15 +1,16 @@ /** * @license * - * Copyright IBM Corp. 2020, 2022 + * Copyright IBM Corp. 2020, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ -import { html, customElement, LitElement } from 'lit-element'; +import { html, LitElement } from 'lit-element'; import settings from 'carbon-components/es/globals/js/settings'; import styles from './structured-list.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/structured-list/structured-list-head.ts b/web-components/packages/carbon-web-components/src/components/structured-list/structured-list-head.ts index e0ee0e7573e5..ec26800901d3 100644 --- a/web-components/packages/carbon-web-components/src/components/structured-list/structured-list-head.ts +++ b/web-components/packages/carbon-web-components/src/components/structured-list/structured-list-head.ts @@ -1,14 +1,15 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ import settings from 'carbon-components/es/globals/js/settings'; -import { html, customElement, LitElement } from 'lit-element'; +import { html, LitElement } from 'lit-element'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; import styles from './structured-list.scss'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/structured-list/structured-list-header-cell-skeleton.ts b/web-components/packages/carbon-web-components/src/components/structured-list/structured-list-header-cell-skeleton.ts index 3f346ee61ba0..874d88339837 100644 --- a/web-components/packages/carbon-web-components/src/components/structured-list/structured-list-header-cell-skeleton.ts +++ b/web-components/packages/carbon-web-components/src/components/structured-list/structured-list-header-cell-skeleton.ts @@ -1,15 +1,16 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ -import { html, customElement, LitElement } from 'lit-element'; +import { html, LitElement } from 'lit-element'; import settings from 'carbon-components/es/globals/js/settings'; import styles from './structured-list.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/structured-list/structured-list-header-cell.ts b/web-components/packages/carbon-web-components/src/components/structured-list/structured-list-header-cell.ts index 6377731739d0..51457d3c6533 100644 --- a/web-components/packages/carbon-web-components/src/components/structured-list/structured-list-header-cell.ts +++ b/web-components/packages/carbon-web-components/src/components/structured-list/structured-list-header-cell.ts @@ -1,15 +1,16 @@ /** * @license * - * Copyright IBM Corp. 2020, 2022 + * Copyright IBM Corp. 2020, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ -import { html, customElement, LitElement } from 'lit-element'; +import { html, LitElement } from 'lit-element'; import settings from 'carbon-components/es/globals/js/settings'; import styles from './structured-list.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/structured-list/structured-list-header-row.ts b/web-components/packages/carbon-web-components/src/components/structured-list/structured-list-header-row.ts index 0b32ed3a0ca9..fa6d1e1d64b3 100644 --- a/web-components/packages/carbon-web-components/src/components/structured-list/structured-list-header-row.ts +++ b/web-components/packages/carbon-web-components/src/components/structured-list/structured-list-header-row.ts @@ -1,14 +1,15 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ import settings from 'carbon-components/es/globals/js/settings'; -import { html, property, customElement, LitElement } from 'lit-element'; +import { html, property, LitElement } from 'lit-element'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; import styles from './structured-list.scss'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/structured-list/structured-list-row.ts b/web-components/packages/carbon-web-components/src/components/structured-list/structured-list-row.ts index 8ec83b69581a..11d6d99b29dc 100644 --- a/web-components/packages/carbon-web-components/src/components/structured-list/structured-list-row.ts +++ b/web-components/packages/carbon-web-components/src/components/structured-list/structured-list-row.ts @@ -1,7 +1,7 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. @@ -9,7 +9,7 @@ import settings from 'carbon-components/es/globals/js/settings'; import { ifDefined } from 'lit-html/directives/if-defined'; -import { html, property, query, customElement, LitElement } from 'lit-element'; +import { html, property, query, LitElement } from 'lit-element'; import CheckmarkFilled16 from '@carbon/icons/lib/checkmark--filled/16'; import HostListener from '../../globals/decorators/host-listener'; import HostListenerMixin from '../../globals/mixins/host-listener'; @@ -18,6 +18,7 @@ import RadioGroupManager, { ManagedRadioButtonDelegate, } from '../../globals/internal/radio-group-manager'; import styles from './structured-list.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/structured-list/structured-list.ts b/web-components/packages/carbon-web-components/src/components/structured-list/structured-list.ts index a524bb367bb7..254be8d99668 100644 --- a/web-components/packages/carbon-web-components/src/components/structured-list/structured-list.ts +++ b/web-components/packages/carbon-web-components/src/components/structured-list/structured-list.ts @@ -1,7 +1,7 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. @@ -9,11 +9,12 @@ import settings from 'carbon-components/es/globals/js/settings'; import { classMap } from 'lit-html/directives/class-map'; -import { html, property, customElement, LitElement } from 'lit-element'; +import { html, property, LitElement } from 'lit-element'; import { forEach } from '../../globals/internal/collection-helpers'; import FocusMixin from '../../globals/mixins/focus'; import BXStructuredListRow from './structured-list-row'; import styles from './structured-list.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/tabs/tab-skeleton.ts b/web-components/packages/carbon-web-components/src/components/tabs/tab-skeleton.ts index d2712eb1a08b..f768605349d0 100644 --- a/web-components/packages/carbon-web-components/src/components/tabs/tab-skeleton.ts +++ b/web-components/packages/carbon-web-components/src/components/tabs/tab-skeleton.ts @@ -1,15 +1,16 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ -import { html, customElement, LitElement } from 'lit-element'; +import { html, LitElement } from 'lit-element'; import settings from 'carbon-components/es/globals/js/settings'; import styles from './tabs.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/tabs/tab.ts b/web-components/packages/carbon-web-components/src/components/tabs/tab.ts index 3b31f3538c8e..22c30246bc9f 100644 --- a/web-components/packages/carbon-web-components/src/components/tabs/tab.ts +++ b/web-components/packages/carbon-web-components/src/components/tabs/tab.ts @@ -1,17 +1,18 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ -import { html, property, customElement } from 'lit-element'; +import { html, property } from 'lit-element'; import settings from 'carbon-components/es/globals/js/settings'; import BXContentSwitcherItem from '../content-switcher/content-switcher-item'; import { TABS_TYPE } from './tabs'; import styles from './tabs.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/tabs/tabs-skeleton.ts b/web-components/packages/carbon-web-components/src/components/tabs/tabs-skeleton.ts index 6b24493a39ab..1e575e38ed26 100644 --- a/web-components/packages/carbon-web-components/src/components/tabs/tabs-skeleton.ts +++ b/web-components/packages/carbon-web-components/src/components/tabs/tabs-skeleton.ts @@ -1,15 +1,16 @@ /** * @license * - * Copyright IBM Corp. 2019 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ -import { html, customElement, LitElement } from 'lit-element'; +import { html, LitElement } from 'lit-element'; import settings from 'carbon-components/es/globals/js/settings'; import styles from './tabs.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/tabs/tabs.ts b/web-components/packages/carbon-web-components/src/components/tabs/tabs.ts index 4571f739b4d0..5246591b6ba1 100644 --- a/web-components/packages/carbon-web-components/src/components/tabs/tabs.ts +++ b/web-components/packages/carbon-web-components/src/components/tabs/tabs.ts @@ -1,14 +1,14 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ import { classMap } from 'lit-html/directives/class-map'; -import { html, property, query, customElement } from 'lit-element'; +import { html, property, query } from 'lit-element'; import ChevronDown16 from '@carbon/icons/lib/chevron--down/16'; import settings from 'carbon-components/es/globals/js/settings'; import HostListenerMixin from '../../globals/mixins/host-listener'; @@ -25,6 +25,7 @@ import { } from './defs'; import BXTab from './tab'; import styles from './tabs.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; const { prefix } = settings; @@ -140,8 +141,8 @@ class BXTabs extends HostListenerMixin(BXContentSwitcher) { * @param [options.immediate] * `true` to make it "immediate selection change" mode, which does: * - * * Starts with the selected item - * * Going prev/next item immediately changes the selection + * Starts with the selected item + * Going prev/next item immediately changes the selection */ protected _navigate( direction: number, diff --git a/web-components/packages/carbon-web-components/src/components/tag/filter-tag.ts b/web-components/packages/carbon-web-components/src/components/tag/filter-tag.ts index 6ab86ba6e2ac..ebdb678ef19f 100644 --- a/web-components/packages/carbon-web-components/src/components/tag/filter-tag.ts +++ b/web-components/packages/carbon-web-components/src/components/tag/filter-tag.ts @@ -1,13 +1,13 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ -import { html, property, query, customElement, LitElement } from 'lit-element'; +import { html, property, query, LitElement } from 'lit-element'; import settings from 'carbon-components/es/globals/js/settings'; import Close16 from '@carbon/icons/lib/close/16'; import FocusMixin from '../../globals/mixins/focus'; @@ -15,6 +15,7 @@ import HostListener from '../../globals/decorators/host-listener'; import HostListenerMixin from '../../globals/mixins/host-listener'; import { TAG_SIZE, TAG_TYPE } from './defs'; import styles from './tag.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; export { TAG_SIZE, TAG_TYPE }; diff --git a/web-components/packages/carbon-web-components/src/components/tag/tag.ts b/web-components/packages/carbon-web-components/src/components/tag/tag.ts index e8b29c1a4ce4..7e85fb48c857 100644 --- a/web-components/packages/carbon-web-components/src/components/tag/tag.ts +++ b/web-components/packages/carbon-web-components/src/components/tag/tag.ts @@ -1,16 +1,17 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ -import { html, property, customElement, LitElement } from 'lit-element'; +import { html, property, LitElement } from 'lit-element'; import settings from 'carbon-components/es/globals/js/settings'; import { TAG_SIZE, TAG_TYPE } from './defs'; import styles from './tag.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; export { TAG_SIZE, TAG_TYPE }; diff --git a/web-components/packages/carbon-web-components/src/components/textarea/textarea-skeleton.ts b/web-components/packages/carbon-web-components/src/components/textarea/textarea-skeleton.ts index 22f346bf19de..2e0c2c47169f 100644 --- a/web-components/packages/carbon-web-components/src/components/textarea/textarea-skeleton.ts +++ b/web-components/packages/carbon-web-components/src/components/textarea/textarea-skeleton.ts @@ -1,15 +1,16 @@ /** * @license * - * Copyright IBM Corp. 2019 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ -import { html, customElement, LitElement } from 'lit-element'; +import { html, LitElement } from 'lit-element'; import settings from 'carbon-components/es/globals/js/settings'; import styles from './textarea.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/textarea/textarea.ts b/web-components/packages/carbon-web-components/src/components/textarea/textarea.ts index cbbc0146cff1..351aff8f09ee 100644 --- a/web-components/packages/carbon-web-components/src/components/textarea/textarea.ts +++ b/web-components/packages/carbon-web-components/src/components/textarea/textarea.ts @@ -1,13 +1,13 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ -import { customElement, LitElement, html, property, query } from 'lit-element'; +import { LitElement, html, property, query } from 'lit-element'; import { classMap } from 'lit-html/directives/class-map'; import settings from 'carbon-components/es/globals/js/settings'; import WarningFilled16 from '@carbon/icons/lib/warning--filled/16'; @@ -17,6 +17,7 @@ import FormMixin from '../../globals/mixins/form'; import ValidityMixin from '../../globals/mixins/validity'; import { TEXTAREA_COLOR_SCHEME } from './defs'; import styles from './textarea.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; export { TEXTAREA_COLOR_SCHEME }; diff --git a/web-components/packages/carbon-web-components/src/components/tile/clickable-tile.ts b/web-components/packages/carbon-web-components/src/components/tile/clickable-tile.ts index 65c0fd3f55a0..ef6c81738397 100644 --- a/web-components/packages/carbon-web-components/src/components/tile/clickable-tile.ts +++ b/web-components/packages/carbon-web-components/src/components/tile/clickable-tile.ts @@ -1,7 +1,7 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. @@ -9,10 +9,11 @@ import settings from 'carbon-components/es/globals/js/settings'; import { classMap } from 'lit-html/directives/class-map'; -import { property, customElement } from 'lit-element'; +import { property } from 'lit-element'; import BXLink from '../link/link'; import { TILE_COLOR_SCHEME } from './defs'; import styles from './tile.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/tile/expandable-tile.ts b/web-components/packages/carbon-web-components/src/components/tile/expandable-tile.ts index 357521d08f71..61295b4b4cbe 100644 --- a/web-components/packages/carbon-web-components/src/components/tile/expandable-tile.ts +++ b/web-components/packages/carbon-web-components/src/components/tile/expandable-tile.ts @@ -1,13 +1,13 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ -import { html, property, customElement, LitElement } from 'lit-element'; +import { html, property, LitElement } from 'lit-element'; import { ifDefined } from 'lit-html/directives/if-defined'; import ChevronDown16 from '@carbon/icons/lib/chevron--down/16'; import settings from 'carbon-components/es/globals/js/settings'; @@ -16,6 +16,7 @@ import FocusMixin from '../../globals/mixins/focus'; import HostListenerMixin from '../../globals/mixins/host-listener'; import { TILE_COLOR_SCHEME } from './defs'; import styles from './tile.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/tile/radio-tile.ts b/web-components/packages/carbon-web-components/src/components/tile/radio-tile.ts index b78fe6a7d935..0102799e053c 100644 --- a/web-components/packages/carbon-web-components/src/components/tile/radio-tile.ts +++ b/web-components/packages/carbon-web-components/src/components/tile/radio-tile.ts @@ -1,20 +1,20 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ import settings from 'carbon-components/es/globals/js/settings'; -import { customElement } from 'lit-element'; import HostListener from '../../globals/decorators/host-listener'; import HostListenerMixin from '../../globals/mixins/host-listener'; import RadioGroupManager, { NAVIGATION_DIRECTION, } from '../../globals/internal/radio-group-manager'; import SelectableTile from './selectable-tile'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/tile/selectable-tile.ts b/web-components/packages/carbon-web-components/src/components/tile/selectable-tile.ts index a7b3fc872dc5..501d5e8b057f 100644 --- a/web-components/packages/carbon-web-components/src/components/tile/selectable-tile.ts +++ b/web-components/packages/carbon-web-components/src/components/tile/selectable-tile.ts @@ -9,19 +9,13 @@ import settings from 'carbon-components/es/globals/js/settings'; import { classMap } from 'lit-html/directives/class-map'; -import { - html, - svg, - property, - query, - customElement, - LitElement, -} from 'lit-element'; +import { html, svg, property, query, LitElement } from 'lit-element'; import CheckmarkFilled16 from '@carbon/icons/lib/checkmark--filled/16'; import ifNonNull from '../../globals/directives/if-non-null'; import FocusMixin from '../../globals/mixins/focus'; import { TILE_COLOR_SCHEME } from './defs'; import styles from './tile.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/tile/tile-group.ts b/web-components/packages/carbon-web-components/src/components/tile/tile-group.ts index 106b4b8067fd..a17eb96eaaf1 100644 --- a/web-components/packages/carbon-web-components/src/components/tile/tile-group.ts +++ b/web-components/packages/carbon-web-components/src/components/tile/tile-group.ts @@ -1,15 +1,16 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ -import { html, customElement, LitElement } from 'lit-element'; +import { html, LitElement } from 'lit-element'; import settings from 'carbon-components/es/globals/js/settings'; import styles from './tile.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/tile/tile.ts b/web-components/packages/carbon-web-components/src/components/tile/tile.ts index a470c870fd6e..68d24e7f69cb 100644 --- a/web-components/packages/carbon-web-components/src/components/tile/tile.ts +++ b/web-components/packages/carbon-web-components/src/components/tile/tile.ts @@ -1,14 +1,15 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ import settings from 'carbon-components/es/globals/js/settings'; -import { html, property, customElement, LitElement } from 'lit-element'; +import { html, property, LitElement } from 'lit-element'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; import { TILE_COLOR_SCHEME } from './defs'; import styles from './tile.scss'; diff --git a/web-components/packages/carbon-web-components/src/components/toggle/toggle.ts b/web-components/packages/carbon-web-components/src/components/toggle/toggle.ts index 4bcd41f54c6a..946bd0b9621f 100644 --- a/web-components/packages/carbon-web-components/src/components/toggle/toggle.ts +++ b/web-components/packages/carbon-web-components/src/components/toggle/toggle.ts @@ -1,19 +1,20 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ import { classMap } from 'lit-html/directives/class-map'; -import { html, property, customElement } from 'lit-element'; +import { html, property } from 'lit-element'; import settings from 'carbon-components/es/globals/js/settings'; import ifNonNull from '../../globals/directives/if-non-null'; import BXCheckbox from '../checkbox/checkbox'; import { TOGGLE_SIZE } from './defs'; import styles from './toggle.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; export { TOGGLE_SIZE }; diff --git a/web-components/packages/carbon-web-components/src/components/tooltip/tooltip-body.ts b/web-components/packages/carbon-web-components/src/components/tooltip/tooltip-body.ts index a46a9151b8c7..92ca19f19745 100644 --- a/web-components/packages/carbon-web-components/src/components/tooltip/tooltip-body.ts +++ b/web-components/packages/carbon-web-components/src/components/tooltip/tooltip-body.ts @@ -8,7 +8,8 @@ */ import settings from 'carbon-components/es/globals/js/settings'; -import { html, property, customElement } from 'lit-element'; +import { html, property } from 'lit-element'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; import HostListener from '../../globals/decorators/host-listener'; import BXFloatingMenu, { FLOATING_MENU_ALIGNMENT, diff --git a/web-components/packages/carbon-web-components/src/components/tooltip/tooltip-definition.ts b/web-components/packages/carbon-web-components/src/components/tooltip/tooltip-definition.ts index 02e9e325e1e7..e6f5c5d390d7 100644 --- a/web-components/packages/carbon-web-components/src/components/tooltip/tooltip-definition.ts +++ b/web-components/packages/carbon-web-components/src/components/tooltip/tooltip-definition.ts @@ -1,18 +1,19 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ import { classMap } from 'lit-html/directives/class-map'; -import { html, property, customElement, LitElement } from 'lit-element'; +import { html, property, LitElement } from 'lit-element'; import settings from 'carbon-components/es/globals/js/settings'; import FocusMixin from '../../globals/mixins/focus'; import { TOOLTIP_ALIGNMENT, TOOLTIP_DIRECTION } from './defs'; import styles from './tooltip.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; export { TOOLTIP_ALIGNMENT, TOOLTIP_DIRECTION }; diff --git a/web-components/packages/carbon-web-components/src/components/tooltip/tooltip-footer.ts b/web-components/packages/carbon-web-components/src/components/tooltip/tooltip-footer.ts index 53de08a39a92..16bec30208ad 100644 --- a/web-components/packages/carbon-web-components/src/components/tooltip/tooltip-footer.ts +++ b/web-components/packages/carbon-web-components/src/components/tooltip/tooltip-footer.ts @@ -1,14 +1,15 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ import settings from 'carbon-components/es/globals/js/settings'; -import { html, customElement, LitElement } from 'lit-element'; +import { html, LitElement } from 'lit-element'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; import styles from './tooltip.scss'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/tooltip/tooltip-icon.ts b/web-components/packages/carbon-web-components/src/components/tooltip/tooltip-icon.ts index ece048b20169..293431d8b930 100644 --- a/web-components/packages/carbon-web-components/src/components/tooltip/tooltip-icon.ts +++ b/web-components/packages/carbon-web-components/src/components/tooltip/tooltip-icon.ts @@ -1,16 +1,17 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ import { classMap } from 'lit-html/directives/class-map'; -import { html, customElement } from 'lit-element'; +import { html } from 'lit-element'; import settings from 'carbon-components/es/globals/js/settings'; import BXTooltipDefintion from './tooltip-definition'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/tooltip/tooltip.ts b/web-components/packages/carbon-web-components/src/components/tooltip/tooltip.ts index c1c66cd77ad2..9cdf276ad8ad 100644 --- a/web-components/packages/carbon-web-components/src/components/tooltip/tooltip.ts +++ b/web-components/packages/carbon-web-components/src/components/tooltip/tooltip.ts @@ -8,7 +8,7 @@ */ import settings from 'carbon-components/es/globals/js/settings'; -import { html, property, query, customElement, LitElement } from 'lit-element'; +import { html, property, query, LitElement } from 'lit-element'; import Information16 from '@carbon/icons/lib/information/16'; import HostListener from '../../globals/decorators/host-listener'; import HostListenerMixin from '../../globals/mixins/host-listener'; @@ -16,6 +16,7 @@ import { find } from '../../globals/internal/collection-helpers'; import BXFloatingMenu from '../floating-menu/floating-menu'; import BXFloatingMenuTrigger from '../floating-menu/floating-menu-trigger'; import styles from './tooltip.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/ui-shell/header-menu-button.ts b/web-components/packages/carbon-web-components/src/components/ui-shell/header-menu-button.ts index 9f8380154f4c..21ed6dcc70f6 100644 --- a/web-components/packages/carbon-web-components/src/components/ui-shell/header-menu-button.ts +++ b/web-components/packages/carbon-web-components/src/components/ui-shell/header-menu-button.ts @@ -1,7 +1,7 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. @@ -9,13 +9,14 @@ import settings from 'carbon-components/es/globals/js/settings'; import { classMap } from 'lit-html/directives/class-map'; -import { html, property, customElement, LitElement } from 'lit-element'; +import { html, property, LitElement } from 'lit-element'; import Close20 from '@carbon/icons/lib/close/20'; import Menu20 from '@carbon/icons/lib/menu/20'; import ifNonNull from '../../globals/directives/if-non-null'; import FocusMixin from '../../globals/mixins/focus'; import { SIDE_NAV_COLLAPSE_MODE, SIDE_NAV_USAGE_MODE } from './side-nav'; import styles from './header.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/ui-shell/header-menu-item.ts b/web-components/packages/carbon-web-components/src/components/ui-shell/header-menu-item.ts index 0543db1df4de..485b234f2bf0 100644 --- a/web-components/packages/carbon-web-components/src/components/ui-shell/header-menu-item.ts +++ b/web-components/packages/carbon-web-components/src/components/ui-shell/header-menu-item.ts @@ -1,14 +1,14 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ import settings from 'carbon-components/es/globals/js/settings'; -import { customElement } from 'lit-element'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; import BXHeaderNavItem from './header-nav-item'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/ui-shell/header-menu.ts b/web-components/packages/carbon-web-components/src/components/ui-shell/header-menu.ts index 1335653d8711..9f5082627045 100644 --- a/web-components/packages/carbon-web-components/src/components/ui-shell/header-menu.ts +++ b/web-components/packages/carbon-web-components/src/components/ui-shell/header-menu.ts @@ -1,7 +1,7 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. @@ -9,13 +9,14 @@ import settings from 'carbon-components/es/globals/js/settings'; import { ifDefined } from 'lit-html/directives/if-defined'; -import { html, property, query, customElement, LitElement } from 'lit-element'; +import { html, property, query, LitElement } from 'lit-element'; import ChevronDownGlyph from '@carbon/icons/lib/chevron--down/16'; import FocusMixin from '../../globals/mixins/focus'; import HostListenerMixin from '../../globals/mixins/host-listener'; import HostListener from '../../globals/decorators/host-listener'; import { forEach } from '../../globals/internal/collection-helpers'; import styles from './header.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/ui-shell/header-name.ts b/web-components/packages/carbon-web-components/src/components/ui-shell/header-name.ts index f04a546c0dc4..d9c66a93791d 100644 --- a/web-components/packages/carbon-web-components/src/components/ui-shell/header-name.ts +++ b/web-components/packages/carbon-web-components/src/components/ui-shell/header-name.ts @@ -1,7 +1,7 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. @@ -9,9 +9,10 @@ import settings from 'carbon-components/es/globals/js/settings'; import { ifDefined } from 'lit-html/directives/if-defined'; -import { html, property, customElement, LitElement } from 'lit-element'; +import { html, property, LitElement } from 'lit-element'; import FocusMixin from '../../globals/mixins/focus'; import styles from './header.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/ui-shell/header-nav-item.ts b/web-components/packages/carbon-web-components/src/components/ui-shell/header-nav-item.ts index 7146cc642137..add2fc982682 100644 --- a/web-components/packages/carbon-web-components/src/components/ui-shell/header-nav-item.ts +++ b/web-components/packages/carbon-web-components/src/components/ui-shell/header-nav-item.ts @@ -1,7 +1,7 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. @@ -9,9 +9,10 @@ import settings from 'carbon-components/es/globals/js/settings'; import { ifDefined } from 'lit-html/directives/if-defined'; -import { html, property, customElement, LitElement } from 'lit-element'; +import { html, property, LitElement } from 'lit-element'; import FocusMixin from '../../globals/mixins/focus'; import styles from './header.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/ui-shell/header-nav.ts b/web-components/packages/carbon-web-components/src/components/ui-shell/header-nav.ts index 8dd13d202cf0..77e8f20abba9 100644 --- a/web-components/packages/carbon-web-components/src/components/ui-shell/header-nav.ts +++ b/web-components/packages/carbon-web-components/src/components/ui-shell/header-nav.ts @@ -1,14 +1,15 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ import settings from 'carbon-components/es/globals/js/settings'; -import { html, property, customElement, LitElement } from 'lit-element'; +import { html, property, LitElement } from 'lit-element'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; import styles from './header.scss'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/ui-shell/header.ts b/web-components/packages/carbon-web-components/src/components/ui-shell/header.ts index a536376f705a..d6909b9432a5 100644 --- a/web-components/packages/carbon-web-components/src/components/ui-shell/header.ts +++ b/web-components/packages/carbon-web-components/src/components/ui-shell/header.ts @@ -1,14 +1,15 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ import settings from 'carbon-components/es/globals/js/settings'; -import { html, customElement, LitElement } from 'lit-element'; +import { html, LitElement } from 'lit-element'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; import styles from './header.scss'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/ui-shell/side-nav-divider.ts b/web-components/packages/carbon-web-components/src/components/ui-shell/side-nav-divider.ts index 549b109502f2..243925157e3b 100644 --- a/web-components/packages/carbon-web-components/src/components/ui-shell/side-nav-divider.ts +++ b/web-components/packages/carbon-web-components/src/components/ui-shell/side-nav-divider.ts @@ -1,14 +1,15 @@ /** * @license * - * Copyright IBM Corp. 2021, 2022 + * Copyright IBM Corp. 2021, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ import settings from 'carbon-components/es/globals/js/settings'; -import { customElement, LitElement } from 'lit-element'; +import { LitElement } from 'lit-element'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; import styles from './side-nav.scss'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/ui-shell/side-nav-items.ts b/web-components/packages/carbon-web-components/src/components/ui-shell/side-nav-items.ts index 552dfbc1604a..74df9b8d0800 100644 --- a/web-components/packages/carbon-web-components/src/components/ui-shell/side-nav-items.ts +++ b/web-components/packages/carbon-web-components/src/components/ui-shell/side-nav-items.ts @@ -1,14 +1,15 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ import settings from 'carbon-components/es/globals/js/settings'; -import { html, customElement, LitElement } from 'lit-element'; +import { html, LitElement } from 'lit-element'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; import styles from './side-nav.scss'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/ui-shell/side-nav-link.ts b/web-components/packages/carbon-web-components/src/components/ui-shell/side-nav-link.ts index 380bb1cca8d6..53c5533c4cfe 100644 --- a/web-components/packages/carbon-web-components/src/components/ui-shell/side-nav-link.ts +++ b/web-components/packages/carbon-web-components/src/components/ui-shell/side-nav-link.ts @@ -1,7 +1,7 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. @@ -9,9 +9,10 @@ import settings from 'carbon-components/es/globals/js/settings'; import { classMap } from 'lit-html/directives/class-map'; -import { html, property, query, customElement, LitElement } from 'lit-element'; +import { html, property, query, LitElement } from 'lit-element'; import FocusMixin from '../../globals/mixins/focus'; import styles from './side-nav.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/ui-shell/side-nav-menu-item.ts b/web-components/packages/carbon-web-components/src/components/ui-shell/side-nav-menu-item.ts index a12d212a2283..3750c2936aa1 100644 --- a/web-components/packages/carbon-web-components/src/components/ui-shell/side-nav-menu-item.ts +++ b/web-components/packages/carbon-web-components/src/components/ui-shell/side-nav-menu-item.ts @@ -1,7 +1,7 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. @@ -9,10 +9,11 @@ import settings from 'carbon-components/es/globals/js/settings'; import { classMap } from 'lit-html/directives/class-map'; -import { html, property, customElement, LitElement } from 'lit-element'; +import { html, property, LitElement } from 'lit-element'; import FocusMixin from '../../globals/mixins/focus'; import BXSideNavMenu from './side-nav-menu'; import styles from './side-nav.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/ui-shell/side-nav-menu.ts b/web-components/packages/carbon-web-components/src/components/ui-shell/side-nav-menu.ts index 5fb1d8677330..7c14038a849d 100644 --- a/web-components/packages/carbon-web-components/src/components/ui-shell/side-nav-menu.ts +++ b/web-components/packages/carbon-web-components/src/components/ui-shell/side-nav-menu.ts @@ -1,18 +1,19 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ import settings from 'carbon-components/es/globals/js/settings'; -import { html, property, query, customElement, LitElement } from 'lit-element'; +import { html, property, query, LitElement } from 'lit-element'; import ChevronDown20 from '@carbon/icons/lib/chevron--down/20'; import { forEach } from '../../globals/internal/collection-helpers'; import FocusMixin from '../../globals/mixins/focus'; import styles from './side-nav.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; const { prefix } = settings; diff --git a/web-components/packages/carbon-web-components/src/components/ui-shell/side-nav.ts b/web-components/packages/carbon-web-components/src/components/ui-shell/side-nav.ts index a98b3b4ba60d..f954428abb9e 100644 --- a/web-components/packages/carbon-web-components/src/components/ui-shell/side-nav.ts +++ b/web-components/packages/carbon-web-components/src/components/ui-shell/side-nav.ts @@ -1,13 +1,13 @@ /** * @license * - * Copyright IBM Corp. 2019, 2022 + * Copyright IBM Corp. 2019, 2023 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ -import { html, property, customElement, LitElement } from 'lit-element'; +import { html, property, LitElement } from 'lit-element'; import settings from 'carbon-components/es/globals/js/settings'; import on from 'carbon-components/es/globals/js/misc/on'; import HostListenerMixin from '../../globals/mixins/host-listener'; @@ -18,6 +18,7 @@ import { SIDE_NAV_COLLAPSE_MODE, SIDE_NAV_USAGE_MODE } from './defs'; import BXHeaderMenuButton from './header-menu-button'; import BXSideNavMenu from './side-nav-menu'; import styles from './side-nav.scss'; +import { carbonElement as customElement } from '../../globals/decorators/carbon-element'; export { SIDE_NAV_COLLAPSE_MODE, SIDE_NAV_USAGE_MODE }; diff --git a/web-components/packages/carbon-web-components/src/globals/decorators/carbon-element.ts b/web-components/packages/carbon-web-components/src/globals/decorators/carbon-element.ts new file mode 100644 index 000000000000..4f3becc2c8e1 --- /dev/null +++ b/web-components/packages/carbon-web-components/src/globals/decorators/carbon-element.ts @@ -0,0 +1,554 @@ +/** + * @license + * + * Copyright IBM Corp. 2019, 2023 + * + * This source code is licensed under the Apache-2.0 license found in the + * LICENSE file in the root directory of this source tree. + */ + +/** + * @license + * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. + * This code may only be used under the BSD style license found at + * http://polymer.github.io/LICENSE.txt + * The complete set of authors may be found at + * http://polymer.github.io/AUTHORS.txt + * The complete set of contributors may be found at + * http://polymer.github.io/CONTRIBUTORS.txt + * Code distributed by Google as part of the polymer project is also + * subject to an additional IP rights grant found at + * http://polymer.github.io/PATENTS.txt + */ + +/* + * IMPORTANT: For compatibility with tsickle and the Closure Compiler, all + * property decorators (but not class decorators) in this file that have + * an @ExportDecoratedItems annotation must be defined as a regular function, + * not an arrow function. + */ + +import { LitElement } from 'lit-element'; + +import { + PropertyDeclaration, + UpdatingElement, +} from 'lit-element/lib/updating-element'; + +export type Constructor = { + // tslint:disable-next-line:no-any + new (...args: any[]): T; +}; + +// From the TC39 Decorators proposal +interface ClassDescriptor { + kind: 'class'; + elements: ClassElement[]; + finisher?: (clazz: Constructor) => undefined | Constructor; +} + +// From the TC39 Decorators proposal +interface ClassElement { + kind: 'field' | 'method'; + key: PropertyKey; + placement: 'static' | 'prototype' | 'own'; + initializer?: Function; + extras?: ClassElement[]; + finisher?: (clazz: Constructor) => undefined | Constructor; + descriptor?: PropertyDescriptor; +} + +const legacyCustomElement = ( + tagName: string, + clazz: Constructor +) => { + try { + window.customElements.define(tagName, clazz); + } catch (error) { + console.warn(`Attempting to re-define ${tagName}`); + } + // Cast as any because TS doesn't recognize the return type as being a + // subtype of the decorated class when clazz is typed as + // `Constructor` for some reason. + // `Constructor` is helpful to make sure the decorator is + // applied to elements however. + // tslint:disable-next-line:no-any + return clazz as any; +}; + +const standardCustomElement = ( + tagName: string, + descriptor: ClassDescriptor +) => { + const { kind, elements } = descriptor; + return { + kind, + elements, + // This callback is called once the class is otherwise fully defined + finisher(clazz: Constructor) { + try { + window.customElements.define(tagName, clazz); + } catch (error) { + console.warn(`Attempting to re-define ${tagName}`); + } + }, + }; +}; + +/** + * Class decorator factory that defines the decorated class as a custom element. + * + * ``` + * @customElement('my-element') + * class MyElement { + * render() { + * return html``; + * } + * } + * ``` + * + * @category Decorator + * @param tagName The name of the custom element to define. + */ +export const carbonElement = + (tagName: string) => + (classOrDescriptor: Constructor | ClassDescriptor) => + typeof classOrDescriptor === 'function' + ? legacyCustomElement(tagName, classOrDescriptor) + : standardCustomElement(tagName, classOrDescriptor); + +const standardProperty = ( + options: PropertyDeclaration, + element: ClassElement +) => { + // When decorating an accessor, pass it through and add property metadata. + // Note, the `hasOwnProperty` check in `createProperty` ensures we don't + // stomp over the user's accessor. + if ( + element.kind === 'method' && + element.descriptor && + !('value' in element.descriptor) + ) { + return { + ...element, + finisher(clazz: typeof UpdatingElement) { + clazz.createProperty(element.key, options); + }, + }; + } else { + // createProperty() takes care of defining the property, but we still + // must return some kind of descriptor, so return a descriptor for an + // unused prototype field. The finisher calls createProperty(). + return { + kind: 'field', + key: Symbol(), + placement: 'own', + descriptor: {}, + // When @babel/plugin-proposal-decorators implements initializers, + // do this instead of the initializer below. See: + // https://github.com/babel/babel/issues/9260 extras: [ + // { + // kind: 'initializer', + // placement: 'own', + // initializer: descriptor.initializer, + // } + // ], + initializer(this: { [key: string]: unknown }) { + if (typeof element.initializer === 'function') { + this[element.key as string] = element.initializer.call(this); + } + }, + finisher(clazz: typeof UpdatingElement) { + clazz.createProperty(element.key, options); + }, + }; + } +}; + +const legacyProperty = ( + options: PropertyDeclaration, + proto: Object, + name: PropertyKey +) => { + (proto.constructor as typeof UpdatingElement).createProperty(name, options); +}; + +/** + * A property decorator which creates a LitElement property which reflects a + * corresponding attribute value. A [[`PropertyDeclaration`]] may optionally be + * supplied to configure property features. + * + * This decorator should only be used for public fields. Private or protected + * fields should use the [[`internalProperty`]] decorator. + * + * @example + * ```ts + * class MyElement { + * @property({ type: Boolean }) + * clicked = false; + * } + * ``` + * @category Decorator + * @ExportDecoratedItems + */ +export function property(options?: PropertyDeclaration) { + // tslint:disable-next-line:no-any decorator + return (protoOrDescriptor: Object | ClassElement, name?: PropertyKey): any => + name !== undefined + ? legacyProperty(options!, protoOrDescriptor as Object, name) + : standardProperty(options!, protoOrDescriptor as ClassElement); +} + +export interface InternalPropertyDeclaration { + /** + * A function that indicates if a property should be considered changed when + * it is set. The function should take the `newValue` and `oldValue` and + * return `true` if an update should be requested. + */ + hasChanged?(value: Type, oldValue: Type): boolean; +} + +/** + * Declares a private or protected property that still triggers updates to the + * element when it changes. + * + * Properties declared this way must not be used from HTML or HTML templating + * systems, they're solely for properties internal to the element. These + * properties may be renamed by optimization tools like the Closure Compiler. + * + * @category Decorator + * @deprecated `internalProperty` has been renamed to `state` in lit-element + * 3.0. Please update to `state` now to be compatible with 3.0. + */ +export function internalProperty(options?: InternalPropertyDeclaration) { + return property({ attribute: false, hasChanged: options?.hasChanged }); +} + +/** + * Declares a private or protected property that still triggers updates to the + * element when it changes. + * + * Properties declared this way must not be used from HTML or HTML templating + * systems, they're solely for properties internal to the element. These + * properties may be renamed by optimization tools like the Closure Compiler. + * + * @category Decorator + */ +export const state = (options?: InternalPropertyDeclaration) => + internalProperty(options); + +/** + * A property decorator that converts a class property into a getter that + * executes a querySelector on the element's renderRoot. + * + * @param selector A DOMString containing one or more selectors to match. + * @param cache An optional boolean which when true performs the DOM query only + * once and caches the result. + * @see: https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelector + * @example + * + * ```ts + * class MyElement { + * @query('#first') + * first; + * + * render() { + * return html` + *
+ *
+ * `; + * } + * } + * ``` + * @category Decorator + */ +export function query(selector: string, cache?: boolean) { + return ( + protoOrDescriptor: Object | ClassElement, + // tslint:disable-next-line:no-any decorator + name?: PropertyKey + ): any => { + const descriptor = { + get(this: LitElement) { + return this.renderRoot.querySelector(selector); + }, + enumerable: true, + configurable: true, + }; + if (cache) { + const prop = + name !== undefined ? name : (protoOrDescriptor as ClassElement).key; + const key = typeof prop === 'symbol' ? Symbol() : `__${prop}`; + descriptor.get = function (this: LitElement) { + if ( + (this as unknown as { [key: string]: Element | null })[ + key as string + ] === undefined + ) { + (this as unknown as { [key: string]: Element | null })[ + key as string + ] = this.renderRoot.querySelector(selector); + } + return (this as unknown as { [key: string]: Element | null })[ + key as string + ]; + }; + } + return name !== undefined + ? legacyQuery(descriptor, protoOrDescriptor as Object, name) + : standardQuery(descriptor, protoOrDescriptor as ClassElement); + }; +} + +// Note, in the future, we may extend this decorator to support the use case +// where the queried element may need to do work to become ready to interact +// with (e.g. load some implementation code). If so, we might elect to +// add a second argument defining a function that can be run to make the +// queried element loaded/updated/ready. +/** + * A property decorator that converts a class property into a getter that + * returns a promise that resolves to the result of a querySelector on the + * element's renderRoot done after the element's `updateComplete` promise + * resolves. When the queried property may change with element state, this + * decorator can be used instead of requiring users to await the + * `updateComplete` before accessing the property. + * + * @param selector A DOMString containing one or more selectors to match. + * @see: https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelector + * @example + * ```ts + * class MyElement { + * @queryAsync('#first') + * first; + * + * render() { + * return html` + *
+ *
+ * `; + * } + * } + * + * // external usage + * async doSomethingWithFirst() { + * (await aMyElement.first).doSomething(); + * } + * ``` + * @category Decorator + */ +export function queryAsync(selector: string) { + return ( + protoOrDescriptor: Object | ClassElement, + // tslint:disable-next-line:no-any decorator + name?: PropertyKey + ): any => { + const descriptor = { + async get(this: LitElement) { + await this.updateComplete; + return this.renderRoot.querySelector(selector); + }, + enumerable: true, + configurable: true, + }; + return name !== undefined + ? legacyQuery(descriptor, protoOrDescriptor as Object, name) + : standardQuery(descriptor, protoOrDescriptor as ClassElement); + }; +} + +/** + * A property decorator that converts a class property into a getter + * that executes a querySelectorAll on the element's renderRoot. + * + * @param selector A DOMString containing one or more selectors to match. + * @see: + * https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelectorAll + * @example + * ```ts + * class MyElement { + * @queryAll('div') + * divs; + * + * render() { + * return html` + *
+ *
+ * `; + * } + * } + * ``` + * @category Decorator + */ +export function queryAll(selector: string) { + return ( + protoOrDescriptor: Object | ClassElement, + // tslint:disable-next-line:no-any decorator + name?: PropertyKey + ): any => { + const descriptor = { + get(this: LitElement) { + return this.renderRoot.querySelectorAll(selector); + }, + enumerable: true, + configurable: true, + }; + return name !== undefined + ? legacyQuery(descriptor, protoOrDescriptor as Object, name) + : standardQuery(descriptor, protoOrDescriptor as ClassElement); + }; +} + +const legacyQuery = ( + descriptor: PropertyDescriptor, + proto: Object, + name: PropertyKey +) => { + Object.defineProperty(proto, name, descriptor); +}; + +const standardQuery = ( + descriptor: PropertyDescriptor, + element: ClassElement +) => ({ + kind: 'method', + placement: 'prototype', + key: element.key, + descriptor, +}); + +const standardEventOptions = ( + options: AddEventListenerOptions, + element: ClassElement +) => { + return { + ...element, + finisher(clazz: typeof UpdatingElement) { + Object.assign( + // @ts-ignore TS2769: No overload matches this call. + clazz.prototype[element.key as keyof UpdatingElement], + options + ); + }, + }; +}; + +const legacyEventOptions = + // tslint:disable-next-line:no-any legacy decorator + (options: AddEventListenerOptions, proto: any, name: PropertyKey) => { + Object.assign(proto[name], options); + }; + +/** + * Adds event listener options to a method used as an event listener in a + * lit-html template. + * + * @param options An object that specifies event listener options as accepted by + * `EventTarget#addEventListener` and `EventTarget#removeEventListener`. + * @see https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Parameters + * Current browsers support the `capture`, `passive`, and `once` options. See: + * @example + * ```ts + * class MyElement { + * clicked = false; + * + * render() { + * return html` + *
+ * + *
+ * `; + * } + * + * @eventOptions({capture: true}) + * _onClick(e) { + * this.clicked = true; + * } + * } + * ``` + * @category Decorator + */ +export function eventOptions(options: AddEventListenerOptions) { + // Return value typed as any to prevent TypeScript from complaining that + // standard decorator function signature does not match TypeScript decorator + // signature + // TODO(kschaaf): unclear why it was only failing on this decorator and not + // the others + return ((protoOrDescriptor: Object | ClassElement, name?: string) => + name !== undefined + ? legacyEventOptions(options, protoOrDescriptor as Object, name) + : standardEventOptions( + options, + protoOrDescriptor as ClassElement + )) as any; // tslint:disable-next-line:no-any decorator +} + +// x-browser support for matches +// tslint:disable-next-line:no-any +const ElementProto = Element.prototype as any; +const legacyMatches = + ElementProto.msMatchesSelector || ElementProto.webkitMatchesSelector; + +/** + * A property decorator that converts a class property into a getter that + * returns the `assignedNodes` of the given named `slot`. Note, the type of + * this property should be annotated as `NodeListOf`. + * + * @param slotName A string name of the slot. + * @param flatten A boolean which when true flattens the assigned nodes, + * meaning any assigned nodes that are slot elements are replaced with their + * assigned nodes. + * @param selector A string which filters the results to elements that match + * the given css selector. + * @example + * ```ts + * class MyElement { + * @queryAssignedNodes('list', true, '.item') + * listItems; + * + * render() { + * return html` + * + * `; + * } + * } + * ``` + * @category Decorator + */ +export function queryAssignedNodes( + slotName = '', + flatten = false, + selector = '' +) { + return ( + protoOrDescriptor: Object | ClassElement, + // tslint:disable-next-line:no-any decorator + name?: PropertyKey + ): any => { + const descriptor = { + get(this: LitElement) { + const slotSelector = `slot${ + slotName ? `[name=${slotName}]` : ':not([name])' + }`; + const slot = this.renderRoot.querySelector(slotSelector); + let nodes = + slot && (slot as HTMLSlotElement).assignedNodes({ flatten }); + if (nodes && selector) { + nodes = nodes.filter( + (node) => + node.nodeType === Node.ELEMENT_NODE && + // tslint:disable-next-line:no-any testing existence on older browsers + ((node as any).matches + ? (node as Element).matches(selector) + : legacyMatches.call(node as Element, selector)) + ); + } + return nodes; + }, + enumerable: true, + configurable: true, + }; + return name !== undefined + ? legacyQuery(descriptor, protoOrDescriptor as Object, name) + : standardQuery(descriptor, protoOrDescriptor as ClassElement); + }; +}