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
@@ -0,0 +1,50 @@
|
|
1
|
+
characters: [ "Richard Hendricks", "Erlich Bachman", "Nelson \"Big Head\" Bighetti", "Bertram Gilfoyle", "Dinesh Chugtai", "Monica Hall", "Donald \"Jared\" Dunn", "Gavin Belson", "Jian Yang", "Laurie Bream", "Russ Hanneman", "Jack \"Action Jack\" Barker", "Keenan Feldspar", "Ed Chen", "Peter Gregory", "Ron LaFlamme" ]
|
2
|
+
companies: [ "Pied Piper", "Hooli", "Raviga Capital Management", "Endframe", "Bachmanity", "Maleant Data Systems Solutions", "Aviato", "Coleman-Blair", "Raviga", "Yoyodyne", "Intersite", "Infotrode", "Bream-Hall", "SeeFood Technologies Inc", "Retinabyte", "VidClone Graphics", "Entercross Systems", "Turnwire" ]
|
3
|
+
quotes: [
|
4
|
+
"I don't want to live in a world where someone else is making the world a better place better than we are.",
|
5
|
+
"I firmly believe we can only achieve greatness if first, we achieve goodness",
|
6
|
+
"Line ’em up, nuts to butts",
|
7
|
+
"Let me ask you. How fast do you think you could jerk off every guy in this room? Because I know how long it would take me. And I can prove it",
|
8
|
+
"It's weird. They always travel in groups of five. These programmers, there's always a tall, skinny white guy; short, skinny Asian guy; fat guy with a ponytail; some guy with crazy facial hair; and then an East Indian guy. It's like they trade guys until they all have the right group.",
|
9
|
+
"Jian-Yang, what're you doing? This is Palo Alto. People are lunatics about smoking here. We don't enjoy all the freedoms that you have in China.",
|
10
|
+
"Well, you just brought piss to a shit fight, you little cunt!",
|
11
|
+
"Hitler actually played the bassoon. So technically Hitler was the Hitler of music.",
|
12
|
+
"I simply imagine that my skeleton is me and my body is my house. That way I'm always home.",
|
13
|
+
"Gavin Belson started out with lofty goals too, but he just kept excusing immoral behavior just like this, until one day all that was left was a sad man with funny shoes... Disgraced, friendless, and engorged with the blood of a youthful charlatan.",
|
14
|
+
"And that, gentlemen, is scrum. Welcome to the next eight weeks of our lives.",
|
15
|
+
"Of course they know that you're not pitching Shazam. That already exists. This would be a Shazam... for food.",
|
16
|
+
"Compromise is the shared hypotenuse of the conjoined triangles of success.",
|
17
|
+
"Gentlemen, I just paid the palapa contractor. The palapa piper, so to speak. The dream is a reality. We'll no longer be exposed... to the elements.",
|
18
|
+
"I was gonna sleep last night, but, uh... I thought I had this solve for this computational trust issue I've been working on, but it turns out, I didn't have a solve. But it was too late. I had already drank the whole pot of coffee.",
|
19
|
+
"I extended my compression algorithm to support... get this... 12-bit color. Okay, so our users will be able to experience a 10 percent increase in image quality with absolutely no increase in server load whatsoever. Just-Just-Just... Just watch this. Before. After. Before. After.",
|
20
|
+
"You listen to me, you muscle-bound handsome Adonis: tech is reserved for people like me, okay? The freaks, the weirdos, the misfits, the geeks, the dweebs, the dorks! Not you!"
|
21
|
+
]
|
22
|
+
apps: [ "Nip Alert", "Astraphile", "Panic-a-Tech", "Spinder", "Nucleus", "Pegg'd", "Clinkle", "Tables", "HooliChat", "PiperChat", "Not Hotdog", "PeaceFare", "CodeRag" ]
|
23
|
+
inventions: [ "Telehuman", "Liquid Shrimp", "Bit Soup", "Audacious", "Tres Comas Tequila", "Pipey", "Always Blue", "Cold Duck", "Skycrane", "Octopus Recipes", "Limp Biscuit", "Hooli Box", "Box Two", "Table", "Anton", "BamBot", "Human Heater" ]
|
24
|
+
mottos: [
|
25
|
+
"Cloud-based, disruptive systems",
|
26
|
+
"Creating unique cross-platform technologies",
|
27
|
+
"Making the world a better place",
|
28
|
+
"Awesome world-changing compression company",
|
29
|
+
"So maybe the reason we share so much is because we understand that without sharing, we can't survive. And sharing is tables.",
|
30
|
+
"Forced adoption through aggressive guerrilla marketing",
|
31
|
+
"Powered by the spirit of exploration and the thrill of the pursuit of the unimaginable",
|
32
|
+
"We not only think outside of the box, we think outside of the box that box is in - and so on - until innovation is free of all boxes that would contain and constrain it",
|
33
|
+
"Our products are products, producing unrivaled results",
|
34
|
+
"Oh, danger will most certainly be proceeded in the face of. Right in its face. Right in it.",
|
35
|
+
"Isn't it time someone put the venture back into venture capital?",
|
36
|
+
"Are bandwidth costs harshing on your vibe?",
|
37
|
+
"The drink that doesn't give a fuck!"
|
38
|
+
]
|
39
|
+
urls: [
|
40
|
+
"http://raviga.com",
|
41
|
+
"http://breamhall.com",
|
42
|
+
"http://piedpiper.com",
|
43
|
+
"http://hooli.com",
|
44
|
+
"http://bachmanity.com",
|
45
|
+
"http://aviato.com",
|
46
|
+
"http://coderag.com",
|
47
|
+
"http://endframesystems.com",
|
48
|
+
"http://drinkhomicide.com"
|
49
|
+
]
|
50
|
+
email: ['richard@piedpiper.test', 'bertram@piedpiper.test', 'dinesh@piedpiper.test', 'jared@piedpiper.test', 'bighead@nipplealert.test', 'erlich@bachmanity.test', 'monica@raviga.test', 'laurie@raviga.test', 'gavin@hooli.test', 'russ@threecommaclub.test', 'denpok@hooli.test']
|
@@ -0,0 +1,29 @@
|
|
1
|
+
require 'sinatra/base'
|
2
|
+
|
3
|
+
module Voom
|
4
|
+
module Presenters
|
5
|
+
module Demo
|
6
|
+
class Search < Sinatra::Base
|
7
|
+
get('/_search_') do
|
8
|
+
content_type :json
|
9
|
+
JSON.dump(search(params[:search]))
|
10
|
+
end
|
11
|
+
|
12
|
+
def search(term)
|
13
|
+
require 'yaml'
|
14
|
+
return [] unless term
|
15
|
+
@terms ||= YAML::load_file(File.join(__dir__, './search-terms.yml'))
|
16
|
+
@terms.keys.reduce([]) do |matches, topic|
|
17
|
+
@terms[topic].reduce(matches) do |matches, item|
|
18
|
+
matches << [item, matches.length] if item.downcase.include?(term.downcase)
|
19
|
+
matches
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
# start the server if ruby file executed directly
|
25
|
+
run! if app_file == $0
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,60 @@
|
|
1
|
+
require 'voom/trace'
|
2
|
+
|
3
|
+
module Voom
|
4
|
+
module Presenters
|
5
|
+
def self.define(name, &block)
|
6
|
+
DSL.define(name, &block)
|
7
|
+
end
|
8
|
+
|
9
|
+
module DSL
|
10
|
+
class << self
|
11
|
+
include Voom::Trace
|
12
|
+
end
|
13
|
+
|
14
|
+
@registry = {}
|
15
|
+
|
16
|
+
def self.registry
|
17
|
+
@registry
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.define(name, &block)
|
21
|
+
registry[name] = Voom::Presenters::DSL::Definition.new(&block)
|
22
|
+
end
|
23
|
+
|
24
|
+
def self.load(directory)
|
25
|
+
files = File.join(directory, '**', '*.pom')
|
26
|
+
Dir.glob(files) do |file|
|
27
|
+
Kernel.load file
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
def self.finalize
|
32
|
+
registry.each do |key, definition|
|
33
|
+
begin
|
34
|
+
register(key, build(definition))
|
35
|
+
rescue Exception => e
|
36
|
+
logger.error {"Failed to load presenter #{key}: #{e.inspect}."}
|
37
|
+
raise e
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
# This method empties out the dsl definitions
|
43
|
+
# It should ONLY be used for testing purposes
|
44
|
+
def self.reset!
|
45
|
+
registry.clear
|
46
|
+
end
|
47
|
+
|
48
|
+
private
|
49
|
+
|
50
|
+
def self.register(name, definition)
|
51
|
+
return Voom::Presenters::App.register(name: name, presenter: definition) unless Voom::Presenters::App.registered?(name)
|
52
|
+
logger.warn {"Warning attempted to redefine the presenter: #{name}!"}
|
53
|
+
end
|
54
|
+
|
55
|
+
def self.build(definition)
|
56
|
+
definition.build
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
require_relative 'base'
|
2
|
+
|
3
|
+
module Voom
|
4
|
+
module Presenters
|
5
|
+
module DSL
|
6
|
+
module Components
|
7
|
+
class Action < Base
|
8
|
+
# Options are used by the actions
|
9
|
+
# Params are passed by the user
|
10
|
+
attr_reader :params, :options
|
11
|
+
|
12
|
+
def initialize(type:, **attribs_, &block)
|
13
|
+
super(type: type, **attribs_, &block)
|
14
|
+
@options = {}
|
15
|
+
extract_options!
|
16
|
+
@params = attribs.delete(:params) {{}}
|
17
|
+
@url = nil
|
18
|
+
end
|
19
|
+
|
20
|
+
def url
|
21
|
+
@parent.router.url(render: options[:presenter], command: options[:path], context: params)
|
22
|
+
end
|
23
|
+
|
24
|
+
private
|
25
|
+
def extract_options!
|
26
|
+
%i(path presenter target).each do |option|
|
27
|
+
optionValue = attribs.delete(option)
|
28
|
+
@options.merge!({option => optionValue}) if optionValue
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require_relative 'event_base'
|
2
|
+
require_relative 'mixins/event'
|
3
|
+
require_relative 'mixins/tooltips'
|
4
|
+
|
5
|
+
module Voom
|
6
|
+
module Presenters
|
7
|
+
module DSL
|
8
|
+
module Components
|
9
|
+
class Avatar < EventBase
|
10
|
+
include Mixins::Tooltips
|
11
|
+
|
12
|
+
attr_accessor :avatar, :color, :size, :position
|
13
|
+
|
14
|
+
def initialize(**attribs_, &block)
|
15
|
+
super(type: :avatar, context: context,
|
16
|
+
**attribs_, &block)
|
17
|
+
@avatar = attribs.delete(:avatar)
|
18
|
+
@color = attribs.delete(:color)
|
19
|
+
@size = attribs.delete(:size)
|
20
|
+
@position = Array(attribs.delete(:position)).compact
|
21
|
+
expand!
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require_relative 'mixins/event'
|
2
|
+
|
3
|
+
module Voom
|
4
|
+
module Presenters
|
5
|
+
module DSL
|
6
|
+
module Components
|
7
|
+
class Badge < EventBase
|
8
|
+
attr_accessor :badge, :icon, :text
|
9
|
+
|
10
|
+
def initialize(**attribs_, &block)
|
11
|
+
super(type: :badge, **attribs_, &block)
|
12
|
+
@badge = attribs.delete(:badge)
|
13
|
+
@icon = attribs.delete(:icon)
|
14
|
+
@text = attribs.delete(:text)
|
15
|
+
expand!
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,78 @@
|
|
1
|
+
require_relative '../lockable'
|
2
|
+
require_relative '../../../serializer'
|
3
|
+
require_relative '../../../trace'
|
4
|
+
|
5
|
+
require 'securerandom'
|
6
|
+
|
7
|
+
module Voom
|
8
|
+
module Presenters
|
9
|
+
module DSL
|
10
|
+
module Components
|
11
|
+
# Every object in the POM is a node
|
12
|
+
# This class provides common base implementation
|
13
|
+
class Base
|
14
|
+
include Lockable
|
15
|
+
|
16
|
+
include Voom::Serializer
|
17
|
+
include LoggerMethods
|
18
|
+
include Trace
|
19
|
+
|
20
|
+
attr_reader :type, :id, :attributes, :context
|
21
|
+
|
22
|
+
alias params context
|
23
|
+
alias attribs attributes
|
24
|
+
|
25
|
+
def initialize(type:, parent:, id: nil, context: {}, **attributes, &block)
|
26
|
+
@id = h(id) || generate_id
|
27
|
+
@type = h(type)
|
28
|
+
@parent = parent
|
29
|
+
@context = context
|
30
|
+
@attributes = escape(attributes)
|
31
|
+
@block = block
|
32
|
+
end
|
33
|
+
|
34
|
+
def expand!
|
35
|
+
extend(_helpers_) if _helpers_
|
36
|
+
instance_eval(&@block) if @block
|
37
|
+
end
|
38
|
+
|
39
|
+
private
|
40
|
+
|
41
|
+
def h(text)
|
42
|
+
return text unless text.is_a? String
|
43
|
+
CGI::escapeHTML(text)
|
44
|
+
end
|
45
|
+
|
46
|
+
def escape(attributes)
|
47
|
+
attributes.map {|k, v| [k, h(v)]}.to_h
|
48
|
+
end
|
49
|
+
|
50
|
+
def generate_id
|
51
|
+
Voom::Presenters::Settings.config.presenters.id_generator.call(self)
|
52
|
+
end
|
53
|
+
|
54
|
+
protected
|
55
|
+
|
56
|
+
def parent(for_type)
|
57
|
+
return @parent if @parent.type == for_type
|
58
|
+
@parent.send(:parent, for_type)
|
59
|
+
end
|
60
|
+
|
61
|
+
def router
|
62
|
+
@parent.send(:router)
|
63
|
+
end
|
64
|
+
|
65
|
+
def yield_block
|
66
|
+
return @_yield_block_ if @_yield_block_
|
67
|
+
@parent.send(:yield_block)
|
68
|
+
end
|
69
|
+
|
70
|
+
def _helpers_
|
71
|
+
@parent.send(:_helpers_) if @parent
|
72
|
+
end
|
73
|
+
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
require_relative 'mixins/common'
|
2
|
+
require_relative 'mixins/event'
|
3
|
+
require_relative 'mixins/tooltips'
|
4
|
+
|
5
|
+
module Voom
|
6
|
+
module Presenters
|
7
|
+
module DSL
|
8
|
+
module Components
|
9
|
+
class Button < EventBase
|
10
|
+
include Mixins::Tooltips
|
11
|
+
BUTTON_TYPES = %i(raised flat fab icon)
|
12
|
+
|
13
|
+
attr_accessor :text, :icon, :button_type, :color, :disabled, :size, :position
|
14
|
+
|
15
|
+
def initialize(type: nil, **attribs_, &block)
|
16
|
+
@button_type = h(type) || ((attribs_[:icon]&&!attribs_[:text]) ? :icon : nil) || :flat
|
17
|
+
super(type: :button, **attribs_, &block)
|
18
|
+
self.icon(attribs.delete(:icon)) if attribs.key?(:icon)
|
19
|
+
@text = attribs.delete(:text)
|
20
|
+
@color = attribs.delete(:color)
|
21
|
+
@disabled = attribs.delete(:disabled) || false
|
22
|
+
@size = attribs.delete(:size)
|
23
|
+
@position = Array(attribs.delete(:position)).compact
|
24
|
+
expand!
|
25
|
+
@event_parent_id = self.parent(:form)&.id || id
|
26
|
+
end
|
27
|
+
|
28
|
+
def icon(icon=nil, **attribs, &block)
|
29
|
+
return @icon if locked?
|
30
|
+
@icon = Components::Icon.new(parent: self, icon: icon,
|
31
|
+
context: context,
|
32
|
+
**attribs, &block)
|
33
|
+
|
34
|
+
end
|
35
|
+
|
36
|
+
def menu(**attributes, &block)
|
37
|
+
return @menu if locked?
|
38
|
+
@menu = Components::Menu.new(parent: self, position: menu_position, context: context, **attributes, &block)
|
39
|
+
end
|
40
|
+
|
41
|
+
private
|
42
|
+
def menu_position
|
43
|
+
position.include?(:right) ? :right : nil
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,119 @@
|
|
1
|
+
require_relative 'menu'
|
2
|
+
require_relative 'typography'
|
3
|
+
require_relative 'mixins/common'
|
4
|
+
require_relative 'mixins/event'
|
5
|
+
require_relative 'mixins/attaches'
|
6
|
+
require_relative 'mixins/avatar'
|
7
|
+
require_relative 'mixins/text_fields'
|
8
|
+
require_relative 'mixins/icons'
|
9
|
+
require_relative 'mixins/snackbars'
|
10
|
+
|
11
|
+
module Voom
|
12
|
+
module Presenters
|
13
|
+
module DSL
|
14
|
+
module Components
|
15
|
+
class Card < EventBase
|
16
|
+
include Mixins::Common
|
17
|
+
include Mixins::Attaches
|
18
|
+
include Mixins::TextFields
|
19
|
+
include Mixins::Icons
|
20
|
+
include Mixins::Snackbars
|
21
|
+
|
22
|
+
attr_reader :height, :width, :selected, :components, :shows_errors
|
23
|
+
|
24
|
+
|
25
|
+
def initialize(**attribs_, &block)
|
26
|
+
super(type: :card, **attribs_, &block)
|
27
|
+
@height = attribs.delete(:height)
|
28
|
+
@width = attribs.delete(:width)
|
29
|
+
@selected = attribs.delete(:selected) {false}
|
30
|
+
self.text(attribs.delete(:text)) if attribs.key?(:text)
|
31
|
+
@shows_errors = attribs.delete(:shows_errors){true}
|
32
|
+
|
33
|
+
@components = []
|
34
|
+
expand!
|
35
|
+
end
|
36
|
+
|
37
|
+
def media(**attribs, &block)
|
38
|
+
return @media if locked?
|
39
|
+
@media = Media.new(parent: self,
|
40
|
+
context: context,
|
41
|
+
**attribs, &block)
|
42
|
+
end
|
43
|
+
|
44
|
+
# def overflow_menu(**attribs, &block)
|
45
|
+
# return @overflow_menu if locked?
|
46
|
+
# icon = attribs.delete(:icon){:more_vert}
|
47
|
+
# position = attribs.delete(:position){ [:top, :right]}
|
48
|
+
# @overflow_menu = Components::Button.new(parent: self,
|
49
|
+
# icon: icon,
|
50
|
+
# position: position,
|
51
|
+
# context: context,
|
52
|
+
# **attribs, &block)
|
53
|
+
# end
|
54
|
+
|
55
|
+
class Media < Base
|
56
|
+
include Mixins::Avatar
|
57
|
+
attr_reader :height, :width, :color
|
58
|
+
|
59
|
+
def initialize(**attribs_, &block)
|
60
|
+
super(type: :media, **attribs_, &block)
|
61
|
+
@height = attribs.delete(:height)
|
62
|
+
@width = attribs.delete(:width)
|
63
|
+
@color = attribs.delete(:color)
|
64
|
+
|
65
|
+
expand!
|
66
|
+
end
|
67
|
+
|
68
|
+
def title(*title, **attribs, &block)
|
69
|
+
return @title if locked?
|
70
|
+
@title = Typography.new(type: :title,
|
71
|
+
parent: self,
|
72
|
+
text: title,
|
73
|
+
context: context,
|
74
|
+
**attribs, &block)
|
75
|
+
end
|
76
|
+
|
77
|
+
def image(image=nil, **attribs, &block)
|
78
|
+
return @image if locked?
|
79
|
+
@image = Image.new(parent: self, image: image, context: context, **attribs, &block)
|
80
|
+
end
|
81
|
+
|
82
|
+
def button(icon=nil, **attributes, &block)
|
83
|
+
return @button if locked?
|
84
|
+
@button = Components::Button.new(icon: icon, position:[:top, :right], parent: self, context: context, **attributes, &block)
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
def text(*text, **attribs, &block)
|
89
|
+
self << Typography.new(type: :body,
|
90
|
+
parent: self, text: text, context: context, **attribs, &block)
|
91
|
+
end
|
92
|
+
|
93
|
+
def actions(**attribs, &block)
|
94
|
+
return @actions if locked?
|
95
|
+
@actions = Actions.new(parent: self,
|
96
|
+
context: context,
|
97
|
+
**attribs, &block)
|
98
|
+
end
|
99
|
+
|
100
|
+
class Actions < Base
|
101
|
+
attr_accessor :buttons
|
102
|
+
|
103
|
+
def initialize(**attribs_, &block)
|
104
|
+
super(type: :action, **attribs_, &block)
|
105
|
+
@buttons = []
|
106
|
+
expand!
|
107
|
+
end
|
108
|
+
|
109
|
+
def button(text=nil, **options, &block)
|
110
|
+
@buttons << Components::Button.new(parent: self, text: text,
|
111
|
+
context: context,
|
112
|
+
**options, &block)
|
113
|
+
end
|
114
|
+
end
|
115
|
+
end
|
116
|
+
end
|
117
|
+
end
|
118
|
+
end
|
119
|
+
end
|