es-grid-template
Version:
es-grid-template
246 lines (244 loc) • 4.74 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.valueToBoolean = exports.translateOption = exports.transferFontSize = exports.stringOperator = exports.paperSize = exports.optionsSize = exports.optionsPaperOrientation = exports.optionFontSize = exports.optionFont = exports.numberOperator = exports.defaultWidth = exports.defaultTimeFormat = exports.defaultRowHeight = exports.defaultPageSizes = exports.defaultDateTimeFormat = exports.defaultDateFormat = exports.default = exports.dateTimeOperator = exports.dateOperator = exports.booleanToValue = exports.booleanOperator = exports.alignToFlex = void 0;
const defaultWidth = exports.defaultWidth = 100;
const defaultRowHeight = exports.defaultRowHeight = 35;
const numberOperator = exports.numberOperator = [{
value: 'equal',
label: 'Equal',
key: '=='
}, {
value: 'greaterthan',
label: 'Greater than',
key: '>'
}, {
value: 'greaterthanorequal',
label: 'Greater than or equal',
key: '>='
}, {
value: 'lessthan',
label: 'Less than',
key: '<'
}, {
value: 'lessthanorequal',
label: 'Less than or equal',
key: '<='
}, {
value: 'notequal',
label: 'Not equal',
key: '!='
}];
const stringOperator = exports.stringOperator = [{
value: 'startswith',
key: '_=',
label: 'Starts with'
}, {
value: 'endswith',
key: '|=',
label: 'Ends with'
}, {
value: 'contains',
key: '~=',
label: 'Contains'
}, {
value: 'equal',
key: '==',
label: 'Equal'
}, {
value: 'notequal',
key: '!=',
label: 'Not equal'
}];
const dateOperator = exports.dateOperator = [{
value: 'equal',
key: '==',
label: 'Equal'
}, {
value: 'notequal',
key: '!=',
label: 'Not equal'
}, {
value: 'greaterthan',
key: '>',
label: 'Greater than'
}, {
value: 'lessthan',
key: '<',
label: 'Less than'
}];
const dateTimeOperator = exports.dateTimeOperator = [{
value: 'equal',
key: '==',
label: 'Equal'
}, {
value: 'notequal',
key: '!=',
label: 'Not equal'
}, {
value: 'greaterthan',
key: '>',
label: 'Greater than'
}, {
value: 'lessthan',
key: '<',
label: 'Less than'
}];
const booleanOperator = exports.booleanOperator = [{
value: 'equal',
key: '==',
label: 'Equal'
}, {
value: 'notequal',
key: '!=',
label: 'Not equal'
}];
const translateOption = (options, t) => {
if (!t) {
return options;
}
return options.map(it => ({
...it,
label: t(it.label)
}));
};
exports.translateOption = translateOption;
const transferFontSize = exports.transferFontSize = {
6: 8,
7: 9,
8: 11,
9: 12,
10: 13,
11: 15,
12: 16,
13: 17,
14: 19,
15: 20,
16: 21,
17: 23,
18: 24,
19: 25,
20: 27,
21: 28,
22: 29,
24: 32,
26: 35,
27: 36,
28: 37
};
const defaultDateFormat = exports.defaultDateFormat = 'd/m/Y';
const defaultDateTimeFormat = exports.defaultDateTimeFormat = 'd/m/Y H:i';
const defaultTimeFormat = exports.defaultTimeFormat = 'H:i';
const defaultPageSizes = exports.defaultPageSizes = [20, 30, 50, 100];
const alignToFlex = exports.alignToFlex = {
center: 'center',
left: 'start',
right: 'end'
};
const optionsSize = exports.optionsSize = [{
label: 'letter',
value: 'letter',
width: 21.59,
height: 27.94
}, {
label: 'A3',
value: 'a3',
width: 27.94,
height: 42
}, {
label: 'A4',
value: 'a4',
width: 21,
height: 29.7
}];
const paperSize = exports.paperSize = {
a4: {
width: 21,
height: 29.7
},
a3: {
width: 27.94,
height: 42
},
letter: {
width: 21.59,
height: 27.94
}
};
const optionFont = exports.optionFont = [{
value: 'Times New Roman',
label: 'Times New Roman'
}, {
value: 'Calibri',
label: 'Calibri (Body)'
}];
// portrait' | 'landscape'
const optionsPaperOrientation = exports.optionsPaperOrientation = [{
value: 'portrait',
label: 'portrait'
}, {
value: 'landscape',
label: 'landscape'
}];
const optionFontSize = exports.optionFontSize = [{
value: 8,
label: '8'
}, {
value: 9,
label: '9'
}, {
value: 10,
label: '10'
}, {
value: 11,
label: '11'
}, {
value: 12,
label: '12'
}, {
value: 13,
label: '13'
}, {
value: 14,
label: '14'
}, {
value: 16,
label: '16'
}, {
value: 18,
label: '18'
}, {
value: 24,
label: '24'
}, {
value: 36,
label: '36'
}, {
value: 48,
label: '48'
}];
/**
* Sort order for BaseTable
*/
const SortOrder = {
/**
* Sort data in ascending order
*/
ascend: 'Ascending',
/**
* Sort data in descending order
*/
descend: 'Descending'
};
var _default = exports.default = SortOrder;
const valueToBoolean = exports.valueToBoolean = {
true: true,
false: false,
1: true,
0: false
};
const booleanToValue = exports.booleanToValue = {
true: 1,
false: 0
};