open-wc / custom-elements-manifest-deprecated

Custom Elements Manifest is a file format that describes custom elements in your project.
8 stars 4 forks source link

mixins not output correctly #43

Closed thepassle closed 3 years ago

thepassle commented 3 years ago
import { LitElement } from '@lion/core';
import { ChoiceGroupMixin, FormGroupMixin } from '@lion/form-core';

/**
 * A wrapper around multiple radios.
 */
export class LionRadioGroup extends ChoiceGroupMixin(FormGroupMixin(LitElement)) {
  connectedCallback() {
    super.connectedCallback();
    this.setAttribute('role', 'radiogroup');
  }

  /**
   * @override FormGroupMixin, during a reset if the current checked value is behind
   * the initial checked value, they both got unchecked
   */
  resetGroup() {
    let initValue;
    this.formElements.forEach(child => {
      if (typeof child.resetGroup === 'function') {
        child.resetGroup();
      } else if (typeof child.reset === 'function') {
        child.reset();
        // If the value was initially checked save this
        if (child.checked) {
          initValue = child.value;
        }
      }
    });
    this.modelValue = initValue;

    this.resetInteractionState();
  }
}
{
      "kind": "javascript-module",
      "path": "./src/LionRadioGroup.js",
      "declarations": [
        {
          "kind": "class",
          "name": "LionRadioGroup",
          "mixins": [
            {
              "name": "ChoiceGroupMixin",
              "package": "@lion/form-core"
            },
            {
              "name": "ChoiceGroupMixin",
              "package": "@lion/form-core"
            }
          ],
          "superclass": {
            "name": "LitElement",
            "package": "@lion/core"
          },
          "members": [
            {
              "kind": "method",
              "name": "resetGroup",
              "privacy": "public"
            }
          ],
          "tagName": "lion-radio-group"
        }
      ],
      "exports": [
        {
          "kind": "js",
          "name": "LionRadioGroup",
          "declaration": {
            "name": "LionRadioGroup",
            "module": "./src/LionRadioGroup.js"
          }
        }
      ]
    }
thepassle commented 3 years ago

note: one of those should be FormGroupMixin

            {
              "name": "ChoiceGroupMixin",
              "package": "@lion/form-core"
            },
            {
              "name": "ChoiceGroupMixin",
              "package": "@lion/form-core"
            }