mirror of
https://github.com/iib0011/omni-tools.git
synced 2025-12-29 16:16:02 +00:00
fix: i18n tsc
This commit is contained in:
@@ -102,7 +102,7 @@ const exampleCards: CardExampleType<InitialValuesType>[] = [
|
||||
];
|
||||
|
||||
export default function Duplicate({ title }: ToolComponentProps) {
|
||||
const { t } = useTranslation();
|
||||
const { t } = useTranslation('list');
|
||||
const [input, setInput] = useState<string>('');
|
||||
const [result, setResult] = useState<string>('');
|
||||
|
||||
@@ -136,53 +136,53 @@ export default function Duplicate({ title }: ToolComponentProps) {
|
||||
updateField
|
||||
}) => [
|
||||
{
|
||||
title: t('list:duplicate.splitOptions'),
|
||||
title: t('duplicate.splitOptions'),
|
||||
component: (
|
||||
<Box>
|
||||
<SimpleRadio
|
||||
onClick={() => updateField('splitOperatorType', 'symbol')}
|
||||
checked={values.splitOperatorType === 'symbol'}
|
||||
title={t('list:duplicate.splitBySymbol')}
|
||||
title={t('duplicate.splitBySymbol')}
|
||||
/>
|
||||
<SimpleRadio
|
||||
onClick={() => updateField('splitOperatorType', 'regex')}
|
||||
checked={values.splitOperatorType === 'regex'}
|
||||
title={t('list:duplicate.splitByRegex')}
|
||||
title={t('duplicate.splitByRegex')}
|
||||
/>
|
||||
<TextFieldWithDesc
|
||||
value={values.splitSeparator}
|
||||
onOwnChange={(val) => updateField('splitSeparator', val)}
|
||||
description={t('list:duplicate.splitSeparatorDescription')}
|
||||
description={t('duplicate.splitSeparatorDescription')}
|
||||
/>
|
||||
<TextFieldWithDesc
|
||||
value={values.joinSeparator}
|
||||
onOwnChange={(val) => updateField('joinSeparator', val)}
|
||||
description={t('list:duplicate.joinSeparatorDescription')}
|
||||
description={t('duplicate.joinSeparatorDescription')}
|
||||
/>
|
||||
</Box>
|
||||
)
|
||||
},
|
||||
{
|
||||
title: t('list:duplicate.duplicationOptions'),
|
||||
title: t('duplicate.duplicationOptions'),
|
||||
component: (
|
||||
<Box>
|
||||
<TextFieldWithDesc
|
||||
value={values.copy}
|
||||
onOwnChange={(val) => updateField('copy', val)}
|
||||
description={t('list:duplicate.copyDescription')}
|
||||
description={t('duplicate.copyDescription')}
|
||||
type="number"
|
||||
/>
|
||||
<CheckboxWithDesc
|
||||
title={t('list:duplicate.concatenate')}
|
||||
title={t('duplicate.concatenate')}
|
||||
checked={values.concatenate}
|
||||
onChange={(checked) => updateField('concatenate', checked)}
|
||||
description={t('list:duplicate.concatenateDescription')}
|
||||
description={t('duplicate.concatenateDescription')}
|
||||
/>
|
||||
<CheckboxWithDesc
|
||||
title={t('list:duplicate.reverse')}
|
||||
title={t('duplicate.reverse')}
|
||||
checked={values.reverse}
|
||||
onChange={(checked) => updateField('reverse', checked)}
|
||||
description={t('list:duplicate.reverseDescription')}
|
||||
description={t('duplicate.reverseDescription')}
|
||||
/>
|
||||
</Box>
|
||||
)
|
||||
@@ -194,23 +194,20 @@ export default function Duplicate({ title }: ToolComponentProps) {
|
||||
title={title}
|
||||
inputComponent={
|
||||
<ToolTextInput
|
||||
title={t('list:duplicate.inputTitle')}
|
||||
title={t('duplicate.inputTitle')}
|
||||
value={input}
|
||||
onChange={setInput}
|
||||
/>
|
||||
}
|
||||
resultComponent={
|
||||
<ToolTextResult
|
||||
title={t('list:duplicate.resultTitle')}
|
||||
value={result}
|
||||
/>
|
||||
<ToolTextResult title={t('duplicate.resultTitle')} value={result} />
|
||||
}
|
||||
initialValues={initialValues}
|
||||
getGroups={getGroups}
|
||||
validationSchema={validationSchema}
|
||||
toolInfo={{
|
||||
title: t('list:duplicate.toolInfo.title'),
|
||||
description: t('list:duplicate.toolInfo.description')
|
||||
title: t('duplicate.toolInfo.title'),
|
||||
description: t('duplicate.toolInfo.description')
|
||||
}}
|
||||
exampleCards={exampleCards}
|
||||
input={input}
|
||||
|
||||
@@ -36,7 +36,7 @@ const splitOperators: {
|
||||
];
|
||||
|
||||
export default function FindUnique() {
|
||||
const { t } = useTranslation();
|
||||
const { t } = useTranslation('list');
|
||||
const [input, setInput] = useState<string>('');
|
||||
const [result, setResult] = useState<string>('');
|
||||
const compute = (optionsValues: typeof initialValues, input: any) => {
|
||||
@@ -66,27 +66,24 @@ export default function FindUnique() {
|
||||
|
||||
return (
|
||||
<ToolContent
|
||||
title={t('list:findUnique.title')}
|
||||
title={t('findUnique.title')}
|
||||
initialValues={initialValues}
|
||||
compute={compute}
|
||||
input={input}
|
||||
setInput={setInput}
|
||||
inputComponent={
|
||||
<ToolTextInput
|
||||
title={t('list:findUnique.inputTitle')}
|
||||
title={t('findUnique.inputTitle')}
|
||||
value={input}
|
||||
onChange={setInput}
|
||||
/>
|
||||
}
|
||||
resultComponent={
|
||||
<ToolTextResult
|
||||
title={t('list:findUnique.resultTitle')}
|
||||
value={result}
|
||||
/>
|
||||
<ToolTextResult title={t('findUnique.resultTitle')} value={result} />
|
||||
}
|
||||
getGroups={({ values, updateField }) => [
|
||||
{
|
||||
title: t('list:findUnique.inputListDelimiter'),
|
||||
title: t('findUnique.inputListDelimiter'),
|
||||
component: (
|
||||
<Box>
|
||||
{splitOperators.map(({ title, description, type }) => (
|
||||
@@ -99,7 +96,7 @@ export default function FindUnique() {
|
||||
/>
|
||||
))}
|
||||
<TextFieldWithDesc
|
||||
description={t('list:findUnique.delimiterDescription')}
|
||||
description={t('findUnique.delimiterDescription')}
|
||||
value={values.splitSeparator}
|
||||
onOwnChange={(val) => updateField('splitSeparator', val)}
|
||||
/>
|
||||
@@ -107,7 +104,7 @@ export default function FindUnique() {
|
||||
)
|
||||
},
|
||||
{
|
||||
title: t('list:findUnique.outputListDelimiter'),
|
||||
title: t('findUnique.outputListDelimiter'),
|
||||
component: (
|
||||
<Box>
|
||||
<TextFieldWithDesc
|
||||
@@ -115,14 +112,14 @@ export default function FindUnique() {
|
||||
onOwnChange={(value) => updateField('joinSeparator', value)}
|
||||
/>
|
||||
<CheckboxWithDesc
|
||||
title={t('list:findUnique.trimItems')}
|
||||
description={t('list:findUnique.trimItemsDescription')}
|
||||
title={t('findUnique.trimItems')}
|
||||
description={t('findUnique.trimItemsDescription')}
|
||||
checked={values.trimItems}
|
||||
onChange={(value) => updateField('trimItems', value)}
|
||||
/>
|
||||
<CheckboxWithDesc
|
||||
title={t('list:findUnique.skipEmptyItems')}
|
||||
description={t('list:findUnique.skipEmptyItemsDescription')}
|
||||
title={t('findUnique.skipEmptyItems')}
|
||||
description={t('findUnique.skipEmptyItemsDescription')}
|
||||
checked={values.deleteEmptyItems}
|
||||
onChange={(value) => updateField('deleteEmptyItems', value)}
|
||||
/>
|
||||
@@ -130,20 +127,20 @@ export default function FindUnique() {
|
||||
)
|
||||
},
|
||||
{
|
||||
title: t('list:findUnique.uniqueItemOptions'),
|
||||
title: t('findUnique.uniqueItemOptions'),
|
||||
component: (
|
||||
<Box>
|
||||
<CheckboxWithDesc
|
||||
title={t('list:findUnique.findAbsolutelyUniqueItems')}
|
||||
title={t('findUnique.findAbsolutelyUniqueItems')}
|
||||
description={t(
|
||||
'list:findUnique.findAbsolutelyUniqueItemsDescription'
|
||||
'findUnique.findAbsolutelyUniqueItemsDescription'
|
||||
)}
|
||||
checked={values.absolutelyUnique}
|
||||
onChange={(value) => updateField('absolutelyUnique', value)}
|
||||
/>
|
||||
<CheckboxWithDesc
|
||||
title={t('list:findUnique.caseSensitiveItems')}
|
||||
description={t('list:findUnique.caseSensitiveItemsDescription')}
|
||||
title={t('findUnique.caseSensitiveItems')}
|
||||
description={t('findUnique.caseSensitiveItemsDescription')}
|
||||
checked={values.caseSensitive}
|
||||
onChange={(value) => updateField('caseSensitive', value)}
|
||||
/>
|
||||
|
||||
@@ -41,7 +41,7 @@ const splitOperators: {
|
||||
];
|
||||
|
||||
export default function FindUnique({ title }: ToolComponentProps) {
|
||||
const { t } = useTranslation();
|
||||
const { t } = useTranslation('list');
|
||||
const [input, setInput] = useState<string>('');
|
||||
const [result, setResult] = useState<string>('');
|
||||
const compute = (optionsValues: typeof initialValues, input: any) => {
|
||||
@@ -81,18 +81,18 @@ export default function FindUnique({ title }: ToolComponentProps) {
|
||||
input={input}
|
||||
inputComponent={
|
||||
<ToolTextInput
|
||||
title={t('list:group.inputTitle')}
|
||||
title={t('group.inputTitle')}
|
||||
value={input}
|
||||
onChange={setInput}
|
||||
/>
|
||||
}
|
||||
resultComponent={
|
||||
<ToolTextResult title={t('list:group.resultTitle')} value={result} />
|
||||
<ToolTextResult title={t('group.resultTitle')} value={result} />
|
||||
}
|
||||
initialValues={initialValues}
|
||||
getGroups={({ values, updateField }) => [
|
||||
{
|
||||
title: t('list:group.inputItemSeparator'),
|
||||
title: t('group.inputItemSeparator'),
|
||||
component: (
|
||||
<Box>
|
||||
{splitOperators.map(({ title, description, type }) => (
|
||||
@@ -107,7 +107,7 @@ export default function FindUnique({ title }: ToolComponentProps) {
|
||||
/>
|
||||
))}
|
||||
<TextFieldWithDesc
|
||||
description={t('list:group.splitSeparatorDescription')}
|
||||
description={t('group.splitSeparatorDescription')}
|
||||
value={values.splitSeparator}
|
||||
onOwnChange={(val) => updateField('splitSeparator', val)}
|
||||
/>
|
||||
@@ -115,12 +115,12 @@ export default function FindUnique({ title }: ToolComponentProps) {
|
||||
)
|
||||
},
|
||||
{
|
||||
title: t('list:group.groupSizeAndSeparators'),
|
||||
title: t('group.groupSizeAndSeparators'),
|
||||
component: (
|
||||
<Box>
|
||||
<TextFieldWithDesc
|
||||
value={values.groupNumber}
|
||||
description={t('list:group.groupNumberDescription')}
|
||||
description={t('group.groupNumberDescription')}
|
||||
type={'number'}
|
||||
onOwnChange={(value) =>
|
||||
updateField('groupNumber', formatNumber(value, 1))
|
||||
@@ -128,46 +128,46 @@ export default function FindUnique({ title }: ToolComponentProps) {
|
||||
/>
|
||||
<TextFieldWithDesc
|
||||
value={values.itemSeparator}
|
||||
description={t('list:group.itemSeparatorDescription')}
|
||||
description={t('group.itemSeparatorDescription')}
|
||||
onOwnChange={(value) => updateField('itemSeparator', value)}
|
||||
/>
|
||||
<TextFieldWithDesc
|
||||
value={values.groupSeparator}
|
||||
description={t('list:group.groupSeparatorDescription')}
|
||||
description={t('group.groupSeparatorDescription')}
|
||||
onOwnChange={(value) => updateField('groupSeparator', value)}
|
||||
/>
|
||||
<TextFieldWithDesc
|
||||
value={values.leftWrap}
|
||||
description={t('list:group.leftWrapDescription')}
|
||||
description={t('group.leftWrapDescription')}
|
||||
onOwnChange={(value) => updateField('leftWrap', value)}
|
||||
/>
|
||||
<TextFieldWithDesc
|
||||
value={values.rightWrap}
|
||||
description={t('list:group.rightWrapDescription')}
|
||||
description={t('group.rightWrapDescription')}
|
||||
onOwnChange={(value) => updateField('rightWrap', value)}
|
||||
/>
|
||||
</Box>
|
||||
)
|
||||
},
|
||||
{
|
||||
title: t('list:group.emptyItemsAndPadding'),
|
||||
title: t('group.emptyItemsAndPadding'),
|
||||
component: (
|
||||
<Box>
|
||||
<CheckboxWithDesc
|
||||
title={t('list:group.deleteEmptyItems')}
|
||||
description={t('list:group.deleteEmptyItemsDescription')}
|
||||
title={t('group.deleteEmptyItems')}
|
||||
description={t('group.deleteEmptyItemsDescription')}
|
||||
checked={values.deleteEmptyItems}
|
||||
onChange={(value) => updateField('deleteEmptyItems', value)}
|
||||
/>
|
||||
<CheckboxWithDesc
|
||||
title={t('list:group.padNonFullGroups')}
|
||||
description={t('list:group.padNonFullGroupsDescription')}
|
||||
title={t('group.padNonFullGroups')}
|
||||
description={t('group.padNonFullGroupsDescription')}
|
||||
checked={values.padNonFullGroup}
|
||||
onChange={(value) => updateField('padNonFullGroup', value)}
|
||||
/>
|
||||
<TextFieldWithDesc
|
||||
value={values.paddingChar}
|
||||
description={t('list:group.paddingCharDescription')}
|
||||
description={t('group.paddingCharDescription')}
|
||||
onOwnChange={(value) => updateField('paddingChar', value)}
|
||||
/>
|
||||
</Box>
|
||||
|
||||
@@ -1,24 +1,4 @@
|
||||
{
|
||||
"group": {
|
||||
"title": "Group List",
|
||||
"description": "Group list items by common properties.",
|
||||
"inputTitle": "Input list",
|
||||
"resultTitle": "Grouped list",
|
||||
"groupingOptions": "Grouping Options",
|
||||
"groupByDescription": "Choose how to group the list items",
|
||||
"groupByValue": "Group by Value",
|
||||
"groupByValueDescription": "Group items that have the same value",
|
||||
"groupByLength": "Group by Length",
|
||||
"groupByLengthDescription": "Group items by their character length",
|
||||
"groupByFirstChar": "Group by First Character",
|
||||
"groupByFirstCharDescription": "Group items by their first character",
|
||||
"groupByLastChar": "Group by Last Character",
|
||||
"groupByLastCharDescription": "Group items by their last character",
|
||||
"toolInfo": {
|
||||
"title": "Group List",
|
||||
"description": "This tool allows you to group list items by various criteria such as value, length, or character position. It's useful for organizing and categorizing data."
|
||||
}
|
||||
},
|
||||
"reverse": {
|
||||
"title": "Reverse List",
|
||||
"description": "Reverse the order of items in a list.",
|
||||
@@ -32,53 +12,22 @@
|
||||
"description": "This tool allows you to reverse the order of items in a list. You can reverse the entire list or each line separately."
|
||||
}
|
||||
},
|
||||
"sort": {
|
||||
"title": "Sort List",
|
||||
"description": "Sort list items in ascending or descending order.",
|
||||
"inputTitle": "Input list",
|
||||
"resultTitle": "Sorted list",
|
||||
"sortOptions": "Sort Options",
|
||||
"sortOrder": "Sort Order",
|
||||
"ascending": "Ascending",
|
||||
"descending": "Descending",
|
||||
"sortType": "Sort Type",
|
||||
"alphabetical": "Alphabetical",
|
||||
"numerical": "Numerical",
|
||||
"natural": "Natural",
|
||||
"toolInfo": {
|
||||
"title": "Sort List",
|
||||
"description": "This tool allows you to sort list items in various orders and types. You can sort alphabetically, numerically, or using natural sorting."
|
||||
}
|
||||
},
|
||||
"duplicate": {
|
||||
"title": "Find Duplicates",
|
||||
"description": "Find and remove duplicate items from a list.",
|
||||
"inputTitle": "Input list",
|
||||
"resultTitle": "Unique list",
|
||||
"duplicateOptions": "Duplicate Options",
|
||||
"removeDuplicates": "Remove Duplicates",
|
||||
"removeDuplicatesDescription": "Remove duplicate items from the list",
|
||||
"showDuplicates": "Show Duplicates",
|
||||
"showDuplicatesDescription": "Show only the duplicate items",
|
||||
"toolInfo": {
|
||||
"title": "Find Duplicates",
|
||||
"description": "This tool allows you to find and handle duplicate items in a list. You can remove duplicates or show only the duplicate items."
|
||||
}
|
||||
},
|
||||
"findUnique": {
|
||||
"title": "Find Unique",
|
||||
"description": "Find unique items in a list.",
|
||||
"inputTitle": "Input list",
|
||||
"resultTitle": "Unique items",
|
||||
"uniqueOptions": "Unique Options",
|
||||
"showUnique": "Show Unique",
|
||||
"showUniqueDescription": "Show only unique items",
|
||||
"showDuplicates": "Show Duplicates",
|
||||
"showDuplicatesDescription": "Show only duplicate items",
|
||||
"toolInfo": {
|
||||
"title": "Find Unique",
|
||||
"description": "This tool allows you to find unique items in a list. You can show unique items or duplicate items."
|
||||
}
|
||||
"inputTitle": "Input List",
|
||||
"resultTitle": "Unique Items",
|
||||
"inputListDelimiter": "Input List Delimiter",
|
||||
"delimiterDescription": "Set a delimiting symbol or regular expression.",
|
||||
"outputListDelimiter": "Output List Delimiter",
|
||||
"trimItems": "Trim List Items",
|
||||
"trimItemsDescription": "Remove leading and trailing spaces before comparing items.",
|
||||
"skipEmptyItems": "Skip Empty Items",
|
||||
"skipEmptyItemsDescription": "Don't include the empty list items in the output.",
|
||||
"uniqueItemOptions": "Unique Item Options",
|
||||
"findAbsolutelyUniqueItems": "Find Absolutely Unique Items",
|
||||
"findAbsolutelyUniqueItemsDescription": "Display only those items of the list that exist in a single copy.",
|
||||
"caseSensitiveItems": "Case Sensitive Items",
|
||||
"caseSensitiveItemsDescription": "Output items with different case as unique elements in the list."
|
||||
},
|
||||
"shuffle": {
|
||||
"title": "Shuffle List",
|
||||
@@ -111,5 +60,104 @@
|
||||
"title": "List Wrapping",
|
||||
"description": "This tool allows you to add text before and after each item in a list. You can specify different text for the left and right sides, and control how the list is processed. It's useful for adding quotes, brackets, or other formatting to list items, preparing data for different formats, or creating structured text."
|
||||
}
|
||||
},
|
||||
"sort": {
|
||||
"inputTitle": "Input list",
|
||||
"resultTitle": "Sorted list",
|
||||
"inputItemSeparator": "Input item separator",
|
||||
"splitSeparatorDescription": "Set a delimiting symbol or regular expression.",
|
||||
"splitOperators": {
|
||||
"symbol": {
|
||||
"title": "Use a Symbol for Splitting",
|
||||
"description": "Delimit input list items with a character."
|
||||
},
|
||||
"regex": {
|
||||
"title": "Use a Regex for Splitting",
|
||||
"description": "Delimit input list items with a regular expression."
|
||||
}
|
||||
},
|
||||
"sortMethod": "Sort method",
|
||||
"sortMethodDescription": "Select a sorting method.",
|
||||
"sortOptions": {
|
||||
"alphabetic": "Sort Alphabetically",
|
||||
"numeric": "Sort Numerically",
|
||||
"length": "Sort by Length"
|
||||
},
|
||||
"orderDescription": "Select a sorting order.",
|
||||
"orderOptions": {
|
||||
"increasing": "Increasing order",
|
||||
"decreasing": "Decreasing order"
|
||||
},
|
||||
"caseSensitive": "Case Sensitive Sort",
|
||||
"caseSensitiveDescription": "Sort uppercase and lowercase items separately. Capital letters precede lowercase letters in an ascending list. (Works only in alphabetical sorting mode.)",
|
||||
"sortedItemProperties": "Sorted item properties",
|
||||
"joinSeparatorDescription": "Use this symbol as a joiner between items in a sorted list.",
|
||||
"removeDuplicates": "Remove duplicates",
|
||||
"removeDuplicatesDescription": "Delete duplicate list items."
|
||||
},
|
||||
"group": {
|
||||
"inputTitle": "Input list",
|
||||
"resultTitle": "Grouped items",
|
||||
"inputItemSeparator": "Input Item Separator",
|
||||
"splitSeparatorDescription": "Set a delimiting symbol or regular expression.",
|
||||
"splitOperators": {
|
||||
"symbol": {
|
||||
"title": "Use a Symbol for Splitting",
|
||||
"description": "Delimit input list items with a character."
|
||||
},
|
||||
"regex": {
|
||||
"title": "Use a Regex for Splitting",
|
||||
"description": "Delimit input list items with a regular expression."
|
||||
}
|
||||
},
|
||||
"groupSizeAndSeparators": "Group Size and Separators",
|
||||
"groupNumberDescription": "Number of items in a group",
|
||||
"itemSeparatorDescription": "Item separator character",
|
||||
"groupSeparatorDescription": "Group separator character",
|
||||
"leftWrapDescription": "Group's left wrap symbol.",
|
||||
"rightWrapDescription": "Group's right wrap symbol.",
|
||||
"emptyItemsAndPadding": "Empty Items and Padding",
|
||||
"deleteEmptyItems": "Delete Empty Items",
|
||||
"deleteEmptyItemsDescription": "Ignore empty items and don't include them in the groups.",
|
||||
"padNonFullGroups": "Pad Non-full Groups",
|
||||
"padNonFullGroupsDescription": "Fill non-full groups with a custom item (enter below).",
|
||||
"paddingCharDescription": "Use this character or item to pad non-full groups."
|
||||
},
|
||||
"duplicate": {
|
||||
"toolInfo": {
|
||||
"title": "List Duplication",
|
||||
"description": "This tool allows you to duplicate items in a list. You can specify the number of copies (including fractional values), control whether items are concatenated or interweaved, and even reverse the duplicated items. It's useful for creating repeated patterns, generating test data, or expanding lists with predictable content."
|
||||
},
|
||||
"inputTitle": "Input List",
|
||||
"resultTitle": "Duplicated List",
|
||||
"splitOptions": "Split Options",
|
||||
"splitBySymbol": "Split by Symbol",
|
||||
"splitByRegex": "Split by Regular Expression",
|
||||
"splitSeparatorDescription": "Separator to split the list",
|
||||
"joinSeparatorDescription": "Separator to join the duplicated list",
|
||||
"duplicationOptions": "Duplication Options",
|
||||
"copyDescription": "Number of copies (can be fractional)",
|
||||
"concatenate": "Concatenate",
|
||||
"concatenateDescription": "Concatenate copies (if unchecked, items will be interweaved)",
|
||||
"reverse": "Reverse",
|
||||
"reverseDescription": "Reverse the duplicated items",
|
||||
"examples": {
|
||||
"simple": {
|
||||
"title": "Simple duplication",
|
||||
"description": "This example shows how to duplicate a list of words."
|
||||
},
|
||||
"reverse": {
|
||||
"title": "Reverse duplication",
|
||||
"description": "This example shows how to duplicate a list in reverse order."
|
||||
},
|
||||
"interweave": {
|
||||
"title": "Interweaving items",
|
||||
"description": "This example shows how to interweave items instead of concatenating them."
|
||||
},
|
||||
"fractional": {
|
||||
"title": "Fractional duplication",
|
||||
"description": "This example shows how to duplicate a list with a fractional number of copies."
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ argument`,
|
||||
];
|
||||
|
||||
export default function Reverse({ title }: ToolComponentProps) {
|
||||
const { t } = useTranslation();
|
||||
const { t } = useTranslation('list');
|
||||
const [input, setInput] = useState<string>('');
|
||||
const [result, setResult] = useState<string>('');
|
||||
|
||||
@@ -121,7 +121,7 @@ export default function Reverse({ title }: ToolComponentProps) {
|
||||
updateField
|
||||
}) => [
|
||||
{
|
||||
title: t('list:reverse.splitterMode'),
|
||||
title: t('reverse.splitterMode'),
|
||||
component: (
|
||||
<Box>
|
||||
{splitOperators.map(({ title, description, type }) => (
|
||||
@@ -137,11 +137,11 @@ export default function Reverse({ title }: ToolComponentProps) {
|
||||
)
|
||||
},
|
||||
{
|
||||
title: t('list:reverse.itemSeparator'),
|
||||
title: t('reverse.itemSeparator'),
|
||||
component: (
|
||||
<Box>
|
||||
<TextFieldWithDesc
|
||||
description={t('list:reverse.itemSeparatorDescription')}
|
||||
description={t('reverse.itemSeparatorDescription')}
|
||||
value={values.splitSeparator}
|
||||
onOwnChange={(val) => updateField('splitSeparator', val)}
|
||||
/>
|
||||
@@ -149,11 +149,11 @@ export default function Reverse({ title }: ToolComponentProps) {
|
||||
)
|
||||
},
|
||||
{
|
||||
title: t('list:reverse.outputListOptions'),
|
||||
title: t('reverse.outputListOptions'),
|
||||
component: (
|
||||
<Box>
|
||||
<TextFieldWithDesc
|
||||
description={t('list:reverse.outputSeparatorDescription')}
|
||||
description={t('reverse.outputSeparatorDescription')}
|
||||
value={values.joinSeparator}
|
||||
onOwnChange={(val) => updateField('joinSeparator', val)}
|
||||
/>
|
||||
@@ -179,17 +179,17 @@ export default function Reverse({ title }: ToolComponentProps) {
|
||||
setInput={setInput}
|
||||
inputComponent={
|
||||
<ToolTextInput
|
||||
title={t('list:reverse.inputTitle')}
|
||||
title={t('reverse.inputTitle')}
|
||||
value={input}
|
||||
onChange={setInput}
|
||||
/>
|
||||
}
|
||||
resultComponent={
|
||||
<ToolTextResult title={t('list:reverse.resultTitle')} value={result} />
|
||||
<ToolTextResult title={t('reverse.resultTitle')} value={result} />
|
||||
}
|
||||
toolInfo={{
|
||||
title: t('list:reverse.toolInfo.title'),
|
||||
description: t('list:reverse.toolInfo.description')
|
||||
title: t('reverse.toolInfo.title'),
|
||||
description: t('reverse.toolInfo.description')
|
||||
}}
|
||||
exampleCards={exampleCards}
|
||||
/>
|
||||
|
||||
@@ -33,7 +33,7 @@ const splitOperators: {
|
||||
];
|
||||
|
||||
export default function Shuffle() {
|
||||
const { t } = useTranslation();
|
||||
const { t } = useTranslation('list');
|
||||
const [input, setInput] = useState<string>('');
|
||||
const [result, setResult] = useState<string>('');
|
||||
const compute = (optionsValues: typeof initialValues, input: any) => {
|
||||
@@ -53,24 +53,24 @@ export default function Shuffle() {
|
||||
|
||||
return (
|
||||
<ToolContent
|
||||
title={t('list:shuffle.title')}
|
||||
title={t('shuffle.title')}
|
||||
initialValues={initialValues}
|
||||
compute={compute}
|
||||
input={input}
|
||||
setInput={setInput}
|
||||
inputComponent={
|
||||
<ToolTextInput
|
||||
title={t('list:shuffle.inputTitle')}
|
||||
title={t('shuffle.inputTitle')}
|
||||
value={input}
|
||||
onChange={setInput}
|
||||
/>
|
||||
}
|
||||
resultComponent={
|
||||
<ToolTextResult title={t('list:shuffle.resultTitle')} value={result} />
|
||||
<ToolTextResult title={t('shuffle.resultTitle')} value={result} />
|
||||
}
|
||||
getGroups={({ values, updateField }) => [
|
||||
{
|
||||
title: t('list:shuffle.inputListSeparator'),
|
||||
title: t('shuffle.inputListSeparator'),
|
||||
component: (
|
||||
<Box>
|
||||
{splitOperators.map(({ title, description, type }) => (
|
||||
@@ -83,7 +83,7 @@ export default function Shuffle() {
|
||||
/>
|
||||
))}
|
||||
<TextFieldWithDesc
|
||||
description={t('list:shuffle.delimiterDescription')}
|
||||
description={t('shuffle.delimiterDescription')}
|
||||
value={values.splitSeparator}
|
||||
onOwnChange={(val) => updateField('splitSeparator', val)}
|
||||
/>
|
||||
@@ -91,11 +91,11 @@ export default function Shuffle() {
|
||||
)
|
||||
},
|
||||
{
|
||||
title: t('list:shuffle.shuffledListLength'),
|
||||
title: t('shuffle.shuffledListLength'),
|
||||
component: (
|
||||
<Box>
|
||||
<TextFieldWithDesc
|
||||
description={t('list:shuffle.outputLengthDescription')}
|
||||
description={t('shuffle.outputLengthDescription')}
|
||||
value={values.length}
|
||||
onOwnChange={(val) => updateField('length', val)}
|
||||
/>
|
||||
@@ -103,13 +103,13 @@ export default function Shuffle() {
|
||||
)
|
||||
},
|
||||
{
|
||||
title: t('list:shuffle.shuffledListSeparator'),
|
||||
title: t('shuffle.shuffledListSeparator'),
|
||||
component: (
|
||||
<Box>
|
||||
<TextFieldWithDesc
|
||||
value={values.joinSeparator}
|
||||
onOwnChange={(value) => updateField('joinSeparator', value)}
|
||||
description={t('list:shuffle.joinSeparatorDescription')}
|
||||
description={t('shuffle.joinSeparatorDescription')}
|
||||
/>
|
||||
</Box>
|
||||
)
|
||||
|
||||
@@ -37,8 +37,8 @@ const splitOperators: {
|
||||
}
|
||||
];
|
||||
|
||||
export default function SplitText({ title }: ToolComponentProps) {
|
||||
const { t } = useTranslation();
|
||||
export default function SortList({ title }: ToolComponentProps) {
|
||||
const { t } = useTranslation('list');
|
||||
const [input, setInput] = useState<string>('');
|
||||
const [result, setResult] = useState<string>('');
|
||||
const compute = (optionsValues: typeof initialValues, input: any) => {
|
||||
@@ -72,33 +72,31 @@ export default function SplitText({ title }: ToolComponentProps) {
|
||||
input={input}
|
||||
inputComponent={
|
||||
<ToolTextInput
|
||||
title={t('list:sort.inputTitle')}
|
||||
title={t('sort.inputTitle')}
|
||||
value={input}
|
||||
onChange={setInput}
|
||||
/>
|
||||
}
|
||||
resultComponent={
|
||||
<ToolTextResult title={t('list:sort.resultTitle')} value={result} />
|
||||
<ToolTextResult title={t('sort.resultTitle')} value={result} />
|
||||
}
|
||||
initialValues={initialValues}
|
||||
getGroups={({ values, updateField }) => [
|
||||
{
|
||||
title: t('list:sort.inputItemSeparator'),
|
||||
title: t('sort.inputItemSeparator'),
|
||||
component: (
|
||||
<Box>
|
||||
{splitOperators.map(({ title, description, type }) => (
|
||||
<SimpleRadio
|
||||
key={type}
|
||||
onClick={() => updateField('splitSeparatorType', type)}
|
||||
title={t(`list.sort.splitOperators.${type}.title`)}
|
||||
description={t(
|
||||
`list.sort.splitOperators.${type}.description`
|
||||
)}
|
||||
title={t(`sort.splitOperators.${type}.title`)}
|
||||
description={t(`sort.splitOperators.${type}.description`)}
|
||||
checked={values.splitSeparatorType === type}
|
||||
/>
|
||||
))}
|
||||
<TextFieldWithDesc
|
||||
description={t('list:sort.splitSeparatorDescription')}
|
||||
description={t('sort.splitSeparatorDescription')}
|
||||
value={values.splitSeparator}
|
||||
onOwnChange={(val) => updateField('splitSeparator', val)}
|
||||
/>
|
||||
@@ -106,45 +104,45 @@ export default function SplitText({ title }: ToolComponentProps) {
|
||||
)
|
||||
},
|
||||
{
|
||||
title: t('list:sort.sortMethod'),
|
||||
title: t('sort.sortMethod'),
|
||||
component: (
|
||||
<Box>
|
||||
<SelectWithDesc
|
||||
selected={values.sortingMethod}
|
||||
options={[
|
||||
{
|
||||
label: t('list:sort.sortOptions.alphabetic'),
|
||||
label: t('sort.sortOptions.alphabetic'),
|
||||
value: 'alphabetic'
|
||||
},
|
||||
{
|
||||
label: t('list:sort.sortOptions.numeric'),
|
||||
label: t('sort.sortOptions.numeric'),
|
||||
value: 'numeric'
|
||||
},
|
||||
{ label: t('list:sort.sortOptions.length'), value: 'length' }
|
||||
{ label: t('sort.sortOptions.length'), value: 'length' }
|
||||
]}
|
||||
onChange={(value) => updateField('sortingMethod', value)}
|
||||
description={t('list:sort.sortMethodDescription')}
|
||||
description={t('sort.sortMethodDescription')}
|
||||
/>
|
||||
<SelectWithDesc
|
||||
selected={values.increasing}
|
||||
options={[
|
||||
{
|
||||
label: t('list:sort.orderOptions.increasing'),
|
||||
label: t('sort.orderOptions.increasing'),
|
||||
value: true
|
||||
},
|
||||
{
|
||||
label: t('list:sort.orderOptions.decreasing'),
|
||||
label: t('sort.orderOptions.decreasing'),
|
||||
value: false
|
||||
}
|
||||
]}
|
||||
onChange={(value) => {
|
||||
updateField('increasing', value);
|
||||
}}
|
||||
description={t('list:sort.orderDescription')}
|
||||
description={t('sort.orderDescription')}
|
||||
/>
|
||||
<CheckboxWithDesc
|
||||
title={t('list:sort.caseSensitive')}
|
||||
description={t('list:sort.caseSensitiveDescription')}
|
||||
title={t('sort.caseSensitive')}
|
||||
description={t('sort.caseSensitiveDescription')}
|
||||
checked={values.caseSensitive}
|
||||
onChange={(val) => updateField('caseSensitive', val)}
|
||||
/>
|
||||
@@ -152,17 +150,17 @@ export default function SplitText({ title }: ToolComponentProps) {
|
||||
)
|
||||
},
|
||||
{
|
||||
title: t('list:sort.sortedItemProperties'),
|
||||
title: t('sort.sortedItemProperties'),
|
||||
component: (
|
||||
<Box>
|
||||
<TextFieldWithDesc
|
||||
description={t('list:sort.joinSeparatorDescription')}
|
||||
description={t('sort.joinSeparatorDescription')}
|
||||
value={values.joinSeparator}
|
||||
onOwnChange={(val) => updateField('joinSeparator', val)}
|
||||
/>
|
||||
<CheckboxWithDesc
|
||||
title={t('list:sort.removeDuplicates')}
|
||||
description={t('list:sort.removeDuplicatesDescription')}
|
||||
title={t('sort.removeDuplicates')}
|
||||
description={t('sort.removeDuplicatesDescription')}
|
||||
checked={values.removeDuplicated}
|
||||
onChange={(val) => updateField('removeDuplicated', val)}
|
||||
/>
|
||||
|
||||
@@ -86,7 +86,7 @@ const exampleCards: CardExampleType<InitialValuesType>[] = [
|
||||
];
|
||||
|
||||
export default function Wrap({ title }: ToolComponentProps) {
|
||||
const { t } = useTranslation();
|
||||
const { t } = useTranslation('list');
|
||||
const [input, setInput] = useState<string>('');
|
||||
const [result, setResult] = useState<string>('');
|
||||
|
||||
@@ -119,50 +119,50 @@ export default function Wrap({ title }: ToolComponentProps) {
|
||||
updateField
|
||||
}) => [
|
||||
{
|
||||
title: t('list:wrap.splitOptions'),
|
||||
title: t('wrap.splitOptions'),
|
||||
component: (
|
||||
<Box>
|
||||
<SimpleRadio
|
||||
onClick={() => updateField('splitOperatorType', 'symbol')}
|
||||
checked={values.splitOperatorType === 'symbol'}
|
||||
title={t('list:wrap.splitBySymbol')}
|
||||
title={t('wrap.splitBySymbol')}
|
||||
/>
|
||||
<SimpleRadio
|
||||
onClick={() => updateField('splitOperatorType', 'regex')}
|
||||
checked={values.splitOperatorType === 'regex'}
|
||||
title={t('list:wrap.splitByRegex')}
|
||||
title={t('wrap.splitByRegex')}
|
||||
/>
|
||||
<TextFieldWithDesc
|
||||
value={values.splitSeparator}
|
||||
onOwnChange={(val) => updateField('splitSeparator', val)}
|
||||
description={t('list:wrap.splitSeparatorDescription')}
|
||||
description={t('wrap.splitSeparatorDescription')}
|
||||
/>
|
||||
<TextFieldWithDesc
|
||||
value={values.joinSeparator}
|
||||
onOwnChange={(val) => updateField('joinSeparator', val)}
|
||||
description={t('list:wrap.joinSeparatorDescription')}
|
||||
description={t('wrap.joinSeparatorDescription')}
|
||||
/>
|
||||
<CheckboxWithDesc
|
||||
checked={values.deleteEmptyItems}
|
||||
onChange={(checked) => updateField('deleteEmptyItems', checked)}
|
||||
title={t('list:wrap.removeEmptyItems')}
|
||||
title={t('wrap.removeEmptyItems')}
|
||||
/>
|
||||
</Box>
|
||||
)
|
||||
},
|
||||
{
|
||||
title: t('list:wrap.wrapOptions'),
|
||||
title: t('wrap.wrapOptions'),
|
||||
component: (
|
||||
<Box>
|
||||
<TextFieldWithDesc
|
||||
value={values.left}
|
||||
onOwnChange={(val) => updateField('left', val)}
|
||||
description={t('list:wrap.leftTextDescription')}
|
||||
description={t('wrap.leftTextDescription')}
|
||||
/>
|
||||
<TextFieldWithDesc
|
||||
value={values.right}
|
||||
onOwnChange={(val) => updateField('right', val)}
|
||||
description={t('list:wrap.rightTextDescription')}
|
||||
description={t('wrap.rightTextDescription')}
|
||||
/>
|
||||
</Box>
|
||||
)
|
||||
@@ -174,20 +174,20 @@ export default function Wrap({ title }: ToolComponentProps) {
|
||||
title={title}
|
||||
inputComponent={
|
||||
<ToolTextInput
|
||||
title={t('list:wrap.inputTitle')}
|
||||
title={t('wrap.inputTitle')}
|
||||
value={input}
|
||||
onChange={setInput}
|
||||
/>
|
||||
}
|
||||
resultComponent={
|
||||
<ToolTextResult title={t('list:wrap.resultTitle')} value={result} />
|
||||
<ToolTextResult title={t('wrap.resultTitle')} value={result} />
|
||||
}
|
||||
initialValues={initialValues}
|
||||
getGroups={getGroups}
|
||||
validationSchema={validationSchema}
|
||||
toolInfo={{
|
||||
title: t('list:wrap.toolInfo.title'),
|
||||
description: t('list:wrap.toolInfo.description')
|
||||
title: t('wrap.toolInfo.title'),
|
||||
description: t('wrap.toolInfo.description')
|
||||
}}
|
||||
exampleCards={exampleCards}
|
||||
input={input}
|
||||
|
||||
Reference in New Issue
Block a user