powerpagestoolkit 1.3.102 → 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 -61
- package/dist/index.bundle.js +0 -1207
package/dist/index.bundle.js
DELETED
|
@@ -1,1207 +0,0 @@
|
|
|
1
|
-
/******/ var __webpack_modules__ = ({
|
|
2
|
-
|
|
3
|
-
/***/ 693:
|
|
4
|
-
/***/ ((module, __webpack_exports__, __webpack_require__) => {
|
|
5
|
-
|
|
6
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
7
|
-
/* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
8
|
-
/* harmony export */ });
|
|
9
|
-
/* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(601);
|
|
10
|
-
/* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
|
|
11
|
-
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(314);
|
|
12
|
-
/* 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__);
|
|
13
|
-
// Imports
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
|
|
17
|
-
// Module
|
|
18
|
-
___CSS_LOADER_EXPORT___.push([module.id, `.info-icon {
|
|
19
|
-
position: relative;
|
|
20
|
-
display: inline-block;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.info-icon .fa-info-circle {
|
|
24
|
-
cursor: pointer; /* Ensures the icon is recognized as interactive */
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.info-icon .flyout-content {
|
|
28
|
-
max-width: calc(100vw - 20px); /* 20px margin on both sides */
|
|
29
|
-
display: none; /* Initially hidden */
|
|
30
|
-
position: absolute;
|
|
31
|
-
left: 50%; /* Center horizontally */
|
|
32
|
-
transform: translateX(-50%); /* Adjust positioning */
|
|
33
|
-
background-color: #f9f9f9;
|
|
34
|
-
padding: 10px;
|
|
35
|
-
border: 1px solid #ddd;
|
|
36
|
-
z-index: 1;
|
|
37
|
-
min-width: 200px; /* Minimum width for better readability */
|
|
38
|
-
box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
|
|
39
|
-
border-radius: 4px; /* Rounded corners */
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
@media (max-width: 600px) {
|
|
43
|
-
.info-icon .flyout-content {
|
|
44
|
-
max-width: 95vw;
|
|
45
|
-
padding: 12px;
|
|
46
|
-
font-size: 0.9em;
|
|
47
|
-
display: block;
|
|
48
|
-
right: auto;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
`, ""]);
|
|
52
|
-
// Exports
|
|
53
|
-
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
/***/ }),
|
|
57
|
-
|
|
58
|
-
/***/ 314:
|
|
59
|
-
/***/ ((module) => {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
/*
|
|
64
|
-
MIT License http://www.opensource.org/licenses/mit-license.php
|
|
65
|
-
Author Tobias Koppers @sokra
|
|
66
|
-
*/
|
|
67
|
-
module.exports = function (cssWithMappingToString) {
|
|
68
|
-
var list = [];
|
|
69
|
-
|
|
70
|
-
// return the list of modules as css string
|
|
71
|
-
list.toString = function toString() {
|
|
72
|
-
return this.map(function (item) {
|
|
73
|
-
var content = "";
|
|
74
|
-
var needLayer = typeof item[5] !== "undefined";
|
|
75
|
-
if (item[4]) {
|
|
76
|
-
content += "@supports (".concat(item[4], ") {");
|
|
77
|
-
}
|
|
78
|
-
if (item[2]) {
|
|
79
|
-
content += "@media ".concat(item[2], " {");
|
|
80
|
-
}
|
|
81
|
-
if (needLayer) {
|
|
82
|
-
content += "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {");
|
|
83
|
-
}
|
|
84
|
-
content += cssWithMappingToString(item);
|
|
85
|
-
if (needLayer) {
|
|
86
|
-
content += "}";
|
|
87
|
-
}
|
|
88
|
-
if (item[2]) {
|
|
89
|
-
content += "}";
|
|
90
|
-
}
|
|
91
|
-
if (item[4]) {
|
|
92
|
-
content += "}";
|
|
93
|
-
}
|
|
94
|
-
return content;
|
|
95
|
-
}).join("");
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
// import a list of modules into the list
|
|
99
|
-
list.i = function i(modules, media, dedupe, supports, layer) {
|
|
100
|
-
if (typeof modules === "string") {
|
|
101
|
-
modules = [[null, modules, undefined]];
|
|
102
|
-
}
|
|
103
|
-
var alreadyImportedModules = {};
|
|
104
|
-
if (dedupe) {
|
|
105
|
-
for (var k = 0; k < this.length; k++) {
|
|
106
|
-
var id = this[k][0];
|
|
107
|
-
if (id != null) {
|
|
108
|
-
alreadyImportedModules[id] = true;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
for (var _k = 0; _k < modules.length; _k++) {
|
|
113
|
-
var item = [].concat(modules[_k]);
|
|
114
|
-
if (dedupe && alreadyImportedModules[item[0]]) {
|
|
115
|
-
continue;
|
|
116
|
-
}
|
|
117
|
-
if (typeof layer !== "undefined") {
|
|
118
|
-
if (typeof item[5] === "undefined") {
|
|
119
|
-
item[5] = layer;
|
|
120
|
-
} else {
|
|
121
|
-
item[1] = "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {").concat(item[1], "}");
|
|
122
|
-
item[5] = layer;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
if (media) {
|
|
126
|
-
if (!item[2]) {
|
|
127
|
-
item[2] = media;
|
|
128
|
-
} else {
|
|
129
|
-
item[1] = "@media ".concat(item[2], " {").concat(item[1], "}");
|
|
130
|
-
item[2] = media;
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
if (supports) {
|
|
134
|
-
if (!item[4]) {
|
|
135
|
-
item[4] = "".concat(supports);
|
|
136
|
-
} else {
|
|
137
|
-
item[1] = "@supports (".concat(item[4], ") {").concat(item[1], "}");
|
|
138
|
-
item[4] = supports;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
list.push(item);
|
|
142
|
-
}
|
|
143
|
-
};
|
|
144
|
-
return list;
|
|
145
|
-
};
|
|
146
|
-
|
|
147
|
-
/***/ }),
|
|
148
|
-
|
|
149
|
-
/***/ 601:
|
|
150
|
-
/***/ ((module) => {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
module.exports = function (i) {
|
|
155
|
-
return i[1];
|
|
156
|
-
};
|
|
157
|
-
|
|
158
|
-
/***/ }),
|
|
159
|
-
|
|
160
|
-
/***/ 72:
|
|
161
|
-
/***/ ((module) => {
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
var stylesInDOM = [];
|
|
166
|
-
function getIndexByIdentifier(identifier) {
|
|
167
|
-
var result = -1;
|
|
168
|
-
for (var i = 0; i < stylesInDOM.length; i++) {
|
|
169
|
-
if (stylesInDOM[i].identifier === identifier) {
|
|
170
|
-
result = i;
|
|
171
|
-
break;
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
return result;
|
|
175
|
-
}
|
|
176
|
-
function modulesToDom(list, options) {
|
|
177
|
-
var idCountMap = {};
|
|
178
|
-
var identifiers = [];
|
|
179
|
-
for (var i = 0; i < list.length; i++) {
|
|
180
|
-
var item = list[i];
|
|
181
|
-
var id = options.base ? item[0] + options.base : item[0];
|
|
182
|
-
var count = idCountMap[id] || 0;
|
|
183
|
-
var identifier = "".concat(id, " ").concat(count);
|
|
184
|
-
idCountMap[id] = count + 1;
|
|
185
|
-
var indexByIdentifier = getIndexByIdentifier(identifier);
|
|
186
|
-
var obj = {
|
|
187
|
-
css: item[1],
|
|
188
|
-
media: item[2],
|
|
189
|
-
sourceMap: item[3],
|
|
190
|
-
supports: item[4],
|
|
191
|
-
layer: item[5]
|
|
192
|
-
};
|
|
193
|
-
if (indexByIdentifier !== -1) {
|
|
194
|
-
stylesInDOM[indexByIdentifier].references++;
|
|
195
|
-
stylesInDOM[indexByIdentifier].updater(obj);
|
|
196
|
-
} else {
|
|
197
|
-
var updater = addElementStyle(obj, options);
|
|
198
|
-
options.byIndex = i;
|
|
199
|
-
stylesInDOM.splice(i, 0, {
|
|
200
|
-
identifier: identifier,
|
|
201
|
-
updater: updater,
|
|
202
|
-
references: 1
|
|
203
|
-
});
|
|
204
|
-
}
|
|
205
|
-
identifiers.push(identifier);
|
|
206
|
-
}
|
|
207
|
-
return identifiers;
|
|
208
|
-
}
|
|
209
|
-
function addElementStyle(obj, options) {
|
|
210
|
-
var api = options.domAPI(options);
|
|
211
|
-
api.update(obj);
|
|
212
|
-
var updater = function updater(newObj) {
|
|
213
|
-
if (newObj) {
|
|
214
|
-
if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap && newObj.supports === obj.supports && newObj.layer === obj.layer) {
|
|
215
|
-
return;
|
|
216
|
-
}
|
|
217
|
-
api.update(obj = newObj);
|
|
218
|
-
} else {
|
|
219
|
-
api.remove();
|
|
220
|
-
}
|
|
221
|
-
};
|
|
222
|
-
return updater;
|
|
223
|
-
}
|
|
224
|
-
module.exports = function (list, options) {
|
|
225
|
-
options = options || {};
|
|
226
|
-
list = list || [];
|
|
227
|
-
var lastIdentifiers = modulesToDom(list, options);
|
|
228
|
-
return function update(newList) {
|
|
229
|
-
newList = newList || [];
|
|
230
|
-
for (var i = 0; i < lastIdentifiers.length; i++) {
|
|
231
|
-
var identifier = lastIdentifiers[i];
|
|
232
|
-
var index = getIndexByIdentifier(identifier);
|
|
233
|
-
stylesInDOM[index].references--;
|
|
234
|
-
}
|
|
235
|
-
var newLastIdentifiers = modulesToDom(newList, options);
|
|
236
|
-
for (var _i = 0; _i < lastIdentifiers.length; _i++) {
|
|
237
|
-
var _identifier = lastIdentifiers[_i];
|
|
238
|
-
var _index = getIndexByIdentifier(_identifier);
|
|
239
|
-
if (stylesInDOM[_index].references === 0) {
|
|
240
|
-
stylesInDOM[_index].updater();
|
|
241
|
-
stylesInDOM.splice(_index, 1);
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
lastIdentifiers = newLastIdentifiers;
|
|
245
|
-
};
|
|
246
|
-
};
|
|
247
|
-
|
|
248
|
-
/***/ }),
|
|
249
|
-
|
|
250
|
-
/***/ 659:
|
|
251
|
-
/***/ ((module) => {
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
var memo = {};
|
|
256
|
-
|
|
257
|
-
/* istanbul ignore next */
|
|
258
|
-
function getTarget(target) {
|
|
259
|
-
if (typeof memo[target] === "undefined") {
|
|
260
|
-
var styleTarget = document.querySelector(target);
|
|
261
|
-
|
|
262
|
-
// Special case to return head of iframe instead of iframe itself
|
|
263
|
-
if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {
|
|
264
|
-
try {
|
|
265
|
-
// This will throw an exception if access to iframe is blocked
|
|
266
|
-
// due to cross-origin restrictions
|
|
267
|
-
styleTarget = styleTarget.contentDocument.head;
|
|
268
|
-
} catch (e) {
|
|
269
|
-
// istanbul ignore next
|
|
270
|
-
styleTarget = null;
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
memo[target] = styleTarget;
|
|
274
|
-
}
|
|
275
|
-
return memo[target];
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
/* istanbul ignore next */
|
|
279
|
-
function insertBySelector(insert, style) {
|
|
280
|
-
var target = getTarget(insert);
|
|
281
|
-
if (!target) {
|
|
282
|
-
throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");
|
|
283
|
-
}
|
|
284
|
-
target.appendChild(style);
|
|
285
|
-
}
|
|
286
|
-
module.exports = insertBySelector;
|
|
287
|
-
|
|
288
|
-
/***/ }),
|
|
289
|
-
|
|
290
|
-
/***/ 540:
|
|
291
|
-
/***/ ((module) => {
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
/* istanbul ignore next */
|
|
296
|
-
function insertStyleElement(options) {
|
|
297
|
-
var element = document.createElement("style");
|
|
298
|
-
options.setAttributes(element, options.attributes);
|
|
299
|
-
options.insert(element, options.options);
|
|
300
|
-
return element;
|
|
301
|
-
}
|
|
302
|
-
module.exports = insertStyleElement;
|
|
303
|
-
|
|
304
|
-
/***/ }),
|
|
305
|
-
|
|
306
|
-
/***/ 56:
|
|
307
|
-
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
/* istanbul ignore next */
|
|
312
|
-
function setAttributesWithoutAttributes(styleElement) {
|
|
313
|
-
var nonce = true ? __webpack_require__.nc : 0;
|
|
314
|
-
if (nonce) {
|
|
315
|
-
styleElement.setAttribute("nonce", nonce);
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
module.exports = setAttributesWithoutAttributes;
|
|
319
|
-
|
|
320
|
-
/***/ }),
|
|
321
|
-
|
|
322
|
-
/***/ 825:
|
|
323
|
-
/***/ ((module) => {
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
/* istanbul ignore next */
|
|
328
|
-
function apply(styleElement, options, obj) {
|
|
329
|
-
var css = "";
|
|
330
|
-
if (obj.supports) {
|
|
331
|
-
css += "@supports (".concat(obj.supports, ") {");
|
|
332
|
-
}
|
|
333
|
-
if (obj.media) {
|
|
334
|
-
css += "@media ".concat(obj.media, " {");
|
|
335
|
-
}
|
|
336
|
-
var needLayer = typeof obj.layer !== "undefined";
|
|
337
|
-
if (needLayer) {
|
|
338
|
-
css += "@layer".concat(obj.layer.length > 0 ? " ".concat(obj.layer) : "", " {");
|
|
339
|
-
}
|
|
340
|
-
css += obj.css;
|
|
341
|
-
if (needLayer) {
|
|
342
|
-
css += "}";
|
|
343
|
-
}
|
|
344
|
-
if (obj.media) {
|
|
345
|
-
css += "}";
|
|
346
|
-
}
|
|
347
|
-
if (obj.supports) {
|
|
348
|
-
css += "}";
|
|
349
|
-
}
|
|
350
|
-
var sourceMap = obj.sourceMap;
|
|
351
|
-
if (sourceMap && typeof btoa !== "undefined") {
|
|
352
|
-
css += "\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), " */");
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
// For old IE
|
|
356
|
-
/* istanbul ignore if */
|
|
357
|
-
options.styleTagTransform(css, styleElement, options.options);
|
|
358
|
-
}
|
|
359
|
-
function removeStyleElement(styleElement) {
|
|
360
|
-
// istanbul ignore if
|
|
361
|
-
if (styleElement.parentNode === null) {
|
|
362
|
-
return false;
|
|
363
|
-
}
|
|
364
|
-
styleElement.parentNode.removeChild(styleElement);
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
/* istanbul ignore next */
|
|
368
|
-
function domAPI(options) {
|
|
369
|
-
if (typeof document === "undefined") {
|
|
370
|
-
return {
|
|
371
|
-
update: function update() {},
|
|
372
|
-
remove: function remove() {}
|
|
373
|
-
};
|
|
374
|
-
}
|
|
375
|
-
var styleElement = options.insertStyleElement(options);
|
|
376
|
-
return {
|
|
377
|
-
update: function update(obj) {
|
|
378
|
-
apply(styleElement, options, obj);
|
|
379
|
-
},
|
|
380
|
-
remove: function remove() {
|
|
381
|
-
removeStyleElement(styleElement);
|
|
382
|
-
}
|
|
383
|
-
};
|
|
384
|
-
}
|
|
385
|
-
module.exports = domAPI;
|
|
386
|
-
|
|
387
|
-
/***/ }),
|
|
388
|
-
|
|
389
|
-
/***/ 113:
|
|
390
|
-
/***/ ((module) => {
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
/* istanbul ignore next */
|
|
395
|
-
function styleTagTransform(css, styleElement) {
|
|
396
|
-
if (styleElement.styleSheet) {
|
|
397
|
-
styleElement.styleSheet.cssText = css;
|
|
398
|
-
} else {
|
|
399
|
-
while (styleElement.firstChild) {
|
|
400
|
-
styleElement.removeChild(styleElement.firstChild);
|
|
401
|
-
}
|
|
402
|
-
styleElement.appendChild(document.createTextNode(css));
|
|
403
|
-
}
|
|
404
|
-
}
|
|
405
|
-
module.exports = styleTagTransform;
|
|
406
|
-
|
|
407
|
-
/***/ })
|
|
408
|
-
|
|
409
|
-
/******/ });
|
|
410
|
-
/************************************************************************/
|
|
411
|
-
/******/ // The module cache
|
|
412
|
-
/******/ var __webpack_module_cache__ = {};
|
|
413
|
-
/******/
|
|
414
|
-
/******/ // The require function
|
|
415
|
-
/******/ function __webpack_require__(moduleId) {
|
|
416
|
-
/******/ // Check if module is in cache
|
|
417
|
-
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
|
418
|
-
/******/ if (cachedModule !== undefined) {
|
|
419
|
-
/******/ return cachedModule.exports;
|
|
420
|
-
/******/ }
|
|
421
|
-
/******/ // Create a new module (and put it into the cache)
|
|
422
|
-
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
423
|
-
/******/ id: moduleId,
|
|
424
|
-
/******/ // no module.loaded needed
|
|
425
|
-
/******/ exports: {}
|
|
426
|
-
/******/ };
|
|
427
|
-
/******/
|
|
428
|
-
/******/ // Execute the module function
|
|
429
|
-
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
430
|
-
/******/
|
|
431
|
-
/******/ // Return the exports of the module
|
|
432
|
-
/******/ return module.exports;
|
|
433
|
-
/******/ }
|
|
434
|
-
/******/
|
|
435
|
-
/************************************************************************/
|
|
436
|
-
/******/ /* webpack/runtime/compat get default export */
|
|
437
|
-
/******/ (() => {
|
|
438
|
-
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
439
|
-
/******/ __webpack_require__.n = (module) => {
|
|
440
|
-
/******/ var getter = module && module.__esModule ?
|
|
441
|
-
/******/ () => (module['default']) :
|
|
442
|
-
/******/ () => (module);
|
|
443
|
-
/******/ __webpack_require__.d(getter, { a: getter });
|
|
444
|
-
/******/ return getter;
|
|
445
|
-
/******/ };
|
|
446
|
-
/******/ })();
|
|
447
|
-
/******/
|
|
448
|
-
/******/ /* webpack/runtime/define property getters */
|
|
449
|
-
/******/ (() => {
|
|
450
|
-
/******/ // define getter functions for harmony exports
|
|
451
|
-
/******/ __webpack_require__.d = (exports, definition) => {
|
|
452
|
-
/******/ for(var key in definition) {
|
|
453
|
-
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
454
|
-
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
455
|
-
/******/ }
|
|
456
|
-
/******/ }
|
|
457
|
-
/******/ };
|
|
458
|
-
/******/ })();
|
|
459
|
-
/******/
|
|
460
|
-
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
461
|
-
/******/ (() => {
|
|
462
|
-
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
463
|
-
/******/ })();
|
|
464
|
-
/******/
|
|
465
|
-
/******/ /* webpack/runtime/nonce */
|
|
466
|
-
/******/ (() => {
|
|
467
|
-
/******/ __webpack_require__.nc = undefined;
|
|
468
|
-
/******/ })();
|
|
469
|
-
/******/
|
|
470
|
-
/************************************************************************/
|
|
471
|
-
var __webpack_exports__ = {};
|
|
472
|
-
|
|
473
|
-
// EXPORTS
|
|
474
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
475
|
-
nC: () => (/* reexport */ JS_API),
|
|
476
|
-
mI: () => (/* reexport */ createDOMNodeReference),
|
|
477
|
-
xq: () => (/* reexport */ createMultipleDOMNodeReferences)
|
|
478
|
-
});
|
|
479
|
-
|
|
480
|
-
;// ./src/JS/safeAjax.js
|
|
481
|
-
function safeAjax(ajaxOptions) {
|
|
482
|
-
var deferredAjax = $.Deferred();
|
|
483
|
-
|
|
484
|
-
// shell is only available via runtime in a PowerPages portal
|
|
485
|
-
//eslint-disable-next-line
|
|
486
|
-
shell.getTokenDeferred().done(function (token) {
|
|
487
|
-
// add headers for AJAX
|
|
488
|
-
if (!ajaxOptions.headers) {
|
|
489
|
-
$.extend(ajaxOptions, {
|
|
490
|
-
headers: {
|
|
491
|
-
__RequestVerificationToken: token
|
|
492
|
-
}
|
|
493
|
-
});
|
|
494
|
-
} else {
|
|
495
|
-
ajaxOptions.headers["__RequestVerificationToken"] = token;
|
|
496
|
-
}
|
|
497
|
-
$.ajax(ajaxOptions).done(function (data, textStatus, jqXHR) {
|
|
498
|
-
//eslint-disable-next-line
|
|
499
|
-
validateLoginSession(data, textStatus, jqXHR, deferredAjax.resolve);
|
|
500
|
-
}).fail(deferredAjax.reject); //AJAX
|
|
501
|
-
}).fail(function () {
|
|
502
|
-
deferredAjax.rejectWith(this, arguments); // on token failure pass the token AJAX and args
|
|
503
|
-
});
|
|
504
|
-
return deferredAjax.promise();
|
|
505
|
-
}
|
|
506
|
-
;// ./src/JS/API.js
|
|
507
|
-
|
|
508
|
-
var API = {
|
|
509
|
-
/**
|
|
510
|
-
*
|
|
511
|
-
* @param {Class} schema an instance of a schema class, containing the desired information for the POST request
|
|
512
|
-
* @returns a Promise resolving the successful results *[record id]* of the POST request, or rejecting the failed results *[error]* of the POST request.
|
|
513
|
-
*/
|
|
514
|
-
createRecord: function createRecord(schema) {
|
|
515
|
-
return new Promise(function (resolve, reject) {
|
|
516
|
-
safeAjax({
|
|
517
|
-
type: "POST",
|
|
518
|
-
url: "/_api/".concat(schema.logicalName()),
|
|
519
|
-
data: schema.value(),
|
|
520
|
-
contentType: "application/json",
|
|
521
|
-
success: function success(response, status, xhr) {
|
|
522
|
-
resolve(xhr.getResponseHeader("entityid"));
|
|
523
|
-
},
|
|
524
|
-
error: function error(_error) {
|
|
525
|
-
reject(_error);
|
|
526
|
-
}
|
|
527
|
-
});
|
|
528
|
-
});
|
|
529
|
-
},
|
|
530
|
-
/**
|
|
531
|
-
*
|
|
532
|
-
* @param {string} tableSetName The DataVerse SET name of the table being queried
|
|
533
|
-
* @param {string} recordID the GUID of the records to be retrieved
|
|
534
|
-
* @param {string} selectColumns *OPTIONAL* if desired, enter your own custom OData query for advanced GET results. Format = select=column1,column2,column3...
|
|
535
|
-
* @returns a Promise resolving the successful results of the GET request, or rejecting the failed results of the GET request
|
|
536
|
-
*/
|
|
537
|
-
getRecord: function getRecord(tableSetName, recordID, selectColumns) {
|
|
538
|
-
return new Promise(function (resolve, reject) {
|
|
539
|
-
var url = "/_api/".concat(tableSetName, "(").concat(recordID, ")").concat(selectColumns ? "?$".concat(selectColumns) : "");
|
|
540
|
-
safeAjax({
|
|
541
|
-
type: "GET",
|
|
542
|
-
url: url,
|
|
543
|
-
success: resolve,
|
|
544
|
-
error: reject
|
|
545
|
-
});
|
|
546
|
-
});
|
|
547
|
-
},
|
|
548
|
-
/**
|
|
549
|
-
*
|
|
550
|
-
* @param {String} tableSetName The DataVerse SET name of the table being queried
|
|
551
|
-
* @param {String} queryParameters *OPTIONAL* the OData query parameters for refining search results: *format = $filter=filters&$select=columns*
|
|
552
|
-
* @returns a Promise resolving the successful results of the GET request, or rejecting the failed results of the GET request
|
|
553
|
-
*/
|
|
554
|
-
getMultiple: function getMultiple(tableSetName, queryParameters) {
|
|
555
|
-
return new Promise(function (resolve, reject) {
|
|
556
|
-
// Construct the URL based on the presence of query parameters
|
|
557
|
-
var url = "/_api/".concat(tableSetName).concat(queryParameters ? "?".concat(queryParameters) : "");
|
|
558
|
-
safeAjax({
|
|
559
|
-
type: "GET",
|
|
560
|
-
url: url,
|
|
561
|
-
success: function success(response) {
|
|
562
|
-
resolve(response.value);
|
|
563
|
-
},
|
|
564
|
-
error: reject
|
|
565
|
-
});
|
|
566
|
-
});
|
|
567
|
-
}
|
|
568
|
-
};
|
|
569
|
-
/* harmony default export */ const JS_API = (API);
|
|
570
|
-
;// ./src/JS/waitFor.js
|
|
571
|
-
/**
|
|
572
|
-
* @description a function that will wait for a targeted element to appear in the DOM, and then resolve a promise to allow further action to be performed after the targeted elements appears
|
|
573
|
-
* @param {String} target a query target expression to target a specific element that you want to appear in the DOM before taking further action
|
|
574
|
-
* @returns {Promise} the element targeted by ID *target*
|
|
575
|
-
*/
|
|
576
|
-
|
|
577
|
-
function waitFor(target) {
|
|
578
|
-
return new Promise(function (resolve) {
|
|
579
|
-
if (target instanceof HTMLElement) {
|
|
580
|
-
return resolve(target);
|
|
581
|
-
}
|
|
582
|
-
if (document.querySelector(target)) {
|
|
583
|
-
return resolve(document.querySelector(target));
|
|
584
|
-
}
|
|
585
|
-
var observer = new MutationObserver(function () {
|
|
586
|
-
if (document.querySelector(target)) {
|
|
587
|
-
observer.disconnect();
|
|
588
|
-
resolve(document.querySelector(target));
|
|
589
|
-
}
|
|
590
|
-
});
|
|
591
|
-
observer.observe(document.body, {
|
|
592
|
-
subtree: true,
|
|
593
|
-
attributes: true
|
|
594
|
-
});
|
|
595
|
-
});
|
|
596
|
-
}
|
|
597
|
-
;// ./src/JS/FieldValidation.class.js
|
|
598
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
599
|
-
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
600
|
-
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
601
|
-
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
602
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
603
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
604
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
605
|
-
var FieldValidation = /*#__PURE__*/_createClass(function FieldValidation(fieldLogicalName, fieldDisplayname, evaluationFunction) {
|
|
606
|
-
_classCallCheck(this, FieldValidation);
|
|
607
|
-
_defineProperty(this, "createValidator", function () {
|
|
608
|
-
if (typeof Page_Validators == "undefined") return;
|
|
609
|
-
// Create new validator
|
|
610
|
-
var newValidator = document.createElement("span");
|
|
611
|
-
newValidator.style.display = "none";
|
|
612
|
-
newValidator.id = "".concat(this.fieldLogicalName, "Validator");
|
|
613
|
-
newValidator.controltovalidate = "".concat(this.fieldLogicalName);
|
|
614
|
-
newValidator.errormessage = "<a href='#".concat(this.fieldDisplayname, "_label'>").concat(this.fieldDisplayname, " is a required field</a>");
|
|
615
|
-
newValidator.validationGroup = ""; // Set this if you have set ValidationGroup on the form
|
|
616
|
-
newValidator.initialvalue = "";
|
|
617
|
-
newValidator.evaluationfunction = this.evaluationFunction;
|
|
618
|
-
// Add the new validator to the page validators array:
|
|
619
|
-
// eslint-disable-next-line no-undef
|
|
620
|
-
Page_Validators.push(newValidator);
|
|
621
|
-
});
|
|
622
|
-
this.fieldLogicalName = fieldLogicalName;
|
|
623
|
-
this.fieldDisplayname = fieldDisplayname;
|
|
624
|
-
this.evaluationFunction = evaluationFunction.bind(this);
|
|
625
|
-
this.createValidator();
|
|
626
|
-
});
|
|
627
|
-
|
|
628
|
-
// EXTERNAL MODULE: ./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js
|
|
629
|
-
var injectStylesIntoStyleTag = __webpack_require__(72);
|
|
630
|
-
var injectStylesIntoStyleTag_default = /*#__PURE__*/__webpack_require__.n(injectStylesIntoStyleTag);
|
|
631
|
-
// EXTERNAL MODULE: ./node_modules/style-loader/dist/runtime/styleDomAPI.js
|
|
632
|
-
var styleDomAPI = __webpack_require__(825);
|
|
633
|
-
var styleDomAPI_default = /*#__PURE__*/__webpack_require__.n(styleDomAPI);
|
|
634
|
-
// EXTERNAL MODULE: ./node_modules/style-loader/dist/runtime/insertBySelector.js
|
|
635
|
-
var insertBySelector = __webpack_require__(659);
|
|
636
|
-
var insertBySelector_default = /*#__PURE__*/__webpack_require__.n(insertBySelector);
|
|
637
|
-
// EXTERNAL MODULE: ./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js
|
|
638
|
-
var setAttributesWithoutAttributes = __webpack_require__(56);
|
|
639
|
-
var setAttributesWithoutAttributes_default = /*#__PURE__*/__webpack_require__.n(setAttributesWithoutAttributes);
|
|
640
|
-
// EXTERNAL MODULE: ./node_modules/style-loader/dist/runtime/insertStyleElement.js
|
|
641
|
-
var insertStyleElement = __webpack_require__(540);
|
|
642
|
-
var insertStyleElement_default = /*#__PURE__*/__webpack_require__.n(insertStyleElement);
|
|
643
|
-
// EXTERNAL MODULE: ./node_modules/style-loader/dist/runtime/styleTagTransform.js
|
|
644
|
-
var styleTagTransform = __webpack_require__(113);
|
|
645
|
-
var styleTagTransform_default = /*#__PURE__*/__webpack_require__.n(styleTagTransform);
|
|
646
|
-
// EXTERNAL MODULE: ./node_modules/css-loader/dist/cjs.js!./src/CSS/infoEl.style.css
|
|
647
|
-
var infoEl_style = __webpack_require__(693);
|
|
648
|
-
;// ./src/CSS/infoEl.style.css
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
var options = {};
|
|
661
|
-
|
|
662
|
-
options.styleTagTransform = (styleTagTransform_default());
|
|
663
|
-
options.setAttributes = (setAttributesWithoutAttributes_default());
|
|
664
|
-
options.insert = insertBySelector_default().bind(null, "head");
|
|
665
|
-
options.domAPI = (styleDomAPI_default());
|
|
666
|
-
options.insertStyleElement = (insertStyleElement_default());
|
|
667
|
-
|
|
668
|
-
var update = injectStylesIntoStyleTag_default()(infoEl_style/* default */.A, options);
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
/* harmony default export */ const CSS_infoEl_style = (infoEl_style/* default */.A && infoEl_style/* default */.A.locals ? infoEl_style/* default */.A.locals : undefined);
|
|
674
|
-
|
|
675
|
-
;// ./src/JS/createInfoElement.js
|
|
676
|
-
// Import the CSS file
|
|
677
|
-
|
|
678
|
-
function CreateInfoEl(titleString) {
|
|
679
|
-
var span = document.createElement("span");
|
|
680
|
-
span.classList.add("info-icon");
|
|
681
|
-
var icon = document.createElement("i");
|
|
682
|
-
icon.classList.add("fa", "fa-solid", "fa-info-circle");
|
|
683
|
-
icon.setAttribute("aria-label", "Info");
|
|
684
|
-
icon.style.cursor = "pointer";
|
|
685
|
-
var flyoutContent = document.createElement("div");
|
|
686
|
-
flyoutContent.innerHTML = titleString;
|
|
687
|
-
flyoutContent.classList.add("flyout-content");
|
|
688
|
-
span.appendChild(icon);
|
|
689
|
-
span.appendChild(flyoutContent);
|
|
690
|
-
|
|
691
|
-
// Function to position flyout content
|
|
692
|
-
var positionFlyout = function positionFlyout() {
|
|
693
|
-
flyoutContent.style.display = "block"; // Show the flyout to calculate dimensions
|
|
694
|
-
|
|
695
|
-
var flyoutRect = flyoutContent.getBoundingClientRect();
|
|
696
|
-
var viewportWidth = window.innerWidth;
|
|
697
|
-
|
|
698
|
-
// Position the flyout
|
|
699
|
-
|
|
700
|
-
// Adjust if flyout is too far to the right
|
|
701
|
-
if (flyoutRect.right > viewportWidth) {
|
|
702
|
-
var overflowAmount = flyoutRect.right - viewportWidth;
|
|
703
|
-
flyoutContent.style.left = "calc(50% - ".concat(overflowAmount, "px)"); // Shift left
|
|
704
|
-
}
|
|
705
|
-
|
|
706
|
-
// Adjust if flyout is too far to the left
|
|
707
|
-
if (flyoutRect.left < 0) {
|
|
708
|
-
var _overflowAmount = Math.abs(flyoutRect.left);
|
|
709
|
-
flyoutContent.style.left = "calc(50% + ".concat(_overflowAmount, "px)"); // Shift right
|
|
710
|
-
}
|
|
711
|
-
};
|
|
712
|
-
icon.addEventListener("mouseenter", positionFlyout);
|
|
713
|
-
icon.addEventListener("mouseleave", function () {
|
|
714
|
-
flyoutContent.style.display = "none"; // Hide on mouse leave
|
|
715
|
-
});
|
|
716
|
-
icon.addEventListener("touchstart", function (event) {
|
|
717
|
-
event.preventDefault();
|
|
718
|
-
// Toggle flyout visibility on touch
|
|
719
|
-
flyoutContent.style.display = flyoutContent.style.display === "block" ? "none" : "block";
|
|
720
|
-
if (flyoutContent.style.display === "block") {
|
|
721
|
-
positionFlyout(); // Position the flyout when displayed
|
|
722
|
-
}
|
|
723
|
-
});
|
|
724
|
-
document.body.addEventListener("click", function (event) {
|
|
725
|
-
if (!span.contains(event.target)) {
|
|
726
|
-
flyoutContent.style.display = "none"; // Hide on body click
|
|
727
|
-
}
|
|
728
|
-
});
|
|
729
|
-
return span;
|
|
730
|
-
}
|
|
731
|
-
;// ./src/JS/DOMNodeReferences.js
|
|
732
|
-
function DOMNodeReferences_typeof(o) { "@babel/helpers - typeof"; return DOMNodeReferences_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, DOMNodeReferences_typeof(o); }
|
|
733
|
-
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == DOMNodeReferences_typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(DOMNodeReferences_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
734
|
-
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
|
|
735
|
-
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
|
|
736
|
-
function DOMNodeReferences_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
737
|
-
function DOMNodeReferences_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, DOMNodeReferences_toPropertyKey(o.key), o); } }
|
|
738
|
-
function DOMNodeReferences_createClass(e, r, t) { return r && DOMNodeReferences_defineProperties(e.prototype, r), t && DOMNodeReferences_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
739
|
-
function DOMNodeReferences_toPropertyKey(t) { var i = DOMNodeReferences_toPrimitive(t, "string"); return "symbol" == DOMNodeReferences_typeof(i) ? i : i + ""; }
|
|
740
|
-
function DOMNodeReferences_toPrimitive(t, r) { if ("object" != DOMNodeReferences_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != DOMNodeReferences_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
/**
|
|
746
|
-
* Class representing a reference to a DOM node.
|
|
747
|
-
*/
|
|
748
|
-
/******/ /******/ /******/
|
|
749
|
-
var DOMNodeReference = /*#__PURE__*/function () {
|
|
750
|
-
/**
|
|
751
|
-
* Creates an instance of DOMNodeReference.
|
|
752
|
-
* @param {string} target - The CSS selector to find the desired DOM element.
|
|
753
|
-
*/
|
|
754
|
-
/******/ /******/
|
|
755
|
-
function DOMNodeReference(target) {
|
|
756
|
-
DOMNodeReferences_classCallCheck(this, DOMNodeReference);
|
|
757
|
-
this.target = target;
|
|
758
|
-
this.element = null;
|
|
759
|
-
this.isLoaded = false;
|
|
760
|
-
this.visibilityController = null;
|
|
761
|
-
this.defaultDisplay = "";
|
|
762
|
-
this.value = null;
|
|
763
|
-
// we defer the rest of initialization
|
|
764
|
-
}
|
|
765
|
-
|
|
766
|
-
/**
|
|
767
|
-
* Initializes the DOMNodeReference instance by waiting for the element to be available in the DOM.
|
|
768
|
-
*/
|
|
769
|
-
/******/ /******/
|
|
770
|
-
return DOMNodeReferences_createClass(DOMNodeReference, [{
|
|
771
|
-
key: "init",
|
|
772
|
-
value: (function () {
|
|
773
|
-
var _init = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
774
|
-
var _this = this;
|
|
775
|
-
var element;
|
|
776
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
777
|
-
while (1) switch (_context.prev = _context.next) {
|
|
778
|
-
case 0:
|
|
779
|
-
_context.prev = 0;
|
|
780
|
-
_context.next = 3;
|
|
781
|
-
return waitFor(this.target);
|
|
782
|
-
case 3:
|
|
783
|
-
element = _context.sent;
|
|
784
|
-
this.element = element;
|
|
785
|
-
if (this.element) {
|
|
786
|
-
_context.next = 7;
|
|
787
|
-
break;
|
|
788
|
-
}
|
|
789
|
-
throw new Error("[SYNACT] No Element could be found with the provided query selector: ".concat(this.target));
|
|
790
|
-
case 7:
|
|
791
|
-
this.value = this.element.value;
|
|
792
|
-
if (!this.element.classList.contains("boolean-radio")) {
|
|
793
|
-
_context.next = 15;
|
|
794
|
-
break;
|
|
795
|
-
}
|
|
796
|
-
_context.next = 11;
|
|
797
|
-
return createDOMNodeReference("#".concat(this.element.id, "_1"));
|
|
798
|
-
case 11:
|
|
799
|
-
this.yesRadio = _context.sent;
|
|
800
|
-
_context.next = 14;
|
|
801
|
-
return createDOMNodeReference("#".concat(this.element.id, "_0"));
|
|
802
|
-
case 14:
|
|
803
|
-
this.noRadio = _context.sent;
|
|
804
|
-
case 15:
|
|
805
|
-
this.element.addEventListener("change", function () {
|
|
806
|
-
_this.value = _this.element.value;
|
|
807
|
-
});
|
|
808
|
-
|
|
809
|
-
// based on the type of element we have targeted in instantiation
|
|
810
|
-
// we now grab the parent element that will be responsible for
|
|
811
|
-
// 'showing' and 'hiding' the target element
|
|
812
|
-
// this is needed also in order to observe changes to visibility so that
|
|
813
|
-
// changes to target can cascade to dependent DOMNodeReferences
|
|
814
|
-
_context.t0 = this.element.tagName;
|
|
815
|
-
_context.next = _context.t0 === "SPAN" ? 19 : _context.t0 === "INPUT" ? 19 : _context.t0 === "TEXTAREA" ? 19 : _context.t0 === "SELECT" ? 19 : _context.t0 === "FIELDSET" ? 21 : 21;
|
|
816
|
-
break;
|
|
817
|
-
case 19:
|
|
818
|
-
this.visibilityController = this.element.closest("td");
|
|
819
|
-
return _context.abrupt("break", 22);
|
|
820
|
-
case 21:
|
|
821
|
-
this.visibilityController = this.element;
|
|
822
|
-
case 22:
|
|
823
|
-
this.defaultDisplay = this.visibilityController.style.display;
|
|
824
|
-
this.isLoaded = true;
|
|
825
|
-
_context.next = 29;
|
|
826
|
-
break;
|
|
827
|
-
case 26:
|
|
828
|
-
_context.prev = 26;
|
|
829
|
-
_context.t1 = _context["catch"](0);
|
|
830
|
-
throw new Error("powerpagestoolkit: There was an error initializing a DOMNodeReference with the target: ".concat(this.target, " :: ").concat(_context.t1));
|
|
831
|
-
case 29:
|
|
832
|
-
case "end":
|
|
833
|
-
return _context.stop();
|
|
834
|
-
}
|
|
835
|
-
}, _callee, this, [[0, 26]]);
|
|
836
|
-
}));
|
|
837
|
-
function init() {
|
|
838
|
-
return _init.apply(this, arguments);
|
|
839
|
-
}
|
|
840
|
-
return init;
|
|
841
|
-
}()
|
|
842
|
-
/**
|
|
843
|
-
* Hides the element by setting its display style to "none".
|
|
844
|
-
* @method hide
|
|
845
|
-
*/
|
|
846
|
-
/******/
|
|
847
|
-
)
|
|
848
|
-
}, {
|
|
849
|
-
key: "hide",
|
|
850
|
-
value: function hide() {
|
|
851
|
-
this.visibilityController.style.display = "none";
|
|
852
|
-
}
|
|
853
|
-
|
|
854
|
-
/**
|
|
855
|
-
* Shows the element by restoring its default display style.
|
|
856
|
-
* @method show
|
|
857
|
-
*/
|
|
858
|
-
/******/
|
|
859
|
-
}, {
|
|
860
|
-
key: "show",
|
|
861
|
-
value: function show() {
|
|
862
|
-
this.visibilityController.style.display = this.defaultDisplay;
|
|
863
|
-
}
|
|
864
|
-
|
|
865
|
-
/**
|
|
866
|
-
* Sets the value of the HTML element.
|
|
867
|
-
* @method setValue
|
|
868
|
-
* @param {string} value - The value to set for the HTML element.
|
|
869
|
-
*/
|
|
870
|
-
/******/
|
|
871
|
-
}, {
|
|
872
|
-
key: "setValue",
|
|
873
|
-
value: function setValue(value) {
|
|
874
|
-
this.element.value = value;
|
|
875
|
-
}
|
|
876
|
-
|
|
877
|
-
/**
|
|
878
|
-
* Appends child elements to the HTML element.
|
|
879
|
-
* @method append
|
|
880
|
-
* @param {...HTMLElement} elements - The elements to append to the HTML element.
|
|
881
|
-
*/
|
|
882
|
-
/******/
|
|
883
|
-
}, {
|
|
884
|
-
key: "append",
|
|
885
|
-
value: function append() {
|
|
886
|
-
var _this$element;
|
|
887
|
-
(_this$element = this.element).append.apply(_this$element, arguments);
|
|
888
|
-
}
|
|
889
|
-
|
|
890
|
-
/**
|
|
891
|
-
* Inserts elements after the HTML element.
|
|
892
|
-
* @method after
|
|
893
|
-
* @param {...HTMLElement} elements - The elements to insert after the HTML element.
|
|
894
|
-
*/
|
|
895
|
-
/******/
|
|
896
|
-
}, {
|
|
897
|
-
key: "after",
|
|
898
|
-
value: function after() {
|
|
899
|
-
var _this$element2;
|
|
900
|
-
(_this$element2 = this.element).after.apply(_this$element2, arguments);
|
|
901
|
-
}
|
|
902
|
-
|
|
903
|
-
/**
|
|
904
|
-
* Retrieves the label associated with the HTML element.
|
|
905
|
-
* @method getLabel
|
|
906
|
-
* @returns {HTMLElement} The label element associated with this element.
|
|
907
|
-
* @throws {Error} Throws an error if the label cannot be found.
|
|
908
|
-
*/
|
|
909
|
-
/******/
|
|
910
|
-
}, {
|
|
911
|
-
key: "getLabel",
|
|
912
|
-
value: function getLabel() {
|
|
913
|
-
return document.querySelector("#".concat(this.element.id, "_label")) || null;
|
|
914
|
-
}
|
|
915
|
-
|
|
916
|
-
/**
|
|
917
|
-
* Appends child elements to the label associated with the HTML element.
|
|
918
|
-
* @method appendToLabel
|
|
919
|
-
* @param {...HTMLElement} elements - The elements to append to the label.
|
|
920
|
-
*/
|
|
921
|
-
/******/
|
|
922
|
-
}, {
|
|
923
|
-
key: "appendToLabel",
|
|
924
|
-
value: function appendToLabel() {
|
|
925
|
-
var label = this.getLabel();
|
|
926
|
-
if (label) {
|
|
927
|
-
for (var _len = arguments.length, elements = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
928
|
-
elements[_key] = arguments[_key];
|
|
929
|
-
}
|
|
930
|
-
label.append.apply(label, [" "].concat(elements));
|
|
931
|
-
}
|
|
932
|
-
}
|
|
933
|
-
|
|
934
|
-
/**
|
|
935
|
-
* Adds a click event listener to the HTML element.
|
|
936
|
-
* @method addClickListener
|
|
937
|
-
* @param {Function} eventHandler - The function to execute when the element is clicked.
|
|
938
|
-
*/
|
|
939
|
-
/******/
|
|
940
|
-
}, {
|
|
941
|
-
key: "addClickListener",
|
|
942
|
-
value: function addClickListener(eventHandler) {
|
|
943
|
-
this.element.addEventListener("click", function (e) {
|
|
944
|
-
e.preventDefault();
|
|
945
|
-
eventHandler();
|
|
946
|
-
});
|
|
947
|
-
}
|
|
948
|
-
|
|
949
|
-
/**
|
|
950
|
-
* Adds a change event listener to the HTML element.
|
|
951
|
-
* @method addChangeListener
|
|
952
|
-
* @param {Function} eventHandler - The function to execute when the element's value changes.
|
|
953
|
-
*/
|
|
954
|
-
/******/
|
|
955
|
-
}, {
|
|
956
|
-
key: "addChangeListener",
|
|
957
|
-
value: function addChangeListener(eventHandler) {
|
|
958
|
-
this.element.addEventListener("change", function (e) {
|
|
959
|
-
e.preventDefault();
|
|
960
|
-
eventHandler();
|
|
961
|
-
});
|
|
962
|
-
}
|
|
963
|
-
|
|
964
|
-
/**
|
|
965
|
-
* Unchecks both the yes and no radio buttons if they exist.
|
|
966
|
-
* @method uncheckRadios
|
|
967
|
-
*/
|
|
968
|
-
/******/
|
|
969
|
-
}, {
|
|
970
|
-
key: "uncheckRadios",
|
|
971
|
-
value: function uncheckRadios() {
|
|
972
|
-
if (this.yesRadio && this.noRadio) {
|
|
973
|
-
this.yesRadio.element.checked = false;
|
|
974
|
-
this.noRadio.element.checked = false;
|
|
975
|
-
} else {
|
|
976
|
-
console.error("[SYNACT] Attempted to uncheck radios for an element that has no radios");
|
|
977
|
-
}
|
|
978
|
-
}
|
|
979
|
-
|
|
980
|
-
/**
|
|
981
|
-
* Creates a validation instance for the field.
|
|
982
|
-
* @method createValidation
|
|
983
|
-
* @param {Function} evaluationFunction - The function used to evaluate the field.
|
|
984
|
-
* @param {string} fieldDisplayName - The field name to display in error if validation fails.
|
|
985
|
-
*/
|
|
986
|
-
/******/
|
|
987
|
-
}, {
|
|
988
|
-
key: "createValidation",
|
|
989
|
-
value: function createValidation(evaluationFunction, fieldDisplayName) {
|
|
990
|
-
new FieldValidation(this.id, "'".concat(fieldDisplayName, "'"), evaluationFunction);
|
|
991
|
-
}
|
|
992
|
-
|
|
993
|
-
/**
|
|
994
|
-
* Adds a tooltip with specified text to the label associated with the HTML element.
|
|
995
|
-
* @method addLabelTooltip
|
|
996
|
-
* @param {string} text - The text to display in the tooltip.
|
|
997
|
-
*/
|
|
998
|
-
/******/
|
|
999
|
-
}, {
|
|
1000
|
-
key: "addLabelTooltip",
|
|
1001
|
-
value: function addLabelTooltip(text) {
|
|
1002
|
-
this.appendToLabel(CreateInfoEl(text));
|
|
1003
|
-
}
|
|
1004
|
-
|
|
1005
|
-
/******/
|
|
1006
|
-
}, {
|
|
1007
|
-
key: "addToolTip",
|
|
1008
|
-
value: function addToolTip(text) {
|
|
1009
|
-
this.append(CreateInfoEl(text));
|
|
1010
|
-
}
|
|
1011
|
-
|
|
1012
|
-
/**
|
|
1013
|
-
* Sets the inner HTML content of the HTML element.
|
|
1014
|
-
* @method setTextContent
|
|
1015
|
-
* @param {string} text - The text to set as the inner HTML of the element.
|
|
1016
|
-
*/
|
|
1017
|
-
/******/
|
|
1018
|
-
}, {
|
|
1019
|
-
key: "setTextContent",
|
|
1020
|
-
value: function setTextContent(text) {
|
|
1021
|
-
this.element.innerHTML = text;
|
|
1022
|
-
}
|
|
1023
|
-
|
|
1024
|
-
/**
|
|
1025
|
-
*
|
|
1026
|
-
* @param {boolean} shouldShow shows or hides the target
|
|
1027
|
-
* if = true => show, if = false => hide
|
|
1028
|
-
*/
|
|
1029
|
-
}, {
|
|
1030
|
-
key: "toggleVisibility",
|
|
1031
|
-
value: function toggleVisibility(shouldShow) {
|
|
1032
|
-
shouldShow ? this.show() : this.hide();
|
|
1033
|
-
}
|
|
1034
|
-
|
|
1035
|
-
/**
|
|
1036
|
-
*
|
|
1037
|
-
* @param {Function} condition A Function that return a boolean value to set the
|
|
1038
|
-
* visibility of the targeted element. if condition() returns true, element is shown.
|
|
1039
|
-
* If false, element is hidden
|
|
1040
|
-
* @param {DOMNodeReference} triggerNode The DOMNodeReference to which an
|
|
1041
|
-
* event listener will be registered to change the visibility state of the calling
|
|
1042
|
-
* DOMNodeReference
|
|
1043
|
-
*/
|
|
1044
|
-
/******/
|
|
1045
|
-
}, {
|
|
1046
|
-
key: "configureConditionalRendering",
|
|
1047
|
-
value: function configureConditionalRendering(condition, triggerNode) {
|
|
1048
|
-
var _this2 = this;
|
|
1049
|
-
this.toggleVisibility(condition());
|
|
1050
|
-
if (triggerNode) {
|
|
1051
|
-
triggerNode.addChangeListener(function () {
|
|
1052
|
-
_this2.toggleVisibility(condition());
|
|
1053
|
-
});
|
|
1054
|
-
var observer = new MutationObserver(function () {
|
|
1055
|
-
var display = window.getComputedStyle(triggerNode.visibilityController).display;
|
|
1056
|
-
_this2.toggleVisibility(display !== "none" && condition());
|
|
1057
|
-
});
|
|
1058
|
-
observer.observe(triggerNode.visibilityController, {
|
|
1059
|
-
attributes: true,
|
|
1060
|
-
attributeFilter: ["style"]
|
|
1061
|
-
});
|
|
1062
|
-
}
|
|
1063
|
-
}
|
|
1064
|
-
|
|
1065
|
-
/**
|
|
1066
|
-
* Executes a callback function once the element is fully loaded.
|
|
1067
|
-
* If the element is already loaded, the callback is called immediately.
|
|
1068
|
-
* Otherwise, a MutationObserver is used to detect when the element is added to the DOM.
|
|
1069
|
-
* @method onceLoaded
|
|
1070
|
-
* @param {Function} callback - A callback function to execute once the element is loaded.
|
|
1071
|
-
*/
|
|
1072
|
-
/******/
|
|
1073
|
-
}, {
|
|
1074
|
-
key: "onceLoaded",
|
|
1075
|
-
value: function onceLoaded(callback) {
|
|
1076
|
-
var _this3 = this;
|
|
1077
|
-
if (this.isLoaded) {
|
|
1078
|
-
callback(this);
|
|
1079
|
-
} else {
|
|
1080
|
-
var observer = new MutationObserver(function () {
|
|
1081
|
-
if (document.querySelector(_this3.target)) {
|
|
1082
|
-
observer.disconnect(); // Stop observing once loaded
|
|
1083
|
-
_this3.isLoaded = true;
|
|
1084
|
-
callback(_this3); // Call the provided callback
|
|
1085
|
-
}
|
|
1086
|
-
});
|
|
1087
|
-
observer.observe(document.body, {
|
|
1088
|
-
subtree: true,
|
|
1089
|
-
childList: true
|
|
1090
|
-
});
|
|
1091
|
-
}
|
|
1092
|
-
}
|
|
1093
|
-
}]);
|
|
1094
|
-
}();
|
|
1095
|
-
/**
|
|
1096
|
-
* Creates and initializes a DOMNodeReference instance.
|
|
1097
|
-
* @async
|
|
1098
|
-
* @function createDOMNodeReference
|
|
1099
|
-
* @param {string | HTMLElement} target - The CSS selector for the desired DOM element.
|
|
1100
|
-
* @returns {Promise<DOMNodeReference>} A promise that resolves to a Proxy of the initialized DOMNodeReference instance.
|
|
1101
|
-
*/
|
|
1102
|
-
function createDOMNodeReference(_x) {
|
|
1103
|
-
return _createDOMNodeReference.apply(this, arguments);
|
|
1104
|
-
}
|
|
1105
|
-
|
|
1106
|
-
/**
|
|
1107
|
-
* Creates and initializes multiple DOMNodeReference instances.
|
|
1108
|
-
* @async
|
|
1109
|
-
* @function createMultipleDOMNodeReferences
|
|
1110
|
-
* @param {string} querySelector - The CSS selector for the desired DOM elements.
|
|
1111
|
-
* @returns {Promise<DOMNodeReference[]>} A promise that resolves to an array of Proxies of initialized DOMNodeReference instances.
|
|
1112
|
-
*/
|
|
1113
|
-
function _createDOMNodeReference() {
|
|
1114
|
-
_createDOMNodeReference = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(target) {
|
|
1115
|
-
var instance;
|
|
1116
|
-
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
1117
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
1118
|
-
case 0:
|
|
1119
|
-
_context2.prev = 0;
|
|
1120
|
-
instance = new DOMNodeReference(target);
|
|
1121
|
-
_context2.next = 4;
|
|
1122
|
-
return instance.init();
|
|
1123
|
-
case 4:
|
|
1124
|
-
return _context2.abrupt("return", new Proxy(instance, {
|
|
1125
|
-
get: function get(target, prop) {
|
|
1126
|
-
// do not proxy the initialization method
|
|
1127
|
-
// init() is only needed in this factory function
|
|
1128
|
-
if (prop == "init") return undefined;
|
|
1129
|
-
|
|
1130
|
-
// proxy the class to wrap all methods in the 'onceLoaded' method, to make sure the
|
|
1131
|
-
// element is always available before executing method
|
|
1132
|
-
var value = target[prop];
|
|
1133
|
-
if (typeof value === "function" && prop !== "onceLoaded") {
|
|
1134
|
-
return function () {
|
|
1135
|
-
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
1136
|
-
args[_key2] = arguments[_key2];
|
|
1137
|
-
}
|
|
1138
|
-
return target.onceLoaded(function () {
|
|
1139
|
-
return value.apply(target, args);
|
|
1140
|
-
});
|
|
1141
|
-
};
|
|
1142
|
-
}
|
|
1143
|
-
return value;
|
|
1144
|
-
}
|
|
1145
|
-
}));
|
|
1146
|
-
case 7:
|
|
1147
|
-
_context2.prev = 7;
|
|
1148
|
-
_context2.t0 = _context2["catch"](0);
|
|
1149
|
-
console.error("There was an error creating a DOMNodeReference: ".concat(_context2.t0));
|
|
1150
|
-
throw new Error(_context2.t0);
|
|
1151
|
-
case 11:
|
|
1152
|
-
case "end":
|
|
1153
|
-
return _context2.stop();
|
|
1154
|
-
}
|
|
1155
|
-
}, _callee2, null, [[0, 7]]);
|
|
1156
|
-
}));
|
|
1157
|
-
return _createDOMNodeReference.apply(this, arguments);
|
|
1158
|
-
}
|
|
1159
|
-
function createMultipleDOMNodeReferences(_x2) {
|
|
1160
|
-
return _createMultipleDOMNodeReferences.apply(this, arguments);
|
|
1161
|
-
}
|
|
1162
|
-
function _createMultipleDOMNodeReferences() {
|
|
1163
|
-
_createMultipleDOMNodeReferences = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(querySelector) {
|
|
1164
|
-
var elements;
|
|
1165
|
-
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
1166
|
-
while (1) switch (_context3.prev = _context3.next) {
|
|
1167
|
-
case 0:
|
|
1168
|
-
_context3.prev = 0;
|
|
1169
|
-
elements = Array.from(document.querySelectorAll(querySelector));
|
|
1170
|
-
_context3.next = 4;
|
|
1171
|
-
return Promise.all(elements.map(function (element) {
|
|
1172
|
-
return createDOMNodeReference(element);
|
|
1173
|
-
}));
|
|
1174
|
-
case 4:
|
|
1175
|
-
elements = _context3.sent;
|
|
1176
|
-
elements.hideAll = function () {
|
|
1177
|
-
return elements.forEach(function (instance) {
|
|
1178
|
-
return instance.hide();
|
|
1179
|
-
});
|
|
1180
|
-
};
|
|
1181
|
-
elements.showAll = function () {
|
|
1182
|
-
return elements.forEach(function (instance) {
|
|
1183
|
-
return instance.show();
|
|
1184
|
-
});
|
|
1185
|
-
};
|
|
1186
|
-
return _context3.abrupt("return", elements);
|
|
1187
|
-
case 10:
|
|
1188
|
-
_context3.prev = 10;
|
|
1189
|
-
_context3.t0 = _context3["catch"](0);
|
|
1190
|
-
console.error("There was an error creating multiple DOMNodeReferences: ".concat(_context3.t0));
|
|
1191
|
-
throw new Error(_context3.t0);
|
|
1192
|
-
case 14:
|
|
1193
|
-
case "end":
|
|
1194
|
-
return _context3.stop();
|
|
1195
|
-
}
|
|
1196
|
-
}, _callee3, null, [[0, 10]]);
|
|
1197
|
-
}));
|
|
1198
|
-
return _createMultipleDOMNodeReferences.apply(this, arguments);
|
|
1199
|
-
}
|
|
1200
|
-
;// ./src/index.js
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
var __webpack_exports__API = __webpack_exports__.nC;
|
|
1205
|
-
var __webpack_exports__createDOMNodeReference = __webpack_exports__.mI;
|
|
1206
|
-
var __webpack_exports__createMultipleDOMNodeReferences = __webpack_exports__.xq;
|
|
1207
|
-
export { __webpack_exports__API as API, __webpack_exports__createDOMNodeReference as createDOMNodeReference, __webpack_exports__createMultipleDOMNodeReferences as createMultipleDOMNodeReferences };
|