create-prisma-php-app 1.12.7 → 1.12.8

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.
@@ -383,13 +383,19 @@ class HXConnector {
383
383
  const element = document.getElementById(attributeSet.id);
384
384
  if (element) {
385
385
  Object.keys(attributeSet.attributes).forEach((attr) => {
386
- if (attr === "class") {
387
- this.updateClassAttribute(
388
- element,
389
- attributeSet.attributes[attr]
390
- );
391
- } else {
392
- element.setAttribute(attr, attributeSet.attributes[attr]);
386
+ const value = attributeSet.attributes[attr];
387
+ switch (attr) {
388
+ case "class":
389
+ this.updateClassAttribute(element, value);
390
+ break;
391
+ case "add":
392
+ element.setAttribute(value, "");
393
+ break;
394
+ case "remove":
395
+ element.removeAttribute(value);
396
+ break;
397
+ default:
398
+ element.setAttribute(attr, value);
393
399
  }
394
400
  });
395
401
  }
@@ -405,13 +411,19 @@ class HXConnector {
405
411
  const element = document.getElementById(swap.id);
406
412
  if (element) {
407
413
  Object.keys(swap.attributes).forEach((attr) => {
408
- if (attr === "class") {
409
- this.updateClassAttribute(
410
- element,
411
- swap.attributes[attr]
412
- );
413
- } else {
414
- element.setAttribute(attr, swap.attributes[attr]);
414
+ const value = swap.attributes[attr];
415
+ switch (attr) {
416
+ case "class":
417
+ this.updateClassAttribute(element, value);
418
+ break;
419
+ case "add":
420
+ element.setAttribute(value, "");
421
+ break;
422
+ case "remove":
423
+ element.removeAttribute(value);
424
+ break;
425
+ default:
426
+ element.setAttribute(attr, value);
415
427
  }
416
428
  });
417
429
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-prisma-php-app",
3
- "version": "1.12.7",
3
+ "version": "1.12.8",
4
4
  "description": "Prisma-PHP: A Revolutionary Library Bridging PHP with Prisma ORM",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",