satis 1.0.70 → 1.0.75

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 03c106e3c85f9b929d8857c93d5b3453f306f0c9557d1cc084dd763dd2bd849b
4
- data.tar.gz: e0e8799e598ac7e0f8825a88194125df5ff140c425c751438f7971f1bb7857d9
3
+ metadata.gz: e8bb27aace7817e26b12e3dc2d45f998cc8115681e7ae457988bdf417da6a237
4
+ data.tar.gz: 444726850e8e2d89b7cd4dc36eee15be4f92a49b24af5128a7b2e86996790309
5
5
  SHA512:
6
- metadata.gz: 73c6b212d40768e612fba5f20870fc99fdb0c544095d8aee622ae76ea0addb833ce361404e2be1c2bd74e288afd50ca8f1f9318cb0ce3bef992c90c7004975e3
7
- data.tar.gz: '08a42c0b640f4f6fe1223d7e1ec046b91ae0cdae1fcf98146efbf6e82b0e180e011c0962d617ace24162cd46225a671ab06e955e6eb062eb47092a3b7eb5480d'
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-8.overflow-x-auto aria-label="Tabs"
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.tab id="#{id}" class="#{index == (tab.selected_tab_index) ? 'selected' : ''}" href="#" aria-current="#{tab.selected? ? "page" : ''}" data-satis-tabs-target="tab" data-action="click->satis-tabs#select"
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
- - if tab.tab_menu
49
- = render(Satis::Menu::Component.new(tab.tab_menu, icon: 'fa-thin fa-square-chevron-down'))
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.inline-flex.items-center.justify-center.h-8.w-8.rounded-full.focus:outline-none.focus:ring-2.focus:ring-offset-2.focus:ring-primary-500.dark:text-gray-500 aria-expanded="false" aria-haspopup="true" type="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.hidden.z-10.bg-white.dark:bg-gray-400.border.dark:border-gray-800.rounded-md.shadow-lg.min-w-max data-satis-menu-target="submenu" data-satis-menu-submenu-placement="bottom"
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.-mb-px.flex.space-x-8.overflow-x-auto aria-label="Tabs"
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 px-1 border-b-2 font-medium text-sm border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300;
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("a")
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
@@ -1,3 +1,3 @@
1
1
  module Satis
2
- VERSION = "1.0.70"
2
+ VERSION = "1.0.75"
3
3
  end
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.70
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-06 00:00:00.000000000 Z
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