@focuson/form_components
Version:
Components that can be used by @focuson/forms
74 lines (73 loc) • 2.34 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.trimDownText = exports.lastIndexOf = exports.getButtonClassName = exports.HowOften = exports.EmploymentType = exports.YesNo = exports.CustomerStatus = exports.ContactTitle = void 0;
var ContactTitle;
(function (ContactTitle) {
ContactTitle["X"] = "";
ContactTitle["MR"] = "Mr";
ContactTitle["MRS"] = "Mrs";
ContactTitle["MISS"] = "Miss";
ContactTitle["MS"] = "Ms";
ContactTitle["DR"] = "Dr";
ContactTitle["REV"] = "Rev";
ContactTitle["PROF"] = "Prof";
ContactTitle["SIR"] = "Sir";
ContactTitle["CAPTAIN"] = "Captain";
ContactTitle["LADY"] = "Lady";
ContactTitle["MAJOR"] = "Major";
ContactTitle["MASTER"] = "Master";
ContactTitle["LORD"] = "Lord";
ContactTitle["COLONEL"] = "Colonel";
ContactTitle["BARON"] = "Baron";
ContactTitle["VISCOUNT"] = "Viscount";
ContactTitle["BRIGADIER"] = "Brigadier";
ContactTitle["LIEUT_COL"] = "Lieut Col";
ContactTitle["FRAU"] = "Frau";
ContactTitle["HERR"] = "Herr";
ContactTitle["FATHER"] = "Father";
ContactTitle["MESSRS"] = "Messrs";
ContactTitle["MADAM"] = "Madam";
})(ContactTitle = exports.ContactTitle || (exports.ContactTitle = {}));
exports.CustomerStatus = {
X: '',
E: 'Employed',
S: 'Self Employed',
C: 'Currently not earning',
R: 'Retired',
T: 'Student',
U: 'Unknown',
H: 'Home Family Responsibilities'
};
exports.YesNo = {
X: '',
N: 'No',
Y: 'Yes'
};
exports.EmploymentType = {
0: '',
1: 'Permanent',
2: 'Temporary',
3: 'Contract'
};
exports.HowOften = {
0: '',
1: 'Annual',
2: 'Monthly',
3: 'Quarterly',
4: 'Half-Yearly',
5: 'Fortnightly',
6: 'Weekly'
};
const getButtonClassName = (buttonType) => (buttonType == 'primary' ? 'primary-btn' : (buttonType == 'secondary' ? 'secondary-btn' : 'button'));
exports.getButtonClassName = getButtonClassName;
function lastIndexOf(ts, fn) {
const copy = [...ts].reverse();
const index = copy.findIndex(fn);
return ts.length - index - 1;
}
exports.lastIndexOf = lastIndexOf;
function trimDownText(s, trimDownToSize) {
const size = trimDownToSize ? trimDownToSize : 300;
return s.length > size ? s.slice(0, size) + " ..." : s;
}
exports.trimDownText = trimDownText;