@bigbinary/neeto-molecules 1.0.16 → 1.0.18
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/README.md +2 -0
- package/dist/DynamicVariables.cjs.js +30 -31
- package/dist/DynamicVariables.cjs.js.map +1 -1
- package/dist/DynamicVariables.js +30 -31
- package/dist/DynamicVariables.js.map +1 -1
- package/dist/EmailPreview.cjs.js +88 -77
- package/dist/EmailPreview.cjs.js.map +1 -1
- package/dist/EmailPreview.js +88 -77
- package/dist/EmailPreview.js.map +1 -1
- package/dist/NeetoWidget.cjs.js +218 -218
- package/dist/NeetoWidget.cjs.js.map +1 -1
- package/dist/NeetoWidget.js +218 -218
- package/dist/NeetoWidget.js.map +1 -1
- package/dist/PhoneNumber.cjs.js +8560 -0
- package/dist/PhoneNumber.cjs.js.map +1 -0
- package/dist/PhoneNumber.js +8528 -0
- package/dist/PhoneNumber.js.map +1 -0
- package/dist/ShareViaEmail.cjs.js +217 -125
- package/dist/ShareViaEmail.cjs.js.map +1 -1
- package/dist/ShareViaEmail.js +217 -125
- package/dist/ShareViaEmail.js.map +1 -1
- package/dist/TableWrapper.cjs.js +235 -0
- package/dist/TableWrapper.cjs.js.map +1 -0
- package/dist/TableWrapper.js +229 -0
- package/dist/TableWrapper.js.map +1 -0
- package/package.json +5 -2
- package/src/translations/en.json +6 -0
- package/types/Header.d.ts +25 -12
- package/types/PhoneNumber.d.ts +110 -0
- package/types/SubHeader.d.ts +31 -6
- package/types/TableWrapper.d.ts +34 -0
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
|
|
5
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
6
|
+
|
|
7
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
8
|
+
|
|
9
|
+
var classnames = {exports: {}};
|
|
10
|
+
|
|
11
|
+
/*!
|
|
12
|
+
Copyright (c) 2018 Jed Watson.
|
|
13
|
+
Licensed under the MIT License (MIT), see
|
|
14
|
+
http://jedwatson.github.io/classnames
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
(function (module) {
|
|
18
|
+
/* global define */
|
|
19
|
+
|
|
20
|
+
(function () {
|
|
21
|
+
|
|
22
|
+
var hasOwn = {}.hasOwnProperty;
|
|
23
|
+
|
|
24
|
+
function classNames() {
|
|
25
|
+
var classes = [];
|
|
26
|
+
|
|
27
|
+
for (var i = 0; i < arguments.length; i++) {
|
|
28
|
+
var arg = arguments[i];
|
|
29
|
+
if (!arg) continue;
|
|
30
|
+
|
|
31
|
+
var argType = typeof arg;
|
|
32
|
+
|
|
33
|
+
if (argType === 'string' || argType === 'number') {
|
|
34
|
+
classes.push(arg);
|
|
35
|
+
} else if (Array.isArray(arg)) {
|
|
36
|
+
if (arg.length) {
|
|
37
|
+
var inner = classNames.apply(null, arg);
|
|
38
|
+
if (inner) {
|
|
39
|
+
classes.push(inner);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
} else if (argType === 'object') {
|
|
43
|
+
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
|
|
44
|
+
classes.push(arg.toString());
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
for (var key in arg) {
|
|
49
|
+
if (hasOwn.call(arg, key) && arg[key]) {
|
|
50
|
+
classes.push(key);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
return classes.join(' ');
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
if (module.exports) {
|
|
60
|
+
classNames.default = classNames;
|
|
61
|
+
module.exports = classNames;
|
|
62
|
+
} else {
|
|
63
|
+
window.classNames = classNames;
|
|
64
|
+
}
|
|
65
|
+
}());
|
|
66
|
+
} (classnames));
|
|
67
|
+
|
|
68
|
+
var classNames = classnames.exports;
|
|
69
|
+
|
|
70
|
+
function cov_2pe656guy1() {
|
|
71
|
+
var path = "/home/runner/work/neeto-molecules/neeto-molecules/src/components/TableWrapper/index.jsx";
|
|
72
|
+
var hash = "2e8f830646a90399b1c7c4d1b52186adb04b8606";
|
|
73
|
+
var global = new Function("return this")();
|
|
74
|
+
var gcv = "__coverage__";
|
|
75
|
+
var coverageData = {
|
|
76
|
+
path: "/home/runner/work/neeto-molecules/neeto-molecules/src/components/TableWrapper/index.jsx",
|
|
77
|
+
statementMap: {
|
|
78
|
+
"0": {
|
|
79
|
+
start: {
|
|
80
|
+
line: 6,
|
|
81
|
+
column: 21
|
|
82
|
+
},
|
|
83
|
+
end: {
|
|
84
|
+
line: 22,
|
|
85
|
+
column: 1
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
"1": {
|
|
89
|
+
start: {
|
|
90
|
+
line: 7,
|
|
91
|
+
column: 2
|
|
92
|
+
},
|
|
93
|
+
end: {
|
|
94
|
+
line: 21,
|
|
95
|
+
column: 8
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
"2": {
|
|
99
|
+
start: {
|
|
100
|
+
line: 24,
|
|
101
|
+
column: 0
|
|
102
|
+
},
|
|
103
|
+
end: {
|
|
104
|
+
line: 35,
|
|
105
|
+
column: 2
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
fnMap: {
|
|
110
|
+
"0": {
|
|
111
|
+
name: "(anonymous_0)",
|
|
112
|
+
decl: {
|
|
113
|
+
start: {
|
|
114
|
+
line: 6,
|
|
115
|
+
column: 21
|
|
116
|
+
},
|
|
117
|
+
end: {
|
|
118
|
+
line: 6,
|
|
119
|
+
column: 22
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
loc: {
|
|
123
|
+
start: {
|
|
124
|
+
line: 7,
|
|
125
|
+
column: 2
|
|
126
|
+
},
|
|
127
|
+
end: {
|
|
128
|
+
line: 21,
|
|
129
|
+
column: 8
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
line: 7
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
branchMap: {
|
|
136
|
+
"0": {
|
|
137
|
+
loc: {
|
|
138
|
+
start: {
|
|
139
|
+
line: 6,
|
|
140
|
+
column: 34
|
|
141
|
+
},
|
|
142
|
+
end: {
|
|
143
|
+
line: 6,
|
|
144
|
+
column: 48
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
type: "default-arg",
|
|
148
|
+
locations: [{
|
|
149
|
+
start: {
|
|
150
|
+
line: 6,
|
|
151
|
+
column: 46
|
|
152
|
+
},
|
|
153
|
+
end: {
|
|
154
|
+
line: 6,
|
|
155
|
+
column: 48
|
|
156
|
+
}
|
|
157
|
+
}],
|
|
158
|
+
line: 6
|
|
159
|
+
},
|
|
160
|
+
"1": {
|
|
161
|
+
loc: {
|
|
162
|
+
start: {
|
|
163
|
+
line: 6,
|
|
164
|
+
column: 50
|
|
165
|
+
},
|
|
166
|
+
end: {
|
|
167
|
+
line: 6,
|
|
168
|
+
column: 71
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
type: "default-arg",
|
|
172
|
+
locations: [{
|
|
173
|
+
start: {
|
|
174
|
+
line: 6,
|
|
175
|
+
column: 66
|
|
176
|
+
},
|
|
177
|
+
end: {
|
|
178
|
+
line: 6,
|
|
179
|
+
column: 71
|
|
180
|
+
}
|
|
181
|
+
}],
|
|
182
|
+
line: 6
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
s: {
|
|
186
|
+
"0": 0,
|
|
187
|
+
"1": 0,
|
|
188
|
+
"2": 0
|
|
189
|
+
},
|
|
190
|
+
f: {
|
|
191
|
+
"0": 0
|
|
192
|
+
},
|
|
193
|
+
b: {
|
|
194
|
+
"0": [0],
|
|
195
|
+
"1": [0]
|
|
196
|
+
},
|
|
197
|
+
_coverageSchema: "1a1c01bbd47fc00a2c39e90264f33305004495a9",
|
|
198
|
+
hash: "2e8f830646a90399b1c7c4d1b52186adb04b8606"
|
|
199
|
+
};
|
|
200
|
+
var coverage = global[gcv] || (global[gcv] = {});
|
|
201
|
+
if (!coverage[path] || coverage[path].hash !== hash) {
|
|
202
|
+
coverage[path] = coverageData;
|
|
203
|
+
}
|
|
204
|
+
var actualCoverage = coverage[path];
|
|
205
|
+
{
|
|
206
|
+
// @ts-ignore
|
|
207
|
+
cov_2pe656guy1 = function () {
|
|
208
|
+
return actualCoverage;
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
return actualCoverage;
|
|
212
|
+
}
|
|
213
|
+
cov_2pe656guy1();
|
|
214
|
+
cov_2pe656guy1().s[0]++;
|
|
215
|
+
var TableWrapper = function TableWrapper(_ref) {
|
|
216
|
+
var children = _ref.children,
|
|
217
|
+
_ref$className = _ref.className,
|
|
218
|
+
className = _ref$className === void 0 ? (cov_2pe656guy1().b[0][0]++, "") : _ref$className,
|
|
219
|
+
_ref$hasPagination = _ref.hasPagination,
|
|
220
|
+
hasPagination = _ref$hasPagination === void 0 ? (cov_2pe656guy1().b[1][0]++, false) : _ref$hasPagination;
|
|
221
|
+
cov_2pe656guy1().f[0]++;
|
|
222
|
+
cov_2pe656guy1().s[1]++;
|
|
223
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
224
|
+
"data-testid": "table-wrapper",
|
|
225
|
+
className: classNames("flex min-h-0 w-full flex-grow flex-col pb-6", className)
|
|
226
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
227
|
+
className: classNames("min-h-0 flex-grow", {
|
|
228
|
+
"pb-11": hasPagination
|
|
229
|
+
})
|
|
230
|
+
}, children));
|
|
231
|
+
};
|
|
232
|
+
cov_2pe656guy1().s[2]++;
|
|
233
|
+
|
|
234
|
+
module.exports = TableWrapper;
|
|
235
|
+
//# sourceMappingURL=TableWrapper.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableWrapper.cjs.js","sources":["../node_modules/classnames/index.js","../src/components/TableWrapper/index.jsx"],"sourcesContent":["/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\tvar nativeCodeString = '[native code]';\n\n\tfunction classNames() {\n\t\tvar classes = [];\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (!arg) continue;\n\n\t\t\tvar argType = typeof arg;\n\n\t\t\tif (argType === 'string' || argType === 'number') {\n\t\t\t\tclasses.push(arg);\n\t\t\t} else if (Array.isArray(arg)) {\n\t\t\t\tif (arg.length) {\n\t\t\t\t\tvar inner = classNames.apply(null, arg);\n\t\t\t\t\tif (inner) {\n\t\t\t\t\t\tclasses.push(inner);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (argType === 'object') {\n\t\t\t\tif (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {\n\t\t\t\t\tclasses.push(arg.toString());\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tfor (var key in arg) {\n\t\t\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\t\t\tclasses.push(key);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn classes.join(' ');\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n","import React from \"react\";\n\nimport classNames from \"classnames\";\nimport PropTypes from \"prop-types\";\n\nconst TableWrapper = ({ children, className = \"\", hasPagination = false }) => (\n <div\n data-testid=\"table-wrapper\"\n className={classNames(\n \"flex min-h-0 w-full flex-grow flex-col pb-6\",\n className\n )}\n >\n <div\n className={classNames(\"min-h-0 flex-grow\", {\n \"pb-11\": hasPagination,\n })}\n >\n {children}\n </div>\n </div>\n);\n\nTableWrapper.propTypes = {\n /**\n * Custom classnames for table wrapper.\n */\n className: PropTypes.string,\n /**\n * Handles table wrapper height when pagination is enabled.\n *\n * `hasPagination={totalCount > defaultPageSize}`\n */\n hasPagination: PropTypes.bool,\n};\n\nexport default TableWrapper;\n"],"names":["cov_2pe656guy1","actualCoverage","s","TableWrapper","_ref","children","_ref$className","className","b","_ref$hasPagination","hasPagination","f","React","createElement","classNames"],"mappings":";;;;;;;;;;;;;;;;;AAKA;AACA;AACA,CAAA,CAAC,YAAY;AAEb;AACA,EAAC,IAAI,MAAM,GAAG,EAAE,CAAC,cAAc,CAAC;AAEhC;EACC,SAAS,UAAU,GAAG;AACvB,GAAE,IAAI,OAAO,GAAG,EAAE,CAAC;AACnB;AACA,GAAE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AAC7C,IAAG,IAAI,GAAG,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;AAC1B,IAAG,IAAI,CAAC,GAAG,EAAE,SAAS;AACtB;AACA,IAAG,IAAI,OAAO,GAAG,OAAO,GAAG,CAAC;AAC5B;IACG,IAAI,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,QAAQ,EAAE;AACrD,KAAI,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;KAClB,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;AAClC,KAAI,IAAI,GAAG,CAAC,MAAM,EAAE;MACf,IAAI,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;MACxC,IAAI,KAAK,EAAE;AAChB,OAAM,OAAO,CAAC,IAAI,CAA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jedwatson.github.io/classnames
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
(function (module) {
|
|
12
|
+
/* global define */
|
|
13
|
+
|
|
14
|
+
(function () {
|
|
15
|
+
|
|
16
|
+
var hasOwn = {}.hasOwnProperty;
|
|
17
|
+
|
|
18
|
+
function classNames() {
|
|
19
|
+
var classes = [];
|
|
20
|
+
|
|
21
|
+
for (var i = 0; i < arguments.length; i++) {
|
|
22
|
+
var arg = arguments[i];
|
|
23
|
+
if (!arg) continue;
|
|
24
|
+
|
|
25
|
+
var argType = typeof arg;
|
|
26
|
+
|
|
27
|
+
if (argType === 'string' || argType === 'number') {
|
|
28
|
+
classes.push(arg);
|
|
29
|
+
} else if (Array.isArray(arg)) {
|
|
30
|
+
if (arg.length) {
|
|
31
|
+
var inner = classNames.apply(null, arg);
|
|
32
|
+
if (inner) {
|
|
33
|
+
classes.push(inner);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
} else if (argType === 'object') {
|
|
37
|
+
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
|
|
38
|
+
classes.push(arg.toString());
|
|
39
|
+
continue;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
for (var key in arg) {
|
|
43
|
+
if (hasOwn.call(arg, key) && arg[key]) {
|
|
44
|
+
classes.push(key);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return classes.join(' ');
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if (module.exports) {
|
|
54
|
+
classNames.default = classNames;
|
|
55
|
+
module.exports = classNames;
|
|
56
|
+
} else {
|
|
57
|
+
window.classNames = classNames;
|
|
58
|
+
}
|
|
59
|
+
}());
|
|
60
|
+
} (classnames));
|
|
61
|
+
|
|
62
|
+
var classNames = classnames.exports;
|
|
63
|
+
|
|
64
|
+
function cov_2pe656guy1() {
|
|
65
|
+
var path = "/home/runner/work/neeto-molecules/neeto-molecules/src/components/TableWrapper/index.jsx";
|
|
66
|
+
var hash = "2e8f830646a90399b1c7c4d1b52186adb04b8606";
|
|
67
|
+
var global = new Function("return this")();
|
|
68
|
+
var gcv = "__coverage__";
|
|
69
|
+
var coverageData = {
|
|
70
|
+
path: "/home/runner/work/neeto-molecules/neeto-molecules/src/components/TableWrapper/index.jsx",
|
|
71
|
+
statementMap: {
|
|
72
|
+
"0": {
|
|
73
|
+
start: {
|
|
74
|
+
line: 6,
|
|
75
|
+
column: 21
|
|
76
|
+
},
|
|
77
|
+
end: {
|
|
78
|
+
line: 22,
|
|
79
|
+
column: 1
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
"1": {
|
|
83
|
+
start: {
|
|
84
|
+
line: 7,
|
|
85
|
+
column: 2
|
|
86
|
+
},
|
|
87
|
+
end: {
|
|
88
|
+
line: 21,
|
|
89
|
+
column: 8
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
"2": {
|
|
93
|
+
start: {
|
|
94
|
+
line: 24,
|
|
95
|
+
column: 0
|
|
96
|
+
},
|
|
97
|
+
end: {
|
|
98
|
+
line: 35,
|
|
99
|
+
column: 2
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
fnMap: {
|
|
104
|
+
"0": {
|
|
105
|
+
name: "(anonymous_0)",
|
|
106
|
+
decl: {
|
|
107
|
+
start: {
|
|
108
|
+
line: 6,
|
|
109
|
+
column: 21
|
|
110
|
+
},
|
|
111
|
+
end: {
|
|
112
|
+
line: 6,
|
|
113
|
+
column: 22
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
loc: {
|
|
117
|
+
start: {
|
|
118
|
+
line: 7,
|
|
119
|
+
column: 2
|
|
120
|
+
},
|
|
121
|
+
end: {
|
|
122
|
+
line: 21,
|
|
123
|
+
column: 8
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
line: 7
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
branchMap: {
|
|
130
|
+
"0": {
|
|
131
|
+
loc: {
|
|
132
|
+
start: {
|
|
133
|
+
line: 6,
|
|
134
|
+
column: 34
|
|
135
|
+
},
|
|
136
|
+
end: {
|
|
137
|
+
line: 6,
|
|
138
|
+
column: 48
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
type: "default-arg",
|
|
142
|
+
locations: [{
|
|
143
|
+
start: {
|
|
144
|
+
line: 6,
|
|
145
|
+
column: 46
|
|
146
|
+
},
|
|
147
|
+
end: {
|
|
148
|
+
line: 6,
|
|
149
|
+
column: 48
|
|
150
|
+
}
|
|
151
|
+
}],
|
|
152
|
+
line: 6
|
|
153
|
+
},
|
|
154
|
+
"1": {
|
|
155
|
+
loc: {
|
|
156
|
+
start: {
|
|
157
|
+
line: 6,
|
|
158
|
+
column: 50
|
|
159
|
+
},
|
|
160
|
+
end: {
|
|
161
|
+
line: 6,
|
|
162
|
+
column: 71
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
type: "default-arg",
|
|
166
|
+
locations: [{
|
|
167
|
+
start: {
|
|
168
|
+
line: 6,
|
|
169
|
+
column: 66
|
|
170
|
+
},
|
|
171
|
+
end: {
|
|
172
|
+
line: 6,
|
|
173
|
+
column: 71
|
|
174
|
+
}
|
|
175
|
+
}],
|
|
176
|
+
line: 6
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
s: {
|
|
180
|
+
"0": 0,
|
|
181
|
+
"1": 0,
|
|
182
|
+
"2": 0
|
|
183
|
+
},
|
|
184
|
+
f: {
|
|
185
|
+
"0": 0
|
|
186
|
+
},
|
|
187
|
+
b: {
|
|
188
|
+
"0": [0],
|
|
189
|
+
"1": [0]
|
|
190
|
+
},
|
|
191
|
+
_coverageSchema: "1a1c01bbd47fc00a2c39e90264f33305004495a9",
|
|
192
|
+
hash: "2e8f830646a90399b1c7c4d1b52186adb04b8606"
|
|
193
|
+
};
|
|
194
|
+
var coverage = global[gcv] || (global[gcv] = {});
|
|
195
|
+
if (!coverage[path] || coverage[path].hash !== hash) {
|
|
196
|
+
coverage[path] = coverageData;
|
|
197
|
+
}
|
|
198
|
+
var actualCoverage = coverage[path];
|
|
199
|
+
{
|
|
200
|
+
// @ts-ignore
|
|
201
|
+
cov_2pe656guy1 = function () {
|
|
202
|
+
return actualCoverage;
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
return actualCoverage;
|
|
206
|
+
}
|
|
207
|
+
cov_2pe656guy1();
|
|
208
|
+
cov_2pe656guy1().s[0]++;
|
|
209
|
+
var TableWrapper = function TableWrapper(_ref) {
|
|
210
|
+
var children = _ref.children,
|
|
211
|
+
_ref$className = _ref.className,
|
|
212
|
+
className = _ref$className === void 0 ? (cov_2pe656guy1().b[0][0]++, "") : _ref$className,
|
|
213
|
+
_ref$hasPagination = _ref.hasPagination,
|
|
214
|
+
hasPagination = _ref$hasPagination === void 0 ? (cov_2pe656guy1().b[1][0]++, false) : _ref$hasPagination;
|
|
215
|
+
cov_2pe656guy1().f[0]++;
|
|
216
|
+
cov_2pe656guy1().s[1]++;
|
|
217
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
218
|
+
"data-testid": "table-wrapper",
|
|
219
|
+
className: classNames("flex min-h-0 w-full flex-grow flex-col pb-6", className)
|
|
220
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
221
|
+
className: classNames("min-h-0 flex-grow", {
|
|
222
|
+
"pb-11": hasPagination
|
|
223
|
+
})
|
|
224
|
+
}, children));
|
|
225
|
+
};
|
|
226
|
+
cov_2pe656guy1().s[2]++;
|
|
227
|
+
|
|
228
|
+
export { TableWrapper as default };
|
|
229
|
+
//# sourceMappingURL=TableWrapper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableWrapper.js","sources":["../node_modules/classnames/index.js","../src/components/TableWrapper/index.jsx"],"sourcesContent":["/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\tvar nativeCodeString = '[native code]';\n\n\tfunction classNames() {\n\t\tvar classes = [];\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (!arg) continue;\n\n\t\t\tvar argType = typeof arg;\n\n\t\t\tif (argType === 'string' || argType === 'number') {\n\t\t\t\tclasses.push(arg);\n\t\t\t} else if (Array.isArray(arg)) {\n\t\t\t\tif (arg.length) {\n\t\t\t\t\tvar inner = classNames.apply(null, arg);\n\t\t\t\t\tif (inner) {\n\t\t\t\t\t\tclasses.push(inner);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (argType === 'object') {\n\t\t\t\tif (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {\n\t\t\t\t\tclasses.push(arg.toString());\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tfor (var key in arg) {\n\t\t\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\t\t\tclasses.push(key);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn classes.join(' ');\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n","import React from \"react\";\n\nimport classNames from \"classnames\";\nimport PropTypes from \"prop-types\";\n\nconst TableWrapper = ({ children, className = \"\", hasPagination = false }) => (\n <div\n data-testid=\"table-wrapper\"\n className={classNames(\n \"flex min-h-0 w-full flex-grow flex-col pb-6\",\n className\n )}\n >\n <div\n className={classNames(\"min-h-0 flex-grow\", {\n \"pb-11\": hasPagination,\n })}\n >\n {children}\n </div>\n </div>\n);\n\nTableWrapper.propTypes = {\n /**\n * Custom classnames for table wrapper.\n */\n className: PropTypes.string,\n /**\n * Handles table wrapper height when pagination is enabled.\n *\n * `hasPagination={totalCount > defaultPageSize}`\n */\n hasPagination: PropTypes.bool,\n};\n\nexport default TableWrapper;\n"],"names":["cov_2pe656guy1","actualCoverage","s","TableWrapper","_ref","children","_ref$className","className","b","_ref$hasPagination","hasPagination","f","React","createElement","classNames"],"mappings":";;;;;;;;;;;AAKA;AACA;AACA,CAAA,CAAC,YAAY;AAEb;AACA,EAAC,IAAI,MAAM,GAAG,EAAE,CAAC,cAAc,CAAC;AAEhC;EACC,SAAS,UAAU,GAAG;AACvB,GAAE,IAAI,OAAO,GAAG,EAAE,CAAC;AACnB;AACA,GAAE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AAC7C,IAAG,IAAI,GAAG,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;AAC1B,IAAG,IAAI,CAAC,GAAG,EAAE,SAAS;AACtB;AACA,IAAG,IAAI,OAAO,GAAG,OAAO,GAAG,CAAC;AAC5B;IACG,IAAI,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,QAAQ,EAAE;AACrD,KAAI,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;KAClB,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;AAClC,KAAI,IAAI,GAAG,CAAC,MAAM,EAAE;MACf,IAAI,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;MACxC,IAAI,KAAK,EAAE;AAChB,OAAM,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;OACpB;MACD;AACL,KAAI,MAAM,IAAI,OAAO,KAAK,QAAQ,EAAE;KAChC,IAAI,GAAG,CAAC,QAAQ,KAAK,MAAM,CAAC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AAC,cAAA,GAAAF,IAAA,CAAEG,SAAS;IAATA,SAAS,GAAAD,cAAA,KAAAN,KAAAA,CAAAA,IAAAA,cAAA,GAAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAG,EAAE,IAAAF,cAAA;IAAAG,kBAAA,GAAAL,IAAA,CAAEM,aAAa;IAAbA,aAAa,GAAAD,kBAAA,KAAAT,KAAAA,CAAAA,IAAAA,cAAA,GAAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAG,KAAK,IAAAC,kBAAA,CAAA;AAAAT,EAAAA,cAAA,GAAAW,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA;AAAAX,EAAAA,cAAA,GAAAE,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA;EACrE,oBAAAU,KAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;AACE,IAAA,aAAA,EAAY,eAAe;AAC3BN,IAAAA,SAAS,EAAEO,UAAU,CACnB,6CAA6C,EAC7CP,SAAS,CAAA;GAGXK,eAAAA,KAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;AACEN,IAAAA,SAAS,EAAEO,UAAU,CAAC,mBAAmB,EAAE;AACzC,MAAA,OAAO,EAAEJ,aAAAA;KACV,CAAA;GAEAL,EAAAA,QAAQ,CACL,CACF,CAAA;AAAD,EACN;AAACL,cAAA,GAAAE,CAAA,CAAA,CAAA,CAAA,EAAA;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bigbinary/neeto-molecules",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.18",
|
|
4
4
|
"description": "A package of reusable molecular components for neeto products.",
|
|
5
5
|
"repository": "git@github.com:bigbinary/neeto-molecules.git",
|
|
6
6
|
"author": "Amaljith K <amaljith.k@bigbinary.com>",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"build": "NODE_ENV=production build-storybook",
|
|
14
14
|
"serve": "node .storybook/db",
|
|
15
15
|
"watch": "rollup -c rollup.config.js --watch",
|
|
16
|
-
"storybook": "node .storybook/db & NODE_ENV=development start-storybook -p 6006",
|
|
16
|
+
"storybook": "(trap 'kill 0' SIGINT; node .storybook/db & NODE_ENV=development start-storybook -p 6006)",
|
|
17
17
|
"build:jsdoc": "node ./.scripts/jsdoc-builder.mjs"
|
|
18
18
|
},
|
|
19
19
|
"engines": {
|
|
@@ -84,6 +84,7 @@
|
|
|
84
84
|
"babel-plugin-transform-react-remove-prop-types": "0.4.24",
|
|
85
85
|
"babel-preset-react": "6.24.1",
|
|
86
86
|
"babel-preset-typescript": "^7.0.0-alpha.19",
|
|
87
|
+
"countries-list": "^2.6.1",
|
|
87
88
|
"css-loader": "4.3.0",
|
|
88
89
|
"cypress": "11.2.0",
|
|
89
90
|
"dayjs": "1.11.1",
|
|
@@ -105,6 +106,7 @@
|
|
|
105
106
|
"jest": "27.5.1",
|
|
106
107
|
"js-logger": "^1.6.1",
|
|
107
108
|
"json-server": "0.17.1",
|
|
109
|
+
"libphonenumber-js": "^1.10.26",
|
|
108
110
|
"lint-staged": "^12.3.7",
|
|
109
111
|
"mixpanel-browser": "^2.45.0",
|
|
110
112
|
"mousetrap": "^1.6.5",
|
|
@@ -120,6 +122,7 @@
|
|
|
120
122
|
"qrcode.react": "^3.1.0",
|
|
121
123
|
"qs": "^6.11.0",
|
|
122
124
|
"ramda": "^0.28.0",
|
|
125
|
+
"raw-loader": "^4.0.2",
|
|
123
126
|
"react": "^17.0.2",
|
|
124
127
|
"react-dom": "17.0.2",
|
|
125
128
|
"react-helmet": "^6.1.0",
|
package/src/translations/en.json
CHANGED
|
@@ -329,6 +329,12 @@
|
|
|
329
329
|
"emailAddress": "Please enter at least one email address"
|
|
330
330
|
}
|
|
331
331
|
}
|
|
332
|
+
},
|
|
333
|
+
"phoneNumberInput": {
|
|
334
|
+
"placeholder": "{{prefix}} type phone number",
|
|
335
|
+
"validations": {
|
|
336
|
+
"invalid": "Phone number is invalid"
|
|
337
|
+
}
|
|
332
338
|
}
|
|
333
339
|
}
|
|
334
340
|
}
|
package/types/Header.d.ts
CHANGED
|
@@ -1,15 +1,28 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* The Header component can be used to display the page title and an action block
|
|
5
|
+
*
|
|
6
|
+
* to perform the main operations on the page.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
*
|
|
10
|
+
* import Header from "@bigbinary/neeto-molecules/Header";
|
|
11
|
+
*
|
|
12
|
+
* const App = () => (
|
|
13
|
+
* <Header title="Heading" actionBlock={<Button label="Primary action" />} />
|
|
14
|
+
* );
|
|
15
|
+
* @endexample
|
|
16
|
+
*/
|
|
3
17
|
const Header: React.FC<{
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
18
|
+
title?: React.ReactNode;
|
|
19
|
+
className?: string;
|
|
20
|
+
actionBlock?: React.ReactNode;
|
|
21
|
+
searchProps?: object;
|
|
22
|
+
breadcrumbs?: {
|
|
23
|
+
text: string;
|
|
24
|
+
link: string;
|
|
25
|
+
}[];
|
|
26
|
+
menuBarToggle?: (...args: any[]) => any;
|
|
13
27
|
}>;
|
|
14
|
-
|
|
15
|
-
export default Header;
|
|
28
|
+
export default Header;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { InputProps, SelectProps, TypographyProps } from "@bigbinary/neetoui";
|
|
3
|
+
import { CountryCode } from "libphonenumber-js";
|
|
4
|
+
import { StringSchema } from "yup";
|
|
5
|
+
export interface PhoneNumberInputProps extends InputProps {
|
|
6
|
+
value?: string;
|
|
7
|
+
onChange?: (value: string) => any;
|
|
8
|
+
className?: string;
|
|
9
|
+
selectProps?: SelectProps;
|
|
10
|
+
error?: string;
|
|
11
|
+
defaultCountry?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface FormikPhoneNumberInputProps extends PhoneNumberInputProps {
|
|
14
|
+
name: string;
|
|
15
|
+
}
|
|
16
|
+
export interface PhoneNumberProps extends TypographyProps {
|
|
17
|
+
className?: string;
|
|
18
|
+
defaultCountry?: string;
|
|
19
|
+
children?: React.ReactNode;
|
|
20
|
+
showEmoji?: boolean;
|
|
21
|
+
value?: string;
|
|
22
|
+
}
|
|
23
|
+
export const PhoneNumberInput: React.ForwardRefExoticComponent<PhoneNumberInputProps>;
|
|
24
|
+
export const FormikPhoneNumberInput: React.ForwardRefExoticComponent<FormikPhoneNumberInputProps>;
|
|
25
|
+
export
|
|
26
|
+
/**
|
|
27
|
+
*
|
|
28
|
+
* An input component to input and validate phone numbers with a country code
|
|
29
|
+
*
|
|
30
|
+
* picker.
|
|
31
|
+
*
|
|
32
|
+
* 
|
|
33
|
+
*
|
|
34
|
+
* Props:
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
*
|
|
38
|
+
* import React, { useState } from "react";
|
|
39
|
+
*
|
|
40
|
+
* import { PhoneNumberInput } from "@bigbinary/neeto-molecules/PhoneNumber";
|
|
41
|
+
*
|
|
42
|
+
* const App = () => {
|
|
43
|
+
* const [phoneNumber, setPhoneNumber] = useState("");
|
|
44
|
+
*
|
|
45
|
+
* return <PhoneNumberInput value={phoneNumber} onChange={setPhoneNumber} />;
|
|
46
|
+
* };
|
|
47
|
+
* @endexample
|
|
48
|
+
* A typography component to display phone numbers along with the flag of the
|
|
49
|
+
*
|
|
50
|
+
* country associated with it.
|
|
51
|
+
*
|
|
52
|
+
* 
|
|
53
|
+
*
|
|
54
|
+
* Props:
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
*
|
|
58
|
+
* import { PhoneNumber } from "@bigbinary/neeto-molecules/PhoneNumber";
|
|
59
|
+
*
|
|
60
|
+
* const App = () => <PhoneNumber showEmoji value="+919988776655" />;
|
|
61
|
+
* @endexample
|
|
62
|
+
* The PhoneNumberInput component wrapped in Formik.
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
*
|
|
66
|
+
* import { FormikPhoneNumberInput, validation } from "@bigbinary/neeto-molecules/PhoneNumber";
|
|
67
|
+
* import { Form } from "@bigbinary/neetoui/formik";
|
|
68
|
+
*
|
|
69
|
+
* const App = () => (
|
|
70
|
+
* return (
|
|
71
|
+
* <Form
|
|
72
|
+
* formikProps={{
|
|
73
|
+
* initialValues: { phoneNumber: "+919988776655" },
|
|
74
|
+
* validationSchema: yup.object({ phoneNumber: validation().required() }),
|
|
75
|
+
* onSubmit: ({ phoneNumber }) => alert(phoneNumber),
|
|
76
|
+
* }}
|
|
77
|
+
* >
|
|
78
|
+
* <FormikPhoneNumberInput name="phoneNumber" />
|
|
79
|
+
* </Form>
|
|
80
|
+
* );
|
|
81
|
+
* );
|
|
82
|
+
* @endexample
|
|
83
|
+
* A utility function that exports a Yup validation schema to be used in Formik. It
|
|
84
|
+
*
|
|
85
|
+
* accepts a string as an optional argument to override the default validation
|
|
86
|
+
*
|
|
87
|
+
* message.
|
|
88
|
+
*
|
|
89
|
+
* @example
|
|
90
|
+
*
|
|
91
|
+
* import { validation } from "@bigbinary/neeto-molecules/PhoneNumber";
|
|
92
|
+
* import * as yup from "yup";
|
|
93
|
+
*
|
|
94
|
+
* const VALIDATION_SCHEMA = yup.object({
|
|
95
|
+
* phoneNumber: validation("Phone number is invalid"),
|
|
96
|
+
* });
|
|
97
|
+
* @endexample
|
|
98
|
+
* A utility function to check whether a phone number is valid. It accepts a phone
|
|
99
|
+
*
|
|
100
|
+
* number and a default country as argument and returns a boolean value specifying
|
|
101
|
+
*
|
|
102
|
+
* whether the phone number is valid or not.
|
|
103
|
+
*
|
|
104
|
+
*/
|
|
105
|
+
const PhoneNumber: React.FC<PhoneNumberProps>;
|
|
106
|
+
export const isPhoneNumberValid: (phoneNumber: string, defaultCountry?: CountryCode | {
|
|
107
|
+
defaultCountry?: CountryCode;
|
|
108
|
+
defaultCallingCode?: string;
|
|
109
|
+
}) => boolean;
|
|
110
|
+
export const validation: (message?: string) => StringSchema<any, any, any>;
|