@budibase/bbui 2.25.0 → 2.26.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.25.0",
4
+ "version": "2.26.0",
5
5
  "license": "MPL-2.0",
6
6
  "svelte": "src/index.js",
7
7
  "module": "dist/bbui.es.js",
@@ -35,8 +35,8 @@
35
35
  ],
36
36
  "dependencies": {
37
37
  "@adobe/spectrum-css-workflow-icons": "1.2.1",
38
- "@budibase/shared-core": "2.25.0",
39
- "@budibase/string-templates": "2.25.0",
38
+ "@budibase/shared-core": "2.26.0",
39
+ "@budibase/string-templates": "2.26.0",
40
40
  "@spectrum-css/accordion": "3.0.24",
41
41
  "@spectrum-css/actionbutton": "1.0.1",
42
42
  "@spectrum-css/actiongroup": "1.0.1",
@@ -103,5 +103,5 @@
103
103
  }
104
104
  }
105
105
  },
106
- "gitHead": "75d949ef66bf20519446d3999c3412e106ef561d"
106
+ "gitHead": "a7b9a5e059543bc51a4d3393dd1f54bc98d61dec"
107
107
  }
@@ -11,6 +11,7 @@
11
11
  export let error = null
12
12
  export let validate = null
13
13
  export let suffix = null
14
+ export let validateOn = "change"
14
15
 
15
16
  const dispatch = createEventDispatcher()
16
17
 
@@ -24,7 +25,16 @@
24
25
  const newValue = e.target.value
25
26
  dispatch("change", newValue)
26
27
  value = newValue
27
- if (validate) {
28
+ if (validate && (error || validateOn === "change")) {
29
+ error = validate(newValue)
30
+ }
31
+ }
32
+
33
+ const onBlur = e => {
34
+ focused = false
35
+ const newValue = e.target.value
36
+ dispatch("blur", newValue)
37
+ if (validate && validateOn === "blur") {
28
38
  error = validate(newValue)
29
39
  }
30
40
  }
@@ -61,7 +71,7 @@
61
71
  type={type || "text"}
62
72
  on:input={onChange}
63
73
  on:focus={() => (focused = true)}
64
- on:blur={() => (focused = false)}
74
+ on:blur={onBlur}
65
75
  class:placeholder
66
76
  bind:this={ref}
67
77
  />