@sdcorejs/angular 19.2.10 → 19.2.12
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/components/avatar/src/avatar.component.d.ts +2 -0
- package/components/button/index.d.ts +2 -0
- package/components/button/src/action-popover.d.ts +22 -0
- package/components/button/src/button-item-divider.component.d.ts +10 -0
- package/components/button/src/button-item.component.d.ts +20 -0
- package/components/button/src/button.component.d.ts +18 -3
- package/components/stepper/src/stepper.component.d.ts +2 -0
- package/components/table/src/components/command/desktop-command.component.d.ts +0 -1
- package/components/tree/src/tree.component.d.ts +12 -1
- package/components/tree/src/tree.model.d.ts +1 -0
- package/fesm2022/sdcorejs-angular-components-api-contract-builder.mjs +4 -4
- package/fesm2022/sdcorejs-angular-components-api-contract-builder.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-avatar.mjs +5 -3
- package/fesm2022/sdcorejs-angular-components-avatar.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-button.mjs +289 -7
- package/fesm2022/sdcorejs-angular-components-button.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-data-state.mjs +1 -1
- package/fesm2022/sdcorejs-angular-components-data-state.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-form-generic.mjs +13 -13
- package/fesm2022/sdcorejs-angular-components-form-generic.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-import-excel.mjs +1 -1
- package/fesm2022/sdcorejs-angular-components-import-excel.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-inform.mjs +1 -1
- package/fesm2022/sdcorejs-angular-components-inform.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-query-bar.mjs +1 -1
- package/fesm2022/sdcorejs-angular-components-query-bar.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-stepper.mjs +14 -2
- package/fesm2022/sdcorejs-angular-components-stepper.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-tab.mjs +3 -3
- package/fesm2022/sdcorejs-angular-components-tab.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-table.mjs +21 -90
- package/fesm2022/sdcorejs-angular-components-table.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-tree.mjs +32 -14
- package/fesm2022/sdcorejs-angular-components-tree.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-upload-file.mjs +1 -1
- package/fesm2022/sdcorejs-angular-components-upload-file.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-checkbox.mjs +4 -2
- package/fesm2022/sdcorejs-angular-forms-checkbox.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-tree-select.mjs +1 -1
- package/fesm2022/sdcorejs-angular-forms-tree-select.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-modules-layout.mjs +2 -2
- package/fesm2022/sdcorejs-angular-modules-layout.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-services-confirm.mjs +1 -1
- package/fesm2022/sdcorejs-angular-services-confirm.mjs.map +1 -1
- package/forms/checkbox/src/checkbox.component.d.ts +3 -2
- package/package.json +1 -1
- package/components/table/src/components/action-menu/action-menu.d.ts +0 -10
|
@@ -11,7 +11,9 @@ export declare class SdAvatar {
|
|
|
11
11
|
readonly size: import("@angular/core").InputSignal<number>;
|
|
12
12
|
constructor();
|
|
13
13
|
readonly isUrl: import("@angular/core").Signal<boolean>;
|
|
14
|
+
readonly baseColor: import("@angular/core").Signal<string>;
|
|
14
15
|
readonly bgColor: import("@angular/core").Signal<string>;
|
|
16
|
+
readonly textColor: import("@angular/core").Signal<string>;
|
|
15
17
|
readonly initials: import("@angular/core").Signal<string>;
|
|
16
18
|
handleError(): void;
|
|
17
19
|
static ɵfac: i0.ɵɵFactoryDeclaration<SdAvatar, never>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { InjectionToken, TemplateRef } from '@angular/core';
|
|
2
|
+
import type { SdButtonItem } from './button-item.component';
|
|
3
|
+
import type { SdButtonItemDivider } from './button-item-divider.component';
|
|
4
|
+
export declare const SD_BUTTON_ENTRY: InjectionToken<SdButtonItem | SdButtonItemDivider>;
|
|
5
|
+
/** Component-local overlay owner; deliberately independent of action data and callbacks. */
|
|
6
|
+
export declare class SdActionPopover {
|
|
7
|
+
#private;
|
|
8
|
+
readonly id: string;
|
|
9
|
+
readonly opened: import("@angular/core").WritableSignal<boolean>;
|
|
10
|
+
constructor();
|
|
11
|
+
open(template: TemplateRef<unknown>, trigger: HTMLButtonElement, last?: boolean, hover?: boolean): void;
|
|
12
|
+
cancelHoverClose(): void;
|
|
13
|
+
scheduleHoverClose(): void;
|
|
14
|
+
retainForKeyboard(): void;
|
|
15
|
+
disableHover(): void;
|
|
16
|
+
close(restore?: boolean): void;
|
|
17
|
+
private items;
|
|
18
|
+
private focus;
|
|
19
|
+
/** Run after rendering so removed/disabled definitions cannot leave focus on a stale item. */
|
|
20
|
+
reconcile(trigger: HTMLButtonElement | undefined): void;
|
|
21
|
+
keydown(event: KeyboardEvent): void;
|
|
22
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ElementRef } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class SdButtonItemDivider {
|
|
4
|
+
readonly element: ElementRef<HTMLElement>;
|
|
5
|
+
readonly kind = "divider";
|
|
6
|
+
/** Optional group heading for flattened action groups. */
|
|
7
|
+
readonly title: import("@angular/core").InputSignal<string | null | undefined>;
|
|
8
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SdButtonItemDivider, never>;
|
|
9
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SdButtonItemDivider, "sd-button-item-divider", never, { "title": { "alias": "title"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ElementRef, TemplateRef } from '@angular/core';
|
|
2
|
+
import type { SdIconSet } from '@sdcorejs/angular/modules/icon';
|
|
3
|
+
import type { SdButtonColor } from './button.component';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
/** Declarative action definition. Its label is instantiated only inside the owning button's overlay. */
|
|
6
|
+
export declare class SdButtonItem {
|
|
7
|
+
readonly element: ElementRef<HTMLElement>;
|
|
8
|
+
readonly kind = "item";
|
|
9
|
+
readonly color: import("@angular/core").InputSignal<SdButtonColor | null | undefined>;
|
|
10
|
+
readonly prefixIcon: import("@angular/core").InputSignal<string | null | undefined>;
|
|
11
|
+
readonly suffixIcon: import("@angular/core").InputSignal<string | null | undefined>;
|
|
12
|
+
readonly fontSet: import("@angular/core").InputSignalWithTransform<SdIconSet | undefined, SdIconSet | null | undefined>;
|
|
13
|
+
readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
14
|
+
readonly tooltip: import("@angular/core").InputSignal<string | null | undefined>;
|
|
15
|
+
readonly autoId: import("@angular/core").InputSignal<string | null | undefined>;
|
|
16
|
+
readonly click: import("@angular/core").OutputEmitterRef<Event>;
|
|
17
|
+
readonly template: import("@angular/core").Signal<TemplateRef<any>>;
|
|
18
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SdButtonItem, never>;
|
|
19
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SdButtonItem, "sd-button-item", never, { "color": { "alias": "color"; "required": false; "isSignal": true; }; "prefixIcon": { "alias": "prefixIcon"; "required": false; "isSignal": true; }; "suffixIcon": { "alias": "suffixIcon"; "required": false; "isSignal": true; }; "fontSet": { "alias": "fontSet"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "tooltip": { "alias": "tooltip"; "required": false; "isSignal": true; }; "autoId": { "alias": "autoId"; "required": false; "isSignal": true; }; }, { "click": "click"; }, never, ["*"], true, never>;
|
|
20
|
+
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SdActionPopover } from './action-popover';
|
|
2
|
+
import { SdButtonItem } from './button-item.component';
|
|
3
|
+
import { ElementRef, OnDestroy, OnInit, TemplateRef } from '@angular/core';
|
|
2
4
|
import { Color } from '@sdcorejs/utils/models';
|
|
3
5
|
import { type SdIconSet } from '@sdcorejs/angular/modules/icon';
|
|
4
6
|
import * as i0 from "@angular/core";
|
|
@@ -8,6 +10,18 @@ export type SdButtonHtmlType = 'button' | 'submit' | 'reset';
|
|
|
8
10
|
export type SdButtonColor = Color | 'black';
|
|
9
11
|
export declare class SdButton implements OnInit, OnDestroy {
|
|
10
12
|
#private;
|
|
13
|
+
readonly entries: import("@angular/core").Signal<readonly (SdButtonItem | import("@sdcorejs/angular/components/button").SdButtonItemDivider)[]>;
|
|
14
|
+
readonly hasActions: import("@angular/core").Signal<boolean>;
|
|
15
|
+
readonly trigger: import("@angular/core").Signal<ElementRef<HTMLButtonElement> | undefined>;
|
|
16
|
+
readonly definitions: import("@angular/core").Signal<ElementRef<HTMLElement>>;
|
|
17
|
+
readonly projectedLabel: import("@angular/core").Signal<ElementRef<HTMLElement> | undefined>;
|
|
18
|
+
readonly hasProjectedLabel: import("@angular/core").WritableSignal<boolean>;
|
|
19
|
+
readonly isIconOnly: import("@angular/core").Signal<boolean>;
|
|
20
|
+
readonly menuTemplate: import("@angular/core").Signal<TemplateRef<unknown>>;
|
|
21
|
+
readonly popover: SdActionPopover;
|
|
22
|
+
onTriggerPointerEnter(event: PointerEvent): void;
|
|
23
|
+
onTriggerKeydown(event: KeyboardEvent): void;
|
|
24
|
+
activateItem(item: SdButtonItem, event: Event): void;
|
|
11
25
|
private el;
|
|
12
26
|
autoIdInput: import("@angular/core").InputSignal<string | null | undefined>;
|
|
13
27
|
type: import("@angular/core").InputSignalWithTransform<SdButtonType, SdButtonType | null | undefined>;
|
|
@@ -20,12 +34,13 @@ export declare class SdButton implements OnInit, OnDestroy {
|
|
|
20
34
|
prefixIcon: import("@angular/core").InputSignal<string | null | undefined>;
|
|
21
35
|
suffixIcon: import("@angular/core").InputSignal<string | null | undefined>;
|
|
22
36
|
disabled: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
37
|
+
readonly openOnHover: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
23
38
|
loading: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
24
39
|
block: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
25
40
|
htmlType: import("@angular/core").InputSignalWithTransform<SdButtonHtmlType, SdButtonHtmlType | null | undefined>;
|
|
26
41
|
autoId: import("@angular/core").Signal<string | undefined>;
|
|
27
42
|
buttonClasses: import("@angular/core").Signal<{
|
|
28
|
-
'c-square': boolean
|
|
43
|
+
'c-square': boolean;
|
|
29
44
|
'c-sm': boolean;
|
|
30
45
|
'c-md': boolean;
|
|
31
46
|
'c-lg': boolean;
|
|
@@ -39,5 +54,5 @@ export declare class SdButton implements OnInit, OnDestroy {
|
|
|
39
54
|
onInternalClick(event: Event): void;
|
|
40
55
|
ngOnDestroy(): void;
|
|
41
56
|
static ɵfac: i0.ɵɵFactoryDeclaration<SdButton, never>;
|
|
42
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<SdButton, "sd-button", never, { "autoIdInput": { "alias": "autoId"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; "color": { "alias": "color"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "fontSet": { "alias": "fontSet"; "required": false; "isSignal": true; }; "title": { "alias": "title"; "required": false; "isSignal": true; }; "width": { "alias": "width"; "required": false; "isSignal": true; }; "tooltip": { "alias": "tooltip"; "required": false; "isSignal": true; }; "prefixIcon": { "alias": "prefixIcon"; "required": false; "isSignal": true; }; "suffixIcon": { "alias": "suffixIcon"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "block": { "alias": "block"; "required": false; "isSignal": true; }; "htmlType": { "alias": "htmlType"; "required": false; "isSignal": true; }; }, { "click": "click"; },
|
|
57
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SdButton, "sd-button", never, { "autoIdInput": { "alias": "autoId"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; "color": { "alias": "color"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "fontSet": { "alias": "fontSet"; "required": false; "isSignal": true; }; "title": { "alias": "title"; "required": false; "isSignal": true; }; "width": { "alias": "width"; "required": false; "isSignal": true; }; "tooltip": { "alias": "tooltip"; "required": false; "isSignal": true; }; "prefixIcon": { "alias": "prefixIcon"; "required": false; "isSignal": true; }; "suffixIcon": { "alias": "suffixIcon"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "openOnHover": { "alias": "openOnHover"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "block": { "alias": "block"; "required": false; "isSignal": true; }; "htmlType": { "alias": "htmlType"; "required": false; "isSignal": true; }; }, { "click": "click"; }, ["entries"], ["*"], true, never>;
|
|
43
58
|
}
|
|
@@ -19,6 +19,8 @@ export declare class SdStepper {
|
|
|
19
19
|
get autoIdAttr(): string | null;
|
|
20
20
|
get cssActive(): string;
|
|
21
21
|
get cssActiveBg(): string;
|
|
22
|
+
get cssActiveContrast(): string;
|
|
23
|
+
get cssCompletedBg(): string;
|
|
22
24
|
get cssCompleted(): string;
|
|
23
25
|
get cssLine(): string;
|
|
24
26
|
constructor();
|
|
@@ -2,7 +2,6 @@ import { SdTableCommand } from '../../models/table-command.model';
|
|
|
2
2
|
import { SdTableItem } from '../../models/table-item.model';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
export declare class DesktopCommand {
|
|
5
|
-
readonly menuPositions: import("@angular/cdk/overlay").ConnectedPosition[];
|
|
6
5
|
readonly autoIdInput: import("@angular/core").InputSignal<string | null | undefined>;
|
|
7
6
|
readonly item: import("@angular/core").InputSignal<SdTableItem<any>>;
|
|
8
7
|
readonly itemIndex: import("@angular/core").InputSignal<number>;
|
|
@@ -50,6 +50,7 @@ export declare class SdTree<T = unknown> {
|
|
|
50
50
|
readonly selectedItemsInput: import("@angular/core").InputSignal<T[] | null | undefined>;
|
|
51
51
|
readonly commands: import("@angular/core").InputSignal<SdTreeCommand<T>[] | null | undefined>;
|
|
52
52
|
readonly selectable: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
53
|
+
readonly showLines: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
53
54
|
readonly selector: import("@angular/core").InputSignal<SdTreeSelectorOption<T> | null | undefined>;
|
|
54
55
|
readonly itemTemplate: import("@angular/core").InputSignal<TemplateRef<SdTreeItemContext<T>> | null | undefined>;
|
|
55
56
|
readonly selectedItemsChange: import("@angular/core").OutputEmitterRef<T[]>;
|
|
@@ -63,6 +64,7 @@ export declare class SdTree<T = unknown> {
|
|
|
63
64
|
readonly resolvedSelector: import("@angular/core").Signal<SdTreeSelectorOption<T> | null | undefined>;
|
|
64
65
|
readonly resolvedCommands: import("@angular/core").Signal<SdTreeCommand<T>[]>;
|
|
65
66
|
readonly resolvedSelectable: import("@angular/core").Signal<boolean>;
|
|
67
|
+
readonly resolvedShowLines: import("@angular/core").Signal<boolean>;
|
|
66
68
|
readonly autoId: import("@angular/core").Signal<string | undefined>;
|
|
67
69
|
readonly resolvedItemTemplate: import("@angular/core").Signal<TemplateRef<SdTreeItemContext<T>> | undefined>;
|
|
68
70
|
readonly indentSize: import("@angular/core").Signal<number>;
|
|
@@ -81,6 +83,15 @@ export declare class SdTree<T = unknown> {
|
|
|
81
83
|
readonly rootNodes: import("@angular/core").Signal<SdTreeNode<T>[]>;
|
|
82
84
|
readonly visibleNodes: import("@angular/core").Signal<SdTreeNode<T>[]>;
|
|
83
85
|
readonly selectedItems: import("@angular/core").Signal<T[]>;
|
|
86
|
+
/** Use visible siblings so filtering and collapsed/lazy branches leave no dangling connectors. */
|
|
87
|
+
readonly treeLines: import("@angular/core").Signal<Map<string, {
|
|
88
|
+
children: boolean;
|
|
89
|
+
segments: {
|
|
90
|
+
level: number;
|
|
91
|
+
branch: boolean;
|
|
92
|
+
last: boolean;
|
|
93
|
+
}[];
|
|
94
|
+
}>>;
|
|
84
95
|
readonly selectedCount: import("@angular/core").Signal<number>;
|
|
85
96
|
readonly selectionMessage: import("@angular/core").Signal<string>;
|
|
86
97
|
readonly visibleSelectionActions: import("@angular/core").Signal<SdTreeSelectionAction<T>[]>;
|
|
@@ -121,5 +132,5 @@ export declare class SdTree<T = unknown> {
|
|
|
121
132
|
nodeAutoId(node: SdTreeNode<T>, part: SdTreeAutoIdPart): string | undefined;
|
|
122
133
|
commandAutoId(node: SdTreeNode<T>, command: SdTreeCommand<T>): string | undefined;
|
|
123
134
|
static ɵfac: i0.ɵɵFactoryDeclaration<SdTree<any>, never>;
|
|
124
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<SdTree<any>, "sd-tree", never, { "autoIdInput": { "alias": "autoId"; "required": false; "isSignal": true; }; "option": { "alias": "option"; "required": false; "isSignal": true; }; "items": { "alias": "items"; "required": false; "isSignal": true; }; "tree": { "alias": "tree"; "required": false; "isSignal": true; }; "selectedItemsInput": { "alias": "selectedItems"; "required": false; "isSignal": true; }; "commands": { "alias": "commands"; "required": false; "isSignal": true; }; "selectable": { "alias": "selectable"; "required": false; "isSignal": true; }; "selector": { "alias": "selector"; "required": false; "isSignal": true; }; "itemTemplate": { "alias": "itemTemplate"; "required": false; "isSignal": true; }; }, { "selectedItemsChange": "selectedItemsChange"; "selectChange": "selectChange"; "expandChange": "expandChange"; "collapseChange": "collapseChange"; "loadError": "loadError"; }, ["itemDef"], never, true, never>;
|
|
135
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SdTree<any>, "sd-tree", never, { "autoIdInput": { "alias": "autoId"; "required": false; "isSignal": true; }; "option": { "alias": "option"; "required": false; "isSignal": true; }; "items": { "alias": "items"; "required": false; "isSignal": true; }; "tree": { "alias": "tree"; "required": false; "isSignal": true; }; "selectedItemsInput": { "alias": "selectedItems"; "required": false; "isSignal": true; }; "commands": { "alias": "commands"; "required": false; "isSignal": true; }; "selectable": { "alias": "selectable"; "required": false; "isSignal": true; }; "showLines": { "alias": "showLines"; "required": false; "isSignal": true; }; "selector": { "alias": "selector"; "required": false; "isSignal": true; }; "itemTemplate": { "alias": "itemTemplate"; "required": false; "isSignal": true; }; }, { "selectedItemsChange": "selectedItemsChange"; "selectChange": "selectChange"; "expandChange": "expandChange"; "collapseChange": "collapseChange"; "loadError": "loadError"; }, ["itemDef"], never, true, never>;
|
|
125
136
|
}
|
|
@@ -93,6 +93,7 @@ export interface SdTreeComponentOptionBase<T = unknown, TItem extends SdTreeItem
|
|
|
93
93
|
commands?: SdTreeCommand<T>[] | null;
|
|
94
94
|
itemTemplate?: SdTreeItemTemplate<T> | null;
|
|
95
95
|
selectable?: boolean;
|
|
96
|
+
showLines?: boolean;
|
|
96
97
|
onSelectedItemsChange?: (items: T[]) => void;
|
|
97
98
|
onSelect?: (event: SdTreeSelectionEvent<T>) => void;
|
|
98
99
|
onExpand?: (event: SdTreeToggleEvent<T>) => void;
|
|
@@ -2538,7 +2538,7 @@ class SdApiContractNodeDrawer {
|
|
|
2538
2538
|
[title]="'core.component.api-contract-builder.drawer.save' | sdTranslate"
|
|
2539
2539
|
(click)="save()"></sd-button>
|
|
2540
2540
|
</sd-side-drawer>
|
|
2541
|
-
`, isInline: true, styles: [".sd-acb-drawer{display:flex;flex-direction:column;gap:12px;padding:16px}.sd-acb-drawer__crumbs{display:flex;flex-wrap:wrap;gap:4px;align-items:center;font-size:12px}.sd-acb-drawer__crumb{padding:2px 4px;border:0;border-radius:4px;background:transparent;color:var(--sd-primary, #005cbb);font:inherit;cursor:pointer}.sd-acb-drawer__crumb:hover{background:color-mix(in srgb,var(--sd-primary, #005cbb) 10%,transparent)}.sd-acb-drawer__crumb--current{color:var(--sd-text, #1a1b1f);font-weight:600;cursor:default}.sd-acb-drawer__crumb-sep{color:var(--sd-text-secondary, #6b6b6b)}.sd-acb-drawer__children{display:flex;flex-direction:column;gap:6px;padding-top:4px;border-top:1px solid var(--sd-border-color, #e6e6e6)}.sd-acb-drawer__children-title{margin:0;font-size:12px;text-transform:uppercase;letter-spacing:.04em;color:var(--sd-text-secondary, #6b6b6b)}.sd-acb-drawer__empty{margin:0;font-size:12px;font-style:italic;color:var(--sd-text-secondary, #6b6b6b)}.sd-acb-drawer__confirm{display:flex;flex-wrap:wrap;gap:8px;align-items:center;padding:8px 10px;border:1px dashed var(--sd-border-color, #e6e6e6);border-radius:6px;background:var(--sd-surface-muted, #f3f5f8);font-size:12px}\n"], dependencies: [{ kind: "component", type: SdSideDrawer, selector: "sd-side-drawer", inputs: ["title", "width", "hideClose", "disableBackdropClose", "beforeClose", "drawerClass", "autoId"], outputs: ["sdClosed", "sdCloseError"] }, { kind: "component", type: SdButton, selector: "sd-button", inputs: ["autoId", "type", "color", "size", "fontSet", "title", "width", "tooltip", "prefixIcon", "suffixIcon", "disabled", "loading", "block", "htmlType"], outputs: ["click"] }, { kind: "component", type: SdInput, selector: "sd-input", inputs: ["autoId", "name", "appearance", "floatLabel", "size", "form", "label", "helperText", "placeholder", "type", "mask", "hideInlineError", "blurOnEnter", "clearable", "required", "readonly", "disabled", "viewed", "minlength", "maxlength", "pattern", "patternErrorMessage", "validator", "inlineError", "hyperlink", "model"], outputs: ["modelChange", "sdChange", "sdFocus", "sdBlur", "keyupEnter", "cleared", "sdFocusForceBlur"] }, { kind: "component", type: SdSelect, selector: "sd-select", inputs: ["autoId", "name", "size", "form", "label", "helperText", "placeholder", "valueField", "displayField", "disabledField", "cacheChecksum", "limit", "hyperlink", "minWidthPanel", "hideInlineError", "hideReadError", "required", "disabled", "viewed", "multiple", "showSelectAll", "clearable", "validator", "inlineError", "appearance", "floatLabel", "items", "model"], outputs: ["sdReadStateChange", "modelChange", "sdChange", "sdSelection"] }, { kind: "component", type: SdApiContractNodeSummary, selector: "sd-api-contract-node-summary", inputs: ["name", "node", "readonly", "autoId"], outputs: ["edit", "remove"] }, { kind: "component", type: SdApiContractSourceEditor, selector: "sd-api-contract-source-editor", inputs: ["node", "suggestions", "disabled", "autoId"], outputs: ["nodeChange"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2541
|
+
`, isInline: true, styles: [".sd-acb-drawer{display:flex;flex-direction:column;gap:12px;padding:16px}.sd-acb-drawer__crumbs{display:flex;flex-wrap:wrap;gap:4px;align-items:center;font-size:12px}.sd-acb-drawer__crumb{padding:2px 4px;border:0;border-radius:4px;background:transparent;color:var(--sd-primary, #005cbb);font:inherit;cursor:pointer}.sd-acb-drawer__crumb:hover{background:color-mix(in srgb,var(--sd-primary, #005cbb) 10%,transparent)}.sd-acb-drawer__crumb--current{color:var(--sd-text, #1a1b1f);font-weight:600;cursor:default}.sd-acb-drawer__crumb-sep{color:var(--sd-text-secondary, #6b6b6b)}.sd-acb-drawer__children{display:flex;flex-direction:column;gap:6px;padding-top:4px;border-top:1px solid var(--sd-border-color, #e6e6e6)}.sd-acb-drawer__children-title{margin:0;font-size:12px;text-transform:uppercase;letter-spacing:.04em;color:var(--sd-text-secondary, #6b6b6b)}.sd-acb-drawer__empty{margin:0;font-size:12px;font-style:italic;color:var(--sd-text-secondary, #6b6b6b)}.sd-acb-drawer__confirm{display:flex;flex-wrap:wrap;gap:8px;align-items:center;padding:8px 10px;border:1px dashed var(--sd-border-color, #e6e6e6);border-radius:6px;background:var(--sd-surface-muted, #f3f5f8);font-size:12px}\n"], dependencies: [{ kind: "component", type: SdSideDrawer, selector: "sd-side-drawer", inputs: ["title", "width", "hideClose", "disableBackdropClose", "beforeClose", "drawerClass", "autoId"], outputs: ["sdClosed", "sdCloseError"] }, { kind: "component", type: SdButton, selector: "sd-button", inputs: ["autoId", "type", "color", "size", "fontSet", "title", "width", "tooltip", "prefixIcon", "suffixIcon", "disabled", "openOnHover", "loading", "block", "htmlType"], outputs: ["click"] }, { kind: "component", type: SdInput, selector: "sd-input", inputs: ["autoId", "name", "appearance", "floatLabel", "size", "form", "label", "helperText", "placeholder", "type", "mask", "hideInlineError", "blurOnEnter", "clearable", "required", "readonly", "disabled", "viewed", "minlength", "maxlength", "pattern", "patternErrorMessage", "validator", "inlineError", "hyperlink", "model"], outputs: ["modelChange", "sdChange", "sdFocus", "sdBlur", "keyupEnter", "cleared", "sdFocusForceBlur"] }, { kind: "component", type: SdSelect, selector: "sd-select", inputs: ["autoId", "name", "size", "form", "label", "helperText", "placeholder", "valueField", "displayField", "disabledField", "cacheChecksum", "limit", "hyperlink", "minWidthPanel", "hideInlineError", "hideReadError", "required", "disabled", "viewed", "multiple", "showSelectAll", "clearable", "validator", "inlineError", "appearance", "floatLabel", "items", "model"], outputs: ["sdReadStateChange", "modelChange", "sdChange", "sdSelection"] }, { kind: "component", type: SdApiContractNodeSummary, selector: "sd-api-contract-node-summary", inputs: ["name", "node", "readonly", "autoId"], outputs: ["edit", "remove"] }, { kind: "component", type: SdApiContractSourceEditor, selector: "sd-api-contract-source-editor", inputs: ["node", "suggestions", "disabled", "autoId"], outputs: ["nodeChange"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2542
2542
|
}
|
|
2543
2543
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: SdApiContractNodeDrawer, decorators: [{
|
|
2544
2544
|
type: Component,
|
|
@@ -2780,7 +2780,7 @@ class SdApiContractNodeEditor {
|
|
|
2780
2780
|
this.nodeChange.emit(setSdApiContractNodeAt(this.node(), this.#containerPointer(), stripped));
|
|
2781
2781
|
}
|
|
2782
2782
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: SdApiContractNodeEditor, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2783
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.21", type: SdApiContractNodeEditor, isStandalone: true, selector: "sd-api-contract-node-editor", inputs: { node: { classPropertyName: "node", publicName: "node", isSignal: true, isRequired: true, transformFunction: null }, basePath: { classPropertyName: "basePath", publicName: "basePath", isSignal: true, isRequired: true, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, autoId: { classPropertyName: "autoId", publicName: "autoId", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { nodeChange: "nodeChange", editRequest: "editRequest" }, ngImport: i0, template: "@let _entries = entries();\n@let _disabled = disabled();\n@let _autoId = autoId();\n\n<div class=\"sd-acb-list\">\n @if (!_entries.length) {\n <p class=\"sd-acb-list__empty\">{{ 'core.component.api-contract-builder.node.empty' | sdTranslate }}</p>\n }\n\n @for (entry of _entries; track entry.key) {\n <sd-api-contract-node-summary\n [name]=\"entry.key\"\n [node]=\"entry.node\"\n [readonly]=\"_disabled\"\n [autoId]=\"_autoId ? _autoId + '-' + entry.key : undefined\"\n (edit)=\"requestEdit(entry.key, entry.node)\"\n (remove)=\"removeProperty(entry.key)\"></sd-api-contract-node-summary>\n }\n\n @if (!_disabled) {\n <sd-button\n class=\"sd-acb-list__add\"\n type=\"light\"\n size=\"sm\"\n prefixIcon=\"add\"\n [autoId]=\"_autoId ? _autoId + '-add' : undefined\"\n [title]=\"'core.component.api-contract-builder.node.add-property' | sdTranslate\"\n (click)=\"requestAdd()\"></sd-button>\n }\n</div>\n", styles: [":host{display:block;width:100%}.sd-acb-list{display:flex;flex-direction:column;gap:6px}.sd-acb-list__empty{margin:0;font-size:12px;font-style:italic;color:var(--sd-text-secondary, #6b6b6b)}.sd-acb-list__add{align-self:flex-start}\n"], dependencies: [{ kind: "component", type: SdButton, selector: "sd-button", inputs: ["autoId", "type", "color", "size", "fontSet", "title", "width", "tooltip", "prefixIcon", "suffixIcon", "disabled", "loading", "block", "htmlType"], outputs: ["click"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }, { kind: "component", type: SdApiContractNodeSummary, selector: "sd-api-contract-node-summary", inputs: ["name", "node", "readonly", "autoId"], outputs: ["edit", "remove"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2783
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.21", type: SdApiContractNodeEditor, isStandalone: true, selector: "sd-api-contract-node-editor", inputs: { node: { classPropertyName: "node", publicName: "node", isSignal: true, isRequired: true, transformFunction: null }, basePath: { classPropertyName: "basePath", publicName: "basePath", isSignal: true, isRequired: true, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, autoId: { classPropertyName: "autoId", publicName: "autoId", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { nodeChange: "nodeChange", editRequest: "editRequest" }, ngImport: i0, template: "@let _entries = entries();\n@let _disabled = disabled();\n@let _autoId = autoId();\n\n<div class=\"sd-acb-list\">\n @if (!_entries.length) {\n <p class=\"sd-acb-list__empty\">{{ 'core.component.api-contract-builder.node.empty' | sdTranslate }}</p>\n }\n\n @for (entry of _entries; track entry.key) {\n <sd-api-contract-node-summary\n [name]=\"entry.key\"\n [node]=\"entry.node\"\n [readonly]=\"_disabled\"\n [autoId]=\"_autoId ? _autoId + '-' + entry.key : undefined\"\n (edit)=\"requestEdit(entry.key, entry.node)\"\n (remove)=\"removeProperty(entry.key)\"></sd-api-contract-node-summary>\n }\n\n @if (!_disabled) {\n <sd-button\n class=\"sd-acb-list__add\"\n type=\"light\"\n size=\"sm\"\n prefixIcon=\"add\"\n [autoId]=\"_autoId ? _autoId + '-add' : undefined\"\n [title]=\"'core.component.api-contract-builder.node.add-property' | sdTranslate\"\n (click)=\"requestAdd()\"></sd-button>\n }\n</div>\n", styles: [":host{display:block;width:100%}.sd-acb-list{display:flex;flex-direction:column;gap:6px}.sd-acb-list__empty{margin:0;font-size:12px;font-style:italic;color:var(--sd-text-secondary, #6b6b6b)}.sd-acb-list__add{align-self:flex-start}\n"], dependencies: [{ kind: "component", type: SdButton, selector: "sd-button", inputs: ["autoId", "type", "color", "size", "fontSet", "title", "width", "tooltip", "prefixIcon", "suffixIcon", "disabled", "openOnHover", "loading", "block", "htmlType"], outputs: ["click"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }, { kind: "component", type: SdApiContractNodeSummary, selector: "sd-api-contract-node-summary", inputs: ["name", "node", "readonly", "autoId"], outputs: ["edit", "remove"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2784
2784
|
}
|
|
2785
2785
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: SdApiContractNodeEditor, decorators: [{
|
|
2786
2786
|
type: Component,
|
|
@@ -2857,7 +2857,7 @@ class SdApiContractRecordEditor {
|
|
|
2857
2857
|
(click)="requestAdd()"></sd-button>
|
|
2858
2858
|
}
|
|
2859
2859
|
</div>
|
|
2860
|
-
`, isInline: true, styles: [":host{display:block;width:100%}.sd-acb-record{display:flex;flex-direction:column;gap:6px}.sd-acb-record__empty{margin:0;font-size:12px;font-style:italic;color:var(--sd-text-secondary, #6b6b6b)}.sd-acb-record__add{align-self:flex-start}\n"], dependencies: [{ kind: "component", type: SdButton, selector: "sd-button", inputs: ["autoId", "type", "color", "size", "fontSet", "title", "width", "tooltip", "prefixIcon", "suffixIcon", "disabled", "loading", "block", "htmlType"], outputs: ["click"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }, { kind: "component", type: SdApiContractNodeSummary, selector: "sd-api-contract-node-summary", inputs: ["name", "node", "readonly", "autoId"], outputs: ["edit", "remove"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2860
|
+
`, isInline: true, styles: [":host{display:block;width:100%}.sd-acb-record{display:flex;flex-direction:column;gap:6px}.sd-acb-record__empty{margin:0;font-size:12px;font-style:italic;color:var(--sd-text-secondary, #6b6b6b)}.sd-acb-record__add{align-self:flex-start}\n"], dependencies: [{ kind: "component", type: SdButton, selector: "sd-button", inputs: ["autoId", "type", "color", "size", "fontSet", "title", "width", "tooltip", "prefixIcon", "suffixIcon", "disabled", "openOnHover", "loading", "block", "htmlType"], outputs: ["click"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }, { kind: "component", type: SdApiContractNodeSummary, selector: "sd-api-contract-node-summary", inputs: ["name", "node", "readonly", "autoId"], outputs: ["edit", "remove"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2861
2861
|
}
|
|
2862
2862
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: SdApiContractRecordEditor, decorators: [{
|
|
2863
2863
|
type: Component,
|
|
@@ -3322,7 +3322,7 @@ class SdApiContractBuilder {
|
|
|
3322
3322
|
this.model.set(next);
|
|
3323
3323
|
}
|
|
3324
3324
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: SdApiContractBuilder, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3325
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.21", type: SdApiContractBuilder, isStandalone: true, selector: "sd-api-contract-builder", inputs: { model: { classPropertyName: "model", publicName: "model", isSignal: true, isRequired: false, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, autoId: { classPropertyName: "autoId", publicName: "autoId", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { model: "modelChange", diagnosticsChange: "diagnosticsChange", validChange: "validChange" }, host: { properties: { "attr.data-autoId": "this.autoIdAttr" } }, viewQueries: [{ propertyName: "nodeDrawer", first: true, predicate: ["nodeDrawer"], descendants: true, isSignal: true }], ngImport: i0, template: "@let _draft = draft();\n@let _readonly = readonly();\n@let _autoId = autoId();\n@let _diagnostics = diagnostics();\n@let _activeStep = activeStep();\n@let _requestSuggestions = requestSuggestions();\n@let _responseFieldOptions = responseFieldOptions();\n\n<!-- why: contract t\u1EEB ngo\u00E0i c\u00F3 th\u1EC3 thi\u1EBFu h\u1EB3n m\u1ED9t t\u1EA7ng. M\u1ECDi nh\u00E1nh \u0111\u1ECDc `_draft.<section>` \u0111\u1EC1u ph\u1EA3i\n g\u00E1c \u2014 builder hi\u1EC3n th\u1ECB contract sai k\u00E8m ch\u1EA9n \u0111o\u00E1n ch\u1EE9 kh\u00F4ng t\u1EF1 v\u00E1, v\u00E0 c\u0169ng kh\u00F4ng \u0111\u01B0\u1EE3c n\u1ED5. -->\n@if (!_draft) {\n <div class=\"sd-acb__empty\">\n <sd-icon name=\"description\" size=\"lg\"></sd-icon>\n <p>{{ 'core.component.api-contract-builder.empty.contract' | sdTranslate }}</p>\n @if (!_readonly) {\n <sd-button\n type=\"fill\"\n color=\"primary\"\n size=\"sm\"\n prefixIcon=\"add\"\n [autoId]=\"_autoId ? _autoId + '-create' : undefined\"\n [title]=\"'core.component.api-contract-builder.create-contract' | sdTranslate\"\n (click)=\"createContract()\"></sd-button>\n }\n </div>\n} @else if (isView()) {\n <section class=\"sd-acb__view\">\n <dl class=\"sd-acb__summary\">\n <dt>{{ 'core.component.api-contract-builder.contract.code' | sdTranslate }}</dt>\n <dd data-field=\"code\">{{ _draft.code }}</dd>\n <dt>{{ 'core.component.api-contract-builder.contract.name' | sdTranslate }}</dt>\n <dd data-field=\"name\">{{ _draft.name }}</dd>\n <dt>{{ 'core.component.api-contract-builder.request.method' | sdTranslate }}</dt>\n <dd data-field=\"method\">{{ _draft.req?.method }}</dd>\n <dt>{{ 'core.component.api-contract-builder.request.url' | sdTranslate }}</dt>\n <dd data-field=\"url\">{{ _draft.req?.url }}</dd>\n </dl>\n\n <sd-api-contract-diagnostic-list\n [diagnostics]=\"_diagnostics\"\n [autoId]=\"_autoId ? _autoId + '-diagnostics' : undefined\"></sd-api-contract-diagnostic-list>\n\n <sd-code-editor language=\"json\" [viewed]=\"true\" maxHeight=\"420px\" [model]=\"json()\"></sd-code-editor>\n </section>\n} @else {\n <nav class=\"sd-acb__steps\" [attr.aria-label]=\"'core.component.api-contract-builder.steps' | sdTranslate\">\n @for (step of steps; track step.index) {\n <button\n type=\"button\"\n class=\"sd-acb__step\"\n [class.sd-acb__step--active]=\"_activeStep === step.index\"\n [attr.aria-current]=\"_activeStep === step.index ? 'step' : null\"\n [attr.data-autoId]=\"_autoId ? _autoId + '-step-' + step.key : null\"\n (click)=\"goToStep(step.index)\">\n <span class=\"sd-acb__step-index\">{{ step.index + 1 }}</span>\n <span class=\"sd-acb__step-label\">{{ step.label }}</span>\n </button>\n }\n </nav>\n\n <div class=\"sd-acb__body\">\n @switch (_activeStep) {\n @case (0) {\n <section class=\"sd-acb__section\" data-step=\"general\">\n <div class=\"sd-acb__grid\">\n <sd-input\n size=\"sm\"\n hideInlineError\n [autoId]=\"_autoId ? _autoId + '-code' : undefined\"\n [label]=\"'core.component.api-contract-builder.contract.code' | sdTranslate\"\n [model]=\"_draft.code\"\n [disabled]=\"_readonly\"\n (sdChange)=\"setText('code', $event)\"></sd-input>\n <sd-input\n size=\"sm\"\n hideInlineError\n [autoId]=\"_autoId ? _autoId + '-name' : undefined\"\n [label]=\"'core.component.api-contract-builder.contract.name' | sdTranslate\"\n [model]=\"_draft.name\"\n [disabled]=\"_readonly\"\n (sdChange)=\"setText('name', $event)\"></sd-input>\n <sd-input\n size=\"sm\"\n hideInlineError\n [autoId]=\"_autoId ? _autoId + '-description' : undefined\"\n [label]=\"'core.component.api-contract-builder.contract.description' | sdTranslate\"\n [model]=\"_draft.description ?? ''\"\n [disabled]=\"_readonly\"\n (sdChange)=\"setText('description', $event)\"></sd-input>\n <sd-input\n size=\"sm\"\n hideInlineError\n [autoId]=\"_autoId ? _autoId + '-version' : undefined\"\n [label]=\"'core.component.api-contract-builder.contract.version' | sdTranslate\"\n [model]=\"contractVersion\"\n [readonly]=\"true\"\n [disabled]=\"true\"></sd-input>\n </div>\n </section>\n }\n\n @case (1) {\n <section class=\"sd-acb__section\" data-step=\"input\">\n @if (_draft.input?.schema; as _inputSchema) {\n <sd-api-contract-node-editor\n [node]=\"$any(_inputSchema)\"\n basePath=\"input.schema\"\n [disabled]=\"_readonly\"\n [autoId]=\"_autoId ? _autoId + '-input' : undefined\"\n (nodeChange)=\"setInputSchema($event)\"\n (editRequest)=\"openNodeDrawer('input.schema', $event)\"></sd-api-contract-node-editor>\n } @else {\n <p class=\"sd-acb__empty-text\">{{ 'core.component.api-contract-builder.empty.section' | sdTranslate }}</p>\n }\n </section>\n }\n\n @case (2) {\n <section class=\"sd-acb__section\" data-step=\"request\">\n @if (_draft.req; as _req) {\n <div class=\"sd-acb__grid\">\n <sd-select\n size=\"sm\"\n hideInlineError\n [clearable]=\"false\"\n [autoId]=\"_autoId ? _autoId + '-method' : undefined\"\n [label]=\"'core.component.api-contract-builder.request.method' | sdTranslate\"\n [items]=\"methodOptions\"\n valueField=\"value\"\n displayField=\"label\"\n [model]=\"_req.method\"\n [disabled]=\"_readonly\"\n (sdChange)=\"setMethod($event)\"></sd-select>\n <sd-input\n class=\"sd-acb__url\"\n size=\"sm\"\n hideInlineError\n [autoId]=\"_autoId ? _autoId + '-url' : undefined\"\n [label]=\"'core.component.api-contract-builder.request.url' | sdTranslate\"\n [placeholder]=\"urlPlaceholder\"\n [model]=\"_req.url\"\n [disabled]=\"_readonly\"\n (sdChange)=\"setUrl($event)\"></sd-input>\n </div>\n\n <h4 class=\"sd-acb__heading\">{{ 'core.component.api-contract-builder.request.path' | sdTranslate }}</h4>\n <sd-api-contract-record-editor\n [record]=\"$any(_req.path)\"\n basePath=\"req.path\"\n [disabled]=\"_readonly\"\n [emptyLabel]=\"'core.component.api-contract-builder.empty.path' | sdTranslate\"\n [autoId]=\"_autoId ? _autoId + '-path' : undefined\"\n (recordChange)=\"setRequestRecord('path', $event)\"\n (editRequest)=\"openNodeDrawer('req.path', $event)\"></sd-api-contract-record-editor>\n\n <h4 class=\"sd-acb__heading\">{{ 'core.component.api-contract-builder.request.query' | sdTranslate }}</h4>\n <sd-api-contract-record-editor\n [record]=\"$any(_req.query)\"\n basePath=\"req.query\"\n [disabled]=\"_readonly\"\n [emptyLabel]=\"'core.component.api-contract-builder.empty.query' | sdTranslate\"\n [autoId]=\"_autoId ? _autoId + '-query' : undefined\"\n (recordChange)=\"setRequestRecord('query', $event)\"\n (editRequest)=\"openNodeDrawer('req.query', $event)\"></sd-api-contract-record-editor>\n\n <h4 class=\"sd-acb__heading\">{{ 'core.component.api-contract-builder.request.headers' | sdTranslate }}</h4>\n <sd-api-contract-record-editor\n [record]=\"$any(_req.headers)\"\n basePath=\"req.headers\"\n [disabled]=\"_readonly\"\n [emptyLabel]=\"'core.component.api-contract-builder.empty.headers' | sdTranslate\"\n [autoId]=\"_autoId ? _autoId + '-headers' : undefined\"\n (recordChange)=\"setRequestRecord('headers', $event)\"\n (editRequest)=\"openNodeDrawer('req.headers', $event)\"></sd-api-contract-record-editor>\n\n <h4 class=\"sd-acb__heading\">{{ 'core.component.api-contract-builder.request.body' | sdTranslate }}</h4>\n @if (_req.body) {\n <sd-api-contract-node-editor\n [node]=\"$any(_req.body)\"\n basePath=\"req.body\"\n [disabled]=\"_readonly\"\n [autoId]=\"_autoId ? _autoId + '-body' : undefined\"\n (nodeChange)=\"setRequestBody($event)\"\n (editRequest)=\"openNodeDrawer('req.body', $event)\"></sd-api-contract-node-editor>\n @if (!_readonly) {\n <sd-button\n type=\"text\"\n color=\"error\"\n size=\"sm\"\n prefixIcon=\"delete\"\n [autoId]=\"_autoId ? _autoId + '-remove-body' : undefined\"\n [title]=\"'core.component.api-contract-builder.request.remove-body' | sdTranslate\"\n (click)=\"removeRequestBody()\"></sd-button>\n }\n } @else {\n <p class=\"sd-acb__empty-text\">{{ 'core.component.api-contract-builder.empty.body' | sdTranslate }}</p>\n @if (!_readonly) {\n <sd-button\n type=\"light\"\n size=\"sm\"\n prefixIcon=\"add\"\n [autoId]=\"_autoId ? _autoId + '-add-body' : undefined\"\n [title]=\"'core.component.api-contract-builder.request.add-body' | sdTranslate\"\n (click)=\"addRequestBody()\"></sd-button>\n }\n }\n } @else {\n <p class=\"sd-acb__empty-text\">{{ 'core.component.api-contract-builder.empty.section' | sdTranslate }}</p>\n }\n </section>\n }\n\n @case (3) {\n <section class=\"sd-acb__section\" data-step=\"response\">\n @if (_draft.res; as _res) {\n <sd-input\n class=\"sd-acb__status\"\n size=\"sm\"\n hideInlineError\n [autoId]=\"_autoId ? _autoId + '-status' : undefined\"\n [label]=\"'core.component.api-contract-builder.response.status' | sdTranslate\"\n [helperText]=\"'core.component.api-contract-builder.response.status-hint' | sdTranslate\"\n [model]=\"statusText()\"\n [disabled]=\"_readonly\"\n (sdChange)=\"setStatus($event)\"></sd-input>\n\n <h4 class=\"sd-acb__heading\">{{ 'core.component.api-contract-builder.response.headers' | sdTranslate }}</h4>\n <sd-api-contract-record-editor\n [record]=\"$any(_res.headers)\"\n basePath=\"res.headers\"\n [disabled]=\"_readonly\"\n [emptyLabel]=\"'core.component.api-contract-builder.empty.headers' | sdTranslate\"\n [autoId]=\"_autoId ? _autoId + '-res-headers' : undefined\"\n (recordChange)=\"setResponseHeaders($event)\"\n (editRequest)=\"openNodeDrawer('res.headers', $event)\"></sd-api-contract-record-editor>\n\n <h4 class=\"sd-acb__heading\">{{ 'core.component.api-contract-builder.response.body' | sdTranslate }}</h4>\n @if (_res.body) {\n <sd-api-contract-node-editor\n [node]=\"$any(_res.body)\"\n basePath=\"res.body\"\n [disabled]=\"_readonly\"\n [autoId]=\"_autoId ? _autoId + '-res-body' : undefined\"\n (nodeChange)=\"setResponseBody($event)\"\n (editRequest)=\"openNodeDrawer('res.body', $event)\"></sd-api-contract-node-editor>\n @if (!_readonly) {\n <sd-button\n type=\"text\"\n color=\"error\"\n size=\"sm\"\n prefixIcon=\"delete\"\n [autoId]=\"_autoId ? _autoId + '-remove-res-body' : undefined\"\n [title]=\"'core.component.api-contract-builder.response.remove-body' | sdTranslate\"\n (click)=\"removeResponseBody()\"></sd-button>\n }\n } @else {\n <p class=\"sd-acb__empty-text\">{{ 'core.component.api-contract-builder.empty.body' | sdTranslate }}</p>\n @if (!_readonly) {\n <sd-button\n type=\"light\"\n size=\"sm\"\n prefixIcon=\"add\"\n [autoId]=\"_autoId ? _autoId + '-add-res-body' : undefined\"\n [title]=\"'core.component.api-contract-builder.response.add-body' | sdTranslate\"\n (click)=\"addResponseBody()\"></sd-button>\n }\n }\n } @else {\n <p class=\"sd-acb__empty-text\">{{ 'core.component.api-contract-builder.empty.section' | sdTranslate }}</p>\n }\n </section>\n }\n\n @case (4) {\n <section class=\"sd-acb__section\" data-step=\"output\">\n @if (_draft.output?.schema; as _outputSchema) {\n @if (!_readonly && _responseFieldOptions.length) {\n <sd-select\n class=\"sd-acb__adopt\"\n size=\"sm\"\n hideInlineError\n [autoId]=\"_autoId ? _autoId + '-use-response' : undefined\"\n [label]=\"'core.component.api-contract-builder.output.use-response' | sdTranslate\"\n [items]=\"_responseFieldOptions\"\n valueField=\"value\"\n displayField=\"label\"\n [(model)]=\"responseFieldToken\"\n (sdChange)=\"useResponseFieldAsOutput($event)\"></sd-select>\n }\n\n <sd-api-contract-node-editor\n [node]=\"$any(_outputSchema)\"\n basePath=\"output.schema\"\n [disabled]=\"_readonly\"\n [autoId]=\"_autoId ? _autoId + '-output' : undefined\"\n (nodeChange)=\"setOutputSchema($event)\"\n (editRequest)=\"openNodeDrawer('output.schema', $event)\"></sd-api-contract-node-editor>\n\n <h4 class=\"sd-acb__heading\">{{ 'core.component.api-contract-builder.output.fields' | sdTranslate }}</h4>\n @let _outputFields = outputFields();\n @if (_outputFields.length) {\n <ul class=\"sd-acb__fields\" [attr.data-autoId]=\"_autoId ? _autoId + '-output-fields' : null\">\n @for (field of _outputFields; track field.path) {\n <li class=\"sd-acb__field\">\n <code>{{ field.path }}</code>\n <span class=\"sd-acb__field-type\">{{ field.type }}</span>\n @if (field.required === true) {\n <span class=\"sd-acb__field-flag\">{{ 'core.component.api-contract-builder.field.required' | sdTranslate }}</span>\n }\n </li>\n }\n </ul>\n } @else {\n <p class=\"sd-acb__empty-text\">{{ 'core.component.api-contract-builder.output.no-fields' | sdTranslate }}</p>\n }\n } @else {\n <p class=\"sd-acb__empty-text\">{{ 'core.component.api-contract-builder.empty.section' | sdTranslate }}</p>\n }\n </section>\n }\n\n @default {\n <section class=\"sd-acb__section\" data-step=\"review\">\n <sd-api-contract-diagnostic-list\n [diagnostics]=\"_diagnostics\"\n [autoId]=\"_autoId ? _autoId + '-diagnostics' : undefined\"\n (navigate)=\"goToDiagnostic($event)\"></sd-api-contract-diagnostic-list>\n\n <h4 class=\"sd-acb__heading\">{{ 'core.component.api-contract-builder.review.json' | sdTranslate }}</h4>\n <sd-code-editor\n language=\"json\"\n maxHeight=\"480px\"\n [viewed]=\"disabled() || mode() === 'view'\"\n [model]=\"json()\"\n (modelChange)=\"applyPastedJson($event)\"></sd-code-editor>\n </section>\n }\n }\n </div>\n\n <!-- why M\u1ED8T instance duy nh\u1EA5t, \u0111\u1EB7t ngo\u00E0i @switch: m\u1ED7i layer m\u1ED9t drawer s\u1EBD l\u00E0 m\u1ED7i layer m\u1ED9t draft, v\u00E0\n \u0111\u1ED5i step gi\u1EEFa l\u00FAc \u0111ang s\u1EEDa s\u1EBD destroy drawer c\u00F9ng v\u1EDBi thay \u0111\u1ED5i ch\u01B0a l\u01B0u. -->\n <sd-api-contract-node-drawer\n #nodeDrawer\n [layer]=\"drawerLayer()\"\n [allowTransform]=\"drawerAllowsTransform()\"\n [suggestions]=\"drawerSuggestions()\"\n [autoId]=\"_autoId ? _autoId + '-node-drawer' : undefined\"\n (nodeCommit)=\"applyNodeCommit($event)\"></sd-api-contract-node-drawer>\n}\n", styles: [":host{display:block;width:100%}.sd-acb__empty{display:flex;flex-direction:column;align-items:center;gap:10px;padding:32px 16px;border:1px dashed var(--sd-border-color, #e6e6e6);border-radius:8px;color:var(--sd-text-secondary, #6b6b6b)}.sd-acb__empty p{margin:0;font-size:13px}.sd-acb__steps{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:16px;border-bottom:1px solid var(--sd-border-color, #e6e6e6);padding-bottom:8px}.sd-acb__step{display:inline-flex;align-items:center;gap:8px;padding:6px 12px;border:1px solid transparent;border-radius:999px;background:transparent;color:var(--sd-text-secondary, #6b6b6b);font:inherit;font-size:13px;cursor:pointer}.sd-acb__step:hover,.sd-acb__step:focus-visible{background:var(--sd-surface-muted, #f3f5f8)}.sd-acb__step--active{border-color:var(--sd-primary, #005cbb);background:var(--sd-primary-light, #e5efff);color:var(--sd-primary-dark, #00419e);font-weight:600}.sd-acb__step-index{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;border-radius:50%;background:var(--sd-surface-muted, #f3f5f8);font-size:11px;font-weight:700}.sd-acb__step--active .sd-acb__step-index{background:var(--sd-primary, #005cbb);color:#fff}.sd-acb__body{display:block}.sd-acb__section{display:flex;flex-direction:column;gap:12px}.sd-acb__grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px;align-items:start}.sd-acb__url,.sd-acb__status{grid-column:span 2}.sd-acb__adopt{max-width:420px}.sd-acb__heading{margin:8px 0 0;font-size:13px;font-weight:600;color:var(--sd-text, #1f2937)}.sd-acb__empty-text{margin:0;font-size:12px;font-style:italic;color:var(--sd-text-secondary, #6b6b6b)}.sd-acb__fields{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:8px}.sd-acb__field{display:inline-flex;align-items:center;gap:6px;padding:4px 10px;border:1px solid var(--sd-border-color, #e6e6e6);border-radius:6px;background:var(--sd-surface-muted, #f3f5f8);font-size:12px}.sd-acb__field-type{color:var(--sd-primary, #005cbb);font-weight:600}.sd-acb__field-flag{color:var(--sd-text-secondary, #6b6b6b)}.sd-acb__view{display:flex;flex-direction:column;gap:16px}.sd-acb__summary{display:grid;grid-template-columns:minmax(120px,max-content) 1fr;gap:6px 16px;margin:0;font-size:13px}.sd-acb__summary dt{color:var(--sd-text-secondary, #6b6b6b)}.sd-acb__summary dd{margin:0;font-weight:600;overflow-wrap:anywhere}@media(max-width:768px){.sd-acb__url,.sd-acb__status{grid-column:span 1}.sd-acb__step-label{display:none}}\n"], dependencies: [{ kind: "component", type: SdButton, selector: "sd-button", inputs: ["autoId", "type", "color", "size", "fontSet", "title", "width", "tooltip", "prefixIcon", "suffixIcon", "disabled", "loading", "block", "htmlType"], outputs: ["click"] }, { kind: "component", type: SdCodeEditor, selector: "sd-code-editor", inputs: ["model", "language", "maxHeight", "viewed"], outputs: ["modelChange"] }, { kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "component", type: SdInput, selector: "sd-input", inputs: ["autoId", "name", "appearance", "floatLabel", "size", "form", "label", "helperText", "placeholder", "type", "mask", "hideInlineError", "blurOnEnter", "clearable", "required", "readonly", "disabled", "viewed", "minlength", "maxlength", "pattern", "patternErrorMessage", "validator", "inlineError", "hyperlink", "model"], outputs: ["modelChange", "sdChange", "sdFocus", "sdBlur", "keyupEnter", "cleared", "sdFocusForceBlur"] }, { kind: "component", type: SdSelect, selector: "sd-select", inputs: ["autoId", "name", "size", "form", "label", "helperText", "placeholder", "valueField", "displayField", "disabledField", "cacheChecksum", "limit", "hyperlink", "minWidthPanel", "hideInlineError", "hideReadError", "required", "disabled", "viewed", "multiple", "showSelectAll", "clearable", "validator", "inlineError", "appearance", "floatLabel", "items", "model"], outputs: ["sdReadStateChange", "modelChange", "sdChange", "sdSelection"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }, { kind: "component", type: SdApiContractDiagnosticList, selector: "sd-api-contract-diagnostic-list", inputs: ["diagnostics", "autoId"], outputs: ["navigate"] }, { kind: "component", type: SdApiContractNodeEditor, selector: "sd-api-contract-node-editor", inputs: ["node", "basePath", "disabled", "autoId"], outputs: ["nodeChange", "editRequest"] }, { kind: "component", type: SdApiContractNodeDrawer, selector: "sd-api-contract-node-drawer", inputs: ["layer", "allowTransform", "suggestions", "autoId"], outputs: ["nodeCommit"] }, { kind: "component", type: SdApiContractRecordEditor, selector: "sd-api-contract-record-editor", inputs: ["record", "basePath", "disabled", "emptyLabel", "autoId"], outputs: ["recordChange", "editRequest"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3325
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.21", type: SdApiContractBuilder, isStandalone: true, selector: "sd-api-contract-builder", inputs: { model: { classPropertyName: "model", publicName: "model", isSignal: true, isRequired: false, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, autoId: { classPropertyName: "autoId", publicName: "autoId", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { model: "modelChange", diagnosticsChange: "diagnosticsChange", validChange: "validChange" }, host: { properties: { "attr.data-autoId": "this.autoIdAttr" } }, viewQueries: [{ propertyName: "nodeDrawer", first: true, predicate: ["nodeDrawer"], descendants: true, isSignal: true }], ngImport: i0, template: "@let _draft = draft();\n@let _readonly = readonly();\n@let _autoId = autoId();\n@let _diagnostics = diagnostics();\n@let _activeStep = activeStep();\n@let _requestSuggestions = requestSuggestions();\n@let _responseFieldOptions = responseFieldOptions();\n\n<!-- why: contract t\u1EEB ngo\u00E0i c\u00F3 th\u1EC3 thi\u1EBFu h\u1EB3n m\u1ED9t t\u1EA7ng. M\u1ECDi nh\u00E1nh \u0111\u1ECDc `_draft.<section>` \u0111\u1EC1u ph\u1EA3i\n g\u00E1c \u2014 builder hi\u1EC3n th\u1ECB contract sai k\u00E8m ch\u1EA9n \u0111o\u00E1n ch\u1EE9 kh\u00F4ng t\u1EF1 v\u00E1, v\u00E0 c\u0169ng kh\u00F4ng \u0111\u01B0\u1EE3c n\u1ED5. -->\n@if (!_draft) {\n <div class=\"sd-acb__empty\">\n <sd-icon name=\"description\" size=\"lg\"></sd-icon>\n <p>{{ 'core.component.api-contract-builder.empty.contract' | sdTranslate }}</p>\n @if (!_readonly) {\n <sd-button\n type=\"fill\"\n color=\"primary\"\n size=\"sm\"\n prefixIcon=\"add\"\n [autoId]=\"_autoId ? _autoId + '-create' : undefined\"\n [title]=\"'core.component.api-contract-builder.create-contract' | sdTranslate\"\n (click)=\"createContract()\"></sd-button>\n }\n </div>\n} @else if (isView()) {\n <section class=\"sd-acb__view\">\n <dl class=\"sd-acb__summary\">\n <dt>{{ 'core.component.api-contract-builder.contract.code' | sdTranslate }}</dt>\n <dd data-field=\"code\">{{ _draft.code }}</dd>\n <dt>{{ 'core.component.api-contract-builder.contract.name' | sdTranslate }}</dt>\n <dd data-field=\"name\">{{ _draft.name }}</dd>\n <dt>{{ 'core.component.api-contract-builder.request.method' | sdTranslate }}</dt>\n <dd data-field=\"method\">{{ _draft.req?.method }}</dd>\n <dt>{{ 'core.component.api-contract-builder.request.url' | sdTranslate }}</dt>\n <dd data-field=\"url\">{{ _draft.req?.url }}</dd>\n </dl>\n\n <sd-api-contract-diagnostic-list\n [diagnostics]=\"_diagnostics\"\n [autoId]=\"_autoId ? _autoId + '-diagnostics' : undefined\"></sd-api-contract-diagnostic-list>\n\n <sd-code-editor language=\"json\" [viewed]=\"true\" maxHeight=\"420px\" [model]=\"json()\"></sd-code-editor>\n </section>\n} @else {\n <nav class=\"sd-acb__steps\" [attr.aria-label]=\"'core.component.api-contract-builder.steps' | sdTranslate\">\n @for (step of steps; track step.index) {\n <button\n type=\"button\"\n class=\"sd-acb__step\"\n [class.sd-acb__step--active]=\"_activeStep === step.index\"\n [attr.aria-current]=\"_activeStep === step.index ? 'step' : null\"\n [attr.data-autoId]=\"_autoId ? _autoId + '-step-' + step.key : null\"\n (click)=\"goToStep(step.index)\">\n <span class=\"sd-acb__step-index\">{{ step.index + 1 }}</span>\n <span class=\"sd-acb__step-label\">{{ step.label }}</span>\n </button>\n }\n </nav>\n\n <div class=\"sd-acb__body\">\n @switch (_activeStep) {\n @case (0) {\n <section class=\"sd-acb__section\" data-step=\"general\">\n <div class=\"sd-acb__grid\">\n <sd-input\n size=\"sm\"\n hideInlineError\n [autoId]=\"_autoId ? _autoId + '-code' : undefined\"\n [label]=\"'core.component.api-contract-builder.contract.code' | sdTranslate\"\n [model]=\"_draft.code\"\n [disabled]=\"_readonly\"\n (sdChange)=\"setText('code', $event)\"></sd-input>\n <sd-input\n size=\"sm\"\n hideInlineError\n [autoId]=\"_autoId ? _autoId + '-name' : undefined\"\n [label]=\"'core.component.api-contract-builder.contract.name' | sdTranslate\"\n [model]=\"_draft.name\"\n [disabled]=\"_readonly\"\n (sdChange)=\"setText('name', $event)\"></sd-input>\n <sd-input\n size=\"sm\"\n hideInlineError\n [autoId]=\"_autoId ? _autoId + '-description' : undefined\"\n [label]=\"'core.component.api-contract-builder.contract.description' | sdTranslate\"\n [model]=\"_draft.description ?? ''\"\n [disabled]=\"_readonly\"\n (sdChange)=\"setText('description', $event)\"></sd-input>\n <sd-input\n size=\"sm\"\n hideInlineError\n [autoId]=\"_autoId ? _autoId + '-version' : undefined\"\n [label]=\"'core.component.api-contract-builder.contract.version' | sdTranslate\"\n [model]=\"contractVersion\"\n [readonly]=\"true\"\n [disabled]=\"true\"></sd-input>\n </div>\n </section>\n }\n\n @case (1) {\n <section class=\"sd-acb__section\" data-step=\"input\">\n @if (_draft.input?.schema; as _inputSchema) {\n <sd-api-contract-node-editor\n [node]=\"$any(_inputSchema)\"\n basePath=\"input.schema\"\n [disabled]=\"_readonly\"\n [autoId]=\"_autoId ? _autoId + '-input' : undefined\"\n (nodeChange)=\"setInputSchema($event)\"\n (editRequest)=\"openNodeDrawer('input.schema', $event)\"></sd-api-contract-node-editor>\n } @else {\n <p class=\"sd-acb__empty-text\">{{ 'core.component.api-contract-builder.empty.section' | sdTranslate }}</p>\n }\n </section>\n }\n\n @case (2) {\n <section class=\"sd-acb__section\" data-step=\"request\">\n @if (_draft.req; as _req) {\n <div class=\"sd-acb__grid\">\n <sd-select\n size=\"sm\"\n hideInlineError\n [clearable]=\"false\"\n [autoId]=\"_autoId ? _autoId + '-method' : undefined\"\n [label]=\"'core.component.api-contract-builder.request.method' | sdTranslate\"\n [items]=\"methodOptions\"\n valueField=\"value\"\n displayField=\"label\"\n [model]=\"_req.method\"\n [disabled]=\"_readonly\"\n (sdChange)=\"setMethod($event)\"></sd-select>\n <sd-input\n class=\"sd-acb__url\"\n size=\"sm\"\n hideInlineError\n [autoId]=\"_autoId ? _autoId + '-url' : undefined\"\n [label]=\"'core.component.api-contract-builder.request.url' | sdTranslate\"\n [placeholder]=\"urlPlaceholder\"\n [model]=\"_req.url\"\n [disabled]=\"_readonly\"\n (sdChange)=\"setUrl($event)\"></sd-input>\n </div>\n\n <h4 class=\"sd-acb__heading\">{{ 'core.component.api-contract-builder.request.path' | sdTranslate }}</h4>\n <sd-api-contract-record-editor\n [record]=\"$any(_req.path)\"\n basePath=\"req.path\"\n [disabled]=\"_readonly\"\n [emptyLabel]=\"'core.component.api-contract-builder.empty.path' | sdTranslate\"\n [autoId]=\"_autoId ? _autoId + '-path' : undefined\"\n (recordChange)=\"setRequestRecord('path', $event)\"\n (editRequest)=\"openNodeDrawer('req.path', $event)\"></sd-api-contract-record-editor>\n\n <h4 class=\"sd-acb__heading\">{{ 'core.component.api-contract-builder.request.query' | sdTranslate }}</h4>\n <sd-api-contract-record-editor\n [record]=\"$any(_req.query)\"\n basePath=\"req.query\"\n [disabled]=\"_readonly\"\n [emptyLabel]=\"'core.component.api-contract-builder.empty.query' | sdTranslate\"\n [autoId]=\"_autoId ? _autoId + '-query' : undefined\"\n (recordChange)=\"setRequestRecord('query', $event)\"\n (editRequest)=\"openNodeDrawer('req.query', $event)\"></sd-api-contract-record-editor>\n\n <h4 class=\"sd-acb__heading\">{{ 'core.component.api-contract-builder.request.headers' | sdTranslate }}</h4>\n <sd-api-contract-record-editor\n [record]=\"$any(_req.headers)\"\n basePath=\"req.headers\"\n [disabled]=\"_readonly\"\n [emptyLabel]=\"'core.component.api-contract-builder.empty.headers' | sdTranslate\"\n [autoId]=\"_autoId ? _autoId + '-headers' : undefined\"\n (recordChange)=\"setRequestRecord('headers', $event)\"\n (editRequest)=\"openNodeDrawer('req.headers', $event)\"></sd-api-contract-record-editor>\n\n <h4 class=\"sd-acb__heading\">{{ 'core.component.api-contract-builder.request.body' | sdTranslate }}</h4>\n @if (_req.body) {\n <sd-api-contract-node-editor\n [node]=\"$any(_req.body)\"\n basePath=\"req.body\"\n [disabled]=\"_readonly\"\n [autoId]=\"_autoId ? _autoId + '-body' : undefined\"\n (nodeChange)=\"setRequestBody($event)\"\n (editRequest)=\"openNodeDrawer('req.body', $event)\"></sd-api-contract-node-editor>\n @if (!_readonly) {\n <sd-button\n type=\"text\"\n color=\"error\"\n size=\"sm\"\n prefixIcon=\"delete\"\n [autoId]=\"_autoId ? _autoId + '-remove-body' : undefined\"\n [title]=\"'core.component.api-contract-builder.request.remove-body' | sdTranslate\"\n (click)=\"removeRequestBody()\"></sd-button>\n }\n } @else {\n <p class=\"sd-acb__empty-text\">{{ 'core.component.api-contract-builder.empty.body' | sdTranslate }}</p>\n @if (!_readonly) {\n <sd-button\n type=\"light\"\n size=\"sm\"\n prefixIcon=\"add\"\n [autoId]=\"_autoId ? _autoId + '-add-body' : undefined\"\n [title]=\"'core.component.api-contract-builder.request.add-body' | sdTranslate\"\n (click)=\"addRequestBody()\"></sd-button>\n }\n }\n } @else {\n <p class=\"sd-acb__empty-text\">{{ 'core.component.api-contract-builder.empty.section' | sdTranslate }}</p>\n }\n </section>\n }\n\n @case (3) {\n <section class=\"sd-acb__section\" data-step=\"response\">\n @if (_draft.res; as _res) {\n <sd-input\n class=\"sd-acb__status\"\n size=\"sm\"\n hideInlineError\n [autoId]=\"_autoId ? _autoId + '-status' : undefined\"\n [label]=\"'core.component.api-contract-builder.response.status' | sdTranslate\"\n [helperText]=\"'core.component.api-contract-builder.response.status-hint' | sdTranslate\"\n [model]=\"statusText()\"\n [disabled]=\"_readonly\"\n (sdChange)=\"setStatus($event)\"></sd-input>\n\n <h4 class=\"sd-acb__heading\">{{ 'core.component.api-contract-builder.response.headers' | sdTranslate }}</h4>\n <sd-api-contract-record-editor\n [record]=\"$any(_res.headers)\"\n basePath=\"res.headers\"\n [disabled]=\"_readonly\"\n [emptyLabel]=\"'core.component.api-contract-builder.empty.headers' | sdTranslate\"\n [autoId]=\"_autoId ? _autoId + '-res-headers' : undefined\"\n (recordChange)=\"setResponseHeaders($event)\"\n (editRequest)=\"openNodeDrawer('res.headers', $event)\"></sd-api-contract-record-editor>\n\n <h4 class=\"sd-acb__heading\">{{ 'core.component.api-contract-builder.response.body' | sdTranslate }}</h4>\n @if (_res.body) {\n <sd-api-contract-node-editor\n [node]=\"$any(_res.body)\"\n basePath=\"res.body\"\n [disabled]=\"_readonly\"\n [autoId]=\"_autoId ? _autoId + '-res-body' : undefined\"\n (nodeChange)=\"setResponseBody($event)\"\n (editRequest)=\"openNodeDrawer('res.body', $event)\"></sd-api-contract-node-editor>\n @if (!_readonly) {\n <sd-button\n type=\"text\"\n color=\"error\"\n size=\"sm\"\n prefixIcon=\"delete\"\n [autoId]=\"_autoId ? _autoId + '-remove-res-body' : undefined\"\n [title]=\"'core.component.api-contract-builder.response.remove-body' | sdTranslate\"\n (click)=\"removeResponseBody()\"></sd-button>\n }\n } @else {\n <p class=\"sd-acb__empty-text\">{{ 'core.component.api-contract-builder.empty.body' | sdTranslate }}</p>\n @if (!_readonly) {\n <sd-button\n type=\"light\"\n size=\"sm\"\n prefixIcon=\"add\"\n [autoId]=\"_autoId ? _autoId + '-add-res-body' : undefined\"\n [title]=\"'core.component.api-contract-builder.response.add-body' | sdTranslate\"\n (click)=\"addResponseBody()\"></sd-button>\n }\n }\n } @else {\n <p class=\"sd-acb__empty-text\">{{ 'core.component.api-contract-builder.empty.section' | sdTranslate }}</p>\n }\n </section>\n }\n\n @case (4) {\n <section class=\"sd-acb__section\" data-step=\"output\">\n @if (_draft.output?.schema; as _outputSchema) {\n @if (!_readonly && _responseFieldOptions.length) {\n <sd-select\n class=\"sd-acb__adopt\"\n size=\"sm\"\n hideInlineError\n [autoId]=\"_autoId ? _autoId + '-use-response' : undefined\"\n [label]=\"'core.component.api-contract-builder.output.use-response' | sdTranslate\"\n [items]=\"_responseFieldOptions\"\n valueField=\"value\"\n displayField=\"label\"\n [(model)]=\"responseFieldToken\"\n (sdChange)=\"useResponseFieldAsOutput($event)\"></sd-select>\n }\n\n <sd-api-contract-node-editor\n [node]=\"$any(_outputSchema)\"\n basePath=\"output.schema\"\n [disabled]=\"_readonly\"\n [autoId]=\"_autoId ? _autoId + '-output' : undefined\"\n (nodeChange)=\"setOutputSchema($event)\"\n (editRequest)=\"openNodeDrawer('output.schema', $event)\"></sd-api-contract-node-editor>\n\n <h4 class=\"sd-acb__heading\">{{ 'core.component.api-contract-builder.output.fields' | sdTranslate }}</h4>\n @let _outputFields = outputFields();\n @if (_outputFields.length) {\n <ul class=\"sd-acb__fields\" [attr.data-autoId]=\"_autoId ? _autoId + '-output-fields' : null\">\n @for (field of _outputFields; track field.path) {\n <li class=\"sd-acb__field\">\n <code>{{ field.path }}</code>\n <span class=\"sd-acb__field-type\">{{ field.type }}</span>\n @if (field.required === true) {\n <span class=\"sd-acb__field-flag\">{{ 'core.component.api-contract-builder.field.required' | sdTranslate }}</span>\n }\n </li>\n }\n </ul>\n } @else {\n <p class=\"sd-acb__empty-text\">{{ 'core.component.api-contract-builder.output.no-fields' | sdTranslate }}</p>\n }\n } @else {\n <p class=\"sd-acb__empty-text\">{{ 'core.component.api-contract-builder.empty.section' | sdTranslate }}</p>\n }\n </section>\n }\n\n @default {\n <section class=\"sd-acb__section\" data-step=\"review\">\n <sd-api-contract-diagnostic-list\n [diagnostics]=\"_diagnostics\"\n [autoId]=\"_autoId ? _autoId + '-diagnostics' : undefined\"\n (navigate)=\"goToDiagnostic($event)\"></sd-api-contract-diagnostic-list>\n\n <h4 class=\"sd-acb__heading\">{{ 'core.component.api-contract-builder.review.json' | sdTranslate }}</h4>\n <sd-code-editor\n language=\"json\"\n maxHeight=\"480px\"\n [viewed]=\"disabled() || mode() === 'view'\"\n [model]=\"json()\"\n (modelChange)=\"applyPastedJson($event)\"></sd-code-editor>\n </section>\n }\n }\n </div>\n\n <!-- why M\u1ED8T instance duy nh\u1EA5t, \u0111\u1EB7t ngo\u00E0i @switch: m\u1ED7i layer m\u1ED9t drawer s\u1EBD l\u00E0 m\u1ED7i layer m\u1ED9t draft, v\u00E0\n \u0111\u1ED5i step gi\u1EEFa l\u00FAc \u0111ang s\u1EEDa s\u1EBD destroy drawer c\u00F9ng v\u1EDBi thay \u0111\u1ED5i ch\u01B0a l\u01B0u. -->\n <sd-api-contract-node-drawer\n #nodeDrawer\n [layer]=\"drawerLayer()\"\n [allowTransform]=\"drawerAllowsTransform()\"\n [suggestions]=\"drawerSuggestions()\"\n [autoId]=\"_autoId ? _autoId + '-node-drawer' : undefined\"\n (nodeCommit)=\"applyNodeCommit($event)\"></sd-api-contract-node-drawer>\n}\n", styles: [":host{display:block;width:100%}.sd-acb__empty{display:flex;flex-direction:column;align-items:center;gap:10px;padding:32px 16px;border:1px dashed var(--sd-border-color, #e6e6e6);border-radius:8px;color:var(--sd-text-secondary, #6b6b6b)}.sd-acb__empty p{margin:0;font-size:13px}.sd-acb__steps{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:16px;border-bottom:1px solid var(--sd-border-color, #e6e6e6);padding-bottom:8px}.sd-acb__step{display:inline-flex;align-items:center;gap:8px;padding:6px 12px;border:1px solid transparent;border-radius:999px;background:transparent;color:var(--sd-text-secondary, #6b6b6b);font:inherit;font-size:13px;cursor:pointer}.sd-acb__step:hover,.sd-acb__step:focus-visible{background:var(--sd-surface-muted, #f3f5f8)}.sd-acb__step--active{border-color:var(--sd-primary, #005cbb);background:var(--sd-primary-light, #e5efff);color:var(--sd-primary-dark, #00419e);font-weight:600}.sd-acb__step-index{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;border-radius:50%;background:var(--sd-surface-muted, #f3f5f8);font-size:11px;font-weight:700}.sd-acb__step--active .sd-acb__step-index{background:var(--sd-primary, #005cbb);color:#fff}.sd-acb__body{display:block}.sd-acb__section{display:flex;flex-direction:column;gap:12px}.sd-acb__grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px;align-items:start}.sd-acb__url,.sd-acb__status{grid-column:span 2}.sd-acb__adopt{max-width:420px}.sd-acb__heading{margin:8px 0 0;font-size:13px;font-weight:600;color:var(--sd-text, #1f2937)}.sd-acb__empty-text{margin:0;font-size:12px;font-style:italic;color:var(--sd-text-secondary, #6b6b6b)}.sd-acb__fields{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:8px}.sd-acb__field{display:inline-flex;align-items:center;gap:6px;padding:4px 10px;border:1px solid var(--sd-border-color, #e6e6e6);border-radius:6px;background:var(--sd-surface-muted, #f3f5f8);font-size:12px}.sd-acb__field-type{color:var(--sd-primary, #005cbb);font-weight:600}.sd-acb__field-flag{color:var(--sd-text-secondary, #6b6b6b)}.sd-acb__view{display:flex;flex-direction:column;gap:16px}.sd-acb__summary{display:grid;grid-template-columns:minmax(120px,max-content) 1fr;gap:6px 16px;margin:0;font-size:13px}.sd-acb__summary dt{color:var(--sd-text-secondary, #6b6b6b)}.sd-acb__summary dd{margin:0;font-weight:600;overflow-wrap:anywhere}@media(max-width:768px){.sd-acb__url,.sd-acb__status{grid-column:span 1}.sd-acb__step-label{display:none}}\n"], dependencies: [{ kind: "component", type: SdButton, selector: "sd-button", inputs: ["autoId", "type", "color", "size", "fontSet", "title", "width", "tooltip", "prefixIcon", "suffixIcon", "disabled", "openOnHover", "loading", "block", "htmlType"], outputs: ["click"] }, { kind: "component", type: SdCodeEditor, selector: "sd-code-editor", inputs: ["model", "language", "maxHeight", "viewed"], outputs: ["modelChange"] }, { kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "component", type: SdInput, selector: "sd-input", inputs: ["autoId", "name", "appearance", "floatLabel", "size", "form", "label", "helperText", "placeholder", "type", "mask", "hideInlineError", "blurOnEnter", "clearable", "required", "readonly", "disabled", "viewed", "minlength", "maxlength", "pattern", "patternErrorMessage", "validator", "inlineError", "hyperlink", "model"], outputs: ["modelChange", "sdChange", "sdFocus", "sdBlur", "keyupEnter", "cleared", "sdFocusForceBlur"] }, { kind: "component", type: SdSelect, selector: "sd-select", inputs: ["autoId", "name", "size", "form", "label", "helperText", "placeholder", "valueField", "displayField", "disabledField", "cacheChecksum", "limit", "hyperlink", "minWidthPanel", "hideInlineError", "hideReadError", "required", "disabled", "viewed", "multiple", "showSelectAll", "clearable", "validator", "inlineError", "appearance", "floatLabel", "items", "model"], outputs: ["sdReadStateChange", "modelChange", "sdChange", "sdSelection"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }, { kind: "component", type: SdApiContractDiagnosticList, selector: "sd-api-contract-diagnostic-list", inputs: ["diagnostics", "autoId"], outputs: ["navigate"] }, { kind: "component", type: SdApiContractNodeEditor, selector: "sd-api-contract-node-editor", inputs: ["node", "basePath", "disabled", "autoId"], outputs: ["nodeChange", "editRequest"] }, { kind: "component", type: SdApiContractNodeDrawer, selector: "sd-api-contract-node-drawer", inputs: ["layer", "allowTransform", "suggestions", "autoId"], outputs: ["nodeCommit"] }, { kind: "component", type: SdApiContractRecordEditor, selector: "sd-api-contract-record-editor", inputs: ["record", "basePath", "disabled", "emptyLabel", "autoId"], outputs: ["recordChange", "editRequest"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3326
3326
|
}
|
|
3327
3327
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImport: i0, type: SdApiContractBuilder, decorators: [{
|
|
3328
3328
|
type: Component,
|