@rh-support/components 1.1.84 → 1.2.1

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.
@@ -1 +1 @@
1
- {"version":3,"file":"CustomTextInput.d.ts","sourceRoot":"","sources":["../../../src/CustomTextInput/CustomTextInput.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAa,cAAc,EAAoB,MAAM,wBAAwB,CAAC;AAIrF,UAAU,MAAO,SAAQ,cAAc;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,eAAO,MAAM,eAAe,UAAW,MAAM,gBAmD5C,CAAC"}
1
+ {"version":3,"file":"CustomTextInput.d.ts","sourceRoot":"","sources":["../../../src/CustomTextInput/CustomTextInput.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAa,cAAc,EAAoB,MAAM,wBAAwB,CAAC;AAIrF,UAAU,MAAO,SAAQ,cAAc;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,eAAO,MAAM,eAAe,UAAW,MAAM,gBAqD5C,CAAC"}
@@ -40,17 +40,19 @@ var CustomTextInput = function (props) {
40
40
  };
41
41
  // Function to check for validity
42
42
  var validatedCheck = function () {
43
- if (validated === 'error') {
44
- return 'error';
43
+ if (!lodash_1.isEmpty(value)) {
44
+ if (validated === 'error') {
45
+ return 'error';
46
+ }
47
+ else if (isSpaceAllowed) {
48
+ return validated;
49
+ }
50
+ else if (!isSpaceAllowed) {
51
+ return lodash_1.isEmpty(value === null || value === void 0 ? void 0 : value.trim()) ? 'error' : 'default';
52
+ }
53
+ else
54
+ return validated;
45
55
  }
46
- else if (isSpaceAllowed) {
47
- return validated;
48
- }
49
- else if (!isSpaceAllowed) {
50
- return lodash_1.isEmpty(value === null || value === void 0 ? void 0 : value.trim()) ? 'error' : 'default';
51
- }
52
- else
53
- return validated;
54
56
  };
55
57
  return (react_1.default.createElement(react_core_1.TextInput, __assign({}, rest, { isRequired: isRequired, className: className, type: type, maxLength: maxLength, value: value, isDisabled: isDisabled, "aria-label": props['aria-label'], placeholder: placeholder, onChange: onTextInputChange, validated: validatedCheck(), name: name })));
56
58
  };
@@ -1 +1 @@
1
- {"version":3,"file":"CustomTextInput.d.ts","sourceRoot":"","sources":["../../../src/CustomTextInput/CustomTextInput.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAa,cAAc,EAAoB,MAAM,wBAAwB,CAAC;AAIrF,UAAU,MAAO,SAAQ,cAAc;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,eAAO,MAAM,eAAe,UAAW,MAAM,gBAmD5C,CAAC"}
1
+ {"version":3,"file":"CustomTextInput.d.ts","sourceRoot":"","sources":["../../../src/CustomTextInput/CustomTextInput.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAa,cAAc,EAAoB,MAAM,wBAAwB,CAAC;AAIrF,UAAU,MAAO,SAAQ,cAAc;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,eAAO,MAAM,eAAe,UAAW,MAAM,gBAqD5C,CAAC"}
@@ -23,17 +23,19 @@ export const CustomTextInput = (props) => {
23
23
  };
24
24
  // Function to check for validity
25
25
  const validatedCheck = () => {
26
- if (validated === 'error') {
27
- return 'error';
26
+ if (!isEmpty(value)) {
27
+ if (validated === 'error') {
28
+ return 'error';
29
+ }
30
+ else if (isSpaceAllowed) {
31
+ return validated;
32
+ }
33
+ else if (!isSpaceAllowed) {
34
+ return isEmpty(value === null || value === void 0 ? void 0 : value.trim()) ? 'error' : 'default';
35
+ }
36
+ else
37
+ return validated;
28
38
  }
29
- else if (isSpaceAllowed) {
30
- return validated;
31
- }
32
- else if (!isSpaceAllowed) {
33
- return isEmpty(value === null || value === void 0 ? void 0 : value.trim()) ? 'error' : 'default';
34
- }
35
- else
36
- return validated;
37
39
  };
38
40
  return (React.createElement(TextInput, Object.assign({}, rest, { isRequired: isRequired, className: className, type: type, maxLength: maxLength, value: value, isDisabled: isDisabled, "aria-label": props['aria-label'], placeholder: placeholder, onChange: onTextInputChange, validated: validatedCheck(), name: name })));
39
41
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/components",
3
- "version": "1.1.84",
3
+ "version": "1.2.1",
4
4
  "description": "Contains all reusabel components for support app",
5
5
  "author": "Vikas Rathee <vrathee@redhat.com>",
6
6
  "license": "ISC",
@@ -52,7 +52,7 @@
52
52
  "prepublishOnly": "npm run build"
53
53
  },
54
54
  "peerDependencies": {
55
- "@cee-eng/hydrajs": "4.12.7",
55
+ "@cee-eng/hydrajs": "4.13.0",
56
56
  "@cee-eng/ui-toolkit": "1.1.6",
57
57
  "@patternfly/patternfly": "4.196.7",
58
58
  "@patternfly/react-core": "4.202.16",
@@ -79,14 +79,14 @@
79
79
  "use-deep-compare-effect": "^1.6.1"
80
80
  },
81
81
  "dependencies": {
82
- "@cee-eng/hydrajs": "4.12.7",
82
+ "@cee-eng/hydrajs": "4.13.0",
83
83
  "@cee-eng/ui-toolkit": "1.1.6",
84
84
  "@patternfly/patternfly": "4.196.7",
85
85
  "@patternfly/react-core": "4.202.16",
86
86
  "@patternfly/react-table": "4.71.16",
87
87
  "@rh-support/types": "0.2.0",
88
- "@rh-support/user-permissions": "0.2.68",
89
- "@rh-support/utils": "0.2.50",
88
+ "@rh-support/user-permissions": "1.0.1",
89
+ "@rh-support/utils": "1.0.1",
90
90
  "@storybook/addon-a11y": "^5.3.19",
91
91
  "@storybook/addon-actions": "^5.3.19",
92
92
  "@storybook/addon-docs": "^5.3.19",
@@ -126,5 +126,5 @@
126
126
  "not ie <= 11",
127
127
  "not op_mini all"
128
128
  ],
129
- "gitHead": "d1025a2463c9e2bac873dd764a02518fbb5b5e47"
129
+ "gitHead": "4c44ec177438ff8e09a761a4f38ce3fbd83c7aaa"
130
130
  }