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.
Files changed (112) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +17 -5
  3. data/README.md +36 -60
  4. data/lib/matestack/ui/bootstrap/base_component.rb +11 -0
  5. data/lib/matestack/ui/bootstrap/base_vue_js_component.rb +11 -0
  6. data/{app/concepts → lib}/matestack/ui/bootstrap/components/accordion.rb +18 -16
  7. data/lib/matestack/ui/bootstrap/components/alert.js +58 -0
  8. data/lib/matestack/ui/bootstrap/components/alert.rb +43 -0
  9. data/lib/matestack/ui/bootstrap/components/avatar.rb +27 -0
  10. data/lib/matestack/ui/bootstrap/components/badge.rb +32 -0
  11. data/{app/concepts → lib}/matestack/ui/bootstrap/components/breadcrumb.rb +12 -10
  12. data/lib/matestack/ui/bootstrap/components/button.rb +71 -0
  13. data/lib/matestack/ui/bootstrap/components/button_group.rb +36 -0
  14. data/lib/matestack/ui/bootstrap/components/card.rb +105 -0
  15. data/lib/matestack/ui/bootstrap/components/carousel.js +84 -0
  16. data/lib/matestack/ui/bootstrap/components/carousel.rb +103 -0
  17. data/{app/concepts → lib}/matestack/ui/bootstrap/components/close.rb +10 -9
  18. data/lib/matestack/ui/bootstrap/components/collapse.js +89 -0
  19. data/lib/matestack/ui/bootstrap/components/collapse.rb +54 -0
  20. data/lib/matestack/ui/bootstrap/components/dropdown.js +19 -0
  21. data/{app/concepts → lib}/matestack/ui/bootstrap/components/dropdown.rb +29 -25
  22. data/lib/matestack/ui/bootstrap/components/icon.rb +21 -0
  23. data/{app/concepts → lib}/matestack/ui/bootstrap/components/list_group.rb +32 -29
  24. data/{app/concepts → lib}/matestack/ui/bootstrap/components/modal.js +32 -28
  25. data/lib/matestack/ui/bootstrap/components/modal.rb +121 -0
  26. data/{app/concepts → lib}/matestack/ui/bootstrap/components/navbar.rb +39 -30
  27. data/{app/concepts → lib}/matestack/ui/bootstrap/components/page_heading.rb +7 -5
  28. data/{app/concepts → lib}/matestack/ui/bootstrap/components/pagination.rb +11 -9
  29. data/lib/matestack/ui/bootstrap/components/popover.js +30 -0
  30. data/{app/concepts → lib}/matestack/ui/bootstrap/components/popover.rb +25 -21
  31. data/{app/concepts → lib}/matestack/ui/bootstrap/components/progress.rb +19 -19
  32. data/lib/matestack/ui/bootstrap/components/scrollspy.rb +50 -0
  33. data/lib/matestack/ui/bootstrap/components/section_card.rb +33 -0
  34. data/lib/matestack/ui/bootstrap/components/spinner.rb +35 -0
  35. data/lib/matestack/ui/bootstrap/components/tab_nav.rb +79 -0
  36. data/lib/matestack/ui/bootstrap/components/tab_nav_content.rb +35 -0
  37. data/lib/matestack/ui/bootstrap/components/toast.js +89 -0
  38. data/lib/matestack/ui/bootstrap/components/toast.rb +113 -0
  39. data/{app/concepts → lib}/matestack/ui/bootstrap/components/tooltip.js +9 -6
  40. data/{app/concepts → lib}/matestack/ui/bootstrap/components/tooltip.rb +20 -18
  41. data/{app/concepts → lib}/matestack/ui/bootstrap/content/figure.rb +4 -2
  42. data/{app/concepts → lib}/matestack/ui/bootstrap/content/smart_collection/collection.rb +22 -16
  43. data/{app/concepts → lib}/matestack/ui/bootstrap/content/smart_collection/collection.scss +0 -0
  44. data/{app/concepts → lib}/matestack/ui/bootstrap/content/smart_collection/content.rb +38 -21
  45. data/{app/concepts → lib}/matestack/ui/bootstrap/content/smart_collection/filter.rb +6 -2
  46. data/{app/concepts → lib}/matestack/ui/bootstrap/content/smart_collection/paginate.rb +16 -11
  47. data/lib/matestack/ui/bootstrap/form/checkbox.rb +88 -0
  48. data/lib/matestack/ui/bootstrap/form/input.rb +116 -0
  49. data/lib/matestack/ui/bootstrap/form/radio.rb +55 -0
  50. data/{app/concepts → lib}/matestack/ui/bootstrap/form/select.rb +18 -10
  51. data/lib/matestack/ui/bootstrap/form/submit.rb +20 -0
  52. data/lib/matestack/ui/bootstrap/form/switch.rb +30 -0
  53. data/lib/matestack/ui/bootstrap/form/textarea.rb +47 -0
  54. data/lib/matestack/ui/bootstrap/index.js +40 -0
  55. data/lib/matestack/ui/bootstrap/initialize.rb +3 -0
  56. data/lib/matestack/ui/bootstrap/layout/column.rb +49 -0
  57. data/{app/concepts → lib}/matestack/ui/bootstrap/layout/container.rb +12 -9
  58. data/lib/matestack/ui/bootstrap/layout/row.rb +25 -0
  59. data/{app/concepts → lib}/matestack/ui/bootstrap/layout/sidebar.js +10 -6
  60. data/lib/matestack/ui/bootstrap/layout/sidebar.rb +43 -0
  61. data/{app/concepts → lib}/matestack/ui/bootstrap/layout/sidebar.scss +0 -0
  62. data/{app/concepts/matestack/ui/bootstrap/apps → lib/matestack/ui/bootstrap/layouts}/admin_template.rb +18 -13
  63. data/lib/matestack/ui/bootstrap/registry.rb +173 -0
  64. data/{app/javascript/matestack-ui-bootstrap → lib/matestack/ui/bootstrap}/stylesheets/matestack-ui-bootstrap.scss +0 -0
  65. data/lib/matestack/ui/bootstrap/version.rb +1 -1
  66. data/lib/matestack/ui/bootstrap.rb +99 -17
  67. metadata +85 -80
  68. data/app/assets/images/avatar-placeholder.png +0 -0
  69. data/app/assets/images/icons/bootstrap-icons.svg +0 -1
  70. data/app/concepts/matestack/ui/bootstrap/components/alert.js +0 -53
  71. data/app/concepts/matestack/ui/bootstrap/components/alert.rb +0 -34
  72. data/app/concepts/matestack/ui/bootstrap/components/avatar.rb +0 -27
  73. data/app/concepts/matestack/ui/bootstrap/components/badge.rb +0 -30
  74. data/app/concepts/matestack/ui/bootstrap/components/button.rb +0 -69
  75. data/app/concepts/matestack/ui/bootstrap/components/button_group.rb +0 -36
  76. data/app/concepts/matestack/ui/bootstrap/components/card.rb +0 -100
  77. data/app/concepts/matestack/ui/bootstrap/components/carousel.js +0 -79
  78. data/app/concepts/matestack/ui/bootstrap/components/carousel.rb +0 -86
  79. data/app/concepts/matestack/ui/bootstrap/components/collapse.js +0 -84
  80. data/app/concepts/matestack/ui/bootstrap/components/collapse.rb +0 -43
  81. data/app/concepts/matestack/ui/bootstrap/components/dropdown.js +0 -14
  82. data/app/concepts/matestack/ui/bootstrap/components/icon.rb +0 -19
  83. data/app/concepts/matestack/ui/bootstrap/components/modal.rb +0 -106
  84. data/app/concepts/matestack/ui/bootstrap/components/popover.js +0 -26
  85. data/app/concepts/matestack/ui/bootstrap/components/scrollspy.rb +0 -48
  86. data/app/concepts/matestack/ui/bootstrap/components/section_card.rb +0 -31
  87. data/app/concepts/matestack/ui/bootstrap/components/spinner.rb +0 -31
  88. data/app/concepts/matestack/ui/bootstrap/components/tab_nav.rb +0 -83
  89. data/app/concepts/matestack/ui/bootstrap/components/tab_nav_content.rb +0 -32
  90. data/app/concepts/matestack/ui/bootstrap/components/toast.js +0 -85
  91. data/app/concepts/matestack/ui/bootstrap/components/toast.rb +0 -99
  92. data/app/concepts/matestack/ui/bootstrap/form/checkbox.rb +0 -99
  93. data/app/concepts/matestack/ui/bootstrap/form/input.rb +0 -112
  94. data/app/concepts/matestack/ui/bootstrap/form/radio.rb +0 -57
  95. data/app/concepts/matestack/ui/bootstrap/form/submit.rb +0 -21
  96. data/app/concepts/matestack/ui/bootstrap/form/switch.rb +0 -99
  97. data/app/concepts/matestack/ui/bootstrap/layout/column.rb +0 -47
  98. data/app/concepts/matestack/ui/bootstrap/layout/row.rb +0 -15
  99. data/app/concepts/matestack/ui/bootstrap/layout/sidebar.rb +0 -45
  100. data/app/concepts/matestack/ui/bootstrap/pages/devise/sign_in.rb +0 -40
  101. data/app/concepts/matestack/ui/bootstrap/registry.rb +0 -61
  102. data/app/helpers/matestack/ui/bootstrap/application_helper.rb +0 -17
  103. data/app/javascript/matestack-ui-bootstrap/index.js +0 -24
  104. data/app/javascript/packs/matestack-ui-bootstrap.js +0 -2
  105. data/app/matestack/bootstrap/form/submit.rb +0 -20
  106. data/config/routes.rb +0 -2
  107. data/config/webpack/development.js +0 -5
  108. data/config/webpack/environment.js +0 -29
  109. data/config/webpack/production.js +0 -33
  110. data/config/webpack/test.js +0 -5
  111. data/config/webpacker.yml +0 -96
  112. 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,2 +0,0 @@
1
- import '../matestack-ui-bootstrap/index'
2
- 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,2 +0,0 @@
1
- Matestack::Ui::Bootstrap::Engine.routes.draw do
2
- end
@@ -1,5 +0,0 @@
1
- process.env.NODE_ENV = process.env.NODE_ENV || 'development'
2
-
3
- const environment = require('./environment')
4
-
5
- module.exports = environment.toWebpackConfig()
@@ -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()
@@ -1,5 +0,0 @@
1
- process.env.NODE_ENV = process.env.NODE_ENV || 'development'
2
-
3
- const environment = require('./environment')
4
-
5
- module.exports = environment.toWebpackConfig()