@radioactive-labs/plutonium 0.49.0 → 0.50.0
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 +1 -1
- package/src/css/components.css +304 -131
- package/src/css/tokens.css +101 -85
- package/src/dist/css/plutonium.css +2 -2
- package/src/dist/js/plutonium.js +404 -25
- package/src/dist/js/plutonium.js.map +4 -4
- package/src/dist/js/plutonium.min.js +45 -45
- package/src/dist/js/plutonium.min.js.map +4 -4
- package/src/js/controllers/autosubmit_controller.js +24 -0
- package/src/js/controllers/bulk_actions_controller.js +15 -16
- package/src/js/controllers/capture_url_controller.js +14 -0
- package/src/js/controllers/filter_panel_controller.js +77 -19
- package/src/js/controllers/flatpickr_controller.js +23 -0
- package/src/js/controllers/frame_navigator_controller.js +34 -6
- package/src/js/controllers/icon_rail_controller.js +22 -0
- package/src/js/controllers/icon_rail_flyout_controller.js +128 -0
- package/src/js/controllers/register_controllers.js +16 -0
- package/src/js/controllers/resource_tab_list_controller.js +56 -3
- package/src/js/controllers/row_click_controller.js +21 -0
- package/src/js/controllers/sidebar_controller.js +28 -1
- package/src/js/controllers/table_column_menu_controller.js +43 -0
- package/src/js/controllers/table_header_controller.js +16 -0
- package/src/js/controllers/view_switcher_controller.js +29 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Controller } from "@hotwired/stimulus"
|
|
2
|
+
|
|
3
|
+
// Connects to data-controller="table-header"
|
|
4
|
+
// Routes column-header clicks: shift-click navigates to multi-href instead of href,
|
|
5
|
+
// adding the column to the existing sort stack (multi-sort).
|
|
6
|
+
// Plain click lets the default link navigation happen, which replaces all sorts.
|
|
7
|
+
export default class extends Controller {
|
|
8
|
+
headerClick(event) {
|
|
9
|
+
if (!event.shiftKey) return // plain click: let the link navigate normally
|
|
10
|
+
const link = event.currentTarget
|
|
11
|
+
const multiHref = link.dataset.tableHeaderMultiHref
|
|
12
|
+
if (!multiHref) return
|
|
13
|
+
event.preventDefault()
|
|
14
|
+
Turbo.visit(multiHref)
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Controller } from "@hotwired/stimulus"
|
|
2
|
+
|
|
3
|
+
// Connects to data-controller="view-switcher"
|
|
4
|
+
// Persists the user's chosen index view in a cookie so the server can
|
|
5
|
+
// render the right shape on next request. Reload after writing so the
|
|
6
|
+
// page comes back with everything (toolbar, filters, table/grid)
|
|
7
|
+
// matching the new view.
|
|
8
|
+
export default class extends Controller {
|
|
9
|
+
static values = { cookieName: String, cookiePath: { type: String, default: "/" } }
|
|
10
|
+
|
|
11
|
+
select(event) {
|
|
12
|
+
const view = event.params.view
|
|
13
|
+
if (!view || !this.cookieNameValue) return
|
|
14
|
+
|
|
15
|
+
// 1 year, scoped to the portal's mount path so different portals
|
|
16
|
+
// can hold different view preferences for the same resource.
|
|
17
|
+
// SameSite=Lax keeps it on top-level navigations but blocks
|
|
18
|
+
// cross-site requests from carrying it along.
|
|
19
|
+
const maxAge = 60 * 60 * 24 * 365
|
|
20
|
+
const path = this.cookiePathValue || "/"
|
|
21
|
+
document.cookie = `${this.cookieNameValue}=${encodeURIComponent(view)}; Path=${path}; Max-Age=${maxAge}; SameSite=Lax`
|
|
22
|
+
|
|
23
|
+
// Strip any legacy `?view=` param so the cookie is the source of
|
|
24
|
+
// truth from now on.
|
|
25
|
+
const url = new URL(window.location.href)
|
|
26
|
+
url.searchParams.delete("view")
|
|
27
|
+
window.location.href = url.toString()
|
|
28
|
+
}
|
|
29
|
+
}
|