plutonium 0.16.5 → 0.18.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/plutonium.css +9 -1
- data/app/assets/plutonium.js +23273 -9599
- data/app/assets/plutonium.js.map +4 -4
- data/app/assets/plutonium.min.js +159 -49
- data/app/assets/plutonium.min.js.map +4 -4
- data/app/views/plutonium/_resource_header.html.erb +33 -24
- data/app/views/rodauth/otp_unlock.html.erb +22 -0
- data/app/views/rodauth/otp_unlock_not_available.html.erb +14 -0
- data/app/views/rodauth/webauthn_remove.html.erb +1 -0
- data/docs/guide/getting-started/resources.md +2 -2
- data/docs/guide/tutorial.md +4 -4
- data/gemfiles/rails_7.gemfile.lock +406 -0
- data/lib/generators/pu/core/assets/assets_generator.rb +1 -1
- data/lib/generators/pu/res/conn/conn_generator.rb +24 -10
- data/lib/generators/pu/rodauth/concerns/configuration.rb +11 -0
- data/lib/generators/pu/rodauth/concerns/feature_selector.rb +4 -0
- data/lib/generators/pu/rodauth/install_generator.rb +3 -1
- data/lib/generators/pu/rodauth/migration/active_record/otp_unlock.erb +7 -0
- data/lib/generators/pu/rodauth/templates/INSTRUCTIONS +2 -46
- data/lib/generators/pu/rodauth/templates/app/controllers/plugin_controller.rb.tt +3 -3
- data/lib/generators/pu/rodauth/templates/app/mailers/rodauth_mailer.rb.tt +50 -1
- data/lib/generators/pu/rodauth/templates/app/rodauth/account_rodauth_plugin.rb.tt +37 -3
- data/lib/generators/pu/rodauth/templates/app/rodauth/rodauth_plugin.rb.tt +33 -8
- data/lib/generators/pu/rodauth/templates/app/views/rodauth_mailer/otp_disabled.text.erb +2 -0
- data/lib/generators/pu/rodauth/templates/app/views/rodauth_mailer/otp_locked_out.text.erb +9 -0
- data/lib/generators/pu/rodauth/templates/app/views/rodauth_mailer/otp_setup.text.erb +2 -0
- data/lib/generators/pu/rodauth/templates/app/views/rodauth_mailer/otp_unlock_failed.text.erb +8 -0
- data/lib/generators/pu/rodauth/templates/app/views/rodauth_mailer/otp_unlocked.text.erb +2 -0
- data/lib/generators/pu/rodauth/templates/app/views/rodauth_mailer/webauthn_authenticator_added.text.erb +3 -0
- data/lib/generators/pu/rodauth/templates/app/views/rodauth_mailer/webauthn_authenticator_removed.text.erb +3 -0
- data/lib/generators/pu/rodauth/views_generator.rb +1 -12
- data/lib/plutonium/core/controllers/authorizable.rb +3 -1
- data/lib/plutonium/helpers/application_helper.rb +0 -8
- data/lib/plutonium/helpers.rb +0 -3
- data/lib/plutonium/railtie.rb +0 -14
- data/lib/plutonium/reloader.rb +2 -12
- data/lib/plutonium/rodauth/controller_methods.rb +1 -3
- data/lib/plutonium/ui/component/behaviour.rb +1 -1
- data/lib/plutonium/ui/component/kit.rb +59 -15
- data/lib/plutonium/ui/display/base.rb +6 -2
- data/lib/plutonium/ui/display/{component → components}/association.rb +1 -1
- data/lib/plutonium/ui/display/components/attachment.rb +93 -0
- data/lib/plutonium/ui/display/{component → components}/markdown.rb +2 -1
- data/lib/plutonium/ui/display/resource.rb +21 -6
- data/lib/plutonium/ui/display/theme.rb +2 -1
- data/lib/plutonium/ui/form/base.rb +7 -0
- data/lib/plutonium/ui/form/components/belongs_to.rb +45 -1
- data/lib/plutonium/ui/form/components/has_many.rb +45 -1
- data/lib/plutonium/ui/form/components/uppy.rb +173 -0
- data/lib/plutonium/ui/form/query.rb +5 -5
- data/lib/plutonium/ui/form/resource.rb +6 -6
- data/lib/plutonium/ui/form/theme.rb +6 -2
- data/lib/plutonium/ui/frame_navigator_panel.rb +25 -4
- data/lib/plutonium/ui/layout/base.rb +1 -1
- data/lib/plutonium/ui/layout/header.rb +1 -1
- data/lib/plutonium/ui/layout/sidebar.rb +0 -1
- data/lib/plutonium/ui/nav_grid_menu.rb +93 -0
- data/lib/plutonium/ui/nav_user.rb +121 -0
- data/lib/plutonium/ui/panel.rb +2 -2
- data/lib/plutonium/ui/tab_list.rb +73 -0
- data/lib/plutonium/ui/table/base.rb +7 -1
- data/lib/plutonium/ui/table/components/attachment.rb +71 -0
- data/lib/plutonium/ui/table/components/pagy_info.rb +12 -4
- data/lib/plutonium/ui/table/components/pagy_pagination.rb +5 -5
- data/lib/plutonium/ui/table/display_theme.rb +2 -1
- data/lib/plutonium/ui/table/resource.rb +11 -12
- data/lib/plutonium/version.rb +1 -1
- data/package-lock.json +356 -18
- data/package.json +6 -2
- data/src/css/plutonium.css +3 -0
- data/src/js/controllers/attachment_input_controller.js +241 -0
- data/src/js/controllers/attachment_preview_container_controller.js +15 -0
- data/src/js/controllers/attachment_preview_controller.js +63 -0
- data/src/js/controllers/color_mode_controller.js +0 -1
- data/src/js/controllers/easymde_controller.js +0 -1
- data/src/js/controllers/flatpickr_controller.js +0 -1
- data/src/js/controllers/form_controller.js +0 -1
- data/src/js/controllers/frame_navigator_controller.js +16 -12
- data/src/js/controllers/intl_tel_input_controller.js +0 -1
- data/src/js/controllers/register_controllers.js +12 -30
- data/src/js/controllers/resource_collapse_controller.js +0 -1
- data/src/js/controllers/resource_dismiss_controller.js +0 -1
- data/src/js/controllers/resource_drop_down_controller.js +161 -9
- data/src/js/controllers/{header_controller.js → resource_header_controller.js} +1 -0
- data/src/js/controllers/resource_tab_list_controller.js +64 -0
- data/src/js/controllers/select_navigator.js +16 -0
- data/src/js/controllers/slim_select_controller.js +0 -1
- data/src/js/support/dom_element.js +78 -0
- data/src/js/support/mime_icon.js +127 -0
- data/tailwind.options.js +0 -5
- metadata +29 -642
- data/README copy.md +0 -83
- data/app/assets/application.js.bk +0 -31419
- data/app/assets/icons/flags/ghana.svg +0 -49
- data/app/assets/icons/outline/address-book.svg +0 -3
- data/app/assets/icons/outline/adjustments-horizontal.svg +0 -3
- data/app/assets/icons/outline/adjustments-vertical.svg +0 -3
- data/app/assets/icons/outline/align-center.svg +0 -3
- data/app/assets/icons/outline/angle-down.svg +0 -3
- data/app/assets/icons/outline/angle-left.svg +0 -3
- data/app/assets/icons/outline/angle-right.svg +0 -3
- data/app/assets/icons/outline/angle-up.svg +0 -3
- data/app/assets/icons/outline/annotation.svg +0 -3
- data/app/assets/icons/outline/archive-arrow-down.svg +0 -3
- data/app/assets/icons/outline/archive.svg +0 -3
- data/app/assets/icons/outline/arrow-down-to-bracket.svg +0 -3
- data/app/assets/icons/outline/arrow-down.svg +0 -3
- data/app/assets/icons/outline/arrow-left-to-bracket.svg +0 -3
- data/app/assets/icons/outline/arrow-left.svg +0 -3
- data/app/assets/icons/outline/arrow-right-alt.svg +0 -3
- data/app/assets/icons/outline/arrow-right-to-bracket.svg +0 -3
- data/app/assets/icons/outline/arrow-right.svg +0 -3
- data/app/assets/icons/outline/arrow-sort-letters.svg +0 -3
- data/app/assets/icons/outline/arrow-up-down.svg +0 -3
- data/app/assets/icons/outline/arrow-up-from-bracket.svg +0 -3
- data/app/assets/icons/outline/arrow-up-right-down-left.svg +0 -3
- data/app/assets/icons/outline/arrow-up-right-from-square.svg +0 -3
- data/app/assets/icons/outline/arrow-up.svg +0 -3
- data/app/assets/icons/outline/arrows-repeat-count.svg +0 -3
- data/app/assets/icons/outline/arrows-repeat.svg +0 -3
- data/app/assets/icons/outline/atom.svg +0 -3
- data/app/assets/icons/outline/backward-step.svg +0 -3
- data/app/assets/icons/outline/badge-check.svg +0 -3
- data/app/assets/icons/outline/bars-from-left.svg +0 -3
- data/app/assets/icons/outline/bars.svg +0 -3
- data/app/assets/icons/outline/bell-active-alt.svg +0 -3
- data/app/assets/icons/outline/bell-active.svg +0 -3
- data/app/assets/icons/outline/bell-ring.svg +0 -3
- data/app/assets/icons/outline/bell.svg +0 -3
- data/app/assets/icons/outline/blender-phone.svg +0 -3
- data/app/assets/icons/outline/book-open.svg +0 -3
- data/app/assets/icons/outline/book.svg +0 -3
- data/app/assets/icons/outline/bookmark.svg +0 -3
- data/app/assets/icons/outline/brain.svg +0 -3
- data/app/assets/icons/outline/briefcase.svg +0 -3
- data/app/assets/icons/outline/bug.svg +0 -3
- data/app/assets/icons/outline/building.svg +0 -3
- data/app/assets/icons/outline/bullhorn.svg +0 -3
- data/app/assets/icons/outline/calendar-edit.svg +0 -3
- data/app/assets/icons/outline/calendar-month.svg +0 -3
- data/app/assets/icons/outline/calendar-plus.svg +0 -3
- data/app/assets/icons/outline/calendar-week.svg +0 -3
- data/app/assets/icons/outline/camera-photo.svg +0 -4
- data/app/assets/icons/outline/caption.svg +0 -3
- data/app/assets/icons/outline/caret-down.svg +0 -3
- data/app/assets/icons/outline/caret-left.svg +0 -3
- data/app/assets/icons/outline/caret-right.svg +0 -3
- data/app/assets/icons/outline/caret-sort.svg +0 -3
- data/app/assets/icons/outline/caret-up.svg +0 -3
- data/app/assets/icons/outline/cart-plus-alt.svg +0 -3
- data/app/assets/icons/outline/cart-plus.svg +0 -3
- data/app/assets/icons/outline/cart.svg +0 -3
- data/app/assets/icons/outline/cash.svg +0 -3
- data/app/assets/icons/outline/chart-line-down.svg +0 -3
- data/app/assets/icons/outline/chart-line-up.svg +0 -3
- data/app/assets/icons/outline/chart-mixed-dollar.svg +0 -3
- data/app/assets/icons/outline/chart-mixed.svg +0 -3
- data/app/assets/icons/outline/chart-pie.svg +0 -4
- data/app/assets/icons/outline/chart.svg +0 -3
- data/app/assets/icons/outline/check-circle.svg +0 -3
- data/app/assets/icons/outline/check-plus-circle.svg +0 -3
- data/app/assets/icons/outline/check.svg +0 -3
- data/app/assets/icons/outline/chevron-double-down.svg +0 -3
- data/app/assets/icons/outline/chevron-double-left.svg +0 -3
- data/app/assets/icons/outline/chevron-double-right.svg +0 -3
- data/app/assets/icons/outline/chevron-double-up.svg +0 -3
- data/app/assets/icons/outline/chevron-down.svg +0 -3
- data/app/assets/icons/outline/chevron-left.svg +0 -3
- data/app/assets/icons/outline/chevron-right.svg +0 -3
- data/app/assets/icons/outline/chevron-sort.svg +0 -3
- data/app/assets/icons/outline/chevron-up.svg +0 -3
- data/app/assets/icons/outline/circle-pause.svg +0 -3
- data/app/assets/icons/outline/circle-plus.svg +0 -3
- data/app/assets/icons/outline/clapperboard-play.svg +0 -3
- data/app/assets/icons/outline/clipboard-check.svg +0 -3
- data/app/assets/icons/outline/clipboard-list.svg +0 -3
- data/app/assets/icons/outline/clipboard.svg +0 -3
- data/app/assets/icons/outline/clock.svg +0 -3
- data/app/assets/icons/outline/close-circle.svg +0 -3
- data/app/assets/icons/outline/close.svg +0 -3
- data/app/assets/icons/outline/cloud-arrow-up.svg +0 -3
- data/app/assets/icons/outline/code-branch.svg +0 -3
- data/app/assets/icons/outline/code-fork.svg +0 -3
- data/app/assets/icons/outline/code-merge.svg +0 -3
- data/app/assets/icons/outline/code-pull-request.svg +0 -3
- data/app/assets/icons/outline/code.svg +0 -3
- data/app/assets/icons/outline/cog.svg +0 -4
- data/app/assets/icons/outline/column.svg +0 -3
- data/app/assets/icons/outline/command.svg +0 -3
- data/app/assets/icons/outline/compress.svg +0 -3
- data/app/assets/icons/outline/computer-speaker.svg +0 -3
- data/app/assets/icons/outline/credit-card.svg +0 -3
- data/app/assets/icons/outline/database.svg +0 -3
- data/app/assets/icons/outline/desktop-pc.svg +0 -3
- data/app/assets/icons/outline/dna.svg +0 -3
- data/app/assets/icons/outline/dollar.svg +0 -3
- data/app/assets/icons/outline/dots-horizontal.svg +0 -3
- data/app/assets/icons/outline/dots-vertical.svg +0 -3
- data/app/assets/icons/outline/download.svg +0 -3
- data/app/assets/icons/outline/draw-square.svg +0 -3
- data/app/assets/icons/outline/edit.svg +0 -3
- data/app/assets/icons/outline/envelope-open.svg +0 -3
- data/app/assets/icons/outline/envelope.svg +0 -3
- data/app/assets/icons/outline/euro.svg +0 -3
- data/app/assets/icons/outline/exclamation-circle.svg +0 -3
- data/app/assets/icons/outline/expand.svg +0 -3
- data/app/assets/icons/outline/eye-slash.svg +0 -3
- data/app/assets/icons/outline/eye.svg +0 -4
- data/app/assets/icons/outline/face-explode.svg +0 -4
- data/app/assets/icons/outline/face-grin-stars.svg +0 -6
- data/app/assets/icons/outline/face-grin.svg +0 -3
- data/app/assets/icons/outline/face-laugh.svg +0 -3
- data/app/assets/icons/outline/file-chart-bar.svg +0 -3
- data/app/assets/icons/outline/file-check.svg +0 -3
- data/app/assets/icons/outline/file-circle-plus.svg +0 -3
- data/app/assets/icons/outline/file-clone.svg +0 -3
- data/app/assets/icons/outline/file-code.svg +0 -3
- data/app/assets/icons/outline/file-copy-alt.svg +0 -3
- data/app/assets/icons/outline/file-copy.svg +0 -3
- data/app/assets/icons/outline/file-csv.svg +0 -3
- data/app/assets/icons/outline/file-export.svg +0 -3
- data/app/assets/icons/outline/file-image.svg +0 -4
- data/app/assets/icons/outline/file-import.svg +0 -3
- data/app/assets/icons/outline/file-invoice.svg +0 -3
- data/app/assets/icons/outline/file-lines.svg +0 -3
- data/app/assets/icons/outline/file-music.svg +0 -3
- data/app/assets/icons/outline/file-paste.svg +0 -3
- data/app/assets/icons/outline/file-pdf.svg +0 -3
- data/app/assets/icons/outline/file-pen.svg +0 -3
- data/app/assets/icons/outline/file-ppt.svg +0 -3
- data/app/assets/icons/outline/file-search.svg +0 -3
- data/app/assets/icons/outline/file-shield.svg +0 -3
- data/app/assets/icons/outline/file-video.svg +0 -3
- data/app/assets/icons/outline/file-word.svg +0 -3
- data/app/assets/icons/outline/file-zip.svg +0 -3
- data/app/assets/icons/outline/file.svg +0 -3
- data/app/assets/icons/outline/filter.svg +0 -3
- data/app/assets/icons/outline/fingerprint.svg +0 -3
- data/app/assets/icons/outline/fire.svg +0 -3
- data/app/assets/icons/outline/flag.svg +0 -3
- data/app/assets/icons/outline/folder-arrow-right.svg +0 -3
- data/app/assets/icons/outline/folder-duplicate.svg +0 -3
- data/app/assets/icons/outline/folder-open.svg +0 -3
- data/app/assets/icons/outline/folder-plus.svg +0 -3
- data/app/assets/icons/outline/folder.svg +0 -3
- data/app/assets/icons/outline/forward-step.svg +0 -3
- data/app/assets/icons/outline/forward.svg +0 -3
- data/app/assets/icons/outline/gift-box.svg +0 -3
- data/app/assets/icons/outline/globe.svg +0 -3
- data/app/assets/icons/outline/grid-plus.svg +0 -3
- data/app/assets/icons/outline/grid.svg +0 -3
- data/app/assets/icons/outline/headphones.svg +0 -3
- data/app/assets/icons/outline/heart.svg +0 -3
- data/app/assets/icons/outline/home.svg +0 -3
- data/app/assets/icons/outline/hourglass.svg +0 -3
- data/app/assets/icons/outline/image.svg +0 -3
- data/app/assets/icons/outline/inbox-full.svg +0 -3
- data/app/assets/icons/outline/inbox.svg +0 -3
- data/app/assets/icons/outline/indent.svg +0 -3
- data/app/assets/icons/outline/info-circle.svg +0 -3
- data/app/assets/icons/outline/keyboard.svg +0 -5
- data/app/assets/icons/outline/label.svg +0 -3
- data/app/assets/icons/outline/landmark.svg +0 -3
- data/app/assets/icons/outline/layers.svg +0 -3
- data/app/assets/icons/outline/letter-bold.svg +0 -3
- data/app/assets/icons/outline/letter-italic.svg +0 -3
- data/app/assets/icons/outline/letter-underline.svg +0 -3
- data/app/assets/icons/outline/life-saver.svg +0 -3
- data/app/assets/icons/outline/lightbulb.svg +0 -3
- data/app/assets/icons/outline/link.svg +0 -3
- data/app/assets/icons/outline/list-music.svg +0 -3
- data/app/assets/icons/outline/list.svg +0 -3
- data/app/assets/icons/outline/lock-open.svg +0 -3
- data/app/assets/icons/outline/lock-time.svg +0 -3
- data/app/assets/icons/outline/lock.svg +0 -3
- data/app/assets/icons/outline/mail-box.svg +0 -3
- data/app/assets/icons/outline/map-pin-alt.svg +0 -4
- data/app/assets/icons/outline/map-pin.svg +0 -3
- data/app/assets/icons/outline/message-caption.svg +0 -3
- data/app/assets/icons/outline/message-dots.svg +0 -3
- data/app/assets/icons/outline/messages.svg +0 -3
- data/app/assets/icons/outline/microphone.svg +0 -3
- data/app/assets/icons/outline/minimize.svg +0 -3
- data/app/assets/icons/outline/minus.svg +0 -3
- data/app/assets/icons/outline/mobile-phone.svg +0 -3
- data/app/assets/icons/outline/moon.svg +0 -3
- data/app/assets/icons/outline/newspaper.svg +0 -3
- data/app/assets/icons/outline/ordered-list.svg +0 -3
- data/app/assets/icons/outline/outdent.svg +0 -3
- data/app/assets/icons/outline/palette.svg +0 -3
- data/app/assets/icons/outline/paper-clip.svg +0 -3
- data/app/assets/icons/outline/paper-plane.svg +0 -3
- data/app/assets/icons/outline/paragraph.svg +0 -3
- data/app/assets/icons/outline/pause.svg +0 -3
- data/app/assets/icons/outline/pen-nib.svg +0 -3
- data/app/assets/icons/outline/pen.svg +0 -3
- data/app/assets/icons/outline/phone.svg +0 -3
- data/app/assets/icons/outline/play.svg +0 -3
- data/app/assets/icons/outline/plus.svg +0 -3
- data/app/assets/icons/outline/printer.svg +0 -3
- data/app/assets/icons/outline/profile-card.svg +0 -3
- data/app/assets/icons/outline/question-circle.svg +0 -3
- data/app/assets/icons/outline/quote.svg +0 -3
- data/app/assets/icons/outline/receipt.svg +0 -3
- data/app/assets/icons/outline/rectangle-list.svg +0 -3
- data/app/assets/icons/outline/redo.svg +0 -3
- data/app/assets/icons/outline/refresh.svg +0 -3
- data/app/assets/icons/outline/reply-all.svg +0 -3
- data/app/assets/icons/outline/reply.svg +0 -3
- data/app/assets/icons/outline/restore-window.svg +0 -3
- data/app/assets/icons/outline/rocket.svg +0 -3
- data/app/assets/icons/outline/ruler-combined.svg +0 -3
- data/app/assets/icons/outline/sale-percent.svg +0 -3
- data/app/assets/icons/outline/scale-balanced.svg +0 -3
- data/app/assets/icons/outline/search.svg +0 -3
- data/app/assets/icons/outline/share-all.svg +0 -3
- data/app/assets/icons/outline/share-nodes.svg +0 -3
- data/app/assets/icons/outline/shield-check.svg +0 -3
- data/app/assets/icons/outline/shield.svg +0 -3
- data/app/assets/icons/outline/shopping-bag.svg +0 -3
- data/app/assets/icons/outline/shuffle.svg +0 -3
- data/app/assets/icons/outline/sort-horizontal.svg +0 -3
- data/app/assets/icons/outline/sort.svg +0 -3
- data/app/assets/icons/outline/star-half-stroke.svg +0 -3
- data/app/assets/icons/outline/star-half.svg +0 -3
- data/app/assets/icons/outline/star.svg +0 -3
- data/app/assets/icons/outline/store.svg +0 -3
- data/app/assets/icons/outline/sun.svg +0 -3
- data/app/assets/icons/outline/swatchbook.svg +0 -3
- data/app/assets/icons/outline/table-column.svg +0 -3
- data/app/assets/icons/outline/table-row.svg +0 -3
- data/app/assets/icons/outline/tablet.svg +0 -3
- data/app/assets/icons/outline/tag.svg +0 -3
- data/app/assets/icons/outline/terminal.svg +0 -3
- data/app/assets/icons/outline/text-size.svg +0 -3
- data/app/assets/icons/outline/text-slash.svg +0 -3
- data/app/assets/icons/outline/thumbs-down.svg +0 -3
- data/app/assets/icons/outline/thumbs-up.svg +0 -3
- data/app/assets/icons/outline/ticket.svg +0 -3
- data/app/assets/icons/outline/trash-bin.svg +0 -3
- data/app/assets/icons/outline/truck.svg +0 -3
- data/app/assets/icons/outline/undo.svg +0 -3
- data/app/assets/icons/outline/upload.svg +0 -3
- data/app/assets/icons/outline/user-add.svg +0 -3
- data/app/assets/icons/outline/user-circle.svg +0 -3
- data/app/assets/icons/outline/user-edit.svg +0 -3
- data/app/assets/icons/outline/user-headset.svg +0 -3
- data/app/assets/icons/outline/user-remove.svg +0 -3
- data/app/assets/icons/outline/user-settings.svg +0 -3
- data/app/assets/icons/outline/user.svg +0 -3
- data/app/assets/icons/outline/users-group.svg +0 -3
- data/app/assets/icons/outline/users.svg +0 -3
- data/app/assets/icons/outline/video-camera.svg +0 -3
- data/app/assets/icons/outline/volume-down.svg +0 -3
- data/app/assets/icons/outline/volume-up.svg +0 -3
- data/app/assets/icons/outline/wallet.svg +0 -3
- data/app/assets/icons/outline/wand-magic-sparkles.svg +0 -3
- data/app/assets/icons/outline/window.svg +0 -3
- data/app/assets/icons/outline/zoom-in.svg +0 -3
- data/app/assets/icons/outline/zoom-out.svg +0 -3
- data/app/assets/icons/solid/X.svg +0 -3
- data/app/assets/icons/solid/address-book.svg +0 -3
- data/app/assets/icons/solid/adjustments-horizontal.svg +0 -3
- data/app/assets/icons/solid/adjustments-vertical.svg +0 -3
- data/app/assets/icons/solid/annotation.svg +0 -3
- data/app/assets/icons/solid/apple.svg +0 -3
- data/app/assets/icons/solid/archive-arrow-down.svg +0 -3
- data/app/assets/icons/solid/archive.svg +0 -4
- data/app/assets/icons/solid/arrow-right-alt.svg +0 -3
- data/app/assets/icons/solid/arrow-up-right-from-square.svg +0 -4
- data/app/assets/icons/solid/backward-step.svg +0 -3
- data/app/assets/icons/solid/badge-check.svg +0 -3
- data/app/assets/icons/solid/bell-active-alt.svg +0 -3
- data/app/assets/icons/solid/bell-active.svg +0 -5
- data/app/assets/icons/solid/bell-ring.svg +0 -3
- data/app/assets/icons/solid/bell.svg +0 -3
- data/app/assets/icons/solid/blender-phone.svg +0 -3
- data/app/assets/icons/solid/book-open.svg +0 -3
- data/app/assets/icons/solid/book.svg +0 -3
- data/app/assets/icons/solid/bookmark.svg +0 -3
- data/app/assets/icons/solid/brain.svg +0 -3
- data/app/assets/icons/solid/briefcase.svg +0 -3
- data/app/assets/icons/solid/bug.svg +0 -3
- data/app/assets/icons/solid/building.svg +0 -3
- data/app/assets/icons/solid/bullhorn.svg +0 -3
- data/app/assets/icons/solid/calendar-edit.svg +0 -4
- data/app/assets/icons/solid/calendar-month.svg +0 -3
- data/app/assets/icons/solid/calendar-plus.svg +0 -3
- data/app/assets/icons/solid/calendar-week.svg +0 -3
- data/app/assets/icons/solid/camera-photo.svg +0 -3
- data/app/assets/icons/solid/caption.svg +0 -3
- data/app/assets/icons/solid/caret-down.svg +0 -3
- data/app/assets/icons/solid/caret-left.svg +0 -3
- data/app/assets/icons/solid/caret-right.svg +0 -3
- data/app/assets/icons/solid/caret-sort.svg +0 -3
- data/app/assets/icons/solid/caret-up.svg +0 -3
- data/app/assets/icons/solid/cart-plus-alt.svg +0 -4
- data/app/assets/icons/solid/cart-plus.svg +0 -4
- data/app/assets/icons/solid/cart.svg +0 -3
- data/app/assets/icons/solid/cash.svg +0 -5
- data/app/assets/icons/solid/chart-mixed-dollar.svg +0 -3
- data/app/assets/icons/solid/chart-pie.svg +0 -4
- data/app/assets/icons/solid/check-circle.svg +0 -3
- data/app/assets/icons/solid/check-plus-circle.svg +0 -4
- data/app/assets/icons/solid/circle-pause.svg +0 -3
- data/app/assets/icons/solid/circle-plus.svg +0 -3
- data/app/assets/icons/solid/clapperboard-play.svg +0 -3
- data/app/assets/icons/solid/clipboard-check.svg +0 -3
- data/app/assets/icons/solid/clipboard-list.svg +0 -3
- data/app/assets/icons/solid/clipboard.svg +0 -3
- data/app/assets/icons/solid/clock.svg +0 -3
- data/app/assets/icons/solid/close-circle.svg +0 -3
- data/app/assets/icons/solid/cloud-arrow-up.svg +0 -4
- data/app/assets/icons/solid/code-branch.svg +0 -3
- data/app/assets/icons/solid/code-fork.svg +0 -3
- data/app/assets/icons/solid/code-merge.svg +0 -3
- data/app/assets/icons/solid/code-pull-request.svg +0 -3
- data/app/assets/icons/solid/cog.svg +0 -3
- data/app/assets/icons/solid/column.svg +0 -3
- data/app/assets/icons/solid/computer-speaker.svg +0 -4
- data/app/assets/icons/solid/credit-card.svg +0 -4
- data/app/assets/icons/solid/css.svg +0 -3
- data/app/assets/icons/solid/database.svg +0 -3
- data/app/assets/icons/solid/desktop-pc.svg +0 -3
- data/app/assets/icons/solid/discord.svg +0 -3
- data/app/assets/icons/solid/download.svg +0 -4
- data/app/assets/icons/solid/draw-square.svg +0 -4
- data/app/assets/icons/solid/dribbble.svg +0 -3
- data/app/assets/icons/solid/dropbox.svg +0 -4
- data/app/assets/icons/solid/edit.svg +0 -4
- data/app/assets/icons/solid/envelope-open.svg +0 -4
- data/app/assets/icons/solid/envelope.svg +0 -4
- data/app/assets/icons/solid/exclamation-circle.svg +0 -3
- data/app/assets/icons/solid/eye-slash.svg +0 -5
- data/app/assets/icons/solid/eye.svg +0 -3
- data/app/assets/icons/solid/face-explode.svg +0 -3
- data/app/assets/icons/solid/face-grin-stars.svg +0 -3
- data/app/assets/icons/solid/face-grin.svg +0 -3
- data/app/assets/icons/solid/face-laugh.svg +0 -3
- data/app/assets/icons/solid/facebook.svg +0 -3
- data/app/assets/icons/solid/file-chart-bar.svg +0 -3
- data/app/assets/icons/solid/file-check.svg +0 -4
- data/app/assets/icons/solid/file-circle-plus.svg +0 -4
- data/app/assets/icons/solid/file-clone.svg +0 -4
- data/app/assets/icons/solid/file-code.svg +0 -3
- data/app/assets/icons/solid/file-copy-alt.svg +0 -4
- data/app/assets/icons/solid/file-copy.svg +0 -4
- data/app/assets/icons/solid/file-csv.svg +0 -3
- data/app/assets/icons/solid/file-export.svg +0 -3
- data/app/assets/icons/solid/file-image.svg +0 -3
- data/app/assets/icons/solid/file-import.svg +0 -3
- data/app/assets/icons/solid/file-invoice.svg +0 -3
- data/app/assets/icons/solid/file-lines.svg +0 -3
- data/app/assets/icons/solid/file-music.svg +0 -3
- data/app/assets/icons/solid/file-paste.svg +0 -4
- data/app/assets/icons/solid/file-pdf.svg +0 -3
- data/app/assets/icons/solid/file-pen.svg +0 -4
- data/app/assets/icons/solid/file-ppt.svg +0 -3
- data/app/assets/icons/solid/file-search.svg +0 -3
- data/app/assets/icons/solid/file-shield.svg +0 -4
- data/app/assets/icons/solid/file-video.svg +0 -3
- data/app/assets/icons/solid/file-word.svg +0 -3
- data/app/assets/icons/solid/file-zip.svg +0 -3
- data/app/assets/icons/solid/file.svg +0 -3
- data/app/assets/icons/solid/filter.svg +0 -3
- data/app/assets/icons/solid/fire.svg +0 -3
- data/app/assets/icons/solid/flag.svg +0 -3
- data/app/assets/icons/solid/flowbite.svg +0 -6
- data/app/assets/icons/solid/folder-arrow-right.svg +0 -3
- data/app/assets/icons/solid/folder-duplicate.svg +0 -4
- data/app/assets/icons/solid/folder-open.svg +0 -3
- data/app/assets/icons/solid/folder-plus.svg +0 -3
- data/app/assets/icons/solid/folder.svg +0 -3
- data/app/assets/icons/solid/forward-step.svg +0 -3
- data/app/assets/icons/solid/forward.svg +0 -3
- data/app/assets/icons/solid/gift-box.svg +0 -3
- data/app/assets/icons/solid/github.svg +0 -3
- data/app/assets/icons/solid/globe.svg +0 -3
- data/app/assets/icons/solid/google.svg +0 -3
- data/app/assets/icons/solid/grid-plus.svg +0 -3
- data/app/assets/icons/solid/grid.svg +0 -3
- data/app/assets/icons/solid/headphones.svg +0 -3
- data/app/assets/icons/solid/heart.svg +0 -3
- data/app/assets/icons/solid/home.svg +0 -3
- data/app/assets/icons/solid/hourglass.svg +0 -3
- data/app/assets/icons/solid/html.svg +0 -3
- data/app/assets/icons/solid/image.svg +0 -4
- data/app/assets/icons/solid/inbox-full.svg +0 -3
- data/app/assets/icons/solid/inbox.svg +0 -3
- data/app/assets/icons/solid/indent.svg +0 -3
- data/app/assets/icons/solid/info-circle.svg +0 -3
- data/app/assets/icons/solid/keyboard.svg +0 -3
- data/app/assets/icons/solid/label.svg +0 -3
- data/app/assets/icons/solid/landmark.svg +0 -4
- data/app/assets/icons/solid/layers.svg +0 -4
- data/app/assets/icons/solid/life-saver.svg +0 -3
- data/app/assets/icons/solid/lightbulb.svg +0 -3
- data/app/assets/icons/solid/linkedin.svg +0 -4
- data/app/assets/icons/solid/list-music.svg +0 -3
- data/app/assets/icons/solid/lock-open.svg +0 -3
- data/app/assets/icons/solid/lock-time.svg +0 -4
- data/app/assets/icons/solid/lock.svg +0 -3
- data/app/assets/icons/solid/mail-box.svg +0 -3
- data/app/assets/icons/solid/map-pin-alt.svg +0 -3
- data/app/assets/icons/solid/map-pin.svg +0 -3
- data/app/assets/icons/solid/message-caption.svg +0 -3
- data/app/assets/icons/solid/message-dots.svg +0 -3
- data/app/assets/icons/solid/messages.svg +0 -4
- data/app/assets/icons/solid/microphone.svg +0 -4
- data/app/assets/icons/solid/mobile-phone.svg +0 -3
- data/app/assets/icons/solid/moon.svg +0 -3
- data/app/assets/icons/solid/newspaper.svg +0 -3
- data/app/assets/icons/solid/npm.svg +0 -3
- data/app/assets/icons/solid/outdent.svg +0 -3
- data/app/assets/icons/solid/palette.svg +0 -3
- data/app/assets/icons/solid/paper-plane.svg +0 -3
- data/app/assets/icons/solid/paragraph.svg +0 -3
- data/app/assets/icons/solid/pause.svg +0 -3
- data/app/assets/icons/solid/pen-nib.svg +0 -3
- data/app/assets/icons/solid/pen.svg +0 -3
- data/app/assets/icons/solid/phone.svg +0 -3
- data/app/assets/icons/solid/play.svg +0 -3
- data/app/assets/icons/solid/printer.svg +0 -3
- data/app/assets/icons/solid/profile-card.svg +0 -3
- data/app/assets/icons/solid/question-circle.svg +0 -3
- data/app/assets/icons/solid/quote.svg +0 -3
- data/app/assets/icons/solid/react.svg +0 -4
- data/app/assets/icons/solid/receipt.svg +0 -3
- data/app/assets/icons/solid/rectangle-list.svg +0 -3
- data/app/assets/icons/solid/reply-all.svg +0 -3
- data/app/assets/icons/solid/reply.svg +0 -3
- data/app/assets/icons/solid/rocket.svg +0 -3
- data/app/assets/icons/solid/sale-percent.svg +0 -3
- data/app/assets/icons/solid/scale-balanced.svg +0 -3
- data/app/assets/icons/solid/search.svg +0 -4
- data/app/assets/icons/solid/share-all.svg +0 -3
- data/app/assets/icons/solid/share-nodes.svg +0 -3
- data/app/assets/icons/solid/shield-check.svg +0 -3
- data/app/assets/icons/solid/shield.svg +0 -3
- data/app/assets/icons/solid/shopping-bag.svg +0 -3
- data/app/assets/icons/solid/stackoverflow.svg +0 -4
- data/app/assets/icons/solid/star-half-stroke.svg +0 -3
- data/app/assets/icons/solid/star-half.svg +0 -3
- data/app/assets/icons/solid/star.svg +0 -3
- data/app/assets/icons/solid/store.svg +0 -3
- data/app/assets/icons/solid/sun.svg +0 -3
- data/app/assets/icons/solid/swatchbook.svg +0 -3
- data/app/assets/icons/solid/table-column.svg +0 -3
- data/app/assets/icons/solid/table-row.svg +0 -3
- data/app/assets/icons/solid/tablet.svg +0 -3
- data/app/assets/icons/solid/tag.svg +0 -3
- data/app/assets/icons/solid/tailwind.svg +0 -3
- data/app/assets/icons/solid/terminal.svg +0 -3
- data/app/assets/icons/solid/thumbs-down.svg +0 -3
- data/app/assets/icons/solid/thumbs-up.svg +0 -3
- data/app/assets/icons/solid/ticket.svg +0 -3
- data/app/assets/icons/solid/trash-bin.svg +0 -3
- data/app/assets/icons/solid/truck.svg +0 -3
- data/app/assets/icons/solid/twitter.svg +0 -3
- data/app/assets/icons/solid/upload.svg +0 -3
- data/app/assets/icons/solid/user-add.svg +0 -3
- data/app/assets/icons/solid/user-circle.svg +0 -3
- data/app/assets/icons/solid/user-edit.svg +0 -3
- data/app/assets/icons/solid/user-headset.svg +0 -3
- data/app/assets/icons/solid/user-remove.svg +0 -3
- data/app/assets/icons/solid/user-settings.svg +0 -3
- data/app/assets/icons/solid/user.svg +0 -3
- data/app/assets/icons/solid/users-group.svg +0 -3
- data/app/assets/icons/solid/users.svg +0 -3
- data/app/assets/icons/solid/video-camera.svg +0 -3
- data/app/assets/icons/solid/volume-down.svg +0 -4
- data/app/assets/icons/solid/volume-up.svg +0 -5
- data/app/assets/icons/solid/vue.svg +0 -3
- data/app/assets/icons/solid/wallet.svg +0 -4
- data/app/assets/icons/solid/wand-magic-sparkles.svg +0 -4
- data/app/assets/icons/solid/window-restore.svg +0 -4
- data/app/assets/icons/solid/window.svg +0 -3
- data/app/assets/icons/solid/youtube.svg +0 -3
- data/app/assets/icons/solid/zoom-in.svg +0 -3
- data/app/assets/icons/solid/zoom-out.svg +0 -3
- data/app/views/components/action_button/action_button_component.html.erb +0 -7
- data/app/views/components/action_button/action_button_component.rb +0 -15
- data/app/views/components/attributes.rb +0 -184
- data/app/views/components/base.rb +0 -29
- data/app/views/components/block/block_component.html.erb +0 -3
- data/app/views/components/block/block_component.rb +0 -44
- data/app/views/components/breadcrumbs/breadcrumbs_component.html.erb +0 -96
- data/app/views/components/breadcrumbs/breadcrumbs_component.rb +0 -9
- data/app/views/components/button/button_component.html.erb +0 -11
- data/app/views/components/button/button_component.rb +0 -128
- data/app/views/components/dyna_frame_content/dyna_frame_content_component.html.erb +0 -8
- data/app/views/components/dyna_frame_content/dyna_frame_content_component.rb +0 -6
- data/app/views/components/dyna_frame_host/dyna_frame_host_component.html.erb +0 -3
- data/app/views/components/dyna_frame_host/dyna_frame_host_component.rb +0 -18
- data/app/views/components/empty_card/empty_card_component.html.erb +0 -6
- data/app/views/components/empty_card/empty_card_component.rb +0 -7
- data/app/views/components/form/form_builder.rb +0 -75
- data/app/views/components/form/form_component.html.erb +0 -73
- data/app/views/components/form/form_component.rb +0 -23
- data/app/views/components/has_many_panel/has_many_panel_component.html.erb +0 -25
- data/app/views/components/has_many_panel/has_many_panel_component.rb +0 -16
- data/app/views/components/header/header_component.html.erb +0 -1
- data/app/views/components/header/header_component.rb +0 -7
- data/app/views/components/interactive_action_form/interactive_action_form_component.html.erb +0 -39
- data/app/views/components/interactive_action_form/interactive_action_form_component.rb +0 -8
- data/app/views/components/nav_grid_menu/nav_grid_menu_component.html.erb +0 -24
- data/app/views/components/nav_grid_menu/nav_grid_menu_component.rb +0 -23
- data/app/views/components/nav_grid_menu_item/nav_grid_menu_item_component.html.erb +0 -4
- data/app/views/components/nav_grid_menu_item/nav_grid_menu_item_component.rb +0 -20
- data/app/views/components/nav_user/nav_user_component.html.erb +0 -50
- data/app/views/components/nav_user/nav_user_component.rb +0 -32
- data/app/views/components/nav_user_link/nav_user_link_component.html.erb +0 -7
- data/app/views/components/nav_user_link/nav_user_link_component.rb +0 -23
- data/app/views/components/nav_user_section/nav_user_section_component.html.erb +0 -7
- data/app/views/components/nav_user_section/nav_user_section_component.rb +0 -18
- data/app/views/components/nested_resource_form_fields/nested_resource_form_fields_component.html.erb +0 -64
- data/app/views/components/nested_resource_form_fields/nested_resource_form_fields_component.rb +0 -29
- data/app/views/components/pagination/pagination_component.html.erb +0 -6
- data/app/views/components/pagination/pagination_component.rb +0 -94
- data/app/views/components/panel/panel_component.html.erb +0 -17
- data/app/views/components/panel/panel_component.rb +0 -17
- data/app/views/components/resource_header/resource_header_component.html.erb +0 -83
- data/app/views/components/resource_header/resource_header_component.rb +0 -30
- data/app/views/components/resource_layout/resource_layout_component.html.erb +0 -53
- data/app/views/components/resource_layout/resource_layout_component.rb +0 -41
- data/app/views/components/sidebar/sidebar_component.html.erb +0 -69
- data/app/views/components/sidebar/sidebar_component.rb +0 -23
- data/app/views/components/sidebar_menu/sidebar_menu_component.html.erb +0 -5
- data/app/views/components/sidebar_menu/sidebar_menu_component.rb +0 -17
- data/app/views/components/sidebar_menu_item/sidebar_menu_item_component.html.erb +0 -64
- data/app/views/components/sidebar_menu_item/sidebar_menu_item_component.rb +0 -52
- data/app/views/components/skeleton/table/table_component.html.erb +0 -18
- data/app/views/components/skeleton/table/table_component.rb +0 -6
- data/app/views/components/table/table_component.html.erb +0 -43
- data/app/views/components/table/table_component.rb +0 -159
- data/app/views/components/table_search_input/table_search_input_component.html.erb +0 -48
- data/app/views/components/table_search_input/table_search_input_component.rb +0 -15
- data/app/views/components/table_toolbar/table_toolbar_component.html.erb +0 -7
- data/app/views/components/table_toolbar/table_toolbar_component.rb +0 -17
- data/app/views/components/toolbar/toolbar_component.html.erb +0 -67
- data/app/views/components/toolbar/toolbar_component.rb +0 -26
- data/app/views/layouts/resource.html copy.erb +0 -49
- data/app/views/plutonium/_resource_header.html copy.erb +0 -287
- data/lib/generators/pu/gen/component/component_generator.rb +0 -99
- data/lib/generators/pu/gen/component/templates/component.html.erb.tt +0 -3
- data/lib/generators/pu/gen/component/templates/component.rb.tt +0 -15
- data/lib/generators/pu/gen/component/templates/controller.js.tt +0 -8
- data/lib/plutonium/builders/menus/sidebar_menu.rb.bk +0 -26
- data/lib/plutonium/builders/menus/sidebar_menu_item.rb.bk +0 -28
- data/lib/plutonium/component_registry.rb +0 -19
- data/lib/plutonium/core/action.rb +0 -49
- data/lib/plutonium/core/actions/basic_action.rb +0 -16
- data/lib/plutonium/core/actions/collection.rb +0 -37
- data/lib/plutonium/core/actions/destroy_action.rb +0 -23
- data/lib/plutonium/core/actions/edit_action.rb +0 -21
- data/lib/plutonium/core/actions/interactive_action.rb +0 -64
- data/lib/plutonium/core/actions/new_action.rb +0 -20
- data/lib/plutonium/core/actions/show_action.rb +0 -19
- data/lib/plutonium/core/associations/renderers/base.rb +0 -77
- data/lib/plutonium/core/associations/renderers/factory.rb +0 -36
- data/lib/plutonium/core/associations/renderers/has_many_renderer.rb +0 -18
- data/lib/plutonium/core/autodiscovery/association_renderer_discoverer.rb +0 -31
- data/lib/plutonium/core/autodiscovery/discoverer.rb +0 -15
- data/lib/plutonium/core/autodiscovery/input_discoverer.rb +0 -31
- data/lib/plutonium/core/autodiscovery/renderer_discoverer.rb +0 -31
- data/lib/plutonium/core/definers/action_definer.rb +0 -25
- data/lib/plutonium/core/definers/association_renderer_definer.rb +0 -33
- data/lib/plutonium/core/definers/field_definer.rb +0 -19
- data/lib/plutonium/core/definers/field_input_definer.rb +0 -77
- data/lib/plutonium/core/definers/field_renderer_definer.rb +0 -37
- data/lib/plutonium/core/fields/inputs/attachment_input.rb +0 -24
- data/lib/plutonium/core/fields/inputs/base.rb +0 -110
- data/lib/plutonium/core/fields/inputs/belongs_to_association_input.rb +0 -15
- data/lib/plutonium/core/fields/inputs/checkbox_input.rb +0 -15
- data/lib/plutonium/core/fields/inputs/date_time_input.rb +0 -15
- data/lib/plutonium/core/fields/inputs/factory.rb +0 -50
- data/lib/plutonium/core/fields/inputs/has_many_association_input.rb +0 -15
- data/lib/plutonium/core/fields/inputs/nested_input.rb +0 -72
- data/lib/plutonium/core/fields/inputs/noop_input.rb +0 -16
- data/lib/plutonium/core/fields/inputs/phone_input.rb +0 -22
- data/lib/plutonium/core/fields/inputs/polymorphic_belongs_to_association_input.rb +0 -48
- data/lib/plutonium/core/fields/inputs/simple_form_association_input.rb +0 -26
- data/lib/plutonium/core/fields/inputs/simple_form_input.rb +0 -13
- data/lib/plutonium/core/fields/renderers/association_renderer.rb +0 -28
- data/lib/plutonium/core/fields/renderers/attachment_renderer.rb +0 -21
- data/lib/plutonium/core/fields/renderers/base.rb +0 -83
- data/lib/plutonium/core/fields/renderers/basic_renderer.rb +0 -13
- data/lib/plutonium/core/fields/renderers/factory.rb +0 -37
- data/lib/plutonium/core/renderable.rb +0 -20
- data/lib/plutonium/core/ui/collection.rb +0 -18
- data/lib/plutonium/core/ui/detail.rb +0 -15
- data/lib/plutonium/core/ui/form.rb +0 -12
- data/lib/plutonium/helpers/action_buttons_helper.rb +0 -32
- data/lib/plutonium/helpers/component_helper.rb +0 -14
- data/lib/plutonium/helpers/form_helper.rb +0 -50
- data/lib/plutonium/icons.rb +0 -32
- data/lib/plutonium/preserved__/field.rb.bk +0 -65
- data/lib/plutonium/preserved__/input.rb.bk +0 -93
- data/lib/plutonium/ui/table/components/pagy_page_info.rb +0 -70
- data/src/js/controllers/has_many_panel_controller.js +0 -8
- data/src/js/controllers/interactive_action_form_controller.js +0 -13
- data/src/js/controllers/nav_grid_menu_controller.js +0 -8
- data/src/js/controllers/nav_grid_menu_item_controller.js +0 -8
- data/src/js/controllers/nav_user_controller.js +0 -8
- data/src/js/controllers/nav_user_link_controller.js +0 -8
- data/src/js/controllers/nav_user_section_controller.js +0 -8
- data/src/js/controllers/resource_layout_controller.js +0 -8
- data/src/js/controllers/sidebar_controller.js +0 -8
- data/src/js/controllers/sidebar_menu_controller.js +0 -8
- data/src/js/controllers/sidebar_menu_item_controller.js +0 -8
- data/src/js/controllers/table_controller.js +0 -8
- data/src/js/controllers/table_search_input_controller.js +0 -8
- data/src/js/controllers/table_toolbar_controller.js +0 -8
- data/src/js/controllers/toolbar_controller.js +0 -8
@@ -0,0 +1,93 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Plutonium
|
4
|
+
module UI
|
5
|
+
module Display
|
6
|
+
module Components
|
7
|
+
class Attachment < Phlexi::Display::Components::Base
|
8
|
+
include Phlexi::Display::Components::Concerns::DisplaysValue
|
9
|
+
include Plutonium::UI::Component::Methods
|
10
|
+
include Plutonium::UI::Component::Behaviour
|
11
|
+
|
12
|
+
def render_value(attachment)
|
13
|
+
return unless attachment.url.present?
|
14
|
+
|
15
|
+
div(
|
16
|
+
class: "p-2 w-full",
|
17
|
+
title: attachment.filename,
|
18
|
+
data: {
|
19
|
+
controller: "attachment-preview",
|
20
|
+
attachment_preview_mime_type_value: attachment.content_type,
|
21
|
+
attachment_preview_thumbnail_url_value: attachment_thumbnail_url(attachment)
|
22
|
+
}
|
23
|
+
) do
|
24
|
+
div(class: "flex flex-col items-center w-full") do
|
25
|
+
render_thumbnail(attachment)
|
26
|
+
render_caption(attachment)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
private
|
32
|
+
|
33
|
+
def render_thumbnail(attachment)
|
34
|
+
return unless attachment.url.present?
|
35
|
+
|
36
|
+
div(
|
37
|
+
class: "w-full aspect-square bg-white border border-gray-200 rounded-lg shadow hover:bg-gray-50 dark:bg-gray-800 dark:border-gray-700 dark:hover:bg-gray-700 transition-all duration-300",
|
38
|
+
data: {attachment_preview_target: "thumbnail"}
|
39
|
+
) do
|
40
|
+
a(
|
41
|
+
href: attachment.url,
|
42
|
+
class: "block aspect-square overflow-hidden rounded-lg",
|
43
|
+
target: :blank,
|
44
|
+
data: {attachment_preview_target: "thumbnailLink"}
|
45
|
+
) do
|
46
|
+
thumbnail_url = attachment_thumbnail_url(attachment)
|
47
|
+
if thumbnail_url
|
48
|
+
img(
|
49
|
+
src: thumbnail_url,
|
50
|
+
class: "w-full h-full object-cover"
|
51
|
+
)
|
52
|
+
else
|
53
|
+
div(class: "w-full h-full flex items-center justify-center text-gray-500 dark:text-gray-400 font-mono") do
|
54
|
+
".#{attachment_extension(attachment)}"
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
def render_caption(attachment)
|
62
|
+
return if attributes[:caption] == false
|
63
|
+
|
64
|
+
div(class: "w-full p-2 text-sm text-gray-700 dark:text-gray-300 truncate text-center") do
|
65
|
+
caption = attributes[:caption] || attachment.filename
|
66
|
+
a(
|
67
|
+
href: attachment.url,
|
68
|
+
class: "hover:text-primary-600 dark:hover:text-primary-500 transition-colors duration-200",
|
69
|
+
target: :blank
|
70
|
+
) do
|
71
|
+
phlexi_render(caption) {
|
72
|
+
plain caption
|
73
|
+
}
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
def attachment_thumbnail_url(attachment)
|
79
|
+
attachment.url if attachment.representable?
|
80
|
+
end
|
81
|
+
|
82
|
+
def attachment_extension(attachment)
|
83
|
+
attachment.try(:extension) || File.extname(attachment.filename.to_s)
|
84
|
+
end
|
85
|
+
|
86
|
+
def normalize_value(value)
|
87
|
+
value
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
@@ -5,9 +5,10 @@ require "redcarpet"
|
|
5
5
|
module Plutonium
|
6
6
|
module UI
|
7
7
|
module Display
|
8
|
-
module
|
8
|
+
module Components
|
9
9
|
class Markdown < Phlexi::Display::Components::Base
|
10
10
|
include Phlexi::Display::Components::Concerns::DisplaysValue
|
11
|
+
include Plutonium::UI::Component::Methods
|
11
12
|
|
12
13
|
RENDERER = Redcarpet::Markdown.new(
|
13
14
|
Redcarpet::Render::HTML.new(
|
@@ -31,6 +31,10 @@ module Plutonium
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def render_associations
|
34
|
+
return unless resource_associations.present?
|
35
|
+
|
36
|
+
tablist = BuildTabList()
|
37
|
+
|
34
38
|
resource_associations.each do |name|
|
35
39
|
reflection = object.class.reflect_on_association name
|
36
40
|
|
@@ -50,16 +54,26 @@ module Plutonium
|
|
50
54
|
when :has_many
|
51
55
|
resource_url_for(reflection.klass, parent: object)
|
52
56
|
end
|
53
|
-
|
57
|
+
|
58
|
+
next unless src
|
59
|
+
|
60
|
+
tablist.with_tab(
|
61
|
+
identifier: title.parameterize,
|
62
|
+
title: -> { h5(class: "text-2xl font-bold tracking-tight text-gray-900 dark:text-white") { title } }
|
63
|
+
) do
|
64
|
+
FrameNavigatorPanel(title: "", src:)
|
65
|
+
end
|
54
66
|
end
|
67
|
+
|
68
|
+
render tablist
|
55
69
|
end
|
56
70
|
|
57
71
|
def render_resource_field(name)
|
58
72
|
when_permitted(name) do
|
59
73
|
# field :name, as: :string
|
60
74
|
# display :name, as: :string
|
61
|
-
# display :description, class: "col-span-full"
|
62
|
-
# display :age,
|
75
|
+
# display :description, wrapper: {class: "col-span-full"}
|
76
|
+
# display :age, class: "max-h-fit"
|
63
77
|
# display :dob do |f|
|
64
78
|
# f.date_tag
|
65
79
|
# end
|
@@ -69,15 +83,16 @@ module Plutonium
|
|
69
83
|
display_definition = resource_definition.defined_displays[name] || {}
|
70
84
|
display_options = display_definition[:options] || {}
|
71
85
|
|
72
|
-
tag =
|
73
|
-
tag_attributes = display_options
|
86
|
+
tag = display_options[:as] || field_options[:as]
|
87
|
+
tag_attributes = display_options.except(:wrapper, :as)
|
74
88
|
tag_block = display_definition[:block] || ->(f) {
|
75
89
|
tag ||= f.inferred_field_component
|
76
90
|
f.send(:"#{tag}_tag", **tag_attributes)
|
77
91
|
}
|
78
92
|
|
93
|
+
wrapper_options = display_options[:wrapper] || {}
|
94
|
+
|
79
95
|
field_options = field_options.except(:as)
|
80
|
-
wrapper_options = display_options.except(:tag, :as)
|
81
96
|
render field(name, **field_options).wrapped(**wrapper_options) do |f|
|
82
97
|
render instance_exec(f, &tag_block)
|
83
98
|
end
|
@@ -21,7 +21,8 @@ module Plutonium
|
|
21
21
|
phone: "flex items-center text-md text-primary-600 dark:text-primary-500 mb-1 whitespace-pre-line",
|
22
22
|
json: "text-sm text-gray-900 dark:text-white mb-1 whitespace-pre font-mono shadow-inner p-4",
|
23
23
|
prefixed_icon: "w-8 h-8 mr-2",
|
24
|
-
markdown: "format dark:format-invert format-primary"
|
24
|
+
markdown: "format dark:format-invert format-primary",
|
25
|
+
attachment_value_wrapper: "grid grid-cols-[repeat(auto-fill,minmax(0,180px))]"
|
25
26
|
})
|
26
27
|
end
|
27
28
|
end
|
@@ -37,11 +37,18 @@ module Plutonium
|
|
37
37
|
create_component(Components::IntlTelInput, :int_tel_input, **, &)
|
38
38
|
end
|
39
39
|
alias_method :phone_tag, :int_tel_input_tag
|
40
|
+
|
41
|
+
def uppy_tag(**, &)
|
42
|
+
create_component(Components::Uppy, :uppy, **, &)
|
43
|
+
end
|
44
|
+
alias_method :file_tag, :uppy_tag
|
40
45
|
end
|
41
46
|
|
42
47
|
private
|
43
48
|
|
44
49
|
def render_actions
|
50
|
+
input name: :return_to, value: request.params[:return_to], type: :hidden, hidden: true
|
51
|
+
|
45
52
|
actions_wrapper {
|
46
53
|
render submit_button
|
47
54
|
}
|
@@ -7,14 +7,58 @@ module Plutonium
|
|
7
7
|
class BelongsTo < Phlexi::Form::Components::BelongsTo
|
8
8
|
include Plutonium::UI::Component::Methods
|
9
9
|
|
10
|
+
def view_template
|
11
|
+
div(class: "flex space-x-1") do
|
12
|
+
super
|
13
|
+
render_add_button
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
10
17
|
private
|
11
18
|
|
19
|
+
def add_url
|
20
|
+
@add_url ||= begin
|
21
|
+
return unless @skip_authorization || allowed_to?(:create?, association_reflection.klass)
|
22
|
+
|
23
|
+
url = @add_action || resource_url_for(association_reflection.klass, action: :new, parent: nil)
|
24
|
+
return unless url
|
25
|
+
|
26
|
+
uri = URI(url)
|
27
|
+
uri.query = URI.encode_www_form({return_to: request.original_url})
|
28
|
+
uri.to_s
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
def render_add_button
|
33
|
+
return if @add_action == false || add_url.nil?
|
34
|
+
|
35
|
+
a(
|
36
|
+
href: add_url,
|
37
|
+
class:
|
38
|
+
"bg-gray-100 dark:bg-gray-600 dark:hover:bg-gray-700 dark:border-gray-500 hover:bg-gray-200 border border-gray-300 rounded-lg p-3 focus:ring-gray-100 dark:focus:ring-gray-700 focus:ring-2 focus:outline-none dark:text-white"
|
39
|
+
) do
|
40
|
+
render Phlex::TablerIcons::Plus.new(class: "w-3 h-3")
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
12
44
|
def choices
|
13
45
|
@choices ||= begin
|
14
|
-
collection =
|
46
|
+
collection = if @provided_choices || @skip_authorization
|
47
|
+
@choice_collection
|
48
|
+
else
|
49
|
+
authorized_resource_scope(association_reflection.klass, relation: @choice_collection)
|
50
|
+
end
|
15
51
|
Phlexi::Form::ChoicesMapper.new(collection, label_method: @label_method, value_method: @value_method)
|
16
52
|
end
|
17
53
|
end
|
54
|
+
|
55
|
+
def build_attributes
|
56
|
+
@provided_choices = !attributes[:choices].nil?
|
57
|
+
@skip_authorization = attributes.delete(:skip_authorization)
|
58
|
+
@add_action = attributes.delete(:add_action)
|
59
|
+
|
60
|
+
super
|
61
|
+
end
|
18
62
|
end
|
19
63
|
end
|
20
64
|
end
|
@@ -7,14 +7,58 @@ module Plutonium
|
|
7
7
|
class HasMany < Phlexi::Form::Components::HasMany
|
8
8
|
include Plutonium::UI::Component::Methods
|
9
9
|
|
10
|
+
def view_template
|
11
|
+
div(class: "flex space-x-1") do
|
12
|
+
super
|
13
|
+
render_add_button
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
10
17
|
private
|
11
18
|
|
19
|
+
def add_url
|
20
|
+
@add_url ||= begin
|
21
|
+
return unless @skip_authorization || allowed_to?(:create?, association_reflection.klass)
|
22
|
+
|
23
|
+
url = @add_action || resource_url_for(association_reflection.klass, action: :new, parent: nil)
|
24
|
+
return unless url
|
25
|
+
|
26
|
+
uri = URI(url)
|
27
|
+
uri.query = URI.encode_www_form({return_to: request.original_url})
|
28
|
+
uri.to_s
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
def render_add_button
|
33
|
+
return if @add_action == false || add_url.nil?
|
34
|
+
|
35
|
+
a(
|
36
|
+
href: add_url,
|
37
|
+
class:
|
38
|
+
"bg-gray-100 dark:bg-gray-600 dark:hover:bg-gray-700 dark:border-gray-500 hover:bg-gray-200 border border-gray-300 rounded-lg p-3 focus:ring-gray-100 dark:focus:ring-gray-700 focus:ring-2 focus:outline-none dark:text-white"
|
39
|
+
) do
|
40
|
+
render Phlex::TablerIcons::Plus.new(class: "w-3 h-3")
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
12
44
|
def choices
|
13
45
|
@choices ||= begin
|
14
|
-
collection =
|
46
|
+
collection = if @provided_choices || @skip_authorization
|
47
|
+
@choice_collection
|
48
|
+
else
|
49
|
+
authorized_resource_scope(association_reflection.klass, relation: @choice_collection)
|
50
|
+
end
|
15
51
|
Phlexi::Form::ChoicesMapper.new(collection, label_method: @label_method, value_method: @value_method)
|
16
52
|
end
|
17
53
|
end
|
54
|
+
|
55
|
+
def build_attributes
|
56
|
+
@provided_choices = !attributes[:choices].nil?
|
57
|
+
@skip_authorization = attributes.delete(:skip_authorization)
|
58
|
+
@add_action = attributes.delete(:add_action)
|
59
|
+
|
60
|
+
super
|
61
|
+
end
|
18
62
|
end
|
19
63
|
end
|
20
64
|
end
|
@@ -0,0 +1,173 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Plutonium
|
4
|
+
module UI
|
5
|
+
module Form
|
6
|
+
module Components
|
7
|
+
class Uppy < Phlexi::Form::Components::Input
|
8
|
+
include Phlexi::Form::Components::Concerns::UploadsFile
|
9
|
+
|
10
|
+
def view_template
|
11
|
+
div(class: tokens(field.dom.id, "flex flex-col-reverse gap-2")) do
|
12
|
+
div do
|
13
|
+
# Hidden field for ensuring removal of esp. has_one_attached attachments
|
14
|
+
input(type: :hidden, name: attributes[:name], multiple: attributes[:multiple], value: nil, autocomplete: "off", hidden: true)
|
15
|
+
|
16
|
+
next if field.value.nil?
|
17
|
+
|
18
|
+
div(
|
19
|
+
class: "attachment-preview-container grid grid-cols-[repeat(auto-fill,minmax(0,180px))] gap-4",
|
20
|
+
data_controller: "attachment-preview-container"
|
21
|
+
) do
|
22
|
+
render_existing_attachments
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
div(class: "attachment-input") do
|
27
|
+
input(
|
28
|
+
**build_direct_upload_options,
|
29
|
+
**attributes,
|
30
|
+
class: tokens(@input_class, attributes[:class])
|
31
|
+
)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
protected
|
37
|
+
|
38
|
+
def build_input_attributes
|
39
|
+
attributes[:type] = :file
|
40
|
+
super
|
41
|
+
|
42
|
+
@input_class = field.dom.id
|
43
|
+
@include_hidden = attributes.delete(:include_hidden)
|
44
|
+
# ensure we are always setting it to false
|
45
|
+
attributes[:value] = false
|
46
|
+
|
47
|
+
if attributes[:multiple]
|
48
|
+
attributes[:name] = "#{attributes[:name].sub(/\[\]$/, "")}[]"
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
private
|
53
|
+
|
54
|
+
def render_existing_attachments
|
55
|
+
Array(field.value).each do |attachment|
|
56
|
+
next unless attachment&.url.present?
|
57
|
+
|
58
|
+
render_attachment_preview(attachment)
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
def render_attachment_preview(attachment)
|
63
|
+
input_name = if attributes[:multiple]
|
64
|
+
"#{attributes[:name].sub(/\[\]$/, "")}[]"
|
65
|
+
else
|
66
|
+
attributes[:name]
|
67
|
+
end
|
68
|
+
|
69
|
+
div(
|
70
|
+
class: "attachment-preview group relative bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-sm hover:shadow-md transition-all duration-300",
|
71
|
+
data: {
|
72
|
+
controller: "attachment-preview",
|
73
|
+
attachment_preview_mime_type_value: attachment.content_type,
|
74
|
+
attachment_preview_thumbnail_url_value: attachment_thumbnail_url(attachment),
|
75
|
+
attachment_preview_target: "thumbnail"
|
76
|
+
},
|
77
|
+
title: attachment.filename
|
78
|
+
) do
|
79
|
+
# Hidden field to preserve the uploaded file
|
80
|
+
input(type: :hidden, name: input_name, multiple: attributes[:multiple], value: attachment.signed_id, autocomplete: "off", hidden: true)
|
81
|
+
|
82
|
+
render_preview_content(attachment)
|
83
|
+
render_filename(attachment)
|
84
|
+
render_delete_button
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
def render_preview_content(attachment)
|
89
|
+
a(
|
90
|
+
href: attachment.url,
|
91
|
+
class: "block aspect-square overflow-hidden rounded-t-lg",
|
92
|
+
target: :blank,
|
93
|
+
data: {attachment_preview_target: "thumbnailLink"}
|
94
|
+
) do
|
95
|
+
if attachment_thumbnail_url(attachment)
|
96
|
+
img(
|
97
|
+
src: attachment_thumbnail_url(attachment),
|
98
|
+
class: "w-full h-full object-cover"
|
99
|
+
)
|
100
|
+
else
|
101
|
+
div(
|
102
|
+
class: "w-full h-full flex items-center justify-center bg-gray-50 dark:bg-gray-900 text-gray-500 dark:text-gray-400 font-mono"
|
103
|
+
) do
|
104
|
+
".#{attachment_extension(attachment)}"
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
110
|
+
def render_filename(attachment)
|
111
|
+
div(
|
112
|
+
class: "px-2 py-1.5 text-sm text-gray-700 dark:text-gray-300 border-t border-gray-200 dark:border-gray-700 truncate text-center bg-white dark:bg-gray-800",
|
113
|
+
title: attachment.filename
|
114
|
+
) do
|
115
|
+
plain attachment.filename.to_s
|
116
|
+
end
|
117
|
+
end
|
118
|
+
|
119
|
+
def render_delete_button
|
120
|
+
button(
|
121
|
+
type: "button",
|
122
|
+
class: "w-full py-2 px-4 text-sm text-red-600 dark:text-red-400 bg-white dark:bg-gray-800 hover:bg-red-50 dark:hover:bg-red-900/50 rounded-b-lg transition-colors duration-200 flex items-center justify-center gap-2 border-t border-gray-200 dark:border-gray-700",
|
123
|
+
data: {action: "click->attachment-preview#remove"}
|
124
|
+
) do
|
125
|
+
span(class: "bi bi-trash")
|
126
|
+
plain "Delete"
|
127
|
+
end
|
128
|
+
end
|
129
|
+
|
130
|
+
def attachment_thumbnail_url(attachment)
|
131
|
+
attachment.url if attachment.representable?
|
132
|
+
end
|
133
|
+
|
134
|
+
def attachment_extension(attachment)
|
135
|
+
attachment.try(:extension) || File.extname(attachment.filename.to_s)
|
136
|
+
end
|
137
|
+
|
138
|
+
def build_direct_upload_options
|
139
|
+
return {} unless attributes[:direct_upload]
|
140
|
+
|
141
|
+
direct_upload_options = {
|
142
|
+
data: {
|
143
|
+
controller: "attachment-input",
|
144
|
+
attachment_input_identifier_value: @input_class,
|
145
|
+
attachment_input_attachment_preview_outlet: ".#{@input_class} .attachment-preview",
|
146
|
+
attachment_input_attachment_preview_container_outlet: ".#{@input_class} .attachment-preview-container"
|
147
|
+
}
|
148
|
+
}
|
149
|
+
|
150
|
+
{
|
151
|
+
max_file_size: nil,
|
152
|
+
min_file_size: nil,
|
153
|
+
max_total_size: nil,
|
154
|
+
max_file_num: attributes.fetch(:size, field.multiple? ? field.limit : 1),
|
155
|
+
min_file_num: nil,
|
156
|
+
allowed_file_types: nil,
|
157
|
+
required_meta_fields: nil
|
158
|
+
}.each do |key, default_value|
|
159
|
+
value = attributes.key?(key) ? attributes.delete(key) : default_value
|
160
|
+
direct_upload_options[:data][:"attachment_input_#{key}_value"] = value
|
161
|
+
end
|
162
|
+
|
163
|
+
direct_upload_options
|
164
|
+
end
|
165
|
+
|
166
|
+
def normalize_input(input_value)
|
167
|
+
input_value
|
168
|
+
end
|
169
|
+
end
|
170
|
+
end
|
171
|
+
end
|
172
|
+
end
|
173
|
+
end
|
@@ -143,19 +143,19 @@ module Plutonium
|
|
143
143
|
def render_defined_field(nested, resource_definition, name)
|
144
144
|
# field :name, as: :string
|
145
145
|
# input :name, as: :string
|
146
|
-
# input :description, class: "col-span-full"
|
147
|
-
# input :age,
|
146
|
+
# input :description, wrapper: {class: "col-span-full"}
|
147
|
+
# input :age, class: "max-h-fit"
|
148
148
|
# input :dob do |f|
|
149
149
|
# f.date_tag
|
150
150
|
# end
|
151
151
|
|
152
152
|
field_options = resource_definition.defined_fields[name] ? resource_definition.defined_fields[name][:options] : {}
|
153
153
|
|
154
|
-
input_definition =
|
154
|
+
input_definition = definition.defined_inputs[name] || {}
|
155
155
|
input_options = input_definition[:options] || {}
|
156
156
|
|
157
|
-
tag =
|
158
|
-
tag_attributes = input_options
|
157
|
+
tag = input_options[:as] || field_options[:as]
|
158
|
+
tag_attributes = input_options.except(:wrapper, :as)
|
159
159
|
tag_block = input_definition[:block] || ->(f) {
|
160
160
|
tag ||= f.inferred_field_component
|
161
161
|
f.send(:"#{tag}_tag", **tag_attributes, class: tokens(tag_attributes[:class], "flex-1"))
|
@@ -48,8 +48,8 @@ module Plutonium
|
|
48
48
|
def render_simple_resource_field(name, definition, form)
|
49
49
|
# field :name, as: :string
|
50
50
|
# input :name, as: :string
|
51
|
-
# input :description, class: "col-span-full"
|
52
|
-
# input :age,
|
51
|
+
# input :description, wrapper: {class: "col-span-full"}
|
52
|
+
# input :age, class: "max-h-fit"
|
53
53
|
# input :dob do |f|
|
54
54
|
# f.date_tag
|
55
55
|
# end
|
@@ -59,21 +59,21 @@ module Plutonium
|
|
59
59
|
input_definition = definition.defined_inputs[name] || {}
|
60
60
|
input_options = input_definition[:options] || {}
|
61
61
|
|
62
|
-
tag =
|
63
|
-
tag_attributes = input_options
|
62
|
+
tag = input_options[:as] || field_options[:as]
|
63
|
+
tag_attributes = input_options.except(:wrapper, :as)
|
64
64
|
tag_block = input_definition[:block] || ->(f) {
|
65
65
|
tag ||= f.inferred_field_component
|
66
66
|
f.send(:"#{tag}_tag", **tag_attributes)
|
67
67
|
}
|
68
68
|
|
69
|
-
|
70
|
-
wrapper_options = input_options.except(:tag, :as)
|
69
|
+
wrapper_options = input_options[:wrapper] || {}
|
71
70
|
if !wrapper_options[:class] || !wrapper_options[:class].include?("col-span")
|
72
71
|
# temp hack to allow col span overrides
|
73
72
|
# TODO: remove once we complete theming, which will support merges
|
74
73
|
wrapper_options[:class] = tokens("col-span-full", wrapper_options[:class])
|
75
74
|
end
|
76
75
|
|
76
|
+
field_options = field_options.except(:as)
|
77
77
|
render form.field(name, **field_options).wrapped(**wrapper_options) do |f|
|
78
78
|
render instance_exec(f, &tag_block)
|
79
79
|
end
|
@@ -31,7 +31,7 @@ module Plutonium
|
|
31
31
|
valid_color: nil,
|
32
32
|
neutral_color: nil,
|
33
33
|
# file
|
34
|
-
file: "w-full border rounded-md shadow-sm font-medium text-sm dark:bg-gray-700 focus:outline-none",
|
34
|
+
# file: "w-full border rounded-md shadow-sm font-medium text-sm dark:bg-gray-700 focus:outline-none",
|
35
35
|
# hint themes
|
36
36
|
hint: "mt-2 text-sm text-gray-500 dark:text-gray-200",
|
37
37
|
# error themes
|
@@ -47,7 +47,11 @@ module Plutonium
|
|
47
47
|
int_tel_input: :input,
|
48
48
|
valid_int_tel_input: :valid_input,
|
49
49
|
invalid_int_tel_input: :invalid_input,
|
50
|
-
neutral_int_tel_input: :neutral_input
|
50
|
+
neutral_int_tel_input: :neutral_input,
|
51
|
+
uppy: :file,
|
52
|
+
valid_uppy: :valid_file,
|
53
|
+
invalid_uppy: :invalid_file,
|
54
|
+
neutral_uppy: :neutral_file
|
51
55
|
})
|
52
56
|
end
|
53
57
|
end
|
@@ -20,6 +20,26 @@ module Plutonium
|
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
23
|
+
class PanelLink < Plutonium::UI::Component::Base
|
24
|
+
def initialize(label:, icon:, href:, **attributes)
|
25
|
+
@label = label
|
26
|
+
@icon = icon
|
27
|
+
@href = href
|
28
|
+
@attributes = attributes
|
29
|
+
end
|
30
|
+
|
31
|
+
def view_template
|
32
|
+
a(
|
33
|
+
title: @label,
|
34
|
+
class: "text-gray-600 dark:text-gray-300",
|
35
|
+
href: @href,
|
36
|
+
**@attributes
|
37
|
+
) {
|
38
|
+
render @icon.new(class: "w-6 h-6")
|
39
|
+
}
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
23
43
|
class PanelContent < Plutonium::UI::Component::Base
|
24
44
|
def initialize(src:)
|
25
45
|
@src = src
|
@@ -38,12 +58,13 @@ module Plutonium
|
|
38
58
|
end
|
39
59
|
|
40
60
|
def view_template
|
41
|
-
div(data: {controller: %w[
|
61
|
+
div(data: {controller: %w[frame-navigator]}) do
|
42
62
|
Panel do |panel|
|
43
63
|
panel.with_title @title
|
44
|
-
panel.with_item PanelItem.new(label: "Home", icon: Phlex::TablerIcons::Home2, data_frame_navigator_target:
|
45
|
-
panel.with_item PanelItem.new(label: "Back", icon: Phlex::TablerIcons::ChevronLeft, data_frame_navigator_target:
|
46
|
-
panel.with_item PanelItem.new(label: "Refresh", icon: Phlex::TablerIcons::RefreshDot, data_frame_navigator_target:
|
64
|
+
panel.with_item PanelItem.new(label: "Home", icon: Phlex::TablerIcons::Home2, data_frame_navigator_target: "homeButton")
|
65
|
+
panel.with_item PanelItem.new(label: "Back", icon: Phlex::TablerIcons::ChevronLeft, data_frame_navigator_target: "backButton")
|
66
|
+
panel.with_item PanelItem.new(label: "Refresh", icon: Phlex::TablerIcons::RefreshDot, data_frame_navigator_target: "refreshButton")
|
67
|
+
panel.with_item PanelLink.new(label: "Maximize", icon: Phlex::TablerIcons::WindowMaximize, href: @src, data_frame_navigator_target: "maximizeLink")
|
47
68
|
panel.with_content PanelContent.new(src: @src)
|
48
69
|
end
|
49
70
|
end
|
@@ -23,7 +23,7 @@ module Plutonium
|
|
23
23
|
|
24
24
|
def page_title = helpers.controller.instance_variable_get(:@page_title)
|
25
25
|
|
26
|
-
def html_attributes = {lang:, data_controller: "
|
26
|
+
def html_attributes = {lang:, data_controller: "color-mode"}
|
27
27
|
|
28
28
|
def body_attributes = {class: "antialiased min-h-screen bg-gray-50 dark:bg-gray-900"}
|
29
29
|
|
@@ -43,7 +43,7 @@ module Plutonium
|
|
43
43
|
nav(
|
44
44
|
class: "bg-white border-b border-gray-200 px-4 py-2.5 dark:bg-gray-800 dark:border-gray-700 fixed left-0 right-0 top-0 z-50",
|
45
45
|
data: {
|
46
|
-
controller:
|
46
|
+
controller: "resource-header",
|
47
47
|
header_sidebar_outlet: "#sidebar-navigation"
|
48
48
|
}
|
49
49
|
) do
|