@radioactive-labs/plutonium 0.1.12 → 0.1.13

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@radioactive-labs/plutonium",
3
- "version": "0.1.12",
3
+ "version": "0.1.13",
4
4
  "description": "Core assets for the Plutonium gem",
5
5
  "type": "module",
6
6
  "main": "src/js/core.js",
@@ -7437,11 +7437,16 @@
7437
7437
  connect() {
7438
7438
  console.log(`easymde connected: ${this.element}`);
7439
7439
  self.easyMDE = new EasyMDE({ element: this.element });
7440
+ this.element.setAttribute("data-action", "turbo:morph-element->easymde#reconnect");
7440
7441
  }
7441
7442
  disconnect() {
7442
7443
  self.easyMDE.toTextArea();
7443
7444
  self.easyMDE = null;
7444
7445
  }
7446
+ reconnect() {
7447
+ this.disconnect();
7448
+ this.connect();
7449
+ }
7445
7450
  };
7446
7451
 
7447
7452
  // src/js/controllers/slim_select_controller.js
@@ -7451,11 +7456,16 @@
7451
7456
  self.slimSelect = new SlimSelect({
7452
7457
  select: this.element
7453
7458
  });
7459
+ this.element.setAttribute("data-action", "turbo:morph-element->slim-select#reconnect");
7454
7460
  }
7455
7461
  disconnect() {
7456
7462
  self.slimSelect.destroy();
7457
7463
  self.slimSelect = null;
7458
7464
  }
7465
+ reconnect() {
7466
+ this.disconnect();
7467
+ this.connect();
7468
+ }
7459
7469
  };
7460
7470
 
7461
7471
  // src/js/controllers/flatpickr_controller.js
@@ -7463,11 +7473,16 @@
7463
7473
  connect() {
7464
7474
  console.log(`flatpickr connected: ${this.element}`);
7465
7475
  self.picker = new flatpickr(this.element, this.#buildOptions());
7476
+ this.element.setAttribute("data-action", "turbo:morph-element->flatpickr#reconnect");
7466
7477
  }
7467
7478
  disconnect() {
7468
7479
  self.picker.destroy();
7469
7480
  self.picker = null;
7470
7481
  }
7482
+ reconnect() {
7483
+ this.disconnect();
7484
+ this.connect();
7485
+ }
7471
7486
  #buildOptions() {
7472
7487
  let options = { altInput: true };
7473
7488
  if (this.element.attributes.type.value == "datetime-local") {