powerpagestoolkit 1.3.103 → 1.3.201

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/index.d.ts CHANGED
@@ -127,21 +127,18 @@ class DOMNodeReference {
127
127
  uncheckRadios(): void;
128
128
 
129
129
  /**
130
- * Configures validation and requirement conditions for the field based on the provided logic functions and dependencies.
131
- * Creates a validator and sets a required level dynamically based on dependency changes.
132
- * @param {Object} config An object containing the requirement and validation logical functions
133
- * @param {(this: DOMNodeReference) => boolean} config.requirementLogic - Function to determine if the field is required.
134
- * @param {(this: DOMNodeReference) => boolean} config.validationLogic - Function to evaluate the field's validity.
135
- * @param {string} fieldDisplayName - Display name used in error messages if validation fails.
136
- * @param {Array<DOMNodeReference>} [dependencies] - Optional dependencies for setting requirement conditions dynamically.
130
+ * Sets up validation and requirement rules for the field. This function dynamically updates the field's required status and validates its input based on the specified conditions.
131
+ *
132
+ * @param {function(this: DOMNodeReference): boolean} isRequired - A function that determines whether the field should be required. Returns `true` if required, `false` otherwise.
133
+ * @param {function(this: DOMNodeReference): boolean} isValid - A function that checks if the field's input is valid. Returns `true` if valid, `false` otherwise.
134
+ * @param {string} fieldDisplayName - The name of the field, used in error messages if validation fails.
135
+ * @param {Array<DOMNodeReference>} [dependencies] Other fields that this field’s requirement depends on. When these fields change, the required status of this field is re-evaluated. Make sure any DOMNodeReference used in `isRequired` or `isValid` is included in this array.
137
136
  */
138
137
  configureValidationAndRequirements(
139
- config: {
140
- requirementLogic: (this: this) => boolean;
141
- validationLogic: (this: this) => boolean;
142
- },
138
+ isRequired: (this: this) => boolean,
139
+ isValid: (this: this) => boolean,
143
140
  fieldDisplayName: string,
144
- dependencies?: DOMNodeReference[]
141
+ dependencies: Array<DOMNodeReference>
145
142
  ): void;
146
143
 
147
144
  /**
@@ -158,6 +155,12 @@ class DOMNodeReference {
158
155
  */
159
156
  addLabelTooltip(text: string): void;
160
157
 
158
+ /**
159
+ * Adds a tooltip with the specified text to the element
160
+ * @param {string} text - The text to display in the tooltip
161
+ */
162
+ addTooltip(text: string): void;
163
+
161
164
  /**
162
165
  * Sets the inner HTML content of the HTML element.
163
166
  * @param {string} text - The text to set as the inner HTML of the element.
@@ -175,16 +178,16 @@ class DOMNodeReference {
175
178
  * Configures conditional rendering for the target element based on a condition
176
179
  * and the visibility of one or more trigger elements.
177
180
  *
178
- * @param {Function} condition - A function that returns a boolean to determine
181
+ * @param {(this: DOMNodeReference) => boolean} condition - A function that returns a boolean to determine
179
182
  * the visibility of the target element. If `condition()` returns true, the element is shown;
180
183
  * otherwise, it is hidden.
181
- * @param {DOMNodeReference | DOMNodeReference[]} triggerNodes - A single `DOMNodeReference`
182
- * or an array of `DOMNodeReference` instances. Event listeners are registered on each
183
- * `triggerNode` to toggle the visibility of the target element based on the `condition`.
184
+ * @param {DOMNodeReference[]} triggerNodes - An array of `DOMNodeReference` instances. Event listeners are
185
+ * registered on each to toggle the visibility of the target element based on the `condition` and the visibility of
186
+ * the target node.
184
187
  */
185
188
  configureConditionalRendering(
186
- condition: () => boolean,
187
- triggerNodes?: DOMNodeReference | DOMNodeReference[]
189
+ condition: (this: DOMNodeReference) => boolean,
190
+ triggerNodes: DOMNodeReference[]
188
191
  ): void;
189
192
 
190
193
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "powerpagestoolkit",
3
- "version": "1.3.103",
3
+ "version": "1.3.201",
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/index.bundle.js",
6
6
  "types": "index.d.ts",