@piying/view-angular-core 1.5.2 → 1.5.5

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>;
@@ -538,15 +540,10 @@ interface ValueChangFnOptions {
538
540
  list?: (KeyPath | undefined)[];
539
541
  skipInitValue?: boolean;
540
542
  }
541
- interface ChangeWhenOption<T extends _PiResolvedCommonViewFieldConfig = _PiResolvedCommonViewFieldConfig> {
542
- fn: (fn: (input: ValueChangFnOptions) => Observable<{
543
- field: _PiResolvedCommonViewFieldConfig;
544
- input: ValueChangFnOptions;
545
- }>) => void;
546
- }
547
543
  type ValueChangeFn = (fn: (input?: ValueChangFnOptions) => Observable<{
548
544
  field: _PiResolvedCommonViewFieldConfig;
549
545
  list: any[];
546
+ listenFields: _PiResolvedCommonViewFieldConfig[];
550
547
  }>, field: _PiResolvedCommonViewFieldConfig) => void;
551
548
  declare function valueChangeFn(field: _PiResolvedCommonViewFieldConfig, input?: ValueChangFnOptions): Observable<{
552
549
  list: any[];
@@ -581,7 +578,7 @@ declare function disableWhen<TInput>(options: DisableWhenOption): _piying_valibo
581
578
  declare function topClass<T>(className: ClassValue, merge?: boolean): _piying_valibot_visit.RawConfigAction<"viewRawConfig", T, _piying_view_angular_core.AnyCoreSchemaHandle>;
582
579
  /** 仅设置在组件上 */
583
580
  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>;
581
+ declare function patchAsyncClass<T>(fn: (field: _PiResolvedCommonViewFieldConfig) => AsyncResult): _piying_valibot_visit.RawConfigAction<"viewRawConfig", T, _piying_view_angular_core.AnyCoreSchemaHandle>;
585
582
 
586
583
  interface NonFieldControlAction<TInput = unknown> extends BaseMetadata<TInput> {
587
584
  readonly type: 'nonFieldControl';
@@ -663,7 +660,7 @@ type CoreRawViewInputs = Record<string, any>;
663
660
  type CoreRawViewAttributes = Record<string, any>;
664
661
  type CoreRawProps = Record<string, any>;
665
662
  interface CoreRawViewOutputs {
666
- [name: string]: (event: any) => void;
663
+ [name: string]: (...args: any[]) => void;
667
664
  }
668
665
  type CoreWrapperConfig1 = {
669
666
  type: string | any | LazyImport<any>;
@@ -742,5 +739,5 @@ declare const PI_CONTEXT_TOKEN: InjectionToken<any>;
742
739
  declare function isGroup(schema: AnyCoreSchemaHandle): boolean | undefined;
743
740
  declare function isArray(schema: AnyCoreSchemaHandle): boolean;
744
741
 
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 };
742
+ 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 };
743
+ export type { AbstractControlParams, AnyCoreSchemaHandle, ArraryIterable, ArrayDeletionMode, AsyncCoreRawWrapperConfig, AsyncProperty, AsyncResult, AsyncValidatorFn, BuildArrayItem, BuildGroupItem, BuildRootInputItem, BuildRootItem, 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.5",
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;