@alauda-fe/crd-form 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/esm2022/alauda-fe-crd-form.mjs +5 -0
  2. package/esm2022/lib/abstract/base-array.mjs +117 -0
  3. package/esm2022/lib/crd-form/component.mjs +334 -0
  4. package/esm2022/lib/crd-form/helper.mjs +32 -0
  5. package/esm2022/lib/crd-form.module.mjs +117 -0
  6. package/esm2022/lib/field-controls/expressions/expression-core.mjs +2 -0
  7. package/esm2022/lib/field-controls/expressions/props-expression.mjs +58 -0
  8. package/esm2022/lib/field-controls/form-item.component.mjs +121 -0
  9. package/esm2022/lib/field-controls/index.mjs +8 -0
  10. package/esm2022/lib/field-controls/module.mjs +141 -0
  11. package/esm2022/lib/field-controls/operand-advanced-field-group.component.mjs +80 -0
  12. package/esm2022/lib/field-controls/operand-array-field-group.component.mjs +112 -0
  13. package/esm2022/lib/field-controls/operand-field-group.component.mjs +98 -0
  14. package/esm2022/lib/field-controls/operand-field.component.mjs +870 -0
  15. package/esm2022/lib/field-controls/widgets/array-table/component.mjs +109 -0
  16. package/esm2022/lib/field-controls/widgets/basic-auth-secret/component.mjs +116 -0
  17. package/esm2022/lib/field-controls/widgets/basic-auth-secret/create/component.mjs +211 -0
  18. package/esm2022/lib/field-controls/widgets/basic-auth-secret/type.mjs +2 -0
  19. package/esm2022/lib/field-controls/widgets/index.mjs +8 -0
  20. package/esm2022/lib/field-controls/widgets/k8s-resource-prefix/component.mjs +169 -0
  21. package/esm2022/lib/field-controls/widgets/k8s-resource-prefix/util.mjs +40 -0
  22. package/esm2022/lib/field-controls/widgets/link/component.mjs +68 -0
  23. package/esm2022/lib/field-controls/widgets/resource-requirements/resource-requirements.component.mjs +524 -0
  24. package/esm2022/lib/field-controls/widgets/utils.mjs +73 -0
  25. package/esm2022/lib/field-controls/widgets/yaml-editor/yaml-editor.component.mjs +94 -0
  26. package/esm2022/lib/field-widgets/htpasswd/component.mjs +35 -0
  27. package/esm2022/lib/field-widgets/htpasswd/form.mjs +171 -0
  28. package/esm2022/lib/field-widgets/htpasswd/index.mjs +4 -0
  29. package/esm2022/lib/field-widgets/htpasswd/module.mjs +54 -0
  30. package/esm2022/lib/field-widgets/index.mjs +2 -0
  31. package/esm2022/lib/remote-widgets/constants.mjs +4 -0
  32. package/esm2022/lib/remote-widgets/index.mjs +4 -0
  33. package/esm2022/lib/remote-widgets/remote-widget.service.mjs +42 -0
  34. package/esm2022/lib/remote-widgets/token.mjs +7 -0
  35. package/esm2022/lib/spec-descriptors/capability/capability.component.mjs +139 -0
  36. package/esm2022/lib/spec-descriptors/capability-list/capability-list.component.mjs +189 -0
  37. package/esm2022/lib/spec-descriptors/index.mjs +4 -0
  38. package/esm2022/lib/spec-descriptors/util.mjs +13 -0
  39. package/esm2022/lib/types/index.mjs +73 -0
  40. package/esm2022/lib/utils/capability.mjs +295 -0
  41. package/esm2022/lib/utils/constant.mjs +22 -0
  42. package/esm2022/lib/utils/directives.mjs +19 -0
  43. package/esm2022/lib/utils/helper.mjs +201 -0
  44. package/esm2022/lib/utils/index.mjs +7 -0
  45. package/esm2022/lib/utils/service-model.mjs +12 -0
  46. package/esm2022/lib/utils/util.mjs +310 -0
  47. package/esm2022/public-api.mjs +13 -0
  48. package/index.d.ts +5 -0
  49. package/lib/abstract/base-array.d.ts +31 -0
  50. package/lib/crd-form/component.d.ts +61 -0
  51. package/lib/crd-form/helper.d.ts +7 -0
  52. package/lib/crd-form.module.d.ts +16 -0
  53. package/lib/field-controls/expressions/expression-core.d.ts +6 -0
  54. package/lib/field-controls/expressions/props-expression.d.ts +36 -0
  55. package/lib/field-controls/form-item.component.d.ts +11 -0
  56. package/lib/field-controls/index.d.ts +7 -0
  57. package/lib/field-controls/module.d.ts +23 -0
  58. package/lib/field-controls/operand-advanced-field-group.component.d.ts +16 -0
  59. package/lib/field-controls/operand-array-field-group.component.d.ts +8 -0
  60. package/lib/field-controls/operand-field-group.component.d.ts +24 -0
  61. package/lib/field-controls/operand-field.component.d.ts +110 -0
  62. package/lib/field-controls/widgets/array-table/component.d.ts +8 -0
  63. package/lib/field-controls/widgets/basic-auth-secret/component.d.ts +26 -0
  64. package/lib/field-controls/widgets/basic-auth-secret/create/component.d.ts +45 -0
  65. package/lib/field-controls/widgets/basic-auth-secret/type.d.ts +11 -0
  66. package/lib/field-controls/widgets/index.d.ts +7 -0
  67. package/lib/field-controls/widgets/k8s-resource-prefix/component.d.ts +35 -0
  68. package/lib/field-controls/widgets/k8s-resource-prefix/util.d.ts +3 -0
  69. package/lib/field-controls/widgets/link/component.d.ts +20 -0
  70. package/lib/field-controls/widgets/resource-requirements/resource-requirements.component.d.ts +88 -0
  71. package/lib/field-controls/widgets/utils.d.ts +17 -0
  72. package/lib/field-controls/widgets/yaml-editor/yaml-editor.component.d.ts +36 -0
  73. package/lib/field-widgets/htpasswd/component.d.ts +9 -0
  74. package/lib/field-widgets/htpasswd/form.d.ts +32 -0
  75. package/lib/field-widgets/htpasswd/index.d.ts +3 -0
  76. package/lib/field-widgets/htpasswd/module.d.ts +13 -0
  77. package/lib/field-widgets/index.d.ts +1 -0
  78. package/lib/remote-widgets/constants.d.ts +3 -0
  79. package/lib/remote-widgets/index.d.ts +3 -0
  80. package/lib/remote-widgets/remote-widget.service.d.ts +28 -0
  81. package/lib/remote-widgets/token.d.ts +3 -0
  82. package/lib/spec-descriptors/capability/capability.component.d.ts +20 -0
  83. package/lib/spec-descriptors/capability-list/capability-list.component.d.ts +34 -0
  84. package/lib/spec-descriptors/index.d.ts +3 -0
  85. package/lib/spec-descriptors/util.d.ts +4 -0
  86. package/lib/types/index.d.ts +122 -0
  87. package/lib/utils/capability.d.ts +54 -0
  88. package/lib/utils/constant.d.ts +12 -0
  89. package/lib/utils/directives.d.ts +9 -0
  90. package/lib/utils/helper.d.ts +61 -0
  91. package/lib/utils/index.d.ts +6 -0
  92. package/lib/utils/service-model.d.ts +44 -0
  93. package/lib/utils/util.d.ts +48 -0
  94. package/package.json +30 -0
  95. package/public-api.d.ts +9 -0
@@ -0,0 +1,23 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./form-item.component";
3
+ import * as i2 from "./operand-advanced-field-group.component";
4
+ import * as i3 from "./operand-array-field-group.component";
5
+ import * as i4 from "./operand-field-group.component";
6
+ import * as i5 from "./operand-field.component";
7
+ import * as i6 from "./widgets/array-table/component";
8
+ import * as i7 from "./widgets/k8s-resource-prefix/component";
9
+ import * as i8 from "./widgets/resource-requirements/resource-requirements.component";
10
+ import * as i9 from "./widgets/yaml-editor/yaml-editor.component";
11
+ import * as i10 from "./widgets/basic-auth-secret/component";
12
+ import * as i11 from "./widgets/basic-auth-secret/create/component";
13
+ import * as i12 from "@angular/common";
14
+ import * as i13 from "@angular/forms";
15
+ import * as i14 from "@alauda/ui";
16
+ import * as i15 from "@alauda/code-editor";
17
+ import * as i16 from "@alauda-fe/common";
18
+ import * as i17 from "./widgets/link/component";
19
+ export declare class FieldControlsModule {
20
+ static ɵfac: i0.ɵɵFactoryDeclaration<FieldControlsModule, never>;
21
+ static ɵmod: i0.ɵɵNgModuleDeclaration<FieldControlsModule, [typeof i1.FormItemComponent, typeof i2.OperandAdvancedFieldGroupComponent, typeof i3.OperandArrayFieldGroupComponent, typeof i4.OperandFieldGroupComponent, typeof i5.OperandFieldComponent, typeof i6.CrdFormArrayTableComponent, typeof i7.K8sResourcePrefixComponent, typeof i8.ResourceRequirementsComponent, typeof i9.YamlEditorComponent, typeof i10.BasicAuthSecretComponent, typeof i11.BasicAuthCreateSecretDialogComponent], [typeof i12.CommonModule, typeof i13.FormsModule, typeof i13.ReactiveFormsModule, typeof i14.FormModule, typeof i14.IconModule, typeof i14.InputModule, typeof i14.RadioModule, typeof i14.SelectModule, typeof i14.SwitchModule, typeof i14.TagModule, typeof i14.TooltipModule, typeof i14.DialogModule, typeof i14.ButtonModule, typeof i15.CodeEditorModule, typeof i16.ArrayFormTableModule, typeof i16.ErrorsMapperModule, typeof i16.StrongPasswordValidatorModule, typeof i16.TranslateModule, typeof i16.CoreModule, typeof i16.WidgetModule, typeof i17.LinkComponent, typeof i16.PasswordInputComponent], [typeof i1.FormItemComponent, typeof i2.OperandAdvancedFieldGroupComponent, typeof i3.OperandArrayFieldGroupComponent, typeof i4.OperandFieldGroupComponent, typeof i5.OperandFieldComponent, typeof i6.CrdFormArrayTableComponent, typeof i7.K8sResourcePrefixComponent, typeof i8.ResourceRequirementsComponent, typeof i9.YamlEditorComponent, typeof i10.BasicAuthSecretComponent, typeof i11.BasicAuthCreateSecretDialogComponent]>;
22
+ static ɵinj: i0.ɵɵInjectorDeclaration<FieldControlsModule>;
23
+ }
@@ -0,0 +1,16 @@
1
+ import { EventEmitter } from '@angular/core';
2
+ import { FieldValueChangeEvent, FormDataState, FormErrors, OperandField } from '../types';
3
+ import * as i0 from "@angular/core";
4
+ export declare class OperandAdvancedFieldGroupComponent {
5
+ fields: OperandField[];
6
+ fieldList: OperandField[];
7
+ formDataState: FormDataState;
8
+ formErrors: FormErrors;
9
+ readonly: boolean;
10
+ valueChange: EventEmitter<FieldValueChangeEvent>;
11
+ expanded: boolean;
12
+ startCase: (string?: string) => string;
13
+ fieldValueChange(e: FieldValueChangeEvent): void;
14
+ static ɵfac: i0.ɵɵFactoryDeclaration<OperandAdvancedFieldGroupComponent, never>;
15
+ static ɵcmp: i0.ɵɵComponentDeclaration<OperandAdvancedFieldGroupComponent, "acl-operand-advanced-field-group", never, { "fields": { "alias": "fields"; "required": false; }; "fieldList": { "alias": "fieldList"; "required": false; }; "formDataState": { "alias": "formDataState"; "required": false; }; "formErrors": { "alias": "formErrors"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; }, { "valueChange": "valueChange"; }, never, never, false, never>;
16
+ }
@@ -0,0 +1,8 @@
1
+ import { OnInit } from '@angular/core';
2
+ import { BaseOperandFiledArrayComponent } from '../abstract/base-array';
3
+ import * as i0 from "@angular/core";
4
+ export declare class OperandArrayFieldGroupComponent extends BaseOperandFiledArrayComponent implements OnInit {
5
+ ngOnInit(): void;
6
+ static ɵfac: i0.ɵɵFactoryDeclaration<OperandArrayFieldGroupComponent, never>;
7
+ static ɵcmp: i0.ɵɵComponentDeclaration<OperandArrayFieldGroupComponent, "acl-operand-array-field-group", never, {}, {}, never, never, false, never>;
8
+ }
@@ -0,0 +1,24 @@
1
+ import { EventEmitter, QueryList } from '@angular/core';
2
+ import { FieldValueChangeEvent, FormDataState, FormErrors, OperandField, OperandFieldGroup } from '../types';
3
+ import { CrdFormCustomDescriptionDirective } from '../utils';
4
+ import * as i0 from "@angular/core";
5
+ export declare class OperandFieldGroupComponent {
6
+ fields: OperandField[];
7
+ fieldGroup: OperandFieldGroup;
8
+ formDataState: FormDataState;
9
+ formErrors: FormErrors;
10
+ customDescriptions: QueryList<CrdFormCustomDescriptionDirective>;
11
+ readonly: boolean;
12
+ valueChange: EventEmitter<FieldValueChangeEvent>;
13
+ private _expanded;
14
+ get expanded(): boolean;
15
+ set expanded(expanded: boolean);
16
+ fieldValueChange(e: FieldValueChangeEvent): void;
17
+ getGroupName(field: OperandFieldGroup): string | import("@alauda-fe/common").LocaleDisplay | {
18
+ en: string;
19
+ zh: string;
20
+ };
21
+ getCustomDescription(customDescriptions: QueryList<CrdFormCustomDescriptionDirective>, field: OperandField): CrdFormCustomDescriptionDirective;
22
+ static ɵfac: i0.ɵɵFactoryDeclaration<OperandFieldGroupComponent, never>;
23
+ static ɵcmp: i0.ɵɵComponentDeclaration<OperandFieldGroupComponent, "acl-operand-field-group", never, { "fields": { "alias": "fields"; "required": false; }; "fieldGroup": { "alias": "fieldGroup"; "required": false; }; "formDataState": { "alias": "formDataState"; "required": false; }; "formErrors": { "alias": "formErrors"; "required": false; }; "customDescriptions": { "alias": "customDescriptions"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; }, { "valueChange": "valueChange"; }, never, never, false, never>;
24
+ }
@@ -0,0 +1,110 @@
1
+ import { Encoding, KubernetesResource, Translation } from '@alauda-fe/common';
2
+ import { HttpClient } from '@angular/common/http';
3
+ import { AfterViewInit, ChangeDetectorRef, EventEmitter, Injector, OnChanges, OnDestroy, OnInit, SimpleChanges } from '@angular/core';
4
+ import { FormControl } from '@angular/forms';
5
+ import { Observable, Subject, BehaviorSubject } from 'rxjs';
6
+ import { CrdFormComponent } from '../crd-form/component';
7
+ import { RemoteWidgetModuleDefinition } from '../remote-widgets';
8
+ import { FieldValueChangeEvent, FormDataState, FormErrors, OperandField, SpecCapability } from '../types';
9
+ import { CrdFormCustomDescriptionDirective, getDisplayByCapability, getFieldDescription, getFieldDisplayName, getFieldType, getRadioOptions } from '../utils';
10
+ import { isLink } from './widgets/link/component';
11
+ import * as i0 from "@angular/core";
12
+ export declare const PASSWORD_REVEAL = "******";
13
+ export declare class OperandFieldComponent implements OnInit, OnDestroy, OnChanges, AfterViewInit {
14
+ readonly crdForm: CrdFormComponent;
15
+ private readonly injector;
16
+ private readonly http;
17
+ private readonly cdr;
18
+ field: OperandField;
19
+ field$: Observable<OperandField>;
20
+ remoteModuleDefinition: RemoteWidgetModuleDefinition;
21
+ remoteModuleDefinition$: Observable<RemoteWidgetModuleDefinition>;
22
+ readonly: boolean;
23
+ get isDisabled(): boolean;
24
+ get effectControlDefaultValue(): boolean;
25
+ get isRequired(): boolean;
26
+ get isCreatable(): boolean;
27
+ get isMultiple(): boolean;
28
+ get isAllowCreate(): boolean;
29
+ get isClearable(): boolean;
30
+ fields: OperandField[];
31
+ formDataState: FormDataState;
32
+ formDataState$: Observable<FormDataState>;
33
+ formErrors: FormErrors;
34
+ customDescription: CrdFormCustomDescriptionDirective;
35
+ valueChange: EventEmitter<FieldValueChangeEvent>;
36
+ itemRemove: EventEmitter<any>;
37
+ get isHidden(): boolean;
38
+ set isHidden(hidden: boolean);
39
+ private _hidden;
40
+ control: FormControl<any>;
41
+ onDestroy$: Subject<void>;
42
+ getFieldType: typeof getFieldType;
43
+ isLink: typeof isLink;
44
+ SpecCapability: typeof SpecCapability;
45
+ getFieldDisplayName: typeof getFieldDisplayName;
46
+ getFieldDescription: typeof getFieldDescription;
47
+ getRadioOptions: typeof getRadioOptions;
48
+ getDisplayByCapability: typeof getDisplayByCapability;
49
+ editorOptions: import("@alauda-fe/common").IEditorConstructionOptions;
50
+ editorActions: import("@alauda/code-editor").CodeEditorActionsConfig;
51
+ isGroupField: (field: OperandField) => field is import("../types").OperandFieldGroup;
52
+ isArrayField: (field: OperandField) => field is import("../types").OperandArrayFieldGroup;
53
+ isRemoteField: (field: OperandField) => field is import("../types").OperandArrayFieldGroup;
54
+ isArrayFieldTable: (field: OperandField) => field is import("../types").OperandArrayFieldGroup;
55
+ convertBooleanSwitchValue: (value: boolean, capabilities: SpecCapability[]) => string | {
56
+ zh: string;
57
+ en: string;
58
+ };
59
+ loading$: BehaviorSubject<boolean>;
60
+ get isCustomErrorsMapper(): boolean;
61
+ PASSWORD_REVEAL: string;
62
+ isBasicTypeField: (filed: OperandField) => boolean;
63
+ viewActions: import("@alauda/code-editor").CodeEditorActionsConfig;
64
+ viewOptions: import("@alauda-fe/common").IEditorConstructionOptions;
65
+ private _validators;
66
+ remoteModule$: Observable<{
67
+ injector: Injector;
68
+ module: import("@angular/core").Type<unknown>;
69
+ component: import("@angular/core").Type<unknown>;
70
+ }>;
71
+ constructor(crdForm: CrdFormComponent, injector: Injector, http: HttpClient, cdr: ChangeDetectorRef);
72
+ registerControl(): void;
73
+ unRegisterControl(): void;
74
+ getWidgets: (capabilities: SpecCapability[]) => {
75
+ descriptor: string;
76
+ component: import("@angular/cdk/portal").ComponentType<any>;
77
+ };
78
+ getRemoteWidget(field: OperandField, remoteDefinition: RemoteWidgetModuleDefinition): {
79
+ descriptor: string;
80
+ component: import("@angular/core").Type<unknown>;
81
+ };
82
+ ngOnInit(): void;
83
+ ngAfterViewInit(): void;
84
+ ngOnDestroy(): void;
85
+ ngOnChanges({ formDataState }: SimpleChanges): void;
86
+ getFieldCurrentValue(): FormDataState;
87
+ getFieldValue(useDefault?: boolean): any;
88
+ getOptionDisplay(value: string, options: Array<{
89
+ value: string;
90
+ display: Translation;
91
+ }>): Translation;
92
+ getSelectOptions(field: OperandField): string[];
93
+ getEncoding(field: OperandField, type: string): Encoding;
94
+ private hasFieldDependency;
95
+ private checkFieldDependency;
96
+ dynamicOptions$: Observable<any>;
97
+ dynamicDefaultValue$: Observable<{
98
+ value: any;
99
+ isDynamic: boolean;
100
+ }>;
101
+ dynamicHiddenValue$: Observable<boolean>;
102
+ getStringExpressionContext: (formContext: any, formDataState: FormDataState) => {
103
+ fetchResourceList: (url: string, callback: (resource: KubernetesResource) => void) => Observable<any[] | void[]>;
104
+ context: any;
105
+ formData: any;
106
+ };
107
+ fetchResourceList: (url: string, callback: (resource: KubernetesResource) => void) => Observable<any[] | void[]>;
108
+ static ɵfac: i0.ɵɵFactoryDeclaration<OperandFieldComponent, never>;
109
+ static ɵcmp: i0.ɵɵComponentDeclaration<OperandFieldComponent, "acl-operand-field", never, { "field": { "alias": "field"; "required": false; }; "remoteModuleDefinition": { "alias": "remoteModuleDefinition"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; "fields": { "alias": "fields"; "required": false; }; "formDataState": { "alias": "formDataState"; "required": false; }; "formErrors": { "alias": "formErrors"; "required": false; }; "customDescription": { "alias": "customDescription"; "required": false; }; }, { "valueChange": "valueChange"; "itemRemove": "itemRemove"; }, never, never, false, never>;
110
+ }
@@ -0,0 +1,8 @@
1
+ import { OnInit } from '@angular/core';
2
+ import { BaseOperandFiledArrayComponent } from '../../../abstract/base-array';
3
+ import * as i0 from "@angular/core";
4
+ export declare class CrdFormArrayTableComponent extends BaseOperandFiledArrayComponent implements OnInit {
5
+ ngOnInit(): void;
6
+ static ɵfac: i0.ɵɵFactoryDeclaration<CrdFormArrayTableComponent, never>;
7
+ static ɵcmp: i0.ɵɵComponentDeclaration<CrdFormArrayTableComponent, "acl-crd-array-table", never, {}, {}, never, never, false, never>;
8
+ }
@@ -0,0 +1,26 @@
1
+ import { DialogService } from '@alauda/ui';
2
+ import { K8sApiService, K8sUtilService, Secret } from '@alauda-fe/common';
3
+ import { Injector } from '@angular/core';
4
+ import { BaseResourceFormComponent } from 'ng-resource-form-util';
5
+ import { Observable, Subject } from 'rxjs';
6
+ import { CrdFormComponent } from '../../../crd-form/component';
7
+ import { OperandField } from '../../../types';
8
+ import { BasicAuthSecretConfig } from './type';
9
+ import * as i0 from "@angular/core";
10
+ export declare class BasicAuthSecretComponent extends BaseResourceFormComponent<string> {
11
+ private readonly k8sApi;
12
+ private readonly crdForm;
13
+ private readonly dialog;
14
+ private readonly k8sUtil;
15
+ required: boolean;
16
+ field: OperandField;
17
+ field$: Observable<OperandField>;
18
+ config$: Observable<BasicAuthSecretConfig>;
19
+ reload$: Subject<void>;
20
+ resources$: Observable<Secret<import("@alauda-fe/common").StringMap>[]>;
21
+ constructor(injector: Injector, k8sApi: K8sApiService, crdForm: CrdFormComponent, dialog: DialogService, k8sUtil: K8sUtilService);
22
+ createForm(): import("@angular/forms").FormControl<any>;
23
+ create(): void;
24
+ static ɵfac: i0.ɵɵFactoryDeclaration<BasicAuthSecretComponent, never>;
25
+ static ɵcmp: i0.ɵɵComponentDeclaration<BasicAuthSecretComponent, "acl-crd-basic-auth-secret", never, { "required": { "alias": "required"; "required": false; }; "field": { "alias": "field"; "required": false; }; }, {}, never, never, false, never>;
26
+ }
@@ -0,0 +1,45 @@
1
+ import { DialogRef, MessageService } from '@alauda/ui';
2
+ import { K8sApiService, TranslateService } from '@alauda-fe/common';
3
+ import { ChangeDetectorRef } from '@angular/core';
4
+ import { FormBuilder, FormGroupDirective } from '@angular/forms';
5
+ import { BasicAuthSecretConfig } from '../type';
6
+ import * as i0 from "@angular/core";
7
+ export declare class BasicAuthCreateSecretDialogComponent {
8
+ readonly dialogData: {
9
+ cluster: string;
10
+ namespace: string;
11
+ config?: BasicAuthSecretConfig;
12
+ };
13
+ private readonly dialogRef;
14
+ private readonly fb;
15
+ private readonly k8sApi;
16
+ private readonly cdr;
17
+ private readonly message;
18
+ private readonly translate;
19
+ readonly form: FormGroupDirective;
20
+ submitting: boolean;
21
+ K8S_RESOURCE_NAME_BASE: {
22
+ pattern: RegExp;
23
+ tip: string;
24
+ };
25
+ usernameKey: string;
26
+ passwordKey: string;
27
+ usernameReadonly: boolean;
28
+ strongPassword: boolean;
29
+ password: boolean;
30
+ showPassword: boolean;
31
+ formGroup: import("@angular/forms").FormGroup<{
32
+ name: import("@angular/forms").FormControl<string>;
33
+ username: import("@angular/forms").FormControl<string>;
34
+ password: import("@angular/forms").FormControl<string>;
35
+ }>;
36
+ constructor(dialogData: {
37
+ cluster: string;
38
+ namespace: string;
39
+ config?: BasicAuthSecretConfig;
40
+ }, dialogRef: DialogRef, fb: FormBuilder, k8sApi: K8sApiService, cdr: ChangeDetectorRef, message: MessageService, translate: TranslateService);
41
+ confirm(): void;
42
+ toggleShowPassword(): void;
43
+ static ɵfac: i0.ɵɵFactoryDeclaration<BasicAuthCreateSecretDialogComponent, never>;
44
+ static ɵcmp: i0.ɵɵComponentDeclaration<BasicAuthCreateSecretDialogComponent, "ng-component", never, {}, {}, never, never, false, never>;
45
+ }
@@ -0,0 +1,11 @@
1
+ export interface BasicAuthSecretConfig {
2
+ secretName?: string;
3
+ usernameKey?: string;
4
+ usernameDefault?: string;
5
+ usernameReadonly?: boolean;
6
+ passwordKey?: string;
7
+ strongPassword?: boolean;
8
+ password?: boolean;
9
+ namespace?: string;
10
+ cluster?: string;
11
+ }
@@ -0,0 +1,7 @@
1
+ export * from './array-table/component';
2
+ export * from './basic-auth-secret/component';
3
+ export * from './basic-auth-secret/create/component';
4
+ export * from './k8s-resource-prefix/component';
5
+ export * from './link/component';
6
+ export * from './resource-requirements/resource-requirements.component';
7
+ export * from './yaml-editor/yaml-editor.component';
@@ -0,0 +1,35 @@
1
+ import { K8sApiService, K8sResourceDefinitions } from '@alauda-fe/common';
2
+ import { Injector } from '@angular/core';
3
+ import { BaseResourceFormComponent } from 'ng-resource-form-util';
4
+ import { BehaviorSubject, Observable } from 'rxjs';
5
+ import { CrdFormComponent } from '../../../crd-form/component';
6
+ import { FormErrors, OperandField } from '../../../types';
7
+ import * as i0 from "@angular/core";
8
+ export declare class K8sResourcePrefixComponent extends BaseResourceFormComponent {
9
+ private readonly k8sApi;
10
+ private readonly crdForm;
11
+ private readonly resourceDefinitions;
12
+ constructor(injector: Injector, k8sApi: K8sApiService, crdForm: CrdFormComponent, resourceDefinitions: K8sResourceDefinitions);
13
+ init$$: BehaviorSubject<boolean>;
14
+ field: OperandField;
15
+ field$: Observable<OperandField>;
16
+ readonly: boolean;
17
+ /**
18
+ * crd-form 的 errorState 是由全局的 FormError 对象建立的,为满足单一数据源的设计,自定义 widget 的 error 可以由外部传入,
19
+ * 所有的 validation 在 field 级别校验,widget 只需要在关心校验失败时进行合理展示
20
+ */
21
+ formErrors: FormErrors;
22
+ options$: Observable<{
23
+ namespaced: boolean;
24
+ labelSelector: string;
25
+ isGlobal: boolean;
26
+ groupVersionKind: string;
27
+ type: string;
28
+ multiple: boolean;
29
+ validations: import("../../../types").OperandFieldValidation;
30
+ }>;
31
+ resources$: Observable<import("@alauda-fe/common").KubernetesResource[]>;
32
+ createForm(): import("@angular/forms").FormControl<any>;
33
+ static ɵfac: i0.ɵɵFactoryDeclaration<K8sResourcePrefixComponent, never>;
34
+ static ɵcmp: i0.ɵɵComponentDeclaration<K8sResourcePrefixComponent, "acl-crd-resource-prefix", never, { "field": { "alias": "field"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; "formErrors": { "alias": "formErrors"; "required": false; }; }, {}, never, never, false, never>;
35
+ }
@@ -0,0 +1,3 @@
1
+ import { K8sResourceDefinitions } from '@alauda-fe/common';
2
+ export declare function findResourceType(type: string, definitions: K8sResourceDefinitions): string;
3
+ export declare function plural(word: string): string;
@@ -0,0 +1,20 @@
1
+ import { OperandField } from '../../../types';
2
+ import * as i0 from "@angular/core";
3
+ interface LinkOptions {
4
+ target?: string;
5
+ }
6
+ export declare function isLink(field: OperandField): boolean;
7
+ /**
8
+ * 获取链接参数
9
+ *
10
+ * @see https://jira.alauda.cn/browse/ACP-32703
11
+ */
12
+ export declare function resolveLinkOptions(field: OperandField): LinkOptions;
13
+ declare const LinkComponent_base: new () => import("@alauda-fe/common").BaseNestedFormControl<string, string>;
14
+ export declare class LinkComponent extends LinkComponent_base {
15
+ field: OperandField;
16
+ get options(): LinkOptions;
17
+ static ɵfac: i0.ɵɵFactoryDeclaration<LinkComponent, never>;
18
+ static ɵcmp: i0.ɵɵComponentDeclaration<LinkComponent, "acl-crd-link", never, { "field": { "alias": "field"; "required": false; }; }, {}, never, never, true, never>;
19
+ }
20
+ export {};
@@ -0,0 +1,88 @@
1
+ import { getResourceValue, getResourceViewModel, ResourceRequirementFormModal, ResourceRequirementStrict, TranslateService } from '@alauda-fe/common';
2
+ import { Injector, OnInit } from '@angular/core';
3
+ import { ControlContainer, FormControl, FormGroup } from '@angular/forms';
4
+ import { BaseResourceFormGroupComponent } from 'ng-resource-form-util';
5
+ import { OperandField } from '../../../types';
6
+ import { getFieldDescription, getFieldDisplayName } from '../../../utils';
7
+ import { OperandFieldComponent } from '../../operand-field.component';
8
+ import * as i0 from "@angular/core";
9
+ export declare class ResourceRequirementsComponent extends BaseResourceFormGroupComponent<ResourceRequirementStrict, ResourceRequirementFormModal> implements OnInit {
10
+ private readonly fieldComponent;
11
+ readonly controlContainer: ControlContainer;
12
+ readonly translate: TranslateService;
13
+ readOnly: boolean;
14
+ field: OperandField;
15
+ get requiredOptions(): {
16
+ required: {
17
+ limit: string[];
18
+ request: string[];
19
+ };
20
+ };
21
+ get limitMemoryRequired(): boolean;
22
+ get limitCpuRequired(): boolean;
23
+ get requestMemoryRequired(): boolean;
24
+ get requestCpuRequired(): boolean;
25
+ get minMaxOptions(): {
26
+ min: {
27
+ limits: any;
28
+ requests: any;
29
+ };
30
+ max: {
31
+ limits: any;
32
+ requests: any;
33
+ };
34
+ };
35
+ get limitMemoryMin(): any;
36
+ get limitCpuMin(): any;
37
+ get requestMemoryMin(): any;
38
+ get requestCpuMin(): any;
39
+ get limitMemoryMax(): any;
40
+ get limitCpuMax(): any;
41
+ get requestMemoryMax(): any;
42
+ get requestCpuMax(): any;
43
+ resourceUnits: {
44
+ cpu: {
45
+ value: string;
46
+ label: string;
47
+ }[];
48
+ memory: string[];
49
+ };
50
+ getFieldDisplayName: typeof getFieldDisplayName;
51
+ getFieldDescription: typeof getFieldDescription;
52
+ getResourceValue: typeof getResourceValue;
53
+ getResourceViewModel: typeof getResourceViewModel;
54
+ constructor(injector: Injector, fieldComponent: OperandFieldComponent, controlContainer: ControlContainer, translate: TranslateService);
55
+ ngOnInit(): void;
56
+ createForm(): FormGroup<{
57
+ limits: FormGroup<{
58
+ cpu: FormGroup<{
59
+ value: FormControl<string>;
60
+ unit: FormControl<string>;
61
+ }>;
62
+ memory: FormGroup<{
63
+ value: FormControl<string>;
64
+ unit: FormControl<string>;
65
+ }>;
66
+ }>;
67
+ requests: FormGroup<{
68
+ cpu: FormGroup<{
69
+ value: FormControl<string>;
70
+ unit: FormControl<string>;
71
+ }>;
72
+ memory: FormGroup<{
73
+ value: FormControl<string>;
74
+ unit: FormControl<string>;
75
+ }>;
76
+ }>;
77
+ }>;
78
+ getDefaultFormModel(): ResourceRequirementFormModal;
79
+ adaptFormModel(formModel: ResourceRequirementFormModal): ResourceRequirementStrict;
80
+ private minValidator;
81
+ private maxValidator;
82
+ formatFormModel(formModel: ResourceRequirementFormModal): void;
83
+ getCpuUnitLabel(value: 'm' | 'c'): string;
84
+ adaptResourceModel(resources: ResourceRequirementStrict): ResourceRequirementFormModal;
85
+ getMinOrMaxErrorsMapper(value: string, kind: 'min' | 'max', type: 'cpu' | 'memory', _locale: string): string;
86
+ static ɵfac: i0.ɵɵFactoryDeclaration<ResourceRequirementsComponent, [null, { optional: true; }, { optional: true; }, null]>;
87
+ static ɵcmp: i0.ɵɵComponentDeclaration<ResourceRequirementsComponent, "acl-crd-resource-requirements", never, { "readOnly": { "alias": "readOnly"; "required": false; }; "field": { "alias": "field"; "required": false; }; }, {}, never, never, false, never>;
88
+ }
@@ -0,0 +1,17 @@
1
+ import { OperandField } from '../../types';
2
+ export declare function resolveRequirementsRequiredOptions(field: OperandField): {
3
+ required: {
4
+ limit: string[];
5
+ request: string[];
6
+ };
7
+ };
8
+ export declare function resolveRequirementsMinOrMaxOptions(field: OperandField): {
9
+ min: {
10
+ limits: any;
11
+ requests: any;
12
+ };
13
+ max: {
14
+ limits: any;
15
+ requests: any;
16
+ };
17
+ };
@@ -0,0 +1,36 @@
1
+ import { CodeEditorActionsConfig, MonacoEditorOptions } from '@alauda/code-editor';
2
+ import { Injector } from '@angular/core';
3
+ import { BaseResourceFormGroupComponent } from 'ng-resource-form-util';
4
+ import { OperandFieldComponent } from '../../operand-field.component';
5
+ import * as i0 from "@angular/core";
6
+ export interface YamlEditorFormModel {
7
+ yaml: string;
8
+ }
9
+ export declare class YamlEditorComponent extends BaseResourceFormGroupComponent<unknown, YamlEditorFormModel> {
10
+ private readonly fieldComponent;
11
+ actionsConfig: CodeEditorActionsConfig;
12
+ options: MonacoEditorOptions;
13
+ disabledActionsConfig: CodeEditorActionsConfig;
14
+ resultFormat: string;
15
+ constructor(injector: Injector, fieldComponent: OperandFieldComponent);
16
+ private getResultFormat;
17
+ createForm(): import("@angular/forms").FormGroup<{
18
+ yaml: import("@angular/forms").FormControl<unknown>;
19
+ }>;
20
+ private getDisabledActionsConfig;
21
+ adaptResourceModel(resource: unknown): YamlEditorFormModel;
22
+ adaptFormModel(formModel: YamlEditorFormModel): string | YamlEditorFormModel;
23
+ getActionsConfig(defaultActions: CodeEditorActionsConfig, disabledActions: CodeEditorActionsConfig): {
24
+ diffMode?: boolean;
25
+ recover?: boolean;
26
+ clear?: boolean;
27
+ find?: boolean;
28
+ copy?: boolean;
29
+ theme?: boolean;
30
+ fullscreen?: boolean;
31
+ export?: boolean;
32
+ import?: boolean;
33
+ };
34
+ static ɵfac: i0.ɵɵFactoryDeclaration<YamlEditorComponent, never>;
35
+ static ɵcmp: i0.ɵɵComponentDeclaration<YamlEditorComponent, "acl-crd-yaml-editor", never, { "actionsConfig": { "alias": "actionsConfig"; "required": false; }; "options": { "alias": "options"; "required": false; }; }, {}, never, never, false, never>;
36
+ }
@@ -0,0 +1,9 @@
1
+ import { OperandFieldComponent } from '../../field-controls';
2
+ import * as i0 from "@angular/core";
3
+ export declare class HtpasswdComponent {
4
+ fieldComponent: OperandFieldComponent;
5
+ isUpdate: boolean;
6
+ constructor(fieldComponent: OperandFieldComponent);
7
+ static ɵfac: i0.ɵɵFactoryDeclaration<HtpasswdComponent, never>;
8
+ static ɵcmp: i0.ɵɵComponentDeclaration<HtpasswdComponent, "ng-component", never, {}, {}, never, never, false, never>;
9
+ }
@@ -0,0 +1,32 @@
1
+ import { FormGroup } from '@angular/forms';
2
+ import { BaseResourceFormComponent } from 'ng-resource-form-util';
3
+ import { OperandField } from '../../types';
4
+ import * as i0 from "@angular/core";
5
+ export declare class HtpasswdFormComponent extends BaseResourceFormComponent<string, {
6
+ username: string;
7
+ password: string;
8
+ }, FormGroup> {
9
+ field: OperandField;
10
+ required: boolean;
11
+ isUpdate: boolean;
12
+ originalUsername: string;
13
+ originalResource: string;
14
+ createForm(): FormGroup<{
15
+ username: import("@angular/forms").FormControl<string>;
16
+ password: import("@angular/forms").FormControl<string>;
17
+ }>;
18
+ adaptResourceModel(resource: string): {
19
+ username: string;
20
+ password: string;
21
+ };
22
+ adaptFormModel({ username, password, }: {
23
+ username: string;
24
+ password: string;
25
+ }): string;
26
+ getLabel(field: OperandField, type: 'username' | 'password'): "username" | "password" | {
27
+ en: string;
28
+ zh: string;
29
+ };
30
+ static ɵfac: i0.ɵɵFactoryDeclaration<HtpasswdFormComponent, never>;
31
+ static ɵcmp: i0.ɵɵComponentDeclaration<HtpasswdFormComponent, "acl-htpasswd-form", never, { "field": { "alias": "field"; "required": false; }; "required": { "alias": "required"; "required": false; }; "isUpdate": { "alias": "isUpdate"; "required": false; }; }, {}, never, never, false, never>;
32
+ }
@@ -0,0 +1,3 @@
1
+ export * from './component';
2
+ export * from './form';
3
+ export * from './module';
@@ -0,0 +1,13 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./component";
3
+ import * as i2 from "./form";
4
+ import * as i3 from "@angular/common";
5
+ import * as i4 from "@angular/forms";
6
+ import * as i5 from "@alauda/ui";
7
+ import * as i6 from "@alauda-fe/common";
8
+ import * as i7 from "../../field-controls/module";
9
+ export declare class HtpasswdModule {
10
+ static ɵfac: i0.ɵɵFactoryDeclaration<HtpasswdModule, never>;
11
+ static ɵmod: i0.ɵɵNgModuleDeclaration<HtpasswdModule, [typeof i1.HtpasswdComponent, typeof i2.HtpasswdFormComponent], [typeof i3.CommonModule, typeof i4.FormsModule, typeof i4.ReactiveFormsModule, typeof i5.FormModule, typeof i5.InputModule, typeof i6.ErrorsMapperModule, typeof i6.StrongPasswordValidatorModule, typeof i6.TranslateModule, typeof i6.CoreModule, typeof i7.FieldControlsModule], [typeof i1.HtpasswdComponent, typeof i2.HtpasswdFormComponent]>;
12
+ static ɵinj: i0.ɵɵInjectorDeclaration<HtpasswdModule>;
13
+ }
@@ -0,0 +1 @@
1
+ export * from './htpasswd';
@@ -0,0 +1,3 @@
1
+ export declare const DEFAULT_REMOTE_MFE_MANIFEST: {
2
+ remotis: string;
3
+ };
@@ -0,0 +1,3 @@
1
+ export * from './constants';
2
+ export * from './remote-widget.service';
3
+ export * from './token';
@@ -0,0 +1,28 @@
1
+ import { K8sApiService, KubernetesResource, StringMap } from '@alauda-fe/common';
2
+ import { OnDestroy, Type } from '@angular/core';
3
+ import * as i0 from "@angular/core";
4
+ export interface ConfigMap<T = StringMap> extends KubernetesResource {
5
+ data?: T;
6
+ binaryData?: StringMap;
7
+ }
8
+ export interface RemoteWidget {
9
+ descriptor: string;
10
+ component: Type<unknown>;
11
+ }
12
+ export interface RemoteWidgetModuleDefinition {
13
+ components: Array<{
14
+ descriptor: string;
15
+ component: Type<unknown>;
16
+ }>;
17
+ module: Type<unknown>;
18
+ }
19
+ export declare class RemoteWidgetsService implements OnDestroy {
20
+ private readonly k8sApi;
21
+ private readonly manifest;
22
+ private readonly destroy$$;
23
+ readonly remoteModule$: import("rxjs").Observable<RemoteWidgetModuleDefinition>;
24
+ constructor(k8sApi: K8sApiService, manifest: StringMap);
25
+ ngOnDestroy(): void;
26
+ static ɵfac: i0.ɵɵFactoryDeclaration<RemoteWidgetsService, never>;
27
+ static ɵprov: i0.ɵɵInjectableDeclaration<RemoteWidgetsService>;
28
+ }
@@ -0,0 +1,3 @@
1
+ import { StringMap } from '@alauda-fe/common';
2
+ import { InjectionToken } from '@angular/core';
3
+ export declare const REMOTE_MFE_MANIFEST: InjectionToken<StringMap>;
@@ -0,0 +1,20 @@
1
+ import { OperandField, SpecCapability } from '../../types';
2
+ import { getFieldDescription, getFieldDisplayName } from '../../utils';
3
+ import * as i0 from "@angular/core";
4
+ export declare class SpecCapabilityComponent {
5
+ field: OperandField;
6
+ fields: OperandField[];
7
+ data: unknown;
8
+ get isHidden(): boolean;
9
+ SpecCapability: typeof SpecCapability;
10
+ getFieldDisplayName: typeof getFieldDisplayName;
11
+ getFieldDescription: typeof getFieldDescription;
12
+ yamlReadOptions: import("@alauda-fe/common").IEditorConstructionOptions;
13
+ viewActions: import("@alauda/code-editor").CodeEditorActionsConfig;
14
+ isArrayField: (field: OperandField) => field is import("../../types").OperandArrayFieldGroup;
15
+ getCapability(capabilities: SpecCapability[]): SpecCapability;
16
+ toDefault(input: unknown): string;
17
+ shouldBeHidden(): boolean;
18
+ static ɵfac: i0.ɵɵFactoryDeclaration<SpecCapabilityComponent, never>;
19
+ static ɵcmp: i0.ɵɵComponentDeclaration<SpecCapabilityComponent, "acl-spec-descriptor-capability", never, { "field": { "alias": "field"; "required": false; }; "fields": { "alias": "fields"; "required": false; }; "data": { "alias": "data"; "required": false; }; }, {}, never, never, false, never>;
20
+ }