powerpagestoolkit 2.3.201 → 2.3.311

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.
@@ -70,12 +70,12 @@ export declare const _init: unique symbol;
70
70
  toggleVisibility(shouldShow: Function | boolean): DOMNodeReference;
71
71
  /**
72
72
  * Sets the value of the HTML element.
73
- * @param {() => any} value - The value to set for the HTML element.
73
+ * @param {(() => any) | any} value - The value to set for the HTML element.
74
74
  * for parents of boolean radios, pass true or false as value, or
75
75
  * an expression returning a boolean
76
76
  * @returns - Instance of this
77
77
  */
78
- setValue(value: any): DOMNodeReference;
78
+ setValue(value: (() => any) | any): DOMNodeReference;
79
79
  /**
80
80
  * Disables the element so that users cannot input any data
81
81
  * @returns - Instance of this
@@ -0,0 +1,35 @@
1
+ /* src/style.css */
2
+ .info-icon {
3
+ position: relative;
4
+ display: inline-block;
5
+ }
6
+ .info-icon .fa-info-circle {
7
+ cursor: pointer;
8
+ }
9
+ .info-icon .flyout-content {
10
+ max-width: calc(100vw - 20px);
11
+ display: none;
12
+ position: absolute;
13
+ left: 50%;
14
+ transform: translateX(-50%);
15
+ background-color: #f9f9f9;
16
+ padding: 10px;
17
+ border: 1px solid #ddd;
18
+ z-index: 1;
19
+ min-width: 200px;
20
+ box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
21
+ border-radius: 4px;
22
+ }
23
+ @media (max-width: 600px) {
24
+ .info-icon .flyout-content {
25
+ max-width: 95vw;
26
+ padding: 12px;
27
+ font-size: 0.9em;
28
+ display: block;
29
+ right: auto;
30
+ }
31
+ }
32
+ .required-field::after {
33
+ content: " *" !important;
34
+ color: #f00 !important;
35
+ }
package/dist/bundle.js CHANGED
@@ -261,9 +261,6 @@ var DOMNodeReference = class _DOMNodeReference {
261
261
  updateValue() {
262
262
  switch (this.element.type) {
263
263
  case "checkbox":
264
- this.value = +this.element.checked;
265
- this.checked = this.element.checked;
266
- break;
267
264
  case "radio":
268
265
  this.value = this.element.checked;
269
266
  this.checked = this.element.checked;
@@ -287,7 +284,7 @@ var DOMNodeReference = class _DOMNodeReference {
287
284
  this.yesRadio.updateValue();
288
285
  this.noRadio.updateValue();
289
286
  this.checked = this.yesRadio.checked;
290
- this.value = +this.yesRadio.checked;
287
+ this.value = this.yesRadio.checked;
291
288
  }
292
289
  }
293
290
  _attachVisibilityController() {
@@ -361,12 +358,15 @@ var DOMNodeReference = class _DOMNodeReference {
361
358
  }
362
359
  /**
363
360
  * Sets the value of the HTML element.
364
- * @param {() => any} value - The value to set for the HTML element.
361
+ * @param {(() => any) | any} value - The value to set for the HTML element.
365
362
  * for parents of boolean radios, pass true or false as value, or
366
363
  * an expression returning a boolean
367
364
  * @returns - Instance of this
368
365
  */
369
366
  setValue(value) {
367
+ if (value instanceof Function) {
368
+ value = value();
369
+ }
370
370
  if (this.element.classList.contains("boolean-radio")) {
371
371
  this.yesRadio.element.checked = value;
372
372
  this.noRadio.element.checked = !value;
@@ -692,4 +692,11 @@ export {
692
692
  createDOMNodeReference,
693
693
  createMultipleDOMNodeReferences
694
694
  };
695
- //# sourceMappingURL=bundle.js.map
695
+
696
+
697
+ (function() {
698
+ const style = document.createElement('style');
699
+ style.textContent = "/* src/style.css */\n.info-icon {\n position: relative;\n display: inline-block;\n}\n.info-icon .fa-info-circle {\n cursor: pointer;\n}\n.info-icon .flyout-content {\n max-width: calc(100vw - 20px);\n display: none;\n position: absolute;\n left: 50%;\n transform: translateX(-50%);\n background-color: #f9f9f9;\n padding: 10px;\n border: 1px solid #ddd;\n z-index: 1;\n min-width: 200px;\n box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);\n border-radius: 4px;\n}\n@media (max-width: 600px) {\n .info-icon .flyout-content {\n max-width: 95vw;\n padding: 12px;\n font-size: 0.9em;\n display: block;\n right: auto;\n }\n}\n.required-field::after {\n content: \" *\" !important;\n color: #f00 !important;\n}\n";
700
+ document.head.appendChild(style);
701
+ })();
702
+
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
+ import './style.css';
1
2
  import API from "./API.js";
2
3
  import { createDOMNodeReference, createMultipleDOMNodeReferences } from "./createDOMNodeReferences.js";
3
- import "./style.css";
4
4
  export { API, createDOMNodeReference, createMultipleDOMNodeReferences };
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "powerpagestoolkit",
3
- "version": "2.3.201",
3
+ "version": "2.3.311",
4
4
  "description": "Reference, manipulate, and engage with Power Pages sites through the nodes in the DOM; use a variety of custom methods that allow customizing your power pages site quicker and easier. ",
5
5
  "main": "./dist/bundle.js",
6
6
  "types": "./dist/index.d.ts",
7
7
  "scripts": {
8
8
  "typecheck": "tsc",
9
- "build": "node build.js",
9
+ "node:build": "node build.js",
10
10
  "build:types": "tsc --emitDeclarationOnly --declaration",
11
- "build:all": "npm run typecheck && npm run build && npm run build:types",
11
+ "build": "npm run typecheck && npm run node:build && npm run build:types",
12
12
  "dev": "tsc --watch"
13
13
  },
14
14
  "devDependencies": {
@@ -55,6 +55,7 @@
55
55
  ],
56
56
  "files": [
57
57
  "dist/bundle.js",
58
+ "dist/bundle.css",
58
59
  "dist/**/*.d.ts"
59
60
  ],
60
61
  "exports": {
@@ -65,6 +66,9 @@
65
66
  "./createDOMNodeReference": {
66
67
  "import": "./dist/createDOMNodeReference.js",
67
68
  "types": "./dist/createDOMNodeReference.d.ts"
69
+ },
70
+ "./style.css": {
71
+ "import": "./dist/bundle.css"
68
72
  }
69
73
  }
70
74
  }