powerpagestoolkit 2.8.2 → 2.8.101
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/dist/src/core/API.d.ts
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
/// <reference path="../globals.d.ts" />
|
|
2
|
-
interface ODataJSON extends object {
|
|
3
|
-
[key: `${string}@odata.bind` | string]: any;
|
|
4
|
-
}
|
|
5
2
|
/**
|
|
6
3
|
* Provides abstract class `API` that allows basic create, read, and update operations in DataVerse via the PowerPages API
|
|
7
4
|
* @method `createRecord` - Create a record in DataVerse
|
|
@@ -15,7 +12,7 @@ declare abstract class API {
|
|
|
15
12
|
* @param data The JSON of the fields and data that are to be updated on the targeted record
|
|
16
13
|
* @returns a Promise resolving the successful results *[record id]* of the POST request, or rejecting the failed results *[error]* of the POST request.
|
|
17
14
|
*/
|
|
18
|
-
static createRecord(tableSetName: string, data:
|
|
15
|
+
static createRecord(tableSetName: string, data: JSON): Promise<string>;
|
|
19
16
|
/**
|
|
20
17
|
*
|
|
21
18
|
* @param tableSetName The DataVerse SET name of the table being queried
|
|
@@ -38,6 +35,6 @@ declare abstract class API {
|
|
|
38
35
|
* @param data The JSON of the fields and data that are to be updated on the targeted record
|
|
39
36
|
* @returns A Promise with the results of the API execution
|
|
40
37
|
*/
|
|
41
|
-
static updateRecord(tableSetName: string, recordId: string, data:
|
|
38
|
+
static updateRecord(tableSetName: string, recordId: string, data: object): Promise<any>;
|
|
42
39
|
}
|
|
43
40
|
export default API;
|
|
@@ -4,12 +4,11 @@ export default class DOMNodeReference {
|
|
|
4
4
|
target: Element | string;
|
|
5
5
|
logicalName?: string;
|
|
6
6
|
root: Element;
|
|
7
|
-
protected
|
|
7
|
+
protected [s.debounceTime]: number;
|
|
8
8
|
protected isLoaded: boolean;
|
|
9
9
|
protected defaultDisplay: string;
|
|
10
|
-
protected [s.observers]: Array<MutationObserver
|
|
10
|
+
protected [s.observers]: Array<MutationObserver>;
|
|
11
11
|
protected [s.boundEventListeners]: Array<BoundEventListener>;
|
|
12
|
-
protected dependents: Dependants;
|
|
13
12
|
protected isRadio: boolean;
|
|
14
13
|
protected radioType: RadioType | null;
|
|
15
14
|
/**
|
|
@@ -25,7 +24,6 @@ export default class DOMNodeReference {
|
|
|
25
24
|
element: HTMLElement;
|
|
26
25
|
protected visibilityController: HTMLElement;
|
|
27
26
|
checked: boolean;
|
|
28
|
-
radioParent: DOMNodeReference | null;
|
|
29
27
|
/**
|
|
30
28
|
* Represents the 'yes' option of a boolean radio field.
|
|
31
29
|
* This property is only available when the parent node
|
|
@@ -44,7 +42,7 @@ export default class DOMNodeReference {
|
|
|
44
42
|
* @param root - Optionally specify the element within to search for the element targeted by 'target'
|
|
45
43
|
* Defaults to 'document.body'
|
|
46
44
|
*/
|
|
47
|
-
/******/ /******/ constructor(target: Element | string, root: Element | undefined,
|
|
45
|
+
/******/ /******/ constructor(target: Element | string, root: Element | undefined, debounceTime: number);
|
|
48
46
|
private extractLogicalName;
|
|
49
47
|
[s.init](): Promise<void>;
|
|
50
48
|
/**
|
|
@@ -72,7 +70,6 @@ export default class DOMNodeReference {
|
|
|
72
70
|
* @public
|
|
73
71
|
*/
|
|
74
72
|
updateValue(e?: Event): void;
|
|
75
|
-
protected triggerDependentsHandlers(): Promise<void>;
|
|
76
73
|
protected validateValue(value: any): any;
|
|
77
74
|
/**
|
|
78
75
|
* Sets up an event listener based on the specified event type, executing the specified
|
|
@@ -151,7 +148,7 @@ export default class DOMNodeReference {
|
|
|
151
148
|
after(...elements: HTMLElement[]): DOMNodeReference;
|
|
152
149
|
/**
|
|
153
150
|
* Retrieves the label associated with the HTML element.
|
|
154
|
-
* @returns The label element associated with this element.
|
|
151
|
+
* @returns {HTMLElement} The label element associated with this element.
|
|
155
152
|
*/
|
|
156
153
|
getLabel(): HTMLElement | null;
|
|
157
154
|
/**
|
|
@@ -170,7 +167,7 @@ export default class DOMNodeReference {
|
|
|
170
167
|
addTooltip(innerHTML: string, containerStyle?: Partial<CSSStyleDeclaration>): DOMNodeReference;
|
|
171
168
|
/**
|
|
172
169
|
* Sets the inner HTML content of the HTML element.
|
|
173
|
-
* @param string - The text to set as the inner HTML of the element.
|
|
170
|
+
* @param {string} string - The text to set as the inner HTML of the element.
|
|
174
171
|
* @returns - Instance of this [provides option to method chain]
|
|
175
172
|
*/
|
|
176
173
|
setInnerHTML(string: string): this;
|
|
@@ -193,21 +190,24 @@ export default class DOMNodeReference {
|
|
|
193
190
|
* Applies a business rule to manage visibility, required state, value, and disabled state dynamically.
|
|
194
191
|
* @see {@link BusinessRule}
|
|
195
192
|
* @param rule The business rule containing conditions for various actions.
|
|
196
|
-
* @param dependencies For re-evaluation
|
|
193
|
+
* @param dependencies For re-evaluation conditions when the state of the dependencies change
|
|
197
194
|
* @returns Instance of this for method chaining.
|
|
198
195
|
*/
|
|
199
196
|
applyBusinessRule(rule: BusinessRule, dependencies: DOMNodeReference[]): DOMNodeReference;
|
|
200
|
-
protected createValidator(evaluationFunction: () => boolean): HTMLSpanElement;
|
|
201
197
|
/**
|
|
202
198
|
* Sets up tracking for dependencies using both event listeners and mutation observers.
|
|
203
199
|
* @protected
|
|
204
200
|
* @param handler The function to execute when dependencies change
|
|
205
201
|
* @param dependencies Array of dependent DOM nodes to track
|
|
202
|
+
* @param options Additional configuration options. clearValuesOnHide defaults to false.
|
|
206
203
|
* all other options defaults to true
|
|
207
204
|
*/
|
|
208
|
-
protected _configDependencyTracking(handler:
|
|
209
|
-
|
|
210
|
-
|
|
205
|
+
protected _configDependencyTracking(handler: () => void, dependencies: Array<DOMNodeReference>, options?: {
|
|
206
|
+
clearValuesOnHide?: boolean;
|
|
207
|
+
observeVisibility?: boolean;
|
|
208
|
+
trackInputEvents?: boolean;
|
|
209
|
+
trackRadioButtons?: boolean;
|
|
210
|
+
}): void;
|
|
211
211
|
/**
|
|
212
212
|
* Sets the required level for the field by adding or removing the "required-field" class on the label.
|
|
213
213
|
*
|
package/dist/src/globals.d.ts
CHANGED
|
@@ -70,47 +70,41 @@ declare interface Form extends Partial<SystemForm> {
|
|
|
70
70
|
formxml: string;
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
declare type IsValid = (
|
|
74
|
-
this: DOMNodeReference,
|
|
75
|
-
isRequired: ReturnType<Condition>
|
|
76
|
-
) => boolean;
|
|
77
|
-
|
|
78
73
|
declare interface BusinessRule {
|
|
79
74
|
/**
|
|
80
75
|
* @param condition A function that returns a boolean to determine
|
|
81
76
|
* the visibility of the target element. If `condition()` returns true, the element is shown;
|
|
82
77
|
* otherwise, it is hidden.
|
|
83
78
|
|
|
79
|
+
* @param clearValuesOnHide Should the values in the targeted field be cleared when hidden? Defaults to true
|
|
84
80
|
*/
|
|
85
|
-
setVisibility?:
|
|
81
|
+
setVisibility?: [
|
|
82
|
+
condition: (this: DOMNodeReference) => boolean,
|
|
83
|
+
clearValuesOnHide?: boolean
|
|
84
|
+
];
|
|
86
85
|
/**
|
|
87
|
-
*
|
|
88
|
-
* @param
|
|
89
|
-
* @param isRequired.this - Reference to this DOMNodeReference
|
|
90
|
-
* @param isValid - Function validating field input.
|
|
91
|
-
* @param isValid.this - Reference to this DOMNodeReference
|
|
92
|
-
* @param isValid.isRequiredResult - Only available if 'isRequired' is also returned from the configuration function
|
|
86
|
+
* @param isRequired Function determining if field is required
|
|
87
|
+
* @param isValid Function validating field input.
|
|
93
88
|
*/
|
|
94
|
-
|
|
95
|
-
isRequired
|
|
96
|
-
isValid
|
|
97
|
-
|
|
98
|
-
|
|
89
|
+
setRequired?: [
|
|
90
|
+
isRequired: () => boolean,
|
|
91
|
+
isValid: (this: DOMNodeReference, isRequired: boolean) => boolean
|
|
92
|
+
];
|
|
99
93
|
/**
|
|
100
94
|
* @param condition A function to determine if the value provided should be applied to this field
|
|
101
95
|
* @param value The value to set for the HTML element.
|
|
102
96
|
* for parents of boolean radios, pass true or false as value, or
|
|
103
97
|
* an expression returning a boolean
|
|
104
98
|
*/
|
|
105
|
-
setValue?:
|
|
106
|
-
condition: (this: DOMNodeReference) => boolean
|
|
107
|
-
value: (() => any) | any
|
|
108
|
-
|
|
99
|
+
setValue?: [
|
|
100
|
+
condition: (this: DOMNodeReference) => boolean,
|
|
101
|
+
value: (() => any) | any
|
|
102
|
+
];
|
|
109
103
|
/**
|
|
110
104
|
* @param condition A function to determine if this field
|
|
111
105
|
* should be enabled in a form, or disabled. True || 1 = disabled. False || 0 = enabled
|
|
112
106
|
*/
|
|
113
|
-
setDisabled?: (
|
|
107
|
+
setDisabled?: () => boolean;
|
|
114
108
|
}
|
|
115
109
|
|
|
116
110
|
declare interface CreationOptions {
|
|
@@ -134,16 +128,6 @@ declare interface CreationOptions {
|
|
|
134
128
|
timeoutMs?: number;
|
|
135
129
|
}
|
|
136
130
|
|
|
137
|
-
declare type DependencyHandlerFunction = () => Promise<void>;
|
|
138
|
-
|
|
139
|
-
declare type Dependants = Map<DOMNodeReference, DependencyHandlerFunction>;
|
|
140
|
-
|
|
141
|
-
declare type ValueElement =
|
|
142
|
-
| HTMLInputElement
|
|
143
|
-
| HTMLSelectElement
|
|
144
|
-
| HTMLTextAreaElement
|
|
145
|
-
| HTMLOptionElement;
|
|
146
|
-
|
|
147
131
|
declare const Page_Validators: any[];
|
|
148
132
|
|
|
149
133
|
declare interface ElementValue {
|