voom-presenters 0.1.7 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +1 -1
  3. data/Gemfile.lock +5 -5
  4. data/app/demo/components/date_fields.pom +2 -2
  5. data/app/demo/components/datetime_fields.pom +6 -5
  6. data/app/demo/components/headers.pom +5 -0
  7. data/app/demo/components/lists.pom +11 -0
  8. data/app/demo/components/time_fields.pom +2 -2
  9. data/app/demo/events/actions/dialogs/trigger.pom +2 -2
  10. data/app/demo/events/actions/toggle_visiblity.pom +4 -4
  11. data/app/demo/shared/context_list.pom +1 -1
  12. data/component-status.yml +11 -11
  13. data/lib/voom/presenters/dsl/components/button.rb +2 -2
  14. data/lib/voom/presenters/dsl/components/checkbox.rb +2 -1
  15. data/lib/voom/presenters/dsl/components/datetime_base.rb +2 -1
  16. data/lib/voom/presenters/dsl/components/event.rb +25 -6
  17. data/lib/voom/presenters/dsl/components/expansion_panel.rb +3 -0
  18. data/lib/voom/presenters/dsl/components/header.rb +23 -0
  19. data/lib/voom/presenters/dsl/components/icon_toggle.rb +2 -2
  20. data/lib/voom/presenters/dsl/components/list.rb +18 -4
  21. data/lib/voom/presenters/dsl/components/lists/action.rb +1 -1
  22. data/lib/voom/presenters/dsl/components/lists/header.rb +19 -0
  23. data/lib/voom/presenters/dsl/components/lists/line.rb +15 -5
  24. data/lib/voom/presenters/dsl/components/menu.rb +2 -1
  25. data/lib/voom/presenters/dsl/components/mixins/typography.rb +0 -1
  26. data/lib/voom/presenters/dsl/components/toggle_base.rb +2 -2
  27. data/lib/voom/presenters/version.rb +1 -1
  28. data/lib/voom/presenters/web_client/app.rb +23 -5
  29. data/public/bundle.css +266 -153
  30. data/public/bundle.js +148 -41
  31. data/scripts/bump.sh +3 -0
  32. data/scripts/deploy-demo.sh +2 -0
  33. data/scripts/release.sh +4 -0
  34. data/views/mdc/assets/js/components/datetime.js +9 -5
  35. data/views/mdc/assets/js/components/events.js +6 -7
  36. data/views/mdc/assets/js/components/events/clears.js +26 -0
  37. data/views/mdc/assets/js/components/events/toggle_visibility.js +26 -0
  38. data/views/mdc/assets/js/components/forms.js +8 -0
  39. data/views/mdc/assets/js/components/lists.js +84 -1
  40. data/views/mdc/assets/js/components/text-fields.js +8 -0
  41. data/views/mdc/assets/scss/components/datetime.scss +5 -0
  42. data/views/mdc/assets/scss/components/list.scss +11 -0
  43. data/views/mdc/assets/scss/theme.scss +49 -2
  44. data/views/mdc/body/drawer.erb +2 -2
  45. data/views/mdc/body/header.erb +6 -0
  46. data/views/mdc/components/checkbox.erb +4 -1
  47. data/views/mdc/components/datetime.erb +2 -2
  48. data/views/mdc/components/expansion_panel.erb +1 -1
  49. data/views/mdc/components/list.erb +2 -1
  50. data/views/mdc/components/list/checkbox.erb +1 -1
  51. data/views/mdc/components/list/header.erb +35 -0
  52. data/views/mdc/components/list/line.erb +2 -1
  53. data/views/mdc/components/menu.erb +1 -1
  54. metadata +9 -4
  55. data/views/mdc/assets/js/components/events/selects.js +0 -28
  56. data/views/mdc/assets/js/components/events/toggle_visiblity.js +0 -19
@@ -72,4 +72,12 @@ export class VTextField extends eventHandlerMixin(VBaseComponent) {
72
72
  }
73
73
  return null;
74
74
  }
75
+
76
+ clear(){
77
+ this.setValue('');
78
+ }
79
+
80
+ setValue(value){
81
+ this.input.value = value;
82
+ }
75
83
  }
@@ -17,3 +17,8 @@
17
17
  padding-right: 48px;
18
18
  padding-left: 48px;
19
19
  }
20
+
21
+ i:focus.v-datetime--clear {
22
+ outline: none;
23
+ }
24
+
@@ -6,4 +6,15 @@
6
6
  @include mdc-theme-prop(background-color, text-icon-on-background);
7
7
  }
8
8
 
9
+ .v-list-item--header {
10
+ background-color: #F5F5F5;
11
+ }
12
+
13
+ #list-item-select-all-header {
14
+ height: 45px;
15
+ > span {
16
+ margin: auto;
17
+ }
18
+ }
19
+
9
20
 
@@ -1,5 +1,52 @@
1
- $mdc-theme-primary: rgb(96,125,139);
2
- $mdc-theme-secondary: rgb(255,171,64);
1
+ $mdc-theme-primary: #5488b2;
2
+ $mdc-theme-secondary: #E58D36;
3
3
  $mdc-theme-background: #fff;
4
4
 
5
5
  $v-theme-error-message: #d50000;
6
+
7
+ $v-header-background: #263138;
8
+ $v-header-color: #839098;
9
+
10
+ $v-drawer-background: #37424a;
11
+ $v-drawer-color: #71818c;
12
+
13
+ $v-title-background: #EBF0F4;
14
+
15
+ .mdl-layout__header {
16
+ background-color: $v-title-background;
17
+ .mdl-layout__header-row {
18
+ background-color: $v-header-background;
19
+ color: $v-header-color;
20
+ }
21
+ .mdl-layout__drawer-button {
22
+ background-color: $v-drawer-background;
23
+ }
24
+ h1 {
25
+ padding-left: 24px;
26
+ color: $v-drawer-color;
27
+ font-size: 30px;
28
+ i {
29
+ font-size: 30px;
30
+ vertical-align: middle;
31
+ }
32
+ }
33
+ }
34
+
35
+ .mdl-layout__drawer {
36
+ background-color: $v-drawer-background;
37
+ border-right: 1px solid $v-drawer-background;
38
+ color: $v-drawer-color;
39
+ .mdl-navigation {
40
+ .mdl-navigation__link {
41
+ color: $v-drawer-color;
42
+ &.v-menu-item__selected {
43
+ color: lighten($v-drawer-color, 20%);
44
+ font-weight: bold;
45
+ }
46
+ &:hover {
47
+ background-color: $v-drawer-background;
48
+ color: lighten($v-drawer-color, 20%);
49
+ }
50
+ }
51
+ }
52
+ }
@@ -3,9 +3,9 @@
3
3
  <% if drawer.menu&.items %>
4
4
  <nav class="mdl-navigation">
5
5
  <% drawer.menu&.items&.each do |item| %>
6
- <a class="mdl-navigation__link"
6
+ <a class="mdl-navigation__link <%= 'v-menu-item__selected' if item.selected %>"
7
7
  id="<%= item.id %>"
8
- style="color: unset; text-decoration: none;"
8
+ style="text-decoration: none;"
9
9
  href="javascript:void(0)"
10
10
  <%= erb :"components/event", :locals => {events: item.events, parent_id: item.event_parent_id} %>>
11
11
  <%= erb :"components/icon", :locals => {comp: item.icon} %>
@@ -22,4 +22,10 @@
22
22
  </nav>
23
23
  <% end %>
24
24
  </div>
25
+ <% if header.page_title&.text || header.page_title&.icon%>
26
+ <h1>
27
+ <%= erb :"components/icon", :locals => {comp: header.page_title.icon, class_name: nil} if header.page_title&.icon%>
28
+ <%= expand_text(header.page_title.text) if header.page_title&.text %>
29
+ </h1>
30
+ <% end %>
25
31
  </header>
@@ -1,9 +1,12 @@
1
+ <% class_name = '' unless local_variables.include? :class_name %>
2
+
1
3
  <div class="mdc-checkbox">
2
4
  <input type="checkbox"
3
5
  id="<%=comp.id%>"
4
6
  name="<%=comp.name%>"
5
7
  value="<%=comp.value%>"
6
- class="mdc-checkbox__native-control"
8
+ class="mdc-checkbox__native-control
9
+ <%= class_name %>"
7
10
  <% if comp.checked %> checked <% end %><% if comp.disabled %> disabled <% end %>
8
11
  <%= erb :"components/event", :locals => {events: comp.events, parent_id: comp.event_parent_id} %>
9
12
  />
@@ -1,12 +1,12 @@
1
1
  <%
2
- time_val = comp.value ? Array(comp.value).map{ |v| v.respond_to?(:strftime) ? v.strftime("%Y-%m-%dT%H:%M:%S.%L") : v}.join(', ') : nil
2
+ time_val = comp.value ? Array([comp.value]).join(', ') : nil
3
3
  %>
4
4
  <div id="<%= comp.id %>"
5
5
  class="mdc-text-field v-datetime
6
6
  <%= comp.icon ? 'mdc-text-field--with-leading-icon' : 'mdc-text-field--with-trailing-icon' %>
7
7
  <%= 'mdc-text-field--fullwidth' if comp.full_width %>
8
8
  <%= 'is-invalid is-dirty' if comp.error %>"
9
- data-config='<%= snake_to_camel(comp.config, except: %i(time_24hr)).to_json %>'
9
+ data-config='<%= snake_to_camel(to_hash(comp.config), except: %i(time_24hr)).to_json %>'
10
10
  data-type='<%= comp.type %>'>
11
11
  <%= erb :"components/icon", :locals => {comp: comp.icon, class_name: 'mdc-text-field__icon',
12
12
  parent_id: "#{comp.id}-input"} %>
@@ -1,4 +1,4 @@
1
- <details id = '<%= comp.id %>' class="v-expansion mdc-elevation--z3">
1
+ <details id = '<%= comp.id %>' class="v-expansion mdc-elevation--z3"<% if comp.open %> open<% end %>>
2
2
  <summary class="v-expansion__summary"><span class="v-expansion__header"><%= expand_text(comp.text&.text) %></span>
3
3
  <span class="v-expansion__secondary-content"><%=expand_text(comp.secondary_text&.text)%></span></summary>
4
4
  <div class="v-expansion__content">
@@ -1,7 +1,8 @@
1
1
  <% unless comp.lines_only %>
2
2
  <ul class="mdc-list
3
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? %>">
4
+ <%= 'mdc-list--avatar-list' if comp.lines.select{|line| eq(line.type, :line) && line.avatar }.any? %>"
5
+ data-total-lines="<%= comp.total_lines %>">
5
6
  <% end %>
6
7
  <% for line in comp.lines %>
7
8
  <%= erb :"components/list/#{line.type}", :locals => {:line => line} %>
@@ -1,5 +1,5 @@
1
1
  <% if line.checkbox %>
2
2
  <span class="mdc-list-item__graphic">
3
- <%= erb :"components/checkbox", :locals => {comp: line.checkbox} %>
3
+ <%= erb :"components/checkbox", :locals => {comp: line.checkbox, class_name: 'v-list-item--selectable-checkbox'} %>
4
4
  </span>
5
5
  <%end%>
@@ -0,0 +1,35 @@
1
+ <li class="mdc-list-item
2
+ v-list-item--header
3
+ v-list-item--selectable-header"
4
+ id="<%= line.id %>">
5
+ <%= erb :"components/checkbox", :locals => {:comp => line.checkbox, :class_name => 'v-checkbox--select-control'} if line.checkbox %>
6
+ <span class="mdc-list-item__text">
7
+ <%= expand_text(line.text&.text) %>
8
+
9
+ <% if line.subtitle %>
10
+ <span class="mdc-list-item__secondary-text">
11
+ <%= expand_text(line.subtitle.text) %>
12
+ </span>
13
+ <% end %>
14
+
15
+ <% if line.body %>
16
+ <span class="mdc-list-item__secondary-text">
17
+ <%= expand_text(line.body.text) %>
18
+ </span>
19
+ <% end %>
20
+ </span>
21
+ </li>
22
+
23
+ <% if line.total_lines > 0 %>
24
+ <li class="mdc-list-item hidden" id="list-item-select-all-header">
25
+ <input type="checkbox" name="all" value="true" id="select-total" style="display: none;" />
26
+ <span class="mdc-list-item__secondary-text" id="list-item-select-all-toggle-off">
27
+ All <span id="page-selection-count">10</span> records on this page are selected. <a href="#" class="toggle-total-set" data-select="on">Select all <%= line.total_lines %> records.</a>
28
+ </span>
29
+ <span class="mdc-list-item__secondary-text hidden" id="list-item-select-all-toggle-on">
30
+ All <%= line.total_lines %> records selected. <a href="#" class="toggle-total-set" data-select="off">Clear selection</a>
31
+ </span>
32
+ </li>
33
+ <% end %>
34
+
35
+ <li role="separator" class="mdc-list-divider"></li>
@@ -3,7 +3,8 @@
3
3
  <% end %>
4
4
  <li class="mdc-list-item
5
5
  <%= 'mdc-list-item--selected' if line.selected %>
6
- <%= 'v-menu-click' if line.menu && line.actions.empty?%>"
6
+ <%= 'v-menu-click' if line.menu && line.actions.empty?%>
7
+ <%= 'v-list-item--selectable' if line.selectable %>"
7
8
  id="<%= line.id %>">
8
9
  <%= erb :"components/list/checkbox", :locals => {:line => line} %>
9
10
  <%= erb :"components/list/icon", :locals => {:line => line} %>
@@ -7,7 +7,7 @@
7
7
  <ul class="mdc-menu__items mdc-list" role="menu" aria-hidden="true">
8
8
  <% comp.items.each do |item| %>
9
9
  <% unless eq(item.type, :divider) %>
10
- <li class="mdc-list-item" role="menuitem" tabindex="0"
10
+ <li class="mdc-list-item <%= 'v-menu-item__selected' if item.selected %>" role="menuitem" tabindex="0"
11
11
  <%= 'disabled' if item.disabled %>>
12
12
  <% unless item.disabled %>
13
13
  <a class="v-menu-link"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: voom-presenters
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Russell Edens
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-05-16 00:00:00.000000000 Z
11
+ date: 2018-06-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ice_nine
@@ -326,6 +326,7 @@ files:
326
326
  - lib/voom/presenters/dsl/components/input.rb
327
327
  - lib/voom/presenters/dsl/components/list.rb
328
328
  - lib/voom/presenters/dsl/components/lists/action.rb
329
+ - lib/voom/presenters/dsl/components/lists/header.rb
329
330
  - lib/voom/presenters/dsl/components/lists/line.rb
330
331
  - lib/voom/presenters/dsl/components/lists/separator.rb
331
332
  - lib/voom/presenters/dsl/components/menu.rb
@@ -409,6 +410,9 @@ files:
409
410
  - public/scripts.js
410
411
  - public/style-bundle.js
411
412
  - public/styles.css
413
+ - scripts/bump.sh
414
+ - scripts/deploy-demo.sh
415
+ - scripts/release.sh
412
416
  - views/mdc/.gitignore
413
417
  - views/mdc/assets/js/app.js
414
418
  - views/mdc/assets/js/components/base-component.js
@@ -421,15 +425,15 @@ files:
421
425
  - views/mdc/assets/js/components/events.js
422
426
  - views/mdc/assets/js/components/events/autocomplete.js
423
427
  - views/mdc/assets/js/components/events/base.js
428
+ - views/mdc/assets/js/components/events/clears.js
424
429
  - views/mdc/assets/js/components/events/dialog.js
425
430
  - views/mdc/assets/js/components/events/errors.js
426
431
  - views/mdc/assets/js/components/events/loads.js
427
432
  - views/mdc/assets/js/components/events/navigates.js
428
433
  - views/mdc/assets/js/components/events/posts.js
429
434
  - views/mdc/assets/js/components/events/replaces.js
430
- - views/mdc/assets/js/components/events/selects.js
431
435
  - views/mdc/assets/js/components/events/snackbar.js
432
- - views/mdc/assets/js/components/events/toggle_visiblity.js
436
+ - views/mdc/assets/js/components/events/toggle_visibility.js
433
437
  - views/mdc/assets/js/components/forms.js
434
438
  - views/mdc/assets/js/components/icon-toggles.js
435
439
  - views/mdc/assets/js/components/initialize.js
@@ -512,6 +516,7 @@ files:
512
516
  - views/mdc/components/list/actions/switch.erb
513
517
  - views/mdc/components/list/avatar.erb
514
518
  - views/mdc/components/list/checkbox.erb
519
+ - views/mdc/components/list/header.erb
515
520
  - views/mdc/components/list/icon.erb
516
521
  - views/mdc/components/list/info.erb
517
522
  - views/mdc/components/list/line.erb
@@ -1,28 +0,0 @@
1
- export class VSelects {
2
- constructor(options, params, event) {
3
- this.target = options.target;
4
- this.params = params;
5
- this.event = event;
6
- }
7
-
8
- call(results) {
9
- let targetFields =document.querySelectorAll('input[name="'+this.target+'"]');
10
- let checked = this.event.target.checked;
11
- new Promise(function (resolve) {
12
- if (targetFields) {
13
- if (checked) {
14
- for (let i = 0; i < targetFields.length; i++) {
15
- console.log(i);
16
- targetFields[i].checked = true;
17
- }
18
- } else {
19
- for (let i = 0; i < targetFields.length; i++) {
20
- targetFields[i].checked = false;
21
- }
22
- }
23
- }
24
- results.push({action:'selects', statusCode: 200});
25
- resolve(results);
26
- });
27
- }
28
- }
@@ -1,19 +0,0 @@
1
- export class VToggleVisiblity {
2
- constructor(options, params, event) {
3
- this.targetId = options.target;
4
- this.params = params;
5
- this.event = event;
6
- }
7
-
8
- call(results) {
9
- var targetId = this.targetId;
10
- var promiseObj = new Promise(function (resolve) {
11
- console.log("Toggling visiblity on: " + targetId);
12
- var elem = document.getElementById(targetId);
13
- elem.classList.toggle("v-hidden");
14
- results.push({action:'toggle_visiblity', statusCode: 200});
15
- resolve(results);
16
- });
17
- return promiseObj;
18
- }
19
- }