@cqa-lib/cqa-ui 1.1.527 → 1.1.529

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 (21) hide show
  1. package/esm2020/lib/dialog/dialog.component.mjs +15 -3
  2. package/esm2020/lib/dialog/dialog.models.mjs +1 -1
  3. package/esm2020/lib/step-builder/step-builder-group/step-builder-group.component.mjs +22 -7
  4. package/esm2020/lib/templates/modular-table-template/dialogs/move-to-folder-dialog.component.mjs +38 -13
  5. package/esm2020/lib/templates/modular-table-template/dialogs/new-folder-dialog.component.mjs +79 -87
  6. package/esm2020/lib/templates/modular-table-template/folder-sidebar/folder-sidebar.component.mjs +21 -4
  7. package/esm2020/lib/templates/modular-table-template/modular-table-template.component.mjs +3 -1
  8. package/esm2020/lib/templates/modular-table-template/modular-table-template.models.mjs +3 -1
  9. package/fesm2015/cqa-lib-cqa-ui.mjs +169 -106
  10. package/fesm2015/cqa-lib-cqa-ui.mjs.map +1 -1
  11. package/fesm2020/cqa-lib-cqa-ui.mjs +169 -104
  12. package/fesm2020/cqa-lib-cqa-ui.mjs.map +1 -1
  13. package/lib/dialog/dialog.component.d.ts +1 -0
  14. package/lib/dialog/dialog.models.d.ts +4 -0
  15. package/lib/step-builder/step-builder-group/step-builder-group.component.d.ts +10 -1
  16. package/lib/templates/modular-table-template/dialogs/move-to-folder-dialog.component.d.ts +12 -2
  17. package/lib/templates/modular-table-template/dialogs/new-folder-dialog.component.d.ts +23 -30
  18. package/lib/templates/modular-table-template/folder-sidebar/folder-sidebar.component.d.ts +4 -0
  19. package/lib/templates/modular-table-template/modular-table-template.models.d.ts +2 -0
  20. package/package.json +1 -1
  21. package/styles.css +1 -1
@@ -19,6 +19,7 @@ export declare class DialogComponent<TResult = unknown> {
19
19
  get panelClassList(): string[];
20
20
  get panelStyles(): Record<string, string | undefined>;
21
21
  buttonVariant(button: DialogButtonConfig<TResult>): ButtonVariant;
22
+ isButtonDisabled(button: DialogButtonConfig<TResult>): boolean;
22
23
  buttonHostClasses(button: DialogButtonConfig<TResult>): string[];
23
24
  private mapAlignmentToClass;
24
25
  private markContentAttached;
@@ -7,6 +7,10 @@ export interface DialogButtonConfig<TResult = unknown> {
7
7
  role?: DialogButtonRole;
8
8
  handler?: (dialogRef: DialogRef<TResult>) => TResult | void | Promise<TResult | void>;
9
9
  closeOnClick?: boolean;
10
+ /** Static or dynamic disabled state. When a function, it receives the dialog ref
11
+ * (so consumers can read the rendered component instance via `getComponentInstance`)
12
+ * and is re-evaluated on every change-detection pass. */
13
+ disabled?: boolean | ((dialogRef: DialogRef<TResult>) => boolean);
10
14
  }
11
15
  export declare type DialogButtonAlignment = 'left' | 'right' | 'center';
12
16
  export interface TemplateDialogContent<TContext = any> {
@@ -48,6 +48,15 @@ export declare class StepBuilderGroupComponent implements OnInit, OnChanges {
48
48
  };
49
49
  /** True while parent is creating the step (API in progress); show loader on Create/Update Step button */
50
50
  isCreatingStep: boolean;
51
+ /**
52
+ * When true, render an amber warning banner at the top of the card explaining that any
53
+ * runtime values typed here will be overridden by the consuming test case. Set this when
54
+ * the step-group step is being created/edited inside a host test case that is itself a
55
+ * step group.
56
+ */
57
+ showNestedStepGroupWarning: boolean;
58
+ /** Optional override for the warning copy. Falls back to a sensible default. */
59
+ nestedStepGroupWarning: string;
51
60
  /** Emit when step is created */
52
61
  createStep: EventEmitter<StepGroupFormData>;
53
62
  /** Emit when step group is selected to fetch runtime variables */
@@ -89,5 +98,5 @@ export declare class StepBuilderGroupComponent implements OnInit, OnChanges {
89
98
  private captureInitialSnapshot;
90
99
  isFormValid(): boolean;
91
100
  static ɵfac: i0.ɵɵFactoryDeclaration<StepBuilderGroupComponent, never>;
92
- static ɵcmp: i0.ɵɵComponentDeclaration<StepBuilderGroupComponent, "cqa-step-builder-group", never, { "stepGroupOptions": "stepGroupOptions"; "hasMoreStepGroups": "hasMoreStepGroups"; "isLoadingStepGroups": "isLoadingStepGroups"; "initialStepGroupId": "initialStepGroupId"; "editMode": "editMode"; "runtimeVariables": "runtimeVariables"; "isLoadingRuntimeVariables": "isLoadingRuntimeVariables"; "existingRuntimeValues": "existingRuntimeValues"; "isCreatingStep": "isCreatingStep"; }, { "createStep": "createStep"; "stepGroupSelected": "stepGroupSelected"; "cancelled": "cancelled"; "loadMoreStepGroups": "loadMoreStepGroups"; "searchStepGroups": "searchStepGroups"; }, never, never>;
101
+ static ɵcmp: i0.ɵɵComponentDeclaration<StepBuilderGroupComponent, "cqa-step-builder-group", never, { "stepGroupOptions": "stepGroupOptions"; "hasMoreStepGroups": "hasMoreStepGroups"; "isLoadingStepGroups": "isLoadingStepGroups"; "initialStepGroupId": "initialStepGroupId"; "editMode": "editMode"; "runtimeVariables": "runtimeVariables"; "isLoadingRuntimeVariables": "isLoadingRuntimeVariables"; "existingRuntimeValues": "existingRuntimeValues"; "isCreatingStep": "isCreatingStep"; "showNestedStepGroupWarning": "showNestedStepGroupWarning"; "nestedStepGroupWarning": "nestedStepGroupWarning"; }, { "createStep": "createStep"; "stepGroupSelected": "stepGroupSelected"; "cancelled": "cancelled"; "loadMoreStepGroups": "loadMoreStepGroups"; "searchStepGroups": "searchStepGroups"; }, never, never>;
93
102
  }
@@ -34,8 +34,17 @@ export declare class MoveToFolderDialogComponent implements OnInit, OnChanges {
34
34
  currentFolderId: number | null;
35
35
  /** Controls which folder is visually selected. Two-way-bind friendly via `pickedFolderIdChange`. */
36
36
  pickedFolderId: number | null;
37
- /** Folder ids to expand by default. If not provided, ancestors of `currentFolderId` are expanded. */
37
+ /** Folder ids to expand by default. If not provided, ancestors of `currentFolderId` (or
38
+ * `pickedFolderId`, when no current context exists) are expanded. */
38
39
  initialExpandedIds?: number[];
40
+ /** Disables the top-level "Unorganised / no folder" row. Decoupled from `currentFolderId`
41
+ * so consumers that reuse this picker for non-move flows (e.g. parent-folder selection
42
+ * inside the New Folder dialog) can keep the root option clickable. The move flows wire
43
+ * this to `currentFolderId == null`. */
44
+ rootDisabled: boolean;
45
+ /** CSS height for the scrollable picker container. Lets embedders shrink the picker when
46
+ * it shares space with other fields (e.g. inside the New Folder dialog). */
47
+ pickerHeight: string;
39
48
  /** Fires whenever the user picks a destination. */
40
49
  folderPicked: EventEmitter<number>;
41
50
  /** Companion output for banana-in-the-box `[(pickedFolderId)]` binding. */
@@ -48,10 +57,11 @@ export declare class MoveToFolderDialogComponent implements OnInit, OnChanges {
48
57
  private collectAncestors;
49
58
  get flatRows(): FlatFolderRow[];
50
59
  isPicked(id: number | null): boolean;
60
+ get isUnorganisedDisabled(): boolean;
51
61
  pick(id: number | null): void;
52
62
  toggleExpanded(id: number, event: Event): void;
53
63
  trackById: (_: number, row: FlatFolderRow) => number;
54
64
  static ɵfac: i0.ɵɵFactoryDeclaration<MoveToFolderDialogComponent, never>;
55
- static ɵcmp: i0.ɵɵComponentDeclaration<MoveToFolderDialogComponent, "cqa-move-to-folder-dialog", never, { "folders": "folders"; "labels": "labels"; "currentFolderId": "currentFolderId"; "pickedFolderId": "pickedFolderId"; "initialExpandedIds": "initialExpandedIds"; }, { "folderPicked": "folderPicked"; "pickedFolderIdChange": "pickedFolderIdChange"; }, never, never>;
65
+ static ɵcmp: i0.ɵɵComponentDeclaration<MoveToFolderDialogComponent, "cqa-move-to-folder-dialog", never, { "folders": "folders"; "labels": "labels"; "currentFolderId": "currentFolderId"; "pickedFolderId": "pickedFolderId"; "initialExpandedIds": "initialExpandedIds"; "rootDisabled": "rootDisabled"; "pickerHeight": "pickerHeight"; }, { "folderPicked": "folderPicked"; "pickedFolderIdChange": "pickedFolderIdChange"; }, never, never>;
56
66
  }
57
67
  export {};
@@ -1,15 +1,16 @@
1
- import { ChangeDetectorRef, EventEmitter, OnInit } from '@angular/core';
2
- import { FormGroup } from '@angular/forms';
3
- import { DynamicSelectFieldConfig } from '../../../dynamic-select/dynamic-select-field.component';
1
+ import { ChangeDetectorRef, EventEmitter } from '@angular/core';
4
2
  import { FolderNode, ModularLabels } from '../modular-table-template.models';
5
3
  import * as i0 from "@angular/core";
6
4
  export declare const DEFAULT_FOLDER_COLOR = "#99999E";
5
+ export declare const FOLDER_NAME_MAX_LENGTH = 20;
7
6
  /**
8
7
  * Body of the "New Folder" dialog.
9
8
  *
10
9
  * Uses reusable library components (`cqa-custom-input` for the name field,
11
- * `cqa-dynamic-select` for the parent dropdown) so hosts can drop this dialog
12
- * into their own modal shell without worrying about styling drift.
10
+ * `cqa-move-to-folder-dialog` as an embedded tree picker for the parent folder)
11
+ * so hosts can drop this dialog into their own modal shell without worrying
12
+ * about styling drift. The tree picker handles arbitrarily deep nesting via
13
+ * expand/collapse rather than a flat dropdown of "A › B › C ›…" paths.
13
14
  *
14
15
  * Two integration paths:
15
16
  *
@@ -21,7 +22,7 @@ export declare const DEFAULT_FOLDER_COLOR = "#99999E";
21
22
  * modal and listens to `(submitted)` / `(cancelled)` / `(nameChange)` /
22
23
  * `(parentIdChange)`.
23
24
  */
24
- export declare class NewFolderDialogComponent implements OnInit {
25
+ export declare class NewFolderDialogComponent {
25
26
  private cdr;
26
27
  private _folders;
27
28
  set folders(value: FolderNode[]);
@@ -30,9 +31,11 @@ export declare class NewFolderDialogComponent implements OnInit {
30
31
  set labels(value: ModularLabels);
31
32
  get labels(): ModularLabels;
32
33
  name: string;
33
- private _parentId;
34
- set parentId(value: number | null);
35
- get parentId(): number | null;
34
+ /** Tracks whether the user has interacted with the name field, so we don't surface
35
+ * the "required" error on first paint when the dialog opens with an empty name. */
36
+ private nameTouched;
37
+ readonly maxNameLength = 20;
38
+ parentId: number | null;
36
39
  color: string;
37
40
  readonly presetColors: string[];
38
41
  readonly rainbowBorder: string;
@@ -45,33 +48,23 @@ export declare class NewFolderDialogComponent implements OnInit {
45
48
  color: string;
46
49
  }>;
47
50
  cancelled: EventEmitter<void>;
48
- /** Reactive form used by cqa-dynamic-select. Untyped to match the project's Angular 13.4 forms API. */
49
- parentForm: FormGroup;
50
- /**
51
- * Config passed to `cqa-dynamic-select`. Stored as a field (not a getter) so
52
- * the object reference is stable across change-detection passes — a getter
53
- * returns a fresh object every CD tick and causes
54
- * `ExpressionChangedAfterItHasBeenCheckedError` + repeated `ngOnChanges` on
55
- * the child select. Other consumers in this lib (e.g. `loop-step`) follow
56
- * the same pattern.
57
- */
58
- parentSelectConfig: DynamicSelectFieldConfig;
59
- private parentOptions;
51
+ /** Labels passed to the embedded tree picker. Re-uses the move-dialog surface but
52
+ * rewrites the root row's label so it reads "(no parent)" instead of "Unorganised"
53
+ * for the create-folder context. */
54
+ parentPickerLabels: ModularLabels;
60
55
  constructor(cdr: ChangeDetectorRef);
61
- ngOnInit(): void;
62
- private rebuildSelectConfig;
63
- private rebuildOptions;
64
- private syncParentControl;
56
+ private buildParentPickerLabels;
65
57
  onNameChange(value: string): void;
66
- onParentSelectionChange(event: {
67
- key: string;
68
- value: any;
69
- }): void;
58
+ onParentPicked(id: number | null): void;
70
59
  isColor(c: string): boolean;
71
60
  get isCustomColor(): boolean;
72
61
  onColorChange(value: string): void;
73
62
  onColorInputEvent(event: Event): void;
74
- /** Returns true when the current state is a valid submission (non-empty, trimmed name). */
63
+ /** Errors surfaced under the name field. Only computed once the user has touched
64
+ * the input so the dialog doesn't open with a "required" error already showing. */
65
+ get nameErrors(): string[];
66
+ /** Returns true when the current state is a valid submission (non-empty trimmed name
67
+ * within the max length). Used by the host to gate the dialog's Create button. */
75
68
  get isValid(): boolean;
76
69
  submit(): void;
77
70
  static ɵfac: i0.ɵɵFactoryDeclaration<NewFolderDialogComponent, never>;
@@ -62,6 +62,8 @@ export declare class FolderSidebarComponent implements OnDestroy {
62
62
  searchValue: string;
63
63
  renamingId: number | null;
64
64
  renameDraft: string;
65
+ /** Inline rename uses the same name rules as the New Folder dialog. */
66
+ readonly renameMaxLength: number;
65
67
  /** Id of the folder whose context menu is open, or null when closed. */
66
68
  contextMenuFolderId: number | null;
67
69
  /** Viewport-anchored position (client coordinates) for the floating menu. */
@@ -84,6 +86,8 @@ export declare class FolderSidebarComponent implements OnDestroy {
84
86
  onSelect(n: FolderNode | null): void;
85
87
  onSelectUnorganised(): void;
86
88
  beginRename(n: FolderNode, event: Event): void;
89
+ /** True when the active rename draft passes the name rules (non-empty, within max length). */
90
+ get isRenameDraftValid(): boolean;
87
91
  commitRename(n: FolderNode): void;
88
92
  cancelRename(): void;
89
93
  onRenameKey(event: KeyboardEvent, n: FolderNode): void;
@@ -60,6 +60,8 @@ export interface ModularLabels {
60
60
  newFolderDialogColorLabel: string;
61
61
  newFolderDialogCancel: string;
62
62
  newFolderDialogConfirm: string;
63
+ newFolderDialogNameRequiredError: string;
64
+ newFolderDialogNameMaxLengthError: string;
63
65
  folderMenuCreateSubfolder: string;
64
66
  folderMenuRename: string;
65
67
  folderMenuMove: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cqa-lib/cqa-ui",
3
- "version": "1.1.527",
3
+ "version": "1.1.529",
4
4
  "description": "UI Kit library for Angular 13.4",
5
5
  "keywords": [
6
6
  "angular",