Skip to content

Commit 3724b9e

Browse files
authored
Merge pull request #76 from gjovanovicst/main
Implemented showcase doc for input-switch component
2 parents 0168e36 + f94ebb0 commit 3724b9e

File tree

40 files changed

+1416
-466
lines changed

40 files changed

+1416
-466
lines changed

packages/angular/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@anywhere-ui/angular",
3-
"version": "0.4.0+21",
3+
"version": "0.4.0+22",
44
"license": "MIT",
55
"keywords": [
66
"anywhere-ui",
@@ -66,5 +66,5 @@
6666
"tslint": "~6.1.3",
6767
"typescript": "4.9.5"
6868
},
69-
"buildnum": "21"
69+
"buildnum": "22"
7070
}

packages/angular/projects/anywhere-ui/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@anywhere-ui/angular",
3-
"version": "0.4.0+21",
3+
"version": "0.4.0+22",
44
"license": "MIT",
55
"keywords": [
66
"anywhere-ui",
@@ -33,5 +33,5 @@
3333
"@anywhere-ui/core": "^0.3.0",
3434
"@anywhere-ui/flex": "^1.0.2"
3535
},
36-
"buildnum": "21"
36+
"buildnum": "22"
3737
}

packages/angular/projects/anywhere-ui/src/lib/directives/angular-component-lib/utils.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@ export const proxyInputs = (Cmp: any, inputs: string[]) => {
1212
set(val: any) {
1313
this.z.runOutsideAngular(() => (this.el[item] = val));
1414
},
15+
/**
16+
* In the event that proxyInputs is called
17+
* multiple times re-defining these inputs
18+
* will cause an error to be thrown. As a result
19+
* we set configurable: true to indicate these
20+
* properties can be changed.
21+
*/
22+
configurable: true,
1523
});
1624
});
1725
};

packages/angular/projects/anywhere-ui/src/lib/directives/proxies.ts

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1082,3 +1082,69 @@ export class DropdownVirtualScroll {
10821082
export declare interface DropdownVirtualScroll extends Components.DropdownVirtualScroll {}
10831083

10841084

1085+
@ProxyCmp({
1086+
inputs: ['textId', 'textTitle']
1087+
})
1088+
@Component({
1089+
selector: 'input-switch-basic',
1090+
changeDetection: ChangeDetectionStrategy.OnPush,
1091+
template: '<ng-content></ng-content>',
1092+
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
1093+
inputs: ['textId', 'textTitle'],
1094+
})
1095+
export class InputSwitchBasic {
1096+
protected el: HTMLElement;
1097+
constructor(c: ChangeDetectorRef, r: ElementRef, protected z: NgZone) {
1098+
c.detach();
1099+
this.el = r.nativeElement;
1100+
}
1101+
}
1102+
1103+
1104+
export declare interface InputSwitchBasic extends Components.InputSwitchBasic {}
1105+
1106+
1107+
@ProxyCmp({
1108+
inputs: ['textId', 'textTitle']
1109+
})
1110+
@Component({
1111+
selector: 'input-switch-disabled',
1112+
changeDetection: ChangeDetectionStrategy.OnPush,
1113+
template: '<ng-content></ng-content>',
1114+
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
1115+
inputs: ['textId', 'textTitle'],
1116+
})
1117+
export class InputSwitchDisabled {
1118+
protected el: HTMLElement;
1119+
constructor(c: ChangeDetectorRef, r: ElementRef, protected z: NgZone) {
1120+
c.detach();
1121+
this.el = r.nativeElement;
1122+
}
1123+
}
1124+
1125+
1126+
export declare interface InputSwitchDisabled extends Components.InputSwitchDisabled {}
1127+
1128+
1129+
@ProxyCmp({
1130+
inputs: ['textId', 'textTitle']
1131+
})
1132+
@Component({
1133+
selector: 'input-switch-preselection',
1134+
changeDetection: ChangeDetectionStrategy.OnPush,
1135+
template: '<ng-content></ng-content>',
1136+
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
1137+
inputs: ['textId', 'textTitle'],
1138+
})
1139+
export class InputSwitchPreselection {
1140+
protected el: HTMLElement;
1141+
constructor(c: ChangeDetectorRef, r: ElementRef, protected z: NgZone) {
1142+
c.detach();
1143+
this.el = r.nativeElement;
1144+
}
1145+
}
1146+
1147+
1148+
export declare interface InputSwitchPreselection extends Components.InputSwitchPreselection {}
1149+
1150+

0 commit comments

Comments
 (0)