@rolatech/angular-authorization 20.0.0-beta.4 → 20.0.0-beta.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. package/fesm2022/rolatech-angular-authorization-clients.routes-CJToHkIB.mjs +441 -0
  2. package/fesm2022/rolatech-angular-authorization-clients.routes-CJToHkIB.mjs.map +1 -0
  3. package/fesm2022/{rolatech-angular-authorization-endpoints.routes-CUD16YeI.mjs → rolatech-angular-authorization-endpoints.routes-D7YPpm6z.mjs} +5 -5
  4. package/fesm2022/rolatech-angular-authorization-endpoints.routes-D7YPpm6z.mjs.map +1 -0
  5. package/fesm2022/rolatech-angular-authorization-permissions.routes-CyF9Ga7g.mjs +316 -0
  6. package/fesm2022/rolatech-angular-authorization-permissions.routes-CyF9Ga7g.mjs.map +1 -0
  7. package/fesm2022/rolatech-angular-authorization-roles.routes-buWtnLgA.mjs +352 -0
  8. package/fesm2022/rolatech-angular-authorization-roles.routes-buWtnLgA.mjs.map +1 -0
  9. package/fesm2022/{rolatech-angular-authorization-settings.routes-CQcuOGIn.mjs → rolatech-angular-authorization-settings.routes-D_p2Zhn9.mjs} +3 -3
  10. package/fesm2022/rolatech-angular-authorization-settings.routes-D_p2Zhn9.mjs.map +1 -0
  11. package/fesm2022/rolatech-angular-authorization-users.routes-C7RBzy-N.mjs +305 -0
  12. package/fesm2022/rolatech-angular-authorization-users.routes-C7RBzy-N.mjs.map +1 -0
  13. package/fesm2022/rolatech-angular-authorization.mjs +8 -8
  14. package/fesm2022/rolatech-angular-authorization.mjs.map +1 -1
  15. package/package.json +1 -1
  16. package/fesm2022/rolatech-angular-authorization-clients.routes-CQFpI9Vf.mjs +0 -441
  17. package/fesm2022/rolatech-angular-authorization-clients.routes-CQFpI9Vf.mjs.map +0 -1
  18. package/fesm2022/rolatech-angular-authorization-endpoints.routes-CUD16YeI.mjs.map +0 -1
  19. package/fesm2022/rolatech-angular-authorization-permissions.routes-DqstP5Uo.mjs +0 -316
  20. package/fesm2022/rolatech-angular-authorization-permissions.routes-DqstP5Uo.mjs.map +0 -1
  21. package/fesm2022/rolatech-angular-authorization-roles.routes-D5eERcED.mjs +0 -352
  22. package/fesm2022/rolatech-angular-authorization-roles.routes-D5eERcED.mjs.map +0 -1
  23. package/fesm2022/rolatech-angular-authorization-settings.routes-CQcuOGIn.mjs.map +0 -1
  24. package/fesm2022/rolatech-angular-authorization-users.routes-hiRqB2Tq.mjs +0 -312
  25. package/fesm2022/rolatech-angular-authorization-users.routes-hiRqB2Tq.mjs.map +0 -1
@@ -0,0 +1,441 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable, model, output, Component, inject, viewChild } from '@angular/core';
3
+ import * as i1 from '@angular/forms';
4
+ import { FormBuilder, Validators } from '@angular/forms';
5
+ import { MatSnackBar } from '@angular/material/snack-bar';
6
+ import { BaseService } from '@rolatech/angular-services';
7
+ import { AngularCommonModule } from '@rolatech/angular-common';
8
+ import { BaseComponent, AngularComponentsModule, TitleComponent, ToolbarComponent, ConfirmationComponent, SpinnerComponent } from '@rolatech/angular-components';
9
+ import * as i4 from '@angular/cdk/clipboard';
10
+ import { ClipboardModule } from '@angular/cdk/clipboard';
11
+ import * as i2 from '@angular/material/button';
12
+ import { MatButtonModule } from '@angular/material/button';
13
+ import * as i4$2 from '@angular/material/icon';
14
+ import { MatIcon } from '@angular/material/icon';
15
+ import * as i3 from '@angular/material/form-field';
16
+ import { MatFormFieldModule } from '@angular/material/form-field';
17
+ import * as i6 from '@angular/material/input';
18
+ import { MatInputModule } from '@angular/material/input';
19
+ import * as i2$1 from '@angular/material/autocomplete';
20
+ import * as i4$1 from '@angular/material/select';
21
+ import * as i1$1 from '@angular/common';
22
+ import * as i3$1 from '@angular/material/divider';
23
+ import * as i5 from '@angular/material/list';
24
+ import * as i7 from '@angular/material/paginator';
25
+ import { MatPaginator } from '@angular/material/paginator';
26
+ import * as i8 from '@angular/material/table';
27
+ import { MatTableDataSource } from '@angular/material/table';
28
+ import * as i1$2 from '@angular/router';
29
+ import * as i6$1 from '@angular/material/menu';
30
+
31
+ class ClientService extends BaseService {
32
+ init() {
33
+ this.endpoint = 'auth/clients';
34
+ super.init();
35
+ }
36
+ resetClientSecret(id) {
37
+ return this.http.post(`${this.actionUrl}/${id}/reset`, {}, {
38
+ withCredentials: true,
39
+ });
40
+ }
41
+ bindWeChatClient(id, data) {
42
+ return this.http.post(`${this.actionUrl}/${id}/wechat`, data, {
43
+ withCredentials: true,
44
+ });
45
+ }
46
+ unBindWeChatClient(id) {
47
+ return this.http.delete(`${this.actionUrl}/${id}/wechat`, {
48
+ withCredentials: true,
49
+ });
50
+ }
51
+ updateWeChatClient(id, data) {
52
+ return this.http.put(`${this.actionUrl}/${id}/wechat`, data, {
53
+ withCredentials: true,
54
+ });
55
+ }
56
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: ClientService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
57
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: ClientService, providedIn: 'root' });
58
+ }
59
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: ClientService, decorators: [{
60
+ type: Injectable,
61
+ args: [{
62
+ providedIn: 'root',
63
+ }]
64
+ }] });
65
+
66
+ class ClientSecretCopyComponent {
67
+ clientSecret = model.required();
68
+ output = output();
69
+ ngDoCheck() {
70
+ this.output.emit(this.clientSecret());
71
+ }
72
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: ClientSecretCopyComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
73
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.0.3", type: ClientSecretCopyComponent, isStandalone: true, selector: "rolatech-authorization-client-secret-copy", inputs: { clientSecret: { classPropertyName: "clientSecret", publicName: "clientSecret", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { clientSecret: "clientSecretChange", output: "output" }, ngImport: i0, template: "<div class=\"flex items-center gap-3\">\n <mat-form-field appearance=\"fill\" subscriptSizing=\"dynamic\">\n <input matInput type=\"password\" [value]=\"clientSecret()\" readonly />\n </mat-form-field>\n <button mat-icon-button [cdkCopyToClipboard]=\"clientSecret()\">\n <mat-icon>content_copy</mat-icon>\n </button>\n</div>\n", styles: ["mat-form-field{width:100%}\n"], dependencies: [{ kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i6.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: ClipboardModule }, { kind: "directive", type: i4.CdkCopyToClipboard, selector: "[cdkCopyToClipboard]", inputs: ["cdkCopyToClipboard", "cdkCopyToClipboardAttempts"], outputs: ["cdkCopyToClipboardCopied"] }] });
74
+ }
75
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: ClientSecretCopyComponent, decorators: [{
76
+ type: Component,
77
+ args: [{ selector: 'rolatech-authorization-client-secret-copy', imports: [MatFormFieldModule, MatInputModule, MatButtonModule, MatIcon, ClipboardModule], template: "<div class=\"flex items-center gap-3\">\n <mat-form-field appearance=\"fill\" subscriptSizing=\"dynamic\">\n <input matInput type=\"password\" [value]=\"clientSecret()\" readonly />\n </mat-form-field>\n <button mat-icon-button [cdkCopyToClipboard]=\"clientSecret()\">\n <mat-icon>content_copy</mat-icon>\n </button>\n</div>\n", styles: ["mat-form-field{width:100%}\n"] }]
78
+ }] });
79
+
80
+ class CreateComponent extends BaseComponent {
81
+ formBuilder = inject(FormBuilder);
82
+ snackBar = inject(MatSnackBar);
83
+ clientService = inject(ClientService);
84
+ fileName = '';
85
+ uploadProgress = 0;
86
+ file;
87
+ url = '';
88
+ clientCreateForm;
89
+ ngOnInit() {
90
+ this.clientCreateForm = this.formBuilder.group({
91
+ name: [null, Validators.required],
92
+ });
93
+ }
94
+ submit() {
95
+ if (!this.clientCreateForm.valid) {
96
+ return;
97
+ }
98
+ this.clientService.create(this.clientCreateForm.value).subscribe({
99
+ next: (res) => {
100
+ this.copyClientSecret(res.data.id, res.data.clientSecret);
101
+ },
102
+ error: (error) => {
103
+ this.snackBar.open(error.message);
104
+ },
105
+ });
106
+ }
107
+ copyClientSecret(id, clientSecret) {
108
+ const options = {
109
+ title: 'Copy client secret',
110
+ confirmText: 'Confirm',
111
+ component: ClientSecretCopyComponent,
112
+ data: {
113
+ clientSecret: clientSecret,
114
+ },
115
+ };
116
+ this.dialogService.open(options);
117
+ this.dialogService.confirmed().subscribe({
118
+ next: (result) => {
119
+ this.router.navigate([`../${id}`], {
120
+ relativeTo: this.route,
121
+ });
122
+ },
123
+ });
124
+ }
125
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: CreateComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
126
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.3", type: CreateComponent, isStandalone: true, selector: "rolatech-authorization-create", usesInheritance: true, ngImport: i0, template: "<rolatech-toolbar title=\"Create\"></rolatech-toolbar>\n<div class=\"px-4\">\n <form [formGroup]=\"clientCreateForm\" (submit)=\"submit()\">\n <div class=\"flex flex-col lg:w-1/2\">\n <!-- name -->\n <rolatech-title title=\"Info\"></rolatech-title>\n <mat-form-field appearance=\"fill\">\n <mat-label> Name </mat-label>\n <input matInput formControlName=\"name\" required />\n </mat-form-field>\n </div>\n <button mat-raised-button type=\"submit\">Save</button>\n </form>\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: AngularCommonModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: AngularComponentsModule }, { kind: "component", type: i2.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i6.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: TitleComponent, selector: "rolatech-title", inputs: ["title", "subtitle", "large"] }, { kind: "component", type: ToolbarComponent, selector: "rolatech-toolbar", inputs: ["title", "subtitle", "back", "link", "large", "divider"] }] });
127
+ }
128
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: CreateComponent, decorators: [{
129
+ type: Component,
130
+ args: [{ imports: [AngularCommonModule, AngularComponentsModule, TitleComponent, ToolbarComponent], selector: 'rolatech-authorization-create', template: "<rolatech-toolbar title=\"Create\"></rolatech-toolbar>\n<div class=\"px-4\">\n <form [formGroup]=\"clientCreateForm\" (submit)=\"submit()\">\n <div class=\"flex flex-col lg:w-1/2\">\n <!-- name -->\n <rolatech-title title=\"Info\"></rolatech-title>\n <mat-form-field appearance=\"fill\">\n <mat-label> Name </mat-label>\n <input matInput formControlName=\"name\" required />\n </mat-form-field>\n </div>\n <button mat-raised-button type=\"submit\">Save</button>\n </form>\n</div>\n" }]
131
+ }] });
132
+
133
+ class ClientBindDialogComponent {
134
+ formBuilder = inject(FormBuilder);
135
+ apps = model();
136
+ app = model();
137
+ selectedApp = model();
138
+ output = output();
139
+ wechatClientBindForm;
140
+ ngOnInit() {
141
+ this.wechatClientBindForm = this.formBuilder.group({
142
+ name: [null, Validators.required],
143
+ appId: [null, Validators.required],
144
+ appSecret: [null, Validators.required],
145
+ });
146
+ if (this.app()) {
147
+ const { name, appId, appSecret } = this.app();
148
+ this.wechatClientBindForm.setValue({
149
+ name,
150
+ appId,
151
+ appSecret,
152
+ });
153
+ }
154
+ }
155
+ onSelectionChange(event) {
156
+ this.selectedApp.set(event.value);
157
+ }
158
+ compareFn(o1, o2) {
159
+ return o1.name === o2.name;
160
+ }
161
+ ngDoCheck() {
162
+ this.output.emit(this.wechatClientBindForm.value);
163
+ }
164
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: ClientBindDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
165
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.3", type: ClientBindDialogComponent, isStandalone: true, selector: "rolatech-authorization-client-bind-dialog", inputs: { apps: { classPropertyName: "apps", publicName: "apps", isSignal: true, isRequired: false, transformFunction: null }, app: { classPropertyName: "app", publicName: "app", isSignal: true, isRequired: false, transformFunction: null }, selectedApp: { classPropertyName: "selectedApp", publicName: "selectedApp", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { apps: "appsChange", app: "appChange", selectedApp: "selectedAppChange", output: "output" }, ngImport: i0, template: "<div>\n <mat-form-field appearance=\"fill\">\n <mat-label>App Type</mat-label>\n <mat-select [compareWith]=\"compareFn\" (selectionChange)=\"onSelectionChange($event)\" [(ngModel)]=\"selectedApp\">\n @for (item of apps(); track item) {\n <mat-option [value]=\"item\">\n {{ item.name }}\n </mat-option>\n }\n </mat-select>\n </mat-form-field>\n <form [formGroup]=\"wechatClientBindForm\">\n <mat-form-field appearance=\"fill\">\n <mat-label> Name </mat-label>\n <input matInput formControlName=\"name\" required />\n </mat-form-field>\n <mat-form-field appearance=\"fill\">\n <mat-label> AppId </mat-label>\n <input matInput formControlName=\"appId\" required />\n </mat-form-field>\n <mat-form-field appearance=\"fill\">\n <mat-label> AppSecret </mat-label>\n <input matInput formControlName=\"appSecret\" required />\n </mat-form-field>\n </form>\n</div>\n", styles: ["mat-form-field{width:100%}\n"], dependencies: [{ kind: "ngmodule", type: AngularCommonModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: AngularComponentsModule }, { kind: "component", type: i2$1.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i6.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: i4$1.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }] });
166
+ }
167
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: ClientBindDialogComponent, decorators: [{
168
+ type: Component,
169
+ args: [{ selector: 'rolatech-authorization-client-bind-dialog', imports: [AngularCommonModule, AngularComponentsModule], template: "<div>\n <mat-form-field appearance=\"fill\">\n <mat-label>App Type</mat-label>\n <mat-select [compareWith]=\"compareFn\" (selectionChange)=\"onSelectionChange($event)\" [(ngModel)]=\"selectedApp\">\n @for (item of apps(); track item) {\n <mat-option [value]=\"item\">\n {{ item.name }}\n </mat-option>\n }\n </mat-select>\n </mat-form-field>\n <form [formGroup]=\"wechatClientBindForm\">\n <mat-form-field appearance=\"fill\">\n <mat-label> Name </mat-label>\n <input matInput formControlName=\"name\" required />\n </mat-form-field>\n <mat-form-field appearance=\"fill\">\n <mat-label> AppId </mat-label>\n <input matInput formControlName=\"appId\" required />\n </mat-form-field>\n <mat-form-field appearance=\"fill\">\n <mat-label> AppSecret </mat-label>\n <input matInput formControlName=\"appSecret\" required />\n </mat-form-field>\n </form>\n</div>\n", styles: ["mat-form-field{width:100%}\n"] }]
170
+ }] });
171
+
172
+ class DetailsComponent extends BaseComponent {
173
+ clientServide = inject(ClientService);
174
+ snackBar = inject(MatSnackBar);
175
+ permissions = [];
176
+ allComplete = false;
177
+ isLoading = false;
178
+ formattedPermissions = [];
179
+ client;
180
+ // results: any;
181
+ ngOnInit() {
182
+ this.get();
183
+ }
184
+ get() {
185
+ this.isLoading = true;
186
+ this.clientServide.get(this.id).subscribe({
187
+ next: (res) => {
188
+ this.client = res.data;
189
+ this.isLoading = false;
190
+ },
191
+ error: (error) => {
192
+ this.isLoading = false;
193
+ this.snackBar.open(error.message);
194
+ },
195
+ });
196
+ }
197
+ editClient() { }
198
+ deleteClient() {
199
+ const options = {
200
+ title: 'Delete client',
201
+ component: ConfirmationComponent,
202
+ data: {
203
+ message: 'Delete confirm?',
204
+ },
205
+ };
206
+ this.dialogService.open(options);
207
+ this.dialogService.confirmed().subscribe({
208
+ next: (result) => {
209
+ if (result) {
210
+ this.clientServide.delete(this.id).subscribe({
211
+ next: (res) => {
212
+ this.snackBarService.open('Deleted');
213
+ this.router.navigate([`../`], {
214
+ relativeTo: this.route,
215
+ });
216
+ },
217
+ error: (error) => {
218
+ this.snackBarService.open(error.message);
219
+ },
220
+ });
221
+ }
222
+ },
223
+ });
224
+ }
225
+ resetClientSecret() {
226
+ this.clientServide.resetClientSecret(this.id).subscribe({
227
+ next: (res) => {
228
+ this.copyClientSecret(res.data.clientSecret);
229
+ },
230
+ error: (error) => {
231
+ this.snackBar.open(error.message);
232
+ },
233
+ });
234
+ }
235
+ bindWeChatclient() {
236
+ const options = {
237
+ title: '绑定应用',
238
+ cancelText: 'Cancel',
239
+ confirmText: 'Confirm',
240
+ component: ClientBindDialogComponent,
241
+ data: {
242
+ selectedApp: { name: '微信' },
243
+ apps: [{ name: '微信' }, { name: '支付宝' }],
244
+ },
245
+ };
246
+ this.dialogService.open(options);
247
+ this.dialogService.confirmed().subscribe({
248
+ next: (result) => {
249
+ if (result) {
250
+ this.clientServide.bindWeChatClient(this.id, result).subscribe({
251
+ next: (res) => {
252
+ this.client.weChatClient = res.data;
253
+ this.snackBarService.open('绑定成功');
254
+ },
255
+ error: (error) => {
256
+ this.snackBarService.open(error.message);
257
+ },
258
+ });
259
+ }
260
+ },
261
+ });
262
+ }
263
+ unBindWeChatclient() {
264
+ const options = {
265
+ title: '解绑应用',
266
+ message: '解除绑定前, 请确认是否正在使用此应用',
267
+ cancelText: 'Cancel',
268
+ confirmText: 'Confirm',
269
+ };
270
+ this.dialogService.open(options);
271
+ this.dialogService.confirmed().subscribe({
272
+ next: (result) => {
273
+ if (result) {
274
+ this.clientServide.unBindWeChatClient(this.id).subscribe({
275
+ next: (res) => {
276
+ this.snackBarService.open(res.data);
277
+ },
278
+ error: (error) => {
279
+ this.snackBarService.open(error.message);
280
+ },
281
+ });
282
+ }
283
+ },
284
+ });
285
+ }
286
+ updateWeChatclient() {
287
+ const options = {
288
+ title: '修改应用',
289
+ cancelText: 'Cancel',
290
+ confirmText: 'Confirm',
291
+ component: ClientBindDialogComponent,
292
+ data: {
293
+ selectedApp: { name: '微信' },
294
+ app: this.client.weChatClient,
295
+ apps: [{ name: '微信' }, { name: '支付宝' }],
296
+ },
297
+ };
298
+ this.dialogService.open(options);
299
+ this.dialogService.confirmed().subscribe({
300
+ next: (result) => {
301
+ if (result) {
302
+ this.clientServide.updateWeChatClient(this.client.weChatClient.id, result).subscribe({
303
+ next: (res) => {
304
+ this.client.weChatClient = res.data;
305
+ this.snackBarService.open('Update successfully');
306
+ },
307
+ error: (error) => {
308
+ this.snackBarService.open(error.message);
309
+ },
310
+ });
311
+ }
312
+ },
313
+ });
314
+ }
315
+ copyClientSecret(clientSecret) {
316
+ const options = {
317
+ title: 'Copy client secret',
318
+ confirmText: 'Confirm',
319
+ component: ClientSecretCopyComponent,
320
+ data: {
321
+ clientSecret: clientSecret,
322
+ },
323
+ };
324
+ this.dialogService.open(options);
325
+ this.dialogService.confirmed().subscribe({
326
+ next: (result) => { },
327
+ });
328
+ }
329
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: DetailsComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
330
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.3", type: DetailsComponent, isStandalone: true, selector: "rolatech-authorization-details", usesInheritance: true, ngImport: i0, template: "<rolatech-toolbar title=\"Client details\"></rolatech-toolbar>\n<div class=\"max-w-[820px] p-3\">\n @if (client) {\n <!-- contact -->\n <div class=\"border border-[--rt-border-color] rounded px-3 pt-3\">\n <div class=\"p-3 flex justify-between items-center\">\n <span class=\"text-xl\">Info</span>\n <div class=\"flex gap-3\">\n <button mat-flat-button class=\"max-h-8\" (click)=\"editClient()\">\n <mat-icon>edit</mat-icon>\n <span i18n>Update</span>\n </button>\n <button mat-flat-button class=\"max-h-8\" (click)=\"deleteClient()\" i18n>Delete</button>\n </div>\n </div>\n <mat-nav-list>\n <mat-list-item>\n <div class=\"flex items-center justify-between\">\n <div class=\"flex flex-1 items-center\">\n <span class=\"w-24 text-sm\" Update>#ID</span>\n <span i18n>{{ client.id || 'Unset' }}</span>\n </div>\n </div>\n </mat-list-item>\n <mat-divider class=\"mx-3\"></mat-divider>\n <mat-list-item>\n <div class=\"flex items-center justify-between\">\n <div class=\"flex flex-1 items-center\">\n <span class=\"w-24 text-sm\">Name</span>\n <span i18n>{{ client.clientName || 'Unset' }}</span>\n </div>\n </div>\n </mat-list-item>\n <mat-divider class=\"mx-3\"></mat-divider>\n <mat-list-item>\n <div class=\"flex items-center justify-between\">\n <div class=\"flex flex-1 items-center\">\n <span class=\"w-24 text-sm\">ClientId</span>\n <span i18n>{{ client.clientId || 'Unset' }}</span>\n </div>\n </div>\n </mat-list-item>\n <mat-divider class=\"mx-3\"></mat-divider>\n <mat-list-item>\n <div class=\"flex items-center justify-between\">\n <div class=\"flex flex-1 items-center\">\n <span class=\"w-24 text-sm\">Client Secret</span>\n <span i18n>Set</span>\n </div>\n <button mat-button (click)=\"resetClientSecret()\">Reset</button>\n </div>\n </mat-list-item>\n <mat-divider class=\"mx-3\"></mat-divider>\n <mat-list-item>\n <div class=\"flex items-center justify-between\">\n <div class=\"flex flex-1 items-center\">\n <span class=\"w-24 text-sm\">Issued At</span>\n <span>{{ client.clientIdIssuedAt | date }}</span>\n </div>\n </div>\n </mat-list-item>\n </mat-nav-list>\n </div>\n <!-- wechat client -->\n <div class=\"border border-[--rt-border-color] rounded p-3 mt-3\">\n <div class=\"p-3 flex justify-between items-center\">\n <span class=\"text-xl\">WeChat Client</span>\n @if (client.weChatClient) {\n <div class=\"flex gap-3\">\n <button mat-flat-button class=\"max-h-8\" (click)=\"updateWeChatclient()\">\n <mat-icon>edit</mat-icon>\n Update\n </button>\n <button mat-flat-button class=\"max-h-8\" (click)=\"unBindWeChatclient()\">Delete</button>\n </div>\n } @else {\n <button mat-flat-button class=\"max-h-8\" (click)=\"bindWeChatclient()\">Bind</button>\n }\n </div>\n @if (client.weChatClient) {\n <mat-nav-list>\n <mat-list-item>\n <div class=\"flex items-center justify-between\">\n <div class=\"flex flex-1 items-center\">\n <span class=\"w-24 text-sm\" i18n>#ID</span>\n <span i18n>{{ client.id || 'Unset' }}</span>\n </div>\n </div>\n </mat-list-item>\n <mat-divider class=\"mx-3\"></mat-divider>\n <mat-list-item>\n <div class=\"flex items-center justify-between\">\n <div class=\"flex flex-1 items-center\">\n <span class=\"w-24 text-sm\" i18n>Name</span>\n <span i18n>{{ client.weChatClient.name || 'Unset' }}</span>\n </div>\n </div>\n </mat-list-item>\n <mat-divider class=\"mx-3\"></mat-divider>\n <mat-list-item>\n <div class=\"flex items-center justify-between\">\n <div class=\"flex flex-1 items-center\">\n <span class=\"w-24 text-sm\" i18n>App Id</span>\n <span i18n>{{ client.weChatClient.appId || 'Unset' }}</span>\n </div>\n </div>\n </mat-list-item>\n <mat-divider class=\"mx-3\"></mat-divider>\n\n <mat-list-item>\n <div class=\"flex items-center justify-between\">\n <div class=\"flex flex-1 items-center\">\n <span class=\"w-24 text-sm\" i18n>App Secret</span>\n <span>{{ client.weChatClient.appSecret || 'Unset' }}</span>\n </div>\n </div>\n </mat-list-item>\n </mat-nav-list>\n } @else {\n <div class=\"p-3\">\n <span class=\"py-11 opacity-70\" i18n>Not bound to WeChat</span>\n </div>\n }\n </div>\n }\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: AngularCommonModule }, { kind: "pipe", type: i1$1.DatePipe, name: "date" }, { kind: "ngmodule", type: AngularComponentsModule }, { kind: "component", type: i2.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i3$1.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { kind: "component", type: i4$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i5.MatNavList, selector: "mat-nav-list", exportAs: ["matNavList"] }, { kind: "component", type: i5.MatListItem, selector: "mat-list-item, a[mat-list-item], button[mat-list-item]", inputs: ["activated"], exportAs: ["matListItem"] }, { kind: "component", type: ToolbarComponent, selector: "rolatech-toolbar", inputs: ["title", "subtitle", "back", "link", "large", "divider"] }] });
331
+ }
332
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: DetailsComponent, decorators: [{
333
+ type: Component,
334
+ args: [{ imports: [AngularCommonModule, AngularComponentsModule, ToolbarComponent], selector: 'rolatech-authorization-details', template: "<rolatech-toolbar title=\"Client details\"></rolatech-toolbar>\n<div class=\"max-w-[820px] p-3\">\n @if (client) {\n <!-- contact -->\n <div class=\"border border-[--rt-border-color] rounded px-3 pt-3\">\n <div class=\"p-3 flex justify-between items-center\">\n <span class=\"text-xl\">Info</span>\n <div class=\"flex gap-3\">\n <button mat-flat-button class=\"max-h-8\" (click)=\"editClient()\">\n <mat-icon>edit</mat-icon>\n <span i18n>Update</span>\n </button>\n <button mat-flat-button class=\"max-h-8\" (click)=\"deleteClient()\" i18n>Delete</button>\n </div>\n </div>\n <mat-nav-list>\n <mat-list-item>\n <div class=\"flex items-center justify-between\">\n <div class=\"flex flex-1 items-center\">\n <span class=\"w-24 text-sm\" Update>#ID</span>\n <span i18n>{{ client.id || 'Unset' }}</span>\n </div>\n </div>\n </mat-list-item>\n <mat-divider class=\"mx-3\"></mat-divider>\n <mat-list-item>\n <div class=\"flex items-center justify-between\">\n <div class=\"flex flex-1 items-center\">\n <span class=\"w-24 text-sm\">Name</span>\n <span i18n>{{ client.clientName || 'Unset' }}</span>\n </div>\n </div>\n </mat-list-item>\n <mat-divider class=\"mx-3\"></mat-divider>\n <mat-list-item>\n <div class=\"flex items-center justify-between\">\n <div class=\"flex flex-1 items-center\">\n <span class=\"w-24 text-sm\">ClientId</span>\n <span i18n>{{ client.clientId || 'Unset' }}</span>\n </div>\n </div>\n </mat-list-item>\n <mat-divider class=\"mx-3\"></mat-divider>\n <mat-list-item>\n <div class=\"flex items-center justify-between\">\n <div class=\"flex flex-1 items-center\">\n <span class=\"w-24 text-sm\">Client Secret</span>\n <span i18n>Set</span>\n </div>\n <button mat-button (click)=\"resetClientSecret()\">Reset</button>\n </div>\n </mat-list-item>\n <mat-divider class=\"mx-3\"></mat-divider>\n <mat-list-item>\n <div class=\"flex items-center justify-between\">\n <div class=\"flex flex-1 items-center\">\n <span class=\"w-24 text-sm\">Issued At</span>\n <span>{{ client.clientIdIssuedAt | date }}</span>\n </div>\n </div>\n </mat-list-item>\n </mat-nav-list>\n </div>\n <!-- wechat client -->\n <div class=\"border border-[--rt-border-color] rounded p-3 mt-3\">\n <div class=\"p-3 flex justify-between items-center\">\n <span class=\"text-xl\">WeChat Client</span>\n @if (client.weChatClient) {\n <div class=\"flex gap-3\">\n <button mat-flat-button class=\"max-h-8\" (click)=\"updateWeChatclient()\">\n <mat-icon>edit</mat-icon>\n Update\n </button>\n <button mat-flat-button class=\"max-h-8\" (click)=\"unBindWeChatclient()\">Delete</button>\n </div>\n } @else {\n <button mat-flat-button class=\"max-h-8\" (click)=\"bindWeChatclient()\">Bind</button>\n }\n </div>\n @if (client.weChatClient) {\n <mat-nav-list>\n <mat-list-item>\n <div class=\"flex items-center justify-between\">\n <div class=\"flex flex-1 items-center\">\n <span class=\"w-24 text-sm\" i18n>#ID</span>\n <span i18n>{{ client.id || 'Unset' }}</span>\n </div>\n </div>\n </mat-list-item>\n <mat-divider class=\"mx-3\"></mat-divider>\n <mat-list-item>\n <div class=\"flex items-center justify-between\">\n <div class=\"flex flex-1 items-center\">\n <span class=\"w-24 text-sm\" i18n>Name</span>\n <span i18n>{{ client.weChatClient.name || 'Unset' }}</span>\n </div>\n </div>\n </mat-list-item>\n <mat-divider class=\"mx-3\"></mat-divider>\n <mat-list-item>\n <div class=\"flex items-center justify-between\">\n <div class=\"flex flex-1 items-center\">\n <span class=\"w-24 text-sm\" i18n>App Id</span>\n <span i18n>{{ client.weChatClient.appId || 'Unset' }}</span>\n </div>\n </div>\n </mat-list-item>\n <mat-divider class=\"mx-3\"></mat-divider>\n\n <mat-list-item>\n <div class=\"flex items-center justify-between\">\n <div class=\"flex flex-1 items-center\">\n <span class=\"w-24 text-sm\" i18n>App Secret</span>\n <span>{{ client.weChatClient.appSecret || 'Unset' }}</span>\n </div>\n </div>\n </mat-list-item>\n </mat-nav-list>\n } @else {\n <div class=\"p-3\">\n <span class=\"py-11 opacity-70\" i18n>Not bound to WeChat</span>\n </div>\n }\n </div>\n }\n</div>\n" }]
335
+ }] });
336
+
337
+ class IndexComponent {
338
+ clientService = inject(ClientService);
339
+ snackBar = inject(MatSnackBar);
340
+ pageEvent;
341
+ isLoading = false;
342
+ isSearch = false;
343
+ length = 100;
344
+ pageSize = 15;
345
+ pageSizeOptions = [5, 10, 25, 100];
346
+ clients = [];
347
+ displayedColumns = ['clientName', 'clientId', 'clientIdIssuedAt', 'actions'];
348
+ paginator = viewChild(MatPaginator);
349
+ orderOptions = [
350
+ {
351
+ key: 'clientIdIssuedAt',
352
+ value: 'Issued At',
353
+ icon: 'arrow_upward',
354
+ sort: 'asc',
355
+ },
356
+ {
357
+ key: 'clientIdIssuedAt',
358
+ value: 'Issued At',
359
+ icon: 'arrow_downward',
360
+ sort: 'desc',
361
+ },
362
+ ];
363
+ orderString = 'clientIdIssuedAt desc';
364
+ dataSource = new MatTableDataSource();
365
+ searchWord;
366
+ ngOnInit() {
367
+ this.findAll(null);
368
+ }
369
+ onClick(item) {
370
+ this.orderString = item.key + ' ' + item.sort;
371
+ this.paginator()?.firstPage();
372
+ this.findAll(null);
373
+ }
374
+ findAll(event) {
375
+ this.isLoading = true;
376
+ this.isSearch = false;
377
+ const page = event ? event.pageIndex + 1 : 1;
378
+ const limit = event ? event.pageSize : 15;
379
+ const sort = this.orderString;
380
+ const options = {
381
+ page,
382
+ limit,
383
+ sort,
384
+ };
385
+ this.clientService.find(options).subscribe({
386
+ next: (res) => {
387
+ this.clients = res.data;
388
+ this.dataSource.data = this.clients;
389
+ this.length = res.meta.pagination.count;
390
+ this.isLoading = false;
391
+ },
392
+ error: (error) => {
393
+ this.isLoading = false;
394
+ this.snackBar.open(error.message);
395
+ },
396
+ });
397
+ }
398
+ search(e) {
399
+ this.isLoading = true;
400
+ const word = e.target.value;
401
+ const options = {
402
+ filter: `clientName:${word}`,
403
+ };
404
+ this.clientService.find(options).subscribe({
405
+ next: (res) => {
406
+ this.clients = res.data;
407
+ this.dataSource.data = this.clients;
408
+ this.length = res.meta.pagination.count;
409
+ this.isLoading = false;
410
+ },
411
+ error: (error) => {
412
+ this.isLoading = false;
413
+ this.snackBar.open(error.message);
414
+ },
415
+ });
416
+ }
417
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: IndexComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
418
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.3", type: IndexComponent, isStandalone: true, selector: "rolatech-authorization-index", viewQueries: [{ propertyName: "paginator", first: true, predicate: MatPaginator, descendants: true, isSignal: true }], ngImport: i0, template: "<rolatech-toolbar title=\"Clients\">\n <button mat-icon-button routerLink=\"./create\">\n <mat-icon>add</mat-icon>\n </button>\n <button mat-icon-button (click)=\"isSearch = true\">\n <mat-icon>search</mat-icon>\n </button>\n <button mat-icon-button [matMenuTriggerFor]=\"beforeMenu\">\n <mat-icon>reorder</mat-icon>\n </button>\n <mat-menu #beforeMenu=\"matMenu\" xPosition=\"before\">\n @for (item of orderOptions; track item) {\n <button mat-menu-item (click)=\"onClick(item)\">\n <span>{{ item.value }}</span>\n <mat-icon>{{ item.icon }}</mat-icon>\n </button>\n }\n </mat-menu>\n</rolatech-toolbar>\n@if (isSearch) {\n <mat-form-field floatLabel=\"auto\">\n <input type=\"text\" matInput placeholder=\"Name\" (keyup.enter)=\"search($event)\" />\n <button matSuffix mat-icon-button (click)=\"findAll(null); isSearch = false\">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n}\n<div class=\"py-3\">\n <rolatech-spinner></rolatech-spinner>\n <table mat-table [dataSource]=\"dataSource\">\n <!-- clientName Column -->\n <ng-container matColumnDef=\"clientName\">\n <th mat-header-cell *matHeaderCellDef>Name</th>\n <td mat-cell *matCellDef=\"let item\">{{ item.clientName }}</td>\n </ng-container>\n\n <!-- clientId Column -->\n <ng-container matColumnDef=\"clientId\">\n <th mat-header-cell *matHeaderCellDef>CLIENT_ID</th>\n <td mat-cell *matCellDef=\"let item\">{{ item.clientId }}</td>\n </ng-container>\n\n <!-- clientId Column -->\n <ng-container matColumnDef=\"clientIdIssuedAt\">\n <th mat-header-cell *matHeaderCellDef>Issued At</th>\n <td mat-cell *matCellDef=\"let item\">{{ item.clientIdIssuedAt | date }}</td>\n </ng-container>\n\n <!-- actions Column -->\n <ng-container matColumnDef=\"actions\" stickyEnd>\n <th mat-header-cell *matHeaderCellDef class=\"actions\"></th>\n <td mat-cell *matCellDef=\"let item\" class=\"actions\">\n <mat-icon>navigate_next</mat-icon>\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns\"></tr>\n <tr\n mat-row\n *matRowDef=\"let row; columns: displayedColumns\"\n [routerLink]=\"['./', row.id]\"\n class=\"cursor-pointer hover:bg-[--rt-raised-background]\"\n ></tr>\n </table>\n</div>\n<mat-paginator\n #paginator\n [length]=\"length\"\n [pageSize]=\"pageSize\"\n [pageSizeOptions]=\"pageSizeOptions\"\n (page)=\"pageEvent = findAll($event)\"\n hidePageSize\n showFirstLastButtons\n>\n</mat-paginator>\n", styles: ["mat-form-field{width:100%}table{width:100%}td.mat-column-actions{text-align:right;min-width:80px;font-size:.8rem;padding:0 28px}.mat-mdc-header-cell.actions{text-align:right;max-width:120px;width:120px;padding:0 28px}td.mat-column-clientName{min-width:128px}mat-cell:last-of-type,mat-header-cell:last-of-type,mat-footer-cell:last-of-type{text-align:right;padding-right:8px!important}\n"], dependencies: [{ kind: "ngmodule", type: AngularCommonModule }, { kind: "pipe", type: i1$1.DatePipe, name: "date" }, { kind: "directive", type: i1$2.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "ngmodule", type: AngularComponentsModule }, { kind: "component", type: i2.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i4$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "directive", type: i6.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: i6$1.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: i6$1.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i6$1.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "component", type: i7.MatPaginator, selector: "mat-paginator", inputs: ["color", "pageIndex", "length", "pageSize", "pageSizeOptions", "hidePageSize", "showFirstLastButtons", "selectConfig", "disabled"], outputs: ["page"], exportAs: ["matPaginator"] }, { kind: "component", type: i8.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i8.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i8.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i8.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i8.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i8.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i8.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i8.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i8.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i8.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "component", type: SpinnerComponent, selector: "rolatech-spinner", inputs: ["title"] }, { kind: "component", type: ToolbarComponent, selector: "rolatech-toolbar", inputs: ["title", "subtitle", "back", "link", "large", "divider"] }] });
419
+ }
420
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: IndexComponent, decorators: [{
421
+ type: Component,
422
+ args: [{ imports: [AngularCommonModule, AngularComponentsModule, SpinnerComponent, ToolbarComponent], selector: 'rolatech-authorization-index', template: "<rolatech-toolbar title=\"Clients\">\n <button mat-icon-button routerLink=\"./create\">\n <mat-icon>add</mat-icon>\n </button>\n <button mat-icon-button (click)=\"isSearch = true\">\n <mat-icon>search</mat-icon>\n </button>\n <button mat-icon-button [matMenuTriggerFor]=\"beforeMenu\">\n <mat-icon>reorder</mat-icon>\n </button>\n <mat-menu #beforeMenu=\"matMenu\" xPosition=\"before\">\n @for (item of orderOptions; track item) {\n <button mat-menu-item (click)=\"onClick(item)\">\n <span>{{ item.value }}</span>\n <mat-icon>{{ item.icon }}</mat-icon>\n </button>\n }\n </mat-menu>\n</rolatech-toolbar>\n@if (isSearch) {\n <mat-form-field floatLabel=\"auto\">\n <input type=\"text\" matInput placeholder=\"Name\" (keyup.enter)=\"search($event)\" />\n <button matSuffix mat-icon-button (click)=\"findAll(null); isSearch = false\">\n <mat-icon>close</mat-icon>\n </button>\n </mat-form-field>\n}\n<div class=\"py-3\">\n <rolatech-spinner></rolatech-spinner>\n <table mat-table [dataSource]=\"dataSource\">\n <!-- clientName Column -->\n <ng-container matColumnDef=\"clientName\">\n <th mat-header-cell *matHeaderCellDef>Name</th>\n <td mat-cell *matCellDef=\"let item\">{{ item.clientName }}</td>\n </ng-container>\n\n <!-- clientId Column -->\n <ng-container matColumnDef=\"clientId\">\n <th mat-header-cell *matHeaderCellDef>CLIENT_ID</th>\n <td mat-cell *matCellDef=\"let item\">{{ item.clientId }}</td>\n </ng-container>\n\n <!-- clientId Column -->\n <ng-container matColumnDef=\"clientIdIssuedAt\">\n <th mat-header-cell *matHeaderCellDef>Issued At</th>\n <td mat-cell *matCellDef=\"let item\">{{ item.clientIdIssuedAt | date }}</td>\n </ng-container>\n\n <!-- actions Column -->\n <ng-container matColumnDef=\"actions\" stickyEnd>\n <th mat-header-cell *matHeaderCellDef class=\"actions\"></th>\n <td mat-cell *matCellDef=\"let item\" class=\"actions\">\n <mat-icon>navigate_next</mat-icon>\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns\"></tr>\n <tr\n mat-row\n *matRowDef=\"let row; columns: displayedColumns\"\n [routerLink]=\"['./', row.id]\"\n class=\"cursor-pointer hover:bg-[--rt-raised-background]\"\n ></tr>\n </table>\n</div>\n<mat-paginator\n #paginator\n [length]=\"length\"\n [pageSize]=\"pageSize\"\n [pageSizeOptions]=\"pageSizeOptions\"\n (page)=\"pageEvent = findAll($event)\"\n hidePageSize\n showFirstLastButtons\n>\n</mat-paginator>\n", styles: ["mat-form-field{width:100%}table{width:100%}td.mat-column-actions{text-align:right;min-width:80px;font-size:.8rem;padding:0 28px}.mat-mdc-header-cell.actions{text-align:right;max-width:120px;width:120px;padding:0 28px}td.mat-column-clientName{min-width:128px}mat-cell:last-of-type,mat-header-cell:last-of-type,mat-footer-cell:last-of-type{text-align:right;padding-right:8px!important}\n"] }]
423
+ }] });
424
+
425
+ const clientsRoutes = [
426
+ {
427
+ path: '',
428
+ component: IndexComponent,
429
+ },
430
+ {
431
+ path: 'create',
432
+ component: CreateComponent,
433
+ },
434
+ {
435
+ path: ':id',
436
+ component: DetailsComponent,
437
+ },
438
+ ];
439
+
440
+ export { clientsRoutes as default };
441
+ //# sourceMappingURL=rolatech-angular-authorization-clients.routes-CJToHkIB.mjs.map