plutonium 0.16.3 → 0.16.4
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.
- checksums.yaml +4 -4
- data/app/assets/plutonium.css +1 -1
- data/app/assets/plutonium.js +19 -12
- data/app/assets/plutonium.js.map +2 -2
- data/app/assets/plutonium.min.js +14 -14
- data/app/assets/plutonium.min.js.map +3 -3
- data/docs/guide/tutorial.md +0 -2
- data/docs/public/templates/pluton8.rb +7 -0
- data/lib/generators/pu/core/assets/templates/tailwind.config.js +7 -6
- data/lib/plutonium/ui/sidebar_menu.rb +169 -0
- data/lib/plutonium/version.rb +1 -1
- data/package-lock.json +2 -2
- data/package.json +1 -1
- data/src/js/controllers/resource_collapse_controller.js +21 -13
- data/tailwind.options.js +46 -0
- metadata +18 -2
data/app/assets/plutonium.js
CHANGED
@@ -3364,7 +3364,6 @@
|
|
3364
3364
|
window.Collapse = Collapse;
|
3365
3365
|
window.initCollapses = initCollapses;
|
3366
3366
|
}
|
3367
|
-
var collapse_default = Collapse;
|
3368
3367
|
|
3369
3368
|
// node_modules/flowbite/lib/esm/components/carousel/index.js
|
3370
3369
|
var __assign3 = function() {
|
@@ -7269,19 +7268,27 @@
|
|
7269
7268
|
static targets = ["trigger", "menu"];
|
7270
7269
|
connect() {
|
7271
7270
|
console.log(`resource-collapse connected: ${this.element}`);
|
7272
|
-
|
7273
|
-
|
7274
|
-
|
7275
|
-
this
|
7271
|
+
if (!this.element.hasAttribute("data-visible")) {
|
7272
|
+
this.element.setAttribute("data-visible", "false");
|
7273
|
+
}
|
7274
|
+
this.#updateState();
|
7276
7275
|
}
|
7277
7276
|
toggle() {
|
7278
|
-
this.
|
7279
|
-
|
7280
|
-
|
7281
|
-
|
7282
|
-
|
7283
|
-
|
7284
|
-
|
7277
|
+
const isVisible = this.element.getAttribute("data-visible") === "true";
|
7278
|
+
this.element.setAttribute("data-visible", (!isVisible).toString());
|
7279
|
+
this.#updateState();
|
7280
|
+
}
|
7281
|
+
#updateState() {
|
7282
|
+
const isVisible = this.element.getAttribute("data-visible") === "true";
|
7283
|
+
if (isVisible) {
|
7284
|
+
this.menuTarget.classList.remove("hidden");
|
7285
|
+
this.triggerTarget.setAttribute("aria-expanded", "true");
|
7286
|
+
this.dispatch("expand");
|
7287
|
+
} else {
|
7288
|
+
this.menuTarget.classList.add("hidden");
|
7289
|
+
this.triggerTarget.setAttribute("aria-expanded", "false");
|
7290
|
+
this.dispatch("collapse");
|
7291
|
+
}
|
7285
7292
|
}
|
7286
7293
|
};
|
7287
7294
|
|