satis 1.0.70 → 1.0.75
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/components/satis/card/component.html.slim +6 -6
- data/app/components/satis/menu/component.html.slim +3 -3
- data/app/components/satis/menu/component.scss +9 -0
- data/app/components/satis/menu/component_controller.js +2 -0
- data/app/components/satis/menu_item/component.html.slim +2 -2
- data/app/components/satis/tab/component.rb +6 -1
- data/app/components/satis/tabs/component.html.slim +2 -2
- data/app/components/satis/tabs/component.scss +19 -1
- data/app/components/satis/tabs/component_controller.js +1 -1
- data/lib/satis/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e8bb27aace7817e26b12e3dc2d45f998cc8115681e7ae457988bdf417da6a237
|
4
|
+
data.tar.gz: 444726850e8e2d89b7cd4dc36eee15be4f92a49b24af5128a7b2e86996790309
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5395dd96507833c0f3100f1851d3d75375d45fab2c2fb3d37cbc1d40f26f177b25db14dc376a98b60a85d1533cc58b46ea72def4f3e27e2bea77233c3d1b259b
|
7
|
+
data.tar.gz: 6c4116e85019189aad9f18ddc3bb61e04122328217b80bbeccf688ad3fe3886b66047633af3c4e741d6574f6059316fe79a1f1c117187933ee353035479a46a1
|
@@ -32,21 +32,21 @@
|
|
32
32
|
- tabs.each do |tab|
|
33
33
|
option selected=tab.selected? = t(tab.name, scope: [:tabs])
|
34
34
|
.hidden.sm:block
|
35
|
-
nav.-mb-px.flex.space-x-
|
35
|
+
nav.-mb-px.flex.space-x-4.overflow-x-auto aria-label="Tabs"
|
36
36
|
- tabs.each_with_index do |tab, index|
|
37
37
|
- id = tab.id.present? ? tab.id : tab.name
|
38
|
-
.flex
|
39
|
-
a
|
38
|
+
.flex.tab class="#{index == (tab.selected_tab_index) ? 'selected' : ''}" data-satis-tabs-target="tab" data-action="click->satis-tabs#select" id="#{id}" href="#" aria-current="#{tab.selected? ? "page" : ''}"
|
39
|
+
a
|
40
40
|
- if tab.icon
|
41
41
|
i.mr-2 class=tab.icon
|
42
|
-
span id="tab_label_#{tab.id}"
|
42
|
+
span id="tab_label_#{tab.id}" class="#{tab.dirty? ? 'italic' : ''}"
|
43
43
|
= t(tab.name, scope: [:tabs], default: tab.title || tab.name)
|
44
44
|
i.fal.fa-triangle-exclamation.ml-2.hidden
|
45
45
|
- if tab.badge
|
46
46
|
span.badge id="tab_badge_#{tab.id}"
|
47
47
|
= tab.badge
|
48
|
-
|
49
|
-
|
48
|
+
- if tab.tab_menu
|
49
|
+
= render(Satis::Menu::Component.new(tab.tab_menu, icon: 'fa-thin fa-chevron-down'))
|
50
50
|
- if custom_tabs_link_html.present?
|
51
51
|
= custom_tabs_link_html
|
52
52
|
|
@@ -1,13 +1,13 @@
|
|
1
|
-
div data-controller="satis-menu" data-action="#{menu.event}->satis-menu#show mouseleave->satis-menu#hide"
|
1
|
+
div.sts-menu data-controller="satis-menu" data-action="#{menu.event}->satis-menu#show mouseleave->satis-menu#hide"
|
2
2
|
- if content
|
3
3
|
= content
|
4
4
|
- else
|
5
|
-
button.
|
5
|
+
button.sts-menu__button aria-expanded="false" aria-haspopup="true" type="button"
|
6
6
|
span.font-semibold.flex-1 id="#{icon_id}" class="#{menu.items.present? ? '' : 'text-gray-200'}"
|
7
7
|
i class=icon
|
8
8
|
|
9
9
|
- if menu.items.present?
|
10
|
-
ul.
|
10
|
+
ul.sts-menu__items.hidden data-satis-menu-target="submenu" data-satis-menu-submenu-placement="bottom"
|
11
11
|
- menu.items.each do |item|
|
12
12
|
= render(Satis::MenuItem::Component.new(item: item))
|
13
13
|
|
@@ -0,0 +1,9 @@
|
|
1
|
+
.sts-menu {
|
2
|
+
&__button {
|
3
|
+
@apply h-8 w-8 inline-flex items-center justify-center rounded-full focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500 dark:text-gray-500;
|
4
|
+
}
|
5
|
+
|
6
|
+
&__items {
|
7
|
+
@apply z-10 bg-white dark:bg-gray-400 border dark:border-gray-800 rounded-md shadow-lg min-w-max;
|
8
|
+
}
|
9
|
+
}
|
@@ -35,6 +35,7 @@ export default class extends ApplicationController {
|
|
35
35
|
this.submenuTarget.setAttribute("data-show", "")
|
36
36
|
this.popperInstance.update()
|
37
37
|
}
|
38
|
+
event.stopPropagation()
|
38
39
|
}
|
39
40
|
|
40
41
|
hide(event) {
|
@@ -42,6 +43,7 @@ export default class extends ApplicationController {
|
|
42
43
|
this.submenuTarget.classList.add("hidden")
|
43
44
|
this.submenuTarget.removeAttribute("data-show")
|
44
45
|
}
|
46
|
+
event.stopPropagation()
|
45
47
|
}
|
46
48
|
|
47
49
|
toggle(event) {
|
@@ -2,10 +2,10 @@ li.rounded-sm.px-3.py-1.hover:bg-gray-100.dark:hover:bg-gray-200.flex.items-cent
|
|
2
2
|
a.cursor-pointer.py-1.w-full.text-left.flex.items-center.outline-none.focus:outline-none href=item.link *item.link_attributes
|
3
3
|
- if item.type == :custom
|
4
4
|
= render(partial: item.link_attributes[:data][:path], locals: item.link_attributes[:data][:parameters])
|
5
|
-
span.pr-1.flex-shrink-0.w-6
|
5
|
+
span.pr-1.flex-shrink-0.w-6.text-gray-500
|
6
6
|
- if item.icon.present?
|
7
7
|
i class=item.icon
|
8
|
-
span.pr-1.flex-1
|
8
|
+
span.pr-1.flex-1.text-gray-500
|
9
9
|
- unless item.type == :custom
|
10
10
|
= item.label
|
11
11
|
span.pr-1.flex-shrink-0.w-6
|
@@ -3,7 +3,7 @@
|
|
3
3
|
module Satis
|
4
4
|
module Tab
|
5
5
|
class Component < Satis::ApplicationComponent
|
6
|
-
attr_reader :options, :name, :icon, :badge, :id, :tab_menu, :selected_tab_index
|
6
|
+
attr_reader :options, :name, :icon, :badge, :id, :tab_menu, :selected_tab_index, :dirty
|
7
7
|
|
8
8
|
def initialize(name, *args, &block)
|
9
9
|
super
|
@@ -16,6 +16,7 @@ module Satis
|
|
16
16
|
@tab_menu = options[:tab_menu]
|
17
17
|
@block = block
|
18
18
|
@selected_tab_index = options[:selected_tab_index]
|
19
|
+
@dirty = options[:dirty]
|
19
20
|
end
|
20
21
|
|
21
22
|
def responsive?
|
@@ -26,6 +27,10 @@ module Satis
|
|
26
27
|
options[:selected] == true
|
27
28
|
end
|
28
29
|
|
30
|
+
def dirty?
|
31
|
+
options[:dirty] == true
|
32
|
+
end
|
33
|
+
|
29
34
|
def title
|
30
35
|
options[:title]
|
31
36
|
end
|
@@ -6,7 +6,7 @@
|
|
6
6
|
option selected=tab.selected? = ct(".#{tab.name}", scope: [group.to_sym], default: tab.name.to_s.humanize)
|
7
7
|
.hidden.sm:block
|
8
8
|
.border-b.border-gray-200
|
9
|
-
nav
|
9
|
+
nav.sts-tabs__nav aria-label="Tabs"
|
10
10
|
- tabs.each do |tab|
|
11
11
|
a.tab id="#{tab.name}" href="#" aria-current="#{tab.selected? ? "page" : ''}" data-satis-tabs-target="tab" data-action="click->satis-tabs#select"
|
12
12
|
- if tab.icon
|
@@ -20,4 +20,4 @@
|
|
20
20
|
div
|
21
21
|
- tabs.each do |tab|
|
22
22
|
div id="#{tab.name}-content" class="tab-content #{tab.options[:padding] == false ? '' : 'mt-4'}" data-satis-tabs-target="content"
|
23
|
-
= tab.to_s
|
23
|
+
= tab.to_s
|
@@ -1,6 +1,14 @@
|
|
1
1
|
.sts-tabs {
|
2
|
+
&__nav {
|
3
|
+
@apply -mb-px flex space-x-4 overflow-x-auto;
|
4
|
+
}
|
5
|
+
|
2
6
|
.tab {
|
3
|
-
@apply border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300 whitespace-nowrap pb-4
|
7
|
+
@apply border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300 whitespace-nowrap px-1 pb-4 border-b-2 font-medium text-sm border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300 cursor-pointer;
|
8
|
+
|
9
|
+
a {
|
10
|
+
@apply no-underline text-gray-500 hover:text-gray-700;
|
11
|
+
}
|
4
12
|
|
5
13
|
.badge {
|
6
14
|
@apply bg-gray-100 text-gray-600 hidden ml-3 rounded-full text-xs font-medium md:inline-block py-0.5 px-2.5;
|
@@ -12,6 +20,16 @@
|
|
12
20
|
.badge {
|
13
21
|
@apply bg-primary-100 text-primary-600;
|
14
22
|
}
|
23
|
+
|
24
|
+
a {
|
25
|
+
@apply text-primary-600;
|
26
|
+
}
|
27
|
+
}
|
28
|
+
|
29
|
+
.sts-menu {
|
30
|
+
&__button {
|
31
|
+
@apply h-0 w-0 pl-4;
|
32
|
+
}
|
15
33
|
}
|
16
34
|
|
17
35
|
&.is-invalid {
|
@@ -48,7 +48,7 @@ export default class extends ApplicationController {
|
|
48
48
|
if (event.srcElement.tagName == "SELECT") {
|
49
49
|
index = event.srcElement.selectedIndex
|
50
50
|
} else {
|
51
|
-
let clickedTab = event.srcElement.closest("
|
51
|
+
let clickedTab = event.srcElement.closest(".tab")
|
52
52
|
index = this.tabTargets.findIndex((el) => {
|
53
53
|
return el.attributes["id"] === clickedTab.attributes["id"]
|
54
54
|
})
|
data/lib/satis/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: satis
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.75
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom de Grunt
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-01-
|
11
|
+
date: 2023-01-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: browser
|
@@ -150,6 +150,7 @@ files:
|
|
150
150
|
- app/components/satis/menu/component.html.slim
|
151
151
|
- app/components/satis/menu/component.md
|
152
152
|
- app/components/satis/menu/component.rb
|
153
|
+
- app/components/satis/menu/component.scss
|
153
154
|
- app/components/satis/menu/component_controller.js
|
154
155
|
- app/components/satis/menu_item/component.html.slim
|
155
156
|
- app/components/satis/menu_item/component.rb
|