plutonium 0.12.9 → 0.12.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/app/views/components/form/form_component.html.erb +1 -3
  3. data/app/views/components/interactive_action_form/interactive_action_form_component.html.erb +5 -7
  4. data/app/views/components/nested_resource_form_fields/nested_resource_form_fields_component.html.erb +2 -2
  5. data/app/views/components/table_search_input/table_search_input_component.html.erb +8 -2
  6. data/app/views/resource/_interactive_resource_action_form.html.erb +1 -1
  7. data/app/views/resource/_resource_details.html.erb +9 -2
  8. data/app/views/resource/_resource_table.html.erb +9 -1
  9. data/lib/generators/pu/core/assets/templates/tailwind.config.js +2 -0
  10. data/lib/generators/pu/core/install/install_generator.rb +1 -1
  11. data/lib/generators/pu/core/install/templates/config/initializers/plutonium.rb +4 -0
  12. data/lib/generators/pu/eject/layout/layout_generator.rb +3 -2
  13. data/lib/generators/pu/eject/shell/shell_generator.rb +3 -2
  14. data/lib/generators/pu/field/input/input_generator.rb +32 -0
  15. data/lib/generators/pu/field/input/templates/.keep +0 -0
  16. data/lib/generators/pu/field/input/templates/input.rb.tt +15 -0
  17. data/lib/generators/pu/field/renderer/renderer_generator.rb +32 -0
  18. data/lib/generators/pu/field/renderer/templates/.keep +0 -0
  19. data/lib/generators/pu/field/renderer/templates/renderer.rb.tt +9 -0
  20. data/lib/plutonium/core/actions/interactive_action.rb +2 -2
  21. data/lib/plutonium/core/associations/renderers/base.rb +77 -0
  22. data/lib/plutonium/core/associations/renderers/factory.rb +0 -2
  23. data/lib/plutonium/core/associations/renderers/has_many_renderer.rb +6 -4
  24. data/lib/plutonium/core/controllers/crud_actions.rb +1 -1
  25. data/lib/plutonium/core/controllers/presentable.rb +3 -3
  26. data/lib/plutonium/core/definers/field_definer.rb +4 -4
  27. data/lib/plutonium/core/definers/{input_definer.rb → field_input_definer.rb} +4 -4
  28. data/lib/plutonium/core/definers/{renderer_definer.rb → field_renderer_definer.rb} +10 -10
  29. data/lib/plutonium/core/fields/inputs/attachment_input.rb +2 -2
  30. data/lib/plutonium/core/fields/inputs/base.rb +76 -10
  31. data/lib/plutonium/core/fields/inputs/checkbox_input.rb +3 -1
  32. data/lib/plutonium/core/fields/inputs/date_time_input.rb +3 -1
  33. data/lib/plutonium/core/fields/inputs/nested_input.rb +36 -21
  34. data/lib/plutonium/core/fields/inputs/noop_input.rb +1 -4
  35. data/lib/plutonium/core/fields/inputs/polymorphic_belongs_to_association_input.rb +8 -7
  36. data/lib/plutonium/core/fields/inputs/simple_form_association_input.rb +4 -5
  37. data/lib/plutonium/core/fields/inputs/simple_form_input.rb +2 -3
  38. data/lib/plutonium/core/fields/renderers/association_renderer.rb +11 -5
  39. data/lib/plutonium/core/fields/renderers/attachment_renderer.rb +3 -10
  40. data/lib/plutonium/core/fields/renderers/base.rb +83 -0
  41. data/lib/plutonium/core/fields/renderers/basic_renderer.rb +3 -17
  42. data/lib/plutonium/core/fields/renderers/factory.rb +0 -1
  43. data/lib/plutonium/core/renderable.rb +20 -0
  44. data/lib/plutonium/helpers/display_helper.rb +1 -1
  45. data/lib/plutonium/resource/controller.rb +1 -1
  46. data/lib/plutonium/resource/policy.rb +1 -1
  47. data/lib/plutonium/resource/presenter.rb +3 -3
  48. data/lib/plutonium/resource/query_object.rb +4 -4
  49. data/lib/plutonium/resource/record.rb +1 -1
  50. data/lib/plutonium/simple_form/attachment_component.rb +1 -1
  51. data/lib/plutonium/version.rb +1 -1
  52. data/package.json +1 -1
  53. metadata +13 -5
  54. data/lib/plutonium/core/associations/renderers/basic_renderer.rb +0 -28
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.9
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
@@ -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