@budibase/bbui 2.0.30-alpha.13 → 2.0.30-alpha.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": "2.0.30-alpha.
|
|
4
|
+
"version": "2.0.30-alpha.15",
|
|
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.30-alpha.
|
|
41
|
+
"@budibase/string-templates": "2.0.30-alpha.15",
|
|
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": "
|
|
88
|
+
"gitHead": "83d5f70937fc66baa53782da968a06f71ff54d19"
|
|
89
89
|
}
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
export let timeOnly = false
|
|
18
18
|
export let ignoreTimezones = false
|
|
19
19
|
export let time24hr = false
|
|
20
|
-
|
|
20
|
+
export let range = false
|
|
21
21
|
const dispatch = createEventDispatcher()
|
|
22
22
|
const flatpickrId = `${uuid()}-wrapper`
|
|
23
23
|
let open = false
|
|
@@ -41,6 +41,7 @@
|
|
|
41
41
|
time_24hr: time24hr || false,
|
|
42
42
|
altFormat: timeOnly ? "H:i" : enableTime ? "F j Y, H:i" : "F j, Y",
|
|
43
43
|
wrap: true,
|
|
44
|
+
mode: range ? "range" : null,
|
|
44
45
|
appendTo,
|
|
45
46
|
disableMobile: "true",
|
|
46
47
|
onReady: () => {
|
|
@@ -64,9 +65,8 @@
|
|
|
64
65
|
if (newValue) {
|
|
65
66
|
newValue = newValue.toISOString()
|
|
66
67
|
}
|
|
67
|
-
|
|
68
68
|
// If time only set date component to 2000-01-01
|
|
69
|
-
if (timeOnly) {
|
|
69
|
+
else if (timeOnly) {
|
|
70
70
|
// Classic flackpickr causing issues.
|
|
71
71
|
// When selecting a value for the first time for a "time only" field,
|
|
72
72
|
// the time is always offset by 1 hour for some reason (regardless of time
|
|
@@ -95,7 +95,11 @@
|
|
|
95
95
|
.slice(0, -1)
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
|
|
98
|
+
if (range) {
|
|
99
|
+
dispatch("change", event.detail)
|
|
100
|
+
} else {
|
|
101
|
+
dispatch("change", newValue)
|
|
102
|
+
}
|
|
99
103
|
}
|
|
100
104
|
|
|
101
105
|
const clearDateOnBackspace = event => {
|
|
@@ -160,7 +164,7 @@
|
|
|
160
164
|
{#key redrawOptions}
|
|
161
165
|
<Flatpickr
|
|
162
166
|
bind:flatpickr
|
|
163
|
-
value={parseDate(value)}
|
|
167
|
+
value={range ? value : parseDate(value)}
|
|
164
168
|
on:open={onOpen}
|
|
165
169
|
on:close={onClose}
|
|
166
170
|
options={flatpickrOptions}
|
|
@@ -14,11 +14,17 @@
|
|
|
14
14
|
export let placeholder = null
|
|
15
15
|
export let appendTo = undefined
|
|
16
16
|
export let ignoreTimezones = false
|
|
17
|
-
|
|
17
|
+
export let range = false
|
|
18
18
|
const dispatch = createEventDispatcher()
|
|
19
19
|
|
|
20
20
|
const onChange = e => {
|
|
21
|
-
|
|
21
|
+
if (range) {
|
|
22
|
+
// Flatpickr cant take two dates and work out what to display, needs to be provided a string.
|
|
23
|
+
// Like - "Date1 to Date2". Hence passing in that specifically from the array
|
|
24
|
+
value = e?.detail[1]
|
|
25
|
+
} else {
|
|
26
|
+
value = e.detail
|
|
27
|
+
}
|
|
22
28
|
dispatch("change", e.detail)
|
|
23
29
|
}
|
|
24
30
|
</script>
|
|
@@ -34,6 +40,7 @@
|
|
|
34
40
|
{time24hr}
|
|
35
41
|
{appendTo}
|
|
36
42
|
{ignoreTimezones}
|
|
43
|
+
{range}
|
|
37
44
|
on:change={onChange}
|
|
38
45
|
/>
|
|
39
46
|
</Field>
|