plutonium 0.12.8 → 0.12.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/plutonium.css +1 -1
  3. data/app/assets/plutonium.js +24 -1
  4. data/app/assets/plutonium.js.map +3 -3
  5. data/app/assets/plutonium.min.js +5 -5
  6. data/app/assets/plutonium.min.js.map +4 -4
  7. data/app/views/components/form/form_component.html.erb +1 -3
  8. data/app/views/components/interactive_action_form/interactive_action_form_component.html.erb +5 -7
  9. data/app/views/components/nested_resource_form_fields/nested_resource_form_fields_component.html.erb +2 -2
  10. data/app/views/components/sidebar/sidebar_component.html.erb +1 -1
  11. data/app/views/components/sidebar/sidebar_component.rb +2 -2
  12. data/app/views/components/sidebar_menu_item/sidebar_menu_item_component.html.erb +6 -6
  13. data/app/views/components/sidebar_menu_item/sidebar_menu_item_component.rb +14 -4
  14. data/app/views/components/table_search_input/table_search_input_component.html.erb +8 -2
  15. data/app/views/resource/_interactive_resource_action_form.html.erb +1 -1
  16. data/app/views/resource/_resource_details.html.erb +9 -2
  17. data/app/views/resource/_resource_table.html.erb +9 -1
  18. data/lib/generators/pu/core/assets/templates/tailwind.config.js +2 -0
  19. data/lib/generators/pu/core/install/install_generator.rb +1 -1
  20. data/lib/generators/pu/core/install/templates/config/initializers/plutonium.rb +4 -0
  21. data/lib/generators/pu/eject/layout/layout_generator.rb +3 -2
  22. data/lib/generators/pu/eject/shell/shell_generator.rb +3 -2
  23. data/lib/generators/pu/field/input/input_generator.rb +32 -0
  24. data/lib/generators/pu/field/input/templates/.keep +0 -0
  25. data/lib/generators/pu/field/input/templates/input.rb.tt +15 -0
  26. data/lib/generators/pu/field/renderer/renderer_generator.rb +32 -0
  27. data/lib/generators/pu/field/renderer/templates/.keep +0 -0
  28. data/lib/generators/pu/field/renderer/templates/renderer.rb.tt +9 -0
  29. data/lib/plutonium/core/actions/interactive_action.rb +2 -2
  30. data/lib/plutonium/core/associations/renderers/base.rb +77 -0
  31. data/lib/plutonium/core/associations/renderers/factory.rb +0 -2
  32. data/lib/plutonium/core/associations/renderers/has_many_renderer.rb +6 -4
  33. data/lib/plutonium/core/controllers/crud_actions.rb +1 -1
  34. data/lib/plutonium/core/controllers/presentable.rb +3 -3
  35. data/lib/plutonium/core/definers/field_definer.rb +4 -4
  36. data/lib/plutonium/core/definers/{input_definer.rb → field_input_definer.rb} +4 -4
  37. data/lib/plutonium/core/definers/{renderer_definer.rb → field_renderer_definer.rb} +10 -10
  38. data/lib/plutonium/core/fields/inputs/attachment_input.rb +2 -2
  39. data/lib/plutonium/core/fields/inputs/base.rb +76 -10
  40. data/lib/plutonium/core/fields/inputs/checkbox_input.rb +3 -1
  41. data/lib/plutonium/core/fields/inputs/date_time_input.rb +3 -1
  42. data/lib/plutonium/core/fields/inputs/nested_input.rb +36 -21
  43. data/lib/plutonium/core/fields/inputs/noop_input.rb +1 -4
  44. data/lib/plutonium/core/fields/inputs/polymorphic_belongs_to_association_input.rb +8 -7
  45. data/lib/plutonium/core/fields/inputs/simple_form_association_input.rb +4 -5
  46. data/lib/plutonium/core/fields/inputs/simple_form_input.rb +2 -3
  47. data/lib/plutonium/core/fields/renderers/association_renderer.rb +11 -5
  48. data/lib/plutonium/core/fields/renderers/attachment_renderer.rb +3 -10
  49. data/lib/plutonium/core/fields/renderers/base.rb +83 -0
  50. data/lib/plutonium/core/fields/renderers/basic_renderer.rb +3 -17
  51. data/lib/plutonium/core/fields/renderers/factory.rb +0 -1
  52. data/lib/plutonium/core/renderable.rb +20 -0
  53. data/lib/plutonium/helpers/display_helper.rb +1 -1
  54. data/lib/plutonium/resource/controller.rb +1 -1
  55. data/lib/plutonium/resource/policy.rb +1 -1
  56. data/lib/plutonium/resource/presenter.rb +3 -3
  57. data/lib/plutonium/resource/query_object.rb +4 -4
  58. data/lib/plutonium/resource/record.rb +1 -1
  59. data/lib/plutonium/simple_form/attachment_component.rb +1 -1
  60. data/lib/plutonium/version.rb +1 -1
  61. data/package.json +1 -1
  62. data/src/js/controllers/register_controllers.js +2 -0
  63. data/src/js/controllers/resource_collapse_controller.js +30 -0
  64. data/src/js/controllers/resource_drop_down_controller.js +1 -1
  65. metadata +14 -5
  66. data/lib/plutonium/core/associations/renderers/basic_renderer.rb +0 -28
@@ -1,3 +1,3 @@
1
1
  module Plutonium
2
- VERSION = "0.12.8"
2
+ VERSION = "0.12.10"
3
3
  end
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@radioactive-labs/plutonium",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Core assets for the Plutonium gem",
5
5
  "type": "module",
6
6
  "main": "src/js/core.js",
@@ -16,6 +16,7 @@ import TableToolbarController from "./table_toolbar_controller.js"
16
16
  import TableController from "./table_controller.js"
17
17
  import FormController from "./form_controller.js"
18
18
  import ResourceDropDownController from "./resource_drop_down_controller.js"
19
+ import ResourceCollapseController from "./resource_collapse_controller.js"
19
20
  import ResourceDismissController from "./resource_dismiss_controller.js"
20
21
  import FrameNavigatorController from "./frame_navigator_controller.js"
21
22
  import ColorModeController from "./color_mode_controller.js"
@@ -39,6 +40,7 @@ export default function (application) {
39
40
  application.register("table", TableController)
40
41
  application.register("form", FormController)
41
42
  application.register("resource-drop-down", ResourceDropDownController)
43
+ application.register("resource-collapse", ResourceCollapseController)
42
44
  application.register("resource-dismiss", ResourceDismissController)
43
45
  application.register("frame-navigator", FrameNavigatorController)
44
46
  application.register("color-mode", ColorModeController)
@@ -0,0 +1,30 @@
1
+ import { Controller } from "@hotwired/stimulus"
2
+ import { Collapse } from 'flowbite';
3
+
4
+
5
+ // Connects to data-controller="resource-collapse"
6
+ export default class extends Controller {
7
+ static targets = ["trigger", "menu"]
8
+
9
+ connect() {
10
+ console.log(`resource-collapse connected: ${this.element}`)
11
+
12
+ this.collapse = new Collapse(this.menuTarget, this.triggerTarget);
13
+ }
14
+
15
+ disconnect() {
16
+ this.collapse = null
17
+ }
18
+
19
+ toggle() {
20
+ this.collapse.toggle()
21
+ }
22
+
23
+ show() {
24
+ this.collapse.show()
25
+ }
26
+
27
+ hide() {
28
+ this.collapse.hide()
29
+ }
30
+ }
@@ -26,6 +26,6 @@ export default class extends Controller {
26
26
  }
27
27
 
28
28
  hide() {
29
- this.dropdown.show()
29
+ this.dropdown.hide()
30
30
  }
31
31
  }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: plutonium
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.8
4
+ version: 0.12.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Froelich
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-06-10 00:00:00.000000000 Z
11
+ date: 2024-06-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: zeitwerk
@@ -877,6 +877,12 @@ files:
877
877
  - lib/generators/pu/docker/install/templates/docker-compose.yml
878
878
  - lib/generators/pu/eject/layout/layout_generator.rb
879
879
  - lib/generators/pu/eject/shell/shell_generator.rb
880
+ - lib/generators/pu/field/input/input_generator.rb
881
+ - lib/generators/pu/field/input/templates/.keep
882
+ - lib/generators/pu/field/input/templates/input.rb.tt
883
+ - lib/generators/pu/field/renderer/renderer_generator.rb
884
+ - lib/generators/pu/field/renderer/templates/.keep
885
+ - lib/generators/pu/field/renderer/templates/renderer.rb.tt
880
886
  - lib/generators/pu/gem/dotenv/dotenv_generator.rb
881
887
  - lib/generators/pu/gem/dotenv/templates/.env
882
888
  - lib/generators/pu/gem/dotenv/templates/.env.local
@@ -1029,7 +1035,7 @@ files:
1029
1035
  - lib/plutonium/core/actions/interactive_action.rb
1030
1036
  - lib/plutonium/core/actions/new_action.rb
1031
1037
  - lib/plutonium/core/actions/show_action.rb
1032
- - lib/plutonium/core/associations/renderers/basic_renderer.rb
1038
+ - lib/plutonium/core/associations/renderers/base.rb
1033
1039
  - lib/plutonium/core/associations/renderers/factory.rb
1034
1040
  - lib/plutonium/core/associations/renderers/has_many_renderer.rb
1035
1041
  - lib/plutonium/core/autodiscovery/association_renderer_discoverer.rb
@@ -1047,8 +1053,8 @@ files:
1047
1053
  - lib/plutonium/core/definers/action_definer.rb
1048
1054
  - lib/plutonium/core/definers/association_renderer_definer.rb
1049
1055
  - lib/plutonium/core/definers/field_definer.rb
1050
- - lib/plutonium/core/definers/input_definer.rb
1051
- - lib/plutonium/core/definers/renderer_definer.rb
1056
+ - lib/plutonium/core/definers/field_input_definer.rb
1057
+ - lib/plutonium/core/definers/field_renderer_definer.rb
1052
1058
  - lib/plutonium/core/fields/inputs/attachment_input.rb
1053
1059
  - lib/plutonium/core/fields/inputs/base.rb
1054
1060
  - lib/plutonium/core/fields/inputs/belongs_to_association_input.rb
@@ -1064,8 +1070,10 @@ files:
1064
1070
  - lib/plutonium/core/fields/inputs/simple_form_input.rb
1065
1071
  - lib/plutonium/core/fields/renderers/association_renderer.rb
1066
1072
  - lib/plutonium/core/fields/renderers/attachment_renderer.rb
1073
+ - lib/plutonium/core/fields/renderers/base.rb
1067
1074
  - lib/plutonium/core/fields/renderers/basic_renderer.rb
1068
1075
  - lib/plutonium/core/fields/renderers/factory.rb
1076
+ - lib/plutonium/core/renderable.rb
1069
1077
  - lib/plutonium/core/ui/collection.rb
1070
1078
  - lib/plutonium/core/ui/detail.rb
1071
1079
  - lib/plutonium/core/ui/form.rb
@@ -1135,6 +1143,7 @@ files:
1135
1143
  - src/js/controllers/nav_user_section_controller.js
1136
1144
  - src/js/controllers/nested_resource_form_fields_controller.js
1137
1145
  - src/js/controllers/register_controllers.js
1146
+ - src/js/controllers/resource_collapse_controller.js
1138
1147
  - src/js/controllers/resource_dismiss_controller.js
1139
1148
  - src/js/controllers/resource_drop_down_controller.js
1140
1149
  - src/js/controllers/resource_header_controller.js
@@ -1,28 +0,0 @@
1
- module Plutonium
2
- module Core
3
- module Associations
4
- module Renderers
5
- class BasicRenderer
6
- attr_reader :name, :label, :reflection, :user_options
7
-
8
- def initialize(name, label:, reflection:, **user_options)
9
- @name = name
10
- @label = label
11
- @reflection = reflection
12
- @user_options = user_options
13
- end
14
-
15
- def render(view_context, record)
16
- raise NotImplementedError
17
- end
18
-
19
- def options = @options ||= renderer_options.deep_merge(@user_options)
20
-
21
- private
22
-
23
- def renderer_options = {}
24
- end
25
- end
26
- end
27
- end
28
- end