matestack-ui-bootstrap 1.5.1 → 3.0.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +17 -5
- data/README.md +36 -60
- data/lib/matestack/ui/bootstrap/base_component.rb +11 -0
- data/lib/matestack/ui/bootstrap/base_vue_js_component.rb +11 -0
- data/{app/concepts → lib}/matestack/ui/bootstrap/components/accordion.rb +18 -16
- data/lib/matestack/ui/bootstrap/components/alert.js +58 -0
- data/lib/matestack/ui/bootstrap/components/alert.rb +43 -0
- data/lib/matestack/ui/bootstrap/components/avatar.rb +27 -0
- data/lib/matestack/ui/bootstrap/components/badge.rb +32 -0
- data/{app/concepts → lib}/matestack/ui/bootstrap/components/breadcrumb.rb +12 -10
- data/lib/matestack/ui/bootstrap/components/button.rb +71 -0
- data/lib/matestack/ui/bootstrap/components/button_group.rb +36 -0
- data/lib/matestack/ui/bootstrap/components/card.rb +105 -0
- data/lib/matestack/ui/bootstrap/components/carousel.js +84 -0
- data/lib/matestack/ui/bootstrap/components/carousel.rb +103 -0
- data/{app/concepts → lib}/matestack/ui/bootstrap/components/close.rb +10 -9
- data/lib/matestack/ui/bootstrap/components/collapse.js +89 -0
- data/lib/matestack/ui/bootstrap/components/collapse.rb +54 -0
- data/lib/matestack/ui/bootstrap/components/dropdown.js +19 -0
- data/{app/concepts → lib}/matestack/ui/bootstrap/components/dropdown.rb +29 -25
- data/lib/matestack/ui/bootstrap/components/icon.rb +21 -0
- data/{app/concepts → lib}/matestack/ui/bootstrap/components/list_group.rb +32 -29
- data/{app/concepts → lib}/matestack/ui/bootstrap/components/modal.js +32 -28
- data/lib/matestack/ui/bootstrap/components/modal.rb +121 -0
- data/{app/concepts → lib}/matestack/ui/bootstrap/components/navbar.rb +39 -30
- data/{app/concepts → lib}/matestack/ui/bootstrap/components/page_heading.rb +7 -5
- data/{app/concepts → lib}/matestack/ui/bootstrap/components/pagination.rb +11 -9
- data/lib/matestack/ui/bootstrap/components/popover.js +30 -0
- data/{app/concepts → lib}/matestack/ui/bootstrap/components/popover.rb +25 -21
- data/{app/concepts → lib}/matestack/ui/bootstrap/components/progress.rb +19 -19
- data/lib/matestack/ui/bootstrap/components/scrollspy.rb +50 -0
- data/lib/matestack/ui/bootstrap/components/section_card.rb +33 -0
- data/lib/matestack/ui/bootstrap/components/spinner.rb +35 -0
- data/lib/matestack/ui/bootstrap/components/tab_nav.rb +79 -0
- data/lib/matestack/ui/bootstrap/components/tab_nav_content.rb +35 -0
- data/lib/matestack/ui/bootstrap/components/toast.js +89 -0
- data/lib/matestack/ui/bootstrap/components/toast.rb +113 -0
- data/{app/concepts → lib}/matestack/ui/bootstrap/components/tooltip.js +9 -6
- data/{app/concepts → lib}/matestack/ui/bootstrap/components/tooltip.rb +20 -18
- data/{app/concepts → lib}/matestack/ui/bootstrap/content/figure.rb +4 -2
- data/{app/concepts → lib}/matestack/ui/bootstrap/content/smart_collection/collection.rb +22 -16
- data/{app/concepts → lib}/matestack/ui/bootstrap/content/smart_collection/collection.scss +0 -0
- data/{app/concepts → lib}/matestack/ui/bootstrap/content/smart_collection/content.rb +38 -21
- data/{app/concepts → lib}/matestack/ui/bootstrap/content/smart_collection/filter.rb +6 -2
- data/{app/concepts → lib}/matestack/ui/bootstrap/content/smart_collection/paginate.rb +16 -11
- data/lib/matestack/ui/bootstrap/form/checkbox.rb +88 -0
- data/lib/matestack/ui/bootstrap/form/input.rb +116 -0
- data/lib/matestack/ui/bootstrap/form/radio.rb +55 -0
- data/{app/concepts → lib}/matestack/ui/bootstrap/form/select.rb +18 -10
- data/lib/matestack/ui/bootstrap/form/submit.rb +20 -0
- data/lib/matestack/ui/bootstrap/form/switch.rb +30 -0
- data/lib/matestack/ui/bootstrap/form/textarea.rb +47 -0
- data/lib/matestack/ui/bootstrap/index.js +40 -0
- data/lib/matestack/ui/bootstrap/initialize.rb +3 -0
- data/lib/matestack/ui/bootstrap/layout/column.rb +49 -0
- data/{app/concepts → lib}/matestack/ui/bootstrap/layout/container.rb +12 -9
- data/lib/matestack/ui/bootstrap/layout/row.rb +25 -0
- data/{app/concepts → lib}/matestack/ui/bootstrap/layout/sidebar.js +10 -6
- data/lib/matestack/ui/bootstrap/layout/sidebar.rb +43 -0
- data/{app/concepts → lib}/matestack/ui/bootstrap/layout/sidebar.scss +0 -0
- data/{app/concepts/matestack/ui/bootstrap/apps → lib/matestack/ui/bootstrap/layouts}/admin_template.rb +18 -13
- data/lib/matestack/ui/bootstrap/registry.rb +173 -0
- data/{app/javascript/matestack-ui-bootstrap → lib/matestack/ui/bootstrap}/stylesheets/matestack-ui-bootstrap.scss +0 -0
- data/lib/matestack/ui/bootstrap/version.rb +1 -1
- data/lib/matestack/ui/bootstrap.rb +99 -17
- metadata +85 -80
- data/app/assets/images/avatar-placeholder.png +0 -0
- data/app/assets/images/icons/bootstrap-icons.svg +0 -1
- data/app/concepts/matestack/ui/bootstrap/components/alert.js +0 -53
- data/app/concepts/matestack/ui/bootstrap/components/alert.rb +0 -34
- data/app/concepts/matestack/ui/bootstrap/components/avatar.rb +0 -27
- data/app/concepts/matestack/ui/bootstrap/components/badge.rb +0 -30
- data/app/concepts/matestack/ui/bootstrap/components/button.rb +0 -69
- data/app/concepts/matestack/ui/bootstrap/components/button_group.rb +0 -36
- data/app/concepts/matestack/ui/bootstrap/components/card.rb +0 -100
- data/app/concepts/matestack/ui/bootstrap/components/carousel.js +0 -79
- data/app/concepts/matestack/ui/bootstrap/components/carousel.rb +0 -86
- data/app/concepts/matestack/ui/bootstrap/components/collapse.js +0 -84
- data/app/concepts/matestack/ui/bootstrap/components/collapse.rb +0 -43
- data/app/concepts/matestack/ui/bootstrap/components/dropdown.js +0 -14
- data/app/concepts/matestack/ui/bootstrap/components/icon.rb +0 -19
- data/app/concepts/matestack/ui/bootstrap/components/modal.rb +0 -106
- data/app/concepts/matestack/ui/bootstrap/components/popover.js +0 -26
- data/app/concepts/matestack/ui/bootstrap/components/scrollspy.rb +0 -48
- data/app/concepts/matestack/ui/bootstrap/components/section_card.rb +0 -31
- data/app/concepts/matestack/ui/bootstrap/components/spinner.rb +0 -31
- data/app/concepts/matestack/ui/bootstrap/components/tab_nav.rb +0 -83
- data/app/concepts/matestack/ui/bootstrap/components/tab_nav_content.rb +0 -32
- data/app/concepts/matestack/ui/bootstrap/components/toast.js +0 -85
- data/app/concepts/matestack/ui/bootstrap/components/toast.rb +0 -99
- data/app/concepts/matestack/ui/bootstrap/form/checkbox.rb +0 -99
- data/app/concepts/matestack/ui/bootstrap/form/input.rb +0 -112
- data/app/concepts/matestack/ui/bootstrap/form/radio.rb +0 -57
- data/app/concepts/matestack/ui/bootstrap/form/submit.rb +0 -21
- data/app/concepts/matestack/ui/bootstrap/form/switch.rb +0 -99
- data/app/concepts/matestack/ui/bootstrap/layout/column.rb +0 -47
- data/app/concepts/matestack/ui/bootstrap/layout/row.rb +0 -15
- data/app/concepts/matestack/ui/bootstrap/layout/sidebar.rb +0 -45
- data/app/concepts/matestack/ui/bootstrap/pages/devise/sign_in.rb +0 -40
- data/app/concepts/matestack/ui/bootstrap/registry.rb +0 -61
- data/app/helpers/matestack/ui/bootstrap/application_helper.rb +0 -17
- data/app/javascript/matestack-ui-bootstrap/index.js +0 -24
- data/app/javascript/packs/matestack-ui-bootstrap.js +0 -2
- data/app/matestack/bootstrap/form/submit.rb +0 -20
- data/config/routes.rb +0 -2
- data/config/webpack/development.js +0 -5
- data/config/webpack/environment.js +0 -29
- data/config/webpack/production.js +0 -33
- data/config/webpack/test.js +0 -5
- data/config/webpacker.yml +0 -96
- data/lib/matestack/ui/bootstrap/engine.rb +0 -26
@@ -1,112 +0,0 @@
|
|
1
|
-
class Matestack::Ui::Bootstrap::Form::Input < Matestack::Ui::Core::Form::Input::Base
|
2
|
-
|
3
|
-
vue_js_component_name "matestack-ui-core-form-input"
|
4
|
-
|
5
|
-
optional :form_text
|
6
|
-
optional :disabled
|
7
|
-
optional :browse_button_text
|
8
|
-
optional :placeholder
|
9
|
-
optional :variant
|
10
|
-
optional :min
|
11
|
-
optional :max
|
12
|
-
optional :step
|
13
|
-
optional :show_value
|
14
|
-
|
15
|
-
def response
|
16
|
-
div class: "matestack-ui-bootstrap-input" do
|
17
|
-
label for: attr_key, class: "form-label", text: input_label if input_label
|
18
|
-
case type
|
19
|
-
when :range
|
20
|
-
input html_attributes.merge(attributes: vue_attributes).merge(bootstrap_range_attributes)
|
21
|
-
if show_value
|
22
|
-
div id: attr_key, class: "form-text" do
|
23
|
-
plain "{{ data['#{attr_key}'] }}"
|
24
|
-
end
|
25
|
-
end
|
26
|
-
when :file
|
27
|
-
file_input
|
28
|
-
else
|
29
|
-
input html_attributes.merge(attributes: vue_attributes).merge(bootstrap_input_attributes)
|
30
|
-
render_errors
|
31
|
-
end
|
32
|
-
render_form_text if form_text
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
def bootstrap_input_attributes
|
37
|
-
{
|
38
|
-
id: (options[:id] || attr_key),
|
39
|
-
class: (options[:class] || "") << (" form-control"),
|
40
|
-
disabled: disabled
|
41
|
-
}
|
42
|
-
end
|
43
|
-
|
44
|
-
def bootstrap_range_attributes
|
45
|
-
{
|
46
|
-
class: (options[:class] || "") << (" form-range"),
|
47
|
-
disabled: disabled,
|
48
|
-
min: min,
|
49
|
-
max: max,
|
50
|
-
steps: step
|
51
|
-
}
|
52
|
-
end
|
53
|
-
|
54
|
-
def bootstrap_file_input_attributes
|
55
|
-
{
|
56
|
-
class: (options[:class] || "") << (" form-file-input"),
|
57
|
-
disabled: disabled
|
58
|
-
}
|
59
|
-
end
|
60
|
-
|
61
|
-
def form_file_wrapper_class
|
62
|
-
case variant
|
63
|
-
when :lg
|
64
|
-
(options[:class] || "") << (" form-file form-file-lg")
|
65
|
-
when :sm
|
66
|
-
(options[:class] || "") << (" form-file form-file-sm")
|
67
|
-
else
|
68
|
-
(options[:class] || "") << (" form-file")
|
69
|
-
end
|
70
|
-
end
|
71
|
-
|
72
|
-
def file_input
|
73
|
-
div class: form_file_wrapper_class do
|
74
|
-
input html_attributes.merge(attributes: vue_attributes).merge(bootstrap_file_input_attributes)
|
75
|
-
label class: "form-file-label", for: attr_key do
|
76
|
-
span class: "form-file-text", attributes: { "v-if": "data['#{attr_key}']" } do
|
77
|
-
if multiple
|
78
|
-
span attributes: { "v-for": "file in data['#{attr_key}']" } do
|
79
|
-
plain "{{ file['name'] }}"
|
80
|
-
end
|
81
|
-
else
|
82
|
-
plain "{{ data['#{attr_key}']['name'] }}"
|
83
|
-
end
|
84
|
-
end
|
85
|
-
span class: "form-file-text", attributes: { "v-if": "!data['#{attr_key}']" } do
|
86
|
-
plain placeholder || "Choose file"
|
87
|
-
end
|
88
|
-
span class: "form-file-button", text: browse_button_text || "Browse"
|
89
|
-
end
|
90
|
-
render_errors
|
91
|
-
end
|
92
|
-
end
|
93
|
-
|
94
|
-
def render_errors
|
95
|
-
unless @included_config[:errors] == false && (errors == false || errors.nil?) || errors == false
|
96
|
-
div class: 'invalid-feedback', attributes: { 'v-for': "error in #{error_key}" } do
|
97
|
-
plain '{{ error }}'
|
98
|
-
end
|
99
|
-
end
|
100
|
-
end
|
101
|
-
|
102
|
-
def input_error_class
|
103
|
-
'is-invalid'
|
104
|
-
end
|
105
|
-
|
106
|
-
def render_form_text
|
107
|
-
div id: "form_text_for_#{attr_key}", class: "form-text" do
|
108
|
-
plain form_text
|
109
|
-
end
|
110
|
-
end
|
111
|
-
|
112
|
-
end
|
@@ -1,57 +0,0 @@
|
|
1
|
-
class Matestack::Ui::Bootstrap::Form::Radio < Matestack::Ui::Core::Form::Radio::Base
|
2
|
-
|
3
|
-
vue_js_component_name "matestack-ui-core-form-radio"
|
4
|
-
|
5
|
-
optional :form_text
|
6
|
-
optional :disabled
|
7
|
-
optional :variant
|
8
|
-
|
9
|
-
def response
|
10
|
-
div class: "matestack-ui-bootstrap-radio" do
|
11
|
-
label class: "form-label", text: input_label if input_label
|
12
|
-
|
13
|
-
radio_options.to_a.each_with_index do |item, index|
|
14
|
-
div class: "form-check #{'form-check-inline' if variant == :inline}" do
|
15
|
-
input html_attributes.merge(
|
16
|
-
attributes: vue_attributes,
|
17
|
-
type: :radio,
|
18
|
-
id: "#{id_for_item(item_value(item))}",
|
19
|
-
name: item_name(item),
|
20
|
-
value: item_value(item),
|
21
|
-
class: radio_class,
|
22
|
-
disabled: disabled
|
23
|
-
)
|
24
|
-
label class: "form-check-label", text: item_label(item), for: id_for_item(item_value(item))
|
25
|
-
if index == radio_options.to_a.size - 1
|
26
|
-
render_errors
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
render_form_text if form_text
|
31
|
-
end
|
32
|
-
|
33
|
-
end
|
34
|
-
|
35
|
-
def radio_class
|
36
|
-
(options[:class] || "") << (" form-check-input")
|
37
|
-
end
|
38
|
-
|
39
|
-
def render_form_text
|
40
|
-
div id: "form_text_for_#{attr_key}", class: "form-text" do
|
41
|
-
plain form_text
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
def render_errors
|
46
|
-
unless @included_config[:errors] == false && (errors == false || errors.nil?) || errors == false
|
47
|
-
div class: 'invalid-feedback', attributes: { 'v-for': "error in #{error_key}" } do
|
48
|
-
plain '{{ error }}'
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
|
-
def input_error_class
|
54
|
-
'is-invalid'
|
55
|
-
end
|
56
|
-
|
57
|
-
end
|
@@ -1,21 +0,0 @@
|
|
1
|
-
class Matestack::Ui::Bootstrap::Form::Submit < Matestack::Ui::Component
|
2
|
-
|
3
|
-
optional :button_variant
|
4
|
-
optional :spinner_variant
|
5
|
-
optional :text
|
6
|
-
optional :loading_text
|
7
|
-
optional :loading_class
|
8
|
-
|
9
|
-
def response
|
10
|
-
form_submit do
|
11
|
-
bs_btn type: "submit", size: options[:size], class: "#{options[:class]}", variant: button_variant || :primary, attributes: { "v-if": "!loading()" } do
|
12
|
-
plain text || "Submit"
|
13
|
-
end
|
14
|
-
bs_btn type: "submit", size: options[:size], class: "#{options[:class]} #{loading_class}", variant: button_variant || :primary, attributes: { disabled: true, "v-if": "loading()" } do
|
15
|
-
bs_spinner variant: spinner_variant || :light, size: :sm
|
16
|
-
plain loading_text || "Loading..."
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
end
|
@@ -1,99 +0,0 @@
|
|
1
|
-
class Matestack::Ui::Bootstrap::Form::Switch < Matestack::Ui::Bootstrap::Form::Checkbox
|
2
|
-
|
3
|
-
vue_js_component_name "matestack-ui-core-form-checkbox"
|
4
|
-
|
5
|
-
optional :form_text
|
6
|
-
optional :disabled
|
7
|
-
optional :variant
|
8
|
-
|
9
|
-
def response
|
10
|
-
div class: "matestack-ui-bootstrap-switch" do
|
11
|
-
label class: "form-label", text: input_label, for: attr_key if input_label && multiple?
|
12
|
-
render_options
|
13
|
-
render_errors
|
14
|
-
render_form_text unless form_text.nil? # otherwise renders empty div
|
15
|
-
# if !checkbox_options.empty?
|
16
|
-
# label for: attr_key, class: "form-label", text: input_label if input_label
|
17
|
-
# end
|
18
|
-
# if !checkbox_options.empty?
|
19
|
-
# multiple_switches
|
20
|
-
# else
|
21
|
-
# true_false_switch
|
22
|
-
# end
|
23
|
-
# render_form_text unless form_text.nil? # otherwise renders empty div
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
private
|
28
|
-
|
29
|
-
def checkbox_wrapper(options = {}, &block)
|
30
|
-
div class: "form-check form-switch #{'form-check-inline' if variant == :inline}", attributes: options[:attributes] do
|
31
|
-
yield
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
# def bs_label(text:, for_input:)
|
36
|
-
# label text: text, for: for_input, class: 'form-check-label'
|
37
|
-
# end
|
38
|
-
#
|
39
|
-
# def true_false_switch
|
40
|
-
# checkbox_wrapper do
|
41
|
-
# form_input type: :hidden, key: key, value: (false_value || 0), errors: false
|
42
|
-
# input html_attributes.merge(
|
43
|
-
# type: :checkbox,
|
44
|
-
# id: "#{id_for_item(value)}",
|
45
|
-
# # id: "#{key}", alternative to address the visible input field better?
|
46
|
-
# name: item_name(key),
|
47
|
-
# value: checked_value,
|
48
|
-
# class: 'form-check-input',
|
49
|
-
# disabled: disabled,
|
50
|
-
# attributes: vue_attributes.merge(
|
51
|
-
# ref: "input.#{attr_key}",
|
52
|
-
# )
|
53
|
-
# )
|
54
|
-
# bs_label text: input_label, for_input: id_for_item(value)
|
55
|
-
# render_errors
|
56
|
-
# end
|
57
|
-
# end
|
58
|
-
#
|
59
|
-
# def multiple_switches
|
60
|
-
# checkbox_options.to_a.each do |item|
|
61
|
-
# checkbox_wrapper do
|
62
|
-
# input html_attributes.merge(
|
63
|
-
# type: :checkbox,
|
64
|
-
# id: "#{id_for_item(item_value(item))}",
|
65
|
-
# name: item_name(item),
|
66
|
-
# value: item_value(item),
|
67
|
-
# class: 'form-check-input',
|
68
|
-
# disabled: disabled,
|
69
|
-
# attributes: vue_attributes
|
70
|
-
# )
|
71
|
-
# bs_label text: item_name(item), for_input: id_for_item(item_value(item))
|
72
|
-
# render_errors if checkbox_options.to_a.last == item
|
73
|
-
# end
|
74
|
-
# end
|
75
|
-
# end
|
76
|
-
#
|
77
|
-
# def render_errors
|
78
|
-
# unless @included_config[:errors] == false && (errors == false || errors.nil?) || errors == false
|
79
|
-
# div class: 'invalid-feedback', attributes: { 'v-for': "error in #{error_key}" } do
|
80
|
-
# plain '{{ error }}'
|
81
|
-
# end
|
82
|
-
# end
|
83
|
-
# end
|
84
|
-
#
|
85
|
-
# def input_error_class
|
86
|
-
# 'is-invalid'
|
87
|
-
# end
|
88
|
-
#
|
89
|
-
# def checkbox_options
|
90
|
-
# super || {}
|
91
|
-
# end
|
92
|
-
#
|
93
|
-
# def render_form_text
|
94
|
-
# div id: "form_text_for_#{attr_key}", class: "form-text" do
|
95
|
-
# plain form_text
|
96
|
-
# end
|
97
|
-
# end
|
98
|
-
|
99
|
-
end
|
@@ -1,47 +0,0 @@
|
|
1
|
-
class Matestack::Ui::Bootstrap::Layout::Column < Matestack::Ui::Component
|
2
|
-
|
3
|
-
COL_ATTRIBUTES = %i[default sm md lg xl xxl]
|
4
|
-
optional *COL_ATTRIBUTES
|
5
|
-
|
6
|
-
ORDER_ATTRIBUTES = %i[order order_sm order_md order_lg order_xl order_xxl]
|
7
|
-
optional *ORDER_ATTRIBUTES
|
8
|
-
|
9
|
-
OFFSET_ATTRIBUTES = %i[offset offset_sm offset_md offset_lg offset_xl offset_xxl]
|
10
|
-
optional *OFFSET_ATTRIBUTES
|
11
|
-
|
12
|
-
optional class: { as: :bs_class }
|
13
|
-
optional :align_self
|
14
|
-
|
15
|
-
def response
|
16
|
-
div col_attributes do
|
17
|
-
yield_components
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
protected
|
22
|
-
|
23
|
-
def col_attributes
|
24
|
-
html_attributes.merge(
|
25
|
-
class: col_classes,
|
26
|
-
attributes: options[:attributes]
|
27
|
-
)
|
28
|
-
end
|
29
|
-
|
30
|
-
def col_classes
|
31
|
-
classes = []
|
32
|
-
COL_ATTRIBUTES.each do |attrs|
|
33
|
-
classes << "col-#{ self.send(:"#{attrs}") }" if attrs == :default and self.send(:"#{attrs}")
|
34
|
-
classes << "col-#{attrs}-#{ self.send(:"#{attrs}") }" if attrs != :default and self.send(:"#{attrs}")
|
35
|
-
end
|
36
|
-
ORDER_ATTRIBUTES.each do |attrs|
|
37
|
-
classes << "#{attrs}-#{ self.send(:"#{attrs}") }".gsub('_', '-') if self.send(:"#{attrs}")
|
38
|
-
end
|
39
|
-
OFFSET_ATTRIBUTES.each do |attrs|
|
40
|
-
classes << "#{attrs}-#{ self.send(:"#{attrs}") }".gsub('_', '-') if self.send(:"#{attrs}")
|
41
|
-
end
|
42
|
-
classes << "align-self-#{align_self}" if align_self.present?
|
43
|
-
classes << "col" if classes.blank?
|
44
|
-
classes << bs_class
|
45
|
-
classes.join(' ').strip
|
46
|
-
end
|
47
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
class Matestack::Ui::Bootstrap::Layout::Row < Matestack::Ui::Component
|
2
|
-
def prepare
|
3
|
-
@row_classes = []
|
4
|
-
|
5
|
-
@row_classes << "align-items-#{options[:vertical]}" if options[:vertical].present?
|
6
|
-
@row_classes << "justify-content-#{options[:horizontal]}" if options[:horizontal].present?
|
7
|
-
@row_classes << "#{options[:class]}" if options[:class].present?
|
8
|
-
end
|
9
|
-
|
10
|
-
def response
|
11
|
-
div id: "#{options[:id]}", class: "row #{@row_classes.join(' ')}" do
|
12
|
-
yield_components
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
@@ -1,45 +0,0 @@
|
|
1
|
-
class Matestack::Ui::Bootstrap::Layout::Sidebar < Matestack::Ui::VueJsComponent
|
2
|
-
|
3
|
-
vue_js_component_name "matestack-ui-bootstrap-sidebar"
|
4
|
-
|
5
|
-
optional :slots
|
6
|
-
optional :sidebar_navigation_items
|
7
|
-
|
8
|
-
def response
|
9
|
-
div class: "sidebar-wrapper shadow-sm bg-white", id: "sidebar" do
|
10
|
-
nav class: 'sidebar pt-4 px-3' do
|
11
|
-
div class: "sidebar-toggler" do
|
12
|
-
bs_btn variant: :link, attributes: { "@click": "sidebarToggle" } do
|
13
|
-
bs_icon name: "list", size: 25, class: "text-muted"
|
14
|
-
end
|
15
|
-
end
|
16
|
-
div class: "sidebar-top mb-3" do
|
17
|
-
slot slots[:sidebar_top] if slots[:sidebar_top].present?
|
18
|
-
end
|
19
|
-
div class: "sidebar-navigation my-3" do
|
20
|
-
sidebar_navigation_partial
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
def sidebar_navigation_partial
|
27
|
-
div class: "list-group" do
|
28
|
-
sidebar_navigation_items.each do |item|
|
29
|
-
if item[:type] == :link
|
30
|
-
link class: "list-group-item list-group-item-action border-0 rounded", path: item[:path] do
|
31
|
-
bs_icon name: item[:icon], size: 20 if item[:icon]
|
32
|
-
span class: "ps-3", text: item[:text] if item[:text]
|
33
|
-
end
|
34
|
-
else
|
35
|
-
transition class: "list-group-item list-group-item-action border-0 rounded", path: item[:path], delay: item[:delay] || 300 do
|
36
|
-
bs_icon name: item[:icon], size: 20 if item[:icon]
|
37
|
-
span class: "ps-3", text: item[:text] if item[:text]
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
|
45
|
-
end
|
@@ -1,40 +0,0 @@
|
|
1
|
-
class Matestack::Ui::Bootstrap::Pages::Devise::SignIn < Matestack::Ui::Page
|
2
|
-
|
3
|
-
def response
|
4
|
-
bs_container class: "mt-5" do
|
5
|
-
bs_row class: "mt-5", vertical: :center, horizontal: :center do
|
6
|
-
bs_col md:4 do
|
7
|
-
login_form_partial
|
8
|
-
end
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
private
|
14
|
-
|
15
|
-
def login_form_partial
|
16
|
-
section class: "mt-5 rounded shadow-sm p-4 mb-4" do
|
17
|
-
heading size: 2, text: 'Sign in'
|
18
|
-
form form_config do
|
19
|
-
div class: "mb-3 mt-4" do
|
20
|
-
bs_form_input label: 'Email', key: :email, type: :email
|
21
|
-
end
|
22
|
-
div class: "mb-3" do
|
23
|
-
bs_form_input label: 'Password', key: :password, type: :password
|
24
|
-
end
|
25
|
-
div class: "mb-3" do
|
26
|
-
bs_form_submit text: "Sign in"
|
27
|
-
end
|
28
|
-
end
|
29
|
-
toggle show_on: 'sign_in_failure' do
|
30
|
-
plain 'Your email or password is not valid.'
|
31
|
-
end
|
32
|
-
br
|
33
|
-
small text: "Dummy user: admin@matestack.io"
|
34
|
-
br
|
35
|
-
small text: "Dummy password: password"
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
|
40
|
-
end
|
@@ -1,61 +0,0 @@
|
|
1
|
-
module Matestack::Ui::Bootstrap::Registry
|
2
|
-
|
3
|
-
COMPONENTS = {
|
4
|
-
bs_accordion: Matestack::Ui::Bootstrap::Components::Accordion,
|
5
|
-
bs_alert: Matestack::Ui::Bootstrap::Components::Alert,
|
6
|
-
bs_avatar: Matestack::Ui::Bootstrap::Components::Avatar,
|
7
|
-
bs_badge: Matestack::Ui::Bootstrap::Components::Badge,
|
8
|
-
bs_breadcrumb: Matestack::Ui::Bootstrap::Components::Breadcrumb,
|
9
|
-
bs_btn: Matestack::Ui::Bootstrap::Components::Button,
|
10
|
-
bs_btn_group: Matestack::Ui::Bootstrap::Components::ButtonGroup,
|
11
|
-
bs_card: Matestack::Ui::Bootstrap::Components::Card,
|
12
|
-
bs_carousel: Matestack::Ui::Bootstrap::Components::Carousel,
|
13
|
-
bs_close: Matestack::Ui::Bootstrap::Components::Close,
|
14
|
-
bs_collapse: Matestack::Ui::Bootstrap::Components::Collapse,
|
15
|
-
bs_dropdown: Matestack::Ui::Bootstrap::Components::Dropdown,
|
16
|
-
bs_icon: Matestack::Ui::Bootstrap::Components::Icon,
|
17
|
-
bs_list_group: Matestack::Ui::Bootstrap::Components::ListGroup,
|
18
|
-
bs_modal: Matestack::Ui::Bootstrap::Components::Modal,
|
19
|
-
bs_navbar: Matestack::Ui::Bootstrap::Components::Navbar,
|
20
|
-
bs_pagination: Matestack::Ui::Bootstrap::Components::Pagination,
|
21
|
-
bs_page_heading: Matestack::Ui::Bootstrap::Components::PageHeading,
|
22
|
-
bs_popover: Matestack::Ui::Bootstrap::Components::Popover,
|
23
|
-
bs_progress: Matestack::Ui::Bootstrap::Components::Progress,
|
24
|
-
bs_scrollspy: Matestack::Ui::Bootstrap::Components::Scrollspy,
|
25
|
-
bs_section_card: Matestack::Ui::Bootstrap::Components::SectionCard,
|
26
|
-
bs_spinner: Matestack::Ui::Bootstrap::Components::Spinner,
|
27
|
-
bs_tab_nav: Matestack::Ui::Bootstrap::Components::TabNav,
|
28
|
-
bs_tab_nav_content: Matestack::Ui::Bootstrap::Components::TabNavContent,
|
29
|
-
bs_toast: Matestack::Ui::Bootstrap::Components::Toast,
|
30
|
-
bs_tooltip: Matestack::Ui::Bootstrap::Components::Tooltip,
|
31
|
-
}
|
32
|
-
|
33
|
-
FORMS = {
|
34
|
-
bs_form_input: Matestack::Ui::Bootstrap::Form::Input,
|
35
|
-
bs_form_select: Matestack::Ui::Bootstrap::Form::Select,
|
36
|
-
bs_form_checkbox: Matestack::Ui::Bootstrap::Form::Checkbox,
|
37
|
-
bs_form_radio: Matestack::Ui::Bootstrap::Form::Radio,
|
38
|
-
bs_form_switch: Matestack::Ui::Bootstrap::Form::Switch,
|
39
|
-
bs_form_submit: Matestack::Ui::Bootstrap::Form::Submit
|
40
|
-
}
|
41
|
-
|
42
|
-
CONTENT = {
|
43
|
-
bs_figure: Matestack::Ui::Bootstrap::Content::Figure,
|
44
|
-
bs_smart_collection: Matestack::Ui::Bootstrap::Content::SmartCollection::Collection,
|
45
|
-
}
|
46
|
-
|
47
|
-
LAYOUTS = {
|
48
|
-
bs_col: Matestack::Ui::Bootstrap::Layout::Column,
|
49
|
-
bs_container: Matestack::Ui::Bootstrap::Layout::Container,
|
50
|
-
bs_row: Matestack::Ui::Bootstrap::Layout::Row,
|
51
|
-
bs_sidebar: Matestack::Ui::Bootstrap::Layout::Sidebar
|
52
|
-
}
|
53
|
-
|
54
|
-
Matestack::Ui::Core::Component::Registry.register_components(
|
55
|
-
**COMPONENTS,
|
56
|
-
**FORMS,
|
57
|
-
**CONTENT,
|
58
|
-
**LAYOUTS
|
59
|
-
)
|
60
|
-
|
61
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
#https://github.com/rails/webpacker/blob/5-x-stable/docs/engines.md
|
2
|
-
|
3
|
-
require "webpacker/helper"
|
4
|
-
|
5
|
-
module Matestack
|
6
|
-
module Ui
|
7
|
-
module Bootstrap
|
8
|
-
module ApplicationHelper
|
9
|
-
include ::Webpacker::Helper
|
10
|
-
|
11
|
-
def current_webpacker_instance
|
12
|
-
Matestack::Ui::Bootstrap::Engine.webpacker
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
@@ -1,24 +0,0 @@
|
|
1
|
-
// This file is automatically compiled by Webpack, along with any other files
|
2
|
-
// present in this directory. You're encouraged to place your actual application logic in
|
3
|
-
// a relevant structure within javascript and only use these pack files to reference
|
4
|
-
// that code so it'll be compiled.
|
5
|
-
|
6
|
-
import "./stylesheets/matestack-ui-bootstrap.scss";
|
7
|
-
|
8
|
-
import '../../concepts/matestack/ui/bootstrap/components/alert'
|
9
|
-
import '../../concepts/matestack/ui/bootstrap/components/carousel'
|
10
|
-
import '../../concepts/matestack/ui/bootstrap/components/collapse'
|
11
|
-
import '../../concepts/matestack/ui/bootstrap/components/dropdown'
|
12
|
-
import '../../concepts/matestack/ui/bootstrap/components/modal'
|
13
|
-
import '../../concepts/matestack/ui/bootstrap/components/toast'
|
14
|
-
import '../../concepts/matestack/ui/bootstrap/components/popover'
|
15
|
-
import '../../concepts/matestack/ui/bootstrap/components/tooltip'
|
16
|
-
import '../../concepts/matestack/ui/bootstrap/layout/sidebar'
|
17
|
-
import '../../concepts/matestack/ui/bootstrap/layout/sidebar.scss'
|
18
|
-
import '../../concepts/matestack/ui/bootstrap/content/smart_collection/collection.scss'
|
19
|
-
|
20
|
-
const MatestackUiBootstrap = {}
|
21
|
-
|
22
|
-
window.MatestackUiBootstrap = MatestackUiBootstrap
|
23
|
-
|
24
|
-
export default MatestackUiBootstrap
|
@@ -1,20 +0,0 @@
|
|
1
|
-
class Bootstrap::Form::Submit < Matestack::Ui::Component
|
2
|
-
|
3
|
-
optional :button_variant
|
4
|
-
optional :spinner_variant
|
5
|
-
optional :text
|
6
|
-
optional :loading_text
|
7
|
-
|
8
|
-
def response
|
9
|
-
form_submit do
|
10
|
-
btn size: options[:size], class: "#{options[:class]}", variant: button_variant || :primary, attributes: { "v-if": "!loading" } do
|
11
|
-
plain text || "Submit"
|
12
|
-
end
|
13
|
-
btn size: options[:size], class: "#{options[:class_loading]}", variant: button_variant || :primary, attributes: { disabled: true, "v-if": "loading" } do
|
14
|
-
spinner variant: spinner_variant || :light, size: :sm
|
15
|
-
plain loading_text || "Loading..."
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
end
|
data/config/routes.rb
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
const { environment } = require('@rails/webpacker')
|
2
|
-
|
3
|
-
environment.config.merge({
|
4
|
-
externals: {
|
5
|
-
"matestack-ui-core": "matestack-ui-core",
|
6
|
-
"chart.js": "chart.js",
|
7
|
-
"bootstrap": "bootstrap",
|
8
|
-
"flatpickr": "flatpickr"
|
9
|
-
}
|
10
|
-
})
|
11
|
-
|
12
|
-
// Remove the digest from the output js filename.
|
13
|
-
// https://github.com/matestack/matestack-ui-core/issues/343#issuecomment-581149092
|
14
|
-
//
|
15
|
-
environment.config.set("output.filename", chunkData => {
|
16
|
-
return "[name].js"
|
17
|
-
})
|
18
|
-
|
19
|
-
// Remove the digest from the output css filename.
|
20
|
-
// https://github.com/matestack/matestack-ui-core/issues/343#issuecomment-581149092
|
21
|
-
//
|
22
|
-
// Inspect with:
|
23
|
-
//
|
24
|
-
// console.log(environment.plugins)
|
25
|
-
//
|
26
|
-
const miniCssExtractPlugin = environment.plugins.get('MiniCssExtract')
|
27
|
-
miniCssExtractPlugin.options.filename = "[name].css"
|
28
|
-
|
29
|
-
module.exports = environment
|
@@ -1,33 +0,0 @@
|
|
1
|
-
process.env.NODE_ENV = process.env.NODE_ENV || 'production'
|
2
|
-
|
3
|
-
const environment = require('./environment')
|
4
|
-
|
5
|
-
// Add `.min` to the production versions of the output files.
|
6
|
-
// https://github.com/matestack/matestack-ui-core/issues/343#issuecomment-580246554
|
7
|
-
// https://github.com/matestack/matestack-ui-core/issues/343#issuecomment-581149092
|
8
|
-
//
|
9
|
-
environment.config.set("output.filename", chunkData => {
|
10
|
-
return "[name].min.js"
|
11
|
-
})
|
12
|
-
const miniCssExtractPlugin = environment.plugins.get('MiniCssExtract')
|
13
|
-
miniCssExtractPlugin.options.filename = "[name].min.css"
|
14
|
-
|
15
|
-
// In order to have babel's es5 (ie11) transpiling be applied to all of the
|
16
|
-
// js code, it needs to be included in the loader paths.
|
17
|
-
// https://github.com/rails/webpacker/blob/master/docs/webpack.md
|
18
|
-
// https://github.com/matestack/matestack-ui-core/issues/238
|
19
|
-
//
|
20
|
-
const babelLoader = environment.loaders.get('babel')
|
21
|
-
delete babelLoader.exclude
|
22
|
-
const path = require('path')
|
23
|
-
const matestackUiBootstrapRootPath = path.resolve(__dirname, '../..')
|
24
|
-
babelLoader.include.push(path.resolve(matestackUiBootstrapRootPath, 'app/concepts/matestack/ui/bootstrap'))
|
25
|
-
babelLoader.include.push(path.resolve(matestackUiBootstrapRootPath, 'node_modules'))
|
26
|
-
|
27
|
-
// We also need to tell babel where to find matestack-ui-material if we are using `npm link`.
|
28
|
-
// Otherwise, it won't follow the symlink to `node_modules/matestack-ui-core`.
|
29
|
-
//
|
30
|
-
// const matestackUiCoreRootPath = path.resolve(require.resolve('matestack-ui-core'), '../../../')
|
31
|
-
// babelLoader.include.push(matestackUiCoreRootPath)
|
32
|
-
|
33
|
-
module.exports = environment.toWebpackConfig()
|