iguazio.dashboard-react-controls 1.9.0 → 1.9.2
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/dist/components/FormChipCell/NewChipForm/NewChipForm.js +1 -1
- package/dist/components/FormChipCell/NewChipForm/newChipForm.scss +14 -14
- package/dist/components/FormCombobox/FormCombobox.js +2 -2
- package/dist/components/FormInput/FormInput.js +9 -3
- package/dist/components/FormTextarea/FormTextarea.js +2 -2
- package/dist/components/Tip/Tip.js +6 -2
- package/dist/constants.js +56 -13
- package/dist/scss/mixins.scss +8 -0
- package/dist/utils/validation.util.js +34 -34
- package/package.json +1 -1
- /package/dist/images/{invalid.svg → exclamation-mark.svg} +0 -0
|
@@ -100,7 +100,7 @@ var NewChipForm = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
|
100
100
|
var labelKeyClassName = (0, _classnames.default)(className, !editConfig.isKeyFocused && 'item_edited', !(0, _lodash.isEmpty)((0, _lodash.get)(meta, ['error', chipIndex, 'key'], [])) && !(0, _lodash.isEmpty)(chipData.key) && 'item_edited_invalid');
|
|
101
101
|
var labelContainerClassName = (0, _classnames.default)('edit-chip-container', background && "edit-chip-container-background_".concat(background), borderColor && "edit-chip-container-border_".concat(borderColor), font && "edit-chip-container-font_".concat(font), density && "edit-chip-container-density_".concat(density), borderRadius && "edit-chip-container-border_".concat(borderRadius), (editConfig.isEdit || editConfig.isNewChip) && 'edit-chip-container_edited');
|
|
102
102
|
var labelValueClassName = (0, _classnames.default)('input-label-value', !editConfig.isValueFocused && 'item_edited', !(0, _lodash.isEmpty)((0, _lodash.get)(meta, ['error', chipIndex, 'value'], [])) && !(0, _lodash.isEmpty)(chipData.value) && 'item_edited_invalid');
|
|
103
|
-
var closeButtonClass = (0, _classnames.default)('
|
|
103
|
+
var closeButtonClass = (0, _classnames.default)('item-icon-close', (editConfig.chipIndex === chipIndex || !isEditable) && 'item-icon-close_hidden');
|
|
104
104
|
(0, _react.useLayoutEffect)(function () {
|
|
105
105
|
if (!chipData.keyFieldWidth && !chipData.valueFieldWidth) {
|
|
106
106
|
var currentWidthKeyInput = refInputKey.current.scrollWidth + 1;
|
|
@@ -51,23 +51,23 @@
|
|
|
51
51
|
&-font {
|
|
52
52
|
@include chipsFont(EditableChip);
|
|
53
53
|
}
|
|
54
|
+
|
|
55
|
+
.item-icon-close {
|
|
56
|
+
display: flex;
|
|
57
|
+
align-items: center;
|
|
58
|
+
justify-content: center;
|
|
59
|
+
|
|
60
|
+
&_hidden {
|
|
61
|
+
visibility: hidden;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
svg {
|
|
65
|
+
transform: scale(0.7);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
54
68
|
}
|
|
55
69
|
|
|
56
70
|
&-separator {
|
|
57
71
|
margin-right: 5px;
|
|
58
72
|
}
|
|
59
|
-
|
|
60
|
-
&__icon-close {
|
|
61
|
-
display: flex;
|
|
62
|
-
align-items: center;
|
|
63
|
-
justify-content: center;
|
|
64
|
-
|
|
65
|
-
&_hidden {
|
|
66
|
-
visibility: hidden;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
svg {
|
|
70
|
-
transform: scale(0.7);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
73
|
}
|
|
@@ -20,7 +20,7 @@ var _types = require("../../types");
|
|
|
20
20
|
var _arrow = require("../../images/arrow.svg");
|
|
21
21
|
var _search = require("../../images/search.svg");
|
|
22
22
|
var _warning = require("../../images/warning.svg");
|
|
23
|
-
var
|
|
23
|
+
var _exclamationMark = require("../../images/exclamation-mark.svg");
|
|
24
24
|
require("./formCombobox.scss");
|
|
25
25
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
26
26
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -447,7 +447,7 @@ var FormCombobox = function FormCombobox(_ref) {
|
|
|
447
447
|
text: (_meta$error$label = (_meta$error = meta.error) === null || _meta$error === void 0 ? void 0 : _meta$error.label) !== null && _meta$error$label !== void 0 ? _meta$error$label : invalidText,
|
|
448
448
|
warning: true
|
|
449
449
|
}),
|
|
450
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
450
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_exclamationMark.ReactComponent, {})
|
|
451
451
|
}), isInvalid && Array.isArray(meta.error) && /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
|
|
452
452
|
className: "form-field__warning",
|
|
453
453
|
onClick: warningIconClick,
|
|
@@ -17,7 +17,8 @@ var _components = require("../../components");
|
|
|
17
17
|
var _types = require("../../types");
|
|
18
18
|
var _validation = require("../../utils/validation.util");
|
|
19
19
|
var _hooks = require("../../hooks");
|
|
20
|
-
var
|
|
20
|
+
var _constants = require("../../constants");
|
|
21
|
+
var _exclamationMark = require("../../images/exclamation-mark.svg");
|
|
21
22
|
var _popout = require("../../images/popout.svg");
|
|
22
23
|
var _warning = require("../../images/warning.svg");
|
|
23
24
|
require("./formInput.scss");
|
|
@@ -115,6 +116,7 @@ var FormInput = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
|
115
116
|
(_ref2 = ref) !== null && _ref2 !== void 0 ? _ref2 : ref = wrapperRef;
|
|
116
117
|
var inputRef = (0, _react.useRef)();
|
|
117
118
|
var errorsRef = (0, _react.useRef)();
|
|
119
|
+
var isRequiredRulePresentRef = (0, _react.useRef)(false);
|
|
118
120
|
(0, _hooks.useDetectOutsideClick)(ref, function () {
|
|
119
121
|
return setShowValidationRules(false);
|
|
120
122
|
});
|
|
@@ -150,7 +152,11 @@ var FormInput = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
|
150
152
|
}, [focused]);
|
|
151
153
|
(0, _react.useEffect)(function () {
|
|
152
154
|
setValidationRules(function () {
|
|
155
|
+
isRequiredRulePresentRef.current = false;
|
|
153
156
|
return rules.map(function (rule) {
|
|
157
|
+
if (rule.name === _constants.validation.REQUIRED.NAME) {
|
|
158
|
+
isRequiredRulePresentRef.current = true;
|
|
159
|
+
}
|
|
154
160
|
return _objectSpread(_objectSpread({}, rule), {}, {
|
|
155
161
|
isValid: !errorsRef.current || !Array.isArray(errorsRef.current) ? true : !errorsRef.current.some(function (err) {
|
|
156
162
|
return err.name === rule.name;
|
|
@@ -212,7 +218,7 @@ var FormInput = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
|
212
218
|
var valueToValidate = (0, _lodash.isNil)(value) ? '' : String(value);
|
|
213
219
|
if (isValueEmptyAndValid(valueToValidate)) return;
|
|
214
220
|
var validationError = null;
|
|
215
|
-
if (required && valueToValidate.trim().length === 0) {
|
|
221
|
+
if (required && valueToValidate.trim().length === 0 && !isRequiredRulePresentRef.current) {
|
|
216
222
|
validationError = {
|
|
217
223
|
name: 'required',
|
|
218
224
|
label: customRequiredLabel || 'This field is required'
|
|
@@ -384,7 +390,7 @@ var FormInput = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
|
384
390
|
text: (_errorsRef$current$la = (_errorsRef$current = errorsRef.current) === null || _errorsRef$current === void 0 ? void 0 : _errorsRef$current.label) !== null && _errorsRef$current$la !== void 0 ? _errorsRef$current$la : invalidText,
|
|
385
391
|
warning: true
|
|
386
392
|
}),
|
|
387
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
393
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_exclamationMark.ReactComponent, {})
|
|
388
394
|
}), isInvalid && Array.isArray(errorsRef.current) && /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
|
|
389
395
|
className: "form-field__warning",
|
|
390
396
|
onClick: toggleValidationRulesMenu,
|
|
@@ -12,7 +12,7 @@ var _reactFinalForm = require("react-final-form");
|
|
|
12
12
|
var _TextTooltipTemplate = _interopRequireDefault(require("../TooltipTemplate/TextTooltipTemplate"));
|
|
13
13
|
var _Tip = _interopRequireDefault(require("../Tip/Tip"));
|
|
14
14
|
var _Tooltip = _interopRequireDefault(require("../Tooltip/Tooltip"));
|
|
15
|
-
var
|
|
15
|
+
var _exclamationMark = require("../../images/exclamation-mark.svg");
|
|
16
16
|
require("./formTextarea.scss");
|
|
17
17
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
18
|
var _excluded = ["className", "disabled", "focused", "iconClass", "invalidText", "label", "maxLength", "name", "onBlur", "onChange", "required", "textAreaIcon", "tip", "withoutBorder"];
|
|
@@ -162,7 +162,7 @@ var FormTextarea = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
|
162
162
|
text: (_meta$error$label = (_meta$error = meta.error) === null || _meta$error === void 0 ? void 0 : _meta$error.label) !== null && _meta$error$label !== void 0 ? _meta$error$label : invalidText,
|
|
163
163
|
warning: true
|
|
164
164
|
}),
|
|
165
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
165
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_exclamationMark.ReactComponent, {})
|
|
166
166
|
}), tip && !required && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tip.default, {
|
|
167
167
|
text: tip,
|
|
168
168
|
className: "form-field__tip"
|
|
@@ -11,6 +11,7 @@ var _reactTransitionGroup = require("react-transition-group");
|
|
|
11
11
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
12
12
|
var _reactDom = require("react-dom");
|
|
13
13
|
var _questionMark = require("../../images/question-mark.svg");
|
|
14
|
+
var _exclamationMark = require("../../images/exclamation-mark.svg");
|
|
14
15
|
var _tip = _interopRequireDefault(require("./tip.scss"));
|
|
15
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
17
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -43,7 +44,8 @@ var iconLength = parseInt(_tip.default.iconlength);
|
|
|
43
44
|
var minTextLength = 40;
|
|
44
45
|
var Tip = function Tip(_ref) {
|
|
45
46
|
var className = _ref.className,
|
|
46
|
-
text = _ref.text
|
|
47
|
+
text = _ref.text,
|
|
48
|
+
withExclamationMark = _ref.withExclamationMark;
|
|
47
49
|
var _useState = (0, _react.useState)(false),
|
|
48
50
|
_useState2 = _slicedToArray(_useState, 2),
|
|
49
51
|
isShow = _useState2[0],
|
|
@@ -92,7 +94,9 @@ var Tip = function Tip(_ref) {
|
|
|
92
94
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
93
95
|
ref: iconRef,
|
|
94
96
|
className: "tip-wrapper",
|
|
95
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
97
|
+
children: withExclamationMark ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_exclamationMark.ReactComponent, {
|
|
98
|
+
"data-testid": "tip-icon"
|
|
99
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_questionMark.ReactComponent, {
|
|
96
100
|
"data-testid": "tip-icon"
|
|
97
101
|
})
|
|
98
102
|
}), /*#__PURE__*/(0, _reactDom.createPortal)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactTransitionGroup.CSSTransition, {
|
package/dist/constants.js
CHANGED
|
@@ -46,19 +46,62 @@ var LABEL_BUTTON = 'label';
|
|
|
46
46
|
/*=========== VALITATION =============*/
|
|
47
47
|
exports.LABEL_BUTTON = LABEL_BUTTON;
|
|
48
48
|
var validation = {
|
|
49
|
-
BEGIN_END_NOT_WITH:
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
49
|
+
BEGIN_END_NOT_WITH: {
|
|
50
|
+
LABEL: 'Must not begin and end with',
|
|
51
|
+
NAME: 'beginEndNot'
|
|
52
|
+
},
|
|
53
|
+
BEGIN_END_WITH: {
|
|
54
|
+
LABEL: 'Must begin and end with',
|
|
55
|
+
NAME: 'beginEnd'
|
|
56
|
+
},
|
|
57
|
+
BEGIN_NOT_WITH: {
|
|
58
|
+
LABEL: 'Must not begin with',
|
|
59
|
+
NAME: 'beginNot'
|
|
60
|
+
},
|
|
61
|
+
BEGIN_WITH: {
|
|
62
|
+
LABEL: 'Must begin with',
|
|
63
|
+
NAME: 'begin'
|
|
64
|
+
},
|
|
65
|
+
END_NOT_WITH: {
|
|
66
|
+
LABEL: 'Must not end with',
|
|
67
|
+
NAME: 'endNot'
|
|
68
|
+
},
|
|
69
|
+
END_WITH: {
|
|
70
|
+
LABEL: 'Must end with',
|
|
71
|
+
NAME: 'end'
|
|
72
|
+
},
|
|
73
|
+
MUST_CONTAIN_EXACTLY_ONE: {
|
|
74
|
+
LABEL: 'Must contain exactly one',
|
|
75
|
+
NAME: 'exactlyOne'
|
|
76
|
+
},
|
|
77
|
+
MUST_HAVE_DOT_AFTER_AT: {
|
|
78
|
+
LABEL: 'Must have at least one . after @',
|
|
79
|
+
NAME: 'dotAfterAt'
|
|
80
|
+
},
|
|
81
|
+
MUST_NOT_BE: {
|
|
82
|
+
LABEL: 'Must not be',
|
|
83
|
+
NAME: 'mustNotBe'
|
|
84
|
+
},
|
|
85
|
+
NO_CONSECUTIVE_CHARACTER: {
|
|
86
|
+
LABEL: 'No consecutive characters',
|
|
87
|
+
NAME: 'noConsecutiveCharacters'
|
|
88
|
+
},
|
|
89
|
+
ONLY_AT_THE_BEGINNING: {
|
|
90
|
+
LABEL: 'Only at the beginning',
|
|
91
|
+
NAME: 'onlyAtTheBeginning'
|
|
92
|
+
},
|
|
93
|
+
REQUIRED: {
|
|
94
|
+
LABEL: 'This field is required',
|
|
95
|
+
NAME: 'required'
|
|
96
|
+
},
|
|
97
|
+
VALID_CHARACTERS_WITH_REFIX: {
|
|
98
|
+
LABEL: 'Valid characters',
|
|
99
|
+
NAME: 'validCharactersWithPrefix'
|
|
100
|
+
},
|
|
101
|
+
VALID_CHARACTERS: {
|
|
102
|
+
LABEL: 'Valid characters',
|
|
103
|
+
NAME: 'validCharacters'
|
|
104
|
+
}
|
|
62
105
|
};
|
|
63
106
|
|
|
64
107
|
/*=========== STATUS CODES =============*/
|
package/dist/scss/mixins.scss
CHANGED
|
@@ -166,67 +166,67 @@ exports.checkPatternsValidityAsync = checkPatternsValidityAsync;
|
|
|
166
166
|
var generateRule = {
|
|
167
167
|
beginWith: function beginWith(chars) {
|
|
168
168
|
return {
|
|
169
|
-
name:
|
|
170
|
-
label: _constants.validation.BEGIN_WITH + ': ' + convertToLabel(chars),
|
|
169
|
+
name: _constants.validation.BEGIN_WITH.NAME,
|
|
170
|
+
label: _constants.validation.BEGIN_WITH.LABEL + ': ' + convertToLabel(chars),
|
|
171
171
|
pattern: new RegExp('^[' + convertToPattern(chars) + ']')
|
|
172
172
|
};
|
|
173
173
|
},
|
|
174
174
|
beginNotWith: function beginNotWith(chars) {
|
|
175
175
|
return {
|
|
176
|
-
name:
|
|
177
|
-
label: _constants.validation.BEGIN_NOT_WITH + ': ' + convertToLabel(chars),
|
|
176
|
+
name: _constants.validation.BEGIN_NOT_WITH.NAME,
|
|
177
|
+
label: _constants.validation.BEGIN_NOT_WITH.LABEL + ': ' + convertToLabel(chars),
|
|
178
178
|
pattern: new RegExp('^[^' + convertToPattern(chars) + ']')
|
|
179
179
|
};
|
|
180
180
|
},
|
|
181
181
|
endWith: function endWith(chars) {
|
|
182
182
|
return {
|
|
183
|
-
name:
|
|
184
|
-
label: _constants.validation.END_WITH + ': ' + convertToLabel(chars),
|
|
183
|
+
name: _constants.validation.END_WITH.NAME,
|
|
184
|
+
label: _constants.validation.END_WITH.LABEL + ': ' + convertToLabel(chars),
|
|
185
185
|
pattern: new RegExp('[' + convertToPattern(chars) + ']$')
|
|
186
186
|
};
|
|
187
187
|
},
|
|
188
188
|
endNotWith: function endNotWith(chars) {
|
|
189
189
|
return {
|
|
190
|
-
name:
|
|
191
|
-
label: _constants.validation.END_NOT_WITH + ': ' + convertToLabel(chars),
|
|
190
|
+
name: _constants.validation.END_NOT_WITH.NAME,
|
|
191
|
+
label: _constants.validation.END_NOT_WITH.LABEL + ': ' + convertToLabel(chars),
|
|
192
192
|
pattern: new RegExp('[^' + convertToPattern(chars) + ']$')
|
|
193
193
|
};
|
|
194
194
|
},
|
|
195
195
|
beginEndWith: function beginEndWith(chars) {
|
|
196
196
|
var convertedPattern = convertToPattern(chars);
|
|
197
197
|
return {
|
|
198
|
-
name:
|
|
199
|
-
label: _constants.validation.BEGIN_END_WITH + ': ' + convertToLabel(chars),
|
|
198
|
+
name: _constants.validation.BEGIN_END_WITH.NAME,
|
|
199
|
+
label: _constants.validation.BEGIN_END_WITH.LABEL + ': ' + convertToLabel(chars),
|
|
200
200
|
pattern: new RegExp('^([' + convertedPattern + '].*)?[' + convertedPattern + ']$')
|
|
201
201
|
};
|
|
202
202
|
},
|
|
203
203
|
beginEndNotWith: function beginEndNotWith(chars) {
|
|
204
204
|
var convertedPattern = convertToPattern(chars);
|
|
205
205
|
return {
|
|
206
|
-
name:
|
|
207
|
-
label: _constants.validation.BEGIN_END_NOT_WITH + ': ' + convertToLabel(chars),
|
|
206
|
+
name: _constants.validation.BEGIN_END_NOT_WITH.NAME,
|
|
207
|
+
label: _constants.validation.BEGIN_END_NOT_WITH.LABEL + ': ' + convertToLabel(chars),
|
|
208
208
|
pattern: new RegExp('^([^' + convertedPattern + '].*)?[^' + convertedPattern + ']$')
|
|
209
209
|
};
|
|
210
210
|
},
|
|
211
211
|
onlyAtTheBeginning: function onlyAtTheBeginning(chars) {
|
|
212
212
|
var convertedPattern = convertToPattern(chars);
|
|
213
213
|
return {
|
|
214
|
-
name:
|
|
215
|
-
label: _constants.validation.ONLY_AT_THE_BEGINNING + ': ' + convertToLabel(chars),
|
|
214
|
+
name: _constants.validation.ONLY_AT_THE_BEGINNING.NAME,
|
|
215
|
+
label: _constants.validation.ONLY_AT_THE_BEGINNING.LABEL + ': ' + convertToLabel(chars),
|
|
216
216
|
pattern: new RegExp('^([' + convertedPattern + '])?[^' + convertedPattern + ']+$')
|
|
217
217
|
};
|
|
218
218
|
},
|
|
219
219
|
validCharacters: function validCharacters(chars) {
|
|
220
220
|
return {
|
|
221
|
-
name:
|
|
222
|
-
label: _constants.validation.VALID_CHARACTERS + ': ' + convertToLabel(chars),
|
|
221
|
+
name: _constants.validation.VALID_CHARACTERS.NAME,
|
|
222
|
+
label: _constants.validation.VALID_CHARACTERS.LABEL + ': ' + convertToLabel(chars),
|
|
223
223
|
pattern: new RegExp('^[' + convertToPattern(chars) + ']+$')
|
|
224
224
|
};
|
|
225
225
|
},
|
|
226
226
|
validCharactersWithPrefix: function validCharactersWithPrefix(chars) {
|
|
227
227
|
return {
|
|
228
|
-
name:
|
|
229
|
-
label: _constants.validation.
|
|
228
|
+
name: _constants.validation.VALID_CHARACTERS_WITH_REFIX.NAME,
|
|
229
|
+
label: _constants.validation.VALID_CHARACTERS_WITH_REFIX.LABEL + ': ' + convertToLabel(chars),
|
|
230
230
|
pattern: new RegExp('^([' + convertToPattern(chars) + ']+/)?[' + convertToPattern(chars) + ']+$')
|
|
231
231
|
};
|
|
232
232
|
},
|
|
@@ -236,8 +236,8 @@ var generateRule = {
|
|
|
236
236
|
return "(?!.*\\".concat(charsPairArray[0], "\\").concat(charsPairArray[1], ")");
|
|
237
237
|
}).join('');
|
|
238
238
|
return {
|
|
239
|
-
name:
|
|
240
|
-
label: _constants.validation.NO_CONSECUTIVE_CHARACTER + ': ' + convertToLabel(chars),
|
|
239
|
+
name: _constants.validation.NO_CONSECUTIVE_CHARACTER.NAME,
|
|
240
|
+
label: _constants.validation.NO_CONSECUTIVE_CHARACTER.LABEL + ': ' + convertToLabel(chars),
|
|
241
241
|
pattern: new RegExp('^' + convertedPattern)
|
|
242
242
|
};
|
|
243
243
|
},
|
|
@@ -255,8 +255,8 @@ var generateRule = {
|
|
|
255
255
|
mustNotBe: function mustNotBe(words) {
|
|
256
256
|
var wordsArray = words.split(' ');
|
|
257
257
|
return {
|
|
258
|
-
name:
|
|
259
|
-
label: _constants.validation.MUST_NOT_BE + ': ' + convertToLabel(words),
|
|
258
|
+
name: _constants.validation.MUST_NOT_BE.NAME,
|
|
259
|
+
label: _constants.validation.MUST_NOT_BE.LABEL + ': ' + convertToLabel(words),
|
|
260
260
|
pattern: function pattern(value) {
|
|
261
261
|
return !_lodash.default.includes(wordsArray, value);
|
|
262
262
|
}
|
|
@@ -276,8 +276,8 @@ var generateRule = {
|
|
|
276
276
|
},
|
|
277
277
|
required: function required() {
|
|
278
278
|
return {
|
|
279
|
-
name:
|
|
280
|
-
label: _constants.validation.REQUIRED,
|
|
279
|
+
name: _constants.validation.REQUIRED.NAME,
|
|
280
|
+
label: _constants.validation.REQUIRED.LABEL,
|
|
281
281
|
pattern: new RegExp('\\S')
|
|
282
282
|
};
|
|
283
283
|
}
|
|
@@ -285,11 +285,11 @@ var generateRule = {
|
|
|
285
285
|
var commonRules = {
|
|
286
286
|
prefixedQualifiedName: [{
|
|
287
287
|
name: 'nameValidCharacters',
|
|
288
|
-
label: "[Name] ".concat(_constants.validation.VALID_CHARACTERS, " : a\u2013z, A\u2013Z, 0\u20139, \u2013, _, ."),
|
|
288
|
+
label: "[Name] ".concat(_constants.validation.VALID_CHARACTERS.LABEL, " : a\u2013z, A\u2013Z, 0\u20139, \u2013, _, ."),
|
|
289
289
|
pattern: /^([^/]+\/)?[\w.-]+$/
|
|
290
290
|
}, {
|
|
291
291
|
name: 'nameBeginEnd',
|
|
292
|
-
label: "[Name] ".concat(_constants.validation.BEGIN_END_WITH, ": a\u2013z, A\u2013Z, 0\u20139"),
|
|
292
|
+
label: "[Name] ".concat(_constants.validation.BEGIN_END_WITH.LABEL, ": a\u2013z, A\u2013Z, 0\u20139"),
|
|
293
293
|
pattern: /^([^/]+\/)?([A-Za-z0-9][^/]*)?[A-Za-z0-9]$/
|
|
294
294
|
}, {
|
|
295
295
|
name: 'nameMaxLength',
|
|
@@ -297,11 +297,11 @@ var commonRules = {
|
|
|
297
297
|
pattern: /^([^/]+\/)?[^/]{1,63}$/
|
|
298
298
|
}, {
|
|
299
299
|
name: 'prefixValidCharacters',
|
|
300
|
-
label: "[Prefix] ".concat(_constants.validation.VALID_CHARACTERS, ": a\u2013z, 0\u20139, \u2013, ."),
|
|
300
|
+
label: "[Prefix] ".concat(_constants.validation.VALID_CHARACTERS.LABEL, ": a\u2013z, 0\u20139, \u2013, ."),
|
|
301
301
|
pattern: /^([a-z0-9.-]+\/)?[^/]+$/
|
|
302
302
|
}, {
|
|
303
303
|
name: 'prefixBeginEnd',
|
|
304
|
-
label: "[Prefix] ".concat(_constants.validation.BEGIN_END_WITH, ": a\u2013z, 0\u20139"),
|
|
304
|
+
label: "[Prefix] ".concat(_constants.validation.BEGIN_END_WITH.LABEL, ": a\u2013z, 0\u20139"),
|
|
305
305
|
pattern: /^([a-z0-9]([^/]*[a-z0-9])?\/)?[^/]+$/
|
|
306
306
|
}, {
|
|
307
307
|
name: 'prefixMaxLength',
|
|
@@ -311,7 +311,7 @@ var commonRules = {
|
|
|
311
311
|
k8sLabels: {
|
|
312
312
|
value: [{
|
|
313
313
|
name: 'valueBeginEnd',
|
|
314
|
-
label: "[Value] ".concat(_constants.validation.BEGIN_END_WITH, " : a\u2013z, A\u2013Z, 0\u20139"),
|
|
314
|
+
label: "[Value] ".concat(_constants.validation.BEGIN_END_WITH.LABEL, " : a\u2013z, A\u2013Z, 0\u20139"),
|
|
315
315
|
pattern: /^([^/]+\/)?([A-Za-z0-9][^/]*)?[A-Za-z0-9]$/
|
|
316
316
|
}, {
|
|
317
317
|
name: 'valueMaxLength',
|
|
@@ -319,20 +319,20 @@ var commonRules = {
|
|
|
319
319
|
pattern: /^([^/]+\/)?[^/]{1,63}$/
|
|
320
320
|
}, {
|
|
321
321
|
name: 'valueValidCharacters',
|
|
322
|
-
label: "[Value] ".concat(_constants.validation.VALID_CHARACTERS, ": a\u2013z, A\u2013Z, 0\u20139, \u2013, _, ."),
|
|
322
|
+
label: "[Value] ".concat(_constants.validation.VALID_CHARACTERS.LABEL, ": a\u2013z, A\u2013Z, 0\u20139, \u2013, _, ."),
|
|
323
323
|
pattern: /^[a-zA-Z0-9\-_.]+$/
|
|
324
324
|
}]
|
|
325
325
|
}
|
|
326
326
|
// email: [
|
|
327
327
|
// generateRule.beginEndNotWith('@ .'),
|
|
328
328
|
// {
|
|
329
|
-
// name:
|
|
330
|
-
// label: ValidationConstants.MUST_CONTAIN_EXACTLY_ONE + ': @',
|
|
329
|
+
// name: ValidationConstants.MUST_CONTAIN_EXACTLY_ONE.NAME,
|
|
330
|
+
// label: ValidationConstants.MUST_CONTAIN_EXACTLY_ONE.LABEL + ': @',
|
|
331
331
|
// pattern: /^[^@]+@[^@]+$/
|
|
332
332
|
// },
|
|
333
333
|
// {
|
|
334
|
-
// name:
|
|
335
|
-
// label: ValidationConstants.MUST_HAVE_DOT_AFTER_AT,
|
|
334
|
+
// name: ValidationConstants.MUST_HAVE_DOT_AFTER_AT.NAME,
|
|
335
|
+
// label: ValidationConstants.MUST_HAVE_DOT_AFTER_AT.LABEL,
|
|
336
336
|
// pattern: /@.+\..+$/
|
|
337
337
|
// }
|
|
338
338
|
// ]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "iguazio.dashboard-react-controls",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.2",
|
|
4
4
|
"description": "Collection of resources (such as CSS styles, fonts and images) and ReactJS 17.x components to share among different Iguazio React repos.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
File without changes
|