voom-presenters 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +4 -1
  3. data/Gemfile +1 -0
  4. data/Gemfile.lock +8 -0
  5. data/README.md +12 -0
  6. data/app/demo/components/date_fields.pom +96 -0
  7. data/app/demo/components/datetime_fields.pom +106 -0
  8. data/app/demo/components/nav/drawer.pom +1 -1
  9. data/app/demo/components/nav/menu.pom +1 -1
  10. data/app/demo/components/time_fields.pom +59 -0
  11. data/app/demo/components/toggles.pom +28 -1
  12. data/app/demo/events/actions/autocomplete.pom +32 -0
  13. data/app/demo/events/actions/deletes.pom +24 -0
  14. data/app/demo/events/actions/dialog.pom +19 -0
  15. data/app/demo/{event/actions/dialog → events/actions/dialogs}/show_dialog.pom +0 -0
  16. data/app/demo/{event/actions/dialog → events/actions/dialogs}/trigger.pom +0 -0
  17. data/app/demo/events/actions/loads.pom +19 -0
  18. data/app/demo/events/actions/posts.pom +23 -0
  19. data/app/demo/{event/new_text.pom → events/actions/replace_text.pom} +0 -0
  20. data/app/demo/events/actions/replaces.pom +21 -0
  21. data/app/demo/events/actions/snackbar.pom +19 -0
  22. data/app/demo/events/actions/toggle_visiblity.pom +21 -0
  23. data/app/demo/events/actions/updates.pom +24 -0
  24. data/app/demo/events/field_level.pom +20 -0
  25. data/app/demo/events/form_level.pom +24 -0
  26. data/app/demo/events/nav/drawer.pom +21 -0
  27. data/app/demo/events.pom +8 -77
  28. data/app/demo/formatting_tokens.pom +125 -0
  29. data/app/demo/index.pom +12 -5
  30. data/app/demo/markdown.pom +33 -40
  31. data/app/demo/shared/context_list.pom +2 -2
  32. data/app/demo/styles.pom +1 -0
  33. data/config.ru +9 -0
  34. data/lib/voom/presenters/dsl/components/base.rb +5 -0
  35. data/lib/voom/presenters/dsl/components/card.rb +2 -0
  36. data/lib/voom/presenters/dsl/components/content.rb +2 -0
  37. data/lib/voom/presenters/dsl/components/date_field.rb +21 -0
  38. data/lib/voom/presenters/dsl/components/datetime_base.rb +48 -0
  39. data/lib/voom/presenters/dsl/components/datetime_field.rb +23 -0
  40. data/lib/voom/presenters/dsl/components/expansion_panel.rb +1 -0
  41. data/lib/voom/presenters/dsl/components/form.rb +2 -0
  42. data/lib/voom/presenters/dsl/components/grid.rb +2 -0
  43. data/lib/voom/presenters/dsl/components/mixins/date_time_fields.rb +29 -0
  44. data/lib/voom/presenters/dsl/components/mixins/text_fields.rb +0 -6
  45. data/lib/voom/presenters/dsl/components/table.rb +1 -1
  46. data/lib/voom/presenters/dsl/components/time_field.rb +21 -0
  47. data/lib/voom/presenters/dsl/user_interface.rb +3 -0
  48. data/lib/voom/presenters/helpers/rails/currency.rb +16 -0
  49. data/lib/voom/presenters/helpers/rails/model_table.rb +52 -0
  50. data/lib/voom/presenters/helpers/rails.rb +4 -34
  51. data/lib/voom/presenters/settings.rb +14 -0
  52. data/lib/voom/presenters/version.rb +1 -1
  53. data/lib/voom/presenters/web_client/app.rb +8 -0
  54. data/public/bundle.css +676 -0
  55. data/public/bundle.js +3314 -1151
  56. data/views/mdc/assets/js/components/datetime.js +36 -0
  57. data/views/mdc/assets/js/components/events/base.js +5 -5
  58. data/views/mdc/assets/js/components/forms.js +2 -2
  59. data/views/mdc/assets/js/components/initialize.js +2 -2
  60. data/views/mdc/assets/js/components/switches.js +1 -1
  61. data/views/mdc/assets/js/components/text-fields.js +2 -4
  62. data/views/mdc/assets/scss/components/datetime.scss +19 -0
  63. data/views/mdc/assets/scss/components/textfield.scss +7 -0
  64. data/views/mdc/assets/scss/components/vendor/flatpickr.min.css +13 -0
  65. data/views/mdc/components/date.erb +1 -0
  66. data/views/mdc/components/{date_time.erb → datetime.erb} +13 -8
  67. data/views/mdc/components/icon.erb +2 -0
  68. data/views/mdc/components/text_field.erb +3 -2
  69. data/views/mdc/components/time.erb +1 -0
  70. data/views/mdc/layout.erb +1 -0
  71. data/views/mdc/package-lock.json +5 -0
  72. data/views/mdc/package.json +1 -1
  73. metadata +33 -18
  74. data/LICENSE.txt +0 -21
  75. data/app/demo/event/actions/nav/drawer.pom +0 -5
  76. data/app/demo/event/actions/nav/menu.pom +0 -19
  77. data/app/demo/event/actions.rb +0 -86
  78. data/app/demo/event/autocomplete.pom +0 -27
  79. data/app/demo/event/field_level.pom +0 -22
  80. data/app/demo/event/form_level.pom +0 -26
  81. data/app/demo/event/nav/drawer.pom +0 -5
  82. data/app/demo/event/nav/menu.pom +0 -14
  83. data/lib/voom/presenters/dsl/components/date_time.rb +0 -17
  84. data/lib/voom/presenters/helpers/currency.rb +0 -14
  85. data/views/mdc/assets/js/components/date-time.js +0 -6
@@ -1,22 +0,0 @@
1
- Voom::Presenters.define(:field_level_events) do
2
- attach :top_nav
3
-
4
- grid do
5
- column 1
6
- column 4 do
7
- card do
8
- display 'Field Level Events'
9
- heading 'Text Fields'
10
- body 'This demonstrates that a change event will submit the field value to the event action. '\
11
- 'This works with posts and replace actions'
12
- text_field name: :myfield do
13
- label 'Data to post'
14
- event :change do
15
- replaces :context_list, :context_list
16
- end
17
- end
18
- attach :context_list
19
- end
20
- end
21
- end
22
- end
@@ -1,26 +0,0 @@
1
- Voom::Presenters.define(:form_level_events) do
2
- attach :top_nav
3
-
4
- grid do
5
- column 1
6
- column 4 do
7
- card do
8
- display 'Posts in Form'
9
- body 'This demonstrates that a change event on **ANY** form input will send all the form inputs to the event action. '\
10
- 'This works with posts and replace actions'
11
- form do
12
- text_field name: :myfield do
13
- label 'Data to post'
14
- end
15
- text_field name: :myfield2 do
16
- label 'More Data to post'
17
- end
18
- event :change do
19
- replaces :context_list, :context_list
20
- end
21
- end
22
- attach :context_list
23
- end
24
- end
25
- end
26
- end
@@ -1,5 +0,0 @@
1
- Voom::Presenters.define(:events_drawer) do
2
- drawer 'Presenters Demo' do
3
- attach :events_menu
4
- end
5
- end
@@ -1,14 +0,0 @@
1
- Voom::Presenters.define(:events_menu) do
2
- helpers Voom::Presenters::Helpers::Inflector
3
- menu side: :left do
4
- %i(event_actions field_level form_level).sort.each do |comp|
5
- item titleize(comp) do
6
- event :click do
7
- loads comp
8
- end
9
- end
10
- end
11
- end
12
- end
13
-
14
-
@@ -1,17 +0,0 @@
1
- require_relative 'text_field'
2
-
3
- module Voom
4
- module Presenters
5
- module DSL
6
- module Components
7
- class DateTime < TextField
8
- def initialize(**attribs_, &block)
9
- super(type: :date_time, **attribs_, &block)
10
- expand!
11
- end
12
- end
13
- end
14
- end
15
- end
16
- end
17
-
@@ -1,14 +0,0 @@
1
- module Voom
2
- module Presenters
3
- module Helpers
4
- module Currency
5
- include ActionView::Helpers::NumberHelper
6
-
7
- def cents_to_currency(amount)
8
- number_to_currency(amount.to_f / 100)
9
- end
10
-
11
- end
12
- end
13
- end
14
- end
@@ -1,6 +0,0 @@
1
- export function initDateTime() {
2
- console.log('\tDateTime');
3
- }
4
-
5
-
6
-