table 6.3.3 → 6.3.4
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/alignString.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import type { ColumnUserConfig } from './types/api';
|
|
2
|
+
declare const _default: (subject: string, containerWidth: number, alignment: ColumnUserConfig['alignment']) => string;
|
|
2
3
|
/**
|
|
3
4
|
* Pads a string to the left and/or right to position the subject
|
|
4
5
|
* text in a desired alignment within a container.
|
package/dist/alignString.js
CHANGED
|
@@ -21,11 +21,6 @@ const alignCenter = (subject, width) => {
|
|
|
21
21
|
return ' '.repeat(halfWidth) + subject + ' '.repeat(halfWidth + 1);
|
|
22
22
|
}
|
|
23
23
|
};
|
|
24
|
-
const alignments = [
|
|
25
|
-
'left',
|
|
26
|
-
'right',
|
|
27
|
-
'center',
|
|
28
|
-
];
|
|
29
24
|
/**
|
|
30
25
|
* Pads a string to the left and/or right to position the subject
|
|
31
26
|
* text in a desired alignment within a container.
|
|
@@ -41,12 +36,6 @@ exports.default = (subject, containerWidth, alignment) => {
|
|
|
41
36
|
if (subjectWidth > containerWidth) {
|
|
42
37
|
throw new Error('Subject parameter value width cannot be greater than the container width.');
|
|
43
38
|
}
|
|
44
|
-
if (typeof alignment !== 'string') {
|
|
45
|
-
throw new TypeError('Alignment parameter value must be a string.');
|
|
46
|
-
}
|
|
47
|
-
if (!alignments.includes(alignment)) {
|
|
48
|
-
throw new Error('Alignment parameter value must be a known alignment parameter value (left, right, center).');
|
|
49
|
-
}
|
|
50
39
|
if (subjectWidth === 0) {
|
|
51
40
|
return ' '.repeat(containerWidth);
|
|
52
41
|
}
|
|
@@ -16,9 +16,6 @@ exports.default = (rows, config) => {
|
|
|
16
16
|
if (typeof config.columns[index1].width !== 'number') {
|
|
17
17
|
throw new TypeError('column[index].width must be a number.');
|
|
18
18
|
}
|
|
19
|
-
if (config.columns[index1].wrapWord !== true && config.columns[index1].wrapWord !== false) {
|
|
20
|
-
throw new TypeError('column[index].wrapWord must be a boolean.');
|
|
21
|
-
}
|
|
22
19
|
cellHeightIndex[index1] = calculateCellHeight_1.default(value, config.columns[index1].width, config.columns[index1].wrapWord);
|
|
23
20
|
});
|
|
24
21
|
rowSpanIndex.push(Math.max(...cellHeightIndex));
|
package/dist/validateConfig.js
CHANGED
|
@@ -5,10 +5,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const validators_1 = __importDefault(require("./generated/validators"));
|
|
7
7
|
exports.default = (schemaId, config) => {
|
|
8
|
-
var _a;
|
|
9
8
|
const validate = validators_1.default[schemaId];
|
|
10
|
-
if (!validate(config)) {
|
|
11
|
-
const errors =
|
|
9
|
+
if (!validate(config) && validate.errors) {
|
|
10
|
+
const errors = validate.errors.map((error) => {
|
|
12
11
|
return {
|
|
13
12
|
message: error.message,
|
|
14
13
|
params: error.params,
|
package/package.json
CHANGED