Skip to content

Commit

Permalink
Merge branch 'master' into elements-1009_fix_angular_release
Browse files Browse the repository at this point in the history
# Conflicts:
#	packages/storybook/elements-stencil-docs.json
  • Loading branch information
janivo committed Oct 26, 2023
2 parents 70f6c4e + 34bf394 commit ae6c800
Show file tree
Hide file tree
Showing 177 changed files with 9,956 additions and 6,362 deletions.
1 change: 1 addition & 0 deletions .github/semantic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ types:
scopes:
- elements|ino-accordion
- elements|ino-autocomplete
- elements|ino-avatar
- elements|ino-button
- elements|ino-card
- elements|ino-carousel
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/deploy-landingpage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,4 @@ jobs:
.gitlab-ci.yml
version
unicorn
hosted-versions.json
2 changes: 2 additions & 0 deletions .github/workflows/semantic-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ jobs:
revert
# Configure which scopes are allowed.
scopes: |
elements|ino-accordion
elements|ino-autocomplete
elements|ino-avatar
elements|ino-button
elements|ino-card
elements|ino-carousel
Expand Down
14 changes: 8 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
"start:angular": "nx run-many --target=start --projects=,elements,elements-angular --output-style=stream",
"start:angular-example": "nx run elements-angular-example:start",
"start:react-example": "nx run-many --target=start --projects=elements-react*,elements --output-style=stream",
"start:react-example:only": "nx run react-example:start",
"start:react-example:only": "nx run elements-react-example:start",
"start:vue-example": "nx run-many --target=start --projects=elements-vue*,elements --output-style=stream",
"start:vue-example:only": "nx run vue-example:start",
"start:vue-example:only": "nx run elements-vue-example:start",
"start:landingpage": "nx run-many --target=start --projects=landingpage,elements-react,elements --output-style=stream",
"start:landingpage:only": "nx run landingpage:start",
"---build---": "",
Expand Down Expand Up @@ -64,9 +64,10 @@
"@angular/cli": "~15.1.0",
"@angular/compiler-cli": "~15.1.0",
"@angular/language-service": "~15.1.0",
"@nrwl/angular": "^15.5.2",
"@nrwl/eslint-plugin-nx": "^15.5.2",
"@nrwl/storybook": "15.5.2",
"@nrwl/angular": "15.9.7",
"@nrwl/eslint-plugin-nx": "15.9.7",
"@nrwl/nx": "^7.8.7",
"@nrwl/storybook": "15.9.7",
"@types/css-font-loading-module": "^0.0.7",
"@types/fs-extra": "^9.0.13",
"@types/jest": "26.0.24",
Expand All @@ -85,7 +86,7 @@
"lerna": "^5.5.2",
"lint-staged": "^10.5.3",
"ng-packagr": "~15.1.0",
"nx": "15.5.2",
"nx": "15.9.7",
"postcss": "^8.4.5",
"postcss-import": "~14.1.0",
"postcss-preset-env": "~7.5.0",
Expand Down Expand Up @@ -133,3 +134,4 @@
"name": "core",
"version": "8.1.3"
}

2 changes: 1 addition & 1 deletion packages/elements-angular-example/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"useDefineForClassFields": false,
"forceConsistentCasingInFileNames": true,
"strict": true,
"noImplicitOverride": true,
"noImplicitOverride": false,
"noPropertyAccessFromIndexSignature": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
Expand Down
3 changes: 1 addition & 2 deletions packages/elements-angular/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
"extends": ["../../.eslintrc.json"],
"ignorePatterns": [
"!**/*",
"proxies*.ts",
"**/angular-component-lib/utils.ts"
"src/generated/**"
],
"overrides": [
{
Expand Down

This file was deleted.

This file was deleted.

4 changes: 0 additions & 4 deletions packages/elements-angular/src/control-value-accesors/index.ts

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,46 +4,40 @@ import { fromEvent } from 'rxjs';

export const proxyInputs = (Cmp: any, inputs: string[]) => {
const Prototype = Cmp.prototype;
inputs.forEach(item => {
inputs.forEach((item) => {
Object.defineProperty(Prototype, item, {
get() {
return this.el[item];
},
set(val: any) {
this.z.runOutsideAngular(() => (this.el[item] = val));
}
},
});
});
};

export const proxyMethods = (Cmp: any, methods: string[]) => {
const Prototype = Cmp.prototype;
methods.forEach(methodName => {
methods.forEach((methodName) => {
Prototype[methodName] = function () {
const args = arguments;
return this.z.runOutsideAngular(() =>
this.el[methodName].apply(this.el, args)
);
return this.z.runOutsideAngular(() => this.el[methodName].apply(this.el, args));
};
});
};

export const proxyOutputs = (instance: any, el: any, events: string[]) => {
events.forEach(eventName => instance[eventName] = fromEvent(el, eventName));
}
events.forEach((eventName) => (instance[eventName] = fromEvent(el, eventName)));
};

export const defineCustomElement = (tagName: string, customElement: any) => {
if (
customElement !== undefined &&
typeof customElements !== 'undefined' &&
!customElements.get(tagName)
) {
if (customElement !== undefined && typeof customElements !== 'undefined' && !customElements.get(tagName)) {
customElements.define(tagName, customElement);
}
}
};

// tslint:disable-next-line: only-arrow-functions
export function ProxyCmp(opts: { defineCustomElementFn?: () => void, inputs?: any; methods?: any }) {
export function ProxyCmp(opts: { defineCustomElementFn?: () => void; inputs?: any; methods?: any }) {
const decorator = function (cls: any) {
const { defineCustomElementFn, inputs, methods } = opts;

Expand Down
27 changes: 27 additions & 0 deletions packages/elements-angular/src/generated/boolean-value-accessor.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { Directive, ElementRef } from '@angular/core';
import { NG_VALUE_ACCESSOR } from '@angular/forms';

import { ValueAccessor } from './value-accessor';

@Directive({
/* tslint:disable-next-line:directive-selector */
selector: 'ino-checkbox, ino-control-item[role="checkbox"], ino-switch',
host: {
'(checkedChange)': 'handleChangeEvent($event.target.checked)'
},
providers: [
{
provide: NG_VALUE_ACCESSOR,
useExisting: BooleanValueAccessor,
multi: true
}
]
})
export class BooleanValueAccessor extends ValueAccessor {
constructor(el: ElementRef) {
super(el);
}
writeValue(value: any) {
this.el.nativeElement.checked = this.lastValue = value == null ? false : value;
}
}
Loading

0 comments on commit ae6c800

Please sign in to comment.