@piying-lib/angular-daisyui 1.2.2 → 1.2.3
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/fesm2022/piying-lib-angular-daisyui-overlay.mjs +241 -0
- package/fesm2022/piying-lib-angular-daisyui-overlay.mjs.map +1 -0
- package/fesm2022/piying-lib-angular-daisyui-preset.mjs +157 -0
- package/fesm2022/piying-lib-angular-daisyui-preset.mjs.map +1 -0
- package/overlay/index.d.ts +136 -0
- package/package.json +10 -2
- package/preset/index.d.ts +268 -0
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { signal, Injectable, inject, computed, Component, viewChild, input, linkedSignal } from '@angular/core';
|
|
3
|
+
import { MergeClassPipe, CssPrefixPipe, TwPrefixPipe } from '@piying-lib/angular-daisyui/pipe';
|
|
4
|
+
import { CdkCopyToClipboard } from '@angular/cdk/clipboard';
|
|
5
|
+
import { ThemeService } from '@piying-lib/angular-daisyui/service';
|
|
6
|
+
import clsx from 'clsx';
|
|
7
|
+
import { StrOrTemplateComponent } from '@piying-lib/angular-core';
|
|
8
|
+
import { SelectorlessOutlet } from '@cyia/ngx-common/directive';
|
|
9
|
+
import { PurePipe } from '@cyia/ngx-common/pipe';
|
|
10
|
+
import { PI_INPUT_OPTIONS_TOKEN, PiyingView } from '@piying/view-angular';
|
|
11
|
+
|
|
12
|
+
class ToastService {
|
|
13
|
+
#list$ = signal([], ...(ngDevMode ? [{ debugName: "#list$" }] : []));
|
|
14
|
+
timeoutDelayIds = new Map();
|
|
15
|
+
timeoutDurationIds = new Map();
|
|
16
|
+
nextId = 0;
|
|
17
|
+
#position$ = signal(['end', 'top'], ...(ngDevMode ? [{ debugName: "#position$" }] : []));
|
|
18
|
+
position$$ = this.#position$.asReadonly();
|
|
19
|
+
list$$ = this.#list$.asReadonly();
|
|
20
|
+
add(options) {
|
|
21
|
+
const id = this.nextId++;
|
|
22
|
+
const delay = options.delay;
|
|
23
|
+
const item = {
|
|
24
|
+
id,
|
|
25
|
+
...options,
|
|
26
|
+
type: options.type || 'info',
|
|
27
|
+
duration: options.duration ?? 5000,
|
|
28
|
+
};
|
|
29
|
+
if (!delay) {
|
|
30
|
+
this.#addToList(item);
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
const timeoutId = setTimeout(() => {
|
|
34
|
+
this.#addToList(item);
|
|
35
|
+
}, delay);
|
|
36
|
+
this.timeoutDelayIds.set(id, timeoutId);
|
|
37
|
+
}
|
|
38
|
+
return id;
|
|
39
|
+
}
|
|
40
|
+
#addToList(item) {
|
|
41
|
+
this.#list$.update((current) => [...current, item]);
|
|
42
|
+
const timeoutId = setTimeout(() => {
|
|
43
|
+
this.remove(item.id);
|
|
44
|
+
}, item.duration);
|
|
45
|
+
this.timeoutDurationIds.set(item.id, timeoutId);
|
|
46
|
+
}
|
|
47
|
+
remove(id) {
|
|
48
|
+
if (this.timeoutDurationIds.has(id)) {
|
|
49
|
+
clearTimeout(this.timeoutDurationIds.get(id));
|
|
50
|
+
this.timeoutDurationIds.delete(id);
|
|
51
|
+
this.#list$.update((current) => current.filter((item) => item.id !== id));
|
|
52
|
+
}
|
|
53
|
+
if (this.timeoutDelayIds.has(id)) {
|
|
54
|
+
clearTimeout(this.timeoutDelayIds.get(id));
|
|
55
|
+
this.timeoutDelayIds.delete(id);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
clear() {
|
|
59
|
+
this.timeoutDurationIds.forEach((timeoutId) => clearTimeout(timeoutId));
|
|
60
|
+
this.timeoutDurationIds.clear();
|
|
61
|
+
this.timeoutDelayIds.forEach((timeoutId) => clearTimeout(timeoutId));
|
|
62
|
+
this.timeoutDelayIds.clear();
|
|
63
|
+
this.#list$.set([]);
|
|
64
|
+
}
|
|
65
|
+
setPosition(item) {
|
|
66
|
+
this.#position$.set(item);
|
|
67
|
+
}
|
|
68
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: ToastService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
69
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: ToastService, providedIn: 'root' });
|
|
70
|
+
}
|
|
71
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: ToastService, decorators: [{
|
|
72
|
+
type: Injectable,
|
|
73
|
+
args: [{
|
|
74
|
+
providedIn: 'root',
|
|
75
|
+
}]
|
|
76
|
+
}] });
|
|
77
|
+
|
|
78
|
+
class ToastPortal {
|
|
79
|
+
toast = inject(ToastService);
|
|
80
|
+
#theme = inject(ThemeService);
|
|
81
|
+
containerClass$$ = computed(() => {
|
|
82
|
+
return clsx(this.toast.position$$().map((item) => this.#theme.addPrefix(`toast-${item}`)));
|
|
83
|
+
}, ...(ngDevMode ? [{ debugName: "containerClass$$" }] : []));
|
|
84
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: ToastPortal, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
85
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.14", type: ToastPortal, isStandalone: true, selector: "pi-toast-portal", ngImport: i0, template: "<div [class]=\"'toast' | cssPrefix | mergeClass: ('z-100' | twPrefix) : containerClass$$()\">\n @for (item of toast.list$$(); track $index) {\n <div\n [class]=\"\n 'alert alert-' + item.type | cssPrefix | mergeClass: 'w-fit break-all gap-1' | twPrefix\n \"\n >\n <span>{{ item.message }}</span>\n @if (item.enableCopy) {\n <button\n class=\"btn btn-circle btn-ghost btn-xs tooltip\"\n [cdkCopyToClipboard]=\"item.message\"\n data-tip=\"copy\"\n >\n <span class=\"material-icons\">content_copy</span>\n </button>\n }\n </div>\n }\n</div>\n", dependencies: [{ kind: "directive", type: CdkCopyToClipboard, selector: "[cdkCopyToClipboard]", inputs: ["cdkCopyToClipboard", "cdkCopyToClipboardAttempts"], outputs: ["cdkCopyToClipboardCopied"] }, { kind: "pipe", type: MergeClassPipe, name: "mergeClass" }, { kind: "pipe", type: CssPrefixPipe, name: "cssPrefix" }, { kind: "pipe", type: TwPrefixPipe, name: "twPrefix" }] });
|
|
86
|
+
}
|
|
87
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: ToastPortal, decorators: [{
|
|
88
|
+
type: Component,
|
|
89
|
+
args: [{ selector: 'pi-toast-portal', imports: [MergeClassPipe, CssPrefixPipe, TwPrefixPipe, CdkCopyToClipboard], template: "<div [class]=\"'toast' | cssPrefix | mergeClass: ('z-100' | twPrefix) : containerClass$$()\">\n @for (item of toast.list$$(); track $index) {\n <div\n [class]=\"\n 'alert alert-' + item.type | cssPrefix | mergeClass: 'w-fit break-all gap-1' | twPrefix\n \"\n >\n <span>{{ item.message }}</span>\n @if (item.enableCopy) {\n <button\n class=\"btn btn-circle btn-ghost btn-xs tooltip\"\n [cdkCopyToClipboard]=\"item.message\"\n data-tip=\"copy\"\n >\n <span class=\"material-icons\">content_copy</span>\n </button>\n }\n </div>\n }\n</div>\n" }]
|
|
90
|
+
}] });
|
|
91
|
+
|
|
92
|
+
const Undefined$$ = Promise.resolve(undefined);
|
|
93
|
+
class ConfirmService {
|
|
94
|
+
#list$ = signal([], ...(ngDevMode ? [{ debugName: "#list$" }] : []));
|
|
95
|
+
nextId = 0;
|
|
96
|
+
list$$ = this.#list$.asReadonly();
|
|
97
|
+
#position$ = signal('middle', ...(ngDevMode ? [{ debugName: "#position$" }] : []));
|
|
98
|
+
position$$ = this.#position$.asReadonly();
|
|
99
|
+
open(options) {
|
|
100
|
+
const id = this.nextId++;
|
|
101
|
+
const p = Promise.withResolvers();
|
|
102
|
+
this.#addToList({
|
|
103
|
+
...options,
|
|
104
|
+
id,
|
|
105
|
+
close: async (index) => {
|
|
106
|
+
(index === undefined
|
|
107
|
+
? Undefined$$
|
|
108
|
+
: options.buttons[index].close
|
|
109
|
+
? options.buttons[index].close()
|
|
110
|
+
: Undefined$$).then((value) => {
|
|
111
|
+
p.resolve(value);
|
|
112
|
+
this.remove(id);
|
|
113
|
+
});
|
|
114
|
+
},
|
|
115
|
+
});
|
|
116
|
+
return p.promise;
|
|
117
|
+
}
|
|
118
|
+
#addToList(item) {
|
|
119
|
+
this.#list$.update((current) => [...current, item]);
|
|
120
|
+
}
|
|
121
|
+
remove(id) {
|
|
122
|
+
this.#list$.update((current) => current.filter((item) => item.id !== id));
|
|
123
|
+
}
|
|
124
|
+
setPosition(position) {
|
|
125
|
+
this.#position$.set(position);
|
|
126
|
+
}
|
|
127
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: ConfirmService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
128
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: ConfirmService, providedIn: 'root' });
|
|
129
|
+
}
|
|
130
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: ConfirmService, decorators: [{
|
|
131
|
+
type: Injectable,
|
|
132
|
+
args: [{
|
|
133
|
+
providedIn: 'root',
|
|
134
|
+
}]
|
|
135
|
+
}] });
|
|
136
|
+
|
|
137
|
+
class ConfirmPortal {
|
|
138
|
+
StrOrTemplateComponent = StrOrTemplateComponent;
|
|
139
|
+
service = inject(ConfirmService);
|
|
140
|
+
#theme = inject(ThemeService);
|
|
141
|
+
containerClass$$ = computed(() => {
|
|
142
|
+
return clsx(this.#theme.addPrefix(`modal-${this.service.position$$()}`));
|
|
143
|
+
}, ...(ngDevMode ? [{ debugName: "containerClass$$" }] : []));
|
|
144
|
+
buttonContent = (content) => {
|
|
145
|
+
return { content };
|
|
146
|
+
};
|
|
147
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: ConfirmPortal, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
148
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.14", type: ConfirmPortal, isStandalone: true, selector: "pi-confirm-portal", ngImport: i0, template: "@for (item of service.list$$(); track $index) {\n <dialog [class]=\"'modal' | cssPrefix | mergeClass: containerClass$$()\" open>\n <div [class]=\"'modal-box' | cssPrefix\">\n <h3 [class]=\"'text-lg font-bold' | twPrefix\">{{ item.title }}</h3>\n <p [class]=\"'py-4 break-all' | twPrefix\">{{ item.message }}</p>\n <form method=\"dialog\" [class]=\"'flex justify-end gap-2' | twPrefix\">\n @for (button of item.buttons; track $index) {\n <button\n [class]=\"'btn' | cssPrefix | mergeClass: button.class\"\n (click)=\"item.close($index)\"\n type=\"button\"\n >\n <ng-template\n [selectlessOutlet]=\"StrOrTemplateComponent\"\n [selectlessOutletInputs]=\"buttonContent | pure: button.label\"\n ></ng-template>\n </button>\n }\n </form>\n </div>\n @if (!item.modal) {\n <form method=\"dialog\" class=\"modal-backdrop\">\n <button (click)=\"item.close(undefined)\">close</button>\n </form>\n }\n </dialog>\n}\n", dependencies: [{ kind: "directive", type: SelectorlessOutlet, selector: "[selectlessOutlet]", inputs: ["selectlessOutlet", "selectlessOutletInputs", "selectlessOutletOutputs", "selectlessOutletDirectives", "selectlessOutletInjector", "selectlessOutletEnvironmentInjector"], exportAs: ["selectlessOutlet"] }, { kind: "pipe", type: MergeClassPipe, name: "mergeClass" }, { kind: "pipe", type: CssPrefixPipe, name: "cssPrefix" }, { kind: "pipe", type: TwPrefixPipe, name: "twPrefix" }, { kind: "pipe", type: PurePipe, name: "pure" }] });
|
|
149
|
+
}
|
|
150
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: ConfirmPortal, decorators: [{
|
|
151
|
+
type: Component,
|
|
152
|
+
args: [{ selector: 'pi-confirm-portal', imports: [MergeClassPipe, CssPrefixPipe, TwPrefixPipe, SelectorlessOutlet, PurePipe], template: "@for (item of service.list$$(); track $index) {\n <dialog [class]=\"'modal' | cssPrefix | mergeClass: containerClass$$()\" open>\n <div [class]=\"'modal-box' | cssPrefix\">\n <h3 [class]=\"'text-lg font-bold' | twPrefix\">{{ item.title }}</h3>\n <p [class]=\"'py-4 break-all' | twPrefix\">{{ item.message }}</p>\n <form method=\"dialog\" [class]=\"'flex justify-end gap-2' | twPrefix\">\n @for (button of item.buttons; track $index) {\n <button\n [class]=\"'btn' | cssPrefix | mergeClass: button.class\"\n (click)=\"item.close($index)\"\n type=\"button\"\n >\n <ng-template\n [selectlessOutlet]=\"StrOrTemplateComponent\"\n [selectlessOutletInputs]=\"buttonContent | pure: button.label\"\n ></ng-template>\n </button>\n }\n </form>\n </div>\n @if (!item.modal) {\n <form method=\"dialog\" class=\"modal-backdrop\">\n <button (click)=\"item.close(undefined)\">close</button>\n </form>\n }\n </dialog>\n}\n" }]
|
|
153
|
+
}] });
|
|
154
|
+
|
|
155
|
+
class FormDialogService {
|
|
156
|
+
#list$ = signal([], ...(ngDevMode ? [{ debugName: "#list$" }] : []));
|
|
157
|
+
nextId = 0;
|
|
158
|
+
list$$ = this.#list$.asReadonly();
|
|
159
|
+
open(options) {
|
|
160
|
+
const id = this.nextId++;
|
|
161
|
+
const p = Promise.withResolvers();
|
|
162
|
+
this.#addToList({
|
|
163
|
+
...options,
|
|
164
|
+
id,
|
|
165
|
+
close: async (result) => {
|
|
166
|
+
p.resolve(result);
|
|
167
|
+
this.#remove(id);
|
|
168
|
+
},
|
|
169
|
+
});
|
|
170
|
+
return p.promise;
|
|
171
|
+
}
|
|
172
|
+
#addToList(item) {
|
|
173
|
+
this.#list$.update((current) => [...current, item]);
|
|
174
|
+
}
|
|
175
|
+
#remove(id) {
|
|
176
|
+
this.#list$.update((current) => current.filter((item) => item.id !== id));
|
|
177
|
+
}
|
|
178
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: FormDialogService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
179
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: FormDialogService, providedIn: 'root' });
|
|
180
|
+
}
|
|
181
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: FormDialogService, decorators: [{
|
|
182
|
+
type: Injectable,
|
|
183
|
+
args: [{
|
|
184
|
+
providedIn: 'root',
|
|
185
|
+
}]
|
|
186
|
+
}] });
|
|
187
|
+
|
|
188
|
+
class FormDialogItemComponent {
|
|
189
|
+
static __version = 2;
|
|
190
|
+
templateRef = viewChild.required('templateRef');
|
|
191
|
+
StrOrTemplateComponent = StrOrTemplateComponent;
|
|
192
|
+
service = inject(FormDialogService);
|
|
193
|
+
options$$ = inject(PI_INPUT_OPTIONS_TOKEN);
|
|
194
|
+
item = input.required(...(ngDevMode ? [{ debugName: "item" }] : []));
|
|
195
|
+
changedValue = linkedSignal(computed(() => this.item()?.value), ...(ngDevMode ? [{ debugName: "changedValue" }] : []));
|
|
196
|
+
loading$ = signal(false, ...(ngDevMode ? [{ debugName: "loading$" }] : []));
|
|
197
|
+
async apply() {
|
|
198
|
+
this.loading$.set(true);
|
|
199
|
+
const item = this.item();
|
|
200
|
+
try {
|
|
201
|
+
const result = (await item.applyValue?.(this.changedValue())) ?? this.changedValue();
|
|
202
|
+
this.item().close(result);
|
|
203
|
+
}
|
|
204
|
+
catch (error) {
|
|
205
|
+
console.error(error);
|
|
206
|
+
}
|
|
207
|
+
finally {
|
|
208
|
+
this.loading$.set(false);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
close() {
|
|
212
|
+
this.item().close(undefined);
|
|
213
|
+
}
|
|
214
|
+
modelChange(value) {
|
|
215
|
+
this.changedValue.set(value);
|
|
216
|
+
}
|
|
217
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: FormDialogItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
218
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.14", type: FormDialogItemComponent, isStandalone: true, selector: "pi-form-dialog-item", inputs: { item: { classPropertyName: "item", publicName: "item", isSignal: true, isRequired: true, transformFunction: null } }, viewQueries: [{ propertyName: "templateRef", first: true, predicate: ["templateRef"], descendants: true, isSignal: true }], ngImport: i0, template: "<ng-template #templateRef>\n <dialog [class]=\"'modal' | cssPrefix\" open>\n <div class=\"modal-box\">\n <h2 [class]=\"'text-lg font-bold' | twPrefix\">{{ item().title }}</h2>\n\n <piying-view\n [schema]=\"item().schema\"\n [options]=\"options$$()\"\n [model]=\"item().value\"\n (modelChange)=\"modelChange($event)\"\n class=\"flex-1 overflow-auto py-4\"\n #ref\n ></piying-view>\n <div class=\"card-actions justify-end\">\n <button class=\"btn btn-error\" (click)=\"close()\">\n <ng-template\n [selectlessOutlet]=\"StrOrTemplateComponent\"\n [selectlessOutletInputs]=\"{ content: item().cancelButton ?? 'Cancel' }\"\n ></ng-template>\n </button>\n\n <input\n type=\"submit\"\n class=\"btn btn-primary\"\n (click)=\"apply()\"\n [disabled]=\"!ref.form$$()?.valid\"\n />\n </div>\n @if (loading$()) {\n <div\n class=\"absolute top-0 bottom-0 left-0 right-0 flex items-center justify-center bg-base-200/70\"\n >\n <span class=\"loading text-primary\"></span>\n </div>\n }\n </div>\n @if (!item().modal) {\n <form method=\"dialog\" class=\"modal-backdrop\">\n <button (click)=\"close()\">close</button>\n </form>\n }\n </dialog>\n</ng-template>\n", dependencies: [{ kind: "directive", type: SelectorlessOutlet, selector: "[selectlessOutlet]", inputs: ["selectlessOutlet", "selectlessOutletInputs", "selectlessOutletOutputs", "selectlessOutletDirectives", "selectlessOutletInjector", "selectlessOutletEnvironmentInjector"], exportAs: ["selectlessOutlet"] }, { kind: "component", type: PiyingView, selector: "piying-view", inputs: ["selectorless", "schema", "model", "options"], outputs: ["modelChange"] }, { kind: "pipe", type: CssPrefixPipe, name: "cssPrefix" }, { kind: "pipe", type: TwPrefixPipe, name: "twPrefix" }] });
|
|
219
|
+
}
|
|
220
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: FormDialogItemComponent, decorators: [{
|
|
221
|
+
type: Component,
|
|
222
|
+
args: [{ selector: 'pi-form-dialog-item', imports: [CssPrefixPipe, TwPrefixPipe, SelectorlessOutlet, PiyingView], template: "<ng-template #templateRef>\n <dialog [class]=\"'modal' | cssPrefix\" open>\n <div class=\"modal-box\">\n <h2 [class]=\"'text-lg font-bold' | twPrefix\">{{ item().title }}</h2>\n\n <piying-view\n [schema]=\"item().schema\"\n [options]=\"options$$()\"\n [model]=\"item().value\"\n (modelChange)=\"modelChange($event)\"\n class=\"flex-1 overflow-auto py-4\"\n #ref\n ></piying-view>\n <div class=\"card-actions justify-end\">\n <button class=\"btn btn-error\" (click)=\"close()\">\n <ng-template\n [selectlessOutlet]=\"StrOrTemplateComponent\"\n [selectlessOutletInputs]=\"{ content: item().cancelButton ?? 'Cancel' }\"\n ></ng-template>\n </button>\n\n <input\n type=\"submit\"\n class=\"btn btn-primary\"\n (click)=\"apply()\"\n [disabled]=\"!ref.form$$()?.valid\"\n />\n </div>\n @if (loading$()) {\n <div\n class=\"absolute top-0 bottom-0 left-0 right-0 flex items-center justify-center bg-base-200/70\"\n >\n <span class=\"loading text-primary\"></span>\n </div>\n }\n </div>\n @if (!item().modal) {\n <form method=\"dialog\" class=\"modal-backdrop\">\n <button (click)=\"close()\">close</button>\n </form>\n }\n </dialog>\n</ng-template>\n" }]
|
|
223
|
+
}], propDecorators: { templateRef: [{ type: i0.ViewChild, args: ['templateRef', { isSignal: true }] }], item: [{ type: i0.Input, args: [{ isSignal: true, alias: "item", required: true }] }] } });
|
|
224
|
+
|
|
225
|
+
class FormDialogPortal {
|
|
226
|
+
service = inject(FormDialogService);
|
|
227
|
+
FormDialogItemComponent = FormDialogItemComponent;
|
|
228
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: FormDialogPortal, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
229
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.14", type: FormDialogPortal, isStandalone: true, selector: "pi-form-dialog-portal", ngImport: i0, template: "@for (item of service.list$$(); track item.id) {\n <ng-template\n [selectlessOutlet]=\"FormDialogItemComponent\"\n [selectlessOutletInjector]=\"item.injector\"\n [selectlessOutletInputs]=\"{ item: item }\"\n ></ng-template>\n}\n", dependencies: [{ kind: "directive", type: SelectorlessOutlet, selector: "[selectlessOutlet]", inputs: ["selectlessOutlet", "selectlessOutletInputs", "selectlessOutletOutputs", "selectlessOutletDirectives", "selectlessOutletInjector", "selectlessOutletEnvironmentInjector"], exportAs: ["selectlessOutlet"] }] });
|
|
230
|
+
}
|
|
231
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: FormDialogPortal, decorators: [{
|
|
232
|
+
type: Component,
|
|
233
|
+
args: [{ selector: 'pi-form-dialog-portal', imports: [SelectorlessOutlet], template: "@for (item of service.list$$(); track item.id) {\n <ng-template\n [selectlessOutlet]=\"FormDialogItemComponent\"\n [selectlessOutletInjector]=\"item.injector\"\n [selectlessOutletInputs]=\"{ item: item }\"\n ></ng-template>\n}\n" }]
|
|
234
|
+
}] });
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* Generated bundle index. Do not edit.
|
|
238
|
+
*/
|
|
239
|
+
|
|
240
|
+
export { ConfirmPortal, ConfirmService, FormDialogItemComponent, FormDialogPortal, FormDialogService, ToastPortal, ToastService };
|
|
241
|
+
//# sourceMappingURL=piying-lib-angular-daisyui-overlay.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"piying-lib-angular-daisyui-overlay.mjs","sources":["../../../projects/daisyui/overlay/toast/toast.service.ts","../../../projects/daisyui/overlay/toast/component.ts","../../../projects/daisyui/overlay/toast/component.html","../../../projects/daisyui/overlay/confirm/confirm.service.ts","../../../projects/daisyui/overlay/confirm/component.ts","../../../projects/daisyui/overlay/confirm/component.html","../../../projects/daisyui/overlay/form-dialog/form-dialog.service.ts","../../../projects/daisyui/overlay/form-dialog/dialog-item/component.ts","../../../projects/daisyui/overlay/form-dialog/dialog-item/component.html","../../../projects/daisyui/overlay/form-dialog/component.ts","../../../projects/daisyui/overlay/form-dialog/component.html","../../../projects/daisyui/overlay/piying-lib-angular-daisyui-overlay.ts"],"sourcesContent":["import { Injectable, signal } from '@angular/core';\n\nexport interface ToastItem {\n id: number;\n message: string;\n type?: 'success' | 'error' | 'warning' | 'info';\n duration?: number;\n enableCopy?: boolean;\n}\n\ntype XPosition = 'start' | 'center' | 'end';\ntype YPosition = 'top' | 'middle' | 'bottom';\n@Injectable({\n providedIn: 'root',\n})\nexport class ToastService {\n readonly #list$ = signal<ToastItem[]>([]);\n private readonly timeoutDelayIds = new Map<number, any>();\n private readonly timeoutDurationIds = new Map<number, any>();\n private nextId = 0;\n #position$ = signal<[XPosition, YPosition]>(['end', 'top']);\n position$$ = this.#position$.asReadonly();\n list$$ = this.#list$.asReadonly();\n\n add(options: Omit<ToastItem, 'id'> & { delay?: number }): number {\n const id = this.nextId++;\n const delay = options.delay;\n const item: ToastItem = {\n id,\n ...options,\n type: options.type || 'info',\n duration: options.duration ?? 5000,\n };\n if (!delay) {\n this.#addToList(item);\n } else {\n const timeoutId = setTimeout(() => {\n this.#addToList(item);\n }, delay);\n this.timeoutDelayIds.set(id, timeoutId);\n }\n\n return id;\n }\n #addToList(item: ToastItem) {\n this.#list$.update((current) => [...current, item]);\n const timeoutId = setTimeout(() => {\n this.remove(item.id);\n }, item.duration);\n\n this.timeoutDurationIds.set(item.id, timeoutId);\n }\n\n remove(id: number): void {\n if (this.timeoutDurationIds.has(id)) {\n clearTimeout(this.timeoutDurationIds.get(id)!);\n this.timeoutDurationIds.delete(id);\n this.#list$.update((current) => current.filter((item) => item.id !== id));\n }\n if (this.timeoutDelayIds.has(id)) {\n clearTimeout(this.timeoutDelayIds.get(id)!);\n this.timeoutDelayIds.delete(id);\n }\n }\n\n clear(): void {\n this.timeoutDurationIds.forEach((timeoutId) => clearTimeout(timeoutId));\n this.timeoutDurationIds.clear();\n this.timeoutDelayIds.forEach((timeoutId) => clearTimeout(timeoutId));\n this.timeoutDelayIds.clear();\n this.#list$.set([]);\n }\n setPosition(item: [XPosition, YPosition]) {\n this.#position$.set(item);\n }\n}\n","import { Component, computed, inject } from '@angular/core';\nimport { CssPrefixPipe, MergeClassPipe, TwPrefixPipe } from '@piying-lib/angular-daisyui/pipe';\nimport { ToastService } from './toast.service';\nimport { CdkCopyToClipboard } from '@angular/cdk/clipboard';\nimport { ThemeService } from '@piying-lib/angular-daisyui/service';\nimport clsx from 'clsx';\n\n@Component({\n selector: 'pi-toast-portal',\n templateUrl: './component.html',\n imports: [MergeClassPipe, CssPrefixPipe, TwPrefixPipe, CdkCopyToClipboard],\n})\nexport class ToastPortal {\n toast = inject(ToastService);\n #theme = inject(ThemeService);\n containerClass$$ = computed(() => {\n return clsx(this.toast.position$$().map((item) => this.#theme.addPrefix(`toast-${item}`)));\n });\n}\n","<div [class]=\"'toast' | cssPrefix | mergeClass: ('z-100' | twPrefix) : containerClass$$()\">\n @for (item of toast.list$$(); track $index) {\n <div\n [class]=\"\n 'alert alert-' + item.type | cssPrefix | mergeClass: 'w-fit break-all gap-1' | twPrefix\n \"\n >\n <span>{{ item.message }}</span>\n @if (item.enableCopy) {\n <button\n class=\"btn btn-circle btn-ghost btn-xs tooltip\"\n [cdkCopyToClipboard]=\"item.message\"\n data-tip=\"copy\"\n >\n <span class=\"material-icons\">content_copy</span>\n </button>\n }\n </div>\n }\n</div>\n","import { Injectable, signal } from '@angular/core';\n\nexport type Button<T> = {\n close?: () => Promise<T>;\n class?: string;\n label: any;\n};\n\ntype UnionCloseReturns<T extends readonly any[]> = T extends readonly []\n ? never\n : {\n [K in keyof T]: T[K] extends { close?: (...args: any[]) => infer R } ? R : never;\n }[number];\n\nexport interface ConfirmItem<BList extends Button<any>[] = any[]> {\n id: number;\n title: string;\n message: string;\n buttons?: BList;\n close: (value: any) => Promise<any>;\n /** 是否为模态框 */\n modal?: boolean;\n}\nconst Undefined$$ = Promise.resolve(undefined);\ntype Position = 'top' | 'middle' | 'bottom' | 'start' | 'end';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class ConfirmService {\n readonly #list$ = signal<ConfirmItem[]>([]);\n private nextId = 0;\n\n list$$ = this.#list$.asReadonly();\n #position$ = signal<Position>('middle');\n position$$ = this.#position$.asReadonly();\n open<TB extends Button<any>[]>(options: Omit<ConfirmItem<TB>, 'id' | 'close'>) {\n const id = this.nextId++;\n const p = Promise.withResolvers<UnionCloseReturns<TB>>();\n this.#addToList({\n ...options,\n id,\n close: async (index: number | undefined) => {\n (index === undefined\n ? Undefined$$\n : options.buttons![index].close\n ? options.buttons![index].close()\n : Undefined$$\n ).then((value) => {\n p.resolve(value);\n this.remove(id);\n });\n },\n });\n\n return p.promise;\n }\n #addToList(item: ConfirmItem) {\n this.#list$.update((current) => [...current, item]);\n }\n\n remove(id: number): void {\n this.#list$.update((current) => current.filter((item) => item.id !== id));\n }\n setPosition(position: Position) {\n this.#position$.set(position);\n }\n}\n","import { Component, computed, inject } from '@angular/core';\nimport { CssPrefixPipe, MergeClassPipe, TwPrefixPipe } from '@piying-lib/angular-daisyui/pipe';\nimport { ThemeService } from '@piying-lib/angular-daisyui/service';\nimport clsx from 'clsx';\nimport { ConfirmService } from './confirm.service';\nimport { StrOrTemplateComponent } from '@piying-lib/angular-core';\nimport { SelectorlessOutlet } from '@cyia/ngx-common/directive';\nimport { PurePipe } from '@cyia/ngx-common/pipe';\n\n@Component({\n selector: 'pi-confirm-portal',\n templateUrl: './component.html',\n imports: [MergeClassPipe, CssPrefixPipe, TwPrefixPipe, SelectorlessOutlet, PurePipe],\n})\nexport class ConfirmPortal {\n readonly StrOrTemplateComponent = StrOrTemplateComponent;\n service = inject(ConfirmService);\n #theme = inject(ThemeService);\n containerClass$$ = computed(() => {\n return clsx(this.#theme.addPrefix(`modal-${this.service.position$$()}`));\n });\n buttonContent = (content: any) => {\n return { content };\n };\n}\n","@for (item of service.list$$(); track $index) {\n <dialog [class]=\"'modal' | cssPrefix | mergeClass: containerClass$$()\" open>\n <div [class]=\"'modal-box' | cssPrefix\">\n <h3 [class]=\"'text-lg font-bold' | twPrefix\">{{ item.title }}</h3>\n <p [class]=\"'py-4 break-all' | twPrefix\">{{ item.message }}</p>\n <form method=\"dialog\" [class]=\"'flex justify-end gap-2' | twPrefix\">\n @for (button of item.buttons; track $index) {\n <button\n [class]=\"'btn' | cssPrefix | mergeClass: button.class\"\n (click)=\"item.close($index)\"\n type=\"button\"\n >\n <ng-template\n [selectlessOutlet]=\"StrOrTemplateComponent\"\n [selectlessOutletInputs]=\"buttonContent | pure: button.label\"\n ></ng-template>\n </button>\n }\n </form>\n </div>\n @if (!item.modal) {\n <form method=\"dialog\" class=\"modal-backdrop\">\n <button (click)=\"item.close(undefined)\">close</button>\n </form>\n }\n </dialog>\n}\n","import { Injectable, Injector, signal } from '@angular/core';\n\nexport interface FormDialogOptions<T = any> {\n id: number;\n\n title: string;\n schema: any;\n value?: T;\n cancelButton?: any;\n /** 是否为模态框 */\n modal?: boolean;\n applyValue?: (value: T) => Promise<T | undefined>;\n injector: Injector;\n close: (value: any) => Promise<any>;\n}\n\n@Injectable({\n providedIn: 'root',\n})\nexport class FormDialogService {\n readonly #list$ = signal<FormDialogOptions[]>([]);\n private nextId = 0;\n\n list$$ = this.#list$.asReadonly();\n\n open<T = any>(options: Omit<FormDialogOptions<T>, 'id' | 'close'>) {\n const id = this.nextId++;\n const p = Promise.withResolvers<T | undefined>();\n this.#addToList({\n ...options,\n id,\n close: async (result?: T) => {\n p.resolve(result);\n this.#remove(id);\n },\n });\n\n return p.promise;\n }\n\n #addToList(item: FormDialogOptions) {\n this.#list$.update((current) => [...current, item]);\n }\n\n #remove(id: number): void {\n this.#list$.update((current) => current.filter((item) => item.id !== id));\n }\n\n // closeAll() {\n // this.#list$.set([]);\n // }\n}\n","import { Component, computed, inject, input, linkedSignal, signal, viewChild } from '@angular/core';\nimport { FormDialogOptions, FormDialogService } from '../form-dialog.service';\nimport { CssPrefixPipe, TwPrefixPipe } from '@piying-lib/angular-daisyui/pipe';\nimport { SelectorlessOutlet } from '@cyia/ngx-common/directive';\nimport { StrOrTemplateComponent } from '@piying-lib/angular-core';\nimport { PI_INPUT_OPTIONS_TOKEN, PiyingView } from '@piying/view-angular';\n\n@Component({\n selector: 'pi-form-dialog-item',\n templateUrl: './component.html',\n imports: [CssPrefixPipe, TwPrefixPipe, SelectorlessOutlet, PiyingView],\n})\nexport class FormDialogItemComponent {\n static __version = 2;\n templateRef = viewChild.required('templateRef');\n readonly StrOrTemplateComponent = StrOrTemplateComponent;\n readonly service = inject(FormDialogService);\n options$$ = inject(PI_INPUT_OPTIONS_TOKEN);\n\n item = input.required<FormDialogOptions>();\n changedValue = linkedSignal(computed(() => this.item()?.value));\n\n loading$ = signal(false);\n\n async apply() {\n this.loading$.set(true);\n const item = this.item();\n\n try {\n const result = (await item.applyValue?.(this.changedValue())) ?? this.changedValue();\n this.item().close(result);\n } catch (error) {\n console.error(error);\n } finally {\n this.loading$.set(false);\n }\n }\n close() {\n this.item().close(undefined);\n }\n modelChange(value: any) {\n this.changedValue.set(value);\n }\n}\n","<ng-template #templateRef>\n <dialog [class]=\"'modal' | cssPrefix\" open>\n <div class=\"modal-box\">\n <h2 [class]=\"'text-lg font-bold' | twPrefix\">{{ item().title }}</h2>\n\n <piying-view\n [schema]=\"item().schema\"\n [options]=\"options$$()\"\n [model]=\"item().value\"\n (modelChange)=\"modelChange($event)\"\n class=\"flex-1 overflow-auto py-4\"\n #ref\n ></piying-view>\n <div class=\"card-actions justify-end\">\n <button class=\"btn btn-error\" (click)=\"close()\">\n <ng-template\n [selectlessOutlet]=\"StrOrTemplateComponent\"\n [selectlessOutletInputs]=\"{ content: item().cancelButton ?? 'Cancel' }\"\n ></ng-template>\n </button>\n\n <input\n type=\"submit\"\n class=\"btn btn-primary\"\n (click)=\"apply()\"\n [disabled]=\"!ref.form$$()?.valid\"\n />\n </div>\n @if (loading$()) {\n <div\n class=\"absolute top-0 bottom-0 left-0 right-0 flex items-center justify-center bg-base-200/70\"\n >\n <span class=\"loading text-primary\"></span>\n </div>\n }\n </div>\n @if (!item().modal) {\n <form method=\"dialog\" class=\"modal-backdrop\">\n <button (click)=\"close()\">close</button>\n </form>\n }\n </dialog>\n</ng-template>\n","import { Component, inject } from '@angular/core';\nimport { FormDialogService } from './form-dialog.service';\nimport { FormDialogItemComponent } from './dialog-item/component';\nimport { SelectorlessOutlet } from '@cyia/ngx-common/directive';\n\n@Component({\n selector: 'pi-form-dialog-portal',\n templateUrl: './component.html',\n imports: [SelectorlessOutlet],\n})\nexport class FormDialogPortal {\n readonly service = inject(FormDialogService);\n readonly FormDialogItemComponent = FormDialogItemComponent;\n}\n","@for (item of service.list$$(); track item.id) {\n <ng-template\n [selectlessOutlet]=\"FormDialogItemComponent\"\n [selectlessOutletInjector]=\"item.injector\"\n [selectlessOutletInputs]=\"{ item: item }\"\n ></ng-template>\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;MAea,YAAY,CAAA;AACd,IAAA,MAAM,GAAG,MAAM,CAAc,EAAE,kDAAC;AACxB,IAAA,eAAe,GAAG,IAAI,GAAG,EAAe;AACxC,IAAA,kBAAkB,GAAG,IAAI,GAAG,EAAe;IACpD,MAAM,GAAG,CAAC;IAClB,UAAU,GAAG,MAAM,CAAyB,CAAC,KAAK,EAAE,KAAK,CAAC,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EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;4FAAhB,gBAAgB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,uBAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECV7B,iPAOA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EDCY,kBAAkB,EAAA,QAAA,EAAA,oBAAA,EAAA,MAAA,EAAA,CAAA,kBAAA,EAAA,wBAAA,EAAA,yBAAA,EAAA,4BAAA,EAAA,0BAAA,EAAA,qCAAA,CAAA,EAAA,QAAA,EAAA,CAAA,kBAAA,CAAA,EAAA,CAAA,EAAA,CAAA;;4FAEjB,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAL5B,SAAS;+BACE,uBAAuB,EAAA,OAAA,EAExB,CAAC,kBAAkB,CAAC,EAAA,QAAA,EAAA,iPAAA,EAAA;;;AER/B;;AAEG;;;;"}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { PiyingViewGroup } from '@piying/view-angular';
|
|
2
|
+
import { RouterOutlet } from '@angular/router';
|
|
3
|
+
import { DivWC, StrOrTemplateComponent, DivNFCC } from '@piying-lib/angular-core';
|
|
4
|
+
import { actions } from '@piying/view-angular-core';
|
|
5
|
+
import * as WCGroup from '@piying-lib/angular-daisyui/wrapper';
|
|
6
|
+
import * as NFCCGroup from '@piying-lib/angular-daisyui/non-field-control';
|
|
7
|
+
import * as FCCGroup from '@piying-lib/angular-daisyui/field-control';
|
|
8
|
+
import * as FGCGroup from '@piying-lib/angular-daisyui/field-group';
|
|
9
|
+
import { ExtWrapperGroup, ExtComponentGroup } from '@piying-lib/angular-daisyui/extension';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* 文档/document https://github.com/piying-org/piying-angular-component/blob/main/projects/daisyui/preset/define.ts */
|
|
13
|
+
const PresetDefine = {
|
|
14
|
+
types: {
|
|
15
|
+
calendar: { type: FCCGroup.CalendarFCC },
|
|
16
|
+
boolean: {
|
|
17
|
+
type: FCCGroup.CheckboxFCC,
|
|
18
|
+
actions: [
|
|
19
|
+
actions.wrappers.set(['label-wrapper']),
|
|
20
|
+
actions.props.patch({
|
|
21
|
+
labelPosition: 'right',
|
|
22
|
+
}),
|
|
23
|
+
],
|
|
24
|
+
},
|
|
25
|
+
checkbox: {
|
|
26
|
+
type: FCCGroup.CheckboxFCC,
|
|
27
|
+
actions: [
|
|
28
|
+
actions.wrappers.set(['label-wrapper']),
|
|
29
|
+
actions.props.patch({
|
|
30
|
+
labelPosition: 'right',
|
|
31
|
+
}),
|
|
32
|
+
],
|
|
33
|
+
},
|
|
34
|
+
'editable-badge': { type: FCCGroup.EditableBadgeFCC },
|
|
35
|
+
'file-input': { type: FCCGroup.FileInputFCC },
|
|
36
|
+
// 基础类型
|
|
37
|
+
input: {
|
|
38
|
+
type: FCCGroup.InputFCC,
|
|
39
|
+
actions: [actions.wrappers.set(['label-wrapper'])],
|
|
40
|
+
},
|
|
41
|
+
string: {
|
|
42
|
+
type: FCCGroup.InputFCC,
|
|
43
|
+
actions: [actions.wrappers.set(['label-wrapper'])],
|
|
44
|
+
},
|
|
45
|
+
number: {
|
|
46
|
+
type: FCCGroup.InputFCC,
|
|
47
|
+
actions: [actions.inputs.set({ type: 'number' }), actions.wrappers.set(['label-wrapper'])],
|
|
48
|
+
},
|
|
49
|
+
date: {
|
|
50
|
+
type: FCCGroup.InputFCC,
|
|
51
|
+
actions: [actions.inputs.set({ type: 'date' }), actions.wrappers.set(['label-wrapper'])],
|
|
52
|
+
},
|
|
53
|
+
password: { type: FCCGroup.PasswordInputFCC },
|
|
54
|
+
radio: {
|
|
55
|
+
type: FCCGroup.RadioFCC,
|
|
56
|
+
actions: [actions.wrappers.set(['label-wrapper'])],
|
|
57
|
+
},
|
|
58
|
+
range: {
|
|
59
|
+
type: FCCGroup.RangeFCC,
|
|
60
|
+
actions: [actions.wrappers.set(['label-wrapper'])],
|
|
61
|
+
},
|
|
62
|
+
rating: { type: FCCGroup.RatingFCC },
|
|
63
|
+
select: {
|
|
64
|
+
type: FCCGroup.SelectFCC,
|
|
65
|
+
actions: [actions.wrappers.set(['label-wrapper'])],
|
|
66
|
+
},
|
|
67
|
+
picklist: {
|
|
68
|
+
type: FCCGroup.SelectFCC,
|
|
69
|
+
actions: [actions.wrappers.set(['label-wrapper'])],
|
|
70
|
+
},
|
|
71
|
+
swap: { type: FCCGroup.SwapFCC },
|
|
72
|
+
textarea: {
|
|
73
|
+
type: FCCGroup.TextareaFCC,
|
|
74
|
+
actions: [actions.wrappers.set(['label-wrapper'])],
|
|
75
|
+
},
|
|
76
|
+
toggle: {
|
|
77
|
+
type: FCCGroup.ToggleFCC,
|
|
78
|
+
actions: [
|
|
79
|
+
actions.wrappers.set(['label-wrapper']),
|
|
80
|
+
actions.props.patch({
|
|
81
|
+
labelPosition: 'right',
|
|
82
|
+
}),
|
|
83
|
+
],
|
|
84
|
+
},
|
|
85
|
+
// 非字段控件
|
|
86
|
+
alert: { type: NFCCGroup.AlertNFCC },
|
|
87
|
+
avatar: { type: NFCCGroup.AvatarNFCC },
|
|
88
|
+
badge: { type: NFCCGroup.BadgeNFCC },
|
|
89
|
+
breadcrumbs: { type: NFCCGroup.BreadcrumbsNFCC },
|
|
90
|
+
button: { type: NFCCGroup.ButtonNFCC },
|
|
91
|
+
divider: { type: NFCCGroup.DividerNFCC },
|
|
92
|
+
dropdown: { type: NFCCGroup.DropdownNFCC },
|
|
93
|
+
fab: { type: NFCCGroup.FabNFCC },
|
|
94
|
+
'input-button': { type: NFCCGroup.InputButtonNFCC },
|
|
95
|
+
kbd: { type: NFCCGroup.KbdNFCC },
|
|
96
|
+
loading: { type: NFCCGroup.LoadingNFCC },
|
|
97
|
+
progress: { type: NFCCGroup.ProgressNFCC },
|
|
98
|
+
'radial-progress': { type: NFCCGroup.RadialProgressNFCC },
|
|
99
|
+
stat: { type: NFCCGroup.StatNFCC },
|
|
100
|
+
status: { type: NFCCGroup.StatusNFCC },
|
|
101
|
+
'theme-controller': { type: NFCCGroup.ThemeControllerNFCC },
|
|
102
|
+
// 字段组
|
|
103
|
+
accordion: { type: FGCGroup.AccordionFGC },
|
|
104
|
+
card: { type: FGCGroup.CardFGC },
|
|
105
|
+
carousel: { type: FGCGroup.CarouselFGC },
|
|
106
|
+
dock: { type: FGCGroup.DockFGC },
|
|
107
|
+
drawer: { type: FGCGroup.DrawerFGC },
|
|
108
|
+
list: { type: FGCGroup.ListFGC },
|
|
109
|
+
navbar: { type: FGCGroup.NavbarFGC },
|
|
110
|
+
steps: { type: FGCGroup.StepsFGC },
|
|
111
|
+
tabs: { type: FGCGroup.TabsFGC },
|
|
112
|
+
// 扩展组件
|
|
113
|
+
'checkbox-list': { type: ExtComponentGroup.CheckboxListFGC },
|
|
114
|
+
'editable-group': { type: ExtComponentGroup.EditableArrayFGC },
|
|
115
|
+
'list-template': { type: ExtComponentGroup.ListTemplateNFCC },
|
|
116
|
+
'logic-group': { type: ExtComponentGroup.logicGroupFGC },
|
|
117
|
+
'menu-tree': { type: ExtComponentGroup.MenuTreeNFCC },
|
|
118
|
+
'option-list': { type: ExtComponentGroup.OptionListFCC },
|
|
119
|
+
pagination: { type: ExtComponentGroup.PaginationNFCC },
|
|
120
|
+
'picker-ref': { type: ExtComponentGroup.PickerRefFCC },
|
|
121
|
+
table: { type: ExtComponentGroup.TableNFCC },
|
|
122
|
+
tr: { type: ExtComponentGroup.TableRowFGC },
|
|
123
|
+
'table-expand-cell': { type: ExtComponentGroup.TableExpandOneTableCell },
|
|
124
|
+
// 特殊类型
|
|
125
|
+
'router-outlet': { type: RouterOutlet },
|
|
126
|
+
object: { type: PiyingViewGroup },
|
|
127
|
+
div: { type: DivNFCC },
|
|
128
|
+
'common-data': { type: StrOrTemplateComponent },
|
|
129
|
+
'filter-option': {
|
|
130
|
+
type: ExtWrapperGroup.FilterOptionNFCC,
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
wrappers: {
|
|
134
|
+
// 默认包装器
|
|
135
|
+
// 和group冲突,应该去掉group
|
|
136
|
+
fieldset: { type: WCGroup.FieldsetWC },
|
|
137
|
+
form: { type: WCGroup.FormWC },
|
|
138
|
+
'label-wrapper': { type: WCGroup.LabelWC },
|
|
139
|
+
'loading-wrapper': { type: WCGroup.LoadingWC },
|
|
140
|
+
'validate-tooltip-wrapper': { type: WCGroup.ValidateTooltipbWC },
|
|
141
|
+
td: { type: WCGroup.TdWC },
|
|
142
|
+
th: { type: WCGroup.ThWC },
|
|
143
|
+
div: { type: DivWC },
|
|
144
|
+
// 扩展包装器
|
|
145
|
+
'sort-header': { type: ExtWrapperGroup.SortHeaderWC },
|
|
146
|
+
'table-checkbox-all': { type: ExtWrapperGroup.TableCheckboxAllWC },
|
|
147
|
+
'table-checkbox-body': { type: ExtWrapperGroup.TableCheckboxOneWC },
|
|
148
|
+
'local-filter': { type: ExtWrapperGroup.OptionListLocalFilterWC },
|
|
149
|
+
},
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Generated bundle index. Do not edit.
|
|
154
|
+
*/
|
|
155
|
+
|
|
156
|
+
export { PresetDefine };
|
|
157
|
+
//# sourceMappingURL=piying-lib-angular-daisyui-preset.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"piying-lib-angular-daisyui-preset.mjs","sources":["../../../projects/daisyui/preset/define.ts","../../../projects/daisyui/preset/piying-lib-angular-daisyui-preset.ts"],"sourcesContent":["import { PiyingViewGroup } from '@piying/view-angular';\nimport { RouterOutlet } from '@angular/router';\nimport { DivNFCC, DivWC, StrOrTemplateComponent } from '@piying-lib/angular-core';\nimport { actions } from '@piying/view-angular-core';\n\n// 核心包装器\nimport * as WCGroup from '@piying-lib/angular-daisyui/wrapper';\nimport * as NFCCGroup from '@piying-lib/angular-daisyui/non-field-control';\nimport * as FCCGroup from '@piying-lib/angular-daisyui/field-control';\nimport * as FGCGroup from '@piying-lib/angular-daisyui/field-group';\nimport { ExtComponentGroup, ExtWrapperGroup } from '@piying-lib/angular-daisyui/extension';\n/** \n * 文档/document https://github.com/piying-org/piying-angular-component/blob/main/projects/daisyui/preset/define.ts */\nexport const PresetDefine = {\n types: {\n calendar: { type: FCCGroup.CalendarFCC },\n boolean: {\n type: FCCGroup.CheckboxFCC,\n actions: [\n actions.wrappers.set(['label-wrapper']),\n actions.props.patch({\n labelPosition: 'right',\n }),\n ],\n },\n checkbox: {\n type: FCCGroup.CheckboxFCC,\n actions: [\n actions.wrappers.set(['label-wrapper']),\n actions.props.patch({\n labelPosition: 'right',\n }),\n ],\n },\n 'editable-badge': { type: FCCGroup.EditableBadgeFCC },\n 'file-input': { type: FCCGroup.FileInputFCC },\n\n // 基础类型\n input: {\n type: FCCGroup.InputFCC,\n actions: [actions.wrappers.set(['label-wrapper'])],\n },\n string: {\n type: FCCGroup.InputFCC,\n actions: [actions.wrappers.set(['label-wrapper'])],\n },\n number: {\n type: FCCGroup.InputFCC,\n actions: [actions.inputs.set({ type: 'number' }), actions.wrappers.set(['label-wrapper'])],\n },\n date: {\n type: FCCGroup.InputFCC,\n actions: [actions.inputs.set({ type: 'date' }), actions.wrappers.set(['label-wrapper'])],\n },\n password: { type: FCCGroup.PasswordInputFCC },\n radio: {\n type: FCCGroup.RadioFCC,\n actions: [actions.wrappers.set(['label-wrapper'])],\n },\n range: {\n type: FCCGroup.RangeFCC,\n actions: [actions.wrappers.set(['label-wrapper'])],\n },\n rating: { type: FCCGroup.RatingFCC },\n select: {\n type: FCCGroup.SelectFCC,\n actions: [actions.wrappers.set(['label-wrapper'])],\n },\n picklist: {\n type: FCCGroup.SelectFCC,\n actions: [actions.wrappers.set(['label-wrapper'])],\n },\n swap: { type: FCCGroup.SwapFCC },\n textarea: {\n type: FCCGroup.TextareaFCC,\n actions: [actions.wrappers.set(['label-wrapper'])],\n },\n\n toggle: {\n type: FCCGroup.ToggleFCC,\n actions: [\n actions.wrappers.set(['label-wrapper']),\n actions.props.patch({\n labelPosition: 'right',\n }),\n ],\n },\n\n // 非字段控件\n alert: { type: NFCCGroup.AlertNFCC },\n avatar: { type: NFCCGroup.AvatarNFCC },\n badge: { type: NFCCGroup.BadgeNFCC },\n breadcrumbs: { type: NFCCGroup.BreadcrumbsNFCC },\n button: { type: NFCCGroup.ButtonNFCC },\n divider: { type: NFCCGroup.DividerNFCC },\n dropdown: { type: NFCCGroup.DropdownNFCC },\n fab: { type: NFCCGroup.FabNFCC },\n 'input-button': { type: NFCCGroup.InputButtonNFCC },\n kbd: { type: NFCCGroup.KbdNFCC },\n loading: { type: NFCCGroup.LoadingNFCC },\n progress: { type: NFCCGroup.ProgressNFCC },\n 'radial-progress': { type: NFCCGroup.RadialProgressNFCC },\n stat: { type: NFCCGroup.StatNFCC },\n status: { type: NFCCGroup.StatusNFCC },\n 'theme-controller': { type: NFCCGroup.ThemeControllerNFCC },\n // 字段组\n accordion: { type: FGCGroup.AccordionFGC },\n card: { type: FGCGroup.CardFGC },\n carousel: { type: FGCGroup.CarouselFGC },\n dock: { type: FGCGroup.DockFGC },\n drawer: { type: FGCGroup.DrawerFGC },\n list: { type: FGCGroup.ListFGC },\n navbar: { type: FGCGroup.NavbarFGC },\n steps: { type: FGCGroup.StepsFGC },\n tabs: { type: FGCGroup.TabsFGC },\n // 扩展组件\n 'checkbox-list': { type: ExtComponentGroup.CheckboxListFGC },\n 'editable-group': { type: ExtComponentGroup.EditableArrayFGC },\n 'list-template': { type: ExtComponentGroup.ListTemplateNFCC },\n 'logic-group': { type: ExtComponentGroup.logicGroupFGC },\n 'menu-tree': { type: ExtComponentGroup.MenuTreeNFCC },\n 'option-list': { type: ExtComponentGroup.OptionListFCC },\n pagination: { type: ExtComponentGroup.PaginationNFCC },\n 'picker-ref': { type: ExtComponentGroup.PickerRefFCC },\n table: { type: ExtComponentGroup.TableNFCC },\n tr: { type: ExtComponentGroup.TableRowFGC },\n 'table-expand-cell': { type: ExtComponentGroup.TableExpandOneTableCell },\n // 特殊类型\n 'router-outlet': { type: RouterOutlet },\n object: { type: PiyingViewGroup },\n div: { type: DivNFCC },\n 'common-data': { type: StrOrTemplateComponent },\n 'filter-option': {\n type: ExtWrapperGroup.FilterOptionNFCC,\n },\n },\n wrappers: {\n // 默认包装器\n // 和group冲突,应该去掉group\n fieldset: { type: WCGroup.FieldsetWC },\n form: { type: WCGroup.FormWC },\n 'label-wrapper': { type: WCGroup.LabelWC },\n 'loading-wrapper': { type: WCGroup.LoadingWC },\n 'validate-tooltip-wrapper': { type: WCGroup.ValidateTooltipbWC },\n td: { type: WCGroup.TdWC },\n th: { type: WCGroup.ThWC },\n div: { type: DivWC },\n // 扩展包装器\n 'sort-header': { type: ExtWrapperGroup.SortHeaderWC },\n 'table-checkbox-all': { type: ExtWrapperGroup.TableCheckboxAllWC },\n 'table-checkbox-body': { type: ExtWrapperGroup.TableCheckboxOneWC },\n 'local-filter': { type: ExtWrapperGroup.OptionListLocalFilterWC },\n },\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAWA;AACoH;AAC7G,MAAM,YAAY,GAAG;AAC1B,IAAA,KAAK,EAAE;AACL,QAAA,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,CAAC,WAAW,EAAE;AACxC,QAAA,OAAO,EAAE;YACP,IAAI,EAAE,QAAQ,CAAC,WAAW;AAC1B,YAAA,OAAO,EAAE;gBACP,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,eAAe,CAAC,CAAC;AACvC,gBAAA,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC;AAClB,oBAAA,aAAa,EAAE,OAAO;iBACvB,CAAC;AACH,aAAA;AACF,SAAA;AACD,QAAA,QAAQ,EAAE;YACR,IAAI,EAAE,QAAQ,CAAC,WAAW;AAC1B,YAAA,OAAO,EAAE;gBACP,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAA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
|
+
import { StrOrTemplateComponent } from '@piying-lib/angular-core';
|
|
4
|
+
import * as _piying_view_angular from '@piying/view-angular';
|
|
5
|
+
import * as _piying_valibot_visit from '@piying/valibot-visit';
|
|
6
|
+
import * as _piying_view_angular_core from '@piying/view-angular-core';
|
|
7
|
+
|
|
8
|
+
interface ToastItem {
|
|
9
|
+
id: number;
|
|
10
|
+
message: string;
|
|
11
|
+
type?: 'success' | 'error' | 'warning' | 'info';
|
|
12
|
+
duration?: number;
|
|
13
|
+
enableCopy?: boolean;
|
|
14
|
+
}
|
|
15
|
+
type XPosition = 'start' | 'center' | 'end';
|
|
16
|
+
type YPosition = 'top' | 'middle' | 'bottom';
|
|
17
|
+
declare class ToastService {
|
|
18
|
+
#private;
|
|
19
|
+
private readonly timeoutDelayIds;
|
|
20
|
+
private readonly timeoutDurationIds;
|
|
21
|
+
private nextId;
|
|
22
|
+
position$$: i0.Signal<[XPosition, YPosition]>;
|
|
23
|
+
list$$: i0.Signal<ToastItem[]>;
|
|
24
|
+
add(options: Omit<ToastItem, 'id'> & {
|
|
25
|
+
delay?: number;
|
|
26
|
+
}): number;
|
|
27
|
+
remove(id: number): void;
|
|
28
|
+
clear(): void;
|
|
29
|
+
setPosition(item: [XPosition, YPosition]): void;
|
|
30
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ToastService, never>;
|
|
31
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ToastService>;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
declare class ToastPortal {
|
|
35
|
+
#private;
|
|
36
|
+
toast: ToastService;
|
|
37
|
+
containerClass$$: i0.Signal<string>;
|
|
38
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ToastPortal, never>;
|
|
39
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ToastPortal, "pi-toast-portal", never, {}, {}, never, never, true, never>;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
type Button<T> = {
|
|
43
|
+
close?: () => Promise<T>;
|
|
44
|
+
class?: string;
|
|
45
|
+
label: any;
|
|
46
|
+
};
|
|
47
|
+
type UnionCloseReturns<T extends readonly any[]> = T extends readonly [] ? never : {
|
|
48
|
+
[K in keyof T]: T[K] extends {
|
|
49
|
+
close?: (...args: any[]) => infer R;
|
|
50
|
+
} ? R : never;
|
|
51
|
+
}[number];
|
|
52
|
+
interface ConfirmItem<BList extends Button<any>[] = any[]> {
|
|
53
|
+
id: number;
|
|
54
|
+
title: string;
|
|
55
|
+
message: string;
|
|
56
|
+
buttons?: BList;
|
|
57
|
+
close: (value: any) => Promise<any>;
|
|
58
|
+
/** 是否为模态框 */
|
|
59
|
+
modal?: boolean;
|
|
60
|
+
}
|
|
61
|
+
type Position = 'top' | 'middle' | 'bottom' | 'start' | 'end';
|
|
62
|
+
declare class ConfirmService {
|
|
63
|
+
#private;
|
|
64
|
+
private nextId;
|
|
65
|
+
list$$: i0.Signal<ConfirmItem<any[]>[]>;
|
|
66
|
+
position$$: i0.Signal<Position>;
|
|
67
|
+
open<TB extends Button<any>[]>(options: Omit<ConfirmItem<TB>, 'id' | 'close'>): Promise<UnionCloseReturns<TB>>;
|
|
68
|
+
remove(id: number): void;
|
|
69
|
+
setPosition(position: Position): void;
|
|
70
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ConfirmService, never>;
|
|
71
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ConfirmService>;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
declare class ConfirmPortal {
|
|
75
|
+
#private;
|
|
76
|
+
readonly StrOrTemplateComponent: typeof StrOrTemplateComponent;
|
|
77
|
+
service: ConfirmService;
|
|
78
|
+
containerClass$$: i0.Signal<string>;
|
|
79
|
+
buttonContent: (content: any) => {
|
|
80
|
+
content: any;
|
|
81
|
+
};
|
|
82
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ConfirmPortal, never>;
|
|
83
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ConfirmPortal, "pi-confirm-portal", never, {}, {}, never, never, true, never>;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
interface FormDialogOptions<T = any> {
|
|
87
|
+
id: number;
|
|
88
|
+
title: string;
|
|
89
|
+
schema: any;
|
|
90
|
+
value?: T;
|
|
91
|
+
cancelButton?: any;
|
|
92
|
+
/** 是否为模态框 */
|
|
93
|
+
modal?: boolean;
|
|
94
|
+
applyValue?: (value: T) => Promise<T | undefined>;
|
|
95
|
+
injector: Injector;
|
|
96
|
+
close: (value: any) => Promise<any>;
|
|
97
|
+
}
|
|
98
|
+
declare class FormDialogService {
|
|
99
|
+
#private;
|
|
100
|
+
private nextId;
|
|
101
|
+
list$$: i0.Signal<FormDialogOptions<any>[]>;
|
|
102
|
+
open<T = any>(options: Omit<FormDialogOptions<T>, 'id' | 'close'>): Promise<T | undefined>;
|
|
103
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FormDialogService, never>;
|
|
104
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<FormDialogService>;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
declare class FormDialogItemComponent {
|
|
108
|
+
static __version: number;
|
|
109
|
+
templateRef: i0.Signal<unknown>;
|
|
110
|
+
readonly StrOrTemplateComponent: typeof StrOrTemplateComponent;
|
|
111
|
+
readonly service: FormDialogService;
|
|
112
|
+
options$$: i0.Signal<Omit<_piying_view_angular_core.SetOptional<Omit<_piying_valibot_visit.ConvertOptions<typeof _piying_view_angular_core.CoreSchemaHandle>, "handle"> & Partial<Pick<_piying_valibot_visit.ConvertOptions<typeof _piying_view_angular_core.CoreSchemaHandle>, "handle">> & {
|
|
113
|
+
builder: typeof _piying_view_angular_core.FormBuilder;
|
|
114
|
+
fieldGlobalConfig?: _piying_view_angular.PiViewConfig;
|
|
115
|
+
}, "handle" | "builder">, "fieldGlobalConfig"> & {
|
|
116
|
+
fieldGlobalConfig?: _piying_view_angular.PiViewConfig;
|
|
117
|
+
}>;
|
|
118
|
+
item: i0.InputSignal<FormDialogOptions<any>>;
|
|
119
|
+
changedValue: i0.WritableSignal<any>;
|
|
120
|
+
loading$: i0.WritableSignal<boolean>;
|
|
121
|
+
apply(): Promise<void>;
|
|
122
|
+
close(): void;
|
|
123
|
+
modelChange(value: any): void;
|
|
124
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FormDialogItemComponent, never>;
|
|
125
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FormDialogItemComponent, "pi-form-dialog-item", never, { "item": { "alias": "item"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
declare class FormDialogPortal {
|
|
129
|
+
readonly service: FormDialogService;
|
|
130
|
+
readonly FormDialogItemComponent: typeof FormDialogItemComponent;
|
|
131
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FormDialogPortal, never>;
|
|
132
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FormDialogPortal, "pi-form-dialog-portal", never, {}, {}, never, never, true, never>;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export { ConfirmPortal, ConfirmService, FormDialogItemComponent, FormDialogPortal, FormDialogService, ToastPortal, ToastService };
|
|
136
|
+
export type { Button, ConfirmItem, FormDialogOptions, ToastItem };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@piying-lib/angular-daisyui",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.3",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/common": ">=20.3.0",
|
|
6
6
|
"@angular/core": ">=20.3.0",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
14
|
"tslib": "^2.3.0",
|
|
15
|
-
"@piying-lib/angular-core": "^1.2.
|
|
15
|
+
"@piying-lib/angular-core": "^1.2.3",
|
|
16
16
|
"cally": "^0.9.2"
|
|
17
17
|
},
|
|
18
18
|
"sideEffects": false,
|
|
@@ -42,10 +42,18 @@
|
|
|
42
42
|
"types": "./non-field-control/index.d.ts",
|
|
43
43
|
"default": "./fesm2022/piying-lib-angular-daisyui-non-field-control.mjs"
|
|
44
44
|
},
|
|
45
|
+
"./overlay": {
|
|
46
|
+
"types": "./overlay/index.d.ts",
|
|
47
|
+
"default": "./fesm2022/piying-lib-angular-daisyui-overlay.mjs"
|
|
48
|
+
},
|
|
45
49
|
"./pipe": {
|
|
46
50
|
"types": "./pipe/index.d.ts",
|
|
47
51
|
"default": "./fesm2022/piying-lib-angular-daisyui-pipe.mjs"
|
|
48
52
|
},
|
|
53
|
+
"./preset": {
|
|
54
|
+
"types": "./preset/index.d.ts",
|
|
55
|
+
"default": "./fesm2022/piying-lib-angular-daisyui-preset.mjs"
|
|
56
|
+
},
|
|
49
57
|
"./service": {
|
|
50
58
|
"types": "./service/index.d.ts",
|
|
51
59
|
"default": "./fesm2022/piying-lib-angular-daisyui-service.mjs"
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import * as _piying_lib_angular_daisyui_extension from '@piying-lib/angular-daisyui/extension';
|
|
3
|
+
import { ExtComponentGroup } from '@piying-lib/angular-daisyui/extension';
|
|
4
|
+
import * as _piying_valibot_visit from '@piying/valibot-visit';
|
|
5
|
+
import * as _piying_view_angular_core from '@piying/view-angular-core';
|
|
6
|
+
import { PiyingViewGroup } from '@piying/view-angular';
|
|
7
|
+
import { RouterOutlet } from '@angular/router';
|
|
8
|
+
import { DivNFCC, StrOrTemplateComponent, DivWC } from '@piying-lib/angular-core';
|
|
9
|
+
import * as WCGroup from '@piying-lib/angular-daisyui/wrapper';
|
|
10
|
+
import * as NFCCGroup from '@piying-lib/angular-daisyui/non-field-control';
|
|
11
|
+
import * as FCCGroup from '@piying-lib/angular-daisyui/field-control';
|
|
12
|
+
import * as FGCGroup from '@piying-lib/angular-daisyui/field-group';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* 文档/document https://github.com/piying-org/piying-angular-component/blob/main/projects/daisyui/preset/define.ts */
|
|
16
|
+
declare const PresetDefine: {
|
|
17
|
+
types: {
|
|
18
|
+
calendar: {
|
|
19
|
+
type: typeof FCCGroup.CalendarFCC;
|
|
20
|
+
};
|
|
21
|
+
boolean: {
|
|
22
|
+
type: typeof FCCGroup.CheckboxFCC;
|
|
23
|
+
actions: _piying_valibot_visit.RawConfigAction<"viewRawConfig", unknown, _piying_view_angular_core.AnyCoreSchemaHandle>[];
|
|
24
|
+
};
|
|
25
|
+
checkbox: {
|
|
26
|
+
type: typeof FCCGroup.CheckboxFCC;
|
|
27
|
+
actions: _piying_valibot_visit.RawConfigAction<"viewRawConfig", unknown, _piying_view_angular_core.AnyCoreSchemaHandle>[];
|
|
28
|
+
};
|
|
29
|
+
'editable-badge': {
|
|
30
|
+
type: typeof FCCGroup.EditableBadgeFCC;
|
|
31
|
+
};
|
|
32
|
+
'file-input': {
|
|
33
|
+
type: typeof FCCGroup.FileInputFCC;
|
|
34
|
+
};
|
|
35
|
+
input: {
|
|
36
|
+
type: typeof FCCGroup.InputFCC;
|
|
37
|
+
actions: _piying_valibot_visit.RawConfigAction<"viewRawConfig", unknown, _piying_view_angular_core.AnyCoreSchemaHandle>[];
|
|
38
|
+
};
|
|
39
|
+
string: {
|
|
40
|
+
type: typeof FCCGroup.InputFCC;
|
|
41
|
+
actions: _piying_valibot_visit.RawConfigAction<"viewRawConfig", unknown, _piying_view_angular_core.AnyCoreSchemaHandle>[];
|
|
42
|
+
};
|
|
43
|
+
number: {
|
|
44
|
+
type: typeof FCCGroup.InputFCC;
|
|
45
|
+
actions: _piying_valibot_visit.RawConfigAction<"viewRawConfig", unknown, _piying_view_angular_core.AnyCoreSchemaHandle>[];
|
|
46
|
+
};
|
|
47
|
+
date: {
|
|
48
|
+
type: typeof FCCGroup.InputFCC;
|
|
49
|
+
actions: _piying_valibot_visit.RawConfigAction<"viewRawConfig", unknown, _piying_view_angular_core.AnyCoreSchemaHandle>[];
|
|
50
|
+
};
|
|
51
|
+
password: {
|
|
52
|
+
type: typeof FCCGroup.PasswordInputFCC;
|
|
53
|
+
};
|
|
54
|
+
radio: {
|
|
55
|
+
type: typeof FCCGroup.RadioFCC;
|
|
56
|
+
actions: _piying_valibot_visit.RawConfigAction<"viewRawConfig", unknown, _piying_view_angular_core.AnyCoreSchemaHandle>[];
|
|
57
|
+
};
|
|
58
|
+
range: {
|
|
59
|
+
type: typeof FCCGroup.RangeFCC;
|
|
60
|
+
actions: _piying_valibot_visit.RawConfigAction<"viewRawConfig", unknown, _piying_view_angular_core.AnyCoreSchemaHandle>[];
|
|
61
|
+
};
|
|
62
|
+
rating: {
|
|
63
|
+
type: typeof FCCGroup.RatingFCC;
|
|
64
|
+
};
|
|
65
|
+
select: {
|
|
66
|
+
type: typeof FCCGroup.SelectFCC;
|
|
67
|
+
actions: _piying_valibot_visit.RawConfigAction<"viewRawConfig", unknown, _piying_view_angular_core.AnyCoreSchemaHandle>[];
|
|
68
|
+
};
|
|
69
|
+
picklist: {
|
|
70
|
+
type: typeof FCCGroup.SelectFCC;
|
|
71
|
+
actions: _piying_valibot_visit.RawConfigAction<"viewRawConfig", unknown, _piying_view_angular_core.AnyCoreSchemaHandle>[];
|
|
72
|
+
};
|
|
73
|
+
swap: {
|
|
74
|
+
type: typeof FCCGroup.SwapFCC;
|
|
75
|
+
};
|
|
76
|
+
textarea: {
|
|
77
|
+
type: typeof FCCGroup.TextareaFCC;
|
|
78
|
+
actions: _piying_valibot_visit.RawConfigAction<"viewRawConfig", unknown, _piying_view_angular_core.AnyCoreSchemaHandle>[];
|
|
79
|
+
};
|
|
80
|
+
toggle: {
|
|
81
|
+
type: typeof FCCGroup.ToggleFCC;
|
|
82
|
+
actions: _piying_valibot_visit.RawConfigAction<"viewRawConfig", unknown, _piying_view_angular_core.AnyCoreSchemaHandle>[];
|
|
83
|
+
};
|
|
84
|
+
alert: {
|
|
85
|
+
type: typeof NFCCGroup.AlertNFCC;
|
|
86
|
+
};
|
|
87
|
+
avatar: {
|
|
88
|
+
type: typeof NFCCGroup.AvatarNFCC;
|
|
89
|
+
};
|
|
90
|
+
badge: {
|
|
91
|
+
type: typeof NFCCGroup.BadgeNFCC;
|
|
92
|
+
};
|
|
93
|
+
breadcrumbs: {
|
|
94
|
+
type: typeof NFCCGroup.BreadcrumbsNFCC;
|
|
95
|
+
};
|
|
96
|
+
button: {
|
|
97
|
+
type: typeof NFCCGroup.ButtonNFCC;
|
|
98
|
+
};
|
|
99
|
+
divider: {
|
|
100
|
+
type: typeof NFCCGroup.DividerNFCC;
|
|
101
|
+
};
|
|
102
|
+
dropdown: {
|
|
103
|
+
type: typeof NFCCGroup.DropdownNFCC;
|
|
104
|
+
};
|
|
105
|
+
fab: {
|
|
106
|
+
type: typeof NFCCGroup.FabNFCC;
|
|
107
|
+
};
|
|
108
|
+
'input-button': {
|
|
109
|
+
type: typeof NFCCGroup.InputButtonNFCC;
|
|
110
|
+
};
|
|
111
|
+
kbd: {
|
|
112
|
+
type: typeof NFCCGroup.KbdNFCC;
|
|
113
|
+
};
|
|
114
|
+
loading: {
|
|
115
|
+
type: typeof NFCCGroup.LoadingNFCC;
|
|
116
|
+
};
|
|
117
|
+
progress: {
|
|
118
|
+
type: typeof NFCCGroup.ProgressNFCC;
|
|
119
|
+
};
|
|
120
|
+
'radial-progress': {
|
|
121
|
+
type: typeof NFCCGroup.RadialProgressNFCC;
|
|
122
|
+
};
|
|
123
|
+
stat: {
|
|
124
|
+
type: typeof NFCCGroup.StatNFCC;
|
|
125
|
+
};
|
|
126
|
+
status: {
|
|
127
|
+
type: typeof NFCCGroup.StatusNFCC;
|
|
128
|
+
};
|
|
129
|
+
'theme-controller': {
|
|
130
|
+
type: typeof NFCCGroup.ThemeControllerNFCC;
|
|
131
|
+
};
|
|
132
|
+
accordion: {
|
|
133
|
+
type: typeof FGCGroup.AccordionFGC;
|
|
134
|
+
};
|
|
135
|
+
card: {
|
|
136
|
+
type: typeof FGCGroup.CardFGC;
|
|
137
|
+
};
|
|
138
|
+
carousel: {
|
|
139
|
+
type: typeof FGCGroup.CarouselFGC;
|
|
140
|
+
};
|
|
141
|
+
dock: {
|
|
142
|
+
type: typeof FGCGroup.DockFGC;
|
|
143
|
+
};
|
|
144
|
+
drawer: {
|
|
145
|
+
type: typeof FGCGroup.DrawerFGC;
|
|
146
|
+
};
|
|
147
|
+
list: {
|
|
148
|
+
type: typeof FGCGroup.ListFGC;
|
|
149
|
+
};
|
|
150
|
+
navbar: {
|
|
151
|
+
type: typeof FGCGroup.NavbarFGC;
|
|
152
|
+
};
|
|
153
|
+
steps: {
|
|
154
|
+
type: typeof FGCGroup.StepsFGC;
|
|
155
|
+
};
|
|
156
|
+
tabs: {
|
|
157
|
+
type: typeof FGCGroup.TabsFGC;
|
|
158
|
+
};
|
|
159
|
+
'checkbox-list': {
|
|
160
|
+
type: typeof _piying_lib_angular_daisyui_extension.CheckboxListFGC;
|
|
161
|
+
};
|
|
162
|
+
'editable-group': {
|
|
163
|
+
type: typeof ExtComponentGroup.EditableArrayFGC;
|
|
164
|
+
};
|
|
165
|
+
'list-template': {
|
|
166
|
+
type: typeof _piying_lib_angular_daisyui_extension.ListTemplateNFCC;
|
|
167
|
+
};
|
|
168
|
+
'logic-group': {
|
|
169
|
+
type: typeof _piying_lib_angular_daisyui_extension.logicGroupFGC;
|
|
170
|
+
};
|
|
171
|
+
'menu-tree': {
|
|
172
|
+
type: typeof _piying_lib_angular_daisyui_extension.MenuTreeNFCC;
|
|
173
|
+
};
|
|
174
|
+
'option-list': {
|
|
175
|
+
type: typeof _piying_lib_angular_daisyui_extension.OptionListFCC;
|
|
176
|
+
};
|
|
177
|
+
pagination: {
|
|
178
|
+
type: typeof _piying_lib_angular_daisyui_extension.PaginationNFCC;
|
|
179
|
+
};
|
|
180
|
+
'picker-ref': {
|
|
181
|
+
type: typeof _piying_lib_angular_daisyui_extension.PickerRefFCC;
|
|
182
|
+
};
|
|
183
|
+
table: {
|
|
184
|
+
type: typeof _piying_lib_angular_daisyui_extension.TableNFCC;
|
|
185
|
+
};
|
|
186
|
+
tr: {
|
|
187
|
+
type: typeof _piying_lib_angular_daisyui_extension.TableRowFGC;
|
|
188
|
+
};
|
|
189
|
+
'table-expand-cell': {
|
|
190
|
+
type: typeof _piying_lib_angular_daisyui_extension.TableExpandOneTableCell;
|
|
191
|
+
};
|
|
192
|
+
'router-outlet': {
|
|
193
|
+
type: typeof RouterOutlet;
|
|
194
|
+
};
|
|
195
|
+
object: {
|
|
196
|
+
type: typeof PiyingViewGroup;
|
|
197
|
+
};
|
|
198
|
+
div: {
|
|
199
|
+
type: typeof DivNFCC;
|
|
200
|
+
};
|
|
201
|
+
'common-data': {
|
|
202
|
+
type: typeof StrOrTemplateComponent;
|
|
203
|
+
};
|
|
204
|
+
'filter-option': {
|
|
205
|
+
type: {
|
|
206
|
+
new (): {
|
|
207
|
+
"__#private@#private": any;
|
|
208
|
+
templateRef: _angular_core.Signal<unknown>;
|
|
209
|
+
content: _angular_core.WritableSignal<string>;
|
|
210
|
+
stopKeyboardListen(event: KeyboardEvent): void;
|
|
211
|
+
};
|
|
212
|
+
__version: number;
|
|
213
|
+
ɵfac: _angular_core.ɵɵFactoryDeclaration<{
|
|
214
|
+
"__#private@#private": any;
|
|
215
|
+
templateRef: _angular_core.Signal<unknown>;
|
|
216
|
+
content: _angular_core.WritableSignal<string>;
|
|
217
|
+
stopKeyboardListen(event: KeyboardEvent): void;
|
|
218
|
+
}, never>;
|
|
219
|
+
ɵcmp: _angular_core.ɵɵComponentDeclaration<{
|
|
220
|
+
"__#private@#private": any;
|
|
221
|
+
templateRef: _angular_core.Signal<unknown>;
|
|
222
|
+
content: _angular_core.WritableSignal<string>;
|
|
223
|
+
stopKeyboardListen(event: KeyboardEvent): void;
|
|
224
|
+
}, "app-filter-option", never, {}, {}, never, never, true, never>;
|
|
225
|
+
};
|
|
226
|
+
};
|
|
227
|
+
};
|
|
228
|
+
wrappers: {
|
|
229
|
+
fieldset: {
|
|
230
|
+
type: typeof WCGroup.FieldsetWC;
|
|
231
|
+
};
|
|
232
|
+
form: {
|
|
233
|
+
type: typeof WCGroup.FormWC;
|
|
234
|
+
};
|
|
235
|
+
'label-wrapper': {
|
|
236
|
+
type: typeof WCGroup.LabelWC;
|
|
237
|
+
};
|
|
238
|
+
'loading-wrapper': {
|
|
239
|
+
type: typeof WCGroup.LoadingWC;
|
|
240
|
+
};
|
|
241
|
+
'validate-tooltip-wrapper': {
|
|
242
|
+
type: typeof WCGroup.ValidateTooltipbWC;
|
|
243
|
+
};
|
|
244
|
+
td: {
|
|
245
|
+
type: typeof WCGroup.TdWC;
|
|
246
|
+
};
|
|
247
|
+
th: {
|
|
248
|
+
type: typeof WCGroup.ThWC;
|
|
249
|
+
};
|
|
250
|
+
div: {
|
|
251
|
+
type: typeof DivWC;
|
|
252
|
+
};
|
|
253
|
+
'sort-header': {
|
|
254
|
+
type: typeof _piying_lib_angular_daisyui_extension.SortHeaderWC;
|
|
255
|
+
};
|
|
256
|
+
'table-checkbox-all': {
|
|
257
|
+
type: typeof _piying_lib_angular_daisyui_extension.TableCheckboxAllWC;
|
|
258
|
+
};
|
|
259
|
+
'table-checkbox-body': {
|
|
260
|
+
type: typeof _piying_lib_angular_daisyui_extension.TableCheckboxOneWC;
|
|
261
|
+
};
|
|
262
|
+
'local-filter': {
|
|
263
|
+
type: typeof _piying_lib_angular_daisyui_extension.OptionListLocalFilterWC;
|
|
264
|
+
};
|
|
265
|
+
};
|
|
266
|
+
};
|
|
267
|
+
|
|
268
|
+
export { PresetDefine };
|