voom-presenters 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +63 -0
- data/Gemfile +2 -0
- data/Gemfile.lock +4 -1
- data/lib/voom/presenters/dsl/components/expansion_panel.rb +2 -0
- data/lib/voom/presenters/dsl/components/grid.rb +2 -0
- data/lib/voom/presenters/dsl/components/radio_button.rb +1 -0
- data/lib/voom/presenters/dsl/components/switch.rb +2 -0
- data/lib/voom/presenters/version.rb +1 -1
- data/public/bundle.js +50 -0
- data/views/mdc/assets/js/components/initialize.js +2 -0
- data/views/mdc/assets/js/components/switches.js +36 -0
- data/views/mdc/components/switch.erb +1 -1
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 640a2c67ff6693946a15d1346628b106c82afb9ffd68ed4cbd9fad9089bcef21
|
4
|
+
data.tar.gz: f3c07e70f86bec1ee77e83be8397b37c9b213610a74266dec21b17b812791627
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 96ac9a944a2e1c9c178f31fc2b289130556239a16502fe0cd30b74d27e158791c0f12f5e148fe44d6f162e150c2b849ca5ea565fcddcf14723c006984fab8b3e
|
7
|
+
data.tar.gz: 013a01b7e54dda3d018986b35b7bc5cd0a0344aa500b725a12ca30615ecb27dcce3e7587abeaa9ad00232af965eabf224139c0b4d4e474225230df9cdf074c77
|
@@ -0,0 +1,63 @@
|
|
1
|
+
# Ruby CircleCI 2.0 configuration file
|
2
|
+
#
|
3
|
+
# Check https://circleci.com/docs/2.0/language-ruby/ for more details
|
4
|
+
#
|
5
|
+
version: 2
|
6
|
+
jobs:
|
7
|
+
build:
|
8
|
+
docker:
|
9
|
+
# specify the version you desire here
|
10
|
+
- image: circleci/ruby:2.4.1-node-browsers
|
11
|
+
|
12
|
+
# Specify service dependencies here if necessary
|
13
|
+
# CircleCI maintains a library of pre-built images
|
14
|
+
# documented at https://circleci.com/docs/2.0/circleci-images/
|
15
|
+
# - image: circleci/postgres:9.4
|
16
|
+
|
17
|
+
working_directory: ~/repo
|
18
|
+
|
19
|
+
steps:
|
20
|
+
- checkout
|
21
|
+
|
22
|
+
# Download and cache dependencies
|
23
|
+
- restore_cache:
|
24
|
+
keys:
|
25
|
+
- v1-dependencies-{{ checksum "Gemfile.lock" }}
|
26
|
+
# fallback to using the latest cache if no exact match is found
|
27
|
+
- v1-dependencies-
|
28
|
+
|
29
|
+
- run:
|
30
|
+
name: install dependencies
|
31
|
+
command: |
|
32
|
+
bundle install --jobs=4 --retry=3 --path vendor/bundle
|
33
|
+
|
34
|
+
- save_cache:
|
35
|
+
paths:
|
36
|
+
- ./vendor/bundle
|
37
|
+
key: v1-dependencies-{{ checksum "Gemfile.lock" }}
|
38
|
+
|
39
|
+
- run:
|
40
|
+
name: 'start integration testing server'
|
41
|
+
command: |
|
42
|
+
rackup
|
43
|
+
background: true
|
44
|
+
|
45
|
+
# run tests!
|
46
|
+
- run:
|
47
|
+
name: run specs
|
48
|
+
command: |
|
49
|
+
mkdir /tmp/test-results
|
50
|
+
TEST_FILES="$(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)"
|
51
|
+
|
52
|
+
bundle exec rspec --format progress \
|
53
|
+
--format RspecJunitFormatter \
|
54
|
+
--out /tmp/test-results/rspec.xml \
|
55
|
+
--format progress \
|
56
|
+
$TEST_FILES
|
57
|
+
|
58
|
+
# collect reports
|
59
|
+
- store_test_results:
|
60
|
+
path: /tmp/test-results
|
61
|
+
- store_artifacts:
|
62
|
+
path: /tmp/test-results
|
63
|
+
destination: test-results
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -59,6 +59,8 @@ GEM
|
|
59
59
|
diff-lcs (>= 1.2.0, < 2.0)
|
60
60
|
rspec-support (~> 3.5.0)
|
61
61
|
rspec-support (3.5.0)
|
62
|
+
rspec_junit_formatter (0.3.0)
|
63
|
+
rspec-core (>= 2, < 4, != 2.12.0)
|
62
64
|
rubyzip (1.2.1)
|
63
65
|
selenium-webdriver (3.11.0)
|
64
66
|
childprocess (~> 0.5)
|
@@ -93,8 +95,9 @@ DEPENDENCIES
|
|
93
95
|
pry (~> 0.10)
|
94
96
|
rack-test (~> 0.8)
|
95
97
|
rake (~> 11.3)
|
96
|
-
rspec
|
98
|
+
rspec
|
97
99
|
rspec-html-matchers
|
100
|
+
rspec_junit_formatter
|
98
101
|
voom-presenters!
|
99
102
|
watir (~> 6.10.3)
|
100
103
|
watir-rspec
|
data/public/bundle.js
CHANGED
@@ -640,6 +640,8 @@ function getNormalizedEventCoords(ev, pageOffset, clientRect) {
|
|
640
640
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__snackbar__ = __webpack_require__(3);
|
641
641
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__checkboxes__ = __webpack_require__(110);
|
642
642
|
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__date_time__ = __webpack_require__(115);
|
643
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__switches__ = __webpack_require__(116);
|
644
|
+
|
643
645
|
|
644
646
|
|
645
647
|
|
@@ -670,6 +672,7 @@ function initialize() {
|
|
670
672
|
Object(__WEBPACK_IMPORTED_MODULE_11__snackbar__["a" /* initSnackbar */])();
|
671
673
|
Object(__WEBPACK_IMPORTED_MODULE_12__checkboxes__["a" /* initCheckboxes */])();
|
672
674
|
Object(__WEBPACK_IMPORTED_MODULE_13__date_time__["a" /* initDateTime */])();
|
675
|
+
Object(__WEBPACK_IMPORTED_MODULE_14__switches__["a" /* initSwitches */])();
|
673
676
|
// This needs to be last, because it relies on the components installed above.
|
674
677
|
Object(__WEBPACK_IMPORTED_MODULE_3__events__["a" /* initEvents */])();
|
675
678
|
// componentHandler.upgradeAllRegistered();
|
@@ -16452,5 +16455,52 @@ function initDateTime() {
|
|
16452
16455
|
console.log('\tDateTime');
|
16453
16456
|
}
|
16454
16457
|
|
16458
|
+
/***/ }),
|
16459
|
+
/* 116 */
|
16460
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
16461
|
+
|
16462
|
+
"use strict";
|
16463
|
+
/* harmony export (immutable) */ __webpack_exports__["a"] = initSwitches;
|
16464
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__base_component__ = __webpack_require__(24);
|
16465
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__mixins_event_handler__ = __webpack_require__(25);
|
16466
|
+
|
16467
|
+
|
16468
|
+
|
16469
|
+
function initSwitches() {
|
16470
|
+
console.log('\tSwitches');
|
16471
|
+
|
16472
|
+
let components = document.querySelectorAll('.v-switch');
|
16473
|
+
if (components) {
|
16474
|
+
for (let i = 0; i < components.length; i++) {
|
16475
|
+
let component = components[i];
|
16476
|
+
if (!component.vComponent) {
|
16477
|
+
let input = component.querySelector('input');
|
16478
|
+
let vSwitch = new VSwitch(component, input);
|
16479
|
+
component.vComponent = vSwitch;
|
16480
|
+
input.vComponent = vSwitch;
|
16481
|
+
}
|
16482
|
+
}
|
16483
|
+
}
|
16484
|
+
}
|
16485
|
+
|
16486
|
+
class VSwitch extends Object(__WEBPACK_IMPORTED_MODULE_1__mixins_event_handler__["a" /* eventHandlerMixin */])(__WEBPACK_IMPORTED_MODULE_0__base_component__["a" /* VBaseComponent */]) {
|
16487
|
+
constructor(element, input) {
|
16488
|
+
super(element);
|
16489
|
+
this.input = input;
|
16490
|
+
}
|
16491
|
+
|
16492
|
+
validate(_formData) {
|
16493
|
+
return true;
|
16494
|
+
}
|
16495
|
+
|
16496
|
+
prepareSubmit(form, params) {
|
16497
|
+
if (!form) {
|
16498
|
+
params.push([this.input.name, this.input.value]);
|
16499
|
+
}
|
16500
|
+
}
|
16501
|
+
}
|
16502
|
+
/* unused harmony export VSwitch */
|
16503
|
+
|
16504
|
+
|
16455
16505
|
/***/ })
|
16456
16506
|
/******/ ]);
|
@@ -12,6 +12,7 @@ import {initForms} from './forms';
|
|
12
12
|
import {initSnackbar} from './snackbar';
|
13
13
|
import {initCheckboxes} from './checkboxes';
|
14
14
|
import {initDateTime} from './date-time';
|
15
|
+
import {initSwitches} from './switches';
|
15
16
|
|
16
17
|
export function initialize(){
|
17
18
|
console.log('Initializing');
|
@@ -28,6 +29,7 @@ export function initialize(){
|
|
28
29
|
initSnackbar();
|
29
30
|
initCheckboxes();
|
30
31
|
initDateTime();
|
32
|
+
initSwitches();
|
31
33
|
// This needs to be last, because it relies on the components installed above.
|
32
34
|
initEvents();
|
33
35
|
// componentHandler.upgradeAllRegistered();
|
@@ -0,0 +1,36 @@
|
|
1
|
+
import {VBaseComponent} from './base-component';
|
2
|
+
import {eventHandlerMixin} from './mixins/event-handler';
|
3
|
+
|
4
|
+
export function initSwitches() {
|
5
|
+
console.log('\tSwitches');
|
6
|
+
|
7
|
+
let components = document.querySelectorAll('.v-switch');
|
8
|
+
if (components) {
|
9
|
+
for (let i = 0; i < components.length; i++) {
|
10
|
+
let component = components[i];
|
11
|
+
if (!component.vComponent) {
|
12
|
+
let input = component.querySelector('input');
|
13
|
+
let vSwitch = new VSwitch(component, input);
|
14
|
+
component.vComponent = vSwitch;
|
15
|
+
input.vComponent = vSwitch;
|
16
|
+
}
|
17
|
+
}
|
18
|
+
}
|
19
|
+
}
|
20
|
+
|
21
|
+
export class VSwitch extends eventHandlerMixin(VBaseComponent) {
|
22
|
+
constructor(element, input) {
|
23
|
+
super(element);
|
24
|
+
this.input = input;
|
25
|
+
}
|
26
|
+
|
27
|
+
validate(_formData) {
|
28
|
+
return true;
|
29
|
+
}
|
30
|
+
|
31
|
+
prepareSubmit(form, params) {
|
32
|
+
if (!form) {
|
33
|
+
params.push([this.input.name, this.input.value]);
|
34
|
+
}
|
35
|
+
}
|
36
|
+
}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: voom-presenters
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Russell Edens
|
@@ -213,6 +213,7 @@ executables: []
|
|
213
213
|
extensions: []
|
214
214
|
extra_rdoc_files: []
|
215
215
|
files:
|
216
|
+
- ".circleci/config.yml"
|
216
217
|
- ".gitignore"
|
217
218
|
- ".ruby-version"
|
218
219
|
- Gemfile
|
@@ -424,6 +425,7 @@ files:
|
|
424
425
|
- views/mdc/assets/js/components/mixins/event-handler.js
|
425
426
|
- views/mdc/assets/js/components/selects.js
|
426
427
|
- views/mdc/assets/js/components/snackbar.js
|
428
|
+
- views/mdc/assets/js/components/switches.js
|
427
429
|
- views/mdc/assets/js/components/text-fields.js
|
428
430
|
- views/mdc/assets/js/dialog-polyfill.js
|
429
431
|
- views/mdc/assets/js/material.js
|