@budibase/bbui 2.0.29 → 2.0.30-alpha.0

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": "2.0.29",
4
+ "version": "2.0.30-alpha.0",
5
5
  "license": "MPL-2.0",
6
6
  "svelte": "src/index.js",
7
7
  "module": "dist/bbui.es.js",
@@ -38,7 +38,7 @@
38
38
  ],
39
39
  "dependencies": {
40
40
  "@adobe/spectrum-css-workflow-icons": "^1.2.1",
41
- "@budibase/string-templates": "^2.0.29",
41
+ "@budibase/string-templates": "2.0.30-alpha.0",
42
42
  "@spectrum-css/actionbutton": "^1.0.1",
43
43
  "@spectrum-css/actiongroup": "^1.0.1",
44
44
  "@spectrum-css/avatar": "^3.0.2",
@@ -85,5 +85,5 @@
85
85
  "svelte-flatpickr": "^3.2.3",
86
86
  "svelte-portal": "^1.0.0"
87
87
  },
88
- "gitHead": "855990ae0050c1f43ceb6fca36fd5aeaba8d6740"
88
+ "gitHead": "d0200a093e9d0030f1194c2b0084f775c76a7121"
89
89
  }
@@ -19,6 +19,7 @@
19
19
  export let placeholderOption = null
20
20
  export let options = []
21
21
  export let isOptionSelected = () => false
22
+ export let isOptionEnabled = () => true
22
23
  export let onSelectOption = () => {}
23
24
  export let getOptionLabel = option => option
24
25
  export let getOptionValue = option => option
@@ -164,6 +165,7 @@
164
165
  aria-selected="true"
165
166
  tabindex="0"
166
167
  on:click={() => onSelectOption(getOptionValue(option, idx))}
168
+ class:is-disabled={!isOptionEnabled(option)}
167
169
  >
168
170
  {#if getOptionIcon(option, idx)}
169
171
  <span class="option-extra">
@@ -256,4 +258,7 @@
256
258
  .spectrum-Popover :global(.spectrum-Search .spectrum-Textfield-icon) {
257
259
  top: 9px;
258
260
  }
261
+ .spectrum-Menu-item.is-disabled {
262
+ pointer-events: none;
263
+ }
259
264
  </style>
@@ -12,6 +12,7 @@
12
12
  export let getOptionValue = option => option
13
13
  export let getOptionIcon = () => null
14
14
  export let getOptionColour = () => null
15
+ export let isOptionEnabled
15
16
  export let readonly = false
16
17
  export let quiet = false
17
18
  export let autoWidth = false
@@ -66,6 +67,7 @@
66
67
  {getOptionValue}
67
68
  {getOptionIcon}
68
69
  {getOptionColour}
70
+ {isOptionEnabled}
69
71
  {autocomplete}
70
72
  {sort}
71
73
  isPlaceholder={value == null || value === ""}
@@ -15,6 +15,7 @@
15
15
  export let getOptionValue = option => extractProperty(option, "value")
16
16
  export let getOptionIcon = option => option?.icon
17
17
  export let getOptionColour = option => option?.colour
18
+ export let isOptionEnabled
18
19
  export let quiet = false
19
20
  export let autoWidth = false
20
21
  export let sort = false
@@ -49,6 +50,7 @@
49
50
  {getOptionValue}
50
51
  {getOptionIcon}
51
52
  {getOptionColour}
53
+ {isOptionEnabled}
52
54
  on:change={onChange}
53
55
  on:click
54
56
  />