avo 3.30.4 → 4.0.0.beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +18 -1
- data/Gemfile.lock +257 -174
- data/README.md +1 -1
- data/app/assets/builds/avo/application.css +13979 -0
- data/app/assets/builds/avo/application.js +1160 -0
- data/app/assets/builds/avo/application.js.map +7 -0
- data/app/assets/builds/avo/late-registration.js +2 -0
- data/app/assets/builds/avo/late-registration.js.map +7 -0
- data/app/assets/config/avo_manifest.js +2 -1
- data/app/assets/images/avo/placeholder.svg +1 -0
- data/app/assets/stylesheets/application.css +250 -0
- data/app/assets/stylesheets/css/button-group.css +23 -0
- data/app/assets/stylesheets/css/components/avatar.css +128 -0
- data/app/assets/stylesheets/css/components/breadcrumbs.css +43 -0
- data/app/assets/stylesheets/css/components/button.css +343 -0
- data/app/assets/stylesheets/css/components/color_scheme_switcher.css +226 -0
- data/app/assets/stylesheets/css/components/discreet_information.css +49 -0
- data/app/assets/stylesheets/css/components/field-wrapper.css +107 -0
- data/app/assets/stylesheets/css/components/grid.css +120 -0
- data/app/assets/stylesheets/css/components/input.css +312 -0
- data/app/assets/stylesheets/css/components/modal.css +228 -0
- data/app/assets/stylesheets/css/components/tooltip.css +25 -0
- data/app/assets/stylesheets/css/components/ui/badge.css +143 -0
- data/app/assets/stylesheets/css/components/ui/card.css +95 -0
- data/app/assets/stylesheets/css/components/ui/checkbox.css +50 -0
- data/app/assets/stylesheets/css/components/ui/description_list.css +3 -0
- data/app/assets/stylesheets/css/components/ui/dropdown.css +68 -0
- data/app/assets/stylesheets/css/components/ui/file_upload_input.css +94 -0
- data/app/assets/stylesheets/css/components/ui/file_upload_item.css +78 -0
- data/app/assets/stylesheets/css/components/ui/panel.css +59 -0
- data/app/assets/stylesheets/css/components/ui/panel_header.css +48 -0
- data/app/assets/stylesheets/css/components/ui/radio.css +22 -0
- data/app/assets/stylesheets/css/components/ui/tabs.css +74 -0
- data/app/assets/stylesheets/css/css-animations.css +54 -0
- data/app/assets/stylesheets/css/fields/code.css +75 -9
- data/app/assets/stylesheets/css/fields/easy-mde.css +7 -0
- data/app/assets/stylesheets/css/fields/key_value.css +97 -0
- data/app/assets/stylesheets/css/fields/progress.css +4 -4
- data/app/assets/stylesheets/css/fields/status.css +7 -1
- data/app/assets/stylesheets/css/fields/tags.css +33 -16
- data/app/assets/stylesheets/css/fields/tiptap.css +17 -15
- data/app/assets/stylesheets/css/fields/trix.css +62 -2
- data/app/assets/stylesheets/css/fonts.css +24 -24
- data/app/assets/stylesheets/css/layout.css +135 -0
- data/app/assets/stylesheets/css/pagination.css +114 -78
- data/app/assets/stylesheets/css/resource-controls.css +13 -0
- data/app/assets/stylesheets/css/search.css +22 -12
- data/app/assets/stylesheets/css/sidebar.css +310 -24
- data/app/assets/stylesheets/css/table.css +60 -0
- data/app/assets/stylesheets/css/tooltips.css +1 -1
- data/app/assets/stylesheets/css/typography.css +10 -1
- data/app/assets/stylesheets/css/variables.css +318 -0
- data/app/assets/svgs/avo/moon-plus-plus.svg +1 -0
- data/app/components/avo/actions_component.html.erb +30 -36
- data/app/components/avo/actions_component.rb +8 -11
- data/app/components/avo/alert_component.html.erb +3 -3
- data/app/components/avo/alert_component.rb +1 -1
- data/app/components/avo/asset_manager/javascript_component.html.erb +1 -2
- data/app/components/avo/backtrace_alert_component.html.erb +4 -4
- data/app/components/avo/base_component.rb +3 -4
- data/app/components/avo/breadcrumb_element_component.html.erb +17 -0
- data/app/components/avo/breadcrumb_element_component.rb +21 -0
- data/app/components/avo/breadcrumbs_component.html.erb +19 -0
- data/app/components/avo/breadcrumbs_component.rb +5 -0
- data/app/components/avo/button_component.rb +20 -126
- data/app/components/avo/clipboard_component.html.erb +3 -2
- data/app/components/avo/clipboard_component.rb +1 -1
- data/app/components/avo/component_missing_component.rb +11 -0
- data/app/components/avo/cover_component.html.erb +3 -0
- data/app/components/avo/cover_component.rb +25 -0
- data/app/components/avo/debug/status_component.html.erb +59 -0
- data/app/components/avo/debug/status_component.rb +30 -0
- data/app/components/avo/description_list_component.rb +11 -0
- data/app/components/avo/discreet_information_component.html.erb +31 -6
- data/app/components/avo/discreet_information_component.rb +23 -32
- data/app/components/avo/divider_component.html.erb +2 -2
- data/app/components/avo/empty_state_component.html.erb +2 -9
- data/app/components/avo/empty_state_component.rb +0 -8
- data/app/components/avo/field_wrapper_component.html.erb +21 -22
- data/app/components/avo/field_wrapper_component.rb +9 -18
- data/app/components/avo/fields/avatar_field/index_component.html.erb +9 -0
- data/app/components/avo/fields/avatar_field/index_component.rb +4 -0
- data/app/components/avo/fields/badge_field/index_component.html.erb +7 -1
- data/app/components/avo/fields/badge_field/show_component.html.erb +6 -1
- data/app/components/avo/fields/belongs_to_field/edit_component.html.erb +16 -14
- data/app/components/avo/fields/belongs_to_field/edit_component.rb +13 -3
- data/app/components/avo/fields/boolean_field/edit_component.html.erb +2 -2
- data/app/components/avo/fields/boolean_group_field/edit_component.html.erb +1 -1
- data/app/components/avo/fields/boolean_group_field/edit_component.rb +2 -3
- data/app/components/avo/fields/code_field/show_component.html.erb +1 -1
- data/app/components/avo/fields/common/boolean_check_component.rb +3 -3
- data/app/components/avo/fields/common/boolean_group_component.html.erb +2 -2
- data/app/components/avo/fields/common/files/controls_component.html.erb +30 -27
- data/app/components/avo/fields/common/files/controls_component.rb +0 -1
- data/app/components/avo/fields/common/files/list_viewer_component.html.erb +4 -5
- data/app/components/avo/fields/common/files/view_type/grid_item_component.html.erb +1 -1
- data/app/components/avo/fields/common/files/view_type/list_item_component.html.erb +7 -19
- data/app/components/avo/fields/common/heading_component.html.erb +2 -2
- data/app/components/avo/fields/common/heading_component.rb +1 -1
- data/app/components/avo/fields/common/key_value_component.html.erb +20 -24
- data/app/components/avo/fields/common/nested_field_component.html.erb +1 -1
- data/app/components/avo/fields/common/nested_field_component.rb +1 -1
- data/app/components/avo/fields/common/progress_bar_component.html.erb +2 -2
- data/app/components/avo/fields/common/stars_component.html.erb +1 -1
- data/app/components/avo/fields/common/status_viewer_component.html.erb +4 -10
- data/app/components/avo/fields/date_field/edit_component.html.erb +14 -1
- data/app/components/avo/fields/date_time_field/edit_component.html.erb +3 -3
- data/app/components/avo/fields/easy_mde_field/show_component.html.erb +1 -1
- data/app/components/avo/fields/edit_component.rb +9 -5
- data/app/components/avo/fields/file_field/edit_component.html.erb +14 -6
- data/app/components/avo/fields/files_field/edit_component.html.erb +11 -4
- data/app/components/avo/fields/has_one_field/show_component.html.erb +10 -9
- data/app/components/avo/fields/heading_field/edit_component.html.erb +1 -1
- data/app/components/avo/fields/heading_field/show_component.html.erb +2 -2
- data/app/components/avo/fields/password_field/edit_component.html.erb +5 -7
- data/app/components/avo/fields/progress_bar_field/edit_component.html.erb +1 -1
- data/app/components/avo/fields/radio_field/edit_component.html.erb +1 -1
- data/app/components/avo/fields/show_component.rb +4 -7
- data/app/components/avo/fields/stars_field/edit_component.html.erb +3 -4
- data/app/components/avo/fields/tags_field/edit_component.html.erb +1 -1
- data/app/components/avo/fields/tags_field/tag_component.html.erb +7 -8
- data/app/components/avo/fields/time_field/edit_component.html.erb +3 -3
- data/app/components/avo/fields/tiptap_field/edit_component.html.erb +11 -11
- data/app/components/avo/fields/tiptap_field/show_component.html.erb +4 -4
- data/app/components/avo/fields/trix_field/edit_component.html.erb +2 -2
- data/app/components/avo/filters_component.html.erb +8 -16
- data/app/components/avo/index/field_wrapper_component.html.erb +9 -2
- data/app/components/avo/index/field_wrapper_component.rb +0 -16
- data/app/components/avo/index/grid_cover_empty_state_component.html.erb +16 -2
- data/app/components/avo/index/grid_cover_empty_state_component.rb +90 -0
- data/app/components/avo/index/grid_item_component.html.erb +29 -12
- data/app/components/avo/index/grid_item_component.rb +12 -10
- data/app/components/avo/index/resource_controls_component.html.erb +1 -1
- data/app/components/avo/index/resource_controls_component.rb +7 -17
- data/app/components/avo/index/resource_controls_dropdown_component.html.erb +3 -0
- data/app/components/avo/index/resource_controls_dropdown_component.rb +81 -0
- data/app/components/avo/index/table_row_component.html.erb +11 -11
- data/app/components/avo/items/panel_component.html.erb +8 -18
- data/app/components/avo/items/panel_component.rb +0 -20
- data/app/components/avo/items/switcher_component.html.erb +60 -1
- data/app/components/avo/items/switcher_component.rb +10 -5
- data/app/components/avo/items/visible_items_component.html.erb +2 -1
- data/app/components/avo/items/visible_items_component.rb +1 -0
- data/app/components/avo/media_library/item_details_component.html.erb +2 -2
- data/app/components/avo/media_library/list_component.html.erb +24 -19
- data/app/components/avo/media_library/list_component.rb +2 -2
- data/app/components/avo/media_library/list_item_component.html.erb +3 -3
- data/app/components/avo/modal_component.html.erb +52 -20
- data/app/components/avo/modal_component.rb +7 -12
- data/app/components/avo/paginator_component.html.erb +46 -33
- data/app/components/avo/paginator_component.rb +10 -5
- data/app/components/avo/panel_name_component.html.erb +1 -1
- data/app/components/avo/profile_item_component.html.erb +4 -4
- data/app/components/avo/profile_item_component.rb +2 -4
- data/app/components/avo/referrer_params_component.html.erb +1 -1
- data/app/components/avo/resource_component.rb +8 -19
- data/app/components/avo/resource_listing_component.html.erb +22 -0
- data/app/components/avo/resource_listing_component.rb +28 -0
- data/app/components/avo/resource_sidebar_component.html.erb +2 -2
- data/app/components/avo/resource_sidebar_component.rb +0 -4
- data/app/components/avo/row_component.html.erb +1 -1
- data/app/components/avo/row_selector_component.html.erb +2 -4
- data/app/components/avo/row_selector_component.rb +0 -1
- data/app/components/avo/search_overlay_component.html.erb +6 -0
- data/app/components/avo/search_overlay_component.rb +2 -0
- data/app/components/avo/sidebar/base_item_component.rb +9 -9
- data/app/components/avo/sidebar/group_component.html.erb +23 -27
- data/app/components/avo/sidebar/group_component.rb +4 -0
- data/app/components/avo/sidebar/link_component.html.erb +30 -7
- data/app/components/avo/sidebar/link_component.rb +30 -2
- data/app/components/avo/sidebar/section_component.html.erb +31 -11
- data/app/components/avo/sidebar/section_component.rb +1 -3
- data/app/components/avo/sidebar_component.html.erb +35 -36
- data/app/components/avo/sidebar_component.rb +16 -0
- data/app/components/avo/sidebar_profile_component.html.erb +27 -36
- data/app/components/avo/sidebar_profile_component.rb +14 -0
- data/app/components/avo/tab_group_component.html.erb +21 -9
- data/app/components/avo/tab_group_component.rb +54 -15
- data/app/components/avo/turbo_frame_wrapper_component.html.erb +4 -8
- data/app/components/avo/turbo_frame_wrapper_component.rb +9 -0
- data/app/components/avo/u_i/avatar_component.html.erb +11 -0
- data/app/components/avo/u_i/avatar_component.rb +61 -0
- data/app/components/avo/u_i/badge_component.html.erb +9 -0
- data/app/components/avo/u_i/badge_component.rb +35 -0
- data/app/components/avo/u_i/card_component.html.erb +29 -0
- data/app/components/avo/u_i/card_component.rb +65 -0
- data/app/components/avo/u_i/dropdown_component.html.erb +14 -0
- data/app/components/avo/u_i/dropdown_component.rb +26 -0
- data/app/components/avo/u_i/dropdown_menu_component.html.erb +16 -0
- data/app/components/avo/u_i/dropdown_menu_component.rb +8 -0
- data/app/components/avo/u_i/file_upload_input_component.html.erb +26 -0
- data/app/components/avo/u_i/file_upload_input_component.rb +15 -0
- data/app/components/avo/u_i/file_upload_item_component.html.erb +48 -0
- data/app/components/avo/u_i/file_upload_item_component.rb +17 -0
- data/app/components/avo/u_i/icon_button_component.html.erb +7 -0
- data/app/components/avo/u_i/icon_button_component.rb +22 -0
- data/app/components/avo/u_i/panel_component.html.erb +49 -0
- data/app/components/avo/u_i/panel_component.rb +29 -0
- data/app/components/avo/u_i/panel_header_component.html.erb +37 -0
- data/app/components/avo/u_i/panel_header_component.rb +24 -0
- data/app/components/avo/u_i/search_input_component.html.erb +28 -0
- data/app/components/avo/u_i/search_input_component.rb +12 -0
- data/app/components/avo/u_i/tabs/tab_component.html.erb +26 -0
- data/app/components/avo/u_i/tabs/tab_component.rb +25 -0
- data/app/components/avo/u_i/tabs/tabs_component.html.erb +7 -0
- data/app/components/avo/u_i/tabs/tabs_component.rb +13 -0
- data/app/components/avo/view_types/base_view_type_component.rb +26 -0
- data/app/components/avo/view_types/grid_component.html.erb +18 -0
- data/app/components/avo/view_types/grid_component.rb +4 -0
- data/app/components/avo/view_types/map_component.html.erb +17 -0
- data/app/components/avo/view_types/map_component.rb +110 -0
- data/app/components/avo/view_types/table_component.html.erb +63 -0
- data/app/components/avo/{index/resource_table_component.rb → view_types/table_component.rb} +1 -10
- data/app/components/avo/views/resource_edit_component.html.erb +12 -18
- data/app/components/avo/views/resource_edit_component.rb +1 -27
- data/app/components/avo/views/resource_index_component.html.erb +97 -74
- data/app/components/avo/views/resource_index_component.rb +23 -3
- data/app/components/avo/views/resource_show_component.html.erb +4 -2
- data/app/components/avo/views/resource_show_component.rb +1 -4
- data/app/controllers/avo/associations_controller.rb +1 -1
- data/app/controllers/avo/base_application_controller.rb +7 -5
- data/app/controllers/avo/base_controller.rb +139 -40
- data/app/controllers/avo/debug_controller.rb +0 -29
- data/app/controllers/avo/media_library_controller.rb +17 -1
- data/app/controllers/avo/search_controller.rb +5 -0
- data/app/controllers/concerns/avo/initializes_avo.rb +7 -8
- data/app/helpers/avo/application_helper.rb +60 -46
- data/app/helpers/avo/turbo_stream_actions_helper.rb +10 -1
- data/app/helpers/avo/url_helpers.rb +3 -2
- data/app/javascript/{avo.base.js → application.js} +9 -18
- data/app/javascript/js/application.js +40 -0
- data/app/javascript/js/controllers/action_controller.js +4 -4
- data/app/javascript/js/controllers/actions_overflow_controller.js +21 -6
- data/app/javascript/js/controllers/color_scheme_switcher_controller.js +226 -0
- data/app/javascript/js/controllers/dropdown_menu_controller.js +42 -0
- data/app/javascript/js/controllers/fields/code_field_controller.js +20 -3
- data/app/javascript/js/controllers/fields/easy_mde_controller.js +23 -1
- data/app/javascript/js/controllers/fields/key_value_controller.js +43 -39
- data/app/javascript/js/controllers/fields/panel_refresh_controller.js +4 -0
- data/app/javascript/js/controllers/fields/tags_field_controller.js +2 -2
- data/app/javascript/js/controllers/fields/tags_field_helpers.js +4 -6
- data/app/javascript/js/controllers/grid_cover_empty_state_controller.js +42 -0
- data/app/javascript/js/controllers/item_selector_controller.js +0 -2
- data/app/javascript/js/controllers/loading_button_controller.js +1 -5
- data/app/javascript/js/controllers/map_dark_mode_controller.js +131 -0
- data/app/javascript/js/controllers/menu_controller.js +38 -16
- data/app/javascript/js/controllers/modal_controller.js +16 -0
- data/app/javascript/js/controllers/modal_size_controller.js +83 -0
- data/app/javascript/js/controllers/nested_form_controller.js +2 -2
- data/app/javascript/js/controllers/password_visibility_controller.js +13 -0
- data/app/javascript/js/controllers/preview_controller.js +2 -2
- data/app/javascript/js/controllers/resource_search_controller.js +123 -0
- data/app/javascript/js/controllers/search_controller.js +10 -29
- data/app/javascript/js/controllers/sidebar_controller.js +29 -9
- data/app/javascript/js/controllers/table_row_controller.js +28 -0
- data/app/javascript/js/controllers/tippy_controller.js +1 -1
- data/app/javascript/js/controllers/toggle_controller.js +40 -5
- data/app/javascript/js/controllers.js +14 -2
- data/app/javascript/js/custom-stream-actions.js +10 -8
- data/app/views/avo/actions/show.html.erb +14 -10
- data/app/views/avo/base/_boolean_filter.html.erb +1 -1
- data/app/views/avo/base/_date_time_filter.html.erb +3 -3
- data/app/views/avo/base/_multiple_select_filter.html.erb +1 -1
- data/app/views/avo/base/_new_via_belongs_to.html.erb +2 -3
- data/app/views/avo/base/_text_filter.html.erb +1 -1
- data/app/views/avo/base/preview.html.erb +5 -4
- data/app/views/avo/debug/status.html.erb +5 -92
- data/app/views/avo/debug/status.text.erb +0 -2
- data/app/views/avo/home/_actions.html.erb +1 -1
- data/app/views/avo/home/_dashboards.html.erb +1 -1
- data/app/views/avo/home/_filters.html.erb +1 -1
- data/app/views/avo/home/_resources.html.erb +2 -2
- data/app/views/avo/home/failed_to_load.html.erb +2 -2
- data/app/views/avo/home/index.html.erb +25 -25
- data/app/views/avo/media_library/_form.html.erb +43 -28
- data/app/views/avo/media_library/show.html.erb +7 -3
- data/app/views/avo/modal/_size_selector.html.erb +46 -0
- data/app/views/avo/partials/_alerts.html.erb +1 -1
- data/app/views/avo/partials/_color_scheme_switcher.html.erb +106 -0
- data/app/views/avo/partials/_color_theme_override.html.erb +49 -0
- data/app/views/avo/partials/_confirm_dialog.html.erb +19 -17
- data/app/views/avo/partials/_custom_tools_alert.html.erb +6 -6
- data/app/views/avo/partials/_footer.html.erb +1 -1
- data/app/views/avo/partials/_header.html.erb +1 -1
- data/app/views/avo/partials/_javascript.html.erb +0 -2
- data/app/views/avo/partials/_navbar.html.erb +53 -8
- data/app/views/avo/partials/_sortable_component.html.erb +1 -1
- data/app/views/avo/partials/_table_header.html.erb +28 -19
- data/app/views/avo/partials/_view_toggle_button.html.erb +6 -29
- data/app/views/avo/partials/distribution_chart.html.erb +2 -2
- data/app/views/avo/private/_links_and_buttons.html.erb +12 -8
- data/app/views/avo/private/design.html.erb +8 -4
- data/app/views/avo/sidebar/_license_warning.html.erb +3 -3
- data/app/views/layouts/avo/application.html.erb +39 -17
- data/app/views/layouts/avo/modal.html.erb +7 -0
- data/avo.gemspec +3 -4
- data/config/i18n-tasks.yml +1 -1
- data/config/importmap.rb +1 -0
- data/config/initializers/pagy.rb +5 -25
- data/config/routes/dynamic_routes.rb +4 -0
- data/config/routes.rb +6 -7
- data/db/factories.rb +14 -0
- data/lib/avo/asset_manager.rb +2 -0
- data/lib/avo/avatar.rb +7 -0
- data/lib/avo/base_action.rb +16 -4
- data/lib/avo/concerns/breadcrumbs.rb +7 -66
- data/lib/avo/concerns/form_builder.rb +41 -0
- data/lib/avo/concerns/{has_profile_photo.rb → has_avatar.rb} +8 -4
- data/lib/avo/concerns/{has_cover_photo.rb → has_cover.rb} +4 -4
- data/lib/avo/concerns/has_description.rb +9 -0
- data/lib/avo/concerns/has_item_type.rb +6 -2
- data/lib/avo/concerns/has_items.rb +43 -58
- data/lib/avo/concerns/pagination.rb +29 -19
- data/lib/avo/concerns/row_controls_configuration.rb +22 -15
- data/lib/avo/configuration/branding.rb +7 -7
- data/lib/avo/configuration.rb +92 -45
- data/lib/avo/{cover_photo.rb → cover.rb} +2 -2
- data/lib/avo/current.rb +0 -11
- data/lib/avo/discreet_information.rb +52 -29
- data/lib/avo/dsl/field_parser.rb +1 -1
- data/lib/avo/engine.rb +41 -8
- data/lib/avo/error_manager.rb +1 -1
- data/lib/avo/fields/avatar_field.rb +19 -0
- data/lib/avo/fields/badge_field.rb +23 -3
- data/lib/avo/fields/base_field.rb +46 -1
- data/lib/avo/fields/concerns/dom_id.rb +17 -0
- data/lib/avo/fields/concerns/file_authorization.rb +4 -0
- data/lib/avo/fields/concerns/has_html_attributes.rb +1 -1
- data/lib/avo/fields/concerns/is_searchable.rb +2 -5
- data/lib/avo/fields/concerns/nested.rb +1 -1
- data/lib/avo/fields/files_field.rb +2 -2
- data/lib/avo/fields/frame_base_field.rb +2 -2
- data/lib/avo/fields/id_field.rb +5 -1
- data/lib/avo/fields/progress_bar_field.rb +1 -1
- data/lib/avo/fields/text_field.rb +1 -1
- data/lib/avo/photo_object.rb +12 -1
- data/lib/avo/plugin_manager.rb +4 -0
- data/lib/avo/resources/base.rb +33 -21
- data/lib/avo/resources/controls/actions_list.rb +3 -3
- data/lib/avo/resources/controls/base_control.rb +1 -1
- data/lib/avo/resources/items/card.rb +16 -0
- data/lib/avo/resources/items/header.rb +11 -0
- data/lib/avo/resources/items/holder.rb +18 -23
- data/lib/avo/resources/items/item_group.rb +5 -7
- data/lib/avo/resources/items/sidebar.rb +5 -9
- data/lib/avo/resources/items/tab.rb +8 -8
- data/lib/avo/resources/items/tab_group.rb +8 -10
- data/lib/avo/resources/resource_manager.rb +2 -1
- data/lib/avo/services/hq_reporter.rb +102 -0
- data/lib/avo/services/telemetry_service.rb +0 -1
- data/lib/avo/test_helpers.rb +36 -22
- data/lib/avo/u_i_instance.rb +60 -0
- data/lib/avo/version.rb +1 -1
- data/lib/avo/view_inquirer.rb +6 -1
- data/lib/avo/view_types/view_type_manager.rb +70 -0
- data/lib/avo.rb +30 -45
- data/lib/generators/avo/action_generator.rb +1 -1
- data/lib/generators/avo/resource_generator.rb +43 -0
- data/lib/generators/avo/resource_tool_generator.rb +1 -1
- data/lib/generators/avo/tailwindcss/install_generator.rb +0 -6
- data/lib/generators/avo/templates/cards/partial_card_partial.tt +1 -1
- data/lib/generators/avo/templates/initializer/avo.tt +7 -9
- data/lib/generators/avo/templates/locales/avo.ar.yml +25 -0
- data/lib/generators/avo/templates/locales/avo.de.yml +25 -0
- data/lib/generators/avo/templates/locales/avo.en.yml +25 -0
- data/lib/generators/avo/templates/locales/avo.es.yml +25 -0
- data/lib/generators/avo/templates/locales/avo.fr.yml +25 -0
- data/lib/generators/avo/templates/locales/avo.it.yml +25 -0
- data/lib/generators/avo/templates/locales/avo.ja.yml +25 -0
- data/lib/generators/avo/templates/locales/avo.nb.yml +25 -0
- data/lib/generators/avo/templates/locales/avo.nl.yml +25 -0
- data/lib/generators/avo/templates/locales/avo.nn.yml +25 -0
- data/lib/generators/avo/templates/locales/avo.pl.yml +25 -0
- data/lib/generators/avo/templates/locales/avo.pt-BR.yml +25 -0
- data/lib/generators/avo/templates/locales/avo.pt.yml +25 -0
- data/lib/generators/avo/templates/locales/avo.ro.yml +25 -0
- data/lib/generators/avo/templates/locales/avo.ru.yml +25 -0
- data/lib/generators/avo/templates/locales/avo.tr.yml +25 -0
- data/lib/generators/avo/templates/locales/{avo.uk.yml → avo.ua.yml} +26 -1
- data/lib/generators/avo/templates/locales/avo.zh-TW.yml +25 -0
- data/lib/generators/avo/templates/locales/avo.zh.yml +25 -0
- data/lib/generators/avo/templates/resource/resource.tt +10 -1
- data/lib/generators/avo/templates/resource_tools/partial.tt +20 -22
- data/lib/generators/avo/templates/tailwindcss/avo.tailwind.css +1 -3
- data/lib/generators/avo/templates/tailwindcss/tailwind.config.js +0 -7
- data/lib/generators/avo/templates/tool/view.tt +14 -16
- data/lib/generators/avo/tool_generator.rb +3 -3
- data/lib/generators/avo/version_generator.rb +1 -1
- data/lib/tasks/avo_tasks.rake +29 -25
- metadata +145 -97
- data/app/assets/stylesheets/avo.base.css +0 -130
- data/app/assets/stylesheets/css/breadcrumbs.css +0 -16
- data/app/assets/stylesheets/css/buttons.css +0 -19
- data/app/assets/stylesheets/css/tailwindcss/base.css +0 -1
- data/app/assets/stylesheets/css/tailwindcss/components.css +0 -1
- data/app/assets/stylesheets/css/tailwindcss/utilities.css +0 -1
- data/app/assets/svgs/avo/arrow-down.svg +0 -3
- data/app/assets/svgs/avo/arrow-up.svg +0 -3
- data/app/assets/svgs/avo/detach.svg +0 -8
- data/app/assets/svgs/avo/download-solid-reversed.svg +0 -3
- data/app/assets/svgs/avo/download-solid.svg +0 -3
- data/app/assets/svgs/avo/edit.svg +0 -5
- data/app/assets/svgs/avo/editor-bold.svg +0 -1
- data/app/assets/svgs/avo/editor-italic.svg +0 -1
- data/app/assets/svgs/avo/editor-link.svg +0 -1
- data/app/assets/svgs/avo/editor-list.svg +0 -1
- data/app/assets/svgs/avo/editor-strike.svg +0 -1
- data/app/assets/svgs/avo/editor-underline.svg +0 -1
- data/app/assets/svgs/avo/eye.svg +0 -1
- data/app/assets/svgs/avo/trash-sm.svg +0 -3
- data/app/assets/svgs/avo/trash.svg +0 -7
- data/app/components/avo/cover_photo_component.html.erb +0 -3
- data/app/components/avo/cover_photo_component.rb +0 -19
- data/app/components/avo/fields/common/badge_viewer_component.html.erb +0 -1
- data/app/components/avo/fields/common/badge_viewer_component.rb +0 -33
- data/app/components/avo/index/resource_grid_component.html.erb +0 -23
- data/app/components/avo/index/resource_grid_component.rb +0 -10
- data/app/components/avo/index/resource_map_component.html.erb +0 -16
- data/app/components/avo/index/resource_map_component.rb +0 -114
- data/app/components/avo/index/resource_table_component.html.erb +0 -52
- data/app/components/avo/panel_component.html.erb +0 -63
- data/app/components/avo/panel_component.rb +0 -43
- data/app/components/avo/panel_header_component.html.erb +0 -42
- data/app/components/avo/panel_header_component.rb +0 -31
- data/app/components/avo/profile_photo_component.html.erb +0 -6
- data/app/components/avo/profile_photo_component.rb +0 -9
- data/app/components/avo/sidebar/heading_component.html.erb +0 -21
- data/app/components/avo/sidebar/heading_component.rb +0 -9
- data/app/components/avo/tab_switcher_component.html.erb +0 -20
- data/app/components/avo/tab_switcher_component.rb +0 -45
- data/app/views/avo/base/close_modal_and_reload_field.turbo_stream.erb +0 -8
- data/app/views/avo/debug/report.html.erb +0 -37
- data/app/views/avo/partials/_panel_breadcrumbs.html.erb +0 -3
- data/app/views/avo/partials/_resource_search.html.erb +0 -16
- data/lib/avo/licensing/community_license.rb +0 -6
- data/lib/avo/licensing/h_q.rb +0 -202
- data/lib/avo/licensing/license.rb +0 -76
- data/lib/avo/licensing/license_manager.rb +0 -24
- data/lib/avo/licensing/nil_license.rb +0 -14
- data/lib/avo/licensing/pro_license.rb +0 -20
- data/lib/avo/licensing/request.rb +0 -20
- data/lib/avo/profile_photo.rb +0 -7
- data/lib/avo/services/debug_service.rb +0 -107
- data/public/avo-assets/placeholder.svg +0 -1
- data/tailwind.preset.js +0 -171
- /data/{public/avo-assets → app/assets/images/avo}/favicon.ico +0 -0
- /data/{public/avo-assets → app/assets/images/avo}/fonts/inter-v7-latin-500.eot +0 -0
- /data/{public/avo-assets → app/assets/images/avo}/fonts/inter-v7-latin-500.svg +0 -0
- /data/{public/avo-assets → app/assets/images/avo}/fonts/inter-v7-latin-500.ttf +0 -0
- /data/{public/avo-assets → app/assets/images/avo}/fonts/inter-v7-latin-500.woff +0 -0
- /data/{public/avo-assets → app/assets/images/avo}/fonts/inter-v7-latin-500.woff2 +0 -0
- /data/{public/avo-assets → app/assets/images/avo}/fonts/inter-v7-latin-600.eot +0 -0
- /data/{public/avo-assets → app/assets/images/avo}/fonts/inter-v7-latin-600.svg +0 -0
- /data/{public/avo-assets → app/assets/images/avo}/fonts/inter-v7-latin-600.ttf +0 -0
- /data/{public/avo-assets → app/assets/images/avo}/fonts/inter-v7-latin-600.woff +0 -0
- /data/{public/avo-assets → app/assets/images/avo}/fonts/inter-v7-latin-600.woff2 +0 -0
- /data/{public/avo-assets → app/assets/images/avo}/fonts/inter-v7-latin-700.eot +0 -0
- /data/{public/avo-assets → app/assets/images/avo}/fonts/inter-v7-latin-700.svg +0 -0
- /data/{public/avo-assets → app/assets/images/avo}/fonts/inter-v7-latin-700.ttf +0 -0
- /data/{public/avo-assets → app/assets/images/avo}/fonts/inter-v7-latin-700.woff +0 -0
- /data/{public/avo-assets → app/assets/images/avo}/fonts/inter-v7-latin-700.woff2 +0 -0
- /data/{public/avo-assets → app/assets/images/avo}/fonts/inter-v7-latin-regular.eot +0 -0
- /data/{public/avo-assets → app/assets/images/avo}/fonts/inter-v7-latin-regular.svg +0 -0
- /data/{public/avo-assets → app/assets/images/avo}/fonts/inter-v7-latin-regular.ttf +0 -0
- /data/{public/avo-assets → app/assets/images/avo}/fonts/inter-v7-latin-regular.woff +0 -0
- /data/{public/avo-assets → app/assets/images/avo}/fonts/inter-v7-latin-regular.woff2 +0 -0
- /data/{public/avo-assets → app/assets/images/avo}/logo-on-white.png +0 -0
- /data/{public/avo-assets → app/assets/images/avo}/logo.png +0 -0
- /data/{public/avo-assets → app/assets/images/avo}/logomark.png +0 -0
|
@@ -1,22 +1,20 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
# A button/link can have the following settings:
|
|
4
|
-
# style: primary/outline/text
|
|
5
|
-
# size: :
|
|
6
|
-
# color: :gray, :red, :green, :blue, or any other tailwind color
|
|
4
|
+
# style: primary/outline/text
|
|
5
|
+
# size: :sm, :md, :lg
|
|
6
|
+
# color: nil, :primary, :accent, :gray, :red, :green, :blue, or any other tailwind color
|
|
7
7
|
# icon: "heroicons/outline/paperclip" as specified in the docs (https://docs.avohq.io/3.0/icons.html)
|
|
8
8
|
class Avo::ButtonComponent < Avo::BaseComponent
|
|
9
9
|
prop :path, kind: :positional
|
|
10
10
|
prop :size, default: :md
|
|
11
11
|
prop :style, default: :outline
|
|
12
|
-
prop :color
|
|
12
|
+
prop :color
|
|
13
13
|
prop :icon do |value|
|
|
14
14
|
value&.to_sym
|
|
15
15
|
end
|
|
16
16
|
prop :icon_class, default: ""
|
|
17
17
|
prop :is_link, default: false
|
|
18
|
-
prop :rounded, default: true
|
|
19
|
-
prop :compact, default: false
|
|
20
18
|
prop :aria, default: {}.freeze
|
|
21
19
|
prop :args, kind: :**, default: {}.freeze
|
|
22
20
|
prop :class
|
|
@@ -34,48 +32,22 @@ class Avo::ButtonComponent < Avo::BaseComponent
|
|
|
34
32
|
end
|
|
35
33
|
|
|
36
34
|
def button_classes
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
classes
|
|
35
|
+
base_classes = [
|
|
36
|
+
"button",
|
|
37
|
+
"button--size-#{@size}",
|
|
38
|
+
"button--style-#{@style}",
|
|
39
|
+
@class,
|
|
40
|
+
"button--color-#{@color}": @color.present?
|
|
41
|
+
]
|
|
42
|
+
base_classes << "button--loading" if @args[:loading]
|
|
43
|
+
|
|
44
|
+
class_names(*base_classes.compact)
|
|
49
45
|
end
|
|
50
46
|
|
|
51
47
|
def is_link?
|
|
52
48
|
@is_link
|
|
53
49
|
end
|
|
54
50
|
|
|
55
|
-
def is_icon?
|
|
56
|
-
@style == :icon
|
|
57
|
-
end
|
|
58
|
-
|
|
59
|
-
def is_not_icon?
|
|
60
|
-
!is_icon?
|
|
61
|
-
end
|
|
62
|
-
|
|
63
|
-
def full_content
|
|
64
|
-
result = ""
|
|
65
|
-
# space out the icon from the text if text is present
|
|
66
|
-
# add the icon height
|
|
67
|
-
icon_classes = class_names(@icon_class, "pointer-events-none", icon_size_classes, "mr-1": content.present? && is_not_icon?)
|
|
68
|
-
|
|
69
|
-
# Add the icon
|
|
70
|
-
result += helpers.svg(@icon, class: icon_classes) if @icon.present?
|
|
71
|
-
|
|
72
|
-
if is_not_icon? && content.present?
|
|
73
|
-
result += content
|
|
74
|
-
end
|
|
75
|
-
|
|
76
|
-
result.html_safe
|
|
77
|
-
end
|
|
78
|
-
|
|
79
51
|
def call
|
|
80
52
|
if is_link?
|
|
81
53
|
output_link
|
|
@@ -86,104 +58,26 @@ class Avo::ButtonComponent < Avo::BaseComponent
|
|
|
86
58
|
|
|
87
59
|
def output_link
|
|
88
60
|
link_to @path, **args do
|
|
89
|
-
|
|
61
|
+
render_content
|
|
90
62
|
end
|
|
91
63
|
end
|
|
92
64
|
|
|
93
65
|
def output_button
|
|
94
66
|
if args.dig(:method).present? || args.dig(:data, :turbo_method).present?
|
|
95
67
|
button_to args[:url], **args do
|
|
96
|
-
|
|
68
|
+
render_content
|
|
97
69
|
end
|
|
98
70
|
else
|
|
99
71
|
button_tag(**args) do
|
|
100
|
-
|
|
72
|
+
render_content
|
|
101
73
|
end
|
|
102
74
|
end
|
|
103
75
|
end
|
|
104
76
|
|
|
105
77
|
private
|
|
106
78
|
|
|
107
|
-
def
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
case @size.to_sym
|
|
111
|
-
when :xs
|
|
112
|
-
" py-0"
|
|
113
|
-
when :sm
|
|
114
|
-
" py-1"
|
|
115
|
-
when :md
|
|
116
|
-
" py-1.5"
|
|
117
|
-
when :lg
|
|
118
|
-
" py-2"
|
|
119
|
-
when :xl
|
|
120
|
-
" py-3"
|
|
121
|
-
else
|
|
122
|
-
""
|
|
123
|
-
end
|
|
124
|
-
end
|
|
125
|
-
|
|
126
|
-
def horizontal_padding_classes
|
|
127
|
-
return " px-0" if is_icon?
|
|
128
|
-
return " px-1" if @compact
|
|
129
|
-
|
|
130
|
-
case @size.to_sym
|
|
131
|
-
when :xs
|
|
132
|
-
" px-2"
|
|
133
|
-
when :sm
|
|
134
|
-
" px-3"
|
|
135
|
-
when :md
|
|
136
|
-
" px-3"
|
|
137
|
-
when :lg
|
|
138
|
-
" px-5"
|
|
139
|
-
when :xl
|
|
140
|
-
" px-6"
|
|
141
|
-
else
|
|
142
|
-
"px-4"
|
|
143
|
-
end
|
|
144
|
-
end
|
|
145
|
-
|
|
146
|
-
def text_size_classes
|
|
147
|
-
case @size.to_sym
|
|
148
|
-
when :xs
|
|
149
|
-
" text-xs"
|
|
150
|
-
else
|
|
151
|
-
" text-sm"
|
|
152
|
-
end
|
|
153
|
-
end
|
|
154
|
-
|
|
155
|
-
def style_classes
|
|
156
|
-
case @style
|
|
157
|
-
when :primary
|
|
158
|
-
" bg-#{@color}-500 text-white border-#{@color}-500 hover:bg-#{@color}-600 hover:border-#{@color}-600 active:border-#{@color}-600 active:outline-#{@color}-600 active:bg-#{@color}-600"
|
|
159
|
-
when :outline
|
|
160
|
-
" bg-white text-#{@color}-500 border-#{@color}-500 hover:bg-#{@color}-100 active:bg-#{@color}-100 active:border-#{@color}-500 active:outline-#{@color}-500"
|
|
161
|
-
when :text
|
|
162
|
-
" text-#{@color}-500 active:outline-#{@color}-500 hover:bg-gray-100 border-transparent"
|
|
163
|
-
when :icon
|
|
164
|
-
" text-#{@color}-600"
|
|
165
|
-
else
|
|
166
|
-
""
|
|
167
|
-
end
|
|
168
|
-
end
|
|
169
|
-
|
|
170
|
-
def icon_size_classes
|
|
171
|
-
icon_classes = ""
|
|
172
|
-
return icon_classes if is_icon?
|
|
173
|
-
|
|
174
|
-
case @size
|
|
175
|
-
when :xs
|
|
176
|
-
icon_classes += " h-4 my-1"
|
|
177
|
-
when :sm
|
|
178
|
-
icon_classes += " h-4 my-1"
|
|
179
|
-
when :md
|
|
180
|
-
icon_classes += " h-4 my-1"
|
|
181
|
-
when :lg
|
|
182
|
-
icon_classes += " h-5 my-0.5"
|
|
183
|
-
when :xl
|
|
184
|
-
icon_classes += " h-6"
|
|
185
|
-
end
|
|
186
|
-
|
|
187
|
-
icon_classes
|
|
79
|
+
def render_content
|
|
80
|
+
concat helpers.svg(@icon, class: class_names("button__icon", @icon_class)) if @icon.present?
|
|
81
|
+
concat content if content.present?
|
|
188
82
|
end
|
|
189
83
|
end
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<%= content_tag :div,
|
|
2
|
-
|
|
2
|
+
# the div is making the row taller without without the -my-1 class
|
|
3
|
+
class: "opacity-0 group-hover/clipboard:opacity-100 transition-opacity duration-200 inline-block -my-1 cursor-pointer",
|
|
3
4
|
data: {
|
|
4
5
|
controller: "clipboard",
|
|
5
6
|
clipboard_success_duration_value: @duration_value,
|
|
@@ -15,7 +16,7 @@
|
|
|
15
16
|
tippy: "tooltip",
|
|
16
17
|
tippy_content: I18n.t("avo.copy")
|
|
17
18
|
} do %>
|
|
18
|
-
<%= helpers.svg "
|
|
19
|
+
<%= helpers.svg "tabler/outline/clipboard", class: "h-4 inline" %>
|
|
19
20
|
<% end %>
|
|
20
21
|
</div>
|
|
21
22
|
<% end %>
|
|
@@ -5,7 +5,7 @@ class Avo::ClipboardComponent < Avo::BaseComponent
|
|
|
5
5
|
|
|
6
6
|
def before_render
|
|
7
7
|
@duration_value = 2500
|
|
8
|
-
@content_value = helpers.svg("
|
|
8
|
+
@content_value = helpers.svg("tabler/outline/clipboard-check", class: "h-4 inline").tr('"', "'")
|
|
9
9
|
end
|
|
10
10
|
|
|
11
11
|
def render?
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
class Avo::ComponentMissingComponent < ViewComponent::Base
|
|
4
|
+
def initialize(*args, component_name:, &block)
|
|
5
|
+
@component_name = component_name
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
def call
|
|
9
|
+
"Component #{@component_name} not found in the Avo UI catalog."
|
|
10
|
+
end
|
|
11
|
+
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
class Avo::CoverComponent < Avo::BaseComponent
|
|
4
|
+
prop :cover
|
|
5
|
+
prop :size do |value|
|
|
6
|
+
@cover&.size
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def size_class
|
|
10
|
+
case @size
|
|
11
|
+
when :sm
|
|
12
|
+
"max-h-60"
|
|
13
|
+
when :md
|
|
14
|
+
"max-h-100"
|
|
15
|
+
when :lg
|
|
16
|
+
"max-h-140"
|
|
17
|
+
when :full
|
|
18
|
+
"max-h-none"
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def render?
|
|
23
|
+
@cover.present? && @cover.visible_in_current_view?
|
|
24
|
+
end
|
|
25
|
+
end
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
<div class="flex flex-col">
|
|
2
|
+
<%= render ui.panel(title: 'Avo Status', description: 'Use this page to debug your Avo instance.') do |panel| %>
|
|
3
|
+
<% panel.with_card do %>
|
|
4
|
+
<div class="grid gap-4 grid-cols-2">
|
|
5
|
+
<div class="relative flex flex-col bg-white rounded-sm shadow-panel p-4 space-y-4 h-full">
|
|
6
|
+
<div class="flex justify-between w-full">
|
|
7
|
+
<div class="font-semibold">License info</div>
|
|
8
|
+
</div>
|
|
9
|
+
<div class="flex flex-col flex-1">
|
|
10
|
+
<div>
|
|
11
|
+
<div class="text-xl font-semibold">
|
|
12
|
+
<span class="text-green-700 text-xl">
|
|
13
|
+
<%= helpers.svg "heroicons/outline/check-badge", class: "h-5 inline -mt-1 relative" %> <span>Community</span>
|
|
14
|
+
</span> license
|
|
15
|
+
</div>
|
|
16
|
+
<div class="mt-4">
|
|
17
|
+
<dl>
|
|
18
|
+
<% information_items.each do |key, value| %>
|
|
19
|
+
<dt><%= key.humanize %></dt>
|
|
20
|
+
<dd><%= value %></dd>
|
|
21
|
+
<% end %>
|
|
22
|
+
</dl>
|
|
23
|
+
</div>
|
|
24
|
+
<div class="mt-6 p-4 bg-blue-50 border border-blue-200 rounded-sm">
|
|
25
|
+
<div class="font-semibold text-blue-800 mb-2">Ready to level up?</div>
|
|
26
|
+
<p class="text-sm text-blue-700 mb-4">
|
|
27
|
+
Visit the link below, select your license, and head to the <strong>Upgrade</strong> section to get started.
|
|
28
|
+
</p>
|
|
29
|
+
<%= a_link 'https://avohq.io/licenses',
|
|
30
|
+
style: :primary,
|
|
31
|
+
color: :blue,
|
|
32
|
+
target: '_blank',
|
|
33
|
+
icon: 'heroicons/outline/external-link' do %>
|
|
34
|
+
Get started!
|
|
35
|
+
<% end %>
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
<div class="relative flex flex-col bg-white rounded-sm shadow-panel p-4 space-y-4 h-full">
|
|
41
|
+
<div class="flex justify-between w-full">
|
|
42
|
+
<div class="font-semibold">Plugins</div>
|
|
43
|
+
</div>
|
|
44
|
+
<div class="flex flex-col flex-1">
|
|
45
|
+
<div>
|
|
46
|
+
<ul>
|
|
47
|
+
<li>Avo <%= Avo::VERSION %></li>
|
|
48
|
+
<% Avo.plugin_manager.plugins.each do |plugin| %>
|
|
49
|
+
<li><%= plugin.name %> - <%= plugin.version %></li>
|
|
50
|
+
<% end %>
|
|
51
|
+
</ul>
|
|
52
|
+
</div>
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
<% end %>
|
|
57
|
+
<% end %>
|
|
58
|
+
</div>
|
|
59
|
+
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
class Avo::Debug::StatusComponent < Avo::BaseComponent
|
|
4
|
+
include Avo::ApplicationHelper
|
|
5
|
+
|
|
6
|
+
def information_items
|
|
7
|
+
@information_items ||= {
|
|
8
|
+
license_key: Avo.configuration.license_key,
|
|
9
|
+
ruby_version: RUBY_VERSION,
|
|
10
|
+
rails_version: Rails::VERSION::STRING,
|
|
11
|
+
environment: Rails.env,
|
|
12
|
+
host: Avo::Current.request&.host,
|
|
13
|
+
port: Avo::Current.request&.port,
|
|
14
|
+
ip: Avo::Current.request&.ip,
|
|
15
|
+
app_name: Avo.configuration.app_name,
|
|
16
|
+
cache_store: Avo.cache_store.class,
|
|
17
|
+
cache_operational:,
|
|
18
|
+
}.stringify_keys.except(*Avo.configuration.exclude_from_status)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def cache_operational
|
|
22
|
+
icon, color = if Avo::Services::TelemetryService.cache_operational?
|
|
23
|
+
["tabler/outline/circle-check", "text-green-500"]
|
|
24
|
+
else
|
|
25
|
+
["tabler/outline/circle-x", "text-red-500"]
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
helpers.svg(icon, class: "h-5 inline -mt-1 relative #{color}")
|
|
29
|
+
end
|
|
30
|
+
end
|
|
@@ -1,7 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
<%= wrapper_element class: class_names(
|
|
2
|
+
@classes,
|
|
3
|
+
"discreet-information",
|
|
4
|
+
"discreet-information--as-icon": as_icon?,
|
|
5
|
+
"discreet-information--as-text": as_text?,
|
|
6
|
+
"discreet-information--as-badge": as_badge?,
|
|
7
|
+
"discreet-information--as-key-value": as_key_value?
|
|
8
|
+
), title: @title, data: { **(@data || {}), tippy: (@title.present? ? :tooltip : nil) } do %>
|
|
9
|
+
<% if as_icon? %>
|
|
10
|
+
<%= helpers.svg @icon, class: "discreet-information__icon" %>
|
|
11
|
+
<% elsif as_text? %>
|
|
12
|
+
<div class="discreet-information__text">
|
|
13
|
+
<%= helpers.svg @icon, class: "discreet-information__icon" if @icon.present? %>
|
|
14
|
+
<%= @text %>
|
|
15
|
+
</div>
|
|
16
|
+
<% elsif as_badge? %>
|
|
17
|
+
<div class="discreet-information__badge">
|
|
18
|
+
<div class="discreet-information__text">
|
|
19
|
+
<%= helpers.svg @icon, class: "discreet-information__icon" if @icon.present? %>
|
|
20
|
+
<%= @text %>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
<% elsif as_key_value? %>
|
|
24
|
+
<div class="discreet-information__key-value">
|
|
25
|
+
<div class="discreet-information__key"><%= @key %></div>
|
|
26
|
+
|
|
27
|
+
<div class="discreet-information__text">
|
|
28
|
+
<%= @value %>
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
6
31
|
<% end %>
|
|
7
|
-
|
|
32
|
+
<% end %>
|
|
@@ -1,47 +1,38 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
class Avo::DiscreetInformationComponent < Avo::BaseComponent
|
|
4
|
-
prop :
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
prop :icon
|
|
5
|
+
prop :key
|
|
6
|
+
prop :text
|
|
7
|
+
prop :value
|
|
8
|
+
prop :as, default: :text
|
|
9
|
+
prop :url
|
|
10
|
+
prop :target
|
|
11
|
+
prop :title
|
|
12
|
+
prop :data
|
|
13
|
+
prop :classes
|
|
14
|
+
|
|
15
|
+
def as_icon?
|
|
16
|
+
@as == :icon
|
|
8
17
|
end
|
|
9
18
|
|
|
10
|
-
def
|
|
11
|
-
|
|
12
|
-
:a
|
|
13
|
-
else
|
|
14
|
-
:div
|
|
15
|
-
end
|
|
19
|
+
def as_text?
|
|
20
|
+
@as == :text
|
|
16
21
|
end
|
|
17
22
|
|
|
18
|
-
def
|
|
19
|
-
|
|
20
|
-
{href: item.url, target: item.url_target}
|
|
21
|
-
else
|
|
22
|
-
{}
|
|
23
|
-
end
|
|
23
|
+
def as_badge?
|
|
24
|
+
@as == :badge
|
|
24
25
|
end
|
|
25
26
|
|
|
26
|
-
def
|
|
27
|
-
|
|
28
|
-
%w[flex gap-1 whitespace-nowrap rounded-md uppercase px-2 py-1 leading-none items-center text-xs block text-center truncate bg-gray-400 text-white hover:bg-gray-500]
|
|
29
|
-
else
|
|
30
|
-
%w[flex gap-1 text-xs font-normal text-gray-600 hover:text-gray-900]
|
|
31
|
-
end
|
|
27
|
+
def as_key_value?
|
|
28
|
+
@as == :key_value
|
|
32
29
|
end
|
|
33
30
|
|
|
34
|
-
def
|
|
35
|
-
if
|
|
36
|
-
|
|
31
|
+
def wrapper_element(args = {}, &block)
|
|
32
|
+
if @url.present?
|
|
33
|
+
link_to @url, **args, target: @target, &block
|
|
37
34
|
else
|
|
38
|
-
|
|
35
|
+
tag.div(**args, &block)
|
|
39
36
|
end
|
|
40
37
|
end
|
|
41
|
-
|
|
42
|
-
def data(item) = item.data || {}
|
|
43
|
-
|
|
44
|
-
def render_item?(item)
|
|
45
|
-
item.visible.nil? || item.visible
|
|
46
|
-
end
|
|
47
38
|
end
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
<div class="relative flex
|
|
1
|
+
<div class="relative flex items-center w-[calc(100%+2rem)] border-t border-tertiary border-solid my-1 -mx-2 px-2" data-component-name="<%= self.class.to_s.underscore %>">
|
|
2
2
|
<% if @label.present? %>
|
|
3
|
-
<div class="
|
|
3
|
+
<div class="relative inset-auto z-20 text-xs leading-none text-content-secondary px-2 pt-2 pb-1 font-medium">
|
|
4
4
|
<%= @label %>
|
|
5
5
|
</div>
|
|
6
6
|
<% end %>
|
|
@@ -1,12 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
<div class="
|
|
3
|
-
<% end %>
|
|
4
|
-
<div class="relative flex-1 flex flex-col items-center justify-center space-y-12 py-24">
|
|
5
|
-
<%= helpers.svg view_type_svg, class: 'h-[250px]' %>
|
|
6
|
-
<div class="text-gray-500 text-center">
|
|
1
|
+
<div class="relative flex-1 flex flex-col items-center justify-center space-y-2 py-6 border border-dashed border-content-secondary rounded-lg">
|
|
2
|
+
<div class="text-content-secondary text-center">
|
|
7
3
|
<%= text %>
|
|
8
4
|
</div>
|
|
9
5
|
</div>
|
|
10
|
-
<% if @add_background %>
|
|
11
|
-
</div>
|
|
12
|
-
<% end %>
|
|
@@ -2,20 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
class Avo::EmptyStateComponent < Avo::BaseComponent
|
|
4
4
|
prop :message
|
|
5
|
-
prop :view_type, default: :table do |value|
|
|
6
|
-
value&.to_sym
|
|
7
|
-
end
|
|
8
|
-
prop :add_background, default: false
|
|
9
5
|
prop :by_association, default: false
|
|
10
6
|
|
|
11
7
|
def text
|
|
12
8
|
@message || locale_message
|
|
13
9
|
end
|
|
14
10
|
|
|
15
|
-
def view_type_svg
|
|
16
|
-
"avo/#{@view_type}-empty-state"
|
|
17
|
-
end
|
|
18
|
-
|
|
19
11
|
private
|
|
20
12
|
|
|
21
13
|
def locale_message
|
|
@@ -1,32 +1,29 @@
|
|
|
1
1
|
<%= content_tag :div,
|
|
2
|
+
id: dom_id(@field),
|
|
2
3
|
class: classes,
|
|
3
4
|
style: style,
|
|
4
5
|
data: data do %>
|
|
5
|
-
<%= content_tag :div,
|
|
6
|
-
"
|
|
7
|
-
|
|
8
|
-
"
|
|
9
|
-
"md:h-14 ": !stacked? && !short?,
|
|
10
|
-
"md:w-48": !stacked? && compact?,
|
|
11
|
-
"md:w-64": !stacked? && !compact?,
|
|
12
|
-
}), data: {slot: "label"} do %>
|
|
6
|
+
<%= content_tag :div,
|
|
7
|
+
class: class_names("field-wrapper__label", @field.get_html(:classes, view: @view, element: :label)),
|
|
8
|
+
data: {slot: "label"} do %>
|
|
9
|
+
<span class="self-center">
|
|
13
10
|
<% if @form.present? %>
|
|
14
11
|
<%= @form.label label_for, label %>
|
|
15
12
|
<% else %>
|
|
16
13
|
<%= @field.name %>
|
|
17
14
|
<% end %>
|
|
18
|
-
<% if on_edit? && @field.is_required? %> <span class="text-red-600
|
|
15
|
+
<% if on_edit? && @field.is_required? %> <span class="text-red-600 ms-1">*</span> <% end %>
|
|
16
|
+
<% if label_help.present? %>
|
|
17
|
+
<div class="field-wrapper__label-help"><%== label_help %></div>
|
|
18
|
+
<% end %>
|
|
19
|
+
</span>
|
|
19
20
|
<% end %>
|
|
20
|
-
<%= content_tag :div,
|
|
21
|
-
@field.get_html(:classes, view: @view, element: :content),
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
"py-2": !compact?,
|
|
25
|
-
"py-1": compact?,
|
|
26
|
-
}), data: {slot: "value"} do %>
|
|
27
|
-
<div class="self-center w-full <% unless full_width? || compact? || stacked? %> md:w-8/12 has-sidebar:w-full <% end %>">
|
|
21
|
+
<%= content_tag :div,
|
|
22
|
+
class: class_names("field-wrapper__content", @field.get_html(:classes, view: @view, element: :content)),
|
|
23
|
+
data: {slot: "value"} do %>
|
|
24
|
+
<%= tag.div class: "field-wrapper__content-wrapper" do %>
|
|
28
25
|
<% if on_show? %>
|
|
29
|
-
<div class="flex flex-row items-center group gap-x-1 group/clipboard">
|
|
26
|
+
<div class="flex flex-row items-center group gap-x-1 group/clipboard w-full">
|
|
30
27
|
<% if render_dash? %>
|
|
31
28
|
—
|
|
32
29
|
<% else %>
|
|
@@ -37,15 +34,17 @@
|
|
|
37
34
|
<% end %>
|
|
38
35
|
</div>
|
|
39
36
|
<% elsif on_edit? %>
|
|
40
|
-
|
|
37
|
+
<div class="field-wrapper__input">
|
|
38
|
+
<%= content %>
|
|
39
|
+
</div>
|
|
41
40
|
<% if @field.record_errors.include?(@field.id) %>
|
|
42
|
-
<div class="
|
|
41
|
+
<div class="field-wrapper__error"><%= @field.record_errors.full_messages_for(@field.id).to_sentence %></div>
|
|
43
42
|
<% end %>
|
|
44
43
|
<% if help.present? %>
|
|
45
|
-
<div class="
|
|
44
|
+
<div class="field-wrapper__help"><%== help %></div>
|
|
46
45
|
<% end %>
|
|
47
46
|
<% end %>
|
|
48
|
-
|
|
47
|
+
<% end %>
|
|
49
48
|
<% end %>
|
|
50
49
|
<% if params[:avo_debug].present? %>
|
|
51
50
|
<!-- Raw value: -->
|
|
@@ -7,12 +7,12 @@ class Avo::FieldWrapperComponent < Avo::BaseComponent
|
|
|
7
7
|
prop :data, default: {}.freeze
|
|
8
8
|
prop :compact, default: false
|
|
9
9
|
prop :help
|
|
10
|
+
prop :label_help
|
|
10
11
|
prop :field
|
|
11
12
|
prop :form
|
|
12
13
|
prop :full_width, default: false
|
|
13
14
|
prop :label
|
|
14
15
|
prop :resource
|
|
15
|
-
prop :short, default: false
|
|
16
16
|
prop :stacked
|
|
17
17
|
prop :style, default: ""
|
|
18
18
|
prop :view, default: Avo::ViewInquirer.new(:show).freeze
|
|
@@ -27,19 +27,14 @@ class Avo::FieldWrapperComponent < Avo::BaseComponent
|
|
|
27
27
|
end
|
|
28
28
|
|
|
29
29
|
def classes(extra_classes = "")
|
|
30
|
-
class_names("field-wrapper
|
|
30
|
+
class_names("field-wrapper",
|
|
31
31
|
@classes,
|
|
32
32
|
extra_classes,
|
|
33
|
+
@field.width_class,
|
|
33
34
|
@field.get_html(:classes, view: @view, element: :wrapper),
|
|
34
35
|
{
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"field-wrapper-size-compact": compact?,
|
|
38
|
-
"field-wrapper-size-regular": !compact?,
|
|
39
|
-
"field-width-full": full_width?,
|
|
40
|
-
"field-width-regular": !full_width?,
|
|
41
|
-
"field-wrapper-layout-stacked": stacked?,
|
|
42
|
-
"field-wrapper-layout-inline md:flex-row md:items-center": !stacked?
|
|
36
|
+
"field-wrapper--stacked": stacked?,
|
|
37
|
+
"field-wrapper--full-width": full_width?,
|
|
43
38
|
})
|
|
44
39
|
end
|
|
45
40
|
|
|
@@ -61,6 +56,10 @@ class Avo::FieldWrapperComponent < Avo::BaseComponent
|
|
|
61
56
|
Avo::ExecutionContext.new(target: @help || @field.help, record: record, resource: @resource, view: @view).handle
|
|
62
57
|
end
|
|
63
58
|
|
|
59
|
+
def label_help
|
|
60
|
+
Avo::ExecutionContext.new(target: @label_help || @field.label_help, record: record, resource: @resource, view: @view).handle
|
|
61
|
+
end
|
|
62
|
+
|
|
64
63
|
def record
|
|
65
64
|
@resource.present? ? @resource.record : nil
|
|
66
65
|
end
|
|
@@ -101,14 +100,6 @@ class Avo::FieldWrapperComponent < Avo::BaseComponent
|
|
|
101
100
|
Avo.configuration.field_wrapper_layout == :stacked
|
|
102
101
|
end
|
|
103
102
|
|
|
104
|
-
def compact?
|
|
105
|
-
@compact
|
|
106
|
-
end
|
|
107
|
-
|
|
108
|
-
def short?
|
|
109
|
-
@short
|
|
110
|
-
end
|
|
111
|
-
|
|
112
103
|
def full_width?
|
|
113
104
|
@full_width
|
|
114
105
|
end
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<%= index_field_wrapper(**field_wrapper_args, flush: true, dash_if_blank: false, center_content: true) do %>
|
|
2
|
+
<% if @resource.avatar.present? && @resource.avatar.value.present? %>
|
|
3
|
+
<%= render Avo::UI::AvatarComponent.new src: helpers.main_app.url_for(@resource.avatar.value), shape: :square, type: :avatar, size: :small %>
|
|
4
|
+
<% elsif @resource.initials.present? %>
|
|
5
|
+
<%= render Avo::UI::AvatarComponent.new shape: :square, type: :initials, size: :small, initials: @resource.initials %>
|
|
6
|
+
<% else %>
|
|
7
|
+
<%= render Avo::UI::AvatarComponent.new shape: :square, type: :placeholder, size: :small %>
|
|
8
|
+
<% end %>
|
|
9
|
+
<% end %>
|