@inriver/inri 1.33.0 → 1.35.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.
@@ -0,0 +1,5 @@
1
+ ---
2
+ "@inriver/inri": minor
3
+ ---
4
+
5
+ Add notBlank validator
@@ -0,0 +1,5 @@
1
+ ---
2
+ "@inriver/inri": patch
3
+ ---
4
+
5
+ Add error slot in CSelect
package/CHANGELOG.md CHANGED
@@ -1,5 +1,50 @@
1
1
  # @inriver/inri
2
2
 
3
+ ## 1.35.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Add notBlank validator
8
+ - Update documentation
9
+ - Add correct class to the c-btn component
10
+ - Wallop font is now included in the package
11
+ - Updating README and exporting tailwing config
12
+
13
+ ### Patch Changes
14
+
15
+ - Provide global app configs
16
+ - Fix CSelect placeholder color. Modularize Sass imports. Include inri typings when bundling
17
+ - Fix Sass warnings and errors by removing usage of @apply and updating Quasar + sass dependencies
18
+ - Add support for showing tooltips when hovering over CSelect and options. Add disable support and styling. Fix required validation to work with empty arrays.
19
+ - Fix broken imports due to faulty declaration file
20
+ - Add support for hiding the sidebars in CLayoutWithSidebars. Add support for entering a custom title in CLayoutWithSidebars
21
+ - Add support for showing placeholder ()in CSelect eoutside of use-input mode
22
+ - Fix faulty import path in globalAppConfig
23
+ - Add error slot in CSelect
24
+ - Fix error when CSelect is passed object options with falsy values
25
+
26
+ ## 1.34.0
27
+
28
+ ### Minor Changes
29
+
30
+ - Update documentation
31
+ - Add correct class to the c-btn component
32
+ - Wallop font is now included in the package
33
+ - Updating README and exporting tailwing config
34
+
35
+ ### Patch Changes
36
+
37
+ - Provide global app configs
38
+ - Fix CSelect placeholder color. Modularize Sass imports. Include inri typings when bundling
39
+ - Fix Sass warnings and errors by removing usage of @apply and updating Quasar + sass dependencies
40
+ - Add support for showing tooltips when hovering over CSelect and options. Add disable support and styling. Fix required validation to work with empty arrays.
41
+ - Fix broken imports due to faulty declaration file
42
+ - Add support for hiding the sidebars in CLayoutWithSidebars. Add support for entering a custom title in CLayoutWithSidebars
43
+ - Add support for showing placeholder ()in CSelect eoutside of use-input mode
44
+ - Fix faulty import path in globalAppConfig
45
+ - Add error slot in CSelect
46
+ - Fix error when CSelect is passed object options with falsy values
47
+
3
48
  ## 1.33.0
4
49
 
5
50
  ### Minor Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inriver/inri",
3
- "version": "1.33.0",
3
+ "version": "1.35.0",
4
4
  "main": "index.ts",
5
5
  "peerDependencies": {
6
6
  "quasar": "2.14.2",
@@ -103,6 +103,10 @@
103
103
  </c-tooltip>
104
104
  </q-item>
105
105
  </template>
106
+
107
+ <template #error>
108
+ <slot name="error" />
109
+ </template>
106
110
  </q-select>
107
111
  </template>
108
112
 
@@ -8,6 +8,7 @@ export default {
8
8
  url: 'This field must be a valid URL',
9
9
  https: 'This field must be a valid URL using https',
10
10
  extension: 'Valid file extensions: {extensions}',
11
+ notBlank: 'This field can not be left empty',
11
12
  contains: 'This field is not valid. Must contain {match}',
12
13
  notContains: 'This field is not valid. Must not contain {match}',
13
14
  notBeginsWith: 'This field is not valid. Must not begin with {match}',
@@ -16,6 +17,9 @@ export default {
16
17
  maxImageSize: 'Images can be no larger than {size}',
17
18
  fileSizeTooBig: 'file size too big',
18
19
  fileTypeInvalid: 'file type invalid',
20
+ incorrect_validator_usage: {
21
+ notBlank: 'Validator "notBlank" can not be used on non-string fields',
22
+ },
19
23
  },
20
24
  error: {
21
25
  unauthorized: 'Unauthorized',
@@ -132,6 +132,20 @@ export function extension (fileExtensions: string, msg?: string) {
132
132
  }
133
133
  }
134
134
 
135
+ /**
136
+ * The value must not be blank (can not be empty nor contain only whitespaces).
137
+ * @param {string} [msg] - Override the default error message
138
+ */
139
+ export function notBlank (msg?: string) {
140
+ return (value): true | string => {
141
+ if (typeof value !== 'string') {
142
+ return $t('inri.validation.incorrect_validator_usage.notBlank')
143
+ }
144
+
145
+ return (value.length > 0 && value.replace(/\s/g, '').length > 0) || msg || $t('inri.validation.notBlank')
146
+ }
147
+ }
148
+
135
149
  /**
136
150
  * The value must contain all the strings in the array.
137
151
  * @param {string[]} arr - Array of strings.
@@ -284,6 +298,7 @@ export const rules = {
284
298
  url,
285
299
  https,
286
300
  extension,
301
+ notBlank,
287
302
  contains,
288
303
  notContains,
289
304
  notBeginsWith,