Skip to content
This repository was archived by the owner on Nov 21, 2024. It is now read-only.

Commit bd0fdad

Browse files
committed
Merge branch 'release/0.1.0'
2 parents 1a24141 + eb1ad1c commit bd0fdad

31 files changed

+624
-800
lines changed

CHANGELOG.md

+14
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# [0.1.0](https://github.com/rucken/ionic/compare/0.0.4...0.1.0) (2019-01-27)
2+
3+
4+
### Bug Fixes
5+
6+
* Revert use form-group to without bindIO ([9697fc6](https://github.com/rucken/ionic/commit/9697fc6))
7+
8+
9+
### Features
10+
11+
* Add ngx-bind-io and update all sources ([4ac5ab6](https://github.com/rucken/ionic/commit/4ac5ab6))
12+
13+
14+
115
## [0.0.4](https://github.com/rucken/ionic/compare/0.0.3...0.0.4) (2019-01-12)
216

317

apps/demo/src/app/app.module.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { MetaLoader, MetaModule } from '@ngx-meta/core';
1111
import { TranslateModule, TranslateService } from '@ngx-translate/core';
1212
import { AccountModule, AuthModalModule, AuthModule, BrowserStorage, CONTENT_TYPES_CONFIG_TOKEN, defaultContentTypesConfig, defaultGroupsConfig, defaultPermissionsConfig, defaultUsersConfig, ErrorsExtractor, GROUPS_CONFIG_TOKEN, LangModule, LangService, PermissionsGuard, PERMISSIONS_CONFIG_TOKEN, PipesModule, STORAGE_CONFIG_TOKEN, TokenService, TransferHttpCacheModule, USERS_CONFIG_TOKEN } from '@rucken/core';
1313
import { GroupsListFiltersModalModule, GroupsListFiltersModalService, IonicAuthModalModule, IonicModalsModule, NavbarModule, UsersListFiltersModalModule, UsersListFiltersModalService } from '@rucken/ionic';
14+
import { NgxBindIOModule } from 'ngx-bind-io';
1415
import { CookieService } from 'ngx-cookie-service';
1516
import { NgxPermissionsModule } from 'ngx-permissions';
1617
import { NgxRepositoryModule } from 'ngx-repository';
@@ -62,7 +63,8 @@ import { initializeApp } from './utils/initialize-app';
6263
NavbarModule,
6364
IonicModalsModule,
6465
UsersListFiltersModalModule.forRoot(),
65-
GroupsListFiltersModalModule.forRoot()
66+
GroupsListFiltersModalModule.forRoot(),
67+
NgxBindIOModule.forRoot()
6668
],
6769
providers: [
6870
{

libs/rucken/ionic/package.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@rucken/ionic",
3-
"version": "0.0.4",
3+
"version": "0.1.0",
44
"engines": {
55
"node": ">=10",
66
"npm": ">=6.4.0"
@@ -35,14 +35,14 @@
3535
}
3636
],
3737
"peerDependencies": {
38-
"@angular/common": "~7.2.0",
39-
"@angular/core": "~7.2.0",
40-
"@ionic/angular": "4.0.0-rc.1",
41-
"@rucken/core": "^3.7.1"
38+
"@angular/common": "~7.2.2",
39+
"@angular/core": "~7.2.2",
40+
"@ionic/angular": "4.0.0",
41+
"@rucken/core": "^3.8.1"
4242
},
4343
"dependencies": {
4444
"@ngx-translate/core": "^11.0.1",
45-
"ngx-dynamic-form-builder": "^0.8.1",
45+
"ngx-dynamic-form-builder": "^0.9.0",
4646
"ngx-permissions": "^6.0.4",
4747
"ngx-repository": "^0.6.3",
4848
"bind-observable": "^1.0.2",

libs/rucken/ionic/src/lib/components/entity-list/entity-list.component.ts

+52-57
Original file line numberDiff line numberDiff line change
@@ -30,66 +30,61 @@ export class EntityListComponent<TModel extends IModel> {
3030
defaultEntityListHeaderTemplate: TemplateRef<any>;
3131

3232
@Input()
33-
gridFieldTemplate: TemplateRef<any>;
33+
gridFieldTemplate: TemplateRef<any> = undefined;
3434
@Input()
35-
gridCellTemplate: TemplateRef<any>;
35+
gridCellTemplate: TemplateRef<any> = undefined;
3636
@Input()
37-
gridFieldContent: TemplateRef<any>;
37+
gridFieldContent: TemplateRef<any> = undefined;
3838
@Input()
39-
gridFieldActionContent: TemplateRef<any>;
39+
gridFieldActionContent: TemplateRef<any> = undefined;
4040
@Input()
41-
gridCellContent: TemplateRef<any>;
41+
gridCellContent: TemplateRef<any> = undefined;
4242
@Input()
43-
gridCellTranslatedContent: TemplateRef<any>;
43+
gridCellTranslatedContent: TemplateRef<any> = undefined;
4444
@Input()
45-
gridCellActionContent: TemplateRef<any>;
45+
gridCellActionContent: TemplateRef<any> = undefined;
4646
@Input()
47-
searchFieldTemplate: TemplateRef<any>;
47+
searchFieldTemplate: TemplateRef<any> = undefined;
4848
@Input()
49-
entityListFooterTemplate: TemplateRef<any>;
49+
entityListFooterTemplate: TemplateRef<any> = undefined;
5050
@Input()
51-
entityListHeaderTemplate: TemplateRef<any>;
51+
entityListHeaderTemplate: TemplateRef<any> = undefined;
5252

5353
@Input()
54-
viewLink: string;
54+
viewLink: string = undefined;
5555
@Input()
56-
updateLink: string;
56+
updateLink: string = undefined;
5757
@Input()
58-
deleteLink: string;
58+
deleteLink: string = undefined;
5959

6060
@Input()
6161
showSearchField = false;
6262
@Input()
63-
selectFirst?: boolean;
63+
selectFirst?: boolean = undefined;
6464
@Input()
6565
set processing(value: boolean) {
66-
this._processing = undefined;
67-
if (value) {
68-
this._loadingController.create({
69-
message: this._translateService.instant('Loading...')
70-
}).then(loading => {
71-
this._processingModal = loading;
72-
loading.present().then(modal => {
73-
if (this._processing === undefined) {
74-
this._processing = value;
75-
} else {
76-
if (this._processingModal && this._processing === false) {
77-
this._processingModal.dismiss().then(() => {
78-
this._processing = false;
79-
this._processingModal = undefined;
80-
});
81-
}
82-
}
83-
});
84-
});
85-
} else {
86-
if (this._processingModal) {
87-
this._processingModal.dismiss().then(() => {
88-
this._processing = false;
89-
this._processingModal = undefined;
90-
});
66+
this._processing = value;
67+
if (this._processingModal !== null) {
68+
if (this._processingModal === undefined) {
69+
this._processingModal = null;
70+
if (value) {
71+
this._loadingController.create({
72+
message: this._translateService.instant('Loading...')
73+
}).then(element => {
74+
element.present().then(_ => {
75+
this._processingModal = element;
76+
if (this._processing === false) {
77+
this.processing = false;
78+
}
79+
});
80+
});
81+
}
9182
} else {
92-
this._processing = false;
83+
if (!value) {
84+
this._processingModal.dismiss().then(() => {
85+
this._processingModal = undefined;
86+
});
87+
}
9388
}
9489
}
9590
}
@@ -99,21 +94,21 @@ export class EntityListComponent<TModel extends IModel> {
9994
@Input()
10095
searchField: FormControl = new FormControl();
10196
@Input()
102-
title: string;
97+
title: string = undefined;
10398
@Input()
10499
createTitle = translate('Create');
105100
@Input()
106101
createClass = 'btn btn-primary';
107102
@Input()
108103
translatedCells: string[] = [];
109104
@Input()
110-
orderColumns: string[];
105+
orderColumns: string[] = undefined;
111106
@Input()
112-
columnsClasses: { [key: string]: string };
107+
columnsClasses: { [key: string]: string } = undefined;
113108
@Input()
114-
orderBy: string;
109+
orderBy: string = undefined;
115110
@Input()
116-
multiSelectColumns: string[];
111+
multiSelectColumns: string[] = undefined;
117112
@Input()
118113
set columns(columns: string[]) {
119114
this._columns = columns;
@@ -133,14 +128,11 @@ export class EntityListComponent<TModel extends IModel> {
133128
}
134129
}
135130
@Input()
136-
classes: string[];
131+
classes: string[] = undefined;
137132
@Input()
138-
strings: any;
133+
strings: any = undefined;
139134
@Input()
140135
set items(items: TModel[]) {
141-
if (this._refresher && this._refresher.target) {
142-
this._refresher.target.complete();
143-
}
144136
this._items = items;
145137
if (
146138
this.selectFirst !== false &&
@@ -150,6 +142,9 @@ export class EntityListComponent<TModel extends IModel> {
150142
) {
151143
this.onSelected([]);
152144
}
145+
if (this._refresher && this._refresher.target) {
146+
this._refresher.target.complete();
147+
}
153148
}
154149
get items() {
155150
return this._items;
@@ -182,7 +177,7 @@ export class EntityListComponent<TModel extends IModel> {
182177
nextPage: EventEmitter<boolean> = new EventEmitter<boolean>();
183178

184179
@Input()
185-
readonly: boolean;
180+
readonly: boolean = undefined;
186181
@Input()
187182
enableCreate = true;
188183
@Input()
@@ -192,7 +187,7 @@ export class EntityListComponent<TModel extends IModel> {
192187
@Input()
193188
enableAppendFromGrid = true;
194189
@Input()
195-
paginationMeta: PaginationMeta;
190+
paginationMeta: PaginationMeta = undefined;
196191

197192
get enableOnlyUpdateOrDelete() {
198193
return (this.isEnableDelete && !this.isEnableUpdate) || (!this.isEnableDelete && this.isEnableUpdate);
@@ -204,12 +199,12 @@ export class EntityListComponent<TModel extends IModel> {
204199
return this.appendFromGrid.observers.length > 0;
205200
}
206201

207-
private _refresher: any;
208-
private _processingModal: any;
202+
private _refresher: any = undefined;
203+
private _processingModal: any = undefined;
209204
private _processing = false;
210-
private _selected: TModel[];
211-
private _items: TModel[];
212-
private _columns: string[];
205+
private _selected: TModel[] = undefined;
206+
private _items: TModel[] = undefined;
207+
private _columns: string[] = undefined;
213208

214209
constructor(
215210
private _viewContainerRef: ViewContainerRef,

libs/rucken/ionic/src/lib/components/form-group/form-group.component.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ import { map } from 'rxjs/operators';
1010
})
1111
export class FormGroupComponent implements AfterViewInit {
1212
@Input()
13-
checkIsDirty?: boolean;
13+
checkIsDirty?: boolean = undefined;
1414
@Input()
15-
tooltipPlacement?: string;
15+
tooltipPlacement?: string = undefined;
1616

1717
get errors(): Observable<any> {
1818
if (this.form && (this.checkIsDirty !== true || this.form.dirty)) {
@@ -29,7 +29,7 @@ export class FormGroupComponent implements AfterViewInit {
2929
}
3030
}
3131
@Input()
32-
form: DynamicFormGroup<any>;
32+
form: DynamicFormGroup<any> = undefined;
3333
@Input()
3434
set name(name: string) {
3535
this._name = name;
@@ -38,7 +38,7 @@ export class FormGroupComponent implements AfterViewInit {
3838
return this._name;
3939
}
4040
@Input()
41-
title: string;
41+
title: string = undefined;
4242

4343
get valid() {
4444
return !this.form || this.form.get(this.name).valid;

libs/rucken/ionic/src/lib/components/navbar/navbar.component.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ import { BehaviorSubject } from 'rxjs';
99
})
1010
export class NavbarComponent {
1111
@Input()
12-
showSignIn: boolean;
12+
showSignIn: boolean = undefined;
1313
@Input()
14-
showSignOut: boolean;
14+
showSignOut: boolean = undefined;
1515
@Input()
16-
title: string;
16+
title: string = undefined;
1717
@Input()
1818
set routes(routes: any[]) {
1919
this.allowedRoutes$.next(

libs/rucken/ionic/src/lib/components/prompt-form-modal/prompt-form-modal.component.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export class PromptFormModalComponent extends BasePromptModalComponent {
1414
@Input()
1515
hideFooter = false;
1616
@Input()
17-
class: string;
17+
class: string = undefined;
1818
@Input()
1919
hideTopNo = false;
2020
@Input()
@@ -26,11 +26,11 @@ export class PromptFormModalComponent extends BasePromptModalComponent {
2626
@Input()
2727
iconTopInfo = 'information-circle-outline';
2828
@Input()
29-
footerButtonsTemplate: TemplateRef<any>;
29+
footerButtonsTemplate: TemplateRef<any> = undefined;
3030
@Input()
31-
readonlyFooterButtonsTemplate: TemplateRef<any>;
31+
readonlyFooterButtonsTemplate: TemplateRef<any> = undefined;
3232
@Input()
33-
headerTemplate: TemplateRef<any>;
33+
headerTemplate: TemplateRef<any> = undefined;
3434
constructor(
3535
protected modalController: ModalController,
3636
private _modalsService: ModalsService,

libs/rucken/ionic/src/lib/components/select-input/select-input.component.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export class SelectInputComponent implements ControlValueAccessor, OnDestroy, On
2929
titleField = 'title';
3030
@Input()
3131
@BindObservable()
32-
items: SelectInput[];
32+
items: SelectInput[] = undefined;
3333
items$!: Observable<SelectInput[]>;
3434
@BindObservable()
3535
selectedIds: (string | number)[];
@@ -49,8 +49,6 @@ export class SelectInputComponent implements ControlValueAccessor, OnDestroy, On
4949
this.selectedIds$.pipe(takeUntil(this._destroyed$)).subscribe(ids => {
5050
if (ids !== undefined && !Array.isArray(ids)) {
5151
ids = [ids];
52-
} else {
53-
ids = [];
5452
}
5553
const selectedItems = this.items.filter(item => ids.filter(id => item.id === id).length > 0);
5654
if (this.multiple) {

libs/rucken/ionic/src/lib/entities/groups/group-modal/group-modal.component.html

+2-16
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,8 @@
22
[formGroup]="form"
33
novalidate>
44
<prompt-form-modal
5-
[class]="class"
6-
[title]="title"
7-
[message]="message"
8-
[infoMessage]="infoMessage"
9-
[errorMessage]="errorMessage"
10-
[noTitle]="noTitle"
11-
[yesTitle]="yesTitle"
12-
[readonly]="readonly"
13-
(no)="onNoClick()"
14-
(yes)="onYesClick()"
15-
[data]="data"
16-
[processing]="processing$ | async"
17-
[disabled]="disabled"
18-
[iconTopYes]="data.id?'checkmark':'add'"
19-
[hideYes]="hideYes"
20-
[hideNo]="hideNo">
5+
bindIO
6+
[iconTopYes]="data.id?'checkmark':'add'">
217
<form-group
228
[checkIsDirty]="checkIsDirty"
239
[form]="form"

libs/rucken/ionic/src/lib/entities/groups/group-modal/group-modal.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { PermissionsService } from '../../../services/permissions.service';
1111
})
1212
export class GroupModalComponent extends BasePromptFormModalComponent<Group> {
1313
@Input()
14-
class: string;
14+
class: string = undefined;
1515
permissions$: Observable<Permission[]>;
1616

1717
constructor(

libs/rucken/ionic/src/lib/entities/groups/group-modal/group-modal.module.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { ReactiveFormsModule } from '@angular/forms';
44
import { IonicModule } from '@ionic/angular';
55
import { TranslateModule } from '@ngx-translate/core';
66
import { DirectivesModule, PipesModule } from '@rucken/core';
7+
import { NgxBindIOModule } from 'ngx-bind-io';
78
import { FormGroupModule } from '../../../components/form-group/form-group.module';
89
import { PromptFormModalModule } from '../../../components/prompt-form-modal/prompt-form-modal.module';
910
import { SelectInputModule } from '../../../components/select-input/select-input.module';
@@ -19,7 +20,8 @@ import { GroupModalComponent } from './group-modal.component';
1920
DirectivesModule,
2021
PipesModule,
2122
PromptFormModalModule,
22-
SelectInputModule
23+
SelectInputModule,
24+
NgxBindIOModule
2325
],
2426
declarations: [GroupModalComponent],
2527
entryComponents: [GroupModalComponent],

0 commit comments

Comments
 (0)