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,6 +1,6 @@
1
- class Matestack::Ui::Bootstrap::Form::Select < Matestack::Ui::Core::Form::Select::Base
1
+ class Matestack::Ui::Bootstrap::Form::Select < Matestack::Ui::VueJs::Components::Form::Select
2
2
 
3
- vue_js_component_name "matestack-ui-core-form-select"
3
+ vue_name "matestack-ui-core-form-select"
4
4
 
5
5
  optional :variant
6
6
  optional :size
@@ -8,8 +8,8 @@ class Matestack::Ui::Bootstrap::Form::Select < Matestack::Ui::Core::Form::Select
8
8
 
9
9
  def response
10
10
  div class: "matestack-ui-bootstrap-form-select" do
11
- label for: attr_key, class: "form-label", text: input_label if input_label
12
- select select_attributes.merge({ id: (options[:id] || attr_key), class: form_select_class, size: size_class }) do
11
+ label input_label, ":for": id, class: "form-label" if input_label
12
+ select select_attributes.merge(bootstrap_select_attributes) do
13
13
  render_options
14
14
  end
15
15
  render_errors
@@ -17,8 +17,16 @@ class Matestack::Ui::Bootstrap::Form::Select < Matestack::Ui::Core::Form::Select
17
17
  end
18
18
  end
19
19
 
20
+ def bootstrap_select_attributes
21
+ {
22
+ class: form_select_class,
23
+ size: size_class,
24
+ disabled: context.disabled
25
+ }
26
+ end
27
+
20
28
  def form_select_class
21
- case variant
29
+ case context.variant
22
30
  when :lg
23
31
  (options[:class] || "") << (" form-select form-select-lg")
24
32
  when :sm
@@ -29,12 +37,12 @@ class Matestack::Ui::Bootstrap::Form::Select < Matestack::Ui::Core::Form::Select
29
37
  end
30
38
 
31
39
  def size_class
32
- size
40
+ context.size
33
41
  end
34
42
 
35
43
  def render_errors
36
- unless @included_config[:errors] == false && (errors == false || errors.nil?) || errors == false
37
- div class: 'invalid-feedback', attributes: { 'v-for': "error in #{error_key}" } do
44
+ if display_errors?
45
+ div class: 'invalid-feedback', 'v-for': "error in #{error_key}" do
38
46
  plain '{{ error }}'
39
47
  end
40
48
  end
@@ -45,8 +53,8 @@ class Matestack::Ui::Bootstrap::Form::Select < Matestack::Ui::Core::Form::Select
45
53
  end
46
54
 
47
55
  def render_form_text
48
- div id: "form_text_for_#{attr_key}", class: "form-text" do
49
- plain form_text
56
+ div class: "form-text form-text-for-#{attribute_key}" do
57
+ plain context.form_text
50
58
  end
51
59
  end
52
60
 
@@ -0,0 +1,20 @@
1
+ class Matestack::Ui::Bootstrap::Form::Submit < Matestack::Ui::Bootstrap::BaseComponent
2
+
3
+ optional :button_variant
4
+ optional :spinner_variant
5
+ optional :loading_text
6
+ optional :loading_class
7
+ optional :size
8
+ optional class: { as: :bs_class }
9
+
10
+ def response
11
+ bs_btn type: "submit", size:context.size, class: "#{context.bs_class}", variant: context.button_variant || :primary, "v-if": "!vc.loading" do
12
+ plain context.text || "Submit"
13
+ end
14
+ bs_btn type: "submit", size: context.size, class: "#{context.bs_class} #{context.loading_class}", variant: context.button_variant || :primary, disabled: true, "v-if": "vc.loading" do
15
+ bs_spinner variant: context.spinner_variant || :light, size: :sm
16
+ plain context.loading_text || "Loading..."
17
+ end
18
+ end
19
+
20
+ end
@@ -0,0 +1,30 @@
1
+ class Matestack::Ui::Bootstrap::Form::Switch < Matestack::Ui::Bootstrap::Form::Checkbox
2
+
3
+ vue_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 input_label, class: "form-label", ":for": id if input_label && multiple?
12
+ render_options
13
+ render_errors
14
+ plain context.form_text
15
+ render_form_text if context.form_text
16
+ end
17
+ end
18
+
19
+ private
20
+
21
+ def checkbox_wrapper(options = {}, &block)
22
+ wrapper_attributes = (options[:attributes] || {}).merge({
23
+ class: "form-check form-switch #{'form-check-inline' if context.variant == :inline}"
24
+ })
25
+ div wrapper_attributes do
26
+ yield if block_given?
27
+ end
28
+ end
29
+
30
+ end
@@ -0,0 +1,47 @@
1
+ class Matestack::Ui::Bootstrap::Form::Textarea < Matestack::Ui::VueJs::Components::Form::Textarea
2
+
3
+ vue_name "matestack-ui-core-form-textarea"
4
+
5
+ optional :form_text
6
+ optional :disabled
7
+ optional :placeholder
8
+ optional :rows
9
+ optional :cols
10
+
11
+ def response
12
+ div class: "matestack-ui-bootstrap-textarea" do
13
+ label input_label, ":for": id, class: "form-label" if input_label
14
+ textarea options.merge(textarea_attributes).merge(bootstrap_textarea_attributes)
15
+ render_errors
16
+ render_form_text if context.form_text
17
+ end
18
+ end
19
+
20
+ def bootstrap_textarea_attributes
21
+ {
22
+ class: (options[:class] || "") << (" form-control"),
23
+ rows: context.rows,
24
+ cols: context.cols,
25
+ disabled: context.disabled
26
+ }
27
+ end
28
+
29
+ def render_errors
30
+ if display_errors?
31
+ div class: 'invalid-feedback', 'v-for': "error in #{error_key}" do
32
+ plain '{{ error }}'
33
+ end
34
+ end
35
+ end
36
+
37
+ def input_error_class
38
+ 'is-invalid'
39
+ end
40
+
41
+ def render_form_text
42
+ div class: "form-text form-text-for-#{attribute_key}" do
43
+ plain context.form_text
44
+ end
45
+ end
46
+
47
+ end
@@ -0,0 +1,40 @@
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 alertComponent from './components/alert'
9
+ import carouselComponent from './components/carousel'
10
+ import collapseComponent from './components/collapse'
11
+ import dropdownComponent from './components/dropdown'
12
+ import modalComponent from './components/modal'
13
+ import popoverComponent from './components/popover'
14
+ import toastComponent from './components/toast'
15
+ import tooltipComponent from './components/tooltip'
16
+ import sidebarComponent from './layout/sidebar'
17
+ import './layout/sidebar.scss'
18
+ import './content/smart_collection/collection.scss'
19
+
20
+ const registerComponents = function(appInstance){
21
+ appInstance.component('matestack-ui-bootstrap-alert', alertComponent)
22
+ appInstance.component('matestack-ui-bootstrap-carousel', carouselComponent)
23
+ appInstance.component('matestack-ui-bootstrap-collapse', collapseComponent)
24
+ appInstance.component('matestack-ui-bootstrap-dropdown', dropdownComponent)
25
+ appInstance.component('matestack-ui-bootstrap-modal', modalComponent)
26
+ appInstance.component('matestack-ui-bootstrap-popover', popoverComponent)
27
+ appInstance.component('matestack-ui-bootstrap-toast', toastComponent)
28
+ appInstance.component('matestack-ui-bootstrap-tooltip', tooltipComponent)
29
+ appInstance.component('matestack-ui-bootstrap-sidebar', sidebarComponent)
30
+
31
+ return appInstance
32
+ }
33
+
34
+ const MatestackUiBootstrap = {
35
+ registerComponents
36
+ }
37
+
38
+ window.MatestackUiBootstrap = MatestackUiBootstrap
39
+
40
+ export default MatestackUiBootstrap
@@ -0,0 +1,3 @@
1
+ class Matestack::Ui::Core::Base
2
+ include Matestack::Ui::Bootstrap::Registry
3
+ end
@@ -0,0 +1,49 @@
1
+ require_relative "../base_component"
2
+
3
+ class Matestack::Ui::Bootstrap::Layout::Column < Matestack::Ui::Bootstrap::BaseComponent
4
+
5
+ COL_ATTRIBUTES = %i[default sm md lg xl xxl]
6
+ optional *COL_ATTRIBUTES
7
+
8
+ ORDER_ATTRIBUTES = %i[order order_sm order_md order_lg order_xl order_xxl]
9
+ optional *ORDER_ATTRIBUTES
10
+
11
+ OFFSET_ATTRIBUTES = %i[offset offset_sm offset_md offset_lg offset_xl offset_xxl]
12
+ optional *OFFSET_ATTRIBUTES
13
+
14
+ optional class: { as: :bs_class }
15
+ optional :align_self
16
+
17
+ def response
18
+ div col_attributes do
19
+ yield if block_given?
20
+ end
21
+ end
22
+
23
+ protected
24
+
25
+ def col_attributes
26
+ options.merge(
27
+ class: col_classes
28
+ )
29
+ end
30
+
31
+ def col_classes
32
+ classes = []
33
+ COL_ATTRIBUTES.each do |attrs|
34
+ classes << "col-#{ context.send("#{attrs}") }" if attrs == :default and context.send("#{attrs}")
35
+ classes << "col-#{attrs}-#{ context.send("#{attrs}") }" if attrs != :default and context.send("#{attrs}")
36
+ end
37
+ ORDER_ATTRIBUTES.each do |attrs|
38
+ classes << "#{attrs}-#{ context.send("#{attrs}") }".gsub('_', '-') if context.send("#{attrs}")
39
+ end
40
+ OFFSET_ATTRIBUTES.each do |attrs|
41
+ classes << "#{attrs}-#{ context.send("#{attrs}") }".gsub('_', '-') if context.send("#{attrs}")
42
+ end
43
+ classes << "align-self-#{context.align_self}" if context.align_self.present?
44
+ classes << "col" if classes.blank?
45
+ classes << context.bs_class
46
+ classes.join(' ').strip
47
+ end
48
+
49
+ end
@@ -1,25 +1,28 @@
1
- class Matestack::Ui::Bootstrap::Layout::Container < Matestack::Ui::Component
1
+ require_relative "../base_component"
2
2
 
3
- optional :size, class: { as: :bs_class }
3
+ class Matestack::Ui::Bootstrap::Layout::Container < Matestack::Ui::Bootstrap::BaseComponent
4
4
 
5
- def response
5
+ optional :size
6
+
7
+ def response
6
8
  div container_attributes do
7
- yield_components
9
+ yield
8
10
  end
9
11
  end
10
12
 
11
13
  protected
12
-
14
+
13
15
  def container_attributes
14
- html_attributes.merge(
16
+ options.merge(
15
17
  class: container_classes
16
18
  )
17
19
  end
18
20
 
19
21
  def container_classes
20
22
  [].tap do |classes|
21
- classes << (size.present? ? "container-#{size}" : "container")
22
- classes << bs_class
23
+ classes << (context.size.present? ? "container-#{context.size}" : "container")
24
+ classes << options[:class]
23
25
  end.join(' ').strip
24
26
  end
25
- end
27
+
28
+ end
@@ -0,0 +1,25 @@
1
+ require_relative "../base_component"
2
+
3
+ class Matestack::Ui::Bootstrap::Layout::Row < Matestack::Ui::Bootstrap::BaseComponent
4
+
5
+ optional :vertical
6
+ optional :horizontal
7
+ optional class: { as: :bs_class }
8
+
9
+ def response
10
+ div options.merge(class: row_classes) do
11
+ yield if block_given?
12
+ end
13
+ end
14
+
15
+ def row_classes
16
+ classes = ["row"]
17
+
18
+ classes << "align-items-#{context.vertical}" if context.vertical.present?
19
+ classes << "justify-content-#{context.horizontal}" if context.horizontal.present?
20
+ classes << "#{context.bs_class}" if context.bs_class.present?
21
+
22
+ classes.join(' ')
23
+ end
24
+
25
+ end
@@ -1,7 +1,9 @@
1
- const bootstrap = require('bootstrap')
1
+ import * as bootstrap from 'bootstrap'
2
+ import MatestackUiVueJs from 'matestack-ui-vuejs'
2
3
 
3
- MatestackUiCore.Vue.component('matestack-ui-bootstrap-sidebar', {
4
- mixins: [MatestackUiCore.componentMixin],
4
+ const sidebarComponent = {
5
+ mixins: [MatestackUiVueJs.componentMixin],
6
+ template: MatestackUiVueJs.componentHelpers.inlineTemplate,
5
7
 
6
8
  data() {
7
9
  return {
@@ -49,16 +51,18 @@ MatestackUiCore.Vue.component('matestack-ui-bootstrap-sidebar', {
49
51
  }
50
52
  window.addEventListener('resize', this.resizeCallback);
51
53
  var self = this;
52
- MatestackUiCore.matestackEventHub.$on("page_loaded", function(){
54
+ MatestackUiVueJs.eventHub.$on("page_loaded", function(){
53
55
  if (window.innerWidth <= 992){
54
56
  self.closeSideBar();
55
57
  }
56
58
  })
57
- MatestackUiCore.matestackEventHub.$on("page_loading_triggered", function(){
59
+ MatestackUiVueJs.eventHub.$on("page_loading_triggered", function(){
58
60
  if (window.innerWidth <= 992){
59
61
  self.closeSideBar();
60
62
  }
61
63
  })
62
64
  }
63
65
 
64
- });
66
+ }
67
+
68
+ export default sidebarComponent
@@ -0,0 +1,43 @@
1
+ require_relative "../base_vue_js_component"
2
+
3
+ class Matestack::Ui::Bootstrap::Layout::Sidebar < Matestack::Ui::Bootstrap::BaseVueJsComponent
4
+
5
+ vue_name "matestack-ui-bootstrap-sidebar"
6
+
7
+ optional :sidebar_navigation_items
8
+
9
+ def response
10
+ nav class: 'sidebar pt-4 px-3 shadow-sm bg-white' do
11
+ div class: "sidebar-toggler" do
12
+ bs_btn variant: :link, "@click": "vc.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 :sidebar_top if slots && 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
+
25
+ def sidebar_navigation_partial
26
+ div class: "list-group" do
27
+ context.sidebar_navigation_items.each do |item|
28
+ if item[:type] == :link
29
+ a class: "list-group-item list-group-item-action border-0 rounded", href: item[:path] do
30
+ bs_icon name: item[:icon], size: 20 if item[:icon]
31
+ span item[:text], class: "ps-3" if item[:text]
32
+ end
33
+ else
34
+ transition class: "list-group-item list-group-item-action border-0 rounded", path: item[:path], delay: item[:delay] || 300 do
35
+ bs_icon name: item[:icon], size: 20 if item[:icon]
36
+ span item[:text], class: "ps-3" if item[:text]
37
+ end
38
+ end
39
+ end
40
+ end
41
+ end
42
+
43
+ end
@@ -1,22 +1,30 @@
1
- class Matestack::Ui::Bootstrap::Apps::AdminTemplate < Matestack::Ui::App
1
+ require_relative "../registry"
2
2
 
3
- def response
3
+ class Matestack::Ui::Bootstrap::Layouts::AdminTemplate < Matestack::Ui::Layout
4
+
5
+ def response(&block)
6
+ matestack_vue_js_app do
7
+ body_response(&block)
8
+ end
9
+ end
10
+
11
+ def body_response(&block)
4
12
  div class: "d-flex flex-row" do
5
13
  if should_show_sidebar?
6
- bs_sidebar sidebar_navigation_items: sidebar_navigation_items, slots: { sidebar_top: sidebar_top_slot }
14
+ div id: "sidebar", class: "sidebar-wrapper" do
15
+ bs_sidebar sidebar_navigation_items: sidebar_navigation_items, slots: { sidebar_top: method(:sidebar_top_slot) }
16
+ end
7
17
  end
8
18
  div id: "content", class: "content-wrapper w-100 #{content_background_class}" do
9
19
  if should_show_navbar?
10
20
  bs_container do
11
- bs_navbar brand: navbar_brand_config, items: navbar_items, class: "pt-4 #{'ps-5' if should_show_sidebar?}", collapse_class: "text-end text-lg-start pe-3" do
12
- # div class: "d-flex" do
13
- # navbar_end_partial if self.respond_to?(:navbar_end_partial)
14
- # end
15
- end
21
+ bs_navbar brand: navbar_brand_config, items: navbar_items, class: "pt-4 #{'ps-5' if should_show_sidebar?}", collapse_class: "text-end text-lg-start pe-3"
16
22
  end
17
23
  end
18
24
  bs_container class: "my-5 px-4 pt-5" do
19
- yield_page slots: { loading_state: loading_state_slot }
25
+ page_switch do
26
+ yield if block_given?
27
+ end
20
28
  end
21
29
  end
22
30
  end
@@ -40,9 +48,7 @@ class Matestack::Ui::Bootstrap::Apps::AdminTemplate < Matestack::Ui::App
40
48
  end
41
49
 
42
50
  def sidebar_top_slot
43
- slot do
44
- sidebar_top_partial if self.respond_to?(:sidebar_top_partial)
45
- end
51
+ sidebar_top_partial if self.respond_to?(:sidebar_top_partial)
46
52
  end
47
53
 
48
54
  def toasts_partial
@@ -81,5 +87,4 @@ class Matestack::Ui::Bootstrap::Apps::AdminTemplate < Matestack::Ui::App
81
87
  "bg-light"
82
88
  end
83
89
 
84
-
85
90
  end
@@ -0,0 +1,173 @@
1
+ module Matestack::Ui::Bootstrap::Registry
2
+
3
+ def bs_accordion(text=nil, options=nil, &block)
4
+ Matestack::Ui::Bootstrap::Components::Accordion.(text, options, &block)
5
+ end
6
+
7
+ def bs_alert(text=nil, options=nil, &block)
8
+ Matestack::Ui::Bootstrap::Components::Alert.(text, options, &block)
9
+ end
10
+
11
+ def bs_avatar(text=nil, options=nil, &block)
12
+ Matestack::Ui::Bootstrap::Components::Avatar.(text, options, &block)
13
+ end
14
+
15
+ def bs_badge(text=nil, options=nil, &block)
16
+ Matestack::Ui::Bootstrap::Components::Badge.(text, options, &block)
17
+ end
18
+
19
+ def bs_breadcrumb(text=nil, options=nil, &block)
20
+ Matestack::Ui::Bootstrap::Components::Breadcrumb.(text, options, &block)
21
+ end
22
+
23
+ def bs_btn(text=nil, options=nil, &block)
24
+ Matestack::Ui::Bootstrap::Components::Button.(text, options, &block)
25
+ end
26
+
27
+ def bs_btn_group(text=nil, options=nil, &block)
28
+ Matestack::Ui::Bootstrap::Components::ButtonGroup.(text, options, &block)
29
+ end
30
+
31
+ def bs_card(text=nil, options=nil, &block)
32
+ Matestack::Ui::Bootstrap::Components::Card.(text, options, &block)
33
+ end
34
+
35
+ def bs_carousel(text=nil, options=nil, &block)
36
+ Matestack::Ui::Bootstrap::Components::Carousel.(text, options, &block)
37
+ end
38
+
39
+ def bs_close(text=nil, options=nil, &block)
40
+ Matestack::Ui::Bootstrap::Components::Close.(text, options, &block)
41
+ end
42
+
43
+ def bs_collapse(text=nil, options=nil, &block)
44
+ Matestack::Ui::Bootstrap::Components::Collapse.(text, options, &block)
45
+ end
46
+
47
+ def bs_dropdown(text=nil, options=nil, &block)
48
+ Matestack::Ui::Bootstrap::Components::Dropdown.(text, options, &block)
49
+ end
50
+
51
+ def bs_icon(text=nil, options=nil, &block)
52
+ Matestack::Ui::Bootstrap::Components::Icon.(text, options, &block)
53
+ end
54
+
55
+ def bs_list_group(text=nil, options=nil, &block)
56
+ Matestack::Ui::Bootstrap::Components::ListGroup.(text, options, &block)
57
+ end
58
+
59
+ def bs_modal(text=nil, options=nil, &block)
60
+ Matestack::Ui::Bootstrap::Components::Modal.(text, options, &block)
61
+ end
62
+
63
+ def bs_navbar(text=nil, options=nil, &block)
64
+ Matestack::Ui::Bootstrap::Components::Navbar.(text, options, &block)
65
+ end
66
+
67
+ def bs_pagination(text=nil, options=nil, &block)
68
+ Matestack::Ui::Bootstrap::Components::Pagination.(text, options, &block)
69
+ end
70
+
71
+ def bs_page_heading(text=nil, options=nil, &block)
72
+ Matestack::Ui::Bootstrap::Components::PageHeading.(text, options, &block)
73
+ end
74
+
75
+ def bs_popover(text=nil, options=nil, &block)
76
+ Matestack::Ui::Bootstrap::Components::Popover.(text, options, &block)
77
+ end
78
+
79
+ def bs_progress(text=nil, options=nil, &block)
80
+ Matestack::Ui::Bootstrap::Components::Progress.(text, options, &block)
81
+ end
82
+
83
+ def bs_scrollspy(text=nil, options=nil, &block)
84
+ Matestack::Ui::Bootstrap::Components::Scrollspy.(text, options, &block)
85
+ end
86
+
87
+ def bs_section_card(text=nil, options=nil, &block)
88
+ Matestack::Ui::Bootstrap::Components::SectionCard.(text, options, &block)
89
+ end
90
+
91
+ def bs_spinner(text=nil, options=nil, &block)
92
+ Matestack::Ui::Bootstrap::Components::Spinner.(text, options, &block)
93
+ end
94
+
95
+ def bs_tab_nav(text=nil, options=nil, &block)
96
+ Matestack::Ui::Bootstrap::Components::TabNav.(text, options, &block)
97
+ end
98
+
99
+ def bs_tab_nav_content(text=nil, options=nil, &block)
100
+ Matestack::Ui::Bootstrap::Components::TabNavContent.(text, options, &block)
101
+ end
102
+
103
+ def bs_toast(text=nil, options=nil, &block)
104
+ Matestack::Ui::Bootstrap::Components::Toast.(text, options, &block)
105
+ end
106
+
107
+ def bs_tooltip(text=nil, options=nil, &block)
108
+ Matestack::Ui::Bootstrap::Components::Tooltip.(text, options, &block)
109
+ end
110
+
111
+
112
+
113
+ def bs_form_input(text=nil, options=nil, &block)
114
+ Matestack::Ui::Bootstrap::Form::Input.(text, options, &block)
115
+ end
116
+
117
+ def bs_form_textarea(text=nil, options=nil, &block)
118
+ Matestack::Ui::Bootstrap::Form::Textarea.(text, options, &block)
119
+ end
120
+
121
+ def bs_form_select(text=nil, options=nil, &block)
122
+ Matestack::Ui::Bootstrap::Form::Select.(text, options, &block)
123
+ end
124
+
125
+ def bs_form_checkbox(text=nil, options=nil, &block)
126
+ Matestack::Ui::Bootstrap::Form::Checkbox.(text, options, &block)
127
+ end
128
+
129
+ def bs_form_radio(text=nil, options=nil, &block)
130
+ Matestack::Ui::Bootstrap::Form::Radio.(text, options, &block)
131
+ end
132
+
133
+ def bs_form_switch(text=nil, options=nil, &block)
134
+ Matestack::Ui::Bootstrap::Form::Switch.(text, options, &block)
135
+ end
136
+
137
+ def bs_form_submit(text=nil, options=nil, &block)
138
+ Matestack::Ui::Bootstrap::Form::Submit.(text, options, &block)
139
+ end
140
+
141
+
142
+
143
+
144
+ def bs_figure(text=nil, options=nil, &block)
145
+ Matestack::Ui::Bootstrap::Content::Figure.(text, options, &block)
146
+ end
147
+
148
+ def bs_smart_collection(text=nil, options=nil, &block)
149
+ Matestack::Ui::Bootstrap::Content::SmartCollection::Collection.(text, options, &block)
150
+ end
151
+
152
+
153
+
154
+
155
+ def bs_col(text=nil, options=nil, &block)
156
+ Matestack::Ui::Bootstrap::Layout::Column.(text, options, &block)
157
+ end
158
+
159
+ def bs_container(text=nil, options=nil, &block)
160
+ Matestack::Ui::Bootstrap::Layout::Container.(text, options, &block)
161
+ end
162
+
163
+ def bs_row(text=nil, options=nil, &block)
164
+ Matestack::Ui::Bootstrap::Layout::Row.(text, options, &block)
165
+ end
166
+
167
+ def bs_sidebar(text=nil, options=nil, &block)
168
+ Matestack::Ui::Bootstrap::Layout::Sidebar.(text, options, &block)
169
+ end
170
+
171
+
172
+
173
+ end
@@ -1,7 +1,7 @@
1
1
  module Matestack
2
2
  module Ui
3
3
  module Bootstrap
4
- VERSION = '1.5.1'
4
+ VERSION = '3.0.0.rc1'
5
5
  end
6
6
  end
7
7
  end