Skip to content

Commit

Permalink
Merge pull request #204 from MaibornWolff/#199-checkbox-group
Browse files Browse the repository at this point in the history
#199 checkbox group
  • Loading branch information
Fuasmattn authored Jul 26, 2023
2 parents c2b104e + ad334b7 commit 5740483
Show file tree
Hide file tree
Showing 18 changed files with 787 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -327,14 +327,14 @@ export class MwCardTitle {
export declare interface MwCardTitle extends Components.MwCardTitle {}

@ProxyCmp({
inputs: ["checked", "disabled", "label", "name", "testId", "value"],
inputs: ["checked", "disabled", "indeterminate", "label", "labelPosition", "name", "testId", "value"],
})
@Component({
selector: "mw-checkbox",
changeDetection: ChangeDetectionStrategy.OnPush,
template: "<ng-content></ng-content>",
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
inputs: ["checked", "disabled", "label", "name", "testId", "value"],
inputs: ["checked", "disabled", "indeterminate", "label", "labelPosition", "name", "testId", "value"],
})
export class MwCheckbox {
protected el: HTMLElement;
Expand All @@ -352,6 +352,32 @@ export declare interface MwCheckbox extends Components.MwCheckbox {
emitter: EventEmitter<CustomEvent<any>>;
}

@ProxyCmp({
inputs: ["direction", "parentLabel", "value", "wrap"],
})
@Component({
selector: "mw-checkbox-group",
changeDetection: ChangeDetectionStrategy.OnPush,
template: "<ng-content></ng-content>",
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
inputs: ["direction", "parentLabel", "value", "wrap"],
})
export class MwCheckboxGroup {
protected el: HTMLElement;
constructor(c: ChangeDetectorRef, r: ElementRef, protected z: NgZone) {
c.detach();
this.el = r.nativeElement;
proxyOutputs(this, this.el, ["checkboxChange"]);
}
}

export declare interface MwCheckboxGroup extends Components.MwCheckboxGroup {
/**
* Event emitted when radioGroup value changes (after radio selection)
*/
checkboxChange: EventEmitter<CustomEvent<{ value?: Array<string | number> }>>;
}

@ProxyCmp({
inputs: ["disabled", "icon", "selected", "showClose", "testId", "toggleable", "value"],
})
Expand Down Expand Up @@ -768,14 +794,14 @@ export declare interface MwPopover extends Components.MwPopover {
}

@ProxyCmp({
inputs: ["checked", "disabled", "label", "name", "testId", "value"],
inputs: ["checked", "disabled", "label", "labelPosition", "name", "testId", "value"],
})
@Component({
selector: "mw-radio",
changeDetection: ChangeDetectionStrategy.OnPush,
template: "<ng-content></ng-content>",
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
inputs: ["checked", "disabled", "label", "name", "testId", "value"],
inputs: ["checked", "disabled", "label", "labelPosition", "name", "testId", "value"],
})
export class MwRadio {
protected el: HTMLElement;
Expand All @@ -788,14 +814,14 @@ export class MwRadio {
export declare interface MwRadio extends Components.MwRadio {}

@ProxyCmp({
inputs: ["value"],
inputs: ["direction", "value", "wrap"],
})
@Component({
selector: "mw-radio-group",
changeDetection: ChangeDetectionStrategy.OnPush,
template: "<ng-content></ng-content>",
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
inputs: ["value"],
inputs: ["direction", "value", "wrap"],
})
export class MwRadioGroup {
protected el: HTMLElement;
Expand Down Expand Up @@ -834,14 +860,14 @@ export class MwSlider {
export declare interface MwSlider extends Components.MwSlider {}

@ProxyCmp({
inputs: ["checked", "disabled", "label", "off", "on", "testId"],
inputs: ["checked", "disabled", "label", "labelPosition", "name", "off", "on", "testId"],
})
@Component({
selector: "mw-switch",
changeDetection: ChangeDetectionStrategy.OnPush,
template: "<ng-content></ng-content>",
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
inputs: ["checked", "disabled", "label", "off", "on", "testId"],
inputs: ["checked", "disabled", "label", "labelPosition", "name", "off", "on", "testId"],
})
export class MwSwitch {
protected el: HTMLElement;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export const DIRECTIVES = [
d.MwCardImage,
d.MwCardTitle,
d.MwCheckbox,
d.MwCheckboxGroup,
d.MwChip,
d.MwChipInput,
d.MwDivider,
Expand Down
1 change: 1 addition & 0 deletions mwui-react/src/components/stencil-generated/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export const MwCardHeader = /*@__PURE__*/ createReactComponent<JSX.MwCardHeader,
export const MwCardImage = /*@__PURE__*/ createReactComponent<JSX.MwCardImage, HTMLMwCardImageElement>("mw-card-image");
export const MwCardTitle = /*@__PURE__*/ createReactComponent<JSX.MwCardTitle, HTMLMwCardTitleElement>("mw-card-title");
export const MwCheckbox = /*@__PURE__*/ createReactComponent<JSX.MwCheckbox, HTMLMwCheckboxElement>("mw-checkbox");
export const MwCheckboxGroup = /*@__PURE__*/ createReactComponent<JSX.MwCheckboxGroup, HTMLMwCheckboxGroupElement>("mw-checkbox-group");
export const MwChip = /*@__PURE__*/ createReactComponent<JSX.MwChip, HTMLMwChipElement>("mw-chip");
export const MwChipInput = /*@__PURE__*/ createReactComponent<JSX.MwChipInput, HTMLMwChipInputElement>("mw-chip-input");
export const MwDivider = /*@__PURE__*/ createReactComponent<JSX.MwDivider, HTMLMwDividerElement>("mw-divider");
Expand Down
Loading

0 comments on commit 5740483

Please sign in to comment.