powerpagestoolkit 2.7.1 → 2.7.2
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/README.md +16 -13
- package/dist/import_map.json +6 -0
- package/dist/src/constants/eventMapping.d.ts +7 -0
- package/dist/src/constants/symbols.d.ts +14 -0
- package/dist/{API.d.ts → src/core/API.d.ts} +14 -6
- package/dist/{DOMNodeReference.d.ts → src/core/DOMNodeReference.d.ts} +34 -70
- package/dist/{DOMNodeReferenceArray.d.ts → src/core/DOMNodeReferenceArray.d.ts} +3 -3
- package/dist/src/core/List.d.ts +13 -0
- package/dist/src/core/bindForm.d.ts +28 -0
- package/dist/src/core/createDOMNodeReferences.d.ts +88 -0
- package/dist/src/core/waitFor.d.ts +9 -0
- package/dist/{errors.d.ts → src/errors/errors.d.ts} +2 -1
- package/dist/src/globals.d.ts +150 -0
- package/dist/src/index.d.ts +5 -0
- package/dist/{bundle.js → src/index.js} +253 -248
- package/dist/src/index.js.LEGAL.txt +0 -0
- package/dist/src/index.js.map +7 -0
- package/dist/src/managers/ReferenceManager.d.ts +6 -0
- package/dist/{createInfoElement.d.ts → src/utils/createInfoElement.d.ts} +1 -0
- package/dist/src/utils/enhanceArray.d.ts +13 -0
- package/dist/src/utils/safeAjax.d.ts +5 -0
- package/package.json +38 -34
- package/assets/infoIconExample.gif +0 -0
- package/dist/List.d.ts +0 -29
- package/dist/bindForm.d.ts +0 -11
- package/dist/bundle.css +0 -36
- package/dist/createDOMNodeReferences.d.ts +0 -36
- package/dist/index.d.ts +0 -6
- package/dist/safeAjax.d.ts +0 -1
- package/dist/waitFor.d.ts +0 -2
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
/// <reference path="../core/DOMNodeReference.ts"/>
|
|
2
|
+
|
|
3
|
+
declare interface CreationOptions {
|
|
4
|
+
/**
|
|
5
|
+
* Should this call return an array of instantiated references, or just a single?
|
|
6
|
+
* Defaults to false, returning a single instance.
|
|
7
|
+
*/
|
|
8
|
+
multiple?: (() => boolean) | boolean;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Optionally specify the element within which to search for the element targeted by 'target'.
|
|
12
|
+
* Defaults to 'document.body'.
|
|
13
|
+
*/
|
|
14
|
+
root?: HTMLElement;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Optionally specify the amount of time that should be waited to find the targeted element before throwing an error.
|
|
18
|
+
* Useful for async DOM loading. Relies on MutationObserver.
|
|
19
|
+
* WARNING: Implementing multiple references with timeout can result in infinite loading.
|
|
20
|
+
*/
|
|
21
|
+
timeoutMs?: number;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
declare interface SystemForm extends Object {
|
|
25
|
+
"@odata.context": string;
|
|
26
|
+
"@odata.etag": string;
|
|
27
|
+
"overwritetime@OData.Community.Display.V1.FormattedValue": string;
|
|
28
|
+
overwritetime: Date;
|
|
29
|
+
"isdesktopenabled@OData.Community.Display.V1.FormattedValue": string;
|
|
30
|
+
isdesktopenabled: boolean;
|
|
31
|
+
"publishedon@OData.Community.Display.V1.FormattedValue": Date;
|
|
32
|
+
publishedon: Date;
|
|
33
|
+
"_organizationid_value@OData.Community.Display.V1.FormattedValue": string;
|
|
34
|
+
"_organizationid_value@Microsoft.Dynamics.CRM.associatednavigationproperty": string;
|
|
35
|
+
"_organizationid_value@Microsoft.Dynamics.CRM.lookuplogicalname": string;
|
|
36
|
+
_organizationid_value: string;
|
|
37
|
+
formxml: string;
|
|
38
|
+
introducedversion: string;
|
|
39
|
+
"isairmerged@OData.Community.Display.V1.FormattedValue": string;
|
|
40
|
+
isairmerged: boolean;
|
|
41
|
+
"istabletenabled@OData.Community.Display.V1.FormattedValue": string;
|
|
42
|
+
istabletenabled: boolean;
|
|
43
|
+
solutionid: string;
|
|
44
|
+
formidunique: string;
|
|
45
|
+
"ismanaged@OData.Community.Display.V1.FormattedValue": string;
|
|
46
|
+
ismanaged: boolean;
|
|
47
|
+
"isdefault@OData.Community.Display.V1.FormattedValue": string;
|
|
48
|
+
isdefault: boolean;
|
|
49
|
+
"objecttypecode@OData.Community.Display.V1.FormattedValue": string;
|
|
50
|
+
objecttypecode: string;
|
|
51
|
+
"type@OData.Community.Display.V1.FormattedValue": string;
|
|
52
|
+
type: number;
|
|
53
|
+
"componentstate@OData.Community.Display.V1.FormattedValue": string;
|
|
54
|
+
componentstate: number;
|
|
55
|
+
"formpresentation@OData.Community.Display.V1.FormattedValue": string;
|
|
56
|
+
formpresentation: number;
|
|
57
|
+
"formactivationstate@OData.Community.Display.V1.FormattedValue": string;
|
|
58
|
+
formactivationstate: number;
|
|
59
|
+
name: string;
|
|
60
|
+
"versionnumber@OData.Community.Display.V1.FormattedValue": string;
|
|
61
|
+
versionnumber: number;
|
|
62
|
+
formjson: string;
|
|
63
|
+
description: string;
|
|
64
|
+
formid: string;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
declare interface Form extends Partial<SystemForm> {
|
|
68
|
+
formxml: string;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
declare interface BusinessRule {
|
|
72
|
+
/**
|
|
73
|
+
* @param condition A function that returns a boolean to determine
|
|
74
|
+
* the visibility of the target element. If `condition()` returns true, the element is shown;
|
|
75
|
+
* otherwise, it is hidden.
|
|
76
|
+
|
|
77
|
+
* @param clearValuesOnHide Should the values in the targeted field be cleared when hidden? Defaults to true
|
|
78
|
+
*/
|
|
79
|
+
setVisibility?: [
|
|
80
|
+
condition: (this: DOMNodeReference) => boolean,
|
|
81
|
+
clearValuesOnHide?: boolean
|
|
82
|
+
];
|
|
83
|
+
/**
|
|
84
|
+
* @param isRequired Function determining if field is required
|
|
85
|
+
* @param isValid Function validating field input.
|
|
86
|
+
*/
|
|
87
|
+
setRequired?: [
|
|
88
|
+
isRequired: () => boolean,
|
|
89
|
+
isValid: (this: DOMNodeReference, isRequired: boolean) => boolean
|
|
90
|
+
];
|
|
91
|
+
/**
|
|
92
|
+
* @param condition A function to determine if the value provided should be applied to this field
|
|
93
|
+
* @param value The value to set for the HTML element.
|
|
94
|
+
* for parents of boolean radios, pass true or false as value, or
|
|
95
|
+
* an expression returning a boolean
|
|
96
|
+
*/
|
|
97
|
+
setValue?: [
|
|
98
|
+
condition: (this: DOMNodeReference) => boolean,
|
|
99
|
+
value: (() => any) | any
|
|
100
|
+
];
|
|
101
|
+
/**
|
|
102
|
+
* @param condition A function to determine if this field
|
|
103
|
+
* should be enabled in a form, or disabled. True || 1 = disabled. False || 0 = enabled
|
|
104
|
+
*/
|
|
105
|
+
setDisabled?: () => boolean;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
declare interface CreationOptions {
|
|
109
|
+
/**
|
|
110
|
+
* Should this call return an array of instantiated references, or just a single?
|
|
111
|
+
* Defaults to false, returning a single instance.
|
|
112
|
+
*/
|
|
113
|
+
multiple?: (() => boolean) | boolean;
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Optionally specify the element within which to search for the element targeted by 'target'.
|
|
117
|
+
* Defaults to 'document.body'.
|
|
118
|
+
*/
|
|
119
|
+
root?: HTMLElement;
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Optionally specify the amount of time that should be waited to find the targeted element before throwing an error.
|
|
123
|
+
* Useful for async DOM loading. Relies on MutationObserver.
|
|
124
|
+
* WARNING: Implementing multiple references with timeout can result in infinite loading.
|
|
125
|
+
*/
|
|
126
|
+
timeoutMs?: number;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
declare const Page_Validators: any[];
|
|
130
|
+
|
|
131
|
+
declare interface ElementValue {
|
|
132
|
+
value: any;
|
|
133
|
+
checked?: boolean;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
declare type RadioType = "truthy" | "falsy";
|
|
137
|
+
|
|
138
|
+
declare interface BoundEventListener {
|
|
139
|
+
element: Element;
|
|
140
|
+
event: keyof HTMLElementEventMap;
|
|
141
|
+
handler: (e: Event) => unknown;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
declare type FormElement =
|
|
145
|
+
| HTMLInputElement
|
|
146
|
+
| HTMLSelectElement
|
|
147
|
+
| HTMLTextAreaElement
|
|
148
|
+
| HTMLSpanElement
|
|
149
|
+
| HTMLButtonElement
|
|
150
|
+
| HTMLFieldSetElement;
|