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,20 @@
|
|
1
|
+
<% class_name = '' unless local_variables.include? :class_name
|
2
|
+
position_classes = comp.position.map {|p| "v-button-position-#{p}"}.join(' ')
|
3
|
+
text_align = comp.position.select {|p| eq(p, :left)}.any? && eq(comp.button_type, :flat)%>
|
4
|
+
|
5
|
+
<button
|
6
|
+
id="<%= comp.id %>"
|
7
|
+
class="mdc-button v-js-ripple-button <%=class_name%>
|
8
|
+
<%= 'mdc-button--raised' if eq(comp.button_type, :raised) %>
|
9
|
+
<%= 'v-secondary-filled-button' if eq(comp.button_type, :raised) && eq(comp.color, :secondary) %>
|
10
|
+
<%= 'v-secondary-text-button' if eq(comp.button_type, :flat) && eq(comp.color, :secondary) %>
|
11
|
+
<%= position_classes %>
|
12
|
+
<%= "v-button-text-align-left" if text_align %>
|
13
|
+
<%= 'mdc-menu-anchor v-menu-click' if comp.menu%>"
|
14
|
+
<%= 'disabled' if comp.disabled %>
|
15
|
+
<%= erb :"components/event", :locals => {events: comp.events, parent_id: comp.event_parent_id} unless comp.disabled %>>
|
16
|
+
<%= erb :"components/icon", :locals => {comp: comp.icon, class_name: 'mdc-button__icon'} %>
|
17
|
+
<%= comp.text %>
|
18
|
+
<%= erb :"components/menu", :locals => {comp: comp.menu, parent_id: comp.id} %>
|
19
|
+
</button>
|
20
|
+
<%= erb :"components/tooltip", :locals => {comp: comp.tooltip, parent_id: comp.id} %>
|
@@ -0,0 +1,22 @@
|
|
1
|
+
<% class_name = '' unless local_variables.include? :class_name
|
2
|
+
position_classes = comp.position.map {|p| "v-button-fab-position-#{p}"}.join(' ')
|
3
|
+
%>
|
4
|
+
|
5
|
+
<% if comp.menu %>
|
6
|
+
<div class="mdc-menu-anchor" %>
|
7
|
+
<% end %>
|
8
|
+
<button id="<%= comp.id %>"
|
9
|
+
class="mdc-fab material-icons v-fab--absolute v-js-ripple-button <%= class_name %> <%= position_classes %>
|
10
|
+
<%= 'mdc-fab--mini' if eq(comp.size, :small) %>"
|
11
|
+
aria-label="<%= inflector.humanize(comp.icon.icon) %>"
|
12
|
+
<%= 'disabled' if comp.disabled %>
|
13
|
+
<%= erb :"components/event", :locals => {events: comp.events, parent_id: comp.event_parent_id} unless comp.disabled %>>
|
14
|
+
<span class="mdc-fab__icon">
|
15
|
+
<%= comp.icon.icon %>
|
16
|
+
</span>
|
17
|
+
</button>
|
18
|
+
<%= erb :"components/tooltip", :locals => {comp: comp.tooltip, parent_id: comp.id} %>
|
19
|
+
<%= erb :"components/menu", :locals => {comp: comp.menu, parent_id: comp.id} %>
|
20
|
+
<% if comp.menu %>
|
21
|
+
</div>
|
22
|
+
<% end %>
|
@@ -0,0 +1,24 @@
|
|
1
|
+
<% class_name = '' unless local_variables.include? :class_name
|
2
|
+
position_classes = comp.position.map {|p| "v-button-icon-position-#{p}"}.join(' ')
|
3
|
+
%>
|
4
|
+
|
5
|
+
<% if comp.menu %>
|
6
|
+
<div class="mdc-menu-anchor" %>
|
7
|
+
<% end %>
|
8
|
+
<button id="<%= comp.id %>"
|
9
|
+
class="mdl-button mdl-js-button mdl-button--icon <%=class_name%> <%= position_classes %>
|
10
|
+
<%= 'mdl-button--colored' if eq(comp.color, :primary) %>
|
11
|
+
<%= 'mdl-button--accent' if eq(comp.color, :secondary) %>
|
12
|
+
<%= 'v-menu-click' if comp.menu%>"
|
13
|
+
style = "<%= color_style(comp) %>"
|
14
|
+
<%= 'disabled' if comp.disabled %>
|
15
|
+
<%= erb :'components/event', :locals => {events: comp.events, parent_id: comp.event_parent_id} unless comp.disabled %>>
|
16
|
+
<%= erb :'components/icon', :locals => {comp: comp.icon} %>
|
17
|
+
<%= comp.text %>
|
18
|
+
</button>
|
19
|
+
<%= erb :"components/tooltip", :locals => {comp: comp.tooltip, parent_id: comp.id} %>
|
20
|
+
<%= erb :"components/menu", :locals => {comp: comp.menu, parent_id: comp.id} %>
|
21
|
+
|
22
|
+
<% if comp.menu %>
|
23
|
+
</div>
|
24
|
+
<% end %>
|
@@ -0,0 +1,49 @@
|
|
1
|
+
<div id="<%=comp.id%>"
|
2
|
+
class="card-<%= comp.id %> mdc-card v-card
|
3
|
+
<%= 'v-actionable' if comp.events %>"
|
4
|
+
style="<%= "width: #{comp.width};" if comp.width%>
|
5
|
+
<%= "height: #{comp.height};" if comp.height%>
|
6
|
+
<%= "outline: medium solid rgb(63,81,181);" if comp.selected %>"
|
7
|
+
<%= erb :"components/event", :locals => {events: comp.events, parent_id: comp.event_parent_id} %>
|
8
|
+
>
|
9
|
+
<% if comp.media %>
|
10
|
+
<div class="v-errors">
|
11
|
+
<div class="mdc-card__media v-card-media
|
12
|
+
<%= 'mdc-card__media--square' if false && comp.media.width == comp.media.height %>"
|
13
|
+
style="<%= "width: #{comp.media.width};" if comp.media.width%>
|
14
|
+
<%= "height: #{comp.media.height};" if comp.media.height %>
|
15
|
+
<%= "background-color: #{comp.media.color};" if comp.media.color %>">
|
16
|
+
<%= erb :"components/button", :locals => {:comp => comp.media.button, class_name: "v-card__media-menu"} %>
|
17
|
+
<%= erb :"components/image", :locals => {:comp => comp.media.image, class_name: 'v-card-media-image'} %>
|
18
|
+
<%= erb :"components/avatar", :locals => {:comp => comp.media.avatar, class_name: 'v-card-media-avatar'} %>
|
19
|
+
<%= erb :"components/title", :locals => {:comp => comp.media.title, class_name: "v-card-title"} %>
|
20
|
+
</div>
|
21
|
+
</div>
|
22
|
+
<% end %>
|
23
|
+
<div class="v-errors">
|
24
|
+
<% if comp.components.any? %>
|
25
|
+
<div class="v-card-content">
|
26
|
+
<%= erb :"components/render", :locals => {:components => comp.components, :scope => nil} %>
|
27
|
+
</div>
|
28
|
+
<% end %>
|
29
|
+
|
30
|
+
<% if comp.actions&.buttons
|
31
|
+
action_buttons = comp.actions.buttons.select {|b| !eq(b.button_type, :icon)}
|
32
|
+
action_icons = comp.actions.buttons.select {|b| eq(b.button_type, :icon)}
|
33
|
+
%>
|
34
|
+
<div class="mdc-card__actions">
|
35
|
+
<div class="mdc-card__action-buttons">
|
36
|
+
<% action_buttons.each do |button| %>
|
37
|
+
<%= erb :"components/button", :locals => {:comp => button, class_name: 'mdc-card__action mdc-card__action--button'} %>
|
38
|
+
<% end %>
|
39
|
+
</div>
|
40
|
+
<div class="mdc-card__action-icons">
|
41
|
+
<% action_icons.each do |button| %>
|
42
|
+
<%= erb :"components/button", :locals => {:comp => button, class_name: 'mdc-card__action mdc-card__action--icon'} %>
|
43
|
+
<% end %>
|
44
|
+
</div>
|
45
|
+
</div>
|
46
|
+
<% end %>
|
47
|
+
</div>
|
48
|
+
</div>
|
49
|
+
|
@@ -0,0 +1,22 @@
|
|
1
|
+
<div class="mdc-checkbox">
|
2
|
+
<input type="checkbox"
|
3
|
+
id="<%=comp.id%>"
|
4
|
+
name="<%=comp.name%>"
|
5
|
+
value="<%=comp.value%>"
|
6
|
+
class="mdc-checkbox__native-control"
|
7
|
+
<% if comp.checked %> checked <% end %><% if comp.disabled %> disabled <% end %>
|
8
|
+
<%= erb :"components/event", :locals => {events: comp.events, parent_id: comp.event_parent_id} %>
|
9
|
+
/>
|
10
|
+
<div class="mdc-checkbox__background">
|
11
|
+
<svg class="mdc-checkbox__checkmark"
|
12
|
+
viewBox="0 0 24 24">
|
13
|
+
<path class="mdc-checkbox__checkmark-path"
|
14
|
+
fill="none"
|
15
|
+
stroke="white"
|
16
|
+
d="M1.73,12.91 8.1,19.28 22.79,4.59"/>
|
17
|
+
</svg>
|
18
|
+
<div class="mdc-checkbox__mixedmark"></div>
|
19
|
+
</div>
|
20
|
+
</div>
|
21
|
+
<label class="v-checkbox__label" id="<%=comp.id%>" for="<%=comp.id%>"><%=comp.text%></label>
|
22
|
+
<%= erb :"components/tooltip", :locals => {comp: comp.tooltip, parent_id: comp.id }%>
|
@@ -0,0 +1,31 @@
|
|
1
|
+
<% if comp
|
2
|
+
leading_icon = comp.icons.select {|i| i.position.select{|p| eq(p, :left)}.any?}.first
|
3
|
+
trailing_icon = comp.icons.select {|i| i.position.select{|p| eq(p, :right)}.any?}.first
|
4
|
+
first_chip = !eq(components[index-1]&.type, :chip)
|
5
|
+
last_chip = !eq(components[index+1]&.type, :chip)
|
6
|
+
|
7
|
+
child_events = (leading_icon&.events || trailing_icon&.events || comp.text&.events||[]).any?
|
8
|
+
%>
|
9
|
+
<% if first_chip %>
|
10
|
+
<div class="mdc-chip-set">
|
11
|
+
<% end %>
|
12
|
+
<div id="<%= comp.id %>"
|
13
|
+
class="mdc-chip
|
14
|
+
<%= color_classname(comp) %>"
|
15
|
+
style = "<%= color_style(comp, 'background-') %>"
|
16
|
+
tabindex="0"
|
17
|
+
<%= erb(:"components/event", locals: {events: comp.events,
|
18
|
+
parent_id: comp.id}) unless child_events %>>
|
19
|
+
<%= erb(:"components/icon", :locals => {comp: leading_icon,
|
20
|
+
class_name: 'mdc-chip__icon mdc-chip__icon--leading',
|
21
|
+
events: child_events ? (leading_icon&.events || comp.events) : nil}) %>
|
22
|
+
<%= erb :"components/typography", :locals => {comp: comp.text, type: 'chip-text', class_name: 'mdc-chip__text'} %>
|
23
|
+
<%= erb(:"components/icon", locals: {comp: trailing_icon,
|
24
|
+
class_name: 'mdc-chip__icon mdc-chip__icon--trailing',
|
25
|
+
events: trailing_icon&.events || comp.events }) %>
|
26
|
+
</div>
|
27
|
+
<% if last_chip %>
|
28
|
+
</div>
|
29
|
+
<% end %>
|
30
|
+
<%= erb :"components/tooltip", :locals => {comp: comp.tooltip, parent_id: comp.id} %>
|
31
|
+
<% end %>
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<div id="<%= comp.id %>"
|
2
|
+
class="v-content
|
3
|
+
<%= 'v-hidden' if comp.hidden %>">
|
4
|
+
<% if comp.shows_errors %>
|
5
|
+
<div class="v-errors">
|
6
|
+
<% end %>
|
7
|
+
<%= erb :"components/render", :locals => {:components => comp.components, :scope => nil} %>
|
8
|
+
<% if comp.shows_errors %>
|
9
|
+
</div>
|
10
|
+
<% end %>
|
11
|
+
</div>
|
@@ -0,0 +1,30 @@
|
|
1
|
+
<%
|
2
|
+
time_val = comp.value ? comp.value.strftime("%Y-%m-%dT%H:%M:%S.%L") : nil
|
3
|
+
%>
|
4
|
+
<div id="<%= comp.id %>"
|
5
|
+
class="mdc-text-field
|
6
|
+
<%= 'mdc-text-field--with-trailing-icon' if comp.icon %>
|
7
|
+
<%= 'mdc-text-field--fullwidth' if comp.full_width %>
|
8
|
+
<%= 'is-invalid is-dirty' if comp.error %>">
|
9
|
+
<%= erb :"components/icon", :locals => {comp: comp.icon, class_name: 'mdc-text-field__icon', parent_id: "#{comp.id}-input"} %>
|
10
|
+
<input id="<%= comp.id %>-input"
|
11
|
+
name="<%= comp.name %>"
|
12
|
+
type="datetime-local"
|
13
|
+
value="<%= time_val %>"
|
14
|
+
class="mdc-text-field__input"
|
15
|
+
aria-controls="<%= comp.id %>-input-helper-text"
|
16
|
+
<%= 'required' if comp.required %>
|
17
|
+
<%= 'invalid' if comp.error %>
|
18
|
+
<%= "pattern='#{comp.pattern}'" if comp.pattern %>
|
19
|
+
<%= 'readonly' if comp.readonly %>
|
20
|
+
list="<%= comp.id %>-list"
|
21
|
+
<%= erb :"components/event", :locals => {events: comp.events, parent_id: "#{comp.id}-input"} %>>
|
22
|
+
<label class='mdc-floating-label mdc-floating-label--float-above' for="<%= comp.id %>"><%= comp.label %></label>
|
23
|
+
<div class="mdc-line-ripple"></div>
|
24
|
+
<datalist id="<%= comp.id %>-list">
|
25
|
+
</datalist>
|
26
|
+
|
27
|
+
</div>
|
28
|
+
<p id="<%= comp.id %>-input-helper-text" class="mdc-text-field-helper-text" aria-hidden="true">
|
29
|
+
<%= comp.error || comp.hint %>
|
30
|
+
</p>
|
@@ -0,0 +1,27 @@
|
|
1
|
+
<%
|
2
|
+
has_form = comp.components.select{|c| eq(c.type, :form)}.any?
|
3
|
+
%>
|
4
|
+
<dialog id="<%= comp.id %>"
|
5
|
+
class="mdl-dialog v-js-dialog"
|
6
|
+
style="<%= "width: #{comp.width}" if comp.width %>
|
7
|
+
<%= "height: #{comp.height}" if comp.height %>"
|
8
|
+
>
|
9
|
+
<% if comp.title %>
|
10
|
+
<h3 class="mdl-dialog__title"><%= expand_text(comp.title.text) %></h3>
|
11
|
+
<% end %>
|
12
|
+
<div class="v-errors">
|
13
|
+
<div class="mdl-dialog__content
|
14
|
+
<%= 'v-dialog--form' if has_form %>">
|
15
|
+
<% comp.components.each do |dcomp| %>
|
16
|
+
<%= erb :"components/#{dcomp.type}", :locals => {:comp => dcomp} %>
|
17
|
+
<% end %>
|
18
|
+
</div>
|
19
|
+
<% if comp.buttons.any? %>
|
20
|
+
<div class="mdl-dialog__actions">
|
21
|
+
<% comp.buttons.reverse.each do |button| %>
|
22
|
+
<%= erb :"components/button", :locals => {:comp => button} %>
|
23
|
+
<% end %>
|
24
|
+
</div>
|
25
|
+
<% end %>
|
26
|
+
</div>
|
27
|
+
</dialog>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<% if events
|
2
|
+
data_events = events.map do |event|
|
3
|
+
[event.event,
|
4
|
+
event.actions.map do |action|
|
5
|
+
additional_options = case action.type.to_s
|
6
|
+
when 'replaces' then
|
7
|
+
{grid_nesting:@grid_nesting, __parent_id__: parent_id}
|
8
|
+
when 'update', 'post', 'delete', 'autocomplete' then
|
9
|
+
{__parent_id__: parent_id}
|
10
|
+
else
|
11
|
+
{}
|
12
|
+
end
|
13
|
+
[action.type, action.url, action.options.to_h.merge(additional_options), action.params.to_h]
|
14
|
+
end,
|
15
|
+
{once: false}]
|
16
|
+
end %>
|
17
|
+
data-events = '<%= data_events.to_json %>'
|
18
|
+
<% end %>
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<details id = '<%= comp.id %>' class="v-expansion mdc-elevation--z3">
|
2
|
+
<summary class="v-expansion__summary"><span class="v-expansion__header"><%= expand_text(comp.text&.text) %></span>
|
3
|
+
<span class="v-expansion__secondary-content"><%=expand_text(comp.secondary_text&.text)%></span></summary>
|
4
|
+
<div class="v-expansion__content">
|
5
|
+
<%= erb :"components/render", :locals => {:components => comp.content.components, :scope=> nil} if comp.content %>
|
6
|
+
</div>
|
7
|
+
<!--<div class="v-expansion__actions">-->
|
8
|
+
<!--<button class="mdc-button mdc-button--raised mdc-button--primary v-expansion__action">Save</button>-->
|
9
|
+
<!--<button class="mdc-button v-expansion__action">Cancel</button>-->
|
10
|
+
<!--</div>-->
|
11
|
+
</details>
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<form role="form"
|
2
|
+
id="<%= comp.id %>"
|
3
|
+
class="v-has-errors v-form"
|
4
|
+
style='width: 100%'
|
5
|
+
onsubmit="javascript:void(0);return false;"
|
6
|
+
<%= erb :"components/event", :locals => {events: comp.events, parent_id: comp.id} %>>
|
7
|
+
<div class="v-errors">
|
8
|
+
<%= erb :"components/render", :locals => {:components => comp.components.select {|c| !eq(c.type, :button)}, :scope => nil} %>
|
9
|
+
<div class="mdl-dialog__actions">
|
10
|
+
<% comp.components.select {|c| eq(c.type, :button)}.reverse.each do |button| %>
|
11
|
+
<%= erb :"components/button", :locals => {:comp => button} %>
|
12
|
+
<% end %>
|
13
|
+
</div>
|
14
|
+
</div>
|
15
|
+
</form>
|
@@ -0,0 +1,24 @@
|
|
1
|
+
<% @grid_nesting += 1 %>
|
2
|
+
<div id="<%= comp.id %>"
|
3
|
+
class="mdc-layout-grid
|
4
|
+
<%= 'v-nested_grid' if @grid_nesting>1 && !comp.padded %>"
|
5
|
+
style="<%= "background-color: #{comp.color};" if comp.color %>">
|
6
|
+
<% unless @grid_nesting>1 %>
|
7
|
+
<% end %>
|
8
|
+
|
9
|
+
<div class="mdc-layout-grid__inner">
|
10
|
+
<% comp.columns.each do |col|
|
11
|
+
span = "mdc-layout-grid__cell--span-#{col.size}"
|
12
|
+
%i(desktop tablet phone).each do |device|
|
13
|
+
span << " mdc-layout-grid__cell--span-#{col.send(device)}-#{device}" if col.send(device)
|
14
|
+
end
|
15
|
+
%>
|
16
|
+
<div id="<%= col.id %>" class="mdc-layout-grid__cell <%= span %>"
|
17
|
+
style="<%= "background-color: #{col.color};" if col.color %>">
|
18
|
+
<%= erb :"components/render", :locals => {:components => col.components, :scope => nil} %>
|
19
|
+
</div>
|
20
|
+
<% end %>
|
21
|
+
</div>
|
22
|
+
</div>
|
23
|
+
<% @grid_nesting -= 1
|
24
|
+
%>
|
@@ -0,0 +1 @@
|
|
1
|
+
<input type="hidden" id="<%= comp.id %>" name="<%= comp.name %>" value="<%= comp.value %>"/>
|
@@ -0,0 +1,30 @@
|
|
1
|
+
<% class_name = '' unless local_variables.include? :class_name
|
2
|
+
%>
|
3
|
+
<% if comp
|
4
|
+
parent_id = comp.event_parent_id unless locals.include? :parent_id
|
5
|
+
icon_name = comp.icon unless locals.include? :icon_name
|
6
|
+
events = comp.events unless locals.include? :events
|
7
|
+
position = comp.position||[] unless locals.include? :position
|
8
|
+
position_classes = position.map {|p| "v-icon-position-#{p}"}.join(' ')
|
9
|
+
class_name= "#{class_name} #{position_classes}"
|
10
|
+
if icon_name =~ /^(fa[srlb]\s)*fa-/
|
11
|
+
icon_class_name = "#{icon_name} v-icon__fa"
|
12
|
+
icon_class_name = "fas #{icon_class_name}" unless icon_class_name=~ /^(fas)|(fal)|(fab)/
|
13
|
+
icon = ''
|
14
|
+
else
|
15
|
+
icon_class_name = "material-icons"
|
16
|
+
icon = icon_name
|
17
|
+
end
|
18
|
+
%>
|
19
|
+
<i id="<%= comp.id %>"
|
20
|
+
class="<%= class_name %> <%= icon_class_name %>
|
21
|
+
<%= 'v-actionable' if comp.events %>
|
22
|
+
<%= color_classname(comp) %>"
|
23
|
+
style = "<%= color_style(comp) %>
|
24
|
+
<%= "font-size: #{comp.size}" if comp.size %>"
|
25
|
+
<%= 'tabindex="1"' if class_name.include?('mdc-text-field__icon') && comp.events %>
|
26
|
+
<%= erb :"components/event", :locals => {events: events, parent_id: parent_id} %>>
|
27
|
+
<%= icon %>
|
28
|
+
</i>
|
29
|
+
<%= erb :"components/tooltip", :locals => {comp: comp.tooltip, parent_id: comp.id} %>
|
30
|
+
<% end %>
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<i id="<%= comp.id %>"
|
2
|
+
class="mdc-icon-toggle material-icons
|
3
|
+
<%= 'mdc-icon-toggle--disabled' if comp.disabled %>"
|
4
|
+
role="button"
|
5
|
+
aria-disabled="<%= comp.disabled %>"
|
6
|
+
aria-pressed="<%= comp.checked %>"
|
7
|
+
data-checked="<%= comp.checked %>"
|
8
|
+
aria-label="" tabindex="0"
|
9
|
+
data-name="<%= comp.name %>"
|
10
|
+
data-toggle-on='{"label": "", "content": "<%= comp.icon %>" ,"cssClass": "v-toggle-icon--on"}'
|
11
|
+
data-toggle-off='{"label": "", "content": "<%= comp.icon %>", "cssClass": "v-toggle-icon--off"}'
|
12
|
+
<%= erb :"components/event", :locals => {events: comp.events, parent_id: comp.event_parent_id} %>>
|
13
|
+
<%= comp.icon %>
|
14
|
+
</i>
|
15
|
+
<%= erb :"components/tooltip", :locals => {comp: comp.tooltip, parent_id: comp.id} %>
|
@@ -0,0 +1,7 @@
|
|
1
|
+
<% if comp
|
2
|
+
position_classes = comp.position.map {|p| "v-image-position-#{p}"}.join(' ') %>
|
3
|
+
<img id="<%= comp.id %>"
|
4
|
+
class="v-image <%=position_classes%>"
|
5
|
+
src="<%= comp.url %>" height="<%= comp.height %>" width="<%= comp.width %>" border="0" alt="">
|
6
|
+
<%= erb :"components/tooltip", :locals => {comp: comp.tooltip, parent_id: comp.id} %>
|
7
|
+
<% end %>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<% if link %>
|
2
|
+
<% if preamble %>
|
3
|
+
<a style="color: unset; text-decoration: none;"
|
4
|
+
<% unless link&.replaces %>
|
5
|
+
href ="<%=link.url%>"
|
6
|
+
<% else %>
|
7
|
+
onclick="new VReplaceElement('<%=link&.replaces%>','<%= link.url %>', '<%="grid_nesting=#{@grid_nesting-1}"%>').call()"
|
8
|
+
<% end %>
|
9
|
+
>
|
10
|
+
<% else %>
|
11
|
+
</a>
|
12
|
+
<% end %>
|
13
|
+
<% end %>
|
14
|
+
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<% unless comp.lines_only %>
|
2
|
+
<ul class="mdc-list
|
3
|
+
<%= 'mdc-list--two-line' if comp.lines.select{|line| eq(line.type, :line) && line.subtitle }.any? %>
|
4
|
+
<%= 'mdc-list--avatar-list' if comp.lines.select{|line| eq(line.type, :line) && line.avatar }.any? %>">
|
5
|
+
<% end %>
|
6
|
+
<% for line in comp.lines %>
|
7
|
+
<%= erb :"components/list/#{line.type}", :locals => {:line => line} %>
|
8
|
+
<% end %>
|
9
|
+
<%= erb :"components/render", :locals => {:components => comp.components, :scope => nil} %>
|
10
|
+
<% unless comp.lines_only %>
|
11
|
+
</ul>
|
12
|
+
<% end %>
|
13
|
+
|
14
|
+
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= erb :"components/button", :locals => {:comp => action.button, class_name:nil} %>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= erb :"components/checkbox", :locals => {:comp => action.checkbox, class_name:nil} %>
|