voom-presenters 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +54 -0
- data/.ruby-version +1 -0
- data/Gemfile +11 -0
- data/Gemfile.lock +104 -0
- data/LICENSE +21 -0
- data/LICENSE.txt +21 -0
- data/README.md +45 -0
- data/ROADMAP.md +21 -0
- data/Rakefile +6 -0
- data/app/demo/component_status.pom +76 -0
- data/app/demo/components.pom +19 -0
- data/app/demo/components/badges.pom +25 -0
- data/app/demo/components/buttons.pom +51 -0
- data/app/demo/components/cards.pom +79 -0
- data/app/demo/components/chips.pom +91 -0
- data/app/demo/components/dialogs.pom +27 -0
- data/app/demo/components/drawers.pom +34 -0
- data/app/demo/components/expansion_panels.pom +21 -0
- data/app/demo/components/fabs-mini.pom +18 -0
- data/app/demo/components/fabs.pom +16 -0
- data/app/demo/components/footers.pom +36 -0
- data/app/demo/components/forms.pom +30 -0
- data/app/demo/components/headers.pom +37 -0
- data/app/demo/components/hidden_fields.pom +20 -0
- data/app/demo/components/icons.pom +94 -0
- data/app/demo/components/layouts.pom +44 -0
- data/app/demo/components/lists.pom +124 -0
- data/app/demo/components/menus.pom +43 -0
- data/app/demo/components/nav/drawer.pom +5 -0
- data/app/demo/components/nav/menu.pom +15 -0
- data/app/demo/components/selects.pom +30 -0
- data/app/demo/components/snackbar.pom +24 -0
- data/app/demo/components/snackbar_attached.pom +6 -0
- data/app/demo/components/tables.pom +39 -0
- data/app/demo/components/text_areas.pom +19 -0
- data/app/demo/components/text_fields.pom +57 -0
- data/app/demo/components/toggles.pom +29 -0
- data/app/demo/components/tooltips.pom +120 -0
- data/app/demo/event/actions.rb +86 -0
- data/app/demo/event/actions/dialog/show_dialog.pom +9 -0
- data/app/demo/event/actions/dialog/trigger.pom +86 -0
- data/app/demo/event/actions/nav/drawer.pom +5 -0
- data/app/demo/event/actions/nav/menu.pom +19 -0
- data/app/demo/event/autocomplete.pom +27 -0
- data/app/demo/event/field_level.pom +22 -0
- data/app/demo/event/form_level.pom +26 -0
- data/app/demo/event/nav/drawer.pom +5 -0
- data/app/demo/event/nav/menu.pom +14 -0
- data/app/demo/event/new_text.pom +6 -0
- data/app/demo/events.pom +98 -0
- data/app/demo/helpers/indented_grid.rb +14 -0
- data/app/demo/index.pom +19 -0
- data/app/demo/markdown.pom +73 -0
- data/app/demo/nav/top_nav.pom +42 -0
- data/app/demo/shared/code.pom +20 -0
- data/app/demo/shared/context_list.pom +29 -0
- data/app/demo/shared/debug.pom +17 -0
- data/app/demo/styles.pom +26 -0
- data/bin/console +22 -0
- data/bin/setup +8 -0
- data/component-status.yml +219 -0
- data/config.ru +21 -0
- data/lib/voom-presenters.rb +9 -0
- data/lib/voom/container_methods.rb +40 -0
- data/lib/voom/logger_methods.rb +11 -0
- data/lib/voom/parameters.rb +73 -0
- data/lib/voom/presenters-engine.rb +40 -0
- data/lib/voom/presenters.rb +13 -0
- data/lib/voom/presenters/api/app.rb +53 -0
- data/lib/voom/presenters/api/router.rb +94 -0
- data/lib/voom/presenters/app.rb +55 -0
- data/lib/voom/presenters/container_item.rb +16 -0
- data/lib/voom/presenters/demo/echo.rb +29 -0
- data/lib/voom/presenters/demo/search-terms.yml +50 -0
- data/lib/voom/presenters/demo/search.rb +29 -0
- data/lib/voom/presenters/dsl.rb +60 -0
- data/lib/voom/presenters/dsl/components/action.rb +35 -0
- data/lib/voom/presenters/dsl/components/avatar.rb +27 -0
- data/lib/voom/presenters/dsl/components/badge.rb +21 -0
- data/lib/voom/presenters/dsl/components/base.rb +78 -0
- data/lib/voom/presenters/dsl/components/button.rb +49 -0
- data/lib/voom/presenters/dsl/components/card.rb +119 -0
- data/lib/voom/presenters/dsl/components/checkbox.rb +16 -0
- data/lib/voom/presenters/dsl/components/chip.rb +48 -0
- data/lib/voom/presenters/dsl/components/content.rb +33 -0
- data/lib/voom/presenters/dsl/components/date_time.rb +17 -0
- data/lib/voom/presenters/dsl/components/dialog.rb +50 -0
- data/lib/voom/presenters/dsl/components/drawer.rb +40 -0
- data/lib/voom/presenters/dsl/components/event.rb +101 -0
- data/lib/voom/presenters/dsl/components/event_base.rb +20 -0
- data/lib/voom/presenters/dsl/components/expansion_panel.rb +46 -0
- data/lib/voom/presenters/dsl/components/footer.rb +25 -0
- data/lib/voom/presenters/dsl/components/form.rb +42 -0
- data/lib/voom/presenters/dsl/components/grid.rb +64 -0
- data/lib/voom/presenters/dsl/components/header.rb +33 -0
- data/lib/voom/presenters/dsl/components/hidden_field.rb +25 -0
- data/lib/voom/presenters/dsl/components/icon.rb +21 -0
- data/lib/voom/presenters/dsl/components/icon_base.rb +24 -0
- data/lib/voom/presenters/dsl/components/icon_toggle.rb +21 -0
- data/lib/voom/presenters/dsl/components/image.rb +36 -0
- data/lib/voom/presenters/dsl/components/input.rb +19 -0
- data/lib/voom/presenters/dsl/components/list.rb +39 -0
- data/lib/voom/presenters/dsl/components/lists/action.rb +72 -0
- data/lib/voom/presenters/dsl/components/lists/line.rb +83 -0
- data/lib/voom/presenters/dsl/components/lists/separator.rb +16 -0
- data/lib/voom/presenters/dsl/components/menu.rb +66 -0
- data/lib/voom/presenters/dsl/components/mixins/append.rb +20 -0
- data/lib/voom/presenters/dsl/components/mixins/attaches.rb +18 -0
- data/lib/voom/presenters/dsl/components/mixins/avatar.rb +18 -0
- data/lib/voom/presenters/dsl/components/mixins/buttons.rb +15 -0
- data/lib/voom/presenters/dsl/components/mixins/chips.rb +21 -0
- data/lib/voom/presenters/dsl/components/mixins/common.rb +50 -0
- data/lib/voom/presenters/dsl/components/mixins/content.rb +15 -0
- data/lib/voom/presenters/dsl/components/mixins/dialogs.rb +19 -0
- data/lib/voom/presenters/dsl/components/mixins/event.rb +19 -0
- data/lib/voom/presenters/dsl/components/mixins/expansion_panels.rb +15 -0
- data/lib/voom/presenters/dsl/components/mixins/grids.rb +15 -0
- data/lib/voom/presenters/dsl/components/mixins/helpers.rb +20 -0
- data/lib/voom/presenters/dsl/components/mixins/icons.rb +17 -0
- data/lib/voom/presenters/dsl/components/mixins/images.rb +15 -0
- data/lib/voom/presenters/dsl/components/mixins/menus.rb +15 -0
- data/lib/voom/presenters/dsl/components/mixins/selects.rb +17 -0
- data/lib/voom/presenters/dsl/components/mixins/snackbars.rb +18 -0
- data/lib/voom/presenters/dsl/components/mixins/text_fields.rb +35 -0
- data/lib/voom/presenters/dsl/components/mixins/toggles.rb +40 -0
- data/lib/voom/presenters/dsl/components/mixins/tooltips.rb +18 -0
- data/lib/voom/presenters/dsl/components/mixins/typography.rb +37 -0
- data/lib/voom/presenters/dsl/components/page.rb +29 -0
- data/lib/voom/presenters/dsl/components/radio_button.rb +14 -0
- data/lib/voom/presenters/dsl/components/select.rb +64 -0
- data/lib/voom/presenters/dsl/components/snackbar.rb +32 -0
- data/lib/voom/presenters/dsl/components/switch.rb +14 -0
- data/lib/voom/presenters/dsl/components/table.rb +102 -0
- data/lib/voom/presenters/dsl/components/text_area.rb +20 -0
- data/lib/voom/presenters/dsl/components/text_field.rb +74 -0
- data/lib/voom/presenters/dsl/components/toggle_base.rb +26 -0
- data/lib/voom/presenters/dsl/components/tooltip.rb +25 -0
- data/lib/voom/presenters/dsl/components/typography.rb +25 -0
- data/lib/voom/presenters/dsl/definer.rb +13 -0
- data/lib/voom/presenters/dsl/definition.rb +31 -0
- data/lib/voom/presenters/dsl/invalid_presenter.rb +8 -0
- data/lib/voom/presenters/dsl/lockable.rb +15 -0
- data/lib/voom/presenters/dsl/user_interface.rb +135 -0
- data/lib/voom/presenters/errors/parameter_validation.rb +10 -0
- data/lib/voom/presenters/errors/unprocessable.rb +8 -0
- data/lib/voom/presenters/helpers.rb +18 -0
- data/lib/voom/presenters/helpers/currency.rb +14 -0
- data/lib/voom/presenters/helpers/date.rb +22 -0
- data/lib/voom/presenters/helpers/errors.rb +11 -0
- data/lib/voom/presenters/helpers/inflector.rb +16 -0
- data/lib/voom/presenters/helpers/rails.rb +60 -0
- data/lib/voom/presenters/helpers/route.rb +11 -0
- data/lib/voom/presenters/helpers/time.rb +27 -0
- data/lib/voom/presenters/settings.rb +35 -0
- data/lib/voom/presenters/version.rb +5 -0
- data/lib/voom/presenters/web_client/app.rb +128 -0
- data/lib/voom/presenters/web_client/markdown_render.rb +16 -0
- data/lib/voom/presenters/web_client/router.rb +96 -0
- data/lib/voom/serializer.rb +43 -0
- data/lib/voom/symbol/to_str.rb +29 -0
- data/lib/voom/trace.rb +19 -0
- data/presenters.gemspec +37 -0
- data/public/.gitignore +2 -0
- data/public/bundle.css +11413 -0
- data/public/bundle.js +16456 -0
- data/public/dialog-polyfill.js +738 -0
- data/public/favicon.ico +0 -0
- data/public/img/demo/dog.png +0 -0
- data/public/img/demo/image_card.jpg +0 -0
- data/public/img/demo/rx.png +0 -0
- data/public/img/demo/welcome_card.jpg +0 -0
- data/public/img/settings/blue.png +0 -0
- data/public/img/settings/green.png +0 -0
- data/public/img/settings/orange.png +0 -0
- data/public/img/settings/purple.png +0 -0
- data/public/img/settings/red.png +0 -0
- data/public/img/settings/teal.png +0 -0
- data/public/img/settings/white.png +0 -0
- data/public/img/settings/yellow.png +0 -0
- data/public/scripts.js +289 -0
- data/public/style-bundle.js +73 -0
- data/public/styles.css +16 -0
- data/views/mdc/.gitignore +1 -0
- data/views/mdc/assets/js/app.js +10 -0
- data/views/mdc/assets/js/components/base-component.js +5 -0
- data/views/mdc/assets/js/components/button.js +15 -0
- data/views/mdc/assets/js/components/cards.js +3 -0
- data/views/mdc/assets/js/components/checkboxes.js +15 -0
- data/views/mdc/assets/js/components/chips.js +12 -0
- data/views/mdc/assets/js/components/date-time.js +6 -0
- data/views/mdc/assets/js/components/dialogs.js +32 -0
- data/views/mdc/assets/js/components/events.js +151 -0
- data/views/mdc/assets/js/components/events/autocomplete.js +96 -0
- data/views/mdc/assets/js/components/events/base.js +41 -0
- data/views/mdc/assets/js/components/events/dialog.js +25 -0
- data/views/mdc/assets/js/components/events/errors.js +142 -0
- data/views/mdc/assets/js/components/events/loads.js +22 -0
- data/views/mdc/assets/js/components/events/navigates.js +17 -0
- data/views/mdc/assets/js/components/events/posts.js +99 -0
- data/views/mdc/assets/js/components/events/replaces.js +82 -0
- data/views/mdc/assets/js/components/events/selects.js +28 -0
- data/views/mdc/assets/js/components/events/snackbar.js +23 -0
- data/views/mdc/assets/js/components/events/toggle_visiblity.js +19 -0
- data/views/mdc/assets/js/components/forms.js +57 -0
- data/views/mdc/assets/js/components/icon-toggles.js +21 -0
- data/views/mdc/assets/js/components/initialize.js +34 -0
- data/views/mdc/assets/js/components/lists.js +4 -0
- data/views/mdc/assets/js/components/menus.js +31 -0
- data/views/mdc/assets/js/components/mixins/event-handler.js +13 -0
- data/views/mdc/assets/js/components/selects.js +45 -0
- data/views/mdc/assets/js/components/snackbar.js +32 -0
- data/views/mdc/assets/js/components/text-fields.js +77 -0
- data/views/mdc/assets/js/dialog-polyfill.js +738 -0
- data/views/mdc/assets/js/material.js +3996 -0
- data/views/mdc/assets/js/utils/urls.js +54 -0
- data/views/mdc/assets/scss/app.scss +31 -0
- data/views/mdc/assets/scss/components/avatar.scss +41 -0
- data/views/mdc/assets/scss/components/button.scss +47 -0
- data/views/mdc/assets/scss/components/card.scss +54 -0
- data/views/mdc/assets/scss/components/checkbox.scss +5 -0
- data/views/mdc/assets/scss/components/chip.scss +30 -0
- data/views/mdc/assets/scss/components/datetime.scss +0 -0
- data/views/mdc/assets/scss/components/dialog.scss +3 -0
- data/views/mdc/assets/scss/components/expansion-panel.scss +153 -0
- data/views/mdc/assets/scss/components/fab.scss +8 -0
- data/views/mdc/assets/scss/components/grid.scss +10 -0
- data/views/mdc/assets/scss/components/icon-toggles.scss +9 -0
- data/views/mdc/assets/scss/components/icon.scss +34 -0
- data/views/mdc/assets/scss/components/image.scss +24 -0
- data/views/mdc/assets/scss/components/list.scss +9 -0
- data/views/mdc/assets/scss/components/menu.scss +17 -0
- data/views/mdc/assets/scss/components/select.scss +16 -0
- data/views/mdc/assets/scss/components/snackbar.scss +5 -0
- data/views/mdc/assets/scss/components/switch.scss +6 -0
- data/views/mdc/assets/scss/components/table-pagination.scss +65 -0
- data/views/mdc/assets/scss/components/textfield.scss +1 -0
- data/views/mdc/assets/scss/components/typography.scss +25 -0
- data/views/mdc/assets/scss/material.blue_grey-orange.min.css +8 -0
- data/views/mdc/assets/scss/styles.scss +11 -0
- data/views/mdc/assets/scss/theme.scss +5 -0
- data/views/mdc/body/drawer.erb +18 -0
- data/views/mdc/body/drawers/menu.erb +25 -0
- data/views/mdc/body/footer.erb +1 -0
- data/views/mdc/body/footers/large.erb +27 -0
- data/views/mdc/body/footers/menu_item.erb +6 -0
- data/views/mdc/body/footers/small.erb +14 -0
- data/views/mdc/body/header.erb +25 -0
- data/views/mdc/body/snackbar.erb +10 -0
- data/views/mdc/components/avatar.erb +24 -0
- data/views/mdc/components/badge.erb +2 -0
- data/views/mdc/components/body.erb +2 -0
- data/views/mdc/components/button.erb +17 -0
- data/views/mdc/components/buttons/button.erb +20 -0
- data/views/mdc/components/buttons/fab.erb +22 -0
- data/views/mdc/components/buttons/icon.erb +24 -0
- data/views/mdc/components/card.erb +49 -0
- data/views/mdc/components/checkbox.erb +22 -0
- data/views/mdc/components/chip.erb +31 -0
- data/views/mdc/components/content.erb +11 -0
- data/views/mdc/components/date_time.erb +30 -0
- data/views/mdc/components/dialog.erb +27 -0
- data/views/mdc/components/display.erb +2 -0
- data/views/mdc/components/event.erb +18 -0
- data/views/mdc/components/expansion_panel.erb +11 -0
- data/views/mdc/components/form.erb +15 -0
- data/views/mdc/components/grid.erb +24 -0
- data/views/mdc/components/headline.erb +2 -0
- data/views/mdc/components/hidden_field.erb +1 -0
- data/views/mdc/components/icon.erb +30 -0
- data/views/mdc/components/icon_toggle.erb +15 -0
- data/views/mdc/components/image.erb +7 -0
- data/views/mdc/components/link.erb +14 -0
- data/views/mdc/components/list.erb +14 -0
- data/views/mdc/components/list/actions.erb +6 -0
- data/views/mdc/components/list/actions/button.erb +1 -0
- data/views/mdc/components/list/actions/checkbox.erb +1 -0
- data/views/mdc/components/list/actions/icon.erb +1 -0
- data/views/mdc/components/list/actions/icon_toggle.erb +1 -0
- data/views/mdc/components/list/actions/radio_button.erb +1 -0
- data/views/mdc/components/list/actions/switch.erb +1 -0
- data/views/mdc/components/list/avatar.erb +5 -0
- data/views/mdc/components/list/checkbox.erb +5 -0
- data/views/mdc/components/list/icon.erb +5 -0
- data/views/mdc/components/list/info.erb +1 -0
- data/views/mdc/components/list/line.erb +34 -0
- data/views/mdc/components/list/menu.erb +23 -0
- data/views/mdc/components/list/separator.erb +1 -0
- data/views/mdc/components/menu.erb +29 -0
- data/views/mdc/components/modal.erb +15 -0
- data/views/mdc/components/radio_button.erb +11 -0
- data/views/mdc/components/render.erb +4 -0
- data/views/mdc/components/select.erb +22 -0
- data/views/mdc/components/snackbar.erb +17 -0
- data/views/mdc/components/static.erb +7 -0
- data/views/mdc/components/subheading.erb +2 -0
- data/views/mdc/components/switch.erb +13 -0
- data/views/mdc/components/table.erb +13 -0
- data/views/mdc/components/table/header.erb +7 -0
- data/views/mdc/components/table/pagination.erb +24 -0
- data/views/mdc/components/table/row.erb +14 -0
- data/views/mdc/components/text_area.erb +8 -0
- data/views/mdc/components/text_field.erb +27 -0
- data/views/mdc/components/title.erb +4 -0
- data/views/mdc/components/tooltip.erb +5 -0
- data/views/mdc/components/typography.erb +13 -0
- data/views/mdc/init-depends.sh +2 -0
- data/views/mdc/layout.erb +50 -0
- data/views/mdc/package-lock.json +11524 -0
- data/views/mdc/package.json +39 -0
- data/views/mdc/web.erb +1 -0
- data/views/mdc/webpack.config.js +47 -0
- metadata +539 -0
data/app/demo/index.pom
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
require_relative 'helpers/indented_grid'
|
2
|
+
|
3
|
+
Voom::Presenters.define(:index) do
|
4
|
+
helpers Demo::Helpers::IndentedGrid
|
5
|
+
attach :top_nav
|
6
|
+
|
7
|
+
indented_grid do
|
8
|
+
headline 'Presenters', id: :headline
|
9
|
+
subheading 'Presenters are to HTML what C is to assembly'
|
10
|
+
body ['A presenter describes a user interface. It is evaluated and a presenter object model (POM) is returned.',
|
11
|
+
'A client that renders POM can display the given user interface.']
|
12
|
+
|
13
|
+
subheading 'For example this is the presentation for this page:', level: 2
|
14
|
+
|
15
|
+
attach 'code', file: __FILE__
|
16
|
+
end
|
17
|
+
|
18
|
+
|
19
|
+
end
|
@@ -0,0 +1,73 @@
|
|
1
|
+
require_relative 'helpers/indented_grid'
|
2
|
+
|
3
|
+
Voom::Presenters.define(:markdown) do
|
4
|
+
helpers Demo::Helpers::IndentedGrid
|
5
|
+
attach :top_nav
|
6
|
+
|
7
|
+
indented_grid do
|
8
|
+
heading 'Markdown'
|
9
|
+
|
10
|
+
body 'Markdown on all text elements is supported.',
|
11
|
+
'It uses [redcarpet](https://github.com/vmg/redcarpet) with the Safe render.'
|
12
|
+
title 'Line breaks'
|
13
|
+
body 'Passing multiple text strings', 'creates line breaks'
|
14
|
+
body ['Arrays of text strings is the same', 'it creates line breaks']
|
15
|
+
body "You can also do line breaks with two line feeds\n\nThis is on another line"
|
16
|
+
body "You can also do line breaks with two carriage returns\r\rThis is on another line"
|
17
|
+
body 'Line two carriage returns in a single string does the same thing
|
18
|
+
|
19
|
+
This is on another line'
|
20
|
+
body "Line two carriage returns in a double quoted string does the same thing\n\n\tThis is also another line"
|
21
|
+
body "A single line feed does not add a line\nThis is on the same line."
|
22
|
+
body "A single carriage return does not add a line\rThis is on the same line."
|
23
|
+
body "A carriage return followed by a line feed.\r\nDoes not break up the line."
|
24
|
+
title 'Escaping HTML'
|
25
|
+
body '<h1>HTML is escaped</h1>'
|
26
|
+
body '<script>console.log("so are script tags")</script>'
|
27
|
+
title 'Lists'
|
28
|
+
body '1. Item 1', '2. Item 2'
|
29
|
+
|
30
|
+
title 'Full Sample'
|
31
|
+
body <<-HEREDOC
|
32
|
+
# Markdown Sample
|
33
|
+
|
34
|
+
----
|
35
|
+
## what is Markdown?
|
36
|
+
see [Wikipedia](http://en.wikipedia.org/wiki/Markdown)
|
37
|
+
|
38
|
+
> Markdown is a lightweight markup language, originally created by John Gruber and Aaron Swartz allowing people "to write using an easy-to-read, easy-to-write plain text format, then convert it to structurally valid XHTML (or HTML)".
|
39
|
+
|
40
|
+
----
|
41
|
+
## markdown quick reference
|
42
|
+
# headers
|
43
|
+
|
44
|
+
*emphasis*
|
45
|
+
|
46
|
+
**strong**
|
47
|
+
|
48
|
+
* list
|
49
|
+
|
50
|
+
>block quote
|
51
|
+
|
52
|
+
`code inline`
|
53
|
+
|
54
|
+
```ruby
|
55
|
+
require 'redcarpet'
|
56
|
+
markdown = Redcarpet.new("Hello World!")
|
57
|
+
puts markdown.to_html
|
58
|
+
```
|
59
|
+
[links](http://wikipedia.org)
|
60
|
+
|
61
|
+
----
|
62
|
+
## changelog
|
63
|
+
* 17-Feb-2013 re-design
|
64
|
+
|
65
|
+
----
|
66
|
+
## thanks
|
67
|
+
* [markdown-js](https://github.com/evilstreak/markdown-js)
|
68
|
+
|
69
|
+
HEREDOC
|
70
|
+
|
71
|
+
|
72
|
+
end
|
73
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
Voom::Presenters.define('top_nav') do
|
2
|
+
page do
|
3
|
+
title 'Presenters Demo'
|
4
|
+
end
|
5
|
+
|
6
|
+
header 'Presenters Demo' do
|
7
|
+
menu do
|
8
|
+
item 'About' do
|
9
|
+
event :click do
|
10
|
+
loads :index
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
item 'Components' do
|
15
|
+
event :click do
|
16
|
+
loads :components
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
item 'Styles' do
|
21
|
+
event :click do
|
22
|
+
loads :styles
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
item 'Events' do
|
27
|
+
event :click do
|
28
|
+
loads :events
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
item 'Status' do
|
33
|
+
event :click do
|
34
|
+
loads :component_status
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
|
@@ -0,0 +1,20 @@
|
|
1
|
+
Voom::Presenters.define(:code) do
|
2
|
+
if context[:file]
|
3
|
+
grid do
|
4
|
+
column 12 do
|
5
|
+
body ''
|
6
|
+
expansion_panel 'Show Source' do
|
7
|
+
content do
|
8
|
+
form do
|
9
|
+
source = File.read(context[:file])
|
10
|
+
text_area full_width: true, rows: source.split("\n").size do
|
11
|
+
value source
|
12
|
+
label 'Source'
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
Voom::Presenters.define(:context_list) do
|
2
|
+
helpers do
|
3
|
+
def title
|
4
|
+
context.fetch(:title) {'Context'}
|
5
|
+
end
|
6
|
+
|
7
|
+
def time
|
8
|
+
Time.now unless context.fetch('testing') {false}
|
9
|
+
end
|
10
|
+
|
11
|
+
def scrubbed_context
|
12
|
+
scrubbed_keys = context.fetch(:exclude) {%w{title file testing}}
|
13
|
+
context.select {|k, _| !scrubbed_keys.include?(k.to_s)}
|
14
|
+
end
|
15
|
+
end
|
16
|
+
content id: :context_list do
|
17
|
+
grid do
|
18
|
+
column 12 do
|
19
|
+
display title
|
20
|
+
subheading "#{time}"
|
21
|
+
list do
|
22
|
+
scrubbed_context.map {|k, v| "#{k}: #{v}"}.each do |param|
|
23
|
+
line param
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
Voom::Presenters.define(:debug) do
|
2
|
+
if context[:debug]
|
3
|
+
grid do
|
4
|
+
column 1
|
5
|
+
column 11 do
|
6
|
+
headline 'Debug Info'
|
7
|
+
title 'Context:'
|
8
|
+
form do
|
9
|
+
text_area full_width: true, rows: context.size do
|
10
|
+
value context.inspect
|
11
|
+
label 'Context'
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
data/app/demo/styles.pom
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
require_relative 'helpers/indented_grid'
|
2
|
+
|
3
|
+
Voom::Presenters.define(:styles) do
|
4
|
+
helpers Demo::Helpers::IndentedGrid
|
5
|
+
attach :top_nav
|
6
|
+
|
7
|
+
indented_grid do
|
8
|
+
display 'Styles'
|
9
|
+
|
10
|
+
# heading is an alias for display
|
11
|
+
heading 'Typography', level: 4
|
12
|
+
display 'Display 4', level: 4
|
13
|
+
display 'Display 3', level: 3
|
14
|
+
display 'Display 2', level: 2
|
15
|
+
display 'Display 1', level: 1
|
16
|
+
headline 'Headline'
|
17
|
+
title 'Title'
|
18
|
+
subheading 'Subheading 2', level: 2
|
19
|
+
subheading 'Subheading 1', level: 1
|
20
|
+
body ['Body 1 paragraph. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut',
|
21
|
+
'labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut',
|
22
|
+
'aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat',
|
23
|
+
'nulla pariatur.'], level: 1
|
24
|
+
body 'Body 2 text, calling something out.', level: 2
|
25
|
+
end
|
26
|
+
end
|
data/bin/console
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'bundler/setup'
|
4
|
+
ENV['VOOM_ROOT'] = File.expand_path(__dir__)
|
5
|
+
libdir = File.join(ENV['VOOM_ROOT'], 'lib')
|
6
|
+
$:.unshift(libdir) unless $:.include?(libdir)
|
7
|
+
require 'voom-presenters'
|
8
|
+
|
9
|
+
Voom::Presenters::Settings.configure do |config|
|
10
|
+
config.presenters.root = File.join(ENV['VOOM_ROOT'], 'app')
|
11
|
+
end
|
12
|
+
Voom::Presenters::App.boot!
|
13
|
+
|
14
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
15
|
+
# with your gem easier. You can also use a different console, if you like.
|
16
|
+
|
17
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
18
|
+
# require "pry"
|
19
|
+
# Pry.start
|
20
|
+
|
21
|
+
require 'irb'
|
22
|
+
IRB.start
|
data/bin/setup
ADDED
@@ -0,0 +1,219 @@
|
|
1
|
+
---
|
2
|
+
-
|
3
|
+
Components: Bottom navigation
|
4
|
+
Implementation: N
|
5
|
+
MDL: N
|
6
|
+
MDC: N
|
7
|
+
Priority: low
|
8
|
+
Completeness:
|
9
|
+
Notes:
|
10
|
+
-
|
11
|
+
Components: Bottom sheets
|
12
|
+
Implementation: N
|
13
|
+
MDL: N
|
14
|
+
MDC: N
|
15
|
+
Priority: not planned
|
16
|
+
Completeness:
|
17
|
+
Notes:
|
18
|
+
-
|
19
|
+
Components: Buttons
|
20
|
+
Implementation: MDC
|
21
|
+
MDL:
|
22
|
+
MDC:
|
23
|
+
Priority:
|
24
|
+
Completeness: 3
|
25
|
+
Notes:
|
26
|
+
-
|
27
|
+
Components: "Buttons: Floating Action Button"
|
28
|
+
Implementation: MDC
|
29
|
+
MDL:
|
30
|
+
MDC:
|
31
|
+
Priority:
|
32
|
+
Completeness: 3
|
33
|
+
Notes:
|
34
|
+
-
|
35
|
+
Components: Cards
|
36
|
+
Implementation: MDL
|
37
|
+
MDL:
|
38
|
+
MDC: Y
|
39
|
+
Priority:
|
40
|
+
Completeness: 2
|
41
|
+
Notes:
|
42
|
+
-
|
43
|
+
Components: Chips
|
44
|
+
Implementation: MDC
|
45
|
+
MDL:
|
46
|
+
MDC:
|
47
|
+
Priority:
|
48
|
+
Completeness: 2
|
49
|
+
Notes:
|
50
|
+
-
|
51
|
+
Components: Data tables
|
52
|
+
Implementation: MDL
|
53
|
+
MDL:
|
54
|
+
MDC: N
|
55
|
+
Priority:
|
56
|
+
Completeness: 2
|
57
|
+
Notes:
|
58
|
+
-
|
59
|
+
Components: Dialogs
|
60
|
+
Implementation: MDL
|
61
|
+
MDL:
|
62
|
+
MDC: Y
|
63
|
+
Priority:
|
64
|
+
Completeness: 3
|
65
|
+
Notes:
|
66
|
+
-
|
67
|
+
Components: Dividers
|
68
|
+
Implementation: N
|
69
|
+
MDL: N
|
70
|
+
MDC: N
|
71
|
+
Priority: not planned
|
72
|
+
Completeness:
|
73
|
+
Notes:
|
74
|
+
-
|
75
|
+
Components: Expansion panels
|
76
|
+
Implementation: Y
|
77
|
+
MDL: N
|
78
|
+
MDC: N
|
79
|
+
Priority:
|
80
|
+
Completeness: 2
|
81
|
+
Notes: Custom
|
82
|
+
-
|
83
|
+
Components: Grid lists
|
84
|
+
Implementation: N
|
85
|
+
MDL:
|
86
|
+
MDC: Y
|
87
|
+
Priority: not planned
|
88
|
+
Completeness:
|
89
|
+
Notes:
|
90
|
+
-
|
91
|
+
Components: Lists
|
92
|
+
Implementation: MDC
|
93
|
+
MDL:
|
94
|
+
MDC:
|
95
|
+
Priority:
|
96
|
+
Completeness: 2
|
97
|
+
Notes:
|
98
|
+
-
|
99
|
+
Components: "Lists: Controls"
|
100
|
+
Implementation: MDL/MDC
|
101
|
+
MDL:
|
102
|
+
MDC:
|
103
|
+
Priority:
|
104
|
+
Completeness: 1
|
105
|
+
Notes: Missing Leave-behinds, MDL controls don't update on replace.
|
106
|
+
-
|
107
|
+
Components: Menus
|
108
|
+
Implementation: MDC/MDL
|
109
|
+
MDL:
|
110
|
+
MDC:
|
111
|
+
Priority:
|
112
|
+
Completeness: 2
|
113
|
+
Notes:
|
114
|
+
-
|
115
|
+
Components: Pickers
|
116
|
+
Implementation: N
|
117
|
+
MDL: N
|
118
|
+
MDC: N
|
119
|
+
Priority: medium
|
120
|
+
Completeness:
|
121
|
+
Notes: Need date/time selection
|
122
|
+
-
|
123
|
+
Components: Progress & activity
|
124
|
+
Implementation: N
|
125
|
+
MDL:
|
126
|
+
MDC: Y
|
127
|
+
Priority: medium
|
128
|
+
Completeness:
|
129
|
+
Notes:
|
130
|
+
-
|
131
|
+
Components: Selection controls/switches
|
132
|
+
Implementation: MDL/MDC
|
133
|
+
MDL:
|
134
|
+
MDC: Y
|
135
|
+
Priority:
|
136
|
+
Completeness: 1
|
137
|
+
Notes: The checkboxes and radio buttons from MDL need to be ported.
|
138
|
+
-
|
139
|
+
Components: Select fields
|
140
|
+
Implementation: MDC
|
141
|
+
MDL:
|
142
|
+
MDC:
|
143
|
+
Priority:
|
144
|
+
Completeness: 2
|
145
|
+
Notes:
|
146
|
+
-
|
147
|
+
Components: Sliders
|
148
|
+
Implementation: N
|
149
|
+
MDL:
|
150
|
+
MDC: Y
|
151
|
+
Priority: medium
|
152
|
+
Completeness:
|
153
|
+
Notes:
|
154
|
+
-
|
155
|
+
Components: Snackbars & toasts
|
156
|
+
Implementation: MDL
|
157
|
+
MDL:
|
158
|
+
MDC: Y
|
159
|
+
Priority:
|
160
|
+
Completeness: 2
|
161
|
+
Notes:
|
162
|
+
-
|
163
|
+
Components: Steppers
|
164
|
+
Implementation: N
|
165
|
+
MDL: N
|
166
|
+
MDC: N
|
167
|
+
Priority: medium
|
168
|
+
Completeness:
|
169
|
+
Notes:
|
170
|
+
-
|
171
|
+
Components: Subheaders
|
172
|
+
Implementation: NA
|
173
|
+
MDL:
|
174
|
+
MDC:
|
175
|
+
Priority: not planned
|
176
|
+
Completeness:
|
177
|
+
Notes: This should be doable using typography
|
178
|
+
-
|
179
|
+
Components: Tabs
|
180
|
+
Implementation: N
|
181
|
+
MDL:
|
182
|
+
MDC: Y
|
183
|
+
Priority: medium
|
184
|
+
Completeness:
|
185
|
+
Notes:
|
186
|
+
-
|
187
|
+
Components: Text fields
|
188
|
+
Implementation: MDC
|
189
|
+
MDL:
|
190
|
+
MDC:
|
191
|
+
Priority: high
|
192
|
+
Completeness: 2
|
193
|
+
Notes:
|
194
|
+
-
|
195
|
+
Components: Toolbars
|
196
|
+
Implementation: MDL
|
197
|
+
MDL:
|
198
|
+
MDC: Y
|
199
|
+
Priority:
|
200
|
+
Completeness: 2
|
201
|
+
Notes:
|
202
|
+
-
|
203
|
+
Components: Tooltips
|
204
|
+
Implementation: MDL
|
205
|
+
MDL:
|
206
|
+
MDC:
|
207
|
+
Priority:
|
208
|
+
Completeness: 1
|
209
|
+
Notes: |
|
210
|
+
The list icons are not displaying tooltips.
|
211
|
+
**Help wanted**
|
212
|
+
-
|
213
|
+
Components: Widgets
|
214
|
+
Implementation: N
|
215
|
+
MDL: N
|
216
|
+
MDC: N
|
217
|
+
Priority: not planned
|
218
|
+
Completeness:
|
219
|
+
Notes:
|