@aemforms/af-core 0.22.23 → 0.22.26
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/browser/afb-events.js +151 -0
- package/lib/browser/afb-runtime.js +3620 -0
- package/lib/cjs/index.cjs +1876 -267
- package/lib/esm/BaseNode.js +454 -26
- package/lib/esm/Checkbox.js +1 -37
- package/lib/esm/CheckboxGroup.js +1 -38
- package/lib/esm/Container.js +9 -30
- package/lib/esm/DateField.js +2 -38
- package/lib/esm/Field.d.ts +2 -2
- package/lib/esm/Field.js +26 -62
- package/lib/esm/Fieldset.js +3 -36
- package/lib/esm/FileObject.js +1 -23
- package/lib/esm/FileUpload.js +1 -34
- package/lib/esm/Form.d.ts +1 -1
- package/lib/esm/Form.js +8 -40
- package/lib/esm/FormInstance.js +5 -53
- package/lib/esm/FormMetaData.js +1 -26
- package/lib/esm/InstanceManager.js +8 -35
- package/lib/esm/Node.js +1 -25
- package/lib/esm/Scriptable.js +2 -29
- package/lib/esm/controller/EventQueue.js +1 -23
- package/lib/esm/controller/Events.d.ts +1 -1
- package/lib/esm/controller/Events.js +19 -41
- package/lib/esm/controller/Logger.d.ts +2 -2
- package/lib/esm/controller/Logger.js +1 -23
- package/lib/esm/data/DataGroup.js +1 -24
- package/lib/esm/data/DataValue.js +1 -23
- package/lib/esm/data/EmptyDataValue.js +1 -23
- package/lib/esm/index.js +21 -55
- package/lib/esm/rules/FunctionRuntime.d.ts +3 -3
- package/lib/esm/rules/FunctionRuntime.js +6 -31
- package/lib/esm/rules/RuleEngine.js +1 -30
- package/lib/esm/types/Json.d.ts +16 -16
- package/lib/esm/types/Json.js +2 -24
- package/lib/esm/types/Model.d.ts +4 -4
- package/lib/esm/types/Model.js +1 -23
- package/lib/esm/types/index.js +2 -22
- package/lib/esm/utils/DataRefParser.d.ts +2 -2
- package/lib/esm/utils/DataRefParser.js +6 -31
- package/lib/esm/utils/Fetch.d.ts +1 -1
- package/lib/esm/utils/Fetch.js +2 -24
- package/lib/esm/utils/FormCreationUtils.js +2 -40
- package/lib/esm/utils/FormUtils.js +8 -33
- package/lib/esm/utils/JsonUtils.js +11 -34
- package/lib/esm/utils/LogUtils.js +1 -23
- package/lib/esm/utils/SchemaUtils.js +2 -24
- package/lib/esm/utils/TranslationUtils.d.ts +1 -1
- package/lib/esm/utils/TranslationUtils.js +9 -32
- package/lib/esm/utils/ValidationUtils.d.ts +4 -4
- package/lib/esm/utils/ValidationUtils.js +4 -30
- package/package.json +2 -14
- package/lib/esm/BaseNode-dc59ab07.js +0 -478
package/lib/esm/Field.js
CHANGED
|
@@ -1,39 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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 { _ as __decorate, s as staticFields, t as target, d as dependencyTracked, e as exclude, i as include } from './BaseNode-dc59ab07.js';
|
|
22
|
-
import { ValidationError } from './types/Model.js';
|
|
23
|
-
import { Constraints, coerceType, ValidConstraints } from './utils/ValidationUtils.js';
|
|
24
|
-
import { Initialize, ExecuteRule, Change, Valid, Invalid, propertyChange } from './controller/Events.js';
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { ValidationError } from './types/index.js';
|
|
8
|
+
import { coerceType, Constraints, ValidConstraints } from './utils/ValidationUtils.js';
|
|
9
|
+
import { Change, ExecuteRule, Initialize, Invalid, propertyChange, Valid } from './controller/Events.js';
|
|
25
10
|
import Scriptable from './Scriptable.js';
|
|
26
11
|
import { defaultFieldTypes } from './utils/SchemaUtils.js';
|
|
27
12
|
import DataValue from './data/DataValue.js';
|
|
13
|
+
import { dependencyTracked, include, exclude, target, staticFields } from './BaseNode.js';
|
|
28
14
|
import NullDataValue from './data/EmptyDataValue.js';
|
|
29
15
|
import { format } from '@aemforms/af-formatters';
|
|
30
|
-
import './utils/DataRefParser.js';
|
|
31
|
-
import './data/DataGroup.js';
|
|
32
|
-
import './utils/FormUtils.js';
|
|
33
|
-
import './utils/JsonUtils.js';
|
|
34
|
-
import './types/Json.js';
|
|
35
|
-
import './FileObject.js';
|
|
36
|
-
|
|
37
16
|
const validTypes = ['string', 'number', 'boolean', 'file', 'string[]', 'number[]', 'boolean[]', 'file[]', 'array', 'object'];
|
|
38
17
|
class Field extends Scriptable {
|
|
39
18
|
constructor(params, _options) {
|
|
@@ -182,10 +161,10 @@ class Field extends Scriptable {
|
|
|
182
161
|
}
|
|
183
162
|
}
|
|
184
163
|
get editFormat() {
|
|
185
|
-
return this.
|
|
164
|
+
return this._jsonModel.editFormat;
|
|
186
165
|
}
|
|
187
166
|
get displayFormat() {
|
|
188
|
-
return this.
|
|
167
|
+
return this._jsonModel.displayFormat;
|
|
189
168
|
}
|
|
190
169
|
get placeholder() {
|
|
191
170
|
return this._jsonModel.placeholder;
|
|
@@ -258,43 +237,31 @@ class Field extends Scriptable {
|
|
|
258
237
|
return this._jsonModel.value === undefined || this._jsonModel.value === null || this._jsonModel.value === '';
|
|
259
238
|
}
|
|
260
239
|
withCategory(df) {
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
if (
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
df = `num|${df}`;
|
|
269
|
-
}
|
|
270
|
-
return df;
|
|
240
|
+
const hasCategory = df?.match(/^(?:date|num)\|/);
|
|
241
|
+
if (hasCategory == null) {
|
|
242
|
+
if (this.format === 'date') {
|
|
243
|
+
df = `date|${df}`;
|
|
244
|
+
}
|
|
245
|
+
else if (this.type === 'number') {
|
|
246
|
+
df = `num|${df}`;
|
|
271
247
|
}
|
|
248
|
+
return df;
|
|
272
249
|
}
|
|
273
250
|
return df;
|
|
274
251
|
}
|
|
275
252
|
get editValue() {
|
|
276
|
-
const df = this.editFormat;
|
|
253
|
+
const df = this.withCategory(this.editFormat);
|
|
277
254
|
if (df && this.isNotEmpty(this.value) && this.valid !== false) {
|
|
278
|
-
|
|
279
|
-
return format(this.value, this.language, df);
|
|
280
|
-
}
|
|
281
|
-
catch (e) {
|
|
282
|
-
return this.value;
|
|
283
|
-
}
|
|
255
|
+
return format(this.value, this.language, df);
|
|
284
256
|
}
|
|
285
257
|
else {
|
|
286
258
|
return this.value;
|
|
287
259
|
}
|
|
288
260
|
}
|
|
289
261
|
get displayValue() {
|
|
290
|
-
const df = this.displayFormat;
|
|
262
|
+
const df = this.withCategory(this.displayFormat);
|
|
291
263
|
if (df && this.isNotEmpty(this.value) && this.valid !== false) {
|
|
292
|
-
|
|
293
|
-
return format(this.value, this.language, df);
|
|
294
|
-
}
|
|
295
|
-
catch (e) {
|
|
296
|
-
return this.value;
|
|
297
|
-
}
|
|
264
|
+
return format(this.value, this.language, df);
|
|
298
265
|
}
|
|
299
266
|
else {
|
|
300
267
|
return this.value;
|
|
@@ -434,7 +401,7 @@ class Field extends Scriptable {
|
|
|
434
401
|
const iv = this._jsonModel.minimum || this._jsonModel.default || 0;
|
|
435
402
|
const fIVal = iv * factor;
|
|
436
403
|
const qt = (fVal - fIVal) / fStep;
|
|
437
|
-
const valid =
|
|
404
|
+
const valid = (fVal - fIVal) % fStep < .001;
|
|
438
405
|
let next, prev;
|
|
439
406
|
if (!valid) {
|
|
440
407
|
next = (Math.ceil(qt) * fStep + fIVal) / factor;
|
|
@@ -637,8 +604,6 @@ class Field extends Scriptable {
|
|
|
637
604
|
getState() {
|
|
638
605
|
return {
|
|
639
606
|
...super.getState(),
|
|
640
|
-
editFormat: this.editFormat,
|
|
641
|
-
displayFormat: this.displayFormat,
|
|
642
607
|
editValue: this.editValue,
|
|
643
608
|
displayValue: this.displayValue
|
|
644
609
|
};
|
|
@@ -688,5 +653,4 @@ __decorate([
|
|
|
688
653
|
__decorate([
|
|
689
654
|
dependencyTracked()
|
|
690
655
|
], Field.prototype, "exclusiveMaximum", null);
|
|
691
|
-
|
|
692
|
-
export { Field as default };
|
|
656
|
+
export default Field;
|
package/lib/esm/Fieldset.js
CHANGED
|
@@ -1,40 +1,9 @@
|
|
|
1
|
-
/*************************************************************************
|
|
2
|
-
* ADOBE CONFIDENTIAL
|
|
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
1
|
import Container from './Container.js';
|
|
22
|
-
import {
|
|
23
|
-
import './BaseNode-dc59ab07.js';
|
|
24
|
-
import './utils/DataRefParser.js';
|
|
25
|
-
import './data/DataGroup.js';
|
|
26
|
-
import './data/DataValue.js';
|
|
27
|
-
import './data/EmptyDataValue.js';
|
|
28
|
-
import './utils/JsonUtils.js';
|
|
29
|
-
import './types/Json.js';
|
|
30
|
-
import './utils/SchemaUtils.js';
|
|
31
|
-
import './Scriptable.js';
|
|
32
|
-
|
|
2
|
+
import { ExecuteRule, Initialize } from './controller/Events.js';
|
|
33
3
|
const defaults = {
|
|
34
|
-
visible: true
|
|
35
|
-
enabled: true
|
|
4
|
+
visible: true
|
|
36
5
|
};
|
|
37
|
-
class Fieldset extends Container {
|
|
6
|
+
export class Fieldset extends Container {
|
|
38
7
|
constructor(params, _options) {
|
|
39
8
|
super(params, _options);
|
|
40
9
|
this._applyDefaults();
|
|
@@ -74,5 +43,3 @@ class Fieldset extends Container {
|
|
|
74
43
|
this._setProperty('enabled', e);
|
|
75
44
|
}
|
|
76
45
|
}
|
|
77
|
-
|
|
78
|
-
export { Fieldset };
|
package/lib/esm/FileObject.js
CHANGED
|
@@ -1,24 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* ADOBE CONFIDENTIAL
|
|
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
|
-
class FileObject {
|
|
1
|
+
export class FileObject {
|
|
22
2
|
data;
|
|
23
3
|
mediaType = 'application/octet-stream';
|
|
24
4
|
name = 'unknown';
|
|
@@ -44,5 +24,3 @@ class FileObject {
|
|
|
44
24
|
this.size === obj.size);
|
|
45
25
|
}
|
|
46
26
|
}
|
|
47
|
-
|
|
48
|
-
export { FileObject };
|
package/lib/esm/FileUpload.js
CHANGED
|
@@ -1,40 +1,8 @@
|
|
|
1
|
-
/*************************************************************************
|
|
2
|
-
* ADOBE CONFIDENTIAL
|
|
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
1
|
import { propertyChange } from './controller/Events.js';
|
|
22
2
|
import Field from './Field.js';
|
|
23
3
|
import { getFileSizeInBytes } from './utils/FormUtils.js';
|
|
24
4
|
import { FileObject } from './FileObject.js';
|
|
25
5
|
import { Constraints } from './utils/ValidationUtils.js';
|
|
26
|
-
import './BaseNode-dc59ab07.js';
|
|
27
|
-
import './utils/DataRefParser.js';
|
|
28
|
-
import './data/DataGroup.js';
|
|
29
|
-
import './data/DataValue.js';
|
|
30
|
-
import './data/EmptyDataValue.js';
|
|
31
|
-
import './types/Model.js';
|
|
32
|
-
import './Scriptable.js';
|
|
33
|
-
import './utils/SchemaUtils.js';
|
|
34
|
-
import '@aemforms/af-formatters';
|
|
35
|
-
import './utils/JsonUtils.js';
|
|
36
|
-
import './types/Json.js';
|
|
37
|
-
|
|
38
6
|
function addNameToDataURL(dataURL, name) {
|
|
39
7
|
return dataURL.replace(';base64', `;name=${encodeURIComponent(name)};base64`);
|
|
40
8
|
}
|
|
@@ -137,5 +105,4 @@ class FileUpload extends Field {
|
|
|
137
105
|
}
|
|
138
106
|
}
|
|
139
107
|
}
|
|
140
|
-
|
|
141
|
-
export { FileUpload as default };
|
|
108
|
+
export default FileUpload;
|
package/lib/esm/Form.d.ts
CHANGED
|
@@ -100,8 +100,8 @@ declare class Form extends Container<FormJson> implements FormModel {
|
|
|
100
100
|
validate(): import("./types/Model.js").ValidationError[];
|
|
101
101
|
isValid(): boolean;
|
|
102
102
|
dispatch(action: Action): void;
|
|
103
|
+
executeAction(action: Action): void;
|
|
103
104
|
submit(action: Action, context: any): void;
|
|
104
|
-
reset(): void;
|
|
105
105
|
getElement(id: string): FieldModel | FieldsetModel | this;
|
|
106
106
|
get qualifiedName(): string;
|
|
107
107
|
getEventQueue(): EventQueue;
|
package/lib/esm/Form.js
CHANGED
|
@@ -1,43 +1,11 @@
|
|
|
1
|
-
/*************************************************************************
|
|
2
|
-
* ADOBE CONFIDENTIAL
|
|
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
1
|
import Container from './Container.js';
|
|
22
2
|
import FormMetaData from './FormMetaData.js';
|
|
23
3
|
import EventQueue from './controller/EventQueue.js';
|
|
24
4
|
import { Logger } from './controller/Logger.js';
|
|
25
|
-
import {
|
|
5
|
+
import { getAttachments, IdGenerator } from './utils/FormUtils.js';
|
|
26
6
|
import DataGroup from './data/DataGroup.js';
|
|
27
7
|
import { submit } from './rules/FunctionRuntime.js';
|
|
28
|
-
import {
|
|
29
|
-
import './BaseNode-dc59ab07.js';
|
|
30
|
-
import './utils/DataRefParser.js';
|
|
31
|
-
import './data/DataValue.js';
|
|
32
|
-
import './data/EmptyDataValue.js';
|
|
33
|
-
import './utils/JsonUtils.js';
|
|
34
|
-
import './types/Json.js';
|
|
35
|
-
import './utils/SchemaUtils.js';
|
|
36
|
-
import './Scriptable.js';
|
|
37
|
-
import './Node.js';
|
|
38
|
-
import './FileObject.js';
|
|
39
|
-
import './utils/Fetch.js';
|
|
40
|
-
|
|
8
|
+
import { ExecuteRule, FieldChanged, FormLoad, Initialize, ValidationComplete } from './controller/Events.js';
|
|
41
9
|
class Form extends Container {
|
|
42
10
|
_ruleEngine;
|
|
43
11
|
_eventQueue;
|
|
@@ -169,16 +137,17 @@ class Form extends Container {
|
|
|
169
137
|
super.dispatch(action);
|
|
170
138
|
}
|
|
171
139
|
}
|
|
140
|
+
executeAction(action) {
|
|
141
|
+
if ((action.type !== 'submit') || this._invalidFields.length === 0) {
|
|
142
|
+
super.executeAction(action);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
172
145
|
submit(action, context) {
|
|
173
146
|
if (this.validate().length === 0) {
|
|
174
147
|
const payload = action?.payload || {};
|
|
175
148
|
submit(context, payload?.success, payload?.error, payload?.submit_as, payload?.data);
|
|
176
149
|
}
|
|
177
150
|
}
|
|
178
|
-
reset() {
|
|
179
|
-
super.reset();
|
|
180
|
-
this._invalidFields = [];
|
|
181
|
-
}
|
|
182
151
|
getElement(id) {
|
|
183
152
|
if (id == this.id) {
|
|
184
153
|
return this;
|
|
@@ -204,5 +173,4 @@ class Form extends Container {
|
|
|
204
173
|
return this._jsonModel.title || '';
|
|
205
174
|
}
|
|
206
175
|
}
|
|
207
|
-
|
|
208
|
-
export { Form as default };
|
|
176
|
+
export default Form;
|
package/lib/esm/FormInstance.js
CHANGED
|
@@ -1,23 +1,3 @@
|
|
|
1
|
-
/*************************************************************************
|
|
2
|
-
* ADOBE CONFIDENTIAL
|
|
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
1
|
import Form from './Form.js';
|
|
22
2
|
import { jsonString } from './utils/JsonUtils.js';
|
|
23
3
|
import { request } from './utils/Fetch.js';
|
|
@@ -26,33 +6,7 @@ import EventQueue from './controller/EventQueue.js';
|
|
|
26
6
|
import { Logger } from './controller/Logger.js';
|
|
27
7
|
import { FormFieldFactory } from './utils/FormCreationUtils.js';
|
|
28
8
|
import { FunctionRuntime } from './rules/FunctionRuntime.js';
|
|
29
|
-
|
|
30
|
-
import './BaseNode-dc59ab07.js';
|
|
31
|
-
import './controller/Events.js';
|
|
32
|
-
import './utils/DataRefParser.js';
|
|
33
|
-
import './data/DataGroup.js';
|
|
34
|
-
import './data/DataValue.js';
|
|
35
|
-
import './data/EmptyDataValue.js';
|
|
36
|
-
import './Scriptable.js';
|
|
37
|
-
import './types/Json.js';
|
|
38
|
-
import './utils/SchemaUtils.js';
|
|
39
|
-
import './FormMetaData.js';
|
|
40
|
-
import './Node.js';
|
|
41
|
-
import './utils/FormUtils.js';
|
|
42
|
-
import './FileObject.js';
|
|
43
|
-
import '@adobe/json-formula';
|
|
44
|
-
import './InstanceManager.js';
|
|
45
|
-
import './Fieldset.js';
|
|
46
|
-
import './FileUpload.js';
|
|
47
|
-
import './Field.js';
|
|
48
|
-
import './types/Model.js';
|
|
49
|
-
import './utils/ValidationUtils.js';
|
|
50
|
-
import '@aemforms/af-formatters';
|
|
51
|
-
import './Checkbox.js';
|
|
52
|
-
import './CheckboxGroup.js';
|
|
53
|
-
import './DateField.js';
|
|
54
|
-
|
|
55
|
-
const createFormInstance = (formModel, callback, logLevel = 'error', fModel = undefined) => {
|
|
9
|
+
export const createFormInstance = (formModel, callback, logLevel = 'error', fModel = undefined) => {
|
|
56
10
|
try {
|
|
57
11
|
let f = fModel;
|
|
58
12
|
if (f == null) {
|
|
@@ -73,7 +27,7 @@ const createFormInstance = (formModel, callback, logLevel = 'error', fModel = un
|
|
|
73
27
|
throw new Error(e);
|
|
74
28
|
}
|
|
75
29
|
};
|
|
76
|
-
const validateFormInstance = (formModel, data) => {
|
|
30
|
+
export const validateFormInstance = (formModel, data) => {
|
|
77
31
|
try {
|
|
78
32
|
const f = new Form({ ...formModel }, FormFieldFactory, new RuleEngine());
|
|
79
33
|
if (data) {
|
|
@@ -85,7 +39,7 @@ const validateFormInstance = (formModel, data) => {
|
|
|
85
39
|
throw new Error(e);
|
|
86
40
|
}
|
|
87
41
|
};
|
|
88
|
-
const validateFormData = (formModel, data) => {
|
|
42
|
+
export const validateFormData = (formModel, data) => {
|
|
89
43
|
try {
|
|
90
44
|
const f = new Form({ ...formModel }, FormFieldFactory, new RuleEngine());
|
|
91
45
|
if (data) {
|
|
@@ -101,7 +55,7 @@ const validateFormData = (formModel, data) => {
|
|
|
101
55
|
throw new Error(e);
|
|
102
56
|
}
|
|
103
57
|
};
|
|
104
|
-
const fetchForm = (url, headers = {}) => {
|
|
58
|
+
export const fetchForm = (url, headers = {}) => {
|
|
105
59
|
const headerObj = new Headers();
|
|
106
60
|
Object.entries(headers).forEach(([key, value]) => {
|
|
107
61
|
headerObj.append(key, value);
|
|
@@ -122,8 +76,6 @@ const fetchForm = (url, headers = {}) => {
|
|
|
122
76
|
});
|
|
123
77
|
});
|
|
124
78
|
};
|
|
125
|
-
const registerFunctions = (functions) => {
|
|
79
|
+
export const registerFunctions = (functions) => {
|
|
126
80
|
FunctionRuntime.registerFunctions(functions);
|
|
127
81
|
};
|
|
128
|
-
|
|
129
|
-
export { createFormInstance, fetchForm, registerFunctions, validateFormData, validateFormInstance };
|
package/lib/esm/FormMetaData.js
CHANGED
|
@@ -1,28 +1,4 @@
|
|
|
1
|
-
/*************************************************************************
|
|
2
|
-
* ADOBE CONFIDENTIAL
|
|
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
1
|
import Node from './Node.js';
|
|
22
|
-
import './utils/JsonUtils.js';
|
|
23
|
-
import './types/Json.js';
|
|
24
|
-
import './utils/SchemaUtils.js';
|
|
25
|
-
|
|
26
2
|
class FormMetaData extends Node {
|
|
27
3
|
get version() {
|
|
28
4
|
return this.getP('version', '');
|
|
@@ -31,5 +7,4 @@ class FormMetaData extends Node {
|
|
|
31
7
|
return this.getP('grammar', '');
|
|
32
8
|
}
|
|
33
9
|
}
|
|
34
|
-
|
|
35
|
-
export { FormMetaData as default };
|
|
10
|
+
export default FormMetaData;
|
|
@@ -1,37 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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 { _ as __decorate, d as dependencyTracked } from './BaseNode-dc59ab07.js';
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
22
7
|
import { Fieldset } from './Fieldset.js';
|
|
23
|
-
import './
|
|
24
|
-
|
|
25
|
-
import './data/DataGroup.js';
|
|
26
|
-
import './data/DataValue.js';
|
|
27
|
-
import './data/EmptyDataValue.js';
|
|
28
|
-
import './Container.js';
|
|
29
|
-
import './utils/JsonUtils.js';
|
|
30
|
-
import './types/Json.js';
|
|
31
|
-
import './utils/SchemaUtils.js';
|
|
32
|
-
import './Scriptable.js';
|
|
33
|
-
|
|
34
|
-
class InstanceManager extends Fieldset {
|
|
8
|
+
import { dependencyTracked } from './BaseNode.js';
|
|
9
|
+
export class InstanceManager extends Fieldset {
|
|
35
10
|
get maxOccur() {
|
|
36
11
|
return this._jsonModel.maxItems;
|
|
37
12
|
}
|
|
@@ -54,5 +29,3 @@ __decorate([
|
|
|
54
29
|
__decorate([
|
|
55
30
|
dependencyTracked()
|
|
56
31
|
], InstanceManager.prototype, "minOccur", null);
|
|
57
|
-
|
|
58
|
-
export { InstanceManager };
|
package/lib/esm/Node.js
CHANGED
|
@@ -1,27 +1,4 @@
|
|
|
1
|
-
/*************************************************************************
|
|
2
|
-
* ADOBE CONFIDENTIAL
|
|
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
1
|
import { getProperty } from './utils/JsonUtils.js';
|
|
22
|
-
import './types/Json.js';
|
|
23
|
-
import './utils/SchemaUtils.js';
|
|
24
|
-
|
|
25
2
|
class Node {
|
|
26
3
|
_jsonModel;
|
|
27
4
|
constructor(inputModel) {
|
|
@@ -36,5 +13,4 @@ class Node {
|
|
|
36
13
|
return false;
|
|
37
14
|
}
|
|
38
15
|
}
|
|
39
|
-
|
|
40
|
-
export { Node as default };
|
|
16
|
+
export default Node;
|
package/lib/esm/Scriptable.js
CHANGED
|
@@ -1,30 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* ADOBE CONFIDENTIAL
|
|
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 { B as BaseNode, a as editableProperties } from './BaseNode-dc59ab07.js';
|
|
22
|
-
import './controller/Events.js';
|
|
23
|
-
import './utils/DataRefParser.js';
|
|
24
|
-
import './data/DataGroup.js';
|
|
25
|
-
import './data/DataValue.js';
|
|
26
|
-
import './data/EmptyDataValue.js';
|
|
27
|
-
|
|
1
|
+
import { BaseNode, editableProperties } from './BaseNode.js';
|
|
28
2
|
class Scriptable extends BaseNode {
|
|
29
3
|
_events = {};
|
|
30
4
|
_rules = {};
|
|
@@ -186,5 +160,4 @@ class Scriptable extends BaseNode {
|
|
|
186
160
|
this.notifyDependents(action);
|
|
187
161
|
}
|
|
188
162
|
}
|
|
189
|
-
|
|
190
|
-
export { Scriptable as default };
|
|
163
|
+
export default Scriptable;
|
|
@@ -1,25 +1,4 @@
|
|
|
1
|
-
/*************************************************************************
|
|
2
|
-
* ADOBE CONFIDENTIAL
|
|
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
1
|
import { Logger } from './Logger.js';
|
|
22
|
-
|
|
23
2
|
class EventNode {
|
|
24
3
|
_node;
|
|
25
4
|
_event;
|
|
@@ -104,5 +83,4 @@ class EventQueue {
|
|
|
104
83
|
this._isProcessing = false;
|
|
105
84
|
}
|
|
106
85
|
}
|
|
107
|
-
|
|
108
|
-
export { EventQueue as default };
|
|
86
|
+
export default EventQueue;
|