@rivet-health/design-system 40.8.0 → 40.9.0
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.
- package/esm2020/lib/navigation/editable-heading/editable-heading.component.mjs +78 -19
- package/fesm2015/rivet-health-design-system.mjs +74 -16
- package/fesm2015/rivet-health-design-system.mjs.map +1 -1
- package/fesm2020/rivet-health-design-system.mjs +74 -16
- package/fesm2020/rivet-health-design-system.mjs.map +1 -1
- package/lib/navigation/editable-heading/editable-heading.component.d.ts +42 -8
- package/package.json +1 -1
|
@@ -18,12 +18,10 @@ import * as i0 from "@angular/core";
|
|
|
18
18
|
* "commit" framing over "change" is deliberate: consumers that persist on
|
|
19
19
|
* commit (analytics, PATCH) treat the gesture itself as the event; those
|
|
20
20
|
* that only care about diffs can compare `next === current` in the handler.
|
|
21
|
-
* There is no cancel path.
|
|
22
21
|
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
* than changing outside-click's meaning.
|
|
22
|
+
* Escape cancels: reverts the draft back to the current value and drops out
|
|
23
|
+
* of edit mode WITHOUT emitting a change. Outside-click still commits (to
|
|
24
|
+
* match `riv-date` / `riv-select`); Escape is the deliberate abandon path.
|
|
27
25
|
*
|
|
28
26
|
* Value handling follows the same convention as `riv-text-field`: `[title]`
|
|
29
27
|
* and `[description]` are treated as suggestions, not authoritative state.
|
|
@@ -32,6 +30,12 @@ import * as i0 from "@angular/core";
|
|
|
32
30
|
* a different value. That lets the component demo out of the box (e.g. in
|
|
33
31
|
* Storybook) without requiring a round trip through the parent.
|
|
34
32
|
*
|
|
33
|
+
* Programmatic entry into edit mode is available via `startEditingTitle()`
|
|
34
|
+
* and `startEditingDescription()` — obtain a reference with
|
|
35
|
+
* `@ViewChild(EditableHeadingComponent)`. Use these for secondary entry
|
|
36
|
+
* points like a kebab-menu "Rename" item, or to auto-open rename after
|
|
37
|
+
* creating a new entity.
|
|
38
|
+
*
|
|
35
39
|
* The component owns no border, background, or card chrome — consumers who
|
|
36
40
|
* want a bordered container should wrap it.
|
|
37
41
|
*
|
|
@@ -64,6 +68,15 @@ export declare class EditableHeadingComponent {
|
|
|
64
68
|
get description(): string;
|
|
65
69
|
titleMaxLength: number;
|
|
66
70
|
descriptionMaxLength: number;
|
|
71
|
+
/**
|
|
72
|
+
* When true, the title and description are not clickable and cannot be
|
|
73
|
+
* edited. Any in-progress edit is dropped without emitting. Imperative
|
|
74
|
+
* `startEditing*` calls no-op. Useful for consumers that need to gate
|
|
75
|
+
* editing on a permission or a broader "actions disabled" state.
|
|
76
|
+
*/
|
|
77
|
+
protected _disabled: boolean;
|
|
78
|
+
set disabled(v: boolean);
|
|
79
|
+
get disabled(): boolean;
|
|
67
80
|
titleChange: EventEmitter<string>;
|
|
68
81
|
descriptionChange: EventEmitter<string>;
|
|
69
82
|
private titleInputRef?;
|
|
@@ -73,12 +86,33 @@ export declare class EditableHeadingComponent {
|
|
|
73
86
|
protected draftDescription: string;
|
|
74
87
|
constructor(cdr: ChangeDetectorRef, host: ElementRef<HTMLElement>);
|
|
75
88
|
get isEditing(): boolean;
|
|
76
|
-
|
|
77
|
-
|
|
89
|
+
/**
|
|
90
|
+
* Enter title-edit mode programmatically. Same behavior as clicking the
|
|
91
|
+
* title — populates the edit buffer from the current value, focuses the
|
|
92
|
+
* input with the caret at the end, and hides the actions slot. No-op if
|
|
93
|
+
* already in an editing mode or when the component is disabled.
|
|
94
|
+
*
|
|
95
|
+
* Intended for consumers that offer a secondary entry point to renaming
|
|
96
|
+
* (e.g. a kebab menu item), or that want to auto-open rename after
|
|
97
|
+
* creating a new entity. Bind via `@ViewChild(EditableHeadingComponent)`.
|
|
98
|
+
*/
|
|
99
|
+
startEditingTitle(): void;
|
|
100
|
+
/**
|
|
101
|
+
* Enter description-edit mode programmatically. Same behavior as clicking
|
|
102
|
+
* the description (or the "+ Add description" button). No-op if already
|
|
103
|
+
* in an editing mode or when the component is disabled.
|
|
104
|
+
*/
|
|
105
|
+
startEditingDescription(): void;
|
|
78
106
|
protected commitTitle(): void;
|
|
79
107
|
protected commitDescription(): void;
|
|
108
|
+
/**
|
|
109
|
+
* Abandon the current edit and return to view mode. No change is emitted.
|
|
110
|
+
* Wired to the Escape key on both edit inputs; also called internally
|
|
111
|
+
* when `disabled` flips to true mid-edit.
|
|
112
|
+
*/
|
|
113
|
+
protected cancel(): void;
|
|
80
114
|
protected onDocumentMouseDown(target: EventTarget | null): void;
|
|
81
115
|
private focusEnd;
|
|
82
116
|
static ɵfac: i0.ɵɵFactoryDeclaration<EditableHeadingComponent, never>;
|
|
83
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<EditableHeadingComponent, "riv-editable-heading", never, { "title": "title"; "description": "description"; "titleMaxLength": "titleMaxLength"; "descriptionMaxLength": "descriptionMaxLength"; }, { "titleChange": "titleChange"; "descriptionChange": "descriptionChange"; }, never, ["[actions]"], false, never>;
|
|
117
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<EditableHeadingComponent, "riv-editable-heading", never, { "title": "title"; "description": "description"; "titleMaxLength": "titleMaxLength"; "descriptionMaxLength": "descriptionMaxLength"; "disabled": "disabled"; }, { "titleChange": "titleChange"; "descriptionChange": "descriptionChange"; }, never, ["[actions]"], false, never>;
|
|
84
118
|
}
|