intelicoreact 1.2.15 → 1.2.17
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/Atomic/FormElements/InputMask/InputMask.js +1 -0
- package/dist/Atomic/FormElements/RadioGroupWithInput/RadioGroupWithInput.js +82 -0
- package/dist/Atomic/FormElements/RadioGroupWithInput/RadioGroupWithInput.scss +30 -0
- package/dist/Atomic/UI/AccordionText/AccordionText.scss +2 -4
- package/package.json +1 -1
- package/dist/Functions/presets/inputMaskPreset.js +0 -176
|
@@ -395,6 +395,7 @@ function InputMask() {
|
|
|
395
395
|
|
|
396
396
|
var charCenterX = charX + charWidth / 2; // If Char X-Coord Out Of Range
|
|
397
397
|
|
|
398
|
+
// If Char X-Coord Out Of Range
|
|
398
399
|
if (!charX || minX > charCenterX || maxX < charCenterX) return resObj;
|
|
399
400
|
if (resObj.index === null || minX <= charCenterX && charCenterX >= maxX && charCenterX < resObj.charX) return {
|
|
400
401
|
index: index,
|
|
@@ -0,0 +1,82 @@
|
|
|
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 _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
+
|
|
12
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
|
+
|
|
14
|
+
var _react = _interopRequireDefault(require("react"));
|
|
15
|
+
|
|
16
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
17
|
+
|
|
18
|
+
var _RadioInput = _interopRequireDefault(require("./../RadioInput/RadioInput"));
|
|
19
|
+
|
|
20
|
+
var _FormElement = _interopRequireDefault(require("../../../Molecular/FormElement/FormElement"));
|
|
21
|
+
|
|
22
|
+
var _Input = _interopRequireDefault(require("./../Input/Input"));
|
|
23
|
+
|
|
24
|
+
var _Alert = _interopRequireDefault(require("../../UI/Alert/Alert"));
|
|
25
|
+
|
|
26
|
+
require("./RadioGroupWithInput.scss");
|
|
27
|
+
|
|
28
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
29
|
+
|
|
30
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
31
|
+
|
|
32
|
+
var RadioGroupWithInput = function RadioGroupWithInput(_ref) {
|
|
33
|
+
var alert = _ref.alert,
|
|
34
|
+
className = _ref.className,
|
|
35
|
+
disabled = _ref.disabled,
|
|
36
|
+
_ref$onChange = _ref.onChange,
|
|
37
|
+
onChange = _ref$onChange === void 0 ? function () {} : _ref$onChange,
|
|
38
|
+
_ref$direction = _ref.direction,
|
|
39
|
+
direction = _ref$direction === void 0 ? 'row' : _ref$direction,
|
|
40
|
+
_ref$options = _ref.options,
|
|
41
|
+
options = _ref$options === void 0 ? [] : _ref$options;
|
|
42
|
+
var handle = {
|
|
43
|
+
changeRadio: function changeRadio(value, el) {
|
|
44
|
+
var newOptions = options.map(function (item) {
|
|
45
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
46
|
+
checked: el.value === item.value ? item.value : false
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
onChange(newOptions);
|
|
50
|
+
},
|
|
51
|
+
changeInput: function changeInput(value, el) {
|
|
52
|
+
el.input.value = value;
|
|
53
|
+
onChange(options);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
57
|
+
className: "radio-group-input-box"
|
|
58
|
+
}, alert && /*#__PURE__*/_react.default.createElement(_Alert.default, (0, _extends2.default)({
|
|
59
|
+
className: "mb10"
|
|
60
|
+
}, alert)), /*#__PURE__*/_react.default.createElement("div", {
|
|
61
|
+
className: (0, _classnames.default)('radio-group-input', className, "radio-group-input--".concat(direction), {
|
|
62
|
+
'radio-group-input--disabled': disabled
|
|
63
|
+
})
|
|
64
|
+
}, options.map(function (item) {
|
|
65
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
66
|
+
key: item.id,
|
|
67
|
+
className: (0, _classnames.default)('radio-group-input-item', "radio-group-input-item-".concat(item.id))
|
|
68
|
+
}, /*#__PURE__*/_react.default.createElement(_RadioInput.default, (0, _extends2.default)({}, item, {
|
|
69
|
+
onChange: function onChange(value) {
|
|
70
|
+
return handle.changeRadio(value, item);
|
|
71
|
+
},
|
|
72
|
+
checked: item.checked
|
|
73
|
+
})), item.input && item.checked && /*#__PURE__*/_react.default.createElement(_FormElement.default, item.input, /*#__PURE__*/_react.default.createElement(_Input.default, (0, _extends2.default)({
|
|
74
|
+
onChange: function onChange(value) {
|
|
75
|
+
return handle.changeInput(value, item);
|
|
76
|
+
}
|
|
77
|
+
}, item.input))));
|
|
78
|
+
})));
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
var _default = RadioGroupWithInput;
|
|
82
|
+
exports.default = _default;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
.radio-group-input {
|
|
2
|
+
display: flex;
|
|
3
|
+
|
|
4
|
+
&--col {
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
|
|
7
|
+
.radio-input:not(:last-child) {
|
|
8
|
+
margin-bottom: 10px;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
&--row {
|
|
13
|
+
align-items: center;
|
|
14
|
+
min-height: 28px;
|
|
15
|
+
|
|
16
|
+
.radio-input:not(:last-child) {
|
|
17
|
+
margin-right: 10px;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
&--disabled {
|
|
22
|
+
pointer-events: none;
|
|
23
|
+
|
|
24
|
+
opacity: 0.5;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.input__wrap {
|
|
28
|
+
margin-bottom: 5px;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -4,10 +4,8 @@
|
|
|
4
4
|
border-radius: 4px;
|
|
5
5
|
background-color: rgba(48, 57, 91, 0.05);
|
|
6
6
|
cursor: pointer;
|
|
7
|
-
|
|
8
7
|
height: 100%;
|
|
9
8
|
max-height: 18px;
|
|
10
|
-
|
|
11
9
|
font-size: 12px;
|
|
12
10
|
font-weight: 400;
|
|
13
11
|
line-height: 18px;
|
|
@@ -18,8 +16,8 @@
|
|
|
18
16
|
|
|
19
17
|
&--open &__body {
|
|
20
18
|
overflow: visible;
|
|
21
|
-
white-space: wrap
|
|
22
|
-
text-overflow: unset
|
|
19
|
+
white-space: normal; // Change 'wrap' to 'normal'
|
|
20
|
+
text-overflow: clip; // Change 'unset' to 'clip'
|
|
23
21
|
}
|
|
24
22
|
|
|
25
23
|
&__body {
|
package/package.json
CHANGED
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', {
|
|
4
|
-
value: true,
|
|
5
|
-
});
|
|
6
|
-
exports.MASK_PRESET = void 0;
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* @param type: 'inputMask',
|
|
10
|
-
* @param maskPattern: 'DD.DD.DDDD',
|
|
11
|
-
* @param maskPatternPlaceholder: 'MM.DD.YYYY',
|
|
12
|
-
* @param usePatternPlaceholder: true,
|
|
13
|
-
* @param isNumericMobileKeyboard: true,
|
|
14
|
-
* @param blinkErrors: true,
|
|
15
|
-
* @param showErrors: false,
|
|
16
|
-
* @param autocomplete: 'bday',
|
|
17
|
-
* @param focusSelector: 'input',
|
|
18
|
-
*/
|
|
19
|
-
var DATE_PRESET = {
|
|
20
|
-
type: 'inputMask',
|
|
21
|
-
maskPattern: 'DD.DD.DDDD',
|
|
22
|
-
maskPatternPlaceholder: 'MM.DD.YYYY',
|
|
23
|
-
usePatternPlaceholder: true,
|
|
24
|
-
isNumericMobileKeyboard: true,
|
|
25
|
-
blinkErrors: true,
|
|
26
|
-
showErrors: false,
|
|
27
|
-
autocomplete: 'bday',
|
|
28
|
-
focusSelector: 'input',
|
|
29
|
-
};
|
|
30
|
-
/**
|
|
31
|
-
* @param type: 'inputMask',
|
|
32
|
-
* @param maskPattern: 'DDDDD',
|
|
33
|
-
* @param maskPlaceholder: 'X',
|
|
34
|
-
* @param isNumericMobileKeyboard: true,
|
|
35
|
-
* @param blinkErrors: true,
|
|
36
|
-
* @param showErrors: false,
|
|
37
|
-
* @param focusSelector: 'input',
|
|
38
|
-
* @param autocomplete: 'postal-code',
|
|
39
|
-
* @param rules: 'fieldZip'
|
|
40
|
-
*/
|
|
41
|
-
|
|
42
|
-
var ZIP_PRESET = {
|
|
43
|
-
type: 'inputMask',
|
|
44
|
-
focusSelector: 'input',
|
|
45
|
-
maskPattern: 'DDDDD',
|
|
46
|
-
maskPlaceholder: 'X',
|
|
47
|
-
isNumericMobileKeyboard: true,
|
|
48
|
-
blinkErrors: true,
|
|
49
|
-
showErrors: false,
|
|
50
|
-
autocomplete: 'postal-code',
|
|
51
|
-
rules: 'fieldZip',
|
|
52
|
-
};
|
|
53
|
-
/**
|
|
54
|
-
* @param type: 'inputMask',
|
|
55
|
-
* @param maskPattern: 'DDDDDDDDD',
|
|
56
|
-
* @param maskPlaceholder: 'X',
|
|
57
|
-
* @param isNumericMobileKeyboard: true,
|
|
58
|
-
* @param blinkErrors: true,
|
|
59
|
-
* @param showErrors: false,
|
|
60
|
-
* @param focusSelector: 'input',
|
|
61
|
-
*/
|
|
62
|
-
|
|
63
|
-
var SSN_PRESET = {
|
|
64
|
-
type: 'inputMask',
|
|
65
|
-
maskPattern: 'DDDDDDDDD',
|
|
66
|
-
maskPlaceholder: 'X',
|
|
67
|
-
focusSelector: 'input',
|
|
68
|
-
isNumericMobileKeyboard: true,
|
|
69
|
-
blinkErrors: true,
|
|
70
|
-
showErrors: false,
|
|
71
|
-
};
|
|
72
|
-
/**
|
|
73
|
-
* @param type: 'inputMask',
|
|
74
|
-
* @param maskPattern: 'DDD-DDD-DDDD',
|
|
75
|
-
* @param maskPlaceholder: 'X',
|
|
76
|
-
* @param isNumericMobileKeyboard: true,
|
|
77
|
-
* @param blinkErrors: true,
|
|
78
|
-
* @param showErrors: false,
|
|
79
|
-
* @param focusSelector: 'input',
|
|
80
|
-
* @param autocomplete: 'tel-national',
|
|
81
|
-
*/
|
|
82
|
-
|
|
83
|
-
var MOBILE_PHONE_PRESET = {
|
|
84
|
-
type: 'inputMask',
|
|
85
|
-
maskPattern: 'DDD-DDD-DDDD',
|
|
86
|
-
maskPlaceholder: 'X',
|
|
87
|
-
focusSelector: 'input',
|
|
88
|
-
isNumericMobileKeyboard: true,
|
|
89
|
-
blinkErrors: true,
|
|
90
|
-
showErrors: false,
|
|
91
|
-
autocomplete: 'tel-national',
|
|
92
|
-
};
|
|
93
|
-
/**
|
|
94
|
-
* @param type: 'inputMask3',
|
|
95
|
-
* @param maskPattern: 'DDDD',
|
|
96
|
-
* @param maskPlaceholder: 'X',
|
|
97
|
-
* @param isNumericMobileKeyboard: true,
|
|
98
|
-
* @param blinkErrors: true,
|
|
99
|
-
* @param showErrors: false,
|
|
100
|
-
*/
|
|
101
|
-
|
|
102
|
-
var SHORT_SSN_PRESET = {
|
|
103
|
-
type: 'inputMask3',
|
|
104
|
-
maskPattern: 'DDDD',
|
|
105
|
-
maskPlaceholder: 'X',
|
|
106
|
-
focusSelector: 'input',
|
|
107
|
-
isNumericMobileKeyboard: true,
|
|
108
|
-
blinkErrors: true,
|
|
109
|
-
showErrors: false,
|
|
110
|
-
};
|
|
111
|
-
/**
|
|
112
|
-
* @param type: 'inputMask',
|
|
113
|
-
* @param maskPattern: 'DDDDDDDDD',
|
|
114
|
-
* @param maskPlaceholder: 'X',
|
|
115
|
-
* @param isNumericMobileKeyboard: true,
|
|
116
|
-
* @param blinkErrors: true,
|
|
117
|
-
* @param showErrors: false,
|
|
118
|
-
*/
|
|
119
|
-
|
|
120
|
-
var ABA_PRESET = {
|
|
121
|
-
type: 'inputMask',
|
|
122
|
-
maskPattern: 'DDDDDDDDD',
|
|
123
|
-
maskPlaceholder: 'X',
|
|
124
|
-
isNumericMobileKeyboard: true,
|
|
125
|
-
blinkErrors: true,
|
|
126
|
-
showErrors: false,
|
|
127
|
-
};
|
|
128
|
-
/**
|
|
129
|
-
* @param type: 'inputMask',
|
|
130
|
-
* @param maskPattern: 'MM/YY',
|
|
131
|
-
* @param maskPatternPlaceholder: 'MM/YY',
|
|
132
|
-
* @param usePatternPlaceholder: true,
|
|
133
|
-
* @param isNumericMobileKeyboard: true,
|
|
134
|
-
* @param blinkErrors: true,
|
|
135
|
-
* @param showErrors: false,
|
|
136
|
-
* @param focusSelector: 'input',
|
|
137
|
-
*/
|
|
138
|
-
|
|
139
|
-
var CC_EXPIRATION_DATE = {
|
|
140
|
-
type: 'inputMask',
|
|
141
|
-
maskPattern: 'MM/YY',
|
|
142
|
-
maskPatternPlaceholder: 'MM/YY',
|
|
143
|
-
usePatternPlaceholder: true,
|
|
144
|
-
isNumericMobileKeyboard: true,
|
|
145
|
-
blinkErrors: true,
|
|
146
|
-
showErrors: false,
|
|
147
|
-
focusSelector: 'input',
|
|
148
|
-
};
|
|
149
|
-
/**
|
|
150
|
-
* @param type: 'inputMask',
|
|
151
|
-
* @param maskPattern: 'DDDDDDDDDD',
|
|
152
|
-
* @param maskPlaceholder: 'X',
|
|
153
|
-
* @param isNumericMobileKeyboard: true,
|
|
154
|
-
* @param blinkErrors: true,
|
|
155
|
-
* @param showErrors: false,
|
|
156
|
-
*/
|
|
157
|
-
|
|
158
|
-
var BANK_ACCOUNT = {
|
|
159
|
-
type: 'inputMask',
|
|
160
|
-
maskPattern: 'DDDDDDDDDD',
|
|
161
|
-
maskPlaceholder: 'X',
|
|
162
|
-
isNumericMobileKeyboard: true,
|
|
163
|
-
blinkErrors: true,
|
|
164
|
-
showErrors: false,
|
|
165
|
-
};
|
|
166
|
-
var MASK_PRESET = {
|
|
167
|
-
BANK_ACCOUNT: BANK_ACCOUNT,
|
|
168
|
-
CC_EXPIRATION_DATE: CC_EXPIRATION_DATE,
|
|
169
|
-
DATE_PRESET: DATE_PRESET,
|
|
170
|
-
ZIP_PRESET: ZIP_PRESET,
|
|
171
|
-
SSN_PRESET: SSN_PRESET,
|
|
172
|
-
MOBILE_PHONE_PRESET: MOBILE_PHONE_PRESET,
|
|
173
|
-
SHORT_SSN_PRESET: SHORT_SSN_PRESET,
|
|
174
|
-
ABA_PRESET: ABA_PRESET,
|
|
175
|
-
};
|
|
176
|
-
exports.MASK_PRESET = MASK_PRESET;
|