intelicoreact 0.1.61 → 0.1.65
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.
|
@@ -51,6 +51,8 @@ function InputMask() {
|
|
|
51
51
|
usePatternPlaceholder = _ref.usePatternPlaceholder,
|
|
52
52
|
_ref$maskAsPlaceholde = _ref.maskAsPlaceholder,
|
|
53
53
|
maskAsPlaceholder = _ref$maskAsPlaceholde === void 0 ? true : _ref$maskAsPlaceholde,
|
|
54
|
+
_ref$maxEditableLen = _ref.maxEditableLen,
|
|
55
|
+
maxEditableLen = _ref$maxEditableLen === void 0 ? -1 : _ref$maxEditableLen,
|
|
54
56
|
_ref$isFocusedDefault = _ref.isFocusedDefault,
|
|
55
57
|
isFocusedDefault = _ref$isFocusedDefault === void 0 ? false : _ref$isFocusedDefault,
|
|
56
58
|
isClearable = _ref.isClearable,
|
|
@@ -95,7 +97,8 @@ function InputMask() {
|
|
|
95
97
|
_ref$isHintLeft = _ref.isHintLeft,
|
|
96
98
|
isHintLeft = _ref$isHintLeft === void 0 ? false : _ref$isHintLeft,
|
|
97
99
|
_ref$hintPosition = _ref.hintPosition,
|
|
98
|
-
hintPosition = _ref$hintPosition === void 0 ? 'right' : _ref$hintPosition
|
|
100
|
+
hintPosition = _ref$hintPosition === void 0 ? 'right' : _ref$hintPosition,
|
|
101
|
+
name = _ref.name;
|
|
99
102
|
|
|
100
103
|
var errors = _objectSpread(_objectSpread({}, _config.DEFAULT_ERRORS), customErrors);
|
|
101
104
|
|
|
@@ -116,7 +119,7 @@ function InputMask() {
|
|
|
116
119
|
isFocused = _useState6[0],
|
|
117
120
|
setFocused = _useState6[1];
|
|
118
121
|
|
|
119
|
-
var _useState7 = (0, _react.useState)(
|
|
122
|
+
var _useState7 = (0, _react.useState)(null),
|
|
120
123
|
_useState8 = (0, _slicedToArray2.default)(_useState7, 2),
|
|
121
124
|
isInitValue = _useState8[0],
|
|
122
125
|
setIsInitValue = _useState8[1]; // ERRORS MANAGEMENT FUNCTIONS | START //
|
|
@@ -212,13 +215,7 @@ function InputMask() {
|
|
|
212
215
|
setInnerValue(function (state) {
|
|
213
216
|
var stateCopy = (0, _toConsumableArray2.default)(state);
|
|
214
217
|
var charObj = getCharObj(char, data);
|
|
215
|
-
|
|
216
|
-
if (i !== null) {
|
|
217
|
-
stateCopy[i] = charObj;
|
|
218
|
-
} else {
|
|
219
|
-
stateCopy.push(charObj);
|
|
220
|
-
}
|
|
221
|
-
|
|
218
|
+
stateCopy.push(charObj);
|
|
222
219
|
return stateCopy;
|
|
223
220
|
});
|
|
224
221
|
};
|
|
@@ -226,16 +223,13 @@ function InputMask() {
|
|
|
226
223
|
var updateInnerValueChar = function updateInnerValueChar() {
|
|
227
224
|
var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
228
225
|
_ref3$char = _ref3.char,
|
|
229
|
-
char = _ref3$char === void 0 ? null : _ref3$char
|
|
230
|
-
_ref3$isSelected = _ref3.isSelected,
|
|
231
|
-
isSelected = _ref3$isSelected === void 0 ? null : _ref3$isSelected;
|
|
226
|
+
char = _ref3$char === void 0 ? null : _ref3$char;
|
|
232
227
|
|
|
233
228
|
var i = arguments.length > 1 ? arguments[1] : undefined;
|
|
234
229
|
setInnerValue(function (state) {
|
|
235
230
|
if (!state[i]) return state;
|
|
236
231
|
var stateCopy = (0, _toConsumableArray2.default)(state);
|
|
237
232
|
if (!stateCopy[i].isSpecialSymbol && char !== null) stateCopy[i].char = char;
|
|
238
|
-
if (isSelected !== null) stateCopy[i].isSelected = isSelected;
|
|
239
233
|
return stateCopy;
|
|
240
234
|
});
|
|
241
235
|
};
|
|
@@ -243,8 +237,7 @@ function InputMask() {
|
|
|
243
237
|
var resetInnerValue = function resetInnerValue() {
|
|
244
238
|
innerValue.map(function (v, i) {
|
|
245
239
|
return updateInnerValueChar({
|
|
246
|
-
char: ''
|
|
247
|
-
isSelected: false
|
|
240
|
+
char: ''
|
|
248
241
|
}, i);
|
|
249
242
|
});
|
|
250
243
|
}; // INNER VALUE MANAGEMENT FUNCTIONS | END //
|
|
@@ -307,8 +300,13 @@ function InputMask() {
|
|
|
307
300
|
return true;
|
|
308
301
|
};
|
|
309
302
|
|
|
310
|
-
var
|
|
303
|
+
var isSpecialSymbolMaskChar = function isSpecialSymbolMaskChar(_ref5) {
|
|
311
304
|
var char = _ref5.char;
|
|
305
|
+
return !(0, _functions.isDigitMaskChar)(char) && !(0, _functions.isLetterMaskChar)(char);
|
|
306
|
+
};
|
|
307
|
+
|
|
308
|
+
var isSpecialSymbolChar = function isSpecialSymbolChar(_ref6) {
|
|
309
|
+
var char = _ref6.char;
|
|
312
310
|
return !(0, _functions.isDigit)(char) && !(0, _functions.isLetter)(char);
|
|
313
311
|
}; // CHECKERS | END //
|
|
314
312
|
// GETTERS | START //
|
|
@@ -319,12 +317,15 @@ function InputMask() {
|
|
|
319
317
|
var isSpecialSymbol = isSpecialSymbolChar({
|
|
320
318
|
char: char
|
|
321
319
|
});
|
|
320
|
+
var isSpecialSymbolMask = isSpecialSymbolMaskChar({
|
|
321
|
+
char: char
|
|
322
|
+
});
|
|
322
323
|
if (char === ' ') char = _config.SPACE_CHAR;
|
|
323
324
|
return _objectSpread({
|
|
324
|
-
char:
|
|
325
|
+
char: isSpecialSymbolMask ? char : '',
|
|
325
326
|
maskChar: char,
|
|
326
|
-
isSpecialSymbol:
|
|
327
|
-
|
|
327
|
+
isSpecialSymbol: isSpecialSymbolMask,
|
|
328
|
+
isCharSymbol: !isSpecialSymbol && char !== '' && isSpecialSymbolMask,
|
|
328
329
|
ref: /*#__PURE__*/(0, _react.createRef)()
|
|
329
330
|
}, data);
|
|
330
331
|
};
|
|
@@ -344,11 +345,11 @@ function InputMask() {
|
|
|
344
345
|
var minX = selectionStartX < selectionEndX ? selectionStartX : selectionEndX;
|
|
345
346
|
var maxX = selectionStartX > selectionEndX ? selectionStartX : selectionEndX;
|
|
346
347
|
|
|
347
|
-
var _innerValue$reduce = innerValue.reduce(function (resObj,
|
|
348
|
+
var _innerValue$reduce = innerValue.reduce(function (resObj, _ref7, index) {
|
|
348
349
|
var _ref$current;
|
|
349
350
|
|
|
350
|
-
var char =
|
|
351
|
-
ref =
|
|
351
|
+
var char = _ref7.char,
|
|
352
|
+
ref = _ref7.ref;
|
|
352
353
|
if ((ref === null || ref === void 0 ? void 0 : ref.current) === null) return resObj;
|
|
353
354
|
|
|
354
355
|
var _ref$current$getBound = ref === null || ref === void 0 ? void 0 : (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.getBoundingClientRect(),
|
|
@@ -387,13 +388,13 @@ function InputMask() {
|
|
|
387
388
|
};
|
|
388
389
|
|
|
389
390
|
var getInnerValueAsString = function getInnerValueAsString() {
|
|
390
|
-
var
|
|
391
|
-
|
|
392
|
-
replaceSpace =
|
|
391
|
+
var _ref8 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
392
|
+
_ref8$replaceSpace = _ref8.replaceSpace,
|
|
393
|
+
replaceSpace = _ref8$replaceSpace === void 0 ? false : _ref8$replaceSpace;
|
|
393
394
|
|
|
394
|
-
var result = innerValue.slice(0, innerValue.length - 1).map(function (
|
|
395
|
-
var char =
|
|
396
|
-
maskChar =
|
|
395
|
+
var result = innerValue.slice(0, innerValue.length - 1).map(function (_ref9, i) {
|
|
396
|
+
var char = _ref9.char,
|
|
397
|
+
maskChar = _ref9.maskChar;
|
|
397
398
|
return char === '' ? getPlaceholderCharByIndex(i) || maskChar : char;
|
|
398
399
|
}).join('');
|
|
399
400
|
return replaceSpace ? result.replace(/\u00A0/g, ' ') : result;
|
|
@@ -403,14 +404,13 @@ function InputMask() {
|
|
|
403
404
|
var start = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
404
405
|
return innerValue.filter(function (charObj, i) {
|
|
405
406
|
return i >= start;
|
|
406
|
-
}).
|
|
407
|
-
var isSpecialSymbol = _ref9.isSpecialSymbol;
|
|
408
|
-
return !isSpecialSymbol;
|
|
409
|
-
}).reduce(function (result, _ref10) {
|
|
407
|
+
}).reduce(function (result, _ref10, i, arr) {
|
|
410
408
|
var char = _ref10.char,
|
|
411
409
|
maskChar = _ref10.maskChar,
|
|
412
|
-
isSpecialSymbol = _ref10.isSpecialSymbol
|
|
413
|
-
|
|
410
|
+
isSpecialSymbol = _ref10.isSpecialSymbol,
|
|
411
|
+
isCharSymbol = _ref10.isCharSymbol;
|
|
412
|
+
if (char !== maskChar && char !== '' || !isSpecialSymbol || isCharSymbol) result += char; // || isCharSymbol
|
|
413
|
+
|
|
414
414
|
return result;
|
|
415
415
|
}, '');
|
|
416
416
|
};
|
|
@@ -435,10 +435,15 @@ function InputMask() {
|
|
|
435
435
|
isSpecialSymbol = charObj.isSpecialSymbol;
|
|
436
436
|
if (!ref) return false;
|
|
437
437
|
|
|
438
|
-
if (isSpecialSymbol && i < innerValue.length - 1) {
|
|
438
|
+
if ((maxEditableLen !== -1 ? i < maxEditableLen : true) && isSpecialSymbol && i < innerValue.length - 1) {
|
|
439
439
|
return prevIndex > i ? onArrowLeftDown(null, i) : onArrowRightDown(null, i);
|
|
440
440
|
}
|
|
441
441
|
|
|
442
|
+
if (maxEditableLen !== -1 && i > maxEditableLen) {
|
|
443
|
+
setFocusOnChar(maxEditableLen, i);
|
|
444
|
+
return false;
|
|
445
|
+
}
|
|
446
|
+
|
|
442
447
|
(_ref$current2 = ref.current) === null || _ref$current2 === void 0 ? void 0 : _ref$current2.focus();
|
|
443
448
|
setTimeout(function () {
|
|
444
449
|
return (0, _InputCarretPosition.setCaretPosition)(ref.current, 0);
|
|
@@ -469,7 +474,7 @@ function InputMask() {
|
|
|
469
474
|
if (isSpecialSymbol) return onBackspaceDown(e, prevIndex);
|
|
470
475
|
|
|
471
476
|
if (maskAsPlaceholder) {
|
|
472
|
-
var newText = getInnerValueAsString().
|
|
477
|
+
var newText = getInnerValueAsString().substring(0, prevIndex) + getInnerValueAsString().substring(i, maxEditableLen !== -1 ? maxEditableLen : getInnerValueAsString().length);
|
|
473
478
|
resetInnerValue();
|
|
474
479
|
|
|
475
480
|
_onPaste({
|
|
@@ -496,7 +501,7 @@ function InputMask() {
|
|
|
496
501
|
if (char === '') return false;
|
|
497
502
|
|
|
498
503
|
if (maskAsPlaceholder) {
|
|
499
|
-
var newText = getInnerValueAsString().
|
|
504
|
+
var newText = getInnerValueAsString().substring(0, i) + getInnerValueAsString().substring(nextIndex, maxEditableLen !== -1 ? maxEditableLen : getInnerValueAsString().length);
|
|
500
505
|
resetInnerValue();
|
|
501
506
|
|
|
502
507
|
_onPaste({
|
|
@@ -593,10 +598,11 @@ function InputMask() {
|
|
|
593
598
|
|
|
594
599
|
if (maskAsPlaceholder && ((_getClearInnerValueAs = getClearInnerValueAsString(i)) === null || _getClearInnerValueAs === void 0 ? void 0 : _getClearInnerValueAs.length) !== 0) {
|
|
595
600
|
var fromIndex = i + 1;
|
|
596
|
-
var text = innerValue.slice().filter(function (
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
601
|
+
var text = innerValue.slice().filter(function (_ref13, index) {
|
|
602
|
+
var isCharSymbol = _ref13.isCharSymbol;
|
|
603
|
+
return index >= i && !isCharSymbol;
|
|
604
|
+
}).map(function (_ref14, index) {
|
|
605
|
+
var char = _ref14.char;
|
|
600
606
|
return char;
|
|
601
607
|
}).join('');
|
|
602
608
|
|
|
@@ -649,9 +655,9 @@ function InputMask() {
|
|
|
649
655
|
};
|
|
650
656
|
|
|
651
657
|
var onClick = function onClick(e, cb) {
|
|
652
|
-
var
|
|
653
|
-
|
|
654
|
-
ignoreIsSelecting =
|
|
658
|
+
var _ref15 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
|
|
659
|
+
_ref15$ignoreIsSelect = _ref15.ignoreIsSelecting,
|
|
660
|
+
ignoreIsSelecting = _ref15$ignoreIsSelect === void 0 ? false : _ref15$ignoreIsSelect;
|
|
655
661
|
|
|
656
662
|
try {
|
|
657
663
|
e.stopPropagation();
|
|
@@ -724,7 +730,7 @@ function InputMask() {
|
|
|
724
730
|
ref = charObj.ref;
|
|
725
731
|
(0, _InputCarretPosition.setCaretPosition)(ref.current, 0);
|
|
726
732
|
|
|
727
|
-
if (isSpecialSymbol && i < innerValue.length - 1) {
|
|
733
|
+
if ((maxEditableLen !== -1 ? i < maxEditableLen : true) && isSpecialSymbol && i < innerValue.length - 1) {
|
|
728
734
|
_onFocus(e, i + 1);
|
|
729
735
|
|
|
730
736
|
return false;
|
|
@@ -735,7 +741,7 @@ function InputMask() {
|
|
|
735
741
|
};
|
|
736
742
|
|
|
737
743
|
var _onPaste = function onPaste(e, i) {
|
|
738
|
-
var
|
|
744
|
+
var _ref16, _window, _e$clipboardData;
|
|
739
745
|
|
|
740
746
|
var setFocusToEnd = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
741
747
|
|
|
@@ -746,16 +752,17 @@ function InputMask() {
|
|
|
746
752
|
|
|
747
753
|
setIsSelecting(false);
|
|
748
754
|
(0, _functions.resetSelectionText)();
|
|
749
|
-
var pastedText = ((
|
|
755
|
+
var pastedText = ((_ref16 = (e === null || e === void 0 ? void 0 : e.clipboardData) || ((_window = window) === null || _window === void 0 ? void 0 : _window.clipboardData)) === null || _ref16 === void 0 ? void 0 : _ref16.getData('text/plain')) || (e === null || e === void 0 ? void 0 : (_e$clipboardData = e.clipboardData) === null || _e$clipboardData === void 0 ? void 0 : _e$clipboardData.getData('Text')) || e.text;
|
|
750
756
|
if (!pastedText) return false;
|
|
751
757
|
var replacedIndexes = [];
|
|
752
758
|
|
|
753
759
|
if (maskAsPlaceholder && (e === null || e === void 0 ? void 0 : e.type) === 'paste') {
|
|
754
760
|
var fromIndex = i + parseInt(pastedText === null || pastedText === void 0 ? void 0 : pastedText.length);
|
|
755
|
-
var text = innerValue.slice().filter(function (
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
761
|
+
var text = innerValue.slice().filter(function (_ref17, index) {
|
|
762
|
+
var isCharSymbol = _ref17.isCharSymbol;
|
|
763
|
+
return index >= i && !isCharSymbol;
|
|
764
|
+
}).map(function (_ref18, index) {
|
|
765
|
+
var char = _ref18.char;
|
|
759
766
|
return char;
|
|
760
767
|
}).join('');
|
|
761
768
|
|
|
@@ -875,18 +882,16 @@ function InputMask() {
|
|
|
875
882
|
var selStartInd = getSelectStartIndex();
|
|
876
883
|
if (selStartInd === null || selStartInd === undefined || selStartInd < 0) return false;
|
|
877
884
|
var selEndInd = (0, _functions.getSelectionText)().length + selStartInd;
|
|
878
|
-
var filteredSelLen = (0, _functions.getSelectionText)().split('').reduce(function (counter, char) {
|
|
879
|
-
if (!isSpecialSymbolChar(char)) counter += 1;
|
|
880
|
-
return counter;
|
|
881
|
-
}, 0);
|
|
882
885
|
(0, _functions.resetSelectionText)();
|
|
883
886
|
|
|
884
887
|
if (maskAsPlaceholder && ((_getClearInnerValueAs2 = getClearInnerValueAsString(selEndInd + 1)) === null || _getClearInnerValueAs2 === void 0 ? void 0 : _getClearInnerValueAs2.length) !== 0) {
|
|
885
|
-
var text = innerValue.slice().filter(function (
|
|
886
|
-
var isSpecialSymbol =
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
888
|
+
var text = innerValue.slice().filter(function (_ref19, index) {
|
|
889
|
+
var isSpecialSymbol = _ref19.isSpecialSymbol,
|
|
890
|
+
isCharSymbol = _ref19.isCharSymbol;
|
|
891
|
+
if (maxEditableLen !== -1 && index > maxEditableLen - 1) return false;
|
|
892
|
+
return (index < selStartInd || index >= selEndInd) && !isSpecialSymbol && !isCharSymbol;
|
|
893
|
+
}).map(function (_ref20, index) {
|
|
894
|
+
var char = _ref20.char;
|
|
890
895
|
return char;
|
|
891
896
|
}).join('');
|
|
892
897
|
resetInnerValue();
|
|
@@ -912,10 +917,13 @@ function InputMask() {
|
|
|
912
917
|
|
|
913
918
|
|
|
914
919
|
(0, _react.useEffect)(function () {
|
|
920
|
+
setInnerValue([]);
|
|
921
|
+
setMaskRendered(false);
|
|
915
922
|
if (!maskPattern) maskPattern = '';
|
|
916
923
|
maskPattern.concat(' ').split('').map(function (char, id, i) {
|
|
917
924
|
return addInnerValueChar({
|
|
918
925
|
char: char,
|
|
926
|
+
i: i,
|
|
919
927
|
data: {
|
|
920
928
|
id: id,
|
|
921
929
|
isReadOnly: id === maskPattern.length
|
|
@@ -923,14 +931,14 @@ function InputMask() {
|
|
|
923
931
|
});
|
|
924
932
|
});
|
|
925
933
|
setMaskRendered(true);
|
|
926
|
-
}, []);
|
|
934
|
+
}, [maskPattern]);
|
|
927
935
|
(0, _react.useEffect)(function () {
|
|
928
936
|
if (!isMaskRendered || isInitValue) return false;
|
|
929
937
|
|
|
930
938
|
if (value && value !== '' && value !== getClearInnerValueAsString()) {
|
|
931
939
|
var valueCharIndex = 0;
|
|
932
|
-
innerValue.map(function (
|
|
933
|
-
var isSpecialSymbol =
|
|
940
|
+
innerValue.map(function (_ref21, i) {
|
|
941
|
+
var isSpecialSymbol = _ref21.isSpecialSymbol;
|
|
934
942
|
if (isSpecialSymbol) return false;
|
|
935
943
|
var char = value[valueCharIndex];
|
|
936
944
|
|
|
@@ -953,7 +961,6 @@ function InputMask() {
|
|
|
953
961
|
|
|
954
962
|
++valueCharIndex;
|
|
955
963
|
});
|
|
956
|
-
setIsInitValue(true);
|
|
957
964
|
}
|
|
958
965
|
}, [isMaskRendered, value, isInitValue]); // Focus Observer
|
|
959
966
|
|
|
@@ -973,6 +980,7 @@ function InputMask() {
|
|
|
973
980
|
if (!isMaskRendered) return false;
|
|
974
981
|
setError(false);
|
|
975
982
|
clearErrorMessage();
|
|
983
|
+
console.log('getClearInnerValueAsString', getClearInnerValueAsString());
|
|
976
984
|
onChangeProp(getClearInnerValueAsString(), getInnerValueAsString({
|
|
977
985
|
replaceSpace: true
|
|
978
986
|
}));
|
|
@@ -1040,8 +1048,7 @@ function InputMask() {
|
|
|
1040
1048
|
var char = obj.char,
|
|
1041
1049
|
ref = obj.ref,
|
|
1042
1050
|
maskChar = obj.maskChar,
|
|
1043
|
-
isSpecialSymbol = obj.isSpecialSymbol
|
|
1044
|
-
isSelected = obj.isSelected;
|
|
1051
|
+
isSpecialSymbol = obj.isSpecialSymbol;
|
|
1045
1052
|
var prevChar = getCharByIndex(i - 1);
|
|
1046
1053
|
if (i === innerValue.length - 1 && isSelecting) return /*#__PURE__*/_react.default.createElement("span", {
|
|
1047
1054
|
style: {
|
|
@@ -1053,7 +1060,7 @@ function InputMask() {
|
|
|
1053
1060
|
key: i,
|
|
1054
1061
|
maxLength: 1,
|
|
1055
1062
|
"attr-char-id": i,
|
|
1056
|
-
className: "\n input-mask_value_item\n ".concat(className, "\n ").concat((0, _functions.isDigitMaskChar)(obj.maskChar) ? 'input-mask_value_item--digit' : '', "\n ").concat((0, _functions.isLetterMaskChar)(obj.maskChar) ? 'input-mask_value_item--letter' : '', "\n ").concat(obj.isSpecialSymbol ? 'input-mask_value_item--spec' : '', "\n
|
|
1063
|
+
className: "\n input-mask_value_item\n ".concat(className, "\n ").concat((0, _functions.isDigitMaskChar)(obj.maskChar) ? 'input-mask_value_item--digit' : '', "\n ").concat((0, _functions.isLetterMaskChar)(obj.maskChar) ? 'input-mask_value_item--letter' : '', "\n ").concat(obj.isSpecialSymbol ? 'input-mask_value_item--spec' : '', "\n ") // ${char === '' || isSpecialSymbol ? 'unselectable' : ''}
|
|
1057
1064
|
// ${!isSelecting && (char === '' || isSpecialSymbol) ? 'unselectable' : ''}
|
|
1058
1065
|
,
|
|
1059
1066
|
onClick: function onClick(e) {
|
|
@@ -70,6 +70,7 @@
|
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
&__item {
|
|
73
|
+
position: relative;
|
|
73
74
|
padding: 10px 10px 14px 10px;
|
|
74
75
|
cursor: pointer;
|
|
75
76
|
font-size: 13px;
|
|
@@ -77,19 +78,38 @@
|
|
|
77
78
|
border-bottom: 1px solid #cfcfcf;
|
|
78
79
|
user-select: none;
|
|
79
80
|
margin-bottom: -1px;
|
|
80
|
-
border-bottom: 2px solid transparent;
|
|
81
|
-
opacity: 65%;
|
|
82
81
|
text-decoration: none !important;
|
|
82
|
+
display: flex;
|
|
83
|
+
align-items: center;
|
|
84
|
+
justify-content: center;
|
|
85
|
+
transition: all 0.2s ease-out;
|
|
86
|
+
|
|
87
|
+
&::after {
|
|
88
|
+
content: "";
|
|
89
|
+
width: 0;
|
|
90
|
+
height: 2px;
|
|
91
|
+
position: absolute;
|
|
92
|
+
bottom: 0;
|
|
93
|
+
background-color: #6b81dd;
|
|
94
|
+
transition: all 0.2s ease-out;
|
|
95
|
+
}
|
|
96
|
+
|
|
83
97
|
&:hover {
|
|
84
|
-
|
|
85
|
-
|
|
98
|
+
&::after {
|
|
99
|
+
width: 50%;
|
|
100
|
+
opacity: 0.6;
|
|
101
|
+
}
|
|
86
102
|
}
|
|
87
103
|
|
|
88
104
|
&.active {
|
|
89
|
-
border-bottom: 2px solid #6b81dd;
|
|
90
105
|
font-weight: 500;
|
|
91
106
|
cursor: default;
|
|
92
107
|
opacity: 100%;
|
|
108
|
+
|
|
109
|
+
&::after {
|
|
110
|
+
width: 100%;
|
|
111
|
+
opacity: 1;
|
|
112
|
+
}
|
|
93
113
|
}
|
|
94
114
|
}
|
|
95
115
|
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
|
|
12
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
+
|
|
14
|
+
var _Label = _interopRequireDefault(require("../../Atomic/FormElements/Label/Label"));
|
|
15
|
+
|
|
16
|
+
require("./FormElement.scss");
|
|
17
|
+
|
|
18
|
+
var RC = 'form-element';
|
|
19
|
+
|
|
20
|
+
var FormElement = function FormElement(_ref) {
|
|
21
|
+
var label = _ref.label,
|
|
22
|
+
required = _ref.required,
|
|
23
|
+
children = _ref.children,
|
|
24
|
+
error = _ref.error,
|
|
25
|
+
className = _ref.className,
|
|
26
|
+
hint = _ref.hint,
|
|
27
|
+
isLabelBolt = _ref.isLabelBolt,
|
|
28
|
+
isNoLabel = _ref.isNoLabel;
|
|
29
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
30
|
+
className: (0, _classnames.default)(className, RC)
|
|
31
|
+
}, label && !isNoLabel && /*#__PURE__*/_react.default.createElement(_Label.default, {
|
|
32
|
+
className: "".concat(RC, "__label"),
|
|
33
|
+
label: label,
|
|
34
|
+
hint: hint,
|
|
35
|
+
isRequired: required,
|
|
36
|
+
isLabelBolt: isLabelBolt
|
|
37
|
+
}), children, error && /*#__PURE__*/_react.default.createElement("span", {
|
|
38
|
+
className: "".concat(RC, "__error")
|
|
39
|
+
}, error));
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
var _default = FormElement;
|
|
43
|
+
exports.default = _default;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "intelicoreact",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.1.65",
|
|
4
|
+
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist/*",
|
|
@@ -11,18 +11,19 @@
|
|
|
11
11
|
],
|
|
12
12
|
"scripts": {
|
|
13
13
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
14
|
-
"build": "babel src --out-dir dist --copy-files --no-copy-ignored"
|
|
14
|
+
"build": "node IntelicoKitVersioningBot/main.js && babel src --out-dir dist --copy-files --no-copy-ignored",
|
|
15
|
+
"release": "babel src --out-dir dist --copy-files --no-copy-ignored && npm publish && node IntelicoKitVersioningBot/main.js"
|
|
15
16
|
},
|
|
16
17
|
"author": "Andrey Isakov",
|
|
17
18
|
"license": "ISC",
|
|
18
19
|
"dependencies": {
|
|
20
|
+
"anme": "^1.0.1",
|
|
21
|
+
"classnames": "^2.3.1",
|
|
19
22
|
"moment": "^2.29.1",
|
|
20
23
|
"moment-timezone": "^0.5.34",
|
|
21
24
|
"react": "^17.0.2",
|
|
22
25
|
"react-feather": "^2.0.9",
|
|
23
|
-
"react-input-mask": "^2.0.4"
|
|
24
|
-
"classnames": "^2.3.1",
|
|
25
|
-
"anme": "^1.0.1"
|
|
26
|
+
"react-input-mask": "^2.0.4"
|
|
26
27
|
},
|
|
27
28
|
"devDependencies": {
|
|
28
29
|
"@babel/cli": "^7.15.7",
|