@flusys/ng-iam 9.1.0-rc.1 → 9.1.1

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 (37) hide show
  1. package/fesm2022/flusys-ng-iam-action-form-page.component-DJ-A1gc2.mjs +685 -0
  2. package/fesm2022/flusys-ng-iam-action-form-page.component-DJ-A1gc2.mjs.map +1 -0
  3. package/fesm2022/{flusys-ng-iam-action-list-page.component-Cf4Dhh5S.mjs → flusys-ng-iam-action-list-page.component-Br0PbgRa.mjs} +369 -166
  4. package/fesm2022/flusys-ng-iam-action-list-page.component-Br0PbgRa.mjs.map +1 -0
  5. package/fesm2022/flusys-ng-iam-iam-container.component-CIdxVCSW.mjs +141 -0
  6. package/fesm2022/flusys-ng-iam-iam-container.component-CIdxVCSW.mjs.map +1 -0
  7. package/fesm2022/flusys-ng-iam-permission-api.service-C7-Yxvz8.mjs +76 -0
  8. package/fesm2022/flusys-ng-iam-permission-api.service-C7-Yxvz8.mjs.map +1 -0
  9. package/fesm2022/flusys-ng-iam-permission-page.component-BlNt83uR.mjs +306 -0
  10. package/fesm2022/flusys-ng-iam-permission-page.component-BlNt83uR.mjs.map +1 -0
  11. package/fesm2022/flusys-ng-iam-role-api.service-OwPgmSFc.mjs +33 -0
  12. package/fesm2022/flusys-ng-iam-role-api.service-OwPgmSFc.mjs.map +1 -0
  13. package/fesm2022/flusys-ng-iam-role-form-page.component-DnkWkbTF.mjs +427 -0
  14. package/fesm2022/flusys-ng-iam-role-form-page.component-DnkWkbTF.mjs.map +1 -0
  15. package/fesm2022/flusys-ng-iam-role-list-page.component-BCO_gQ8k.mjs +685 -0
  16. package/fesm2022/flusys-ng-iam-role-list-page.component-BCO_gQ8k.mjs.map +1 -0
  17. package/fesm2022/flusys-ng-iam-tree-utils-B1pBG4At.mjs +110 -0
  18. package/fesm2022/flusys-ng-iam-tree-utils-B1pBG4At.mjs.map +1 -0
  19. package/fesm2022/flusys-ng-iam-user-action-selector.component-CAXEmJWx.mjs +4592 -0
  20. package/fesm2022/flusys-ng-iam-user-action-selector.component-CAXEmJWx.mjs.map +1 -0
  21. package/fesm2022/flusys-ng-iam.mjs +2051 -2
  22. package/fesm2022/flusys-ng-iam.mjs.map +1 -1
  23. package/package.json +5 -5
  24. package/types/flusys-ng-iam.d.ts +621 -604
  25. package/fesm2022/flusys-ng-iam-action-form-page.component-Dn0TD1Zu.mjs +0 -509
  26. package/fesm2022/flusys-ng-iam-action-form-page.component-Dn0TD1Zu.mjs.map +0 -1
  27. package/fesm2022/flusys-ng-iam-action-list-page.component-Cf4Dhh5S.mjs.map +0 -1
  28. package/fesm2022/flusys-ng-iam-flusys-ng-iam-Y7U2lGZk.mjs +0 -5584
  29. package/fesm2022/flusys-ng-iam-flusys-ng-iam-Y7U2lGZk.mjs.map +0 -1
  30. package/fesm2022/flusys-ng-iam-iam-container.component-XBoIeQ0t.mjs +0 -105
  31. package/fesm2022/flusys-ng-iam-iam-container.component-XBoIeQ0t.mjs.map +0 -1
  32. package/fesm2022/flusys-ng-iam-permission-page.component-CCAQuZSJ.mjs +0 -204
  33. package/fesm2022/flusys-ng-iam-permission-page.component-CCAQuZSJ.mjs.map +0 -1
  34. package/fesm2022/flusys-ng-iam-role-form-page.component-EFjxhBRY.mjs +0 -352
  35. package/fesm2022/flusys-ng-iam-role-form-page.component-EFjxhBRY.mjs.map +0 -1
  36. package/fesm2022/flusys-ng-iam-role-list-page.component-DBfhjdkM.mjs +0 -486
  37. package/fesm2022/flusys-ng-iam-role-list-page.component-DBfhjdkM.mjs.map +0 -1
@@ -0,0 +1,685 @@
1
+ import { a as ActionApiService, t as buildActionParentTree } from "./flusys-ng-iam-tree-utils-B1pBG4At.mjs";
2
+ import { ActionType, LogicBuilderComponent } from "./flusys-ng-iam.mjs";
3
+ import * as i0 from "@angular/core";
4
+ import { Component, computed, effect, inject, signal } from "@angular/core";
5
+ import { TranslatePipe, TranslateService } from "@flusys/ng-shared";
6
+ import { CheckboxComponent, FButtonDirective, InputTextDirective, MessageService, SelectComponent, TreeSelectComponent, UiIconComponent } from "@flusys/ng-ui";
7
+ import { toSignal } from "@angular/core/rxjs-interop";
8
+ import { FormField, form, required } from "@angular/forms/signals";
9
+ import { ActivatedRoute, Router } from "@angular/router";
10
+ var ActionFormPageComponent = class ActionFormPageComponent {
11
+ route = inject(ActivatedRoute);
12
+ router = inject(Router);
13
+ actionApi = inject(ActionApiService);
14
+ messageService = inject(MessageService);
15
+ translateAdapter = inject(TranslateService, { optional: true });
16
+ routeParams = toSignal(this.route.paramMap);
17
+ initialized = false;
18
+ translate(key, vars) {
19
+ return this.translateAdapter?.translate(key, vars) ?? key;
20
+ }
21
+ isLoading = signal(false, ...ngDevMode ? [{ debugName: "isLoading" }] : /* istanbul ignore next */ []);
22
+ existingAction = signal(null, ...ngDevMode ? [{ debugName: "existingAction" }] : /* istanbul ignore next */ []);
23
+ isEditMode = computed(() => !!this.existingAction(), ...ngDevMode ? [{ debugName: "isEditMode" }] : /* istanbul ignore next */ []);
24
+ allActionsForLogic = signal([], ...ngDevMode ? [{ debugName: "allActionsForLogic" }] : /* istanbul ignore next */ []);
25
+ allActions = signal([], ...ngDevMode ? [{ debugName: "allActions" }] : /* istanbul ignore next */ []);
26
+ parentTreeNodes = computed(() => buildActionParentTree(this.allActions(), this.existingAction()?.id), ...ngDevMode ? [{ debugName: "parentTreeNodes" }] : /* istanbul ignore next */ []);
27
+ formModel = signal({
28
+ id: "",
29
+ name: "",
30
+ description: "",
31
+ code: "",
32
+ actionType: ActionType.BACKEND,
33
+ permissionLogic: null,
34
+ parentId: null,
35
+ serial: "",
36
+ isActive: true
37
+ }, ...ngDevMode ? [{ debugName: "formModel" }] : /* istanbul ignore next */ []);
38
+ actionTypes = computed(() => [
39
+ {
40
+ label: this.translate("iam.action.type.backend.label"),
41
+ value: ActionType.BACKEND
42
+ },
43
+ {
44
+ label: this.translate("iam.action.type.frontend.label"),
45
+ value: ActionType.FRONTEND
46
+ },
47
+ {
48
+ label: this.translate("iam.action.type.both.label"),
49
+ value: ActionType.BOTH
50
+ }
51
+ ], ...ngDevMode ? [{ debugName: "actionTypes" }] : /* istanbul ignore next */ []);
52
+ actionForm = form(this.formModel, (f) => {
53
+ required(f.name, { message: this.translate("shared.validation.required", { field: this.translate("iam.action.name") }) });
54
+ });
55
+ isFormValid = computed(() => {
56
+ return this.formModel().name.trim().length > 0;
57
+ }, ...ngDevMode ? [{ debugName: "isFormValid" }] : /* istanbul ignore next */ []);
58
+ constructor() {
59
+ effect(() => {
60
+ const params = this.routeParams();
61
+ if (!params || this.initialized) return;
62
+ this.initialized = true;
63
+ this.initializeForm(params.get("id"));
64
+ });
65
+ }
66
+ async initializeForm(id) {
67
+ try {
68
+ const response = await this.actionApi.getAll({
69
+ pagination: {
70
+ currentPage: 0,
71
+ pageSize: 1e4
72
+ },
73
+ select: [
74
+ "id",
75
+ "name",
76
+ "code",
77
+ "actionType",
78
+ "permissionLogic",
79
+ "parentId"
80
+ ]
81
+ });
82
+ if (response?.success && response.data) {
83
+ this.allActionsForLogic.set(response.data.map((a) => ({
84
+ id: a.id,
85
+ name: a.name ?? this.translate("shared.unnamed")
86
+ })));
87
+ this.allActions.set(response.data);
88
+ }
89
+ } catch {}
90
+ if (id && id !== "new") await this.loadAction(id);
91
+ }
92
+ async loadAction(id) {
93
+ this.isLoading.set(true);
94
+ try {
95
+ const response = await this.actionApi.findById(id, [
96
+ "id",
97
+ "name",
98
+ "description",
99
+ "code",
100
+ "actionType",
101
+ "permissionLogic",
102
+ "parentId",
103
+ "serial",
104
+ "isActive",
105
+ "readOnly"
106
+ ]);
107
+ if (response?.success && response.data) {
108
+ const action = response.data;
109
+ if (action.readOnly) {
110
+ this.messageService.add({
111
+ severity: "error",
112
+ summary: this.translate("shared.error"),
113
+ detail: this.translate("iam.action.readonly.edit.forbidden")
114
+ });
115
+ this.router.navigate(["/iam/actions"]);
116
+ return;
117
+ }
118
+ this.existingAction.set(action);
119
+ this.formModel.set({
120
+ id: action.id ?? "",
121
+ name: action.name ?? "",
122
+ description: action.description ?? "",
123
+ code: action.code ?? "",
124
+ actionType: action.actionType ?? ActionType.BACKEND,
125
+ permissionLogic: action.permissionLogic ?? null,
126
+ parentId: action.parentId ?? null,
127
+ serial: action.serial?.toString() ?? "",
128
+ isActive: action.isActive ?? true
129
+ });
130
+ } else this.router.navigate(["/iam/actions"]);
131
+ } catch {
132
+ this.router.navigate(["/iam/actions"]);
133
+ } finally {
134
+ this.isLoading.set(false);
135
+ }
136
+ }
137
+ async onSubmit(event) {
138
+ event.preventDefault();
139
+ if (!this.isFormValid()) {
140
+ this.messageService.add({
141
+ severity: "error",
142
+ summary: this.translate("shared.validation.error"),
143
+ detail: this.translate("shared.fill.required.fields")
144
+ });
145
+ return;
146
+ }
147
+ this.isLoading.set(true);
148
+ try {
149
+ const formValue = this.formModel();
150
+ const dto = {
151
+ ...formValue,
152
+ description: formValue.description || void 0,
153
+ code: formValue.code || void 0,
154
+ parentId: formValue.parentId || void 0,
155
+ serial: formValue.serial ? parseInt(formValue.serial, 10) : void 0,
156
+ permissionLogic: formValue.permissionLogic ?? void 0
157
+ };
158
+ const response = this.isEditMode() ? await this.actionApi.update(dto) : await this.actionApi.insert(dto);
159
+ this.messageService.add({
160
+ severity: "success",
161
+ summary: this.translate("shared.success"),
162
+ detail: response.messageKey ? this.translate(response.messageKey, response.messageVariables) : response.message ?? ""
163
+ });
164
+ this.router.navigate(["/iam/actions"]);
165
+ } catch {} finally {
166
+ this.isLoading.set(false);
167
+ }
168
+ }
169
+ onBack() {
170
+ this.router.navigate(["/iam/actions"]);
171
+ }
172
+ onLogicChange(logic) {
173
+ this.formModel.update((model) => ({
174
+ ...model,
175
+ permissionLogic: logic
176
+ }));
177
+ }
178
+ static ɵfac = i0.ɵɵngDeclareFactory({
179
+ minVersion: "12.0.0",
180
+ version: "22.2.1",
181
+ ngImport: i0,
182
+ type: ActionFormPageComponent,
183
+ deps: [],
184
+ target: i0.ɵɵFactoryTarget.Component
185
+ });
186
+ static ɵcmp = i0.ɵɵngDeclareComponent({
187
+ minVersion: "17.0.0",
188
+ version: "22.2.1",
189
+ type: ActionFormPageComponent,
190
+ isStandalone: true,
191
+ selector: "lib-action-form-page",
192
+ ngImport: i0,
193
+ template: `
194
+ <div class="card">
195
+ <h3 class="text-lg sm:text-xl font-semibold mb-4">
196
+ {{
197
+ isEditMode()
198
+ ? ('iam.action.edit' | translate)
199
+ : ('iam.action.new' | translate)
200
+ }}
201
+ </h3>
202
+
203
+ <form
204
+ (submit)="onSubmit($event)"
205
+ class="grid grid-cols-1 md:grid-cols-2 gap-4"
206
+ >
207
+ <!-- Name -->
208
+ <div class="flex flex-col gap-2">
209
+ <label for="name" class="font-medium"
210
+ >{{ 'iam.action.name' | translate }} *</label
211
+ >
212
+ <input
213
+ fInputText
214
+ id="name"
215
+ [formField]="actionForm.name"
216
+ [placeholder]="'iam.action.name.placeholder' | translate"
217
+ />
218
+ </div>
219
+
220
+ <!-- Code -->
221
+ <div class="flex flex-col gap-2">
222
+ <label for="code" class="font-medium">{{
223
+ 'iam.action.code' | translate
224
+ }}</label>
225
+ <input
226
+ fInputText
227
+ id="code"
228
+ [formField]="actionForm.code"
229
+ [placeholder]="'iam.action.code.placeholder' | translate"
230
+ />
231
+ </div>
232
+
233
+ <!-- Description -->
234
+ <div class="flex flex-col gap-2">
235
+ <label for="description" class="font-medium">{{
236
+ 'shared.description' | translate
237
+ }}</label>
238
+ <input
239
+ fInputText
240
+ id="description"
241
+ [formField]="actionForm.description"
242
+ [placeholder]="'shared.description.placeholder' | translate"
243
+ />
244
+ </div>
245
+
246
+ <!-- Action Type -->
247
+ <div class="flex flex-col gap-2">
248
+ <label for="actionType" class="font-medium"
249
+ >{{ 'iam.action.type' | translate }} *</label
250
+ >
251
+ <f-select
252
+ inputId="actionType"
253
+ [options]="actionTypes()"
254
+ optionLabel="label"
255
+ optionValue="value"
256
+ [formField]="actionForm.actionType"
257
+ [placeholder]="'iam.action.type' | translate"
258
+ />
259
+ </div>
260
+
261
+ <!-- Parent Action -->
262
+ <div class="flex flex-col gap-2">
263
+ <label class="font-medium">{{
264
+ 'iam.action.parent' | translate
265
+ }}</label>
266
+ <f-treeselect
267
+ [options]="parentTreeNodes()"
268
+ [formField]="actionForm.parentId"
269
+ [placeholder]="'iam.action.select.parent' | translate"
270
+ [filter]="true"
271
+ [showClear]="true"
272
+ />
273
+ </div>
274
+
275
+ <!-- Order -->
276
+ <div class="flex flex-col gap-2">
277
+ <label for="serial" class="font-medium">{{
278
+ 'shared.display.order' | translate
279
+ }}</label>
280
+ <input
281
+ fInputText
282
+ id="serial"
283
+ type="number"
284
+ [formField]="actionForm.serial"
285
+ [placeholder]="'shared.display.order.placeholder' | translate"
286
+ />
287
+ </div>
288
+
289
+ <!-- Is Active -->
290
+ <div class="flex items-end gap-2 pb-1 md:col-span-2">
291
+ <f-checkbox
292
+ [formField]="actionForm.isActive"
293
+ [binary]="true"
294
+ inputId="isActive"
295
+ />
296
+ <label for="isActive">{{ 'shared.active' | translate }}</label>
297
+ </div>
298
+
299
+ <!-- Permission Logic Builder -->
300
+ <div class="md:col-span-2">
301
+ <lib-logic-builder
302
+ [logic]="formModel().permissionLogic"
303
+ [actions]="allActionsForLogic()"
304
+ (logicChange)="onLogicChange($event)"
305
+ />
306
+ </div>
307
+
308
+ <!-- Actions -->
309
+ <div class="flex justify-end gap-2 md:col-span-2 pt-4">
310
+ <button
311
+ fButton
312
+ type="button"
313
+ severity="secondary"
314
+ [outlined]="true"
315
+ (click)="onBack()"
316
+ >
317
+ <span pButtonLabel>{{ 'shared.cancel' | translate }}</span>
318
+ </button>
319
+ <button
320
+ fButton
321
+ type="submit"
322
+ [disabled]="!isFormValid() || isLoading()"
323
+ >
324
+ @if (isLoading()) {
325
+ <ui-icon pButtonIcon name="spinner" [spin]="true"></ui-icon>
326
+ }
327
+ <span pButtonLabel>{{
328
+ isEditMode()
329
+ ? ('shared.update' | translate)
330
+ : ('shared.create' | translate)
331
+ }}</span>
332
+ </button>
333
+ </div>
334
+ </form>
335
+ </div>
336
+ `,
337
+ isInline: true,
338
+ dependencies: [
339
+ {
340
+ kind: "component",
341
+ type: CheckboxComponent,
342
+ selector: "f-checkbox",
343
+ inputs: [
344
+ "label",
345
+ "binary",
346
+ "disabled",
347
+ "readonly",
348
+ "inputId",
349
+ "invalid",
350
+ "indeterminate",
351
+ "variant",
352
+ "size",
353
+ "touched",
354
+ "styleClass",
355
+ "style",
356
+ "checked"
357
+ ],
358
+ outputs: [
359
+ "onChange",
360
+ "onBlur",
361
+ "touch",
362
+ "checkedChange"
363
+ ]
364
+ },
365
+ {
366
+ kind: "directive",
367
+ type: FButtonDirective,
368
+ selector: "[fButton]",
369
+ inputs: [
370
+ "severity",
371
+ "text",
372
+ "outlined",
373
+ "link",
374
+ "variant",
375
+ "rounded",
376
+ "raised",
377
+ "fluid",
378
+ "disabled",
379
+ "loading",
380
+ "loadingIcon",
381
+ "size",
382
+ "label",
383
+ "icon",
384
+ "iconPos",
385
+ "ariaLabel",
386
+ "plain"
387
+ ]
388
+ },
389
+ {
390
+ kind: "directive",
391
+ type: InputTextDirective,
392
+ selector: "[fInputText]",
393
+ inputs: [
394
+ "invalid",
395
+ "touched",
396
+ "variant",
397
+ "size",
398
+ "fluid"
399
+ ]
400
+ },
401
+ {
402
+ kind: "component",
403
+ type: SelectComponent,
404
+ selector: "f-select",
405
+ inputs: [
406
+ "options",
407
+ "optionLabel",
408
+ "optionValue",
409
+ "placeholder",
410
+ "disabled",
411
+ "filter",
412
+ "filterBy",
413
+ "filterMatchMode",
414
+ "filterLocale",
415
+ "filterPlaceholder",
416
+ "resetFilterOnHide",
417
+ "autofocusFilter",
418
+ "emptyMessage",
419
+ "emptyFilterMessage",
420
+ "showClear",
421
+ "loading",
422
+ "loadingIcon",
423
+ "dropdownIcon",
424
+ "clearIcon",
425
+ "inputId",
426
+ "invalid",
427
+ "touched",
428
+ "styleClass",
429
+ "style",
430
+ "appendTo",
431
+ "editable",
432
+ "readonly",
433
+ "autofocus",
434
+ "checkmark",
435
+ "group",
436
+ "optionGroupLabel",
437
+ "optionGroupChildren",
438
+ "virtualScroll",
439
+ "virtualScrollItemSize",
440
+ "lazy",
441
+ "selectedObject"
442
+ ],
443
+ outputs: [
444
+ "onFilter",
445
+ "onChange",
446
+ "onShow",
447
+ "onHide",
448
+ "onBlur",
449
+ "onFocus",
450
+ "onClear",
451
+ "onLazyLoad"
452
+ ]
453
+ },
454
+ {
455
+ kind: "component",
456
+ type: TreeSelectComponent,
457
+ selector: "f-treeselect",
458
+ inputs: [
459
+ "options",
460
+ "placeholder",
461
+ "inputId",
462
+ "disabled",
463
+ "filter",
464
+ "filterBy",
465
+ "filterPlaceholder",
466
+ "selectionMode",
467
+ "display",
468
+ "propagateSelectionDown",
469
+ "propagateSelectionUp",
470
+ "showClear",
471
+ "virtualScroll",
472
+ "virtualScrollItemSize",
473
+ "emptyMessage",
474
+ "invalid",
475
+ "touched",
476
+ "styleClass",
477
+ "style",
478
+ "appendTo"
479
+ ]
480
+ },
481
+ {
482
+ kind: "component",
483
+ type: UiIconComponent,
484
+ selector: "ui-icon",
485
+ inputs: [
486
+ "name",
487
+ "size",
488
+ "spin",
489
+ "fill",
490
+ "severity"
491
+ ]
492
+ },
493
+ {
494
+ kind: "directive",
495
+ type: FormField,
496
+ selector: "[formField]",
497
+ inputs: ["formField"],
498
+ exportAs: ["formField"]
499
+ },
500
+ {
501
+ kind: "component",
502
+ type: LogicBuilderComponent,
503
+ selector: "lib-logic-builder",
504
+ inputs: ["logic", "actions"],
505
+ outputs: ["logicChange"]
506
+ },
507
+ {
508
+ kind: "pipe",
509
+ type: TranslatePipe,
510
+ name: "translate"
511
+ }
512
+ ]
513
+ });
514
+ };
515
+ i0.ɵɵngDeclareClassMetadata({
516
+ minVersion: "12.0.0",
517
+ version: "22.2.1",
518
+ ngImport: i0,
519
+ type: ActionFormPageComponent,
520
+ decorators: [{
521
+ type: Component,
522
+ args: [{
523
+ selector: "lib-action-form-page",
524
+ imports: [
525
+ CheckboxComponent,
526
+ FButtonDirective,
527
+ InputTextDirective,
528
+ SelectComponent,
529
+ TreeSelectComponent,
530
+ UiIconComponent,
531
+ FormField,
532
+ LogicBuilderComponent,
533
+ TranslatePipe
534
+ ],
535
+ template: `
536
+ <div class="card">
537
+ <h3 class="text-lg sm:text-xl font-semibold mb-4">
538
+ {{
539
+ isEditMode()
540
+ ? ('iam.action.edit' | translate)
541
+ : ('iam.action.new' | translate)
542
+ }}
543
+ </h3>
544
+
545
+ <form
546
+ (submit)="onSubmit($event)"
547
+ class="grid grid-cols-1 md:grid-cols-2 gap-4"
548
+ >
549
+ <!-- Name -->
550
+ <div class="flex flex-col gap-2">
551
+ <label for="name" class="font-medium"
552
+ >{{ 'iam.action.name' | translate }} *</label
553
+ >
554
+ <input
555
+ fInputText
556
+ id="name"
557
+ [formField]="actionForm.name"
558
+ [placeholder]="'iam.action.name.placeholder' | translate"
559
+ />
560
+ </div>
561
+
562
+ <!-- Code -->
563
+ <div class="flex flex-col gap-2">
564
+ <label for="code" class="font-medium">{{
565
+ 'iam.action.code' | translate
566
+ }}</label>
567
+ <input
568
+ fInputText
569
+ id="code"
570
+ [formField]="actionForm.code"
571
+ [placeholder]="'iam.action.code.placeholder' | translate"
572
+ />
573
+ </div>
574
+
575
+ <!-- Description -->
576
+ <div class="flex flex-col gap-2">
577
+ <label for="description" class="font-medium">{{
578
+ 'shared.description' | translate
579
+ }}</label>
580
+ <input
581
+ fInputText
582
+ id="description"
583
+ [formField]="actionForm.description"
584
+ [placeholder]="'shared.description.placeholder' | translate"
585
+ />
586
+ </div>
587
+
588
+ <!-- Action Type -->
589
+ <div class="flex flex-col gap-2">
590
+ <label for="actionType" class="font-medium"
591
+ >{{ 'iam.action.type' | translate }} *</label
592
+ >
593
+ <f-select
594
+ inputId="actionType"
595
+ [options]="actionTypes()"
596
+ optionLabel="label"
597
+ optionValue="value"
598
+ [formField]="actionForm.actionType"
599
+ [placeholder]="'iam.action.type' | translate"
600
+ />
601
+ </div>
602
+
603
+ <!-- Parent Action -->
604
+ <div class="flex flex-col gap-2">
605
+ <label class="font-medium">{{
606
+ 'iam.action.parent' | translate
607
+ }}</label>
608
+ <f-treeselect
609
+ [options]="parentTreeNodes()"
610
+ [formField]="actionForm.parentId"
611
+ [placeholder]="'iam.action.select.parent' | translate"
612
+ [filter]="true"
613
+ [showClear]="true"
614
+ />
615
+ </div>
616
+
617
+ <!-- Order -->
618
+ <div class="flex flex-col gap-2">
619
+ <label for="serial" class="font-medium">{{
620
+ 'shared.display.order' | translate
621
+ }}</label>
622
+ <input
623
+ fInputText
624
+ id="serial"
625
+ type="number"
626
+ [formField]="actionForm.serial"
627
+ [placeholder]="'shared.display.order.placeholder' | translate"
628
+ />
629
+ </div>
630
+
631
+ <!-- Is Active -->
632
+ <div class="flex items-end gap-2 pb-1 md:col-span-2">
633
+ <f-checkbox
634
+ [formField]="actionForm.isActive"
635
+ [binary]="true"
636
+ inputId="isActive"
637
+ />
638
+ <label for="isActive">{{ 'shared.active' | translate }}</label>
639
+ </div>
640
+
641
+ <!-- Permission Logic Builder -->
642
+ <div class="md:col-span-2">
643
+ <lib-logic-builder
644
+ [logic]="formModel().permissionLogic"
645
+ [actions]="allActionsForLogic()"
646
+ (logicChange)="onLogicChange($event)"
647
+ />
648
+ </div>
649
+
650
+ <!-- Actions -->
651
+ <div class="flex justify-end gap-2 md:col-span-2 pt-4">
652
+ <button
653
+ fButton
654
+ type="button"
655
+ severity="secondary"
656
+ [outlined]="true"
657
+ (click)="onBack()"
658
+ >
659
+ <span pButtonLabel>{{ 'shared.cancel' | translate }}</span>
660
+ </button>
661
+ <button
662
+ fButton
663
+ type="submit"
664
+ [disabled]="!isFormValid() || isLoading()"
665
+ >
666
+ @if (isLoading()) {
667
+ <ui-icon pButtonIcon name="spinner" [spin]="true"></ui-icon>
668
+ }
669
+ <span pButtonLabel>{{
670
+ isEditMode()
671
+ ? ('shared.update' | translate)
672
+ : ('shared.create' | translate)
673
+ }}</span>
674
+ </button>
675
+ </div>
676
+ </form>
677
+ </div>
678
+ `
679
+ }]
680
+ }],
681
+ ctorParameters: () => []
682
+ });
683
+ export { ActionFormPageComponent };
684
+
685
+ //# sourceMappingURL=flusys-ng-iam-action-form-page.component-DJ-A1gc2.mjs.map