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
@@ -1,15 +0,0 @@
|
|
1
|
-
module Plutonium
|
2
|
-
module Core
|
3
|
-
module Fields
|
4
|
-
module Inputs
|
5
|
-
class BelongsToAssociationInput < SimpleFormAssociationInput
|
6
|
-
private
|
7
|
-
|
8
|
-
def param
|
9
|
-
(reflection.respond_to?(:options) && reflection.options[:foreign_key]) || :"#{reflection.name}_id"
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
@@ -1,50 +0,0 @@
|
|
1
|
-
require "simple_form/map_type"
|
2
|
-
|
3
|
-
module Plutonium
|
4
|
-
module Core
|
5
|
-
module Fields
|
6
|
-
module Inputs
|
7
|
-
class Factory
|
8
|
-
extend ::SimpleForm::MapType
|
9
|
-
|
10
|
-
map_type :has_one, to: Plutonium::Core::Fields::Inputs::NoopInput
|
11
|
-
map_type :belongs_to, to: Plutonium::Core::Fields::Inputs::BelongsToAssociationInput
|
12
|
-
map_type :polymorphic_belongs_to, to: Plutonium::Core::Fields::Inputs::PolymorphicBelongsToAssociationInput
|
13
|
-
map_type :has_many, to: Plutonium::Core::Fields::Inputs::HasManyAssociationInput
|
14
|
-
map_type :attachment, to: Plutonium::Core::Fields::Inputs::AttachmentInput
|
15
|
-
map_type :datetime, :date, :time, to: Plutonium::Core::Fields::Inputs::DateTimeInput
|
16
|
-
map_type :phone, to: Plutonium::Core::Fields::Inputs::PhoneInput
|
17
|
-
map_type :boolean, to: Plutonium::Core::Fields::Inputs::CheckboxInput
|
18
|
-
# map_type :text, :string, to: Plutonium::Core::Fields::Inputs::SimpleFormInput
|
19
|
-
|
20
|
-
def self.build(name, type:, **options)
|
21
|
-
input_type = options[:as] || type
|
22
|
-
mapping = mappings[input_type] || Plutonium::Core::Fields::Inputs::SimpleFormInput
|
23
|
-
mapping.new(name, **options)
|
24
|
-
end
|
25
|
-
|
26
|
-
def self.for_resource_attribute(resource_class, attr_name, **options)
|
27
|
-
type = nil
|
28
|
-
|
29
|
-
if (attachment = resource_class.try(:reflect_on_attachment, attr_name))
|
30
|
-
type = :attachment
|
31
|
-
options[:reflection] = attachment
|
32
|
-
elsif (association = resource_class.try(:reflect_on_association, attr_name))
|
33
|
-
type = association.polymorphic? ? :"polymorphic_#{association.macro}" : association.macro
|
34
|
-
options[:reflection] = association
|
35
|
-
elsif (column = resource_class.try(:column_for_attribute, attr_name))
|
36
|
-
type = column.type
|
37
|
-
options[:multiple] = column.try(:array?) if options[:multiple].nil?
|
38
|
-
elsif (filter = resource_class.try(:filters).try(:[], attr_name))
|
39
|
-
# type = filter.database_column_type
|
40
|
-
options[:hint] ||= filter.desc
|
41
|
-
options[:multiple] = column.try(:array?) if options[:multiple].nil?
|
42
|
-
end
|
43
|
-
|
44
|
-
build(attr_name, type:, **options)
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
@@ -1,72 +0,0 @@
|
|
1
|
-
module Plutonium
|
2
|
-
module Core
|
3
|
-
module Fields
|
4
|
-
module Inputs
|
5
|
-
class NestedInput < Base
|
6
|
-
include Plutonium::Core::Definers::FieldInputDefiner
|
7
|
-
|
8
|
-
attr_reader :inputs, :resource_class
|
9
|
-
|
10
|
-
def initialize(name, inputs:, resource_class:, allow_destroy:, update_only:, limit:, **)
|
11
|
-
@inputs = inputs
|
12
|
-
@resource_class = resource_class
|
13
|
-
@allow_destroy = allow_destroy
|
14
|
-
@update_only = update_only
|
15
|
-
@limit = limit
|
16
|
-
|
17
|
-
super(name, **)
|
18
|
-
end
|
19
|
-
|
20
|
-
def render
|
21
|
-
render_component :nested_resource_form_fields, form:, **options
|
22
|
-
end
|
23
|
-
|
24
|
-
def collect(params)
|
25
|
-
nested_params = params[param] || {}
|
26
|
-
attributes = (nested_params.keys.first == "0") ? collect_indexed_attributes(nested_params) : collect_single_attributes(nested_params)
|
27
|
-
{param => attributes}
|
28
|
-
end
|
29
|
-
|
30
|
-
private
|
31
|
-
|
32
|
-
def collect_single_attributes(params)
|
33
|
-
collected = defined_inputs.collect_all(params)
|
34
|
-
collected[:id] = params[:id] if params.key?(:id) && !@update_only
|
35
|
-
collected[:_destroy] = params[:_destroy] if @allow_destroy
|
36
|
-
collected
|
37
|
-
end
|
38
|
-
|
39
|
-
def collect_indexed_attributes(params)
|
40
|
-
attributes = {}
|
41
|
-
params.each do |index, nested_params|
|
42
|
-
collected = defined_inputs.collect_all(nested_params)
|
43
|
-
collected[:id] = nested_params[:id] if nested_params.key?(:id) && !@update_only
|
44
|
-
collected[:_destroy] = nested_params[:_destroy] if @allow_destroy
|
45
|
-
attributes[index] = collected
|
46
|
-
end
|
47
|
-
attributes
|
48
|
-
end
|
49
|
-
|
50
|
-
def param
|
51
|
-
:"#{name}_attributes"
|
52
|
-
end
|
53
|
-
|
54
|
-
def input_options
|
55
|
-
{
|
56
|
-
name:,
|
57
|
-
resource_class:,
|
58
|
-
allow_destroy: @allow_destroy,
|
59
|
-
update_only: @update_only,
|
60
|
-
limit: @limit,
|
61
|
-
inputs: defined_inputs
|
62
|
-
}
|
63
|
-
end
|
64
|
-
|
65
|
-
def defined_inputs
|
66
|
-
@defined_inputs ||= defined_field_inputs_for(*inputs)
|
67
|
-
end
|
68
|
-
end
|
69
|
-
end
|
70
|
-
end
|
71
|
-
end
|
72
|
-
end
|
@@ -1,22 +0,0 @@
|
|
1
|
-
module Plutonium
|
2
|
-
module Core
|
3
|
-
module Fields
|
4
|
-
module Inputs
|
5
|
-
class PhoneInput < SimpleFormInput
|
6
|
-
# def render(view_context, f, record, **opts)
|
7
|
-
# opts = options.deep_merge opts
|
8
|
-
# opts.delete(:as)
|
9
|
-
# f.input name, **opts
|
10
|
-
# end
|
11
|
-
|
12
|
-
# def collect(params)
|
13
|
-
# value = params[param]
|
14
|
-
# country = user_options[:country]
|
15
|
-
# country ||= params[user_options[:country_param].to_sym] if user_options[:country_param].present?
|
16
|
-
# {param => Phonelib.parse(value, country).full_e164}
|
17
|
-
# end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
@@ -1,48 +0,0 @@
|
|
1
|
-
module Plutonium
|
2
|
-
module Core
|
3
|
-
module Fields
|
4
|
-
module Inputs
|
5
|
-
class PolymorphicBelongsToAssociationInput < SimpleFormAssociationInput
|
6
|
-
def render
|
7
|
-
form.input param, **options
|
8
|
-
end
|
9
|
-
|
10
|
-
private
|
11
|
-
|
12
|
-
def param
|
13
|
-
:"#{reflection.name}_sgid"
|
14
|
-
end
|
15
|
-
|
16
|
-
def input_options
|
17
|
-
collection = @user_options.delete(:collection).presence || associated_classes
|
18
|
-
{
|
19
|
-
as: :grouped_select,
|
20
|
-
collection:,
|
21
|
-
label: reflection.name.to_s.humanize,
|
22
|
-
group_label_method: :first,
|
23
|
-
group_method: :last, include_blank: "Select One"
|
24
|
-
}
|
25
|
-
end
|
26
|
-
|
27
|
-
def associated_classes
|
28
|
-
Plutonium.eager_load_rails!
|
29
|
-
|
30
|
-
associated_classes = []
|
31
|
-
ActiveRecord::Base.descendants.each do |model|
|
32
|
-
next unless model.table_exists?
|
33
|
-
model.reflect_on_all_associations(:has_many).each do |association|
|
34
|
-
if association.options[:as] == reflection.name
|
35
|
-
associated_classes << model
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
associated_classes.map { |klass|
|
41
|
-
[klass.model_name.human.pluralize, klass.all]
|
42
|
-
}.to_h
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
@@ -1,26 +0,0 @@
|
|
1
|
-
module Plutonium
|
2
|
-
module Core
|
3
|
-
module Fields
|
4
|
-
module Inputs
|
5
|
-
class SimpleFormAssociationInput < Base
|
6
|
-
attr_reader :reflection
|
7
|
-
|
8
|
-
def initialize(name, reflection:, **)
|
9
|
-
@reflection = reflection
|
10
|
-
super(name, **)
|
11
|
-
end
|
12
|
-
|
13
|
-
def render
|
14
|
-
form.association name, **options
|
15
|
-
end
|
16
|
-
|
17
|
-
private
|
18
|
-
|
19
|
-
def param
|
20
|
-
raise NotImplementedError, "#{self.class}#param"
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
@@ -1,28 +0,0 @@
|
|
1
|
-
module Plutonium
|
2
|
-
module Core
|
3
|
-
module Fields
|
4
|
-
module Renderers
|
5
|
-
class AssociationRenderer < Base
|
6
|
-
attr_reader :reflection
|
7
|
-
|
8
|
-
def initialize(name, reflection:, **user_options)
|
9
|
-
@reflection = reflection
|
10
|
-
super(name, **user_options)
|
11
|
-
end
|
12
|
-
|
13
|
-
def render
|
14
|
-
display_field value:, **options
|
15
|
-
end
|
16
|
-
|
17
|
-
private
|
18
|
-
|
19
|
-
def renderer_options
|
20
|
-
{
|
21
|
-
# helper: value.class.include?(Plutonium: :Resource: :Record) ? :display_association_value : :display_name_of
|
22
|
-
}
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
@@ -1,21 +0,0 @@
|
|
1
|
-
module Plutonium
|
2
|
-
module Core
|
3
|
-
module Fields
|
4
|
-
module Renderers
|
5
|
-
class AttachmentRenderer < AssociationRenderer
|
6
|
-
def render
|
7
|
-
attachment_preview value, **options
|
8
|
-
end
|
9
|
-
|
10
|
-
private
|
11
|
-
|
12
|
-
def renderer_options
|
13
|
-
{
|
14
|
-
caption: true
|
15
|
-
}
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
@@ -1,83 +0,0 @@
|
|
1
|
-
module Plutonium
|
2
|
-
module Core
|
3
|
-
module Fields
|
4
|
-
module Renderers
|
5
|
-
class Base
|
6
|
-
include Plutonium::Core::Renderable
|
7
|
-
|
8
|
-
attr_reader :name
|
9
|
-
|
10
|
-
# Initializes the Base renderer class with a name and user-defined options.
|
11
|
-
#
|
12
|
-
# @param name [String] the name of the renderer.
|
13
|
-
# @param user_options [Hash] user-defined options for the renderer.
|
14
|
-
def initialize(name, **user_options)
|
15
|
-
@name = name
|
16
|
-
@user_options = user_options
|
17
|
-
end
|
18
|
-
|
19
|
-
# Sets the record object on the renderer and merges render options.
|
20
|
-
#
|
21
|
-
# @param record [Object] the record object.
|
22
|
-
# @param render_options [Hash] additional options for rendering.
|
23
|
-
# @return [self] the renderer instance.
|
24
|
-
def with(record:, **render_options)
|
25
|
-
@record = record
|
26
|
-
@render_options = render_options
|
27
|
-
@options = build_options(render_options)
|
28
|
-
|
29
|
-
self
|
30
|
-
end
|
31
|
-
|
32
|
-
def label
|
33
|
-
options[:label] || record.class.human_attribute_name(name)
|
34
|
-
end
|
35
|
-
|
36
|
-
private
|
37
|
-
|
38
|
-
# Returns the merged options for rendering.
|
39
|
-
#
|
40
|
-
# @raise [RuntimeError] if accessed before rendering.
|
41
|
-
# @return [Hash] the merged options.
|
42
|
-
def options
|
43
|
-
raise "cannot access #options before calling #with" unless defined?(@options)
|
44
|
-
|
45
|
-
@options
|
46
|
-
end
|
47
|
-
|
48
|
-
# Returns the record object.
|
49
|
-
#
|
50
|
-
# @raise [RuntimeError] if accessed before rendering.
|
51
|
-
# @return [Object] the record object.
|
52
|
-
def record
|
53
|
-
raise "cannot access #record before calling #with" unless defined?(@record)
|
54
|
-
|
55
|
-
@record
|
56
|
-
end
|
57
|
-
|
58
|
-
# Returns the value of the record's attribute corresponding to the renderer's name.
|
59
|
-
#
|
60
|
-
# @return [Object] the value of the attribute.
|
61
|
-
def value
|
62
|
-
record.public_send(name)
|
63
|
-
end
|
64
|
-
|
65
|
-
# Returns renderer-specific options, can be overridden by subclasses.
|
66
|
-
#
|
67
|
-
# @return [Hash] the renderer-specific options.
|
68
|
-
def renderer_options
|
69
|
-
{}
|
70
|
-
end
|
71
|
-
|
72
|
-
# Builds the options for rendering by merging renderer options, user options, and render options.
|
73
|
-
#
|
74
|
-
# @param render_options [Hash] additional options for rendering.
|
75
|
-
# @return [Hash] the merged options.
|
76
|
-
def build_options(render_options)
|
77
|
-
renderer_options.deep_merge(@user_options).deep_merge(render_options)
|
78
|
-
end
|
79
|
-
end
|
80
|
-
end
|
81
|
-
end
|
82
|
-
end
|
83
|
-
end
|
@@ -1,37 +0,0 @@
|
|
1
|
-
require "simple_form/map_type"
|
2
|
-
|
3
|
-
module Plutonium
|
4
|
-
module Core
|
5
|
-
module Fields
|
6
|
-
module Renderers
|
7
|
-
class Factory
|
8
|
-
extend ::SimpleForm::MapType
|
9
|
-
|
10
|
-
map_type :belongs_to, :has_one, :has_many, to: Plutonium::Core::Fields::Renderers::AssociationRenderer
|
11
|
-
map_type :attachment, to: Plutonium::Core::Fields::Renderers::AttachmentRenderer
|
12
|
-
|
13
|
-
def self.build(name, type:, **)
|
14
|
-
mapping = mappings[type] || Plutonium::Core::Fields::Renderers::BasicRenderer
|
15
|
-
mapping.new(name, **)
|
16
|
-
end
|
17
|
-
|
18
|
-
def self.for_resource_attribute(resource_class, attr_name, **options)
|
19
|
-
type = nil
|
20
|
-
|
21
|
-
if (attachment = resource_class.try(:reflect_on_attachment, attr_name))
|
22
|
-
type = :attachment
|
23
|
-
options[:reflection] = attachment
|
24
|
-
elsif (association = resource_class.try(:reflect_on_association, attr_name))
|
25
|
-
type = association.macro
|
26
|
-
options[:reflection] = association
|
27
|
-
elsif (column = resource_class.try(:column_for_attribute, attr_name))
|
28
|
-
type = column.type
|
29
|
-
end
|
30
|
-
|
31
|
-
build(attr_name, type:, **options)
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
@@ -1,20 +0,0 @@
|
|
1
|
-
module Plutonium
|
2
|
-
module Core
|
3
|
-
module Renderable
|
4
|
-
extend ActiveSupport::Concern
|
5
|
-
|
6
|
-
included do
|
7
|
-
delegate_missing_to :@view_context
|
8
|
-
end
|
9
|
-
|
10
|
-
def render_in(view_context)
|
11
|
-
@view_context = view_context
|
12
|
-
render
|
13
|
-
end
|
14
|
-
|
15
|
-
def render
|
16
|
-
raise NotImplementedError, "#{self.class}#render"
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
@@ -1,18 +0,0 @@
|
|
1
|
-
require "dry-initializer"
|
2
|
-
|
3
|
-
module Plutonium
|
4
|
-
module Core
|
5
|
-
module UI
|
6
|
-
class Collection
|
7
|
-
extend Dry::Initializer
|
8
|
-
|
9
|
-
option :resource_class
|
10
|
-
option :records, default: proc { [] }
|
11
|
-
option :fields, default: proc { {} }
|
12
|
-
option :actions, default: proc { Plutonium::Core::Actions::Collection.new }
|
13
|
-
option :pager, optional: true
|
14
|
-
option :search_object, optional: true
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
module Plutonium
|
2
|
-
module Core
|
3
|
-
module UI
|
4
|
-
class Detail
|
5
|
-
extend Dry::Initializer
|
6
|
-
|
7
|
-
option :resource_class
|
8
|
-
option :record, optional: true
|
9
|
-
option :fields, default: proc { {} }
|
10
|
-
option :associations, default: proc { {} }
|
11
|
-
option :actions, default: proc { Plutonium::Core::Actions::Collection.new }
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
@@ -1,32 +0,0 @@
|
|
1
|
-
module Plutonium
|
2
|
-
module Helpers
|
3
|
-
module ActionButtonsHelper
|
4
|
-
def toolbar_action_button(resource, action)
|
5
|
-
render_component :action_button,
|
6
|
-
classname: "me-2",
|
7
|
-
to: resource_url_for(resource, action: action.route_options.action, **action.route_options.options),
|
8
|
-
method: action.route_options.method,
|
9
|
-
icon: action.icon,
|
10
|
-
label: action.label,
|
11
|
-
tooltip: action.label,
|
12
|
-
color: action.color,
|
13
|
-
confirmation: action.confirmation,
|
14
|
-
size: :xs
|
15
|
-
end
|
16
|
-
|
17
|
-
def table_action_button(resource, action)
|
18
|
-
render_component :action_button,
|
19
|
-
classname: "ms-2",
|
20
|
-
to: resource_url_for(resource, action: action.route_options.action, **action.route_options.options),
|
21
|
-
method: action.route_options.method,
|
22
|
-
icon: action.icon,
|
23
|
-
label: nil, # action.label,
|
24
|
-
tooltip: action.label,
|
25
|
-
color: action.color,
|
26
|
-
confirmation: action.confirmation,
|
27
|
-
variant: :outline,
|
28
|
-
size: :xs
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
@@ -1,14 +0,0 @@
|
|
1
|
-
module Plutonium
|
2
|
-
module Helpers
|
3
|
-
module ComponentHelper
|
4
|
-
def resolve_component(name)
|
5
|
-
Plutonium::ComponentRegistry.resolve name
|
6
|
-
end
|
7
|
-
|
8
|
-
def render_component(name, *, **, &)
|
9
|
-
component = resolve_component name
|
10
|
-
render(component.new(*, **), &)
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
@@ -1,50 +0,0 @@
|
|
1
|
-
module Plutonium
|
2
|
-
module Helpers
|
3
|
-
module FormHelper
|
4
|
-
include ActionView::Helpers::FormHelper
|
5
|
-
|
6
|
-
def resource_form_for(record, **options, &block)
|
7
|
-
options[:url] ||= resource_url_for(record, action: record.new_record? ? :create : :update)
|
8
|
-
options = build_form_options(options)
|
9
|
-
|
10
|
-
with_resource_form_field_error_proc do
|
11
|
-
form_for(record, options, &block)
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
def resource_form_with(**options, &block)
|
16
|
-
options = build_form_options(options)
|
17
|
-
with_resource_form_field_error_proc do
|
18
|
-
form_with(**options, &block)
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
def token_tag(...)
|
23
|
-
# needed to workaround https://github.com/tailwindlabs/tailwindcss/issues/3350
|
24
|
-
super.sub(" />", " hidden />").html_safe
|
25
|
-
end
|
26
|
-
|
27
|
-
private
|
28
|
-
|
29
|
-
def build_form_options(options)
|
30
|
-
options[:builder] ||= PlutoniumUi::FormBuilder
|
31
|
-
options[:wrapper] ||= :default_resource_form
|
32
|
-
options[:html] ||= {}
|
33
|
-
options[:html][:novalidate] = false unless options[:html].key?(:novalidate)
|
34
|
-
options
|
35
|
-
end
|
36
|
-
|
37
|
-
def with_resource_form_field_error_proc
|
38
|
-
# borrowed from https://github.com/heartcombo/simple_form/blob/main/lib/simple_form/action_view_extensions/form_helper.rb#L40C1-L50C10
|
39
|
-
# this does not look threadsafe
|
40
|
-
default_field_error_proc = ::ActionView::Base.field_error_proc
|
41
|
-
begin
|
42
|
-
::ActionView::Base.field_error_proc = proc { |html_tag, instance| html_tag }
|
43
|
-
yield
|
44
|
-
ensure
|
45
|
-
::ActionView::Base.field_error_proc = default_field_error_proc
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|