@piying/view-vue2-legacy 2.4.4 → 2.4.6

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.
Files changed (3) hide show
  1. package/index.js +28 -27
  2. package/index.js.map +1 -1
  3. package/package.json +2 -2
package/index.js CHANGED
@@ -6901,11 +6901,13 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
6901
6901
  setup(__props) {
6902
6902
  const props2 = __props;
6903
6903
  const injector = inject(InjectorToken);
6904
- const inputs = signalToRef(() => props2.field.inputs());
6905
- const outputs = signalToRef(() => props2.field.outputs());
6906
6904
  const renderConfig = signalToRef(() => props2.field.renderConfig());
6907
- const attributes = signalToRef(() => props2.field.attributes());
6905
+ const inputs = signalToRef(() => props2.field.inputs?.());
6906
+ const attributes = signalToRef(() => props2.field.attributes?.());
6908
6907
  const fieldInput = computed(() => ({ ...attributes.value, ...inputs.value }));
6908
+ const outputs = signalToRef(() => props2.field.outputs?.());
6909
+ const events2 = signalToRef(() => props2.field.events?.());
6910
+ const fieldOutput = computed(() => ({ ...outputs.value, ...events2.value }));
6909
6911
  const fieldChildren = signalToRef(() => props2.field.children?.());
6910
6912
  const wrappers = signalToRef(() => props2.field.wrappers());
6911
6913
  const define = signalToRef(() => props2.field.define?.());
@@ -6931,12 +6933,12 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
6931
6933
  dispose?.(true);
6932
6934
  dispose = void 0;
6933
6935
  });
6934
- return { __sfc: true, props: props2, injector, inputs, outputs, renderConfig, attributes, fieldInput, fieldChildren, wrappers, define, componentType, field, childRef, isControl, dispose, PiWrapper, Fragment };
6936
+ return { __sfc: true, props: props2, injector, renderConfig, inputs, attributes, fieldInput, outputs, events: events2, fieldOutput, fieldChildren, wrappers, define, componentType, field, childRef, isControl, dispose, PiWrapper, Fragment };
6935
6937
  }
6936
6938
  });
6937
6939
  var _sfc_render$2 = function render2() {
6938
6940
  var _vm = this, _c = _vm._self._c, _setup = _vm._self._setupProxy;
6939
- 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.outputs))] : [_setup.field.form.control ? [_c(_setup.componentType, _vm._g(_vm._b({ ref: "childRef", tag: "component" }, "component", _setup.fieldInput, false), _setup.outputs))] : [_c(_setup.componentType, _vm._g(_vm._b({ tag: "component" }, "component", _setup.fieldInput, false), _setup.outputs))]]], 2)] : _vm._e()] : _vm._e()], 2);
6941
+ 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);
6940
6942
  };
6941
6943
  var _sfc_staticRenderFns$2 = [];
6942
6944
  var __component__$2 = /* @__PURE__ */ normalizeComponent(
@@ -6945,7 +6947,7 @@ var __component__$2 = /* @__PURE__ */ normalizeComponent(
6945
6947
  _sfc_staticRenderFns$2,
6946
6948
  false,
6947
6949
  null,
6948
- "97958aee"
6950
+ "833bf9cd"
6949
6951
  );
6950
6952
  const FieldTemplate = __component__$2.exports;
6951
6953
  const _sfc_main$1 = /* @__PURE__ */ defineComponent({
@@ -6982,25 +6984,24 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
6982
6984
  PI_INPUT_MODEL_TOKEN,
6983
6985
  computed(() => inputs.modelValue)
6984
6986
  );
6985
- let injectorDispose;
6986
- const initResult = computed(() => {
6987
- injectorDispose?.();
6988
- const subInjector = createInjector({ providers: [], parent: rootInjector.value });
6989
- injectorDispose = () => {
6990
- subInjector.destroy();
6991
- injectorDispose = void 0;
6992
- };
6993
- const field2 = convert(inputs.schema, {
6994
- ...inputs.options,
6995
- handle: VueSchemaHandle,
6996
- builder: VueFormBuilder,
6997
- injector: subInjector
6998
- });
6999
- return [field2, subInjector];
7000
- });
7001
- onUnmounted(() => {
7002
- injectorDispose?.();
7003
- });
6987
+ let initResult = shallowRef();
6988
+ watch(
6989
+ () => [inputs.schema, inputs.options, rootInjector.value],
6990
+ (_, __, onCleanup) => {
6991
+ const subInjector = createInjector({ providers: [], parent: rootInjector.value });
6992
+ onCleanup(() => {
6993
+ subInjector.destroy();
6994
+ });
6995
+ const field2 = convert(inputs.schema, {
6996
+ ...inputs.options,
6997
+ handle: VueSchemaHandle,
6998
+ builder: VueFormBuilder,
6999
+ injector: subInjector
7000
+ });
7001
+ initResult.value = [field2, subInjector];
7002
+ },
7003
+ { immediate: true }
7004
+ );
7004
7005
  const field = computed(() => initResult.value[0]);
7005
7006
  watch(
7006
7007
  () => [initResult.value, inputs.modelValue],
@@ -7022,7 +7023,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
7022
7023
  },
7023
7024
  { immediate: true }
7024
7025
  );
7025
- return { __sfc: true, inputs, emit, maybeParentField, rootInjector, injectorDispose, initResult, field, FieldTemplate };
7026
+ return { __sfc: true, inputs, emit, maybeParentField, rootInjector, initResult, field, FieldTemplate };
7026
7027
  }
7027
7028
  });
7028
7029
  var _sfc_render$1 = function render3() {
@@ -7036,7 +7037,7 @@ var __component__$1 = /* @__PURE__ */ normalizeComponent(
7036
7037
  _sfc_staticRenderFns$1,
7037
7038
  false,
7038
7039
  null,
7039
- "026c7115"
7040
+ "340d6ac0"
7040
7041
  );
7041
7042
  const piyingView = __component__$1.exports;
7042
7043
  function useControlValueAccessor(autoChange = true) {