@aemforms/af-core 0.22.31 → 0.22.33
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/{esm/BaseNode.d.ts → BaseNode.d.ts} +6 -6
- package/lib/{esm/BaseNode-f84b22c6.js → BaseNode.js} +58 -94
- package/lib/{esm/Checkbox.d.ts → Checkbox.d.ts} +1 -1
- package/lib/Checkbox.js +29 -0
- package/lib/{esm/CheckboxGroup.d.ts → CheckboxGroup.d.ts} +2 -2
- package/lib/CheckboxGroup.js +24 -0
- package/lib/{esm/Container.d.ts → Container.d.ts} +4 -4
- package/lib/{esm/Container.js → Container.js} +51 -77
- package/lib/{esm/DateField.d.ts → DateField.d.ts} +1 -1
- package/lib/DateField.js +26 -0
- package/lib/{esm/Field.d.ts → Field.d.ts} +7 -7
- package/lib/{esm/Field.js → Field.js} +84 -104
- package/lib/{esm/Fieldset.d.ts → Fieldset.d.ts} +7 -7
- package/lib/{esm/Fieldset.js → Fieldset.js} +14 -43
- package/lib/{esm/FileObject.d.ts → FileObject.d.ts} +1 -1
- package/lib/FileObject.js +29 -0
- package/lib/{esm/FileUpload.d.ts → FileUpload.d.ts} +3 -3
- package/lib/FileUpload.js +124 -0
- package/lib/{esm/Form.d.ts → Form.d.ts} +12 -12
- package/lib/{esm/Form.js → Form.js} +34 -65
- package/lib/{esm/FormInstance.d.ts → FormInstance.d.ts} +3 -3
- package/lib/FormInstance.js +94 -0
- package/lib/{esm/FormMetaData.d.ts → FormMetaData.d.ts} +2 -2
- package/lib/FormMetaData.js +15 -0
- package/lib/{esm/InstanceManager.d.ts → InstanceManager.d.ts} +2 -2
- package/lib/InstanceManager.js +35 -0
- package/lib/Node.js +15 -0
- package/lib/{esm/Scriptable.d.ts → Scriptable.d.ts} +3 -3
- package/lib/{esm/Scriptable.js → Scriptable.js} +17 -38
- package/lib/{esm/controller → controller}/EventQueue.d.ts +3 -3
- package/lib/{esm/controller → controller}/EventQueue.js +8 -32
- package/lib/{esm/controller → controller}/Events.d.ts +2 -2
- package/lib/{esm/controller → controller}/Events.js +22 -26
- package/lib/{esm/controller → controller}/Logger.d.ts +2 -2
- package/lib/controller/Logger.js +33 -0
- package/lib/{esm/data → data}/DataGroup.d.ts +1 -1
- package/lib/{esm/data → data}/DataGroup.js +20 -38
- package/lib/{esm/data → data}/DataValue.d.ts +1 -1
- package/lib/{esm/data → data}/DataValue.js +4 -26
- package/lib/{esm/data → data}/EmptyDataValue.d.ts +1 -1
- package/lib/data/EmptyDataValue.js +34 -0
- package/lib/index.d.ts +21 -0
- package/lib/index.js +57 -0
- package/lib/{esm/rules → rules}/FunctionRuntime.d.ts +3 -3
- package/lib/{esm/rules → rules}/FunctionRuntime.js +52 -63
- package/lib/{esm/rules → rules}/RuleEngine.d.ts +1 -1
- package/lib/rules/RuleEngine.js +51 -0
- package/lib/{esm/types → types}/Json.d.ts +16 -16
- package/lib/types/Json.js +10 -0
- package/lib/{esm/types → types}/Model.d.ts +9 -9
- package/lib/types/Model.js +10 -0
- package/lib/types/index.d.ts +2 -0
- package/lib/types/index.js +18 -0
- package/lib/{esm/utils → utils}/DataRefParser.d.ts +4 -4
- package/lib/{esm/utils → utils}/DataRefParser.js +30 -45
- package/lib/{esm/utils → utils}/Fetch.d.ts +1 -1
- package/lib/utils/Fetch.js +74 -0
- package/lib/{esm/utils → utils}/FormCreationUtils.d.ts +1 -1
- package/lib/utils/FormCreationUtils.js +67 -0
- package/lib/{esm/utils → utils}/FormUtils.d.ts +2 -1
- package/lib/{esm/utils → utils}/FormUtils.js +62 -46
- package/lib/{esm/utils → utils}/JsonUtils.d.ts +1 -1
- package/lib/utils/JsonUtils.js +89 -0
- package/lib/{esm/utils → utils}/LogUtils.d.ts +1 -1
- package/lib/utils/LogUtils.js +10 -0
- package/lib/{esm/utils → utils}/SchemaUtils.d.ts +1 -1
- package/lib/{esm/utils → utils}/SchemaUtils.js +9 -29
- package/lib/{esm/utils → utils}/TranslationUtils.d.ts +2 -2
- package/lib/utils/TranslationUtils.js +125 -0
- package/lib/{esm/utils → utils}/ValidationUtils.d.ts +4 -4
- package/lib/{esm/utils → utils}/ValidationUtils.js +13 -35
- package/package.json +8 -13
- package/lib/cjs/index.cjs +0 -7426
- package/lib/esm/BaseNode.js +0 -26
- package/lib/esm/Checkbox.js +0 -63
- package/lib/esm/CheckboxGroup.js +0 -60
- package/lib/esm/DateField.js +0 -57
- package/lib/esm/FileObject.js +0 -48
- package/lib/esm/FileUpload.js +0 -141
- package/lib/esm/FormInstance.js +0 -129
- package/lib/esm/FormMetaData.js +0 -35
- package/lib/esm/InstanceManager.js +0 -58
- package/lib/esm/Node.js +0 -40
- package/lib/esm/controller/Logger.js +0 -52
- package/lib/esm/data/EmptyDataValue.js +0 -51
- package/lib/esm/index.d.ts +0 -21
- package/lib/esm/index.js +0 -55
- package/lib/esm/rules/RuleEngine.js +0 -76
- package/lib/esm/types/Json.js +0 -29
- package/lib/esm/types/Model.js +0 -30
- package/lib/esm/types/index.d.ts +0 -2
- package/lib/esm/types/index.js +0 -22
- package/lib/esm/utils/Fetch.js +0 -83
- package/lib/esm/utils/FormCreationUtils.js +0 -112
- package/lib/esm/utils/JsonUtils.js +0 -99
- package/lib/esm/utils/LogUtils.js +0 -28
- package/lib/esm/utils/TranslationUtils.js +0 -138
- /package/lib/{esm/Node.d.ts → Node.d.ts} +0 -0
|
@@ -1,28 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
*
|
|
5
|
-
* Copyright 2022 Adobe
|
|
6
|
-
* All Rights Reserved.
|
|
7
|
-
*
|
|
8
|
-
* NOTICE: All information contained herein is, and remains
|
|
9
|
-
* the property of Adobe and its suppliers, if any. The intellectual
|
|
10
|
-
* and technical concepts contained herein are proprietary to Adobe
|
|
11
|
-
* and its suppliers and are protected by all applicable intellectual
|
|
12
|
-
* property laws, including trade secret and copyright laws.
|
|
13
|
-
* Dissemination of this information or reproduction of this material
|
|
14
|
-
* is strictly forbidden unless prior written permission is obtained
|
|
15
|
-
* from Adobe.
|
|
16
|
-
|
|
17
|
-
* Adobe permits you to use and modify this file solely in accordance with
|
|
18
|
-
* the terms of the Adobe license agreement accompanying it.
|
|
19
|
-
*************************************************************************/
|
|
20
|
-
|
|
21
|
-
import { Logger } from './Logger.js';
|
|
22
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const Logger_1 = require("./Logger");
|
|
23
4
|
class EventNode {
|
|
24
|
-
_node;
|
|
25
|
-
_event;
|
|
26
5
|
constructor(_node, _event) {
|
|
27
6
|
this._node = _node;
|
|
28
7
|
this._event = _event;
|
|
@@ -44,13 +23,10 @@ class EventNode {
|
|
|
44
23
|
}
|
|
45
24
|
}
|
|
46
25
|
class EventQueue {
|
|
47
|
-
logger
|
|
48
|
-
static MAX_EVENT_CYCLE_COUNT = 10;
|
|
49
|
-
_runningEventCount;
|
|
50
|
-
_isProcessing = false;
|
|
51
|
-
_pendingEvents = [];
|
|
52
|
-
constructor(logger = new Logger('off')) {
|
|
26
|
+
constructor(logger = new Logger_1.Logger('off')) {
|
|
53
27
|
this.logger = logger;
|
|
28
|
+
this._isProcessing = false;
|
|
29
|
+
this._pendingEvents = [];
|
|
54
30
|
this._runningEventCount = {};
|
|
55
31
|
}
|
|
56
32
|
get length() {
|
|
@@ -104,5 +80,5 @@ class EventQueue {
|
|
|
104
80
|
this._isProcessing = false;
|
|
105
81
|
}
|
|
106
82
|
}
|
|
107
|
-
|
|
108
|
-
|
|
83
|
+
EventQueue.MAX_EVENT_CYCLE_COUNT = 10;
|
|
84
|
+
exports.default = EventQueue;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Action, BaseJson, FieldModel, FieldsetModel, FormModel, ValidationError } from '../types/index
|
|
1
|
+
import { Action, BaseJson, FieldModel, FieldsetModel, FormModel, ValidationError } from '../types/index';
|
|
2
2
|
declare class ActionImpl implements Action {
|
|
3
3
|
private _metadata?;
|
|
4
4
|
protected _type: string;
|
|
@@ -18,7 +18,7 @@ declare class ActionImpl implements Action {
|
|
|
18
18
|
};
|
|
19
19
|
toString(): string;
|
|
20
20
|
}
|
|
21
|
-
export type ChangePayload = {
|
|
21
|
+
export declare type ChangePayload = {
|
|
22
22
|
changes: Array<{
|
|
23
23
|
propertyName: string;
|
|
24
24
|
prevValue?: any;
|
|
@@ -1,28 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
*
|
|
5
|
-
* Copyright 2022 Adobe
|
|
6
|
-
* All Rights Reserved.
|
|
7
|
-
*
|
|
8
|
-
* NOTICE: All information contained herein is, and remains
|
|
9
|
-
* the property of Adobe and its suppliers, if any. The intellectual
|
|
10
|
-
* and technical concepts contained herein are proprietary to Adobe
|
|
11
|
-
* and its suppliers and are protected by all applicable intellectual
|
|
12
|
-
* property laws, including trade secret and copyright laws.
|
|
13
|
-
* Dissemination of this information or reproduction of this material
|
|
14
|
-
* is strictly forbidden unless prior written permission is obtained
|
|
15
|
-
* from Adobe.
|
|
16
|
-
|
|
17
|
-
* Adobe permits you to use and modify this file solely in accordance with
|
|
18
|
-
* the terms of the Adobe license agreement accompanying it.
|
|
19
|
-
*************************************************************************/
|
|
20
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RemoveInstance = exports.AddInstance = exports.RemoveItem = exports.AddItem = exports.CustomEvent = exports.FieldChanged = exports.Reset = exports.Submit = exports.Focus = exports.ValidationComplete = exports.Blur = exports.Click = exports.FormLoad = exports.Initialize = exports.propertyChange = exports.ExecuteRule = exports.Valid = exports.Invalid = exports.Change = void 0;
|
|
21
4
|
class ActionImpl {
|
|
22
|
-
_metadata;
|
|
23
|
-
_type;
|
|
24
|
-
_payload;
|
|
25
|
-
_target;
|
|
26
5
|
constructor(payload, type, _metadata) {
|
|
27
6
|
this._metadata = _metadata;
|
|
28
7
|
this._payload = payload;
|
|
@@ -65,21 +44,25 @@ class Change extends ActionImpl {
|
|
|
65
44
|
return new Change(this.payload.changes.concat(change.payload.changes), this.metadata);
|
|
66
45
|
}
|
|
67
46
|
}
|
|
47
|
+
exports.Change = Change;
|
|
68
48
|
class Invalid extends ActionImpl {
|
|
69
49
|
constructor(payload = {}) {
|
|
70
50
|
super(payload, 'invalid', {});
|
|
71
51
|
}
|
|
72
52
|
}
|
|
53
|
+
exports.Invalid = Invalid;
|
|
73
54
|
class Valid extends ActionImpl {
|
|
74
55
|
constructor(payload = {}) {
|
|
75
56
|
super(payload, 'valid', {});
|
|
76
57
|
}
|
|
77
58
|
}
|
|
59
|
+
exports.Valid = Valid;
|
|
78
60
|
class ExecuteRule extends ActionImpl {
|
|
79
61
|
constructor(payload = {}, dispatch = false) {
|
|
80
62
|
super(payload, 'executeRule', { dispatch });
|
|
81
63
|
}
|
|
82
64
|
}
|
|
65
|
+
exports.ExecuteRule = ExecuteRule;
|
|
83
66
|
const propertyChange = (propertyName, currentValue, prevValue) => {
|
|
84
67
|
return new Change({
|
|
85
68
|
changes: [
|
|
@@ -91,46 +74,55 @@ const propertyChange = (propertyName, currentValue, prevValue) => {
|
|
|
91
74
|
]
|
|
92
75
|
});
|
|
93
76
|
};
|
|
77
|
+
exports.propertyChange = propertyChange;
|
|
94
78
|
class Initialize extends ActionImpl {
|
|
95
79
|
constructor(payload, dispatch = false) {
|
|
96
80
|
super(payload, 'initialize', { dispatch });
|
|
97
81
|
}
|
|
98
82
|
}
|
|
83
|
+
exports.Initialize = Initialize;
|
|
99
84
|
class FormLoad extends ActionImpl {
|
|
100
85
|
constructor() {
|
|
101
86
|
super({}, 'load', { dispatch: false });
|
|
102
87
|
}
|
|
103
88
|
}
|
|
89
|
+
exports.FormLoad = FormLoad;
|
|
104
90
|
class Click extends ActionImpl {
|
|
105
91
|
constructor(payload, dispatch = false) {
|
|
106
92
|
super(payload, 'click', { dispatch });
|
|
107
93
|
}
|
|
108
94
|
}
|
|
95
|
+
exports.Click = Click;
|
|
109
96
|
class Blur extends ActionImpl {
|
|
110
97
|
constructor(payload, dispatch = false) {
|
|
111
98
|
super(payload, 'blur', { dispatch });
|
|
112
99
|
}
|
|
113
100
|
}
|
|
101
|
+
exports.Blur = Blur;
|
|
114
102
|
class ValidationComplete extends ActionImpl {
|
|
115
103
|
constructor(payload, dispatch = false) {
|
|
116
104
|
super(payload, 'validationComplete', { dispatch });
|
|
117
105
|
}
|
|
118
106
|
}
|
|
107
|
+
exports.ValidationComplete = ValidationComplete;
|
|
119
108
|
class Focus extends ActionImpl {
|
|
120
109
|
constructor() {
|
|
121
110
|
super({}, 'focus', { dispatch: false });
|
|
122
111
|
}
|
|
123
112
|
}
|
|
113
|
+
exports.Focus = Focus;
|
|
124
114
|
class Submit extends ActionImpl {
|
|
125
115
|
constructor(payload, dispatch = false) {
|
|
126
116
|
super(payload, 'submit', { dispatch });
|
|
127
117
|
}
|
|
128
118
|
}
|
|
119
|
+
exports.Submit = Submit;
|
|
129
120
|
class Reset extends ActionImpl {
|
|
130
121
|
constructor(payload, dispatch = false) {
|
|
131
122
|
super(payload, 'reset', { dispatch });
|
|
132
123
|
}
|
|
133
124
|
}
|
|
125
|
+
exports.Reset = Reset;
|
|
134
126
|
class FieldChanged extends ActionImpl {
|
|
135
127
|
constructor(changes, field) {
|
|
136
128
|
super({
|
|
@@ -139,6 +131,7 @@ class FieldChanged extends ActionImpl {
|
|
|
139
131
|
}, 'fieldChanged');
|
|
140
132
|
}
|
|
141
133
|
}
|
|
134
|
+
exports.FieldChanged = FieldChanged;
|
|
142
135
|
class CustomEvent extends ActionImpl {
|
|
143
136
|
constructor(eventName, payload = {}, dispatch = false) {
|
|
144
137
|
super(payload, eventName, { dispatch });
|
|
@@ -147,25 +140,28 @@ class CustomEvent extends ActionImpl {
|
|
|
147
140
|
return true;
|
|
148
141
|
}
|
|
149
142
|
}
|
|
143
|
+
exports.CustomEvent = CustomEvent;
|
|
150
144
|
class AddItem extends ActionImpl {
|
|
151
145
|
constructor(payload) {
|
|
152
146
|
super(payload, 'addItem');
|
|
153
147
|
}
|
|
154
148
|
}
|
|
149
|
+
exports.AddItem = AddItem;
|
|
155
150
|
class RemoveItem extends ActionImpl {
|
|
156
151
|
constructor(payload) {
|
|
157
152
|
super(payload, 'removeItem');
|
|
158
153
|
}
|
|
159
154
|
}
|
|
155
|
+
exports.RemoveItem = RemoveItem;
|
|
160
156
|
class AddInstance extends ActionImpl {
|
|
161
157
|
constructor(payload) {
|
|
162
158
|
super(payload, 'addInstance');
|
|
163
159
|
}
|
|
164
160
|
}
|
|
161
|
+
exports.AddInstance = AddInstance;
|
|
165
162
|
class RemoveInstance extends ActionImpl {
|
|
166
163
|
constructor(payload) {
|
|
167
164
|
super(payload, 'removeInstance');
|
|
168
165
|
}
|
|
169
166
|
}
|
|
170
|
-
|
|
171
|
-
export { AddInstance, AddItem, Blur, Change, Click, CustomEvent, ExecuteRule, FieldChanged, Focus, FormLoad, Initialize, Invalid, RemoveInstance, RemoveItem, Reset, Submit, Valid, ValidationComplete, propertyChange };
|
|
167
|
+
exports.RemoveInstance = RemoveInstance;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export type LogFunction = 'info' | 'warn' | 'error' | 'debug';
|
|
2
|
-
export type LogLevel = 'off' | LogFunction;
|
|
1
|
+
export declare type LogFunction = 'info' | 'warn' | 'error' | 'debug';
|
|
2
|
+
export declare type LogLevel = 'off' | LogFunction;
|
|
3
3
|
export declare class Logger {
|
|
4
4
|
debug(msg: string): void;
|
|
5
5
|
info(msg: string): void;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Logger = void 0;
|
|
4
|
+
const levels = {
|
|
5
|
+
off: 0,
|
|
6
|
+
debug: 1,
|
|
7
|
+
info: 2,
|
|
8
|
+
warn: 3,
|
|
9
|
+
error: 4
|
|
10
|
+
};
|
|
11
|
+
class Logger {
|
|
12
|
+
constructor(logLevel = 'off') {
|
|
13
|
+
this.logLevel = levels[logLevel];
|
|
14
|
+
}
|
|
15
|
+
debug(msg) {
|
|
16
|
+
this.log(msg, 'debug');
|
|
17
|
+
}
|
|
18
|
+
info(msg) {
|
|
19
|
+
this.log(msg, 'info');
|
|
20
|
+
}
|
|
21
|
+
warn(msg) {
|
|
22
|
+
this.log(msg, 'warn');
|
|
23
|
+
}
|
|
24
|
+
error(msg) {
|
|
25
|
+
this.log(msg, 'error');
|
|
26
|
+
}
|
|
27
|
+
log(msg, level) {
|
|
28
|
+
if (this.logLevel !== 0 && this.logLevel <= levels[level]) {
|
|
29
|
+
console[level](msg);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.Logger = Logger;
|
|
@@ -1,37 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
* the property of Adobe and its suppliers, if any. The intellectual
|
|
10
|
-
* and technical concepts contained herein are proprietary to Adobe
|
|
11
|
-
* and its suppliers and are protected by all applicable intellectual
|
|
12
|
-
* property laws, including trade secret and copyright laws.
|
|
13
|
-
* Dissemination of this information or reproduction of this material
|
|
14
|
-
* is strictly forbidden unless prior written permission is obtained
|
|
15
|
-
* from Adobe.
|
|
16
|
-
|
|
17
|
-
* Adobe permits you to use and modify this file solely in accordance with
|
|
18
|
-
* the terms of the Adobe license agreement accompanying it.
|
|
19
|
-
*************************************************************************/
|
|
20
|
-
|
|
21
|
-
import DataValue from './DataValue.js';
|
|
22
|
-
import NullDataValue from './EmptyDataValue.js';
|
|
23
|
-
|
|
24
|
-
class DataGroup extends DataValue {
|
|
25
|
-
$_items;
|
|
26
|
-
createEntry(key, value) {
|
|
27
|
-
const t = value instanceof Array ? 'array' : typeof value;
|
|
28
|
-
if (typeof value === 'object' && value != null) {
|
|
29
|
-
return new DataGroup(key, value, t);
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
return new DataValue(key, value, t);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const DataValue_1 = __importDefault(require("./DataValue"));
|
|
7
|
+
const EmptyDataValue_1 = __importDefault(require("./EmptyDataValue"));
|
|
8
|
+
class DataGroup extends DataValue_1.default {
|
|
35
9
|
constructor(_name, _value, _type = typeof _value) {
|
|
36
10
|
super(_name, _value, _type);
|
|
37
11
|
if (_value instanceof Array) {
|
|
@@ -45,6 +19,15 @@ class DataGroup extends DataValue {
|
|
|
45
19
|
}));
|
|
46
20
|
}
|
|
47
21
|
}
|
|
22
|
+
createEntry(key, value) {
|
|
23
|
+
const t = value instanceof Array ? 'array' : typeof value;
|
|
24
|
+
if (typeof value === 'object' && value != null) {
|
|
25
|
+
return new DataGroup(key, value, t);
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
return new DataValue_1.default(key, value, t);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
48
31
|
get $value() {
|
|
49
32
|
const enabled = this.$_fields.find(x => x.enabled !== false);
|
|
50
33
|
if (!enabled && this.$_fields.length) {
|
|
@@ -63,10 +46,10 @@ class DataGroup extends DataValue {
|
|
|
63
46
|
return Object.entries(this.$_items).length;
|
|
64
47
|
}
|
|
65
48
|
$convertToDataValue() {
|
|
66
|
-
return new
|
|
49
|
+
return new DataValue_1.default(this.$name, this.$value, this.$type);
|
|
67
50
|
}
|
|
68
51
|
$addDataNode(name, value, override = false) {
|
|
69
|
-
if (value !==
|
|
52
|
+
if (value !== EmptyDataValue_1.default) {
|
|
70
53
|
if (this.$type === 'array') {
|
|
71
54
|
const index = name;
|
|
72
55
|
if (!override) {
|
|
@@ -96,5 +79,4 @@ class DataGroup extends DataValue {
|
|
|
96
79
|
return true;
|
|
97
80
|
}
|
|
98
81
|
}
|
|
99
|
-
|
|
100
|
-
export { DataGroup as default };
|
|
82
|
+
exports.default = DataGroup;
|
|
@@ -1,32 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* ___________________
|
|
4
|
-
*
|
|
5
|
-
* Copyright 2022 Adobe
|
|
6
|
-
* All Rights Reserved.
|
|
7
|
-
*
|
|
8
|
-
* NOTICE: All information contained herein is, and remains
|
|
9
|
-
* the property of Adobe and its suppliers, if any. The intellectual
|
|
10
|
-
* and technical concepts contained herein are proprietary to Adobe
|
|
11
|
-
* and its suppliers and are protected by all applicable intellectual
|
|
12
|
-
* property laws, including trade secret and copyright laws.
|
|
13
|
-
* Dissemination of this information or reproduction of this material
|
|
14
|
-
* is strictly forbidden unless prior written permission is obtained
|
|
15
|
-
* from Adobe.
|
|
16
|
-
|
|
17
|
-
* Adobe permits you to use and modify this file solely in accordance with
|
|
18
|
-
* the terms of the Adobe license agreement accompanying it.
|
|
19
|
-
*************************************************************************/
|
|
20
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
3
|
class DataValue {
|
|
22
|
-
$_name;
|
|
23
|
-
$_value;
|
|
24
|
-
$_type;
|
|
25
|
-
$_fields = [];
|
|
26
4
|
constructor($_name, $_value, $_type = typeof $_value) {
|
|
27
5
|
this.$_name = $_name;
|
|
28
6
|
this.$_value = $_value;
|
|
29
7
|
this.$_type = $_type;
|
|
8
|
+
this.$_fields = [];
|
|
30
9
|
}
|
|
31
10
|
valueOf() {
|
|
32
11
|
return this.$_value;
|
|
@@ -64,5 +43,4 @@ class DataValue {
|
|
|
64
43
|
return false;
|
|
65
44
|
}
|
|
66
45
|
}
|
|
67
|
-
|
|
68
|
-
export { DataValue as default };
|
|
46
|
+
exports.default = DataValue;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const DataValue_1 = __importDefault(require("./DataValue"));
|
|
7
|
+
const value = Symbol('NullValue');
|
|
8
|
+
class NullDataValueClass extends DataValue_1.default {
|
|
9
|
+
constructor() {
|
|
10
|
+
super('', value, 'null');
|
|
11
|
+
}
|
|
12
|
+
setValue() {
|
|
13
|
+
}
|
|
14
|
+
$bindToField() {
|
|
15
|
+
}
|
|
16
|
+
$length() {
|
|
17
|
+
return 0;
|
|
18
|
+
}
|
|
19
|
+
$convertToDataValue() {
|
|
20
|
+
return this;
|
|
21
|
+
}
|
|
22
|
+
$addDataNode() {
|
|
23
|
+
}
|
|
24
|
+
$removeDataNode() {
|
|
25
|
+
}
|
|
26
|
+
$getDataNode() {
|
|
27
|
+
return this;
|
|
28
|
+
}
|
|
29
|
+
$containsDataNode() {
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
const NullDataValue = new NullDataValueClass();
|
|
34
|
+
exports.default = NullDataValue;
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export * from './FormInstance';
|
|
2
|
+
export * from './types/index';
|
|
3
|
+
export * from './controller/Events';
|
|
4
|
+
export * from './utils/TranslationUtils';
|
|
5
|
+
export * from './utils/JsonUtils';
|
|
6
|
+
export * from './utils/SchemaUtils';
|
|
7
|
+
import { getFileSizeInBytes, extractFileInfo, isEmpty } from './utils/FormUtils';
|
|
8
|
+
import { BaseNode } from './BaseNode';
|
|
9
|
+
import Checkbox from './Checkbox';
|
|
10
|
+
import CheckboxGroup from './CheckboxGroup';
|
|
11
|
+
import Container from './Container';
|
|
12
|
+
import Field from './Field';
|
|
13
|
+
import { Fieldset } from './Fieldset';
|
|
14
|
+
import { FileObject } from './FileObject';
|
|
15
|
+
import FileUpload from './FileUpload';
|
|
16
|
+
import FormMetaData from './FormMetaData';
|
|
17
|
+
import Node from './Node';
|
|
18
|
+
import Scriptable from './Scriptable';
|
|
19
|
+
import Form from './Form';
|
|
20
|
+
import { FunctionRuntime, request } from './rules/FunctionRuntime';
|
|
21
|
+
export { Form, BaseNode, Checkbox, CheckboxGroup, Container, Field, Fieldset, FileObject, FileUpload, FormMetaData, Node, Scriptable, getFileSizeInBytes, extractFileInfo, FunctionRuntime, request, isEmpty };
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
|
+
};
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
exports.isEmpty = exports.request = exports.FunctionRuntime = exports.extractFileInfo = exports.getFileSizeInBytes = exports.Scriptable = exports.Node = exports.FormMetaData = exports.FileUpload = exports.FileObject = exports.Fieldset = exports.Field = exports.Container = exports.CheckboxGroup = exports.Checkbox = exports.BaseNode = exports.Form = void 0;
|
|
21
|
+
__exportStar(require("./FormInstance"), exports);
|
|
22
|
+
__exportStar(require("./types/index"), exports);
|
|
23
|
+
__exportStar(require("./controller/Events"), exports);
|
|
24
|
+
__exportStar(require("./utils/TranslationUtils"), exports);
|
|
25
|
+
__exportStar(require("./utils/JsonUtils"), exports);
|
|
26
|
+
__exportStar(require("./utils/SchemaUtils"), exports);
|
|
27
|
+
const FormUtils_1 = require("./utils/FormUtils");
|
|
28
|
+
Object.defineProperty(exports, "getFileSizeInBytes", { enumerable: true, get: function () { return FormUtils_1.getFileSizeInBytes; } });
|
|
29
|
+
Object.defineProperty(exports, "extractFileInfo", { enumerable: true, get: function () { return FormUtils_1.extractFileInfo; } });
|
|
30
|
+
Object.defineProperty(exports, "isEmpty", { enumerable: true, get: function () { return FormUtils_1.isEmpty; } });
|
|
31
|
+
const BaseNode_1 = require("./BaseNode");
|
|
32
|
+
Object.defineProperty(exports, "BaseNode", { enumerable: true, get: function () { return BaseNode_1.BaseNode; } });
|
|
33
|
+
const Checkbox_1 = __importDefault(require("./Checkbox"));
|
|
34
|
+
exports.Checkbox = Checkbox_1.default;
|
|
35
|
+
const CheckboxGroup_1 = __importDefault(require("./CheckboxGroup"));
|
|
36
|
+
exports.CheckboxGroup = CheckboxGroup_1.default;
|
|
37
|
+
const Container_1 = __importDefault(require("./Container"));
|
|
38
|
+
exports.Container = Container_1.default;
|
|
39
|
+
const Field_1 = __importDefault(require("./Field"));
|
|
40
|
+
exports.Field = Field_1.default;
|
|
41
|
+
const Fieldset_1 = require("./Fieldset");
|
|
42
|
+
Object.defineProperty(exports, "Fieldset", { enumerable: true, get: function () { return Fieldset_1.Fieldset; } });
|
|
43
|
+
const FileObject_1 = require("./FileObject");
|
|
44
|
+
Object.defineProperty(exports, "FileObject", { enumerable: true, get: function () { return FileObject_1.FileObject; } });
|
|
45
|
+
const FileUpload_1 = __importDefault(require("./FileUpload"));
|
|
46
|
+
exports.FileUpload = FileUpload_1.default;
|
|
47
|
+
const FormMetaData_1 = __importDefault(require("./FormMetaData"));
|
|
48
|
+
exports.FormMetaData = FormMetaData_1.default;
|
|
49
|
+
const Node_1 = __importDefault(require("./Node"));
|
|
50
|
+
exports.Node = Node_1.default;
|
|
51
|
+
const Scriptable_1 = __importDefault(require("./Scriptable"));
|
|
52
|
+
exports.Scriptable = Scriptable_1.default;
|
|
53
|
+
const Form_1 = __importDefault(require("./Form"));
|
|
54
|
+
exports.Form = Form_1.default;
|
|
55
|
+
const FunctionRuntime_1 = require("./rules/FunctionRuntime");
|
|
56
|
+
Object.defineProperty(exports, "FunctionRuntime", { enumerable: true, get: function () { return FunctionRuntime_1.FunctionRuntime; } });
|
|
57
|
+
Object.defineProperty(exports, "request", { enumerable: true, get: function () { return FunctionRuntime_1.request; } });
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
type HTTP_VERB = 'GET' | 'POST';
|
|
1
|
+
declare type HTTP_VERB = 'GET' | 'POST';
|
|
2
2
|
export declare const request: (context: any, uri: string, httpVerb: HTTP_VERB, payload: any, success: string, error: string, headers: any) => Promise<void>;
|
|
3
3
|
export declare const submit: (context: any, success: string, error: string, submitAs?: 'application/json' | 'multipart/form-data', input_data?: any) => Promise<void>;
|
|
4
|
-
export type CustomFunction = Function;
|
|
5
|
-
export type FunctionDefinition = {
|
|
4
|
+
export declare type CustomFunction = Function;
|
|
5
|
+
export declare type FunctionDefinition = {
|
|
6
6
|
_func: CustomFunction;
|
|
7
7
|
_signature: Array<any>;
|
|
8
8
|
};
|