@budibase/bbui 3.38.5 → 3.39.15

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.38.5",
4
+ "version": "3.39.15",
5
5
  "license": "MPL-2.0",
6
6
  "module": "dist/bbui.mjs",
7
7
  "exports": {
@@ -105,5 +105,5 @@
105
105
  }
106
106
  }
107
107
  },
108
- "gitHead": "5795ec6c95812463cba1d8cede8295f6c2b915cb"
108
+ "gitHead": "e409b00d4727dd9f3c5ba22401aa3d0d8c062cba"
109
109
  }
@@ -299,16 +299,17 @@
299
299
  gap: var(--spacing-xl);
300
300
  }
301
301
  .text {
302
- display: flex;
303
- flex-direction: column;
304
- justify-content: center;
305
- align-items: flex-start;
306
- gap: var(--spacing-xs);
302
+ flex: 1 1 auto;
303
+ min-width: 0;
307
304
  font-weight: 500;
308
305
  color: var(--spectrum-global-color-gray-900);
306
+ white-space: nowrap;
307
+ overflow: hidden;
308
+ text-overflow: ellipsis;
309
309
  }
310
310
  .buttons {
311
311
  display: flex;
312
+ flex: 0 0 auto;
312
313
  flex-direction: row;
313
314
  justify-content: flex-start;
314
315
  align-items: center;
@@ -42,7 +42,7 @@
42
42
  return String(value).toLowerCase()
43
43
  }
44
44
 
45
- $: query = value || ""
45
+ $: if (!focus) query = value || ""
46
46
  $: filteredOptions =
47
47
  !query.trim() || !options?.length
48
48
  ? options
@@ -59,12 +59,13 @@
59
59
  }
60
60
 
61
61
  const onType: FormEventHandler<HTMLInputElement> = e => {
62
- const value = e.currentTarget.value
63
- dispatch("type", value)
64
- selectOption(value, false)
62
+ query = e.currentTarget.value
63
+ dispatch("type", query)
64
+ open = true
65
65
  }
66
66
 
67
67
  const onPick = (value: string) => {
68
+ query = value
68
69
  dispatch("pick", value)
69
70
  selectOption(value)
70
71
  }
@@ -87,10 +88,13 @@
87
88
  on:focus={() => (focus = true)}
88
89
  on:blur={() => {
89
90
  focus = false
91
+ if (query !== (value || "")) {
92
+ dispatch("change", query)
93
+ }
90
94
  dispatch("blur")
91
95
  }}
92
96
  on:input={onType}
93
- value={value || ""}
97
+ value={query}
94
98
  placeholder={placeholder || ""}
95
99
  {disabled}
96
100
  {readonly}
@@ -135,6 +139,7 @@
135
139
  role="option"
136
140
  aria-selected="true"
137
141
  tabindex="0"
142
+ on:mousedown|preventDefault
138
143
  on:click={() => onPick(getOptionValue(option))}
139
144
  >
140
145
  <span class="spectrum-Menu-itemLabel">{getOptionLabel(option)}</span
@@ -82,7 +82,12 @@
82
82
  const base = value || now
83
83
  dispatch(
84
84
  "change",
85
- base.year(date.year()).month(date.month()).date(date.date())
85
+ base
86
+ .year(date.year())
87
+ .month(date.month())
88
+ .date(date.date())
89
+ .second(0)
90
+ .millisecond(0)
86
91
  )
87
92
  }
88
93
 
@@ -20,7 +20,7 @@
20
20
  $: showTime = enableTime || timeOnly
21
21
 
22
22
  const setToNow = () => {
23
- const now = dayjs()
23
+ const now = dayjs().second(0).millisecond(0)
24
24
  calendar?.setDate(now)
25
25
  handleChange(now)
26
26
  }
@@ -16,7 +16,10 @@
16
16
  }
17
17
 
18
18
  const [hour, minute] = e.target.value.split(":").map(x => parseInt(x))
19
- dispatch("change", (value || dayjs()).hour(hour).minute(minute))
19
+ dispatch(
20
+ "change",
21
+ (value || dayjs()).hour(hour).minute(minute).second(0).millisecond(0)
22
+ )
20
23
  }
21
24
  </script>
22
25
 
@@ -238,6 +238,7 @@
238
238
  {disabled}
239
239
  class:is-open={open}
240
240
  class:is-readonly={readonly}
241
+ class:auto-width={autoWidth}
241
242
  aria-haspopup="listbox"
242
243
  on:click={onClick}
243
244
  bind:this={button}
@@ -444,6 +445,10 @@
444
445
  width: 100%;
445
446
  box-shadow: none;
446
447
  }
448
+ .spectrum-Picker.auto-width {
449
+ width: auto;
450
+ max-width: 100%;
451
+ }
447
452
  .spectrum-Picker.has-border {
448
453
  border: 1px solid var(--spectrum-global-color-gray-200);
449
454
  border-radius: 6px;
@@ -7,6 +7,7 @@
7
7
  export let text: string | null = null
8
8
  export let disabled: boolean = false
9
9
  export let noPadding: boolean = false
10
+ export let noMargin: boolean = false
10
11
 
11
12
  const dispatch = createEventDispatcher()
12
13
  const onChange = (event: Event) => {
@@ -15,7 +16,11 @@
15
16
  }
16
17
  </script>
17
18
 
18
- <div class="spectrum-Switch spectrum-Switch--emphasized" class:noPadding>
19
+ <div
20
+ class="spectrum-Switch spectrum-Switch--emphasized"
21
+ class:noPadding
22
+ class:noMargin
23
+ >
19
24
  <input
20
25
  checked={value}
21
26
  {disabled}
@@ -40,4 +45,7 @@
40
45
  padding: 0;
41
46
  margin: 0;
42
47
  }
48
+ .spectrum-Switch.noMargin {
49
+ --spectrum-switch-cursor-hit-x: 0;
50
+ }
43
51
  </style>
@@ -8,11 +8,12 @@
8
8
  export let placeholder: string | undefined = undefined
9
9
  export let type = "text"
10
10
  export let disabled = false
11
- export let id = null
11
+ export let id: string | null = null
12
12
  export let readonly = false
13
13
  export let updateOnChange = true
14
14
  export let quiet = false
15
- export let align: "left" | "right" | "center" | undefined = undefined
15
+ export let align: "left" | "right" | "center" | "justify" | undefined =
16
+ undefined
16
17
  export let autofocus: boolean | null = false
17
18
  export let autocomplete: FullAutoFill | boolean | null | undefined = undefined
18
19
 
@@ -67,6 +68,12 @@
67
68
  if (type === "bigint") {
68
69
  return "numeric"
69
70
  }
71
+ if (type === "url") {
72
+ return "url"
73
+ }
74
+ if (type === "email") {
75
+ return "email"
76
+ }
70
77
  return type === "number" ? "decimal" : "text"
71
78
  }
72
79
 
@@ -12,6 +12,7 @@
12
12
  export let error: string | undefined = undefined
13
13
  export let helpText: string | undefined = undefined
14
14
  export let noPadding: boolean = false
15
+ export let noMargin: boolean = false
15
16
 
16
17
  const dispatch = createEventDispatcher()
17
18
  const onChange = (e: CustomEvent<boolean>) => {
@@ -23,6 +24,7 @@
23
24
  <Field {helpText} {label} {labelPosition} {error}>
24
25
  <Switch
25
26
  {disabled}
27
+ {noMargin}
26
28
  {text}
27
29
  {noPadding}
28
30
  value={value ?? undefined}
@@ -11,6 +11,7 @@
11
11
  export let fixed: boolean = false
12
12
  export let color: string | undefined = undefined
13
13
  export let noWrap: boolean = false
14
+ export let offset: number = 0
14
15
 
15
16
  let wrapper: HTMLElement | undefined
16
17
  let hovered = false
@@ -44,15 +45,15 @@
44
45
  // Determine where to render tooltip based on position prop
45
46
  if (position === TooltipPosition.Top) {
46
47
  left = bounds.left + bounds.width / 2
47
- top = bounds.top
48
+ top = bounds.top + offset
48
49
  } else if (position === TooltipPosition.Right) {
49
- left = bounds.left + bounds.width
50
+ left = bounds.left + bounds.width + offset
50
51
  top = bounds.top + bounds.height / 2
51
52
  } else if (position === TooltipPosition.Bottom) {
52
53
  left = bounds.left + bounds.width / 2
53
- top = bounds.top + bounds.height
54
+ top = bounds.top + bounds.height + offset
54
55
  } else if (position === TooltipPosition.Left) {
55
- left = bounds.left
56
+ left = bounds.left - offset
56
57
  top = bounds.top + bounds.height / 2
57
58
  }
58
59
  }