@budibase/bbui 3.23.35 → 3.23.36

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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@budibase/bbui",
3
3
  "description": "A UI solution used in the different Budibase projects.",
4
- "version": "3.23.35",
4
+ "version": "3.23.36",
5
5
  "license": "MPL-2.0",
6
6
  "svelte": "src/index.ts",
7
7
  "module": "dist/bbui.mjs",
@@ -107,5 +107,5 @@
107
107
  }
108
108
  }
109
109
  },
110
- "gitHead": "794fa2457b5414b4f964bcc31a1b1dca3be4ae22"
110
+ "gitHead": "d3c5b44f30df4aa2c627b910c7b3e157a888764d"
111
111
  }
@@ -26,7 +26,9 @@
26
26
  export let emphasized: boolean = false
27
27
  export let onTop: boolean = false
28
28
  export let size: "S" | "M" | "L" = "M"
29
+ export let disabled: boolean = false
29
30
  export let beforeSwitch: ((_title: string) => boolean) | null = null
31
+ export let hideTabsList: boolean = false
30
32
 
31
33
  let thisSelected: string | undefined = undefined
32
34
  let container: HTMLElement | undefined
@@ -48,7 +50,7 @@
48
50
  if (thisSelected !== selected) {
49
51
  thisSelected = selected
50
52
  dispatch("select", thisSelected)
51
- } else if ($tab.title !== thisSelected) {
53
+ } else if ($tab.title !== thisSelected && !disabled) {
52
54
  if (typeof beforeSwitch == "function") {
53
55
  const proceed = beforeSwitch($tab.title)
54
56
  if (proceed) {
@@ -70,8 +72,8 @@
70
72
  }
71
73
  }
72
74
 
73
- $: $tab && calculateIndicatorLength()
74
- $: $tab && calculateIndicatorOffset()
75
+ $: $tab && !disabled && calculateIndicatorLength()
76
+ $: $tab && !disabled && calculateIndicatorOffset()
75
77
 
76
78
  function calculateIndicatorLength() {
77
79
  if (!vertical) {
@@ -113,6 +115,7 @@
113
115
  class:spectrum-Tabs--vertical={vertical}
114
116
  class:spectrum-Tabs--horizontal={!vertical}
115
117
  class="spectrum-Tabs spectrum-Tabs--size{size}"
118
+ class:hidden={hideTabsList}
116
119
  >
117
120
  <slot />
118
121
  {#if $tab.info}
@@ -139,6 +142,9 @@
139
142
  position: relative;
140
143
  border-bottom-color: var(--spectrum-global-color-gray-200);
141
144
  }
145
+ .spectrum-Tabs.hidden {
146
+ display: none;
147
+ }
142
148
  .spectrum-Tabs-content {
143
149
  margin-top: var(--spectrum-global-dimension-static-size-150);
144
150
  }