@odx/foundation 1.0.0-beta.239 → 1.0.0-beta.240

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,14 +1,12 @@
1
1
  import { CheckboxControl, CustomElement } from '../../main.js';
2
- import { OdxIconName } from '@odx/icons';
3
2
  import { PropertyValues, TemplateResult } from 'lit';
4
3
  declare global {
5
4
  interface HTMLElementTagNameMap {
6
5
  'odx-checkbox': OdxCheckbox;
7
6
  }
8
7
  }
9
- declare const OdxCheckbox_base: import('../../utils/main.js').Constructor<CheckboxControl> & typeof CustomElement;
8
+ declare const OdxCheckbox_base: import('../../utils/types.js').Constructor<CheckboxControl> & typeof CustomElement;
10
9
  export declare class OdxCheckbox extends OdxCheckbox_base {
11
- get indicatorIcon(): OdxIconName | null;
12
10
  protected render(): TemplateResult;
13
11
  protected renderContent(): TemplateResult | null;
14
12
  protected willUpdate(props: PropertyValues<this>): void;
@@ -1,3 +1,4 @@
1
+ import { TemplateResult } from 'lit';
1
2
  import { OdxCheckbox } from '../main.js';
2
3
  declare global {
3
4
  interface HTMLElementTagNameMap {
@@ -6,8 +7,8 @@ declare global {
6
7
  }
7
8
  export declare class OdxRadioButton extends OdxCheckbox {
8
9
  indeterminate: never;
9
- get indicatorIcon(): null;
10
10
  connectedCallback(): void;
11
11
  toggle(state?: boolean, emitEvent?: boolean): boolean;
12
+ protected render(): TemplateResult;
12
13
  }
13
14
  //# sourceMappingURL=radio-button.d.ts.map
@@ -14,7 +14,6 @@ export declare const SwitchIndicatorPosition: Pick<{
14
14
  }, "START" | "END">;
15
15
  export declare class OdxSwitch extends OdxCheckbox {
16
16
  indicatorPosition: SwitchIndicatorPosition;
17
- get indicatorIcon(): import('@odx/icons').OdxIconName | null;
18
17
  connectedCallback(): void;
19
18
  protected render(): TemplateResult;
20
19
  }
@@ -1659,11 +1659,8 @@ class OdxCheckbox extends CheckboxControl(CustomElement) {
1659
1659
  static {
1660
1660
  customElement("odx-checkbox", styles$_)(OdxCheckbox);
1661
1661
  }
1662
- get indicatorIcon() {
1663
- return this.indeterminate ? "core::minus" : "core::check";
1664
- }
1665
1662
  render() {
1666
- return html`<div class="indicator"><odx-icon class="icon" name="${optionalAttr(this.indicatorIcon)}"></odx-icon></div>${this.renderContent()}`;
1663
+ return html`<div class="indicator">${when(this.checked || this.indeterminate, () => html`<odx-icon class="icon" name="${this.indeterminate ? "core::minus" : "core::check"}"></odx-icon>`)}</div>${this.renderContent()}`;
1667
1664
  }
1668
1665
  renderContent() {
1669
1666
  return html`<div class="content"><div class="label"><slot></slot></div><div class="description"><slot name="description"></slot></div></div>`;
@@ -3396,9 +3393,6 @@ class OdxRadioButton extends OdxCheckbox {
3396
3393
  static {
3397
3394
  customElement("odx-radio-button", styles$t)(OdxRadioButton);
3398
3395
  }
3399
- get indicatorIcon() {
3400
- return null;
3401
- }
3402
3396
  connectedCallback() {
3403
3397
  super.connectedCallback();
3404
3398
  this.role = "radio";
@@ -3406,6 +3400,9 @@ class OdxRadioButton extends OdxCheckbox {
3406
3400
  toggle(state, emitEvent = false) {
3407
3401
  return super.toggle(state ?? true, emitEvent);
3408
3402
  }
3403
+ render() {
3404
+ return html`<div class="indicator"><odx-icon class="icon"></odx-icon></div>${this.renderContent()}`;
3405
+ }
3409
3406
  }
3410
3407
 
3411
3408
  const styles$s = ":host{display:flex}:host(:not([layout=horizontal])){flex-direction:column}:host([layout=list]){::slotted(odx-radio-button:last-of-type){border-block-end:none}::slotted(odx-radio-button){border-block-end:var(--odx-border-width-thin)solid var(--odx-color-stroke-neutral-subtle);padding:var(--odx-layout-spacing-md);width:auto;margin:0}}";
@@ -4246,15 +4243,12 @@ const _OdxSwitch = class _OdxSwitch extends OdxCheckbox {
4246
4243
  static {
4247
4244
  customElement("odx-switch", styles$f)(_OdxSwitch);
4248
4245
  }
4249
- get indicatorIcon() {
4250
- return this.checked || this.indeterminate ? super.indicatorIcon : "core::close";
4251
- }
4252
4246
  connectedCallback() {
4253
4247
  super.connectedCallback();
4254
4248
  this.role = "switch";
4255
4249
  }
4256
4250
  render() {
4257
- return html`<div class="base"><div class="indicator"><odx-icon class="icon" name="${optionalAttr(this.indicatorIcon)}"></odx-icon></div><div class="track"></div></div>${this.renderContent()}`;
4251
+ return html`<div class="base"><div class="indicator"><odx-icon class="icon" name="${this.checked ? this.indeterminate ? "core::minus" : "core::check" : "core::close"}"></odx-icon></div><div class="track"></div></div>${this.renderContent()}`;
4258
4252
  }
4259
4253
  };
4260
4254
  __decorateClass([
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@odx/foundation",
3
3
  "displayName": "ODX Design System Foundation",
4
4
  "description": "A library of Web Component building blocks for ODX",
5
- "version": "1.0.0-beta.239",
5
+ "version": "1.0.0-beta.240",
6
6
  "author": "Drägerwerk AG & Co.KGaA",
7
7
  "license": "SEE LICENSE IN LICENSE",
8
8
  "homepage": "https://odx.draeger.com",
@@ -34,8 +34,8 @@
34
34
  "@odx-internal/config-stylelint": "0.0.0",
35
35
  "@odx-internal/config-typescript": "0.0.0",
36
36
  "@odx-internal/config-vite": "0.0.0",
37
- "@odx-internal/utils-storybook": "0.0.0",
38
- "@odx/design-tokens": "2.3.0"
37
+ "@odx/design-tokens": "2.3.0",
38
+ "@odx-internal/utils-storybook": "0.0.0"
39
39
  },
40
40
  "sideEffects": [
41
41
  "dist/components-loader.js",