@piying/view-vue 2.9.1 → 2.9.2
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.js +31 -1
- package/index.js.map +1 -1
- package/package.json +2 -2
- package/util/typed-component.d.ts +5 -0
package/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { inject, shallowRef, watchEffect, defineComponent, computed, createBlock, renderSlot, openBlock, resolveDynamicComponent, mergeProps, unref, toHandlers, withCtx, createVNode, normalizeProps, guardReactiveProps, defineAsyncComponent, provide, watch, onUnmounted, createElementBlock, createCommentVNode, Fragment, ref, renderList } from "vue";
|
|
2
|
-
import { CoreSchemaHandle, FormBuilder, isLazyMark, getLazyImport, isFieldControl, createViewControlLink, convert, initListen, setComponent, actions } from "@piying/view-core";
|
|
2
|
+
import { CoreSchemaHandle, FormBuilder, isLazyMark, getLazyImport, isFieldControl, createViewControlLink, convert, initListen, setComponent, actions, NFCSchema } from "@piying/view-core";
|
|
3
3
|
import { effect, createRootInjector, ChangeDetectionSchedulerImpl, ChangeDetectionScheduler, createInjector, untracked } from "static-injector";
|
|
4
4
|
var store;
|
|
5
5
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -103,6 +103,30 @@ function getDefault(schema, dataset, config2) {
|
|
|
103
103
|
schema.default
|
|
104
104
|
);
|
|
105
105
|
}
|
|
106
|
+
// @__NO_SIDE_EFFECTS__
|
|
107
|
+
function pipe(...pipe2) {
|
|
108
|
+
return {
|
|
109
|
+
...pipe2[0],
|
|
110
|
+
pipe: pipe2,
|
|
111
|
+
get "~standard"() {
|
|
112
|
+
return /* @__PURE__ */ _getStandardProps(this);
|
|
113
|
+
},
|
|
114
|
+
"~run"(dataset, config2) {
|
|
115
|
+
for (const item of pipe2) {
|
|
116
|
+
if (item.kind !== "metadata") {
|
|
117
|
+
if (dataset.issues && (item.kind === "schema" || item.kind === "transformation")) {
|
|
118
|
+
dataset.typed = false;
|
|
119
|
+
break;
|
|
120
|
+
}
|
|
121
|
+
if (!dataset.issues || !config2.abortEarly && !config2.abortPipeEarly) {
|
|
122
|
+
dataset = item["~run"](dataset, config2);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
return dataset;
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
}
|
|
106
130
|
class VueSchemaHandle extends CoreSchemaHandle {
|
|
107
131
|
}
|
|
108
132
|
class VueFormBuilder extends FormBuilder {
|
|
@@ -465,6 +489,12 @@ function typedComponent(input) {
|
|
|
465
489
|
define: input,
|
|
466
490
|
setComponent(key, fn) {
|
|
467
491
|
return metadataList(fn ? [setComponent(key), ...fn(actions)] : [setComponent(key)]);
|
|
492
|
+
},
|
|
493
|
+
nfcComponent(key, fn) {
|
|
494
|
+
return /* @__PURE__ */ pipe(
|
|
495
|
+
NFCSchema,
|
|
496
|
+
metadataList(fn ? [setComponent(key), ...fn(actions)] : [setComponent(key)])
|
|
497
|
+
);
|
|
468
498
|
}
|
|
469
499
|
};
|
|
470
500
|
}
|