matestack-ui-bootstrap 3.1.2 → 3.2.0.beta1
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 +4 -4
- data/lib/matestack/ui/bootstrap/components/modal.rb +1 -0
- data/lib/matestack/ui/bootstrap/components/offcanvas.js +70 -0
- data/lib/matestack/ui/bootstrap/components/offcanvas.rb +61 -0
- data/lib/matestack/ui/bootstrap/index.js +2 -0
- data/lib/matestack/ui/bootstrap/registry.rb +2 -2
- data/lib/matestack/ui/bootstrap/stylesheets/matestack-ui-bootstrap.scss +0 -1
- data/lib/matestack/ui/bootstrap/version.rb +1 -1
- data/lib/matestack/ui/bootstrap.rb +1 -0
- metadata +8 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4e2e524d1b06bb253accbeffe605bf69d001d2da8cdffd908bd73ff0b5310443
|
4
|
+
data.tar.gz: a2f16babea258baccc4c020dec5922ba38342928f0d51369f7524c02e54c17fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ddee9d2f3f7468773bedffcf320dddd4ea812c3e95dbe72d0ac254154c5d62f5f8b5a37ec2ca65722d74ec2e98c8fc775e35407d2d755c8a41ca40a41bc13419
|
7
|
+
data.tar.gz: 99469b732c22cf31eb20acc73d68eefaf3f5670c67607928996a9f73cf080458b87b1d2face5940df1739ada0c7ca33157cf2da5a07fbc6821f8a73aa3185b26
|
@@ -17,6 +17,7 @@ class Matestack::Ui::Bootstrap::Components::Modal < Matestack::Ui::Bootstrap::Ba
|
|
17
17
|
optional :static, :keyboard, :scrollable, :centered
|
18
18
|
optional :modal_dialog_class
|
19
19
|
optional :id
|
20
|
+
optional class: { as: :bs_class }
|
20
21
|
# event trigger
|
21
22
|
optional :toggle_on, :show_on, :hide_on, :handle_update_on, :dispose_on
|
22
23
|
|
@@ -0,0 +1,70 @@
|
|
1
|
+
import * as bootstrap from 'bootstrap'
|
2
|
+
import MatestackUiVueJs from 'matestack-ui-vuejs'
|
3
|
+
|
4
|
+
const offcanvasComponent = {
|
5
|
+
mixins: [MatestackUiVueJs.componentMixin],
|
6
|
+
template: MatestackUiVueJs.componentHelpers.inlineTemplate,
|
7
|
+
|
8
|
+
data() {
|
9
|
+
return {
|
10
|
+
offcanvasInstance: undefined,
|
11
|
+
};
|
12
|
+
},
|
13
|
+
|
14
|
+
methods: {
|
15
|
+
toggle: function (){
|
16
|
+
this.offcanvasInstance.toggle()
|
17
|
+
},
|
18
|
+
show: function (){
|
19
|
+
this.offcanvasInstance.show()
|
20
|
+
},
|
21
|
+
hide: function (){
|
22
|
+
this.offcanvasInstance.hide()
|
23
|
+
}
|
24
|
+
},
|
25
|
+
|
26
|
+
mounted: function() {
|
27
|
+
const self = this
|
28
|
+
const offcanvasElement = self.getElement()
|
29
|
+
self.offcanvasInstance = new bootstrap.Offcanvas(offcanvasElement)
|
30
|
+
},
|
31
|
+
|
32
|
+
created: function() {
|
33
|
+
const self = this
|
34
|
+
var eventHub = MatestackUiVueJs.eventHub;
|
35
|
+
// toggle_on event registration
|
36
|
+
if(self.props["toggle_on"] != undefined){
|
37
|
+
var toggle_events = self.props["toggle_on"].split(",")
|
38
|
+
toggle_events.forEach(toggle_event => eventHub.$on(toggle_event.trim(), self.toggle));
|
39
|
+
}
|
40
|
+
// show_on event registration
|
41
|
+
if(self.props["show_on"] != undefined){
|
42
|
+
var show_events = self.props["show_on"].split(",")
|
43
|
+
show_events.forEach(show_event => eventHub.$on(show_event.trim(), self.show));
|
44
|
+
}
|
45
|
+
// hide_on event registration
|
46
|
+
if(self.props["hide_on"] != undefined){
|
47
|
+
var hide_events = self.props["hide_on"].split(",")
|
48
|
+
hide_events.forEach(hide_event => eventHub.$on(hide_event.trim(), self.hide));
|
49
|
+
}
|
50
|
+
},
|
51
|
+
|
52
|
+
beforeUnmount: function() {
|
53
|
+
const self = this
|
54
|
+
var eventHub = MatestackUiVueJs.eventHub;
|
55
|
+
if(self.props["toggle_on"] != undefined){
|
56
|
+
var toggle_events = self.props["toggle_on"].split(",")
|
57
|
+
toggle_events.forEach(toggle_event => eventHub.$off(toggle_event.trim(), self.toggle));
|
58
|
+
}
|
59
|
+
if(self.props["show_on"] != undefined){
|
60
|
+
var show_events = self.props["show_on"].split(",")
|
61
|
+
show_events.forEach(show_event => eventHub.$off(show_event.trim(), self.show));
|
62
|
+
}
|
63
|
+
if(self.props["hide_on"] != undefined){
|
64
|
+
var hide_events = self.props["hide_on"].split(",")
|
65
|
+
hide_events.forEach(hide_event => eventHub.$off(hide_event.trim(), self.hide));
|
66
|
+
}
|
67
|
+
},
|
68
|
+
}
|
69
|
+
|
70
|
+
export default offcanvasComponent
|
@@ -0,0 +1,61 @@
|
|
1
|
+
require_relative "../base_vue_js_component"
|
2
|
+
|
3
|
+
class Matestack::Ui::Bootstrap::Components::Offcanvas < Matestack::Ui::Bootstrap::BaseVueJsComponent
|
4
|
+
|
5
|
+
vue_name 'matestack-ui-bootstrap-offcanvas'
|
6
|
+
|
7
|
+
optional :id
|
8
|
+
optional class: { as: :bs_class }
|
9
|
+
optional :placement # start, end, top, bottom - default: start
|
10
|
+
optional :scroll # true, false - default: false
|
11
|
+
optional :backdrop # true, false - default: true
|
12
|
+
optional :static_title # any string - default: ""
|
13
|
+
|
14
|
+
optional :toggle_on, :show_on, :hide_on, :handle_update_on, :dispose_on
|
15
|
+
|
16
|
+
|
17
|
+
def response
|
18
|
+
div offcanvas_attributes do
|
19
|
+
div class: "offcanvas-header" do
|
20
|
+
h5 class:"offcanvas-title", id: "#{context.id}Label", text: "#{context.static_title}"
|
21
|
+
button type: "button", class:"btn-close", "data-bs-dismiss": "offcanvas", "aria-label": "Close"
|
22
|
+
end
|
23
|
+
div class:"offcanvas-body" do
|
24
|
+
yield
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
protected
|
30
|
+
|
31
|
+
def offcanvas_attributes
|
32
|
+
attributes = {}.tap do |hash|
|
33
|
+
hash[:id] = context.id
|
34
|
+
hash[:class] = offcanvas_classes
|
35
|
+
hash[:attributes] = { 'tabindex': "-1", 'aria-labelledby': "#{context.id}Label" }
|
36
|
+
hash[:data] = {}.tap do |data|
|
37
|
+
data["bs-scroll"] = "#{context.scroll&.to_s || "false"}"
|
38
|
+
data["bs-backdrop"] = "#{context.backdrop&.to_s || "true"}"
|
39
|
+
end
|
40
|
+
end
|
41
|
+
options.merge(
|
42
|
+
attributes
|
43
|
+
)
|
44
|
+
end
|
45
|
+
|
46
|
+
def offcanvas_classes
|
47
|
+
[].tap do |classes|
|
48
|
+
classes << "offcanvas offcanvas-#{context.placement || 'start'}"
|
49
|
+
classes << context.bs_class
|
50
|
+
end.join(' ').strip
|
51
|
+
end
|
52
|
+
|
53
|
+
def vue_props
|
54
|
+
{}.tap do |props|
|
55
|
+
props[:toggle_on] = context.toggle_on
|
56
|
+
props[:show_on] = context.show_on
|
57
|
+
props[:hide_on] = context.hide_on
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
end
|
@@ -10,6 +10,7 @@ import carouselComponent from './components/carousel'
|
|
10
10
|
import collapseComponent from './components/collapse'
|
11
11
|
import dropdownComponent from './components/dropdown'
|
12
12
|
import modalComponent from './components/modal'
|
13
|
+
import offcanvasComponent from './components/offcanvas'
|
13
14
|
import popoverComponent from './components/popover'
|
14
15
|
import toastComponent from './components/toast'
|
15
16
|
import tooltipComponent from './components/tooltip'
|
@@ -23,6 +24,7 @@ const registerComponents = function(appInstance){
|
|
23
24
|
appInstance.component('matestack-ui-bootstrap-collapse', collapseComponent)
|
24
25
|
appInstance.component('matestack-ui-bootstrap-dropdown', dropdownComponent)
|
25
26
|
appInstance.component('matestack-ui-bootstrap-modal', modalComponent)
|
27
|
+
appInstance.component('matestack-ui-bootstrap-offcanvas', offcanvasComponent)
|
26
28
|
appInstance.component('matestack-ui-bootstrap-popover', popoverComponent)
|
27
29
|
appInstance.component('matestack-ui-bootstrap-toast', toastComponent)
|
28
30
|
appInstance.component('matestack-ui-bootstrap-tooltip', tooltipComponent)
|
@@ -64,8 +64,8 @@ module Matestack::Ui::Bootstrap::Registry
|
|
64
64
|
Matestack::Ui::Bootstrap::Components::Navbar.(text, options, &block)
|
65
65
|
end
|
66
66
|
|
67
|
-
def
|
68
|
-
Matestack::Ui::Bootstrap::Components::
|
67
|
+
def bs_offcanvas(text=nil, options=nil, &block)
|
68
|
+
Matestack::Ui::Bootstrap::Components::Offcanvas.(text, options, &block)
|
69
69
|
end
|
70
70
|
|
71
71
|
def bs_page_heading(text=nil, options=nil, &block)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: matestack-ui-bootstrap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.2.0.beta1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonas Jabari
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-06-
|
11
|
+
date: 2022-06-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: matestack-ui-core
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 3.
|
33
|
+
version: 3.2.0.beta.pre.1
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 3.
|
40
|
+
version: 3.2.0.beta.pre.1
|
41
41
|
description: Bootstrap v5 components for Matestack UI
|
42
42
|
email:
|
43
43
|
- jonas@matestack.io
|
@@ -74,6 +74,8 @@ files:
|
|
74
74
|
- lib/matestack/ui/bootstrap/components/modal.js
|
75
75
|
- lib/matestack/ui/bootstrap/components/modal.rb
|
76
76
|
- lib/matestack/ui/bootstrap/components/navbar.rb
|
77
|
+
- lib/matestack/ui/bootstrap/components/offcanvas.js
|
78
|
+
- lib/matestack/ui/bootstrap/components/offcanvas.rb
|
77
79
|
- lib/matestack/ui/bootstrap/components/page_heading.rb
|
78
80
|
- lib/matestack/ui/bootstrap/components/pagination.rb
|
79
81
|
- lib/matestack/ui/bootstrap/components/popover.js
|
@@ -129,9 +131,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
129
131
|
version: '0'
|
130
132
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
131
133
|
requirements:
|
132
|
-
- - "
|
134
|
+
- - ">"
|
133
135
|
- !ruby/object:Gem::Version
|
134
|
-
version:
|
136
|
+
version: 1.3.1
|
135
137
|
requirements: []
|
136
138
|
rubygems_version: 3.2.15
|
137
139
|
signing_key:
|