@aemforms/af-core 0.22.26 → 0.22.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/lib/cjs/index.cjs +345 -1886
  2. package/lib/esm/BaseNode-d78cc1b0.js +478 -0
  3. package/lib/esm/BaseNode.d.ts +1 -1
  4. package/lib/esm/BaseNode.js +26 -454
  5. package/lib/esm/Checkbox.js +37 -1
  6. package/lib/esm/CheckboxGroup.js +38 -1
  7. package/lib/esm/Container.d.ts +6 -1
  8. package/lib/esm/Container.js +108 -19
  9. package/lib/esm/DateField.js +38 -2
  10. package/lib/esm/Field.d.ts +2 -2
  11. package/lib/esm/Field.js +62 -26
  12. package/lib/esm/Fieldset.js +36 -3
  13. package/lib/esm/FileObject.js +23 -1
  14. package/lib/esm/FileUpload.js +34 -1
  15. package/lib/esm/Form.d.ts +1 -1
  16. package/lib/esm/Form.js +40 -8
  17. package/lib/esm/FormInstance.js +53 -5
  18. package/lib/esm/FormMetaData.js +26 -1
  19. package/lib/esm/InstanceManager.js +35 -8
  20. package/lib/esm/Node.js +25 -1
  21. package/lib/esm/Scriptable.js +29 -2
  22. package/lib/esm/controller/EventQueue.js +23 -1
  23. package/lib/esm/controller/Events.d.ts +1 -1
  24. package/lib/esm/controller/Events.js +41 -19
  25. package/lib/esm/controller/Logger.d.ts +2 -2
  26. package/lib/esm/controller/Logger.js +23 -1
  27. package/lib/esm/data/DataGroup.js +24 -1
  28. package/lib/esm/data/DataValue.js +23 -1
  29. package/lib/esm/data/EmptyDataValue.js +23 -1
  30. package/lib/esm/index.js +55 -21
  31. package/lib/esm/rules/FunctionRuntime.d.ts +3 -3
  32. package/lib/esm/rules/FunctionRuntime.js +31 -6
  33. package/lib/esm/rules/RuleEngine.js +30 -1
  34. package/lib/esm/types/Json.d.ts +16 -16
  35. package/lib/esm/types/Json.js +24 -2
  36. package/lib/esm/types/Model.d.ts +4 -4
  37. package/lib/esm/types/Model.js +23 -1
  38. package/lib/esm/types/index.js +22 -2
  39. package/lib/esm/utils/DataRefParser.d.ts +2 -2
  40. package/lib/esm/utils/DataRefParser.js +31 -6
  41. package/lib/esm/utils/Fetch.d.ts +1 -1
  42. package/lib/esm/utils/Fetch.js +24 -2
  43. package/lib/esm/utils/FormCreationUtils.js +40 -2
  44. package/lib/esm/utils/FormUtils.js +33 -8
  45. package/lib/esm/utils/JsonUtils.js +34 -11
  46. package/lib/esm/utils/LogUtils.js +23 -1
  47. package/lib/esm/utils/SchemaUtils.js +24 -2
  48. package/lib/esm/utils/TranslationUtils.d.ts +1 -1
  49. package/lib/esm/utils/TranslationUtils.js +32 -9
  50. package/lib/esm/utils/ValidationUtils.d.ts +4 -4
  51. package/lib/esm/utils/ValidationUtils.js +30 -4
  52. package/package.json +14 -2
  53. package/lib/browser/afb-events.js +0 -151
  54. package/lib/browser/afb-runtime.js +0 -3620
package/lib/esm/index.js CHANGED
@@ -1,21 +1,55 @@
1
- export * from './FormInstance.js';
2
- export * from './types/index.js';
3
- export * from './controller/Events.js';
4
- export * from './utils/TranslationUtils.js';
5
- export * from './utils/JsonUtils.js';
6
- export * from './utils/SchemaUtils.js';
7
- import { getFileSizeInBytes, extractFileInfo, isEmpty } from './utils/FormUtils.js';
8
- import { BaseNode } from './BaseNode.js';
9
- import Checkbox from './Checkbox.js';
10
- import CheckboxGroup from './CheckboxGroup.js';
11
- import Container from './Container.js';
12
- import Field from './Field.js';
13
- import { Fieldset } from './Fieldset.js';
14
- import { FileObject } from './FileObject.js';
15
- import FileUpload from './FileUpload.js';
16
- import FormMetaData from './FormMetaData.js';
17
- import Node from './Node.js';
18
- import Scriptable from './Scriptable.js';
19
- import Form from './Form.js';
20
- import { FunctionRuntime, request } from './rules/FunctionRuntime.js';
21
- export { Form, BaseNode, Checkbox, CheckboxGroup, Container, Field, Fieldset, FileObject, FileUpload, FormMetaData, Node, Scriptable, getFileSizeInBytes, extractFileInfo, FunctionRuntime, request, isEmpty };
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
+ export { createFormInstance, fetchForm, registerFunctions, validateFormData, validateFormInstance } from './FormInstance.js';
22
+ export { constraintProps, translationProps } from './types/Json.js';
23
+ export { ValidationError } from './types/Model.js';
24
+ export { AddInstance, AddItem, Blur, Change, Click, CustomEvent, ExecuteRule, FieldChanged, Focus, FormLoad, Initialize, Invalid, RemoveInstance, RemoveItem, Reset, Submit, Valid, ValidationComplete, propertyChange } from './controller/Events.js';
25
+ export { CUSTOM_PROPS_KEY, TRANSLATION_ID, TRANSLATION_TOKEN, addTranslationId, createTranslationObj, createTranslationObject, getOrElse, invalidateTranslation } from './utils/TranslationUtils.js';
26
+ export { checkIfConstraintsArePresent, checkIfKeyAdded, deepClone, getProperty, isCheckbox, isCheckboxGroup, isDateField, isFile, isRepeatable, jsonString } from './utils/JsonUtils.js';
27
+ export { defaultFieldTypes, exportDataSchema } from './utils/SchemaUtils.js';
28
+ export { extractFileInfo, getFileSizeInBytes, isEmpty } from './utils/FormUtils.js';
29
+ export { B as BaseNode } from './BaseNode-d78cc1b0.js';
30
+ export { default as Checkbox } from './Checkbox.js';
31
+ export { default as CheckboxGroup } from './CheckboxGroup.js';
32
+ export { default as Container } from './Container.js';
33
+ export { default as Field } from './Field.js';
34
+ export { Fieldset } from './Fieldset.js';
35
+ export { FileObject } from './FileObject.js';
36
+ export { default as FileUpload } from './FileUpload.js';
37
+ export { default as FormMetaData } from './FormMetaData.js';
38
+ export { default as Node } from './Node.js';
39
+ export { default as Scriptable } from './Scriptable.js';
40
+ export { default as Form } from './Form.js';
41
+ export { FunctionRuntime, request } from './rules/FunctionRuntime.js';
42
+ import './utils/Fetch.js';
43
+ import './rules/RuleEngine.js';
44
+ import '@adobe/json-formula';
45
+ import './controller/EventQueue.js';
46
+ import './controller/Logger.js';
47
+ import './utils/FormCreationUtils.js';
48
+ import './InstanceManager.js';
49
+ import './utils/DataRefParser.js';
50
+ import './data/DataGroup.js';
51
+ import './data/DataValue.js';
52
+ import './data/EmptyDataValue.js';
53
+ import './DateField.js';
54
+ import '@aemforms/af-formatters';
55
+ import './utils/ValidationUtils.js';
@@ -1,8 +1,8 @@
1
- declare type HTTP_VERB = 'GET' | 'POST';
1
+ 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 declare type CustomFunction = Function;
5
- export declare type FunctionDefinition = {
4
+ export type CustomFunction = Function;
5
+ export type FunctionDefinition = {
6
6
  _func: CustomFunction;
7
7
  _signature: Array<any>;
8
8
  };
@@ -1,8 +1,31 @@
1
- import { AddInstance, AddItem, Change, Click, CustomEvent, RemoveInstance, RemoveItem, Reset, Submit } from '../controller/Events.js';
2
- import { request as fRequest } from '../utils/Fetch.js';
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 { CustomEvent, Submit, RemoveInstance, AddInstance, Reset, RemoveItem, AddItem, Click, Change } from '../controller/Events.js';
22
+ import { request as request$1 } from '../utils/Fetch.js';
3
23
  import { FileObject } from '../FileObject.js';
4
24
  import { getAttachments } from '../utils/FormUtils.js';
5
25
  import { jsonString } from '../utils/JsonUtils.js';
26
+ import '../types/Json.js';
27
+ import '../utils/SchemaUtils.js';
28
+
6
29
  const getCustomEventName = (name) => {
7
30
  const eName = name;
8
31
  if (eName.length > 0 && eName.startsWith('custom:')) {
@@ -10,7 +33,7 @@ const getCustomEventName = (name) => {
10
33
  }
11
34
  return eName;
12
35
  };
13
- export const request = async (context, uri, httpVerb, payload, success, error, headers) => {
36
+ const request = async (context, uri, httpVerb, payload, success, error, headers) => {
14
37
  const endpoint = uri;
15
38
  const requestOptions = {
16
39
  method: httpVerb
@@ -48,7 +71,7 @@ export const request = async (context, uri, httpVerb, payload, success, error, h
48
71
  inputPayload = urlEncoded(payload);
49
72
  }
50
73
  }
51
- result = await fRequest(endpoint, inputPayload, requestOptions);
74
+ result = await request$1(endpoint, inputPayload, requestOptions);
52
75
  }
53
76
  catch (e) {
54
77
  context.form.logger.error('Error invoking a rest API');
@@ -103,7 +126,7 @@ const multipartFormData = (data, attachments) => {
103
126
  }
104
127
  return formData;
105
128
  };
106
- export const submit = async (context, success, error, submitAs = 'multipart/form-data', input_data = null) => {
129
+ const submit = async (context, success, error, submitAs = 'multipart/form-data', input_data = null) => {
107
130
  const endpoint = context.form.action;
108
131
  let data = input_data;
109
132
  if (typeof data != 'object' || data == null) {
@@ -317,4 +340,6 @@ class FunctionRuntimeImpl {
317
340
  return { ...defaultFunctions, ...this.customFunctions };
318
341
  }
319
342
  }
320
- export const FunctionRuntime = new FunctionRuntimeImpl();
343
+ const FunctionRuntime = new FunctionRuntimeImpl();
344
+
345
+ export { FunctionRuntime, request, submit };
@@ -1,5 +1,33 @@
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
+
1
21
  import Formula from '@adobe/json-formula';
2
22
  import { FunctionRuntime } from './FunctionRuntime.js';
23
+ import '../controller/Events.js';
24
+ import '../utils/Fetch.js';
25
+ import '../FileObject.js';
26
+ import '../utils/FormUtils.js';
27
+ import '../utils/JsonUtils.js';
28
+ import '../types/Json.js';
29
+ import '../utils/SchemaUtils.js';
30
+
3
31
  class RuleEngine {
4
32
  _context;
5
33
  _globalNames = [
@@ -44,4 +72,5 @@ class RuleEngine {
44
72
  }
45
73
  }
46
74
  }
47
- export default RuleEngine;
75
+
76
+ export { RuleEngine as default };
@@ -1,17 +1,17 @@
1
- export declare type Items<T> = {
1
+ export type Items<T> = {
2
2
  [key: string]: T;
3
3
  };
4
- export declare type Primitives = string | number | boolean | null | undefined;
5
- export declare type Label = {
4
+ export type Primitives = string | number | boolean | null | undefined;
5
+ export type Label = {
6
6
  value: string;
7
7
  richText?: boolean;
8
8
  visible?: boolean;
9
9
  };
10
- declare type TranslationConstraintsJson = {
10
+ type TranslationConstraintsJson = {
11
11
  enumNames?: string[];
12
12
  enum?: any[];
13
13
  };
14
- export declare type ConstraintsJson = TranslationConstraintsJson & {
14
+ export type ConstraintsJson = TranslationConstraintsJson & {
15
15
  accept?: string[];
16
16
  enforceEnum?: boolean;
17
17
  exclusiveMinimum?: number;
@@ -33,7 +33,7 @@ export declare type ConstraintsJson = TranslationConstraintsJson & {
33
33
  validationExpression?: string;
34
34
  uniqueItems?: boolean;
35
35
  };
36
- export declare type ConstraintsMessages = {
36
+ export type ConstraintsMessages = {
37
37
  accept?: string;
38
38
  enum?: string;
39
39
  exclusiveMinimum?: string;
@@ -53,14 +53,14 @@ export declare type ConstraintsMessages = {
53
53
  type?: string;
54
54
  validationExpression?: string;
55
55
  };
56
- export declare type RulesJson = {
56
+ export type RulesJson = {
57
57
  rules?: Items<string>;
58
58
  events?: Items<string[] | string | undefined>;
59
59
  };
60
- declare type TranslationBaseJson = {
60
+ type TranslationBaseJson = {
61
61
  description?: string;
62
62
  };
63
- export declare type BaseJson = TranslationBaseJson & RulesJson & ConstraintsJson & {
63
+ export type BaseJson = TranslationBaseJson & RulesJson & ConstraintsJson & {
64
64
  dataRef?: string | null;
65
65
  ':type'?: string;
66
66
  label?: Label;
@@ -79,10 +79,10 @@ export declare type BaseJson = TranslationBaseJson & RulesJson & ConstraintsJson
79
79
  altText?: string;
80
80
  viewType?: string;
81
81
  };
82
- declare type TranslationFieldJson = {
82
+ type TranslationFieldJson = {
83
83
  placeholder?: string;
84
84
  };
85
- export declare type FieldJson = BaseJson & TranslationFieldJson & {
85
+ export type FieldJson = BaseJson & TranslationFieldJson & {
86
86
  readOnly?: boolean;
87
87
  valid?: boolean;
88
88
  default?: any;
@@ -93,19 +93,19 @@ export declare type FieldJson = BaseJson & TranslationFieldJson & {
93
93
  displayValue?: string;
94
94
  emptyValue?: 'null' | 'undefined' | '';
95
95
  };
96
- export declare type ContainerJson = BaseJson & {
96
+ export type ContainerJson = BaseJson & {
97
97
  items: Array<FieldJson | ContainerJson>;
98
98
  initialItems?: number;
99
99
  activeChild?: string;
100
100
  };
101
- export declare type MetaDataJson = {
101
+ export type MetaDataJson = {
102
102
  version?: string;
103
103
  grammar?: string;
104
104
  };
105
- export declare type FieldsetJson = ContainerJson & {
105
+ export type FieldsetJson = ContainerJson & {
106
106
  'type'?: 'array' | 'object';
107
107
  };
108
- export declare type FormJson = ContainerJson & {
108
+ export type FormJson = ContainerJson & {
109
109
  metadata?: MetaDataJson;
110
110
  data?: any;
111
111
  title?: string;
@@ -113,7 +113,7 @@ export declare type FormJson = ContainerJson & {
113
113
  adaptiveForm?: string;
114
114
  lang?: string;
115
115
  };
116
- export declare type TranslationJson = TranslationBaseJson & TranslationFieldJson & TranslationConstraintsJson;
116
+ export type TranslationJson = TranslationBaseJson & TranslationFieldJson & TranslationConstraintsJson;
117
117
  export declare const translationProps: string[];
118
118
  export declare const constraintProps: string[];
119
119
  export {};
@@ -1,7 +1,29 @@
1
- export const translationProps = ['description', 'placeholder', 'enum', 'enumNames', 'label.value', 'constraintMessages.accept',
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
+ const translationProps = ['description', 'placeholder', 'enum', 'enumNames', 'label.value', 'constraintMessages.accept',
2
22
  'constraintMessages.enum', 'constraintMessages.exclusiveMinimum', 'constraintMessages.exclusiveMaximum', 'constraintMessages.format', 'constraintMessages.maxFileSize', 'constraintMessages.maxLength',
3
23
  'constraintMessages.maximum', 'constraintMessages.maxItems', 'constraintMessages.minLength', 'constraintMessages.minimum', 'constraintMessages.minItems', 'constraintMessages.pattern', 'constraintMessages.required',
4
24
  'constraintMessages.step', 'constraintMessages.type', 'constraintMessages.validationExpression'];
5
- export const constraintProps = ['accept', 'enum', 'exclusiveMinimum', 'exclusiveMaximum',
25
+ const constraintProps = ['accept', 'enum', 'exclusiveMinimum', 'exclusiveMaximum',
6
26
  'format', 'maxFileSize', 'maxLength', 'maximum', 'maxItems',
7
27
  'minLength', 'minimum', 'minItems', 'pattern', 'required', 'step', 'validationExpression', 'enumNames'];
28
+
29
+ export { constraintProps, translationProps };
@@ -15,15 +15,15 @@ export interface ScriptableField {
15
15
  interface WithState<T> {
16
16
  getState: () => any;
17
17
  }
18
- declare type stateProps = {
18
+ type stateProps = {
19
19
  id: string;
20
20
  index: number;
21
21
  ':type': string;
22
22
  };
23
- export declare type State<T> = stateProps & (T extends ContainerJson ? T & {
23
+ export type State<T> = stateProps & (T extends ContainerJson ? T & {
24
24
  items: Array<State<FieldJson | ContainerJson>>;
25
25
  } : T);
26
- export declare type Subscription = {
26
+ export type Subscription = {
27
27
  unsubscribe(): void;
28
28
  };
29
29
  export interface Action {
@@ -34,7 +34,7 @@ export interface Action {
34
34
  readonly target: FormModel | FieldModel | FieldsetModel;
35
35
  readonly originalAction?: Action;
36
36
  }
37
- export declare type callbackFn = (action: Action) => void;
37
+ export type callbackFn = (action: Action) => void;
38
38
  export interface WithController {
39
39
  subscribe(callback: callbackFn, eventName?: string): Subscription;
40
40
  dispatch(action: Action): void;
@@ -1,4 +1,24 @@
1
- export class ValidationError {
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 ValidationError {
2
22
  fieldName;
3
23
  errorMessages;
4
24
  constructor(fieldName = '', errorMessages = []) {
@@ -6,3 +26,5 @@ export class ValidationError {
6
26
  this.fieldName = fieldName;
7
27
  }
8
28
  }
29
+
30
+ export { ValidationError };
@@ -1,2 +1,22 @@
1
- export * from './Json.js';
2
- export * from './Model.js';
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
+ export { constraintProps, translationProps } from './Json.js';
22
+ export { ValidationError } from './Model.js';
@@ -1,8 +1,8 @@
1
1
  import DataGroup from '../data/DataGroup.js';
2
2
  import DataValue from '../data/DataValue.js';
3
- declare type TokenType = string;
3
+ type TokenType = string;
4
4
  export declare const TOK_GLOBAL: TokenType;
5
- export declare type Token = {
5
+ export type Token = {
6
6
  type: TokenType;
7
7
  value: string | number;
8
8
  start: number;
@@ -1,25 +1,48 @@
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
+
1
21
  import DataGroup from '../data/DataGroup.js';
22
+ import '../data/DataValue.js';
23
+ import '../data/EmptyDataValue.js';
24
+
2
25
  const TOK_DOT = 'DOT';
3
26
  const TOK_IDENTIFIER = 'Identifier';
4
- export const TOK_GLOBAL = 'Global';
27
+ const TOK_GLOBAL = 'Global';
5
28
  const TOK_BRACKET = 'bracket';
6
29
  const TOK_NUMBER = 'Number';
7
30
  const globalStartToken = '$';
8
- export const identifier = (value, start) => {
31
+ const identifier = (value, start) => {
9
32
  return {
10
33
  type: TOK_IDENTIFIER,
11
34
  value,
12
35
  start
13
36
  };
14
37
  };
15
- export const bracket = (value, start) => {
38
+ const bracket = (value, start) => {
16
39
  return {
17
40
  type: TOK_BRACKET,
18
41
  value,
19
42
  start
20
43
  };
21
44
  };
22
- export const global$ = () => {
45
+ const global$ = () => {
23
46
  return {
24
47
  type: TOK_GLOBAL,
25
48
  start: 0,
@@ -154,10 +177,10 @@ class Tokenizer {
154
177
  return this._result_tokens;
155
178
  }
156
179
  }
157
- export const tokenize = (stream) => {
180
+ const tokenize = (stream) => {
158
181
  return new Tokenizer(stream).tokenize();
159
182
  };
160
- export const resolveData = (data, input, create) => {
183
+ const resolveData = (data, input, create) => {
161
184
  let tokens;
162
185
  if (typeof input === 'string') {
163
186
  tokens = tokenize(input);
@@ -220,3 +243,5 @@ export const resolveData = (data, input, create) => {
220
243
  }
221
244
  return result;
222
245
  };
246
+
247
+ export { TOK_GLOBAL, bracket, global$, identifier, resolveData, tokenize };
@@ -1,5 +1,5 @@
1
1
  export declare const request: (url: string, data?: any, options?: RequestOptions) => any;
2
- export declare type RequestOptions = {
2
+ export type RequestOptions = {
3
3
  contentType?: string;
4
4
  method?: 'POST' | 'GET';
5
5
  headers?: any;
@@ -1,4 +1,24 @@
1
- export const request = (url, data = null, options = {}) => {
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
+ const request = (url, data = null, options = {}) => {
2
22
  const opts = { ...defaultRequestOptions, ...options };
3
23
  const updatedUrl = opts.method === 'GET' && data ? convertQueryString(url, data) : url;
4
24
  if (opts.method !== 'GET') {
@@ -34,7 +54,7 @@ export const request = (url, data = null, options = {}) => {
34
54
  const defaultRequestOptions = {
35
55
  method: 'GET'
36
56
  };
37
- export const convertQueryString = (endpoint, payload) => {
57
+ const convertQueryString = (endpoint, payload) => {
38
58
  if (!payload) {
39
59
  return endpoint;
40
60
  }
@@ -59,3 +79,5 @@ export const convertQueryString = (endpoint, payload) => {
59
79
  }
60
80
  return endpoint.includes('?') ? `${endpoint}&${params.join('&')}` : `${endpoint}?${params.join('&')}`;
61
81
  };
82
+
83
+ export { convertQueryString, request };
@@ -1,11 +1,47 @@
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
+
1
21
  import { InstanceManager } from '../InstanceManager.js';
2
22
  import { Fieldset } from '../Fieldset.js';
3
- import { isCheckbox, isCheckboxGroup, isDateField, isFile, isRepeatable } from './JsonUtils.js';
23
+ import { isRepeatable, isFile, isCheckbox, isCheckboxGroup, isDateField } from './JsonUtils.js';
4
24
  import FileUpload from '../FileUpload.js';
5
25
  import Checkbox from '../Checkbox.js';
6
26
  import CheckboxGroup from '../CheckboxGroup.js';
7
27
  import DateField from '../DateField.js';
8
28
  import Field from '../Field.js';
29
+ import '../BaseNode-d78cc1b0.js';
30
+ import '../controller/Events.js';
31
+ import './DataRefParser.js';
32
+ import '../data/DataGroup.js';
33
+ import '../data/DataValue.js';
34
+ import '../data/EmptyDataValue.js';
35
+ import '../Container.js';
36
+ import '../Scriptable.js';
37
+ import '../types/Json.js';
38
+ import './SchemaUtils.js';
39
+ import './FormUtils.js';
40
+ import '../FileObject.js';
41
+ import './ValidationUtils.js';
42
+ import '../types/Model.js';
43
+ import '@aemforms/af-formatters';
44
+
9
45
  const alternateFieldTypeMapping = {
10
46
  'text': 'text-input',
11
47
  'number': 'number-input',
@@ -71,4 +107,6 @@ class FormFieldFactoryImpl {
71
107
  return retVal;
72
108
  }
73
109
  }
74
- export const FormFieldFactory = new FormFieldFactoryImpl();
110
+ const FormFieldFactory = new FormFieldFactoryImpl();
111
+
112
+ export { FormFieldFactory };