Class: Plutonium::UI::ExportButton
- Inherits:
-
Component::Base
- Object
- Component::Base
- Plutonium::UI::ExportButton
- Defined in:
- lib/plutonium/ui/export_button.rb
Overview
Connected split “Export” control for the index toolbar (sits beside the Filter button and shares its ‘pu-btn-outline pu-btn-sm` styling).
The primary button exports the current view (selected scope + filters + search). The caret opens a menu with “Export all”, which exports the entire authorized scope.
Both links carry ‘target=“_blank”`, which opens the streamed download in a new tab and bypasses Turbo (Turbo ignores links with a `target`).
The two halves are joined into one control by flattening their shared inner corners via inline styles (‘rounded-*-none` utilities aren’t in the packaged stylesheet), so it reads as a single button rather than two pills.
Constant Summary collapse
- PRIMARY_STYLE =
Inline corner/border tweaks that join the two halves seamlessly.
"border-top-right-radius:0;border-bottom-right-radius:0"- CARET_STYLE =
"border-top-left-radius:0;border-bottom-left-radius:0;border-left-width:0;padding-left:0.375rem;padding-right:0.375rem"
Instance Method Summary collapse
-
#initialize(scoped_url:, all_url:) ⇒ ExportButton
constructor
A new instance of ExportButton.
- #view_template ⇒ Object
Methods included from Component::Behaviour
Methods included from Component::Tokens
Methods included from Component::Kit
#BuildActionButton, #BuildActionsDropdown, #BuildAvatar, #BuildBlock, #BuildBreadcrumbs, #BuildBulkActionsToolbar, #BuildColorModeSelector, #BuildDynaFrameContent, #BuildDynaFrameHost, #BuildEmptyCard, #BuildFrameNavigatorPanel, #BuildModalCentered, #BuildModalSlideover, #BuildPageHeader, #BuildPanel, #BuildRowActionsDropdown, #BuildSkeletonTable, #BuildTabList, #BuildTableFilterPills, #BuildTableInfo, #BuildTablePagination, #BuildTableScopesBar, #BuildTableScopesPills, #BuildTableSearchBar, #BuildTableToolbar, #BuildTableViewSwitcher, #method_missing, #respond_to_missing?
Constructor Details
#initialize(scoped_url:, all_url:) ⇒ ExportButton
Returns a new instance of ExportButton.
24 25 26 27 |
# File 'lib/plutonium/ui/export_button.rb', line 24 def initialize(scoped_url:, all_url:) @scoped_url = scoped_url @all_url = all_url end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Plutonium::UI::Component::Kit
Instance Method Details
#view_template ⇒ Object
29 30 31 32 33 34 35 |
# File 'lib/plutonium/ui/export_button.rb', line 29 def view_template div(class: "relative inline-flex", data: {controller: "resource-drop-down"}) do render_primary render_caret end end |