@inriver/inri 1.34.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.
- package/.changeset/afraid-tips-shop.md +5 -0
- package/CHANGELOG.md +23 -0
- package/package.json +1 -1
- package/src/i18n/en/index.ts +4 -0
- package/src/plugins/validationRules.ts +15 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
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
|
+
|
|
3
26
|
## 1.34.0
|
|
4
27
|
|
|
5
28
|
### Minor Changes
|
package/package.json
CHANGED
package/src/i18n/en/index.ts
CHANGED
|
@@ -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,
|