@budibase/frontend-core 2.6.16-alpha.2 → 2.6.16-alpha.4

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,17 +1,17 @@
1
1
  {
2
2
  "name": "@budibase/frontend-core",
3
- "version": "2.6.16-alpha.2",
3
+ "version": "2.6.16-alpha.4",
4
4
  "description": "Budibase frontend core libraries used in builder and client",
5
5
  "author": "Budibase",
6
6
  "license": "MPL-2.0",
7
7
  "svelte": "src/index.js",
8
8
  "dependencies": {
9
- "@budibase/bbui": "2.6.16-alpha.2",
10
- "@budibase/shared-core": "2.6.16-alpha.2",
9
+ "@budibase/bbui": "2.6.16-alpha.4",
10
+ "@budibase/shared-core": "2.6.16-alpha.4",
11
11
  "dayjs": "^1.11.7",
12
12
  "lodash": "^4.17.21",
13
13
  "socket.io-client": "^4.6.1",
14
14
  "svelte": "^3.46.2"
15
15
  },
16
- "gitHead": "821fb1203fc4e6d1c79954d1b69aafd4a59359e7"
16
+ "gitHead": "7ef56bb0effd46a525ca978773976e71b9a90465"
17
17
  }
@@ -0,0 +1,67 @@
1
+ <script>
2
+ import { Layout } from "@budibase/bbui"
3
+ import Bulgaria from "../../assets/bulgaria.png"
4
+ import Covanta from "../../assets/covanta.png"
5
+ import Schnellecke from "../../assets/schnellecke.png"
6
+
7
+ const testimonials = [
8
+ {
9
+ text: "Budibase was the only solution that checked all the boxes for Covanta. Covanta expects to realize $3.2MM in savings due to the elimination of redundant data entry.",
10
+ name: "Charles Link",
11
+ role: "Senior Director, Data and Analytics",
12
+ image: Covanta,
13
+ imageSize: 105,
14
+ },
15
+ {
16
+ text: "Budibase was mission-critical for us and went a long way in preventing what could have become a humanitarian crisis here in Bulgaria.",
17
+ name: "Bozhidar Bozhanov",
18
+ role: "Government of Bulgaria",
19
+ image: Bulgaria,
20
+ imageSize: 49,
21
+ },
22
+ {
23
+ text: "Centralization of authentication, quick turnaround time for requests, integration with different database systems has given it the edge and it’s now used daily for internal development for those apps that you know you need but don’t feel value in losing days of development to reinvent the wheel.",
24
+ name: "Davide Lenzarini",
25
+ role: "IT manager",
26
+ image: Schnellecke,
27
+ imageSize: 141,
28
+ },
29
+ ]
30
+ const testimonial = testimonials[Math.floor(Math.random() * 3)]
31
+ </script>
32
+
33
+ <div class="testimonial">
34
+ <Layout noPadding gap="S">
35
+ <img
36
+ width={testimonial.imageSize}
37
+ alt="a-happy-budibase-user"
38
+ src={testimonial.image}
39
+ />
40
+ <div class="text">
41
+ "{testimonial.text}"
42
+ </div>
43
+ <div class="author">
44
+ <div class="name">{testimonial.name}</div>
45
+ <div class="company">{testimonial.role}</div>
46
+ </div>
47
+ </Layout>
48
+ </div>
49
+
50
+ <style>
51
+ .testimonial {
52
+ width: 380px;
53
+ padding: 40px;
54
+ }
55
+ .text {
56
+ font-size: var(--font-size-l);
57
+ font-style: italic;
58
+ }
59
+ .name {
60
+ font-weight: bold;
61
+ color: var(--spectrum-global-color-gray-900);
62
+ font-size: var(--font-size-l);
63
+ }
64
+ .company {
65
+ color: var(--spectrum-global-color-gray-700);
66
+ }
67
+ </style>
@@ -1,58 +1,15 @@
1
1
  <script>
2
2
  import SplitPage from "./SplitPage.svelte"
3
- import { Layout } from "@budibase/bbui"
4
- import Bulgaria from "../../assets/bulgaria.png"
5
- import Covanta from "../../assets/covanta.png"
6
- import Schnellecke from "../../assets/schnellecke.png"
3
+ import Testimonial from "./Testimonial.svelte"
7
4
 
8
5
  export let enabled = true
9
-
10
- const testimonials = [
11
- {
12
- text: "Budibase was the only solution that checked all the boxes for Covanta. Covanta expects to realize $3.2MM in savings due to the elimination of redundant data entry.",
13
- name: "Charles Link",
14
- role: "Senior Director, Data and Analytics",
15
- image: Covanta,
16
- imageSize: 105,
17
- },
18
- {
19
- text: "Budibase was mission-critical for us and went a long way in preventing what could have become a humanitarian crisis here in Bulgaria.",
20
- name: "Bozhidar Bozhanov",
21
- role: "Government of Bulgaria",
22
- image: Bulgaria,
23
- imageSize: 49,
24
- },
25
- {
26
- text: "Centralization of authentication, quick turnaround time for requests, integration with different database systems has given it the edge and it’s now used daily for internal development for those apps that you know you need but don’t feel value in losing days of development to reinvent the wheel.",
27
- name: "Davide Lenzarini",
28
- role: "IT manager",
29
- image: Schnellecke,
30
- imageSize: 141,
31
- },
32
- ]
33
- const testimonial = testimonials[Math.floor(Math.random() * 3)]
34
6
  </script>
35
7
 
36
8
  <SplitPage>
37
9
  <slot />
38
10
  <div class:wrapper={enabled} slot="right">
39
11
  {#if enabled}
40
- <div class="testimonial">
41
- <Layout noPadding gap="S">
42
- <img
43
- width={testimonial.imageSize}
44
- alt="a-happy-budibase-user"
45
- src={testimonial.image}
46
- />
47
- <div class="text">
48
- "{testimonial.text}"
49
- </div>
50
- <div class="author">
51
- <div class="name">{testimonial.name}</div>
52
- <div class="company">{testimonial.role}</div>
53
- </div>
54
- </Layout>
55
- </div>
12
+ <Testimonial />
56
13
  {/if}
57
14
  </div>
58
15
  </SplitPage>
@@ -64,20 +21,4 @@
64
21
  display: grid;
65
22
  place-items: center;
66
23
  }
67
- .testimonial {
68
- width: 380px;
69
- padding: 40px;
70
- }
71
- .text {
72
- font-size: var(--font-size-l);
73
- font-style: italic;
74
- }
75
- .name {
76
- font-weight: bold;
77
- color: var(--spectrum-global-color-gray-900);
78
- font-size: var(--font-size-l);
79
- }
80
- .company {
81
- color: var(--spectrum-global-color-gray-700);
82
- }
83
24
  </style>
@@ -13,10 +13,10 @@
13
13
  let flatpickr
14
14
  let isOpen
15
15
 
16
- // adding the 0- will turn a string like 00:00:00 into a valid ISO
16
+ // Adding the 0- will turn a string like 00:00:00 into a valid ISO
17
17
  // date, but will make actual ISO dates invalid
18
- $: time = new Date(`0-${value}`)
19
- $: timeOnly = !isNaN(time) || schema?.timeOnly
18
+ $: isTimeValue = !isNaN(new Date(`0-${value}`))
19
+ $: timeOnly = isTimeValue || schema?.timeOnly
20
20
  $: dateOnly = schema?.dateOnly
21
21
  $: format = timeOnly
22
22
  ? "HH:mm:ss"
@@ -24,6 +24,19 @@
24
24
  ? "MMM D YYYY"
25
25
  : "MMM D YYYY, HH:mm"
26
26
  $: editable = focused && !readonly
27
+ $: displayValue = getDisplayValue(value, format, timeOnly, isTimeValue)
28
+
29
+ const getDisplayValue = (value, format, timeOnly, isTimeValue) => {
30
+ if (!value) {
31
+ return ""
32
+ }
33
+ // Parse full date strings
34
+ if (!timeOnly || !isTimeValue) {
35
+ return dayjs(value).format(format)
36
+ }
37
+ // Otherwise must be a time string
38
+ return dayjs(`0-${value}`).format(format)
39
+ }
27
40
 
28
41
  // Ensure we close flatpickr when unselected
29
42
  $: {
@@ -49,7 +62,7 @@
49
62
  <div class="container">
50
63
  <div class="value">
51
64
  {#if value}
52
- {dayjs(timeOnly ? time : value).format(format)}
65
+ {displayValue}
53
66
  {/if}
54
67
  </div>
55
68
  {#if editable}
@@ -1,3 +1,4 @@
1
1
  export { default as SplitPage } from "./SplitPage.svelte"
2
2
  export { default as TestimonialPage } from "./TestimonialPage.svelte"
3
+ export { default as Testimonial } from "./Testimonial.svelte"
3
4
  export { Grid } from "./grid"