@piying-lib/angular-core 1.2.1 → 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.
@@ -1,11 +1,12 @@
1
1
  import * as i0 from '@angular/core';
2
- import { computed, Component, viewChild, input, inject, TemplateRef, forwardRef } from '@angular/core';
2
+ import { computed, Component, viewChild, input, inject, TemplateRef, forwardRef, Injector, resource, runInInjectionContext, ChangeDetectionStrategy } from '@angular/core';
3
3
  import { NgTemplateOutlet } from '@angular/common';
4
4
  import { MatIcon } from '@angular/material/icon';
5
5
  import { SelectorlessOutlet } from '@cyia/ngx-common/directive';
6
6
  import { PurePipe } from '@cyia/ngx-common/pipe';
7
7
  import { BaseControl, PiyingView, PI_INPUT_OPTIONS_TOKEN, AttributesDirective, InsertFieldDirective, EventsDirective } from '@piying/view-angular';
8
8
  import { NG_VALUE_ACCESSOR } from '@angular/forms';
9
+ import { ActivatedRoute } from '@angular/router';
9
10
 
10
11
  const DefaultOptionConvert = {
11
12
  label: (item) => (typeof item !== 'object' ? item : item.label),
@@ -143,6 +144,34 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImpo
143
144
  ], template: "<ng-template #templateRef>\n @let data = $any(content$$());\n @if (isString | pure: data) {\n {{ data }}\n } @else if (isTemplateRef | pure: data) {\n <ng-container *ngTemplateOutlet=\"$any(data)\"></ng-container>\n } @else if (isSchema | pure: data) {\n <ng-container\n [selectlessOutlet]=\"PiyingView\"\n [selectlessOutletInputs]=\"piyingInput | pure: content$$ : schemaOptions$$\"\n ></ng-container>\n } @else if (isObject | pure: data) {\n @if (data['image']; as image) {\n <img [src]=\"image.src\" [alt]=\"image.alt\" />\n }\n @if (data['icon']; as icon) {\n <mat-icon\n [inline]=\"icon.inline\"\n [fontIcon]=\"icon.fontIcon\"\n [fontSet]=\"icon.fontSet\"\n [svgIcon]=\"icon.svgIcon\"\n ></mat-icon>\n }\n @if (data['title']) {\n <span>\n {{ data['title'] }}\n </span>\n }\n }\n</ng-template>\n" }]
144
145
  }], propDecorators: { templateRef: [{ type: i0.ViewChild, args: ['templateRef', { isSignal: true }] }], content: [{ type: i0.Input, args: [{ isSignal: true, alias: "content", required: false }] }], context: [{ type: i0.Input, args: [{ isSignal: true, alias: "context", required: false }] }] } });
145
146
 
147
+ const defaultValue = Promise.resolve(undefined);
148
+ /**
149
+ * 文档/document
150
+ * https://github.com/piying-org/piying-angular-component/blob/main/projects/core/component/schema-view-page/component.ts
151
+ */
152
+ class SchemaViewPage {
153
+ #route = inject(ActivatedRoute);
154
+ #injector = inject(Injector);
155
+ PiyingView = PiyingView;
156
+ #schema = this.#route.snapshot.data['schema']();
157
+ #model = resource({
158
+ loader: async () => runInInjectionContext(this.#injector, () => this.#route.snapshot.data['model']?.() || defaultValue),
159
+ });
160
+ #options = this.#route.snapshot.data['options']();
161
+ inputs = {
162
+ schema: this.#schema,
163
+ options: this.#options,
164
+ model: this.#model.value,
165
+ selectorless: true,
166
+ };
167
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: SchemaViewPage, deps: [], target: i0.ɵɵFactoryTarget.Component });
168
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.14", type: SchemaViewPage, isStandalone: true, selector: "div[pi-schema-view-page]", ngImport: i0, template: "<ng-template [selectlessOutlet]=\"PiyingView\" [selectlessOutletInputs]=\"inputs\"></ng-template>\n", dependencies: [{ kind: "directive", type: SelectorlessOutlet, selector: "[selectlessOutlet]", inputs: ["selectlessOutlet", "selectlessOutletInputs", "selectlessOutletOutputs", "selectlessOutletDirectives", "selectlessOutletInjector", "selectlessOutletEnvironmentInjector"], exportAs: ["selectlessOutlet"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
169
+ }
170
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: SchemaViewPage, decorators: [{
171
+ type: Component,
172
+ args: [{ selector: 'div[pi-schema-view-page]', standalone: true, imports: [SelectorlessOutlet], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-template [selectlessOutlet]=\"PiyingView\" [selectlessOutletInputs]=\"inputs\"></ng-template>\n" }]
173
+ }] });
174
+
146
175
  class DivWC {
147
176
  static __version = 2;
148
177
  templateRef = viewChild.required('templateRef');
@@ -166,5 +195,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImpo
166
195
  * Generated bundle index. Do not edit.
167
196
  */
168
197
 
169
- export { DefaultOptionConvert, DivNFCC, DivWC, StrOrTemplateComponent, computedWithPrev, isSchema, transformOption, transformOptions };
198
+ export { DefaultOptionConvert, DivNFCC, DivWC, SchemaViewPage, StrOrTemplateComponent, computedWithPrev, isSchema, transformOption, transformOptions };
170
199
  //# sourceMappingURL=piying-lib-angular-core.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"piying-lib-angular-core.mjs","sources":["../../../projects/core/util/options.ts","../../../projects/core/util/computed-with-prev.ts","../../../projects/core/util/is.ts","../../../projects/core/component/div/component.ts","../../../projects/core/component/str-template/component.ts","../../../projects/core/component/str-template/component.html","../../../projects/core/wrapper/div/component.ts","../../../projects/core/piying-lib-angular-core.ts"],"sourcesContent":["export interface Option1 {\n label: string;\n value: any;\n disabled?: boolean;\n type?: 'option';\n description?: string;\n}\nexport interface OptionGroup {\n disabled?: boolean;\n label: string;\n children: Option1[];\n type: 'group';\n description?: string;\n}\nexport interface ResolvedOption {\n label: string;\n value: any;\n disabled?: boolean;\n type: 'option' | 'group' | (string & {});\n children?: ResolvedOption[];\n description?: string;\n origin: any;\n}\nexport interface OptionConvert {\n label: (input: any) => string;\n description: (input: any) => string;\n value: (input: any) => any;\n isGroup: (input: any) => boolean;\n children?: (input: any) => any[];\n disabled?: (input: any) => boolean;\n type?: (input: any) => string;\n}\nexport type Option2 = string;\n\nexport const DefaultOptionConvert: OptionConvert = {\n label: (item) => (typeof item !== 'object' ? item : item.label),\n description: (item) => item.description,\n value: (item) => (typeof item !== 'object' ? item : item.value),\n disabled: (item) => typeof item === 'object' && item.disabled,\n isGroup: (item) => typeof item === 'object' && item.type === 'group',\n type: (item) => (typeof item === 'object' ? item.type : 'option'),\n children: (item) => item.children,\n};\n\nexport function transformOptions(options: any[], optionConvert: OptionConvert): ResolvedOption[] {\n return options.map((option) => {\n const resolvedItem: ResolvedOption = {\n label: optionConvert.label(option),\n value: optionConvert.value(option),\n disabled: optionConvert.disabled?.(option) ?? false,\n type: 'option',\n description: optionConvert.description(option),\n origin: option,\n };\n if (optionConvert.isGroup(option)) {\n resolvedItem.type = 'group';\n resolvedItem.children = transformOptions(optionConvert.children!(option), optionConvert);\n return resolvedItem;\n }\n return resolvedItem;\n });\n}\nexport function transformOption(option: any, optionConvert: OptionConvert): ResolvedOption {\n const resolvedItem: ResolvedOption = {\n label: optionConvert.label(option),\n value: optionConvert.value(option),\n disabled: optionConvert.disabled?.(option) ?? false,\n type: optionConvert.type?.(option) ?? 'option',\n description: optionConvert.description(option),\n origin: option,\n };\n if (optionConvert.isGroup(option)) {\n resolvedItem.type = 'group';\n resolvedItem.children = transformOptions(optionConvert.children!(option), optionConvert);\n return resolvedItem;\n }\n return resolvedItem;\n}\n\nexport interface SelectOption {\n readonly label?: string;\n readonly value: any;\n readonly description?: string;\n readonly disabled?: boolean;\n /** 样式代替label */\n readonly style?: any;\n}\n","import { computed, CreateComputedOptions, Signal } from '@angular/core';\n\nexport function computedWithPrev<T>(\n computation: (prev: T | undefined) => T,\n options?: CreateComputedOptions<T>,\n): Signal<T> {\n let previous: T | undefined;\n return computed(() => {\n const newValue = computation(previous);\n previous = newValue;\n return newValue;\n }, options);\n}\n","export function isSchema(input: any) {\n return (\n input && typeof input === 'object' && '~run' in input && 'kind' in input && 'type' in input\n );\n}\n","import { Component } from '@angular/core';\n\n/**\n * 通用容器组件\n *\n * 一个基础的 div 容器组件,用于在表单中创建通用的容器元素。\n * 该组件本身不提供任何交互功能,主要用作布局容器或包裹其他组件。\n *\n * **使用场景**:\n * - 需要对表单元素进行分组和布局时\n * - 需要添加样式容器时\n * - 需要创建空白占位区域时\n *\n */\n@Component({\n selector: 'div',\n template: ``,\n})\nexport class DivNFCC {}\n","import { NgTemplateOutlet } from '@angular/common';\nimport {\n Component,\n computed,\n forwardRef,\n inject,\n input,\n TemplateRef,\n viewChild,\n} from '@angular/core';\n\n/**\n * 字符串或模板渲染组件\n *\n * 一个智能渲染组件,能够根据传入的内容自动判断类型并选择合适的渲染方式。\n * 支持字符串、数字、布尔值、TemplateRef 模板、Schema 对象以及包含 image/icon/title 的对象。\n *\n * **功能特性**:\n * - 自动识别字符串类型并直接渲染\n * - 支持 Angular TemplateRef 模板渲染\n * - 支持 PiyingView Schema 渲染\n * - 支持特殊对象格式(image、icon、title)的渲染\n * - 支持上下文数据传递\n *\n * **使用场景**:\n * - 需要动态渲染不同类型的 content 内容时\n * - 需要在表单中嵌入复杂内容(模板、Schema)时\n * - 需要统一处理多种数据类型显示时\n *\n */\nimport { MatIcon } from '@angular/material/icon';\nimport { SelectorlessOutlet } from '@cyia/ngx-common/directive';\nimport { PurePipe } from '@cyia/ngx-common/pipe';\nimport { BaseControl, PI_INPUT_OPTIONS_TOKEN, PiyingView } from '@piying/view-angular';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { isSchema } from '../../util';\n\n@Component({\n selector: 'app-str-or-template',\n templateUrl: './component.html',\n imports: [PurePipe, NgTemplateOutlet, MatIcon, SelectorlessOutlet],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => StrOrTemplateComponent),\n multi: true,\n },\n ],\n})\nexport class StrOrTemplateComponent extends BaseControl {\n static __version = 2;\n readonly PiyingView = PiyingView;\n templateRef = viewChild.required('templateRef');\n /** 内容 */\n content = input();\n /** 上下文数据 */\n context = input();\n content$$ = computed(() => {\n return this.content() ?? this.value$();\n });\n parentPyOptions = inject(PI_INPUT_OPTIONS_TOKEN, { optional: true });\n schemaOptions$$ = computed(() => {\n return {\n ...this.parentPyOptions!(),\n context: { ...this.parentPyOptions!().context, ...(this.context() as any) },\n };\n });\n\n isString(input: any) {\n return typeof input === 'string' || typeof input === 'number' || typeof input === 'boolean';\n }\n isTemplateRef(input: any) {\n return input instanceof TemplateRef;\n }\n isObject(input: any) {\n return typeof input === 'object';\n }\n isSchema = isSchema;\n piyingInput = (schema: any, options: any) => {\n return {\n schema,\n options,\n selectorless: true,\n };\n };\n}\n","<ng-template #templateRef>\n @let data = $any(content$$());\n @if (isString | pure: data) {\n {{ data }}\n } @else if (isTemplateRef | pure: data) {\n <ng-container *ngTemplateOutlet=\"$any(data)\"></ng-container>\n } @else if (isSchema | pure: data) {\n <ng-container\n [selectlessOutlet]=\"PiyingView\"\n [selectlessOutletInputs]=\"piyingInput | pure: content$$ : schemaOptions$$\"\n ></ng-container>\n } @else if (isObject | pure: data) {\n @if (data['image']; as image) {\n <img [src]=\"image.src\" [alt]=\"image.alt\" />\n }\n @if (data['icon']; as icon) {\n <mat-icon\n [inline]=\"icon.inline\"\n [fontIcon]=\"icon.fontIcon\"\n [fontSet]=\"icon.fontSet\"\n [svgIcon]=\"icon.svgIcon\"\n ></mat-icon>\n }\n @if (data['title']) {\n <span>\n {{ data['title'] }}\n </span>\n }\n }\n</ng-template>\n","import { Component, viewChild } from '@angular/core';\nimport { AttributesDirective, EventsDirective, InsertFieldDirective } from '@piying/view-angular';\n\n@Component({\n selector: 'app-div-wrapper',\n template: `<ng-template #templateRef let-attr=\"attributes\" let-events=\"events\">\n <div [attributes]=\"attr()\" [events]=\"events()\"><ng-container insertField></ng-container></div>\n </ng-template>`,\n imports: [AttributesDirective, InsertFieldDirective, EventsDirective],\n})\nexport class DivWC {\n static __version = 2;\n templateRef = viewChild.required('templateRef');\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAkCO,MAAM,oBAAoB,G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AA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,oBAAoB,EAAA,QAAA,EAAA,eAAA,EAAA,QAAA,EAAA,CAAA,aAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,eAAe,EAAA,QAAA,EAAA,UAAA,EAAA,MAAA,EAAA,CAAA,QAAA,CAAA,EAAA,CAAA,EAAA,CAAA;;4FAEzD,KAAK,EAAA,UAAA,EAAA,CAAA;kBAPjB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,iBAAiB;AAC3B,oBAAA,QAAQ,EAAE,CAAA;;AAEK,gBAAA,CAAA;AACf,oBAAA,OAAO,EAAE,CAAC,mBAAmB,EAAE,oBAAoB,EAAE,eAAe,CAAC;AACtE,iBAAA;yEAGkC,aAAa,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;ACZhD;;AAEG;;;;"}
1
+ {"version":3,"file":"piying-lib-angular-core.mjs","sources":["../../../projects/core/util/options.ts","../../../projects/core/util/computed-with-prev.ts","../../../projects/core/util/is.ts","../../../projects/core/component/div/component.ts","../../../projects/core/component/str-template/component.ts","../../../projects/core/component/str-template/component.html","../../../projects/core/component/schema-view-page/component.ts","../../../projects/core/component/schema-view-page/component.html","../../../projects/core/wrapper/div/component.ts","../../../projects/core/piying-lib-angular-core.ts"],"sourcesContent":["export interface Option1 {\n label: string;\n value: any;\n disabled?: boolean;\n type?: 'option';\n description?: string;\n}\nexport interface OptionGroup {\n disabled?: boolean;\n label: string;\n children: Option1[];\n type: 'group';\n description?: string;\n}\nexport interface ResolvedOption {\n label: string;\n value: any;\n disabled?: boolean;\n type: 'option' | 'group' | (string & {});\n children?: ResolvedOption[];\n description?: string;\n origin: any;\n}\nexport interface OptionConvert {\n label: (input: any) => string;\n description: (input: any) => string;\n value: (input: any) => any;\n isGroup: (input: any) => boolean;\n children?: (input: any) => any[];\n disabled?: (input: any) => boolean;\n type?: (input: any) => string;\n}\nexport type Option2 = string;\n\nexport const DefaultOptionConvert: OptionConvert = {\n label: (item) => (typeof item !== 'object' ? item : item.label),\n description: (item) => item.description,\n value: (item) => (typeof item !== 'object' ? item : item.value),\n disabled: (item) => typeof item === 'object' && item.disabled,\n isGroup: (item) => typeof item === 'object' && item.type === 'group',\n type: (item) => (typeof item === 'object' ? item.type : 'option'),\n children: (item) => item.children,\n};\n\nexport function transformOptions(options: any[], optionConvert: OptionConvert): ResolvedOption[] {\n return options.map((option) => {\n const resolvedItem: ResolvedOption = {\n label: optionConvert.label(option),\n value: optionConvert.value(option),\n disabled: optionConvert.disabled?.(option) ?? false,\n type: 'option',\n description: optionConvert.description(option),\n origin: option,\n };\n if (optionConvert.isGroup(option)) {\n resolvedItem.type = 'group';\n resolvedItem.children = transformOptions(optionConvert.children!(option), optionConvert);\n return resolvedItem;\n }\n return resolvedItem;\n });\n}\nexport function transformOption(option: any, optionConvert: OptionConvert): ResolvedOption {\n const resolvedItem: ResolvedOption = {\n label: optionConvert.label(option),\n value: optionConvert.value(option),\n disabled: optionConvert.disabled?.(option) ?? false,\n type: optionConvert.type?.(option) ?? 'option',\n description: optionConvert.description(option),\n origin: option,\n };\n if (optionConvert.isGroup(option)) {\n resolvedItem.type = 'group';\n resolvedItem.children = transformOptions(optionConvert.children!(option), optionConvert);\n return resolvedItem;\n }\n return resolvedItem;\n}\n\nexport interface SelectOption {\n readonly label?: string;\n readonly value: any;\n readonly description?: string;\n readonly disabled?: boolean;\n /** 样式代替label */\n readonly style?: any;\n}\n","import { computed, CreateComputedOptions, Signal } from '@angular/core';\n\nexport function computedWithPrev<T>(\n computation: (prev: T | undefined) => T,\n options?: CreateComputedOptions<T>,\n): Signal<T> {\n let previous: T | undefined;\n return computed(() => {\n const newValue = computation(previous);\n previous = newValue;\n return newValue;\n }, options);\n}\n","export function isSchema(input: any) {\n return (\n input && typeof input === 'object' && '~run' in input && 'kind' in input && 'type' in input\n );\n}\n","import { Component } from '@angular/core';\n\n/**\n * 通用容器组件\n *\n * 一个基础的 div 容器组件,用于在表单中创建通用的容器元素。\n * 该组件本身不提供任何交互功能,主要用作布局容器或包裹其他组件。\n *\n * **使用场景**:\n * - 需要对表单元素进行分组和布局时\n * - 需要添加样式容器时\n * - 需要创建空白占位区域时\n *\n */\n@Component({\n selector: 'div',\n template: ``,\n})\nexport class DivNFCC {}\n","import { NgTemplateOutlet } from '@angular/common';\nimport {\n Component,\n computed,\n forwardRef,\n inject,\n input,\n TemplateRef,\n viewChild,\n} from '@angular/core';\n\n/**\n * 字符串或模板渲染组件\n *\n * 一个智能渲染组件,能够根据传入的内容自动判断类型并选择合适的渲染方式。\n * 支持字符串、数字、布尔值、TemplateRef 模板、Schema 对象以及包含 image/icon/title 的对象。\n *\n * **功能特性**:\n * - 自动识别字符串类型并直接渲染\n * - 支持 Angular TemplateRef 模板渲染\n * - 支持 PiyingView Schema 渲染\n * - 支持特殊对象格式(image、icon、title)的渲染\n * - 支持上下文数据传递\n *\n * **使用场景**:\n * - 需要动态渲染不同类型的 content 内容时\n * - 需要在表单中嵌入复杂内容(模板、Schema)时\n * - 需要统一处理多种数据类型显示时\n *\n */\nimport { MatIcon } from '@angular/material/icon';\nimport { SelectorlessOutlet } from '@cyia/ngx-common/directive';\nimport { PurePipe } from '@cyia/ngx-common/pipe';\nimport { BaseControl, PI_INPUT_OPTIONS_TOKEN, PiyingView } from '@piying/view-angular';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { isSchema } from '../../util';\n\n@Component({\n selector: 'app-str-or-template',\n templateUrl: './component.html',\n imports: [PurePipe, NgTemplateOutlet, MatIcon, SelectorlessOutlet],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => StrOrTemplateComponent),\n multi: true,\n },\n ],\n})\nexport class StrOrTemplateComponent extends BaseControl {\n static __version = 2;\n readonly PiyingView = PiyingView;\n templateRef = viewChild.required('templateRef');\n /** 内容 */\n content = input();\n /** 上下文数据 */\n context = input();\n content$$ = computed(() => {\n return this.content() ?? this.value$();\n });\n parentPyOptions = inject(PI_INPUT_OPTIONS_TOKEN, { optional: true });\n schemaOptions$$ = computed(() => {\n return {\n ...this.parentPyOptions!(),\n context: { ...this.parentPyOptions!().context, ...(this.context() as any) },\n };\n });\n\n isString(input: any) {\n return typeof input === 'string' || typeof input === 'number' || typeof input === 'boolean';\n }\n isTemplateRef(input: any) {\n return input instanceof TemplateRef;\n }\n isObject(input: any) {\n return typeof input === 'object';\n }\n isSchema = isSchema;\n piyingInput = (schema: any, options: any) => {\n return {\n schema,\n options,\n selectorless: true,\n };\n };\n}\n","<ng-template #templateRef>\n @let data = $any(content$$());\n @if (isString | pure: data) {\n {{ data }}\n } @else if (isTemplateRef | pure: data) {\n <ng-container *ngTemplateOutlet=\"$any(data)\"></ng-container>\n } @else if (isSchema | pure: data) {\n <ng-container\n [selectlessOutlet]=\"PiyingView\"\n [selectlessOutletInputs]=\"piyingInput | pure: content$$ : schemaOptions$$\"\n ></ng-container>\n } @else if (isObject | pure: data) {\n @if (data['image']; as image) {\n <img [src]=\"image.src\" [alt]=\"image.alt\" />\n }\n @if (data['icon']; as icon) {\n <mat-icon\n [inline]=\"icon.inline\"\n [fontIcon]=\"icon.fontIcon\"\n [fontSet]=\"icon.fontSet\"\n [svgIcon]=\"icon.svgIcon\"\n ></mat-icon>\n }\n @if (data['title']) {\n <span>\n {{ data['title'] }}\n </span>\n }\n }\n</ng-template>\n","import {\n ChangeDetectionStrategy,\n Component,\n inject,\n Injector,\n resource,\n runInInjectionContext,\n} from '@angular/core';\nimport { ActivatedRoute } from '@angular/router';\nimport { PiyingView } from '@piying/view-angular';\nimport { SelectorlessOutlet } from '@cyia/ngx-common/directive';\nconst defaultValue = Promise.resolve(undefined);\n/**\n * 文档/document\n * https://github.com/piying-org/piying-angular-component/blob/main/projects/core/component/schema-view-page/component.ts\n */\n@Component({\n selector: 'div[pi-schema-view-page]',\n templateUrl: './component.html',\n standalone: true,\n imports: [SelectorlessOutlet],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SchemaViewPage {\n #route = inject(ActivatedRoute);\n #injector = inject(Injector);\n\n readonly PiyingView = PiyingView;\n #schema = this.#route.snapshot.data['schema']();\n #model = resource({\n loader: async () =>\n runInInjectionContext(\n this.#injector,\n () => this.#route.snapshot.data['model']?.() || defaultValue,\n ),\n });\n #options = this.#route.snapshot.data['options']();\n inputs = {\n schema: this.#schema,\n options: this.#options,\n model: this.#model.value,\n selectorless: true,\n };\n}\n","<ng-template [selectlessOutlet]=\"PiyingView\" [selectlessOutletInputs]=\"inputs\"></ng-template>\n","import { Component, viewChild } from '@angular/core';\nimport { AttributesDirective, EventsDirective, InsertFieldDirective } from '@piying/view-angular';\n\n@Component({\n selector: 'app-div-wrapper',\n template: `<ng-template #templateRef let-attr=\"attributes\" let-events=\"events\">\n <div [attributes]=\"attr()\" [events]=\"events()\"><ng-container insertField></ng-container></div>\n </ng-template>`,\n imports: [AttributesDirective, InsertFieldDirective, EventsDirective],\n})\nexport class DivWC {\n static __version = 2;\n templateRef = viewChild.required('templateRef');\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAkCO,MAAM,oBAAoB,GAAkB;IACjD,KAAK,EAAE,CAAC,IAAI,MAAM,OAAO,IAAI,KAAK,QAAQ,GAAG,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC;IAC/D,WAAW,EAAE,CAAC,IAAI,KAAK,IAAI,CAAC,WAAW;IACvC,KAAK,EAAE,CAAC,IAAI,MAAM,OAAO,IAAI,KAAK,QAAQ,GAAG,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC;AAC/D,IAAA,QAAQ,EAAE,CAAC,IAAI,KAAK,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,QAAQ;AAC7D,IAAA,OAAO,EAAE,CAAC,IAAI,KAAK,OAAO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AA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,eAAe,EAAA,QAAA,EAAA,UAAA,EAAA,MAAA,EAAA,CAAA,QAAA,CAAA,EAAA,CAAA,EAAA,CAAA;;4FAEzD,KAAK,EAAA,UAAA,EAAA,CAAA;kBAPjB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,iBAAiB;AAC3B,oBAAA,QAAQ,EAAE,CAAA;;AAEK,gBAAA,CAAA;AACf,oBAAA,OAAO,EAAE,CAAC,mBAAmB,EAAE,oBAAoB,EAAE,eAAe,CAAC;AACtE,iBAAA;yEAGkC,aAAa,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;ACZhD;;AAEG;;;;"}
package/index.d.ts CHANGED
@@ -119,6 +119,23 @@ declare class StrOrTemplateComponent extends BaseControl {
119
119
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<StrOrTemplateComponent, "app-str-or-template", never, { "content": { "alias": "content"; "required": false; "isSignal": true; }; "context": { "alias": "context"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
120
120
  }
121
121
 
122
+ /**
123
+ * 文档/document
124
+ * https://github.com/piying-org/piying-angular-component/blob/main/projects/core/component/schema-view-page/component.ts
125
+ */
126
+ declare class SchemaViewPage {
127
+ #private;
128
+ readonly PiyingView: typeof PiyingView;
129
+ inputs: {
130
+ schema: any;
131
+ options: any;
132
+ model: _angular_core.WritableSignal<any>;
133
+ selectorless: boolean;
134
+ };
135
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<SchemaViewPage, never>;
136
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<SchemaViewPage, "div[pi-schema-view-page]", never, {}, {}, never, never, true, never>;
137
+ }
138
+
122
139
  declare class DivWC {
123
140
  static __version: number;
124
141
  templateRef: _angular_core.Signal<unknown>;
@@ -126,5 +143,5 @@ declare class DivWC {
126
143
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<DivWC, "app-div-wrapper", never, {}, {}, never, never, true, never>;
127
144
  }
128
145
 
129
- export { DefaultOptionConvert, DivNFCC, DivWC, StrOrTemplateComponent, computedWithPrev, isSchema, transformOption, transformOptions };
146
+ export { DefaultOptionConvert, DivNFCC, DivWC, SchemaViewPage, StrOrTemplateComponent, computedWithPrev, isSchema, transformOption, transformOptions };
130
147
  export type { AlertColor, Color, IconConfig, Option1, Option2, OptionConvert, OptionGroup, ResolvedOption, SelectOption, Size };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@piying-lib/angular-core",
3
- "version": "1.2.1",
3
+ "version": "1.2.3",
4
4
  "peerDependencies": {
5
5
  "@angular/common": ">=20.3.0",
6
6
  "@angular/core": ">=20.3.0"