arara 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/README.md +38 -0
- data/Rakefile +32 -0
- data/app/assets/config/arara_manifest.js +1 -0
- data/app/assets/javascripts/arara.js +603 -0
- data/app/assets/stylesheets/arara/application.css +15 -0
- data/app/components/arara.rb +2 -0
- data/app/components/arara/base_component.rb +62 -0
- data/app/components/arara/button_component.html.erb +7 -0
- data/app/components/arara/button_component.rb +50 -0
- data/app/components/arara/card_action_buttons_component.html.erb +3 -0
- data/app/components/arara/card_action_buttons_component.rb +15 -0
- data/app/components/arara/card_action_icons_component.html.erb +3 -0
- data/app/components/arara/card_action_icons_component.rb +15 -0
- data/app/components/arara/card_actions_component.html.erb +3 -0
- data/app/components/arara/card_actions_component.rb +15 -0
- data/app/components/arara/card_component.html.erb +3 -0
- data/app/components/arara/card_component.rb +15 -0
- data/app/components/arara/card_media_component.html.erb +3 -0
- data/app/components/arara/card_media_component.rb +20 -0
- data/app/components/arara/card_media_content_component.html.erb +3 -0
- data/app/components/arara/card_media_content_component.rb +15 -0
- data/app/components/arara/card_primary_content_component.html.erb +3 -0
- data/app/components/arara/card_primary_content_component.rb +18 -0
- data/app/components/arara/checkbox_component.html.erb +22 -0
- data/app/components/arara/checkbox_component.rb +25 -0
- data/app/components/arara/chip_component.html.erb +13 -0
- data/app/components/arara/chip_component.rb +22 -0
- data/app/components/arara/chipset_component.html.erb +6 -0
- data/app/components/arara/chipset_component.rb +23 -0
- data/app/components/arara/data_table_body_cell_component.html.erb +3 -0
- data/app/components/arara/data_table_body_cell_component.rb +18 -0
- data/app/components/arara/data_table_body_checkbox_component.html.erb +11 -0
- data/app/components/arara/data_table_body_checkbox_component.rb +25 -0
- data/app/components/arara/data_table_body_component.html.erb +3 -0
- data/app/components/arara/data_table_body_component.rb +15 -0
- data/app/components/arara/data_table_body_row_component.html.erb +3 -0
- data/app/components/arara/data_table_body_row_component.rb +27 -0
- data/app/components/arara/data_table_component.html.erb +5 -0
- data/app/components/arara/data_table_component.rb +36 -0
- data/app/components/arara/data_table_header_cell_component.html.erb +3 -0
- data/app/components/arara/data_table_header_cell_component.rb +24 -0
- data/app/components/arara/data_table_header_checkbox_component.html.erb +11 -0
- data/app/components/arara/data_table_header_checkbox_component.rb +25 -0
- data/app/components/arara/data_table_header_component.html.erb +3 -0
- data/app/components/arara/data_table_header_component.rb +11 -0
- data/app/components/arara/data_table_header_row_component.html.erb +3 -0
- data/app/components/arara/data_table_header_row_component.rb +15 -0
- data/app/components/arara/dialog_button_component.html.erb +4 -0
- data/app/components/arara/dialog_button_component.rb +31 -0
- data/app/components/arara/dialog_component.html.erb +8 -0
- data/app/components/arara/dialog_component.rb +34 -0
- data/app/components/arara/dialog_content_component.html.erb +3 -0
- data/app/components/arara/dialog_content_component.rb +15 -0
- data/app/components/arara/dialog_footer_component.html.erb +3 -0
- data/app/components/arara/dialog_footer_component.rb +15 -0
- data/app/components/arara/dialog_title_component.html.erb +3 -0
- data/app/components/arara/dialog_title_component.rb +16 -0
- data/app/components/arara/elevation_component.html.erb +3 -0
- data/app/components/arara/elevation_component.rb +19 -0
- data/app/components/arara/fab_component.html.erb +13 -0
- data/app/components/arara/fab_component.rb +42 -0
- data/app/components/arara/fab_icon_component.html.erb +3 -0
- data/app/components/arara/fab_icon_component.rb +15 -0
- data/app/components/arara/form_builder.rb +142 -0
- data/app/components/arara/form_field_component.html.erb +3 -0
- data/app/components/arara/form_field_component.rb +15 -0
- data/app/components/arara/google_calendar/menu_item_component.html.erb +11 -0
- data/app/components/arara/google_calendar/menu_item_component.rb +34 -0
- data/app/components/arara/google_calendar/nav_bar_component.html.erb +176 -0
- data/app/components/arara/google_calendar/nav_bar_component.rb +6 -0
- data/app/components/arara/icon_button_component.html.erb +3 -0
- data/app/components/arara/icon_button_component.rb +42 -0
- data/app/components/arara/icon_toggle_component.html.erb +3 -0
- data/app/components/arara/icon_toggle_component.rb +18 -0
- data/app/components/arara/material_icon_component.html.erb +3 -0
- data/app/components/arara/material_icon_component.rb +18 -0
- data/app/components/arara/menu_component.html.erb +5 -0
- data/app/components/arara/menu_component.rb +19 -0
- data/app/components/arara/menu_divider_component.html.erb +1 -0
- data/app/components/arara/menu_divider_component.rb +19 -0
- data/app/components/arara/menu_item_component.html.erb +3 -0
- data/app/components/arara/menu_item_component.rb +22 -0
- data/app/components/arara/nav_bar_component.html.erb +293 -0
- data/app/components/arara/nav_bar_component.rb +7 -0
- data/app/components/arara/radio_button_component.html.erb +8 -0
- data/app/components/arara/radio_button_component.rb +35 -0
- data/app/components/arara/select_component.html.erb +22 -0
- data/app/components/arara/select_component.rb +27 -0
- data/app/components/arara/select_item_component.html.erb +3 -0
- data/app/components/arara/select_item_component.rb +45 -0
- data/app/components/arara/step_component.html.erb +27 -0
- data/app/components/arara/step_component.rb +100 -0
- data/app/components/arara/step_connector_component.html.erb +4 -0
- data/app/components/arara/step_connector_component.rb +31 -0
- data/app/components/arara/stepper_component.html.erb +3 -0
- data/app/components/arara/stepper_component.rb +20 -0
- data/app/components/arara/switch_component.html.erb +8 -0
- data/app/components/arara/switch_component.rb +35 -0
- data/app/components/arara/tags.rb +2 -0
- data/app/components/arara/tags/check_box.rb +63 -0
- data/app/components/arara/tags/chip_choice.rb +81 -0
- data/app/components/arara/tags/chipset.rb +39 -0
- data/app/components/arara/tags/country_select.rb +110 -0
- data/app/components/arara/tags/label.rb +78 -0
- data/app/components/arara/tags/password_field.rb +16 -0
- data/app/components/arara/tags/radio_button.rb +31 -0
- data/app/components/arara/tags/select.rb +120 -0
- data/app/components/arara/tags/text_area.rb +25 -0
- data/app/components/arara/tags/text_field.rb +31 -0
- data/app/components/arara/text_field_component.html.erb +47 -0
- data/app/components/arara/text_field_component.rb +101 -0
- data/app/components/arara/typography_component.html.erb +1 -0
- data/app/components/arara/typography_component.rb +51 -0
- data/app/controllers/arara/application_controller.rb +5 -0
- data/app/helpers/arara/application_helper.rb +4 -0
- data/app/javascript/arara/controllers/body_class_toggler_controller.js +20 -0
- data/app/javascript/arara/controllers/counter_controller.js +22 -0
- data/app/javascript/arara/controllers/demo_dialog_controller.js +24 -0
- data/app/javascript/arara/controllers/mdc_chip_set_controller.js +18 -0
- data/app/javascript/arara/controllers/mdc_data_table_controller.js +18 -0
- data/app/javascript/arara/controllers/mdc_form_field_controller.js +40 -0
- data/app/javascript/arara/controllers/mdc_icon_toggle_controller.js +18 -0
- data/app/javascript/arara/controllers/mdc_linear_progress_controller.js +18 -0
- data/app/javascript/arara/controllers/mdc_list_controller.js +23 -0
- data/app/javascript/arara/controllers/mdc_menu_controller.js +25 -0
- data/app/javascript/arara/controllers/mdc_ripple_controller.js +18 -0
- data/app/javascript/arara/controllers/mdc_select_controller.js +27 -0
- data/app/javascript/arara/controllers/mdc_slider_controller.js +21 -0
- data/app/javascript/arara/controllers/mdc_snackbar_controller.js +38 -0
- data/app/javascript/arara/controllers/mdc_switch_controller.js +18 -0
- data/app/javascript/arara/controllers/mdc_tab_bar_controller.js +18 -0
- data/app/javascript/arara/controllers/mdc_text_field_controller.js +35 -0
- data/app/javascript/arara/controllers/mdc_top_app_bar_controller.js +18 -0
- data/app/javascript/arara/controllers/rails_chip_set_choice_controller.js +31 -0
- data/app/javascript/arara/controllers/rails_chip_set_filter_controller.js +39 -0
- data/app/javascript/arara/controllers/remote_form_controller.js +79 -0
- data/app/javascript/arara/helpers/sum.js +5 -0
- data/app/javascript/arara/index.js +65 -0
- data/app/javascript/arara/scss/_material_design.scss +34 -0
- data/app/javascript/arara/scss/_tailwind.scss +4 -0
- data/app/javascript/arara/scss/arara.scss +5 -0
- data/app/javascript/arara/scss/material_design/_custom.scss +61 -0
- data/app/javascript/arara/scss/tailwind/_ripple_workaround.scss +22 -0
- data/app/jobs/arara/application_job.rb +4 -0
- data/app/mailers/arara/application_mailer.rb +6 -0
- data/app/models/arara/application_record.rb +5 -0
- data/app/views/layouts/arara/application.html.erb +15 -0
- data/config/routes.rb +2 -0
- data/lib/arara.rb +5 -0
- data/lib/arara/engine.rb +7 -0
- data/lib/arara/version.rb +3 -0
- data/lib/tasks/arara_tasks.rake +4 -0
- metadata +238 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// Visit The Stimulus Handbook for more details
|
|
2
|
+
// https://stimulusjs.org/handbook/introduction
|
|
3
|
+
//
|
|
4
|
+
// This example controller works with specially annotated HTML like:
|
|
5
|
+
//
|
|
6
|
+
// <div data-controller="hello">
|
|
7
|
+
// <h1 data-target="hello.output"></h1>
|
|
8
|
+
// </div>
|
|
9
|
+
|
|
10
|
+
import { Controller } from "stimulus"
|
|
11
|
+
import { MDCRipple } from "@material/ripple"
|
|
12
|
+
|
|
13
|
+
export default class extends Controller {
|
|
14
|
+
connect() {
|
|
15
|
+
const el = new MDCRipple(this.element)
|
|
16
|
+
this.el = el
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// Visit The Stimulus Handbook for more details
|
|
2
|
+
// https://stimulusjs.org/handbook/introduction
|
|
3
|
+
//
|
|
4
|
+
// This example controller works with specially annotated HTML like:
|
|
5
|
+
//
|
|
6
|
+
// <div data-controller="hello">
|
|
7
|
+
// <h1 data-target="hello.output"></h1>
|
|
8
|
+
// </div>
|
|
9
|
+
|
|
10
|
+
import { Controller } from "stimulus"
|
|
11
|
+
import { MDCSelect } from "@material/select"
|
|
12
|
+
|
|
13
|
+
export default class extends Controller {
|
|
14
|
+
static targets = ["input"]
|
|
15
|
+
|
|
16
|
+
connect() {
|
|
17
|
+
const el = new MDCSelect(this.element)
|
|
18
|
+
|
|
19
|
+
// initialize with the selected value
|
|
20
|
+
this.inputTarget.value = el.value
|
|
21
|
+
|
|
22
|
+
el.listen("MDCSelect:change", () => {
|
|
23
|
+
this.inputTarget.value = el.value
|
|
24
|
+
})
|
|
25
|
+
this.el = el
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// Visit The Stimulus Handbook for more details
|
|
2
|
+
// https://stimulusjs.org/handbook/introduction
|
|
3
|
+
//
|
|
4
|
+
// This example controller works with specially annotated HTML like:
|
|
5
|
+
//
|
|
6
|
+
// <div data-controller="hello">
|
|
7
|
+
// <h1 data-target="hello.output"></h1>
|
|
8
|
+
// </div>
|
|
9
|
+
|
|
10
|
+
import { Controller } from "stimulus"
|
|
11
|
+
import { MDCSlider } from "@material/slider"
|
|
12
|
+
|
|
13
|
+
export default class extends Controller {
|
|
14
|
+
connect() {
|
|
15
|
+
const el = new MDCSlider(this.element)
|
|
16
|
+
el.listen("MDCSlider:change", () => {
|
|
17
|
+
alert(`Value changed to ${el.value}`)
|
|
18
|
+
})
|
|
19
|
+
this.el = el
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// Visit The Stimulus Handbook for more details
|
|
2
|
+
// https://stimulusjs.org/handbook/introduction
|
|
3
|
+
//
|
|
4
|
+
// This example controller works with specially annotated HTML like:
|
|
5
|
+
//
|
|
6
|
+
// <div data-controller="hello">
|
|
7
|
+
// <h1 data-target="hello.output"></h1>
|
|
8
|
+
// </div>
|
|
9
|
+
|
|
10
|
+
import { Controller } from "stimulus"
|
|
11
|
+
import { MDCSnackbar } from "@material/snackbar"
|
|
12
|
+
|
|
13
|
+
export default class extends Controller {
|
|
14
|
+
static targets = ["button", "snackbar"]
|
|
15
|
+
|
|
16
|
+
connect() {
|
|
17
|
+
if (window.snackbarQueue == undefined) {
|
|
18
|
+
window.snackbarQueue = []
|
|
19
|
+
}
|
|
20
|
+
this.queue = window.snackbarQueue
|
|
21
|
+
this.snackbar = new MDCSnackbar(this.snackbarTarget)
|
|
22
|
+
this.snackbar.listen("MDCSnackbar:closed", () => this.handleClosed())
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
openSnackbar() {
|
|
26
|
+
this.queue.push(() => this.snackbar.open())
|
|
27
|
+
if (this.queue.length === 1) {
|
|
28
|
+
this.queue[0]()
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
handleClosed() {
|
|
33
|
+
this.queue.shift()
|
|
34
|
+
if (this.queue.length > 0) {
|
|
35
|
+
this.queue[0]()
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// Visit The Stimulus Handbook for more details
|
|
2
|
+
// https://stimulusjs.org/handbook/introduction
|
|
3
|
+
//
|
|
4
|
+
// This example controller works with specially annotated HTML like:
|
|
5
|
+
//
|
|
6
|
+
// <div data-controller="hello">
|
|
7
|
+
// <h1 data-target="hello.output"></h1>
|
|
8
|
+
// </div>
|
|
9
|
+
|
|
10
|
+
import { Controller } from "stimulus"
|
|
11
|
+
import { MDCSwitch } from "@material/switch"
|
|
12
|
+
|
|
13
|
+
export default class extends Controller {
|
|
14
|
+
connect() {
|
|
15
|
+
const el = new MDCSwitch(this.element)
|
|
16
|
+
this.el = el
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// Visit The Stimulus Handbook for more details
|
|
2
|
+
// https://stimulusjs.org/handbook/introduction
|
|
3
|
+
//
|
|
4
|
+
// This example controller works with specially annotated HTML like:
|
|
5
|
+
//
|
|
6
|
+
// <div data-controller="hello">
|
|
7
|
+
// <h1 data-target="hello.output"></h1>
|
|
8
|
+
// </div>
|
|
9
|
+
|
|
10
|
+
import { Controller } from "stimulus"
|
|
11
|
+
import { MDCTabBar } from "@material/tab-bar"
|
|
12
|
+
|
|
13
|
+
export default class extends Controller {
|
|
14
|
+
connect() {
|
|
15
|
+
const el = new MDCTabBar(this.element)
|
|
16
|
+
this.el = el
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// Visit The Stimulus Handbook for more details
|
|
2
|
+
// https://stimulusjs.org/handbook/introduction
|
|
3
|
+
//
|
|
4
|
+
// This example controller works with specially annotated HTML like:
|
|
5
|
+
//
|
|
6
|
+
// <div data-controller="hello">
|
|
7
|
+
// <h1 data-target="hello.output"></h1>
|
|
8
|
+
// </div>
|
|
9
|
+
|
|
10
|
+
import { Controller } from "stimulus"
|
|
11
|
+
import { MDCTextField } from "@material/textfield"
|
|
12
|
+
|
|
13
|
+
export default class extends Controller {
|
|
14
|
+
static targets = ["element", "helperLine"]
|
|
15
|
+
|
|
16
|
+
connect() {
|
|
17
|
+
const el = new MDCTextField(this.elementTarget)
|
|
18
|
+
this.el = el
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
handleFocus(e) {
|
|
22
|
+
this.elementTarget.classList.remove("mdc-text-field--error")
|
|
23
|
+
if (this.hasHelperLineTarget) {
|
|
24
|
+
if (this.helperLineTarget.classList.contains("mdc-text-field-helper-line--error")) {
|
|
25
|
+
this.helperLineTarget.querySelector("p").innerHTML = ""
|
|
26
|
+
}
|
|
27
|
+
this.helperLineTarget.classList.remove("mdc-text-field-helper-line--error")
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
disconnect() {
|
|
32
|
+
this.el.destroy()
|
|
33
|
+
this.el = null
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// Visit The Stimulus Handbook for more details
|
|
2
|
+
// https://stimulusjs.org/handbook/introduction
|
|
3
|
+
//
|
|
4
|
+
// This example controller works with specially annotated HTML like:
|
|
5
|
+
//
|
|
6
|
+
// <div data-controller="hello">
|
|
7
|
+
// <h1 data-target="hello.output"></h1>
|
|
8
|
+
// </div>
|
|
9
|
+
|
|
10
|
+
import { Controller } from "stimulus"
|
|
11
|
+
import { MDCTopAppBar } from "@material/top-app-bar"
|
|
12
|
+
|
|
13
|
+
export default class extends Controller {
|
|
14
|
+
connect() {
|
|
15
|
+
const el = new MDCTopAppBar(this.element)
|
|
16
|
+
this.el = el
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// Visit The Stimulus Handbook for more details
|
|
2
|
+
// https://stimulusjs.org/handbook/introduction
|
|
3
|
+
//
|
|
4
|
+
// This example controller works with specially annotated HTML like:
|
|
5
|
+
//
|
|
6
|
+
// <div data-controller="hello">
|
|
7
|
+
// <h1 data-target="hello.output"></h1>
|
|
8
|
+
// </div>
|
|
9
|
+
|
|
10
|
+
import { Controller } from "stimulus"
|
|
11
|
+
|
|
12
|
+
export default class extends Controller {
|
|
13
|
+
static targets = ["input"]
|
|
14
|
+
|
|
15
|
+
connect() {
|
|
16
|
+
const controller = this.application.getControllerForElementAndIdentifier(this.element, "mdc-chip-set")
|
|
17
|
+
const chipSet = controller.el
|
|
18
|
+
const _this = this
|
|
19
|
+
|
|
20
|
+
chipSet.listen("MDCChip:selection", function (event) {
|
|
21
|
+
_this.handleSelection(event)
|
|
22
|
+
})
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
handleSelection(event) {
|
|
26
|
+
if (event.detail.selected) {
|
|
27
|
+
const value = event.target.attributes.value.value
|
|
28
|
+
this.inputTarget.value = value
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// Visit The Stimulus Handbook for more details
|
|
2
|
+
// https://stimulusjs.org/handbook/introduction
|
|
3
|
+
//
|
|
4
|
+
// This example controller works with specially annotated HTML like:
|
|
5
|
+
//
|
|
6
|
+
// <div data-controller="hello">
|
|
7
|
+
// <h1 data-target="hello.output"></h1>
|
|
8
|
+
// </div>
|
|
9
|
+
|
|
10
|
+
import { Controller } from "stimulus"
|
|
11
|
+
|
|
12
|
+
export default class extends Controller {
|
|
13
|
+
connect() {
|
|
14
|
+
const controller = this.application.getControllerForElementAndIdentifier(this.element, "mdc-chip-set")
|
|
15
|
+
const chipSet = controller.el
|
|
16
|
+
const _this = this
|
|
17
|
+
|
|
18
|
+
chipSet.listen("MDCChip:selection", function (event) {
|
|
19
|
+
_this.handleSelection(event)
|
|
20
|
+
})
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
handleSelection(event) {
|
|
24
|
+
// console.log("event", event)
|
|
25
|
+
console.log("target", event.target)
|
|
26
|
+
const inputValue = event.target.attributes.value.value
|
|
27
|
+
console.log("inputValue", event.target)
|
|
28
|
+
console.log("detail", event.detail)
|
|
29
|
+
const dataTarget = event.target.dataset.railsChipSetFilterTarget
|
|
30
|
+
console.log("dataTarget", dataTarget)
|
|
31
|
+
const target = this.element.querySelector(`[data-target="${dataTarget}"]`)
|
|
32
|
+
console.log("target", target)
|
|
33
|
+
if (event.detail.selected) {
|
|
34
|
+
target.value = inputValue
|
|
35
|
+
} else {
|
|
36
|
+
target.value = 0
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
// Visit The Stimulus Handbook for more details
|
|
2
|
+
// https://stimulusjs.org/handbook/introduction
|
|
3
|
+
//
|
|
4
|
+
// This example controller works with specially annotated HTML like:
|
|
5
|
+
//
|
|
6
|
+
// <div data-controller="hello">
|
|
7
|
+
// <h1 data-target="hello.output"></h1>
|
|
8
|
+
// </div>
|
|
9
|
+
|
|
10
|
+
function scrollTo(element, to = 0, duration = 1000) {
|
|
11
|
+
|
|
12
|
+
const start = element.scrollTop
|
|
13
|
+
const change = to - start
|
|
14
|
+
const increment = 20
|
|
15
|
+
let currentTime = 0
|
|
16
|
+
|
|
17
|
+
const animateScroll = (() => {
|
|
18
|
+
|
|
19
|
+
currentTime += increment
|
|
20
|
+
|
|
21
|
+
const val = Math.easeInOutQuad(currentTime, start, change, duration)
|
|
22
|
+
|
|
23
|
+
element.scrollTop = val
|
|
24
|
+
|
|
25
|
+
if (currentTime < duration) {
|
|
26
|
+
setTimeout(animateScroll, increment)
|
|
27
|
+
}
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
animateScroll()
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
Math.easeInOutQuad = function (t, b, c, d) {
|
|
34
|
+
|
|
35
|
+
t /= d / 2
|
|
36
|
+
if (t < 1) return c / 2 * t * t + b
|
|
37
|
+
t--
|
|
38
|
+
return -c / 2 * (t * (t - 2) - 1) + b
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
import { Controller } from "stimulus"
|
|
43
|
+
|
|
44
|
+
export default class extends Controller {
|
|
45
|
+
connect() {
|
|
46
|
+
const formId = this.element.id
|
|
47
|
+
|
|
48
|
+
this.element.addEventListener("ajax:success", function (e, data, status, xhr) {
|
|
49
|
+
console.log("ajax:success")
|
|
50
|
+
return
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
this.element.addEventListener("ajax:error", function (e, xhr, status, error) {
|
|
54
|
+
var parser = new DOMParser()
|
|
55
|
+
var doc = parser.parseFromString(e.detail[2].responseText, "text/html")
|
|
56
|
+
var form = doc.querySelector(`form#${formId}`)
|
|
57
|
+
|
|
58
|
+
// sets the new form
|
|
59
|
+
const parentNode = e.target.parentNode
|
|
60
|
+
parentNode.replaceChild(form, e.target)
|
|
61
|
+
|
|
62
|
+
// animate to first element with error
|
|
63
|
+
const newForm = parentNode.querySelector(`form#${formId}`)
|
|
64
|
+
const elementWithError = newForm.querySelector(".mdc-text-field--error")
|
|
65
|
+
|
|
66
|
+
if (elementWithError) {
|
|
67
|
+
var content = document.querySelector("#content")
|
|
68
|
+
scrollTo(content, (elementWithError.offsetTop - content.offsetTop), 600)
|
|
69
|
+
}
|
|
70
|
+
e.stopPropagation()
|
|
71
|
+
return
|
|
72
|
+
})
|
|
73
|
+
|
|
74
|
+
this.element.addEventListener("ajax:complete", function (e, xhr, status, error) {
|
|
75
|
+
e.stopPropagation()
|
|
76
|
+
return
|
|
77
|
+
})
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
export { default as sum } from "./helpers/sum.js"
|
|
2
|
+
export * from "./helpers/sum.js"
|
|
3
|
+
|
|
4
|
+
export { default as body_class_toggler_controller } from "./controllers/body_class_toggler_controller.js"
|
|
5
|
+
export * from "./controllers/body_class_toggler_controller.js"
|
|
6
|
+
|
|
7
|
+
export { default as counter_controller } from "./controllers/counter_controller.js"
|
|
8
|
+
export * from "./controllers/counter_controller.js"
|
|
9
|
+
|
|
10
|
+
export { default as demo_dialog_controller } from "./controllers/demo_dialog_controller.js"
|
|
11
|
+
export * from "./controllers/demo_dialog_controller.js"
|
|
12
|
+
|
|
13
|
+
export { default as mdc_chip_set_controller } from "./controllers/mdc_chip_set_controller.js"
|
|
14
|
+
export * from "./controllers/mdc_chip_set_controller.js"
|
|
15
|
+
|
|
16
|
+
export { default as mdc_data_table_controller } from "./controllers/mdc_data_table_controller.js"
|
|
17
|
+
export * from "./controllers/mdc_data_table_controller.js"
|
|
18
|
+
|
|
19
|
+
export { default as mdc_form_field_controller } from "./controllers/mdc_form_field_controller.js"
|
|
20
|
+
export * from "./controllers/mdc_form_field_controller.js"
|
|
21
|
+
|
|
22
|
+
export { default as mdc_icon_toggle_controller } from "./controllers/mdc_icon_toggle_controller.js"
|
|
23
|
+
export * from "./controllers/mdc_icon_toggle_controller.js"
|
|
24
|
+
|
|
25
|
+
export { default as mdc_linear_progress_controller } from "./controllers/mdc_linear_progress_controller.js"
|
|
26
|
+
export * from "./controllers/mdc_linear_progress_controller.js"
|
|
27
|
+
|
|
28
|
+
export { default as mdc_list_controller } from "./controllers/mdc_list_controller.js"
|
|
29
|
+
export * from "./controllers/mdc_list_controller.js"
|
|
30
|
+
|
|
31
|
+
export { default as mdc_menu_controller } from "./controllers/mdc_menu_controller.js"
|
|
32
|
+
export * from "./controllers/mdc_menu_controller.js"
|
|
33
|
+
|
|
34
|
+
export { default as mdc_ripple_controller } from "./controllers/mdc_ripple_controller.js"
|
|
35
|
+
export * from "./controllers/mdc_ripple_controller.js"
|
|
36
|
+
|
|
37
|
+
export { default as mdc_select_controller } from "./controllers/mdc_select_controller.js"
|
|
38
|
+
export * from "./controllers/mdc_select_controller.js"
|
|
39
|
+
|
|
40
|
+
export { default as mdc_slider_controller } from "./controllers/mdc_slider_controller.js"
|
|
41
|
+
export * from "./controllers/mdc_slider_controller.js"
|
|
42
|
+
|
|
43
|
+
export { default as mdc_snackbar_controller } from "./controllers/mdc_snackbar_controller.js"
|
|
44
|
+
export * from "./controllers/mdc_snackbar_controller.js"
|
|
45
|
+
|
|
46
|
+
export { default as mdc_switch_controller } from "./controllers/mdc_switch_controller.js"
|
|
47
|
+
export * from "./controllers/mdc_switch_controller.js"
|
|
48
|
+
|
|
49
|
+
export { default as mdc_tab_bar_controller } from "./controllers/mdc_tab_bar_controller.js"
|
|
50
|
+
export * from "./controllers/mdc_tab_bar_controller.js"
|
|
51
|
+
|
|
52
|
+
export { default as mdc_text_field_controller } from "./controllers/mdc_text_field_controller.js"
|
|
53
|
+
export * from "./controllers/mdc_text_field_controller.js"
|
|
54
|
+
|
|
55
|
+
export { default as mdc_top_app_bar_controller } from "./controllers/mdc_top_app_bar_controller.js"
|
|
56
|
+
export * from "./controllers/mdc_top_app_bar_controller.js"
|
|
57
|
+
|
|
58
|
+
export { default as rails_chip_set_choice_controller } from "./controllers/rails_chip_set_choice_controller.js"
|
|
59
|
+
export * from "./controllers/rails_chip_set_choice_controller.js"
|
|
60
|
+
|
|
61
|
+
export { default as rails_chip_set_filter_controller } from "./controllers/rails_chip_set_filter_controller.js"
|
|
62
|
+
export * from "./controllers/rails_chip_set_filter_controller.js"
|
|
63
|
+
|
|
64
|
+
export { default as remote_form_controller } from "./controllers/remote_form_controller.js"
|
|
65
|
+
export * from "./controllers/remote_form_controller.js"
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// Material Design
|
|
2
|
+
@import "@material/typography/mdc-typography";
|
|
3
|
+
@import "@material/ripple/mdc-ripple";
|
|
4
|
+
@import "@material/top-app-bar/mdc-top-app-bar";
|
|
5
|
+
|
|
6
|
+
@import "@material/form-field/mdc-form-field";
|
|
7
|
+
@import "@material/button/mdc-button";
|
|
8
|
+
@import "@material/card/mdc-card";
|
|
9
|
+
@import "@material/checkbox/mdc-checkbox";
|
|
10
|
+
@import "@material/icon-button/mdc-icon-button";
|
|
11
|
+
@import "@material/chips/mdc-chips";
|
|
12
|
+
@import "@material/data-table/mdc-data-table"; // needs checkbox
|
|
13
|
+
@import "@material/dialog/mdc-dialog";
|
|
14
|
+
@import "@material/elevation/mdc-elevation";
|
|
15
|
+
@import "@material/fab/mdc-fab";
|
|
16
|
+
@import "@material/image-list/mdc-image-list";
|
|
17
|
+
@import "@material/layout-grid/mdc-layout-grid";
|
|
18
|
+
@import "@material/list/mdc-list";
|
|
19
|
+
@import "@material/linear-progress/mdc-linear-progress";
|
|
20
|
+
@import "@material/menu-surface/mdc-menu-surface"; //needs list
|
|
21
|
+
@import "@material/menu/mdc-menu"; //needs list
|
|
22
|
+
@import "@material/radio/mdc-radio"; // needs form field
|
|
23
|
+
@import "@material/select/mdc-select"; // needs list, menu-surface, menu
|
|
24
|
+
@import "@material/slider/mdc-slider";
|
|
25
|
+
@import "@material/snackbar/mdc-snackbar";
|
|
26
|
+
@import "@material/switch/mdc-switch";
|
|
27
|
+
|
|
28
|
+
@import "@material/tab-bar/mdc-tab-bar";
|
|
29
|
+
@import "@material/tab-scroller/mdc-tab-scroller";
|
|
30
|
+
@import "@material/tab-indicator/mdc-tab-indicator";
|
|
31
|
+
@import "@material/tab/mdc-tab";
|
|
32
|
+
|
|
33
|
+
@import "@material/textfield/mdc-text-field";
|
|
34
|
+
@import "./material_design/_custom.scss"
|