@piying-lib/angular-daisyui 1.1.7 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/extension/index.d.ts +163 -11
- package/fesm2022/piying-lib-angular-daisyui-extension.mjs +446 -29
- package/fesm2022/piying-lib-angular-daisyui-extension.mjs.map +1 -1
- package/fesm2022/{piying-lib-angular-daisyui-field-control-props.directive-C5mF89PX.mjs → piying-lib-angular-daisyui-field-control-props.directive-I-MQ3iQV.mjs} +2 -1
- package/fesm2022/piying-lib-angular-daisyui-field-control-props.directive-I-MQ3iQV.mjs.map +1 -0
- package/fesm2022/piying-lib-angular-daisyui-field-control.mjs +218 -17
- package/fesm2022/piying-lib-angular-daisyui-field-control.mjs.map +1 -1
- package/fesm2022/piying-lib-angular-daisyui-field-group.mjs +113 -27
- package/fesm2022/piying-lib-angular-daisyui-field-group.mjs.map +1 -1
- package/fesm2022/piying-lib-angular-daisyui-non-field-control.mjs +147 -9
- package/fesm2022/piying-lib-angular-daisyui-non-field-control.mjs.map +1 -1
- package/fesm2022/piying-lib-angular-daisyui-service.mjs.map +1 -1
- package/fesm2022/piying-lib-angular-daisyui-wrapper.mjs +47 -4
- package/fesm2022/piying-lib-angular-daisyui-wrapper.mjs.map +1 -1
- package/field-control/index.d.ts +162 -10
- package/field-group/index.d.ts +97 -13
- package/non-field-control/index.d.ts +150 -0
- package/package.json +2 -2
- package/preset-css/css/style.css +1 -1
- package/preset-css/css/style.split.css +1 -1
- package/preset-css/json/manifest.json +747 -851
- package/preset-css/ts/accordion.ts +9 -9
- package/preset-css/ts/alert.ts +12 -12
- package/preset-css/ts/avatar.ts +7 -7
- package/preset-css/ts/badge.ts +20 -20
- package/preset-css/ts/breadcrumbs.ts +1 -3
- package/preset-css/ts/browser-mockup.ts +1 -4
- package/preset-css/ts/button.ts +27 -27
- package/preset-css/ts/calendar.ts +1 -5
- package/preset-css/ts/card.ts +15 -15
- package/preset-css/ts/carousel.ts +9 -9
- package/preset-css/ts/chat-bubble.ts +17 -17
- package/preset-css/ts/checkbox.ts +16 -16
- package/preset-css/ts/code-mockup.ts +1 -3
- package/preset-css/ts/collapse.ts +9 -9
- package/preset-css/ts/countdown.ts +1 -3
- package/preset-css/ts/diff.ts +1 -6
- package/preset-css/ts/divider.ts +15 -15
- package/preset-css/ts/dock.ts +10 -10
- package/preset-css/ts/drawer-sidebar.ts +11 -11
- package/preset-css/ts/dropdown.ts +14 -14
- package/preset-css/ts/fab-speed-dial.ts +1 -6
- package/preset-css/ts/fieldset.ts +1 -5
- package/preset-css/ts/file-input.ts +17 -17
- package/preset-css/ts/filter.ts +1 -4
- package/preset-css/ts/footer.ts +7 -7
- package/preset-css/ts/hero.ts +1 -5
- package/preset-css/ts/hover-3-d-card.ts +1 -3
- package/preset-css/ts/hover-gallery.ts +1 -3
- package/preset-css/ts/index.ts +1 -1
- package/preset-css/ts/indicator.ts +10 -10
- package/preset-css/ts/join-group-items.ts +6 -6
- package/preset-css/ts/kbd.ts +1 -8
- package/preset-css/ts/label.ts +1 -4
- package/preset-css/ts/link.ts +12 -12
- package/preset-css/ts/list.ts +1 -6
- package/preset-css/ts/loading.ts +14 -14
- package/preset-css/ts/mask.ts +20 -20
- package/preset-css/ts/menu.ts +17 -17
- package/preset-css/ts/modal.ts +13 -13
- package/preset-css/ts/navbar.ts +1 -6
- package/preset-css/ts/pagination.ts +1 -6
- package/preset-css/ts/phone-mockup.ts +5 -5
- package/preset-css/ts/progress.ts +11 -11
- package/preset-css/ts/radial-progress.ts +1 -3
- package/preset-css/ts/radio.ts +16 -16
- package/preset-css/ts/range-slider.ts +16 -16
- package/preset-css/ts/rating.ts +10 -10
- package/preset-css/ts/select.ts +17 -17
- package/preset-css/ts/skeleton.ts +1 -4
- package/preset-css/ts/stack.ts +1 -7
- package/preset-css/ts/stat.ts +11 -11
- package/preset-css/ts/status.ts +16 -16
- package/preset-css/ts/steps.ts +15 -15
- package/preset-css/ts/swap.ts +9 -9
- package/preset-css/ts/table.ts +11 -11
- package/preset-css/ts/tabs.ts +17 -17
- package/preset-css/ts/text-input.ts +17 -17
- package/preset-css/ts/text-rotate.ts +1 -3
- package/preset-css/ts/textarea.ts +17 -17
- package/preset-css/ts/theme-controller.ts +1 -3
- package/preset-css/ts/timeline.ts +11 -11
- package/preset-css/ts/toast.ts +9 -9
- package/preset-css/ts/toggle.ts +16 -16
- package/preset-css/ts/tooltip.ts +17 -17
- package/preset-css/ts/validator.ts +1 -4
- package/preset-css/ts/window-mockup.ts +1 -3
- package/service/index.d.ts +1 -1
- package/wrapper/index.d.ts +23 -2
- package/fesm2022/piying-lib-angular-daisyui-field-control-props.directive-C5mF89PX.mjs.map +0 -1
|
@@ -4,17 +4,17 @@ import { viewChild, input, inject, computed, Component, model, output, Injection
|
|
|
4
4
|
import { StrOrTemplateComponent, isSchema, computedWithPrev, DefaultOptionConvert, transformOption } from '@piying-lib/angular-core';
|
|
5
5
|
import { CssPrefixPipe, MergeClassPipe, TwPrefixPipe } from '@piying-lib/angular-daisyui/pipe';
|
|
6
6
|
import { ThemeService } from '@piying-lib/angular-daisyui/service';
|
|
7
|
-
import { AttributesDirective, PI_VIEW_FIELD_TOKEN, PiyingViewGroupBase, InsertFieldDirective, BaseControl, PiyingView, PI_INPUT_OPTIONS_TOKEN } from '@piying/view-angular';
|
|
7
|
+
import { AttributesDirective, PI_VIEW_FIELD_TOKEN, PiyingViewGroupBase, InsertFieldDirective, BaseControl, PiyingView, PI_INPUT_OPTIONS_TOKEN, EventsDirective } from '@piying/view-angular';
|
|
8
8
|
import { RouterLink, RouterLinkActive } from '@angular/router';
|
|
9
9
|
import * as i1 from '@angular/material/icon';
|
|
10
|
-
import { MatIconModule
|
|
10
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
11
11
|
import * as i1$1 from '@angular/forms';
|
|
12
12
|
import { FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
13
13
|
import { PurePipe } from '@cyia/ngx-common/pipe';
|
|
14
14
|
import clsx from 'clsx';
|
|
15
15
|
import { SelectorlessOutlet } from '@cyia/ngx-common/directive';
|
|
16
16
|
import * as v from 'valibot';
|
|
17
|
-
import { setComponent, NFCSchema, actions, PI_VIEW_FIELD_TOKEN as PI_VIEW_FIELD_TOKEN$1 } from '@piying/view-angular-core';
|
|
17
|
+
import { setComponent, NFCSchema, actions, PI_VIEW_FIELD_TOKEN as PI_VIEW_FIELD_TOKEN$1, formConfig } from '@piying/view-angular-core';
|
|
18
18
|
import { ThWC, TdWC } from '@piying-lib/angular-daisyui/wrapper';
|
|
19
19
|
import { takeUntilDestroyed, toSignal } from '@angular/core/rxjs-interop';
|
|
20
20
|
import { BehaviorSubject, shareReplay, map, filter, Subject, tap, switchMap, Subscription } from 'rxjs';
|
|
@@ -26,13 +26,28 @@ import { TemplatePortal } from '@angular/cdk/portal';
|
|
|
26
26
|
import { takeWhile } from 'rxjs/operators';
|
|
27
27
|
|
|
28
28
|
const routerLinkActiveOptions = { exact: false };
|
|
29
|
+
/*
|
|
30
|
+
* MenuTreeNFCC - 导航菜单树组件
|
|
31
|
+
*
|
|
32
|
+
* 用途: 用于显示具有层级结构的导航菜单,支持多种导航项类型(basic/divider/group)
|
|
33
|
+
* 特性:
|
|
34
|
+
* - 支持横向和纵向布局
|
|
35
|
+
* - 支持不同尺寸显示
|
|
36
|
+
* - 可自定义菜单项模板
|
|
37
|
+
* - 集成 Angular Router,支持路由激活状态显示
|
|
38
|
+
*
|
|
39
|
+
* 使用场景: 侧边栏导航、顶部导航菜单等需要层级结构的导航场景
|
|
40
|
+
*/
|
|
29
41
|
class MenuTreeNFCC {
|
|
30
42
|
static __version = 2;
|
|
31
43
|
routerLinkActiveOptions = routerLinkActiveOptions;
|
|
32
44
|
StrOrTemplateComponent = StrOrTemplateComponent;
|
|
33
45
|
templateRef = viewChild.required('templateRef');
|
|
46
|
+
/** 菜单项列表 */
|
|
34
47
|
list = input([], ...(ngDevMode ? [{ debugName: "list" }] : []));
|
|
48
|
+
/** 尺寸大小 */
|
|
35
49
|
size = input(...(ngDevMode ? [undefined, { debugName: "size" }] : []));
|
|
50
|
+
/** 方向 */
|
|
36
51
|
direction = input(...(ngDevMode ? [undefined, { debugName: "direction" }] : []));
|
|
37
52
|
#theme = inject(ThemeService);
|
|
38
53
|
wrapperClass$ = computed(() => {
|
|
@@ -71,12 +86,27 @@ const SubsetMatchOptions = {
|
|
|
71
86
|
function goPage(value) {
|
|
72
87
|
return { type: 'go', value };
|
|
73
88
|
}
|
|
89
|
+
/*
|
|
90
|
+
* PaginationNFCC - 分页组件
|
|
91
|
+
*
|
|
92
|
+
* 用途: 用于分页显示大量数据,支持自定义每页条数和跳转页面
|
|
93
|
+
* 特性:
|
|
94
|
+
* - 支持横向和纵向布局
|
|
95
|
+
* - 可配置每页显示条数选项
|
|
96
|
+
* - 支持自定义页码标签
|
|
97
|
+
* - 集成 piying-view 字段系统,自动同步分页属性
|
|
98
|
+
*
|
|
99
|
+
* 使用场景: 数据表格分页、列表分页等需要分页功能的场景
|
|
100
|
+
*/
|
|
74
101
|
class PaginationNFCC {
|
|
75
102
|
static __version = 2;
|
|
76
103
|
StrOrTemplateComponent = StrOrTemplateComponent;
|
|
77
104
|
templateRef = viewChild.required('templateRef');
|
|
105
|
+
/** 方向 */
|
|
78
106
|
direction = input(...(ngDevMode ? [undefined, { debugName: "direction" }] : []));
|
|
107
|
+
/** 每页条数选项 */
|
|
79
108
|
sizeOptions = input(...(ngDevMode ? [undefined, { debugName: "sizeOptions" }] : []));
|
|
109
|
+
/** 每页条数标签函数 */
|
|
80
110
|
optionsLabel = input(...(ngDevMode ? [undefined, { debugName: "optionsLabel" }] : []));
|
|
81
111
|
value = model.required(...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
82
112
|
// todo 临时兼容
|
|
@@ -167,6 +197,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImpo
|
|
|
167
197
|
args: [{ selector: 'app-pagination', imports: [AttributesDirective, PurePipe, FormsModule, MergeClassPipe], template: "<ng-template #templateRef let-attr=\"attributes\">\n <div\n [class]=\"'flex items-center gap-2' | mergeClass: attr()?.class\"\n [attributes]=\"attr()\"\n [excludes]=\"['class']\"\n >\n @if (sizeOptions(); as sizeOptions) {\n <select class=\"select w-20\" [ngModel]=\"value().size\" (ngModelChange)=\"pageSizeChange($event)\">\n @for (item of sizeOptions; track $index) {\n <option [ngValue]=\"item\">\n {{ optionsLabel() ? (optionsLabel()! | pure: item : value().index : count()) : item }}\n </option>\n }\n </select>\n }\n <div [class]=\"wrapperClass$()\">\n <button\n class=\"join-item btn p-0 w-(--size)\"\n [disabled]=\"value().index === 0\"\n (click)=\"gotoPage(0)\"\n >\n \u00AB\n </button>\n @for (item of pageRange$$(); track $index) {\n @if (item.type === 'go') {\n <button\n class=\"join-item btn p-0 w-(--size)\"\n [aria-label]=\"item.value + 1\"\n [class.btn-active]=\"item.value === value().index\"\n (click)=\"gotoPage(item.value)\"\n >\n {{ item.value + 1 }}\n </button>\n } @else if (item.type === 'prev') {\n <button class=\"join-item btn p-0 w-(--size)\" (click)=\"gotoPage(value().index - 5)\">\n <\n </button>\n } @else if (item.type === 'next') {\n <button class=\"join-item btn p-0 w-(--size)\" (click)=\"gotoPage(value().index + 5)\">\n >\n </button>\n }\n }\n <button\n class=\"join-item btn p-0 w-(--size)\"\n [disabled]=\"value().index === maxPageCount$$() - 1\"\n (click)=\"gotoPage(maxPageCount$$() - 1)\"\n >\n \u00BB\n </button>\n </div>\n </div>\n</ng-template>\n" }]
|
|
168
198
|
}], propDecorators: { templateRef: [{ type: i0.ViewChild, args: ['templateRef', { isSignal: true }] }], direction: [{ type: i0.Input, args: [{ isSignal: true, alias: "direction", required: false }] }], sizeOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "sizeOptions", required: false }] }], optionsLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionsLabel", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }, { type: i0.Output, args: ["valueChange"] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }], count: [{ type: i0.Input, args: [{ isSignal: true, alias: "count", required: true }] }] } });
|
|
169
199
|
|
|
200
|
+
/*
|
|
201
|
+
* TableRowFGC - 表格行组件
|
|
202
|
+
*
|
|
203
|
+
* 用途: 作为表格行的容器组件,用于包裹表格行内的字段组
|
|
204
|
+
* 特性:
|
|
205
|
+
* - 作为表格行的基类组件
|
|
206
|
+
* - 支持字段组功能
|
|
207
|
+
*
|
|
208
|
+
* 使用场景: table使用
|
|
209
|
+
*/
|
|
170
210
|
class TableRowFGC extends PiyingViewGroupBase {
|
|
171
211
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: TableRowFGC, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
172
212
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.14", type: TableRowFGC, isStandalone: true, selector: "tr", providers: [], usesInheritance: true, ngImport: i0, template: "@for (field of children$$(); track $index) {\n <ng-container\n *ngTemplateOutlet=\"fieldTemplateRef(); context: { $implicit: field, injector }\"\n ></ng-container>\n}\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: FormsModule }] });
|
|
@@ -194,13 +234,33 @@ function createDefaultColDefineFn(isHeader, content, context) {
|
|
|
194
234
|
},
|
|
195
235
|
}), actions.wrappers.set([{ type: isHeader ? ThWC : TdWC }]));
|
|
196
236
|
}
|
|
237
|
+
/*
|
|
238
|
+
* TableNFCC - 数据表格组件
|
|
239
|
+
*
|
|
240
|
+
* 用途: 用于显示和管理大量结构化数据,支持丰富的列定义和行操作
|
|
241
|
+
* 特性:
|
|
242
|
+
* - 支持表头、表体、表脚三部分的自定义渲染
|
|
243
|
+
* - 支持列组定义,可配置列的显示内容和格式
|
|
244
|
+
* - 支持行展开功能(ExpandOneTableCell)
|
|
245
|
+
* - 集成 piying-view Schema 系统,支持动态数据和验证
|
|
246
|
+
* - 支持排序、状态管理等高级功能
|
|
247
|
+
*
|
|
248
|
+
* 使用场景: 数据列表展示、管理后台、报表等需要表格形式展示数据的场景
|
|
249
|
+
*
|
|
250
|
+
* 核心类型:
|
|
251
|
+
* - ItemCell: 列内容定义(字符串/Schema/函数)
|
|
252
|
+
* - ColumnDefine: 列定义(head/body/foot)
|
|
253
|
+
* - TableItemDefine2: 表格完整定义(行+列)
|
|
254
|
+
*/
|
|
197
255
|
class TableNFCC {
|
|
198
256
|
static __version = 2;
|
|
199
257
|
templateRef = viewChild.required('templateRef');
|
|
200
258
|
#field = inject(PI_VIEW_FIELD_TOKEN$1);
|
|
201
259
|
StrOrTemplateComponent = StrOrTemplateComponent;
|
|
260
|
+
/** 表格定义 */
|
|
202
261
|
define = input(...(ngDevMode ? [undefined, { debugName: "define" }] : []));
|
|
203
262
|
// todo待修改
|
|
263
|
+
/** 数据列表 */
|
|
204
264
|
data = input([], ...(ngDevMode ? [{ debugName: "data" }] : []));
|
|
205
265
|
injector = inject(Injector);
|
|
206
266
|
data$$ = computed(() => {
|
|
@@ -208,12 +268,17 @@ class TableNFCC {
|
|
|
208
268
|
return Array.isArray(data) ? data : data();
|
|
209
269
|
}, ...(ngDevMode ? [{ debugName: "data$$" }] : []));
|
|
210
270
|
#status = inject(TABLE_STATUS_TOKEN, { optional: true });
|
|
271
|
+
/** 是否启用斑马纹效果 */
|
|
211
272
|
zebra = input(...(ngDevMode ? [undefined, { debugName: "zebra" }] : []));
|
|
273
|
+
/** 固定配置 */
|
|
212
274
|
pin = input(...(ngDevMode ? [undefined, { debugName: "pin" }] : []));
|
|
275
|
+
/** 尺寸大小 */
|
|
213
276
|
size = input(...(ngDevMode ? [undefined, { debugName: "size" }] : []));
|
|
277
|
+
/** 跟踪函数 */
|
|
214
278
|
trackBy = input((key, value) => {
|
|
215
279
|
return key;
|
|
216
280
|
}, ...(ngDevMode ? [{ debugName: "trackBy" }] : []));
|
|
281
|
+
/** 分页配置 */
|
|
217
282
|
pagination = input(...(ngDevMode ? [undefined, { debugName: "pagination" }] : []));
|
|
218
283
|
type = input(...(ngDevMode ? [undefined, { debugName: "type" }] : []));
|
|
219
284
|
#theme = inject(ThemeService);
|
|
@@ -361,7 +426,7 @@ class SortService {
|
|
|
361
426
|
this.#direction$.next(data);
|
|
362
427
|
}
|
|
363
428
|
else {
|
|
364
|
-
|
|
429
|
+
const data = this.#direction$.value;
|
|
365
430
|
if (direction === 0) {
|
|
366
431
|
if (key in data) {
|
|
367
432
|
this.#direction$.next({});
|
|
@@ -392,6 +457,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImpo
|
|
|
392
457
|
}] });
|
|
393
458
|
|
|
394
459
|
class inputSortDirective {
|
|
460
|
+
/** 排序键 */
|
|
395
461
|
key = input.required(...(ngDevMode ? [{ debugName: "key" }] : []));
|
|
396
462
|
inputSort = signal(0, ...(ngDevMode ? [{ debugName: "inputSort" }] : []));
|
|
397
463
|
#el = inject(ElementRef).nativeElement;
|
|
@@ -438,6 +504,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImpo
|
|
|
438
504
|
args: ['change']
|
|
439
505
|
}] } });
|
|
440
506
|
|
|
507
|
+
/*
|
|
508
|
+
* SortHeaderWC - 排序列头包装器组件
|
|
509
|
+
*
|
|
510
|
+
* 用途: 用于表格列的排序控制,通常与 Table 组件配合使用
|
|
511
|
+
* 特性:
|
|
512
|
+
* - 显示排序图标和排序状态
|
|
513
|
+
* - 支持点击触发排序
|
|
514
|
+
* - 集成 piying-view 字段系统
|
|
515
|
+
* - 支持通过 props 设置排序 key
|
|
516
|
+
*
|
|
517
|
+
* 使用场景: 表格列需要排序功能时作为列的包装器使用
|
|
518
|
+
*/
|
|
441
519
|
class SortHeaderWC {
|
|
442
520
|
static __version = 2;
|
|
443
521
|
templateRef = viewChild.required('templateRef');
|
|
@@ -447,12 +525,11 @@ class SortHeaderWC {
|
|
|
447
525
|
return this.props$$()['key'];
|
|
448
526
|
}, ...(ngDevMode ? [{ debugName: "key$$" }] : []));
|
|
449
527
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: SortHeaderWC, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
450
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.3.14", type: SortHeaderWC, isStandalone: true, selector: "app-sort-header", viewQueries: [{ propertyName: "templateRef", first: true, predicate: ["templateRef"], descendants: true, isSignal: true }], ngImport: i0, template: "<ng-template #templateRef let-attr=\"attributes\">\n <div class=\"flex items-center\">\n <ng-container insertField></ng-container>\n\n <label\n [class]=\"'swap swap-rotate' | mergeClass: attr()?.class | cssPrefix\"\n [attributes]=\"attr()\"\n [excludes]=\"['class']\"\n >\n <input type=\"checkbox\" inputSort [key]=\"key$$()\" />\n\n <div [class]=\"'swap-indeterminate' | cssPrefix\"></div>\n <div [class]=\"'swap-on' | mergeClass: 'flex' | twPrefix\">\n <
|
|
528
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.3.14", type: SortHeaderWC, isStandalone: true, selector: "app-sort-header", viewQueries: [{ propertyName: "templateRef", first: true, predicate: ["templateRef"], descendants: true, isSignal: true }], ngImport: i0, template: "<ng-template #templateRef let-attr=\"attributes\">\n <div class=\"flex items-center\">\n <ng-container insertField></ng-container>\n\n <label\n [class]=\"'swap swap-rotate' | mergeClass: attr()?.class | cssPrefix\"\n [attributes]=\"attr()\"\n [excludes]=\"['class']\"\n >\n <input type=\"checkbox\" inputSort [key]=\"key$$()\" />\n\n <div [class]=\"'swap-indeterminate' | cssPrefix\"></div>\n <div [class]=\"'swap-on' | mergeClass: 'flex' | twPrefix\">\n <span class=\"material-icons\">arrow_upward</span>\n </div>\n <div [class]=\"'swap-off' | cssPrefix | mergeClass: 'flex' | twPrefix\">\n <span class=\"material-icons\">arrow_downward</span>\n </div>\n </label>\n </div>\n</ng-template>\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: AttributesDirective, selector: "[attributes]", inputs: ["attributes", "excludes"] }, { kind: "directive", type: inputSortDirective, selector: "[inputSort]", inputs: ["key"] }, { kind: "directive", type: InsertFieldDirective, selector: "[insertField]", exportAs: ["insertField"] }, { kind: "pipe", type: CssPrefixPipe, name: "cssPrefix" }, { kind: "pipe", type: MergeClassPipe, name: "mergeClass" }, { kind: "pipe", type: TwPrefixPipe, name: "twPrefix" }] });
|
|
451
529
|
}
|
|
452
530
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: SortHeaderWC, decorators: [{
|
|
453
531
|
type: Component,
|
|
454
532
|
args: [{ selector: 'app-sort-header', imports: [
|
|
455
|
-
MatIcon,
|
|
456
533
|
FormsModule,
|
|
457
534
|
CssPrefixPipe,
|
|
458
535
|
MergeClassPipe,
|
|
@@ -460,7 +537,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImpo
|
|
|
460
537
|
inputSortDirective,
|
|
461
538
|
InsertFieldDirective,
|
|
462
539
|
TwPrefixPipe,
|
|
463
|
-
], template: "<ng-template #templateRef let-attr=\"attributes\">\n <div class=\"flex items-center\">\n <ng-container insertField></ng-container>\n\n <label\n [class]=\"'swap swap-rotate' | mergeClass: attr()?.class | cssPrefix\"\n [attributes]=\"attr()\"\n [excludes]=\"['class']\"\n >\n <input type=\"checkbox\" inputSort [key]=\"key$$()\" />\n\n <div [class]=\"'swap-indeterminate' | cssPrefix\"></div>\n <div [class]=\"'swap-on' | mergeClass: 'flex' | twPrefix\">\n <
|
|
540
|
+
], template: "<ng-template #templateRef let-attr=\"attributes\">\n <div class=\"flex items-center\">\n <ng-container insertField></ng-container>\n\n <label\n [class]=\"'swap swap-rotate' | mergeClass: attr()?.class | cssPrefix\"\n [attributes]=\"attr()\"\n [excludes]=\"['class']\"\n >\n <input type=\"checkbox\" inputSort [key]=\"key$$()\" />\n\n <div [class]=\"'swap-indeterminate' | cssPrefix\"></div>\n <div [class]=\"'swap-on' | mergeClass: 'flex' | twPrefix\">\n <span class=\"material-icons\">arrow_upward</span>\n </div>\n <div [class]=\"'swap-off' | cssPrefix | mergeClass: 'flex' | twPrefix\">\n <span class=\"material-icons\">arrow_downward</span>\n </div>\n </label>\n </div>\n</ng-template>\n" }]
|
|
464
541
|
}], propDecorators: { templateRef: [{ type: i0.ViewChild, args: ['templateRef', { isSignal: true }] }] } });
|
|
465
542
|
|
|
466
543
|
const defaultKey = 'default';
|
|
@@ -474,7 +551,7 @@ class CheckboxService {
|
|
|
474
551
|
#defaultDataBind(dataChangeClear = false) {
|
|
475
552
|
effect(() => {
|
|
476
553
|
const data1 = this.#data$$();
|
|
477
|
-
|
|
554
|
+
const data2 = Array.isArray(data1) ? data1 : data1?.();
|
|
478
555
|
untracked(() => {
|
|
479
556
|
this.setAllList(() => {
|
|
480
557
|
return data2;
|
|
@@ -524,7 +601,7 @@ class CheckboxService {
|
|
|
524
601
|
selectAll(checked, key = defaultKey) {
|
|
525
602
|
const list = this.#fn();
|
|
526
603
|
const result = this.#selectModelMap.get(key);
|
|
527
|
-
|
|
604
|
+
const event$ = this.#allEvent.get(key);
|
|
528
605
|
if (checked) {
|
|
529
606
|
list.forEach((item) => {
|
|
530
607
|
result.select(item);
|
|
@@ -536,7 +613,7 @@ class CheckboxService {
|
|
|
536
613
|
event$.next(checked);
|
|
537
614
|
}
|
|
538
615
|
listenAllSelect(key = defaultKey) {
|
|
539
|
-
|
|
616
|
+
const result = this.#allEvent.get(key);
|
|
540
617
|
if (!result) {
|
|
541
618
|
throw new Error('CheckboxService not call init');
|
|
542
619
|
}
|
|
@@ -560,6 +637,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImpo
|
|
|
560
637
|
type: Injectable
|
|
561
638
|
}] });
|
|
562
639
|
|
|
640
|
+
/*
|
|
641
|
+
* TableCheckboxAllWC - 表格全选复选框包装器组件
|
|
642
|
+
*
|
|
643
|
+
* 用途: 用于表格的全选功能,控制所有行的选中状态
|
|
644
|
+
* 特性:
|
|
645
|
+
* - 显示全选/取消全选按钮
|
|
646
|
+
* - 同步表格行的选中状态
|
|
647
|
+
* - 集成 CheckboxService 进行状态管理
|
|
648
|
+
* - 集成 piying-view 字段系统
|
|
649
|
+
*
|
|
650
|
+
* 使用场景: 表格需要批量操作时,用于控制所有行的选中状态
|
|
651
|
+
*/
|
|
563
652
|
class TableCheckboxAllWC {
|
|
564
653
|
field$$ = inject(PI_VIEW_FIELD_TOKEN);
|
|
565
654
|
props$$ = computed(() => this.field$$().props(), ...(ngDevMode ? [{ debugName: "props$$" }] : []));
|
|
@@ -587,6 +676,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImpo
|
|
|
587
676
|
args: [{ selector: 'app-table-checkbox-all', imports: [InsertFieldDirective], template: "<ng-template #templateRef let-attr=\"attributes\">\n <ng-container insertField></ng-container>\n</ng-template>\n" }]
|
|
588
677
|
}], ctorParameters: () => [], propDecorators: { templateRef: [{ type: i0.ViewChild, args: ['templateRef', { isSignal: true }] }] } });
|
|
589
678
|
|
|
679
|
+
/*
|
|
680
|
+
* TableCheckboxOneWC - 表格单选复选框包装器组件
|
|
681
|
+
*
|
|
682
|
+
* 用途: 用于表格单行的复选框控制,管理单行的选中状态
|
|
683
|
+
* 特性:
|
|
684
|
+
* - 显示单行的复选框
|
|
685
|
+
* - 同步单行的选中状态到服务
|
|
686
|
+
* - 集成 CheckboxService 进行状态管理
|
|
687
|
+
* - 集成 piying-view 字段系统
|
|
688
|
+
*
|
|
689
|
+
* 使用场景: 表格需要批量操作时,用于控制单行的选中状态
|
|
690
|
+
*/
|
|
590
691
|
class TableCheckboxOneWC {
|
|
591
692
|
static __version = 2;
|
|
592
693
|
templateRef = viewChild.required('templateRef');
|
|
@@ -681,7 +782,7 @@ class TableResourceService {
|
|
|
681
782
|
#data$ = resource({
|
|
682
783
|
params: computed(() => {
|
|
683
784
|
const params = this.#queryParams$();
|
|
684
|
-
|
|
785
|
+
const requestFn = this.#requestFn$();
|
|
685
786
|
return {
|
|
686
787
|
requestFn,
|
|
687
788
|
params,
|
|
@@ -689,7 +790,7 @@ class TableResourceService {
|
|
|
689
790
|
};
|
|
690
791
|
}),
|
|
691
792
|
loader: async (res) => {
|
|
692
|
-
|
|
793
|
+
const needUpdate = res.params.index !== this.#preUpdateIndex$();
|
|
693
794
|
if (needUpdate) {
|
|
694
795
|
this.#preUpdateIndex$.set(res.params.index);
|
|
695
796
|
}
|
|
@@ -731,6 +832,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImpo
|
|
|
731
832
|
type: Injectable
|
|
732
833
|
}] });
|
|
733
834
|
|
|
835
|
+
/*
|
|
836
|
+
* TableExpandOneTableCell - 表格行展开单元格组件
|
|
837
|
+
*
|
|
838
|
+
* 用途: 用于表格行的展开控制,显示和控制行的展开状态
|
|
839
|
+
* 特性:
|
|
840
|
+
* - 显示展开/收起按钮
|
|
841
|
+
* - 控制行的展开状态
|
|
842
|
+
* - 集成 TableExpandService 进行状态管理
|
|
843
|
+
* - 集成 piying-view 字段系统
|
|
844
|
+
*
|
|
845
|
+
* 使用场景: 表格行需要展开显示详细信息的场景
|
|
846
|
+
*/
|
|
734
847
|
class TableExpandOneTableCell {
|
|
735
848
|
static __version = 2;
|
|
736
849
|
templateRef = viewChild.required('templateRef');
|
|
@@ -749,11 +862,11 @@ class TableExpandOneTableCell {
|
|
|
749
862
|
this.#service.toggleExpand(this.field$$().context['item$']());
|
|
750
863
|
}
|
|
751
864
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: TableExpandOneTableCell, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
752
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.14", type: TableExpandOneTableCell, isStandalone: true, selector: "app-table-expand-cell", viewQueries: [{ propertyName: "templateRef", first: true, predicate: ["templateRef"], descendants: true, isSignal: true }], ngImport: i0, template: "<ng-template #templateRef let-attr=\"attributes\">\n <
|
|
865
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.14", type: TableExpandOneTableCell, isStandalone: true, selector: "app-table-expand-cell", viewQueries: [{ propertyName: "templateRef", first: true, predicate: ["templateRef"], descendants: true, isSignal: true }], ngImport: i0, template: "<ng-template #templateRef let-attr=\"attributes\">\n <span\n [class]=\"'material-icons cursor-pointer' | mergeClass: attr()?.class\"\n [attributes]=\"attr()\"\n [excludes]=\"['class']\"\n (click)=\"toggle()\"\n >\n @if (isExpand$$()) {\n keyboard_arrow_up\n } @else {\n keyboard_arrow_down\n }\n </span>\n</ng-template>\n", dependencies: [{ kind: "directive", type: AttributesDirective, selector: "[attributes]", inputs: ["attributes", "excludes"] }, { kind: "pipe", type: MergeClassPipe, name: "mergeClass" }] });
|
|
753
866
|
}
|
|
754
867
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: TableExpandOneTableCell, decorators: [{
|
|
755
868
|
type: Component,
|
|
756
|
-
args: [{ selector: 'app-table-expand-cell', imports: [
|
|
869
|
+
args: [{ selector: 'app-table-expand-cell', imports: [MergeClassPipe, AttributesDirective], template: "<ng-template #templateRef let-attr=\"attributes\">\n <span\n [class]=\"'material-icons cursor-pointer' | mergeClass: attr()?.class\"\n [attributes]=\"attr()\"\n [excludes]=\"['class']\"\n (click)=\"toggle()\"\n >\n @if (isExpand$$()) {\n keyboard_arrow_up\n } @else {\n keyboard_arrow_down\n }\n </span>\n</ng-template>\n" }]
|
|
757
870
|
}], propDecorators: { templateRef: [{ type: i0.ViewChild, args: ['templateRef', { isSignal: true }] }] } });
|
|
758
871
|
|
|
759
872
|
/**
|
|
@@ -836,34 +949,36 @@ class CdkConnectedOverlay {
|
|
|
836
949
|
_position;
|
|
837
950
|
_scrollStrategyFactory = inject(CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY);
|
|
838
951
|
_ngZone = inject(NgZone);
|
|
839
|
-
/**
|
|
952
|
+
/** 弹窗触发原点 */
|
|
840
953
|
origin = input.required(...(ngDevMode ? [{ debugName: "origin" }] : []));
|
|
841
|
-
/**
|
|
954
|
+
/** 已注册的连接位置对 */
|
|
842
955
|
positions = input(...(ngDevMode ? [undefined, { debugName: "positions" }] : []));
|
|
843
956
|
positions$$ = computed(() => {
|
|
844
957
|
const pos = this.positions();
|
|
845
958
|
return pos && pos.length ? pos : defaultPositionList;
|
|
846
959
|
}, ...(ngDevMode ? [{ debugName: "positions$$" }] : []));
|
|
847
|
-
/**
|
|
960
|
+
/** 弹窗连接点相对于原点的 x 轴偏移量(像素) */
|
|
848
961
|
offsetX = input(...(ngDevMode ? [undefined, { debugName: "offsetX" }] : []));
|
|
849
|
-
/**
|
|
962
|
+
/** 弹窗连接点相对于原点的 y 轴偏移量(像素) */
|
|
850
963
|
offsetY = input(...(ngDevMode ? [undefined, { debugName: "offsetY" }] : []));
|
|
964
|
+
/** 弹窗配置 */
|
|
851
965
|
overlayConfig = input(...(ngDevMode ? [undefined, { debugName: "overlayConfig" }] : []));
|
|
852
|
-
/**
|
|
966
|
+
/** 弹窗与视口边缘之间的间距(像素) */
|
|
853
967
|
viewportMargin = input(0, ...(ngDevMode ? [{ debugName: "viewportMargin" }] : []));
|
|
854
968
|
open = model(false, ...(ngDevMode ? [{ debugName: "open" }] : []));
|
|
855
|
-
/**
|
|
969
|
+
/** 是否可以通过用户交互关闭弹窗 */
|
|
856
970
|
disableClose = input(false, ...(ngDevMode ? [{ debugName: "disableClose" }] : []));
|
|
857
|
-
/**
|
|
971
|
+
/** 用于设置 transform origin 的 CSS 选择器 */
|
|
858
972
|
transformOriginSelector = input(...(ngDevMode ? [undefined, { debugName: "transformOriginSelector" }] : []));
|
|
859
|
-
/**
|
|
973
|
+
/** 滚动时是否锁定弹窗位置 */
|
|
860
974
|
lockPosition = input(false, ...(ngDevMode ? [{ debugName: "lockPosition" }] : []));
|
|
861
|
-
/**
|
|
975
|
+
/** 弹窗的宽高是否可以被约束以适应视口 */
|
|
862
976
|
flexibleDimensions = input(false, ...(ngDevMode ? [{ debugName: "flexibleDimensions" }] : []));
|
|
863
|
-
/**
|
|
977
|
+
/** 在启用灵活定位后,弹窗是否可以在首次打开后增长 */
|
|
864
978
|
growAfterOpen = input(false, ...(ngDevMode ? [{ debugName: "growAfterOpen" }] : []));
|
|
865
|
-
/**
|
|
979
|
+
/** 如果提供的位置都不合适,弹窗是否可以被推到屏幕上 */
|
|
866
980
|
push = input(false, ...(ngDevMode ? [{ debugName: "push" }] : []));
|
|
981
|
+
/** 弹窗宽度是否与原点宽度匹配 */
|
|
867
982
|
matchWidth = input(false, ...(ngDevMode ? [{ debugName: "matchWidth" }] : []));
|
|
868
983
|
/** Event emitted when the backdrop is clicked. */
|
|
869
984
|
backdropClick = new EventEmitter();
|
|
@@ -1088,16 +1203,33 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImpo
|
|
|
1088
1203
|
type: Output
|
|
1089
1204
|
}] } });
|
|
1090
1205
|
|
|
1206
|
+
/*
|
|
1207
|
+
* PickerRefFCC - 选择器引用组件
|
|
1208
|
+
*
|
|
1209
|
+
* 用途: 用于触发选择器弹窗,支持自定义触发器和内容区域
|
|
1210
|
+
* 特性:
|
|
1211
|
+
* - 支持自定义触发器内容(trigger)
|
|
1212
|
+
* - 支持自定义弹窗内容(content)
|
|
1213
|
+
* - 支持选择后自动关闭(changeClose)
|
|
1214
|
+
* - 基于 CDK Overlay 实现弹窗定位
|
|
1215
|
+
* - 实现了 ControlValueAccessor 接口,可直接用于表单
|
|
1216
|
+
*
|
|
1217
|
+
* 使用场景: 选择器、下拉选择、日期时间选择等需要弹窗选择的场景
|
|
1218
|
+
*/
|
|
1091
1219
|
class PickerRefFCC extends BaseControl {
|
|
1092
1220
|
static index = 0;
|
|
1093
1221
|
SelectorlessOutlet = SelectorlessOutlet;
|
|
1094
1222
|
static __version = 2;
|
|
1095
1223
|
templateRef = viewChild.required('templateRef');
|
|
1096
1224
|
PiyingView = PiyingView;
|
|
1225
|
+
/** 触发器内容 */
|
|
1097
1226
|
trigger = input(...(ngDevMode ? [undefined, { debugName: "trigger" }] : []));
|
|
1227
|
+
/** 弹窗内容 */
|
|
1098
1228
|
content = input(...(ngDevMode ? [undefined, { debugName: "content" }] : []));
|
|
1229
|
+
/** 选择后是否自动关闭 */
|
|
1099
1230
|
changeClose = input(...(ngDevMode ? [undefined, { debugName: "changeClose" }] : []));
|
|
1100
1231
|
isOpen$ = signal(false, ...(ngDevMode ? [{ debugName: "isOpen$" }] : []));
|
|
1232
|
+
/** 弹窗配置 */
|
|
1101
1233
|
overlayConfig = input(...(ngDevMode ? [undefined, { debugName: "overlayConfig" }] : []));
|
|
1102
1234
|
position$ = signal('', ...(ngDevMode ? [{ debugName: "position$" }] : []));
|
|
1103
1235
|
parentPyOptions = inject(PI_INPUT_OPTIONS_TOKEN, { optional: true });
|
|
@@ -1167,15 +1299,31 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImpo
|
|
|
1167
1299
|
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-template #templateRef let-attr=\"attributes\">\n <div cdkOverlayOrigin #trigger=\"cdkOverlayOrigin\" [attributes]=\"attr()\" (click)=\"openRef()\">\n <ng-container\n [selectlessOutlet]=\"PiyingView\"\n [selectlessOutletInputs]=\"triggerInput$$()\"\n ></ng-container>\n </div>\n\n <ng-template\n cdkConnectedOverlay\n [origin]=\"trigger\"\n [open]=\"isOpen$()\"\n [overlayConfig]=\"overlayConfig()\"\n (detach)=\"isOpen$.set(false)\"\n (overlayOutsideClick)=\"outsideClick()\"\n >\n <ng-container\n [selectlessOutlet]=\"PiyingView\"\n [selectlessOutletInputs]=\"contentInput$$()\"\n [selectlessOutletOutputs]=\"contentOutput$$()\"\n ></ng-container>\n </ng-template>\n</ng-template>\n" }]
|
|
1168
1300
|
}], propDecorators: { templateRef: [{ type: i0.ViewChild, args: ['templateRef', { isSignal: true }] }], trigger: [{ type: i0.Input, args: [{ isSignal: true, alias: "trigger", required: false }] }], content: [{ type: i0.Input, args: [{ isSignal: true, alias: "content", required: false }] }], changeClose: [{ type: i0.Input, args: [{ isSignal: true, alias: "changeClose", required: false }] }], overlayConfig: [{ type: i0.Input, args: [{ isSignal: true, alias: "overlayConfig", required: false }] }] } });
|
|
1169
1301
|
|
|
1302
|
+
/*
|
|
1303
|
+
* OptionListFCC - 选项列表组件
|
|
1304
|
+
*
|
|
1305
|
+
* 用途: 用于显示可选择的选项列表,支持自定义选项模板和转换规则
|
|
1306
|
+
* 特性:
|
|
1307
|
+
* - 支持动态选项数据(options)
|
|
1308
|
+
* - 支持自定义选项模板(optionTemplate)
|
|
1309
|
+
* - 支持选项转换器(optionConvert)
|
|
1310
|
+
* - 实现了 ControlValueAccessor 接口,可直接用于表单
|
|
1311
|
+
* - 集成 piying-view 字段系统
|
|
1312
|
+
*
|
|
1313
|
+
* 使用场景: 下拉选择、单选列表、选项选择等需要选项列表的场景
|
|
1314
|
+
*/
|
|
1170
1315
|
class OptionListFCC extends BaseControl {
|
|
1171
1316
|
static __version = 2;
|
|
1172
1317
|
StrOrTemplateComponent = StrOrTemplateComponent;
|
|
1173
1318
|
PiyingView = PiyingView;
|
|
1174
1319
|
templateRef = viewChild.required('templateRef');
|
|
1320
|
+
/** 选项列表 */
|
|
1175
1321
|
options = input([], ...(ngDevMode ? [{ debugName: "options", transform: (input) => input ?? [] }] : [{
|
|
1176
1322
|
transform: (input) => input ?? [],
|
|
1177
1323
|
}]));
|
|
1324
|
+
/** 选项模板 */
|
|
1178
1325
|
optionTemplate = input(...(ngDevMode ? [undefined, { debugName: "optionTemplate" }] : []));
|
|
1326
|
+
/** 选项转换器 */
|
|
1179
1327
|
optionConvert = input(DefaultOptionConvert, ...(ngDevMode ? [{ debugName: "optionConvert", transform: (input) => ({ ...DefaultOptionConvert, ...input }) }] : [{
|
|
1180
1328
|
transform: (input) => ({ ...DefaultOptionConvert, ...input }),
|
|
1181
1329
|
}]));
|
|
@@ -1222,12 +1370,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImpo
|
|
|
1222
1370
|
], template: "<ng-template #liGroup let-item>\n <!-- todo open\u6D4B\u8BD5 -->\n <details open>\n <summary>{{ item.label }}</summary>\n <ul>\n @for (child of item.children; track $index) {\n <ng-container\n *ngTemplateOutlet=\"itemTemplate; context: { $implicit: child }\"\n ></ng-container>\n }\n </ul>\n </details>\n</ng-template>\n<ng-template #itemTemplate let-option>\n @let rOption = transformOption | pure: option : optionConvert();\n @let template = optionTemplate()?.[rOption.type];\n @if (template) {\n <ng-container\n [selectlessOutlet]=\"PiyingView\"\n [selectlessOutletInputs]=\"getInput$$ | pure: template\"\n ></ng-container>\n } @else if (rOption.type === 'option') {\n <li (click)=\"selectOption(rOption)\">\n <button [class]=\"activateClass | pure: rOption.value : value$()\">\n <ng-template\n [selectlessOutlet]=\"StrOrTemplateComponent\"\n [selectlessOutletInputs]=\"optionInput | pure: rOption.label\"\n ></ng-template>\n </button>\n </li>\n } @else if (rOption.type === 'group') {\n <li>\n <details open>\n <summary>\n <ng-template\n [selectlessOutlet]=\"StrOrTemplateComponent\"\n [selectlessOutletInputs]=\"optionInput | pure: rOption.label\"\n ></ng-template>\n </summary>\n <ul>\n @for (child of rOption.children; track $index) {\n <ng-container\n *ngTemplateOutlet=\"itemTemplate; context: { $implicit: child }\"\n ></ng-container>\n }\n </ul>\n </details>\n </li>\n }\n</ng-template>\n\n<ng-template #templateRef let-attr=\"attributes\">\n <ul class=\"menu\">\n @for (option of options(); track $index) {\n <ng-container *ngTemplateOutlet=\"itemTemplate; context: { $implicit: option }\"></ng-container>\n }\n </ul>\n</ng-template>\n" }]
|
|
1223
1371
|
}], propDecorators: { templateRef: [{ type: i0.ViewChild, args: ['templateRef', { isSignal: true }] }], 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 }] }] } });
|
|
1224
1372
|
|
|
1373
|
+
/*
|
|
1374
|
+
* ListTemplateNFCC - 列表模板组件
|
|
1375
|
+
*
|
|
1376
|
+
* 用途: 用于基于模板渲染列表数据,支持动态上下文传递
|
|
1377
|
+
* 特性:
|
|
1378
|
+
* - 支持自定义模板(template)
|
|
1379
|
+
* - 支持列表数据渲染(list)
|
|
1380
|
+
* - 支持传递父级和项的上下文信息
|
|
1381
|
+
* - 集成 piying-view 字段系统
|
|
1382
|
+
*
|
|
1383
|
+
* 使用场景: 动态列表渲染、模板化列表展示等需要基于模板渲染列表的场景
|
|
1384
|
+
*/
|
|
1225
1385
|
class ListTemplateNFCC {
|
|
1226
1386
|
static __version = 2;
|
|
1227
1387
|
StrOrTemplateComponent = StrOrTemplateComponent;
|
|
1228
1388
|
PiyingView = PiyingView;
|
|
1229
1389
|
templateRef = viewChild.required('templateRef');
|
|
1390
|
+
/** 模板 */
|
|
1230
1391
|
template = input.required(...(ngDevMode ? [{ debugName: "template" }] : []));
|
|
1392
|
+
/** 列表数据 */
|
|
1231
1393
|
list = input([], ...(ngDevMode ? [{ debugName: "list" }] : []));
|
|
1232
1394
|
parentPyOptions = inject(PI_INPUT_OPTIONS_TOKEN, { optional: true });
|
|
1233
1395
|
field = inject(PI_VIEW_FIELD_TOKEN);
|
|
@@ -1246,15 +1408,243 @@ class ListTemplateNFCC {
|
|
|
1246
1408
|
};
|
|
1247
1409
|
};
|
|
1248
1410
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: ListTemplateNFCC, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1249
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.14", type: ListTemplateNFCC, isStandalone: true, selector: "app-list-template", inputs: { template: { classPropertyName: "template", publicName: "template", isSignal: true, isRequired: true, transformFunction: null }, list: { classPropertyName: "list", publicName: "list", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "templateRef", first: true, predicate: ["templateRef"], descendants: true, isSignal: true }], ngImport: i0, template: "<ng-template #templateRef let-attr=\"attributes\">\n @for (child of list(); track $index) {\n <ng-container\n [selectlessOutlet]=\"PiyingView\"\n [selectlessOutletInputs]=\"templateInput$$ | pure: child\"\n ></ng-container>\n }\n</ng-template>\n", dependencies: [{ kind: "directive", type: SelectorlessOutlet, selector: "[selectlessOutlet]", inputs: ["selectlessOutlet", "selectlessOutletInputs", "selectlessOutletOutputs", "selectlessOutletDirectives", "selectlessOutletInjector", "selectlessOutletEnvironmentInjector"], exportAs: ["selectlessOutlet"] }, { kind: "
|
|
1411
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.14", type: ListTemplateNFCC, isStandalone: true, selector: "app-list-template", inputs: { template: { classPropertyName: "template", publicName: "template", isSignal: true, isRequired: true, transformFunction: null }, list: { classPropertyName: "list", publicName: "list", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "templateRef", first: true, predicate: ["templateRef"], descendants: true, isSignal: true }], ngImport: i0, template: "<ng-template #templateRef let-attr=\"attributes\">\n @for (child of list(); track $index) {\n <ng-container\n [selectlessOutlet]=\"PiyingView\"\n [selectlessOutletInputs]=\"templateInput$$ | pure: child\"\n ></ng-container>\n }\n</ng-template>\n", dependencies: [{ kind: "directive", type: SelectorlessOutlet, selector: "[selectlessOutlet]", inputs: ["selectlessOutlet", "selectlessOutletInputs", "selectlessOutletOutputs", "selectlessOutletDirectives", "selectlessOutletInjector", "selectlessOutletEnvironmentInjector"], exportAs: ["selectlessOutlet"] }, { kind: "pipe", type: PurePipe, name: "pure" }] });
|
|
1250
1412
|
}
|
|
1251
1413
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: ListTemplateNFCC, decorators: [{
|
|
1252
1414
|
type: Component,
|
|
1253
|
-
args: [{ selector: 'app-list-template', imports: [SelectorlessOutlet,
|
|
1415
|
+
args: [{ selector: 'app-list-template', imports: [SelectorlessOutlet, PurePipe], template: "<ng-template #templateRef let-attr=\"attributes\">\n @for (child of list(); track $index) {\n <ng-container\n [selectlessOutlet]=\"PiyingView\"\n [selectlessOutletInputs]=\"templateInput$$ | pure: child\"\n ></ng-container>\n }\n</ng-template>\n" }]
|
|
1254
1416
|
}], propDecorators: { templateRef: [{ type: i0.ViewChild, args: ['templateRef', { isSignal: true }] }], template: [{ type: i0.Input, args: [{ isSignal: true, alias: "template", required: true }] }], list: [{ type: i0.Input, args: [{ isSignal: true, alias: "list", required: false }] }] } });
|
|
1255
1417
|
|
|
1418
|
+
/*
|
|
1419
|
+
* EditableGroupFGC - 可编辑组组件
|
|
1420
|
+
*
|
|
1421
|
+
* 用途: 用于动态管理可增删的组数据,支持键值对和单值两种模式
|
|
1422
|
+
* 特性:
|
|
1423
|
+
* - 支持添加和删除组项
|
|
1424
|
+
* - 支持横向和纵向布局
|
|
1425
|
+
* - 支持设置最小长度限制
|
|
1426
|
+
* - 支持自定义新增项的初始值
|
|
1427
|
+
* - 支持键值对模式(通过 groupKeySchema)
|
|
1428
|
+
* - 集成 piying-view 字段系统
|
|
1429
|
+
*
|
|
1430
|
+
* 使用场景: 动态表单项、可增删的数据组、键值对列表等需要动态管理组数据的场景
|
|
1431
|
+
*/
|
|
1432
|
+
class EditableGroupFGC extends PiyingViewGroupBase {
|
|
1433
|
+
static __version = 2;
|
|
1434
|
+
templateRef = viewChild.required('templateRef');
|
|
1435
|
+
PiyingView = PiyingView;
|
|
1436
|
+
/** 布局方式 */
|
|
1437
|
+
layout = input('row', ...(ngDevMode ? [{ debugName: "layout" }] : []));
|
|
1438
|
+
/** 是否禁用添加 */
|
|
1439
|
+
disableAdd = input(false, ...(ngDevMode ? [{ debugName: "disableAdd" }] : []));
|
|
1440
|
+
/** 添加模式 */
|
|
1441
|
+
addMode = input(0, ...(ngDevMode ? [{ debugName: "addMode" }] : []));
|
|
1442
|
+
/** 是否禁用删除 */
|
|
1443
|
+
disableRemove = input(false, ...(ngDevMode ? [{ debugName: "disableRemove" }] : []));
|
|
1444
|
+
/** 添加位置 */
|
|
1445
|
+
addPosition = input('bottom', ...(ngDevMode ? [{ debugName: "addPosition" }] : []));
|
|
1446
|
+
/** 初始值生成函数 */
|
|
1447
|
+
initValue = input(...(ngDevMode ? [undefined, { debugName: "initValue" }] : []));
|
|
1448
|
+
/** 最小长度 */
|
|
1449
|
+
minLength = input(0, ...(ngDevMode ? [{ debugName: "minLength" }] : []));
|
|
1450
|
+
isRecord$$ = computed(() => {
|
|
1451
|
+
return !!this.field$$().form.control.config$().groupKeySchema;
|
|
1452
|
+
}, ...(ngDevMode ? [{ debugName: "isRecord$$" }] : []));
|
|
1453
|
+
wrapperClass$$ = computed(() => {
|
|
1454
|
+
return this.layout() === 'row' ? 'flex gap-2 items-center' : 'flex flex-col gap-2';
|
|
1455
|
+
}, ...(ngDevMode ? [{ debugName: "wrapperClass$$" }] : []));
|
|
1456
|
+
parentPyOptions = inject(PI_INPUT_OPTIONS_TOKEN, { optional: true });
|
|
1457
|
+
#keySchema$$ = computed(() => {
|
|
1458
|
+
return this.field$$().form.control.config$().groupKeySchema;
|
|
1459
|
+
}, ...(ngDevMode ? [{ debugName: "#keySchema$$" }] : []));
|
|
1460
|
+
#valueSchema$$ = computed(() => {
|
|
1461
|
+
return this.field$$().form.control.config$().groupValueSchema;
|
|
1462
|
+
}, ...(ngDevMode ? [{ debugName: "#valueSchema$$" }] : []));
|
|
1463
|
+
keySchemaOptions$$ = computed(() => {
|
|
1464
|
+
return {
|
|
1465
|
+
schema: this.#keySchema$$(),
|
|
1466
|
+
options: {
|
|
1467
|
+
...this.parentPyOptions(),
|
|
1468
|
+
context: {
|
|
1469
|
+
...this.parentPyOptions().context,
|
|
1470
|
+
parent: this.parentPyOptions().context,
|
|
1471
|
+
parentField: this.field$$(),
|
|
1472
|
+
},
|
|
1473
|
+
},
|
|
1474
|
+
selectorless: true,
|
|
1475
|
+
};
|
|
1476
|
+
}, ...(ngDevMode ? [{ debugName: "keySchemaOptions$$" }] : []));
|
|
1477
|
+
valueSchemaOptions$$ = computed(() => {
|
|
1478
|
+
return {
|
|
1479
|
+
schema: this.#valueSchema$$(),
|
|
1480
|
+
options: {
|
|
1481
|
+
...this.parentPyOptions(),
|
|
1482
|
+
context: {
|
|
1483
|
+
...this.parentPyOptions().context,
|
|
1484
|
+
parent: this.parentPyOptions().context,
|
|
1485
|
+
parentField: this.field$$(),
|
|
1486
|
+
},
|
|
1487
|
+
},
|
|
1488
|
+
selectorless: true,
|
|
1489
|
+
};
|
|
1490
|
+
}, ...(ngDevMode ? [{ debugName: "valueSchemaOptions$$" }] : []));
|
|
1491
|
+
addNewInputs = (input, newValueFn, model) => {
|
|
1492
|
+
return {
|
|
1493
|
+
...input,
|
|
1494
|
+
model: newValueFn?.(model),
|
|
1495
|
+
};
|
|
1496
|
+
};
|
|
1497
|
+
addNew(newValue, newKey) {
|
|
1498
|
+
if (newKey && newValue) {
|
|
1499
|
+
const keyForm = newKey.componentInstance.form$$();
|
|
1500
|
+
const valueForm = newValue.componentInstance.form$$();
|
|
1501
|
+
this.field$$().action.set(valueForm.value, keyForm.value);
|
|
1502
|
+
keyForm.reset();
|
|
1503
|
+
valueForm.reset();
|
|
1504
|
+
}
|
|
1505
|
+
else if (newValue) {
|
|
1506
|
+
const form = newValue.componentInstance.form$$();
|
|
1507
|
+
this.field$$().action.set(form.value);
|
|
1508
|
+
form.reset();
|
|
1509
|
+
}
|
|
1510
|
+
else {
|
|
1511
|
+
const index = this.field$$().children().length;
|
|
1512
|
+
this.field$$().action.set(this.initValue()?.(index), index);
|
|
1513
|
+
}
|
|
1514
|
+
}
|
|
1515
|
+
removeItem(key) {
|
|
1516
|
+
this.field$$().action.remove(key);
|
|
1517
|
+
}
|
|
1518
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: EditableGroupFGC, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1519
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.14", type: EditableGroupFGC, isStandalone: true, selector: "app-editable-group", inputs: { layout: { classPropertyName: "layout", publicName: "layout", isSignal: true, isRequired: false, transformFunction: null }, disableAdd: { classPropertyName: "disableAdd", publicName: "disableAdd", isSignal: true, isRequired: false, transformFunction: null }, addMode: { classPropertyName: "addMode", publicName: "addMode", isSignal: true, isRequired: false, transformFunction: null }, disableRemove: { classPropertyName: "disableRemove", publicName: "disableRemove", isSignal: true, isRequired: false, transformFunction: null }, addPosition: { classPropertyName: "addPosition", publicName: "addPosition", isSignal: true, isRequired: false, transformFunction: null }, initValue: { classPropertyName: "initValue", publicName: "initValue", isSignal: true, isRequired: false, transformFunction: null }, minLength: { classPropertyName: "minLength", publicName: "minLength", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "templateRef", first: true, predicate: ["templateRef"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<ng-template #templateRef let-attr=\"attributes\" let-events=\"events\">\n <div\n [class]=\"wrapperClass$$() | cssPrefix | mergeClass: attr()?.class\"\n [attributes]=\"attr()\"\n [excludes]=\"['class']\"\n [events]=\"events()\"\n >\n @let children = children$$();\n <ng-template #addTemplate>\n @if (!disableAdd()) {\n @if (isRecord$$()) {\n <div class=\"flex items-center gap-2\">\n <div class=\"flex-1 flex items-center gap-2\">\n <ng-container\n [selectlessOutlet]=\"PiyingView\"\n [selectlessOutletInputs]=\"\n addNewInputs | pure: keySchemaOptions$$() : initValue() : children.length\n \"\n #newKey=\"selectlessOutlet\"\n ></ng-container>\n <ng-container\n [selectlessOutlet]=\"PiyingView\"\n [selectlessOutletInputs]=\"\n addNewInputs | pure: valueSchemaOptions$$() : initValue() : children.length\n \"\n #newValue=\"selectlessOutlet\"\n ></ng-container>\n </div>\n @let keyForm = newKey.componentInstance?.form$$();\n @let valueFform = newValue.componentInstance?.form$$();\n <button\n class=\"btn btn-circle\"\n (click)=\"addNew(newValue, newKey)\"\n color=\"primary\"\n [disabled]=\"!valueFform?.valid || !keyForm?.valid\"\n >\n <span class=\"material-icons\">add</span>\n </button>\n </div>\n } @else if (addMode() === 0) {\n <button class=\"btn btn-circle\" (click)=\"addNew()\" color=\"primary\">\n <span class=\"material-icons\">add</span>\n </button>\n } @else {\n <div class=\"flex items-center gap-2\">\n <div class=\"flex-1\">\n <ng-container\n [selectlessOutlet]=\"PiyingView\"\n [selectlessOutletInputs]=\"\n addNewInputs | pure: valueSchemaOptions$$() : initValue() : children.length\n \"\n #newValue=\"selectlessOutlet\"\n ></ng-container>\n </div>\n @let form = newValue.componentInstance?.form$$();\n <button\n class=\"btn btn-circle\"\n (click)=\"addNew(newValue)\"\n color=\"primary\"\n [disabled]=\"!form || form.invalid\"\n >\n <span class=\"material-icons\">add</span>\n </button>\n </div>\n }\n }\n </ng-template>\n @if (addPosition() === 'top') {\n <ng-container *ngTemplateOutlet=\"addTemplate\"></ng-container>\n }\n @for (field of children; track field.id || $index) {\n <div class=\"flex items-center gap-2\">\n @if (isRecord$$()) {\n @let key = field.key!;\n {{ key }}\n }\n <div class=\"flex-1\">\n <ng-container\n *ngTemplateOutlet=\"fieldTemplateRef(); context: { $implicit: field, injector }\"\n ></ng-container>\n </div>\n\n @if (!disableRemove()) {\n <button\n class=\"btn btn-circle btn-error\"\n (click)=\"removeItem($index)\"\n [disabled]=\"minLength() >= children.length\"\n >\n <span class=\"material-icons\">delete</span>\n </button>\n }\n </div>\n }\n @if (addPosition() === 'bottom') {\n <ng-container *ngTemplateOutlet=\"addTemplate\"></ng-container>\n }\n </div>\n</ng-template>\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: AttributesDirective, selector: "[attributes]", inputs: ["attributes", "excludes"] }, { kind: "directive", type: EventsDirective, selector: "[events]", inputs: ["events"] }, { 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: PurePipe, name: "pure" }] });
|
|
1520
|
+
}
|
|
1521
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: EditableGroupFGC, decorators: [{
|
|
1522
|
+
type: Component,
|
|
1523
|
+
args: [{ selector: 'app-editable-group', imports: [
|
|
1524
|
+
NgTemplateOutlet,
|
|
1525
|
+
FormsModule,
|
|
1526
|
+
MergeClassPipe,
|
|
1527
|
+
CssPrefixPipe,
|
|
1528
|
+
AttributesDirective,
|
|
1529
|
+
EventsDirective,
|
|
1530
|
+
SelectorlessOutlet,
|
|
1531
|
+
PurePipe,
|
|
1532
|
+
], template: "<ng-template #templateRef let-attr=\"attributes\" let-events=\"events\">\n <div\n [class]=\"wrapperClass$$() | cssPrefix | mergeClass: attr()?.class\"\n [attributes]=\"attr()\"\n [excludes]=\"['class']\"\n [events]=\"events()\"\n >\n @let children = children$$();\n <ng-template #addTemplate>\n @if (!disableAdd()) {\n @if (isRecord$$()) {\n <div class=\"flex items-center gap-2\">\n <div class=\"flex-1 flex items-center gap-2\">\n <ng-container\n [selectlessOutlet]=\"PiyingView\"\n [selectlessOutletInputs]=\"\n addNewInputs | pure: keySchemaOptions$$() : initValue() : children.length\n \"\n #newKey=\"selectlessOutlet\"\n ></ng-container>\n <ng-container\n [selectlessOutlet]=\"PiyingView\"\n [selectlessOutletInputs]=\"\n addNewInputs | pure: valueSchemaOptions$$() : initValue() : children.length\n \"\n #newValue=\"selectlessOutlet\"\n ></ng-container>\n </div>\n @let keyForm = newKey.componentInstance?.form$$();\n @let valueFform = newValue.componentInstance?.form$$();\n <button\n class=\"btn btn-circle\"\n (click)=\"addNew(newValue, newKey)\"\n color=\"primary\"\n [disabled]=\"!valueFform?.valid || !keyForm?.valid\"\n >\n <span class=\"material-icons\">add</span>\n </button>\n </div>\n } @else if (addMode() === 0) {\n <button class=\"btn btn-circle\" (click)=\"addNew()\" color=\"primary\">\n <span class=\"material-icons\">add</span>\n </button>\n } @else {\n <div class=\"flex items-center gap-2\">\n <div class=\"flex-1\">\n <ng-container\n [selectlessOutlet]=\"PiyingView\"\n [selectlessOutletInputs]=\"\n addNewInputs | pure: valueSchemaOptions$$() : initValue() : children.length\n \"\n #newValue=\"selectlessOutlet\"\n ></ng-container>\n </div>\n @let form = newValue.componentInstance?.form$$();\n <button\n class=\"btn btn-circle\"\n (click)=\"addNew(newValue)\"\n color=\"primary\"\n [disabled]=\"!form || form.invalid\"\n >\n <span class=\"material-icons\">add</span>\n </button>\n </div>\n }\n }\n </ng-template>\n @if (addPosition() === 'top') {\n <ng-container *ngTemplateOutlet=\"addTemplate\"></ng-container>\n }\n @for (field of children; track field.id || $index) {\n <div class=\"flex items-center gap-2\">\n @if (isRecord$$()) {\n @let key = field.key!;\n {{ key }}\n }\n <div class=\"flex-1\">\n <ng-container\n *ngTemplateOutlet=\"fieldTemplateRef(); context: { $implicit: field, injector }\"\n ></ng-container>\n </div>\n\n @if (!disableRemove()) {\n <button\n class=\"btn btn-circle btn-error\"\n (click)=\"removeItem($index)\"\n [disabled]=\"minLength() >= children.length\"\n >\n <span class=\"material-icons\">delete</span>\n </button>\n }\n </div>\n }\n @if (addPosition() === 'bottom') {\n <ng-container *ngTemplateOutlet=\"addTemplate\"></ng-container>\n }\n </div>\n</ng-template>\n" }]
|
|
1533
|
+
}], propDecorators: { templateRef: [{ type: i0.ViewChild, args: ['templateRef', { isSignal: true }] }], layout: [{ type: i0.Input, args: [{ isSignal: true, alias: "layout", required: false }] }], disableAdd: [{ type: i0.Input, args: [{ isSignal: true, alias: "disableAdd", required: false }] }], addMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "addMode", required: false }] }], disableRemove: [{ type: i0.Input, args: [{ isSignal: true, alias: "disableRemove", required: false }] }], addPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "addPosition", required: false }] }], initValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "initValue", required: false }] }], minLength: [{ type: i0.Input, args: [{ isSignal: true, alias: "minLength", required: false }] }] } });
|
|
1534
|
+
|
|
1535
|
+
const Empty_Array = [];
|
|
1536
|
+
/*
|
|
1537
|
+
* CheckboxListFGC - 复选框列表组件
|
|
1538
|
+
*
|
|
1539
|
+
* 用途: 用于显示可多选的复选框列表,支持动态选项和自定义配置
|
|
1540
|
+
* 特性:
|
|
1541
|
+
* - 支持动态复选框选项(options)
|
|
1542
|
+
* - 支持自定义每个选项的 Schema 和属性
|
|
1543
|
+
* - 实现了 ControlValueAccessor 接口,可直接用于表单
|
|
1544
|
+
* - 基于 piying-view 字段系统,支持动态验证和状态管理
|
|
1545
|
+
* - 支持值的增删操作
|
|
1546
|
+
*
|
|
1547
|
+
* 使用场景: 多选列表、权限选择、标签选择等需要多选功能的场景
|
|
1548
|
+
*/
|
|
1549
|
+
class CheckboxListFGC extends PiyingViewGroupBase {
|
|
1550
|
+
static __version = 2;
|
|
1551
|
+
templateRef = viewChild.required('templateRef');
|
|
1552
|
+
PiyingView = PiyingView;
|
|
1553
|
+
/** 选项列表 */
|
|
1554
|
+
options = input(...(ngDevMode ? [undefined, { debugName: "options" }] : []));
|
|
1555
|
+
#parentPyOptions = inject(PI_INPUT_OPTIONS_TOKEN, { optional: true });
|
|
1556
|
+
templateSchema$$ = computed(() => {
|
|
1557
|
+
return this.field$$().form.control.config$().groupValueSchema;
|
|
1558
|
+
}, ...(ngDevMode ? [{ debugName: "templateSchema$$" }] : []));
|
|
1559
|
+
schemaItemFn = (template, input) => {
|
|
1560
|
+
return v.pipe(v.optional(template), formConfig({
|
|
1561
|
+
transfomer: {
|
|
1562
|
+
toModel(value, control) {
|
|
1563
|
+
return value ? input.value : undefined;
|
|
1564
|
+
},
|
|
1565
|
+
toView(value, control) {
|
|
1566
|
+
return !!value;
|
|
1567
|
+
},
|
|
1568
|
+
},
|
|
1569
|
+
}), actions.inputs.patch(input.inputs ?? {}), actions.props.patch(input.props ?? {}));
|
|
1570
|
+
};
|
|
1571
|
+
schemaOptions$$ = (template, input, value) => {
|
|
1572
|
+
return {
|
|
1573
|
+
schema: template,
|
|
1574
|
+
options: this.#parentPyOptions(),
|
|
1575
|
+
selectorless: true,
|
|
1576
|
+
model: value.includes(input.value),
|
|
1577
|
+
};
|
|
1578
|
+
};
|
|
1579
|
+
value$$ = computed(() => {
|
|
1580
|
+
return this.field$$().form.control.value$$() ?? Empty_Array;
|
|
1581
|
+
}, ...(ngDevMode ? [{ debugName: "value$$" }] : []));
|
|
1582
|
+
modelOutput = (booleanValue) => {
|
|
1583
|
+
return {
|
|
1584
|
+
modelChange: (value) => {
|
|
1585
|
+
const list = this.value$$().slice();
|
|
1586
|
+
if (value) {
|
|
1587
|
+
this.field$$().action.set(value);
|
|
1588
|
+
}
|
|
1589
|
+
else {
|
|
1590
|
+
const index = list.findIndex((item) => item === booleanValue);
|
|
1591
|
+
this.field$$().action.remove(index);
|
|
1592
|
+
}
|
|
1593
|
+
},
|
|
1594
|
+
};
|
|
1595
|
+
};
|
|
1596
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: CheckboxListFGC, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1597
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.14", type: CheckboxListFGC, isStandalone: true, selector: "app-checkbox-list", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
|
|
1598
|
+
{
|
|
1599
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1600
|
+
useExisting: forwardRef(() => CheckboxListFGC),
|
|
1601
|
+
multi: true,
|
|
1602
|
+
},
|
|
1603
|
+
], viewQueries: [{ propertyName: "templateRef", first: true, predicate: ["templateRef"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<ng-template #templateRef let-attr=\"attributes\" let-events=\"events\">\n @for (item of options(); track $index) {\n <ng-container\n [selectlessOutlet]=\"PiyingView\"\n [selectlessOutletInputs]=\"\n schemaOptions$$ | pure: (schemaItemFn | pure: templateSchema$$() : item) : item : value$$()\n \"\n [selectlessOutletOutputs]=\"modelOutput | pure: item.value\"\n ></ng-container>\n }\n</ng-template>\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: SelectorlessOutlet, selector: "[selectlessOutlet]", inputs: ["selectlessOutlet", "selectlessOutletInputs", "selectlessOutletOutputs", "selectlessOutletDirectives", "selectlessOutletInjector", "selectlessOutletEnvironmentInjector"], exportAs: ["selectlessOutlet"] }, { kind: "pipe", type: PurePipe, name: "pure" }] });
|
|
1604
|
+
}
|
|
1605
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: CheckboxListFGC, decorators: [{
|
|
1606
|
+
type: Component,
|
|
1607
|
+
args: [{ selector: 'app-checkbox-list', imports: [FormsModule, SelectorlessOutlet, PurePipe], providers: [
|
|
1608
|
+
{
|
|
1609
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1610
|
+
useExisting: forwardRef(() => CheckboxListFGC),
|
|
1611
|
+
multi: true,
|
|
1612
|
+
},
|
|
1613
|
+
], template: "<ng-template #templateRef let-attr=\"attributes\" let-events=\"events\">\n @for (item of options(); track $index) {\n <ng-container\n [selectlessOutlet]=\"PiyingView\"\n [selectlessOutletInputs]=\"\n schemaOptions$$ | pure: (schemaItemFn | pure: templateSchema$$() : item) : item : value$$()\n \"\n [selectlessOutletOutputs]=\"modelOutput | pure: item.value\"\n ></ng-container>\n }\n</ng-template>\n" }]
|
|
1614
|
+
}], propDecorators: { templateRef: [{ type: i0.ViewChild, args: ['templateRef', { isSignal: true }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }] } });
|
|
1615
|
+
|
|
1616
|
+
/*
|
|
1617
|
+
* logicGroupFGC - 逻辑组组件
|
|
1618
|
+
*
|
|
1619
|
+
* 用途: 用于根据逻辑条件控制子组件的激活状态
|
|
1620
|
+
* 特性:
|
|
1621
|
+
* - 根据 FieldLogicGroup 的激活状态显示子组件
|
|
1622
|
+
* - 自动过滤未激活的子组件
|
|
1623
|
+
* - 集成 piying-view 字段系统
|
|
1624
|
+
*
|
|
1625
|
+
* 使用场景: 条件显示、逻辑控制、动态表单等需要根据逻辑条件控制组件显示的场景
|
|
1626
|
+
*/
|
|
1627
|
+
class logicGroupFGC extends PiyingViewGroupBase {
|
|
1628
|
+
static __version = 2;
|
|
1629
|
+
templateRef = viewChild.required('templateRef');
|
|
1630
|
+
activateChildren$$ = computed(() => {
|
|
1631
|
+
const control = this.field$$().form.control;
|
|
1632
|
+
return this.field$$().children().filter((config, index1) => {
|
|
1633
|
+
return !!control.activatedChildren().find(([index2]) => index1 === index2);
|
|
1634
|
+
});
|
|
1635
|
+
}, ...(ngDevMode ? [{ debugName: "activateChildren$$" }] : []));
|
|
1636
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: logicGroupFGC, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1637
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.14", type: logicGroupFGC, isStandalone: true, selector: "app-logic-group", 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 activateChildren$$(); track $index) {\n <ng-container\n *ngTemplateOutlet=\"fieldTemplateRef(); context: { $implicit: item }\"\n ></ng-container>\n }\n</ng-template>\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
1638
|
+
}
|
|
1639
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: logicGroupFGC, decorators: [{
|
|
1640
|
+
type: Component,
|
|
1641
|
+
args: [{ selector: 'app-logic-group', imports: [NgTemplateOutlet], template: "<ng-template #templateRef let-attr=\"attributes\">\n @for (item of activateChildren$$(); track $index) {\n <ng-container\n *ngTemplateOutlet=\"fieldTemplateRef(); context: { $implicit: item }\"\n ></ng-container>\n }\n</ng-template>\n" }]
|
|
1642
|
+
}], propDecorators: { templateRef: [{ type: i0.ViewChild, args: ['templateRef', { isSignal: true }] }] } });
|
|
1643
|
+
|
|
1256
1644
|
var component_index = /*#__PURE__*/Object.freeze({
|
|
1257
1645
|
__proto__: null,
|
|
1646
|
+
CheckboxListFGC: CheckboxListFGC,
|
|
1647
|
+
EditableArrayFGC: EditableGroupFGC,
|
|
1258
1648
|
ListTemplateNFCC: ListTemplateNFCC,
|
|
1259
1649
|
MenuTreeNFCC: MenuTreeNFCC,
|
|
1260
1650
|
OptionListFCC: OptionListFCC,
|
|
@@ -1262,9 +1652,22 @@ var component_index = /*#__PURE__*/Object.freeze({
|
|
|
1262
1652
|
PickerRefFCC: PickerRefFCC,
|
|
1263
1653
|
TableExpandOneTableCell: TableExpandOneTableCell,
|
|
1264
1654
|
TableNFCC: TableNFCC,
|
|
1265
|
-
TableRowFGC: TableRowFGC
|
|
1655
|
+
TableRowFGC: TableRowFGC,
|
|
1656
|
+
logicGroupFGC: logicGroupFGC
|
|
1266
1657
|
});
|
|
1267
1658
|
|
|
1659
|
+
/*
|
|
1660
|
+
* FilterOptionNFCC - 过滤选项组件
|
|
1661
|
+
*
|
|
1662
|
+
* 用途: 用于显示过滤输入框,通常与 OptionList 组件配合使用
|
|
1663
|
+
* 特性:
|
|
1664
|
+
* - 显示过滤输入框
|
|
1665
|
+
* - 从 context 中获取搜索内容
|
|
1666
|
+
* - 阻止键盘事件冒泡
|
|
1667
|
+
* - 集成 piying-view 字段系统
|
|
1668
|
+
*
|
|
1669
|
+
* 使用场景: 选项列表需要本地过滤功能时,用于输入过滤条件
|
|
1670
|
+
*/
|
|
1268
1671
|
class FilterOptionNFCC {
|
|
1269
1672
|
static __version = 2;
|
|
1270
1673
|
templateRef = viewChild.required('templateRef');
|
|
@@ -1281,6 +1684,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImpo
|
|
|
1281
1684
|
args: [{ selector: 'app-filter-option', imports: [FormsModule, CssPrefixPipe, MergeClassPipe, AttributesDirective, FormsModule], template: "<ng-template #templateRef let-attr=\"attributes\">\n <input\n type=\"text\"\n [attributes]=\"attr?.()\"\n [excludes]=\"['class']\"\n [class]=\"attr?.().class | mergeClass: 'input' | cssPrefix\"\n [(ngModel)]=\"content\"\n (keydown)=\"stopKeyboardListen($event)\"\n />\n</ng-template>\n" }]
|
|
1282
1685
|
}], propDecorators: { templateRef: [{ type: i0.ViewChild, args: ['templateRef', { isSignal: true }] }] } });
|
|
1283
1686
|
|
|
1687
|
+
/*
|
|
1688
|
+
* OptionListLocalFilterWC - 选项列表本地过滤包装器组件
|
|
1689
|
+
*
|
|
1690
|
+
* 用途: 用于在客户端对选项列表进行本地过滤筛选
|
|
1691
|
+
* 特性:
|
|
1692
|
+
* - 支持输入搜索内容进行过滤
|
|
1693
|
+
* - 支持自定义过滤函数(filterWith)
|
|
1694
|
+
* - 支持自定义过滤选项组件(filterDefine)
|
|
1695
|
+
* - 自动同步过滤状态到选项列表
|
|
1696
|
+
* - 集成 piying-view 字段系统
|
|
1697
|
+
*
|
|
1698
|
+
* 使用场景: 选项列表数据量较小,需要在客户端进行筛选的场景
|
|
1699
|
+
*/
|
|
1284
1700
|
class OptionListLocalFilterWC {
|
|
1285
1701
|
static __version = 2;
|
|
1286
1702
|
templateRef = viewChild.required('templateRef');
|
|
@@ -1336,6 +1752,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImpo
|
|
|
1336
1752
|
|
|
1337
1753
|
var wrapper_index = /*#__PURE__*/Object.freeze({
|
|
1338
1754
|
__proto__: null,
|
|
1755
|
+
FilterOptionNFCC: FilterOptionNFCC,
|
|
1339
1756
|
OptionListLocalFilterWC: OptionListLocalFilterWC,
|
|
1340
1757
|
SortHeaderWC: SortHeaderWC,
|
|
1341
1758
|
TableCheckboxAllWC: TableCheckboxAllWC,
|
|
@@ -1346,5 +1763,5 @@ var wrapper_index = /*#__PURE__*/Object.freeze({
|
|
|
1346
1763
|
* Generated bundle index. Do not edit.
|
|
1347
1764
|
*/
|
|
1348
1765
|
|
|
1349
|
-
export { CheckboxService, ExactMatchOptions, ExpandRowDirective, component_index as ExtComponentGroup, wrapper_index as ExtWrapperGroup, ListTemplateNFCC, MenuTreeNFCC, OptionListFCC, OptionListLocalFilterWC, PaginationNFCC, PickerRefFCC, SortHeaderWC, SortService, SubsetMatchOptions, TableCheckboxAllWC, TableCheckboxOneWC, TableExpandOneTableCell, TableExpandService, TableNFCC, TableResourceService, TableRowFGC, wrapper_index$1 as WrapperGroup, createDefaultColDefine, createDefaultColDefineFn, createRowDefine, inputSortDirective };
|
|
1766
|
+
export { CheckboxListFGC, CheckboxService, EditableGroupFGC, ExactMatchOptions, ExpandRowDirective, component_index as ExtComponentGroup, wrapper_index as ExtWrapperGroup, ListTemplateNFCC, MenuTreeNFCC, OptionListFCC, OptionListLocalFilterWC, PaginationNFCC, PickerRefFCC, SortHeaderWC, SortService, SubsetMatchOptions, TableCheckboxAllWC, TableCheckboxOneWC, TableExpandOneTableCell, TableExpandService, TableNFCC, TableResourceService, TableRowFGC, wrapper_index$1 as WrapperGroup, createDefaultColDefine, createDefaultColDefineFn, createRowDefine, inputSortDirective, logicGroupFGC };
|
|
1350
1767
|
//# sourceMappingURL=piying-lib-angular-daisyui-extension.mjs.map
|