@tachybase/schema 0.23.40 → 0.23.47
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/lib/core/effects/index.d.ts +2 -0
- package/lib/core/effects/index.js +23 -0
- package/lib/core/effects/onFieldEffects.d.ts +27 -0
- package/lib/core/effects/onFieldEffects.js +158 -0
- package/lib/core/effects/onFormEffects.d.ts +24 -0
- package/lib/core/effects/onFormEffects.js +117 -0
- package/lib/core/global.d.js +0 -0
- package/lib/core/index.d.ts +4 -0
- package/lib/core/index.js +27 -0
- package/lib/core/models/ArrayField.d.ts +17 -0
- package/lib/core/models/ArrayField.js +145 -0
- package/lib/core/models/BaseField.d.ts +72 -0
- package/lib/core/models/BaseField.js +285 -0
- package/lib/core/models/Field.d.ts +70 -0
- package/lib/core/models/Field.js +426 -0
- package/lib/core/models/Form.d.ts +102 -0
- package/lib/core/models/Form.js +483 -0
- package/lib/core/models/Graph.d.ts +8 -0
- package/lib/core/models/Graph.js +77 -0
- package/lib/core/models/Heart.d.ts +16 -0
- package/lib/core/models/Heart.js +91 -0
- package/lib/core/models/LifeCycle.d.ts +14 -0
- package/lib/core/models/LifeCycle.js +64 -0
- package/lib/core/models/ObjectField.d.ts +12 -0
- package/lib/core/models/ObjectField.js +64 -0
- package/lib/core/models/Query.d.ts +18 -0
- package/lib/core/models/Query.js +105 -0
- package/lib/core/models/VoidField.d.ts +14 -0
- package/lib/core/models/VoidField.js +117 -0
- package/lib/core/models/index.d.ts +9 -0
- package/lib/core/models/index.js +37 -0
- package/lib/core/models/types.d.ts +9 -0
- package/lib/core/models/types.js +15 -0
- package/lib/core/shared/checkers.d.ts +117 -0
- package/lib/core/shared/checkers.js +109 -0
- package/lib/core/shared/constants.d.ts +48 -0
- package/lib/core/shared/constants.js +86 -0
- package/lib/core/shared/effective.d.ts +9 -0
- package/lib/core/shared/effective.js +91 -0
- package/lib/core/shared/externals.d.ts +8 -0
- package/lib/core/shared/externals.js +87 -0
- package/lib/core/shared/internals.d.ts +54 -0
- package/lib/core/shared/internals.js +956 -0
- package/lib/core/types.d.ts +275 -0
- package/lib/core/types.js +76 -0
- package/lib/grid/index.d.ts +67 -0
- package/lib/grid/index.js +378 -0
- package/lib/grid/observer.d.ts +19 -0
- package/lib/grid/observer.js +107 -0
- package/lib/index.d.ts +12 -24
- package/lib/index.js +27 -244
- package/lib/json-schema/compiler.d.ts +8 -0
- package/lib/json-schema/compiler.js +129 -0
- package/lib/json-schema/global.d.js +0 -0
- package/lib/json-schema/index.d.ts +2 -0
- package/lib/json-schema/index.js +23 -0
- package/lib/json-schema/patches.d.ts +5 -0
- package/lib/json-schema/patches.js +68 -0
- package/lib/json-schema/polyfills/SPECIFICATION_1_0.d.ts +2 -0
- package/lib/json-schema/polyfills/SPECIFICATION_1_0.js +132 -0
- package/lib/json-schema/polyfills/index.d.ts +1 -0
- package/lib/json-schema/polyfills/index.js +21 -0
- package/lib/json-schema/schema.d.ts +88 -0
- package/lib/json-schema/schema.js +231 -0
- package/lib/json-schema/shared.d.ts +62 -0
- package/lib/json-schema/shared.js +232 -0
- package/lib/json-schema/transformer.d.ts +4 -0
- package/lib/json-schema/transformer.js +238 -0
- package/lib/json-schema/types.d.ts +119 -0
- package/lib/json-schema/types.js +15 -0
- package/lib/path/contexts.d.ts +10 -0
- package/lib/path/contexts.js +49 -0
- package/lib/path/destructor.d.ts +15 -0
- package/lib/path/destructor.js +151 -0
- package/lib/path/index.d.ts +51 -0
- package/lib/path/index.js +513 -0
- package/lib/path/matcher.d.ts +33 -0
- package/lib/path/matcher.js +197 -0
- package/lib/path/parser.d.ts +33 -0
- package/lib/path/parser.js +379 -0
- package/lib/path/shared.d.ts +13 -0
- package/lib/path/shared.js +121 -0
- package/lib/path/tokenizer.d.ts +27 -0
- package/lib/path/tokenizer.js +269 -0
- package/lib/path/tokens.d.ts +27 -0
- package/lib/path/tokens.js +216 -0
- package/lib/path/types.d.ts +88 -0
- package/lib/path/types.js +63 -0
- package/lib/react/components/ArrayField.d.ts +6 -0
- package/lib/react/components/ArrayField.js +44 -0
- package/lib/react/components/ExpressionScope.d.ts +2 -0
- package/lib/react/components/ExpressionScope.js +35 -0
- package/lib/react/components/Field.d.ts +5 -0
- package/lib/react/components/Field.js +45 -0
- package/lib/react/components/FormConsumer.d.ts +2 -0
- package/lib/react/components/FormConsumer.js +36 -0
- package/lib/react/components/FormProvider.d.ts +2 -0
- package/lib/react/components/FormProvider.js +35 -0
- package/lib/react/components/ObjectField.d.ts +6 -0
- package/lib/react/components/ObjectField.js +39 -0
- package/lib/react/components/ReactiveField.d.ts +11 -0
- package/lib/react/components/ReactiveField.js +115 -0
- package/lib/react/components/RecordScope.d.ts +2 -0
- package/lib/react/components/RecordScope.js +65 -0
- package/lib/react/components/RecordsScope.d.ts +2 -0
- package/lib/react/components/RecordsScope.js +43 -0
- package/lib/react/components/RecursionField.d.ts +2 -0
- package/lib/react/components/RecursionField.js +105 -0
- package/lib/react/components/SchemaField.d.ts +41 -0
- package/lib/react/components/SchemaField.js +154 -0
- package/lib/react/components/VoidField.d.ts +5 -0
- package/lib/react/components/VoidField.js +39 -0
- package/lib/react/components/index.d.ts +11 -0
- package/lib/react/components/index.js +41 -0
- package/lib/react/global.d.js +0 -0
- package/lib/react/hooks/index.d.ts +6 -0
- package/lib/react/hooks/index.js +31 -0
- package/lib/react/hooks/useAttach.d.ts +6 -0
- package/lib/react/hooks/useAttach.js +35 -0
- package/lib/react/hooks/useExpressionScope.d.ts +1 -0
- package/lib/react/hooks/useExpressionScope.js +30 -0
- package/lib/react/hooks/useField.d.ts +2 -0
- package/lib/react/hooks/useField.js +32 -0
- package/lib/react/hooks/useFieldSchema.d.ts +2 -0
- package/lib/react/hooks/useFieldSchema.js +32 -0
- package/lib/react/hooks/useForm.d.ts +2 -0
- package/lib/react/hooks/useForm.js +32 -0
- package/lib/react/hooks/useFormEffects.d.ts +2 -0
- package/lib/react/hooks/useFormEffects.js +42 -0
- package/lib/react/hooks/useParentForm.d.ts +2 -0
- package/lib/react/hooks/useParentForm.js +40 -0
- package/lib/react/index.d.ts +5 -0
- package/lib/react/index.js +29 -0
- package/lib/react/shared/connect.d.ts +9 -0
- package/lib/react/shared/connect.js +118 -0
- package/lib/react/shared/context.d.ts +14 -0
- package/lib/react/shared/context.js +74 -0
- package/lib/react/shared/index.d.ts +2 -0
- package/lib/react/shared/index.js +23 -0
- package/lib/react/shared/render.d.ts +2 -0
- package/lib/react/shared/render.js +69 -0
- package/lib/react/types.d.ts +84 -0
- package/lib/react/types.js +15 -0
- package/lib/reactive/action.d.ts +2 -0
- package/lib/reactive/action.js +48 -0
- package/lib/reactive/annotations/box.d.ts +7 -0
- package/lib/reactive/annotations/box.js +76 -0
- package/lib/reactive/annotations/computed.d.ts +12 -0
- package/lib/reactive/annotations/computed.js +154 -0
- package/lib/reactive/annotations/index.d.ts +5 -0
- package/lib/reactive/annotations/index.js +29 -0
- package/lib/reactive/annotations/observable.d.ts +4 -0
- package/lib/reactive/annotations/observable.js +67 -0
- package/lib/reactive/annotations/ref.d.ts +6 -0
- package/lib/reactive/annotations/ref.js +78 -0
- package/lib/reactive/annotations/shallow.d.ts +2 -0
- package/lib/reactive/annotations/shallow.js +67 -0
- package/lib/reactive/array.d.ts +12 -0
- package/lib/reactive/array.js +83 -0
- package/lib/reactive/autorun.d.ts +7 -0
- package/lib/reactive/autorun.js +155 -0
- package/lib/reactive/batch.d.ts +2 -0
- package/lib/reactive/batch.js +40 -0
- package/lib/reactive/checkers.d.ts +10 -0
- package/lib/reactive/checkers.js +60 -0
- package/lib/reactive/environment.d.ts +28 -0
- package/lib/reactive/environment.js +76 -0
- package/lib/reactive/externals.d.ts +10 -0
- package/lib/reactive/externals.js +156 -0
- package/lib/reactive/global.d.js +0 -0
- package/lib/reactive/handlers.d.ts +4 -0
- package/lib/reactive/handlers.js +246 -0
- package/lib/reactive/index.d.ts +10 -0
- package/lib/reactive/index.js +39 -0
- package/lib/reactive/internals.d.ts +17 -0
- package/lib/reactive/internals.js +139 -0
- package/lib/reactive/model.d.ts +3 -0
- package/lib/reactive/model.js +68 -0
- package/lib/reactive/observable.d.ts +9 -0
- package/lib/reactive/observable.js +50 -0
- package/lib/reactive/observe.d.ts +2 -0
- package/lib/reactive/observe.js +58 -0
- package/lib/reactive/reaction.d.ts +21 -0
- package/lib/reactive/reaction.js +278 -0
- package/lib/reactive/tracker.d.ts +7 -0
- package/lib/reactive/tracker.js +63 -0
- package/lib/reactive/tree.d.ts +25 -0
- package/lib/reactive/tree.js +106 -0
- package/lib/reactive/types.d.ts +79 -0
- package/lib/reactive/types.js +21 -0
- package/lib/reactive/untracked.d.ts +4 -0
- package/lib/reactive/untracked.js +29 -0
- package/lib/reactive-react/hooks/index.d.ts +9 -0
- package/lib/reactive-react/hooks/index.js +48 -0
- package/lib/reactive-react/hooks/useCompatEffect.d.ts +2 -0
- package/lib/reactive-react/hooks/useCompatEffect.js +60 -0
- package/lib/reactive-react/hooks/useCompatFactory.d.ts +3 -0
- package/lib/reactive-react/hooks/useCompatFactory.js +74 -0
- package/lib/reactive-react/hooks/useDidUpdate.d.ts +1 -0
- package/lib/reactive-react/hooks/useDidUpdate.js +38 -0
- package/lib/reactive-react/hooks/useForceUpdate.d.ts +1 -0
- package/lib/reactive-react/hooks/useForceUpdate.js +76 -0
- package/lib/reactive-react/hooks/useLayoutEffect.d.ts +2 -0
- package/lib/reactive-react/hooks/useLayoutEffect.js +28 -0
- package/lib/reactive-react/hooks/useObserver.d.ts +2 -0
- package/lib/reactive-react/hooks/useObserver.js +43 -0
- package/lib/reactive-react/index.d.ts +3 -0
- package/lib/reactive-react/index.js +25 -0
- package/lib/reactive-react/observer.d.ts +8 -0
- package/lib/reactive-react/observer.js +64 -0
- package/lib/reactive-react/shared/gc.d.ts +8 -0
- package/lib/reactive-react/shared/gc.js +59 -0
- package/lib/reactive-react/shared/global.d.ts +1 -0
- package/lib/reactive-react/shared/global.js +50 -0
- package/lib/reactive-react/shared/immediate.d.ts +1 -0
- package/lib/reactive-react/shared/immediate.js +40 -0
- package/lib/reactive-react/shared/index.d.ts +2 -0
- package/lib/reactive-react/shared/index.js +23 -0
- package/lib/reactive-react/types.d.ts +14 -0
- package/lib/reactive-react/types.js +15 -0
- package/lib/shared/array.d.ts +35 -0
- package/lib/shared/array.js +189 -0
- package/lib/shared/case.d.ts +6 -0
- package/lib/shared/case.js +39 -0
- package/lib/shared/checkers.d.ts +21 -0
- package/lib/shared/checkers.js +77 -0
- package/lib/shared/clone.d.ts +2 -0
- package/lib/shared/clone.js +97 -0
- package/lib/shared/compare.d.ts +1 -0
- package/lib/shared/compare.js +129 -0
- package/lib/shared/defaults.d.ts +6 -0
- package/lib/shared/defaults.js +63 -0
- package/lib/shared/deprecate.d.ts +1 -0
- package/lib/shared/deprecate.js +42 -0
- package/lib/shared/global.d.ts +1 -0
- package/lib/shared/global.js +50 -0
- package/lib/shared/index.d.ts +16 -0
- package/lib/shared/index.js +51 -0
- package/lib/shared/instanceof.d.ts +1 -0
- package/lib/shared/instanceof.js +36 -0
- package/lib/shared/isEmpty.d.ts +3 -0
- package/lib/shared/isEmpty.js +94 -0
- package/lib/shared/merge.d.ts +12 -0
- package/lib/shared/merge.js +214 -0
- package/lib/shared/middleware.d.ts +4 -0
- package/lib/shared/middleware.js +41 -0
- package/lib/shared/path.d.ts +3 -0
- package/lib/shared/path.js +27 -0
- package/lib/shared/string.d.ts +1 -0
- package/lib/shared/string.js +38 -0
- package/lib/shared/subscribable.d.ts +11 -0
- package/lib/shared/subscribable.js +74 -0
- package/lib/shared/uid.d.ts +1 -0
- package/lib/shared/uid.js +35 -0
- package/lib/validator/formats.d.ts +16 -0
- package/lib/validator/formats.js +40 -0
- package/lib/validator/index.d.ts +4 -0
- package/lib/validator/index.js +27 -0
- package/lib/validator/locale.d.ts +219 -0
- package/lib/validator/locale.js +240 -0
- package/lib/validator/parser.d.ts +5 -0
- package/lib/validator/parser.js +153 -0
- package/lib/validator/registry.d.ts +15 -0
- package/lib/validator/registry.js +116 -0
- package/lib/validator/rules.d.ts +3 -0
- package/lib/validator/rules.js +154 -0
- package/lib/validator/template.d.ts +2 -0
- package/lib/validator/template.js +42 -0
- package/lib/validator/types.d.ts +62 -0
- package/lib/validator/types.js +28 -0
- package/lib/validator/validator.d.ts +2 -0
- package/lib/validator/validator.js +63 -0
- package/package.json +16 -10
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var useForm_exports = {};
|
|
20
|
+
__export(useForm_exports, {
|
|
21
|
+
useForm: () => useForm
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(useForm_exports);
|
|
24
|
+
var import_react = require("react");
|
|
25
|
+
var import_shared = require("../shared");
|
|
26
|
+
const useForm = /* @__PURE__ */ __name(() => {
|
|
27
|
+
return (0, import_react.useContext)(import_shared.FormContext);
|
|
28
|
+
}, "useForm");
|
|
29
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
30
|
+
0 && (module.exports = {
|
|
31
|
+
useForm
|
|
32
|
+
});
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var useFormEffects_exports = {};
|
|
20
|
+
__export(useFormEffects_exports, {
|
|
21
|
+
useFormEffects: () => useFormEffects
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(useFormEffects_exports);
|
|
24
|
+
var import_reactive_react = require("../../reactive-react");
|
|
25
|
+
var import_shared = require("../../shared");
|
|
26
|
+
var import_useForm = require("./useForm");
|
|
27
|
+
const useFormEffects = /* @__PURE__ */ __name((effects) => {
|
|
28
|
+
const form = (0, import_useForm.useForm)();
|
|
29
|
+
(0, import_reactive_react.unstable_useCompatFactory)(() => {
|
|
30
|
+
const id = (0, import_shared.uid)();
|
|
31
|
+
form.addEffects(id, effects);
|
|
32
|
+
return {
|
|
33
|
+
dispose() {
|
|
34
|
+
form.removeEffects(id);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
});
|
|
38
|
+
}, "useFormEffects");
|
|
39
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
40
|
+
0 && (module.exports = {
|
|
41
|
+
useFormEffects
|
|
42
|
+
});
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var useParentForm_exports = {};
|
|
20
|
+
__export(useParentForm_exports, {
|
|
21
|
+
useParentForm: () => useParentForm
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(useParentForm_exports);
|
|
24
|
+
var import_core = require("../../core");
|
|
25
|
+
var import_useField = require("./useField");
|
|
26
|
+
var import_useForm = require("./useForm");
|
|
27
|
+
const useParentForm = /* @__PURE__ */ __name(() => {
|
|
28
|
+
const field = (0, import_useField.useField)();
|
|
29
|
+
const form = (0, import_useForm.useForm)();
|
|
30
|
+
const findObjectParent = /* @__PURE__ */ __name((field2) => {
|
|
31
|
+
if (!field2) return form;
|
|
32
|
+
if ((0, import_core.isObjectField)(field2)) return field2;
|
|
33
|
+
return findObjectParent(field2 == null ? void 0 : field2.parent);
|
|
34
|
+
}, "findObjectParent");
|
|
35
|
+
return findObjectParent(field);
|
|
36
|
+
}, "useParentForm");
|
|
37
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
38
|
+
0 && (module.exports = {
|
|
39
|
+
useParentForm
|
|
40
|
+
});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from))
|
|
8
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
+
}
|
|
11
|
+
return to;
|
|
12
|
+
};
|
|
13
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
var react_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(react_exports);
|
|
17
|
+
__reExport(react_exports, require("../json-schema"), module.exports);
|
|
18
|
+
__reExport(react_exports, require("./components"), module.exports);
|
|
19
|
+
__reExport(react_exports, require("./shared"), module.exports);
|
|
20
|
+
__reExport(react_exports, require("./hooks"), module.exports);
|
|
21
|
+
__reExport(react_exports, require("./types"), module.exports);
|
|
22
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
23
|
+
0 && (module.exports = {
|
|
24
|
+
...require("../json-schema"),
|
|
25
|
+
...require("./components"),
|
|
26
|
+
...require("./shared"),
|
|
27
|
+
...require("./hooks"),
|
|
28
|
+
...require("./types")
|
|
29
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { observer, Observer } from '../../reactive-react';
|
|
3
|
+
import { IComponentMapper, IStateMapper, JSXComponent } from '../types';
|
|
4
|
+
export declare function mapProps<T extends JSXComponent>(...args: IStateMapper<React.ComponentProps<T>>[]): (target: T) => React.MemoExoticComponent<import("..").ReactFC<any>>;
|
|
5
|
+
export declare function mapReadPretty<T extends JSXComponent, C extends JSXComponent>(component: C, readPrettyProps?: React.ComponentProps<C>): (target: T) => React.MemoExoticComponent<import("..").ReactFC<{
|
|
6
|
+
ref?: React.RefAttributes<any>;
|
|
7
|
+
}>>;
|
|
8
|
+
export declare function connect<T extends JSXComponent>(target: T, ...args: IComponentMapper<T>[]): React.ForwardRefExoticComponent<React.PropsWithoutRef<React.ComponentProps<T>> & React.RefAttributes<React.ElementRef<T>>>;
|
|
9
|
+
export { observer, Observer };
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var connect_exports = {};
|
|
30
|
+
__export(connect_exports, {
|
|
31
|
+
Observer: () => import_reactive_react.Observer,
|
|
32
|
+
connect: () => connect,
|
|
33
|
+
mapProps: () => mapProps,
|
|
34
|
+
mapReadPretty: () => mapReadPretty,
|
|
35
|
+
observer: () => import_reactive_react.observer
|
|
36
|
+
});
|
|
37
|
+
module.exports = __toCommonJS(connect_exports);
|
|
38
|
+
var import_react = __toESM(require("react"));
|
|
39
|
+
var import_hoist_non_react_statics = __toESM(require("hoist-non-react-statics"));
|
|
40
|
+
var import_core = require("../../core");
|
|
41
|
+
var import_reactive_react = require("../../reactive-react");
|
|
42
|
+
var import_shared = require("../../shared");
|
|
43
|
+
var import_hooks = require("../hooks");
|
|
44
|
+
function mapProps(...args) {
|
|
45
|
+
return (target) => {
|
|
46
|
+
return (0, import_reactive_react.observer)(
|
|
47
|
+
(props) => {
|
|
48
|
+
const field = (0, import_hooks.useField)();
|
|
49
|
+
const results = args.reduce(
|
|
50
|
+
(props2, mapper) => {
|
|
51
|
+
if ((0, import_shared.isFn)(mapper)) {
|
|
52
|
+
props2 = Object.assign(props2, mapper(props2, field));
|
|
53
|
+
} else {
|
|
54
|
+
(0, import_shared.each)(mapper, (to, extract) => {
|
|
55
|
+
const extractValue = import_shared.FormPath.getIn(field, extract);
|
|
56
|
+
const targetValue = (0, import_shared.isStr)(to) ? to : extract;
|
|
57
|
+
const originalValue = import_shared.FormPath.getIn(props2, targetValue);
|
|
58
|
+
if (extract === "value") {
|
|
59
|
+
if (to !== extract) {
|
|
60
|
+
delete props2.value;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
if ((0, import_shared.isValid)(originalValue) && !(0, import_shared.isValid)(extractValue)) return;
|
|
64
|
+
import_shared.FormPath.setIn(props2, targetValue, extractValue);
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
return props2;
|
|
68
|
+
},
|
|
69
|
+
{ ...props }
|
|
70
|
+
);
|
|
71
|
+
return import_react.default.createElement(target, results);
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
forwardRef: true
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
__name(mapProps, "mapProps");
|
|
80
|
+
function mapReadPretty(component, readPrettyProps) {
|
|
81
|
+
return (target) => {
|
|
82
|
+
return (0, import_reactive_react.observer)(
|
|
83
|
+
(props) => {
|
|
84
|
+
const field = (0, import_hooks.useField)();
|
|
85
|
+
if (!(0, import_core.isVoidField)(field) && (field == null ? void 0 : field.pattern) === "readPretty") {
|
|
86
|
+
return import_react.default.createElement(component, {
|
|
87
|
+
...readPrettyProps,
|
|
88
|
+
...props
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
return import_react.default.createElement(target, props);
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
forwardRef: true
|
|
95
|
+
}
|
|
96
|
+
);
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
__name(mapReadPretty, "mapReadPretty");
|
|
100
|
+
function connect(target, ...args) {
|
|
101
|
+
const Target = args.reduce((target2, mapper) => {
|
|
102
|
+
return mapper(target2);
|
|
103
|
+
}, target);
|
|
104
|
+
const Destination = import_react.default.forwardRef((props, ref) => {
|
|
105
|
+
return import_react.default.createElement(Target, { ...props, ref });
|
|
106
|
+
});
|
|
107
|
+
if (target) (0, import_hoist_non_react_statics.default)(Destination, target);
|
|
108
|
+
return Destination;
|
|
109
|
+
}
|
|
110
|
+
__name(connect, "connect");
|
|
111
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
112
|
+
0 && (module.exports = {
|
|
113
|
+
Observer,
|
|
114
|
+
connect,
|
|
115
|
+
mapProps,
|
|
116
|
+
mapReadPretty,
|
|
117
|
+
observer
|
|
118
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Form, GeneralField } from '../../core';
|
|
3
|
+
import { Schema } from '../../json-schema';
|
|
4
|
+
import { ISchemaFieldReactFactoryOptions, SchemaReactComponents } from '../types';
|
|
5
|
+
export declare const FormContext: React.Context<Form<any>>;
|
|
6
|
+
export declare const FieldContext: React.Context<GeneralField>;
|
|
7
|
+
export declare const SchemaMarkupContext: React.Context<Schema<any, any, any, any, any, any, any, any, any>>;
|
|
8
|
+
export declare const SchemaContext: React.Context<Schema<any, any, any, any, any, any, any, any, any>>;
|
|
9
|
+
export declare const SchemaExpressionScopeContext: React.Context<any>;
|
|
10
|
+
export declare const SchemaComponentsContext: React.Context<SchemaReactComponents>;
|
|
11
|
+
export declare const SchemaOptionsContext: React.Context<ISchemaFieldReactFactoryOptions<any>>;
|
|
12
|
+
export declare const ContextCleaner: ({ children }: {
|
|
13
|
+
children: any;
|
|
14
|
+
}) => any;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var context_exports = {};
|
|
30
|
+
__export(context_exports, {
|
|
31
|
+
ContextCleaner: () => ContextCleaner,
|
|
32
|
+
FieldContext: () => FieldContext,
|
|
33
|
+
FormContext: () => FormContext,
|
|
34
|
+
SchemaComponentsContext: () => SchemaComponentsContext,
|
|
35
|
+
SchemaContext: () => SchemaContext,
|
|
36
|
+
SchemaExpressionScopeContext: () => SchemaExpressionScopeContext,
|
|
37
|
+
SchemaMarkupContext: () => SchemaMarkupContext,
|
|
38
|
+
SchemaOptionsContext: () => SchemaOptionsContext
|
|
39
|
+
});
|
|
40
|
+
module.exports = __toCommonJS(context_exports);
|
|
41
|
+
var import_react = __toESM(require("react"));
|
|
42
|
+
const createContextCleaner = /* @__PURE__ */ __name((...contexts) => {
|
|
43
|
+
return ({ children }) => {
|
|
44
|
+
return contexts.reduce((buf, ctx) => {
|
|
45
|
+
return import_react.default.createElement(ctx.Provider, { value: void 0 }, buf);
|
|
46
|
+
}, children);
|
|
47
|
+
};
|
|
48
|
+
}, "createContextCleaner");
|
|
49
|
+
const FormContext = (0, import_react.createContext)(null);
|
|
50
|
+
const FieldContext = (0, import_react.createContext)(null);
|
|
51
|
+
const SchemaMarkupContext = (0, import_react.createContext)(null);
|
|
52
|
+
const SchemaContext = (0, import_react.createContext)(null);
|
|
53
|
+
const SchemaExpressionScopeContext = (0, import_react.createContext)(null);
|
|
54
|
+
const SchemaComponentsContext = (0, import_react.createContext)(null);
|
|
55
|
+
const SchemaOptionsContext = (0, import_react.createContext)(null);
|
|
56
|
+
const ContextCleaner = createContextCleaner(
|
|
57
|
+
FieldContext,
|
|
58
|
+
SchemaMarkupContext,
|
|
59
|
+
SchemaContext,
|
|
60
|
+
SchemaExpressionScopeContext,
|
|
61
|
+
SchemaComponentsContext,
|
|
62
|
+
SchemaOptionsContext
|
|
63
|
+
);
|
|
64
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
65
|
+
0 && (module.exports = {
|
|
66
|
+
ContextCleaner,
|
|
67
|
+
FieldContext,
|
|
68
|
+
FormContext,
|
|
69
|
+
SchemaComponentsContext,
|
|
70
|
+
SchemaContext,
|
|
71
|
+
SchemaExpressionScopeContext,
|
|
72
|
+
SchemaMarkupContext,
|
|
73
|
+
SchemaOptionsContext
|
|
74
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from))
|
|
8
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
+
}
|
|
11
|
+
return to;
|
|
12
|
+
};
|
|
13
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
var shared_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(shared_exports);
|
|
17
|
+
__reExport(shared_exports, require("./context"), module.exports);
|
|
18
|
+
__reExport(shared_exports, require("./connect"), module.exports);
|
|
19
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
20
|
+
0 && (module.exports = {
|
|
21
|
+
...require("./context"),
|
|
22
|
+
...require("./connect")
|
|
23
|
+
});
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var render_exports = {};
|
|
30
|
+
__export(render_exports, {
|
|
31
|
+
render: () => render
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(render_exports);
|
|
34
|
+
var import_react = __toESM(require("react"));
|
|
35
|
+
var import_shared = require("../../shared");
|
|
36
|
+
var _a, _b, _c, _d, _e;
|
|
37
|
+
const env = {
|
|
38
|
+
portalDOM: (_c = (_b = (_a = import_shared.globalThisPolyfill) == null ? void 0 : _a.document) == null ? void 0 : _b.createElement) == null ? void 0 : _c.call(_b, "div"),
|
|
39
|
+
createPortal: (_e = (_d = import_shared.globalThisPolyfill) == null ? void 0 : _d["ReactDOM"]) == null ? void 0 : _e.createPortal
|
|
40
|
+
};
|
|
41
|
+
const loadCreatePortal = /* @__PURE__ */ __name(() => {
|
|
42
|
+
var _a2;
|
|
43
|
+
if (!env.createPortal) {
|
|
44
|
+
try {
|
|
45
|
+
env.createPortal ??= (_a2 = require("react-dom")) == null ? void 0 : _a2.createPortal;
|
|
46
|
+
} catch {
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
if (!env.createPortal) {
|
|
50
|
+
try {
|
|
51
|
+
import("react-dom").then((module2) => env.createPortal ??= module2 == null ? void 0 : module2.createPortal).catch();
|
|
52
|
+
} catch {
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}, "loadCreatePortal");
|
|
56
|
+
const render = /* @__PURE__ */ __name((element) => {
|
|
57
|
+
var _a2;
|
|
58
|
+
if (((_a2 = import_shared.globalThisPolyfill.navigator) == null ? void 0 : _a2.product) === "ReactNative") return null;
|
|
59
|
+
if (env.portalDOM && env.createPortal) {
|
|
60
|
+
return env.createPortal(element, env.portalDOM);
|
|
61
|
+
} else {
|
|
62
|
+
return import_react.default.createElement("template", {}, element);
|
|
63
|
+
}
|
|
64
|
+
}, "render");
|
|
65
|
+
loadCreatePortal();
|
|
66
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
67
|
+
0 && (module.exports = {
|
|
68
|
+
render
|
|
69
|
+
});
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { FieldDisplayTypes, Field as FieldType, FieldValidator, Form, FormPatternTypes, GeneralField, IFieldFactoryProps, IVoidFieldFactoryProps, ObjectField, VoidField } from '../core';
|
|
3
|
+
import { ISchema, Schema, SchemaKey } from '../json-schema';
|
|
4
|
+
import { ReactFC } from '../reactive-react';
|
|
5
|
+
import { FormPathPattern } from '../shared';
|
|
6
|
+
export type JSXComponent = keyof JSX.IntrinsicElements | React.JSXElementConstructor<any>;
|
|
7
|
+
export type IProviderProps = {
|
|
8
|
+
form: Form;
|
|
9
|
+
};
|
|
10
|
+
export interface IFormSpyProps {
|
|
11
|
+
children?: (form: Form) => ReactChild;
|
|
12
|
+
}
|
|
13
|
+
export type RenderPropsChildren<Payload> = ((field: Payload, form: Form) => React.ReactNode) | React.ReactNode;
|
|
14
|
+
export interface IFieldProps<D extends JSXComponent, C extends JSXComponent, Field = FieldType> extends IFieldFactoryProps<D, C> {
|
|
15
|
+
children?: RenderPropsChildren<Field>;
|
|
16
|
+
decorator?: [] | [D] | [D, React.ComponentProps<D>] | any[];
|
|
17
|
+
component?: [] | [C] | [C, React.ComponentProps<C>] | any[];
|
|
18
|
+
}
|
|
19
|
+
export interface IVoidFieldProps<D extends JSXComponent, C extends JSXComponent, Field = VoidField> extends IVoidFieldFactoryProps<D, C> {
|
|
20
|
+
children?: RenderPropsChildren<Field>;
|
|
21
|
+
decorator?: [] | [D] | [D, React.ComponentProps<D>] | any[];
|
|
22
|
+
component?: [] | [C] | [C, React.ComponentProps<C>] | any[];
|
|
23
|
+
}
|
|
24
|
+
export interface IComponentMapper<T extends JSXComponent> {
|
|
25
|
+
(target: T): JSXComponent;
|
|
26
|
+
}
|
|
27
|
+
export type IStateMapper<Props> = {
|
|
28
|
+
[key in keyof FieldType]?: keyof Props | boolean;
|
|
29
|
+
} | ((props: Props, field: GeneralField) => Props);
|
|
30
|
+
export type SchemaReactComponents = Record<string, JSXComponent>;
|
|
31
|
+
export interface ISchemaFieldReactFactoryOptions<Components extends SchemaReactComponents = any> {
|
|
32
|
+
components?: Components;
|
|
33
|
+
scope?: any;
|
|
34
|
+
}
|
|
35
|
+
export interface ISchemaFieldOptionContext {
|
|
36
|
+
components: SchemaReactComponents;
|
|
37
|
+
}
|
|
38
|
+
export interface ISchemaFieldProps<Decorator extends JSXComponent = any, Component extends JSXComponent = any, InnerField = ObjectField<Decorator, Component>> extends Omit<IFieldFactoryProps<Decorator, Component, InnerField>, 'name'> {
|
|
39
|
+
schema?: ISchema;
|
|
40
|
+
components?: {
|
|
41
|
+
[key: string]: JSXComponent;
|
|
42
|
+
};
|
|
43
|
+
scope?: any;
|
|
44
|
+
name?: SchemaKey;
|
|
45
|
+
children?: React.ReactNode;
|
|
46
|
+
}
|
|
47
|
+
export interface ISchemaMapper {
|
|
48
|
+
(schema: Schema, name: SchemaKey): Schema;
|
|
49
|
+
}
|
|
50
|
+
export interface ISchemaFilter {
|
|
51
|
+
(schema: Schema, name: SchemaKey): boolean;
|
|
52
|
+
}
|
|
53
|
+
export interface IRecursionFieldProps {
|
|
54
|
+
schema: ISchema;
|
|
55
|
+
name?: SchemaKey;
|
|
56
|
+
basePath?: FormPathPattern;
|
|
57
|
+
propsRecursion?: boolean;
|
|
58
|
+
onlyRenderProperties?: boolean;
|
|
59
|
+
onlyRenderSelf?: boolean;
|
|
60
|
+
mapProperties?: ISchemaMapper;
|
|
61
|
+
filterProperties?: ISchemaFilter;
|
|
62
|
+
}
|
|
63
|
+
export type ObjectKey = string | number | boolean | symbol;
|
|
64
|
+
export type Path<T, Key extends keyof T = keyof T> = Key extends string ? T[Key] extends Record<string, any> ? `${Key}.${Path<T[Key], Exclude<keyof T[Key], keyof Array<any>>> & string}` | `${Key}.${Exclude<keyof T[Key], keyof Array<any>> & string}` | Key : Key : never;
|
|
65
|
+
export type PathValue<T, P extends Path<T>> = P extends `${infer Key}.${infer Rest}` ? Key extends keyof T ? Rest extends Path<T[Key]> ? PathValue<T[Key], Rest> : never : never : P extends keyof T ? T[P] : never;
|
|
66
|
+
export type KeyOfReactComponent<T> = Exclude<keyof T, 'contextTypes' | 'displayName' | 'propTypes' | 'defaultProps'>;
|
|
67
|
+
export type ReactComponentPath<T, Key extends KeyOfReactComponent<T> = KeyOfReactComponent<T>> = Key extends string ? T[Key] extends Record<string, any> ? `${Key}.${Exclude<KeyOfReactComponent<T[Key]>, keyof Array<any>> & string}` | Key : Key : never;
|
|
68
|
+
export type ReactComponentPropsByPathValue<T extends Record<string, any>, P extends ReactComponentPath<T>> = P extends `${infer Key}.${infer Rest}` ? Key extends keyof T ? Rest extends ReactComponentPath<T[Key]> ? ReactComponentPropsByPathValue<T[Key], Rest> : never : React.ComponentProps<T[P]> : P extends keyof T ? React.ComponentProps<T[P]> : never;
|
|
69
|
+
export interface ISchemaMarkupFieldProps<Components extends SchemaReactComponents, Decorator extends ReactComponentPath<Components>, Component extends ReactComponentPath<Components>> extends ISchema<Decorator, Component, ReactComponentPropsByPathValue<Components, Decorator>, ReactComponentPropsByPathValue<Components, Component>, FormPatternTypes, FieldDisplayTypes, FieldValidator, React.ReactNode, GeneralField> {
|
|
70
|
+
children?: React.ReactNode;
|
|
71
|
+
}
|
|
72
|
+
export type ISchemaTypeFieldProps<Components extends SchemaReactComponents, Decorator extends ReactComponentPath<Components>, Component extends ReactComponentPath<Components>> = ISchemaMarkupFieldProps<Components, Decorator, Component>;
|
|
73
|
+
export interface IExpressionScopeProps {
|
|
74
|
+
value?: any;
|
|
75
|
+
}
|
|
76
|
+
export interface IRecordScopeProps {
|
|
77
|
+
getIndex?(): number;
|
|
78
|
+
getRecord(): any;
|
|
79
|
+
}
|
|
80
|
+
export interface IRecordsScopeProps {
|
|
81
|
+
getRecords(): any[];
|
|
82
|
+
}
|
|
83
|
+
export type ReactChild = React.ReactElement | string | number;
|
|
84
|
+
export { type ReactFC };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from))
|
|
8
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
+
}
|
|
11
|
+
return to;
|
|
12
|
+
};
|
|
13
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
14
|
+
var types_exports = {};
|
|
15
|
+
module.exports = __toCommonJS(types_exports);
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var action_exports = {};
|
|
19
|
+
__export(action_exports, {
|
|
20
|
+
action: () => action
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(action_exports);
|
|
23
|
+
var import_internals = require("./internals");
|
|
24
|
+
var import_reaction = require("./reaction");
|
|
25
|
+
const action = (0, import_internals.createBoundaryAnnotation)(
|
|
26
|
+
() => {
|
|
27
|
+
(0, import_reaction.batchStart)();
|
|
28
|
+
(0, import_reaction.untrackStart)();
|
|
29
|
+
},
|
|
30
|
+
() => {
|
|
31
|
+
(0, import_reaction.untrackEnd)();
|
|
32
|
+
(0, import_reaction.batchEnd)();
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
action.scope = (0, import_internals.createBoundaryAnnotation)(
|
|
36
|
+
() => {
|
|
37
|
+
(0, import_reaction.batchScopeStart)();
|
|
38
|
+
(0, import_reaction.untrackStart)();
|
|
39
|
+
},
|
|
40
|
+
() => {
|
|
41
|
+
(0, import_reaction.untrackEnd)();
|
|
42
|
+
(0, import_reaction.batchScopeEnd)();
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
46
|
+
0 && (module.exports = {
|
|
47
|
+
action
|
|
48
|
+
});
|