@piying/view-angular-core 1.5.1 → 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/fesm2022/piying-view-angular-core-test.mjs +7 -29
- package/fesm2022/piying-view-angular-core-test.mjs.map +1 -1
- package/fesm2022/piying-view-angular-core.mjs +124 -43
- package/fesm2022/piying-view-angular-core.mjs.map +1 -1
- package/index.d.ts +17 -15
- package/package.json +1 -1
- package/test/index.d.ts +1 -1
|
@@ -1,33 +1,11 @@
|
|
|
1
|
-
import { rawConfig, FieldGroup, isFieldGroup, FieldArray, isFieldArray, FieldControl, isFieldControl, FieldLogicGroup, isFieldLogicGroup } from '@piying/view-angular-core';
|
|
1
|
+
import { rawConfig, mergeHooksFn, FieldGroup, isFieldGroup, FieldArray, isFieldArray, FieldControl, isFieldControl, FieldLogicGroup, isFieldLogicGroup } from '@piying/view-angular-core';
|
|
2
2
|
|
|
3
|
-
const getField = (field$, hooks = '
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
};
|
|
10
|
-
break;
|
|
11
|
-
}
|
|
12
|
-
case 'fieldInit': {
|
|
13
|
-
field.hooks.fieldResolved = (field) => {
|
|
14
|
-
field$.resolve(field);
|
|
15
|
-
};
|
|
16
|
-
break;
|
|
17
|
-
}
|
|
18
|
-
case 'afterComponent': {
|
|
19
|
-
field.hooks.afterCreateComponent = (field) => {
|
|
20
|
-
field$.resolve(field);
|
|
21
|
-
};
|
|
22
|
-
break;
|
|
23
|
-
}
|
|
24
|
-
case 'beforeComponent': {
|
|
25
|
-
field.hooks.beforeCreateComponent = (field) => {
|
|
26
|
-
field$.resolve(field);
|
|
27
|
-
};
|
|
28
|
-
break;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
3
|
+
const getField = (field$, hooks = 'allFieldsResolved') => rawConfig((field) => {
|
|
4
|
+
mergeHooksFn({
|
|
5
|
+
[hooks]: (field) => {
|
|
6
|
+
field$.resolve(field);
|
|
7
|
+
},
|
|
8
|
+
}, { position: 'bottom' }, field);
|
|
31
9
|
});
|
|
32
10
|
|
|
33
11
|
function keyEqual(input1, input2) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"piying-view-angular-core-test.mjs","sources":["../../../projects/view-angular-core/test/util/action.ts","../../../projects/view-angular-core/test/util/key-equal.ts","../../../projects/view-angular-core/test/util/type-equal.ts","../../../projects/view-angular-core/test/util/is-field.ts","../../../projects/view-angular-core/test/piying-view-angular-core-test.ts"],"sourcesContent":["import { RawConfigActionCommon } from '@piying/valibot-visit';\nimport {\n _PiResolvedCommonViewFieldConfig,\n rawConfig,\n} from '@piying/view-angular-core';\nexport type GetFieldType<T> = <B>(\n field$: PromiseWithResolvers<T>,\n hooks?:\n | '
|
|
1
|
+
{"version":3,"file":"piying-view-angular-core-test.mjs","sources":["../../../projects/view-angular-core/test/util/action.ts","../../../projects/view-angular-core/test/util/key-equal.ts","../../../projects/view-angular-core/test/util/type-equal.ts","../../../projects/view-angular-core/test/util/is-field.ts","../../../projects/view-angular-core/test/piying-view-angular-core-test.ts"],"sourcesContent":["import { RawConfigActionCommon } from '@piying/valibot-visit';\nimport {\n _PiResolvedCommonViewFieldConfig,\n mergeHooksFn,\n rawConfig,\n} from '@piying/view-angular-core';\nexport type GetFieldType<T> = <B>(\n field$: PromiseWithResolvers<T>,\n hooks?:\n | 'allFieldsResolved'\n | 'fieldResolved'\n | 'beforeCreateComponent'\n | 'afterCreateComponent',\n) => RawConfigActionCommon<B>;\nexport const getField: GetFieldType<_PiResolvedCommonViewFieldConfig> = (\n field$,\n hooks = 'allFieldsResolved',\n) =>\n rawConfig((field) => {\n mergeHooksFn(\n {\n [hooks]: (field: any) => {\n field$.resolve(field as any);\n },\n },\n { position: 'bottom' },\n field,\n );\n });\n","declare const expect: any;\n\nexport function keyEqual(input1: any, input2: any) {\n if (input1 === input2) {\n expect(input1).toEqual(input2);\n return;\n }\n\n if (input1 === undefined || input2 === undefined) {\n expect(input1).toEqual(input2);\n return;\n }\n input1 = Array.isArray(input1)\n ? input1\n : input1 === undefined\n ? []\n : [input1];\n input2 = Array.isArray(input2)\n ? input2\n : input2 === undefined\n ? []\n : [input2];\n\n if (input1.length !== input2.length) {\n throw new Error(`${input1} != ${input2}`);\n }\n for (let index = 0; index < input1.length; index++) {\n const i1 = input1[index];\n const i2 = input2[index];\n expect(i1).toEqual(i2);\n }\n}\n","declare const expect: any;\n\nexport function typeEqual(input1: any, input2: any) {\n expect(input1).toEqual(input2);\n}\n","import {\n FieldArray,\n FieldControl,\n FieldGroup,\n FieldLogicGroup,\n isFieldArray,\n isFieldControl,\n isFieldGroup,\n isFieldLogicGroup,\n} from '@piying/view-angular-core';\ndeclare const expect: any;\nexport function assertFieldGroup(input: any): asserts input is FieldGroup {\n if (!(input instanceof FieldGroup)) {\n throw new Error('FieldGroup验证失败');\n }\n expect(isFieldGroup(input)).toBeTrue();\n}\nexport function assertFieldArray(input: any): asserts input is FieldArray {\n if (!(input instanceof FieldArray)) {\n throw new Error('FieldArray验证失败');\n }\n expect(isFieldArray(input)).toBeTrue();\n}\nexport function assertFieldControl(input: any): asserts input is FieldControl {\n if (!(input instanceof FieldControl)) {\n throw new Error('FieldControl验证失败');\n }\n expect(isFieldControl(input)).toBeTrue();\n}\nexport function assertFieldLogicGroup(\n input: any,\n): asserts input is FieldLogicGroup {\n if (!(input instanceof FieldLogicGroup)) {\n throw new Error('FieldLogicGroup验证失败');\n }\n expect(isFieldLogicGroup(input)).toBeTrue();\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAcO,MAAM,QAAQ,GAAmD,CACtE,MAAM,EACN,KAAK,GAAG,mBAAmB,KAE3B,SAAS,CAAC,CAAC,KAAK,KAAI;AAClB,IAAA,YAAY,CACV;AACE,QAAA,CAAC,KAAK,GAAG,CAAC,KAAU,KAAI;AACtB,YAAA,MAAM,CAAC,OAAO,CAAC,KAAY,CAAC;QAC9B,CAAC;KACF,EACD,EAAE,QAAQ,EAAE,QAAQ,EAAE,EACtB,KAAK,CACN;AACH,CAAC;;AC1BG,SAAU,QAAQ,CAAC,MAAW,EAAE,MAAW,EAAA;AAC/C,IAAA,IAAI,MAAM,KAAK,MAAM,EAAE;QACrB,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC;QAC9B;IACF;IAEA,IAAI,MAAM,KAAK,SAAS,IAAI,MAAM,KAAK,SAAS,EAAE;QAChD,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC;QAC9B;IACF;AACA,IAAA,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM;AAC3B,UAAE;UACA,MAAM,KAAK;AACX,cAAE;AACF,cAAE,CAAC,MAAM,CAAC;AACd,IAAA,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM;AAC3B,UAAE;UACA,MAAM,KAAK;AACX,cAAE;AACF,cAAE,CAAC,MAAM,CAAC;IAEd,IAAI,MAAM,CAAC,MAAM,KAAK,MAAM,CAAC,MAAM,EAAE;QACnC,MAAM,IAAI,KAAK,CAAC,CAAA,EAAG,MAAM,CAAA,IAAA,EAAO,MAAM,CAAA,CAAE,CAAC;IAC3C;AACA,IAAA,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;AAClD,QAAA,MAAM,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC;AACxB,QAAA,MAAM,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC;QACxB,MAAM,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IACxB;AACF;;AC7BM,SAAU,SAAS,CAAC,MAAW,EAAE,MAAW,EAAA;IAChD,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC;AAChC;;ACOM,SAAU,gBAAgB,CAAC,KAAU,EAAA;AACzC,IAAA,IAAI,EAAE,KAAK,YAAY,UAAU,CAAC,EAAE;AAClC,QAAA,MAAM,IAAI,KAAK,CAAC,gBAAgB,CAAC;IACnC;IACA,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,EAAE;AACxC;AACM,SAAU,gBAAgB,CAAC,KAAU,EAAA;AACzC,IAAA,IAAI,EAAE,KAAK,YAAY,UAAU,CAAC,EAAE;AAClC,QAAA,MAAM,IAAI,KAAK,CAAC,gBAAgB,CAAC;IACnC;IACA,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,EAAE;AACxC;AACM,SAAU,kBAAkB,CAAC,KAAU,EAAA;AAC3C,IAAA,IAAI,EAAE,KAAK,YAAY,YAAY,CAAC,EAAE;AACpC,QAAA,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC;IACrC;IACA,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,EAAE;AAC1C;AACM,SAAU,qBAAqB,CACnC,KAAU,EAAA;AAEV,IAAA,IAAI,EAAE,KAAK,YAAY,eAAe,CAAC,EAAE;AACvC,QAAA,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC;IACxC;IACA,MAAM,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,EAAE;AAC7C;;ACpCA;;AAEG;;;;"}
|
|
@@ -1146,6 +1146,32 @@ function fieldQuery(keyPath, field, aliasMap, root) {
|
|
|
1146
1146
|
return undefined;
|
|
1147
1147
|
}
|
|
1148
1148
|
|
|
1149
|
+
const FindConfigToken = new InjectionToken('FindConfig');
|
|
1150
|
+
function FindConfigFactory() {
|
|
1151
|
+
const globalConfig = inject(PI_VIEW_CONFIG_TOKEN);
|
|
1152
|
+
return {
|
|
1153
|
+
findWrapper: (wrapper) => {
|
|
1154
|
+
let config;
|
|
1155
|
+
let type;
|
|
1156
|
+
if (typeof wrapper === 'string') {
|
|
1157
|
+
config = globalConfig?.wrappers?.[wrapper];
|
|
1158
|
+
type = wrapper;
|
|
1159
|
+
}
|
|
1160
|
+
else if (typeof wrapper.type === 'string') {
|
|
1161
|
+
config = globalConfig?.wrappers?.[wrapper.type];
|
|
1162
|
+
type = wrapper.type;
|
|
1163
|
+
}
|
|
1164
|
+
else {
|
|
1165
|
+
config = wrapper;
|
|
1166
|
+
}
|
|
1167
|
+
if (!config) {
|
|
1168
|
+
throw new Error(`🈳wrapper:[${type}]❗`);
|
|
1169
|
+
}
|
|
1170
|
+
return config;
|
|
1171
|
+
},
|
|
1172
|
+
};
|
|
1173
|
+
}
|
|
1174
|
+
|
|
1149
1175
|
var _a;
|
|
1150
1176
|
class FormBuilder {
|
|
1151
1177
|
#scopeMap = inject(PI_FORM_BUILDER_ALIAS_MAP, { optional: true }) ??
|
|
@@ -1285,6 +1311,7 @@ class FormBuilder {
|
|
|
1285
1311
|
attributes,
|
|
1286
1312
|
define: define ? { ...define, inputs, outputs, attributes } : undefined,
|
|
1287
1313
|
wrappers,
|
|
1314
|
+
injector: this.#envInjector,
|
|
1288
1315
|
};
|
|
1289
1316
|
resolvedConfig =
|
|
1290
1317
|
this.afterResolveConfig(field, resolvedConfig) ?? resolvedConfig;
|
|
@@ -1571,14 +1598,12 @@ class FormBuilder {
|
|
|
1571
1598
|
inputField.parent = parent;
|
|
1572
1599
|
parent.fixedChildren().push(inputField);
|
|
1573
1600
|
}
|
|
1601
|
+
#findConfig = inject(FindConfigToken);
|
|
1574
1602
|
#resolveWrappers(wrappers) {
|
|
1575
1603
|
const result = (wrappers ?? []).map((wrapper) => {
|
|
1576
1604
|
// 查引用1
|
|
1605
|
+
const config = this.#findConfig.findWrapper(wrapper);
|
|
1577
1606
|
if (typeof wrapper === 'string') {
|
|
1578
|
-
const config = this.#globalConfig?.wrappers?.[wrapper];
|
|
1579
|
-
if (!config) {
|
|
1580
|
-
throw new Error(`🈳wrapper:[${wrapper}]❗`);
|
|
1581
|
-
}
|
|
1582
1607
|
return {
|
|
1583
1608
|
...config,
|
|
1584
1609
|
inputs: signal(config.inputs),
|
|
@@ -1587,10 +1612,6 @@ class FormBuilder {
|
|
|
1587
1612
|
}
|
|
1588
1613
|
else if (typeof wrapper.type === 'string') {
|
|
1589
1614
|
// 查引用2
|
|
1590
|
-
const config = this.#globalConfig?.wrappers?.[wrapper.type];
|
|
1591
|
-
if (!config) {
|
|
1592
|
-
throw new Error(`🈳wrapper:[${wrapper.type}]❗`);
|
|
1593
|
-
}
|
|
1594
1615
|
return {
|
|
1595
1616
|
inputs: signal({ ...config.inputs, ...wrapper.inputs }),
|
|
1596
1617
|
outputs: { ...config.outputs, ...wrapper.outputs },
|
|
@@ -1634,7 +1655,7 @@ const setHooks = (hooks) => rawConfig((field) => {
|
|
|
1634
1655
|
const patchHooks = (hooks) => rawConfig((field) => {
|
|
1635
1656
|
field.hooks = { ...field.hooks, ...hooks };
|
|
1636
1657
|
});
|
|
1637
|
-
const DefaultOptions
|
|
1658
|
+
const DefaultOptions = { position: 'bottom' };
|
|
1638
1659
|
function mergeHooksFn(hooks, options, field) {
|
|
1639
1660
|
field.hooks ??= {};
|
|
1640
1661
|
for (const key in hooks) {
|
|
@@ -1650,7 +1671,7 @@ function mergeHooksFn(hooks, options, field) {
|
|
|
1650
1671
|
};
|
|
1651
1672
|
}
|
|
1652
1673
|
}
|
|
1653
|
-
const mergeHooks = (hooks, options = DefaultOptions
|
|
1674
|
+
const mergeHooks = (hooks, options = DefaultOptions) => rawConfig((field) => mergeHooksFn(hooks, options, field));
|
|
1654
1675
|
function removeHooks(list) {
|
|
1655
1676
|
return rawConfig((field) => {
|
|
1656
1677
|
const oldValue = field.hooks;
|
|
@@ -1755,7 +1776,9 @@ function patchAsyncFn(patchKey) {
|
|
|
1755
1776
|
obj[key] = value(field);
|
|
1756
1777
|
return obj;
|
|
1757
1778
|
}, {}), field[patchKey]);
|
|
1758
|
-
|
|
1779
|
+
if (patchKey !== 'props') {
|
|
1780
|
+
field.define[patchKey] = result;
|
|
1781
|
+
}
|
|
1759
1782
|
field[patchKey] =
|
|
1760
1783
|
result;
|
|
1761
1784
|
},
|
|
@@ -1818,57 +1841,72 @@ function removeProps(list) {
|
|
|
1818
1841
|
}
|
|
1819
1842
|
const patchAsyncProps = patchAsyncFn('props');
|
|
1820
1843
|
|
|
1821
|
-
function
|
|
1844
|
+
function createOutputListener(outputs, options) {
|
|
1822
1845
|
return rawConfig((field) => {
|
|
1823
|
-
|
|
1846
|
+
mergeHooksFn({
|
|
1847
|
+
allFieldsResolved: (field) => {
|
|
1848
|
+
field.outputs.update((originOutputs) => {
|
|
1849
|
+
originOutputs = options.setOutputs ? {} : { ...originOutputs };
|
|
1850
|
+
for (const key in outputs) {
|
|
1851
|
+
const oldFn = originOutputs[key];
|
|
1852
|
+
originOutputs[key] = (...args) => {
|
|
1853
|
+
if (options.mergeOutput && oldFn) {
|
|
1854
|
+
oldFn(...args, field);
|
|
1855
|
+
}
|
|
1856
|
+
return outputs[key](...args, field);
|
|
1857
|
+
};
|
|
1858
|
+
}
|
|
1859
|
+
return originOutputs;
|
|
1860
|
+
});
|
|
1861
|
+
},
|
|
1862
|
+
}, { position: 'bottom' }, field);
|
|
1863
|
+
});
|
|
1864
|
+
}
|
|
1865
|
+
function setOutputs(outputs) {
|
|
1866
|
+
return createOutputListener(outputs, {
|
|
1867
|
+
setOutputs: true,
|
|
1868
|
+
mergeOutput: false,
|
|
1824
1869
|
});
|
|
1825
1870
|
}
|
|
1826
1871
|
function patchOutputs(outputs) {
|
|
1827
|
-
return
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
...oldValue,
|
|
1831
|
-
...outputs,
|
|
1832
|
-
};
|
|
1872
|
+
return createOutputListener(outputs, {
|
|
1873
|
+
setOutputs: false,
|
|
1874
|
+
mergeOutput: false,
|
|
1833
1875
|
});
|
|
1834
1876
|
}
|
|
1835
1877
|
function removeOutputs(list) {
|
|
1836
1878
|
return rawConfig((field) => {
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1879
|
+
mergeHooksFn({
|
|
1880
|
+
allFieldsResolved: (field) => {
|
|
1881
|
+
field.outputs.update((originOutputs) => {
|
|
1882
|
+
originOutputs = { ...originOutputs };
|
|
1883
|
+
list.forEach((key) => {
|
|
1884
|
+
if (key in originOutputs) {
|
|
1885
|
+
delete originOutputs[key];
|
|
1886
|
+
}
|
|
1887
|
+
});
|
|
1888
|
+
return originOutputs;
|
|
1889
|
+
});
|
|
1890
|
+
},
|
|
1891
|
+
}, { position: 'bottom' }, field);
|
|
1845
1892
|
});
|
|
1846
1893
|
}
|
|
1847
|
-
function mergeOutputFn(field, outputs
|
|
1894
|
+
function mergeOutputFn(field, outputs) {
|
|
1848
1895
|
field.outputs.update((originOutputs) => {
|
|
1849
1896
|
originOutputs = { ...originOutputs };
|
|
1850
1897
|
for (const key in outputs) {
|
|
1851
1898
|
const oldFn = originOutputs[key];
|
|
1852
1899
|
originOutputs[key] = (...args) => {
|
|
1853
|
-
if (options.position === 'top') {
|
|
1854
|
-
outputs[key](...args, field);
|
|
1855
|
-
}
|
|
1856
1900
|
oldFn?.(...args, field);
|
|
1857
|
-
|
|
1858
|
-
outputs[key](...args, field);
|
|
1859
|
-
}
|
|
1901
|
+
outputs[key](...args, field);
|
|
1860
1902
|
};
|
|
1861
1903
|
}
|
|
1862
1904
|
return originOutputs;
|
|
1863
1905
|
});
|
|
1864
1906
|
}
|
|
1865
|
-
const
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
allFieldsResolved: (field) => {
|
|
1869
|
-
mergeOutputFn(field, outputs, options);
|
|
1870
|
-
},
|
|
1871
|
-
}, { position: 'bottom' }, field);
|
|
1907
|
+
const mergeOutputs = (outputs) => createOutputListener(outputs, {
|
|
1908
|
+
setOutputs: false,
|
|
1909
|
+
mergeOutput: true,
|
|
1872
1910
|
});
|
|
1873
1911
|
function outputChangeFn(rawField, fn) {
|
|
1874
1912
|
mergeHooksFn({
|
|
@@ -1881,7 +1919,7 @@ function outputChangeFn(rawField, fn) {
|
|
|
1881
1919
|
[item.output]: (...args) => {
|
|
1882
1920
|
subject.next(args);
|
|
1883
1921
|
},
|
|
1884
|
-
}
|
|
1922
|
+
});
|
|
1885
1923
|
resultList.push({
|
|
1886
1924
|
subject,
|
|
1887
1925
|
field: emitField,
|
|
@@ -1919,6 +1957,48 @@ function patchWrappers(wrappers, options = defaultValue) {
|
|
|
1919
1957
|
}
|
|
1920
1958
|
});
|
|
1921
1959
|
}
|
|
1960
|
+
function patchAsyncWrapper(inputWrapper, options = defaultValue) {
|
|
1961
|
+
return rawConfig((field) => {
|
|
1962
|
+
mergeHooksFn({
|
|
1963
|
+
allFieldsResolved: (field) => {
|
|
1964
|
+
const findConfig = field.injector.get(FindConfigToken);
|
|
1965
|
+
let inputs$ = signal({});
|
|
1966
|
+
if (inputWrapper.inputs && Object.keys(inputWrapper.inputs).length) {
|
|
1967
|
+
inputs$ = asyncInputMerge(Object.entries(inputWrapper.inputs).reduce((obj, [key, value]) => {
|
|
1968
|
+
obj[key] = value(field);
|
|
1969
|
+
return obj;
|
|
1970
|
+
}, {}), inputs$);
|
|
1971
|
+
}
|
|
1972
|
+
let attributes$ = signal({});
|
|
1973
|
+
if (inputWrapper.attributes &&
|
|
1974
|
+
Object.keys(inputWrapper.attributes).length) {
|
|
1975
|
+
attributes$ = asyncInputMerge(Object.entries(inputWrapper.attributes).reduce((obj, [key, value]) => {
|
|
1976
|
+
obj[key] = value(field);
|
|
1977
|
+
return obj;
|
|
1978
|
+
}, {}), attributes$);
|
|
1979
|
+
}
|
|
1980
|
+
const oldOutputs = inputWrapper.outputs;
|
|
1981
|
+
const outputs = {};
|
|
1982
|
+
if (oldOutputs && Object.keys(oldOutputs).length) {
|
|
1983
|
+
for (const key in oldOutputs) {
|
|
1984
|
+
const oldFn = oldOutputs[key];
|
|
1985
|
+
outputs[key] = (...args) => oldFn(...args, field);
|
|
1986
|
+
}
|
|
1987
|
+
}
|
|
1988
|
+
const defaultWrapperConfig = findConfig.findWrapper(inputWrapper);
|
|
1989
|
+
const newWrapper = {
|
|
1990
|
+
...defaultWrapperConfig,
|
|
1991
|
+
inputs: inputs$,
|
|
1992
|
+
outputs,
|
|
1993
|
+
attributes: attributes$,
|
|
1994
|
+
};
|
|
1995
|
+
field.wrappers.update((wrappers) => options.position === 'tail'
|
|
1996
|
+
? [...wrappers, newWrapper]
|
|
1997
|
+
: [newWrapper, ...wrappers]);
|
|
1998
|
+
},
|
|
1999
|
+
}, { position: 'bottom' }, field);
|
|
2000
|
+
});
|
|
2001
|
+
}
|
|
1922
2002
|
function removeWrappers(list) {
|
|
1923
2003
|
return rawConfig((field) => {
|
|
1924
2004
|
if (!field.wrappers) {
|
|
@@ -2245,6 +2325,7 @@ function convert(obj, options) {
|
|
|
2245
2325
|
provide: PI_CONTEXT_TOKEN,
|
|
2246
2326
|
useValue: options.context,
|
|
2247
2327
|
},
|
|
2328
|
+
{ provide: FindConfigToken, useFactory: FindConfigFactory },
|
|
2248
2329
|
options.builder,
|
|
2249
2330
|
{ provide: EnvironmentInjector, useFactory: () => injector },
|
|
2250
2331
|
],
|
|
@@ -2272,5 +2353,5 @@ const NFCSchema = v.optional(v.void());
|
|
|
2272
2353
|
* Generated bundle index. Do not edit.
|
|
2273
2354
|
*/
|
|
2274
2355
|
|
|
2275
|
-
export { AbstractControl, CoreSchemaHandle, FieldArray, FieldControl, FieldGroup, FieldLogicGroup, FormBuilder, INVALID, NFCSchema, PENDING, PI_CONTEXT_TOKEN, PI_FORM_BUILDER_ALIAS_MAP, PI_FORM_BUILDER_OPTIONS_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$1 as unWrapSignal, valueChange, valueChangeFn };
|
|
2356
|
+
export { AbstractControl, CoreSchemaHandle, FieldArray, FieldControl, FieldGroup, FieldLogicGroup, FormBuilder, INVALID, NFCSchema, PENDING, PI_CONTEXT_TOKEN, PI_FORM_BUILDER_ALIAS_MAP, PI_FORM_BUILDER_OPTIONS_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$1 as unWrapSignal, valueChange, valueChangeFn };
|
|
2276
2357
|
//# sourceMappingURL=piying-view-angular-core.mjs.map
|