@piying/view-vue2-legacy 2.10.0 → 2.10.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/component/field-control-bind.vue.d.ts +35 -0
- package/component/field-template.vue.d.ts +2 -0
- package/component/piying-view.vue.d.ts +3 -6
- package/index.d.ts +2 -0
- package/index.js +134 -80
- package/index.js.map +1 -1
- package/package.json +2 -2
- package/token.d.ts +1 -10
- package/util/convert-wrapper.d.ts +4 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { KeyPath } from '@piying/view-core';
|
|
2
|
+
import type { PiResolvedViewFieldConfig } from '../type/group';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
field: PiResolvedViewFieldConfig;
|
|
5
|
+
path?: KeyPath;
|
|
6
|
+
};
|
|
7
|
+
declare var __VLS_1: {
|
|
8
|
+
cvaa: {
|
|
9
|
+
value: import("vue").ShallowRef<any>;
|
|
10
|
+
disabled: import("vue").Ref<boolean>;
|
|
11
|
+
valueChange: (input: any) => void;
|
|
12
|
+
touchedChange: () => void;
|
|
13
|
+
};
|
|
14
|
+
field: PiResolvedViewFieldConfig | undefined;
|
|
15
|
+
};
|
|
16
|
+
type __VLS_Slots = {} & {
|
|
17
|
+
default?: (props: typeof __VLS_1) => any;
|
|
18
|
+
};
|
|
19
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>>, {}>;
|
|
20
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
21
|
+
declare const _default: typeof __VLS_export;
|
|
22
|
+
export default _default;
|
|
23
|
+
type __VLS_TypePropsToOption<T> = {
|
|
24
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
25
|
+
type: import('vue').PropType<Required<T>[K]>;
|
|
26
|
+
} : {
|
|
27
|
+
type: import('vue').PropType<T[K]>;
|
|
28
|
+
required: true;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
32
|
+
new (): {
|
|
33
|
+
$slots: S;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { PiResolvedViewFieldConfig } from '../type/group';
|
|
2
|
+
import { type KeyPath } from '@piying/view-core';
|
|
2
3
|
type __VLS_Props = {
|
|
3
4
|
field: PiResolvedViewFieldConfig;
|
|
5
|
+
path?: KeyPath;
|
|
4
6
|
};
|
|
5
7
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>>, {}>;
|
|
6
8
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import * as v from 'valibot';
|
|
2
|
-
import type {
|
|
2
|
+
import type { FieldConvertViewOptions } from '@piying/view-core';
|
|
3
3
|
type __VLS_Props = {
|
|
4
|
-
schema: v.BaseSchema<any, any, any
|
|
4
|
+
schema: v.BaseSchema<any, any, any>;
|
|
5
5
|
modelValue?: any;
|
|
6
|
-
options:
|
|
7
|
-
injector?: Injector;
|
|
8
|
-
[name: string]: any;
|
|
9
|
-
};
|
|
6
|
+
options: FieldConvertViewOptions;
|
|
10
7
|
};
|
|
11
8
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
12
9
|
"update:modelValue": (...args: any[]) => void;
|
package/index.d.ts
CHANGED
|
@@ -5,6 +5,8 @@ import PiyingFieldTemplate from './component/field-template.vue';
|
|
|
5
5
|
export { PiyingFieldTemplate };
|
|
6
6
|
import PiyingViewGroup from './component/group.vue';
|
|
7
7
|
export { PiyingViewGroup };
|
|
8
|
+
import PiyingFieldControlBind from './component/field-control-bind.vue';
|
|
9
|
+
export { PiyingFieldControlBind as Field, PiyingFieldControlBind };
|
|
8
10
|
export * from './type';
|
|
9
11
|
export * from './token';
|
|
10
12
|
export * from './builder';
|
package/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CoreSchemaHandle, FormBuilder, isFieldControl, isLazyMark, getLazyImport, createViewControlLink, convert, initListen } from "@piying/view-core";
|
|
2
1
|
import { effect, createRootInjector, ChangeDetectionSchedulerImpl, ChangeDetectionScheduler, createInjector, untracked } from "static-injector";
|
|
2
|
+
import { isFieldControl, isLazyMark, getLazyImport, createViewControlLink, FormBuilder, CoreSchemaHandle, createConvertToField, initListen } from "@piying/view-core";
|
|
3
3
|
var emptyObject = Object.freeze({});
|
|
4
4
|
var isArray = Array.isArray;
|
|
5
5
|
function isUndef(v) {
|
|
@@ -1439,17 +1439,17 @@ function normalizeArrayChildren(children, nestedIndex) {
|
|
|
1439
1439
|
}
|
|
1440
1440
|
return res;
|
|
1441
1441
|
}
|
|
1442
|
-
function renderList(val,
|
|
1442
|
+
function renderList(val, render6) {
|
|
1443
1443
|
var ret = null, i, l, keys, key;
|
|
1444
1444
|
if (isArray(val) || typeof val === "string") {
|
|
1445
1445
|
ret = new Array(val.length);
|
|
1446
1446
|
for (i = 0, l = val.length; i < l; i++) {
|
|
1447
|
-
ret[i] =
|
|
1447
|
+
ret[i] = render6(val[i], i);
|
|
1448
1448
|
}
|
|
1449
1449
|
} else if (typeof val === "number") {
|
|
1450
1450
|
ret = new Array(val);
|
|
1451
1451
|
for (i = 0; i < val; i++) {
|
|
1452
|
-
ret[i] =
|
|
1452
|
+
ret[i] = render6(i + 1, i);
|
|
1453
1453
|
}
|
|
1454
1454
|
} else if (isObject(val)) {
|
|
1455
1455
|
if (hasSymbol && val[Symbol.iterator]) {
|
|
@@ -1457,7 +1457,7 @@ function renderList(val, render5) {
|
|
|
1457
1457
|
var iterator = val[Symbol.iterator]();
|
|
1458
1458
|
var result = iterator.next();
|
|
1459
1459
|
while (!result.done) {
|
|
1460
|
-
ret.push(
|
|
1460
|
+
ret.push(render6(result.value, ret.length));
|
|
1461
1461
|
result = iterator.next();
|
|
1462
1462
|
}
|
|
1463
1463
|
} else {
|
|
@@ -1465,7 +1465,7 @@ function renderList(val, render5) {
|
|
|
1465
1465
|
ret = new Array(keys.length);
|
|
1466
1466
|
for (i = 0, l = keys.length; i < l; i++) {
|
|
1467
1467
|
key = keys[i];
|
|
1468
|
-
ret[i] =
|
|
1468
|
+
ret[i] = render6(val[key], key, i);
|
|
1469
1469
|
}
|
|
1470
1470
|
}
|
|
1471
1471
|
}
|
|
@@ -1899,7 +1899,7 @@ function renderMixin(Vue2) {
|
|
|
1899
1899
|
};
|
|
1900
1900
|
Vue2.prototype._render = function() {
|
|
1901
1901
|
var vm = this;
|
|
1902
|
-
var _a = vm.$options,
|
|
1902
|
+
var _a = vm.$options, render6 = _a.render, _parentVnode = _a._parentVnode;
|
|
1903
1903
|
if (_parentVnode && vm._isMounted) {
|
|
1904
1904
|
vm.$scopedSlots = normalizeScopedSlots(vm.$parent, _parentVnode.data.scopedSlots, vm.$slots, vm.$scopedSlots);
|
|
1905
1905
|
if (vm._slotsProxy) {
|
|
@@ -1913,7 +1913,7 @@ function renderMixin(Vue2) {
|
|
|
1913
1913
|
try {
|
|
1914
1914
|
setCurrentInstance(vm);
|
|
1915
1915
|
currentRenderingInstance = vm;
|
|
1916
|
-
vnode =
|
|
1916
|
+
vnode = render6.call(vm._renderProxy, vm.$createElement);
|
|
1917
1917
|
} catch (e) {
|
|
1918
1918
|
handleError(e, vm, "render");
|
|
1919
1919
|
if (process.env.NODE_ENV !== "production" && vm.$options.renderError) {
|
|
@@ -6775,15 +6775,8 @@ if (inBrowser) {
|
|
|
6775
6775
|
}
|
|
6776
6776
|
}, 0);
|
|
6777
6777
|
}
|
|
6778
|
-
class VueSchemaHandle extends CoreSchemaHandle {
|
|
6779
|
-
}
|
|
6780
|
-
class VueFormBuilder extends FormBuilder {
|
|
6781
|
-
}
|
|
6782
6778
|
const InjectorToken = /* @__PURE__ */ Symbol();
|
|
6783
6779
|
const PI_VIEW_FIELD_TOKEN = /* @__PURE__ */ Symbol();
|
|
6784
|
-
const PI_INPUT_OPTIONS_TOKEN = /* @__PURE__ */ Symbol();
|
|
6785
|
-
const PI_INPUT_SCHEMA_TOKEN = /* @__PURE__ */ Symbol();
|
|
6786
|
-
const PI_INPUT_MODEL_TOKEN = /* @__PURE__ */ Symbol();
|
|
6787
6780
|
function signalToRef(value) {
|
|
6788
6781
|
const injector = inject(InjectorToken);
|
|
6789
6782
|
const dataRef = shallowRef(void 0);
|
|
@@ -6850,7 +6843,7 @@ var freeze = function(e, t, n) {
|
|
|
6850
6843
|
}), e("div", { attrs: { fragment: this.name } }, n);
|
|
6851
6844
|
} };
|
|
6852
6845
|
var Fragment = component;
|
|
6853
|
-
const _sfc_main$
|
|
6846
|
+
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
6854
6847
|
__name: "wrapper",
|
|
6855
6848
|
props: {
|
|
6856
6849
|
wrappers: null
|
|
@@ -6864,10 +6857,10 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
6864
6857
|
return { __sfc: true, dInputs, restWrappers, wrapper, inputs, outputs, SelfComponent: PiWrapper, Fragment };
|
|
6865
6858
|
}
|
|
6866
6859
|
});
|
|
6867
|
-
function normalizeComponent(scriptExports,
|
|
6860
|
+
function normalizeComponent(scriptExports, render6, staticRenderFns, functionalTemplate, injectStyles, scopeId, moduleIdentifier, shadowMode) {
|
|
6868
6861
|
var options = typeof scriptExports === "function" ? scriptExports.options : scriptExports;
|
|
6869
|
-
if (
|
|
6870
|
-
options.render =
|
|
6862
|
+
if (render6) {
|
|
6863
|
+
options.render = render6;
|
|
6871
6864
|
options.staticRenderFns = staticRenderFns;
|
|
6872
6865
|
options._compiled = true;
|
|
6873
6866
|
}
|
|
@@ -6879,42 +6872,46 @@ function normalizeComponent(scriptExports, render5, staticRenderFns, functionalT
|
|
|
6879
6872
|
options
|
|
6880
6873
|
};
|
|
6881
6874
|
}
|
|
6882
|
-
var _sfc_render$
|
|
6875
|
+
var _sfc_render$4 = function render() {
|
|
6883
6876
|
var _vm = this, _c = _vm._self._c, _setup = _vm._self._setupProxy;
|
|
6884
6877
|
return _c(_setup.Fragment, [_setup.wrapper ? [_c(_setup.wrapper.type, _vm._g(_vm._b({ tag: "component" }, "component", _setup.inputs, false), _setup.outputs), [_c(_setup.SelfComponent, _vm._b({}, "self-component", { wrappers: _setup.restWrappers }, false), [_vm._t("default")], 2)], 1)] : [_vm._t("default")]], 2);
|
|
6885
6878
|
};
|
|
6886
|
-
var _sfc_staticRenderFns$
|
|
6887
|
-
var __component__$
|
|
6888
|
-
_sfc_main$
|
|
6889
|
-
_sfc_render$
|
|
6890
|
-
_sfc_staticRenderFns$
|
|
6879
|
+
var _sfc_staticRenderFns$4 = [];
|
|
6880
|
+
var __component__$4 = /* @__PURE__ */ normalizeComponent(
|
|
6881
|
+
_sfc_main$4,
|
|
6882
|
+
_sfc_render$4,
|
|
6883
|
+
_sfc_staticRenderFns$4,
|
|
6891
6884
|
false,
|
|
6892
6885
|
null,
|
|
6893
6886
|
"1a421ffb"
|
|
6894
6887
|
);
|
|
6895
|
-
const PiWrapper = __component__$
|
|
6896
|
-
const _sfc_main$
|
|
6888
|
+
const PiWrapper = __component__$4.exports;
|
|
6889
|
+
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
6897
6890
|
__name: "field-template",
|
|
6898
6891
|
props: {
|
|
6899
|
-
field: null
|
|
6892
|
+
field: null,
|
|
6893
|
+
path: null
|
|
6900
6894
|
},
|
|
6901
6895
|
setup(__props) {
|
|
6902
6896
|
const props2 = __props;
|
|
6897
|
+
const field = computed(() => {
|
|
6898
|
+
const keyPath = props2.path;
|
|
6899
|
+
return keyPath ? props2.field.get(keyPath) : props2.field;
|
|
6900
|
+
});
|
|
6903
6901
|
const injector = inject(InjectorToken);
|
|
6904
|
-
const renderConfig = signalToRef(() =>
|
|
6905
|
-
const inputs = signalToRef(() =>
|
|
6906
|
-
const attributes = signalToRef(() =>
|
|
6902
|
+
const renderConfig = signalToRef(() => field.value.renderConfig());
|
|
6903
|
+
const inputs = signalToRef(() => field.value.inputs?.());
|
|
6904
|
+
const attributes = signalToRef(() => field.value.attributes?.());
|
|
6907
6905
|
const fieldInput = computed(() => ({ ...attributes.value, ...inputs.value }));
|
|
6908
|
-
const outputs = signalToRef(() =>
|
|
6909
|
-
const events2 = signalToRef(() =>
|
|
6906
|
+
const outputs = signalToRef(() => field.value.outputs?.());
|
|
6907
|
+
const events2 = signalToRef(() => field.value.events?.());
|
|
6910
6908
|
const fieldOutput = computed(() => ({ ...outputs.value, ...events2.value }));
|
|
6911
|
-
const fieldChildren = signalToRef(() =>
|
|
6912
|
-
const wrappers = signalToRef(() =>
|
|
6913
|
-
const define = signalToRef(() =>
|
|
6909
|
+
const fieldChildren = signalToRef(() => field.value.children?.());
|
|
6910
|
+
const wrappers = signalToRef(() => field.value.wrappers());
|
|
6911
|
+
const define = signalToRef(() => field.value.define?.());
|
|
6914
6912
|
const componentType = computed(
|
|
6915
6913
|
() => typeof define.value?.type === "function" || isLazyMark(define.value?.type) ? defineAsyncComponent(getLazyImport(define.value?.type)) : define.value?.type
|
|
6916
6914
|
);
|
|
6917
|
-
const field = computed(() => props2.field);
|
|
6918
6915
|
provide(PI_VIEW_FIELD_TOKEN, field);
|
|
6919
6916
|
const childRef = shallowRef(null);
|
|
6920
6917
|
const isControl = isFieldControl(field.value.form.control);
|
|
@@ -6933,24 +6930,43 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
6933
6930
|
dispose?.(true);
|
|
6934
6931
|
dispose = void 0;
|
|
6935
6932
|
});
|
|
6936
|
-
return { __sfc: true, props: props2, injector, renderConfig, inputs, attributes, fieldInput, outputs, events: events2, fieldOutput, fieldChildren, wrappers, define, componentType,
|
|
6933
|
+
return { __sfc: true, props: props2, field, injector, renderConfig, inputs, attributes, fieldInput, outputs, events: events2, fieldOutput, fieldChildren, wrappers, define, componentType, childRef, isControl, dispose, PiWrapper, Fragment };
|
|
6937
6934
|
}
|
|
6938
6935
|
});
|
|
6939
|
-
var _sfc_render$
|
|
6936
|
+
var _sfc_render$3 = function render2() {
|
|
6940
6937
|
var _vm = this, _c = _vm._self._c, _setup = _vm._self._setupProxy;
|
|
6941
6938
|
return _c(_setup.Fragment, [!_setup.renderConfig.hidden ? [_setup.define?.type ? [_c(_setup.PiWrapper, { attrs: { "wrappers": _setup.wrappers } }, [_setup.fieldChildren ? [_c(_setup.componentType, _vm._g(_vm._b({ tag: "component" }, "component", _setup.fieldInput, false), _setup.fieldOutput))] : [_setup.field.form.control ? [_c(_setup.componentType, _vm._g(_vm._b({ ref: "childRef", tag: "component" }, "component", _setup.fieldInput, false), _setup.fieldOutput))] : [_c(_setup.componentType, _vm._g(_vm._b({ tag: "component" }, "component", _setup.fieldInput, false), _setup.fieldOutput))]]], 2)] : _vm._e()] : _vm._e()], 2);
|
|
6942
6939
|
};
|
|
6943
|
-
var _sfc_staticRenderFns$
|
|
6944
|
-
var __component__$
|
|
6945
|
-
_sfc_main$
|
|
6946
|
-
_sfc_render$
|
|
6947
|
-
_sfc_staticRenderFns$
|
|
6940
|
+
var _sfc_staticRenderFns$3 = [];
|
|
6941
|
+
var __component__$3 = /* @__PURE__ */ normalizeComponent(
|
|
6942
|
+
_sfc_main$3,
|
|
6943
|
+
_sfc_render$3,
|
|
6944
|
+
_sfc_staticRenderFns$3,
|
|
6948
6945
|
false,
|
|
6949
6946
|
null,
|
|
6950
|
-
"
|
|
6947
|
+
"8f9e37ed"
|
|
6951
6948
|
);
|
|
6952
|
-
const FieldTemplate = __component__$
|
|
6953
|
-
|
|
6949
|
+
const FieldTemplate = __component__$3.exports;
|
|
6950
|
+
class VueFormBuilder extends FormBuilder {
|
|
6951
|
+
}
|
|
6952
|
+
class VueSchemaHandle extends CoreSchemaHandle {
|
|
6953
|
+
}
|
|
6954
|
+
const DefaultConvertOptions = {
|
|
6955
|
+
builder: VueFormBuilder,
|
|
6956
|
+
handle: VueSchemaHandle
|
|
6957
|
+
};
|
|
6958
|
+
const convertToField = createConvertToField(
|
|
6959
|
+
DefaultConvertOptions,
|
|
6960
|
+
createRootInjector({
|
|
6961
|
+
providers: [
|
|
6962
|
+
{
|
|
6963
|
+
provide: ChangeDetectionScheduler,
|
|
6964
|
+
useClass: ChangeDetectionSchedulerImpl
|
|
6965
|
+
}
|
|
6966
|
+
]
|
|
6967
|
+
})
|
|
6968
|
+
);
|
|
6969
|
+
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
6954
6970
|
__name: "piying-view",
|
|
6955
6971
|
props: {
|
|
6956
6972
|
schema: null,
|
|
@@ -6972,18 +6988,6 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
6972
6988
|
})
|
|
6973
6989
|
);
|
|
6974
6990
|
provide(InjectorToken, rootInjector);
|
|
6975
|
-
provide(
|
|
6976
|
-
PI_INPUT_OPTIONS_TOKEN,
|
|
6977
|
-
computed(() => inputs.options)
|
|
6978
|
-
);
|
|
6979
|
-
provide(
|
|
6980
|
-
PI_INPUT_SCHEMA_TOKEN,
|
|
6981
|
-
computed(() => inputs.schema)
|
|
6982
|
-
);
|
|
6983
|
-
provide(
|
|
6984
|
-
PI_INPUT_MODEL_TOKEN,
|
|
6985
|
-
computed(() => inputs.modelValue)
|
|
6986
|
-
);
|
|
6987
6991
|
const initResult = shallowRef();
|
|
6988
6992
|
watch(
|
|
6989
6993
|
() => [inputs.schema, inputs.options, rootInjector.value],
|
|
@@ -6992,12 +6996,11 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
6992
6996
|
onCleanup(() => {
|
|
6993
6997
|
subInjector.destroy();
|
|
6994
6998
|
});
|
|
6995
|
-
const field2 =
|
|
6996
|
-
|
|
6997
|
-
|
|
6998
|
-
|
|
6999
|
-
|
|
7000
|
-
});
|
|
6999
|
+
const field2 = convertToField(
|
|
7000
|
+
() => inputs.schema,
|
|
7001
|
+
subInjector,
|
|
7002
|
+
() => inputs.options
|
|
7003
|
+
);
|
|
7001
7004
|
initResult.value = [field2, subInjector];
|
|
7002
7005
|
},
|
|
7003
7006
|
{ immediate: true }
|
|
@@ -7026,20 +7029,20 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
7026
7029
|
return { __sfc: true, inputs, emit, maybeParentField, rootInjector, initResult, field, FieldTemplate };
|
|
7027
7030
|
}
|
|
7028
7031
|
});
|
|
7029
|
-
var _sfc_render$
|
|
7032
|
+
var _sfc_render$2 = function render3() {
|
|
7030
7033
|
var _vm = this, _c = _vm._self._c, _setup = _vm._self._setupProxy;
|
|
7031
7034
|
return _c(_setup.FieldTemplate, { attrs: { "field": _setup.field } });
|
|
7032
7035
|
};
|
|
7033
|
-
var _sfc_staticRenderFns$
|
|
7034
|
-
var __component__$
|
|
7035
|
-
_sfc_main$
|
|
7036
|
-
_sfc_render$
|
|
7037
|
-
_sfc_staticRenderFns$
|
|
7036
|
+
var _sfc_staticRenderFns$2 = [];
|
|
7037
|
+
var __component__$2 = /* @__PURE__ */ normalizeComponent(
|
|
7038
|
+
_sfc_main$2,
|
|
7039
|
+
_sfc_render$2,
|
|
7040
|
+
_sfc_staticRenderFns$2,
|
|
7038
7041
|
false,
|
|
7039
7042
|
null,
|
|
7040
|
-
"
|
|
7043
|
+
"9d8be97a"
|
|
7041
7044
|
);
|
|
7042
|
-
const piyingView = __component__$
|
|
7045
|
+
const piyingView = __component__$2.exports;
|
|
7043
7046
|
function useControlValueAccessor(autoChange = true, optionalBind) {
|
|
7044
7047
|
const value = shallowRef();
|
|
7045
7048
|
const disabled = ref$1(false);
|
|
@@ -7087,7 +7090,7 @@ function useControlValueAccessor(autoChange = true, optionalBind) {
|
|
|
7087
7090
|
}
|
|
7088
7091
|
};
|
|
7089
7092
|
}
|
|
7090
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
7093
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
7091
7094
|
__name: "group",
|
|
7092
7095
|
setup(__props) {
|
|
7093
7096
|
const field = inject(PI_VIEW_FIELD_TOKEN);
|
|
@@ -7095,12 +7098,64 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
7095
7098
|
return { __sfc: true, field, children, FieldTemplate, Fragment };
|
|
7096
7099
|
}
|
|
7097
7100
|
});
|
|
7098
|
-
var _sfc_render = function render4() {
|
|
7101
|
+
var _sfc_render$1 = function render4() {
|
|
7099
7102
|
var _vm = this, _c = _vm._self._c, _setup = _vm._self._setupProxy;
|
|
7100
7103
|
return _c(_setup.Fragment, [_vm._l(_setup.children, function(field, index2) {
|
|
7101
7104
|
return [_c(_setup.FieldTemplate, { key: index2, attrs: { "field": field } })];
|
|
7102
7105
|
})], 2);
|
|
7103
7106
|
};
|
|
7107
|
+
var _sfc_staticRenderFns$1 = [];
|
|
7108
|
+
var __component__$1 = /* @__PURE__ */ normalizeComponent(
|
|
7109
|
+
_sfc_main$1,
|
|
7110
|
+
_sfc_render$1,
|
|
7111
|
+
_sfc_staticRenderFns$1,
|
|
7112
|
+
false,
|
|
7113
|
+
null,
|
|
7114
|
+
"038a7f41"
|
|
7115
|
+
);
|
|
7116
|
+
const group = __component__$1.exports;
|
|
7117
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
7118
|
+
__name: "field-control-bind",
|
|
7119
|
+
props: {
|
|
7120
|
+
field: null,
|
|
7121
|
+
path: null
|
|
7122
|
+
},
|
|
7123
|
+
setup(__props) {
|
|
7124
|
+
const props2 = __props;
|
|
7125
|
+
const resolvedField = computed(() => {
|
|
7126
|
+
const keyPath = props2.path;
|
|
7127
|
+
return keyPath ? props2.field.get(keyPath) : props2.field;
|
|
7128
|
+
});
|
|
7129
|
+
let dispose;
|
|
7130
|
+
const { cva, cvaa } = useControlValueAccessor();
|
|
7131
|
+
watch(
|
|
7132
|
+
[resolvedField],
|
|
7133
|
+
([field]) => {
|
|
7134
|
+
dispose?.();
|
|
7135
|
+
if (field?.form?.control) {
|
|
7136
|
+
const control = field.form.control;
|
|
7137
|
+
if (!control) {
|
|
7138
|
+
throw new Error(`📍 fieldControlBind:[${field.keyPath || ""}]->[${props2.path || ""}]❗`);
|
|
7139
|
+
}
|
|
7140
|
+
if (!isFieldControl(control)) {
|
|
7141
|
+
throw new Error(`🏷️ fieldControl❗`);
|
|
7142
|
+
}
|
|
7143
|
+
dispose = createViewControlLink(() => control, cva, field.injector);
|
|
7144
|
+
}
|
|
7145
|
+
},
|
|
7146
|
+
{ immediate: true }
|
|
7147
|
+
);
|
|
7148
|
+
onUnmounted(() => {
|
|
7149
|
+
dispose?.(true);
|
|
7150
|
+
dispose = void 0;
|
|
7151
|
+
});
|
|
7152
|
+
return { __sfc: true, props: props2, resolvedField, dispose, cva, cvaa };
|
|
7153
|
+
}
|
|
7154
|
+
});
|
|
7155
|
+
var _sfc_render = function render5() {
|
|
7156
|
+
var _vm = this, _c = _vm._self._c, _setup = _vm._self._setupProxy;
|
|
7157
|
+
return _c("div", [_vm._t("default", null, { "cvaa": _setup.cvaa, "field": _setup.resolvedField })], 2);
|
|
7158
|
+
};
|
|
7104
7159
|
var _sfc_staticRenderFns = [];
|
|
7105
7160
|
var __component__ = /* @__PURE__ */ normalizeComponent(
|
|
7106
7161
|
_sfc_main,
|
|
@@ -7108,15 +7163,14 @@ var __component__ = /* @__PURE__ */ normalizeComponent(
|
|
|
7108
7163
|
_sfc_staticRenderFns,
|
|
7109
7164
|
false,
|
|
7110
7165
|
null,
|
|
7111
|
-
"
|
|
7166
|
+
"7747f509"
|
|
7112
7167
|
);
|
|
7113
|
-
const
|
|
7168
|
+
const fieldControlBind = __component__.exports;
|
|
7114
7169
|
export {
|
|
7170
|
+
fieldControlBind as Field,
|
|
7115
7171
|
InjectorToken,
|
|
7116
|
-
PI_INPUT_MODEL_TOKEN,
|
|
7117
|
-
PI_INPUT_OPTIONS_TOKEN,
|
|
7118
|
-
PI_INPUT_SCHEMA_TOKEN,
|
|
7119
7172
|
PI_VIEW_FIELD_TOKEN,
|
|
7173
|
+
fieldControlBind as PiyingFieldControlBind,
|
|
7120
7174
|
FieldTemplate as PiyingFieldTemplate,
|
|
7121
7175
|
piyingView as PiyingView,
|
|
7122
7176
|
group as PiyingViewGroup,
|