powerpagestoolkit 1.3.101 → 1.3.103
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/index.js +1180 -0
- package/dist/index.js.map +1 -0
- package/dist/types/JS/API.d.ts +24 -0
- package/dist/types/JS/DOMNodeReferences.d.ts +64 -0
- package/dist/types/JS/createInfoElement.d.ts +1 -0
- package/dist/types/JS/errors.d.ts +10 -0
- package/dist/types/JS/safeAjax.d.ts +1 -0
- package/dist/types/JS/waitFor.d.ts +1 -0
- package/dist/types/index.d.ts +3 -0
- package/index.d.ts +91 -27
- package/package.json +61 -38
- package/dist/index.bundle.js +0 -1207
package/dist/index.js
ADDED
|
@@ -0,0 +1,1180 @@
|
|
|
1
|
+
/******/ (() => { // webpackBootstrap
|
|
2
|
+
/******/ "use strict";
|
|
3
|
+
/******/ var __webpack_modules__ = ({
|
|
4
|
+
|
|
5
|
+
/***/ 672:
|
|
6
|
+
/***/ ((module, __webpack_exports__, __webpack_require__) => {
|
|
7
|
+
|
|
8
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
9
|
+
/* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
10
|
+
/* harmony export */ });
|
|
11
|
+
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(354);
|
|
12
|
+
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
|
|
13
|
+
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(314);
|
|
14
|
+
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
|
|
15
|
+
// Imports
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
|
|
19
|
+
// Module
|
|
20
|
+
___CSS_LOADER_EXPORT___.push([module.id, `.info-icon {
|
|
21
|
+
position: relative;
|
|
22
|
+
display: inline-block;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.info-icon .fa-info-circle {
|
|
26
|
+
cursor: pointer; /* Ensures the icon is recognized as interactive */
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.info-icon .flyout-content {
|
|
30
|
+
max-width: calc(100vw - 20px); /* 20px margin on both sides */
|
|
31
|
+
display: none; /* Initially hidden */
|
|
32
|
+
position: absolute;
|
|
33
|
+
left: 50%; /* Center horizontally */
|
|
34
|
+
transform: translateX(-50%); /* Adjust positioning */
|
|
35
|
+
background-color: #f9f9f9;
|
|
36
|
+
padding: 10px;
|
|
37
|
+
border: 1px solid #ddd;
|
|
38
|
+
z-index: 1;
|
|
39
|
+
min-width: 200px; /* Minimum width for better readability */
|
|
40
|
+
box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
|
|
41
|
+
border-radius: 4px; /* Rounded corners */
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
@media (max-width: 600px) {
|
|
45
|
+
.info-icon .flyout-content {
|
|
46
|
+
max-width: 95vw;
|
|
47
|
+
padding: 12px;
|
|
48
|
+
font-size: 0.9em;
|
|
49
|
+
display: block;
|
|
50
|
+
right: auto;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.required-field::after {
|
|
55
|
+
content: " *" !important;
|
|
56
|
+
color: #f00 !important;
|
|
57
|
+
}
|
|
58
|
+
`, "",{"version":3,"sources":["webpack://./src/CSS/style.css"],"names":[],"mappings":"AAAA;EACE,kBAAkB;EAClB,qBAAqB;AACvB;;AAEA;EACE,eAAe,EAAE,kDAAkD;AACrE;;AAEA;EACE,6BAA6B,EAAE,8BAA8B;EAC7D,aAAa,EAAE,qBAAqB;EACpC,kBAAkB;EAClB,SAAS,EAAE,wBAAwB;EACnC,2BAA2B,EAAE,uBAAuB;EACpD,yBAAyB;EACzB,aAAa;EACb,sBAAsB;EACtB,UAAU;EACV,gBAAgB,EAAE,yCAAyC;EAC3D,0CAA0C;EAC1C,kBAAkB,EAAE,oBAAoB;AAC1C;;AAEA;EACE;IACE,eAAe;IACf,aAAa;IACb,gBAAgB;IAChB,cAAc;IACd,WAAW;EACb;AACF;;AAEA;EACE,wBAAwB;EACxB,sBAAsB;AACxB","sourcesContent":[".info-icon {\r\n position: relative;\r\n display: inline-block;\r\n}\r\n\r\n.info-icon .fa-info-circle {\r\n cursor: pointer; /* Ensures the icon is recognized as interactive */\r\n}\r\n\r\n.info-icon .flyout-content {\r\n max-width: calc(100vw - 20px); /* 20px margin on both sides */\r\n display: none; /* Initially hidden */\r\n position: absolute;\r\n left: 50%; /* Center horizontally */\r\n transform: translateX(-50%); /* Adjust positioning */\r\n background-color: #f9f9f9;\r\n padding: 10px;\r\n border: 1px solid #ddd;\r\n z-index: 1;\r\n min-width: 200px; /* Minimum width for better readability */\r\n box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);\r\n border-radius: 4px; /* Rounded corners */\r\n}\r\n\r\n@media (max-width: 600px) {\r\n .info-icon .flyout-content {\r\n max-width: 95vw;\r\n padding: 12px;\r\n font-size: 0.9em;\r\n display: block;\r\n right: auto;\r\n }\r\n}\r\n\r\n.required-field::after {\r\n content: \" *\" !important;\r\n color: #f00 !important;\r\n}\r\n"],"sourceRoot":""}]);
|
|
59
|
+
// Exports
|
|
60
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
/***/ }),
|
|
64
|
+
|
|
65
|
+
/***/ 314:
|
|
66
|
+
/***/ ((module) => {
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
/*
|
|
71
|
+
MIT License http://www.opensource.org/licenses/mit-license.php
|
|
72
|
+
Author Tobias Koppers @sokra
|
|
73
|
+
*/
|
|
74
|
+
module.exports = function (cssWithMappingToString) {
|
|
75
|
+
var list = [];
|
|
76
|
+
|
|
77
|
+
// return the list of modules as css string
|
|
78
|
+
list.toString = function toString() {
|
|
79
|
+
return this.map(function (item) {
|
|
80
|
+
var content = "";
|
|
81
|
+
var needLayer = typeof item[5] !== "undefined";
|
|
82
|
+
if (item[4]) {
|
|
83
|
+
content += "@supports (".concat(item[4], ") {");
|
|
84
|
+
}
|
|
85
|
+
if (item[2]) {
|
|
86
|
+
content += "@media ".concat(item[2], " {");
|
|
87
|
+
}
|
|
88
|
+
if (needLayer) {
|
|
89
|
+
content += "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {");
|
|
90
|
+
}
|
|
91
|
+
content += cssWithMappingToString(item);
|
|
92
|
+
if (needLayer) {
|
|
93
|
+
content += "}";
|
|
94
|
+
}
|
|
95
|
+
if (item[2]) {
|
|
96
|
+
content += "}";
|
|
97
|
+
}
|
|
98
|
+
if (item[4]) {
|
|
99
|
+
content += "}";
|
|
100
|
+
}
|
|
101
|
+
return content;
|
|
102
|
+
}).join("");
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
// import a list of modules into the list
|
|
106
|
+
list.i = function i(modules, media, dedupe, supports, layer) {
|
|
107
|
+
if (typeof modules === "string") {
|
|
108
|
+
modules = [[null, modules, undefined]];
|
|
109
|
+
}
|
|
110
|
+
var alreadyImportedModules = {};
|
|
111
|
+
if (dedupe) {
|
|
112
|
+
for (var k = 0; k < this.length; k++) {
|
|
113
|
+
var id = this[k][0];
|
|
114
|
+
if (id != null) {
|
|
115
|
+
alreadyImportedModules[id] = true;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
for (var _k = 0; _k < modules.length; _k++) {
|
|
120
|
+
var item = [].concat(modules[_k]);
|
|
121
|
+
if (dedupe && alreadyImportedModules[item[0]]) {
|
|
122
|
+
continue;
|
|
123
|
+
}
|
|
124
|
+
if (typeof layer !== "undefined") {
|
|
125
|
+
if (typeof item[5] === "undefined") {
|
|
126
|
+
item[5] = layer;
|
|
127
|
+
} else {
|
|
128
|
+
item[1] = "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {").concat(item[1], "}");
|
|
129
|
+
item[5] = layer;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
if (media) {
|
|
133
|
+
if (!item[2]) {
|
|
134
|
+
item[2] = media;
|
|
135
|
+
} else {
|
|
136
|
+
item[1] = "@media ".concat(item[2], " {").concat(item[1], "}");
|
|
137
|
+
item[2] = media;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
if (supports) {
|
|
141
|
+
if (!item[4]) {
|
|
142
|
+
item[4] = "".concat(supports);
|
|
143
|
+
} else {
|
|
144
|
+
item[1] = "@supports (".concat(item[4], ") {").concat(item[1], "}");
|
|
145
|
+
item[4] = supports;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
list.push(item);
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
return list;
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
/***/ }),
|
|
155
|
+
|
|
156
|
+
/***/ 354:
|
|
157
|
+
/***/ ((module) => {
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
module.exports = function (item) {
|
|
162
|
+
var content = item[1];
|
|
163
|
+
var cssMapping = item[3];
|
|
164
|
+
if (!cssMapping) {
|
|
165
|
+
return content;
|
|
166
|
+
}
|
|
167
|
+
if (typeof btoa === "function") {
|
|
168
|
+
var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(cssMapping))));
|
|
169
|
+
var data = "sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(base64);
|
|
170
|
+
var sourceMapping = "/*# ".concat(data, " */");
|
|
171
|
+
return [content].concat([sourceMapping]).join("\n");
|
|
172
|
+
}
|
|
173
|
+
return [content].join("\n");
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
/***/ }),
|
|
177
|
+
|
|
178
|
+
/***/ 39:
|
|
179
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
180
|
+
|
|
181
|
+
__webpack_require__.r(__webpack_exports__);
|
|
182
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
183
|
+
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
184
|
+
/* harmony export */ });
|
|
185
|
+
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(72);
|
|
186
|
+
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
|
|
187
|
+
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(825);
|
|
188
|
+
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
|
|
189
|
+
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(659);
|
|
190
|
+
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
|
|
191
|
+
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(56);
|
|
192
|
+
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
|
|
193
|
+
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(540);
|
|
194
|
+
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
|
|
195
|
+
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(113);
|
|
196
|
+
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
|
|
197
|
+
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_style_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(672);
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
var options = {};
|
|
210
|
+
|
|
211
|
+
options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
|
|
212
|
+
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
|
|
213
|
+
options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
|
|
214
|
+
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
|
|
215
|
+
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());
|
|
216
|
+
|
|
217
|
+
var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_style_css__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A, options);
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_style_css__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A && _node_modules_css_loader_dist_cjs_js_style_css__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.locals ? _node_modules_css_loader_dist_cjs_js_style_css__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A.locals : undefined);
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
/***/ }),
|
|
226
|
+
|
|
227
|
+
/***/ 72:
|
|
228
|
+
/***/ ((module) => {
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
var stylesInDOM = [];
|
|
233
|
+
function getIndexByIdentifier(identifier) {
|
|
234
|
+
var result = -1;
|
|
235
|
+
for (var i = 0; i < stylesInDOM.length; i++) {
|
|
236
|
+
if (stylesInDOM[i].identifier === identifier) {
|
|
237
|
+
result = i;
|
|
238
|
+
break;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
return result;
|
|
242
|
+
}
|
|
243
|
+
function modulesToDom(list, options) {
|
|
244
|
+
var idCountMap = {};
|
|
245
|
+
var identifiers = [];
|
|
246
|
+
for (var i = 0; i < list.length; i++) {
|
|
247
|
+
var item = list[i];
|
|
248
|
+
var id = options.base ? item[0] + options.base : item[0];
|
|
249
|
+
var count = idCountMap[id] || 0;
|
|
250
|
+
var identifier = "".concat(id, " ").concat(count);
|
|
251
|
+
idCountMap[id] = count + 1;
|
|
252
|
+
var indexByIdentifier = getIndexByIdentifier(identifier);
|
|
253
|
+
var obj = {
|
|
254
|
+
css: item[1],
|
|
255
|
+
media: item[2],
|
|
256
|
+
sourceMap: item[3],
|
|
257
|
+
supports: item[4],
|
|
258
|
+
layer: item[5]
|
|
259
|
+
};
|
|
260
|
+
if (indexByIdentifier !== -1) {
|
|
261
|
+
stylesInDOM[indexByIdentifier].references++;
|
|
262
|
+
stylesInDOM[indexByIdentifier].updater(obj);
|
|
263
|
+
} else {
|
|
264
|
+
var updater = addElementStyle(obj, options);
|
|
265
|
+
options.byIndex = i;
|
|
266
|
+
stylesInDOM.splice(i, 0, {
|
|
267
|
+
identifier: identifier,
|
|
268
|
+
updater: updater,
|
|
269
|
+
references: 1
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
identifiers.push(identifier);
|
|
273
|
+
}
|
|
274
|
+
return identifiers;
|
|
275
|
+
}
|
|
276
|
+
function addElementStyle(obj, options) {
|
|
277
|
+
var api = options.domAPI(options);
|
|
278
|
+
api.update(obj);
|
|
279
|
+
var updater = function updater(newObj) {
|
|
280
|
+
if (newObj) {
|
|
281
|
+
if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap && newObj.supports === obj.supports && newObj.layer === obj.layer) {
|
|
282
|
+
return;
|
|
283
|
+
}
|
|
284
|
+
api.update(obj = newObj);
|
|
285
|
+
} else {
|
|
286
|
+
api.remove();
|
|
287
|
+
}
|
|
288
|
+
};
|
|
289
|
+
return updater;
|
|
290
|
+
}
|
|
291
|
+
module.exports = function (list, options) {
|
|
292
|
+
options = options || {};
|
|
293
|
+
list = list || [];
|
|
294
|
+
var lastIdentifiers = modulesToDom(list, options);
|
|
295
|
+
return function update(newList) {
|
|
296
|
+
newList = newList || [];
|
|
297
|
+
for (var i = 0; i < lastIdentifiers.length; i++) {
|
|
298
|
+
var identifier = lastIdentifiers[i];
|
|
299
|
+
var index = getIndexByIdentifier(identifier);
|
|
300
|
+
stylesInDOM[index].references--;
|
|
301
|
+
}
|
|
302
|
+
var newLastIdentifiers = modulesToDom(newList, options);
|
|
303
|
+
for (var _i = 0; _i < lastIdentifiers.length; _i++) {
|
|
304
|
+
var _identifier = lastIdentifiers[_i];
|
|
305
|
+
var _index = getIndexByIdentifier(_identifier);
|
|
306
|
+
if (stylesInDOM[_index].references === 0) {
|
|
307
|
+
stylesInDOM[_index].updater();
|
|
308
|
+
stylesInDOM.splice(_index, 1);
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
lastIdentifiers = newLastIdentifiers;
|
|
312
|
+
};
|
|
313
|
+
};
|
|
314
|
+
|
|
315
|
+
/***/ }),
|
|
316
|
+
|
|
317
|
+
/***/ 659:
|
|
318
|
+
/***/ ((module) => {
|
|
319
|
+
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+
var memo = {};
|
|
323
|
+
|
|
324
|
+
/* istanbul ignore next */
|
|
325
|
+
function getTarget(target) {
|
|
326
|
+
if (typeof memo[target] === "undefined") {
|
|
327
|
+
var styleTarget = document.querySelector(target);
|
|
328
|
+
|
|
329
|
+
// Special case to return head of iframe instead of iframe itself
|
|
330
|
+
if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {
|
|
331
|
+
try {
|
|
332
|
+
// This will throw an exception if access to iframe is blocked
|
|
333
|
+
// due to cross-origin restrictions
|
|
334
|
+
styleTarget = styleTarget.contentDocument.head;
|
|
335
|
+
} catch (e) {
|
|
336
|
+
// istanbul ignore next
|
|
337
|
+
styleTarget = null;
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
memo[target] = styleTarget;
|
|
341
|
+
}
|
|
342
|
+
return memo[target];
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
/* istanbul ignore next */
|
|
346
|
+
function insertBySelector(insert, style) {
|
|
347
|
+
var target = getTarget(insert);
|
|
348
|
+
if (!target) {
|
|
349
|
+
throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");
|
|
350
|
+
}
|
|
351
|
+
target.appendChild(style);
|
|
352
|
+
}
|
|
353
|
+
module.exports = insertBySelector;
|
|
354
|
+
|
|
355
|
+
/***/ }),
|
|
356
|
+
|
|
357
|
+
/***/ 540:
|
|
358
|
+
/***/ ((module) => {
|
|
359
|
+
|
|
360
|
+
|
|
361
|
+
|
|
362
|
+
/* istanbul ignore next */
|
|
363
|
+
function insertStyleElement(options) {
|
|
364
|
+
var element = document.createElement("style");
|
|
365
|
+
options.setAttributes(element, options.attributes);
|
|
366
|
+
options.insert(element, options.options);
|
|
367
|
+
return element;
|
|
368
|
+
}
|
|
369
|
+
module.exports = insertStyleElement;
|
|
370
|
+
|
|
371
|
+
/***/ }),
|
|
372
|
+
|
|
373
|
+
/***/ 56:
|
|
374
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
375
|
+
|
|
376
|
+
|
|
377
|
+
|
|
378
|
+
/* istanbul ignore next */
|
|
379
|
+
function setAttributesWithoutAttributes(styleElement) {
|
|
380
|
+
var nonce = true ? __webpack_require__.nc : 0;
|
|
381
|
+
if (nonce) {
|
|
382
|
+
styleElement.setAttribute("nonce", nonce);
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
module.exports = setAttributesWithoutAttributes;
|
|
386
|
+
|
|
387
|
+
/***/ }),
|
|
388
|
+
|
|
389
|
+
/***/ 825:
|
|
390
|
+
/***/ ((module) => {
|
|
391
|
+
|
|
392
|
+
|
|
393
|
+
|
|
394
|
+
/* istanbul ignore next */
|
|
395
|
+
function apply(styleElement, options, obj) {
|
|
396
|
+
var css = "";
|
|
397
|
+
if (obj.supports) {
|
|
398
|
+
css += "@supports (".concat(obj.supports, ") {");
|
|
399
|
+
}
|
|
400
|
+
if (obj.media) {
|
|
401
|
+
css += "@media ".concat(obj.media, " {");
|
|
402
|
+
}
|
|
403
|
+
var needLayer = typeof obj.layer !== "undefined";
|
|
404
|
+
if (needLayer) {
|
|
405
|
+
css += "@layer".concat(obj.layer.length > 0 ? " ".concat(obj.layer) : "", " {");
|
|
406
|
+
}
|
|
407
|
+
css += obj.css;
|
|
408
|
+
if (needLayer) {
|
|
409
|
+
css += "}";
|
|
410
|
+
}
|
|
411
|
+
if (obj.media) {
|
|
412
|
+
css += "}";
|
|
413
|
+
}
|
|
414
|
+
if (obj.supports) {
|
|
415
|
+
css += "}";
|
|
416
|
+
}
|
|
417
|
+
var sourceMap = obj.sourceMap;
|
|
418
|
+
if (sourceMap && typeof btoa !== "undefined") {
|
|
419
|
+
css += "\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), " */");
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
// For old IE
|
|
423
|
+
/* istanbul ignore if */
|
|
424
|
+
options.styleTagTransform(css, styleElement, options.options);
|
|
425
|
+
}
|
|
426
|
+
function removeStyleElement(styleElement) {
|
|
427
|
+
// istanbul ignore if
|
|
428
|
+
if (styleElement.parentNode === null) {
|
|
429
|
+
return false;
|
|
430
|
+
}
|
|
431
|
+
styleElement.parentNode.removeChild(styleElement);
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
/* istanbul ignore next */
|
|
435
|
+
function domAPI(options) {
|
|
436
|
+
if (typeof document === "undefined") {
|
|
437
|
+
return {
|
|
438
|
+
update: function update() {},
|
|
439
|
+
remove: function remove() {}
|
|
440
|
+
};
|
|
441
|
+
}
|
|
442
|
+
var styleElement = options.insertStyleElement(options);
|
|
443
|
+
return {
|
|
444
|
+
update: function update(obj) {
|
|
445
|
+
apply(styleElement, options, obj);
|
|
446
|
+
},
|
|
447
|
+
remove: function remove() {
|
|
448
|
+
removeStyleElement(styleElement);
|
|
449
|
+
}
|
|
450
|
+
};
|
|
451
|
+
}
|
|
452
|
+
module.exports = domAPI;
|
|
453
|
+
|
|
454
|
+
/***/ }),
|
|
455
|
+
|
|
456
|
+
/***/ 113:
|
|
457
|
+
/***/ ((module) => {
|
|
458
|
+
|
|
459
|
+
|
|
460
|
+
|
|
461
|
+
/* istanbul ignore next */
|
|
462
|
+
function styleTagTransform(css, styleElement) {
|
|
463
|
+
if (styleElement.styleSheet) {
|
|
464
|
+
styleElement.styleSheet.cssText = css;
|
|
465
|
+
} else {
|
|
466
|
+
while (styleElement.firstChild) {
|
|
467
|
+
styleElement.removeChild(styleElement.firstChild);
|
|
468
|
+
}
|
|
469
|
+
styleElement.appendChild(document.createTextNode(css));
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
module.exports = styleTagTransform;
|
|
473
|
+
|
|
474
|
+
/***/ }),
|
|
475
|
+
|
|
476
|
+
/***/ 377:
|
|
477
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
478
|
+
|
|
479
|
+
|
|
480
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
481
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
482
|
+
};
|
|
483
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
484
|
+
//@ts-nocheck
|
|
485
|
+
const safeAjax_js_1 = __importDefault(__webpack_require__(626));
|
|
486
|
+
const API = {
|
|
487
|
+
/**
|
|
488
|
+
*
|
|
489
|
+
* @param {Class} schema an instance of a schema class, containing the desired information for the POST request
|
|
490
|
+
* @returns a Promise resolving the successful results *[record id]* of the POST request, or rejecting the failed results *[error]* of the POST request.
|
|
491
|
+
*/
|
|
492
|
+
createRecord(schema) {
|
|
493
|
+
return new Promise((resolve, reject) => {
|
|
494
|
+
(0, safeAjax_js_1.default)({
|
|
495
|
+
type: "POST",
|
|
496
|
+
url: `/_api/${schema.logicalName()}`,
|
|
497
|
+
data: schema.value(),
|
|
498
|
+
contentType: "application/json",
|
|
499
|
+
success: function (response, status, xhr) {
|
|
500
|
+
resolve(xhr.getResponseHeader("entityid"));
|
|
501
|
+
},
|
|
502
|
+
error: (error) => {
|
|
503
|
+
reject(error);
|
|
504
|
+
},
|
|
505
|
+
});
|
|
506
|
+
});
|
|
507
|
+
},
|
|
508
|
+
/**
|
|
509
|
+
*
|
|
510
|
+
* @param {string} tableSetName The DataVerse SET name of the table being queried
|
|
511
|
+
* @param {string} recordID the GUID of the records to be retrieved
|
|
512
|
+
* @param {string} selectColumns *OPTIONAL* if desired, enter your own custom OData query for advanced GET results. Format = select=column1,column2,column3...
|
|
513
|
+
* @returns a Promise resolving the successful results of the GET request, or rejecting the failed results of the GET request
|
|
514
|
+
*/
|
|
515
|
+
getRecord(tableSetName, recordID, selectColumns) {
|
|
516
|
+
return new Promise((resolve, reject) => {
|
|
517
|
+
const url = `/_api/${tableSetName}(${recordID})${selectColumns ? `?$${selectColumns}` : ""}`;
|
|
518
|
+
(0, safeAjax_js_1.default)({
|
|
519
|
+
type: "GET",
|
|
520
|
+
url: url,
|
|
521
|
+
success: resolve,
|
|
522
|
+
error: reject,
|
|
523
|
+
});
|
|
524
|
+
});
|
|
525
|
+
},
|
|
526
|
+
/**
|
|
527
|
+
*
|
|
528
|
+
* @param {String} tableSetName The DataVerse SET name of the table being queried
|
|
529
|
+
* @param {String} queryParameters *OPTIONAL* the OData query parameters for refining search results: *format = $filter=filters&$select=columns*
|
|
530
|
+
* @returns a Promise resolving the successful results of the GET request, or rejecting the failed results of the GET request
|
|
531
|
+
*/
|
|
532
|
+
getMultiple(tableSetName, queryParameters) {
|
|
533
|
+
return new Promise((resolve, reject) => {
|
|
534
|
+
// Construct the URL based on the presence of query parameters
|
|
535
|
+
const url = `/_api/${tableSetName}${queryParameters ? `?${queryParameters}` : ""}`;
|
|
536
|
+
(0, safeAjax_js_1.default)({
|
|
537
|
+
type: "GET",
|
|
538
|
+
url: url,
|
|
539
|
+
success: function (response) {
|
|
540
|
+
resolve(response.value);
|
|
541
|
+
},
|
|
542
|
+
error: reject,
|
|
543
|
+
});
|
|
544
|
+
});
|
|
545
|
+
},
|
|
546
|
+
};
|
|
547
|
+
exports["default"] = API;
|
|
548
|
+
|
|
549
|
+
|
|
550
|
+
/***/ }),
|
|
551
|
+
|
|
552
|
+
/***/ 539:
|
|
553
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
554
|
+
|
|
555
|
+
|
|
556
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
557
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
558
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
559
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
560
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
561
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
562
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
563
|
+
});
|
|
564
|
+
};
|
|
565
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
566
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
567
|
+
};
|
|
568
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
569
|
+
exports.DOMNodeReference = void 0;
|
|
570
|
+
exports.createDOMNodeReference = createDOMNodeReference;
|
|
571
|
+
exports.createMultipleDOMNodeReferences = createMultipleDOMNodeReferences;
|
|
572
|
+
const waitFor_js_1 = __importDefault(__webpack_require__(565));
|
|
573
|
+
const createInfoElement_js_1 = __importDefault(__webpack_require__(465));
|
|
574
|
+
const errors_js_1 = __webpack_require__(598);
|
|
575
|
+
__webpack_require__(39);
|
|
576
|
+
/**
|
|
577
|
+
* Class representing a reference to a DOM node.
|
|
578
|
+
*/
|
|
579
|
+
/******/ /******/ /******/ class DOMNodeReference {
|
|
580
|
+
/**
|
|
581
|
+
* Creates an instance of DOMNodeReference.
|
|
582
|
+
* @param {string} target - The CSS selector to find the desired DOM element.
|
|
583
|
+
*/
|
|
584
|
+
/******/ /******/ constructor(target) {
|
|
585
|
+
this.target = target;
|
|
586
|
+
this.isLoaded = false;
|
|
587
|
+
this.defaultDisplay = "";
|
|
588
|
+
this.value = null;
|
|
589
|
+
// we defer the rest of initialization
|
|
590
|
+
}
|
|
591
|
+
_init() {
|
|
592
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
593
|
+
try {
|
|
594
|
+
const element = yield (0, waitFor_js_1.default)(this.target);
|
|
595
|
+
this.element = element;
|
|
596
|
+
if (!this.element) {
|
|
597
|
+
throw new errors_js_1.DOMNodeNotFoundError(this);
|
|
598
|
+
}
|
|
599
|
+
if (this.element.classList.contains("boolean-radio")) {
|
|
600
|
+
yield this._attachRadioButtons();
|
|
601
|
+
}
|
|
602
|
+
this._initValueSync();
|
|
603
|
+
this._attachVisibilityController();
|
|
604
|
+
this.defaultDisplay = this.visibilityController.style.display;
|
|
605
|
+
this.isLoaded = true;
|
|
606
|
+
}
|
|
607
|
+
catch (e) {
|
|
608
|
+
throw new errors_js_1.DOMNodeInitializationError(this, e);
|
|
609
|
+
}
|
|
610
|
+
});
|
|
611
|
+
}
|
|
612
|
+
_initValueSync() {
|
|
613
|
+
// Function to update this.value based on element type
|
|
614
|
+
// Initial sync
|
|
615
|
+
this.updateValue();
|
|
616
|
+
// Event listeners for real-time changes based on element type
|
|
617
|
+
const elementType = this.element.type;
|
|
618
|
+
if (elementType === "checkbox" || elementType === "radio") {
|
|
619
|
+
this.element.addEventListener("click", this.updateValue.bind(this));
|
|
620
|
+
}
|
|
621
|
+
else if (elementType === "select-one" ||
|
|
622
|
+
elementType === "select-multiple") {
|
|
623
|
+
this.element.addEventListener("change", this.updateValue.bind(this));
|
|
624
|
+
}
|
|
625
|
+
else {
|
|
626
|
+
this.element.addEventListener("input", this.updateValue.bind(this));
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
updateValue() {
|
|
630
|
+
switch (this.element.type) {
|
|
631
|
+
case "checkbox":
|
|
632
|
+
case "radio":
|
|
633
|
+
this.value = this.element.checked;
|
|
634
|
+
this.checked = this.element.checked;
|
|
635
|
+
break;
|
|
636
|
+
case "select-multiple":
|
|
637
|
+
this.value = Array.from(this.element.selectedOptions).map((option) => option.value);
|
|
638
|
+
break;
|
|
639
|
+
case "number":
|
|
640
|
+
this.value =
|
|
641
|
+
this.element.value !== ""
|
|
642
|
+
? Number(this.element.value)
|
|
643
|
+
: null;
|
|
644
|
+
break;
|
|
645
|
+
default:
|
|
646
|
+
this.value = null;
|
|
647
|
+
break;
|
|
648
|
+
}
|
|
649
|
+
if (this.element.classList.contains("boolean-radio")) {
|
|
650
|
+
this.yesRadio.updateValue();
|
|
651
|
+
this.noRadio.updateValue();
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
_attachVisibilityController() {
|
|
655
|
+
// Set the default visibility controller to the element itself
|
|
656
|
+
this.visibilityController = this.element;
|
|
657
|
+
// If the element is a table, use its closest fieldset as the controller
|
|
658
|
+
if (this.element.tagName === "TABLE") {
|
|
659
|
+
const fieldset = this.element.closest("fieldset");
|
|
660
|
+
if (fieldset) {
|
|
661
|
+
this.visibilityController = fieldset;
|
|
662
|
+
}
|
|
663
|
+
return;
|
|
664
|
+
}
|
|
665
|
+
// For specific tag types, use the closest 'td' if available as the controller
|
|
666
|
+
const tagsRequiringTdParent = [
|
|
667
|
+
"SPAN",
|
|
668
|
+
"INPUT",
|
|
669
|
+
"TEXTAREA",
|
|
670
|
+
"SELECT",
|
|
671
|
+
"TABLE",
|
|
672
|
+
];
|
|
673
|
+
if (tagsRequiringTdParent.includes(this.element.tagName)) {
|
|
674
|
+
const tdParent = this.element.closest("td");
|
|
675
|
+
if (tdParent) {
|
|
676
|
+
this.visibilityController = tdParent;
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
_attachRadioButtons() {
|
|
681
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
682
|
+
this.yesRadio = yield createDOMNodeReference(`#${this.element.id}_1`);
|
|
683
|
+
this.noRadio = yield createDOMNodeReference(`#${this.element.id}_0`);
|
|
684
|
+
});
|
|
685
|
+
}
|
|
686
|
+
on(eventType, eventHandler) {
|
|
687
|
+
this.element.addEventListener(eventType, eventHandler.bind(this));
|
|
688
|
+
}
|
|
689
|
+
hide() {
|
|
690
|
+
this.visibilityController.style.display = "none";
|
|
691
|
+
}
|
|
692
|
+
show() {
|
|
693
|
+
this.visibilityController.style.display = this.defaultDisplay;
|
|
694
|
+
}
|
|
695
|
+
toggleVisibility(shouldShow) {
|
|
696
|
+
if (shouldShow instanceof Function) {
|
|
697
|
+
shouldShow() ? this.show() : this.hide();
|
|
698
|
+
}
|
|
699
|
+
else {
|
|
700
|
+
shouldShow ? this.show() : this.hide();
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
setValue(value) {
|
|
704
|
+
if (this.element.classList.contains("boolean-radio")) {
|
|
705
|
+
this.yesRadio.element.checked = value;
|
|
706
|
+
this.noRadio.element.checked =
|
|
707
|
+
!value;
|
|
708
|
+
}
|
|
709
|
+
else {
|
|
710
|
+
this.element.value = value;
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
disable() {
|
|
714
|
+
try {
|
|
715
|
+
this.element.disabled = true;
|
|
716
|
+
}
|
|
717
|
+
catch (e) {
|
|
718
|
+
throw new Error(`There was an error trying to disable the target: ${this.target}`);
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
enable() {
|
|
722
|
+
try {
|
|
723
|
+
this.element.disabled = false;
|
|
724
|
+
}
|
|
725
|
+
catch (e) {
|
|
726
|
+
throw new Error(`There was an error trying to disable the target: ${this.target}`);
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
append(...elements) {
|
|
730
|
+
this.element.append(...elements);
|
|
731
|
+
}
|
|
732
|
+
before(...elements) {
|
|
733
|
+
this.element.before(...elements);
|
|
734
|
+
}
|
|
735
|
+
after(...elements) {
|
|
736
|
+
this.element.after(...elements);
|
|
737
|
+
}
|
|
738
|
+
getLabel() {
|
|
739
|
+
return document.querySelector(`#${this.element.id}_label`) || null;
|
|
740
|
+
}
|
|
741
|
+
appendToLabel(...elements) {
|
|
742
|
+
const label = this.getLabel();
|
|
743
|
+
if (label) {
|
|
744
|
+
label.append(" ", ...elements);
|
|
745
|
+
}
|
|
746
|
+
}
|
|
747
|
+
addLabelTooltip(text) {
|
|
748
|
+
this.appendToLabel((0, createInfoElement_js_1.default)(text));
|
|
749
|
+
}
|
|
750
|
+
addToolTip(text) {
|
|
751
|
+
this.append((0, createInfoElement_js_1.default)(text));
|
|
752
|
+
}
|
|
753
|
+
setTextContent(text) {
|
|
754
|
+
this.element.innerHTML = text;
|
|
755
|
+
}
|
|
756
|
+
uncheckRadios() {
|
|
757
|
+
if (this.yesRadio && this.noRadio) {
|
|
758
|
+
this.yesRadio.element.checked = false;
|
|
759
|
+
this.noRadio.element.checked = false;
|
|
760
|
+
}
|
|
761
|
+
else {
|
|
762
|
+
console.error("[SYNACT] Attempted to uncheck radios for an element that has no radios");
|
|
763
|
+
}
|
|
764
|
+
}
|
|
765
|
+
configureConditionalRendering(condition, triggerNodes) {
|
|
766
|
+
try {
|
|
767
|
+
this.toggleVisibility(condition());
|
|
768
|
+
if (triggerNodes) {
|
|
769
|
+
const nodes = Array.isArray(triggerNodes)
|
|
770
|
+
? triggerNodes
|
|
771
|
+
: [triggerNodes];
|
|
772
|
+
nodes.forEach((node) => {
|
|
773
|
+
node.on("change", () => this.toggleVisibility(condition()));
|
|
774
|
+
const observer = new MutationObserver(() => {
|
|
775
|
+
const display = window.getComputedStyle(node.visibilityController).display;
|
|
776
|
+
this.toggleVisibility(display !== "none" && condition());
|
|
777
|
+
});
|
|
778
|
+
observer.observe(node.visibilityController, {
|
|
779
|
+
attributes: true,
|
|
780
|
+
attributeFilter: ["style"],
|
|
781
|
+
});
|
|
782
|
+
});
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
catch (e) {
|
|
786
|
+
throw new errors_js_1.ConditionalRenderingError(this, e);
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
configureValidationAndRequirements(logic, fieldDisplayName, dependencies) {
|
|
790
|
+
if (typeof Page_Validators !== "undefined") {
|
|
791
|
+
const newValidator = document.createElement("span");
|
|
792
|
+
newValidator.style.display = "none";
|
|
793
|
+
newValidator.id = `${this.element.id}Validator`;
|
|
794
|
+
newValidator.controltovalidate = this.element.id;
|
|
795
|
+
newValidator.errormessage = `<a href='#${this.element.id}_label'>${fieldDisplayName} is a required field</a>`;
|
|
796
|
+
newValidator.evaluationfunction =
|
|
797
|
+
logic.validationLogic.bind(this);
|
|
798
|
+
//eslint-disable-next-line
|
|
799
|
+
Page_Validators.push(newValidator);
|
|
800
|
+
}
|
|
801
|
+
else {
|
|
802
|
+
throw new Error("Attempted to add to Validator where Page_Validators do not exist");
|
|
803
|
+
}
|
|
804
|
+
this.setRequiredLevel(logic.requirementLogic(this));
|
|
805
|
+
if (!dependencies)
|
|
806
|
+
return;
|
|
807
|
+
dependencies = Array.isArray(dependencies) ? dependencies : [dependencies];
|
|
808
|
+
dependencies.forEach((dep) => {
|
|
809
|
+
dep.element.addEventListener("change", () => this.setRequiredLevel(logic.requirementLogic(this)));
|
|
810
|
+
});
|
|
811
|
+
}
|
|
812
|
+
setRequiredLevel(isRequired) {
|
|
813
|
+
var _a, _b, _c, _d;
|
|
814
|
+
if (isRequired instanceof Function) {
|
|
815
|
+
isRequired()
|
|
816
|
+
? (_a = this.getLabel()) === null || _a === void 0 ? void 0 : _a.classList.add("required-field")
|
|
817
|
+
: (_b = this.getLabel()) === null || _b === void 0 ? void 0 : _b.classList.remove("required-field");
|
|
818
|
+
return;
|
|
819
|
+
}
|
|
820
|
+
else {
|
|
821
|
+
isRequired
|
|
822
|
+
? (_c = this.getLabel()) === null || _c === void 0 ? void 0 : _c.classList.add("required-field")
|
|
823
|
+
: (_d = this.getLabel()) === null || _d === void 0 ? void 0 : _d.classList.remove("required-field");
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
onceLoaded(callback) {
|
|
827
|
+
if (this.isLoaded) {
|
|
828
|
+
callback(this);
|
|
829
|
+
return;
|
|
830
|
+
}
|
|
831
|
+
if (this.target instanceof HTMLElement) {
|
|
832
|
+
callback(this);
|
|
833
|
+
return;
|
|
834
|
+
}
|
|
835
|
+
const observer = new MutationObserver(() => {
|
|
836
|
+
if (document.querySelector(this.target)) {
|
|
837
|
+
observer.disconnect(); // Stop observing once loaded
|
|
838
|
+
this.isLoaded = true;
|
|
839
|
+
callback(this); // Call the provided callback
|
|
840
|
+
}
|
|
841
|
+
});
|
|
842
|
+
observer.observe(document.body, {
|
|
843
|
+
subtree: true,
|
|
844
|
+
childList: true,
|
|
845
|
+
});
|
|
846
|
+
}
|
|
847
|
+
}
|
|
848
|
+
exports.DOMNodeReference = DOMNodeReference;
|
|
849
|
+
/**
|
|
850
|
+
* Creates and initializes a DOMNodeReference instance.
|
|
851
|
+
* @async
|
|
852
|
+
* @function createDOMNodeReference
|
|
853
|
+
* @param {string | HTMLElement} target - The CSS selector for the desired DOM element.
|
|
854
|
+
* @returns {Promise<DOMNodeReference>} A promise that resolves to a Proxy of the initialized DOMNodeReference instance.
|
|
855
|
+
*/
|
|
856
|
+
function createDOMNodeReference(target) {
|
|
857
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
858
|
+
try {
|
|
859
|
+
const instance = new DOMNodeReference(target);
|
|
860
|
+
yield instance._init();
|
|
861
|
+
return new Proxy(instance, {
|
|
862
|
+
get: (target, prop) => {
|
|
863
|
+
// do not proxy the initialization method
|
|
864
|
+
// init() is only needed in this factory function
|
|
865
|
+
if (prop.toString().startsWith("_"))
|
|
866
|
+
return undefined;
|
|
867
|
+
// proxy the class to wrap all methods in the 'onceLoaded' method, to make sure the
|
|
868
|
+
// element is always available before executing method
|
|
869
|
+
const value = target[prop];
|
|
870
|
+
if (typeof value === "function" && prop !== "onceLoaded") {
|
|
871
|
+
return (...args) => target.onceLoaded(() => value.apply(target, args));
|
|
872
|
+
}
|
|
873
|
+
return value;
|
|
874
|
+
},
|
|
875
|
+
});
|
|
876
|
+
}
|
|
877
|
+
catch (e) {
|
|
878
|
+
console.error(`There was an error creating a DOMNodeReference: ${e}`);
|
|
879
|
+
throw new Error(e);
|
|
880
|
+
}
|
|
881
|
+
});
|
|
882
|
+
}
|
|
883
|
+
/**
|
|
884
|
+
* Creates and initializes multiple DOMNodeReference instances.
|
|
885
|
+
* @async
|
|
886
|
+
* @function createMultipleDOMNodeReferences
|
|
887
|
+
* @param {string} querySelector - The CSS selector for the desired DOM elements.
|
|
888
|
+
* @returns {Promise<DOMNodeReference[]>} A promise that resolves to an array of Proxies of initialized DOMNodeReference instances.
|
|
889
|
+
*/
|
|
890
|
+
function createMultipleDOMNodeReferences(querySelector) {
|
|
891
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
892
|
+
try {
|
|
893
|
+
const elements = Array.from(document.querySelectorAll(querySelector));
|
|
894
|
+
const initializedElements = yield Promise.all(elements.map((element) => createDOMNodeReference(element)));
|
|
895
|
+
const domNodeArray = initializedElements;
|
|
896
|
+
domNodeArray.hideAll = () => domNodeArray.forEach((instance) => instance.hide());
|
|
897
|
+
domNodeArray.showAll = () => domNodeArray.forEach((instance) => instance.show());
|
|
898
|
+
return elements;
|
|
899
|
+
}
|
|
900
|
+
catch (e) {
|
|
901
|
+
console.error(`There was an error creating multiple DOMNodeReferences: ${e}`);
|
|
902
|
+
throw new Error(e);
|
|
903
|
+
}
|
|
904
|
+
});
|
|
905
|
+
}
|
|
906
|
+
|
|
907
|
+
|
|
908
|
+
/***/ }),
|
|
909
|
+
|
|
910
|
+
/***/ 465:
|
|
911
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
912
|
+
|
|
913
|
+
|
|
914
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
915
|
+
exports["default"] = CreateInfoEl;
|
|
916
|
+
function CreateInfoEl(titleString) {
|
|
917
|
+
const span = document.createElement("span");
|
|
918
|
+
span.classList.add("info-icon");
|
|
919
|
+
const icon = document.createElement("i");
|
|
920
|
+
icon.classList.add("fa", "fa-solid", "fa-info-circle");
|
|
921
|
+
icon.setAttribute("aria-label", "Info");
|
|
922
|
+
icon.style.cursor = "pointer";
|
|
923
|
+
const flyoutContent = document.createElement("div");
|
|
924
|
+
flyoutContent.innerHTML = titleString;
|
|
925
|
+
flyoutContent.classList.add("flyout-content");
|
|
926
|
+
span.appendChild(icon);
|
|
927
|
+
span.appendChild(flyoutContent);
|
|
928
|
+
// Function to position flyout content
|
|
929
|
+
const positionFlyout = () => {
|
|
930
|
+
flyoutContent.style.display = "block"; // Show the flyout to calculate dimensions
|
|
931
|
+
const flyoutRect = flyoutContent.getBoundingClientRect();
|
|
932
|
+
const viewportWidth = window.innerWidth;
|
|
933
|
+
// Position the flyout
|
|
934
|
+
// Adjust if flyout is too far to the right
|
|
935
|
+
if (flyoutRect.right > viewportWidth) {
|
|
936
|
+
const overflowAmount = flyoutRect.right - viewportWidth;
|
|
937
|
+
flyoutContent.style.left = `calc(50% - ${overflowAmount}px)`; // Shift left
|
|
938
|
+
}
|
|
939
|
+
// Adjust if flyout is too far to the left
|
|
940
|
+
if (flyoutRect.left < 0) {
|
|
941
|
+
const overflowAmount = Math.abs(flyoutRect.left);
|
|
942
|
+
flyoutContent.style.left = `calc(50% + ${overflowAmount}px)`; // Shift right
|
|
943
|
+
}
|
|
944
|
+
};
|
|
945
|
+
icon.addEventListener("mouseenter", positionFlyout);
|
|
946
|
+
icon.addEventListener("mouseleave", () => {
|
|
947
|
+
flyoutContent.style.display = "none"; // Hide on mouse leave
|
|
948
|
+
});
|
|
949
|
+
icon.addEventListener("touchstart", (event) => {
|
|
950
|
+
event.preventDefault();
|
|
951
|
+
// Toggle flyout visibility on touch
|
|
952
|
+
flyoutContent.style.display =
|
|
953
|
+
flyoutContent.style.display === "block" ? "none" : "block";
|
|
954
|
+
if (flyoutContent.style.display === "block") {
|
|
955
|
+
positionFlyout(); // Position the flyout when displayed
|
|
956
|
+
}
|
|
957
|
+
});
|
|
958
|
+
document.body.addEventListener("click", (event) => {
|
|
959
|
+
if (!span.contains(event.target)) {
|
|
960
|
+
flyoutContent.style.display = "none"; // Hide on body click
|
|
961
|
+
}
|
|
962
|
+
});
|
|
963
|
+
return span;
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
|
|
967
|
+
/***/ }),
|
|
968
|
+
|
|
969
|
+
/***/ 598:
|
|
970
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
971
|
+
|
|
972
|
+
|
|
973
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
974
|
+
exports.ConditionalRenderingError = exports.DOMNodeNotFoundError = exports.DOMNodeInitializationError = void 0;
|
|
975
|
+
class DOMNodeInitializationError extends Error {
|
|
976
|
+
constructor(instance, error) {
|
|
977
|
+
super(`There was an error initializing a DOMNodeReference for target: ${instance.target}, :: ${error}`);
|
|
978
|
+
this.name = "DOMNodeInitializationError";
|
|
979
|
+
}
|
|
980
|
+
}
|
|
981
|
+
exports.DOMNodeInitializationError = DOMNodeInitializationError;
|
|
982
|
+
class DOMNodeNotFoundError extends Error {
|
|
983
|
+
constructor(instance) {
|
|
984
|
+
super(`The targeted DOM element was not found: ${instance.target}`);
|
|
985
|
+
}
|
|
986
|
+
}
|
|
987
|
+
exports.DOMNodeNotFoundError = DOMNodeNotFoundError;
|
|
988
|
+
class ConditionalRenderingError extends Error {
|
|
989
|
+
constructor(instance, error) {
|
|
990
|
+
super(`There was an error condiguring conditional rendering for target: ${instance.target} :: ${error}`);
|
|
991
|
+
}
|
|
992
|
+
}
|
|
993
|
+
exports.ConditionalRenderingError = ConditionalRenderingError;
|
|
994
|
+
|
|
995
|
+
|
|
996
|
+
/***/ }),
|
|
997
|
+
|
|
998
|
+
/***/ 626:
|
|
999
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
1000
|
+
|
|
1001
|
+
|
|
1002
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1003
|
+
exports["default"] = safeAjax;
|
|
1004
|
+
// @ts-nocheck
|
|
1005
|
+
function safeAjax(ajaxOptions) {
|
|
1006
|
+
const deferredAjax = $.Deferred();
|
|
1007
|
+
// shell is only available via runtime in a PowerPages portal
|
|
1008
|
+
shell
|
|
1009
|
+
.getTokenDeferred()
|
|
1010
|
+
.done(function (token) {
|
|
1011
|
+
// add headers for AJAX
|
|
1012
|
+
if (!ajaxOptions.headers) {
|
|
1013
|
+
$.extend(ajaxOptions, {
|
|
1014
|
+
headers: {
|
|
1015
|
+
__RequestVerificationToken: token,
|
|
1016
|
+
},
|
|
1017
|
+
});
|
|
1018
|
+
}
|
|
1019
|
+
else {
|
|
1020
|
+
ajaxOptions.headers["__RequestVerificationToken"] = token;
|
|
1021
|
+
}
|
|
1022
|
+
$.ajax(ajaxOptions)
|
|
1023
|
+
.done(function (data, textStatus, jqXHR) {
|
|
1024
|
+
//eslint-disable-next-line
|
|
1025
|
+
validateLoginSession(data, textStatus, jqXHR, deferredAjax.resolve);
|
|
1026
|
+
})
|
|
1027
|
+
.fail(deferredAjax.reject); //AJAX
|
|
1028
|
+
})
|
|
1029
|
+
.fail(function () {
|
|
1030
|
+
deferredAjax.rejectWith(this, arguments); // on token failure pass the token AJAX and args
|
|
1031
|
+
});
|
|
1032
|
+
return deferredAjax.promise();
|
|
1033
|
+
}
|
|
1034
|
+
|
|
1035
|
+
|
|
1036
|
+
/***/ }),
|
|
1037
|
+
|
|
1038
|
+
/***/ 565:
|
|
1039
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
1040
|
+
|
|
1041
|
+
|
|
1042
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1043
|
+
exports["default"] = waitFor;
|
|
1044
|
+
function waitFor(target) {
|
|
1045
|
+
return new Promise((resolve, reject) => {
|
|
1046
|
+
// Create observer to watch for target in DOM
|
|
1047
|
+
const observer = new MutationObserver(() => {
|
|
1048
|
+
const observedElement = (document.querySelector(target));
|
|
1049
|
+
if (observedElement) {
|
|
1050
|
+
clearTimeout(timeout);
|
|
1051
|
+
observer.disconnect();
|
|
1052
|
+
resolve(observedElement);
|
|
1053
|
+
}
|
|
1054
|
+
});
|
|
1055
|
+
const timeout = setTimeout(() => {
|
|
1056
|
+
observer.disconnect();
|
|
1057
|
+
reject(new Error(`Element not found: ${target} within 5 seconds`));
|
|
1058
|
+
}, 5000);
|
|
1059
|
+
// Check if target is already in DOM
|
|
1060
|
+
if (target instanceof HTMLElement) {
|
|
1061
|
+
clearTimeout(timeout);
|
|
1062
|
+
return resolve(target);
|
|
1063
|
+
}
|
|
1064
|
+
const element = document.querySelector(target);
|
|
1065
|
+
if (element) {
|
|
1066
|
+
clearTimeout(timeout);
|
|
1067
|
+
return resolve(element);
|
|
1068
|
+
}
|
|
1069
|
+
observer.observe(document.body, {
|
|
1070
|
+
subtree: true,
|
|
1071
|
+
attributes: true,
|
|
1072
|
+
childList: true, // Detects added/removed child elements
|
|
1073
|
+
});
|
|
1074
|
+
});
|
|
1075
|
+
}
|
|
1076
|
+
|
|
1077
|
+
|
|
1078
|
+
/***/ }),
|
|
1079
|
+
|
|
1080
|
+
/***/ 229:
|
|
1081
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
1082
|
+
|
|
1083
|
+
|
|
1084
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
1085
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
1086
|
+
};
|
|
1087
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
1088
|
+
exports.createMultipleDOMNodeReferences = exports.createDOMNodeReference = exports.API = void 0;
|
|
1089
|
+
const API_js_1 = __importDefault(__webpack_require__(377));
|
|
1090
|
+
exports.API = API_js_1.default;
|
|
1091
|
+
const DOMNodeReferences_js_1 = __webpack_require__(539);
|
|
1092
|
+
Object.defineProperty(exports, "createDOMNodeReference", ({ enumerable: true, get: function () { return DOMNodeReferences_js_1.createDOMNodeReference; } }));
|
|
1093
|
+
Object.defineProperty(exports, "createMultipleDOMNodeReferences", ({ enumerable: true, get: function () { return DOMNodeReferences_js_1.createMultipleDOMNodeReferences; } }));
|
|
1094
|
+
|
|
1095
|
+
|
|
1096
|
+
/***/ })
|
|
1097
|
+
|
|
1098
|
+
/******/ });
|
|
1099
|
+
/************************************************************************/
|
|
1100
|
+
/******/ // The module cache
|
|
1101
|
+
/******/ var __webpack_module_cache__ = {};
|
|
1102
|
+
/******/
|
|
1103
|
+
/******/ // The require function
|
|
1104
|
+
/******/ function __webpack_require__(moduleId) {
|
|
1105
|
+
/******/ // Check if module is in cache
|
|
1106
|
+
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
|
1107
|
+
/******/ if (cachedModule !== undefined) {
|
|
1108
|
+
/******/ return cachedModule.exports;
|
|
1109
|
+
/******/ }
|
|
1110
|
+
/******/ // Create a new module (and put it into the cache)
|
|
1111
|
+
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
1112
|
+
/******/ id: moduleId,
|
|
1113
|
+
/******/ // no module.loaded needed
|
|
1114
|
+
/******/ exports: {}
|
|
1115
|
+
/******/ };
|
|
1116
|
+
/******/
|
|
1117
|
+
/******/ // Execute the module function
|
|
1118
|
+
/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
|
1119
|
+
/******/
|
|
1120
|
+
/******/ // Return the exports of the module
|
|
1121
|
+
/******/ return module.exports;
|
|
1122
|
+
/******/ }
|
|
1123
|
+
/******/
|
|
1124
|
+
/************************************************************************/
|
|
1125
|
+
/******/ /* webpack/runtime/compat get default export */
|
|
1126
|
+
/******/ (() => {
|
|
1127
|
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
1128
|
+
/******/ __webpack_require__.n = (module) => {
|
|
1129
|
+
/******/ var getter = module && module.__esModule ?
|
|
1130
|
+
/******/ () => (module['default']) :
|
|
1131
|
+
/******/ () => (module);
|
|
1132
|
+
/******/ __webpack_require__.d(getter, { a: getter });
|
|
1133
|
+
/******/ return getter;
|
|
1134
|
+
/******/ };
|
|
1135
|
+
/******/ })();
|
|
1136
|
+
/******/
|
|
1137
|
+
/******/ /* webpack/runtime/define property getters */
|
|
1138
|
+
/******/ (() => {
|
|
1139
|
+
/******/ // define getter functions for harmony exports
|
|
1140
|
+
/******/ __webpack_require__.d = (exports, definition) => {
|
|
1141
|
+
/******/ for(var key in definition) {
|
|
1142
|
+
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
1143
|
+
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
1144
|
+
/******/ }
|
|
1145
|
+
/******/ }
|
|
1146
|
+
/******/ };
|
|
1147
|
+
/******/ })();
|
|
1148
|
+
/******/
|
|
1149
|
+
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
1150
|
+
/******/ (() => {
|
|
1151
|
+
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
1152
|
+
/******/ })();
|
|
1153
|
+
/******/
|
|
1154
|
+
/******/ /* webpack/runtime/make namespace object */
|
|
1155
|
+
/******/ (() => {
|
|
1156
|
+
/******/ // define __esModule on exports
|
|
1157
|
+
/******/ __webpack_require__.r = (exports) => {
|
|
1158
|
+
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
1159
|
+
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
1160
|
+
/******/ }
|
|
1161
|
+
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
1162
|
+
/******/ };
|
|
1163
|
+
/******/ })();
|
|
1164
|
+
/******/
|
|
1165
|
+
/******/ /* webpack/runtime/nonce */
|
|
1166
|
+
/******/ (() => {
|
|
1167
|
+
/******/ __webpack_require__.nc = undefined;
|
|
1168
|
+
/******/ })();
|
|
1169
|
+
/******/
|
|
1170
|
+
/************************************************************************/
|
|
1171
|
+
/******/
|
|
1172
|
+
/******/ // startup
|
|
1173
|
+
/******/ // Load entry module and return exports
|
|
1174
|
+
/******/ // This entry module is referenced by other modules so it can't be inlined
|
|
1175
|
+
/******/ var __webpack_exports__ = __webpack_require__(229);
|
|
1176
|
+
/******/ module.exports = __webpack_exports__;
|
|
1177
|
+
/******/
|
|
1178
|
+
/******/ })()
|
|
1179
|
+
;
|
|
1180
|
+
//# sourceMappingURL=index.js.map
|