@piying-lib/angular-daisyui 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +64 -0
- package/extension/index.d.ts +449 -0
- package/fesm2022/piying-lib-angular-daisyui-extension.mjs +1356 -0
- package/fesm2022/piying-lib-angular-daisyui-extension.mjs.map +1 -0
- package/fesm2022/piying-lib-angular-daisyui-field-control-props.directive-C5mF89PX.mjs +27 -0
- package/fesm2022/piying-lib-angular-daisyui-field-control-props.directive-C5mF89PX.mjs.map +1 -0
- package/fesm2022/piying-lib-angular-daisyui-field-control.mjs +616 -0
- package/fesm2022/piying-lib-angular-daisyui-field-control.mjs.map +1 -0
- package/fesm2022/piying-lib-angular-daisyui-field-group.mjs +345 -0
- package/fesm2022/piying-lib-angular-daisyui-field-group.mjs.map +1 -0
- package/fesm2022/piying-lib-angular-daisyui-non-field-control.mjs +452 -0
- package/fesm2022/piying-lib-angular-daisyui-non-field-control.mjs.map +1 -0
- package/fesm2022/piying-lib-angular-daisyui-pipe.mjs +55 -0
- package/fesm2022/piying-lib-angular-daisyui-pipe.mjs.map +1 -0
- package/fesm2022/piying-lib-angular-daisyui-service.mjs +115 -0
- package/fesm2022/piying-lib-angular-daisyui-service.mjs.map +1 -0
- package/fesm2022/piying-lib-angular-daisyui-wrapper.mjs +75 -0
- package/fesm2022/piying-lib-angular-daisyui-wrapper.mjs.map +1 -0
- package/fesm2022/piying-lib-angular-daisyui.mjs +4 -0
- package/fesm2022/piying-lib-angular-daisyui.mjs.map +1 -0
- package/field-control/index.d.ts +204 -0
- package/field-group/index.d.ts +162 -0
- package/index.d.ts +2 -0
- package/non-field-control/index.d.ts +255 -0
- package/package.json +54 -0
- package/pipe/index.d.ts +25 -0
- package/preset-css/css/style.css +1 -0
- package/preset-css/css/style.split.css +126 -0
- package/preset-css/json/manifest.json +739 -0
- package/preset-css/ts/accordion.ts +9 -0
- package/preset-css/ts/alert.ts +12 -0
- package/preset-css/ts/avatar.ts +7 -0
- package/preset-css/ts/badge.ts +20 -0
- package/preset-css/ts/breadcrumbs.ts +1 -0
- package/preset-css/ts/browser-mockup.ts +1 -0
- package/preset-css/ts/button.ts +27 -0
- package/preset-css/ts/calendar.ts +1 -0
- package/preset-css/ts/card.ts +15 -0
- package/preset-css/ts/carousel.ts +9 -0
- package/preset-css/ts/chat-bubble.ts +17 -0
- package/preset-css/ts/checkbox.ts +16 -0
- package/preset-css/ts/code-mockup.ts +1 -0
- package/preset-css/ts/collapse.ts +9 -0
- package/preset-css/ts/countdown.ts +1 -0
- package/preset-css/ts/diff.ts +1 -0
- package/preset-css/ts/divider.ts +15 -0
- package/preset-css/ts/dock.ts +10 -0
- package/preset-css/ts/drawer-sidebar.ts +11 -0
- package/preset-css/ts/dropdown.ts +13 -0
- package/preset-css/ts/fab-speed-dial.ts +1 -0
- package/preset-css/ts/fieldset.ts +1 -0
- package/preset-css/ts/file-input.ts +17 -0
- package/preset-css/ts/filter.ts +1 -0
- package/preset-css/ts/footer.ts +7 -0
- package/preset-css/ts/hero.ts +1 -0
- package/preset-css/ts/hover-gallery.ts +1 -0
- package/preset-css/ts/index.ts +63 -0
- package/preset-css/ts/indicator.ts +10 -0
- package/preset-css/ts/join.ts +1 -0
- package/preset-css/ts/kbd.ts +1 -0
- package/preset-css/ts/label.ts +1 -0
- package/preset-css/ts/link.ts +12 -0
- package/preset-css/ts/list.ts +1 -0
- package/preset-css/ts/loading.ts +14 -0
- package/preset-css/ts/mask.ts +20 -0
- package/preset-css/ts/menu.ts +17 -0
- package/preset-css/ts/modal.ts +13 -0
- package/preset-css/ts/navbar.ts +1 -0
- package/preset-css/ts/pagination.ts +1 -0
- package/preset-css/ts/phone-mockup.ts +5 -0
- package/preset-css/ts/progress.ts +11 -0
- package/preset-css/ts/radial-progress.ts +1 -0
- package/preset-css/ts/radio.ts +16 -0
- package/preset-css/ts/range-slider.ts +16 -0
- package/preset-css/ts/rating.ts +10 -0
- package/preset-css/ts/select.ts +17 -0
- package/preset-css/ts/skeleton.ts +1 -0
- package/preset-css/ts/stack.ts +1 -0
- package/preset-css/ts/stat.ts +11 -0
- package/preset-css/ts/status.ts +16 -0
- package/preset-css/ts/steps.ts +15 -0
- package/preset-css/ts/swap.ts +9 -0
- package/preset-css/ts/table.ts +11 -0
- package/preset-css/ts/tabs.ts +17 -0
- package/preset-css/ts/text-input.ts +17 -0
- package/preset-css/ts/textarea.ts +17 -0
- package/preset-css/ts/theme-controller.ts +1 -0
- package/preset-css/ts/timeline.ts +11 -0
- package/preset-css/ts/toast.ts +9 -0
- package/preset-css/ts/toggle.ts +16 -0
- package/preset-css/ts/tooltip.ts +17 -0
- package/preset-css/ts/validator.ts +1 -0
- package/preset-css/ts/window-mockup.ts +1 -0
- package/service/index.d.ts +42 -0
- package/wrapper/index.d.ts +27 -0
|
@@ -0,0 +1,616 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { viewChild, input, inject, computed, forwardRef, Component, output, signal, PendingTasks, afterNextRender, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/forms';
|
|
4
|
+
import { FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
5
|
+
import { BaseControl, AttributesDirective } from '@piying/view-angular';
|
|
6
|
+
import { NgTemplateOutlet, NgClass } from '@angular/common';
|
|
7
|
+
import { ThemeService } from '@piying-lib/angular-daisyui/service';
|
|
8
|
+
import { CssPrefixPipe, MergeClassPipe } from '@piying-lib/angular-daisyui/pipe';
|
|
9
|
+
import { PurePipe } from '@cyia/ngx-common/pipe';
|
|
10
|
+
import { DefaultOptionConvert, StrOrTemplateComponent } from '@piying-lib/angular-core';
|
|
11
|
+
import { range } from 'es-toolkit';
|
|
12
|
+
import { SelectorlessOutlet } from '@cyia/ngx-common/directive';
|
|
13
|
+
import clsx from 'clsx';
|
|
14
|
+
import { SelectionModel } from '@angular/cdk/collections';
|
|
15
|
+
|
|
16
|
+
class CheckboxFCC extends BaseControl {
|
|
17
|
+
static __version = 2;
|
|
18
|
+
templateRef = viewChild.required('templateRef');
|
|
19
|
+
indeterminate = input(...(ngDevMode ? [undefined, { debugName: "indeterminate" }] : []));
|
|
20
|
+
color = input(...(ngDevMode ? [undefined, { debugName: "color" }] : []));
|
|
21
|
+
size = input(...(ngDevMode ? [undefined, { debugName: "size" }] : []));
|
|
22
|
+
#theme = inject(ThemeService);
|
|
23
|
+
wrapperClass$ = computed(() => {
|
|
24
|
+
return this.#theme.setClass(this.#theme.setColor('checkbox', this.color()), this.#theme.setSize('checkbox', this.size()));
|
|
25
|
+
}, ...(ngDevMode ? [{ debugName: "wrapperClass$" }] : []));
|
|
26
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: CheckboxFCC, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
27
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.3.14", type: CheckboxFCC, isStandalone: true, selector: "app-checkbox", inputs: { indeterminate: { classPropertyName: "indeterminate", publicName: "indeterminate", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
|
|
28
|
+
{
|
|
29
|
+
provide: NG_VALUE_ACCESSOR,
|
|
30
|
+
useExisting: forwardRef(() => CheckboxFCC),
|
|
31
|
+
multi: true,
|
|
32
|
+
},
|
|
33
|
+
], viewQueries: [{ propertyName: "templateRef", first: true, predicate: ["templateRef"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<ng-template #templateRef let-attr=\"attributes\">\n <input\n type=\"checkbox\"\n [ngModel]=\"value$()\"\n (ngModelChange)=\"valueAndTouchedChange($event)\"\n [class]=\"attr()?.class | mergeClass: ('checkbox' | cssPrefix) : wrapperClass$()\"\n [attributes]=\"attr()\"\n [excludes]=\"['class']\"\n [indeterminate]=\"indeterminate()\"\n />\n</ng-template>\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: AttributesDirective, selector: "[attributes]", inputs: ["attributes", "excludes"] }, { kind: "pipe", type: CssPrefixPipe, name: "cssPrefix" }, { kind: "pipe", type: MergeClassPipe, name: "mergeClass" }] });
|
|
34
|
+
}
|
|
35
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: CheckboxFCC, decorators: [{
|
|
36
|
+
type: Component,
|
|
37
|
+
args: [{ selector: 'app-checkbox', imports: [
|
|
38
|
+
FormsModule,
|
|
39
|
+
AttributesDirective,
|
|
40
|
+
NgTemplateOutlet,
|
|
41
|
+
NgClass,
|
|
42
|
+
CssPrefixPipe,
|
|
43
|
+
MergeClassPipe,
|
|
44
|
+
], providers: [
|
|
45
|
+
{
|
|
46
|
+
provide: NG_VALUE_ACCESSOR,
|
|
47
|
+
useExisting: forwardRef(() => CheckboxFCC),
|
|
48
|
+
multi: true,
|
|
49
|
+
},
|
|
50
|
+
], template: "<ng-template #templateRef let-attr=\"attributes\">\n <input\n type=\"checkbox\"\n [ngModel]=\"value$()\"\n (ngModelChange)=\"valueAndTouchedChange($event)\"\n [class]=\"attr()?.class | mergeClass: ('checkbox' | cssPrefix) : wrapperClass$()\"\n [attributes]=\"attr()\"\n [excludes]=\"['class']\"\n [indeterminate]=\"indeterminate()\"\n />\n</ng-template>\n" }]
|
|
51
|
+
}], propDecorators: { templateRef: [{ type: i0.ViewChild, args: ['templateRef', { isSignal: true }] }], indeterminate: [{ type: i0.Input, args: [{ isSignal: true, alias: "indeterminate", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }] } });
|
|
52
|
+
|
|
53
|
+
class FileInputFCC extends BaseControl {
|
|
54
|
+
static __version = 2;
|
|
55
|
+
templateRef = viewChild.required('templateRef');
|
|
56
|
+
color = input(...(ngDevMode ? [undefined, { debugName: "color" }] : []));
|
|
57
|
+
size = input(...(ngDevMode ? [undefined, { debugName: "size" }] : []));
|
|
58
|
+
multiple = input(...(ngDevMode ? [undefined, { debugName: "multiple" }] : []));
|
|
59
|
+
ghost = input(...(ngDevMode ? [undefined, { debugName: "ghost" }] : []));
|
|
60
|
+
fileChange = output();
|
|
61
|
+
fileChanged(input) {
|
|
62
|
+
if (!input.files) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
if (this.multiple()) {
|
|
66
|
+
this.valueAndTouchedChange([...input.files]);
|
|
67
|
+
this.fileChange.emit([...input.files]);
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
this.valueAndTouchedChange(input.files[0]);
|
|
71
|
+
this.fileChange.emit(input.files[0]);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
clicked(input) {
|
|
75
|
+
input.value = '';
|
|
76
|
+
}
|
|
77
|
+
#theme = inject(ThemeService);
|
|
78
|
+
wrapperClass$ = computed(() => {
|
|
79
|
+
return this.#theme.setClass(this.#theme.setColor('file-input', this.color()), this.#theme.setSize('file-input', this.size()), this.ghost() ? this.#theme.addPrefix(`file-input-ghost`) : undefined);
|
|
80
|
+
}, ...(ngDevMode ? [{ debugName: "wrapperClass$" }] : []));
|
|
81
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: FileInputFCC, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
82
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.3.14", type: FileInputFCC, isStandalone: true, selector: "app-file-input", inputs: { color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, ghost: { classPropertyName: "ghost", publicName: "ghost", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { fileChange: "fileChange" }, providers: [
|
|
83
|
+
{
|
|
84
|
+
provide: NG_VALUE_ACCESSOR,
|
|
85
|
+
useExisting: forwardRef(() => FileInputFCC),
|
|
86
|
+
multi: true,
|
|
87
|
+
},
|
|
88
|
+
], viewQueries: [{ propertyName: "templateRef", first: true, predicate: ["templateRef"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<ng-template #templateRef let-attr=\"attributes\">\n <input\n type=\"file\"\n [class]=\"attr()?.class | mergeClass: ('file-input' | cssPrefix) : wrapperClass$()\"\n [attributes]=\"attr()\"\n [excludes]=\"['class']\"\n [multiple]=\"multiple()\"\n #el\n (change)=\"fileChanged(el)\"\n (click)=\"clicked(el)\"\n [disabled]=\"disabled$()\"\n />\n</ng-template>\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: AttributesDirective, selector: "[attributes]", inputs: ["attributes", "excludes"] }, { kind: "pipe", type: CssPrefixPipe, name: "cssPrefix" }, { kind: "pipe", type: MergeClassPipe, name: "mergeClass" }] });
|
|
89
|
+
}
|
|
90
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: FileInputFCC, decorators: [{
|
|
91
|
+
type: Component,
|
|
92
|
+
args: [{ selector: 'app-file-input', imports: [
|
|
93
|
+
FormsModule,
|
|
94
|
+
AttributesDirective,
|
|
95
|
+
NgTemplateOutlet,
|
|
96
|
+
NgClass,
|
|
97
|
+
CssPrefixPipe,
|
|
98
|
+
MergeClassPipe,
|
|
99
|
+
], providers: [
|
|
100
|
+
{
|
|
101
|
+
provide: NG_VALUE_ACCESSOR,
|
|
102
|
+
useExisting: forwardRef(() => FileInputFCC),
|
|
103
|
+
multi: true,
|
|
104
|
+
},
|
|
105
|
+
], template: "<ng-template #templateRef let-attr=\"attributes\">\n <input\n type=\"file\"\n [class]=\"attr()?.class | mergeClass: ('file-input' | cssPrefix) : wrapperClass$()\"\n [attributes]=\"attr()\"\n [excludes]=\"['class']\"\n [multiple]=\"multiple()\"\n #el\n (change)=\"fileChanged(el)\"\n (click)=\"clicked(el)\"\n [disabled]=\"disabled$()\"\n />\n</ng-template>\n" }]
|
|
106
|
+
}], propDecorators: { templateRef: [{ type: i0.ViewChild, args: ['templateRef', { isSignal: true }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], ghost: [{ type: i0.Input, args: [{ isSignal: true, alias: "ghost", required: false }] }], fileChange: [{ type: i0.Output, args: ["fileChange"] }] } });
|
|
107
|
+
|
|
108
|
+
function toDateStr(date) {
|
|
109
|
+
const month = `${date.getMonth() + 1}`.padStart(2, '0');
|
|
110
|
+
const day = `${date.getDate()}`.padStart(2, '0');
|
|
111
|
+
return `${date.getFullYear()}-${month}-${day}`;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
class InputFCC extends BaseControl {
|
|
115
|
+
static __version = 2;
|
|
116
|
+
type = input('text', ...(ngDevMode ? [{ debugName: "type" }] : []));
|
|
117
|
+
ghost = input(...(ngDevMode ? [undefined, { debugName: "ghost" }] : []));
|
|
118
|
+
templateRef = viewChild.required('templateRef');
|
|
119
|
+
color = input(...(ngDevMode ? [undefined, { debugName: "color" }] : []));
|
|
120
|
+
size = input(...(ngDevMode ? [undefined, { debugName: "size" }] : []));
|
|
121
|
+
#theme = inject(ThemeService);
|
|
122
|
+
wrapperClass$$ = computed(() => {
|
|
123
|
+
return this.#theme.setClass(this.#theme.setColor('input', this.color()), this.#theme.setSize('input', this.size()), this.ghost() ? this.#theme.addPrefix(`input-ghost`) : undefined);
|
|
124
|
+
}, ...(ngDevMode ? [{ debugName: "wrapperClass$$" }] : []));
|
|
125
|
+
valueChange2(value, el) {
|
|
126
|
+
switch (this.type()) {
|
|
127
|
+
case 'number': {
|
|
128
|
+
this.valueChange(el.valueAsNumber);
|
|
129
|
+
break;
|
|
130
|
+
}
|
|
131
|
+
case 'date': {
|
|
132
|
+
this.valueChange(el.valueAsDate);
|
|
133
|
+
break;
|
|
134
|
+
}
|
|
135
|
+
default: {
|
|
136
|
+
this.valueChange(value);
|
|
137
|
+
break;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
inputFormat(value, type) {
|
|
142
|
+
if (type === 'date' && value instanceof Date) {
|
|
143
|
+
return toDateStr(value);
|
|
144
|
+
}
|
|
145
|
+
return value;
|
|
146
|
+
}
|
|
147
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: InputFCC, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
148
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.3.14", type: InputFCC, isStandalone: true, selector: "app-input", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, ghost: { classPropertyName: "ghost", publicName: "ghost", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
|
|
149
|
+
{
|
|
150
|
+
provide: NG_VALUE_ACCESSOR,
|
|
151
|
+
useExisting: forwardRef(() => InputFCC),
|
|
152
|
+
multi: true,
|
|
153
|
+
},
|
|
154
|
+
], viewQueries: [{ propertyName: "templateRef", first: true, predicate: ["templateRef"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<ng-template #templateRef let-attr=\"attributes\">\n <input\n [class]=\"attr()?.class | mergeClass: ('input' | cssPrefix) : wrapperClass$$()\"\n [attributes]=\"attr()\"\n [excludes]=\"['class']\"\n [type]=\"type()\"\n [ngModel]=\"inputFormat | pure: value$() : type()\"\n #el\n (ngModelChange)=\"valueChange2($event, el)\"\n [disabled]=\"disabled$()\"\n (blur)=\"touchedChange()\"\n />\n</ng-template>\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: AttributesDirective, selector: "[attributes]", inputs: ["attributes", "excludes"] }, { kind: "pipe", type: CssPrefixPipe, name: "cssPrefix" }, { kind: "pipe", type: MergeClassPipe, name: "mergeClass" }, { kind: "pipe", type: PurePipe, name: "pure" }] });
|
|
155
|
+
}
|
|
156
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: InputFCC, decorators: [{
|
|
157
|
+
type: Component,
|
|
158
|
+
args: [{ selector: 'app-input', imports: [FormsModule, AttributesDirective, CssPrefixPipe, MergeClassPipe, PurePipe], providers: [
|
|
159
|
+
{
|
|
160
|
+
provide: NG_VALUE_ACCESSOR,
|
|
161
|
+
useExisting: forwardRef(() => InputFCC),
|
|
162
|
+
multi: true,
|
|
163
|
+
},
|
|
164
|
+
], template: "<ng-template #templateRef let-attr=\"attributes\">\n <input\n [class]=\"attr()?.class | mergeClass: ('input' | cssPrefix) : wrapperClass$$()\"\n [attributes]=\"attr()\"\n [excludes]=\"['class']\"\n [type]=\"type()\"\n [ngModel]=\"inputFormat | pure: value$() : type()\"\n #el\n (ngModelChange)=\"valueChange2($event, el)\"\n [disabled]=\"disabled$()\"\n (blur)=\"touchedChange()\"\n />\n</ng-template>\n" }]
|
|
165
|
+
}], propDecorators: { type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], ghost: [{ type: i0.Input, args: [{ isSignal: true, alias: "ghost", required: false }] }], templateRef: [{ type: i0.ViewChild, args: ['templateRef', { isSignal: true }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }] } });
|
|
166
|
+
|
|
167
|
+
class RadioFCC extends BaseControl {
|
|
168
|
+
static __version = 2;
|
|
169
|
+
static index = 0;
|
|
170
|
+
templateRef = viewChild.required('templateRef');
|
|
171
|
+
color = input(...(ngDevMode ? [undefined, { debugName: "color" }] : []));
|
|
172
|
+
size = input(...(ngDevMode ? [undefined, { debugName: "size" }] : []));
|
|
173
|
+
name = `radio-${RadioFCC.index++}`;
|
|
174
|
+
options = input([], ...(ngDevMode ? [{ debugName: "options", transform: (input) => input ?? [] }] : [{
|
|
175
|
+
transform: (input) => input ?? [],
|
|
176
|
+
}]));
|
|
177
|
+
optionTemplate = input(...(ngDevMode ? [undefined, { debugName: "optionTemplate" }] : []));
|
|
178
|
+
optionConvert = input(DefaultOptionConvert, ...(ngDevMode ? [{ debugName: "optionConvert", transform: (input) => ({ ...DefaultOptionConvert, ...input }) }] : [{
|
|
179
|
+
transform: (input) => ({ ...DefaultOptionConvert, ...input }),
|
|
180
|
+
}]));
|
|
181
|
+
resolvedOptions$$ = computed(() => this.transformOptions(this.options()), ...(ngDevMode ? [{ debugName: "resolvedOptions$$" }] : []));
|
|
182
|
+
transformOptions(options) {
|
|
183
|
+
return options.map((option) => {
|
|
184
|
+
const resolvedItem = {
|
|
185
|
+
label: this.optionConvert().label(option),
|
|
186
|
+
value: this.optionConvert().value(option),
|
|
187
|
+
disabled: this.optionConvert().disabled?.(option) ?? false,
|
|
188
|
+
description: this.optionConvert().description?.(option),
|
|
189
|
+
type: 'option',
|
|
190
|
+
origin: option,
|
|
191
|
+
};
|
|
192
|
+
return resolvedItem;
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
#theme = inject(ThemeService);
|
|
196
|
+
wrapperClass$ = computed(() => {
|
|
197
|
+
return this.#theme.setClass(this.#theme.setColor('radio', this.color()), this.#theme.setSize('radio', this.size()));
|
|
198
|
+
}, ...(ngDevMode ? [{ debugName: "wrapperClass$" }] : []));
|
|
199
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: RadioFCC, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
200
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.14", type: RadioFCC, isStandalone: true, selector: "app-radio", inputs: { color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, optionTemplate: { classPropertyName: "optionTemplate", publicName: "optionTemplate", isSignal: true, isRequired: false, transformFunction: null }, optionConvert: { classPropertyName: "optionConvert", publicName: "optionConvert", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
|
|
201
|
+
{
|
|
202
|
+
provide: NG_VALUE_ACCESSOR,
|
|
203
|
+
useExisting: forwardRef(() => RadioFCC),
|
|
204
|
+
multi: true,
|
|
205
|
+
},
|
|
206
|
+
], viewQueries: [{ propertyName: "templateRef", first: true, predicate: ["templateRef"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<ng-template #templateRef let-attr=\"attributes\">\n @for (item of resolvedOptions$$(); track $index) {\n <span>\n @let id = name + '-' + $index;\n <input\n type=\"radio\"\n [name]=\"name\"\n [disabled]=\"item.disabled || disabled$()\"\n [checked]=\"item.value === value$()\"\n (change)=\"valueAndTouchedChange(item.value)\"\n [attributes]=\"attr()\"\n [excludes]=\"['class']\"\n [class]=\"attr()?.class | mergeClass: ('radio' | cssPrefix) : wrapperClass$()\"\n [id]=\"id\"\n />\n @if (optionTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"optionTemplate(); context: { $implicit: item, id: id }\"\n ></ng-container>\n } @else if (item.label) {\n <label\n [for]=\"id\"\n [class]=\"!!item.description ? ('tooltip' | cssPrefix) : undefined\"\n [attr.data-tip]=\"item.description!\"\n >{{ item.label }}\n </label>\n }\n </span>\n }\n</ng-template>\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: AttributesDirective, selector: "[attributes]", inputs: ["attributes", "excludes"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: CssPrefixPipe, name: "cssPrefix" }, { kind: "pipe", type: MergeClassPipe, name: "mergeClass" }] });
|
|
207
|
+
}
|
|
208
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: RadioFCC, decorators: [{
|
|
209
|
+
type: Component,
|
|
210
|
+
args: [{ selector: 'app-radio', imports: [
|
|
211
|
+
FormsModule,
|
|
212
|
+
AttributesDirective,
|
|
213
|
+
NgTemplateOutlet,
|
|
214
|
+
NgClass,
|
|
215
|
+
CssPrefixPipe,
|
|
216
|
+
MergeClassPipe,
|
|
217
|
+
], providers: [
|
|
218
|
+
{
|
|
219
|
+
provide: NG_VALUE_ACCESSOR,
|
|
220
|
+
useExisting: forwardRef(() => RadioFCC),
|
|
221
|
+
multi: true,
|
|
222
|
+
},
|
|
223
|
+
], template: "<ng-template #templateRef let-attr=\"attributes\">\n @for (item of resolvedOptions$$(); track $index) {\n <span>\n @let id = name + '-' + $index;\n <input\n type=\"radio\"\n [name]=\"name\"\n [disabled]=\"item.disabled || disabled$()\"\n [checked]=\"item.value === value$()\"\n (change)=\"valueAndTouchedChange(item.value)\"\n [attributes]=\"attr()\"\n [excludes]=\"['class']\"\n [class]=\"attr()?.class | mergeClass: ('radio' | cssPrefix) : wrapperClass$()\"\n [id]=\"id\"\n />\n @if (optionTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"optionTemplate(); context: { $implicit: item, id: id }\"\n ></ng-container>\n } @else if (item.label) {\n <label\n [for]=\"id\"\n [class]=\"!!item.description ? ('tooltip' | cssPrefix) : undefined\"\n [attr.data-tip]=\"item.description!\"\n >{{ item.label }}\n </label>\n }\n </span>\n }\n</ng-template>\n" }]
|
|
224
|
+
}], propDecorators: { templateRef: [{ type: i0.ViewChild, args: ['templateRef', { isSignal: true }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], optionTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionTemplate", required: false }] }], optionConvert: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionConvert", required: false }] }] } });
|
|
225
|
+
|
|
226
|
+
class RangeFCC extends BaseControl {
|
|
227
|
+
static __version = 2;
|
|
228
|
+
templateRef = viewChild.required('templateRef');
|
|
229
|
+
color = input(...(ngDevMode ? [undefined, { debugName: "color" }] : []));
|
|
230
|
+
size = input(...(ngDevMode ? [undefined, { debugName: "size" }] : []));
|
|
231
|
+
min = input(...(ngDevMode ? [undefined, { debugName: "min" }] : []));
|
|
232
|
+
max = input(...(ngDevMode ? [undefined, { debugName: "max" }] : []));
|
|
233
|
+
step = input(...(ngDevMode ? [undefined, { debugName: "step" }] : []));
|
|
234
|
+
#theme = inject(ThemeService);
|
|
235
|
+
wrapperClass$ = computed(() => {
|
|
236
|
+
return this.#theme.setClass(this.#theme.setColor('range', this.color()), this.#theme.setSize('range', this.size()));
|
|
237
|
+
}, ...(ngDevMode ? [{ debugName: "wrapperClass$" }] : []));
|
|
238
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: RangeFCC, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
239
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.3.14", type: RangeFCC, isStandalone: true, selector: "app-range", inputs: { color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, step: { classPropertyName: "step", publicName: "step", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
|
|
240
|
+
{
|
|
241
|
+
provide: NG_VALUE_ACCESSOR,
|
|
242
|
+
useExisting: forwardRef(() => RangeFCC),
|
|
243
|
+
multi: true,
|
|
244
|
+
},
|
|
245
|
+
], viewQueries: [{ propertyName: "templateRef", first: true, predicate: ["templateRef"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<ng-template #templateRef let-attr=\"attributes\">\n <input\n type=\"range\"\n [min]=\"min()\"\n [max]=\"max()\"\n [attributes]=\"attr()\"\n [excludes]=\"['class']\"\n [class]=\"attr()?.class | mergeClass: ('range' | cssPrefix) : wrapperClass$()\"\n [step]=\"step()\"\n [ngModel]=\"value$()\"\n (ngModelChange)=\"valueAndTouchedChange($event)\"\n />\n</ng-template>\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.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: i1.RangeValueAccessor, selector: "input[type=range][formControlName],input[type=range][formControl],input[type=range][ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: AttributesDirective, selector: "[attributes]", inputs: ["attributes", "excludes"] }, { kind: "pipe", type: CssPrefixPipe, name: "cssPrefix" }, { kind: "pipe", type: MergeClassPipe, name: "mergeClass" }] });
|
|
246
|
+
}
|
|
247
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: RangeFCC, decorators: [{
|
|
248
|
+
type: Component,
|
|
249
|
+
args: [{ selector: 'app-range', imports: [
|
|
250
|
+
FormsModule,
|
|
251
|
+
AttributesDirective,
|
|
252
|
+
NgTemplateOutlet,
|
|
253
|
+
NgClass,
|
|
254
|
+
CssPrefixPipe,
|
|
255
|
+
MergeClassPipe,
|
|
256
|
+
], providers: [
|
|
257
|
+
{
|
|
258
|
+
provide: NG_VALUE_ACCESSOR,
|
|
259
|
+
useExisting: forwardRef(() => RangeFCC),
|
|
260
|
+
multi: true,
|
|
261
|
+
},
|
|
262
|
+
], template: "<ng-template #templateRef let-attr=\"attributes\">\n <input\n type=\"range\"\n [min]=\"min()\"\n [max]=\"max()\"\n [attributes]=\"attr()\"\n [excludes]=\"['class']\"\n [class]=\"attr()?.class | mergeClass: ('range' | cssPrefix) : wrapperClass$()\"\n [step]=\"step()\"\n [ngModel]=\"value$()\"\n (ngModelChange)=\"valueAndTouchedChange($event)\"\n />\n</ng-template>\n" }]
|
|
263
|
+
}], propDecorators: { templateRef: [{ type: i0.ViewChild, args: ['templateRef', { isSignal: true }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], step: [{ type: i0.Input, args: [{ isSignal: true, alias: "step", required: false }] }] } });
|
|
264
|
+
|
|
265
|
+
class RatingFCC extends BaseControl {
|
|
266
|
+
static index = 0;
|
|
267
|
+
name = `rating-${RatingFCC.index++}`;
|
|
268
|
+
static __version = 2;
|
|
269
|
+
templateRef = viewChild.required('templateRef');
|
|
270
|
+
size = input(...(ngDevMode ? [undefined, { debugName: "size" }] : []));
|
|
271
|
+
min = input(1, ...(ngDevMode ? [{ debugName: "min" }] : []));
|
|
272
|
+
max = input(5, ...(ngDevMode ? [{ debugName: "max" }] : []));
|
|
273
|
+
half = input(...(ngDevMode ? [undefined, { debugName: "half" }] : []));
|
|
274
|
+
type = input('star', ...(ngDevMode ? [{ debugName: "type" }] : []));
|
|
275
|
+
list = computed(() => {
|
|
276
|
+
return range(this.min(), this.max());
|
|
277
|
+
}, ...(ngDevMode ? [{ debugName: "list" }] : []));
|
|
278
|
+
itemClass$$ = computed(() => {
|
|
279
|
+
return this.#theme.addPrefix2('mask', this.type());
|
|
280
|
+
}, ...(ngDevMode ? [{ debugName: "itemClass$$" }] : []));
|
|
281
|
+
#theme = inject(ThemeService);
|
|
282
|
+
wrapperClass$ = computed(() => {
|
|
283
|
+
return this.#theme.setClass(this.#theme.setSize('rating', this.size()));
|
|
284
|
+
}, ...(ngDevMode ? [{ debugName: "wrapperClass$" }] : []));
|
|
285
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: RatingFCC, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
286
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.14", type: RatingFCC, isStandalone: true, selector: "app-rating", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, half: { classPropertyName: "half", publicName: "half", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
|
|
287
|
+
{
|
|
288
|
+
provide: NG_VALUE_ACCESSOR,
|
|
289
|
+
useExisting: forwardRef(() => RatingFCC),
|
|
290
|
+
multi: true,
|
|
291
|
+
},
|
|
292
|
+
], viewQueries: [{ propertyName: "templateRef", first: true, predicate: ["templateRef"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<ng-template #templateRef let-attr=\"attributes\">\n <div\n [attributes]=\"attr()\"\n [excludes]=\"['class']\"\n [class]=\"\n attr()?.class\n | mergeClass\n : ('rating' | cssPrefix)\n : wrapperClass$()\n : (half() ? ('rating-half' | cssPrefix) : undefined)\n \"\n >\n <input\n type=\"radio\"\n [name]=\"name\"\n aria-label=\"{{ min() }} rating\"\n [checked]=\"value$() === min()\"\n (change)=\"valueAndTouchedChange(min())\"\n [class]=\"itemClass$$() | mergeClass: ('rating-hidden' | cssPrefix)\"\n />\n @for (item of list(); track $index) {\n @if (half()) {\n <input\n type=\"radio\"\n [name]=\"name\"\n aria-label=\"{{ item + 0.5 }} rating\"\n [checked]=\"value$() === item + 0.5\"\n (change)=\"valueAndTouchedChange(item + 0.5)\"\n [class]=\"itemClass$$() | mergeClass: ('mask mask-half-1' | cssPrefix)\"\n />\n <input\n type=\"radio\"\n [name]=\"name\"\n aria-label=\"{{ item + 1 }} rating\"\n [checked]=\"value$() === item + 1\"\n (change)=\"valueAndTouchedChange(item + 1)\"\n [class]=\"itemClass$$() | mergeClass: ('mask mask-half-2' | cssPrefix)\"\n />\n } @else {\n <input\n type=\"radio\"\n [name]=\"name\"\n aria-label=\"{{ item + 1 }} rating\"\n [checked]=\"value$() === item + 1\"\n (change)=\"valueAndTouchedChange(item + 1)\"\n [class]=\"itemClass$$() | mergeClass: ('mask' | cssPrefix)\"\n />\n }\n }\n </div>\n</ng-template>\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: AttributesDirective, selector: "[attributes]", inputs: ["attributes", "excludes"] }, { kind: "pipe", type: CssPrefixPipe, name: "cssPrefix" }, { kind: "pipe", type: MergeClassPipe, name: "mergeClass" }] });
|
|
293
|
+
}
|
|
294
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: RatingFCC, decorators: [{
|
|
295
|
+
type: Component,
|
|
296
|
+
args: [{ selector: 'app-rating', imports: [
|
|
297
|
+
FormsModule,
|
|
298
|
+
AttributesDirective,
|
|
299
|
+
NgTemplateOutlet,
|
|
300
|
+
NgClass,
|
|
301
|
+
CssPrefixPipe,
|
|
302
|
+
MergeClassPipe,
|
|
303
|
+
], providers: [
|
|
304
|
+
{
|
|
305
|
+
provide: NG_VALUE_ACCESSOR,
|
|
306
|
+
useExisting: forwardRef(() => RatingFCC),
|
|
307
|
+
multi: true,
|
|
308
|
+
},
|
|
309
|
+
], template: "<ng-template #templateRef let-attr=\"attributes\">\n <div\n [attributes]=\"attr()\"\n [excludes]=\"['class']\"\n [class]=\"\n attr()?.class\n | mergeClass\n : ('rating' | cssPrefix)\n : wrapperClass$()\n : (half() ? ('rating-half' | cssPrefix) : undefined)\n \"\n >\n <input\n type=\"radio\"\n [name]=\"name\"\n aria-label=\"{{ min() }} rating\"\n [checked]=\"value$() === min()\"\n (change)=\"valueAndTouchedChange(min())\"\n [class]=\"itemClass$$() | mergeClass: ('rating-hidden' | cssPrefix)\"\n />\n @for (item of list(); track $index) {\n @if (half()) {\n <input\n type=\"radio\"\n [name]=\"name\"\n aria-label=\"{{ item + 0.5 }} rating\"\n [checked]=\"value$() === item + 0.5\"\n (change)=\"valueAndTouchedChange(item + 0.5)\"\n [class]=\"itemClass$$() | mergeClass: ('mask mask-half-1' | cssPrefix)\"\n />\n <input\n type=\"radio\"\n [name]=\"name\"\n aria-label=\"{{ item + 1 }} rating\"\n [checked]=\"value$() === item + 1\"\n (change)=\"valueAndTouchedChange(item + 1)\"\n [class]=\"itemClass$$() | mergeClass: ('mask mask-half-2' | cssPrefix)\"\n />\n } @else {\n <input\n type=\"radio\"\n [name]=\"name\"\n aria-label=\"{{ item + 1 }} rating\"\n [checked]=\"value$() === item + 1\"\n (change)=\"valueAndTouchedChange(item + 1)\"\n [class]=\"itemClass$$() | mergeClass: ('mask' | cssPrefix)\"\n />\n }\n }\n </div>\n</ng-template>\n" }]
|
|
310
|
+
}], propDecorators: { templateRef: [{ type: i0.ViewChild, args: ['templateRef', { isSignal: true }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], half: [{ type: i0.Input, args: [{ isSignal: true, alias: "half", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }] } });
|
|
311
|
+
|
|
312
|
+
class SelectFCC extends BaseControl {
|
|
313
|
+
static __version = 2;
|
|
314
|
+
templateRef = viewChild.required('templateRef');
|
|
315
|
+
color = input(...(ngDevMode ? [undefined, { debugName: "color" }] : []));
|
|
316
|
+
size = input(...(ngDevMode ? [undefined, { debugName: "size" }] : []));
|
|
317
|
+
multiple = input(false, ...(ngDevMode ? [{ debugName: "multiple" }] : []));
|
|
318
|
+
ghost = input(...(ngDevMode ? [undefined, { debugName: "ghost" }] : []));
|
|
319
|
+
native = input(...(ngDevMode ? [undefined, { debugName: "native" }] : []));
|
|
320
|
+
/** ---输入--- */
|
|
321
|
+
/** @title 列表
|
|
322
|
+
@default [] */
|
|
323
|
+
options = input([], ...(ngDevMode ? [{ debugName: "options", transform: (input) => input ?? [] }] : [{
|
|
324
|
+
transform: (input) => input ?? [],
|
|
325
|
+
}]));
|
|
326
|
+
optionConvert = input(DefaultOptionConvert, ...(ngDevMode ? [{ debugName: "optionConvert", transform: (input) => ({ ...DefaultOptionConvert, ...input }) }] : [{
|
|
327
|
+
transform: (input) => ({ ...DefaultOptionConvert, ...input }),
|
|
328
|
+
}]));
|
|
329
|
+
emptyOptionContent = input('------', ...(ngDevMode ? [{ debugName: "emptyOptionContent" }] : []));
|
|
330
|
+
resolvedOptions$$ = computed(() => this.transformOptions(this.options()), ...(ngDevMode ? [{ debugName: "resolvedOptions$$" }] : []));
|
|
331
|
+
transformOptions(options) {
|
|
332
|
+
return options.map((option) => {
|
|
333
|
+
const resolvedItem = {
|
|
334
|
+
label: this.optionConvert().label(option),
|
|
335
|
+
value: this.optionConvert().value(option),
|
|
336
|
+
disabled: this.optionConvert().disabled?.(option) ?? false,
|
|
337
|
+
type: 'option',
|
|
338
|
+
origin: option,
|
|
339
|
+
};
|
|
340
|
+
return resolvedItem;
|
|
341
|
+
});
|
|
342
|
+
}
|
|
343
|
+
#theme = inject(ThemeService);
|
|
344
|
+
wrapperClass$$ = computed(() => {
|
|
345
|
+
return this.#theme.setClass(this.#theme.setColor('select', this.color()), this.#theme.setSize('select', this.size()), this.ghost() ? this.#theme.addPrefix('select-ghost ') : undefined, this.native() ? this.#theme.addTwPrefix('appearance-none') : undefined);
|
|
346
|
+
}, ...(ngDevMode ? [{ debugName: "wrapperClass$$" }] : []));
|
|
347
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: SelectFCC, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
348
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.14", type: SelectFCC, isStandalone: true, selector: "app-select", inputs: { color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, ghost: { classPropertyName: "ghost", publicName: "ghost", isSignal: true, isRequired: false, transformFunction: null }, native: { classPropertyName: "native", publicName: "native", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, optionConvert: { classPropertyName: "optionConvert", publicName: "optionConvert", isSignal: true, isRequired: false, transformFunction: null }, emptyOptionContent: { classPropertyName: "emptyOptionContent", publicName: "emptyOptionContent", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
|
|
349
|
+
{
|
|
350
|
+
provide: NG_VALUE_ACCESSOR,
|
|
351
|
+
useExisting: forwardRef(() => SelectFCC),
|
|
352
|
+
multi: true,
|
|
353
|
+
},
|
|
354
|
+
], viewQueries: [{ propertyName: "templateRef", first: true, predicate: ["templateRef"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<ng-template #templateRef let-attr=\"attributes\">\n @let multi = multiple();\n @if (multi) {\n <select\n [attributes]=\"attr()\"\n [excludes]=\"['class']\"\n [class]=\"attr()?.class | mergeClass: ('select' | cssPrefix) : wrapperClass$$()\"\n [ngModel]=\"value$()\"\n (ngModelChange)=\"valueAndTouchedChange($event)\"\n [disabled]=\"disabled$()\"\n multiple\n >\n <ng-template #optionTemp let-config=\"config\">\n @if (config.type === 'group') {\n <optgroup [label]=\"config.label\">\n @for (item of config.children; track $index) {\n <ng-container\n *ngTemplateOutlet=\"optionTemp; context: { config: item }\"\n ></ng-container>\n }\n </optgroup>\n } @else {\n <option\n [disabled]=\"config.disabled\"\n [ngValue]=\"config.value\"\n [attr.data-tip]=\"config.description!\"\n [class]=\"!!config.description ? ('tooltip' | cssPrefix) : undefined\"\n >\n {{ config.label }}\n </option>\n }\n </ng-template>\n <option disabled selected>{{ emptyOptionContent() }}</option>\n\n @for (item of resolvedOptions$$(); track $index) {\n <ng-container *ngTemplateOutlet=\"optionTemp; context: { config: item }\"></ng-container>\n }\n </select>\n } @else {\n <select\n [attributes]=\"attr()\"\n [excludes]=\"['class']\"\n [class]=\"attr()?.class | mergeClass: ('select' | cssPrefix) : wrapperClass$$()\"\n [ngModel]=\"value$()\"\n (ngModelChange)=\"valueAndTouchedChange($event)\"\n [disabled]=\"disabled$()\"\n >\n <ng-template #optionTemp let-config=\"config\">\n @if (config.type === 'group') {\n <optgroup [label]=\"config.label\">\n @for (item of config.children; track $index) {\n <ng-container\n *ngTemplateOutlet=\"optionTemp; context: { config: item }\"\n ></ng-container>\n }\n </optgroup>\n } @else {\n <option\n [disabled]=\"config.disabled\"\n [ngValue]=\"config.value\"\n [attr.data-tip]=\"config.description!\"\n [class]=\"!!config.description ? ('tooltip' | cssPrefix) : undefined\"\n >\n {{ config.label }}\n </option>\n }\n </ng-template>\n <option disabled selected>{{ emptyOptionContent() }}</option>\n\n @for (item of resolvedOptions$$(); track $index) {\n <ng-container *ngTemplateOutlet=\"optionTemp; context: { config: item }\"></ng-container>\n }\n </select>\n }\n</ng-template>\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1.SelectMultipleControlValueAccessor, selector: "select[multiple][formControlName],select[multiple][formControl],select[multiple][ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: AttributesDirective, selector: "[attributes]", inputs: ["attributes", "excludes"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: CssPrefixPipe, name: "cssPrefix" }, { kind: "pipe", type: MergeClassPipe, name: "mergeClass" }] });
|
|
355
|
+
}
|
|
356
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: SelectFCC, decorators: [{
|
|
357
|
+
type: Component,
|
|
358
|
+
args: [{ selector: 'app-select', imports: [
|
|
359
|
+
FormsModule,
|
|
360
|
+
AttributesDirective,
|
|
361
|
+
NgTemplateOutlet,
|
|
362
|
+
NgClass,
|
|
363
|
+
CssPrefixPipe,
|
|
364
|
+
MergeClassPipe,
|
|
365
|
+
], providers: [
|
|
366
|
+
{
|
|
367
|
+
provide: NG_VALUE_ACCESSOR,
|
|
368
|
+
useExisting: forwardRef(() => SelectFCC),
|
|
369
|
+
multi: true,
|
|
370
|
+
},
|
|
371
|
+
], template: "<ng-template #templateRef let-attr=\"attributes\">\n @let multi = multiple();\n @if (multi) {\n <select\n [attributes]=\"attr()\"\n [excludes]=\"['class']\"\n [class]=\"attr()?.class | mergeClass: ('select' | cssPrefix) : wrapperClass$$()\"\n [ngModel]=\"value$()\"\n (ngModelChange)=\"valueAndTouchedChange($event)\"\n [disabled]=\"disabled$()\"\n multiple\n >\n <ng-template #optionTemp let-config=\"config\">\n @if (config.type === 'group') {\n <optgroup [label]=\"config.label\">\n @for (item of config.children; track $index) {\n <ng-container\n *ngTemplateOutlet=\"optionTemp; context: { config: item }\"\n ></ng-container>\n }\n </optgroup>\n } @else {\n <option\n [disabled]=\"config.disabled\"\n [ngValue]=\"config.value\"\n [attr.data-tip]=\"config.description!\"\n [class]=\"!!config.description ? ('tooltip' | cssPrefix) : undefined\"\n >\n {{ config.label }}\n </option>\n }\n </ng-template>\n <option disabled selected>{{ emptyOptionContent() }}</option>\n\n @for (item of resolvedOptions$$(); track $index) {\n <ng-container *ngTemplateOutlet=\"optionTemp; context: { config: item }\"></ng-container>\n }\n </select>\n } @else {\n <select\n [attributes]=\"attr()\"\n [excludes]=\"['class']\"\n [class]=\"attr()?.class | mergeClass: ('select' | cssPrefix) : wrapperClass$$()\"\n [ngModel]=\"value$()\"\n (ngModelChange)=\"valueAndTouchedChange($event)\"\n [disabled]=\"disabled$()\"\n >\n <ng-template #optionTemp let-config=\"config\">\n @if (config.type === 'group') {\n <optgroup [label]=\"config.label\">\n @for (item of config.children; track $index) {\n <ng-container\n *ngTemplateOutlet=\"optionTemp; context: { config: item }\"\n ></ng-container>\n }\n </optgroup>\n } @else {\n <option\n [disabled]=\"config.disabled\"\n [ngValue]=\"config.value\"\n [attr.data-tip]=\"config.description!\"\n [class]=\"!!config.description ? ('tooltip' | cssPrefix) : undefined\"\n >\n {{ config.label }}\n </option>\n }\n </ng-template>\n <option disabled selected>{{ emptyOptionContent() }}</option>\n\n @for (item of resolvedOptions$$(); track $index) {\n <ng-container *ngTemplateOutlet=\"optionTemp; context: { config: item }\"></ng-container>\n }\n </select>\n }\n</ng-template>\n" }]
|
|
372
|
+
}], propDecorators: { templateRef: [{ type: i0.ViewChild, args: ['templateRef', { isSignal: true }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], ghost: [{ type: i0.Input, args: [{ isSignal: true, alias: "ghost", required: false }] }], native: [{ type: i0.Input, args: [{ isSignal: true, alias: "native", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], optionConvert: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionConvert", required: false }] }], emptyOptionContent: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyOptionContent", required: false }] }] } });
|
|
373
|
+
|
|
374
|
+
class TextareaFCC extends BaseControl {
|
|
375
|
+
static __version = 2;
|
|
376
|
+
ghost = input(...(ngDevMode ? [undefined, { debugName: "ghost" }] : []));
|
|
377
|
+
templateRef = viewChild.required('templateRef');
|
|
378
|
+
color = input(...(ngDevMode ? [undefined, { debugName: "color" }] : []));
|
|
379
|
+
size = input(...(ngDevMode ? [undefined, { debugName: "size" }] : []));
|
|
380
|
+
#theme = inject(ThemeService);
|
|
381
|
+
wrapperClass$$ = computed(() => {
|
|
382
|
+
return this.#theme.setClass(this.#theme.setColor('textarea', this.color()), this.#theme.setSize('textarea', this.size()), this.ghost() ? this.#theme.addPrefix('textarea-ghost') : undefined);
|
|
383
|
+
}, ...(ngDevMode ? [{ debugName: "wrapperClass$$" }] : []));
|
|
384
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: TextareaFCC, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
385
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.3.14", type: TextareaFCC, isStandalone: true, selector: "app-textarea", inputs: { ghost: { classPropertyName: "ghost", publicName: "ghost", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
|
|
386
|
+
{
|
|
387
|
+
provide: NG_VALUE_ACCESSOR,
|
|
388
|
+
useExisting: forwardRef(() => TextareaFCC),
|
|
389
|
+
multi: true,
|
|
390
|
+
},
|
|
391
|
+
], viewQueries: [{ propertyName: "templateRef", first: true, predicate: ["templateRef"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<ng-template #templateRef let-attr=\"attributes\">\n <textarea\n [class]=\"attr()?.class | mergeClass: ('textarea' | cssPrefix) : wrapperClass$$()\"\n [attributes]=\"attr()\"\n [excludes]=\"['class']\"\n [ngModel]=\"value$()\"\n (ngModelChange)=\"valueChange($event)\"\n [disabled]=\"disabled$()\"\n (blur)=\"touchedChange()\"\n ></textarea>\n</ng-template>\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: AttributesDirective, selector: "[attributes]", inputs: ["attributes", "excludes"] }, { kind: "pipe", type: CssPrefixPipe, name: "cssPrefix" }, { kind: "pipe", type: MergeClassPipe, name: "mergeClass" }] });
|
|
392
|
+
}
|
|
393
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: TextareaFCC, decorators: [{
|
|
394
|
+
type: Component,
|
|
395
|
+
args: [{ selector: 'app-textarea', imports: [FormsModule, AttributesDirective, NgClass, CssPrefixPipe, MergeClassPipe], providers: [
|
|
396
|
+
{
|
|
397
|
+
provide: NG_VALUE_ACCESSOR,
|
|
398
|
+
useExisting: forwardRef(() => TextareaFCC),
|
|
399
|
+
multi: true,
|
|
400
|
+
},
|
|
401
|
+
], template: "<ng-template #templateRef let-attr=\"attributes\">\n <textarea\n [class]=\"attr()?.class | mergeClass: ('textarea' | cssPrefix) : wrapperClass$$()\"\n [attributes]=\"attr()\"\n [excludes]=\"['class']\"\n [ngModel]=\"value$()\"\n (ngModelChange)=\"valueChange($event)\"\n [disabled]=\"disabled$()\"\n (blur)=\"touchedChange()\"\n ></textarea>\n</ng-template>\n" }]
|
|
402
|
+
}], propDecorators: { ghost: [{ type: i0.Input, args: [{ isSignal: true, alias: "ghost", required: false }] }], templateRef: [{ type: i0.ViewChild, args: ['templateRef', { isSignal: true }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }] } });
|
|
403
|
+
|
|
404
|
+
class ToggleFCC extends BaseControl {
|
|
405
|
+
static __version = 2;
|
|
406
|
+
templateRef = viewChild.required('templateRef');
|
|
407
|
+
color = input(...(ngDevMode ? [undefined, { debugName: "color" }] : []));
|
|
408
|
+
size = input(...(ngDevMode ? [undefined, { debugName: "size" }] : []));
|
|
409
|
+
indeterminate = input(...(ngDevMode ? [undefined, { debugName: "indeterminate" }] : []));
|
|
410
|
+
#theme = inject(ThemeService);
|
|
411
|
+
wrapperClass$ = computed(() => {
|
|
412
|
+
return this.#theme.setClass(this.#theme.setColor('toggle', this.color()), this.#theme.setSize('toggle', this.size()));
|
|
413
|
+
}, ...(ngDevMode ? [{ debugName: "wrapperClass$" }] : []));
|
|
414
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: ToggleFCC, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
415
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.3.14", type: ToggleFCC, isStandalone: true, selector: "app-toggle", inputs: { color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, indeterminate: { classPropertyName: "indeterminate", publicName: "indeterminate", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
|
|
416
|
+
{
|
|
417
|
+
provide: NG_VALUE_ACCESSOR,
|
|
418
|
+
useExisting: forwardRef(() => ToggleFCC),
|
|
419
|
+
multi: true,
|
|
420
|
+
},
|
|
421
|
+
], viewQueries: [{ propertyName: "templateRef", first: true, predicate: ["templateRef"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<ng-template #templateRef let-attr=\"attributes\">\n <input\n type=\"checkbox\"\n [class]=\"attr()?.class | mergeClass: ('toggle' | cssPrefix) : wrapperClass$()\"\n [attributes]=\"attr()\"\n [excludes]=\"['class']\"\n [ngModel]=\"value$()\"\n (ngModelChange)=\"valueAndTouchedChange($event)\"\n [disabled]=\"disabled$()\"\n [indeterminate]=\"indeterminate()\"\n />\n</ng-template>\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: AttributesDirective, selector: "[attributes]", inputs: ["attributes", "excludes"] }, { kind: "pipe", type: CssPrefixPipe, name: "cssPrefix" }, { kind: "pipe", type: MergeClassPipe, name: "mergeClass" }] });
|
|
422
|
+
}
|
|
423
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: ToggleFCC, decorators: [{
|
|
424
|
+
type: Component,
|
|
425
|
+
args: [{ selector: 'app-toggle', imports: [FormsModule, AttributesDirective, NgClass, CssPrefixPipe, MergeClassPipe], providers: [
|
|
426
|
+
{
|
|
427
|
+
provide: NG_VALUE_ACCESSOR,
|
|
428
|
+
useExisting: forwardRef(() => ToggleFCC),
|
|
429
|
+
multi: true,
|
|
430
|
+
},
|
|
431
|
+
], template: "<ng-template #templateRef let-attr=\"attributes\">\n <input\n type=\"checkbox\"\n [class]=\"attr()?.class | mergeClass: ('toggle' | cssPrefix) : wrapperClass$()\"\n [attributes]=\"attr()\"\n [excludes]=\"['class']\"\n [ngModel]=\"value$()\"\n (ngModelChange)=\"valueAndTouchedChange($event)\"\n [disabled]=\"disabled$()\"\n [indeterminate]=\"indeterminate()\"\n />\n</ng-template>\n" }]
|
|
432
|
+
}], propDecorators: { templateRef: [{ type: i0.ViewChild, args: ['templateRef', { isSignal: true }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], indeterminate: [{ type: i0.Input, args: [{ isSignal: true, alias: "indeterminate", required: false }] }] } });
|
|
433
|
+
|
|
434
|
+
class SwapFCC extends BaseControl {
|
|
435
|
+
static __version = 2;
|
|
436
|
+
StrOrTemplateComponent = StrOrTemplateComponent;
|
|
437
|
+
templateRef = viewChild.required('templateRef');
|
|
438
|
+
onContent = input('✔️', ...(ngDevMode ? [{ debugName: "onContent" }] : []));
|
|
439
|
+
offContent = input('❌', ...(ngDevMode ? [{ debugName: "offContent" }] : []));
|
|
440
|
+
indeterminateContent = input(...(ngDevMode ? [undefined, { debugName: "indeterminateContent" }] : []));
|
|
441
|
+
indeterminate = input(...(ngDevMode ? [undefined, { debugName: "indeterminate" }] : []));
|
|
442
|
+
rotate = input(...(ngDevMode ? [undefined, { debugName: "rotate" }] : []));
|
|
443
|
+
flip = input(...(ngDevMode ? [undefined, { debugName: "flip" }] : []));
|
|
444
|
+
#theme = inject(ThemeService);
|
|
445
|
+
wrapperClass$ = computed(() => {
|
|
446
|
+
return clsx(this.rotate() ? this.#theme.addPrefix('swap-rotate') : undefined, this.flip() ? this.#theme.addPrefix('swap-flip') : undefined);
|
|
447
|
+
}, ...(ngDevMode ? [{ debugName: "wrapperClass$" }] : []));
|
|
448
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: SwapFCC, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
449
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.3.14", type: SwapFCC, isStandalone: true, selector: "app-swap", inputs: { onContent: { classPropertyName: "onContent", publicName: "onContent", isSignal: true, isRequired: false, transformFunction: null }, offContent: { classPropertyName: "offContent", publicName: "offContent", isSignal: true, isRequired: false, transformFunction: null }, indeterminateContent: { classPropertyName: "indeterminateContent", publicName: "indeterminateContent", isSignal: true, isRequired: false, transformFunction: null }, indeterminate: { classPropertyName: "indeterminate", publicName: "indeterminate", isSignal: true, isRequired: false, transformFunction: null }, rotate: { classPropertyName: "rotate", publicName: "rotate", isSignal: true, isRequired: false, transformFunction: null }, flip: { classPropertyName: "flip", publicName: "flip", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
|
|
450
|
+
{
|
|
451
|
+
provide: NG_VALUE_ACCESSOR,
|
|
452
|
+
useExisting: forwardRef(() => SwapFCC),
|
|
453
|
+
multi: true,
|
|
454
|
+
},
|
|
455
|
+
], viewQueries: [{ propertyName: "templateRef", first: true, predicate: ["templateRef"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<ng-template #templateRef let-attr=\"attributes\">\n <label\n [attributes]=\"attr()\"\n [excludes]=\"['class']\"\n [class]=\"attr()?.class | mergeClass: ('swap' | cssPrefix) : wrapperClass$()\"\n >\n <input\n type=\"checkbox\"\n [ngModel]=\"value$()\"\n (ngModelChange)=\"valueAndTouchedChange($event)\"\n [disabled]=\"disabled$()\"\n [indeterminate]=\"indeterminate()\"\n />\n <div [class]=\"'swap-on' | cssPrefix\">\n <ng-template\n [selectlessOutlet]=\"StrOrTemplateComponent\"\n [selectlessOutletInputs]=\"{ content: onContent }\"\n ></ng-template>\n </div>\n <div [class]=\"'swap-off' | cssPrefix\">\n <ng-template\n [selectlessOutlet]=\"StrOrTemplateComponent\"\n [selectlessOutletInputs]=\"{ content: offContent }\"\n ></ng-template>\n </div>\n <div [class]=\"'swap-indeterminate' | cssPrefix\">\n <ng-template\n [selectlessOutlet]=\"StrOrTemplateComponent\"\n [selectlessOutletInputs]=\"{ content: indeterminateContent }\"\n ></ng-template>\n </div>\n </label>\n</ng-template>\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: AttributesDirective, selector: "[attributes]", inputs: ["attributes", "excludes"] }, { kind: "directive", type: SelectorlessOutlet, selector: "[selectlessOutlet]", inputs: ["selectlessOutlet", "selectlessOutletInputs", "selectlessOutletOutputs", "selectlessOutletDirectives", "selectlessOutletInjector", "selectlessOutletEnvironmentInjector"], exportAs: ["selectlessOutlet"] }, { kind: "pipe", type: CssPrefixPipe, name: "cssPrefix" }, { kind: "pipe", type: MergeClassPipe, name: "mergeClass" }] });
|
|
456
|
+
}
|
|
457
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: SwapFCC, decorators: [{
|
|
458
|
+
type: Component,
|
|
459
|
+
args: [{ selector: 'app-swap', imports: [
|
|
460
|
+
FormsModule,
|
|
461
|
+
AttributesDirective,
|
|
462
|
+
PurePipe,
|
|
463
|
+
NgTemplateOutlet,
|
|
464
|
+
CssPrefixPipe,
|
|
465
|
+
SelectorlessOutlet,
|
|
466
|
+
StrOrTemplateComponent,
|
|
467
|
+
NgClass,
|
|
468
|
+
MergeClassPipe,
|
|
469
|
+
], providers: [
|
|
470
|
+
{
|
|
471
|
+
provide: NG_VALUE_ACCESSOR,
|
|
472
|
+
useExisting: forwardRef(() => SwapFCC),
|
|
473
|
+
multi: true,
|
|
474
|
+
},
|
|
475
|
+
], template: "<ng-template #templateRef let-attr=\"attributes\">\n <label\n [attributes]=\"attr()\"\n [excludes]=\"['class']\"\n [class]=\"attr()?.class | mergeClass: ('swap' | cssPrefix) : wrapperClass$()\"\n >\n <input\n type=\"checkbox\"\n [ngModel]=\"value$()\"\n (ngModelChange)=\"valueAndTouchedChange($event)\"\n [disabled]=\"disabled$()\"\n [indeterminate]=\"indeterminate()\"\n />\n <div [class]=\"'swap-on' | cssPrefix\">\n <ng-template\n [selectlessOutlet]=\"StrOrTemplateComponent\"\n [selectlessOutletInputs]=\"{ content: onContent }\"\n ></ng-template>\n </div>\n <div [class]=\"'swap-off' | cssPrefix\">\n <ng-template\n [selectlessOutlet]=\"StrOrTemplateComponent\"\n [selectlessOutletInputs]=\"{ content: offContent }\"\n ></ng-template>\n </div>\n <div [class]=\"'swap-indeterminate' | cssPrefix\">\n <ng-template\n [selectlessOutlet]=\"StrOrTemplateComponent\"\n [selectlessOutletInputs]=\"{ content: indeterminateContent }\"\n ></ng-template>\n </div>\n </label>\n</ng-template>\n" }]
|
|
476
|
+
}], propDecorators: { templateRef: [{ type: i0.ViewChild, args: ['templateRef', { isSignal: true }] }], onContent: [{ type: i0.Input, args: [{ isSignal: true, alias: "onContent", required: false }] }], offContent: [{ type: i0.Input, args: [{ isSignal: true, alias: "offContent", required: false }] }], indeterminateContent: [{ type: i0.Input, args: [{ isSignal: true, alias: "indeterminateContent", required: false }] }], indeterminate: [{ type: i0.Input, args: [{ isSignal: true, alias: "indeterminate", required: false }] }], rotate: [{ type: i0.Input, args: [{ isSignal: true, alias: "rotate", required: false }] }], flip: [{ type: i0.Input, args: [{ isSignal: true, alias: "flip", required: false }] }] } });
|
|
477
|
+
|
|
478
|
+
const DateKey = ['min', 'max', 'today', 'focusedDate'];
|
|
479
|
+
const RangeDateKey = [...DateKey, 'tentative'];
|
|
480
|
+
|
|
481
|
+
function DateEqual(a, b) {
|
|
482
|
+
return a.getTime() === b.getTime();
|
|
483
|
+
}
|
|
484
|
+
function DateAsc(a, b) {
|
|
485
|
+
return a.getTime() - b.getTime();
|
|
486
|
+
}
|
|
487
|
+
class CalendarFCC extends BaseControl {
|
|
488
|
+
static __version = 2;
|
|
489
|
+
templateRef = viewChild.required('templateRef');
|
|
490
|
+
type = input('date', ...(ngDevMode ? [{ debugName: "type" }] : []));
|
|
491
|
+
dateProps = input(...(ngDevMode ? [undefined, { debugName: "dateProps" }] : []));
|
|
492
|
+
monthProps = input(1, ...(ngDevMode ? [{ debugName: "monthProps" }] : []));
|
|
493
|
+
monthProps$$ = computed(() => {
|
|
494
|
+
const value = this.monthProps();
|
|
495
|
+
return typeof value === 'number'
|
|
496
|
+
? range(value).map((value) => {
|
|
497
|
+
return value;
|
|
498
|
+
})
|
|
499
|
+
: value;
|
|
500
|
+
}, ...(ngDevMode ? [{ debugName: "monthProps$$" }] : []));
|
|
501
|
+
#multiList$$ = computed(() => {
|
|
502
|
+
return new SelectionModel(true, this.value$(), undefined, DateEqual);
|
|
503
|
+
}, ...(ngDevMode ? [{ debugName: "#multiList$$" }] : []));
|
|
504
|
+
dateProps$$ = computed(() => {
|
|
505
|
+
const props = this.dateProps();
|
|
506
|
+
const converted = {};
|
|
507
|
+
if (props) {
|
|
508
|
+
(this.type() === 'range' ? RangeDateKey : DateKey).forEach((item) => {
|
|
509
|
+
if (props[item]) {
|
|
510
|
+
converted[item] = toDateStr(props[item]);
|
|
511
|
+
}
|
|
512
|
+
});
|
|
513
|
+
}
|
|
514
|
+
let value;
|
|
515
|
+
switch (this.type()) {
|
|
516
|
+
case 'date': {
|
|
517
|
+
if (this.value$()) {
|
|
518
|
+
value = toDateStr(this.value$());
|
|
519
|
+
}
|
|
520
|
+
break;
|
|
521
|
+
}
|
|
522
|
+
case 'range': {
|
|
523
|
+
value = (this.value$() ?? [])
|
|
524
|
+
.map((item) => {
|
|
525
|
+
return toDateStr(item);
|
|
526
|
+
})
|
|
527
|
+
.join('/');
|
|
528
|
+
break;
|
|
529
|
+
}
|
|
530
|
+
case 'multi': {
|
|
531
|
+
value = (this.value$() ?? [])
|
|
532
|
+
.map((item) => {
|
|
533
|
+
return toDateStr(item);
|
|
534
|
+
})
|
|
535
|
+
.join(' ');
|
|
536
|
+
break;
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
return {
|
|
540
|
+
...props,
|
|
541
|
+
value,
|
|
542
|
+
...converted,
|
|
543
|
+
};
|
|
544
|
+
}, ...(ngDevMode ? [{ debugName: "dateProps$$" }] : []));
|
|
545
|
+
#theme = inject(ThemeService);
|
|
546
|
+
#callyInstance$$ = signal(undefined, ...(ngDevMode ? [{ debugName: "#callyInstance$$" }] : []));
|
|
547
|
+
callyInited$$ = computed(() => {
|
|
548
|
+
return !!this.#callyInstance$$();
|
|
549
|
+
}, ...(ngDevMode ? [{ debugName: "callyInited$$" }] : []));
|
|
550
|
+
#pt = inject(PendingTasks);
|
|
551
|
+
constructor() {
|
|
552
|
+
super();
|
|
553
|
+
afterNextRender(() => {
|
|
554
|
+
this.#pt.run(() => {
|
|
555
|
+
return import('cally').then((a) => this.#callyInstance$$.set(a));
|
|
556
|
+
});
|
|
557
|
+
});
|
|
558
|
+
}
|
|
559
|
+
focusdayChanged($event) {
|
|
560
|
+
switch (this.type()) {
|
|
561
|
+
case 'multi':
|
|
562
|
+
this.#multiList$$().toggle($event.detail);
|
|
563
|
+
this.value$.set(this.#multiList$$().selected);
|
|
564
|
+
this.valueAndTouchedChange(this.value$());
|
|
565
|
+
break;
|
|
566
|
+
case 'date': {
|
|
567
|
+
this.value$.set($event.detail);
|
|
568
|
+
this.valueAndTouchedChange(this.value$());
|
|
569
|
+
break;
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
#rangeList = [];
|
|
574
|
+
rangestartChanged(event) {
|
|
575
|
+
this.#rangeList[0] = event.detail;
|
|
576
|
+
}
|
|
577
|
+
rangeendChanged(event) {
|
|
578
|
+
this.#rangeList[1] = event.detail;
|
|
579
|
+
this.value$.set(this.#rangeList.sort(DateAsc));
|
|
580
|
+
this.valueAndTouchedChange(this.value$());
|
|
581
|
+
}
|
|
582
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: CalendarFCC, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
583
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.14", type: CalendarFCC, isStandalone: true, selector: "app-calendar", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, dateProps: { classPropertyName: "dateProps", publicName: "dateProps", isSignal: true, isRequired: false, transformFunction: null }, monthProps: { classPropertyName: "monthProps", publicName: "monthProps", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
|
|
584
|
+
{
|
|
585
|
+
provide: NG_VALUE_ACCESSOR,
|
|
586
|
+
useExisting: forwardRef(() => CalendarFCC),
|
|
587
|
+
multi: true,
|
|
588
|
+
},
|
|
589
|
+
], viewQueries: [{ propertyName: "templateRef", first: true, predicate: ["templateRef"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<ng-template #templateRef let-attr=\"attributes\">\n @defer (when callyInited$$()) {\n @let ClassStr = 'cally' | cssPrefix | mergeClass: attr()?.class;\n @switch (type()) {\n @case ('date') {\n <calendar-date\n [class]=\"ClassStr\"\n (focusday)=\"focusdayChanged($any($event))\"\n [calendarProps]=\"dateProps$$()\"\n >\n <svg\n aria-label=\"Previous\"\n class=\"fill-current size-4\"\n slot=\"previous\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n >\n <path fill=\"currentColor\" d=\"M15.75 19.5 8.25 12l7.5-7.5\"></path>\n </svg>\n <svg\n aria-label=\"Next\"\n class=\"fill-current size-4\"\n slot=\"next\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n >\n <path fill=\"currentColor\" d=\"m8.25 4.5 7.5 7.5-7.5 7.5\"></path>\n </svg>\n <calendar-month></calendar-month>\n </calendar-date>\n }\n @case ('multi') {\n <calendar-multi\n [class]=\"ClassStr\"\n [calendarProps]=\"dateProps$$()\"\n (focusday)=\"focusdayChanged($any($event))\"\n >\n <calendar-month></calendar-month>\n </calendar-multi>\n }\n @case ('range') {\n <calendar-range\n [class]=\"ClassStr\"\n [calendarProps]=\"dateProps$$()\"\n (focusday)=\"focusdayChanged($any($event))\"\n (rangestart)=\"rangestartChanged($any($event))\"\n (rangeend)=\"rangeendChanged($any($event))\"\n >\n @for (item of monthProps$$(); track $index) {\n <calendar-month [attr.offset]=\"item\"></calendar-month>\n }\n </calendar-range>\n }\n }\n } @loading {\n <span class=\"loading loading-spinner loading-xs\"></span>\n }\n</ng-template>\n", dependencies: [{ kind: "ngmodule", type: FormsModule }], deferBlockDependencies: [() => [import('./piying-lib-angular-daisyui-field-control-props.directive-C5mF89PX.mjs').then(m => m.CalendarPropsDirective), import('@piying-lib/angular-daisyui/pipe').then(m => m.CssPrefixPipe), import('@piying-lib/angular-daisyui/pipe').then(m => m.MergeClassPipe)]] });
|
|
590
|
+
}
|
|
591
|
+
i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "20.3.14", ngImport: i0, type: CalendarFCC, resolveDeferredDeps: () => [import('./piying-lib-angular-daisyui-field-control-props.directive-C5mF89PX.mjs').then(m => m.CalendarPropsDirective), import('@piying-lib/angular-daisyui/pipe').then(m => m.CssPrefixPipe), import('@piying-lib/angular-daisyui/pipe').then(m => m.MergeClassPipe)], resolveMetadata: (CalendarPropsDirective, CssPrefixPipe, MergeClassPipe) => ({ decorators: [{
|
|
592
|
+
type: Component,
|
|
593
|
+
args: [{ selector: 'app-calendar', imports: [
|
|
594
|
+
FormsModule,
|
|
595
|
+
AttributesDirective,
|
|
596
|
+
NgTemplateOutlet,
|
|
597
|
+
NgClass,
|
|
598
|
+
CssPrefixPipe,
|
|
599
|
+
MergeClassPipe,
|
|
600
|
+
PurePipe,
|
|
601
|
+
CalendarPropsDirective,
|
|
602
|
+
], providers: [
|
|
603
|
+
{
|
|
604
|
+
provide: NG_VALUE_ACCESSOR,
|
|
605
|
+
useExisting: forwardRef(() => CalendarFCC),
|
|
606
|
+
multi: true,
|
|
607
|
+
},
|
|
608
|
+
], schemas: [CUSTOM_ELEMENTS_SCHEMA], template: "<ng-template #templateRef let-attr=\"attributes\">\n @defer (when callyInited$$()) {\n @let ClassStr = 'cally' | cssPrefix | mergeClass: attr()?.class;\n @switch (type()) {\n @case ('date') {\n <calendar-date\n [class]=\"ClassStr\"\n (focusday)=\"focusdayChanged($any($event))\"\n [calendarProps]=\"dateProps$$()\"\n >\n <svg\n aria-label=\"Previous\"\n class=\"fill-current size-4\"\n slot=\"previous\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n >\n <path fill=\"currentColor\" d=\"M15.75 19.5 8.25 12l7.5-7.5\"></path>\n </svg>\n <svg\n aria-label=\"Next\"\n class=\"fill-current size-4\"\n slot=\"next\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n >\n <path fill=\"currentColor\" d=\"m8.25 4.5 7.5 7.5-7.5 7.5\"></path>\n </svg>\n <calendar-month></calendar-month>\n </calendar-date>\n }\n @case ('multi') {\n <calendar-multi\n [class]=\"ClassStr\"\n [calendarProps]=\"dateProps$$()\"\n (focusday)=\"focusdayChanged($any($event))\"\n >\n <calendar-month></calendar-month>\n </calendar-multi>\n }\n @case ('range') {\n <calendar-range\n [class]=\"ClassStr\"\n [calendarProps]=\"dateProps$$()\"\n (focusday)=\"focusdayChanged($any($event))\"\n (rangestart)=\"rangestartChanged($any($event))\"\n (rangeend)=\"rangeendChanged($any($event))\"\n >\n @for (item of monthProps$$(); track $index) {\n <calendar-month [attr.offset]=\"item\"></calendar-month>\n }\n </calendar-range>\n }\n }\n } @loading {\n <span class=\"loading loading-spinner loading-xs\"></span>\n }\n</ng-template>\n" }]
|
|
609
|
+
}], ctorParameters: () => [], propDecorators: { templateRef: [{ type: i0.ViewChild, args: ['templateRef', { isSignal: true }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], dateProps: [{ type: i0.Input, args: [{ isSignal: true, alias: "dateProps", required: false }] }], monthProps: [{ type: i0.Input, args: [{ isSignal: true, alias: "monthProps", required: false }] }] } }) });
|
|
610
|
+
|
|
611
|
+
/**
|
|
612
|
+
* Generated bundle index. Do not edit.
|
|
613
|
+
*/
|
|
614
|
+
|
|
615
|
+
export { CalendarFCC, CheckboxFCC, FileInputFCC, InputFCC, RadioFCC, RangeFCC, RatingFCC, SelectFCC, SwapFCC, TextareaFCC, ToggleFCC };
|
|
616
|
+
//# sourceMappingURL=piying-lib-angular-daisyui-field-control.mjs.map
|