additional macros

This commit is contained in:
Jan Prochazka
2021-03-25 19:19:14 +01:00
parent 952bdc4baa
commit 9876a76836
3 changed files with 59 additions and 2 deletions

View File

@@ -58,6 +58,58 @@ return value ? value.toString().replace(new RegExp(rtext, rflags), args.replace
],
code: `return modules.lodash[args.type](value)`,
},
{
title: 'Pad left',
name: 'padLeft',
group: 'Text',
args: [
{
type: 'text',
label: 'Character',
name: 'character',
default: '0',
},
{
type: 'text',
label: 'Length',
name: 'length',
default: '3',
},
],
description: 'Returns string of a specified length in which the beginning of the current string is padded with spaces or other character',
type: 'transformValue',
code: `return modules.lodash.padStart(value, +args.length, args.character)`,
},
{
title: 'Pad right',
name: 'padRight',
group: 'Text',
args: [
{
type: 'text',
label: 'Character',
name: 'character',
default: '0',
},
{
type: 'text',
label: 'Length',
name: 'length',
default: '3',
},
],
description: 'Returns string of a specified length in which the end of the current string is padded with spaces or other character',
type: 'transformValue',
code: `return modules.lodash.padEnd(value, +args.length, args.character)`,
},
{
title: 'Trim',
name: 'trim',
group: 'Text',
description: 'Removes leading and trailing whitespace ',
type: 'transformValue',
code: `return modules.lodash.trim(value)`,
},
{
title: 'Row index',
name: 'rowIndex',