@ng-nest/ui 20.1.6 → 20.1.7
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/attachments/index.d.ts +277 -0
- package/auto-complete/index.d.ts +1 -0
- package/card/index.d.ts +12 -2
- package/core/index.d.ts +40 -3
- package/dropdown/index.d.ts +30 -8
- package/fesm2022/ng-nest-ui-attachments.mjs +331 -0
- package/fesm2022/ng-nest-ui-attachments.mjs.map +1 -0
- package/fesm2022/ng-nest-ui-auto-complete.mjs +3 -0
- package/fesm2022/ng-nest-ui-auto-complete.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-card.mjs +11 -5
- package/fesm2022/ng-nest-ui-card.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-core.mjs +29 -1
- package/fesm2022/ng-nest-ui-core.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-dropdown.mjs +160 -38
- package/fesm2022/ng-nest-ui-dropdown.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-image.mjs +2 -2
- package/fesm2022/ng-nest-ui-image.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-list.mjs +31 -7
- package/fesm2022/ng-nest-ui-list.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-prompts.mjs +8 -3
- package/fesm2022/ng-nest-ui-prompts.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-select.mjs +3 -0
- package/fesm2022/ng-nest-ui-select.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-sender.mjs +6 -5
- package/fesm2022/ng-nest-ui-sender.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-suggestion.mjs +110 -0
- package/fesm2022/ng-nest-ui-suggestion.mjs.map +1 -0
- package/fesm2022/ng-nest-ui-thought-chain.mjs +121 -0
- package/fesm2022/ng-nest-ui-thought-chain.mjs.map +1 -0
- package/fesm2022/ng-nest-ui-timeline.mjs +27 -5
- package/fesm2022/ng-nest-ui-timeline.mjs.map +1 -1
- package/fesm2022/ng-nest-ui-upload.mjs +205 -11
- package/fesm2022/ng-nest-ui-upload.mjs.map +1 -1
- package/fesm2022/ng-nest-ui.mjs +4 -0
- package/fesm2022/ng-nest-ui.mjs.map +1 -1
- package/index.d.ts +4 -0
- package/list/index.d.ts +30 -18
- package/package.json +57 -45
- package/prompts/index.d.ts +17 -2
- package/select/index.d.ts +1 -0
- package/sender/index.d.ts +1 -0
- package/suggestion/index.d.ts +96 -0
- package/thought-chain/index.d.ts +107 -0
- package/timeline/index.d.ts +35 -19
- package/upload/index.d.ts +39 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, output, Component, ChangeDetectionStrategy, ViewEncapsulation, viewChild, signal, computed, NgModule } from '@angular/core';
|
|
2
|
+
import { input, output, Component, ChangeDetectionStrategy, ViewEncapsulation, inject, ElementRef, viewChild, signal, computed, NgModule } from '@angular/core';
|
|
3
3
|
import { XFormControlFunction, XValueAccessor } from '@ng-nest/ui/base-form';
|
|
4
4
|
import { XToNumber, XToBoolean } from '@ng-nest/ui/core';
|
|
5
5
|
import * as i1 from '@angular/cdk/text-field';
|
|
@@ -118,16 +118,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImpor
|
|
|
118
118
|
|
|
119
119
|
class XSenderStopComponent {
|
|
120
120
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: XSenderStopComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
121
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.0", type: XSenderStopComponent, isStandalone: true, selector: "x-sender-stop", ngImport: i0, template: "<div class=\"x-sender-stop\">\r\n <svg color=\"currentColor\" viewBox=\"0 0 1000 1000\" xmlns=\"http://www.w3.org/2000/svg\">\r\n <rect fill=\"currentColor\" height=\"
|
|
121
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.0", type: XSenderStopComponent, isStandalone: true, selector: "x-sender-stop", ngImport: i0, template: "<div class=\"x-sender-stop\">\r\n <svg color=\"currentColor\" viewBox=\"0 0 1000 1000\" xmlns=\"http://www.w3.org/2000/svg\">\r\n <rect fill=\"currentColor\" height=\"400\" width=\"400\" rx=\"45\" ry=\"45\" x=\"300\" y=\"300\"></rect>\r\n <circle cx=\"500\" cy=\"500\" fill=\"none\" r=\"450\" stroke=\"currentColor\" stroke-width=\"100\" opacity=\"0.45\"></circle>\r\n <circle\r\n cx=\"500\"\r\n cy=\"500\"\r\n fill=\"none\"\r\n r=\"450\"\r\n stroke=\"currentColor\"\r\n stroke-width=\"100\"\r\n stroke-dasharray=\"600 9999999\"\r\n >\r\n <animateTransform\r\n attributeName=\"transform\"\r\n dur=\"1s\"\r\n from=\"0 500 500\"\r\n repeatCount=\"indefinite\"\r\n to=\"360 500 500\"\r\n type=\"rotate\"\r\n ></animateTransform>\r\n </circle>\r\n </svg>\r\n</div>\r\n", styles: [".x-sender-stop{margin:0;padding:0}.x-sender-stop{display:flex;align-items:center;justify-content:center;will-change:color,background-color,border,box-shadow;transition:color var(--x-animation-duration-base) ease-in-out,background-color var(--x-animation-duration-base) ease-in-out,border var(--x-animation-duration-base) ease-in-out,box-shadow var(--x-animation-duration-base) ease-in-out;cursor:pointer;border-radius:50%}.x-sender-stop:hover{background-color:var(--x-primary-900)}.x-sender-stop svg{color:var(--x-primary);width:var(--x-height-medium);height:var(--x-height-medium)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
122
122
|
}
|
|
123
123
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: XSenderStopComponent, decorators: [{
|
|
124
124
|
type: Component,
|
|
125
|
-
args: [{ selector: 'x-sender-stop', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [], template: "<div class=\"x-sender-stop\">\r\n <svg color=\"currentColor\" viewBox=\"0 0 1000 1000\" xmlns=\"http://www.w3.org/2000/svg\">\r\n <rect fill=\"currentColor\" height=\"
|
|
125
|
+
args: [{ selector: 'x-sender-stop', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [], template: "<div class=\"x-sender-stop\">\r\n <svg color=\"currentColor\" viewBox=\"0 0 1000 1000\" xmlns=\"http://www.w3.org/2000/svg\">\r\n <rect fill=\"currentColor\" height=\"400\" width=\"400\" rx=\"45\" ry=\"45\" x=\"300\" y=\"300\"></rect>\r\n <circle cx=\"500\" cy=\"500\" fill=\"none\" r=\"450\" stroke=\"currentColor\" stroke-width=\"100\" opacity=\"0.45\"></circle>\r\n <circle\r\n cx=\"500\"\r\n cy=\"500\"\r\n fill=\"none\"\r\n r=\"450\"\r\n stroke=\"currentColor\"\r\n stroke-width=\"100\"\r\n stroke-dasharray=\"600 9999999\"\r\n >\r\n <animateTransform\r\n attributeName=\"transform\"\r\n dur=\"1s\"\r\n from=\"0 500 500\"\r\n repeatCount=\"indefinite\"\r\n to=\"360 500 500\"\r\n type=\"rotate\"\r\n ></animateTransform>\r\n </circle>\r\n </svg>\r\n</div>\r\n", styles: [".x-sender-stop{margin:0;padding:0}.x-sender-stop{display:flex;align-items:center;justify-content:center;will-change:color,background-color,border,box-shadow;transition:color var(--x-animation-duration-base) ease-in-out,background-color var(--x-animation-duration-base) ease-in-out,border var(--x-animation-duration-base) ease-in-out,box-shadow var(--x-animation-duration-base) ease-in-out;cursor:pointer;border-radius:50%}.x-sender-stop:hover{background-color:var(--x-primary-900)}.x-sender-stop svg{color:var(--x-primary);width:var(--x-height-medium);height:var(--x-height-medium)}\n"] }]
|
|
126
126
|
}] });
|
|
127
127
|
|
|
128
128
|
class XSenderComponent extends XSenderProperty {
|
|
129
129
|
constructor() {
|
|
130
130
|
super(...arguments);
|
|
131
|
+
this.elementRef = inject(ElementRef);
|
|
131
132
|
this.textarea = viewChild.required('textarea');
|
|
132
133
|
this.focused = signal(false, ...(ngDevMode ? [{ debugName: "focused" }] : []));
|
|
133
134
|
this.maxRowsComputed = computed(() => {
|
|
@@ -178,11 +179,11 @@ class XSenderComponent extends XSenderProperty {
|
|
|
178
179
|
this.onChange(value);
|
|
179
180
|
}
|
|
180
181
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: XSenderComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
181
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.0", type: XSenderComponent, isStandalone: true, selector: "x-sender", providers: [XValueAccessor(XSenderComponent)], viewQueries: [{ propertyName: "textarea", first: true, predicate: ["textarea"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<div\r\n class=\"x-sender\"\r\n [class.x-disabled]=\"disabledComputed()\"\r\n [class.x-required]=\"requiredIsEmpty()\"\r\n [class.x-invalid]=\"invalid()\"\r\n [class.x-focused]=\"focused()\"\r\n>\r\n <div class=\"x-sender-wrapper\">\r\n @if (header()) {\r\n <div class=\"x-sender-header\">\r\n <ng-container *ngTemplateOutlet=\"header()\"></ng-container>\r\n </div>\r\n }\r\n <div class=\"x-sender-content\" (click)=\"inputFocus('after')\">\r\n @if (prefix()) {\r\n <div class=\"x-sender-prefix\">\r\n <ng-container *ngTemplateOutlet=\"prefix()\"></ng-container>\r\n </div>\r\n }\r\n <textarea\r\n #textarea\r\n [disabled]=\"disabledComputed()\"\r\n [required]=\"requiredComputed()\"\r\n [readOnly]=\"readonly()\"\r\n [placeholder]=\"placeholderComputed()\"\r\n [(ngModel)]=\"value\"\r\n (ngModelChange)=\"change($event)\"\r\n cdkTextareaAutosize\r\n [cdkAutosizeMinRows]=\"minRows()\"\r\n [cdkAutosizeMaxRows]=\"maxRowsComputed()\"\r\n (keydown)=\"onKeydown($event)\"\r\n (focus)=\"focused.set(true)\"\r\n (blur)=\"focused.set(false)\"\r\n (input)=\"formControlValidator()\"\r\n (click)=\"$event.stopPropagation()\"\r\n class=\"x-sender-textarea\"\r\n ></textarea>\r\n\r\n @if (suffix()) {\r\n <div class=\"x-sender-suffix\">\r\n <ng-container *ngTemplateOutlet=\"suffix()\"></ng-container>\r\n </div>\r\n } @else {\r\n @if (!footer()) {\r\n <div class=\"x-sender-suffix\">\r\n @if (!loading()) {\r\n <x-button\r\n type=\"primary\"\r\n circle\r\n flat\r\n icon=\"fto-send\"\r\n [loading]=\"loading()\"\r\n [disabled]=\"disabledComputed()\"\r\n (click)=\"onEnterPressed($event)\"\r\n ></x-button>\r\n } @else {\r\n <x-sender-stop (click)=\"onStop($event)\"></x-sender-stop>\r\n }\r\n </div>\r\n }\r\n }\r\n </div>\r\n @if (footer()) {\r\n <div class=\"x-sender-footer\">\r\n <ng-container *ngTemplateOutlet=\"footer()\"></ng-container>\r\n </div>\r\n }\r\n @if (requiredIsEmpty() || invalid()) {\r\n <div class=\"x-border-error x-top-left\"></div>\r\n <div class=\"x-border-error x-top-right\"></div>\r\n <div class=\"x-border-error x-bottom-left\"></div>\r\n <div class=\"x-border-error x-bottom-right\"></div>\r\n }\r\n </div>\r\n</div>\r\n", styles: [".x-sender{margin:0;padding:0}.x-sender-wrapper{position:relative;border:var(--x-border-width) var(--x-border-style) var(--x-border);border-radius:var(--x-border-radius);background-color:var(--x-background);transition:all var(--x-animation-duration-slow)}.x-sender-wrapper:hover{border-color:var(--x-primary-300)}.x-sender-content{display:flex;align-items:flex-end;padding:var(--x-padding-small) var(--x-padding-medium);gap:var(--x-padding-small);width:100%;cursor:text}.x-sender-textarea{padding:0;flex:auto;align-self:center;min-height:auto;line-height:1.5;vertical-align:bottom;background-color:transparent;resize:none;border:none;outline:none}.x-sender
|
|
182
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.0", type: XSenderComponent, isStandalone: true, selector: "x-sender", providers: [XValueAccessor(XSenderComponent)], viewQueries: [{ propertyName: "textarea", first: true, predicate: ["textarea"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<div\r\n class=\"x-sender\"\r\n [class.x-disabled]=\"disabledComputed()\"\r\n [class.x-required]=\"requiredIsEmpty()\"\r\n [class.x-invalid]=\"invalid()\"\r\n [class.x-focused]=\"focused()\"\r\n>\r\n <div class=\"x-sender-wrapper\">\r\n @if (header()) {\r\n <div class=\"x-sender-header\">\r\n <ng-container *ngTemplateOutlet=\"header()\"></ng-container>\r\n </div>\r\n }\r\n <div class=\"x-sender-content\" (click)=\"inputFocus('after')\">\r\n @if (prefix()) {\r\n <div class=\"x-sender-prefix\">\r\n <ng-container *ngTemplateOutlet=\"prefix()\"></ng-container>\r\n </div>\r\n }\r\n <textarea\r\n #textarea\r\n [disabled]=\"disabledComputed()\"\r\n [required]=\"requiredComputed()\"\r\n [readOnly]=\"readonly()\"\r\n [placeholder]=\"placeholderComputed()\"\r\n [(ngModel)]=\"value\"\r\n (ngModelChange)=\"change($event)\"\r\n cdkTextareaAutosize\r\n [cdkAutosizeMinRows]=\"minRows()\"\r\n [cdkAutosizeMaxRows]=\"maxRowsComputed()\"\r\n (keydown)=\"onKeydown($event)\"\r\n (focus)=\"focused.set(true)\"\r\n (blur)=\"focused.set(false)\"\r\n (input)=\"formControlValidator()\"\r\n (click)=\"$event.stopPropagation()\"\r\n class=\"x-sender-textarea\"\r\n ></textarea>\r\n\r\n @if (suffix()) {\r\n <div class=\"x-sender-suffix\">\r\n <ng-container *ngTemplateOutlet=\"suffix()\"></ng-container>\r\n </div>\r\n } @else {\r\n @if (!footer()) {\r\n <div class=\"x-sender-suffix\">\r\n @if (!loading()) {\r\n <x-button\r\n type=\"primary\"\r\n circle\r\n flat\r\n icon=\"fto-send\"\r\n [loading]=\"loading()\"\r\n [disabled]=\"disabledComputed()\"\r\n (click)=\"onEnterPressed($event)\"\r\n ></x-button>\r\n } @else {\r\n <x-sender-stop (click)=\"onStop($event)\"></x-sender-stop>\r\n }\r\n </div>\r\n }\r\n }\r\n </div>\r\n @if (footer()) {\r\n <div class=\"x-sender-footer\">\r\n <ng-container *ngTemplateOutlet=\"footer()\"></ng-container>\r\n </div>\r\n }\r\n @if (requiredIsEmpty() || invalid()) {\r\n <div class=\"x-border-error x-top-left\"></div>\r\n <div class=\"x-border-error x-top-right\"></div>\r\n <div class=\"x-border-error x-bottom-left\"></div>\r\n <div class=\"x-border-error x-bottom-right\"></div>\r\n }\r\n </div>\r\n</div>\r\n", styles: [".x-sender{margin:0;padding:0}.x-sender-wrapper{position:relative;border:var(--x-border-width) var(--x-border-style) var(--x-border);border-radius:var(--x-border-radius);background-color:var(--x-background);transition:all var(--x-animation-duration-slow)}.x-sender-wrapper:hover{border-color:var(--x-primary-300)}.x-sender-content{display:flex;align-items:flex-end;padding:var(--x-padding-small) var(--x-padding-medium);gap:var(--x-padding-small);width:100%;cursor:text}.x-sender-textarea{padding:0;flex:auto;align-self:center;min-height:auto;line-height:1.5;vertical-align:bottom;background-color:transparent;resize:none;border:none;outline:none}.x-sender.x-disabled .x-sender-wrapper{color:var(--x-text-400);cursor:default;border-color:var(--x-border-100);background-color:var(--x-background-a300)}.x-sender.x-disabled .x-sender-textarea{color:var(--x-text-400);cursor:default}.x-sender.x-invalid .x-border-error,.x-sender.x-required .x-border-error{position:absolute;height:.75rem;width:.75rem;z-index:10}.x-sender.x-invalid .x-border-error.x-top-left,.x-sender.x-required .x-border-error.x-top-left{border-top-left-radius:var(--x-border-radius);top:0;left:0;border-top:var(--x-border-width) solid var(--x-danger);border-left:var(--x-border-width) solid var(--x-danger)}.x-sender.x-invalid .x-border-error.x-top-right,.x-sender.x-required .x-border-error.x-top-right{border-top-right-radius:var(--x-border-radius);top:0;right:0;border-top:var(--x-border-width) solid var(--x-danger);border-right:var(--x-border-width) solid var(--x-danger)}.x-sender.x-invalid .x-border-error.x-bottom-left,.x-sender.x-required .x-border-error.x-bottom-left{border-bottom-left-radius:var(--x-border-radius);bottom:0;left:0;border-bottom:var(--x-border-width) solid var(--x-danger);border-left:var(--x-border-width) solid var(--x-danger)}.x-sender.x-invalid .x-border-error.x-bottom-right,.x-sender.x-required .x-border-error.x-bottom-right{border-bottom-right-radius:var(--x-border-radius);bottom:0;right:0;border-bottom:var(--x-border-width) solid var(--x-danger);border-right:var(--x-border-width) solid var(--x-danger)}\n"], dependencies: [{ kind: "ngmodule", type: TextFieldModule }, { kind: "directive", type: i1.CdkTextareaAutosize, selector: "textarea[cdkTextareaAutosize]", inputs: ["cdkAutosizeMinRows", "cdkAutosizeMaxRows", "cdkTextareaAutosize", "placeholder"], exportAs: ["cdkTextareaAutosize"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: XButtonComponent, selector: "x-button" }, { kind: "component", type: XSenderStopComponent, selector: "x-sender-stop" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
182
183
|
}
|
|
183
184
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: XSenderComponent, decorators: [{
|
|
184
185
|
type: Component,
|
|
185
|
-
args: [{ selector: 'x-sender', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [XValueAccessor(XSenderComponent)], imports: [TextFieldModule, FormsModule, NgTemplateOutlet, XButtonComponent, XSenderStopComponent], template: "<div\r\n class=\"x-sender\"\r\n [class.x-disabled]=\"disabledComputed()\"\r\n [class.x-required]=\"requiredIsEmpty()\"\r\n [class.x-invalid]=\"invalid()\"\r\n [class.x-focused]=\"focused()\"\r\n>\r\n <div class=\"x-sender-wrapper\">\r\n @if (header()) {\r\n <div class=\"x-sender-header\">\r\n <ng-container *ngTemplateOutlet=\"header()\"></ng-container>\r\n </div>\r\n }\r\n <div class=\"x-sender-content\" (click)=\"inputFocus('after')\">\r\n @if (prefix()) {\r\n <div class=\"x-sender-prefix\">\r\n <ng-container *ngTemplateOutlet=\"prefix()\"></ng-container>\r\n </div>\r\n }\r\n <textarea\r\n #textarea\r\n [disabled]=\"disabledComputed()\"\r\n [required]=\"requiredComputed()\"\r\n [readOnly]=\"readonly()\"\r\n [placeholder]=\"placeholderComputed()\"\r\n [(ngModel)]=\"value\"\r\n (ngModelChange)=\"change($event)\"\r\n cdkTextareaAutosize\r\n [cdkAutosizeMinRows]=\"minRows()\"\r\n [cdkAutosizeMaxRows]=\"maxRowsComputed()\"\r\n (keydown)=\"onKeydown($event)\"\r\n (focus)=\"focused.set(true)\"\r\n (blur)=\"focused.set(false)\"\r\n (input)=\"formControlValidator()\"\r\n (click)=\"$event.stopPropagation()\"\r\n class=\"x-sender-textarea\"\r\n ></textarea>\r\n\r\n @if (suffix()) {\r\n <div class=\"x-sender-suffix\">\r\n <ng-container *ngTemplateOutlet=\"suffix()\"></ng-container>\r\n </div>\r\n } @else {\r\n @if (!footer()) {\r\n <div class=\"x-sender-suffix\">\r\n @if (!loading()) {\r\n <x-button\r\n type=\"primary\"\r\n circle\r\n flat\r\n icon=\"fto-send\"\r\n [loading]=\"loading()\"\r\n [disabled]=\"disabledComputed()\"\r\n (click)=\"onEnterPressed($event)\"\r\n ></x-button>\r\n } @else {\r\n <x-sender-stop (click)=\"onStop($event)\"></x-sender-stop>\r\n }\r\n </div>\r\n }\r\n }\r\n </div>\r\n @if (footer()) {\r\n <div class=\"x-sender-footer\">\r\n <ng-container *ngTemplateOutlet=\"footer()\"></ng-container>\r\n </div>\r\n }\r\n @if (requiredIsEmpty() || invalid()) {\r\n <div class=\"x-border-error x-top-left\"></div>\r\n <div class=\"x-border-error x-top-right\"></div>\r\n <div class=\"x-border-error x-bottom-left\"></div>\r\n <div class=\"x-border-error x-bottom-right\"></div>\r\n }\r\n </div>\r\n</div>\r\n", styles: [".x-sender{margin:0;padding:0}.x-sender-wrapper{position:relative;border:var(--x-border-width) var(--x-border-style) var(--x-border);border-radius:var(--x-border-radius);background-color:var(--x-background);transition:all var(--x-animation-duration-slow)}.x-sender-wrapper:hover{border-color:var(--x-primary-300)}.x-sender-content{display:flex;align-items:flex-end;padding:var(--x-padding-small) var(--x-padding-medium);gap:var(--x-padding-small);width:100%;cursor:text}.x-sender-textarea{padding:0;flex:auto;align-self:center;min-height:auto;line-height:1.5;vertical-align:bottom;background-color:transparent;resize:none;border:none;outline:none}.x-sender
|
|
186
|
+
args: [{ selector: 'x-sender', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [XValueAccessor(XSenderComponent)], imports: [TextFieldModule, FormsModule, NgTemplateOutlet, XButtonComponent, XSenderStopComponent], template: "<div\r\n class=\"x-sender\"\r\n [class.x-disabled]=\"disabledComputed()\"\r\n [class.x-required]=\"requiredIsEmpty()\"\r\n [class.x-invalid]=\"invalid()\"\r\n [class.x-focused]=\"focused()\"\r\n>\r\n <div class=\"x-sender-wrapper\">\r\n @if (header()) {\r\n <div class=\"x-sender-header\">\r\n <ng-container *ngTemplateOutlet=\"header()\"></ng-container>\r\n </div>\r\n }\r\n <div class=\"x-sender-content\" (click)=\"inputFocus('after')\">\r\n @if (prefix()) {\r\n <div class=\"x-sender-prefix\">\r\n <ng-container *ngTemplateOutlet=\"prefix()\"></ng-container>\r\n </div>\r\n }\r\n <textarea\r\n #textarea\r\n [disabled]=\"disabledComputed()\"\r\n [required]=\"requiredComputed()\"\r\n [readOnly]=\"readonly()\"\r\n [placeholder]=\"placeholderComputed()\"\r\n [(ngModel)]=\"value\"\r\n (ngModelChange)=\"change($event)\"\r\n cdkTextareaAutosize\r\n [cdkAutosizeMinRows]=\"minRows()\"\r\n [cdkAutosizeMaxRows]=\"maxRowsComputed()\"\r\n (keydown)=\"onKeydown($event)\"\r\n (focus)=\"focused.set(true)\"\r\n (blur)=\"focused.set(false)\"\r\n (input)=\"formControlValidator()\"\r\n (click)=\"$event.stopPropagation()\"\r\n class=\"x-sender-textarea\"\r\n ></textarea>\r\n\r\n @if (suffix()) {\r\n <div class=\"x-sender-suffix\">\r\n <ng-container *ngTemplateOutlet=\"suffix()\"></ng-container>\r\n </div>\r\n } @else {\r\n @if (!footer()) {\r\n <div class=\"x-sender-suffix\">\r\n @if (!loading()) {\r\n <x-button\r\n type=\"primary\"\r\n circle\r\n flat\r\n icon=\"fto-send\"\r\n [loading]=\"loading()\"\r\n [disabled]=\"disabledComputed()\"\r\n (click)=\"onEnterPressed($event)\"\r\n ></x-button>\r\n } @else {\r\n <x-sender-stop (click)=\"onStop($event)\"></x-sender-stop>\r\n }\r\n </div>\r\n }\r\n }\r\n </div>\r\n @if (footer()) {\r\n <div class=\"x-sender-footer\">\r\n <ng-container *ngTemplateOutlet=\"footer()\"></ng-container>\r\n </div>\r\n }\r\n @if (requiredIsEmpty() || invalid()) {\r\n <div class=\"x-border-error x-top-left\"></div>\r\n <div class=\"x-border-error x-top-right\"></div>\r\n <div class=\"x-border-error x-bottom-left\"></div>\r\n <div class=\"x-border-error x-bottom-right\"></div>\r\n }\r\n </div>\r\n</div>\r\n", styles: [".x-sender{margin:0;padding:0}.x-sender-wrapper{position:relative;border:var(--x-border-width) var(--x-border-style) var(--x-border);border-radius:var(--x-border-radius);background-color:var(--x-background);transition:all var(--x-animation-duration-slow)}.x-sender-wrapper:hover{border-color:var(--x-primary-300)}.x-sender-content{display:flex;align-items:flex-end;padding:var(--x-padding-small) var(--x-padding-medium);gap:var(--x-padding-small);width:100%;cursor:text}.x-sender-textarea{padding:0;flex:auto;align-self:center;min-height:auto;line-height:1.5;vertical-align:bottom;background-color:transparent;resize:none;border:none;outline:none}.x-sender.x-disabled .x-sender-wrapper{color:var(--x-text-400);cursor:default;border-color:var(--x-border-100);background-color:var(--x-background-a300)}.x-sender.x-disabled .x-sender-textarea{color:var(--x-text-400);cursor:default}.x-sender.x-invalid .x-border-error,.x-sender.x-required .x-border-error{position:absolute;height:.75rem;width:.75rem;z-index:10}.x-sender.x-invalid .x-border-error.x-top-left,.x-sender.x-required .x-border-error.x-top-left{border-top-left-radius:var(--x-border-radius);top:0;left:0;border-top:var(--x-border-width) solid var(--x-danger);border-left:var(--x-border-width) solid var(--x-danger)}.x-sender.x-invalid .x-border-error.x-top-right,.x-sender.x-required .x-border-error.x-top-right{border-top-right-radius:var(--x-border-radius);top:0;right:0;border-top:var(--x-border-width) solid var(--x-danger);border-right:var(--x-border-width) solid var(--x-danger)}.x-sender.x-invalid .x-border-error.x-bottom-left,.x-sender.x-required .x-border-error.x-bottom-left{border-bottom-left-radius:var(--x-border-radius);bottom:0;left:0;border-bottom:var(--x-border-width) solid var(--x-danger);border-left:var(--x-border-width) solid var(--x-danger)}.x-sender.x-invalid .x-border-error.x-bottom-right,.x-sender.x-required .x-border-error.x-bottom-right{border-bottom-right-radius:var(--x-border-radius);bottom:0;right:0;border-bottom:var(--x-border-width) solid var(--x-danger);border-right:var(--x-border-width) solid var(--x-danger)}\n"] }]
|
|
186
187
|
}] });
|
|
187
188
|
|
|
188
189
|
class XSenderModule {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-nest-ui-sender.mjs","sources":["../../../../lib/ng-nest/ui/sender/sender.property.ts","../../../../lib/ng-nest/ui/sender/stop.component.ts","../../../../lib/ng-nest/ui/sender/stop.component.html","../../../../lib/ng-nest/ui/sender/sender.component.ts","../../../../lib/ng-nest/ui/sender/sender.component.html","../../../../lib/ng-nest/ui/sender/sender.module.ts","../../../../lib/ng-nest/ui/sender/ng-nest-ui-sender.ts"],"sourcesContent":["import { XFormControlFunction, XFormOption } from '@ng-nest/ui/base-form';\r\nimport { Component, input, output, TemplateRef } from '@angular/core';\r\nimport { XBoolean, XNumber, XToBoolean, XToNumber } from '@ng-nest/ui/core';\r\n\r\n/**\r\n * Sender\r\n * @selector x-sender\r\n * @decorator component\r\n */\r\nexport const XSenderPrefix = 'x-sender';\r\nconst X_SENDER_CONFIG_NAME = 'sender';\r\n\r\n/**\r\n * Sender Property\r\n */\r\n@Component({ selector: `${XSenderPrefix}-property`, template: '' })\r\nexport class XSenderProperty extends XFormControlFunction(X_SENDER_CONFIG_NAME) {\r\n /**\r\n * @zh_CN 最小的行数\r\n * @en_US min number of rows\r\n */\r\n readonly minRows = input<number, XNumber>(1, { transform: XToNumber });\r\n /**\r\n * @zh_CN 最大的行数\r\n * @en_US max number of rows\r\n */\r\n readonly maxRows = input<number, XNumber>(Number.MAX_SAFE_INTEGER, { transform: XToNumber });\r\n /**\r\n * @zh_CN 提交加载中\r\n * @en_US Loading\r\n */\r\n readonly loading = input<boolean, XBoolean>(false, { transform: XToBoolean });\r\n /**\r\n * @zh_CN 提交类型\r\n * @en_US Submit type\r\n */\r\n readonly submitType = input<XSenderSubmitType>(this.config?.submitType ?? 'enter');\r\n /**\r\n * @zh_CN 提交\r\n * @en_US Submit\r\n */\r\n readonly submit = output<Event>();\r\n /**\r\n * @zh_CN 暂停提交\r\n * @en_US Stop\r\n */\r\n readonly stop = output<Event>();\r\n /**\r\n * @zh_CN 自定义后缀\r\n * @en_US Custom suffix\r\n */\r\n readonly suffix = input<TemplateRef<any>>();\r\n /**\r\n * @zh_CN 自定义前缀\r\n * @en_US Custom prefix\r\n */\r\n readonly prefix = input<TemplateRef<any>>();\r\n /**\r\n * @zh_CN 自定义头部\r\n * @en_US Custom header\r\n */\r\n readonly header = input<TemplateRef<any>>();\r\n /**\r\n * @zh_CN 自定义底部\r\n * @en_US Custom footer\r\n */\r\n readonly footer = input<TemplateRef<any>>();\r\n /**\r\n * @zh_CN 输入提示信息\r\n * @en_US Enter prompt information\r\n */\r\n override readonly placeholder = input<string | string[]>('');\r\n /**\r\n * @zh_CN 禁用\r\n * @en_US Disabled\r\n */\r\n override readonly disabled = input<boolean, XBoolean>(false, { transform: XToBoolean });\r\n /**\r\n * @zh_CN 必填\r\n * @en_US Required\r\n */\r\n override readonly required = input<boolean, XBoolean>(false, { transform: XToBoolean });\r\n /**\r\n * @zh_CN 只读\r\n * @en_US Readonly\r\n */\r\n override readonly readonly = input<boolean, XBoolean>(false, { transform: XToBoolean });\r\n /**\r\n * @zh_CN 正则验证规则\r\n * @en_US Regular verification rules\r\n */\r\n override readonly pattern = input<RegExp | RegExp[] | any>(null);\r\n /**\r\n * @zh_CN 验证不通过提示文字\r\n * @en_US Verify not pass the prompt text\r\n */\r\n override readonly message = input<string | string[]>([]);\r\n /**\r\n * @zh_CN 输入验证函数\r\n * @en_US Enter the verification function\r\n */\r\n override readonly inputValidator = input<(value: any) => boolean>();\r\n}\r\n\r\n/**\r\n * Sender Option\r\n */\r\nexport interface XSenderOption extends XFormOption {\r\n /**\r\n * @zh_CN 最小的行数\r\n * @en_US min number of rows\r\n */\r\n minRows?: number;\r\n /**\r\n * @zh_CN 最大的行数\r\n * @en_US max number of rows\r\n */\r\n maxRows?: number;\r\n /**\r\n * @zh_CN 提交加载中\r\n * @en_US Loading\r\n */\r\n loading?: boolean;\r\n /**\r\n * @zh_CN 提交类型\r\n * @en_US Submit type\r\n */\r\n submitType?: XSenderSubmitType;\r\n /**\r\n * @zh_CN 提交\r\n * @en_US Submit\r\n */\r\n submit?: (event: Event) => void;\r\n /**\r\n * @zh_CN 自定义后缀\r\n * @en_US Custom suffix\r\n */\r\n suffix?: TemplateRef<any>;\r\n /**\r\n * @zh_CN 自定义前缀\r\n * @en_US Custom prefix\r\n */\r\n prefix?: TemplateRef<any>;\r\n /**\r\n * @zh_CN 自定义头部\r\n * @en_US Custom header\r\n */\r\n header?: TemplateRef<any>;\r\n /**\r\n * @zh_CN 自定义底部\r\n * @en_US Custom footer\r\n */\r\n footer?: TemplateRef<any>;\r\n /**\r\n * @zh_CN 输入提示信息\r\n * @en_US Enter prompt information\r\n */\r\n placeholder?: string;\r\n /**\r\n * @zh_CN 禁用\r\n * @en_US Disabled\r\n */\r\n disabled?: boolean;\r\n /**\r\n * @zh_CN 必填\r\n * @en_US Required\r\n */\r\n required?: boolean;\r\n /**\r\n * @zh_CN 只读\r\n * @en_US Readonly\r\n */\r\n readonly?: boolean;\r\n /**\r\n * @zh_CN 正则验证规则\r\n * @en_US Regular verification rules\r\n */\r\n pattern?: RegExp | RegExp[] | any;\r\n /**\r\n * @zh_CN 验证不通过提示文字\r\n * @en_US Verify not pass the prompt text\r\n */\r\n message?: string | string[];\r\n /**\r\n * @zh_CN 输入验证函数\r\n * @en_US Enter the verification function\r\n */\r\n inputValidator: (value: any) => boolean;\r\n}\r\n\r\n/**\r\n * @zh_CN 提交类型\r\n * @en_US Submit type\r\n */\r\nexport type XSenderSubmitType = 'enter' | 'shiftEnter';\r\n","import { ChangeDetectionStrategy, Component, ViewEncapsulation } from '@angular/core';\r\n\r\n@Component({\r\n selector: 'x-sender-stop',\r\n templateUrl: './stop.component.html',\r\n styleUrls: ['./stop.component.scss'],\r\n encapsulation: ViewEncapsulation.None,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n imports: []\r\n})\r\nexport class XSenderStopComponent {}\r\n","<div class=\"x-sender-stop\">\r\n <svg color=\"currentColor\" viewBox=\"0 0 1000 1000\" xmlns=\"http://www.w3.org/2000/svg\">\r\n <rect fill=\"currentColor\" height=\"250\" rx=\"24\" ry=\"24\" width=\"250\" x=\"375\" y=\"375\"></rect>\r\n <circle cx=\"500\" cy=\"500\" fill=\"none\" r=\"450\" stroke=\"currentColor\" stroke-width=\"100\" opacity=\"0.45\"></circle>\r\n <circle\r\n cx=\"500\"\r\n cy=\"500\"\r\n fill=\"none\"\r\n r=\"450\"\r\n stroke=\"currentColor\"\r\n stroke-width=\"100\"\r\n stroke-dasharray=\"600 9999999\"\r\n >\r\n <animateTransform\r\n attributeName=\"transform\"\r\n dur=\"1s\"\r\n from=\"0 500 500\"\r\n repeatCount=\"indefinite\"\r\n to=\"360 500 500\"\r\n type=\"rotate\"\r\n ></animateTransform>\r\n </circle>\r\n </svg>\r\n</div>\r\n","import {\r\n Component,\r\n ViewEncapsulation,\r\n ChangeDetectionStrategy,\r\n viewChild,\r\n ElementRef,\r\n computed,\r\n signal\r\n} from '@angular/core';\r\nimport { XSenderProperty } from './sender.property';\r\nimport { XValueAccessor } from '@ng-nest/ui/base-form';\r\nimport { TextFieldModule } from '@angular/cdk/text-field';\r\nimport { XButtonComponent } from '@ng-nest/ui/button';\r\nimport { FormsModule } from '@angular/forms';\r\nimport { NgTemplateOutlet } from '@angular/common';\r\nimport { XSenderStopComponent } from './stop.component';\r\n\r\n@Component({\r\n selector: 'x-sender',\r\n templateUrl: './sender.component.html',\r\n styleUrls: ['./sender.component.scss'],\r\n encapsulation: ViewEncapsulation.None,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n providers: [XValueAccessor(XSenderComponent)],\r\n imports: [TextFieldModule, FormsModule, NgTemplateOutlet, XButtonComponent, XSenderStopComponent]\r\n})\r\nexport class XSenderComponent extends XSenderProperty {\r\n textarea = viewChild.required<ElementRef<HTMLTextAreaElement>>('textarea');\r\n focused = signal(false);\r\n maxRowsComputed = computed(() => {\r\n const rows = this.maxRows();\r\n return rows === Number.MAX_SAFE_INTEGER ? undefined : rows;\r\n });\r\n placeholderComputed = computed(() => {\r\n const placeholder = this.placeholder() as string;\r\n return placeholder;\r\n });\r\n\r\n onKeydown(event: KeyboardEvent) {\r\n if (this.submitType() === 'enter') {\r\n if (event.key === 'Enter' && !event.shiftKey) {\r\n event.preventDefault();\r\n this.onEnterPressed(event);\r\n }\r\n } else if (this.submitType() === 'shiftEnter') {\r\n if (event.key === 'Enter' && event.shiftKey) {\r\n event.preventDefault();\r\n this.onEnterPressed(event);\r\n }\r\n }\r\n }\r\n\r\n onEnterPressed(event: Event) {\r\n this.submit.emit(event);\r\n }\r\n\r\n onStop(event: Event) {\r\n this.stop.emit(event);\r\n }\r\n\r\n inputFocus(type: 'focus' | 'select' | 'before' | 'after' = 'after') {\r\n this.textarea().nativeElement.focus();\r\n if (!this.value()) return;\r\n if (type === 'after') {\r\n this.textarea().nativeElement.setSelectionRange(this.value().length, this.value().length);\r\n } else if (type === 'before') {\r\n this.textarea().nativeElement.setSelectionRange(0, 0);\r\n } else if (type === 'select') {\r\n this.textarea().nativeElement.setSelectionRange(0, this.value().length);\r\n }\r\n }\r\n\r\n change(value: any) {\r\n if (this.onChange) this.onChange(value);\r\n }\r\n}\r\n","<div\r\n class=\"x-sender\"\r\n [class.x-disabled]=\"disabledComputed()\"\r\n [class.x-required]=\"requiredIsEmpty()\"\r\n [class.x-invalid]=\"invalid()\"\r\n [class.x-focused]=\"focused()\"\r\n>\r\n <div class=\"x-sender-wrapper\">\r\n @if (header()) {\r\n <div class=\"x-sender-header\">\r\n <ng-container *ngTemplateOutlet=\"header()\"></ng-container>\r\n </div>\r\n }\r\n <div class=\"x-sender-content\" (click)=\"inputFocus('after')\">\r\n @if (prefix()) {\r\n <div class=\"x-sender-prefix\">\r\n <ng-container *ngTemplateOutlet=\"prefix()\"></ng-container>\r\n </div>\r\n }\r\n <textarea\r\n #textarea\r\n [disabled]=\"disabledComputed()\"\r\n [required]=\"requiredComputed()\"\r\n [readOnly]=\"readonly()\"\r\n [placeholder]=\"placeholderComputed()\"\r\n [(ngModel)]=\"value\"\r\n (ngModelChange)=\"change($event)\"\r\n cdkTextareaAutosize\r\n [cdkAutosizeMinRows]=\"minRows()\"\r\n [cdkAutosizeMaxRows]=\"maxRowsComputed()\"\r\n (keydown)=\"onKeydown($event)\"\r\n (focus)=\"focused.set(true)\"\r\n (blur)=\"focused.set(false)\"\r\n (input)=\"formControlValidator()\"\r\n (click)=\"$event.stopPropagation()\"\r\n class=\"x-sender-textarea\"\r\n ></textarea>\r\n\r\n @if (suffix()) {\r\n <div class=\"x-sender-suffix\">\r\n <ng-container *ngTemplateOutlet=\"suffix()\"></ng-container>\r\n </div>\r\n } @else {\r\n @if (!footer()) {\r\n <div class=\"x-sender-suffix\">\r\n @if (!loading()) {\r\n <x-button\r\n type=\"primary\"\r\n circle\r\n flat\r\n icon=\"fto-send\"\r\n [loading]=\"loading()\"\r\n [disabled]=\"disabledComputed()\"\r\n (click)=\"onEnterPressed($event)\"\r\n ></x-button>\r\n } @else {\r\n <x-sender-stop (click)=\"onStop($event)\"></x-sender-stop>\r\n }\r\n </div>\r\n }\r\n }\r\n </div>\r\n @if (footer()) {\r\n <div class=\"x-sender-footer\">\r\n <ng-container *ngTemplateOutlet=\"footer()\"></ng-container>\r\n </div>\r\n }\r\n @if (requiredIsEmpty() || invalid()) {\r\n <div class=\"x-border-error x-top-left\"></div>\r\n <div class=\"x-border-error x-top-right\"></div>\r\n <div class=\"x-border-error x-bottom-left\"></div>\r\n <div class=\"x-border-error x-bottom-right\"></div>\r\n }\r\n </div>\r\n</div>\r\n","import { NgModule } from '@angular/core';\r\nimport { XSenderComponent } from './sender.component';\r\nimport { XSenderStopComponent } from './stop.component';\r\n\r\n@NgModule({\r\n exports: [XSenderComponent, XSenderStopComponent],\r\n imports: [XSenderComponent, XSenderStopComponent]\r\n})\r\nexport class XSenderModule {}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;AAIA;;;;AAIG;AACI,MAAM,aAAa,GAAG,UAAU;AACvC,MAAM,oBAAoB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A,EACpC,CAAC,cAAc,CAAA,gBAAA,CAAkB,CAAC,EAAA,OAAA,EACpC,CAAC,eAAe,EAAE,WAAW,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,oBAAoB,CAAC,EAAA,QAAA,EAAA,ukFAAA,EAAA,MAAA,EAAA,CAAA,08EAAA,CAAA,EAAA;;;MEhBtF,aAAa,CAAA;iIAAb,aAAa,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAAb,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,aAAa,YAFd,gBAAgB,EAAE,oBAAoB,CAAA,EAAA,OAAA,EAAA,CADtC,gBAAgB,EAAE,oBAAoB,CAAA,EAAA,CAAA,CAAA;AAGrC,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,aAAa,YAFd,gBAAgB,CAAA,EAAA,CAAA,CAAA;;2FAEf,aAAa,EAAA,UAAA,EAAA,CAAA;kBAJzB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,CAAC,gBAAgB,EAAE,oBAAoB,CAAC;AACjD,oBAAA,OAAO,EAAE,CAAC,gBAAgB,EAAE,oBAAoB;AACjD,iBAAA;;;ACPD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ng-nest-ui-sender.mjs","sources":["../../../../lib/ng-nest/ui/sender/sender.property.ts","../../../../lib/ng-nest/ui/sender/stop.component.ts","../../../../lib/ng-nest/ui/sender/stop.component.html","../../../../lib/ng-nest/ui/sender/sender.component.ts","../../../../lib/ng-nest/ui/sender/sender.component.html","../../../../lib/ng-nest/ui/sender/sender.module.ts","../../../../lib/ng-nest/ui/sender/ng-nest-ui-sender.ts"],"sourcesContent":["import { XFormControlFunction, XFormOption } from '@ng-nest/ui/base-form';\r\nimport { Component, input, output, TemplateRef } from '@angular/core';\r\nimport { XBoolean, XNumber, XToBoolean, XToNumber } from '@ng-nest/ui/core';\r\n\r\n/**\r\n * Sender\r\n * @selector x-sender\r\n * @decorator component\r\n */\r\nexport const XSenderPrefix = 'x-sender';\r\nconst X_SENDER_CONFIG_NAME = 'sender';\r\n\r\n/**\r\n * Sender Property\r\n */\r\n@Component({ selector: `${XSenderPrefix}-property`, template: '' })\r\nexport class XSenderProperty extends XFormControlFunction(X_SENDER_CONFIG_NAME) {\r\n /**\r\n * @zh_CN 最小的行数\r\n * @en_US min number of rows\r\n */\r\n readonly minRows = input<number, XNumber>(1, { transform: XToNumber });\r\n /**\r\n * @zh_CN 最大的行数\r\n * @en_US max number of rows\r\n */\r\n readonly maxRows = input<number, XNumber>(Number.MAX_SAFE_INTEGER, { transform: XToNumber });\r\n /**\r\n * @zh_CN 提交加载中\r\n * @en_US Loading\r\n */\r\n readonly loading = input<boolean, XBoolean>(false, { transform: XToBoolean });\r\n /**\r\n * @zh_CN 提交类型\r\n * @en_US Submit type\r\n */\r\n readonly submitType = input<XSenderSubmitType>(this.config?.submitType ?? 'enter');\r\n /**\r\n * @zh_CN 提交\r\n * @en_US Submit\r\n */\r\n readonly submit = output<Event>();\r\n /**\r\n * @zh_CN 暂停提交\r\n * @en_US Stop\r\n */\r\n readonly stop = output<Event>();\r\n /**\r\n * @zh_CN 自定义后缀\r\n * @en_US Custom suffix\r\n */\r\n readonly suffix = input<TemplateRef<any>>();\r\n /**\r\n * @zh_CN 自定义前缀\r\n * @en_US Custom prefix\r\n */\r\n readonly prefix = input<TemplateRef<any>>();\r\n /**\r\n * @zh_CN 自定义头部\r\n * @en_US Custom header\r\n */\r\n readonly header = input<TemplateRef<any>>();\r\n /**\r\n * @zh_CN 自定义底部\r\n * @en_US Custom footer\r\n */\r\n readonly footer = input<TemplateRef<any>>();\r\n /**\r\n * @zh_CN 输入提示信息\r\n * @en_US Enter prompt information\r\n */\r\n override readonly placeholder = input<string | string[]>('');\r\n /**\r\n * @zh_CN 禁用\r\n * @en_US Disabled\r\n */\r\n override readonly disabled = input<boolean, XBoolean>(false, { transform: XToBoolean });\r\n /**\r\n * @zh_CN 必填\r\n * @en_US Required\r\n */\r\n override readonly required = input<boolean, XBoolean>(false, { transform: XToBoolean });\r\n /**\r\n * @zh_CN 只读\r\n * @en_US Readonly\r\n */\r\n override readonly readonly = input<boolean, XBoolean>(false, { transform: XToBoolean });\r\n /**\r\n * @zh_CN 正则验证规则\r\n * @en_US Regular verification rules\r\n */\r\n override readonly pattern = input<RegExp | RegExp[] | any>(null);\r\n /**\r\n * @zh_CN 验证不通过提示文字\r\n * @en_US Verify not pass the prompt text\r\n */\r\n override readonly message = input<string | string[]>([]);\r\n /**\r\n * @zh_CN 输入验证函数\r\n * @en_US Enter the verification function\r\n */\r\n override readonly inputValidator = input<(value: any) => boolean>();\r\n}\r\n\r\n/**\r\n * Sender Option\r\n */\r\nexport interface XSenderOption extends XFormOption {\r\n /**\r\n * @zh_CN 最小的行数\r\n * @en_US min number of rows\r\n */\r\n minRows?: number;\r\n /**\r\n * @zh_CN 最大的行数\r\n * @en_US max number of rows\r\n */\r\n maxRows?: number;\r\n /**\r\n * @zh_CN 提交加载中\r\n * @en_US Loading\r\n */\r\n loading?: boolean;\r\n /**\r\n * @zh_CN 提交类型\r\n * @en_US Submit type\r\n */\r\n submitType?: XSenderSubmitType;\r\n /**\r\n * @zh_CN 提交\r\n * @en_US Submit\r\n */\r\n submit?: (event: Event) => void;\r\n /**\r\n * @zh_CN 自定义后缀\r\n * @en_US Custom suffix\r\n */\r\n suffix?: TemplateRef<any>;\r\n /**\r\n * @zh_CN 自定义前缀\r\n * @en_US Custom prefix\r\n */\r\n prefix?: TemplateRef<any>;\r\n /**\r\n * @zh_CN 自定义头部\r\n * @en_US Custom header\r\n */\r\n header?: TemplateRef<any>;\r\n /**\r\n * @zh_CN 自定义底部\r\n * @en_US Custom footer\r\n */\r\n footer?: TemplateRef<any>;\r\n /**\r\n * @zh_CN 输入提示信息\r\n * @en_US Enter prompt information\r\n */\r\n placeholder?: string;\r\n /**\r\n * @zh_CN 禁用\r\n * @en_US Disabled\r\n */\r\n disabled?: boolean;\r\n /**\r\n * @zh_CN 必填\r\n * @en_US Required\r\n */\r\n required?: boolean;\r\n /**\r\n * @zh_CN 只读\r\n * @en_US Readonly\r\n */\r\n readonly?: boolean;\r\n /**\r\n * @zh_CN 正则验证规则\r\n * @en_US Regular verification rules\r\n */\r\n pattern?: RegExp | RegExp[] | any;\r\n /**\r\n * @zh_CN 验证不通过提示文字\r\n * @en_US Verify not pass the prompt text\r\n */\r\n message?: string | string[];\r\n /**\r\n * @zh_CN 输入验证函数\r\n * @en_US Enter the verification function\r\n */\r\n inputValidator: (value: any) => boolean;\r\n}\r\n\r\n/**\r\n * @zh_CN 提交类型\r\n * @en_US Submit type\r\n */\r\nexport type XSenderSubmitType = 'enter' | 'shiftEnter';\r\n","import { ChangeDetectionStrategy, Component, ViewEncapsulation } from '@angular/core';\r\n\r\n@Component({\r\n selector: 'x-sender-stop',\r\n templateUrl: './stop.component.html',\r\n styleUrls: ['./stop.component.scss'],\r\n encapsulation: ViewEncapsulation.None,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n imports: []\r\n})\r\nexport class XSenderStopComponent {}\r\n","<div class=\"x-sender-stop\">\r\n <svg color=\"currentColor\" viewBox=\"0 0 1000 1000\" xmlns=\"http://www.w3.org/2000/svg\">\r\n <rect fill=\"currentColor\" height=\"400\" width=\"400\" rx=\"45\" ry=\"45\" x=\"300\" y=\"300\"></rect>\r\n <circle cx=\"500\" cy=\"500\" fill=\"none\" r=\"450\" stroke=\"currentColor\" stroke-width=\"100\" opacity=\"0.45\"></circle>\r\n <circle\r\n cx=\"500\"\r\n cy=\"500\"\r\n fill=\"none\"\r\n r=\"450\"\r\n stroke=\"currentColor\"\r\n stroke-width=\"100\"\r\n stroke-dasharray=\"600 9999999\"\r\n >\r\n <animateTransform\r\n attributeName=\"transform\"\r\n dur=\"1s\"\r\n from=\"0 500 500\"\r\n repeatCount=\"indefinite\"\r\n to=\"360 500 500\"\r\n type=\"rotate\"\r\n ></animateTransform>\r\n </circle>\r\n </svg>\r\n</div>\r\n","import {\r\n Component,\r\n ViewEncapsulation,\r\n ChangeDetectionStrategy,\r\n viewChild,\r\n ElementRef,\r\n computed,\r\n signal,\r\n inject\r\n} from '@angular/core';\r\nimport { XSenderProperty } from './sender.property';\r\nimport { XValueAccessor } from '@ng-nest/ui/base-form';\r\nimport { TextFieldModule } from '@angular/cdk/text-field';\r\nimport { XButtonComponent } from '@ng-nest/ui/button';\r\nimport { FormsModule } from '@angular/forms';\r\nimport { NgTemplateOutlet } from '@angular/common';\r\nimport { XSenderStopComponent } from './stop.component';\r\n\r\n@Component({\r\n selector: 'x-sender',\r\n templateUrl: './sender.component.html',\r\n styleUrls: ['./sender.component.scss'],\r\n encapsulation: ViewEncapsulation.None,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n providers: [XValueAccessor(XSenderComponent)],\r\n imports: [TextFieldModule, FormsModule, NgTemplateOutlet, XButtonComponent, XSenderStopComponent]\r\n})\r\nexport class XSenderComponent extends XSenderProperty {\r\n elementRef = inject(ElementRef);\r\n textarea = viewChild.required<ElementRef<HTMLTextAreaElement>>('textarea');\r\n\r\n focused = signal(false);\r\n maxRowsComputed = computed(() => {\r\n const rows = this.maxRows();\r\n return rows === Number.MAX_SAFE_INTEGER ? undefined : rows;\r\n });\r\n placeholderComputed = computed(() => {\r\n const placeholder = this.placeholder() as string;\r\n return placeholder;\r\n });\r\n\r\n onKeydown(event: KeyboardEvent) {\r\n if (this.submitType() === 'enter') {\r\n if (event.key === 'Enter' && !event.shiftKey) {\r\n event.preventDefault();\r\n this.onEnterPressed(event);\r\n }\r\n } else if (this.submitType() === 'shiftEnter') {\r\n if (event.key === 'Enter' && event.shiftKey) {\r\n event.preventDefault();\r\n this.onEnterPressed(event);\r\n }\r\n }\r\n }\r\n\r\n onEnterPressed(event: Event) {\r\n this.submit.emit(event);\r\n }\r\n\r\n onStop(event: Event) {\r\n this.stop.emit(event);\r\n }\r\n\r\n inputFocus(type: 'focus' | 'select' | 'before' | 'after' = 'after') {\r\n this.textarea().nativeElement.focus();\r\n if (!this.value()) return;\r\n if (type === 'after') {\r\n this.textarea().nativeElement.setSelectionRange(this.value().length, this.value().length);\r\n } else if (type === 'before') {\r\n this.textarea().nativeElement.setSelectionRange(0, 0);\r\n } else if (type === 'select') {\r\n this.textarea().nativeElement.setSelectionRange(0, this.value().length);\r\n }\r\n }\r\n\r\n change(value: any) {\r\n if (this.onChange) this.onChange(value);\r\n }\r\n}\r\n","<div\r\n class=\"x-sender\"\r\n [class.x-disabled]=\"disabledComputed()\"\r\n [class.x-required]=\"requiredIsEmpty()\"\r\n [class.x-invalid]=\"invalid()\"\r\n [class.x-focused]=\"focused()\"\r\n>\r\n <div class=\"x-sender-wrapper\">\r\n @if (header()) {\r\n <div class=\"x-sender-header\">\r\n <ng-container *ngTemplateOutlet=\"header()\"></ng-container>\r\n </div>\r\n }\r\n <div class=\"x-sender-content\" (click)=\"inputFocus('after')\">\r\n @if (prefix()) {\r\n <div class=\"x-sender-prefix\">\r\n <ng-container *ngTemplateOutlet=\"prefix()\"></ng-container>\r\n </div>\r\n }\r\n <textarea\r\n #textarea\r\n [disabled]=\"disabledComputed()\"\r\n [required]=\"requiredComputed()\"\r\n [readOnly]=\"readonly()\"\r\n [placeholder]=\"placeholderComputed()\"\r\n [(ngModel)]=\"value\"\r\n (ngModelChange)=\"change($event)\"\r\n cdkTextareaAutosize\r\n [cdkAutosizeMinRows]=\"minRows()\"\r\n [cdkAutosizeMaxRows]=\"maxRowsComputed()\"\r\n (keydown)=\"onKeydown($event)\"\r\n (focus)=\"focused.set(true)\"\r\n (blur)=\"focused.set(false)\"\r\n (input)=\"formControlValidator()\"\r\n (click)=\"$event.stopPropagation()\"\r\n class=\"x-sender-textarea\"\r\n ></textarea>\r\n\r\n @if (suffix()) {\r\n <div class=\"x-sender-suffix\">\r\n <ng-container *ngTemplateOutlet=\"suffix()\"></ng-container>\r\n </div>\r\n } @else {\r\n @if (!footer()) {\r\n <div class=\"x-sender-suffix\">\r\n @if (!loading()) {\r\n <x-button\r\n type=\"primary\"\r\n circle\r\n flat\r\n icon=\"fto-send\"\r\n [loading]=\"loading()\"\r\n [disabled]=\"disabledComputed()\"\r\n (click)=\"onEnterPressed($event)\"\r\n ></x-button>\r\n } @else {\r\n <x-sender-stop (click)=\"onStop($event)\"></x-sender-stop>\r\n }\r\n </div>\r\n }\r\n }\r\n </div>\r\n @if (footer()) {\r\n <div class=\"x-sender-footer\">\r\n <ng-container *ngTemplateOutlet=\"footer()\"></ng-container>\r\n </div>\r\n }\r\n @if (requiredIsEmpty() || invalid()) {\r\n <div class=\"x-border-error x-top-left\"></div>\r\n <div class=\"x-border-error x-top-right\"></div>\r\n <div class=\"x-border-error x-bottom-left\"></div>\r\n <div class=\"x-border-error x-bottom-right\"></div>\r\n }\r\n </div>\r\n</div>\r\n","import { NgModule } from '@angular/core';\r\nimport { XSenderComponent } from './sender.component';\r\nimport { XSenderStopComponent } from './stop.component';\r\n\r\n@NgModule({\r\n exports: [XSenderComponent, XSenderStopComponent],\r\n imports: [XSenderComponent, XSenderStopComponent]\r\n})\r\nexport class XSenderModule {}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;AAIA;;;;AAIG;AACI,MAAM,aAAa,GAAG,UAAU;AACvC,MAAM,oBAAoB,GAAG,QAAQ;AAErC;;AAEG;MAEU,eAAgB,SAAQ,oBAAoB,CAAC,oBAAoB,CAAC,CAAA;AAD/E,IAAA,WAAA,GAAA;;AAEE;;;AAG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EACpC,CAAC,eAAe,EAAE,WAAW,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,oBAAoB,CAAC,EAAA,QAAA,EAAA,ukFAAA,EAAA,MAAA,EAAA,CAAA,+jEAAA,CAAA,EAAA;;;MEjBtF,aAAa,CAAA;iIAAb,aAAa,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAAb,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,aAAa,YAFd,gBAAgB,EAAE,oBAAoB,CAAA,EAAA,OAAA,EAAA,CADtC,gBAAgB,EAAE,oBAAoB,CAAA,EAAA,CAAA,CAAA;AAGrC,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,aAAa,YAFd,gBAAgB,CAAA,EAAA,CAAA,CAAA;;2FAEf,aAAa,EAAA,UAAA,EAAA,CAAA;kBAJzB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,CAAC,gBAAgB,EAAE,oBAAoB,CAAC;AACjD,oBAAA,OAAO,EAAE,CAAC,gBAAgB,EAAE,oBAAoB;AACjD,iBAAA;;;ACPD;;AAEG;;;;"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, model, output, Component, ChangeDetectionStrategy, ViewEncapsulation, NgModule } from '@angular/core';
|
|
3
|
+
import { XPropertyFunction, XToDataArray, XToBoolean, XToCssPixelValue } from '@ng-nest/ui/core';
|
|
4
|
+
import { XDropdownComponent } from '@ng-nest/ui/dropdown';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Suggestion
|
|
8
|
+
* @selector x-suggestion
|
|
9
|
+
* @decorator component
|
|
10
|
+
*/
|
|
11
|
+
const XSuggestionPrefix = 'x-suggestion';
|
|
12
|
+
const X_SUGGESTION_CONFIG_NAME = 'suggestion';
|
|
13
|
+
/**
|
|
14
|
+
* Suggestion Property
|
|
15
|
+
*/
|
|
16
|
+
class XSuggestionProperty extends XPropertyFunction(X_SUGGESTION_CONFIG_NAME) {
|
|
17
|
+
constructor() {
|
|
18
|
+
super(...arguments);
|
|
19
|
+
/**
|
|
20
|
+
* @zh_CN 建议项列表
|
|
21
|
+
* @en_US Suggestion items
|
|
22
|
+
*/
|
|
23
|
+
this.data = input([], ...(ngDevMode ? [{ debugName: "data", transform: XToDataArray }] : [{ transform: XToDataArray }]));
|
|
24
|
+
/**
|
|
25
|
+
* @zh_CN 显示建议项
|
|
26
|
+
* @en_US Show Suggestion items
|
|
27
|
+
*/
|
|
28
|
+
this.visible = model(false, ...(ngDevMode ? [{ debugName: "visible" }] : []));
|
|
29
|
+
/**
|
|
30
|
+
* @zh_CN 展示位置
|
|
31
|
+
* @en_US Placement
|
|
32
|
+
*/
|
|
33
|
+
this.placement = input(this.config?.placement ?? 'top-start', ...(ngDevMode ? [{ debugName: "placement" }] : []));
|
|
34
|
+
/**
|
|
35
|
+
* @zh_CN 禁用
|
|
36
|
+
* @en_US Disabled
|
|
37
|
+
*/
|
|
38
|
+
this.disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled", transform: XToBoolean }] : [{ transform: XToBoolean }]));
|
|
39
|
+
/**
|
|
40
|
+
* @zh_CN 节点中已经包含子节点数据
|
|
41
|
+
* @en_US The node already contains child node data
|
|
42
|
+
*/
|
|
43
|
+
this.children = input(false, ...(ngDevMode ? [{ debugName: "children", transform: XToBoolean }] : [{ transform: XToBoolean }]));
|
|
44
|
+
/**
|
|
45
|
+
* @zh_CN 弹框的最小宽度
|
|
46
|
+
* @en_US Portal min-width
|
|
47
|
+
*/
|
|
48
|
+
this.portalMinWidth = input('10rem', ...(ngDevMode ? [{ debugName: "portalMinWidth", transform: XToCssPixelValue }] : [{ transform: XToCssPixelValue }]));
|
|
49
|
+
/**
|
|
50
|
+
* @zh_CN 弹框的最大宽度
|
|
51
|
+
* @en_US Portal max-width
|
|
52
|
+
*/
|
|
53
|
+
this.portalMaxWidth = input('', ...(ngDevMode ? [{ debugName: "portalMaxWidth", transform: XToCssPixelValue }] : [{ transform: XToCssPixelValue }]));
|
|
54
|
+
/**
|
|
55
|
+
* @zh_CN 弹框的最小高度
|
|
56
|
+
* @en_US Portal min-height
|
|
57
|
+
*/
|
|
58
|
+
this.portalMinHeight = input('', ...(ngDevMode ? [{ debugName: "portalMinHeight", transform: XToCssPixelValue }] : [{ transform: XToCssPixelValue }]));
|
|
59
|
+
/**
|
|
60
|
+
* @zh_CN 弹框的最大高度
|
|
61
|
+
* @en_US Portal max-height
|
|
62
|
+
*/
|
|
63
|
+
this.portalMaxHeight = input('', ...(ngDevMode ? [{ debugName: "portalMaxHeight", transform: XToCssPixelValue }] : [{ transform: XToCssPixelValue }]));
|
|
64
|
+
/**
|
|
65
|
+
* @zh_CN 尺寸
|
|
66
|
+
* @en_US Size
|
|
67
|
+
*/
|
|
68
|
+
this.size = input(this.config?.size ?? 'medium', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
69
|
+
/**
|
|
70
|
+
* @zh_CN 建议项点击事件
|
|
71
|
+
* @en_US Suggestion item click event
|
|
72
|
+
*/
|
|
73
|
+
this.nodeClick = output();
|
|
74
|
+
}
|
|
75
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: XSuggestionProperty, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
76
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.0", type: XSuggestionProperty, isStandalone: true, selector: "x-suggestion-property", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, visible: { classPropertyName: "visible", publicName: "visible", isSignal: true, isRequired: false, transformFunction: null }, placement: { classPropertyName: "placement", publicName: "placement", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, children: { classPropertyName: "children", publicName: "children", isSignal: true, isRequired: false, transformFunction: null }, portalMinWidth: { classPropertyName: "portalMinWidth", publicName: "portalMinWidth", isSignal: true, isRequired: false, transformFunction: null }, portalMaxWidth: { classPropertyName: "portalMaxWidth", publicName: "portalMaxWidth", isSignal: true, isRequired: false, transformFunction: null }, portalMinHeight: { classPropertyName: "portalMinHeight", publicName: "portalMinHeight", isSignal: true, isRequired: false, transformFunction: null }, portalMaxHeight: { classPropertyName: "portalMaxHeight", publicName: "portalMaxHeight", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { visible: "visibleChange", nodeClick: "nodeClick" }, usesInheritance: true, ngImport: i0, template: '', isInline: true }); }
|
|
77
|
+
}
|
|
78
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: XSuggestionProperty, decorators: [{
|
|
79
|
+
type: Component,
|
|
80
|
+
args: [{ selector: `${XSuggestionPrefix}-property`, template: '' }]
|
|
81
|
+
}] });
|
|
82
|
+
|
|
83
|
+
class XSuggestionComponent extends XSuggestionProperty {
|
|
84
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: XSuggestionComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
85
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.0", type: XSuggestionComponent, isStandalone: true, selector: "x-suggestion", usesInheritance: true, ngImport: i0, template: "<div class=\"x-suggestion\">\r\n <x-dropdown\r\n [data]=\"data()\"\r\n (nodeClick)=\"nodeClick.emit($event)\"\r\n [trigger]=\"'click'\"\r\n [(visible)]=\"visible\"\r\n [placement]=\"placement()\"\r\n [disabled]=\"disabled()\"\r\n [children]=\"children()\"\r\n [portalMinWidth]=\"portalMinWidth()\"\r\n [portalMaxWidth]=\"portalMaxWidth()\"\r\n [portalMinHeight]=\"portalMinHeight()\"\r\n [portalMaxHeight]=\"portalMaxHeight()\"\r\n [size]=\"size()\"\r\n >\r\n <ng-content></ng-content>\r\n </x-dropdown>\r\n</div>\r\n", styles: [".x-suggestion{margin:0;padding:0}.x-suggestion>x-dropdown{display:block}.x-suggestion>x-dropdown>.x-dropdown{display:block}\n"], dependencies: [{ kind: "component", type: XDropdownComponent, selector: "x-dropdown" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
86
|
+
}
|
|
87
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: XSuggestionComponent, decorators: [{
|
|
88
|
+
type: Component,
|
|
89
|
+
args: [{ selector: 'x-suggestion', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [XDropdownComponent], template: "<div class=\"x-suggestion\">\r\n <x-dropdown\r\n [data]=\"data()\"\r\n (nodeClick)=\"nodeClick.emit($event)\"\r\n [trigger]=\"'click'\"\r\n [(visible)]=\"visible\"\r\n [placement]=\"placement()\"\r\n [disabled]=\"disabled()\"\r\n [children]=\"children()\"\r\n [portalMinWidth]=\"portalMinWidth()\"\r\n [portalMaxWidth]=\"portalMaxWidth()\"\r\n [portalMinHeight]=\"portalMinHeight()\"\r\n [portalMaxHeight]=\"portalMaxHeight()\"\r\n [size]=\"size()\"\r\n >\r\n <ng-content></ng-content>\r\n </x-dropdown>\r\n</div>\r\n", styles: [".x-suggestion{margin:0;padding:0}.x-suggestion>x-dropdown{display:block}.x-suggestion>x-dropdown>.x-dropdown{display:block}\n"] }]
|
|
90
|
+
}] });
|
|
91
|
+
|
|
92
|
+
class XSuggestionModule {
|
|
93
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: XSuggestionModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
94
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.0", ngImport: i0, type: XSuggestionModule, imports: [XSuggestionComponent], exports: [XSuggestionComponent] }); }
|
|
95
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: XSuggestionModule, imports: [XSuggestionComponent] }); }
|
|
96
|
+
}
|
|
97
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: XSuggestionModule, decorators: [{
|
|
98
|
+
type: NgModule,
|
|
99
|
+
args: [{
|
|
100
|
+
exports: [XSuggestionComponent],
|
|
101
|
+
imports: [XSuggestionComponent]
|
|
102
|
+
}]
|
|
103
|
+
}] });
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Generated bundle index. Do not edit.
|
|
107
|
+
*/
|
|
108
|
+
|
|
109
|
+
export { XSuggestionComponent, XSuggestionModule, XSuggestionPrefix, XSuggestionProperty };
|
|
110
|
+
//# sourceMappingURL=ng-nest-ui-suggestion.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ng-nest-ui-suggestion.mjs","sources":["../../../../lib/ng-nest/ui/suggestion/suggestion.property.ts","../../../../lib/ng-nest/ui/suggestion/suggestion.component.ts","../../../../lib/ng-nest/ui/suggestion/suggestion.component.html","../../../../lib/ng-nest/ui/suggestion/suggestion.module.ts","../../../../lib/ng-nest/ui/suggestion/ng-nest-ui-suggestion.ts"],"sourcesContent":["import { Component, input, model, output } from '@angular/core';\r\nimport {\r\n XPropertyFunction,\r\n XDataArray,\r\n XToDataArray,\r\n XPlacement,\r\n XBoolean,\r\n XToBoolean,\r\n XNumber,\r\n XToCssPixelValue,\r\n XSize\r\n} from '@ng-nest/ui/core';\r\nimport { XDropdownNode } from '@ng-nest/ui/dropdown';\r\n\r\n/**\r\n * Suggestion\r\n * @selector x-suggestion\r\n * @decorator component\r\n */\r\nexport const XSuggestionPrefix = 'x-suggestion';\r\nconst X_SUGGESTION_CONFIG_NAME = 'suggestion';\r\n\r\n/**\r\n * Suggestion Property\r\n */\r\n@Component({ selector: `${XSuggestionPrefix}-property`, template: '' })\r\nexport class XSuggestionProperty extends XPropertyFunction(X_SUGGESTION_CONFIG_NAME) {\r\n /**\r\n * @zh_CN 建议项列表\r\n * @en_US Suggestion items\r\n */\r\n readonly data = input<XSuggestionNode[], XDataArray<XSuggestionNode>>([], { transform: XToDataArray });\r\n /**\r\n * @zh_CN 显示建议项\r\n * @en_US Show Suggestion items\r\n */\r\n readonly visible = model<boolean>(false);\r\n /**\r\n * @zh_CN 展示位置\r\n * @en_US Placement\r\n */\r\n readonly placement = input<XPlacement>(this.config?.placement ?? 'top-start');\r\n /**\r\n * @zh_CN 禁用\r\n * @en_US Disabled\r\n */\r\n readonly disabled = input<boolean, XBoolean>(false, { transform: XToBoolean });\r\n /**\r\n * @zh_CN 节点中已经包含子节点数据\r\n * @en_US The node already contains child node data\r\n */\r\n readonly children = input<boolean, XBoolean>(false, { transform: XToBoolean });\r\n /**\r\n * @zh_CN 弹框的最小宽度\r\n * @en_US Portal min-width\r\n */\r\n readonly portalMinWidth = input<string, XNumber>('10rem', { transform: XToCssPixelValue });\r\n /**\r\n * @zh_CN 弹框的最大宽度\r\n * @en_US Portal max-width\r\n */\r\n readonly portalMaxWidth = input<string, XNumber>('', { transform: XToCssPixelValue });\r\n /**\r\n * @zh_CN 弹框的最小高度\r\n * @en_US Portal min-height\r\n */\r\n readonly portalMinHeight = input<string, XNumber>('', { transform: XToCssPixelValue });\r\n /**\r\n * @zh_CN 弹框的最大高度\r\n * @en_US Portal max-height\r\n */\r\n readonly portalMaxHeight = input<string, XNumber>('', { transform: XToCssPixelValue });\r\n /**\r\n * @zh_CN 尺寸\r\n * @en_US Size\r\n */\r\n readonly size = input<XSize>(this.config?.size ?? 'medium');\r\n /**\r\n * @zh_CN 建议项点击事件\r\n * @en_US Suggestion item click event\r\n */\r\n readonly nodeClick = output<XSuggestionNode>();\r\n}\r\n\r\n/**\r\n * @zh_CN 建议项\r\n * @en_US Suggestion\r\n */\r\nexport interface XSuggestionNode extends XDropdownNode {}\r\n","import { ChangeDetectionStrategy, Component, ViewEncapsulation } from '@angular/core';\r\nimport { XSuggestionProperty } from './suggestion.property';\r\nimport { XDropdownComponent } from '@ng-nest/ui/dropdown';\r\n\r\n@Component({\r\n selector: 'x-suggestion',\r\n templateUrl: './suggestion.component.html',\r\n styleUrls: ['./suggestion.component.scss'],\r\n encapsulation: ViewEncapsulation.None,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n imports: [XDropdownComponent]\r\n})\r\nexport class XSuggestionComponent extends XSuggestionProperty {}\r\n","<div class=\"x-suggestion\">\r\n <x-dropdown\r\n [data]=\"data()\"\r\n (nodeClick)=\"nodeClick.emit($event)\"\r\n [trigger]=\"'click'\"\r\n [(visible)]=\"visible\"\r\n [placement]=\"placement()\"\r\n [disabled]=\"disabled()\"\r\n [children]=\"children()\"\r\n [portalMinWidth]=\"portalMinWidth()\"\r\n [portalMaxWidth]=\"portalMaxWidth()\"\r\n [portalMinHeight]=\"portalMinHeight()\"\r\n [portalMaxHeight]=\"portalMaxHeight()\"\r\n [size]=\"size()\"\r\n >\r\n <ng-content></ng-content>\r\n </x-dropdown>\r\n</div>\r\n","import { NgModule } from '@angular/core';\r\nimport { XSuggestionComponent } from './suggestion.component';\r\n\r\n@NgModule({\r\n exports: [XSuggestionComponent],\r\n imports: [XSuggestionComponent]\r\n})\r\nexport class XSuggestionModule {}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAcA;;;;AAIG;AACI,MAAM,iBAAiB,GAAG;AACjC,MAAM,wBAAwB,GAAG,YAAY;AAE7C;;AAEG;MAEU,mBAAoB,SAAQ,iBAAiB,CAAC,wBAAwB,CAAC,CAAA;AADpF,IAAA,WAAA,GAAA;;AAEE;;;AAGG;AACM,QAAA,IAAA,CAAA,IAAI,GAAG,KAAK,CAAiD,EAAE,wCAAI,SAAS,EAAE,YAAY,EAAA,CAAA,GAAA,CAAzB,EAAE,SAAS,EAAE,YAAY,EAAE,GAAC;AACtG;;;AAGG;AACM,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK,CAAU,KAAK,mDAAC;AACxC;;;AAGG;QACM,IAAA,CAAA,SAAS,GAAG,KAAK,CAAa,IAAI,CAAC,MAAM,EAAE,SAAS,IAAI,WAAW,EAAA,IAAA,SAAA,GAAA,CAAA,EAAA,SAAA,EAAA,WAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAC;AAC7E;;;AAGG;AACM,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAoB,KAAK,4CAAI,SAAS,EAAE,UAAU,EAAA,CAAA,GAAA,CAAvB,EAAE,SAAS,EAAE,UAAU,EAAE,GAAC;AAC9E;;;AAGG;AACM,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAoB,KAAK,4CAAI,SAAS,EAAE,UAAU,EAAA,CAAA,GAAA,CAAvB,EAAE,SAAS,EAAE,UAAU,EAAE,GAAC;AAC9E;;;AAGG;AACM,QAAA,IAAA,CAAA,cAAc,GAAG,KAAK,CAAkB,OAAO,kDAAI,SAAS,EAAE,gBAAgB,EAAA,CAAA,GAAA,CAA7B,EAAE,SAAS,EAAE,gBAAgB,EAAE,GAAC;AAC1F;;;AAGG;AACM,QAAA,IAAA,CAAA,cAAc,GAAG,KAAK,CA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,IAAA,EAAA,CAAA;oBACR,OAAO,EAAE,CAAC,oBAAoB,CAAC;oBAC/B,OAAO,EAAE,CAAC,oBAAoB;AAC/B,iBAAA;;;ACND;;AAEG;;;;"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { model, input, Component, inject, ChangeDetectorRef, ChangeDetectionStrategy, ViewEncapsulation, NgModule } from '@angular/core';
|
|
3
|
+
import { XPropertyFunction, XToBoolean } from '@ng-nest/ui/core';
|
|
4
|
+
import { XTimelineComponent } from '@ng-nest/ui/timeline';
|
|
5
|
+
import { XOutletDirective } from '@ng-nest/ui/outlet';
|
|
6
|
+
import { XIconComponent } from '@ng-nest/ui/icon';
|
|
7
|
+
import { XLoadingComponent } from '@ng-nest/ui/loading';
|
|
8
|
+
import * as i1 from '@ng-nest/ui/collapse';
|
|
9
|
+
import { XCollapseModule } from '@ng-nest/ui/collapse';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* ThoughtChain
|
|
13
|
+
* @selector x-thought-chain
|
|
14
|
+
* @decorator component
|
|
15
|
+
*/
|
|
16
|
+
const XThoughtChainPrefix = 'x-thought-chain';
|
|
17
|
+
const X_THOUGHT_CHAIN_CONFIG_NAME = 'thoughtChain';
|
|
18
|
+
/**
|
|
19
|
+
* ThoughtChain Property
|
|
20
|
+
*/
|
|
21
|
+
class XThoughtChainProperty extends XPropertyFunction(X_THOUGHT_CHAIN_CONFIG_NAME) {
|
|
22
|
+
constructor() {
|
|
23
|
+
super(...arguments);
|
|
24
|
+
/**
|
|
25
|
+
* @zh_CN 思维链节点数据
|
|
26
|
+
* @en_US ThoughtChain items
|
|
27
|
+
*/
|
|
28
|
+
this.data = model([], ...(ngDevMode ? [{ debugName: "data" }] : []));
|
|
29
|
+
/**
|
|
30
|
+
* @zh_CN 显示序号
|
|
31
|
+
* @en_US Show number
|
|
32
|
+
*/
|
|
33
|
+
this.showNumber = input(this.config?.showNumber ?? true, ...(ngDevMode ? [{ debugName: "showNumber", transform: XToBoolean }] : [{ transform: XToBoolean }]));
|
|
34
|
+
/**
|
|
35
|
+
* @zh_CN 尺寸
|
|
36
|
+
* @en_US Size
|
|
37
|
+
*/
|
|
38
|
+
this.size = input(this.config?.size ?? 'medium', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
39
|
+
/**
|
|
40
|
+
* @zh_CN 自定义内容模板
|
|
41
|
+
* @en_US Content template
|
|
42
|
+
*/
|
|
43
|
+
this.wrapper = input(...(ngDevMode ? [undefined, { debugName: "wrapper" }] : []));
|
|
44
|
+
/**
|
|
45
|
+
* @zh_CN 自定义图标模板
|
|
46
|
+
* @en_US Icon template
|
|
47
|
+
*/
|
|
48
|
+
this.icon = input(...(ngDevMode ? [undefined, { debugName: "icon" }] : []));
|
|
49
|
+
/**
|
|
50
|
+
* @zh_CN 节点标题右侧额外的内容模板
|
|
51
|
+
* @en_US Node extra content
|
|
52
|
+
*/
|
|
53
|
+
this.extra = input(...(ngDevMode ? [undefined, { debugName: "extra" }] : []));
|
|
54
|
+
/**
|
|
55
|
+
* @zh_CN 节点详细内容模板
|
|
56
|
+
* @en_US Node detail content
|
|
57
|
+
*/
|
|
58
|
+
this.content = input(...(ngDevMode ? [undefined, { debugName: "content" }] : []));
|
|
59
|
+
/**
|
|
60
|
+
* @zh_CN 详细内容是否可折叠
|
|
61
|
+
* @en_US Collapsible detail content
|
|
62
|
+
*/
|
|
63
|
+
this.collapsible = input(this.config?.collapsible ?? false, ...(ngDevMode ? [{ debugName: "collapsible", transform: XToBoolean }] : [{ transform: XToBoolean }]));
|
|
64
|
+
/**
|
|
65
|
+
* @zh_CN loading 的类型样式
|
|
66
|
+
* @en_US Loading type style
|
|
67
|
+
*/
|
|
68
|
+
this.loadingType = input(this.config?.loadingType ?? 'circular', ...(ngDevMode ? [{ debugName: "loadingType" }] : []));
|
|
69
|
+
}
|
|
70
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: XThoughtChainProperty, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
71
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.0", type: XThoughtChainProperty, isStandalone: true, selector: "x-thought-chain-property", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, showNumber: { classPropertyName: "showNumber", publicName: "showNumber", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, wrapper: { classPropertyName: "wrapper", publicName: "wrapper", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, extra: { classPropertyName: "extra", publicName: "extra", isSignal: true, isRequired: false, transformFunction: null }, content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: false, transformFunction: null }, collapsible: { classPropertyName: "collapsible", publicName: "collapsible", isSignal: true, isRequired: false, transformFunction: null }, loadingType: { classPropertyName: "loadingType", publicName: "loadingType", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { data: "dataChange" }, usesInheritance: true, ngImport: i0, template: '', isInline: true }); }
|
|
72
|
+
}
|
|
73
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: XThoughtChainProperty, decorators: [{
|
|
74
|
+
type: Component,
|
|
75
|
+
args: [{ selector: `${XThoughtChainPrefix}-property`, template: '' }]
|
|
76
|
+
}] });
|
|
77
|
+
|
|
78
|
+
class XThoughtChainComponent extends XThoughtChainProperty {
|
|
79
|
+
constructor() {
|
|
80
|
+
super(...arguments);
|
|
81
|
+
this.cdr = inject(ChangeDetectorRef);
|
|
82
|
+
}
|
|
83
|
+
addNode(node) {
|
|
84
|
+
this.data.update((x) => [...x, node]);
|
|
85
|
+
}
|
|
86
|
+
updateNode(node) {
|
|
87
|
+
const nd = this.data().find((x) => x.id === node.id);
|
|
88
|
+
if (nd)
|
|
89
|
+
Object.assign(nd, node);
|
|
90
|
+
this.cdr.detectChanges();
|
|
91
|
+
}
|
|
92
|
+
removeNode(node) {
|
|
93
|
+
this.data.update((x) => [...x.filter((y) => y.id !== node.id)]);
|
|
94
|
+
}
|
|
95
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: XThoughtChainComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
96
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.0", type: XThoughtChainComponent, isStandalone: true, selector: "x-thought-chain", usesInheritance: true, ngImport: i0, template: "<div class=\"x-thought-chain\">\r\n <x-timeline\r\n [data]=\"data()\"\r\n [showNumber]=\"showNumber()\"\r\n [icon]=\"iconTpl\"\r\n [wrapper]=\"wrapper() ?? wrapperTpl\"\r\n [size]=\"size()\"\r\n ></x-timeline>\r\n\r\n <ng-template #iconTpl let-node=\"$node\" let-index=\"$index\">\r\n <div\r\n class=\"x-thought-chain-icon\"\r\n [class.x-thought-chain-success]=\"node.status === 'success'\"\r\n [class.x-thought-chain-error]=\"node.status === 'error'\"\r\n [class.x-thought-chain-pending]=\"node.status === 'pending'\"\r\n [style.backgroundColor]=\"node.color\"\r\n >\r\n @if (showNumber() && !node.icon && !node.loading && node.status !== 'pending') {\r\n {{ index + 1 }}\r\n }\r\n @if (node.icon && !node.loading && node.status !== 'pending') {\r\n <x-icon [type]=\"node.icon\"></x-icon>\r\n }\r\n @if (node.loading || node.status === 'pending') {\r\n <x-loading inline [x-loading]=\"true\" [size]=\"size()\" [type]=\"loadingType()\"></x-loading>\r\n }\r\n </div>\r\n </ng-template>\r\n\r\n <ng-template #wrapperTpl let-node=\"$node\" let-index=\"$index\">\r\n @if (collapsible()) {\r\n <x-collapse class=\"x-thought-chain-collapse\" ghost iconPosition=\"left\">\r\n <x-collapse-panel [label]=\"labelTpl\">\r\n <ng-container *xOutlet=\"contentTpl\"></ng-container>\r\n </x-collapse-panel>\r\n </x-collapse>\r\n } @else {\r\n <ng-container *xOutlet=\"labelTpl\"></ng-container>\r\n <ng-container *xOutlet=\"contentTpl\"></ng-container>\r\n }\r\n <ng-template #labelTpl>\r\n <div class=\"x-thought-chain-wrapper\">\r\n <div class=\"x-thought-chain-inner\">\r\n <div class=\"x-thought-chain-label\">{{ node.label }}</div>\r\n <div class=\"x-thought-chain-description\">{{ node.description }}</div>\r\n </div>\r\n <div class=\"x-thought-chain-extra\">\r\n <ng-container *xOutlet=\"extra(); context: { $node: node, $index: index }\"></ng-container>\r\n </div>\r\n </div>\r\n </ng-template>\r\n\r\n <ng-template #contentTpl>\r\n @if (node.content || content()) {\r\n @if (content()) {\r\n <div class=\"x-thought-chain-content\">\r\n <ng-container *xOutlet=\"content(); context: { $node: node, $index: index }\"></ng-container>\r\n </div>\r\n } @else {\r\n <div class=\"x-thought-chain-content\" [innerHTML]=\"node.content\"></div>\r\n }\r\n }\r\n </ng-template>\r\n </ng-template>\r\n</div>\r\n", styles: [".x-thought-chain{margin:0;padding:0}.x-thought-chain-wrapper{display:flex}.x-thought-chain-inner{flex:1;display:flex;flex-direction:column}.x-thought-chain-label{font-weight:600}.x-thought-chain-description{color:var(--x-text-400)}.x-thought-chain-content{position:relative;border:var(--x-border-width) var(--x-border-style) var(--x-border);border-radius:var(--x-border-radius);background-color:var(--x-white)}.x-thought-chain-collapse .x-collapse-panel-header{padding:0;align-items:flex-start}.x-thought-chain-icon{width:100%;height:100%;border-radius:50%;display:flex;justify-content:center;align-items:center}.x-thought-chain-success{background-color:var(--x-success)}.x-thought-chain-error{background-color:var(--x-danger)}.x-thought-chain .x-timeline-big .x-thought-chain-label{line-height:calc(var(--x-height-big) - .5rem)}.x-thought-chain .x-timeline-big .x-thought-chain-content{line-height:calc(var(--x-height-big) - .75rem);padding:var(--x-padding-big)}.x-thought-chain .x-timeline-big .x-thought-chain-collapse .x-collapse-panel-header>.x-icon{height:calc(var(--x-height-big) - .5rem);display:flex;align-items:center}.x-thought-chain .x-timeline-big .x-thought-chain-collapse .x-collapse-panel-content{padding:calc(var(--x-padding-big) * .5) 0}.x-thought-chain .x-timeline-large .x-thought-chain-label{line-height:calc(var(--x-height-large) - .5rem)}.x-thought-chain .x-timeline-large .x-thought-chain-content{line-height:calc(var(--x-height-large) - .75rem);padding:var(--x-padding-large)}.x-thought-chain .x-timeline-large .x-thought-chain-collapse .x-collapse-panel-header>.x-icon{height:calc(var(--x-height-large) - .5rem);display:flex;align-items:center}.x-thought-chain .x-timeline-large .x-thought-chain-collapse .x-collapse-panel-content{padding:calc(var(--x-padding-large) * .5) 0}.x-thought-chain .x-timeline-medium .x-thought-chain-label{line-height:calc(var(--x-height-medium) - .5rem)}.x-thought-chain .x-timeline-medium .x-thought-chain-content{line-height:calc(var(--x-height-medium) - .75rem);padding:var(--x-padding-medium)}.x-thought-chain .x-timeline-medium .x-thought-chain-collapse .x-collapse-panel-header>.x-icon{height:calc(var(--x-height-medium) - .5rem);display:flex;align-items:center}.x-thought-chain .x-timeline-medium .x-thought-chain-collapse .x-collapse-panel-content{padding:calc(var(--x-padding-medium) * .5) 0}.x-thought-chain .x-timeline-small .x-thought-chain-label{line-height:calc(var(--x-height-small) - .5rem)}.x-thought-chain .x-timeline-small .x-thought-chain-content{line-height:calc(var(--x-height-small) - .75rem);padding:var(--x-padding-small)}.x-thought-chain .x-timeline-small .x-thought-chain-collapse .x-collapse-panel-header>.x-icon{height:calc(var(--x-height-small) - .5rem);display:flex;align-items:center}.x-thought-chain .x-timeline-small .x-thought-chain-collapse .x-collapse-panel-content{padding:calc(var(--x-padding-small) * .5) 0}.x-thought-chain .x-timeline-mini .x-thought-chain-label{line-height:calc(var(--x-height-mini) - .5rem)}.x-thought-chain .x-timeline-mini .x-thought-chain-content{line-height:calc(var(--x-height-mini) - .75rem);padding:var(--x-padding-mini)}.x-thought-chain .x-timeline-mini .x-thought-chain-collapse .x-collapse-panel-header>.x-icon{height:calc(var(--x-height-mini) - .5rem);display:flex;align-items:center}.x-thought-chain .x-timeline-mini .x-thought-chain-collapse .x-collapse-panel-content{padding:calc(var(--x-padding-mini) * .5) 0}\n"], dependencies: [{ kind: "component", type: XTimelineComponent, selector: "x-timeline" }, { kind: "directive", type: XOutletDirective, selector: "[xOutlet]", inputs: ["xOutletContext", "xOutlet"] }, { kind: "component", type: XIconComponent, selector: "x-icon" }, { kind: "component", type: XLoadingComponent, selector: "x-loading, [x-loading]" }, { kind: "ngmodule", type: XCollapseModule }, { kind: "component", type: i1.XCollapseComponent, selector: "x-collapse" }, { kind: "component", type: i1.XCollapsePanelComponent, selector: "x-collapse-panel" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
97
|
+
}
|
|
98
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: XThoughtChainComponent, decorators: [{
|
|
99
|
+
type: Component,
|
|
100
|
+
args: [{ selector: 'x-thought-chain', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [XTimelineComponent, XOutletDirective, XIconComponent, XLoadingComponent, XCollapseModule], template: "<div class=\"x-thought-chain\">\r\n <x-timeline\r\n [data]=\"data()\"\r\n [showNumber]=\"showNumber()\"\r\n [icon]=\"iconTpl\"\r\n [wrapper]=\"wrapper() ?? wrapperTpl\"\r\n [size]=\"size()\"\r\n ></x-timeline>\r\n\r\n <ng-template #iconTpl let-node=\"$node\" let-index=\"$index\">\r\n <div\r\n class=\"x-thought-chain-icon\"\r\n [class.x-thought-chain-success]=\"node.status === 'success'\"\r\n [class.x-thought-chain-error]=\"node.status === 'error'\"\r\n [class.x-thought-chain-pending]=\"node.status === 'pending'\"\r\n [style.backgroundColor]=\"node.color\"\r\n >\r\n @if (showNumber() && !node.icon && !node.loading && node.status !== 'pending') {\r\n {{ index + 1 }}\r\n }\r\n @if (node.icon && !node.loading && node.status !== 'pending') {\r\n <x-icon [type]=\"node.icon\"></x-icon>\r\n }\r\n @if (node.loading || node.status === 'pending') {\r\n <x-loading inline [x-loading]=\"true\" [size]=\"size()\" [type]=\"loadingType()\"></x-loading>\r\n }\r\n </div>\r\n </ng-template>\r\n\r\n <ng-template #wrapperTpl let-node=\"$node\" let-index=\"$index\">\r\n @if (collapsible()) {\r\n <x-collapse class=\"x-thought-chain-collapse\" ghost iconPosition=\"left\">\r\n <x-collapse-panel [label]=\"labelTpl\">\r\n <ng-container *xOutlet=\"contentTpl\"></ng-container>\r\n </x-collapse-panel>\r\n </x-collapse>\r\n } @else {\r\n <ng-container *xOutlet=\"labelTpl\"></ng-container>\r\n <ng-container *xOutlet=\"contentTpl\"></ng-container>\r\n }\r\n <ng-template #labelTpl>\r\n <div class=\"x-thought-chain-wrapper\">\r\n <div class=\"x-thought-chain-inner\">\r\n <div class=\"x-thought-chain-label\">{{ node.label }}</div>\r\n <div class=\"x-thought-chain-description\">{{ node.description }}</div>\r\n </div>\r\n <div class=\"x-thought-chain-extra\">\r\n <ng-container *xOutlet=\"extra(); context: { $node: node, $index: index }\"></ng-container>\r\n </div>\r\n </div>\r\n </ng-template>\r\n\r\n <ng-template #contentTpl>\r\n @if (node.content || content()) {\r\n @if (content()) {\r\n <div class=\"x-thought-chain-content\">\r\n <ng-container *xOutlet=\"content(); context: { $node: node, $index: index }\"></ng-container>\r\n </div>\r\n } @else {\r\n <div class=\"x-thought-chain-content\" [innerHTML]=\"node.content\"></div>\r\n }\r\n }\r\n </ng-template>\r\n </ng-template>\r\n</div>\r\n", styles: [".x-thought-chain{margin:0;padding:0}.x-thought-chain-wrapper{display:flex}.x-thought-chain-inner{flex:1;display:flex;flex-direction:column}.x-thought-chain-label{font-weight:600}.x-thought-chain-description{color:var(--x-text-400)}.x-thought-chain-content{position:relative;border:var(--x-border-width) var(--x-border-style) var(--x-border);border-radius:var(--x-border-radius);background-color:var(--x-white)}.x-thought-chain-collapse .x-collapse-panel-header{padding:0;align-items:flex-start}.x-thought-chain-icon{width:100%;height:100%;border-radius:50%;display:flex;justify-content:center;align-items:center}.x-thought-chain-success{background-color:var(--x-success)}.x-thought-chain-error{background-color:var(--x-danger)}.x-thought-chain .x-timeline-big .x-thought-chain-label{line-height:calc(var(--x-height-big) - .5rem)}.x-thought-chain .x-timeline-big .x-thought-chain-content{line-height:calc(var(--x-height-big) - .75rem);padding:var(--x-padding-big)}.x-thought-chain .x-timeline-big .x-thought-chain-collapse .x-collapse-panel-header>.x-icon{height:calc(var(--x-height-big) - .5rem);display:flex;align-items:center}.x-thought-chain .x-timeline-big .x-thought-chain-collapse .x-collapse-panel-content{padding:calc(var(--x-padding-big) * .5) 0}.x-thought-chain .x-timeline-large .x-thought-chain-label{line-height:calc(var(--x-height-large) - .5rem)}.x-thought-chain .x-timeline-large .x-thought-chain-content{line-height:calc(var(--x-height-large) - .75rem);padding:var(--x-padding-large)}.x-thought-chain .x-timeline-large .x-thought-chain-collapse .x-collapse-panel-header>.x-icon{height:calc(var(--x-height-large) - .5rem);display:flex;align-items:center}.x-thought-chain .x-timeline-large .x-thought-chain-collapse .x-collapse-panel-content{padding:calc(var(--x-padding-large) * .5) 0}.x-thought-chain .x-timeline-medium .x-thought-chain-label{line-height:calc(var(--x-height-medium) - .5rem)}.x-thought-chain .x-timeline-medium .x-thought-chain-content{line-height:calc(var(--x-height-medium) - .75rem);padding:var(--x-padding-medium)}.x-thought-chain .x-timeline-medium .x-thought-chain-collapse .x-collapse-panel-header>.x-icon{height:calc(var(--x-height-medium) - .5rem);display:flex;align-items:center}.x-thought-chain .x-timeline-medium .x-thought-chain-collapse .x-collapse-panel-content{padding:calc(var(--x-padding-medium) * .5) 0}.x-thought-chain .x-timeline-small .x-thought-chain-label{line-height:calc(var(--x-height-small) - .5rem)}.x-thought-chain .x-timeline-small .x-thought-chain-content{line-height:calc(var(--x-height-small) - .75rem);padding:var(--x-padding-small)}.x-thought-chain .x-timeline-small .x-thought-chain-collapse .x-collapse-panel-header>.x-icon{height:calc(var(--x-height-small) - .5rem);display:flex;align-items:center}.x-thought-chain .x-timeline-small .x-thought-chain-collapse .x-collapse-panel-content{padding:calc(var(--x-padding-small) * .5) 0}.x-thought-chain .x-timeline-mini .x-thought-chain-label{line-height:calc(var(--x-height-mini) - .5rem)}.x-thought-chain .x-timeline-mini .x-thought-chain-content{line-height:calc(var(--x-height-mini) - .75rem);padding:var(--x-padding-mini)}.x-thought-chain .x-timeline-mini .x-thought-chain-collapse .x-collapse-panel-header>.x-icon{height:calc(var(--x-height-mini) - .5rem);display:flex;align-items:center}.x-thought-chain .x-timeline-mini .x-thought-chain-collapse .x-collapse-panel-content{padding:calc(var(--x-padding-mini) * .5) 0}\n"] }]
|
|
101
|
+
}] });
|
|
102
|
+
|
|
103
|
+
class XThoughtChainModule {
|
|
104
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: XThoughtChainModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
105
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.0", ngImport: i0, type: XThoughtChainModule, imports: [XThoughtChainComponent], exports: [XThoughtChainComponent] }); }
|
|
106
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: XThoughtChainModule, imports: [XThoughtChainComponent] }); }
|
|
107
|
+
}
|
|
108
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: XThoughtChainModule, decorators: [{
|
|
109
|
+
type: NgModule,
|
|
110
|
+
args: [{
|
|
111
|
+
exports: [XThoughtChainComponent],
|
|
112
|
+
imports: [XThoughtChainComponent]
|
|
113
|
+
}]
|
|
114
|
+
}] });
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Generated bundle index. Do not edit.
|
|
118
|
+
*/
|
|
119
|
+
|
|
120
|
+
export { XThoughtChainComponent, XThoughtChainModule, XThoughtChainPrefix, XThoughtChainProperty };
|
|
121
|
+
//# sourceMappingURL=ng-nest-ui-thought-chain.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ng-nest-ui-thought-chain.mjs","sources":["../../../../lib/ng-nest/ui/thought-chain/thought-chain.property.ts","../../../../lib/ng-nest/ui/thought-chain/thought-chain.component.ts","../../../../lib/ng-nest/ui/thought-chain/thought-chain.component.html","../../../../lib/ng-nest/ui/thought-chain/thought-chain.module.ts","../../../../lib/ng-nest/ui/thought-chain/ng-nest-ui-thought-chain.ts"],"sourcesContent":["import { Component, input, model } from '@angular/core';\r\nimport { XPropertyFunction, XBoolean, XToBoolean, XSize, XTemplate } from '@ng-nest/ui/core';\r\nimport { XTimelineNode } from '@ng-nest/ui/timeline';\r\nimport type { XLoadingType } from '@ng-nest/ui/loading';\r\n\r\n/**\r\n * ThoughtChain\r\n * @selector x-thought-chain\r\n * @decorator component\r\n */\r\nexport const XThoughtChainPrefix = 'x-thought-chain';\r\nconst X_THOUGHT_CHAIN_CONFIG_NAME = 'thoughtChain';\r\n\r\n/**\r\n * ThoughtChain Property\r\n */\r\n@Component({ selector: `${XThoughtChainPrefix}-property`, template: '' })\r\nexport class XThoughtChainProperty extends XPropertyFunction(X_THOUGHT_CHAIN_CONFIG_NAME) {\r\n /**\r\n * @zh_CN 思维链节点数据\r\n * @en_US ThoughtChain items\r\n */\r\n readonly data = model<XThoughtChainNode[]>([]);\r\n /**\r\n * @zh_CN 显示序号\r\n * @en_US Show number\r\n */\r\n readonly showNumber = input<boolean, XBoolean>(this.config?.showNumber ?? true, { transform: XToBoolean });\r\n /**\r\n * @zh_CN 尺寸\r\n * @en_US Size\r\n */\r\n readonly size = input<XSize>(this.config?.size ?? 'medium');\r\n /**\r\n * @zh_CN 自定义内容模板\r\n * @en_US Content template\r\n */\r\n readonly wrapper = input<XTemplate>();\r\n /**\r\n * @zh_CN 自定义图标模板\r\n * @en_US Icon template\r\n */\r\n readonly icon = input<XTemplate>();\r\n /**\r\n * @zh_CN 节点标题右侧额外的内容模板\r\n * @en_US Node extra content\r\n */\r\n readonly extra = input<XTemplate>();\r\n /**\r\n * @zh_CN 节点详细内容模板\r\n * @en_US Node detail content\r\n */\r\n readonly content = input<XTemplate>();\r\n /**\r\n * @zh_CN 详细内容是否可折叠\r\n * @en_US Collapsible detail content\r\n */\r\n readonly collapsible = input<boolean, XBoolean>(this.config?.collapsible ?? false, { transform: XToBoolean });\r\n /**\r\n * @zh_CN loading 的类型样式\r\n * @en_US Loading type style\r\n */\r\n readonly loadingType = input<XLoadingType>(this.config?.loadingType ?? 'circular');\r\n}\r\n\r\n/**\r\n * @zh_CN 思维链节点\r\n * @en_US Thought chain node\r\n */\r\nexport interface XThoughtChainNode extends XTimelineNode {\r\n /**\r\n * @zh_CN 节点描述\r\n * @en_US Node description\r\n */\r\n description?: string;\r\n /**\r\n * @zh_CN 节点状态\r\n * @en_US Node status\r\n */\r\n status?: XThoughtChainNodeStatus;\r\n}\r\n\r\n/**\r\n * @zh_CN 节点状态\r\n * @en_US Node status\r\n */\r\nexport type XThoughtChainNodeStatus = 'success' | 'error' | 'pending';\r\n","import { ChangeDetectionStrategy, ChangeDetectorRef, Component, inject, ViewEncapsulation } from '@angular/core';\r\nimport { XThoughtChainNode, XThoughtChainProperty } from './thought-chain.property';\r\nimport { XTimelineComponent } from '@ng-nest/ui/timeline';\r\nimport { XOutletDirective } from '@ng-nest/ui/outlet';\r\nimport { XIconComponent } from '@ng-nest/ui/icon';\r\nimport { XLoadingComponent } from '@ng-nest/ui/loading';\r\nimport { XCollapseModule } from '@ng-nest/ui/collapse';\r\n\r\n@Component({\r\n selector: 'x-thought-chain',\r\n templateUrl: './thought-chain.component.html',\r\n styleUrls: ['./thought-chain.component.scss'],\r\n encapsulation: ViewEncapsulation.None,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n imports: [XTimelineComponent, XOutletDirective, XIconComponent, XLoadingComponent, XCollapseModule]\r\n})\r\nexport class XThoughtChainComponent extends XThoughtChainProperty {\r\n cdr = inject(ChangeDetectorRef);\r\n addNode(node: XThoughtChainNode) {\r\n this.data.update((x) => [...x, node]);\r\n }\r\n\r\n updateNode(node: XThoughtChainNode) {\r\n const nd = this.data().find((x) => x.id === node.id);\r\n if (nd) Object.assign(nd, node);\r\n this.cdr.detectChanges();\r\n }\r\n\r\n removeNode(node: XThoughtChainNode) {\r\n this.data.update((x) => [...x.filter((y) => y.id !== node.id)]);\r\n }\r\n}\r\n","<div class=\"x-thought-chain\">\r\n <x-timeline\r\n [data]=\"data()\"\r\n [showNumber]=\"showNumber()\"\r\n [icon]=\"iconTpl\"\r\n [wrapper]=\"wrapper() ?? wrapperTpl\"\r\n [size]=\"size()\"\r\n ></x-timeline>\r\n\r\n <ng-template #iconTpl let-node=\"$node\" let-index=\"$index\">\r\n <div\r\n class=\"x-thought-chain-icon\"\r\n [class.x-thought-chain-success]=\"node.status === 'success'\"\r\n [class.x-thought-chain-error]=\"node.status === 'error'\"\r\n [class.x-thought-chain-pending]=\"node.status === 'pending'\"\r\n [style.backgroundColor]=\"node.color\"\r\n >\r\n @if (showNumber() && !node.icon && !node.loading && node.status !== 'pending') {\r\n {{ index + 1 }}\r\n }\r\n @if (node.icon && !node.loading && node.status !== 'pending') {\r\n <x-icon [type]=\"node.icon\"></x-icon>\r\n }\r\n @if (node.loading || node.status === 'pending') {\r\n <x-loading inline [x-loading]=\"true\" [size]=\"size()\" [type]=\"loadingType()\"></x-loading>\r\n }\r\n </div>\r\n </ng-template>\r\n\r\n <ng-template #wrapperTpl let-node=\"$node\" let-index=\"$index\">\r\n @if (collapsible()) {\r\n <x-collapse class=\"x-thought-chain-collapse\" ghost iconPosition=\"left\">\r\n <x-collapse-panel [label]=\"labelTpl\">\r\n <ng-container *xOutlet=\"contentTpl\"></ng-container>\r\n </x-collapse-panel>\r\n </x-collapse>\r\n } @else {\r\n <ng-container *xOutlet=\"labelTpl\"></ng-container>\r\n <ng-container *xOutlet=\"contentTpl\"></ng-container>\r\n }\r\n <ng-template #labelTpl>\r\n <div class=\"x-thought-chain-wrapper\">\r\n <div class=\"x-thought-chain-inner\">\r\n <div class=\"x-thought-chain-label\">{{ node.label }}</div>\r\n <div class=\"x-thought-chain-description\">{{ node.description }}</div>\r\n </div>\r\n <div class=\"x-thought-chain-extra\">\r\n <ng-container *xOutlet=\"extra(); context: { $node: node, $index: index }\"></ng-container>\r\n </div>\r\n </div>\r\n </ng-template>\r\n\r\n <ng-template #contentTpl>\r\n @if (node.content || content()) {\r\n @if (content()) {\r\n <div class=\"x-thought-chain-content\">\r\n <ng-container *xOutlet=\"content(); context: { $node: node, $index: index }\"></ng-container>\r\n </div>\r\n } @else {\r\n <div class=\"x-thought-chain-content\" [innerHTML]=\"node.content\"></div>\r\n }\r\n }\r\n </ng-template>\r\n </ng-template>\r\n</div>\r\n","import { NgModule } from '@angular/core';\r\nimport { XThoughtChainComponent } from './thought-chain.component';\r\n\r\n@NgModule({\r\n exports: [XThoughtChainComponent],\r\n imports: [XThoughtChainComponent]\r\n})\r\nexport class XThoughtChainModule {}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;AAKA;;;;AAIG;AACI,MAAM,mBAAmB,GAAG;AACnC,MAAM,2BAA2B,GAAG,cAAc;AAElD;;AAEG;MAEU,qBAAsB,SAAQ,iBAAiB,CAAC,2BAA2B,CAAC,CAAA;AADzF,IAAA,WAAA,GAAA;;AAEE;;;AAGG;AACM,QAAA,IAAA,CAAA,IAAI,GAAG,KAAK,CAAsB,EAAE,gDAAC;AAC9C;;;AAGG;QACM,IAAA,CAAA,UAAU,GAAG,KAAK,CAAoB,IAAI,CAAC,MAAM,EAAE,UAAU,IAAI,IAAI,8CAAI,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