Skip to content

Commit 5b96421

Browse files
committed
chore(merge): continuous
2 parents 395b88a + d90c704 commit 5b96421

File tree

4 files changed

+23
-26
lines changed

4 files changed

+23
-26
lines changed

src/client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@
3737
},
3838
"flat": true,
3939
"dependencies": {
40-
"@rapid-build-ui/rb-base": "^0.0.5"
40+
"@rapid-build-ui/rb-base": "^0.0.6"
4141
}
4242
}

src/client/scripts/validation/validation.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,16 @@ const Validation = Base => class extends Base {
7474
this.rb.events.emit(this, 'validated', { // ex: appender.js
7575
detail: { validity }
7676
});
77+
this.setChildrenValidity(validity)
7778
}
79+
80+
setChildrenValidity(validity) {
81+
const rbChildrenFormControls = Helpers.getRbFormControls(this.shadowRoot);
82+
for (const control of rbChildrenFormControls) {
83+
control.setValidity({ valid: validity.valid, message: '' })
84+
}
85+
}
86+
7887
setPristine() { // :void
7988
// console.log(`${this.localName.toUpperCase()}:`, 'set pristine');
8089
this.setDirty({ blurred: false, dirty: false });

src/client/scripts/validation/validators.js

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,8 @@ import Messages from './messages.js'
77
/* Helpers (all return boolean)
88
**********/
99
const Help = {
10-
arrayRequired(val, params) {
11-
var fn, isValid, item, j, len;
12-
isValid = false;
13-
if (!val) return isValid;
14-
if (params.generalArray) return !!val.length;
15-
fn = item => {
16-
if (!item.selected) return;
17-
return isValid = true;
18-
};
19-
for (j = 0, len = val.length; j < len; j++) {
20-
item = val[j];
21-
fn(item);
22-
}
23-
return isValid;
10+
arrayRequired(val) {
11+
return !!val.length;
2412
},
2513

2614
stringRequired(val) {
@@ -236,9 +224,9 @@ const Validators = {
236224
return {valid: val.match(params)};
237225
},
238226

239-
required(val, params) {
227+
required(val) {
240228
const valid = Type.is.array(val) ?
241-
Help.arrayRequired(val, params) :
229+
Help.arrayRequired(val) :
242230
Help.stringRequired(val);
243231
return {
244232
valid,

src/client/yarn.lock

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22
# yarn lockfile v1
33

44

5-
"@rapid-build-ui/rb-base@^0.0.5":
6-
version "0.0.5"
7-
resolved "https://registry.yarnpkg.com/@rapid-build-ui/rb-base/-/rb-base-0.0.5.tgz#dfb60084d78c40a762c59e25c07a9660b657b1e9"
8-
integrity sha512-BD4KXPJSVeHy3uRtWW5ofRK7vdTNP67xrEnMppjbDcVak9lBF19wetIX7ovDivlTywp2QPkNnST/OViF1LVQtg==
5+
"@rapid-build-ui/rb-base@^0.0.6":
6+
version "0.0.6"
7+
resolved "https://registry.yarnpkg.com/@rapid-build-ui/rb-base/-/rb-base-0.0.6.tgz#f6ed9d11fb696f6159f197b65ba2a4820a9f8cd1"
8+
integrity sha512-aSuPWmfFrUezxM7KnyzcRuNutVds97fYCp7T2CHhAd4YXZP65tSdMoLHIZ+0+ZXMaV95CKTaxd5NlIZeew4zmg==
99
dependencies:
10-
lit-html "^0.13.0"
10+
lit-html "^0.14.0"
1111
skatejs "^5.2.4"
1212

13-
lit-html@^0.13.0:
14-
version "0.13.0"
15-
resolved "https://registry.yarnpkg.com/lit-html/-/lit-html-0.13.0.tgz#d05e7fe8ade572432120339c451c614669788adf"
16-
integrity sha512-p3R2ji/ucNVG5skguy8WufmSYIdMiTTb9ObUVYM2bOuvIXzDnUiePXGwP5BDbKssW1K6fw1Oj/M07FzdPLsTXw==
13+
lit-html@^0.14.0:
14+
version "0.14.0"
15+
resolved "https://registry.yarnpkg.com/lit-html/-/lit-html-0.14.0.tgz#d6830e8f55fb923b0f5824decf7da082a1d22997"
16+
integrity sha512-+xqUPzzJGEDqb0F5DOnMXvL0jxpkKebAMlXycKZxFtzlmD+qePEmYrEUPF9XVXcc5eYBzYXTCOUcjSCod4YvgQ==
1717

1818
skatejs@^5.2.4:
1919
version "5.2.4"

0 commit comments

Comments
 (0)