@piying/view-angular-core 1.5.2 → 1.5.4

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/index.d.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  import * as _angular_core from '@angular/core';
2
2
  import { WritableSignal, Signal, Injector, CreateEffectOptions, EffectRef, InjectionToken } from '@angular/core';
3
- import * as rxjs from 'rxjs';
4
3
  import { UnaryFunction, Observable } from 'rxjs';
5
4
  import * as v from 'valibot';
6
5
  import { BaseSchema, BaseMetadata, ArraySchema, BaseIssue, ErrorMessage, ArrayIssue } from 'valibot';
@@ -463,11 +462,13 @@ declare function setInputs<T>(inputs: CoreRawViewInputs): _piying_valibot_visit.
463
462
  declare function patchInputs<T>(inputs: CoreRawViewInputs): _piying_valibot_visit.RawConfigAction<"viewRawConfig", T, _piying_view_angular_core.AnyCoreSchemaHandle>;
464
463
  declare function removeInputs<T>(list: string[]): _piying_valibot_visit.RawConfigAction<"viewRawConfig", T, _piying_view_angular_core.AnyCoreSchemaHandle>;
465
464
  declare function asyncInputMerge(dataObj: Record<string, any>, data$: WritableSignal<any>): WritableSignal<any>;
466
- declare function patchAsyncFn(patchKey: 'props' | 'inputs' | 'attributes'): <T>(dataObj: Record<string, (field: _PiResolvedCommonViewFieldConfig) => Promise<any> | Observable<any> | Signal<any> | (any & {})>, options?: {
465
+ type AsyncResult = Promise<any> | Observable<any> | Signal<any> | (any & {});
466
+ type AsyncProperty = (field: _PiResolvedCommonViewFieldConfig) => AsyncResult;
467
+ declare function patchAsyncFn(patchKey: 'props' | 'inputs' | 'attributes'): <T>(dataObj: Record<string, AsyncProperty>, options?: {
467
468
  addPosition: "top" | "bottom";
468
469
  hookName: "fieldResolved" | "allFieldsResolved";
469
470
  }) => _piying_valibot_visit.RawConfigAction<"viewRawConfig", T, _piying_view_angular_core.AnyCoreSchemaHandle>;
470
- declare const patchAsyncInputs: <T>(dataObj: Record<string, (field: _PiResolvedCommonViewFieldConfig) => Promise<any> | Observable<any> | Signal<any> | (any & {})>, options?: {
471
+ declare const patchAsyncInputs: <T>(dataObj: Record<string, AsyncProperty>, options?: {
471
472
  addPosition: "top" | "bottom";
472
473
  hookName: "fieldResolved" | "allFieldsResolved";
473
474
  }) => _piying_valibot_visit.RawConfigAction<"viewRawConfig", T, _piying_view_angular_core.AnyCoreSchemaHandle>;
@@ -475,7 +476,7 @@ declare const patchAsyncInputs: <T>(dataObj: Record<string, (field: _PiResolvedC
475
476
  declare function setAttributes<T>(attributes: CoreRawViewAttributes): _piying_valibot_visit.RawConfigAction<"viewRawConfig", T, _piying_view_angular_core.AnyCoreSchemaHandle>;
476
477
  declare function patchAttributes<T>(attributes: CoreRawViewAttributes): _piying_valibot_visit.RawConfigAction<"viewRawConfig", T, _piying_view_angular_core.AnyCoreSchemaHandle>;
477
478
  declare function removeAttributes<T>(list: string[]): _piying_valibot_visit.RawConfigAction<"viewRawConfig", T, _piying_view_angular_core.AnyCoreSchemaHandle>;
478
- declare const patchAsyncAttributes: <T>(dataObj: Record<string, (field: _piying_view_angular_core._PiResolvedCommonViewFieldConfig) => Promise<any> | rxjs.Observable<any> | _angular_core.Signal<any> | (any & {})>, options?: {
479
+ declare const patchAsyncAttributes: <T>(dataObj: Record<string, _piying_view_angular_core.AsyncProperty>, options?: {
479
480
  addPosition: "top" | "bottom";
480
481
  hookName: "fieldResolved" | "allFieldsResolved";
481
482
  }) => _piying_valibot_visit.RawConfigAction<"viewRawConfig", T, _piying_view_angular_core.AnyCoreSchemaHandle>;
@@ -483,7 +484,7 @@ declare const patchAsyncAttributes: <T>(dataObj: Record<string, (field: _piying_
483
484
  declare function setProps<T>(props: CoreRawProps): _piying_valibot_visit.RawConfigAction<"viewRawConfig", T, _piying_view_angular_core.AnyCoreSchemaHandle>;
484
485
  declare function patchProps<T>(props: CoreRawProps): _piying_valibot_visit.RawConfigAction<"viewRawConfig", T, _piying_view_angular_core.AnyCoreSchemaHandle>;
485
486
  declare function removeProps<T>(list: string[]): _piying_valibot_visit.RawConfigAction<"viewRawConfig", T, _piying_view_angular_core.AnyCoreSchemaHandle>;
486
- declare const patchAsyncProps: <T>(dataObj: Record<string, (field: _piying_view_angular_core._PiResolvedCommonViewFieldConfig) => Promise<any> | rxjs.Observable<any> | _angular_core.Signal<any> | (any & {})>, options?: {
487
+ declare const patchAsyncProps: <T>(dataObj: Record<string, _piying_view_angular_core.AsyncProperty>, options?: {
487
488
  addPosition: "top" | "bottom";
488
489
  hookName: "fieldResolved" | "allFieldsResolved";
489
490
  }) => _piying_valibot_visit.RawConfigAction<"viewRawConfig", T, _piying_view_angular_core.AnyCoreSchemaHandle>;
@@ -491,12 +492,8 @@ declare const patchAsyncProps: <T>(dataObj: Record<string, (field: _piying_view_
491
492
  declare function setOutputs<T>(outputs: CoreRawViewOutputs): _piying_valibot_visit.RawConfigAction<"viewRawConfig", T, AnyCoreSchemaHandle>;
492
493
  declare function patchOutputs<T>(outputs: CoreRawViewOutputs): _piying_valibot_visit.RawConfigAction<"viewRawConfig", T, AnyCoreSchemaHandle>;
493
494
  declare function removeOutputs<T>(list: string[]): _piying_valibot_visit.RawConfigAction<"viewRawConfig", T, AnyCoreSchemaHandle>;
494
- declare function mergeOutputFn(field: _PiResolvedCommonViewFieldConfig, outputs: CoreRawViewOutputs, options: {
495
- position: 'top' | 'bottom';
496
- }): void;
497
- declare const mergeOutputs: <T>(outputs: Record<string, (...args: any[]) => void>, options?: {
498
- position: "top" | "bottom";
499
- }) => _piying_valibot_visit.RawConfigAction<"viewRawConfig", T, AnyCoreSchemaHandle>;
495
+ declare function mergeOutputFn(field: _PiResolvedCommonViewFieldConfig, outputs: CoreRawViewOutputs): void;
496
+ declare const mergeOutputs: <T>(outputs: Record<string, (...args: any[]) => void>) => _piying_valibot_visit.RawConfigAction<"viewRawConfig", T, AnyCoreSchemaHandle>;
500
497
  type EventChangeFn = (fn: (input: {
501
498
  list: KeyPath | undefined;
502
499
  output: string;
@@ -513,6 +510,11 @@ type PatchWrappersOptions = {
513
510
  position: 'head' | 'tail';
514
511
  };
515
512
  declare function patchWrappers<T>(wrappers: CoreRawWrapperConfig | CoreRawWrapperConfig[], options?: PatchWrappersOptions): _piying_valibot_visit.RawConfigAction<"viewRawConfig", T, _piying_view_angular_core.AnyCoreSchemaHandle>;
513
+ type AsyncCoreRawWrapperConfig = Omit<Exclude<CoreRawWrapperConfig, string>, 'inputs' | 'attributes'> & {
514
+ inputs?: Record<string, AsyncProperty>;
515
+ attributes?: Record<string, AsyncProperty>;
516
+ };
517
+ declare function patchAsyncWrapper<T>(inputWrapper: AsyncCoreRawWrapperConfig, options?: PatchWrappersOptions): _piying_valibot_visit.RawConfigAction<"viewRawConfig", T, _piying_view_angular_core.AnyCoreSchemaHandle>;
516
518
  declare function removeWrappers<T>(list: string[]): _piying_valibot_visit.RawConfigAction<"viewRawConfig", T, _piying_view_angular_core.AnyCoreSchemaHandle>;
517
519
 
518
520
  declare function setAlias<T>(alias: string): _piying_valibot_visit.RawConfigAction<"viewRawConfig", T, _piying_view_angular_core.AnyCoreSchemaHandle>;
@@ -581,7 +583,7 @@ declare function disableWhen<TInput>(options: DisableWhenOption): _piying_valibo
581
583
  declare function topClass<T>(className: ClassValue, merge?: boolean): _piying_valibot_visit.RawConfigAction<"viewRawConfig", T, _piying_view_angular_core.AnyCoreSchemaHandle>;
582
584
  /** 仅设置在组件上 */
583
585
  declare function componentClass<T>(className: ClassValue, merge?: boolean): _piying_valibot_visit.RawConfigAction<"viewRawConfig", T, _piying_view_angular_core.AnyCoreSchemaHandle>;
584
- declare function patchAsyncClass<T>(fn: (field: _PiResolvedCommonViewFieldConfig) => Promise<any> | Observable<any> | Signal<any> | (any & {})): _piying_valibot_visit.RawConfigAction<"viewRawConfig", T, _piying_view_angular_core.AnyCoreSchemaHandle>;
586
+ declare function patchAsyncClass<T>(fn: (field: _PiResolvedCommonViewFieldConfig) => AsyncResult): _piying_valibot_visit.RawConfigAction<"viewRawConfig", T, _piying_view_angular_core.AnyCoreSchemaHandle>;
585
587
 
586
588
  interface NonFieldControlAction<TInput = unknown> extends BaseMetadata<TInput> {
587
589
  readonly type: 'nonFieldControl';
@@ -663,7 +665,7 @@ type CoreRawViewInputs = Record<string, any>;
663
665
  type CoreRawViewAttributes = Record<string, any>;
664
666
  type CoreRawProps = Record<string, any>;
665
667
  interface CoreRawViewOutputs {
666
- [name: string]: (event: any) => void;
668
+ [name: string]: (...args: any[]) => void;
667
669
  }
668
670
  type CoreWrapperConfig1 = {
669
671
  type: string | any | LazyImport<any>;
@@ -742,5 +744,5 @@ declare const PI_CONTEXT_TOKEN: InjectionToken<any>;
742
744
  declare function isGroup(schema: AnyCoreSchemaHandle): boolean | undefined;
743
745
  declare function isArray(schema: AnyCoreSchemaHandle): boolean;
744
746
 
745
- export { AbstractControl, CoreSchemaHandle, FieldArray, FieldControl, FieldGroup, FieldLogicGroup, FormBuilder, INVALID, NFCSchema, PENDING, PI_CONTEXT_TOKEN, PI_VIEW_CONFIG_TOKEN, SortedArray, UpdateType, VALID, arrayStartsWith, asyncInputMerge, clone, componentClass, controlStatusList, convert, createViewControlLink, disableWhen, effectListen, fieldControlStatusClass, formConfig, getLazyImport, hideWhen, initListen, isArray, isFieldArray, isFieldControl, isFieldGroup, isFieldLogicGroup, isGroup, isLazyMark, layout, lazyMark, mergeHooks, mergeHooksFn, mergeOutputFn, mergeOutputs, nonFieldControl, outputChange, outputChangeFn, patchAsyncAttributes, patchAsyncClass, patchAsyncFn, patchAsyncInputs, patchAsyncProps, patchAttributes, patchHooks, patchInputs, patchOutputs, patchProps, patchWrappers, rawConfig, removeAttributes, removeHooks, removeInputs, removeOutputs, removeProps, removeWrappers, renderConfig, setAlias, setAttributes, setComponent, setHooks, setInputs, setOutputs, setProps, setWrappers, toArray, toObservable, topClass, unWrapSignal, valueChange, valueChangeFn };
746
- export type { AbstractControlParams, AnyCoreSchemaHandle, ArraryIterable, ArrayDeletionMode, AsyncValidatorFn, BuildArrayItem, BuildGroupItem, BuildRootInputItem, BuildRootItem, ChangeWhenOption, ConfigMergeStrategy, ControlValueAccessor, CoreRawComponentDefine, CoreRawProps, CoreRawViewAttributes, CoreRawViewInputs, CoreRawViewOutputs, CoreRawWrapperConfig, CoreResolvedComponentDefine, CoreResolvedWrapperConfig, CoreWrapperConfig1, DefaultConfigKey, DisableWhenOption, DisabledValueStrategy, EventChangeFn, FieldArrayConfig$, FieldFormConfig, FieldFormConfig$, FieldGroupConfig$, FieldLogicGroupConfig$, FieldRenderConfig, FieldTransformerConfig, FormBuilderOptions, FormHooks, HideWhenOption, HookConfig, HooksConfig, KeyPath, LayoutAction, LazyImport, LazyMarkType, LogicType, MergeHooksConfig, NonFieldControlAction, PiCommonConfig, PiCommonDefaultConfig, PiResolvedCommonViewFieldConfig, QueryPath, RawKeyPath, SetOptional, SetReadonly, SetWrapper$, SetWrapper$$, SignalInputValue, ToObservableOptions, UnWrapSignal, VALID_STATUS, ValidationErrors, ValidatorFn, ValueChangFnOptions, ValueChangeFn, Wrapper$, Writeable, _PiResolvedCommonViewFieldConfig };
747
+ export { AbstractControl, CoreSchemaHandle, FieldArray, FieldControl, FieldGroup, FieldLogicGroup, FormBuilder, INVALID, NFCSchema, PENDING, PI_CONTEXT_TOKEN, PI_VIEW_CONFIG_TOKEN, SortedArray, UpdateType, VALID, arrayStartsWith, asyncInputMerge, clone, componentClass, controlStatusList, convert, createViewControlLink, disableWhen, effectListen, fieldControlStatusClass, formConfig, getLazyImport, hideWhen, initListen, isArray, isFieldArray, isFieldControl, isFieldGroup, isFieldLogicGroup, isGroup, isLazyMark, layout, lazyMark, mergeHooks, mergeHooksFn, mergeOutputFn, mergeOutputs, nonFieldControl, outputChange, outputChangeFn, patchAsyncAttributes, patchAsyncClass, patchAsyncFn, patchAsyncInputs, patchAsyncProps, patchAsyncWrapper, patchAttributes, patchHooks, patchInputs, patchOutputs, patchProps, patchWrappers, rawConfig, removeAttributes, removeHooks, removeInputs, removeOutputs, removeProps, removeWrappers, renderConfig, setAlias, setAttributes, setComponent, setHooks, setInputs, setOutputs, setProps, setWrappers, toArray, toObservable, topClass, unWrapSignal, valueChange, valueChangeFn };
748
+ export type { AbstractControlParams, AnyCoreSchemaHandle, ArraryIterable, ArrayDeletionMode, AsyncCoreRawWrapperConfig, AsyncProperty, AsyncResult, AsyncValidatorFn, BuildArrayItem, BuildGroupItem, BuildRootInputItem, BuildRootItem, ChangeWhenOption, ConfigMergeStrategy, ControlValueAccessor, CoreRawComponentDefine, CoreRawProps, CoreRawViewAttributes, CoreRawViewInputs, CoreRawViewOutputs, CoreRawWrapperConfig, CoreResolvedComponentDefine, CoreResolvedWrapperConfig, CoreWrapperConfig1, DefaultConfigKey, DisableWhenOption, DisabledValueStrategy, EventChangeFn, FieldArrayConfig$, FieldFormConfig, FieldFormConfig$, FieldGroupConfig$, FieldLogicGroupConfig$, FieldRenderConfig, FieldTransformerConfig, FormBuilderOptions, FormHooks, HideWhenOption, HookConfig, HooksConfig, KeyPath, LayoutAction, LazyImport, LazyMarkType, LogicType, MergeHooksConfig, NonFieldControlAction, PiCommonConfig, PiCommonDefaultConfig, PiResolvedCommonViewFieldConfig, QueryPath, RawKeyPath, SetOptional, SetReadonly, SetWrapper$, SetWrapper$$, SignalInputValue, ToObservableOptions, UnWrapSignal, VALID_STATUS, ValidationErrors, ValidatorFn, ValueChangFnOptions, ValueChangeFn, Wrapper$, Writeable, _PiResolvedCommonViewFieldConfig };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@piying/view-angular-core",
3
- "version": "1.5.2",
3
+ "version": "1.5.4",
4
4
  "homepage": "https://piying-org.github.io/website/docs/client/intro",
5
5
  "repository": {
6
6
  "url": "https://github.com/piying-org/piying-view"
package/test/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { RawConfigActionCommon } from '@piying/valibot-visit';
2
2
  import { _PiResolvedCommonViewFieldConfig, FieldGroup, FieldArray, FieldControl, FieldLogicGroup } from '@piying/view-angular-core';
3
3
 
4
- type GetFieldType<T> = <B>(field$: PromiseWithResolvers<T>, hooks?: 'allInit' | 'fieldInit' | 'chilrenInit' | 'beforeComponent' | 'afterComponent') => RawConfigActionCommon<B>;
4
+ type GetFieldType<T> = <B>(field$: PromiseWithResolvers<T>, hooks?: 'allFieldsResolved' | 'fieldResolved' | 'beforeCreateComponent' | 'afterCreateComponent') => RawConfigActionCommon<B>;
5
5
  declare const getField: GetFieldType<_PiResolvedCommonViewFieldConfig>;
6
6
 
7
7
  declare function keyEqual(input1: any, input2: any): void;