Skip to content

Commit

Permalink
Merge pull request #13 from scenius-software/ng16-update-fix-demo
Browse files Browse the repository at this point in the history
Upgrade packages and fix demo
  • Loading branch information
Lerke authored Oct 17, 2023
2 parents d5a3ba0 + a47e45a commit 8a1d2ac
Show file tree
Hide file tree
Showing 17 changed files with 5,207 additions and 3,495 deletions.
8,627 changes: 5,174 additions & 3,453 deletions package-lock.json

Large diffs are not rendered by default.

28 changes: 14 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
},
"private": true,
"dependencies": {
"@angular/animations": "~16.1.1",
"@angular/common": "~16.1.1",
"@angular/compiler": "~16.1.1",
"@angular/core": "~16.1.1",
"@angular/forms": "~16.1.1",
"@angular/platform-browser": "~16.1.1",
"@angular/platform-browser-dynamic": "~16.1.1",
"@angular/router": "~16.1.1",
"@angular/animations": "~16.2.9",
"@angular/common": "~16.2.9",
"@angular/compiler": "~16.2.9",
"@angular/core": "~16.2.9",
"@angular/forms": "~16.2.9",
"@angular/platform-browser": "~16.2.9",
"@angular/platform-browser-dynamic": "~16.2.9",
"@angular/router": "~16.2.9",
"@cds/core": "6.4.3",
"@clr/angular": "15.5.1",
"@clr/icons": "13.0.2",
Expand All @@ -32,15 +32,15 @@
"zone.js": "0.13.1"
},
"devDependencies": {
"@angular-devkit/build-angular": "^16.1.0",
"ng-packagr": "^16.1.0",
"@angular/cli": "16.1.0",
"@angular/compiler-cli": "16.1.1",
"@angular/language-service": "16.1.1",
"@angular-devkit/build-angular": "^16.2.6",
"@angular/cli": "16.2.6",
"@angular/compiler-cli": "16.2.9",
"@angular/language-service": "16.2.9",
"@types/node": "20.3.1",
"codelyzer": "6.0.2",
"codelyzer": "^0.0.28",
"jasmine-core": "5.0.1",
"jasmine-spec-reporter": "7.0.0",
"ng-packagr": "^16.1.0",
"ts-node": "10.9.1",
"tslint": "~6.1.0",
"typescript": "5.1.3"
Expand Down
1 change: 0 additions & 1 deletion projects/demo/src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { ScClrAutocompleteModule } from 'projects/sc-clr-autocomplete/src/lib/sc-clr-autocomplete.module';


const routes: Routes = [];

@NgModule({
Expand Down
3 changes: 1 addition & 2 deletions projects/demo/src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Component } from '@angular/core';
import { UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';
import { UntypedFormControl, UntypedFormGroup } from '@angular/forms';
import { ScClrAutocompleteMode } from 'projects/sc-clr-autocomplete/src/lib/model/autocomplete-result/sc-clr-autocomplete.mode';
import version from '../../../../version';

Expand All @@ -24,5 +24,4 @@ export abstract class FormSender {
sendForm() {
alert(JSON.stringify(this.form.value));
}

}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, OnInit } from '@angular/core';
import { Component } from '@angular/core';
import { ScAutocompleteModel } from 'projects/sc-clr-autocomplete/src/lib/model/autocomplete-model/sc-autocomplete.model';
import { StaticAutocompleteModel } from 'projects/sc-clr-autocomplete/src/lib/model/autocomplete-model/static-autocomplete.model';
import { FormSender } from 'projects/demo/src/app/app.component';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, OnInit } from '@angular/core';
import { Component } from '@angular/core';
import { FormSender } from 'projects/demo/src/app/app.component';
import { ScAutocompleteModel } from 'projects/sc-clr-autocomplete/src/lib/model/autocomplete-model/sc-autocomplete.model';
import { StaticAutocompleteModel } from 'projects/sc-clr-autocomplete/src/lib/model/autocomplete-model/static-autocomplete.model';
Expand All @@ -8,7 +8,7 @@ import { StaticAutocompleteModel } from 'projects/sc-clr-autocomplete/src/lib/mo
templateUrl: './static-select.component.html',
styleUrls: ['./static-select.component.scss']
})
export class StaticSelectComponent extends FormSender implements OnInit {
export class StaticSelectComponent extends FormSender{
model: ScAutocompleteModel<string>;
exampleCodeStaticTypescript = 'private _demoModel = [ \'Hello\', \'world\', \'this\', \'is\', \'an\', \'auto complete\', \'component\', \'for\', \'clarity\' ];\n' +
'this.model = new StaticAutocompleteModel(this._demoModel);';
Expand All @@ -25,8 +25,4 @@ export class StaticSelectComponent extends FormSender implements OnInit {
super();
this.model = new StaticAutocompleteModel(this._demoModel);
}

ngOnInit() {
}

}
2 changes: 1 addition & 1 deletion projects/sc-clr-autocomplete/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sc-clr-autocomplete",
"version": "0.0.18",
"version": "0.0.19",
"description": "Autocomplete Component for Clarity",
"author": "Scenius",
"repository": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { ClrAutocompleteItem } from '../../model/autocomplete-result/clr-autocom
})
export class ScClrAutocompleteComponent<T> implements ControlValueAccessor, AfterViewInit {
/**
* Returns whether or not a valid value is selected from the auto-complete model.
* Returns whether a valid value is selected from the auto-complete model.
*/
get elementIsSelected(): boolean {
return this.selectedItem !== undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import { ScAutocompleteModel } from '../model/autocomplete-model/sc-autocomplete
import { ClrAutocompleteItem } from '../model/autocomplete-result/clr-autocomplete.item';

export class ScQueryHelpers {
private constructor() {}

static queryModel<T>(model: ScAutocompleteModel<any>, queryTerm: string): Array<ClrAutocompleteItem<T>> {
const searchExp = queryTerm.length > 0 ? new RegExp('^(.*)(' + ScQueryHelpers.escape(queryTerm) + ')(.*)$', 'i')
: new RegExp('^(.*)$', 'i');
Expand All @@ -22,7 +20,7 @@ export class ScQueryHelpers {
}

/**
* Lets not have the user input any values that could be parsed as regex structures.
* Let's not have the user input any values that could be parsed as regex structures.
* @param val input to sanitize.
*/
private static escape(val: string): string {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { HttpClient } from '@angular/common/http';
import { ClrAutocompleteItem } from '../autocomplete-result/clr-autocomplete.item';
import { ScQueryHelpers } from '../../helpers/qeuery-helpers';
import { ScQueryHelpers } from '../../helpers/sc-query-helpers';
import { ScAutocompleteModel } from './sc-autocomplete.model';

export class HttpAutocompleteModel<T> extends ScAutocompleteModel<T> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Observable } from 'rxjs';
import { ScAutocompleteModel } from './sc-autocomplete.model';
import { ClrAutocompleteItem } from '../autocomplete-result/clr-autocomplete.item';
import { ScQueryHelpers } from '../../helpers/qeuery-helpers';
import { ScQueryHelpers } from '../../helpers/sc-query-helpers';

export class ObservableAutocompleteModel<T> extends ScAutocompleteModel<T> {
constructor(private _observable: Observable<Array<T>>, _displaySelector: ((T1: T) => string) = ((T1) => T1.toString())) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ScAutocompleteModel } from './sc-autocomplete.model';
import { ScQueryHelpers } from '../../helpers/qeuery-helpers';
import { ScQueryHelpers } from '../../helpers/sc-query-helpers';
import { ClrAutocompleteItem } from '../autocomplete-result/clr-autocomplete.item';

export class StaticAutocompleteModel<T> extends ScAutocompleteModel<T> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { ScClrAutocompleteComponent } from './components/autocomplete/sc-clr-aut
import { ScClrAutocompletePopoverComponent } from './components/popover/sc-clr-autocomplete-popover.component';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';


@NgModule({
declarations: [
ScClrAutocompleteComponent,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
import { ComponentFactoryResolver, ComponentRef, ElementRef, Injectable, Injector, ViewContainerRef } from '@angular/core';
import { ComponentRef, ElementRef, Injectable, ViewContainerRef } from '@angular/core';
import { ScClrAutocompletePopoverComponent } from '../components/popover/sc-clr-autocomplete-popover.component';

@Injectable({
providedIn: 'root'
})
export class ScClrAutocompletePopoverService {

constructor(private _componentResolver: ComponentFactoryResolver, private _injector: Injector) {
}

open<T>(vcRef: ViewContainerRef, parentComponent: ElementRef): ComponentRef<ScClrAutocompletePopoverComponent<T>> {
vcRef.clear();

const factory = this._componentResolver.resolveComponentFactory(ScClrAutocompletePopoverComponent);
const component = vcRef.createComponent(factory);
const component = vcRef.createComponent(ScClrAutocompletePopoverComponent);
component.instance.parentComponent = parentComponent;

// @ts-ignore
Expand Down
2 changes: 1 addition & 1 deletion projects/sc-clr-autocomplete/tsconfig.lib.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "../../out-tsc/lib",
"target": "es2015",
"target": "ES2022",
"declaration": true,
"inlineSources": true,
"types": [],
Expand Down
6 changes: 5 additions & 1 deletion tsconfig.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,9 @@
"exclude": [
"projects/demo/src/test.ts",
"projects/demo/src/**/*.spec.ts"
]
],
"angularCompilerOptions": {
"enableIvy": true,
"compilationMode": "full"
}
}
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"module": "es2020",
"moduleResolution": "node",
"importHelpers": true,
"target": "es2015",
"target": "ES2022",
"typeRoots": [
"node_modules/@types"
],
Expand Down

0 comments on commit 8a1d2ac

Please sign in to comment.